From: Lizhi Hou <lizhi.hou@amd.com>
To: Rob Herring <robh@kernel.org>
Cc: Bjorn Helgaas <helgaas@kernel.org>, <linux-pci@vger.kernel.org>,
<devicetree@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
<max.zhen@amd.com>, <sonal.santan@amd.com>,
<stefano.stabellini@xilinx.com>
Subject: Re: [PATCH V10 2/5] PCI: Create device tree node for bridge
Date: Mon, 24 Jul 2023 11:18:42 -0700 [thread overview]
Message-ID: <6f85ea12-b0d3-520f-f114-001669aa0434@amd.com> (raw)
In-Reply-To: <CAL_JsqLzGted2tYHM7uKZRYDHypz4P6KMXGDuYLgpYsJcUyU8Q@mail.gmail.com>
On 7/18/23 11:15, Rob Herring wrote:
> On Fri, Jun 30, 2023 at 12:25 PM Lizhi Hou <lizhi.hou@amd.com> wrote:
>>
>> On 6/29/23 16:52, Rob Herring wrote:
>>>>> + rp[i].child_addr[0] = j;
>>>>> + ret = of_changeset_add_empty_prop(ocs, np, "dynamic");
>>>> It seems slightly confusing to use a "dynamic" property here when we
>>>> also have the OF_DYNAMIC dynamic flag above. I think they have
>>>> different meanings, don't they?
>>> Hum, what's the property for? It's new in this version. Any DT property
>>> needs to be documented, but I don't see why we need it.
>> This is mentioned in my previous reply for V9
>>
>> https://lore.kernel.org/lkml/af9b6bb3-a98d-4fb6-b51e-b48bca61dada@amd.com/
>>
>> As we discussed before, "interrupt-map" was intended to be used here.
>>
>> And after thinking it more, it may not work for the cases where ppnode
>>
>> is not dynamically generated and it does not have "interrupt-map".
>>
>> For example the IBM ppc system, its device tree has nodes for pci bridge
>>
>> and it does not have "interrupt-map".
> How do you know? I ask because usually the only way I have visibility
> there is when I break something. In traditional OpenFirmware, which
> IBM PPC is, all PCI devices have a DT node because it's the firmware
> telling the OS "these are the devices I discovered and this is how I
> configured them".
I configured a ppc VM and added a bridge to the VM
qemu-system-ppc -L pc-bios -boot c -prom-env "boot-device=hd:,\yaboot"
-prom-env "boot-args=conf=hd:,\yaboot.conf" -M mac99 -m 1024 -hda
debian10.qcow2 -nographic -device pci-bridge,chassis_nr=1,id=pci.9
# ls /proc/device-tree/pci\@f2000000/pci1b36\,1\@f/
66mhz-capable class-code fast-back-to-back min-grant
vendor-id
assigned-addresses device-id interrupts name
bus-range devsel-speed linux,phandle reg
cache-line-size ethernet@1 max-latency revision-id
The bridge node does not have 'interrupt-map'. That is why I concerned
for using 'interrupt-map'.
To further debugging on if it really breaks anything, I added a nic
device under bridge. Even without my patch, it is failed anyway.
[ 0.086586] pci 0000:01:01.0: of_irq_parse_pci: failed with rc=-22
So I setup another power10 VM and see the 'interrupt-map' is created for
pci bridge. And the nic device under bridge works fine.
Maybe using 'interrupt-map' will not break anything in the real world.
I will re-create a patchset which uses 'interrupt-map' (like V9) and
checks it only when CONFIG_PCI_DYNAMIC_OF_NODES is turned on.
Thanks,
Lizhi
>
>> Based on previous discussions, OF_DYNAMIC should not be used here.
> For the same reasons, I don't think the behavior should change based
> on being dynamic. Now maybe the behavior when it's an ACPI system with
> DT overlays has to change, but that's a problem for later. I don't yet
> know if we'd handle that here somehow or elsewhere so that this node
> looks like a normal DT system.
>
> This should all work the same whether we've generated the nodes or
> they were already present in the FDT when we booted.
>
>> So I think adding "dynamic" might be a way to identify the dynamically
>>
>> added node. Or we can introduce a new flag e.g OF_IRQ_SWIZZLING.
> I hope not. The flags tend to be hacks.
>
> Rob
next prev parent reply other threads:[~2023-07-24 18:18 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-06-29 17:19 [PATCH V10 0/5] Generate device tree node for pci devices Lizhi Hou
2023-06-29 17:19 ` [PATCH V10 1/5] of: dynamic: Add interfaces for creating device node dynamically Lizhi Hou
2023-06-29 17:19 ` [PATCH V10 2/5] PCI: Create device tree node for bridge Lizhi Hou
2023-06-29 22:56 ` Bjorn Helgaas
2023-06-29 23:52 ` Rob Herring
2023-06-30 16:48 ` Bjorn Helgaas
2023-06-30 19:59 ` Lizhi Hou
2023-06-30 18:24 ` Lizhi Hou
2023-07-18 15:50 ` Lizhi Hou
2023-07-18 18:15 ` Rob Herring
2023-07-24 18:18 ` Lizhi Hou [this message]
2023-06-29 23:55 ` Rob Herring
2023-06-30 14:42 ` Bjorn Helgaas
2023-06-29 17:19 ` [PATCH V10 3/5] PCI: Add quirks to generate device tree node for Xilinx Alveo U50 Lizhi Hou
2023-06-29 20:37 ` Bjorn Helgaas
2023-06-29 17:19 ` [PATCH V10 4/5] of: overlay: Extend of_overlay_fdt_apply() to specify the target node Lizhi Hou
2023-06-29 17:19 ` [PATCH V10 5/5] of: unittest: Add pci_dt_testdrv pci driver Lizhi Hou
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=6f85ea12-b0d3-520f-f114-001669aa0434@amd.com \
--to=lizhi.hou@amd.com \
--cc=devicetree@vger.kernel.org \
--cc=helgaas@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=max.zhen@amd.com \
--cc=robh@kernel.org \
--cc=sonal.santan@amd.com \
--cc=stefano.stabellini@xilinx.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox