]> git.ipfire.org Git - people/pmueller/ipfire-2.x.git/blob - src/patches/suse-2.6.27.39/patches.drivers/libata-set-device-class-to-NONE-if-phys_offline
Fix oinkmaster patch.
[people/pmueller/ipfire-2.x.git] / src / patches / suse-2.6.27.39 / patches.drivers / libata-set-device-class-to-NONE-if-phys_offline
1 From 816ab89782ac139a8b65147cca990822bb7e8675 Mon Sep 17 00:00:00 2001
2 From: Tejun Heo <tj@kernel.org>
3 Date: Wed, 22 Oct 2008 00:31:34 +0900
4 Subject: [PATCH] libata: set device class to NONE if phys_offline
5 References: bnc#441420
6
7 Reset methods don't have access to phys link status for slave links
8 and may incorrectly indicate device presence causing unnecessary probe
9 failures for unoccupied links. This patch clears device class to NONE
10 during post-reset processing if phys link is offline.
11
12 As on/offlineness semantics is strictly defined and used in multiple
13 places by the core layer, this won't change behavior for drivers which
14 don't use slave links.
15
16 Signed-off-by: Tejun Heo <tj@kernel.org>
17 Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
18 Signed-off-by: Tejun Heo <teheo@suse.de>
19 ---
20 drivers/ata/libata-eh.c | 16 ++++++++--------
21 1 file changed, 8 insertions(+), 8 deletions(-)
22
23 --- a/drivers/ata/libata-eh.c
24 +++ b/drivers/ata/libata-eh.c
25 @@ -2425,14 +2425,14 @@ int ata_eh_reset(struct ata_link *link,
26 dev->pio_mode = XFER_PIO_0;
27 dev->flags &= ~ATA_DFLAG_SLEEPING;
28
29 - if (ata_phys_link_offline(ata_dev_phys_link(dev)))
30 - continue;
31 -
32 - /* apply class override */
33 - if (lflags & ATA_LFLAG_ASSUME_ATA)
34 - classes[dev->devno] = ATA_DEV_ATA;
35 - else if (lflags & ATA_LFLAG_ASSUME_SEMB)
36 - classes[dev->devno] = ATA_DEV_SEMB_UNSUP; /* not yet */
37 + if (!ata_phys_link_offline(ata_dev_phys_link(dev))) {
38 + /* apply class override */
39 + if (lflags & ATA_LFLAG_ASSUME_ATA)
40 + classes[dev->devno] = ATA_DEV_ATA;
41 + else if (lflags & ATA_LFLAG_ASSUME_SEMB)
42 + classes[dev->devno] = ATA_DEV_SEMB_UNSUP;
43 + } else
44 + classes[dev->devno] = ATA_DEV_NONE;
45 }
46
47 /* record current link speed */