linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [2.6 patch] fix pciehp_free_irq()
@ 2008-08-27 22:05 Adrian Bunk
  2008-08-29  2:44 ` Kenji Kaneshige
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Adrian Bunk @ 2008-08-27 22:05 UTC (permalink / raw)
  To: Kenji Kaneshige, Jesse Barnes; +Cc: linux-kernel, linux-pci

This patch fixes an obvious bug (loop was never entered) caused by
commit 820943b6fc4781621dee52ba026106758a727dd3
(pciehp: cleanup pcie_poll_cmd).

Reported-by: Adrian Bunk <bunk@kernel.org>
Signed-off-by: Adrian Bunk <bunk@kernel.org>

---
0cca78f4b7c7d6c7b64ae5acc08bb641454b4835 
diff --git a/drivers/pci/hotplug/pciehp_hpc.c b/drivers/pci/hotplug/pciehp_hpc.c
index ab31f5b..9d934dd 100644
--- a/drivers/pci/hotplug/pciehp_hpc.c
+++ b/drivers/pci/hotplug/pciehp_hpc.c
@@ -250,23 +250,23 @@ static inline void pciehp_free_irq(struct controller *ctrl)
 static int pcie_poll_cmd(struct controller *ctrl)
 {
 	u16 slot_status;
 	int timeout = 1000;
 
 	if (!pciehp_readw(ctrl, SLOTSTATUS, &slot_status)) {
 		if (slot_status & CMD_COMPLETED) {
 			pciehp_writew(ctrl, SLOTSTATUS, CMD_COMPLETED);
 			return 1;
 		}
 	}
-	while (timeout > 1000) {
+	while (timeout > 0) {
 		msleep(10);
 		timeout -= 10;
 		if (!pciehp_readw(ctrl, SLOTSTATUS, &slot_status)) {
 			if (slot_status & CMD_COMPLETED) {
 				pciehp_writew(ctrl, SLOTSTATUS, CMD_COMPLETED);
 				return 1;
 			}
 		}
 	}
 	return 0;	/* timeout */
 }

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

* Re: [2.6 patch] fix pciehp_free_irq()
  2008-08-27 22:05 [2.6 patch] fix pciehp_free_irq() Adrian Bunk
@ 2008-08-29  2:44 ` Kenji Kaneshige
  2008-09-09 18:40 ` Jesse Barnes
  2008-09-09 22:52 ` Kenji Kaneshige
  2 siblings, 0 replies; 5+ messages in thread
From: Kenji Kaneshige @ 2008-08-29  2:44 UTC (permalink / raw)
  To: Adrian Bunk; +Cc: Jesse Barnes, linux-kernel, linux-pci

