counter: microchip-tcb-capture: Allow shared IRQ for multi-channel TCBs
Subsystems (3)
PATCH 1/1 counter: microchip-tcb-capture: Allow shared IRQ for multi-channel TCBs
Mark the interrupt as IRQF_SHARED to permit multiple counter channels to share the same TCB IRQ line.
Each Timer/Counter Block (TCB) instance shares a single IRQ line among its three internal channels. When multiple counter channels (e.g., counter@0 and counter@1) within the same TCB are enabled, the second call to devm_request_irq() fails because the IRQ line is already requested by the first channel.
--- drivers/counter/microchip-tcb-capture.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/counter/microchip-tcb-capture.c +1 -1
@@ -451,7 +451,7 @@ static void mchp_tc_irq_remove(void *ptr)static int mchp_tc_irq_enable (struct counter_device *const counter,int irq) {struct mchp_tc_data *const priv =counter_priv (counter); -int ret =devm_request_irq (counter->parent, irq, mchp_tc_isr,0 , +int ret =devm_request_irq (counter->parent, irq, mchp_tc_isr,IRQF_SHARED ,dev_name (counter->parent), counter);if (ret <0 )
---
base-commit: fd94619c43360eb44d28bd3ef326a4f85c600a07
change-id: 20251006-microchip-tcb-edd8aeae36c4
Best regards,
Signature · 1 line
Dharma Balasubiramani <[email protected]>
On Mon, Oct 06, 2025 at 04:21:50PM +0530, Dharma Balasubiramani wrote:
Hello Dharma,
Quoted 30 lines
Mark the interrupt as
IRQF_SHAREDto permit multiple counter channels to share the same TCB IRQ line.Each Timer/Counter Block (TCB) instance shares a single IRQ line among its three internal channels. When multiple counter channels (e.g., counter@0 and counter@1) within the same TCB are enabled, the second call to
devm_request_irq()fails because the IRQ line is already requested by the first channel.Fixes e5d581396821 ("counter: microchip-tcb-capture: Add IRQ handling")Signed-off-by Dharma Balasubiramani <[email protected]>--- drivers/counter/microchip-tcb-capture.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/counter/microchip-tcb-capture.c +1
-2@@ -451,7 +451,7 @@ static void mchp_tc_irq_remove(void *ptr)static int mchp_tc_irq_enable (struct counter_device *const counter,int irq) {struct mchp_tc_data *const priv =counter_priv (counter); -int ret =devm_request_irq (counter->parent, irq, mchp_tc_isr,0 , +int ret =devm_request_irq (counter->parent, irq, mchp_tc_isr,IRQF_SHARED ,dev_name (counter->parent), counter);if (ret <0 ) ---
Quoted 3 lines
base-commit:
fd94619c43360eb44d28bd3ef326a4f85c600a07
change-id: 20251006-microchip-tcb-edd8aeae36c4
This change makes sense, thanks !
Quoted 4 lines
Best regards,
--
Dharma Balasubiramani <[email protected]>
--
Kamel Bouhara, Bootlin
Embedded Linux and kernel engineering
https://bootlin.com
Bence Csókás
Reviewed-byRe:
Hi,
Quoted 47 lines · Dharma Balasubiramani
Hello Dharma,
Quoted 30 lines
Mark the interrupt as
IRQF_SHAREDto permit multiple counter channels to share the same TCB IRQ line.Each Timer/Counter Block (TCB) instance shares a single IRQ line among its three internal channels. When multiple counter channels (e.g., counter@0 and counter@1) within the same TCB are enabled, the second call to
devm_request_irq()fails because the IRQ line is already requested by the first channel.Fixes e5d581396821 ("counter: microchip-tcb-capture: Add IRQ handling")Signed-off-by Dharma Balasubiramani <[email protected]>--- drivers/counter/microchip-tcb-capture.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/counter/microchip-tcb-capture.c +1
-2@@ -451,7 +451,7 @@ static void mchp_tc_irq_remove(void *ptr)static int mchp_tc_irq_enable (struct counter_device *const counter,int irq) {struct mchp_tc_data *const priv =counter_priv (counter); -int ret =devm_request_irq (counter->parent, irq, mchp_tc_isr,0 , +int ret =devm_request_irq (counter->parent, irq, mchp_tc_isr,IRQF_SHARED ,dev_name (counter->parent), counter);if (ret <0 ) ---Quoted 3 lines
base-commit:
fd94619c43360eb44d28bd3ef326a4f85c600a07
change-id: 20251006-microchip-tcb-edd8aeae36c4This change makes sense, thanks !
Reviewed-by Kamel Bouhara <[email protected]>Quoted 4 lines
Best regards,
--
Dharma Balasubiramani <[email protected]>
Quoted 4 lines
--
Kamel Bouhara, Bootlin
Embedded Linux and kernel engineering
https://bootlin.com
Looks reasonable to me as well.
Quoted 10 lines · Dharma Balasubiramani
Mark the interrupt as
IRQF_SHAREDto permit multiple counter channels to share the same TCB IRQ line.Each Timer/Counter Block (TCB) instance shares a single IRQ line among its three internal channels. When multiple counter channels (e.g., counter@0 and counter@1) within the same TCB are enabled, the second call to
devm_request_irq()fails because the IRQ line is already requested by the first channel.[...]
Applied, thanks!
[1/1] counter: microchip-tcb-capture: Allow shared IRQ for multi-channel TCBs
commit: 109ff654934a4752f8875ded672efd1fbfe4d31d
Best regards,
Signature · 1 line
William Breathitt Gray <[email protected]>