Received: by 10.192.165.148 with SMTP id m20csp4181238imm; Mon, 30 Apr 2018 13:20:11 -0700 (PDT) X-Google-Smtp-Source: AB8JxZqPkMY+ePyYnWB4FaISxocccKKocHxCC+4k9lst28knbU8MEnopP24mnaZodOm2BmY85FmQ X-Received: by 2002:a17:902:2702:: with SMTP id c2-v6mr13437583plb.297.1525119611726; Mon, 30 Apr 2018 13:20:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525119611; cv=none; d=google.com; s=arc-20160816; b=I8Sn3UzmLMOK2t/1xrSE/5IrLUKl3K1Na8BqcwtPJ4i2EqpfXB9fwlwrhVfOmQvEAO +/kyIbnQqDLDv4at9uc387unBb59bEzYaRITN6unrfINb+v1JWeEU6TePF6OXnXkRCg4 P4229McoIxL8ysD8WiIhyw2PeEHAS/T8yaT8//U7h4nKpdu7mN+ELHpg/ytNIPnvK4Pq TGALJvcDQSHOiPkQ14PeIMkJz31ETR5yGLn1GUMWRWu+8hyHZW4GXXzwcWN2o1l7gcke +ERQoWg1XeW6vPSycgSh6FtA7aykYqDgbY2lU0a5n1ngP6DlHDmkdSupH5erCAJEzYjy cIrQ== 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=CxEa+KOqxqkRUQ+g81IZMLTIKp7TQEo2ppFwcFYNxWw=; b=alKRkivvW+yUBTt1CqPKOx6WBW6myFG4vOPqpbjjcn9q0OCzgJiPpRTAE3p3k8Blgc n91TglinlJc+LUKC9B28NeN3saT4xLGqdSpIpmnNIi6x3F7X8Kkv/dcpqxELoP+JxpSe /v9gtAJxQGmuBiAEGhXh0dl3ZxZs5/DhI/vNQaMWWNQ7g1eU97G2lV1oc7OGFk+HpD9q gvmytXUsUP1shTs2R/kwuGVPxYbBz8IeC0PNtUBI/o6D2qOnc98V0Tje12zSYqUCo0Ac 00d4UaNPvyKIFF9efjzDvDCtDF6rREd1KLMLy0OyumRsOQQZ4fZ0TTUqhX3vg32MNsCb cVYw== 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 g3-v6si7687517pld.309.2018.04.30.13.19.57; Mon, 30 Apr 2018 13:20:11 -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 S1755953AbeD3UTf (ORCPT + 99 others); Mon, 30 Apr 2018 16:19:35 -0400 Received: from mail.kernel.org ([198.145.29.99]:60782 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755292AbeD3T0t (ORCPT ); Mon, 30 Apr 2018 15:26:49 -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 40AB522DBF; Mon, 30 Apr 2018 19:26:49 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 40AB522DBF 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.9 42/61] PCI: aardvark: Set PIO_ADDR_LS correctly in advk_pcie_rd_conf() Date: Mon, 30 Apr 2018 12:24:45 -0700 Message-Id: <20180430183954.895591878@linuxfoundation.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180430183951.312721450@linuxfoundation.org> References: <20180430183951.312721450@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.9-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 @@ -175,8 +175,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) @@ -458,7 +456,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);