Tartarus changed the topic of #u-boot to: SOURCE MOVED TO https://source.denx.de/u-boot/u-boot.git / U-Boot v2022.07 is OUT / Merge Window is OPEN, -next is CLOSED / Release v2022.10 is scheduled for 3 October 2022 / http://www.denx.de/wiki/U-Boot / Channel archives at https://libera.irclog.whitequark.org/u-boot
haritz has quit [Quit: ZNC 1.8.2+deb2 - https://znc.in]
haritz has joined #u-boot
haritz has joined #u-boot
mmu_man has quit [Ping timeout: 268 seconds]
gsz has quit [Quit: leaving]
persmule has quit [Ping timeout: 268 seconds]
persmule has joined #u-boot
camus has quit [Ping timeout: 252 seconds]
thopiekar has quit [Ping timeout: 268 seconds]
thopiekar has joined #u-boot
camus has joined #u-boot
camus has quit [Read error: Connection reset by peer]
camus has joined #u-boot
camus has quit [Ping timeout: 268 seconds]
camus has joined #u-boot
LeSpocky has quit [Ping timeout: 245 seconds]
LeSpocky has joined #u-boot
Gravis has quit [Ping timeout: 245 seconds]
vagrantc has quit [Quit: leaving]
Xeroine has joined #u-boot
Xeroine has quit [Ping timeout: 245 seconds]
rvalue has quit [Read error: Connection reset by peer]
rvalue has joined #u-boot
persmule has quit [Remote host closed the connection]
persmule has joined #u-boot
ldevulder has joined #u-boot
crb_ has quit [*.net *.split]
bryanb has quit [*.net *.split]
foxtrot has quit [*.net *.split]
qsx has quit [*.net *.split]
xypron has quit [*.net *.split]
rburton has quit [*.net *.split]
milkylainen has quit [*.net *.split]
xypron has joined #u-boot
bryanb has joined #u-boot
qsx has joined #u-boot
rburton has joined #u-boot
southey2 has joined #u-boot
crb has joined #u-boot
southey2 is now known as foxtrot
eternalforms has quit [*.net *.split]
derRichard has quit [*.net *.split]
narmstrong has quit [*.net *.split]
kabel has quit [*.net *.split]
dgilmore has quit [*.net *.split]
marex has quit [*.net *.split]
johang_ has quit [*.net *.split]
tpw_rules has quit [*.net *.split]
eternalforms has joined #u-boot
derRichard has joined #u-boot
dgilmore has joined #u-boot
kabel has joined #u-boot
dgilmore has joined #u-boot
dgilmore has quit [Changing host]
narmstrong has joined #u-boot
tpw_rules has joined #u-boot
guillaume_g has joined #u-boot
marex has joined #u-boot
johang has joined #u-boot
guillaume has joined #u-boot
matthias_bgg has joined #u-boot
guillaume_g has quit [Ping timeout: 268 seconds]
guillaume is now known as guillaume_g
frieder has joined #u-boot
persmule has quit [Remote host closed the connection]
Xeroine has joined #u-boot
guillaume has joined #u-boot
foxtrot has quit [Remote host closed the connection]
guillaume_g has quit [Ping timeout: 255 seconds]
foxtrot has joined #u-boot
sszy has joined #u-boot
stefanro has quit [Ping timeout: 272 seconds]
stefanro has joined #u-boot
<paulbarker> Hi folks, I'm having some difficulties writing test cases which use the sandbox spi driver
<paulbarker> The sandbox spi flash driver is initialized using device_bind() instead of device_probe()
<paulbarker> The device_bind() function doesn't call device_alloc_priv() and so calling dev_get_parent_priv() on the resulting device returns NULL
<paulbarker> On real hardware where the SPI device was initialized via device tree, dev_get_parent_priv() gives me a populated struct spi_slave
<paulbarker> Without a spi_slave object I can't query things like max_read_size, max_write_size & wordlen for the SPI bus. I want to keep my code generic so it handles both real hw and the sandbox drivers so I can't just assume values for these
<paulbarker> Any ideas why the sandbox SPI flash driver is initialized this way? It seems very awkward
monstr has joined #u-boot
<hramrach> actually, I am facing similar problem on real hardware - when a device is added many drivers only bind but don't probe
<hramrach> from the discussion probe happens when u-boot considers the device 'necessary' but I have no idea how that happens oe why it happens for some drivers and not others
Xeroine has quit [Ping timeout: 245 seconds]
<hramrach> so if it gets bound and used but not probed then it's probably a bug somewhere but I am completely at a loss how to debug DM. it's so convoluted with so many layers that I have absolutely no idea about actual execution path
<paulbarker> hramrach: It definitely took me a couple of hours to figure out how the sandbox SPI drivers initialize
<paulbarker> I would say that failing to allocate & initialize the device private data feels like a bug
<paulbarker> Trying to fix that would affect lots of drivers though and would be a complex piece of work
<paulbarker> The alternative for the SPI driver would be to move fields from `struct spi_slave` to `struct dm_spi_slave_plat` since the platform data does seem to be setup correctly in device_bind()
<paulbarker> I would appreciate input from anyone more familiar with the u-boot device model
prabhakarlad has joined #u-boot
mmu_man has joined #u-boot
sszy has quit [Quit: http://quassel-irc.org - Chat comfortably. Anywhere.]
sszy has joined #u-boot
<paulbarker> Ok, I spotted one thing I missed. There is a call to `device_probe(emul)` for the emulated SPI device. However, it's in sandbox_spi_xfer() and so the device isn't fully probed until a transfer occurs
<paulbarker> There may be a simpler solution here in moving that probe call out to an appropriate initialization function
persmule has joined #u-boot
persmule has quit [Remote host closed the connection]
persmule has joined #u-boot
<marex> hramrach: whenever user needs a service from driver that is bound and not probed, the driver gets probed
<marex> hramrach: it's lazy probing, that's all
<hramrach> what I don't understand is how adding an additional device makes suddenly a lot of unrelated devices not needed
<marex> you need to be more specific than that
<hramrach> when rk808 sysreset is added in ad607512f5757f4485968efd5bcf2c0245a8a235 regulatrs are no longer probed
<hramrach> also no systeset devices are found in the uclass anymore although there was one before and now there should be two but there is none
<hramrach> that is the dm uclass lists them but the sysreset walk does not find any
<marex> macromorgan: ^
<hramrach> sure enough dm_dump_uclass uses uclass_foreach_dev() but uclass_first_device() and uclass_next_device()
<hramrach> it's known problem, and a revert is posted
<hramrach> it looks like the problem is not in the driver which is very similar to other sysreset drivers but in the infra, though
<hramrach> or it's in subtle interaction of the rk drivers and the infra which cannot be understood without understanding what's going on in the infra first
<hramrach> *sysreset_walk uses uclass_first_device() and uclass_next_device()
Xeroine has joined #u-boot
matthias_bgg has quit [Quit: Leaving]
<marex> hramrach: try and talk to macromorgan about the change, really
<marex> I dunno their timezone, but give it a try
GNUtoo has quit [Remote host closed the connection]
<hramrach> they have no idea why it broke stuff and posted a revert
<hramrach> so yes, I can cherry-pick that revert and the regression will be fixed but the cause is not clear
GNUtoo has joined #u-boot
kettenis has quit [Quit: Lost terminal]
sam_sepi0l has quit [Quit: Textual IRC Client: www.textualapp.com]
torez has joined #u-boot
hanetzer has quit [Ping timeout: 245 seconds]
hanetzer has joined #u-boot
hanetzer has quit [Ping timeout: 268 seconds]
hanetzer has joined #u-boot
matthias_bgg has joined #u-boot
rvalue has quit [Read error: Connection reset by peer]
rvalue has joined #u-boot
thopiekar has quit [Ping timeout: 240 seconds]
ad__ is now known as bigendian
lucascastro has joined #u-boot
prabhakarlad has quit [Quit: Client closed]
persmule has quit [Remote host closed the connection]
<paulbarker> I think I've found a way around my issue - When iterating through SPI devices I can check `device_active(dev)` and if it isn't active I can call `device_probe(dev)`
<macromorgan> marex: Something I found (to the "interaction theory") is that while testing on my rk3326 based device these issues never popped up, but for the rk3566 based devices they do.
<macromorgan> Given the behavior I really wanted with the two patches I submitted was a "power off on plug-in" and I got that without the sysreset driver, for now until it's understood better what's going on I will just revert the patch adding the sysreset driver
<macromorgan> I'll resubmit again today or tomorrow
persmule has joined #u-boot
frieder has quit [Remote host closed the connection]
mmu_man has quit [Ping timeout: 252 seconds]
sukbeom has quit [Ping timeout: 240 seconds]
<marex> macromorgan: can't you cooperate with hramrach and sort it out ?
sszy has quit [Quit: http://quassel-irc.org - Chat comfortably. Anywhere.]
sukbeom has joined #u-boot
guillaume has quit [Quit: Konversation terminated!]
redbrain has quit [Read error: Connection reset by peer]
haritz has quit [Read error: Connection reset by peer]
redbrain has joined #u-boot
<hramrach> marex: sounds like neither of us knows what the actual problem is because .. DM
<marex> hramrach: I would blame the DM authors
<marex> ;-)
<marex> hramrach: well, does rk8xx_bind() even get called at all ?
<hramrach> yes
<marex> and this device_bind_driver_to_node() ?
<hramrach> yes
<marex> so the driver is bound, but not probed ?
<marex> ie the rk8xx_sysreset shows up in => dm tree ?
<hramrach> I don't think it has a probe mathod
<hramrach> yes it does show
<marex> it does, unimplemented one
<marex> can you paste.debian.net the dm tree output on your board ?
<hramrach> but it break sprobling other drivers
<marex> I assume if you type => reset the rk8xx_sysreset_request is not called ?
<hramrach> no
<marex> breaks probing other drivers ?
<hramrach> yes, the regulators are no longer probed
<marex> does device_bind_driver_to_node return < 0 ?
<hramrach> if it dod the regulators would not be added to DM AFAICT
<hramrach> bacause they are added after
<hramrach> I already posted dm tree output last week but it has probably expired from the pastebin by now
<marex> not helpful
<marex> what happens if you add dev_or_flags(dev, DM_FLAG_PROBE_AFTER_BIND) after device_bind_driver_to_node() ?
<marex> that would force the sysreset to be probed
<marex> I think you can even update U_BOOT_DRIVER(rk8xx_sysreset) = { .flags = DM_FLAG_PROBE_AFTER_BIND, }; to achieve the same effect
monstr has quit [Remote host closed the connection]
haritz has joined #u-boot
haritz has joined #u-boot
<hramrach> I have no problem with the new sysreset not getting probed - I have problem with the previously available sysreset not getting probed anymore, nor the regulatros
<hramrach> marex: ^
<hramrach> I don't particularly care about hte new device, the board worked OK without it
<hramrach> what really bothers me is that adding a new device breaks *a lot* of previously working devices
astroid has quit [Ping timeout: 240 seconds]
<macromorgan> does it have anything to do with the pmic driver being dm-pre-reloc?
<macromorgan> I wonder if we ifdef that sysreset driver so it doesn't load during SPL?
<macromorgan> again though for some reason (I haven't gotten into the specifics just yet) I cannot reproduce this issue on my rk3326 based device... the rk3566 device I have can reproduce it intermittently, but the branch I use deviates so far from mainline I'm not sure how useful that is...
<macromorgan> it's mainline with about 20 patches on top to support the device I'm on, the rk3566... hopefully one day that can be mainlined too
<hramrach> for u-boot 20 patches is normal, the question is if htey touch the area ;-)
<hramrach> U-Boot 2022.07-00032-g45ef5b0068 (Aug 01 2022 - 18:47:46 +0200)
<hramrach> such a nice round numer ;-)
prabhakarlad has joined #u-boot
sakman has quit [Remote host closed the connection]
<marex> hramrach: in your 'before' case, you did 'usb reset', did you not ?
<marex> could it be that's what probed they pmic and co ?
<hramrach> no
<hramrach> marex: I only booted, interrupted the boot with pressing a key, and did dm tree, nothing else
<marex> https://paste.opensuse.org/85134667 keyboard 0 [ + ] usb_kbd | `-- usb_kbd
<hramrach> I used serial
<hramrach> yes, whan the pmic is not probed usb may fail
<hramrach> the usb keyboard is probably built-in
<marex> you are testing with/without that one commit, right ?
<hramrach> yes
<marex> there are no other changes between those two tests ?
<hramrach> yes, just built new u-boot specifically for the test
<hramrach> I have about 20 distro patches that are completely unrelated and some debug patches I reverted
<marex> did the DM_FLAG_PROBE_AFTER_BIND make any difference ?
sakman has joined #u-boot
<hramrach> did not test that, and don't know haow to use it exactly from the description
<marex> edit drivers/power/pmic/rk8xx.c
<marex> locate +U_BOOT_DRIVER(rk8xx_sysreset) = {
<marex> add new line .flags = DM_FLAG_PROBE_AFTER_BIND,
<marex> save, exit, compile, test
<marex> link does not work ?
<hramrach> works for me ?
<marex> that's weird ... why is the sysreset bound of regulators of node ?
<marex> shouldn't it be bound to the parent (pmic) one ?
<marex> macromorgan: ^
<marex> er no, nevermind
<hramrach> it's bound to the only node available which is the pmic
<hramrach> actually not binding to OF node makes no difference at all, it's still child of pmic in DM
<hramrach> if not child of pmic but a new root everything works but the DM is bogus
<marex> hramrach: does this https://paste.debian.net/plainh/275e59f1 work ?
<hramrach> no, tried that, makes no difference
<hramrach> but using some bogus parent it makes everything fine :p
<hramrach> I think it's NULL but did not check
la_mettrie has left #u-boot [WeeChat 2.7.1]
<marex> hramrach: dev cannot be NULL in bind
<marex> hramrach: try and enable debug in drivers/core, that might provide a hint
<hramrach> AFAICt it does not
<marex> you really do need to dig into the DM core if you want this solved
<marex> (solved properly that is)
<hramrach> how exaactly do I enable debug for all of driver core, anyway?
<hramrach> the parts I tried to enable gave identical output, and a lot of it
GNUtoo has quit [Ping timeout: 268 seconds]
<hramrach> like I had to increase the 3k line scrollback in the terminal to capture the output
<hramrach> and once I did I saw no actual difference
GNUtoo has joined #u-boot
<marex> try adding ccflags-y += -DDEBUG on top of drivers/core/Makefile
<marex> or selectively, #define DEBUG on top of specific file
<marex> hramrach: in minicom, Meta-L is logging
<hramrach> yes, specific fines, but which ones?
<marex> hramrach: probably start with lists.c and device.c
astroid has joined #u-boot
astroid has quit [Changing host]
astroid has joined #u-boot
<hramrach> ok, I will install minicom
thopiekar has joined #u-boot
<hramrach> marex: where does minicom create the log files?
<hramrach> disregard the mmc read failure - that's another bug
GNUtoo has quit [Ping timeout: 268 seconds]
GNUtoo has joined #u-boot
akaWolf has quit [Ping timeout: 245 seconds]
Xeroine has quit [Ping timeout: 268 seconds]
akaWolf has joined #u-boot
<marex> hramrach: the later case has two sysresets ?
GNUtoo has quit [Write error: Connection reset by peer]
<hramrach> yes
<hramrach> all core debug http://sprunge.us/A9KtK5
<hramrach> marex: cannot paster the inidividual loggs because of paster size limit
GNUtoo has joined #u-boot
<hramrach> the paste limit ís 150k and the files are under 200k, quite lame
Gravis has joined #u-boot
<marex> hramrach: website doesnt work
<marex> the suse and debian pastes do work
mmu_man has joined #u-boot
<hramrach> they don't allow large enough paste
<marex> hramrach: arent you missing quite a bit of the output ? or is it just the diff that's clipped ?
<hramrach> marex: that's just the diff, cannot paste the output with these services due to paste size limit
<marex> hmmmm
<marex> I would expect something about the sysreset there somewhere
<hramrach> and *only* the sysreset, not a bunch of other unrelated stuff
sbach has quit [Read error: Connection reset by peer]
sbach has joined #u-boot
lucascastro has quit [Quit: Leaving]
lucascastro has joined #u-boot
lucascastro has quit [Remote host closed the connection]
vagrantc has joined #u-boot
matthias_bgg has quit [Ping timeout: 268 seconds]
alan_ has joined #u-boot
ndesaulniers_ has joined #u-boot
Zapy_ has joined #u-boot
moto-timo_ has joined #u-boot
pgreco_ has joined #u-boot
rfs613- has joined #u-boot
niska` has joined #u-boot
indy_ has joined #u-boot
DrPatater has quit [Ping timeout: 252 seconds]
mrnuke has joined #u-boot
matthias_bgg has joined #u-boot
agraf_ has joined #u-boot
mrnuke_ has quit [*.net *.split]
indy has quit [*.net *.split]
alan_o has quit [*.net *.split]
niska has quit [*.net *.split]
Zapy has quit [*.net *.split]
pgreco has quit [*.net *.split]
agraf has quit [*.net *.split]
rfs613 has quit [*.net *.split]
tinybronca[m] has quit [*.net *.split]
moto-timo has quit [*.net *.split]
ndesaulniers has quit [*.net *.split]
Zapy_ is now known as Zapy
moto-timo_ is now known as moto-timo
agraf_ is now known as agraf
bih420[m] has joined #u-boot
tinybronca[m] has joined #u-boot
Patater has joined #u-boot
Patater has quit [Remote host closed the connection]
Patater has joined #u-boot
torez has quit [Quit: torez]
DrPatater has joined #u-boot
Patater has quit [Ping timeout: 252 seconds]
vagrantc has quit [Quit: leaving]