Subject: [Pcihpd-discuss] [PATCH 6/9][BUG] pciehp: Fix command write From: Kenji Kaneshige 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 Signed-off-by: Kristen Carlson Accardi --- drivers/pci/hotplug/pciehp_hpc.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) Index: linux-hotplug/drivers/pci/hotplug/pciehp_hpc.c =================================================================== --- linux-hotplug.orig/drivers/pci/hotplug/pciehp_hpc.c 2008-04-24 14:48:29.000000000 -0700 +++ linux-hotplug/drivers/pci/hotplug/pciehp_hpc.c 2008-04-24 15:14:00.000000000 -0700 @@ -301,7 +301,10 @@ static int pcie_write_cmd(struct control } slot_ctrl &= ~mask; - slot_ctrl |= ((cmd & mask) | CMD_CMPL_INTR_ENABLE); + slot_ctrl |= (cmd & mask); + /* Don't enable command completed if caller is changing it. */ + if (!(mask & CMD_CMPL_INTR_ENABLE)) + slot_ctrl |= CMD_CMPL_INTR_ENABLE; ctrl->cmd_busy = 1; smp_mb();