marcan changed the topic of #asahi-dev to: Asahi Linux: porting Linux to Apple Silicon macs | Non-development talk: #asahi | General development | GitHub: https://alx.sh/g | Wiki: https://alx.sh/w | Logs: https://alx.sh/l/asahi-dev
Method has joined #asahi-dev
winter has joined #asahi-dev
Etrien has quit [Read error: No route to host]
Etrien has joined #asahi-dev
thelounge7571340 has joined #asahi-dev
thelounge7571340 has quit [Remote host closed the connection]
r0ni has quit [Quit: Leaving]
nicolas17 has joined #asahi-dev
<jannau> marcan: https://github.com/jannau/linux/tree/dcp-backlight-wip and https://github.com/jannau/m1n1/tree/dcp-brightness hacked together backlight control, not for testing
<jannau> annotations are at least incomplete, I have no idea what the "flags" are doing
<jannau> dcp appears to report the brightness in nits, unsure what we have to do to set the brightness in nits
<jannau> best guess from the ADT backloight node is that DCP sets a DAC register, a look up table provides current and there are coefficients to calculate nits from current
uur has quit [Ping timeout: 480 seconds]
* jannau curses apple for not always clearing the shmem. this looked so random in the dumps that I thought it was leftover
uur has joined #asahi-dev
uur has quit [Ping timeout: 480 seconds]
nicolas17 has quit [Remote host closed the connection]
ccs1 has quit [Ping timeout: 480 seconds]
uur has joined #asahi-dev
brentr123 has quit [Quit: Connection closed for inactivity]
thelounge7571340 has joined #asahi-dev
thelounge7571340 has quit [Remote host closed the connection]
ccs1 has joined #asahi-dev
uur has quit [Ping timeout: 480 seconds]
uur has joined #asahi-dev
thelounge7571340 has joined #asahi-dev
thelounge7571340 has quit [Remote host closed the connection]
uur has quit [Ping timeout: 480 seconds]
uur has joined #asahi-dev
<tpw_rules> jannau: is that the same weird encoding in the nvram?
<tpw_rules> also is https://github.com/AsahiLinux/linux/tree/gpu/rust-wip supposed to build? i am getting modpost errors. just wanted to make sure my rust infra was up to snuff
uur has quit [Ping timeout: 480 seconds]
thelounge7571340 has joined #asahi-dev
thelounge7571340 has quit [Remote host closed the connection]
uur has joined #asahi-dev
uur has quit [Ping timeout: 480 seconds]
Glanzmann has joined #asahi-dev
uur has joined #asahi-dev
<Glanzmann> tpw_rules: This works for me: https://pbot.rmdir.de/brmgQa1O2bh4efW_yI7EGA Full build output: https://pbot.rmdir.de/YGiYtZW102oeF-7BhjMCAw Howto setup rust for Linux kernel: https://www.kernel.org/doc/html/next/rust/quick-start.html
thelounge7571340 has joined #asahi-dev
thelounge7571340 has quit [Remote host closed the connection]
<Glanzmann> tpw_rules: But the asahi gpu driver fails to probe for me on the mini, so I'm not using it.
Glanzmann has quit [Quit: EOF]
<tpw_rules> ah, so you are building with gcc as the main compiler?
uur has quit [Ping timeout: 480 seconds]
nickchan has joined #asahi-dev
Core2718 has joined #asahi-dev
Glanzmann has joined #asahi-dev
Core9066 has quit [Read error: No route to host]
Core9066 has joined #asahi-dev
<Glanzmann> tpw_rules: The first time I tried, I used gcc. But it is not supported with rust, so I switched to clang which I never used before knowlingly. Anyway the LLVM=-14 tells the kernel build infrastructure to use 'clang-14' as compiler. So with the example I pasted, no I did not use gcc but used clang-14.
Core2718 has quit [Ping timeout: 480 seconds]
nickchan has quit [Quit: nickchan]
uur has joined #asahi-dev
uur has quit []
Etrien__ has joined #asahi-dev
Etrien has quit [Ping timeout: 480 seconds]
thelounge7571340 has joined #asahi-dev
thelounge7571340 has quit [Remote host closed the connection]
l3k has quit [Remote host closed the connection]
nickchan has joined #asahi-dev
Etrien has joined #asahi-dev
Etrien__ has quit [Ping timeout: 480 seconds]
Dementor has quit [Quit: Ping timeout (120 seconds)]
Dementor has joined #asahi-dev
<jannau> tpw_rules: it would be far too dim if it was the same unit and scale. not even sure if chnaging the nvram value did anything. not really worth looking at atm
<jannau> tpw_rules: at some point the gpu couldn't be build as module due to the rust bindings, not sure if that is still the case
thelounge7571340 has joined #asahi-dev
thelounge7571340 has quit [Remote host closed the connection]
SSJ_GZ has joined #asahi-dev
<marcan> tpw_rules: it's conceivable we will add something to u-boot to load xHCI firmware in the future (once PCI xHCI works at all)
<marcan> but even without that, there is a general issue because distros will want to put xhci_pci in the initramfs, so that on *other* platforms you can use those controllers at least
<marcan> and that will imply that on *this* platform you need the firmware
<marcan> so it doesn't matter if we don't expect AS users to use xHCI in the initramfs for installers because it's broken in u-boot right now; it needs the firmware because the module is going to be in there anyway, and if it loads without the firmware then xHCI won't work *at all*
Dementor has quit [Quit: Ping timeout (120 seconds)]
Dementor has joined #asahi-dev
Dementor has quit [Quit: Ping timeout (120 seconds)]
ccs1 has quit [Ping timeout: 480 seconds]
Dementor has joined #asahi-dev
thelounge7571340 has joined #asahi-dev
thelounge7571340 has quit [Remote host closed the connection]
nullroute has quit [Max SendQ exceeded]
nullroute has joined #asahi-dev
nickchan has quit [Quit: nickchan]
nickchan has joined #asahi-dev
nickchan has quit []
Etrien__ has joined #asahi-dev
Etrien has quit [Ping timeout: 480 seconds]
thelounge7571340 has joined #asahi-dev
thelounge7571340 has quit [Remote host closed the connection]
<povik> ccs1: there was ilya who expressed interest some ten days ago and i gave them a walkthrough of the task. though they didn't have an imac but wanted to try to start writing the driver still. i don't expect them to finish it lacking hardware to test on
riker77 has quit [Quit: Quitting IRC - gone for good...]
riker77 has joined #asahi-dev
riker77 has quit []
thelounge7571340 has joined #asahi-dev
thelounge7571340 has quit [Remote host closed the connection]
Etrien__ has quit [Read error: Connection reset by peer]
Etrien has joined #asahi-dev
riker77 has joined #asahi-dev
thelounge7571340 has joined #asahi-dev
thelounge7571340 has quit [Remote host closed the connection]
Core8048 has joined #asahi-dev
Core9066 has quit [Ping timeout: 480 seconds]
thelounge7571340 has joined #asahi-dev
thelounge7571340 has quit [Remote host closed the connection]
amarioguy2 has joined #asahi-dev
mrkajetanp has joined #asahi-dev
Esmil has joined #asahi-dev
amarioguy2 has quit [Ping timeout: 480 seconds]
gabuscus_ has joined #asahi-dev
<sven> urgh.. so the replayed xnu trace and my atcphy.c do the same pokes but the first one works and the latter one doesn't.
<sven> i wonder if there's some delay() missing somewhere that I just don't see in the MMIO trace but replaying it with python happens to be slow enough :(
gabuscus has quit [Ping timeout: 480 seconds]
gabuscus_ has quit [Ping timeout: 480 seconds]
thelounge7571340 has joined #asahi-dev
thelounge7571340 has quit [Remote host closed the connection]
gabuscus has joined #asahi-dev
<marcan> sven: for PLLs and things like that delays would often be necessary, yeah
<marcan> does macos read anything? maybe it's polling for a bit to flip but when you trace it's slow enough it always is already done?
<marcan> maybe do any reads and print the values and cross check
<marcan> (or just add random delays)
<sven> i'm pretty sure I can account for all macos reads
<sven> i've traced both and diffed the hv looks and both do the same amount of reads
<sven> *hv traces
<sven> and random delays don't seem to fix anything.
<marcan> sven: and do you get the same values back in linux?
<sven> i'm starting to suspect it's something very dumb
<sven> yes
<marcan> I'm going with dumb then
<marcan> something something linux power domains?
<sven> hrm, let me check if there's something strange there
<sven> lol, if I run the macos trace before I boot into linux and still run the atcphy.c it still works
<sven> this is going to be something silly
<rmk> marcan: I guess if Lee doesn't reply, the next thing to try is to see whether moving smc_core.c into drivers/mfd satisfies the issue. If that fails, then try all of drivers/platform/apple/*.[ch] into drivers/mfd maybe drivers/mfd/apple... if that doesn't work for Lee, I'm then at a complete loss - and I suggest at that point we effectively re-implement the mfd part to get around the blockage.
<rmk> I'm not particularly happy with Lee calling my attempt a "hack" when it seemed to be somewhat closer to the solution he seemed to be asking for.
tanty has quit [Remote host closed the connection]
tanty has joined #asahi-dev
amarioguy2 has joined #asahi-dev
<kettenis> kevans91: sorry, had a busy week/weekend
<kettenis> not sure I can provide much more context other than that the old code was clearly buggy and that I gave up with switching the FPU registers in a clever way
<kettenis> given the way modern compilers generate code with vector instructions all over the place, I'm not sure if there is any benefit in trying to be clever
<kettenis> rmk: related to the smc stuff, I'm not sure what conclusion was reached for the dt bindings
<kettenis> I think I wanted to point out at some point that including the SoC in the compatible names for sub-nodes didn't make a lot of sense since these are firmware interfaces controlling (mostly) off-SoC hardware
Gaspare has joined #asahi-dev
<jannau> marcan: backlight-marketing-table seems to 16.16 display brightness values in nits. those might be the steps used by the brightness keys
<rmk> kettenis: so you think we shouldn't have the apple,t8103-smc-gpio compatible?
<marcan> rmk: if Lee doesn't reply I'd rather just resubmit it as platform and not Cc him, because he clearly doesn't want to work with us and I'm not interested in playing a guessing game with no feedback
<marcan> he doesn't know what he wants, and he hasn't bothered to actually read and understand how the driver works
<marcan> he probably thinks this should be using regmaps or shared memory or something like most other MFD devices
<kevans91_> kettenis: thanks (and no worried, re: delay); think I'm going to switch over to debugging the different issue we hit under the hypervisor, then circle back to this later
<kevans91_> it's actually the first write we do, to q1, where the cpu just apparently hangs (no exception afaict)
<marcan> so if he doesn't play ball, we try to sneak it in because using MFD is clearly the correct solution, regardless of what the maintainer says; and if he blocks that, then we have no choice but to reinvent the MFD wheel because a Linux subsystem maintainer has decided some people shouldn't use his subsystem
<marcan> this whole thing is stupid
<rmk> marcan: honestly, I think we could get away with converting this code to create and remove the platform devices directly without involving mfd without it needing too much effort, and then Lee's mfd stuff is completely out the loop.
<marcan> right. it's more code, and therefore obviously a bad solution, but it sounds like the maintainer of the subsystem intended for this purpose doesn't actually want his subsystem used for this purpose so...
<marcan> shittier code it is.
amarioguy2 has quit [Ping timeout: 480 seconds]
<kettenis> rmk: yes, that is what I think
<kettenis> but I don't want to derail the whole thing
<marcan> (sorry, I'm in a bad mood dealing with this after the argument last week, bad upstreaming interactions make me cranky)
<marcan> (I can deal with code reviews and design bikeshedding and whatever, but this kind of silliness gets to me)
thelounge7571340 has joined #asahi-dev
thelounge7571340 has quit [Remote host closed the connection]
<rmk> yep, I think we can implement this without too much hassle without involving mfd if that's where we get to.
Method is now known as Method_
amarioguy2 has joined #asahi-dev
<sven> aaand it was something at least silly. clear vs. set in the crossbar for one register that's CLK_N_EN instead of CLK_EN.
<sven> now it sometimes works :/
<Dcow_> "something works" ?
<sven> sometimes
zzywysm has quit [Read error: Connection reset by peer]
<sven> If I boot like 10 times it only works maybe 7 times
zzywysm has joined #asahi-dev
<sven> pretty sure it's missing some important delays somewhere. just adding a mdelay(10) to every single register write seems to help a lot
DarkShadow4444 has quit [Quit: ZNC - https://znc.in]
DarkShadow44 has joined #asahi-dev
Gaspare has quit [Quit: Gaspare]
thelounge7571340 has joined #asahi-dev
thelounge7571340 has quit [Read error: Connection reset by peer]
Core9066 has joined #asahi-dev
Core3870 has joined #asahi-dev
Core4262 has joined #asahi-dev
Core9066 has quit [Read error: No route to host]
Core8048 has quit [Ping timeout: 480 seconds]
Core3870 has quit [Ping timeout: 480 seconds]
qyliss has quit [Quit: bye]
qyliss has joined #asahi-dev
amarioguy2 has quit [Ping timeout: 480 seconds]
thelounge7571340 has joined #asahi-dev
EricCurtin[m] has quit [Write error: connection closed]
thelounge7571340 has quit [Remote host closed the connection]
amarioguy has quit [Ping timeout: 480 seconds]
Gaspare has joined #asahi-dev
Gaspare has quit [Quit: Gaspare]
Gaspare has joined #asahi-dev
amarioguy has joined #asahi-dev
Glanzmann has quit [Quit: EOF]
<sven> alright, seems to work reliable with delays at the correct positions now. at least for HBR.
nvflash_ has joined #asahi-dev
<nvflash_> I installed Asahi on my MBP M2 13" a few days ago, but the keyboard does't work with Grub, I see from a twitter post there is a fix. Can I pull the fix to my install?
thelounge7571340 has joined #asahi-dev
thelounge7571340 has quit [Remote host closed the connection]
nvflash_ has quit [Remote host closed the connection]
bluetail7 has joined #asahi-dev
dottedmag has left #asahi-dev [#asahi-dev]
bluetail has quit [Ping timeout: 480 seconds]
bluetail7 is now known as bluetail
nicolas17 has joined #asahi-dev
bluetail has quit [Ping timeout: 480 seconds]
thelounge7571340 has joined #asahi-dev
thelounge7571340 has quit [Remote host closed the connection]
thelounge7571340 has joined #asahi-dev
thelounge7571340 has quit [Remote host closed the connection]
<rmk> marcan: please don't reply to Lee! I've invited him to chat with me on irc about it, I suspect he's completely misunderstood the code structure, which would explain a lot of his comments.
jluthra has quit [Remote host closed the connection]
jluthra has joined #asahi-dev
thelounge7571340 has joined #asahi-dev
thelounge7571340 has quit [Remote host closed the connection]
yamii has quit [Quit: WeeChat 3.6]
yamii has joined #asahi-dev
thelounge7571340 has joined #asahi-dev
thelounge7571340 has quit [Remote host closed the connection]
Gaspare has quit [Quit: Gaspare]
Core9066 has joined #asahi-dev
Core4262 has quit [Ping timeout: 480 seconds]
thelounge7571340 has joined #asahi-dev
thelounge7571340 has quit [Remote host closed the connection]
SSJ_GZ has quit [Ping timeout: 480 seconds]
DarkShadow4444 has joined #asahi-dev