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, avri.altman@wdc.com,
	alim.akhtar@samsung.com, jejb@linux.ibm.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, yi-fan.peng@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,
	draviv@codeaurora.org, stable@vger.kernel.org
Subject: Re: [PATCH v2] ufs: core: add missing post notify for power mode change
Date: Fri, 22 Nov 2024 10:23:40 -0800	[thread overview]
Message-ID: <f0cc674e-18f7-47c6-a39e-596b2cb161a4@acm.org> (raw)
In-Reply-To: <20241122024943.30589-1-peter.wang@mediatek.com>

On 11/21/24 6:49 PM, peter.wang@mediatek.com wrote:
> diff --git a/include/ufs/ufshcd.h b/include/ufs/ufshcd.h
> index 3f68ae3e4330..1db754b4a4d6 100644
> --- a/include/ufs/ufshcd.h
> +++ b/include/ufs/ufshcd.h
> @@ -308,7 +308,9 @@ struct ufs_pwr_mode_info {
>    *                       to allow variant specific Uni-Pro initialization.
>    * @pwr_change_notify: called before and after a power mode change
>    *			is carried out to allow vendor spesific capabilities
> - *			to be set.
> + *			to be set. PRE_CHANGE can modify final_params based
> + *			on desired_pwr_mode, but POST_CHANGE must not alter
> + *			the final_params parameter
>    * @setup_xfer_req: called before any transfer request is issued
>    *                  to set some things
>    * @setup_task_mgmt: called before any task management request is issued
> @@ -350,9 +352,9 @@ struct ufs_hba_variant_ops {
>   	int	(*link_startup_notify)(struct ufs_hba *,
>   				       enum ufs_notify_change_status);
>   	int	(*pwr_change_notify)(struct ufs_hba *,
> -					enum ufs_notify_change_status status,
> -					struct ufs_pa_layer_attr *,
> -					struct ufs_pa_layer_attr *);
> +				enum ufs_notify_change_status status,
> +				struct ufs_pa_layer_attr *desired_pwr_mode,
> +				struct ufs_pa_layer_attr *final_params);
>   	void	(*setup_xfer_req)(struct ufs_hba *hba, int tag,
>   				  bool is_scsi_cmd);
>   	void	(*setup_task_mgmt)(struct ufs_hba *, int, u8);

'pwr_change_notify' probably should be split into two callback pointers
(one for PRE_CHANGE, one for POST_CHANGE) since the third and fourth
arguments have different roles for pre and post changes. Additionally,
this would allow to constify the fourth argument for the post callback.

Anyway, since this patch looks good to me:

Reviewed-by: Bart Van Assche <bvanassche@acm.org>

  reply	other threads:[~2024-11-22 18:24 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-11-22  2:49 [PATCH v2] ufs: core: add missing post notify for power mode change peter.wang
2024-11-22 18:23 ` Bart Van Assche [this message]
2024-12-05  2:17 ` 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:
  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=f0cc674e-18f7-47c6-a39e-596b2cb161a4@acm.org \
    --to=bvanassche@acm.org \
    --cc=alice.chao@mediatek.com \
    --cc=alim.akhtar@samsung.com \
    --cc=avri.altman@wdc.com \
    --cc=cc.chou@mediatek.com \
    --cc=chaotian.jing@mediatek.com \
    --cc=chun-hung.wu@mediatek.com \
    --cc=draviv@codeaurora.org \
    --cc=ed.tsai@mediatek.com \
    --cc=eddie.huang@mediatek.com \
    --cc=jejb@linux.ibm.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=stable@vger.kernel.org \
    --cc=tun-yu.yu@mediatek.com \
    --cc=wsd_upstream@mediatek.com \
    --cc=yi-fan.peng@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