Message ID | 20191120012859.23300-27-oohall@gmail.com (mailing list archive) |
---|---|
State | RFC |
Headers | show |
Series | [Very,RFC,01/46] powerpc/eeh: Don't attempt to restore VF config space after reset | expand |
Context | Check | Description |
---|---|---|
snowpatch_ozlabs/apply_patch | warning | Failed to apply on branch powerpc/merge (784eee1cc44801366d4f197e0ade7739ee8e1e83) |
snowpatch_ozlabs/apply_patch | warning | Failed to apply on branch powerpc/next (0695f8bca93ea0c57f0e8e21b4b4db70183b3d1c) |
snowpatch_ozlabs/apply_patch | warning | Failed to apply on branch linus/master (c74386d50fbaf4a54fd3fe560f1abc709c0cff4b) |
snowpatch_ozlabs/apply_patch | warning | Failed to apply on branch powerpc/fixes (7d6475051fb3d9339c5c760ed9883bc0a9048b21) |
snowpatch_ozlabs/apply_patch | warning | Failed to apply on branch linux-next (5d1131b4d61e52e5702e0fa4bcbec81ac7d6ef52) |
snowpatch_ozlabs/apply_patch | fail | Failed to apply to any branch |
On 20/11/2019 12:28, Oliver O'Halloran wrote: > Remove the use of pci_dn from the low-level config space access functions. > These are used by the eeh's config ops and the bus config ops that we > provide to the PCI core. > > Signed-off-by: Oliver O'Halloran <oohall@gmail.com> > --- > arch/powerpc/platforms/powernv/eeh-powernv.c | 14 +++-------- > arch/powerpc/platforms/powernv/pci.c | 26 ++++++++------------ > arch/powerpc/platforms/powernv/pci.h | 6 ++--- > 3 files changed, 16 insertions(+), 30 deletions(-) > > diff --git a/arch/powerpc/platforms/powernv/eeh-powernv.c b/arch/powerpc/platforms/powernv/eeh-powernv.c > index 49a932ff092a..8a73bc7517c5 100644 > --- a/arch/powerpc/platforms/powernv/eeh-powernv.c > +++ b/arch/powerpc/platforms/powernv/eeh-powernv.c > @@ -331,31 +331,25 @@ static inline bool pnv_eeh_cfg_blocked(struct eeh_dev *edev) > static int pnv_eeh_read_config(struct eeh_dev *edev, > int where, int size, u32 *val) > { > - struct pci_dn *pdn = eeh_dev_to_pdn(edev); > - > - if (!pdn) > - return PCIBIOS_DEVICE_NOT_FOUND; > + struct pnv_phb *phb = edev->controller->private_data; > > if (pnv_eeh_cfg_blocked(edev)) { > *val = 0xFFFFFFFF; > return PCIBIOS_SET_FAILED; > } > > - return pnv_pci_cfg_read(pdn, where, size, val); > + return pnv_pci_cfg_read(phb, edev->bdfn, where, size, val); > } > > static int pnv_eeh_write_config(struct eeh_dev *edev, > int where, int size, u32 val) > { > - struct pci_dn *pdn = eeh_dev_to_pdn(edev); > - > - if (!pdn) > - return PCIBIOS_DEVICE_NOT_FOUND; > + struct pnv_phb *phb = edev->controller->private_data; > > if (pnv_eeh_cfg_blocked(edev)) > return PCIBIOS_SET_FAILED; > > - return pnv_pci_cfg_write(pdn, where, size, val); > + return pnv_pci_cfg_write(phb, edev->bdfn, where, size, val); > } > > static struct eeh_pe *pnv_eeh_pe_get_parent(struct pci_dev *pdev) > diff --git a/arch/powerpc/platforms/powernv/pci.c b/arch/powerpc/platforms/powernv/pci.c > index 50142ff045ac..36eea4bb514c 100644 > --- a/arch/powerpc/platforms/powernv/pci.c > +++ b/arch/powerpc/platforms/powernv/pci.c > @@ -654,11 +654,9 @@ static void pnv_pci_config_check_eeh(struct pnv_phb *phb, u16 bdfn) > } > } > > -int pnv_pci_cfg_read(struct pci_dn *pdn, > +int pnv_pci_cfg_read(struct pnv_phb *phb, u16 bdfn, > int where, int size, u32 *val) > { > - struct pnv_phb *phb = pdn->phb->private_data; > - u32 bdfn = (pdn->busno << 8) | pdn->devfn; > s64 rc; > > switch (size) { > @@ -685,19 +683,16 @@ int pnv_pci_cfg_read(struct pci_dn *pdn, > return PCIBIOS_FUNC_NOT_SUPPORTED; > } > > - pr_devel("%s: bus: %x devfn: %x +%x/%x -> %08x\n", > - __func__, pdn->busno, pdn->devfn, where, size, *val); > + pr_devel("%s: bdfn: %x +%x/%x -> %08x\n", > + __func__, bdfn, where, size, *val); > return PCIBIOS_SUCCESSFUL; > } > > -int pnv_pci_cfg_write(struct pci_dn *pdn, > +int pnv_pci_cfg_write(struct pnv_phb *phb, u16 bdfn, > int where, int size, u32 val) > { > - struct pnv_phb *phb = pdn->phb->private_data; > - u32 bdfn = (pdn->busno << 8) | pdn->devfn; > - > - pr_devel("%s: bus: %x devfn: %x +%x/%x -> %08x\n", > - __func__, pdn->busno, pdn->devfn, where, size, val); > + pr_devel("%s: bdfn: %x +%x/%x -> %08x\n", > + __func__, bdfn, where, size, val); > switch (size) { > case 1: > opal_pci_config_write_byte(phb->opal_id, bdfn, where, val); > @@ -753,12 +748,11 @@ static int pnv_pci_read_config(struct pci_bus *bus, > if (!pdn) > return PCIBIOS_DEVICE_NOT_FOUND; > > - edev = pdn_to_eeh_dev(pdn); > + edev = pnv_eeh_find_edev(phb, bdfn); > if (!pnv_eeh_pre_cfg_check(edev)) > return PCIBIOS_DEVICE_NOT_FOUND; > > - ret = pnv_pci_cfg_read(pdn, where, size, val); > - phb = pdn->phb->private_data; > + ret = pnv_pci_cfg_read(phb, bdfn, where, size, val); > if (phb->flags & PNV_PHB_FLAG_EEH && edev) { > if (*val == EEH_IO_ERROR_VALUE(size) && > eeh_dev_check_failure(edev)) > @@ -784,11 +778,11 @@ static int pnv_pci_write_config(struct pci_bus *bus, > if (!pdn) > return PCIBIOS_DEVICE_NOT_FOUND; > > - edev = pdn_to_eeh_dev(pdn); > + edev = pnv_eeh_find_edev(phb, bdfn); > if (!pnv_eeh_pre_cfg_check(edev)) > return PCIBIOS_DEVICE_NOT_FOUND; > > - ret = pnv_pci_cfg_write(pdn, where, size, val); > + ret = pnv_pci_cfg_write(phb, bdfn, where, size, val); > > if (!(phb->flags & PNV_PHB_FLAG_EEH)) > pnv_pci_config_check_eeh(phb, bdfn); > diff --git a/arch/powerpc/platforms/powernv/pci.h b/arch/powerpc/platforms/powernv/pci.h > index be435a810d19..52dc4d05eaca 100644 > --- a/arch/powerpc/platforms/powernv/pci.h > +++ b/arch/powerpc/platforms/powernv/pci.h > @@ -7,8 +7,6 @@ > #include <asm/iommu.h> > #include <asm/msi_bitmap.h> > > -struct pci_dn; > - This is the best bit :) Reviewed-by: Alexey Kardashevskiy <aik@ozlabs.ru> > enum pnv_phb_type { > PNV_PHB_IODA1 = 0, > PNV_PHB_IODA2 = 1, > @@ -174,9 +172,9 @@ extern struct pci_ops pnv_pci_ops; > > void pnv_pci_dump_phb_diag_data(struct pci_controller *hose, > unsigned char *log_buff); > -int pnv_pci_cfg_read(struct pci_dn *pdn, > +int pnv_pci_cfg_read(struct pnv_phb *phb, u16 bdfn, > int where, int size, u32 *val); > -int pnv_pci_cfg_write(struct pci_dn *pdn, > +int pnv_pci_cfg_write(struct pnv_phb *phb, u16 bdfn, > int where, int size, u32 val); > extern struct iommu_table *pnv_pci_table_alloc(int nid); > >
diff --git a/arch/powerpc/platforms/powernv/eeh-powernv.c b/arch/powerpc/platforms/powernv/eeh-powernv.c index 49a932ff092a..8a73bc7517c5 100644 --- a/arch/powerpc/platforms/powernv/eeh-powernv.c +++ b/arch/powerpc/platforms/powernv/eeh-powernv.c @@ -331,31 +331,25 @@ static inline bool pnv_eeh_cfg_blocked(struct eeh_dev *edev) static int pnv_eeh_read_config(struct eeh_dev *edev, int where, int size, u32 *val) { - struct pci_dn *pdn = eeh_dev_to_pdn(edev); - - if (!pdn) - return PCIBIOS_DEVICE_NOT_FOUND; + struct pnv_phb *phb = edev->controller->private_data; if (pnv_eeh_cfg_blocked(edev)) { *val = 0xFFFFFFFF; return PCIBIOS_SET_FAILED; } - return pnv_pci_cfg_read(pdn, where, size, val); + return pnv_pci_cfg_read(phb, edev->bdfn, where, size, val); } static int pnv_eeh_write_config(struct eeh_dev *edev, int where, int size, u32 val) { - struct pci_dn *pdn = eeh_dev_to_pdn(edev); - - if (!pdn) - return PCIBIOS_DEVICE_NOT_FOUND; + struct pnv_phb *phb = edev->controller->private_data; if (pnv_eeh_cfg_blocked(edev)) return PCIBIOS_SET_FAILED; - return pnv_pci_cfg_write(pdn, where, size, val); + return pnv_pci_cfg_write(phb, edev->bdfn, where, size, val); } static struct eeh_pe *pnv_eeh_pe_get_parent(struct pci_dev *pdev) diff --git a/arch/powerpc/platforms/powernv/pci.c b/arch/powerpc/platforms/powernv/pci.c index 50142ff045ac..36eea4bb514c 100644 --- a/arch/powerpc/platforms/powernv/pci.c +++ b/arch/powerpc/platforms/powernv/pci.c @@ -654,11 +654,9 @@ static void pnv_pci_config_check_eeh(struct pnv_phb *phb, u16 bdfn) } } -int pnv_pci_cfg_read(struct pci_dn *pdn, +int pnv_pci_cfg_read(struct pnv_phb *phb, u16 bdfn, int where, int size, u32 *val) { - struct pnv_phb *phb = pdn->phb->private_data; - u32 bdfn = (pdn->busno << 8) | pdn->devfn; s64 rc; switch (size) { @@ -685,19 +683,16 @@ int pnv_pci_cfg_read(struct pci_dn *pdn, return PCIBIOS_FUNC_NOT_SUPPORTED; } - pr_devel("%s: bus: %x devfn: %x +%x/%x -> %08x\n", - __func__, pdn->busno, pdn->devfn, where, size, *val); + pr_devel("%s: bdfn: %x +%x/%x -> %08x\n", + __func__, bdfn, where, size, *val); return PCIBIOS_SUCCESSFUL; } -int pnv_pci_cfg_write(struct pci_dn *pdn, +int pnv_pci_cfg_write(struct pnv_phb *phb, u16 bdfn, int where, int size, u32 val) { - struct pnv_phb *phb = pdn->phb->private_data; - u32 bdfn = (pdn->busno << 8) | pdn->devfn; - - pr_devel("%s: bus: %x devfn: %x +%x/%x -> %08x\n", - __func__, pdn->busno, pdn->devfn, where, size, val); + pr_devel("%s: bdfn: %x +%x/%x -> %08x\n", + __func__, bdfn, where, size, val); switch (size) { case 1: opal_pci_config_write_byte(phb->opal_id, bdfn, where, val); @@ -753,12 +748,11 @@ static int pnv_pci_read_config(struct pci_bus *bus, if (!pdn) return PCIBIOS_DEVICE_NOT_FOUND; - edev = pdn_to_eeh_dev(pdn); + edev = pnv_eeh_find_edev(phb, bdfn); if (!pnv_eeh_pre_cfg_check(edev)) return PCIBIOS_DEVICE_NOT_FOUND; - ret = pnv_pci_cfg_read(pdn, where, size, val); - phb = pdn->phb->private_data; + ret = pnv_pci_cfg_read(phb, bdfn, where, size, val); if (phb->flags & PNV_PHB_FLAG_EEH && edev) { if (*val == EEH_IO_ERROR_VALUE(size) && eeh_dev_check_failure(edev)) @@ -784,11 +778,11 @@ static int pnv_pci_write_config(struct pci_bus *bus, if (!pdn) return PCIBIOS_DEVICE_NOT_FOUND; - edev = pdn_to_eeh_dev(pdn); + edev = pnv_eeh_find_edev(phb, bdfn); if (!pnv_eeh_pre_cfg_check(edev)) return PCIBIOS_DEVICE_NOT_FOUND; - ret = pnv_pci_cfg_write(pdn, where, size, val); + ret = pnv_pci_cfg_write(phb, bdfn, where, size, val); if (!(phb->flags & PNV_PHB_FLAG_EEH)) pnv_pci_config_check_eeh(phb, bdfn); diff --git a/arch/powerpc/platforms/powernv/pci.h b/arch/powerpc/platforms/powernv/pci.h index be435a810d19..52dc4d05eaca 100644 --- a/arch/powerpc/platforms/powernv/pci.h +++ b/arch/powerpc/platforms/powernv/pci.h @@ -7,8 +7,6 @@ #include <asm/iommu.h> #include <asm/msi_bitmap.h> -struct pci_dn; - enum pnv_phb_type { PNV_PHB_IODA1 = 0, PNV_PHB_IODA2 = 1, @@ -174,9 +172,9 @@ extern struct pci_ops pnv_pci_ops; void pnv_pci_dump_phb_diag_data(struct pci_controller *hose, unsigned char *log_buff); -int pnv_pci_cfg_read(struct pci_dn *pdn, +int pnv_pci_cfg_read(struct pnv_phb *phb, u16 bdfn, int where, int size, u32 *val); -int pnv_pci_cfg_write(struct pci_dn *pdn, +int pnv_pci_cfg_write(struct pnv_phb *phb, u16 bdfn, int where, int size, u32 val); extern struct iommu_table *pnv_pci_table_alloc(int nid);
Remove the use of pci_dn from the low-level config space access functions. These are used by the eeh's config ops and the bus config ops that we provide to the PCI core. Signed-off-by: Oliver O'Halloran <oohall@gmail.com> --- arch/powerpc/platforms/powernv/eeh-powernv.c | 14 +++-------- arch/powerpc/platforms/powernv/pci.c | 26 ++++++++------------ arch/powerpc/platforms/powernv/pci.h | 6 ++--- 3 files changed, 16 insertions(+), 30 deletions(-)