/[linux-patches]/genpatches-2.6/tags/2.6.21-4/2112_libata-suspend.patch
Gentoo

Contents of /genpatches-2.6/tags/2.6.21-4/2112_libata-suspend.patch

Parent Directory Parent Directory | Revision Log Revision Log


Revision 974 - (show annotations) (download)
Thu May 24 23:17:59 2007 UTC (11 years, 4 months ago) by dsd
File size: 43107 byte(s)
2.6.21-4 release
1 From 9666f4009c22f6520ac3fb8a19c9e32ab973e828 Mon Sep 17 00:00:00 2001
2 From: Tejun Heo <htejun@gmail.com>
3 Date: Fri, 4 May 2007 21:27:47 +0200
4 Subject: [PATCH] libata: reimplement suspend/resume support using sdev->manage_start_stop
5
6 Reimplement suspend/resume support using sdev->manage_start_stop.
7
8 * Device suspend/resume is now SCSI layer's responsibility and the
9 code is simplified a lot.
10
11 * DPM is dropped. This also simplifies code a lot. Suspend/resume
12 status is port-wide now.
13
14 * ata_scsi_device_suspend/resume() and ata_dev_ready() removed.
15
16 * Resume now has to wait for disk to spin up before proceeding. I
17 couldn't find easy way out as libata is in EH waiting for the
18 disk to be ready and sd is waiting for EH to complete to issue
19 START_STOP.
20
21 * sdev->manage_start_stop is set to 1 in ata_scsi_slave_config().
22 This fixes spindown on shutdown and suspend-to-disk.
23
24 Signed-off-by: Tejun Heo <htejun@gmail.com>
25 Signed-off-by: Jeff Garzik <jeff@garzik.org>
26 ---
27 drivers/ata/ahci.c | 4 -
28 drivers/ata/ata_generic.c | 6 +-
29 drivers/ata/ata_piix.c | 4 -
30 drivers/ata/libata-core.c | 39 +------
31 drivers/ata/libata-eh.c | 237 +--------------------------------------
32 drivers/ata/libata-scsi.c | 129 +---------------------
33 drivers/ata/pata_ali.c | 4 -
34 drivers/ata/pata_amd.c | 4 -
35 drivers/ata/pata_atiixp.c | 4 -
36 drivers/ata/pata_cmd640.c | 4 -
37 drivers/ata/pata_cmd64x.c | 4 -
38 drivers/ata/pata_cs5520.c | 4 -
39 drivers/ata/pata_cs5530.c | 4 -
40 drivers/ata/pata_cs5535.c | 4 -
41 drivers/ata/pata_cypress.c | 4 -
42 drivers/ata/pata_efar.c | 4 -
43 drivers/ata/pata_hpt366.c | 4 -
44 drivers/ata/pata_hpt3x3.c | 4 -
45 drivers/ata/pata_it8213.c | 4 -
46 drivers/ata/pata_it821x.c | 4 -
47 drivers/ata/pata_ixp4xx_cf.c | 2 +-
48 drivers/ata/pata_jmicron.c | 4 -
49 drivers/ata/pata_marvell.c | 4 -
50 drivers/ata/pata_mpc52xx.c | 4 -
51 drivers/ata/pata_mpiix.c | 4 -
52 drivers/ata/pata_netcell.c | 4 -
53 drivers/ata/pata_ns87410.c | 4 -
54 drivers/ata/pata_oldpiix.c | 4 -
55 drivers/ata/pata_opti.c | 4 -
56 drivers/ata/pata_optidma.c | 4 -
57 drivers/ata/pata_pdc202xx_old.c | 4 -
58 drivers/ata/pata_radisys.c | 4 -
59 drivers/ata/pata_rz1000.c | 6 +-
60 drivers/ata/pata_sc1200.c | 4 -
61 drivers/ata/pata_scc.c | 4 -
62 drivers/ata/pata_serverworks.c | 4 -
63 drivers/ata/pata_sil680.c | 4 -
64 drivers/ata/pata_sis.c | 4 -
65 drivers/ata/pata_triflex.c | 4 -
66 drivers/ata/pata_via.c | 4 -
67 drivers/ata/sata_inic162x.c | 4 -
68 drivers/ata/sata_nv.c | 8 --
69 drivers/ata/sata_sil.c | 4 -
70 drivers/ata/sata_sil24.c | 4 -
71 include/linux/libata.h | 14 +--
72 45 files changed, 14 insertions(+), 575 deletions(-)
73
74 Index: linux-2.6.21-gentoo-r1/drivers/ata/ahci.c
75 ===================================================================
76 --- linux-2.6.21-gentoo-r1.orig/drivers/ata/ahci.c
77 +++ linux-2.6.21-gentoo-r1/drivers/ata/ahci.c
78 @@ -245,10 +245,6 @@ static struct scsi_host_template ahci_sh
79 .slave_configure = ata_scsi_slave_config,
80 .slave_destroy = ata_scsi_slave_destroy,
81 .bios_param = ata_std_bios_param,
82 -#ifdef CONFIG_PM
83 - .suspend = ata_scsi_device_suspend,
84 - .resume = ata_scsi_device_resume,
85 -#endif
86 };
87
88 static const struct ata_port_operations ahci_ops = {
89 Index: linux-2.6.21-gentoo-r1/drivers/ata/ata_generic.c
90 ===================================================================
91 --- linux-2.6.21-gentoo-r1.orig/drivers/ata/ata_generic.c
92 +++ linux-2.6.21-gentoo-r1/drivers/ata/ata_generic.c
93 @@ -83,7 +83,7 @@ static int generic_set_mode(struct ata_p
94
95 for (i = 0; i < ATA_MAX_DEVICES; i++) {
96 struct ata_device *dev = &ap->device[i];
97 - if (ata_dev_ready(dev)) {
98 + if (ata_dev_enabled(dev)) {
99 /* We don't really care */
100 dev->pio_mode = XFER_PIO_0;
101 dev->dma_mode = XFER_MW_DMA_0;
102 @@ -119,10 +119,6 @@ static struct scsi_host_template generic
103 .slave_configure = ata_scsi_slave_config,
104 .slave_destroy = ata_scsi_slave_destroy,
105 .bios_param = ata_std_bios_param,
106 -#ifdef CONFIG_PM
107 - .resume = ata_scsi_device_resume,
108 - .suspend = ata_scsi_device_suspend,
109 -#endif
110 };
111
112 static struct ata_port_operations generic_port_ops = {
113 Index: linux-2.6.21-gentoo-r1/drivers/ata/ata_piix.c
114 ===================================================================
115 --- linux-2.6.21-gentoo-r1.orig/drivers/ata/ata_piix.c
116 +++ linux-2.6.21-gentoo-r1/drivers/ata/ata_piix.c
117 @@ -275,10 +275,6 @@ static struct scsi_host_template piix_sh
118 .slave_configure = ata_scsi_slave_config,
119 .slave_destroy = ata_scsi_slave_destroy,
120 .bios_param = ata_std_bios_param,
121 -#ifdef CONFIG_PM
122 - .resume = ata_scsi_device_resume,
123 - .suspend = ata_scsi_device_suspend,
124 -#endif
125 };
126
127 static const struct ata_port_operations piix_pata_ops = {
128 Index: linux-2.6.21-gentoo-r1/drivers/ata/libata-core.c
129 ===================================================================
130 --- linux-2.6.21-gentoo-r1.orig/drivers/ata/libata-core.c
131 +++ linux-2.6.21-gentoo-r1/drivers/ata/libata-core.c
132 @@ -2563,7 +2563,7 @@ int ata_set_mode(struct ata_port *ap, st
133 dev = &ap->device[i];
134
135 /* don't update suspended devices' xfer mode */
136 - if (!ata_dev_ready(dev))
137 + if (!ata_dev_enabled(dev))
138 continue;
139
140 rc = ata_dev_set_mode(dev);
141 @@ -5460,37 +5460,11 @@ static int ata_host_request_pm(struct at
142 */
143 int ata_host_suspend(struct ata_host *host, pm_message_t mesg)
144 {
145 - int i, j, rc;
146 + int rc;
147
148 rc = ata_host_request_pm(host, mesg, 0, ATA_EHI_QUIET, 1);
149 - if (rc)
150 - goto fail;
151 -
152 - /* EH is quiescent now. Fail if we have any ready device.
153 - * This happens if hotplug occurs between completion of device
154 - * suspension and here.
155 - */
156 - for (i = 0; i < host->n_ports; i++) {
157 - struct ata_port *ap = host->ports[i];
158 -
159 - for (j = 0; j < ATA_MAX_DEVICES; j++) {
160 - struct ata_device *dev = &ap->device[j];
161 -
162 - if (ata_dev_ready(dev)) {
163 - ata_port_printk(ap, KERN_WARNING,
164 - "suspend failed, device %d "
165 - "still active\n", dev->devno);
166 - rc = -EBUSY;
167 - goto fail;
168 - }
169 - }
170 - }
171 -
172 - host->dev->power.power_state = mesg;
173 - return 0;
174 -
175 - fail:
176 - ata_host_resume(host);
177 + if (rc == 0)
178 + host->dev->power.power_state = mesg;
179 return rc;
180 }
181
182 @@ -6442,11 +6416,6 @@ EXPORT_SYMBOL_GPL(ata_pci_default_filter
183 EXPORT_SYMBOL_GPL(ata_pci_clear_simplex);
184 #endif /* CONFIG_PCI */
185
186 -#ifdef CONFIG_PM
187 -EXPORT_SYMBOL_GPL(ata_scsi_device_suspend);
188 -EXPORT_SYMBOL_GPL(ata_scsi_device_resume);
189 -#endif /* CONFIG_PM */
190 -
191 EXPORT_SYMBOL_GPL(ata_eng_timeout);
192 EXPORT_SYMBOL_GPL(ata_port_schedule_eh);
193 EXPORT_SYMBOL_GPL(ata_port_abort);
194 Index: linux-2.6.21-gentoo-r1/drivers/ata/libata-eh.c
195 ===================================================================
196 --- linux-2.6.21-gentoo-r1.orig/drivers/ata/libata-eh.c
197 +++ linux-2.6.21-gentoo-r1/drivers/ata/libata-eh.c
198 @@ -55,29 +55,12 @@ static void ata_eh_finish(struct ata_por
199 #ifdef CONFIG_PM
200 static void ata_eh_handle_port_suspend(struct ata_port *ap);
201 static void ata_eh_handle_port_resume(struct ata_port *ap);
202 -static int ata_eh_suspend(struct ata_port *ap,
203 - struct ata_device **r_failed_dev);
204 -static void ata_eh_prep_resume(struct ata_port *ap);
205 -static int ata_eh_resume(struct ata_port *ap, struct ata_device **r_failed_dev);
206 #else /* CONFIG_PM */
207 static void ata_eh_handle_port_suspend(struct ata_port *ap)
208 { }
209
210 static void ata_eh_handle_port_resume(struct ata_port *ap)
211 { }
212 -
213 -static int ata_eh_suspend(struct ata_port *ap, struct ata_device **r_failed_dev)
214 -{
215 - return 0;
216 -}
217 -
218 -static void ata_eh_prep_resume(struct ata_port *ap)
219 -{ }
220 -
221 -static int ata_eh_resume(struct ata_port *ap, struct ata_device **r_failed_dev)
222 -{
223 - return 0;
224 -}
225 #endif /* CONFIG_PM */
226
227 static void ata_ering_record(struct ata_ering *ering, int is_io,
228 @@ -1762,7 +1745,7 @@ static int ata_eh_revalidate_and_attach(
229 if (ehc->i.flags & ATA_EHI_DID_RESET)
230 readid_flags |= ATA_READID_POSTRESET;
231
232 - if (action & ATA_EH_REVALIDATE && ata_dev_ready(dev)) {
233 + if ((action & ATA_EH_REVALIDATE) && ata_dev_enabled(dev)) {
234 if (ata_port_offline(ap)) {
235 rc = -EIO;
236 goto err;
237 @@ -1839,166 +1822,6 @@ static int ata_eh_revalidate_and_attach(
238 return rc;
239 }
240
241 -#ifdef CONFIG_PM
242 -/**
243 - * ata_eh_suspend - handle suspend EH action
244 - * @ap: target host port
245 - * @r_failed_dev: result parameter to indicate failing device
246 - *
247 - * Handle suspend EH action. Disk devices are spinned down and
248 - * other types of devices are just marked suspended. Once
249 - * suspended, no EH action to the device is allowed until it is
250 - * resumed.
251 - *
252 - * LOCKING:
253 - * Kernel thread context (may sleep).
254 - *
255 - * RETURNS:
256 - * 0 on success, -errno otherwise
257 - */
258 -static int ata_eh_suspend(struct ata_port *ap, struct ata_device **r_failed_dev)
259 -{
260 - struct ata_device *dev;
261 - int i, rc = 0;
262 -
263 - DPRINTK("ENTER\n");
264 -
265 - for (i = 0; i < ATA_MAX_DEVICES; i++) {
266 - unsigned long flags;
267 - unsigned int action, err_mask;
268 -
269 - dev = &ap->device[i];
270 - action = ata_eh_dev_action(dev);
271 -
272 - if (!ata_dev_enabled(dev) || !(action & ATA_EH_SUSPEND))
273 - continue;
274 -
275 - WARN_ON(dev->flags & ATA_DFLAG_SUSPENDED);
276 -
277 - ata_eh_about_to_do(ap, dev, ATA_EH_SUSPEND);
278 -
279 - if (dev->class == ATA_DEV_ATA && !(action & ATA_EH_PM_FREEZE)) {
280 - /* flush cache */
281 - rc = ata_flush_cache(dev);
282 - if (rc)
283 - break;
284 -
285 - /* spin down */
286 - err_mask = ata_do_simple_cmd(dev, ATA_CMD_STANDBYNOW1);
287 - if (err_mask) {
288 - ata_dev_printk(dev, KERN_ERR, "failed to "
289 - "spin down (err_mask=0x%x)\n",
290 - err_mask);
291 - rc = -EIO;
292 - break;
293 - }
294 - }
295 -
296 - spin_lock_irqsave(ap->lock, flags);
297 - dev->flags |= ATA_DFLAG_SUSPENDED;
298 - spin_unlock_irqrestore(ap->lock, flags);
299 -
300 - ata_eh_done(ap, dev, ATA_EH_SUSPEND);
301 - }
302 -
303 - if (rc)
304 - *r_failed_dev = dev;
305 -
306 - DPRINTK("EXIT\n");
307 - return rc;
308 -}
309 -
310 -/**
311 - * ata_eh_prep_resume - prep for resume EH action
312 - * @ap: target host port
313 - *
314 - * Clear SUSPENDED in preparation for scheduled resume actions.
315 - * This allows other parts of EH to access the devices being
316 - * resumed.
317 - *
318 - * LOCKING:
319 - * Kernel thread context (may sleep).
320 - */
321 -static void ata_eh_prep_resume(struct ata_port *ap)
322 -{
323 - struct ata_device *dev;
324 - unsigned long flags;
325 - int i;
326 -
327 - DPRINTK("ENTER\n");
328 -
329 - for (i = 0; i < ATA_MAX_DEVICES; i++) {
330 - unsigned int action;
331 -
332 - dev = &ap->device[i];
333 - action = ata_eh_dev_action(dev);
334 -
335 - if (!ata_dev_enabled(dev) || !(action & ATA_EH_RESUME))
336 - continue;
337 -
338 - spin_lock_irqsave(ap->lock, flags);
339 - dev->flags &= ~ATA_DFLAG_SUSPENDED;
340 - spin_unlock_irqrestore(ap->lock, flags);
341 - }
342 -
343 - DPRINTK("EXIT\n");
344 -}
345 -
346 -/**
347 - * ata_eh_resume - handle resume EH action
348 - * @ap: target host port
349 - * @r_failed_dev: result parameter to indicate failing device
350 - *
351 - * Handle resume EH action. Target devices are already reset and
352 - * revalidated. Spinning up is the only operation left.
353 - *
354 - * LOCKING:
355 - * Kernel thread context (may sleep).
356 - *
357 - * RETURNS:
358 - * 0 on success, -errno otherwise
359 - */
360 -static int ata_eh_resume(struct ata_port *ap, struct ata_device **r_failed_dev)
361 -{
362 - struct ata_device *dev;
363 - int i, rc = 0;
364 -
365 - DPRINTK("ENTER\n");
366 -
367 - for (i = 0; i < ATA_MAX_DEVICES; i++) {
368 - unsigned int action, err_mask;
369 -
370 - dev = &ap->device[i];
371 - action = ata_eh_dev_action(dev);
372 -
373 - if (!ata_dev_enabled(dev) || !(action & ATA_EH_RESUME))
374 - continue;
375 -
376 - ata_eh_about_to_do(ap, dev, ATA_EH_RESUME);
377 -
378 - if (dev->class == ATA_DEV_ATA && !(action & ATA_EH_PM_FREEZE)) {
379 - err_mask = ata_do_simple_cmd(dev,
380 - ATA_CMD_IDLEIMMEDIATE);
381 - if (err_mask) {
382 - ata_dev_printk(dev, KERN_ERR, "failed to "
383 - "spin up (err_mask=0x%x)\n",
384 - err_mask);
385 - rc = -EIO;
386 - break;
387 - }
388 - }
389 -
390 - ata_eh_done(ap, dev, ATA_EH_RESUME);
391 - }
392 -
393 - if (rc)
394 - *r_failed_dev = dev;
395 -
396 - DPRINTK("EXIT\n");
397 - return 0;
398 -}
399 -#endif /* CONFIG_PM */
400 -
401 static int ata_port_nr_enabled(struct ata_port *ap)
402 {
403 int i, cnt = 0;
404 @@ -2024,17 +1847,6 @@ static int ata_eh_skip_recovery(struct a
405 struct ata_eh_context *ehc = &ap->eh_context;
406 int i;
407
408 - /* skip if all possible devices are suspended */
409 - for (i = 0; i < ata_port_max_devices(ap); i++) {
410 - struct ata_device *dev = &ap->device[i];
411 -
412 - if (!(dev->flags & ATA_DFLAG_SUSPENDED))
413 - break;
414 - }
415 -
416 - if (i == ata_port_max_devices(ap))
417 - return 1;
418 -
419 /* thaw frozen port, resume link and recover failed devices */
420 if ((ap->pflags & ATA_PFLAG_FROZEN) ||
421 (ehc->i.flags & ATA_EHI_RESUME_LINK) || ata_port_nr_enabled(ap))
422 @@ -2114,9 +1926,6 @@ static int ata_eh_recover(struct ata_por
423 if (ap->pflags & ATA_PFLAG_UNLOADING)
424 goto out;
425
426 - /* prep for resume */
427 - ata_eh_prep_resume(ap);
428 -
429 /* skip EH if possible. */
430 if (ata_eh_skip_recovery(ap))
431 ehc->i.action = 0;
432 @@ -2144,11 +1953,6 @@ static int ata_eh_recover(struct ata_por
433 if (rc)
434 goto dev_fail;
435
436 - /* resume devices */
437 - rc = ata_eh_resume(ap, &dev);
438 - if (rc)
439 - goto dev_fail;
440 -
441 /* configure transfer mode if necessary */
442 if (ehc->i.flags & ATA_EHI_SETMODE) {
443 rc = ata_set_mode(ap, &dev);
444 @@ -2157,11 +1961,6 @@ static int ata_eh_recover(struct ata_por
445 ehc->i.flags &= ~ATA_EHI_SETMODE;
446 }
447
448 - /* suspend devices */
449 - rc = ata_eh_suspend(ap, &dev);
450 - if (rc)
451 - goto dev_fail;
452 -
453 goto out;
454
455 dev_fail:
456 @@ -2357,22 +2156,13 @@ static void ata_eh_handle_port_suspend(s
457 *
458 * Resume @ap.
459 *
460 - * This function also waits upto one second until all devices
461 - * hanging off this port requests resume EH action. This is to
462 - * prevent invoking EH and thus reset multiple times on resume.
463 - *
464 - * On DPM resume, where some of devices might not be resumed
465 - * together, this may delay port resume upto one second, but such
466 - * DPM resumes are rare and 1 sec delay isn't too bad.
467 - *
468 * LOCKING:
469 * Kernel thread context (may sleep).
470 */
471 static void ata_eh_handle_port_resume(struct ata_port *ap)
472 {
473 - unsigned long timeout;
474 unsigned long flags;
475 - int i, rc = 0;
476 + int rc = 0;
477
478 /* are we resuming? */
479 spin_lock_irqsave(ap->lock, flags);
480 @@ -2383,31 +2173,12 @@ static void ata_eh_handle_port_resume(st
481 }
482 spin_unlock_irqrestore(ap->lock, flags);
483
484 - /* spurious? */
485 - if (!(ap->pflags & ATA_PFLAG_SUSPENDED))
486 - goto done;
487 + WARN_ON(!(ap->pflags & ATA_PFLAG_SUSPENDED));
488
489 if (ap->ops->port_resume)
490 rc = ap->ops->port_resume(ap);
491
492 - /* give devices time to request EH */
493 - timeout = jiffies + HZ; /* 1s max */
494 - while (1) {
495 - for (i = 0; i < ATA_MAX_DEVICES; i++) {
496 - struct ata_device *dev = &ap->device[i];
497 - unsigned int action = ata_eh_dev_action(dev);
498 -
499 - if ((dev->flags & ATA_DFLAG_SUSPENDED) &&
500 - !(action & ATA_EH_RESUME))
501 - break;
502 - }
503 -
504 - if (i == ATA_MAX_DEVICES || time_after(jiffies, timeout))
505 - break;
506 - msleep(10);
507 - }
508 -
509 - done:
510 + /* report result */
511 spin_lock_irqsave(ap->lock, flags);
512 ap->pflags &= ~(ATA_PFLAG_PM_PENDING | ATA_PFLAG_SUSPENDED);
513 if (ap->pm_result) {
514 Index: linux-2.6.21-gentoo-r1/drivers/ata/libata-scsi.c
515 ===================================================================
516 --- linux-2.6.21-gentoo-r1.orig/drivers/ata/libata-scsi.c
517 +++ linux-2.6.21-gentoo-r1/drivers/ata/libata-scsi.c
518 @@ -510,133 +510,6 @@ static void ata_dump_status(unsigned id,
519 }
520 }
521
522 -#ifdef CONFIG_PM
523 -/**
524 - * ata_scsi_device_suspend - suspend ATA device associated with sdev
525 - * @sdev: the SCSI device to suspend
526 - * @mesg: target power management message
527 - *
528 - * Request suspend EH action on the ATA device associated with
529 - * @sdev and wait for the operation to complete.
530 - *
531 - * LOCKING:
532 - * Kernel thread context (may sleep).
533 - *
534 - * RETURNS:
535 - * 0 on success, -errno otherwise.
536 - */
537 -int ata_scsi_device_suspend(struct scsi_device *sdev, pm_message_t mesg)
538 -{
539 - struct ata_port *ap = ata_shost_to_port(sdev->host);
540 - struct ata_device *dev = ata_scsi_find_dev(ap, sdev);
541 - unsigned long flags;
542 - unsigned int action;
543 - int rc = 0;
544 -
545 - if (!dev)
546 - goto out;
547 -
548 - spin_lock_irqsave(ap->lock, flags);
549 -
550 - /* wait for the previous resume to complete */
551 - while (dev->flags & ATA_DFLAG_SUSPENDED) {
552 - spin_unlock_irqrestore(ap->lock, flags);
553 - ata_port_wait_eh(ap);
554 - spin_lock_irqsave(ap->lock, flags);
555 - }
556 -
557 - /* if @sdev is already detached, nothing to do */
558 - if (sdev->sdev_state == SDEV_OFFLINE ||
559 - sdev->sdev_state == SDEV_CANCEL || sdev->sdev_state == SDEV_DEL)
560 - goto out_unlock;
561 -
562 - /* request suspend */
563 - action = ATA_EH_SUSPEND;
564 - if (mesg.event != PM_EVENT_SUSPEND)
565 - action |= ATA_EH_PM_FREEZE;
566 - ap->eh_info.dev_action[dev->devno] |= action;
567 - ap->eh_info.flags |= ATA_EHI_QUIET;
568 - ata_port_schedule_eh(ap);
569 -
570 - spin_unlock_irqrestore(ap->lock, flags);
571 -
572 - /* wait for EH to do the job */
573 - ata_port_wait_eh(ap);
574 -
575 - spin_lock_irqsave(ap->lock, flags);
576 -
577 - /* If @sdev is still attached but the associated ATA device
578 - * isn't suspended, the operation failed.
579 - */
580 - if (sdev->sdev_state != SDEV_OFFLINE &&
581 - sdev->sdev_state != SDEV_CANCEL && sdev->sdev_state != SDEV_DEL &&
582 - !(dev->flags & ATA_DFLAG_SUSPENDED))
583 - rc = -EIO;
584 -
585 - out_unlock:
586 - spin_unlock_irqrestore(ap->lock, flags);
587 - out:
588 - if (rc == 0)
589 - sdev->sdev_gendev.power.power_state = mesg;
590 - return rc;
591 -}
592 -
593 -/**
594 - * ata_scsi_device_resume - resume ATA device associated with sdev
595 - * @sdev: the SCSI device to resume
596 - *
597 - * Request resume EH action on the ATA device associated with
598 - * @sdev and return immediately. This enables parallel
599 - * wakeup/spinup of devices.
600 - *
601 - * LOCKING:
602 - * Kernel thread context (may sleep).
603 - *
604 - * RETURNS:
605 - * 0.
606 - */
607 -int ata_scsi_device_resume(struct scsi_device *sdev)
608 -{
609 - struct ata_port *ap = ata_shost_to_port(sdev->host);
610 - struct ata_device *dev = ata_scsi_find_dev(ap, sdev);
611 - struct ata_eh_info *ehi = &ap->eh_info;
612 - unsigned long flags;
613 - unsigned int action;
614 -
615 - if (!dev)
616 - goto out;
617 -
618 - spin_lock_irqsave(ap->lock, flags);
619 -
620 - /* if @sdev is already detached, nothing to do */
621 - if (sdev->sdev_state == SDEV_OFFLINE ||
622 - sdev->sdev_state == SDEV_CANCEL || sdev->sdev_state == SDEV_DEL)
623 - goto out_unlock;
624 -
625 - /* request resume */
626 - action = ATA_EH_RESUME;
627 - if (sdev->sdev_gendev.power.power_state.event == PM_EVENT_SUSPEND)
628 - __ata_ehi_hotplugged(ehi);
629 - else
630 - action |= ATA_EH_PM_FREEZE | ATA_EH_SOFTRESET;
631 - ehi->dev_action[dev->devno] |= action;
632 -
633 - /* We don't want autopsy and verbose EH messages. Disable
634 - * those if we're the only device on this link.
635 - */
636 - if (ata_port_max_devices(ap) == 1)
637 - ehi->flags |= ATA_EHI_NO_AUTOPSY | ATA_EHI_QUIET;
638 -
639 - ata_port_schedule_eh(ap);
640 -
641 - out_unlock:
642 - spin_unlock_irqrestore(ap->lock, flags);
643 - out:
644 - sdev->sdev_gendev.power.power_state = PMSG_ON;
645 - return 0;
646 -}
647 -#endif /* CONFIG_PM */
648 -
649 /**
650 * ata_to_sense_error - convert ATA error to SCSI error
651 * @id: ATA device number
652 @@ -929,6 +802,8 @@ int ata_scsi_slave_config(struct scsi_de
653
654 blk_queue_max_phys_segments(sdev->request_queue, LIBATA_MAX_PRD);
655
656 + sdev->manage_start_stop = 1;
657 +
658 if (dev)
659 ata_scsi_dev_config(sdev, dev);
660
661 Index: linux-2.6.21-gentoo-r1/drivers/ata/pata_ali.c
662 ===================================================================
663 --- linux-2.6.21-gentoo-r1.orig/drivers/ata/pata_ali.c
664 +++ linux-2.6.21-gentoo-r1/drivers/ata/pata_ali.c
665 @@ -345,10 +345,6 @@ static struct scsi_host_template ali_sht
666 .slave_configure = ata_scsi_slave_config,
667 .slave_destroy = ata_scsi_slave_destroy,
668 .bios_param = ata_std_bios_param,
669 -#ifdef CONFIG_PM
670 - .resume = ata_scsi_device_resume,
671 - .suspend = ata_scsi_device_suspend,
672 -#endif
673 };
674
675 /*
676 Index: linux-2.6.21-gentoo-r1/drivers/ata/pata_amd.c
677 ===================================================================
678 --- linux-2.6.21-gentoo-r1.orig/drivers/ata/pata_amd.c
679 +++ linux-2.6.21-gentoo-r1/drivers/ata/pata_amd.c
680 @@ -334,10 +334,6 @@ static struct scsi_host_template amd_sht
681 .slave_configure = ata_scsi_slave_config,
682 .slave_destroy = ata_scsi_slave_destroy,
683 .bios_param = ata_std_bios_param,
684 -#ifdef CONFIG_PM
685 - .resume = ata_scsi_device_resume,
686 - .suspend = ata_scsi_device_suspend,
687 -#endif
688 };
689
690 static struct ata_port_operations amd33_port_ops = {
691 Index: linux-2.6.21-gentoo-r1/drivers/ata/pata_atiixp.c
692 ===================================================================
693 --- linux-2.6.21-gentoo-r1.orig/drivers/ata/pata_atiixp.c
694 +++ linux-2.6.21-gentoo-r1/drivers/ata/pata_atiixp.c
695 @@ -224,10 +224,6 @@ static struct scsi_host_template atiixp_
696 .slave_configure = ata_scsi_slave_config,
697 .slave_destroy = ata_scsi_slave_destroy,
698 .bios_param = ata_std_bios_param,
699 -#ifdef CONFIG_PM
700 - .resume = ata_scsi_device_resume,
701 - .suspend = ata_scsi_device_suspend,
702 -#endif
703 };
704
705 static struct ata_port_operations atiixp_port_ops = {
706 Index: linux-2.6.21-gentoo-r1/drivers/ata/pata_cmd64x.c
707 ===================================================================
708 --- linux-2.6.21-gentoo-r1.orig/drivers/ata/pata_cmd64x.c
709 +++ linux-2.6.21-gentoo-r1/drivers/ata/pata_cmd64x.c
710 @@ -285,10 +285,6 @@ static struct scsi_host_template cmd64x_
711 .slave_configure = ata_scsi_slave_config,
712 .slave_destroy = ata_scsi_slave_destroy,
713 .bios_param = ata_std_bios_param,
714 -#ifdef CONFIG_PM
715 - .resume = ata_scsi_device_resume,
716 - .suspend = ata_scsi_device_suspend,
717 -#endif
718 };
719
720 static struct ata_port_operations cmd64x_port_ops = {
721 Index: linux-2.6.21-gentoo-r1/drivers/ata/pata_cs5520.c
722 ===================================================================
723 --- linux-2.6.21-gentoo-r1.orig/drivers/ata/pata_cs5520.c
724 +++ linux-2.6.21-gentoo-r1/drivers/ata/pata_cs5520.c
725 @@ -167,10 +167,6 @@ static struct scsi_host_template cs5520_
726 .slave_configure = ata_scsi_slave_config,
727 .slave_destroy = ata_scsi_slave_destroy,
728 .bios_param = ata_std_bios_param,
729 -#ifdef CONFIG_PM
730 - .resume = ata_scsi_device_resume,
731 - .suspend = ata_scsi_device_suspend,
732 -#endif
733 };
734
735 static struct ata_port_operations cs5520_port_ops = {
736 Index: linux-2.6.21-gentoo-r1/drivers/ata/pata_cs5530.c
737 ===================================================================
738 --- linux-2.6.21-gentoo-r1.orig/drivers/ata/pata_cs5530.c
739 +++ linux-2.6.21-gentoo-r1/drivers/ata/pata_cs5530.c
740 @@ -188,10 +188,6 @@ static struct scsi_host_template cs5530_
741 .slave_configure = ata_scsi_slave_config,
742 .slave_destroy = ata_scsi_slave_destroy,
743 .bios_param = ata_std_bios_param,
744 -#ifdef CONFIG_PM
745 - .resume = ata_scsi_device_resume,
746 - .suspend = ata_scsi_device_suspend,
747 -#endif
748 };
749
750 static struct ata_port_operations cs5530_port_ops = {
751 Index: linux-2.6.21-gentoo-r1/drivers/ata/pata_cs5535.c
752 ===================================================================
753 --- linux-2.6.21-gentoo-r1.orig/drivers/ata/pata_cs5535.c
754 +++ linux-2.6.21-gentoo-r1/drivers/ata/pata_cs5535.c
755 @@ -185,10 +185,6 @@ static struct scsi_host_template cs5535_
756 .slave_configure = ata_scsi_slave_config,
757 .slave_destroy = ata_scsi_slave_destroy,
758 .bios_param = ata_std_bios_param,
759 -#ifdef CONFIG_PM
760 - .resume = ata_scsi_device_resume,
761 - .suspend = ata_scsi_device_suspend,
762 -#endif
763 };
764
765 static struct ata_port_operations cs5535_port_ops = {
766 Index: linux-2.6.21-gentoo-r1/drivers/ata/pata_cypress.c
767 ===================================================================
768 --- linux-2.6.21-gentoo-r1.orig/drivers/ata/pata_cypress.c
769 +++ linux-2.6.21-gentoo-r1/drivers/ata/pata_cypress.c
770 @@ -136,10 +136,6 @@ static struct scsi_host_template cy82c69
771 .slave_configure = ata_scsi_slave_config,
772 .slave_destroy = ata_scsi_slave_destroy,
773 .bios_param = ata_std_bios_param,
774 -#ifdef CONFIG_PM
775 - .resume = ata_scsi_device_resume,
776 - .suspend = ata_scsi_device_suspend,
777 -#endif
778 };
779
780 static struct ata_port_operations cy82c693_port_ops = {
781 Index: linux-2.6.21-gentoo-r1/drivers/ata/pata_efar.c
782 ===================================================================
783 --- linux-2.6.21-gentoo-r1.orig/drivers/ata/pata_efar.c
784 +++ linux-2.6.21-gentoo-r1/drivers/ata/pata_efar.c
785 @@ -234,10 +234,6 @@ static struct scsi_host_template efar_sh
786 .slave_configure = ata_scsi_slave_config,
787 .slave_destroy = ata_scsi_slave_destroy,
788 .bios_param = ata_std_bios_param,
789 -#ifdef CONFIG_PM
790 - .resume = ata_scsi_device_resume,
791 - .suspend = ata_scsi_device_suspend,
792 -#endif
793 };
794
795 static const struct ata_port_operations efar_ops = {
796 Index: linux-2.6.21-gentoo-r1/drivers/ata/pata_hpt366.c
797 ===================================================================
798 --- linux-2.6.21-gentoo-r1.orig/drivers/ata/pata_hpt366.c
799 +++ linux-2.6.21-gentoo-r1/drivers/ata/pata_hpt366.c
800 @@ -328,10 +328,6 @@ static struct scsi_host_template hpt36x_
801 .slave_configure = ata_scsi_slave_config,
802 .slave_destroy = ata_scsi_slave_destroy,
803 .bios_param = ata_std_bios_param,
804 -#ifdef CONFIG_PM
805 - .resume = ata_scsi_device_resume,
806 - .suspend = ata_scsi_device_suspend,
807 -#endif
808 };
809
810 /*
811 Index: linux-2.6.21-gentoo-r1/drivers/ata/pata_hpt3x3.c
812 ===================================================================
813 --- linux-2.6.21-gentoo-r1.orig/drivers/ata/pata_hpt3x3.c
814 +++ linux-2.6.21-gentoo-r1/drivers/ata/pata_hpt3x3.c
815 @@ -119,10 +119,6 @@ static struct scsi_host_template hpt3x3_
816 .slave_configure = ata_scsi_slave_config,
817 .slave_destroy = ata_scsi_slave_destroy,
818 .bios_param = ata_std_bios_param,
819 -#ifdef CONFIG_PM
820 - .resume = ata_scsi_device_resume,
821 - .suspend = ata_scsi_device_suspend,
822 -#endif
823 };
824
825 static struct ata_port_operations hpt3x3_port_ops = {
826 Index: linux-2.6.21-gentoo-r1/drivers/ata/pata_it8213.c
827 ===================================================================
828 --- linux-2.6.21-gentoo-r1.orig/drivers/ata/pata_it8213.c
829 +++ linux-2.6.21-gentoo-r1/drivers/ata/pata_it8213.c
830 @@ -246,10 +246,6 @@ static struct scsi_host_template it8213_
831 .dma_boundary = ATA_DMA_BOUNDARY,
832 .slave_configure = ata_scsi_slave_config,
833 .bios_param = ata_std_bios_param,
834 -#ifdef CONFIG_PM
835 - .resume = ata_scsi_device_resume,
836 - .suspend = ata_scsi_device_suspend,
837 -#endif
838 };
839
840 static const struct ata_port_operations it8213_ops = {
841 Index: linux-2.6.21-gentoo-r1/drivers/ata/pata_it821x.c
842 ===================================================================
843 --- linux-2.6.21-gentoo-r1.orig/drivers/ata/pata_it821x.c
844 +++ linux-2.6.21-gentoo-r1/drivers/ata/pata_it821x.c
845 @@ -646,10 +646,6 @@ static struct scsi_host_template it821x_
846 .slave_configure = ata_scsi_slave_config,
847 .slave_destroy = ata_scsi_slave_destroy,
848 .bios_param = ata_std_bios_param,
849 -#ifdef CONFIG_PM
850 - .resume = ata_scsi_device_resume,
851 - .suspend = ata_scsi_device_suspend,
852 -#endif
853 };
854
855 static struct ata_port_operations it821x_smart_port_ops = {
856 Index: linux-2.6.21-gentoo-r1/drivers/ata/pata_ixp4xx_cf.c
857 ===================================================================
858 --- linux-2.6.21-gentoo-r1.orig/drivers/ata/pata_ixp4xx_cf.c
859 +++ linux-2.6.21-gentoo-r1/drivers/ata/pata_ixp4xx_cf.c
860 @@ -31,7 +31,7 @@ static int ixp4xx_set_mode(struct ata_po
861
862 for (i = 0; i < ATA_MAX_DEVICES; i++) {
863 struct ata_device *dev = &ap->device[i];
864 - if (ata_dev_ready(dev)) {
865 + if (ata_dev_enabled(dev)) {
866 ata_dev_printk(dev, KERN_INFO, "configured for PIO0\n");
867 dev->pio_mode = XFER_PIO_0;
868 dev->xfer_mode = XFER_PIO_0;
869 Index: linux-2.6.21-gentoo-r1/drivers/ata/pata_jmicron.c
870 ===================================================================
871 --- linux-2.6.21-gentoo-r1.orig/drivers/ata/pata_jmicron.c
872 +++ linux-2.6.21-gentoo-r1/drivers/ata/pata_jmicron.c
873 @@ -137,10 +137,6 @@ static struct scsi_host_template jmicron
874 .slave_destroy = ata_scsi_slave_destroy,
875 /* Use standard CHS mapping rules */
876 .bios_param = ata_std_bios_param,
877 -#ifdef CONFIG_PM
878 - .suspend = ata_scsi_device_suspend,
879 - .resume = ata_scsi_device_resume,
880 -#endif
881 };
882
883 static const struct ata_port_operations jmicron_ops = {
884 Index: linux-2.6.21-gentoo-r1/drivers/ata/pata_marvell.c
885 ===================================================================
886 --- linux-2.6.21-gentoo-r1.orig/drivers/ata/pata_marvell.c
887 +++ linux-2.6.21-gentoo-r1/drivers/ata/pata_marvell.c
888 @@ -103,10 +103,6 @@ static struct scsi_host_template marvell
889 .slave_destroy = ata_scsi_slave_destroy,
890 /* Use standard CHS mapping rules */
891 .bios_param = ata_std_bios_param,
892 -#ifdef CONFIG_PM
893 - .resume = ata_scsi_device_resume,
894 - .suspend = ata_scsi_device_suspend,
895 -#endif
896 };
897
898 static const struct ata_port_operations marvell_ops = {
899 Index: linux-2.6.21-gentoo-r1/drivers/ata/pata_mpc52xx.c
900 ===================================================================
901 --- linux-2.6.21-gentoo-r1.orig/drivers/ata/pata_mpc52xx.c
902 +++ linux-2.6.21-gentoo-r1/drivers/ata/pata_mpc52xx.c
903 @@ -280,10 +280,6 @@ static struct scsi_host_template mpc52xx
904 .dma_boundary = ATA_DMA_BOUNDARY,
905 .slave_configure = ata_scsi_slave_config,
906 .bios_param = ata_std_bios_param,
907 -#ifdef CONFIG_PM
908 - .suspend = ata_scsi_device_suspend,
909 - .resume = ata_scsi_device_resume,
910 -#endif
911 };
912
913 static struct ata_port_operations mpc52xx_ata_port_ops = {
914 Index: linux-2.6.21-gentoo-r1/drivers/ata/pata_mpiix.c
915 ===================================================================
916 --- linux-2.6.21-gentoo-r1.orig/drivers/ata/pata_mpiix.c
917 +++ linux-2.6.21-gentoo-r1/drivers/ata/pata_mpiix.c
918 @@ -165,10 +165,6 @@ static struct scsi_host_template mpiix_s
919 .slave_configure = ata_scsi_slave_config,
920 .slave_destroy = ata_scsi_slave_destroy,
921 .bios_param = ata_std_bios_param,
922 -#ifdef CONFIG_PM
923 - .resume = ata_scsi_device_resume,
924 - .suspend = ata_scsi_device_suspend,
925 -#endif
926 };
927
928 static struct ata_port_operations mpiix_port_ops = {
929 Index: linux-2.6.21-gentoo-r1/drivers/ata/pata_netcell.c
930 ===================================================================
931 --- linux-2.6.21-gentoo-r1.orig/drivers/ata/pata_netcell.c
932 +++ linux-2.6.21-gentoo-r1/drivers/ata/pata_netcell.c
933 @@ -63,10 +63,6 @@ static struct scsi_host_template netcell
934 .slave_destroy = ata_scsi_slave_destroy,
935 /* Use standard CHS mapping rules */
936 .bios_param = ata_std_bios_param,
937 -#ifdef CONFIG_PM
938 - .resume = ata_scsi_device_resume,
939 - .suspend = ata_scsi_device_suspend,
940 -#endif
941 };
942
943 static const struct ata_port_operations netcell_ops = {
944 Index: linux-2.6.21-gentoo-r1/drivers/ata/pata_ns87410.c
945 ===================================================================
946 --- linux-2.6.21-gentoo-r1.orig/drivers/ata/pata_ns87410.c
947 +++ linux-2.6.21-gentoo-r1/drivers/ata/pata_ns87410.c
948 @@ -157,10 +157,6 @@ static struct scsi_host_template ns87410
949 .slave_configure = ata_scsi_slave_config,
950 .slave_destroy = ata_scsi_slave_destroy,
951 .bios_param = ata_std_bios_param,
952 -#ifdef CONFIG_PM
953 - .resume = ata_scsi_device_resume,
954 - .suspend = ata_scsi_device_suspend,
955 -#endif
956 };
957
958 static struct ata_port_operations ns87410_port_ops = {
959 Index: linux-2.6.21-gentoo-r1/drivers/ata/pata_oldpiix.c
960 ===================================================================
961 --- linux-2.6.21-gentoo-r1.orig/drivers/ata/pata_oldpiix.c
962 +++ linux-2.6.21-gentoo-r1/drivers/ata/pata_oldpiix.c
963 @@ -233,10 +233,6 @@ static struct scsi_host_template oldpiix
964 .slave_configure = ata_scsi_slave_config,
965 .slave_destroy = ata_scsi_slave_destroy,
966 .bios_param = ata_std_bios_param,
967 -#ifdef CONFIG_PM
968 - .resume = ata_scsi_device_resume,
969 - .suspend = ata_scsi_device_suspend,
970 -#endif
971 };
972
973 static const struct ata_port_operations oldpiix_pata_ops = {
974 Index: linux-2.6.21-gentoo-r1/drivers/ata/pata_opti.c
975 ===================================================================
976 --- linux-2.6.21-gentoo-r1.orig/drivers/ata/pata_opti.c
977 +++ linux-2.6.21-gentoo-r1/drivers/ata/pata_opti.c
978 @@ -179,10 +179,6 @@ static struct scsi_host_template opti_sh
979 .slave_configure = ata_scsi_slave_config,
980 .slave_destroy = ata_scsi_slave_destroy,
981 .bios_param = ata_std_bios_param,
982 -#ifdef CONFIG_PM
983 - .resume = ata_scsi_device_resume,
984 - .suspend = ata_scsi_device_suspend,
985 -#endif
986 };
987
988 static struct ata_port_operations opti_port_ops = {
989 Index: linux-2.6.21-gentoo-r1/drivers/ata/pata_optidma.c
990 ===================================================================
991 --- linux-2.6.21-gentoo-r1.orig/drivers/ata/pata_optidma.c
992 +++ linux-2.6.21-gentoo-r1/drivers/ata/pata_optidma.c
993 @@ -360,10 +360,6 @@ static struct scsi_host_template optidma
994 .slave_configure = ata_scsi_slave_config,
995 .slave_destroy = ata_scsi_slave_destroy,
996 .bios_param = ata_std_bios_param,
997 -#ifdef CONFIG_PM
998 - .resume = ata_scsi_device_resume,
999 - .suspend = ata_scsi_device_suspend,
1000 -#endif
1001 };
1002
1003 static struct ata_port_operations optidma_port_ops = {
1004 Index: linux-2.6.21-gentoo-r1/drivers/ata/pata_pdc202xx_old.c
1005 ===================================================================
1006 --- linux-2.6.21-gentoo-r1.orig/drivers/ata/pata_pdc202xx_old.c
1007 +++ linux-2.6.21-gentoo-r1/drivers/ata/pata_pdc202xx_old.c
1008 @@ -273,10 +273,6 @@ static struct scsi_host_template pdc202x
1009 .slave_configure = ata_scsi_slave_config,
1010 .slave_destroy = ata_scsi_slave_destroy,
1011 .bios_param = ata_std_bios_param,
1012 -#ifdef CONFIG_PM
1013 - .resume = ata_scsi_device_resume,
1014 - .suspend = ata_scsi_device_suspend,
1015 -#endif
1016 };
1017
1018 static struct ata_port_operations pdc2024x_port_ops = {
1019 Index: linux-2.6.21-gentoo-r1/drivers/ata/pata_radisys.c
1020 ===================================================================
1021 --- linux-2.6.21-gentoo-r1.orig/drivers/ata/pata_radisys.c
1022 +++ linux-2.6.21-gentoo-r1/drivers/ata/pata_radisys.c
1023 @@ -228,10 +228,6 @@ static struct scsi_host_template radisys
1024 .slave_configure = ata_scsi_slave_config,
1025 .slave_destroy = ata_scsi_slave_destroy,
1026 .bios_param = ata_std_bios_param,
1027 -#ifdef CONFIG_PM
1028 - .resume = ata_scsi_device_resume,
1029 - .suspend = ata_scsi_device_suspend,
1030 -#endif
1031 };
1032
1033 static const struct ata_port_operations radisys_pata_ops = {
1034 Index: linux-2.6.21-gentoo-r1/drivers/ata/pata_rz1000.c
1035 ===================================================================
1036 --- linux-2.6.21-gentoo-r1.orig/drivers/ata/pata_rz1000.c
1037 +++ linux-2.6.21-gentoo-r1/drivers/ata/pata_rz1000.c
1038 @@ -65,7 +65,7 @@ static int rz1000_set_mode(struct ata_po
1039
1040 for (i = 0; i < ATA_MAX_DEVICES; i++) {
1041 struct ata_device *dev = &ap->device[i];
1042 - if (ata_dev_ready(dev)) {
1043 + if (ata_dev_enabled(dev)) {
1044 /* We don't really care */
1045 dev->pio_mode = XFER_PIO_0;
1046 dev->xfer_mode = XFER_PIO_0;
1047 @@ -94,10 +94,6 @@ static struct scsi_host_template rz1000_
1048 .slave_configure = ata_scsi_slave_config,
1049 .slave_destroy = ata_scsi_slave_destroy,
1050 .bios_param = ata_std_bios_param,
1051 -#ifdef CONFIG_PM
1052 - .resume = ata_scsi_device_resume,
1053 - .suspend = ata_scsi_device_suspend,
1054 -#endif
1055 };
1056
1057 static struct ata_port_operations rz1000_port_ops = {
1058 Index: linux-2.6.21-gentoo-r1/drivers/ata/pata_sc1200.c
1059 ===================================================================
1060 --- linux-2.6.21-gentoo-r1.orig/drivers/ata/pata_sc1200.c
1061 +++ linux-2.6.21-gentoo-r1/drivers/ata/pata_sc1200.c
1062 @@ -194,10 +194,6 @@ static struct scsi_host_template sc1200_
1063 .slave_configure = ata_scsi_slave_config,
1064 .slave_destroy = ata_scsi_slave_destroy,
1065 .bios_param = ata_std_bios_param,
1066 -#ifdef CONFIG_PM
1067 - .resume = ata_scsi_device_resume,
1068 - .suspend = ata_scsi_device_suspend,
1069 -#endif
1070 };
1071
1072 static struct ata_port_operations sc1200_port_ops = {
1073 Index: linux-2.6.21-gentoo-r1/drivers/ata/pata_scc.c
1074 ===================================================================
1075 --- linux-2.6.21-gentoo-r1.orig/drivers/ata/pata_scc.c
1076 +++ linux-2.6.21-gentoo-r1/drivers/ata/pata_scc.c
1077 @@ -984,10 +984,6 @@ static struct scsi_host_template scc_sht
1078 .slave_configure = ata_scsi_slave_config,
1079 .slave_destroy = ata_scsi_slave_destroy,
1080 .bios_param = ata_std_bios_param,
1081 -#ifdef CONFIG_PM
1082 - .resume = ata_scsi_device_resume,
1083 - .suspend = ata_scsi_device_suspend,
1084 -#endif
1085 };
1086
1087 static const struct ata_port_operations scc_pata_ops = {
1088 Index: linux-2.6.21-gentoo-r1/drivers/ata/pata_serverworks.c
1089 ===================================================================
1090 --- linux-2.6.21-gentoo-r1.orig/drivers/ata/pata_serverworks.c
1091 +++ linux-2.6.21-gentoo-r1/drivers/ata/pata_serverworks.c
1092 @@ -319,10 +319,6 @@ static struct scsi_host_template serverw
1093 .slave_configure = ata_scsi_slave_config,
1094 .slave_destroy = ata_scsi_slave_destroy,
1095 .bios_param = ata_std_bios_param,
1096 -#ifdef CONFIG_PM
1097 - .resume = ata_scsi_device_resume,
1098 - .suspend = ata_scsi_device_suspend,
1099 -#endif
1100 };
1101
1102 static struct ata_port_operations serverworks_osb4_port_ops = {
1103 Index: linux-2.6.21-gentoo-r1/drivers/ata/pata_sil680.c
1104 ===================================================================
1105 --- linux-2.6.21-gentoo-r1.orig/drivers/ata/pata_sil680.c
1106 +++ linux-2.6.21-gentoo-r1/drivers/ata/pata_sil680.c
1107 @@ -236,10 +236,6 @@ static struct scsi_host_template sil680_
1108 .slave_configure = ata_scsi_slave_config,
1109 .slave_destroy = ata_scsi_slave_destroy,
1110 .bios_param = ata_std_bios_param,
1111 -#ifdef CONFIG_PM
1112 - .suspend = ata_scsi_device_suspend,
1113 - .resume = ata_scsi_device_resume,
1114 -#endif
1115 };
1116
1117 static struct ata_port_operations sil680_port_ops = {
1118 Index: linux-2.6.21-gentoo-r1/drivers/ata/pata_sis.c
1119 ===================================================================
1120 --- linux-2.6.21-gentoo-r1.orig/drivers/ata/pata_sis.c
1121 +++ linux-2.6.21-gentoo-r1/drivers/ata/pata_sis.c
1122 @@ -575,10 +575,6 @@ static struct scsi_host_template sis_sht
1123 .slave_configure = ata_scsi_slave_config,
1124 .slave_destroy = ata_scsi_slave_destroy,
1125 .bios_param = ata_std_bios_param,
1126 -#ifdef CONFIG_PM
1127 - .resume = ata_scsi_device_resume,
1128 - .suspend = ata_scsi_device_suspend,
1129 -#endif
1130 };
1131
1132 static const struct ata_port_operations sis_133_ops = {
1133 Index: linux-2.6.21-gentoo-r1/drivers/ata/pata_triflex.c
1134 ===================================================================
1135 --- linux-2.6.21-gentoo-r1.orig/drivers/ata/pata_triflex.c
1136 +++ linux-2.6.21-gentoo-r1/drivers/ata/pata_triflex.c
1137 @@ -193,10 +193,6 @@ static struct scsi_host_template triflex
1138 .slave_configure = ata_scsi_slave_config,
1139 .slave_destroy = ata_scsi_slave_destroy,
1140 .bios_param = ata_std_bios_param,
1141 -#ifdef CONFIG_PM
1142 - .resume = ata_scsi_device_resume,
1143 - .suspend = ata_scsi_device_suspend,
1144 -#endif
1145 };
1146
1147 static struct ata_port_operations triflex_port_ops = {
1148 Index: linux-2.6.21-gentoo-r1/drivers/ata/pata_via.c
1149 ===================================================================
1150 --- linux-2.6.21-gentoo-r1.orig/drivers/ata/pata_via.c
1151 +++ linux-2.6.21-gentoo-r1/drivers/ata/pata_via.c
1152 @@ -305,10 +305,6 @@ static struct scsi_host_template via_sht
1153 .slave_configure = ata_scsi_slave_config,
1154 .slave_destroy = ata_scsi_slave_destroy,
1155 .bios_param = ata_std_bios_param,
1156 -#ifdef CONFIG_PM
1157 - .resume = ata_scsi_device_resume,
1158 - .suspend = ata_scsi_device_suspend,
1159 -#endif
1160 };
1161
1162 static struct ata_port_operations via_port_ops = {
1163 Index: linux-2.6.21-gentoo-r1/drivers/ata/sata_inic162x.c
1164 ===================================================================
1165 --- linux-2.6.21-gentoo-r1.orig/drivers/ata/sata_inic162x.c
1166 +++ linux-2.6.21-gentoo-r1/drivers/ata/sata_inic162x.c
1167 @@ -135,10 +135,6 @@ static struct scsi_host_template inic_sh
1168 .slave_configure = inic_slave_config,
1169 .slave_destroy = ata_scsi_slave_destroy,
1170 .bios_param = ata_std_bios_param,
1171 -#ifdef CONFIG_PM
1172 - .suspend = ata_scsi_device_suspend,
1173 - .resume = ata_scsi_device_resume,
1174 -#endif
1175 };
1176
1177 static const int scr_map[] = {
1178 Index: linux-2.6.21-gentoo-r1/drivers/ata/sata_nv.c
1179 ===================================================================
1180 --- linux-2.6.21-gentoo-r1.orig/drivers/ata/sata_nv.c
1181 +++ linux-2.6.21-gentoo-r1/drivers/ata/sata_nv.c
1182 @@ -322,10 +322,6 @@ static struct scsi_host_template nv_sht
1183 .slave_configure = ata_scsi_slave_config,
1184 .slave_destroy = ata_scsi_slave_destroy,
1185 .bios_param = ata_std_bios_param,
1186 -#ifdef CONFIG_PM
1187 - .suspend = ata_scsi_device_suspend,
1188 - .resume = ata_scsi_device_resume,
1189 -#endif
1190 };
1191
1192 static struct scsi_host_template nv_adma_sht = {
1193 @@ -344,10 +340,6 @@ static struct scsi_host_template nv_adma
1194 .slave_configure = nv_adma_slave_config,
1195 .slave_destroy = ata_scsi_slave_destroy,
1196 .bios_param = ata_std_bios_param,
1197 -#ifdef CONFIG_PM
1198 - .suspend = ata_scsi_device_suspend,
1199 - .resume = ata_scsi_device_resume,
1200 -#endif
1201 };
1202
1203 static const struct ata_port_operations nv_generic_ops = {
1204 Index: linux-2.6.21-gentoo-r1/drivers/ata/sata_sil.c
1205 ===================================================================
1206 --- linux-2.6.21-gentoo-r1.orig/drivers/ata/sata_sil.c
1207 +++ linux-2.6.21-gentoo-r1/drivers/ata/sata_sil.c
1208 @@ -183,10 +183,6 @@ static struct scsi_host_template sil_sht
1209 .slave_configure = ata_scsi_slave_config,
1210 .slave_destroy = ata_scsi_slave_destroy,
1211 .bios_param = ata_std_bios_param,
1212 -#ifdef CONFIG_PM
1213 - .suspend = ata_scsi_device_suspend,
1214 - .resume = ata_scsi_device_resume,
1215 -#endif
1216 };
1217
1218 static const struct ata_port_operations sil_ops = {
1219 Index: linux-2.6.21-gentoo-r1/drivers/ata/sata_sil24.c
1220 ===================================================================
1221 --- linux-2.6.21-gentoo-r1.orig/drivers/ata/sata_sil24.c
1222 +++ linux-2.6.21-gentoo-r1/drivers/ata/sata_sil24.c
1223 @@ -381,10 +381,6 @@ static struct scsi_host_template sil24_s
1224 .slave_configure = ata_scsi_slave_config,
1225 .slave_destroy = ata_scsi_slave_destroy,
1226 .bios_param = ata_std_bios_param,
1227 -#ifdef CONFIG_PM
1228 - .suspend = ata_scsi_device_suspend,
1229 - .resume = ata_scsi_device_resume,
1230 -#endif
1231 };
1232
1233 static const struct ata_port_operations sil24_ops = {
1234 Index: linux-2.6.21-gentoo-r1/include/linux/libata.h
1235 ===================================================================
1236 --- linux-2.6.21-gentoo-r1.orig/include/linux/libata.h
1237 +++ linux-2.6.21-gentoo-r1/include/linux/libata.h
1238 @@ -140,7 +140,6 @@ enum {
1239
1240 ATA_DFLAG_PIO = (1 << 8), /* device limited to PIO mode */
1241 ATA_DFLAG_NCQ_OFF = (1 << 9), /* device limited to non-NCQ mode */
1242 - ATA_DFLAG_SUSPENDED = (1 << 10), /* device suspended */
1243 ATA_DFLAG_INIT_MASK = (1 << 16) - 1,
1244
1245 ATA_DFLAG_DETACH = (1 << 16),
1246 @@ -267,13 +266,9 @@ enum {
1247 ATA_EH_REVALIDATE = (1 << 0),
1248 ATA_EH_SOFTRESET = (1 << 1),
1249 ATA_EH_HARDRESET = (1 << 2),
1250 - ATA_EH_SUSPEND = (1 << 3),
1251 - ATA_EH_RESUME = (1 << 4),
1252 - ATA_EH_PM_FREEZE = (1 << 5),
1253
1254 ATA_EH_RESET_MASK = ATA_EH_SOFTRESET | ATA_EH_HARDRESET,
1255 - ATA_EH_PERDEV_MASK = ATA_EH_REVALIDATE | ATA_EH_SUSPEND |
1256 - ATA_EH_RESUME | ATA_EH_PM_FREEZE,
1257 + ATA_EH_PERDEV_MASK = ATA_EH_REVALIDATE,
1258
1259 /* ata_eh_info->flags */
1260 ATA_EHI_HOTPLUGGED = (1 << 0), /* could have been hotplugged */
1261 @@ -752,8 +747,6 @@ extern int sata_scr_write_flush(struct a
1262 extern int ata_port_online(struct ata_port *ap);
1263 extern int ata_port_offline(struct ata_port *ap);
1264 #ifdef CONFIG_PM
1265 -extern int ata_scsi_device_resume(struct scsi_device *);
1266 -extern int ata_scsi_device_suspend(struct scsi_device *, pm_message_t mesg);
1267 extern int ata_host_suspend(struct ata_host *host, pm_message_t mesg);
1268 extern void ata_host_resume(struct ata_host *host);
1269 #endif
1270 @@ -1019,11 +1012,6 @@ static inline unsigned int ata_dev_absen
1271 return ata_class_absent(dev->class);
1272 }
1273
1274 -static inline unsigned int ata_dev_ready(const struct ata_device *dev)
1275 -{
1276 - return ata_dev_enabled(dev) && !(dev->flags & ATA_DFLAG_SUSPENDED);
1277 -}
1278 -
1279 /*
1280 * port helpers
1281 */

  ViewVC Help
Powered by ViewVC 1.1.20