From owner-svn-src-all@freebsd.org Sun Feb 26 07:09:45 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 439AFCEEACB for ; Sun, 26 Feb 2017 07:09:45 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-it0-x22a.google.com (mail-it0-x22a.google.com [IPv6:2607:f8b0:4001:c0b::22a]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 07B0C142 for ; Sun, 26 Feb 2017 07:09:45 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-it0-x22a.google.com with SMTP id 203so49558044ith.0 for ; Sat, 25 Feb 2017 23:09:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=PhQn8PexhU580Tpwk3xJMgJPCcI8TBoWr67dWgtf5+A=; b=etTGQ1XckzESB7Pu0RyZp3G5719ffIvUjctGgv1v89cbYgo9HrQlTtPn/YMkYV3vhd NMjQSDdBmogfwDABEgFwfgHXHB32sncmR+15CCGplhqnZGtTyuq5bCOlMtWwE+WYRUl7 2sCqgz+5PWTy9K2hasmOzIQCIZ/L6LjDLh6bsSG2XoWuIBIx43PZzH/tpxhpoc66DOyT izxBTwFgp26r82JcXCHfLAdcAfRL8jky+e71jUzE2HH6Rd9h69JKg1T2udCreOGr4Ymp C9B3e7CB7u0NnnJlTmbND4qiqJUhjTTUUS8x00Zq4poQ/fx83HNJ4dCxO38sRBtOEHkY 7V6w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=PhQn8PexhU580Tpwk3xJMgJPCcI8TBoWr67dWgtf5+A=; b=PjZjA0jlv6cikf9EzbIsMRBJs/MHLt0dh1uy2FXGmnUexAaWDeqeDfU7IBdNL1nR7f GQUMo2rIeDMfUcWufng2i24NgVfQXTzbnt8Jb82D2OO4YBz6ALXAwFo5woZf9Onvw0Xr yK0kBxCKKZyokD6lO0JSo/BT8PF8pLoKaZJP3U3ThV8Sv3YdR4CULY4UgrennDLnfpgm vgw1mmkfhVrBCuyjmAQQWWWqtzEvmERGeLhtIjPOI3MMLQSQr3hY5ssyY7IctsarMowA f2wpxkUDxXXaNP+ZF3vjPlDa+rM/+vJm2nxt3zaqx7BehBiDXs3ceBOBV9zJw7YQGrGR 3i9Q== X-Gm-Message-State: AMke39nsI6j82hnfw5eDXb+EmCO+vbV9fHK8RN+xDmfP4eUKwLNm5avOPlUcb8vmRiIdEQTJXqXFi4864lBbIQ== X-Received: by 10.36.116.71 with SMTP id o68mr10583536itc.60.1488092984134; Sat, 25 Feb 2017 23:09:44 -0800 (PST) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 10.79.145.132 with HTTP; Sat, 25 Feb 2017 23:09:43 -0800 (PST) X-Originating-IP: [69.53.245.200] In-Reply-To: <3310124.BntCrrpGtA@ralph.baldwin.cx> References: <201702250611.v1P6BxIY083971@repo.freebsd.org> <3310124.BntCrrpGtA@ralph.baldwin.cx> From: Warner Losh Date: Sun, 26 Feb 2017 00:09:43 -0700 X-Google-Sender-Auth: As_dtD7-ZCK-AFe3MDj0W_2u6eE Message-ID: 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... To: John Baldwin Cc: Warner Losh , src-committers , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 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 07:09:45 -0000 On Sat, Feb 25, 2017 at 11:28 PM, John Baldwin 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