public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Sasha Levin <sashal@kernel.org>
To: linux-kernel@vger.kernel.org, stable@vger.kernel.org
Cc: Kiwoong Kim <kwmad.kim@samsung.com>,
	Bart Van Assche <bvanassche@acm.org>,
	Chanwoo Lee <cw9316.lee@samsung.com>,
	"Martin K . Petersen" <martin.petersen@oracle.com>,
	Sasha Levin <sashal@kernel.org>,
	jejb@linux.ibm.com, linux-scsi@vger.kernel.org
Subject: [PATCH AUTOSEL 5.15 06/18] scsi: ufs: core: Move __ufshcd_send_uic_cmd() outside host_lock
Date: Sun, 24 Sep 2023 09:18:43 -0400	[thread overview]
Message-ID: <20230924131857.1276330-6-sashal@kernel.org> (raw)
In-Reply-To: <20230924131857.1276330-1-sashal@kernel.org>

From: Kiwoong Kim <kwmad.kim@samsung.com>

[ Upstream commit 2d3f59cf868b4a2dd678a96cd49bdd91411bd59f ]

__ufshcd_send_uic_cmd() is wrapped by uic_cmd_mutex and its related
contexts are accessed within the section wrapped by uic_cmd_mutex. Thus,
wrapping with host_lock is redundant.

Signed-off-by: Kiwoong Kim <kwmad.kim@samsung.com>
Link: https://lore.kernel.org/r/782ba5f26f0a96e58d85dff50751787d2d2a6b2b.1693790060.git.kwmad.kim@samsung.com
Reviewed-by: Bart Van Assche <bvanassche@acm.org>
Reviewed-by: Chanwoo Lee <cw9316.lee@samsung.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/scsi/ufs/ufshcd.c | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c
index d00d263705e15..f48036f09eab5 100644
--- a/drivers/scsi/ufs/ufshcd.c
+++ b/drivers/scsi/ufs/ufshcd.c
@@ -2309,7 +2309,6 @@ __ufshcd_send_uic_cmd(struct ufs_hba *hba, struct uic_command *uic_cmd,
 		      bool completion)
 {
 	lockdep_assert_held(&hba->uic_cmd_mutex);
-	lockdep_assert_held(hba->host->host_lock);
 
 	if (!ufshcd_ready_for_uic_cmd(hba)) {
 		dev_err(hba->dev,
@@ -2336,15 +2335,12 @@ __ufshcd_send_uic_cmd(struct ufs_hba *hba, struct uic_command *uic_cmd,
 int ufshcd_send_uic_cmd(struct ufs_hba *hba, struct uic_command *uic_cmd)
 {
 	int ret;
-	unsigned long flags;
 
 	ufshcd_hold(hba, false);
 	mutex_lock(&hba->uic_cmd_mutex);
 	ufshcd_add_delay_before_dme_cmd(hba);
 
-	spin_lock_irqsave(hba->host->host_lock, flags);
 	ret = __ufshcd_send_uic_cmd(hba, uic_cmd, true);
-	spin_unlock_irqrestore(hba->host->host_lock, flags);
 	if (!ret)
 		ret = ufshcd_wait_for_uic_cmd(hba, uic_cmd);
 
@@ -3967,8 +3963,8 @@ static int ufshcd_uic_pwr_ctrl(struct ufs_hba *hba, struct uic_command *cmd)
 		wmb();
 		reenable_intr = true;
 	}
-	ret = __ufshcd_send_uic_cmd(hba, cmd, false);
 	spin_unlock_irqrestore(hba->host->host_lock, flags);
+	ret = __ufshcd_send_uic_cmd(hba, cmd, false);
 	if (ret) {
 		dev_err(hba->dev,
 			"pwr ctrl cmd 0x%x with mode 0x%x uic error %d\n",
-- 
2.40.1


  parent reply	other threads:[~2023-09-24 13:29 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-24 13:18 [PATCH AUTOSEL 5.15 01/18] parisc: sba: Fix compile warning wrt list of SBA devices Sasha Levin
2023-09-24 13:18 ` [PATCH AUTOSEL 5.15 02/18] parisc: iosapic.c: Fix sparse warnings Sasha Levin
2023-09-24 13:18 ` [PATCH AUTOSEL 5.15 03/18] parisc: drivers: Fix sparse warning Sasha Levin
2023-09-24 13:18 ` [PATCH AUTOSEL 5.15 04/18] parisc: irq: Make irq_stack_union static to avoid " Sasha Levin
2023-09-24 13:18 ` [PATCH AUTOSEL 5.15 05/18] scsi: qedf: Add synchronization between I/O completions and abort Sasha Levin
2023-09-24 13:18 ` Sasha Levin [this message]
2023-09-24 13:18 ` [PATCH AUTOSEL 5.15 07/18] selftests/ftrace: Correctly enable event in instance-event.tc Sasha Levin
2023-09-24 13:18 ` [PATCH AUTOSEL 5.15 08/18] ring-buffer: Avoid softlockup in ring_buffer_resize() Sasha Levin
2023-09-24 13:18 ` [PATCH AUTOSEL 5.15 09/18] btrfs: improve error message after failure to add delayed dir index item Sasha Levin
2023-09-24 13:18 ` [PATCH AUTOSEL 5.15 10/18] selftests: fix dependency checker script Sasha Levin
2023-09-24 13:18 ` [PATCH AUTOSEL 5.15 11/18] ring-buffer: Do not attempt to read past "commit" Sasha Levin
2023-09-24 13:18 ` [PATCH AUTOSEL 5.15 12/18] platform/mellanox: mlxbf-bootctl: add NET dependency into Kconfig Sasha Levin
2023-09-24 13:18 ` [PATCH AUTOSEL 5.15 13/18] drm/amd/display: Don't check registers, if using AUX BL control Sasha Levin
2023-09-24 13:18 ` [PATCH AUTOSEL 5.15 14/18] drm/amdgpu: Handle null atom context in VBIOS info ioctl Sasha Levin
2023-09-24 13:18 ` [PATCH AUTOSEL 5.15 15/18] scsi: pm80xx: Use phy-specific SAS address when sending PHY_START command Sasha Levin
2023-09-24 13:18 ` [PATCH AUTOSEL 5.15 16/18] scsi: pm80xx: Avoid leaking tags when processing OPC_INB_SET_CONTROLLER_CONFIG command Sasha Levin
2023-09-24 13:18 ` [PATCH AUTOSEL 5.15 17/18] smb3: correct places where ENOTSUPP is used instead of preferred EOPNOTSUPP Sasha Levin
2023-09-24 13:18 ` [PATCH AUTOSEL 5.15 18/18] ata: libata-eh: do not clear ATA_PFLAG_EH_PENDING in ata_eh_reset() Sasha Levin

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=20230924131857.1276330-6-sashal@kernel.org \
    --to=sashal@kernel.org \
    --cc=bvanassche@acm.org \
    --cc=cw9316.lee@samsung.com \
    --cc=jejb@linux.ibm.com \
    --cc=kwmad.kim@samsung.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=martin.petersen@oracle.com \
    --cc=stable@vger.kernel.org \
    /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