libata: make reset related methods proper port operations
[deliverable/linux.git] / drivers / ata / libata-eh.c
index 0d0a2c0ab9e7b23864f09b729f9be963f0b3d89d..ec32082356cb073c457f7c41572187ee528657c3 100644 (file)
@@ -2814,6 +2814,7 @@ void ata_eh_finish(struct ata_port *ap)
 /**
  *     ata_do_eh - do standard error handling
  *     @ap: host port to handle error for
+ *
  *     @prereset: prereset method (can be NULL)
  *     @softreset: softreset method (can be NULL)
  *     @hardreset: hardreset method (can be NULL)
@@ -2844,6 +2845,30 @@ void ata_do_eh(struct ata_port *ap, ata_prereset_fn_t prereset,
        ata_eh_finish(ap);
 }
 
+/**
+ *     ata_std_error_handler - standard error handler
+ *     @ap: host port to handle error for
+ *
+ *     Standard error handler
+ *
+ *     LOCKING:
+ *     Kernel thread context (may sleep).
+ */
+void ata_std_error_handler(struct ata_port *ap)
+{
+       struct ata_port_operations *ops = ap->ops;
+       ata_reset_fn_t hardreset = ops->hardreset;
+
+       /* sata_std_hardreset is inherited to all drivers from
+        * ata_base_port_ops.  Ignore it if SCR access is not
+        * available.
+        */
+       if (hardreset == sata_std_hardreset && !sata_scr_valid(&ap->link))
+               hardreset = NULL;
+
+       ata_do_eh(ap, ops->prereset, ops->softreset, hardreset, ops->postreset);
+}
+
 #ifdef CONFIG_PM
 /**
  *     ata_eh_handle_port_suspend - perform port suspend operation
This page took 0.02675 seconds and 5 git commands to generate.