tree:
https://github.com/intel/linux-intel-lts.git 5.4/yocto
head: cfef018a5efc728040e938c270bbc68fc8124d33
commit: 12fc406ee6d446e71ab81fc11faa3b2ebe1095c4 [15479/18252] igc: Fix
igc_ptp_rx_pktstamp()
config: x86_64-randconfig-s022-20210815 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-22) 9.3.0
reproduce:
# apt-get install sparse
# sparse version: v0.6.3-348-gf0e6938b-dirty
#
https://github.com/intel/linux-intel-lts/commit/12fc406ee6d446e71ab81fc11...
git remote add intel-linux-intel-lts
https://github.com/intel/linux-intel-lts.git
git fetch --no-tags intel-linux-intel-lts 5.4/yocto
git checkout 12fc406ee6d446e71ab81fc11faa3b2ebe1095c4
# save the attached .config to linux build tree
make W=1 C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' O=build_dir
ARCH=x86_64 SHELL=/bin/bash drivers/net/ethernet/intel/igc/
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
sparse warnings: (new ones prefixed by >>)
> drivers/net/ethernet/intel/igc/igc_ptp.c:460:18: sparse: sparse:
cast to restricted __le32
drivers/net/ethernet/intel/igc/igc_ptp.c:461:24:
sparse: sparse: cast to restricted __le32
drivers/net/ethernet/intel/igc/igc_ptp.c:742:21: sparse: sparse: cast to restricted
__be32
drivers/net/ethernet/intel/igc/igc_ptp.c:742:21: sparse: sparse: cast to restricted
__be32
drivers/net/ethernet/intel/igc/igc_ptp.c:742:21: sparse: sparse: cast to restricted
__be32
drivers/net/ethernet/intel/igc/igc_ptp.c:742:21: sparse: sparse: cast to restricted
__be32
drivers/net/ethernet/intel/igc/igc_ptp.c:742:21: sparse: sparse: cast to restricted
__be32
drivers/net/ethernet/intel/igc/igc_ptp.c:742:21: sparse: sparse: cast to restricted
__be32
vim +460 drivers/net/ethernet/intel/igc/igc_ptp.c
432
433 /**
434 * igc_ptp_rx_pktstamp - Retrieve timestamp from rx packet buffer
435 * @q_vector: Pointer to interrupt specific structure
436 * @va: Pointer to address containing Rx buffer
437 * @skb: Buffer containing timestamp and packet
438 *
439 * This function retrieves the timestamp saved in the beginning of packet
440 * buffer. While two timestamps are available, one in timer0 reference and the
441 * other in timer1 reference, this function considers only the timestamp in
442 * timer0 reference.
443 */
444 void igc_ptp_rx_pktstamp(struct igc_q_vector *q_vector, u32 *va,
445 struct sk_buff *skb)
446 {
447 struct igc_adapter *adapter = q_vector->adapter;
448 u64 regval;
449 int adjust;
450
451 /* Timestamps are saved in little endian at the beginning of the packet
452 * buffer following the layout:
453 *
454 * DWORD: | 0 | 1 | 2 | 3 |
455 * Field: | Timer1 SYSTIML | Timer1 SYSTIMH | Timer0 SYSTIML | Timer0 SYSTIMH |
456 *
457 * SYSTIML holds the nanoseconds part while SYSTIMH holds the seconds
458 * part of the timestamp.
459 */
460 regval = le32_to_cpu(va[2]);
461 regval |=
(u64)le32_to_cpu(va[3]) << 32;
462 igc_ptp_systim_to_hwtstamp(adapter, skb_hwtstamps(skb), regval);
463
464 /* Adjust timestamp for the RX latency based on link speed */
465 switch (adapter->link_speed) {
466 case SPEED_10:
467 adjust = IGC_I225_RX_LATENCY_10;
468 break;
469 case SPEED_100:
470 adjust = IGC_I225_RX_LATENCY_100;
471 break;
472 case SPEED_1000:
473 adjust = IGC_I225_RX_LATENCY_1000;
474 break;
475 case SPEED_2500:
476 adjust = IGC_I225_RX_LATENCY_2500;
477 break;
478 default:
479 adjust = 0;
480 netdev_warn_once(adapter->netdev, "Imprecise timestamp\n");
481 break;
482 }
483 skb_hwtstamps(skb)->hwtstamp =
484 ktime_sub_ns(skb_hwtstamps(skb)->hwtstamp, adjust);
485 }
486
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org