Skip to content

Commit 8da76f7

Browse files
ahunter6martinkpetersen
authored andcommitted
scsi: ufs-pci: Add quirk for broken auto-hibernate for Intel EHL
Intel EHL UFS host controller advertises auto-hibernate capability but it does not work correctly. Add a quirk for that. [mkp: checkpatch fix] Link: https://lore.kernel.org/r/[email protected] Fixes: 8c09d75 ("scsi: ufshdc-pci: Add Intel PCI IDs for EHL") Acked-by: Stanley Chu <[email protected]> Signed-off-by: Adrian Hunter <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
1 parent 215d326 commit 8da76f7

File tree

2 files changed

+22
-3
lines changed

2 files changed

+22
-3
lines changed

drivers/scsi/ufs/ufshcd-pci.c

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,11 +44,23 @@ static int ufs_intel_link_startup_notify(struct ufs_hba *hba,
4444
return err;
4545
}
4646

47+
static int ufs_intel_ehl_init(struct ufs_hba *hba)
48+
{
49+
hba->quirks |= UFSHCD_QUIRK_BROKEN_AUTO_HIBERN8;
50+
return 0;
51+
}
52+
4753
static struct ufs_hba_variant_ops ufs_intel_cnl_hba_vops = {
4854
.name = "intel-pci",
4955
.link_startup_notify = ufs_intel_link_startup_notify,
5056
};
5157

58+
static struct ufs_hba_variant_ops ufs_intel_ehl_hba_vops = {
59+
.name = "intel-pci",
60+
.init = ufs_intel_ehl_init,
61+
.link_startup_notify = ufs_intel_link_startup_notify,
62+
};
63+
5264
#ifdef CONFIG_PM_SLEEP
5365
/**
5466
* ufshcd_pci_suspend - suspend power management function
@@ -177,8 +189,8 @@ static const struct dev_pm_ops ufshcd_pci_pm_ops = {
177189
static const struct pci_device_id ufshcd_pci_tbl[] = {
178190
{ PCI_VENDOR_ID_SAMSUNG, 0xC00C, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 },
179191
{ PCI_VDEVICE(INTEL, 0x9DFA), (kernel_ulong_t)&ufs_intel_cnl_hba_vops },
180-
{ PCI_VDEVICE(INTEL, 0x4B41), (kernel_ulong_t)&ufs_intel_cnl_hba_vops },
181-
{ PCI_VDEVICE(INTEL, 0x4B43), (kernel_ulong_t)&ufs_intel_cnl_hba_vops },
192+
{ PCI_VDEVICE(INTEL, 0x4B41), (kernel_ulong_t)&ufs_intel_ehl_hba_vops },
193+
{ PCI_VDEVICE(INTEL, 0x4B43), (kernel_ulong_t)&ufs_intel_ehl_hba_vops },
182194
{ } /* terminate list */
183195
};
184196

drivers/scsi/ufs/ufshcd.h

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -520,6 +520,12 @@ enum ufshcd_quirks {
520520
* OCS FATAL ERROR with device error through sense data
521521
*/
522522
UFSHCD_QUIRK_BROKEN_OCS_FATAL_ERROR = 1 << 10,
523+
524+
/*
525+
* This quirk needs to be enabled if the host controller has
526+
* auto-hibernate capability but it doesn't work.
527+
*/
528+
UFSHCD_QUIRK_BROKEN_AUTO_HIBERN8 = 1 << 11,
523529
};
524530

525531
enum ufshcd_caps {
@@ -803,7 +809,8 @@ return true;
803809

804810
static inline bool ufshcd_is_auto_hibern8_supported(struct ufs_hba *hba)
805811
{
806-
return (hba->capabilities & MASK_AUTO_HIBERN8_SUPPORT);
812+
return (hba->capabilities & MASK_AUTO_HIBERN8_SUPPORT) &&
813+
!(hba->quirks & UFSHCD_QUIRK_BROKEN_AUTO_HIBERN8);
807814
}
808815

809816
static inline bool ufshcd_is_auto_hibern8_enabled(struct ufs_hba *hba)

0 commit comments

Comments
 (0)