Because it is not a Rmw operation, atomic_set() is not serialized,
and therefore the 'upgradable' smp_mb__after_atomic() call after
the atomic_set() is completely bogus (not to mention the comment
could also use some love, but that's a different matter).

This patch replaces these with smp_mb(), which seems like the
original intent of when the code was written.

Signed-off-by: Davidlohr Bueso <dbu...@suse.de>
---
 drivers/crypto/cavium/nitrox/nitrox_main.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/crypto/cavium/nitrox/nitrox_main.c 
b/drivers/crypto/cavium/nitrox/nitrox_main.c
index bc924980e10c..da2e0edceb50 100644
--- a/drivers/crypto/cavium/nitrox/nitrox_main.c
+++ b/drivers/crypto/cavium/nitrox/nitrox_main.c
@@ -504,7 +504,7 @@ static int nitrox_probe(struct pci_dev *pdev,
 
        atomic_set(&ndev->state, __NDEV_READY);
        /* barrier to sync with other cpus */
-       smp_mb__after_atomic();
+       smp_mb();
 
        err = nitrox_crypto_register();
        if (err)
@@ -551,7 +551,7 @@ static void nitrox_remove(struct pci_dev *pdev)
 
        atomic_set(&ndev->state, __NDEV_NOT_READY);
        /* barrier to sync with other cpus */
-       smp_mb__after_atomic();
+       smp_mb();
 
        nitrox_remove_from_devlist(ndev);
 
-- 
2.16.4

Reply via email to