From patchwork Wed Jan 13 13:20:55 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomasz Nowicki X-Patchwork-Id: 566926 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 240A4140307 for ; Thu, 14 Jan 2016 00:27:20 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=semihalf-com.20150623.gappssmtp.com header.i=@semihalf-com.20150623.gappssmtp.com header.b=Q2ccjtvf; dkim-atps=neutral Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754916AbcAMN0y (ORCPT ); Wed, 13 Jan 2016 08:26:54 -0500 Received: from mail-wm0-f49.google.com ([74.125.82.49]:34868 "EHLO mail-wm0-f49.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1760088AbcAMNVg (ORCPT ); Wed, 13 Jan 2016 08:21:36 -0500 Received: by mail-wm0-f49.google.com with SMTP id f206so293987257wmf.0 for ; Wed, 13 Jan 2016 05:21:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=semihalf-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=BGuosGMAwNL8ZXFLcDCuWo6wGQ0daC+R0TB+lnYCN28=; b=Q2ccjtvfO+slpaKACnCsfzathtsZCx84qgyME0Kt3vYT/ukl3sEwEonwiyf0XGPxSL GKsGD+vi7gZRx27TwX8JaJ+DfyFlL7GOGWvaUJvYaoj1C1aS9yroJhiXq3a+kq3epmKw W3LiLOqmS0s0OxaCnXapp9P0HyM+6U8zeVcOKCwBALEia6zuffvdjV0qS093Js1ttL3/ sqTh66LyiJwNYrY12epk1yLVAp8FvB48bK/NYZLeUPplGB+eZZMtIc7GAl1kqRldTvqQ 2wEE+ZPs/tvG3Ht1TyruSdPuyoU48xGjQYQVYWTAmJcEsq6UwQPsxKL5bRvQ8G5gW/v8 zISg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=BGuosGMAwNL8ZXFLcDCuWo6wGQ0daC+R0TB+lnYCN28=; b=Oif5Emu5IZs/6tH8YBH4sVvUPROBL/aLNToPyfIskJoq4FF7ykiQeTur5k9OjX8VjY Y7TdS/mbWuCpxh11HAH55ZVksKRNBd/axCopuAa41LJybzwJl3n6zkawCSPSvqKsLCHn IU+AdP/dm0lA5yIz2WOHiWqOQEpukRPebjqVwsBsq92PMp9YFS+1r9TnWF0wbdmpacgo l1s7KiLJ17UhrWbk8TX8ag6B9vEaWoo4lzDPrY0F+FDzQVMxwZhX+d4Gs41PJUNiiW0S p/iGmzVgXd7sEslSV/HYu00t0SqRugTAeVZTLCKX9Jnk9g7IKP1i8Wxh0zTYl863bjFU KMpw== X-Gm-Message-State: ALoCoQkMc/zAM/ENR1zGDwlhihhEdj1uWpr7G8td7FU/23TISnG2SG6ABZoHVZ/nle0ztJS3XAbCy+shqCpdkh02KBc5hGZwCg== X-Received: by 10.194.90.50 with SMTP id bt18mr145746340wjb.118.1452691295693; Wed, 13 Jan 2016 05:21:35 -0800 (PST) Received: from tn-HP-4.semihalf.local (cardhu.semihalf.com. [213.17.239.108]) by smtp.gmail.com with ESMTPSA id y124sm8858741wmg.3.2016.01.13.05.21.33 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 13 Jan 2016 05:21:35 -0800 (PST) From: Tomasz Nowicki To: bhelgaas@google.com, arnd@arndb.de, will.deacon@arm.com, catalin.marinas@arm.com, rjw@rjwysocki.net, hanjun.guo@linaro.org, Lorenzo.Pieralisi@arm.com, okaya@codeaurora.org, jiang.liu@linux.intel.com, Stefano.Stabellini@eu.citrix.com Cc: robert.richter@caviumnetworks.com, mw@semihalf.com, Liviu.Dudau@arm.com, ddaney@caviumnetworks.com, tglx@linutronix.de, wangyijing@huawei.com, Suravee.Suthikulpanit@amd.com, msalter@redhat.com, linux-pci@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org, linaro-acpi@lists.linaro.org, jchandra@broadcom.com, jcm@redhat.com, Tomasz Nowicki Subject: [PATCH V3 09/21] pci, acpi, ecam: Add flag to indicate whether ECAM region was hot added or not. Date: Wed, 13 Jan 2016 14:20:55 +0100 Message-Id: <1452691267-32240-10-git-send-email-tn@semihalf.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1452691267-32240-1-git-send-email-tn@semihalf.com> References: <1452691267-32240-1-git-send-email-tn@semihalf.com> Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org There are two ways we can get ECAM (aka MCFG) regions using ACPI, from MCFG static table and from _CBA method. We cannot remove static regions, however regions coming from _CBA should be removed while removing bridge device. In the light of above we need flag to mark hot added ECAM entries so that user should use pci_mmconfig_inject while adding regions from _CBA method. Signed-off-by: Tomasz Nowicki Tested-by: Suravee Suthikulpanit Tested-by: Jeremy Linton --- drivers/pci/ecam.c | 2 ++ include/linux/ecam.h | 1 + 2 files changed, 3 insertions(+) diff --git a/drivers/pci/ecam.c b/drivers/pci/ecam.c index 8a5eef7..da35b4c 100644 --- a/drivers/pci/ecam.c +++ b/drivers/pci/ecam.c @@ -131,6 +131,7 @@ struct pci_mmcfg_region *pci_mmconfig_alloc(int segment, int start, new->segment = segment; new->start_bus = start; new->end_bus = end; + new->hot_added = false; res = &new->res; res->start = addr + PCI_MMCFG_BUS_OFFSET(start); @@ -221,6 +222,7 @@ int pci_mmconfig_inject(struct pci_mmcfg_region *cfg) err = -ENOMEM; goto out; } else { + cfg->hot_added = true; list_add_sorted(cfg); pr_info("MMCONFIG at %pR (base %#lx)\n", &cfg->res, (unsigned long)cfg->address); diff --git a/include/linux/ecam.h b/include/linux/ecam.h index 813acd1..e0f322e 100644 --- a/include/linux/ecam.h +++ b/include/linux/ecam.h @@ -17,6 +17,7 @@ struct pci_mmcfg_region { u8 start_bus; u8 end_bus; char name[PCI_MMCFG_RESOURCE_NAME_LEN]; + bool hot_added; }; struct pci_mmcfg_region *pci_mmconfig_lookup(int segment, int bus);