From: Adrian Hunter <adrian.hunter@intel.com>
To: Stanley Jhu <stanleyjhu@google.com>,
"Martin K . Petersen" <mkp@kernel.org>,
"James E . J . Bottomley" <James.Bottomley@HansenPartnership.com>
Cc: Alim Akhtar <alim.akhtar@samsung.com>,
Bart Van Assche <bvanassche@acm.org>,
Bean Huo <beanhuo@micron.com>,
sangram kumar yerra <sangram.k.y@intel.com>,
Rajeshkumar Sambandham <Rajeshkumar.Sambandham@amd.com>,
<linux-scsi@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
<stable@vger.kernel.org>
Subject: Re: [PATCH] scsi: ufs: ufs-pci: Check hba->vops in system PM callbacks
Date: Sat, 14 Nov 2026 07:37:16 +0200 [thread overview]
Message-ID: <02d67da9-13a5-4e38-89aa-30de10df85f4@intel.com> (raw)
In-Reply-To: <20261111084853.3530107-1-stanleyjhu@google.com>
On 11/11/2026 10:48, Stanley Jhu wrote:
> ufshcd_pci_tbl[] defines the Samsung 0xC00C and AMD 0x1B29 PCI IDs
> with .driver_data set to 0, so ufshcd_pci_probe() leaves hba->vops
> NULL. Both ufshcd_pci_suspend_prepare() and
> ufshcd_pci_resume_complete() dereference hba->vops->name without
> checking hba->vops:
>
> 1. System suspend on an AMD 0x1B29 or Samsung 0xC00C host enters the
> PM prepare phase and calls ufshcd_pci_suspend_prepare().
> 2. ufshcd_pci_suspend_prepare() evaluates
> strcmp(hba->vops->name, "intel-pci"), dereferences NULL, and
> triggers a kernel oops in the suspending task.
>
> Check that hba->vops is non-NULL before reading hba->vops->name in
> both callbacks so hosts without variant operations use the generic
> ufshcd_suspend_prepare() and ufshcd_resume_complete() paths.
>
> Fixes: bb44826c3bdb ("scsi: ufs: ufs-pci: Fix S0ix/S3 for Intel controllers")
> Cc: stable@vger.kernel.org
> Signed-off-by: Stanley Jhu <stanleyjhu@google.com>
Reviewed-by: Adrian Hunter <adrian.hunter@intel.com>
> ---
> drivers/ufs/host/ufshcd-pci.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/ufs/host/ufshcd-pci.c b/drivers/ufs/host/ufshcd-pci.c
> index 668b57403e62..f9abbbc436f4 100644
> --- a/drivers/ufs/host/ufshcd-pci.c
> +++ b/drivers/ufs/host/ufshcd-pci.c
> @@ -644,7 +644,7 @@ static int ufshcd_pci_suspend_prepare(struct device *dev)
> {
> struct ufs_hba *hba = dev_get_drvdata(dev);
>
> - if (!strcmp(hba->vops->name, "intel-pci"))
> + if (hba->vops && !strcmp(hba->vops->name, "intel-pci"))
> return ufs_intel_suspend_prepare(dev);
>
> return ufshcd_suspend_prepare(dev);
> @@ -654,7 +654,7 @@ static void ufshcd_pci_resume_complete(struct device *dev)
> {
> struct ufs_hba *hba = dev_get_drvdata(dev);
>
> - if (!strcmp(hba->vops->name, "intel-pci")) {
> + if (hba->vops && !strcmp(hba->vops->name, "intel-pci")) {
> ufs_intel_resume_complete(dev);
> return;
> }
prev parent reply other threads:[~2026-11-14 5:39 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-11 8:48 Stanley Jhu
2026-11-14 5:37 ` Adrian Hunter [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=02d67da9-13a5-4e38-89aa-30de10df85f4@intel.com \
--to=adrian.hunter@intel.com \
--cc=James.Bottomley@HansenPartnership.com \
--cc=Rajeshkumar.Sambandham@amd.com \
--cc=alim.akhtar@samsung.com \
--cc=beanhuo@micron.com \
--cc=bvanassche@acm.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=mkp@kernel.org \
--cc=sangram.k.y@intel.com \
--cc=stable@vger.kernel.org \
--cc=stanleyjhu@google.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®