Received: by 2002:a05:6a10:eb17:0:0:0:0 with SMTP id hx23csp60945pxb; Thu, 2 Sep 2021 19:18:57 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzrH/vgvql7wLPaRVtRVNy0/pXYLAb5Z0Auy2hw9gtatBlhNYyeQUXZnUCCCw0dr2gie6+m X-Received: by 2002:a92:ae0e:: with SMTP id s14mr883442ilh.197.1630635536979; Thu, 02 Sep 2021 19:18:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1630635536; cv=none; d=google.com; s=arc-20160816; b=rvEt1hr+IVOLoG1q8qwP3wYYyT+ySMeTrZtsaZY3nj8sBcZrvyorHjcaajmWuAjH40 I1oCj656WYHixTLSCvLo/dzxI6Cym4Y7f68MKNExJP/juWyGrb1EBQ7HXUmvTJK8l70A uipIwKhXK2veAePAZXQZqGgX7pp0FcCmMm4BeJBH/ypBchpPDJmnmcA6uHOQw2rROYwB Nzvm6OrTX/Z7D9GliF1AFrExKEcyb/H9Ei84ZV8XAtXoAFzfvL+dc7za5OX/6UudipvV ZZSPYPtaJ3VVtgKE4aYJaMYG7LVRnb/VjXSiqVO0H4MESVODwKGsJuxx4UrUqjnoNCkr sNdQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=1aZwa45lKhrAFfmSsnRqBX5rvfTJ2itANvtSd+k2ghc=; b=gGXeRG0yLx+j688Bw61zdkbcxi6N+ofa6zgmvq8dZtyBFtDyPtpkEV98bQejm9lx1c inbORGqU92//msSuEPCH/++kf7yAm6Xf6N1IYYnNwJiWWS+tXK/hgMAf88VqXyKLqg/B 63yGHTbpOCkeuAFyQLQEizdX9Bx5EU0IgUR7iVewU6AF2GD3nlMqhbL7VzcgDASUFfyS YnYX98CXvcNoQe7JAIXYr88HlVsmzSK1ATosRGuv8XdcjKly9KcoKfsZaU9J6rIZO8HU 4iRoIjf04yM1KWP8Kxrz5/X2Dc6LhORgVgo1p1FC1eS8taskQzLFGePSg9M1a4H5ngIJ xssg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail (test mode) header.i=@armlinux.org.uk header.s=pandora-2019 header.b=cY5MmrfG; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id l10si4639252ios.26.2021.09.02.19.18.45; Thu, 02 Sep 2021 19:18:56 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=fail (test mode) header.i=@armlinux.org.uk header.s=pandora-2019 header.b=cY5MmrfG; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S1346156AbhICAF1 (ORCPT + 99 others); Thu, 2 Sep 2021 20:05:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41338 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1343948AbhICAF0 (ORCPT ); Thu, 2 Sep 2021 20:05:26 -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 51E47C061575; Thu, 2 Sep 2021 17:04:27 -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=1aZwa45lKhrAFfmSsnRqBX5rvfTJ2itANvtSd+k2ghc=; b=cY5MmrfGcs4Cg8XSd8qHh+G2f 4o/wEHJZkxIhUwlMw0e/JO5IWeOuFpsZnJzCWKjns0+LCTGdQS57fNXfv0Jh3MLTolhDk92xgKtAv V89d5GXoFx3IH9GVru3vJnGekckGLY/Zl9ZxluTMGj5UMhh/lrgFomSi0URHRI6xeQt1QePv99v+E 939HYZmCMzpjb/hqTV5ZovKYhm7msFuixkR0dRY4ena+Pc9qpCQ7Q3himRBB+r4rv5a4CkyWJSC+/ FvC8Ft+hxCriJqgJ2jPNXb0uM3/gkO32vjBiHI/nQEZlIlA0KGUGVSc/901xNFLuBWy5nKz8HSRyP JVUrhNYlA==; Received: from shell.armlinux.org.uk ([fd8f:7570:feb6:1:5054:ff:fe00:4ec]:48126) by pandora.armlinux.org.uk with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mLwgw-0002Ew-Jr; Fri, 03 Sep 2021 01:04:22 +0100 Received: from linux by shell.armlinux.org.uk with local (Exim 4.92) (envelope-from ) id 1mLwgt-0008MM-Av; Fri, 03 Sep 2021 01:04:19 +0100 Date: Fri, 3 Sep 2021 01:04:19 +0100 From: "Russell King (Oracle)" To: Vladimir Oltean Cc: Andrew Lunn , Florian Fainelli , Vladimir Oltean , netdev@vger.kernel.org, Greg Kroah-Hartman , "Rafael J. Wysocki" , Heiner Kallweit , "David S. Miller" , Jakub Kicinski , Vivien Didelot , linux-kernel@vger.kernel.org, Linus Walleij , Alvin =?utf-8?Q?=C5=A0ipraga?= , ACPI Devel Maling List , kernel-team , Len Brown Subject: Re: [RFC PATCH net-next 1/3] net: phy: don't bind genphy in phy_attach_direct if the specific driver defers probe Message-ID: <20210903000419.GR22278@shell.armlinux.org.uk> References: <20210901225053.1205571-2-vladimir.oltean@nxp.com> <20210902185016.GL22278@shell.armlinux.org.uk> <20210902213303.GO22278@shell.armlinux.org.uk> <20210902213949.r3q5764wykqgjm4z@skbuf> <20210902222439.GQ22278@shell.armlinux.org.uk> <20210902224506.5h7bnybjbljs5uxz@skbuf> <20210902232607.v7uglvpqi5hyoudq@skbuf> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210902232607.v7uglvpqi5hyoudq@skbuf> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: Russell King (Oracle) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Sep 03, 2021 at 02:26:07AM +0300, Vladimir Oltean wrote: > On Fri, Sep 03, 2021 at 01:02:06AM +0200, Andrew Lunn wrote: > > We should try to keep phylink_create and phylink_destroy symmetrical: > > > > /** > > * phylink_create() - create a phylink instance > > * @config: a pointer to the target &struct phylink_config > > * @fwnode: a pointer to a &struct fwnode_handle describing the network > > * interface > > * @iface: the desired link mode defined by &typedef phy_interface_t > > * @mac_ops: a pointer to a &struct phylink_mac_ops for the MAC. > > * > > * Create a new phylink instance, and parse the link parameters found in @np. > > * This will parse in-band modes, fixed-link or SFP configuration. > > * > > * Note: the rtnl lock must not be held when calling this function. > > > > Having different locking requirements will catch people out. > > > > Interestingly, there is no ASSERT_NO_RTNL(). Maybe we should add such > > a macro. > > In this case, the easiest might be to just take a different mutex in > dpaa2 which serializes all places that access the priv->mac references. > I don't know exactly why the SFP bus needs the rtnl_mutex, I've removed > those locks and will see what fails tomorrow, but I don't think dpaa2 > has a good enough justification to take the rtnl_mutex just so that it > can connect and disconnect to the MAC freely at runtime. It needs it to ensure that the sfp-bus code is safe. sfp-bus code sits between phylink and the sfp stuff, and will be called from either side. It can't have its own lock, because that gives lockdep splats. Removing a lock and then running the kernel is a down right stupid way to test to see if a lock is necessary. That approach is like having built a iron bridge, covered it in paint, then you remove most the bolts, and then test to see whether it's safe for vehicles to travel over it by riding your bicycle across it and declaring it safe. Sorry, but if you think "remove lock, run kernel, if it works fine the lock is unnecessary" is a valid approach, then you've just disqualified yourself from discussing this topic any further. Locking is done by knowing the code and code analysis, not by playing "does the code fail if I remove it" games. I am utterly shocked that you think that this is a valid approach. -- RMK's Patch system: https://www.armlinux.org.uk/developer/patches/ FTTP is here! 40Mbps down 10Mbps up. Decent connectivity at last!