nfp: fail graciously when someone tries to grab global lock
authorJakub Kicinski <jakub.kicinski@netronome.com>
Wed, 22 Mar 2017 00:59:08 +0000 (17:59 -0700)
committerDavid S. Miller <davem@davemloft.net>
Wed, 22 Mar 2017 19:59:06 +0000 (12:59 -0700)
commitf1ba63ec9073d5f270efde4cd86d811a441d54d0
tree2e1a13122c66cc55fd883d309688cfe1ddd93279
parent3d4fc6eb4bc15cd81a150b065494f0e67d2493c0
nfp: fail graciously when someone tries to grab global lock

The global device lock is acquired to search the resource table.
The lock is actually itself part of the table (entry 0).
Therefore if someone asks for resource 0 we would deadlock since
double locking is no longer allowed.

Currently the driver doesn't try to lock that resource so let's
simply make sure we fail graciously and not add special handling
of this case until really need.  Hide the relevant defines in
the source file.

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.h
drivers/net/ethernet/netronome/nfp/nfpcore/nfp_resource.c