linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Vishal Chourasia <vishalc@linux.ibm.com>
To: linuxppc-dev@lists.ozlabs.org
Cc: Herbert Xu <herbert@gondor.apana.org.au>,
	"David S. Miller" <davem@davemloft.net>,
	Michael Ellerman <mpe@ellerman.id.au>,
	Nicholas Piggin <npiggin@gmail.com>,
	Christophe Leroy <christophe.leroy@csgroup.eu>,
	Naveen N Rao <naveen@kernel.org>,
	Madhavan Srinivasan <maddy@linux.ibm.com>,
	linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH] crypto/nx: Rename devdata_mutex to devdata_spinlock
Date: Mon, 14 Oct 2024 10:50:15 +0530	[thread overview]
Message-ID: <ZwyqD-w5hEhrnqTB@linux.ibm.com> (raw)

Rename devdata_mutex to devdata_spinlock to accurately reflect its
implementation as a spinlock.

Signed-off-by: Vishal Chourasia <vishalc@linux.ibm.com>
---
 drivers/crypto/nx/nx-common-pseries.c | 34 +++++++++++++--------------
 1 file changed, 17 insertions(+), 17 deletions(-)

diff --git a/drivers/crypto/nx/nx-common-pseries.c b/drivers/crypto/nx/nx-common-pseries.c
index 35f2d0d8507ed..a0eb900383af7 100644
--- a/drivers/crypto/nx/nx-common-pseries.c
+++ b/drivers/crypto/nx/nx-common-pseries.c
@@ -133,7 +133,7 @@ struct nx842_devdata {
 };

 static struct nx842_devdata __rcu *devdata;
-static DEFINE_SPINLOCK(devdata_mutex);
+static DEFINE_SPINLOCK(devdata_spinlock);

 #define NX842_COUNTER_INC(_x) \
 static inline void nx842_inc_##_x( \
@@ -750,15 +750,15 @@ static int nx842_OF_upd(struct property *new_prop)
        if (!new_devdata)
                return -ENOMEM;

-       spin_lock_irqsave(&devdata_mutex, flags);
+       spin_lock_irqsave(&devdata_spinlock, flags);
        old_devdata = rcu_dereference_check(devdata,
-                       lockdep_is_held(&devdata_mutex));
+                       lockdep_is_held(&devdata_spinlock));
        if (old_devdata)
                of_node = old_devdata->dev->of_node;

        if (!old_devdata || !of_node) {
                pr_err("%s: device is not available\n", __func__);
-               spin_unlock_irqrestore(&devdata_mutex, flags);
+               spin_unlock_irqrestore(&devdata_spinlock, flags);
                kfree(new_devdata);
                return -ENODEV;
        }
@@ -810,7 +810,7 @@ static int nx842_OF_upd(struct property *new_prop)
                        old_devdata->max_sg_len);

        rcu_assign_pointer(devdata, new_devdata);
-       spin_unlock_irqrestore(&devdata_mutex, flags);
+       spin_unlock_irqrestore(&devdata_spinlock, flags);
        synchronize_rcu();
        dev_set_drvdata(new_devdata->dev, new_devdata);
        kfree(old_devdata);
@@ -821,13 +821,13 @@ static int nx842_OF_upd(struct property *new_prop)
                dev_info(old_devdata->dev, "%s: device disabled\n", __func__);
                nx842_OF_set_defaults(new_devdata);
                rcu_assign_pointer(devdata, new_devdata);
-               spin_unlock_irqrestore(&devdata_mutex, flags);
+               spin_unlock_irqrestore(&devdata_spinlock, flags);
                synchronize_rcu();
                dev_set_drvdata(new_devdata->dev, new_devdata);
                kfree(old_devdata);
        } else {
                dev_err(old_devdata->dev, "%s: could not update driver from hardware\n", __func__);
-               spin_unlock_irqrestore(&devdata_mutex, flags);
+               spin_unlock_irqrestore(&devdata_spinlock, flags);
        }

        if (!ret)
@@ -1045,9 +1045,9 @@ static int nx842_probe(struct vio_dev *viodev,
                return -ENOMEM;
        }

-       spin_lock_irqsave(&devdata_mutex, flags);
+       spin_lock_irqsave(&devdata_spinlock, flags);
        old_devdata = rcu_dereference_check(devdata,
-                       lockdep_is_held(&devdata_mutex));
+                       lockdep_is_held(&devdata_spinlock));

        if (old_devdata && old_devdata->vdev != NULL) {
                dev_err(&viodev->dev, "%s: Attempt to register more than one instance of the hardware\n", __func__);
@@ -1062,7 +1062,7 @@ static int nx842_probe(struct vio_dev *viodev,
        nx842_OF_set_defaults(new_devdata);

        rcu_assign_pointer(devdata, new_devdata);
-       spin_unlock_irqrestore(&devdata_mutex, flags);
+       spin_unlock_irqrestore(&devdata_spinlock, flags);
        synchronize_rcu();
        kfree(old_devdata);

@@ -1101,7 +1101,7 @@ static int nx842_probe(struct vio_dev *viodev,
        return 0;

 error_unlock:
-       spin_unlock_irqrestore(&devdata_mutex, flags);
+       spin_unlock_irqrestore(&devdata_spinlock, flags);
        if (new_devdata)
                kfree(new_devdata->counters);
        kfree(new_devdata);
@@ -1122,12 +1122,12 @@ static void nx842_remove(struct vio_dev *viodev)

        crypto_unregister_alg(&nx842_pseries_alg);

-       spin_lock_irqsave(&devdata_mutex, flags);
+       spin_lock_irqsave(&devdata_spinlock, flags);
        old_devdata = rcu_dereference_check(devdata,
-                       lockdep_is_held(&devdata_mutex));
+                       lockdep_is_held(&devdata_spinlock));
        of_reconfig_notifier_unregister(&nx842_of_nb);
        RCU_INIT_POINTER(devdata, NULL);
-       spin_unlock_irqrestore(&devdata_mutex, flags);
+       spin_unlock_irqrestore(&devdata_spinlock, flags);
        synchronize_rcu();
        dev_set_drvdata(&viodev->dev, NULL);
        if (old_devdata)
@@ -1257,11 +1257,11 @@ static void __exit nx842_pseries_exit(void)

        crypto_unregister_alg(&nx842_pseries_alg);

-       spin_lock_irqsave(&devdata_mutex, flags);
+       spin_lock_irqsave(&devdata_spinlock, flags);
        old_devdata = rcu_dereference_check(devdata,
-                       lockdep_is_held(&devdata_mutex));
+                       lockdep_is_held(&devdata_spinlock));
        RCU_INIT_POINTER(devdata, NULL);
-       spin_unlock_irqrestore(&devdata_mutex, flags);
+       spin_unlock_irqrestore(&devdata_spinlock, flags);
        synchronize_rcu();
        if (old_devdata && old_devdata->dev)
                dev_set_drvdata(old_devdata->dev, NULL);
--
2.47.0



                 reply	other threads:[~2024-10-14  5:20 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ZwyqD-w5hEhrnqTB@linux.ibm.com \
    --to=vishalc@linux.ibm.com \
    --cc=christophe.leroy@csgroup.eu \
    --cc=davem@davemloft.net \
    --cc=herbert@gondor.apana.org.au \
    --cc=linux-crypto@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=maddy@linux.ibm.com \
    --cc=mpe@ellerman.id.au \
    --cc=naveen@kernel.org \
    --cc=npiggin@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).