linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Re: [PATCH] fix the interrupt loss problem on powerpc IPIC(2.6.25-2.6.28)
@ 2009-02-18  5:47 dayu
  2009-02-19 16:41 ` Kumar Gala
  0 siblings, 1 reply; 4+ messages in thread
From: dayu @ 2009-02-18  5:47 UTC (permalink / raw)
  To: olof; +Cc: leoli, galak, linuxppc-dev, linux-kernel

renew description in  the patch,  with this change the 'temp'  is still used to make code clear.

___________________________________________

From: Da Yu <dayu@datangmobile.cn>
Date: Wed, 18 Feb 2009 19:58:20 +0800
Subject: [PATCH] fix the interrupt loss problem on powerpc IPIC (2.6.25-2.6.28)

Description: The interrupt pending register is write 1 clear.  If there are more than one external interrupts pending at the same time, acking the first interrupt by reading pending register then OR the corresponding bit and write back to pending register will also clear other interrupt pending bits.  That will cause loss of interrupt.

Signed-off-by: Da Yu <dayu@datangmobile.cn>
---

--- a/arch/powerpc/sysdev/ipic.c	2009-02-18 09:47:04.000000000 +0800
+++ b/arch/powerpc/sysdev/ipic.c	2009-02-18 09:46:34.000000000 +0800
@@ -568,8 +568,7 @@ static void ipic_ack_irq(unsigned int vi

 	spin_lock_irqsave(&ipic_lock, flags);

-	temp = ipic_read(ipic->regs, ipic_info[src].ack);
-	temp |= (1 << (31 - ipic_info[src].bit));
+	temp = 1 << (31 - ipic_info[src].bit);
 	ipic_write(ipic->regs, ipic_info[src].ack, temp);

 	/* mb() can't guarantee that ack is finished.  But it does finish
@@ -592,8 +591,7 @@ static void ipic_mask_irq_and_ack(unsign
 	temp &= ~(1 << (31 - ipic_info[src].bit));
 	ipic_write(ipic->regs, ipic_info[src].mask, temp);

-	temp = ipic_read(ipic->regs, ipic_info[src].ack);
-	temp |= (1 << (31 - ipic_info[src].bit));
+	temp = 1 << (31 - ipic_info[src].bit);
 	ipic_write(ipic->regs, ipic_info[src].ack, temp);

 	/* mb() can't guarantee that ack is finished.  But it does finish



 
 

-----邮件原件-----
发件人: Olof Johansson [mailto:olof@lixom.net] 
发送时间: 2009年2月18日 10:43
收件人: 笪禹
抄送: leoli@freescale.com; galak@kernel.crashing.org; linuxppc-dev@ozlabs.org; linux-kernel@vger.kernel.org
主题: Re: [PATCH] fix the interrupt loss problem on powerpc IPIC(2.6.25-2.6.28)

On Wed, Feb 18, 2009 at 10:16:07AM +0800, dayu@datangmobile.cn wrote:
> From: Da Yu <dayu@datangmobile.cn>
> Date: Wed, 18 Feb 2009 19:58:20 +0800
> Subject: [PATCH] fix the interrupt loss problem on powerpc IPIC 
> (2.6.25-2.6.28)
> 
> Signed-off-by: Da Yu <dayu@datangmobile.cn>

Still no proper explanation in the patch.

Also, with this change, is 'temp' really needed, or can you just pass in the mask by hand?


-Olof

> ---
> 
> --- a/arch/powerpc/sysdev/ipic.c	2009-02-18 09:47:04.000000000 +0800
> +++ b/arch/powerpc/sysdev/ipic.c	2009-02-18 09:46:34.000000000 +0800
> @@ -568,8 +568,7 @@ static void ipic_ack_irq(unsigned int vi
> 
>  	spin_lock_irqsave(&ipic_lock, flags);
> 
> -	temp = ipic_read(ipic->regs, ipic_info[src].ack);
> -	temp |= (1 << (31 - ipic_info[src].bit));
> +	temp = 1 << (31 - ipic_info[src].bit);
>  	ipic_write(ipic->regs, ipic_info[src].ack, temp);
> 
>  	/* mb() can't guarantee that ack is finished.  But it does finish


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] fix the interrupt loss problem on powerpc IPIC(2.6.25-2.6.28)
  2009-02-18  5:47 [PATCH] fix the interrupt loss problem on powerpc IPIC(2.6.25-2.6.28) dayu
@ 2009-02-19 16:41 ` Kumar Gala
  0 siblings, 0 replies; 4+ messages in thread
From: Kumar Gala @ 2009-02-19 16:41 UTC (permalink / raw)
  To: <dayu@datangmobile.cn>; +Cc: olof, leoli, linuxppc-dev, linux-kernel


On Feb 17, 2009, at 11:47 PM, <dayu@datangmobile.cn> <dayu@datangmobile.cn 
 > wrote:

>
> From: Da Yu <dayu@datangmobile.cn>
> Date: Wed, 18 Feb 2009 19:58:20 +0800
> Subject: [PATCH] fix the interrupt loss problem on powerpc IPIC  
> (2.6.25-2.6.28)
>
> Description: The interrupt pending register is write 1 clear.  If  
> there are more than one external interrupts pending at the same  
> time, acking the first interrupt by reading pending register then OR  
> the corresponding bit and write back to pending register will also  
> clear other interrupt pending bits.  That will cause loss of  
> interrupt.
>
> Signed-off-by: Da Yu <dayu@datangmobile.cn>
> ---


applied to next

