summaryrefslogtreecommitdiffstats
path: root/drivers/net/s2io.c
diff options
context:
space:
mode:
authorSreenivasa Honnur <Sreenivasa.Honnur@neterion.com>2007-12-05 23:59:28 -0500
committerJeff Garzik <jeff@garzik.org>2007-12-07 15:09:06 -0500
commit7962024e9d16e9349d76b553326f3fa7be64305e (patch)
tree4d12ca9d0219967ab2dc90b5dc3a0adb8283c84a /drivers/net/s2io.c
parent17cf803a57c89c5afe6d5299ac9416683c3240dd (diff)
downloadop-kernel-dev-7962024e9d16e9349d76b553326f3fa7be64305e.zip
op-kernel-dev-7962024e9d16e9349d76b553326f3fa7be64305e.tar.gz
S2io: Check for register initialization completion before accesing device registers
- Making sure register initialisation is complete before proceeding further. The driver must wait until initialization is complete before attempting to access any other device registers. Signed-off-by: Surjit Reang <surjit.reang@neterion.com> Signed-off-by: Sreenivasa Honnur <sreenivasa.honnur@neterion.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>
Diffstat (limited to 'drivers/net/s2io.c')
-rw-r--r--drivers/net/s2io.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/drivers/net/s2io.c b/drivers/net/s2io.c
index d5113dd..121cb10 100644
--- a/drivers/net/s2io.c
+++ b/drivers/net/s2io.c
@@ -84,7 +84,7 @@
#include "s2io.h"
#include "s2io-regs.h"
-#define DRV_VERSION "2.0.26.6"
+#define DRV_VERSION "2.0.26.10"
/* S2io Driver name & version. */
static char s2io_driver_name[] = "Neterion";
@@ -1100,6 +1100,20 @@ static int init_nic(struct s2io_nic *nic)
msleep(500);
val64 = readq(&bar0->sw_reset);
+ /* Ensure that it's safe to access registers by checking
+ * RIC_RUNNING bit is reset. Check is valid only for XframeII.
+ */
+ if (nic->device_type == XFRAME_II_DEVICE) {
+ for (i = 0; i < 50; i++) {
+ val64 = readq(&bar0->adapter_status);
+ if (!(val64 & ADAPTER_STATUS_RIC_RUNNING))
+ break;
+ msleep(10);
+ }
+ if (i == 50)
+ return -ENODEV;
+ }
+
/* Enable Receiving broadcasts */
add = &bar0->mac_cfg;
val64 = readq(&bar0->mac_cfg);
OpenPOWER on IntegriCloud