Skip to content

Commit ae01b24

Browse files
htejunjgarzik
authored andcommitted
libata: Implement ATA_FLAG_NO_DIPM and apply it to mcp65
NVIDIA mcp65 familiy of controllers cause command timeouts when DIPM is used. Implement ATA_FLAG_NO_DIPM and apply it. This problem was reported by Stefan Bader in the following thread. http://thread.gmane.org/gmane.linux.ide/48841 stable: applicable to 2.6.37 and 38. Signed-off-by: Tejun Heo <[email protected]> Reported-by: Stefan Bader <[email protected]> Cc: [email protected] Signed-off-by: Jeff Garzik <[email protected]>
1 parent 3f7ac1d commit ae01b24

File tree

3 files changed

+6
-3
lines changed

3 files changed

+6
-3
lines changed

drivers/ata/ahci.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ static const struct ata_port_info ahci_port_info[] = {
150150
{
151151
AHCI_HFLAGS (AHCI_HFLAG_NO_FPDMA_AA | AHCI_HFLAG_NO_PMP |
152152
AHCI_HFLAG_YES_NCQ),
153-
.flags = AHCI_FLAG_COMMON,
153+
.flags = AHCI_FLAG_COMMON | ATA_FLAG_NO_DIPM,
154154
.pio_mask = ATA_PIO4,
155155
.udma_mask = ATA_UDMA6,
156156
.port_ops = &ahci_ops,

drivers/ata/libata-eh.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3316,6 +3316,7 @@ static int ata_eh_set_lpm(struct ata_link *link, enum ata_lpm_policy policy,
33163316
struct ata_eh_context *ehc = &link->eh_context;
33173317
struct ata_device *dev, *link_dev = NULL, *lpm_dev = NULL;
33183318
enum ata_lpm_policy old_policy = link->lpm_policy;
3319+
bool no_dipm = ap->flags & ATA_FLAG_NO_DIPM;
33193320
unsigned int hints = ATA_LPM_EMPTY | ATA_LPM_HIPM;
33203321
unsigned int err_mask;
33213322
int rc;
@@ -3332,7 +3333,7 @@ static int ata_eh_set_lpm(struct ata_link *link, enum ata_lpm_policy policy,
33323333
*/
33333334
ata_for_each_dev(dev, link, ENABLED) {
33343335
bool hipm = ata_id_has_hipm(dev->id);
3335-
bool dipm = ata_id_has_dipm(dev->id);
3336+
bool dipm = ata_id_has_dipm(dev->id) && !no_dipm;
33363337

33373338
/* find the first enabled and LPM enabled devices */
33383339
if (!link_dev)
@@ -3389,7 +3390,8 @@ static int ata_eh_set_lpm(struct ata_link *link, enum ata_lpm_policy policy,
33893390

33903391
/* host config updated, enable DIPM if transitioning to MIN_POWER */
33913392
ata_for_each_dev(dev, link, ENABLED) {
3392-
if (policy == ATA_LPM_MIN_POWER && ata_id_has_dipm(dev->id)) {
3393+
if (policy == ATA_LPM_MIN_POWER && !no_dipm &&
3394+
ata_id_has_dipm(dev->id)) {
33933395
err_mask = ata_dev_set_feature(dev,
33943396
SETFEATURES_SATA_ENABLE, SATA_DIPM);
33953397
if (err_mask && err_mask != AC_ERR_DEV) {

include/linux/libata.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,7 @@ enum {
196196
* management */
197197
ATA_FLAG_SW_ACTIVITY = (1 << 22), /* driver supports sw activity
198198
* led */
199+
ATA_FLAG_NO_DIPM = (1 << 23), /* host not happy with DIPM */
199200

200201
/* bits 24:31 of ap->flags are reserved for LLD specific flags */
201202

0 commit comments

Comments
 (0)