From patchwork Wed Mar 14 16:34:54 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Desnes A. Nunes do Rosario" X-Patchwork-Id: 885907 X-Patchwork-Delegate: bhelgaas@google.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=linux-pci-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=linux.vnet.ibm.com Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 401clt6pwNz9sTs for ; Thu, 15 Mar 2018 03:35:38 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752025AbeCNQff (ORCPT ); Wed, 14 Mar 2018 12:35:35 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:51886 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752100AbeCNQfd (ORCPT ); Wed, 14 Mar 2018 12:35:33 -0400 Received: from pps.filterd (m0098421.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w2EGXf0g037268 for ; Wed, 14 Mar 2018 12:35:32 -0400 Received: from e35.co.us.ibm.com (e35.co.us.ibm.com [32.97.110.153]) by mx0a-001b2d01.pphosted.com with ESMTP id 2gq7171040-1 (version=TLSv1.2 cipher=AES256-SHA256 bits=256 verify=NOT) for ; Wed, 14 Mar 2018 12:35:32 -0400 Received: from localhost by e35.co.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Wed, 14 Mar 2018 10:35:31 -0600 Received: from b03cxnp08027.gho.boulder.ibm.com (9.17.130.19) by e35.co.us.ibm.com (192.168.1.135) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Wed, 14 Mar 2018 10:35:27 -0600 Received: from b03ledav004.gho.boulder.ibm.com (b03ledav004.gho.boulder.ibm.com [9.17.130.235]) by b03cxnp08027.gho.boulder.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id w2EGZQAb12648934; Wed, 14 Mar 2018 09:35:26 -0700 Received: from b03ledav004.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id BED1E7803F; Wed, 14 Mar 2018 10:35:26 -0600 (MDT) Received: from ibm.ibmmodules.com (unknown [9.85.207.171]) by b03ledav004.gho.boulder.ibm.com (Postfix) with ESMTP id 4667A78038; Wed, 14 Mar 2018 10:35:23 -0600 (MDT) From: "Desnes A. Nunes do Rosario" To: linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org, linuxppc-dev@lists.ozlabs.org Cc: bhelgaas@google.com, benh@kernel.crashing.org, paulus@samba.org, mpe@ellerman.id.au, ruscur@russell.cc, aik@ozlabs.ru, david@gibson.dropbear.id.au, fbarrat@linux.vnet.ibm.com, brking@linux.vnet.ibm.com Subject: [PATCH 1/2, pci] pci: Addition of PCI_DEV_FLAGS_QUIET_PCI_REALIGN attribute to the PCI subsystem Date: Wed, 14 Mar 2018 13:34:54 -0300 X-Mailer: git-send-email 2.14.3 In-Reply-To: <20180314163455.15854-1-desnesn@linux.vnet.ibm.com> References: <20180314163455.15854-1-desnesn@linux.vnet.ibm.com> X-TM-AS-GCONF: 00 x-cbid: 18031416-0012-0000-0000-000015E52FBF X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00008673; HX=3.00000241; KW=3.00000007; PH=3.00000004; SC=3.00000254; SDB=6.01002988; UDB=6.00510402; IPR=6.00782318; MB=3.00020033; MTD=3.00000008; XFM=3.00000015; UTC=2018-03-14 16:35:29 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 18031416-0013-0000-0000-000051DE4D8C Message-Id: <20180314163455.15854-2-desnesn@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2018-03-14_08:, , signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 impostorscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1709140000 definitions=main-1803140187 Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org Add PCI_DEV_FLAGS_QUIET_PCI_REALIGN to pci_dev_flags and use it to silent PCI realignment messages if the flag is turned on by a driver. Signed-off-by: Desnes A. Nunes do Rosario --- drivers/pci/pci.c | 3 ++- drivers/pci/setup-res.c | 3 ++- include/linux/pci.h | 2 ++ 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c index 8c71d1a66cdd..be197c944e5f 100644 --- a/drivers/pci/pci.c +++ b/drivers/pci/pci.c @@ -5505,7 +5505,8 @@ void pci_reassigndev_resource_alignment(struct pci_dev *dev) return; } - pci_info(dev, "Disabling memory decoding and releasing memory resources\n"); + if (!(dev->dev_flags & PCI_DEV_FLAGS_QUIET_PCI_REALIGN)) + pci_info(dev, "Disabling memory decoding and releasing memory resources\n"); pci_read_config_word(dev, PCI_COMMAND, &command); command &= ~PCI_COMMAND_MEMORY; pci_write_config_word(dev, PCI_COMMAND, command); diff --git a/drivers/pci/setup-res.c b/drivers/pci/setup-res.c index 369d48d6c6f1..00a538def763 100644 --- a/drivers/pci/setup-res.c +++ b/drivers/pci/setup-res.c @@ -172,7 +172,8 @@ EXPORT_SYMBOL(pci_claim_resource); void pci_disable_bridge_window(struct pci_dev *dev) { - pci_info(dev, "disabling bridge mem windows\n"); + if (!(dev->dev_flags & PCI_DEV_FLAGS_QUIET_PCI_REALIGN)) + pci_info(dev, "disabling bridge mem windows\n"); /* MMIO Base/Limit */ pci_write_config_dword(dev, PCI_MEMORY_BASE, 0x0000fff0); diff --git a/include/linux/pci.h b/include/linux/pci.h index e057e8cc63e7..993f9c7dcc00 100644 --- a/include/linux/pci.h +++ b/include/linux/pci.h @@ -205,6 +205,8 @@ enum pci_dev_flags { PCI_DEV_FLAGS_NO_FLR_RESET = (__force pci_dev_flags_t) (1 << 10), /* Don't use Relaxed Ordering for TLPs directed at this device */ PCI_DEV_FLAGS_NO_RELAXED_ORDERING = (__force pci_dev_flags_t) (1 << 11), + /* Silent PCI resource realignment messages */ + PCI_DEV_FLAGS_QUIET_PCI_REALIGN = (__force pci_dev_flags_t) (1 << 12), }; enum pci_irq_reroute_variant {