From: Bryan O'Sullivan Date: Thu, 28 Sep 2006 16:00:19 +0000 (-0700) Subject: IB/ipath: Fix EEPROM read when driver is compiled with -Os X-Git-Tag: v2.6.19-rc1~652^2~4 X-Git-Url: http://pilppa.com/gitweb/?a=commitdiff_plain;h=1a4e74a08788db913486cb9a3dc30984c55e9897;p=linux-2.6-omap-h63xx.git 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 Signed-off-by: Roland Dreier --- diff --git a/drivers/infiniband/hw/ipath/ipath_eeprom.c b/drivers/infiniband/hw/ipath/ipath_eeprom.c index c8cfda89cb3..a4019a6b756 100644 --- a/drivers/infiniband/hw/ipath/ipath_eeprom.c +++ b/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)