libata-eh.c (6f366c1c751454df3d1c0f25f15ee0164821112a) libata-eh.c (6ffa01d88c9dd45e2ed917b5eeeb494d07efb1ab)
1/*
2 * libata-eh.c - libata error handling
3 *
4 * Maintained by: Jeff Garzik <jgarzik@pobox.com>
5 * Please ALWAYS copy linux-ide@vger.kernel.org
6 * on emails.
7 *
8 * Copyright 2006 Tejun Heo <htejun@gmail.com>

--- 38 unchanged lines hidden (view full) ---

47enum {
48 ATA_EH_SPDN_NCQ_OFF = (1 << 0),
49 ATA_EH_SPDN_SPEED_DOWN = (1 << 1),
50 ATA_EH_SPDN_FALLBACK_TO_PIO = (1 << 2),
51};
52
53static void __ata_port_freeze(struct ata_port *ap);
54static void ata_eh_finish(struct ata_port *ap);
1/*
2 * libata-eh.c - libata error handling
3 *
4 * Maintained by: Jeff Garzik <jgarzik@pobox.com>
5 * Please ALWAYS copy linux-ide@vger.kernel.org
6 * on emails.
7 *
8 * Copyright 2006 Tejun Heo <htejun@gmail.com>

--- 38 unchanged lines hidden (view full) ---

47enum {
48 ATA_EH_SPDN_NCQ_OFF = (1 << 0),
49 ATA_EH_SPDN_SPEED_DOWN = (1 << 1),
50 ATA_EH_SPDN_FALLBACK_TO_PIO = (1 << 2),
51};
52
53static void __ata_port_freeze(struct ata_port *ap);
54static void ata_eh_finish(struct ata_port *ap);
55#ifdef CONFIG_PM
55static void ata_eh_handle_port_suspend(struct ata_port *ap);
56static void ata_eh_handle_port_resume(struct ata_port *ap);
56static void ata_eh_handle_port_suspend(struct ata_port *ap);
57static void ata_eh_handle_port_resume(struct ata_port *ap);
58static int ata_eh_suspend(struct ata_port *ap,
59 struct ata_device **r_failed_dev);
60static void ata_eh_prep_resume(struct ata_port *ap);
61static int ata_eh_resume(struct ata_port *ap, struct ata_device **r_failed_dev);
62#else /* CONFIG_PM */
63static void ata_eh_handle_port_suspend(struct ata_port *ap)
64{ }
57
65
66static void ata_eh_handle_port_resume(struct ata_port *ap)
67{ }
68
69static int ata_eh_suspend(struct ata_port *ap, struct ata_device **r_failed_dev)
70{
71 return 0;
72}
73
74static void ata_eh_prep_resume(struct ata_port *ap)
75{ }
76
77static int ata_eh_resume(struct ata_port *ap, struct ata_device **r_failed_dev)
78{
79 return 0;
80}
81#endif /* CONFIG_PM */
82
58static void ata_ering_record(struct ata_ering *ering, int is_io,
59 unsigned int err_mask)
60{
61 struct ata_ering_entry *ent;
62
63 WARN_ON(!err_mask);
64
65 ering->cursor++;

--- 1719 unchanged lines hidden (view full) ---

1785
1786 if (rc)
1787 *r_failed_dev = dev;
1788
1789 DPRINTK("EXIT\n");
1790 return rc;
1791}
1792
83static void ata_ering_record(struct ata_ering *ering, int is_io,
84 unsigned int err_mask)
85{
86 struct ata_ering_entry *ent;
87
88 WARN_ON(!err_mask);
89
90 ering->cursor++;

--- 1719 unchanged lines hidden (view full) ---

1810
1811 if (rc)
1812 *r_failed_dev = dev;
1813
1814 DPRINTK("EXIT\n");
1815 return rc;
1816}
1817
1818#ifdef CONFIG_PM
1793/**
1794 * ata_eh_suspend - handle suspend EH action
1795 * @ap: target host port
1796 * @r_failed_dev: result parameter to indicate failing device
1797 *
1798 * Handle suspend EH action. Disk devices are spinned down and
1799 * other types of devices are just marked suspended. Once
1800 * suspended, no EH action to the device is allowed until it is

--- 141 unchanged lines hidden (view full) ---

1942 }
1943
1944 if (rc)
1945 *r_failed_dev = dev;
1946
1947 DPRINTK("EXIT\n");
1948 return 0;
1949}
1819/**
1820 * ata_eh_suspend - handle suspend EH action
1821 * @ap: target host port
1822 * @r_failed_dev: result parameter to indicate failing device
1823 *
1824 * Handle suspend EH action. Disk devices are spinned down and
1825 * other types of devices are just marked suspended. Once
1826 * suspended, no EH action to the device is allowed until it is

--- 141 unchanged lines hidden (view full) ---

1968 }
1969
1970 if (rc)
1971 *r_failed_dev = dev;
1972
1973 DPRINTK("EXIT\n");
1974 return 0;
1975}
1976#endif /* CONFIG_PM */
1950
1951static int ata_port_nr_enabled(struct ata_port *ap)
1952{
1953 int i, cnt = 0;
1954
1955 for (i = 0; i < ATA_MAX_DEVICES; i++)
1956 if (ata_dev_enabled(&ap->device[i]))
1957 cnt++;

--- 286 unchanged lines hidden (view full) ---

2244 ata_postreset_fn_t postreset)
2245{
2246 ata_eh_autopsy(ap);
2247 ata_eh_report(ap);
2248 ata_eh_recover(ap, prereset, softreset, hardreset, postreset);
2249 ata_eh_finish(ap);
2250}
2251
1977
1978static int ata_port_nr_enabled(struct ata_port *ap)
1979{
1980 int i, cnt = 0;
1981
1982 for (i = 0; i < ATA_MAX_DEVICES; i++)
1983 if (ata_dev_enabled(&ap->device[i]))
1984 cnt++;

--- 286 unchanged lines hidden (view full) ---

2271 ata_postreset_fn_t postreset)
2272{
2273 ata_eh_autopsy(ap);
2274 ata_eh_report(ap);
2275 ata_eh_recover(ap, prereset, softreset, hardreset, postreset);
2276 ata_eh_finish(ap);
2277}
2278
2279#ifdef CONFIG_PM
2252/**
2253 * ata_eh_handle_port_suspend - perform port suspend operation
2254 * @ap: port to suspend
2255 *
2256 * Suspend @ap.
2257 *
2258 * LOCKING:
2259 * Kernel thread context (may sleep).

--- 99 unchanged lines hidden (view full) ---

2359 spin_lock_irqsave(ap->lock, flags);
2360 ap->pflags &= ~(ATA_PFLAG_PM_PENDING | ATA_PFLAG_SUSPENDED);
2361 if (ap->pm_result) {
2362 *ap->pm_result = rc;
2363 ap->pm_result = NULL;
2364 }
2365 spin_unlock_irqrestore(ap->lock, flags);
2366}
2280/**
2281 * ata_eh_handle_port_suspend - perform port suspend operation
2282 * @ap: port to suspend
2283 *
2284 * Suspend @ap.
2285 *
2286 * LOCKING:
2287 * Kernel thread context (may sleep).

--- 99 unchanged lines hidden (view full) ---

2387 spin_lock_irqsave(ap->lock, flags);
2388 ap->pflags &= ~(ATA_PFLAG_PM_PENDING | ATA_PFLAG_SUSPENDED);
2389 if (ap->pm_result) {
2390 *ap->pm_result = rc;
2391 ap->pm_result = NULL;
2392 }
2393 spin_unlock_irqrestore(ap->lock, flags);
2394}
2395#endif /* CONFIG_PM */