Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp4626422pxj; Tue, 25 May 2021 12:18:02 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxOk+mndI+s4aGehYvhlY4NdlY0OGsscPcbgpJ+lfLvPU0lL6fCaquFk/cGnWp8MchH4wFE X-Received: by 2002:a05:6638:2643:: with SMTP id n3mr32334635jat.104.1621970282772; Tue, 25 May 2021 12:18:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621970282; cv=none; d=google.com; s=arc-20160816; b=YB9/XDX5i68Famh74MzjS4man//LyGv9KB0TM31ro/+elHhzf4NKDcWMwuvDXGZv+C 15FFfwF8Z3dI3bYY7OqxVavGDYhL3M29xF3hRL590g0FSLDzdKNsm1adULe67RW6PJm9 N1lehTHdVxwa1KrUlC3nTHMNI7kRl23GctMzFrrPGmUBunqlU2KVNKSDXTzrVAQjpW+F 9B4UvCFSBYW34oPe0sCjOZ8dAyI3MPEAjkmsFP5cCiESyQC7YSlBU1CCI00Sos2O81MP kfQ8UA70MHD1dPuNuUInOACgADPc6G9+FF7CGxzB47ggoDbWb83G7+CAj80KPIBrhDs5 Nz3g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :message-id:subject:cc:to:from:date:dkim-signature; bh=clYkgvZqZonco08ahs71hYVxk5P3Ip0ywJfaDj84HgA=; b=gYopzw32Q4Ck+iKz2m+0DUFGTcfzX2wFDS2xnHk/FutZXogd0izDEP30SZpUdFXEnF xN0PWleqoZoXjyhL3qFTidXwIkj8b034D8RZ5omoixkmVRhQtOotyUCodVuNDD1jOL2x o54+CPpa4Ez6VvMSABnzYR28h50ydwfqHfvGjRM2Kkgrjv2ji42F08fUcVZRAqaF8PfP LY7y1jJox1JIZdnRjddP391DZhr98fd0heUIh1lL4P4XIi/FLJ7QiiWP11xsu1p7rovX qjYkomSJvr3nTU6h7I9YEWa5XS82dQMKflWK8LJjTjaEkpJoXlb70crGfwBF3t3ArNa7 G1Og== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=hJ1NmT7J; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id s13si20323315jat.68.2021.05.25.12.17.48; Tue, 25 May 2021 12:18:02 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=hJ1NmT7J; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232470AbhEYTRa (ORCPT + 99 others); Tue, 25 May 2021 15:17:30 -0400 Received: from mail.kernel.org ([198.145.29.99]:47972 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230029AbhEYTR2 (ORCPT ); Tue, 25 May 2021 15:17:28 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id E605F610A1; Tue, 25 May 2021 19:15:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1621970158; bh=Ic/XP5SaZJAGzEAKMh9ZFFeMeUnuVLBZvSWO7z7/HQs=; h=Date:From:To:Cc:Subject:In-Reply-To:From; b=hJ1NmT7JQFhl1mf6po8zwX3S8ONxUyN33ksA+WIB1wbQtc7JUq/4edPHhJjl8QDso Qn73DVaV7pQIW/eTgWte9ZdnqT1poUVzGDamaxarF7z+LTZKuqs6vkiDds9b1HVQFq jBsnCiiT67t6eJNWEc49tqWY/d6hNhFo+F0KeWbnbDT21nTOLNpcFLUlW3bkL6a1Vw bsYfAHhVhzDJrWvUmUrUZJvWSkuoXgVOhKKlTw6oRGhvKcYu8u3hZmHcjNAQDcA4jr KBBZzTDv1YaoGHIkIES3em7lIU2qNXbK+B/7wMQTohBppGMd/RKvGmw4uAe7G7/7wO OiYZdxyN4tF6Q== Date: Tue, 25 May 2021 14:15:56 -0500 From: Bjorn Helgaas To: Ard Biesheuvel Cc: Peter Geis , Punit Agrawal , Robin Murphy , Alexandru Elisei , Linux Kernel Mailing List , "open list:ARM/Rockchip SoC..." , arm-mail-list , Heiko Stuebner , Leonardo Bras , Rob Herring , PCI , Christian =?iso-8859-1?Q?K=F6nig?= Subject: Re: [BUG] rockpro64: PCI BAR reassignment broken by commit 9d57e61bf723 ("of/pci: Add IORESOURCE_MEM_64 to resource flags for 64-bit memory addresses") Message-ID: <20210525191556.GA1220872@bjorn-Precision-5520> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, May 25, 2021 at 05:54:56PM +0200, Ard Biesheuvel wrote: > On Tue, 25 May 2021 at 17:34, Peter Geis wrote: > > > > >> > On 2021-05-18 10:09, Alexandru Elisei wrote: > > > > >> >> [..] > > > > >> >> [ 0.305183] rockchip-pcie f8000000.pcie: host bridge /pcie@f8000000 ranges: > > > > >> >> [ 0.305248] rockchip-pcie f8000000.pcie: MEM 0x00fa000000..0x00fbdfffff -> 0x00fa000000 > > > > >> >> [ 0.305285] rockchip-pcie f8000000.pcie: IO 0x00fbe00000..0x00fbefffff -> 0x00fbe00000 > > > > >> >> [ 0.373705] rockchip-pcie f8000000.pcie: PCI host bridge to bus 0000:00 > > > > >> >> [ 0.373730] pci_bus 0000:00: root bus resource [bus 00-1f] > > > > >> >> [ 0.373751] pci_bus 0000:00: root bus resource [mem 0xfa000000-0xfbdfffff 64bit] > > > > >> >> [ 0.373777] pci_bus 0000:00: root bus resource [io 0x0000-0xfffff] (bus address [0xfbe00000-0xfbefffff]) > ... For some reason, lspci translates the BAR values to CPU > addresses, but the PCI side addresses are within 32-bits. lspci shows BARs as CPU physical addresses by default. These are the same addresses you would see in pdev->resource[n] and the same as BAR values you would see in dmesg. A 64-bit CPU physical address can certainly be translated by the host bridge to a 32-bit PCI address. But that's not happening here because this host bridge applies no translation (CPU physical 0xfa000000 maps to bus address 0xfa000000). "lspci -b" shows the PCI bus addresses.