ChanServ changed the topic of #linux-msm to:
marvin24 has joined #linux-msm
marvin24_ has quit [Ping timeout: 480 seconds]
<jstultz> bamse: hey! how's it going? was curious: I noticed db845c is still coming up with a random wifi mac each boot. I know you had a solution long ago, but I can't remember the details
<jstultz> I feel like we had some serialno based calculation to come up with a unique but consistent mac
<bamse> jstultz: hey, nice to see you around again :)
<bamse> jstultz: i don't remember having something for wifi, i did the ethernet mac address stuff
<jstultz> bamse: oh, maybe that was it..
<jstultz> bamse: i feel like we had something for wifi too, but maybe that was an android userland thing..
<bamse> jstultz: that might be the case
<bamse> jstultz: i believe the downstream solution relies on some files written in the factory and some userspace tooling to configure the interface on every boot...
<jstultz> bamse: i also had a work wifi router that was inbetween my regular network previously, and i'm really only noticing now because my main router is yelling that new devices are connecting to my wifi all the time :) so maybe it was the same before, I just didn't notice it
<bamse> yeah, that's definitely annoying
<bamse> or the fact that your ssh known_hosts fills up with all these random devices
<jstultz> bamse: i'll check in with pundir to see if he recalls. (luckily i don't have to ssh to the device)
<jstultz> bamse: not having my decade old inbox to search for these details is exposing how bad my memory is
<Mis012[m]> jstultz: I think the "cleaner" way to do this is to have the bootloader put the mac address in the device tree
<Mis012[m]> and I believe there was some emmc serial number calculation for when you don't want to fetch the magic file
<jstultz> Mis012[m]: no doubt - though with the number of different ways dtbs are managed, having that work consistently may be tough
<Mis012[m]> well, the bootloader is already responsible for adding stuff to `chosen` for example
<jstultz> Mis012[m]: ok, maybe its simpler then I'm thinking..
<jstultz> Mis012[m]: does that work for appended dtbs? I thought the loading there was all kernel based.. but I'm probably wrong.
<Mis012[m]> well... there is an option for arm (not 64) to do it without bootloader
<Mis012[m]> since some old arm devices never got bootloaders which know what a device tree is
<Mis012[m]> but on aarch64, it's always handled by the bootloader
<jstultz> Mis012[m]: ah, I'm confusing it.. cool, that's good to know.
<Mis012[m]> minecrell implemented this in lk2nd iirc
pevik has joined #linux-msm
<minecrell> Mis012[m]: no, this was some patch someone at Linaro made for the db410c LK actually
<Mis012[m]> speaking about bad memory :P
jhovold has joined #linux-msm
qyousef has quit [Ping timeout: 480 seconds]
Souradeep has quit [Quit: The Lounge - https://thelounge.chat]
rnayak has quit [Quit: The Lounge - https://thelounge.chat]
sibis has quit [Quit: The Lounge - https://thelounge.chat]
<Mis012[m]> konradybcio: ok, so it gets further before a random reboot...?
<pundir> jstultz: we did that for ethernet https://r.android.com/1293841
pevik has quit [Ping timeout: 480 seconds]
<konradybcio> Mis012: interesting, do you have watchdog in your dt?
<Mis012[m]> u-boot dt or Linux dt? I have never seen an enabled watchdog on a qcom SoC
<konradybcio> Linux
<Mis012[m]> also, a while(1) in u-boot doesn't get watchdogged
<konradybcio> Shouldn't hurt to try?
<konradybcio> Also try maxcpus=1
<Mis012[m]> I should really find a better way to update the kernel than reflashing the almost 2GB partition with a firehose...
<Mis012[m]> otherwise that sdcard will be ded soon
<sepkov[m]> Mis012[m]: Just flash boot
<sepkov[m]> That's how I do when I make changes to kernel
<Mis012[m]> I have kernel on ext2 :P
<sepkov[m]> You're not flashing boot to device?
<Mis012[m]> to sdcard
<Mis012[m]> because no sdcard slot on laptop
<sepkov[m]> Which device is it pardon me?
<Mis012[m]> fxtec with 8998
<Mis012[m]> mostly unfused <3
<sepkov[m]> Wow
<sepkov[m]> I didn't know such a thing existed
<Mis012[m]> well... it's pretty rare nowadays
<Mis012[m]> they do it on purpose, as opposed to unfused 8916 devices :P
<sepkov[m]> Where do they sell it?
<Mis012[m]> qcom is trying really hard to make sure accidents don't happen, probably related to scum like aleph
<Mis012[m]> sepkov: they don't exactly sell it, but they'll be selling a version with sdm632 or something like that
<Mis012[m]> should also be unfused
<sepkov[m]> Got it thanks
<Mis012[m]> they were approached by some joke of hardened android ROM, telling them to fuse it
<Mis012[m]> thankfully they were told to fuck off iirc
<Mis012[m]> sepkov: to cool down your expectations, it probably won't ship with u-boot instead of eewefi :P
<sepkov[m]> They'll make us make our own device at the end
<sepkov[m]> Why do you lock a processor and effectively create a electronic junk after couple of years
<sepkov[m]> All for money
<Mis012[m]> well... qcom loves security
<Mis012[m]> but they don't really get that they're doing it wrong
<Mis012[m]> and even the OEMs who don't care are pressured by qcom to use all of their fancy security features
<Mis012[m]> as I said, might have something to do with aleph security scum
<Mis012[m]> also known as "intended features are now CVEs"
<Mis012[m]> sepkov: aleph actually pressured oneplus to retroactively fuse deployed secureboot off devices
<Mis012[m]> because apparetnly secure boot off is a CVE
<Mis012[m]> konradybcio: ๐Ÿ˜ญ
<sepkov[m]> Mis012[m]: What?!!?!??
<sepkov[m]> Well
<sepkov[m]> Mayyyybe
<Mis012[m]> CVE should mean vulnerability in code
<Mis012[m]> for aleph, CVE means "signed firehose which runs at EL3 has peek&poke enabled"
<Mis012[m]> for exampe
<Mis012[m]> *example
<Mis012[m]> that feature is intended to work that way...
<Mis012[m]> might or might not be why we got XBL_SEC
<Mis012[m]> konradybcio: ok, so no dog-adjacent nodes in msm8998* dts/i files
<konradybcio> There should be one
<Mis012[m]> looks like downstream to me -_-
<Mis012[m]> that seems like it's for enabling the watchdog
pespin has joined #linux-msm
Daanct12 has joined #linux-msm
<Mis012[m]> konradybcio: how possible is it that https://gitlab.com/Codeaurora/abl_tianocore_edk2/-/blob/LA.UM.5.1_rb1.4/ArmPkg/Application/LinuxLoader/AArch64/LinuxStarter.c#L295 is being used for the misbehaving cores?
<Mis012[m]> konradybcio: seems qcom,msm-watchdog is not a thing in mainline?
<Mis012[m]> unless it's called differently
<Mis012[m]> qcom,msm-watchdog doesn't match even a single time in mainline tree
<alexeymin> there is kpss-wdt thing
pespin has quit []
pespin has joined #linux-msm
<Mis012[m]> I'm starting to get morbidly curious as to whether you can load LinuxLoader.efi with u-boot xD
<Mis012[m]> would probably want to try that with working simplefb
<konradybcio> Kpss wdt
<Mis012[m]> konradybcio: yeah, alexeymin pointed me to that
<Mis012[m]> seems to be the equivalent
<Mis012[m]> well, ๐Ÿคž
<konradybcio> <Mis012[m]> "konradybcio: how possible is..." <- Unlikely, psci is in tz
<konradybcio> Mis012[m]: I'm in class so im not up with chat history heh
<Mis012[m]> well, yes, but PSCI doesn't work on half the cores
<Mis012[m]> and spin tables are supported in mainline ;)
<Mis012[m]> ๐Ÿ˜ญ
<Mis012[m]> konradybcio: any other ideas?
<konradybcio> Hmm, try disabling gcc
<konradybcio> And rpmcc
<Mis012[m]> sounds like something that will break a lot of stuff
<Mis012[m]> but why not try :P
qyousef has joined #linux-msm
<Mis012[m]> konradybcio: noice
<Mis012[m]> and no reboot
<konradybcio> Ok, now restore rpmcc
<Mis012[m]> hehe, right back to not working
<konradybcio> Ok
<konradybcio> Try gcc without rpmcc
<Mis012[m]> on it
<konradybcio> Make sure you have xo_board and not rpm xo though
<konradybcio> In clocks = in dts
<konradybcio> Under gcc:
<Mis012[m]> <&rpmcc RPM_SMD_XO_CLK_SRC> is only used for stuff that I don't care about right now :P
<Mis012[m]> poor sdcard...
<Mis012[m]> writing almost it's full capacity instead of just the file
<Mis012[m]> ext2 write support in firehose wen
<Mis012[m]> konradybcio: aaand it works \o/
<Mis012[m]> nice
<Mis012[m]> thx
<Mis012[m]> now onto figuring out why rpmcc causes trouble
<Mis012[m]> looks like regulators work
<Mis012[m]> I wonder if it also printed `irq: type mismatch` before
<konradybcio> Now debug rpmcc
<konradybcio> Knock off clocks
<konradybcio> I suspect qdss
<Mis012[m]> does eewEFI initialize qdss? ๐Ÿคจ
<Mis012[m]> also qdss clocks have hw voting
<Mis012[m]> riiight?
<konradybcio> Perhaps?
<konradybcio> Remember rpm is just an abstraction layer
<Mis012[m]> which wouldn't need to exist if more things had hw voting :P
<Mis012[m]> this is one
<Mis012[m]> (there are other vote registers for other CPUs)
<Mis012[m]> and two more spares for some reason
<Mis012[m]> and this
<Mis012[m]> guess the other qdss clocks don't have hw voting?
<konradybcio> So uh did you try nuking it and probing rpmcc?
Daanct12 has quit [Remote host closed the connection]
Daanct12 has joined #linux-msm
<Mis012[m]> I was thinking about where to nuke it and then I got distracted
<Mis012[m]> I assume this isn't NULLable?
<Mis012[m]> for (i = 0; i < num_clks; i++) {
<Mis012[m]> if (!rpm_smd_clks[i])
<Mis012[m]> continue;
<Mis012[m]> hehe, it is
Daanct12 has quit [Quit: Leaving]
<konradybcio> You can just // it
<Mis012[m]> removing RPM_SMD_QDSS_CLK and RPM_SMD_QDSS_A_CLK is not enough
<Mis012[m]> this is with every single clock entry commented
* Mis012[m] afk
dliviu has quit [Read error: No route to host]
dliviu has joined #linux-msm
<konradybcio> Hmm, isn't that for dt clocks= source lookup?
<konradybcio> (i dont have the source before my eyes rn)
<konradybcio> Try leaving just one in
<konradybcio> For example that qdss, since you know it makes no difference
svarbanov has quit [Remote host closed the connection]
lumag__ has quit [Ping timeout: 480 seconds]
pespin has quit [Remote host closed the connection]
jhovold has quit [Ping timeout: 480 seconds]
lumag__ has joined #linux-msm
pevik has joined #linux-msm
<calebccff> elder_: IPA wakeups work \o/ I set up a connection with netcat over mobile data on my OnePlus 6 and then put it in suspend, sending data from the server to device caused it to wake up and immediately receive the data
<elder_> Well that's nice...
<elder_> I didn't expect it to work quite right, but hey, I won't complain
<calebccff> haha
<calebccff> i really can't thank you enough
<calebccff> so, we can wake up the device for network notifications but it can't wake up for texts or calls
<elder_> IPA only does IP traffic
<elder_> Calls most likely go via some other mechanism.
<calebccff> glink or something I think? I asked bamse about it before
<elder_> I might have thought texts could go through IP but ultimately SMS might have its only channel (maybe on the same channel as phone calls?)
<calebccff> huh SMS over IP sounds fun
<calebccff> elder_: is it possible to have the IPA also handle wifi data?
<elder_> I don't think so.
<elder_> As I understand it some sort of WiFi stack runs on the modem. I don't know how that data gets to the AP.
<elder_> Maybe it's possible but I don't know how, and if it is, it's not going to be supported any time soon...
<Mis012[m]> elder_: it seems to me that the atheros firmware (the one running on the PCI-E card) was ported as a hexagon userspace app
<elder_> Sounds about right.
<Mis012[m]> at least that's how it is on 8998
<Mis012[m]> elder_: it's so weird to think that the internal registers are all in Linux's address space, but I assume there are some realtime requirements :P
<elder_> I know basically nothing about it...
<calebccff> elder_: thanks a lot for your help, and for making all this cool hardware work :)
<elder_> I'm glad it's working for you. It's really nice to learn things are working on hardware I haven't directly used.
<Mis012[m]> I wonder if atheros counts as SDR...
<Mis012[m]> since that would make having fun with it legally challenging
<konradybcio> calebccf, calls go through mpm
<Mis012[m]> the what
<konradybcio> the gic abstraction layer
<konradybcio> so that your ap doesn't have to be on 24/7
<Mis012[m]> mpm is not exactly "gic abstraction layer"
<calebccff> also it seems like runtime PM kills the IPA ~10 seconds after suspend, it needs to support not disabling the IPA if there's some connection open I guess
<Mis012[m]> afaik mpm is an umbrella term for power management related hw
<Mis012[m]> mpm interrupt is for all intents and purposes an interrupt with wake capability
<Mis012[m]> the relevant part is still what triggers that interrupt
<konradybcio> i mean, the interrupt part is what matters to you in the end
<Mis012[m]> well, magic SSCAON registers also matter to me, but maybe that's just me :P
<Mis012[m]> seems 845 hyp doesn't use any magic SSCAON registers
<Mis012[m]> *though
<konradybcio> 845 doesn't have mpm anymore
<konradybcio> pdc
<konradybcio> as do rpmh platforms
<Mis012[m]> I've seen some hints that mpm-like stuff is done in sw
<Mis012[m]> seems pretty meh
<Mis012[m]> konradybcio: eh... so just uncommenting `[RPM_SMD_QDSS_CLK] = &msm8916_qdss_clk,` results in reeeeeeeeeboot
<konradybcio> is it true for any other random rpmcc clock?
<Mis012[m]> I really don't feel like testing "any"...
<konradybcio> test 2, then test n+1 and call it mathematical induction ;)
<Mis012[m]> xD
<konradybcio> cmon
<Mis012[m]> contrary to popular belief, mathematical induction is not magic :P
<konradybcio> there's a finite number of cases
<konradybcio> and recompiling just clk-smd-rpm and re-linking the kernel should take no more than like 10 seconds
<Mis012[m]> it's finite but arbitrarily large
<Mis012[m]> btw I've shrunk my ext2 image to 100MiB
<Mis012[m]> to lower the damage
<Mis012[m]> heuristics ftw
<Mis012[m]> `[RPM_SMD_RF_CLK3_A_PIN] = &msm8998_rf_clk3_a_pin,` doesn't cause an issue
<Mis012[m]> probably related to the fact that it's not mentioned anywhere outside that place and the header
<konradybcio> ok, try enabling the rest of pinctrl clocks
<Mis012[m]> >the rest of pinctrl clocks
<Mis012[m]> ??
<Mis012[m]> if you mean TLMM, those are definitely hw voted
<konradybcio> no, they are called rpm pinctrl clocks
<konradybcio> in the driver, even
<Mis012[m]> weird name choice, any etymology for it?
<bamse> calebccff: in general, call handling and texts communication is encoded using qmi, then send over qrtr, on top of glink or smd
<calebccff> bamse: right, the modem surely supports firing an IRQ to wake up the AP for an SMS or incoming call though?
<bamse> calebccff: glink works by filling up shared memory buffers and then kicking an ipc-interrupt related to the other side
<Mis012[m]> well... the main interrupt probably won't be wakeup-enabled though?
<bamse> calebccff: so the modem will kick smp2p and that in turn will trickle up to glink
<Mis012[m]> since you don't want every shmem message to wake up the AP
<bamse> Mis012[m]: it is, if you send a glink message the other side will be woken up
<Mis012[m]> weird, I'd think there would be a lot of chatter going on there that is not wakeup worthy
<bamse> the bulk of the communication is ap-driven, the rest is considered wakeup-worthy...and then there's some corner cases
<Mis012[m]> I guess another way to handle this would be for the other core to check if AP is sleeping, potentially for how long already, and then decide based on that if sending a message is such a great idea
pevik has quit [Ping timeout: 480 seconds]
<bamse> right, there are a few such cases
<bamse> and there are a few cases where ap will send a pause/start message as it's going to sleep/waking up
<Mis012[m]> you wouldn't happen to know why removing uefi from the boot process makes rpmcc act up?
<bamse> what do you do instead of uefi?
<Mis012[m]> u-boot
<Mis012[m]> same u-boot chainloaded in boot.img doesn't manifest this problem
<bamse> cool, but unfortunately there's too much things going on in that black box for me to have any good suggestions :/
<Mis012[m]> well, I could even read the code if I thought it would help, but `grep` says it's not worth it
<Mis012[m]> no rpmcc stuff seems to be like actually used
<Mis012[m]> konradybcio: I will hazard a guess that none of these are actually used
<Mis012[m]> (no reboot)
<Mis012[m]> let's try uncommenting XO, at this point I'm expecting that to fail
<Mis012[m]> hm, it didn't
<Mis012[m]> so my adjusted guess is that RPM_SMD_QDSS_CLK is one of the bad apples, but can't be the only one since commenting out only it didn't work
<Mis012[m]> or XO is just a noop because of course it would be
<konradybcio> Or maybe the clocks that don't work need some more setup that is done in xbl
<Mis012[m]> I've got this so far, booted fine last time,... (full message at https://matrix.org/_matrix/media/r0/download/matrix.org/VJjcLuDLkzfouipfBHYKvOjM)
<Mis012[m]> I even tried to tin it...
<Mis012[m]> should really get some pogo pins already, I always forget to order tham
<Mis012[m]> *them
<Mis012[m]> aand a reboot after `[ 0.408847] vgaarb: loaded`
<Mis012[m]> let me guess which one it was...
<Mis012[m]> fwiw while I don't think that a missing parent should cause this, it's highly improbable that every clock managed by that driver has xo as direct parent...
<Mis012[m]> I'd expect better of mainline than "it works, who cares it's objectively wrong"
<Mis012[m]> would be nice to have an excuse to fix that though ngl
<Mis012[m]> instead of this being something more obscure
<Mis012[m]> ok, so we have the true culprits isolated
<Mis012[m]> //[RPM_SMD_MMAXI_CLK] = &msm8996_mmssnoc_axi_rpm_clk,
<Mis012[m]> //[RPM_SMD_MMAXI_A_CLK] = &msm8996_mmssnoc_axi_rpm_a_clk,
<Mis012[m]> and
<Mis012[m]> //[RPM_SMD_QDSS_A_CLK] = &msm8916_qdss_a_clk,
<Mis012[m]> //[RPM_SMD_QDSS_CLK] = &msm8916_qdss_clk,
<Mis012[m]> time for some sleep()