From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=74.125.231.203 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796389332; b=ZKXA8WVeuPjMPb/9/vnoZeJ8FTqApN09xgYoMhrgynO47/vcxq6NhbQeRu9dNfVu/01C d0kokrM5gJlLKZVbYC38itgczA6zyJkWg0dvFJ6uxDatGN8oisRBy0qFORDRNTCLopHOU TwyJi+FMzJh9v2B7IBresXcG1wNfFirIWVNhI217ZkzLi+1lz0EqWcg1CnuVx/4x/OU9J 0zd1AMeNsgrpBI+N56qOCiXnbq2s9eW3ODCde+93ukokCVhFwmFU1lYriypvBTcYjw4R5 sFqUhLyvZk3l/UoFTS08XjwdAQI0QLXbdw2dCZX97QSp2hIX+ORhUEqbX+OE33lq99Q== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796389332; h=DMARC-Filter:Received:DKIM-Signature:X-Google-DKIM-Signature: X-Forwarded-Encrypted:X-Gm-Message-State:X-Gm-Gg:X-Received:Received: Message-ID:Date:MIME-Version:User-Agent:Subject:To:Cc:References: Content-Language:From:In-Reply-To:Content-Type: Content-Transfer-Encoding; bh=+nDlhDIuu7xFc1MIHhcVNyFkxX/wjaSYEks0m6cZjVI=; b=nZvNdb1Ghi3QfeRuHJVUu5mhk0a3J5pc/2z6eB1r9ffAiHKSOn+PJ38s+eiXTd9BrdZa QxwVjzqacjii2OzJgSorORh7q3CEtWq6+g4vdr6ruuLt81EJ0c3ttxRHKk6ENgCnjqpBH xXrRObfwhi6ei0wLJZMSBVSvGSwq2jyJccZtJKJh/1Ojy3ntHRX6g1XqAi61WU12d1Xfd MwThf5oa1N5MeN9Gb3whebNM08J3qgtaQPYKKj/OW+2OgoR8gmT542BInj+MjD2EDLBWr 0fwh+uWyBg1QYvsEWjDwLEMODNJ2bSNu/1PkArT98ui/nj+viQEbER9bpmQqSwZ94qw== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=riscstar.com; spf=pass smtp.mailfrom=riscstar.com; dkim=pass header.d=riscstar.com header.i=@riscstar.com header.a=rsa-sha256 header.s=google header.b=jZrUI7zT; arc=none smtp.remote-ip=74.125.231.203 Received: from mail-oi2-f11.google.com (mail-oi2-f11.google.com [74.125.231.203]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 22C28606A32D for ; Fri, 4 Dec 2026 13:02:11 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 22C28606A32D Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=riscstar.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=riscstar.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key, unprotected) header.d=riscstar.com header.i=@riscstar.com header.a=rsa-sha256 header.s=google header.b=jZrUI7zT Received: by mail-oi2-f11.google.com with SMTP id 5614622812f47-5725b4210ffso246637b6e.1 for ; Fri, 04 Dec 2026 05:02:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=riscstar.com; s=google; t=1796389331; x=1796994131; darn=vger.kernel.org; h=content-transfer-encoding:content-type:in-reply-to:from :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id:from:to:cc:subject:date:message-id:reply-to :content-type; bh=+nDlhDIuu7xFc1MIHhcVNyFkxX/wjaSYEks0m6cZjVI=; b=jZrUI7zTzvOShEMKlqGi+ap9wrmcO98J3fjPVNn9XEhpKfkVq8nAX7oX+Jn7xuxmEG B+utpwhf5xvT/lITOyERchmtr2Xp2OzF//cYy4tmW6FWYqHmNoGXbGwCz7cAc2QqkQne zBFDxwzYJy7atGTl0/6tc0nUfoqQgghCQqDnddJ8d0UJRCj5Y+Ie237WgBmne2VpBKwv YFGHjv+tRdvWLPgYgBhIGvrQAB6D4YMmjV3SX69e06l9KjGiLmw8YJVfoIsT+HW1e6rR OurN8sTERqhKVlCSNDn7d+Z49fe4R/q63USJH+zDidXJytJbTDeF9dF6nS4tanoA47yP 5vWA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1796389331; x=1796994131; h=content-transfer-encoding:content-type:in-reply-to:from :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to:content-type; bh=+nDlhDIuu7xFc1MIHhcVNyFkxX/wjaSYEks0m6cZjVI=; b=AbMdmn2SXXsM3Ywiq0vgEo+XCIjjSrhjqGniwUGEgt08k/S99n8s+mXdfMwRwoXrZI y/0QQ7xsWSmyWvgLuuH5CPhn3255Utt81eIYGT4gz+/0kn2neQv9zWkqapQhjVsmz03m np+lQVMbabXY5l2gEsSw6YK8tYXinUfFopUJA61IOewYXl8VRTY+LstGBaJGc36M8SiX kK6OqljXEgiwCfu3ZPei+nrVEkzbCC7PgwloG89gMF1j+Hhm923i4je5+WcElO3frOlI GkB0/L7i7e1hdHm4B9RNV90VVhIcCGokL8Vnz+hwzA42SJE1QpAgnsCBil5PDwXZ8N9W Z7IA== X-Forwarded-Encrypted: i=1; AL+hErGIQKsgNQwb9ut9fCiAHd/wRYLZ7MqtTOiIp2W9wBImqVYd0vF8YfMT9aMp+JquzUMyvuUwn5mLiuWhc68=@vger.kernel.org X-Gm-Message-State: APuU4Z/a+ahebd5YAEhTh8PFes/Pt1KcNR0krIz0Dk+T4OwfmRXtezZK gIh1Vb+NfvtqsYtTWPW2O79zSoQgwK9v0+PQpHeaDuU3rGxothnyH1aevFQjDXHWRlE= X-Gm-Gg: AZFdTZdEdYvymBXYvHgVtqaiPHUArVh9dd3VmySYI6tHRi/XL7OGvlvnuaZD6o0RUkk ciVDiZxeRTBJ2O9NZCLBjAa0qUgoDC6b1ugLk40ch1uIXUWXACysatnLhWAVNayop6c8iBRKZB4 DG4NfD9HOESeqgCG3/+p2LRblw1yg/cLNgdAP1MxDRBEwjt3PlhDR02SAY1ft6JtwBPEAzRcbHK CLguSV19ivREDqsUNBlHREsMAkJdPR5GrLXxjK1uG8tEzK0ctvM/F54f/+84Xw0yivhKAb99wRA x6ydbTUFfu/4tRi6HQt4eLrcaSE/9/S0n/4mJoNpi3jY8XNJcv8cTp/i0CtD9ZI8EbhAng+M47E hSux/IMP6wh8mPGAZBHqsqF4/7TRVb8cF4WuzYqDrSWTyTD+EMTpbdKkfIEu0wYz4kAsed6nl+2 4SvGot6qG+LNAXo3q77Wbn6dOVt+jjjdSgn1eVVTfGQV5P/r06xsmUn1tU+xfA+QVIXBb6CMxBQ Pqvs7VpxSMhQCT9CZ23gaYH4C+k78LdUcXvtpAch6YlluERPPainc9zGYVmUiWKBZiQ+G6XO0Fj NIiPhKOv+ZpuC6y8+RwGDuoNWeF4cdcaTsbS/sZII2Yj9TNganYZ X-Received: by 2002:a05:6808:1207:b0:4f4:813c:6a21 with SMTP id 5614622812f47-57f205c3680mr1483593b6e.20.1796389330829; Fri, 04 Dec 2026 05:02:10 -0800 (PST) Received: from [172.22.22.28] ([76.156.233.211]) by smtp.gmail.com with ESMTPSA id 5614622812f47-57f1f16740bsm1558479b6e.0.2026.12.04.05.02.09 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 04 Dec 2026 05:02:10 -0800 (PST) Message-ID: <178d9cfb-9078-420b-ac88-c06bdaa78d3a@riscstar.com> Date: Fri, 4 Dec 2026 07:02:09 -0600 X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v4 0/2] PCI: of: update endpoint ranges dynamically To: Alexander Stein , bhelgaas@google.com, robh@google.com, krzk+dt@kernel.org, conor+dt@kernel.org, linux-pci@vger.kernel.org Cc: daniel@riscstar.com, mohd.anwar@oss.qualcomm.com, lorenzo.bianconi@oss.qualcomm.com, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org References: <20261105212412.591931-1-elder@riscstar.com> <5372347.31r3eYUQgx@steina-w> Content-Language: en-US From: Alex Elder In-Reply-To: <5372347.31r3eYUQgx@steina-w> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit On 12/4/26 4:58 AM, Alexander Stein wrote: > Hi Alex, > > Am Donnerstag, 5. November 2026, 22:24:10 Mitteleuropäische Normalzeit schrieb Alex Elder: >> This series fixes a bug in PCI devicetree handling code. >> >> If a PCI endpoint function is represented in devicetree, and it >> implements a PCI endpoint bus, its ranges property must be created >> dynamically. This is because the PCI function's BAR addresses are >> assigned during PCI enumeration, and a static ranges property cannot >> assume a particular static BAR address matches what was assigned. >> >> The solution is to dynamically generate a ranges property for PCI >> functions defined in devicetree that implement a PCI endpoint bus. > > Thanks for the series. I've picked your dynamic_ranges-v4 branch and > managed to create DT devices for BARs on a FPGA attached to > an imx8mp, including the dynamic ranges. > But I noticed I had to add my own PCIe fixup regarding > of_pci_make_dev_node for it to take effect. Is this really necessary > or can it be done automatically? It is necessary. A few months ago we talked about using a different mechanism than the PCI quirks to handle this. I offered to help on that, but I won't until I've got my current work (including this series) accepted. https://lore.kernel.org/all/20260918173003.GA1166280@bhelgaas/ > FWIW: > Tested-by: Alexander Stein I think this is extremely helpful and I really appreciate it. -Alex > Best regards, > Alexander > >> >> -Alex >> >> Note: this series depends on the patch "PCI: of: drop the reg_num >> argument to of_pci_set_address()" found in this series: >> https://lore.kernel.org/lkml/20261105153801.435566-5-elder@riscstar.com/ >> >> The entire series (based on v7.4-rc1 and including that series as >> prerequisite) is available here: >> https://github.com/riscstar/linux/tree/outgoing/dynamic_ranges-v4 >> >> Version 3 is available here: >> https://lore.kernel.org/lkml/20260924222444.1351466-1-elder@riscstar.com/ >> >> Between version 3 and version 4: >> - Dramatically simplified the description in this cover letter. See >> earlier versions for a more lengthy explanation. >> - Dropped the first patch, which allowed a null pointer for the flags >> argument to of_pci_get_addr_flags(). This wasn't really necessary >> and didn't really add value. >> - Indicated clearly that Andrea della Porta has tested this series on >> the Raspberry Pi 5, which uses PCI endpoint bus for its RP1 chip. >> The current statically-defined ranges property works for this system, >> and when the necessary PCI quirk is enabled, the dynamically generated >> ranges property works correctly as well. >> >> Between version 2 and version 3: >> - The ranges property for a PCI endpoint with an existing devicetree node >> is only updated if its ranges property has an empty value (i.e., it is >> "ranges;", or is not defined) >> >> Version 2 is available here: >> https://lore.kernel.org/lkml/20260910021919.3421449-1-elder@riscstar.com/ >> >> Between version 1 and version 2: >> - Included the first patch (which was previously posted in a different >> series) >> - Modified the last patch so the ranges property is updated only for >> PCI endpoints having at least one "pci-ep-bus" node >> - Rebased on v7.3-rc2 (and the prerequisite series) >> >> Version 1 is available here: >> https://lore.kernel.org/lkml/20260813220717.1394644-1-elder@riscstar.com/ >> >> >> >> Alex Elder (2): >> PCI: of: introduce of_pci_build_prop_ranges() >> PCI: of: introduce of_pci_update_endpoint_node_ranges() >> >> drivers/pci/of.c | 97 ++++++++++++++++++++++++++--- >> drivers/pci/of_property.c | 126 +++++++++++++++++++++++++------------- >> drivers/pci/pci.h | 1 + >> 3 files changed, 173 insertions(+), 51 deletions(-) >> >> >> base-commit: 8c786803613eb0d3352417509611d1db877c65af >> > >