8250_pci Add EEH support to the 8250 driver for IBM/Digi PCIe 2-port Adapter

The purpose of the patch is to add EEH support to the 8250_PCI driver
for the IBM/Digi PCIE 2port Async EIA-232 Adapter that uses a PLX
chipset on the PPC platforrm.  Basic support for this adapter was
recently added https://lkml.org/lkml/2011/5/11/341

This patch was created against the linux-next kernel

Cc: Greg Kroah-Hartman <gregkh@suse.de>
Cc: Breno Leitao <leitao@linux.vnet.ibm.com>
Cc: Scott Kilau <scottk@digi.com>
Signed-off-by: Michael Reed <mreed@linux.vnet.ibm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This commit is contained in:
Michael Reed 2011-05-31 12:06:28 -05:00 committed by Greg Kroah-Hartman
parent ae92c1f5e7
commit 2807190b69
1 changed files with 47 additions and 0 deletions

View File

@ -2708,6 +2708,7 @@ pciserial_init_one(struct pci_dev *dev, const struct pci_device_id *ent)
board = &pci_boards[ent->driver_data]; board = &pci_boards[ent->driver_data];
rc = pci_enable_device(dev); rc = pci_enable_device(dev);
pci_save_state(dev);
if (rc) if (rc)
return rc; return rc;
@ -4002,6 +4003,51 @@ static struct pci_device_id serial_pci_tbl[] = {
{ 0, } { 0, }
}; };
static pci_ers_result_t serial8250_io_error_detected(struct pci_dev *dev,
pci_channel_state_t state)
{
struct serial_private *priv = pci_get_drvdata(dev);
if (state == pci_channel_io_perm_failure)
return PCI_ERS_RESULT_DISCONNECT;
if (priv)
pciserial_suspend_ports(priv);
pci_disable_device(dev);
return PCI_ERS_RESULT_NEED_RESET;
}
static pci_ers_result_t serial8250_io_slot_reset(struct pci_dev *dev)
{
int rc;
rc = pci_enable_device(dev);
if (rc)
return PCI_ERS_RESULT_DISCONNECT;
pci_restore_state(dev);
pci_save_state(dev);
return PCI_ERS_RESULT_RECOVERED;
}
static void serial8250_io_resume(struct pci_dev *dev)
{
struct serial_private *priv = pci_get_drvdata(dev);
if (priv)
pciserial_resume_ports(priv);
}
static struct pci_error_handlers serial8250_err_handler = {
.error_detected = serial8250_io_error_detected,
.slot_reset = serial8250_io_slot_reset,
.resume = serial8250_io_resume,
};
static struct pci_driver serial_pci_driver = { static struct pci_driver serial_pci_driver = {
.name = "serial", .name = "serial",
.probe = pciserial_init_one, .probe = pciserial_init_one,
@ -4011,6 +4057,7 @@ static struct pci_driver serial_pci_driver = {
.resume = pciserial_resume_one, .resume = pciserial_resume_one,
#endif #endif
.id_table = serial_pci_tbl, .id_table = serial_pci_tbl,
.err_handler = &serial8250_err_handler,
}; };
static int __init serial8250_pci_init(void) static int __init serial8250_pci_init(void)