Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp2051328iog; Sun, 26 Jun 2022 05:33:04 -0700 (PDT) X-Google-Smtp-Source: AGRyM1swvJHaxCDsP8/+bQtjlXv0GfjkCRFyGNl3TW/e6PqfEffsy+IIyRBXgaKYrjtWZxWtSMsf X-Received: by 2002:a05:6402:1e95:b0:42a:c466:52ad with SMTP id f21-20020a0564021e9500b0042ac46652admr10958604edf.340.1656246784455; Sun, 26 Jun 2022 05:33:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1656246784; cv=none; d=google.com; s=arc-20160816; b=v5i21SI663grQ7pZ7jmCxZHMGYwaI/JJoOXbazIRweUpUIV5nGKIuWthGJg4R+Xra7 D4XyXhDbNzUSh380VajRn3xaF/fFAJkb0UppTcsZ9U83B05vSXNg3uXHosNChTcew6OL JNFrSvdhvrk+nr+6g8pemMnkP8lW56GGzJ42g+hetjlb+DWhQHkaE6MbcXwc8MphMKBn M605xso9v2uw8BUtj9s+Ajw47gO4nq2OMGl7QBunet//avsJYv5CtCi8+fWLTHpji346 q3BduALM6W2a5HaZMXu1+GHYHyOvt90chrzgarxsr+gy2l5kfyNGtMAM+zY72RHOJxql Ef+Q== 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=75aTd0Ev/Z630ThOOZrk2WxvAWB24ozE61wj8DwQHlU=; b=qn43sZUUo4UTHDBbm3Bkdu/zLpFkkA3xJFbhGs7StTRuLHbYo2FtchGwkd/CvbYy2s 0RphMCpHxYNGP4L4tWsyeOn+n1NgHlbgkVmoq3X+5SeQvwJoizgH/57UaWk9g9DNElIe 6AUooc1nOE7lan2K/KVBmxYoMAEupqLsPBg7Pnhn3rKrni2J0koUOGiYSyvXxv+TsADM VG/UKyg9081vbsVDNoE4Hug3SB4b5rPoxlLtNSZuzh8BpYScDHWtOYrMtsiSN4AIlprg LiYWbyixYOA9f3HtJEIDBTABoxtjw5ZMeUb82JRyH0t5UIaVyBz4EveZ2iITR67vFV5E +9rg== ARC-Authentication-Results: i=1; mx.google.com; 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 g10-20020a056402090a00b0042ac9b0221fsi10950795edz.241.2022.06.26.05.32.30; Sun, 26 Jun 2022 05:33:04 -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; 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 S234175AbiFZMP7 (ORCPT + 99 others); Sun, 26 Jun 2022 08:15:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51506 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229847AbiFZMP5 (ORCPT ); Sun, 26 Jun 2022 08:15:57 -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 B93D6D125 for ; Sun, 26 Jun 2022 05:15:55 -0700 (PDT) Received: from ptx.hi.pengutronix.de ([2001:67c:670:100:1d::c0]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1o5RBA-0001zF-AI; Sun, 26 Jun 2022 14:15:52 +0200 Received: from ore by ptx.hi.pengutronix.de with local (Exim 4.92) (envelope-from ) id 1o5RB7-0001wE-II; Sun, 26 Jun 2022 14:15:49 +0200 Date: Sun, 26 Jun 2022 14:15:49 +0200 From: Oleksij Rempel To: Andrew Lunn Cc: Lukas Wunner , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Eric Dumazet , kernel@pengutronix.de, Jakub Kicinski , Paolo Abeni , "David S. Miller" Subject: Re: [PATCH net-next v1 1/1] net: phy: ax88772a: fix lost pause advertisement configuration Message-ID: <20220626121549.GA8725@pengutronix.de> References: <20220624075558.3141464-1-o.rempel@pengutronix.de> <20220625071731.GA3462@wunner.de> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: X-Sent-From: Pengutronix Hildesheim X-URL: http://www.pengutronix.de/ X-Accept-Language: de,en X-Accept-Content-Type: text/plain User-Agent: Mutt/1.10.1 (2018-07-13) X-SA-Exim-Connect-IP: 2001:67c:670:100:1d::c0 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 X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,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 Sun, Jun 26, 2022 at 10:58:24AM +0200, Andrew Lunn wrote: > 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); > Hm, this is not enough to restore/reconfigure advertisement register. Should I change PHY state to UP and trigger the state machine? 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 |