[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <DM8PR11MB562163A58A2B970434338D2EAB7A9@DM8PR11MB5621.namprd11.prod.outlook.com>
Date: Fri, 2 Sep 2022 06:05:28 +0000
From: "Jankowski, Konrad0" <konrad0.jankowski@...el.com>
To: ivecera <ivecera@...hat.com>,
"netdev@...r.kernel.org" <netdev@...r.kernel.org>
CC: Paolo Abeni <pabeni@...hat.com>,
Eric Dumazet <edumazet@...gle.com>,
"moderated list:INTEL ETHERNET DRIVERS"
<intel-wired-lan@...ts.osuosl.org>,
open list <linux-kernel@...r.kernel.org>,
"Piotrowski, Patryk" <patryk.piotrowski@...el.com>,
Jeff Kirsher <jeffrey.t.kirsher@...el.com>,
Jakub Kicinski <kuba@...nel.org>,
Vitaly Grinberg <vgrinber@...hat.com>,
"David S. Miller" <davem@...emloft.net>
Subject: RE: [Intel-wired-lan] [PATCH net v2] iavf: Detach device during reset
task
> -----Original Message-----
> From: Intel-wired-lan <intel-wired-lan-bounces@...osl.org> On Behalf Of
> Ivan Vecera
> Sent: Tuesday, August 30, 2022 10:16 AM
> To: netdev@...r.kernel.org
> Cc: Paolo Abeni <pabeni@...hat.com>; Eric Dumazet
> <edumazet@...gle.com>; moderated list:INTEL ETHERNET DRIVERS <intel-
> wired-lan@...ts.osuosl.org>; open list <linux-kernel@...r.kernel.org>;
> Piotrowski, Patryk <patryk.piotrowski@...el.com>; Jeff Kirsher
> <jeffrey.t.kirsher@...el.com>; Jakub Kicinski <kuba@...nel.org>; Vitaly
> Grinberg <vgrinber@...hat.com>; David S. Miller <davem@...emloft.net>
> Subject: [Intel-wired-lan] [PATCH net v2] iavf: Detach device during reset
> task
>
> iavf_reset_task() takes crit_lock at the beginning and holds it during whole
> call. The function subsequently calls
> iavf_init_interrupt_scheme() that grabs RTNL. Problem occurs when
> userspace initiates during the reset task any ndo callback that runs under
> RTNL like iavf_open() because some of that functions tries to take crit_lock.
> This leads to classic A-B B-A deadlock scenario.
>
> To resolve this situation the device should be detached in
> iavf_reset_task() prior taking crit_lock to avoid subsequent ndos running
> under RTNL and reattach the device at the end.
>
> Fixes: 62fe2a865e6d ("i40evf: add missing rtnl_lock() around
> i40evf_set_interrupt_capability")
> Cc: Jacob Keller <jacob.e.keller@...el.com>
> Cc: Patryk Piotrowski <patryk.piotrowski@...el.com>
> Cc: SlawomirX Laba <slawomirx.laba@...el.com>
> Tested-by: Vitaly Grinberg <vgrinber@...hat.com>
> Signed-off-by: Ivan Vecera <ivecera@...hat.com>
> ---
> drivers/net/ethernet/intel/iavf/iavf_main.c | 14 +++++++++++---
> 1 file changed, 11 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/net/ethernet/intel/iavf/iavf_main.c
> b/drivers/net/ethernet/intel/iavf/iavf_main.c
> index f39440ad5c50..10aa99dfdcdb 100644
> --- a/drivers/net/ethernet/intel/iavf/iavf_main.c
> +++ b/drivers/net/ethernet/intel/iavf/iavf_main.c
Tested-by: Konrad Jankowski <konrad0.jankowski@...el.com>
Powered by blists - more mailing lists