Linux-SCSI Archive on
 help / color / Atom feed
From: Eric Biggers <>
To:, Avri Altman <>,
	Alim Akhtar <>
Cc: Kiwoong Kim <>
Subject: [PATCH] scsi: ufs: make ufshcd_print_trs() consider UFSHCD_QUIRK_PRDT_BYTE_GRAN
Date: Tue, 25 Aug 2020 19:10:40 -0700
Message-ID: <> (raw)

From: Eric Biggers <>

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

Fixes: 26f968d7de82 ("scsi: ufs: Introduce UFSHCD_QUIRK_PRDT_BYTE_GRAN quirk")
Cc: Alim Akhtar <>
Cc: Kiwoong Kim <>
Signed-off-by: Eric Biggers <>
 drivers/scsi/ufs/ufshcd.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c
index 1d157ff58d817..316b861305eae 100644
--- a/drivers/scsi/ufs/ufshcd.c
+++ b/drivers/scsi/ufs/ufshcd.c
@@ -474,6 +474,9 @@ void ufshcd_print_trs(struct ufs_hba *hba, unsigned long bitmap, bool pr_prdt)
 		prdt_length = le16_to_cpu(
+		if (hba->quirks & UFSHCD_QUIRK_PRDT_BYTE_GRAN)
+			prdt_length /= sizeof(struct ufshcd_sg_entry);
 			"UPIU[%d] - PRDT - %d entries  phys@0x%llx\n",
 			tag, prdt_length,

             reply index

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-26  2:10 Eric Biggers [this message]
2020-09-09  2:09 ` Martin K. Petersen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \ \ \ \ \ \ \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

Linux-SCSI Archive on

Archives are clonable:
	git clone --mirror linux-scsi/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-scsi linux-scsi/ \
	public-inbox-index linux-scsi

Example config snippet for mirrors

Newsgroup available over NNTP:

AGPL code for this site: git clone