Received: by 10.192.165.148 with SMTP id m20csp4149914imm; Mon, 30 Apr 2018 12:42:22 -0700 (PDT) X-Google-Smtp-Source: AB8JxZo2skYia1WHhUpSSgNW/KcyRnqppac00BXkthCJ0URkPuzghtm3cdJuM7avVxzVYTLHjO0p X-Received: by 2002:a63:69c3:: with SMTP id e186-v6mr10901001pgc.353.1525117342354; Mon, 30 Apr 2018 12:42:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525117342; cv=none; d=google.com; s=arc-20160816; b=IN3mXiBcKbMa7KM48jUkI45zUJoIor5kyakftCVPmOGrEjxX8YdZbP8ZKk979cIWv2 LbfHiXnWoMl6+F5dMkKBymLQt5B2O2W4OQ7DYMFaAa1MjZx/e9uTPKqwjbmgahgyGFCH P9fHVCJmlh84iBIEuH9AjTWM26WIsaLEaWdpbqFpSyPqQamQ73WQg7IksYY0EgBtVOYC 0tTNfTyJFeTbzT7oX18LoenYePbtJfb76ctEhwMEcGeeqdX4rmpAlyUPo/9R/iGcaQcJ Lr4lOPFu/f7KYf5X5aOEVidhLjOz7FT/GNwKgBdLaReDASUIuHCTrmDiUJdMzMcRFGFh L4HQ== 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=zenE7vJ06nRwXDM1FnObKoL/46KOSb4RZnY6Pucqb1w=; b=n6AJwSTFz9X5/5KoKl4cxOP6tbsacp+gr8vedWrmbhrpR6bCg2NSKrcGFcZupLZgkt 2BOf5Baosajef7Q9fQtAeCi3TmVIIJGqsDKuxgQ7pYAxxi5TvdxQGJmwZJ3pmuwCZNg6 H8WIJjVMwUa9GcVIefT8r+czG/Y+LR9efwZBnb+JsYoT9hWfo4p7DZrpBkXjh1RNuOyV 699ou5JNIEmVAXa5VaC8LKVoP1+PxDNusD8NWlprIUMeL285XqMb4K/PaMDdQ58SZjeS QnB0oJ2FKE5xfBGm3iIRgoh40NRoxgC6xhNo2vWtG4urG0iIDduKVGJ3Yj7kSEJiDS7m yhKQ== 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 z64-v6si1929335pgb.471.2018.04.30.12.42.07; Mon, 30 Apr 2018 12:42:22 -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 S1756587AbeD3Tlj (ORCPT + 99 others); Mon, 30 Apr 2018 15:41:39 -0400 Received: from mail.kernel.org ([198.145.29.99]:36294 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756325AbeD3T2b (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 9E88A22DCB; Mon, 30 Apr 2018 19:28:30 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 9E88A22DCB 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 069/113] PCI: aardvark: Fix logic in advk_pcie_{rd,wr}_conf() Date: Mon, 30 Apr 2018 12:24:40 -0700 Message-Id: <20180430184018.143435413@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 660661afcd40ed7f515ef3369721ed58e80c0fc5 upstream. The PCI configuration space read/write functions were special casing the situation where PCI_SLOT(devfn) != 0, and returned PCIBIOS_DEVICE_NOT_FOUND in this case. However, while this is what is intended for the root bus, it is not intended for the child busses, as it prevents discovering devices with PCI_SLOT(x) != 0. Therefore, we return PCIBIOS_DEVICE_NOT_FOUND only if we're on the root bus. 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, 2 insertions(+), 2 deletions(-) --- a/drivers/pci/host/pci-aardvark.c +++ b/drivers/pci/host/pci-aardvark.c @@ -437,7 +437,7 @@ static int advk_pcie_rd_conf(struct pci_ u32 reg; int ret; - if (PCI_SLOT(devfn) != 0) { + if ((bus->number == pcie->root_bus_nr) && PCI_SLOT(devfn) != 0) { *val = 0xffffffff; return PCIBIOS_DEVICE_NOT_FOUND; } @@ -491,7 +491,7 @@ static int advk_pcie_wr_conf(struct pci_ int offset; int ret; - if (PCI_SLOT(devfn) != 0) + if ((bus->number == pcie->root_bus_nr) && PCI_SLOT(devfn) != 0) return PCIBIOS_DEVICE_NOT_FOUND; if (where % size)