RE: [PATCH] ACPICA / hwreg: Use acpi_gbl_reduced_hardware to prevent accessing PM registers

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

 




> -----Original Message-----
> From: Duran, Leo [mailto:leo.duran@xxxxxxx]
> Sent: Wednesday, September 18, 2013 8:53 PM
> To: Moore, Robert; 'Hanjun Guo'
> Cc: Box, David E; 'linaro-kernel@xxxxxxxxxxxxxxxx'; 'patches@xxxxxxxxxx';
> 'linaro-acpi@xxxxxxxxxxxxxxxx'; 'Rafael J. Wysocki'; 'linux-
> acpi@xxxxxxxxxxxxxxx'; Zheng, Lv; 'Len Brown'
> Subject: RE: [PATCH] ACPICA / hwreg: Use acpi_gbl_reduced_hardware to
> prevent accessing PM registers
> 
> Ummh...
> 
> > -----Original Message-----
> > From: linaro-acpi-bounces@xxxxxxxxxxxxxxxx [mailto:linaro-acpi-
> > bounces@xxxxxxxxxxxxxxxx] On Behalf Of Moore, Robert
> > Sent: Wednesday, September 18, 2013 9:38 PM
> > To: 'Hanjun Guo'
> > Cc: Box, David E; 'linaro-kernel@xxxxxxxxxxxxxxxx';
> > 'patches@xxxxxxxxxx'; 'linaro-acpi@xxxxxxxxxxxxxxxx'; 'Rafael J.
> > Wysocki'; 'linux-acpi@xxxxxxxxxxxxxxx'; Zheng, Lv; 'Len Brown'
> > Subject: Re: [Linaro-acpi] [PATCH] ACPICA / hwreg: Use
> > acpi_gbl_reduced_hardware to prevent accessing PM registers
> >
> > While we are at it, here is the *complete* list of ACPICA interfaces
> > that are meaningless on a hardware-reduced platform.
> 
> Events are supported by hw-reduced ACPI 5.0, just in a different (non-
> legacy) way: GPIO-signaled events.
> So I'm wondering if perhaps a bit of refactoring is in order, rather than
> complete removal of all those functions?
> Leo
> 


GPIO events are drastically different than any other ACPI events. The model that ACPICA is using for these is that the native GPIO driver loads on detection of a GPIO _HID during the device detection namespace walk. Then:

Text from the ACPI specification below. Comments in parentheses are mine:

OSPM (GPIO driver) handles GPIO-signaled events as follows:
* The GPIO interrupt is handled by OSPM (GPIO driver) because it is listed in the _AEI object under a GPIO controller.
* When the event fires, OSPM (GPIO driver) handles the interrupt according to its mode and invokes the _EVT method (via AcpiEvaluateObject), passing it the pin number of the event.
* From this point on, handling is exactly like that for GPEs. The _EVT method does a Notify() on the appropriate device, (AcpiInstallNotifyHandler) and OS-specific mechanisms are used to notify the driver of the event.

None of the ACPICA interfaces below are required for this sequence of events.

Bob



