iw_cxgb3: handle chip reset notifications
authorDivy Le Ray <divy@chelsio.com>
Tue, 27 Jan 2009 06:22:19 +0000 (22:22 -0800)
committerDavid S. Miller <davem@davemloft.net>
Tue, 27 Jan 2009 06:22:19 +0000 (22:22 -0800)
Freeze activity when notified that the underlying chip
is getting reset on a EEH event or fatal error.

Signed-off-by: Divy Le Ray <divy@chelsio.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/infiniband/hw/cxgb3/cxio_hal.c
drivers/infiniband/hw/cxgb3/cxio_hal.h
drivers/infiniband/hw/cxgb3/iwch.c

index 4dcf08b3fd832dd12d96a5a5ce3c9dcc1c8a5058..11efd3528ce4e8e9943153c3914d45de3467e02e 100644 (file)
@@ -701,6 +701,9 @@ static int __cxio_tpt_op(struct cxio_rdev *rdev_p, u32 reset_tpt_entry,
        u32 stag_idx;
        u32 wptr;
 
+       if (rdev_p->flags)
+               return -EIO;
+
        stag_state = stag_state > 0;
        stag_idx = (*stag) >> 8;
 
index 656fe47bc84f94ea2d1af60e2d916be85a69cd47..9ed65b055171e331fda71fc32302de55106682c8 100644 (file)
@@ -108,6 +108,8 @@ struct cxio_rdev {
        struct gen_pool *pbl_pool;
        struct gen_pool *rqt_pool;
        struct list_head entry;
+       u32     flags;
+#define        CXIO_ERROR_FATAL        1
 };
 
 static inline int cxio_num_stags(struct cxio_rdev *rdev_p)
index 4489c89d6710c6b22c478f4b7742ff0ff4688576..37a4fc264a07a10bc34ff8e7f92b34869153e640 100644 (file)
@@ -51,13 +51,15 @@ cxgb3_cpl_handler_func t3c_handlers[NUM_CPL_CMDS];
 
 static void open_rnic_dev(struct t3cdev *);
 static void close_rnic_dev(struct t3cdev *);
+static void iwch_err_handler(struct t3cdev *, u32, u32);
 
 struct cxgb3_client t3c_client = {
        .name = "iw_cxgb3",
        .add = open_rnic_dev,
        .remove = close_rnic_dev,
        .handlers = t3c_handlers,
-       .redirect = iwch_ep_redirect
+       .redirect = iwch_ep_redirect,
+       .err_handler = iwch_err_handler
 };
 
 static LIST_HEAD(dev_list);
@@ -160,6 +162,17 @@ static void close_rnic_dev(struct t3cdev *tdev)
        mutex_unlock(&dev_mutex);
 }
 
+static void iwch_err_handler(struct t3cdev *tdev, u32 status, u32 error)
+{
+       struct cxio_rdev *rdev = tdev->ulp;
+
+       if (status == OFFLOAD_STATUS_DOWN)
+               rdev->flags = CXIO_ERROR_FATAL;
+
+       return;
+
+}
+
 static int __init iwch_init_module(void)
 {
        int err;