[PATCH 1/3] dt-bindings: net: dsa: ksz: document Microchip KSZ87xx family switches

2019-07-24 Thread Marek Vasut
Document Microchip KSZ87xx family switches. These include KSZ8765 - 5 port switch KSZ8794 - 4 port switch KSZ8795 - 5 port switch Signed-off-by: Marek Vasut Cc: Andrew Lunn Cc: David S. Miller Cc: Florian Fainelli Cc: Rob Herring Cc: Tristram Ha Cc: Vivien Didelot Cc: Woojung Huh Cc

[PATCH 0/3] net: dsa: ksz: Add Microchip KSZ87xx support

2019-07-24 Thread Marek Vasut
This series adds support for Microchip KSZ87xx switches, which are slightly simpler compared to KSZ9xxx . Signed-off-by: Marek Vasut Cc: Andrew Lunn Cc: David S. Miller Cc: Florian Fainelli Cc: Tristram Ha Cc: Vivien Didelot Cc: Woojung Huh Marek Vasut (1): dt-bindings: net: dsa: ksz

[PATCH 2/3] net: dsa: ksz: Add KSZ8795 tag code

2019-07-24 Thread Marek Vasut
From: Tristram Ha Add DSA tag code for Microchip KSZ8795 switch. The switch is simpler and the tag is only 1 byte, instead of 2 as is the case with KSZ9477. Signed-off-by: Tristram Ha Signed-off-by: Marek Vasut Cc: Andrew Lunn Cc: David S. Miller Cc: Florian Fainelli Cc: Tristram Ha Cc

[PATCH 3/3] net: dsa: ksz: Add Microchip KSZ8795 DSA driver

2019-07-24 Thread Marek Vasut
From: Tristram Ha Add Microchip KSZ8795 DSA driver. Signed-off-by: Tristram Ha Signed-off-by: Marek Vasut Cc: Andrew Lunn Cc: David S. Miller Cc: Florian Fainelli Cc: Tristram Ha Cc: Vivien Didelot Cc: Woojung Huh --- drivers/net/dsa/microchip/Kconfig | 18 + drivers/net/dsa

Re: [PATCH 3/3] net: dsa: ksz: Add Microchip KSZ8795 DSA driver

