summaryrefslogtreecommitdiff
path: root/drivers/net/ethernet/netronome/nfp/nfpcore
diff options
context:
space:
mode:
authorJakub Kicinski <jakub.kicinski@netronome.com>2017-03-21 17:59:07 -0700
committerDavid S. Miller <davem@davemloft.net>2017-03-22 12:59:06 -0700
commit3d4fc6eb4bc15cd81a150b065494f0e67d2493c0 (patch)
treea3eb5da2f54c90c77e13d2f226ee6b8fb32e73cf /drivers/net/ethernet/netronome/nfp/nfpcore
parent31c7ba9eff5d8a9f20057082eb44cc3c6a1fb3d6 (diff)
downloadlwn-3d4fc6eb4bc15cd81a150b065494f0e67d2493c0.tar.gz
lwn-3d4fc6eb4bc15cd81a150b065494f0e67d2493c0.zip
nfp: disallow sharing mutexes on the same machine
NFP can be connected to multiple machines via PCI or other buses. Access to hardware resources is arbitrated using locks residing in device memory. Currently nfpcore only respects the mutexes when it comes to inter-host locking, but if we try to acquire the same lock again, on one host - it will simply return success because owner of the lock is already set to that host. This makes the locks useless for arbitration within one host and unfair because whichever host grabbed the lock will have a chance to reacquire it without others getting a shot. Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/netronome/nfp/nfpcore')
-rw-r--r--drivers/net/ethernet/netronome/nfp/nfpcore/nfp_cppcore.c6
1 files changed, 0 insertions, 6 deletions
diff --git a/drivers/net/ethernet/netronome/nfp/nfpcore/nfp_cppcore.c b/drivers/net/ethernet/netronome/nfp/nfpcore/nfp_cppcore.c
index 40108e66c654..e2267b421af0 100644
--- a/drivers/net/ethernet/netronome/nfp/nfpcore/nfp_cppcore.c
+++ b/drivers/net/ethernet/netronome/nfp/nfpcore/nfp_cppcore.c
@@ -1736,11 +1736,5 @@ int nfp_cpp_mutex_trylock(struct nfp_cpp_mutex *mutex)
return 0;
}
- /* Already locked by us? Success! */
- if (tmp == value) {
- mutex->depth = 1;
- return 0;
- }
-
return nfp_mutex_is_locked(tmp) ? -EBUSY : -EINVAL;
}