Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp2038251rwd; Sun, 21 May 2023 11:32:45 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5Hi6uLT9Pv2MhrdPCdGXbKohXwhYqlE2us41jArWE9+YvN1Ghc8LqvRsvfkvb3W/pKw3HQ X-Received: by 2002:a05:6a00:c96:b0:64a:ff32:7347 with SMTP id a22-20020a056a000c9600b0064aff327347mr11489171pfv.13.1684693965020; Sun, 21 May 2023 11:32:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684693965; cv=none; d=google.com; s=arc-20160816; b=piCaRAQPZP9xznaEbxUC1pL3qM+YQj+/vknAVafLFWu52dM9Hga++FcB5TlkkvVmoi +ElnApz7cKeS/JcagsfkH+6kSg8xi7ikCZLt9o2L6npixYelly16L/XJnb7kLuOKSdKa +6yhpndOQfDK2LnwCrY/+v1E8OHXyLzunKYFwk9n63G7lzFx5pLdpa2VgUGkrpLgrlV3 1W/gv+rXOAnwADP2EZ0+Q7bz0187ppyd2x35QkRDsiHSIAwJudxatI7LlYvBW19R3k4o 48dd25p039RqeiWRtHeBLfDt/z4hFvJLD70lBST+30/H5Tfu4qloPdH30sUo9OVlTJ2s Vk9A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=fM7breEkmpFcu5kMT1h3Tjd0iDA0uSr1msWJ+/s0HS0=; b=Bk7nk4EK/EyZ+HKGppOVt7bM6nnag8j0GRK40NObKkhZ+B+TO3/+iZLQRxuaSsXgAr LsWH+tD2FheEQWlcSdgO00h4H4bsWxwFcu5zSVconO/QClh/NZi6R9vw6KU7xbpJLrTB VLP/WzC9PEO2UTcDzNQ1Ziqvyvvo7rprqkvxaG8iR4TYhG46oPR3bF4mDdav1hLQs0IQ 4lHmLpEtClaACsXWNChjquppclGR0NM5ukWSJcaAzpLcxdiMEAcz/iCrzgHG/igThMQv 84Tg3KqPuho6eZd8EeWj8xilKcE7r5/AT5s2l6kDqkVBXfwQ6opxy7l7DRTFmjul+uTo LeBg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail (test mode) header.i=@armlinux.org.uk header.s=pandora-2019 header.b=MvKPY4Fm; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=armlinux.org.uk Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id y2-20020aa79e02000000b0063b7790fde1si1679725pfq.284.2023.05.21.11.32.31; Sun, 21 May 2023 11:32:44 -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; dkim=fail (test mode) header.i=@armlinux.org.uk header.s=pandora-2019 header.b=MvKPY4Fm; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=armlinux.org.uk Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231750AbjEUSEm (ORCPT + 99 others); Sun, 21 May 2023 14:04:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46598 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229571AbjEUSAL (ORCPT ); Sun, 21 May 2023 14:00:11 -0400 Received: from pandora.armlinux.org.uk (pandora.armlinux.org.uk [IPv6:2001:4d48:ad52:32c8:5054:ff:fe00:142]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5C67EE1; Sun, 21 May 2023 11:00:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=armlinux.org.uk; s=pandora-2019; h=Sender:In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=fM7breEkmpFcu5kMT1h3Tjd0iDA0uSr1msWJ+/s0HS0=; b=MvKPY4Fmh8yN1XdnZfnsxeUAC7 jt872Gwx4coXAhNu0so+puhLjlDrfK3LU9LFysT/utXhXd5YDvkkHHSxDM+JDE0Y37rrtriUt61Yn JRPXCgfjaHPu5w3G8n+oYPXr5ZK9UiSUp3i/M5xcKvg5X+C0KUHAnxhhO18vIKsNEL93Y7yWfG/tM 8Dc1I0ec8tilwJE4m/W5m3+1C57Tr0uV46UK24S48f9NOvd3VSTwQ8M8ZyS4wX+uhmdc7+iOv0C0v r3mEllywX48gj0J5ovKkEOCSTo0C47idCY32E5s1hZ0EFYeO73e4K7/GixDNM+FFSXZ6WH0hFltNL wXi96Igg==; Received: from shell.armlinux.org.uk ([fd8f:7570:feb6:1:5054:ff:fe00:4ec]:44292) by pandora.armlinux.org.uk with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1q0nLa-0005SQ-Ea; Sun, 21 May 2023 18:59:58 +0100 Received: from linux by shell.armlinux.org.uk with local (Exim 4.94.2) (envelope-from ) id 1q0nLV-0006ry-63; Sun, 21 May 2023 18:59:53 +0100 Date: Sun, 21 May 2023 18:59:53 +0100 From: "Russell King (Oracle)" To: David Epping Cc: Andrew Lunn , Heiner Kallweit , "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, UNGLinuxDriver@microchip.com Subject: Re: [PATCH net 3/3] net: phy: mscc: enable VSC8501/2 RGMII RX clock Message-ID: References: <20230520160603.32458-1-david.epping@missinglinkelectronics.com> <20230520160603.32458-4-david.epping@missinglinkelectronics.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230520160603.32458-4-david.epping@missinglinkelectronics.com> Sender: Russell King (Oracle) X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,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 Sat, May 20, 2023 at 06:06:03PM +0200, David Epping wrote: > +static int vsc85xx_rgmii_enable_rx_clk(struct phy_device *phydev, > + u32 rgmii_cntl) > +{ > + int rc, phy_id; > + > + phy_id = phydev->drv->phy_id & phydev->drv->phy_id_mask; > + if (PHY_ID_VSC8501 != phy_id && PHY_ID_VSC8502 != phy_id) > + return 0; As you are accessing the phy_id in the phy_driver struct, isn't it already true that this will be initialised to constants such as PHY_ID_VSC8501 or PHY_ID_VSC8502? In which case, why would you need to mask it with drv->phy_id_mask ? > + > + mutex_lock(&phydev->lock); > + > + rc = phy_modify_paged(phydev, MSCC_PHY_PAGE_EXTENDED_2, rgmii_cntl, > + VSC8502_RGMII_RX_CLK_DISABLE, 0); > + > + mutex_unlock(&phydev->lock); What is the purpose of taking this lock? phy_modify_paged() will do its read-modify-write access and page accesses under the MDIO bus lock, which should be all that's required to guarantee an atomic update. -- RMK's Patch system: https://www.armlinux.org.uk/developer/patches/ FTTP is here! 80Mbps down 10Mbps up. Decent connectivity at last!