mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Bart Van Assche <bvanassche@acm.org>
To: j-young.choi@samsung.com, ALIM AKHTAR <alim.akhtar@samsung.com>,
	"avri.altman@wdc.com" <avri.altman@wdc.com>,
	"jejb@linux.ibm.com" <jejb@linux.ibm.com>,
	"martin.petersen@oracle.com" <martin.petersen@oracle.com>,
	"beanhuo@micron.com" <beanhuo@micron.com>,
	"adrian.hunter@intel.com" <adrian.hunter@intel.com>,
	"linux-scsi@vger.kernel.org" <linux-scsi@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v3 1/2] scsi: ufs: wb: renaming & cleanups functions
Date: Thu, 7 Jul 2022 15:28:33 -0700	[thread overview]
Message-ID: <56de725b-d07a-e78e-e573-cfb868d315c9@acm.org> (raw)
In-Reply-To: <20220701074654epcms2p5fcc0a8abe766fa00851b00dff98ad3c7@epcms2p5>

On 7/1/22 00:46, Jinyoung CHOI wrote:
> The Function names were changed clearly, and the location of the
> comments was modified and added properly.
> 
> In addition, the conditional test of the toggle functions was
> different, so it was modified.
> 
> Unnecessary logs were removed and modified appropriately.

There are too many changes in this patch. Please split this patch, e.g. 
one patch that introduces ufshcd_is_wb_buf_flush_allowed(), one patch 
that renames ufshcd_wb_toggle_flush_during_h8() and its arguments and 
another patch that renames ufshcd_wb_config().

> diff --git a/drivers/ufs/core/ufs-sysfs.c b/drivers/ufs/core/ufs-sysfs.c
> index 0a088b47d557..6253606b93b4 100644
> --- a/drivers/ufs/core/ufs-sysfs.c
> +++ b/drivers/ufs/core/ufs-sysfs.c
> @@ -230,7 +230,7 @@ static ssize_t wb_on_store(struct device *dev, struct device_attribute *attr,
>   		 * If the platform supports UFSHCD_CAP_CLK_SCALING, turn WB
>   		 * on/off will be done while clock scaling up/down.
>   		 */
> -		dev_warn(dev, "To control WB through wb_on is not allowed!\n");
> +		dev_warn(dev, "It is not allowed to control WB!\n");

I suggest to change "control" into "configure".

>   static void ufshcd_scsi_unblock_requests(struct ufs_hba *hba)
> @@ -1289,9 +1288,10 @@ static int ufshcd_devfreq_scale(struct ufs_hba *hba, bool scale_up)
>   		}
>   	}
>   
> -	/* Enable Write Booster if we have scaled up else disable it */
>   	downgrade_write(&hba->clk_scaling_lock);
>   	is_writelock = false;
> +
> +	/* Enable Write Booster if we have scaled up else disable it */
>   	ufshcd_wb_toggle(hba, scale_up);

The above change could be yet another patch.

>   out_unprepare:
> @@ -5715,6 +5715,9 @@ static int __ufshcd_wb_toggle(struct ufs_hba *hba, bool set, enum flag_idn idn)
>   	enum query_opcode opcode = set ? UPIU_QUERY_OPCODE_SET_FLAG :
>   				   UPIU_QUERY_OPCODE_CLEAR_FLAG;
>   
> +	if (!ufshcd_is_wb_allowed(hba))
> +		return -EPERM;
> +

Moving the ufshcd_is_wb_allowed() call from ufshcd_wb_toggle() into 
__ufshcd_wb_toggle() should be yet another patch.

> -	if (!(enable ^ hba->dev_info.wb_enabled))
> +	if (hba->dev_info.wb_enabled == enable)
>   		return 0;

This change is independent of the rest of this patch and hence could be 
yet another patch.

> -	dev_info(hba->dev, "%s Write Booster %s\n",
> -			__func__, enable ? "enabled" : "disabled");

Why has this code been left out?

> -	ret = __ufshcd_wb_toggle(hba, set,
> -			QUERY_FLAG_IDN_WB_BUFF_FLUSH_DURING_HIBERN8);
> -	if (ret) {
> -		dev_err(hba->dev, "%s: WB-Buf Flush during H8 %s failed: %d\n",
> -			__func__, set ? "enable" : "disable", ret);
> -		return;
> -	}
> -	dev_dbg(hba->dev, "%s WB-Buf Flush during H8 %s\n",
> -			__func__, set ? "enabled" : "disabled");
> +	ret = __ufshcd_wb_toggle(hba, enable,
> +				 QUERY_FLAG_IDN_WB_BUFF_FLUSH_DURING_HIBERN8);
> +	if (ret)
> +		dev_err(hba->dev, "%s: failed to %s WB buf flush during H8 %d\n",
> +			__func__, enable ? "enable" : "disable", ret);

The above error message is worse than the original error message. Please 
either keep the original message or change it into something better than 
the original, e.g. "Failed to %s WB buffer flushing during H8".

Thanks,

Bart.

  parent reply	other threads:[~2022-07-07 22:28 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CGME20220701074420epcms2p4c4a6a016c7070d5dfa279fc4607caa95@epcms2p4>
2022-07-01  7:44 ` [PATCH v3 0/2] scsi: ufs: wb: Add sysfs and cleanup Jinyoung CHOI
     [not found]   ` <CGME20220701074420epcms2p4c4a6a016c7070d5dfa279fc4607caa95@epcms2p5>
2022-07-01  7:46     ` [PATCH v3 1/2] scsi: ufs: wb: renaming & cleanups functions Jinyoung CHOI
2022-07-03 13:00       ` Avri Altman
     [not found]       ` <CGME20220701074420epcms2p4c4a6a016c7070d5dfa279fc4607caa95@epcms2p2>
2022-07-04  2:44         ` Jinyoung CHOI
2022-07-07 22:28       ` Bart Van Assche [this message]
     [not found]   ` <CGME20220701074420epcms2p4c4a6a016c7070d5dfa279fc4607caa95@epcms2p8>
2022-07-01  7:48     ` [PATCH v3 2/2] scsi: ufs: wb: Add Manual Flush sysfs Jinyoung CHOI
2022-07-03 13:08       ` Avri Altman
2022-07-07 22:45       ` Bart Van Assche

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=56de725b-d07a-e78e-e573-cfb868d315c9@acm.org \
    --to=bvanassche@acm.org \
    --cc=adrian.hunter@intel.com \
    --cc=alim.akhtar@samsung.com \
    --cc=avri.altman@wdc.com \
    --cc=beanhuo@micron.com \
    --cc=j-young.choi@samsung.com \
    --cc=jejb@linux.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=martin.petersen@oracle.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

all inboxes | Powered by JetHome®