Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp1936583iog; Sun, 26 Jun 2022 02:12:10 -0700 (PDT) X-Google-Smtp-Source: AGRyM1tmwqFG9zZj4Glwvsczf3/3bJmNmHb0oVoR3iqs8D7zwZoidkr72sopNbJs0GvKuaoFDt7o X-Received: by 2002:a17:907:a424:b0:702:f94a:a897 with SMTP id sg36-20020a170907a42400b00702f94aa897mr6985262ejc.255.1656234730380; Sun, 26 Jun 2022 02:12:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1656234730; cv=none; d=google.com; s=arc-20160816; b=1Ex631kc4XrdOkuQK3fRCy4qdUSt7XUOfg0cNMSXU/cjGj6qHo4Nx12HY4zQs0eI0z qekfByC2+uQwAbCzzhw6W3zaG8P3HpbpOwfITWKqTeQuhuvbGgZoj+s0OPXmpdWdtO6c kAysHymFjpUgKjNYDBtiFHZrUikTumPhTO7UDDavox8U0eowD1Zj6AFTSgsth0XrCgXi UZriL7a+06SsIrxwd6tOeQuPkQL71WNVAaHbqr7ybbfrm3C6LQgfnoI3XxFKNFTd9Eze PVGLZfHdXqhxORJv3xU6J6wQdZqV5ELOKoOBMW6hVtQZuPyqBEn62+sdM96Gjzs5OfJC jOSw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=1JKbLmopt0oRqy5yYNNrI21JPFQkbbU7U2hItfpsuus=; b=CE9s3nOJhcYbUhcnwuAnPYssSSTM8wozcuZoygVTuR/NwnwJIYHi35C6cW/DQamLqt 37w+MsPuEWfReNN0Vpo0CGVEVC9nWHXn4u+FQG0tb77Z21g0nsCOoY2NYarD1a/RVM6X tA20BFw8rUL/YbtAIwllMCksQO9/cGXMpumtShvG51LSo42GQOeAes0Tn1xMn1933Rzl WeQ5Lx15+ZHJPe+H6n7O/tx1SQDko6sgALLWs2VFrjWWAugIKHKYqtcvzmChWdYp+i9F DYSlexPxw4/SEuaSRgGDMlUVnnwiUVF0SjmsN3VbVKpXFazYX/6XMUdMp/0MHVSlfAEg yYYQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lunn.ch header.s=20171124 header.b=bJR8iIVx; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id dx26-20020a170906a85a00b007262b0e9e43si1711546ejb.808.2022.06.26.02.11.44; Sun, 26 Jun 2022 02:12:10 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@lunn.ch header.s=20171124 header.b=bJR8iIVx; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234074AbiFZI6s (ORCPT + 99 others); Sun, 26 Jun 2022 04:58:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40746 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229550AbiFZI6q (ORCPT ); Sun, 26 Jun 2022 04:58:46 -0400 Received: from vps0.lunn.ch (vps0.lunn.ch [185.16.172.187]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 14FDAE0F8; Sun, 26 Jun 2022 01:58:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lunn.ch; s=20171124; h=In-Reply-To:Content-Disposition:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:From:Sender:Reply-To:Subject: Date:Message-ID:To:Cc:MIME-Version:Content-Type:Content-Transfer-Encoding: Content-ID:Content-Description:Content-Disposition:In-Reply-To:References; bh=1JKbLmopt0oRqy5yYNNrI21JPFQkbbU7U2hItfpsuus=; b=bJR8iIVxbtaUXB8NG6eDKqiuVa 9xrMJnFB15Amkl8LagOgvijKEaeh9zgoC3mhJBCcBNlf4ZjIxiLGToqMKFmW+xvL1pkeMHdaK4ZL9 tFyONmKeM676Dr4TwnFCvsDVXQw1uEDIbBVkcF76otqwqJWfovuEgAvUbIuI+cyDRGNg=; Received: from andrew by vps0.lunn.ch with local (Exim 4.94.2) (envelope-from ) id 1o5O64-008HQM-Mi; Sun, 26 Jun 2022 10:58:24 +0200 Date: Sun, 26 Jun 2022 10:58:24 +0200 From: Andrew Lunn To: Lukas Wunner Cc: Oleksij Rempel , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , kernel@pengutronix.de, linux-kernel@vger.kernel.org, netdev@vger.kernel.org Subject: Re: [PATCH net-next v1 1/1] net: phy: ax88772a: fix lost pause advertisement configuration Message-ID: References: <20220624075558.3141464-1-o.rempel@pengutronix.de> <20220625071731.GA3462@wunner.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220625071731.GA3462@wunner.de> X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_PASS,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, Jun 25, 2022 at 09:17:31AM +0200, Lukas Wunner wrote: > On Fri, Jun 24, 2022 at 09:55:58AM +0200, Oleksij Rempel wrote: > > In case of asix_ax88772a_link_change_notify() workaround, we run soft > > reset which will automatically clear MII_ADVERTISE configuration. The > > PHYlib framework do not know about changed configuration state of the > > PHY, so we need to save and restore all needed configuration registers. > [...] > > static void asix_ax88772a_link_change_notify(struct phy_device *phydev) > > { > > /* Reset PHY, otherwise MII_LPA will provide outdated information. > > * This issue is reproducible only with some link partner PHYs > > */ > > - if (phydev->state == PHY_NOLINK && phydev->drv->soft_reset) > > + if (phydev->state == PHY_NOLINK && phydev->drv->soft_reset) { > > + struct asix_context context; > > + > > + asix_context_save(phydev, &context); > > + > > phydev->drv->soft_reset(phydev); > > + > > + asix_context_restore(phydev, &context); > > + } > > } > > Hm, how about just calling phy_init_hw()? That will perform a > ->soft_reset() and also restore the configuration, including > interrupts (which the above does not, but I guess that's > irrelevant as long as the driver uses polling). > > Does phy_init_hw() do too much or too little compared to the above > and is hence not a viable solution? at803x.c has: /* After changing the smart speed settings, we need to perform a * software reset, use phy_init_hw() to make sure we set the * reapply any values which might got lost during software reset. */ if (ret == 1) ret = phy_init_hw(phydev); Andrew