* [PATCH] MIPS: Fix gic_set_affinity infinite loop
@ 2013-06-21 11:13 Tony Wu
2013-06-21 17:01 ` Steven J. Hill
0 siblings, 1 reply; 6+ messages in thread
From: Tony Wu @ 2013-06-21 11:13 UTC (permalink / raw)
To: ralf, Steven.Hill, linux-mips
There is an infinite loop in gic_set_affinity. When irq_set_affinity
gets called on gic controller, it blocks forever.
Signed-off-by: Tony Wu <tung7970@gmail.com>
Cc: Steven J. Hill <Steven.Hill@imgtec.com>
---
arch/mips/kernel/irq-gic.c | 15 +++++++--------
1 file changed, 7 insertions(+), 8 deletions(-)
diff --git a/arch/mips/kernel/irq-gic.c b/arch/mips/kernel/irq-gic.c
index c01b307..5b5ddb2 100644
--- a/arch/mips/kernel/irq-gic.c
+++ b/arch/mips/kernel/irq-gic.c
@@ -219,16 +219,15 @@ static int gic_set_affinity(struct irq_data *d, const struct cpumask *cpumask,
/* Assumption : cpumask refers to a single CPU */
spin_lock_irqsave(&gic_lock, flags);
- for (;;) {
- /* Re-route this IRQ */
- GIC_SH_MAP_TO_VPE_SMASK(irq, first_cpu(tmp));
- /* Update the pcpu_masks */
- for (i = 0; i < NR_CPUS; i++)
- clear_bit(irq, pcpu_masks[i].pcpu_mask);
- set_bit(irq, pcpu_masks[first_cpu(tmp)].pcpu_mask);
+ /* Re-route this IRQ */
+ GIC_SH_MAP_TO_VPE_SMASK(irq, first_cpu(tmp));
+
+ /* Update the pcpu_masks */
+ for (i = 0; i < NR_CPUS; i++)
+ clear_bit(irq, pcpu_masks[i].pcpu_mask);
+ set_bit(irq, pcpu_masks[first_cpu(tmp)].pcpu_mask);
- }
cpumask_copy(d->affinity, cpumask);
spin_unlock_irqrestore(&gic_lock, flags);
--
1.7.10.2
^ permalink raw reply related [flat|nested] 6+ messages in thread* Re: [PATCH] MIPS: Fix gic_set_affinity infinite loop
@ 2013-06-21 17:01 ` Steven J. Hill
0 siblings, 0 replies; 6+ messages in thread
From: Steven J. Hill @ 2013-06-21 17:01 UTC (permalink / raw)
To: Tony Wu; +Cc: linux-mips
On 06/21/2013 06:13 AM, Tony Wu wrote:
> There is an infinite loop in gic_set_affinity. When irq_set_affinity
> gets called on gic controller, it blocks forever.
>
Tony,
What hardware platform is this on and how do you trigger the call to
'gic_set_affinity' such that you get stuck? Thanks.
-Steve
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] MIPS: Fix gic_set_affinity infinite loop
@ 2013-06-21 17:01 ` Steven J. Hill
0 siblings, 0 replies; 6+ messages in thread
From: Steven J. Hill @ 2013-06-21 17:01 UTC (permalink / raw)
To: Tony Wu; +Cc: linux-mips
On 06/21/2013 06:13 AM, Tony Wu wrote:
> There is an infinite loop in gic_set_affinity. When irq_set_affinity
> gets called on gic controller, it blocks forever.
>
Tony,
What hardware platform is this on and how do you trigger the call to
'gic_set_affinity' such that you get stuck? Thanks.
-Steve
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] MIPS: Fix gic_set_affinity infinite loop
2013-06-21 17:01 ` Steven J. Hill
(?)
@ 2013-06-26 19:05 ` Ralf Baechle
2013-06-26 22:23 ` Steven J. Hill
-1 siblings, 1 reply; 6+ messages in thread
From: Ralf Baechle @ 2013-06-26 19:05 UTC (permalink / raw)
To: Steven J. Hill; +Cc: Tony Wu, linux-mips, Chris Dearman
On Fri, Jun 21, 2013 at 12:01:19PM -0500, Steven J. Hill wrote:
> On 06/21/2013 06:13 AM, Tony Wu wrote:
> >There is an infinite loop in gic_set_affinity. When irq_set_affinity
> >gets called on gic controller, it blocks forever.
> >
> Tony,
>
> What hardware platform is this on and how do you trigger the call to
> 'gic_set_affinity' such that you get stuck? Thanks.
I assume on a SMP GIC configuration he must have tried something like
echo 1 > /proc/irq/2/smp_affinity
Where 1 is a CPU bit mask and 2 the number of a GIC interrupt of which
to change the affinity.
This is a hillarious bug, this obviously has never been working.
I'm not sure if anything else would need fixing or if the loop had any
sane purpose but as of now I can't see one so I'm queueing the patch
for linux-next.
Ralf
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] MIPS: Fix gic_set_affinity infinite loop
@ 2013-06-26 22:23 ` Steven J. Hill
0 siblings, 0 replies; 6+ messages in thread
From: Steven J. Hill @ 2013-06-26 22:23 UTC (permalink / raw)
To: Ralf Baechle; +Cc: Tony Wu, linux-mips, Chris Dearman
On 06/26/2013 02:05 PM, Ralf Baechle wrote:
>
> I assume on a SMP GIC configuration he must have tried something like
>
> echo 1 > /proc/irq/2/smp_affinity
>
> Where 1 is a CPU bit mask and 2 the number of a GIC interrupt of which
> to change the affinity.
>
I confirmed the hang on the Malta board. Tony's patch fixes this. Thank
you Tony.
Steve
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] MIPS: Fix gic_set_affinity infinite loop
@ 2013-06-26 22:23 ` Steven J. Hill
0 siblings, 0 replies; 6+ messages in thread
From: Steven J. Hill @ 2013-06-26 22:23 UTC (permalink / raw)
To: Ralf Baechle; +Cc: Tony Wu, linux-mips, Chris Dearman
On 06/26/2013 02:05 PM, Ralf Baechle wrote:
>
> I assume on a SMP GIC configuration he must have tried something like
>
> echo 1 > /proc/irq/2/smp_affinity
>
> Where 1 is a CPU bit mask and 2 the number of a GIC interrupt of which
> to change the affinity.
>
I confirmed the hang on the Malta board. Tony's patch fixes this. Thank
you Tony.
Steve
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2013-06-26 22:23 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-06-21 11:13 [PATCH] MIPS: Fix gic_set_affinity infinite loop Tony Wu
2013-06-21 17:01 ` Steven J. Hill
2013-06-21 17:01 ` Steven J. Hill
2013-06-26 19:05 ` Ralf Baechle
2013-06-26 22:23 ` Steven J. Hill
2013-06-26 22:23 ` Steven J. Hill
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.