From: kernel test robot <lkp@intel.com>
To: Brad Larson <blarson@amd.com>, linux-arm-kernel@lists.infradead.org
Cc: oe-kbuild-all@lists.linux.dev, linux-kernel@vger.kernel.org,
linux-mmc@vger.kernel.org, linux-spi@vger.kernel.org,
adrian.hunter@intel.com, alcooperx@gmail.com,
andy.shevchenko@gmail.com, arnd@arndb.de, blarson@amd.com,
brendan.higgins@linux.dev, briannorris@chromium.org,
catalin.marinas@arm.com, conor+dt@kernel.org,
davidgow@google.com, gsomlo@gmail.com, gerg@linux-m68k.org,
hal.feng@starfivetech.com, hasegawa-hitomi@fujitsu.com,
j.neuschaefer@gmx.net, joel@jms.id.au, kernel@esmil.dk,
krzk@kernel.org, krzysztof.kozlowski+dt@linaro.org,
lee@kernel.org, lee.jones@linaro.org, broonie@kernel.org,
p.zabel@pengutronix.de, rdunlap@infradead.org,
robh+dt@kernel.org, samuel@sholland.org
Subject: Re: [PATCH v14 8/8] soc: amd: Add support for AMD Pensando SoC Controller
Date: Tue, 16 May 2023 16:45:20 +0800 [thread overview]
Message-ID: <202305161642.PZQ4S8o2-lkp@intel.com> (raw)
In-Reply-To: <20230515181606.65953-9-blarson@amd.com>
Hi Brad,
kernel test robot noticed the following build warnings:
[auto build test WARNING on e922ba281a8d84f640d8c8e18a385d032c19e185]
url: https://github.com/intel-lab-lkp/linux/commits/Brad-Larson/dt-bindings-arm-add-AMD-Pensando-boards/20230516-032312
base: e922ba281a8d84f640d8c8e18a385d032c19e185
patch link: https://lore.kernel.org/r/20230515181606.65953-9-blarson%40amd.com
patch subject: [PATCH v14 8/8] soc: amd: Add support for AMD Pensando SoC Controller
config: sh-allmodconfig (https://download.01.org/0day-ci/archive/20230516/202305161642.PZQ4S8o2-lkp@intel.com/config)
compiler: sh4-linux-gcc (GCC) 12.1.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://github.com/intel-lab-lkp/linux/commit/48a90df35083d2f3788e171ff0af01ddc8cd871b
git remote add linux-review https://github.com/intel-lab-lkp/linux
git fetch --no-tags linux-review Brad-Larson/dt-bindings-arm-add-AMD-Pensando-boards/20230516-032312
git checkout 48a90df35083d2f3788e171ff0af01ddc8cd871b
# save the config file
mkdir build_dir && cp config build_dir/.config
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross W=1 O=build_dir ARCH=sh olddefconfig
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross W=1 O=build_dir ARCH=sh SHELL=/bin/bash drivers/soc/amd/
If you fix the issue, kindly add following tag where applicable
| Reported-by: kernel test robot <lkp@intel.com>
| Link: https://lore.kernel.org/oe-kbuild-all/202305161642.PZQ4S8o2-lkp@intel.com/
All warnings (new ones prefixed by >>):
drivers/soc/amd/pensando-ctrl.c: In function 'penctrl_ioctl':
>> drivers/soc/amd/pensando-ctrl.c:91:36: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
91 | if (copy_from_user(tx_buf, (void __user *)msg->tx_buf, msg->len)) {
| ^
drivers/soc/amd/pensando-ctrl.c:114:26: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
114 | if (copy_to_user((void __user *)msg->rx_buf, rx_buf, msg->len))
| ^
vim +91 drivers/soc/amd/pensando-ctrl.c
34
35 static long
36 penctrl_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
37 {
38 void __user *in_arg = (void __user *)arg;
39 struct penctrl_device *penctrl;
40 u8 tx_buf[PENCTRL_MAX_MSG_LEN];
41 u8 rx_buf[PENCTRL_MAX_MSG_LEN];
42 struct spi_transfer t[2] = {};
43 struct penctrl_spi_xfer *msg;
44 struct spi_device *spi;
45 unsigned int num_msgs;
46 struct spi_message m;
47 u32 size;
48 int ret;
49
50 /* Check for a valid command */
51 if (_IOC_TYPE(cmd) != PENCTRL_IOC_MAGIC)
52 return -ENOTTY;
53
54 if (_IOC_NR(cmd) > PENCTRL_IOC_MAXNR)
55 return -ENOTTY;
56
57 if (((_IOC_DIR(cmd) & _IOC_READ)) && !access_ok(in_arg, _IOC_SIZE(cmd)))
58 return -EFAULT;
59
60 if (((_IOC_DIR(cmd) & _IOC_WRITE)) && !access_ok(in_arg, _IOC_SIZE(cmd)))
61 return -EFAULT;
62
63 /* Get a reference to the SPI device */
64 penctrl = filp->private_data;
65 if (!penctrl)
66 return -ESHUTDOWN;
67
68 spi = spi_dev_get(penctrl->spi);
69 if (!spi)
70 return -ESHUTDOWN;
71
72 /* Verify and prepare SPI message */
73 size = _IOC_SIZE(cmd);
74 num_msgs = size / sizeof(struct penctrl_spi_xfer);
75 if (num_msgs > 2 || size == 0 || size % sizeof(struct penctrl_spi_xfer)) {
76 ret = -EINVAL;
77 goto out_unlock;
78 }
79 msg = memdup_user((struct penctrl_spi_xfer *)arg, size);
80 if (IS_ERR(msg)) {
81 ret = PTR_ERR(msg);
82 goto out_unlock;
83 }
84 if (msg->len > PENCTRL_MAX_MSG_LEN) {
85 ret = -EINVAL;
86 goto out_unlock;
87 }
88
89 t[0].tx_buf = tx_buf;
90 t[0].len = msg->len;
> 91 if (copy_from_user(tx_buf, (void __user *)msg->tx_buf, msg->len)) {
92 ret = -EFAULT;
93 goto out_unlock;
94 }
95 if (num_msgs > 1) {
96 msg++;
97 if (msg->len > PENCTRL_MAX_MSG_LEN) {
98 ret = -EINVAL;
99 goto out_unlock;
100 }
101 t[1].rx_buf = rx_buf;
102 t[1].len = msg->len;
103 }
104 spi_message_init_with_transfers(&m, t, num_msgs);
105
106 /* Perform the transfer */
107 mutex_lock(&spi_lock);
108 ret = spi_sync(spi, &m);
109 mutex_unlock(&spi_lock);
110
111 if (ret || (num_msgs == 1))
112 goto out_unlock;
113
114 if (copy_to_user((void __user *)msg->rx_buf, rx_buf, msg->len))
115 ret = -EFAULT;
116
117 out_unlock:
118 spi_dev_put(spi);
119 return ret;
120 }
121
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests
next prev parent reply other threads:[~2023-05-16 8:46 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-05-15 18:15 [PATCH v14 0/8] Support AMD Pensando Elba SoC Brad Larson
2023-05-15 18:15 ` [PATCH v14 1/8] dt-bindings: arm: add AMD Pensando boards Brad Larson
2023-05-15 18:16 ` [PATCH v14 2/8] dt-bindings: spi: cdns: Add compatible for AMD Pensando Elba SoC Brad Larson
2023-05-16 15:18 ` Mark Brown
2023-05-15 18:16 ` [PATCH v14 3/8] dt-bindings: soc: amd: amd,pensando-elba-ctrl: Add Pensando SoC Controller Brad Larson
2023-05-15 18:16 ` [PATCH v14 4/8] MAINTAINERS: Add entry for AMD PENSANDO Brad Larson
2023-05-15 18:16 ` [PATCH v14 5/8] arm64: Add config for AMD Pensando SoC platforms Brad Larson
2023-05-15 18:16 ` [PATCH v14 6/8] arm64: dts: Add AMD Pensando Elba SoC support Brad Larson
2023-05-16 7:17 ` Krzysztof Kozlowski
2023-05-16 7:54 ` Michal Simek
2023-05-23 19:28 ` Brad Larson
2023-05-24 11:52 ` Geert Uytterhoeven
2023-05-30 22:03 ` Brad Larson
2023-05-31 13:09 ` Geert Uytterhoeven
2023-06-05 23:52 ` Brad Larson
2023-05-15 18:16 ` [PATCH v14 7/8] spi: cadence-quadspi: Add compatible for AMD Pensando Elba SoC Brad Larson
2023-05-15 18:16 ` [PATCH v14 8/8] soc: amd: Add support for AMD Pensando SoC Controller Brad Larson
2023-05-15 21:05 ` Andy Shevchenko
2023-05-23 2:12 ` Brad Larson
2023-05-16 5:19 ` Mahapatra, Amit Kumar
2023-05-16 7:36 ` Michal Simek
2023-05-17 11:14 ` Geert Uytterhoeven
2023-05-16 8:45 ` kernel test robot [this message]
2023-05-16 11:03 ` Arnd Bergmann
2023-05-23 22:11 ` Brad Larson
2023-05-24 12:41 ` Arnd Bergmann
2023-08-07 22:17 ` Brad Larson
2023-05-16 7:14 ` [PATCH v14 0/8] Support AMD Pensando Elba SoC Krzysztof Kozlowski
2023-05-17 14:43 ` (subset) " Mark Brown
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=202305161642.PZQ4S8o2-lkp@intel.com \
--to=lkp@intel.com \
--cc=adrian.hunter@intel.com \
--cc=alcooperx@gmail.com \
--cc=andy.shevchenko@gmail.com \
--cc=arnd@arndb.de \
--cc=blarson@amd.com \
--cc=brendan.higgins@linux.dev \
--cc=briannorris@chromium.org \
--cc=broonie@kernel.org \
--cc=catalin.marinas@arm.com \
--cc=conor+dt@kernel.org \
--cc=davidgow@google.com \
--cc=gerg@linux-m68k.org \
--cc=gsomlo@gmail.com \
--cc=hal.feng@starfivetech.com \
--cc=hasegawa-hitomi@fujitsu.com \
--cc=j.neuschaefer@gmx.net \
--cc=joel@jms.id.au \
--cc=kernel@esmil.dk \
--cc=krzk@kernel.org \
--cc=krzysztof.kozlowski+dt@linaro.org \
--cc=lee.jones@linaro.org \
--cc=lee@kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mmc@vger.kernel.org \
--cc=linux-spi@vger.kernel.org \
--cc=oe-kbuild-all@lists.linux.dev \
--cc=p.zabel@pengutronix.de \
--cc=rdunlap@infradead.org \
--cc=robh+dt@kernel.org \
--cc=samuel@sholland.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).