1. 08 3月, 2018 2 次提交
  2. 28 2月, 2018 1 次提交
  3. 09 2月, 2018 1 次提交
  4. 16 1月, 2018 1 次提交
  5. 14 12月, 2017 1 次提交
    • R
      net: phy: fix resume handling · f5e64032
      Russell King 提交于
      When a PHY has the BMCR_PDOWN bit set, it may decide to ignore writes
      to other registers, or reset the registers to power-on defaults.
      Micrel PHYs do this for their interrupt registers.
      
      The current structure of phylib tries to enable interrupts before
      resuming (and releasing) the BMCR_PDOWN bit.  This fails, causing
      Micrel PHYs to stop working after a suspend/resume sequence if they
      are using interrupts.
      
      Fix this by ensuring that the PHY driver resume methods do not take
      the phydev->lock mutex themselves, but the callers of phy_resume()
      take that lock.  This then allows us to move the call to phy_resume()
      before we enable interrupts in phy_start().
      Signed-off-by: NRussell King <rmk+kernel@armlinux.org.uk>
      Reviewed-by: NAndrew Lunn <andrew@lunn.ch>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      f5e64032
  6. 04 12月, 2017 2 次提交
  7. 02 12月, 2017 1 次提交
  8. 22 9月, 2017 1 次提交
  9. 31 8月, 2017 1 次提交
    • F
      Revert "net: phy: Correctly process PHY_HALTED in phy_stop_machine()" · ebc8254a
      Florian Fainelli 提交于
      This reverts commit 7ad813f2 ("net: phy:
      Correctly process PHY_HALTED in phy_stop_machine()") because it is
      creating the possibility for a NULL pointer dereference.
      
      David Daney provide the following call trace and diagram of events:
      
      When ndo_stop() is called we call:
      
       phy_disconnect()
          +---> phy_stop_interrupts() implies: phydev->irq = PHY_POLL;
          +---> phy_stop_machine()
          |      +---> phy_state_machine()
          |              +----> queue_delayed_work(): Work queued.
          +--->phy_detach() implies: phydev->attached_dev = NULL;
      
      Now at a later time the queued work does:
      
       phy_state_machine()
          +---->netif_carrier_off(phydev->attached_dev): Oh no! It is NULL:
      
       CPU 12 Unable to handle kernel paging request at virtual address
      0000000000000048, epc == ffffffff80de37ec, ra == ffffffff80c7c
      Oops[#1]:
      CPU: 12 PID: 1502 Comm: kworker/12:1 Not tainted 4.9.43-Cavium-Octeon+ #1
      Workqueue: events_power_efficient phy_state_machine
      task: 80000004021ed100 task.stack: 8000000409d70000
      $ 0   : 0000000000000000 ffffffff84720060 0000000000000048 0000000000000004
      $ 4   : 0000000000000000 0000000000000001 0000000000000004 0000000000000000
      $ 8   : 0000000000000000 0000000000000000 00000000ffff98f3 0000000000000000
      $12   : 8000000409d73fe0 0000000000009c00 ffffffff846547c8 000000000000af3b
      $16   : 80000004096bab68 80000004096babd0 0000000000000000 80000004096ba800
      $20   : 0000000000000000 0000000000000000 ffffffff81090000 0000000000000008
      $24   : 0000000000000061 ffffffff808637b0
      $28   : 8000000409d70000 8000000409d73cf0 80000000271bd300 ffffffff80c7804c
      Hi    : 000000000000002a
      Lo    : 000000000000003f
      epc   : ffffffff80de37ec netif_carrier_off+0xc/0x58
      ra    : ffffffff80c7804c phy_state_machine+0x48c/0x4f8
      Status: 14009ce3        KX SX UX KERNEL EXL IE
      Cause : 00800008 (ExcCode 02)
      BadVA : 0000000000000048
      PrId  : 000d9501 (Cavium Octeon III)
      Modules linked in:
      Process kworker/12:1 (pid: 1502, threadinfo=8000000409d70000,
      task=80000004021ed100, tls=0000000000000000)
      Stack : 8000000409a54000 80000004096bab68 80000000271bd300 80000000271c1e00
              0000000000000000 ffffffff808a1708 8000000409a54000 80000000271bd300
              80000000271bd320 8000000409a54030 ffffffff80ff0f00 0000000000000001
              ffffffff81090000 ffffffff808a1ac0 8000000402182080 ffffffff84650000
              8000000402182080 ffffffff84650000 ffffffff80ff0000 8000000409a54000
              ffffffff808a1970 0000000000000000 80000004099e8000 8000000402099240
              0000000000000000 ffffffff808a8598 0000000000000000 8000000408eeeb00
              8000000409a54000 00000000810a1d00 0000000000000000 8000000409d73de8
              8000000409d73de8 0000000000000088 000000000c009c00 8000000409d73e08
              8000000409d73e08 8000000402182080 ffffffff808a84d0 8000000402182080
              ...
      Call Trace:
      [<ffffffff80de37ec>] netif_carrier_off+0xc/0x58
      [<ffffffff80c7804c>] phy_state_machine+0x48c/0x4f8
      [<ffffffff808a1708>] process_one_work+0x158/0x368
      [<ffffffff808a1ac0>] worker_thread+0x150/0x4c0
      [<ffffffff808a8598>] kthread+0xc8/0xe0
      [<ffffffff808617f0>] ret_from_kernel_thread+0x14/0x1c
      
      The original motivation for this change originated from Marc Gonzales
      indicating that his network driver did not have its adjust_link callback
      executing with phydev->link = 0 while he was expecting it.
      
      PHYLIB has never made any such guarantees ever because phy_stop() merely just
      tells the workqueue to move into PHY_HALTED state which will happen
      asynchronously.
      Reported-by: NGeert Uytterhoeven <geert+renesas@glider.be>
      Reported-by: NDavid Daney <ddaney.cavm@gmail.com>
      Fixes: 7ad813f2 ("net: phy: Correctly process PHY_HALTED in phy_stop_machine()")
      Signed-off-by: NFlorian Fainelli <f.fainelli@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      ebc8254a
  10. 07 8月, 2017 5 次提交
  11. 01 8月, 2017 2 次提交
  12. 28 7月, 2017 1 次提交
  13. 14 6月, 2017 1 次提交
  14. 09 6月, 2017 1 次提交
  15. 07 6月, 2017 3 次提交
  16. 05 6月, 2017 1 次提交
  17. 16 5月, 2017 1 次提交
    • M
      net: fix some identation issues at kernel-doc markups · d651983d
      Mauro Carvalho Chehab 提交于
      Sphinx is very pedantic with regards to identation and
      escape sequences:
      
        ./include/net/sock.h:1967: ERROR: Unexpected indentation.
        ./include/net/sock.h:1969: ERROR: Unexpected indentation.
        ./include/net/sock.h:1970: WARNING: Block quote ends without a blank line; unexpected unindent.
        ./include/net/sock.h:1971: WARNING: Block quote ends without a blank line; unexpected unindent.
        ./include/net/sock.h:2268: WARNING: Inline emphasis start-string without end-string.
        ./net/core/sock.c:2686: ERROR: Unexpected indentation.
        ./net/core/sock.c:2687: WARNING: Block quote ends without a blank line; unexpected unindent.
        ./net/core/datagram.c:182: WARNING: Inline emphasis start-string without end-string.
        ./include/linux/netdevice.h:1444: ERROR: Unexpected indentation.
        ./drivers/net/phy/phy.c:381: ERROR: Unexpected indentation.
        ./drivers/net/phy/phy.c:382: WARNING: Block quote ends without a blank line; unexpected unindent.
      
      - Fix spacing where needed;
      - Properly escape constants;
      - Use a literal block for a race description.
      
      No functional changes.
      Signed-off-by: NMauro Carvalho Chehab <mchehab@s-opensource.com>
      d651983d
  18. 27 4月, 2017 1 次提交
    • A
      net: phy: fix auto-negotiation stall due to unavailable interrupt · f555f34f
      Alexander Kochetkov 提交于
      The Ethernet link on an interrupt driven PHY was not coming up if the Ethernet
      cable was plugged before the Ethernet interface was brought up.
      
      The patch trigger PHY state machine to update link state if PHY was requested to
      do auto-negotiation and auto-negotiation complete flag already set.
      
      During power-up cycle the PHY do auto-negotiation, generate interrupt and set
      auto-negotiation complete flag. Interrupt is handled by PHY state machine but
      doesn't update link state because PHY is in PHY_READY state. After some time
      MAC bring up, start and request PHY to do auto-negotiation. If there are no new
      settings to advertise genphy_config_aneg() doesn't start PHY auto-negotiation.
      PHY continue to stay in auto-negotiation complete state and doesn't fire
      interrupt. At the same time PHY state machine expect that PHY started
      auto-negotiation and is waiting for interrupt from PHY and it won't get it.
      
      Fixes: 321beec5 ("net: phy: Use interrupts when available in NOLINK state")
      Signed-off-by: NAlexander Kochetkov <al.kochet@gmail.com>
      Cc: stable <stable@vger.kernel.org> # v4.9+
      Tested-by: NRoger Quadros <rogerq@ti.com>
      Tested-by: NAlexandre Belloni <alexandre.belloni@free-electrons.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      f555f34f
  19. 18 4月, 2017 2 次提交
    • R
      net: phy: simplify phy_supported_speeds() · 786df9c2
      Russell King 提交于
      Simplify the loop in phy_supported_speeds().
      Signed-off-by: NRussell King <rmk+kernel@armlinux.org.uk>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      786df9c2
    • R
      net: phy: improve phylib correctness for non-autoneg settings · d0613037
      Russell King 提交于
      phylib has some undesirable behaviour when forcing a link mode through
      ethtool.  phylib uses this code:
      
      	idx = phy_find_valid(phy_find_setting(phydev->speed, phydev->duplex),
      			features);
      
      to find an index in the settings table.  phy_find_setting() starts at
      index 0, and scans upwards looking for an exact speed and duplex match.
      When it doesn't find it, it returns MAX_NUM_SETTINGS - 1, which is
      10baseT-Half duplex.
      
      phy_find_valid() then scans from the point (and effectively only checks
      one entry) before bailing out, returning MAX_NUM_SETTINGS - 1.
      
      phy_sanitize_settings() then sets ->speed to SPEED_10 and ->duplex to
      DUPLEX_HALF whether or not 10baseT-Half is supported or not.  This goes
      against all the comments against these functions, and 10baseT-Half may
      not even be supported by the hardware.
      
      Rework these functions, introducing a new method of scanning the table.
      There are two modes of lookup that phylib wants: exact, and inexact.
      
      - in exact mode, we return either an exact match or failure
      - in inexact mode, we return an exact match if it exists, a match at
        the highest speed that is not greater than the requested speed
        (ignoring duplex), or failing that, the lowest supported speed, or
        failure.
      
      The biggest difference is that we always check whether the entry is
      supported before further consideration, so all unsupported entries are
      not considered as candidates.
      
      This results in arguably saner behaviour, better matches the comments,
      and is probably what users would expect.
      
      This becomes important as ethernet speeds increase, PHYs exist which do
      not support the 10Mbit speeds, and half-duplex is likely to become
      obsolete - it's already not even an option on 10Gbit and faster links.
      Signed-off-by: NRussell King <rmk+kernel@armlinux.org.uk>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      d0613037
  20. 05 4月, 2017 1 次提交
  21. 02 4月, 2017 3 次提交
  22. 25 3月, 2017 1 次提交
  23. 23 3月, 2017 2 次提交
  24. 25 2月, 2017 1 次提交
  25. 20 2月, 2017 1 次提交
  26. 26 1月, 2017 1 次提交
  27. 24 1月, 2017 1 次提交