Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp2737740rwb; Wed, 30 Nov 2022 10:10:16 -0800 (PST) X-Google-Smtp-Source: AA0mqf7M8GegYirw72DgcIml2hhtL1xKOWbI5QKNFXGc43WMiQZdqTxHRdKRxBYT8fFDUdA+xXRB X-Received: by 2002:a17:907:206f:b0:7bb:cc6b:86d6 with SMTP id qp15-20020a170907206f00b007bbcc6b86d6mr25881185ejb.252.1669831815864; Wed, 30 Nov 2022 10:10:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669831815; cv=none; d=google.com; s=arc-20160816; b=vU695okeWLGf0/UaFcPXzuxSK2SvRcS9H0uvfcgWdWQz1vqMHbnTeAnm+pF43aRuoV MhKWPaIKj7AjtUrogt1yYnFk9uvzwsBOVDA0+CzqRFfL3x9ljpnjhRy1ehihmizSMdVx wreOu/CJi3QN/n1vJmPuA1RLnv8x+mQRA7AyfpfoaWEo1uM8UBXE/nILog5tUBT2HllZ TgJv4csKGVpgZsLzvSbzk9HFqQXTZ/VCofH+7SH5QOhtD/QM/mquLnVIlhbJM2E75Xw5 4EzngSqGTFzCrcmHw+ZzF3K/Bsu49qT+k8rPSvc0HPnFsmbnh7NB+dCAnZ/4XF9Q9k+Y NhrQ== 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=eWTp50vj1owXok9ZS3DmZfJ3/9+ZtfspBzxtU2pkiRI=; b=snkF1j6QPFCrtrzESMxCMGcXaM0J3yIEBGKkt6yYQhA/NzzNpIHEKdkmrpUHE1qSW9 aEbi9AUJr38jTnIhy7J9ifhKba8zCWCmV8ABgHWwRtAd2fpbUP0jmD77/+4k1HI+Oi9h XIi/guMudje+g0pfTY/TnqWKaR0ohKUVjL0nZc2J6EQ9VlDLjK9qFUZRaDK/lSUhz3Ww IxmjuiNoy0zUp+SH+K6vkMQfYhzAJKSM0m2Bf01pLnfOiBE2yQMuSlyUE/4RLHljMEVO 4XvFLUI/2qkNunv/x//vUmk5aHJaYZTqHAlwLyHbJxAPIMmNi8o7Ql43rE21iEcEnmqy G5cQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail (test mode) header.i=@armlinux.org.uk header.s=pandora-2019 header.b=B1cSd1Gk; 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 o1-20020aa7c7c1000000b00469b3fcafe8si1637050eds.432.2022.11.30.10.09.55; Wed, 30 Nov 2022 10:10:15 -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=fail (test mode) header.i=@armlinux.org.uk header.s=pandora-2019 header.b=B1cSd1Gk; 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 S230028AbiK3Rdm (ORCPT + 84 others); Wed, 30 Nov 2022 12:33:42 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59648 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229986AbiK3Rdf (ORCPT ); Wed, 30 Nov 2022 12:33:35 -0500 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 2B61C27B1E; Wed, 30 Nov 2022 09:33:34 -0800 (PST) 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=eWTp50vj1owXok9ZS3DmZfJ3/9+ZtfspBzxtU2pkiRI=; b=B1cSd1GkIITcC8/xA5aVHlM8+p 1Rr1lANb/HDuYBAg8j9goKrN6bfsVoXW0be+Iu7cFOfiezpqDvY3JQu9C5Ej8FhOiPF64Od/rxQ6J pK27iZVpfVj3TM9Mar4tb38myxDjdItKcft9cKeB+SaeqpB0BioD28IQe5+oamHmxLJBiJkpaS65m UlkUCjpAciVEx+2rUbBRg5kbZcHP+chAA1JlV/W0rS0f3vJ0bIcA9JRnD+3v3diksD0BPu6R2BQBe TWRbzP/SG3zBhnJKVhPfrIesmWPo8IDvl9rzUBG6NpJj07Qbx8UXLg3oXU/qaSviFDHHP+FxC+X8b rmga18dQ==; Received: from shell.armlinux.org.uk ([fd8f:7570:feb6:1:5054:ff:fe00:4ec]:35504) 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 1p0QxT-0001zy-W9; Wed, 30 Nov 2022 17:33:20 +0000 Received: from linux by shell.armlinux.org.uk with local (Exim 4.94.2) (envelope-from ) id 1p0QxP-0002fg-9t; Wed, 30 Nov 2022 17:33:15 +0000 Date: Wed, 30 Nov 2022 17:33:15 +0000 From: "Russell King (Oracle)" To: Andrew Lunn 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: Sender: Russell King (Oracle) 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_NONE,SPF_NONE 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 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. However, if the author does have lockdep enabled but ignores the warnings, that isn't going to help. -- RMK's Patch system: https://www.armlinux.org.uk/developer/patches/ FTTP is here! 40Mbps down 10Mbps up. Decent connectivity at last!