* [PATCH v1 0/2] make UFS dev_cmd more readable
@ 2020-07-06 9:19 Bean Huo
2020-07-06 9:19 ` [PATCH v1 1/2] scsi: ufs: differentiate dev_cmd trace message Bean Huo
2020-07-06 9:19 ` [PATCH v1 2/2] scsi: ufs: change ufshcd_comp_devman_upiu() to ufshcd_compose_devman_upiu() Bean Huo
0 siblings, 2 replies; 5+ messages in thread
From: Bean Huo @ 2020-07-06 9:19 UTC (permalink / raw)
To: alim.akhtar, avri.altman, asutoshd, jejb, martin.petersen,
stanley.chu, beanhuo, bvanassche, tomas.winkler, cang
Cc: linux-scsi, linux-kernel
From: Bean Huo <beanhuo@micron.com>
Bean Huo (2):
scsi: ufs: differentiate dev_cmd trace message
scsi: ufs: change ufshcd_comp_devman_upiu() to
ufshcd_compose_devman_upiu()
drivers/scsi/ufs/ufshcd.c | 13 ++++++++-----
1 file changed, 8 insertions(+), 5 deletions(-)
--
2.17.1
^ permalink raw reply [flat|nested] 5+ messages in thread* [PATCH v1 1/2] scsi: ufs: differentiate dev_cmd trace message 2020-07-06 9:19 [PATCH v1 0/2] make UFS dev_cmd more readable Bean Huo @ 2020-07-06 9:19 ` Bean Huo 2020-07-06 9:24 ` Avri Altman 2020-07-06 9:19 ` [PATCH v1 2/2] scsi: ufs: change ufshcd_comp_devman_upiu() to ufshcd_compose_devman_upiu() Bean Huo 1 sibling, 1 reply; 5+ messages in thread From: Bean Huo @ 2020-07-06 9:19 UTC (permalink / raw) To: alim.akhtar, avri.altman, asutoshd, jejb, martin.petersen, stanley.chu, beanhuo, bvanassche, tomas.winkler, cang Cc: linux-scsi, linux-kernel From: Bean Huo <beanhuo@micron.com> fshcd_exec_dev_cmd() can send query request and NOP request, and it is confusing that ufshcd_add_query_upiu_trace() prints us the "query_send" string in the trace log. Change it and add NOP key message in the trace print according to the dev_cmd type. Signed-off-by: Bean Huo <beanhuo@micron.com> --- drivers/scsi/ufs/ufshcd.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c index 59358bb75014..173deee37e26 100644 --- a/drivers/scsi/ufs/ufshcd.c +++ b/drivers/scsi/ufs/ufshcd.c @@ -2727,7 +2727,9 @@ static int ufshcd_exec_dev_cmd(struct ufs_hba *hba, hba->dev_cmd.complete = &wait; - ufshcd_add_query_upiu_trace(hba, tag, "query_send"); + ufshcd_add_query_upiu_trace(hba, tag, + cmd_type == DEV_CMD_TYPE_QUERY ? + "send QUERY" : "send NOP"); /* Make sure descriptors are ready before ringing the doorbell */ wmb(); spin_lock_irqsave(hba->host->host_lock, flags); @@ -2738,7 +2740,7 @@ static int ufshcd_exec_dev_cmd(struct ufs_hba *hba, err = ufshcd_wait_for_dev_cmd(hba, lrbp, timeout); ufshcd_add_query_upiu_trace(hba, tag, - err ? "query_complete_err" : "query_complete"); + err ? "dev_cmd err" : "dev_cmd complete"); out_put_tag: blk_put_request(req); -- 2.17.1 ^ permalink raw reply related [flat|nested] 5+ messages in thread
* RE: [PATCH v1 1/2] scsi: ufs: differentiate dev_cmd trace message 2020-07-06 9:19 ` [PATCH v1 1/2] scsi: ufs: differentiate dev_cmd trace message Bean Huo @ 2020-07-06 9:24 ` Avri Altman 0 siblings, 0 replies; 5+ messages in thread From: Avri Altman @ 2020-07-06 9:24 UTC (permalink / raw) To: Bean Huo, alim.akhtar@samsung.com, asutoshd@codeaurora.org, jejb@linux.ibm.com, martin.petersen@oracle.com, stanley.chu@mediatek.com, beanhuo@micron.com, bvanassche@acm.org, tomas.winkler@intel.com, cang@codeaurora.org Cc: linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org > > From: Bean Huo <beanhuo@micron.com> > > fshcd_exec_dev_cmd() can send query request and NOP request, and it is Typo ? > confusing that ufshcd_add_query_upiu_trace() prints us the "query_send" > string in the trace log. Change it and add NOP key message in the trace > print according to the dev_cmd type. > > Signed-off-by: Bean Huo <beanhuo@micron.com> Our parsers already looking for those strings. You can add stuff, but do not change anything that user-space already expects. Thanks, Avri > --- > drivers/scsi/ufs/ufshcd.c | 6 ++++-- > 1 file changed, 4 insertions(+), 2 deletions(-) > > diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c > index 59358bb75014..173deee37e26 100644 > --- a/drivers/scsi/ufs/ufshcd.c > +++ b/drivers/scsi/ufs/ufshcd.c > @@ -2727,7 +2727,9 @@ static int ufshcd_exec_dev_cmd(struct ufs_hba > *hba, > > hba->dev_cmd.complete = &wait; > > - ufshcd_add_query_upiu_trace(hba, tag, "query_send"); > + ufshcd_add_query_upiu_trace(hba, tag, > + cmd_type == DEV_CMD_TYPE_QUERY ? > + "send QUERY" : "send NOP"); > /* Make sure descriptors are ready before ringing the doorbell */ > wmb(); > spin_lock_irqsave(hba->host->host_lock, flags); > @@ -2738,7 +2740,7 @@ static int ufshcd_exec_dev_cmd(struct ufs_hba > *hba, > err = ufshcd_wait_for_dev_cmd(hba, lrbp, timeout); > > ufshcd_add_query_upiu_trace(hba, tag, > - err ? "query_complete_err" : "query_complete"); > + err ? "dev_cmd err" : "dev_cmd complete"); > > out_put_tag: > blk_put_request(req); > -- > 2.17.1 ^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH v1 2/2] scsi: ufs: change ufshcd_comp_devman_upiu() to ufshcd_compose_devman_upiu() 2020-07-06 9:19 [PATCH v1 0/2] make UFS dev_cmd more readable Bean Huo 2020-07-06 9:19 ` [PATCH v1 1/2] scsi: ufs: differentiate dev_cmd trace message Bean Huo @ 2020-07-06 9:19 ` Bean Huo 2020-07-07 5:27 ` Avri Altman 1 sibling, 1 reply; 5+ messages in thread From: Bean Huo @ 2020-07-06 9:19 UTC (permalink / raw) To: alim.akhtar, avri.altman, asutoshd, jejb, martin.petersen, stanley.chu, beanhuo, bvanassche, tomas.winkler, cang Cc: linux-scsi, linux-kernel From: Bean Huo <beanhuo@micron.com> ufshcd_comp_devman_upiu() alwasy make me confuse that it is a request completion calling function. Change it to ufshcd_compose_devman_upiu(). Signed-off-by: Bean Huo <beanhuo@micron.com> --- drivers/scsi/ufs/ufshcd.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c index 173deee37e26..96d830bb900f 100644 --- a/drivers/scsi/ufs/ufshcd.c +++ b/drivers/scsi/ufs/ufshcd.c @@ -2368,12 +2368,13 @@ static inline void ufshcd_prepare_utp_nop_upiu(struct ufshcd_lrb *lrbp) } /** - * ufshcd_comp_devman_upiu - UFS Protocol Information Unit(UPIU) + * ufshcd_compose_devman_upiu - UFS Protocol Information Unit(UPIU) * for Device Management Purposes * @hba: per adapter instance * @lrbp: pointer to local reference block */ -static int ufshcd_comp_devman_upiu(struct ufs_hba *hba, struct ufshcd_lrb *lrbp) +static int ufshcd_compose_devman_upiu(struct ufs_hba *hba, + struct ufshcd_lrb *lrbp) { u32 upiu_flags; int ret = 0; @@ -2564,7 +2565,7 @@ static int ufshcd_compose_dev_cmd(struct ufs_hba *hba, lrbp->intr_cmd = true; /* No interrupt aggregation */ hba->dev_cmd.type = cmd_type; - return ufshcd_comp_devman_upiu(hba, lrbp); + return ufshcd_compose_devman_upiu(hba, lrbp); } static int -- 2.17.1 ^ permalink raw reply related [flat|nested] 5+ messages in thread
* RE: [PATCH v1 2/2] scsi: ufs: change ufshcd_comp_devman_upiu() to ufshcd_compose_devman_upiu() 2020-07-06 9:19 ` [PATCH v1 2/2] scsi: ufs: change ufshcd_comp_devman_upiu() to ufshcd_compose_devman_upiu() Bean Huo @ 2020-07-07 5:27 ` Avri Altman 0 siblings, 0 replies; 5+ messages in thread From: Avri Altman @ 2020-07-07 5:27 UTC (permalink / raw) To: Bean Huo, alim.akhtar@samsung.com, asutoshd@codeaurora.org, jejb@linux.ibm.com, martin.petersen@oracle.com, stanley.chu@mediatek.com, beanhuo@micron.com, bvanassche@acm.org, tomas.winkler@intel.com, cang@codeaurora.org Cc: linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org > > From: Bean Huo <beanhuo@micron.com> > > ufshcd_comp_devman_upiu() alwasy make me confuse that it is a request > completion calling function. Change it to ufshcd_compose_devman_upiu(). > > Signed-off-by: Bean Huo <beanhuo@micron.com> Acked-by: Avri Altman <avri.altman@wdc.com> ^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2020-07-07 5:27 UTC | newest] Thread overview: 5+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2020-07-06 9:19 [PATCH v1 0/2] make UFS dev_cmd more readable Bean Huo 2020-07-06 9:19 ` [PATCH v1 1/2] scsi: ufs: differentiate dev_cmd trace message Bean Huo 2020-07-06 9:24 ` Avri Altman 2020-07-06 9:19 ` [PATCH v1 2/2] scsi: ufs: change ufshcd_comp_devman_upiu() to ufshcd_compose_devman_upiu() Bean Huo 2020-07-07 5:27 ` Avri Altman
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox