Message ID | 20191120012859.23300-38-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: > Rather than using the pdn->pe_number for a device as an index into the > IODA PE array we can use the reverse map. This maps the RID (i.e. bdfn) > to the PE number associated with it. Firmware maintains a copy of the > rmap which is used by the hardware for determining which PE to use > when handling a DMA so this gets us a bit closer to the model used > by the HW, which is comprehensible by mortals, rather than... whatever s/comprensible/comprehensible/ ? > the hell is going on currently. Merge this into 02/46? > > Signed-off-by: Oliver O'Halloran <oohall@gmail.com> > --- > arch/powerpc/platforms/powernv/pci-ioda.c | 8 ++------ > 1 file changed, 2 insertions(+), 6 deletions(-) > > diff --git a/arch/powerpc/platforms/powernv/pci-ioda.c b/arch/powerpc/platforms/powernv/pci-ioda.c > index 8525642b1256..d111a50fbe68 100644 > --- a/arch/powerpc/platforms/powernv/pci-ioda.c > +++ b/arch/powerpc/platforms/powernv/pci-ioda.c > @@ -672,13 +672,9 @@ struct pnv_ioda_pe *__pnv_ioda_get_pe(struct pnv_phb *phb, u16 bdfn) > struct pnv_ioda_pe *pnv_ioda_get_pe(struct pci_dev *dev) > { > struct pnv_phb *phb = pci_bus_to_pnvhb(dev->bus); > - struct pci_dn *pdn = pci_get_pdn(dev); > + u16 bdfn = (dev->bus->number << 8) | dev->devfn; > > - if (!pdn) > - return NULL; > - if (pdn->pe_number == IODA_INVALID_PE) > - return NULL; > - return &phb->ioda.pe_array[pdn->pe_number]; > + return __pnv_ioda_get_pe(phb, bdfn); > } > > static int pnv_ioda_set_one_peltv(struct pnv_phb *phb, >
diff --git a/arch/powerpc/platforms/powernv/pci-ioda.c b/arch/powerpc/platforms/powernv/pci-ioda.c index 8525642b1256..d111a50fbe68 100644 --- a/arch/powerpc/platforms/powernv/pci-ioda.c +++ b/arch/powerpc/platforms/powernv/pci-ioda.c @@ -672,13 +672,9 @@ struct pnv_ioda_pe *__pnv_ioda_get_pe(struct pnv_phb *phb, u16 bdfn) struct pnv_ioda_pe *pnv_ioda_get_pe(struct pci_dev *dev) { struct pnv_phb *phb = pci_bus_to_pnvhb(dev->bus); - struct pci_dn *pdn = pci_get_pdn(dev); + u16 bdfn = (dev->bus->number << 8) | dev->devfn; - if (!pdn) - return NULL; - if (pdn->pe_number == IODA_INVALID_PE) - return NULL; - return &phb->ioda.pe_array[pdn->pe_number]; + return __pnv_ioda_get_pe(phb, bdfn); } static int pnv_ioda_set_one_peltv(struct pnv_phb *phb,
Rather than using the pdn->pe_number for a device as an index into the IODA PE array we can use the reverse map. This maps the RID (i.e. bdfn) to the PE number associated with it. Firmware maintains a copy of the rmap which is used by the hardware for determining which PE to use when handling a DMA so this gets us a bit closer to the model used by the HW, which is comprensible by mortals, rather than... whatever the hell is going on currently. Signed-off-by: Oliver O'Halloran <oohall@gmail.com> --- arch/powerpc/platforms/powernv/pci-ioda.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-)