aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorTejun Heo <htejun@gmail.com>2006-04-11 09:16:45 -0400
committerJeff Garzik <jeff@garzik.org>2006-04-11 13:12:46 -0400
commit2bf2cb26b2512c6a609bb152982c388329bedff6 (patch)
tree9f1f3ea5000304fd946f34b24d9904c2a1027480 /drivers
parentdb70fef0750e5f8dbb64f9fadb333d2c7caf26a1 (diff)
[PATCH] libata: kill @verbose from ata_reset_fn_t
@verbose was added to ata_reset_fn_t because AHCI complained during probing if no device was attached to the port. However, muting failure message isn't the correct approach. Reset methods are responsible for detecting no device condition and finishing successfully. Now that AHCI softreset is fixed, kill @verbose. Signed-off-by: Tejun Heo <htejun@gmail.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/scsi/ahci.c13
-rw-r--r--drivers/scsi/libata-core.c36
-rw-r--r--drivers/scsi/libata.h6
-rw-r--r--drivers/scsi/sata_sil24.c8
4 files changed, 22 insertions, 41 deletions
diff --git a/drivers/scsi/ahci.c b/drivers/scsi/ahci.c
index 20fc0846e0be..0e7fb9bf2cd1 100644
--- a/drivers/scsi/ahci.c
+++ b/drivers/scsi/ahci.c
@@ -534,7 +534,7 @@ static int ahci_poll_register(void __iomem *reg, u32 mask, u32 val,
534 return -1; 534 return -1;
535} 535}
536 536
537static int ahci_softreset(struct ata_port *ap, int verbose, unsigned int *class) 537static int ahci_softreset(struct ata_port *ap, unsigned int *class)
538{ 538{
539 struct ahci_host_priv *hpriv = ap->host_set->private_data; 539 struct ahci_host_priv *hpriv = ap->host_set->private_data;
540 struct ahci_port_priv *pp = ap->private_data; 540 struct ahci_port_priv *pp = ap->private_data;
@@ -646,22 +646,19 @@ static int ahci_softreset(struct ata_port *ap, int verbose, unsigned int *class)
646 fail_restart: 646 fail_restart:
647 ahci_start_engine(ap); 647 ahci_start_engine(ap);
648 fail: 648 fail:
649 if (verbose) 649 printk(KERN_ERR "ata%u: softreset failed (%s)\n",
650 printk(KERN_ERR "ata%u: softreset failed (%s)\n", 650 ap->id, reason);
651 ap->id, reason);
652 else
653 DPRINTK("EXIT, rc=%d reason=\"%s\"\n", rc, reason);
654 return rc; 651 return rc;
655} 652}
656 653
657static int ahci_hardreset(struct ata_port *ap, int verbose, unsigned int *class) 654static int ahci_hardreset(struct ata_port *ap, unsigned int *class)
658{ 655{
659 int rc; 656 int rc;
660 657
661 DPRINTK("ENTER\n"); 658 DPRINTK("ENTER\n");
662 659
663 ahci_stop_engine(ap); 660 ahci_stop_engine(ap);
664 rc = sata_std_hardreset(ap, verbose, class); 661 rc = sata_std_hardreset(ap, class);
665 ahci_start_engine(ap); 662 ahci_start_engine(ap);
666 663
667 if (rc == 0) 664 if (rc == 0)
diff --git a/drivers/scsi/libata-core.c b/drivers/scsi/libata-core.c
index f37179623efa..92b5077ac052 100644
--- a/drivers/scsi/libata-core.c
+++ b/drivers/scsi/libata-core.c
@@ -2387,7 +2387,6 @@ void ata_std_probeinit(struct ata_port *ap)
2387/** 2387/**
2388 * ata_std_softreset - reset host port via ATA SRST 2388 * ata_std_softreset - reset host port via ATA SRST
2389 * @ap: port to reset 2389 * @ap: port to reset
2390 * @verbose: fail verbosely
2391 * @classes: resulting classes of attached devices 2390 * @classes: resulting classes of attached devices
2392 * 2391 *
2393 * Reset host port using ATA SRST. This function is to be used 2392 * Reset host port using ATA SRST. This function is to be used
@@ -2399,7 +2398,7 @@ void ata_std_probeinit(struct ata_port *ap)
2399 * RETURNS: 2398 * RETURNS:
2400 * 0 on success, -errno otherwise. 2399 * 0 on success, -errno otherwise.
2401 */ 2400 */
2402int ata_std_softreset(struct ata_port *ap, int verbose, unsigned int *classes) 2401int ata_std_softreset(struct ata_port *ap, unsigned int *classes)
2403{ 2402{
2404 unsigned int slave_possible = ap->flags & ATA_FLAG_SLAVE_POSS; 2403 unsigned int slave_possible = ap->flags & ATA_FLAG_SLAVE_POSS;
2405 unsigned int devmask = 0, err_mask; 2404 unsigned int devmask = 0, err_mask;
@@ -2425,12 +2424,8 @@ int ata_std_softreset(struct ata_port *ap, int verbose, unsigned int *classes)
2425 DPRINTK("about to softreset, devmask=%x\n", devmask); 2424 DPRINTK("about to softreset, devmask=%x\n", devmask);
2426 err_mask = ata_bus_softreset(ap, devmask); 2425 err_mask = ata_bus_softreset(ap, devmask);
2427 if (err_mask) { 2426 if (err_mask) {
2428 if (verbose) 2427 printk(KERN_ERR "ata%u: SRST failed (err_mask=0x%x)\n",
2429 printk(KERN_ERR "ata%u: SRST failed (err_mask=0x%x)\n", 2428 ap->id, err_mask);
2430 ap->id, err_mask);
2431 else
2432 DPRINTK("EXIT, softreset failed (err_mask=0x%x)\n",
2433 err_mask);
2434 return -EIO; 2429 return -EIO;
2435 } 2430 }
2436 2431
@@ -2447,7 +2442,6 @@ int ata_std_softreset(struct ata_port *ap, int verbose, unsigned int *classes)
2447/** 2442/**
2448 * sata_std_hardreset - reset host port via SATA phy reset 2443 * sata_std_hardreset - reset host port via SATA phy reset
2449 * @ap: port to reset 2444 * @ap: port to reset
2450 * @verbose: fail verbosely
2451 * @class: resulting class of attached device 2445 * @class: resulting class of attached device
2452 * 2446 *
2453 * SATA phy-reset host port using DET bits of SControl register. 2447 * SATA phy-reset host port using DET bits of SControl register.
@@ -2460,7 +2454,7 @@ int ata_std_softreset(struct ata_port *ap, int verbose, unsigned int *classes)
2460 * RETURNS: 2454 * RETURNS:
2461 * 0 on success, -errno otherwise. 2455 * 0 on success, -errno otherwise.
2462 */ 2456 */
2463int sata_std_hardreset(struct ata_port *ap, int verbose, unsigned int *class) 2457int sata_std_hardreset(struct ata_port *ap, unsigned int *class)
2464{ 2458{
2465 u32 scontrol; 2459 u32 scontrol;
2466 2460
@@ -2500,11 +2494,8 @@ int sata_std_hardreset(struct ata_port *ap, int verbose, unsigned int *class)
2500 } 2494 }
2501 2495
2502 if (ata_busy_sleep(ap, ATA_TMOUT_BOOT_QUICK, ATA_TMOUT_BOOT)) { 2496 if (ata_busy_sleep(ap, ATA_TMOUT_BOOT_QUICK, ATA_TMOUT_BOOT)) {
2503 if (verbose) 2497 printk(KERN_ERR "ata%u: COMRESET failed "
2504 printk(KERN_ERR "ata%u: COMRESET failed " 2498 "(device not ready)\n", ap->id);
2505 "(device not ready)\n", ap->id);
2506 else
2507 DPRINTK("EXIT, device not ready\n");
2508 return -EIO; 2499 return -EIO;
2509 } 2500 }
2510 2501
@@ -2592,16 +2583,15 @@ int ata_std_probe_reset(struct ata_port *ap, unsigned int *classes)
2592 ata_std_postreset, classes); 2583 ata_std_postreset, classes);
2593} 2584}
2594 2585
2595int ata_do_reset(struct ata_port *ap, 2586int ata_do_reset(struct ata_port *ap, ata_reset_fn_t reset,
2596 ata_reset_fn_t reset, ata_postreset_fn_t postreset, 2587 ata_postreset_fn_t postreset, unsigned int *classes)
2597 int verbose, unsigned int *classes)
2598{ 2588{
2599 int i, rc; 2589 int i, rc;
2600 2590
2601 for (i = 0; i < ATA_MAX_DEVICES; i++) 2591 for (i = 0; i < ATA_MAX_DEVICES; i++)
2602 classes[i] = ATA_DEV_UNKNOWN; 2592 classes[i] = ATA_DEV_UNKNOWN;
2603 2593
2604 rc = reset(ap, verbose, classes); 2594 rc = reset(ap, classes);
2605 if (rc) 2595 if (rc)
2606 return rc; 2596 return rc;
2607 2597
@@ -2645,8 +2635,6 @@ int ata_do_reset(struct ata_port *ap,
2645 * - If classification is supported, fill classes[] with 2635 * - If classification is supported, fill classes[] with
2646 * recognized class codes. 2636 * recognized class codes.
2647 * - If classification is not supported, leave classes[] alone. 2637 * - If classification is not supported, leave classes[] alone.
2648 * - If verbose is non-zero, print error message on failure;
2649 * otherwise, shut up.
2650 * 2638 *
2651 * LOCKING: 2639 * LOCKING:
2652 * Kernel thread context (may sleep) 2640 * Kernel thread context (may sleep)
@@ -2666,7 +2654,7 @@ int ata_drive_probe_reset(struct ata_port *ap, ata_probeinit_fn_t probeinit,
2666 probeinit(ap); 2654 probeinit(ap);
2667 2655
2668 if (softreset && !ata_set_sata_spd_needed(ap)) { 2656 if (softreset && !ata_set_sata_spd_needed(ap)) {
2669 rc = ata_do_reset(ap, softreset, postreset, 0, classes); 2657 rc = ata_do_reset(ap, softreset, postreset, classes);
2670 if (rc == 0 && classes[0] != ATA_DEV_UNKNOWN) 2658 if (rc == 0 && classes[0] != ATA_DEV_UNKNOWN)
2671 goto done; 2659 goto done;
2672 printk(KERN_INFO "ata%u: softreset failed, will try " 2660 printk(KERN_INFO "ata%u: softreset failed, will try "
@@ -2678,7 +2666,7 @@ int ata_drive_probe_reset(struct ata_port *ap, ata_probeinit_fn_t probeinit,
2678 goto done; 2666 goto done;
2679 2667
2680 while (1) { 2668 while (1) {
2681 rc = ata_do_reset(ap, hardreset, postreset, 0, classes); 2669 rc = ata_do_reset(ap, hardreset, postreset, classes);
2682 if (rc == 0) { 2670 if (rc == 0) {
2683 if (classes[0] != ATA_DEV_UNKNOWN) 2671 if (classes[0] != ATA_DEV_UNKNOWN)
2684 goto done; 2672 goto done;
@@ -2699,7 +2687,7 @@ int ata_drive_probe_reset(struct ata_port *ap, ata_probeinit_fn_t probeinit,
2699 ap->id); 2687 ap->id);
2700 ssleep(5); 2688 ssleep(5);
2701 2689
2702 rc = ata_do_reset(ap, softreset, postreset, 0, classes); 2690 rc = ata_do_reset(ap, softreset, postreset, classes);
2703 } 2691 }
2704 2692
2705 done: 2693 done:
diff --git a/drivers/scsi/libata.h b/drivers/scsi/libata.h
index b18d377588dc..3f8b0a863781 100644
--- a/drivers/scsi/libata.h
+++ b/drivers/scsi/libata.h
@@ -56,10 +56,8 @@ extern int ata_set_sata_spd_needed(struct ata_port *ap);
56extern int ata_down_xfermask_limit(struct ata_port *ap, struct ata_device *dev, 56extern int ata_down_xfermask_limit(struct ata_port *ap, struct ata_device *dev,
57 int force_pio0); 57 int force_pio0);
58extern int ata_set_mode(struct ata_port *ap, struct ata_device **r_failed_dev); 58extern int ata_set_mode(struct ata_port *ap, struct ata_device **r_failed_dev);
59extern int ata_do_reset(struct ata_port *ap, 59extern int ata_do_reset(struct ata_port *ap, ata_reset_fn_t reset,
60 ata_reset_fn_t reset, 60 ata_postreset_fn_t postreset, unsigned int *classes);
61 ata_postreset_fn_t postreset,
62 int verbose, unsigned int *classes);
63extern void ata_qc_free(struct ata_queued_cmd *qc); 61extern void ata_qc_free(struct ata_queued_cmd *qc);
64extern void ata_qc_issue(struct ata_queued_cmd *qc); 62extern void ata_qc_issue(struct ata_queued_cmd *qc);
65extern int ata_check_atapi_dma(struct ata_queued_cmd *qc); 63extern int ata_check_atapi_dma(struct ata_queued_cmd *qc);
diff --git a/drivers/scsi/sata_sil24.c b/drivers/scsi/sata_sil24.c
index 9aa7493ea146..26d84e094b1d 100644
--- a/drivers/scsi/sata_sil24.c
+++ b/drivers/scsi/sata_sil24.c
@@ -426,8 +426,7 @@ static void sil24_tf_read(struct ata_port *ap, struct ata_taskfile *tf)
426 *tf = pp->tf; 426 *tf = pp->tf;
427} 427}
428 428
429static int sil24_softreset(struct ata_port *ap, int verbose, 429static int sil24_softreset(struct ata_port *ap, unsigned int *class)
430 unsigned int *class)
431{ 430{
432 void __iomem *port = (void __iomem *)ap->ioaddr.cmd_addr; 431 void __iomem *port = (void __iomem *)ap->ioaddr.cmd_addr;
433 struct sil24_port_priv *pp = ap->private_data; 432 struct sil24_port_priv *pp = ap->private_data;
@@ -489,13 +488,12 @@ static int sil24_softreset(struct ata_port *ap, int verbose,
489 return 0; 488 return 0;
490} 489}
491 490
492static int sil24_hardreset(struct ata_port *ap, int verbose, 491static int sil24_hardreset(struct ata_port *ap, unsigned int *class)
493 unsigned int *class)
494{ 492{
495 unsigned int dummy_class; 493 unsigned int dummy_class;
496 494
497 /* sil24 doesn't report device signature after hard reset */ 495 /* sil24 doesn't report device signature after hard reset */
498 return sata_std_hardreset(ap, verbose, &dummy_class); 496 return sata_std_hardreset(ap, &dummy_class);
499} 497}
500 498
501static int sil24_probe_reset(struct ata_port *ap, unsigned int *classes) 499static int sil24_probe_reset(struct ata_port *ap, unsigned int *classes)