aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@woody.linux-foundation.org>2007-05-08 14:58:20 -0400
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-05-08 14:58:20 -0400
commit4750def52cb2c21732dda9aa1d43a07db37b0186 (patch)
tree29fd6223665faabb593f8ae1f4f626685f425ff9 /include
parent9028780a3e6d2c3dd940e89b377765cca008b6df (diff)
parent27c78b372d05e47bbd059c9bb003c6d716abff54 (diff)
Merge branch 'reset-seq' of master.kernel.org:/pub/scm/linux/kernel/git/jgarzik/libata-dev
* 'reset-seq' of master.kernel.org:/pub/scm/linux/kernel/git/jgarzik/libata-dev: [libata reset-seq] build and merge fixes libata: reimplement reset sequencing libata: improve ata_std_prereset() libata: improve 0xff status handling libata: add deadline support to prereset and reset methods
Diffstat (limited to 'include')
-rw-r--r--include/linux/libata.h40
1 files changed, 15 insertions, 25 deletions
diff --git a/include/linux/libata.h b/include/linux/libata.h
index d8cfc72ea9c1..7906d750aa77 100644
--- a/include/linux/libata.h
+++ b/include/linux/libata.h
@@ -296,18 +296,8 @@ enum {
296 296
297 /* how hard are we gonna try to probe/recover devices */ 297 /* how hard are we gonna try to probe/recover devices */
298 ATA_PROBE_MAX_TRIES = 3, 298 ATA_PROBE_MAX_TRIES = 3,
299 ATA_EH_RESET_TRIES = 3,
300 ATA_EH_DEV_TRIES = 3, 299 ATA_EH_DEV_TRIES = 3,
301 300
302 /* Drive spinup time (time from power-on to the first D2H FIS)
303 * in msecs - 8s currently. Failing to get ready in this time
304 * isn't critical. It will result in reset failure for
305 * controllers which can't wait for the first D2H FIS. libata
306 * will retry, so it just has to be long enough to spin up
307 * most devices.
308 */
309 ATA_SPINUP_WAIT = 8000,
310
311 /* Horkage types. May be set by libata or controller on drives 301 /* Horkage types. May be set by libata or controller on drives
312 (some horkage may be drive/controller pair dependant */ 302 (some horkage may be drive/controller pair dependant */
313 303
@@ -348,8 +338,9 @@ struct ata_queued_cmd;
348 338
349/* typedefs */ 339/* typedefs */
350typedef void (*ata_qc_cb_t) (struct ata_queued_cmd *qc); 340typedef void (*ata_qc_cb_t) (struct ata_queued_cmd *qc);
351typedef int (*ata_prereset_fn_t)(struct ata_port *ap); 341typedef int (*ata_prereset_fn_t)(struct ata_port *ap, unsigned long deadline);
352typedef int (*ata_reset_fn_t)(struct ata_port *ap, unsigned int *classes); 342typedef int (*ata_reset_fn_t)(struct ata_port *ap, unsigned int *classes,
343 unsigned long deadline);
353typedef void (*ata_postreset_fn_t)(struct ata_port *ap, unsigned int *classes); 344typedef void (*ata_postreset_fn_t)(struct ata_port *ap, unsigned int *classes);
354 345
355struct ata_ioports { 346struct ata_ioports {
@@ -494,7 +485,6 @@ struct ata_eh_info {
494 unsigned int dev_action[ATA_MAX_DEVICES]; /* dev EH action */ 485 unsigned int dev_action[ATA_MAX_DEVICES]; /* dev EH action */
495 unsigned int flags; /* ATA_EHI_* flags */ 486 unsigned int flags; /* ATA_EHI_* flags */
496 487
497 unsigned long hotplug_timestamp;
498 unsigned int probe_mask; 488 unsigned int probe_mask;
499 489
500 char desc[ATA_EH_DESC_LEN]; 490 char desc[ATA_EH_DESC_LEN];
@@ -688,13 +678,17 @@ extern void __sata_phy_reset(struct ata_port *ap);
688extern void sata_phy_reset(struct ata_port *ap); 678extern void sata_phy_reset(struct ata_port *ap);
689extern void ata_bus_reset(struct ata_port *ap); 679extern void ata_bus_reset(struct ata_port *ap);
690extern int sata_set_spd(struct ata_port *ap); 680extern int sata_set_spd(struct ata_port *ap);
691extern int sata_phy_debounce(struct ata_port *ap, const unsigned long *param); 681extern int sata_phy_debounce(struct ata_port *ap, const unsigned long *param,
692extern int sata_phy_resume(struct ata_port *ap, const unsigned long *param); 682 unsigned long deadline);
693extern int ata_std_prereset(struct ata_port *ap); 683extern int sata_phy_resume(struct ata_port *ap, const unsigned long *param,
694extern int ata_std_softreset(struct ata_port *ap, unsigned int *classes); 684 unsigned long deadline);
695extern int sata_port_hardreset(struct ata_port *ap, 685extern int ata_std_prereset(struct ata_port *ap, unsigned long deadline);
696 const unsigned long *timing); 686extern int ata_std_softreset(struct ata_port *ap, unsigned int *classes,
697extern int sata_std_hardreset(struct ata_port *ap, unsigned int *class); 687 unsigned long deadline);
688extern int sata_port_hardreset(struct ata_port *ap, const unsigned long *timing,
689 unsigned long deadline);
690extern int sata_std_hardreset(struct ata_port *ap, unsigned int *class,
691 unsigned long deadline);
698extern void ata_std_postreset(struct ata_port *ap, unsigned int *classes); 692extern void ata_std_postreset(struct ata_port *ap, unsigned int *classes);
699extern void ata_port_disable(struct ata_port *); 693extern void ata_port_disable(struct ata_port *);
700extern void ata_std_ports(struct ata_ioports *ioaddr); 694extern void ata_std_ports(struct ata_ioports *ioaddr);
@@ -750,6 +744,7 @@ extern void ata_host_resume(struct ata_host *host);
750extern int ata_ratelimit(void); 744extern int ata_ratelimit(void);
751extern int ata_busy_sleep(struct ata_port *ap, 745extern int ata_busy_sleep(struct ata_port *ap,
752 unsigned long timeout_pat, unsigned long timeout); 746 unsigned long timeout_pat, unsigned long timeout);
747extern int ata_wait_ready(struct ata_port *ap, unsigned long deadline);
753extern void ata_port_queue_task(struct ata_port *ap, work_func_t fn, 748extern void ata_port_queue_task(struct ata_port *ap, work_func_t fn,
754 void *data, unsigned long delay); 749 void *data, unsigned long delay);
755extern u32 ata_wait_register(void __iomem *reg, u32 mask, u32 val, 750extern u32 ata_wait_register(void __iomem *reg, u32 mask, u32 val,
@@ -919,12 +914,7 @@ extern void ata_do_eh(struct ata_port *ap, ata_prereset_fn_t prereset,
919 914
920static inline void __ata_ehi_hotplugged(struct ata_eh_info *ehi) 915static inline void __ata_ehi_hotplugged(struct ata_eh_info *ehi)
921{ 916{
922 if (ehi->flags & ATA_EHI_HOTPLUGGED)
923 return;
924
925 ehi->flags |= ATA_EHI_HOTPLUGGED | ATA_EHI_RESUME_LINK; 917 ehi->flags |= ATA_EHI_HOTPLUGGED | ATA_EHI_RESUME_LINK;
926 ehi->hotplug_timestamp = jiffies;
927
928 ehi->action |= ATA_EH_SOFTRESET; 918 ehi->action |= ATA_EH_SOFTRESET;
929 ehi->probe_mask |= (1 << ATA_MAX_DEVICES) - 1; 919 ehi->probe_mask |= (1 << ATA_MAX_DEVICES) - 1;
930} 920}