fix pciehp_free_irq()
PATCH 1/1 fix pciehp_free_irq()
This patch fixes an obvious bug (loop was never entered) caused by commit 820943b6fc4781621dee52ba026106758a727dd3 (pciehp: cleanup pcie_poll_cmd).
---0cca78f4b7c7d6c7b64ae5acc08bb641454b4835
drivers/pci/hotplug/pciehp_hpc.c +1 -1
@@ -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 */ }
Quoted 29 lines · Adrian Bunk
This patch fixes an obvious bug (loop was never entered) caused by commit
820943b6fc4781621dee52ba026106758a727dd3(pciehp: cleanuppcie_poll_cmd).Reported-by Adrian Bunk <[email protected]>Signed-off-by Adrian Bunk <[email protected]>---
0cca78f4b7c7d6c7b64ae5acc08bb641454b4835diff --gita/drivers/pci/hotplug/pciehp_hpc.cb/drivers/pci/hotplug/pciehp_hpc.cindex ab31f5b..9d934dd 100644drivers/pci/hotplug/pciehp_hpc.c +1
-1@@ -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 );
drivers/pci/hotplug/pciehp_hpc.c static inline void pciehp_free_irq(struct controller *ctrl) · line 272
Quoted 10 lines
drivers/pci/hotplug/pciehp_hpc.c +0
-0timeout -=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.
Thanks,
Kenji Kaneshige
Jesse Barnes
AppliedQuoted 6 lines · Adrian Bunk
This patch fixes an obvious bug (loop was never entered) caused by commit
820943b6fc4781621dee52ba026106758a727dd3(pciehp: cleanuppcie_poll_cmd).Reported-by Adrian Bunk <[email protected]>Signed-off-by Adrian Bunk <[email protected]>
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
----- Original Message -----
Quoted 13 lines
From: Jesse Barnes <[email protected]>
To: Adrian Bunk <[email protected]>
Subject: Re: [2.6 patch] fixpciehp_free_irq()
Date: Tue, 9 Sep 2008 11:40:41 -0700
Cc: Kenji Kaneshige <[email protected]>,
[email protected], [email protected]Quoted 4 lines · Adrian Bunk
This patch fixes an obvious bug (loop was never entered) caused by commit
820943b6fc4781621dee52ba026106758a727dd3(pciehp: cleanuppcie_poll_cmd).
Quoted 7 lines
Quoted 2 lines
Reported-by Adrian Bunk <[email protected]>Signed-off-by Adrian Bunk <[email protected]>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
Quoted 21 lines · Kenji Kaneshige
----- Original Message -----
Quoted 12 lines
From: Jesse Barnes <[email protected]>
To: Adrian Bunk <[email protected]>
Subject: Re: [2.6 patch] fixpciehp_free_irq()
Date: Tue, 9 Sep 2008 11:40:41 -0700
Cc: Kenji Kaneshige <[email protected]>,
[email protected], [email protected]Quoted 4 lines · Adrian Bunk
This patch fixes an obvious bug (loop was never entered) caused by commit
820943b6fc4781621dee52ba026106758a727dd3(pciehp: cleanuppcie_poll_cmd).Quoted 6 lines
Quoted 2 lines
Reported-by Adrian Bunk <[email protected]>Signed-off-by Adrian Bunk <[email protected]>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...
Quoted 5 lines
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.
Signature · 1 line
Jesse Barnes, Intel Open Source Technology Center