#
…

2023-01-22

00:09chadmed_ has quit [Remote host closed the connection]
00:09chadmed_ has joined #asahi-dev
00:21seeeath has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
02:01eiln has joined #asahi-dev
02:08faruk has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
02:09faruk has joined #asahi-dev
02:14amarioguy has quit [Remote host closed the connection]
02:29seeeath has joined #asahi-dev
02:58eiln has quit [Remote host closed the connection]
03:10seeeath has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
03:57swaggie has joined #asahi-dev
03:58eiln has joined #asahi-dev
03:59eilngot chaining to work
03:59eilnmeaning most* apple coreml models can be asahified now
03:59eilnaesrgan (GAN super resolution) https://bashify.io/images/YFTg7S
03:59eilnshit demo but deeplabv3 (semantic segmentation) https://bashify.io/images/ximE17
03:59eiln*models with CPU layers between i have zero plans to support
03:59eilnbut those are the exception. full on GANs work so ¯\_(ツ)_/¯
03:59eilncontext/safety, esp the nasty chained ones, needs work
04:00eilnuserspace, even the c-api for computes, is very lacking
04:00eilnand ml is so watered down that ik people are gonna complain without a one-click unstable diffusion notebook to run
04:00eilnso im trying my best on that
04:00eilnbut i hope to release these soon s.t. people can test, including t600x
04:09marcaneiln: nice!
05:10chadmed_ has quit [Remote host closed the connection]
06:01faruk has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
06:07chadmedi borrowed jeffmiw's float translation function because the one in smc-core kept giving a null pointer dereference, which i will look at fixing at some point
06:08chadmedits based mostly on jeffmiw's work but generalised so that it will be a bit nicer to maintain and work with multiple machines
06:11chadmedthe scaling on translated floats is incorrect for power readings but that can be easily rectified
07:51mkurz has quit [Remote host closed the connection]
07:51mkurz has joined #asahi-dev
08:46marcana... null deref? for a *float conversion*?
08:47chadmedyeah idk whats going on there, the kernel oopses inside that function though
08:47chadmedim probably passing it something it doesnt like
08:47marcanare you actually giving it a pointer to the int to write to? :p
08:48chadmedyeah i was
08:48marcanI don't get it, that function doesn't do any pointer math at all...
08:48chadmedyeah idk like i said its something im doing wrong that ill figure out
08:49chadmedbut for now macsmc_f32_to_u32 works as a poc
08:49cylm has quit [Ping timeout: 480 seconds]
08:49marcanso I was thinking we want all those key/name mappings in the DT
08:49marcansince it is fundamentally not tied to the SoC at all
08:50marcanit is tied to the platform and SMC firmware
08:50marcanand could even gain new entries with firmware upgrades
08:52marcanplus there are going to be combinatronics involved, e.g. you have certain SoC-tied things (like CLVR voltage rails on Pro/Max) and some machine-tied things (e.g. j314 vs j316 differences)
08:53marcanso we probably want to have it in the DT as separate includes much like the platforms themselves are handled
08:55chadmedyeah my thought on that was to end up with a per-machine smc binding for the match table, but that makes a bit more sense
08:56chadmedonly thing is i dont _think_ you can build the hwmon_channel_info struct on the fly
08:56chadmedthe hwmon docs say something about the way applesmc-intel does it being non-preferred these days, and none of the recent hwmon drivers do anything like that
08:57svenoh well, here comes the usb curse: if I first use my apple tbt 3->2 adapter and then switch to this startech adapter acio hangs 🙃
09:02zzywysm has joined #asahi-dev
09:09zzywysm_ has quit [Ping timeout: 480 seconds]
09:46swaggie has quit [Remote host closed the connection]
09:47swaggie has joined #asahi-dev
09:48jeffmiwchamed: I'm working on an hwmon driver version that will have configurable labels when we know them and do that from the DT like previously discussed with marcan.
09:49chadmed_ has joined #asahi-dev
09:51chadmed_jeffmiw: yeah i was just playing around with how that would look
09:51chadmed_building the hwmon_channel_info array based on dt info is possible just annoying
09:53jeffmiwby the way, if anyone has idea suggestion for the DT data/structure format or something that will be similar, I'm very interested :)
09:55swaggie has quit [Ping timeout: 480 seconds]
09:55chadmed_i was thinking something like the opp table
09:56chadmed_have an element for each key with smc-key and smc-label props
09:56chadmed_or something like that
09:56chadmed_then you could just walk the table and build the required structures in the driver
09:57chadmed_idek if thats possible though, i need to read up on how dts are compiled
09:58jeffmiwthanks. I'll see how I could do something similar or along those lines
10:02swaggie has joined #asahi-dev
10:15swaggie has quit [Remote host closed the connection]
10:17swaggie has joined #asahi-dev
10:25swaggie has quit [Ping timeout: 480 seconds]
10:48swaggie has joined #asahi-dev
11:03kensan has joined #asahi-dev
11:08kensan has quit []
11:10swaggie has quit [Ping timeout: 480 seconds]
11:27kh has joined #asahi-dev
11:31marcanchadmed_: yeah the "don't build the hwmon_channel_info on the fly" thing falls under "lol subsystem maintainers think they can dictate how hardware works"
11:31marcanwe push back against those silly rules/guidelines :p
11:34swaggie has joined #asahi-dev
11:37kettenis_in the openbsd aplsmc(4) driver I simply have a list of keys we might be interested in and check which of them exist when the driver attaches
11:38kettenis_seems to work fine so far, although I only support a limited set of keys for now
11:38kettenis_of course if Apple starts using the same key for wildly different purposes this won't work
11:42marcankettenis_: some keys have a different meaning on different systems because they are abstractly attached to power rails
11:42marcane.g. MPMU buck #1 might be two totally different things on different machines, and naming it "MPMU buck #1" erases all information useful for end users
11:43marcanI'd rather name those after the power rail they drive or what that power rail is for
11:43marcanwhich varies from board to board
11:43marcan(of course we don't have that data for everything, but we do for some machines, and that's nice)
11:44svenjannau: fwiw, I think at this point we might as well try to just writer our own small dwc3 driver that calls into the dwc3 core but is more aware of the annoying atcphy dance by hooking into the typec_mux stuff as well
11:44ChaosPrincessif we intend to unify smc drivers with intel machines, then how to define that data for intel systems where there is no DT
11:44svenjannau: especially with thunderbolt this seems to be very annoying to get right and end in even more ugly hacks
11:44marcanChaosPrincess: I don't think intel machines have anywhere near as many sensors as these; we could just have some defaults hardcoded in the driver and probe for existing keys like kettenis_ does for those
11:44marcanit'd cause some divergence but that's fine
11:45ChaosPrincessso, just assume apple will not make new intel machines and have hardcoded tables in the driver?
11:45svenjannau: it looks like we e.g. don't need a dwc3 reset if we just switch from usb3-only to usb3/dp
11:46marcansven: works for me, we already have apple,dwc3 for this. might need a denylist in the generic dwc3 driver to make sure it doesn't probe on snps,dwc3 first.
11:46svenyeah, there's some annoying details to figure out but at least I want to give this a try
11:47kettenis_having a consistent set of descriptions for those keys may be a challenge ("name of the power rail" vs. "what they're for")
11:47marcanplease do
11:47svenhacking around dwc3 is getting more and more painful these days
11:47svenwhich is probably a sign that we're doing something wrong ;)
11:47marcankettenis_: I'd just include both, flood users with info. repair people will love it, and it's cool. for stuff we don't have the info for, just roll with what we can guess.
11:48marcanit doesn't have to be consistent other than a few very well defined and stable keys, it has to be useful.
11:52kh has quit [Quit: Quit]
11:57kettenis_I suppose I can always ignore the stuff in the DT if it conflicts with my OCD ;)
12:04chadmed_ChaosPrincess: 90% of that applesmc-intel driver can be factored out into an x86 backend for smc core
12:04ChaosPrincessand the other 90% is parsing of the keys
12:04ChaosPrincesssince they dont match
12:05robinp has joined #asahi-dev
12:05chadmed_yeah the way they do it is odd too
12:05swaggie has quit [Ping timeout: 480 seconds]
12:06marcanthe fan control keys match, that's the #1 thing that will share nicely
12:07chadmed_does the existing intel driver work for t2 macs?
12:07marcanthat's another reason to deprecate it
12:07chadmed_ah... yeah...
12:07marcanand I expect T2 Macs to share a lot more with M1s
12:08marcanlike, quite likely, the battery stuff
12:08ChaosPrincessmarcan: dont they use a different data format
12:08ChaosPrincessint vs float and such
12:09ChaosPrincessand intel macs used some weird fixpoint format for some keys
12:09chadmed_would it be worth just not unifying them, but factoring out the backend stuff we can and still have an independent driver for the intel machines
12:09marcanChaosPrincess: oh, good point, they do, but... key type is discoverable
12:09marcanso that means the driver can just find out and support both
12:09chadmed_or can we just say "if dmi table use this codepath if of use this other codepath"
12:09marcanthat's just a minor divergence
12:09marcanyou can query key type and data format
12:10marcanchadmed_: not worth it IMO
12:12marcanonce we have fan/temp unified, the rest of what the intel driver is what... keyboard backlight and some ambient light sensor thing?
12:12marcanthose are easy enough to throw in for completeness and call the existing driver superseded
12:13marcanand in the meantime we can just have both drivers mutually exclusive in kconfig and let people pick
12:27marcanso apple silicon already has mixed key formats: most templeratures are 'flt ' (float32), but some are 'ioft' (16.16 fixed point). intel macs seem to use (at least) 'sp78' which is 8.8 fixed point (7.8 plus sign bit, but hopefully the sign bit is standard two's complement?)
12:27marcanthe driver needs to just enumerate all T??? keys, and grab the formats, and export everything it supports
12:28marcanthen pull descriptions from the DT or (on intel) hardcoded tables for known keys
12:28marcanand leave the others as raw keys
12:28marcan(better export unknown keys than leave them out)
12:30bcrumb has joined #asahi-dev
12:54amarioguy has joined #asahi-dev
12:58eiln has quit [Remote host closed the connection]
13:01swaggie has joined #asahi-dev
13:29swaggie has quit [Ping timeout: 480 seconds]
13:54svenhrm, there's a strange apciec1-piodma node in the ADT which seems to use the pciec dart for some reason
13:55svenits MMIO starts where usually the second root port would be
13:56svenand apparently at some point the .kexts disappeared from /System/Library/Extensions :/
13:56svenlike, all of them. I guess they only exist in that kernelcache now?
13:59jannaumarcan: please replace bits/020-t6000-dart with https://github.com/jannau/linux/tree/bits/020-t6000-dart - update to Thierry's v13 which hopefully gets merged for v6.3
14:02jannaumarcan: do you still want to "stabilize" asahi-wip soon? I would like to get the component based probing and runtime PM merged before 13.2 support
14:03marcanjannau: I think at this point we might just release everything together, so I'm happy to merge those in first
14:05bcrumb has quit [Quit: WeeChat 3.8]
14:06ChaosPrincessif you have time, mind looking at the touchbar prs?
14:07svenapciec[%s]::%s no PIODMA engine associated with this port <-- oh dear god, I'm not sure I want to know what that's about
14:11marcansven: looks like a generic DMA copy engine?
14:11svenyeah, somehow associated with the thunderbolt pcie controller
14:12marcanand DCP too, and other things :p
14:12sveni'm just a bit confused because it uses stream 15 of that pcie dart
14:13chadmed_ has quit [Ping timeout: 480 seconds]
14:13jannaumarcan: ok, I'll prepare it. not sure if I want to something about the PCIe dart runtime PM hack
14:13marcanI'll look at it
14:14svenand DCP at least uses that piodma thing somehow internally. it's just weird that the thunderbolt pcie controller has that thing as wel
14:20m42uko_ has joined #asahi-dev
14:26m42uko has quit [Ping timeout: 480 seconds]
14:28kensan has joined #asahi-dev
14:34jannaumarcan: https://github.com/jannau/linux/tree/dcp_runtime_pm based on asahi-6.2-rc3-5 I hope you don't mind sorting the patches into their bits/* branches. creating PRs for all of them is a little tedious
14:35marcanthanks :)
14:37jannaua0139ccbde88 can be dropped from bits/200-dcp wrong branch and change is already squashed in bits/020-t6000-dart
14:52kettenis_marcan: since we're talking pull requests:
14:53kettenis_prepares us for an upcoming u-boot change
14:59marcanmerged and pushed, smoke tested on t6000
15:01marcanjannau: the hack looks fine for now, we can shave that yak later
15:02marcan[ 211.940035] apple-dcp 38bc00000.dcp: RTKit wakeup timed out, trying reset. Please do not report bugs
15:02marcan[ 211.942392] apple-dcp 38bc00000.dcp: RTKit: Initializing (protocol version 12)
15:02marcanI assume that's normal?
15:02marcanthe timeout does cause a slight user visible delay that's not great
15:02marcanmight want to shorten it
15:03jannauon the initial probe? no, that's unexpected
15:03marcanno, after a sleep/wake
15:03jannaustill unexpected. should only trigger after module unloading
15:04marcanI think I might have screwed up some patches, sec
15:05marcanyeah, DART rpm was missing
15:08marcanjannau: still times out though, with that
15:08marcandid I miss something else?
15:10marcanah yes, some DT stuff I think?
15:11marcanno wait, it's not that
15:11marcanoh it's marked always-on
15:12marcandid I miss that patch?
15:12jannausoc: apple: apple-pmgr-pwrstate: Switch to IRQ-safe mode is missing
15:13jannaualways-on should not matter, dcp removes that on probe
15:15jannaubut I think I was mostly testing on t8103 without always-on added that only for the PR, it was always there for t600x and t8112 though
15:15jannaubut I could have missed resets there
15:15marcannow it works, except
15:15marcan[ 20.423739] apple-dcp 38bc00000.dcp: Runtime PM usage count underflow!
15:15marcan[ 20.424813] apple-dcp 38bc00000.dcp: failed to suspend DCP
15:16marcanthat clearly shouldn't happen
15:16marcan(it does work nonetheless though)
15:17marcanafter a couple sleep cycles it stopped saying that
15:20bisko has joined #asahi-dev
15:24bisko has quit []
15:24jannauI see neither on t8103-j274 without always-on for ps_disp0_cpu0. testing now with always-on
15:27bisko has joined #asahi-dev
15:43marcanI suspect I know what this is
15:44bisko has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
15:45marcanyeah, it's a race
15:45jannaumarcan: reproduced with "soc: apple: apple-pmgr-pwrstate: Switch to IRQ-safe mode" reverted
15:45marcanno it's just a race
15:49jannauI see it here with a timeout for setDCPPower() and there's a syslog message after that
15:51marcanjannau: pushed a fixup with a comment
15:52marcanwait I messed up
15:52seeeath has joined #asahi-dev
15:53marcanjannau: fixed now
15:54marcanhonestly the mechanism I used there is kind of flaky and should probably be rethought
15:54marcanbut at least this works now
15:59antonio2 has joined #asahi-dev
15:59jannaulooks ok. nice though that the reset recovered from this. I still consider the module reload and reset handling as unsupported
16:00marcanoh this one wasn't causing any badness, the rpm code just re-incremented the count so it was just cosmetic
16:00marcanthe previous one though, yeah (when I was missing the IRQ-safe patch)
16:01marcanjannau: what are your plans for 13.2?
16:01jannauthe deferred probe / gdm startup race should be fixed now
16:01marcanooh nice
16:02jannauI'm currently working on updating trace_dcp.py for 13.2
16:03marcanjannau: how is the race solved in the end?
16:03jannaudriver changes will be a little annoying. firmware specific call/callback tables and structures
16:04antonio2 has quit [Quit: Leaving]
16:05marcanah, I guess you just start all DCPs in the callback when the components are ready?
16:05marcandcp_wait_ready() right
16:05marcanmakes sense
16:05jannaumarcan: component (linux/component.h) based probing starts when the last missing component is probed
16:06marcanyeah, got it
16:07jannauI think the wait_ready change is not that important. it prevents a "drm: crtc missing modes" during fbdev initailization
16:08marcanok, I'll do a -dev release with this and m1n1
16:12marcanI'm thinking I might merge lina's new UAPI/rebase stuff plus rebase on the latest rc, and then after some smoke testing of that do a release to stable to see if we regress anything (which really should only affect -edge at that point)
16:13marcanand then when the M2 Pro/Max stuff is ready, release it together with promoting -edge stuff to stable
16:14marcani.e. to non-edge
16:14marcanwhether something else makes it in there (audio? DP?) depends on timing at that point, TBD
16:16marcanbut anyway, doing a build with what we have now before going to sleep
16:33marcan[ 1.326413] WARNING: CPU: 4 PID: 460 at drivers/gpu/drm/drm_atomic_state_helper.c:174 drm_atomic_helper_crtc_duplicate_state+0x58/0x74
16:33marcanjannau: backlight restore by systemd fails
16:33marcanbacklight itself works in KDE though
16:34marcanWARN_ON(!crtc->state) is what is firing
16:35marcanthis happens before dcp_poweron even
16:36marcanI'm guessing we might need to just cache backlight values somewhere before this stuff is ready?
16:36marcananyway, not a big deal, just fyi
16:36jannauthe backlight device gets only registered after dcp is (re)started and reports the current brightness
16:37marcanyeah but I think the issue is that there hasn't been a swap yet, so we don't have any atomic state
16:37marcanor something like that
16:38marcanthis all happens before:
16:38marcan[ 1.346268] apple-dcp 38bc00000.dcp: DCP booted
16:38marcan[ 1.346558] apple-dcp 38bc00000.dcp: DCP is_main_display: 1
16:38marcan[ 1.346562] apple-dcp 38bc00000.dcp: dcp_hotplug: connected: 1
16:38marcanso I think systemd is probably triggering that immediately when the backlight device appears
16:39jannauok, missing swap or modeset sounds reasonable and it appears it's called then the backlight devices reappears
16:40jannaunot really happy with the backlight handling. I wish the drm backlight integration would progress faster
17:03faruk has joined #asahi-dev
17:04faruk has quit []
17:09seeeath has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
17:14seeeath has joined #asahi-dev
17:35seeeath has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
17:37faruk has joined #asahi-dev
17:50jeffmiw_ has joined #asahi-dev
17:56jeffmiw_ has quit [Remote host closed the connection]
18:08bcrumb has joined #asahi-dev
18:10hightower4 has quit [Ping timeout: 480 seconds]
18:11bcrumb has quit []
18:28gladiac has joined #asahi-dev
18:41jeffmiw_ has joined #asahi-dev
18:42jeffmiw_ has quit [Remote host closed the connection]
18:43swaggie has joined #asahi-dev
18:46thastihaving an interesting issue here (m2 air, on -edge): I'm trying to use an USB-C ethernet dongle. I can only get it to enumerate reliably by placing a finger on top of the USB traces on its PCB. Without doing that, it never enumerates (and I get repeated 'Cannot enable. Maybe the USB cable is bad?' or 'config error' messages in dmesg)
18:47thasticould that be caused by some USB-PHY setting, making the link not come up properly due to marginal signal integrity without my finger on the PCB?
18:57jannaudoes the dongle work reliably when connected to other devices
19:00thastiI only have one other machine to test, but it seemed to work fine there. I should be able to test another machine or two at work tomorrow
19:02thastii at least two have two such devices (same model, both new out of box), and both of them behave exactly the same
19:02thastibut if their design was bad, that would of course to be expected :)
19:03svendoes it work on the same machine when running macos?
19:03thastithis I haven't tried yet (haven't booted back into macos since I installed asahi on here)
19:12thasti.. turns out macOS actually doesn't boot any longer (telling me it needs to be reinstalled)
19:17bisko has joined #asahi-dev
19:25thastiokay, got it to boot. turns out the dongles don't really work under macOS either
19:26thastii can get them to appear sometimes with the same kind of trick, but without that they don't show up
19:29sventhanks for checking, sounds like some kind of signal integrity issue then
19:30svencan’t really do anything about that though :(
19:30seeeath has joined #asahi-dev
19:30thastiyep, best guess it's just a marginal design (they were free, I probably know the reason why now...)
19:44bcrumb has joined #asahi-dev
19:46bcrumb_ has joined #asahi-dev
19:47swaggie has quit [Ping timeout: 480 seconds]
19:50bcrumb__ has joined #asahi-dev
19:50bisko has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
19:53bcrumb has quit [Ping timeout: 480 seconds]
19:57bisko has joined #asahi-dev
19:57bcrumb_ has quit [Ping timeout: 480 seconds]
20:00bisko has quit []
20:03bcrumb__ has quit [Quit: WeeChat 3.8]
20:05bisko has joined #asahi-dev
20:14faruk has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
20:16bisko has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
20:18gladiac has quit [Quit: k thx bye]
20:26nicolas17 has joined #asahi-dev
20:38nicolas17ChaosPrincess: your touchbar pr only supports M1 atm right?
20:39mkurz has quit [Quit: Leaving]
20:39bisko has joined #asahi-dev
20:40ChaosPrincessin theory should work on m2, but i do not have one
20:42nicolas17I have M2, but maybe you want some review/testing on M1 first, before messing with the M2 devicetree :P
20:47bisko has quit [Ping timeout: 480 seconds]
20:50faruk has joined #asahi-dev
21:09nicolas17 has quit [Ping timeout: 480 seconds]
21:10nicolas17 has joined #asahi-dev
21:12* thastifixed the USB ethernet dongles by shortening the wires between the USB-C cable pigtail and the PCB... now works reliably
21:14jluthra has quit [Remote host closed the connection]
21:15jluthra has joined #asahi-dev
21:30faruk has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
21:30c10l1 has quit []
21:30c10l has joined #asahi-dev
21:30faruk has joined #asahi-dev
21:39faruk has quit [Ping timeout: 480 seconds]
21:58svenhrm, looks like apple's pciec driver has some quirks for certain devices that don't play nice with the rid2sid map
21:59sven"PI7C9X442SL USB OHCI" is always forced to sid 0
21:59svenand then there's a marvel-wa-viddids field in the ADT to select some devices that also get a special treatment
22:02svenohh... the PI7C9X442SL workaround makes sense I think. it's the controller in the old apple thunderbolt displays (like mine) and that one exposes three different pci functions
22:02svenand that worked here. so I bet all functions just need to go to the same stream
22:10kettenis_might not include the function number in the RID
22:11kettenis_linux may already have a quirk table
22:13svenyeah, that’s what I assume happens. but if we just go with mapping each bus to a separate sid it’ll just work without quirks
22:15kettenis_one of the reasons I suggested that approach ;)
22:24seeeath_ has joined #asahi-dev
22:25hightower2 has joined #asahi-dev
22:30seeeath has quit [Ping timeout: 480 seconds]
22:51sawyer has joined #asahi-dev
22:52sawyerhi all, saw this in the tethered boot setup guide and wasn't sure if it was a placeholder or a reference that I'm just out-of-the-loop on: `A somewhat sane .config can be found at [[DesktopKernel]].`
23:00yrlf has quit [Quit: The Lounge - https://thelounge.chat]
23:12whomst has joined #asahi-dev
23:12whomst has quit []
23:12whomst has joined #asahi-dev
23:17whomst has quit []
23:20cylm has joined #asahi-dev
23:26seeeath_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
23:26seeeath has joined #asahi-dev
23:31yrlf has joined #asahi-dev
23:33seeeath has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
23:35seeeath has joined #asahi-dev
23:37seeeath has quit []
23:44whomst has joined #asahi-dev
23:53whomst has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
…