Skip to content

Commit a7480fd

Browse files
Merge patch series "Eight small UFS patches"
Bart Van Assche <bvanassche@acm.org> says: Hi Martin, This patch series includes two bug fixes for this development cycle and six small patches that are intended for the next merge window. If applying the first two patches only during the current development cycle would be inconvenient, postponing all patches until the next merge window is fine with me. Please consider including these patches in the upstream kernel. Thanks, Bart. [mkp: Applied patches #1 and #2 to 6.18/scsi-fixes] Link: https://patch.msgid.link/20251014200118.3390839-1-bvanassche@acm.org Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2 parents ea0e278 + bfe5f5d commit a7480fd

File tree

7 files changed

+12
-13
lines changed

7 files changed

+12
-13
lines changed

drivers/ufs/core/ufs-mcq.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -568,12 +568,12 @@ int ufshcd_mcq_sq_cleanup(struct ufs_hba *hba, int task_tag)
568568

569569
id = hwq->id;
570570

571-
mutex_lock(&hwq->sq_mutex);
571+
guard(mutex)(&hwq->sq_mutex);
572572

573573
/* stop the SQ fetching before working on it */
574574
err = ufshcd_mcq_sq_stop(hba, hwq);
575575
if (err)
576-
goto unlock;
576+
return err;
577577

578578
/* SQCTI = EXT_IID, IID, LUN, Task Tag */
579579
nexus = lrbp->lun << 8 | task_tag;
@@ -600,8 +600,6 @@ int ufshcd_mcq_sq_cleanup(struct ufs_hba *hba, int task_tag)
600600
if (ufshcd_mcq_sq_start(hba, hwq))
601601
err = -ETIMEDOUT;
602602

603-
unlock:
604-
mutex_unlock(&hwq->sq_mutex);
605603
return err;
606604
}
607605

drivers/ufs/core/ufs_trace.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@
4242
#define UFS_CMD_TRACE_STRINGS \
4343
EM(UFS_CMD_SEND, "send_req") \
4444
EM(UFS_CMD_COMP, "complete_rsp") \
45-
EM(UFS_DEV_COMP, "dev_complete") \
4645
EM(UFS_QUERY_SEND, "query_send") \
4746
EM(UFS_QUERY_COMP, "query_complete") \
4847
EM(UFS_QUERY_ERR, "query_complete_err") \

drivers/ufs/core/ufs_trace_types.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
enum ufs_trace_str_t {
66
UFS_CMD_SEND,
77
UFS_CMD_COMP,
8-
UFS_DEV_COMP,
98
UFS_QUERY_SEND,
109
UFS_QUERY_COMP,
1110
UFS_QUERY_ERR,

drivers/ufs/core/ufshcd-priv.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
#include <linux/pm_runtime.h>
77
#include <ufs/ufshcd.h>
88

9+
void ufshcd_enable_intr(struct ufs_hba *hba, u32 intrs);
10+
911
static inline bool ufshcd_is_user_access_allowed(struct ufs_hba *hba)
1012
{
1113
return !hba->shutting_down;

drivers/ufs/core/ufshcd.c

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2619,7 +2619,7 @@ __ufshcd_send_uic_cmd(struct ufs_hba *hba, struct uic_command *uic_cmd)
26192619

26202620
init_completion(&uic_cmd->done);
26212621

2622-
uic_cmd->cmd_active = 1;
2622+
uic_cmd->cmd_active = true;
26232623
ufshcd_dispatch_uic_cmd(hba, uic_cmd);
26242624

26252625
return 0;
@@ -5582,7 +5582,7 @@ static irqreturn_t ufshcd_uic_cmd_compl(struct ufs_hba *hba, u32 intr_status)
55825582
guard(spinlock_irqsave)(hba->host->host_lock);
55835583
cmd = hba->active_uic_cmd;
55845584
if (!cmd)
5585-
goto unlock;
5585+
return retval;
55865586

55875587
if (ufshcd_is_auto_hibern8_error(hba, intr_status))
55885588
hba->errors |= (UFSHCD_UIC_HIBERN8_MASK & intr_status);
@@ -5591,21 +5591,20 @@ static irqreturn_t ufshcd_uic_cmd_compl(struct ufs_hba *hba, u32 intr_status)
55915591
cmd->argument2 |= ufshcd_get_uic_cmd_result(hba);
55925592
cmd->argument3 = ufshcd_get_dme_attr_val(hba);
55935593
if (!hba->uic_async_done)
5594-
cmd->cmd_active = 0;
5594+
cmd->cmd_active = false;
55955595
complete(&cmd->done);
55965596
retval = IRQ_HANDLED;
55975597
}
55985598

55995599
if (intr_status & UFSHCD_UIC_PWR_MASK && hba->uic_async_done) {
5600-
cmd->cmd_active = 0;
5600+
cmd->cmd_active = false;
56015601
complete(hba->uic_async_done);
56025602
retval = IRQ_HANDLED;
56035603
}
56045604

56055605
if (retval == IRQ_HANDLED)
56065606
ufshcd_add_uic_command_trace(hba, cmd, UFS_CMD_COMP);
56075607

5608-
unlock:
56095608
return retval;
56105609
}
56115610

include/ufs/ufshcd.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ struct uic_command {
7878
const u32 argument1;
7979
u32 argument2;
8080
u32 argument3;
81-
int cmd_active;
81+
bool cmd_active;
8282
struct completion done;
8383
};
8484

@@ -1297,7 +1297,6 @@ static inline void ufshcd_rmwl(struct ufs_hba *hba, u32 mask, u32 val, u32 reg)
12971297

12981298
void ufshcd_enable_irq(struct ufs_hba *hba);
12991299
void ufshcd_disable_irq(struct ufs_hba *hba);
1300-
void ufshcd_enable_intr(struct ufs_hba *hba, u32 intrs);
13011300
int ufshcd_alloc_host(struct device *, struct ufs_hba **);
13021301
int ufshcd_hba_enable(struct ufs_hba *hba);
13031302
int ufshcd_init(struct ufs_hba *, void __iomem *, unsigned int);

include/ufs/ufshci.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,19 +83,22 @@ enum {
8383
};
8484

8585
enum {
86+
/* Submission Queue (SQ) Configuration Registers */
8687
REG_SQATTR = 0x0,
8788
REG_SQLBA = 0x4,
8889
REG_SQUBA = 0x8,
8990
REG_SQDAO = 0xC,
9091
REG_SQISAO = 0x10,
9192

93+
/* Completion Queue (CQ) Configuration Registers */
9294
REG_CQATTR = 0x20,
9395
REG_CQLBA = 0x24,
9496
REG_CQUBA = 0x28,
9597
REG_CQDAO = 0x2C,
9698
REG_CQISAO = 0x30,
9799
};
98100

101+
/* Operation and Runtime Registers - Submission Queues and Completion Queues */
99102
enum {
100103
REG_SQHP = 0x0,
101104
REG_SQTP = 0x4,

0 commit comments

Comments
 (0)