Skip to content

Commit 7627a0e

Browse files
superm1floatious
authored andcommitted
ata: ahci: Drop low power policy board type
The low power policy board type was introduced to allow systems to get into deep states reliably. Before it was introduced `min_power` was causing problems for a number of drives. New power policies `min_power_with_partial` and `med_power_with_dipm` have been introduced which provide a more stable baseline for systems. Tested-by: Damien Le Moal <[email protected]> Tested-by: Jian-Hong Pan <[email protected]> Acked-by: Jian-Hong Pan <[email protected]> Acked-by: Christoph Hellwig <[email protected]> Reviewed-by: Damien Le Moal <[email protected]> Reviewed-by: Mario Limonciello <[email protected]> Reviewed-by: Mika Westerberg <[email protected]> Suggested-by: Christoph Hellwig <[email protected]> Signed-off-by: Mario Limonciello <[email protected]> [cassel: rebase patch and fix trivial conflicts] Signed-off-by: Niklas Cassel <[email protected]>
1 parent ae1f3db commit 7627a0e

File tree

3 files changed

+53
-70
lines changed

3 files changed

+53
-70
lines changed

drivers/ata/Kconfig

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -116,15 +116,14 @@ config SATA_AHCI
116116
If unsure, say N.
117117

118118
config SATA_MOBILE_LPM_POLICY
119-
int "Default SATA Link Power Management policy for low power chipsets"
119+
int "Default SATA Link Power Management policy"
120120
range 0 4
121121
default 0
122122
depends on SATA_AHCI
123123
help
124124
Select the Default SATA Link Power Management (LPM) policy to use
125125
for chipsets / "South Bridges" supporting low-power modes. Such
126-
chipsets are typically found on most laptops but desktops and
127-
servers now also widely use chipsets supporting low power modes.
126+
chipsets are ubiquitous across laptops, desktops and servers.
128127

129128
The value set has the following meanings:
130129
0 => Keep firmware settings

drivers/ata/ahci.c

Lines changed: 48 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,6 @@ enum board_ids {
5050
board_ahci,
5151
board_ahci_43bit_dma,
5252
board_ahci_ign_iferr,
53-
board_ahci_low_power,
5453
board_ahci_no_debounce_delay,
5554
board_ahci_nomsi,
5655
board_ahci_noncq,
@@ -143,13 +142,6 @@ static const struct ata_port_info ahci_port_info[] = {
143142
.udma_mask = ATA_UDMA6,
144143
.port_ops = &ahci_ops,
145144
},
146-
[board_ahci_low_power] = {
147-
AHCI_HFLAGS (AHCI_HFLAG_USE_LPM_POLICY),
148-
.flags = AHCI_FLAG_COMMON,
149-
.pio_mask = ATA_PIO4,
150-
.udma_mask = ATA_UDMA6,
151-
.port_ops = &ahci_ops,
152-
},
153145
[board_ahci_no_debounce_delay] = {
154146
.flags = AHCI_FLAG_COMMON,
155147
.link_flags = ATA_LFLAG_NO_DEBOUNCE_DELAY,
@@ -283,13 +275,13 @@ static const struct pci_device_id ahci_pci_tbl[] = {
283275
{ PCI_VDEVICE(INTEL, 0x2924), board_ahci }, /* ICH9 */
284276
{ PCI_VDEVICE(INTEL, 0x2925), board_ahci }, /* ICH9 */
285277
{ PCI_VDEVICE(INTEL, 0x2927), board_ahci }, /* ICH9 */
286-
{ PCI_VDEVICE(INTEL, 0x2929), board_ahci_low_power }, /* ICH9M */
287-
{ PCI_VDEVICE(INTEL, 0x292a), board_ahci_low_power }, /* ICH9M */
288-
{ PCI_VDEVICE(INTEL, 0x292b), board_ahci_low_power }, /* ICH9M */
289-
{ PCI_VDEVICE(INTEL, 0x292c), board_ahci_low_power }, /* ICH9M */
290-
{ PCI_VDEVICE(INTEL, 0x292f), board_ahci_low_power }, /* ICH9M */
278+
{ PCI_VDEVICE(INTEL, 0x2929), board_ahci }, /* ICH9M */
279+
{ PCI_VDEVICE(INTEL, 0x292a), board_ahci }, /* ICH9M */
280+
{ PCI_VDEVICE(INTEL, 0x292b), board_ahci }, /* ICH9M */
281+
{ PCI_VDEVICE(INTEL, 0x292c), board_ahci }, /* ICH9M */
282+
{ PCI_VDEVICE(INTEL, 0x292f), board_ahci }, /* ICH9M */
291283
{ PCI_VDEVICE(INTEL, 0x294d), board_ahci }, /* ICH9 */
292-
{ PCI_VDEVICE(INTEL, 0x294e), board_ahci_low_power }, /* ICH9M */
284+
{ PCI_VDEVICE(INTEL, 0x294e), board_ahci }, /* ICH9M */
293285
{ PCI_VDEVICE(INTEL, 0x502a), board_ahci }, /* Tolapai */
294286
{ PCI_VDEVICE(INTEL, 0x502b), board_ahci }, /* Tolapai */
295287
{ PCI_VDEVICE(INTEL, 0x3a05), board_ahci }, /* ICH10 */
@@ -299,9 +291,9 @@ static const struct pci_device_id ahci_pci_tbl[] = {
299291
{ PCI_VDEVICE(INTEL, 0x3b23), board_ahci }, /* PCH AHCI */
300292
{ PCI_VDEVICE(INTEL, 0x3b24), board_ahci }, /* PCH RAID */
301293
{ PCI_VDEVICE(INTEL, 0x3b25), board_ahci }, /* PCH RAID */
302-
{ PCI_VDEVICE(INTEL, 0x3b29), board_ahci_low_power }, /* PCH M AHCI */
294+
{ PCI_VDEVICE(INTEL, 0x3b29), board_ahci }, /* PCH M AHCI */
303295
{ PCI_VDEVICE(INTEL, 0x3b2b), board_ahci }, /* PCH RAID */
304-
{ PCI_VDEVICE(INTEL, 0x3b2c), board_ahci_low_power }, /* PCH M RAID */
296+
{ PCI_VDEVICE(INTEL, 0x3b2c), board_ahci }, /* PCH M RAID */
305297
{ PCI_VDEVICE(INTEL, 0x3b2f), board_ahci }, /* PCH AHCI */
306298
{ PCI_VDEVICE(INTEL, 0x19b0), board_ahci_pcs7 }, /* DNV AHCI */
307299
{ PCI_VDEVICE(INTEL, 0x19b1), board_ahci_pcs7 }, /* DNV AHCI */
@@ -324,39 +316,39 @@ static const struct pci_device_id ahci_pci_tbl[] = {
324316
{ PCI_VDEVICE(INTEL, 0x19cE), board_ahci_pcs7 }, /* DNV AHCI */
325317
{ PCI_VDEVICE(INTEL, 0x19cF), board_ahci_pcs7 }, /* DNV AHCI */
326318
{ PCI_VDEVICE(INTEL, 0x1c02), board_ahci }, /* CPT AHCI */
327-
{ PCI_VDEVICE(INTEL, 0x1c03), board_ahci_low_power }, /* CPT M AHCI */
319+
{ PCI_VDEVICE(INTEL, 0x1c03), board_ahci }, /* CPT M AHCI */
328320
{ PCI_VDEVICE(INTEL, 0x1c04), board_ahci }, /* CPT RAID */
329-
{ PCI_VDEVICE(INTEL, 0x1c05), board_ahci_low_power }, /* CPT M RAID */
321+
{ PCI_VDEVICE(INTEL, 0x1c05), board_ahci }, /* CPT M RAID */
330322
{ PCI_VDEVICE(INTEL, 0x1c06), board_ahci }, /* CPT RAID */
331323
{ PCI_VDEVICE(INTEL, 0x1c07), board_ahci }, /* CPT RAID */
332324
{ PCI_VDEVICE(INTEL, 0x1d02), board_ahci }, /* PBG AHCI */
333325
{ PCI_VDEVICE(INTEL, 0x1d04), board_ahci }, /* PBG RAID */
334326
{ PCI_VDEVICE(INTEL, 0x1d06), board_ahci }, /* PBG RAID */
335327
{ PCI_VDEVICE(INTEL, 0x2323), board_ahci }, /* DH89xxCC AHCI */
336328
{ PCI_VDEVICE(INTEL, 0x1e02), board_ahci }, /* Panther Point AHCI */
337-
{ PCI_VDEVICE(INTEL, 0x1e03), board_ahci_low_power }, /* Panther M AHCI */
329+
{ PCI_VDEVICE(INTEL, 0x1e03), board_ahci }, /* Panther M AHCI */
338330
{ PCI_VDEVICE(INTEL, 0x1e04), board_ahci }, /* Panther Point RAID */
339331
{ PCI_VDEVICE(INTEL, 0x1e05), board_ahci }, /* Panther Point RAID */
340332
{ PCI_VDEVICE(INTEL, 0x1e06), board_ahci }, /* Panther Point RAID */
341-
{ PCI_VDEVICE(INTEL, 0x1e07), board_ahci_low_power }, /* Panther M RAID */
333+
{ PCI_VDEVICE(INTEL, 0x1e07), board_ahci }, /* Panther M RAID */
342334
{ PCI_VDEVICE(INTEL, 0x1e0e), board_ahci }, /* Panther Point RAID */
343335
{ PCI_VDEVICE(INTEL, 0x8c02), board_ahci }, /* Lynx Point AHCI */
344-
{ PCI_VDEVICE(INTEL, 0x8c03), board_ahci_low_power }, /* Lynx M AHCI */
336+
{ PCI_VDEVICE(INTEL, 0x8c03), board_ahci }, /* Lynx M AHCI */
345337
{ PCI_VDEVICE(INTEL, 0x8c04), board_ahci }, /* Lynx Point RAID */
346-
{ PCI_VDEVICE(INTEL, 0x8c05), board_ahci_low_power }, /* Lynx M RAID */
338+
{ PCI_VDEVICE(INTEL, 0x8c05), board_ahci }, /* Lynx M RAID */
347339
{ PCI_VDEVICE(INTEL, 0x8c06), board_ahci }, /* Lynx Point RAID */
348-
{ PCI_VDEVICE(INTEL, 0x8c07), board_ahci_low_power }, /* Lynx M RAID */
340+
{ PCI_VDEVICE(INTEL, 0x8c07), board_ahci }, /* Lynx M RAID */
349341
{ PCI_VDEVICE(INTEL, 0x8c0e), board_ahci }, /* Lynx Point RAID */
350-
{ PCI_VDEVICE(INTEL, 0x8c0f), board_ahci_low_power }, /* Lynx M RAID */
351-
{ PCI_VDEVICE(INTEL, 0x9c02), board_ahci_low_power }, /* Lynx LP AHCI */
352-
{ PCI_VDEVICE(INTEL, 0x9c03), board_ahci_low_power }, /* Lynx LP AHCI */
353-
{ PCI_VDEVICE(INTEL, 0x9c04), board_ahci_low_power }, /* Lynx LP RAID */
354-
{ PCI_VDEVICE(INTEL, 0x9c05), board_ahci_low_power }, /* Lynx LP RAID */
355-
{ PCI_VDEVICE(INTEL, 0x9c06), board_ahci_low_power }, /* Lynx LP RAID */
356-
{ PCI_VDEVICE(INTEL, 0x9c07), board_ahci_low_power }, /* Lynx LP RAID */
357-
{ PCI_VDEVICE(INTEL, 0x9c0e), board_ahci_low_power }, /* Lynx LP RAID */
358-
{ PCI_VDEVICE(INTEL, 0x9c0f), board_ahci_low_power }, /* Lynx LP RAID */
359-
{ PCI_VDEVICE(INTEL, 0x9dd3), board_ahci_low_power }, /* Cannon Lake PCH-LP AHCI */
342+
{ PCI_VDEVICE(INTEL, 0x8c0f), board_ahci }, /* Lynx M RAID */
343+
{ PCI_VDEVICE(INTEL, 0x9c02), board_ahci }, /* Lynx LP AHCI */
344+
{ PCI_VDEVICE(INTEL, 0x9c03), board_ahci }, /* Lynx LP AHCI */
345+
{ PCI_VDEVICE(INTEL, 0x9c04), board_ahci }, /* Lynx LP RAID */
346+
{ PCI_VDEVICE(INTEL, 0x9c05), board_ahci }, /* Lynx LP RAID */
347+
{ PCI_VDEVICE(INTEL, 0x9c06), board_ahci }, /* Lynx LP RAID */
348+
{ PCI_VDEVICE(INTEL, 0x9c07), board_ahci }, /* Lynx LP RAID */
349+
{ PCI_VDEVICE(INTEL, 0x9c0e), board_ahci }, /* Lynx LP RAID */
350+
{ PCI_VDEVICE(INTEL, 0x9c0f), board_ahci }, /* Lynx LP RAID */
351+
{ PCI_VDEVICE(INTEL, 0x9dd3), board_ahci }, /* Cannon Lake PCH-LP AHCI */
360352
{ PCI_VDEVICE(INTEL, 0x1f22), board_ahci }, /* Avoton AHCI */
361353
{ PCI_VDEVICE(INTEL, 0x1f23), board_ahci }, /* Avoton AHCI */
362354
{ PCI_VDEVICE(INTEL, 0x1f24), board_ahci }, /* Avoton RAID */
@@ -390,26 +382,26 @@ static const struct pci_device_id ahci_pci_tbl[] = {
390382
{ PCI_VDEVICE(INTEL, 0x8d66), board_ahci }, /* Wellsburg RAID */
391383
{ PCI_VDEVICE(INTEL, 0x8d6e), board_ahci }, /* Wellsburg RAID */
392384
{ PCI_VDEVICE(INTEL, 0x23a3), board_ahci }, /* Coleto Creek AHCI */
393-
{ PCI_VDEVICE(INTEL, 0x9c83), board_ahci_low_power }, /* Wildcat LP AHCI */
394-
{ PCI_VDEVICE(INTEL, 0x9c85), board_ahci_low_power }, /* Wildcat LP RAID */
395-
{ PCI_VDEVICE(INTEL, 0x9c87), board_ahci_low_power }, /* Wildcat LP RAID */
396-
{ PCI_VDEVICE(INTEL, 0x9c8f), board_ahci_low_power }, /* Wildcat LP RAID */
385+
{ PCI_VDEVICE(INTEL, 0x9c83), board_ahci }, /* Wildcat LP AHCI */
386+
{ PCI_VDEVICE(INTEL, 0x9c85), board_ahci }, /* Wildcat LP RAID */
387+
{ PCI_VDEVICE(INTEL, 0x9c87), board_ahci }, /* Wildcat LP RAID */
388+
{ PCI_VDEVICE(INTEL, 0x9c8f), board_ahci }, /* Wildcat LP RAID */
397389
{ PCI_VDEVICE(INTEL, 0x8c82), board_ahci }, /* 9 Series AHCI */
398-
{ PCI_VDEVICE(INTEL, 0x8c83), board_ahci_low_power }, /* 9 Series M AHCI */
390+
{ PCI_VDEVICE(INTEL, 0x8c83), board_ahci }, /* 9 Series M AHCI */
399391
{ PCI_VDEVICE(INTEL, 0x8c84), board_ahci }, /* 9 Series RAID */
400-
{ PCI_VDEVICE(INTEL, 0x8c85), board_ahci_low_power }, /* 9 Series M RAID */
392+
{ PCI_VDEVICE(INTEL, 0x8c85), board_ahci }, /* 9 Series M RAID */
401393
{ PCI_VDEVICE(INTEL, 0x8c86), board_ahci }, /* 9 Series RAID */
402-
{ PCI_VDEVICE(INTEL, 0x8c87), board_ahci_low_power }, /* 9 Series M RAID */
394+
{ PCI_VDEVICE(INTEL, 0x8c87), board_ahci }, /* 9 Series M RAID */
403395
{ PCI_VDEVICE(INTEL, 0x8c8e), board_ahci }, /* 9 Series RAID */
404-
{ PCI_VDEVICE(INTEL, 0x8c8f), board_ahci_low_power }, /* 9 Series M RAID */
405-
{ PCI_VDEVICE(INTEL, 0x9d03), board_ahci_low_power }, /* Sunrise LP AHCI */
406-
{ PCI_VDEVICE(INTEL, 0x9d05), board_ahci_low_power }, /* Sunrise LP RAID */
407-
{ PCI_VDEVICE(INTEL, 0x9d07), board_ahci_low_power }, /* Sunrise LP RAID */
396+
{ PCI_VDEVICE(INTEL, 0x8c8f), board_ahci }, /* 9 Series M RAID */
397+
{ PCI_VDEVICE(INTEL, 0x9d03), board_ahci }, /* Sunrise LP AHCI */
398+
{ PCI_VDEVICE(INTEL, 0x9d05), board_ahci }, /* Sunrise LP RAID */
399+
{ PCI_VDEVICE(INTEL, 0x9d07), board_ahci }, /* Sunrise LP RAID */
408400
{ PCI_VDEVICE(INTEL, 0xa102), board_ahci }, /* Sunrise Point-H AHCI */
409-
{ PCI_VDEVICE(INTEL, 0xa103), board_ahci_low_power }, /* Sunrise M AHCI */
401+
{ PCI_VDEVICE(INTEL, 0xa103), board_ahci }, /* Sunrise M AHCI */
410402
{ PCI_VDEVICE(INTEL, 0xa105), board_ahci }, /* Sunrise Point-H RAID */
411403
{ PCI_VDEVICE(INTEL, 0xa106), board_ahci }, /* Sunrise Point-H RAID */
412-
{ PCI_VDEVICE(INTEL, 0xa107), board_ahci_low_power }, /* Sunrise M RAID */
404+
{ PCI_VDEVICE(INTEL, 0xa107), board_ahci }, /* Sunrise M RAID */
413405
{ PCI_VDEVICE(INTEL, 0xa10f), board_ahci }, /* Sunrise Point-H RAID */
414406
{ PCI_VDEVICE(INTEL, 0xa182), board_ahci }, /* Lewisburg AHCI*/
415407
{ PCI_VDEVICE(INTEL, 0xa186), board_ahci }, /* Lewisburg RAID*/
@@ -422,16 +414,16 @@ static const struct pci_device_id ahci_pci_tbl[] = {
422414
{ PCI_VDEVICE(INTEL, 0xa356), board_ahci }, /* Cannon Lake PCH-H RAID */
423415
{ PCI_VDEVICE(INTEL, 0x06d7), board_ahci }, /* Comet Lake-H RAID */
424416
{ PCI_VDEVICE(INTEL, 0xa386), board_ahci }, /* Comet Lake PCH-V RAID */
425-
{ PCI_VDEVICE(INTEL, 0x0f22), board_ahci_low_power }, /* Bay Trail AHCI */
426-
{ PCI_VDEVICE(INTEL, 0x0f23), board_ahci_low_power }, /* Bay Trail AHCI */
427-
{ PCI_VDEVICE(INTEL, 0x22a3), board_ahci_low_power }, /* Cherry Tr. AHCI */
428-
{ PCI_VDEVICE(INTEL, 0x5ae3), board_ahci_low_power }, /* ApolloLake AHCI */
429-
{ PCI_VDEVICE(INTEL, 0x34d3), board_ahci_low_power }, /* Ice Lake LP AHCI */
430-
{ PCI_VDEVICE(INTEL, 0x02d3), board_ahci_low_power }, /* Comet Lake PCH-U AHCI */
431-
{ PCI_VDEVICE(INTEL, 0x02d7), board_ahci_low_power }, /* Comet Lake PCH RAID */
417+
{ PCI_VDEVICE(INTEL, 0x0f22), board_ahci }, /* Bay Trail AHCI */
418+
{ PCI_VDEVICE(INTEL, 0x0f23), board_ahci }, /* Bay Trail AHCI */
419+
{ PCI_VDEVICE(INTEL, 0x22a3), board_ahci }, /* Cherry Tr. AHCI */
420+
{ PCI_VDEVICE(INTEL, 0x5ae3), board_ahci }, /* ApolloLake AHCI */
421+
{ PCI_VDEVICE(INTEL, 0x34d3), board_ahci }, /* Ice Lake LP AHCI */
422+
{ PCI_VDEVICE(INTEL, 0x02d3), board_ahci }, /* Comet Lake PCH-U AHCI */
423+
{ PCI_VDEVICE(INTEL, 0x02d7), board_ahci }, /* Comet Lake PCH RAID */
432424
/* Elkhart Lake IDs 0x4b60 & 0x4b62 https://sata-io.org/product/8803 not tested yet */
433-
{ PCI_VDEVICE(INTEL, 0x4b63), board_ahci_low_power }, /* Elkhart Lake AHCI */
434-
{ PCI_VDEVICE(INTEL, 0x7ae2), board_ahci_low_power }, /* Alder Lake-P AHCI */
425+
{ PCI_VDEVICE(INTEL, 0x4b63), board_ahci }, /* Elkhart Lake AHCI */
426+
{ PCI_VDEVICE(INTEL, 0x7ae2), board_ahci }, /* Alder Lake-P AHCI */
435427

436428
/* JMicron 360/1/3/5/6, match class to avoid IDE function */
437429
{ PCI_VENDOR_ID_JMICRON, PCI_ANY_ID, PCI_ANY_ID, PCI_ANY_ID,
@@ -459,7 +451,7 @@ static const struct pci_device_id ahci_pci_tbl[] = {
459451
{ PCI_VDEVICE(AMD, 0x7800), board_ahci }, /* AMD Hudson-2 */
460452
{ PCI_VDEVICE(AMD, 0x7801), board_ahci_no_debounce_delay }, /* AMD Hudson-2 (AHCI mode) */
461453
{ PCI_VDEVICE(AMD, 0x7900), board_ahci }, /* AMD CZ */
462-
{ PCI_VDEVICE(AMD, 0x7901), board_ahci_low_power }, /* AMD Green Sardine */
454+
{ PCI_VDEVICE(AMD, 0x7901), board_ahci }, /* AMD Green Sardine */
463455
/* AMD is using RAID class only for ahci controllers */
464456
{ PCI_VENDOR_ID_AMD, PCI_ANY_ID, PCI_ANY_ID, PCI_ANY_ID,
465457
PCI_CLASS_STORAGE_RAID << 8, 0xffffff, board_ahci },
@@ -1660,11 +1652,6 @@ static void ahci_update_initial_lpm_policy(struct ata_port *ap)
16601652
struct ahci_host_priv *hpriv = ap->host->private_data;
16611653
int policy = CONFIG_SATA_MOBILE_LPM_POLICY;
16621654

1663-
1664-
/* Ignore processing for chipsets that don't use policy */
1665-
if (!(hpriv->flags & AHCI_HFLAG_USE_LPM_POLICY))
1666-
return;
1667-
16681655
/*
16691656
* AHCI contains a known incompatibility between LPM and hot-plug
16701657
* removal events, see 7.3.1 Hot Plug Removal Detection and Power

drivers/ata/ahci.h

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -241,13 +241,10 @@ enum {
241241
AHCI_HFLAG_YES_ALPM = BIT(23), /* force ALPM cap on */
242242
AHCI_HFLAG_NO_WRITE_TO_RO = BIT(24), /* don't write to read
243243
only registers */
244-
AHCI_HFLAG_USE_LPM_POLICY = BIT(25), /* chipset that should use
245-
SATA_MOBILE_LPM_POLICY
246-
as default lpm_policy */
247-
AHCI_HFLAG_SUSPEND_PHYS = BIT(26), /* handle PHYs during
244+
AHCI_HFLAG_SUSPEND_PHYS = BIT(25), /* handle PHYs during
248245
suspend/resume */
249-
AHCI_HFLAG_NO_SXS = BIT(28), /* SXS not supported */
250-
AHCI_HFLAG_43BIT_ONLY = BIT(29), /* 43bit DMA addr limit */
246+
AHCI_HFLAG_NO_SXS = BIT(26), /* SXS not supported */
247+
AHCI_HFLAG_43BIT_ONLY = BIT(27), /* 43bit DMA addr limit */
251248

252249
/* ap->flags bits */
253250

0 commit comments

Comments
 (0)