From patchwork Tue Oct 27 16:38:39 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomasz Nowicki X-Patchwork-Id: 7498231 X-Patchwork-Delegate: bhelgaas@google.com Return-Path: X-Original-To: patchwork-linux-pci@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 EAA2E9F327 for ; Tue, 27 Oct 2015 16:44:50 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 1FBCF208AF for ; Tue, 27 Oct 2015 16:44:50 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 3EF552087A for ; Tue, 27 Oct 2015 16:44:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753212AbbJ0QoK (ORCPT ); Tue, 27 Oct 2015 12:44:10 -0400 Received: from mail-lf0-f54.google.com ([209.85.215.54]:34434 "EHLO mail-lf0-f54.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S965163AbbJ0Qja (ORCPT ); Tue, 27 Oct 2015 12:39:30 -0400 Received: by lfaz124 with SMTP id z124so175672071lfa.1 for ; Tue, 27 Oct 2015 09:39:29 -0700 (PDT) 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=Ei8mhni4CMYlvmJlXw7Fc8tj9KYLIDL/SqqqCccO2co=; b=SNEcuy9EqM9nBA2QEq2MRS7JYbZHKVZCSVHSmbwb2OvvuLK18CVlaCeoqc4pEuzz8y wAzdm51ILXCqzrRkNVad03o8rHB1kdOk+34TN/9XM9E4VT+0HcEGkqsyOuqxZQMhG4zL faR0yaSwpoTWOkCpDWNs/xwP2+TuuiIWQ2GUJhjGgyqDhJg10oYCwPQpprfsQXOpNt9g EcdgW0MgkNX/pExci+1fM90S8UUHXtpLMTZmc4Hv7as2f+oiKhlvdwPrgp41Tt6V3R3v RhsWG2ZCiPiUqjfXASATw1hRzB/NQF4org1CDPHD9MMCX9OzgPO2i5SDI2Ai9+1SKJWF 4djA== 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=Ei8mhni4CMYlvmJlXw7Fc8tj9KYLIDL/SqqqCccO2co=; b=linwhwH293Wim75EmE+uDZ9Fm8fHiDOi1hRQNjk3HtmI+fZkvQhDVHZzlBvCR5yA1f L5LE7NknWQMQyVIqjcq45LJj72r56DTG5pFfPJepc9eLOVZPLrM1OWVjkXcD4WhBa5b0 zhDLTGHY8TX7ESSu8j4zCDO0lJyb+Tng182hOg8xAyRJQ94NiIgYgr+01wWYEkBmXqc8 FazvQJ9L9HI3TC4dJJ+o9WkI+t3L8KVfNz+W48mIL3ndpFT11XvbwKqXTgMBXA0pcmHs Xh5LVIYljASwGOG1fVCeBpXlTelVp8Zn195Rn8ydWqV6SZ7E5AicUvJfzsWEFNe/u+7y vzmg== X-Gm-Message-State: ALoCoQmqGC8n4BzLZsydS33DO7cARKRPSfyaPoAfBwpWm1JLiY+eAFWGgWDotwOPhjvJJ+zMh91h X-Received: by 10.25.20.97 with SMTP id k94mr13268118lfi.27.1445963969549; Tue, 27 Oct 2015 09:39:29 -0700 (PDT) Received: from tn-HP-4.semihalf.local ([80.82.22.190]) by smtp.gmail.com with ESMTPSA id kk6sm6988609lbc.48.2015.10.27.09.39.28 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 27 Oct 2015 09:39:29 -0700 (PDT) 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 Cc: jiang.liu@linux.intel.com, robert.richter@caviumnetworks.com, Narinder.Dhillon@caviumnetworks.com, ddaney@caviumnetworks.com, Liviu.Dudau@arm.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, Tomasz Nowicki Subject: [PATCH V1 08/11] pci, acpi, ecam: Add flag to indicate whether ECAM region was hot added or not. Date: Tue, 27 Oct 2015 17:38:39 +0100 Message-Id: <1445963922-22711-9-git-send-email-tn@semihalf.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1445963922-22711-1-git-send-email-tn@semihalf.com> References: <1445963922-22711-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 X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00,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 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 --- 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);