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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 744D0C52D7C for ; Tue, 13 Aug 2024 16:49:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Type:MIME-Version: References:In-Reply-To:Subject:Cc:To:From:Message-ID:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=ppXrWm8YGKF3R4k+YQIJ/QOi/8MvkoEXPBIxX2heQqE=; b=r2u8XNmRmK5jqIAhMfO6pJdGQx O2TvK4S+aPrn4g911fqxGpvtRQqAHAejwS4AbD7bTceLcMa1oEx+OSL1HSEGan3lvADDCvCh5zWoG /OCtGwESrsC4+DBPZGsLA06WpwohHOoubuxFBWjYWSTvSy5aZ36ZboI5Egu6izmlbY6peC7662lhb MR3FpJJEy4tGva209j35mBgKhgYbBL+qlw5jEDGtBIqxQ/gtz+kYX/GvXeBZ1yTIdXT++T6qkiCOL 3oGzagz6MDWy8XPPRrD3trbf/n/2JrnOV8Dd5GG7Ufh7iYBBszJ1Yf28LoYf1wF7QQClhuadlL1Tg Tbx6AYbg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sduiR-00000004Pxz-2m4u; Tue, 13 Aug 2024 16:49:47 +0000 Received: from sin.source.kernel.org ([145.40.73.55]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sduhp-00000004PrR-2IDf for linux-arm-kernel@lists.infradead.org; Tue, 13 Aug 2024 16:49:11 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by sin.source.kernel.org (Postfix) with ESMTP id 62B63CE13AD; Tue, 13 Aug 2024 16:49:07 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5E7BDC4AF09; Tue, 13 Aug 2024 16:49:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1723567746; bh=m6VisToohIEMIQJQIbU8qwBhwVBuJUfVH2KDYx1eBWQ=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=IDbE0rW91NfgeiyaVSeUG+leSIJD28drSzhjH79F/ohoMaJOx/o3fpMzrt+BoEFOB G0v8LK+bDG2+Hr+7zYY6x5ih92Ie+CpERw0cuiGIeu3PiMHA1d46z+LUJMBqIVRtu3 3PoEHKElKNBWozlUp0IkA9LRyHvVClVf3EsX3Engg+aTJ6Iv4qz6eq7RPUbboIjTDl 1BwIqjkQ/mEPC50dvdAIRC934MPbCEXIzUlibJUdYWtYj9W6USLekd2qTerSuTpOj2 0/drEIfE2neATCFj24azxArhbSvQ7Tmxf59qwmgs20ItEsqJtkLw7/EGHPdaSCYgUn k/dE1cv0npviA== Received: from sofa.misterjones.org ([185.219.108.64] helo=goblin-girl.misterjones.org) by disco-boy.misterjones.org with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1sduhk-003QLJ-AG; Tue, 13 Aug 2024 17:49:04 +0100 Date: Tue, 13 Aug 2024 17:49:04 +0100 Message-ID: <86wmkkz7un.wl-maz@kernel.org> From: Marc Zyngier To: Breno Leitao Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, netdev@vger.kernel.org, Sunil Goutham , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni Subject: Re: [PATCH net] net: thunder_bgx: Fix netdev structure allocation In-Reply-To: References: <20240812141322.1742918-1-maz@kernel.org> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue) FLIM-LB/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL-LB/10.8 EasyPG/1.0.0 Emacs/29.4 (aarch64-unknown-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset=US-ASCII X-SA-Exim-Connect-IP: 185.219.108.64 X-SA-Exim-Rcpt-To: leitao@debian.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, netdev@vger.kernel.org, sgoutham@marvell.com, davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com X-SA-Exim-Mail-From: maz@kernel.org X-SA-Exim-Scanned: No (on disco-boy.misterjones.org); SAEximRunCond expanded to false X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240813_094909_965008_1C9539C9 X-CRM114-Status: GOOD ( 26.68 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Tue, 13 Aug 2024 17:25:27 +0100, Breno Leitao wrote: > > Hello Marc, > > On Mon, Aug 12, 2024 at 03:13:22PM +0100, Marc Zyngier wrote: > > Commit 94833addfaba ("net: thunderx: Unembed netdev structure") had > > a go at dynamically allocating the netdev structures for the thunderx_bgx > > driver. This change results in my ThunderX box catching fire (to be fair, > > it is what it does best). > > Should I be proud of it? :-) It's always good practice to check that someone still cares about terrible HW. Break it, wait for a few releases, and purge it if nobody was looking. Unfortunately, this is one of the few machines I have that has 16kB page support, so I can't really turn a blind eye on the breakage... ;-) > > > The issues with this change are that: > > > > - bgx_lmac_enable() is called *after* bgx_acpi_register_phy() and > > bgx_init_of_phy(), both expecting netdev to be a valid pointer. > > > > - bgx_init_of_phy() populates the MAC addresses for *all* LMACs > > attached to a given BGX instance, and thus needs netdev for each of > > them to have been allocated. > > > > There is a few things to be said about how the driver mixes LMAC and > > BGX states which leads to this sorry state, but that's beside the point. > > > > To address this, go back to a situation where all netdev structures > > are allocated before the driver starts relying on them, and move the > > freeing of these structures to driver removal. Someone brave enough > > can always go and restructure the driver if they want. > > > > Fixes: 94833addfaba ("net: thunderx: Unembed netdev structure") > > Signed-off-by: Marc Zyngier > > Reviewed-by: Breno Leitao > > Thanks for taming my fiery commit. No worries. Thanks, M. -- Without deviation from the norm, progress is not possible.