[PATCH 5/8] firmware: arm_scmi: Make SMC transport a standalone driver
kernel test robot
lkp at intel.com
Sun Jul 7 09:03:11 PDT 2024
Hi Cristian,
kernel test robot noticed the following build warnings:
[auto build test WARNING on soc/for-next]
[also build test WARNING on next-20240703]
[cannot apply to linus/master v6.10-rc6]
[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/Cristian-Marussi/firmware-arm_scmi-Introduce-setup_shmem_iomap/20240707-082513
base: https://git.kernel.org/pub/scm/linux/kernel/git/soc/soc.git for-next
patch link: https://lore.kernel.org/r/20240707002055.1835121-6-cristian.marussi%40arm.com
patch subject: [PATCH 5/8] firmware: arm_scmi: Make SMC transport a standalone driver
config: arm-defconfig (https://download.01.org/0day-ci/archive/20240707/202407072316.PqU8yj52-lkp@intel.com/config)
compiler: clang version 14.0.6 (https://github.com/llvm/llvm-project f28c006a5895fc0e329fe15fead81e37457cb1d1)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240707/202407072316.PqU8yj52-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 at intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202407072316.PqU8yj52-lkp@intel.com/
All warnings (new ones prefixed by >>):
>> drivers/firmware/arm_scmi/scmi_transport_smc.c:157:58: warning: variable 'size' is uninitialized when used here [-Wuninitialized]
void __iomem *ptr = (void __iomem *)scmi_info->shmem + size - 8;
^~~~
drivers/firmware/arm_scmi/scmi_transport_smc.c:136:22: note: initialize the variable 'size' to silence this warning
resource_size_t size;
^
= 0
1 warning generated.
vim +/size +157 drivers/firmware/arm_scmi/scmi_transport_smc.c
0bfdca8a8661aa drivers/firmware/arm_scmi/smc.c Cristian Marussi 2021-12-20 129
1dc6558062dadf drivers/firmware/arm_scmi/smc.c Peng Fan 2020-03-08 130 static int smc_chan_setup(struct scmi_chan_info *cinfo, struct device *dev,
1dc6558062dadf drivers/firmware/arm_scmi/smc.c Peng Fan 2020-03-08 131 bool tx)
1dc6558062dadf drivers/firmware/arm_scmi/smc.c Peng Fan 2020-03-08 132 {
1dc6558062dadf drivers/firmware/arm_scmi/smc.c Peng Fan 2020-03-08 133 struct device *cdev = cinfo->dev;
da405477e76707 drivers/firmware/arm_scmi/smc.c Nikunj Kela 2023-10-09 134 unsigned long cap_id = ULONG_MAX;
1dc6558062dadf drivers/firmware/arm_scmi/smc.c Peng Fan 2020-03-08 135 struct scmi_smc *scmi_info;
1dc6558062dadf drivers/firmware/arm_scmi/smc.c Peng Fan 2020-03-08 136 resource_size_t size;
1dc6558062dadf drivers/firmware/arm_scmi/smc.c Peng Fan 2020-03-08 137 struct resource res;
1dc6558062dadf drivers/firmware/arm_scmi/smc.c Peng Fan 2020-03-08 138 u32 func_id;
d1ff11d7ad8704 drivers/firmware/arm_scmi/smc.c Cristian Marussi 2023-07-19 139 int ret;
1dc6558062dadf drivers/firmware/arm_scmi/smc.c Peng Fan 2020-03-08 140
1dc6558062dadf drivers/firmware/arm_scmi/smc.c Peng Fan 2020-03-08 141 if (!tx)
1dc6558062dadf drivers/firmware/arm_scmi/smc.c Peng Fan 2020-03-08 142 return -ENODEV;
1dc6558062dadf drivers/firmware/arm_scmi/smc.c Peng Fan 2020-03-08 143
1dc6558062dadf drivers/firmware/arm_scmi/smc.c Peng Fan 2020-03-08 144 scmi_info = devm_kzalloc(dev, sizeof(*scmi_info), GFP_KERNEL);
1dc6558062dadf drivers/firmware/arm_scmi/smc.c Peng Fan 2020-03-08 145 if (!scmi_info)
1dc6558062dadf drivers/firmware/arm_scmi/smc.c Peng Fan 2020-03-08 146 return -ENOMEM;
1dc6558062dadf drivers/firmware/arm_scmi/smc.c Peng Fan 2020-03-08 147
728a057b6ab114 drivers/firmware/arm_scmi/scmi_transport_smc.c Cristian Marussi 2024-07-07 148 scmi_info->shmem = core->shmem->setup_iomap(cinfo, dev, tx);
6c5d3315c40fa0 drivers/firmware/arm_scmi/smc.c Peng Fan 2024-07-07 149 if (IS_ERR(scmi_info->shmem))
6c5d3315c40fa0 drivers/firmware/arm_scmi/smc.c Peng Fan 2024-07-07 150 return PTR_ERR(scmi_info->shmem);
1dc6558062dadf drivers/firmware/arm_scmi/smc.c Peng Fan 2020-03-08 151
1dc6558062dadf drivers/firmware/arm_scmi/smc.c Peng Fan 2020-03-08 152 ret = of_property_read_u32(dev->of_node, "arm,smc-id", &func_id);
1dc6558062dadf drivers/firmware/arm_scmi/smc.c Peng Fan 2020-03-08 153 if (ret < 0)
1dc6558062dadf drivers/firmware/arm_scmi/smc.c Peng Fan 2020-03-08 154 return ret;
1dc6558062dadf drivers/firmware/arm_scmi/smc.c Peng Fan 2020-03-08 155
da405477e76707 drivers/firmware/arm_scmi/smc.c Nikunj Kela 2023-10-09 156 if (of_device_is_compatible(dev->of_node, "qcom,scmi-smc")) {
da405477e76707 drivers/firmware/arm_scmi/smc.c Nikunj Kela 2023-10-09 @157 void __iomem *ptr = (void __iomem *)scmi_info->shmem + size - 8;
da405477e76707 drivers/firmware/arm_scmi/smc.c Nikunj Kela 2023-10-09 158 /* The capability-id is kept in last 8 bytes of shmem.
da405477e76707 drivers/firmware/arm_scmi/smc.c Nikunj Kela 2023-10-09 159 * +-------+ <-- 0
da405477e76707 drivers/firmware/arm_scmi/smc.c Nikunj Kela 2023-10-09 160 * | shmem |
da405477e76707 drivers/firmware/arm_scmi/smc.c Nikunj Kela 2023-10-09 161 * +-------+ <-- size - 8
da405477e76707 drivers/firmware/arm_scmi/smc.c Nikunj Kela 2023-10-09 162 * | capId |
da405477e76707 drivers/firmware/arm_scmi/smc.c Nikunj Kela 2023-10-09 163 * +-------+ <-- size
da405477e76707 drivers/firmware/arm_scmi/smc.c Nikunj Kela 2023-10-09 164 */
da405477e76707 drivers/firmware/arm_scmi/smc.c Nikunj Kela 2023-10-09 165 memcpy_fromio(&cap_id, ptr, sizeof(cap_id));
da405477e76707 drivers/firmware/arm_scmi/smc.c Nikunj Kela 2023-10-09 166 }
da405477e76707 drivers/firmware/arm_scmi/smc.c Nikunj Kela 2023-10-09 167
5f2ea10a808aef drivers/firmware/arm_scmi/smc.c Nikunj Kela 2023-05-06 168 if (of_device_is_compatible(dev->of_node, "arm,scmi-smc-param")) {
5f2ea10a808aef drivers/firmware/arm_scmi/smc.c Nikunj Kela 2023-05-06 169 scmi_info->param_page = SHMEM_PAGE(res.start);
5f2ea10a808aef drivers/firmware/arm_scmi/smc.c Nikunj Kela 2023-05-06 170 scmi_info->param_offset = SHMEM_OFFSET(res.start);
5f2ea10a808aef drivers/firmware/arm_scmi/smc.c Nikunj Kela 2023-05-06 171 }
dd820ee21d5e07 drivers/firmware/arm_scmi/smc.c Jim Quinlan 2020-12-22 172 /*
dd820ee21d5e07 drivers/firmware/arm_scmi/smc.c Jim Quinlan 2020-12-22 173 * If there is an interrupt named "a2p", then the service and
dd820ee21d5e07 drivers/firmware/arm_scmi/smc.c Jim Quinlan 2020-12-22 174 * completion of a message is signaled by an interrupt rather than by
dd820ee21d5e07 drivers/firmware/arm_scmi/smc.c Jim Quinlan 2020-12-22 175 * the return of the SMC call.
dd820ee21d5e07 drivers/firmware/arm_scmi/smc.c Jim Quinlan 2020-12-22 176 */
d1ff11d7ad8704 drivers/firmware/arm_scmi/smc.c Cristian Marussi 2023-07-19 177 scmi_info->irq = of_irq_get_byname(cdev->of_node, "a2p");
d1ff11d7ad8704 drivers/firmware/arm_scmi/smc.c Cristian Marussi 2023-07-19 178 if (scmi_info->irq > 0) {
d1ff11d7ad8704 drivers/firmware/arm_scmi/smc.c Cristian Marussi 2023-07-19 179 ret = request_irq(scmi_info->irq, smc_msg_done_isr,
d1ff11d7ad8704 drivers/firmware/arm_scmi/smc.c Cristian Marussi 2023-07-19 180 IRQF_NO_SUSPEND, dev_name(dev), scmi_info);
dd820ee21d5e07 drivers/firmware/arm_scmi/smc.c Jim Quinlan 2020-12-22 181 if (ret) {
dd820ee21d5e07 drivers/firmware/arm_scmi/smc.c Jim Quinlan 2020-12-22 182 dev_err(dev, "failed to setup SCMI smc irq\n");
dd820ee21d5e07 drivers/firmware/arm_scmi/smc.c Jim Quinlan 2020-12-22 183 return ret;
dd820ee21d5e07 drivers/firmware/arm_scmi/smc.c Jim Quinlan 2020-12-22 184 }
f716cbd33f038a drivers/firmware/arm_scmi/smc.c Cristian Marussi 2021-12-20 185 } else {
f716cbd33f038a drivers/firmware/arm_scmi/smc.c Cristian Marussi 2021-12-20 186 cinfo->no_completion_irq = true;
dd820ee21d5e07 drivers/firmware/arm_scmi/smc.c Jim Quinlan 2020-12-22 187 }
dd820ee21d5e07 drivers/firmware/arm_scmi/smc.c Jim Quinlan 2020-12-22 188
1dc6558062dadf drivers/firmware/arm_scmi/smc.c Peng Fan 2020-03-08 189 scmi_info->func_id = func_id;
da405477e76707 drivers/firmware/arm_scmi/smc.c Nikunj Kela 2023-10-09 190 scmi_info->cap_id = cap_id;
1dc6558062dadf drivers/firmware/arm_scmi/smc.c Peng Fan 2020-03-08 191 scmi_info->cinfo = cinfo;
0bfdca8a8661aa drivers/firmware/arm_scmi/smc.c Cristian Marussi 2021-12-20 192 smc_channel_lock_init(scmi_info);
1dc6558062dadf drivers/firmware/arm_scmi/smc.c Peng Fan 2020-03-08 193 cinfo->transport_info = scmi_info;
1dc6558062dadf drivers/firmware/arm_scmi/smc.c Peng Fan 2020-03-08 194
1dc6558062dadf drivers/firmware/arm_scmi/smc.c Peng Fan 2020-03-08 195 return 0;
1dc6558062dadf drivers/firmware/arm_scmi/smc.c Peng Fan 2020-03-08 196 }
1dc6558062dadf drivers/firmware/arm_scmi/smc.c Peng Fan 2020-03-08 197
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
More information about the linux-arm-kernel
mailing list