Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp4342688rwd; Tue, 23 May 2023 06:35:51 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ50DcPSmlgS0WAE6LlqWJFg5RZyHGJLgPWs3bHvUoupV7Pg8h0EadoQvAgkQGHL6DsfW8I6 X-Received: by 2002:a05:6a00:248a:b0:64e:6862:8553 with SMTP id c10-20020a056a00248a00b0064e68628553mr7025832pfv.32.1684848951208; Tue, 23 May 2023 06:35:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684848951; cv=none; d=google.com; s=arc-20160816; b=sGPMl9QwWpwtH5uQp8wDzORl0HTLC+uIZXxy9GkdV++zs4T8ERbkYSUVyWc9SFMVRw kEf53LAioLJLb2L4nyrxEnYPR6IkeXHh0m8w34C+H9iAySyQqIfZVz9yCK3FL261i49J DROHG+9DopvEmKzYYfD1thU65XeodULQw3SI06KWT+q937BpbqJrSHutAYda3fgZDK2c cQuHwVbEgQhtrF9UaoUJ/f/nTQ1+eVfyitePwiTiqpPTashKTbLX2JkpxYT4oZcAE8qY ri/gMuSVc79IW4uuJ/1TaWJMgAoEooiYas6XwmIFKqQw96l5zRJ+ydsPYoyJliHCZqIo aNPw== 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:message-id:subject:cc:to:from:date:dkim-signature; bh=QaJjwNP0byDh2vTB+BfRP2skNBByswtyi4rwwgzOO84=; b=BPkvWH76okcREthLU6tqTWa9SQSpYG14ZMPNcLPBrbyjaKrjXKXW95lHtkeORh855g zp6lx34lAyUXua3Wcw7kx64fRUXGB8n3/v74920v+qF2qflJG6OQFDqh7vhNh5hRUomO PrJGTcSQ1uOcpmV5teexq1Oq31XirSFuoHT+bSArLjdgJ3ePZLQrKbWLEjB5yslVDb7G tZXdJM3Ka2KBzTkQFMiSsirzTOkXmMevx9soTmB+tt0lCdQPKnoO+arrzq/o27qcPKQ7 HVldNa7VmliIu0SHo4eZhOB6Hf4Gkc1A8Ny7d3DSfPWiCe4dQ6jDDvI20ALjDS+nhzDr v/sg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lunn.ch header.s=20171124 header.b=ccExP0nk; 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=pass (p=NONE sp=NONE dis=NONE) header.from=lunn.ch Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id bm18-20020a656e92000000b0053ef9d107cdsi478599pgb.584.2023.05.23.06.35.34; Tue, 23 May 2023 06:35:51 -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=pass header.i=@lunn.ch header.s=20171124 header.b=ccExP0nk; 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=pass (p=NONE sp=NONE dis=NONE) header.from=lunn.ch Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236174AbjEWNRC (ORCPT + 99 others); Tue, 23 May 2023 09:17:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49922 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232705AbjEWNRB (ORCPT ); Tue, 23 May 2023 09:17:01 -0400 Received: from vps0.lunn.ch (vps0.lunn.ch [156.67.10.101]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CC255118; Tue, 23 May 2023 06:16:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lunn.ch; s=20171124; h=In-Reply-To:Content-Disposition:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:From:Sender:Reply-To:Subject: Date:Message-ID:To:Cc:MIME-Version:Content-Type:Content-Transfer-Encoding: Content-ID:Content-Description:Content-Disposition:In-Reply-To:References; bh=QaJjwNP0byDh2vTB+BfRP2skNBByswtyi4rwwgzOO84=; b=ccExP0nk6kRSUyvuKNMxUTrYp9 qZeebMgn0R0JRYDIvCz0au56fuuXA+49zhy5VzSJMeWwKse+BnKbFNywhzvCGoRLfdyIvbTV8b5TJ MWZoxRTa6km5+qDaRcImYnqD/z0HjL0xZwSm2e3JjM1xiKET/dZx3wc4jASsCZdV9SUU=; Received: from andrew by vps0.lunn.ch with local (Exim 4.94.2) (envelope-from ) id 1q1Rsh-00Dglg-2T; Tue, 23 May 2023 15:16:51 +0200 Date: Tue, 23 May 2023 15:16:51 +0200 From: Andrew Lunn To: David Epping Cc: Vladimir Oltean , Russell King , 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 v2 0/3] net: phy: mscc: support VSC8501 Message-ID: References: <20230523090405.10655-1-david.epping@missinglinkelectronics.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230523090405.10655-1-david.epping@missinglinkelectronics.com> X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_PASS,SPF_PASS, T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED 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 > - I left the mutex_lock(&phydev->lock) in the > vsc85xx_update_rgmii_cntl() function, as I'm not sure whether it > is required to repeatedly access phydev->interface and > phy_interface_is_rgmii(phydev) in a consistent way. Just adding to Russell comment. As a general rule of thumb, if your driver is doing something which no other driver is doing, you have to consider if it is correct. A PHY driver taking phydev->lock is very unusual. So at minimum you should be able to explain why it is needed. And when it comes to locking, locking is hard, so you really should understand it. Now the mscc is an odd device, because it has multiple PHYs in the package, and a number of registers are shared between these PHYs. So it does have different locking requirements to most PHYs. However, i don't think that is involved here. Those oddities are hidden behind phy_base_write() and phy_base_read(). Andrew