ARM: S5PV310: Optimize interrupt source searching code
Subsystems (3)
PATCH 1/1 ARM: S5PV310: Optimize interrupt source searching code
From: Changhwan Youn <[email protected]>
It is reported by Junseok Jung that using clz instruction is better instead of using for-loop to find the interrupt source. This patch modifies interrupt source searching code using __fls(). The __fls() is implemented using clz instruction.
--- arch/arm/mach-s5pv310/irq-combiner.c | 6 +----- 1 files changed, 1 insertions(+), 5 deletions(-)
arch/arm/mach-s5pv310/irq-combiner.c +1 -5
@@ -66,11 +66,7 @@ static void combiner_handle_cascade_irq(unsigned int irq, struct irq_desc *desc)if (status ==0 ) goto out; -for (combiner_irq =0 ; combiner_irq <32 ; combiner_irq++) { -if (status &0x1 ) -break ; - status >>=1 ; - } + combiner_irq =__fls (status); cascade_irq = combiner_irq + (chip_data->irq_offset & ~31 );if (unlikely (cascade_irq >=NR_IRQS ))
Signature · 1 line
1.6.2.5
PATCH 1/1 ARM: S5PV310: Optimize interrupt source searching code
Hello.
Quoted 19 lines · Kukjin Kim
From: Changhwan Youn<[email protected]>
It is reported by Junseok Jung that using clz instruction is better instead of using for-loop to find the interrupt source. This patch modifies interrupt source searching code using
__fls(). The__fls()is implemented using clz instruction.Suggested-by Junseok Jung<[email protected]>Signed-off-by Changhwan Youn<[email protected]>Signed-off-by Kukjin Kim<[email protected]>--- arch/arm/mach-s5pv310/irq-combiner.c | 6 +----- 1 files changed, 1 insertions(+), 5 deletions(-)arch/arm/mach-s5pv310/irq-combiner.c +0
-0
arch/arm/mach-s5pv310/irq-combiner.c static void combiner_handle_cascade_irq(unsigned int irq, struct irq_desc *desc) · line 69
Quoted 9 lines
arch/arm/mach-s5pv310/irq-combiner.c +1
-5@@ -66,11 +66,7 @@ static void combiner_handle_cascade_irq(unsigned int irq, struct irq_desc *desc)if (status ==0 ) goto out; -for (combiner_irq =0 ; combiner_irq<32 ; combiner_irq++) { -if (status &0x1 ) -break ; - status>>=1 ; - } + combiner_irq =__fls (status);
But the loop finds the *first* set bit, not the last...
WBR, Sergei
PATCH 1/1 ARM: S5PV310: Optimize interrupt source searching code
Quoted 26 lines · Sergei Shtylyov
Hello.
Quoted 22 lines · Kukjin Kim
From: Changhwan Youn<[email protected]>
It is reported by Junseok Jung that using clz instruction is better instead of using for-loop to find the interrupt source. This patch modifies interrupt source searching code using
__fls(). The__fls()is implemented using clz instruction.Suggested-by Junseok Jung<[email protected]>Signed-off-by Changhwan Youn<[email protected]>Signed-off-by Kukjin Kim<[email protected]>--- arch/arm/mach-s5pv310/irq-combiner.c | 6 +----- 1 files changed, 1 insertions(+), 5 deletions(-)arch/arm/mach-s5pv310/irq-combiner.c +0
-0@@ -66,11 +66,7 @@ static void combiner_handle_cascade_irq(unsigned int irq, struct irq_desc *desc)if (status ==0 ) goto out;
Quoted 8 lines
arch/arm/mach-s5pv310/irq-combiner.c static void combiner_handle_cascade_irq(unsigned int irq, struct irq_desc *desc) · line 69
Quoted 6 lines
arch/arm/mach-s5pv310/irq-combiner.c +1
-5-for (combiner_irq =0 ; combiner_irq<32 ; combiner_irq++) { -if (status &0x1 ) -break ; - status>>=1 ; - } + combiner_irq =__fls (status);But the loop finds the *first* set bit, not the last...
__ffs than?
Signature · 4 lines
Best regards, _ _ | Humble Liege of Serenely Enlightened Majesty of o' \,=./ `o | Computer Science, Michał "mina86" Nazarewicz (o o) +----[mina86*mina86.com]---[mina86*jabber.org]----ooO--(_)--Ooo--
PATCH 1/1 ARM: S5PV310: Optimize interrupt source searching code
Quoted 1 line · Michal Nazarewicz
Hi :-)
Quoted 40 lines
Quoted 11 lines · Sergei Shtylyov
Hello.
Quoted 6 lines · Kukjin Kim
From: Changhwan Youn<[email protected]>
It is reported by Junseok Jung that using clz instruction is better instead of using for-loop to find the interrupt source. This patch modifies interrupt source searching code using
__fls(). The__fls()is implemented using clz instruction.Quoted 8 lines
arch/arm/mach-s5pv310/irq-
Quoted 8 lines
Suggested-by Junseok Jung<[email protected]>Signed-off-by Changhwan Youn<[email protected]>Signed-off-by Kukjin Kim<[email protected]>--- arch/arm/mach-s5pv310/irq-combiner.c | 6 +----- 1 files changed, 1 insertions(+), 5 deletions(-)arch/arm/mach-s5pv310/irq- renamed from arch/arm/mach-s5pv310/irq-combiner.c +0
-0
combiner.cQuoted 4 lines
arch/arm/mach-s5pv310/irq-combiner.c static void combiner_handle_cascade_irq(unsigned int
Quoted 4 lines
index 0f70521..39e3647 100644
arch/arm/mach-s5pv310/irq-combiner.c +0
-0@@ -66,11 +66,7 @@ static void combiner_handle_cascade_irq(unsigned intirq, struct
irq_desc*desc)Quoted 11 lines
arch/arm/mach-s5pv310/irq-combiner.c static void combiner_handle_cascade_irq(unsigned int irq, struct irq_desc *desc) · line 69
Quoted 9 lines
arch/arm/mach-s5pv310/irq-combiner.c +1
-5if (status ==0 ) goto out; -for (combiner_irq =0 ; combiner_irq<32 ; combiner_irq++) { -if (status &0x1 ) -break ; - status>>=1 ; - } + combiner_irq =__fls (status);But the loop finds the *first* set bit, not the last...
Quoted 2 lines
__ffsthan?
Yes, already re-submitted.
Thanks.
Best regards,
Kgene.
--
Kukjin Kim <[email protected]>, Senior Engineer, SW Solution Development Team, Samsung Electronics Co., Ltd.
PATCH 1/1 ARM: S5PV310: Optimize interrupt source searching code
In reply to Sergei ShtylyovQuoted 3 lines · Sergei Shtylyov
Hello.
Hi ;-)
Quoted 9 lines · Kukjin Kim
Quoted 7 lines
From: Changhwan Youn<[email protected]>
It is reported by Junseok Jung that using clz instruction is better instead of using for-loop to find the interrupt source. This patch modifies interrupt source searching code using
__fls(). The__fls()is implemented using clz instruction.
Quoted 8 lines
Review
Quoted 8 lines
Suggested-by Junseok Jung<[email protected]>Signed-off-by Changhwan Youn<[email protected]>Signed-off-by Kukjin Kim<[email protected]>--- arch/arm/mach-s5pv310/irq-combiner.c | 6 +----- 1 files changed, 1 insertions(+), 5 deletions(-)(quoted diff) +0
-0
b/arch/arm/mach-s5pv310/irq-
Quoted 5 lines
combiner.carch/arm/mach-s5pv310/irq-combiner.c static void combiner_handle_cascade_irq(unsigned int
Quoted 4 lines
index 0f70521..39e3647 100644
arch/arm/mach-s5pv310/irq-combiner.c +0
-0@@ -66,11 +66,7 @@ static void combiner_handle_cascade_irq(unsigned int
irq,
Quoted 4 lines
struct
irq_desc*desc)Quoted 3 lines
arch/arm/mach-s5pv310/irq-combiner.c +0
-0if (status ==0 ) goto out;
Quoted 9 lines
arch/arm/mach-s5pv310/irq-combiner.c static void combiner_handle_cascade_irq(unsigned int irq, struct irq_desc *desc) · line 69
Quoted 6 lines
arch/arm/mach-s5pv310/irq-combiner.c +1
-5-for (combiner_irq =0 ; combiner_irq<32 ; combiner_irq++) { -if (status &0x1 ) -break ; - status>>=1 ; - } + combiner_irq =__fls (status);But the loop finds the *first* set bit, not the last...
Yes, you're right.
So I already re-submitted like following :-)
http://lists.infradead.org/pipermail/linux-arm-kernel/2010-September/027071.
html
Thanks for your pointing out.
Best regards,
Kgene.
--
Kukjin Kim <[email protected]>, Senior Engineer, SW Solution Development Team, Samsung Electronics Co., Ltd.