]> git.baikalelectronics.ru Git - kernel.git/commit
nfp: don't wait for resources indefinitely
authorJakub Kicinski <jakub.kicinski@netronome.com>
Mon, 29 May 2017 00:53:01 +0000 (17:53 -0700)
committerDavid S. Miller <davem@davemloft.net>
Tue, 30 May 2017 15:27:06 +0000 (11:27 -0400)
commit8b35f83935e10d9cdcdaecd655fbdd89b7126c3d
treea1727e6edd57cb54c7543020b825a1b5828437dd
parente49b993b48fccce2288c3f27f0bed826a699351b
nfp: don't wait for resources indefinitely

There is currently no timeout to the resource and lock acquiring
loops.  We printed warnings and depended on user sending a signal
to the waiting process to stop the waiting.  This doesn't work
very well when wait happens out of a work queue.  The simplest
example of that is PCI probe.  When user loads the module and card
is in a broken state modprobe will wait forever and signals sent
to it will not actually reach the probing thread.

Make sure all wait loops have a time out.  Set the upper wait time
to 60 seconds to stay on the safe side.

Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/netronome/nfp/nfpcore/nfp_cpp.h
drivers/net/ethernet/netronome/nfp/nfpcore/nfp_mutex.c
drivers/net/ethernet/netronome/nfp/nfpcore/nfp_resource.c