rpms/kernel/devel linux-2.6-acpi-git-ec-init-fixes.patch, NONE, 1.1 linux-2.6-drivers-ssb-debug-revision.patch, NONE, 1.1 kernel.spec, 1.158, 1.159

Chuck Ebbert (cebbert) fedora-extras-commits at redhat.com
Wed Sep 12 18:36:23 UTC 2007


Author: cebbert

Update of /cvs/pkgs/rpms/kernel/devel
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv25503

Modified Files:
	kernel.spec 
Added Files:
	linux-2.6-acpi-git-ec-init-fixes.patch 
	linux-2.6-drivers-ssb-debug-revision.patch 
Log Message:
* Wed Sep 12 2007 Chuck Ebbert <cebbert at redhat.com>
- better debug message for SSB driver
- acpi: fix EC initialization (from linux-acpi.git)


linux-2.6-acpi-git-ec-init-fixes.patch:

--- NEW FILE linux-2.6-acpi-git-ec-init-fixes.patch ---
From: Alexey Starikovskiy <astarikovskiy at suse.de>
Date: Wed, 5 Sep 2007 23:56:38 +0000 (-0400)
Subject: ACPI: EC: Drop ECDT-based boot_ec as soon as we find DSDT-based one.
X-Git-Url: http://git.kernel.org/?p=linux%2Fkernel%2Fgit%2Flenb%2Flinux-acpi-2.6.git;a=commitdiff_plain;h=4c611060660f0de3e9b8f02df207312bc6f5c331

ACPI: EC: Drop ECDT-based boot_ec as soon as we find DSDT-based one.

ASUS notebooks have numerous problems with EC initialization
This patch tries to work around three known issues reported
in bugzilla 8598, 8709 and 8909/8919.

Signed-off-by: Alexey Starikovskiy <astarikovskiy at suse.de>
Signed-off-by: Len Brown <len.brown at intel.com>
---

diff --git a/drivers/acpi/ec.c b/drivers/acpi/ec.c
index 3f7935a..9cd7997 100644
--- a/drivers/acpi/ec.c
+++ b/drivers/acpi/ec.c
@@ -121,6 +121,7 @@ static struct acpi_ec {
 	atomic_t event_count;
 	wait_queue_head_t wait;
 	struct list_head list;
+	u8 handlers_installed;
 } *boot_ec, *first_ec;
 
 /* --------------------------------------------------------------------------
@@ -680,32 +681,50 @@ ec_parse_device(acpi_handle handle, u32 Level, void *context, void **retval)
 	status = acpi_evaluate_integer(handle, "_GPE", NULL, &ec->gpe);
 	if (ACPI_FAILURE(status))
 		return status;
-
 	/* Find and register all query methods */
 	acpi_walk_namespace(ACPI_TYPE_METHOD, handle, 1,
 			    acpi_ec_register_query_methods, ec, NULL);
-
 	/* Use the global lock for all EC transactions? */
 	acpi_evaluate_integer(handle, "_GLK", NULL, &ec->global_lock);
-
 	ec->handle = handle;
-
-	printk(KERN_INFO PREFIX "GPE = 0x%lx, I/O: command/status = 0x%lx, data = 0x%lx\n",
-			  ec->gpe, ec->command_addr, ec->data_addr);
-
 	return AE_CTRL_TERMINATE;
 }
 
+static void ec_remove_handlers(struct acpi_ec *ec)
+{
+	if (ACPI_FAILURE(acpi_remove_address_space_handler(ec->handle,
+				ACPI_ADR_SPACE_EC, &acpi_ec_space_handler)))
+		printk(KERN_ERR PREFIX "failed to remove space handler\n");
+	if (ACPI_FAILURE(acpi_remove_gpe_handler(NULL, ec->gpe,
+				&acpi_ec_gpe_handler)))
+		printk(KERN_ERR PREFIX "failed to remove gpe handler\n");
+	ec->handlers_installed = 0;
+}
+
 static int acpi_ec_add(struct acpi_device *device)
 {
 	struct acpi_ec *ec = NULL;
 
 	if (!device)
 		return -EINVAL;
-
 	strcpy(acpi_device_name(device), ACPI_EC_DEVICE_NAME);
 	strcpy(acpi_device_class(device), ACPI_EC_CLASS);
 
+	/* Check for boot EC */
+	if (boot_ec) {
+		if (boot_ec->handle == device->handle) {
+			/* Pre-loaded EC from DSDT, just move pointer */
+			ec = boot_ec;
+			boot_ec = NULL;
+			goto end;
+		} else if (boot_ec->handle == ACPI_ROOT_OBJECT) {
+			/* ECDT-based EC, time to shut it down */
+			ec_remove_handlers(boot_ec);
+			kfree(boot_ec);
+			first_ec = boot_ec = NULL;
+		}
+	}
+
 	ec = make_acpi_ec();
 	if (!ec)
 		return -ENOMEM;
@@ -715,25 +734,14 @@ static int acpi_ec_add(struct acpi_device *device)
 		kfree(ec);
 		return -EINVAL;
 	}
-
-	/* Check if we found the boot EC */
-	if (boot_ec) {
-		if (boot_ec->gpe == ec->gpe) {
-			/* We might have incorrect info for GL at boot time */
-			mutex_lock(&boot_ec->lock);
-			boot_ec->global_lock = ec->global_lock;
-			/* Copy handlers from new ec into boot ec */
-			list_splice(&ec->list, &boot_ec->list);
-			mutex_unlock(&boot_ec->lock);
-			kfree(ec);
-			ec = boot_ec;
-		}
-	} else
-		first_ec = ec;
 	ec->handle = device->handle;
+      end:
+	if (!first_ec)
+		first_ec = ec;
 	acpi_driver_data(device) = ec;
-
 	acpi_ec_add_fs(device);
+	printk(KERN_INFO PREFIX "GPE = 0x%lx, I/O: command/status = 0x%lx, data = 0x%lx\n",
+			  ec->gpe, ec->command_addr, ec->data_addr);
 	return 0;
 }
 
@@ -756,10 +764,7 @@ static int acpi_ec_remove(struct acpi_device *device, int type)
 	acpi_driver_data(device) = NULL;
 	if (ec == first_ec)
 		first_ec = NULL;
-
-	/* Don't touch boot EC */
-	if (boot_ec != ec)
-		kfree(ec);
+	kfree(ec);
 	return 0;
 }
 
@@ -789,6 +794,8 @@ ec_parse_io_ports(struct acpi_resource *resource, void *context)
 static int ec_install_handlers(struct acpi_ec *ec)
 {
 	acpi_status status;
+	if (ec->handlers_installed)
+		return 0;
 	status = acpi_install_gpe_handler(NULL, ec->gpe,
 					  ACPI_GPE_EDGE_TRIGGERED,
 					  &acpi_ec_gpe_handler, ec);
@@ -807,6 +814,7 @@ static int ec_install_handlers(struct acpi_ec *ec)
 		return -ENODEV;
 	}
 
+	ec->handlers_installed = 1;
 	return 0;
 }
 
@@ -823,41 +831,22 @@ static int acpi_ec_start(struct acpi_device *device)
 	if (!ec)
 		return -EINVAL;
 
-	/* Boot EC is already working */
-	if (ec != boot_ec)
-		ret = ec_install_handlers(ec);
+	ret = ec_install_handlers(ec);
 
 	/* EC is fully operational, allow queries */
 	atomic_set(&ec->query_pending, 0);
-
 	return ret;
 }
 
 static int acpi_ec_stop(struct acpi_device *device, int type)
 {
-	acpi_status status;
 	struct acpi_ec *ec;
-
 	if (!device)
 		return -EINVAL;
-
 	ec = acpi_driver_data(device);
 	if (!ec)
 		return -EINVAL;
-
-	/* Don't touch boot EC */
-	if (ec == boot_ec)
-		return 0;
-
-	status = acpi_remove_address_space_handler(ec->handle,
-						   ACPI_ADR_SPACE_EC,
-						   &acpi_ec_space_handler);
-	if (ACPI_FAILURE(status))
-		return -ENODEV;
-
-	status = acpi_remove_gpe_handler(NULL, ec->gpe, &acpi_ec_gpe_handler);
-	if (ACPI_FAILURE(status))
-		return -ENODEV;
+	ec_remove_handlers(ec);
 
 	return 0;
 }
