An error occurred fetching the project authors.
  1. 03 Sep, 2023 1 commit
  2. 28 Aug, 2023 1 commit
  3. 31 Jul, 2023 1 commit
  4. 23 Jun, 2023 1 commit
    • Ying Hsu's avatar
      igb: Fix igb_down hung on surprise removal · 004d2506
      Ying Hsu authored
      In a setup where a Thunderbolt hub connects to Ethernet and a display
      through USB Type-C, users may experience a hung task timeout when they
      remove the cable between the PC and the Thunderbolt hub.
      This is because the igb_down function is called multiple times when
      the Thunderbolt hub is unplugged. For example, the igb_io_error_detected
      triggers the first call, and the igb_remove triggers the second call.
      The second call to igb_down will block at napi_synchronize.
      Here's the call trace:
          __schedule+0x3b0/0xddb
          ? __mod_timer+0x164/0x5d3
          schedule+0x44/0xa8
          schedule_timeout+0xb2/0x2a4
          ? run_local_timers+0x4e/0x4e
          msleep+0x31/0x38
          igb_down+0x12c/0x22a [igb 6615058754948bfde0bf01429257eb59f13030d4]
          __igb_close+0x6f/0x9c [igb 6615058754948bfde0bf01429257eb59f13030d4]
          igb_close+0x23/0x2b [igb 6615058754948bfde0bf01429257eb59f13030d4]
          __dev_close_many+0x95/0xec
          dev_close_many+0x6e/0x103
          unregister_netdevice_many+0x105/0x5b1
          unregister_netdevice_queue+0xc2/0x10d
          unregister_netdev+0x1c/0x23
          igb_remove+0xa7/0x11c [igb 6615058754948bfde0bf01429257eb59f13030d4]
          pci_device_remove+0x3f/0x9c
          device_release_driver_internal+0xfe/0x1b4
          pci_stop_bus_device+0x5b/0x7f
          pci_stop_bus_device+0x30/0x7f
          pci_stop_bus_device+0x30/0x7f
          pci_stop_and_remove_bus_device+0x12/0x19
          pciehp_unconfigure_device+0x76/0xe9
          pciehp_disable_slot+0x6e/0x131
          pciehp_handle_presence_or_link_change+0x7a/0x3f7
          pciehp_ist+0xbe/0x194
          irq_thread_fn+0x22/0x4d
          ? irq_thread+0x1fd/0x1fd
          irq_thread+0x17b/0x1fd
          ? irq_forced_thread_fn+0x5f/0x5f
          kthread+0x142/0x153
          ? __irq_get_irqchip_state+0x46/0x46
          ? kthread_associate_blkcg+0x71/0x71
          ret_from_fork+0x1f/0x30
      
      In this case, igb_io_error_detected detaches the network interface
      and requests a PCIE slot reset, however, the PCIE reset callback is
      not being invoked and thus the Ethernet connection breaks down.
      As the PCIE error in this case is a non-fatal one, requesting a
      slot reset can be avoided.
      This patch fixes the task hung issue and preserves Ethernet
      connection by ignoring non-fatal PCIE errors.
      Signed-off-by: default avatarYing Hsu <yinghsu@chromium.org>
      Tested-by: Pucha Himasekhar Reddy <himasekharx.reddy.pucha@intel.com> (A Contingent worker at Intel)
      Signed-off-by: default avatarTony Nguyen <anthony.l.nguyen@intel.com>
      Reviewed-by: default avatarSimon Horman <simon.horman@corigine.com>
      Link: https://lore.kernel.org/r/20230620174732.4145155-1-anthony.l.nguyen@intel.comSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      004d2506
  5. 09 Jun, 2023 1 commit
  6. 18 May, 2023 1 commit
  7. 16 Mar, 2023 2 commits
    • Akihiko Odaki's avatar
      igb: Enable SR-IOV after reinit · 50f30349
      Akihiko Odaki authored
      Enabling SR-IOV causes the virtual functions to make requests to the
      PF via the mailbox. Notably, E1000_VF_RESET request will happen during
      the initialization of the VF. However, unless the reinit is done, the
      VMMB interrupt, which delivers mailbox interrupt from VF to PF will be
      kept masked and such requests will be silently ignored.
      
      Enable SR-IOV at the very end of the procedure to configure the device
      for SR-IOV so that the PF is configured properly for SR-IOV when a VF is
      activated.
      
      Fixes: fa44f2f1 ("igb: Enable SR-IOV configuration via PCI sysfs interface")
      Signed-off-by: default avatarAkihiko Odaki <akihiko.odaki@daynix.com>
      Tested-by: default avatarMarek Szlosek <marek.szlosek@intel.com>
      Signed-off-by: default avatarTony Nguyen <anthony.l.nguyen@intel.com>
      50f30349
    • Lin Ma's avatar
      igb: revert rtnl_lock() that causes deadlock · 65f69851
      Lin Ma authored
      The commit 6faee3d4 ("igb: Add lock to avoid data race") adds
      rtnl_lock to eliminate a false data race shown below
      
       (FREE from device detaching)      |   (USE from netdev core)
      igb_remove                         |  igb_ndo_get_vf_config
       igb_disable_sriov                 |  vf >= adapter->vfs_allocated_count?
        kfree(adapter->vf_data)          |
        adapter->vfs_allocated_count = 0 |
                                         |    memcpy(... adapter->vf_data[vf]
      
      The above race will never happen and the extra rtnl_lock causes deadlock
      below
      
      [  141.420169]  <TASK>
      [  141.420672]  __schedule+0x2dd/0x840
      [  141.421427]  schedule+0x50/0xc0
      [  141.422041]  schedule_preempt_disabled+0x11/0x20
      [  141.422678]  __mutex_lock.isra.13+0x431/0x6b0
      [  141.423324]  unregister_netdev+0xe/0x20
      [  141.423578]  igbvf_remove+0x45/0xe0 [igbvf]
      [  141.423791]  pci_device_remove+0x36/0xb0
      [  141.423990]  device_release_driver_internal+0xc1/0x160
      [  141.424270]  pci_stop_bus_device+0x6d/0x90
      [  141.424507]  pci_stop_and_remove_bus_device+0xe/0x20
      [  141.424789]  pci_iov_remove_virtfn+0xba/0x120
      [  141.425452]  sriov_disable+0x2f/0xf0
      [  141.425679]  igb_disable_sriov+0x4e/0x100 [igb]
      [  141.426353]  igb_remove+0xa0/0x130 [igb]
      [  141.426599]  pci_device_remove+0x36/0xb0
      [  141.426796]  device_release_driver_internal+0xc1/0x160
      [  141.427060]  driver_detach+0x44/0x90
      [  141.427253]  bus_remove_driver+0x55/0xe0
      [  141.427477]  pci_unregister_driver+0x2a/0xa0
      [  141.428296]  __x64_sys_delete_module+0x141/0x2b0
      [  141.429126]  ? mntput_no_expire+0x4a/0x240
      [  141.429363]  ? syscall_trace_enter.isra.19+0x126/0x1a0
      [  141.429653]  do_syscall_64+0x5b/0x80
      [  141.429847]  ? exit_to_user_mode_prepare+0x14d/0x1c0
      [  141.430109]  ? syscall_exit_to_user_mode+0x12/0x30
      [  141.430849]  ? do_syscall_64+0x67/0x80
      [  141.431083]  ? syscall_exit_to_user_mode_prepare+0x183/0x1b0
      [  141.431770]  ? syscall_exit_to_user_mode+0x12/0x30
      [  141.432482]  ? do_syscall_64+0x67/0x80
      [  141.432714]  ? exc_page_fault+0x64/0x140
      [  141.432911]  entry_SYSCALL_64_after_hwframe+0x72/0xdc
      
      Since the igb_disable_sriov() will call pci_disable_sriov() before
      releasing any resources, the netdev core will synchronize the cleanup to
      avoid any races. This patch removes the useless rtnl_(un)lock to guarantee
      correctness.
      
      CC: stable@vger.kernel.org
      Fixes: 6faee3d4 ("igb: Add lock to avoid data race")
      Reported-by: default avatarCorinna Vinschen <vinschen@redhat.com>
      Link: https://lore.kernel.org/intel-wired-lan/ZAcJvkEPqWeJHO2r@calimero.vinschen.de/Signed-off-by: default avatarLin Ma <linma@zju.edu.cn>
      Tested-by: default avatarCorinna Vinschen <vinschen@redhat.com>
      Reviewed-by: default avatarJacob Keller <jacob.e.keller@intel.com>
      Reviewed-by: default avatarSimon Horman <simon.horman@corigine.com>
      Tested-by: default avatarRafal Romanowski <rafal.romanowski@intel.com>
      Signed-off-by: default avatarTony Nguyen <anthony.l.nguyen@intel.com>
      65f69851
  8. 09 Mar, 2023 1 commit
  9. 16 Feb, 2023 1 commit
    • Corinna Vinschen's avatar
      igb: conditionalize I2C bit banging on external thermal sensor support · 5d54cb17
      Corinna Vinschen authored
      Commit a97f8783 ("igb: unbreak I2C bit-banging on i350") introduced
      code to change I2C settings to bit banging unconditionally.
      
      However, this patch introduced a regression:  On an Intel S2600CWR
      Server Board with three NICs:
      
      - 1x dual-port copper
        Intel I350 Gigabit Network Connection [8086:1521] (rev 01)
        fw 1.63, 0x80000dda
      
      - 2x quad-port SFP+ with copper SFP Avago ABCU-5700RZ
        Intel I350 Gigabit Fiber Network Connection [8086:1522] (rev 01)
        fw 1.52.0
      
      the SFP NICs no longer get link at all.  Reverting commit a97f8783
      or switching to the Intel out-of-tree driver both fix the problem.
      
      Per the igb out-of-tree driver, I2C bit banging on i350 depends on
      support for an external thermal sensor (ETS).  However, commit
      a97f8783 added bit banging unconditionally.  Additionally, the
      out-of-tree driver always calls init_thermal_sensor_thresh on probe,
      while our driver only calls init_thermal_sensor_thresh only in
      igb_reset(), and only if an ETS is present, ignoring the internal
      thermal sensor.  The affected SFPs don't provide an ETS.  Per Intel,
      the behaviour is a result of i350 firmware requirements.
      
      This patch fixes the problem by aligning the behaviour to the
      out-of-tree driver:
      
      - split igb_init_i2c() into two functions:
        - igb_init_i2c() only performs the basic I2C initialization.
        - igb_set_i2c_bb() makes sure that E1000_CTRL_I2C_ENA is set
          and enables bit-banging.
      
      - igb_probe() only calls igb_set_i2c_bb() if an ETS is present.
      
      - igb_probe() calls init_thermal_sensor_thresh() unconditionally.
      
      - igb_reset() aligns its behaviour to igb_probe(), i. e., call
        igb_set_i2c_bb() if an ETS is present and call
        init_thermal_sensor_thresh() unconditionally.
      
      Fixes: a97f8783 ("igb: unbreak I2C bit-banging on i350")
      Tested-by: default avatarMateusz Palczewski <mateusz.palczewski@intel.com>
      Co-developed-by: default avatarJamie Bainbridge <jbainbri@redhat.com>
      Signed-off-by: default avatarJamie Bainbridge <jbainbri@redhat.com>
      Signed-off-by: default avatarCorinna Vinschen <vinschen@redhat.com>
      Signed-off-by: default avatarTony Nguyen <anthony.l.nguyen@intel.com>
      Link: https://lore.kernel.org/r/20230214185549.1306522-1-anthony.l.nguyen@intel.comSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      5d54cb17
  10. 15 Feb, 2023 1 commit
  11. 08 Feb, 2023 1 commit
    • Vladimir Oltean's avatar
      net/sched: taprio: give higher priority to higher TCs in software dequeue mode · 2f530df7
      Vladimir Oltean authored
      Current taprio software implementation is haunted by the shadow of the
      igb/igc hardware model. It iterates over child qdiscs in increasing
      order of TXQ index, therefore giving higher xmit priority to TXQ 0 and
      lower to TXQ N. According to discussions with Vinicius, that is the
      default (perhaps even unchangeable) prioritization scheme used for the
      NICs that taprio was first written for (igb, igc), and we have a case of
      two bugs canceling out, resulting in a functional setup on igb/igc, but
      a less sane one on other NICs.
      
      To the best of my understanding, taprio should prioritize based on the
      traffic class, so it should really dequeue starting with the highest
      traffic class and going down from there. We get to the TXQ using the
      tc_to_txq[] netdev property.
      
      TXQs within the same TC have the same (strict) priority, so we should
      pick from them as fairly as we can. We can achieve that by implementing
      something very similar to q->curband from multiq_dequeue().
      
      Since igb/igc really do have TXQ 0 of higher hardware priority than
      TXQ 1 etc, we need to preserve the behavior for them as well. We really
      have no choice, because in txtime-assist mode, taprio is essentially a
      software scheduler towards offloaded child tc-etf qdiscs, so the TXQ
      selection really does matter (not all igb TXQs support ETF/SO_TXTIME,
      says Kurt Kanzenbach).
      
      To preserve the behavior, we need a capability bit so that taprio can
      determine if it's running on igb/igc, or on something else. Because igb
      doesn't offload taprio at all, we can't piggyback on the
      qdisc_offload_query_caps() call from taprio_enable_offload(), but
      instead we need a separate call which is also made for software
      scheduling.
      
      Introduce two static keys to minimize the performance penalty on systems
      which only have igb/igc NICs, and on systems which only have other NICs.
      For mixed systems, taprio will have to dynamically check whether to
      dequeue using one prioritization algorithm or using the other.
      Signed-off-by: default avatarVladimir Oltean <vladimir.oltean@nxp.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      2f530df7
  12. 03 Feb, 2023 1 commit
  13. 30 Jan, 2023 1 commit
    • Bjorn Helgaas's avatar
      igb: Remove redundant pci_enable_pcie_error_reporting() · 8aea4c32
      Bjorn Helgaas authored
      pci_enable_pcie_error_reporting() enables the device to send ERR_*
      Messages.  Since f26e58bf ("PCI/AER: Enable error reporting when AER is
      native"), the PCI core does this for all devices during enumeration.
      
      Remove the redundant pci_enable_pcie_error_reporting() call from the
      driver.  Also remove the corresponding pci_disable_pcie_error_reporting()
      from the driver .remove() path.
      
      Note that this doesn't control interrupt generation by the Root Port; that
      is controlled by the AER Root Error Command register, which is managed by
      the AER service driver.
      Signed-off-by: default avatarBjorn Helgaas <bhelgaas@google.com>
      Cc: Jesse Brandeburg <jesse.brandeburg@intel.com>
      Cc: Tony Nguyen <anthony.l.nguyen@intel.com>
      Cc: intel-wired-lan@lists.osuosl.org
      Cc: netdev@vger.kernel.org
      Tested-by: Gurucharan G <gurucharanx.g@intel.com> (A Contingent worker at Intel)
      Signed-off-by: default avatarTony Nguyen <anthony.l.nguyen@intel.com>
      8aea4c32
  14. 14 Dec, 2022 1 commit
  15. 04 Nov, 2022 2 commits
  16. 29 Oct, 2022 1 commit
  17. 29 Sep, 2022 1 commit
  18. 31 Aug, 2022 1 commit
  19. 18 Aug, 2022 1 commit
    • Lin Ma's avatar
      igb: Add lock to avoid data race · 6faee3d4
      Lin Ma authored
      The commit c23d92b8 ("igb: Teardown SR-IOV before
      unregister_netdev()") places the unregister_netdev() call after the
      igb_disable_sriov() call to avoid functionality issue.
      
      However, it introduces several race conditions when detaching a device.
      For example, when .remove() is called, the below interleaving leads to
      use-after-free.
      
       (FREE from device detaching)      |   (USE from netdev core)
      igb_remove                         |  igb_ndo_get_vf_config
       igb_disable_sriov                 |  vf >= adapter->vfs_allocated_count?
        kfree(adapter->vf_data)          |
        adapter->vfs_allocated_count = 0 |
                                         |    memcpy(... adapter->vf_data[vf]
      
      Moreover, the igb_disable_sriov() also suffers from data race with the
      requests from VF driver.
      
       (FREE from device detaching)      |   (USE from requests)
      igb_remove                         |  igb_msix_other
       igb_disable_sriov                 |   igb_msg_task
        kfree(adapter->vf_data)          |    vf < adapter->vfs_allocated_count
        adapter->vfs_allocated_count = 0 |
      
      To this end, this commit first eliminates the data races from netdev
      core by using rtnl_lock (similar to commit 71947923 ("dpaa2-eth: add
      MAC/PHY support through phylink")). And then adds a spinlock to
      eliminate races from driver requests. (similar to commit 1e53834c
      ("ixgbe: Add locking to prevent panic when setting sriov_numvfs to zero")
      
      Fixes: c23d92b8 ("igb: Teardown SR-IOV before unregister_netdev()")
      Signed-off-by: default avatarLin Ma <linma@zju.edu.cn>
      Tested-by: default avatarKonrad Jankowski <konrad0.jankowski@intel.com>
      Signed-off-by: default avatarTony Nguyen <anthony.l.nguyen@intel.com>
      Link: https://lore.kernel.org/r/20220817184921.735244-1-anthony.l.nguyen@intel.comSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      6faee3d4
  20. 13 Jul, 2022 1 commit
  21. 30 Jun, 2022 1 commit
  22. 23 Jun, 2022 1 commit
    • Kai-Heng Feng's avatar
      igb: Make DMA faster when CPU is active on the PCIe link · 4e0effd9
      Kai-Heng Feng authored
      Intel I210 on some Intel Alder Lake platforms can only achieve ~750Mbps
      Tx speed via iperf. The RR2DCDELAY shows around 0x2xxx DMA delay, which
      will be significantly lower when 1) ASPM is disabled or 2) SoC package
      c-state stays above PC3. When the RR2DCDELAY is around 0x1xxx the Tx
      speed can reach to ~950Mbps.
      
      According to the I210 datasheet "8.26.1 PCIe Misc. Register - PCIEMISC",
      "DMA Idle Indication" doesn't seem to tie to DMA coalesce anymore, so
      set it to 1b for "DMA is considered idle when there is no Rx or Tx AND
      when there are no TLPs indicating that CPU is active detected on the
      PCIe link (such as the host executes CSR or Configuration register read
      or write operation)" and performing Tx should also fall under "active
      CPU on PCIe link" case.
      
      In addition to that, commit b6e0c419 ("igb: Move DMA Coalescing init
      code to separate function.") seems to wrongly changed from enabling
      E1000_PCIEMISC_LX_DECISION to disabling it, also fix that.
      
      Fixes: b6e0c419 ("igb: Move DMA Coalescing init code to separate function.")
      Signed-off-by: default avatarKai-Heng Feng <kai.heng.feng@canonical.com>
      Tested-by: Gurucharan <gurucharanx.g@intel.com> (A Contingent worker at Intel)
      Signed-off-by: default avatarTony Nguyen <anthony.l.nguyen@intel.com>
      Link: https://lore.kernel.org/r/20220621221056.604304-1-anthony.l.nguyen@intel.comSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      4e0effd9
  23. 18 Jun, 2022 1 commit
    • Lorenzo Bianconi's avatar
      igb: fix a use-after-free issue in igb_clean_tx_ring · 3f6a57ee
      Lorenzo Bianconi authored
      Fix the following use-after-free bug in igb_clean_tx_ring routine when
      the NIC is running in XDP mode. The issue can be triggered redirecting
      traffic into the igb NIC and then closing the device while the traffic
      is flowing.
      
      [   73.322719] CPU: 1 PID: 487 Comm: xdp_redirect Not tainted 5.18.3-apu2 #9
      [   73.330639] Hardware name: PC Engines APU2/APU2, BIOS 4.0.7 02/28/2017
      [   73.337434] RIP: 0010:refcount_warn_saturate+0xa7/0xf0
      [   73.362283] RSP: 0018:ffffc9000081f798 EFLAGS: 00010282
      [   73.367761] RAX: 0000000000000000 RBX: ffffc90000420f80 RCX: 0000000000000000
      [   73.375200] RDX: ffff88811ad22d00 RSI: ffff88811ad171e0 RDI: ffff88811ad171e0
      [   73.382590] RBP: 0000000000000900 R08: ffffffff82298f28 R09: 0000000000000058
      [   73.390008] R10: 0000000000000219 R11: ffffffff82280f40 R12: 0000000000000090
      [   73.397356] R13: ffff888102343a40 R14: ffff88810359e0e4 R15: 0000000000000000
      [   73.404806] FS:  00007ff38d31d740(0000) GS:ffff88811ad00000(0000) knlGS:0000000000000000
      [   73.413129] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
      [   73.419096] CR2: 000055cff35f13f8 CR3: 0000000106391000 CR4: 00000000000406e0
      [   73.426565] Call Trace:
      [   73.429087]  <TASK>
      [   73.431314]  igb_clean_tx_ring+0x43/0x140 [igb]
      [   73.436002]  igb_down+0x1d7/0x220 [igb]
      [   73.439974]  __igb_close+0x3c/0x120 [igb]
      [   73.444118]  igb_xdp+0x10c/0x150 [igb]
      [   73.447983]  ? igb_pci_sriov_configure+0x70/0x70 [igb]
      [   73.453362]  dev_xdp_install+0xda/0x110
      [   73.457371]  dev_xdp_attach+0x1da/0x550
      [   73.461369]  do_setlink+0xfd0/0x10f0
      [   73.465166]  ? __nla_validate_parse+0x89/0xc70
      [   73.469714]  rtnl_setlink+0x11a/0x1e0
      [   73.473547]  rtnetlink_rcv_msg+0x145/0x3d0
      [   73.477709]  ? rtnl_calcit.isra.0+0x130/0x130
      [   73.482258]  netlink_rcv_skb+0x8d/0x110
      [   73.486229]  netlink_unicast+0x230/0x340
      [   73.490317]  netlink_sendmsg+0x215/0x470
      [   73.494395]  __sys_sendto+0x179/0x190
      [   73.498268]  ? move_addr_to_user+0x37/0x70
      [   73.502547]  ? __sys_getsockname+0x84/0xe0
      [   73.506853]  ? netlink_setsockopt+0x1c1/0x4a0
      [   73.511349]  ? __sys_setsockopt+0xc8/0x1d0
      [   73.515636]  __x64_sys_sendto+0x20/0x30
      [   73.519603]  do_syscall_64+0x3b/0x80
      [   73.523399]  entry_SYSCALL_64_after_hwframe+0x44/0xae
      [   73.528712] RIP: 0033:0x7ff38d41f20c
      [   73.551866] RSP: 002b:00007fff3b945a68 EFLAGS: 00000246 ORIG_RAX: 000000000000002c
      [   73.559640] RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00007ff38d41f20c
      [   73.567066] RDX: 0000000000000034 RSI: 00007fff3b945b30 RDI: 0000000000000003
      [   73.574457] RBP: 0000000000000003 R08: 0000000000000000 R09: 0000000000000000
      [   73.581852] R10: 0000000000000000 R11: 0000000000000246 R12: 00007fff3b945ab0
      [   73.589179] R13: 0000000000000000 R14: 0000000000000003 R15: 00007fff3b945b30
      [   73.596545]  </TASK>
      [   73.598842] ---[ end trace 0000000000000000 ]---
      
      Fixes: 9cbc948b ("igb: add XDP support")
      Signed-off-by: default avatarLorenzo Bianconi <lorenzo@kernel.org>
      Reviewed-by: default avatarJesse Brandeburg <jesse.brandeburg@intel.com>
      Acked-by: default avatarJesper Dangaard Brouer <brouer@redhat.com>
      Link: https://lore.kernel.org/r/e5c01d549dc37bff18e46aeabd6fb28a7bcf84be.1655388571.git.lorenzo@kernel.orgSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      3f6a57ee
  24. 18 May, 2022 1 commit
    • Kevin Mitchell's avatar
      igb: skip phy status check where unavailable · 942d2ad5
      Kevin Mitchell authored
      igb_read_phy_reg() will silently return, leaving phy_data untouched, if
      hw->ops.read_reg isn't set. Depending on the uninitialized value of
      phy_data, this led to the phy status check either succeeding immediately
      or looping continuously for 2 seconds before emitting a noisy err-level
      timeout. This message went out to the console even though there was no
      actual problem.
      
      Instead, first check if there is read_reg function pointer. If not,
      proceed without trying to check the phy status register.
      
      Fixes: b72f3f72 ("igb: When GbE link up, wait for Remote receiver status condition")
      Signed-off-by: default avatarKevin Mitchell <kevmitch@arista.com>
      Tested-by: Gurucharan <gurucharanx.g@intel.com> (A Contingent worker at Intel)
      Signed-off-by: default avatarTony Nguyen <anthony.l.nguyen@intel.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      942d2ad5
  25. 07 Feb, 2022 1 commit
  26. 27 Jan, 2022 1 commit
  27. 29 Dec, 2021 3 commits
  28. 28 Dec, 2021 1 commit
  29. 21 Dec, 2021 1 commit
  30. 15 Dec, 2021 1 commit
  31. 13 Dec, 2021 1 commit
  32. 25 Nov, 2021 1 commit
  33. 17 Nov, 2021 1 commit
  34. 29 Oct, 2021 1 commit
    • Jan Kundrát's avatar
      igb: unbreak I2C bit-banging on i350 · a97f8783
      Jan Kundrát authored
      The driver tried to use Linux' native software I2C bus master
      (i2c-algo-bits) for exporting the I2C interface that talks to the SFP
      cage(s) towards userspace. As-is, however, the physical SCL/SDA pins
      were not moving at all, staying at logical 1 all the time.
      
      The main culprit was the I2CPARAMS register where igb was not setting
      the I2CBB_EN bit. That meant that all the careful signal bit-banging was
      actually not being propagated to the chip pads (I verified this with a
      scope).
      
      The bit-banging was not correct either, because I2C is supposed to be an
      open-collector bus, and the code was driving both lines via a totem
      pole. The code was also trying to do operations which did not make any
      sense with the i2c-algo-bits, namely manipulating both SDA and SCL from
      igb_set_i2c_data (which is only supposed to set SDA). I'm not sure if
      that was meant as an optimization, or was just flat out wrong, but given
      that the i2c-algo-bits is set up to work with a totally dumb GPIO-ish
      implementation underneath, there's no need for this code to be smart.
      
      The open-drain vs. totem-pole is fixed by the usual trick where the
      logical zero is implemented via regular output mode and outputting a
      logical 0, and the logical high is implemented via the IO pad configured
      as an input (thus floating), and letting the mandatory pull-up resistors
      do the rest. Anything else is actually wrong on I2C where all devices
      are supposed to have open-drain connection to the bus.
      
      The missing I2CBB_EN is set (along with a safe initial value of the
      GPIOs) just before registering this software I2C bus.
      
      The chip datasheet mentions HW-implemented I2C transactions (SFP EEPROM
      reads and writes) as well, but I'm not touching these for simplicity.
      
      Tested on a LR-Link LRES2203PF-2SFP (which is an almost-miniPCIe form
      factor card, a cable, and a module with two SFP cages). There was one
      casualty, an old broken SFP we had laying around, which was used to
      solder some thin wires as a DIY I2C breakout. Thanks for your service.
      With this patch in place, I can `i2cdump -y 3 0x51 c` and read back data
      which make sense. Yay.
      Signed-off-by: default avatarJan Kundrát <jan.kundrat@cesnet.cz>
      See-also: https://www.spinics.net/lists/netdev/msg490554.htmlReviewed-by: default avatarJesse Brandeburg <jesse.brandeburg@intel.com>
      Tested-by: default avatarTony Brelinski <tony.brelinski@intel.com>
      Signed-off-by: default avatarTony Nguyen <anthony.l.nguyen@intel.com>
      a97f8783
  35. 05 Oct, 2021 1 commit
  36. 27 Jul, 2021 1 commit
    • Arnd Bergmann's avatar
      dev_ioctl: split out ndo_eth_ioctl · a7605370
      Arnd Bergmann authored
      Most users of ndo_do_ioctl are ethernet drivers that implement
      the MII commands SIOCGMIIPHY/SIOCGMIIREG/SIOCSMIIREG, or hardware
      timestamping with SIOCSHWTSTAMP/SIOCGHWTSTAMP.
      
      Separate these from the few drivers that use ndo_do_ioctl to
      implement SIOCBOND, SIOCBR and SIOCWANDEV commands.
      
      This is a purely cosmetic change intended to help readers find
      their way through the implementation.
      
      Cc: Doug Ledford <dledford@redhat.com>
      Cc: Jason Gunthorpe <jgg@ziepe.ca>
      Cc: Jay Vosburgh <j.vosburgh@gmail.com>
      Cc: Veaceslav Falico <vfalico@gmail.com>
      Cc: Andy Gospodarek <andy@greyhouse.net>
      Cc: Andrew Lunn <andrew@lunn.ch>
      Cc: Vivien Didelot <vivien.didelot@gmail.com>
      Cc: Florian Fainelli <f.fainelli@gmail.com>
      Cc: Vladimir Oltean <olteanv@gmail.com>
      Cc: Leon Romanovsky <leon@kernel.org>
      Cc: linux-rdma@vger.kernel.org
      Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
      Acked-by: default avatarJason Gunthorpe <jgg@nvidia.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      a7605370