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; }