Add the driver for Intel Keem Bay SoC timer block
Subsystems (2)
v6 cover Add the driver for Intel Keem Bay SoC timer block
From: Shruthi Sanil <[email protected]>
The timer block supports 1 64-bit free running counter and 8 32-bit general purpose timers.
Patch 1 holds the device tree binding documentation. Patch 2 holds the device driver.
This driver is tested on the Keem Bay evaluation module board.
Changes since v5:
- Created a MFD device for the common configuration register in the device tree bindings.
- Updated the timer driver with the MFD framework to access the common configuration register.
Changes since v4:
- Updated the description in the device tree bindings.
- Updated the unit address of all the timers and counter in the device tree binding.
Changes since v3:
- Update in KConfig file to support COMPILE_TEST for Keem Bay timer.
- Update in device tree bindings to remove status field.
- Update in device tree bindings to remove 64-bit address space for the child nodes by using non-empty ranges.
Changes since v2:
- Add multi timer support.
- Update in the device tree binding to support multi timers.
- Code optimization.
Changes since v1:
- Add support for KEEMBAY_TIMER to get selected through Kconfig.platforms.
- Add CLOCK_EVT_FEAT_DYNIRQ as part of clockevent feature.
- Avoid overlapping reg regions across 2 device nodes.
- Simplify 2 device nodes as 1 because both are from same IP block.
- Adapt the driver code according to the new simplified devicetree.
Shruthi Sanil (2):
dt-bindings: timer: Add bindings for Intel Keem Bay SoC Timer
clocksource: Add Intel Keem Bay timer support
.../bindings/timer/intel,keembay-timer.yaml | 173 ++++++++++++ MAINTAINERS | 5 + drivers/clocksource/Kconfig | 11 + drivers/clocksource/Makefile | 1 + drivers/clocksource/timer-keembay.c | 252 ++++++++++++++++++ 5 files changed, 442 insertions(+) create mode 100644 Documentation/devicetree/bindings/timer/intel,keembay-timer.yaml create mode 100644 drivers/clocksource/timer-keembay.c
base-commit: 27151f177827d478508e756c7657273261aaf8a9
Signature · 1 line
2.17.1
PATCH v6 1/2 dt-bindings: timer: Add bindings for Intel Keem Bay SoC Timer
From: Shruthi Sanil <[email protected]>
Add Device Tree bindings for the Timer IP, which can be used as clocksource and clockevent device in the Intel Keem Bay SoC.
--- .../bindings/timer/intel,keembay-timer.yaml | 173 ++++++++++++++++++ 1 file changed, 173 insertions(+) create mode 100644 Documentation/devicetree/bindings/timer/intel,keembay-timer.yaml
Documentation/devicetree/bindings/timer/intel,keembay-timer.yaml new file +173 -0
@@ -0,0 +1,173 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/timer/intel,keembay-timer.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Intel Keem Bay SoC Timers + +maintainers: + - Shruthi Sanil <[email protected]> + +description: | + The Intel Keem Bay timer driver supports 1 free running counter and 8 timers. + Each timer is capable of generating inividual interrupt. + Both the features are enabled through the timer general config register. + + The parent node represents the common general configuration details and + the child nodes represents the counter and timers. + +properties: + compatible: + enum: + - simple-mfd + - intel, keembay-gpt-creg + + reg: + description: General configuration register address and length. + maxItems: 1 + + ranges: true + + "#address-cells": + const: 1 + + "#size-cells": + const: 1 + +required: + - compatible + - reg + - ranges + - "#address-cells" + - "#size-cells" + +patternProperties: + "^counter@[0-9a-f]+$": + type: object + description: Properties for Intel Keem Bay counter + + properties: + compatible: + enum: + - intel,keembay-counter + + reg: + maxItems: 1 + + clocks: + maxItems: 1 + + required: + - compatible + - reg + - clocks + + "^timer@[0-9a-f]+$": + type: object + description: Properties for Intel Keem Bay timer + + properties: + compatible: + enum: + - intel,keembay-timer + + reg: + maxItems: 1 + + interrupts: + maxItems: 1 + + clocks: + maxItems: 1 + + required: + - compatible + - reg + - interrupts + - clocks + +additionalProperties: false + +examples: + - | + #include <dt-bindings/interrupt-controller/arm-gic.h> + #include <dt-bindings/interrupt-controller/irq.h> + #define KEEM_BAY_A53_TIM + + soc { + #address-cells = <0x2>; + #size-cells = <0x2>; + + gpt@20331000 { + compatible = "intel,keembay-gpt-creg", "simple-mfd"; + reg = <0x0 0x20331000 0x0 0xc>; + ranges = <0x0 0x0 0x20330000 0xF0>; + #address-cells = <0x1>; + #size-cells = <0x1>; + + counter@e8 { + compatible = "intel,keembay-counter"; + reg = <0xe8 0x8>; + clocks = <&scmi_clk KEEM_BAY_A53_TIM>; + }; + + timer@10 { + compatible = "intel,keembay-timer"; + reg = <0x10 0xc>; + interrupts = <GIC_SPI 0x3 IRQ_TYPE_LEVEL_HIGH>; + clocks = <&scmi_clk KEEM_BAY_A53_TIM>; + }; + + timer@20 { + compatible = "intel,keembay-timer"; + reg = <0x20 0xc>; + interrupts = <GIC_SPI 0x4 IRQ_TYPE_LEVEL_HIGH>; + clocks = <&scmi_clk KEEM_BAY_A53_TIM>; + }; + + timer@30 { + compatible = "intel,keembay-timer"; + reg = <0x30 0xc>; + interrupts = <GIC_SPI 0x5 IRQ_TYPE_LEVEL_HIGH>; + clocks = <&scmi_clk KEEM_BAY_A53_TIM>; + }; + + timer@40 { + compatible = "intel,keembay-timer"; + reg = <0x40 0xc>; + interrupts = <GIC_SPI 0x6 IRQ_TYPE_LEVEL_HIGH>; + clocks = <&scmi_clk KEEM_BAY_A53_TIM>; + }; + + timer@50 { + compatible = "intel,keembay-timer"; + reg = <0x50 0xc>; + interrupts = <GIC_SPI 0x7 IRQ_TYPE_LEVEL_HIGH>; + clocks = <&scmi_clk KEEM_BAY_A53_TIM>; + }; + + timer@60 { + compatible = "intel,keembay-timer"; + reg = <0x60 0xc>; + interrupts = <GIC_SPI 0x8 IRQ_TYPE_LEVEL_HIGH>; + clocks = <&scmi_clk KEEM_BAY_A53_TIM>; + }; + + timer@70 { + compatible = "intel,keembay-timer"; + reg = <0x70 0xc>; + interrupts = <GIC_SPI 0x9 IRQ_TYPE_LEVEL_HIGH>; + clocks = <&scmi_clk KEEM_BAY_A53_TIM>; + }; + + timer@80 { + compatible = "intel,keembay-timer"; + reg = <0x80 0xc>; + interrupts = <GIC_SPI 0xa IRQ_TYPE_LEVEL_HIGH>; + clocks = <&scmi_clk KEEM_BAY_A53_TIM>; + }; + }; + }; + +...
Signature · 1 line
2.17.1
Rob Herring
maintainerRe: [PATCH v6 1/2] dt-bindings: timer: Add bindings for Intel Keem Bay SoC Timer
Quoted 5 lines · On Tue, 07 Sep 2021 00:06:20 +0530, [email protected] wrote:
From: Shruthi Sanil <[email protected]>
Add Device Tree bindings for the Timer IP, which can be used as clocksource and clockevent device in the Intel Keem Bay SoC.
Quoted 7 lines
Reviewed-by Andy Shevchenko <[email protected]>Signed-off-by Shruthi Sanil <[email protected]>--- .../bindings/timer/intel,keembay-timer.yaml | 173 ++++++++++++++++++ 1 file changed, 173 insertions(+) create mode 100644 Documentation/devicetree/bindings/timer/intel,keembay-timer.yaml
My bot found errors running 'make DT_CHECKER_FLAGS=-m dt_binding_check' on your patch (DT_CHECKER_FLAGS is new in v5.13):
yamllint warnings/errors:
dtschema/dtc warnings/errors:Documentation/devicetree/bindings/timer/intel,keembay-timer.example.dt.yaml:0:0: /example-0/soc/gpt@20331000: failed to match any schema with compatible: ['intel,keembay-gpt-creg', 'simple-mfd']
doc reference errors (make refcheckdocs):
See https://patchwork.ozlabs.org/patch/1525030
This check can fail if there are any dependencies. The base for a patch series is generally the most recent rc1.
If you already ran 'make dt_binding_check' and didn't see the above error(s), then make sure 'yamllint' is installed and dt-schema is up to date:
pip3 install dtschema --upgrade
Please check and re-submit.
PATCH v6 2/2 clocksource: Add Intel Keem Bay timer support
In reply to [email protected]From: Shruthi Sanil <[email protected]>
The Intel Keem Bay timer driver supports clocksource and clockevent features for the timer IP used in Intel Keem Bay SoC.
The timer block supports 1 free running counter and 8 timers. The free running counter can be used as a clocksource and the timers can be used as clockevent. Each timer is capable of generating individual interrupt.
Both the features are enabled through the timer general config register.
--- MAINTAINERS | 5 + drivers/clocksource/Kconfig | 11 ++ drivers/clocksource/Makefile | 1 + drivers/clocksource/timer-keembay.c | 252 ++++++++++++++++++++++++++++ 4 files changed, 269 insertions(+) create mode 100644 drivers/clocksource/timer-keembay.c
MAINTAINERS +5 -0
@@ -9506,6 +9506,11 @@ F: drivers/crypto/keembay/keembay-ocs-hcu-core.c F: drivers/crypto/keembay/ocs-hcu.c F: drivers/crypto/keembay/ocs-hcu.h +INTEL KEEM BAY TIMER SUPPORT +M: Shruthi Sanil <[email protected]> +S: Maintained +F: drivers/clocksource/timer-keembay.c + INTEL MANAGEMENT ENGINE (mei) M: Tomas Winkler <[email protected]> L: [email protected]
drivers/clocksource/Kconfig +11 -0
@@ -708,4 +708,15 @@ config MICROCHIP_PIT64B modes and high resolution. It is used as a clocksource and a clockevent. +config KEEMBAY_TIMER + bool "Intel Keem Bay timer" + depends on ARCH_KEEMBAY || COMPILE_TEST + select TIMER_OF + help + This option enables the support for the Intel Keem Bay + general purpose timer and free running counter driver. + Each timer can generate an individual interrupt and + supports oneshot and periodic modes. + The 64-bit counter can be used as a clock source. + endmenu
drivers/clocksource/Makefile +1 -0
@@ -88,3 +88,4 @@ obj-$(CONFIG_CSKY_MP_TIMER) += timer-mp-csky.o obj-$(CONFIG_GX6605S_TIMER) += timer-gx6605s.o obj-$(CONFIG_HYPERV_TIMER) += hyperv_timer.o obj-$(CONFIG_MICROCHIP_PIT64B) += timer-microchip-pit64b.o +obj-$(CONFIG_KEEMBAY_TIMER) += timer-keembay.o
drivers/clocksource/timer-keembay.c new file +252 -0
252 lines not on this page · raw message
Signature · 1 line
2.17.1
Re: [PATCH v6 2/2] clocksource: Add Intel Keem Bay timer support
drivers/clocksource/timer-keembay.c line 158
Quoted 10 lines · shruthi sanil
drivers/clocksource/timer-keembay.c new file +9
-0+ +/* Provides a unique ID for each timer */ +static DEFINE_IDA (keembay_timer_ida); + + timer_id =ida_alloc (&keembay_timer_ida,GFP_KERNEL ); +if (timer_id <0 ) { + ret = timer_id; + goto err_keembay_ce_to_free; + }
May I ask what the purpose of the IDA, which is backed by a full blown xarray, is here?
AFAICT all you want is a unique number for the timer name for up to 8 timers.
drivers/clocksource/timer-keembay.c line 160
Quoted 1 line
drivers/clocksource/timer-keembay.c new file +1
-0+ timer_name =kasprintf (GFP_KERNEL ,"keembay_timer%d" , timer_id);
So what's wrong about:
static unsigned int keembay_timer_id;
timer_name = kasprintf(GFP_KERNEL, "keembay_timer%d", keembay_timer_id++);
Hmm?
drivers/clocksource/timer-keembay.c line 192
Quoted 5 lines
drivers/clocksource/timer-keembay.c new file +5
-0+ +clockevents_config_and_register (&keembay_ce_to->clkevt, +timer_of_rate (keembay_ce_to), +1 , +U32_MAX );
Aside of that what's the point of registering more than one of those timers as clock event? The core will only use one and the rest is just going to use memory for no value.
Thanks,
tglx
RE: [PATCH v6 2/2] clocksource: Add Intel Keem Bay timer support
Quoted 34 lines
-----Original Message-----
From: Thomas Gleixner <[email protected]>
Sent: Monday, September 27, 2021 3:11 AM
To: Sanil, Shruthi <[email protected]>; [email protected]; [email protected]; [email protected]; [email protected]
Cc: [email protected]; [email protected]; [email protected]; Thokala, Srikanth <[email protected]>; Raja Subramanian, Lakshmi Bai <[email protected]>; Sangannavar, Mallikarjunappa <[email protected]>; Sanil, Shruthi <[email protected]>
Subject: Re: [PATCH v6 2/2] clocksource: Add Intel Keem Bay timer supportdrivers/clocksource/timer-keembay.c line 158
Quoted 10 lines · shruthi sanil
drivers/clocksource/timer-keembay.c new file +9
-0+ +/* Provides a unique ID for each timer */ static +DEFINE_IDA (keembay_timer_ida); + + timer_id =ida_alloc (&keembay_timer_ida,GFP_KERNEL ); +if (timer_id <0 ) { + ret = timer_id; + goto err_keembay_ce_to_free; + }May I ask what the purpose of the IDA, which is backed by a full blown xarray, is here?
AFAICT all you want is a unique number for the timer name for up to 8 timers.
Review
Quoted 1 line
(quoted diff) +1
-0+ timer_name = kasprintf(GFP_KERNEL, "keembay_timer%d",
timer_id);
Quoted 8 lines
So what's wrong about:
static unsigned int
keembay_timer_id;
timer_name= kasprintf(GFP_KERNEL, "keembay_timer%d",
keembay_timer_id++);Hmm?
Yes, we had initially implemented it in the similar way, but in the course of review it got changed to use IDA.
Quoted 10 lines
drivers/clocksource/timer-keembay.c line 192
Quoted 6 lines
drivers/clocksource/timer-keembay.c new file +5
-0+ +clockevents_config_and_register (&keembay_ce_to->clkevt, +timer_of_rate (keembay_ce_to), +1 , +U32_MAX );Aside of that what's the point of registering more than one of those timers as clock event? The core will only use one and the rest is just going to use memory for no value.
Instead ofkeembay_ce_to->clkevt.cpumask = cpumask_of(0);
can I update it askeembay_ce_to->clkevt.cpumask = cpu_possible_mask; so that each timer would be associated with different cores?
Thanks,
Shruthi
Quoted 4 lines
Thanks,
tglx
Re: [PATCH v6 2/2] clocksource: Add Intel Keem Bay timer support
Quoted 57 lines · Shruthi
Quoted 34 lines
-----Original Message-----
From: Thomas Gleixner <[email protected]>
Sent: Monday, September 27, 2021 3:11 AM
To: Sanil, Shruthi <[email protected]>; [email protected]; [email protected]; [email protected]; [email protected]
Cc: [email protected]; [email protected]; [email protected]; Thokala, Srikanth <[email protected]>; Raja Subramanian, Lakshmi Bai <[email protected]>; Sangannavar, Mallikarjunappa <[email protected]>; Sanil, Shruthi <[email protected]>
Subject: Re: [PATCH v6 2/2] clocksource: Add Intel Keem Bay timer supportdrivers/clocksource/timer-keembay.c line 158
Quoted 10 lines · shruthi sanil
drivers/clocksource/timer-keembay.c new file +9
-0+ +/* Provides a unique ID for each timer */ static +DEFINE_IDA (keembay_timer_ida); + + timer_id =ida_alloc (&keembay_timer_ida,GFP_KERNEL ); +if (timer_id <0 ) { + ret = timer_id; + goto err_keembay_ce_to_free; + }May I ask what the purpose of the IDA, which is backed by a full blown xarray, is here?
AFAICT all you want is a unique number for the timer name for up to 8 timers.
Review
Quoted 1 line
(quoted diff) +1
-0+ timer_name = kasprintf(GFP_KERNEL, "keembay_timer%d",
timer_id);Quoted 8 lines
So what's wrong about:
static unsigned int
keembay_timer_id;
timer_name= kasprintf(GFP_KERNEL, "keembay_timer%d",
keembay_timer_id++);Hmm?
Yes, we had initially implemented it in the similar way, but in the course of review it got changed to use IDA.
Quoted 10 lines
drivers/clocksource/timer-keembay.c line 192
Quoted 6 lines
drivers/clocksource/timer-keembay.c new file +5
-0+ +clockevents_config_and_register (&keembay_ce_to->clkevt, +timer_of_rate (keembay_ce_to), +1 , +U32_MAX );Aside of that what's the point of registering more than one of those timers as clock event? The core will only use one and the rest is just going to use memory for no value.
Quoted 5 lines
Instead of
keembay_ce_to->clkevt.cpumask=cpumask_of(0);
can I update it askeembay_ce_to->clkevt.cpumask=cpu_possible_mask; so that each timer would be associated with different cores?
Let me try to clarify:
The Intel Keem bay Soc is a 4 x Cortex-A53
The arch ARM timer is per CPU on this platform.
Case 1:
-------
- the architected timer is not desired and this timer is wanted to be
used instead (but rating tells the opposite) => rewrite per cpu code
Case 2:
-------
- the architected timer are desired and this timer is used as a
broadcast timer when a core is going done with cpuidle. One timer is needed.
- In order to prevent useless wakeup, the timer uses the flag DYNIRQ.
However, cpumask_of(0) is set and makes inoperative this flag. In order to make full use of it, clkevt.cpumask must be cpu_possible_mask
Hope that helps
-- Daniel
Signature · 5 lines
<http://www.linaro.org/> Linaro.org │ Open source software for ARM SoCs Follow Linaro: <http://www.facebook.com/pages/Linaro> Facebook | <http://twitter.com/#!/linaroorg> Twitter | <http://www.linaro.org/linaro-blog/> Blog
RE: [PATCH v6 2/2] clocksource: Add Intel Keem Bay timer support
Quoted 95 lines
-----Original Message-----
From: Daniel Lezcano <[email protected]>
Sent: Thursday, December 23, 2021 7:46 PM
To: Sanil, Shruthi <[email protected]>; Thomas Gleixner <[email protected]>; [email protected]; [email protected]; [email protected]
Cc: [email protected]; [email protected]; [email protected]; Thokala, Srikanth <[email protected]>; Raja Subramanian, Lakshmi Bai <[email protected]>; Sangannavar, Mallikarjunappa <[email protected]>
Subject: Re: [PATCH v6 2/2] clocksource: Add Intel Keem Bay timer supportQuoted 4 lines · Shruthi
Quoted 4 lines
-----Original Message-----
From: Thomas Gleixner <[email protected]>
Sent: Monday, September 27, 2021 3:11 AM
To: Sanil, Shruthi <[email protected]>;Quoted 8 lines
Quoted 8 lines
[email protected];
[email protected]; [email protected]; [email protected]
Cc: [email protected]; [email protected]; [email protected]; Thokala, Srikanth <[email protected]>; Raja Subramanian, Lakshmi Bai <[email protected]>;
Sangannavar, MallikarjunappaQuoted 48 lines
Quoted 25 lines
Sanil, Shruthi <[email protected]>
Subject: Re: [PATCH v6 2/2] clocksource: Add Intel Keem Bay timer supportdrivers/clocksource/timer-keembay.c line 158
Quoted 10 lines · shruthi sanil
drivers/clocksource/timer-keembay.c new file +9
-0+ +/* Provides a unique ID for each timer */ static +DEFINE_IDA (keembay_timer_ida); + + timer_id =ida_alloc (&keembay_timer_ida,GFP_KERNEL ); +if (timer_id <0 ) { + ret = timer_id; + goto err_keembay_ce_to_free; + }May I ask what the purpose of the IDA, which is backed by a full blown xarray, is here?
AFAICT all you want is a unique number for the timer name for up to 8 timers.
Review
Quoted 1 line
(quoted diff) +1
-0+ timer_name = kasprintf(GFP_KERNEL, "keembay_timer%d",
timer_id);Quoted 8 lines
So what's wrong about:
static unsigned int
keembay_timer_id;
timer_name= kasprintf(GFP_KERNEL, "keembay_timer%d",
keembay_timer_id++);Hmm?
Yes, we had initially implemented it in the similar way, but in the course of review it got changed to use IDA.
Quoted 10 lines
drivers/clocksource/timer-keembay.c line 192
Quoted 6 lines
drivers/clocksource/timer-keembay.c new file +5
-0+ +clockevents_config_and_register (&keembay_ce_to->clkevt, +timer_of_rate (keembay_ce_to), +1 , +U32_MAX );Aside of that what's the point of registering more than one of those timers as clock event? The core will only use one and the rest is just going to use memory for no value.
Quoted 4 lines
Instead of
keembay_ce_to->clkevt.cpumask=cpumask_of(0); can I update it askeembay_ce_to->clkevt.cpumask=cpu_possible_mask; so that each timer would be associated with different cores?Let me try to clarify:
The Intel Keem bay Soc is a 4 x Cortex-A53
The arch ARM timer is per CPU on this platform.
Case 1:
-------
- the architected timer is not desired and this timer is wanted to be used
instead (but rating tells the opposite) => rewrite per cpu codeCase 2:
-------
- the architected timer are desired and this timer is used as a broadcast
timer when a core is going done with cpuidle. One timer is needed.
Quoted 8 lines
- In order to prevent useless wakeup, the timer uses the flag DYNIRQ.
However,cpumask_of(0)is set and makes inoperative this flag. In order to make full use of it, clkevt.cpumask must becpu_possible_maskHope that helps
-- Daniel
Thank You Daniel for the explanation.
In case of KMB, we are using the ARM architecture timer.
We would be using the timer for case2. So I need to register Just 1 timer. I'll check and make the changes accordingly and submit the next patch.
Thank You!
Regards,
Shruthi
Quoted 13 lines
--
<http://www.linaro.org/> Linaro.org │ Open source software for ARM SoCsFollow Linaro: <http://www.facebook.com/pages/Linaro> Facebook |
<http://twitter.com/#!/linaroorg> Twitter | <http://www.linaro.org/linaro-
blog/> Blog
RE: [PATCH v6 2/2] clocksource: Add Intel Keem Bay timer support
In reply to Thomas GleixnerHi Thomas
Quoted 72 lines
-----Original Message-----
From: Sanil, Shruthi
Sent: Thursday, November 11, 2021 4:12 PM
To: Thomas Gleixner <[email protected]>; [email protected]; [email protected]; [email protected]; [email protected]
Cc: [email protected]; [email protected]; [email protected]; Thokala, Srikanth <[email protected]>; Raja Subramanian, Lakshmi Bai <[email protected]>; Sangannavar, Mallikarjunappa <[email protected]>
Subject: RE: [PATCH v6 2/2] clocksource: Add Intel Keem Bay timer supportQuoted 37 lines
-----Original Message-----
From: Thomas Gleixner <[email protected]>
Sent: Monday, September 27, 2021 3:11 AM
To: Sanil, Shruthi <[email protected]>; [email protected];
[email protected]; [email protected]; [email protected]
Cc: [email protected]; [email protected]; [email protected]; Thokala, Srikanth <[email protected]>; Raja Subramanian, Lakshmi Bai <[email protected]>;
Sangannavar, Mallikarjunappa <[email protected]>; Sanil, Shruthi <[email protected]>
Subject: Re: [PATCH v6 2/2] clocksource: Add Intel Keem Bay timer supportdrivers/clocksource/timer-keembay.c line 158
Quoted 10 lines · shruthi sanil
drivers/clocksource/timer-keembay.c new file +9
-0+ +/* Provides a unique ID for each timer */ static +DEFINE_IDA (keembay_timer_ida); + + timer_id =ida_alloc (&keembay_timer_ida,GFP_KERNEL ); +if (timer_id <0 ) { + ret = timer_id; + goto err_keembay_ce_to_free; + }May I ask what the purpose of the IDA, which is backed by a full blown xarray, is here?
AFAICT all you want is a unique number for the timer name for up to 8 timers.
Review
Quoted 1 line
(quoted diff) +1
-0+ timer_name = kasprintf(GFP_KERNEL, "keembay_timer%d",
timer_id);Quoted 8 lines
So what's wrong about:
static unsigned int
keembay_timer_id;
timer_name= kasprintf(GFP_KERNEL, "keembay_timer%d",
keembay_timer_id++);Hmm?
Yes, we had initially implemented it in the similar way, but in the course of review it got changed to use IDA.
Quoted 10 lines
drivers/clocksource/timer-keembay.c line 192
Quoted 6 lines
drivers/clocksource/timer-keembay.c new file +5
-0+ +clockevents_config_and_register (&keembay_ce_to->clkevt, +timer_of_rate (keembay_ce_to), +1 , +U32_MAX );Aside of that what's the point of registering more than one of those timers as clock event? The core will only use one and the rest is just going to use memory for no value.
Quoted 5 lines
Instead of
keembay_ce_to->clkevt.cpumask=cpumask_of(0); can I update it askeembay_ce_to->clkevt.cpumask=cpu_possible_mask; so that each timer would be associated with different cores?
Could you please help me with the above query?
Thanks,
Shruthi
Quoted 7 lines
Thanks,
ShruthiQuoted 4 lines
Thanks,
tglx
RE: [PATCH v6 2/2] clocksource: Add Intel Keem Bay timer support
In reply to Thomas GleixnerHi Thomas,
Could you please help with the query addressed below regarding multiple timers?
Quoted 107 lines
-----Original Message-----
From: Sanil, Shruthi
Sent: Thursday, November 25, 2021 10:59 PM
To: Thomas Gleixner <[email protected]>; [email protected]; [email protected]; [email protected]; [email protected]
Cc: [email protected]; [email protected]; [email protected]; Thokala, Srikanth <[email protected]>; Raja Subramanian, Lakshmi Bai <[email protected]>; Sangannavar, Mallikarjunappa <[email protected]>
Subject: RE: [PATCH v6 2/2] clocksource: Add Intel Keem Bay timer supportHi Thomas
Quoted 75 lines
-----Original Message-----
From: Sanil, Shruthi
Sent: Thursday, November 11, 2021 4:12 PM
To: Thomas Gleixner <[email protected]>; [email protected]; [email protected]; [email protected]; [email protected]
Cc: [email protected]; [email protected]; [email protected]; Thokala, Srikanth <[email protected]>; Raja Subramanian, Lakshmi Bai <[email protected]>;
Sangannavar, Mallikarjunappa <[email protected]>
Subject: RE: [PATCH v6 2/2] clocksource: Add Intel Keem Bay timer supportQuoted 38 lines
-----Original Message-----
From: Thomas Gleixner <[email protected]>
Sent: Monday, September 27, 2021 3:11 AM
To: Sanil, Shruthi <[email protected]>; [email protected];
[email protected]; [email protected]; [email protected]
Cc: [email protected]; [email protected]; [email protected]; Thokala, Srikanth <[email protected]>; Raja Subramanian, Lakshmi Bai <[email protected]>;
Sangannavar, Mallikarjunappa <[email protected]>;
Sanil, Shruthi <[email protected]>
Subject: Re: [PATCH v6 2/2] clocksource: Add Intel Keem Bay timer supportdrivers/clocksource/timer-keembay.c line 158
Quoted 10 lines · shruthi sanil
drivers/clocksource/timer-keembay.c new file +9
-0+ +/* Provides a unique ID for each timer */ static +DEFINE_IDA (keembay_timer_ida); + + timer_id =ida_alloc (&keembay_timer_ida,GFP_KERNEL ); +if (timer_id <0 ) { + ret = timer_id; + goto err_keembay_ce_to_free; + }May I ask what the purpose of the IDA, which is backed by a full blown xarray, is here?
AFAICT all you want is a unique number for the timer name for up to 8 timers.
Review
Quoted 1 line
(quoted diff) +1
-0+ timer_name = kasprintf(GFP_KERNEL, "keembay_timer%d",
timer_id);Quoted 8 lines
So what's wrong about:
static unsigned int
keembay_timer_id;
timer_name= kasprintf(GFP_KERNEL, "keembay_timer%d",
keembay_timer_id++);Hmm?
Yes, we had initially implemented it in the similar way, but in the course of review it got changed to use IDA.
Quoted 10 lines
drivers/clocksource/timer-keembay.c line 192
Quoted 6 lines
drivers/clocksource/timer-keembay.c new file +5
-0+ +clockevents_config_and_register (&keembay_ce_to->clkevt, +timer_of_rate (keembay_ce_to), +1 , +U32_MAX );Aside of that what's the point of registering more than one of those timers as clock event? The core will only use one and the rest is just going to use memory for no value.
Quoted 5 lines
Instead of
keembay_ce_to->clkevt.cpumask=cpumask_of(0); can I update it askeembay_ce_to->clkevt.cpumask=cpu_possible_mask; so that each timer would be associated with different cores?Could you please help me with the above query?
Thanks,
ShruthiQuoted 7 lines
Thanks,
ShruthiQuoted 4 lines
Thanks,
tglx