diff options
author | Tejun Heo <htejun@gmail.com> | 2006-11-01 04:38:52 -0500 |
---|---|---|
committer | Jeff Garzik <jeff@garzik.org> | 2006-12-01 22:41:31 -0500 |
commit | efdaedc443e935eda82e9e78a6e65d1f993d242f (patch) | |
tree | 8bcdc05ec85f7a9e7b0a5b1e5014ec21cf4e8aac /drivers | |
parent | ad616ffbda8caf3ce76d2b43027e789d732abf48 (diff) |
[PATCH] libata: implement ATA_EHI_PRINTINFO
Implement ehi flag ATA_EHI_PRINTINFO. This flag is set when device
configuration needs to print out device info. This used to be handled
by @print_info argument to ata_dev_configure() but LLDs also need to
know about it in ->dev_config() callback.
This patch replaces @print_info w/ ATA_EHI_PRINTINFO and make sata_sil
print workaround messages only on the initial configuration.
Signed-off-by: Tejun Heo <htejun@gmail.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/ata/libata-core.c | 10 | ||||
-rw-r--r-- | drivers/ata/libata-eh.c | 7 | ||||
-rw-r--r-- | drivers/ata/libata.h | 2 | ||||
-rw-r--r-- | drivers/ata/sata_sil.c | 11 |
4 files changed, 19 insertions, 11 deletions
diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c index 315f46841f68..e294731a7edd 100644 --- a/drivers/ata/libata-core.c +++ b/drivers/ata/libata-core.c | |||
@@ -1377,7 +1377,6 @@ static void ata_set_port_max_cmd_len(struct ata_port *ap) | |||
1377 | /** | 1377 | /** |
1378 | * ata_dev_configure - Configure the specified ATA/ATAPI device | 1378 | * ata_dev_configure - Configure the specified ATA/ATAPI device |
1379 | * @dev: Target device to configure | 1379 | * @dev: Target device to configure |
1380 | * @print_info: Enable device info printout | ||
1381 | * | 1380 | * |
1382 | * Configure @dev according to @dev->id. Generic and low-level | 1381 | * Configure @dev according to @dev->id. Generic and low-level |
1383 | * driver specific fixups are also applied. | 1382 | * driver specific fixups are also applied. |
@@ -1388,9 +1387,10 @@ static void ata_set_port_max_cmd_len(struct ata_port *ap) | |||
1388 | * RETURNS: | 1387 | * RETURNS: |
1389 | * 0 on success, -errno otherwise | 1388 | * 0 on success, -errno otherwise |
1390 | */ | 1389 | */ |
1391 | int ata_dev_configure(struct ata_device *dev, int print_info) | 1390 | int ata_dev_configure(struct ata_device *dev) |
1392 | { | 1391 | { |
1393 | struct ata_port *ap = dev->ap; | 1392 | struct ata_port *ap = dev->ap; |
1393 | int print_info = ap->eh_context.i.flags & ATA_EHI_PRINTINFO; | ||
1394 | const u16 *id = dev->id; | 1394 | const u16 *id = dev->id; |
1395 | unsigned int xfer_mask; | 1395 | unsigned int xfer_mask; |
1396 | char revbuf[7]; /* XYZ-99\0 */ | 1396 | char revbuf[7]; /* XYZ-99\0 */ |
@@ -1638,7 +1638,9 @@ int ata_bus_probe(struct ata_port *ap) | |||
1638 | if (rc) | 1638 | if (rc) |
1639 | goto fail; | 1639 | goto fail; |
1640 | 1640 | ||
1641 | rc = ata_dev_configure(dev, 1); | 1641 | ap->eh_context.i.flags |= ATA_EHI_PRINTINFO; |
1642 | rc = ata_dev_configure(dev); | ||
1643 | ap->eh_context.i.flags &= ~ATA_EHI_PRINTINFO; | ||
1642 | if (rc) | 1644 | if (rc) |
1643 | goto fail; | 1645 | goto fail; |
1644 | } | 1646 | } |
@@ -3045,7 +3047,7 @@ int ata_dev_revalidate(struct ata_device *dev, int post_reset) | |||
3045 | memcpy(dev->id, id, sizeof(id[0]) * ATA_ID_WORDS); | 3047 | memcpy(dev->id, id, sizeof(id[0]) * ATA_ID_WORDS); |
3046 | 3048 | ||
3047 | /* configure device according to the new ID */ | 3049 | /* configure device according to the new ID */ |
3048 | rc = ata_dev_configure(dev, 0); | 3050 | rc = ata_dev_configure(dev); |
3049 | if (rc == 0) | 3051 | if (rc == 0) |
3050 | return 0; | 3052 | return 0; |
3051 | 3053 | ||
diff --git a/drivers/ata/libata-eh.c b/drivers/ata/libata-eh.c index 02b2b2787d9b..7c446442616c 100644 --- a/drivers/ata/libata-eh.c +++ b/drivers/ata/libata-eh.c | |||
@@ -1661,8 +1661,11 @@ static int ata_eh_revalidate_and_attach(struct ata_port *ap, | |||
1661 | dev->class = ehc->classes[dev->devno]; | 1661 | dev->class = ehc->classes[dev->devno]; |
1662 | 1662 | ||
1663 | rc = ata_dev_read_id(dev, &dev->class, 1, dev->id); | 1663 | rc = ata_dev_read_id(dev, &dev->class, 1, dev->id); |
1664 | if (rc == 0) | 1664 | if (rc == 0) { |
1665 | rc = ata_dev_configure(dev, 1); | 1665 | ehc->i.flags |= ATA_EHI_PRINTINFO; |
1666 | rc = ata_dev_configure(dev); | ||
1667 | ehc->i.flags &= ~ATA_EHI_PRINTINFO; | ||
1668 | } | ||
1666 | 1669 | ||
1667 | if (rc) { | 1670 | if (rc) { |
1668 | dev->class = ATA_DEV_UNKNOWN; | 1671 | dev->class = ATA_DEV_UNKNOWN; |
diff --git a/drivers/ata/libata.h b/drivers/ata/libata.h index c83300055ec5..e4ffb2e38992 100644 --- a/drivers/ata/libata.h +++ b/drivers/ata/libata.h | |||
@@ -54,7 +54,7 @@ extern unsigned int ata_do_simple_cmd(struct ata_device *dev, u8 cmd); | |||
54 | extern int ata_dev_read_id(struct ata_device *dev, unsigned int *p_class, | 54 | extern int ata_dev_read_id(struct ata_device *dev, unsigned int *p_class, |
55 | int post_reset, u16 *id); | 55 | int post_reset, u16 *id); |
56 | extern int ata_dev_revalidate(struct ata_device *dev, int post_reset); | 56 | extern int ata_dev_revalidate(struct ata_device *dev, int post_reset); |
57 | extern int ata_dev_configure(struct ata_device *dev, int print_info); | 57 | extern int ata_dev_configure(struct ata_device *dev); |
58 | extern int sata_down_spd_limit(struct ata_port *ap); | 58 | extern int sata_down_spd_limit(struct ata_port *ap); |
59 | extern int sata_set_spd_needed(struct ata_port *ap); | 59 | extern int sata_set_spd_needed(struct ata_port *ap); |
60 | extern int ata_down_xfermask_limit(struct ata_device *dev, int force_pio0); | 60 | extern int ata_down_xfermask_limit(struct ata_device *dev, int force_pio0); |
diff --git a/drivers/ata/sata_sil.c b/drivers/ata/sata_sil.c index ca8d99312472..f844a1faba18 100644 --- a/drivers/ata/sata_sil.c +++ b/drivers/ata/sata_sil.c | |||
@@ -534,6 +534,7 @@ static void sil_thaw(struct ata_port *ap) | |||
534 | */ | 534 | */ |
535 | static void sil_dev_config(struct ata_port *ap, struct ata_device *dev) | 535 | static void sil_dev_config(struct ata_port *ap, struct ata_device *dev) |
536 | { | 536 | { |
537 | int print_info = ap->eh_context.i.flags & ATA_EHI_PRINTINFO; | ||
537 | unsigned int n, quirks = 0; | 538 | unsigned int n, quirks = 0; |
538 | unsigned char model_num[41]; | 539 | unsigned char model_num[41]; |
539 | 540 | ||
@@ -549,16 +550,18 @@ static void sil_dev_config(struct ata_port *ap, struct ata_device *dev) | |||
549 | if (slow_down || | 550 | if (slow_down || |
550 | ((ap->flags & SIL_FLAG_MOD15WRITE) && | 551 | ((ap->flags & SIL_FLAG_MOD15WRITE) && |
551 | (quirks & SIL_QUIRK_MOD15WRITE))) { | 552 | (quirks & SIL_QUIRK_MOD15WRITE))) { |
552 | ata_dev_printk(dev, KERN_INFO, "applying Seagate errata fix " | 553 | if (print_info) |
553 | "(mod15write workaround)\n"); | 554 | ata_dev_printk(dev, KERN_INFO, "applying Seagate " |
555 | "errata fix (mod15write workaround)\n"); | ||
554 | dev->max_sectors = 15; | 556 | dev->max_sectors = 15; |
555 | return; | 557 | return; |
556 | } | 558 | } |
557 | 559 | ||
558 | /* limit to udma5 */ | 560 | /* limit to udma5 */ |
559 | if (quirks & SIL_QUIRK_UDMA5MAX) { | 561 | if (quirks & SIL_QUIRK_UDMA5MAX) { |
560 | ata_dev_printk(dev, KERN_INFO, | 562 | if (print_info) |
561 | "applying Maxtor errata fix %s\n", model_num); | 563 | ata_dev_printk(dev, KERN_INFO, "applying Maxtor " |
564 | "errata fix %s\n", model_num); | ||
562 | dev->udma_mask &= ATA_UDMA5; | 565 | dev->udma_mask &= ATA_UDMA5; |
563 | return; | 566 | return; |
564 | } | 567 | } |