rpms/kernel/F-9 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.651, 1.652

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


Author: cebbert

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

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-33
- 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-9/kernel.spec,v
retrieving revision 1.651
retrieving revision 1.652
diff -u -r1.651 -r1.652
--- kernel.spec	22 May 2008 20:31:39 -0000	1.651
+++ kernel.spec	27 May 2008 18:09:52 -0000	1.652
@@ -624,8 +624,13 @@
 Patch570: linux-2.6-selinux-mprotect-checks.patch
 Patch580: linux-2.6-sparc-selinux-mprotect-checks.patch
 Patch610: linux-2.6-defaults-fat-utf8.patch
+
+# libata
 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
 Patch681: linux-2.6-wireless-pending.patch
@@ -653,9 +658,6 @@
 # kludge to make ich9 e1000 work
 Patch2000: linux-2.6-e1000-ich9.patch
 
-# Make Eee disk faster.
-Patch2010: linux-2.6-sata-eeepc-faster.patch
-
 # atl2 network driver
 Patch2020: linux-2.6-netdev-atl2.patch
 
@@ -1166,10 +1168,17 @@
 # Use UTF-8 by default on VFAT.
 ApplyPatch linux-2.6-defaults-fat-utf8.patch
 
+# libata
 # ia64 ata quirk
 ApplyPatch linux-2.6-ata-quirk.patch
 # wake up links that have been put to sleep by BIOS (#436099)
 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 Eee disk faster.
+ApplyPatch linux-2.6-sata-eeepc-faster.patch
 
 # wireless patches headed for 2.6.26
 ApplyPatch linux-2.6-wireless.patch
@@ -1199,8 +1208,6 @@
 
 ApplyPatch linux-2.6-e1000-ich9.patch
 
-ApplyPatch linux-2.6-sata-eeepc-faster.patch
-
 ApplyPatch linux-2.6-netdev-atl2.patch
 
 # Nouveau DRM + drm fixes
@@ -1824,6 +1831,10 @@
 %kernel_variant_files -a /%{image_install_path}/xen*-%{KVERREL}.xen -e /etc/ld.so.conf.d/kernelcap-%{KVERREL}.xen.conf %{with_xen} xen
 
 %changelog
+* Tue May 27 2008 Chuck Ebbert <cebbert at redhat.com> 2.6.25.4-33
+- libata: fix hangs on undock (#439197)
+- libata: fix problems with some old/broken CF hardware (F8 #224005)
+
 * Thu May 22 2008 Dave Jones <davej at redhat.com>
 - Disable CONFIG_DMAR. This is terminally broken in the presence of a broken BIOS
 




More information about the fedora-extras-commits mailing list