From patchwork Fri Dec 1 00:14:12 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christian Marangi X-Patchwork-Id: 172180 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:bcd1:0:b0:403:3b70:6f57 with SMTP id r17csp775873vqy; Thu, 30 Nov 2023 16:15:05 -0800 (PST) X-Google-Smtp-Source: AGHT+IETrR1dnlNPw9IomubWqTpf6X8xwiqLjnsaip8s79KZg7N5s2lr0l8wmH3OKV+T+vwyABvD X-Received: by 2002:a17:902:e80d:b0:1cf:b56f:5359 with SMTP id u13-20020a170902e80d00b001cfb56f5359mr20881771plg.16.1701389705227; Thu, 30 Nov 2023 16:15:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701389705; cv=none; d=google.com; s=arc-20160816; b=S1ohS8XtXbPPsf29y9wGx1R4uPzWe0KwqPHDZfqbO+HA5fCoa50L/LHEyCndCyKQsn fiy7RsgBpwb4mnfiOPLDSutOuofxrZ/hU6YUhwSai3F6Mohm6VON8iB+w/aLogtBM6bm 65njR1LOfrP3Jy8YwVKvmrX8GFRLMBYQseQLtJ94jaKkWNON3oRUgSCS898QSXnzplMN CBjZhPjDytL4wbrtn5duQtsp7XUdbxQyOWdKsZXGo7jbruN3phNP2bG3mTVaB3OtqHaf gmb1C0RhJcIOwjt2jpWrdhR4VsDYx6yvge4E+/V1EQ0+1Ug9E+R+bmqEV69wumg06D1/ fvUA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=4S8WGKa0/D4CAm9y6YGXWUP7HyKdLd55ppGa7UA6g6A=; fh=utmrxdkgikAlLxVfQI1kldUG+rNjhrLN+3fAlOYj01s=; b=zkmGC9j5WMk//fC5p6aUgW2358nQhVXM8bQSKklbHrgF/KJhZagOfZRR3LrLJGUrH2 zymzfrZgA6BU98euGbh9dZTzt4goJSYknD3iwNlf9IJNUqgS/6DCvfFxz2YPqvn9kvhO pX/VCjpE3KrHI+4GB9aIt/w6Pc+Tu5wSFqSReDHom8tJ77YNwx4mr8AueHwDehyE8AlC 8BB3unxRKcs6NpNmAJJXeyxinKdkIXQRyWVPrCZW4gn1rodv4St6ydVKg4Cg3DzrCw29 i/0RHIbjVC5q8l0LPkn1TBQ7k1RDxHJ5in0iYfkcaOPQZIMecbFSkpDGVjzues0QN/XQ oX1A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=EKEHcGR6; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id p22-20020a170902b09600b001d00ff4bf6csi2089435plr.466.2023.11.30.16.15.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 Nov 2023 16:15:05 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) client-ip=23.128.96.37; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=EKEHcGR6; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id AD00D805DC31; Thu, 30 Nov 2023 16:15:03 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1377406AbjLAAOs (ORCPT + 99 others); Thu, 30 Nov 2023 19:14:48 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52228 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1377397AbjLAAOq (ORCPT ); Thu, 30 Nov 2023 19:14:46 -0500 Received: from mail-wm1-x32e.google.com (mail-wm1-x32e.google.com [IPv6:2a00:1450:4864:20::32e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B9AAF197; Thu, 30 Nov 2023 16:14:52 -0800 (PST) Received: by mail-wm1-x32e.google.com with SMTP id 5b1f17b1804b1-40b4f6006d5so14732935e9.1; Thu, 30 Nov 2023 16:14:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1701389691; x=1701994491; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=4S8WGKa0/D4CAm9y6YGXWUP7HyKdLd55ppGa7UA6g6A=; b=EKEHcGR6/nE0E41Kr0tfotrGUkcpewpralAzjadCewrbWBHTTQLz4GaMnuSq3ZdLx6 zC/gQ52sYhSi+Ehyt41vAoV6ai13smD5WOFqII2BYTgaMjsCsB4tkO7EoIXIPQLLijiU b7tZU3IFekrp7an8AlY5W4ATDX7j86Ls7GRyf0G0A1SfXYkXG1mVhgj5JhDPpbe8SsbD 9VJCCqMd8Q4SnbcEexeHA9KbNnr0dQJHZgd/3YUzwVRvlzNchtvmHUNDuavtWsAy+z5c pep+Owqek9SE1K3jPhBwb5TPWm3cH1DT15mTxLEGMrvI/IIRG/oLcLF9BeNLO3BfL6TA dOgg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701389691; x=1701994491; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=4S8WGKa0/D4CAm9y6YGXWUP7HyKdLd55ppGa7UA6g6A=; b=ukknrkaa5e6Sx8Goqy0UlVpn2lD8rJSgdCsh1iUc/SRnfK1nSLzpGjPN22xHQzly88 eZsrf0ArPKcu+vDyzMtDE6YkbiRp0fzzFIpue6CluSDQEUnoMqyom/FGhBTLo5rLUr6K efzz5QKW7F1HjiCBiUlwGlDJkJ58HMPskkprfXr1awQirjQWDaoike3dESR9z3KyQgEr G7mR8oeueMUXmOs1eruQ1e2H0KoeZMNlmeKgV80vugi9Fqk9I7chAQUv2THA7XriDo9r /5LXmKTnhsZASW0RAxekL3t9P+Ey5if4wFGkagcumJ1xvT6pDFn1ANmcujkH/Bd+yVkJ ZxGQ== X-Gm-Message-State: AOJu0YyeOINgdtWvNRHGkas/qAVcHwBwum3PBGzqD2GedJlOfkbY/PSO riTbF8tDCiH8GmTVvSi9aB0= X-Received: by 2002:a05:600c:524d:b0:40b:473d:6b82 with SMTP id fc13-20020a05600c524d00b0040b473d6b82mr110234wmb.12.1701389690879; Thu, 30 Nov 2023 16:14:50 -0800 (PST) Received: from localhost.localdomain (93-34-89-13.ip49.fastwebnet.it. [93.34.89.13]) by smtp.googlemail.com with ESMTPSA id g16-20020a05600c4ed000b0040b47c53610sm3535457wmq.14.2023.11.30.16.14.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 Nov 2023 16:14:50 -0800 (PST) From: Christian Marangi To: Andrew Lunn , Heiner Kallweit , Russell King , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , netdev@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Christian Marangi Subject: [net-next PATCH v2 02/12] net: phy: at803x: move disable WOL to specific at8031 probe Date: Fri, 1 Dec 2023 01:14:12 +0100 Message-Id: <20231201001423.20989-3-ansuelsmth@gmail.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20231201001423.20989-1-ansuelsmth@gmail.com> References: <20231201001423.20989-1-ansuelsmth@gmail.com> MIME-Version: 1.0 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,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 X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Thu, 30 Nov 2023 16:15:03 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1784036411394961105 X-GMAIL-MSGID: 1784036411394961105 Move the WOL disable call to specific at8031 probe to make at803x_probe more generic and drop extra check for PHY ID. Keep the same previous behaviour by first calling at803x_probe and then disabling WOL. Signed-off-by: Christian Marangi Reviewed-by: Andrew Lunn --- drivers/net/phy/at803x.c | 29 +++++++++++++++++++---------- 1 file changed, 19 insertions(+), 10 deletions(-) diff --git a/drivers/net/phy/at803x.c b/drivers/net/phy/at803x.c index ef203b0807e5..85302d96d133 100644 --- a/drivers/net/phy/at803x.c +++ b/drivers/net/phy/at803x.c @@ -886,15 +886,6 @@ static int at803x_probe(struct phy_device *phydev) priv->is_fiber = true; break; } - - /* Disable WoL in 1588 register which is enabled - * by default - */ - ret = phy_modify_mmd(phydev, MDIO_MMD_PCS, - AT803X_PHY_MMD3_WOL_CTRL, - AT803X_WOL_EN, 0); - if (ret) - return ret; } return 0; @@ -1591,6 +1582,24 @@ static int at803x_cable_test_start(struct phy_device *phydev) return 0; } +static int at8031_probe(struct phy_device *phydev) +{ + int ret; + + ret = at803x_probe(phydev); + if (ret) + return ret; + + /* Disable WoL in 1588 register which is enabled + * by default + */ + ret = phy_modify_mmd(phydev, MDIO_MMD_PCS, + AT803X_PHY_MMD3_WOL_CTRL, + AT803X_WOL_EN, 0); + + return ret; +} + static int qca83xx_config_init(struct phy_device *phydev) { u8 switch_revision; @@ -2092,7 +2101,7 @@ static struct phy_driver at803x_driver[] = { PHY_ID_MATCH_EXACT(ATH8031_PHY_ID), .name = "Qualcomm Atheros AR8031/AR8033", .flags = PHY_POLL_CABLE_TEST, - .probe = at803x_probe, + .probe = at8031_probe, .config_init = at803x_config_init, .config_aneg = at803x_config_aneg, .soft_reset = genphy_soft_reset,