lkml.org 
[lkml]   [2020]   [Jul]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    SubjectRe: [PATCH v4 6/7] powerpc/pseries/iommu: Make use of DDW even if it does not map the partition
    From
    Date
    On Thu, 2020-07-16 at 04:16 -0300, Leonardo Bras wrote:
    > +static void iommu_pseries_table_update(struct pci_dev *dev,
    > + struct device_node *pdn)
    > +{
    > + const struct dynamic_dma_window_prop *ddw;
    > + struct pci_dn *pci;
    > + int len;
    > +
    > + ddw = of_get_property(pdn, DMA64_PROPNAME, &len);
    > + if (!ddw || len < sizeof(struct dynamic_dma_window_prop))
    > + return;
    > +
    > + iommu_table_update(pci->table_group->tables[0], pci->phb->node,
    > + ddw->liobn, ddw->dma_base, ddw->tce_shift,
    > + ddw->window_shift);
    > +}
    > +
    > static void pci_dma_dev_setup_pSeriesLP(struct pci_dev *dev)
    > {
    > struct device_node *pdn, *dn;
    > @@ -1382,6 +1403,7 @@ static bool iommu_bypass_supported_pSeriesLP(struct pci_dev *pdev, u64 dma_mask)
    > pdev->dev.archdata.dma_offset = enable_ddw(pdev, pdn);
    > if (pdev->dev.archdata.dma_offset)
    > return true;
    > + iommu_pseries_table_update(pdev, pdn);
    > }
    >

    Noticed a bug in this one: pci is not getting assigned.
    My bad, there must have been a merge error.

    Also, I will refactor the function to make use of pdn only, as I can do
    pci = PCI_DN(pdn) (I think it's better this way).

    Sorry for the buggy patch.

    Best regards,

    \
     
     \ /
      Last update: 2020-07-21 23:40    [W:3.209 / U:0.120 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site