Commit 1d9a5446 authored by Gavin Shan's avatar Gavin Shan Committed by Benjamin Herrenschmidt

powerpc/powernv: Use EEH PCI config accessors

For EEH PowerNV backends, they need use their own PCI config
accesors as the normal one could be blocked during PE reset.
The patch also removes necessary parameter "hose" for the
function ioda_eeh_bridge_reset().
Signed-off-by: default avatarGavin Shan <gwshan@linux.vnet.ibm.com>
Signed-off-by: default avatarBenjamin Herrenschmidt <benh@kernel.crashing.org>
parent d0914f50
...@@ -478,26 +478,27 @@ static int ioda_eeh_root_reset(struct pci_controller *hose, int option) ...@@ -478,26 +478,27 @@ static int ioda_eeh_root_reset(struct pci_controller *hose, int option)
return 0; return 0;
} }
static int ioda_eeh_bridge_reset(struct pci_controller *hose, static int ioda_eeh_bridge_reset(struct pci_dev *dev, int option)
struct pci_dev *dev, int option)
{ {
u16 ctrl; struct device_node *dn = pci_device_to_OF_node(dev);
u32 ctrl;
pr_debug("%s: Reset device %04x:%02x:%02x.%01x with option %d\n", pr_debug("%s: Reset PCI bus %04x:%02x with option %d\n",
__func__, hose->global_number, dev->bus->number, __func__, pci_domain_nr(dev->bus),
PCI_SLOT(dev->devfn), PCI_FUNC(dev->devfn), option); dev->bus->number, option);
switch (option) { switch (option) {
case EEH_RESET_FUNDAMENTAL: case EEH_RESET_FUNDAMENTAL:
case EEH_RESET_HOT: case EEH_RESET_HOT:
pci_read_config_word(dev, PCI_BRIDGE_CONTROL, &ctrl); eeh_ops->read_config(dn, PCI_BRIDGE_CONTROL, 2, &ctrl);
ctrl |= PCI_BRIDGE_CTL_BUS_RESET; ctrl |= PCI_BRIDGE_CTL_BUS_RESET;
pci_write_config_word(dev, PCI_BRIDGE_CONTROL, ctrl); eeh_ops->write_config(dn, PCI_BRIDGE_CONTROL, 2, ctrl);
break; break;
case EEH_RESET_DEACTIVATE: case EEH_RESET_DEACTIVATE:
pci_read_config_word(dev, PCI_BRIDGE_CONTROL, &ctrl); eeh_ops->read_config(dn, PCI_BRIDGE_CONTROL, 2, &ctrl);
ctrl &= ~PCI_BRIDGE_CTL_BUS_RESET; ctrl &= ~PCI_BRIDGE_CTL_BUS_RESET;
pci_write_config_word(dev, PCI_BRIDGE_CONTROL, ctrl); eeh_ops->write_config(dn, PCI_BRIDGE_CONTROL, 2, ctrl);
break; break;
} }
...@@ -552,7 +553,7 @@ static int ioda_eeh_reset(struct eeh_pe *pe, int option) ...@@ -552,7 +553,7 @@ static int ioda_eeh_reset(struct eeh_pe *pe, int option)
if (pci_is_root_bus(bus)) if (pci_is_root_bus(bus))
ret = ioda_eeh_root_reset(hose, option); ret = ioda_eeh_root_reset(hose, option);
else else
ret = ioda_eeh_bridge_reset(hose, bus->self, option); ret = ioda_eeh_bridge_reset(bus->self, option);
} }
return ret; return ret;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment