Re: [PATCH 2/5] ice: retain the adapter throughout hardware initialization and teardown
From: Przemek Kitszel
Date: Thu Nov 26 2026 - 10:06:47 EST
On 10/20/26 11:24 AM, Przemek Kitszel wrote:
On 10/19/26 12:51, Aaron Ma wrote:
Adapter-scoped synchronization must be available to Admin Queue users
from initial queue creation through the last teardown command. Probe
currently obtains its adapter reference only after hardware and package
initialization, and error cleanup and removal drop it before hardware
teardown.
Acquire the reference before either normal hardware initialization or
firmware recovery-mode initialization. Release it after hardware and
device cleanup, balancing recovery-mode probe failures and removal too.
This establishes the lifetime prerequisite for moving package ownership
exclusion from a module-global mutex to the shared adapter.
Signed-off-by: Aaron Ma <aaron.ma@xxxxxxxxxxxxx>
it was me to move hw init before adapter init, to make hw details
readily accessible to the adapter
but I agree that SW lock protection covering HW reinit will be great,
and my needs could be achieved by other means, even if less elegant
so, I'm happy with your patch
OTOH I have a big series that git-conflicts, would be easiest if your
series will be merged first (so I will adjust), but I don't want to be
delayed (will be CCing you on it going forward)
this was merged (just this and 1st patch of the lined series):
https://lore.kernel.org/netdev/20261117094913.100756-3-przemyslaw.kitszel@xxxxxxxxx/
to make your and my needs met, I think the right solution would be to
move ice_hw init/deinit into ice_adapter constructor/destructor
then holding ice_adapter devl lock will be both easy and natural
the "init_param" param of ice_adapter_init() was initially meant for
number of PFs (taken from ice_hw), but I will pass in v8 of my series
ptr to ice_hw
(talking aloud to make it easier for you to base over it and/or comment
early)
the real thing is of course the 3rd patch not this one