Received: by 10.192.165.148 with SMTP id m20csp4150363imm; Mon, 30 Apr 2018 12:42:55 -0700 (PDT) X-Google-Smtp-Source: AB8JxZqykWJYr7imnYAxiGUk9FUYNE+zzvesDDonh8DWYbHijmIt2yMTDZKQ51W5Ni4kXC7Pk85L X-Received: by 10.98.198.217 with SMTP id x86mr13116741pfk.192.1525117375683; Mon, 30 Apr 2018 12:42:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525117375; cv=none; d=google.com; s=arc-20160816; b=oezoq/LinO78gzEoXUonuWQFQjSaIiwKz+t4ill1RzIrdzKsU8NrBryJsUt7B561pH ARZFE1DthBnmezXqcWDATUYoQzeuSjf+T/awmuwPOIvSiqEKX362kFq6rq7xTar55dHY yedCNiws7Qqo3WE14McVSJUEGwuERiT5IGpHH353a+Hh2E9jA/kUNG42Pmu1xmLQH6Mo UeTh/EFnGxybSnuYCp53UYAIiPj5ZFYJUHixc12jtlM8P5mwBgZAJxAdC343/Ph3aWHN DklzID07Jm2THvdJJwrgW+iJ0lXSSv3MqW5PcBaHPfK6LctB1PbiBKVLHgM8X6gJVOlu LuHQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from:dmarc-filter :arc-authentication-results; bh=lzipe47cCOJN3hupaiXh6s8k0v0wlJ3kLO8jp7eoWNs=; b=mWplpXT4qng5Os59ICpMgJUFueVv0tP0eFWBgjzLiQyeRVF6XiXeTovIUfPK/Z4ABP UpqaX3frTy6edfK9zg29vJVSDN9QnZWfnSXlxGPa3gBC9aCbeYy5MGK2pMkmasrNtWLf H6jkOUTSikgQlStDojGR2iMi47daUqxXcETH56G5iqp71WN/CMk8/4t+Sha1YP5DjPq5 Gyo82FhaNn+SNS1x8jyQEGo7KuZ9EiZk0YLP6A22/6s9npOhmoaH1D1s99AIruR/8b5q 50yKXg6qvf/TgJnXwSNw8o5Q/AUOxwtAPb6LhmMUHO2ZinGpATdv72lOJ7sCFAlzqsiP ahOA== 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 p25-v6si6629179pgd.395.2018.04.30.12.42.41; Mon, 30 Apr 2018 12:42:55 -0700 (PDT) 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 S1756483AbeD3TlV (ORCPT + 99 others); Mon, 30 Apr 2018 15:41:21 -0400 Received: from mail.kernel.org ([198.145.29.99]:36316 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756328AbeD3T2b (ORCPT ); Mon, 30 Apr 2018 15:28:31 -0400 Received: from localhost (unknown [104.132.1.102]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 4424222DAC; Mon, 30 Apr 2018 19:28:31 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 4424222DAC Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=linuxfoundation.org Authentication-Results: mail.kernel.org; spf=fail smtp.mailfrom=gregkh@linuxfoundation.org From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Victor Gu , Wilson Ding , Nadav Haklai , Thomas Petazzoni , Lorenzo Pieralisi Subject: [PATCH 4.16 070/113] PCI: aardvark: Set PIO_ADDR_LS correctly in advk_pcie_rd_conf() Date: Mon, 30 Apr 2018 12:24:41 -0700 Message-Id: <20180430184018.181832334@linuxfoundation.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180430184015.043892819@linuxfoundation.org> References: <20180430184015.043892819@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.16-stable review patch. If anyone has any objections, please let me know. ------------------ From: Victor Gu commit 4fa3999ee672c54a5498ce98e20fe3fdf9c1cbb4 upstream. When setting the PIO_ADDR_LS register during a configuration read, we were properly passing the device number, function number and register number, but not the bus number, causing issues when reading the configuration of PCIe devices. Fixes: 8c39d710363c1 ("PCI: aardvark: Add Aardvark PCI host controller driver") Cc: Signed-off-by: Victor Gu Reviewed-by: Wilson Ding Reviewed-by: Nadav Haklai [Thomas: tweak commit log.] Signed-off-by: Thomas Petazzoni Signed-off-by: Lorenzo Pieralisi Signed-off-by: Greg Kroah-Hartman --- drivers/pci/host/pci-aardvark.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) --- a/drivers/pci/host/pci-aardvark.c +++ b/drivers/pci/host/pci-aardvark.c @@ -172,8 +172,6 @@ #define PCIE_CONFIG_WR_TYPE0 0xa #define PCIE_CONFIG_WR_TYPE1 0xb -/* PCI_BDF shifts 8bit, so we need extra 4bit shift */ -#define PCIE_BDF(dev) (dev << 4) #define PCIE_CONF_BUS(bus) (((bus) & 0xff) << 20) #define PCIE_CONF_DEV(dev) (((dev) & 0x1f) << 15) #define PCIE_CONF_FUNC(fun) (((fun) & 0x7) << 12) @@ -456,7 +454,7 @@ static int advk_pcie_rd_conf(struct pci_ advk_writel(pcie, reg, PIO_CTRL); /* Program the address registers */ - reg = PCIE_BDF(devfn) | PCIE_CONF_REG(where); + reg = PCIE_CONF_ADDR(bus->number, devfn, where); advk_writel(pcie, reg, PIO_ADDR_LS); advk_writel(pcie, 0, PIO_ADDR_MS);