rpms/kernel/F-8 linux-2.6-libata-acpi-hotplug-fixups.patch, NONE, 1.1 linux-2.6-libata-be-a-bit-more-slack-about-early-devices.patch, NONE, 1.1 kernel.spec, 1.451, 1.452

Chuck Ebbert (cebbert) fedora-extras-commits at redhat.com
Tue May 27 18:18:13 UTC 2008


Author: cebbert

Update of /cvs/pkgs/rpms/kernel/F-8
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv11041

Modified Files:
	kernel.spec 
Added Files:
	linux-2.6-libata-acpi-hotplug-fixups.patch 
	linux-2.6-libata-be-a-bit-more-slack-about-early-devices.patch 
Log Message:
* Tue May 27 2008 Chuck Ebbert <cebbert at redhat.com> 2.6.25.4-12
- libata: fix hangs on undock (#439197)
- libata: fix problems with some old/broken CF hardware (F8 #224005)


linux-2.6-libata-acpi-hotplug-fixups.patch:

--- NEW FILE linux-2.6-libata-acpi-hotplug-fixups.patch ---
Gitweb:     http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=ae6c23c4e1ec9720b99e1e6850fe47c6c7fddbb3
Commit:     ae6c23c4e1ec9720b99e1e6850fe47c6c7fddbb3
Parent:     50af2fa1e18d0ab411d06bf727ecadb7e01721e9
Author:     Matthew Garrett <mjg59 at srcf.ucam.org>
AuthorDate: Mon May 19 17:29:34 2008 +0100
Committer:  Jeff Garzik <jgarzik at redhat.com>
CommitDate: Mon May 19 17:55:18 2008 -0400

    Fixups to ATA ACPI hotplug
    
    The libata-acpi.c code currently accepts hotplug messages from both the
    port and the device. This does not match the behaviour of the bay
    driver, and may result in confusion when two hotplug requests are
    received for the same device. This patch limits the hotplug notification
    to removable ACPI devices, which in turn allows it to use the _STA
    method to determine whether the device has been removed or inserted.
    On removal, devices are marked as detached. On insertion, a hotplug scan
    is started. This should avoid lockups caused by the ata layer attempting
    to scan devices which have been removed. The uevent sending is moved
    outside the spinlock in order to avoid a warning generated by it firing
    when interrupts are disabled.
    
    Signed-off-by: Matthew Garrett <mjg at redhat.com>
    Signed-off-by: Jeff Garzik <jgarzik at redhat.com>
---
 drivers/ata/libata-acpi.c |   77 +++++++++++++++++++++++++++++----------------
 1 files changed, 50 insertions(+), 27 deletions(-)

diff --git a/drivers/ata/libata-acpi.c b/drivers/ata/libata-acpi.c
index 70b77e0..865a552 100644
--- a/drivers/ata/libata-acpi.c
+++ b/drivers/ata/libata-acpi.c
@@ -118,8 +118,8 @@ static void ata_acpi_associate_ide_port(struct ata_port *ap)
 		ap->pflags |= ATA_PFLAG_INIT_GTM_VALID;
 }
 
-static void ata_acpi_handle_hotplug(struct ata_port *ap, struct ata_device *dev,
-				    u32 event)
+static void ata_acpi_handle_hotplug(struct ata_port *ap, struct ata_device 
+				    *dev, u32 event)
 {
 	char event_string[12];
 	char *envp[] = { event_string, NULL };
@@ -127,39 +127,67 @@ static void ata_acpi_handle_hotplug(struct ata_port *ap, struct ata_device *dev,
 	struct kobject *kobj = NULL;
 	int wait = 0;
 	unsigned long flags;
-
+	acpi_handle handle, tmphandle;
+	unsigned long sta;
+	acpi_status status;
+	
 	if (!ap)
 		ap = dev->link->ap;
 	ehi = &ap->link.eh_info;
 
 	spin_lock_irqsave(ap->lock, flags);
 
+	if (dev)
+		handle = dev->acpi_handle;
+	else
+		handle = ap->acpi_handle;
+
+	status = acpi_get_handle(handle, "_EJ0", &tmphandle);
+	if (ACPI_FAILURE(status)) {
+		/* This device is not ejectable */
+		spin_unlock_irqrestore(ap->lock, flags);
+		return;
+	}
+
+	status = acpi_evaluate_integer(handle, "_STA", NULL, &sta);
+	if (ACPI_FAILURE(status)) {
+		printk ("Unable to determine bay status\n");
+		spin_unlock_irqrestore(ap->lock, flags);
+		return;
+	}
+
 	switch (event) {
 	case ACPI_NOTIFY_BUS_CHECK:
 	case ACPI_NOTIFY_DEVICE_CHECK:
 		ata_ehi_push_desc(ehi, "ACPI event");
-		ata_ehi_hotplugged(ehi);
-		ata_port_freeze(ap);
-		break;
-
-	case ACPI_NOTIFY_EJECT_REQUEST:
-		ata_ehi_push_desc(ehi, "ACPI event");
-		if (dev)
-			dev->flags |= ATA_DFLAG_DETACH;
-		else {
-			struct ata_link *tlink;
-			struct ata_device *tdev;
-
-			ata_port_for_each_link(tlink, ap)
-				ata_link_for_each_dev(tdev, tlink)
-					tdev->flags |= ATA_DFLAG_DETACH;
+		if (!sta) {
+                /* Device has been unplugged */
+			if (dev)
+				dev->flags |= ATA_DFLAG_DETACH;
+			else {
+				struct ata_link *tlink;
+				struct ata_device *tdev;
+				
+				ata_port_for_each_link(tlink, ap) {
+					ata_link_for_each_dev(tdev, tlink) {
+						tdev->flags |= 
+							ATA_DFLAG_DETACH;
+					}
+				}
+			}
+			ata_port_schedule_eh(ap);
+			wait = 1;
+		} else {
+			ata_ehi_hotplugged(ehi);
+			ata_port_freeze(ap);
 		}
-
-		ata_port_schedule_eh(ap);
-		wait = 1;
-		break;
 	}
 
+	spin_unlock_irqrestore(ap->lock, flags);
+
+	if (wait)
+		ata_port_wait_eh(ap);
+
 	if (dev) {
 		if (dev->sdev)
 			kobj = &dev->sdev->sdev_gendev.kobj;
@@ -170,11 +198,6 @@ static void ata_acpi_handle_hotplug(struct ata_port *ap, struct ata_device *dev,
 		sprintf(event_string, "BAY_EVENT=%d", event);
 		kobject_uevent_env(kobj, KOBJ_CHANGE, envp);
 	}
-
-	spin_unlock_irqrestore(ap->lock, flags);
-
-	if (wait)
-		ata_port_wait_eh(ap);
 }
 
 static void ata_acpi_dev_notify(acpi_handle handle, u32 event, void *data)

linux-2.6-libata-be-a-bit-more-slack-about-early-devices.patch:

--- NEW FILE linux-2.6-libata-be-a-bit-more-slack-about-early-devices.patch ---
From: Alan Cox <alan at lxorguk.ukuu.org.uk>
Date: Tue, 8 Apr 2008 15:36:44 +0000 (+0100)
Subject: libata: Be a bit more slack about early devices
X-Git-Tag: v2.6.26-rc1~1150^2~10
X-Git-Url: http://git.kernel.org/?p=linux%2Fkernel%2Fgit%2Ftorvalds%2Flinux-2.6.git;a=commitdiff_plain;h=b93fda12357b3f1aa55cf69d8e088372788ea9ea

libata: Be a bit more slack about early devices

We have a certain number of 'ATA' emulations often on CF or other flash
devices that are at best "loosely based" on the CF 1.1 standard. These
devices report themselves as disk but don't support the ATA minimal
command set only the CF 1.1 set.

Relax the PIO checking for devices reporting ATA rev 0, or no iordy
support, or CFA. Rework the code a bit as it was already messy and this
made it quite ugly.

Signed-off-by: Alan Cox <alan at redhat.com>
Signed-off-by: Jeff Garzik <jgarzik at redhat.com>
---

diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c
index 2556ea2..733eb94 100644
--- a/drivers/ata/libata-core.c
+++ b/drivers/ata/libata-core.c
@@ -3132,16 +3132,21 @@ static int ata_dev_set_mode(struct ata_device *dev)
 	if (rc)
 		return rc;
 
-	/* Old CFA may refuse this command, which is just fine */
-	if (dev->xfer_shift == ATA_SHIFT_PIO && ata_id_is_cfa(dev->id))
-		ign_dev_err = 1;
-
-	/* Some very old devices and some bad newer ones fail any kind of
-	   SET_XFERMODE request but support PIO0-2 timings and no IORDY */
-	if (dev->xfer_shift == ATA_SHIFT_PIO && !ata_id_has_iordy(dev->id) &&
-			dev->pio_mode <= XFER_PIO_2)
-		ign_dev_err = 1;
-
+	if (dev->xfer_shift == ATA_SHIFT_PIO) {
+		/* Old CFA may refuse this command, which is just fine */
+		if (ata_id_is_cfa(dev->id))
+			ign_dev_err = 1;
+		/* Catch several broken garbage emulations plus some pre
+		   ATA devices */
+		if (ata_id_major_version(dev->id) == 0 &&
+					dev->pio_mode <= XFER_PIO_2)
+			ign_dev_err = 1;
+		/* Some very old devices and some bad newer ones fail
+		   any kind of SET_XFERMODE request but support PIO0-2
+		   timings and no IORDY */
+		if (!ata_id_has_iordy(dev->id) && dev->pio_mode <= XFER_PIO_2)
+			ign_dev_err = 1;
+	}
 	/* Early MWDMA devices do DMA but don't allow DMA mode setting.
 	   Don't fail an MWDMA0 set IFF the device indicates it is in MWDMA0 */
 	if (dev->xfer_shift == ATA_SHIFT_MWDMA &&


Index: kernel.spec
===================================================================
RCS file: /cvs/pkgs/rpms/kernel/F-8/kernel.spec,v
retrieving revision 1.451
retrieving revision 1.452
diff -u -r1.451 -r1.452
--- kernel.spec	27 May 2008 17:36:32 -0000	1.451
+++ kernel.spec	27 May 2008 18:17:27 -0000	1.452
@@ -637,6 +637,8 @@
 
 Patch670: linux-2.6-ata-quirk.patch
 Patch671: linux-2.6-libata-force-hardreset-in-sleep-mode.patch
+Patch672: linux-2.6-libata-acpi-hotplug-fixups.patch
+Patch673: linux-2.6-libata-be-a-bit-more-slack-about-early-devices.patch
 Patch674: linux-2.6-sata-eeepc-faster.patch
 
 Patch680: linux-2.6-wireless.patch
@@ -1144,6 +1146,10 @@
 ApplyPatch linux-2.6-ata-quirk.patch
 # force hard reset when ahci links are asleep at init time
 ApplyPatch linux-2.6-libata-force-hardreset-in-sleep-mode.patch
+# fix hangs on undock (#439197)
+ApplyPatch linux-2.6-libata-acpi-hotplug-fixups.patch
+# fix problems with some old/broken CF hardware (F8 #224005)
+ApplyPatch linux-2.6-libata-be-a-bit-more-slack-about-early-devices.patch
 # make eeepc ata go faster
 ApplyPatch linux-2.6-sata-eeepc-faster.patch
 
@@ -1821,7 +1827,11 @@
 
 
 %changelog
-* Thu May 22 2008 Chuck Ebbert <cebbert at redhat.com> 2.6.25.4-11
+* Tue May 27 2008 Chuck Ebbert <cebbert at redhat.com> 2.6.25.4-12
+- libata: fix hangs on undock (#439197)
+- libata: fix problems with some old/broken CF hardware (F8 #224005)
+
+* Tue May 27 2008 Chuck Ebbert <cebbert at redhat.com> 2.6.25.4-11
 - Remove already-merged libata pata_ali DMA disable patch.
 - Add missing libata patch from the F9 kernel.
 




More information about the scm-commits mailing list