tree:
https://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux.git
renesas/i2c/smbus-cleanup
head: 06a3965f7ca847f8c42e7715251164ba6255e2a2
commit: 06a3965f7ca847f8c42e7715251164ba6255e2a2 [14/14] ipmi: remove open coded version
of SMBus block write
config: powerpc-randconfig-p002-20210112 (attached as .config)
compiler: powerpc-linux-gcc (GCC) 9.3.0
reproduce (this is a W=1 build):
wget
https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O
~/bin/make.cross
chmod +x ~/bin/make.cross
#
https://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux.git/commit/?id=...
git remote add wsa
https://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux.git
git fetch --no-tags wsa renesas/i2c/smbus-cleanup
git checkout 06a3965f7ca847f8c42e7715251164ba6255e2a2
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=powerpc
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All warnings (new ones prefixed by >>):
drivers/char/ipmi/ipmb_dev_int.c:356:36: warning: 'acpi_ipmb_id' defined but
not used [-Wunused-const-variable=]
356 | static const struct acpi_device_id acpi_ipmb_id[] = {
| ^~~~~~~~~~~~
drivers/char/ipmi/ipmb_dev_int.c: In function 'ipmb_write':
> drivers/char/ipmi/ipmb_dev_int.c:173:1: warning: the frame size
of 1040 bytes is larger than 1024 bytes [-Wframe-larger-than=]
173 | }
| ^
vim +173 drivers/char/ipmi/ipmb_dev_int.c
042f057fe2dcf386 Vijay Khemka 2019-12-11 134
51bd6f291583684f Asmaa Mnebhi 2019-06-10 135 static ssize_t ipmb_write(struct file
*file, const char __user *buf,
51bd6f291583684f Asmaa Mnebhi 2019-06-10 136 size_t count, loff_t *ppos)
51bd6f291583684f Asmaa Mnebhi 2019-06-10 137 {
51bd6f291583684f Asmaa Mnebhi 2019-06-10 138 struct ipmb_dev *ipmb_dev =
to_ipmb_dev(file);
51bd6f291583684f Asmaa Mnebhi 2019-06-10 139 u8 rq_sa, netf_rq_lun, msg_len;
06a3965f7ca847f8 Wolfram Sang 2021-01-12 140 struct i2c_client temp_client;
51bd6f291583684f Asmaa Mnebhi 2019-06-10 141 u8 msg[MAX_MSG_LEN];
51bd6f291583684f Asmaa Mnebhi 2019-06-10 142 ssize_t ret;
51bd6f291583684f Asmaa Mnebhi 2019-06-10 143
51bd6f291583684f Asmaa Mnebhi 2019-06-10 144 if (count > sizeof(msg))
51bd6f291583684f Asmaa Mnebhi 2019-06-10 145 return -EINVAL;
51bd6f291583684f Asmaa Mnebhi 2019-06-10 146
51bd6f291583684f Asmaa Mnebhi 2019-06-10 147 if (copy_from_user(&msg, buf,
count))
51bd6f291583684f Asmaa Mnebhi 2019-06-10 148 return -EFAULT;
51bd6f291583684f Asmaa Mnebhi 2019-06-10 149
51bd6f291583684f Asmaa Mnebhi 2019-06-10 150 if (count < msg[0])
51bd6f291583684f Asmaa Mnebhi 2019-06-10 151 return -EINVAL;
51bd6f291583684f Asmaa Mnebhi 2019-06-10 152
51bd6f291583684f Asmaa Mnebhi 2019-06-10 153 rq_sa =
GET_7BIT_ADDR(msg[RQ_SA_8BIT_IDX]);
51bd6f291583684f Asmaa Mnebhi 2019-06-10 154 netf_rq_lun = msg[NETFN_LUN_IDX];
51bd6f291583684f Asmaa Mnebhi 2019-06-10 155
042f057fe2dcf386 Vijay Khemka 2019-12-11 156 /* Check i2c block transfer vs smbus */
042f057fe2dcf386 Vijay Khemka 2019-12-11 157 if (ipmb_dev->is_i2c_protocol) {
042f057fe2dcf386 Vijay Khemka 2019-12-11 158 ret =
ipmb_i2c_write(ipmb_dev->client, msg, rq_sa);
042f057fe2dcf386 Vijay Khemka 2019-12-11 159 return (ret == 1) ? count : ret;
042f057fe2dcf386 Vijay Khemka 2019-12-11 160 }
042f057fe2dcf386 Vijay Khemka 2019-12-11 161
51bd6f291583684f Asmaa Mnebhi 2019-06-10 162 /*
06a3965f7ca847f8 Wolfram Sang 2021-01-12 163 * subtract rq_sa and netf_rq_lun from
the length of the msg. Fill the
06a3965f7ca847f8 Wolfram Sang 2021-01-12 164 * temporary client. Note that its use is
an exception for IPMI.
51bd6f291583684f Asmaa Mnebhi 2019-06-10 165 */
51bd6f291583684f Asmaa Mnebhi 2019-06-10 166 msg_len = msg[IPMB_MSG_LEN_IDX] -
SMBUS_MSG_HEADER_LENGTH;
06a3965f7ca847f8 Wolfram Sang 2021-01-12 167 memcpy(&temp_client,
ipmb_dev->client, sizeof(temp_client));
06a3965f7ca847f8 Wolfram Sang 2021-01-12 168 temp_client.addr = rq_sa;
21feadd024e74712 Arnd Bergmann 2019-06-19 169
06a3965f7ca847f8 Wolfram Sang 2021-01-12 170 ret =
i2c_smbus_write_block_data(&temp_client, netf_rq_lun, msg_len,
06a3965f7ca847f8 Wolfram Sang 2021-01-12 171 msg + SMBUS_MSG_IDX_OFFSET);
06a3965f7ca847f8 Wolfram Sang 2021-01-12 172 return ret < 0 ? ret : count;
51bd6f291583684f Asmaa Mnebhi 2019-06-10 @173 }
51bd6f291583684f Asmaa Mnebhi 2019-06-10 174
:::::: The code at line 173 was first introduced by commit
:::::: 51bd6f291583684f495ea498984dfc22049d7fd2 Add support for IPMB driver
:::::: TO: Asmaa Mnebhi <Asmaa(a)mellanox.com>
:::::: CC: Corey Minyard <cminyard(a)mvista.com>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org