]> git.kernelconcepts.de Git - karo-tx-linux.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)
commit9b5655767c6763f0322d8292f3d9dbc43816d22e
treea1727e6edd57cb54c7543020b825a1b5828437dd
parenteefbde7e10026273a81f54ab3b76e959f4f0ef09
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