> > If we are going to dynamically disable some of these interfaces, we
> > will need to disable all of them -- for completeness. So, this is
> > actually not a trivial change.
> >
> > I'll let the linux experts chime in on this one.
> > Bob
> >
> >
> > AcpiInstallSciHandler
> > AcpiRemoveSciHandler
> > AcpiInstallGlobalEventHandler
> > AcpiInstallFixedEventHandler
> > AcpiRemoveFixedEventHandler
> > AcpiInstallGpeHandler
> > AcpiRemoveGpeHandler
> > AcpiAcquireGlobalLock
> > AcpiReleaseGlobalLock
> > AcpiEnable
> > AcpiDisable
> > AcpiEnableEvent
> > AcpiDisableEvent
> > AcpiClearEvent
> > AcpiGetEventStatus
> > AcpiUpdateAllGpes
> > AcpiEnableGpe
> > AcpiDisableGpe
> > AcpiSetGpe
> > AcpiSetupGpeForWake
> > AcpiSetGpeWakeMask
> > AcpiClearGpe
> > AcpiGetGpeStatus
> > AcpiFinishGpe
> > AcpiDisableAllGpes
> > AcpiEnableAllRuntimeGpes
> > AcpiInstallGpeBlock
> > AcpiRemoveGpeBlock
> > AcpiGetGpeDevice
> > AcpiGetTimerResolution
> > AcpiGetTimer
> > AcpiGetTimerDuration
> > AcpiReadBitRegister
> > AcpiWriteBitRegister
> > AcpiSetFirmwareWakingVector
> > AcpiSetFirmwareWakingVector64
> > AcpiEnterSleepStateS4bios
> >
> >
> >
> >
> >
> >
> >
> > > -----Original Message-----
> > > From: Moore, Robert
> > > Sent: Wednesday, September 18, 2013 8:09 AM
> > > To: Hanjun Guo
> > > Cc: 'Rafael J. Wysocki'; 'Len Brown'; Box, David E; Zheng, Lv;
> > 'linux-
> > > acpi@xxxxxxxxxxxxxxx'; 'patches@xxxxxxxxxx'; 'linaro-
> > > kernel@xxxxxxxxxxxxxxxx'; 'linaro-acpi@xxxxxxxxxxxxxxxx'
> > > Subject: RE: [PATCH] ACPICA / hwreg: Use acpi_gbl_reduced_hardware
> > > to prevent accessing PM registers
> > >
> > >
> > >
> > > > -----Original Message-----
> > > > From: Hanjun Guo [mailto:hanjun.guo@xxxxxxxxxx]
> > > > Sent: Wednesday, September 18, 2013 2:32 AM
> > > > To: Moore, Robert
> > > > Cc: 'Rafael J. Wysocki'; 'Len Brown'; Box, David E; Zheng, Lv;
> > 'linux-
> > > > acpi@xxxxxxxxxxxxxxx'; 'patches@xxxxxxxxxx'; 'linaro-
> > > > kernel@xxxxxxxxxxxxxxxx'; 'linaro-acpi@xxxxxxxxxxxxxxxx'
> > > > Subject: Re: [PATCH] ACPICA / hwreg: Use acpi_gbl_reduced_hardware
> > to
> > > > prevent accessing PM registers
> > > >
> > > > On 2013-9-17 1:26, Moore, Robert wrote:
> > > > > + #define ACPI_REDUCED_HARDWARE           TRUE
> > > > >
> > > > > The intent of this feature is of course, to remove all code that
> > is
> > > > > not
> > > > needed -- specifically for hardware-reduced machines where the
> > > > size
> > of
> > > > the kernel is important.
> > > > >
> > > > > On a larger machine, the hardware-reduced flag should be
> > sufficient.
> > > > However, I would think that the host OS would look at this flag
> > > > and realize that it should not be doing certain ACPI
> > > > hardware-related things up front, rather than later when it finds
> > > > out that a write
> > to
> > > > some ACPI hardware fails because the hardware isn't there.
> > > >
> > > > Do you mean we should change the ACPI device driver instead of
> > > > changing the ACPICA code? that would be a hard job, because
> > hardware
> > > > ACPI is used everywhere.
> > > >
> > >
> > >
> > > I don't really know the answer to this, but something tells me that
> > bad
> > > things may happen when a driver expects the ACPI hardware to be
> > there, and
> > > it finds out that it isn't, simply by calling one of the ACPI
> > hardware
> > > interfaces.
> > >
> > > Or, we could word it this way: if a driver is expecting the ACPI
> > hardware
> > > to exist, and we are running on a hardware-reduced platform, why is
> > the
> > > driver being loaded in the first place?
> > >
> > > BTW, hardware-reduced is not restricted to ARM platforms.
> > >
> > >
> > >
> > >
> > > > Thanks
> > > > Hanjun
> > > >
> > > > >
> > > > > This is not to say that it is probably a good thing to return an
> > > > > error
> > > > from the ACPI hardware code in the hardware-reduced case.
> > > > >
> > > > > Bob
> > > > >
> > > >
> >
> >
> > _______________________________________________
> > Linaro-acpi mailing list
> > Linaro-acpi@xxxxxxxxxxxxxxxx
> > http://lists.linaro.org/mailman/listinfo/linaro-acpi
> 

--
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




[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