Linux SCSI subsystem development
 help / color / mirror / Atom feed
From: Bart Van Assche <bvanassche@acm.org>
To: peter.wang@mediatek.com, linux-scsi@vger.kernel.org,
	martin.petersen@oracle.com
Cc: wsd_upstream@mediatek.com, linux-mediatek@lists.infradead.org,
	chun-hung.wu@mediatek.com, alice.chao@mediatek.com,
	cc.chou@mediatek.com, chaotian.jing@mediatek.com,
	jiajie.hao@mediatek.com, qilin.tan@mediatek.com,
	lin.gui@mediatek.com, tun-yu.yu@mediatek.com,
	eddie.huang@mediatek.com, naomi.chu@mediatek.com,
	ed.tsai@mediatek.com
Subject: Re: [PATCH v1 2/2] ufs: core: support dumping CQ entry in MCQ Mode
Date: Tue, 14 Oct 2025 08:46:38 -0700	[thread overview]
Message-ID: <4c47f800-0536-452a-b64b-d177fa306418@acm.org> (raw)
In-Reply-To: <20251014131758.270324-3-peter.wang@mediatek.com>

On 10/14/25 6:15 AM, peter.wang@mediatek.com wrote:
> diff --git a/drivers/ufs/core/ufshcd.c b/drivers/ufs/core/ufshcd.c
> index d779cc777a17..b90500126b35 100644
> --- a/drivers/ufs/core/ufshcd.c
> +++ b/drivers/ufs/core/ufshcd.c
> @@ -599,7 +599,8 @@ static void ufshcd_print_evt_hist(struct ufs_hba *hba)
>   }
>   
>   static
> -void ufshcd_print_tr(struct ufs_hba *hba, int tag, bool pr_prdt)
> +void ufshcd_print_tr(struct ufs_hba *hba, struct cq_entry *cqe,
> +		     int tag, bool pr_prdt)
>   {
>   	const struct ufshcd_lrb *lrbp;
>   	int prdt_length;
> @@ -618,6 +619,8 @@ void ufshcd_print_tr(struct ufs_hba *hba, int tag, bool pr_prdt)
>   
>   	ufshcd_hex_dump("UPIU TRD: ", lrbp->utr_descriptor_ptr,
>   			sizeof(struct utp_transfer_req_desc));
> +	if (cqe)
> +		ufshcd_hex_dump("UPIU CQE: ", cqe, sizeof(struct cq_entry));
>   	dev_err(hba->dev, "UPIU[%d] - Request UPIU phys@0x%llx\n", tag,
>   		(u64)lrbp->ucd_req_dma_addr);
>   	ufshcd_hex_dump("UPIU REQ: ", lrbp->ucd_req_ptr,
> @@ -648,7 +651,7 @@ static bool ufshcd_print_tr_iter(struct request *req, void *priv)
>   	struct Scsi_Host *shost = sdev->host;
>   	struct ufs_hba *hba = shost_priv(shost);
>   
> -	ufshcd_print_tr(hba, req->tag, *(bool *)priv);
> +	ufshcd_print_tr(hba, NULL, req->tag, *(bool *)priv);
>   
>   	return true;
>   }
> @@ -5536,7 +5539,7 @@ ufshcd_transfer_rsp_status(struct ufs_hba *hba, struct ufshcd_lrb *lrbp,
>   
>   	if ((host_byte(result) != DID_OK) &&
>   	    (host_byte(result) != DID_REQUEUE) && !hba->silence_err_logs)
> -		ufshcd_print_tr(hba, lrbp->task_tag, true);
> +		ufshcd_print_tr(hba, cqe, lrbp->task_tag, true);
>   	return result;
>   }
>   
> @@ -7763,9 +7766,9 @@ static int ufshcd_abort(struct scsi_cmnd *cmd)
>   		ufshcd_print_evt_hist(hba);
>   		ufshcd_print_host_state(hba);
>   		ufshcd_print_pwr_info(hba);
> -		ufshcd_print_tr(hba, tag, true);
> +		ufshcd_print_tr(hba, NULL, tag, true);
>   	} else {
> -		ufshcd_print_tr(hba, tag, false);
> +		ufshcd_print_tr(hba, NULL, tag, false);
>   	}
>   	hba->req_abort_count++;

So there are four callers of ufshcd_print_tr() and only one caller dumps
the CQE? Wouldn't it be better not to add any arguments to
ufshcd_print_tr() and instead add the code for dumping the CQE directly
in the only function that needs this functionality?

Thanks,

Bart.



  reply	other threads:[~2025-10-14 15:46 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-10-14 13:15 [PATCH v1 0/2] update CQ entry and dump CQE in MCQ mode peter.wang
2025-10-14 13:15 ` [PATCH v1 1/2] ufs: core: update CQ Entry to UFS 4.1 format peter.wang
2025-10-14 15:44   ` Bart Van Assche
2025-10-15  5:58     ` Peter Wang (王信友)
2025-10-14 13:15 ` [PATCH v1 2/2] ufs: core: support dumping CQ entry in MCQ Mode peter.wang
2025-10-14 15:46   ` Bart Van Assche [this message]
2025-10-15  6:14     ` Peter Wang (王信友)
2025-10-15 16:00       ` Bart Van Assche
2025-10-16  2:12         ` Peter Wang (王信友)

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:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

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

  git send-email \
    --in-reply-to=4c47f800-0536-452a-b64b-d177fa306418@acm.org \
    --to=bvanassche@acm.org \
    --cc=alice.chao@mediatek.com \
    --cc=cc.chou@mediatek.com \
    --cc=chaotian.jing@mediatek.com \
    --cc=chun-hung.wu@mediatek.com \
    --cc=ed.tsai@mediatek.com \
    --cc=eddie.huang@mediatek.com \
    --cc=jiajie.hao@mediatek.com \
    --cc=lin.gui@mediatek.com \
    --cc=linux-mediatek@lists.infradead.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=martin.petersen@oracle.com \
    --cc=naomi.chu@mediatek.com \
    --cc=peter.wang@mediatek.com \
    --cc=qilin.tan@mediatek.com \
    --cc=tun-yu.yu@mediatek.com \
    --cc=wsd_upstream@mediatek.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox