Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp478315ybb; Fri, 3 Apr 2020 06:27:45 -0700 (PDT) X-Google-Smtp-Source: APiQypIF+HNbAetEun7zuANjKdRby1G8Z4HFMGMyz0amqQZGNter0l5PMDw0UbD5XPYmU9W3kwNu X-Received: by 2002:aca:891:: with SMTP id 139mr2939993oii.137.1585920465634; Fri, 03 Apr 2020 06:27:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585920465; cv=none; d=google.com; s=arc-20160816; b=zpc6eruxPLReOmDX6JwCWazV62ZY7bNBfCn0HF1ouq84cknnuYedPa9RUUdiS45fZe xVVeCFXOdJAJxetvjsQGDqH3IWmBe1sfgSbAGcqwKfLvp8duYDKYCJSosrNCmHjcubrw PP358cP867+VLeOy9CE0hQeZUYpiK59uuNL8O70bix16IsAmu3YCwTM/PxRi5Juz0fIU aUywiIzkVATF1DaKgAvnpNdjBl9+fXhNiN5s+NenTLBGEqFjkjEH+aMNBq2LPdiRkT8D SOw98fddDlyJuZy2c2d4cKYp9l6lAs3S7FgDlTZIaE1N5RQw/EFgG+hS28nXDyPQKMTl Ubwg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=kfWSDIagbtyE24zBzSd4Wi6BEjjkOuCZzFGWsd96K8M=; b=a8OxnlKLCh5oXuYIlxiM+SvV/qarwG+FbGXNF7IEeSVFCcc96YWXWaNgqNwNkGfvln lQdRKAcPpKOxRWAaUtn8/5wYJO68DN89l1aQBblUBh6eRTD49sXrBO5g5oXbZPB9RmAK ZYS8Sz9jTkpm8X5G2Hu9kt/g4hS63sRMglbq7Vz34gi+hyKBpP9Sof5F2CQiGzvvN7ve d3s6xxF2joC/LyMJiwxvn7zkfCBwc1503rcvvhzPACKxSBhQ9VeOwY6KnRgQbPxmR3Sz qrbTC5JrkKqtob5RdBIsrC+rMzNll6vAZ9rGC8Fi0qzIIvcISh2c7yaXRDpIn3bdxhUI NNOg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@lunn.ch header.s=20171124 header.b=tpibQXHx; 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 h26si466473otg.145.2020.04.03.06.27.32; Fri, 03 Apr 2020 06:27:45 -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; dkim=fail header.i=@lunn.ch header.s=20171124 header.b=tpibQXHx; 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 S2390803AbgDCNGB (ORCPT + 99 others); Fri, 3 Apr 2020 09:06:01 -0400 Received: from vps0.lunn.ch ([185.16.172.187]:46482 "EHLO vps0.lunn.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727998AbgDCNGA (ORCPT ); Fri, 3 Apr 2020 09:06:00 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lunn.ch; s=20171124; h=In-Reply-To:Content-Type:MIME-Version:References:Message-ID: Subject:Cc:To:From:Date:Sender:Reply-To:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=kfWSDIagbtyE24zBzSd4Wi6BEjjkOuCZzFGWsd96K8M=; b=tpibQXHxHXhTwILqRgiYnGoWXY 2I8M/hc36uFRuM61QLxUpnpYQRMdQIVg7x9+UdgzNxr2JJEIENJc3Irs3UWdHWHi4eZ9dOxsEhv9E j92HXm26NX6dQNEra4C0t9c7x6JbLbl58ldc7Cq2ouUZiIJEXnCxRF+CLyO6Y973Hca8=; Received: from andrew by vps0.lunn.ch with local (Exim 4.93) (envelope-from ) id 1jKM16-000naW-ON; Fri, 03 Apr 2020 15:05:48 +0200 Date: Fri, 3 Apr 2020 15:05:48 +0200 From: Andrew Lunn To: Oleksij Rempel Cc: Florian Fainelli , Heiner Kallweit , David Jander , "David S. Miller" , kernel@pengutronix.de, linux-kernel@vger.kernel.org, netdev@vger.kernel.org, Philippe Schenker , Russell King Subject: Re: [PATCH v1] net: phy: micrel: kszphy_resume(): add delay after genphy_resume() before accessing PHY registers Message-ID: <20200403130548.GD114745@lunn.ch> References: <20200403075325.10205-1-o.rempel@pengutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200403075325.10205-1-o.rempel@pengutronix.de> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Apr 03, 2020 at 09:53:25AM +0200, Oleksij Rempel wrote: > 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 Hi Oleksij Please in future set the subject to [PATCH net v1] to indicate this is a fix. Reviewed-by: Andrew Lunn Andrew