[PATCH V10] powerpc/fsl-pci: Unify pci/pcie initialization code

Michael Neuling mikey at neuling.org
Tue Sep 18 19:56:14 EST 2012


> +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


More information about the Linuxppc-dev mailing list