You are not logged in.

#1 2011-12-15 19:50:45

dare023
Member
Registered: 2010-04-21
Posts: 64

Laptop starts when adapter is plugged in

I found some similar threads,but my problem is little different.
I have a Acer 5735 laptop,and using it with patched kernel (now 3.0.8)  due to this bug :https://bugs.archlinux.org/task/17821
This is patch that must be used to be able to run any Linux os,if not there is number of problems,like lags,unable to watch video and biggest of all - no booting until battery is pulled of for 10-20 seconds.

Index: linux-2.6/drivers/acpi/ec.c
===================================================================
--- linux-2.6.orig/drivers/acpi/ec.c
+++ linux-2.6/drivers/acpi/ec.c
@@ -223,6 +223,7 @@ static int ec_poll(struct acpi_ec *ec)
 				if (ec_transaction_done(ec))
 					return 0;
 			} else {
+				msleep(1);
 				if (wait_event_timeout(ec->wait,
 						ec_transaction_done(ec),
 						msecs_to_jiffies(1)))
@@ -230,8 +231,8 @@ static int ec_poll(struct acpi_ec *ec)
 			}
 			advance_transaction(ec, acpi_ec_read_status(ec));
 		} while (time_before(jiffies, delay));
-		if (acpi_ec_read_status(ec) & ACPI_EC_FLAG_IBF)
-			break;
+//		if (acpi_ec_read_status(ec) & ACPI_EC_FLAG_IBF)
+//			break;
 		pr_debug(PREFIX "controller reset, restart transaction\n");
 		spin_lock_irqsave(&ec->curr_lock, flags);
 		start_transaction(ec);
@@ -268,6 +269,15 @@ static int ec_check_ibf0(struct acpi_ec
 	return (status & ACPI_EC_FLAG_IBF) == 0;
 }
 
+/* try to clean input buffer with burst_disable transaction */
+static int acpi_ec_clean_buffer(struct acpi_ec *ec)
+{
+	struct transaction t = {.command = ACPI_EC_BURST_DISABLE,
+				.wdata = NULL, .rdata = NULL,
+				.wlen = 0, .rlen = 0};
+	return acpi_ec_transaction_unlocked(ec, &t);
+}
+
 static int ec_wait_ibf0(struct acpi_ec *ec)
 {
 	unsigned long delay = jiffies + msecs_to_jiffies(ec_delay);
@@ -276,7 +286,7 @@ static int ec_wait_ibf0(struct acpi_ec *
 		if (wait_event_timeout(ec->wait, ec_check_ibf0(ec),
 					msecs_to_jiffies(1)))
 			return 0;
-	return -ETIME;
+	return acpi_ec_clean_buffer(ec);
 }
 
 static int acpi_ec_transaction(struct acpi_ec *ec, struct transaction *t)

In most cases laptop  runs fine,but when battery is drained to a critical level,and turned off - when I plug-in adapter laptop just starts,and lid is closed.
I use kde,system is updated,acpi-cpufreq module is loaded,and kde power manager is handling performance (on adapter),and powersave (on battery) governors,guess there is no problem there,and have no other problems  with laptop.   
There is one strange thing:when that happens bluetooth button is turned on,but stays off otherwise.
Can somebody explain whats is happening here?
Not that this is a big problem,but if can be solved....
Edit : Just remembered - sometimes instead shutdown laptop restarts

Last edited by dare023 (2011-12-16 05:29:14)

Offline

#2 2012-01-22 11:56:43

dare023
Member
Registered: 2010-04-21
Posts: 64

Re: Laptop starts when adapter is plugged in

Sorry for double posting,but this is getting totally random,and it is very annoying.
Almost every time I turn laptop off and plug in power adapter laptop boots ,no matter that lid is closed.
Any suggestions?

Offline

Board footer

Powered by FluxBB