libera/#maemo-leste/ Friday, 2021-11-26

Wizzuphttps://www.aliexpress.com/item/1005003272036569.html12:11
Wizzupthese seem quite small12:11
uvosnot sure why you need sutch a thing12:25
uvoshttps://www.aliexpress.com/item/1005001847849317.html?spm=a2g0o.productlist.0.0.5f522caeFjJgL8&algo_pvid=49986476-d1b2-4a56-9ea5-f4a5e56e21f8&algo_exp_id=49986476-d1b2-4a56-9ea5-f4a5e56e21f8-3&pdp_ext_f=%7B%22sku_id%22%3A%2212000017838609285%22%7D\12:25
uvosjust one of these12:25
uvosset it to 3.7v before you leave12:25
uvosand have a usb cable feed it12:26
uvoshttps://www.aliexpress.com/item/4000064597454.html?spm=a2g0o.productlist.0.0.5f522caeFjJgL8&algo_pvid=49986476-d1b2-4a56-9ea5-f4a5e56e21f8&algo_exp_id=49986476-d1b2-4a56-9ea5-f4a5e56e21f8-0&pdp_ext_f=%7B%22sku_id%22%3A%2210000000165416980%22%7D12:26
uvosmaybe rather this12:26
Wizzupmhm12:26
uvostransient current can be pretty high with these things12:26
WizzupI might be able to find those locally here now12:27
uvossure yeah12:27
uvosbut you need a multimeter too12:28
uvosnot sure what you have12:28
Wizzupnothing, but there should be shops with that stuff here12:28
Wizzupprobably better if I just wait and focus on other stuff, but I don't like waiting :)12:28
uvosprobubly more sane just to work on userspace with the d412:29
Wizzupmhm12:29
WizzupI'll work on the bootmenu+recovery-mode and omap-linux some, try to get that going12:30
bencohuvos: wait, is that thing reliable12:38
bencohuvos: it looks like a toy12:38
uvosofc its just a lm25912:39
uvosextreamly widly used in products12:39
bencohno I meant, your first link12:39
uvosand the rest is just its referance implementation12:39
bencohthe "power supply" with the lcd screen12:40
uvosthose work great too12:40
Wizzupthe one I linked?12:40
uvoscant vautch for this exact one12:40
uvosbut i have several12:41
uvosthey are fine12:41
bencohWizzup: ah right, that one too12:41
uvosno match for a real lab supply on output ripple or regulation12:41
uvosbut perfectly fine otherwise12:41
bencohhm12:41
WizzupI mean I don't think I can find a lab psu here, that's the problem :p12:41
WizzupI'll just wait12:41
bencohWizzup: what kind of voltage do you need anyway?12:42
bencoh~4V ?12:42
Wizzupa bit less, but around that, yes12:44
Wizzupfound a local shop, will go there now I guess15:02
sicelo:-)15:08
uvos"[12:41] <Wizzup> I'll just wait" that lasted long :P15:12
Wizzuphehe15:16
freemangordonuvos:   drmModePageFlip takes 6 ms18:12
freemangordonaccording to docs it shall return immediately18:12
Wizzupgot it at least18:22
freemangordonwell, not sure18:23
uvosfreemangordon: thats wierd drmModePageFlip shouldent really do anything at all18:25
uvoshttps://elixir.bootlin.com/linux/latest/source/drivers/gpu/drm/drm_plane.c#L1202 probubly waits for one of the locks18:31
uvosplenty of reasons why drm_mode_page_flip_ioctl can stall for a while really18:31
freemangordonI think in our case it is that it pins the framebuffer18:35
freemangordonbut I think we have more general issue here - it seems buffer is created for every frame18:36
freemangordonnot that I know how is that supposed to work18:36
freemangordonbut in armsoc we have ARMSOCDRI2ReuseBufferNotify()18:37
uvosin our flipchain dri2 in x calls a function called check_resue_buffer (or something like that)18:38
uvosit returns false18:38
uvosmaybe check whyy18:38
Wizzupok, I have a working serial. now to remember which string to use for kernel command line18:38
uvosfreemangordon:  its allocate_or_reuse_buffer18:40
uvosthe ddx implements ReuseBufferNotify18:40
uvosyeah looks like what armsoc probubly dose18:40
freemangordonhmm, where do you see that?18:42
freemangordonuvos: I don;t see such function18:43
uvoshw/xfree86/dri2/dri.c18:44
uvoshw/xfree86/dri2/dri2.c18:44
uvosallocate_or_reuse_buffer18:44
uvosline 50318:44
uvosgets called on every flip and returns false on d4 - i checked this yesterday18:45
freemangordonI don;t understand what do you mean "the ddx implements ReuseBufferNotify"18:45
freemangordonomap-video ddx does not implement that18:45
freemangordonmaybe this is one of the problems18:45
uvosright18:45
uvosthats why allocate_or_reuse_buffer returns false18:45
uvosthe ddx implements ReuseBufferNotify if it wants18:46
uvosactually thats not what happens18:46
freemangordonah, yeah, sure18:46
uvosit returns false for another reason18:46
uvosactually false is reuse18:47
uvosso no idea18:47
freemangordonuvos: what about (both of us) try to find some time these days and debug this?18:50
freemangordonI mean - to have a debug session18:51
freemangordonnot to say that it somehow manages to tear while doing page flip18:52
freemangordonthis is impossible on theory :)18:53
freemangordon*in theory18:53
uvoswhy would that be impossible, you can flip during hblank18:54
freemangordonno, because the flip requested is "flip on next vblank"18:56
freemangordonWizzup: do we have some budget to spend on that?18:56
uvossure we can debug some time18:56
uvossynconiously18:56
freemangordonyeah18:56
uvosidk if it makes sense but sure18:56
freemangordonI am not sure too18:56
freemangordonthus my question ^^^ to Wizzup18:57
freemangordonif we can find someone who knows how all this is supposed to work18:57
Wizzupfreemangordon: probably depends on how much the person needs18:58
freemangordonwell, I guess we have to fina that 'person' first18:59
Wizzuplet's see if I can boot to recovery mode with serial now :)19:41
sicelo:-)19:43
Wizzupuvos: do we need to install something to make the recovery softlevel work?19:43
Wizzuphm, ok, nevermind, it works I think19:43
Wizzupuvos: btw since I attached serial I haven't bad any random boot failure ;)20:04
Wizzuptmlind_: ok, I have a shell now with the uarts idled and no modules loaded20:14
Wizzupthe screen seems to be on still though20:14
WizzupI guess I'll load omapdrm and friends?20:15
Wizzupuvos: ping20:27
uvosWizzup: hmm?20:27
Wizzupuvos: how do I blank a display with drm20:28
WizzupI might not have enough modules loaded yet but it's also not clear to me20:28
Wizzupuvos: as in, I have the n900 booted to init=/bin/bash and enabled off mode20:28
uvoshttps://github.com/IMbackK/drm_blankscreen20:28
Wizzupbut I don't think the screen is off20:28
Wizzupok, I do not have /dev/dri/ yet20:29
Wizzupso more is missing20:29
Wizzupthe panel is loaded though20:29
uvosis omapdrm loaded?20:29
Wizzupyes20:29
uvosudev?20:30
Wizzuphttps://dpaste.com/GXV7KEUQ820:30
Wizzupno, definitely not udev since that loads all the modules20:30
Wizzupwhich is the point: I don't want it to do that20:30
freemangordonWizzup: maybe mknod20:30
Wizzupwhen I booted to init=/bin/bash the display was still on from u-boot20:30
uvosWizzup: well udev also creats lots of the files in /dev/20:30
uvosyeah mknod20:30
WizzupI ran busybox mdev -s and it didn't make it20:31
Wizzupas you sure what's all that is needed?20:31
parazydYou should mount devtmpfs first, no?20:31
parazydThen mdev20:31
uvosmodule wise that looks correct20:31
Wizzupoh you're right, even devtmpfs is not set up20:31
Wizzupargh20:31
uvosheh20:32
parazydThen also sys and proc manually20:32
Wizzupmaybe not, it says it's already mounted20:32
Wizzupbut it's not in mount20:32
Wizzupparazyd: yes I did that20:32
freemangordonWizzup: I think you should mknod /dev/dri/card0 c 226,0 at some point20:32
Wizzup# mount -t devtmpfs devtmpfs /dev20:32
Wizzupmount: /dev: devtmpfs already mounted on /dev.20:32
freemangordonsorry, it is mknod /dev/dri/card0 c 226 020:33
freemangordon(no comma)20:33
Wizzupstill, I don't have internet so I can't build uvos tool anyway20:33
WizzupI'll have to reset/reboot20:33
Wizzupkinda weird that kernel provides no way to do this20:34
parazydIn my initramfs shell script I have:20:34
parazydmount -t devtmpfs none /dev20:34
parazydmount -t proc none /proc20:34
parazydmount -t sysfs none /sys20:34
parazydin that order20:34
Wizzupty20:35
freemangordonglib upstream replied, finally :)20:35
Wizzuptmlind_: this traces happens when n900 fails to boot randomly https://dpaste.com/GRWDBS2PA20:35
Wizzupuvos: ^20:36
freemangordonpm runtime20:36
Wizzupyes, as always20:36
Wizzup:P20:36
freemangordon:)20:37
freemangordonlets hope tmlind_ know how to find the offending module20:38
freemangordon*knows20:38
freemangordonWizzup: maybe post on linux-omap20:39
Wizzupyeah, I'm just trying to catch a bunch20:39
WizzupI'll have to build nokia modem again later as well20:39
Wizzupparazyd: btw kernel does it:21:00
Wizzup# dmesg|grep devtmp21:00
Wizzup[    0.134277] devtmpfs: initialized21:00
Wizzup[    5.040222] devtmpfs: mounted21:00
Wizzupso the mknod is not enough (or just wrong) since uvos drm tool gets Can not open drm device /dev/dri/card0: No such device21:02
freemangordonmaybe you need to mknod render node as well21:03
Wizzupmodprobe display_connector21:04
Wizzupthis was necessary21:04
Wizzupalas, uvos https://dpaste.com/DN8678RA821:04
Wizzupit looks like the touchscreen doesn't even support runtime pm?21:09
uvosi mean it just calls perror() regardless21:11
uvosso that dosent mean anything21:11
uvosunless drmSetMaster is failing21:11
uvosi should klean that thing up a bit21:11
uvosdose it not work?21:12
Wizzuphttps://github.com/maemo-leste/bugtracker/issues/32121:12
Wizzupuvos: well maybe I need to also disable the backlight manually?21:12
uvosif the backlight is associated with the right output device in dts it should also turn off21:13
uvoscat /sys/class/drm/*/dpms21:13
uvosshould tell you if the display is on or not21:14
uvosaccording to drm21:14
Wizzupok21:14
Wizzupit looks like you things turns off only one21:15
Wizzup# cat /sys/class/drm/*/dpms21:15
WizzupOn21:15
WizzupOn21:15
uvosobivously you need to have whatever module the baclight led is on loaded too21:15
uvosbtw21:15
Wizzup(runs tool)21:15
Wizzup# cat /sys/class/drm/*/dpms21:15
WizzupOff21:15
WizzupOn21:15
Wizzupyes, but I can control the backlight via sys so it is loaded with the panel21:15
WizzupI think probably it turns off the s-video/composite but not the lcd21:16
uvosit should turn off both21:16
uvoscode wise21:16
Wizzup# cat /sys/class/drm/card0-Composite-1/dpms21:16
WizzupOff21:16
Wizzupt# cat /sys/class/drm/card0-DPI-1/dpms21:16
WizzupOn21:16
Wizzupright21:16
uvosworks on d4 with dsi and hdmi21:16
uvosdrmModeConnectorSetProperty also returns 0 for both displays21:17
uvosso it not haveing any effect is wierd21:17
Wizzup't is what is happening though21:17
uvosmaybe something else is reneableing it, could you have drm_blankscreen not quit21:17
uvosand not drop master21:17
uvosthat way nothing can renable21:18
uvosso move drmSetMaster(device); out of the loop21:18
uvosand add while(true) to the end21:18
uvosafter the loop21:18
uvosand  remove  drmDropMaster(device); ofc21:19
Wizzupthe only process that runs is bash21:19
uvosthe kernel might for its console, it dident when i wrote the program but it might now21:20
Wizzupin any case currently: # sleep 5; ./idle.sh21:20
WizzupST_UART2,ST_MCSPI121:20
Wizzupuvos: console=ttyS2 though21:20
uvosWizzup: ok21:20
uvosWizzup: no idea then21:20
Wizzupspi1 = touchscreen as far as I can tell21:21
Wizzup(and it's not loaded, and it doesn't do pm)21:21
uvosand uart is undetached kernel console21:21
uvosproubly21:21
Wizzupit is detached actually21:22
Wizzupuart2 seems to be bt21:22
Wizzup[    2.565093] printk: console [ttyS2] enabled21:22
Wizzup[   17.983398] printk: console [ttyS2] disabled21:22
Wizzupuvos: maybe fbdev can be used to blank or something?21:31
uvosyou can try fbdev blanking21:34
uvosbut on d4 it dosent allow it it idle21:34
uvos*to21:35
Wizzupok21:35
Wizzupinteresting, without drm loaded (just serials idled and off mode enabled) I get this:21:37
Wizzup# sleep 5 ; ./idle.sh21:37
WizzupST_MCSPI121:37
uvosdose i2cdetect suggest you have any i2c devices in use by the kernel?21:38
Wizzupit looks like RET increases though21:39
uvoslooking at /sys/class/i2c-dev/ should also work21:39
uvosah so its not blocked all the time21:39
Wizzupyes, which is great, I haven't seen that before21:39
uvosthat might be the best you can do, tmlind mentioned that the kernel is too busy with timers to enter off mode with stock cost table21:40
Wizzuphmm, ok21:40
uvosdunno if it applies when you have so little modules loaded or not21:40
uvostmlind_: ?21:40
Wizzup# sleep 5; ./idle.sh21:40
WizzupST_MCSPI121:40
WizzupOFF:0,RET:45821:40
Wizzupuvos: fwiw no modules loaded at all atm21:41
Wizzupwell I guess this is some progress21:42
Wizzuplooks like loading just drm (not omapdrm) and panel adds uart2 as blocker, but allows me turn off backlight and it's not too bad ...21:44
Wizzup0.01A at 0.34V21:44
Wizzupso like 71mW?21:49
uvos0.34v?21:49
Wizzup# sleep 10 ; cat /sys/class/power_supply/bq27200-0/power_avg21:49
Wizzup7154021:49
Wizzupuvos: 3.4V21:49
Wizzupsry21:49
Wizzupmy display is showing 03.4v ;)21:50
uvos 0.01A at 0.34V =/=  71mW21:50
uvosor 0.01A at 3.4V =/=  71mW even21:50
Wizzupright, which is why I took the measure from bq2720021:51
uvos71mW is the same as bionic at idle21:51
Wizzup71mW seems about right for hitting RET some time but not OFF, no21:51
uvosalso ret no off21:51
uvosso that makes sense21:51
Wizzupalright21:51
uvosactually bionic is about 6021:51
uvosbut ~21:51
Wizzupyeah maybe I need to let it settle some more21:51
uvosroughly21:51
Wizzupok, I'll document all of this, but then there is a big task of loading modules one by one I guess21:52
Wizzupseeing what causes what kind of blocks21:52
WizzupI suspect there's more than a few different ones21:52
Wizzupalso didn't tmlind_ say he fixed OFF not being hit?21:52
uvosnot that i remember21:52
uvosbut maybe21:53
uvosi remember him hacking the cost table21:53
uvosno idea how this ended up21:53
siceloWizzup: https://libera.irclog.whitequark.org/maemo-leste/2021-09-28#3090864721:55
Wizzupsicelo: ok, so looks like we probably dn't have it yet21:55
Wizzupthanks for digging that up :)21:56
sicelo 18:40 <tmlind> uvos: yup trying with target_residency of 50000 and 60000 makes core ret work21:56
sicelo18:40 <tmlind> core_pwrdm (ON),OFF:19,RET:6,INA:0,ON:26,RET-LOGIC-OFF:0,RET-MEMBANK1-OFF:0,RET-MEMBANK2-OFF:021:56
siceloso you could try that and see21:56
uvosyeah21:57
uvosbut we need to mesure target_residency really21:57
uvosand see if the current value is wrong21:57
Wizzupso this would be replacing 15000 with 50000 and 30000 with 60000 ?21:58
Wizzupin arch/arm/mach-omap2/cpuidle34xx.c21:58
uvosyou should lower it really21:59
uvosif you want it to pick it more often21:59
Wizzupwell it looks like we're raising it atm?22:00
Wizzupunless I am missing something?22:00
uvosright22:01
uvosthat makes no sense22:01
uvosthats why im mentioning it22:01
Wizzupwell I might do what tmlind said worked first22:01
Wizzupand then see what better values we need?22:01
uvosjust set off to what ret is now22:01
uvosthere might not be better values22:01
Wizzuphttps://dpaste.com/43AM6QRE422:01
uvosso the point of target_residencey is that this is the minimum time the device must spend there for it to make sense to enter this state22:02
uvosfrom a pm perspective22:02
uvosoff requries you to reload all registers22:02
Wizzuphmm22:02
uvosits expensive22:02
uvospower wise22:02
Wizzupthen why does it only work for tmlind_ if he increases it?22:02
Wizzupidgi22:02
uvoshis values must be wrong/typo, he must be looking at a different file or he/someone changed it to a lower value since22:03
uvoshttps://www.kernel.org/doc/html/v5.15/admin-guide/pm/cpuidle.html22:04
Wizzuplast change Date:   Wed Mar 4 14:54:30 2020 -080022:04
Wizzupgrepping for omap3_idle_driver only shows this file22:04
Wizzupand these are the only target_residency mentions22:04
Wizzupoh hmmmmm22:05
Wizzupomap3_idle_driver vs omap3430_idle_driver22:05
Wizzupok I see what I should change now22:05
Wizzupsorry for being slow22:06
uvosnp22:06
uvoswe are all slow sometimes22:06
lelMerlijnWajer assigned an issue: https://github.com/maemo-leste/bugtracker/issues/545 (N900: Try to hit OFF mode (low power consumption))22:17
Wizzupttps://github.com/maemo-leste/bugtracker/issues/545#issuecomment-980438141 posted some info here22:17
uvosTerrorist Tactics and ProcedureS?22:18
Wizzuphttps://github.com/maemo-leste/bugtracker/issues/54522:19
Wizzup^_^22:19
Wizzuptotally worth the 40 euro for this lab psu22:19
uvosheh22:19
Wizzuphttps://multi-com.eu/,details,id_pr,16969,key,laboratory-power-supply-powerlab-1502d-15v-2a-dc-led.html it's this I think22:20
Wizzupany ideas about the best way to load specific modules and do off mode tests?22:21
Wizzupto see which ones block idle22:21
WizzupI figured maybe I can make some script that one can set as init= that also sets up wifi and sshd, but I don't think I have job management in my bash shell currently22:22
uvosnot really22:23
uvosomap3430 having its own special cost table probubly has a reason btw22:23
uvosthere is likley some bug that causes it to take forever to restore from idle or some errata that wastes a buch of power on wakeup22:24
Wizzupmhm22:24
uvosie this numbers suggest something is broken hw wise22:25
Wizzupwell, what can we do :)22:25
uvosno idea, we need to quiet down the kernel timers22:25
WizzupI meant we cannot fix the hw22:25
Wizzupbut yeah I guess you mean lowering the timers doesn't necessarily help22:26
Wizzupmaybe tmlind was also onto something when he said maybe they overflow22:26
Wizzup# sleep 5; ./idle.sh22:49
WizzupST_MCSPI122:49
WizzupOFF:13,RET:122:49
sicelothat's beautiful sight :-)22:52
Wizzupdoesn't seem to matter much for power usage compared to ret though22:52
uvosprobubly the errata biteing22:53
uvosmaybe some value higher than what you have22:53
uvosbut lower than before would be better22:53
Wizzupit looks like kernel also just wakes up more than before perhaps22:54
Wizzupcausing it not to be hit22:54
uvosright yes thats true for sure22:54
uvosits very busy22:54
uvosincreably so compeard to the motorola kernel for instance22:54
Wizzupuvos: do you see that in powertop?23:13
uvosyeah23:31
Wizzuplooks like tsc2005 just outright blocks idle when probed23:31
Wizzuplol23:31
uvoswhats lol about that?23:31
uvosif it dosent support runtimepm23:32
Wizzupwell I think it does in some form23:32
Wizzupat least open/close do something23:32
Wizzupuvos: well it's mostly lol in the sense that it's the first module I probed23:35
Wizzupand it blocks idles right away23:35
uvosnot sure if suprising, ts on d4 also blocked idle at all times untill tmlind improved the driver23:36
uvosfixing various drivers is likely going to be the story of your life for a while :P23:36
Wizzupat least wifi does not block idle23:36
uvosthats something23:37
Wizzuphttps://github.com/maemo-leste/bugtracker/issues/545#issuecomment-980458784 keeping a list here23:57

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