@@ -877,7 +866,7 @@ int __init acpi_ec_ecdt_probe(void)
 	status = acpi_get_table(ACPI_SIG_ECDT, 1,
 				(struct acpi_table_header **)&ecdt_ptr);
 	if (ACPI_SUCCESS(status)) {
-		printk(KERN_INFO PREFIX "EC description table is found, configuring boot EC\n\n");
+		printk(KERN_INFO PREFIX "EC description table is found, configuring boot EC\n");
 		boot_ec->command_addr = ecdt_ptr->control.address;
 		boot_ec->data_addr = ecdt_ptr->data.address;
 		boot_ec->gpe = ecdt_ptr->gpe;
@@ -899,7 +888,6 @@ int __init acpi_ec_ecdt_probe(void)
       error:
 	kfree(boot_ec);
 	boot_ec = NULL;
-
 	return -ENODEV;
 }
 

linux-2.6-drivers-ssb-debug-revision.patch:

--- NEW FILE linux-2.6-drivers-ssb-debug-revision.patch ---
---
 drivers/ssb/main.c |    2 ++
 1 file changed, 2 insertions(+)

--- linux-2.6.22.noarch.orig/drivers/ssb/main.c
+++ linux-2.6.22.noarch/drivers/ssb/main.c
@@ -884,6 +884,8 @@ static u32 ssb_tmslow_reject_bitmask(str
 	case SSB_IDLOW_SSBREV_23:
 		return SSB_TMSLOW_REJECT_23;
 	default:
+		printk(KERN_ERR "ssb: rev %x\n", 
+		       ssb_read32(dev, SSB_IDLOW) & SSB_IDLOW_SSBREV);
 		WARN_ON(1);
 	}
 	return (SSB_TMSLOW_REJECT_22 | SSB_TMSLOW_REJECT_23);


Index: kernel.spec
===================================================================
RCS file: /cvs/pkgs/rpms/kernel/devel/kernel.spec,v
retrieving revision 1.158
retrieving revision 1.159
diff -u -r1.158 -r1.159
--- kernel.spec	12 Sep 2007 00:16:26 -0000	1.158
+++ kernel.spec	12 Sep 2007 18:35:50 -0000	1.159
@@ -632,6 +632,7 @@
 Patch690: git-wireless-dev.patch
 Patch691: linux-2.6-iwlwifi-fw-name-compat.patch
 Patch700: linux-2.6-bcm43xx-pci-neuter.patch
+Patch701: linux-2.6-drivers-ssb-debug-revision.patch
 Patch710: linux-2.6-netdev-e1000e-01.patch
 Patch711: linux-2.6-netdev-e1000e-02.patch
 Patch712: linux-2.6-netdev-e1000e-03.patch
@@ -643,6 +644,7 @@
 Patch718: linux-2.6-netdev-e1000e-09.patch
 Patch719: linux-2.6-netdev-e1000e-10.patch
 #Patch780: linux-2.6-clockevents-fix-resume-logic.patch
+Patch750: linux-2.6-acpi-git-ec-init-fixes.patch
 Patch800: linux-2.6-wakeups-hdaps.patch
 Patch801: linux-2.6-wakeups.patch
 Patch820: linux-2.6-compile-fixes.patch
@@ -1138,6 +1140,9 @@
 # avoid bcm3xx vs bcm43xx-mac80211 PCI ID conflicts
 ApplyPatch linux-2.6-bcm43xx-pci-neuter.patch
 
+# debug the SSB driver
+ApplyPatch linux-2.6-drivers-ssb-debug-revision.patch
+
 # latest Intel driver for ich9
 ApplyPatch linux-2.6-netdev-e1000e-01.patch
 ApplyPatch linux-2.6-netdev-e1000e-02.patch
@@ -1151,6 +1156,8 @@
 ApplyPatch linux-2.6-netdev-e1000e-10.patch
 
 # ACPI patches
+# fix EC init
+ApplyPatch linux-2.6-acpi-git-ec-init-fixes.patch
 
 # Fix excessive wakeups
 # Make hdaps timer only tick when in use.
@@ -1796,6 +1803,10 @@
 
 
 %changelog
+* Wed Sep 12 2007 Chuck Ebbert <cebbert at redhat.com>
+- better debug message for SSB driver
+- acpi: fix EC initialization (from linux-acpi.git)
+
 * Tue Sep 11 2007 Roland McGrath <roland at redhat.com>
 - utrace update (#248532, #267161, #284311)
 




More information about the scm-commits mailing list