From owner-svn-src-all@freebsd.org Sun Feb 26 06:39:02 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EC9E3CEE51A; Sun, 26 Feb 2017 06:39:02 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from mail.baldwin.cx (bigwig.baldwin.cx [96.47.65.170]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C8FB4634; Sun, 26 Feb 2017 06:39:02 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from ralph.baldwin.cx (c-73-231-226-104.hsd1.ca.comcast.net [73.231.226.104]) by mail.baldwin.cx (Postfix) with ESMTPSA id AA6B710A791; Sun, 26 Feb 2017 01:38:54 -0500 (EST) From: John Baldwin To: Warner Losh Cc: src-committers@freebsd.org, svn-src-all@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... Date: Sat, 25 Feb 2017 22:28:33 -0800 Message-ID: <3310124.BntCrrpGtA@ralph.baldwin.cx> User-Agent: KMail/4.14.10 (FreeBSD/11.0-STABLE; KDE/4.14.10; amd64; ; ) In-Reply-To: <201702250611.v1P6BxIY083971@repo.freebsd.org> References: <201702250611.v1P6BxIY083971@repo.freebsd.org> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.4.3 (mail.baldwin.cx); Sun, 26 Feb 2017 01:38:54 -0500 (EST) X-Virus-Scanned: clamav-milter 0.99.2 at mail.baldwin.cx X-Virus-Status: Clean X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 Feb 2017 06:39:03 -0000 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. -- John Baldwin