Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.5 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A83BBC47259 for ; Fri, 1 May 2020 22:49:45 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 7D5E9216FD for ; Fri, 1 May 2020 22:49:45 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=lunn.ch header.i=@lunn.ch header.b="UvmrAUNL" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726788AbgEAWtm (ORCPT ); Fri, 1 May 2020 18:49:42 -0400 Received: from vps0.lunn.ch ([185.16.172.187]:37110 "EHLO vps0.lunn.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726045AbgEAWtl (ORCPT ); Fri, 1 May 2020 18:49:41 -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=erqGzmSSH5y0r3VB9jCpr4m0raRhuyy0tc14D0hD6ms=; b=UvmrAUNL5bxjdMqf3T+FIL1U1m cdbfMZWa/RKAUs41S/U4KTlKv96o6cIUkj0GiLURrTDBKbi6K/OJi/YOu0FVWczES/vHiHMWIm7S2 5gJaaD7oQtfsxImM7iAzz+DGUY9COJjZOxfa/09TUq0iUFAojY9j5HwDbxwu9gsp+X28=; Received: from andrew by vps0.lunn.ch with local (Exim 4.93) (envelope-from ) id 1jUeTR-000aVU-VP; Sat, 02 May 2020 00:49:37 +0200 Date: Sat, 2 May 2020 00:49:37 +0200 From: Andrew Lunn To: David Miller Cc: netdev@vger.kernel.org, fugang.duan@nxp.com, cphealy@gmail.com Subject: Re: [PATCH net-next v2] net: ethernet: fec: Prevent MII event after MII_SPEED write Message-ID: <20200501224937.GB136749@lunn.ch> References: <20200429205323.76908-1-andrew@lunn.ch> <20200501.152954.1266270078854134704.davem@davemloft.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200501.152954.1266270078854134704.davem@davemloft.net> Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org On Fri, May 01, 2020 at 03:29:54PM -0700, David Miller wrote: > From: Andrew Lunn > Date: Wed, 29 Apr 2020 22:53:23 +0200 > > > The change to polled IO for MDIO completion assumes that MII events > > are only generated for MDIO transactions. However on some SoCs writing > > to the MII_SPEED register can also trigger an MII event. As a result, > > the next MDIO read has a pending MII event, and immediately reads the > > data registers before it contains useful data. When the read does > > complete, another MII event is posted, which results in the next read > > also going wrong, and the cycle continues. > > > > By writing 0 to the MII_DATA register before writing to the speed > > register, this MII event for the MII_SPEED is suppressed, and polled > > IO works as expected. > > > > v2 - Only infec_enet_mii_init() > > > > Fixes: 29ae6bd1b0d8 ("net: ethernet: fec: Replace interrupt driven MDIO with polled IO") > > Reported-by: Andy Duan > > Suggested-by: Andy Duan > > Signed-off-by: Andrew Lunn > > Hmmm, I reverted the Fixes: tag patch so you'll need to respin this I think. Ah. We wanted the fix reverting, but not that the fix was fixing. Sorry, we were unclear. Andrew