|
@@ -3316,6 +3316,7 @@ static int ata_eh_set_lpm(struct ata_link *link, enum ata_lpm_policy policy,
|
|
struct ata_eh_context *ehc = &link->eh_context;
|
|
struct ata_eh_context *ehc = &link->eh_context;
|
|
struct ata_device *dev, *link_dev = NULL, *lpm_dev = NULL;
|
|
struct ata_device *dev, *link_dev = NULL, *lpm_dev = NULL;
|
|
enum ata_lpm_policy old_policy = link->lpm_policy;
|
|
enum ata_lpm_policy old_policy = link->lpm_policy;
|
|
|
|
+ bool no_dipm = ap->flags & ATA_FLAG_NO_DIPM;
|
|
unsigned int hints = ATA_LPM_EMPTY | ATA_LPM_HIPM;
|
|
unsigned int hints = ATA_LPM_EMPTY | ATA_LPM_HIPM;
|
|
unsigned int err_mask;
|
|
unsigned int err_mask;
|
|
int rc;
|
|
int rc;
|
|
@@ -3332,7 +3333,7 @@ static int ata_eh_set_lpm(struct ata_link *link, enum ata_lpm_policy policy,
|
|
*/
|
|
*/
|
|
ata_for_each_dev(dev, link, ENABLED) {
|
|
ata_for_each_dev(dev, link, ENABLED) {
|
|
bool hipm = ata_id_has_hipm(dev->id);
|
|
bool hipm = ata_id_has_hipm(dev->id);
|
|
- bool dipm = ata_id_has_dipm(dev->id);
|
|
|
|
|
|
+ bool dipm = ata_id_has_dipm(dev->id) && !no_dipm;
|
|
|
|
|
|
/* find the first enabled and LPM enabled devices */
|
|
/* find the first enabled and LPM enabled devices */
|
|
if (!link_dev)
|
|
if (!link_dev)
|
|
@@ -3389,7 +3390,8 @@ static int ata_eh_set_lpm(struct ata_link *link, enum ata_lpm_policy policy,
|
|
|
|
|
|
/* host config updated, enable DIPM if transitioning to MIN_POWER */
|
|
/* host config updated, enable DIPM if transitioning to MIN_POWER */
|
|
ata_for_each_dev(dev, link, ENABLED) {
|
|
ata_for_each_dev(dev, link, ENABLED) {
|
|
- if (policy == ATA_LPM_MIN_POWER && ata_id_has_dipm(dev->id)) {
|
|
|
|
|
|
+ if (policy == ATA_LPM_MIN_POWER && !no_dipm &&
|
|
|
|
+ ata_id_has_dipm(dev->id)) {
|
|
err_mask = ata_dev_set_feature(dev,
|
|
err_mask = ata_dev_set_feature(dev,
|
|
SETFEATURES_SATA_ENABLE, SATA_DIPM);
|
|
SETFEATURES_SATA_ENABLE, SATA_DIPM);
|
|
if (err_mask && err_mask != AC_ERR_DEV) {
|
|
if (err_mask && err_mask != AC_ERR_DEV) {
|