hc
2024-02-20 102a0743326a03cd1a1202ceda21e175b7d3575c
kernel/drivers/ata/libata-sata.c
....@@ -317,7 +317,7 @@
317317 * immediately after resuming. Delay 200ms before
318318 * debouncing.
319319 */
320
- if (!(link->flags & ATA_LFLAG_NO_DB_DELAY))
320
+ if (!(link->flags & ATA_LFLAG_NO_DEBOUNCE_DELAY))
321321 ata_msleep(link->ap, 200);
322322
323323 /* is SControl restored correctly? */
....@@ -394,10 +394,23 @@
394394 case ATA_LPM_MED_POWER_WITH_DIPM:
395395 case ATA_LPM_MIN_POWER_WITH_PARTIAL:
396396 case ATA_LPM_MIN_POWER:
397
- if (ata_link_nr_enabled(link) > 0)
398
- /* no restrictions on LPM transitions */
397
+ if (ata_link_nr_enabled(link) > 0) {
398
+ /* assume no restrictions on LPM transitions */
399399 scontrol &= ~(0x7 << 8);
400
- else {
400
+
401
+ /*
402
+ * If the controller does not support partial, slumber,
403
+ * or devsleep, then disallow these transitions.
404
+ */
405
+ if (link->ap->host->flags & ATA_HOST_NO_PART)
406
+ scontrol |= (0x1 << 8);
407
+
408
+ if (link->ap->host->flags & ATA_HOST_NO_SSC)
409
+ scontrol |= (0x2 << 8);
410
+
411
+ if (link->ap->host->flags & ATA_HOST_NO_DEVSLP)
412
+ scontrol |= (0x4 << 8);
413
+ } else {
401414 /* empty port, power off */
402415 scontrol &= ~0xf;
403416 scontrol |= (0x1 << 2);