From patchwork Fri Sep 12 18:04:16 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bjorn Helgaas X-Patchwork-Id: 4897311 X-Patchwork-Delegate: bhelgaas@google.com Return-Path: X-Original-To: patchwork-linux-pci@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 7F48DBEEA5 for ; Fri, 12 Sep 2014 18:05:06 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 5387A2024C for ; Fri, 12 Sep 2014 18:05:05 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 87C7720254 for ; Fri, 12 Sep 2014 18:05:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751236AbaILSEp (ORCPT ); Fri, 12 Sep 2014 14:04:45 -0400 Received: from mail-ig0-f175.google.com ([209.85.213.175]:60446 "EHLO mail-ig0-f175.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752568AbaILSER (ORCPT ); Fri, 12 Sep 2014 14:04:17 -0400 Received: by mail-ig0-f175.google.com with SMTP id h15so966382igd.2 for ; Fri, 12 Sep 2014 11:04:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=subject:to:from:cc:date:message-id:in-reply-to:references :user-agent:mime-version:content-type:content-transfer-encoding; bh=FRATfe6sT6kR5evtyPOswNplOao9F3448lKLsfMbYZc=; b=o5Lsf2hng8mq6t0B45i+atlm8tX0gc0KN4q44pBfITtzcPcIFNq4Yf680bXW/G+ft+ m1oD/fseVYicHdFUANAv+0puN1r9WkHQpWUg5O0B70rAMqjG7yTXb0mCiD/jlLqrXe7r DCV/qTxVOthf7pzgWLNfQcjSpA9LNINrv7r2UJUjpkKpnx+jLXnx1HCKU7rPoTNR8Fg2 /cqxy2LY5g1uLPO87fJUg63r6BudiGRNmTTI5wvH234Y8XJj4K5jFTppjvW/UbINsZsg BAw1+kvA59wD0ot8mWCenHURsidt5qX9HAcEQA361HFZaV94FGyjlEY//GfK4xgJXBEl FFSw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:to:from:cc:date:message-id:in-reply-to :references:user-agent:mime-version:content-type :content-transfer-encoding; bh=FRATfe6sT6kR5evtyPOswNplOao9F3448lKLsfMbYZc=; b=bLSl7wUjliiiT/wyChBxQp6X5u8TCv8Ry3jkGg1sqNKyNZWgBxCnEMGS/NX/V0W5DQ 5ueiFytPcI1r/yU1ksihkMC1PPQQ0UprjNyJeW3eKDqIlqw1JV5GacAfr1CQjaOWeyA3 YPcaMOtn8MM3Tg5hlljVVmqq67FSLI5AoFacuDiYKQ4uEVcGL8ygmbAaQOxcBQcJ7ouY f5LrqWnKhWnAUMjJjEZO4BCUeVKcJb9KbE45H8FtW6pVhz90nKL5OgJn3EY2FLEA23eF 8GlnTE08MkFqXq84H7/sD7MYgvk0E9zprMI5Y0YibQ43KOLHS+fcC4CDa/y7IKfYAc10 b1VQ== X-Gm-Message-State: ALoCoQlchjxn9PkCXJCQCywyhzX4lxpL6ovOTshszwLJr8yTacdLP9qaAkYUYrfJ6f27gMgqpk+O X-Received: by 10.42.247.18 with SMTP id ma18mr11016371icb.27.1410545057422; Fri, 12 Sep 2014 11:04:17 -0700 (PDT) Received: from localhost ([172.16.49.108]) by mx.google.com with ESMTPSA id z5sm2075585igl.21.2014.09.12.11.04.16 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Fri, 12 Sep 2014 11:04:16 -0700 (PDT) Subject: [PATCH v1 13/13] PCI: Configure *all* devices, not just hot-added ones To: linux-pci@vger.kernel.org From: Bjorn Helgaas Cc: Rajat Jain , Linus Torvalds , "Rafael J. Wysocki" , linux-kernel@vger.kernel.org, linux-acpi@vger.kernel.org, Yinghai Lu Date: Fri, 12 Sep 2014 12:04:16 -0600 Message-ID: <20140912180415.1630.57583.stgit@bhelgaas-glaptop2.roam.corp.google.com> In-Reply-To: <20140912180141.1630.17120.stgit@bhelgaas-glaptop2.roam.corp.google.com> References: <20140912180141.1630.17120.stgit@bhelgaas-glaptop2.roam.corp.google.com> User-Agent: StGit/0.16 MIME-Version: 1.0 Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org X-Spam-Status: No, score=-9.0 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP There's not really a good way to determine whether firmware has already configured a device with _HPP/_HPX settings. On legacy systems, the BIOS has probably configured everything, but on UEFI systems it is not required to do so. Per the PCI Firmware Specification, rev 3.1, sec 3.5, if PCI_COMMAND_IO or PCI_COMMAND_MEMORY is set, we can assume firmware has set the corresponding BARs and maybe we can assume it has configured the rest of the device. And if a bridge has PCI_COMMAND_PARITY or PCI_COMMAND_SERR set, we can assume firmware has configured the bridge. But we can't tell much about devices without BARs. I think it should be safe to apply _HPP and _HPX settings anyway, even if firmware has already configured the device, so configure everything we find. Signed-off-by: Bjorn Helgaas --- drivers/pci/probe.c | 3 --- 1 file changed, 3 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe linux-pci" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/pci/probe.c b/drivers/pci/probe.c index cb411fbb6435..290c657da0b9 100644 --- a/drivers/pci/probe.c +++ b/drivers/pci/probe.c @@ -1358,9 +1358,6 @@ static void pci_configure_device(struct pci_dev *dev) struct hotplug_params hpp; int ret; - if (system_state == SYSTEM_BOOTING) - return; - memset(&hpp, 0, sizeof(hpp)); ret = pci_get_hp_params(dev, &hpp); if (ret)