Re: [PATCH 1/8] ACPI / PCI: Introduce acpi_pci_osc_control_query()

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

 



On Tuesday, August 03, 2010, Kenji Kaneshige wrote:
> (2010/08/03 6:53), Rafael J. Wysocki wrote:
> > From: Rafael J. Wysocki<rjw@xxxxxxx>
> >
> > Introduce a function allowing the caller to obtain a mask of _OSC
> > control bits the BIOS will allow the kernel to control for a given
> > PCI root bridge.
> >
> > Signed-off-by: Rafael J. Wysocki<rjw@xxxxxxx>
> > ---
> >   drivers/acpi/pci_root.c |   58 ++++++++++++++++++++++++++++++++++++++++--------
> >   include/linux/acpi.h    |    1
> >   2 files changed, 50 insertions(+), 9 deletions(-)
> >
> > Index: linux-2.6/drivers/acpi/pci_root.c
> > ===================================================================
> > --- linux-2.6.orig/drivers/acpi/pci_root.c
> > +++ linux-2.6/drivers/acpi/pci_root.c
> > @@ -225,21 +225,32 @@ static acpi_status acpi_pci_run_osc(acpi
> >   	return status;
> >   }
> >
> > -static acpi_status acpi_pci_query_osc(struct acpi_pci_root *root, u32 flags)
> > +static acpi_status acpi_pci_query_osc(struct acpi_pci_root *root,
> > +					u32 support,
> > +					u32 *control)
> >   {
> >   	acpi_status status;
> > -	u32 support_set, result, capbuf[3];
> > +	u32 result, capbuf[3];
> > +
> > +	support&= OSC_PCI_SUPPORT_MASKS;
> > +	support |= root->osc_support_set;
> >
> > -	/* do _OSC query for all possible controls */
> > -	support_set = root->osc_support_set | (flags&  OSC_PCI_SUPPORT_MASKS);
> >   	capbuf[OSC_QUERY_TYPE] = OSC_QUERY_ENABLE;
> > -	capbuf[OSC_SUPPORT_TYPE] = support_set;
> > -	capbuf[OSC_CONTROL_TYPE] = OSC_PCI_CONTROL_MASKS;
> > +	capbuf[OSC_SUPPORT_TYPE] = support;
> > +	if (control) {
> > +		*control&= OSC_PCI_CONTROL_MASKS;
> > +		capbuf[OSC_CONTROL_TYPE] = *control;
> 
> I think controls that are already granted to OS need to be ORed here.
> I.e.
> 
> 		capbuf[OSC_CONTROL_TYPE] = root->osc_control_set | *control;

That's correct.

Thanks,
Rafael
_______________________________________________
linux-pm mailing list
linux-pm@xxxxxxxxxxxxxxxxxxxxxxxxxx
https://lists.linux-foundation.org/mailman/listinfo/linux-pm


[Index of Archives]     [Linux ACPI]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [CPU Freq]     [Kernel Newbies]     [Fedora Kernel]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux