Skip to contentSkip to conversation

fix pciehp_free_irq()

PATCH Applied Adrian Bunk 3 participants 5 messages Aug 27, 2008 – Sep 10, 2008 PCI

lore
Share & tools
lore
#0 lore raw

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
index ab31f5b..9d934dd 100644
@@ -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 */
 }
Acked-by on v1 1/1
#1 lore raw
Quoted 29 lines · Adrian Bunk

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

---
0cca78f4b7c7d6c7b64ae5acc08bb641454b4835 diff --git a/drivers/pci/hotplug/pciehp_hpc.c b/drivers/pci/hotplug/pciehp_hpc.c index ab31f5b..9d934dd 100644

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

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

Thanks,
Kenji Kaneshige

Applied
#2 lore raw
In reply to Adrian Bunk
Quoted 6 lines · Adrian Bunk

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

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

#3 lore raw

----- Original Message -----

Quoted 13 lines

From: Jesse Barnes <[email protected]>
To: Adrian Bunk <[email protected]>
Subject: Re: [2.6 patch] fix pciehp_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: cleanup pcie_poll_cmd).

Quoted 7 lines
Quoted 2 lines

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

#4 lore raw
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] fix pciehp_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: cleanup pcie_poll_cmd).

Quoted 6 lines
Quoted 2 lines

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