Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1523473 > unrolled thread
| Started by | fu.wei@linaro.org |
|---|---|
| First post | 2016-11-16 14:50 +0100 |
| Last post | 2016-11-17 10:50 +0100 |
| Articles | 19 on this page of 39 — 6 participants |
Back to article view | Back to linux.kernel
[PATCH v16 00/15] acpi, clocksource: add GTDT driver and GTDT support in arm_arch_timer fu.wei@linaro.org - 2016-11-16 14:50 +0100
[PATCH v16 07/15] clocksource/drivers/arm_arch_timer: Refactor arch_timer_detect_rate to keep dt code in *_of_init fu.wei@linaro.org - 2016-11-16 15:00 +0100
Re: [PATCH v16 07/15] clocksource/drivers/arm_arch_timer: Refactor arch_timer_detect_rate to keep dt code in *_of_init Mark Rutland <mark.rutland@arm.com> - 2016-11-18 21:00 +0100
Re: [PATCH v16 07/15] clocksource/drivers/arm_arch_timer: Refactor arch_timer_detect_rate to keep dt code in *_of_init Fu Wei <fu.wei@linaro.org> - 2016-11-21 15:10 +0100
[PATCH v16 12/15] clocksource/drivers/arm_arch_timer: Simplify ACPI support code. fu.wei@linaro.org - 2016-11-16 15:00 +0100
[PATCH v16 13/15] acpi/arm64: Add memory-mapped timer support in GTDT driver fu.wei@linaro.org - 2016-11-16 15:00 +0100
Re: [PATCH v16 13/15] acpi/arm64: Add memory-mapped timer support in GTDT driver Lorenzo Pieralisi <lorenzo.pieralisi@arm.com> - 2016-11-18 15:30 +0100
Re: [PATCH v16 13/15] acpi/arm64: Add memory-mapped timer support in GTDT driver Fu Wei <fu.wei@linaro.org> - 2016-11-23 13:00 +0100
Re: [PATCH v16 13/15] acpi/arm64: Add memory-mapped timer support in GTDT driver Fu Wei <fu.wei@linaro.org> - 2016-11-24 05:00 +0100
[PATCH v16 10/15] clocksource/drivers/arm_arch_timer: Refactor the timer init code to prepare for GTDT fu.wei@linaro.org - 2016-11-16 15:00 +0100
Re: [PATCH v16 10/15] clocksource/drivers/arm_arch_timer: Refactor the timer init code to prepare for GTDT Mark Rutland <mark.rutland@arm.com> - 2016-11-18 21:10 +0100
Re: [PATCH v16 10/15] clocksource/drivers/arm_arch_timer: Refactor the timer init code to prepare for GTDT Fu Wei <fu.wei@linaro.org> - 2016-11-23 07:20 +0100
[PATCH v16 11/15] acpi/arm64: Add GTDT table parse driver fu.wei@linaro.org - 2016-11-16 15:00 +0100
Re: [PATCH v16 11/15] acpi/arm64: Add GTDT table parse driver Mark Rutland <mark.rutland@arm.com> - 2016-11-18 21:20 +0100
Re: [PATCH v16 11/15] acpi/arm64: Add GTDT table parse driver Fu Wei <fu.wei@linaro.org> - 2016-11-23 13:10 +0100
[PATCH v16 04/15] clocksource/drivers/arm_arch_timer: rename some enums and defines, and some cleanups. fu.wei@linaro.org - 2016-11-16 15:00 +0100
Re: [PATCH v16 04/15] clocksource/drivers/arm_arch_timer: rename some enums and defines, and some cleanups. Mark Rutland <mark.rutland@arm.com> - 2016-11-18 20:00 +0100
Re: [PATCH v16 04/15] clocksource/drivers/arm_arch_timer: rename some enums and defines, and some cleanups. Fu Wei <fu.wei@linaro.org> - 2016-11-21 07:20 +0100
[PATCH v16 01/15] clocksource/drivers/arm_arch_timer: Move enums and defines to header file fu.wei@linaro.org - 2016-11-16 15:00 +0100
[PATCH v16 15/15] acpi/arm64: Add SBSA Generic Watchdog support in GTDT driver fu.wei@linaro.org - 2016-11-16 15:00 +0100
[PATCH v16 14/15] clocksource/drivers/arm_arch_timer: Add GTDT support for memory-mapped timer fu.wei@linaro.org - 2016-11-16 15:00 +0100
Re: [PATCH v16 14/15] clocksource/drivers/arm_arch_timer: Add GTDT support for memory-mapped timer Mark Rutland <mark.rutland@arm.com> - 2016-11-18 21:30 +0100
Re: [PATCH v16 14/15] clocksource/drivers/arm_arch_timer: Add GTDT support for memory-mapped timer Fu Wei <fu.wei@linaro.org> - 2016-11-23 13:20 +0100
[PATCH v16 08/15] clocksource/drivers/arm_arch_timer: Refactor arch_timer_needs_probing, and call it only if acpi disabled. fu.wei@linaro.org - 2016-11-16 15:00 +0100
Re: [PATCH v16 08/15] clocksource/drivers/arm_arch_timer: Refactor arch_timer_needs_probing, and call it only if acpi disabled. Mark Rutland <mark.rutland@arm.com> - 2016-11-18 21:00 +0100
Re: [PATCH v16 08/15] clocksource/drivers/arm_arch_timer: Refactor arch_timer_needs_probing, and call it only if acpi disabled. Fu Wei <fu.wei@linaro.org> - 2016-11-21 15:40 +0100
[PATCH v16 06/15] clocksource/drivers/arm_arch_timer: separate out arch_timer_uses_ppi init code to prepare for GTDT. fu.wei@linaro.org - 2016-11-16 15:00 +0100
Re: [PATCH v16 06/15] clocksource/drivers/arm_arch_timer: separate out arch_timer_uses_ppi init code to prepare for GTDT. Mark Rutland <mark.rutland@arm.com> - 2016-11-18 20:40 +0100
Re: [PATCH v16 06/15] clocksource/drivers/arm_arch_timer: separate out arch_timer_uses_ppi init code to prepare for GTDT. Fu Wei <fu.wei@linaro.org> - 2016-11-21 10:50 +0100
[PATCH v16 03/15] clocksource/drivers/arm_arch_timer: Improve printk relevant code fu.wei@linaro.org - 2016-11-16 15:00 +0100
[PATCH v16 02/15] clocksource/drivers/arm_arch_timer: Add a new enum for spi type fu.wei@linaro.org - 2016-11-16 15:00 +0100
[PATCH v16 09/15] clocksource/drivers/arm_arch_timer: Introduce some new structs to prepare for GTDT fu.wei@linaro.org - 2016-11-16 15:00 +0100
[PATCH v16 05/15] clocksource/drivers/arm_arch_timer: fix a bug in arch_timer_register about arch_timer_uses_ppi fu.wei@linaro.org - 2016-11-16 15:00 +0100
Re: [PATCH v16 05/15] clocksource/drivers/arm_arch_timer: fix a bug in arch_timer_register about arch_timer_uses_ppi Mark Rutland <mark.rutland@arm.com> - 2016-11-18 20:00 +0100
Re: [PATCH v16 05/15] clocksource/drivers/arm_arch_timer: fix a bug in arch_timer_register about arch_timer_uses_ppi Fu Wei <fu.wei@linaro.org> - 2016-11-21 08:40 +0100
Re: [PATCH v16 00/15] acpi, clocksource: add GTDT driver and GTDT support in arm_arch_timer Xiongfeng Wang <wangxiongfeng2@huawei.com> - 2016-11-17 04:50 +0100
Re: [PATCH v16 00/15] acpi, clocksource: add GTDT driver and GTDT support in arm_arch_timer Xiongfeng Wang <wangxiongfeng2@huawei.com> - 2016-11-17 10:40 +0100
Re: [PATCH v16 00/15] acpi, clocksource: add GTDT driver and GTDT support in arm_arch_timer Fu Wei <fu.wei@linaro.org> - 2016-11-17 12:20 +0100
Re: [PATCH v16 00/15] acpi, clocksource: add GTDT driver and GTDT support in arm_arch_timer Daniel Lezcano <daniel.lezcano@linaro.org> - 2016-11-17 10:50 +0100
Page 2 of 2 — ← Prev page 1 [2]
| From | fu.wei@linaro.org |
|---|---|
| Date | 2016-11-16 15:00 +0100 |
| Subject | [PATCH v16 14/15] clocksource/drivers/arm_arch_timer: Add GTDT support for memory-mapped timer |
| Message-ID | <sE8UO-3xZ-53@gated-at.bofh.it> |
| In reply to | #1523473 |
From: Fu Wei <fu.wei@linaro.org>
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 <fu.wei@linaro.org>
---
drivers/clocksource/arm_arch_timer.c | 26 +++++++++++++++++++++++++-
1 file changed, 25 insertions(+), 1 deletion(-)
diff --git a/drivers/clocksource/arm_arch_timer.c b/drivers/clocksource/arm_arch_timer.c
index c494ca8..0aad60a 100644
--- a/drivers/clocksource/arm_arch_timer.c
+++ b/drivers/clocksource/arm_arch_timer.c
@@ -1067,7 +1067,28 @@ CLOCKSOURCE_OF_DECLARE(armv7_arch_timer_mem, "arm,armv7-timer-mem",
arch_timer_mem_of_init);
#ifdef CONFIG_ACPI_GTDT
-/* Initialize per-processor generic timer */
+static int __init arch_timer_mem_acpi_init(void)
+{
+ struct arch_timer_mem *timer_mem;
+ int ret = 0;
+ int i = 0;
+
+ timer_mem = kzalloc(sizeof(*timer_mem), GFP_KERNEL);
+ if (!timer_mem)
+ return -ENOMEM;
+
+ while (!gtdt_arch_timer_mem_init(timer_mem, i)) {
+ ret = arch_timer_mem_init(timer_mem);
+ if (ret)
+ break;
+ i++;
+ }
+
+ kfree(timer_mem);
+ return ret;
+}
+
+/* Initialize per-processor generic timer and memory-mapped timer(if present) */
static int __init arch_timer_acpi_init(struct acpi_table_header *table)
{
int ret;
@@ -1104,6 +1125,9 @@ static int __init arch_timer_acpi_init(struct acpi_table_header *table)
/* Get the frequency from CNTFRQ */
arch_timer_detect_rate(NULL);
+ if (arch_timer_mem_acpi_init())
+ pr_err("Failed to initialize memory-mapped timer.\n");
+
ret = arch_timer_init();
error:
--
2.7.4
[toc] | [prev] | [next] | [standalone]
| From | Mark Rutland <mark.rutland@arm.com> |
|---|---|
| Date | 2016-11-18 21:30 +0100 |
| Subject | Re: [PATCH v16 14/15] clocksource/drivers/arm_arch_timer: Add GTDT support for memory-mapped timer |
| Message-ID | <sEXXk-3vd-9@gated-at.bofh.it> |
| In reply to | #1523492 |
On Wed, Nov 16, 2016 at 09:49:07PM +0800, fu.wei@linaro.org wrote:
> From: Fu Wei <fu.wei@linaro.org>
>
> 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 <fu.wei@linaro.org>
> ---
> drivers/clocksource/arm_arch_timer.c | 26 +++++++++++++++++++++++++-
> 1 file changed, 25 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/clocksource/arm_arch_timer.c b/drivers/clocksource/arm_arch_timer.c
> index c494ca8..0aad60a 100644
> --- a/drivers/clocksource/arm_arch_timer.c
> +++ b/drivers/clocksource/arm_arch_timer.c
> @@ -1067,7 +1067,28 @@ CLOCKSOURCE_OF_DECLARE(armv7_arch_timer_mem, "arm,armv7-timer-mem",
> arch_timer_mem_of_init);
>
> #ifdef CONFIG_ACPI_GTDT
> -/* Initialize per-processor generic timer */
> +static int __init arch_timer_mem_acpi_init(void)
> +{
> + struct arch_timer_mem *timer_mem;
> + int ret = 0;
> + int i = 0;
> +
> + timer_mem = kzalloc(sizeof(*timer_mem), GFP_KERNEL);
Why do you need it zeroed? You don't clear it between iterations, so
either you don't need this, or you have a bug in the loop.
> + if (!timer_mem)
> + return -ENOMEM;
> +
> + while (!gtdt_arch_timer_mem_init(timer_mem, i)) {
Huh?
Why doesn't GTDT expose a function to fill in the entire arch_timer_mem
in one go?
There shouldn't be multiple instances, as far as I am aware. Am I
mistaken?
> + ret = arch_timer_mem_init(timer_mem);
> + if (ret)
> + break;
> + i++;
> + }
> +
> + kfree(timer_mem);
> + return ret;
> +}
Regardless, arch_timer_mem is small enough that you don't need dynamic
allocaiton. Just put it on the stack, e.g.
static int __init arch_timer_mem_acpi_init(void)
{
int i = 0;
struct arch_timer_mem timer_mem;
while (!gtdt_arch_timer_mem_init(timer_mem, i)) {
int ret = arch_timer_mem_init();
if (ret)
return ret;
i++
}
return 0;
}
Thanks,
Mark.
[toc] | [prev] | [next] | [standalone]
| From | Fu Wei <fu.wei@linaro.org> |
|---|---|
| Date | 2016-11-23 13:20 +0100 |
| Subject | Re: [PATCH v16 14/15] clocksource/drivers/arm_arch_timer: Add GTDT support for memory-mapped timer |
| Message-ID | <sGEGR-4OI-3@gated-at.bofh.it> |
| In reply to | #1525703 |
Hi Mark,
On 19 November 2016 at 04:20, Mark Rutland <mark.rutland@arm.com> wrote:
> On Wed, Nov 16, 2016 at 09:49:07PM +0800, fu.wei@linaro.org wrote:
>> From: Fu Wei <fu.wei@linaro.org>
>>
>> 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 <fu.wei@linaro.org>
>> ---
>> drivers/clocksource/arm_arch_timer.c | 26 +++++++++++++++++++++++++-
>> 1 file changed, 25 insertions(+), 1 deletion(-)
>>
>> diff --git a/drivers/clocksource/arm_arch_timer.c b/drivers/clocksource/arm_arch_timer.c
>> index c494ca8..0aad60a 100644
>> --- a/drivers/clocksource/arm_arch_timer.c
>> +++ b/drivers/clocksource/arm_arch_timer.c
>> @@ -1067,7 +1067,28 @@ CLOCKSOURCE_OF_DECLARE(armv7_arch_timer_mem, "arm,armv7-timer-mem",
>> arch_timer_mem_of_init);
>>
>> #ifdef CONFIG_ACPI_GTDT
>> -/* Initialize per-processor generic timer */
>> +static int __init arch_timer_mem_acpi_init(void)
>> +{
>> + struct arch_timer_mem *timer_mem;
>> + int ret = 0;
>> + int i = 0;
>> +
>> + timer_mem = kzalloc(sizeof(*timer_mem), GFP_KERNEL);
>
> Why do you need it zeroed? You don't clear it between iterations, so
> either you don't need this, or you have a bug in the loop.
>
>> + if (!timer_mem)
>> + return -ENOMEM;
>> +
>> + while (!gtdt_arch_timer_mem_init(timer_mem, i)) {
>
> Huh?
>
> Why doesn't GTDT expose a function to fill in the entire arch_timer_mem
> in one go?
Yes, that is a good idea, but I need to find a way to get the number of
GT block in GTDT, then allocate a struct arch_timer_mem array for all GT block
>
> There shouldn't be multiple instances, as far as I am aware. Am I
> mistaken?
I don't see any doc says : there is only one memory-mapped timer
in a soc.
Maybe we have more than one GT block in GTDT or
(in another word) we may have more than one memory-mapped
timer in a soc, right ??
Please correct me, If I miss something.
>
>> + ret = arch_timer_mem_init(timer_mem);
>> + if (ret)
>> + break;
>> + i++;
>> + }
>> +
>> + kfree(timer_mem);
>> + return ret;
>> +}
>
>
> Regardless, arch_timer_mem is small enough that you don't need dynamic
> allocaiton. Just put it on the stack, e.g.
>
> static int __init arch_timer_mem_acpi_init(void)
> {
> int i = 0;
> struct arch_timer_mem timer_mem;
>
> while (!gtdt_arch_timer_mem_init(timer_mem, i)) {
> int ret = arch_timer_mem_init();
> if (ret)
> return ret;
> i++
> }
>
> return 0;
> }
>
> Thanks,
> Mark.
--
Best regards,
Fu Wei
Software Engineer
Red Hat
[toc] | [prev] | [next] | [standalone]
| From | fu.wei@linaro.org |
|---|---|
| Date | 2016-11-16 15:00 +0100 |
| Subject | [PATCH v16 08/15] clocksource/drivers/arm_arch_timer: Refactor arch_timer_needs_probing, and call it only if acpi disabled. |
| Message-ID | <sE8UO-3xZ-37@gated-at.bofh.it> |
| In reply to | #1523473 |
From: Fu Wei <fu.wei@linaro.org>
The patch refactor original arch_timer_needs_probing function:
(1) Separate out arch_timer_needs_probing from arch_timer_common_init,
and call it only if acpi disabled.
(2) Rename arch_timer_needs_probing to arch_timer_needs_of_probing.
Signed-off-by: Fu Wei <fu.wei@linaro.org>
---
drivers/clocksource/arm_arch_timer.c | 34 +++++++++++++++++++---------------
1 file changed, 19 insertions(+), 15 deletions(-)
diff --git a/drivers/clocksource/arm_arch_timer.c b/drivers/clocksource/arm_arch_timer.c
index fe4e812..9ddc091 100644
--- a/drivers/clocksource/arm_arch_timer.c
+++ b/drivers/clocksource/arm_arch_timer.c
@@ -792,15 +792,28 @@ static const struct of_device_id arch_timer_mem_of_match[] __initconst = {
{},
};
-static bool __init
-arch_timer_needs_probing(int type, const struct of_device_id *matches)
+static bool __init arch_timer_needs_of_probing(void)
{
struct device_node *dn;
bool needs_probing = false;
+ unsigned int mask = ARCH_TIMER_TYPE_CP15 | ARCH_TIMER_TYPE_MEM;
+
+ /* We have two timers, and both device-tree nodes are probed. */
+ if ((arch_timers_present & mask) == mask)
+ return false;
+
+ /*
+ * Only one type of timer is probed,
+ * check if we have another type of timer node in device-tree.
+ */
+ if (arch_timers_present & ARCH_TIMER_TYPE_CP15)
+ dn = of_find_matching_node(NULL, arch_timer_mem_of_match);
+ else
+ dn = of_find_matching_node(NULL, arch_timer_of_match);
- dn = of_find_matching_node(NULL, matches);
- if (dn && of_device_is_available(dn) && !(arch_timers_present & type))
+ if (dn && of_device_is_available(dn))
needs_probing = true;
+
of_node_put(dn);
return needs_probing;
@@ -808,17 +821,8 @@ arch_timer_needs_probing(int type, const struct of_device_id *matches)
static int __init arch_timer_common_init(void)
{
- unsigned int mask = ARCH_TIMER_TYPE_CP15 | ARCH_TIMER_TYPE_MEM;
-
- /* Wait until both nodes are probed if we have two timers */
- if ((arch_timers_present & mask) != mask) {
- if (arch_timer_needs_probing(ARCH_TIMER_TYPE_MEM,
- arch_timer_mem_of_match))
- return 0;
- if (arch_timer_needs_probing(ARCH_TIMER_TYPE_CP15,
- arch_timer_of_match))
- return 0;
- }
+ if (acpi_disabled && arch_timer_needs_of_probing())
+ return 0;
arch_timer_banner(arch_timers_present);
arch_counter_register(arch_timers_present);
--
2.7.4
[toc] | [prev] | [next] | [standalone]
| From | Mark Rutland <mark.rutland@arm.com> |
|---|---|
| Date | 2016-11-18 21:00 +0100 |
| Subject | Re: [PATCH v16 08/15] clocksource/drivers/arm_arch_timer: Refactor arch_timer_needs_probing, and call it only if acpi disabled. |
| Message-ID | <sEXuh-32H-15@gated-at.bofh.it> |
| In reply to | #1523493 |
On Wed, Nov 16, 2016 at 09:49:01PM +0800, fu.wei@linaro.org wrote:
> From: Fu Wei <fu.wei@linaro.org>
>
> The patch refactor original arch_timer_needs_probing function:
> (1) Separate out arch_timer_needs_probing from arch_timer_common_init,
> and call it only if acpi disabled.
> (2) Rename arch_timer_needs_probing to arch_timer_needs_of_probing.
Please write a real commit message.
> Signed-off-by: Fu Wei <fu.wei@linaro.org>
> ---
> drivers/clocksource/arm_arch_timer.c | 34 +++++++++++++++++++---------------
> 1 file changed, 19 insertions(+), 15 deletions(-)
>
> diff --git a/drivers/clocksource/arm_arch_timer.c b/drivers/clocksource/arm_arch_timer.c
> index fe4e812..9ddc091 100644
> --- a/drivers/clocksource/arm_arch_timer.c
> +++ b/drivers/clocksource/arm_arch_timer.c
> @@ -792,15 +792,28 @@ static const struct of_device_id arch_timer_mem_of_match[] __initconst = {
> {},
> };
>
> -static bool __init
> -arch_timer_needs_probing(int type, const struct of_device_id *matches)
> +static bool __init arch_timer_needs_of_probing(void)
> {
> struct device_node *dn;
> bool needs_probing = false;
> + unsigned int mask = ARCH_TIMER_TYPE_CP15 | ARCH_TIMER_TYPE_MEM;
> +
> + /* We have two timers, and both device-tree nodes are probed. */
> + if ((arch_timers_present & mask) == mask)
> + return false;
> +
> + /*
> + * Only one type of timer is probed,
> + * check if we have another type of timer node in device-tree.
> + */
> + if (arch_timers_present & ARCH_TIMER_TYPE_CP15)
> + dn = of_find_matching_node(NULL, arch_timer_mem_of_match);
> + else
> + dn = of_find_matching_node(NULL, arch_timer_of_match);
>
> - dn = of_find_matching_node(NULL, matches);
> - if (dn && of_device_is_available(dn) && !(arch_timers_present & type))
> + if (dn && of_device_is_available(dn))
> needs_probing = true;
> +
> of_node_put(dn);
>
> return needs_probing;
> @@ -808,17 +821,8 @@ arch_timer_needs_probing(int type, const struct of_device_id *matches)
>
> static int __init arch_timer_common_init(void)
> {
> - unsigned int mask = ARCH_TIMER_TYPE_CP15 | ARCH_TIMER_TYPE_MEM;
> -
> - /* Wait until both nodes are probed if we have two timers */
> - if ((arch_timers_present & mask) != mask) {
> - if (arch_timer_needs_probing(ARCH_TIMER_TYPE_MEM,
> - arch_timer_mem_of_match))
> - return 0;
> - if (arch_timer_needs_probing(ARCH_TIMER_TYPE_CP15,
> - arch_timer_of_match))
> - return 0;
> - }
Why can't we just move this into the DT-specific caller of
arch_timer_common_init()?
Thanks
Mark.
> + if (acpi_disabled && arch_timer_needs_of_probing())
> + return 0;
>
> arch_timer_banner(arch_timers_present);
> arch_counter_register(arch_timers_present);
> --
> 2.7.4
>
[toc] | [prev] | [next] | [standalone]
| From | Fu Wei <fu.wei@linaro.org> |
|---|---|
| Date | 2016-11-21 15:40 +0100 |
| Subject | Re: [PATCH v16 08/15] clocksource/drivers/arm_arch_timer: Refactor arch_timer_needs_probing, and call it only if acpi disabled. |
| Message-ID | <sFXVf-2nj-25@gated-at.bofh.it> |
| In reply to | #1525686 |
Hi Mark,
On 19 November 2016 at 03:56, Mark Rutland <mark.rutland@arm.com> wrote:
> On Wed, Nov 16, 2016 at 09:49:01PM +0800, fu.wei@linaro.org wrote:
>> From: Fu Wei <fu.wei@linaro.org>
>>
>> The patch refactor original arch_timer_needs_probing function:
>> (1) Separate out arch_timer_needs_probing from arch_timer_common_init,
>> and call it only if acpi disabled.
>> (2) Rename arch_timer_needs_probing to arch_timer_needs_of_probing.
>
> Please write a real commit message.
OK, how about this:
clocksource/drivers/arm_arch_timer: Refactor
arch_timer_needs_probing, only use it in the DT init code
Currently, the arch_timer_common_init uses arch_timer_needs_probing call to
wait for both timers been probed which is only for booting from DT.
For booting from ACPI, we don't need these in arch_timer_common_init, these code
should be only in the DT init code.
This patch seperates arch_timer_needs_probing related code out into a
new function
named arch_timer_needs_of_probing, and then reworks arch_timer_of_init
to use it,
so that we can keep this only in the DT init code.
>
>> Signed-off-by: Fu Wei <fu.wei@linaro.org>
>> ---
>> drivers/clocksource/arm_arch_timer.c | 34 +++++++++++++++++++---------------
>> 1 file changed, 19 insertions(+), 15 deletions(-)
>>
>> diff --git a/drivers/clocksource/arm_arch_timer.c b/drivers/clocksource/arm_arch_timer.c
>> index fe4e812..9ddc091 100644
>> --- a/drivers/clocksource/arm_arch_timer.c
>> +++ b/drivers/clocksource/arm_arch_timer.c
>> @@ -792,15 +792,28 @@ static const struct of_device_id arch_timer_mem_of_match[] __initconst = {
>> {},
>> };
>>
>> -static bool __init
>> -arch_timer_needs_probing(int type, const struct of_device_id *matches)
>> +static bool __init arch_timer_needs_of_probing(void)
>> {
>> struct device_node *dn;
>> bool needs_probing = false;
>> + unsigned int mask = ARCH_TIMER_TYPE_CP15 | ARCH_TIMER_TYPE_MEM;
>> +
>> + /* We have two timers, and both device-tree nodes are probed. */
>> + if ((arch_timers_present & mask) == mask)
>> + return false;
>> +
>> + /*
>> + * Only one type of timer is probed,
>> + * check if we have another type of timer node in device-tree.
>> + */
>> + if (arch_timers_present & ARCH_TIMER_TYPE_CP15)
>> + dn = of_find_matching_node(NULL, arch_timer_mem_of_match);
>> + else
>> + dn = of_find_matching_node(NULL, arch_timer_of_match);
>>
>> - dn = of_find_matching_node(NULL, matches);
>> - if (dn && of_device_is_available(dn) && !(arch_timers_present & type))
>> + if (dn && of_device_is_available(dn))
>> needs_probing = true;
>> +
>> of_node_put(dn);
>>
>> return needs_probing;
>> @@ -808,17 +821,8 @@ arch_timer_needs_probing(int type, const struct of_device_id *matches)
>>
>> static int __init arch_timer_common_init(void)
>> {
>> - unsigned int mask = ARCH_TIMER_TYPE_CP15 | ARCH_TIMER_TYPE_MEM;
>> -
>> - /* Wait until both nodes are probed if we have two timers */
>> - if ((arch_timers_present & mask) != mask) {
>> - if (arch_timer_needs_probing(ARCH_TIMER_TYPE_MEM,
>> - arch_timer_mem_of_match))
>> - return 0;
>> - if (arch_timer_needs_probing(ARCH_TIMER_TYPE_CP15,
>> - arch_timer_of_match))
>> - return 0;
>> - }
>
> Why can't we just move this into the DT-specific caller of
> arch_timer_common_init()?
yes, I have thought about this, but that means we have to split arch_timer_init,
and use arch_timer_register and arch_timer_common_init directly in
arch_timer_of_init.
In another word, I also need to modify arch_timer_of_init, not only
arch_timer_common_init,
but let me have a try in v17, see if you like it.
>
> Thanks
> Mark.
>
>> + if (acpi_disabled && arch_timer_needs_of_probing())
>> + return 0;
>>
>> arch_timer_banner(arch_timers_present);
>> arch_counter_register(arch_timers_present);
>> --
>> 2.7.4
>>
--
Best regards,
Fu Wei
Software Engineer
Red Hat
[toc] | [prev] | [next] | [standalone]
| From | fu.wei@linaro.org |
|---|---|
| Date | 2016-11-16 15:00 +0100 |
| Subject | [PATCH v16 06/15] clocksource/drivers/arm_arch_timer: separate out arch_timer_uses_ppi init code to prepare for GTDT. |
| Message-ID | <sE8UO-3xZ-43@gated-at.bofh.it> |
| In reply to | #1523473 |
From: Fu Wei <fu.wei@linaro.org>
The patch refactor original arch_timer_uses_ppi init code:
(1) Extract a subfunction: arch_timer_uses_ppi_init
(2) Use the new subfunction in arch_timer_of_init and
arch_timer_acpi_init
Signed-off-by: Fu Wei <fu.wei@linaro.org>
---
drivers/clocksource/arm_arch_timer.c | 73 +++++++++++++++++++++---------------
1 file changed, 42 insertions(+), 31 deletions(-)
diff --git a/drivers/clocksource/arm_arch_timer.c b/drivers/clocksource/arm_arch_timer.c
index 6de164f..af22953 100644
--- a/drivers/clocksource/arm_arch_timer.c
+++ b/drivers/clocksource/arm_arch_timer.c
@@ -821,40 +821,42 @@ static int __init arch_timer_common_init(void)
return arch_timer_arch_init();
}
-static int __init arch_timer_init(void)
+/*
+ * If HYP mode is available, we know that the physical timer
+ * has been configured to be accessible from PL1. Use it, so
+ * that a guest can use the virtual timer instead.
+ *
+ * If no interrupt provided for virtual timer, we'll have to
+ * stick to the physical timer. It'd better be accessible...
+ * On ARM64, we we only use ARCH_TIMER_PHYS_NONSECURE_PPI in Linux.
+ *
+ * On ARMv8.1 with VH extensions, the kernel runs in HYP. VHE
+ * accesses to CNTP_*_EL1 registers are silently redirected to
+ * their CNTHP_*_EL2 counterparts, and use a different PPI
+ * number.
+ */
+static int __init arch_timer_uses_ppi_init(void)
{
- int ret;
- /*
- * If HYP mode is available, we know that the physical timer
- * has been configured to be accessible from PL1. Use it, so
- * that a guest can use the virtual timer instead.
- *
- * If no interrupt provided for virtual timer, we'll have to
- * stick to the physical timer. It'd better be accessible...
- *
- * On ARMv8.1 with VH extensions, the kernel runs in HYP. VHE
- * accesses to CNTP_*_EL1 registers are silently redirected to
- * their CNTHP_*_EL2 counterparts, and use a different PPI
- * number.
- */
- if (is_hyp_mode_available() || !arch_timer_ppi[ARCH_TIMER_VIRT_PPI]) {
- bool has_ppi;
-
- if (is_kernel_in_hyp_mode()) {
- arch_timer_uses_ppi = ARCH_TIMER_HYP_PPI;
- has_ppi = !!arch_timer_ppi[ARCH_TIMER_HYP_PPI];
- } else {
+ if (is_hyp_mode_available() && is_kernel_in_hyp_mode()) {
+ arch_timer_uses_ppi = ARCH_TIMER_HYP_PPI;
+ } else if (!arch_timer_ppi[ARCH_TIMER_VIRT_PPI]) {
+ if (IS_ENABLED(CONFIG_ARM64))
+ arch_timer_uses_ppi = ARCH_TIMER_PHYS_NONSECURE_PPI;
+ else
arch_timer_uses_ppi = ARCH_TIMER_PHYS_SECURE_PPI;
- has_ppi = (!!arch_timer_ppi[ARCH_TIMER_PHYS_SECURE_PPI] ||
- !!arch_timer_ppi[ARCH_TIMER_PHYS_NONSECURE_PPI]);
- }
-
- if (!has_ppi) {
- pr_warn("No interrupt available, giving up\n");
- return -EINVAL;
- }
}
+ if (arch_timer_ppi[arch_timer_uses_ppi])
+ return 0;
+
+ pr_warn("No interrupt available, giving up\n");
+ return -EINVAL;
+}
+
+static int __init arch_timer_init(void)
+{
+ int ret;
+
ret = arch_timer_register();
if (ret)
return ret;
@@ -870,7 +872,7 @@ static int __init arch_timer_init(void)
static int __init arch_timer_of_init(struct device_node *np)
{
- int i;
+ int i, ret;
if (arch_timers_present & ARCH_TIMER_TYPE_CP15) {
pr_warn("multiple nodes in dt, skipping\n");
@@ -902,6 +904,10 @@ static int __init arch_timer_of_init(struct device_node *np)
of_property_read_bool(np, "arm,cpu-registers-not-fw-configured"))
arch_timer_uses_ppi = ARCH_TIMER_PHYS_SECURE_PPI;
+ ret = arch_timer_uses_ppi_init();
+ if (ret)
+ return ret;
+
return arch_timer_init();
}
CLOCKSOURCE_OF_DECLARE(armv7_arch_timer, "arm,armv7-timer", arch_timer_of_init);
@@ -1011,6 +1017,7 @@ static int __init map_generic_timer_interrupt(u32 interrupt, u32 flags)
/* Initialize per-processor generic timer */
static int __init arch_timer_acpi_init(struct acpi_table_header *table)
{
+ int ret;
struct acpi_table_gtdt *gtdt;
if (arch_timers_present & ARCH_TIMER_TYPE_CP15) {
@@ -1041,6 +1048,10 @@ static int __init arch_timer_acpi_init(struct acpi_table_header *table)
/* Get the frequency from CNTFRQ */
arch_timer_detect_rate(NULL, NULL);
+ ret = arch_timer_uses_ppi_init();
+ if (ret)
+ return ret;
+
/* Always-on capability */
arch_timer_c3stop = !(gtdt->non_secure_el1_flags & ACPI_GTDT_ALWAYS_ON);
--
2.7.4
[toc] | [prev] | [next] | [standalone]
| From | Mark Rutland <mark.rutland@arm.com> |
|---|---|
| Date | 2016-11-18 20:40 +0100 |
| Subject | Re: [PATCH v16 06/15] clocksource/drivers/arm_arch_timer: separate out arch_timer_uses_ppi init code to prepare for GTDT. |
| Message-ID | <sEXaW-2W9-29@gated-at.bofh.it> |
| In reply to | #1523494 |
On Wed, Nov 16, 2016 at 09:48:59PM +0800, fu.wei@linaro.org wrote: > From: Fu Wei <fu.wei@linaro.org> > > The patch refactor original arch_timer_uses_ppi init code: > (1) Extract a subfunction: arch_timer_uses_ppi_init > (2) Use the new subfunction in arch_timer_of_init and > arch_timer_acpi_init This isn't a strict refactoring, since this now assigns ARCH_TIMER_PHYS_NONSECURE_PPI to arch_timer_uses_ppi, which we didn't do previously. As a general note, please write your commit messages as prose rather than a list of bullet points. Please also explain the rationale for the change, rather than enumerating the changes. Call out things which are important and/or likely to surprise reviewers, for example: * Can 32-bit ARM still use non-secure interrupts afer this change? * Does the "arm,cpu-registers-not-fw-configured" proeprty still work? That will make it vastly easier to have this code reviewed, and it will be far more helpful for anyone looking at this in future. For example: arm_arch_timer: rework PPI determination Currently, the arch timer driver uses ARCH_TIMER_PHYS_SECURE_PPI to mean the driver will use the secure PPI *and* potentialy also use the non-secure PPI. This is somewhat confusing. For arm64, where it never makes sense to use the secure PPI, this means we must always request the useless secure PPI, adding to the confusion. For ACPI, where we may not even have a valid secure PPI number, this is additionally problematic. We need the driver to be able to use *only* the non-secure PPI. The logic to choose which PPI to use is intertwined with other logic in arch_timer_init(). This patch factors the PPI determination out into a new function, and then reworks it so that we can handle having only a non-secure PPI. [...] > +/* > + * If HYP mode is available, we know that the physical timer > + * has been configured to be accessible from PL1. Use it, so > + * that a guest can use the virtual timer instead. > + * > + * If no interrupt provided for virtual timer, we'll have to > + * stick to the physical timer. It'd better be accessible... > + * On ARM64, we we only use ARCH_TIMER_PHYS_NONSECURE_PPI in Linux. It would be better to say that for arm64 we never use the secure interrupt. > + * > + * On ARMv8.1 with VH extensions, the kernel runs in HYP. VHE > + * accesses to CNTP_*_EL1 registers are silently redirected to > + * their CNTHP_*_EL2 counterparts, and use a different PPI > + * number. > + */ > +static int __init arch_timer_uses_ppi_init(void) It would be better to call this something like arch_timer_select_ppi(). As it stands, the name is difficult to read. > @@ -902,6 +904,10 @@ static int __init arch_timer_of_init(struct device_node *np) > of_property_read_bool(np, "arm,cpu-registers-not-fw-configured")) > arch_timer_uses_ppi = ARCH_TIMER_PHYS_SECURE_PPI; > > + ret = arch_timer_uses_ppi_init(); > + if (ret) > + return ret; This is clearly broken if you consider what the statement above is doing. Thanks, Mark.
[toc] | [prev] | [next] | [standalone]
| From | Fu Wei <fu.wei@linaro.org> |
|---|---|
| Date | 2016-11-21 10:50 +0100 |
| Subject | Re: [PATCH v16 06/15] clocksource/drivers/arm_arch_timer: separate out arch_timer_uses_ppi init code to prepare for GTDT. |
| Message-ID | <sFToB-7Sv-11@gated-at.bofh.it> |
| In reply to | #1525683 |
Hi Mark, On 19 November 2016 at 03:30, Mark Rutland <mark.rutland@arm.com> wrote: > On Wed, Nov 16, 2016 at 09:48:59PM +0800, fu.wei@linaro.org wrote: >> From: Fu Wei <fu.wei@linaro.org> >> >> The patch refactor original arch_timer_uses_ppi init code: >> (1) Extract a subfunction: arch_timer_uses_ppi_init >> (2) Use the new subfunction in arch_timer_of_init and >> arch_timer_acpi_init > > This isn't a strict refactoring, since this now assigns > ARCH_TIMER_PHYS_NONSECURE_PPI to arch_timer_uses_ppi, which we didn't do > previously. > > As a general note, please write your commit messages as prose rather > than a list of bullet points. Please also explain the rationale for the > change, rather than enumerating the changes. Call out things which are > important and/or likely to surprise reviewers, for example: > > * Can 32-bit ARM still use non-secure interrupts afer this change? > > * Does the "arm,cpu-registers-not-fw-configured" proeprty still work? > > That will make it vastly easier to have this code reviewed, and it will > be far more helpful for anyone looking at this in future. > > For example: > > arm_arch_timer: rework PPI determination > > Currently, the arch timer driver uses ARCH_TIMER_PHYS_SECURE_PPI to > mean the driver will use the secure PPI *and* potentialy also use the > non-secure PPI. This is somewhat confusing. > > For arm64, where it never makes sense to use the secure PPI, this > means we must always request the useless secure PPI, adding to the > confusion. For ACPI, where we may not even have a valid secure PPI > number, this is additionally problematic. We need the driver to be > able to use *only* the non-secure PPI. > > The logic to choose which PPI to use is intertwined with other logic > in arch_timer_init(). This patch factors the PPI determination out > into a new function, and then reworks it so that we can handle having > only a non-secure PPI. Great thanks for your example, will use this, :-) maybe add : For ARM32, it still can use non-secure interrupts after this change, and the "arm,cpu-registers-not-fw-configured" property still works. > > [...] > >> +/* >> + * If HYP mode is available, we know that the physical timer >> + * has been configured to be accessible from PL1. Use it, so >> + * that a guest can use the virtual timer instead. >> + * >> + * If no interrupt provided for virtual timer, we'll have to >> + * stick to the physical timer. It'd better be accessible... >> + * On ARM64, we we only use ARCH_TIMER_PHYS_NONSECURE_PPI in Linux. > > It would be better to say that for arm64 we never use the secure > interrupt. For ARM64, we never use the secure interrupt, so it will be set to ARCH_TIMER_PHYS_NONSECURE_PPI instead. > >> + * >> + * On ARMv8.1 with VH extensions, the kernel runs in HYP. VHE >> + * accesses to CNTP_*_EL1 registers are silently redirected to >> + * their CNTHP_*_EL2 counterparts, and use a different PPI >> + * number. >> + */ >> +static int __init arch_timer_uses_ppi_init(void) > > It would be better to call this something like arch_timer_select_ppi(). > As it stands, the name is difficult to read. Yes, good idea, will do > >> @@ -902,6 +904,10 @@ static int __init arch_timer_of_init(struct device_node *np) >> of_property_read_bool(np, "arm,cpu-registers-not-fw-configured")) >> arch_timer_uses_ppi = ARCH_TIMER_PHYS_SECURE_PPI; >> >> + ret = arch_timer_uses_ppi_init(); >> + if (ret) >> + return ret; > > This is clearly broken if you consider what the statement above is > doing. Maybe I misunderstand this, I tried to follow the original logic. Are you saying: we should use arch_timer_select_ppi() first, then (maybe) change arch_timer_uses_ppi according to "arm,cpu-registers-not-fw-configured"? Please correct me, if I misunderstand this. > > Thanks, > Mark. -- Best regards, Fu Wei Software Engineer Red Hat
[toc] | [prev] | [next] | [standalone]
| From | fu.wei@linaro.org |
|---|---|
| Date | 2016-11-16 15:00 +0100 |
| Subject | [PATCH v16 03/15] clocksource/drivers/arm_arch_timer: Improve printk relevant code |
| Message-ID | <sE8UO-3xZ-51@gated-at.bofh.it> |
| In reply to | #1523473 |
From: Fu Wei <fu.wei@linaro.org>
This patch defines pr_fmt(fmt) for all pr_* functions,
then the pr_* doesn't need to add "arch_timer:" everytime.
According to the suggestion from checkpatch.pl:
(1) delete some Blank Spaces in arch_timer_banner;
(2) delete a redundant Tab in a bland line of arch_timer_init(void)
No functional change.
Signed-off-by: Fu Wei <fu.wei@linaro.org>
Acked-by: Mark Rutland <mark.rutland@arm.com>
---
drivers/clocksource/arm_arch_timer.c | 49 ++++++++++++++++++------------------
1 file changed, 25 insertions(+), 24 deletions(-)
diff --git a/drivers/clocksource/arm_arch_timer.c b/drivers/clocksource/arm_arch_timer.c
index 63bb532..15341cf 100644
--- a/drivers/clocksource/arm_arch_timer.c
+++ b/drivers/clocksource/arm_arch_timer.c
@@ -32,6 +32,9 @@
#include <clocksource/arm_arch_timer.h>
+#undef pr_fmt
+#define pr_fmt(fmt) "arch_timer: " fmt
+
#define CNTTIDR 0x08
#define CNTTIDR_VIRT(n) (BIT(1) << ((n) * 4))
@@ -504,22 +507,22 @@ arch_timer_detect_rate(void __iomem *cntbase, struct device_node *np)
/* Check the timer frequency. */
if (arch_timer_rate == 0)
- pr_warn("Architected timer frequency not available\n");
+ pr_warn("frequency not available\n");
}
static void arch_timer_banner(unsigned type)
{
- pr_info("Architected %s%s%s timer(s) running at %lu.%02luMHz (%s%s%s).\n",
- type & ARCH_CP15_TIMER ? "cp15" : "",
- type == (ARCH_CP15_TIMER | ARCH_MEM_TIMER) ? " and " : "",
- type & ARCH_MEM_TIMER ? "mmio" : "",
- (unsigned long)arch_timer_rate / 1000000,
- (unsigned long)(arch_timer_rate / 10000) % 100,
- type & ARCH_CP15_TIMER ?
- (arch_timer_uses_ppi == VIRT_PPI) ? "virt" : "phys" :
+ pr_info("%s%s%s timer(s) running at %lu.%02luMHz (%s%s%s).\n",
+ type & ARCH_CP15_TIMER ? "cp15" : "",
+ type == (ARCH_CP15_TIMER | ARCH_MEM_TIMER) ? " and " : "",
+ type & ARCH_MEM_TIMER ? "mmio" : "",
+ (unsigned long)arch_timer_rate / 1000000,
+ (unsigned long)(arch_timer_rate / 10000) % 100,
+ type & ARCH_CP15_TIMER ?
+ (arch_timer_uses_ppi == VIRT_PPI) ? "virt" : "phys" :
"",
- type == (ARCH_CP15_TIMER | ARCH_MEM_TIMER) ? "/" : "",
- type & ARCH_MEM_TIMER ?
+ type == (ARCH_CP15_TIMER | ARCH_MEM_TIMER) ? "/" : "",
+ type & ARCH_MEM_TIMER ?
arch_timer_mem_use_virtual ? "virt" : "phys" :
"");
}
@@ -618,8 +621,7 @@ static void __init arch_counter_register(unsigned type)
static void arch_timer_stop(struct clock_event_device *clk)
{
- pr_debug("arch_timer_teardown disable IRQ%d cpu #%d\n",
- clk->irq, smp_processor_id());
+ pr_debug("disable IRQ%d cpu #%d\n", clk->irq, smp_processor_id());
disable_percpu_irq(arch_timer_ppi[arch_timer_uses_ppi]);
if (arch_timer_has_nonsecure_ppi())
@@ -712,8 +714,7 @@ static int __init arch_timer_register(void)
}
if (err) {
- pr_err("arch_timer: can't register interrupt %d (%d)\n",
- ppi, err);
+ pr_err("can't register interrupt %d (%d)\n", ppi, err);
goto out_free;
}
@@ -766,7 +767,7 @@ static int __init arch_timer_mem_register(void __iomem *base, unsigned int irq)
ret = request_irq(irq, func, IRQF_TIMER, "arch_mem_timer", &t->evt);
if (ret) {
- pr_err("arch_timer: Failed to request mem timer irq\n");
+ pr_err("Failed to request mem timer irq\n");
kfree(t);
}
@@ -844,7 +845,7 @@ static int __init arch_timer_init(void)
}
if (!has_ppi) {
- pr_warn("arch_timer: No interrupt available, giving up\n");
+ pr_warn("No interrupt available, giving up\n");
return -EINVAL;
}
}
@@ -858,7 +859,7 @@ static int __init arch_timer_init(void)
return ret;
arch_timer_kvm_info.virtual_irq = arch_timer_ppi[VIRT_PPI];
-
+
return 0;
}
@@ -867,7 +868,7 @@ static int __init arch_timer_of_init(struct device_node *np)
int i;
if (arch_timers_present & ARCH_CP15_TIMER) {
- pr_warn("arch_timer: multiple nodes in dt, skipping\n");
+ pr_warn("multiple nodes in dt, skipping\n");
return 0;
}
@@ -911,7 +912,7 @@ static int __init arch_timer_mem_init(struct device_node *np)
arch_timers_present |= ARCH_MEM_TIMER;
cntctlbase = of_iomap(np, 0);
if (!cntctlbase) {
- pr_err("arch_timer: Can't find CNTCTLBase\n");
+ pr_err("Can't find CNTCTLBase\n");
return -ENXIO;
}
@@ -926,7 +927,7 @@ static int __init arch_timer_mem_init(struct device_node *np)
u32 cntacr;
if (of_property_read_u32(frame, "frame-number", &n)) {
- pr_err("arch_timer: Missing frame-number\n");
+ pr_err("Missing frame-number\n");
of_node_put(frame);
goto out;
}
@@ -955,7 +956,7 @@ static int __init arch_timer_mem_init(struct device_node *np)
ret= -ENXIO;
base = arch_counter_base = of_iomap(best_frame, 0);
if (!base) {
- pr_err("arch_timer: Can't map frame's registers\n");
+ pr_err("Can't map frame's registers\n");
goto out;
}
@@ -966,7 +967,7 @@ static int __init arch_timer_mem_init(struct device_node *np)
ret = -EINVAL;
if (!irq) {
- pr_err("arch_timer: Frame missing %s irq",
+ pr_err("Frame missing %s irq",
arch_timer_mem_use_virtual ? "virt" : "phys");
goto out;
}
@@ -1008,7 +1009,7 @@ static int __init arch_timer_acpi_init(struct acpi_table_header *table)
struct acpi_table_gtdt *gtdt;
if (arch_timers_present & ARCH_CP15_TIMER) {
- pr_warn("arch_timer: already initialized, skipping\n");
+ pr_warn("already initialized, skipping\n");
return -EINVAL;
}
--
2.7.4
[toc] | [prev] | [next] | [standalone]
| From | fu.wei@linaro.org |
|---|---|
| Date | 2016-11-16 15:00 +0100 |
| Subject | [PATCH v16 02/15] clocksource/drivers/arm_arch_timer: Add a new enum for spi type |
| Message-ID | <sE8UP-3xZ-59@gated-at.bofh.it> |
| In reply to | #1523473 |
From: Fu Wei <fu.wei@linaro.org>
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 <fu.wei@linaro.org>
Acked-by: Mark Rutland <mark.rutland@arm.com>
---
drivers/clocksource/arm_arch_timer.c | 4 ++--
include/clocksource/arm_arch_timer.h | 6 ++++++
2 files changed, 8 insertions(+), 2 deletions(-)
diff --git a/drivers/clocksource/arm_arch_timer.c b/drivers/clocksource/arm_arch_timer.c
index 21068be..63bb532 100644
--- a/drivers/clocksource/arm_arch_timer.c
+++ b/drivers/clocksource/arm_arch_timer.c
@@ -960,9 +960,9 @@ static int __init arch_timer_mem_init(struct device_node *np)
}
if (arch_timer_mem_use_virtual)
- irq = irq_of_parse_and_map(best_frame, 1);
+ irq = irq_of_parse_and_map(best_frame, ARCH_TIMER_VIRT_SPI);
else
- irq = irq_of_parse_and_map(best_frame, 0);
+ irq = irq_of_parse_and_map(best_frame, ARCH_TIMER_PHYS_SPI);
ret = -EINVAL;
if (!irq) {
diff --git a/include/clocksource/arm_arch_timer.h b/include/clocksource/arm_arch_timer.h
index 557f869..d23c381 100644
--- a/include/clocksource/arm_arch_timer.h
+++ b/include/clocksource/arm_arch_timer.h
@@ -46,6 +46,12 @@ enum arch_timer_ppi_nr {
MAX_TIMER_PPI
};
+enum arch_timer_spi_nr {
+ ARCH_TIMER_PHYS_SPI,
+ ARCH_TIMER_VIRT_SPI,
+ ARCH_TIMER_MAX_TIMER_SPI
+};
+
#define ARCH_TIMER_PHYS_ACCESS 0
#define ARCH_TIMER_VIRT_ACCESS 1
#define ARCH_TIMER_MEM_PHYS_ACCESS 2
--
2.7.4
[toc] | [prev] | [next] | [standalone]
| From | fu.wei@linaro.org |
|---|---|
| Date | 2016-11-16 15:00 +0100 |
| Subject | [PATCH v16 09/15] clocksource/drivers/arm_arch_timer: Introduce some new structs to prepare for GTDT |
| Message-ID | <sE8UO-3xZ-57@gated-at.bofh.it> |
| In reply to | #1523473 |
From: Fu Wei <fu.wei@linaro.org>
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 <fu.wei@linaro.org>
---
include/clocksource/arm_arch_timer.h | 17 +++++++++++++++++
1 file changed, 17 insertions(+)
diff --git a/include/clocksource/arm_arch_timer.h b/include/clocksource/arm_arch_timer.h
index 2625ff1..cc986a3 100644
--- a/include/clocksource/arm_arch_timer.h
+++ b/include/clocksource/arm_arch_timer.h
@@ -57,6 +57,8 @@ enum arch_timer_spi_nr {
#define ARCH_TIMER_MEM_PHYS_ACCESS 2
#define ARCH_TIMER_MEM_VIRT_ACCESS 3
+#define ARCH_TIMER_MEM_MAX_FRAMES 8
+
#define ARCH_TIMER_USR_PCT_ACCESS_EN BIT(0) /* physical counter */
#define ARCH_TIMER_USR_VCT_ACCESS_EN BIT(1) /* virtual counter */
#define ARCH_TIMER_VIRT_EVT_EN BIT(2)
@@ -72,6 +74,21 @@ struct arch_timer_kvm_info {
int virtual_irq;
};
+struct arch_timer_mem_frame {
+ int frame_nr;
+ phys_addr_t cntbase;
+ size_t size;
+ int phys_irq;
+ int virt_irq;
+};
+
+struct arch_timer_mem {
+ phys_addr_t cntctlbase;
+ size_t size;
+ int num_frames;
+ struct arch_timer_mem_frame frame[ARCH_TIMER_MEM_MAX_FRAMES];
+};
+
#ifdef CONFIG_ARM_ARCH_TIMER
extern u32 arch_timer_get_rate(void);
--
2.7.4
[toc] | [prev] | [next] | [standalone]
| From | fu.wei@linaro.org |
|---|---|
| Date | 2016-11-16 15:00 +0100 |
| Subject | [PATCH v16 05/15] clocksource/drivers/arm_arch_timer: fix a bug in arch_timer_register about arch_timer_uses_ppi |
| Message-ID | <sE8UP-3xZ-63@gated-at.bofh.it> |
| In reply to | #1523473 |
From: Fu Wei <fu.wei@linaro.org>
The patch fix a potential bug about arch_timer_uses_ppi in
arch_timer_register.
On ARM64, we don't use ARCH_TIMER_PHYS_SECURE_PPI in Linux, so we will
just igorne it in init code. If arch_timer_uses_ppi is
ARCH_TIMER_PHYS_NONSECURE_PPI, the orignal code of
arch_timer_uses_ppi may go wrong.
Signed-off-by: Fu Wei <fu.wei@linaro.org>
---
drivers/clocksource/arm_arch_timer.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/clocksource/arm_arch_timer.c b/drivers/clocksource/arm_arch_timer.c
index dd1040d..6de164f 100644
--- a/drivers/clocksource/arm_arch_timer.c
+++ b/drivers/clocksource/arm_arch_timer.c
@@ -699,7 +699,7 @@ static int __init arch_timer_register(void)
case ARCH_TIMER_PHYS_NONSECURE_PPI:
err = request_percpu_irq(ppi, arch_timer_handler_phys,
"arch_timer", arch_timer_evt);
- if (!err && arch_timer_ppi[ARCH_TIMER_PHYS_NONSECURE_PPI]) {
+ if (!err && arch_timer_has_nonsecure_ppi()) {
ppi = arch_timer_ppi[ARCH_TIMER_PHYS_NONSECURE_PPI];
err = request_percpu_irq(ppi, arch_timer_handler_phys,
"arch_timer", arch_timer_evt);
--
2.7.4
[toc] | [prev] | [next] | [standalone]
| From | Mark Rutland <mark.rutland@arm.com> |
|---|---|
| Date | 2016-11-18 20:00 +0100 |
| Subject | Re: [PATCH v16 05/15] clocksource/drivers/arm_arch_timer: fix a bug in arch_timer_register about arch_timer_uses_ppi |
| Message-ID | <sEWyf-2tW-59@gated-at.bofh.it> |
| In reply to | #1523498 |
On Wed, Nov 16, 2016 at 09:48:58PM +0800, fu.wei@linaro.org wrote:
> From: Fu Wei <fu.wei@linaro.org>
>
> The patch fix a potential bug about arch_timer_uses_ppi in
> arch_timer_register.
> On ARM64, we don't use ARCH_TIMER_PHYS_SECURE_PPI in Linux, so we will
> just igorne it in init code.
That's not currently the case. I assume you mean we will in later
patches? If so, please make that clear in the commit message.
> If arch_timer_uses_ppi is ARCH_TIMER_PHYS_NONSECURE_PPI, the orignal
> code of arch_timer_uses_ppi may go wrong.
How? What specifically happens?
We don't currently assign ARCH_TIMER_PHYS_NONSECURE_PPI to
arch_timer_uses_ppi, so I assume a later patch changes this. This change
should be folded into said patch; it doesn't make sense in isolation.
Thanks,
Mark.
> Signed-off-by: Fu Wei <fu.wei@linaro.org>
> ---
> drivers/clocksource/arm_arch_timer.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/clocksource/arm_arch_timer.c b/drivers/clocksource/arm_arch_timer.c
> index dd1040d..6de164f 100644
> --- a/drivers/clocksource/arm_arch_timer.c
> +++ b/drivers/clocksource/arm_arch_timer.c
> @@ -699,7 +699,7 @@ static int __init arch_timer_register(void)
> case ARCH_TIMER_PHYS_NONSECURE_PPI:
> err = request_percpu_irq(ppi, arch_timer_handler_phys,
> "arch_timer", arch_timer_evt);
> - if (!err && arch_timer_ppi[ARCH_TIMER_PHYS_NONSECURE_PPI]) {
> + if (!err && arch_timer_has_nonsecure_ppi()) {
> ppi = arch_timer_ppi[ARCH_TIMER_PHYS_NONSECURE_PPI];
> err = request_percpu_irq(ppi, arch_timer_handler_phys,
> "arch_timer", arch_timer_evt);
> --
> 2.7.4
>
[toc] | [prev] | [next] | [standalone]
| From | Fu Wei <fu.wei@linaro.org> |
|---|---|
| Date | 2016-11-21 08:40 +0100 |
| Subject | Re: [PATCH v16 05/15] clocksource/drivers/arm_arch_timer: fix a bug in arch_timer_register about arch_timer_uses_ppi |
| Message-ID | <sFRmN-6Ce-1@gated-at.bofh.it> |
| In reply to | #1525654 |
Hi Mark,
On 19 November 2016 at 02:52, Mark Rutland <mark.rutland@arm.com> wrote:
> On Wed, Nov 16, 2016 at 09:48:58PM +0800, fu.wei@linaro.org wrote:
>> From: Fu Wei <fu.wei@linaro.org>
>>
>> The patch fix a potential bug about arch_timer_uses_ppi in
>> arch_timer_register.
>> On ARM64, we don't use ARCH_TIMER_PHYS_SECURE_PPI in Linux, so we will
>> just igorne it in init code.
>
> That's not currently the case. I assume you mean we will in later
> patches? If so, please make that clear in the commit message.
>
>> If arch_timer_uses_ppi is ARCH_TIMER_PHYS_NONSECURE_PPI, the orignal
>> code of arch_timer_uses_ppi may go wrong.
>
> How? What specifically happens?
>
> We don't currently assign ARCH_TIMER_PHYS_NONSECURE_PPI to
> arch_timer_uses_ppi, so I assume a later patch changes this. This change
> should be folded into said patch; it doesn't make sense in isolation.
yes, this patch is a preparation for the next which may set
arch_timer_use_ppi as ARCH_TIMER_PHYS_NONSECURE_PPI.
So you are right, I will merge this into the next and mention this
change in the commit message.
Great thanks
>
> Thanks,
> Mark.
>
>> Signed-off-by: Fu Wei <fu.wei@linaro.org>
>> ---
>> drivers/clocksource/arm_arch_timer.c | 2 +-
>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/drivers/clocksource/arm_arch_timer.c b/drivers/clocksource/arm_arch_timer.c
>> index dd1040d..6de164f 100644
>> --- a/drivers/clocksource/arm_arch_timer.c
>> +++ b/drivers/clocksource/arm_arch_timer.c
>> @@ -699,7 +699,7 @@ static int __init arch_timer_register(void)
>> case ARCH_TIMER_PHYS_NONSECURE_PPI:
>> err = request_percpu_irq(ppi, arch_timer_handler_phys,
>> "arch_timer", arch_timer_evt);
>> - if (!err && arch_timer_ppi[ARCH_TIMER_PHYS_NONSECURE_PPI]) {
>> + if (!err && arch_timer_has_nonsecure_ppi()) {
>> ppi = arch_timer_ppi[ARCH_TIMER_PHYS_NONSECURE_PPI];
>> err = request_percpu_irq(ppi, arch_timer_handler_phys,
>> "arch_timer", arch_timer_evt);
>> --
>> 2.7.4
>>
--
Best regards,
Fu Wei
Software Engineer
Red Hat
[toc] | [prev] | [next] | [standalone]
| From | Xiongfeng Wang <wangxiongfeng2@huawei.com> |
|---|---|
| Date | 2016-11-17 04:50 +0100 |
| Subject | Re: [PATCH v16 00/15] acpi, clocksource: add GTDT driver and GTDT support in arm_arch_timer |
| Message-ID | <sElS1-3EH-13@gated-at.bofh.it> |
| In reply to | #1523473 |
Tested-by: wangxiongfeng2@huawei.com on D05 board. On 2016/11/16 21:48, fu.wei@linaro.org wrote: > From: Fu Wei <fu.wei@linaro.org> > > This patchset: > (1)Preparation for adding GTDT support in arm_arch_timer: > 1. Move some enums and marcos to header file; > 2. Add a new enum for spi type; > 3. Improve printk relevant code. > 4. rename some enums and defines, and some cleanups. > 5. separate out arch_timer_uses_ppi init code and fix a potential bug > 6. Refactor arch_timer_detect_rate to keep dt code only in *_of_init > 7. Refactor arch_timer_needs_probing, and call it only if acpi disabled. > 8. Introduce some new structs and refactor the timer init code > > (2)Introduce ACPI GTDT parser: drivers/acpi/arm64/acpi_gtdt.c > Parse all kinds of timer in GTDT table of ACPI:arch timer, > memory-mapped timer and SBSA Generic Watchdog timer. > This driver can help to simplify all the relevant timer drivers, > and separate all the ACPI GTDT knowledge from them. > > (3)Simplify ACPI code for arm_arch_timer > > (4)Add GTDT support for ARM memory-mapped timer, also refactor > original memory-mapped timer dt support for reusing some common > code. > > This patchset has been tested on the following platforms with ACPI enabled: > (1)ARM Foundation v8 model > > Changelog: > v16: https://lkml.org/lkml/2016/ > Fix patchset problem about static enum ppi_nr of 01/13 in v15. > Refactor arch_timer_detect_rate. > Refactor arch_timer_needs_probing. > > v15: https://lkml.org/lkml/2016/11/15/366 > Re-order patches > Add arm_arch_timer refactoring patches to prepare for GTDT: > 1. rename some enums and defines, and some cleanups > 2. separate out arch_timer_uses_ppi init code and fix a potential bug > 3. Improve some new structs, refactor the timer init code. > Since the some structs have been changed, GTDT parser for memory-mapped > timer and SBSA Generic Watchdog timer have been update. > > v14: https://lkml.org/lkml/2016/9/28/573 > Separate memory-mapped timer GTDT support into two patches > 1. Refactor the timer init code to prepare for GTDT > 2. Add GTDT support for memory-mapped timer > > v13: http://www.mail-archive.com/linux-kernel@vger.kernel.org/msg1231717.html > Improve arm_arch_timer code for memory-mapped > timer GTDT support, refactor original memory-mapped timer > dt support for reusing some common code. > > v12: https://lkml.org/lkml/2016/9/13/250 > Rebase to latest Linux 4.8-rc6 > Delete the confusing "skipping" in the error message. > > V11: https://lkml.org/lkml/2016/9/6/354 > Rebase to latest Linux 4.8-rc5 > Delete typedef (suggested by checkpatch.pl) > > V10: https://lkml.org/lkml/2016/7/26/215 > Drop the "readq" patch. > Rebase to latest Linux 4.7. > > V9: https://lkml.org/lkml/2016/7/25/345 > Improve pr_err message in acpi gtdt driver. > Update Commit message for 7/9 > shorten the irq mapping function name > Improve GTDT driver for memory-mapped timer > > v8: https://lkml.org/lkml/2016/7/19/660 > Improve "pr_fmt(fmt)" definition: add "ACPI" in front of "GTDT", > and also improve printk message. > Simplify is_timer_block and is_watchdog. > Merge acpi_gtdt_desc_init and gtdt_arch_timer_init into acpi_gtdt_init(); > Delete __init in include/linux/acpi.h for GTDT API > Make ARM64 select GTDT. > Delete "#include <linux/module.h>" from acpi_gtdt.c > Simplify GT block parse code. > > v7: https://lkml.org/lkml/2016/7/13/769 > Move the GTDT driver to drivers/acpi/arm64 > Add add the ARM64-specific ACPI Support maintainers in MAINTAINERS > Merge 3 patches of GTDT parser driver. > Fix the for_each_platform_timer bug. > > v6: https://lkml.org/lkml/2016/6/29/580 > split the GTDT driver to 4 parts: basic, arch_timer, memory-mapped timer, > and SBSA Generic Watchdog timer > Improve driver by suggestions and example code from Daniel Lezcano > > v5: https://lkml.org/lkml/2016/5/24/356 > Sorting out all patches, simplify the API of GTDT driver: > GTDT driver just fills the data struct for arm_arch_timer driver. > > v4: https://lists.linaro.org/pipermail/linaro-acpi/2016-March/006667.html > Delete the kvm relevant patches > Separate two patches for sorting out the code for arm_arch_timer. > Improve irq info export code to allow missing irq info in GTDT table. > > v3: https://lkml.org/lkml/2016/2/1/658 > Improve GTDT driver code: > (1)improve pr_* by defining pr_fmt(fmt) > (2)simplify gtdt_sbsa_gwdt_init > (3)improve gtdt_arch_timer_data_init, if table is NULL, it will try > to get GTDT table. > Move enum ppi_nr to arm_arch_timer.h, and add enum spi_nr. > Add arm_arch_timer get ppi from DT and GTDT support for kvm. > > v2: https://lkml.org/lkml/2015/12/2/10 > Rebase to latest kernel version(4.4-rc3). > Fix the bug about the config problem, > use CONFIG_ACPI_GTDT instead of CONFIG_ACPI in arm_arch_timer.c > > v1: The first upstreaming version: https://lkml.org/lkml/2015/10/28/553 > > Fu Wei (15): > clocksource/drivers/arm_arch_timer: Move enums and defines to header > file > clocksource/drivers/arm_arch_timer: Add a new enum for spi type > clocksource/drivers/arm_arch_timer: Improve printk relevant code > clocksource/drivers/arm_arch_timer: rename some enums and defines, and > some cleanups. > clocksource/drivers/arm_arch_timer: fix a bug in arch_timer_register > about arch_timer_uses_ppi > clocksource/drivers/arm_arch_timer: separate out arch_timer_uses_ppi > init code to prepare for GTDT. > clocksource/drivers/arm_arch_timer: Refactor arch_timer_detect_rate to > keep dt code in *_of_init > clocksource/drivers/arm_arch_timer: Refactor arch_timer_needs_probing, > and call it only if acpi disabled. > clocksource/drivers/arm_arch_timer: Introduce some new structs to > prepare for GTDT > clocksource/drivers/arm_arch_timer: Refactor the timer init code to > prepare for GTDT > acpi/arm64: Add GTDT table parse driver > clocksource/drivers/arm_arch_timer: Simplify ACPI support code. > acpi/arm64: Add memory-mapped timer support in GTDT driver > clocksource/drivers/arm_arch_timer: Add GTDT support for memory-mapped > timer > acpi/arm64: Add SBSA Generic Watchdog support in GTDT driver > > arch/arm64/Kconfig | 1 + > drivers/acpi/arm64/Kconfig | 3 + > drivers/acpi/arm64/Makefile | 1 + > drivers/acpi/arm64/gtdt.c | 411 +++++++++++++++++++++++++++++ > drivers/clocksource/arm_arch_timer.c | 484 ++++++++++++++++++++--------------- > drivers/watchdog/Kconfig | 1 + > include/clocksource/arm_arch_timer.h | 61 ++++- > include/linux/acpi.h | 8 + > virt/kvm/arm/hyp/timer-sr.c | 6 +- > 9 files changed, 759 insertions(+), 217 deletions(-) > create mode 100644 drivers/acpi/arm64/gtdt.c >
[toc] | [prev] | [next] | [standalone]
| From | Xiongfeng Wang <wangxiongfeng2@huawei.com> |
|---|---|
| Date | 2016-11-17 10:40 +0100 |
| Subject | Re: [PATCH v16 00/15] acpi, clocksource: add GTDT driver and GTDT support in arm_arch_timer |
| Message-ID | <sErkK-7f8-27@gated-at.bofh.it> |
| In reply to | #1524074 |
Sorry for not describing specifically in the last mail. I have applied all the patches of this patchset on Linux 4.9, and tested the per-cpu timer and sbsa watchdog part, which function well on D05 board. On 2016/11/17 11:34, Xiongfeng Wang wrote: > Tested-by: wangxiongfeng2@huawei.com on D05 board. > > > On 2016/11/16 21:48, fu.wei@linaro.org wrote: >> From: Fu Wei <fu.wei@linaro.org> >> >> This patchset: >> (1)Preparation for adding GTDT support in arm_arch_timer: >> 1. Move some enums and marcos to header file; >> 2. Add a new enum for spi type; >> 3. Improve printk relevant code. >> 4. rename some enums and defines, and some cleanups. >> 5. separate out arch_timer_uses_ppi init code and fix a potential bug >> 6. Refactor arch_timer_detect_rate to keep dt code only in *_of_init >> 7. Refactor arch_timer_needs_probing, and call it only if acpi disabled. >> 8. Introduce some new structs and refactor the timer init code >> >> (2)Introduce ACPI GTDT parser: drivers/acpi/arm64/acpi_gtdt.c >> Parse all kinds of timer in GTDT table of ACPI:arch timer, >> memory-mapped timer and SBSA Generic Watchdog timer. >> This driver can help to simplify all the relevant timer drivers, >> and separate all the ACPI GTDT knowledge from them. >> >> (3)Simplify ACPI code for arm_arch_timer >> >> (4)Add GTDT support for ARM memory-mapped timer, also refactor >> original memory-mapped timer dt support for reusing some common >> code. >> >> This patchset has been tested on the following platforms with ACPI enabled: >> (1)ARM Foundation v8 model >> >> Changelog: >> v16: https://lkml.org/lkml/2016/ >> Fix patchset problem about static enum ppi_nr of 01/13 in v15. >> Refactor arch_timer_detect_rate. >> Refactor arch_timer_needs_probing. >> >> v15: https://lkml.org/lkml/2016/11/15/366 >> Re-order patches >> Add arm_arch_timer refactoring patches to prepare for GTDT: >> 1. rename some enums and defines, and some cleanups >> 2. separate out arch_timer_uses_ppi init code and fix a potential bug >> 3. Improve some new structs, refactor the timer init code. >> Since the some structs have been changed, GTDT parser for memory-mapped >> timer and SBSA Generic Watchdog timer have been update. >> >> v14: https://lkml.org/lkml/2016/9/28/573 >> Separate memory-mapped timer GTDT support into two patches >> 1. Refactor the timer init code to prepare for GTDT >> 2. Add GTDT support for memory-mapped timer >> >> v13: http://www.mail-archive.com/linux-kernel@vger.kernel.org/msg1231717.html >> Improve arm_arch_timer code for memory-mapped >> timer GTDT support, refactor original memory-mapped timer >> dt support for reusing some common code. >> >> v12: https://lkml.org/lkml/2016/9/13/250 >> Rebase to latest Linux 4.8-rc6 >> Delete the confusing "skipping" in the error message. >> >> V11: https://lkml.org/lkml/2016/9/6/354 >> Rebase to latest Linux 4.8-rc5 >> Delete typedef (suggested by checkpatch.pl) >> >> V10: https://lkml.org/lkml/2016/7/26/215 >> Drop the "readq" patch. >> Rebase to latest Linux 4.7. >> >> V9: https://lkml.org/lkml/2016/7/25/345 >> Improve pr_err message in acpi gtdt driver. >> Update Commit message for 7/9 >> shorten the irq mapping function name >> Improve GTDT driver for memory-mapped timer >> >> v8: https://lkml.org/lkml/2016/7/19/660 >> Improve "pr_fmt(fmt)" definition: add "ACPI" in front of "GTDT", >> and also improve printk message. >> Simplify is_timer_block and is_watchdog. >> Merge acpi_gtdt_desc_init and gtdt_arch_timer_init into acpi_gtdt_init(); >> Delete __init in include/linux/acpi.h for GTDT API >> Make ARM64 select GTDT. >> Delete "#include <linux/module.h>" from acpi_gtdt.c >> Simplify GT block parse code. >> >> v7: https://lkml.org/lkml/2016/7/13/769 >> Move the GTDT driver to drivers/acpi/arm64 >> Add add the ARM64-specific ACPI Support maintainers in MAINTAINERS >> Merge 3 patches of GTDT parser driver. >> Fix the for_each_platform_timer bug. >> >> v6: https://lkml.org/lkml/2016/6/29/580 >> split the GTDT driver to 4 parts: basic, arch_timer, memory-mapped timer, >> and SBSA Generic Watchdog timer >> Improve driver by suggestions and example code from Daniel Lezcano >> >> v5: https://lkml.org/lkml/2016/5/24/356 >> Sorting out all patches, simplify the API of GTDT driver: >> GTDT driver just fills the data struct for arm_arch_timer driver. >> >> v4: https://lists.linaro.org/pipermail/linaro-acpi/2016-March/006667.html >> Delete the kvm relevant patches >> Separate two patches for sorting out the code for arm_arch_timer. >> Improve irq info export code to allow missing irq info in GTDT table. >> >> v3: https://lkml.org/lkml/2016/2/1/658 >> Improve GTDT driver code: >> (1)improve pr_* by defining pr_fmt(fmt) >> (2)simplify gtdt_sbsa_gwdt_init >> (3)improve gtdt_arch_timer_data_init, if table is NULL, it will try >> to get GTDT table. >> Move enum ppi_nr to arm_arch_timer.h, and add enum spi_nr. >> Add arm_arch_timer get ppi from DT and GTDT support for kvm. >> >> v2: https://lkml.org/lkml/2015/12/2/10 >> Rebase to latest kernel version(4.4-rc3). >> Fix the bug about the config problem, >> use CONFIG_ACPI_GTDT instead of CONFIG_ACPI in arm_arch_timer.c >> >> v1: The first upstreaming version: https://lkml.org/lkml/2015/10/28/553 >> >> Fu Wei (15): >> clocksource/drivers/arm_arch_timer: Move enums and defines to header >> file >> clocksource/drivers/arm_arch_timer: Add a new enum for spi type >> clocksource/drivers/arm_arch_timer: Improve printk relevant code >> clocksource/drivers/arm_arch_timer: rename some enums and defines, and >> some cleanups. >> clocksource/drivers/arm_arch_timer: fix a bug in arch_timer_register >> about arch_timer_uses_ppi >> clocksource/drivers/arm_arch_timer: separate out arch_timer_uses_ppi >> init code to prepare for GTDT. >> clocksource/drivers/arm_arch_timer: Refactor arch_timer_detect_rate to >> keep dt code in *_of_init >> clocksource/drivers/arm_arch_timer: Refactor arch_timer_needs_probing, >> and call it only if acpi disabled. >> clocksource/drivers/arm_arch_timer: Introduce some new structs to >> prepare for GTDT >> clocksource/drivers/arm_arch_timer: Refactor the timer init code to >> prepare for GTDT >> acpi/arm64: Add GTDT table parse driver >> clocksource/drivers/arm_arch_timer: Simplify ACPI support code. >> acpi/arm64: Add memory-mapped timer support in GTDT driver >> clocksource/drivers/arm_arch_timer: Add GTDT support for memory-mapped >> timer >> acpi/arm64: Add SBSA Generic Watchdog support in GTDT driver >> >> arch/arm64/Kconfig | 1 + >> drivers/acpi/arm64/Kconfig | 3 + >> drivers/acpi/arm64/Makefile | 1 + >> drivers/acpi/arm64/gtdt.c | 411 +++++++++++++++++++++++++++++ >> drivers/clocksource/arm_arch_timer.c | 484 ++++++++++++++++++++--------------- >> drivers/watchdog/Kconfig | 1 + >> include/clocksource/arm_arch_timer.h | 61 ++++- >> include/linux/acpi.h | 8 + >> virt/kvm/arm/hyp/timer-sr.c | 6 +- >> 9 files changed, 759 insertions(+), 217 deletions(-) >> create mode 100644 drivers/acpi/arm64/gtdt.c >> > > > . >
[toc] | [prev] | [next] | [standalone]
| From | Fu Wei <fu.wei@linaro.org> |
|---|---|
| Date | 2016-11-17 12:20 +0100 |
| Subject | Re: [PATCH v16 00/15] acpi, clocksource: add GTDT driver and GTDT support in arm_arch_timer |
| Message-ID | <sEsTv-8pd-17@gated-at.bofh.it> |
| In reply to | #1524194 |
Hi Xiongfeng On 17 November 2016 at 17:25, Xiongfeng Wang <wangxiongfeng2@huawei.com> wrote: > > Sorry for not describing specifically in the last mail. > I have applied all the patches of this patchset on Linux 4.9, and tested > the per-cpu timer and sbsa watchdog part, which function well on D05 board. Thanks for your testing, So I will apply your Tested-by in 1~8, 11, 12, 15 in my next patchset. > > On 2016/11/17 11:34, Xiongfeng Wang wrote: >> Tested-by: wangxiongfeng2@huawei.com on D05 board. >> >> >> On 2016/11/16 21:48, fu.wei@linaro.org wrote: >>> From: Fu Wei <fu.wei@linaro.org> >>> >>> This patchset: >>> (1)Preparation for adding GTDT support in arm_arch_timer: >>> 1. Move some enums and marcos to header file; >>> 2. Add a new enum for spi type; >>> 3. Improve printk relevant code. >>> 4. rename some enums and defines, and some cleanups. >>> 5. separate out arch_timer_uses_ppi init code and fix a potential bug >>> 6. Refactor arch_timer_detect_rate to keep dt code only in *_of_init >>> 7. Refactor arch_timer_needs_probing, and call it only if acpi disabled. >>> 8. Introduce some new structs and refactor the timer init code >>> >>> (2)Introduce ACPI GTDT parser: drivers/acpi/arm64/acpi_gtdt.c >>> Parse all kinds of timer in GTDT table of ACPI:arch timer, >>> memory-mapped timer and SBSA Generic Watchdog timer. >>> This driver can help to simplify all the relevant timer drivers, >>> and separate all the ACPI GTDT knowledge from them. >>> >>> (3)Simplify ACPI code for arm_arch_timer >>> >>> (4)Add GTDT support for ARM memory-mapped timer, also refactor >>> original memory-mapped timer dt support for reusing some common >>> code. >>> >>> This patchset has been tested on the following platforms with ACPI enabled: >>> (1)ARM Foundation v8 model >>> >>> Changelog: >>> v16: https://lkml.org/lkml/2016/ >>> Fix patchset problem about static enum ppi_nr of 01/13 in v15. >>> Refactor arch_timer_detect_rate. >>> Refactor arch_timer_needs_probing. >>> >>> v15: https://lkml.org/lkml/2016/11/15/366 >>> Re-order patches >>> Add arm_arch_timer refactoring patches to prepare for GTDT: >>> 1. rename some enums and defines, and some cleanups >>> 2. separate out arch_timer_uses_ppi init code and fix a potential bug >>> 3. Improve some new structs, refactor the timer init code. >>> Since the some structs have been changed, GTDT parser for memory-mapped >>> timer and SBSA Generic Watchdog timer have been update. >>> >>> v14: https://lkml.org/lkml/2016/9/28/573 >>> Separate memory-mapped timer GTDT support into two patches >>> 1. Refactor the timer init code to prepare for GTDT >>> 2. Add GTDT support for memory-mapped timer >>> >>> v13: http://www.mail-archive.com/linux-kernel@vger.kernel.org/msg1231717.html >>> Improve arm_arch_timer code for memory-mapped >>> timer GTDT support, refactor original memory-mapped timer >>> dt support for reusing some common code. >>> >>> v12: https://lkml.org/lkml/2016/9/13/250 >>> Rebase to latest Linux 4.8-rc6 >>> Delete the confusing "skipping" in the error message. >>> >>> V11: https://lkml.org/lkml/2016/9/6/354 >>> Rebase to latest Linux 4.8-rc5 >>> Delete typedef (suggested by checkpatch.pl) >>> >>> V10: https://lkml.org/lkml/2016/7/26/215 >>> Drop the "readq" patch. >>> Rebase to latest Linux 4.7. >>> >>> V9: https://lkml.org/lkml/2016/7/25/345 >>> Improve pr_err message in acpi gtdt driver. >>> Update Commit message for 7/9 >>> shorten the irq mapping function name >>> Improve GTDT driver for memory-mapped timer >>> >>> v8: https://lkml.org/lkml/2016/7/19/660 >>> Improve "pr_fmt(fmt)" definition: add "ACPI" in front of "GTDT", >>> and also improve printk message. >>> Simplify is_timer_block and is_watchdog. >>> Merge acpi_gtdt_desc_init and gtdt_arch_timer_init into acpi_gtdt_init(); >>> Delete __init in include/linux/acpi.h for GTDT API >>> Make ARM64 select GTDT. >>> Delete "#include <linux/module.h>" from acpi_gtdt.c >>> Simplify GT block parse code. >>> >>> v7: https://lkml.org/lkml/2016/7/13/769 >>> Move the GTDT driver to drivers/acpi/arm64 >>> Add add the ARM64-specific ACPI Support maintainers in MAINTAINERS >>> Merge 3 patches of GTDT parser driver. >>> Fix the for_each_platform_timer bug. >>> >>> v6: https://lkml.org/lkml/2016/6/29/580 >>> split the GTDT driver to 4 parts: basic, arch_timer, memory-mapped timer, >>> and SBSA Generic Watchdog timer >>> Improve driver by suggestions and example code from Daniel Lezcano >>> >>> v5: https://lkml.org/lkml/2016/5/24/356 >>> Sorting out all patches, simplify the API of GTDT driver: >>> GTDT driver just fills the data struct for arm_arch_timer driver. >>> >>> v4: https://lists.linaro.org/pipermail/linaro-acpi/2016-March/006667.html >>> Delete the kvm relevant patches >>> Separate two patches for sorting out the code for arm_arch_timer. >>> Improve irq info export code to allow missing irq info in GTDT table. >>> >>> v3: https://lkml.org/lkml/2016/2/1/658 >>> Improve GTDT driver code: >>> (1)improve pr_* by defining pr_fmt(fmt) >>> (2)simplify gtdt_sbsa_gwdt_init >>> (3)improve gtdt_arch_timer_data_init, if table is NULL, it will try >>> to get GTDT table. >>> Move enum ppi_nr to arm_arch_timer.h, and add enum spi_nr. >>> Add arm_arch_timer get ppi from DT and GTDT support for kvm. >>> >>> v2: https://lkml.org/lkml/2015/12/2/10 >>> Rebase to latest kernel version(4.4-rc3). >>> Fix the bug about the config problem, >>> use CONFIG_ACPI_GTDT instead of CONFIG_ACPI in arm_arch_timer.c >>> >>> v1: The first upstreaming version: https://lkml.org/lkml/2015/10/28/553 >>> >>> Fu Wei (15): >>> clocksource/drivers/arm_arch_timer: Move enums and defines to header >>> file >>> clocksource/drivers/arm_arch_timer: Add a new enum for spi type >>> clocksource/drivers/arm_arch_timer: Improve printk relevant code >>> clocksource/drivers/arm_arch_timer: rename some enums and defines, and >>> some cleanups. >>> clocksource/drivers/arm_arch_timer: fix a bug in arch_timer_register >>> about arch_timer_uses_ppi >>> clocksource/drivers/arm_arch_timer: separate out arch_timer_uses_ppi >>> init code to prepare for GTDT. >>> clocksource/drivers/arm_arch_timer: Refactor arch_timer_detect_rate to >>> keep dt code in *_of_init >>> clocksource/drivers/arm_arch_timer: Refactor arch_timer_needs_probing, >>> and call it only if acpi disabled. >>> clocksource/drivers/arm_arch_timer: Introduce some new structs to >>> prepare for GTDT >>> clocksource/drivers/arm_arch_timer: Refactor the timer init code to >>> prepare for GTDT >>> acpi/arm64: Add GTDT table parse driver >>> clocksource/drivers/arm_arch_timer: Simplify ACPI support code. >>> acpi/arm64: Add memory-mapped timer support in GTDT driver >>> clocksource/drivers/arm_arch_timer: Add GTDT support for memory-mapped >>> timer >>> acpi/arm64: Add SBSA Generic Watchdog support in GTDT driver >>> >>> arch/arm64/Kconfig | 1 + >>> drivers/acpi/arm64/Kconfig | 3 + >>> drivers/acpi/arm64/Makefile | 1 + >>> drivers/acpi/arm64/gtdt.c | 411 +++++++++++++++++++++++++++++ >>> drivers/clocksource/arm_arch_timer.c | 484 ++++++++++++++++++++--------------- >>> drivers/watchdog/Kconfig | 1 + >>> include/clocksource/arm_arch_timer.h | 61 ++++- >>> include/linux/acpi.h | 8 + >>> virt/kvm/arm/hyp/timer-sr.c | 6 +- >>> 9 files changed, 759 insertions(+), 217 deletions(-) >>> create mode 100644 drivers/acpi/arm64/gtdt.c >>> >> >> >> . >> > -- Best regards, Fu Wei Software Engineer Red Hat
[toc] | [prev] | [next] | [standalone]
| From | Daniel Lezcano <daniel.lezcano@linaro.org> |
|---|---|
| Date | 2016-11-17 10:50 +0100 |
| Subject | Re: [PATCH v16 00/15] acpi, clocksource: add GTDT driver and GTDT support in arm_arch_timer |
| Message-ID | <sEruq-7iB-27@gated-at.bofh.it> |
| In reply to | #1523473 |
On Wed, Nov 16, 2016 at 09:48:53PM +0800, fu.wei@linaro.org wrote: > From: Fu Wei <fu.wei@linaro.org> > > This patchset: > (1)Preparation for adding GTDT support in arm_arch_timer: > 1. Move some enums and marcos to header file; > 2. Add a new enum for spi type; > 3. Improve printk relevant code. > 4. rename some enums and defines, and some cleanups. > 5. separate out arch_timer_uses_ppi init code and fix a potential bug > 6. Refactor arch_timer_detect_rate to keep dt code only in *_of_init > 7. Refactor arch_timer_needs_probing, and call it only if acpi disabled. > 8. Introduce some new structs and refactor the timer init code > > (2)Introduce ACPI GTDT parser: drivers/acpi/arm64/acpi_gtdt.c > Parse all kinds of timer in GTDT table of ACPI:arch timer, > memory-mapped timer and SBSA Generic Watchdog timer. > This driver can help to simplify all the relevant timer drivers, > and separate all the ACPI GTDT knowledge from them. > > (3)Simplify ACPI code for arm_arch_timer > > (4)Add GTDT support for ARM memory-mapped timer, also refactor > original memory-mapped timer dt support for reusing some common > code. > > This patchset has been tested on the following platforms with ACPI enabled: > (1)ARM Foundation v8 model > > Changelog: > v16: https://lkml.org/lkml/2016/ > Fix patchset problem about static enum ppi_nr of 01/13 in v15. > Refactor arch_timer_detect_rate. > Refactor arch_timer_needs_probing. Most of the patches are touching drivers/clocksource and others acpi. Through which tree this patchset should go ?
[toc] | [prev] | [standalone]
Page 2 of 2 — ← Prev page 1 [2]
Back to top | Article view | linux.kernel
csiph-web