libera/#maemo-leste/ Sunday, 2024-12-15

freemangordonWizzup: ok :)10:55
Wizzup:D10:59
mkfzhello15:18
mkfzthere is a store nearby me which sells n900 phones15:18
mkfzthese are however locked, can I buy them and get rid of password?15:19
inkyi think you just reflash15:47
mkfzis there anything I need to consider or check before I buy?15:51
sicelomodem works, usb port works15:56
tmlindfreemangordon: maybe ofono can directly access the gsm dlcs on /dev/ttyS0, see g_at_mux_new_gsm0710_basic()16:12
Wizzupmkfz: I think just modem and usb yeah, lock should not be a problem16:41
freemangordontmlind: the question was - can kernel do something in a way that there is no need of served_ngsm16:55
freemangordonofono does not need anything tty now it uses qmi16:56
freemangordonso, can snd soc or phy driver open /dev/ttyS0 and set line discipline on it16:57
freemangordon*serdev_ngsm  that is16:57
freemangordonor, upstreaming serdev_ngsm is the only proper way16:59
tmlindwell the uart wakeups do not matter much any longer with usb qmi working if it's just the audio17:28
tmlindafaik serdev is the way to build serial port device drivers, otherwise it would have to be user space17:29
freemangordonok, but can;t we do the same in kernel as in userspace:17:29
freemangordonopen ttyS0, set line discipline to n_gsm, etc17:29
freemangordonI don;t think we shall drop support for uart wakeups, but would prefer if we can get away without upstreaming serdev_ngsm, given that I am not sure I'll manager to upstream it17:34
freemangordon*manage17:34
tmlindyeah it's a pain to fix up for upstreaming..17:35
freemangordonso, I saw at least 2 drivers that open tty devices, in upstream17:35
tmlindso if ofono handled it, we still need to coordinate with the asoc driver with daemon i think sicelo mentioned earlier17:35
freemangordonhmm, I missed that17:36
tmlindi doubt a sound driver doing tty_set_ldisc() would be liked much..17:36
freemangordonno, that would be the phy17:36
tmlindphy?17:37
freemangordonyeah, why not?17:37
freemangordonI mean: phy will set line discipline on ttyS017:37
tmlindwell it's the opening of the ports part still that's going to be messy17:37
freemangordonand than soc will open ttyGSM2 (or whatever is the correct tty for audio contol)17:37
freemangordon*and then17:38
tmlindmuch cleaner if ofono sets the voice call volume with some daemon coordinating the asoc settings imo :)17:38
Wizzupmight be worth to see what asoc folks think17:39
tmlindsure17:39
freemangordonthis is out of my knowledge17:39
Wizzupif it's in alsa then it'll be easier for the rest of userspace17:39
freemangordonlemme find what upstream does ATM in terms of opening tty devices17:40
tmlindthen it makes sense to implement it with serdev and we've seen that it goes nowhere17:40
freemangordonthis https://elixir.bootlin.com/linux/v6.12.5/source/drivers/leds/trigger/ledtrig-tty.c#L22217:41
freemangordonand https://elixir.bootlin.com/linux/v6.12.5/source/drivers/accessibility/speakup/spk_ttyio.c#L15417:42
freemangordonwhy would not we do something similar?17:42
tmlindwell i think the idea of serdev is to deal with that kind of stuff using a generic layer17:43
freemangordonsure, that's clear, but upstream does not seem happy with it17:44
freemangordonor, do they expect anything else to happen?17:44
tmlindit's just too much to deal with at least for me17:45
tmlindinfinite bugs and changes needed17:45
freemangordonImagine how would I be in that situation, given your experience with kernel ;)17:46
tmlindsicelo: what was the audio daemon helper thingy you mentioned earlier?17:46
tmlindwell the n_gsm is in a better shape now after siemens has been patching it, but still feels like a big mess17:47
freemangordonright, but we have fixes fro it too17:48
freemangordonI will send17:48
tmlindok17:48
freemangordonhowever, do you know what is needed for seredev to go upstream?17:48
freemangordon*serdev17:48
freemangordonI saw series v5 was sent, and then nothing, perhaps I missed it17:49
tmlindjohan had a bunch of good comments on it if you search on lore17:49
tmlindchanging the functions to be more serdev like was one, then moving stuff around17:50
tmlindi think he suggested that the dlcis are treated as serdev subdevices or something like that17:50
tmlindanyways, i feel it's a waste of time if we don't need it for anything beyond setting voice call volume and mute17:51
freemangordonans switching streams17:51
freemangordon*and17:51
tmlindno, that's in the asoc driver for the mcbsp17:51
tmlindi think also the bluetooth would be just an asoc driver still17:52
freemangordonno, I think voice strams swithing is done through modem17:52
freemangordon*streams17:52
tmlindoh right to set it to be the master17:52
freemangordon  p, li { white-space: pre-wrap; }  AT+EACC17:52
freemangordonthis is still needed IIUC17:53
tmlindyeah17:53
freemangordonso this, noise cancellation, mute and volume17:54
tmlindyup17:54
freemangordonI think this is better done on alsa17:54
freemangordondid you have a look at the links I pasted ^^^17:54
freemangordonupstream drivers opening ttys17:55
tmlindvery old drivers though?17:55
freemangordonno idea17:55
freemangordonlemme check17:55
freemangordonnot really17:56
freemangordonWed Jan 13 18:30:18 202117:56
freemangordonfd4a641ac88fbbaf8b90e00823397597a287cfcd17:56
tmlindok17:57
tmlindso did you get the gps stuff working over usb qmi?17:57
freemangordonyes17:57
freemangordonat least you and sicelo said that data looks like gps data :)17:58
tmlindthen if we can claim that no other drivers need to use ttyS0 it might be justified..17:58
freemangordonumm, but we'll expose ttyGSMn to userspace17:58
tmlindyou should test outside or near a window and see if you get a gps fix after 10 to 20 minutes17:58
freemangordonso GPS tty will still be accessible17:59
tmlindhmm so how would drivers/gnss access it?17:59
freemangordontty_open_shared?17:59
freemangordonI am not sure what gnss diver is doing ATM, honestly18:00
tmlindhmm ok so maybe that would work18:00
tmlindit's custom at commands on a separate dlci18:00
tmlindso your plan is to have the phy driver set up the line discipline, then have drivers do tty_open_shared()?18:01
freemangordonyes18:01
freemangordonwell.. plan18:01
freemangordonidea18:01
tmlindworth a test imo, that would leave out all the serdev ngsm hassles18:01
freemangordonmhm18:01
freemangordoneven if upstream reject it, that will be way easier to maintain too18:02
freemangordonas out-of-tree patch18:02
tmlindyeah for sure18:02
freemangordonand for gps I think we shall use ofono either ways18:02
freemangordonbecause qmi works most of devices we care, besides n90018:03
freemangordonI have no idea if gps works with leste on n90018:03
tmlindi guess ofono could create some socket for gpsd to use18:04
freemangordonthat's what it does, provides fd to read from18:04
freemangordonand you read18:04
tmlindok great18:04
freemangordonnmea data18:04
tmlindso gpsd can already use it?18:05
freemangordonhttps://git.kernel.org/pub/scm/network/ofono/ofono.git/tree/doc/location-reporting-api.txt18:05
freemangordonin theory18:05
tmlindcool18:05
freemangordonI guess we'll have to fix some bugs in ofono(I already have a patch to send) but those are details18:06
freemangordonand Denis seems very nice and cooperative guy18:06
freemangordonhe accepts patches almost instantly18:06
tmlindyup that's great18:06
freemangordonmhm18:07
freemangordonok, se the plan is: I will try to make snd soc stuff work without serdev_ngsm18:07
freemangordonwill report once I have result :)18:07
tmlindthere should be a way to enable gps on ttyUSB0, 1, 2, 3 btw, probably just some nvram setting but unknown18:07
freemangordonttyUSB4 accept +CMUX=018:08
tmlindbut does it switch to gsm mode?18:08
freemangordonyes18:08
freemangordonI tried18:08
tmlindoh ok18:08
freemangordonusing cmux (or some other tool, lemme try to re-find it)18:08
tmlindif you get it to gsm mode, dlci7 can be used to echo back what you write, at least on ttyS018:09
freemangordonhttps://github.com/Rtone/cmux18:09
freemangordonhad to change init sequence a bit, but....18:09
freemangordonand then I got this ULXXX headers18:10
freemangordonor DL, whatever18:10
tmlindi also made some userspace gsm tool before i went with the serdev stuff because of the wake-up events needed18:10
freemangordonthe proprietary motorola framing18:10
tmlindah right18:10
freemangordonwell, I don;t see why shall we drop wake-ups18:11
tmlindyou can ignore the motorola header and start all writes with U123418:11
freemangordonmy gut feeling tells me that without them wi might have stability issues in long run18:11
freemangordon*we18:11
tmlindwell the wakeups are now implemented in the phy driver18:11
freemangordonlike, overfilling some modem internal buffer/queue18:11
freemangordonright18:12
tmlindif your audio device driver is a child of the phy, it will wake up the parent phy driver with pm_runtime_get()18:12
freemangordonmhm18:12
freemangordonI understand that18:12
tmlindok18:13
freemangordonI think I will keep the current DT structure initially, DT is not my strongest skill18:13
tmlindthe phy driver needs to just call of_platform_populate() to probe the child devices18:14
freemangordonok, thanks18:14
tmlindhmm the nice thing is that the phy driver knows when the modem is there and the gsm stuff is working18:15
tmlindin flash mode, it's not in gsm mode18:15
freemangordonmhm18:16
freemangordonand I can return EPROBE_DEFER until I can open the gsm ttys (from snd soc driver), right?18:16
tmlindwell the phy driver can call of_platform_populate() only after the modem is powered up18:17
tmlindand remove the child devices on shutdown18:17
freemangordonok, but will ttyGSMn devices appear instantly?18:18
tmlindno, it takes some time, see the 8 second or so wait in the phy driver18:18
freemangordonmhm, so, I can return EPROBE_DEFER in snd soc driver until the is tty device to open, isn't that proper?18:19
freemangordon*there is18:19
tmlindno need to, the snd soc driver won't probe until you call of_platform_populate()18:19
tmlindi think you can call that after the request threaded irq in the phy driver18:20
tmlindthat's when the completion is done18:20
freemangordonok18:22
freemangordonthanks!18:22
freemangordonhave to cook some dinner, laters18:23
tmlindi think one of the reasons for serdev was that there's no way to tell if something is connected to a uart without devicetree, with your solution that issue is not there as the phy driver knows when the line discipline can be started18:23
tmlindok ttyl18:23
freemangordonmhm18:23
freemangordonttyl18:23
freemangordontmlind: why serdev_ngsm does runtime PM of USB phy? is that really needed now with USB wakeup?19:46
sicelobtw, in brief, what's the relationship between the uart/serial stuff and audio?19:48
freemangordonvoice call volume/mute/noise cancellation is done with commands over serial19:49
freemangordonalso, switching between BT/Headset, ...19:49
freemangordontmlind: scratch that, it needs to wake the modem19:50
tmlindfreemangordon: probably the wake pin kicking is needed for gsm19:50
freemangordonyeah19:50
freemangordonhmm, I can;t have 2 platform drivers in on e module, right?19:51
tmlindfreemangordon: so what's the AT+CMUX=0 init sequence you used for ttyUSB4? i can try it briefly with my debug tool too19:51
freemangordonsec19:51
tmlindyou can have the asoc driver and others as completely separate drivers like we have with serdev ngsm19:52
freemangordonyes, but serial platform driver?19:52
tmlindhmm not sure what you mean..19:52
freemangordonI should have it as a separate platform driver too, no?19:52
tmlindwhat's the serial platform driver?19:53
freemangordonnow we have   p, li { white-space: pre-wrap; }  "motorola,mapphone-mdm6600-serial"19:53
freemangordonthat one19:53
freemangordonthat's a DT child of   uart119:53
tmlindoh i don't think it's needed now19:53
tmlindthat was the glue between serdev ngsm and the dlci19:53
freemangordonright19:53
freemangordonbut...19:54
freemangordonisn;t it beter some platform driver to be probed when uart1 appears?19:54
freemangordonor ther is no need19:54
tmlindno need to if you probe the child device drivers when the modem is ready19:54
freemangordonand I just wait long enough in phy driver and just open the tty?19:54
freemangordonok19:55
tmlindyeah open if after the request_threaded_irq() when the completion is completed19:55
tmlindin the phy driver19:55
freemangordonyeah, but, is it guaranteed that uart1 will be ready by that time?19:55
tmlindshould be yeah19:55
freemangordonok19:55
tmlindunless booted to flash_mode19:55
freemangordonso, this https://github.com/Rtone/cmux19:56
freemangordonyeah, but phy driver knows the mode19:56
tmlindright :)19:56
tmlindso you just changed the cmux init sequence and pointed it to /dev/ttyUSB4?19:56
freemangordonyep19:56
freemangordonthis patch https://pastebin.com/REhpYu7p19:56
freemangordonthis creates 4 ports, no idea why 4, but...19:57
freemangordonoh19:57
tmlindok no luck so far here with patched https://github.com/tmlind/droid4-ngsm19:57
freemangordon#define NUM_NODES419:57
freemangordondo you want me to execute some copmands?19:58
freemangordon*commands19:58
tmlindno need to, was just wondering19:59
freemangordonhmm, it always errors with U1234:ERROR=2, no matter what I type20:02
tmlindtry format UNNNNAT+FOO\r\020:03
freemangordonmhm20:04
freemangordondoes not like it20:04
tmlindmay not be wired to anything?20:04
freemangordon2 and 4 cannot be opened20:04
freemangordonso I guess those are not wired20:04
freemangordonbut 1 and 3 I can open20:05
freemangordon1 errors with U123420:05
freemangordon3 errors with U000020:05
freemangordonmaybe cmux sets wring parameters, lemme check20:05
tmlindok sounds like something is connected20:08
freemangordonyes, but what :)20:08
freemangordontmlind: opening /dev/gsmtty1 gives the same result20:14
freemangordonas opening /dev/ttyGSM120:14
freemangordonwith minicom that is20:14
freemangordon9 was sim card, right? (/me checks ofono)20:14
freemangordonno, it is 1020:16
freemangordontmlind: those are 1to1 mapped to gsmttyN ports20:29
freemangordon./ttyngsm.sh 10 AT+MSIM=? over /dev/ttyGSM10 return SIM card details20:29
freemangordonthis patch https://pastebin.com/gACm7i4w over cmux20:30
freemangordonscript https://pastebin.com/U1LAVyG920:31
tmlindok nice to hear20:35
freemangordontmlind: hmm, am I sure uart1 tty is always ttyS0?20:39
tmlindheh you could use the new hardware based addressing.. except the nodes are not yet created20:45
freemangordonI think I shall keep serial platform driver20:45
freemangordonand do of_platform_populate from there20:46
tmlind17199dfccd4b ("Documentation: kernel-parameters: Add DEVNAME:0.0 format for serial ports")20:46
freemangordonalso AT+CMUX=0 shall be done from here20:46
freemangordonthat way I avoid having to deal with device naming20:47
freemangordonalso, I get tty port from parent device, no?20:47
freemangordonlets se20:47
freemangordona20:47
freemangordonsee20:47
freemangordontmlind: can I do of_get_parent() from serial platform driver to get uart device directly?20:59
tmlindnot following.. from which driver are you trying to do that from?21:04
freemangordon"motorola,mapphone-mdm6600-serial"21:05
freemangordonI want to keep that21:05
tmlindoh ok21:05
freemangordonand call AT+CMUX=0 from its probe()21:06
tmlindso is that child of the phy now?21:06
freemangordonno, I am keeping the same DT21:06
freemangordonit is child of uart21:06
freemangordonso I can get uart driver_node21:07
tmlindif it's a child of the uart, likely it would need to be a serdev driver21:07
freemangordonI can do of_get_parent() right?21:08
tmlindyeah or dev->parent21:08
freemangordonnot sure how to get serdev device from that21:08
freemangordonwill try though21:08
tmlindjust set up "motorola,mapphone-mdm6600-serial" as a direct serdev device for the uart21:09
freemangordonhmm, ok21:09
tmlindthen start the gsm line discipline, and n_gsm.c will create the /dev/gsmtty instances21:10
freemangordonmhm21:10
tmlindi think it needs to be a child of /dev/ttyS0 though, can't use /dev/ttyUSB421:10
freemangordonyes21:10
tmlindok21:10
freemangordonI want to use serial, not usb21:10
tmlindyeah21:10
tmlindno special need to use the ttyUSB421:11
freemangordonexactly21:11
freemangordonhmm, can't find anything 'serdev'  related21:11
tmlindgit grep EXPORT drivers/tty/serdev/21:12
freemangordonhmm...21:13
tmlindthe serdev device won't have the tty created, i wonder if that's going to cause an issue starting the line discipline21:13
tmlindfor an example on d4, see drivers/bluetooth/hci_ll.c21:15
freemangordonso,   serdev_device_driver_register() instead of platfrom device?21:17
freemangordonsorry, not following21:18
tmlindyeah serdev_device_driver_register()21:19
tmlindgrep for ti,wl1285-st for the hci_ll.c example dts21:19
tmlindwhen you configure a uart for a serdev device, it won't have the tty created for /dev/ttyS021:20
freemangordonI was thinking about something else: instead of creating serdev, isn't it possible to get uart device (being parent in DT) and then using it to find port device and tty respectively?21:20
tmlindright but with serdev you get quite a bit of stuff automated for you21:21
tmlindyou just do serdev_write() for AT+CMUX=021:21
freemangordonbut then, who will set line discipline on the port?21:22
tmlindcan't remember the name of the function, something else not serdev_write()21:22
freemangordonwrite_wkup() or something21:22
tmlindheh yeah setting the line discipline part is a bit open :)21:22
freemangordonso, I will need parent port tty device either ways21:23
tmlinddo you need a struct tty for that?21:23
freemangordonmhm21:23
freemangordonlemme try to find the code21:23
freemangordonint tty_set_ldisc(struct tty_struct *tty, int disc)21:24
freemangordonso I need struct tty21:24
tmlindhmm21:24
tmlindwell drivers/bluetooth is setting the line discpline somehow for the wlcore bluetooth example i pasted above21:25
freemangordonlemme check it21:26
tmlindi guess must be in drivers/bluetooth/hci_serdev.c21:27
tmlindas it replaces drivers/bluetooth/hci_ldisc.c for serdev devices i think21:29
tmlindhmm actually i think serdev hci does it without line discpiline21:30
freemangordonmhm21:30
freemangordonthat's what I think too21:31
freemangordonmaybe we can call n_gsm functions directly?21:31
freemangordonif they are exported at all21:31
tmlindheh so back to serdev-ngsm?21:31
freemangordonbut without need to upstream another driver :)21:31
freemangordonlemme see if n_gsm exports any API21:32
tmlindi added some patch to export the registering in the serdev-ngsm patches21:32
freemangordonmhm21:32
freemangordonI will look upstream21:32
tmlindi think johan had some idea to make the dlci instances to use serdev too but that might get messy21:33
freemangordonnope, nothing is exported from n_gsm21:35
tmlindright21:35
freemangordonok, lets get back to my initial plan21:35
freemangordonI just need to  find the way to get from uart device_node to uart_port or something21:35
freemangordonwe have kobject in device_node, is that useful for anything?21:36
tmlind&of->dev ?21:37
freemangordonlemme check21:37
tmlindgotta go here, have fun, ttyl21:39
freemangordonttyl21:39
freemangordonthanks!21:39
freemangordonhmm, of_find_device_by_node()21:41

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