Skip to content

Commit 2d32a9a

Browse files
kkaneshigejbarnes993
authored andcommitted
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>
1 parent c6b069e commit 2d32a9a

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

‎drivers/pci/hotplug/pciehp_hpc.c‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -279,6 +279,7 @@ static int pcie_write_cmd(struct slot *slot, u16 cmd, u16 mask)
279279
slot_ctrl |= ((cmd & mask) | CMD_CMPL_INTR_ENABLE);
280280

281281
ctrl->cmd_busy = 1;
282+
smp_mb();
282283
retval = pciehp_writew(ctrl, SLOTCTRL, slot_ctrl);
283284
if (retval)
284285
err("%s: Cannot write to SLOTCTRL register\n", __func__);
@@ -759,6 +760,7 @@ static irqreturn_t pcie_isr(int irq, void *dev_id)
759760
/* Check Command Complete Interrupt Pending */
760761
if (intr_loc & CMD_COMPLETED) {
761762
ctrl->cmd_busy = 0;
763+
smp_mb();
762764
wake_up_interruptible(&ctrl->queue);
763765
}
764766

0 commit comments

Comments
 (0)