Merge branch 'upstream-linus' of master.kernel.org:/pub/scm/linux/kernel/git/jgarzik/libata-dev

* 'upstream-linus' of master.kernel.org:/pub/scm/linux/kernel/git/jgarzik/libata-dev:
[PATCH] ata_piix: add map 01b for ICH7M
[libata] sata_mv: errata check buglet fix

+35 -4
+34 -2
drivers/scsi/ata_piix.c
··· 123 123 ich6_sata = 4, 124 124 ich6_sata_ahci = 5, 125 125 ich6m_sata_ahci = 6, 126 - ich8_sata_ahci = 7, 126 + ich7m_sata_ahci = 7, 127 + ich8_sata_ahci = 8, 127 128 128 129 /* constants for mapping table */ 129 130 P0 = 0, /* port 0 */ ··· 189 188 /* 82801GB/GR/GH (ICH7, identical to ICH6) */ 190 189 { 0x8086, 0x27c0, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich6_sata_ahci }, 191 190 /* 2801GBM/GHM (ICH7M, identical to ICH6M) */ 192 - { 0x8086, 0x27c4, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich6m_sata_ahci }, 191 + { 0x8086, 0x27c4, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich7m_sata_ahci }, 193 192 /* Enterprise Southbridge 2 (where's the datasheet?) */ 194 193 { 0x8086, 0x2680, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich6_sata_ahci }, 195 194 /* SATA Controller 1 IDE (ICH8, no datasheet yet) */ ··· 337 336 }, 338 337 }; 339 338 339 + static const struct piix_map_db ich7m_map_db = { 340 + .mask = 0x3, 341 + .port_enable = 0x5, 342 + .present_shift = 4, 343 + 344 + /* Map 01b isn't specified in the doc but some notebooks use 345 + * it anyway. ATM, the only case spotted carries subsystem ID 346 + * 1025:0107. This is the only difference from ich6m. 347 + */ 348 + .map = { 349 + /* PM PS SM SS MAP */ 350 + { P0, P2, RV, RV }, /* 00b */ 351 + { IDE, IDE, P1, P3 }, /* 01b */ 352 + { P0, P2, IDE, IDE }, /* 10b */ 353 + { RV, RV, RV, RV }, 354 + }, 355 + }; 356 + 340 357 static const struct piix_map_db ich8_map_db = { 341 358 .mask = 0x3, 342 359 .port_enable = 0x3, ··· 374 355 [ich6_sata] = &ich6_map_db, 375 356 [ich6_sata_ahci] = &ich6_map_db, 376 357 [ich6m_sata_ahci] = &ich6m_map_db, 358 + [ich7m_sata_ahci] = &ich7m_map_db, 377 359 [ich8_sata_ahci] = &ich8_map_db, 378 360 }; 379 361 ··· 453 433 }, 454 434 455 435 /* ich6m_sata_ahci */ 436 + { 437 + .sht = &piix_sht, 438 + .host_flags = ATA_FLAG_SATA | 439 + PIIX_FLAG_CHECKINTR | PIIX_FLAG_SCR | 440 + PIIX_FLAG_AHCI, 441 + .pio_mask = 0x1f, /* pio0-4 */ 442 + .mwdma_mask = 0x07, /* mwdma0-2 */ 443 + .udma_mask = 0x7f, /* udma0-6 */ 444 + .port_ops = &piix_sata_ops, 445 + }, 446 + 447 + /* ich7m_sata_ahci */ 456 448 { 457 449 .sht = &piix_sht, 458 450 .host_flags = ATA_FLAG_SATA |
+1 -2
drivers/scsi/sata_mv.c
··· 1961 1961 timeout = jiffies + msecs_to_jiffies(200); 1962 1962 do { 1963 1963 sata_scr_read(ap, SCR_STATUS, &sstatus); 1964 - sstatus &= 0x3; 1965 - if ((sstatus == 3) || (sstatus == 0)) 1964 + if (((sstatus & 0x3) == 3) || ((sstatus & 0x3) == 0)) 1966 1965 break; 1967 1966 1968 1967 __msleep(1, can_sleep);