From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 938163D78 for ; Tue, 13 Jun 2023 09:09:25 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4BAFAC433D2; Tue, 13 Jun 2023 09:09:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1686647365; bh=5YoMjA68JolkA23tLh+BPZF4o/5QE2j9cjaqVqI4d5E=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=rj5LIfec0am42M8Rohetf9F4Wh7ksPeTVerXiuQO1FN/DOUjv301rfoK72wJn0kla ut7+9Jj+EcqGfHgkl9CFI/kBiqcy6yZ8Fu/5P8hpaxcQtFH1Iba+ZxLWRK3wXVKk9H wxMkY2z2PK8K+2y4JZjXzkTmUl/OtFbLLMqVzL4AR5+YH/gk/oJBr0laKYmUbK5OOi +WchMpRzXR4L82Fkzg0cQkQkne2kbAUaQQkNW9lweHmbMlF2OyQIX7ZroqYbjiSVJ0 0/d4rymkExK2kaFn+WB9taa+MfqlCZXPlRkOh54Mdxq6AIZ6EMo2LGX+zlNKqmdIOF JvTxeA2K91lKQ== Date: Tue, 13 Jun 2023 12:09:20 +0300 From: Leon Romanovsky To: Vladimir Oltean Cc: Maciej Fijalkowski , Asmaa Mnebhi , davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, netdev@vger.kernel.org, cai.huoqing@linux.dev, brgl@bgdev.pl, chenhao288@hisilicon.com, huangguangbin2@huawei.com, David Thompson Subject: Re: [PATCH net v2 1/1] mlxbf_gige: Fix kernel panic at shutdown Message-ID: <20230613090920.GW12152@unreal> References: <20230611181125.GJ12152@unreal> <20230612115925.GR12152@unreal> <20230612123718.u6cfggybbtx4owbq@skbuf> <20230612131707.GS12152@unreal> <20230612132841.xcrlmfhzhu5qazgk@skbuf> <20230612133853.GT12152@unreal> <20230612140521.tzhgliaok5u3q67o@skbuf> <20230613071959.GU12152@unreal> <20230613083002.pjzsno2tzbewej7o@skbuf> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230613083002.pjzsno2tzbewej7o@skbuf> On Tue, Jun 13, 2023 at 11:30:02AM +0300, Vladimir Oltean wrote: > On Tue, Jun 13, 2023 at 10:19:59AM +0300, Leon Romanovsky wrote: > > But once child finishes device_shutdown(), it will be removed from devices_kset > > list and dev->driver should be NULL at that point for the child. > > What piece of code would make dev->driver be NULL for devices that have > been shut down by device_shutdown()? You are right here and I'm wrong on that point, dev->driver is set to NULL in all other places where the device is going to be reused and not in device_shutdown(). Unfortunately, it doesn't change a lot in our conversation, as device_shutdown() is very specific call which is called in two flows: kernel_halt() and kernel_restart(). In both flows, it is end game. Thanks