Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp2697586rwb; Wed, 30 Nov 2022 09:39:46 -0800 (PST) X-Google-Smtp-Source: AA0mqf7cpMpDJk9i35o5yW2WMecZuZjrAbedC0VNwk0jJvPQaZOHd1RcVbN//PJifzwhDhk9M7SW X-Received: by 2002:a17:907:104c:b0:7c0:8010:49f2 with SMTP id oy12-20020a170907104c00b007c0801049f2mr9959521ejb.631.1669829985886; Wed, 30 Nov 2022 09:39:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669829985; cv=none; d=google.com; s=arc-20160816; b=amg4Q6oZXKI+7hmryq7oEkzQvm4Fe8yruKC0Wt7s9EvqWtNuincJY01FlLDJYmaIPy 13zjYCbKsyIDo4Yi1E9wxZkDWkqhDdyveLDbIM+esPV/UgL+dpp0Q/OKOh6TWGvJzF4r v37KKA+gixs25ASJDgqWVDkkArvkGa3q9pAWKRZU+9ldbsVpVVDSAVwUqaeb5YbrB5uj HWFZ3RdoYVXDwoWfJ7eBP6bI3HmO+mN/eBntb8lRC/kjjPVt+cOHhabjO8l8ZdBWn1Cr 2i+PUi3WOInd5e4yH3EpLz1H3itqflNDO2InJ3m77a1gNzQ1hwAaZHSj0Px800VvfVzk mHRA== 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=HOR8TJlxjCjAtgrXFWiZM3BCPiC97uvsOgWLmMHIcAM=; b=N7sPalwYOFwTznigkmd6tjHhlBX+0w3rbegeHMQXR/v4lf6/EUCuC2aEdrY/VekCvR nLETrGEkgjZ0UV4vM91IuGlIQWy48QRgbOia+j76mr6g+oXfGfaFm4axHl1LnNhnqWsg wnFGnqFatHKYjTYjGohDp57vPXUJOG5aU5AZHKx1w6wRM3DgdfooRDF2tMN4hHiP1Bxx iufNxXe7J5y6ytzIRfEB+Bv9IZ1g2AIn52k2Vksuoi+HyNwEqc/G2jgHyrjg8Xi00gqJ Op2rbDapUxAzMTm8T/woLmeE2ecg9XKe0czO4NjmSIc5X3zdJNQ3dAsMBROVa+6ssiqS 0itQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lunn.ch header.s=20171124 header.b=sJhVGozY; 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 hp8-20020a1709073e0800b0078d027ceb41si2016005ejc.857.2022.11.30.09.39.25; Wed, 30 Nov 2022 09:39:45 -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=sJhVGozY; 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 S231163AbiK3ROX (ORCPT + 83 others); 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: 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 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