Re: [PATCH] clocksource: fix read and iounmap of incorrect variable

2017-06-09 Thread Fu Wei
emap(frame->cntbase). > > Fixes: c389d701dfb70 ("clocksource: arm_arch_timer: split MMIO timer > probing.") > > Signed-off-by: Frank Rowand Reviewed-by: Fu Wei > --- > > WARNING: CPU: 0 PID: 0 at mm/vmalloc.c:1514 iounmap+0x14/0x18 > Trying to vfree() nonexistent

Re: [GIT PULL 00/16] clocksource: arm_arch_timer: GTDT-based MMIO timer support

2017-04-20 Thread Fu Wei
een addressed. > >> Hi Thomas, >> >> the series is ok for me. Is it possible to pull these changes directly in >> tip/timers/core? > > The tip-bot tells me it was. > > Many thanks for picking these up, it's much appreciated. Great thanks to all of you, I very appreciate all the help and suggestion from you :-) > > Mark. -- Best regards, Fu Wei Software Engineer Red Hat

[PATCH v24 10/11] clocksource: arm_arch_timer: add GTDT support for memory-mapped timer

2017-04-14 Thread fu . wei
From: Fu Wei The patch add memory-mapped timer register support by using the information provided by the new GTDT driver of ACPI. Signed-off-by: Fu Wei Reviewed-by: Hanjun Guo [Mark: verify CNTFRQ, only register the first frame] Signed-off-by: Mark Rutland --- drivers/clocksource

[PATCH v24 11/11] acpi/arm64: Add SBSA Generic Watchdog support in GTDT driver

2017-04-14 Thread fu . wei
From: Fu Wei This driver adds support for parsing SBSA Generic Watchdog timer in GTDT, parse all info in SBSA Generic Watchdog Structure in GTDT, and creating a platform device with that information. This allows the operating system to obtain device data from the resource of platform device

[PATCH v24 09/11] acpi/arm64: Add memory-mapped timer support in GTDT driver

2017-04-14 Thread fu . wei
From: Fu Wei On platforms booting with ACPI, architected memory-mapped timers' configuration data is provided by firmware through the ACPI GTDT static table. The clocksource architected timer kernel driver requires a firmware interface to collect timer configuration and configure its d

[PATCH v24 08/11] acpi: Introduce acpi_unregister_irq function

2017-04-14 Thread fu . wei
From: Fu Wei This patch introduces acpi_unregister_irq function to free a linux IRQ number<->GSI mapping by a given linux IRQ number. Even we have successfully registered the GSI, when some error occurs, we may need to unmap it for freeing the IRQ resource. But in some cases, we only ha

[PATCH v24 05/11] clocksource: arm_arch_timer: split MMIO timer probing.

2017-04-14 Thread fu . wei
From: Fu Wei Currently the code to probe MMIO architected timers mixes DT parsing with actual poking of hardware. This makes the code harder than necessary to understand, and makes it difficult to add support for probing via ACPI. This patch splits the DT parsing from HW probing. The DT parsing

[PATCH v24 07/11] clocksource: arm_arch_timer: simplify ACPI support code.

2017-04-14 Thread fu . wei
From: Fu Wei The patch update arm_arch_timer driver to use the function provided by the new GTDT driver of ACPI. By this way, arm_arch_timer.c can be simplified, and separate all the ACPI GTDT knowledge from this timer driver. Signed-off-by: Fu Wei Signed-off-by: Hanjun Guo Tested-by

[PATCH v24 06/11] acpi/arm64: Add GTDT table parse driver

2017-04-14 Thread fu . wei
From: Fu Wei This patch adds support for parsing arch timer info in GTDT, provides some kernel APIs to parse all the PPIs and always-on info in GTDT and export them. By this driver, we can simplify arm_arch_timer drivers, and separate the ACPI GTDT knowledge from it. Signed-off-by: Fu Wei

[PATCH v24 03/11] clocksource: arm_arch_timer: move arch_timer_needs_of_probing into DT init call

2017-04-14 Thread fu . wei
From: Fu Wei To cleanly split code paths specific to ACPI or DT at a higher level, this patch removes arch_timer_init(), folding the relevant parts of its logic into existing callers. This paths the way for further rework, and saves a few lines. Signed-off-by: Fu Wei Reviewed-by: Hanjun Guo

[PATCH v24 04/11] clocksource: arm_arch_timer: add structs to describe MMIO timer

2017-04-14 Thread fu . wei
From: Fu Wei In preparation for ACPI GTDT support, this patch adds structs to describe the MMIO timers indepedent of the firmware interface. Subsequent patches will use these to split the FW/HW probing logic, so that the HW probing logic can be shared by ACPI and DT. Signed-off-by: Fu Wei

[PATCH v24 02/11] clocksource: arm_arch_timer: refactor arch_timer_needs_probing

2017-04-14 Thread fu . wei
From: Fu Wei When booting with DT, it's possible for timer nodes to be probed in any order. Some common initialisation needs to occur after all nodes have been probed, and arch_timer_common_init() has code to detect when this has happened. This logic is DT-specific, and it would be be

[PATCH v24 01/11] clocksource: arm_arch_timer: split dt-only rate handling

2017-04-14 Thread fu . wei
From: Fu Wei For historical reasons, rate detection when probing via DT is somewhat convoluted. We tried to package this up in arch_timer_detect_rate(), but with the addition of ACPI worse, and gets in the way of stringent rate checking when ACPI is used. This patch makes arch_timer_detect_rate

[PATCH v24 00/11] acpi, clocksource: add GTDT driver and GTDT support in arm_arch_timer

2017-04-14 Thread fu . wei
From: Fu Wei This patchset: (1)Preparation for adding GTDT support in arm_arch_timer: 1. Introduce a MMIO CNTFRQ helper. 2. separate out device-tree code from arch_timer_detect_rate 3. replace arch_timer_detect_rate with arch_timer_of_configure_rate 4

