Received: by 2002:a05:7412:419a:b0:f3:1519:9f41 with SMTP id i26csp2539907rdh; Sun, 26 Nov 2023 09:50:09 -0800 (PST) X-Google-Smtp-Source: AGHT+IHfTBqldLVBYpI+Kd5BJFIV9QlriHUbMfeopC3dq0LUAFhBThRh9IMrllgns1m0r3pqFJpe X-Received: by 2002:a17:902:ed06:b0:1cf:b65f:4cba with SMTP id b6-20020a170902ed0600b001cfb65f4cbamr5908572pld.19.1701021009149; Sun, 26 Nov 2023 09:50:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701021009; cv=none; d=google.com; s=arc-20160816; b=V2C/ISSSy6E6irmBUKMZpueonnOVhh/LiOVGECPFTOLlBFgh1kvANq+z5achS/xFfX tM/7msLqfAmH9CfseclWTQG73pfyM/XQ1bQHYScntBru1r2VExAaSK6lughHHT0W+VSM X6zE4QzPRfBxyXfS3JuTNwP44ox2YGPaZbIZ/8pPkJ03ang9U/SiR0gnd3v7KNSSzyGN eq/lm3uSdNY85cGJYlUOy5s7EMdqDNS9G/ZiD/9RJ++JqM5avjnbIrOerDl4avfDbhrF zrcaz+4t6xMmM7/h94KpQc1Bm26NMYdqT9pG9SJ8UrOatWC5MxE7u8AFoUpFIcny8plb btVA== 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=M01KVHUIlllcymTTdsk1kxxuGxb6BPjBNY/xeBH6YOk=; fh=Cnxe1R25bYXkGqrnz/1tfn/lPtVwyC1JqNazPCgqnHo=; b=CbKaNY1T4l1fiwlOK3Afs2WJX9EGekn0IEyJPYNwXoPu5GtQSTOGcYzMEP/VbKR7rh hN7lLt5nd4LhijwWtkkxSPmFSdzxcTrJvpnyq/vybg0je3Zr56G2Gj90AIpGo//3KUd2 GGoZn0Dob7YT5N9+vLduUyq7VZ/t/GyoPC96fK+2M87LSvyabx1DN7dkRh2FiCN3LftZ cYIKLwQAJTRrSV03iSyh7cDar4qOHgE+2wXMq+CUV6OgOcl9iOaEWN312BZGxEldcULp ufP9FWvhBr96MIRlQLRjynEnJV7SB4c+vRQbmH3B8eF/o9gCWR4+OTX6YjKUCHWK/2gT R64g== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail (test mode) header.i=@armlinux.org.uk header.s=pandora-2019 header.b=1om2Hsx4; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 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 fry.vger.email (fry.vger.email. [2620:137:e000::3:8]) by mx.google.com with ESMTPS id b11-20020a170902b60b00b001cfb5505bddsi3269186pls.564.2023.11.26.09.50.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 26 Nov 2023 09:50:09 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) client-ip=2620:137:e000::3:8; Authentication-Results: mx.google.com; dkim=fail (test mode) header.i=@armlinux.org.uk header.s=pandora-2019 header.b=1om2Hsx4; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 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: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by fry.vger.email (Postfix) with ESMTP id 77A0E807F4BB; Sun, 26 Nov 2023 09:50:06 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230136AbjKZRtr (ORCPT + 99 others); Sun, 26 Nov 2023 12:49:47 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54076 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229436AbjKZRtp (ORCPT ); Sun, 26 Nov 2023 12:49:45 -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 B5A5F101; Sun, 26 Nov 2023 09:49:51 -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=M01KVHUIlllcymTTdsk1kxxuGxb6BPjBNY/xeBH6YOk=; b=1om2Hsx4FVQ0Kkd6MzAkq/IDcg wlvlZOyerdlAjsHl2rpcze/0k306QpxM3reNvVHz2RPNK07LnrO9e5a5yi7c63lFgAVtm7zc5ztlU +CR6MCTuXIHP56q3PgMEj4D2+r4AlNXZV4AxlE512tKi3T9+px8a/l+BLTl5kUTcqjcPWWszuIfHL mXTYPCu9YYZX20stnhi2n6n9eW3tIKwNlz8xMsd67z9cAnTxA6N77etUbYwc/NDhunalhnyXft+qT bFXb5jiGf+t7MlBT61N0e6OUbf9pnp2zBHL9QKlUNGssUExaWmg+g4qMtHttYyTMVCnwGzfQHIVWL pcr+zF1A==; Received: from shell.armlinux.org.uk ([fd8f:7570:feb6:1:5054:ff:fe00:4ec]:33244) by pandora.armlinux.org.uk with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1r7JGF-0004up-1j; Sun, 26 Nov 2023 17:49:39 +0000 Received: from linux by shell.armlinux.org.uk with local (Exim 4.94.2) (envelope-from ) id 1r7JGE-00013E-4W; Sun, 26 Nov 2023 17:49:38 +0000 Date: Sun, 26 Nov 2023 17:49:38 +0000 From: "Russell King (Oracle)" To: Andrew Lunn Cc: Claudiu Beznea , nicolas.ferre@microchip.com, davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, hkallweit1@gmail.com, jgarzik@pobox.com, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 2/2] net: macb: Unregister nedev before MDIO bus in remove Message-ID: References: <20231126141046.3505343-1-claudiu.beznea@tuxon.dev> <20231126141046.3505343-3-claudiu.beznea@tuxon.dev> <086fc661-0974-4bb6-a8ae-daa9d53361d9@lunn.ch> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <086fc661-0974-4bb6-a8ae-daa9d53361d9@lunn.ch> Sender: Russell King (Oracle) X-Spam-Status: No, score=-0.6 required=5.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on fry.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (fry.vger.email [0.0.0.0]); Sun, 26 Nov 2023 09:50:06 -0800 (PST) On Sun, Nov 26, 2023 at 06:13:55PM +0100, Andrew Lunn wrote: > > diff --git a/drivers/net/ethernet/cadence/macb_main.c b/drivers/net/ethernet/cadence/macb_main.c > > index cebae0f418f2..73d041af3de1 100644 > > --- a/drivers/net/ethernet/cadence/macb_main.c > > +++ b/drivers/net/ethernet/cadence/macb_main.c > > @@ -5165,11 +5165,11 @@ static void macb_remove(struct platform_device *pdev) > > > > if (dev) { > > bp = netdev_priv(dev); > > + unregister_netdev(dev); > > phy_exit(bp->sgmii_phy); > > mdiobus_unregister(bp->mii_bus); > > mdiobus_free(bp->mii_bus); > > > > - unregister_netdev(dev); > > tasklet_kill(&bp->hresp_err_tasklet); > > > I don't know this driver... > > What does this tasklet do? Is it safe for it to run after the netdev > is unregistered, and the PHY and the mdio bus is gone? Maybe this > tasklet_kill should be after the interrupt is disabled, but before the > netdev is unregistered? .. and while evaluating Andrew's comment, check whether the tasklet is necessary for the device to successfully close or not - remembering that unregister_netdev() will close down an open netdev. -- RMK's Patch system: https://www.armlinux.org.uk/developer/patches/ FTTP is here! 80Mbps down 10Mbps up. Decent connectivity at last!