Received: by 10.223.176.5 with SMTP id f5csp2931847wra; Thu, 1 Feb 2018 08:13:01 -0800 (PST) X-Google-Smtp-Source: AH8x226TJhMHWtQFmmUQUh5be40CCM1OU2T45x6SrjbwhdTIRPWgWoIMcJeByLh3gd53uO7c0P9n X-Received: by 2002:a17:902:7008:: with SMTP id y8-v6mr1454419plk.358.1517501581156; Thu, 01 Feb 2018 08:13:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517501581; cv=none; d=google.com; s=arc-20160816; b=zPUqXY4VSR1krdwsWwkgHEsCDEA4foh/ADREopclKScVK2LC/V/HJFzsRGquz5EOCp TwieVSNGgfxa8MpBzlYLACdl2jT8GCINT7EBAahqWft+sctyDzIa1RRdBib5DP3Qf+jg 2OqN5GGwLxX+nhItMaNlCX6zqUUk5//j8lFuLLg0cM6GZIW2z5AKOyD/Yot9D7YN9bhw Go2PYtAGIyaXCEuByvFpevStiZITPDlfq3GkEd3Fopout5CmOA6e6OitoOj9quHrASh2 kcUG7OYgIdL0Q1wmp3AsIwZPO5Nt/w+sCcztwCMBu0/2NcFNcdJPUtmRdvw33nM9Fq5O DdFg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=eXibFweiViW9IEqSlqfyv5BiAsO6vqQ5ZCaJY0Ejpcs=; b=OfnUVgV/OOBQQIDjlwZOX031PDbvPqPIvcqowWrzNXWGj+IIfCpMqeNS1ZNZodjyPN OxIuVCyraPj7q7yEU/hvyqGJOOi5xp8Te9RdmfIXmmpuCqsrSzP/tYx4zHCTGztiJf/i AH30Z9gu79/BE79ai17nCVH+7Yg/PlBjtUTvbX97SEmK9G2d20TivnZiw3AxyOnErWoC d/MI4ow2y2asghAwDlWf1xVm4VuwJAOQWHRqKZ4fUHPnOpshE1FbZt/yL3GA/UQgTKlG 6VgnLbmFu5PCIdFX4TkQyoclVDqHaRgoJpqrrVqE7FcxKUr3+GiIafAFGRiFtzOiVCCo gn+A== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g10-v6si4305325plt.206.2018.02.01.08.12.45; Thu, 01 Feb 2018 08:13: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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752597AbeBAQLf (ORCPT + 99 others); Thu, 1 Feb 2018 11:11:35 -0500 Received: from bastet.se.axis.com ([195.60.68.11]:40550 "EHLO bastet.se.axis.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752463AbeBAQLb (ORCPT ); Thu, 1 Feb 2018 11:11:31 -0500 Received: from localhost (localhost [127.0.0.1]) by bastet.se.axis.com (Postfix) with ESMTP id 2FCE6187F5; Thu, 1 Feb 2018 17:11:30 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at bastet.se.axis.com Received: from bastet.se.axis.com ([IPv6:::ffff:127.0.0.1]) by localhost (bastet.se.axis.com [::ffff:127.0.0.1]) (amavisd-new, port 10024) with LMTP id h1BIU5aTuBdN; Thu, 1 Feb 2018 17:11:29 +0100 (CET) Received: from boulder03.se.axis.com (boulder03.se.axis.com [10.0.8.17]) by bastet.se.axis.com (Postfix) with ESMTPS id C7CF5187C8; Thu, 1 Feb 2018 17:11:28 +0100 (CET) Received: from boulder03.se.axis.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 982A01E07A; Thu, 1 Feb 2018 17:11:28 +0100 (CET) Received: from boulder03.se.axis.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 8B99C1E079; Thu, 1 Feb 2018 17:11:28 +0100 (CET) Received: from thoth.se.axis.com (unknown [10.0.2.173]) by boulder03.se.axis.com (Postfix) with ESMTP; Thu, 1 Feb 2018 17:11:28 +0100 (CET) Received: from lnxartpec1.se.axis.com (lnxartpec1.se.axis.com [10.88.4.10]) by thoth.se.axis.com (Postfix) with ESMTP id 7E52E25EC; Thu, 1 Feb 2018 17:11:28 +0100 (CET) Received: by lnxartpec1.se.axis.com (Postfix, from userid 20283) id 7A698401AF; Thu, 1 Feb 2018 17:11:28 +0100 (CET) From: Niklas Cassel To: kishon@ti.com, Lorenzo Pieralisi , Bjorn Helgaas , Sekhar Nori , Cyrille Pitchen , Niklas Cassel , John Keeping , Shawn Lin Cc: Niklas Cassel , linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 1/3] PCI: endpoint: Handle 64-bit BARs properly Date: Thu, 1 Feb 2018 17:11:17 +0100 Message-Id: <20180201161119.3852-2-niklas.cassel@axis.com> X-Mailer: git-send-email 2.14.2 In-Reply-To: <20180201161119.3852-1-niklas.cassel@axis.com> References: <20180201161119.3852-1-niklas.cassel@axis.com> X-TM-AS-GCONF: 00 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org A 64-bit BAR uses the succeeding BAR for the upper bits, therefore we cannot call pci_epc_set_bar() on a BAR that follows a 64-bit BAR. If pci_epc_set_bar() is called with flag PCI_BASE_ADDRESS_MEM_TYPE_64, it has to be up to the controller driver to write both BAR[x] and BAR[x+1] (and BAR_mask[x] and BAR_mask[x+1]). Signed-off-by: Niklas Cassel --- drivers/pci/endpoint/functions/pci-epf-test.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/pci/endpoint/functions/pci-epf-test.c b/drivers/pci/endpoint/functions/pci-epf-test.c index 800da09d9005..eef85820f59e 100644 --- a/drivers/pci/endpoint/functions/pci-epf-test.c +++ b/drivers/pci/endpoint/functions/pci-epf-test.c @@ -382,6 +382,8 @@ static int pci_epf_test_set_bar(struct pci_epf *epf) if (bar == test_reg_bar) return ret; } + if (flags & PCI_BASE_ADDRESS_MEM_TYPE_64) + bar++; } return 0; -- 2.14.2