Re: [PATCH] gpiolib-acpi: Register GpioInt ACPI event handlers from a late_initcall

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Aug 13, 2018 at 05:53:43PM +0200, Hans de Goede wrote:
> Hi,
> 
> On 13-08-18 17:44, Mika Westerberg wrote:
> > On Sun, Aug 12, 2018 at 06:25:36PM +0200, Hans de Goede wrote:
> > > GpioInt ACPI event handlers may see there IRQ triggered immediately
> > > after requesting the IRQ (esp. level triggered ones). This means that they
> > > may run before any (builtin) other drivers have had a chance to register
> > > their OpRegion handlers, leading to errors like this:
> > > 
> > > [    1.133274] ACPI Error: No handler for Region [PMOP] ((____ptrval____)) [UserDefinedRegion] (20180531/evregion-132)
> > > [    1.133286] ACPI Error: Region UserDefinedRegion (ID=141) has no handler (20180531/exfldio-265)
> > > [    1.133297] ACPI Error: Method parse/execution failed \_SB.GPO2._L01, AE_NOT_EXIST (20180531/psparse-516)
> > > 
> > 
> > Hmm, according ACPI 6.2 spec (see chapter 6.5.4 explaining _REG method)
> > the AML code is not supposed to access OpRegions if they are not
> > available (e.g there is no driver loaded).
> 
> Sure, but there are plenty of cases where AML code does not always
> does that and even it where to do that, from an interrupt handler
> like this, that is probably a bad idea, since the handler will
> clear the interrupt cause, so what ever the code would have done
> if the OpRegion was in place now will not happen.
> 
> > Can you share the AML that triggers the above error?
> 
> Sure but as said there is plenty of AML code around not
> checking for OpRegions being registered, anyways:
> 
> https://fedorapeople.org/~jwrdegoede/acpidump.onda-v975w
> 
> Look for _L01 in the DSDT part, it is the VBUS access there
> which triggers these errors.

:-(

I'm pretty sure it fails even in Windows if the interrupt is triggered
before the corresponding handler is installed. I guess your solution at
least makes it working better with built-in drivers. For modules I think
we are still in the same situation but I don't have better ideas right
now.

Acked-by: Mika Westerberg <mika.westerberg@xxxxxxxxxxxxxxx>



[Index of Archives]     [Linux IBM ACPI]     [Linux Power Management]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]     [Linux Resources]

  Powered by Linux