All of lore.kernel.org
 help / color / mirror / Atom feed
From: Len Brown <lenb@kernel.org>
To: linux-acpi@vger.kernel.org
Cc: Alexey Starikovskiy <astarikovskiy@suse.de>,
	Len Brown <len.brown@intel.com>
Subject: [PATCH 01/94] ACPI: EC: Add some basic check for ECDT data
Date: Fri, 09 Jan 2009 04:26:03 -0500	[thread overview]
Message-ID: <c5279dee26c0e8d7c4200993bfc4b540d2469598.1231492606.git.len.brown@intel.com> (raw)
In-Reply-To: <1231493256-11678-1-git-send-email-lenb@kernel.org>

From: Alexey Starikovskiy <astarikovskiy@suse.de>

One more ASUS comes with empty ECDT, add a guard for it...

http://bugzilla.kernel.org/show_bug.cgi?id=11880

Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de>
Signed-off-by: Len Brown <len.brown@intel.com>
---
 drivers/acpi/ec.c |   43 ++++++++++++++++++++++---------------------
 1 files changed, 22 insertions(+), 21 deletions(-)

diff --git a/drivers/acpi/ec.c b/drivers/acpi/ec.c
index cf41f9f..3ba034f 100644
--- a/drivers/acpi/ec.c
+++ b/drivers/acpi/ec.c
@@ -977,7 +977,6 @@ static const struct acpi_device_id ec_device_ids[] = {
 
 int __init acpi_ec_ecdt_probe(void)
 {
-	int ret;
 	acpi_status status;
 	struct acpi_table_ecdt *ecdt_ptr;
 
@@ -1005,30 +1004,32 @@ int __init acpi_ec_ecdt_probe(void)
 		boot_ec->gpe = ecdt_ptr->gpe;
 		boot_ec->handle = ACPI_ROOT_OBJECT;
 		acpi_get_handle(ACPI_ROOT_OBJECT, ecdt_ptr->id, &boot_ec->handle);
-	} else {
-		/* This workaround is needed only on some broken machines,
-		 * which require early EC, but fail to provide ECDT */
-		acpi_handle x;
-		printk(KERN_DEBUG PREFIX "Look up EC in DSDT\n");
-		status = acpi_get_devices(ec_device_ids[0].id, ec_parse_device,
-						boot_ec, NULL);
-		/* Check that acpi_get_devices actually find something */
-		if (ACPI_FAILURE(status) || !boot_ec->handle)
-			goto error;
-		/* We really need to limit this workaround, the only ASUS,
-		 * which needs it, has fake EC._INI method, so use it as flag.
-		 * Keep boot_ec struct as it will be needed soon.
-		 */
-		if (ACPI_FAILURE(acpi_get_handle(boot_ec->handle, "_INI", &x)))
-			return -ENODEV;
+		/* Add some basic check against completely broken table */
+		if (boot_ec->data_addr != boot_ec->command_addr)
+			goto install;
+	/* fall through */
 	}
-
-	ret = ec_install_handlers(boot_ec);
-	if (!ret) {
+	/* This workaround is needed only on some broken machines,
+	 * which require early EC, but fail to provide ECDT */
+	acpi_handle x;
+	printk(KERN_DEBUG PREFIX "Look up EC in DSDT\n");
+	status = acpi_get_devices(ec_device_ids[0].id, ec_parse_device,
+					boot_ec, NULL);
+	/* Check that acpi_get_devices actually find something */
+	if (ACPI_FAILURE(status) || !boot_ec->handle)
+		goto error;
+	/* We really need to limit this workaround, the only ASUS,
+	 * which needs it, has fake EC._INI method, so use it as flag.
+	 * Keep boot_ec struct as it will be needed soon.
+	 */
+	if (ACPI_FAILURE(acpi_get_handle(boot_ec->handle, "_INI", &x)))
+		return -ENODEV;
+install:
+	if (!ec_install_handlers(boot_ec)) {
 		first_ec = boot_ec;
 		return 0;
 	}
-      error:
+error:
 	kfree(boot_ec);
 	boot_ec = NULL;
 	return -ENODEV;
-- 
1.5.6.6


  reply	other threads:[~2009-01-09  9:27 UTC|newest]

Thread overview: 96+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-01-09  9:26 ACPI & Suspend related patches for 2.6.29 Len Brown
2009-01-09  9:26 ` Len Brown [this message]
2009-01-09  9:26   ` [PATCH 02/94] ACPI: EC: fix compilation warning Len Brown
2009-01-09  9:26   ` [PATCH 03/94] /proc/acpi/alarm: handle day-of-month wraparound on readback Len Brown
2009-01-09  9:26   ` [PATCH 04/94] ACPI: video: Fix reversed brightness behavior on ThinkPad SL series Len Brown
2009-01-09  9:26   ` [PATCH 05/94] Hibernate: Call platform_begin before swsusp_shrink_memory Len Brown
2009-01-09  9:26   ` [PATCH 06/94] ACPI hibernate: Add a mechanism to save/restore ACPI NVS memory Len Brown
2009-01-09  9:26   ` [PATCH 07/94] x86 hibernate: Mark ACPI NVS memory region at startup Len Brown
2009-01-09  9:26   ` [PATCH 08/94] ACPI hibernate: Introduce new kernel parameter acpi_sleep=s4_nonvs Len Brown
2009-01-09  9:26   ` [PATCH 09/94] Hibernate: Do not oops on resume if image data are incorrect Len Brown
2009-01-09  9:26   ` [PATCH 10/94] Hibernate: Take overlapping zones into account (rev. 2) Len Brown
2009-01-09  9:26   ` [PATCH 11/94] Hibernate: Replace unnecessary evaluation of pfn_to_page() Len Brown
2009-01-09  9:26   ` [PATCH 12/94] drivers/misc/Makefile, Kconfig: cleanup Len Brown
2009-01-09  9:26   ` [PATCH 13/94] create drivers/platform/x86/ from drivers/misc/ Len Brown
2009-01-09  9:26   ` [PATCH 14/94] ACPI: move wmi, asus_acpi, toshiba_acpi to drivers/platform/x86 Len Brown
2009-01-09  9:26   ` [PATCH 15/94] doc: fix kernel-parameters.txt formatting Len Brown
2009-01-09  9:26   ` [PATCH 16/94] Newly inserted battery might differ from one just removed, so Len Brown
2009-01-09  9:26   ` [PATCH 17/94] ACPI: disable MPS when NO APIC-table found Len Brown
2009-01-09  9:26   ` [PATCH 18/94] eeepc-laptop: use select and not depends on Len Brown
2009-01-09  9:26   ` [PATCH 19/94] ACPICA: Fix several warnings under gcc 4 compiler Len Brown
2009-01-09  9:26   ` [PATCH 20/94] ACPICA: Update FACS waking vector interfaces Len Brown
2009-01-09  9:26   ` [PATCH 21/94] ACPICA: Fix possible memory leak on error in parser Len Brown
2009-01-09  9:26   ` [PATCH 22/94] ACPICA: Optimize execution of AML While loops Len Brown
2009-01-09  9:26   ` [PATCH 23/94] ACPICA: Add a mechanism to escape infinite AML While() loops Len Brown
2009-01-09  9:26   ` [PATCH 24/94] ACPICA: Update debug output for IndexField I/O Len Brown
2009-01-09  9:26   ` [PATCH 25/94] ACPICA: Fix namestring for the SystemCMOS address space Len Brown
2009-01-09  9:26   ` [PATCH 26/94] ACPICA: Emit warning if two FACS or DSDT tables found in the FADT Len Brown
2009-01-09  9:26   ` [PATCH 27/94] ACPICA: Add global pointer for FACS table to simplify FACS access Len Brown
2009-01-09  9:26   ` [PATCH 28/94] ACPICA: Reformat comments, no functional changes Len Brown
2009-01-09  9:26   ` [PATCH 29/94] ACPICA: Add support to externally execute _OSI method Len Brown
2009-01-09  9:26   ` [PATCH 30/94] ACPICA: Remove references to obsolete ACPI_DUMP_APP Len Brown
2009-01-09  9:26   ` [PATCH 31/94] ACPICA: Fix to allow aliases within ASL namepaths Len Brown
2009-01-09  9:26   ` [PATCH 32/94] ACPICA: Allow multiple backslash prefix in namepaths Len Brown
2009-01-09  9:26   ` [PATCH 33/94] ACPICA: Add Buffer->String conversion for predefined methods Len Brown
2009-01-09  9:26   ` [PATCH 34/94] ACPICA: Consolidate method arg count validation code Len Brown
2009-01-09  9:26   ` [PATCH 35/94] ACPICA: Enhance implicit return mechanism Len Brown
2009-01-09  9:26   ` [PATCH 36/94] ACPICA: Update version to 20081031 Len Brown
2009-01-09  9:26   ` [PATCH 37/94] cpuidle: Add decaying history logic to menu idle predictor Len Brown
2009-01-09  9:26   ` [PATCH 38/94] ACPI: Do not modify SCI_EN directly Len Brown
2009-01-09  9:26   ` [PATCH 39/94] ACPI: PCI: use conventional PCI address format Len Brown
2009-01-09  9:26   ` [PATCH 40/94] ACPI: PCI: remove unnecessary null pointer checks Len Brown
2009-01-09  9:26   ` [PATCH 41/94] ACPI: PCI: simplify buffer management for evaluating _PRT Len Brown
2009-01-09  9:26   ` [PATCH 42/94] ACPI: PCI: ignore _PRT function information Len Brown
2009-01-09  9:26   ` [PATCH 43/94] ACPI: PCI: fix GSI/IRQ naming confusion Len Brown
2009-01-09  9:26   ` [PATCH 44/94] ACPI: PCI: move struct acpi_prt_entry declaration out of public header file Len Brown
2009-01-09  9:26   ` [PATCH 45/94] ACPI: PCI: add a helper to convert _PRT INTx pin number to name Len Brown
2009-01-09  9:26   ` [PATCH 46/94] ACPI: PCI: always use the PCI INTx pin values, not the _PRT ones Len Brown
2009-01-09  9:26   ` [PATCH 47/94] ACPI: PCI: use 1-based encoding for _PRT quirks Len Brown
2009-01-09  9:26   ` [PATCH 48/94] ACPI: PCI: lookup _PRT entry by PCI dev and pin, not segment/bus/dev/pin Len Brown
2009-01-09  9:26   ` [PATCH 49/94] ACPI: PCI: tweak _PRT lookup debug Len Brown
2009-01-09  9:26   ` [PATCH 50/94] ACPI: PCI: remove callback from acpi_pci_irq_lookup & acpi_pci_irq_derive Len Brown
2009-01-09  9:26   ` [PATCH 51/94] ACPI: PCI: use positive logic to simplify code Len Brown
2009-01-09  9:26   ` [PATCH 52/94] ACPI: PCI: follow typical PCI INTx swizzling pattern Len Brown
2009-01-09  9:26   ` [PATCH 53/94] ACPI: PCI: combine lookup and derive Len Brown
2009-01-09  9:26   ` [PATCH 54/94] ACPI: PCI: simplify list of _PRT entries Len Brown
2009-01-09  9:26   ` [PATCH 55/94] ACPI: PCI: simplify struct acpi_prt_entry Len Brown
2009-01-09  9:26   ` [PATCH 56/94] ACPI: PCI: expand acpi_pci_allocate_irq() and acpi_pci_free_irq() inline Len Brown
2009-01-09  9:26   ` [PATCH 57/94] ACPI: PCI: whitespace and useless initialization cleanup Len Brown
2009-01-09  9:27   ` [PATCH 58/94] ACPI: PCI: add HP copyright Len Brown
2009-01-09  9:27   ` [PATCH 59/94] ACPI: simplify buffer management for acpi_pci_bind() etc Len Brown
2009-01-09  9:27   ` [PATCH 60/94] ACPI: ec.c, pci_link.c, video_detec.c: static Len Brown
2009-01-09  9:27   ` [PATCH 61/94] video: always update the brightness when poking "brightness" Len Brown
2009-01-09  9:27   ` [PATCH 62/94] ACPI: osl.c: replace return_ACPI_STATUS with return Len Brown
2009-01-09  9:27   ` [PATCH 63/94] ACPI: ec.c: call acpi_get_name to get node name Len Brown
2009-01-09  9:27   ` [PATCH 64/94] ACPI: proc.c: remove ACPI_FUNCTION_TRACE Len Brown
2009-01-09  9:27   ` [PATCH 65/94] ACPI: wakeup.c: " Len Brown
2009-01-09  9:27   ` [PATCH 66/94] ACPICA: New: acpi_get_gpe_device interface Len Brown
2009-01-09  9:27   ` [PATCH 67/94] ACPICA: New: Public GPE group enable/disable interfaces Len Brown
2009-01-09  9:27   ` [PATCH 68/94] ACPI: main.c: use new public " Len Brown
2009-01-09  9:27   ` [PATCH 69/94] ACPI: sony-laptop.c: call acpi_get_object_info to get node info Len Brown
2009-01-09  9:27   ` [PATCH 70/94] ACPI: power.c: call acpi_get_name to get node name Len Brown
2009-01-09  9:27   ` [PATCH 71/94] ACPI: panasonic-laptop.c: remove ACPI_FUNCTION_TRACE Len Brown
2009-01-09  9:27   ` [PATCH 72/94] ACPI: io_acpi_init.c: call acpi_get_name to get node fullname Len Brown
2009-01-09  9:27   ` [PATCH 73/94] ACPI: io_common.c: call acpi_get_table to avoid using ACPI_SIG_DSDT Len Brown
2009-01-09  9:27   ` [PATCH 74/94] ACPICA: New: acpi_read and acpi_write public interfaces Len Brown
2009-01-09  9:27   ` [PATCH 75/94] ACPICA: Move all public H/W interfaces to new hwxface Len Brown
2009-01-09  9:27   ` [PATCH 76/94] ACPICA: New: acpi_reset interface - write to reset register Len Brown
2009-01-09  9:27   ` [PATCH 77/94] ACPI: reboot.c: use new acpi_reset interface Len Brown
2009-01-09  9:27   ` [PATCH 78/94] ACPI: remove private acpica headers from driver files Len Brown
2009-01-09  9:27   ` [PATCH 80/94] ACPICA: Fixes for various ACPI data tables Len Brown
2009-01-09  9:27   ` [PATCH 81/94] ACPICA: Add ACPI_MUTEX_TYPE configuration option Len Brown
2009-01-09  9:27   ` [PATCH 82/94] ACPICA: FADT parsing changes and fixes Len Brown
2009-01-09  9:27   ` [PATCH 83/94] ACPICA: FADT: set acpi_gbl_use_default_register_widths to TRUE by default Len Brown
2009-01-09  9:27   ` [PATCH 84/94] ACPICA: FADT: Update error msgs for consistency Len Brown
2009-01-09  9:27   ` [PATCH 85/94] ACPICA: Update version to 20081204 Len Brown
2009-01-09  9:27   ` [PATCH 86/94] ACPICA: delete acdisasm.h Len Brown
2009-01-09  9:27   ` [PATCH 87/94] ACPICA: delete utcache.c Len Brown
2009-01-09  9:27   ` [PATCH 88/94] fujitsu-laptop: Add BL power, LED control and radio state information Len Brown
2009-01-09  9:27   ` [PATCH 89/94] fujitsu-laptop: Simplify SBLL/SBL2 backlight handling Len Brown
2009-01-09  9:27   ` [PATCH 90/94] ACPI: Avoid array address overflow when _CST MWAIT hint bits are set Len Brown
2009-01-09  9:27   ` [PATCH 91/94] ACPI : Use RSDT instead of XSDT by adding boot option of "acpi=rsdt" Len Brown
2009-01-09  9:27   ` [PATCH 92/94] ACPI: fix build warning Len Brown
2009-01-09  9:27   ` [PATCH 93/94] ACPICA: create acpica/ directory Len Brown
2009-01-09  9:27   ` [PATCH 94/94] ACPICA: hide private headers Len Brown
2009-01-09 12:06 ` ACPI & Suspend related patches for 2.6.29 Rafael J. Wysocki
2009-01-09 20:04   ` Len Brown

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=c5279dee26c0e8d7c4200993bfc4b540d2469598.1231492606.git.len.brown@intel.com \
    --to=lenb@kernel.org \
    --cc=astarikovskiy@suse.de \
    --cc=len.brown@intel.com \
    --cc=linux-acpi@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.