Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp997969ybb; Fri, 3 Apr 2020 16:05:41 -0700 (PDT) X-Google-Smtp-Source: APiQypKonj99MmUn1ho5MSaB9PuyY+saX2NdnccOIOilObSJeU6GeSkuapQtH+jvuTvL5CPwKNnp X-Received: by 2002:aca:ec49:: with SMTP id k70mr5058037oih.80.1585955141050; Fri, 03 Apr 2020 16:05:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585955141; cv=none; d=google.com; s=arc-20160816; b=DBKWV9AuH10l8ErbIdOm7ry/uYLP61HOq6N4inPMjn9pvTHK/MDgt2TcpXeTbesa7s 6VylqvEASspfvX8OBOp/funI+dBoUzqd7emz9GMnwgKz7X4kKlw2sLeKsirVdl+d+s4T 3K3wWVlYGOIO2hj73CWZoDqK0A+FWPdXl9+Bvsj6H7yEG8oEHwp79nOaRfyOvHARq3SZ yfIv4AYpFlfU7HR620Zk4tn5F8rTkHpmnlzXDZt+D4jGJGGy3KjKHl9XZhkPdC+I+TRF GMXx44gyN9nOe3HBo2syqoaUhjJE4DC5lgHSpAKAR4WBy9q/xbf5OsBfNCBBWhAsK4nG qOjg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:from:subject:cc:to:message-id:date; bh=VhPZS96m4C2QykyfbDnNJqK4KE5HqVlVfpiWn9mjE0g=; b=Mv7NSlantCHZzr4NNGionDnXXVbCwvZXiEQM1xUNQpDhQkxkM/CBMk5Z8U6iKpKQ94 JJoKIlnMrr30czpupWtLDIBmn6gUQ3JXVTWvBakrA++PvhnLDsMBJ8P/ijIe+STizRq1 LVfKFBIKCB6HlH4lSLO2khKMxV/Ibkhdfo5pOV3SVrZiLHPzmy7jD+C9adB+TexZFFQv 05yFWp6pElF6trabWfme+Fbbz1MJN27qpIr7D1FLrU7fcrO1eM1BctpxzuUpdgVhf658 uD0WbELV+LK4D8srH+NBzYUz9XCQNlSMTcpmPQzCtBGRjeBb7D5/FQ6zsMdTW4gJ7rLX EBQg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q15si4484279otm.212.2020.04.03.16.05.27; Fri, 03 Apr 2020 16:05:41 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728375AbgDCXFK (ORCPT + 99 others); Fri, 3 Apr 2020 19:05:10 -0400 Received: from shards.monkeyblade.net ([23.128.96.9]:36336 "EHLO shards.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727829AbgDCXFJ (ORCPT ); Fri, 3 Apr 2020 19:05:09 -0400 Received: from localhost (unknown [IPv6:2601:601:9f00:477::3d5]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) (Authenticated sender: davem-davemloft) by shards.monkeyblade.net (Postfix) with ESMTPSA id B547B121938E3; Fri, 3 Apr 2020 16:05:08 -0700 (PDT) Date: Fri, 03 Apr 2020 16:05:07 -0700 (PDT) Message-Id: <20200403.160507.1105430274883121139.davem@davemloft.net> To: o.rempel@pengutronix.de Cc: andrew@lunn.ch, f.fainelli@gmail.com, hkallweit1@gmail.com, david@protonic.nl, kernel@pengutronix.de, linux-kernel@vger.kernel.org, netdev@vger.kernel.org, philippe.schenker@toradex.com, linux@armlinux.org.uk Subject: Re: [PATCH v1] net: phy: micrel: kszphy_resume(): add delay after genphy_resume() before accessing PHY registers From: David Miller In-Reply-To: <20200403075325.10205-1-o.rempel@pengutronix.de> References: <20200403075325.10205-1-o.rempel@pengutronix.de> X-Mailer: Mew version 6.8 on Emacs 26.1 Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.5.12 (shards.monkeyblade.net [149.20.54.216]); Fri, 03 Apr 2020 16:05:09 -0700 (PDT) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Oleksij Rempel Date: Fri, 3 Apr 2020 09:53:25 +0200 > After the power-down bit is cleared, the chip internally triggers a > global reset. According to the KSZ9031 documentation, we have to wait at > least 1ms for the reset to finish. > > If the chip is accessed during reset, read will return 0xffff, while > write will be ignored. Depending on the system performance and MDIO bus > speed, we may or may not run in to this issue. > > This bug was discovered on an iMX6QP system with KSZ9031 PHY and > attached PHY interrupt line. If IRQ was used, the link status update was > lost. In polling mode, the link status update was always correct. > > The investigation showed, that during a read-modify-write access, the > read returned 0xffff (while the chip was still in reset) and > corresponding write hit the chip _after_ reset and triggered (due to the > 0xffff) another reset in an undocumented bit (register 0x1f, bit 1), > resulting in the next write being lost due to the new reset cycle. > > This patch fixes the issue by adding a 1...2 ms sleep after the > genphy_resume(). > > Fixes: 836384d2501d ("net: phy: micrel: Add specific suspend") > Signed-off-by: Oleksij Rempel Applied and queued up for -stable, thank you.