[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20210720133153.0f13c92a@cakuba>
Date: Tue, 20 Jul 2021 13:31:53 +0200
From: Jakub Kicinski <kuba@...nel.org>
To: Tony Nguyen <anthony.l.nguyen@...el.com>
Cc: davem@...emloft.net, Stefan Assmann <sassmann@...nic.de>,
netdev@...r.kernel.org,
Konrad Jankowski <konrad0.jankowski@...el.com>
Subject: Re: [PATCH net-next 3/3] iavf: fix locking of critical sections
On Mon, 19 Jul 2021 09:31:54 -0700, Tony Nguyen wrote:
> To avoid races between iavf_init_task(), iavf_reset_task(),
> iavf_watchdog_task(), iavf_adminq_task() as well as the shutdown and
> remove functions more locking is required.
> The current protection by __IAVF_IN_CRITICAL_TASK is needed in
> additional places.
>
> - The reset task performs state transitions, therefore needs locking.
> - The adminq task acts on replies from the PF in
> iavf_virtchnl_completion() which may alter the states.
> - The init task is not only run during probe but also if a VF gets stuck
> to reinitialize it.
> - The shutdown function performs a state transition.
> - The remove function performs a state transition and also free's
> resources.
>
> iavf_lock_timeout() is introduced to avoid waiting infinitely
> and cause a deadlock. Rather unlock and print a warning.
I have a vague recollection of complaining about something like this
previously. Why not use a normal lock? Please at the very least include
an explanation in the commit message.
If you use bit locks you should use the _lock and _unlock flavours of
the bitops.
Powered by blists - more mailing lists