From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 53D96C433FE for ; Wed, 30 Nov 2022 17:14:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231176AbiK3ROX (ORCPT ); Wed, 30 Nov 2022 12:14:23 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39708 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231143AbiK3ROC (ORCPT ); Wed, 30 Nov 2022 12:14:02 -0500 Received: from vps0.lunn.ch (vps0.lunn.ch [156.67.10.101]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8B8F1B08; Wed, 30 Nov 2022 09:11:02 -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=HOR8TJlxjCjAtgrXFWiZM3BCPiC97uvsOgWLmMHIcAM=; b=sJhVGozYoTaAqEbOHSw0JhUC/J ypKAouVxcLP88WVTUnVmgtF2KsPw4dohg41oO4EmPrBMy6rP0tZxVYoqGthR9Qrha8QcnCXvjtqTI /7gf957SDvkw5IVCsxATJM+cakLQy84lk53yvWQxM6UhHAxtl2KxjoKb3fji+pxoxZ38=; Received: from andrew by vps0.lunn.ch with local (Exim 4.94.2) (envelope-from ) id 1p0Qba-003ymW-GK; Wed, 30 Nov 2022 18:10:42 +0100 Date: Wed, 30 Nov 2022 18:10:42 +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: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Nov 30, 2022 at 09:55:50AM +0000, Russell King (Oracle) wrote: > On Wed, Nov 30, 2022 at 05:49:28PM +0800, Frank wrote: > > +/** > > + * yt8531_set_wol() - turn wake-on-lan on or off > > + * @phydev: a pointer to a &struct phy_device > > + * @wol: a pointer to a &struct ethtool_wolinfo > > + * > > + * NOTE: YTPHY_WOL_CONFIG_REG, YTPHY_WOL_MACADDR2_REG, YTPHY_WOL_MACADDR1_REG > > + * and YTPHY_WOL_MACADDR0_REG are common ext reg. > > + * > > + * returns 0 or negative errno code > > + */ > > +static int yt8531_set_wol(struct phy_device *phydev, > > + struct ethtool_wolinfo *wol) > > +{ > > So this is called from the .set_wol method directly, and won't have the > MDIO bus lock taken... Hi Frank 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? ASSERT_RTNL() but for an MDIO bus. Andrew