1. 15 6月, 2021 1 次提交
  2. 03 6月, 2021 2 次提交
  3. 19 4月, 2021 1 次提交
  4. 09 4月, 2021 3 次提交
  5. 29 1月, 2021 2 次提交
  6. 09 12月, 2020 4 次提交
    • F
      net: stmmac: overwrite the dma_cap.addr64 according to HW design · f119cc98
      Fugang Duan 提交于
      The current IP register MAC_HW_Feature1[ADDR64] only defines
      32/40/64 bit width, but some SOCs support others like i.MX8MP
      support 34 bits but it maps to 40 bits width in MAC_HW_Feature1[ADDR64].
      So overwrite dma_cap.addr64 according to HW real design.
      
      Fixes: 94abdad6 ("net: ethernet: dwmac: add ethernet glue logic for NXP imx8 chip")
      Signed-off-by: NFugang Duan <fugang.duan@nxp.com>
      Signed-off-by: NJoakim Zhang <qiangqing.zhang@nxp.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      f119cc98
    • F
      net: stmmac: delete the eee_ctrl_timer after napi disabled · 5f585913
      Fugang Duan 提交于
      There have chance to re-enable the eee_ctrl_timer and fire the timer
      in napi callback after delete the timer in .stmmac_release(), which
      introduces to access eee registers in the timer function after clocks
      are disabled then causes system hang. Found this issue when do
      suspend/resume and reboot stress test.
      
      It is safe to delete the timer after napi disabled and disable lpi mode.
      
      Fixes: d765955d ("stmmac: add the Energy Efficient Ethernet support")
      Signed-off-by: NFugang Duan <fugang.duan@nxp.com>
      Signed-off-by: NJoakim Zhang <qiangqing.zhang@nxp.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      5f585913
    • F
      net: stmmac: free tx skb buffer in stmmac_resume() · 4ec236c7
      Fugang Duan 提交于
      When do suspend/resume test, there have WARN_ON() log dump from
      stmmac_xmit() funciton, the code logic:
      	entry = tx_q->cur_tx;
      	first_entry = entry;
      	WARN_ON(tx_q->tx_skbuff[first_entry]);
      
      In normal case, tx_q->tx_skbuff[txq->cur_tx] should be NULL because
      the skb should be handled and freed in stmmac_tx_clean().
      
      But stmmac_resume() reset queue parameters like below, skb buffers
      may not be freed.
      	tx_q->cur_tx = 0;
      	tx_q->dirty_tx = 0;
      
      So free tx skb buffer in stmmac_resume() to avoid warning and
      memory leak.
      
      log:
      [   46.139824] ------------[ cut here ]------------
      [   46.144453] WARNING: CPU: 0 PID: 0 at drivers/net/ethernet/stmicro/stmmac/stmmac_main.c:3235 stmmac_xmit+0x7a0/0x9d0
      [   46.154969] Modules linked in: crct10dif_ce vvcam(O) flexcan can_dev
      [   46.161328] CPU: 0 PID: 0 Comm: swapper/0 Tainted: G           O      5.4.24-2.1.0+g2ad925d15481 #1
      [   46.170369] Hardware name: NXP i.MX8MPlus EVK board (DT)
      [   46.175677] pstate: 80000005 (Nzcv daif -PAN -UAO)
      [   46.180465] pc : stmmac_xmit+0x7a0/0x9d0
      [   46.184387] lr : dev_hard_start_xmit+0x94/0x158
      [   46.188913] sp : ffff800010003cc0
      [   46.192224] x29: ffff800010003cc0 x28: ffff000177e2a100
      [   46.197533] x27: ffff000176ef0840 x26: ffff000176ef0090
      [   46.202842] x25: 0000000000000000 x24: 0000000000000000
      [   46.208151] x23: 0000000000000003 x22: ffff8000119ddd30
      [   46.213460] x21: ffff00017636f000 x20: ffff000176ef0cc0
      [   46.218769] x19: 0000000000000003 x18: 0000000000000000
      [   46.224078] x17: 0000000000000000 x16: 0000000000000000
      [   46.229386] x15: 0000000000000079 x14: 0000000000000000
      [   46.234695] x13: 0000000000000003 x12: 0000000000000003
      [   46.240003] x11: 0000000000000010 x10: 0000000000000010
      [   46.245312] x9 : ffff00017002b140 x8 : 0000000000000000
      [   46.250621] x7 : ffff00017636f000 x6 : 0000000000000010
      [   46.255930] x5 : 0000000000000001 x4 : ffff000176ef0000
      [   46.261238] x3 : 0000000000000003 x2 : 00000000ffffffff
      [   46.266547] x1 : ffff000177e2a000 x0 : 0000000000000000
      [   46.271856] Call trace:
      [   46.274302]  stmmac_xmit+0x7a0/0x9d0
      [   46.277874]  dev_hard_start_xmit+0x94/0x158
      [   46.282056]  sch_direct_xmit+0x11c/0x338
      [   46.285976]  __qdisc_run+0x118/0x5f0
      [   46.289549]  net_tx_action+0x110/0x198
      [   46.293297]  __do_softirq+0x120/0x23c
      [   46.296958]  irq_exit+0xb8/0xd8
      [   46.300098]  __handle_domain_irq+0x64/0xb8
      [   46.304191]  gic_handle_irq+0x5c/0x148
      [   46.307936]  el1_irq+0xb8/0x180
      [   46.311076]  cpuidle_enter_state+0x84/0x360
      [   46.315256]  cpuidle_enter+0x34/0x48
      [   46.318829]  call_cpuidle+0x18/0x38
      [   46.322314]  do_idle+0x1e0/0x280
      [   46.325539]  cpu_startup_entry+0x24/0x40
      [   46.329460]  rest_init+0xd4/0xe0
      [   46.332687]  arch_call_rest_init+0xc/0x14
      [   46.336695]  start_kernel+0x420/0x44c
      [   46.340353] ---[ end trace bc1ee695123cbacd ]---
      
      Fixes: 47dd7a54 ("net: add support for STMicroelectronics Ethernet controllers.")
      Signed-off-by: NFugang Duan <fugang.duan@nxp.com>
      Signed-off-by: NJoakim Zhang <qiangqing.zhang@nxp.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      4ec236c7
    • F
      net: stmmac: start phylink instance before stmmac_hw_setup() · 36d18b56
      Fugang Duan 提交于
      Start phylink instance and resume back the PHY to supply
      RX clock to MAC before MAC layer initialization by calling
      .stmmac_hw_setup(), since DMA reset depends on the RX clock,
      otherwise DMA reset cost maximum timeout value then finally
      timeout.
      
      Fixes: 74371272 ("net: stmmac: Convert to phylink and remove phylib logic")
      Signed-off-by: NFugang Duan <fugang.duan@nxp.com>
      Signed-off-by: NJoakim Zhang <qiangqing.zhang@nxp.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      36d18b56
  7. 17 11月, 2020 1 次提交
  8. 31 10月, 2020 1 次提交
    • M
      net: stmmac: Fix channel lock initialization · 2b94f526
      Marek Szyprowski 提交于
      Commit 0366f7e0 ("net: stmmac: add ethtool support for get/set
      channels") refactored channel initialization, but during that operation,
      the spinlock initialization got lost. Fix this. This fixes the following
      lockdep warning:
      
      meson8b-dwmac ff3f0000.ethernet eth0: Link is Up - 1Gbps/Full - flow control off
      INFO: trying to register non-static key.
      the code is fine but needs lockdep annotation.
      turning off the locking correctness validator.
      CPU: 1 PID: 331 Comm: kworker/1:2H Not tainted 5.9.0-rc3+ #1858
      Hardware name: Hardkernel ODROID-N2 (DT)
      Workqueue: kblockd blk_mq_run_work_fn
      Call trace:
       dump_backtrace+0x0/0x1d0
       show_stack+0x14/0x20
       dump_stack+0xe8/0x154
       register_lock_class+0x58c/0x590
       __lock_acquire+0x7c/0x1790
       lock_acquire+0xf4/0x440
       _raw_spin_lock_irqsave+0x80/0xb0
       stmmac_tx_timer+0x4c/0xb0 [stmmac]
       call_timer_fn+0xc4/0x3e8
       run_timer_softirq+0x2b8/0x6c0
       efi_header_end+0x114/0x5f8
       irq_exit+0x104/0x110
       __handle_domain_irq+0x60/0xb8
       gic_handle_irq+0x58/0xb0
       el1_irq+0xbc/0x180
       _raw_spin_unlock_irqrestore+0x48/0x90
       mmc_blk_rw_wait+0x70/0x160
       mmc_blk_mq_issue_rq+0x510/0x830
       mmc_mq_queue_rq+0x13c/0x278
       blk_mq_dispatch_rq_list+0x2a0/0x698
       __blk_mq_do_dispatch_sched+0x254/0x288
       __blk_mq_sched_dispatch_requests+0x190/0x1d8
       blk_mq_sched_dispatch_requests+0x34/0x70
       __blk_mq_run_hw_queue+0xcc/0x148
       blk_mq_run_work_fn+0x20/0x28
       process_one_work+0x2a8/0x718
       worker_thread+0x48/0x460
       kthread+0x134/0x160
       ret_from_fork+0x10/0x1c
      
      Fixes: 0366f7e0 ("net: stmmac: add ethtool support for get/set channels")
      Signed-off-by: NMarek Szyprowski <m.szyprowski@samsung.com>
      Link: https://lore.kernel.org/r/20201029185011.4749-1-m.szyprowski@samsung.comSigned-off-by: NJakub Kicinski <kuba@kernel.org>
      2b94f526
  9. 04 10月, 2020 1 次提交
    • V
      net: stmmac: Modify configuration method of EEE timers · 388e201d
      Vineetha G. Jaya Kumaran 提交于
      Ethtool manual stated that the tx-timer is the "the amount of time the
      device should stay in idle mode prior to asserting its Tx LPI". The
      previous implementation for "ethtool --set-eee tx-timer" sets the LPI TW
      timer duration which is not correct. Hence, this patch fixes the
      "ethtool --set-eee tx-timer" to configure the EEE LPI timer.
      
      The LPI TW Timer will be using the defined default value instead of
      "ethtool --set-eee tx-timer" which follows the EEE LS timer implementation.
      
      Changelog V2
      *Not removing/modifying the eee_timer.
      *EEE LPI timer can be configured through ethtool and also the eee_timer
      module param.
      *EEE TW Timer will be configured with default value only, not able to be
      configured through ethtool or module param. This follows the implementation
      of the EEE LS Timer.
      
      Fixes: d765955d ("stmmac: add the Energy Efficient Ethernet support")
      Signed-off-by: NVineetha G. Jaya Kumaran <vineetha.g.jaya.kumaran@intel.com>
      Signed-off-by: NVoon Weifeng <weifeng.voon@intel.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      388e201d
  10. 26 9月, 2020 2 次提交
    • C
      net: stmmac: Add option for VLAN filter fail queue enable · e0f9956a
      Chuah, Kim Tatt 提交于
      Add option in plat_stmmacenet_data struct to enable VLAN Filter Fail
      Queuing. This option allows packets that fail VLAN filter to be routed
      to a specific Rx queue when Receive All is also set.
      
      When this option is enabled:
      - Enable VFFQ only when entering promiscuous mode, because Receive All
        will pass up all rx packets that failed address filtering (similar to
        promiscuous mode).
      - VLAN-promiscuous mode is never entered to allow rx packet to fail VLAN
        filters and get routed to selected VFFQ Rx queue.
      Reviewed-by: NVoon Weifeng <weifeng.voon@intel.com>
      Reviewed-by: NOng Boon Leong <boon.leong.ong@intel.com>
      Signed-off-by: NChuah, Kim Tatt <kim.tatt.chuah@intel.com>
      Signed-off-by: NOng Boon Leong <boon.leong.ong@intel.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      e0f9956a
    • J
      drivers/net/ethernet: clean up mis-targeted comments · d0ea5cbd
      Jesse Brandeburg 提交于
      As part of the W=1 cleanups for ethernet, a million [*] driver
      comments had to be cleaned up to get the W=1 compilation to
      succeed. This change finally makes the drivers/net/ethernet tree
      compile with W=1 set on the command line. NOTE: The kernel uses
      kdoc style (see Documentation/process/kernel-doc.rst) when
      documenting code, not doxygen or other styles.
      
      After this patch the x86_64 build has no warnings from W=1, however
      scripts/kernel-doc says there are 1545 more warnings in source files, that
      I need to develop a script to fix in a followup patch.
      
      The errors fixed here are all kdoc of a few classes, with a few outliers:
      In file included from drivers/net/ethernet/qlogic/netxen/netxen_nic_hw.c:10:
      drivers/net/ethernet/qlogic/netxen/netxen_nic.h:1193:18: warning: ‘FW_DUMP_LEVELS’ defined but not used [-Wunused-const-variable=]
       1193 | static const u32 FW_DUMP_LEVELS[] = { 0x3, 0x7, 0xf, 0x1f, 0x3f, 0x7f, 0xff };
            |                  ^~~~~~~~~~~~~~
      ... repeats 4 times...
      drivers/net/ethernet/sun/cassini.c:2084:24: warning: suggest braces around empty body in an ‘else’ statement [-Wempty-body]
       2084 |    RX_USED_ADD(page, i);
      drivers/net/ethernet/natsemi/ns83820.c: In function ‘phy_intr’:
      drivers/net/ethernet/natsemi/ns83820.c:603:6: warning: variable ‘tbisr’ set but not used [-Wunused-but-set-variable]
        603 |  u32 tbisr, tanar, tanlpar;
            |      ^~~~~
      drivers/net/ethernet/natsemi/ns83820.c: In function ‘ns83820_get_link_ksettings’:
      drivers/net/ethernet/natsemi/ns83820.c:1207:11: warning: variable ‘tanar’ set but not used [-Wunused-but-set-variable]
       1207 |  u32 cfg, tanar, tbicr;
            |           ^~~~~
      drivers/net/ethernet/packetengines/yellowfin.c:1063:18: warning: variable ‘yf_size’ set but not used [-Wunused-but-set-variable]
       1063 |   int data_size, yf_size;
            |                  ^~~~~~~
      
      Normal kdoc fixes:
      warning: Function parameter or member 'x' not described in 'y'
      warning: Excess function parameter 'x' description in 'y'
      warning: Cannot understand <string> on line <NNN> - I thought it was a doc line
      
      [*] - ok it wasn't quite a million, but it felt like it.
      Signed-off-by: NJesse Brandeburg <jesse.brandeburg@intel.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      d0ea5cbd
  11. 17 9月, 2020 1 次提交
  12. 16 9月, 2020 3 次提交
  13. 12 9月, 2020 1 次提交
  14. 08 9月, 2020 1 次提交
  15. 29 7月, 2020 3 次提交
  16. 27 5月, 2020 1 次提交
    • F
      net: stmmac: enable timestamp snapshot for required PTP packets in dwmac v5.10a · f2fb6b62
      Fugang Duan 提交于
      For rx filter 'HWTSTAMP_FILTER_PTP_V2_EVENT', it should be
      PTP v2/802.AS1, any layer, any kind of event packet, but HW only
      take timestamp snapshot for below PTP message: sync, Pdelay_req,
      Pdelay_resp.
      
      Then it causes below issue when test E2E case:
      ptp4l[2479.534]: port 1: received DELAY_REQ without timestamp
      ptp4l[2481.423]: port 1: received DELAY_REQ without timestamp
      ptp4l[2481.758]: port 1: received DELAY_REQ without timestamp
      ptp4l[2483.524]: port 1: received DELAY_REQ without timestamp
      ptp4l[2484.233]: port 1: received DELAY_REQ without timestamp
      ptp4l[2485.750]: port 1: received DELAY_REQ without timestamp
      ptp4l[2486.888]: port 1: received DELAY_REQ without timestamp
      ptp4l[2487.265]: port 1: received DELAY_REQ without timestamp
      ptp4l[2487.316]: port 1: received DELAY_REQ without timestamp
      
      Timestamp snapshot dependency on register bits in received path:
      SNAPTYPSEL TSMSTRENA TSEVNTENA 	PTP_Messages
      01         x         0          SYNC, Follow_Up, Delay_Req,
                                      Delay_Resp, Pdelay_Req, Pdelay_Resp,
                                      Pdelay_Resp_Follow_Up
      01         0         1          SYNC, Pdelay_Req, Pdelay_Resp
      
      For dwmac v5.10a, enabling all events by setting register
      DWC_EQOS_TIME_STAMPING[SNAPTYPSEL] to 2’b01, clearing bit [TSEVNTENA]
      to 0’b0, which can support all required events.
      Signed-off-by: NFugang Duan <fugang.duan@nxp.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      f2fb6b62
  17. 24 5月, 2020 1 次提交
    • L
      net: stmmac: don't attach interface until resume finishes · 31096c3e
      Leon Yu 提交于
      Commit 14b41a29 ("net: stmmac: Delete txtimer in suspend") was the
      first attempt to fix a race between mod_timer() and setup_timer()
      during stmmac_resume(). However the issue still exists as the commit
      only addressed half of the issue.
      
      Same race can still happen as stmmac_resume() re-attaches interface
      way too early - even before hardware is fully initialized.  Worse,
      doing so allows network traffic to restart and stmmac_tx_timer_arm()
      being called in the middle of stmmac_resume(), which re-init tx timers
      in stmmac_init_coalesce().  timer_list will be corrupted and system
      crashes as a result of race between mod_timer() and setup_timer().
      
        systemd--1995    2.... 552950018us : stmmac_suspend: 4994
        ksoftirq-9       0..s2 553123133us : stmmac_tx_timer_arm: 2276
        systemd--1995    0.... 553127896us : stmmac_resume: 5101
        systemd--320     7...2 553132752us : stmmac_tx_timer_arm: 2276
        (sd-exec-1999    5...2 553135204us : stmmac_tx_timer_arm: 2276
        ---------------------------------
        pc : run_timer_softirq+0x468/0x5e0
        lr : run_timer_softirq+0x570/0x5e0
        Call trace:
         run_timer_softirq+0x468/0x5e0
         __do_softirq+0x124/0x398
         irq_exit+0xd8/0xe0
         __handle_domain_irq+0x6c/0xc0
         gic_handle_irq+0x60/0xb0
         el1_irq+0xb8/0x180
         arch_cpu_idle+0x38/0x230
         default_idle_call+0x24/0x3c
         do_idle+0x1e0/0x2b8
         cpu_startup_entry+0x28/0x48
         secondary_start_kernel+0x1b4/0x208
      
      Fix this by deferring netif_device_attach() to the end of
      stmmac_resume().
      Signed-off-by: NLeon Yu <leoyu@nvidia.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      31096c3e
  18. 06 5月, 2020 1 次提交
  19. 05 5月, 2020 1 次提交
  20. 01 5月, 2020 2 次提交
  21. 22 4月, 2020 1 次提交
    • V
      net: stmmac: Enable SERDES power up/down sequence · b9663b7c
      Voon Weifeng 提交于
      This patch is to enable Intel SERDES power up/down sequence. The SERDES
      converts 8/10 bits data to SGMII signal. Below is an example of
      HW configuration for SGMII mode. The SERDES is located in the PHY IF
      in the diagram below.
      
      <-----------------GBE Controller---------->|<--External PHY chip-->
      +----------+         +----+            +---+           +----------+
      |   EQoS   | <-GMII->| DW | < ------ > |PHY| <-SGMII-> | External |
      |   MAC    |         |xPCS|            |IF |           | PHY      |
      +----------+         +----+            +---+           +----------+
             ^               ^                 ^                ^
             |               |                 |                |
             +---------------------MDIO-------------------------+
      
      PHY IF configuration and status registers are accessible through
      mdio address 0x15 which is defined as mdio_adhoc_addr. During D0,
      The driver will need to power up PHY IF by changing the power state
      to P0. Likewise, for D3, the driver sets PHY IF power state to P3.
      Signed-off-by: NVoon Weifeng <weifeng.voon@intel.com>
      Signed-off-by: NOng Boon Leong <boon.leong.ong@intel.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      b9663b7c
  22. 02 4月, 2020 1 次提交
  23. 31 3月, 2020 1 次提交
  24. 18 3月, 2020 1 次提交
  25. 10 3月, 2020 3 次提交