public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] resolve ACPI oops on boot
@ 2002-07-18 21:15 Dominik Brodowski
  2002-07-23 21:20 ` Bill Davidsen
  0 siblings, 1 reply; 5+ messages in thread
From: Dominik Brodowski @ 2002-07-18 21:15 UTC (permalink / raw)
  To: davej, torvalds; +Cc: linux-kernel

An u8 was casted into an u32, then all 32 bits were set to zero, this
causing another variable - in my case, processor flags - to be corrupted. 

Dominik

--- linux/drivers/acpi-original/ec.c	Fri Jul 12 22:43:11 2002
+++ linux/drivers/acpi/ec.c	Fri Jul 12 23:28:14 2002
@@ -134,7 +134,7 @@
 acpi_ec_read (
 	struct acpi_ec		*ec,
 	u8			address,
-	u8			*data)
+	u32			*data)
 {
 	acpi_status		status = AE_OK;
 	int			result = 0;
@@ -167,7 +167,7 @@
 		goto end;
 
 
-	acpi_hw_low_level_read(8, (u32*) data, &ec->data_addr, 0);
+	acpi_hw_low_level_read(8, data, &ec->data_addr, 0);
 
 	ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Read [%02x] from address [%02x]\n",
 		*data, address));
@@ -237,7 +237,7 @@
 static int
 acpi_ec_query (
 	struct acpi_ec		*ec,
-	u8			*data)
+	u32			*data)
 {
 	int			result = 0;
 	acpi_status		status = AE_OK;
@@ -269,7 +269,7 @@
 	if (result)
 		goto end;
 	
-	acpi_hw_low_level_read(8, (u32*) data, &ec->data_addr, 0);
+	acpi_hw_low_level_read(8, data, &ec->data_addr, 0);
 	if (!*data)
 		result = -ENODATA;
 
@@ -328,7 +328,7 @@
 {
 	acpi_status		status = AE_OK;
 	struct acpi_ec		*ec = (struct acpi_ec *) data;
-	u8			value = 0;
+	u32			value = 0;
 	unsigned long		flags = 0;
 	struct acpi_ec_query_data *query_data = NULL;
 
@@ -336,7 +336,7 @@
 		return;
 
 	spin_lock_irqsave(&ec->lock, flags);
-	acpi_hw_low_level_read(8, (u32*) &value, &ec->command_addr, 0);
+	acpi_hw_low_level_read(8, &value, &ec->command_addr, 0);
 	spin_unlock_irqrestore(&ec->lock, flags);
 
 	/* TBD: Implement asynch events!
@@ -398,6 +398,7 @@
 {
 	int			result = 0;
 	struct acpi_ec		*ec = NULL;
+	u32          		tmp = 0;
 
 	ACPI_FUNCTION_TRACE("acpi_ec_space_handler");
 
@@ -408,7 +409,8 @@
 
 	switch (function) {
 	case ACPI_READ:
-		result = acpi_ec_read(ec, (u8) address, (u8*) value);
+		result = acpi_ec_read(ec, (u8) address, &tmp);
+		*value = (acpi_integer) tmp;
 		break;
 	case ACPI_WRITE:
 		result = acpi_ec_write(ec, (u8) address, (u8) *value);


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2002-07-30 16:23 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-07-18 21:15 [PATCH] resolve ACPI oops on boot Dominik Brodowski
2002-07-23 21:20 ` Bill Davidsen
2002-07-23 22:55   ` Dominik Brodowski
2002-07-30 16:21     ` Bill Davidsen
2002-07-24 23:12   ` Matthew Harrell

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox