1. 12 9月, 2018 1 次提交
    • K
      r8169: Clear RTL_FLAG_TASK_*_PENDING when clearing RTL_FLAG_TASK_ENABLED · 6ad56901
      Kai-Heng Feng 提交于
      After system suspend, sometimes the r8169 doesn't work when ethernet
      cable gets pluggued.
      
      This issue happens because rtl_reset_work() doesn't get called from
      rtl8169_runtime_resume(), after system suspend.
      
      In rtl_task(), RTL_FLAG_TASK_* only gets cleared if this condition is
      met:
      if (!netif_running(dev) ||
          !test_bit(RTL_FLAG_TASK_ENABLED, tp->wk.flags))
          ...
      
      If RTL_FLAG_TASK_ENABLED was cleared during system suspend while
      RTL_FLAG_TASK_RESET_PENDING was set, the next rtl_schedule_task() won't
      schedule task as the flag is still there.
      
      So in addition to clearing RTL_FLAG_TASK_ENABLED, also clears other
      flags.
      
      Cc: Heiner Kallweit <hkallweit1@gmail.com>
      Signed-off-by: NKai-Heng Feng <kai.heng.feng@canonical.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      6ad56901
  2. 08 9月, 2018 1 次提交
    • M
      r8169: set TxConfig register after TX / RX is enabled, just like RxConfig · f74dd480
      Maciej S. Szmigiero 提交于
      Commit 3559d81e ("r8169: simplify rtl_hw_start_8169") changed order of
      two register writes:
      1) Caused RxConfig to be written before TX / RX is enabled,
      2) Caused TxConfig to be written before TX / RX is enabled.
      
      At least on XIDs 10000000 ("RTL8169sb/8110sb") and
      18000000 ("RTL8169sc/8110sc") such writes are ignored by the chip, leaving
      values in these registers intact.
      
      Change 1) was reverted by
      commit 05212ba8 ("r8169: set RxConfig after tx/rx is enabled for RTL8169sb/8110sb devices"),
      however change 2) wasn't.
      
      In practice, this caused TxConfig's "InterFrameGap time" and "Max DMA Burst
      Size per Tx DMA Burst" bits to be zero dramatically reducing TX performance
      (in my tests it dropped from around 500Mbps to around 50Mbps).
      
      This patch fixes the issue by moving TxConfig register write a bit later in
      the code so it happens after TX / RX is already enabled.
      
      Fixes: 05212ba8 ("r8169: set RxConfig after tx/rx is enabled for RTL8169sb/8110sb devices")
      Signed-off-by: NMaciej S. Szmigiero <mail@maciej.szmigiero.name>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      f74dd480
  3. 04 9月, 2018 1 次提交
  4. 30 8月, 2018 1 次提交
    • A
      r8169: set RxConfig after tx/rx is enabled for RTL8169sb/8110sb devices · 05212ba8
      Azat Khuzhin 提交于
      I have two Ethernet adapters:
        r8169 0000:03:01.0 eth0: RTL8169sb/8110sb, 00:14:d1:14:2d:49, XID 10000000, IRQ 18
        r8169 0000:01:00.0 eth0: RTL8168e/8111e, 64:66:b3:11:14:5d, XID 2c200000, IRQ 30
      And after upgrading from linux 4.15 [1] to linux 4.18+ [2] RTL8169sb failed to
      receive any packets. tcpdump shows a lot of checksum mismatch.
      
        [1]: a0f79386
        [2]: 05193597 (4.19 merge window opened)
      
      I started bisecting and the found that [3] breaks it. According to [4]:
        "For 8110S, 8110SB, and 8110SC series, the initial value of RxConfig
        needs to be set after the tx/rx is enabled."
      So I moved rtl_init_rxcfg() after enabling tx/rs and now my adapter works
      (RTL8168e works too).
      
        [3]: 3559d81e
        [4]: e542a226 ("r8169: adjust the RxConfig
      settings.")
      
      Also drop "rx" from rtl_set_rx_tx_config_registers(), since it does nothing
      with it already.
      
      Fixes: 3559d81e ("r8169: simplify
      rtl_hw_start_8169")
      
      Cc: Heiner Kallweit <hkallweit1@gmail.com>
      Cc: David S. Miller <davem@davemloft.net>
      Cc: netdev@vger.kernel.org
      Cc: Realtek linux nic maintainers <nic_swsd@realtek.com>
      Signed-off-by: NAzat Khuzhin <a3at.mail@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      05212ba8
  5. 20 8月, 2018 1 次提交
    • J
      r8169: don't use MSI-X on RTL8106e · 7bb05b85
      Jian-Hong Pan 提交于
      Found the ethernet network on ASUS X441UAR doesn't come back on resume
      from suspend when using MSI-X.  The chip is RTL8106e - version 39.
      
      [   21.848357] libphy: r8169: probed
      [   21.848473] r8169 0000:02:00.0 eth0: RTL8106e, 0c:9d:92:32:67:b4, XID
      44900000, IRQ 127
      [   22.518860] r8169 0000:02:00.0 enp2s0: renamed from eth0
      [   29.458041] Generic PHY r8169-200:00: attached PHY driver [Generic
      PHY] (mii_bus:phy_addr=r8169-200:00, irq=IGNORE)
      [   63.227398] r8169 0000:02:00.0 enp2s0: Link is Up - 100Mbps/Full -
      flow control off
      [  124.514648] Generic PHY r8169-200:00: attached PHY driver [Generic
      PHY] (mii_bus:phy_addr=r8169-200:00, irq=IGNORE)
      
      Here is the ethernet controller in detail:
      
      02:00.0 Ethernet controller [0200]: Realtek Semiconductor Co., Ltd.
      RTL8101/2/6E PCI Express Fast/Gigabit Ethernet controller [10ec:8136]
      (rev 07)
      	Subsystem: ASUSTeK Computer Inc. RTL810xE PCI Express Fast
      Ethernet controller [1043:200f]
      	Flags: bus master, fast devsel, latency 0, IRQ 16
      	I/O ports at e000 [size=256]
      	Memory at ef100000 (64-bit, non-prefetchable) [size=4K]
      	Memory at e0000000 (64-bit, prefetchable) [size=16K]
      	Capabilities: <access denied>
      	Kernel driver in use: r8169
      	Kernel modules: r8169
      
      Falling back to MSI fixes the issue.
      
      Fixes: 6c6aa15f ("r8169: improve interrupt handling")
      Signed-off-by: NJian-Hong Pan <jian-hong@endlessm.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      7bb05b85
  6. 13 8月, 2018 1 次提交
  7. 11 8月, 2018 5 次提交
  8. 25 7月, 2018 1 次提交
  9. 18 7月, 2018 11 次提交
  10. 05 7月, 2018 1 次提交
  11. 03 7月, 2018 1 次提交
  12. 02 7月, 2018 1 次提交
    • H
      r8169: remove old PHY reset hack · 335c997d
      Heiner Kallweit 提交于
      This hack (affecting the non-PCIe models only) was introduced in 2004
      to deal with link negotiation failures in 1GBit mode. Based on a
      comment in the r8169 vendor driver I assume the issue affects RTL8169sb
      in combination with particular 1GBit switch models.
      
      Resetting the PHY every 10s and hoping that one fine day we will make
      it to establish the link seems to be very hacky to me. I'd say:
      If 1GBit doesn't work reliably in a users environment then the user
      should remove 1GBit from the advertised modes, e.g. by using
      ethtool -s <if> advertise <10/100 modes>
      
      If the issue affects one chip version only and that with most link
      partners, then we could also think of removing 1GBit from the
      advertised modes for this chip version in the driver.
      Signed-off-by: NHeiner Kallweit <hkallweit1@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      335c997d
  13. 30 6月, 2018 2 次提交
    • H
      r8169: remove TBI 1000BaseX support · e397286b
      Heiner Kallweit 提交于
      The very first version of RTL8169 from 2002 (and only this one) has
      support for a TBI 1000BaseX fiber interface. The TBI support in the
      driver makes switching to phylib tricky, so best would be to get
      rid of it. I found no report from anybody using a device with RTL8169
      and fiber interface, also the vendor driver doesn't support this mode
      (any longer).
      So remove TBI support and bail out with a message if a card with
      activated TBI is detected. If there really should be any user of it
      out there, we could add a stripped-down version of the driver
      supporting chip version 01 and TBI only (and maybe move it to
      staging).
      Signed-off-by: NHeiner Kallweit <hkallweit1@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      e397286b
    • H
      r8169: use standard debug output functions · 49d17512
      Heiner Kallweit 提交于
      I see no need to define a private debug output symbol, let's use the
      standard debug output functions instead. In this context also remove
      the deprecated PFX define.
      
      The one assertion is wrong IMO anyway, this code path is used also
      by chip version 01.
      Signed-off-by: NHeiner Kallweit <hkallweit1@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      49d17512
  14. 26 6月, 2018 1 次提交
  15. 25 6月, 2018 3 次提交
  16. 23 6月, 2018 2 次提交
  17. 22 6月, 2018 2 次提交
  18. 21 6月, 2018 1 次提交
  19. 21 5月, 2018 1 次提交
    • H
      r8169: fix network error on resume from suspend · 52f8560e
      Heiner Kallweit 提交于
      This commit removed calls to rtl_set_rx_mode(). This is ok for the
      standard path if the link is brought up, however it breaks system
      resume from suspend. Link comes up but no network traffic.
      
      Meanwhile common code from rtl_hw_start_8169/8101/8168() was moved
      to rtl_hw_start(), therefore re-add the call to rtl_set_rx_mode()
      there.
      
      Due to adding this call we have to move definition of rtl_hw_start()
      after definition of rtl_set_rx_mode().
      Signed-off-by: NHeiner Kallweit <hkallweit1@gmail.com>
      Fixes: 82d3ff6d ("r8169: remove calls to rtl_set_rx_mode")
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      52f8560e
  20. 09 5月, 2018 1 次提交
    • H
      r8169: fix powering up RTL8168h · 3148dedf
      Heiner Kallweit 提交于
      Since commit a92a0849 "r8169: improve runtime pm in general and
      suspend unused ports" interfaces w/o link are runtime-suspended after
      10s. On systems where drivers take longer to load this can lead to the
      situation that the interface is runtime-suspended already when it's
      initially brought up.
      This shouldn't be a problem because rtl_open() resumes MAC/PHY.
      However with at least one chip version the interface doesn't properly
      come up, as reported here:
      https://bugzilla.kernel.org/show_bug.cgi?id=199549
      
      The vendor driver uses a delay to give certain chip versions some
      time to resume before starting the PHY configuration. So let's do
      the same. I don't know which chip versions may be affected,
      therefore apply this delay always.
      
      This patch was reported to fix the issue for RTL8168h.
      I was able to reproduce the issue on an Asus H310I-Plus which also
      uses a RTL8168h. Also in my case the patch fixed the issue.
      Reported-by: NSlava Kardakov <ojab@ojab.ru>
      Tested-by: NSlava Kardakov <ojab@ojab.ru>
      Signed-off-by: NHeiner Kallweit <hkallweit1@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      3148dedf
  21. 03 5月, 2018 1 次提交