Re: [PATCH 2/5] firmware: arm_scmi: imx: Add i.MX95 CPU Protocol

kernel test robot
2025-01-24T04:11:45Z

Hi Peng,

kernel test robot noticed the following build warnings:

[auto build test WARNING on 0907e7fb35756464aa34c35d6abb02998418164b]

url: https://github.com/intel-lab-lkp/linux/commits/Peng-Fan-OSS/firmware-arm_scmi-imx-Add-i-MX95-LMM-protocol/20250121-231254
base: 0907e7fb35756464aa34c35d6abb02998418164b
patch link: https://lore.kernel.org/r/20250121-imx-lmm-cpu-v1-2-0eab7e073e4e%40nxp.com
patch subject: [PATCH 2/5] firmware: arm_scmi: imx: Add i.MX95 CPU Protocol
config: arm64-randconfig-r122-20250124 (https://download.01.org/0day-ci/archive/20250124/202501241148.0CI9mBP5-lkp@intel.com/config)
compiler: aarch64-linux-gcc (GCC) 14.2.0
reproduce: (https://download.01.org/0day-ci/archive/20250124/202501241148.0CI9mBP5-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/202501241148.0CI9mBP5-lkp@intel.com/

sparse warnings: (new ones prefixed by >>)
>> drivers/firmware/arm_scmi/vendors/imx/imx-sm-cpu.c:139:19: sparse: sparse: incorrect type in assignment (different base types) @@ expected restricted __le32 [usertype] flags @@ got unsigned long @@
drivers/firmware/arm_scmi/vendors/imx/imx-sm-cpu.c:139:19: sparse: expected restricted __le32 [usertype] flags
drivers/firmware/arm_scmi/vendors/imx/imx-sm-cpu.c:139:19: sparse: got unsigned long
>> drivers/firmware/arm_scmi/vendors/imx/imx-sm-cpu.c:140:19: sparse: sparse: invalid assignment: |=
drivers/firmware/arm_scmi/vendors/imx/imx-sm-cpu.c:140:19: sparse: left side has type restricted __le32
drivers/firmware/arm_scmi/vendors/imx/imx-sm-cpu.c:140:19: sparse: right side has type unsigned long
drivers/firmware/arm_scmi/vendors/imx/imx-sm-cpu.c:141:19: sparse: sparse: invalid assignment: |=
drivers/firmware/arm_scmi/vendors/imx/imx-sm-cpu.c:141:19: sparse: left side has type restricted __le32
drivers/firmware/arm_scmi/vendors/imx/imx-sm-cpu.c:141:19: sparse: right side has type unsigned long
>> drivers/firmware/arm_scmi/vendors/imx/imx-sm-cpu.c:173:25: sparse: sparse: restricted __le32 degrades to integer
drivers/firmware/arm_scmi/vendors/imx/imx-sm-cpu.c:205:32: sparse: sparse: restricted __le32 degrades to integer

vim +139 drivers/firmware/arm_scmi/vendors/imx/imx-sm-cpu.c

119
120 static int scmi_imx_cpu_reset_vector_set(const struct scmi_protocol_handle *ph,
121 u32 cpuid, u64 vector, bool start,
122 bool boot, bool resume)
123 {
124 struct scmi_imx_cpu_reset_vector_set_in *in;
125 struct scmi_xfer *t;
126 int ret;
127
128 ret = scmi_imx_cpu_validate_cpuid(ph, cpuid);
129 if (ret)
130 return ret;
131
132 ret = ph->xops->xfer_get_init(ph, SCMI_IMX_CPU_RESET_VECTOR_SET, sizeof(*in),
133 0, &t);
134 if (ret)
135 return ret;
136
137 in = t->tx.buf;
138 in->cpuid = cpu_to_le32(cpuid);
> 139 in->flags = start ? CPU_VEC_FLAGS_START : 0;
> 140 in->flags |= boot ? CPU_VEC_FLAGS_BOOT : 0;
141 in->flags |= resume ? CPU_VEC_FLAGS_BOOT : 0;
142 in->resetvectorlow = cpu_to_le32(lower_32_bits(vector));
143 in->resetvectorhigh = cpu_to_le32(upper_32_bits(vector));
144 ret = ph->xops->do_xfer(ph, t);
145
146 ph->xops->xfer_put(ph, t);
147
148 return ret;
149 }
150
151 static int scmi_imx_cpu_started(const struct scmi_protocol_handle *ph, u32 cpuid,
152 bool *started)
153 {
154 struct scmi_imx_cpu_info_get_out *out;
155 struct scmi_xfer *t;
156 int ret;
157
158 *started = false;
159 ret = scmi_imx_cpu_validate_cpuid(ph, cpuid);
160 if (ret)
161 return ret;
162
163 ret = ph->xops->xfer_get_init(ph, SCMI_IMX_CPU_INFO_GET, sizeof(u32),
164 0, &t);
165 if (ret)
166 return ret;
167
168 put_unaligned_le32(cpuid, t->tx.buf);
169 ret = ph->xops->do_xfer(ph, t);
170 if (!ret) {
171 out = t->rx.buf;
172 if ((out->runmode == CPU_RUN_MODE_START) ||
> 173 (out->runmode == CPU_RUN_MODE_SLEEP))
174 *started = true;
175 }
176
177 ph->xops->xfer_put(ph, t);
178
179 return ret;
180 }
181

--
0-DAY CI Kernel Test Service