netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Oleksij Rempel <o.rempel@pengutronix.de>
To: Vladimir Oltean <olteanv@gmail.com>
Cc: Woojung Huh <woojung.huh@microchip.com>,
	Andrew Lunn <andrew@lunn.ch>,
	Florian Fainelli <f.fainelli@gmail.com>,
	Russell King <linux@armlinux.org.uk>,
	netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
	Vivien Didelot <vivien.didelot@gmail.com>,
	Michael Grzeschik <m.grzeschik@pengutronix.de>,
	kernel@pengutronix.de, Jakub Kicinski <kuba@kernel.org>,
	UNGLinuxDriver@microchip.com,
	"David S. Miller" <davem@davemloft.net>
Subject: Re: [PATCH net-next v4 4/9] net: phy: micrel: apply resume errata workaround for ksz8873 and ksz8863
Date: Sat, 12 Jun 2021 06:26:39 +0200	[thread overview]
Message-ID: <20210612042639.bgsloltuqoipmwtk@pengutronix.de> (raw)
In-Reply-To: <20210611192010.ptmblzpj6ilt24ly@skbuf>

On Fri, Jun 11, 2021 at 10:20:10PM +0300, Vladimir Oltean wrote:
> On Fri, Jun 11, 2021 at 09:15:22AM +0200, Oleksij Rempel wrote:
> > The ksz8873 and ksz8863 switches are affected by following errata:
> > 
> > | "Receiver error in 100BASE-TX mode following Soft Power Down"
> > |
> > | Some KSZ8873 devices may exhibit receiver errors after transitioning
> > | from Soft Power Down mode to Normal mode, as controlled by register 195
> > | (0xC3) bits [1:0]. When exiting Soft Power Down mode, the receiver
> > | blocks may not start up properly, causing the PHY to miss data and
> > | exhibit erratic behavior. The problem may appear on either port 1 or
> > | port 2, or both ports. The problem occurs only for 100BASE-TX, not
> > | 10BASE-T.
> > |
> > | END USER IMPLICATIONS
> > | When the failure occurs, the following symptoms are seen on the affected
> > | port(s):
> > | - The port is able to link
> > | - LED0 blinks, even when there is no traffic
> > | - The MIB counters indicate receive errors (Rx Fragments, Rx Symbol
> > |   Errors, Rx CRC Errors, Rx Alignment Errors)
> > | - Only a small fraction of packets is correctly received and forwarded
> > |   through the switch. Most packets are dropped due to receive errors.
> > |
> > | The failing condition cannot be corrected by the following:
> > | - Removing and reconnecting the cable
> > | - Hardware reset
> > | - Software Reset and PCS Reset bits in register 67 (0x43)
> > |
> > | Work around:
> > | The problem can be corrected by setting and then clearing the Port Power
> > | Down bits (registers 29 (0x1D) and 45 (0x2D), bit 3). This must be done
> > | separately for each affected port after returning from Soft Power Down
> > | Mode to Normal Mode. The following procedure will ensure no further
> > | issues due to this erratum. To enter Soft Power Down Mode, set register
> > | 195 (0xC3), bits [1:0] = 10.
> > |
> > | To exit Soft Power Down Mode, follow these steps:
> > | 1. Set register 195 (0xC3), bits [1:0] = 00 // Exit soft power down mode
> > | 2. Wait 1ms minimum
> > | 3. Set register 29 (0x1D), bit [3] = 1 // Enter PHY port 1 power down mode
> > | 4. Set register 29 (0x1D), bit [3] = 0 // Exit PHY port 1 power down mode
> > | 5. Set register 45 (0x2D), bit [3] = 1 // Enter PHY port 2 power down mode
> > | 6. Set register 45 (0x2D), bit [3] = 0 // Exit PHY port 2 power down mode
> > 
> > This patch implements steps 2...6 of the suggested workaround. During
> > (initial) switch power up, step 1 is executed by the dsa/ksz8795
> > driver's probe function.
> > 
> > Note: In this workaround we toggle the MII_BMCR register's BMCR_PDOWN
> > bit, this is translated to the actual register and bit (as mentioned in
> > the arratum) by the ksz8_r_phy()/ksz8_w_phy() functions.
> 
> s/arratum/erratum/
> 
> Also, the commit message is still missing this piece of information you
> gave in the previous thread:
> 
> | this issue was seen  at some early point of development (back in 2019)
> | reproducible on system start. Where switch was in some default state or
> | on a state configured by the bootloader. I didn't tried to reproduce it
> | now.
> 
> Years from now, some poor souls might struggle to understand why this
> patch was done this way. If it is indeed the case that the issue is only
> seen during the handover between bootloader and kernel, there is really
> no reason to implement the ERR workaround in phy_resume instead of doing
> it once at probe time.

