Re: 2.6.27-rc5 acpi: EC Storm error message on bootup

From: jmerkey
Date: Tue Sep 09 2008 - 11:22:24 EST


> 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

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/