Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 26 Feb 2017 00:09:43 -0700
From:      Warner Losh <imp@bsdimp.com>
To:        John Baldwin <jhb@freebsd.org>
Cc:        Warner Losh <imp@freebsd.org>, src-committers <src-committers@freebsd.org>, "svn-src-all@freebsd.org" <svn-src-all@freebsd.org>,  "svn-src-head@freebsd.org" <svn-src-head@freebsd.org>
Subject:   Re: svn commit: r314250 - in head/sys: arm/mv arm/nvidia arm/versatile arm/xscale/i8134x arm/xscale/ixp425 dev/acpica dev/hyperv/pcib dev/ofw dev/pci dev/xen/pcifront mips/adm5120 mips/atheros mips/cav...
Message-ID:  <CANCZdfpZFGiQMTa%2BFR%2BXaHEgo_Sbbp-Nj-9zAO0PFXvGRk2FSA@mail.gmail.com>
In-Reply-To: <3310124.BntCrrpGtA@ralph.baldwin.cx>
References:  <201702250611.v1P6BxIY083971@repo.freebsd.org> <3310124.BntCrrpGtA@ralph.baldwin.cx>

next in thread | previous in thread | raw e-mail | index | archive | help
On Sat, Feb 25, 2017 at 11:28 PM, John Baldwin <jhb@freebsd.org> wrote:
> On Saturday, February 25, 2017 06:11:59 AM Warner Losh wrote:
>> Author: imp
>> Date: Sat Feb 25 06:11:59 2017
>> New Revision: 314250
>> URL: https://svnweb.freebsd.org/changeset/base/314250
>>
>> Log:
>>   Convert PCIe Hot Plug to using pci_request_feature
>>
>>   Convert PCIe hot plug support over to asking the firmware, if any, for
>>   permission to use the HotPlug hardware. Implement pci_request_feature
>>   for ACPI. All other host pci connections to allowing all valid feature
>>   requests.
>>
>>   Sponsored by: Netflix
>
> This lost one good feature from the first version:
>
>> @@ -722,3 +720,25 @@ acpi_pcib_acpi_release_resource(device_t
>>  }
>>  #endif
>>  #endif
>> +
>> +static int
>> +acpi_pcib_request_feature(device_t pcib, device_t dev, enum pci_feature feature)
>> +{
>> +     uint32_t osc_ctl;
>> +     struct acpi_hpcib_softc *sc;
>> +
>> +     sc = device_get_softc(dev);
>> +
>> +     switch (feature) {
>> +     case PCI_FEATURE_HP:
>> +             osc_ctl = PCIM_OSC_CTL_PCIE_HP;
>> +             break;
>> +     case PCI_FEATURE_AER:
>> +             osc_ctl = PCIM_OSC_CTL_PCIE_AER;
>> +             break;
>> +     default:
>> +             return (EINVAL);
>> +     }
>> +
>> +     return (acpi_pcib_osc(sc, osc_ctl));
>> +}
>
> We should check for the desired 'osc_ctl' in the already-enabled
> sc->ap_osc_ctl and not bother invoking _OSC if the specific feature
> has already been granted.

OK. I think I must have misunderstood your comments. I'd gotten the
impression thought you wanted me to remove it, so I did. It's easy
enough to add back. For current uses, it won't matter, but it might in
the future.

Warner



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CANCZdfpZFGiQMTa%2BFR%2BXaHEgo_Sbbp-Nj-9zAO0PFXvGRk2FSA>