Re: [PATCH v23 09/11] acpi/arm64: Add memory-mapped timer support in GTDT driver

2017-04-06 Thread Fu Wei
Hi Mark, On 7 April 2017 at 01:52, Mark Rutland wrote: > On Fri, Apr 07, 2017 at 01:39:09AM +0800, Fu Wei wrote: >> On 7 April 2017 at 01:24, Mark Rutland wrote: >> > On Fri, Apr 07, 2017 at 12:47:47AM +0800, Fu Wei wrote: >> >> On 6 April 2017 at 02:38, Mark Rutla

Re: [PATCH v23 09/11] acpi/arm64: Add memory-mapped timer support in GTDT driver

2017-04-06 Thread Fu Wei
Hi Mark On 7 April 2017 at 01:24, Mark Rutland wrote: > On Fri, Apr 07, 2017 at 12:47:47AM +0800, Fu Wei wrote: >> On 6 April 2017 at 02:38, Mark Rutland wrote: >> > On Sat, Apr 01, 2017 at 01:51:03AM +0800, fu@linaro.org wrote: >> >> + /* >> >>

Re: [PATCH v23 09/11] acpi/arm64: Add memory-mapped timer support in GTDT driver

2017-04-06 Thread Fu Wei
Hi Lorenzo, On 3 April 2017 at 18:45, Lorenzo Pieralisi wrote: > On Sat, Apr 01, 2017 at 01:51:03AM +0800, fu@linaro.org wrote: >> From: Fu Wei >> >> On platforms booting with ACPI, architected memory-mapped timers' >> configuration data is provided b

Re: [PATCH v23 09/11] acpi/arm64: Add memory-mapped timer support in GTDT driver

2017-04-06 Thread Fu Wei
+ return ret; >> + timer_mem++; >> + (*timer_count)++; >> + } >> + } > > If we were to have multiple GT blocks, this would leave timer_mem in an > inconsistent state. In gtdt_parse_timer_block we'll blat any existing > timer_mem->cntctlbase, and blat some arbitrary set of frames. however, > *some* frames may have been held over from a previous iteration. > > My understanding was that the system level timer had a single CNTCTLBase > frame, and hence we should only have a single GT block. > > Judging by ARM DDI 0487A.k_iss10775, I1.3 "Memory-mapped timer > components" and I3.4 "Generic Timer memory-mapped registers overview", > it does appear that the system should only have one CNTCTLBase frame. > > What's going on here? > > Thanks, > Mark. -- Best regards, Fu Wei Software Engineer Red Hat

Re: [PATCH v23 06/11] clocksource: arm_arch_timer: refactor MMIO timer probing.

2017-04-06 Thread Fu Wei
quency.\n"); iounmap(base); return -EINVAL; } Please correct me, if I miss something. Thanks :-) > > Thanks, > Mark. -- Best regards, Fu Wei Software Engineer Red Hat

Re: [PATCH v23 00/11] acpi, clocksource: add GTDT driver and GTDT support in arm_arch_timer

2017-03-31 Thread Fu Wei
Hi Xiongfeng Wang, On 1 April 2017 at 10:14, Xiongfeng Wang wrote: > > > On 2017/4/1 1:50, fu@linaro.org wrote: >> From: Fu Wei >> >> This patchset: >> (1)Preparation for adding GTDT support in arm_arch_timer: >> 1. Introduce a MMIO CN

Re: [PATCH v22 00/11] acpi, clocksource: add GTDT driver and GTDT support in arm_arch_timer

2017-03-31 Thread Fu Wei
Hi Mark, On 28 March 2017 at 22:53, Mark Rutland wrote: > Hi, > > On Tue, Mar 28, 2017 at 10:29:10PM +0800, Fu Wei wrote: >> On 28 March 2017 at 21:05, Mark Rutland wrote: >> > Sorry for the delay; I have not had the time to focus on this as I would >> > like to

[PATCH v23 11/11] acpi/arm64: Add SBSA Generic Watchdog support in GTDT driver

2017-03-31 Thread fu . wei
From: Fu Wei This driver adds support for parsing SBSA Generic Watchdog timer in GTDT, parse all info in SBSA Generic Watchdog Structure in GTDT, and creating a platform device with that information. This allows the operating system to obtain device data from the resource of platform device

[PATCH v23 10/11] clocksource: arm_arch_timer: add GTDT support for memory-mapped timer

2017-03-31 Thread fu . wei
From: Fu Wei The patch add memory-mapped timer register support by using the information provided by the new GTDT driver of ACPI. Signed-off-by: Fu Wei Reviewed-by: Hanjun Guo --- drivers/clocksource/arm_arch_timer.c | 35 --- 1 file changed, 32 insertions

[PATCH v23 09/11] acpi/arm64: Add memory-mapped timer support in GTDT driver

2017-03-31 Thread fu . wei
From: Fu Wei On platforms booting with ACPI, architected memory-mapped timers' configuration data is provided by firmware through the ACPI GTDT static table. The clocksource architected timer kernel driver requires a firmware interface to collect timer configuration and configure its d

[PATCH v23 08/11] clocksource: arm_arch_timer: simplify ACPI support code.

2017-03-31 Thread fu . wei
From: Fu Wei The patch update arm_arch_timer driver to use the function provided by the new GTDT driver of ACPI. By this way, arm_arch_timer.c can be simplified, and separate all the ACPI GTDT knowledge from this timer driver. Signed-off-by: Fu Wei Signed-off-by: Hanjun Guo Tested-by

[PATCH v23 07/11] acpi/arm64: Add GTDT table parse driver

2017-03-31 Thread fu . wei
From: Fu Wei This patch adds support for parsing arch timer info in GTDT, provides some kernel APIs to parse all the PPIs and always-on info in GTDT and export them. By this driver, we can simplify arm_arch_timer drivers, and separate the ACPI GTDT knowledge from it. Signed-off-by: Fu Wei

[PATCH v23 06/11] clocksource: arm_arch_timer: refactor MMIO timer probing.

2017-03-31 Thread fu . wei
From: Fu Wei Currently the code to probe MMIO architected timers mixes DT parsing with actual poking of hardware. This makes the code harder than necessary to understand, and makes it difficult to add support for probing via ACPI. This patch factors all the DT-specific logic out of

[PATCH v23 05/11] clocksource: arm_arch_timer: add structs to describe MMIO timer

2017-03-31 Thread fu . wei
From: Fu Wei In preparation for ACPI GTDT support, this patch adds structs to describe the MMIO timers indepedent of the firmware interface. Subsequent patches will use these to split the FW/HW probing logic, so that the HW probing logic can be shared by ACPI and DT. [Mark: reword commit

[PATCH v23 03/11] clocksource: arm_arch_timer: refactor arch_timer_needs_probing

2017-03-31 Thread fu . wei
From: Fu Wei When booting with DT, it's possible for timer nodes to be probed in any order. Some common initialisation needs to occur after all nodes have been probed, and arch_timer_common_init() has code to detect when this has happened. This logic is DT-specific, and it would be be

[PATCH v23 04/11] clocksource: arm_arch_timer: move arch_timer_needs_of_probing into DT init call

2017-03-31 Thread fu . wei
From: Fu Wei To cleanly split code paths specific to ACPI or DT at a higher level, this patch removes arch_timer_init(), folding the relevant parts of its logic into existing callers. This patches the way for further rework, and saves a few lines. Signed-off-by: Fu Wei Reviewed-by: Hanjun Guo

[PATCH v23 00/11] acpi, clocksource: add GTDT driver and GTDT support in arm_arch_timer

2017-03-31 Thread fu . wei
From: Fu Wei This patchset: (1)Preparation for adding GTDT support in arm_arch_timer: 1. Introduce a MMIO CNTFRQ helper. 2. separate out device-tree code from arch_timer_detect_rate 3. remove arch_timer_detect_rate use arch_timer_*get_cntfrq directly 4

[PATCH v23 01/11] clocksource: arm_arch_timer: add MMIO CNTFRQ helper

2017-03-31 Thread fu . wei
From: Fu Wei We currently open-code the readl() for the MMIO time frequency. To avoid duplicating the logic with future rework, this patch adds a helepr to read the MMIO timer frequency, mirroring what we have for the sysreg timer frequency. Signed-off-by: Fu Wei [Mark: reword commit message

[PATCH v23 02/11] clocksource: arm_arch_timer: split dt-only rate handling

2017-03-31 Thread fu . wei
From: Fu Wei Currently Currently arch_timer_detect_rate() tried to handle both the sysreg timer and MMIO timer, with DT-specific fallback code. This gets in the way of implementing deterministic and correct rate probing when using ACPI. This patch moves this logic out into the (DT-specific

Re: [PATCH v22 11/11] acpi/arm64: Add SBSA Generic Watchdog support in GTDT driver

2017-03-31 Thread Fu Wei
Hi Lorenzo, On 28 March 2017 at 23:41, Lorenzo Pieralisi wrote: > On Wed, Mar 22, 2017 at 12:31:22AM +0800, fu@linaro.org wrote: >> From: Fu Wei >> >> This driver adds support for parsing SBSA Generic Watchdog timer >> in GTDT, parse all info in SBSA Generic

Re: [PATCH v22 09/11] acpi/arm64: Add memory-mapped timer support in GTDT driver

2017-03-30 Thread Fu Wei
Hi Lorenzo, On 30 March 2017 at 00:47, Lorenzo Pieralisi wrote: > On Wed, Mar 22, 2017 at 12:31:20AM +0800, fu@linaro.org wrote: >> From: Fu Wei >> >> On platforms booting with ACPI, architected memory-mapped timers' >> configuration data is provided b

Re: [PATCH v22 02/11] clocksource: arm_arch_timer: separate out device-tree code and remove arch_timer_detect_rate

2017-03-29 Thread Fu Wei
On 29 March 2017 at 22:41, Daniel Lezcano wrote: > On Wed, Mar 29, 2017 at 01:11:58PM +0800, Fu Wei wrote: >> Hi Daniel, >> >> On 29 March 2017 at 11:41, Fu Wei wrote: >> > Hi Daniel, >> > >> > Great thanks for your review, allow me to answer your

Re: [PATCH v22 07/11] acpi/arm64: Add GTDT table parse driver

2017-03-29 Thread Fu Wei
On 29 March 2017 at 22:29, Fu Wei wrote: > Hi Lorenzo, > > On 28 March 2017 at 19:35, Lorenzo Pieralisi > wrote: >> On Wed, Mar 22, 2017 at 12:31:18AM +0800, fu@linaro.org wrote: >>> From: Fu Wei >>> >>> This patch adds support for parsing arch

Re: [PATCH v22 07/11] acpi/arm64: Add GTDT table parse driver

2017-03-29 Thread Fu Wei
Hi Lorenzo, On 28 March 2017 at 19:35, Lorenzo Pieralisi wrote: > On Wed, Mar 22, 2017 at 12:31:18AM +0800, fu@linaro.org wrote: >> From: Fu Wei >> >> This patch adds support for parsing arch timer info in GTDT, >> provides some kernel APIs to parse all the PP

Re: [PATCH v22 07/11] acpi/arm64: Add GTDT table parse driver

2017-03-29 Thread Fu Wei
Hi Lorenzo, On 29 March 2017 at 19:33, Lorenzo Pieralisi wrote: > On Wed, Mar 29, 2017 at 06:48:26PM +0800, Fu Wei wrote: >> Hi Lorenzo, >> >> On 29 March 2017 at 18:21, Lorenzo Pieralisi >> wrote: >> > On Wed, Mar 29, 20

Re: [PATCH v22 07/11] acpi/arm64: Add GTDT table parse driver

2017-03-29 Thread Fu Wei
Hi Lorenzo, On 29 March 2017 at 18:21, Lorenzo Pieralisi wrote: > On Wed, Mar 29, 2017 at 05:48:17PM +0800, Fu Wei wrote: > > [...] > >> * @platform_timer_count: It points to a integer variable which is used >> * for storing the n

Re: [PATCH v22 07/11] acpi/arm64: Add GTDT table parse driver

2017-03-29 Thread Fu Wei
fu@linaro.org wrote: >> From: Fu Wei >> >> This patch adds support for parsing arch timer info in GTDT, >> provides some kernel APIs to parse all the PPIs and >> always-on info in GTDT and export them. >> >> By this driver, we can simplify arm_arch

Re: [PATCH v22 02/11] clocksource: arm_arch_timer: separate out device-tree code and remove arch_timer_detect_rate

2017-03-28 Thread Fu Wei
Hi Daniel, On 29 March 2017 at 11:41, Fu Wei wrote: > Hi Daniel, > > Great thanks for your review, allow me to answer your question below: > > On 28 March 2017 at 22:58, Daniel Lezcano wrote: >> On Wed, Mar 22, 2017 at 12:31:13AM +0800, fu@linaro.org wr

Re: [PATCH v22 02/11] clocksource: arm_arch_timer: separate out device-tree code and remove arch_timer_detect_rate

2017-03-28 Thread Fu Wei
Hi Daniel, Great thanks for your review, allow me to answer your question below: On 28 March 2017 at 22:58, Daniel Lezcano wrote: > On Wed, Mar 22, 2017 at 12:31:13AM +0800, fu@linaro.org wrote: >> From: Fu Wei >> >> Currently, the counter frequency detection call(a

Re: [PATCH v22 00/11] acpi, clocksource: add GTDT driver and GTDT support in arm_arch_timer

2017-03-28 Thread Fu Wei
Hi Mark, On 28 March 2017 at 21:05, Mark Rutland wrote: > On Tue, Mar 28, 2017 at 08:34:12PM +0800, Fu Wei wrote: >> Hi Jon, >> >> Thanks for your email >> An hour ago, I just got some feedback from Lorenzo, will update my >> patchset ASAP according to his s

Re: [PATCH v22 00/11] acpi, clocksource: add GTDT driver and GTDT support in arm_arch_timer

2017-03-28 Thread Fu Wei
/gtdt I guess I should rebase my patchset to his gtdt branch for v23. So now, I am waiting for Mark's feedback to move on. On 28 March 2017 at 19:32, Jon Masters wrote: > Anyone got review comments for this series? > > On 03/21/2017 12:31 PM, fu@linaro.org wrote: >> From

[PATCH v22 08/11] clocksource: arm_arch_timer: simplify ACPI support code.

2017-03-21 Thread fu . wei
From: Fu Wei The patch update arm_arch_timer driver to use the function provided by the new GTDT driver of ACPI. By this way, arm_arch_timer.c can be simplified, and separate all the ACPI GTDT knowledge from this timer driver. Signed-off-by: Fu Wei Signed-off-by: Hanjun Guo Tested-by

[PATCH v22 09/11] acpi/arm64: Add memory-mapped timer support in GTDT driver

2017-03-21 Thread fu . wei
From: Fu Wei On platforms booting with ACPI, architected memory-mapped timers' configuration data is provided by firmware through the ACPI GTDT static table. The clocksource architected timer kernel driver requires a firmware interface to collect timer configuration and configure its d

[PATCH v22 07/11] acpi/arm64: Add GTDT table parse driver

2017-03-21 Thread fu . wei
From: Fu Wei This patch adds support for parsing arch timer info in GTDT, provides some kernel APIs to parse all the PPIs and always-on info in GTDT and export them. By this driver, we can simplify arm_arch_timer drivers, and separate the ACPI GTDT knowledge from it. Signed-off-by: Fu Wei

[PATCH v22 10/11] clocksource: arm_arch_timer: add GTDT support for memory-mapped timer

2017-03-21 Thread fu . wei
From: Fu Wei The patch add memory-mapped timer register support by using the information provided by the new GTDT driver of ACPI. Signed-off-by: Fu Wei Reviewed-by: Hanjun Guo --- drivers/clocksource/arm_arch_timer.c | 35 --- 1 file changed, 32 insertions

[PATCH v22 11/11] acpi/arm64: Add SBSA Generic Watchdog support in GTDT driver

2017-03-21 Thread fu . wei
From: Fu Wei This driver adds support for parsing SBSA Generic Watchdog timer in GTDT, parse all info in SBSA Generic Watchdog Structure in GTDT, and creating a platform device with that information. This allows the operating system to obtain device data from the resource of platform device

[PATCH v22 06/11] clocksource: arm_arch_timer: refactor MMIO timer probing.

2017-03-21 Thread fu . wei
From: Fu Wei Currently the code to probe MMIO architected timers mixes DT parsing with actual poking of hardware. This makes the code harder than necessary to understand, and makes it difficult to add support for probing via ACPI. This patch factors all the DT-specific logic out of

[PATCH v22 05/11] clocksource: arm_arch_timer: introduce some new structs to prepare for GTDT

2017-03-21 Thread fu . wei
From: Fu Wei The patch introduce two new structs: arch_timer_mem, arch_timer_mem_frame. And also introduce a new define: ARCH_TIMER_MEM_MAX_FRAMES These will be used for refactoring the memory-mapped timer init code to prepare for GTDT Signed-off-by: Fu Wei Reviewed-by: Hanjun Guo

[PATCH v22 03/11] clocksource: arm_arch_timer: refactor arch_timer_needs_probing

2017-03-21 Thread fu . wei
From: Fu Wei When system init with device-tree, we don't know which node will be initialized first. And the code in arch_timer_common_init should wait until per-cpu timer and MMIO timer are both initialized. So we need arch_timer_needs_probing to detect the init status of system. But curr

[PATCH v22 02/11] clocksource: arm_arch_timer: separate out device-tree code and remove arch_timer_detect_rate

2017-03-21 Thread fu . wei
From: Fu Wei Currently, the counter frequency detection call(arch_timer_detect_rate) includes getting the frequency from the device-tree property, the per-cpu arch-timer and the memory-mapped (MMIO) timer interfaces. But reading device-tree property will be needed only when system boot with

[PATCH v22 04/11] clocksource: arm_arch_timer: move arch_timer_needs_of_probing into DT init call

2017-03-21 Thread fu . wei
From: Fu Wei Because arch_timer_needs_of_probing is only for booting with device-tree, but arch_timer_common_init is a generic init call which shouldn't include the FW-specific code. It's better to put arch_timer_needs_of_probing into DT init function. But for per-cpu

[PATCH v22 01/11] clocksource: arm_arch_timer: introduce a wrapper function to get the frequency from mmio.

2017-03-21 Thread fu . wei
From: Fu Wei The patch introduce a new functions: arch_timer_mem_get_cntfrq, and applies it in arch_timer_detect_rate. This function will be used for getting the frequency from mmio to prepare for reworking counter frequency detection. Signed-off-by: Fu Wei --- drivers/clocksource

[PATCH v22 00/11] acpi, clocksource: add GTDT driver and GTDT support in arm_arch_timer

2017-03-21 Thread fu . wei
From: Fu Wei This patchset: (1)Preparation for adding GTDT support in arm_arch_timer: 1. Introduce a wrapper function to get the frequency from mmio. 2. separate out device-tree code from arch_timer_detect_rate 3. remove arch_timer_detect_rate use arch_timer_

Re: [PATCH v21 13/13] acpi/arm64: Add SBSA Generic Watchdog support in GTDT driver

2017-03-20 Thread Fu Wei
Hi Mark, On 21 March 2017 at 02:09, Mark Rutland wrote: > On Tue, Mar 21, 2017 at 01:57:58AM +0800, Fu Wei wrote: >> On 18 March 2017 at 04:01, Mark Rutland wrote: >> > On Tue, Feb 07, 2017 at 02:50:15AM +0800, fu@linaro.org wrote: > >> > I've not been ab

Re: [Linaro-acpi] [PATCH v21 13/13] acpi/arm64: Add SBSA Generic Watchdog support in GTDT driver

2017-03-20 Thread Fu Wei
Hi Mark, Lurndal, On 21 March 2017 at 02:50, Lurndal, Scott wrote: > On Mon, Mar 20, 2017 at 06:09:50PM +, Mark Rutland wrote: >> On Tue, Mar 21, 2017 at 01:57:58AM +0800, Fu Wei wrote: >> > On 18 March 2017 at 04:01, Mark Rutland wrote: >> > > On Tue, Feb 07

Re: [PATCH v21 13/13] acpi/arm64: Add SBSA Generic Watchdog support in GTDT driver

2017-03-20 Thread Fu Wei
about that if this is saying "we only have one SBSA watchdog in a system" would you let me know where mention it? Do I miss something? Thanks :-) > > [...] > >> diff --git a/drivers/watchdog/Kconfig b/drivers/watchdog/Kconfig >> index acb00b5..c899df1 100644 >> --- a/drivers/watchdog/Kconfig >> +++ b/drivers/watchdog/Kconfig >> @@ -219,6 +219,7 @@ config ARM_SBSA_WATCHDOG >> tristate "ARM SBSA Generic Watchdog" >> depends on ARM64 >> depends on ARM_ARCH_TIMER >> + depends on ACPI_GTDT || !ACPI > > I don't think this is necessary. > > This series hasn't touched this driver code at all. yes, since we are using "select ACPI_GTDT if ACPI" in ARM64, we don't this. Thanks for pointing it out. :-) > > Thanks, > Mark. -- Best regards, Fu Wei Software Engineer Red Hat

Re: [PATCH v21 11/13] acpi/arm64: Add memory-mapped timer support in GTDT driver

2017-03-20 Thread Fu Wei
struct arch_timer_mem_frame *frame = &timer_mem->frame[j]; > >> + if (frame->common_flags & ACPI_GTDT_GT_IS_SECURE_TIMER) >> + continue; >> + >> + if (!frame->base_address || !frame->timer_interrupt) >> + return -EINVAL; >> + >> + data->frame[j].phys_irq = map_gt_gsi(frame->timer_interrupt, >> + frame->timer_flags); > > ... allowing us to simplify lines like this. Thanks, will follow all the suggestion above. :-) > > Thanks, > Mark. -- Best regards, Fu Wei Software Engineer Red Hat

Re: [PATCH v21 04/13] clocksource: arm_arch_timer: split arch_timer_rate for different types of timer

2017-03-20 Thread Fu Wei
Hi Mark, On 18 March 2017 at 03:05, Mark Rutland wrote: > On Tue, Feb 07, 2017 at 02:50:06AM +0800, fu@linaro.org wrote: >> From: Fu Wei >> >> Currently, arch_timer_rate is used to store the frequency got from per-cpu >> arch-timer or the memory-mapped (MMIO) ti

Re: [PATCH v21 01/13] clocksource: arm_arch_timer: introduce two functions to get the frequency from mmio and sysreg.

2017-03-20 Thread Fu Wei
Hi Mark, On 20 March 2017 at 18:41, Mark Rutland wrote: > On Mon, Mar 20, 2017 at 05:43:29PM +0800, Fu Wei wrote: >> On 20 March 2017 at 15:36, Fu Wei wrote: >> > On 18 March 2017 at 02:05, Mark Rutland wrote: >> >> On Tue, Feb 07, 2017 at 02:50:03AM

Re: [PATCH v21 01/13] clocksource: arm_arch_timer: introduce two functions to get the frequency from mmio and sysreg.

2017-03-20 Thread Fu Wei
Hi Mark, On 20 March 2017 at 15:36, Fu Wei wrote: > Hi Mark, > > On 18 March 2017 at 02:05, Mark Rutland wrote: >> On Tue, Feb 07, 2017 at 02:50:03AM +0800, fu@linaro.org wrote: >>> +static u32 arch_timer_get_sysreg_freq(void) >>> +{ >>> + /*

Re: [PATCH v21 01/13] clocksource: arm_arch_timer: introduce two functions to get the frequency from mmio and sysreg.

2017-03-20 Thread Fu Wei
ce, so I'm happy with this wrapper. > > If you can s/arch_timer_get_mmio_freq/arch_timer_get_cntfrq/, and drop sorry, May I guess that is "s/arch_timer_get_mmio_freq/arch_timer_get_mmio_cntfrq/" or "s/arch_timer_get_mmio_freq/arch_timer_mem_get_cntfrq/" which one do you prefer? :-) > the comments, then this looks fine to me. > > Thanks, > Mark. -- Best regards, Fu Wei Software Engineer Red Hat

Re: [PATCH v21 03/13] clocksource: arm_arch_timer: remove arch_timer_detect_rate

2017-03-20 Thread Fu Wei
Hi Mark, On 18 March 2017 at 02:07, Mark Rutland wrote: > On Tue, Feb 07, 2017 at 02:50:05AM +0800, fu@linaro.org wrote: >> From: Fu Wei >> >> The original counter frequency detection call(arch_timer_detect_rate) >> include getting the frequency from the per-cpu a

Re: [PATCH v21 00/13] acpi, clocksource: add GTDT driver and GTDT support in arm_arch_timer

2017-03-19 Thread Fu Wei
Hi Mark, On 18 March 2017 at 04:03, Mark Rutland wrote: > On Thu, Mar 09, 2017 at 11:47:16PM +0100, Fu Wei wrote: >> Hi Mark, Marc, > > Hi, > >> I have tried to rebase all the 19(6+13) patches on 4.11-rc1, >> all the patchse can directly apply on 4.11-rc1, >

Re: [PATCH v21 00/13] acpi, clocksource: add GTDT driver and GTDT support in arm_arch_timer

2017-03-09 Thread Fu Wei
Hi Mark, Marc, I have tried to rebase all the 19(6+13) patches on 4.11-rc1, all the patchse can directly apply on 4.11-rc1, Could you help to review the patches, and see if there is anywhere I can improve ? Great thanks ! :-) On 20 February 2017 at 17:20, Fu Wei wrote: > Hi Mark, M

Re: [PATCH v21 00/13] acpi, clocksource: add GTDT driver and GTDT support in arm_arch_timer

2017-02-20 Thread Fu Wei
Hi Mark, Marc On 7 February 2017 at 02:50, wrote: > From: Fu Wei > > This patchset: > (1)Preparation for adding GTDT support in arm_arch_timer: > 1. Introduce two functions to get the frequency from mmio and sysreg. > 2. separate out dev

[PATCH v21 06/13] clocksource: arm_arch_timer: move arch_timer_needs_of_probing into DT init call

2017-02-06 Thread fu . wei
From: Fu Wei Because arch_timer_needs_of_probing is only for booting with device-tree, but arch_timer_common_init is a generic init call which shouldn't include the FW-specific code. It's better to put arch_timer_needs_of_probing into DT init function. But for per-cpu

[PATCH v21 12/13] clocksource: arm_arch_timer: add GTDT support for memory-mapped timer

2017-02-06 Thread fu . wei
From: Fu Wei The patch add memory-mapped timer register support by using the information provided by the new GTDT driver of ACPI. Signed-off-by: Fu Wei Reviewed-by: Hanjun Guo --- drivers/clocksource/arm_arch_timer.c | 35 --- 1 file changed, 32 insertions

[PATCH v21 13/13] acpi/arm64: Add SBSA Generic Watchdog support in GTDT driver

2017-02-06 Thread fu . wei
From: Fu Wei This driver adds support for parsing SBSA Generic Watchdog timer in GTDT, parse all info in SBSA Generic Watchdog Structure in GTDT, and creating a platform device with that information. This allows the operating system to obtain device data from the resource of platform device

[PATCH v21 10/13] clocksource: arm_arch_timer: simplify ACPI support code.

2017-02-06 Thread fu . wei
From: Fu Wei The patch update arm_arch_timer driver to use the function provided by the new GTDT driver of ACPI. By this way, arm_arch_timer.c can be simplified, and separate all the ACPI GTDT knowledge from this timer driver. Signed-off-by: Fu Wei Signed-off-by: Hanjun Guo Tested-by

[PATCH v21 11/13] acpi/arm64: Add memory-mapped timer support in GTDT driver

2017-02-06 Thread fu . wei
From: Fu Wei On platforms booting with ACPI, architected memory-mapped timers' configuration data is provided by firmware through the ACPI GTDT static table. The clocksource architected timer kernel driver requires a firmware interface to collect timer configuration and configure its d

[PATCH v21 09/13] acpi/arm64: Add GTDT table parse driver

2017-02-06 Thread fu . wei
From: Fu Wei This patch adds support for parsing arch timer info in GTDT, provides some kernel APIs to parse all the PPIs and always-on info in GTDT and export them. By this driver, we can simplify arm_arch_timer drivers, and separate the ACPI GTDT knowledge from it. Signed-off-by: Fu Wei

[PATCH v21 07/13] clocksource: arm_arch_timer: introduce some new structs to prepare for GTDT

2017-02-06 Thread fu . wei
From: Fu Wei The patch introduce two new structs: arch_timer_mem, arch_timer_mem_frame. And also introduce a new define: ARCH_TIMER_MEM_MAX_FRAMES These will be used for refactoring the memory-mapped timer init code to prepare for GTDT Signed-off-by: Fu Wei Reviewed-by: Hanjun Guo

[PATCH v21 08/13] clocksource: arm_arch_timer: refactor MMIO timer probing.

2017-02-06 Thread fu . wei
From: Fu Wei Currently the code to probe MMIO architected timers mixes DT parsing with actual poking of hardware. This makes the code harder than necessary to understand, and makes it difficult to add support for probing via ACPI. This patch factors all the DT-specific logic out of

[PATCH v21 05/13] clocksource: arm_arch_timer: refactor arch_timer_needs_probing

2017-02-06 Thread fu . wei
From: Fu Wei When system init with device-tree, we don't know which node will be initialized first. And the code in arch_timer_common_init should wait until per-cpu timer and MMIO timer are both initialized. So we need arch_timer_needs_probing to detect the init status of system. But curr

[PATCH v21 02/13] clocksource: arm_arch_timer: separate out device-tree code from arch_timer_detect_rate

2017-02-06 Thread fu . wei
From: Fu Wei Currently, the counter frequency detection call(arch_timer_detect_rate) include getting the frequency from the device-tree property. But reading device-tree property will be needed only when system boot with device-tree. This patch separate out device-tree code, keep them in device

[PATCH v21 03/13] clocksource: arm_arch_timer: remove arch_timer_detect_rate

2017-02-06 Thread fu . wei
From: Fu Wei The original counter frequency detection call(arch_timer_detect_rate) include getting the frequency from the per-cpu arch-timer and the memory-mapped (MMIO) timer interfaces. But they will be needed only when the system initializes the relevant timer. This patch remove

[PATCH v21 04/13] clocksource: arm_arch_timer: split arch_timer_rate for different types of timer

2017-02-06 Thread fu . wei
From: Fu Wei Currently, arch_timer_rate is used to store the frequency got from per-cpu arch-timer or the memory-mapped (MMIO) timers. But those values come from different registers which should all be initialized by firmware. This patch remove arch_timer_rate, and use arch_timer_sysreg_freq

[PATCH v21 01/13] clocksource: arm_arch_timer: introduce two functions to get the frequency from mmio and sysreg.

2017-02-06 Thread fu . wei
From: Fu Wei The patch introduce two new functions: arch_timer_get_sysreg_freq and arch_timer_get_mmio_freq, and applys them in arch_timer_detect_rate. These will be used for getting the frequency from mmio and sysreg to prepare for reworking counter frequency detection. Signed-off-by: Fu Wei

[PATCH v21 00/13] acpi, clocksource: add GTDT driver and GTDT support in arm_arch_timer

2017-02-06 Thread fu . wei
From: Fu Wei This patchset: (1)Preparation for adding GTDT support in arm_arch_timer: 1. Introduce two functions to get the frequency from mmio and sysreg. 2. separate out device-tree code from arch_timer_detect_rate 3. remove arch_timer_detect_rate use

Re: [PATCH v20 08/17] clocksource/drivers/arm_arch_timer: Rework counter frequency detection.

2017-01-31 Thread Fu Wei
Hi Mark, On 1 February 2017 at 02:49, Mark Rutland wrote: > On Wed, Feb 01, 2017 at 02:43:02AM +0800, Fu Wei wrote: >> On 31 January 2017 at 01:49, Mark Rutland wrote: >> > On Thu, Jan 26, 2017 at 01:49:03PM +0800, Fu Wei wrote: >> >> On 26 January 2017 at 01:25, M

Re: [PATCH v20 08/17] clocksource/drivers/arm_arch_timer: Rework counter frequency detection.

2017-01-31 Thread Fu Wei
Hi Mark, On 31 January 2017 at 01:49, Mark Rutland wrote: > On Thu, Jan 26, 2017 at 01:49:03PM +0800, Fu Wei wrote: >> On 26 January 2017 at 01:25, Mark Rutland wrote: >> > On Wed, Jan 25, 2017 at 02:46:12PM +0800, Fu Wei wrote: >> >> On 25 January 2017 at 01:24, M

Re: [PATCH v20 08/17] clocksource/drivers/arm_arch_timer: Rework counter frequency detection.

2017-01-25 Thread Fu Wei
Hi Mark, Christopher, On 26 January 2017 at 01:36, Mark Rutland wrote: > On Wed, Jan 25, 2017 at 10:38:01AM -0500, Christopher Covington wrote: >> On 01/25/2017 01:46 AM, Fu Wei wrote: >> > On 25 January 2017 at 01:24, Mark Rutland wrote: >> >> On Wed, Jan 18

Re: [PATCH v20 08/17] clocksource/drivers/arm_arch_timer: Rework counter frequency detection.

2017-01-25 Thread Fu Wei
Hi Mark, On 26 January 2017 at 01:25, Mark Rutland wrote: > On Wed, Jan 25, 2017 at 02:46:12PM +0800, Fu Wei wrote: >> Hi Mark, > > Hi, > >> On 25 January 2017 at 01:24, Mark Rutland wrote: >> > On Wed, Jan 18, 2017 at 09:25:32PM +0800, fu....@lin

Re: [PATCH v20 08/17] clocksource/drivers/arm_arch_timer: Rework counter frequency detection.

2017-01-24 Thread Fu Wei
Hi Mark, On 25 January 2017 at 14:46, Fu Wei wrote: > Hi Mark, > > On 25 January 2017 at 01:24, Mark Rutland wrote: >> On Wed, Jan 18, 2017 at 09:25:32PM +0800, fu@linaro.org wrote: >>> From: Fu Wei >>> >>> The counter frequency detection call(arc

Re: [PATCH v20 08/17] clocksource/drivers/arm_arch_timer: Rework counter frequency detection.

2017-01-24 Thread Fu Wei
Hi Mark, On 25 January 2017 at 01:24, Mark Rutland wrote: > On Wed, Jan 18, 2017 at 09:25:32PM +0800, fu@linaro.org wrote: >> From: Fu Wei >> >> The counter frequency detection call(arch_timer_detect_rate) combines two >> ways to get counter frequency: system co

Re: [PATCH v20 00/17] acpi, clocksource: add GTDT driver and GTDT support in arm_arch_timer

2017-01-23 Thread Fu Wei
Hi Mark On 24 January 2017 at 02:54, Mark Rutland wrote: > Hi, > > On Wed, Jan 18, 2017 at 09:25:24PM +0800, fu@linaro.org wrote: >> From: Fu Wei >> >> This patchset: >> (1)Preparation for adding GTDT support in arm_arch_timer: >> 1. Clean

Re: [PATCH v20 13/17] acpi/arm64: Add GTDT table parse driver

2017-01-19 Thread Fu Wei
Hi Mark, On 19 January 2017 at 19:16, Mark Rutland wrote: > On Thu, Jan 19, 2017 at 06:32:55PM +0800, Fu Wei wrote: >> On 19 January 2017 at 17:11, Hanjun Guo wrote: >> > On 2017/1/18 21:25, fu@linaro.org wrote: >> >> From: Fu Wei > >> >>

Re: [PATCH v20 00/17] acpi, clocksource: add GTDT driver and GTDT support in arm_arch_timer

2017-01-19 Thread Fu Wei
Hi Hanjun, On 19 January 2017 at 17:20, Hanjun Guo wrote: > Hi Fuwei, > > > On 2017/1/18 21:25, fu@linaro.org wrote: >> >> From: Fu Wei >> >> This patchset: >> (1)Preparation for adding GTDT support in arm_arch_timer: >> 1. Clean

Re: [PATCH v20 13/17] acpi/arm64: Add GTDT table parse driver

2017-01-19 Thread Fu Wei
Hi Hanjun, On 19 January 2017 at 17:11, Hanjun Guo wrote: > On 2017/1/18 21:25, fu@linaro.org wrote: >> >> From: Fu Wei >> >> This patch adds support for parsing arch timer info in GTDT, >> provides some kernel APIs to parse all the PPIs and >>

Re: [PATCH v20 16/17] clocksource/drivers/arm_arch_timer: Add GTDT support for memory-mapped timer

2017-01-19 Thread Fu Wei
Hi Hanjun, On 19 January 2017 at 17:16, Hanjun Guo wrote: > On 2017/1/18 21:25, fu@linaro.org wrote: >> >> From: Fu Wei >> >> The patch add memory-mapped timer register support by using the >> information provided by the new GTDT driver of

Re: [PATCH v20 11/17] clocksource/drivers/arm_arch_timer: Introduce some new structs to prepare for GTDT

2017-01-19 Thread Fu Wei
Hi Hanjun, On 19 January 2017 at 16:28, Hanjun Guo wrote: > On 2017/1/18 21:25, fu@linaro.org wrote: >> >> From: Fu Wei >> >> The patch introduce two new structs: arch_timer_mem, arch_timer_mem_frame. >> And also introduce a new define: ARCH_TIMER_MEM_MAX_FR

Re: [PATCH v20 08/17] clocksource/drivers/arm_arch_timer: Rework counter frequency detection.

2017-01-19 Thread Fu Wei
Hi Hanjun, On 19 January 2017 at 16:02, Hanjun Guo wrote: > Hi Fuwei, > > One comments below. > > > On 2017/1/18 21:25, fu@linaro.org wrote: >> >> From: Fu Wei >> >> The counter frequency detection call(arch_timer_detect_rate) combines tw

[PATCH v20 17/17] acpi/arm64: Add SBSA Generic Watchdog support in GTDT driver

2017-01-18 Thread fu . wei
From: Fu Wei This driver adds support for parsing SBSA Generic Watchdog timer in GTDT, parse all info in SBSA Generic Watchdog Structure in GTDT, and creating a platform device with that information. This allows the operating system to obtain device data from the resource of platform device

[PATCH v20 13/17] acpi/arm64: Add GTDT table parse driver

2017-01-18 Thread fu . wei
From: Fu Wei This patch adds support for parsing arch timer info in GTDT, provides some kernel APIs to parse all the PPIs and always-on info in GTDT and export them. By this driver, we can simplify arm_arch_timer drivers, and separate the ACPI GTDT knowledge from it. Signed-off-by: Fu Wei

[PATCH v20 05/17] clocksource/drivers/arm_arch_timer: Add a new enum for spi type

2017-01-18 Thread fu . wei
From: Fu Wei This patch add a new enum "arch_timer_spi_nr" and use it in the driver. Just for code's readability, no functional change. Signed-off-by: Fu Wei Acked-by: Mark Rutland --- drivers/clocksource/arm_arch_timer.c | 4 ++-- include/clocksource/arm_arch_timer.h | 6

[PATCH v20 09/17] clocksource/drivers/arm_arch_timer: Refactor arch_timer_needs_probing

2017-01-18 Thread fu . wei
From: Fu Wei When system init with device-tree, we don't know which node will be initialized first. And the code in arch_timer_common_init should wait until per-cpu timer and MMIO timer are both initialized. So we need arch_timer_needs_probing to detect the init status of system. But curr

  1   2   3   4   5   6   7   >