Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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 <kaneshige.kenji@jp.fujitsu.com>
Signed-off-by: Kristen Carlson Accardi <kristen.c.accardi@intel.com>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>

authored by

Kenji Kaneshige and committed by
Jesse Barnes
2d32a9ae c6b069e9

+2
+2
drivers/pci/hotplug/pciehp_hpc.c
··· 279 279 slot_ctrl |= ((cmd & mask) | CMD_CMPL_INTR_ENABLE); 280 280 281 281 ctrl->cmd_busy = 1; 282 + smp_mb(); 282 283 retval = pciehp_writew(ctrl, SLOTCTRL, slot_ctrl); 283 284 if (retval) 284 285 err("%s: Cannot write to SLOTCTRL register\n", __func__); ··· 760 759 /* Check Command Complete Interrupt Pending */ 761 760 if (intr_loc & CMD_COMPLETED) { 762 761 ctrl->cmd_busy = 0; 762 + smp_mb(); 763 763 wake_up_interruptible(&ctrl->queue); 764 764 } 765 765