- k

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] fix the interrupt loss problem on powerpc IPIC (2.6.25-2.6.28)
  2009-02-18  2:16 [PATCH] fix the interrupt loss problem on powerpc IPIC (2.6.25-2.6.28) dayu
@ 2009-02-18  2:43 ` Olof Johansson
  0 siblings, 0 replies; 4+ messages in thread
From: Olof Johansson @ 2009-02-18  2:43 UTC (permalink / raw)
  To: dayu; +Cc: leoli, galak, linuxppc-dev, linux-kernel

On Wed, Feb 18, 2009 at 10:16:07AM +0800, dayu@datangmobile.cn wrote:
> From: Da Yu <dayu@datangmobile.cn>
> Date: Wed, 18 Feb 2009 19:58:20 +0800
> Subject: [PATCH] fix the interrupt loss problem on powerpc IPIC (2.6.25-2.6.28)
> 
> Signed-off-by: Da Yu <dayu@datangmobile.cn>

Still no proper explanation in the patch.

Also, with this change, is 'temp' really needed, or can you just pass in the
mask by hand?


-Olof

> ---
> 
> --- a/arch/powerpc/sysdev/ipic.c	2009-02-18 09:47:04.000000000 +0800
> +++ b/arch/powerpc/sysdev/ipic.c	2009-02-18 09:46:34.000000000 +0800
> @@ -568,8 +568,7 @@ static void ipic_ack_irq(unsigned int vi
> 
>  	spin_lock_irqsave(&ipic_lock, flags);
> 
> -	temp = ipic_read(ipic->regs, ipic_info[src].ack);
> -	temp |= (1 << (31 - ipic_info[src].bit));
> +	temp = 1 << (31 - ipic_info[src].bit);
>  	ipic_write(ipic->regs, ipic_info[src].ack, temp);
> 
>  	/* mb() can't guarantee that ack is finished.  But it does finish


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH] fix the interrupt loss problem on powerpc IPIC (2.6.25-2.6.28)
@ 2009-02-18  2:16 dayu
  2009-02-18  2:43 ` Olof Johansson
  0 siblings, 1 reply; 4+ messages in thread
From: dayu @ 2009-02-18  2:16 UTC (permalink / raw)
  To: leoli, galak; +Cc: linux-kernel, linuxppc-dev

From: Da Yu <dayu@datangmobile.cn>
Date: Wed, 18 Feb 2009 19:58:20 +0800
Subject: [PATCH] fix the interrupt loss problem on powerpc IPIC (2.6.25-2.6.28)

Signed-off-by: Da Yu <dayu@datangmobile.cn>
---

--- a/arch/powerpc/sysdev/ipic.c	2009-02-18 09:47:04.000000000 +0800
+++ b/arch/powerpc/sysdev/ipic.c	2009-02-18 09:46:34.000000000 +0800
@@ -568,8 +568,7 @@ static void ipic_ack_irq(unsigned int vi

 	spin_lock_irqsave(&ipic_lock, flags);

-	temp = ipic_read(ipic->regs, ipic_info[src].ack);
-	temp |= (1 << (31 - ipic_info[src].bit));
+	temp = 1 << (31 - ipic_info[src].bit);
 	ipic_write(ipic->regs, ipic_info[src].ack, temp);

 	/* mb() can't guarantee that ack is finished.  But it does finish
@@ -592,8 +591,7 @@ static void ipic_mask_irq_and_ack(unsign
 	temp &= ~(1 << (31 - ipic_info[src].bit));
 	ipic_write(ipic->regs, ipic_info[src].mask, temp);

-	temp = ipic_read(ipic->regs, ipic_info[src].ack);
-	temp |= (1 << (31 - ipic_info[src].bit));
+	temp = 1 << (31 - ipic_info[src].bit);
 	ipic_write(ipic->regs, ipic_info[src].ack, temp);

 	/* mb() can't guarantee that ack is finished.  But it does finish




-----邮件原件-----
发件人: Li Yang [mailto:leoli@freescale.com] 
发送时间: 2009年2月17日 22:38
收件人: Kumar Gala
抄送: 笪禹; linux-kernel@vger.kernel.org; linuxppc-dev@ozlabs.org
主题: Re: [PATCH] fix the interrupt loss problem on powerpc IPIC (2.6.23)

On Tue, Feb 17, 2009 at 10:12 PM, Kumar Gala <galak@kernel.crashing.org> wrote:
>
> On Feb 17, 2009, at 6:44 AM, <dayu@datangmobile.cn> 
> <dayu@datangmobile.cn>
> wrote:
>
>> From: Da Yu <dayu@datangmobile.cn>
>> Date: Tue, 17 Feb 2009 19:58:20 +0800
>> Subject: [PATCH] fix the interrupt loss problem on powerpc IPIC 
>> (2.6.23)
>>
>> Signed-off-by: Da Yu <dayu@datangmobile.cn>
>> ---
>
> Please provide a bit more description as to why this fixes the issue.

The pending register is write 1 clear.  If there are more than one external interrupts pending at the same time, acking the first interrupt will also clear other interrupt pending bits.  That will cause loss of interrupt.

- Leo

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2009-02-19 16:42 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-02-18  5:47 [PATCH] fix the interrupt loss problem on powerpc IPIC(2.6.25-2.6.28) dayu
2009-02-19 16:41 ` Kumar Gala
  -- strict thread matches above, loose matches on Subject: below --
2009-02-18  2:16 [PATCH] fix the interrupt loss problem on powerpc IPIC (2.6.25-2.6.28) dayu
2009-02-18  2:43 ` Olof Johansson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).