From patchwork Mon Jan 14 11:15:06 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: 155443 Delivered-To: patch@linaro.org Received: by 2002:a02:48:0:0:0:0:0 with SMTP id 69csp3536973jaa; Mon, 14 Jan 2019 03:17:00 -0800 (PST) X-Google-Smtp-Source: ALg8bN5R5Eyj4nqiMwJykdLRr2HfRR/Bwt1XtO/OcBkKXERvD/Y6uBU0VpZQyRbr5iSITx11hZnx X-Received: by 2002:a17:902:c85:: with SMTP id 5mr25312709plt.339.1547464620694; Mon, 14 Jan 2019 03:17:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547464620; cv=none; d=google.com; s=arc-20160816; b=b8PRoChDqEN26ahHabx8Rwyx5t/WHrrxYGh2fkLZfte/HtvuL9B+uUUgOgvd97UW8+ 1Z08jkjzyPBdkBfc/GqEetRgrFlfTibuMAiKI1Xk3IFGQMR2VoTXmaAms8s/8Edbhn7a 5vpjiE4OZ0D1n/5V0jROApIyJ36uRe69vKTC903IPROtKIVfs8mEEqquZKdFXlgH6D1d 4oTyuBlafaVBE4Y3CDxLkpP8CTHVRXyXCpinRIkR6efTN71gWOvzLcYpRyjGMYrd1OCr 66tbIxaStkZvkC9wglVQB3EaIsdvo4MyTfteyKOWI2+JK9AYhomoby3vD/nt1scMLUlF DzEQ== 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=bomR0TElheZ70a4424n4+PZQ1RpTa9f7juuhG35IGxY=; b=m6gpMyR/P9kLZsyOiBZMagsv2+jclOBmnEp8kHQ152FACo/Enmqz5p1QVNDg8yxIvM HKMIzLZ9OW+eAvbhwVhDBgyLsbF6UmMB1IA+V0RSPMRKAkyu9b6oWAmKHZlwTBLPlnMz LqZ5Nrk49wM3ePmmlEuIgfx82KPRvSGPuRFpDginM5tg3XGDr6LodvWFoA4O4XJ8A/B+ dRVAQyfETDV3LDezKcFEa6jOjKRLUjAV2Ngb0ZISXMhBT6OrouQioEdDj+zftK0FsD+x W315k8osiJYbzgr3QXkpO73C/luRfM0Fp27p9Bvn0GzpU+Vn7tWv8THuB7scySSD6CzC xWMQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=MNyt1hEx; 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 j26si92810pgl.537.2019.01.14.03.17.00; Mon, 14 Jan 2019 03:17:00 -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=MNyt1hEx; 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 S1726414AbfANLQ7 (ORCPT + 5 others); Mon, 14 Jan 2019 06:16:59 -0500 Received: from lelv0143.ext.ti.com ([198.47.23.248]:45532 "EHLO lelv0143.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726561AbfANLQ7 (ORCPT ); Mon, 14 Jan 2019 06:16:59 -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 x0EBGELg112733; Mon, 14 Jan 2019 05:16:14 -0600 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1547464574; bh=bomR0TElheZ70a4424n4+PZQ1RpTa9f7juuhG35IGxY=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=MNyt1hEx/sd+05mnHce4k7ZLAqhX05iEv7WPS3DZbrh9QcOI5VEiksPADW94LA7km d9lG+mwGo5hZ0ecJLxYddj4+dijpp9vqItQyvNHB9AYP2uMZNVRTkJVbh0lHfyA9D0 QGIlnBxLzdhc/EVSIYHC8/oPux1E+N7pElAOVrJM= Received: from DLEE107.ent.ti.com (dlee107.ent.ti.com [157.170.170.37]) by fllv0034.itg.ti.com (8.15.2/8.15.2) with ESMTPS id x0EBGEAO067802 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Mon, 14 Jan 2019 05:16:14 -0600 Received: from DLEE115.ent.ti.com (157.170.170.26) by DLEE107.ent.ti.com (157.170.170.37) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1591.10; Mon, 14 Jan 2019 05:16:14 -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, 14 Jan 2019 05:16:14 -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 x0EBFd1a011560; Mon, 14 Jan 2019 05:16:10 -0600 From: Kishon Vijay Abraham I To: Kishon Vijay Abraham I , Lorenzo Pieralisi , Gustavo Pimentel , Alan Douglas , Shawn Lin , Heiko Stuebner CC: Bjorn Helgaas , Jingoo Han , , , , , Subject: [PATCH v2 08/15] PCI: endpoint: Fix pci_epf_alloc_space to set correct MEM TYPE flags Date: Mon, 14 Jan 2019 16:45:06 +0530 Message-ID: <20190114111513.21618-9-kishon@ti.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190114111513.21618-1-kishon@ti.com> References: <20190114111513.21618-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 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 | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) -- 2.17.1 diff --git a/drivers/pci/endpoint/pci-epf-core.c b/drivers/pci/endpoint/pci-epf-core.c index 825fa24427a3..8bfdcd291196 100644 --- a/drivers/pci/endpoint/pci-epf-core.c +++ b/drivers/pci/endpoint/pci-epf-core.c @@ -131,7 +131,9 @@ void *pci_epf_alloc_space(struct pci_epf *epf, size_t size, enum pci_barno bar) epf->bar[bar].phys_addr = phys_addr; 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; }