tree:
https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc.git
char-misc-testing
head: 74e71964b1a9ffd34fa4b6ec8f2fa13e7cf0ac7a
commit: 74abd1f2d49a2a9660eadd9486da333554c4a23b [100/117] bus: fsl-mc: make sure MC
firmware is up and running
config: arm64-randconfig-s032-20201209 (attached as .config)
compiler: aarch64-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
# apt-get install sparse
# sparse version: v0.6.3-179-ga00755aa-dirty
#
https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc.git/comm...
git remote add char-misc
https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc.git
git fetch --no-tags char-misc char-misc-testing
git checkout 74abd1f2d49a2a9660eadd9486da333554c4a23b
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross C=1
CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' ARCH=arm64
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
"sparse warnings: (new ones prefixed by >>)"
drivers/bus/fsl-mc/fsl-mc-bus.c:974:33: sparse: sparse: incorrect type in assignment
(different address spaces) @@ expected void *fsl_mc_regs @@ got void [noderef]
__iomem * @@
drivers/bus/fsl-mc/fsl-mc-bus.c:974:33: sparse: expected void *fsl_mc_regs
drivers/bus/fsl-mc/fsl-mc-bus.c:974:33: sparse: got void [noderef] __iomem *
drivers/bus/fsl-mc/fsl-mc-bus.c:988:17: sparse: sparse: incorrect type in argument 1
(different address spaces) @@ expected void const volatile [noderef] __iomem *addr @@
got void * @@
drivers/bus/fsl-mc/fsl-mc-bus.c:988:17: sparse: expected void const volatile
[noderef] __iomem *addr
drivers/bus/fsl-mc/fsl-mc-bus.c:988:17: sparse: got void *
> drivers/bus/fsl-mc/fsl-mc-bus.c:988:17: sparse: sparse: incorrect
type in argument 2 (different address spaces) @@ expected void volatile [noderef]
__iomem *addr @@ got void * @@
drivers/bus/fsl-mc/fsl-mc-bus.c:988:17:
sparse: expected void volatile [noderef] __iomem *addr
drivers/bus/fsl-mc/fsl-mc-bus.c:988:17: sparse: got void *
drivers/bus/fsl-mc/fsl-mc-bus.c:992:40: sparse: sparse: incorrect type in argument 1
(different address spaces) @@ expected void const volatile [noderef] __iomem *addr @@
got void * @@
drivers/bus/fsl-mc/fsl-mc-bus.c:992:40: sparse: expected void const volatile
[noderef] __iomem *addr
drivers/bus/fsl-mc/fsl-mc-bus.c:992:40: sparse: got void *
vim +988 drivers/bus/fsl-mc/fsl-mc-bus.c
949
950 /**
951 * fsl_mc_bus_probe - callback invoked when the root MC bus is being
952 * added
953 */
954 static int fsl_mc_bus_probe(struct platform_device *pdev)
955 {
956 struct fsl_mc_obj_desc obj_desc;
957 int error;
958 struct fsl_mc *mc;
959 struct fsl_mc_device *mc_bus_dev = NULL;
960 struct fsl_mc_io *mc_io = NULL;
961 int container_id;
962 phys_addr_t mc_portal_phys_addr;
963 u32 mc_portal_size, mc_stream_id;
964 struct resource *plat_res;
965
966 mc = devm_kzalloc(&pdev->dev, sizeof(*mc), GFP_KERNEL);
967 if (!mc)
968 return -ENOMEM;
969
970 platform_set_drvdata(pdev, mc);
971
972 plat_res = platform_get_resource(pdev, IORESOURCE_MEM, 1);
973 if (plat_res) {
974 mc->fsl_mc_regs = devm_ioremap_resource(&pdev->dev,
plat_res);
975 if (IS_ERR(mc->fsl_mc_regs))
976 return PTR_ERR(mc->fsl_mc_regs);
977 }
978
979 if (mc->fsl_mc_regs) {
980 /*
981 * Some bootloaders pause the MC firmware before booting the
982 * kernel so that MC will not cause faults as soon as the
983 * SMMU probes due to the fact that there's no configuration
984 * in place for MC.
985 * At this point MC should have all its SMMU setup done so make
986 * sure it is resumed.
987 */
988 writel(readl(mc->fsl_mc_regs + FSL_MC_GCR1) &
(~GCR1_P1_STOP),
989 mc->fsl_mc_regs + FSL_MC_GCR1);
990
991 if (IS_ENABLED(CONFIG_ACPI) && !dev_of_node(&pdev->dev)) {
992 mc_stream_id = readl(mc->fsl_mc_regs + FSL_MC_FAPR);
993 /*
994 * HW ORs the PL and BMT bit, places the result in bit
995 * 14 of the StreamID and ORs in the ICID. Calculate it
996 * accordingly.
997 */
998 mc_stream_id = (mc_stream_id & 0xffff) |
999 ((mc_stream_id & (MC_FAPR_PL | MC_FAPR_BMT)) ?
1000 BIT(14) : 0);
1001 error = acpi_dma_configure_id(&pdev->dev,
1002 DEV_DMA_COHERENT,
1003 &mc_stream_id);
1004 if (error)
1005 dev_warn(&pdev->dev,
1006 "failed to configure dma: %d.\n",
1007 error);
1008 }
1009 }
1010
1011 /*
1012 * Get physical address of MC portal for the root DPRC:
1013 */
1014 plat_res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
1015 mc_portal_phys_addr = plat_res->start;
1016 mc_portal_size = resource_size(plat_res);
1017 error = fsl_create_mc_io(&pdev->dev, mc_portal_phys_addr,
1018 mc_portal_size, NULL,
1019 FSL_MC_IO_ATOMIC_CONTEXT_PORTAL, &mc_io);
1020 if (error < 0)
1021 return error;
1022
1023 error = mc_get_version(mc_io, 0, &mc_version);
1024 if (error != 0) {
1025 dev_err(&pdev->dev,
1026 "mc_get_version() failed with error %d\n", error);
1027 goto error_cleanup_mc_io;
1028 }
1029
1030 dev_info(&pdev->dev, "MC firmware version: %u.%u.%u\n",
1031 mc_version.major, mc_version.minor, mc_version.revision);
1032
1033 if (dev_of_node(&pdev->dev)) {
1034 error = get_mc_addr_translation_ranges(&pdev->dev,
1035 &mc->translation_ranges,
1036 &mc->num_translation_ranges);
1037 if (error < 0)
1038 goto error_cleanup_mc_io;
1039 }
1040
1041 error = dprc_get_container_id(mc_io, 0, &container_id);
1042 if (error < 0) {
1043 dev_err(&pdev->dev,
1044 "dprc_get_container_id() failed: %d\n", error);
1045 goto error_cleanup_mc_io;
1046 }
1047
1048 memset(&obj_desc, 0, sizeof(struct fsl_mc_obj_desc));
1049 error = dprc_get_api_version(mc_io, 0,
1050 &obj_desc.ver_major,
1051 &obj_desc.ver_minor);
1052 if (error < 0)
1053 goto error_cleanup_mc_io;
1054
1055 obj_desc.vendor = FSL_MC_VENDOR_FREESCALE;
1056 strcpy(obj_desc.type, "dprc");
1057 obj_desc.id = container_id;
1058 obj_desc.irq_count = 1;
1059 obj_desc.region_count = 0;
1060
1061 error = fsl_mc_device_add(&obj_desc, mc_io, &pdev->dev,
&mc_bus_dev);
1062 if (error < 0)
1063 goto error_cleanup_mc_io;
1064
1065 mc->root_mc_bus_dev = mc_bus_dev;
1066 mc_bus_dev->dev.fwnode = pdev->dev.fwnode;
1067 return 0;
1068
1069 error_cleanup_mc_io:
1070 fsl_destroy_mc_io(mc_io);
1071 return error;
1072 }
1073
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org