linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Benjamin Herrenschmidt <benh@au1.ibm.com>
To: Wei Yang <weiyang@linux.vnet.ibm.com>
Cc: aik@au1.ibm.com, linuxppc-dev@lists.ozlabs.org,
	gwshan@linux.vnet.ibm.com
Subject: Re: [PATCH 2/2] powerpc/powernc: revert part of commit d905c5df(PPC: POWERNV: move iommu_add_device earlier)
Date: Mon, 21 Apr 2014 13:37:32 +1000	[thread overview]
Message-ID: <1398051452.19682.15.camel@pasglop> (raw)
In-Reply-To: <1398047119-6861-2-git-send-email-weiyang@linux.vnet.ibm.com>

On Mon, 2014-04-21 at 10:25 +0800, Wei Yang wrote:
> Here is a draft call flow:
> 
> pci_device_add
>    pcibios_add_device
>       pci_dma_dev_setup
>          pnv_pci_dma_dev_setup
>             pnv_pci_ioda_dma_dev_setup
>                set_iommu_table_base_and_group <--- here
> device_add
> 
> When set_iommu_table_base_and_group() is invoked int
> pnv_pci_ioda_dma_dev_setup(), the dev->kobj->sd is not initialized. The
> dev->kobj->sd is initialized in device_add().
> 
> After applying this patch, the error
>     iommu_tce: 0003:05:00.0 has not been added, ret=-14
> is cleared.
> 
> This patch revert the change for pnv_pci_ioda_dma_dev_setup() from commit
> d905c5df(PPC: POWERNV: move iommu_add_device earlier).

But in that case, is the group still set ?

Alexey, is that correct ?

Cheers,
Ben.

> Signed-off-by: Wei Yang <weiyang@linux.vnet.ibm.com>
> ---
>  arch/powerpc/platforms/powernv/pci-ioda.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/arch/powerpc/platforms/powernv/pci-ioda.c b/arch/powerpc/platforms/powernv/pci-ioda.c
> index fc4edda..b5d8f73 100644
> --- a/arch/powerpc/platforms/powernv/pci-ioda.c
> +++ b/arch/powerpc/platforms/powernv/pci-ioda.c
> @@ -1425,7 +1425,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_iommu_table_base_and_group(&pdev->dev, &pe->tce32_table);
> +	set_iommu_table_base(&pdev->dev, &pe->tce32_table);
>  }
>  
>  static int pnv_pci_ioda_dma_set_mask(struct pnv_phb *phb,

  reply	other threads:[~2014-04-21  3:37 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-04-21  2:25 [PATCH 1/2] powerpc/powernv: clear the refcount for pci_dev on powernv platform Wei Yang
2014-04-21  2:25 ` [PATCH 2/2] powerpc/powernc: revert part of commit d905c5df(PPC: POWERNV: move iommu_add_device earlier) Wei Yang
2014-04-21  3:37   ` Benjamin Herrenschmidt [this message]
2014-04-21  5:22     ` Wei Yang
2014-04-21  6:11       ` Wei Yang
2014-04-21  3:35 ` [PATCH 1/2] powerpc/powernv: clear the refcount for pci_dev on powernv platform Benjamin Herrenschmidt
2014-04-21  6:03   ` Wei Yang
2014-04-21 23:34 ` Gavin Shan
2014-04-22  7:44   ` Wei Yang
2014-04-22  8:25     ` Benjamin Herrenschmidt
2014-04-22  9:44       ` Wei Yang
2014-04-22 23:00       ` Gavin Shan
2014-04-23  0:26         ` Benjamin Herrenschmidt
2014-04-23  1:56           ` Wei Yang

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=1398051452.19682.15.camel@pasglop \
    --to=benh@au1.ibm.com \
    --cc=aik@au1.ibm.com \
    --cc=gwshan@linux.vnet.ibm.com \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).