Skip to content

Commit bf6f158

Browse files
committed
ahci: clean up ahci_broken_devslp quirk
Most quirks are applied using a specific board type board_ahci_no* (e.g. board_ahci_nomsi, board_ahci_noncq), which then sets a flag representing the specific quirk. ahci_pci_tbl (which is the table of all supported PCI devices), then uses that board type for the PCI vendor and device IDs which need to be quirked. The ahci_broken_devslp quirk is not implemented in this standard way. Modify the ahci_broken_devslp quirk to be implemented like the other quirks. This way, we will not have the same PCI device and vendor ID scattered over ahci.c. It will simply be defined in a single location. Suggested-by: Dan Williams <[email protected]> Reviewed-by: Damien Le Moal <[email protected]> Reviewed-by: Mika Westerberg <[email protected]> Signed-off-by: Niklas Cassel <[email protected]>
1 parent f2b70a2 commit bf6f158

File tree

1 file changed

+10
-16
lines changed

1 file changed

+10
-16
lines changed

drivers/ata/ahci.c

Lines changed: 10 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ enum board_ids {
6161
* without testing that the platform actually works without the quirk.)
6262
*/
6363
board_ahci_pcs_quirk,
64+
board_ahci_pcs_quirk_no_devslp,
6465
board_ahci_pcs_quirk_no_sntf,
6566
board_ahci_yes_fbs,
6667

@@ -172,6 +173,14 @@ static const struct ata_port_info ahci_port_info[] = {
172173
.udma_mask = ATA_UDMA6,
173174
.port_ops = &ahci_ops,
174175
},
176+
[board_ahci_pcs_quirk_no_devslp] = {
177+
AHCI_HFLAGS (AHCI_HFLAG_INTEL_PCS_QUIRK |
178+
AHCI_HFLAG_NO_DEVSLP),
179+
.flags = AHCI_FLAG_COMMON,
180+
.pio_mask = ATA_PIO4,
181+
.udma_mask = ATA_UDMA6,
182+
.port_ops = &ahci_ops,
183+
},
175184
[board_ahci_pcs_quirk_no_sntf] = {
176185
AHCI_HFLAGS (AHCI_HFLAG_INTEL_PCS_QUIRK |
177186
AHCI_HFLAG_NO_SNTF),
@@ -420,7 +429,7 @@ static const struct pci_device_id ahci_pci_tbl[] = {
420429
{ PCI_VDEVICE(INTEL, 0x06d7), board_ahci_pcs_quirk }, /* Comet Lake-H RAID */
421430
{ PCI_VDEVICE(INTEL, 0xa386), board_ahci_pcs_quirk }, /* Comet Lake PCH-V RAID */
422431
{ PCI_VDEVICE(INTEL, 0x0f22), board_ahci_pcs_quirk }, /* Bay Trail AHCI */
423-
{ PCI_VDEVICE(INTEL, 0x0f23), board_ahci_pcs_quirk }, /* Bay Trail AHCI */
432+
{ PCI_VDEVICE(INTEL, 0x0f23), board_ahci_pcs_quirk_no_devslp }, /* Bay Trail AHCI */
424433
{ PCI_VDEVICE(INTEL, 0x22a3), board_ahci_pcs_quirk }, /* Cherry Tr. AHCI */
425434
{ PCI_VDEVICE(INTEL, 0x5ae3), board_ahci_pcs_quirk }, /* ApolloLake AHCI */
426435
{ PCI_VDEVICE(INTEL, 0x34d3), board_ahci_pcs_quirk }, /* Ice Lake LP AHCI */
@@ -1420,17 +1429,6 @@ static bool ahci_broken_online(struct pci_dev *pdev)
14201429
return pdev->bus->number == (val >> 8) && pdev->devfn == (val & 0xff);
14211430
}
14221431

1423-
static bool ahci_broken_devslp(struct pci_dev *pdev)
1424-
{
1425-
/* device with broken DEVSLP but still showing SDS capability */
1426-
static const struct pci_device_id ids[] = {
1427-
{ PCI_VDEVICE(INTEL, 0x0f23)}, /* Valleyview SoC */
1428-
{}
1429-
};
1430-
1431-
return pci_match_id(ids, pdev);
1432-
}
1433-
14341432
#ifdef CONFIG_ATA_ACPI
14351433
static void ahci_gtf_filter_workaround(struct ata_host *host)
14361434
{
@@ -1823,10 +1821,6 @@ static int ahci_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
18231821
&dev_attr_remapped_nvme.attr,
18241822
NULL);
18251823

1826-
/* must set flag prior to save config in order to take effect */
1827-
if (ahci_broken_devslp(pdev))
1828-
hpriv->flags |= AHCI_HFLAG_NO_DEVSLP;
1829-
18301824
#ifdef CONFIG_ARM64
18311825
if (pdev->vendor == PCI_VENDOR_ID_HUAWEI &&
18321826
pdev->device == 0xa235 &&

0 commit comments

Comments
 (0)