RE: [PATCH] ACPI: EC: do transaction from interrupt context

Zhao, Yakui
2008-09-26T13:54:56Z

Alan gives a suggestion that after processing the EC notification event, EC driver
should continue to issue the query command and process the EC notification event until the query command returns zero.
But this suggestion will break my laptop. On my laptop when issuing the query command, a non-zero query event is returned but it can't be processed.(There is no corresponding ACPI _Qxx object). At the same time the SCI_EVT bit won't be cleared. In such case OS can't exit the function of acpi_ec_query_handler, which causes that the acpid kernel thread can't work well.

In fact according to my analysis IMO Alexey's patch will break my laptop. But now the laptop is not in my hand and I can't do the test. After I own the laptop again, I will do the test and attach the corresponding info.

At the same time there are two generic issues in this patch:
a. spin_lock is overkill. When 2000 EC I/O read/write are executed, the CPU interrupt will be disabled for about 1.5ms. This will affect the normal laptops.
b. the local variable that resides in process stack space is used in interrupt-context.

Best regards.

-----Original Message-----
From: Rafael J. Wysocki [mailto:rjw@sisk.pl]
Sent: 2008年9月26日 20:34
To: Zhao, Yakui
Cc: Sitsofe Wheeler; Alexey Starikovskiy; LenBrown; Linux-acpi@vger.kernel.org
Subject: Re: [PATCH] ACPI: EC: do transaction from interrupt context

On Friday, 26 of September 2008, Zhao Yakui wrote:
> On Thu, 2008-09-25 at 18:52 +0100, Sitsofe Wheeler wrote:
> > Alexey Starikovskiy wrote:
> > > It is easier and faster to do transaction directly from interrupt context
> > > rather than waking control thread.
> > > Also, cleaner GPE storm avoidance is implemented.
> Hi, Sitsofe
> I think that the problem on the asus-EEEPC can't be resolved really
> by the Alexey's patch. IMO it is only lucky.
> In fact the main problem on Asus-EEEPC is related with the broken EC.
> Before an EC notification event is processed, another EC notification
> event arrives again.
> If EC driver check whether the SCI_EVT bit is set after processing
> one EC notification event, the problem will be resolved.
> http://bugzilla.kernel.org/show_bug.cgi?id=11089
> Alan Jenkins already sent a patch about how to fix the issue on the
> Asus-EEEPC.
>
> But if the above patch is merged , maybe it will break some laptops.
> On my laptop when issuing the query command, a non-zero query event is
> returned but it can't be processed.(There is no corresponding ACPI _Qxx
> object). At the same time the SCI_EVT bit won't be cleared. In such case
> OS can't exit the function of acpi_ec_query_handler, which causes that
> the acpid kernel thread can't work well.

So does the patch break your box as a result?

Rafael
--
To unsubscribe from this list: send the line "unsubscribe linux-acpi" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html