<dsimic>
true, and it also stems from the naming changes resulting from PCI(e) cards being moved around between the slots on a typical x86_64 motherboard
<dsimic>
there's no such possibility with the fixed on-board devices, so a much simpler, fixed naming scheme for them would/should make sense
<dsimic>
I still need to think a lot about it, i.e. how to actually introduce back what's been erradicated long time ago -- stable and simple numbering :)
<dsimic>
and not to cause a lot of frowning upon
<CounterPillow>
that won't help you when your PCIe controllers probe in a different order
<dsimic>
good point, which is why I need to put more thinking into it
<dsimic>
for example, the layout of the PCIe "tree" is known for each board, so in theory the "known nodes" could be referenced for the numbering
<dsimic>
though, that's far from simple, so... more thinking is needed :)
<CounterPillow>
why waste time on this at all? the problem is solved
<dsimic>
how?
<CounterPillow>
with the stable interface naming scheme. If people want them renamed to something numbered, they can with udev rules for their specific setup and preference.
<dsimic>
i.e. how to link on-board network interfaces with the per-interface on-board LEDs?
<dsimic>
that's true for the userspace, but I'm not sure that can work for the DTs
<CounterPillow>
DTs don't depend on probe order at all and can just reference whatever node they mean, no?
<dsimic>
e.g. there are devices with the RJ-45 network ports in the back and per-interface LEDs on the front, which are supposed to be linked with the corresponding network interfaces
<dsimic>
but there are no DT nodes needed for the on-board PCIe devices that are network interfaces, they're enumerated dynamically
<dsimic>
i.e. there's (currently) nothing to link to
<dsimic>
there are already DT examples that add such nodes for the purpose of defining static MAC addresses by the boot loader, but frankly, they look really wrong by trying to define statically that's dynamic by nature
<CounterPillow>
there can be nodes for devices in pcie controllers iirc, and it's for purposes like this where a device is hard-wired and its hard-wiredness depends on something else
<dsimic>
true, there are e.g. soldered PCIe WiFi nodes that require some additional "out of band" resets and whatnot to actually work
<dsimic>
such additions to the DTs have already been frowned upon a lot, and the only reason why they were accepted was that such soldered PCIe modules/devices couldn't work wthout the additional handling performed that way
<dsimic>
all that is something to think more about
stikonas has quit [Remote host closed the connection]
<dsimic>
adding a whole lot of kludge to a DT, which actually isn't needed for the devices to work, just to be able to reference the node somewhere else in the DT, seems like a suboptimal approach to me, while all that's needed is some kind of simple and stable ordering for the soldered on-board devices
<CounterPillow>
"just to be able to reference the node somewhere else in the DT" is the reason why phandles exists though. A non-enumerable part needs to know about the enumerable part, and in that case I think having a node for the enumerable part that specifies which PCIe bus address it describes is quite a reasonable way to have the non-enumerable DT refer to this device that's expected to be there for its functionality.
<naoki>
dsimic: CounterPillow: Hmm. Thanks for the info.
Daanct12 has joined #linux-rockchip
hexdump02 has quit [Ping timeout: 244 seconds]
hexdump02 has joined #linux-rockchip
godvino has joined #linux-rockchip
<dsimic>
CounterPillow: I'll think more about it for sure
<dsimic>
the rather large argument against defining parts of the DT that describe automatically enumerable parts, just to reference them elsewhere, is the amount of data that needs to be addeed; maybe I forgot some of details so the amount of data added that way actually isn't that large, it's been a while simce I looked into in closely
<dsimic>
the amounf of added data in the example that I mentioned earlier, which serves for the boot loader to define a fixed MAC address for a PCIe Ethernet interface and pass it to the Linux kernel driver, is simply ridiculously large
<dsimic>
if I were a maintainer of the respective platform/architecture, I'd ask the contributor to seek another solution :)
<dsimic>
s/for a PCIe/for a soldered on-board PCIe/
Bahhumbug has quit [Read error: Connection reset by peer]
Bahhumbug has joined #linux-rockchip
_whitelogger has joined #linux-rockchip
_whitelogger has joined #linux-rockchip
_whitelogger has joined #linux-rockchip
ldevulder has joined #linux-rockchip
franoosh has joined #linux-rockchip
franoosh has quit [Ping timeout: 256 seconds]
naoki has quit [Quit: naoki]
franoosh has joined #linux-rockchip
<diederik>
Context/concrete example: I was (very) surprised I couldn't connect the LAN1/LAN2 LEDS to their NICs because they are connected via PCIe on NanoPi R5S
Net147 has quit [Quit: Quit]
Net147 has joined #linux-rockchip
Net147 has quit [Changing host]
Net147 has joined #linux-rockchip
<wens>
isn't it just one node?
<diederik>
what do you mean?
franoosh has quit [Ping timeout: 264 seconds]
stikonas has joined #linux-rockchip
stikonas has quit [Remote host closed the connection]
franoosh has joined #linux-rockchip
raster has joined #linux-rockchip
franoosh has quit [Ping timeout: 264 seconds]
dsimic has quit [Ping timeout: 240 seconds]
dsimic has joined #linux-rockchip
Daanct12 has quit [Quit: WeeChat 4.7.1]
warpme has joined #linux-rockchip
warpme has quit [Client Quit]
stikonas has joined #linux-rockchip
<wens>
I meant for adding pcie devices
<diederik>
Can you give or point to an example? I still don't get it
stikonas has quit [Ping timeout: 244 seconds]
stikonas has joined #linux-rockchip
<wens>
diederik: I was responding to dsimic's comments, not yours
<diederik>
wens: oh, that explains it. Thanks :)
psydroid2 has joined #linux-rockchip
franoosh has joined #linux-rockchip
raster has quit [Quit: Gettin' stinky!]
dliviu has joined #linux-rockchip
nashpa has quit [Ping timeout: 260 seconds]
stikonas has quit [Remote host closed the connection]
franoosh has quit [Ping timeout: 265 seconds]
stikonas has joined #linux-rockchip
testaccount has joined #linux-rockchip
testaccount has quit [Quit: Going offline for now]
<dsimic>
diederik: yes, the NanoPi R5S is a very good example
<dsimic>
wens: of course, it ends up in a single DT node, but it's so deep down inside other nodes that also need to be added for that purpose
franoosh has joined #linux-rockchip
<wens>
your pcie controller node is always going to be present
<wens>
maybe there's a root bridge node
<wens>
then the network controller
<wens>
same goes for actual slots I think
<wens>
there's nothing enumerable about hardware slots. so if you want them nicely numbered you probably have to describe them in DT
<wens>
on x86 they are described in dmi / smbios. you're not getting away with no description
<dsimic>
here's the example for setting a fixed MAC address by the boot loader
<dsimic>
less +147 arch/arm64/boot/dts/freescale/imx8mm-venice-gw72xx.dtsi
<dsimic>
(that's how I make such "bookmarks" internally :)
<dsimic>
that's really a lot to add, IMHO
<dsimic>
though, maybe it actually isn't that horrible, now that I'm thinking about it again... hmm
<dsimic>
hmm, maybe it would be possible to link to the PCIe network interfaces using the current userspace interface naming nomenclature
<dsimic>
the names generated that way are already guaranteed to be persistent, and that's all we need
<wens>
there's one _stable_ interface naming scheme based on slot names
<dsimic>
hmm, true, and we've got no slots for the on-board interfaces
<wens>
for example I get enP3p49s0 and enP4p65s0 on my orange pi 5 plus
<dsimic>
thus, something more to think about
<wens>
the kernel doesn't really know that there are no slots :p
<dsimic>
the first step should be to make it aware of that :)
<wens>
I think if you add aliases it then allows following a different scheme?
<dsimic>
but what to add aliases for?
<wens>
there are also other options, like based on mac address
<dsimic>
I'd be happy to add ethX aliases for the on-board PCIe interfaces, but they need to point to something
<wens>
then you will need to add device nodes for them
<wens>
no way around it; as you said, they need to point to something
<dsimic>
ah, MAC addresses are often not saved anywhere, such as into some flash, so we can't hinge on them either :/
<dsimic>
let me reasearch the current userspace naming scheme in detail first, please, regarding the lack of slots
<dsimic>
s/reasearch/research/
<wens>
I think in my example the slot number is just randomly carved out
<dsimic>
perhaps, which is quite wrong and should be fixed first
<wens>
probably 16 slots per domain, and index 0 is left to the root complex
<wens>
not sure what the lowercase 'p' is for in my example. but s0 indicates slot 0 under that particular domain / controller
ldevulder has quit [Ping timeout: 264 seconds]
cbeznea has quit [Ping timeout: 248 seconds]
franoosh has quit [Remote host closed the connection]
<dsimic>
wens: thanks for the link! O'll research it all in detail, including going through the systemd source code
<dsimic>
I already had to go through it, while fixing some pacman-related bug a while ago
<dsimic>
sometimes I really wish systemd documentation is available as a large, single PDF file... IMHO, a lot of context gets lost by splitting it into multiple pages available online or as man pages