aboutsummaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)AuthorFilesLines
2018-01-03nfp: add repr_preclean callbackDirk van der Merwe2-3/+25
Just before a repr is cleaned up, we give the app a chance to perform some preclean configuration while the reprs pointer is still configured for the app. Signed-off-by: Dirk van der Merwe <dirk.vandermerwe@netronome.com> Reviewed-by: Jakub Kicinski <jakub.kicinski@netronome.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2018-01-03nfp: flower: obtain repr link state only from firmwareDirk van der Merwe2-2/+2
Instead of starting up reprs assuming that there is link, only respond to the link state reported by firmware. Furthermore, ensure link is down after repr netdevs are created. Signed-off-by: Dirk van der Merwe <dirk.vandermerwe@netronome.com> Reviewed-by: Jakub Kicinski <jakub.kicinski@netronome.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2018-01-03net: mdio: Only perform gpio reset for PHYsAndrew Lunn1-4/+17
Ethernet switch on the MDIO bus have historically performed their own handling of the GPIO reset line. The resent patch to have the MDIO core handle the reset has broken the switch drivers, in that they cannot claim the GPIO. Some switch drivers need more control over the GPIO line than what the MDIO core provides. So restore the historical behaviour by only performing a reset of PHYs, not switches. Fixes: bafbdd527d56 ("phylib: Add device reset GPIO support") Reported-by: Sean Wang <sean.wang@mediatek.com> Signed-off-by: Andrew Lunn <andrew@lunn.ch> Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be> Tested-by: Geert Uytterhoeven <geert+renesas@glider.be> Signed-off-by: David S. Miller <davem@davemloft.net>
2018-01-03Merge branch 'net-Resolve-races-in-phy-accessors'David S. Miller7-346/+490
Russell King says: ==================== Resolve races in phy accessors This series resolves races with various accesses to PHY registers. The first five patches are necessary before we add phylink support to mvneta, the remaining three are merely cleanups for unobserved races, and hence are less critical. There are two possible classes of races that can occur: where we write to a page register that changes the meaning of a group of other registers, and where we read-modify-write a register. Resolve these races by performing the accesses under the mdio bus lock, ensuring that no other user can access the bus while the series of atomic operations are being performed. These patches have been posted before, and have been modified along the lines of previous feedback: - The third patch was originally reviewed by Florian, but as I've added __phy_modify() to it, I've removed that attributation. - Included generic page-based accessors as suggested last time around. - Since we have the unlocked __phy_modify() in this patch series, it is sensible to include the changes for this to marvell.c - these accessors have to change anyway to avoid deadlocks on the mdio bus lock. I haven't been able to test the at803x.c changes yet beyond compile testing - although I do have systems with an ar8035 PHY. However, they should be straight forward to review. This is targetted for net-next because the races have not been found in existing drivers, but have been observed with phylink integrated into mvneta - that's not to say that the races do not exist today, they are just unobserved (probably through lack of rigorous enough testing.) The race provoking condition is detailed in patch 5. ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
2018-01-03net: phy: convert read-modify-write to phy_modify()Russell King3-112/+46
Convert read-modify-write sequences in at803x, Marvell and core phylib to use phy_modify() to ensure safety. Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk> Reviewed-by: Andrew Lunn <andrew@lunn.ch> Signed-off-by: David S. Miller <davem@davemloft.net>
2018-01-03net: phy: add phy_modify() accessorRussell King2-0/+24
Add phy_modify() convenience accessor to complement the mdiobus counterpart. Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk> Reviewed-by: Andrew Lunn <andrew@lunn.ch> Signed-off-by: David S. Miller <davem@davemloft.net>
2018-01-03net: phy: marvell: fix paged access racesRussell King1-217/+137
For paged accesses to be truely safe, we need to hold the bus lock to prevent anyone else gaining access to the registers while we modify them. The phydev->lock mutex does not do this: userspace via the MII ioctl can still sneak in and read or write any register while we are on a different page, and the suspend/resume methods can be called by a thread different to the thread polling the phy status. Races have been observed with mvneta on SolidRun Clearfog with phylink, particularly between the phylib worker reading the PHYs status, and the thread resuming mvneta, calling phy_start() which then calls through to m88e1121_config_aneg_rgmii_delays(), which tries to read-modify-write the MSCR register: CPU0 CPU1 marvell_read_status_page() marvell_set_page(phydev, MII_MARVELL_FIBER_PAGE) ... m88e1121_config_aneg_rgmii_delays() set_page(MII_MARVELL_MSCR_PAGE) phy_read(phydev, MII_88E1121_PHY_MSCR_REG) marvell_set_page(phydev, MII_MARVELL_COPPER_PAGE); ... phy_write(phydev, MII_88E1121_PHY_MSCR_REG) The result of this is we end up writing the copper page register 21, which causes the copper PHY to be disabled, and the link partner sees the link immediately go down. Solve this by taking the bus lock instead of the PHY lock, thereby preventing other accesses to the PHY while we are accessing other PHY pages. Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk> Reviewed-by: Andrew Lunn <andrew@lunn.ch> Signed-off-by: David S. Miller <davem@davemloft.net>
2018-01-03net: phy: add paged phy register accessorsRussell King2-0/+168
Add a set of paged phy register accessors which are inherently safe in their design against other accesses interfering with the paged access. Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk> Reviewed-by: Andrew Lunn <andrew@lunn.ch> Signed-off-by: David S. Miller <davem@davemloft.net>
2018-01-03net: phy: add unlocked accessorsRussell King2-0/+53
Add unlocked versions of the bus accessors, which allows access to the bus with all the tracing. These accessors validate that the bus mutex is held, which is a basic requirement for all mii bus accesses. Also added is a read-modify-write unlocked accessor with the same locking requirements. Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk> Reviewed-by: Andrew Lunn <andrew@lunn.ch> Signed-off-by: David S. Miller <davem@davemloft.net>
2018-01-03net: phy: use unlocked accessors for indirect MMD accessesRussell King1-5/+6
Use unlocked accessors for indirect MMD accesses to clause 22 PHYs. This permits tracing of these accesses. Reviewed-by: Florian Fainelli <f.fainelli@gmail.com> Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk> Signed-off-by: David S. Miller <davem@davemloft.net>
2018-01-03net: mdiobus: add unlocked accessorsRussell King2-12/+56
Add unlocked versions of the bus accessors, which allows access to the bus with all the tracing. These accessors validate that the bus mutex is held, which is a basic requirement for all mii bus accesses. Reviewed-by: Florian Fainelli <f.fainelli@gmail.com> Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk> Signed-off-by: David S. Miller <davem@davemloft.net>
2018-01-03cxgb4: collect TX rate limit info in UP CIM logsRahul Lakkireddy5-39/+100
Collect TX rate limiting related information in UP CIM logs. Signed-off-by: Rahul Lakkireddy <rahul.lakkireddy@chelsio.com> Signed-off-by: Ganesh Goudar <ganeshgr@chelsio.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2018-01-03Merge branch 'mvneta-phylink'David S. Miller4-324/+405
Russell King says: ==================== Convert mvneta to phylink This series converts mvneta to use phylink, which is necessary to support the SFP cages on SolidRun's Clearfog platform. This series just converts mvneta without adding the DT parts - having discussed with Andrew, we believe we're too close to the merge window to submit that patch. I've split the "net: mvneta: convert to phylink" patch up to make it easier to review, and in doing so, spotted some minor corner cases that needed to be fixed along the way. This series depends on the previously merged phylink patches in netdev, along with the recently reviewed 7 patch series "Resolve races in phy accessors" without which, the race described in patch 5 of that series is very evident when triggering a dummy hibernate cycle. This series also illustrates how to convert mvpp2 to phylink. mvneta is the only user of the fixed_phy_update_state() API, and this becomes redundant with the conversion. It would be good to get this series not only reviewed, but also independently tested to ensure that I haven't missed anything - I only have the Clearfog platform to test on, and that doesn't support all the different interface modes that mvneta supports. A particularly interesting side effect of this series is that DSA switches no longer need the "CPU" port and DSA facing MAC ethernet instance to be marked as a fixed link anymore with mvneta - we can use 1000BaseX mode, and the DSA to CPU link will use the 802.3z negotiation to determine the link properties without needing the link parameters to be explicitly stated in DT - that is a subject of a future patch. ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
2018-01-03net: phy: fixed-phy: remove fixed_phy_update_state()Russell King2-40/+0
mvneta is the only user of fixed_phy_update_state(), which has been converted to use phylink instead. Remove fixed_phy_update_state(). Reviewed-by: Florian Fainelli <f.fainelli@gmail.com> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk> Signed-off-by: David S. Miller <davem@davemloft.net>
2018-01-03net: mvneta: add module EEPROM reading supportRussell King1-0/+18
Add support for reading the SFF module's EEPROM via the ethtool API. Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk> Signed-off-by: David S. Miller <davem@davemloft.net>
2018-01-03net: mvneta: disable MVNETA_CAUSE_PSC_SYNC_CHANGE interruptRussell King1-8/+4
The PSC sync change interrupt can fire multiple times while the link is down, which is caused by noise on the serdes lines. As this isn't information we make use of, it's pointless having the interrupt enabled. Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk> Signed-off-by: David S. Miller <davem@davemloft.net>
2018-01-03net: mvneta: add EEE supportRussell King1-5/+94
Add support for EEE to mvneta. Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk> Signed-off-by: David S. Miller <davem@davemloft.net>
2018-01-03net: mvneta: add flow control supportRussell King1-0/+32
Add support for flow control to mvneta. Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk> Signed-off-by: David S. Miller <davem@davemloft.net>
2018-01-03net: mvneta: add 1000BaseX supportRussell King1-9/+50
Add support for 1000BaseX link modes. Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk> Signed-off-by: David S. Miller <davem@davemloft.net>
2018-01-03net: mvneta: move port configurationRussell King1-31/+20
Move the port configuration and release of reset to mvneta_mac_config() along side the rest of the port mode configuration. Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk> Signed-off-by: David S. Miller <davem@davemloft.net>
2018-01-03net: mvneta: convert to phylinkRussell King2-243/+176
Convert mvneta to use phylink, which models the MAC to PHY link in a generic, reusable form. Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk> - remove unused sync status Signed-off-by: David S. Miller <davem@davemloft.net>
2018-01-03net: mvneta: prepare to convert to phylinkRussell King1-41/+60
Prepare to convert mvneta to phylink by splitting the adjust_link function into its consituent parts. Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk> Signed-off-by: David S. Miller <davem@davemloft.net>
2018-01-03net: mvneta: ensure PM paths take the rtnl lockRussell King1-0/+4
The netdev core always ensures that the rtnl lock is held while calling the ndo_open() and ndo_stop() methods. However, the suspend/resume paths do not hold the rtnl lock. phylink will expect the rtnl lock to be held when the MAC driver calls it, so we end up with kernel warnings. Take the lock to ensure that these functions are called in a consistent manner. Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk> Signed-off-by: David S. Miller <davem@davemloft.net>
2018-01-03Merge branch 'net-Renesas-kill-redundant-checks'David S. Miller2-4/+2
Sergei Shtylyov says: ==================== Kill redundant checks in the Renesas Ethernet drivers Here's a set of 2 patches against DaveM's 'net-next.git' repo removing redundant checks in the driver probe() methods. ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
2018-01-03sh_eth: kill redundant check in the probe() methodSergei Shtylyov1-2/+1
Browsing thru the driver disassembly, I noticed that gcc was able to figure out that the 'ndev' pointer is always non-NULL when calling free_netdev() on the probe() method's error path and thus skip that redundant NULL check... gcc is smart, be like gcc! :-) Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com> Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be> Signed-off-by: David S. Miller <davem@davemloft.net>
2018-01-03ravb: kill redundant check in the probe() methodSergei Shtylyov1-2/+1
Browsing thru the driver disassembly, I noticed that gcc was able to figure out that the 'ndev' pointer is always non-NULL when calling free_netdev() on the probe() method's error path and thus skip that redundant NULL check... gcc is smart, be like gcc! :-) Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com> Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be> Signed-off-by: David S. Miller <davem@davemloft.net>
2018-01-02liquidio: Use zeroing memory allocator than allocator/memsetHimanshu Jha1-5/+2
Use vzalloc for allocating zeroed memory and remove unnecessary memset function. Done using Coccinelle. Generated-by: scripts/coccinelle/api/alloc/kzalloc-simple.cocci 0-day tested with no failures. Suggested-by: Luis R. Rodriguez <mcgrof@kernel.org> Signed-off-by: Himanshu Jha <himanshujha199640@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2018-01-02ethernet/broadcom: Use zeroing memory allocator than allocator/memsetHimanshu Jha2-7/+4
Use dma_zalloc_coherent for allocating zeroed memory and remove unnecessary memset function. Done using Coccinelle. Generated-by: scripts/coccinelle/api/alloc/kzalloc-simple.cocci 0-day tested with no failures. Suggested-by: Luis R. Rodriguez <mcgrof@kernel.org> Signed-off-by: Himanshu Jha <himanshujha199640@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2018-01-02qed: Use zeroing memory allocator than allocator/memsetHimanshu Jha2-9/+6
Use dma_zalloc_coherent and vzalloc for allocating zeroed memory and remove unnecessary memset function. Done using Coccinelle. Generated-by: scripts/coccinelle/api/alloc/kzalloc-simple.cocci 0-day tested with no failures. Suggested-by: Luis R. Rodriguez <mcgrof@kernel.org> Signed-off-by: Himanshu Jha <himanshujha199640@gmail.com> Acked-by: Tomer Tayar <Tomer.Tayar@cavium.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2018-01-02Merge branch 'net-stmmac-Couple-of-debug-prints-improvements'David S. Miller4-6/+5
Florian Fainelli says: ==================== net: stmmac: Couple of debug prints improvements While working on a particular problem, I had to turn on debug prints and found them to be useful, but could deserve some improvements in order to help debug situations. ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
2018-01-02net: stmmac: Allow debug prints of frame_len/COEFlorian Fainelli1-3/+2
There is no reason not to allow printing the frame_len/COE value and put that under a check for ETH_FRAME_LEN, drop it so we can see what the descriptor reports. Signed-off-by: Florian Fainelli <f.fainelli@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2018-01-02net: stmmac: Pad ring number with zeroes in display_ring()Florian Fainelli3-3/+3
Make the printing of the ring number consistent and properly aligned by padding the ring number with up to 3 zeroes, which covers the maximum ring size. This makes it a lot easier to see outliers in debug prints. Signed-off-by: Florian Fainelli <f.fainelli@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2018-01-02net: dsa: Fix dsa_legacy_register() return valueFlorian Fainelli1-1/+1
We need to make the dsa_legacy_register() stub return 0 in order for dsa_init_module() to successfully register and continue registering the ETH_P_XDSA packet handler. Fixes: 2a93c1a3651f ("net: dsa: Allow compiling out legacy support") Reported-by: Egil Hjelmeland <privat@egil-hjelmeland.no> Signed-off-by: Florian Fainelli <f.fainelli@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2018-01-02Merge branch 'further-sfp-phylink-updates'David S. Miller4-62/+114
Russell King says: ==================== further sfp/phylink updates This series: - cleans up printing of module information - improves the transceiver capability decoding, getting rid of the guessing by connector type, improves direct-attach cable support and adds support for 1G Base-PX and Base-BX10 modules. - cleans up phylink_sfp_module_insert() ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
2018-01-02phylink: remove 'mode' variable from phylink_sfp_module_insert()Russell King1-7/+8
'mode' is actually constant through phylink_sfp_module_insert(), so remove it and replace it with the enumerated constant. Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk> Signed-off-by: David S. Miller <davem@davemloft.net>
2018-01-02sfp: improve support for direct-attach copper cablesRussell King2-8/+79
Improve the support for direct-attach copper so that we avoid kernel warning messages, and report the appropriate PORT_DA type to userspace. Direct Attach cables can use a number of protocols depending on their range of speeds. Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk> Signed-off-by: David S. Miller <davem@davemloft.net>
2018-01-02sfp: add support for 1000Base-PX and 1000Base-BX10Russell King1-0/+21
Add support for decoding the transceiver information for 1000Base-PX and 1000Base-BX10. These use 1000BASE-X protocol. Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk> Signed-off-by: David S. Miller <davem@davemloft.net>
2018-01-02sfp: don't guess support from connector typeRussell King1-29/+0
Don't try to guess the support mask from the connector type - this is mostly irrelevant to the speeds that the transceiver supports. Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk> Signed-off-by: David S. Miller <davem@davemloft.net>
2018-01-02sfp: use precision to print non-null terminated stringsRussell King1-18/+6
Rather than memcpy()'ing the strings and null terminate them, printf allows non-NULL terminated strings provided the precision is not more than the size of the buffer. Use this form to print the basic module information rather than copying and terminating the strings. Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk> Signed-off-by: David S. Miller <davem@davemloft.net>
2018-01-02Merge branch 'marvell10g-phy-updates'David S. Miller4-41/+148
Russell King says: ==================== marvell10g updates This series: - adds MDI/MDIX reporting - adds support for 10/100Mbps half-duplex link modes - adds a comment describing the setup on VF610 ZII boards (where the phy interface mode doesn't change.) - cleans up the phy interace mode switching ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
2018-01-02net: phy: marvell10g: add support for half duplex 100M and 10MRussell King1-25/+12
Add support for half-duplex 100M and 10M copper connections by parsing the advertisment results rather than trying to decode the negotiated speed from one of the PHYs "vendor" registers. This allows us to decode the duplex as well, which means we can support half-duplex mode for the slower speeds. Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk> Reviewed-by: Andrew Lunn <andrew@lunn.ch> Signed-off-by: David S. Miller <davem@davemloft.net>
2018-01-02net: phy: add helper to convert negotiation result to phy settingsRussell King2-0/+45
Add a helper to convert the result of the autonegotiation advertisment into the PHYs speed and duplex settings. If the result is full duplex, also extract the pause mode settings from the link partner advertisment. Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk> Reviewed-by: Andrew Lunn <andrew@lunn.ch> Signed-off-by: David S. Miller <davem@davemloft.net>
2018-01-02net: phy: marvell10g: clean up interface mode switchingRussell King1-16/+20
Centralise the PHY interface mode switching, rather than having it in two places. Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk> Reviewed-by: Andrew Lunn <andrew@lunn.ch> Signed-off-by: David S. Miller <davem@davemloft.net>
2018-01-02net: phy: marvell10g: add MDI swap reportingRussell King3-0/+65
Add reporting of the MDI swap to the Marvell 10G PHY driver by providing a generic implementation for the standard 10GBASE-T pair swap register and polarity register. We also support reading the MDI swap status for 1G and below from a PCS register. Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk> Reviewed-by: Andrew Lunn <andrew@lunn.ch> Signed-off-by: David S. Miller <davem@davemloft.net>
2018-01-02net: phy: marvell10g: update header commentsRussell King1-1/+7
Update header comments to indicate the newly found behaviour with XAUI interfaces. Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk> Reviewed-by: Andrew Lunn <andrew@lunn.ch> Signed-off-by: David S. Miller <davem@davemloft.net>
2018-01-02net: hns: add ACPI mode support for ethtool -pJian Shen2-2/+57
The locate operation interface of fiber port can only work with DT mode. Add a new interface to control the locate led for ACPI mode. Signed-off-by: Jian Shen <shenjian15@huawei.com> Signed-off-by: Peng Li <lipeng321@huawei.com> Tested-by: Zhou Wang <wangzhou1@hisilicon.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2018-01-02cxgb4: Check alignment constraint for T6Ganesh Goudar1-5/+12
Update the check for setting IPV4 filters and align filter_id to multiple of 2, only for IPv6 filters in case of T6. Signed-off-by: Arjun Vynipadath <arjun@chelsio.com> Signed-off-by: Ganesh Goudar <ganeshgr@chelsio.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2018-01-02Merge branch 'ena-next'David S. Miller5-8/+81
Netanel Belgazal says: ==================== update ENA driver to version 1.5.0 This patchset contains two changes: * Add a robust mechanism for detection of stuck Rx/Tx rings due to missed or misrouted MSI-X * Increase the driver version to 1.5.0 ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
2018-01-02net: ena: increase ena driver version to 1.5.0Netanel Belgazal1-1/+1
Signed-off-by: Netanel Belgazal <netanel@amazon.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2018-01-02net: ena: add detection and recovery mechanism for handling missed/misrouted MSI-XNetanel Belgazal5-7/+80
A mechanism for detection of stuck Rx/Tx rings due to missed or misrouted interrupts. Check if there are unhandled completion descriptors before the first MSI-X interrupt arrived. The check is per queue and per interrupt vector. Once such condition is detected, driver and device reset is scheduled. Signed-off-by: Netanel Belgazal <netanel@amazon.com> Signed-off-by: David S. Miller <davem@davemloft.net>