Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp1098302iog; Sat, 25 Jun 2022 00:28:38 -0700 (PDT) X-Google-Smtp-Source: AGRyM1ur2a071yedodUrxokhnH6U6PsGVBtTynsQPMZv0k1C1Z5n2wsiuVaUQxSWUBdnw9dmVlJl X-Received: by 2002:a05:6402:4496:b0:435:d605:6ff8 with SMTP id er22-20020a056402449600b00435d6056ff8mr3486875edb.357.1656142118037; Sat, 25 Jun 2022 00:28:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1656142118; cv=none; d=google.com; s=arc-20160816; b=l1UweSPAXood53NdcxkhzTSeDDL9CnHPdqQukMiVpeG+mU1K3cBlTjVkro4sEGwC3u u6o7iA09dCzVtB4dTWWY1WsU1Ystg8Gl/5cz4OHKs9gdpx/HI+RQvpknfwWUwG1aUArL qwyy6dQaj1xRzhnFvl3KMrZjJJJKrgodbfxTYK93/9jLmXGrkX/y4L7JQjHKlzLbalar gHsq+GsaZJu0u9Hogu1C/UorIBh3xm5iuCWmDNSAVobl8CSU4hDc8/rf1/VfT0MuC1vg 64fUVSCC7luD+zeqyGH0wP4aVUNWKe2keq4MfUY4G6cxIX6I1vdhzkL1HkPQqGwSUZG9 ovPA== 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=UWgyuQvK7Xc0zX0+1/Xt8AMFlqPi0NVdLZgbz9oKV5Q=; b=pKoVnkECUlKTDCAYc+3lezjZuJlCc6xwSLynleO4cr1fmGVyL5ZLB5wUiah7CyKrye NHv7WPAK3Hvo0hEjtBrdRSb9I+UJ1gCkceqlGLuDqWx4u5+wpGGcQuMeDAFCXUJxtNHa RUlJb6penm67HHuX7qzb7x15f4ne9LePJFQ6iFLUneufO4ic/H/kqkWWJ5NIhP46++C+ 1wzG5vYsz3GTsyjdiyiG6sJkf7s1LanZfqKmaImbvIY4jx+v52VeGdPzsO2vIhUl2Hyt xZB+Oa9TietgfkmysJYrZ4K0i3uqX1x1b3JDRWI2Bpn9QhwbIfpEyEk91s3t8BihMnSt jFIQ== 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 f20-20020a0564021e9400b00435712ee0e5si6765526edf.629.2022.06.25.00.28.13; Sat, 25 Jun 2022 00:28:38 -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 S232128AbiFYHRj (ORCPT + 99 others); Sat, 25 Jun 2022 03:17:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39512 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231527AbiFYHRh (ORCPT ); Sat, 25 Jun 2022 03:17:37 -0400 Received: from bmailout3.hostsharing.net (bmailout3.hostsharing.net [IPv6:2a01:4f8:150:2161:1:b009:f23e:0]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A8FBC31DE3; Sat, 25 Jun 2022 00:17:35 -0700 (PDT) Received: from h08.hostsharing.net (h08.hostsharing.net [IPv6:2a01:37:1000::53df:5f1c:0]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "*.hostsharing.net", Issuer "RapidSSL TLS DV RSA Mixed SHA256 2020 CA-1" (verified OK)) by bmailout3.hostsharing.net (Postfix) with ESMTPS id 2BA4B100D9407; Sat, 25 Jun 2022 09:17:32 +0200 (CEST) Received: by h08.hostsharing.net (Postfix, from userid 100393) id 05825132D7A; Sat, 25 Jun 2022 09:17:32 +0200 (CEST) Date: Sat, 25 Jun 2022 09:17:31 +0200 From: Lukas Wunner To: Oleksij Rempel Cc: "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: <20220625071731.GA3462@wunner.de> References: <20220624075558.3141464-1-o.rempel@pengutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220624075558.3141464-1-o.rempel@pengutronix.de> User-Agent: Mutt/1.10.1 (2018-07-13) X-Spam-Status: No, score=-2.4 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,RCVD_IN_DNSWL_LOW,SPF_HELO_NONE,SPF_NONE, 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 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? Thanks, Lukas