From: "Bryan O'Sullivan" The mb() prevents the compiler from reordering on this function, with some versions of gcc and -Os optimization. The result is random failures in the EEPROM read without this change. Signed-off-by: Dave Olson Signed-off-by: Bryan O'Sullivan Cc: "Michael S. Tsirkin" Cc: Roland Dreier Signed-off-by: Andrew Morton --- drivers/infiniband/hw/ipath/ipath_eeprom.c | 1 + 1 files changed, 1 insertion(+) diff -puN drivers/infiniband/hw/ipath/ipath_eeprom.c~ib-ipath-fixes-a-bug-where-our-delay-for-eeprom-no drivers/infiniband/hw/ipath/ipath_eeprom.c --- a/drivers/infiniband/hw/ipath/ipath_eeprom.c~ib-ipath-fixes-a-bug-where-our-delay-for-eeprom-no +++ a/drivers/infiniband/hw/ipath/ipath_eeprom.c @@ -186,6 +186,7 @@ bail: */ static void i2c_wait_for_writes(struct ipath_devdata *dd) { + mb(); (void)ipath_read_kreg32(dd, dd->ipath_kregs->kr_scratch); } _