[jkirsher-next-queue:dev-queue 49/99] drivers/net/ethernet/intel/ice/ice_base.c:432:8: error: implicit declaration of function 'xsk_umem_has_addrs_rq'; did you mean 'xsk_umem_get_headroom'?
by kbuild test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/jkirsher/next-queue.git dev-queue
head: 5950d1e508b225372208a78339e6434adf129852
commit: ee9a9330eddc09067644982f3981dc21ab863451 [49/99] ice: Check UMEM FQ size when allocating bufs
config: i386-allyesconfig (attached as .config)
compiler: gcc-7 (Ubuntu 7.5.0-6ubuntu2) 7.5.0
reproduce (this is a W=1 build):
git checkout ee9a9330eddc09067644982f3981dc21ab863451
# save the attached .config to linux build tree
make ARCH=i386
If you fix the issue, kindly add following tag as appropriate
Reported-by: kbuild test robot <lkp(a)intel.com>
All errors (new ones prefixed by >>, old ones prefixed by <<):
drivers/net/ethernet/intel/ice/ice_base.c: In function 'ice_setup_rx_ctx':
>> drivers/net/ethernet/intel/ice/ice_base.c:432:8: error: implicit declaration of function 'xsk_umem_has_addrs_rq'; did you mean 'xsk_umem_get_headroom'? [-Werror=implicit-function-declaration]
if (!xsk_umem_has_addrs_rq(ring->xsk_umem, num_bufs)) {
^~~~~~~~~~~~~~~~~~~~~
xsk_umem_get_headroom
>> drivers/net/ethernet/intel/ice/ice_base.c:440:9: error: implicit declaration of function 'ice_alloc_rx_bufs_slow_zc'; did you mean 'ice_alloc_rx_bufs_zc'? [-Werror=implicit-function-declaration]
err = ice_alloc_rx_bufs_slow_zc(ring, num_bufs);
^~~~~~~~~~~~~~~~~~~~~~~~~
ice_alloc_rx_bufs_zc
cc1: some warnings being treated as errors
vim +432 drivers/net/ethernet/intel/ice/ice_base.c
275
276 /**
277 * ice_setup_rx_ctx - Configure a receive ring context
278 * @ring: The Rx ring to configure
279 *
280 * Configure the Rx descriptor ring in RLAN context.
281 */
282 int ice_setup_rx_ctx(struct ice_ring *ring)
283 {
284 struct device *dev = ice_pf_to_dev(ring->vsi->back);
285 int chain_len = ICE_MAX_CHAINED_RX_BUFS;
286 u16 num_bufs = ICE_DESC_UNUSED(ring);
287 struct ice_vsi *vsi = ring->vsi;
288 u32 rxdid = ICE_RXDID_FLEX_NIC;
289 struct ice_rlan_ctx rlan_ctx;
290 struct ice_hw *hw;
291 u32 regval;
292 u16 pf_q;
293 int err;
294
295 hw = &vsi->back->hw;
296
297 /* what is Rx queue number in global space of 2K Rx queues */
298 pf_q = vsi->rxq_map[ring->q_index];
299
300 /* clear the context structure first */
301 memset(&rlan_ctx, 0, sizeof(rlan_ctx));
302
303 ring->rx_buf_len = vsi->rx_buf_len;
304
305 if (ring->vsi->type == ICE_VSI_PF) {
306 if (!xdp_rxq_info_is_reg(&ring->xdp_rxq))
307 /* coverity[check_return] */
308 xdp_rxq_info_reg(&ring->xdp_rxq, ring->netdev,
309 ring->q_index);
310
311 ring->xsk_umem = ice_xsk_umem(ring);
312 if (ring->xsk_umem) {
313 xdp_rxq_info_unreg_mem_model(&ring->xdp_rxq);
314
315 ring->rx_buf_len =
316 xsk_umem_get_rx_frame_size(ring->xsk_umem);
317 /* For AF_XDP ZC, we disallow packets to span on
318 * multiple buffers, thus letting us skip that
319 * handling in the fast-path.
320 */
321 chain_len = 1;
322 err = xdp_rxq_info_reg_mem_model(&ring->xdp_rxq,
323 MEM_TYPE_XSK_BUFF_POOL,
324 NULL);
325 if (err)
326 return err;
327 xsk_buff_set_rxq_info(ring->xsk_umem, &ring->xdp_rxq);
328
329 dev_info(dev, "Registered XDP mem model MEM_TYPE_ZERO_COPY on Rx ring %d\n",
330 ring->q_index);
331 } else {
332 if (!xdp_rxq_info_is_reg(&ring->xdp_rxq))
333 /* coverity[check_return] */
334 xdp_rxq_info_reg(&ring->xdp_rxq,
335 ring->netdev,
336 ring->q_index);
337
338 err = xdp_rxq_info_reg_mem_model(&ring->xdp_rxq,
339 MEM_TYPE_PAGE_SHARED,
340 NULL);
341 if (err)
342 return err;
343 }
344 }
345 /* Receive Queue Base Address.
346 * Indicates the starting address of the descriptor queue defined in
347 * 128 Byte units.
348 */
349 rlan_ctx.base = ring->dma >> 7;
350
351 rlan_ctx.qlen = ring->count;
352
353 /* Receive Packet Data Buffer Size.
354 * The Packet Data Buffer Size is defined in 128 byte units.
355 */
356 rlan_ctx.dbuf = ring->rx_buf_len >> ICE_RLAN_CTX_DBUF_S;
357
358 /* use 32 byte descriptors */
359 rlan_ctx.dsize = 1;
360
361 /* Strip the Ethernet CRC bytes before the packet is posted to host
362 * memory.
363 */
364 rlan_ctx.crcstrip = 1;
365
366 /* L2TSEL flag defines the reported L2 Tags in the receive descriptor */
367 rlan_ctx.l2tsel = 1;
368
369 rlan_ctx.dtype = ICE_RX_DTYPE_NO_SPLIT;
370 rlan_ctx.hsplit_0 = ICE_RLAN_RX_HSPLIT_0_NO_SPLIT;
371 rlan_ctx.hsplit_1 = ICE_RLAN_RX_HSPLIT_1_NO_SPLIT;
372
373 /* This controls whether VLAN is stripped from inner headers
374 * The VLAN in the inner L2 header is stripped to the receive
375 * descriptor if enabled by this flag.
376 */
377 rlan_ctx.showiv = 0;
378
379 /* Max packet size for this queue - must not be set to a larger value
380 * than 5 x DBUF
381 */
382 rlan_ctx.rxmax = min_t(u32, vsi->max_frame,
383 chain_len * ring->rx_buf_len);
384
385 /* Rx queue threshold in units of 64 */
386 rlan_ctx.lrxqthresh = 1;
387
388 /* Enable Flexible Descriptors in the queue context which
389 * allows this driver to select a specific receive descriptor format
390 */
391 regval = rd32(hw, QRXFLXP_CNTXT(pf_q));
392 if (vsi->type != ICE_VSI_VF) {
393 regval |= (rxdid << QRXFLXP_CNTXT_RXDID_IDX_S) &
394 QRXFLXP_CNTXT_RXDID_IDX_M;
395
396 /* increasing context priority to pick up profile ID;
397 * default is 0x01; setting to 0x03 to ensure profile
398 * is programming if prev context is of same priority
399 */
400 regval |= (0x03 << QRXFLXP_CNTXT_RXDID_PRIO_S) &
401 QRXFLXP_CNTXT_RXDID_PRIO_M;
402
403 } else {
404 regval &= ~(QRXFLXP_CNTXT_RXDID_IDX_M |
405 QRXFLXP_CNTXT_RXDID_PRIO_M |
406 QRXFLXP_CNTXT_TS_M);
407 }
408 wr32(hw, QRXFLXP_CNTXT(pf_q), regval);
409
410 /* Absolute queue number out of 2K needs to be passed */
411 err = ice_write_rxq_ctx(hw, &rlan_ctx, pf_q);
412 if (err) {
413 dev_err(dev, "Failed to set LAN Rx queue context for absolute Rx queue %d error: %d\n",
414 pf_q, err);
415 return -EIO;
416 }
417
418 if (vsi->type == ICE_VSI_VF)
419 return 0;
420
421 /* configure Rx buffer alignment */
422 if (!vsi->netdev || test_bit(ICE_FLAG_LEGACY_RX, vsi->back->flags))
423 ice_clear_ring_build_skb_ena(ring);
424 else
425 ice_set_ring_build_skb_ena(ring);
426
427 /* init queue specific tail register */
428 ring->tail = hw->hw_addr + QRX_TAIL(pf_q);
429 writel(0, ring->tail);
430
431 if (ring->xsk_umem) {
> 432 if (!xsk_umem_has_addrs_rq(ring->xsk_umem, num_bufs)) {
433 dev_warn(dev, "UMEM does not provide enough addresses to fill %d buffers on Rx ring %d\n",
434 num_bufs, ring->q_index);
435 dev_warn(dev, "Change Rx ring/fill queue size to avoid performance issues\n");
436
437 return 0;
438 }
439
> 440 err = ice_alloc_rx_bufs_slow_zc(ring, num_bufs);
441 if (err)
442 dev_info(dev, "Failed to allocate some buffers on UMEM enabled Rx ring %d (pf_q %d)\n",
443 ring->q_index, pf_q);
444 return 0;
445 }
446
447 ice_alloc_rx_bufs(ring, num_bufs);
448
449 return 0;
450 }
451
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
2 years, 3 months
[omap:serdev-ngsm-pending-v5.7 20/29] drivers/gnss/motmdm.c:71:5: warning: no previous prototype for 'motmdm_gnss_send_command'
by kbuild test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap.git serdev-ngsm-pending-v5.7
head: 4eda51fea6be98ca5a4023a988b102bf3629b295
commit: ae348e86a0abccb615c8875a95d63f10268f1c4f [20/29] gnss: motmdm: Add support for Motorola Mapphone MDM6600 modem
config: riscv-allyesconfig (attached as .config)
compiler: riscv64-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
git checkout ae348e86a0abccb615c8875a95d63f10268f1c4f
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=riscv
If you fix the issue, kindly add following tag as appropriate
Reported-by: kbuild test robot <lkp(a)intel.com>
All warnings (new ones prefixed by >>, old ones prefixed by <<):
>> drivers/gnss/motmdm.c:71:5: warning: no previous prototype for 'motmdm_gnss_send_command' [-Wmissing-prototypes]
71 | int motmdm_gnss_send_command(struct motmdm_gnss_data *ddata,
| ^~~~~~~~~~~~~~~~~~~~~~~~
drivers/gnss/motmdm.c: In function 'motmdm_gnss_receive_data':
>> drivers/gnss/motmdm.c:209:6: warning: variable 'error' set but not used [-Wunused-but-set-variable]
209 | int error = 0;
| ^~~~~
vim +/motmdm_gnss_send_command +71 drivers/gnss/motmdm.c
62
63 /*
64 * Note that multiple commands can be sent in series with responses coming
65 * out-of-order. For GNSS, we don't need to care about the out-of-order
66 * responses, and can assume we have at most one command active at a time.
67 * For the commands, can use just a jiffies base packet ID and let the modem
68 * sort out the ID conflicts with the modem's unsolicited message ID
69 * numbering.
70 */
> 71 int motmdm_gnss_send_command(struct motmdm_gnss_data *ddata,
72 const u8 *buf, int len)
73 {
74 struct gnss_device *gdev = ddata->gdev;
75 const int timeout_ms = 1000;
76 unsigned char cmd[128];
77 int ret, cmdlen;
78
79 cmdlen = len + 5 + 1;
80 if (cmdlen > 128)
81 return -EINVAL;
82
83 mutex_lock(&ddata->mutex);
84 memset(ddata->buf, 0, ddata->len);
85 ddata->parsed = false;
86 snprintf(cmd, cmdlen, "U%04li%s", jiffies % 10000, buf);
87 ret = serdev_ngsm_write(ddata->modem, &ddata->dlci, cmd, cmdlen);
88 if (ret < 0)
89 goto out_unlock;
90
91 ret = wait_event_timeout(ddata->read_queue, ddata->parsed,
92 msecs_to_jiffies(timeout_ms));
93 if (ret == 0) {
94 ret = -ETIMEDOUT;
95 goto out_unlock;
96 } else if (ret < 0) {
97 goto out_unlock;
98 }
99
100 if (!strstr(ddata->buf, ":OK")) {
101 dev_err(&gdev->dev, "command %s error %s\n",
102 cmd, ddata->buf);
103 ret = -EPIPE;
104 }
105
106 ret = len;
107
108 out_unlock:
109 mutex_unlock(&ddata->mutex);
110
111 return ret;
112 }
113
114 /*
115 * Android uses AT+MPDSTART=0,1,100,0 which starts GNSS for a while,
116 * and then GNSS needs to be kicked with an AT command based on a
117 * status message.
118 */
119 static void motmdm_gnss_restart(struct work_struct *work)
120 {
121 struct motmdm_gnss_data *ddata =
122 container_of(work, struct motmdm_gnss_data,
123 restart_work.work);
124 struct gnss_device *gdev = ddata->gdev;
125 const unsigned char *cmd = "AT+MPDSTART=0,1,100,0";
126 int error;
127
128 ddata->last_update = ktime_get();
129
130 error = motmdm_gnss_send_command(ddata, cmd, strlen(cmd));
131 if (error < 0) {
132 /* Timeouts can happen, don't warn and try again */
133 if (error != -ETIMEDOUT)
134 dev_warn(&gdev->dev, "%s: could not start: %i\n",
135 __func__, error);
136
137 schedule_delayed_work(&ddata->restart_work,
138 msecs_to_jiffies(MOTMDM_GNSS_RATE));
139
140 return;
141 }
142 }
143
144 static void motmdm_gnss_start(struct gnss_device *gdev, int delay_ms)
145 {
146 struct motmdm_gnss_data *ddata = gnss_get_drvdata(gdev);
147 ktime_t now, next, delta;
148 int next_ms;
149
150 now = ktime_get();
151 next = ktime_add_ms(ddata->last_update, delay_ms);
152 delta = ktime_sub(next, now);
153 next_ms = ktime_to_ms(delta);
154
155 if (next_ms < 0)
156 next_ms = 0;
157 if (next_ms > delay_ms)
158 next_ms = delay_ms;
159
160 schedule_delayed_work(&ddata->restart_work, msecs_to_jiffies(next_ms));
161 }
162
163 static int motmdm_gnss_stop(struct gnss_device *gdev)
164 {
165 struct motmdm_gnss_data *ddata = gnss_get_drvdata(gdev);
166 const unsigned char *cmd = "AT+MPDSTOP";
167
168 cancel_delayed_work_sync(&ddata->restart_work);
169
170 return motmdm_gnss_send_command(ddata, cmd, strlen(cmd));
171 }
172
173 static int motmdm_gnss_init(struct gnss_device *gdev)
174 {
175 struct motmdm_gnss_data *ddata = gnss_get_drvdata(gdev);
176 const unsigned char *cmd = "AT+MPDINIT=1";
177 int error;
178
179 error = motmdm_gnss_send_command(ddata, cmd, strlen(cmd));
180 if (error < 0)
181 return error;
182
183 motmdm_gnss_start(gdev, 0);
184
185 return 0;
186 }
187
188 static int motmdm_gnss_finish(struct gnss_device *gdev)
189 {
190 struct motmdm_gnss_data *ddata = gnss_get_drvdata(gdev);
191 const unsigned char *cmd = "AT+MPDINIT=0";
192 int error;
193
194 error = motmdm_gnss_stop(gdev);
195 if (error < 0)
196 return error;
197
198 return motmdm_gnss_send_command(ddata, cmd, strlen(cmd));
199 }
200
201 static int motmdm_gnss_receive_data(struct gsm_serdev_dlci *dlci,
202 const unsigned char *buf,
203 size_t len)
204 {
205 struct gnss_device *gdev = dlci->drvdata;
206 struct motmdm_gnss_data *ddata = gnss_get_drvdata(gdev);
207 const unsigned char *msg;
208 size_t msglen;
> 209 int error = 0;
210
211 if (len <= MOTMDM_GNSS_RESP_LEN)
212 return 0;
213
214 /* Handle U1234+MPD style command response */
215 if (buf[MOTMDM_GNSS_HEADER_LEN] != '~') {
216 msg = buf + MOTMDM_GNSS_RESP_LEN;
217 strncpy(ddata->buf, msg, len - MOTMDM_GNSS_RESP_LEN);
218 ddata->parsed = true;
219 wake_up(&ddata->read_queue);
220
221 return len;
222 }
223
224 if (len <= MOTMDM_GNSS_DATA_LEN)
225 return 0;
226
227 /* Handle U1234~+MPD style unsolicted message */
228 switch (buf[MOTMDM_GNSS_DATA_LEN]) {
229 case 'N': /* UNNNN~+MPDNMEA=NN, */
230 msg = buf + MOTMDM_GNSS_NMEA_LEN;
231 msglen = len - MOTMDM_GNSS_NMEA_LEN;
232
233 /*
234 * Firmware bug: Strip out extra duplicate line break always
235 * in the data
236 */
237 msglen--;
238
239 /*
240 * Firmware bug: Strip out extra data based on an
241 * earlier line break in the data
242 */
243 if (msg[msglen - 5 - 1] == 0x0a)
244 msglen -= 5;
245
246 error = gnss_insert_raw(gdev, msg, msglen);
247 break;
248 case 'S': /* UNNNN~+MPDSTATUS=N,NN */
249 msg = buf + MOTMDM_GNSS_STATUS_LEN;
250 msglen = len - MOTMDM_GNSS_STATUS_LEN;
251
252 switch (msg[0]) {
253 case '1':
254 ddata->status = MOTMDM_GNSS_INITIALIZED;
255 break;
256 case '2':
257 ddata->status = MOTMDM_GNSS_DATA_OR_TIMEOUT;
258 if (rate_ms < MOTMDM_GNSS_RATE)
259 rate_ms = MOTMDM_GNSS_RATE;
260 if (rate_ms > 16 * MOTMDM_GNSS_RATE)
261 rate_ms = 16 * MOTMDM_GNSS_RATE;
262 motmdm_gnss_start(gdev, rate_ms);
263 break;
264 case '3':
265 ddata->status = MOTMDM_GNSS_STARTED;
266 break;
267 case '4':
268 ddata->status = MOTMDM_GNSS_STOPPED;
269 break;
270 default:
271 ddata->status = MOTMDM_GNSS_UNKNOWN;
272 break;
273 }
274 break;
275 case 'X': /* UNNNN~+MPDXREQ=N for updated xtra2.bin needed */
276 default:
277 break;
278 }
279
280 return len;
281 }
282
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
2 years, 3 months
[ezequielg:rk3288-vp8-h264-encoding-wip 13/14] drivers/staging/media/hantro/hantro_h1_h264_enc.c:717:24: sparse: sparse: incorrect type in assignment (different base types)
by kbuild test robot
tree: git://git.infradead.org/users/ezequielg/linux rk3288-vp8-h264-encoding-wip
head: e1e1beb01eda3ae31a43091e8b4d589d939f8315
commit: 40aa7b09d00ca42666b8c6e91e940ceef33f2b17 [13/14] [HACK] hantro: Add H264 encoding support
config: x86_64-allmodconfig (attached as .config)
compiler: gcc-7 (Ubuntu 7.5.0-6ubuntu2) 7.5.0
reproduce:
# apt-get install sparse
# sparse version: v0.6.1-193-gb8fad4bc-dirty
git checkout 40aa7b09d00ca42666b8c6e91e940ceef33f2b17
# save the attached .config to linux build tree
make W=1 C=1 ARCH=x86_64 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__'
If you fix the issue, kindly add following tag as appropriate
Reported-by: kbuild test robot <lkp(a)intel.com>
sparse warnings: (new ones prefixed by >>)
>> drivers/staging/media/hantro/hantro_h1_h264_enc.c:717:24: sparse: sparse: incorrect type in assignment (different base types) @@ expected unsigned long long [usertype] @@ got nsigned long long [usertype] @@
>> drivers/staging/media/hantro/hantro_h1_h264_enc.c:717:24: sparse: expected unsigned long long [usertype]
>> drivers/staging/media/hantro/hantro_h1_h264_enc.c:717:24: sparse: got restricted __be64 [usertype]
vim +717 drivers/staging/media/hantro/hantro_h1_h264_enc.c
710
711 // TODO: Don't we have some macro for this?
712 static void buffer_cpu_to_be64(u64 *buf, u32 size)
713 {
714 u32 i;
715
716 for (i = 0; i < size; ++i)
> 717 buf[i] = cpu_to_be64(buf[i]);
718 }
719
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
2 years, 3 months
[jkirsher-next-queue:dev-queue 19/99] drivers/net/ethernet/intel/i40e/i40e_xsk.c:234:6: error: redefinition of 'i40e_alloc_rx_buffers_zc'
by kbuild test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/jkirsher/next-queue.git dev-queue
head: 5950d1e508b225372208a78339e6434adf129852
commit: b530c4dd1d0830c45139e65808038373cc54ebc8 [19/99] i40e: trivial fixup of comments in i40e_xsk.c
config: i386-allyesconfig (attached as .config)
compiler: gcc-7 (Ubuntu 7.5.0-6ubuntu2) 7.5.0
reproduce (this is a W=1 build):
git checkout b530c4dd1d0830c45139e65808038373cc54ebc8
# save the attached .config to linux build tree
make ARCH=i386
If you fix the issue, kindly add following tag as appropriate
Reported-by: kbuild test robot <lkp(a)intel.com>
All error/warnings (new ones prefixed by >>, old ones prefixed by <<):
>> drivers/net/ethernet/intel/i40e/i40e_xsk.c:234:6: error: redefinition of 'i40e_alloc_rx_buffers_zc'
bool i40e_alloc_rx_buffers_zc(struct i40e_ring *rx_ring, u16 count)
^~~~~~~~~~~~~~~~~~~~~~~~
drivers/net/ethernet/intel/i40e/i40e_xsk.c:183:6: note: previous definition of 'i40e_alloc_rx_buffers_zc' was here
bool i40e_alloc_rx_buffers_zc(struct i40e_ring *rx_ring, u16 count)
^~~~~~~~~~~~~~~~~~~~~~~~
drivers/net/ethernet/intel/i40e/i40e_xsk.c: In function 'i40e_alloc_rx_buffers_zc':
>> drivers/net/ethernet/intel/i40e/i40e_xsk.c:236:9: error: implicit declaration of function '__i40e_alloc_rx_buffers_zc'; did you mean 'i40e_alloc_rx_buffers_zc'? [-Werror=implicit-function-declaration]
return __i40e_alloc_rx_buffers_zc(rx_ring, count,
^~~~~~~~~~~~~~~~~~~~~~~~~~
i40e_alloc_rx_buffers_zc
>> drivers/net/ethernet/intel/i40e/i40e_xsk.c:237:8: error: 'i40e_alloc_buffer_slow_zc' undeclared (first use in this function); did you mean 'i40e_alloc_rx_buffers_zc'?
i40e_alloc_buffer_slow_zc);
^~~~~~~~~~~~~~~~~~~~~~~~~
i40e_alloc_rx_buffers_zc
drivers/net/ethernet/intel/i40e/i40e_xsk.c:237:8: note: each undeclared identifier is reported only once for each function it appears in
drivers/net/ethernet/intel/i40e/i40e_xsk.c: In function 'i40e_alloc_rx_buffers_fast_zc':
>> drivers/net/ethernet/intel/i40e/i40e_xsk.c:253:8: error: 'i40e_alloc_buffer_zc' undeclared (first use in this function); did you mean 'i40e_alloc_rx_buffers_zc'?
i40e_alloc_buffer_zc);
^~~~~~~~~~~~~~~~~~~~
i40e_alloc_rx_buffers_zc
drivers/net/ethernet/intel/i40e/i40e_xsk.c: In function 'i40e_reuse_rx_buffer_zc':
>> drivers/net/ethernet/intel/i40e/i40e_xsk.c:302:8: error: 'struct i40e_rx_buffer' has no member named 'addr'
new_bi->addr = old_bi->addr;
^~
drivers/net/ethernet/intel/i40e/i40e_xsk.c:302:23: error: 'struct i40e_rx_buffer' has no member named 'addr'
new_bi->addr = old_bi->addr;
^~
>> drivers/net/ethernet/intel/i40e/i40e_xsk.c:303:8: error: 'struct i40e_rx_buffer' has no member named 'handle'
new_bi->handle = old_bi->handle;
^~
drivers/net/ethernet/intel/i40e/i40e_xsk.c:303:25: error: 'struct i40e_rx_buffer' has no member named 'handle'
new_bi->handle = old_bi->handle;
^~
drivers/net/ethernet/intel/i40e/i40e_xsk.c:305:8: error: 'struct i40e_rx_buffer' has no member named 'addr'
old_bi->addr = NULL;
^~
drivers/net/ethernet/intel/i40e/i40e_xsk.c: At top level:
>> drivers/net/ethernet/intel/i40e/i40e_xsk.c:313:6: warning: no previous prototype for 'i40e_zca_free' [-Wmissing-prototypes]
void i40e_zca_free(struct zero_copy_allocator *alloc, unsigned long handle)
^~~~~~~~~~~~~
In file included from include/linux/export.h:43:0,
from include/linux/linkage.h:7,
from include/linux/kernel.h:8,
from include/linux/list.h:9,
from include/linux/timer.h:5,
from include/linux/netdevice.h:24,
from include/trace/events/xdp.h:8,
from include/linux/bpf_trace.h:5,
from drivers/net/ethernet/intel/i40e/i40e_xsk.c:4:
drivers/net/ethernet/intel/i40e/i40e_xsk.c: In function 'i40e_zca_free':
>> include/linux/kernel.h:994:32: error: dereferencing pointer to incomplete type 'struct zero_copy_allocator'
BUILD_BUG_ON_MSG(!__same_type(*(ptr), ((type *)0)->member) && ^~~~~~
include/linux/compiler.h:330:9: note: in definition of macro '__compiletime_assert'
if (!(condition)) ^~~~~~~~~
include/linux/compiler.h:350:2: note: in expansion of macro '_compiletime_assert'
_compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
^~~~~~~~~~~~~~~~~~~
include/linux/build_bug.h:39:37: note: in expansion of macro 'compiletime_assert'
#define BUILD_BUG_ON_MSG(cond, msg) compiletime_assert(!(cond), msg)
^~~~~~~~~~~~~~~~~~
include/linux/kernel.h:994:2: note: in expansion of macro 'BUILD_BUG_ON_MSG'
BUILD_BUG_ON_MSG(!__same_type(*(ptr), ((type *)0)->member) && ^~~~~~~~~~~~~~~~
include/linux/kernel.h:994:20: note: in expansion of macro '__same_type'
BUILD_BUG_ON_MSG(!__same_type(*(ptr), ((type *)0)->member) && ^~~~~~~~~~~
>> drivers/net/ethernet/intel/i40e/i40e_xsk.c:320:12: note: in expansion of macro 'container_of'
rx_ring = container_of(alloc, struct i40e_ring, zca);
^~~~~~~~~~~~
>> include/linux/kernel.h:994:51: error: 'struct i40e_ring' has no member named 'zca'
BUILD_BUG_ON_MSG(!__same_type(*(ptr), ((type *)0)->member) && ^
include/linux/compiler.h:330:9: note: in definition of macro '__compiletime_assert'
if (!(condition)) ^~~~~~~~~
include/linux/compiler.h:350:2: note: in expansion of macro '_compiletime_assert'
_compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
^~~~~~~~~~~~~~~~~~~
include/linux/build_bug.h:39:37: note: in expansion of macro 'compiletime_assert'
#define BUILD_BUG_ON_MSG(cond, msg) compiletime_assert(!(cond), msg)
^~~~~~~~~~~~~~~~~~
include/linux/kernel.h:994:2: note: in expansion of macro 'BUILD_BUG_ON_MSG'
BUILD_BUG_ON_MSG(!__same_type(*(ptr), ((type *)0)->member) && ^~~~~~~~~~~~~~~~
include/linux/kernel.h:994:20: note: in expansion of macro '__same_type'
BUILD_BUG_ON_MSG(!__same_type(*(ptr), ((type *)0)->member) && ^~~~~~~~~~~
>> drivers/net/ethernet/intel/i40e/i40e_xsk.c:320:12: note: in expansion of macro 'container_of'
rx_ring = container_of(alloc, struct i40e_ring, zca);
^~~~~~~~~~~~
In file included from <command-line>:0:0:
>> include/linux/compiler_types.h:129:35: error: 'struct i40e_ring' has no member named 'zca'
#define __compiler_offsetof(a, b) __builtin_offsetof(a, b)
^
include/linux/stddef.h:17:32: note: in expansion of macro '__compiler_offsetof'
#define offsetof(TYPE, MEMBER) __compiler_offsetof(TYPE, MEMBER)
^~~~~~~~~~~~~~~~~~~
include/linux/kernel.h:997:21: note: in expansion of macro 'offsetof'
((type *)(__mptr - offsetof(type, member))); })
^~~~~~~~
>> drivers/net/ethernet/intel/i40e/i40e_xsk.c:320:12: note: in expansion of macro 'container_of'
rx_ring = container_of(alloc, struct i40e_ring, zca);
^~~~~~~~~~~~
>> drivers/net/ethernet/intel/i40e/i40e_xsk.c:322:28: error: 'struct xdp_umem' has no member named 'chunk_mask'; did you mean 'chunk_size'?
mask = rx_ring->xsk_umem->chunk_mask;
^~~~~~~~~~
chunk_size
>> drivers/net/ethernet/intel/i40e/i40e_xsk.c:332:12: error: implicit declaration of function 'xdp_umem_get_dma'; did you mean 'xp_raw_get_dma'? [-Werror=implicit-function-declaration]
bi->dma = xdp_umem_get_dma(rx_ring->xsk_umem, handle);
^~~~~~~~~~~~~~~~
xp_raw_get_dma
drivers/net/ethernet/intel/i40e/i40e_xsk.c:335:4: error: 'struct i40e_rx_buffer' has no member named 'addr'
bi->addr = xdp_umem_get_data(rx_ring->xsk_umem, handle);
^~
>> drivers/net/ethernet/intel/i40e/i40e_xsk.c:335:13: error: implicit declaration of function 'xdp_umem_get_data'; did you mean 'xp_raw_get_data'? [-Werror=implicit-function-declaration]
bi->addr = xdp_umem_get_data(rx_ring->xsk_umem, handle);
^~~~~~~~~~~~~~~~~
xp_raw_get_data
drivers/net/ethernet/intel/i40e/i40e_xsk.c:336:4: error: 'struct i40e_rx_buffer' has no member named 'addr'
bi->addr += hr;
^~
drivers/net/ethernet/intel/i40e/i40e_xsk.c:338:4: error: 'struct i40e_rx_buffer' has no member named 'handle'
bi->handle = xsk_umem_adjust_offset(rx_ring->xsk_umem, (u64)handle,
^~
>> drivers/net/ethernet/intel/i40e/i40e_xsk.c:338:15: error: implicit declaration of function 'xsk_umem_adjust_offset'; did you mean 'vmem_altmap_offset'? [-Werror=implicit-function-declaration]
bi->handle = xsk_umem_adjust_offset(rx_ring->xsk_umem, (u64)handle,
^~~~~~~~~~~~~~~~~~~~~~
vmem_altmap_offset
drivers/net/ethernet/intel/i40e/i40e_xsk.c: In function 'i40e_alloc_rx_buffers_zc':
>> drivers/net/ethernet/intel/i40e/i40e_xsk.c:238:1: warning: control reaches end of non-void function [-Wreturn-type]
}
^
At top level:
drivers/net/ethernet/intel/i40e/i40e_xsk.c:290:13: warning: 'i40e_reuse_rx_buffer_zc' defined but not used [-Wunused-function]
static void i40e_reuse_rx_buffer_zc(struct i40e_ring *rx_ring,
^~~~~~~~~~~~~~~~~~~~~~~
drivers/net/ethernet/intel/i40e/i40e_xsk.c:266:31: warning: 'i40e_get_rx_buffer_zc' defined but not used [-Wunused-function]
static struct i40e_rx_buffer *i40e_get_rx_buffer_zc(struct i40e_ring *rx_ring,
^~~~~~~~~~~~~~~~~~~~~
drivers/net/ethernet/intel/i40e/i40e_xsk.c:250:13: warning: 'i40e_alloc_rx_buffers_fast_zc' defined but not used [-Wunused-function]
static bool i40e_alloc_rx_buffers_fast_zc(struct i40e_ring *rx_ring, u16 count)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cc1: some warnings being treated as errors
vim +/i40e_alloc_rx_buffers_zc +234 drivers/net/ethernet/intel/i40e/i40e_xsk.c
182
> 183 bool i40e_alloc_rx_buffers_zc(struct i40e_ring *rx_ring, u16 count)
184 {
185 u16 ntu = rx_ring->next_to_use;
186 union i40e_rx_desc *rx_desc;
187 struct xdp_buff **bi, *xdp;
188 dma_addr_t dma;
189 bool ok = true;
190
191 rx_desc = I40E_RX_DESC(rx_ring, ntu);
192 bi = i40e_rx_bi(rx_ring, ntu);
193 do {
194 xdp = xsk_buff_alloc(rx_ring->xsk_umem);
195 if (!xdp) {
196 ok = false;
197 goto no_buffers;
198 }
199 *bi = xdp;
200 dma = xsk_buff_xdp_get_dma(xdp);
201 rx_desc->read.pkt_addr = cpu_to_le64(dma);
202 rx_desc->read.hdr_addr = 0;
203
204 rx_desc++;
205 bi++;
206 ntu++;
207
208 if (unlikely(ntu == rx_ring->count)) {
209 rx_desc = I40E_RX_DESC(rx_ring, 0);
210 bi = i40e_rx_bi(rx_ring, 0);
211 ntu = 0;
212 }
213
214 count--;
215 } while (count);
216
217 no_buffers:
218 if (rx_ring->next_to_use != ntu)
219 i40e_release_rx_desc(rx_ring, ntu);
220
221 return ok;
222 }
223
224 /**
225 * i40e_alloc_rx_buffers_zc - Allocates a number of Rx buffers
226 * @rx_ring: Rx ring
227 * @count: The number of buffers to allocate
228 *
229 * This function allocates a number of Rx buffers from the reuse queue
230 * or fill ring and places them on the Rx ring.
231 *
232 * Returns true for a successful allocation, false otherwise
233 **/
> 234 bool i40e_alloc_rx_buffers_zc(struct i40e_ring *rx_ring, u16 count)
235 {
> 236 return __i40e_alloc_rx_buffers_zc(rx_ring, count,
> 237 i40e_alloc_buffer_slow_zc);
> 238 }
239
240 /**
241 * i40e_alloc_rx_buffers_fast_zc - Allocates a number of Rx buffers
242 * @rx_ring: Rx ring
243 * @count: The number of buffers to allocate
244 *
245 * This function allocates a number of Rx buffers from the fill ring
246 * or the internal recycle mechanism and places them on the Rx ring.
247 *
248 * Returns true for a successful allocation, false otherwise
249 **/
250 static bool i40e_alloc_rx_buffers_fast_zc(struct i40e_ring *rx_ring, u16 count)
251 {
252 return __i40e_alloc_rx_buffers_zc(rx_ring, count,
> 253 i40e_alloc_buffer_zc);
254 }
255
256 /**
257 * i40e_get_rx_buffer_zc - Return the current Rx buffer
258 * @rx_ring: Rx ring
259 * @size: The size of the rx buffer (read from descriptor)
260 *
261 * This function returns the current, received Rx buffer, and also
262 * does DMA synchronization. the Rx ring.
263 *
264 * Returns the received Rx buffer
265 **/
266 static struct i40e_rx_buffer *i40e_get_rx_buffer_zc(struct i40e_ring *rx_ring,
267 const unsigned int size)
268 {
269 struct i40e_rx_buffer *bi;
270
271 bi = &rx_ring->rx_bi[rx_ring->next_to_clean];
272
273 /* we are reusing so sync this buffer for CPU use */
274 dma_sync_single_range_for_cpu(rx_ring->dev,
275 bi->dma, 0,
276 size,
277 DMA_BIDIRECTIONAL);
278
279 return bi;
280 }
281
282 /**
283 * i40e_reuse_rx_buffer_zc - Recycle an Rx buffer
284 * @rx_ring: Rx ring
285 * @old_bi: The Rx buffer to recycle
286 *
287 * This function recycles a finished Rx buffer, and places it on the
288 * recycle queue (next_to_alloc).
289 **/
290 static void i40e_reuse_rx_buffer_zc(struct i40e_ring *rx_ring,
291 struct i40e_rx_buffer *old_bi)
292 {
293 struct i40e_rx_buffer *new_bi = &rx_ring->rx_bi[rx_ring->next_to_alloc];
294 u16 nta = rx_ring->next_to_alloc;
295
296 /* update, and store next to alloc */
297 nta++;
298 rx_ring->next_to_alloc = (nta < rx_ring->count) ? nta : 0;
299
300 /* transfer page from old buffer to new buffer */
301 new_bi->dma = old_bi->dma;
> 302 new_bi->addr = old_bi->addr;
> 303 new_bi->handle = old_bi->handle;
304
305 old_bi->addr = NULL;
306 }
307
308 /**
309 * i40e_zca_free - Free callback for MEM_TYPE_ZERO_COPY allocations
310 * @alloc: Zero-copy allocator
311 * @handle: Buffer handle
312 **/
> 313 void i40e_zca_free(struct zero_copy_allocator *alloc, unsigned long handle)
314 {
315 struct i40e_rx_buffer *bi;
316 struct i40e_ring *rx_ring;
317 u64 hr, mask;
318 u16 nta;
319
> 320 rx_ring = container_of(alloc, struct i40e_ring, zca);
321 hr = rx_ring->xsk_umem->headroom + XDP_PACKET_HEADROOM;
> 322 mask = rx_ring->xsk_umem->chunk_mask;
323
324 nta = rx_ring->next_to_alloc;
325 bi = &rx_ring->rx_bi[nta];
326
327 nta++;
328 rx_ring->next_to_alloc = (nta < rx_ring->count) ? nta : 0;
329
330 handle &= mask;
331
> 332 bi->dma = xdp_umem_get_dma(rx_ring->xsk_umem, handle);
333 bi->dma += hr;
334
> 335 bi->addr = xdp_umem_get_data(rx_ring->xsk_umem, handle);
> 336 bi->addr += hr;
337
> 338 bi->handle = xsk_umem_adjust_offset(rx_ring->xsk_umem, (u64)handle,
339 rx_ring->xsk_umem->headroom);
340 }
341
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
2 years, 3 months
[linux-next:master 5095/12102] net/ipv4/tcp_output.c:188:3: warning: result of comparison of constant -1 with expression of type 'u8' (aka 'unsigned char') is always false
by kbuild test robot
Hi Eric,
FYI, the error/warning still remains.
tree: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head: c11d28ab4a691736e30b49813fb801847bd44e83
commit: 2b195850128f5bafde177b12489d9fa27962cc1e [5095/12102] tcp: add tp->dup_ack_counter
config: x86_64-randconfig-a002-20200524 (attached as .config)
compiler: clang version 11.0.0 (https://github.com/llvm/llvm-project 3393cc4cebf9969db94dc424b7a2b6195589c33b)
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
# install x86_64 cross compiling tool for clang build
# apt-get install binutils-x86-64-linux-gnu
git checkout 2b195850128f5bafde177b12489d9fa27962cc1e
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=x86_64
If you fix the issue, kindly add following tag as appropriate
Reported-by: kbuild test robot <lkp(a)intel.com>
All warnings (new ones prefixed by >>, old ones prefixed by <<):
>> net/ipv4/tcp_output.c:188:3: warning: result of comparison of constant -1 with expression of type 'u8' (aka 'unsigned char') is always false [-Wtautological-constant-out-of-range-compare]
NET_ADD_STATS(sock_net(sk), LINUX_MIB_TCPACKCOMPRESSED,
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/net/ip.h:293:41: note: expanded from macro 'NET_ADD_STATS'
#define NET_ADD_STATS(net, field, adnd) SNMP_ADD_STATS((net)->mib.net_statistics, field, adnd)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/net/snmp.h:143:4: note: expanded from macro 'SNMP_ADD_STATS'
this_cpu_add(mib->mibs[field], addend)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/percpu-defs.h:509:33: note: expanded from macro 'this_cpu_add'
#define this_cpu_add(pcp, val) __pcpu_size_call(this_cpu_add_, pcp, val)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
note: (skipping 1 expansions in backtrace; use -fmacro-backtrace-limit=0 to see all)
<scratch space>:160:1: note: expanded from here
this_cpu_add_8
^
arch/x86/include/asm/percpu.h:492:35: note: expanded from macro 'this_cpu_add_8'
#define this_cpu_add_8(pcp, val) percpu_add_op(volatile, (pcp), val)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
arch/x86/include/asm/percpu.h:131:31: note: expanded from macro 'percpu_add_op'
((val) == 1 || (val) == -1)) ? ~~~~~ ^ ~~
1 warning generated.
vim +188 net/ipv4/tcp_output.c
^1da177e4c3f41 Linus Torvalds 2005-04-16 180
67edfef7863957 Andi Kleen 2009-07-21 181 /* Account for an ACK we sent. */
27cde44a259c38 Yuchung Cheng 2018-07-18 182 static inline void tcp_event_ack_sent(struct sock *sk, unsigned int pkts,
27cde44a259c38 Yuchung Cheng 2018-07-18 183 u32 rcv_nxt)
^1da177e4c3f41 Linus Torvalds 2005-04-16 184 {
5d9f4262b7ea41 Eric Dumazet 2018-05-17 185 struct tcp_sock *tp = tcp_sk(sk);
5d9f4262b7ea41 Eric Dumazet 2018-05-17 186
2b195850128f5b Eric Dumazet 2020-04-30 187 if (unlikely(tp->compressed_ack)) {
200d95f4575934 Eric Dumazet 2018-05-17 @188 NET_ADD_STATS(sock_net(sk), LINUX_MIB_TCPACKCOMPRESSED,
2b195850128f5b Eric Dumazet 2020-04-30 189 tp->compressed_ack);
2b195850128f5b Eric Dumazet 2020-04-30 190 tp->compressed_ack = 0;
5d9f4262b7ea41 Eric Dumazet 2018-05-17 191 if (hrtimer_try_to_cancel(&tp->compressed_ack_timer) == 1)
5d9f4262b7ea41 Eric Dumazet 2018-05-17 192 __sock_put(sk);
5d9f4262b7ea41 Eric Dumazet 2018-05-17 193 }
27cde44a259c38 Yuchung Cheng 2018-07-18 194
27cde44a259c38 Yuchung Cheng 2018-07-18 195 if (unlikely(rcv_nxt != tp->rcv_nxt))
27cde44a259c38 Yuchung Cheng 2018-07-18 196 return; /* Special ACK sent by DCTCP to reflect ECN */
463c84b97f2401 Arnaldo Carvalho de Melo 2005-08-09 197 tcp_dec_quickack_mode(sk, pkts);
463c84b97f2401 Arnaldo Carvalho de Melo 2005-08-09 198 inet_csk_clear_xmit_timer(sk, ICSK_TIME_DACK);
^1da177e4c3f41 Linus Torvalds 2005-04-16 199 }
^1da177e4c3f41 Linus Torvalds 2005-04-16 200
:::::: The code at line 188 was first introduced by commit
:::::: 200d95f4575934e49f872109cce18c5e72383eb8 tcp: add TCPAckCompressed SNMP counter
:::::: TO: Eric Dumazet <edumazet(a)google.com>
:::::: CC: David S. Miller <davem(a)davemloft.net>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
2 years, 3 months
[jkirsher-next-queue:dev-queue 9/99] drivers/net/ethernet/intel/ice/ice_common.c:1770:7: warning: this statement may fall through
by kbuild test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/jkirsher/next-queue.git dev-queue
head: 5950d1e508b225372208a78339e6434adf129852
commit: 71c1f807aa1ff02f44b51234fb57c1b6f0eea872 [9/99] ice: Create and register virtual bus for RDMA
config: i386-allyesconfig (attached as .config)
compiler: gcc-7 (Ubuntu 7.5.0-6ubuntu2) 7.5.0
reproduce (this is a W=1 build):
git checkout 71c1f807aa1ff02f44b51234fb57c1b6f0eea872
# save the attached .config to linux build tree
make ARCH=i386
If you fix the issue, kindly add following tag as appropriate
Reported-by: kbuild test robot <lkp(a)intel.com>
All warnings (new ones prefixed by >>, old ones prefixed by <<):
drivers/net/ethernet/intel/ice/ice_common.c: In function 'ice_parse_caps':
>> drivers/net/ethernet/intel/ice/ice_common.c:1770:7: warning: this statement may fall through [-Wimplicit-fallthrough=]
if (func_p) {
^
drivers/net/ethernet/intel/ice/ice_common.c:1788:3: note: here
case ICE_AQC_CAPS_IWARP:
^~~~
vim +1770 drivers/net/ethernet/intel/ice/ice_common.c
995c90f2de819b Anirudh Venkataramanan 2018-10-26 1613
9c20346b6309e2 Anirudh Venkataramanan 2018-03-20 1614 /**
9c20346b6309e2 Anirudh Venkataramanan 2018-03-20 1615 * ice_parse_caps - parse function/device capabilities
f9867df6d96593 Anirudh Venkataramanan 2019-02-19 1616 * @hw: pointer to the HW struct
9c20346b6309e2 Anirudh Venkataramanan 2018-03-20 1617 * @buf: pointer to a buffer containing function/device capability records
9c20346b6309e2 Anirudh Venkataramanan 2018-03-20 1618 * @cap_count: number of capability records in the list
9c20346b6309e2 Anirudh Venkataramanan 2018-03-20 1619 * @opc: type of capabilities list to parse
9c20346b6309e2 Anirudh Venkataramanan 2018-03-20 1620 *
9c20346b6309e2 Anirudh Venkataramanan 2018-03-20 1621 * Helper function to parse function(0x000a)/device(0x000b) capabilities list.
9c20346b6309e2 Anirudh Venkataramanan 2018-03-20 1622 */
9c20346b6309e2 Anirudh Venkataramanan 2018-03-20 1623 static void
9c20346b6309e2 Anirudh Venkataramanan 2018-03-20 1624 ice_parse_caps(struct ice_hw *hw, void *buf, u32 cap_count,
9c20346b6309e2 Anirudh Venkataramanan 2018-03-20 1625 enum ice_adminq_opc opc)
9c20346b6309e2 Anirudh Venkataramanan 2018-03-20 1626 {
9c20346b6309e2 Anirudh Venkataramanan 2018-03-20 1627 struct ice_aqc_list_caps_elem *cap_resp;
9c20346b6309e2 Anirudh Venkataramanan 2018-03-20 1628 struct ice_hw_func_caps *func_p = NULL;
9c20346b6309e2 Anirudh Venkataramanan 2018-03-20 1629 struct ice_hw_dev_caps *dev_p = NULL;
9c20346b6309e2 Anirudh Venkataramanan 2018-03-20 1630 struct ice_hw_common_caps *caps;
a84db52569ddef Anirudh Venkataramanan 2019-04-16 1631 char const *prefix;
9c20346b6309e2 Anirudh Venkataramanan 2018-03-20 1632 u32 i;
9c20346b6309e2 Anirudh Venkataramanan 2018-03-20 1633
9c20346b6309e2 Anirudh Venkataramanan 2018-03-20 1634 if (!buf)
9c20346b6309e2 Anirudh Venkataramanan 2018-03-20 1635 return;
9c20346b6309e2 Anirudh Venkataramanan 2018-03-20 1636
9c20346b6309e2 Anirudh Venkataramanan 2018-03-20 1637 cap_resp = (struct ice_aqc_list_caps_elem *)buf;
9c20346b6309e2 Anirudh Venkataramanan 2018-03-20 1638
9c20346b6309e2 Anirudh Venkataramanan 2018-03-20 1639 if (opc == ice_aqc_opc_list_dev_caps) {
9c20346b6309e2 Anirudh Venkataramanan 2018-03-20 1640 dev_p = &hw->dev_caps;
9c20346b6309e2 Anirudh Venkataramanan 2018-03-20 1641 caps = &dev_p->common_cap;
a84db52569ddef Anirudh Venkataramanan 2019-04-16 1642 prefix = "dev cap";
9c20346b6309e2 Anirudh Venkataramanan 2018-03-20 1643 } else if (opc == ice_aqc_opc_list_func_caps) {
9c20346b6309e2 Anirudh Venkataramanan 2018-03-20 1644 func_p = &hw->func_caps;
9c20346b6309e2 Anirudh Venkataramanan 2018-03-20 1645 caps = &func_p->common_cap;
a84db52569ddef Anirudh Venkataramanan 2019-04-16 1646 prefix = "func cap";
9c20346b6309e2 Anirudh Venkataramanan 2018-03-20 1647 } else {
9c20346b6309e2 Anirudh Venkataramanan 2018-03-20 1648 ice_debug(hw, ICE_DBG_INIT, "wrong opcode\n");
9c20346b6309e2 Anirudh Venkataramanan 2018-03-20 1649 return;
9c20346b6309e2 Anirudh Venkataramanan 2018-03-20 1650 }
9c20346b6309e2 Anirudh Venkataramanan 2018-03-20 1651
9c20346b6309e2 Anirudh Venkataramanan 2018-03-20 1652 for (i = 0; caps && i < cap_count; i++, cap_resp++) {
9c20346b6309e2 Anirudh Venkataramanan 2018-03-20 1653 u32 logical_id = le32_to_cpu(cap_resp->logical_id);
9c20346b6309e2 Anirudh Venkataramanan 2018-03-20 1654 u32 phys_id = le32_to_cpu(cap_resp->phys_id);
9c20346b6309e2 Anirudh Venkataramanan 2018-03-20 1655 u32 number = le32_to_cpu(cap_resp->number);
9c20346b6309e2 Anirudh Venkataramanan 2018-03-20 1656 u16 cap = le16_to_cpu(cap_resp->cap);
9c20346b6309e2 Anirudh Venkataramanan 2018-03-20 1657
9c20346b6309e2 Anirudh Venkataramanan 2018-03-20 1658 switch (cap) {
995c90f2de819b Anirudh Venkataramanan 2018-10-26 1659 case ICE_AQC_CAPS_VALID_FUNCTIONS:
995c90f2de819b Anirudh Venkataramanan 2018-10-26 1660 caps->valid_functions = number;
995c90f2de819b Anirudh Venkataramanan 2018-10-26 1661 ice_debug(hw, ICE_DBG_INIT,
5c875c1af8dc69 Anirudh Venkataramanan 2019-09-03 1662 "%s: valid_functions (bitmap) = %d\n", prefix,
995c90f2de819b Anirudh Venkataramanan 2018-10-26 1663 caps->valid_functions);
eae1bbb2a4519a Bruce Allan 2019-11-08 1664
eae1bbb2a4519a Bruce Allan 2019-11-08 1665 /* store func count for resource management purposes */
eae1bbb2a4519a Bruce Allan 2019-11-08 1666 if (dev_p)
eae1bbb2a4519a Bruce Allan 2019-11-08 1667 dev_p->num_funcs = hweight32(number);
995c90f2de819b Anirudh Venkataramanan 2018-10-26 1668 break;
75d2b253026b8b Anirudh Venkataramanan 2018-09-19 1669 case ICE_AQC_CAPS_SRIOV:
75d2b253026b8b Anirudh Venkataramanan 2018-09-19 1670 caps->sr_iov_1_1 = (number == 1);
75d2b253026b8b Anirudh Venkataramanan 2018-09-19 1671 ice_debug(hw, ICE_DBG_INIT,
5c875c1af8dc69 Anirudh Venkataramanan 2019-09-03 1672 "%s: sr_iov_1_1 = %d\n", prefix,
a84db52569ddef Anirudh Venkataramanan 2019-04-16 1673 caps->sr_iov_1_1);
75d2b253026b8b Anirudh Venkataramanan 2018-09-19 1674 break;
75d2b253026b8b Anirudh Venkataramanan 2018-09-19 1675 case ICE_AQC_CAPS_VF:
75d2b253026b8b Anirudh Venkataramanan 2018-09-19 1676 if (dev_p) {
75d2b253026b8b Anirudh Venkataramanan 2018-09-19 1677 dev_p->num_vfs_exposed = number;
75d2b253026b8b Anirudh Venkataramanan 2018-09-19 1678 ice_debug(hw, ICE_DBG_INIT,
5c875c1af8dc69 Anirudh Venkataramanan 2019-09-03 1679 "%s: num_vfs_exposed = %d\n", prefix,
75d2b253026b8b Anirudh Venkataramanan 2018-09-19 1680 dev_p->num_vfs_exposed);
75d2b253026b8b Anirudh Venkataramanan 2018-09-19 1681 } else if (func_p) {
75d2b253026b8b Anirudh Venkataramanan 2018-09-19 1682 func_p->num_allocd_vfs = number;
75d2b253026b8b Anirudh Venkataramanan 2018-09-19 1683 func_p->vf_base_id = logical_id;
75d2b253026b8b Anirudh Venkataramanan 2018-09-19 1684 ice_debug(hw, ICE_DBG_INIT,
5c875c1af8dc69 Anirudh Venkataramanan 2019-09-03 1685 "%s: num_allocd_vfs = %d\n", prefix,
75d2b253026b8b Anirudh Venkataramanan 2018-09-19 1686 func_p->num_allocd_vfs);
75d2b253026b8b Anirudh Venkataramanan 2018-09-19 1687 ice_debug(hw, ICE_DBG_INIT,
5c875c1af8dc69 Anirudh Venkataramanan 2019-09-03 1688 "%s: vf_base_id = %d\n", prefix,
75d2b253026b8b Anirudh Venkataramanan 2018-09-19 1689 func_p->vf_base_id);
75d2b253026b8b Anirudh Venkataramanan 2018-09-19 1690 }
75d2b253026b8b Anirudh Venkataramanan 2018-09-19 1691 break;
9c20346b6309e2 Anirudh Venkataramanan 2018-03-20 1692 case ICE_AQC_CAPS_VSI:
9c20346b6309e2 Anirudh Venkataramanan 2018-03-20 1693 if (dev_p) {
9c20346b6309e2 Anirudh Venkataramanan 2018-03-20 1694 dev_p->num_vsi_allocd_to_host = number;
9c20346b6309e2 Anirudh Venkataramanan 2018-03-20 1695 ice_debug(hw, ICE_DBG_INIT,
5c875c1af8dc69 Anirudh Venkataramanan 2019-09-03 1696 "%s: num_vsi_allocd_to_host = %d\n",
a84db52569ddef Anirudh Venkataramanan 2019-04-16 1697 prefix,
9c20346b6309e2 Anirudh Venkataramanan 2018-03-20 1698 dev_p->num_vsi_allocd_to_host);
9c20346b6309e2 Anirudh Venkataramanan 2018-03-20 1699 } else if (func_p) {
7a1f7111754020 Brett Creeley 2019-02-08 1700 func_p->guar_num_vsi =
7a1f7111754020 Brett Creeley 2019-02-08 1701 ice_get_num_per_func(hw, ICE_MAX_VSI);
9c20346b6309e2 Anirudh Venkataramanan 2018-03-20 1702 ice_debug(hw, ICE_DBG_INIT,
5c875c1af8dc69 Anirudh Venkataramanan 2019-09-03 1703 "%s: guar_num_vsi (fw) = %d\n",
a84db52569ddef Anirudh Venkataramanan 2019-04-16 1704 prefix, number);
a84db52569ddef Anirudh Venkataramanan 2019-04-16 1705 ice_debug(hw, ICE_DBG_INIT,
5c875c1af8dc69 Anirudh Venkataramanan 2019-09-03 1706 "%s: guar_num_vsi = %d\n",
a84db52569ddef Anirudh Venkataramanan 2019-04-16 1707 prefix, func_p->guar_num_vsi);
9c20346b6309e2 Anirudh Venkataramanan 2018-03-20 1708 }
9c20346b6309e2 Anirudh Venkataramanan 2018-03-20 1709 break;
a257f188b72bf0 Usha Ketineni 2019-08-08 1710 case ICE_AQC_CAPS_DCB:
a257f188b72bf0 Usha Ketineni 2019-08-08 1711 caps->dcb = (number == 1);
a257f188b72bf0 Usha Ketineni 2019-08-08 1712 caps->active_tc_bitmap = logical_id;
a257f188b72bf0 Usha Ketineni 2019-08-08 1713 caps->maxtc = phys_id;
a257f188b72bf0 Usha Ketineni 2019-08-08 1714 ice_debug(hw, ICE_DBG_INIT,
5c875c1af8dc69 Anirudh Venkataramanan 2019-09-03 1715 "%s: dcb = %d\n", prefix, caps->dcb);
a257f188b72bf0 Usha Ketineni 2019-08-08 1716 ice_debug(hw, ICE_DBG_INIT,
5c875c1af8dc69 Anirudh Venkataramanan 2019-09-03 1717 "%s: active_tc_bitmap = %d\n", prefix,
a257f188b72bf0 Usha Ketineni 2019-08-08 1718 caps->active_tc_bitmap);
a257f188b72bf0 Usha Ketineni 2019-08-08 1719 ice_debug(hw, ICE_DBG_INIT,
5c875c1af8dc69 Anirudh Venkataramanan 2019-09-03 1720 "%s: maxtc = %d\n", prefix, caps->maxtc);
a257f188b72bf0 Usha Ketineni 2019-08-08 1721 break;
9c20346b6309e2 Anirudh Venkataramanan 2018-03-20 1722 case ICE_AQC_CAPS_RSS:
9c20346b6309e2 Anirudh Venkataramanan 2018-03-20 1723 caps->rss_table_size = number;
9c20346b6309e2 Anirudh Venkataramanan 2018-03-20 1724 caps->rss_table_entry_width = logical_id;
9c20346b6309e2 Anirudh Venkataramanan 2018-03-20 1725 ice_debug(hw, ICE_DBG_INIT,
5c875c1af8dc69 Anirudh Venkataramanan 2019-09-03 1726 "%s: rss_table_size = %d\n", prefix,
9c20346b6309e2 Anirudh Venkataramanan 2018-03-20 1727 caps->rss_table_size);
9c20346b6309e2 Anirudh Venkataramanan 2018-03-20 1728 ice_debug(hw, ICE_DBG_INIT,
5c875c1af8dc69 Anirudh Venkataramanan 2019-09-03 1729 "%s: rss_table_entry_width = %d\n", prefix,
9c20346b6309e2 Anirudh Venkataramanan 2018-03-20 1730 caps->rss_table_entry_width);
9c20346b6309e2 Anirudh Venkataramanan 2018-03-20 1731 break;
9c20346b6309e2 Anirudh Venkataramanan 2018-03-20 1732 case ICE_AQC_CAPS_RXQS:
9c20346b6309e2 Anirudh Venkataramanan 2018-03-20 1733 caps->num_rxq = number;
9c20346b6309e2 Anirudh Venkataramanan 2018-03-20 1734 caps->rxq_first_id = phys_id;
9c20346b6309e2 Anirudh Venkataramanan 2018-03-20 1735 ice_debug(hw, ICE_DBG_INIT,
5c875c1af8dc69 Anirudh Venkataramanan 2019-09-03 1736 "%s: num_rxq = %d\n", prefix,
a84db52569ddef Anirudh Venkataramanan 2019-04-16 1737 caps->num_rxq);
9c20346b6309e2 Anirudh Venkataramanan 2018-03-20 1738 ice_debug(hw, ICE_DBG_INIT,
5c875c1af8dc69 Anirudh Venkataramanan 2019-09-03 1739 "%s: rxq_first_id = %d\n", prefix,
9c20346b6309e2 Anirudh Venkataramanan 2018-03-20 1740 caps->rxq_first_id);
9c20346b6309e2 Anirudh Venkataramanan 2018-03-20 1741 break;
9c20346b6309e2 Anirudh Venkataramanan 2018-03-20 1742 case ICE_AQC_CAPS_TXQS:
9c20346b6309e2 Anirudh Venkataramanan 2018-03-20 1743 caps->num_txq = number;
9c20346b6309e2 Anirudh Venkataramanan 2018-03-20 1744 caps->txq_first_id = phys_id;
9c20346b6309e2 Anirudh Venkataramanan 2018-03-20 1745 ice_debug(hw, ICE_DBG_INIT,
5c875c1af8dc69 Anirudh Venkataramanan 2019-09-03 1746 "%s: num_txq = %d\n", prefix,
a84db52569ddef Anirudh Venkataramanan 2019-04-16 1747 caps->num_txq);
9c20346b6309e2 Anirudh Venkataramanan 2018-03-20 1748 ice_debug(hw, ICE_DBG_INIT,
5c875c1af8dc69 Anirudh Venkataramanan 2019-09-03 1749 "%s: txq_first_id = %d\n", prefix,
9c20346b6309e2 Anirudh Venkataramanan 2018-03-20 1750 caps->txq_first_id);
9c20346b6309e2 Anirudh Venkataramanan 2018-03-20 1751 break;
9c20346b6309e2 Anirudh Venkataramanan 2018-03-20 1752 case ICE_AQC_CAPS_MSIX:
9c20346b6309e2 Anirudh Venkataramanan 2018-03-20 1753 caps->num_msix_vectors = number;
9c20346b6309e2 Anirudh Venkataramanan 2018-03-20 1754 caps->msix_vector_first_id = phys_id;
9c20346b6309e2 Anirudh Venkataramanan 2018-03-20 1755 ice_debug(hw, ICE_DBG_INIT,
5c875c1af8dc69 Anirudh Venkataramanan 2019-09-03 1756 "%s: num_msix_vectors = %d\n", prefix,
9c20346b6309e2 Anirudh Venkataramanan 2018-03-20 1757 caps->num_msix_vectors);
9c20346b6309e2 Anirudh Venkataramanan 2018-03-20 1758 ice_debug(hw, ICE_DBG_INIT,
5c875c1af8dc69 Anirudh Venkataramanan 2019-09-03 1759 "%s: msix_vector_first_id = %d\n", prefix,
9c20346b6309e2 Anirudh Venkataramanan 2018-03-20 1760 caps->msix_vector_first_id);
9c20346b6309e2 Anirudh Venkataramanan 2018-03-20 1761 break;
148beb61203125 Henry Tieman 2020-05-11 1762 case ICE_AQC_CAPS_FD:
148beb61203125 Henry Tieman 2020-05-11 1763 if (dev_p) {
148beb61203125 Henry Tieman 2020-05-11 1764 dev_p->num_flow_director_fltr = number;
148beb61203125 Henry Tieman 2020-05-11 1765 ice_debug(hw, ICE_DBG_INIT,
148beb61203125 Henry Tieman 2020-05-11 1766 "%s: num_flow_director_fltr = %d\n",
148beb61203125 Henry Tieman 2020-05-11 1767 prefix,
148beb61203125 Henry Tieman 2020-05-11 1768 dev_p->num_flow_director_fltr);
148beb61203125 Henry Tieman 2020-05-11 1769 }
148beb61203125 Henry Tieman 2020-05-11 @1770 if (func_p) {
148beb61203125 Henry Tieman 2020-05-11 1771 u32 reg_val, val;
148beb61203125 Henry Tieman 2020-05-11 1772
148beb61203125 Henry Tieman 2020-05-11 1773 reg_val = rd32(hw, GLQF_FD_SIZE);
148beb61203125 Henry Tieman 2020-05-11 1774 val = (reg_val & GLQF_FD_SIZE_FD_GSIZE_M) >>
148beb61203125 Henry Tieman 2020-05-11 1775 GLQF_FD_SIZE_FD_GSIZE_S;
148beb61203125 Henry Tieman 2020-05-11 1776 func_p->fd_fltr_guar =
148beb61203125 Henry Tieman 2020-05-11 1777 ice_get_num_per_func(hw, val);
148beb61203125 Henry Tieman 2020-05-11 1778 val = (reg_val & GLQF_FD_SIZE_FD_BSIZE_M) >>
148beb61203125 Henry Tieman 2020-05-11 1779 GLQF_FD_SIZE_FD_BSIZE_S;
148beb61203125 Henry Tieman 2020-05-11 1780 func_p->fd_fltr_best_effort = val;
148beb61203125 Henry Tieman 2020-05-11 1781 ice_debug(hw, ICE_DBG_INIT,
148beb61203125 Henry Tieman 2020-05-11 1782 "%s: fd_fltr_guar = %d\n",
148beb61203125 Henry Tieman 2020-05-11 1783 prefix, func_p->fd_fltr_guar);
148beb61203125 Henry Tieman 2020-05-11 1784 ice_debug(hw, ICE_DBG_INIT,
148beb61203125 Henry Tieman 2020-05-11 1785 "%s: fd_fltr_best_effort = %d\n",
148beb61203125 Henry Tieman 2020-05-11 1786 prefix, func_p->fd_fltr_best_effort);
148beb61203125 Henry Tieman 2020-05-11 1787 }
71c1f807aa1ff0 Dave Ertman 2020-05-04 1788 case ICE_AQC_CAPS_IWARP:
71c1f807aa1ff0 Dave Ertman 2020-05-04 1789 caps->iwarp = (number == 1);
71c1f807aa1ff0 Dave Ertman 2020-05-04 1790 ice_debug(hw, ICE_DBG_INIT,
71c1f807aa1ff0 Dave Ertman 2020-05-04 1791 "%s: iwarp = %d\n", prefix, caps->iwarp);
148beb61203125 Henry Tieman 2020-05-11 1792 break;
9c20346b6309e2 Anirudh Venkataramanan 2018-03-20 1793 case ICE_AQC_CAPS_MAX_MTU:
9c20346b6309e2 Anirudh Venkataramanan 2018-03-20 1794 caps->max_mtu = number;
5c875c1af8dc69 Anirudh Venkataramanan 2019-09-03 1795 ice_debug(hw, ICE_DBG_INIT, "%s: max_mtu = %d\n",
a84db52569ddef Anirudh Venkataramanan 2019-04-16 1796 prefix, caps->max_mtu);
9c20346b6309e2 Anirudh Venkataramanan 2018-03-20 1797 break;
9c20346b6309e2 Anirudh Venkataramanan 2018-03-20 1798 default:
9c20346b6309e2 Anirudh Venkataramanan 2018-03-20 1799 ice_debug(hw, ICE_DBG_INIT,
a84db52569ddef Anirudh Venkataramanan 2019-04-16 1800 "%s: unknown capability[%d]: 0x%x\n", prefix,
a84db52569ddef Anirudh Venkataramanan 2019-04-16 1801 i, cap);
9c20346b6309e2 Anirudh Venkataramanan 2018-03-20 1802 break;
9c20346b6309e2 Anirudh Venkataramanan 2018-03-20 1803 }
9c20346b6309e2 Anirudh Venkataramanan 2018-03-20 1804 }
9164f761c99493 Bruce Allan 2019-11-08 1805
9164f761c99493 Bruce Allan 2019-11-08 1806 /* Re-calculate capabilities that are dependent on the number of
9164f761c99493 Bruce Allan 2019-11-08 1807 * physical ports; i.e. some features are not supported or function
9164f761c99493 Bruce Allan 2019-11-08 1808 * differently on devices with more than 4 ports.
9164f761c99493 Bruce Allan 2019-11-08 1809 */
9164f761c99493 Bruce Allan 2019-11-08 1810 if (hw->dev_caps.num_funcs > 4) {
9164f761c99493 Bruce Allan 2019-11-08 1811 /* Max 4 TCs per port */
9164f761c99493 Bruce Allan 2019-11-08 1812 caps->maxtc = 4;
9164f761c99493 Bruce Allan 2019-11-08 1813 ice_debug(hw, ICE_DBG_INIT,
9164f761c99493 Bruce Allan 2019-11-08 1814 "%s: maxtc = %d (based on #ports)\n", prefix,
9164f761c99493 Bruce Allan 2019-11-08 1815 caps->maxtc);
71c1f807aa1ff0 Dave Ertman 2020-05-04 1816 if (caps->iwarp) {
71c1f807aa1ff0 Dave Ertman 2020-05-04 1817 ice_debug(hw, ICE_DBG_INIT, "%s: forcing RDMA off\n",
71c1f807aa1ff0 Dave Ertman 2020-05-04 1818 prefix);
71c1f807aa1ff0 Dave Ertman 2020-05-04 1819 caps->iwarp = 0;
71c1f807aa1ff0 Dave Ertman 2020-05-04 1820 }
71c1f807aa1ff0 Dave Ertman 2020-05-04 1821
71c1f807aa1ff0 Dave Ertman 2020-05-04 1822 /* print message only when processing device capabilities */
71c1f807aa1ff0 Dave Ertman 2020-05-04 1823 if (dev_p)
71c1f807aa1ff0 Dave Ertman 2020-05-04 1824 dev_info(ice_hw_to_dev(hw),
71c1f807aa1ff0 Dave Ertman 2020-05-04 1825 "RDMA functionality is not available with the current device configuration.\n");
9164f761c99493 Bruce Allan 2019-11-08 1826 }
9c20346b6309e2 Anirudh Venkataramanan 2018-03-20 1827 }
9c20346b6309e2 Anirudh Venkataramanan 2018-03-20 1828
:::::: The code at line 1770 was first introduced by commit
:::::: 148beb612031255156d68b342170140524afb36e ice: Initialize Flow Director resources
:::::: TO: Henry Tieman <henry.w.tieman(a)intel.com>
:::::: CC: Jeff Kirsher <jeffrey.t.kirsher(a)intel.com>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
2 years, 3 months
[peterz-queue:locking/kcsan 12/21] drivers/hwmon/xgene-hwmon.c:126:9: sparse: sparse: incorrect type in assignment (different base types)
by kbuild test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/peterz/queue.git locking/kcsan
head: ffed638b6a2180da8fd002a46632d746af72b299
commit: bbfa112b46bdbbdfc2f5bfb9c2dcbef780ff6417 [12/21] READ_ONCE: Simplify implementations of {READ,WRITE}_ONCE()
config: x86_64-allmodconfig (attached as .config)
compiler: gcc-7 (Ubuntu 7.5.0-6ubuntu2) 7.5.0
reproduce:
# apt-get install sparse
# sparse version: v0.6.1-193-gb8fad4bc-dirty
git checkout bbfa112b46bdbbdfc2f5bfb9c2dcbef780ff6417
# save the attached .config to linux build tree
make W=1 C=1 ARCH=x86_64 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__'
If you fix the issue, kindly add following tag as appropriate
Reported-by: kbuild test robot <lkp(a)intel.com>
sparse warnings: (new ones prefixed by >>)
drivers/hwmon/xgene-hwmon.c:123:15: sparse: sparse: cast to restricted __le16
>> drivers/hwmon/xgene-hwmon.c:126:9: sparse: sparse: incorrect type in assignment (different base types) @@ expected unsigned short volatile @@ got restrunsigned short volatile @@
drivers/hwmon/xgene-hwmon.c:126:9: sparse: expected unsigned short volatile
drivers/hwmon/xgene-hwmon.c:126:9: sparse: got restricted __le16 [usertype]
>> drivers/hwmon/xgene-hwmon.c:143:9: sparse: sparse: incorrect type in assignment (different base types) @@ expected unsigned int volatile @@ got restricunsigned int volatile @@
drivers/hwmon/xgene-hwmon.c:143:9: sparse: expected unsigned int volatile
drivers/hwmon/xgene-hwmon.c:143:9: sparse: got restricted __le32 [usertype]
drivers/hwmon/xgene-hwmon.c:147:9: sparse: sparse: incorrect type in assignment (different base types) @@ expected unsigned short volatile @@ got restrunsigned short volatile @@
drivers/hwmon/xgene-hwmon.c:147:9: sparse: expected unsigned short volatile
drivers/hwmon/xgene-hwmon.c:147:9: sparse: got restricted __le16 [usertype]
drivers/hwmon/xgene-hwmon.c:151:15: sparse: sparse: cast to restricted __le16
drivers/hwmon/xgene-hwmon.c:153:9: sparse: sparse: incorrect type in assignment (different base types) @@ expected unsigned short volatile @@ got restrunsigned short volatile @@
drivers/hwmon/xgene-hwmon.c:153:9: sparse: expected unsigned short volatile
drivers/hwmon/xgene-hwmon.c:153:9: sparse: got restricted __le16 [usertype]
drivers/hwmon/xgene-hwmon.c:157:17: sparse: sparse: incorrect type in assignment (different base types) @@ expected unsigned int volatile @@ got restricunsigned int volatile @@
drivers/hwmon/xgene-hwmon.c:157:17: sparse: expected unsigned int volatile
drivers/hwmon/xgene-hwmon.c:157:17: sparse: got restricted __le32 [usertype]
--
drivers/dma/mediatek/mtk-hsdma.c:451:17: sparse: sparse: incorrect type in assignment (different base types) @@ expected restricted __le32 volatile @@ got unsrestricted __le32 volatile @@
drivers/dma/mediatek/mtk-hsdma.c:451:17: sparse: expected restricted __le32 volatile
drivers/dma/mediatek/mtk-hsdma.c:451:17: sparse: got unsigned long long [usertype] src
drivers/dma/mediatek/mtk-hsdma.c:452:17: sparse: sparse: restricted __le32 degrades to integer
>> drivers/dma/mediatek/mtk-hsdma.c:452:17: sparse: sparse: incorrect type in assignment (different base types) @@ expected restricted __le32 volatile @@ got 32 volatile @@
drivers/dma/mediatek/mtk-hsdma.c:452:17: sparse: expected restricted __le32 volatile
drivers/dma/mediatek/mtk-hsdma.c:452:17: sparse: got unsigned int
drivers/dma/mediatek/mtk-hsdma.c:456:17: sparse: sparse: incorrect type in assignment (different base types) @@ expected restricted __le32 volatile @@ got unsrestricted __le32 volatile @@
drivers/dma/mediatek/mtk-hsdma.c:456:17: sparse: expected restricted __le32 volatile
drivers/dma/mediatek/mtk-hsdma.c:456:17: sparse: got unsigned long long [usertype] dest
>> drivers/dma/mediatek/mtk-hsdma.c:457:17: sparse: sparse: incorrect type in assignment (different base types) @@ expected restricted __le32 volatile @@ got le @@
drivers/dma/mediatek/mtk-hsdma.c:457:17: sparse: expected restricted __le32 volatile
drivers/dma/mediatek/mtk-hsdma.c:457:17: sparse: got int
drivers/dma/mediatek/mtk-hsdma.c:580:33: sparse: sparse: restricted __le32 degrades to integer
drivers/dma/mediatek/mtk-hsdma.c:604:26: sparse: sparse: Using plain integer as NULL pointer
drivers/dma/mediatek/mtk-hsdma.c:878:18: sparse: sparse: incorrect type in initializer (different base types) @@ expected restricted __le32 [usertype] ddone @@ got 2 [usertype] ddone @@
drivers/dma/mediatek/mtk-hsdma.c:878:18: sparse: expected restricted __le32 [usertype] ddone
drivers/dma/mediatek/mtk-hsdma.c:878:18: sparse: got unsigned long
drivers/dma/mediatek/mtk-hsdma.c:879:16: sparse: sparse: incorrect type in initializer (different base types) @@ expected restricted __le32 [usertype] ls0 @@ got 2 [usertype] ls0 @@
drivers/dma/mediatek/mtk-hsdma.c:879:16: sparse: expected restricted __le32 [usertype] ls0
drivers/dma/mediatek/mtk-hsdma.c:879:16: sparse: got unsigned long
drivers/dma/mediatek/mtk-hsdma.c:883:18: sparse: sparse: incorrect type in initializer (different base types) @@ expected restricted __le32 [usertype] ddone @@ got 2 [usertype] ddone @@
drivers/dma/mediatek/mtk-hsdma.c:883:18: sparse: expected restricted __le32 [usertype] ddone
drivers/dma/mediatek/mtk-hsdma.c:883:18: sparse: got unsigned long
drivers/dma/mediatek/mtk-hsdma.c:884:16: sparse: sparse: incorrect type in initializer (different base types) @@ expected restricted __le32 [usertype] ls0 @@ got 2 [usertype] ls0 @@
drivers/dma/mediatek/mtk-hsdma.c:884:16: sparse: expected restricted __le32 [usertype] ls0
drivers/dma/mediatek/mtk-hsdma.c:884:16: sparse: got unsigned long
vim +126 drivers/hwmon/xgene-hwmon.c
ed42cfa881e1d8d hotran 2016-07-21 115
ed42cfa881e1d8d hotran 2016-07-21 116 /*
ed42cfa881e1d8d hotran 2016-07-21 117 * This function tests and clears a bitmask then returns its old value
ed42cfa881e1d8d hotran 2016-07-21 118 */
ed42cfa881e1d8d hotran 2016-07-21 119 static u16 xgene_word_tst_and_clr(u16 *addr, u16 mask)
ed42cfa881e1d8d hotran 2016-07-21 120 {
ed42cfa881e1d8d hotran 2016-07-21 121 u16 ret, val;
ed42cfa881e1d8d hotran 2016-07-21 122
c7cefce03e69127 Arnd Bergmann 2016-09-09 123 val = le16_to_cpu(READ_ONCE(*addr));
ed42cfa881e1d8d hotran 2016-07-21 124 ret = val & mask;
ed42cfa881e1d8d hotran 2016-07-21 125 val &= ~mask;
c7cefce03e69127 Arnd Bergmann 2016-09-09 @126 WRITE_ONCE(*addr, cpu_to_le16(val));
ed42cfa881e1d8d hotran 2016-07-21 127
ed42cfa881e1d8d hotran 2016-07-21 128 return ret;
ed42cfa881e1d8d hotran 2016-07-21 129 }
ed42cfa881e1d8d hotran 2016-07-21 130
ed42cfa881e1d8d hotran 2016-07-21 131 static int xgene_hwmon_pcc_rd(struct xgene_hwmon_dev *ctx, u32 *msg)
ed42cfa881e1d8d hotran 2016-07-21 132 {
ed42cfa881e1d8d hotran 2016-07-21 133 struct acpi_pcct_shared_memory *generic_comm_base = ctx->pcc_comm_addr;
c7cefce03e69127 Arnd Bergmann 2016-09-09 134 u32 *ptr = (void *)(generic_comm_base + 1);
ed42cfa881e1d8d hotran 2016-07-21 135 int rc, i;
ed42cfa881e1d8d hotran 2016-07-21 136 u16 val;
ed42cfa881e1d8d hotran 2016-07-21 137
ed42cfa881e1d8d hotran 2016-07-21 138 mutex_lock(&ctx->rd_mutex);
ed42cfa881e1d8d hotran 2016-07-21 139 init_completion(&ctx->rd_complete);
ed42cfa881e1d8d hotran 2016-07-21 140 ctx->resp_pending = true;
ed42cfa881e1d8d hotran 2016-07-21 141
ed42cfa881e1d8d hotran 2016-07-21 142 /* Write signature for subspace */
c7cefce03e69127 Arnd Bergmann 2016-09-09 @143 WRITE_ONCE(generic_comm_base->signature,
c7cefce03e69127 Arnd Bergmann 2016-09-09 144 cpu_to_le32(PCC_SIGNATURE_MASK | ctx->mbox_idx));
ed42cfa881e1d8d hotran 2016-07-21 145
ed42cfa881e1d8d hotran 2016-07-21 146 /* Write to the shared command region */
c7cefce03e69127 Arnd Bergmann 2016-09-09 147 WRITE_ONCE(generic_comm_base->command,
c7cefce03e69127 Arnd Bergmann 2016-09-09 148 cpu_to_le16(MSG_TYPE(msg[0]) | PCCC_GENERATE_DB_INT));
ed42cfa881e1d8d hotran 2016-07-21 149
ed42cfa881e1d8d hotran 2016-07-21 150 /* Flip CMD COMPLETE bit */
c7cefce03e69127 Arnd Bergmann 2016-09-09 151 val = le16_to_cpu(READ_ONCE(generic_comm_base->status));
ed42cfa881e1d8d hotran 2016-07-21 152 val &= ~PCCS_CMD_COMPLETE;
c7cefce03e69127 Arnd Bergmann 2016-09-09 153 WRITE_ONCE(generic_comm_base->status, cpu_to_le16(val));
ed42cfa881e1d8d hotran 2016-07-21 154
ed42cfa881e1d8d hotran 2016-07-21 155 /* Copy the message to the PCC comm space */
ed42cfa881e1d8d hotran 2016-07-21 156 for (i = 0; i < sizeof(struct slimpro_resp_msg) / 4; i++)
c7cefce03e69127 Arnd Bergmann 2016-09-09 157 WRITE_ONCE(ptr[i], cpu_to_le32(msg[i]));
ed42cfa881e1d8d hotran 2016-07-21 158
ed42cfa881e1d8d hotran 2016-07-21 159 /* Ring the doorbell */
ed42cfa881e1d8d hotran 2016-07-21 160 rc = mbox_send_message(ctx->mbox_chan, msg);
ed42cfa881e1d8d hotran 2016-07-21 161 if (rc < 0) {
ed42cfa881e1d8d hotran 2016-07-21 162 dev_err(ctx->dev, "Mailbox send error %d\n", rc);
ed42cfa881e1d8d hotran 2016-07-21 163 goto err;
ed42cfa881e1d8d hotran 2016-07-21 164 }
ed42cfa881e1d8d hotran 2016-07-21 165 if (!wait_for_completion_timeout(&ctx->rd_complete,
ed42cfa881e1d8d hotran 2016-07-21 166 usecs_to_jiffies(ctx->usecs_lat))) {
ed42cfa881e1d8d hotran 2016-07-21 167 dev_err(ctx->dev, "Mailbox operation timed out\n");
ed42cfa881e1d8d hotran 2016-07-21 168 rc = -ETIMEDOUT;
ed42cfa881e1d8d hotran 2016-07-21 169 goto err;
ed42cfa881e1d8d hotran 2016-07-21 170 }
ed42cfa881e1d8d hotran 2016-07-21 171
ed42cfa881e1d8d hotran 2016-07-21 172 /* Check for error message */
ed42cfa881e1d8d hotran 2016-07-21 173 if (MSG_TYPE(ctx->sync_msg.msg) == MSG_TYPE_ERR) {
ed42cfa881e1d8d hotran 2016-07-21 174 rc = -EINVAL;
ed42cfa881e1d8d hotran 2016-07-21 175 goto err;
ed42cfa881e1d8d hotran 2016-07-21 176 }
ed42cfa881e1d8d hotran 2016-07-21 177
ed42cfa881e1d8d hotran 2016-07-21 178 msg[0] = ctx->sync_msg.msg;
ed42cfa881e1d8d hotran 2016-07-21 179 msg[1] = ctx->sync_msg.param1;
ed42cfa881e1d8d hotran 2016-07-21 180 msg[2] = ctx->sync_msg.param2;
ed42cfa881e1d8d hotran 2016-07-21 181
ed42cfa881e1d8d hotran 2016-07-21 182 err:
ed42cfa881e1d8d hotran 2016-07-21 183 mbox_chan_txdone(ctx->mbox_chan, 0);
ed42cfa881e1d8d hotran 2016-07-21 184 ctx->resp_pending = false;
ed42cfa881e1d8d hotran 2016-07-21 185 mutex_unlock(&ctx->rd_mutex);
ed42cfa881e1d8d hotran 2016-07-21 186 return rc;
ed42cfa881e1d8d hotran 2016-07-21 187 }
ed42cfa881e1d8d hotran 2016-07-21 188
:::::: The code at line 126 was first introduced by commit
:::::: c7cefce03e691270c0e5e117248e14661e9c9cad hwmon: (xgene) access mailbox as RAM
:::::: TO: Arnd Bergmann <arnd(a)arndb.de>
:::::: CC: Guenter Roeck <linux(a)roeck-us.net>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
2 years, 3 months
[rdma:wip/jgg-for-next 164/171] drivers/infiniband/core/uverbs_std_types_srq.o: warning: objtool: __llvm_gcov_writeout()+0x7: call without frame pointer save/setup
by kbuild test robot
CC: Doug Ledford <dledford(a)redhat.com>
CC: Jason Gunthorpe <jgg+lists(a)ziepe.ca>
CC: linux-rdma(a)vger.kernel.org
TO: Yishai Hadas <yishaih(a)mellanox.com>
CC: Jason Gunthorpe <jgg(a)ziepe.ca>
CC: Leon Romanovsky <leonro(a)mellanox.com>
tree: https://git.kernel.org/pub/scm/linux/kernel/git/rdma/rdma.git wip/jgg-for-next
head: a94dae867c5663f36c950b82832e146a6c2f0e42
commit: c3eab946aba443f0b44a08f446735c74495610a9 [164/171] IB/uverbs: Introduce create/destroy SRQ commands over ioctl
config: x86_64-randconfig-a015-20200521 (attached as .config)
compiler: clang version 11.0.0 (https://github.com/llvm/llvm-project 3393cc4cebf9969db94dc424b7a2b6195589c33b)
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
# install x86_64 cross compiling tool for clang build
# apt-get install binutils-x86-64-linux-gnu
git checkout c3eab946aba443f0b44a08f446735c74495610a9
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=x86_64
If you fix the issue, kindly add following tag as appropriate
Reported-by: kbuild test robot <lkp(a)intel.com>
All warnings (new ones prefixed by >>, old ones prefixed by <<):
>> drivers/infiniband/core/uverbs_std_types_srq.o: warning: objtool: __llvm_gcov_writeout()+0x7: call without frame pointer save/setup
>> drivers/infiniband/core/uverbs_std_types_srq.o: warning: objtool: __llvm_gcov_reset()+0x0: call without frame pointer save/setup
>> drivers/infiniband/core/uverbs_std_types_srq.o: warning: objtool: __llvm_gcov_flush()+0x0: call without frame pointer save/setup
>> drivers/infiniband/core/uverbs_std_types_srq.o: warning: objtool: __llvm_gcov_init()+0x0: call without frame pointer save/setup
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
2 years, 3 months
drivers/misc/pci_endpoint_test.c:347:6: warning: Local variable 'irq_type' shadows outer variable [shadowVariable]
by kbuild test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: caffb99b6929f41a69edbb5aef3a359bf45f3315
commit: b2ba9225e0313b1de631a44b7b48c109032bffec misc: pci_endpoint_test: Avoid using module parameter to determine irqtype
date: 7 weeks ago
compiler: gcc-7 (Ubuntu 7.5.0-6ubuntu2) 7.5.0
reproduce (this is a W=1 build):
git checkout b2ba9225e0313b1de631a44b7b48c109032bffec
# save the attached .config to linux build tree
make ARCH=x86_64
If you fix the issue, kindly add following tag as appropriate
Reported-by: kbuild test robot <lkp(a)intel.com>
cppcheck warnings: (new ones prefixed by >>)
>> drivers/misc/pci_endpoint_test.c:347:6: warning: Local variable 'irq_type' shadows outer variable [shadowVariable]
int irq_type = test->irq_type;
^
drivers/misc/pci_endpoint_test.c:86:12: note: Shadowed declaration
static int irq_type = IRQ_TYPE_MSI;
^
drivers/misc/pci_endpoint_test.c:347:6: note: Shadow variable
int irq_type = test->irq_type;
^
drivers/misc/pci_endpoint_test.c:481:6: warning: Local variable 'irq_type' shadows outer variable [shadowVariable]
int irq_type = test->irq_type;
^
drivers/misc/pci_endpoint_test.c:86:12: note: Shadowed declaration
static int irq_type = IRQ_TYPE_MSI;
^
drivers/misc/pci_endpoint_test.c:481:6: note: Shadow variable
int irq_type = test->irq_type;
^
drivers/misc/pci_endpoint_test.c:580:6: warning: Local variable 'irq_type' shadows outer variable [shadowVariable]
int irq_type = test->irq_type;
^
drivers/misc/pci_endpoint_test.c:86:12: note: Shadowed declaration
static int irq_type = IRQ_TYPE_MSI;
^
drivers/misc/pci_endpoint_test.c:580:6: note: Shadow variable
int irq_type = test->irq_type;
^
vim +/irq_type +347 drivers/misc/pci_endpoint_test.c
326
327 static bool pci_endpoint_test_copy(struct pci_endpoint_test *test,
328 unsigned long arg)
329 {
330 struct pci_endpoint_test_xfer_param param;
331 bool ret = false;
332 void *src_addr;
333 void *dst_addr;
334 u32 flags = 0;
335 bool use_dma;
336 size_t size;
337 dma_addr_t src_phys_addr;
338 dma_addr_t dst_phys_addr;
339 struct pci_dev *pdev = test->pdev;
340 struct device *dev = &pdev->dev;
341 void *orig_src_addr;
342 dma_addr_t orig_src_phys_addr;
343 void *orig_dst_addr;
344 dma_addr_t orig_dst_phys_addr;
345 size_t offset;
346 size_t alignment = test->alignment;
> 347 int irq_type = test->irq_type;
348 u32 src_crc32;
349 u32 dst_crc32;
350 int err;
351
352 err = copy_from_user(¶m, (void __user *)arg, sizeof(param));
353 if (err) {
354 dev_err(dev, "Failed to get transfer param\n");
355 return false;
356 }
357
358 size = param.size;
359 if (size > SIZE_MAX - alignment)
360 goto err;
361
362 use_dma = !!(param.flags & PCITEST_FLAGS_USE_DMA);
363 if (use_dma)
364 flags |= FLAG_USE_DMA;
365
366 if (irq_type < IRQ_TYPE_LEGACY || irq_type > IRQ_TYPE_MSIX) {
367 dev_err(dev, "Invalid IRQ type option\n");
368 goto err;
369 }
370
371 orig_src_addr = kzalloc(size + alignment, GFP_KERNEL);
372 if (!orig_src_addr) {
373 dev_err(dev, "Failed to allocate source buffer\n");
374 ret = false;
375 goto err;
376 }
377
378 get_random_bytes(orig_src_addr, size + alignment);
379 orig_src_phys_addr = dma_map_single(dev, orig_src_addr,
380 size + alignment, DMA_TO_DEVICE);
381 if (dma_mapping_error(dev, orig_src_phys_addr)) {
382 dev_err(dev, "failed to map source buffer address\n");
383 ret = false;
384 goto err_src_phys_addr;
385 }
386
387 if (alignment && !IS_ALIGNED(orig_src_phys_addr, alignment)) {
388 src_phys_addr = PTR_ALIGN(orig_src_phys_addr, alignment);
389 offset = src_phys_addr - orig_src_phys_addr;
390 src_addr = orig_src_addr + offset;
391 } else {
392 src_phys_addr = orig_src_phys_addr;
393 src_addr = orig_src_addr;
394 }
395
396 pci_endpoint_test_writel(test, PCI_ENDPOINT_TEST_LOWER_SRC_ADDR,
397 lower_32_bits(src_phys_addr));
398
399 pci_endpoint_test_writel(test, PCI_ENDPOINT_TEST_UPPER_SRC_ADDR,
400 upper_32_bits(src_phys_addr));
401
402 src_crc32 = crc32_le(~0, src_addr, size);
403
404 orig_dst_addr = kzalloc(size + alignment, GFP_KERNEL);
405 if (!orig_dst_addr) {
406 dev_err(dev, "Failed to allocate destination address\n");
407 ret = false;
408 goto err_dst_addr;
409 }
410
411 orig_dst_phys_addr = dma_map_single(dev, orig_dst_addr,
412 size + alignment, DMA_FROM_DEVICE);
413 if (dma_mapping_error(dev, orig_dst_phys_addr)) {
414 dev_err(dev, "failed to map destination buffer address\n");
415 ret = false;
416 goto err_dst_phys_addr;
417 }
418
419 if (alignment && !IS_ALIGNED(orig_dst_phys_addr, alignment)) {
420 dst_phys_addr = PTR_ALIGN(orig_dst_phys_addr, alignment);
421 offset = dst_phys_addr - orig_dst_phys_addr;
422 dst_addr = orig_dst_addr + offset;
423 } else {
424 dst_phys_addr = orig_dst_phys_addr;
425 dst_addr = orig_dst_addr;
426 }
427
428 pci_endpoint_test_writel(test, PCI_ENDPOINT_TEST_LOWER_DST_ADDR,
429 lower_32_bits(dst_phys_addr));
430 pci_endpoint_test_writel(test, PCI_ENDPOINT_TEST_UPPER_DST_ADDR,
431 upper_32_bits(dst_phys_addr));
432
433 pci_endpoint_test_writel(test, PCI_ENDPOINT_TEST_SIZE,
434 size);
435
436 pci_endpoint_test_writel(test, PCI_ENDPOINT_TEST_FLAGS, flags);
437 pci_endpoint_test_writel(test, PCI_ENDPOINT_TEST_IRQ_TYPE, irq_type);
438 pci_endpoint_test_writel(test, PCI_ENDPOINT_TEST_IRQ_NUMBER, 1);
439 pci_endpoint_test_writel(test, PCI_ENDPOINT_TEST_COMMAND,
440 COMMAND_COPY);
441
442 wait_for_completion(&test->irq_raised);
443
444 dma_unmap_single(dev, orig_dst_phys_addr, size + alignment,
445 DMA_FROM_DEVICE);
446
447 dst_crc32 = crc32_le(~0, dst_addr, size);
448 if (dst_crc32 == src_crc32)
449 ret = true;
450
451 err_dst_phys_addr:
452 kfree(orig_dst_addr);
453
454 err_dst_addr:
455 dma_unmap_single(dev, orig_src_phys_addr, size + alignment,
456 DMA_TO_DEVICE);
457
458 err_src_phys_addr:
459 kfree(orig_src_addr);
460
461 err:
462 return ret;
463 }
464
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
2 years, 3 months