.. | .. |
---|
317 | 317 | * immediately after resuming. Delay 200ms before |
---|
318 | 318 | * debouncing. |
---|
319 | 319 | */ |
---|
320 | | - if (!(link->flags & ATA_LFLAG_NO_DB_DELAY)) |
---|
| 320 | + if (!(link->flags & ATA_LFLAG_NO_DEBOUNCE_DELAY)) |
---|
321 | 321 | ata_msleep(link->ap, 200); |
---|
322 | 322 | |
---|
323 | 323 | /* is SControl restored correctly? */ |
---|
.. | .. |
---|
394 | 394 | case ATA_LPM_MED_POWER_WITH_DIPM: |
---|
395 | 395 | case ATA_LPM_MIN_POWER_WITH_PARTIAL: |
---|
396 | 396 | 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 */ |
---|
399 | 399 | 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 { |
---|
401 | 414 | /* empty port, power off */ |
---|
402 | 415 | scontrol &= ~0xf; |
---|
403 | 416 | scontrol |= (0x1 << 2); |
---|