Linux SCSI subsystem development
 help / color / mirror / Atom feed
From: Bart Van Assche <bvanassche@acm.org>
To: Hongjie Fang <hongjiefang@asrmicro.com>,
	alim.akhtar@samsung.com, avri.altman@wdc.com,
	James.Bottomley@HansenPartnership.com,
	martin.petersen@oracle.com
Cc: linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] scsi: ufs: core: call hibern8 notify when hibern8 cmd failed
Date: Wed, 29 Apr 2026 09:23:22 -0700	[thread overview]
Message-ID: <13b1b7e8-4cd1-420a-94a4-e8528d2eb723@acm.org> (raw)
In-Reply-To: <20260429112355.4125408-1-hongjiefang@asrmicro.com>

On 4/29/26 4:23 AM, Hongjie Fang wrote:
> diff --git a/include/ufs/ufshcd.h b/include/ufs/ufshcd.h
> index 8563b6648976..c1cb30d8aa4a 100644
> --- a/include/ufs/ufshcd.h
> +++ b/include/ufs/ufshcd.h
> @@ -355,7 +355,8 @@ struct ufs_hba_variant_ops {
>   				  bool is_scsi_cmd);
>   	void	(*setup_task_mgmt)(struct ufs_hba *, int, u8);
>   	void    (*hibern8_notify)(struct ufs_hba *, enum uic_cmd_dme,
> -					enum ufs_notify_change_status);
> +					enum ufs_notify_change_status,
> +					int cmd_ret);
>   	int	(*apply_dev_quirks)(struct ufs_hba *hba);
>   	void	(*fixup_dev_quirks)(struct ufs_hba *hba);
>   	int     (*suspend)(struct ufs_hba *, enum ufs_pm_op,

Passing the full 'cmd_ret' value to the hibern8_notify vendor operation 
may make the UFS driver harder to maintain than necessary.
Implementations of this vendor operation may test for specific values of
'cmd_ret'. Hence, when making any change in the code that calls
.hibern8_notify() regarding the return value, all implementations of
.hibern8_notify() would have to be reviewed.

Has it been considered to add a third value in enum 
ufs_notify_change_status, e.g. ROLLBACK_CHANGE? That should be
sufficient for hibern8_notify implementations, isn't it?

Thanks,

Bart.

  reply	other threads:[~2026-04-29 16:23 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-29 11:23 [PATCH v2] scsi: ufs: core: call hibern8 notify when hibern8 cmd failed Hongjie Fang
2026-04-29 16:23 ` Bart Van Assche [this message]
2026-04-30  2:40   ` Fang Hongjie(方洪杰)

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=13b1b7e8-4cd1-420a-94a4-e8528d2eb723@acm.org \
    --to=bvanassche@acm.org \
    --cc=James.Bottomley@HansenPartnership.com \
    --cc=alim.akhtar@samsung.com \
    --cc=avri.altman@wdc.com \
    --cc=hongjiefang@asrmicro.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