瀏覽代碼

IB/ipath: Fix EEPROM read when driver is compiled with -Os

The EEPROM is read via programmable I/O pins. When the driver
is compiled -Os, the CPU can speculatively read the I/O
value before it is valid.  This patch fixes the problem.

Signed-off-by: Bryan O'Sullivan <bryan.osullivan@qlogic.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
Bryan O'Sullivan 18 年之前
父節點
當前提交
1a4e74a087
共有 1 個文件被更改,包括 1 次插入0 次删除
  1. 1 0
      drivers/infiniband/hw/ipath/ipath_eeprom.c

+ 1 - 0
drivers/infiniband/hw/ipath/ipath_eeprom.c

@@ -187,6 +187,7 @@ bail:
 static void i2c_wait_for_writes(struct ipath_devdata *dd)
 {
 	(void)ipath_read_kreg32(dd, dd->ipath_kregs->kr_scratch);
+	rmb();
 }
 
 static void scl_out(struct ipath_devdata *dd, u8 bit)