aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTejun Heo <htejun@gmail.com>2008-01-23 10:05:14 -0500
committerJeff Garzik <jgarzik@redhat.com>2008-04-17 15:44:16 -0400
commit8cebf274dd1c955a6e03385a85fd6569ce445946 (patch)
treec459cd20ef93413e063826bb99ca0bcaf67ec8d2
parent672b2d65ba83a6f3f801fd3d58851aa9c0725a54 (diff)
libata: kill ATA_LFLAG_SKIP_D2H_BSY
Some controllers can't reliably record the initial D2H FIS after SATA link is brought online for whatever reason. Advanced controllers which don't have traditional TF register based interface often have this problem as they don't really have the TF registers to update while the controller and link are being initialized. SKIP_D2H_BSY works around the problem by skipping the wait for device readiness before issuing SRST, so for such controllers libata issues SRST blindly and hopes for the best. Now that libata defaults to hardreset, this workaround is no longer necessary. For controllers which have support for hardreset, SRST is never issued by itself. It is only issued as follow-up SRST for device classification and PMP initialization, so there's no need to wait for it from prereset. Kill ATA_LFLAG_SKIP_D2H_BSY. Signed-off-by: Tejun Heo <htejun@gmail.com>
-rw-r--r--drivers/ata/ahci.c7
-rw-r--r--drivers/ata/libata-core.c6
-rw-r--r--drivers/ata/sata_fsl.c2
-rw-r--r--drivers/ata/sata_sil24.c4
-rw-r--r--include/linux/libata.h2
5 files changed, 2 insertions, 19 deletions
diff --git a/drivers/ata/ahci.c b/drivers/ata/ahci.c
index 66d6c8821087..1bd258e5390f 100644
--- a/drivers/ata/ahci.c
+++ b/drivers/ata/ahci.c
@@ -198,7 +198,6 @@ enum {
198 ATA_FLAG_MMIO | ATA_FLAG_PIO_DMA | 198 ATA_FLAG_MMIO | ATA_FLAG_PIO_DMA |
199 ATA_FLAG_ACPI_SATA | ATA_FLAG_AN | 199 ATA_FLAG_ACPI_SATA | ATA_FLAG_AN |
200 ATA_FLAG_IPM, 200 ATA_FLAG_IPM,
201 AHCI_LFLAG_COMMON = ATA_LFLAG_SKIP_D2H_BSY,
202 201
203 ICH_MAP = 0x90, /* ICH MAP register */ 202 ICH_MAP = 0x90, /* ICH MAP register */
204}; 203};
@@ -407,7 +406,6 @@ static const struct ata_port_info ahci_port_info[] = {
407 /* board_ahci */ 406 /* board_ahci */
408 { 407 {
409 .flags = AHCI_FLAG_COMMON, 408 .flags = AHCI_FLAG_COMMON,
410 .link_flags = AHCI_LFLAG_COMMON,
411 .pio_mask = 0x1f, /* pio0-4 */ 409 .pio_mask = 0x1f, /* pio0-4 */
412 .udma_mask = ATA_UDMA6, 410 .udma_mask = ATA_UDMA6,
413 .port_ops = &ahci_ops, 411 .port_ops = &ahci_ops,
@@ -416,7 +414,6 @@ static const struct ata_port_info ahci_port_info[] = {
416 { 414 {
417 AHCI_HFLAGS (AHCI_HFLAG_NO_NCQ | AHCI_HFLAG_NO_PMP), 415 AHCI_HFLAGS (AHCI_HFLAG_NO_NCQ | AHCI_HFLAG_NO_PMP),
418 .flags = AHCI_FLAG_COMMON, 416 .flags = AHCI_FLAG_COMMON,
419 .link_flags = AHCI_LFLAG_COMMON,
420 .pio_mask = 0x1f, /* pio0-4 */ 417 .pio_mask = 0x1f, /* pio0-4 */
421 .udma_mask = ATA_UDMA6, 418 .udma_mask = ATA_UDMA6,
422 .port_ops = &ahci_vt8251_ops, 419 .port_ops = &ahci_vt8251_ops,
@@ -425,7 +422,6 @@ static const struct ata_port_info ahci_port_info[] = {
425 { 422 {
426 AHCI_HFLAGS (AHCI_HFLAG_IGN_IRQ_IF_ERR), 423 AHCI_HFLAGS (AHCI_HFLAG_IGN_IRQ_IF_ERR),
427 .flags = AHCI_FLAG_COMMON, 424 .flags = AHCI_FLAG_COMMON,
428 .link_flags = AHCI_LFLAG_COMMON,
429 .pio_mask = 0x1f, /* pio0-4 */ 425 .pio_mask = 0x1f, /* pio0-4 */
430 .udma_mask = ATA_UDMA6, 426 .udma_mask = ATA_UDMA6,
431 .port_ops = &ahci_ops, 427 .port_ops = &ahci_ops,
@@ -436,7 +432,6 @@ static const struct ata_port_info ahci_port_info[] = {
436 AHCI_HFLAG_32BIT_ONLY | 432 AHCI_HFLAG_32BIT_ONLY |
437 AHCI_HFLAG_SECT255 | AHCI_HFLAG_NO_PMP), 433 AHCI_HFLAG_SECT255 | AHCI_HFLAG_NO_PMP),
438 .flags = AHCI_FLAG_COMMON, 434 .flags = AHCI_FLAG_COMMON,
439 .link_flags = AHCI_LFLAG_COMMON,
440 .pio_mask = 0x1f, /* pio0-4 */ 435 .pio_mask = 0x1f, /* pio0-4 */
441 .udma_mask = ATA_UDMA6, 436 .udma_mask = ATA_UDMA6,
442 .port_ops = &ahci_ops, 437 .port_ops = &ahci_ops,
@@ -447,7 +442,6 @@ static const struct ata_port_info ahci_port_info[] = {
447 AHCI_HFLAG_MV_PATA), 442 AHCI_HFLAG_MV_PATA),
448 .flags = ATA_FLAG_SATA | ATA_FLAG_NO_LEGACY | 443 .flags = ATA_FLAG_SATA | ATA_FLAG_NO_LEGACY |
449 ATA_FLAG_MMIO | ATA_FLAG_PIO_DMA, 444 ATA_FLAG_MMIO | ATA_FLAG_PIO_DMA,
450 .link_flags = AHCI_LFLAG_COMMON,
451 .pio_mask = 0x1f, /* pio0-4 */ 445 .pio_mask = 0x1f, /* pio0-4 */
452 .udma_mask = ATA_UDMA6, 446 .udma_mask = ATA_UDMA6,
453 .port_ops = &ahci_ops, 447 .port_ops = &ahci_ops,
@@ -457,7 +451,6 @@ static const struct ata_port_info ahci_port_info[] = {
457 AHCI_HFLAGS (AHCI_HFLAG_IGN_SERR_INTERNAL | 451 AHCI_HFLAGS (AHCI_HFLAG_IGN_SERR_INTERNAL |
458 AHCI_HFLAG_NO_PMP), 452 AHCI_HFLAG_NO_PMP),
459 .flags = AHCI_FLAG_COMMON, 453 .flags = AHCI_FLAG_COMMON,
460 .link_flags = AHCI_LFLAG_COMMON,
461 .pio_mask = 0x1f, /* pio0-4 */ 454 .pio_mask = 0x1f, /* pio0-4 */
462 .udma_mask = ATA_UDMA6, 455 .udma_mask = ATA_UDMA6,
463 .port_ops = &ahci_ops, 456 .port_ops = &ahci_ops,
diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c
index 02e7ba43a3b3..baef749ec528 100644
--- a/drivers/ata/libata-core.c
+++ b/drivers/ata/libata-core.c
@@ -3962,10 +3962,8 @@ int ata_std_prereset(struct ata_link *link, unsigned long deadline)
3962 "link for reset (errno=%d)\n", rc); 3962 "link for reset (errno=%d)\n", rc);
3963 } 3963 }
3964 3964
3965 /* Wait for !BSY if the controller can wait for the first D2H 3965 /* wait for !BSY if we don't know that no device is attached */
3966 * Reg FIS and we don't know that no device is attached. 3966 if (!ata_link_offline(link)) {
3967 */
3968 if (!(link->flags & ATA_LFLAG_SKIP_D2H_BSY) && !ata_link_offline(link)) {
3969 rc = ata_wait_ready(ap, deadline); 3967 rc = ata_wait_ready(ap, deadline);
3970 if (rc && rc != -ENODEV) { 3968 if (rc && rc != -ENODEV) {
3971 ata_link_printk(link, KERN_WARNING, "device not ready " 3969 ata_link_printk(link, KERN_WARNING, "device not ready "
diff --git a/drivers/ata/sata_fsl.c b/drivers/ata/sata_fsl.c
index fbd423ad23bb..d23b690ed1a1 100644
--- a/drivers/ata/sata_fsl.c
+++ b/drivers/ata/sata_fsl.c
@@ -35,7 +35,6 @@ enum {
35 SATA_FSL_HOST_FLAGS = (ATA_FLAG_SATA | ATA_FLAG_NO_LEGACY | 35 SATA_FSL_HOST_FLAGS = (ATA_FLAG_SATA | ATA_FLAG_NO_LEGACY |
36 ATA_FLAG_MMIO | ATA_FLAG_PIO_DMA | 36 ATA_FLAG_MMIO | ATA_FLAG_PIO_DMA |
37 ATA_FLAG_NCQ), 37 ATA_FLAG_NCQ),
38 SATA_FSL_HOST_LFLAGS = ATA_LFLAG_SKIP_D2H_BSY,
39 38
40 SATA_FSL_MAX_CMDS = SATA_FSL_QUEUE_DEPTH, 39 SATA_FSL_MAX_CMDS = SATA_FSL_QUEUE_DEPTH,
41 SATA_FSL_CMD_HDR_SIZE = 16, /* 4 DWORDS */ 40 SATA_FSL_CMD_HDR_SIZE = 16, /* 4 DWORDS */
@@ -1241,7 +1240,6 @@ static const struct ata_port_operations sata_fsl_ops = {
1241static const struct ata_port_info sata_fsl_port_info[] = { 1240static const struct ata_port_info sata_fsl_port_info[] = {
1242 { 1241 {
1243 .flags = SATA_FSL_HOST_FLAGS, 1242 .flags = SATA_FSL_HOST_FLAGS,
1244 .link_flags = SATA_FSL_HOST_LFLAGS,
1245 .pio_mask = 0x1f, /* pio 0-4 */ 1243 .pio_mask = 0x1f, /* pio 0-4 */
1246 .udma_mask = 0x7f, /* udma 0-6 */ 1244 .udma_mask = 0x7f, /* udma 0-6 */
1247 .port_ops = &sata_fsl_ops, 1245 .port_ops = &sata_fsl_ops,
diff --git a/drivers/ata/sata_sil24.c b/drivers/ata/sata_sil24.c
index aa8d0323c9bb..ba0c00e8ee7f 100644
--- a/drivers/ata/sata_sil24.c
+++ b/drivers/ata/sata_sil24.c
@@ -254,7 +254,6 @@ enum {
254 ATA_FLAG_MMIO | ATA_FLAG_PIO_DMA | 254 ATA_FLAG_MMIO | ATA_FLAG_PIO_DMA |
255 ATA_FLAG_NCQ | ATA_FLAG_ACPI_SATA | 255 ATA_FLAG_NCQ | ATA_FLAG_ACPI_SATA |
256 ATA_FLAG_AN | ATA_FLAG_PMP, 256 ATA_FLAG_AN | ATA_FLAG_PMP,
257 SIL24_COMMON_LFLAGS = ATA_LFLAG_SKIP_D2H_BSY,
258 SIL24_FLAG_PCIX_IRQ_WOC = (1 << 24), /* IRQ loss errata on PCI-X */ 257 SIL24_FLAG_PCIX_IRQ_WOC = (1 << 24), /* IRQ loss errata on PCI-X */
259 258
260 IRQ_STAT_4PORTS = 0xf, 259 IRQ_STAT_4PORTS = 0xf,
@@ -449,7 +448,6 @@ static const struct ata_port_info sil24_port_info[] = {
449 { 448 {
450 .flags = SIL24_COMMON_FLAGS | SIL24_NPORTS2FLAG(4) | 449 .flags = SIL24_COMMON_FLAGS | SIL24_NPORTS2FLAG(4) |
451 SIL24_FLAG_PCIX_IRQ_WOC, 450 SIL24_FLAG_PCIX_IRQ_WOC,
452 .link_flags = SIL24_COMMON_LFLAGS,
453 .pio_mask = 0x1f, /* pio0-4 */ 451 .pio_mask = 0x1f, /* pio0-4 */
454 .mwdma_mask = 0x07, /* mwdma0-2 */ 452 .mwdma_mask = 0x07, /* mwdma0-2 */
455 .udma_mask = ATA_UDMA5, /* udma0-5 */ 453 .udma_mask = ATA_UDMA5, /* udma0-5 */
@@ -458,7 +456,6 @@ static const struct ata_port_info sil24_port_info[] = {
458 /* sil_3132 */ 456 /* sil_3132 */
459 { 457 {
460 .flags = SIL24_COMMON_FLAGS | SIL24_NPORTS2FLAG(2), 458 .flags = SIL24_COMMON_FLAGS | SIL24_NPORTS2FLAG(2),
461 .link_flags = SIL24_COMMON_LFLAGS,
462 .pio_mask = 0x1f, /* pio0-4 */ 459 .pio_mask = 0x1f, /* pio0-4 */
463 .mwdma_mask = 0x07, /* mwdma0-2 */ 460 .mwdma_mask = 0x07, /* mwdma0-2 */
464 .udma_mask = ATA_UDMA5, /* udma0-5 */ 461 .udma_mask = ATA_UDMA5, /* udma0-5 */
@@ -467,7 +464,6 @@ static const struct ata_port_info sil24_port_info[] = {
467 /* sil_3131/sil_3531 */ 464 /* sil_3131/sil_3531 */
468 { 465 {
469 .flags = SIL24_COMMON_FLAGS | SIL24_NPORTS2FLAG(1), 466 .flags = SIL24_COMMON_FLAGS | SIL24_NPORTS2FLAG(1),
470 .link_flags = SIL24_COMMON_LFLAGS,
471 .pio_mask = 0x1f, /* pio0-4 */ 467 .pio_mask = 0x1f, /* pio0-4 */
472 .mwdma_mask = 0x07, /* mwdma0-2 */ 468 .mwdma_mask = 0x07, /* mwdma0-2 */
473 .udma_mask = ATA_UDMA5, /* udma0-5 */ 469 .udma_mask = ATA_UDMA5, /* udma0-5 */
diff --git a/include/linux/libata.h b/include/linux/libata.h
index 4093e3b6a8b7..6eec11957e54 100644
--- a/include/linux/libata.h
+++ b/include/linux/libata.h
@@ -163,8 +163,6 @@ enum {
163 ATA_DEV_NONE = 9, /* no device */ 163 ATA_DEV_NONE = 9, /* no device */
164 164
165 /* struct ata_link flags */ 165 /* struct ata_link flags */
166 ATA_LFLAG_SKIP_D2H_BSY = (1 << 1), /* can't wait for the first D2H
167 * Register FIS clearing BSY */
168 ATA_LFLAG_NO_SRST = (1 << 2), /* avoid softreset */ 166 ATA_LFLAG_NO_SRST = (1 << 2), /* avoid softreset */
169 ATA_LFLAG_ASSUME_ATA = (1 << 3), /* assume ATA class */ 167 ATA_LFLAG_ASSUME_ATA = (1 << 3), /* assume ATA class */
170 ATA_LFLAG_ASSUME_SEMB = (1 << 4), /* assume SEMB class */ 168 ATA_LFLAG_ASSUME_SEMB = (1 << 4), /* assume SEMB class */