From patchwork Mon Jan 7 06:41:35 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: 154854 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp3171023ljp; Sun, 6 Jan 2019 22:43:30 -0800 (PST) X-Google-Smtp-Source: ALg8bN75If7FmSI3S4cGQa1nnG9r3WsBEx38YEoz1g7gxJDN1ylJBQKwWysWHuzMjwFn0eb4W0u+ X-Received: by 2002:a17:902:6a8c:: with SMTP id n12mr60541364plk.85.1546843410380; Sun, 06 Jan 2019 22:43:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1546843410; cv=none; d=google.com; s=arc-20160816; b=ALIw7K4MUtBkgQyN+tsSQNWgjAlUAwoSKURyPyTuzZ63wOvGKH851YsrNjqmXq59bE bC4iIwaHdxxqtyDQmmT+5gX67nIRst7LNnqmIXGgUU4QulS9qJbVyZvvH9YyxUgF6GbW NyXnpuQ83X0bMV7tVGw6x8aHpK8PEqMOVQXC3XNHBJDLbC3NjTnvvmBOKR7OWSSKSygS IaI8nWfl4MCDHgWnFpGuDghrV4zQVZCbS+DOPNVCwLeOoawpwqkhrNDv7Rv7VN0/o9GO xTIj4bKZJjqoXhaUCkTSFrls9WF+cWAXPmA3fqj7tQ7lmf/GDAC251AcKWD0lIYIgeV4 Saww== 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=cErqiu0ARQGyKCvuDtnfQEI4ZlZ26OR+gjwxCf8dAg4=; b=rZu6YomkKkfWEcKryS4kvQlWc89yN1T4cIs8lxezMsZ2z0eXDKGLYb6tdyADCEGqBp NPE4jPiWQmV8BtkkPZ4hC5biLgRu2/SZnHHGnPRPVW+qgblLvpvNyy0uL5blNw6QuEQE cOKyPwVNoLdjYDNKCwLCEQVUWyXwuzh4VvW9YNvG4kRGv7elkV6fPcBNXjtLFNDiIXk4 knfY+zq0TrncgDy10co+e/XtyShusQeJ2gfNal3j+mLN+PNogqtoIc+CdZpNCuiM+coY sXEr5HwIP4Q/SUvPOtDaiR1aHhad7YzbNaCohK43q7K8ZNHuI4AoOGq1hdXwunLhIYp/ LucA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=mNkGRDzs; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-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 i13si10886644pgi.260.2019.01.06.22.43.30; Sun, 06 Jan 2019 22:43:30 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-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=mNkGRDzs; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-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 S1726540AbfAGGn2 (ORCPT + 31 others); Mon, 7 Jan 2019 01:43:28 -0500 Received: from lelv0143.ext.ti.com ([198.47.23.248]:38890 "EHLO lelv0143.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725771AbfAGGnZ (ORCPT ); Mon, 7 Jan 2019 01:43:25 -0500 Received: from lelv0265.itg.ti.com ([10.180.67.224]) by lelv0143.ext.ti.com (8.15.2/8.15.2) with ESMTP id x076gulx055152; Mon, 7 Jan 2019 00:42:56 -0600 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1546843376; bh=cErqiu0ARQGyKCvuDtnfQEI4ZlZ26OR+gjwxCf8dAg4=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=mNkGRDzsJSoQ8ZeDWejeSfoGil7FdYS/sbmTF5HMpMiq0JIwEEjfCLA8B/GQouHAb hvLC+qB8thQvP+dvoNtDwrv82N2tvcXWsqQcCU5nn+1NmHjBU3J1Jzz2aqtDfYj2C6 XKVPlKuQfBJYdjOmOuFFNwMN95DTydqsAXv+27dk= Received: from DLEE102.ent.ti.com (dlee102.ent.ti.com [157.170.170.32]) by lelv0265.itg.ti.com (8.15.2/8.15.2) with ESMTPS id x076guv2048373 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Mon, 7 Jan 2019 00:42:56 -0600 Received: from DLEE113.ent.ti.com (157.170.170.24) by DLEE102.ent.ti.com (157.170.170.32) 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:56 -0600 Received: from dflp32.itg.ti.com (10.64.6.15) by DLEE113.ent.ti.com (157.170.170.24) 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:56 -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 x076gfnx002672; Mon, 7 Jan 2019 00:42:51 -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 02/15] PCI: dwc: Add ->get_features() callback function in dw_pcie_ep_ops Date: Mon, 7 Jan 2019 12:11:35 +0530 Message-ID: <20190107064148.10152-3-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-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Each platform using Designware PCIe core can support different set of endpoint features. Add a new callback function ->get_features() in dw_pcie_ep_ops so that each platform using Designware PCIe core can advertise its supported features to the endpoint function driver. Signed-off-by: Kishon Vijay Abraham I --- drivers/pci/controller/dwc/pcie-designware-ep.c | 12 ++++++++++++ drivers/pci/controller/dwc/pcie-designware.h | 1 + 2 files changed, 13 insertions(+) -- 2.17.1 diff --git a/drivers/pci/controller/dwc/pcie-designware-ep.c b/drivers/pci/controller/dwc/pcie-designware-ep.c index a543c45c7224..7a2925a16ab8 100644 --- a/drivers/pci/controller/dwc/pcie-designware-ep.c +++ b/drivers/pci/controller/dwc/pcie-designware-ep.c @@ -355,6 +355,17 @@ static int dw_pcie_ep_start(struct pci_epc *epc) return pci->ops->start_link(pci); } +static const struct pci_epc_features* +dw_pcie_ep_get_features(struct pci_epc *epc, u8 func_no) +{ + struct dw_pcie_ep *ep = epc_get_drvdata(epc); + + if (!ep->ops->get_features) + return NULL; + + return ep->ops->get_features(ep); +} + static const struct pci_epc_ops epc_ops = { .write_header = dw_pcie_ep_write_header, .set_bar = dw_pcie_ep_set_bar, @@ -368,6 +379,7 @@ static const struct pci_epc_ops epc_ops = { .raise_irq = dw_pcie_ep_raise_irq, .start = dw_pcie_ep_start, .stop = dw_pcie_ep_stop, + .get_features = dw_pcie_ep_get_features, }; int dw_pcie_ep_raise_legacy_irq(struct dw_pcie_ep *ep, u8 func_no) diff --git a/drivers/pci/controller/dwc/pcie-designware.h b/drivers/pci/controller/dwc/pcie-designware.h index 9943d8c68335..1f56e6ae34ff 100644 --- a/drivers/pci/controller/dwc/pcie-designware.h +++ b/drivers/pci/controller/dwc/pcie-designware.h @@ -192,6 +192,7 @@ struct dw_pcie_ep_ops { void (*ep_init)(struct dw_pcie_ep *ep); int (*raise_irq)(struct dw_pcie_ep *ep, u8 func_no, enum pci_epc_irq_type type, u16 interrupt_num); + const struct pci_epc_features* (*get_features)(struct dw_pcie_ep *ep); }; struct dw_pcie_ep { From patchwork Mon Jan 7 06:41:39 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: 154861 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp3171431ljp; Sun, 6 Jan 2019 22:44:08 -0800 (PST) X-Google-Smtp-Source: ALg8bN5Sic6PZTZbr2zgUbfXA5iQpF4SgZspbYLQsPbUt/fmRJwYwkSPWMcNrQOJnhGPKgWTgnDb X-Received: by 2002:a17:902:2c83:: with SMTP id n3mr60788330plb.104.1546843448083; Sun, 06 Jan 2019 22:44:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1546843448; cv=none; d=google.com; s=arc-20160816; b=CquW0KzKlKADIa2PAsgqC9y+tDy/JXNWt/HLn4ZhGd6O4hjRxyIFQlj1+xrzzymJvJ zgmbPL531zJXkjEBz9lUCirpfTyEVf/wbDK3gGFBcFcwy7sXdUO3+lDZZbhmN9pJImVA evpc51lsDiIkBQeFrP1x8gmliPXp1W8xYm8rWtnM9xRpisBlOtUZIxLx2AFTWPFia9fd NZzu9eDb38Ok6q6W7LZYf6LCAoGxfC4LaTVxquVpF+yHdBZ71WrpuKR0jerBXgQPEAiK QPvjY+ET3djLM95iFuC7WkXaDUrFCIA2sFJ+pu8PLJdfnJqn+ESp6RNfQF4S0apDAxgB vH2Q== 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=7BZqM5lihQv/21d7TmC8rclZDArMN5iGSCdWQmZG2ac=; b=WfSPOJiO6najj1m+esFi1lKnfnXF2mbwdBvkB6Na0itqAsuxqY+RXT9Owx520PcdOA wLZOB9ZJxhcnDT/R6unzbA85TdFW20mVLg8+pWvrmHI8Mm9yygUQvbn5dMTduxd7lncj pVttC/o3jyPK6778TdpEEuMurHwR1AjfZNb4Ny+dk2UsLONcbu+/lpWKNGBTuJlSfp6z pQmZ/C+tzD1BRb38O5wypmU9J83k7RP6H7q4GCAAMGqw7w34sCMP/EopmjdLcfnGT3cC cjwaDxLzLU8C+nv1JP9pjqgJNp7xqusB2WBiJe3zC2oYA9PiWFbfmHUn90xrEppaQuJH 0opA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=GpSd2ahK; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-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 j17si6450470pfd.113.2019.01.06.22.44.07; Sun, 06 Jan 2019 22:44:08 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-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=GpSd2ahK; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-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 S1726674AbfAGGoH (ORCPT + 31 others); Mon, 7 Jan 2019 01:44:07 -0500 Received: from fllv0016.ext.ti.com ([198.47.19.142]:36794 "EHLO fllv0016.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726647AbfAGGoE (ORCPT ); Mon, 7 Jan 2019 01:44:04 -0500 Received: from fllv0035.itg.ti.com ([10.64.41.0]) by fllv0016.ext.ti.com (8.15.2/8.15.2) with ESMTP id x076hDVM021658; Mon, 7 Jan 2019 00:43:13 -0600 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1546843393; bh=7BZqM5lihQv/21d7TmC8rclZDArMN5iGSCdWQmZG2ac=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=GpSd2ahKxWrTJHYfGwg4GDpLvKh0L4Hw63vMjt0GgWfYhz3t0Tlms+AU4zWrLNmv+ suQe5kIkYsPpL4cwBCt8SHYsORNsaRcSB9X1+jEy1C0Zo4P0QB3MJMopHSQbN6gR11 6dpkF2HyhJtqdvqNg+kowP9Zbcv+bUzeL6mc8r5g= Received: from DLEE102.ent.ti.com (dlee102.ent.ti.com [157.170.170.32]) by fllv0035.itg.ti.com (8.15.2/8.15.2) with ESMTPS id x076hDEN038427 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Mon, 7 Jan 2019 00:43:13 -0600 Received: from DLEE114.ent.ti.com (157.170.170.25) by DLEE102.ent.ti.com (157.170.170.32) 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:13 -0600 Received: from dflp32.itg.ti.com (10.64.6.15) by DLEE114.ent.ti.com (157.170.170.25) 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:13 -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 x076gfo3002672; Mon, 7 Jan 2019 00:43:09 -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 06/15] PCI: cadence: Populate ->get_features() cdns_pcie_epc_ops Date: Mon, 7 Jan 2019 12:11:39 +0530 Message-ID: <20190107064148.10152-7-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-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Populate ->get_features() dw_pcie_ep_ops to return the EPC features supported by Cadence PCIe endpoint controller. Signed-off-by: Kishon Vijay Abraham I --- drivers/pci/controller/pcie-cadence-ep.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) -- 2.17.1 diff --git a/drivers/pci/controller/pcie-cadence-ep.c b/drivers/pci/controller/pcie-cadence-ep.c index c3a088910f48..14c2545bb17e 100644 --- a/drivers/pci/controller/pcie-cadence-ep.c +++ b/drivers/pci/controller/pcie-cadence-ep.c @@ -411,6 +411,18 @@ static int cdns_pcie_ep_start(struct pci_epc *epc) return 0; } +static const struct pci_epc_features cdns_pcie_epc_features = { + .linkup_notifier = false, + .msi_capable = true, + .msix_capable = false, +}; + +static const struct pci_epc_features* +cdns_pcie_ep_get_features(struct pci_epc *epc, u8 func_no) +{ + return &cdns_pcie_epc_features; +} + static const struct pci_epc_ops cdns_pcie_epc_ops = { .write_header = cdns_pcie_ep_write_header, .set_bar = cdns_pcie_ep_set_bar, @@ -421,6 +433,7 @@ static const struct pci_epc_ops cdns_pcie_epc_ops = { .get_msi = cdns_pcie_ep_get_msi, .raise_irq = cdns_pcie_ep_raise_irq, .start = cdns_pcie_ep_start, + .get_features = cdns_pcie_ep_get_features, }; static const struct of_device_id cdns_pcie_ep_of_match[] = { From patchwork Mon Jan 7 06:41:40 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: 154866 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp3171874ljp; Sun, 6 Jan 2019 22:44:50 -0800 (PST) X-Google-Smtp-Source: ALg8bN4rU19WRZX3j5Wua1DyWB5gQPLWJ2MS4naNWiVsVUYU2ilg+kdkGCBrFpMBoO0NDCujv7AY X-Received: by 2002:a62:31c1:: with SMTP id x184mr63519892pfx.204.1546843489987; Sun, 06 Jan 2019 22:44:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1546843489; cv=none; d=google.com; s=arc-20160816; b=n/aotQj8NpI17G4wbjquF7CbREmU1tmXQgBXHrfB39QEO5W0xxeqjAbIcdgnDBPg9a bjIPuWkX34qcwilfy+VTFUwJnv2DcDmh1AbJZu1Z33l9DvhHwc1VkcNDgL0G/GmplCLj G5fCBZ/4pZDl12ekMf9bwdWYwp9cC2bB4Z/wB2JtLE7nWKCH0dIO0+r0zvLyLsRnAbYZ IKskofPs4gElKb7Gb5PGfkfb9M3v3NTkvdKnGNjeBdGhbglmD5SfDAcO2d6kKo9+YTZC bcz5/RBThirFDCCU4CvDPcX2pLlZOTd/Opq1AmOSbwKmCeYQarq1edh4oe+1CfQRhIl8 EXoQ== 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=wJzish8jKdOVXhvaJ7MTD1mt6K3UYjBXhrK5Hbnol9E=; b=WBoYQQi034X7ip5myGFDkC46eZkmTfxgWEkCawH7iDiEzEEC/2RjebSzAap3ktE/d4 Rs1+Uu7PEZfeWY93FD6ATZ0fSfggUJXVsKSwRaiCof+bvEyVuFIH8ppXRdYs476cGgfw yiY/xwL/2FbwBnNA7ZrHCXCaSrlri4QTnsg1gIjFvfL6TKfTdVI8xoMM7yv+gi7kVGBw nEv3e+M47TmqQehULJgo3gt9xMIS9OI/dS5stFpnpj04CcorV7i1JQ7hM8/83amEv69C 8entdUlaKcPl7e25xiaBb/wciayh2LZ3SHV+evq/AACNiEA1/ZQNCEU0RXGkt8444GXK AWbQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b="W8zH/Zjh"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-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 y189si65253978pfg.75.2019.01.06.22.44.49; Sun, 06 Jan 2019 22:44:49 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-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="W8zH/Zjh"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-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 S1726754AbfAGGos (ORCPT + 31 others); Mon, 7 Jan 2019 01:44:48 -0500 Received: from fllv0016.ext.ti.com ([198.47.19.142]:36896 "EHLO fllv0016.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726446AbfAGGor (ORCPT ); Mon, 7 Jan 2019 01:44:47 -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 x076hI62021681; Mon, 7 Jan 2019 00:43:18 -0600 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1546843398; bh=wJzish8jKdOVXhvaJ7MTD1mt6K3UYjBXhrK5Hbnol9E=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=W8zH/Zjhszg3u1sMPVtKto0NvGJTmMf2q8FabmjBspWvtjOuZEawEp7qr8Is7V051 iR6iWyfnmPSyXHJn77KzkxoeZJcMUbWEEiy3GhD2H8kjeBMbp3PzICw/OUfXtQmAjk 4f2Z/MQM7roIY3iOkoZyJMEsdMcoApmw/0tIzftA= Received: from DFLE101.ent.ti.com (dfle101.ent.ti.com [10.64.6.22]) by lelv0265.itg.ti.com (8.15.2/8.15.2) with ESMTPS id x076hHit048943 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Mon, 7 Jan 2019 00:43:17 -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:17 -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:17 -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 x076gfo4002672; Mon, 7 Jan 2019 00:43:14 -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 07/15] PCI: endpoint: Add helper to get first unreserved BAR Date: Mon, 7 Jan 2019 12:11:40 +0530 Message-ID: <20190107064148.10152-8-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-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Add a helper function pci_epc_get_first_free_bar(), to get the first unreserved BAR that can be used for endpoint function. Signed-off-by: Kishon Vijay Abraham I --- drivers/pci/endpoint/pci-epc-core.c | 22 ++++++++++++++++++++++ include/linux/pci-epc.h | 1 + 2 files changed, 23 insertions(+) -- 2.17.1 diff --git a/drivers/pci/endpoint/pci-epc-core.c b/drivers/pci/endpoint/pci-epc-core.c index 5a099479d9ab..b1632f91e33e 100644 --- a/drivers/pci/endpoint/pci-epc-core.c +++ b/drivers/pci/endpoint/pci-epc-core.c @@ -83,6 +83,28 @@ struct pci_epc *pci_epc_get(const char *epc_name) } EXPORT_SYMBOL_GPL(pci_epc_get); +/** + * pci_epc_get_first_free_bar() - helper to get first unreserved BAR + * @epc_features: pci_epc_features structure that holds the reserved bar bitmap + * + * Invoke to get the first unreserved BAR that can be used for endpoint + * function. + */ +int pci_epc_get_first_free_bar(const struct pci_epc_features *epc_features) +{ + int free_bar; + + if (!epc_features) + return 0; + + free_bar = ffz(epc_features->reserved_bar); + if (free_bar <= 0 || free_bar > 6) + return -EINVAL; + + return free_bar; +} +EXPORT_SYMBOL_GPL(pci_epc_get_first_free_bar); + /** * pci_epc_get_features() - get the features supported by EPC * @epc: the features supported by *this* EPC device will be returned diff --git a/include/linux/pci-epc.h b/include/linux/pci-epc.h index 79fbcf94e14d..dc3513a2f88a 100644 --- a/include/linux/pci-epc.h +++ b/include/linux/pci-epc.h @@ -180,6 +180,7 @@ 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); +int pci_epc_get_first_free_bar(const struct pci_epc_features *epc_features); 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:41 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: 154865 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp3171768ljp; Sun, 6 Jan 2019 22:44:40 -0800 (PST) X-Google-Smtp-Source: ALg8bN7riMy62VmqTmcqqHWRicJ6ey2gFOlbPQw9pAPquaLKtzgvjHD4NOB3vkbagyHwraibnr00 X-Received: by 2002:a17:902:ab92:: with SMTP id f18mr58125902plr.221.1546843480282; Sun, 06 Jan 2019 22:44:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1546843480; cv=none; d=google.com; s=arc-20160816; b=VobowcQdK5pOtdJMAyPseRIcR/PpXrMjmh6e/1rmc0J9gWgukDxN//e1lzOEbFb20O oA5YWAE7buNY0BaKLiQdj1WUzGdUm8+e+wGfgYdmQ9GvjtmAjSDhxbee17Laa81P8ID7 hlo8/mUU3UmcFEotHnRsnvgB0MdYTpCm9PQck7pkIgnPCAxQoziYlnCQtpA1Xg18n3Op OcDr95mEGVjKcVnVCngCK/118rEHzakB09bDrvvyFEdfuKchyqUPKh+jJkbuiyNoawwV ZDaTfwiB9l2rb6UHiyC0kiR90TkzP2UhHwyim8NuTtZdUpitQZrQ4rrLdNhLV0GO0HAQ qgSw== 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=fGpp7AJSp2QJ3b2BXU0YJ9gjYR4vq9hY+xl5l1GvJjg=; b=F3t0TiZGjGeJqoZvEvuFlZCmEyJDp697HJe+Uih3h7NzAQ3G12uW++5hydhyiyqwXo yDFX8d1xQv1a1P1oGBNabBDZRyVrXeiigOFeDdq1deXhDn4SeVUujcOlmEdK2yX2Thua 0yrX+XKfH9gAq7Qw3AEkfAZxKZdbRPUHXXhheM1tM/Gh8L2A+EQruTdbD4owRq5kD5eG wFSKuEwo64QZ+fakR+pIX8nxTOt3Ctp65E8uixvN+qZHdzIkVK8HT1rriVunPTtLIGan meGqVoefu2ZqYn05xJRdx+nqziO00pinkMAoeBvor1SJIRHtV6yzdihmvJRaxcyf4vAm 8FXQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b="f5Om/+st"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-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 p11si59390976plo.363.2019.01.06.22.44.40; Sun, 06 Jan 2019 22:44:40 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-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="f5Om/+st"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-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 S1726741AbfAGGoj (ORCPT + 31 others); Mon, 7 Jan 2019 01:44:39 -0500 Received: from fllv0015.ext.ti.com ([198.47.19.141]:41164 "EHLO fllv0015.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726490AbfAGGoh (ORCPT ); Mon, 7 Jan 2019 01:44:37 -0500 Received: from fllv0034.itg.ti.com ([10.64.40.246]) by fllv0015.ext.ti.com (8.15.2/8.15.2) with ESMTP id x076hMd2058992; Mon, 7 Jan 2019 00:43:22 -0600 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1546843402; bh=fGpp7AJSp2QJ3b2BXU0YJ9gjYR4vq9hY+xl5l1GvJjg=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=f5Om/+st/MScAiW6ANrI7uGL8EEKLXfvgxV1PXOPZBmZ1ZALX0nPsQNvoVFRPq3oO OiSi7bNNF3HWc1dBLNCGdwRIZg2E3JxcamMfKZm2LuRHxsyTYp8t2XpxbR5rN3gqjw bCOiyNlqhbm8He6cFjPPT/CHm7MKowBYuKiGAqec= Received: from DLEE103.ent.ti.com (dlee103.ent.ti.com [157.170.170.33]) by fllv0034.itg.ti.com (8.15.2/8.15.2) with ESMTPS id x076hMSs021096 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Mon, 7 Jan 2019 00:43:22 -0600 Received: from DLEE102.ent.ti.com (157.170.170.32) by DLEE103.ent.ti.com (157.170.170.33) 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:22 -0600 Received: from dflp32.itg.ti.com (10.64.6.15) by DLEE102.ent.ti.com (157.170.170.32) 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:22 -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 x076gfo5002672; Mon, 7 Jan 2019 00:43:18 -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 08/15] PCI: endpoint: Fix pci_epf_alloc_space to set correct MEM TYPE flags Date: Mon, 7 Jan 2019 12:11:41 +0530 Message-ID: <20190107064148.10152-9-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-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org pci_epf_alloc_space() sets the MEM TYPE flags to indicate a 32-bit Base Address Register irrespective of the size. Fix it here to indicate 64-bit BAR if the size is > 2GB. Signed-off-by: Kishon Vijay Abraham I --- drivers/pci/endpoint/pci-epf-core.c | 3 +++ 1 file changed, 3 insertions(+) -- 2.17.1 diff --git a/drivers/pci/endpoint/pci-epf-core.c b/drivers/pci/endpoint/pci-epf-core.c index 825fa24427a3..cd395cb7dfd9 100644 --- a/drivers/pci/endpoint/pci-epf-core.c +++ b/drivers/pci/endpoint/pci-epf-core.c @@ -132,6 +132,9 @@ void *pci_epf_alloc_space(struct pci_epf *epf, size_t size, enum pci_barno bar) epf->bar[bar].size = size; epf->bar[bar].barno = bar; epf->bar[bar].flags = PCI_BASE_ADDRESS_SPACE_MEMORY; + epf->bar[bar].flags |= upper_32_bits(size) ? + PCI_BASE_ADDRESS_MEM_TYPE_64 : + PCI_BASE_ADDRESS_MEM_TYPE_32; return space; } From patchwork Mon Jan 7 06:41:44 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: 154860 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp3171395ljp; Sun, 6 Jan 2019 22:44:06 -0800 (PST) X-Google-Smtp-Source: ALg8bN4qyQTiUxjd+ZpXwS0V2DDrdr7wLv1S17JK2BtkIRiZWx7UJcqH06z443n3LiFgObqwpLDM X-Received: by 2002:a63:c451:: with SMTP id m17mr9850741pgg.27.1546843445925; Sun, 06 Jan 2019 22:44:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1546843445; cv=none; d=google.com; s=arc-20160816; b=ZMhyFKzgvJsqyQb1Z6RXl9P7G8KiCc8m0/p0c/HRhfukPTrW9XgvVTJcA77TLQC8G0 eY4lawjg3jbK2M6ppKjC8JCJJwx7FzK3xQ25pWjsTeueQULVu8CGqmktdhfdkwW76qD/ i+IaL2ja+zObJfteTmrfEBFTfDnxt1E0HlH0nKTVxq5guZqp1OFB0XtsJtzMlZ4MWe/o 32dpiIvMODWYZ9y8dvdq5MrZ8cWh11YpvWTwNxDUKxGW7VWrPHk5+wEcC+4Lf1VrjbnT VJk/PwZ9LTlIlrbBdW7L5+DZ2gfbqB9oEX+ZzC+5rI9wb1MFk6FxZLIrk4rZ4G5qfncP ysmg== 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=I1BEPEyj0/HrX7NYKrqEJYA/4rslF5P7456ZRPE0ths=; b=p3uwQAYjojoGrru5+bFyMsHyi87DJpY8ndQz8SDRsCENk9pz8+QtEampBtTR/GIfcK i13AqHTvqceQXtqVJHlsilirWJ3zKn6uA1JAch8YAZ672J1Lny/96nCLcUzkc+YRIhw+ RdyPxPIm+7gfqrHmznEAH8PlZBXb3HjvMkqQjNhxSm7WkLBez9fbVF0FRish3fgdj4jo CfMvevLJv0q7Iek7qBU3zkn5j/0evenowGxohe/ANlodcaUkSQ+47wqYlbTTTPjszTjU zq55fPlJVEKrb7la7dSWcNdnOuhW/wdcuRXbhQrfdND5GGAMdCUTokROrzIv97PWGzvF RxKQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=JZsfIhRr; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-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 j17si6450470pfd.113.2019.01.06.22.44.05; Sun, 06 Jan 2019 22:44:05 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-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=JZsfIhRr; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-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 S1726655AbfAGGoE (ORCPT + 31 others); Mon, 7 Jan 2019 01:44:04 -0500 Received: from fllv0015.ext.ti.com ([198.47.19.141]:41094 "EHLO fllv0015.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726613AbfAGGoA (ORCPT ); Mon, 7 Jan 2019 01:44:00 -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 x076hZRx059042; Mon, 7 Jan 2019 00:43:35 -0600 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1546843415; bh=I1BEPEyj0/HrX7NYKrqEJYA/4rslF5P7456ZRPE0ths=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=JZsfIhRr3LWz1cdE8NnKTtVCTFa/Z0B6e7mbtVJKhniihvqefOIVHBYaKQXTxZRei U3ZP8hHfDc/R7vciQ1B7JPO6um3dqh78LKcPMvsEit7Cu44LEBT1iH4Y70GlxFCAzw 2VY2MSm2U7XSF6e1ieXTpDTNhdodLYo7oEEnFGYs= Received: from DLEE101.ent.ti.com (dlee101.ent.ti.com [157.170.170.31]) by lelv0266.itg.ti.com (8.15.2/8.15.2) with ESMTPS id x076hZKg071461 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Mon, 7 Jan 2019 00:43:35 -0600 Received: from DLEE115.ent.ti.com (157.170.170.26) by DLEE101.ent.ti.com (157.170.170.31) 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:34 -0600 Received: from dflp32.itg.ti.com (10.64.6.15) by DLEE115.ent.ti.com (157.170.170.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:35 -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 x076gfo8002672; Mon, 7 Jan 2019 00:43:31 -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 11/15] PCI: pci-epf-test: Use pci_epc_get_features to get EPC features Date: Mon, 7 Jan 2019 12:11:44 +0530 Message-ID: <20190107064148.10152-12-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-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Use pci_epc_get_features to get EPC features such as linkup notifier support, MSI/MSIX capable, BAR configuration etc and use it for configuring pci-epf-test. Since these features are now obtained directly from EPC driver, remove pci_epf_test_data which was initially added to have EPC features in endpoint function driver. Signed-off-by: Kishon Vijay Abraham I --- drivers/pci/endpoint/functions/pci-epf-test.c | 72 ++++++++++--------- 1 file changed, 39 insertions(+), 33 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 ade296180383..a26f6ccaa322 100644 --- a/drivers/pci/endpoint/functions/pci-epf-test.c +++ b/drivers/pci/endpoint/functions/pci-epf-test.c @@ -47,8 +47,6 @@ struct pci_epf_test { void *reg[6]; struct pci_epf *epf; enum pci_barno test_reg_bar; - bool linkup_notifier; - bool msix_available; struct delayed_work cmd_handler; }; @@ -71,11 +69,6 @@ static struct pci_epf_header test_header = { .interrupt_pin = PCI_INTERRUPT_INTA, }; -struct pci_epf_test_data { - enum pci_barno test_reg_bar; - bool linkup_notifier; -}; - static size_t bar_size[] = { 512, 512, 1024, 16384, 131072, 1048576 }; static int pci_epf_test_copy(struct pci_epf_test *epf_test) @@ -458,25 +451,49 @@ static int pci_epf_test_alloc_space(struct pci_epf *epf) return 0; } +static void pci_epf_configure_bar(struct pci_epf *epf, + const struct pci_epc_features *epc_features) +{ + struct pci_epf_bar *epf_bar; + bool bar_fixed_64bit; + int i; + + for (i = BAR_0; i <= BAR_5; i++) { + epf_bar = &epf->bar[i]; + bar_fixed_64bit = !!(epc_features->bar_fixed_64bit & (1 << i)); + if (bar_fixed_64bit) + epf_bar->flags |= PCI_BASE_ADDRESS_MEM_TYPE_64; + if (epc_features->bar_fixed_size[i]) + bar_size[i] = epc_features->bar_fixed_size[i]; + } +} + static int pci_epf_test_bind(struct pci_epf *epf) { int ret; struct pci_epf_test *epf_test = epf_get_drvdata(epf); struct pci_epf_header *header = epf->header; + const struct pci_epc_features *epc_features; + enum pci_barno test_reg_bar = BAR_0; struct pci_epc *epc = epf->epc; struct device *dev = &epf->dev; + bool linkup_notifier = false; + bool msix_capable = false; + bool msi_capable = true; if (WARN_ON_ONCE(!epc)) return -EINVAL; - if (epc->features & EPC_FEATURE_NO_LINKUP_NOTIFIER) - epf_test->linkup_notifier = false; - else - epf_test->linkup_notifier = true; - - epf_test->msix_available = epc->features & EPC_FEATURE_MSIX_AVAILABLE; + epc_features = pci_epc_get_features(epc, epf->func_no); + if (!epc_features) { + linkup_notifier = epc_features->linkup_notifier; + msix_capable = epc_features->msix_capable; + msi_capable = epc_features->msi_capable; + test_reg_bar = pci_epc_get_first_free_bar(epc_features); + pci_epf_configure_bar(epf, epc_features); + } - epf_test->test_reg_bar = EPC_FEATURE_GET_BAR(epc->features); + epf_test->test_reg_bar = test_reg_bar; ret = pci_epc_write_header(epc, epf->func_no, header); if (ret) { @@ -492,13 +509,15 @@ static int pci_epf_test_bind(struct pci_epf *epf) if (ret) return ret; - ret = pci_epc_set_msi(epc, epf->func_no, epf->msi_interrupts); - if (ret) { - dev_err(dev, "MSI configuration failed\n"); - return ret; + if (msi_capable) { + ret = pci_epc_set_msi(epc, epf->func_no, epf->msi_interrupts); + if (ret) { + dev_err(dev, "MSI configuration failed\n"); + return ret; + } } - if (epf_test->msix_available) { + if (msix_capable) { ret = pci_epc_set_msix(epc, epf->func_no, epf->msix_interrupts); if (ret) { dev_err(dev, "MSI-X configuration failed\n"); @@ -506,7 +525,7 @@ static int pci_epf_test_bind(struct pci_epf *epf) } } - if (!epf_test->linkup_notifier) + if (!linkup_notifier) queue_work(kpcitest_workqueue, &epf_test->cmd_handler.work); return 0; @@ -523,17 +542,6 @@ static int pci_epf_test_probe(struct pci_epf *epf) { struct pci_epf_test *epf_test; struct device *dev = &epf->dev; - const struct pci_epf_device_id *match; - struct pci_epf_test_data *data; - enum pci_barno test_reg_bar = BAR_0; - bool linkup_notifier = true; - - match = pci_epf_match_device(pci_epf_test_ids, epf); - data = (struct pci_epf_test_data *)match->driver_data; - if (data) { - test_reg_bar = data->test_reg_bar; - linkup_notifier = data->linkup_notifier; - } epf_test = devm_kzalloc(dev, sizeof(*epf_test), GFP_KERNEL); if (!epf_test) @@ -541,8 +549,6 @@ static int pci_epf_test_probe(struct pci_epf *epf) epf->header = &test_header; epf_test->epf = epf; - epf_test->test_reg_bar = test_reg_bar; - epf_test->linkup_notifier = linkup_notifier; INIT_DELAYED_WORK(&epf_test->cmd_handler, pci_epf_test_cmd_handler); From patchwork Mon Jan 7 06:41:45 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: 154864 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp3171674ljp; Sun, 6 Jan 2019 22:44:34 -0800 (PST) X-Google-Smtp-Source: AFSGD/VsKVS5mdUTAUdXQ538+XYPnd6BCP4k1TGxSbdN6C3QqaBL6BqafcG3BulHmlM+soTEnlhZ X-Received: by 2002:a62:75d1:: with SMTP id q200mr61705857pfc.254.1546843473995; Sun, 06 Jan 2019 22:44:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1546843473; cv=none; d=google.com; s=arc-20160816; b=So0gQuuT2or2SXn2ZbNlSkkkuWjCZXX58yF9ABjbSxDL51LQD9u66LgnzOwPz1dxcQ IU9+j3JhSKPOEEnFU11jvkzeatkSJxad93eWj0dhd32NjxYbZBIJD9WoeEniJGw/nEt4 q0sGX7g9KjZFZcoPHLPh8JEzGaWNdWQ84Hsh17kAIURW7krjLSek6dIvEPCkDTNHteyR tFJDkwi0qvd17p5DUc9tBtS0s+aMqYj/Ac378IO72/KM9GZ4ilUPfp1p0pul8DEDl/IB VfVtmC9+U/NErbMJZ2Hk1KLk9/pulRcNoQDP4jgoe+A8z4VPwb5meOY2bhU0h7s6vt9t WB8A== 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=JHufpCFiR5hyFNaIpQ75Q1+qFFkM6nzfAJw54s+6OLU=; b=xP8hKw1NOFo4NaS2SDrbEbKsk4jKKH77S219YGyfLQGD9OIbfFjQf24pDVL7LkC6D7 seU/m8U8spnN7oaB9nniXQryCpGGoVk0tRuAe+9qfVnR/IcSeYmyWJQ4tPpxRwz6kuU7 +2H2hl+jaEhRV/XRFc/7h9+E6lzFMXMk302Tm/zMNmkx4OKp0L8ASgO16xeIRr4f2hkL 53G6jKqdLoybAPigCGCrCqRdGlxi8QfGu5zlgfwPm3TkVNOLTlqGB/IApEf73GWTsRsb nO1uUil00+mfyaewYKj3mMvIwXXSAlSZqGXNxmGsyUft2R9uuevCN3SXNBm0ONu08DrT QEQg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=MBObeyt6; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-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 p11si59390976plo.363.2019.01.06.22.44.33; Sun, 06 Jan 2019 22:44:33 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-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=MBObeyt6; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-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 S1726723AbfAGGoc (ORCPT + 31 others); Mon, 7 Jan 2019 01:44:32 -0500 Received: from lelv0143.ext.ti.com ([198.47.23.248]:39046 "EHLO lelv0143.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726602AbfAGGn6 (ORCPT ); Mon, 7 Jan 2019 01:43:58 -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 x076hdpd055394; Mon, 7 Jan 2019 00:43:39 -0600 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1546843419; bh=JHufpCFiR5hyFNaIpQ75Q1+qFFkM6nzfAJw54s+6OLU=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=MBObeyt6dnvi1vJS559IYKSldAfq7ColwoeIx5+OqlXRnlffir47/KGV+Zer1iQiJ 1xC3DsidrE0ec8VBZkNZ3M83NFMD2TL3xkHpI0QKA9vRXUHXTJxaYqjC/sPmnmmybl j7tClpnbpereIioUcSwrkRglhWQBGzuy1K+Onw/g= 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 x076hdtF038724 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Mon, 7 Jan 2019 00:43:39 -0600 Received: from DLEE103.ent.ti.com (157.170.170.33) 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:43:39 -0600 Received: from dflp32.itg.ti.com (10.64.6.15) by DLEE103.ent.ti.com (157.170.170.33) 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:39 -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 x076gfo9002672; Mon, 7 Jan 2019 00:43:35 -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 12/15] PCI: cadence: Remove pci_epf_linkup from Cadence EP driver Date: Mon, 7 Jan 2019 12:11:45 +0530 Message-ID: <20190107064148.10152-13-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-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org pci_epf_linkup is intended to be invoked if the EPC supports linkup notification. Now that pci-epf-test uses get_features callback, which indicates Cadence EP driver doesn't support linkup notification, remove pci_epf_linkup from Cadence EP driver. Signed-off-by: Kishon Vijay Abraham I --- drivers/pci/controller/pcie-cadence-ep.c | 12 ------------ 1 file changed, 12 deletions(-) -- 2.17.1 diff --git a/drivers/pci/controller/pcie-cadence-ep.c b/drivers/pci/controller/pcie-cadence-ep.c index 14c2545bb17e..def7820cb824 100644 --- a/drivers/pci/controller/pcie-cadence-ep.c +++ b/drivers/pci/controller/pcie-cadence-ep.c @@ -396,18 +396,6 @@ static int cdns_pcie_ep_start(struct pci_epc *epc) cfg |= BIT(epf->func_no); cdns_pcie_writel(pcie, CDNS_PCIE_LM_EP_FUNC_CFG, cfg); - /* - * The PCIe links are automatically established by the controller - * once for all at powerup: the software can neither start nor stop - * those links later at runtime. - * - * Then we only have to notify the EP core that our links are already - * established. However we don't call directly pci_epc_linkup() because - * we've already locked the epc->lock. - */ - list_for_each_entry(epf, &epc->pci_epf, list) - pci_epf_linkup(epf); - return 0; } From patchwork Mon Jan 7 06:41:46 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: 154859 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp3171343ljp; Sun, 6 Jan 2019 22:44:01 -0800 (PST) X-Google-Smtp-Source: ALg8bN7o3hPP5ICVAw1jKjBtqzf2bPxbEtzLpfJ2MUcAyP6xKYijU/vk598dPuD5jVbhYJ/fjEgg X-Received: by 2002:a17:902:f082:: with SMTP id go2mr60186663plb.115.1546843441341; Sun, 06 Jan 2019 22:44:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1546843441; cv=none; d=google.com; s=arc-20160816; b=X+4t1qyhtrzfGFUpEklcF8y1s96aCEI2eVZ7XA+9x+oydHfgH6RZyJLCrcLKsG1Kqs 0MWnLLuPfebAuX0mv3PnHOruheyfmzCMlaTW0HVRnuDbXEPZ2kuCl/oPZ7hIqPUszPz5 /ssbguzuzkBtwHKghuCe1oqj8w1PUZnWO5cZxgEIC8OxmrBGdNCeD4c2Ok1jwXq1gqP9 ecQL1pPLwo0maGtXCTSdYnqMoTOBuepEwv1SrQScUV3pwLmMneqf911PKwBnLHxRYqce Q2yd6drleKqSinunnOfXvhsQx1Lt1PRuJVdpzJ80aEYCJ8JfcN/WUbBwt37iCv6FGOwK Zg5g== 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=XoRGeo3vT25+3Bl/ejetLFYJrvBGa4ChLOy2A0kveqs=; b=CgkWb6l49YmcH60BIJRKHezZReqoYl6jagwhP1w7xrLVdAYzhCUCA2RT9H8hW7nOcy 0/Mp8qLSa1DZv263bJS4l+/HSeo8TjuGIL9fw0Uq+z7T4HkLA16pqg7hbTr2s0yhpJ6m JPFJ/ADPwskEnEo1LhcOUPvW452BLEXe2E30RA+epJIPnCGlkNJpkb0NIADkKNTkPIxf ovojn5FRAUzxflEGdK/cTEUj9R2S5VHfIGipZAFeGZwx1Z0h2rs9hptQRjTJepbf2ySe NZKY8waqfh5OgwAfrn+mCSqXnEz0FbHhBAbb96TGp67BK2+NlcZpZXL4w28BS8VzySQL mFLQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=XiWur7WD; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-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.44.01; Sun, 06 Jan 2019 22:44:01 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-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=XiWur7WD; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-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 S1726639AbfAGGoA (ORCPT + 31 others); Mon, 7 Jan 2019 01:44:00 -0500 Received: from lelv0142.ext.ti.com ([198.47.23.249]:44566 "EHLO lelv0142.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726609AbfAGGn7 (ORCPT ); Mon, 7 Jan 2019 01:43:59 -0500 Received: from fllv0035.itg.ti.com ([10.64.41.0]) by lelv0142.ext.ti.com (8.15.2/8.15.2) with ESMTP id x076hh6r079970; Mon, 7 Jan 2019 00:43:43 -0600 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1546843423; bh=XoRGeo3vT25+3Bl/ejetLFYJrvBGa4ChLOy2A0kveqs=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=XiWur7WDaQZIiey8EGxQN0w+n2AQGBjeDN5eWhhbpW4PjmMnjI2Fm1C9w7AabmkdX 7nZnd2yeVgbNnHuhd3fUju3vIznMhj1mFzRsX2HqumwwWndvTLzz9vKAIsemPJb/9Y /+v5CGv42F55AZ8BbFXHIh58J9m7mOS/AlFoFwJY= Received: from DFLE103.ent.ti.com (dfle103.ent.ti.com [10.64.6.24]) by fllv0035.itg.ti.com (8.15.2/8.15.2) with ESMTPS id x076hh55038785 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Mon, 7 Jan 2019 00:43:43 -0600 Received: from DFLE104.ent.ti.com (10.64.6.25) by DFLE103.ent.ti.com (10.64.6.24) 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:43 -0600 Received: from dflp32.itg.ti.com (10.64.6.15) by DFLE104.ent.ti.com (10.64.6.25) 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:43 -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 x076gfoA002672; Mon, 7 Jan 2019 00:43:39 -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 13/15] PCI: rockchip: Remove pci_epf_linkup from Rockchip EP driver Date: Mon, 7 Jan 2019 12:11:46 +0530 Message-ID: <20190107064148.10152-14-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-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org pci_epf_linkup is intended to be invoked if the EPC supports linkup notification. Now that pci-epf-test uses get_features callback, which indicates Rockchip EP driver doesn't support linkup notification, remove pci_epf_linkup from Rockchip EP driver. Signed-off-by: Kishon Vijay Abraham I --- drivers/pci/controller/pcie-rockchip-ep.c | 3 --- 1 file changed, 3 deletions(-) -- 2.17.1 diff --git a/drivers/pci/controller/pcie-rockchip-ep.c b/drivers/pci/controller/pcie-rockchip-ep.c index 9b60ad323ac7..a5d799e2dff2 100644 --- a/drivers/pci/controller/pcie-rockchip-ep.c +++ b/drivers/pci/controller/pcie-rockchip-ep.c @@ -499,9 +499,6 @@ static int rockchip_pcie_ep_start(struct pci_epc *epc) rockchip_pcie_write(rockchip, cfg, PCIE_CORE_PHY_FUNC_CFG); - list_for_each_entry(epf, &epc->pci_epf, list) - pci_epf_linkup(epf); - return 0; } From patchwork Mon Jan 7 06:41:47 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: 154863 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp3171544ljp; Sun, 6 Jan 2019 22:44:18 -0800 (PST) X-Google-Smtp-Source: ALg8bN6xbpsxwXi83S3Q4yQu/5j1eNm1voaJ51izA/1iKwz9w82yX97MGRkzxAqEDVGT0Zwwxx2a X-Received: by 2002:a63:3d1:: with SMTP id 200mr10009877pgd.68.1546843458412; Sun, 06 Jan 2019 22:44:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1546843458; cv=none; d=google.com; s=arc-20160816; b=OM6nLEfmqDeiYdgPbwtH127O7WnhtlsjdFcGOWtmkVngdaNwn5j4Sy8h+bZsmBCGDx 6JTdPH51uOELMk+2NJMpU0InWmpiexhMDz2ynaqSzpxCibANLLq7ojSU5jndZicf+xTN efhPPP1VRQ6UZ3TrM/TJcwJXf4UfR2H2EzPArT7r5bg5ibbV7vdIyfIvyBaTkNsnMgEl Ba3nYWZFE9UQVRRD1QG+9eKyw9R3Sd28p5+4t0AmZe5vd5yNmrO+dqhxtOu4hk7dl7OU jzz67c9nIlXC65gA8aTr8V5SvBb4h1TgAJpRF5ScvgyddBCG3DAPQNQSyOLnSoCpHGcW S5CA== 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=f30RSmXMqhsV1n1NfMeTlD3ATOBh5scl1ryG7fV6mJI=; b=uOyRIP8FJyWqRrcfAqiMA/x6YCZrdiqgDG04747rnAldEbMOD5YBfF40tNTRwdukcL tJTNOBgi0I5C4iS72AGSY+n3Xi3Fgk8rcCB3sj0TEavCowk+OTGofyKsCwgUFcatk+2C tcrI1ye/0QgGXGiZnwkk2pqH/xaHcA8xxEEp5rsBfUkEmGWCcvrQWZTJfGj7IS2Fr4/4 EfJVrGetiqg916yHS8ZYbqZ2pxDAJip8XksCt1vNOiMrAW4jxJo03bFi8eBTlwScCpnW io5w3U12bLrkCcNtBb0YpKo9UiFC1fzenng49A8vlzIB6uW0iAaTcpgDSRzPxYAH6pls +4cQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=cPMWIu4+; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-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 d2si62933960pla.81.2019.01.06.22.44.18; Sun, 06 Jan 2019 22:44:18 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-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=cPMWIu4+; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-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 S1726709AbfAGGoR (ORCPT + 31 others); Mon, 7 Jan 2019 01:44:17 -0500 Received: from lelv0143.ext.ti.com ([198.47.23.248]:39084 "EHLO lelv0143.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726273AbfAGGoF (ORCPT ); Mon, 7 Jan 2019 01:44:05 -0500 Received: from fllv0034.itg.ti.com ([10.64.40.246]) by lelv0143.ext.ti.com (8.15.2/8.15.2) with ESMTP id x076hmMG055443; Mon, 7 Jan 2019 00:43:48 -0600 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1546843428; bh=f30RSmXMqhsV1n1NfMeTlD3ATOBh5scl1ryG7fV6mJI=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=cPMWIu4+7qq27qo54hUDefYDXUDaThbqVdSejCnoCYNyp/VdX9nYYY4mbrDvvoQPW 5jWsckn+8lCbRJxAyDHPOk7tHlEf8nYih9zxDiwZcan9qiJJFm9KMxh1tbZha6EhKW hHz/1HhhZ6rugky0oM9w2OHDqskQScOC+ThLX6/4= Received: from DLEE106.ent.ti.com (dlee106.ent.ti.com [157.170.170.36]) by fllv0034.itg.ti.com (8.15.2/8.15.2) with ESMTPS id x076hm5j021466 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Mon, 7 Jan 2019 00:43:48 -0600 Received: from DLEE115.ent.ti.com (157.170.170.26) by DLEE106.ent.ti.com (157.170.170.36) 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:47 -0600 Received: from dflp32.itg.ti.com (10.64.6.15) by DLEE115.ent.ti.com (157.170.170.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:48 -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 x076gfoB002672; Mon, 7 Jan 2019 00:43:43 -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 14/15] PCI: designware-plat: Remove setting epc->features in Designware plat EP driver Date: Mon, 7 Jan 2019 12:11:47 +0530 Message-ID: <20190107064148.10152-15-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-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Now that pci-epf-test uses get_features callback and dw_plat_pcie_epc_features in Designware plat EP driver already indicates it doesn't support linkup notification and is MSIX capable, remove setting epc->features which is not used anymore by the endpoint function driver. Signed-off-by: Kishon Vijay Abraham I --- drivers/pci/controller/dwc/pcie-designware-plat.c | 4 ---- 1 file changed, 4 deletions(-) -- 2.17.1 diff --git a/drivers/pci/controller/dwc/pcie-designware-plat.c b/drivers/pci/controller/dwc/pcie-designware-plat.c index bd0516afc86f..3be87126aef3 100644 --- a/drivers/pci/controller/dwc/pcie-designware-plat.c +++ b/drivers/pci/controller/dwc/pcie-designware-plat.c @@ -70,14 +70,10 @@ static const struct dw_pcie_ops dw_pcie_ops = { static void dw_plat_pcie_ep_init(struct dw_pcie_ep *ep) { struct dw_pcie *pci = to_dw_pcie_from_ep(ep); - struct pci_epc *epc = ep->epc; enum pci_barno bar; for (bar = BAR_0; bar <= BAR_5; bar++) dw_pcie_ep_reset_bar(pci, bar); - - epc->features |= EPC_FEATURE_NO_LINKUP_NOTIFIER; - epc->features |= EPC_FEATURE_MSIX_AVAILABLE; } static int dw_plat_pcie_ep_raise_irq(struct dw_pcie_ep *ep, u8 func_no, From patchwork Mon Jan 7 06:41:48 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: 154862 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp3171463ljp; Sun, 6 Jan 2019 22:44:11 -0800 (PST) X-Google-Smtp-Source: ALg8bN6Rgk5x6P63+VwrHkkUpLY0I1Wri320veh/s2qIjN7ulD0lag0ZE6zFF+f3GhaDwqJ55t7O X-Received: by 2002:a63:bd1a:: with SMTP id a26mr9799841pgf.121.1546843450880; Sun, 06 Jan 2019 22:44:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1546843450; cv=none; d=google.com; s=arc-20160816; b=1JdxVOmeJX/5yVTdvX+omLGb1HBzgC1w00YVu9CmIGhUhQaTaHvLHwv8+y2U1O241R HLZeYyGJqJA2lniqdzJr1SgUs46SkjwRNsLf/5OCyjRYxHwNCD1yQm5QwIocYu4Y1MZC 34+BJah0/LIOM6NuRdp8iMnl5W68v22hUmM8rv3+EiNYp+pquqa0WSObFiRpFQ5JvpV1 AZMOLSnVFM+VqD/EQVNGYG3fCc0goyoL+ATcWo+9hhvcoGWBVTQdUGM2holKF+gc/XJz uyF3QMXFaeQ/V/gEl4H0yIIxr+0KAO0ZDAb+6L5A1iD7HFa10uWQwDn7zplOpZwoU9NW enwQ== 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=hINSWO+j0rnQzGXlYYmcVdxAz+2sDdsG0d8LALea1i4=; b=WyoxbfueAAV56Kf1n8OXo0a9Zv1j460BI7EIMkCo/FgKRSqHu4K+gwks3Nf0dfQMLj e1xR2mLWAQ9Lmu7MsYnpNAnV+ZMVJ1++CQmkxpeWPEuUnlNw/csQmtgGRme71xJeYJ0Q Ac0uybTSmjM/yI6rWZIcnVDBCVZXzyDkWvGhhtEviCta/l5CkItFhTYHkyt2HwH37/ML e/gjEUFqDJ2+NtghnTxWS7+KOLmWPyspjXAukvz6InHWfoIub6/L2EFBd58XEYN3H0Xw gYcKRH8b07W76thVMZ6CQ3MnVxp0vUV31aSb/jl1r4nVHp2N7eqdaK4P7EyI8p2reiW8 eZhA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=nniCUJBv; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-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 z9si6608397pgf.54.2019.01.06.22.44.10; Sun, 06 Jan 2019 22:44:10 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-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=nniCUJBv; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-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 S1726691AbfAGGoJ (ORCPT + 31 others); Mon, 7 Jan 2019 01:44:09 -0500 Received: from fllv0016.ext.ti.com ([198.47.19.142]:36804 "EHLO fllv0016.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726671AbfAGGoH (ORCPT ); Mon, 7 Jan 2019 01:44:07 -0500 Received: from lelv0266.itg.ti.com ([10.180.67.225]) by fllv0016.ext.ti.com (8.15.2/8.15.2) with ESMTP id x076hqdv021825; Mon, 7 Jan 2019 00:43:52 -0600 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1546843432; bh=hINSWO+j0rnQzGXlYYmcVdxAz+2sDdsG0d8LALea1i4=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=nniCUJBvEVBJFmbm+Imj/1XZcd98HetidQUV8VJAtd1Ip6qIKbYak0xCpLH48OkRo HvIITVDCq41KlmmkKwK1T8DA5bUEktUYdp7KYmmfYuJ5D0Wx242JUIlGIJ0oHclGUh QsScUts3AvasiX0xUb+Ko0kjpSGLNVhBVhJg1M2I= Received: from DLEE101.ent.ti.com (dlee101.ent.ti.com [157.170.170.31]) by lelv0266.itg.ti.com (8.15.2/8.15.2) with ESMTPS id x076hqhN071741 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Mon, 7 Jan 2019 00:43:52 -0600 Received: from DLEE104.ent.ti.com (157.170.170.34) by DLEE101.ent.ti.com (157.170.170.31) 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:51 -0600 Received: from dflp32.itg.ti.com (10.64.6.15) by DLEE104.ent.ti.com (157.170.170.34) 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:51 -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 x076gfoC002672; Mon, 7 Jan 2019 00:43:48 -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 15/15] PCI: endpoint: Remove features member in struct pci_epc Date: Mon, 7 Jan 2019 12:11:48 +0530 Message-ID: <20190107064148.10152-16-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-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Since EPC features are now implemented using pci_epc_features and all the EPC drivers are moved to using pci_epc_features, remove features member in struct pci_epc and all the helper macros for configuring the features. Signed-off-by: Kishon Vijay Abraham I --- include/linux/pci-epc.h | 9 --------- 1 file changed, 9 deletions(-) -- 2.17.1 diff --git a/include/linux/pci-epc.h b/include/linux/pci-epc.h index dc3513a2f88a..4870ad5a6ca2 100644 --- a/include/linux/pci-epc.h +++ b/include/linux/pci-epc.h @@ -99,7 +99,6 @@ struct pci_epc { struct config_group *group; /* spinlock to protect against concurrent access of EP controller */ spinlock_t lock; - unsigned int features; }; /** @@ -120,14 +119,6 @@ struct pci_epc_features { 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) -#define EPC_FEATURE_SET_BAR(features, bar) \ - (features |= (EPC_FEATURE_BAR_MASK & (bar << 1))) -#define EPC_FEATURE_GET_BAR(features) \ - ((features & EPC_FEATURE_BAR_MASK) >> 1) - #define to_pci_epc(device) container_of((device), struct pci_epc, dev) #define pci_epc_create(dev, ops) \