]> git.baikalelectronics.ru Git - kernel.git/commit
nfp: don't hold PF lock while enabling SR-IOV
authorJakub Kicinski <jakub.kicinski@netronome.com>
Wed, 23 Aug 2017 06:22:42 +0000 (23:22 -0700)
committerDavid S. Miller <davem@davemloft.net>
Thu, 24 Aug 2017 03:39:44 +0000 (20:39 -0700)
commit10106065fec5b07fbf52c4bf79852b2d56cb5efb
tree1cd1a376d6902098d629ba0d83bcad2408064b76
parent7388eb01141f1c2cd03bca5842ee7e5e3003f511
nfp: don't hold PF lock while enabling SR-IOV

Enabling SR-IOV VFs will cause the PCI subsystem to schedule a
work and flush its workqueue.  Since the nfp driver schedules its
own work we can't enable VFs while holding driver load.  Commit
f3eaf992dfac ("nfp: allocate a private workqueue for driver work")
tried to avoid this deadlock by creating a separate workqueue.
Unfortunately, due to the architecture of workqueue subsystem this
does not guarantee a separate thread of execution.  Luckily
we can simply take pci_enable_sriov() from under the driver lock.

Take pci_disable_sriov() from under the lock too for symmetry.

Fixes: f3eaf992dfac ("nfp: allocate a private workqueue for driver work")
Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com>
Reviewed-by: Simon Horman <simon.horman@netronome.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/netronome/nfp/nfp_main.c