[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <534451cb4ae2a6c38e1cde147d4021581a6a4f0d.camel@gmail.com>
Date: Tue, 21 Jul 2020 18:39:40 -0300
From: Leonardo Bras <leobras.c@...il.com>
To: Michael Ellerman <mpe@...erman.id.au>,
Benjamin Herrenschmidt <benh@...nel.crashing.org>,
Paul Mackerras <paulus@...ba.org>,
Alexey Kardashevskiy <aik@...abs.ru>,
Joel Stanley <joel@....id.au>,
Christophe Leroy <christophe.leroy@....fr>,
Thiago Jung Bauermann <bauerman@...ux.ibm.com>,
Ram Pai <linuxram@...ibm.com>,
Brian King <brking@...ux.vnet.ibm.com>
Cc: linuxppc-dev@...ts.ozlabs.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v4 6/7] powerpc/pseries/iommu: Make use of DDW even if
it does not map the partition
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,
Powered by blists - more mailing lists