From patchwork Wed Dec 16 15:16:19 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomasz Nowicki X-Patchwork-Id: 7862841 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 4E3AB9F1C2 for ; Wed, 16 Dec 2015 15:24:00 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 4D2C62035E for ; Wed, 16 Dec 2015 15:23:59 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 81DC220382 for ; Wed, 16 Dec 2015 15:23:58 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1a9DuP-00058E-Lt; Wed, 16 Dec 2015 15:22:29 +0000 Received: from mail-wm0-x231.google.com ([2a00:1450:400c:c09::231]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1a9DqL-0000hN-CQ for linux-arm-kernel@lists.infradead.org; Wed, 16 Dec 2015 15:18:19 +0000 Received: by mail-wm0-x231.google.com with SMTP id l126so43175398wml.0 for ; Wed, 16 Dec 2015 07:17:56 -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=qNVxAhVkaUEExtzlsOgTGnSUMExmwXMoEDneDJQ/Giw=; b=o+CADKY54qJkwqekkcL5X/orSULl3klbik+QWO8kbobwXHRO6w7h0MDKKsue3AkddF 1md0SeZ7aoEFE+ul+vAxvNcl7RLcys29e0wVNjDRpRPTGB0W2qHSykGZEoUM/iwMLrB2 7SbrQD44NQzWfA92JtV5KjWvY2ysFNaI7H2NhgZDfERt9yt4bWB1IMlFQbiHlXbSkKkg 1UfbdN0+TQ4XEFtKmXUDbsTiltAkRi4trn0BUbH2yAwwPfBRMhgjPVpswUsZL4F/Xkxm LbSNoxUsDX6tu0x2VdgOztEg7lmzO2KqSoTHKLFAzBDCou6gp9okLH8oFN/CBFA/jfCi ddow== 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=qNVxAhVkaUEExtzlsOgTGnSUMExmwXMoEDneDJQ/Giw=; b=YmJPQWl2gER/NhnQv04s4w64oNJOtzaQ/XkzV0dUkWwRS/nvsrYMUYwuwTiahBy33S GlK2Y0R+xOANTlTS61+MtrGPccVTUc4kIYAqgR57rRAY7UGpti95tCnyiifa4nJoutrN Vs8w9mkA0XlhcR4gGRKzOPcKWSsPWic7Run8N51VSx1qa2RYm2ttaHVkWREXg2gYo6gc wZGhHV51QJY/CqOkrKlJ9Und8+kD/wTXEFkH+GWpvYp1jjt7NVj/pI4XousfMxYVj0UN fbv75qki1INlsdoxJxrD/TQfAUlhoDOiIhEj+OW4FfNr+FQV16p/tav7x/VReTWmVOzj ds0g== X-Gm-Message-State: ALoCoQnD00LmTFmeZ+YFjLexW652nP25D53VFNCCQbTE/YtO2mpTvGft3lIinVqhX3PhcgQ9BLyZQF7p0kEIfSPrXxfufS3tRw== X-Received: by 10.194.134.102 with SMTP id pj6mr56901477wjb.23.1450279075773; Wed, 16 Dec 2015 07:17:55 -0800 (PST) Received: from tn-HP-4.semihalf.local ([80.82.22.190]) by smtp.gmail.com with ESMTPSA id z17sm6438761wjq.1.2015.12.16.07.17.53 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 16 Dec 2015 07:17:55 -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 Subject: [PATCH V2 09/23] pci, acpi, ecam: Add flag to indicate whether ECAM region was hot added or not. Date: Wed, 16 Dec 2015 16:16:19 +0100 Message-Id: <1450278993-12664-10-git-send-email-tn@semihalf.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1450278993-12664-1-git-send-email-tn@semihalf.com> References: <1450278993-12664-1-git-send-email-tn@semihalf.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20151216_071817_858118_125B17E1 X-CRM114-Status: GOOD ( 10.99 ) X-Spam-Score: -2.6 (--) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: jchandra@broadcom.com, jcm@redhat.com, linaro-acpi@lists.linaro.org, linux-pci@vger.kernel.org, Liviu.Dudau@arm.com, ddaney@caviumnetworks.com, linux-kernel@vger.kernel.org, linux-acpi@vger.kernel.org, robert.richter@caviumnetworks.com, Suravee.Suthikulpanit@amd.com, msalter@redhat.com, wangyijing@huawei.com, Tomasz Nowicki , tglx@linutronix.de, mw@semihalf.com, linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED, T_DKIM_INVALID, T_RP_MATCHES_RCVD, 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 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 --- 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);