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

Rafael J. Wysocki
2008-09-26T15:51:44Z

On Friday, 26 of September 2008, Alexey Starikovskiy wrote:
> Rafael J. Wysocki wrote:
> > On Friday, 26 of September 2008, Alexey Starikovskiy wrote:
> >
> >> Rafael J. Wysocki wrote:
> >>
> >>>> He refers to the ec->curr (former ec->t).
> >>>>
> >>> Hm, I'm not sure what the failing scenario in this case would be.
> >>>
> >> Last one was the thread of the stack is killed during transaction,
> >> thus stack vanishes and interrupt goes over freed memory.
> >>
> >
> > This isn't possible IMO. The thread is uninterruptible while waiting for the
> > transaction to finish (if I'm not mistaken).
> >
> Right, I already explained it to Yakui, this is why he only claims
> "ugly" now.
> > That said, we can still embed 'curr' in 'struct acpi_ec' and do
> > 'ec.curr = t' instead of 'ec->curr = &t' in acpi_ec_transaction_unlocked().
> > Now, if 'command' is embedded in 'curr', it will be sufficient to do
> > 'if (curr.command)' instead of doing 'if (ec->curr)', wherever applicable.
> >
> No, I like current way more. Now it is not possible to use transaction
> data if
> acpi_ec_transaction is not on the stack.

OK