Re: [PATCH 2/2] firmware: arm_scmi: Add qcom hvc/shmem transport

kernel test robot
2023-07-23T02:16:51Z

Hi Nikunj,

kernel test robot noticed the following build warnings:

[auto build test WARNING on robh/for-next]
[also build test WARNING on linus/master v6.5-rc2 next-20230721]
[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#_base_tree_information]

url: https://github.com/intel-lab-lkp/linux/commits/Nikunj-Kela/dt-bindings-arm-Add-qcom-specific-hvc-transport-for-SCMI/20230719-001116
base: https://git.kernel.org/pub/scm/linux/kernel/git/robh/linux.git for-next
patch link: https://lore.kernel.org/r/20230718160833.36397-3-quic_nkela%40quicinc.com
patch subject: [PATCH 2/2] firmware: arm_scmi: Add qcom hvc/shmem transport
config: arm64-randconfig-r083-20230723 (https://download.01.org/0day-ci/archive/20230723/202307231034.5C5lj4Dv-lkp@intel.com/config)
compiler: aarch64-linux-gcc (GCC) 12.3.0
reproduce: (https://download.01.org/0day-ci/archive/20230723/202307231034.5C5lj4Dv-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202307231034.5C5lj4Dv-lkp@intel.com/

sparse warnings: (new ones prefixed by >>)
>> drivers/firmware/arm_scmi/qcom_hvc.c:136:26: sparse: sparse: cast removes address space '__iomem' of expression
>> drivers/firmware/arm_scmi/qcom_hvc.c:136:52: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void const volatile [noderef] __iomem *addr @@ got void * @@
drivers/firmware/arm_scmi/qcom_hvc.c:136:52: sparse: expected void const volatile [noderef] __iomem *addr
drivers/firmware/arm_scmi/qcom_hvc.c:136:52: sparse: got void *
drivers/firmware/arm_scmi/qcom_hvc.c:139:25: sparse: sparse: cast removes address space '__iomem' of expression
drivers/firmware/arm_scmi/qcom_hvc.c:139:58: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void const volatile [noderef] __iomem *addr @@ got void * @@
drivers/firmware/arm_scmi/qcom_hvc.c:139:58: sparse: expected void const volatile [noderef] __iomem *addr
drivers/firmware/arm_scmi/qcom_hvc.c:139:58: sparse: got void *

vim +/__iomem +136 drivers/firmware/arm_scmi/qcom_hvc.c

82
83 static int qcom_hvc_chan_setup(struct scmi_chan_info *cinfo,
84 struct device *dev, bool tx)
85 {
86 struct device *cdev = cinfo->dev;
87 struct scmi_qcom_hvc *scmi_info;
88 resource_size_t size;
89 struct resource res;
90 struct device_node *np;
91 unsigned long cap_id;
92 u32 func_id;
93 int ret, irq;
94
95 if (!tx)
96 return -ENODEV;
97
98 scmi_info = devm_kzalloc(dev, sizeof(*scmi_info), GFP_KERNEL);
99 if (!scmi_info)
100 return -ENOMEM;
101
102 np = of_parse_phandle(cdev->of_node, "shmem", 0);
103 if (!of_device_is_compatible(np, "arm,scmi-shmem"))
104 return -ENXIO;
105
106 ret = of_address_to_resource(np, 0, &res);
107 of_node_put(np);
108 if (ret) {
109 dev_err(cdev, "failed to get SCMI Tx shared memory\n");
110 return ret;
111 }
112
113 size = resource_size(&res);
114
115 /* let's map 2 additional ulong since
116 * func-id & capability-id are kept after shmem.
117 * +-------+
118 * | |
119 * | shmem |
120 * | |
121 * | |
122 * +-------+ <-- size
123 * | funcId|
124 * +-------+ <-- size + sizeof(ulong)
125 * | capId |
126 * +-------+ <-- size + 2*sizeof(ulong)
127 */
128
129 scmi_info->shmem = devm_ioremap(dev, res.start,
130 size + 2 * sizeof(unsigned long));
131 if (!scmi_info->shmem) {
132 dev_err(dev, "failed to ioremap SCMI Tx shared memory\n");
133 return -EADDRNOTAVAIL;
134 }
135
> 136 func_id = readl((void *)(scmi_info->shmem) + size);
137

--
0-DAY CI Kernel Test Service