libera/#maemo-leste/ Friday, 2021-12-17

bencohWizzup: gpio-keys misbehaving in OFF mode might (?) be an invalid pullup configuration issue10:05
bencohassuming it uses a different pin configuration for sleep modes (some chips do)10:05
siceloWizzup: yay @wl1251. you also had made nice writeup really :-)10:21
bencohWizzup: see TRM Chapter 7.4.4 Pad Functional Multiplexing, bit OFFPULLUDENABLE10:22
siceloare we going to handle CVE-2021-39685 in Leste kernels?10:22
Wizzupwe'll pull in latest 5.15-stable or so10:31
Wizzupbencoh: hm, could be the same for ssi-protocol then10:31
Wizzupbasically what I am seeing is that it wakes up every few seconds (gpio_keys), sends slider press/unpress, and then sleep again for a bit10:32
bencohWizzup: can you try devmem 0x480020de 16 ?10:43
bencohI'd like to compare the result with what I see on fremantle10:43
bencoh(spoiler: on fremantle OFF-related bits are all 0, meaning I was wrong)10:44
bencoh(I get 0x4114 for the records)10:46
Wizzupbencoh: just to check, you have devmem on fremantle?10:47
bencohWizzup: yeah10:50
Wizzupbencoh: you just compiled it in scratchbox or something10:51
Wizzup?10:51
bencohI don't think so10:51
bencohwait, where does it come from ....10:51
WizzupI need to read some regs for Tony as well, which is why I am asking10:51
bencohdpkg says not found10:51
bencohwth10:52
bencohalright lemme check my sb vm10:52
bencohaaah, symlink to /bin/busybox :)10:53
bencohyou just need busybox-power10:54
bencoh(I still think you should check 0x480020de on leste btw, just to make sure)10:54
sicelobencoh: i also got zeros the other day too, but then wondered if it wasn't just what Pali mentioned, that userspace isn't allowed to read them10:55
siceloin fremantle, that is10:55
Wizzupis it sane to just apt install busybox-power ?10:55
Wizzups/sane/safe/10:55
bencohsicelo: no, I get 0x4114; you just need to run it as root10:55
siceloah :-)10:56
bencohsicelo: also, unpowered components may return 0s or bus error, depending on the SoC10:56
bencohWizzup: I think so10:56
sicelowell i was doing it with sudo (but not the addresses you're checking. i was checking the ones from tony)10:56
Palisicelo: if userspace cannot read /dev/mem then process either segfault or open fails with EPERM10:56
bencoh(the n900 schematics are a blessing)10:57
Wizzupftr10:58
Wizzup# devmem 0x480020de10:58
WizzupIllegal instruction10:58
Wizzupdevmem 0x48004a0810:58
Wizzup0x0000000010:58
Wizzuptmlind: so 0x48004a08 seems to be 0x0000000010:59
bencohWizzup: devmem 0x480020de 1610:59
bencohotherwise it's unaligned :)11:00
Wizzupoh11:00
Wizzup# sleep 5 ; devmem 0x480020de 1611:00
Wizzup0x411411:00
bencohWizzup: on leste or fremantle?11:00
Wizzupfremantle11:00
WizzupI need to compile devmem on leste still11:00
bencohah, I was asking about leste :)11:00
bencohto compile it? can't you just install it?11:00
Wizzupyeah, ok, but I'm still just being happy that I can do this on fremantle since Tony asked about wrt bandgap11:00
Wizzupbencoh: from where?11:00
bencohmemdump11:01
bencohI think11:01
Wizzupmemdump - utility to dump memory contents to standard output11:01
bencohhmm, that's not devmem actually, but good enough I guess11:01
Wizzupomg, just running 'memdump' without args causes it to dump memory11:02
bencohhaha11:02
bencohyou can also try memtool if you prefer11:02
bencohmemtool md -w 0x480020de11:03
Wizzupit reads a pretty big region11:05
Wizzupmaybe adding +0x4 makes sense?11:06
Wizzup# memtool md -w 0x480020de+0x411:06
Wizzup480020de: 0114 010411:06
* bencoh headscratches11:07
bencohwhat's the +0x4 ?11:07
bencohah, bytes11:08
WizzupMemory regions can be specified in two different forms: START+SIZE11:08
bencohso it would be +0x211:08
Wizzup# memtool md -w 0x480020de+0x211:08
bencohlooks like it is 0x0114 anyway11:08
Wizzup480020de: 011411:08
bencohso different from fremantle11:08
bencohthe missing bit is the WAKEUP_EN flag11:08
bencohyou could try setting it, see if it stays there even after hitting OFF mode, and see if it makes a difference, I guess11:09
Wizzupevery time I start to think I understand how this works even a bit I get lost again11:10
Wizzupok, let me see where to set thatr11:10
Wizzupit looks that in dts it mostly goes in pinctrl11:10
bencohah, if you want to do it properly, then yes, it goes in one of the pinmuxes11:11
bencohthe gpio-keys node doesn't refer to any pinctrl yet11:11
Wizzupwhat is the non-proper way to do it?11:11
uvosjust write to the register with rwmem/devmem whatever11:11
bencohyeah11:13
Wizzupso in omap3-n900.dts gpio_keys refers to &gpio3, &gpio4, &gpio611:13
Wizzupthis pin doesn't fall in any of their regs11:14
bencohthe pinmux entry should look like that11:14
bencohOMAP3_CORE1_IOPAD(0x20de, WAKEUP_EN | INPUT_EN | PULL_UP | MUX_MODE4)11:14
bencohthe gpio-keys entry for the slider is keypad_slide11:14
bencohbut that part is fine11:14
bencohassuming gpio3 7 is indeed gpio_71, but I'm pretty sure it is, otherwise slider would never work11:15
Wizzupbut wait, why do you assume the problem is slider only?11:15
Wizzupwhat I see is that gpio_keys wakes up and fires *all* gpio_keys events11:15
Wizzupnot just slider, also camera button, etc11:15
bencohwait, what?11:16
Wizzupright.11:16
Wizzuplet me demonstrate11:16
Wizzupoh, this time the device just reset :)11:17
Wizzuphttps://dpaste.com/8LSHRGVT411:17
Wizzupnormalle the screen keeps going on and off after a few seconds11:17
bencohhm, I wonder why I assumed you were referring to slider back then11:17
Wizzupwell I did mention the slider earlier11:17
Wizzupmaybe that wasn't clear in the gpio keys context11:18
Wizzupbut the slider is the most visible part because it makes mce wake up the device/screen11:18
bencohah11:18
uvosyou can disable that with mce-lockgeneric if that makes testing idle easier11:19
Wizzupuvos: I mean sure but that's not really the problem here11:19
uvosright11:19
uvosbut the device waking up might make testing the problem itself harder11:19
uvossince it dosent off again then11:19
Wizzupit does turn off the display as well11:19
Wizzupsince this repeats every few seconds11:19
uvosok11:19
Wizzupbut sure just testing idle stuff I can just rmmod gpio_keys11:20
Wizzupbut something is quite wrong there I think11:20
uvosno doubt11:20
uvosbut setting the reg dosent fix it for gpio3 7?11:20
bencohWizzup: what do you get for memtool md -w 0x480020d8+0x4 on leste?11:21
Wizzupuvos: the device just reset11:21
Wizzupand they all fire at once11:21
WizzupI can try in a bit for sure11:21
Wizzupbencoh: with off mode not turned on, and gpio keys probed I guess?11:21
bencohWizzup: for a start yes11:22
Wizzupok, just a second, I need a coffee11:22
bencoh:)11:22
bencohdamn, I forgot how messy the pre-devicetree board drivers could be ...11:26
bencohhaving a look at arch/arm/mach-omap2/board-rx51* (fremantle kernel) ... it's awful11:26
Wizzupbencoh: do you have a git link for it?11:49
WizzupI don't know what the canonical place is11:49
bencohhmm, lemme check11:50
Wizzup# memtool md -w 0x480020d8+0x411:51
Wizzup480020d8: 0104 0104                                          ....11:51
bencohI get 4104 410411:53
bencohlooks like all gpio-keys are missing the WAKEUP_EN bit11:53
bencohto be honest I don't fully understand the TRM 7.4.4 chapter, nor the System Off mode subchapter11:54
bencoh(I only had a quick look thus far)11:54
bencohbut something tells me keeping the fremantle values might help11:55
bencohWizzup: https://vcs.maemo.org/git/kernel-power I think11:56
bencohthat's the latest kernel-power (Pali's fork of the fremantle kernel)11:57
Wizzuphttps://vcs.maemo.org/git/?p=kernel-power;a=shortlog11:57
Wizzupok11:57
bencoh(actually someone else started the fork, but P.ali eventually became the main maintainer/contributor :))12:00
Wizzupok, so I can write the memory with memtool mw12:02
Wizzupso should I write to all the addresses then?12:05
Wizzup(for all the gpio keys)12:05
bencohyou could try changing only one of those first12:06
bencohto see if it makes a difference12:06
Wizzupok, let me boot to a more minimal system in case some other subsystem causes resets12:06
Wizzuphm... interesting12:11
Wizzupso just enabling off mode is not the problem12:11
Wizzupthe problem starts occuring when I idle the serial devices12:12
Wizzup(which of course are what prevents it from entering off mode)12:12
bencoh?12:12
bencoh"the problem" being? the gpio-keys thing, or the device resetting?12:12
Wizzupgpio keys12:12
Wizzupand they wake up 'with' the serial12:12
bencohhmm ...12:14
Wizzupgetting the reg didn't help fwiw12:14
Wizzupmaybe the n900-pm script is too agressive in the sysfs stuff it changes perhaps12:14
bencoheverytime the device wakes from serial you get events in /dev/input ?12:14
Wizzupyes12:15
bencohwell, at least it should be a non-issue on production devices12:15
bencohthat's interesting though, and it might hint at some issue too :)12:15
Wizzupactually it is only three keys:12:16
WizzupKEY_SCREENLOCK, KEY_CAMERA_FOCUS, KEY_CAMERA12:16
Wizzupso that is &gpio312:17
Wizzuphuh, no, both12:17
Wizzup(3 and 4)12:17
Wizzupunrelated but debugging these resets is incredibly hard because to hit them we have to detach the kernel console from serial12:18
Wizzupso the crucial messages are basically always lost12:18
bencohyou can always check dmesg afterwards12:19
Wizzupthat doesn't help when it has reset :)12:19
bencoh?12:19
bencohah, *reset*12:19
Wizzupyeah12:19
bencohnevermind12:19
Wizzuplike, hard device resets12:19
bencohdon't we have that ... pmem thing (was it pmem?) on n900?12:20
Wizzupramoops/pstore alike?12:23
Wizzupbencoh: btw I got it wrong, it also happens sometimes when I don't type in serial12:24
Wizzupsorry, finding this stuff out as I go along :)12:24
Wizzupit could be some other wakeup that causes it to leave OFF mode for a bit though12:24
bencohcould be ...12:26
bencohI guess we should really read those OFF mode chapters ...12:26
Wizzupmhm12:29
Wizzuprmmod gpio_keys also causes device not to idle again12:29
Wizzupprobing it again helps12:30
bencohthat's ... interesting13:04
Wizzupprobably some things aren't deinitialised properly or something13:05
Wizzupfreemangordon: hm I got this for xorgproto:18:09
WizzupMaking all in bigreqsproto18:09
Wizzupmake[3]: Entering directory '/mnt/merlijn/maemo-leste/xorgproto/build/specs/bigreqsproto'18:09
Wizzupmake[3]: *** No rule to make target 'bigreq.xml', needed by 'all-am'.  Stop.18:09
Wizzupthere are nothing but makefiles hm..18:13
Wizzupmust be one of the weird debian things again18:14
Wizzuptruly breaks the brain18:17
Wizzupfreemangordon: I guess you also got libxi ?18:21
Wizzupfreemangordon: really wonder how you did this18:38
WizzupI had to pull in xorgproto, libxi, and now I need this weird libxcvt which wants debhelper-compat = 1318:38
Wizzupwhich we don't have18:39
Wizzupmaybe this is a xwayland only dep?18:40
Wizzupthe debian/ I have already drops xwayland, so I'm not sure waht is up18:40
WizzupI downloaded it from debian unstable and now it built at least18:50
Wizzuplol, great ... I built everything for armhf18:55
Wizzupand pine64 is arm64 of course18:55
Wizzup*flips table*18:56
freemangordonsorry, being busy19:16
freemangordonand sill am19:16
freemangordon*still19:16
WizzupI figured it out I think19:17
Wizzupalthough I don't know how we will do this in CI19:17
uvosupdating x properly is a lot of work since the api levels also chainged so xf86-* modules also must be rebuilt19:31
Wizzuplet's see19:36
uvoshttps://gitlab.freedesktop.org/xorg/xserver/-/commit/7759743c6387f72faa9eb8602ea3f2777c0e0d1719:37
uvoshttps://gitlab.freedesktop.org/xorg/xserver/-/commit/0886254f96f40e59193ccbb0e3acbd5ae92dbaa319:37
Wizzupnot a problem though19:38
Wizzupalso the xrandr stuff is np for modesetting19:38
uvosit bumps the abi version19:38
uvosso you have to rebuild video-* plugins19:39
uvosexcept modesetting ofc19:39
Wizzupuvos: yeah we only use modesetting on pp19:41
uvoswell if you want to update x in tge repo you have to rebuild all plugins19:42
Wizzupsure19:42
Wizzupif it doesn't make glamor better, I won't19:42
Wizzupuvos: looks like the same problems20:16
Wizzupmaybe it's time to force the gles/egl path20:16
Wizzupactually it does feel better20:29
Wizzupit happens only once on boot now it looks like20:36
Wizzupuvos: does pp need a change to rotate h-d somehow? monitor-sensor picks it up20:38
Wizzupbut it doesn't rotate20:38
Wizzupiio-accelerometer is loaded I think20:39
Wizzupmatrix is 90 degrees off20:44
Wizzuphm monitor-sensor is correct20:46
Wizzupit's really nice and fast in portrait mode :)20:49
uvosWizzup: monitor sensor should have Normal as landscape21:39
uvosand left up as protrait21:39
Wizzupuvos: hm, then it is wrong21:58
Wizzupuvos: so 'normal' is currently reported when I hold it in portrait21:59
uvosright21:59
uvosso parazyd did this21:59
Wizzupand 'left-up' for landscape22:00
uvosit worked at some point, maybe the kernel changed22:00
uvoshttps://github.com/maemo-leste/leste-config/blob/master/leste-config-pinephone/lib/udev/rules.d/50-iio-sensors.rules.leste22:00
WizzupSUBSYSTEM=="iio", ENV{OF_NAME}=="mpu6050", ENV{ACCEL_MOUNT_MATRIX}="1, 0, 0; 0, 1, 0; 0, 0, 1"22:01
Wizzupthis doesn't seem like it is touchscreen matrix22:01
Wizzupcomment might be wrong there22:01
Wizzupright?22:01
uvosoh yeah22:01
uvosthe comment is wrong22:02
Wizzupmpu6050 is accelerometer22:02
WizzupOF_FULLNAME=/soc/i2c@1c2b000/accelerometer@6822:02
WizzupOF_COMPATIBLE_0=invensense,mpu605022:02
Wizzup# cat in_accel_mount_matrix22:03
Wizzup0, 1, 0; -1, 0, 0; 0, 0, -122:03
Wizzuphm, it sure has a lot of matrices22:03
Wizzupuvos: I don't see any changes in leste-config recently22:07
uvosso in_accel_mount_matrix comes from kernel22:07
uvosthis is wrong (for us) we dont want iio-s-p to use it22:07
uvosso we override it with the udev rule22:08
uvosnow the rule is not applieing or the axies changed in the driver (unlikely)22:08
uvosso plase checkout the udev entry22:08
uvosso is the matrix applied to the right device?22:16
uvosudevadm info `readlink -f /sys/bus/iio/devices/iio\:device3`22:17
uvosreplace device3 with whatever is the acell on pp ofc22:17
WizzupI think it might not be yeah22:20
Wizzuphttps://dpaste.com/BES85Y4AZ22:21
WizzupE: OF_NAME=accelerometer22:22
Wizzupso it doesn't match22:22
uvosright so someone changed dts22:23
Wizzupok I have a fix22:23
Wizzupwill make sure it's in sync with kernel22:23
Wizzupbtw it's really smooth in portrait22:23
uvosto bad hildon is ergonomically terrible in protrait22:25
Wizzupso new X seems better22:40
WizzupI only see the keyboard now being draw correctly once22:40
Wizzupper orientation22:40
Wizzupon pp22:40
uvoswith gl or gles22:42
uvos?22:42
Wizzupgl22:44
WizzupI didn't try the gles part yet22:44
Wizzupthat's next22:45
Wizzuphmm let me try another build tomorrow23:02
Wizzuplol I was building 1.20 :-)23:03
Wizzupman23:03
WizzupI guess that's good news23:04
Wizzupthe dpi is messed up23:44

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