Subject: [PATCH 3/9][BUG] pciehp: Add missing memory barrier From: Kenji Kaneshige Fix the possible race condition between pcie_isr() and pciehp_write_cmd() because of the lack of memory barrier. Signed-off-by: Kenji Kaneshige Signed-off-by: Kristen Carlson Accardi --- drivers/pci/hotplug/pciehp_hpc.c | 2 ++ 1 file changed, 2 insertions(+) Index: linux-hotplug/drivers/pci/hotplug/pciehp_hpc.c =================================================================== --- linux-hotplug.orig/drivers/pci/hotplug/pciehp_hpc.c 2008-04-24 13:25:19.000000000 -0700 +++ linux-hotplug/drivers/pci/hotplug/pciehp_hpc.c 2008-04-24 13:25:32.000000000 -0700 @@ -279,6 +279,7 @@ static int pcie_write_cmd(struct slot *s slot_ctrl |= ((cmd & mask) | CMD_CMPL_INTR_ENABLE); ctrl->cmd_busy = 1; + smp_mb(); retval = pciehp_writew(ctrl, SLOTCTRL, slot_ctrl); if (retval) err("%s: Cannot write to SLOTCTRL register\n", __func__); @@ -759,6 +760,7 @@ static irqreturn_t pcie_isr(int irq, voi /* Check Command Complete Interrupt Pending */ if (intr_loc & CMD_COMPLETED) { ctrl->cmd_busy = 0; + smp_mb(); wake_up_interruptible(&ctrl->queue); }