Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp2816060rwb; Wed, 30 Nov 2022 11:13:30 -0800 (PST) X-Google-Smtp-Source: AA0mqf7Y/qUaXihxDvW600fAPfLsty2a33hM974C4+nYV/uQxc+5smCp21PyTm5Od5HBNHthnJUx X-Received: by 2002:a17:907:8c0d:b0:7ae:70f9:114 with SMTP id ta13-20020a1709078c0d00b007ae70f90114mr23771082ejc.44.1669835610322; Wed, 30 Nov 2022 11:13:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669835610; cv=none; d=google.com; s=arc-20160816; b=hrxjNmskjMgJ31FHcjE7bCzbvRQAIeNpfU7r9kOEdowGRisLdG4CGFhXYlPGhZ0puL aJEd6uq6REdbIUtwkABKNkuRFDDT15TM8KdyPwZUPWxzrALbAro4mN1nZkm9zfxhOm1Z rWcbEo1D4YU2B1pLxILqZvDsUg5EsCrVkCZn+BfIBdv9odvhVY22FrxL49nZ/+8ZWAxr 8n3k2iTsDHH6BaQXOmdqLYkv4gAPWo+hasiVDNaU7wXFGH0GuVGYA7mKsokj9sVNvYO5 NmnXer4+K3RfEA0AkF3MWJxA8/fbFL41KBrSHRmyphW3aUqzb0qQKROL3KVxXh6RmeG+ mHpA== 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=4c09+CUgf/2EPKD4iaGq2aTS0q8Ubfdgolp1/FJx814=; b=Pk3ISXxj+fDzXt/IIORhv2YoGrmHzOhV4m4DCOxbQXt3wI77B0gFbFKuCG6dZYGI/2 jOhOuCV62yCmD5OypaTqwIw7fcle9ERIlhmXNZ8hnzGnRhDIrmxdn6fe19POt7RODqe/ 1X9GRSGGn/JxuVrEnTPpPrhnZ5nh1aVMqIUst2f1boYL/aym/KGMXzX6ZjyQ4OpQ2tEN f7jTRFQRzmlMu18FkzEqgYd3g5YQ4QFHGgkBMweZ4TVIzyNpVDehbw3ReHsaSRFRpfVo EEstndxs/iF492g92agf5SCu6GY9Yj4/mI5qw1wizX/W8JQYH2YkvALdO4K7DWUtJSdD 6miA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lunn.ch header.s=20171124 header.b=DysGmG6T; 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 bb8-20020a1709070a0800b0078df1c345dcsi2055942ejc.535.2022.11.30.11.13.09; Wed, 30 Nov 2022 11:13:30 -0800 (PST) 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=DysGmG6T; 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 S230100AbiK3SVa (ORCPT + 83 others); Wed, 30 Nov 2022 13:21:30 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49706 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230289AbiK3SUt (ORCPT ); Wed, 30 Nov 2022 13:20:49 -0500 Received: from vps0.lunn.ch (vps0.lunn.ch [156.67.10.101]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 00E0A8C46A; Wed, 30 Nov 2022 10:19:30 -0800 (PST) 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=4c09+CUgf/2EPKD4iaGq2aTS0q8Ubfdgolp1/FJx814=; b=DysGmG6Tr3Q1hxLAFB2v+yoiX+ RQjxudqAX9v2CpHHusShXSIll1fM9jg+KylojiYgu/tsLE2CBy7tmhoAN/GwGxB/n0h+buvrjcEoN 9imHJYaMPKAWLcrn/KROi0AwImFIVyl2ECfwUw9iCMyhGz2Pgy7c1+JlNWRy1nLws7js=; Received: from andrew by vps0.lunn.ch with local (Exim 4.94.2) (envelope-from ) id 1p0Rfo-003zJo-Vu; Wed, 30 Nov 2022 19:19:09 +0100 Date: Wed, 30 Nov 2022 19:19:08 +0100 From: Andrew Lunn To: "Russell King (Oracle)" Cc: Frank , Peter Geis , Heiner Kallweit , "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , yinghong.zhang@motor-comm.com, fei.zhang@motor-comm.com, hua.sun@motor-comm.com, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH net-next] net: phy: Add driver for Motorcomm yt8531 gigabit ethernet phy Message-ID: References: <20221130094928.14557-1-Frank.Sae@motor-comm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: 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 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 Wed, Nov 30, 2022 at 05:33:15PM +0000, Russell King (Oracle) wrote: > Hi Andrew, > > On Wed, Nov 30, 2022 at 06:10:42PM +0100, Andrew Lunn wrote: > > This is not the first time Russell has pointed out your locking is > > wrong. > > > > How about adding a check in functions which should be called with the > > lock taken really do have the lock taken? > > They already do: > > lockdep_assert_held_once(&bus->mdio_lock); > > but I guess people just aren't testing their code with lockdep enabled. > > The only other thing I can think of trying is to use mutex_trylock(): > > if (WARN_ON_ONCE(mutex_trylock(&bus->mdio_lock))) > mutex_unlock(&bus->mdio_lock); > > scattered throughout. The ASSERT_RTNL() macro does this, it does not depend on lockdep. And given the persistent sort of problems we have seen, you are probably correct, lockdep is not being enabled by some developers. I guess they don't even know what it is. Andrew