On Wed, 2008-09-03 at 11:53 +0400, Alexey Starikovskiy wrote: > Zhao Yakui wrote: > > On Wed, 2008-09-03 at 10:46 +0400, Alexey Starikovskiy wrote: > >> Zhao Yakui wrote: > >>> On Tue, 2008-09-02 at 00:59 +0400, Alexey Starikovskiy wrote: > >>>> Alexey Starikovskiy wrote: > >>> Hi, Alexey > >>> In this patch after the EC timeout happens, the EC_FLAGS_GPE_MODE of > >>> ec->flags will be clear and EC_FLAGS_NO_GPE bit will be set. But the EC > >>> GPE won't be disabled again. Right? > >> Right > >>> In such case when EC is accessed, EC will work in polling mode. At > >>> the same time EC interrupt still can be triggered. But the > >>> EC_FLAGS_GPE_MODE can't be set again. Right? > >> Almost. EC by itself (hardware device) still will be working in its > >> "optimized gpe mode" as before, but EC driver (software) will be working in poll mode. > >> Regards, > > If EC always works in such mode, it seems that we can make EC work more > > simply. > If you _disable_ EC GPE or not enable it in first place, EC(hardware) will be working in > poll mode. So, there is no spare code to clean up, sorry. Not understand what you said. After your three patches hit the upstream kernel, the EC GPE is still enabled when EC timeout happens. In such case when EC is accessed, EC will work in polling mode. At the same time EC GPE interrupt still can be triggered. If so, maybe it is also reasonable that EC always works in such mode after the ACPI EC driver is loaded fully.(ACPI EC device is bound with the ACPI EC driver). a. EC GPE interrupt can be triggered b. When EC internal register is accessed, EC driver works in polling mode. If EC always works in above mode, the working flowchart in EC driver can be simplified. a. The mode switch from polling mode to interrupt mode is useless b. Some flags are also useless. (For example: WAIT_GPE/RESCHEDULE_POLL/FLAGS_NO_GPE) c. polling timer is useless d. In EC GPE interrupt handler we can only care the EC notification event.(The SCI_EVT bit of EC status register). > > If so, a lot of source code in EC will be useless and we can do a > > cleanup. After this, the EC driver will be easier to understand. When > > new problems appears, we can easily identify the root cause. > > > > Thanks. > > Yakui -- To unsubscribe from this list: send the line "unsubscribe linux-acpi" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html