Ok, i'll drop this patch for now.

Regards,
Oleksij
-- 
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

  reply	other threads:[~2021-06-12  4:26 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-11  7:15 [PATCH net-next v4 0/9] provide cable test support for the ksz886x switch Oleksij Rempel
2021-06-11  7:15 ` [PATCH net-next v4 1/9] net: phy: micrel: move phy reg offsets to common header Oleksij Rempel
2021-06-11 19:09   ` Vladimir Oltean
2021-06-11 23:27   ` Florian Fainelli
2021-06-11  7:15 ` [PATCH net-next v4 2/9] net: dsa: microchip: ksz8795: add phylink support Oleksij Rempel
2021-06-11 19:11   ` Vladimir Oltean
2021-06-11 23:28   ` Florian Fainelli
2021-06-11  7:15 ` [PATCH net-next v4 3/9] net: phy: micrel: use consistent alignments Oleksij Rempel
2021-06-11 19:12   ` Vladimir Oltean
2021-06-11 23:28   ` Florian Fainelli
2021-06-11  7:15 ` [PATCH net-next v4 4/9] net: phy: micrel: apply resume errata workaround for ksz8873 and ksz8863 Oleksij Rempel
2021-06-11 19:20   ` Vladimir Oltean
2021-06-12  4:26     ` Oleksij Rempel [this message]
2021-06-12 15:13       ` Vladimir Oltean
2021-06-14  6:55         ` Oleksij Rempel
2021-06-11  7:15 ` [PATCH net-next v4 5/9] net: phy/dsa micrel/ksz886x add MDI-X support Oleksij Rempel
2021-06-12 18:14   ` Andrew Lunn
2021-06-13  2:05   ` Florian Fainelli
2021-06-11  7:15 ` [PATCH net-next v4 6/9] net: phy: micrel: ksz8081 " Oleksij Rempel
2021-06-12 18:14   ` Andrew Lunn
2021-06-13  2:05   ` Florian Fainelli
2021-06-11  7:15 ` [PATCH net-next v4 7/9] net: dsa: microchip: ksz8795: add LINK_MD register support Oleksij Rempel
2021-06-12 18:16   ` Andrew Lunn
2021-06-13  2:09   ` Florian Fainelli
2021-06-11  7:15 ` [PATCH net-next v4 8/9] net: dsa: dsa_slave_phy_connect(): extend phy's flags with port specific phy flags Oleksij Rempel
2021-06-11 19:24   ` Vladimir Oltean
2021-06-11 23:26     ` Florian Fainelli
2021-06-14  3:37       ` Oleksij Rempel
2021-06-14  3:34     ` Oleksij Rempel
2021-06-11  7:15 ` [PATCH net-next v4 9/9] net: phy: micrel: ksz886x/ksz8081: add cabletest support Oleksij Rempel
2021-06-12 18:23   ` Andrew Lunn
2021-06-14  3:51     ` Oleksij Rempel

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210612042639.bgsloltuqoipmwtk@pengutronix.de \
    --to=o.rempel@pengutronix.de \
    --cc=UNGLinuxDriver@microchip.com \
    --cc=andrew@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=f.fainelli@gmail.com \
    --cc=kernel@pengutronix.de \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@armlinux.org.uk \
    --cc=m.grzeschik@pengutronix.de \
    --cc=netdev@vger.kernel.org \
    --cc=olteanv@gmail.com \
    --cc=vivien.didelot@gmail.com \
    --cc=woojung.huh@microchip.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).