linux-arm-msm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v1] scsi: ufs: qcom: Hold the mutex lock when config ESI
@ 2023-07-11  8:48 Ziqi Chen
  2023-07-23 19:25 ` Martin K. Petersen
  0 siblings, 1 reply; 2+ messages in thread
From: Ziqi Chen @ 2023-07-11  8:48 UTC (permalink / raw)
  To: quic_asutoshd, quic_cang, bvanassche, mani, stanley.chu,
	adrian.hunter, beanhuo, avri.altman, junwoo80.lee,
	martin.petersen, quic_ziqichen, quic_nitirawa
  Cc: linux-scsi, Andy Gross, Bjorn Andersson, Konrad Dybcio,
	James E.J. Bottomley, open list:ARM/QUALCOMM SUPPORT, open list

Lock the MSI descriptor storage of a device when config ESI.
Otherwise we would meet plenty of warnings during boot up.

Signed-off-by: Ziqi Chen <quic_ziqichen@quicinc.com>
---
 drivers/ufs/host/ufs-qcom.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/ufs/host/ufs-qcom.c b/drivers/ufs/host/ufs-qcom.c
index f36bcdb..d29e63e 100644
--- a/drivers/ufs/host/ufs-qcom.c
+++ b/drivers/ufs/host/ufs-qcom.c
@@ -1680,6 +1680,7 @@ static int ufs_qcom_config_esi(struct ufs_hba *hba)
 		goto out;
 	}
 
+	msi_lock_descs(hba->dev);
 	msi_for_each_desc(desc, hba->dev, MSI_DESC_ALL) {
 		ret = devm_request_irq(hba->dev, desc->irq,
 				       ufs_qcom_mcq_esi_handler,
@@ -1691,14 +1692,17 @@ static int ufs_qcom_config_esi(struct ufs_hba *hba)
 			break;
 		}
 	}
+	msi_unlock_descs(hba->dev);
 
 	if (ret) {
 		/* Rewind */
+		msi_lock_descs(hba->dev);
 		msi_for_each_desc(desc, hba->dev, MSI_DESC_ALL) {
 			if (desc == failed_desc)
 				break;
 			devm_free_irq(hba->dev, desc->irq, hba);
 		}
+		msi_unlock_descs(hba->dev);
 		platform_msi_domain_free_irqs(hba->dev);
 	} else {
 		if (host->hw_ver.major == 6 && host->hw_ver.minor == 0 &&
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH v1] scsi: ufs: qcom: Hold the mutex lock when config ESI
  2023-07-11  8:48 [PATCH v1] scsi: ufs: qcom: Hold the mutex lock when config ESI Ziqi Chen
@ 2023-07-23 19:25 ` Martin K. Petersen
  0 siblings, 0 replies; 2+ messages in thread
From: Martin K. Petersen @ 2023-07-23 19:25 UTC (permalink / raw)
  To: Ziqi Chen
  Cc: quic_asutoshd, quic_cang, bvanassche, mani, stanley.chu,
	adrian.hunter, beanhuo, avri.altman, junwoo80.lee,
	martin.petersen, quic_nitirawa, linux-scsi, Andy Gross,
	Bjorn Andersson, Konrad Dybcio, James E.J. Bottomley,
	open list:ARM/QUALCOMM SUPPORT, open list


Ziqi,

> Lock the MSI descriptor storage of a device when config ESI. Otherwise
> we would meet plenty of warnings during boot up.

Applied to 6.6/scsi-staging, thanks!

-- 
Martin K. Petersen	Oracle Linux Engineering

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-07-23 19:25 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-07-11  8:48 [PATCH v1] scsi: ufs: qcom: Hold the mutex lock when config ESI Ziqi Chen
2023-07-23 19:25 ` Martin K. Petersen

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).