Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp23380imu; Tue, 15 Jan 2019 15:42:23 -0800 (PST) X-Google-Smtp-Source: ALg8bN7jlr8NU/qtIAwFQc9SA26JKy8+MGj28Iu+rcs6j5GQp3V/y3x3BPK1mPz+5QE3o9bfvNbZ X-Received: by 2002:a63:101:: with SMTP id 1mr6131287pgb.152.1547595743862; Tue, 15 Jan 2019 15:42:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547595743; cv=none; d=google.com; s=arc-20160816; b=jlnz/WEns30A/B6177XiaUF39hM49GGuXnGYrPbPE710PCypMzEYrwauwcUF+x0yLZ FMRAXCAcbMDfLIeggG/sa7pjzTC3CTCK9Px68P17+mw40a0sii1QySKlJBtRdG6bAkxG +G6bDfBKIJF+I058ZNg8spYeeW5gtd7mzltT4I6UuE3nMvQclbqkaRrRxAeM6WlGRYEm wNPLTCxhTRi0J+joMkcOjDi9FQ8UD4UlYqbBWcT9WfyRhBK8h7TC54YHejIVqI76KKeO MyGuQFHyqX5zpG0/G6qph5zLuVPxGkfCL2Q4q3b3Sw7TWpSz0zvOysgAYjXI0J93G1rT fqWQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=wW+aNCVudqJZYJ8c1BD19iIjt7jUc881dWe8SulQJIg=; b=IQ5Q5zmEJJgDGT5NLwkQbwTCmHXOE2fz/FUuc+FAovnM/AeMhNxdJiVvebV82KTZa8 oits4s0RYBBWVmudsuOhJDEnnkbBIX1SL3ACCoxlHsimiyZr5aNOYONjdZ8vetvopIVG juUEfvYv2e0fXM9IJnOY/n/WHxD0+8QGJOHkW8ENvNAmlNkCvOq4IJOKF1HvDTE48eUh BTpdmsWkap6DfxLq8ozVcaUi3gXJhyso+fwIGQfMY4MdZy0cIFF/Fv5sbAm80ByXrfCm dJ4shZvgCb2cEAxE7Q3eFDEPuCy1gImJwpotbT/qX4XDg7QpaGLvT2RvaLLF8d+cucEJ cZQQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=kHl5cM+4; 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 m8si2552690pls.400.2019.01.15.15.41.21; Tue, 15 Jan 2019 15:42:23 -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=@kernel.org header.s=default header.b=kHl5cM+4; 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 S2387975AbfAOQqr (ORCPT + 99 others); Tue, 15 Jan 2019 11:46:47 -0500 Received: from mail.kernel.org ([198.145.29.99]:35616 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387870AbfAOQpx (ORCPT ); Tue, 15 Jan 2019 11:45:53 -0500 Received: from localhost (5356596B.cm-6-7b.dynamic.ziggo.nl [83.86.89.107]) (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 09C402054F; Tue, 15 Jan 2019 16:45:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1547570753; bh=eynPlV8lXbHYUJ2T/Ppg9M3+jeyP7RphdaphSOBLhNE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=kHl5cM+4kPURwyLVf/KyO/sZ3TUaCZqq9cQGj7A7K5QP5X2TUnIa2ZY8biAD2WSJf A7E3Qsj0JGHDF0PIFWgSykJJq0GJBZnuyqKs2EU+jcMWXMpn4cZqGppwiOfB9+lCTz ooj8ZhhQnebRNB2/XXWLwh7ItuS1MTvIUJnqCyJY= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Eric Auger , Jean-Philippe Brucker , Lorenzo Pieralisi , Robin Murphy , Will Deacon , Hanjun Guo , Sudeep Holla , Catalin Marinas , "Rafael J. Wysocki" Subject: [PATCH 4.20 33/57] ACPI/IORT: Fix rc_dma_get_range() Date: Tue, 15 Jan 2019 17:36:14 +0100 Message-Id: <20190115154912.572506598@linuxfoundation.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190115154910.734892368@linuxfoundation.org> References: <20190115154910.734892368@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review X-Patchwork-Hint: ignore MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.20-stable review patch. If anyone has any objections, please let me know. ------------------ From: Jean-Philippe Brucker commit c7777236dd8f587f6a8d6800c03df318fd4d2627 upstream. When executed for a PCI_ROOT_COMPLEX type, iort_match_node_callback() expects the opaque pointer argument to be a PCI bus device. At the moment rc_dma_get_range() passes the PCI endpoint instead of the bus, and we've been lucky to have pci_domain_nr(ptr) return 0 instead of crashing. Pass the bus device to iort_scan_node(). Fixes: 5ac65e8c8941 ("ACPI/IORT: Support address size limit for root complexes") Reported-by: Eric Auger Signed-off-by: Jean-Philippe Brucker Signed-off-by: Lorenzo Pieralisi Reviewed-by: Eric Auger Acked-by: Robin Murphy Cc: stable@vger.kernel.org Cc: Will Deacon Cc: Hanjun Guo Cc: Sudeep Holla Cc: Catalin Marinas Cc: "Rafael J. Wysocki" Signed-off-by: Will Deacon Signed-off-by: Greg Kroah-Hartman --- drivers/acpi/arm64/iort.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) --- a/drivers/acpi/arm64/iort.c +++ b/drivers/acpi/arm64/iort.c @@ -951,9 +951,10 @@ static int rc_dma_get_range(struct devic { struct acpi_iort_node *node; struct acpi_iort_root_complex *rc; + struct pci_bus *pbus = to_pci_dev(dev)->bus; node = iort_scan_node(ACPI_IORT_NODE_PCI_ROOT_COMPLEX, - iort_match_node_callback, dev); + iort_match_node_callback, &pbus->dev); if (!node || node->revision < 1) return -ENODEV;