Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

scsi: ufs: core: Update CQ Entry to UFS 4.1 format

Update the completion queue (CQ) entry format according to the UFS 4.1
specification. UFS 4.1 introduces new members in reserved record
DW5. Also refine DW4 with detailed members defined in UFS 4.0. Modify
the code to incorporate these changes by updating the overall_status in
the CQ entry structure.

Signed-off-by: Peter Wang <peter.wang@mediatek.com>
Reviewed-by: Bart Van Assche <bvanassche@acm.org>
Link: https://patch.msgid.link/20251016023507.1000664-2-peter.wang@mediatek.com
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>

authored by

Peter Wang and committed by
Martin K. Petersen
bfe0d22f ce085ecd

+21 -5
+2 -2
drivers/ufs/core/ufshcd.c
··· 856 856 struct cq_entry *cqe) 857 857 { 858 858 if (cqe) 859 - return le32_to_cpu(cqe->status) & MASK_OCS; 859 + return cqe->overall_status & MASK_OCS; 860 860 861 861 return lrbp->utr_descriptor_ptr->header.ocs & MASK_OCS; 862 862 } ··· 5646 5646 scsi_done(cmd); 5647 5647 } else { 5648 5648 if (cqe) { 5649 - ocs = le32_to_cpu(cqe->status) & MASK_OCS; 5649 + ocs = cqe->overall_status & MASK_OCS; 5650 5650 lrbp->utr_descriptor_ptr->header.ocs = ocs; 5651 5651 } 5652 5652 complete(&hba->dev_cmd.complete);
+19 -3
include/ufs/ufshci.h
··· 569 569 __le16 prd_table_offset; 570 570 571 571 /* DW 4 */ 572 - __le32 status; 572 + u8 overall_status; 573 + u8 extended_error_code; 574 + __le16 reserved_1; 573 575 574 - /* DW 5-7 */ 575 - __le32 reserved[3]; 576 + /* DW 5 */ 577 + u8 task_tag; 578 + u8 lun; 579 + #if defined(__BIG_ENDIAN) 580 + u8 ext_iid:4; 581 + u8 iid:4; 582 + #elif defined(__LITTLE_ENDIAN) 583 + u8 iid:4; 584 + u8 ext_iid:4; 585 + #else 586 + #error 587 + #endif 588 + u8 reserved_2; 589 + 590 + /* DW 6-7 */ 591 + __le32 reserved_3[2]; 576 592 }; 577 593 578 594 static_assert(sizeof(struct cq_entry) == 32);