2 (untested) minor mcq cleanups.
Avri Altman (2):
scsi: ufs: mcq: Annotate ufshcd_inc_sq_tail appropriately
scsi: ufs: mcq: Use pointer arithmetic in send_command
drivers/ufs/core/ufshcd-priv.h | 1 +
drivers/ufs/core/ufshcd.c | 5 +++--
include/ufs/ufshcd.h | 2 +-
3 files changed, 5 insertions(+), 3 deletions(-)
--
2.17.1
Allow Sparse and such to know that the hwq lock should be held here.
Signed-off-by: Avri Altman <[email protected]>
---
drivers/ufs/core/ufshcd-priv.h | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/ufs/core/ufshcd-priv.h b/drivers/ufs/core/ufshcd-priv.h
index 529f8507a5e4..d53b93c21a0c 100644
--- a/drivers/ufs/core/ufshcd-priv.h
+++ b/drivers/ufs/core/ufshcd-priv.h
@@ -364,6 +364,7 @@ static inline bool ufs_is_valid_unit_desc_lun(struct ufs_dev_info *dev_info, u8
}
static inline void ufshcd_inc_sq_tail(struct ufs_hw_queue *q)
+ __must_hold(&q->sq_lock)
{
u32 mask = q->max_entries - 1;
u32 val;
--
2.17.1
Make sqe_base_addr a UTRD pointer it is, instead of an opaque void *.
Signed-off-by: Avri Altman <[email protected]>
---
drivers/ufs/core/ufshcd.c | 5 +++--
include/ufs/ufshcd.h | 2 +-
2 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/drivers/ufs/core/ufshcd.c b/drivers/ufs/core/ufshcd.c
index 35a3bd95c5e4..aa7bb05e99eb 100644
--- a/drivers/ufs/core/ufshcd.c
+++ b/drivers/ufs/core/ufshcd.c
@@ -2242,10 +2242,11 @@ void ufshcd_send_command(struct ufs_hba *hba, unsigned int task_tag,
if (is_mcq_enabled(hba)) {
int utrd_size = sizeof(struct utp_transfer_req_desc);
+ struct utp_transfer_req_desc *src = lrbp->utr_descriptor_ptr;
+ struct utp_transfer_req_desc *dest = hwq->sqe_base_addr + hwq->sq_tail_slot;
spin_lock(&hwq->sq_lock);
- memcpy(hwq->sqe_base_addr + (hwq->sq_tail_slot * utrd_size),
- lrbp->utr_descriptor_ptr, utrd_size);
+ memcpy(dest, src, utrd_size);
ufshcd_inc_sq_tail(hwq);
spin_unlock(&hwq->sq_lock);
} else {
diff --git a/include/ufs/ufshcd.h b/include/ufs/ufshcd.h
index 25aab8ec4f86..bd42477706b6 100644
--- a/include/ufs/ufshcd.h
+++ b/include/ufs/ufshcd.h
@@ -1100,7 +1100,7 @@ struct ufs_hw_queue {
void __iomem *mcq_cq_head;
void __iomem *mcq_cq_tail;
- void *sqe_base_addr;
+ struct utp_transfer_req_desc *sqe_base_addr;
dma_addr_t sqe_dma_addr;
struct cq_entry *cqe_base_addr;
dma_addr_t cqe_dma_addr;
--
2.17.1
On 3/29/23 03:13, Avri Altman wrote:
> 2 (untested) minor mcq cleanups.
I cannot test this series. I hope someone else can.
Thanks,
Bart.
On Wed, 29 Mar 2023 13:13:01 +0300, Avri Altman wrote:
> 2 (untested) minor mcq cleanups.
>
> Avri Altman (2):
> scsi: ufs: mcq: Annotate ufshcd_inc_sq_tail appropriately
> scsi: ufs: mcq: Use pointer arithmetic in send_command
>
> drivers/ufs/core/ufshcd-priv.h | 1 +
> drivers/ufs/core/ufshcd.c | 5 +++--
> include/ufs/ufshcd.h | 2 +-
> 3 files changed, 5 insertions(+), 3 deletions(-)
>
> [...]
Applied to 6.4/scsi-queue, thanks!
[1/2] scsi: ufs: mcq: Annotate ufshcd_inc_sq_tail appropriately
https://git.kernel.org/mkp/scsi/c/4de243c40c0f
[2/2] scsi: ufs: mcq: Use pointer arithmetic in send_command
https://git.kernel.org/mkp/scsi/c/3c85f087faec
--
Martin K. Petersen Oracle Linux Engineering
>
> On 3/29/23 03:13, Avri Altman wrote:
> > 2 (untested) minor mcq cleanups.
>
> I cannot test this series. I hope someone else can.
Would appreciate any help with a tested-by tag.
Thanks,
Avri
>
> Thanks,
>
> Bart.