return 0;
}
-static void rsxx_eeh_frozen(struct pci_dev *dev)
+static int rsxx_eeh_frozen(struct pci_dev *dev)
{
struct rsxx_cardinfo *card = pci_get_drvdata(dev);
int i;
+ int st;
dev_warn(&dev->dev, "IBM FlashSystem PCI: preparing for slot reset.\n");
pci_disable_device(dev);
- rsxx_eeh_save_issued_dmas(card);
+ st = rsxx_eeh_save_issued_dmas(card);
+ if (st)
+ return st;
rsxx_eeh_save_issued_creg(card);
card->ctrl[i].cmd.buf,
card->ctrl[i].cmd.dma_addr);
}
+
+ return 0;
}
static void rsxx_eeh_failure(struct pci_dev *dev)
static pci_ers_result_t rsxx_error_detected(struct pci_dev *dev,
enum pci_channel_state error)
{
+ int st;
+
if (dev->revision < RSXX_EEH_SUPPORT)
return PCI_ERS_RESULT_NONE;
return PCI_ERS_RESULT_DISCONNECT;
}
- rsxx_eeh_frozen(dev);
+ st = rsxx_eeh_frozen(dev);
+ if (st) {
+ dev_err(&dev->dev, "Slot reset setup failed\n");
+ rsxx_eeh_failure(dev);
+ return PCI_ERS_RESULT_DISCONNECT;
+ }
+
return PCI_ERS_RESULT_NEED_RESET;
}
}
}
-void rsxx_eeh_save_issued_dmas(struct rsxx_cardinfo *card)
+int rsxx_eeh_save_issued_dmas(struct rsxx_cardinfo *card)
{
int i;
int j;
issued_dmas = kzalloc(sizeof(*issued_dmas) * card->n_targets,
GFP_KERNEL);
+ if (!issued_dmas)
+ return -ENOMEM;
for (i = 0; i < card->n_targets; i++) {
INIT_LIST_HEAD(&issued_dmas[i]);
}
kfree(issued_dmas);
+
+ return 0;
}
void rsxx_eeh_cancel_dmas(struct rsxx_cardinfo *card)
rsxx_dma_cb cb,
void *cb_data);
int rsxx_hw_buffers_init(struct pci_dev *dev, struct rsxx_dma_ctrl *ctrl);
-void rsxx_eeh_save_issued_dmas(struct rsxx_cardinfo *card);
+int rsxx_eeh_save_issued_dmas(struct rsxx_cardinfo *card);
void rsxx_eeh_cancel_dmas(struct rsxx_cardinfo *card);
int rsxx_eeh_remap_dmas(struct rsxx_cardinfo *card);