[PATCH v5 3/3] mmc: sdhci-of-dwcmshc: add rockchip platform support

kernel test robot lkp at intel.com
Tue Mar 16 06:10:31 GMT 2021


Hi Shawn,

I love your patch! Perhaps something to improve:

[auto build test WARNING on robh/for-next]
[also build test WARNING on linus/master v5.12-rc3 next-20210315]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]

url:    https://github.com/0day-ci/linux/commits/Shawn-Lin/dt-bindings-mmc-sdhci-of-dwcmhsc-Convert-to-yaml-file/20210316-100829
base:   https://git.kernel.org/pub/scm/linux/kernel/git/robh/linux.git for-next
config: powerpc-randconfig-r002-20210316 (attached as .config)
compiler: clang version 13.0.0 (https://github.com/llvm/llvm-project 50c7504a93fdb90c26870db8c8ea7add895c7725)
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # install powerpc cross compiling tool for clang build
        # apt-get install binutils-powerpc-linux-gnu
        # https://github.com/0day-ci/linux/commit/4e67269c227f3ccf6904cdc31971bf6534d1bcf3
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review Shawn-Lin/dt-bindings-mmc-sdhci-of-dwcmhsc-Convert-to-yaml-file/20210316-100829
        git checkout 4e67269c227f3ccf6904cdc31971bf6534d1bcf3
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=powerpc 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp at intel.com>

All warnings (new ones prefixed by >>):

   In file included from drivers/mmc/host/sdhci-of-dwcmshc.c:11:
   In file included from include/linux/dma-mapping.h:10:
   In file included from include/linux/scatterlist.h:9:
   In file included from arch/powerpc/include/asm/io.h:619:
   arch/powerpc/include/asm/io-defs.h:43:1: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
   DEF_PCI_AC_NORET(insb, (unsigned long p, void *b, unsigned long c),
   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   arch/powerpc/include/asm/io.h:616:3: note: expanded from macro 'DEF_PCI_AC_NORET'
                   __do_##name al;                                 \
                   ^~~~~~~~~~~~~~
   <scratch space>:10:1: note: expanded from here
   __do_insb
   ^
   arch/powerpc/include/asm/io.h:556:56: note: expanded from macro '__do_insb'
   #define __do_insb(p, b, n)      readsb((PCI_IO_ADDR)_IO_BASE+(p), (b), (n))
                                          ~~~~~~~~~~~~~~~~~~~~~^
   In file included from drivers/mmc/host/sdhci-of-dwcmshc.c:11:
   In file included from include/linux/dma-mapping.h:10:
   In file included from include/linux/scatterlist.h:9:
   In file included from arch/powerpc/include/asm/io.h:619:
   arch/powerpc/include/asm/io-defs.h:45:1: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
   DEF_PCI_AC_NORET(insw, (unsigned long p, void *b, unsigned long c),
   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   arch/powerpc/include/asm/io.h:616:3: note: expanded from macro 'DEF_PCI_AC_NORET'
                   __do_##name al;                                 \
                   ^~~~~~~~~~~~~~
   <scratch space>:12:1: note: expanded from here
   __do_insw
   ^
   arch/powerpc/include/asm/io.h:557:56: note: expanded from macro '__do_insw'
   #define __do_insw(p, b, n)      readsw((PCI_IO_ADDR)_IO_BASE+(p), (b), (n))
                                          ~~~~~~~~~~~~~~~~~~~~~^
   In file included from drivers/mmc/host/sdhci-of-dwcmshc.c:11:
   In file included from include/linux/dma-mapping.h:10:
   In file included from include/linux/scatterlist.h:9:
   In file included from arch/powerpc/include/asm/io.h:619:
   arch/powerpc/include/asm/io-defs.h:47:1: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
   DEF_PCI_AC_NORET(insl, (unsigned long p, void *b, unsigned long c),
   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   arch/powerpc/include/asm/io.h:616:3: note: expanded from macro 'DEF_PCI_AC_NORET'
                   __do_##name al;                                 \
                   ^~~~~~~~~~~~~~
   <scratch space>:14:1: note: expanded from here
   __do_insl
   ^
   arch/powerpc/include/asm/io.h:558:56: note: expanded from macro '__do_insl'
   #define __do_insl(p, b, n)      readsl((PCI_IO_ADDR)_IO_BASE+(p), (b), (n))
                                          ~~~~~~~~~~~~~~~~~~~~~^
   In file included from drivers/mmc/host/sdhci-of-dwcmshc.c:11:
   In file included from include/linux/dma-mapping.h:10:
   In file included from include/linux/scatterlist.h:9:
   In file included from arch/powerpc/include/asm/io.h:619:
   arch/powerpc/include/asm/io-defs.h:49:1: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
   DEF_PCI_AC_NORET(outsb, (unsigned long p, const void *b, unsigned long c),
   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   arch/powerpc/include/asm/io.h:616:3: note: expanded from macro 'DEF_PCI_AC_NORET'
                   __do_##name al;                                 \
                   ^~~~~~~~~~~~~~
   <scratch space>:16:1: note: expanded from here
   __do_outsb
   ^
   arch/powerpc/include/asm/io.h:559:58: note: expanded from macro '__do_outsb'
   #define __do_outsb(p, b, n)     writesb((PCI_IO_ADDR)_IO_BASE+(p),(b),(n))
                                           ~~~~~~~~~~~~~~~~~~~~~^
   In file included from drivers/mmc/host/sdhci-of-dwcmshc.c:11:
   In file included from include/linux/dma-mapping.h:10:
   In file included from include/linux/scatterlist.h:9:
   In file included from arch/powerpc/include/asm/io.h:619:
   arch/powerpc/include/asm/io-defs.h:51:1: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
   DEF_PCI_AC_NORET(outsw, (unsigned long p, const void *b, unsigned long c),
   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   arch/powerpc/include/asm/io.h:616:3: note: expanded from macro 'DEF_PCI_AC_NORET'
                   __do_##name al;                                 \
                   ^~~~~~~~~~~~~~
   <scratch space>:18:1: note: expanded from here
   __do_outsw
   ^
   arch/powerpc/include/asm/io.h:560:58: note: expanded from macro '__do_outsw'
   #define __do_outsw(p, b, n)     writesw((PCI_IO_ADDR)_IO_BASE+(p),(b),(n))
                                           ~~~~~~~~~~~~~~~~~~~~~^
   In file included from drivers/mmc/host/sdhci-of-dwcmshc.c:11:
   In file included from include/linux/dma-mapping.h:10:
   In file included from include/linux/scatterlist.h:9:
   In file included from arch/powerpc/include/asm/io.h:619:
   arch/powerpc/include/asm/io-defs.h:53:1: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
   DEF_PCI_AC_NORET(outsl, (unsigned long p, const void *b, unsigned long c),
   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   arch/powerpc/include/asm/io.h:616:3: note: expanded from macro 'DEF_PCI_AC_NORET'
                   __do_##name al;                                 \
                   ^~~~~~~~~~~~~~
   <scratch space>:20:1: note: expanded from here
   __do_outsl
   ^
   arch/powerpc/include/asm/io.h:561:58: note: expanded from macro '__do_outsl'
   #define __do_outsl(p, b, n)     writesl((PCI_IO_ADDR)_IO_BASE+(p),(b),(n))
                                           ~~~~~~~~~~~~~~~~~~~~~^
>> drivers/mmc/host/sdhci-of-dwcmshc.c:371:6: warning: variable 'rk_priv' is used uninitialized whenever 'if' condition is true [-Wsometimes-uninitialized]
           if (err)
               ^~~
   drivers/mmc/host/sdhci-of-dwcmshc.c:403:6: note: uninitialized use occurs here
           if (rk_priv)
               ^~~~~~~
   drivers/mmc/host/sdhci-of-dwcmshc.c:371:2: note: remove the 'if' if its condition is always false
           if (err)
           ^~~~~~~~
   drivers/mmc/host/sdhci-of-dwcmshc.c:329:29: note: initialize the variable 'rk_priv' to silence this warning
           struct rk3568_priv *rk_priv;
                                      ^
                                       = NULL
   7 warnings generated.


vim +371 drivers/mmc/host/sdhci-of-dwcmshc.c

4e67269c227f3c Shawn Lin     2021-03-16  323  
e438cf49b3053e Jisheng Zhang 2018-07-06  324  static int dwcmshc_probe(struct platform_device *pdev)
e438cf49b3053e Jisheng Zhang 2018-07-06  325  {
e438cf49b3053e Jisheng Zhang 2018-07-06  326  	struct sdhci_pltfm_host *pltfm_host;
e438cf49b3053e Jisheng Zhang 2018-07-06  327  	struct sdhci_host *host;
e438cf49b3053e Jisheng Zhang 2018-07-06  328  	struct dwcmshc_priv *priv;
4e67269c227f3c Shawn Lin     2021-03-16  329  	struct rk3568_priv *rk_priv;
4e67269c227f3c Shawn Lin     2021-03-16  330  	const struct sdhci_pltfm_data *pltfm_data;
e438cf49b3053e Jisheng Zhang 2018-07-06  331  	int err;
b85c997d2cfefe Jisheng Zhang 2018-08-28  332  	u32 extra;
e438cf49b3053e Jisheng Zhang 2018-07-06  333  
4e67269c227f3c Shawn Lin     2021-03-16  334  	pltfm_data = of_device_get_match_data(&pdev->dev);
4e67269c227f3c Shawn Lin     2021-03-16  335  	if (!pltfm_data) {
4e67269c227f3c Shawn Lin     2021-03-16  336  		dev_err(&pdev->dev, "Error: No device match data found\n");
4e67269c227f3c Shawn Lin     2021-03-16  337  		return -ENODEV;
4e67269c227f3c Shawn Lin     2021-03-16  338  	}
4e67269c227f3c Shawn Lin     2021-03-16  339  
4e67269c227f3c Shawn Lin     2021-03-16  340  	host = sdhci_pltfm_init(pdev, pltfm_data,
e438cf49b3053e Jisheng Zhang 2018-07-06  341  				sizeof(struct dwcmshc_priv));
e438cf49b3053e Jisheng Zhang 2018-07-06  342  	if (IS_ERR(host))
e438cf49b3053e Jisheng Zhang 2018-07-06  343  		return PTR_ERR(host);
e438cf49b3053e Jisheng Zhang 2018-07-06  344  
b85c997d2cfefe Jisheng Zhang 2018-08-28  345  	/*
b85c997d2cfefe Jisheng Zhang 2018-08-28  346  	 * extra adma table cnt for cross 128M boundary handling.
b85c997d2cfefe Jisheng Zhang 2018-08-28  347  	 */
b85c997d2cfefe Jisheng Zhang 2018-08-28  348  	extra = DIV_ROUND_UP_ULL(dma_get_required_mask(&pdev->dev), SZ_128M);
b85c997d2cfefe Jisheng Zhang 2018-08-28  349  	if (extra > SDHCI_MAX_SEGS)
b85c997d2cfefe Jisheng Zhang 2018-08-28  350  		extra = SDHCI_MAX_SEGS;
b85c997d2cfefe Jisheng Zhang 2018-08-28  351  	host->adma_table_cnt += extra;
b85c997d2cfefe Jisheng Zhang 2018-08-28  352  
e438cf49b3053e Jisheng Zhang 2018-07-06  353  	pltfm_host = sdhci_priv(host);
e438cf49b3053e Jisheng Zhang 2018-07-06  354  	priv = sdhci_pltfm_priv(pltfm_host);
e438cf49b3053e Jisheng Zhang 2018-07-06  355  
e438cf49b3053e Jisheng Zhang 2018-07-06  356  	pltfm_host->clk = devm_clk_get(&pdev->dev, "core");
e438cf49b3053e Jisheng Zhang 2018-07-06  357  	if (IS_ERR(pltfm_host->clk)) {
e438cf49b3053e Jisheng Zhang 2018-07-06  358  		err = PTR_ERR(pltfm_host->clk);
e438cf49b3053e Jisheng Zhang 2018-07-06  359  		dev_err(&pdev->dev, "failed to get core clk: %d\n", err);
e438cf49b3053e Jisheng Zhang 2018-07-06  360  		goto free_pltfm;
e438cf49b3053e Jisheng Zhang 2018-07-06  361  	}
e438cf49b3053e Jisheng Zhang 2018-07-06  362  	err = clk_prepare_enable(pltfm_host->clk);
e438cf49b3053e Jisheng Zhang 2018-07-06  363  	if (err)
e438cf49b3053e Jisheng Zhang 2018-07-06  364  		goto free_pltfm;
e438cf49b3053e Jisheng Zhang 2018-07-06  365  
e438cf49b3053e Jisheng Zhang 2018-07-06  366  	priv->bus_clk = devm_clk_get(&pdev->dev, "bus");
e438cf49b3053e Jisheng Zhang 2018-07-06  367  	if (!IS_ERR(priv->bus_clk))
e438cf49b3053e Jisheng Zhang 2018-07-06  368  		clk_prepare_enable(priv->bus_clk);
e438cf49b3053e Jisheng Zhang 2018-07-06  369  
e438cf49b3053e Jisheng Zhang 2018-07-06  370  	err = mmc_of_parse(host->mmc);
e438cf49b3053e Jisheng Zhang 2018-07-06 @371  	if (err)
e438cf49b3053e Jisheng Zhang 2018-07-06  372  		goto err_clk;
e438cf49b3053e Jisheng Zhang 2018-07-06  373  
e438cf49b3053e Jisheng Zhang 2018-07-06  374  	sdhci_get_of_property(pdev);
e438cf49b3053e Jisheng Zhang 2018-07-06  375  
4e67269c227f3c Shawn Lin     2021-03-16  376  	priv->vendor_specific_area1 =
4e67269c227f3c Shawn Lin     2021-03-16  377  		sdhci_readl(host, DWCMSHC_P_VENDOR_AREA1) & DWCMSHC_AREA1_MASK;
4e67269c227f3c Shawn Lin     2021-03-16  378  
ca1219c0a74322 Jisheng Zhang 2020-12-29  379  	host->mmc_host_ops.request = dwcmshc_request;
4e67269c227f3c Shawn Lin     2021-03-16  380  	host->mmc_host_ops.hs400_enhanced_strobe = dwcmshc_hs400_enhanced_strobe;
4e67269c227f3c Shawn Lin     2021-03-16  381  
4e67269c227f3c Shawn Lin     2021-03-16  382  	if (pltfm_data == &sdhci_dwcmshc_rk3568_pdata) {
4e67269c227f3c Shawn Lin     2021-03-16  383  		rk_priv = devm_kzalloc(&pdev->dev, sizeof(struct rk3568_priv), GFP_KERNEL);
4e67269c227f3c Shawn Lin     2021-03-16  384  		if (!rk_priv)
4e67269c227f3c Shawn Lin     2021-03-16  385  			goto err_clk;
4e67269c227f3c Shawn Lin     2021-03-16  386  
4e67269c227f3c Shawn Lin     2021-03-16  387  		priv->priv = rk_priv;
4e67269c227f3c Shawn Lin     2021-03-16  388  
4e67269c227f3c Shawn Lin     2021-03-16  389  		err = dwcmshc_rk3568_init(host, rk_priv);
4e67269c227f3c Shawn Lin     2021-03-16  390  		if (err)
4e67269c227f3c Shawn Lin     2021-03-16  391  			goto err_clk;
4e67269c227f3c Shawn Lin     2021-03-16  392  	}
ca1219c0a74322 Jisheng Zhang 2020-12-29  393  
e438cf49b3053e Jisheng Zhang 2018-07-06  394  	err = sdhci_add_host(host);
e438cf49b3053e Jisheng Zhang 2018-07-06  395  	if (err)
e438cf49b3053e Jisheng Zhang 2018-07-06  396  		goto err_clk;
e438cf49b3053e Jisheng Zhang 2018-07-06  397  
e438cf49b3053e Jisheng Zhang 2018-07-06  398  	return 0;
e438cf49b3053e Jisheng Zhang 2018-07-06  399  
e438cf49b3053e Jisheng Zhang 2018-07-06  400  err_clk:
e438cf49b3053e Jisheng Zhang 2018-07-06  401  	clk_disable_unprepare(pltfm_host->clk);
e438cf49b3053e Jisheng Zhang 2018-07-06  402  	clk_disable_unprepare(priv->bus_clk);
4e67269c227f3c Shawn Lin     2021-03-16  403  	if (rk_priv)
4e67269c227f3c Shawn Lin     2021-03-16  404  		clk_bulk_disable_unprepare(RK3568_MAX_CLKS,
4e67269c227f3c Shawn Lin     2021-03-16  405  					   rk_priv->rockchip_clks);
e438cf49b3053e Jisheng Zhang 2018-07-06  406  free_pltfm:
e438cf49b3053e Jisheng Zhang 2018-07-06  407  	sdhci_pltfm_free(pdev);
e438cf49b3053e Jisheng Zhang 2018-07-06  408  	return err;
e438cf49b3053e Jisheng Zhang 2018-07-06  409  }
e438cf49b3053e Jisheng Zhang 2018-07-06  410  

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
-------------- next part --------------
A non-text attachment was scrubbed...
Name: .config.gz
Type: application/gzip
Size: 41131 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-rockchip/attachments/20210316/6a1a2764/attachment-0001.gz>


More information about the Linux-rockchip mailing list