* [PATCH] scsi: ufs-pci: Add quirk for broken auto-hibernate for Intel EHL
@ 2020-08-10 14:10 Adrian Hunter
2020-08-11 0:59 ` Stanley Chu
2020-08-18 3:12 ` Martin K. Petersen
0 siblings, 2 replies; 3+ messages in thread
From: Adrian Hunter @ 2020-08-10 14:10 UTC (permalink / raw)
To: Martin K . Petersen, James E . J . Bottomley
Cc: linux-scsi, linux-kernel, Alim Akhtar, Avri Altman
Intel EHL UFS host controller advertises auto-hibernate capability but it
does not work correctly. Add a quirk for that.
Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
Fixes: 8c09d75276971 ("scsi: ufshdc-pci: Add Intel PCI IDs for EHL")
---
drivers/scsi/ufs/ufshcd-pci.c | 16 ++++++++++++++--
drivers/scsi/ufs/ufshcd.h | 9 ++++++++-
2 files changed, 22 insertions(+), 3 deletions(-)
diff --git a/drivers/scsi/ufs/ufshcd-pci.c b/drivers/scsi/ufs/ufshcd-pci.c
index f407b13883ac..5a95a7bfbab0 100644
--- a/drivers/scsi/ufs/ufshcd-pci.c
+++ b/drivers/scsi/ufs/ufshcd-pci.c
@@ -44,11 +44,23 @@ static int ufs_intel_link_startup_notify(struct ufs_hba *hba,
return err;
}
+static int ufs_intel_ehl_init(struct ufs_hba *hba)
+{
+ hba->quirks |= UFSHCD_QUIRK_BROKEN_AUTO_HIBERN8;
+ return 0;
+}
+
static struct ufs_hba_variant_ops ufs_intel_cnl_hba_vops = {
.name = "intel-pci",
.link_startup_notify = ufs_intel_link_startup_notify,
};
+static struct ufs_hba_variant_ops ufs_intel_ehl_hba_vops = {
+ .name = "intel-pci",
+ .init = ufs_intel_ehl_init,
+ .link_startup_notify = ufs_intel_link_startup_notify,
+};
+
#ifdef CONFIG_PM_SLEEP
/**
* ufshcd_pci_suspend - suspend power management function
@@ -177,8 +189,8 @@ static const struct dev_pm_ops ufshcd_pci_pm_ops = {
static const struct pci_device_id ufshcd_pci_tbl[] = {
{ PCI_VENDOR_ID_SAMSUNG, 0xC00C, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 },
{ PCI_VDEVICE(INTEL, 0x9DFA), (kernel_ulong_t)&ufs_intel_cnl_hba_vops },
- { PCI_VDEVICE(INTEL, 0x4B41), (kernel_ulong_t)&ufs_intel_cnl_hba_vops },
- { PCI_VDEVICE(INTEL, 0x4B43), (kernel_ulong_t)&ufs_intel_cnl_hba_vops },
+ { PCI_VDEVICE(INTEL, 0x4B41), (kernel_ulong_t)&ufs_intel_ehl_hba_vops },
+ { PCI_VDEVICE(INTEL, 0x4B43), (kernel_ulong_t)&ufs_intel_ehl_hba_vops },
{ } /* terminate list */
};
diff --git a/drivers/scsi/ufs/ufshcd.h b/drivers/scsi/ufs/ufshcd.h
index b2ef18f1b746..87eb0794e239 100644
--- a/drivers/scsi/ufs/ufshcd.h
+++ b/drivers/scsi/ufs/ufshcd.h
@@ -520,6 +520,12 @@ enum ufshcd_quirks {
* OCS FATAL ERROR with device error through sense data
*/
UFSHCD_QUIRK_BROKEN_OCS_FATAL_ERROR = 1 << 10,
+
+ /*
+ * This quirk needs to be enabled if the host controller has
+ * auto-hibernate capability but it doesn't work.
+ */
+ UFSHCD_QUIRK_BROKEN_AUTO_HIBERN8 = 1 << 11,
};
enum ufshcd_caps {
@@ -803,7 +809,8 @@ return true;
static inline bool ufshcd_is_auto_hibern8_supported(struct ufs_hba *hba)
{
- return (hba->capabilities & MASK_AUTO_HIBERN8_SUPPORT);
+ return (hba->capabilities & MASK_AUTO_HIBERN8_SUPPORT) &&
+ !(hba->quirks & UFSHCD_QUIRK_BROKEN_AUTO_HIBERN8);
}
static inline bool ufshcd_is_auto_hibern8_enabled(struct ufs_hba *hba)
--
2.17.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] scsi: ufs-pci: Add quirk for broken auto-hibernate for Intel EHL
2020-08-10 14:10 [PATCH] scsi: ufs-pci: Add quirk for broken auto-hibernate for Intel EHL Adrian Hunter
@ 2020-08-11 0:59 ` Stanley Chu
2020-08-18 3:12 ` Martin K. Petersen
1 sibling, 0 replies; 3+ messages in thread
From: Stanley Chu @ 2020-08-11 0:59 UTC (permalink / raw)
To: Adrian Hunter
Cc: Martin K . Petersen, James E . J . Bottomley, linux-scsi,
linux-kernel, Alim Akhtar, Avri Altman
On Mon, 2020-08-10 at 17:10 +0300, Adrian Hunter wrote:
> Intel EHL UFS host controller advertises auto-hibernate capability but it
> does not work correctly. Add a quirk for that.
>
> Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
> Fixes: 8c09d75276971 ("scsi: ufshdc-pci: Add Intel PCI IDs for EHL")
> ---
Acked-by: Stanley Chu <stanley.chu@mediatek.com>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] scsi: ufs-pci: Add quirk for broken auto-hibernate for Intel EHL
2020-08-10 14:10 [PATCH] scsi: ufs-pci: Add quirk for broken auto-hibernate for Intel EHL Adrian Hunter
2020-08-11 0:59 ` Stanley Chu
@ 2020-08-18 3:12 ` Martin K. Petersen
1 sibling, 0 replies; 3+ messages in thread
From: Martin K. Petersen @ 2020-08-18 3:12 UTC (permalink / raw)
To: Adrian Hunter, James E . J . Bottomley
Cc: Martin K . Petersen, linux-kernel, Avri Altman, linux-scsi,
Alim Akhtar
On Mon, 10 Aug 2020 17:10:24 +0300, Adrian Hunter wrote:
> Intel EHL UFS host controller advertises auto-hibernate capability but it
> does not work correctly. Add a quirk for that.
Applied to 5.9/scsi-fixes, thanks!
[1/1] scsi: ufs-pci: Add quirk for broken auto-hibernate for Intel EHL
https://git.kernel.org/mkp/scsi/c/8da76f71fef7
--
Martin K. Petersen Oracle Linux Engineering
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2020-08-18 3:14 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-08-10 14:10 [PATCH] scsi: ufs-pci: Add quirk for broken auto-hibernate for Intel EHL Adrian Hunter
2020-08-11 0:59 ` Stanley Chu
2020-08-18 3:12 ` Martin K. Petersen
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox