From patchwork Fri Sep 12 18:03:54 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bjorn Helgaas X-Patchwork-Id: 4897361 Return-Path: X-Original-To: patchwork-linux-acpi@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 6EF86BEEA6 for ; Fri, 12 Sep 2014 18:05:45 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 4F7C32021B for ; Fri, 12 Sep 2014 18:05:44 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 0DAEE20254 for ; Fri, 12 Sep 2014 18:05:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752461AbaILSEB (ORCPT ); Fri, 12 Sep 2014 14:04:01 -0400 Received: from mail-ie0-f173.google.com ([209.85.223.173]:42368 "EHLO mail-ie0-f173.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752399AbaILSD6 (ORCPT ); Fri, 12 Sep 2014 14:03:58 -0400 Received: by mail-ie0-f173.google.com with SMTP id x19so1380220ier.4 for ; Fri, 12 Sep 2014 11:03:58 -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=dZoZtWIG6ghKwh7F8haI+L3f/y3mJaBrMExhj5ojS8M=; b=kqfdKWuz4Z3E6xrC1+mUeuzPGzfccGqp/6p56EJO+uJvNFNOxY8SNyuRNCESnVxmwE Tlkq8MZXOd6fQNVw2tdCv10rKTXo0MU9K7v7FYRNxQKuFPSYtn9OpNDncamxuA6HmHKH pOl8n3I3dBqS7sX5Qu27pd/ZnZbsVx57yugsc/Uc5H98+mXh1SiB2y+LnmJalSQmI3YY XTvNHUaC5msTtV2wsuA7A44HqhTlCbT37n3Qm1+gREhbnPK0XtjSGgw3+o8mVdBhyCwy sbLmTMLN8vQC2d/lqW1Qr6LCGgeRcFBZeJTIo9cn2USAw6FyGCNY2gW8hIcu7/F4CNZl HhzQ== 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=dZoZtWIG6ghKwh7F8haI+L3f/y3mJaBrMExhj5ojS8M=; b=k6KRrLUNKXMsrSf6Op1s3p2C5/RiBvRmU2LifBkqnvTEkmjPWpHy0HISQ4gGvojp3j iZgxhFNB3cFxIZY07+LVSUT/b8FfyUgjX7nsbXlr4E84JxK/doilmPYbV53ZrG5c8ynl SZwOiT+Ywe0/rQJsteXEnqxfT2xuECwWAhnTmpmBUrR+jM4+Qi4B47P1ytE6uTkzrHdw HR8T5/9ss44LgrB5o9JQFMF6MpGfEXPp1GGeUpwKcUsbszmgnNKKaq565m7K0Zpvlcy9 psMTEJsdyfX9ayS1YOPovU9zI8w90tc38xPvU2G9bBihghUze9cE6ynN0hdZcr2nKL0t I7XQ== X-Gm-Message-State: ALoCoQm25u4nFievdNM694m5lcQfiN4TRNv3OYrxieHTYPVUkcBAIsjodP3Nghb/DGX5dGuQXXeY X-Received: by 10.42.237.197 with SMTP id kp5mr11550886icb.49.1410545037942; Fri, 12 Sep 2014 11:03:57 -0700 (PDT) Received: from localhost ([172.16.49.108]) by mx.google.com with ESMTPSA id e4sm2074709igl.18.2014.09.12.11.03.57 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Fri, 12 Sep 2014 11:03:57 -0700 (PDT) Subject: [PATCH v1 10/13] PCI: Preserve BIOS PCI_COMMAND_SERR and PCI_COMMAND_PARITY settings 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:03:54 -0600 Message-ID: <20140912180354.1630.57838.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-acpi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-acpi@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=unavailable 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 Do not clear PCI_COMMAND_SERR or PCI_COMMAND_PARITY based on _HPP. The spec (ACPI rev 5.0, sec 6.2.7) says that when "Enable SERR" is set to 1, we should enable SERR in the command register. It says nothing about *disabling* SERR or PERR; in fact, the example in 6.2.7.1 says we should leave PERR alone unless "Enable PERR" is 1. For hot-added devices, this probably doesn't matter because they power up with these bits cleared. But in addition to hot-plugged devices, the spec allows the platform to use _HPP for "configuration of PCI devices not configured by the BIOS at system boot," and it may make a difference for devices present at boot. This change means that if BIOS enables SERR or PERR on a device, and it supplies _HPP or _HPX with the SERR or PERR bits *cleared*, we will leave SERR or PERR reporting enabled on that device instead of disabling it. See also 40abb96c51bb ("pciehp: Fix programming hotplug parameters"), where this code was first added. Signed-off-by: Bjorn Helgaas --- drivers/pci/probe.c | 8 -------- 1 file changed, 8 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe linux-acpi" 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 003d112a783d..a16b3472b70d 100644 --- a/drivers/pci/probe.c +++ b/drivers/pci/probe.c @@ -1264,12 +1264,8 @@ static void program_hpp_type0(struct pci_dev *dev, struct hpp_type0 *hpp) pci_read_config_word(dev, PCI_COMMAND, &pci_cmd); if (hpp->enable_serr) pci_cmd |= PCI_COMMAND_SERR; - else - pci_cmd &= ~PCI_COMMAND_SERR; if (hpp->enable_perr) pci_cmd |= PCI_COMMAND_PARITY; - else - pci_cmd &= ~PCI_COMMAND_PARITY; pci_write_config_word(dev, PCI_COMMAND, pci_cmd); /* Program bridge control value */ @@ -1279,12 +1275,8 @@ static void program_hpp_type0(struct pci_dev *dev, struct hpp_type0 *hpp) pci_read_config_word(dev, PCI_BRIDGE_CONTROL, &pci_bctl); if (hpp->enable_serr) pci_bctl |= PCI_BRIDGE_CTL_SERR; - else - pci_bctl &= ~PCI_BRIDGE_CTL_SERR; if (hpp->enable_perr) pci_bctl |= PCI_BRIDGE_CTL_PARITY; - else - pci_bctl &= ~PCI_BRIDGE_CTL_PARITY; pci_write_config_word(dev, PCI_BRIDGE_CONTROL, pci_bctl); } }