All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alexey Kardashevskiy <aik@ozlabs.ru>
To: Gavin Shan <gwshan@linux.vnet.ibm.com>
Cc: linuxppc-dev@lists.ozlabs.org,
	Benjamin Herrenschmidt <benh@kernel.crashing.org>,
	Michael Ellerman <mpe@ellerman.id.au>,
	Wei Yang <weiyang@linux.vnet.ibm.com>
Subject: Re: [PATCH kernel] powerpc/iommu: Set default DMA offset in dma_dev_setup
Date: Thu, 27 Aug 2015 17:41:31 +1000	[thread overview]
Message-ID: <55DEBF2B.3030306@ozlabs.ru> (raw)
In-Reply-To: <20150827061635.GA9648@gwshan>

On 08/27/2015 04:16 PM, Gavin Shan wrote:
> On Thu, Aug 27, 2015 at 04:01:16PM +1000, Alexey Kardashevskiy wrote:
>> "powerpc/iommu: Cleanup setting of DMA base/offset" expects that
>> the default DMA offset is set from pnv_ioda_setup_bus_dma() which
>> is correct unless it is SRIOV where the code flow is different - at
>> the moment when pnv_ioda_setup_bus_dma() is called, there is no PE for
>> the just created VF.
>>
>
> The PEs for VFs are ready at the moment. We don't have pci_dev for
> VFs actually.


Ah, you are right. Should have been:

====
"powerpc/iommu: Cleanup setting of DMA base/offset" expects that
the default DMA offset is set from pnv_ioda_setup_bus_dma() which
is correct unless it is SRIOV where the code flow is different - at
the moment when pnv_ioda_setup_bus_dma() is called, PCI devices
for VFs are not created yet.
====


>> This adds missing set_dma_offset() to pnv_pci_ioda_dma_dev_setup()
>> to cover the case of SRIOV.
>>
>> Note that we still need set_dma_offset() in pnv_ioda_setup_bus_dma()
>> as at the boot time pnv_pci_ioda_dma_dev_setup() is called when no PE
>> was created yet, this happens at the PHB fixup stage.
>>
>> Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
>
> Reviewed-by: Gavin Shan <gwshan@linux.vnet.ibm.com>
>
> Thanks,
> Gavin
>
>> ---
>>
>> Makes sense to squash it to "powerpc/iommu: Cleanup setting of DMA base/offset".
>>
>>
>> ---
>> arch/powerpc/platforms/powernv/pci-ioda.c | 1 +
>> 1 file changed, 1 insertion(+)
>>
>> diff --git a/arch/powerpc/platforms/powernv/pci-ioda.c b/arch/powerpc/platforms/powernv/pci-ioda.c
>> index 2c286b57..af875c1 100644
>> --- a/arch/powerpc/platforms/powernv/pci-ioda.c
>> +++ b/arch/powerpc/platforms/powernv/pci-ioda.c
>> @@ -1590,6 +1590,7 @@ static void pnv_pci_ioda_dma_dev_setup(struct pnv_phb *phb, struct pci_dev *pdev
>>
>> 	pe = &phb->ioda.pe_array[pdn->pe_number];
>> 	WARN_ON(get_dma_ops(&pdev->dev) != &dma_iommu_ops);
>> +	set_dma_offset(&pdev->dev, pe->tce_bypass_base);
>> 	set_iommu_table_base(&pdev->dev, pe->table_group.tables[0]);
>> 	/*
>> 	 * Note: iommu_add_device() will fail here as
>> --
>> 2.4.0.rc3.8.gfb3e7d5
>>
>


-- 
Alexey

  reply	other threads:[~2015-08-27  7:41 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-08-27  6:01 [PATCH kernel] powerpc/iommu: Set default DMA offset in dma_dev_setup Alexey Kardashevskiy
2015-08-27  6:16 ` Gavin Shan
2015-08-27  7:41   ` Alexey Kardashevskiy [this message]
2015-08-27  9:37 ` [kernel] " Michael Ellerman
2015-08-27 13:07   ` Alexey Kardashevskiy
2015-08-28  3:23     ` Michael Ellerman
2015-08-27 21:58 ` Michael Ellerman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=55DEBF2B.3030306@ozlabs.ru \
    --to=aik@ozlabs.ru \
    --cc=benh@kernel.crashing.org \
    --cc=gwshan@linux.vnet.ibm.com \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=mpe@ellerman.id.au \
    --cc=weiyang@linux.vnet.ibm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.