Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp1098438pxj; Fri, 11 Jun 2021 21:30:13 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwVugXCv6+POZs0QEQ5Z+IepirsegGaH41orw+2pQhkgRbi0c0csdES0HkeYVRr3BPY1XS+ X-Received: by 2002:a17:906:1790:: with SMTP id t16mr6380251eje.203.1623472213729; Fri, 11 Jun 2021 21:30:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1623472213; cv=none; d=google.com; s=arc-20160816; b=NtMrDsOPBvYu7WLA8r04jG3sBcC2xJq8TBIP3FMc4rNaVpRaGkJT09kZsNfodAiPQq /pzyrvFcN/hdFabRde4RU8bKrq2XOC3fqkLW+SRv+CqotOMmDMuJvpHbUeF/U0ivuljc rij/LlmzFMpOEF8aZBCJeIdFC96pqY9YqZn7Cm1dJdSEXA5NompadsR2P/lF2Csg19fZ DfeYzR4R0m5rL934/ZAI0rgvLHLzJPK+97Q4qRTLxpnSoouwYCh2XzA2m2+yKyAe93NJ f6PBt1ARKigeTulJHythIx5UG9XtNsAa2rd23QnPHo+DvihzKye8Kv1O2Rgvq/PD59Ez ZNzA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=VQt3M5bVSI9m1Qw2sXfaBqRYse+YjGT1sO9MgAPeT2k=; b=nCbOb0eTQC6CO6WZLmMrimt/YVMZZPRiggfqbdnYehVQ6al/4DMzpcqZB/PIzfw8Ks LECbmb1leBCMeu04Kh8nh2+6k3R3jxgHzf0eMYCD9nHUHe+pLdsa0vJXWQZTmvpOb+Hy vQUvoIS4t1EWQAgdH1zdoFK6WEoC+IxIcjcWw4uJ49za3N4B6XnMQCpVGS1EZcMUDKQ5 bvCmraCBwYa30LG3zQV9qSnlnk8PmkdOaGZkSmZNJlJ2Yh2kLeZg/dQPMnCX/9ROfYRN VL2yGglM63Ei9pbB8z+D4sn/vODc0FBpUZMSMWn70D62bdYpWYWssYjPQHa1F/tem79u nIRg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id v13si7808018edl.474.2021.06.11.21.29.50; Fri, 11 Jun 2021 21:30:13 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230040AbhFLE2t (ORCPT + 99 others); Sat, 12 Jun 2021 00:28:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40048 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229446AbhFLE2s (ORCPT ); Sat, 12 Jun 2021 00:28:48 -0400 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 15E02C061574 for ; Fri, 11 Jun 2021 21:26:49 -0700 (PDT) Received: from pty.hi.pengutronix.de ([2001:67c:670:100:1d::c5]) by metis.ext.pengutronix.de with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lrvEH-0008IN-Uw; Sat, 12 Jun 2021 06:26:41 +0200 Received: from ore by pty.hi.pengutronix.de with local (Exim 4.89) (envelope-from ) id 1lrvEF-0002Aj-Hc; Sat, 12 Jun 2021 06:26:39 +0200 Date: Sat, 12 Jun 2021 06:26:39 +0200 From: Oleksij Rempel To: Vladimir Oltean Cc: Woojung Huh , Andrew Lunn , Florian Fainelli , Russell King , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Vivien Didelot , Michael Grzeschik , kernel@pengutronix.de, Jakub Kicinski , UNGLinuxDriver@microchip.com, "David S. Miller" Subject: Re: [PATCH net-next v4 4/9] net: phy: micrel: apply resume errata workaround for ksz8873 and ksz8863 Message-ID: <20210612042639.bgsloltuqoipmwtk@pengutronix.de> References: <20210611071527.9333-1-o.rempel@pengutronix.de> <20210611071527.9333-5-o.rempel@pengutronix.de> <20210611192010.ptmblzpj6ilt24ly@skbuf> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20210611192010.ptmblzpj6ilt24ly@skbuf> X-Sent-From: Pengutronix Hildesheim X-URL: http://www.pengutronix.de/ X-IRC: #ptxdist @freenode X-Accept-Language: de,en X-Accept-Content-Type: text/plain X-Uptime: 06:26:05 up 191 days, 18:32, 38 users, load average: 0.17, 0.10, 0.02 User-Agent: NeoMutt/20170113 (1.7.2) X-SA-Exim-Connect-IP: 2001:67c:670:100:1d::c5 X-SA-Exim-Mail-From: ore@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-kernel@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 |