Skip to content

Commit 0ae7a02

Browse files
Mani-Sadhasivammartinkpetersen
authored andcommitted
scsi: ufs: qcom: Export ufshcd_{enable/disable}_irq helpers and make use of them
Instead of duplicating the enable/disable IRQ part, let's export the helpers available in ufshcd driver and make use of them. This also fixes the possible redundant IRQ disable before asserting reset (when IRQ was already disabled). Fixes: 4a79157 ("scsi: ufs: ufs-qcom: Disable interrupt in reset path") Reviewed-by: Bart Van Assche <bvanassche@acm.org> Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org> Link: https://lore.kernel.org/r/20231208065902.11006-7-manivannan.sadhasivam@linaro.org Tested-by: Andrew Halaney <ahalaney@redhat.com> # sa8775p-ride Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
1 parent d42d368 commit 0ae7a02

3 files changed

Lines changed: 9 additions & 8 deletions

File tree

drivers/ufs/core/ufshcd.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -289,21 +289,23 @@ static void ufshcd_wb_toggle_buf_flush_during_h8(struct ufs_hba *hba,
289289
static void ufshcd_hba_vreg_set_lpm(struct ufs_hba *hba);
290290
static void ufshcd_hba_vreg_set_hpm(struct ufs_hba *hba);
291291

292-
static inline void ufshcd_enable_irq(struct ufs_hba *hba)
292+
void ufshcd_enable_irq(struct ufs_hba *hba)
293293
{
294294
if (!hba->is_irq_enabled) {
295295
enable_irq(hba->irq);
296296
hba->is_irq_enabled = true;
297297
}
298298
}
299+
EXPORT_SYMBOL_GPL(ufshcd_enable_irq);
299300

300-
static inline void ufshcd_disable_irq(struct ufs_hba *hba)
301+
void ufshcd_disable_irq(struct ufs_hba *hba)
301302
{
302303
if (hba->is_irq_enabled) {
303304
disable_irq(hba->irq);
304305
hba->is_irq_enabled = false;
305306
}
306307
}
308+
EXPORT_SYMBOL_GPL(ufshcd_disable_irq);
307309

308310
static void ufshcd_configure_wb(struct ufs_hba *hba)
309311
{

drivers/ufs/host/ufs-qcom.c

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -300,8 +300,7 @@ static int ufs_qcom_host_reset(struct ufs_hba *hba)
300300
return 0;
301301

302302
reenable_intr = hba->is_irq_enabled;
303-
disable_irq(hba->irq);
304-
hba->is_irq_enabled = false;
303+
ufshcd_disable_irq(hba);
305304

306305
ret = reset_control_assert(host->core_reset);
307306
if (ret) {
@@ -324,10 +323,8 @@ static int ufs_qcom_host_reset(struct ufs_hba *hba)
324323

325324
usleep_range(1000, 1100);
326325

327-
if (reenable_intr) {
328-
enable_irq(hba->irq);
329-
hba->is_irq_enabled = true;
330-
}
326+
if (reenable_intr)
327+
ufshcd_enable_irq(hba);
331328

332329
return 0;
333330
}

include/ufs/ufshcd.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1231,6 +1231,8 @@ static inline void ufshcd_rmwl(struct ufs_hba *hba, u32 mask, u32 val, u32 reg)
12311231
ufshcd_writel(hba, tmp, reg);
12321232
}
12331233

1234+
void ufshcd_enable_irq(struct ufs_hba *hba);
1235+
void ufshcd_disable_irq(struct ufs_hba *hba);
12341236
int ufshcd_alloc_host(struct device *, struct ufs_hba **);
12351237
void ufshcd_dealloc_host(struct ufs_hba *);
12361238
int ufshcd_hba_enable(struct ufs_hba *hba);

0 commit comments

Comments
 (0)