Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp4666515pxk; Wed, 30 Sep 2020 08:39:38 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzIZcOdKdBQzerbtS2our/b/H8kgx+hTsDBzYMMr/EtdM6KWWOe0yaDIezsJq/EKAkEXrZa X-Received: by 2002:a17:906:5402:: with SMTP id q2mr3359719ejo.316.1601480378187; Wed, 30 Sep 2020 08:39:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1601480378; cv=none; d=google.com; s=arc-20160816; b=NPbhD2etolh7hMsWNZGGAvamfr0NWxQAa60rYpv2lRevWGqwu9f6MQjaUt5L5XMwiJ oJJIyK82gnnsqiMJxWQurpf/dzIUhob7NNgDe386ve1Oz0jDEH4sftd6eQPbeWQD9dkc 9zwrNGfco808XyePmimtlheEV/0sJNBjEivPB0+iVwpMfhDTYl9dG0JsWDFCabhPaiMc CBercKm4IwOrct6Q0nJdIrfNZff8oVztoIfFLuWg54HmZWUj2bjjbOICWgah9/5ZGOUg 1PmRD3lZ/u3KfxhEavhs9QI2TnKvhUZbYdw/8dWFDS7/jC8Cl+8BHaPKYbco8bwZh9eB UI5g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=XMppkYZ4t3t/jCdVdtCLKocKpBY6oIXcMXBRoQk+HUs=; b=SUfx0DFw6sCoCzPq5RU5YJASv7PPNyOU2y3v5sYKUVlAvnBn1gMnFhymp3lLB2Jvkt /YEQh1hhqLPXW6XF9NggKoj+hMptoI+9jmT4XWYPTlyLUjy6VVUXr62+hYEVkerzWJ2U OqwK/q9JHsWMBfo83ZDE1kLJmbsnSjuTZyZKOEI3ePs5Nvo6316FXMRixico5tOnv5TI Q/8x0YJ7f3CdabDGeszw0vtGBwk9rNEPZ4A6bMVephVNs0Pg3MUC/r+2ECu7VO3cDu54 OpadgiZ1OCIocyvyF/pC9KPshpdHCis+x1hR9bAdLt4GqTJsKWrUB2cGgQWgxDnplRYX KEbg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=ymXglrP2; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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. [23.128.96.18]) by mx.google.com with ESMTP id b18si1234257edw.559.2020.09.30.08.39.15; Wed, 30 Sep 2020 08:39:38 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=ymXglrP2; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S1731140AbgI3Pho (ORCPT + 99 others); Wed, 30 Sep 2020 11:37:44 -0400 Received: from fllv0015.ext.ti.com ([198.47.19.141]:57372 "EHLO fllv0015.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725823AbgI3Pho (ORCPT ); Wed, 30 Sep 2020 11:37:44 -0400 Received: from lelv0265.itg.ti.com ([10.180.67.224]) by fllv0015.ext.ti.com (8.15.2/8.15.2) with ESMTP id 08UFbWLP044151; Wed, 30 Sep 2020 10:37:32 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1601480252; bh=XMppkYZ4t3t/jCdVdtCLKocKpBY6oIXcMXBRoQk+HUs=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=ymXglrP2o+/imZrGn+MigN1FT3A7UIEJpFOz2DPSeEtKxAWlhlt9lr6JufSFkw5Hv r1/lErIAYrFjHgHm0z1eCa++8OjLrMc8/C9wNGK36a0lcexYRhi99clO1utrRvWUK9 0pS963eHKqd7xLlbvwblAHXQikBbrMGfDglbfOiY= Received: from DFLE104.ent.ti.com (dfle104.ent.ti.com [10.64.6.25]) by lelv0265.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 08UFbWQd044547 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Wed, 30 Sep 2020 10:37:32 -0500 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.1979.3; Wed, 30 Sep 2020 10:37:31 -0500 Received: from lelv0326.itg.ti.com (10.180.67.84) 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.1979.3 via Frontend Transport; Wed, 30 Sep 2020 10:37:31 -0500 Received: from a0393678-ssd.dal.design.ti.com (ileax41-snat.itg.ti.com [10.172.224.153]) by lelv0326.itg.ti.com (8.15.2/8.15.2) with ESMTP id 08UFZLZb033254; Wed, 30 Sep 2020 10:37:25 -0500 From: Kishon Vijay Abraham I To: Bjorn Helgaas , Jonathan Corbet , Kishon Vijay Abraham I , Lorenzo Pieralisi , Arnd Bergmann , Jon Mason , Dave Jiang , Allen Hubbe , Tom Joseph , Rob Herring CC: Greg Kroah-Hartman , , , , Subject: [PATCH v7 12/18] PCI: cadence: Configure LM_EP_FUNC_CFG based on epc->function_num_map Date: Wed, 30 Sep 2020 21:05:13 +0530 Message-ID: <20200930153519.7282-13-kishon@ti.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200930153519.7282-1-kishon@ti.com> References: <20200930153519.7282-1-kishon@ti.com> MIME-Version: 1.0 Content-Type: text/plain X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The number of functions supported by the endpoint controller is configured in LM_EP_FUNC_CFG based on func_no member of struct pci_epf. Now that an endpoint function can be associated with two endpoint controllers (primary and secondary), just using func_no will not suffice as that will take into account only if the endpoint controller is associated with the primary interface of endpoint function. Instead use epc->function_num_map which will already have the configured functions information (irrespective of whether the endpoint controller is associated with primary or secondary interface). Signed-off-by: Kishon Vijay Abraham I --- drivers/pci/controller/cadence/pcie-cadence-ep.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/drivers/pci/controller/cadence/pcie-cadence-ep.c b/drivers/pci/controller/cadence/pcie-cadence-ep.c index 5df492a12042..59ce57744345 100644 --- a/drivers/pci/controller/cadence/pcie-cadence-ep.c +++ b/drivers/pci/controller/cadence/pcie-cadence-ep.c @@ -507,18 +507,13 @@ static int cdns_pcie_ep_start(struct pci_epc *epc) struct cdns_pcie_ep *ep = epc_get_drvdata(epc); struct cdns_pcie *pcie = &ep->pcie; struct device *dev = pcie->dev; - struct pci_epf *epf; - u32 cfg; int ret; /* * BIT(0) is hardwired to 1, hence function 0 is always enabled * and can't be disabled anyway. */ - cfg = BIT(0); - list_for_each_entry(epf, &epc->pci_epf, list) - cfg |= BIT(epf->func_no); - cdns_pcie_writel(pcie, CDNS_PCIE_LM_EP_FUNC_CFG, cfg); + cdns_pcie_writel(pcie, CDNS_PCIE_LM_EP_FUNC_CFG, epc->function_num_map); ret = cdns_pcie_start_link(pcie); if (ret) { -- 2.17.1