Adrian Bunk wrote:
> This patch fixes an obvious bug (loop was never entered) caused by
> commit 820943b6fc4781621dee52ba026106758a727dd3
> (pciehp: cleanup pcie_poll_cmd).
> 
> Reported-by: Adrian Bunk <bunk@kernel.org>
> Signed-off-by: Adrian Bunk <bunk@kernel.org>
> 
> ---
> 0cca78f4b7c7d6c7b64ae5acc08bb641454b4835 
> diff --git a/drivers/pci/hotplug/pciehp_hpc.c b/drivers/pci/hotplug/pciehp_hpc.c
> index ab31f5b..9d934dd 100644
> --- a/drivers/pci/hotplug/pciehp_hpc.c
> +++ b/drivers/pci/hotplug/pciehp_hpc.c
> @@ -250,23 +250,23 @@ static inline void pciehp_free_irq(struct controller *ctrl)
>  static int pcie_poll_cmd(struct controller *ctrl)
>  {
>  	u16 slot_status;
>  	int timeout = 1000;
>  
>  	if (!pciehp_readw(ctrl, SLOTSTATUS, &slot_status)) {
>  		if (slot_status & CMD_COMPLETED) {
>  			pciehp_writew(ctrl, SLOTSTATUS, CMD_COMPLETED);
>  			return 1;
>  		}
>  	}
> -	while (timeout > 1000) {
> +	while (timeout > 0) {
>  		msleep(10);
>  		timeout -= 10;
>  		if (!pciehp_readw(ctrl, SLOTSTATUS, &slot_status)) {
>  			if (slot_status & CMD_COMPLETED) {
>  				pciehp_writew(ctrl, SLOTSTATUS, CMD_COMPLETED);
>  				return 1;
>  			}
>  		}
>  	}
>  	return 0;	/* timeout */
>  }
> 
> 

Sorry, that's my bad.
Thank you for the patch, Adrian.

Acked-by: Kenji Kaneshige <kaneshige.kenji@jp.fujitsu.com>

Thanks,
Kenji Kaneshige



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

* Re: [2.6 patch] fix pciehp_free_irq()
  2008-08-27 22:05 [2.6 patch] fix pciehp_free_irq() Adrian Bunk
  2008-08-29  2:44 ` Kenji Kaneshige
@ 2008-09-09 18:40 ` Jesse Barnes
  2008-09-09 22:52 ` Kenji Kaneshige
  2 siblings, 0 replies; 5+ messages in thread
From: Jesse Barnes @ 2008-09-09 18:40 UTC (permalink / raw)
  To: Adrian Bunk; +Cc: Kenji Kaneshige, linux-kernel, linux-pci

On Wednesday, August 27, 2008 3:05 pm Adrian Bunk wrote:
> This patch fixes an obvious bug (loop was never entered) caused by
> commit 820943b6fc4781621dee52ba026106758a727dd3
> (pciehp: cleanup pcie_poll_cmd).
>
> Reported-by: Adrian Bunk <bunk@kernel.org>
> Signed-off-by: Adrian Bunk <bunk@kernel.org>

Applied to my linux-next branch.  Kenji-san do you think this should go into 
2.6.27?  I haven't heard any regression reports about it, but it does seem 
like a good and simple fix...

Thanks,
Jesse

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

* Re: Re: [2.6 patch] fix pciehp_free_irq()
  2008-08-27 22:05 [2.6 patch] fix pciehp_free_irq() Adrian Bunk
  2008-08-29  2:44 ` Kenji Kaneshige
  2008-09-09 18:40 ` Jesse Barnes
@ 2008-09-09 22:52 ` Kenji Kaneshige
  2008-09-10 17:51   ` Jesse Barnes
  2 siblings, 1 reply; 5+ messages in thread
From: Kenji Kaneshige @ 2008-09-09 22:52 UTC (permalink / raw)
  To: Jesse Barnes; +Cc: Adrian Bunk, Kenji Kaneshige, linux-kernel, linux-pci

----- Original Message -----
>From: Jesse Barnes <jbarnes@virtuousgeek.org>
>To: Adrian Bunk <bunk@kernel.org>
>Subject: Re: [2.6 patch] fix pciehp_free_irq()
>Date: Tue, 9 Sep 2008 11:40:41 -0700
>Cc: Kenji Kaneshige <kaneshige.kenji@jp.fujitsu.com>,
>   linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org
>
>
>On Wednesday, August 27, 2008 3:05 pm Adrian Bunk wrote:
>> This patch fixes an obvious bug (loop was never entered) caused by
>> commit 820943b6fc4781621dee52ba026106758a727dd3
>> (pciehp: cleanup pcie_poll_cmd).
>>
>> Reported-by: Adrian Bunk <bunk@kernel.org>
>> Signed-off-by: Adrian Bunk <bunk@kernel.org>
>
>Applied to my linux-next branch.  Kenji-san do you think this should go into 
>2.6.27?  I haven't heard any regression reports about it, but it does seem 
>like a good and simple fix...
>

Though regression was not reported, it is actually a regression internally.
It doesn't have a big impact against the hotplug controller that supports 
"command completed interrupt", but it might have a impact against the
controller that doesn't support "command completed interrupt". So I think
it should go into 2.6.27. As you said, the patch looks good and simple.

Thanks,
Kenji Kaneshige


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

* Re: [2.6 patch] fix pciehp_free_irq()
  2008-09-09 22:52 ` Kenji Kaneshige
@ 2008-09-10 17:51   ` Jesse Barnes
  0 siblings, 0 replies; 5+ messages in thread
From: Jesse Barnes @ 2008-09-10 17:51 UTC (permalink / raw)
  To: Kenji Kaneshige; +Cc: Adrian Bunk, linux-kernel, linux-pci

On Tuesday, September 9, 2008 3:52 pm Kenji Kaneshige wrote:
> ----- Original Message -----
>
> >From: Jesse Barnes <jbarnes@virtuousgeek.org>
> >To: Adrian Bunk <bunk@kernel.org>
> >Subject: Re: [2.6 patch] fix pciehp_free_irq()
> >Date: Tue, 9 Sep 2008 11:40:41 -0700
> >Cc: Kenji Kaneshige <kaneshige.kenji@jp.fujitsu.com>,
> >   linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org
> >
> >On Wednesday, August 27, 2008 3:05 pm Adrian Bunk wrote:
> >> This patch fixes an obvious bug (loop was never entered) caused by
> >> commit 820943b6fc4781621dee52ba026106758a727dd3
> >> (pciehp: cleanup pcie_poll_cmd).
> >>
> >> Reported-by: Adrian Bunk <bunk@kernel.org>
> >> Signed-off-by: Adrian Bunk <bunk@kernel.org>
> >
> >Applied to my linux-next branch.  Kenji-san do you think this should go
> > into 2.6.27?  I haven't heard any regression reports about it, but it
> > does seem like a good and simple fix...
>
> Though regression was not reported, it is actually a regression internally.
> It doesn't have a big impact against the hotplug controller that supports
> "command completed interrupt", but it might have a impact against the
> controller that doesn't support "command completed interrupt". So I think
> it should go into 2.6.27. As you said, the patch looks good and simple.

Ok, thanks, I've queued it up for 2.6.27.

-- 
Jesse Barnes, Intel Open Source Technology Center

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

end of thread, other threads:[~2008-09-10 17:51 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-08-27 22:05 [2.6 patch] fix pciehp_free_irq() Adrian Bunk
2008-08-29  2:44 ` Kenji Kaneshige
2008-09-09 18:40 ` Jesse Barnes
2008-09-09 22:52 ` Kenji Kaneshige
2008-09-10 17:51   ` Jesse Barnes

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).