Sunday, 2022-01-09

*** tpb <[email protected]> has joined #litex00:00
shornesomlo: I have been watching the mmc driver review marathon, good work, do you have an idea of who will be accepting it for upstream?02:40
*** Degi <[email protected]> has quit IRC (Ping timeout: 256 seconds)04:54
*** Degi <[email protected]> has joined #litex04:54
*** ewen <[email protected]> has joined #litex07:17
*** ewen <[email protected]> has quit IRC (Ping timeout: 256 seconds)08:01
*** FabM <FabM!~FabM@2a03:d604:103:600:70a:8e1a:318f:f8e0> has joined #litex08:06
*** FabM <FabM!~FabM@armadeus/team/FabM> has quit IRC (Remote host closed the connection)08:18
*** Martoni <Martoni!~Martoni@2a03:d604:103:600:2ad2:44ff:fe23:2f72> has joined #litex08:19
*** zjason` is now known as zjason08:30
*** linear_cannon <[email protected]> has joined #litex09:19
*** essele <[email protected]> has joined #litex09:46
*** Martoni <Martoni!~Martoni@2a03:d604:103:600:2ad2:44ff:fe23:2f72> has quit IRC (Ping timeout: 240 seconds)10:33
*** Guest71 <[email protected]> has joined #litex10:40
*** Guest71 <[email protected]> has quit IRC (Client Quit)10:40
*** essele <[email protected]> has quit IRC (Quit: My MacBook has gone to sleep. ZZZzzz…)12:12
*** essele <[email protected]> has joined #litex12:13
*** essele <[email protected]> has quit IRC (Ping timeout: 240 seconds)12:20
somloshorne: marathon is right :) (but that's OK, I like learning about existing kernel infrastructure the slow, hands-on way)14:36
somlono idea who will be accepting it though14:36
*** essele <[email protected]> has joined #litex16:01
*** essele <[email protected]> has quit IRC (Quit: My MacBook has gone to sleep. ZZZzzz…)16:44
*** essele <[email protected]> has joined #litex16:46
*** TMM_ <[email protected]> has quit IRC (Quit: https://quassel-irc.org - Chat comfortably. Anywhere.)16:48
*** TMM_ <[email protected]> has joined #litex16:49
*** essele <[email protected]> has quit IRC (Quit: My MacBook has gone to sleep. ZZZzzz…)16:58
*** gruetzkopf <gruetzkopf!~quassel@wireguard/tunneler/gruetzkopf> has quit IRC (Quit: http://quassel-irc.org - Chat comfortably. Anywhere.)17:19
*** gruetzkopf <gruetzkopf!~quassel@wireguard/tunneler/gruetzkopf> has joined #litex17:20
*** essele <[email protected]> has joined #litex17:44
*** essele <[email protected]> has quit IRC (Quit: My MacBook has gone to sleep. ZZZzzz…)18:20
*** essele <[email protected]> has joined #litex18:21
*** essele <[email protected]> has quit IRC (Ping timeout: 256 seconds)18:25
*** essele <[email protected]> has joined #litex18:48
*** essele <[email protected]> has quit IRC (Ping timeout: 240 seconds)18:53
*** Martoni <Martoni!~Martoni@2a03:d604:103:600:2ad2:44ff:fe23:2f72> has joined #litex18:53
*** essele <[email protected]> has joined #litex18:54
*** essele <[email protected]> has quit IRC (Ping timeout: 240 seconds)18:58
*** essele <[email protected]> has joined #litex19:05
*** essele <[email protected]> has quit IRC (Ping timeout: 256 seconds)19:10
*** essele <[email protected]> has joined #litex19:26
*** Martoni <Martoni!~Martoni@2a03:d604:103:600:2ad2:44ff:fe23:2f72> has quit IRC (Ping timeout: 240 seconds)20:03
*** essele <[email protected]> has quit IRC (Quit: My MacBook has gone to sleep. ZZZzzz…)20:08
shornesomlo: I am trying to bring up the new litex mmc driver now.  It doesn't seem to work.  Maybe related to litex_sys_clk which doesnt exist in openrisc.  Ill try to see what can be done.22:18
somloshorne: look at litex commits b4fb3ea9 and d108d2ad for the relevant DTS updates the driver ended up relying on during review22:40
shornesomlo: thanks, I am using the latest litex and generated what looks like a correct dts.. tracing the boot process it seems I am never getting to litex_mmc_probe22:52
shorne            mmc0: mmc@e0005000 {22:53
shorne                compatible = "litex,mmc";22:53
shorne                reg = <0xe0005000 0x100>,22:53
shorne                      <0xe0003800 0x100>,22:53
shorne                      <0xe0003000 0x100>,22:53
shorne                      <0xe0004800 0x100>,22:53
shorne                      <0xe0004000 0x100>;22:53
shorne                reg-names = "phy", "core", "reader", "writer", "irq";22:53
shorne                clocks = <&sys_clk>;22:53
shorne                bus-width = <0x04>;22:53
shorne                interrupts = <3>;22:53
shorne                status = "okay";22:53
shorne            };22:53
shornefor example22:53
somlothat looks fine, here's mine for comparison:22:54
somlo                mmc0: mmc@12005000 {22:54
somlo                        compatible = "litex,mmc";22:54
somlo                        reg = <0x12005000 0x100>,22:54
somlo                                <0x12003800 0x100>,22:54
somlo                                <0x12003000 0x100>,22:54
somlo                                <0x12004800 0x100>,22:54
somlo                                <0x12004000 0x100>;22:54
somlo                        reg-names = "phy", "core", "reader", "writer", "irq";22:54
somlo                        clocks = <&sys_clk>;22:54
somlo                        interrupt-parent = <&L1>;22:54
somlo                        interrupts = <4>;22:54
somlo                };22:55
shorneduring boot with enabling initcall_debug I see...22:56
shorne[    5.620000] calling  mmc_blk_init+0x0/0x170 @ 122:56
shorne[    5.630000] initcall mmc_blk_init+0x0/0x170 returned 0 after 3355 usecs22:56
shorne[    5.630000] calling  litex_mmc_driver_init+0x0/0x30 @ 122:56
shorne[    5.640000] initcall litex_mmc_driver_init+0x0/0x30 returned 0 after 2016 usecs22:56
somlobtw, I also had to drop the `of_match_ptr()` wrapper from around `litex_match` -- can that have anything to do with it?22:57
shornethat doesn't tell much, but I also added a  dev_info(dev, "Initializing litex mmc"); to the top of litex_mmc_probe22:57
shorneyeah, it could be... I saw that change, let me see22:58
shorneI am adding back of_match_ptr to see if it helps22:59
shornehmm, I don't think it will,  of_match_ptr is just #define of_match_ptr(_ptr)      (_ptr)23:01
somlooh, it's a no-op23:02
somlosorry it broke for you, hopefully we can figure out why23:07
somlosomewhat orthogonally, I'm going to push out v11 in a few minutes, a few additional bits of polish to the sources (unlikely to make a difference for the better in your case, though, sadly)23:08
shorneYeah, Ill figure it out.23:09
shorneI am just debugging/printffing/tracing the init process to see where its going wrong23:10
*** nelgau <[email protected]> has joined #litex23:11
somlowondering if publishing all the intermediate versions (which I've kept as separate branches) in litex-hub/linux could be of any help to you, to do a "meta-bisect" of sorts ?23:11
somloyou could of course just `git-am` them from all the emails, but that'd be more of a PITA23:12
somlobut yeah, it'd be interesting to know how come it's failing to even call into litex_mmc_probe() for you23:13
shorneyeah, likely something simple, I may have to meta-bisect it but that may be a last resort23:16
somlothere's only 10 revisions, so about 3 or 4 places to try :)23:30
somlooh, and once it gets past probe, please LMK re. https://github.com/litex-hub/linux/blob/litex-rebase/drivers/mmc/host/litex_mmc.c#L16523:33
somlothat used to be four litex_read32()'s, but it seemed like memcpy_fromio() doesn't play weird endianness swaps on BE the way readl() does (so that I have to undo that with another le32_to_cpu in _read_litex_subregister()23:35
somloand it'd be nice to have a successful test on BE just as a sanity check23:36
somloI also had to do some changes to the Kconfig wizardry, but I don't think there's more to it beyond whether you get the option to select the driver or not during build, and you obviously are building it, so that wouldn't likely be it either23:38
shorneok, the BE thing might be interesting, that always gives us issues23:40
shornealright, now debugging shows something23:41
shorne[    6.350000] bus: 'platform': __driver_probe_device: matched device e0005000.mmc with driver litex-mmc23:41
shorne[    6.360000] probe of e0005000.mmc returned -517 after 293 usecs23:41
a3fshorne: clock missing? might be a good occasion to use dev_err_probe, so /sys/kernel/debug/devices_deferred can give some useful info on what deferred the probe indefinitely23:42
shorneI think the probe is being called, for some reason these dev_info logger statements are not being outputted23:43
a3fDo you have dev_info first thing in the function or later on?23:44
shornefirst thing, I think I need to enabled dynamic debug23:44
a3fhmm, perhaps driver core tries to request some resource for you? I saw that with power domains, I think. if they are not yet loaded, they defer probe even before it runs23:49
somloshorne: what's your `sys_clk` entry in DTS look like?23:50
somloI have:23:52
somlo        ...23:52
somlo        clocks {23:52
somlo                sys_clk: litex_sys_clk {23:52
somlo                        #clock-cells = <0>;23:52
somlo                        compatible = "fixed-clock";23:52
somlo                        clock-frequency = <50000000>;23:52
somlo                };23:53
somlo        };23:53
somlo        ...23:53
somlo        L12: soc {23:53
somlo                ...23:53
somlo                mmc0: mmc@12005000 {23:53
somlo                        compatible = "litex,mmc";23:53
somlo                        ...23:53

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