#
✕ nick:marcan
#asahi · 2022-12-27 17:53
marcanI hate USB.
#asahi · 2022-12-27 17:53
marcanand I'm not even sure if it can be made to work with ports chained off of hubs, because if you reset everything wouldn't that lose the disconnect state on DFPs?
#asahi · 2022-12-27 17:52
marcanthat means even *more* cursed abstraction breaking bullshit in linux
#asahi · 2022-12-27 17:52
marcansven: the only safe way to make it work with a full reset is if we can detect a disconnect during sleep, which is probably possible with tipd irq flags or something, but
#asahi · 2022-12-27 17:50
marcanas I said, Synopsys
#asahi · 2022-12-27 17:50
marcanbecause those use an xHCI controller not made by Synopsys
#asahi · 2022-12-27 17:50
marcanit also works on the Type A ports on M1s
#asahi · 2022-12-27 17:50
marcanyes it does
#asahi · 2022-12-27 17:50
marcanI'm going to be very sad if 2) is the state of affairs on macOS
#asahi · 2022-12-27 17:50
marcankarolherbst: no, that is cursed because it means either 1) your USB storage devices fall off the bus on suspend and your filesystems crash, or 2) you enable the stupid cheat mode that works around that, then someone unplugs a USB driver and plugs in a different but identical drive during sleep and on resume their filesystem gets corrupted to hell and back
#asahi · 2022-12-27 17:48
marcanChaosPrincess: Synopsys.
#asahi · 2022-12-27 17:48
marcanI need to log what macOS does to figure out whether ports breaking in suspend mode is expected (maybe macOS does full resets, that'd be cursed...) or whether there's a magic incantation to make it not explode
#asahi · 2022-12-27 17:47
marcanno, dwc2 is usb2
#asahi · 2022-12-27 17:46
marcanso dwc2 was *really* bad, dwc3 is just mostly bad
#asahi · 2022-12-27 17:46
marcanM1s use dwc3
#asahi · 2022-12-27 17:46
marcanthose use dwc2
#asahi · 2022-12-27 17:46
marcanthis is why USB sucks on the raspberry pi
#asahi · 2022-12-27 17:46
marcanat least it's not dwc2 broken, where you need CPU low latency assist to even make the USB ports work and perform properly
#asahi · 2022-12-27 17:46
marcanso broken is the default state
#asahi · 2022-12-27 17:45
marcanI mean, it's a Synopsys core
#asahi · 2022-12-27 17:45
marcanI need to do deeper testing, but from what I saw simply putting ports into suspend and then trying to take them out doesn't work
#asahi · 2022-12-27 17:45
marcanUSB is very cursed on these machines
#asahi · 2022-12-27 17:45
marcan(lots of things are broken in suspend, but USB especially)
#asahi · 2022-12-27 17:45
marcanre suspend that is known broken
#asahi · 2022-12-27 17:44
marcanas long as you don't need two discrete outputs
#asahi · 2022-12-27 17:44
marcanthey don't *require* MST
#asahi · 2022-12-27 17:44
marcanso all those "MST" docks with two ports just end up spitting out the same thing to both when used with non-MST hosts
#asahi · 2022-12-27 17:43
marcankarolherbst: DP-MST hardware will usually send a single stream to multiple outputs
#asahi · 2022-12-26 06:13
marcanalso see the actual drivers we have so far for more fleshed-out logic, e.g. https://github.com/AsahiLinux/linux/blob/asahi-wip/drivers/power/supply/macsmc_power.c
#asahi · 2022-12-26 06:12
marcanyou do a m1n1-only install and run them from another machine connected via USB
#asahi · 2022-12-26 06:11
marcan*staring
#asahi · 2022-12-26 06:11
marcanon watcher you can ^C it and get the shell to make changes, then ^D to continue
#asahi · 2022-12-26 06:11
marcanit's how I worked out most of the battery stuff, starting at the output while charging/discharging/messing with things
#asahi · 2022-12-26 06:10
marcanhttps://github.com/AsahiLinux/m1n1/blob/main/proxyclient/experiments/smc_watcher.py and that (which I just pushed) lets you monitor a subset of keys for changes, you can pass it a list of keys or key patterns (shell glob style)
#asahi · 2022-12-26 06:10
marcanhttps://github.com/AsahiLinux/m1n1/blob/main/proxyclient/experiments/smc.py that will dump all SMC keys once
#asahi · 2022-12-26 06:09
marcanbut it's a start on making sense of it all
#asahi · 2022-12-26 06:09
marcanas I said lots might be wrong
#asahi · 2022-12-26 06:09
marcanlots of guesswork
#asahi · 2022-12-26 06:09
marcansoftware, schematics, stuff from the diags images, etc
#asahi · 2022-12-26 06:07
marcanlet me push that one
#asahi · 2022-12-26 06:07
marcanoh, I just realized smc_watcher is not pushed
#asahi · 2022-12-26 06:06
marcanit's my living doc on this stuff
#asahi · 2022-12-26 06:06
marcancaveat emptor some of those might be wrong
#asahi · 2022-12-26 06:05
marcanalso https://hub.marcan.st/t/smc-key-info.txt might help decipher that
#asahi · 2022-12-26 06:03
marcanyou can also talk to the PMU directly through another SPMI instance but I don't know what the commands for GPIOs are at that layer
#asahi · 2022-12-26 06:03
marcanSMC just proxies that
#asahi · 2022-12-26 06:03
marcanthe PMU talks to it over SPMI
#asahi · 2022-12-26 06:03
marcanit's part of the SoC
#asahi · 2022-12-26 06:03
marcanyou'll have to either install the m1n1 stub only (in expert mode) or do the m1n1 proxy backdoor dance on an asahi install (pretty sure that's on the wiki somewhere too, tl;dr csrutil disable for the asahi install then nvram boot-args-v
#asahi · 2022-12-26 06:02
marcanit can poll SMC keys so you can watch things like voltages/currents in real-ish time

plus ›