This is a note to let you know that I've just added the patch titled scsi: ufs: Make ufshcd_print_trs() consider UFSHCD_QUIRK_PRDT_BYTE_GRAN to the 5.8-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: scsi-ufs-make-ufshcd_print_trs-consider-ufshcd_quirk.patch and it can be found in the queue-5.8 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let <stable@xxxxxxxxxxxxxxx> know about it. commit a463ec9c9277e0f70368cfa4d3170ede747fa777 Author: Eric Biggers <ebiggers@xxxxxxxxxx> Date: Tue Aug 25 19:10:40 2020 -0700 scsi: ufs: Make ufshcd_print_trs() consider UFSHCD_QUIRK_PRDT_BYTE_GRAN [ Upstream commit cc770ce34aeeff21991f162f0db1a758ea672727 ] Fix ufshcd_print_trs() to consider UFSHCD_QUIRK_PRDT_BYTE_GRAN when using utp_transfer_req_desc::prd_table_length, so that it doesn't treat the number of bytes as the number of entries. Originally from Kiwoong Kim (https://lkml.kernel.org/r/20200218233115.8185-1-kwmad.kim@xxxxxxxxxxx). Link: https://lore.kernel.org/r/20200826021040.152148-1-ebiggers@xxxxxxxxxx Fixes: 26f968d7de82 ("scsi: ufs: Introduce UFSHCD_QUIRK_PRDT_BYTE_GRAN quirk") Cc: Alim Akhtar <alim.akhtar@xxxxxxxxxxx> Cc: Kiwoong Kim <kwmad.kim@xxxxxxxxxxx> Signed-off-by: Eric Biggers <ebiggers@xxxxxxxxxx> Signed-off-by: Martin K. Petersen <martin.petersen@xxxxxxxxxx> Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx> diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c index 8bc8e4e62c045..e5f75b2e07e2c 100644 --- a/drivers/scsi/ufs/ufshcd.c +++ b/drivers/scsi/ufs/ufshcd.c @@ -484,6 +484,9 @@ void ufshcd_print_trs(struct ufs_hba *hba, unsigned long bitmap, bool pr_prdt) prdt_length = le16_to_cpu( lrbp->utr_descriptor_ptr->prd_table_length); + if (hba->quirks & UFSHCD_QUIRK_PRDT_BYTE_GRAN) + prdt_length /= sizeof(struct ufshcd_sg_entry); + dev_err(hba->dev, "UPIU[%d] - PRDT - %d entries phys@0x%llx\n", tag, prdt_length,