From patchwork Wed Nov 29 02:12:07 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christian Marangi X-Patchwork-Id: 171026 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:a5a7:0:b0:403:3b70:6f57 with SMTP id d7csp68279vqn; Tue, 28 Nov 2023 18:12:50 -0800 (PST) X-Google-Smtp-Source: AGHT+IEwrocZ520bU+PKXk51xZAqpX7V1O8i0ouuesZaAnBG3NGm5+NANQ7wiXmphFiWW9RmDaMT X-Received: by 2002:a05:6808:1304:b0:3ae:126b:8c2b with SMTP id y4-20020a056808130400b003ae126b8c2bmr22652790oiv.30.1701223970420; Tue, 28 Nov 2023 18:12:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701223970; cv=none; d=google.com; s=arc-20160816; b=QwdojGe3adqLNjeL6rBG9G0nW0eE6RPLeIQWnk+BSTWc1qHGGXwADJOdmUCSl32TvH ppDKpem357lWcV7Uh73qNASzlsgKnbmw3vXF3d6HoLoo8G63gLwNZpYGT9BV4TaT5RZw pZVjg9g0FZj2QWZd2MteHgp6JZUU5weKFEfIohLjNWNhuOni6J4oVsr4xbPbsErsNB34 IYwTESVEAtS8NMWpv+TWPnHOOO0JdMckGH3e/rTt9ngx2j7fNijyCQfPbqTyPwdNpJwx rk6PNiBBM/12uxX+luKPtqcUqUXGRAcIsAMa/SFNIyy8kSh/edJFVt67z9IaJpzvCFdF aDpA== 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=dt4PyFm7vz4PSs/CMN+Td9iZ3kGYAxZdlYsWr/1duKY=; fh=M/Mg9TtngevyqXgZJCTwFV5p5//1sl9LEorA0JOhC3o=; b=O3oD2yyx4Rbcydj3eN2q+GaC1QHJ/6f8Vl4zWE6wu69ZG2tkYxQYl8q9J3uc9Fv5Yx eqmihB1Qr/JVlL4YUixyapbbNzmgRdTQKqkrdk1Pq2rPb9vAon6ksOAQv89SfiVWq+S7 oEkuv+jHxJv1LVUaPiTMxmguVy62qTdUb3hXu6LnNAfRs/5ylji4yldVopUdrBM/TcEB tTfE5tFpAOuIji+ELEsi74vQMCE3Rx1zdCAv8eux4Rtshd6kiJaTKBiu3k6alBlRrX+t 6VRpkbR6co7XK5rOy7jeVSxZ72g3Vif6B8y17W843H049BdHeaxLZI67TX+NMpKUy8HF XlmQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=myTKw3P9; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 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. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id o66-20020a634145000000b005b91a58721esi13292829pga.316.2023.11.28.18.12.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 Nov 2023 18:12:50 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=myTKw3P9; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 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 6C93A80C0376; Tue, 28 Nov 2023 18:12:48 -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 S1376759AbjK2CMa (ORCPT + 99 others); Tue, 28 Nov 2023 21:12:30 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42640 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1376750AbjK2CM0 (ORCPT ); Tue, 28 Nov 2023 21:12:26 -0500 Received: from mail-wm1-x329.google.com (mail-wm1-x329.google.com [IPv6:2a00:1450:4864:20::329]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7E10519AE; Tue, 28 Nov 2023 18:12:32 -0800 (PST) Received: by mail-wm1-x329.google.com with SMTP id 5b1f17b1804b1-40b397793aaso2298335e9.0; Tue, 28 Nov 2023 18:12:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1701223951; x=1701828751; 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=dt4PyFm7vz4PSs/CMN+Td9iZ3kGYAxZdlYsWr/1duKY=; b=myTKw3P9yLweJySHRcUsNdISUyaqcUFm1Wws7m20QUkiQ67XLXjysYKARUkRACMtpj WcUO+2FM/2e2IHfZQIM9WnHz2IJKBXX9Oh1CDTIg2cFJH77Y1pqV+oDl3ArdAeJjEilp 4tTsoQ7mQtWUqJXK99lQNdjDWbgwmzLjKlTpmEHxU7x9SkXwotkFixkJN4Bo6ushriAt DLTI1X79kut7M4L6qbBBjbjbHrSHAkq13BPK15VnxxZykIwz/XdkMawiLgdZTA/Kzrq3 DqRDyfGuNdbzaZY+TrWEvSbVxxPt1dNBq97g8yGWJjg9egsBR5szThkbn4hJq2Vpww0i 1+0A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701223951; x=1701828751; 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=dt4PyFm7vz4PSs/CMN+Td9iZ3kGYAxZdlYsWr/1duKY=; b=lA+QNNWri/QblZ8Cb7nwcEjjJCgL0Tte9AyTsawWSgAPp3dUvt50X/yV5oTC4CxK2D 2s7wMZQcnlYSxIvb82Z6S96rxaFYJuFqRTO9OYcqhj9toCq09KkkjUSfKtjStonQPyvs tXiLJX7/1/Rs5bVBNuy7DcaxCRidHE3m6in3Mxb0uWjZtFKqNODF5jCywRSmV6hj8jVD RnkV1Rmr8zQ7n2RNQc5D4fEQbKWfLwhKDT2+PijTijfvgKH2bwu4ZEcb3Eaiwtl+UwID REZHPTlmFhZis20V197ccpVbY9yMaHjhgwQ0MXDh30qO8PGrmhuot7iPl0G3ReS6ETNa d0dQ== X-Gm-Message-State: AOJu0Ywg7cmopcYjE++CqJfIQixOeyMBJQfG1qkVpPEkeLZdZSqSTQ11 oT/tDw3AGYkU57oSYxQ/M0sY4/uSOUI= X-Received: by 2002:a05:600c:1d08:b0:40b:2a62:a2b6 with SMTP id l8-20020a05600c1d0800b0040b2a62a2b6mr14429504wms.1.1701223950657; Tue, 28 Nov 2023 18:12:30 -0800 (PST) Received: from localhost.localdomain (93-34-89-13.ip49.fastwebnet.it. [93.34.89.13]) by smtp.googlemail.com with ESMTPSA id b19-20020a05600c4e1300b0040648217f4fsm321406wmq.39.2023.11.28.18.12.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 Nov 2023 18:12:30 -0800 (PST) From: Christian Marangi To: Andrew Lunn , Heiner Kallweit , Russell King , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Andy Gross , Bjorn Andersson , Konrad Dybcio , linux-kernel@vger.kernel.org, netdev@vger.kernel.org, linux-arm-msm@vger.kernel.org Cc: Christian Marangi Subject: [net-next PATCH 02/14] net: phy: at803x: move disable WOL for 8031 from probe to config Date: Wed, 29 Nov 2023 03:12:07 +0100 Message-Id: <20231129021219.20914-3-ansuelsmth@gmail.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20231129021219.20914-1-ansuelsmth@gmail.com> References: <20231129021219.20914-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_BLOCKED,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]); Tue, 28 Nov 2023 18:12:48 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1783862626116931458 X-GMAIL-MSGID: 1783862626116931458 Probe should be used only for DT parsing and allocate required priv, it shouldn't touch regs, there is config_init for that. Move the WOL disable call from probe to config_init to follow this rule and keep code tidy. No behaviour is done as the mode was disabled only if phy_read succeeded in probe and this is translated as the first action done in config_init (called only if probe returns 0) Signed-off-by: Christian Marangi --- drivers/net/phy/at803x.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/drivers/net/phy/at803x.c b/drivers/net/phy/at803x.c index ef203b0807e5..b32ff82240dc 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; @@ -1008,6 +999,15 @@ static int at803x_config_init(struct phy_device *phydev) int ret; if (phydev->drv->phy_id == ATH8031_PHY_ID) { + /* 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; + /* Some bootloaders leave the fiber page selected. * Switch to the appropriate page (fiber or copper), as otherwise we * read the PHY capabilities from the wrong page.