From: Kenji Kaneshige Date: Fri, 25 Apr 2008 21:39:02 +0000 (-0700) Subject: pciehp: Add missing memory barrier X-Git-Tag: v2.6.26-rc1~364^2~15 X-Git-Url: http://pilppa.com/gitweb/?a=commitdiff_plain;h=2d32a9aed2e335d110fbb11985a9545b1f7219ab;p=linux-2.6-omap-h63xx.git pciehp: Add missing memory barrier 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 Signed-off-by: Jesse Barnes --- diff --git a/drivers/pci/hotplug/pciehp_hpc.c b/drivers/pci/hotplug/pciehp_hpc.c index 51a5055f696..19eba2a2f74 100644 --- a/drivers/pci/hotplug/pciehp_hpc.c +++ b/drivers/pci/hotplug/pciehp_hpc.c @@ -279,6 +279,7 @@ static int pcie_write_cmd(struct slot *slot, u16 cmd, u16 mask) 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, void *dev_id) /* Check Command Complete Interrupt Pending */ if (intr_loc & CMD_COMPLETED) { ctrl->cmd_busy = 0; + smp_mb(); wake_up_interruptible(&ctrl->queue); }