aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKenji Kaneshige <kaneshige.kenji@jp.fujitsu.com>2008-04-25 17:39:14 -0400
committerJesse Barnes <jbarnes@virtuousgeek.org>2008-04-25 17:39:14 -0400
commitb7aa1f1603bea4fdec49a915712dea280cfd07e8 (patch)
treed0821e8110b96cd793384b79c470d951d9e7bb19
parentef0ff95f136f0f2d035667af5d18b824609de320 (diff)
pciehp: Fix command write
Current implementation of pciehp_write_cmd() always enables command completed interrupt. But pciehp_write_cmd() is also used for clearing command completed interrupt enable bit. In this case, we must not set the command completed interrupt enable bit. To fix this bug, this patch add the check to see if caller wants to change command complete interrupt enable bit. Signed-off-by: Kenji Kaneshige <kaneshige.kenji@jp.fujitsu.com> Signed-off-by: Kristen Carlson Accardi <kristen.c.accardi@intel.com> Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
-rw-r--r--drivers/pci/hotplug/pciehp_hpc.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/pci/hotplug/pciehp_hpc.c b/drivers/pci/hotplug/pciehp_hpc.c
index 3efb1296290d..49883c59756e 100644
--- a/drivers/pci/hotplug/pciehp_hpc.c
+++ b/drivers/pci/hotplug/pciehp_hpc.c
@@ -301,7 +301,10 @@ static int pcie_write_cmd(struct controller *ctrl, u16 cmd, u16 mask)
301 } 301 }
302 302
303 slot_ctrl &= ~mask; 303 slot_ctrl &= ~mask;
304 slot_ctrl |= ((cmd & mask) | CMD_CMPL_INTR_ENABLE); 304 slot_ctrl |= (cmd & mask);
305 /* Don't enable command completed if caller is changing it. */
306 if (!(mask & CMD_CMPL_INTR_ENABLE))
307 slot_ctrl |= CMD_CMPL_INTR_ENABLE;
305 308
306 ctrl->cmd_busy = 1; 309 ctrl->cmd_busy = 1;
307 smp_mb(); 310 smp_mb();