Linux SCSI subsystem development
 help / color / mirror / Atom feed
From: "Fang Hongjie(方洪杰)" <hongjiefang@asrmicro.com>
To: Bart Van Assche <bvanassche@acm.org>,
	"alim.akhtar@samsung.com" <alim.akhtar@samsung.com>,
	"avri.altman@wdc.com" <avri.altman@wdc.com>,
	"James.Bottomley@HansenPartnership.com"
	<James.Bottomley@HansenPartnership.com>,
	"martin.petersen@oracle.com" <martin.petersen@oracle.com>
Cc: "linux-scsi@vger.kernel.org" <linux-scsi@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: RE: [PATCH v2] scsi: ufs: core: call hibern8 notify when hibern8 cmd failed
Date: Thu, 30 Apr 2026 02:40:35 +0000	[thread overview]
Message-ID: <568f953d989a410fa573127a4c3c22d4@exch02.asrmicro.com> (raw)
In-Reply-To: <13b1b7e8-4cd1-420a-94a4-e8528d2eb723@acm.org>


> From: Bart Van Assche [mailto:bvanassche@acm.org]
> Sent: Thursday, April 30, 2026 12:23 AM
> To: Fang Hongjie <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
> 
> 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?
> 

Adding a third enum value to handle this is the more reasonable approach. 
This would not affect the existing vendor implementations, 
and the change would be confined to internal functions within the ufs core.

Pass `ROLLBACK_CHANGE` when the hibern8 command returns a failure, 
and use `POST_CHANGE` otherwise.

> Thanks,
> 
> Bart.

Best.


      reply	other threads:[~2026-04-30  2:41 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
2026-04-30  2:40   ` Fang Hongjie(方洪杰) [this message]

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=568f953d989a410fa573127a4c3c22d4@exch02.asrmicro.com \
    --to=hongjiefang@asrmicro.com \
    --cc=James.Bottomley@HansenPartnership.com \
    --cc=alim.akhtar@samsung.com \
    --cc=avri.altman@wdc.com \
    --cc=bvanassche@acm.org \
    --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