]> git.ipfire.org Git - people/pmueller/ipfire-2.x.git/blobdiff - src/patches/suse-2.6.27.25/patches.drivers/libata-set-device-class-to-NONE-if-phys_offline
Updated xen patches taken from suse.
[people/pmueller/ipfire-2.x.git] / src / patches / suse-2.6.27.25 / patches.drivers / libata-set-device-class-to-NONE-if-phys_offline
diff --git a/src/patches/suse-2.6.27.25/patches.drivers/libata-set-device-class-to-NONE-if-phys_offline b/src/patches/suse-2.6.27.25/patches.drivers/libata-set-device-class-to-NONE-if-phys_offline
new file mode 100644 (file)
index 0000000..6b42f2c
--- /dev/null
@@ -0,0 +1,47 @@
+From 816ab89782ac139a8b65147cca990822bb7e8675 Mon Sep 17 00:00:00 2001
+From: Tejun Heo <tj@kernel.org>
+Date: Wed, 22 Oct 2008 00:31:34 +0900
+Subject: [PATCH] libata: set device class to NONE if phys_offline
+References: bnc#441420
+
+Reset methods don't have access to phys link status for slave links
+and may incorrectly indicate device presence causing unnecessary probe
+failures for unoccupied links.  This patch clears device class to NONE
+during post-reset processing if phys link is offline.
+
+As on/offlineness semantics is strictly defined and used in multiple
+places by the core layer, this won't change behavior for drivers which
+don't use slave links.
+
+Signed-off-by: Tejun Heo <tj@kernel.org>
+Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
+Signed-off-by: Tejun Heo <teheo@suse.de>
+---
+ drivers/ata/libata-eh.c |   16 ++++++++--------
+ 1 file changed, 8 insertions(+), 8 deletions(-)
+
+--- a/drivers/ata/libata-eh.c
++++ b/drivers/ata/libata-eh.c
+@@ -2425,14 +2425,14 @@ int ata_eh_reset(struct ata_link *link, 
+               dev->pio_mode = XFER_PIO_0;
+               dev->flags &= ~ATA_DFLAG_SLEEPING;
+-              if (ata_phys_link_offline(ata_dev_phys_link(dev)))
+-                      continue;
+-
+-              /* apply class override */
+-              if (lflags & ATA_LFLAG_ASSUME_ATA)
+-                      classes[dev->devno] = ATA_DEV_ATA;
+-              else if (lflags & ATA_LFLAG_ASSUME_SEMB)
+-                      classes[dev->devno] = ATA_DEV_SEMB_UNSUP; /* not yet */
++              if (!ata_phys_link_offline(ata_dev_phys_link(dev))) {
++                      /* apply class override */
++                      if (lflags & ATA_LFLAG_ASSUME_ATA)
++                              classes[dev->devno] = ATA_DEV_ATA;
++                      else if (lflags & ATA_LFLAG_ASSUME_SEMB)
++                              classes[dev->devno] = ATA_DEV_SEMB_UNSUP;
++              } else
++                      classes[dev->devno] = ATA_DEV_NONE;
+       }
+       /* record current link speed */