From patchwork Mon Jan 7 06:41:34 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kishon Vijay Abraham I X-Patchwork-Id: 154852 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp3170900ljp; Sun, 6 Jan 2019 22:43:16 -0800 (PST) X-Google-Smtp-Source: AFSGD/XFN4q6pK1l6rFoIxKCjLVDxitKU5qhZUdkUvBvH2sL0KxKHTnFC0kUcqRR4VITr6o6YIqt X-Received: by 2002:a62:2c81:: with SMTP id s123mr61166274pfs.174.1546843395976; Sun, 06 Jan 2019 22:43:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1546843395; cv=none; d=google.com; s=arc-20160816; b=qjNdDo3i6ucEEjRDQFKltDBN/Ts3LVVsDWw6m6Nk2352F/Bxif9oDErVAcHEyNwv26 O8C88svy/O67z0dfydpsAzdFNKd/5ORrUVAuvwKA5XZj+a+NBz76lIXe8Tg8K5ct4lvF 0DU0Vx6ciiBt75vDeTBGLW6eGLiXgx0u74QiUJCysQL/6e/i5q1GpJ2ZbUWv6M5/kZsm CGU3WCBTVkVvVTZJX/LDsZnlnKgQIROwa8pcXLuLIb6rZIN2BKcDAnEEHrjDzhLVWWnk YsoDNNuyk2DXfvCcPNZyewSs1ENWdsoLfxAzbLR7TSl7wYujKzV9wcIQaCx/Uw/0ek8o C3PQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=7zfWfnCQeG4SmqHvA26Y+pmRNPO6bCuT02zsP3l4mz4=; b=QEf/DwUFJEr56IHXMSssmNER+bIpk1435oQ9OIGifBKyEnt6wwK+LO5hTufyryDXhh Uc4NZbmoNUH1mT6UOs3w5wSsD0FSxIQnyEYTb6E3Z+IgfuNn2Utc9wiekJ9NX0teYopv sagPLsXpK33in22MqSaC0en1W6hzhITiNZDZpmkVWD+T8iPz2SV0+UJHskpUFXWh5uKl mmWWUTksaF9hDXUigabjUlZg6pCwPXfeqkUkoXDzGydmI8jcK98VElaMw918KpgQcSM1 zk2JQtpJF+CP6Ja6Wo5yCpRFk2G7k4jeYF5F6VDlk6IgfdAsixmifjqRu65QHG2qwGLJ Pv3Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=hm0vuiEW; spf=pass (google.com: best guess record for domain of linux-omap-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-omap-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 3si21754459plx.33.2019.01.06.22.43.15; Sun, 06 Jan 2019 22:43:15 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-omap-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=hm0vuiEW; spf=pass (google.com: best guess record for domain of linux-omap-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-omap-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726427AbfAGGnJ (ORCPT + 5 others); Mon, 7 Jan 2019 01:43:09 -0500 Received: from fllv0015.ext.ti.com ([198.47.19.141]:40858 "EHLO fllv0015.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725771AbfAGGnJ (ORCPT ); Mon, 7 Jan 2019 01:43:09 -0500 Received: from fllv0035.itg.ti.com ([10.64.41.0]) by fllv0015.ext.ti.com (8.15.2/8.15.2) with ESMTP id x076gp2q058836; Mon, 7 Jan 2019 00:42:51 -0600 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1546843371; bh=7zfWfnCQeG4SmqHvA26Y+pmRNPO6bCuT02zsP3l4mz4=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=hm0vuiEW4RTnVOdG+0aPGDqnzNQG299faMf6MEHh/hHYreKd9xXmbfg1+7T1TefGF +nMj/bU9yPyT/UpDn9Z9tYEWD+jaOlQDfJ1bkJsy0xuywvWxpR7vZX1/rDcvgjGw2p ucf6W+OQhdAVj08dcRq3Yj29aFHzv+YoiJufaHXA= Received: from DLEE104.ent.ti.com (dlee104.ent.ti.com [157.170.170.34]) by fllv0035.itg.ti.com (8.15.2/8.15.2) with ESMTPS id x076gp6n037989 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Mon, 7 Jan 2019 00:42:51 -0600 Received: from DLEE108.ent.ti.com (157.170.170.38) by DLEE104.ent.ti.com (157.170.170.34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1591.10; Mon, 7 Jan 2019 00:42:50 -0600 Received: from dflp32.itg.ti.com (10.64.6.15) by DLEE108.ent.ti.com (157.170.170.38) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.1591.10 via Frontend Transport; Mon, 7 Jan 2019 00:42:50 -0600 Received: from a0393678ub.india.ti.com (ileax41-snat.itg.ti.com [10.172.224.153]) by dflp32.itg.ti.com (8.14.3/8.13.8) with ESMTP id x076gfnw002672; Mon, 7 Jan 2019 00:42:46 -0600 From: Kishon Vijay Abraham I To: Lorenzo Pieralisi , Bjorn Helgaas , Gustavo Pimentel , Alan Douglas , Shawn Lin CC: Jingoo Han , Heiko Stuebner , Cyrille Pitchen , Jia-Ju Bai , , , , , , Subject: [PATCH 01/15] PCI: endpoint: Add new pci_epc_ops to get EPC features Date: Mon, 7 Jan 2019 12:11:34 +0530 Message-ID: <20190107064148.10152-2-kishon@ti.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190107064148.10152-1-kishon@ti.com> References: <20190107064148.10152-1-kishon@ti.com> MIME-Version: 1.0 X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org Add a new pci_epc_ops ->get_features() to get the features supported by EPC. Since EPC can provide different features to different functions, the ->get_features() ops takes _func_no_ as an argument. Signed-off-by: Kishon Vijay Abraham I --- drivers/pci/endpoint/pci-epc-core.c | 30 +++++++++++++++++++++++++++++ include/linux/pci-epc.h | 22 +++++++++++++++++++++ 2 files changed, 52 insertions(+) -- 2.17.1 diff --git a/drivers/pci/endpoint/pci-epc-core.c b/drivers/pci/endpoint/pci-epc-core.c index 094dcc3203b8..5a099479d9ab 100644 --- a/drivers/pci/endpoint/pci-epc-core.c +++ b/drivers/pci/endpoint/pci-epc-core.c @@ -83,6 +83,36 @@ struct pci_epc *pci_epc_get(const char *epc_name) } EXPORT_SYMBOL_GPL(pci_epc_get); +/** + * pci_epc_get_features() - get the features supported by EPC + * @epc: the features supported by *this* EPC device will be returned + * @func_no: the features supported by the EPC device specific to the + * endpoint function with func_no will be returned + * + * Invoke to get the features provided by the EPC which may be + * specific to an endpoint function. Returns pci_epc_features on success + * and NULL for any failures. + */ +const struct pci_epc_features *pci_epc_get_features(struct pci_epc *epc, + u8 func_no) +{ + const struct pci_epc_features *epc_features; + unsigned long flags; + + if (IS_ERR_OR_NULL(epc) || func_no >= epc->max_functions) + return NULL; + + if (!epc->ops->get_features) + return NULL; + + spin_lock_irqsave(&epc->lock, flags); + epc_features = epc->ops->get_features(epc, func_no); + spin_unlock_irqrestore(&epc->lock, flags); + + return epc_features; +} +EXPORT_SYMBOL_GPL(pci_epc_get_features); + /** * pci_epc_stop() - stop the PCI link * @epc: the link of the EPC device that has to be stopped diff --git a/include/linux/pci-epc.h b/include/linux/pci-epc.h index 37dab8116901..79fbcf94e14d 100644 --- a/include/linux/pci-epc.h +++ b/include/linux/pci-epc.h @@ -59,6 +59,8 @@ struct pci_epc_ops { enum pci_epc_irq_type type, u16 interrupt_num); int (*start)(struct pci_epc *epc); void (*stop)(struct pci_epc *epc); + const struct pci_epc_features* (*get_features)(struct pci_epc *epc, + u8 func_no); struct module *owner; }; @@ -100,6 +102,24 @@ struct pci_epc { unsigned int features; }; +/** + * struct pci_epc_features - features supported by a EPC device per function + * @linkup_notifier: indicate if the EPC device can notify EPF driver on link up + * @msi_capable: indicate if the endpoint function has MSI capability + * @msix_capable: indicate if the endpoint function has MSI-X capability + * @reserved_bar: bitmap to indicate reserved BAR unavailable to function driver + * @bar_fixed_64bit: bitmap to indicate fixed 64bit BARs + * @bar_fixed_size: Array specifying the size supported by each BAR + */ +struct pci_epc_features { + unsigned int linkup_notifier : 1; + unsigned int msi_capable : 1; + unsigned int msix_capable : 1; + u8 reserved_bar; + u8 bar_fixed_64bit; + u64 bar_fixed_size[BAR_5 + 1]; +}; + #define EPC_FEATURE_NO_LINKUP_NOTIFIER BIT(0) #define EPC_FEATURE_BAR_MASK (BIT(1) | BIT(2) | BIT(3)) #define EPC_FEATURE_MSIX_AVAILABLE BIT(4) @@ -158,6 +178,8 @@ int pci_epc_raise_irq(struct pci_epc *epc, u8 func_no, enum pci_epc_irq_type type, u16 interrupt_num); int pci_epc_start(struct pci_epc *epc); void pci_epc_stop(struct pci_epc *epc); +const struct pci_epc_features *pci_epc_get_features(struct pci_epc *epc, + u8 func_no); struct pci_epc *pci_epc_get(const char *epc_name); void pci_epc_put(struct pci_epc *epc); From patchwork Mon Jan 7 06:41:36 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kishon Vijay Abraham I X-Patchwork-Id: 154855 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp3171057ljp; Sun, 6 Jan 2019 22:43:33 -0800 (PST) X-Google-Smtp-Source: AFSGD/UOzzaB5kGdbduWit56fbVfVg82qU0HQsM7DX376NskQ42vmjCk7i7xvDjRqt59XVYXNvBr X-Received: by 2002:a62:2cf:: with SMTP id 198mr62317168pfc.67.1546843413128; Sun, 06 Jan 2019 22:43:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1546843413; cv=none; d=google.com; s=arc-20160816; b=yzVHojIUGsJcNcbQfkq/XkG/CvzhhILpupOe2xS1Jnc9s2Q1OAr0hyO0fl52cz/nQB 1qzkBAh1UjjMM49rf9C8poWjQo27Qyo803vYr363v5KUiEz9DcyrQuRjNTK/3sh7L/sw MggZCl5jT3zYJrAyhnYmsTHhoDfg4qULlBO4aG94LUOu1aaeWd8jplEGzcp9jz9WNOLl 6bs6lPRDzm7x4AVEIJ9RzEOxLZxtW3ZOYSdSkoaajI6o1NaycwGgOx8CF/aTA/a8vJzP K5pGAIGEOg7rZx0+lqwZXVbrdxwhFOr1YtxVs8gCFNRSz1OQ4FfUOaFqe4GCbpKExnG4 amlw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=UxFV2AA/OxJ+RGbF6mGrC+ScIM/GAuGJn+bhMgD6qEM=; b=P64qKUVRHvTFu0AP2GyXDx7u1rNrbRat+g3kc4QAJp+eMmJJN4ymwiYAGzbp1sEKtY NSOEe9cULqT7mgpxUqMCtEZODMqZuMv8Wpqu7NcfYPNUhwoonbhdJmmQ8RH7rCV1TmkL BOu1bhwbVbYMn1b9dJhyw0/c14toDjev7944ltc6CLhWzp433r+w1GesjRxrGG+Q5i4r AiPsVV37NCzRc+AOdCb6nC/MdQ8CrP4E+xurISA62orVhteLjDuRifR6RNdnPRfvnJl+ Tv4qvUGvqjkvWOntTCWOZ+j+1svTikA5R/PqzTBYD1Ij0wjNdmM3IjDGwPYa5BCySOhZ I+7g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=t5cLz4cA; spf=pass (google.com: best guess record for domain of linux-omap-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-omap-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f75si7494493pff.131.2019.01.06.22.43.32; Sun, 06 Jan 2019 22:43:33 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-omap-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=t5cLz4cA; spf=pass (google.com: best guess record for domain of linux-omap-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-omap-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725771AbfAGGn3 (ORCPT + 5 others); Mon, 7 Jan 2019 01:43:29 -0500 Received: from fllv0015.ext.ti.com ([198.47.19.141]:40958 "EHLO fllv0015.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726537AbfAGGn1 (ORCPT ); Mon, 7 Jan 2019 01:43:27 -0500 Received: from lelv0265.itg.ti.com ([10.180.67.224]) by fllv0015.ext.ti.com (8.15.2/8.15.2) with ESMTP id x076h1se058868; Mon, 7 Jan 2019 00:43:01 -0600 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1546843381; bh=UxFV2AA/OxJ+RGbF6mGrC+ScIM/GAuGJn+bhMgD6qEM=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=t5cLz4cAmg4s3+2A/8tCs9Ll7f8dHxNtToHd4BozQ3Ycafmms1BT7lH5Mq8Ozt0tp fYG+0z+ehXDym+7TXJroLrsDSLQXBzJuece+auPpHxQ8lAyC8G76DEcwKZqHfDK5lH HzJ0LNw3sQM12JxEekDp4QhRGHZjNg4rF8CHzo24= Received: from DFLE105.ent.ti.com (dfle105.ent.ti.com [10.64.6.26]) by lelv0265.itg.ti.com (8.15.2/8.15.2) with ESMTPS id x076h04N048436 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Mon, 7 Jan 2019 00:43:00 -0600 Received: from DFLE109.ent.ti.com (10.64.6.30) by DFLE105.ent.ti.com (10.64.6.26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1591.10; Mon, 7 Jan 2019 00:43:00 -0600 Received: from dflp32.itg.ti.com (10.64.6.15) by DFLE109.ent.ti.com (10.64.6.30) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.1591.10 via Frontend Transport; Mon, 7 Jan 2019 00:43:00 -0600 Received: from a0393678ub.india.ti.com (ileax41-snat.itg.ti.com [10.172.224.153]) by dflp32.itg.ti.com (8.14.3/8.13.8) with ESMTP id x076gfo0002672; Mon, 7 Jan 2019 00:42:56 -0600 From: Kishon Vijay Abraham I To: Lorenzo Pieralisi , Bjorn Helgaas , Gustavo Pimentel , Alan Douglas , Shawn Lin CC: Jingoo Han , Heiko Stuebner , Cyrille Pitchen , Jia-Ju Bai , , , , , , Subject: [PATCH 03/15] PCI: designware-plat: Populate ->get_features() dw_pcie_ep_ops Date: Mon, 7 Jan 2019 12:11:36 +0530 Message-ID: <20190107064148.10152-4-kishon@ti.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190107064148.10152-1-kishon@ti.com> References: <20190107064148.10152-1-kishon@ti.com> MIME-Version: 1.0 X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org Populate ->get_features() dw_pcie_ep_ops to return the EPC features supported by Designware PCIe endpoint controller. Signed-off-by: Kishon Vijay Abraham I --- drivers/pci/controller/dwc/pcie-designware-plat.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) -- 2.17.1 diff --git a/drivers/pci/controller/dwc/pcie-designware-plat.c b/drivers/pci/controller/dwc/pcie-designware-plat.c index c12bf794d69c..bd0516afc86f 100644 --- a/drivers/pci/controller/dwc/pcie-designware-plat.c +++ b/drivers/pci/controller/dwc/pcie-designware-plat.c @@ -100,9 +100,22 @@ static int dw_plat_pcie_ep_raise_irq(struct dw_pcie_ep *ep, u8 func_no, return 0; } +static const struct pci_epc_features dw_plat_pcie_epc_features = { + .linkup_notifier = false, + .msi_capable = true, + .msix_capable = true, +}; + +static const struct pci_epc_features* +dw_plat_pcie_get_features(struct dw_pcie_ep *ep) +{ + return &dw_plat_pcie_epc_features; +} + static struct dw_pcie_ep_ops pcie_ep_ops = { .ep_init = dw_plat_pcie_ep_init, .raise_irq = dw_plat_pcie_ep_raise_irq, + .get_features = dw_plat_pcie_get_features, }; static int dw_plat_add_pcie_port(struct dw_plat_pcie *dw_plat_pcie, From patchwork Mon Jan 7 06:41:37 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kishon Vijay Abraham I X-Patchwork-Id: 154853 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp3170999ljp; Sun, 6 Jan 2019 22:43:27 -0800 (PST) X-Google-Smtp-Source: AFSGD/UUxpAVx70P730cFWolgpXs6RmqKb1xbiF9YCKCb4Fr0NFSJfSkseth1JyM1W1dHmwlCgR6 X-Received: by 2002:aa7:8542:: with SMTP id y2mr62841751pfn.83.1546843407747; Sun, 06 Jan 2019 22:43:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1546843407; cv=none; d=google.com; s=arc-20160816; b=L9P3mZxNSXc8zBHLbZcJaqP+1dEL4C1a/dqkXWbV0Nm1IfspPQwe7aIZQh67mvr1UX p+TypLTv5sP8BOdNixcNGsOOxHzKdm48vfAn83kYg3Y7LvGKVqtDDTQe3/dAstEeOuA0 Htg+FFkFWRMOUL8uKHZlLWPXF9Vj2FKWer1UaiPugw/S4Vhoyo/2QPPyXD2P24Q3uVW4 mlXWQPqGM7mH6/GB3AIG3ry/RmonIeFL7DiU6l3E4tGqyshGqGvB0fSKr4EY1wUFLlzi aCjWPT/TylIpkGvqmAQLw7tDUkXcfXHAdyq/jXk7dNy2+296ZXuX6B4r3PIoxsaggf/b QUVQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=TmIM90if+baASLKYtEih7oqZRQj9lMMND6SlULCYPWw=; b=V3cSQV5S4MEiG/8wtRLvXbp0G68L4jChcxKZTLCbezlCaVnw/PtpIEaDjtJE4NzqDD 8kgKRm/V9rwWiLg5yqiMeOa+bFDrKTcjA6FGBdhHqN/n3GCfrMlbJZAlPpcSPDgcW8uh 5aRiE2G3gEY2M3qhgg9QdflQSEM1MZQ0IHy1wdgqBC3FSoohhNfbzV6dRVhOoroGscb9 oGEMqAznV1Bk8EEmYcL6vzmeDv/c3woa3zwzZRrHpzADwQlbUnWbCiuEhRcTgjRQ4ZDi PEPPXG4KUwc0OCldVDDSOFsePxJRIhkCgBvO9iiQC263kKdrxJrXWqjNLppbkQQaSO+e ucJQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=s4cGbFeT; spf=pass (google.com: best guess record for domain of linux-omap-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-omap-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d36si41530917pla.216.2019.01.06.22.43.27; Sun, 06 Jan 2019 22:43:27 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-omap-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=s4cGbFeT; spf=pass (google.com: best guess record for domain of linux-omap-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-omap-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726504AbfAGGnZ (ORCPT + 5 others); Mon, 7 Jan 2019 01:43:25 -0500 Received: from fllv0015.ext.ti.com ([198.47.19.141]:40946 "EHLO fllv0015.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725550AbfAGGnZ (ORCPT ); Mon, 7 Jan 2019 01:43:25 -0500 Received: from lelv0266.itg.ti.com ([10.180.67.225]) by fllv0015.ext.ti.com (8.15.2/8.15.2) with ESMTP id x076h5fY058891; Mon, 7 Jan 2019 00:43:05 -0600 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1546843385; bh=TmIM90if+baASLKYtEih7oqZRQj9lMMND6SlULCYPWw=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=s4cGbFeTxcmy/RknkLx+VUGLIvRawQJSvkSLFiTGAhUuZYcyABTOXSx8LdfaIpVXE f7fh4+y7fM+H063V63R4/fo0rckjdfqU84ClIb0dOjynSKCngBEPoLBxObLOvuwQBQ FBsFYhg9nYUsqHcqj/JjmuBIlUIvxCAI+W3ef24M= Received: from DFLE106.ent.ti.com (dfle106.ent.ti.com [10.64.6.27]) by lelv0266.itg.ti.com (8.15.2/8.15.2) with ESMTPS id x076h5XC071098 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Mon, 7 Jan 2019 00:43:05 -0600 Received: from DFLE115.ent.ti.com (10.64.6.36) by DFLE106.ent.ti.com (10.64.6.27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1591.10; Mon, 7 Jan 2019 00:43:05 -0600 Received: from dflp32.itg.ti.com (10.64.6.15) by DFLE115.ent.ti.com (10.64.6.36) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.1591.10 via Frontend Transport; Mon, 7 Jan 2019 00:43:04 -0600 Received: from a0393678ub.india.ti.com (ileax41-snat.itg.ti.com [10.172.224.153]) by dflp32.itg.ti.com (8.14.3/8.13.8) with ESMTP id x076gfo1002672; Mon, 7 Jan 2019 00:43:01 -0600 From: Kishon Vijay Abraham I To: Lorenzo Pieralisi , Bjorn Helgaas , Gustavo Pimentel , Alan Douglas , Shawn Lin CC: Jingoo Han , Heiko Stuebner , Cyrille Pitchen , Jia-Ju Bai , , , , , , Subject: [PATCH 04/15] PCI: pci-dra7xx: Populate ->get_features() dw_pcie_ep_ops Date: Mon, 7 Jan 2019 12:11:37 +0530 Message-ID: <20190107064148.10152-5-kishon@ti.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190107064148.10152-1-kishon@ti.com> References: <20190107064148.10152-1-kishon@ti.com> MIME-Version: 1.0 X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org Populate ->get_features() dw_pcie_ep_ops to return the EPC features supported by DRA7xx PCIe endpoint controller. Signed-off-by: Kishon Vijay Abraham I --- drivers/pci/controller/dwc/pci-dra7xx.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) -- 2.17.1 diff --git a/drivers/pci/controller/dwc/pci-dra7xx.c b/drivers/pci/controller/dwc/pci-dra7xx.c index a32d6dde7a57..15620cfa617b 100644 --- a/drivers/pci/controller/dwc/pci-dra7xx.c +++ b/drivers/pci/controller/dwc/pci-dra7xx.c @@ -389,9 +389,22 @@ static int dra7xx_pcie_raise_irq(struct dw_pcie_ep *ep, u8 func_no, return 0; } +static const struct pci_epc_features dra7xx_pcie_epc_features = { + .linkup_notifier = true, + .msi_capable = true, + .msix_capable = false, +}; + +static const struct pci_epc_features* +dra7xx_pcie_get_features(struct dw_pcie_ep *ep) +{ + return &dra7xx_pcie_epc_features; +} + static struct dw_pcie_ep_ops pcie_ep_ops = { .ep_init = dra7xx_pcie_ep_init, .raise_irq = dra7xx_pcie_raise_irq, + .get_features = dra7xx_pcie_get_features, }; static int __init dra7xx_add_pcie_ep(struct dra7xx_pcie *dra7xx, From patchwork Mon Jan 7 06:41:38 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kishon Vijay Abraham I X-Patchwork-Id: 154857 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp3171279ljp; Sun, 6 Jan 2019 22:43:55 -0800 (PST) X-Google-Smtp-Source: AFSGD/VVEhg93W7KqnLz78LEWP8UDU/JP0G+A/mHdBrPcWfWekMNbAQiCDE7YNwrsFcj1Emm76cV X-Received: by 2002:a62:1542:: with SMTP id 63mr62334513pfv.230.1546843435267; Sun, 06 Jan 2019 22:43:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1546843435; cv=none; d=google.com; s=arc-20160816; b=G1kxBBSaUUk8XjxMGIPH7wWVSq/r7t4ofrnUNYAZnwFdJpYyVF8p16wg2ig0SzVFpj w3UvWzG2eaXuaXP4exDBHESiv0u1b7TaNfC2T5wbkUaAFpj/gPfwvCP94CmIoSFK/GHo P3BsdF1XhIpf+JGwPgMTCLj9u+4Ko79tN92hn+h2y2QEXaoLn2FwcIIbdjee/liw79wI ZaoavZHuOhlAlLjFBi6RZYWhuL58/j/THrvew03ZNqDcn+rX6bYkoUBaZqRnbVEaRYv2 BaPLw7/eV84JAQ9VK0IzTdVxxXeS4WKV2fBM1KfcN1UnNURU4tgHpzYCIqaBlYr3bKBU f0eQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=B87URmk8FxmkzbOiUN33pM2ksJFStfqzKpKRhu9JNSU=; b=INtd+QgqriiOtGYPlq+z5q6X6D6UlwW2jmegJkJWMnbtGVViWtsZgRr5Jqec3B+2EB Adq0KNVJldqteMVZzZo+Ok1RELNvtdUA1g0RHBGDxIQDmeOwZ2RF6H1CiX7hkxIpPjjW gzFLxvkaze7Z6U09j2LNoRXOa4L6deSgx9RZsGAeZhA8w+qXjLn9/F3RmBf1SkqvK7kV Zvbai3cOrMM2jbuKt6f4Re87TfCg/mx5Enb9ZAgWh0jkKrbeojYI8bxWE1NotjHBn6OO 2JOEkaqXGia2u0FOeKZEn6VCGSZ3cDRp86FRxte/IXK9AJXltSdq7ghpecMrHRx8vXqC Je0g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=oo2kszdB; spf=pass (google.com: best guess record for domain of linux-omap-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-omap-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i12si40331805plt.213.2019.01.06.22.43.55; Sun, 06 Jan 2019 22:43:55 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-omap-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=oo2kszdB; spf=pass (google.com: best guess record for domain of linux-omap-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-omap-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726579AbfAGGny (ORCPT + 5 others); Mon, 7 Jan 2019 01:43:54 -0500 Received: from lelv0143.ext.ti.com ([198.47.23.248]:39026 "EHLO lelv0143.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725804AbfAGGny (ORCPT ); Mon, 7 Jan 2019 01:43:54 -0500 Received: from fllv0035.itg.ti.com ([10.64.41.0]) by lelv0143.ext.ti.com (8.15.2/8.15.2) with ESMTP id x076h9P6055205; Mon, 7 Jan 2019 00:43:09 -0600 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1546843389; bh=B87URmk8FxmkzbOiUN33pM2ksJFStfqzKpKRhu9JNSU=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=oo2kszdBwPqlwhPG4KleDRQm6FGyLLBKHdbj86Lru+uQIeFfDSLk4kPqTXBJfT+Gy F2hvfWDI2ZOd0GmCO2b+wclg7SDMeWBQHv6BLZOb8sKTtbCYg7+lREaj33Gp/Hzz2y i7cOAuqGlVFYKHSQSPV458uL9N9iY62k7JdSevos= Received: from DFLE104.ent.ti.com (dfle104.ent.ti.com [10.64.6.25]) by fllv0035.itg.ti.com (8.15.2/8.15.2) with ESMTPS id x076h9oK038338 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Mon, 7 Jan 2019 00:43:09 -0600 Received: from DFLE106.ent.ti.com (10.64.6.27) by DFLE104.ent.ti.com (10.64.6.25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1591.10; Mon, 7 Jan 2019 00:43:09 -0600 Received: from dflp32.itg.ti.com (10.64.6.15) by DFLE106.ent.ti.com (10.64.6.27) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.1591.10 via Frontend Transport; Mon, 7 Jan 2019 00:43:09 -0600 Received: from a0393678ub.india.ti.com (ileax41-snat.itg.ti.com [10.172.224.153]) by dflp32.itg.ti.com (8.14.3/8.13.8) with ESMTP id x076gfo2002672; Mon, 7 Jan 2019 00:43:05 -0600 From: Kishon Vijay Abraham I To: Lorenzo Pieralisi , Bjorn Helgaas , Gustavo Pimentel , Alan Douglas , Shawn Lin CC: Jingoo Han , Heiko Stuebner , Cyrille Pitchen , Jia-Ju Bai , , , , , , Subject: [PATCH 05/15] PCI: rockchip: Populate ->get_features() dw_pcie_ep_ops Date: Mon, 7 Jan 2019 12:11:38 +0530 Message-ID: <20190107064148.10152-6-kishon@ti.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190107064148.10152-1-kishon@ti.com> References: <20190107064148.10152-1-kishon@ti.com> MIME-Version: 1.0 X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org Populate ->get_features() dw_pcie_ep_ops to return the EPC features supported by Rockchip PCIe endpoint controller. Signed-off-by: Kishon Vijay Abraham I --- drivers/pci/controller/pcie-rockchip-ep.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) -- 2.17.1 diff --git a/drivers/pci/controller/pcie-rockchip-ep.c b/drivers/pci/controller/pcie-rockchip-ep.c index b8163c56a142..9b60ad323ac7 100644 --- a/drivers/pci/controller/pcie-rockchip-ep.c +++ b/drivers/pci/controller/pcie-rockchip-ep.c @@ -505,6 +505,18 @@ static int rockchip_pcie_ep_start(struct pci_epc *epc) return 0; } +static const struct pci_epc_features rockchip_pcie_epc_features = { + .linkup_notifier = false, + .msi_capable = true, + .msix_capable = false, +}; + +static const struct pci_epc_features* +rockchip_pcie_ep_get_features(struct pci_epc *epc, u8 func_no) +{ + return &rockchip_pcie_epc_features; +} + static const struct pci_epc_ops rockchip_pcie_epc_ops = { .write_header = rockchip_pcie_ep_write_header, .set_bar = rockchip_pcie_ep_set_bar, @@ -515,6 +527,7 @@ static const struct pci_epc_ops rockchip_pcie_epc_ops = { .get_msi = rockchip_pcie_ep_get_msi, .raise_irq = rockchip_pcie_ep_raise_irq, .start = rockchip_pcie_ep_start, + .get_features = rockchip_pcie_ep_get_features, }; static int rockchip_pcie_parse_ep_dt(struct rockchip_pcie *rockchip, From patchwork Mon Jan 7 06:41:42 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kishon Vijay Abraham I X-Patchwork-Id: 154856 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp3171182ljp; Sun, 6 Jan 2019 22:43:45 -0800 (PST) X-Google-Smtp-Source: ALg8bN49pi1H9NuMEz9s2F+CGgawAKr5gzfeqmNki/PTU3UMNvtQU39hGDVO6IjeTsmxs/tL2S4A X-Received: by 2002:a17:902:690c:: with SMTP id j12mr59712721plk.206.1546843425528; Sun, 06 Jan 2019 22:43:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1546843425; cv=none; d=google.com; s=arc-20160816; b=09xb2zYT861wdsPZrINweJCLOsXupGr2ycDIxryCgm1pX1KKt/7pCFjAPScRD7aj1p bVjuX1SJSV2/pWDt7S7iVdOhsnlaQsNTQBZZ2QbEYisdO0yNezx/V7XPofmtMzs+nyq8 HqzzhFPGEnshJARSeubxtob8VLrHdWsHar5bPbiG1gIUPEUeSXgd7XFfrIcrk+nBAsd/ sDVAEpV7k9iRLc4wu4f8RzWYJ9arDQpBv7xoeuzevbf9tB1nOz4wmkiNloWBwghhYn03 CUM3OmweR0CZ72a41OhVkDi8kVPe+PesMBgfYiFmaK8UO8P7MSNk36PHkcUdINQyE/yr VkZQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=DS7GtGkD91osbAa6RekCVW+2i6NQKOGWzWvT8VJgdzc=; b=bIOboNZAwx6/pNB3AA+pcFWvvHsJFD5hyg+Gkz+3lRoHiCqzebRMpZTJyTtiG98O2I 3C+zxHYa+9vc51L8nhGI6aOdjbhwdjt4c4I6gCE2XeZmj4C+qRtzrwRMF4vkoKpCYUlV db4ra/zUD6OG7TP9v8eQdY2138FB255GHewOgETfnsxpMRVOz1znSxp00gHLREe22Zkn GXTP0kNl127ViCIZGAGk/igmYieUt3+1vZ8XQ0M7pgKUbl0aupxBAQ1NnVqvNWG5bXvH TxmsR1yO9RjeO9UiYKsA442pEnrstesyoAVDDxVj5saryJ7PIiOPtx4gX3Q+n3QGlb5B XPJQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=tjvX4ev0; spf=pass (google.com: best guess record for domain of linux-omap-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-omap-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j66si16679107pfb.182.2019.01.06.22.43.45; Sun, 06 Jan 2019 22:43:45 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-omap-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=tjvX4ev0; spf=pass (google.com: best guess record for domain of linux-omap-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-omap-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726560AbfAGGno (ORCPT + 5 others); Mon, 7 Jan 2019 01:43:44 -0500 Received: from fllv0016.ext.ti.com ([198.47.19.142]:36726 "EHLO fllv0016.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726537AbfAGGno (ORCPT ); Mon, 7 Jan 2019 01:43:44 -0500 Received: from lelv0265.itg.ti.com ([10.180.67.224]) by fllv0016.ext.ti.com (8.15.2/8.15.2) with ESMTP id x076hQNj021727; Mon, 7 Jan 2019 00:43:26 -0600 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1546843406; bh=DS7GtGkD91osbAa6RekCVW+2i6NQKOGWzWvT8VJgdzc=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=tjvX4ev0+qVhU5xdcbfSfB7Zao9BgkuQzB3XiQF/o4jMMF2A2/y+PLla4nnBW/Rov IpGsNA0l4LHQULVRP2gnysMk9SUOLzMcvruyZwzl2EKerQ75Sx+D44kViyHIu0K4sG gPe0fGm1OALtS8h1BZ8rE7d9hw5PEzBmGmkjUBjM= Received: from DFLE105.ent.ti.com (dfle105.ent.ti.com [10.64.6.26]) by lelv0265.itg.ti.com (8.15.2/8.15.2) with ESMTPS id x076hQow049058 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Mon, 7 Jan 2019 00:43:26 -0600 Received: from DFLE106.ent.ti.com (10.64.6.27) by DFLE105.ent.ti.com (10.64.6.26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1591.10; Mon, 7 Jan 2019 00:43:26 -0600 Received: from dflp32.itg.ti.com (10.64.6.15) by DFLE106.ent.ti.com (10.64.6.27) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.1591.10 via Frontend Transport; Mon, 7 Jan 2019 00:43:26 -0600 Received: from a0393678ub.india.ti.com (ileax41-snat.itg.ti.com [10.172.224.153]) by dflp32.itg.ti.com (8.14.3/8.13.8) with ESMTP id x076gfo6002672; Mon, 7 Jan 2019 00:43:22 -0600 From: Kishon Vijay Abraham I To: Lorenzo Pieralisi , Bjorn Helgaas , Gustavo Pimentel , Alan Douglas , Shawn Lin CC: Jingoo Han , Heiko Stuebner , Cyrille Pitchen , Jia-Ju Bai , , , , , , Subject: [PATCH 09/15] PCI: pci-epf-test: Remove setting epf_bar flags in function driver Date: Mon, 7 Jan 2019 12:11:42 +0530 Message-ID: <20190107064148.10152-10-kishon@ti.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190107064148.10152-1-kishon@ti.com> References: <20190107064148.10152-1-kishon@ti.com> MIME-Version: 1.0 X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org Now that pci_epf_alloc_space() sets BAR MEM TYPE flags as 64Bit or 32Bit based on size, remove setting it in function driver. Signed-off-by: Kishon Vijay Abraham I --- drivers/pci/endpoint/functions/pci-epf-test.c | 4 ---- 1 file changed, 4 deletions(-) -- 2.17.1 diff --git a/drivers/pci/endpoint/functions/pci-epf-test.c b/drivers/pci/endpoint/functions/pci-epf-test.c index 3e86fa3c7da3..44cc31343a80 100644 --- a/drivers/pci/endpoint/functions/pci-epf-test.c +++ b/drivers/pci/endpoint/functions/pci-epf-test.c @@ -406,10 +406,6 @@ static int pci_epf_test_set_bar(struct pci_epf *epf) for (bar = BAR_0; bar <= BAR_5; bar++) { epf_bar = &epf->bar[bar]; - epf_bar->flags |= upper_32_bits(epf_bar->size) ? - PCI_BASE_ADDRESS_MEM_TYPE_64 : - PCI_BASE_ADDRESS_MEM_TYPE_32; - ret = pci_epc_set_bar(epc, epf->func_no, epf_bar); if (ret) { pci_epf_free_space(epf, epf_test->reg[bar], bar); From patchwork Mon Jan 7 06:41:43 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kishon Vijay Abraham I X-Patchwork-Id: 154858 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp3171315ljp; Sun, 6 Jan 2019 22:43:59 -0800 (PST) X-Google-Smtp-Source: ALg8bN7iZyjw1UoBDBnRF8dvb7agdA/EWv3wEq4+kSH7+W8lj7HqqzDZsLNBpr7arrcri8u7Rj/D X-Received: by 2002:a17:902:7c05:: with SMTP id x5mr59212552pll.273.1546843438996; Sun, 06 Jan 2019 22:43:58 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1546843438; cv=none; d=google.com; s=arc-20160816; b=KfiL/foHmNHZ9rssUr5QLLXJtIFTKCGfP62GSBMrdJJsxzlgbuXHt8kKF2ND07CaY2 JagV3l3MzNSeiOYpjZobBNgedeGucXY/Ox2QCwFEpqIQ3Cu+CKh5uiLzUd+x+3XCAkyI g/rZxwgtnkVdUfMajC+bEPSfhTtiZiOoMc0T20MKKNH/7N9dyTkUfooLyeACz5bBdopV JoWXJoUPP8J7q24EjV0oehUjB6eWtk4bTBy7dKdLq6xR9J6VOrSqPfJNvXeBzhhCh8Ll OtQgbuZZ9LpXl9Zb5Xh5EaQhC45f1PjYNkYwQv+YXRTYMcZtPYNQlVLkbSxRKGzfgG2T 75Hw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=9uy7oBAgopBKXmOWf1Xu6i0EmqFED+atLS7+JVzPan8=; b=SL0Qx4oOn7I2mDcPFbFEZA584FwqE1iGQ5NbOA9ZZzZI2IhF5eb0Hxf0Knpo7+AYCq 5Qolz8xdxEbW0xVWh0iCwEWn53JLTpclXJZ2W76GEh6wT+oZ9UXwaT3j8dRXjyOMHLrD /Qryb+yQU1T88O0GPy7R7+19vb77Y9bVs1/O1kF081+S9V7veiqR5OTtWD+jNRF+tlkp hJP1nciT3FPnmtUV9Qz7f80AEBWvgZqblpepF0LJmbOcHoPIcBGcfg2A422ikKDztEFb dk2ckas+XxA8PcUOo0Enjz3ckmPU400z59SkPkCk3nSXBNcOr7u06hrJ+ESNed3uXS15 AIKg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=JYWkdfNv; spf=pass (google.com: best guess record for domain of linux-omap-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-omap-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id o192si21717713pgo.129.2019.01.06.22.43.58; Sun, 06 Jan 2019 22:43:58 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-omap-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=JYWkdfNv; spf=pass (google.com: best guess record for domain of linux-omap-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-omap-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726596AbfAGGn6 (ORCPT + 5 others); Mon, 7 Jan 2019 01:43:58 -0500 Received: from fllv0015.ext.ti.com ([198.47.19.141]:41086 "EHLO fllv0015.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725804AbfAGGn5 (ORCPT ); Mon, 7 Jan 2019 01:43:57 -0500 Received: from fllv0035.itg.ti.com ([10.64.41.0]) by fllv0015.ext.ti.com (8.15.2/8.15.2) with ESMTP id x076hUCk059031; Mon, 7 Jan 2019 00:43:30 -0600 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1546843410; bh=9uy7oBAgopBKXmOWf1Xu6i0EmqFED+atLS7+JVzPan8=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=JYWkdfNv1+e1GG3acZ9gMSouaODqZz61M0RplwA1XRHpoOBXPR+m2NpGK9wh60yN/ I0S5fdtEZQlaB57gc9lWAtGb1YXw29A6O3MtjBhw7qA0gJQMB7tbjnpIjdV9cMheao YPIgPv+ma6VzsGONL3s77GSYs5s1rnFmemOjiEwU= Received: from DFLE101.ent.ti.com (dfle101.ent.ti.com [10.64.6.22]) by fllv0035.itg.ti.com (8.15.2/8.15.2) with ESMTPS id x076hUZE038637 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Mon, 7 Jan 2019 00:43:30 -0600 Received: from DFLE105.ent.ti.com (10.64.6.26) by DFLE101.ent.ti.com (10.64.6.22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1591.10; Mon, 7 Jan 2019 00:43:30 -0600 Received: from dflp32.itg.ti.com (10.64.6.15) by DFLE105.ent.ti.com (10.64.6.26) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.1591.10 via Frontend Transport; Mon, 7 Jan 2019 00:43:30 -0600 Received: from a0393678ub.india.ti.com (ileax41-snat.itg.ti.com [10.172.224.153]) by dflp32.itg.ti.com (8.14.3/8.13.8) with ESMTP id x076gfo7002672; Mon, 7 Jan 2019 00:43:26 -0600 From: Kishon Vijay Abraham I To: Lorenzo Pieralisi , Bjorn Helgaas , Gustavo Pimentel , Alan Douglas , Shawn Lin CC: Jingoo Han , Heiko Stuebner , Cyrille Pitchen , Jia-Ju Bai , , , , , , Subject: [PATCH 10/15] PCI: pci-epf-test: Do not allocate next BARs memory if current BAR is 64Bit Date: Mon, 7 Jan 2019 12:11:43 +0530 Message-ID: <20190107064148.10152-11-kishon@ti.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190107064148.10152-1-kishon@ti.com> References: <20190107064148.10152-1-kishon@ti.com> MIME-Version: 1.0 X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org It's useless to allocate memory for next BAR if the current BAR is a 64Bit BAR. Stop allocating memory for the next BAR, if the current BARs flag indicates this is a 64Bit BAR. Signed-off-by: Kishon Vijay Abraham I --- drivers/pci/endpoint/functions/pci-epf-test.c | 4 ++++ 1 file changed, 4 insertions(+) -- 2.17.1 diff --git a/drivers/pci/endpoint/functions/pci-epf-test.c b/drivers/pci/endpoint/functions/pci-epf-test.c index 44cc31343a80..ade296180383 100644 --- a/drivers/pci/endpoint/functions/pci-epf-test.c +++ b/drivers/pci/endpoint/functions/pci-epf-test.c @@ -429,6 +429,7 @@ static int pci_epf_test_alloc_space(struct pci_epf *epf) { struct pci_epf_test *epf_test = epf_get_drvdata(epf); struct device *dev = &epf->dev; + struct pci_epf_bar *epf_bar; void *base; int bar; enum pci_barno test_reg_bar = epf_test->test_reg_bar; @@ -442,6 +443,7 @@ static int pci_epf_test_alloc_space(struct pci_epf *epf) epf_test->reg[test_reg_bar] = base; for (bar = BAR_0; bar <= BAR_5; bar++) { + epf_bar = &epf->bar[bar]; if (bar == test_reg_bar) continue; base = pci_epf_alloc_space(epf, bar_size[bar], bar); @@ -449,6 +451,8 @@ static int pci_epf_test_alloc_space(struct pci_epf *epf) dev_err(dev, "Failed to allocate space for BAR%d\n", bar); epf_test->reg[bar] = base; + if (epf_bar->flags & PCI_BASE_ADDRESS_MEM_TYPE_64) + bar++; } return 0;