Received: by 2002:a05:7412:419a:b0:f3:1519:9f41 with SMTP id i26csp4491177rdh; Wed, 29 Nov 2023 03:04:30 -0800 (PST) X-Google-Smtp-Source: AGHT+IEY5kZ4iwQun15+5IZhH4YqsBwHddYZLodF02vvcrrpyjg56HlyQvEZmv9TXKi/IX7CJqfT X-Received: by 2002:a05:6a00:2e8b:b0:6cb:4361:773c with SMTP id fd11-20020a056a002e8b00b006cb4361773cmr24431795pfb.5.1701255870180; Wed, 29 Nov 2023 03:04:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701255870; cv=none; d=google.com; s=arc-20160816; b=LMJCT63/mkfzdcU4SZ+etudQB5ItWqfGTThBpnUlec7CqDyK913ktkCeDJFJGsMFn3 DcySEVFndpqGbM/ArOXxGhE8ZB66YmHFx/1OnG84p9NFZ8rcCAgXNcTu+2wP3Ru9eUqp 0QuJ8fP8YvRD2db+lT57dZuqHhK/DBjTSHKMobNuGTU3RexPRlP1ZBxXpUpvF78JGme5 U7edJyCNs7WyQlaFoBRABBNKDDBuriL7JS+KRZPyboWs5HakbTpf/KmqUGPaI8zptgVL 97MnwrtIMCmL7AcICJsqDXg0lrsJJeJ8E+BIvfg08uVCVD73XDPAZXO5zkDfCpHQEMYT 4gFg== 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:subject:cc:to:from:date:message-id:dkim-signature; bh=Rjk+/1D9AF+cQ5xDbcmA1MBP/vuhlv65HDhCtKVSoZk=; fh=floi/2IuV1Qum9ifTQSOvf7MUhMRHRs0awnS5YABf+A=; b=wiSE5ZYWHu0DRqzp438dQeL3bBbJpbAl7AewQUCO162WfIf4BEpWe9pvhaRqpFDwbQ UUrmSQJM2fcwqRn6GZ+2Z7U6mcbiTx7dJ1SaJAql3BRh4d0d+tHVXH2Bv5nipfFMnw4y efoR1xSVf8MizRaLEAI24kDqBoikF+YvFNvzNJ8094TlEPFKt6w0R+cboFXoYiwgRF1E KNesk9YfGvk6EF7e2KD4W4Ae8l9Xd5sLBv+ttGHuxr36Pv6eTijSuDvmUkXbLXWnhgs1 9fhWC68XjPrucJDwyXp/gVIvqiN7DibC2d9mzgHTC3z9xNvV40Im3vRQ7NSfJp1ffrk9 GsPQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=PqNEvVpW; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from howler.vger.email (howler.vger.email. [2620:137:e000::3:4]) by mx.google.com with ESMTPS id a19-20020a656553000000b005be1ee5b99fsi14326721pgw.526.2023.11.29.03.04.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 29 Nov 2023 03:04:30 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) client-ip=2620:137:e000::3:4; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=PqNEvVpW; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 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 howler.vger.email (Postfix) with ESMTP id 2B818804BB6C; Wed, 29 Nov 2023 03:04:27 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230111AbjK2LEK (ORCPT + 99 others); Wed, 29 Nov 2023 06:04:10 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48820 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230299AbjK2LED (ORCPT ); Wed, 29 Nov 2023 06:04:03 -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 75C2E95; Wed, 29 Nov 2023 03:04:09 -0800 (PST) Received: by mail-wm1-x329.google.com with SMTP id 5b1f17b1804b1-40b4f6006d5so11968395e9.1; Wed, 29 Nov 2023 03:04:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1701255848; x=1701860648; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:subject:cc :to:from:date:message-id:from:to:cc:subject:date:message-id:reply-to; bh=Rjk+/1D9AF+cQ5xDbcmA1MBP/vuhlv65HDhCtKVSoZk=; b=PqNEvVpW911WnIT3JULjB3wgDwpK5ePh+wNSB/GmLnEWH5osYydhpBvsbQ7/Xz5ocH dc1pRYehdHP34IIxLKWnIdSZQvpF5/k9/9LizgWR/vCDrynO0khPxNsOvtB5FavVVXxn QCaav1jar7DjpwuVnqW4zHZJ8QqG6xX3KUvI44aWStupV1hpXK7hXkf78Dnk5hj6qW+u MEX2nw/5mB9MYjLyyeDNaUwzJbdBg1Wa0QkEEEWcy4twANRwlDTCSsr0ugk7MWyIz9dS /96OyLGVbvRQJjYMNhb8v2EaLvkKYAKz914EBjUYoTRdJzmLjQc+YqHpJ81clQWLwUHh 4N3g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701255848; x=1701860648; h=in-reply-to:content-disposition:mime-version:references:subject:cc :to:from:date:message-id:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=Rjk+/1D9AF+cQ5xDbcmA1MBP/vuhlv65HDhCtKVSoZk=; b=CZdtv/P88MJHWt3eFVf4ghsBXNWjcrtDB3gKuTxGh1bWsfb17P0r8/unxqooJGPoJY TxPksoLVzXrVexAqAkAQUerf9odN1TjCHSK9DPv7TwypeWtyhmKDRKq26IQ8ehvdvcp8 vUiTlUL/IAzoizPfeNussjbdWvCOqyWR8jsJJZvSZA6uMsSjRqf8FOr6ViWgLJ5JFfsq +joKQ2ypCoTkhOQalpDvBe2sGPDe3GidY1eArPseQ0BIfcTmVBSoXA+uYJRbFuFJkvsf BrxeqB0QuRfMC7Z2W4UGYP9v3vXt6hYAJb5gcgO11bMUI8uh3UQZu/tKaqvPIV60vgnz e2Iw== X-Gm-Message-State: AOJu0YyNS4pJo5Y2TfDg4Nf78oaqnuhx92Wdl5GAfosgR58LQy6z+IxB fsA2gnWtehnFHDUD/gRqtXg= X-Received: by 2002:a05:600c:5125:b0:40b:3dae:1ff6 with SMTP id o37-20020a05600c512500b0040b3dae1ff6mr8791416wms.14.1701255847651; Wed, 29 Nov 2023 03:04:07 -0800 (PST) Received: from Ansuel-xps. (93-34-89-13.ip49.fastwebnet.it. [93.34.89.13]) by smtp.gmail.com with ESMTPSA id q4-20020adfea04000000b003296b488961sm17464741wrm.31.2023.11.29.03.04.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 29 Nov 2023 03:04:07 -0800 (PST) Message-ID: <65671aa7.df0a0220.2a628.a3b9@mx.google.com> X-Google-Original-Message-ID: Date: Wed, 29 Nov 2023 12:04:04 +0100 From: Christian Marangi To: "Russell King (Oracle)" Cc: Andrew Lunn , Heiner Kallweit , "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 Subject: Re: [net-next PATCH 08/14] net: phy: at803x: drop specific PHY id check from cable test functions References: <20231129021219.20914-1-ansuelsmth@gmail.com> <20231129021219.20914-9-ansuelsmth@gmail.com> <656708a8.df0a0220.28d76.9307@mx.google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-0.6 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on howler.vger.email 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 (howler.vger.email [0.0.0.0]); Wed, 29 Nov 2023 03:04:27 -0800 (PST) On Wed, Nov 29, 2023 at 10:57:28AM +0000, Russell King (Oracle) wrote: > On Wed, Nov 29, 2023 at 10:47:18AM +0100, Christian Marangi wrote: > > On Wed, Nov 29, 2023 at 09:38:39AM +0000, Russell King (Oracle) wrote: > > > On Wed, Nov 29, 2023 at 03:12:13AM +0100, Christian Marangi wrote: > > > > @@ -1310,10 +1302,6 @@ static int at803x_cable_test_start(struct phy_device *phydev) > > > > */ > > > > phy_write(phydev, MII_BMCR, BMCR_ANENABLE); > > > > phy_write(phydev, MII_ADVERTISE, ADVERTISE_CSMA); > > > > - if (phydev->phy_id != ATH9331_PHY_ID && > > > > - phydev->phy_id != ATH8032_PHY_ID && > > > > - phydev->phy_id != QCA9561_PHY_ID) > > > > - phy_write(phydev, MII_CTRL1000, 0); > > > ... > > > > +static int at8031_cable_test_start(struct phy_device *phydev) > > > > +{ > > > > + at803x_cable_test_start(phydev); > > > > + phy_write(phydev, MII_CTRL1000, 0); > > > > > > I don't think this is a safe change - same reasons as given on a > > > previous patch. You can't randomly reorder register writes like this. > > > > > > > Actually for this the order is keeped. Generic function is called and > > for at8031 MII_CTRL1000 is called on top of that. > > Okay, but I don't like it. I would prefer this to be: > > static void at803x_cable_test_autoneg(struct phy_device *phydev) > { > phy_write(phydev, MII_BMCR, BMCR_ANENABLE); > phy_write(phydev, MII_ADVERTISE, ADVERTISE_CSMA); > } > > static int at803x_cable_test_start(struct phy_device *phydev) > { > at803x_cable_test_autoneg(phydev); > return 0; > } > > static int at8031_cable_test_start(struct phy_device *phydev) > { > at803x_cable_test_autoneg(phydev); > phy_write(phydev, MII_CTRL1000, 0); > return 0; > } > > which makes it more explicit what is going on here. Also a comment > above the function stating that it's for AR8031 _and_ AR8035 would > be useful. > Much cleaner thanks for the hint! -- Ansuel