Re: [Freedreno] [PATCH] of_device: removed #include that caused a recursion in included headers
> -Original Message- > From: Rob Herring > Sent: Monday, 20 April 2020 23:37 > > On Mon, Apr 13, 2020 at 04:35:53PM +0300, Hadar Gat wrote: > > Both of_platform.h and of_device.h were included each other. > > In of_device.h, removed unneeded #include to of_platform.h and added > > include to of_platform.h in the files that needs it. > > Guess we forgot about that temporary comment! > > Both of these headers have a lot of things we don't want 'normal' > drivers calling. The most common thing needed from of_device.h is > of_match_device/of_device_get_match_data. A good number are only for > ibmebus. Maybe the header should be split or the former just moved to of.h. > > For of_platform.h, it seems we have a bunch of unneeded includes: > > $ git grep 'of_platform\.h' drivers/ | wc > 5601120 36049 > $ git grep -E 'of_(platform_(pop|def)|find_device)' drivers/ | wc > 2481215 20630 > > Would nice to drop those (or switch to of_device.h?) too. > > Be sure to build on Sparc. It's the oddball. Hi Rob and thanks for your inputs. Unfortunately I cannot continue to work on this patch at the moment since it is not as small as I expected and I have limited resources for that. So anyone can take it and continue from here. Thanks, Hadar > > Signed-off-by: Hadar Gat > > --- > > drivers/base/platform.c | 1 + > > drivers/bus/vexpress-config.c | 1 + > > drivers/dma/at_hdmac.c| 1 + > > drivers/dma/stm32-dmamux.c| 1 + > > drivers/dma/ti/dma-crossbar.c | 1 + > > drivers/gpu/drm/msm/adreno/a6xx_gmu.c | 1 + > > drivers/gpu/drm/msm/hdmi/hdmi.c | 1 + > > drivers/gpu/drm/msm/msm_drv.c | 1 + > > drivers/gpu/drm/rockchip/dw-mipi-dsi-rockchip.c | 1 + > > drivers/gpu/drm/sun4i/sun4i_tcon.c| 1 + > > drivers/iio/adc/stm32-adc-core.c | 1 + > > drivers/iio/adc/stm32-dfsdm-adc.c | 1 + > > drivers/iio/adc/stm32-dfsdm-core.c| 1 + > > drivers/iommu/tegra-smmu.c| 1 + > > drivers/memory/atmel-ebi.c| 1 + > > drivers/mfd/palmas.c | 1 + > > drivers/mfd/ssbi.c| 1 + > > drivers/mtd/nand/raw/omap2.c | 1 + > > drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c | 1 + > > drivers/net/ethernet/ti/cpsw.c| 1 + > > drivers/phy/tegra/xusb.c | 1 + > > drivers/pinctrl/nomadik/pinctrl-nomadik.c | 1 + > > drivers/soc/samsung/exynos-pmu.c | 1 + > > drivers/soc/sunxi/sunxi_sram.c| 1 + > > include/linux/of_device.h | 2 -- > > lib/genalloc.c| 1 + > > 26 files changed, 25 insertions(+), 2 deletions(-) ___ Freedreno mailing list Freedreno@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/freedreno
Re: [Freedreno] [PATCH] of_device: removed #include that caused a recursion in included headers
On Mon, Apr 13, 2020 at 04:35:53PM +0300, Hadar Gat wrote: > Both of_platform.h and of_device.h were included each other. > In of_device.h, removed unneeded #include to of_platform.h > and added include to of_platform.h in the files that needs it. Guess we forgot about that temporary comment! Both of these headers have a lot of things we don't want 'normal' drivers calling. The most common thing needed from of_device.h is of_match_device/of_device_get_match_data. A good number are only for ibmebus. Maybe the header should be split or the former just moved to of.h. For of_platform.h, it seems we have a bunch of unneeded includes: $ git grep 'of_platform\.h' drivers/ | wc 5601120 36049 $ git grep -E 'of_(platform_(pop|def)|find_device)' drivers/ | wc 2481215 20630 Would nice to drop those (or switch to of_device.h?) too. Be sure to build on Sparc. It's the oddball. > > Signed-off-by: Hadar Gat > --- > drivers/base/platform.c | 1 + > drivers/bus/vexpress-config.c | 1 + > drivers/dma/at_hdmac.c| 1 + > drivers/dma/stm32-dmamux.c| 1 + > drivers/dma/ti/dma-crossbar.c | 1 + > drivers/gpu/drm/msm/adreno/a6xx_gmu.c | 1 + > drivers/gpu/drm/msm/hdmi/hdmi.c | 1 + > drivers/gpu/drm/msm/msm_drv.c | 1 + > drivers/gpu/drm/rockchip/dw-mipi-dsi-rockchip.c | 1 + > drivers/gpu/drm/sun4i/sun4i_tcon.c| 1 + > drivers/iio/adc/stm32-adc-core.c | 1 + > drivers/iio/adc/stm32-dfsdm-adc.c | 1 + > drivers/iio/adc/stm32-dfsdm-core.c| 1 + > drivers/iommu/tegra-smmu.c| 1 + > drivers/memory/atmel-ebi.c| 1 + > drivers/mfd/palmas.c | 1 + > drivers/mfd/ssbi.c| 1 + > drivers/mtd/nand/raw/omap2.c | 1 + > drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c | 1 + > drivers/net/ethernet/ti/cpsw.c| 1 + > drivers/phy/tegra/xusb.c | 1 + > drivers/pinctrl/nomadik/pinctrl-nomadik.c | 1 + > drivers/soc/samsung/exynos-pmu.c | 1 + > drivers/soc/sunxi/sunxi_sram.c| 1 + > include/linux/of_device.h | 2 -- > lib/genalloc.c| 1 + > 26 files changed, 25 insertions(+), 2 deletions(-) ___ Freedreno mailing list Freedreno@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/freedreno
Re: [Freedreno] [PATCH] of_device: removed #include that caused a recursion in included headers
Hi Hadar, Thank you for the patch! Yet something to improve: [auto build test ERROR on stm32/stm32-next] [also build test ERROR on sunxi/sunxi/for-next tegra/for-next linus/master v5.7-rc1 next-20200413] [if your patch is applied to the wrong git tree, please drop us a note to help improve the system. BTW, we also suggest to use '--base' option to specify the base tree in git format-patch, please see https://stackoverflow.com/a/37406982] url: https://github.com/0day-ci/linux/commits/Hadar-Gat/of_device-removed-include-that-caused-a-recursion-in-included-headers/20200414-032638 base: https://git.kernel.org/pub/scm/linux/kernel/git/atorgue/stm32.git stm32-next config: arm-multi_v5_defconfig (attached as .config) compiler: arm-linux-gnueabi-gcc (GCC) 9.3.0 reproduce: wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross # save the attached .config to linux build tree GCC_VERSION=9.3.0 make.cross ARCH=arm If you fix the issue, kindly add following tag as appropriate Reported-by: kbuild test robot All errors (new ones prefixed by >>): drivers/bus/imx-weim.c: In function 'weim_parse_dt': >> drivers/bus/imx-weim.c:227:9: error: implicit declaration of function >> 'of_platform_default_populate' [-Werror=implicit-function-declaration] 227 | ret = of_platform_default_populate(pdev->dev.of_node, | ^~~~ cc1: some warnings being treated as errors -- drivers/pinctrl/freescale/pinctrl-imx1-core.c: In function 'imx1_pinctrl_core_probe': >> drivers/pinctrl/freescale/pinctrl-imx1-core.c:639:8: error: implicit >> declaration of function 'of_platform_populate' >> [-Werror=implicit-function-declaration] 639 | ret = of_platform_populate(pdev->dev.of_node, NULL, NULL, >dev); |^~~~ cc1: some warnings being treated as errors vim +/of_platform_default_populate +227 drivers/bus/imx-weim.c 85bf6d4e4b100e Huang Shijie 2013-05-28 189 4a92f07816ba30 Sascha Hauer 2019-08-14 190 static int weim_parse_dt(struct platform_device *pdev, void __iomem *base) 85bf6d4e4b100e Huang Shijie 2013-05-28 191 { 3f98b6baad63b1 Alexander Shiyan 2013-06-29 192const struct of_device_id *of_id = of_match_device(weim_id_table, 3f98b6baad63b1 Alexander Shiyan 2013-06-29 193 >dev); 3f98b6baad63b1 Alexander Shiyan 2013-06-29 194const struct imx_weim_devtype *devtype = of_id->data; 85bf6d4e4b100e Huang Shijie 2013-05-28 195struct device_node *child; 52c47b63412b09 Alison Chaiken2015-02-18 196int ret, have_child = 0; c7995bcb36ef61 Sven Van Asbroeck 2018-12-17 197struct cs_timing_state ts = {}; 77266e722feabb Sven Van Asbroeck 2019-07-12 198u32 reg; 85bf6d4e4b100e Huang Shijie 2013-05-28 199 8d9ee21e98205e Shawn Guo 2014-02-11 200if (devtype == _weim_devtype) { 8d9ee21e98205e Shawn Guo 2014-02-11 201ret = imx_weim_gpr_setup(pdev); 8d9ee21e98205e Shawn Guo 2014-02-11 202if (ret) 8d9ee21e98205e Shawn Guo 2014-02-11 203return ret; 8d9ee21e98205e Shawn Guo 2014-02-11 204} 8d9ee21e98205e Shawn Guo 2014-02-11 205 77266e722feabb Sven Van Asbroeck 2019-07-12 206if (of_property_read_bool(pdev->dev.of_node, "fsl,burst-clk-enable")) { 77266e722feabb Sven Van Asbroeck 2019-07-12 207if (devtype->wcr_bcm) { 77266e722feabb Sven Van Asbroeck 2019-07-12 208reg = readl(base + devtype->wcr_offset); 77266e722feabb Sven Van Asbroeck 2019-07-12 209 writel(reg | devtype->wcr_bcm, 77266e722feabb Sven Van Asbroeck 2019-07-12 210 base + devtype->wcr_offset); 77266e722feabb Sven Van Asbroeck 2019-07-12 211} else { 77266e722feabb Sven Van Asbroeck 2019-07-12 212 dev_err(>dev, "burst clk mode not supported.\n"); 77266e722feabb Sven Van Asbroeck 2019-07-12 213return -EINVAL; 77266e722feabb Sven Van Asbroeck 2019-07-12 214} 77266e722feabb Sven Van Asbroeck 2019-07-12 215} 77266e722feabb Sven Van Asbroeck 2019-07-12 216 33b96d2c957921 Fabio Estevam 2016-02-22 217 for_each_available_child_of_node(pdev->dev.of_node, child) { c7995bcb36ef61 Sven Van Asbroeck 2018-12-17 218ret = weim_timing_setup(>dev, child, base, devtype, ); 52c47b63412b09 Alison Chaiken2015-02-18 219if (ret) 9c0982d809fd81 Rob Herring 2017-07-18 220 dev_warn(>dev, "%pOF set timing failed.\n", 9c0982d809fd81 Rob Herring 2017-07-18 221 child); 52c47b63412b09 Alison Chaiken2015-02-18 222
Re: [Freedreno] [PATCH] of_device: removed #include that caused a recursion in included headers
Hi Hadar, Thank you for the patch! Yet something to improve: [auto build test ERROR on stm32/stm32-next] [also build test ERROR on linus/master v5.7-rc1 next-20200413] [if your patch is applied to the wrong git tree, please drop us a note to help improve the system. BTW, we also suggest to use '--base' option to specify the base tree in git format-patch, please see https://stackoverflow.com/a/37406982] url: https://github.com/0day-ci/linux/commits/Hadar-Gat/of_device-removed-include-that-caused-a-recursion-in-included-headers/20200414-032638 base: https://git.kernel.org/pub/scm/linux/kernel/git/atorgue/stm32.git stm32-next config: sparc-randconfig-a001-20200413 (attached as .config) compiler: sparc-linux-gcc (GCC) 9.3.0 reproduce: wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross # save the attached .config to linux build tree GCC_VERSION=9.3.0 make.cross ARCH=sparc If you fix the issue, kindly add following tag as appropriate Reported-by: kbuild test robot All errors (new ones prefixed by >>): arch/sparc/mm/iommu.c: In function 'iommu_init': >> arch/sparc/mm/iommu.c:139:32: error: implicit declaration of function >> 'of_find_device_by_node'; did you mean 'bus_find_device_by_fwnode'? >> [-Werror=implicit-function-declaration] 139 | struct platform_device *op = of_find_device_by_node(dp); |^~ |bus_find_device_by_fwnode >> arch/sparc/mm/iommu.c:139:32: error: initialization of 'struct >> platform_device *' from 'int' makes pointer from integer without a cast >> [-Werror=int-conversion] cc1: all warnings being treated as errors -- arch/sparc/mm/io-unit.c: In function 'iounit_init': >> arch/sparc/mm/io-unit.c:81:32: error: implicit declaration of function >> 'of_find_device_by_node'; did you mean 'bus_find_device_by_fwnode'? >> [-Werror=implicit-function-declaration] 81 | struct platform_device *op = of_find_device_by_node(dp); |^~ |bus_find_device_by_fwnode >> arch/sparc/mm/io-unit.c:81:32: error: initialization of 'struct >> platform_device *' from 'int' makes pointer from integer without a cast >> [-Werror=int-conversion] cc1: all warnings being treated as errors vim +139 arch/sparc/mm/iommu.c ^1da177e4c3f41 Linus Torvalds 2005-04-16 133 046e26a8ba10b8 David S. Miller 2008-08-27 134 static int __init iommu_init(void) 046e26a8ba10b8 David S. Miller 2008-08-27 135 { 046e26a8ba10b8 David S. Miller 2008-08-27 136 struct device_node *dp; 046e26a8ba10b8 David S. Miller 2008-08-27 137 046e26a8ba10b8 David S. Miller 2008-08-27 138 for_each_node_by_name(dp, "iommu") { cd4cd7306a403f Grant Likely2010-07-22 @139 struct platform_device *op = of_find_device_by_node(dp); 046e26a8ba10b8 David S. Miller 2008-08-27 140 046e26a8ba10b8 David S. Miller 2008-08-27 141 sbus_iommu_init(op); 046e26a8ba10b8 David S. Miller 2008-08-27 142 of_propagate_archdata(op); 046e26a8ba10b8 David S. Miller 2008-08-27 143 } 046e26a8ba10b8 David S. Miller 2008-08-27 144 046e26a8ba10b8 David S. Miller 2008-08-27 145 return 0; 046e26a8ba10b8 David S. Miller 2008-08-27 146 } 046e26a8ba10b8 David S. Miller 2008-08-27 147 :: The code at line 139 was first introduced by commit :: cd4cd7306a403f62ef3ca783b9d1cf2a03e595ed sparc: remove references to of_device and to_of_device :: TO: Grant Likely :: CC: Grant Likely --- 0-DAY CI Kernel Test Service, Intel Corporation https://lists.01.org/hyperkitty/list/kbuild-...@lists.01.org .config.gz Description: application/gzip ___ Freedreno mailing list Freedreno@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/freedreno