public inbox for linux-next@vger.kernel.org 
 help / color / mirror / Atom feed
* Re: [PATCH V10] powerpc/fsl-pci: Unify pci/pcie initialization code
       [not found] <1346139848-28021-1-git-send-email-B38951@freescale.com>
@ 2012-09-18  9:56 ` Michael Neuling
  2012-09-18 10:34   ` Jia Hongtao-B38951
  0 siblings, 1 reply; 2+ messages in thread
From: Michael Neuling @ 2012-09-18  9:56 UTC (permalink / raw)
  To: Jia Hongtao; +Cc: linuxppc-dev, galak, B07421, benh, linux-next

> +static int __devinit fsl_pci_probe(struct platform_device *pdev)
> +{
> +	int ret;
> +	struct device_node *node;
> +	struct pci_controller *hose;
> +
> +	node = pdev->dev.of_node;
> +	ret = fsl_add_bridge(node, fsl_pci_primary == node);
>  
>  #ifdef CONFIG_SWIOTLB
> -	/*
> -	 * if we couldn't map all of DRAM via the dma windows
> -	 * we need SWIOTLB to handle buffers located outside of
> -	 * dma capable memory region
> -	 */
> -	if (memblock_end_of_DRAM() - 1 > max)
> -		ppc_swiotlb_enable = 1;
> +	if (ret == 0) {
> +		hose = pci_find_hose_for_OF_device(pdev->dev.of_node);
> +
> +		/*
> +		 * if we couldn't map all of DRAM via the dma windows
> +		 * we need SWIOTLB to handle buffers located outside of
> +		 * dma capable memory region
> +		 */
> +		if (memblock_end_of_DRAM() - 1 > hose->dma_window_base_cur +
> +				hose->dma_window_size)
> +			ppc_swiotlb_enable = 1;
> +	}
>  #endif
> +
> +	mpc85xx_pci_err_probe(pdev);
> +
> +	return 0;
> +}

This breaks when CONFIG_SWIOTLB is disabled (chroma_defconfig hit this
next-20120918), but think this could also hit in Linus tree:

  arch/powerpc/sysdev/fsl_pci.c: In function 'fsl_pci_probe':
  arch/powerpc/sysdev/fsl_pci.c:867:25: error: unused variable 'hose' [-Werror=unused-variable]
  cc1: all warnings being treated as errors

Mikey

^ permalink raw reply	[flat|nested] 2+ messages in thread

* RE: [PATCH V10] powerpc/fsl-pci: Unify pci/pcie initialization code
  2012-09-18  9:56 ` [PATCH V10] powerpc/fsl-pci: Unify pci/pcie initialization code Michael Neuling
@ 2012-09-18 10:34   ` Jia Hongtao-B38951
  0 siblings, 0 replies; 2+ messages in thread
From: Jia Hongtao-B38951 @ 2012-09-18 10:34 UTC (permalink / raw)
  To: Michael Neuling
  Cc: linuxppc-dev@lists•ozlabs.org, galak@kernel•crashing.org,
	Wood Scott-B07421, benh@kernel•crashing.org,
	linux-next@vger•kernel.org



> -----Original Message-----
> From: Michael Neuling [mailto:mikey@neuling•org]
> Sent: Tuesday, September 18, 2012 5:56 PM
> To: Jia Hongtao-B38951
> Cc: linuxppc-dev@lists•ozlabs.org; galak@kernel•crashing.org; Wood Scott-
> B07421; benh@kernel•crashing.org; linux-next@vger•kernel.org
> Subject: Re: [PATCH V10] powerpc/fsl-pci: Unify pci/pcie initialization
> code
> 
> > +static int __devinit fsl_pci_probe(struct platform_device *pdev) {
> > +	int ret;
> > +	struct device_node *node;
> > +	struct pci_controller *hose;
> > +
> > +	node = pdev->dev.of_node;
> > +	ret = fsl_add_bridge(node, fsl_pci_primary == node);
> >
> >  #ifdef CONFIG_SWIOTLB
> > -	/*
> > -	 * if we couldn't map all of DRAM via the dma windows
> > -	 * we need SWIOTLB to handle buffers located outside of
> > -	 * dma capable memory region
> > -	 */
> > -	if (memblock_end_of_DRAM() - 1 > max)
> > -		ppc_swiotlb_enable = 1;
> > +	if (ret == 0) {
> > +		hose = pci_find_hose_for_OF_device(pdev->dev.of_node);
> > +
> > +		/*
> > +		 * if we couldn't map all of DRAM via the dma windows
> > +		 * we need SWIOTLB to handle buffers located outside of
> > +		 * dma capable memory region
> > +		 */
> > +		if (memblock_end_of_DRAM() - 1 > hose->dma_window_base_cur +
> > +				hose->dma_window_size)
> > +			ppc_swiotlb_enable = 1;
> > +	}
> >  #endif
> > +
> > +	mpc85xx_pci_err_probe(pdev);
> > +
> > +	return 0;
> > +}
> 
> This breaks when CONFIG_SWIOTLB is disabled (chroma_defconfig hit this
> next-20120918), but think this could also hit in Linus tree:
> 
>   arch/powerpc/sysdev/fsl_pci.c: In function 'fsl_pci_probe':
>   arch/powerpc/sysdev/fsl_pci.c:867:25: error: unused variable 'hose' [-
> Werror=unused-variable]
>   cc1: all warnings being treated as errors
> 
> Mikey

You are right, it's a problem.
I already send a patch to fix this.
Pls refer to http://patchwork.ozlabs.org/patch/184673/

Thanks for your response.

- Hongtao.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2012-09-18 10:34 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <1346139848-28021-1-git-send-email-B38951@freescale.com>
2012-09-18  9:56 ` [PATCH V10] powerpc/fsl-pci: Unify pci/pcie initialization code Michael Neuling
2012-09-18 10:34   ` Jia Hongtao-B38951

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox