[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 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

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] [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 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 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 -

[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: 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: 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

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,

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] 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

[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: 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

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-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

[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: 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

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-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-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

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

[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

[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

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->

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)

[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

[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 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-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 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

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

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 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

[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

[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

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 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

[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] rsi: Fix TX EAPOL packet handling against iwlwifi AP

2020-10-15 Thread Marek Vasut
lob/master/rsi/rsi_91x_hal.c#L238 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 --- driv

Re: PHY reset question

2020-10-12 Thread Marek Vasut
On 10/12/20 7:48 AM, Oleksij Rempel wrote: > Hi all, > > thank you for the feedback! > > On Fri, Oct 09, 2020 at 04:25:49PM +0200, Bruno Thomsen wrote: >> Hi Fabio and Oleksij >> >> Den ons. 7. okt. 2020 kl. 11.50 skrev Fabio Estevam : >>> >>> Hi Oleksij, >>> >>> On Tue, Oct 6, 2020 at 5:05 AM Ol

[PATCH V2] net: fec: Fix phy_device lookup for phy_reset_after_clk_enable()

2020-10-10 Thread Marek Vasut
xes: 1b0a83ac04e3 ("net: fec: add phy_reset_after_clk_enable() support") Signed-off-by: Marek Vasut Cc: Christoph Niedermaier Cc: David S. Miller Cc: NXP Linux Team Cc: Richard Leitner Cc: Shawn Guo --- V2: - put_device() the phy_dev reference from of_phy_find_device() - A

Re: [PATCH] net: fec: Fix phy_device lookup for phy_reset_after_clk_enable()

2020-10-10 Thread Marek Vasut
On 10/9/20 8:02 PM, Jakub Kicinski wrote: > On Fri, 9 Oct 2020 19:34:10 +0200 Marek Vasut wrote: >>>>> To an untrained eye this looks pretty weird. >>>> >>>> I see, I'm not quite sure how to address this comment. >>> >>> I

Re: [PATCH] net: fec: Fix phy_device lookup for phy_reset_after_clk_enable()

2020-10-09 Thread Marek Vasut
On 10/9/20 5:15 PM, Jakub Kicinski wrote: > On Fri, 9 Oct 2020 09:20:30 +0200 Marek Vasut wrote: >>> Can you describe your problem in detail? >> >> Yes, I tried to do that in the commit message and the extra detailed >> comment above the code. What exactly d

Re: [PATCH] net: fec: Fix phy_device lookup for phy_reset_after_clk_enable()

2020-10-09 Thread Marek Vasut
On 10/9/20 2:46 AM, Jakub Kicinski wrote: > On Wed, 7 Oct 2020 00:02:42 +0200 Marek Vasut wrote: >> On 10/6/20 11:09 PM, Florian Fainelli wrote: >>> On 10/6/2020 1:20 PM, Marek Vasut wrote: >>>> The phy_reset_after_clk_enable() is always called with ndev->phydev,

Re: [PATCH][RESEND] net: fec: Fix PHY init after phy_reset_after_clk_enable()

2020-10-09 Thread Marek Vasut
On 10/9/20 2:51 AM, Jakub Kicinski wrote: > On Tue, 6 Oct 2020 15:52:53 +0200 Marek Vasut wrote: >> The phy_reset_after_clk_enable() does a PHY reset, which means the PHY >> loses its register settings. The fec_enet_mii_probe() starts the PHY >> and does the necessary calls

Re: PHY reset question

2020-10-07 Thread Marek Vasut
On 10/7/20 11:06 AM, Marco Felsch wrote: > On 20-10-07 10:23, Marek Vasut wrote: >> On 10/7/20 10:14 AM, Marco Felsch wrote: >>> Hi Marek, >> >> Hi, >> >> [...] >> >>> On 20-10-06 14:11, Florian Fainelli wrote: >>>> On 10/6/2020

Re: PHY reset question

2020-10-07 Thread Marek Vasut
On 10/7/20 10:14 AM, Marco Felsch wrote: > Hi Marek, Hi, [...] > On 20-10-06 14:11, Florian Fainelli wrote: >> On 10/6/2020 1:24 PM, Marek Vasut wrote: > > ... > >>> If this happens on MX6 with FEC, can you please try these two patches? >>> >>

Re: PHY reset question

2020-10-06 Thread Marek Vasut
On 10/6/20 11:11 PM, Florian Fainelli wrote: > > > On 10/6/2020 1:24 PM, Marek Vasut wrote: >> On 10/6/20 9:36 PM, Florian Fainelli wrote: >> [...] >>>> - Use compatible ("compatible = "ethernet-phy-id0022.1560") in the >>>>

Re: [PATCH] net: fec: Fix phy_device lookup for phy_reset_after_clk_enable()

2020-10-06 Thread Marek Vasut
On 10/6/20 11:09 PM, Florian Fainelli wrote: > > > On 10/6/2020 1:20 PM, Marek Vasut wrote: >> The phy_reset_after_clk_enable() is always called with ndev->phydev, >> however that pointer may be NULL even though the PHY device instance >> already exists and is suffi

Re: PHY reset question

2020-10-06 Thread Marek Vasut
On 10/6/20 9:36 PM, Florian Fainelli wrote: [...] >> - Use compatible ("compatible = "ethernet-phy-id0022.1560") in the >> devicetree, >>    so that reading the PHYID is not needed >>    - easy to solve. >>    Disadvantage: >>    - losing PHY auto-detection capability >>    - need a new devicetree

[PATCH] net: fec: Fix phy_device lookup for phy_reset_after_clk_enable()

2020-10-06 Thread Marek Vasut
ice instance already, use the OF PHY node to obtain the PHY device instance, and then use that PHY device instance when triggering the PHY reset. Fixes: 1b0a83ac04e3 ("net: fec: add phy_reset_after_clk_enable() support") Signed-off-by: Marek Vasut Cc: Christoph Niedermaier Cc: David S. Miller

[PATCH][RESEND] net: fec: Fix PHY init after phy_reset_after_clk_enable()

2020-10-06 Thread Marek Vasut
() should be called only after the PHY has been reset, not before as it is now. Fixes: 1b0a83ac04e3 ("net: fec: add phy_reset_after_clk_enable() support") Reviewed-by: Andrew Lunn Tested-by: Richard Leitner Signed-off-by: Marek Vasut Cc: Christoph Niedermaier Cc: David S. Miller Cc: NXP

Re: [PATCH] net: fec: Fix PHY init after phy_reset_after_clk_enable()

2020-10-06 Thread Marek Vasut
On 9/28/20 3:03 PM, Richard Leitner wrote: > On Sat, Sep 26, 2020 at 08:52:17PM +0200, Marek Vasut wrote: >> On 9/9/20 10:38 AM, Richard Leitner wrote: >>> On Fri, Sep 04, 2020 at 09:23:26PM +0200, Marek Vasut wrote: >>>> On 9/4/20 9:02 PM, Richard Leitner wrote: &g

Re: [PATCH] net: fec: Fix PHY init after phy_reset_after_clk_enable()

2020-09-26 Thread Marek Vasut
On 9/9/20 10:38 AM, Richard Leitner wrote: > On Fri, Sep 04, 2020 at 09:23:26PM +0200, Marek Vasut wrote: >> On 9/4/20 9:02 PM, Richard Leitner wrote: >>> On Fri, Sep 04, 2020 at 05:26:14PM +0200, Marek Vasut wrote: >>>> On 9/4/20 4:02 PM, Andrew Lunn wrote: >&

Re: [PATCH] can: m_can: Set pinmux into "default" state on start

2020-09-16 Thread Marek Vasut
On 9/1/20 8:56 PM, Marek Vasut wrote: > On 8/9/20 1:01 PM, Marek Vasut wrote: >> On 5/31/20 8:13 PM, Marek Vasut wrote: >>> On systems like stm32mp1 where pins have both "default" and "sleep" pinmux >>> states in DT, the pins are in "sleep"

Re: [PATCH] net: fec: Fix PHY init after phy_reset_after_clk_enable()

2020-09-04 Thread Marek Vasut
On 9/4/20 9:02 PM, Richard Leitner wrote: > On Fri, Sep 04, 2020 at 05:26:14PM +0200, Marek Vasut wrote: >> On 9/4/20 4:02 PM, Andrew Lunn wrote: >>> On Fri, Sep 04, 2020 at 12:45:44AM +0200, Marek Vasut wrote: >>>> On 9/4/20 12:08 AM, Andrew Lunn wrote: >>

Re: [PATCH] net: fec: Fix PHY init after phy_reset_after_clk_enable()

2020-09-04 Thread Marek Vasut
On 9/4/20 4:02 PM, Andrew Lunn wrote: > On Fri, Sep 04, 2020 at 12:45:44AM +0200, Marek Vasut wrote: >> On 9/4/20 12:08 AM, Andrew Lunn wrote: >>>>> b4 am 20200903043947.3272453-1-f.faine...@gmail.com >>>> >>>> That might be a fix for the long run,

Re: [PATCH] net: fec: Fix PHY init after phy_reset_after_clk_enable()

2020-09-03 Thread Marek Vasut
On 9/4/20 12:08 AM, Andrew Lunn wrote: >>> b4 am 20200903043947.3272453-1-f.faine...@gmail.com >> >> That might be a fix for the long run, but I doubt there's any chance to >> backport it all to stable, is there ? > > No. For stable we need something simpler. Like this patch ? > I think a be

Re: [PATCH] net: fec: Fix PHY init after phy_reset_after_clk_enable()

2020-09-03 Thread Marek Vasut
On 9/3/20 11:53 PM, Andrew Lunn wrote: > On Thu, Sep 03, 2020 at 11:36:39PM +0200, Marek Vasut wrote: >> On 9/3/20 11:00 PM, Andrew Lunn wrote: >>> On Thu, Sep 03, 2020 at 10:27:12PM +0200, Marek Vasut wrote: >>>> The phy_reset_after_clk_enable() does a PHY reset,

Re: [PATCH] net: fec: Fix PHY init after phy_reset_after_clk_enable()

2020-09-03 Thread Marek Vasut
On 9/3/20 11:00 PM, Andrew Lunn wrote: > On Thu, Sep 03, 2020 at 10:27:12PM +0200, Marek Vasut wrote: >> The phy_reset_after_clk_enable() does a PHY reset, which means the PHY >> loses its register settings. The fec_enet_mii_probe() starts the PHY >> and does the necessary c

[PATCH] net: fec: Fix PHY init after phy_reset_after_clk_enable()

2020-09-03 Thread Marek Vasut
() should be called only after the PHY has been reset, not before as it is now. Fixes: 1b0a83ac04e3 ("net: fec: add phy_reset_after_clk_enable() support") Signed-off-by: Marek Vasut Cc: Christoph Niedermaier Cc: David S. Miller Cc: NXP Linux Team Cc: Richard Leitner Cc: Shawn Guo --- d

Re: [PATCH] can: m_can: Set pinmux into "default" state on start

2020-09-01 Thread Marek Vasut
On 8/9/20 1:01 PM, Marek Vasut wrote: > On 5/31/20 8:13 PM, Marek Vasut wrote: >> On systems like stm32mp1 where pins have both "default" and "sleep" pinmux >> states in DT, the pins are in "sleep" state by default. Switch the pins into >> th

[PATCH V7 08/19] net: ks8851: Use 16-bit writes to program MAC address

2020-05-28 Thread Marek Vasut
anymore. There should be no functional change. Reviewed-by: Andrew Lunn Signed-off-by: Marek Vasut Cc: David S. Miller Cc: Lukas Wunner Cc: Petr Stetiar Cc: YueHaibing --- V2: Get rid of the KS_MAR(i + 1) by adjusting KS_MAR(x) macro V3: Swap MARx MSB and LSB in ks8851_read_mac_addr() V4: No

[PATCH V7 18/19] net: ks8851: Implement Parallel bus operations

2020-05-28 Thread Marek Vasut
how to access the bus, but uses the common ks8851.c code. To make this patch reviewable, instead of rewriting ks8851_mll.c, ks8851_mll.c is removed in a separate subsequent patch. Signed-off-by: Marek Vasut Cc: David S. Miller Cc: Lukas Wunner Cc: Petr Stetiar Cc: YueHaibing --- V2: - Drop

[PATCH V7 17/19] net: ks8851: Separate SPI operations into separate file

2020-05-28 Thread Marek Vasut
Pull all the SPI bus specific code into a separate file, so that it is not mixed with the common code. Rename ks8851.c to ks8851_common.c. The ks8851_common.c is linked with ks8851_spi.c now, so it can call the accessors in the ks8851_spi.c without any pointer indirection. Signed-off-by: Marek

[PATCH V7 19/19] net: ks8851: Remove ks8851_mll.c

2020-05-28 Thread Marek Vasut
The ks8851_mll.c is replaced by ks8851_par.c, which is using common code from ks8851.c, just like ks8851_spi.c . Remove this old ad-hoc driver. Signed-off-by: Marek Vasut Cc: David S. Miller Cc: Lukas Wunner Cc: Petr Stetiar Cc: YueHaibing --- V2: No change V3: No change V4: No change V5: No

[PATCH V7 14/19] net: ks8851: Factor out TX work flush function

2020-05-28 Thread Marek Vasut
the parallel bus driver. Reviewed-by: Andrew Lunn Signed-off-by: Marek Vasut Cc: David S. Miller Cc: Lukas Wunner Cc: Petr Stetiar Cc: YueHaibing --- V3: New patch V4: No change V5: No change V6: No change V7: No change --- drivers/net/ethernet/micrel/ks8851.c | 16 1 file

[PATCH V7 01/19] net: ks8851: Factor out spi->dev in probe()/remove()

2020-05-28 Thread Marek Vasut
Pull out the spi->dev into one common place in the function instead of having it repeated over and over again. This is done in preparation for unifying ks8851 and ks8851-mll drivers. No functional change. Reviewed-by: Andrew Lunn Signed-off-by: Marek Vasut Cc: David S. Miller Cc: Lukas Wun

[PATCH V7 15/19] net: ks8851: Permit overridding interrupt enable register

2020-05-28 Thread Marek Vasut
The parallel bus variant does not need to use the TX interrupt at all as it writes the TX FIFO directly with in .ndo_start_xmit, permit the drivers to configure the interrupt enable bits. Reviewed-by: Andrew Lunn Signed-off-by: Marek Vasut Cc: David S. Miller Cc: Lukas Wunner Cc: Petr Stetiar

[PATCH V7 04/19] net: ks8851: Pass device node into ks8851_init_mac()

2020-05-28 Thread Marek Vasut
his is done in preparation for unifying the KS8851 SPI and parallel bus drivers. No functional change. Signed-off-by: Marek Vasut Cc: David S. Miller Cc: Lukas Wunner Cc: Petr Stetiar Cc: YueHaibing --- V2: Pass in of_node instead of the entire device pointer V3: No change V4: No change V5:

[PATCH V7 00/19] net: ks8851: Unify KS8851 SPI and MLL drivers

2020-05-28 Thread Marek Vasut
bus driver is because the SPI bus driver is much higher quality. Note that I dropped "net: ks8851: Drop define debug and pr_fmt()" for now, will send it separatelly later. Marek Vasut (19): net: ks8851: Factor out spi->dev in probe()/remove() net: ks8851: Rename ndev to netdev i

[PATCH V7 11/19] net: ks8851: Factor out SKB receive function

2020-05-28 Thread Marek Vasut
Factor out this netif_rx_ni(), so it could be overridden by the parallel bus variant of the KS8851 driver. Signed-off-by: Marek Vasut Cc: David S. Miller Cc: Lukas Wunner Cc: Petr Stetiar Cc: YueHaibing --- V3: New patch V4: No change V5: No change V6: No change V7: No change --- drivers

[PATCH V7 06/19] net: ks8851: Use dev_{get,set}_drvdata()

2020-05-28 Thread Marek Vasut
Replace spi_{get,set}_drvdata() with dev_{get,set}_drvdata(), which works for both SPI and platform drivers. This is done in preparation for unifying the KS8851 SPI and parallel bus drivers. There should be no functional change. Reviewed-by: Andrew Lunn Signed-off-by: Marek Vasut Cc: David S

[PATCH V7 13/19] net: ks8851: Split out SPI specific code from probe() and remove()

2020-05-28 Thread Marek Vasut
Factor out common code into ks8851_probe_common() and ks8851_remove_common() to permit both SPI and parallel bus driver variants to use the common code path for both probing and removal. There should be no functional change. Reviewed-by: Andrew Lunn Signed-off-by: Marek Vasut Cc: David S

[PATCH V7 03/19] net: ks8851: Replace dev_err() with netdev_err() in IRQ handler

2020-05-28 Thread Marek Vasut
ers. Reviewed-by: Andrew Lunn Signed-off-by: Marek Vasut Cc: David S. Miller Cc: Lukas Wunner Cc: Petr Stetiar Cc: YueHaibing --- V2: Add RB from Andrew V3: No change V4: No change V5: No change V6: No change V7: No change --- drivers/net/ethernet/micrel/ks8851.c | 2 +- 1 file changed, 1 insertion(+)

[PATCH V7 09/19] net: ks8851: Use 16-bit read of RXFC register

2020-05-28 Thread Marek Vasut
anymore. There should be no functional change. Signed-off-by: Marek Vasut Cc: David S. Miller Cc: Lukas Wunner Cc: Petr Stetiar Cc: YueHaibing --- V2: No change V3: No change V4: Drop the NOTE from the comment, the performance is OK V5: No change V6: No change V7: No change --- drivers/net

[PATCH V7 02/19] net: ks8851: Rename ndev to netdev in probe

2020-05-28 Thread Marek Vasut
Rename ndev variable to netdev for the sake of consistency. No functional change. Reviewed-by: Andrew Lunn Signed-off-by: Marek Vasut Cc: David S. Miller Cc: Lukas Wunner Cc: Petr Stetiar Cc: YueHaibing --- V2: New patch V3: No change V4: No change V5: No change V6: No change V7: No change

[PATCH V7 05/19] net: ks8851: Use devm_alloc_etherdev()

2020-05-28 Thread Marek Vasut
Use device managed version of alloc_etherdev() to simplify the code. No functional change intended. Reviewed-by: Andrew Lunn Signed-off-by: Marek Vasut Cc: David S. Miller Cc: Lukas Wunner Cc: Petr Stetiar Cc: YueHaibing --- V2: Add RB from Andrew V3: No change V4: No change V5: No change

[PATCH V7 07/19] net: ks8851: Remove ks8851_rdreg32()

2020-05-28 Thread Marek Vasut
noticeable performance impact on the SPI variant of KS8851, then we should consider using regmap to abstract the SPI and parallel bus options and in case of SPI, permit regmap to merge register reads of neighboring registers into single, longer, read. Signed-off-by: Marek Vasut Cc: David S. Miller Cc

[PATCH V7 16/19] net: ks8851: Implement register, FIFO, lock accessor callbacks

2020-05-28 Thread Marek Vasut
The register and FIFO accessors are bus specific, so is locking. Implement callbacks so that each variant of the KS8851 can implement matching accessors and locking, and use the rest of the common code. Reviewed-by: Andrew Lunn Signed-off-by: Marek Vasut Cc: David S. Miller Cc: Lukas Wunner

[PATCH V7 10/19] net: ks8851: Factor out bus lock handling

2020-05-28 Thread Marek Vasut
. Reviewed-by: Andrew Lunn Signed-off-by: Marek Vasut Cc: David S. Miller Cc: Lukas Wunner Cc: Petr Stetiar Cc: YueHaibing --- V3: New patch V4: s@unsigned status@unsigned int status@ in ks8851_irq() V5: No change V6: No change V7: No change --- drivers/net/ethernet/micrel/ks8851.c | 97

[PATCH V7 12/19] net: ks8851: Split out SPI specific entries in struct ks8851_net

2020-05-28 Thread Marek Vasut
Add a new struct ks8851_net_spi, which embeds the original struct ks8851_net and contains the entries specific only to the SPI variant of KS8851. There should be no functional change. Reviewed-by: Andrew Lunn Signed-off-by: Marek Vasut Cc: David S. Miller Cc: Lukas Wunner Cc: Petr Stetiar

Re: [PATCH V6 00/20] net: ks8851: Unify KS8851 SPI and MLL drivers

2020-05-21 Thread Marek Vasut
On 5/17/20 9:30 PM, David Miller wrote: > From: Andrew Lunn > Date: Sun, 17 May 2020 21:16:35 +0200 > >>> Nevertheless I was going to repeat the performance measurements on a >>> recent kernel but haven't gotten around to that yet because the >>> measurements need to be performed with CONFIG_PREE

Re: [PATCH V6 20/20] net: ks8851: Drop define debug and pr_fmt()

2020-05-18 Thread Marek Vasut
On 5/17/20 4:55 AM, Joe Perches wrote: > On Sun, 2020-05-17 at 04:47 +0200, Marek Vasut wrote: >> On 5/17/20 4:37 AM, Joe Perches wrote: >>> On Sun, 2020-05-17 at 04:28 +0200, Marek Vasut wrote: >>>> On 5/17/20 4:01 AM, Joe Perches wrote: >>>>> On Sun,

Re: [PATCH V6 16/20] net: ks8851: Implement register, FIFO, lock accessor callbacks

2020-05-18 Thread Marek Vasut
On 5/18/20 6:34 PM, Jakub Kicinski wrote: > On Sun, 17 May 2020 02:33:50 +0200 Marek Vasut wrote: >> The register and FIFO accessors are bus specific, so is locking. >> Implement callbacks so that each variant of the KS8851 can implement >> matching accessors and locking, an

Re: [PATCH V6 00/20] net: ks8851: Unify KS8851 SPI and MLL drivers

2020-05-17 Thread Marek Vasut
On 5/17/20 9:26 PM, Andrew Lunn wrote: >> So I was already led into reworking the entire series to do this >> inlining once, after V1. It then turned out it's a horrible mess to get >> everything to compile as modules and built-in and then also only the >> parallel/SPI as a module and then the othe

Re: [PATCH V6 09/20] net: ks8851: Use 16-bit read of RXFC register

2020-05-17 Thread Marek Vasut
On 5/17/20 9:44 PM, Andrew Lunn wrote: > On Sun, May 17, 2020 at 02:33:43AM +0200, Marek Vasut wrote: >> The RXFC register is the only one being read using 8-bit accessors. >> To make it easier to support the 16-bit accesses used by the parallel >> bus variant of KS8851, u

Re: [PATCH V6 00/20] net: ks8851: Unify KS8851 SPI and MLL drivers

2020-05-17 Thread Marek Vasut
create > a new branch with RT patches on the test machine, which is fairly > involved and time consuming. > > I think it's fair that the two drivers are unified, but the performance > for the SPI variant shouldn't be unnecessarily diminished in the process. Could it be that your problem is related to this huge out-of-tree patch you use then ? -- Best regards, Marek Vasut

Re: [PATCH V6 20/20] net: ks8851: Drop define debug and pr_fmt()

2020-05-16 Thread Marek Vasut
On 5/17/20 4:37 AM, Joe Perches wrote: > On Sun, 2020-05-17 at 04:28 +0200, Marek Vasut wrote: >> On 5/17/20 4:01 AM, Joe Perches wrote: >>> On Sun, 2020-05-17 at 02:33 +0200, Marek Vasut wrote: >>>> Drop those debug statements from both drivers. They were ther

Re: [PATCH V6 20/20] net: ks8851: Drop define debug and pr_fmt()

2020-05-16 Thread Marek Vasut
On 5/17/20 4:01 AM, Joe Perches wrote: > On Sun, 2020-05-17 at 02:33 +0200, Marek Vasut wrote: >> Drop those debug statements from both drivers. They were there since >> at least 2011 and enabled by default, but that's likely wrong. > [] >> diff --git a/drivers/net

Re: [PATCH V6 00/20] net: ks8851: Unify KS8851 SPI and MLL drivers

2020-05-16 Thread Marek Vasut
On 5/17/20 4:02 AM, David Miller wrote: > From: Marek Vasut > Date: Sun, 17 May 2020 02:33:34 +0200 > >> The KS8851SNL/SNLI and KS8851-16MLL/MLLI/MLLU are very much the same pieces >> of silicon, except the former has an SPI interface, while the later has a >> paral

[PATCH V6 15/20] net: ks8851: Permit overridding interrupt enable register

2020-05-16 Thread Marek Vasut
The parallel bus variant does not need to use the TX interrupt at all as it writes the TX FIFO directly with in .ndo_start_xmit, permit the drivers to configure the interrupt enable bits. Reviewed-by: Andrew Lunn Signed-off-by: Marek Vasut Cc: David S. Miller Cc: Lukas Wunner Cc: Petr Stetiar

[PATCH V6 17/20] net: ks8851: Separate SPI operations into separate file

2020-05-16 Thread Marek Vasut
Pull all the SPI bus specific code into a separate file, so that it is not mixed with the common code. Rename ks8851.c to ks8851_common.c. The ks8851_common.c is linked with ks8851_spi.c now, so it can call the accessors in the ks8851_spi.c without any pointer indirection. Signed-off-by: Marek

[PATCH V6 01/20] net: ks8851: Factor out spi->dev in probe()/remove()

2020-05-16 Thread Marek Vasut
Pull out the spi->dev into one common place in the function instead of having it repeated over and over again. This is done in preparation for unifying ks8851 and ks8851-mll drivers. No functional change. Reviewed-by: Andrew Lunn Signed-off-by: Marek Vasut Cc: David S. Miller Cc: Lukas Wun

[PATCH V6 11/20] net: ks8851: Factor out SKB receive function

2020-05-16 Thread Marek Vasut
Factor out this netif_rx_ni(), so it could be overridden by the parallel bus variant of the KS8851 driver. Signed-off-by: Marek Vasut Cc: David S. Miller Cc: Lukas Wunner Cc: Petr Stetiar Cc: YueHaibing --- V3: New patch V4: No change V5: No change V6: No change --- drivers/net/ethernet

[PATCH V6 05/20] net: ks8851: Use devm_alloc_etherdev()

2020-05-16 Thread Marek Vasut
Use device managed version of alloc_etherdev() to simplify the code. No functional change intended. Reviewed-by: Andrew Lunn Signed-off-by: Marek Vasut Cc: David S. Miller Cc: Lukas Wunner Cc: Petr Stetiar Cc: YueHaibing --- V2: Add RB from Andrew V3: No change V4: No change V5: No change

[PATCH V6 00/20] net: ks8851: Unify KS8851 SPI and MLL drivers

2020-05-16 Thread Marek Vasut
bus driver is because the SPI bus driver is much higher quality. Marek Vasut (20): net: ks8851: Factor out spi->dev in probe()/remove() net: ks8851: Rename ndev to netdev in probe net: ks8851: Replace dev_err() with netdev_err() in IRQ handler net: ks8851: Pass device node i

  1   2   3   4   5   >