Received: by 2002:a05:7412:419a:b0:f3:1519:9f41 with SMTP id i26csp2819343rdh; Sun, 26 Nov 2023 22:21:22 -0800 (PST) X-Google-Smtp-Source: AGHT+IHz43rDvhj8oTk9KtEOEcrqqI+bdI7ay8qroPYbsELu+KOXGj1RfHtuab2cxHMvaMceclKB X-Received: by 2002:a05:6808:f8b:b0:3ac:a522:5461 with SMTP id o11-20020a0568080f8b00b003aca5225461mr13953957oiw.36.1701066081775; Sun, 26 Nov 2023 22:21:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701066081; cv=none; d=google.com; s=arc-20160816; b=PWpSWsu4CKQEy9PjK87S1rpxcSZhdOafZPu8AAa6Y1DjEAdK9j3vePkGJ+f+mlY2gN cvtRKnBGZgvckB7XWFW4dkf1k4/er8/uiGa+Yd1LWRRDwCTnwAwJbfcJDXrvas4wsMF+ PTEy+jJJxrAN9JpoS6CFmgoPb3Wr4J3BdrAO9CY5GkAJEIV/P8MJ7IyiIuNJfFZ/vtGR sUywMVRsswWuoCbnhwNYtiq0hwqVn9HyvOQ3K3SgQJ2mmZuJbvBYzzl+lwNG1pcfXd4N N/L+G7czsg6wOo250SsV9VPnz497CKwB4it2beKZF6G1OY6x9kEKPiEIVZwALQdxg0bo Xp5g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=SHtEQi8g8hzQmGEKqbL9kvJSOxbU+L25q3WrEMfx6eQ=; fh=L8NMR2C9LrR1pcrnniN7sPbDUjQnHNDejVw3fuIRfJU=; b=joRJ/4tb71e1gzAFEwEkdBjB/4hY7InkRAA+atubUsv8IXcXhKTZ/3IvkPd+PC2Q4p qxyEzLJXqU0pVHAgZZNgBhVeRblrNQkA4EICHN4T3vUYsG59E5f32AosdUKNMT64lt6q rfxgplf6+r/+mBxkUyBDBGocbWspqWSXpunCh7EL11Vob9PnFfciljcGUWUP/H/Dfu1z Tfh6VyAAxejr1O91wCcRwH9qHa6Y9NzjfhosHk1Cd64x6ZHYJMiBWg03sF+s9pr7mucD +Jt11RpI9dpXL0yDUGeKbr/H7RJ3flADEgfnn6YLtVZdih8U6ZGMWdDuDl0OSB5LFZMM WGDQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@tuxon.dev header.s=google header.b=Uh1l1gXP; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id h1-20020a056a00170100b006cd908c0599si1054291pfc.369.2023.11.26.22.21.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 26 Nov 2023 22:21:21 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; dkim=pass header.i=@tuxon.dev header.s=google header.b=Uh1l1gXP; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id A05DC80699E1; Sun, 26 Nov 2023 22:12:55 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229774AbjK0GLR (ORCPT + 99 others); Mon, 27 Nov 2023 01:11:17 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37478 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229509AbjK0GLQ (ORCPT ); Mon, 27 Nov 2023 01:11:16 -0500 Received: from mail-ej1-x62b.google.com (mail-ej1-x62b.google.com [IPv6:2a00:1450:4864:20::62b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E79F6E4 for ; Sun, 26 Nov 2023 22:11:20 -0800 (PST) Received: by mail-ej1-x62b.google.com with SMTP id a640c23a62f3a-9e1021dbd28so514539966b.3 for ; Sun, 26 Nov 2023 22:11:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tuxon.dev; s=google; t=1701065479; x=1701670279; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=SHtEQi8g8hzQmGEKqbL9kvJSOxbU+L25q3WrEMfx6eQ=; b=Uh1l1gXPo7uM8iGaJofaS8/4NydXffpDdIQmWcgijf7grcElrxTzECzpDTQawXa/oI m1fK4P03WRWJydU808yf9q1hOn5AB1LJA8ownmlo9Wvy4rIkruhdOEg6I4fUlbqUHWkW iEfYFznnlUlvkcISwAQus/jYl3gqEP8XdwUpEfC7bysajtxxUfDu0Jh+wUCLiMUF3sGK 0o4eeAL0enBGO4c87vfPqmt0HWF76WBAzDgA0AMNGuuFH6hctNsXJNLTPEtr5QuNfWna 3RAU3HhgNM98WYp327BTbCb6wZ4dKrI7zSkYnyPLufEeDdEJxoKsN3OPEskD1iPXfJqC 2I/A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701065479; x=1701670279; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=SHtEQi8g8hzQmGEKqbL9kvJSOxbU+L25q3WrEMfx6eQ=; b=hcmQXxcsesb9evV/5R7SGRhOLP3zcgPZLTRPSIExVyY1cSzGcVT4uEcR/ZmjeV/XvN zIO590+TIczazCdEaGC6kIOhq19uv2yuNoBuXQJAhWeS/4diiS8RW0yYJLtL3H756zId 9rBJoVmFw8awpoPUBaqYMIa7q6ahUZ2CFgzf4fUzZkjTzjXqy12M+pdCb+95LOs+/QSh ljDIoU7Vodx6g3tfxGHSnMwWdbt9l+yeVcP/Pkd0P7qI+eVHYvyB7KYTZo8sfvZPFcLB W4bpmdee5l3wVnvB/TvvH0BJRIJ/MOnJqDGmHnYsg9Rm0/svk2XM+vB5b5Rex3+G+6Lw pgow== X-Gm-Message-State: AOJu0YyWscP52uQFXkHfT15i0louIVLMTzvcLzqo1IJdrsW6YT5UBhQ7 pRAY2vd5LAnT51dEETSntuZTKQ== X-Received: by 2002:a17:907:1255:b0:9de:32bb:fa95 with SMTP id wc21-20020a170907125500b009de32bbfa95mr5686417ejb.35.1701065479311; Sun, 26 Nov 2023 22:11:19 -0800 (PST) Received: from [192.168.50.4] ([82.78.167.125]) by smtp.gmail.com with ESMTPSA id 20-20020a170906319400b00a097c5162b0sm3840401ejy.87.2023.11.26.22.11.18 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 26 Nov 2023 22:11:18 -0800 (PST) Message-ID: <7ea4c3fe-a911-4161-af13-7f1d55def7e3@tuxon.dev> Date: Mon, 27 Nov 2023 08:11:17 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 2/2] net: macb: Unregister nedev before MDIO bus in remove Content-Language: en-US To: Andrew Lunn 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 References: <20231126141046.3505343-1-claudiu.beznea@tuxon.dev> <20231126141046.3505343-3-claudiu.beznea@tuxon.dev> <086fc661-0974-4bb6-a8ae-daa9d53361d9@lunn.ch> From: claudiu beznea In-Reply-To: <086fc661-0974-4bb6-a8ae-daa9d53361d9@lunn.ch> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE 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 X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Sun, 26 Nov 2023 22:12:55 -0800 (PST) On 26.11.2023 19:13, 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? It handles bus errors that my happens while DMA fetches data from system memory. It re-initializes the TX/RX, DMA buffers, clear interrupts, stop/start all tx queues. > Is it safe for it to run after the netdev > is unregistered, and the PHY and the mdio bus is gone? Not really, as it accesses netdev specific data. > Maybe this > tasklet_kill should be after the interrupt is disabled, but before the > netdev is unregistered? That would be a better place, indeed. Thank you, Claudiu Beznea > > If you have one bug here, there might be others. > > Andrew