2019-07-25 Thread Marek Vasut
On 7/25/19 4:03 PM, Andrew Lunn wrote: > On Wed, Jul 24, 2019 at 03:40:48PM +0200, Marek Vasut wrote: >> From: Tristram Ha >> +static void ksz8795_phy_setup(struct ksz_device *dev, int port, >> + struct phy_device *phy) >> +{ >>

[PATCH V2 0/3] net: dsa: ksz: Add Microchip KSZ87xx support

2019-07-25 Thread Marek Vasut
This series adds support for Microchip KSZ87xx switches, which are slightly simpler compared to KSZ9xxx . Signed-off-by: Marek Vasut Cc: Andrew Lunn Cc: David S. Miller Cc: Florian Fainelli Cc: Tristram Ha Cc: Vivien Didelot Cc: Woojung Huh Marek Vasut (1): dt-bindings: net: dsa: ksz

[PATCH V2 1/3] dt-bindings: net: dsa: ksz: document Microchip KSZ87xx family switches

2019-07-25 Thread Marek Vasut
Document Microchip KSZ87xx family switches. These include KSZ8765 - 5 port switch KSZ8794 - 4 port switch KSZ8795 - 5 port switch Signed-off-by: Marek Vasut Cc: Andrew Lunn Cc: David S. Miller Cc: Florian Fainelli Cc: Rob Herring Cc: Tristram Ha Cc: Vivien Didelot Cc: Woojung Huh Cc

[PATCH V2 2/3] net: dsa: ksz: Add KSZ8795 tag code

2019-07-25 Thread Marek Vasut
From: Tristram Ha Add DSA tag code for Microchip KSZ8795 switch. The switch is simpler and the tag is only 1 byte, instead of 2 as is the case with KSZ9477. Signed-off-by: Tristram Ha Signed-off-by: Marek Vasut Cc: Andrew Lunn Cc: David S. Miller Cc: Florian Fainelli Cc: Tristram Ha Cc

[PATCH V2 3/3] net: dsa: ksz: Add Microchip KSZ8795 DSA driver

2019-07-25 Thread Marek Vasut
From: Tristram Ha Add Microchip KSZ8795 DSA driver. Signed-off-by: Tristram Ha Signed-off-by: Marek Vasut Cc: Andrew Lunn Cc: David S. Miller Cc: Florian Fainelli Cc: Tristram Ha Cc: Vivien Didelot Cc: Woojung Huh --- V2: - Use reverse xmas tree for variable declaration - Use BIT

Re: [PATCH 3/3] net: dsa: ksz: Add Microchip KSZ8795 DSA driver

2019-07-25 Thread Marek Vasut
On 7/25/19 4:59 PM, Andrew Lunn wrote: > On Thu, Jul 25, 2019 at 04:56:37PM +0200, Marek Vasut wrote: >> On 7/25/19 4:03 PM, Andrew Lunn wrote: >>> On Wed, Jul 24, 2019 at 03:40:48PM +0200, Marek Vasut wrote: >>>> From: Tristram Ha >>>> +static void ksz

[PATCH V3 0/3] net: dsa: ksz: Add Microchip KSZ87xx support

2019-07-26 Thread Marek Vasut
This series adds support for Microchip KSZ87xx switches, which are slightly simpler compared to KSZ9xxx . Signed-off-by: Marek Vasut Cc: Andrew Lunn Cc: David S. Miller Cc: Florian Fainelli Cc: Tristram Ha Cc: Vivien Didelot Cc: Woojung Huh Marek Vasut (1): dt-bindings: net: dsa: ksz

[PATCH V3 1/3] dt-bindings: net: dsa: ksz: document Microchip KSZ87xx family switches

2019-07-26 Thread Marek Vasut
Document Microchip KSZ87xx family switches. These include KSZ8765 - 5 port switch KSZ8794 - 4 port switch KSZ8795 - 5 port switch Signed-off-by: Marek Vasut Cc: Andrew Lunn Cc: David S. Miller Cc: Florian Fainelli Cc: Rob Herring Cc: Tristram Ha Cc: Vivien Didelot Cc: Woojung Huh Cc

[PATCH V3 2/3] net: dsa: ksz: Add KSZ8795 tag code

2019-07-26 Thread Marek Vasut
From: Tristram Ha Add DSA tag code for Microchip KSZ8795 switch. The switch is simpler and the tag is only 1 byte, instead of 2 as is the case with KSZ9477. Signed-off-by: Tristram Ha Signed-off-by: Marek Vasut Cc: Andrew Lunn Cc: David S. Miller Cc: Florian Fainelli Cc: Tristram Ha Cc

[PATCH V3 3/3] net: dsa: ksz: Add Microchip KSZ8795 DSA driver

2019-07-26 Thread Marek Vasut
From: Tristram Ha Add Microchip KSZ8795 DSA driver. Signed-off-by: Tristram Ha Signed-off-by: Marek Vasut Cc: Andrew Lunn Cc: David S. Miller Cc: Florian Fainelli Cc: Tristram Ha Cc: Vivien Didelot Cc: Woojung Huh --- V2: - Use reverse xmas tree for variable declaration - Use BIT

[PATCH V4 2/3] net: dsa: ksz: Add KSZ8795 tag code

2019-07-29 Thread Marek Vasut
From: Tristram Ha Add DSA tag code for Microchip KSZ8795 switch. The switch is simpler and the tag is only 1 byte, instead of 2 as is the case with KSZ9477. Signed-off-by: Tristram Ha Signed-off-by: Marek Vasut Cc: Andrew Lunn Cc: David S. Miller Cc: Florian Fainelli Cc: Tristram Ha Cc

[PATCH V4 0/3] net: dsa: ksz: Add Microchip KSZ87xx support

2019-07-29 Thread Marek Vasut
This series adds support for Microchip KSZ87xx switches, which are slightly simpler compared to KSZ9xxx . Signed-off-by: Marek Vasut Cc: Andrew Lunn Cc: David S. Miller Cc: Florian Fainelli Cc: Tristram Ha Cc: Vivien Didelot Cc: Woojung Huh Marek Vasut (1): dt-bindings: net: dsa: ksz

[PATCH V4 3/3] net: dsa: ksz: Add Microchip KSZ8795 DSA driver

2019-07-29 Thread Marek Vasut
From: Tristram Ha Add Microchip KSZ8795 DSA driver. Signed-off-by: Tristram Ha Signed-off-by: Marek Vasut Cc: Andrew Lunn Cc: David S. Miller Cc: Florian Fainelli Cc: Tristram Ha Cc: Vivien Didelot Cc: Woojung Huh --- V2: - Use reverse xmas tree for variable declaration - Use BIT

[PATCH V4 1/3] dt-bindings: net: dsa: ksz: document Microchip KSZ87xx family switches

2019-07-29 Thread Marek Vasut
Document Microchip KSZ87xx family switches. These include KSZ8765 - 5 port switch KSZ8794 - 4 port switch KSZ8795 - 5 port switch Signed-off-by: Marek Vasut Cc: Andrew Lunn Cc: David S. Miller Cc: Florian Fainelli Cc: Rob Herring Cc: Tristram Ha Cc: Vivien Didelot Cc: Woojung Huh Cc

[PATCH 3/3] net: dsa: ksz: Drop NET_DSA_TAG_KSZ9477

2019-08-06 Thread Marek Vasut
This Kconfig option is unused, drop it. Signed-off-by: Marek Vasut Cc: Andrew Lunn Cc: David S. Miller Cc: Florian Fainelli Cc: Tristram Ha Cc: Vivien Didelot Cc: Woojung Huh --- drivers/net/dsa/microchip/Kconfig | 1 - net/dsa/Kconfig | 7 --- 2 files changed, 8

[PATCH 2/3] net: dsa: ksz: Merge ksz_priv.h into ksz_common.h

2019-08-06 Thread Marek Vasut
Merge the two headers into one, no functional change. Signed-off-by: Marek Vasut Cc: Andrew Lunn Cc: David S. Miller Cc: Florian Fainelli Cc: Tristram Ha Cc: Vivien Didelot Cc: Woojung Huh --- drivers/net/dsa/microchip/ksz8795.c | 1 - drivers/net/dsa/microchip/ksz8795_spi.c | 1

[PATCH 1/3] net: dsa: ksz: Remove dead code and fix warnings

2019-08-06 Thread Marek Vasut
ers cannot be swapped, as that would trigger missing forward declaration errors, which would indicate the way forward is to merge the two headers into one. Signed-off-by: Marek Vasut Cc: Andrew Lunn Cc: David S. Miller Cc: Florian Fainelli Cc: Tristram Ha Cc: Vivien Didelot Cc: Woojung Huh --

Re: [PATCH net-next] net: ks8851: Connect and start/stop the internal PHY

2021-01-12 Thread Marek Vasut
On 1/11/21 3:47 PM, Andrew Lunn wrote: On Mon, Jan 11, 2021 at 01:53:37PM +0100, Marek Vasut wrote: Unless the internal PHY is connected and started, the phylib will not poll the PHY for state and produce state updates. Connect the PHY and start/stop it. Hi Marek Please continue the

Re: [PATCH net-next] net: ks8851: Connect and start/stop the internal PHY

2021-01-12 Thread Marek Vasut
On 1/11/21 3:43 PM, Heiner Kallweit wrote: On 11.01.2021 15:10, Marek Vasut wrote: On 1/11/21 2:50 PM, Heiner Kallweit wrote: On 11.01.2021 14:38, Marek Vasut wrote: On 1/11/21 2:26 PM, Heiner Kallweit wrote: [...] LGTM. When having a brief look at the driver I stumbled across two things

Re: [PATCH net-next] net: ks8851: Connect and start/stop the internal PHY

2021-01-15 Thread Marek Vasut
On 1/14/21 2:54 PM, Andrew Lunn wrote: On Tue, Jan 12, 2021 at 11:28:00PM +0100, Marek Vasut wrote: On 1/11/21 3:47 PM, Andrew Lunn wrote: On Mon, Jan 11, 2021 at 01:53:37PM +0100, Marek Vasut wrote: Unless the internal PHY is connected and started, the phylib will not poll the PHY for state

[PATCH net-next] net: ks8851: Fix mixed module/builtin build

2021-01-15 Thread Marek Vasut
ce to `__this_module' Fix this by including the ks8851_common.c in both ks8851_spi.c and ks8851_par.c. The DEBUG macro is defined in ks8851_common.c, so it does not have to be defined again. Signed-off-by: Marek Vasut Cc: Andrew Lunn Cc: Heiner Kallweit Cc: Jakub Kicinski Cc: Lukas Wunner

Re: [PATCH net-next] net: ks8851: Fix mixed module/builtin build

2021-01-15 Thread Marek Vasut
On 1/15/21 4:00 PM, Andrew Lunn wrote: On Fri, Jan 15, 2021 at 02:42:39PM +0100, Marek Vasut wrote: When either the SPI or PAR variant is compiled as module AND the other variant is compiled as built-in, the following build error occurs: arm-linux-gnueabi-ld: drivers/net/ethernet/micrel

Re: [PATCH net-next] net: ks8851: Fix mixed module/builtin build

2021-01-15 Thread Marek Vasut
On 1/15/21 4:59 PM, Andrew Lunn wrote: On Fri, Jan 15, 2021 at 04:05:57PM +0100, Marek Vasut wrote: On 1/15/21 4:00 PM, Andrew Lunn wrote: On Fri, Jan 15, 2021 at 02:42:39PM +0100, Marek Vasut wrote: When either the SPI or PAR variant is compiled as module AND the other variant is compiled as

Re: [PATCH] net: ks8851: remove definition of DEBUG

2021-01-15 Thread Marek Vasut
On 1/15/21 4:31 PM, t...@redhat.com wrote: From: Tom Rix Defining DEBUG should only be done in development. So remove DEBUG. Signed-off-by: Tom Rix Reviewed-by: Marek Vasut Thanks

[PATCH net-next V2] net: ks8851: Fix mixed module/builtin build

2021-01-16 Thread Marek Vasut
ce to `__this_module' Fix this by passing THIS_MODULE as argument to ks8851_probe_common(), ks8851_register_mdiobus(), and ultimately __mdiobus_register() in the ks8851_common.c. Fixes: ef3631220d2b ("net: ks8851: Register MDIO bus and the internal PHY") Signed-off-by: Marek Vasut

Re: [PATCH net-next] net: ks8851: Fix mixed module/builtin build

2021-01-16 Thread Marek Vasut
On 1/15/21 10:36 PM, Arnd Bergmann wrote: On Fri, Jan 15, 2021 at 6:24 PM Heiner Kallweit wrote: On 15.01.2021 16:59, Andrew Lunn wrote: On Fri, Jan 15, 2021 at 04:05:57PM +0100, Marek Vasut wrote: On 1/15/21 4:00 PM, Andrew Lunn wrote: On Fri, Jan 15, 2021 at 02:42:39PM +0100, Marek Vasut

Re: [PATCH net-next V2] net: ks8851: Fix mixed module/builtin build

2021-01-16 Thread Marek Vasut
On 1/16/21 6:04 PM, Arnd Bergmann wrote: On Sat, Jan 16, 2021 at 5:48 PM Marek Vasut wrote: When either the SPI or PAR variant is compiled as module AND the other variant is compiled as built-in, the following build error occurs: arm-linux-gnueabi-ld: drivers/net/ethernet/micrel

Re: [PATCH net-next V2] net: ks8851: Fix mixed module/builtin build

2021-01-16 Thread Marek Vasut
On 1/16/21 9:39 PM, Lukas Wunner wrote: On Sat, Jan 16, 2021 at 08:26:22PM +0100, Arnd Bergmann wrote: On Sat, Jan 16, 2021 at 6:56 PM Marek Vasut wrote: On 1/16/21 6:04 PM, Arnd Bergmann wrote: On Sat, Jan 16, 2021 at 5:48 PM Marek Vasut wrote: I don't really like this version,

[PATCH net-next] net: dsa: microchip: ksz8795: Fix KSZ8794 port map again

2021-01-19 Thread Marek Vasut
e2a984abd8 ("net: dsa: microchip: ksz8795: use phy_port_cnt where possible") Fixes: 241ed719bc98 ("net: dsa: microchip: ksz8795: use port_cnt instead of TOTOAL_PORT_NUM") Signed-off-by: Marek Vasut Cc: Andrew Lunn Cc: Florian Fainelli Cc: Michael Grzeschik Cc: Jakub Kicinski

[PATCH net-next V2] net: dsa: microchip: ksz8795: Fix KSZ8794 port map again

2021-01-19 Thread Marek Vasut
e2a984abd8 ("net: dsa: microchip: ksz8795: use phy_port_cnt where possible") Fixes: 241ed719bc98 ("net: dsa: microchip: ksz8795: use port_cnt instead of TOTOAL_PORT_NUM") Signed-off-by: Marek Vasut Cc: Andrew Lunn Cc: Florian Fainelli Cc: Michael Grzeschik Cc: Jakub Kicinski

[PATCH net-next] net: dsa: microchip: Adjust reset release timing to match reference reset circuit

2021-01-19 Thread Marek Vasut
fits the constraint with a bit of extra space. Fixes: 5b797980908a ("net: dsa: microchip: Implement recommended reset timing") Signed-off-by: Marek Vasut Cc: Andrew Lunn Cc: Florian Fainelli Cc: Jakub Kicinski Cc: Michael Grzeschik Cc: Paul Barker --- drivers/net/dsa/microchip/ks

[PATCH net-next V2] net: dsa: microchip: Adjust reset release timing to match reference reset circuit

2021-01-19 Thread Marek Vasut
fits the constraint with a bit of extra space. Fixes: 5b797980908a ("net: dsa: microchip: Implement recommended reset timing") Reviewed-by: Florian Fainelli Signed-off-by: Marek Vasut Cc: Andrew Lunn Cc: Florian Fainelli Cc: Jakub Kicinski Cc: Michael Grzeschik Cc: Paul Barker -

Re: [PATCH net-next V2] net: dsa: microchip: Adjust reset release timing to match reference reset circuit

2021-01-20 Thread Marek Vasut
On 1/21/21 2:31 AM, Jakub Kicinski wrote: On Wed, 20 Jan 2021 04:05:02 +0100 Marek Vasut wrote: KSZ8794CNX datasheet section 8.0 RESET CIRCUIT describes recommended circuit for interfacing with CPU/FPGA reset consisting of 10k pullup resistor and 10uF capacitor to ground. This circuit takes

[PATCH 2/2] net: ks8851: Register MDIO bus and the internal PHY

2020-12-30 Thread Marek Vasut
: Marek Vasut Cc: Andrew Lunn Cc: Heiner Kallweit Cc: Lukas Wunner To: netdev@vger.kernel.org --- drivers/net/ethernet/micrel/ks8851.h| 1 + drivers/net/ethernet/micrel/ks8851_common.c | 69 - 2 files changed, 67 insertions(+), 3 deletions(-) diff --git a/drivers/net

[PATCH 1/2] net: phy: micrel: Add KS8851 PHY support

2020-12-30 Thread Marek Vasut
-off-by: Marek Vasut Cc: Andrew Lunn Cc: Heiner Kallweit Cc: Lukas Wunner To: netdev@vger.kernel.org --- drivers/net/phy/micrel.c | 9 + include/linux/micrel_phy.h | 2 ++ 2 files changed, 11 insertions(+) diff --git a/drivers/net/phy/micrel.c b/drivers/net/phy/micrel.c index

Re: [PATCH 1/2] net: phy: micrel: Add KS8851 PHY support

2021-01-03 Thread Marek Vasut
On 12/30/20 4:43 PM, Andrew Lunn wrote: On Wed, Dec 30, 2020 at 01:53:57PM +0100, Marek Vasut wrote: The KS8851 has a reduced internal PHY, which is accessible through its registers at offset 0xe4. The PHY is compatible with KS886x PHY present in Micrel switches, except the PHY ID Low/High

Re: [PATCH 2/2] net: ks8851: Register MDIO bus and the internal PHY

2021-01-03 Thread Marek Vasut
On 12/30/20 5:00 PM, Andrew Lunn wrote: +static int ks8851_mdio_read(struct mii_bus *bus, int phy_id, int reg) +{ + struct ks8851_net *ks = bus->priv; + + if (phy_id != 0) + return 0x; + Please check for C45 and return -EOPNOTSUPP. The ks8851_reg_read() does

Re: [PATCH 1/2] net: phy: micrel: Add KS8851 PHY support

2021-01-03 Thread Marek Vasut
On 1/3/21 5:55 PM, Andrew Lunn wrote: On Sun, Jan 03, 2021 at 01:55:22PM +0100, Marek Vasut wrote: On 12/30/20 4:43 PM, Andrew Lunn wrote: On Wed, Dec 30, 2020 at 01:53:57PM +0100, Marek Vasut wrote: The KS8851 has a reduced internal PHY, which is accessible through its registers at offset

[PATCH V2 2/2] net: ks8851: Register MDIO bus and the internal PHY

2021-01-04 Thread Marek Vasut
: Marek Vasut Cc: Andrew Lunn Cc: Heiner Kallweit Cc: Lukas Wunner To: netdev@vger.kernel.org --- V2: - Cast the BIT(0) to u32 to avoid build warnings - Swap PHY ID Hi/Lo registers for MDIO bus access (retain old behavior for MII bus access) - Return -EOPNOTSUPP on read from

[PATCH V2 1/2] net: phy: micrel: Add KS8851 PHY support

2021-01-04 Thread Marek Vasut
The KS8851 has a reduced internal PHY, which is accessible through its registers at offset 0xe4. The PHY is compatible with KS886x PHY present in Micrel switches, including the PHY ID Low/High registers swap, which is present both in the MAC and the switch. Signed-off-by: Marek Vasut Cc: Andrew

[PATCH net-next V3 0/2] net: ks8851: Add KS8851 PHY support

2021-01-05 Thread Marek Vasut
The KS8851 has a reduced internal PHY, which is accessible through its registers at offset 0xe4. The PHY is compatible with KS886x PHY present in Micrel switches, including the PHY ID Low/High registers swap, which is present both in the MAC and the switch. Marek Vasut (2): net: phy: micrel

[PATCH net-next V3 1/2] net: phy: micrel: Add KS8851 PHY support

2021-01-05 Thread Marek Vasut
: Marek Vasut Cc: Andrew Lunn Cc: Heiner Kallweit Cc: Lukas Wunner --- V2: Merge the KSZ8851 and KS886X entries, as those PHYs cannot be discerned V3: Add RB from Andrew --- drivers/net/phy/micrel.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/phy/micrel.c b

[PATCH net-next V3 2/2] net: ks8851: Register MDIO bus and the internal PHY

2021-01-05 Thread Marek Vasut
: Andrew Lunn Signed-off-by: Marek Vasut Cc: Andrew Lunn Cc: Heiner Kallweit Cc: Lukas Wunner --- V2: - Cast the BIT(0) to u32 to avoid build warnings - Swap PHY ID Hi/Lo registers for MDIO bus access (retain old behavior for MII bus access) - Return -EOPNOTSUPP on read from

[PATCH] net: phy: Trigger link_change_notify on PHY_HALTED

2021-01-05 Thread Marek Vasut
because old_state = PHY_HALTED and phy_dev->state = PHY_HALTED. Signed-off-by: Marek Vasut Cc: Andrew Lunn Cc: David S. Miller Cc: Heiner Kallweit --- drivers/net/phy/phy.c | 10 ++ 1 file changed, 10 insertions(+) diff --git a/drivers/net/phy/phy.c b/drivers/net/phy/phy.c index 4

[PATCH] [RFC] net: phy: smsc: Add magnetics VIO regulator support

2021-01-05 Thread Marek Vasut
Add support for controlling regulator powering the magnetics. In case the interface is down, it is possible to save considerable power by turning the regulator supplying the magnetics off. Signed-off-by: Marek Vasut Cc: Andrew Lunn Cc: Florian Fainelli Cc: David S. Miller Cc: Heiner Kallweit

Re: [PATCH] [RFC] net: phy: smsc: Add magnetics VIO regulator support

2021-01-05 Thread Marek Vasut
On 1/5/21 6:38 PM, Andrew Lunn wrote: +static void smsc_link_change_notify(struct phy_device *phydev) +{ + struct smsc_phy_priv *priv = phydev->priv; + + if (!priv->vddio) + return; + + if (phydev->state == PHY_HALTED) + regulator_disable(priv->vddio)

Re: [PATCH] [RFC] net: phy: smsc: Add magnetics VIO regulator support

2021-01-05 Thread Marek Vasut
On 1/5/21 8:03 PM, Andrew Lunn wrote: On Tue, Jan 05, 2021 at 06:53:48PM +0100, Marek Vasut wrote: On 1/5/21 6:38 PM, Andrew Lunn wrote: +static void smsc_link_change_notify(struct phy_device *phydev) +{ + struct smsc_phy_priv *priv = phydev->priv; + + if (!priv->

[PATCH net-next] net: ks8851: Select PHYLIB and MICREL_PHY in Kconfig

2021-01-11 Thread Marek Vasut
The PHYLIB must be selected to provide mdiobus_*() functions, and the MICREL_PHY is necessary too, as that is the only possible PHY attached to the KS8851 (it is the internal PHY). Fixes: ef3631220d2b ("net: ks8851: Register MDIO bus and the internal PHY") Signed-off-by: Marek Vasut

[PATCH net-next] net: ks8851: Connect and start/stop the internal PHY

2021-01-11 Thread Marek Vasut
Unless the internal PHY is connected and started, the phylib will not poll the PHY for state and produce state updates. Connect the PHY and start/stop it. Signed-off-by: Marek Vasut Cc: Andrew Lunn Cc: Heiner Kallweit Cc: Lukas Wunner --- drivers/net/ethernet/micrel/ks8851.h| 2

Re: [PATCH net-next] net: ks8851: Connect and start/stop the internal PHY

2021-01-11 Thread Marek Vasut
On 1/11/21 2:26 PM, Heiner Kallweit wrote: [...] LGTM. When having a brief look at the driver I stumbled across two things: 1. Do MAC/PHY support any pause mode? Then a call to phy_support_(a)sym_pause() would be missing. https://ww1.microchip.com/downloads/en/DeviceDoc/KSZ8851-16MLL-Sing

Re: [PATCH net-next] net: ks8851: Connect and start/stop the internal PHY

2021-01-11 Thread Marek Vasut
On 1/11/21 2:50 PM, Heiner Kallweit wrote: On 11.01.2021 14:38, Marek Vasut wrote: On 1/11/21 2:26 PM, Heiner Kallweit wrote: [...] LGTM. When having a brief look at the driver I stumbled across two things: 1. Do MAC/PHY support any pause mode? Then a call to     phy_support_(a)sym_pause

[PATCH 1/2] rsi: Move card interrupt handling to RX thread

2020-11-03 Thread Marek Vasut
th local buffer. Signed-off-by: Marek Vasut Cc: Angus Ainslie Cc: David S. Miller Cc: Jakub Kicinski Cc: Kalle Valo Cc: Lee Jones Cc: Martin Kepplinger Cc: Sebastian Krzyszkowiak Cc: Siva Rebbagondla Cc: linux-wirel...@vger.kernel.org Cc: netdev@vger.kernel.org --- drivers/net/wireless/rsi

[PATCH 2/2] rsi: Clean up loop in the interrupt handler

2020-11-03 Thread Marek Vasut
The inner do { ... } while loop is completely useless, all it does is iterate over a switch-case statement, one bit at a time. This can easily be replaced by simple if (status & bit) { ... } tests for each bit. No functional change. Signed-off-by: Marek Vasut Cc: Angus Ainslie Cc: Dav

Re: [PATCH 1/2] rsi: Move card interrupt handling to RX thread

2020-11-04 Thread Marek Vasut
On 11/4/20 4:21 PM, Martin Kepplinger wrote: On 03.11.20 19:09, Marek Vasut wrote: The interrupt handling of the RS911x is particularly heavy. For each RX packet, the card does three SDIO transactions, one to read interrupt status register, one to RX buffer length, one to read the RX packet(s

[PATCH] rsi: Use resume_noirq for SDIO

2021-03-27 Thread Marek Vasut
anything else from claiming the SDIO bus first. Fixes: 20db07332736 ("rsi: sdio suspend and resume support") Signed-off-by: Marek Vasut Cc: Amitkumar Karwar Cc: Angus Ainslie Cc: David S. Miller Cc: Jakub Kicinski Cc: Kalle Valo Cc: Karun Eagalapati Cc: Martin Kepplinger Cc:

Re: [PATCH] [5.8 regression] net: ks8851: fix link error

2021-01-26 Thread Marek Vasut
On 1/25/21 1:19 PM, Arnd Bergmann wrote: From: Arnd Bergmann An object file cannot be built for both loadable module and built-in use at the same time: arm-linux-gnueabi-ld: drivers/net/ethernet/micrel/ks8851_common.o: in function `ks8851_probe_common': ks8851_common.c:(.text+0xf80): undefine

Re: [PATCH AUTOSEL 5.10 050/217] rsi: Fix TX EAPOL packet handling against iwlwifi AP

2021-03-02 Thread Marek Vasut
On 12/23/20 3:13 AM, Sasha Levin wrote: Hello Sasha, From: Marek Vasut [ Upstream commit 65277100caa2f2c62b6f3c4648b90d6f0435f3bc ] In case RSI9116 SDIO WiFi operates in STA mode against Intel 9260 in AP mode, the association fails. The former is using wpa_supplicant during association, the

Re: [PATCH AUTOSEL 5.10 050/217] rsi: Fix TX EAPOL packet handling against iwlwifi AP

2021-03-04 Thread Marek Vasut
On 3/4/21 9:47 PM, Sasha Levin wrote: On Tue, Mar 02, 2021 at 08:25:49PM +0100, Marek Vasut wrote: On 12/23/20 3:13 AM, Sasha Levin wrote: Hello Sasha, From: Marek Vasut [ Upstream commit 65277100caa2f2c62b6f3c4648b90d6f0435f3bc ] In case RSI9116 SDIO WiFi operates in STA mode against

[PATCH] net: dsa: microchip: Use gpiod_set_value_cansleep()

2019-06-23 Thread Marek Vasut
Replace gpiod_set_value() with gpiod_set_value_cansleep(), as the switch reset GPIO can be connected to e.g. I2C GPIO expander and it is perfectly fine for the kernel to sleep for a bit in ksz_switch_register(). Signed-off-by: Marek Vasut Cc: Andrew Lunn Cc: Florian Fainelli Cc: Linus Walleij

[PATCH] net: ethernet: ti: cpsw: Assign OF node to slave devices

2019-06-23 Thread Marek Vasut
Assign OF node to CPSW slave devices, otherwise it is not possible to bind e.g. DSA switch to them. Without this patch, the DSA code tries to find the ethernet device by OF match, but fails to do so because the slave device has NULL OF node. Signed-off-by: Marek Vasut Cc: David S. Miller Cc

Re: [PATCH] net: dsa: microchip: Use gpiod_set_value_cansleep()

2019-06-23 Thread Marek Vasut
On 6/23/19 5:09 PM, Andrew Lunn wrote: > On Sun, Jun 23, 2019 at 02:10:36PM +0200, Marek Vasut wrote: >> Replace gpiod_set_value() with gpiod_set_value_cansleep(), as the switch >> reset GPIO can be connected to e.g. I2C GPIO expander and it is perfectly >> fine for the kern

[PATCH V2] net: dsa: microchip: Use gpiod_set_value_cansleep()

2019-06-23 Thread Marek Vasut
Replace gpiod_set_value() with gpiod_set_value_cansleep(), as the switch reset GPIO can be connected to e.g. I2C GPIO expander and it is perfectly fine for the kernel to sleep for a bit in ksz_switch_register(). Signed-off-by: Marek Vasut Cc: Andrew Lunn Cc: Florian Fainelli Cc: Linus Walleij

[PATCH V3 06/10] net: dsa: microchip: Factor out register access opcode generation

2019-06-23 Thread Marek Vasut
Factor out the code which sends out the register read/write opcodes to the switch, since the code differs in single bit between read and write. Signed-off-by: Marek Vasut Cc: Andrew Lunn Cc: Florian Fainelli Cc: Tristram Ha Cc: Woojung Huh --- V2: New patch V3: - Rebase on next/master

[PATCH V3 09/10] net: dsa: microchip: Factor out regmap config generation into common header

2019-06-23 Thread Marek Vasut
The regmap config tables are rather similar for various generations of the KSZ8xxx/KSZ9xxx switches. Introduce a macro which allows generating those tables without duplication. Note that $regalign parameter is not used right now, but will be used in KSZ87xx series switches. Signed-off-by: Marek

[PATCH V3 01/10] net: dsa: microchip: Remove ksz_{read,write}24()

2019-06-23 Thread Marek Vasut
These functions and callbacks are never used, remove them. Signed-off-by: Marek Vasut Cc: Andrew Lunn Cc: Florian Fainelli Cc: Tristram Ha Cc: Woojung Huh --- V2: No change V3: - Rebase on next/master - Test on KSZ9477EVB --- drivers/net/dsa/microchip/ksz9477_spi.c | 25

[PATCH V3 08/10] net: dsa: microchip: Dispose of ksz_io_ops

2019-06-23 Thread Marek Vasut
Since the driver now uses regmap , get rid of ad-hoc ksz_io_ops abstraction, which no longer has any meaning. Moreover, since regmap has it's own locking, get rid of the register access mutex. Signed-off-by: Marek Vasut Cc: Andrew Lunn Cc: Florian Fainelli Cc: Tristram Ha Cc: Woojun

[PATCH V3 10/10] net: dsa: microchip: Replace ad-hoc bit manipulation with regmap

2019-06-23 Thread Marek Vasut
Regmap provides bit manipulation functions to set/clear bits, use those insted of reimplementing them. Signed-off-by: Marek Vasut Cc: Andrew Lunn Cc: Florian Fainelli Cc: Tristram Ha Cc: Woojung Huh --- V2: New patch V3: - Rebase on next/master - Test on KSZ9477EVB --- drivers/net/dsa

[PATCH V3 07/10] net: dsa: microchip: Initial SPI regmap support

2019-06-23 Thread Marek Vasut
for no reason. Regmap covers the whole thing now. Signed-off-by: Marek Vasut Cc: Andrew Lunn Cc: Florian Fainelli Cc: Tristram Ha Cc: Woojung Huh --- V2: - Squash with "net: dsa: microchip: Remove dev->txbuf" - Use separate regmaps for 8/16/32bit registers - Increase th

[PATCH V3 04/10] net: dsa: microchip: Move ksz_cfg and ksz_port_cfg to ksz9477.c

2019-06-23 Thread Marek Vasut
These functions are only used by the KSZ9477 code, move them from the header into that code. Note that these functions will be soon replaced by regmap equivalents. Signed-off-by: Marek Vasut Cc: Andrew Lunn Cc: Florian Fainelli Cc: Tristram Ha Cc: Woojung Huh --- V2: New patch V3: - Rebase

[PATCH V3 00/10] net: dsa: microchip: Convert to regmap

2019-06-23 Thread Marek Vasut
This patchset converts KSZ9477 switch driver to regmap. This was tested with extra patches on KSZ8795. This was also tested on KSZ9477 on Microchip KSZ9477EVB board, which I now have. Signed-off-by: Marek Vasut Cc: Andrew Lunn Cc: Florian Fainelli Cc: Tristram Ha Cc: Woojung Huh Marek

[PATCH V3 03/10] net: dsa: microchip: Inline ksz_spi.h

2019-06-23 Thread Marek Vasut
The functions in the header file are static, and the header file is included from single C file, just inline the code into the C file. The bonus is that it's easier to spot further content to clean up. Signed-off-by: Marek Vasut Cc: Andrew Lunn Cc: Florian Fainelli Cc: Tristram Ha Cc: Wo

[PATCH V3 02/10] net: dsa: microchip: Remove ksz_{get,set}()

2019-06-23 Thread Marek Vasut
These functions and callbacks are never used, remove them. Signed-off-by: Marek Vasut Cc: Andrew Lunn Cc: Florian Fainelli Cc: Tristram Ha Cc: Woojung Huh --- V2: No change V3: - Rebase on next/master - Test on KSZ9477EVB --- drivers/net/dsa/microchip/ksz9477_spi.c | 2 -- drivers/net

[PATCH V3 05/10] net: dsa: microchip: Use PORT_CTRL_ADDR() instead of indirect function call

2019-06-23 Thread Marek Vasut
The indirect function call to dev->dev_ops->get_port_addr() is expensive especially if called for every single register access, and only returns the value of PORT_CTRL_ADDR() macro. Use PORT_CTRL_ADDR() macro directly instead. Signed-off-by: Marek Vasut Cc: Andrew Lunn Cc: Florian Fainel

Re: [PATCH V3 07/10] net: dsa: microchip: Initial SPI regmap support

2019-06-24 Thread Marek Vasut
On 6/24/19 12:35 AM, Marek Vasut wrote: > Add basic SPI regmap support into the driver. > > Previous patches unconver that ksz_spi_write() is always ever called > with len = 1, 2 or 4. We can thus drop the if (len > SPI_TX_BUF_LEN) > check and we can also drop the allocation of

Re: [PATCH V3 05/10] net: dsa: microchip: Use PORT_CTRL_ADDR() instead of indirect function call

2019-06-24 Thread Marek Vasut
On 6/24/19 5:20 AM, Andrew Lunn wrote: > On Mon, Jun 24, 2019 at 12:35:03AM +0200, Marek Vasut wrote: >> The indirect function call to dev->dev_ops->get_port_addr() is expensive >> especially if called for every single register access, and only returns >> the value of

Re: [PATCH V3 07/10] net: dsa: microchip: Initial SPI regmap support

2019-06-25 Thread Marek Vasut
On 6/25/19 1:59 AM, Vladimir Oltean wrote: > On Tue, 25 Jun 2019 at 01:17, Marek Vasut wrote: >> >> On 6/24/19 12:35 AM, Marek Vasut wrote: >>> Add basic SPI regmap support into the driver. >>> >>> Previous patches unconver that ksz_spi_write() is alway

Re: [PATCH V3 07/10] net: dsa: microchip: Initial SPI regmap support

2019-06-25 Thread Marek Vasut
On 6/25/19 2:40 PM, Vladimir Oltean wrote: > On Tue, 25 Jun 2019 at 15:06, Marek Vasut wrote: >> >> On 6/25/19 1:59 AM, Vladimir Oltean wrote: >>> On Tue, 25 Jun 2019 at 01:17, Marek Vasut wrote: >>>> >>>> On 6/24/19 12:35 AM, Marek Vasut wrote: &g

[PATCH V4 09/10] net: dsa: microchip: Factor out regmap config generation into common header

2019-06-25 Thread Marek Vasut
The regmap config tables are rather similar for various generations of the KSZ8xxx/KSZ9xxx switches. Introduce a macro which allows generating those tables without duplication. Note that $regalign parameter is not used right now, but will be used in KSZ87xx series switches. Signed-off-by: Marek

[PATCH V4 10/10] net: dsa: microchip: Replace ad-hoc bit manipulation with regmap

2019-06-25 Thread Marek Vasut
Regmap provides bit manipulation functions to set/clear bits, use those insted of reimplementing them. Signed-off-by: Marek Vasut Cc: Andrew Lunn Cc: Florian Fainelli Cc: Tristram Ha Cc: Woojung Huh --- V2: New patch V3: - Rebase on next/master - Test on KSZ9477EVB V4: No change

[PATCH V4 06/10] net: dsa: microchip: Factor out register access opcode generation

2019-06-25 Thread Marek Vasut
Factor out the code which sends out the register read/write opcodes to the switch, since the code differs in single bit between read and write. Signed-off-by: Marek Vasut Cc: Andrew Lunn Cc: Florian Fainelli Cc: Tristram Ha Cc: Woojung Huh Reviewed-by: Andrew Lunn --- V2: New patch V3

[PATCH V4 08/10] net: dsa: microchip: Dispose of ksz_io_ops

2019-06-25 Thread Marek Vasut
Since the driver now uses regmap , get rid of ad-hoc ksz_io_ops abstraction, which no longer has any meaning. Moreover, since regmap has it's own locking, get rid of the register access mutex. Signed-off-by: Marek Vasut Cc: Andrew Lunn Cc: Florian Fainelli Cc: Tristram Ha Cc: Woojun

[PATCH V4 04/10] net: dsa: microchip: Move ksz_cfg and ksz_port_cfg to ksz9477.c

2019-06-25 Thread Marek Vasut
These functions are only used by the KSZ9477 code, move them from the header into that code. Note that these functions will be soon replaced by regmap equivalents. Signed-off-by: Marek Vasut Cc: Andrew Lunn Cc: Florian Fainelli Cc: Tristram Ha Cc: Woojung Huh Reviewed-by: Andrew Lunn --- V2

[PATCH V4 00/10] net: dsa: microchip: Convert to regmap

2019-06-25 Thread Marek Vasut
This patchset converts KSZ9477 switch driver to regmap. This was tested with extra patches on KSZ8795. This was also tested on KSZ9477 on Microchip KSZ9477EVB board, which I now have. Signed-off-by: Marek Vasut Cc: Andrew Lunn Cc: Florian Fainelli Cc: Tristram Ha Cc: Woojung Huh Marek

[PATCH V4 07/10] net: dsa: microchip: Initial SPI regmap support

2019-06-25 Thread Marek Vasut
for no reason. Regmap covers the whole thing now. Signed-off-by: Marek Vasut Cc: Andrew Lunn Cc: Florian Fainelli Cc: Tristram Ha Cc: Woojung Huh --- V2: - Squash with "net: dsa: microchip: Remove dev->txbuf" - Use separate regmaps for 8/16/32bit registers - Increase th

[PATCH V4 01/10] net: dsa: microchip: Remove ksz_{read,write}24()

2019-06-25 Thread Marek Vasut
These functions and callbacks are never used, remove them. Signed-off-by: Marek Vasut Cc: Andrew Lunn Cc: Florian Fainelli Cc: Tristram Ha Cc: Woojung Huh Reviewed-by: Andrew Lunn --- V2: No change V3: - Rebase on next/master - Test on KSZ9477EVB V4: Add RB --- drivers/net/dsa

[PATCH V4 05/10] net: dsa: microchip: Use PORT_CTRL_ADDR() instead of indirect function call

2019-06-25 Thread Marek Vasut
The indirect function call to dev->dev_ops->get_port_addr() is expensive especially if called for every single register access, and only returns the value of PORT_CTRL_ADDR() macro. Use PORT_CTRL_ADDR() macro directly instead. Signed-off-by: Marek Vasut Cc: Andrew Lunn Cc: Florian Fainel

[PATCH V4 03/10] net: dsa: microchip: Inline ksz_spi.h

2019-06-25 Thread Marek Vasut
The functions in the header file are static, and the header file is included from single C file, just inline the code into the C file. The bonus is that it's easier to spot further content to clean up. Signed-off-by: Marek Vasut Cc: Andrew Lunn Cc: Florian Fainelli Cc: Tristram Ha Cc: Wo

[PATCH V4 02/10] net: dsa: microchip: Remove ksz_{get,set}()

2019-06-25 Thread Marek Vasut
These functions and callbacks are never used, remove them. Signed-off-by: Marek Vasut Cc: Andrew Lunn Cc: Florian Fainelli Cc: Tristram Ha Cc: Woojung Huh Reviewed-by: Andrew Lunn --- V2: No change V3: - Rebase on next/master - Test on KSZ9477EVB V4: Add RB --- drivers/net/dsa

[PATCH 1/5] net: dsa: microchip: Replace ad-hoc polling with regmap

2019-06-27 Thread Marek Vasut
Regmap provides polling function to poll for bits in a register, use in instead of reimplementing it. Signed-off-by: Marek Vasut Cc: Andrew Lunn Cc: Florian Fainelli Cc: Tristram Ha Cc: Woojung Huh --- drivers/net/dsa/microchip/ksz9477.c| 14 +- drivers/net/dsa/microchip

[PATCH 2/5] net: dsa: microchip: Replace ksz9477_wait_vlan_ctrl_ready polling with regmap

2019-06-27 Thread Marek Vasut
values than this one. Signed-off-by: Marek Vasut Cc: Andrew Lunn Cc: Florian Fainelli Cc: Tristram Ha Cc: Woojung Huh --- drivers/net/dsa/microchip/ksz9477.c | 26 -- 1 file changed, 8 insertions(+), 18 deletions(-) diff --git a/drivers/net/dsa/microchip/ksz9477.c b

[PATCH 4/5] net: dsa: microchip: Replace ksz9477_wait_alu_sta_ready polling with regmap

2019-06-27 Thread Marek Vasut
values than this one. Signed-off-by: Marek Vasut Cc: Andrew Lunn Cc: Florian Fainelli Cc: Tristram Ha Cc: Woojung Huh --- drivers/net/dsa/microchip/ksz9477.c | 32 +++-- 1 file changed, 12 insertions(+), 20 deletions(-) diff --git a/drivers/net/dsa/microchip/ksz9477.c b

[PATCH 5/5] net: dsa: microchip: Replace bit RMW with regmap

2019-06-27 Thread Marek Vasut
Regmap provides read-modify-write function to update bitfields in registers. Replace ad-hoc read-modify-write with regmap_update_bits() where applicable. Signed-off-by: Marek Vasut Cc: Andrew Lunn Cc: Florian Fainelli Cc: Tristram Ha Cc: Woojung Huh --- drivers/net/dsa/microchip/ksz9477.c

[PATCH 0/5] net: dsa: microchip: Further regmap cleanups

2019-06-27 Thread Marek Vasut
Vasut Cc: Andrew Lunn Cc: Florian Fainelli Cc: Tristram Ha Cc: Woojung Huh Marek Vasut (5): net: dsa: microchip: Replace ad-hoc polling with regmap net: dsa: microchip: Replace ksz9477_wait_vlan_ctrl_ready polling with regmap net: dsa: microchip: Replace ksz9477_wait_alu_ready polling

[PATCH 3/5] net: dsa: microchip: Replace ksz9477_wait_alu_ready polling with regmap

2019-06-27 Thread Marek Vasut
values than this one. Signed-off-by: Marek Vasut Cc: Andrew Lunn Cc: Florian Fainelli Cc: Tristram Ha Cc: Woojung Huh --- drivers/net/dsa/microchip/ksz9477.c | 34 ++--- 1 file changed, 12 insertions(+), 22 deletions(-) diff --git a/drivers/net/dsa/microchip/ksz9477.c b

Re: [PATCH 0/5] net: dsa: microchip: Further regmap cleanups

2019-06-28 Thread Marek Vasut
On 6/28/19 5:31 PM, Vivien Didelot wrote: > Hi Marek, > > On Thu, 27 Jun 2019 23:55:51 +0200, Marek Vasut wrote: >> This patchset cleans up KSZ9477 switch driver by replacing various >> ad-hoc polling implementations and register RMW with regmap functions. >> >>

[PATCH V5] net: phy: tja11xx: Add TJA11xx PHY driver

2019-05-17 Thread Marek Vasut
Add driver for the NXP TJA1100 and TJA1101 PHYs. These PHYs are special BroadRReach 100BaseT1 PHYs used in automotive. Signed-off-by: Marek Vasut Cc: Andrew Lunn Cc: Florian Fainelli Cc: Guenter Roeck Cc: Heiner Kallweit Cc: Jean Delvare Cc: linux-hw...@vger.kernel.org --- V2: - Use

  1   2   3   4   5   >