aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ata
diff options
context:
space:
mode:
authorJeff Garzik <jeff@garzik.org>2012-07-25 15:58:48 -0400
committerJeff Garzik <jgarzik@redhat.com>2012-07-25 15:58:48 -0400
commit8407884dd9164ec18ed2afc00f56b87e36c51fcf (patch)
treeb6ea42c231d7d39f454de28a068d78ce11709770 /drivers/ata
parentdc7f71f486f4f5fa96f6dcf86833da020cde8a11 (diff)
parentbdc0077af574800d24318b6945cf2344e8dbb050 (diff)
Merge branch 'master' [vanilla Linus master] into libata-dev.git/upstream
Two bits were appended to the end of the bitfield list in struct scsi_device. Resolve that conflict by including both bits. Conflicts: include/scsi/scsi_device.h
Diffstat (limited to 'drivers/ata')
-rw-r--r--drivers/ata/libata-core.c4
-rw-r--r--drivers/ata/libata-eh.c57
2 files changed, 50 insertions, 11 deletions
diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c
index 95a656f33a23..fadd5866d40f 100644
--- a/drivers/ata/libata-core.c
+++ b/drivers/ata/libata-core.c
@@ -80,6 +80,8 @@ const struct ata_port_operations ata_base_port_ops = {
80 .prereset = ata_std_prereset, 80 .prereset = ata_std_prereset,
81 .postreset = ata_std_postreset, 81 .postreset = ata_std_postreset,
82 .error_handler = ata_std_error_handler, 82 .error_handler = ata_std_error_handler,
83 .sched_eh = ata_std_sched_eh,
84 .end_eh = ata_std_end_eh,
83}; 85};
84 86
85const struct ata_port_operations sata_port_ops = { 87const struct ata_port_operations sata_port_ops = {
@@ -6644,6 +6646,8 @@ struct ata_port_operations ata_dummy_port_ops = {
6644 .qc_prep = ata_noop_qc_prep, 6646 .qc_prep = ata_noop_qc_prep,
6645 .qc_issue = ata_dummy_qc_issue, 6647 .qc_issue = ata_dummy_qc_issue,
6646 .error_handler = ata_dummy_error_handler, 6648 .error_handler = ata_dummy_error_handler,
6649 .sched_eh = ata_std_sched_eh,
6650 .end_eh = ata_std_end_eh,
6647}; 6651};
6648 6652
6649const struct ata_port_info ata_dummy_port_info = { 6653const struct ata_port_info ata_dummy_port_info = {
diff --git a/drivers/ata/libata-eh.c b/drivers/ata/libata-eh.c
index 938b6996c38f..7d4535e989bf 100644
--- a/drivers/ata/libata-eh.c
+++ b/drivers/ata/libata-eh.c
@@ -793,12 +793,12 @@ void ata_scsi_port_error_handler(struct Scsi_Host *host, struct ata_port *ap)
793 ata_for_each_link(link, ap, HOST_FIRST) 793 ata_for_each_link(link, ap, HOST_FIRST)
794 memset(&link->eh_info, 0, sizeof(link->eh_info)); 794 memset(&link->eh_info, 0, sizeof(link->eh_info));
795 795
796 /* Clear host_eh_scheduled while holding ap->lock such 796 /* end eh (clear host_eh_scheduled) while holding
797 * that if exception occurs after this point but 797 * ap->lock such that if exception occurs after this
798 * before EH completion, SCSI midlayer will 798 * point but before EH completion, SCSI midlayer will
799 * re-initiate EH. 799 * re-initiate EH.
800 */ 800 */
801 host->host_eh_scheduled = 0; 801 ap->ops->end_eh(ap);
802 802
803 spin_unlock_irqrestore(ap->lock, flags); 803 spin_unlock_irqrestore(ap->lock, flags);
804 ata_eh_release(ap); 804 ata_eh_release(ap);
@@ -986,16 +986,13 @@ void ata_qc_schedule_eh(struct ata_queued_cmd *qc)
986} 986}
987 987
988/** 988/**
989 * ata_port_schedule_eh - schedule error handling without a qc 989 * ata_std_sched_eh - non-libsas ata_ports issue eh with this common routine
990 * @ap: ATA port to schedule EH for 990 * @ap: ATA port to schedule EH for
991 *
992 * Schedule error handling for @ap. EH will kick in as soon as
993 * all commands are drained.
994 * 991 *
995 * LOCKING: 992 * LOCKING: inherited from ata_port_schedule_eh
996 * spin_lock_irqsave(host lock) 993 * spin_lock_irqsave(host lock)
997 */ 994 */
998void ata_port_schedule_eh(struct ata_port *ap) 995void ata_std_sched_eh(struct ata_port *ap)
999{ 996{
1000 WARN_ON(!ap->ops->error_handler); 997 WARN_ON(!ap->ops->error_handler);
1001 998
@@ -1007,6 +1004,44 @@ void ata_port_schedule_eh(struct ata_port *ap)
1007 1004
1008 DPRINTK("port EH scheduled\n"); 1005 DPRINTK("port EH scheduled\n");
1009} 1006}
1007EXPORT_SYMBOL_GPL(ata_std_sched_eh);
1008
1009/**
1010 * ata_std_end_eh - non-libsas ata_ports complete eh with this common routine
1011 * @ap: ATA port to end EH for
1012 *
1013 * In the libata object model there is a 1:1 mapping of ata_port to
1014 * shost, so host fields can be directly manipulated under ap->lock, in
1015 * the libsas case we need to hold a lock at the ha->level to coordinate
1016 * these events.
1017 *
1018 * LOCKING:
1019 * spin_lock_irqsave(host lock)
1020 */
1021void ata_std_end_eh(struct ata_port *ap)
1022{
1023 struct Scsi_Host *host = ap->scsi_host;
1024
1025 host->host_eh_scheduled = 0;
1026}
1027EXPORT_SYMBOL(ata_std_end_eh);
1028
1029
1030/**
1031 * ata_port_schedule_eh - schedule error handling without a qc
1032 * @ap: ATA port to schedule EH for
1033 *
1034 * Schedule error handling for @ap. EH will kick in as soon as
1035 * all commands are drained.
1036 *
1037 * LOCKING:
1038 * spin_lock_irqsave(host lock)
1039 */
1040void ata_port_schedule_eh(struct ata_port *ap)
1041{
1042 /* see: ata_std_sched_eh, unless you know better */
1043 ap->ops->sched_eh(ap);
1044}
1010 1045
1011static int ata_do_link_abort(struct ata_port *ap, struct ata_link *link) 1046static int ata_do_link_abort(struct ata_port *ap, struct ata_link *link)
1012{ 1047{