ChanServ changed the topic of #armlinux to: ARM kernel talk [Upstream kernel, find your vendor forums for questions about their kernels] | https://libera.irclog.whitequark.org/armlinux
naoki has joined #armlinux
jn has quit [Ping timeout: 272 seconds]
jn has joined #armlinux
jn has joined #armlinux
jn has quit [Remote host closed the connection]
jn has joined #armlinux
jn has joined #armlinux
mag has quit [Remote host closed the connection]
mag has joined #armlinux
apritzel has quit [Ping timeout: 260 seconds]
derjanni_ has quit [Ping timeout: 268 seconds]
derjanni has joined #armlinux
rvalue has joined #armlinux
derjanni_ has joined #armlinux
derjanni has quit [Ping timeout: 272 seconds]
jclsn has quit [Ping timeout: 252 seconds]
jclsn has joined #armlinux
guillaume_g has joined #armlinux
derjanni has joined #armlinux
derjanni_ has quit [Ping timeout: 268 seconds]
rvalue has quit [Read error: Connection reset by peer]
rvalue has joined #armlinux
iivanov has joined #armlinux
heat has quit [Ping timeout: 260 seconds]
bps has joined #armlinux
sszy has joined #armlinux
bps has quit [Ping timeout: 272 seconds]
amitk_ has joined #armlinux
amitk has quit [Ping timeout: 260 seconds]
apritzel has joined #armlinux
headless has joined #armlinux
apritzel has quit [Ping timeout: 256 seconds]
monstr has joined #armlinux
<lag> Dear hive-mind, does -EPROBE_DEFER loop forever? (I would usually look these kinds of things up, but I am exceptionally over-loaded ATM - TIA)
cleger has joined #armlinux
mag has quit [Ping timeout: 260 seconds]
viorel has joined #armlinux
elastic_dog has quit [Ping timeout: 252 seconds]
mag has joined #armlinux
elastic_dog has joined #armlinux
<geertu> lag: See driver_deferred_probe_timeout in drivers/base/dd.c (defaults to 10 if CONFIG_MODULES, else 0)
<lag> geertu: Thank you buddy! :thumb
<lag> geertu: Odd that someone on the list is insisting that it loops forever - I knew this shouldn't be the case
* geertu felt obliged to respond, as he just confessed not being an MFD fan ;-)
<lag> geertu: :)
<lag> geertu: MFD is great for certain use-cases, but for the purists, having the ability to trivially convert a class driver into a platform driver is not a good thing - each to their own! :)
iivanov has quit [Read error: Connection reset by peer]
iivanov has joined #armlinux
bps has joined #armlinux
bps has joined #armlinux
bps has quit [Changing host]
bps has quit [Ping timeout: 255 seconds]
apritzel has joined #armlinux
Peng_Fan has quit [Quit: Connection closed for inactivity]
<javierm> lag, geertu: I don't think driver_deferred_probe_timeout is used by all subsytems, but only the ones that opt-in
<bjdooks> lag: it'll keep going every time a new device or such happens
<javierm> git grep driver_deferred_probe_check_state | grep -v "drivers/base"
<javierm> drivers/iommu/of_iommu.c: return driver_deferred_probe_check_state(dev);
<javierm> drivers/net/mdio/fwnode_mdio.c: rc = driver_deferred_probe_check_state(&phy->mdio.dev);
<javierm> include/linux/device/driver.h:int driver_deferred_probe_check_state(struct device *dev);
<javierm> geertu, lag ^
<javierm> bjdooks: indeed. If the subsystems doesn't check for driver_deferred_probe_check_state(), I believe that will always be -EPROBE_DEFER
<lag> bjdooks: That would suit too - so long as it's finite
<lag> javierm: geertu: bjdooks: So what's the default? What happens without special handling?
<bjdooks> it'll just keep trying deffered devices each time there's a device added, iirc
<lag> bjdooks: I guess I need to figure out why that is not the case for this particular contributor
<javierm> lag: do you have a reference to the thread ?
<lag> javierm: Sure, let me dig it up
<javierm> lag: but what bjdooks said, maybe you can refer the contributor to https://blog.dowhile0.org/2022/06/21/how-to-troubleshoot-deferred-probe-issues-in-linux/
<lag> javierm: I shouldn't do that until I am certain that it's not our (LED subsystem's) fault!
<javierm> lag: right, but regardless I wrote that to help people troubleshoot probe deferral issues :)
cbeznea has joined #armlinux
<geertu> javierm: I must be unlucky when I have a deferred probe issue, as usually I don't get sufficiently far in the boot to look at /sys/kernel/debug/devices_deferred :-(
<javierm> geertu: yeah, I also had issues with driver_deferred_probe_timeout (because was timing out with some IOMMU driver on QC platforms)
<javierm> geertu: and proposed to disable it by default but got nacked: https://lore.kernel.org/lkml/20221116115348.517599-1-javierm@redhat.com/
<javierm> lag: the contributor is correct, there's no way for user-space to know when the probe deferral finished, it's basically the halting problem
<javierm> lag: because it may be that the dependency could be registered only when a linux module is loaded for example
headless has quit [Quit: Konversation terminated!]
<javierm> lag: if you want led-gpios to time out, then you should call driver_deferred_probe_check_state()
<lag> javierm: So what is looping and filling up the buffer if the deferred devices are only re-executed when new devices are added?
<javierm> lag: that seems to be some user-space daemon that they have?
<lag> javierm: ... what would happen if we used driver_deferred_probe_check_state() and the pinctrl driver was insmoded at a later date?
<lag> javierm: Egh!
<javierm> lag: because they talk about poll(2) ? or did I misunderstood what they meant?
<javierm> lag: if the pinctrl is insmoded / probe callback called after the 10 secs default timeout, it will fail with -ENODEV
<lag> javierm: As I say, I need to carve out some time to spend on it I think :|
<javierm> lag: yeah, basically you need to decide what would be the behaviour for your subsystem. Either never timeout (the default) or timeout after driver_deferred_probe_timeout (the subsystems I shared in my grep output)
<javierm> lag: IMO the correct thing here would be to not have a timeout but have a syscall or something for user-space to specify that no more modules are expected to be loaded
<javierm> so that the probe deferral mechanism is disabled from there
<javierm> lag: but I don't think the patch they are proposing is the correct thing to do, it is yet again a workaround
<javierm> lag: if the problem is logs, then they should not log on the probe deferral path
<javierm> lag: ah, they already have these kind of stuff in their driver: https://elixir.bootlin.com/linux/latest/source/drivers/leds/simple/simatic-ipc-leds-gpio.c#L82
<javierm> ugh, and request_module("gpio-f7188x")
<javierm> lag: why they are not using module alias instead for https://elixir.bootlin.com/linux/latest/source/drivers/gpio/gpio-f7188x.c ?
<javierm> lag: too many workarounds in that driver... If I were you, I would probably just merge that and move on. IMO the probe deferral mechanism is just hacks on top of hacks
<javierm> lag: specially since the driver is already using that pattern of returning -ENODEV if !IS_ENABLED(CONFIG_FOO_BAR), so at least what is proposing is consistent
<bjdooks> hmm, if the driver is checking for a config, sounds like one of the drivers is not doing the right thing
iivanov has quit [Quit: Leaving...]
iivanov_ has joined #armlinux
iivanov_ has quit [Client Quit]
iivanov has joined #armlinux
iivanov has quit [Client Quit]
bps has joined #armlinux
bps has quit [Changing host]
bps has joined #armlinux
iivanov has joined #armlinux
<lag> bjdooks: That was my initial issue - however, there is already a precedent for it in the lines below (before my time) /facepalm
<javierm> lag, bjdooks: yeah, agreed but as mentioned the driver is already doing that so not sure if is worth to push back in this case
<javierm> anyways, not a hill I would be willing to die on at least :)
<lag> javierm: ... and with 600 mails in my back-log, I don't have time to waste on 49:51 issues
<lag> Path of least resistance, here we come ...
<bjdooks> it's a hill i'd quitely back away from and then pretend to have never seen it in the first place
robmur01 has quit [Remote host closed the connection]
naoki has quit [Quit: naoki]
robmur01 has joined #armlinux
naoki has joined #armlinux
naoki has quit [Quit: naoki]
cmarinas_ has joined #armlinux
cmarinas has quit [Ping timeout: 272 seconds]
heat has joined #armlinux
<mwalle> The general rule seem to be not to rely on the bootloader, but I'm not sure how to fix the following in linux. The problem is that on one of our boards, the PHY reset is broken. The reset line is driven by the CPLD and the SoC. Until now, both will drive the output (the reset line doesn't work, the io cell seems to be to weak to compete against the CPLD output cell). The intended use is that the
<mwalle> SoC drives another gpio connected to the CPLD which then drives the PHY reset. The fix seems easy, that is just change the phy reset GPIO in the device tree. *But* if the bootloader isn't updated, it will leave the old gpio as output. And in this case, the CPLD now drives against the SoC output. So linux would need to change the old gpio to input mode.
<mwalle> just requesting that pin via the pinmux, doesn't work as it wont change the gpio direction. Maybe someone has another idea?
cmarinas_ has quit [Quit: ZNC 1.8.2 - https://znc.in]
cmarinas has joined #armlinux
<jn> mwalle: i'd try using the gpio-hog mechanism, see Documentation/devicetree/bindings/gpio/gpio.txt
<mwalle> jn: ah that one. yeah, but it has one major drawback. the order in which that one is probed isn't always in favor. And I guess it could change over time (?)
<mwalle> *in my favor
<jn> hmm
<mwalle> (i've tried to use that one on another board to set some obscure gpios I need for some devices to work. sometimes it worked, sometimes the gpio hog was activated after the driver was probed)
<jn> in that case, i'd try to change the bootloader or CPLD design to avoid booting in an unusable state
<mwalle> jn: sure. for new boards that is doabale (and maybe boards in the field if customer wants to do bootloader updates). But there seems to be something missing in linux to fix up such situations.
<jn> hmm, i see
<jn> early board code is always a (somewhat dirty) option
elastic_1 has joined #armlinux
elastic_dog is now known as Guest7821
elastic_1 is now known as elastic_dog
Guest7821 has quit [Killed (osmium.libera.chat (Nickname regained by services))]
<mwalle> and making the gpio hog code probe early isn't possible because the gpio controller might be a module and there is just no link between a device and an assicated gpio.
<mwalle> or - for dt platforms at least - the gpio hog could be a child of a device
<jn> modules are a good point. in your specific case you could use them to influence the probe order in your favor
<mwalle> jn: yeah but that is rather fragile. we are an OEM. We can't really tell someone how to use our bsp
balrog has quit [Quit: Bye]
monstr has quit [Remote host closed the connection]
balrog has joined #armlinux
sszy has quit [Quit: http://quassel-irc.org - Chat comfortably. Anywhere.]
headless has joined #armlinux
bps has quit [Ping timeout: 255 seconds]
cleger has quit [Quit: Leaving]
cleger has joined #armlinux
guillaume_g has quit [Quit: Konversation terminated!]
cleger has quit [Remote host closed the connection]
derjanni_ has joined #armlinux
derjanni has quit [Ping timeout: 268 seconds]
bps has joined #armlinux
bps has joined #armlinux
apritzel has quit [Ping timeout: 272 seconds]
apritzel has joined #armlinux
headless_ has joined #armlinux
headless has quit [Ping timeout: 256 seconds]
viorel has quit [Quit: WeeChat 3.5]
cbeznea has quit [Ping timeout: 264 seconds]
iivanov has quit [Quit: Leaving...]
amitk_ has quit [Ping timeout: 256 seconds]
headless_ has quit [Quit: Konversation terminated!]
naoki has joined #armlinux
rvalue has quit [Ping timeout: 255 seconds]
rvalue has joined #armlinux
rvalue has quit [Quit: ZNC - https://znc.in]
rvalue has joined #armlinux
<ukleinek> linusw_: Do you know details about drivers/mfd/ab8500*?
<ukleinek> linusw_: background of my question is: I looked at the matching PWM driver (i.e. drivers/pwm/pwm-ab8500.c) and there is something strange.
<ukleinek> The driver doesn't handle struct pwm_state::period, I guess the period is fixed at 0x300 ns, but a confirmation from someone who has the documentation handy would be great.
rvalue has quit [Ping timeout: 268 seconds]
<ukleinek> s/0x300/0x400/
bps has quit [Ping timeout: 256 seconds]