summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZiqi Chen <quic_ziqichen@quicinc.com>2023-07-11 16:48:46 +0800
committerMartin K. Petersen <martin.petersen@oracle.com>2023-07-23 15:24:49 -0400
commitf52a805e19b169989ec6c61254529b273a18116d (patch)
treee48e6ccc8f9f4a2900a67cdeead59469773c0b23
parent8f2b78652d0552e157a0b9cd354f2e5c20ba98ca (diff)
downloadlwn-f52a805e19b169989ec6c61254529b273a18116d.tar.gz
lwn-f52a805e19b169989ec6c61254529b273a18116d.zip
scsi: ufs: qcom: Hold the mutex lock when configuring ESI
Lock the MSI descriptor storage of a device when configuring ESI. Otherwise we would see warnings during boot. Signed-off-by: Ziqi Chen <quic_ziqichen@quicinc.com> Link: https://lore.kernel.org/r/1689065327-45039-1-git-send-email-quic_ziqichen@quicinc.com Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
-rw-r--r--drivers/ufs/host/ufs-qcom.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/ufs/host/ufs-qcom.c b/drivers/ufs/host/ufs-qcom.c
index f36bcdbea938..d29e63e4a4f8 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 &&