Received: by 2002:a05:7412:419a:b0:f3:1519:9f41 with SMTP id i26csp2524375rdh; Sun, 26 Nov 2023 09:14:21 -0800 (PST) X-Google-Smtp-Source: AGHT+IGQibzMFyZGlZLH6k3WlvRDl4K9q8QQsXQHCK5Dn07xuMVqD1x1NWX+/pLwe7qVUF+3cFEQ X-Received: by 2002:a17:902:a5c4:b0:1cf:b1df:47cd with SMTP id t4-20020a170902a5c400b001cfb1df47cdmr5363975plq.25.1701018860702; Sun, 26 Nov 2023 09:14:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701018860; cv=none; d=google.com; s=arc-20160816; b=kSQS976JhQvzGQFcu0iK80E1W1xDZLfc10BA39o3pWvEDnhzDOO313ZBHLKxKszvVT Nfx8IZl6hPIrzRqGfc/G4tvupSru8qKzrs6TCs4WaHymciDLya2+g5PidkCvJbQ0PtXV 7gRwPvetYAX4WUzVmc8pA4HV8qCQaIooILrjYvQfddFNFXZLi3fMZ1R5AetJgene7ZPa Y4g66tC+etT+nKlUKNMsJTR1UwWNPH2LTrLZ3kJjaaHmpJQro7x1drJziZ2J/SVogho9 P0oDm6y6aO+hkVXtPCJ9t40C6K2/LYElpukSJdvtAAcLUxzPYLws+rK5D7mpUj0Jzgij 9NEw== 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=RdIudcP1oq+zY0g0sLYUC7kZO/VnWzdwxsQtDjsyiRc=; fh=m94l1DPiKITIcmtigo548P6g127LIf2roeb7NFLaWVs=; b=eXKYpmAuU1kOlsH3d7aVh0Q0mueJULqhdsAsehzvJpYNca/LGuk25J6Hn9OZ4tMASn SmBPA+JFFlRU0yA0xpGMK92Y2CtTx+a5EgP7BRZiIhbiZCat/G9mxwMFnAO9fEhLjqng bn5VgUVbGro0fqEozZ8LP0PwSZxI/6aI1U4TCmj1Eq8mp0lu2OKzIUw98R4lNaxSyS38 w+MmNiXzzVh9sUaVce0thjAciuWXU0zKvuj+2WmD5p3yGjnBlXYnUJziQDLAxvi5zu4c xdvZZ6/rplArQqLkyxKw8F2TpM767tiO4gO09gG89hV8XQeWFg4dQ4ht15j8KgdT7NUP JyaQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lunn.ch header.s=20171124 header.b=tuBhHgzH; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 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 morse.vger.email (morse.vger.email. [2620:137:e000::3:1]) by mx.google.com with ESMTPS id ix1-20020a170902f80100b001cc47d6f4absi6540029plb.107.2023.11.26.09.14.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 26 Nov 2023 09:14:20 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) client-ip=2620:137:e000::3:1; Authentication-Results: mx.google.com; dkim=pass header.i=@lunn.ch header.s=20171124 header.b=tuBhHgzH; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=lunn.ch Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by morse.vger.email (Postfix) with ESMTP id 3AE1480B8399; Sun, 26 Nov 2023 09:14:17 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229562AbjKZROC (ORCPT + 99 others); Sun, 26 Nov 2023 12:14:02 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59722 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229437AbjKZROB (ORCPT ); Sun, 26 Nov 2023 12:14:01 -0500 Received: from vps0.lunn.ch (vps0.lunn.ch [156.67.10.101]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 52EB6FA; Sun, 26 Nov 2023 09:14:08 -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=RdIudcP1oq+zY0g0sLYUC7kZO/VnWzdwxsQtDjsyiRc=; b=tuBhHgzHAWCR9J7VB1MLndQiOS NFt9FRodtLaiMV9YtxlaGS7AVtZWczMGvGgF0IoA7r6udEpOv47CUqQANYeQfI4YrtS929nMgJhK2 hISLUT79kWfZMaYjumXdY7TV2/Vy0h/zrAjWd5JsMqDF7OOH1p5n/tnN03WISoW215/U=; Received: from andrew by vps0.lunn.ch with local (Exim 4.94.2) (envelope-from ) id 1r7Ihf-001GDJ-Fc; Sun, 26 Nov 2023 18:13:55 +0100 Date: Sun, 26 Nov 2023 18:13:55 +0100 From: Andrew Lunn To: Claudiu Beznea Cc: nicolas.ferre@microchip.com, davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, hkallweit1@gmail.com, linux@armlinux.org.uk, 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: <086fc661-0974-4bb6-a8ae-daa9d53361d9@lunn.ch> References: <20231126141046.3505343-1-claudiu.beznea@tuxon.dev> <20231126141046.3505343-3-claudiu.beznea@tuxon.dev> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20231126141046.3505343-3-claudiu.beznea@tuxon.dev> X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,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 morse.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 (morse.vger.email [0.0.0.0]); Sun, 26 Nov 2023 09:14:17 -0800 (PST) > 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? If you have one bug here, there might be others. Andrew