diff options
author | Sathya Perla <sathyap@serverengines.com> | 2010-02-14 16:22:01 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-02-16 00:49:51 -0500 |
commit | cf588477a3fbf085426e5c0b6205984ebb7e2187 (patch) | |
tree | 3c5cf63269e443fa5c0518581526017774fa5888 /drivers/net/benet/be_cmds.c | |
parent | 0dca3a843632c2fbb6e358734fb08fc23e800f50 (diff) |
be2net: implement EEH pci error recovery handlers
The code has been tested on IBM pSeries server.
Signed-off-by: Sathya Perla <sathyap@serverengines.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/benet/be_cmds.c')
-rw-r--r-- | drivers/net/benet/be_cmds.c | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/drivers/net/benet/be_cmds.c b/drivers/net/benet/be_cmds.c index d1a0e5ede4b3..3397ee327e1f 100644 --- a/drivers/net/benet/be_cmds.c +++ b/drivers/net/benet/be_cmds.c | |||
@@ -167,7 +167,14 @@ static int be_mbox_db_ready_wait(struct be_adapter *adapter, void __iomem *db) | |||
167 | u32 ready; | 167 | u32 ready; |
168 | 168 | ||
169 | do { | 169 | do { |
170 | ready = ioread32(db) & MPU_MAILBOX_DB_RDY_MASK; | 170 | ready = ioread32(db); |
171 | if (ready == 0xffffffff) { | ||
172 | dev_err(&adapter->pdev->dev, | ||
173 | "pci slot disconnected\n"); | ||
174 | return -1; | ||
175 | } | ||
176 | |||
177 | ready &= MPU_MAILBOX_DB_RDY_MASK; | ||
171 | if (ready) | 178 | if (ready) |
172 | break; | 179 | break; |
173 | 180 | ||
@@ -198,6 +205,11 @@ static int be_mbox_notify_wait(struct be_adapter *adapter) | |||
198 | struct be_mcc_mailbox *mbox = mbox_mem->va; | 205 | struct be_mcc_mailbox *mbox = mbox_mem->va; |
199 | struct be_mcc_compl *compl = &mbox->compl; | 206 | struct be_mcc_compl *compl = &mbox->compl; |
200 | 207 | ||
208 | /* wait for ready to be set */ | ||
209 | status = be_mbox_db_ready_wait(adapter, db); | ||
210 | if (status != 0) | ||
211 | return status; | ||
212 | |||
201 | val |= MPU_MAILBOX_DB_HI_MASK; | 213 | val |= MPU_MAILBOX_DB_HI_MASK; |
202 | /* at bits 2 - 31 place mbox dma addr msb bits 34 - 63 */ | 214 | /* at bits 2 - 31 place mbox dma addr msb bits 34 - 63 */ |
203 | val |= (upper_32_bits(mbox_mem->dma) >> 2) << 2; | 215 | val |= (upper_32_bits(mbox_mem->dma) >> 2) << 2; |
@@ -396,6 +408,9 @@ int be_cmd_fw_clean(struct be_adapter *adapter) | |||
396 | u8 *wrb; | 408 | u8 *wrb; |
397 | int status; | 409 | int status; |
398 | 410 | ||
411 | if (adapter->eeh_err) | ||
412 | return -EIO; | ||
413 | |||
399 | spin_lock(&adapter->mbox_lock); | 414 | spin_lock(&adapter->mbox_lock); |
400 | 415 | ||
401 | wrb = (u8 *)wrb_from_mbox(adapter); | 416 | wrb = (u8 *)wrb_from_mbox(adapter); |
@@ -768,6 +783,9 @@ int be_cmd_q_destroy(struct be_adapter *adapter, struct be_queue_info *q, | |||
768 | u8 subsys = 0, opcode = 0; | 783 | u8 subsys = 0, opcode = 0; |
769 | int status; | 784 | int status; |
770 | 785 | ||
786 | if (adapter->eeh_err) | ||
787 | return -EIO; | ||
788 | |||
771 | spin_lock(&adapter->mbox_lock); | 789 | spin_lock(&adapter->mbox_lock); |
772 | 790 | ||
773 | wrb = wrb_from_mbox(adapter); | 791 | wrb = wrb_from_mbox(adapter); |
@@ -856,6 +874,9 @@ int be_cmd_if_destroy(struct be_adapter *adapter, u32 interface_id) | |||
856 | struct be_cmd_req_if_destroy *req; | 874 | struct be_cmd_req_if_destroy *req; |
857 | int status; | 875 | int status; |
858 | 876 | ||
877 | if (adapter->eeh_err) | ||
878 | return -EIO; | ||
879 | |||
859 | spin_lock(&adapter->mbox_lock); | 880 | spin_lock(&adapter->mbox_lock); |
860 | 881 | ||
861 | wrb = wrb_from_mbox(adapter); | 882 | wrb = wrb_from_mbox(adapter); |