mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: jmerkey@wolfmountaingroup.com
To: "Alexey Starikovskiy" <astarikovskiy@suse.de>
Cc: jmerkey@wolfmountaingroup.com, linux-kernel@vger.kernel.org
Subject: Re: 2.6.27-rc5 acpi: EC Storm error message on bootup
Date: Tue, 9 Sep 2008 08:51:47 -0600 (MDT)	[thread overview]
Message-ID: <1044.69.2.248.210.1220971907.squirrel@webmail.wolfmountaingroup.com> (raw)
In-Reply-To: <48C60685.60303@suse.de>

> It does not disable EC, it disables EC GPE (interrupt from EC).
> Could you please test patch from comment #81 in bug #9998?
> http://bugzilla.kernel.org/attachment.cgi?id=17695&action=view
>
> Thanks,
> Alex.

Patch does not apply correctly to 2.6.27-rc5 -- do you have a patch a
little closer to 2.6.27-rc6?

Here is what ended up in the .rej file after I applied it:

***************
*** 140,208 ****
  	outb(data, ec->data_addr);
  }

- static inline int acpi_ec_check_status(struct acpi_ec *ec, enum ec_event
event)
  {
- 	if (test_bit(EC_FLAGS_WAIT_GPE, &ec->flags))
- 		return 0;
- 	if (event == ACPI_EC_EVENT_OBF_1) {
- 		if (acpi_ec_read_status(ec) & ACPI_EC_FLAG_OBF)
- 			return 1;
- 	} else if (event == ACPI_EC_EVENT_IBF_0) {
- 		if (!(acpi_ec_read_status(ec) & ACPI_EC_FLAG_IBF))
- 			return 1;
- 	}
-
  	return 0;
  }

- static void ec_schedule_ec_poll(struct acpi_ec *ec)
  {
- 	if (test_bit(EC_FLAGS_RESCHEDULE_POLL, &ec->flags))
- 		schedule_delayed_work(&ec->work,
- 				      msecs_to_jiffies(ACPI_EC_DELAY));
  }

- static void ec_switch_to_poll_mode(struct acpi_ec *ec)
  {
  	set_bit(EC_FLAGS_NO_GPE, &ec->flags);
  	clear_bit(EC_FLAGS_GPE_MODE, &ec->flags);
- 	acpi_disable_gpe(NULL, ec->gpe, ACPI_NOT_ISR);
- 	set_bit(EC_FLAGS_RESCHEDULE_POLL, &ec->flags);
  }

- static int acpi_ec_wait(struct acpi_ec *ec, enum ec_event event, int
force_poll)
  {
- 	atomic_set(&ec->irq_count, 0);
- 	if (likely(test_bit(EC_FLAGS_GPE_MODE, &ec->flags)) &&
- 	    likely(!force_poll)) {
- 		if (wait_event_timeout(ec->wait, acpi_ec_check_status(ec, event),
- 				       msecs_to_jiffies(ACPI_EC_DELAY)))
- 			return 0;
- 		clear_bit(EC_FLAGS_WAIT_GPE, &ec->flags);
- 		if (acpi_ec_check_status(ec, event)) {
- 			/* missing GPEs, switch back to poll mode */
- 			if (printk_ratelimit())
- 				pr_info(PREFIX "missing confirmations, "
- 						"switch off interrupt mode.\n");
- 			ec_switch_to_poll_mode(ec);
- 			ec_schedule_ec_poll(ec);
- 			return 0;
- 		}
- 	} else {
- 		unsigned long delay = jiffies + msecs_to_jiffies(ACPI_EC_DELAY);
- 		clear_bit(EC_FLAGS_WAIT_GPE, &ec->flags);
- 		while (time_before(jiffies, delay)) {
- 			if (acpi_ec_check_status(ec, event))
- 				return 0;
- 			msleep(1);
- 		}
- 		if (acpi_ec_check_status(ec,event))
- 			return 0;
  	}
- 	pr_err(PREFIX "acpi_ec_wait timeout, status = 0x%2.2x, event = %s\n",
- 		acpi_ec_read_status(ec),
- 		(event == ACPI_EC_EVENT_OBF_1) ? "\"b0=1\"" : "\"b1=0\"");
- 	return -ETIME;
  }

  static int acpi_ec_transaction_unlocked(struct acpi_ec *ec, u8 command,
--- 159,219 ----
  	outb(data, ec->data_addr);
  }

+ static int ec_transaction_done(struct acpi_ec *ec)
  {
+ 	if (!ec_read_command(ec))
+ 		return 1;
+ 	if (!ec->t.wlen && !ec->t.rlen)
+ 		return 1;
  	return 0;
  }

+ static void gpe_transaction(struct acpi_ec *ec, u8 status)
  {
+ 	if (!ec_read_command(ec))
+ 		return;
+ 	if (ec->t.wlen > 0) {
+ 		if ((status & ACPI_EC_FLAG_IBF) == 0) {
+ 			acpi_ec_write_data(ec, *(ec->t.wdata++));
+ 			--ec->t.wlen;
+ 		} else
+ 			/* false interrupt, state didn't change */
+ 			atomic_inc(&ec->irq_count);
+
+ 	} else if (ec->t.rlen > 0) {
+ 		if ((status & ACPI_EC_FLAG_OBF) == 1) {
+ 			*(ec->t.rdata++) = acpi_ec_read_data(ec);
+ 			--ec->t.rlen;
+ 		} else
+ 			/* false interrupt, state didn't change */
+ 			atomic_inc(&ec->irq_count);
+ 	}
  }

+ static int acpi_ec_wait(struct acpi_ec *ec)
  {
+ 	if (wait_event_timeout(ec->wait, ec_transaction_done(ec),
+ 			       msecs_to_jiffies(ACPI_EC_DELAY)))
+ 		return 0;
+ 	/* missing GPEs, switch back to poll mode */
+ 	if (printk_ratelimit())
+ 		pr_info(PREFIX "missing confirmations, "
+ 				"switch off interrupt mode.\n");
  	set_bit(EC_FLAGS_NO_GPE, &ec->flags);
  	clear_bit(EC_FLAGS_GPE_MODE, &ec->flags);
+ 	return 1;
  }

+ static void acpi_ec_gpe_query(void *ec_cxt);
+
+ static int ec_check_sci(struct acpi_ec *ec, u8 state)
  {
+ 	if (state & ACPI_EC_FLAG_SCI) {
+ 		if (!test_and_set_bit(EC_FLAGS_QUERY_PENDING, &ec->flags))
+ 			return acpi_os_execute(OSL_EC_BURST_HANDLER,
+ 				acpi_ec_gpe_query, ec);
  	}
+ 	return 0;
  }

  static int acpi_ec_transaction_unlocked(struct acpi_ec *ec, u8 command,

Jeff


  reply	other threads:[~2008-09-09 15:22 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-09-02 21:27 jmerkey
2008-09-09  5:15 ` Alexey Starikovskiy
2008-09-09 14:51   ` jmerkey [this message]
2008-09-09 14:59     ` jmerkey
2008-09-09 17:35       ` Alexey Starikovskiy
2008-09-09 17:53         ` jmerkey
2008-09-09 19:30         ` jmerkey

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=1044.69.2.248.210.1220971907.squirrel@webmail.wolfmountaingroup.com \
    --to=jmerkey@wolfmountaingroup.com \
    --cc=astarikovskiy@suse.de \
    --cc=linux-kernel@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®