diff options
author | Tejun Heo <htejun@gmail.com> | 2007-08-06 05:36:23 -0400 |
---|---|---|
committer | Jeff Garzik <jeff@garzik.org> | 2007-10-12 14:55:31 -0400 |
commit | 0c88758b5a6325428aaadab619886242db20ceae (patch) | |
tree | bf84abbce984fa45c4ce927b65695f30a8ea3a43 /drivers/ata | |
parent | 0260731f0187840e272bfa10d3ba0f3e417976f5 (diff) |
libata-link: make two port flags HRST_TO_RESUME and SKIP_D2H_BSY link flags
HRST_TO_RESUME and SKIP_D2H_BSY are link attributes. Move them to
ata_link->flags. This will allow host and PMP links to have different
attributes. ata_port_info->link_flags is added and used by LLDs to
specify these flags during initialization.
Signed-off-by: Tejun Heo <htejun@gmail.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
Diffstat (limited to 'drivers/ata')
-rw-r--r-- | drivers/ata/ahci.c | 16 | ||||
-rw-r--r-- | drivers/ata/libata-core.c | 5 | ||||
-rw-r--r-- | drivers/ata/sata_nv.c | 14 | ||||
-rw-r--r-- | drivers/ata/sata_sil.c | 7 | ||||
-rw-r--r-- | drivers/ata/sata_sil24.c | 7 |
5 files changed, 31 insertions, 18 deletions
diff --git a/drivers/ata/ahci.c b/drivers/ata/ahci.c index e38ae12d0148..483733783cf8 100644 --- a/drivers/ata/ahci.c +++ b/drivers/ata/ahci.c | |||
@@ -178,8 +178,8 @@ enum { | |||
178 | 178 | ||
179 | AHCI_FLAG_COMMON = ATA_FLAG_SATA | ATA_FLAG_NO_LEGACY | | 179 | AHCI_FLAG_COMMON = ATA_FLAG_SATA | ATA_FLAG_NO_LEGACY | |
180 | ATA_FLAG_MMIO | ATA_FLAG_PIO_DMA | | 180 | ATA_FLAG_MMIO | ATA_FLAG_PIO_DMA | |
181 | ATA_FLAG_SKIP_D2H_BSY | | ||
182 | ATA_FLAG_ACPI_SATA, | 181 | ATA_FLAG_ACPI_SATA, |
182 | AHCI_LFLAG_COMMON = ATA_LFLAG_SKIP_D2H_BSY, | ||
183 | }; | 183 | }; |
184 | 184 | ||
185 | struct ahci_cmd_hdr { | 185 | struct ahci_cmd_hdr { |
@@ -333,6 +333,7 @@ static const struct ata_port_info ahci_port_info[] = { | |||
333 | /* board_ahci */ | 333 | /* board_ahci */ |
334 | { | 334 | { |
335 | .flags = AHCI_FLAG_COMMON, | 335 | .flags = AHCI_FLAG_COMMON, |
336 | .link_flags = AHCI_LFLAG_COMMON, | ||
336 | .pio_mask = 0x1f, /* pio0-4 */ | 337 | .pio_mask = 0x1f, /* pio0-4 */ |
337 | .udma_mask = ATA_UDMA6, | 338 | .udma_mask = ATA_UDMA6, |
338 | .port_ops = &ahci_ops, | 339 | .port_ops = &ahci_ops, |
@@ -340,14 +341,15 @@ static const struct ata_port_info ahci_port_info[] = { | |||
340 | /* board_ahci_pi */ | 341 | /* board_ahci_pi */ |
341 | { | 342 | { |
342 | .flags = AHCI_FLAG_COMMON | AHCI_FLAG_HONOR_PI, | 343 | .flags = AHCI_FLAG_COMMON | AHCI_FLAG_HONOR_PI, |
344 | .link_flags = AHCI_LFLAG_COMMON, | ||
343 | .pio_mask = 0x1f, /* pio0-4 */ | 345 | .pio_mask = 0x1f, /* pio0-4 */ |
344 | .udma_mask = ATA_UDMA6, | 346 | .udma_mask = ATA_UDMA6, |
345 | .port_ops = &ahci_ops, | 347 | .port_ops = &ahci_ops, |
346 | }, | 348 | }, |
347 | /* board_ahci_vt8251 */ | 349 | /* board_ahci_vt8251 */ |
348 | { | 350 | { |
349 | .flags = AHCI_FLAG_COMMON | ATA_FLAG_HRST_TO_RESUME | | 351 | .flags = AHCI_FLAG_COMMON | AHCI_FLAG_NO_NCQ, |
350 | AHCI_FLAG_NO_NCQ, | 352 | .link_flags = AHCI_LFLAG_COMMON | ATA_LFLAG_HRST_TO_RESUME, |
351 | .pio_mask = 0x1f, /* pio0-4 */ | 353 | .pio_mask = 0x1f, /* pio0-4 */ |
352 | .udma_mask = ATA_UDMA6, | 354 | .udma_mask = ATA_UDMA6, |
353 | .port_ops = &ahci_vt8251_ops, | 355 | .port_ops = &ahci_vt8251_ops, |
@@ -355,6 +357,7 @@ static const struct ata_port_info ahci_port_info[] = { | |||
355 | /* board_ahci_ign_iferr */ | 357 | /* board_ahci_ign_iferr */ |
356 | { | 358 | { |
357 | .flags = AHCI_FLAG_COMMON | AHCI_FLAG_IGN_IRQ_IF_ERR, | 359 | .flags = AHCI_FLAG_COMMON | AHCI_FLAG_IGN_IRQ_IF_ERR, |
360 | .link_flags = AHCI_LFLAG_COMMON, | ||
358 | .pio_mask = 0x1f, /* pio0-4 */ | 361 | .pio_mask = 0x1f, /* pio0-4 */ |
359 | .udma_mask = ATA_UDMA6, | 362 | .udma_mask = ATA_UDMA6, |
360 | .port_ops = &ahci_ops, | 363 | .port_ops = &ahci_ops, |
@@ -364,6 +367,7 @@ static const struct ata_port_info ahci_port_info[] = { | |||
364 | .flags = AHCI_FLAG_COMMON | | 367 | .flags = AHCI_FLAG_COMMON | |
365 | AHCI_FLAG_IGN_SERR_INTERNAL | | 368 | AHCI_FLAG_IGN_SERR_INTERNAL | |
366 | AHCI_FLAG_32BIT_ONLY, | 369 | AHCI_FLAG_32BIT_ONLY, |
370 | .link_flags = AHCI_LFLAG_COMMON, | ||
367 | .pio_mask = 0x1f, /* pio0-4 */ | 371 | .pio_mask = 0x1f, /* pio0-4 */ |
368 | .udma_mask = ATA_UDMA6, | 372 | .udma_mask = ATA_UDMA6, |
369 | .port_ops = &ahci_ops, | 373 | .port_ops = &ahci_ops, |
@@ -373,9 +377,9 @@ static const struct ata_port_info ahci_port_info[] = { | |||
373 | .sht = &ahci_sht, | 377 | .sht = &ahci_sht, |
374 | .flags = ATA_FLAG_SATA | ATA_FLAG_NO_LEGACY | | 378 | .flags = ATA_FLAG_SATA | ATA_FLAG_NO_LEGACY | |
375 | ATA_FLAG_MMIO | ATA_FLAG_PIO_DMA | | 379 | ATA_FLAG_MMIO | ATA_FLAG_PIO_DMA | |
376 | ATA_FLAG_SKIP_D2H_BSY | AHCI_FLAG_HONOR_PI | | 380 | AHCI_FLAG_HONOR_PI | AHCI_FLAG_NO_NCQ | |
377 | AHCI_FLAG_NO_NCQ | AHCI_FLAG_NO_MSI | | 381 | AHCI_FLAG_NO_MSI | AHCI_FLAG_MV_PATA, |
378 | AHCI_FLAG_MV_PATA, | 382 | .link_flags = AHCI_LFLAG_COMMON, |
379 | .pio_mask = 0x1f, /* pio0-4 */ | 383 | .pio_mask = 0x1f, /* pio0-4 */ |
380 | .udma_mask = ATA_UDMA6, | 384 | .udma_mask = ATA_UDMA6, |
381 | .port_ops = &ahci_ops, | 385 | .port_ops = &ahci_ops, |
diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c index 944f54457c8f..2be30c7a2226 100644 --- a/drivers/ata/libata-core.c +++ b/drivers/ata/libata-core.c | |||
@@ -3332,7 +3332,7 @@ int ata_std_prereset(struct ata_link *link, unsigned long deadline) | |||
3332 | 3332 | ||
3333 | /* handle link resume */ | 3333 | /* handle link resume */ |
3334 | if ((ehc->i.flags & ATA_EHI_RESUME_LINK) && | 3334 | if ((ehc->i.flags & ATA_EHI_RESUME_LINK) && |
3335 | (ap->flags & ATA_FLAG_HRST_TO_RESUME)) | 3335 | (link->flags & ATA_LFLAG_HRST_TO_RESUME)) |
3336 | ehc->i.action |= ATA_EH_HARDRESET; | 3336 | ehc->i.action |= ATA_EH_HARDRESET; |
3337 | 3337 | ||
3338 | /* if we're about to do hardreset, nothing more to do */ | 3338 | /* if we're about to do hardreset, nothing more to do */ |
@@ -3351,7 +3351,7 @@ int ata_std_prereset(struct ata_link *link, unsigned long deadline) | |||
3351 | /* Wait for !BSY if the controller can wait for the first D2H | 3351 | /* Wait for !BSY if the controller can wait for the first D2H |
3352 | * Reg FIS and we don't know that no device is attached. | 3352 | * Reg FIS and we don't know that no device is attached. |
3353 | */ | 3353 | */ |
3354 | if (!(ap->flags & ATA_FLAG_SKIP_D2H_BSY) && !ata_link_offline(link)) { | 3354 | if (!(link->flags & ATA_LFLAG_SKIP_D2H_BSY) && !ata_link_offline(link)) { |
3355 | rc = ata_wait_ready(ap, deadline); | 3355 | rc = ata_wait_ready(ap, deadline); |
3356 | if (rc && rc != -ENODEV) { | 3356 | if (rc && rc != -ENODEV) { |
3357 | ata_link_printk(link, KERN_WARNING, "device not ready " | 3357 | ata_link_printk(link, KERN_WARNING, "device not ready " |
@@ -6269,6 +6269,7 @@ struct ata_host *ata_host_alloc_pinfo(struct device *dev, | |||
6269 | ap->mwdma_mask = pi->mwdma_mask; | 6269 | ap->mwdma_mask = pi->mwdma_mask; |
6270 | ap->udma_mask = pi->udma_mask; | 6270 | ap->udma_mask = pi->udma_mask; |
6271 | ap->flags |= pi->flags; | 6271 | ap->flags |= pi->flags; |
6272 | ap->link.flags |= pi->link_flags; | ||
6272 | ap->ops = pi->port_ops; | 6273 | ap->ops = pi->port_ops; |
6273 | 6274 | ||
6274 | if (!host->ops && (pi->port_ops != &ata_dummy_port_ops)) | 6275 | if (!host->ops && (pi->port_ops != &ata_dummy_port_ops)) |
diff --git a/drivers/ata/sata_nv.c b/drivers/ata/sata_nv.c index 67ba0f75f1e9..884d9f05e6c6 100644 --- a/drivers/ata/sata_nv.c +++ b/drivers/ata/sata_nv.c | |||
@@ -455,8 +455,8 @@ static const struct ata_port_info nv_port_info[] = { | |||
455 | /* generic */ | 455 | /* generic */ |
456 | { | 456 | { |
457 | .sht = &nv_sht, | 457 | .sht = &nv_sht, |
458 | .flags = ATA_FLAG_SATA | ATA_FLAG_NO_LEGACY | | 458 | .flags = ATA_FLAG_SATA | ATA_FLAG_NO_LEGACY, |
459 | ATA_FLAG_HRST_TO_RESUME, | 459 | .link_flags = ATA_LFLAG_HRST_TO_RESUME, |
460 | .pio_mask = NV_PIO_MASK, | 460 | .pio_mask = NV_PIO_MASK, |
461 | .mwdma_mask = NV_MWDMA_MASK, | 461 | .mwdma_mask = NV_MWDMA_MASK, |
462 | .udma_mask = NV_UDMA_MASK, | 462 | .udma_mask = NV_UDMA_MASK, |
@@ -466,8 +466,8 @@ static const struct ata_port_info nv_port_info[] = { | |||
466 | /* nforce2/3 */ | 466 | /* nforce2/3 */ |
467 | { | 467 | { |
468 | .sht = &nv_sht, | 468 | .sht = &nv_sht, |
469 | .flags = ATA_FLAG_SATA | ATA_FLAG_NO_LEGACY | | 469 | .flags = ATA_FLAG_SATA | ATA_FLAG_NO_LEGACY, |
470 | ATA_FLAG_HRST_TO_RESUME, | 470 | .link_flags = ATA_LFLAG_HRST_TO_RESUME, |
471 | .pio_mask = NV_PIO_MASK, | 471 | .pio_mask = NV_PIO_MASK, |
472 | .mwdma_mask = NV_MWDMA_MASK, | 472 | .mwdma_mask = NV_MWDMA_MASK, |
473 | .udma_mask = NV_UDMA_MASK, | 473 | .udma_mask = NV_UDMA_MASK, |
@@ -477,8 +477,8 @@ static const struct ata_port_info nv_port_info[] = { | |||
477 | /* ck804 */ | 477 | /* ck804 */ |
478 | { | 478 | { |
479 | .sht = &nv_sht, | 479 | .sht = &nv_sht, |
480 | .flags = ATA_FLAG_SATA | ATA_FLAG_NO_LEGACY | | 480 | .flags = ATA_FLAG_SATA | ATA_FLAG_NO_LEGACY, |
481 | ATA_FLAG_HRST_TO_RESUME, | 481 | .link_flags = ATA_LFLAG_HRST_TO_RESUME, |
482 | .pio_mask = NV_PIO_MASK, | 482 | .pio_mask = NV_PIO_MASK, |
483 | .mwdma_mask = NV_MWDMA_MASK, | 483 | .mwdma_mask = NV_MWDMA_MASK, |
484 | .udma_mask = NV_UDMA_MASK, | 484 | .udma_mask = NV_UDMA_MASK, |
@@ -489,8 +489,8 @@ static const struct ata_port_info nv_port_info[] = { | |||
489 | { | 489 | { |
490 | .sht = &nv_adma_sht, | 490 | .sht = &nv_adma_sht, |
491 | .flags = ATA_FLAG_SATA | ATA_FLAG_NO_LEGACY | | 491 | .flags = ATA_FLAG_SATA | ATA_FLAG_NO_LEGACY | |
492 | ATA_FLAG_HRST_TO_RESUME | | ||
493 | ATA_FLAG_MMIO | ATA_FLAG_NCQ, | 492 | ATA_FLAG_MMIO | ATA_FLAG_NCQ, |
493 | .link_flags = ATA_LFLAG_HRST_TO_RESUME, | ||
494 | .pio_mask = NV_PIO_MASK, | 494 | .pio_mask = NV_PIO_MASK, |
495 | .mwdma_mask = NV_MWDMA_MASK, | 495 | .mwdma_mask = NV_MWDMA_MASK, |
496 | .udma_mask = NV_UDMA_MASK, | 496 | .udma_mask = NV_UDMA_MASK, |
diff --git a/drivers/ata/sata_sil.c b/drivers/ata/sata_sil.c index 5cd3eb83e4ad..802d679dc994 100644 --- a/drivers/ata/sata_sil.c +++ b/drivers/ata/sata_sil.c | |||
@@ -59,7 +59,8 @@ enum { | |||
59 | SIL_FLAG_MOD15WRITE = (1 << 30), | 59 | SIL_FLAG_MOD15WRITE = (1 << 30), |
60 | 60 | ||
61 | SIL_DFL_PORT_FLAGS = ATA_FLAG_SATA | ATA_FLAG_NO_LEGACY | | 61 | SIL_DFL_PORT_FLAGS = ATA_FLAG_SATA | ATA_FLAG_NO_LEGACY | |
62 | ATA_FLAG_MMIO | ATA_FLAG_HRST_TO_RESUME, | 62 | ATA_FLAG_MMIO, |
63 | SIL_DFL_LINK_FLAGS = ATA_LFLAG_HRST_TO_RESUME, | ||
63 | 64 | ||
64 | /* | 65 | /* |
65 | * Controller IDs | 66 | * Controller IDs |
@@ -216,6 +217,7 @@ static const struct ata_port_info sil_port_info[] = { | |||
216 | /* sil_3112 */ | 217 | /* sil_3112 */ |
217 | { | 218 | { |
218 | .flags = SIL_DFL_PORT_FLAGS | SIL_FLAG_MOD15WRITE, | 219 | .flags = SIL_DFL_PORT_FLAGS | SIL_FLAG_MOD15WRITE, |
220 | .link_flags = SIL_DFL_LINK_FLAGS, | ||
219 | .pio_mask = 0x1f, /* pio0-4 */ | 221 | .pio_mask = 0x1f, /* pio0-4 */ |
220 | .mwdma_mask = 0x07, /* mwdma0-2 */ | 222 | .mwdma_mask = 0x07, /* mwdma0-2 */ |
221 | .udma_mask = ATA_UDMA5, | 223 | .udma_mask = ATA_UDMA5, |
@@ -225,6 +227,7 @@ static const struct ata_port_info sil_port_info[] = { | |||
225 | { | 227 | { |
226 | .flags = SIL_DFL_PORT_FLAGS | SIL_FLAG_MOD15WRITE | | 228 | .flags = SIL_DFL_PORT_FLAGS | SIL_FLAG_MOD15WRITE | |
227 | SIL_FLAG_NO_SATA_IRQ, | 229 | SIL_FLAG_NO_SATA_IRQ, |
230 | .link_flags = SIL_DFL_LINK_FLAGS, | ||
228 | .pio_mask = 0x1f, /* pio0-4 */ | 231 | .pio_mask = 0x1f, /* pio0-4 */ |
229 | .mwdma_mask = 0x07, /* mwdma0-2 */ | 232 | .mwdma_mask = 0x07, /* mwdma0-2 */ |
230 | .udma_mask = ATA_UDMA5, | 233 | .udma_mask = ATA_UDMA5, |
@@ -233,6 +236,7 @@ static const struct ata_port_info sil_port_info[] = { | |||
233 | /* sil_3512 */ | 236 | /* sil_3512 */ |
234 | { | 237 | { |
235 | .flags = SIL_DFL_PORT_FLAGS | SIL_FLAG_RERR_ON_DMA_ACT, | 238 | .flags = SIL_DFL_PORT_FLAGS | SIL_FLAG_RERR_ON_DMA_ACT, |
239 | .link_flags = SIL_DFL_LINK_FLAGS, | ||
236 | .pio_mask = 0x1f, /* pio0-4 */ | 240 | .pio_mask = 0x1f, /* pio0-4 */ |
237 | .mwdma_mask = 0x07, /* mwdma0-2 */ | 241 | .mwdma_mask = 0x07, /* mwdma0-2 */ |
238 | .udma_mask = ATA_UDMA5, | 242 | .udma_mask = ATA_UDMA5, |
@@ -241,6 +245,7 @@ static const struct ata_port_info sil_port_info[] = { | |||
241 | /* sil_3114 */ | 245 | /* sil_3114 */ |
242 | { | 246 | { |
243 | .flags = SIL_DFL_PORT_FLAGS | SIL_FLAG_RERR_ON_DMA_ACT, | 247 | .flags = SIL_DFL_PORT_FLAGS | SIL_FLAG_RERR_ON_DMA_ACT, |
248 | .link_flags = SIL_DFL_LINK_FLAGS, | ||
244 | .pio_mask = 0x1f, /* pio0-4 */ | 249 | .pio_mask = 0x1f, /* pio0-4 */ |
245 | .mwdma_mask = 0x07, /* mwdma0-2 */ | 250 | .mwdma_mask = 0x07, /* mwdma0-2 */ |
246 | .udma_mask = ATA_UDMA5, | 251 | .udma_mask = ATA_UDMA5, |
diff --git a/drivers/ata/sata_sil24.c b/drivers/ata/sata_sil24.c index 869e414d7ed3..e2cccc7f4358 100644 --- a/drivers/ata/sata_sil24.c +++ b/drivers/ata/sata_sil24.c | |||
@@ -237,8 +237,8 @@ enum { | |||
237 | /* host flags */ | 237 | /* host flags */ |
238 | SIL24_COMMON_FLAGS = ATA_FLAG_SATA | ATA_FLAG_NO_LEGACY | | 238 | SIL24_COMMON_FLAGS = ATA_FLAG_SATA | ATA_FLAG_NO_LEGACY | |
239 | ATA_FLAG_MMIO | ATA_FLAG_PIO_DMA | | 239 | ATA_FLAG_MMIO | ATA_FLAG_PIO_DMA | |
240 | ATA_FLAG_NCQ | ATA_FLAG_SKIP_D2H_BSY | | 240 | ATA_FLAG_NCQ | ATA_FLAG_ACPI_SATA, |
241 | ATA_FLAG_ACPI_SATA, | 241 | SIL24_COMMON_LFLAGS = ATA_LFLAG_SKIP_D2H_BSY, |
242 | SIL24_FLAG_PCIX_IRQ_WOC = (1 << 24), /* IRQ loss errata on PCI-X */ | 242 | SIL24_FLAG_PCIX_IRQ_WOC = (1 << 24), /* IRQ loss errata on PCI-X */ |
243 | 243 | ||
244 | IRQ_STAT_4PORTS = 0xf, | 244 | IRQ_STAT_4PORTS = 0xf, |
@@ -424,6 +424,7 @@ static const struct ata_port_info sil24_port_info[] = { | |||
424 | { | 424 | { |
425 | .flags = SIL24_COMMON_FLAGS | SIL24_NPORTS2FLAG(4) | | 425 | .flags = SIL24_COMMON_FLAGS | SIL24_NPORTS2FLAG(4) | |
426 | SIL24_FLAG_PCIX_IRQ_WOC, | 426 | SIL24_FLAG_PCIX_IRQ_WOC, |
427 | .link_flags = SIL24_COMMON_LFLAGS, | ||
427 | .pio_mask = 0x1f, /* pio0-4 */ | 428 | .pio_mask = 0x1f, /* pio0-4 */ |
428 | .mwdma_mask = 0x07, /* mwdma0-2 */ | 429 | .mwdma_mask = 0x07, /* mwdma0-2 */ |
429 | .udma_mask = ATA_UDMA5, /* udma0-5 */ | 430 | .udma_mask = ATA_UDMA5, /* udma0-5 */ |
@@ -432,6 +433,7 @@ static const struct ata_port_info sil24_port_info[] = { | |||
432 | /* sil_3132 */ | 433 | /* sil_3132 */ |
433 | { | 434 | { |
434 | .flags = SIL24_COMMON_FLAGS | SIL24_NPORTS2FLAG(2), | 435 | .flags = SIL24_COMMON_FLAGS | SIL24_NPORTS2FLAG(2), |
436 | .link_flags = SIL24_COMMON_LFLAGS, | ||
435 | .pio_mask = 0x1f, /* pio0-4 */ | 437 | .pio_mask = 0x1f, /* pio0-4 */ |
436 | .mwdma_mask = 0x07, /* mwdma0-2 */ | 438 | .mwdma_mask = 0x07, /* mwdma0-2 */ |
437 | .udma_mask = ATA_UDMA5, /* udma0-5 */ | 439 | .udma_mask = ATA_UDMA5, /* udma0-5 */ |
@@ -440,6 +442,7 @@ static const struct ata_port_info sil24_port_info[] = { | |||
440 | /* sil_3131/sil_3531 */ | 442 | /* sil_3131/sil_3531 */ |
441 | { | 443 | { |
442 | .flags = SIL24_COMMON_FLAGS | SIL24_NPORTS2FLAG(1), | 444 | .flags = SIL24_COMMON_FLAGS | SIL24_NPORTS2FLAG(1), |
445 | .link_flags = SIL24_COMMON_LFLAGS, | ||
443 | .pio_mask = 0x1f, /* pio0-4 */ | 446 | .pio_mask = 0x1f, /* pio0-4 */ |
444 | .mwdma_mask = 0x07, /* mwdma0-2 */ | 447 | .mwdma_mask = 0x07, /* mwdma0-2 */ |
445 | .udma_mask = ATA_UDMA5, /* udma0-5 */ | 448 | .udma_mask = ATA_UDMA5, /* udma0-5 */ |