Skip to content
  1. Aug 03, 2017
  2. Aug 02, 2017
    • David S. Miller's avatar
      Merge branch 'dsa-rework-EEE-support' · cb5b136c
      David S. Miller authored
      
      
      Vivien Didelot says:
      
      ====================
      net: dsa: rework EEE support
      
      EEE implies configuring the port's PHY and MAC of both ends of the wire.
      
      The current EEE support in DSA mixes PHY and MAC configuration, which is
      bad because PHYs must be configured through a proper PHY driver. The DSA
      switch operations for EEE are only meant for configuring the port's MAC,
      which are integrated in the Ethernet switch device.
      
      This patchset fixes the EEE support in qca8k driver, makes the DSA layer
      call phy_init_eee for all drivers, and remove the EEE support from the
      mv88e6xxx driver since the Marvell PHY driver should be enough for it.
      
      Changes in v2:
       - make PHY device and DSA EEE ops mandatory for slave EEE operations.
       - simply return 0 in drivers which don't need to do anything to
         configure the port' MAC. Subsequent PHY calls will be enough.
      ====================
      
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      cb5b136c
    • Vivien Didelot's avatar
      net: dsa: rename switch EEE ops · 08f50061
      Vivien Didelot authored
      
      
      To avoid confusion with the PHY EEE settings, rename the .set_eee and
      .get_eee ops to respectively .set_mac_eee and .get_mac_eee.
      
      Signed-off-by: default avatarVivien Didelot <vivien.didelot@savoirfairelinux.com>
      Reviewed-by: default avatarAndrew Lunn <andrew@lunn.ch>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      08f50061
    • Vivien Didelot's avatar
      net: dsa: mv88e6xxx: remove EEE support · 5480db69
      Vivien Didelot authored
      
      
      The PHY's EEE settings are already accessed by the DSA layer through the
      Marvell PHY driver and there is nothing to be done for switch's MACs.
      
      Remove all EEE support from the mv88e6xxx driver and simply return 0
      from the EEE ops.
      
      Signed-off-by: default avatarVivien Didelot <vivien.didelot@savoirfairelinux.com>
      Reviewed-by: default avatarAndrew Lunn <andrew@lunn.ch>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      5480db69
    • Vivien Didelot's avatar
      net: dsa: remove PHY device argument from .set_eee · 46587e4a
      Vivien Didelot authored
      
      
      The DSA switch operations for EEE are only meant to configure a port's
      MAC EEE settings. The port's PHY EEE settings are accessed by the DSA
      layer and must be made available via a proper PHY driver.
      
      In order to reduce this confusion, remove the phy_device argument from
      the .set_eee operation.
      
      Signed-off-by: default avatarVivien Didelot <vivien.didelot@savoirfairelinux.com>
      Reviewed-by: default avatarAndrew Lunn <andrew@lunn.ch>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      46587e4a
    • Vivien Didelot's avatar
      net: dsa: call phy_init_eee in DSA layer · c48f7eb3
      Vivien Didelot authored
      
      
      All DSA drivers are calling phy_init_eee if eee_enabled is true.
      
      Move up this statement in the DSA layer to simplify the DSA drivers.
      qca8k does not require to cache the ethtool_eee structures from now on.
      
      Signed-off-by: default avatarVivien Didelot <vivien.didelot@savoirfairelinux.com>
      Reviewed-by: default avatarAndrew Lunn <andrew@lunn.ch>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      c48f7eb3
    • Vivien Didelot's avatar
      net: dsa: mv88e6xxx: call phy_init_eee · 7f5c6d7c
      Vivien Didelot authored
      
      
      It is safer to init the EEE before the DSA layer call
      phy_ethtool_set_eee, as sf2 and qca8k are doing.
      
      Signed-off-by: default avatarVivien Didelot <vivien.didelot@savoirfairelinux.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      7f5c6d7c
    • Vivien Didelot's avatar
      net: dsa: bcm_sf2: remove unneeded supported flags · b11af0ce
      Vivien Didelot authored
      
      
      The SF2 driver is masking the supported bitfield of its private copy of
      the ports' ethtool_eee structures. It is used nowhere, thus remove it.
      
      Signed-off-by: default avatarVivien Didelot <vivien.didelot@savoirfairelinux.com>
      Reviewed-by: default avatarFlorian Fainelli <f.fainelli@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      b11af0ce
    • Vivien Didelot's avatar
      net: dsa: qca8k: empty qca8k_get_eee · 193da90e
      Vivien Didelot authored
      
      
      phy_ethtool_get_eee is already called by the DSA layer, thus remove the
      duplicated call in the qca8k driver.
      
      Signed-off-by: default avatarVivien Didelot <vivien.didelot@savoirfairelinux.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      193da90e
    • Vivien Didelot's avatar
      net: dsa: qca8k: do not cache unneeded EEE fields · a2444ab8
      Vivien Didelot authored
      
      
      The qca8k driver is currently caching a bitfield of the supported member
      of a ethtool_eee private structure, which is unused.
      
      Only the eee_enabled field of the private ethtool_eee copy is updated,
      thus using p->advertised and p->lp_advertised is also erroneous.
      
      Remove the usage of these private ethtool_eee members and only rely on
      phy_ethtool_get_eee to assign the eee_active member.
      
      Signed-off-by: default avatarVivien Didelot <vivien.didelot@savoirfairelinux.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      a2444ab8
    • Vivien Didelot's avatar
      net: dsa: qca8k: enable EEE once · dca20989
      Vivien Didelot authored
      
      
      If EEE is queried enabled, qca8k_set_eee calls qca8k_eee_enable_set
      twice (because it is already called in qca8k_eee_init). Fix that.
      
      Signed-off-by: default avatarVivien Didelot <vivien.didelot@savoirfairelinux.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      dca20989
    • Vivien Didelot's avatar
      net: dsa: qca8k: fix EEE init · 06d7b5c3
      Vivien Didelot authored
      
      
      The qca8k obviously copied code from the sf2 driver as how to set EEE:
      
          if (e->eee_enabled) {
              p->eee_enabled = qca8k_eee_init(ds, port, phydev);
              if (!p->eee_enabled)
                  ret = -EOPNOTSUPP;
          }
      
      But it did not use the same logic for the EEE init routine, which is
      "Returns 0 if EEE was not enabled, or 1 otherwise". This results in
      returning -EOPNOTSUPP on success and caching EEE enabled on failure.
      
      This patch fixes the returned value of qca8k_eee_init.
      
      Signed-off-by: default avatarVivien Didelot <vivien.didelot@savoirfairelinux.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      06d7b5c3
    • Vivien Didelot's avatar
      net: dsa: PHY device is mandatory for EEE · 7b9cc738
      Vivien Didelot authored
      
      
      The port's PHY and MAC are both implied in EEE. The current code does
      not call the PHY operations if the related device is NULL. Change that
      by returning -ENODEV if there's no PHY device attached to the interface.
      
      Signed-off-by: default avatarVivien Didelot <vivien.didelot@savoirfairelinux.com>
      Reviewed-by: default avatarAndrew Lunn <andrew@lunn.ch>
      Reviewed-by: default avatarFlorian Fainelli <f.fainelli@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      7b9cc738
    • David S. Miller's avatar
      Merge branch 'ravb-wol-magic-packet' · 13e6be2d
      David S. Miller authored
      
      
      Niklas Söderlund says:
      
      ====================
      ravb: add wake-on-lan support via magic packet
      
      WoL is enabled in the suspend callback by setting MagicPacket detection
      and disabling all interrupts expect MagicPacket. In the resume path the
      driver needs to reset the hardware to rearm the WoL logic, this prevents
      the driver from simply restoring the registers and to take advantage of
      that ravb was not suspended to reduce resume time. To reset the
      hardware the driver closes the device, sets it in reset mode and reopens
      the device just like it would do in a normal suspend/resume scenario
      without WoL enabled, but it both closes and opens the device in the
      resume callback since the device needs to be reset for WoL to work.
      
      One quirk needed for WoL is that the module clock needs to be prevented
      from being switched off by Runtime PM. To keep the clock alive the
      suspend callback need to call clk_enable() directly to increase the
      usage count of the clock. Then when Runtime PM decreases the clock usage
      count it won't reach 0 and be switched off.
      
      Changes since v2
      - Only do the clock dance to workaround PSCI sleep when resuming if WoL
        is enabled. This was a bug in v2 which resulted in a WARN if resuming
        from PSCI sleep with WoL disabled, thanks Sergei for pointing this
        out!
      - Break out clock dance workaround in separate patch to make it easier
        to revert once a fix is upstream for the clock driver as suggested by
        Sergei.
      
      Changes since v1
      - Fix issue where device would fail to resume from PSCI suspend if WoL
        was enabled, reported by Geert. The fault was that the clock driver
        thinks the clock is on, but PSCI have disabled it, added workaround
        for this in ravb driver which can be removed once the clock driver is
        aware of the PSCI behavior.
      - Only try to restore from wol wake up if netif is running, since this
        is a condition to enable wol in the first place this was a bug in v1.
      ====================
      
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      13e6be2d
    • Niklas Söderlund's avatar
      ravb: add workaround for clock when resuming with WoL enabled · fbf3d034
      Niklas Söderlund authored
      
      
      The renesas-cpg-mssr clock driver are not yet aware of PSCI sleep where
      power is cut to the SoC. When resuming from this state with WoL enabled
      the enable count of the ravb clock is 1 and the clock driver thinks the
      clock is already on when PM core enables the clock and increments the
      enable count to 2. This will result in the ravb driver failing to talk
      to the hardware since the module clock is off. Work around this by
      forcing the enable count to 0 and then back to 2 when resuming with WoL
      enabled.
      
      This workaround should be reverted once the renesas-cpg-mssr clock
      driver becomes aware of this PSCI sleep behavior.
      
      Signed-off-by: default avatarNiklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
      Acked-by: default avatarSergei Shtylyov <sergei.shtylyov@cogentembedded.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      fbf3d034
    • Niklas Söderlund's avatar
      ravb: add wake-on-lan support via magic packet · 3e3d6477
      Niklas Söderlund authored
      
      
      WoL is enabled in the suspend callback by setting MagicPacket detection
      and disabling all interrupts expect MagicPacket. In the resume path the
      driver needs to reset the hardware to rearm the WoL logic, this prevents
      the driver from simply restoring the registers and to take advantage of
      that ravb was not suspended to reduce resume time. To reset the
      hardware the driver closes the device, sets it in reset mode and reopens
      the device just like it would do in a normal suspend/resume scenario
      without WoL enabled, but it both closes and opens the device in the
      resume callback since the device needs to be reset for WoL to work.
      
      One quirk needed for WoL is that the module clock needs to be prevented
      from being switched off by Runtime PM. To keep the clock alive the
      suspend callback need to call clk_enable() directly to increase the
      usage count of the clock. Then when Runtime PM decreases the clock usage
      count it won't reach 0 and be switched off.
      
      Signed-off-by: default avatarNiklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
      Acked-by: default avatarSergei Shtylyov <sergei.shtylyov@cogentembedded.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      3e3d6477
    • David S. Miller's avatar
      Merge branch 'for-upstream' of... · 906a039d
      David S. Miller authored
      
      Merge branch 'for-upstream' of git://git.kernel.org/pub/scm/linux/kernel/git/bluetooth/bluetooth-next
      
      Johan Hedberg says:
      
      ====================
      pull request: bluetooth-next 2017-08-01
      
      Here's our first batch of Bluetooth patches for the 4.14 kernel:
      
       - Several new USB IDs for the btusb driver
       - Memory leak fix in btusb driver
       - Cleanups & fixes to hci_nokia, hci_serdev and hci_bcm drivers
       - Fixed cleanup path in mrf24j40 (802.15.4) driver probe function
       - A few other smaller cleanups & fixes to drivers
      
      Please let me know if there are any issues pulling. Thanks.
      ====================
      
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      906a039d
    • Willem de Bruijn's avatar
      net: add skb_frag_foreach_page and use with kmap_atomic · c613c209
      Willem de Bruijn authored
      
      
      Skb frags may contain compound pages. Various operations map frags
      temporarily using kmap_atomic, but this function works on single
      pages, not whole compound pages. The distinction is only relevant
      for high mem pages that require temporary mappings.
      
      Introduce a looping mechanism that for compound highmem pages maps
      one page at a time, does not change behavior on other pages.
      Use the loop in the kmap_atomic callers in net/core/skbuff.c.
      
      Verified by triggering skb_copy_bits with
      
          tcpdump -n -c 100 -i ${DEV} -w /dev/null &
          netperf -t TCP_STREAM -H ${HOST}
      
        and by triggering __skb_checksum with
      
          ethtool -K ${DEV} tx off
      
        repeated the tests with looping on a non-highmem platform
        (x86_64) by making skb_frag_must_loop always return true.
      
      Signed-off-by: default avatarWillem de Bruijn <willemb@google.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      c613c209
    • David S. Miller's avatar
      Merge branch 'mediatek-next' · 1ae39d65
      David S. Miller authored
      
      
      Sean Wang says:
      
      ====================
      net-next: mediatek: add support for ethernet on MT7622 SoC
      
      Changes since v2:
      - update John's mail
      
      Changes since v1:
      - add refinement for ethernet clock management
      - take out the code block for ESW, add it until ESW driver is actually introduced
      
      The series adds the driver for ethernet controller found on MT7622 SoC.
      There are additions against with previous MT7623 SoC such as shared SGMII
      given for the dual GMACs and built-in 5-ports 10/100 embedded switch support
      (ESW). Thus more clocks consumers and SGMII hardware setup for the extra
      features are all introduced here and as for the support for ESW that would be
      planned to add in the separate patch integrating with DSA infrastructure
      in the future.
      
      Currently testing successfully is done with those patches for the conditions
      such as GMAC2 with IP1001 PHY via RGMII and GMAC1/2 with RTL8211F PHY via SGMII.
      ====================
      
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      1ae39d65
    • Sean Wang's avatar
      MAINTAINERS: add Sean/Nelson as MediaTek ethernet maintainers · 0857d6f8
      Sean Wang authored
      
      
      Sean and Nelson work for MediaTek on maintaining the MediaTek ethernet
      driver for the existing SoCs and adding support for the following SoCs.
      In the past, Sean has been active at making most of the qualifications
      , stress test and submitting a lot of patches for the driver while
      Nelson was looking into the aspects more on hardware additions and details
      such as introducing PDMA with Hardware LRO to the driver. Also update
      John's up-to-date mail address in the patch.
      
      Cc: John Crispin <john@phrozen.org>
      Signed-off-by: default avatarSean Wang <sean.wang@mediatek.com>
      Signed-off-by: default avatarNelson Chang <nelson.chang@mediatek.com>
      Acked-by: default avatarJohn Crispin <john@phrozen.org>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      0857d6f8
    • Sean Wang's avatar
      net-next: mediatek: add support for MediaTek MT7622 SoC · 42c03844
      Sean Wang authored
      
      
      This patch adds the driver for ethernet controller on MT7622 SoC. It has
      the similar handling logic as the previously MT7623 does, but there are
      additions against with MT7623 SoC, the shared SGMII given for the dual
      GMACs and including 5-ports 10/100 embedded switch support (ESW) as the
      GMAC1 option, thus more clocks consumers for the extra feature are
      introduced here. So for ease portability and maintenance, those
      differences all are being kept inside the platform data as other drivers
      usually do. Currently testing successfully is done with those patches for
      the conditions such as GMAC2 with IP1001 PHY via RGMII and GMAC1/2 with
      RTL8211F PHY via SGMII.
      
      Signed-off-by: default avatarSean Wang <sean.wang@mediatek.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      42c03844
    • Sean Wang's avatar
      net-next: mediatek: add platform data to adapt into various hardware · 2ec50f57
      Sean Wang authored
      
      
      This patch is the preparation patch in order to adapt into various
      hardware through adding platform data which holds specific characteristics
      among MediaTek SoCs and introducing the unified clock handler for those
      distinct clock requirements depending on different features such as
      TRGMII and SGMII getting support on the target SoC. And finally, add
      enhancement with given the generic description for Kconfig and remove the
      unnecessary machine type dependency in Makefile.
      
      Signed-off-by: default avatarSean Wang <sean.wang@mediatek.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      2ec50f57
    • Sean Wang's avatar
      dt-bindings: net: mediatek: add support for MediaTek MT7623 and MT7622 SoC · da779b40
      Sean Wang authored
      
      
      The patch adds the supplements in the dt-binding document for MediaTek
      MT7622 SoC with extra SGMII system controller and relevant clock consumers
      listed as the requirements for those SoCs equipped with the SGMII circuit.
      Also, add the missing binding information for MT7623 SoC here which relies
      on the fallback binding of MT2701.
      
      Signed-off-by: default avatarSean Wang <sean.wang@mediatek.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      da779b40
    • David S. Miller's avatar
      Merge branch 'kzproxy-next' · 2e674381
      David S. Miller authored
      
      
      Tom Herbert says:
      
      ====================
      net: Infrastructure changes for [kz]proxy
      
      This patch set contains some general infrastructure enhancements that
      will be used by kernel proxy and zero proxy.
      
      The changes are:
        - proto_ops: Add locked versions of sendmsg and sendpage
        - skb_send_sock: Allow sending and skb on a socket within the
          kernel
        - Generalize strparser. Allow it to be used in other contexts than
          just in the read_sock path. This will be used in the transmit
          path of zero proxy.
      
      Some nice future work (which I've been discussing with John Fastabend)
      will be to make some of the related functions to allow gifting of skbs
      We should be able to do that with skb_send_sock and strp_process. I'd
      also like this feature in the read_sock callbeck.
      
      Tested: Ran modified kernel without incident. Tested new functionality
      using zero proxy (in development).
      ====================
      
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      2e674381