Monday, 2022-01-10

*** tpb <[email protected]> has joined #litex00:00
shorneI didn't realize dev_info doesn't work at all unless I enabled CONFIG_DYNAMIC_DEBUG.  Now I need to learn how to turn things on with dyndbg=00:00
shornemine looks the same...00:01
shorne        clocks {00:02
shorne            sys_clk: litex_sys_clk {00:02
shorne                #clock-cells = <0>;00:02
shorne                compatible = "fixed-clock";00:02
shorne                clock-frequency = <100000000>;00:02
shorne            };00:02
shorne        };00:02
shornemaybe I need to enabled the fixed-clock module COMMON_CLK00:05
shorneOpenRISC has an internal clock though, but maybe this is ok00:06
shorneit doesn't seem to help but it does confirm my suspision that it was the clock changes00:10
somloshorne, so what happens when your litex_mmc_probe() hits this spot: https://github.com/litex-hub/linux/blob/litex-rebase/drivers/mmc/host/litex_mmc.c#L553 ?00:26
somloit's just another way to read the clock frequency from DTS (instead of looking up the CPU clock, which I was -- rightfully, IMHO -- told is super hacky and not generalizable) ?00:27
somlos/the clock frequency/*a* clock frequency/00:28
shorneDo you know how to get the dev_info, dev_* print statements to print?00:32
shornebootargs = "console=liteuart earlycon=liteuart,0xe0006800 rootwait root=/dev/mmcblk0p3 debug initcall_debug dyndbg=\"file dd.c +p\" dyndbg.verbose=3";00:32
shorneI was trying to do ... dyndbg="file litex-mmc.c +p"... maybe it should be litex-mmc.dyndbg="+p"?00:33
somloshorne: dev_err_probe() should complain about the clock regardless of debug level00:34
shorneyeah, I am getting nothing00:36
somloand for the rest, I just add `pr_err()` or `pr_warn()` statements if I want to get it to print things while debugging -- low tech, but works :)00:36
shorne[    6.320000] calling  mmc_blk_init+0x0/0x170 @ 100:36
shorne[    6.320000] initcall mmc_blk_init+0x0/0x170 returned 0 after 3423 usecs00:36
shorne[    6.330000] calling  litex_mmc_driver_init+0x0/0x30 @ 100:36
shorne[    6.340000] bus: 'platform': __driver_probe_device: matched device e0005000.mmc with driver litex-mmc00:36
shorne[    6.340000] probe of e0005000.mmc returned -517 after 315 usecs00:36
shorne[    6.350000] platform e0005000.mmc: Added to deferred list00:36
shorne[    6.360000] initcall litex_mmc_driver_init+0x0/0x30 returned 0 after 22269 usecs00:36
shornethe dev_info statement I added to probe doesn't print00:37
shornethe above probe statements are printed because I added dyndbg=\"file dd.c +p\"00:37
somlogo for pr_warn(), that one's less conditional on a crap-ton of policy...00:37
shorneIll just to go lo tech00:37
somlo517 is EPROBE_DEFER00:38
somlobe interesting to confirm/deny it's from PTR_ERR(clk) or somewhere else...00:40
shorneI think somewhere else, I added printk's and it never gets to if (IS_ERR(clk)) it looks like00:43
somlothe only other spot it could be then is devm_add_action_or_reset()00:44
somlothat's the only callee-generated return error code before devm_clk_get()00:45
somlobut devm_add_action (which is the thing doing the work) never returns anything other than ENOMEM or 0 (in drivers/base/devres.c)00:49
somlocan you get a pr_warn("got here\n") at the beginning of the probe, right before mmc_alloc_host() ?00:50
somloI think terminating with \n is important too, otherwise things don't get flushed out to the terminal reliably (distant foggy memory of me banging my head against the wall wondering where my debug printouts went, and why they're not happening when they ought to)00:52
shornenow some more logs00:58
shorne[   10.010000] bus: 'platform': __driver_probe_device: matched device e0005000.mmc with driver litex-mmc00:58
shorne[   10.020000] platform e0005000.mmc: error -EPROBE_DEFER: wait for supplier litex_sys_clk00:58
shorne[   10.030000] probe of e0005000.mmc returned -517 after 8197 usecs00:58
shorne[   10.040000] platform e0005000.mmc: Added to deferred list00:58
shorne[   10.040000] initcall deferred_probe_initcall+0x0/0xb8 returned 0 after 83937 usecs00:58
somlook, so it's from PTR_ERR(clk), as you suspected00:59
shorneI think the platform probe framework is looking at the device tree and seeing the dependency and then deferring the probe before calling probe00:59
shorneI could be wrong01:00
shornebut need to figure out how to get this "generic" clock dependency satisfied in mor1kx01:01
somlonow the question is why does it think it doesn't have the dependency satisfied, since there's clearly a clock in the DT01:01
somloand more mysteriously, why on earth does it work on litex+rocket (I hate not knowing why things do work) :D01:02
shorneI think (guessing) its because this fixed-rate clock is part of the COMMON_CLK stuff.  I think arch/openrisc does not support it01:03
shornemaybe riscv / linux uses a generic clock modules.  OpenRISC has a special clock01:04
somlothen we need to find an alternative way to specify a dummy clock whose frequency we parse in litex_mmc_probe() that works everywhere01:04
somloand we thought searching for the CPU's clock frequency was a hack :)01:05
shorneyeah, I need to go01:05
shornethanks for helping looking01:05
shorneIll look at this later01:06
somlohey, let me know if there's anything I can do to help -- I'll try to teach myself some more DT magic in the mean time01:06
*** nelgau <[email protected]> has quit IRC (Remote host closed the connection)03:34
*** nelgau <[email protected]> has joined #litex03:50
*** Degi_ <[email protected]> has joined #litex04:52
*** Degi <[email protected]> has quit IRC (Ping timeout: 256 seconds)04:53
*** Degi_ is now known as Degi04:53
*** nelgau <[email protected]> has quit IRC (Remote host closed the connection)05:16
*** ilia__s <[email protected]> has quit IRC (Ping timeout: 268 seconds)06:14
*** cr1901 <cr1901!~cr1901@2601:8d:8600:911:11ef:719a:393d:292f> has quit IRC (Remote host closed the connection)06:15
*** cr1901 <cr1901!~cr1901@2601:8d:8600:911:6ce3:c0c5:783e:b45a> has joined #litex06:16
*** _whitelogger <[email protected]> has quit IRC (Remote host closed the connection)06:57
*** _whitelogger <[email protected]> has joined #litex06:57
*** nelgau <[email protected]> has joined #litex06:59
*** _whitelogger <[email protected]> has quit IRC (Ping timeout: 240 seconds)07:04
*** _whitelogger <[email protected]> has joined #litex07:12
geertushorne: somlo: .probe() is not called if device links knows the clock referenced from the DT clocks property is not there.07:19
*** geertu <[email protected]> has quit IRC (Quit: GPU insanity)07:25
*** geertu <[email protected]> has joined #litex07:26
*** FabM <FabM!~FabM@2a03:d604:103:600:7bca:8597:f8c:dc93> has joined #litex07:55
*** geertu <[email protected]> has quit IRC (*.net *.split)08:09
*** nelgau <[email protected]> has quit IRC (*.net *.split)08:09
*** lexano <[email protected]> has quit IRC (*.net *.split)08:09
*** Peanut <Peanut!~paul@user/peanut> has quit IRC (*.net *.split)08:09
*** Melkhior <Melkhior!~Melkhior@2a01:e0a:1b7:12a0:225:90ff:fefb:e717> has quit IRC (*.net *.split)08:09
*** david-sawatzke[m <david-sawatzke[m!~david-saw@2001:470:69fc:105::1634> has quit IRC (*.net *.split)08:09
*** bluecmd <bluecmd!~bluecmd@2001:470:69fc:105::1d44> has quit IRC (*.net *.split)08:09
*** willcode4[m] <willcode4[m]!~willcode4@2001:470:69fc:105::e1b3> has quit IRC (*.net *.split)08:09
*** leons <leons!~leons@2001:470:69fc:105::abc> has quit IRC (*.net *.split)08:09
*** jryans <jryans!~jryans@2001:470:69fc:105::1d> has quit IRC (*.net *.split)08:09
*** _franck_ <[email protected]> has quit IRC (*.net *.split)08:09
*** shenki <[email protected]> has quit IRC (*.net *.split)08:09
*** oter <oter!5e7a0135f3@2604:bf00:561:2000::25f> has quit IRC (*.net *.split)08:09
*** x56 <x56!0x56@user/x56> has quit IRC (*.net *.split)08:09
*** tucanae47_ <[email protected]> has quit IRC (*.net *.split)08:09
*** esden <[email protected]> has quit IRC (*.net *.split)08:09
*** mupuf <[email protected]> has quit IRC (*.net *.split)08:09
*** CarlosEDP <CarlosEDP!~carlosedp@2001:470:69fc:105::218e> has quit IRC (*.net *.split)08:09
*** Crofton[m] <Crofton[m]!~croftongn@2001:470:69fc:105::9a7> has quit IRC (*.net *.split)08:09
*** mntmn <[email protected]> has quit IRC (*.net *.split)08:09
*** G33KatWork <[email protected]> has quit IRC (*.net *.split)08:09
*** keesj <[email protected]> has quit IRC (*.net *.split)08:09
*** mithro <[email protected]> has quit IRC (*.net *.split)08:09
*** _florent_ <[email protected]> has quit IRC (*.net *.split)08:09
*** Degi <[email protected]> has quit IRC (*.net *.split)08:09
*** tnt <tnt!~tnt@osmocom/tnt> has quit IRC (*.net *.split)08:09
*** zyp <[email protected]> has quit IRC (*.net *.split)08:09
*** RaYmAn <[email protected]> has quit IRC (*.net *.split)08:09
*** kgugala <[email protected]> has quit IRC (*.net *.split)08:09
*** promach[m] <promach[m]!~promach@2001:470:69fc:105::ca1> has quit IRC (*.net *.split)08:09
*** Stary <Stary!~Stary@hacksoc/infrastructure> has quit IRC (*.net *.split)08:09
*** novenary <[email protected]> has quit IRC (*.net *.split)08:09
*** benh <[email protected]> has quit IRC (*.net *.split)08:09
*** toshywoshy <toshywoshy!~toshywosh@ptr-377wf33o3bnthuddmycb.18120a2.ip6.access.telenet.be> has quit IRC (*.net *.split)08:09
*** jevinskie[m] <jevinskie[m]!~jevinskie@2001:470:69fc:105::bb3> has quit IRC (*.net *.split)08:09
*** CarlFK <CarlFK!~carlfk@2001:470:69fc:105::5d8> has quit IRC (*.net *.split)08:09
*** lambda <lambda!~weechat@2a01:4f8:c010:8b24::1> has quit IRC (*.net *.split)08:09
*** key2 <key2!sid337923@2a03:5180:f::5:2803> has quit IRC (*.net *.split)08:09
*** eigenform <[email protected]> has quit IRC (*.net *.split)08:09
*** vup <[email protected]> has quit IRC (*.net *.split)08:09
*** anuejn <[email protected]> has quit IRC (*.net *.split)08:09
*** shoragan <shoragan!~shoragan@user/shoragan> has quit IRC (*.net *.split)08:09
*** mikolajw <mikolajw!~mikolajtc@2001:470:69fc:105::3b02> has quit IRC (*.net *.split)08:09
*** r4d10n[m]1 <r4d10n[m]1!~r4d10nmat@2001:470:69fc:105::1:6255> has quit IRC (*.net *.split)08:09
*** pavelow <[email protected]> has quit IRC (*.net *.split)08:09
*** kbeckmann <[email protected]> has quit IRC (*.net *.split)08:09
*** sorear <[email protected]> has quit IRC (*.net *.split)08:09
*** dcallagh <dcallagh!~dcallagh@2001:470:69fc:105::9c5> has quit IRC (*.net *.split)08:09
*** DerekKozel[m] <DerekKozel[m]!~dkozelgnu@2001:470:69fc:105::2f14> has quit IRC (*.net *.split)08:09
*** nrossi[m] <nrossi[m]!~nrossimat@2001:470:69fc:105::1:4527> has quit IRC (*.net *.split)08:09
*** shoragan[m] <shoragan[m]!~shoraganm@2001:470:69fc:105::39> has quit IRC (*.net *.split)08:09
*** gatecat <[email protected]> has quit IRC (*.net *.split)08:09
*** shorne <[email protected]> has quit IRC (*.net *.split)08:09
*** tumbleweed <tumbleweed!~stefanor@ubuntu/member/tumbleweed> has quit IRC (*.net *.split)08:09
*** felix_ <[email protected]> has quit IRC (*.net *.split)08:09
*** hexagon5un <hexagon5un!~elliot@hackaday/elliot> has quit IRC (*.net *.split)08:09
*** vomoniyi[m] <vomoniyi[m]!~vomoniyig@2001:470:69fc:105::3023> has quit IRC (*.net *.split)08:09
*** Las[m] <Las[m]!~lasmatrix@2001:470:69fc:105::74e> has quit IRC (*.net *.split)08:09
*** a3f <a3f!~a3f@2001:470:69fc:105::41d> has quit IRC (*.net *.split)08:09
*** amstan <amstan!~amstan@2001:470:69fc:105::1e9> has quit IRC (*.net *.split)08:09
*** sajattack[m] <sajattack[m]!~sajattack@2001:470:69fc:105::1d9> has quit IRC (*.net *.split)08:09
*** somlo <[email protected]> has quit IRC (*.net *.split)08:09
*** Degi <[email protected]> has joined #litex08:21
*** geertu <[email protected]> has joined #litex08:21
*** nelgau <[email protected]> has joined #litex08:21
*** lexano <[email protected]> has joined #litex08:21
*** tnt <tnt!~tnt@osmocom/tnt> has joined #litex08:21
*** Peanut <Peanut!~paul@user/peanut> has joined #litex08:21
*** jevinskie[m] <jevinskie[m]!~jevinskie@2001:470:69fc:105::bb3> has joined #litex08:21
*** mikolajw <mikolajw!~mikolajtc@2001:470:69fc:105::3b02> has joined #litex08:21
*** r4d10n[m]1 <r4d10n[m]1!~r4d10nmat@2001:470:69fc:105::1:6255> has joined #litex08:21
*** nrossi[m] <nrossi[m]!~nrossimat@2001:470:69fc:105::1:4527> has joined #litex08:21
*** CarlFK <CarlFK!~carlfk@2001:470:69fc:105::5d8> has joined #litex08:21
*** a3f <a3f!~a3f@2001:470:69fc:105::41d> has joined #litex08:21
*** amstan <amstan!~amstan@2001:470:69fc:105::1e9> has joined #litex08:21
*** Crofton[m] <Crofton[m]!~croftongn@2001:470:69fc:105::9a7> has joined #litex08:21
*** willcode4[m] <willcode4[m]!~willcode4@2001:470:69fc:105::e1b3> has joined #litex08:21
*** bluecmd <bluecmd!~bluecmd@2001:470:69fc:105::1d44> has joined #litex08:21
*** Las[m] <Las[m]!~lasmatrix@2001:470:69fc:105::74e> has joined #litex08:21
*** promach[m] <promach[m]!~promach@2001:470:69fc:105::ca1> has joined #litex08:21
*** vomoniyi[m] <vomoniyi[m]!~vomoniyig@2001:470:69fc:105::3023> has joined #litex08:21
*** DerekKozel[m] <DerekKozel[m]!~dkozelgnu@2001:470:69fc:105::2f14> has joined #litex08:21
*** CarlosEDP <CarlosEDP!~carlosedp@2001:470:69fc:105::218e> has joined #litex08:21
*** david-sawatzke[m <david-sawatzke[m!~david-saw@2001:470:69fc:105::1634> has joined #litex08:21
*** dcallagh <dcallagh!~dcallagh@2001:470:69fc:105::9c5> has joined #litex08:21
*** shoragan[m] <shoragan[m]!~shoraganm@2001:470:69fc:105::39> has joined #litex08:21
*** sajattack[m] <sajattack[m]!~sajattack@2001:470:69fc:105::1d9> has joined #litex08:21
*** jryans <jryans!~jryans@2001:470:69fc:105::1d> has joined #litex08:21
*** leons <leons!~leons@2001:470:69fc:105::abc> has joined #litex08:21
*** Melkhior <Melkhior!~Melkhior@2a01:e0a:1b7:12a0:225:90ff:fefb:e717> has joined #litex08:21
*** mupuf <[email protected]> has joined #litex08:21
*** esden <[email protected]> has joined #litex08:21
*** tucanae47_ <[email protected]> has joined #litex08:21
*** x56 <x56!0x56@user/x56> has joined #litex08:21
*** oter <oter!5e7a0135f3@2604:bf00:561:2000::25f> has joined #litex08:21
*** shenki <[email protected]> has joined #litex08:21
*** _franck_ <[email protected]> has joined #litex08:21
*** _florent_ <[email protected]> has joined #litex08:21
*** mithro <[email protected]> has joined #litex08:21
*** keesj <[email protected]> has joined #litex08:21
*** G33KatWork <[email protected]> has joined #litex08:21
*** mntmn <[email protected]> has joined #litex08:21
*** kgugala <[email protected]> has joined #litex08:21
*** RaYmAn <[email protected]> has joined #litex08:21
*** zyp <[email protected]> has joined #litex08:21
*** toshywoshy <toshywoshy!~toshywosh@ptr-377wf33o3bnthuddmycb.18120a2.ip6.access.telenet.be> has joined #litex08:21
*** benh <[email protected]> has joined #litex08:21
*** novenary <[email protected]> has joined #litex08:21
*** Stary <Stary!~Stary@hacksoc/infrastructure> has joined #litex08:21
*** shoragan <shoragan!~shoragan@user/shoragan> has joined #litex08:21
*** anuejn <[email protected]> has joined #litex08:21
*** vup <[email protected]> has joined #litex08:21
*** eigenform <[email protected]> has joined #litex08:21
*** key2 <key2!sid337923@2a03:5180:f::5:2803> has joined #litex08:21
*** lambda <lambda!~weechat@2a01:4f8:c010:8b24::1> has joined #litex08:21
*** hexagon5un <hexagon5un!~elliot@hackaday/elliot> has joined #litex08:21
*** felix_ <[email protected]> has joined #litex08:21
*** tumbleweed <tumbleweed!~stefanor@ubuntu/member/tumbleweed> has joined #litex08:21
*** shorne <[email protected]> has joined #litex08:21
*** gatecat <[email protected]> has joined #litex08:21
*** sorear <[email protected]> has joined #litex08:21
*** kbeckmann <[email protected]> has joined #litex08:21
*** pavelow <[email protected]> has joined #litex08:21
*** somlo <[email protected]> has joined #litex08:21
*** Degi <[email protected]> has quit IRC (Ping timeout: 256 seconds)08:23
*** Degi <[email protected]> has joined #litex08:24
*** nelgau <[email protected]> has quit IRC (Remote host closed the connection)09:01
*** essele <[email protected]> has joined #litex10:36
Wolfvakcan't you enable COMMON_CLK in menuconfig? according to the Kconfig, the only condition for it not to appear is if HAVE_LEGACY_CLK is enabled, which it only is by some few old SoCs (arm, m68k, sh)11:48
a3fgeertu: in that case, shorne should be able to set fw_devlink=off and the probe should be entered, right?12:00
geertua3f: yep12:02
geertuBut the issue with of_match_ptr() suggests he does not have CONFIG_OF=y neither?12:03
somlogeertu: what do you mean by "not there" (re mmc and referenced clock)? It's not *really* there on litex+rocket either, it's just a dummy entry whose frequency I need to parse...13:14
somlo*dummy DTS entry, that is13:15
geertusomlo: If the target clock referenced by the clocks property has not been instantiated yet.13:16
somlogeertu: sorry for being thick here, but by my understanding of what you're saying it shouldn't have worked on litex+rocket or vexriscv either13:18
geertusomlo: openrisc does not select COMMON_CLK13:19
somlooh, so that's a kernel .config thing, then13:20
geertuWith COMMON_CLK, drivers/clk/clk-fixed-rate.c:CLK_OF_DECLARE(fixed_clk, "fixed-clock", of_fixed_clk_setup) takes care of instantiating the fixed rate clock13:20
geertuActually Kconfig13:20
somlook, that makes sense. So then we need a simpler, less dependency-encumbered way to specify a clock frequency for the mmc DT node13:23
geertuIMHO OpenRISC should just switch to CCF, like all other modern architectures13:24
somlowondering what the sequencing of that vs. upstreamability of litex_mmc should be :)13:26
geertuThen we no longer need things like13:26
geertu      anyOf:13:26
geertu        - required: [ clock-frequency ]13:26
geertu        - required: [ clocks ]13:26
geertuin Documentation/devicetree/bindings/serial/8250.yaml13:26
geertuAlthough it's probably too late to kill all of that, due to legacy ("real") OF on PPC etc.13:28
somloah, so that's a hint for me (and/or shorne) to do something kludgy in the short term :D13:28
geertuYou could do like of_platform_serial_setup() for 16550. And repeat that for any future driver that uses clocks :-(13:28
geertushorne: just select COMMON_CLK and be happy?13:29
somloshorne: and if that won't be an option for you, let's chat about it on the LiteSDCard review thread on lkml -- if we're going to modify or add alternative ways to specify the sd_clock source in DT13:31
geertuIf you want to share drivers across architectures, you really want to use COMMON_CLK13:36
somlogeertu: as it is right now, I should add `depends on COMMON_CLK` to the litesdcard Kconfig entry, though...13:56
geertusomlo: I think so14:00
geertutechnically, depends on HAVE_CLK should do, as there are non-CCF clock implementations.  But if you use OF and clocks, you must use CCF for clocks.14:02
geertu(and OpenRISC uses OF, and currently no clocks)14:02
*** FabM <FabM!~FabM@armadeus/team/FabM> has quit IRC (Ping timeout: 240 seconds)15:43
*** FabM <FabM!~FabM@2a03:d604:103:600:a93a:c12a:33bc:b0d3> has joined #litex15:57
*** essele_ <[email protected]> has joined #litex16:44
*** essele <[email protected]> has quit IRC (Read error: Connection reset by peer)16:44
*** nelgau <[email protected]> has joined #litex19:25
*** FabM <FabM!~FabM@armadeus/team/FabM> has quit IRC (Ping timeout: 268 seconds)20:55
shornegeertu: selecting COMMON_CLK is not enough.  I think because arch/openrisc does not call  of_clk_init(NULL); and other things to support the common_clk framework.21:24
shorneprobably we would want: depends on ((PPC_MICROWATT || LITEX) && OF && COMMON_CLK) || COMPILE_TEST21:26
shorneI will reply on the list, I am thinking I should just add support for common_clk to arch/openrisc21:38
somloshorne: how about "((PPC_MICROWATT || LITEX) && OF && HAVE_CLK) || COMPILE_TEST" ?21:38
somloI think COMMON_CLK is one of the ways to satisfy HAVE_CLK (per geertu, earlier)21:39
shorneI see, it should work21:41
shornenow I also see there is HAVE_LEGACY_CLK21:42
somloyeah, that I think would also satisfy HAVE_CLK21:42
somloI'll make this change and line it up for v12, but probably I'll wait for any more feedback (and for news on how enabling common_clk support works out for you eventually)21:43
*** nelgau <[email protected]> has quit IRC (Remote host closed the connection)21:49
*** nelgau <[email protected]> has joined #litex21:50
shorneI got it to work21:53
somlo\o/21:53
shorneI did the common_clk init in arch/openrisc/kernel/time.c21:53
shorneIll reply on v1121:54
somloawesome!21:54
somlohow about the BE memcpy_from_io() thing?21:55
somloi.e., is litex_mmc (v11 + depends_on HAVE_CLK) working OK on openrisc?21:55
shorneit seems to just work the whole system boots and works21:59
shorneany specific test case?22:00
somlook, good to hear (I sort-of expected that after digging into the inner workings of memcpy_fromio)22:00
somlonothing fancy, if it even recognizes the card and you can ls on it, we should be good22:01
somloif it were scrambling the endianness of the 4x32-bit response register, we'd know :)22:01
shorneyeah, thats what I figured, it works22:08
*** TMM_ <[email protected]> has quit IRC (Quit: https://quassel-irc.org - Chat comfortably. Anywhere.)23:27
*** TMM_ <[email protected]> has joined #litex23:27
*** nelgau <[email protected]> has quit IRC (Remote host closed the connection)23:32

Generated by irclog2html.py 2.17.2 by Marius Gedminas - find it at https://mg.pov.lt/irclog2html/!