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
bisko has joined #asahi-dev
millenialhacker has joined #asahi-dev
lkron has quit [Quit: Lost terminal]
bisko has quit [Ping timeout: 480 seconds]
millenialhacker has quit [Ping timeout: 480 seconds]
millenialhacker has joined #asahi-dev
os has joined #asahi-dev
thelounge7571340 has joined #asahi-dev
thelounge7571340 has quit [Remote host closed the connection]
millenialhacker has quit [Remote host closed the connection]
<marcan> rmk: the other mfd cells are not expressed in the DT at all right now, and don't need to be. also I thought we agreed to drop the compatible for gpio?
<marcan> (except rtc, rtc will need the nvram nonsense)
<marcan> i.e. having a cell does not imply having required DT documentation. that documentation should come with the driver itself, if that subdevice needs DT info.
<marcan> rmk: re the last patch, I think the main Kconfig should also be moved under mfd, not just left as a dummy option
<marcan> then the kconfig can just mention that this module requires platform-specific backend drivers to function, or whatever
millenialhacker has joined #asahi-dev
<marcan> the dpe stuff is probably a bunch of magic math, like the GPU, based on device tree data. good luck have fun, Lina's spent the past two weeks figuring out that for the GPU :p
<marcan> hint: you want to mutate the device tree data before booting macos and diff the resulting writes (then shut down the system after them to avoid bad power data from actually breaking something)
<marcan> lamlam: ^
millenialhacker has quit [Ping timeout: 480 seconds]
millenialhacker has joined #asahi-dev
millenialhacker has quit [Remote host closed the connection]
millenialhacker has joined #asahi-dev
<chadmed> zzwysm: the DTs are fine, it looks like theres a race between adding a node to opp_list and parsing the next OPP. there doesnt seem to be any other way that branch could be taken
<chadmed> i have to put the opp stuff on ice for a few days now though, but i think the smart long term solution is to detangle the opp-microwatt prop from the regulator stuff altogether, since its stated purpose hasnt really got much to do with regulators anyway and tethering it to that stuff was a lazy hack
millenialhacker has quit [Ping timeout: 480 seconds]
thelounge7571340 has joined #asahi-dev
millenialhacker has joined #asahi-dev
thelounge7571340 has quit [Remote host closed the connection]
millenialhacker has quit [Ping timeout: 480 seconds]
Dcow has quit [Remote host closed the connection]
thelounge7571340 has joined #asahi-dev
thelounge7571340 has quit [Remote host closed the connection]
nicolas17 has quit [Ping timeout: 480 seconds]
thelounge7571340 has joined #asahi-dev
thelounge7571340 has quit [Remote host closed the connection]
bisko has joined #asahi-dev
bisko has quit [Ping timeout: 480 seconds]
thelounge7571340 has joined #asahi-dev
thelounge7571340 has quit [Remote host closed the connection]
millenialhacker has joined #asahi-dev
nyx_o has quit [Ping timeout: 480 seconds]
nyx_o has joined #asahi-dev
millenialhacker has quit [Ping timeout: 480 seconds]
snowcra5h has quit [Quit: B1tch eX]
thelounge7571340 has joined #asahi-dev
thelounge7571340 has quit [Remote host closed the connection]
millenialhacker has joined #asahi-dev
thelounge7571340 has joined #asahi-dev
thelounge7571340 has quit [Remote host closed the connection]
ajv009 has joined #asahi-dev
Skirmisher has quit [Remote host closed the connection]
Skirmisher has joined #asahi-dev
millenialhacker has quit [Ping timeout: 480 seconds]
cylm has quit [Ping timeout: 480 seconds]
bisko has joined #asahi-dev
Dementor1 has joined #asahi-dev
Dementor has quit [Ping timeout: 480 seconds]
Dementor1 is now known as Dementor
bisko 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]
millenialhacker has joined #asahi-dev
millenialhacker has quit [Ping timeout: 480 seconds]
SSJ_GZ has joined #asahi-dev
m5zs7k has quit [Ping timeout: 480 seconds]
m5zs7k has joined #asahi-dev
MajorBiscuit has joined #asahi-dev
thelounge7571340 has joined #asahi-dev
thelounge7571340 has quit [Remote host closed the connection]
Major_Biscuit has joined #asahi-dev
Dcow has joined #asahi-dev
MajorBiscuit has quit [Ping timeout: 480 seconds]
bgb has joined #asahi-dev
ccs1 has joined #asahi-dev
kujeger has quit [Ping timeout: 480 seconds]
cylm has joined #asahi-dev
millenialhacker has joined #asahi-dev
Mrmaxmeier has quit [Quit: The Lounge - https://thelounge.chat]
Mrmaxmeier has joined #asahi-dev
millenialhacker has quit [Ping timeout: 480 seconds]
thelounge7571340 has joined #asahi-dev
thelounge7571340 has quit [Read error: Connection reset by peer]
<rmk> marcan: if we don't have DT compatibles in the mfd cell, MFD doesn't populate the of_node/fw_node in the device.
<rmk> there was a discussion about this in the initial posting, and the decision there was rather than messing about in each client, we'd add compatibles - that came from the review of the DT bindings iirc.
<rmk> what was more recently suggested to be dropped was the t8103 specific compatible, not the generic one
gladiac has joined #asahi-dev
bpye has quit [Quit: Ping timeout (120 seconds)]
bpye has joined #asahi-dev
millenialhacker has joined #asahi-dev
millenialhacker has quit [Ping timeout: 480 seconds]
thelounge7571340 has joined #asahi-dev
thelounge7571340 has quit [Remote host closed the connection]
ccs1 has quit [Ping timeout: 480 seconds]
Dementor has quit [Ping timeout: 480 seconds]
as400 has joined #asahi-dev
as400_ has joined #asahi-dev
as400 has quit [Remote host closed the connection]
as400_ is now known as as400
thelounge7571340 has joined #asahi-dev
thelounge7571340 has quit [Remote host closed the connection]
as400 has quit [Remote host closed the connection]
as400 has joined #asahi-dev
amateurece has quit [Quit: Connection closed for inactivity]
as400 has quit [Remote host closed the connection]
as400 has joined #asahi-dev
roxfan has joined #asahi-dev
millenialhacker has joined #asahi-dev
roxfan2 has quit [Ping timeout: 480 seconds]
as400 has quit [Remote host closed the connection]
bgb has quit [Remote host closed the connection]
millenialhacker has quit [Ping timeout: 480 seconds]
bgb has joined #asahi-dev
as400 has joined #asahi-dev
cy8aer has quit [Remote host closed the connection]
cy8aer has joined #asahi-dev
thelounge7571340 has joined #asahi-dev
thelounge7571340 has quit [Remote host closed the connection]
as400 has quit [Ping timeout: 480 seconds]
as400 has joined #asahi-dev
bisko has joined #asahi-dev
bisko has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
as400_ has joined #asahi-dev
as400 has quit [Remote host closed the connection]
as400_ is now known as as400
<ChaosPrincess> marcan: it looks like there is a bug in apple_smc_rtkit_get_key_info: the key_info variable is not actually passed to the apple_smc_cmd
thelounge7571340 has joined #asahi-dev
thelounge7571340 has quit [Remote host closed the connection]
as400 has quit [Ping timeout: 480 seconds]
as400 has joined #asahi-dev
millenialhacker has joined #asahi-dev
millenialhacker has quit [Ping timeout: 480 seconds]
as400 has quit [Ping timeout: 480 seconds]
as400 has joined #asahi-dev
thelounge7571340 has joined #asahi-dev
thelounge7571340 has quit [Remote host closed the connection]
as400 has quit [Ping timeout: 480 seconds]
hxliew has joined #asahi-dev
as400 has joined #asahi-dev
Dcow has quit [Remote host closed the connection]
<sven> hrm, looks like macos has another way that's not the tps6598x chip to figure out HPD. my usb3+dp hub doesn't trigger any irq in the tps chip when I disconnect the hdmi cable
<sven> macos somehow detects that disconnect though
as400 has quit [Ping timeout: 480 seconds]
as400 has joined #asahi-dev
<sven> *sigh*, the HPD in "DP SID Status" is correct but no interrupt is triggered when that changes
<sven> the hpd in "Data Status" is incorrect and can get stuck but there is an interrupt triggered when it changes :(
Dcow has joined #asahi-dev
<sven> jannau: https://f.svpe.de/32f2cafe3d6a663ee824841f8bdd4ee9f1a2dafdc234abd2ffceccaf215cedbf_dcpext-panic.txt no idea how I hit that once. looks like you can also look forward to dcpext fun though!
<_jannau_> two concurrent hotplug events maybe?
<sven> I've enabled all IRQs in the tps chip and nothing triggered when I unplugged the HDMI cable
<sven> there's probably yet enother out of band mechanism
<sven> *another
Dcow has quit [Ping timeout: 480 seconds]
<sven> oh, you meant for the crash?
<sven> could be
Dementor has joined #asahi-dev
as400 has quit [Ping timeout: 480 seconds]
millenialhacker has joined #asahi-dev
<_jannau_> yes, the crash
<_jannau_> at least for the tps65982 the super speed pairs are not mapped through it so it probably doesn't notice if you disconnect the DP cable
<sven> yeah, I think I accidentally trigger two hotplug events when shutting down but only if tipd shuts down before DCP
<sven> tps6598x notices, it just doesn’t allow me to trigger an interrupt :(
<sven> apparently there’s some PD messages that is exchanged which changes this “DP SID Status”
<sven> There’s just no interrupt when that changes happens
<sven> but at least I think I found the missing delay that broke insertion/removal in the type c side
<sven> it switches pretty reliably between usb3/DP-only/usb3+DP now
<sven> *on the typec
millenialhacker has quit [Ping timeout: 480 seconds]
thelounge7571340 has joined #asahi-dev
thelounge7571340 has quit [Remote host closed the connection]
as400 has joined #asahi-dev
gladiac is now known as Guest433
gladiac has joined #asahi-dev
psykose has quit [Remote host closed the connection]
psykose has joined #asahi-dev
Guest433 has quit [Ping timeout: 480 seconds]
as400 has quit [Ping timeout: 480 seconds]
as400 has joined #asahi-dev
as400_ has joined #asahi-dev
as400 has quit [Remote host closed the connection]
as400_ is now known as as400
thelounge7571340 has joined #asahi-dev
thelounge7571340 has quit [Remote host closed the connection]
millenialhacker has joined #asahi-dev
millenialhacker has quit [Ping timeout: 480 seconds]
Dcow has joined #asahi-dev
thelounge7571340 has joined #asahi-dev
thelounge7571340 has quit [Remote host closed the connection]
jlco_ has quit []
as400_ has joined #asahi-dev
as400 has quit [Remote host closed the connection]
jlco has joined #asahi-dev
as400_ is now known as as400
jlco has quit []
jlco has joined #asahi-dev
bisko has joined #asahi-dev
bisko has quit []
<sven> weird, I don’t see anything special when tracing macOS :/
<sven> no idea how it gets the HPD updates
bisko has joined #asahi-dev
bisko has quit []
millenialhacker has joined #asahi-dev
<millenialhacker> sven: naive question, there is no ring buffer / shared memory mapped between usb3 controller & AP?
<sven> uh... define usb3 controller
<sven> xhci has a bunch of rings
<sven> but that's entirely unrelated to the displayport HPD
<millenialhacker> Is the Display Port controlled by a dedicated processor right?
<millenialhacker> A co-processor* I mean
<sven> not really
<jannau> yes, that is dcp(ext)
<sven> :D
<sven> it's complicated ;)
<millenialhacker> I got confused yes or no? :D
<sven> dcpext controls parts of it. mainly the actual display stream and all the link training stuff
<sven> then there's atcphy which controls the actual physical layer
<millenialhacker> It may be possible that the status change you are looking for is exposed in a IRQ or ring buffer of a co-processor
<sven> and then there's this tps6598x chip that (among other things) negotiates the cable mode (e.g. usb3, dp altmode, etc.)
<sven> no
<millenialhacker> Is really weird you see no extra data in refs for tps chip
<millenialhacker> Everything points towards another comm channel, maybe a IO mapped register somewhere else
<sven> the tps chip can only speak i2c to the main SoC afaik
<millenialhacker> :(
thelounge7571340 has joined #asahi-dev
thelounge7571340 has quit [Remote host closed the connection]
millenia_ has joined #asahi-dev
<millenialhacker> Nothing happens on SPMI?
as400_ has joined #asahi-dev
as400 has quit [Remote host closed the connection]
<sven> hrm, it might be a GPIO but that would be a bit strange
<sven> oh, but then it would be in the ADT and last time I checked I didn't see anything there
<millenialhacker> Strange is a interesting word for Apple
as400_ is now known as as400
<jannau> the hdmi hpd on the macbook pro 14" is a gpio and in the adt
<millenialhacker> jannau what about MbP M1 ?
<jannau> so it seems to be unlikely that tps6598x uses a gpio without mention in the ADT
<sven> yeah
millenia_ has quit [Ping timeout: 480 seconds]
<sven> it's also a bit weird when they have a perfectly cable i2c bus and a gpio for the irq to waste another gpio on hpd
<sven> s/cable/capable/
Major_Biscuit has quit [Ping timeout: 480 seconds]
<jannau> the tps65987 data sheet says that it can be configured to use gpio3 for hpd when hpd is signaled through usb pd, see "8.3.8 DisplayPort HPD"
<sven> the TPS65987DDH datasheet claims there is an interrupt for changes to that DP SID register but it looks like that one just doesn't exist on the CD321X chips
<sven> hm.. but we'd still need the gpio configured in the ADT, wouldn't we?
<jannau> yes
<sven> maybe there's some magic configuration for the cd321x missing that somehow enables that DP SID interrupt
as400 has quit [Ping timeout: 480 seconds]
millenialhacker has quit [Remote host closed the connection]
millenialhacker has joined #asahi-dev
millenialhacker_ has joined #asahi-dev
millenialhacker_ has quit [Remote host closed the connection]
millenialhacker has quit [Ping timeout: 480 seconds]
as400 has joined #asahi-dev
millenialhacker has joined #asahi-dev
gladiac has quit [Quit: k thx bye]
as400 has quit [Ping timeout: 480 seconds]
millenialhacker has quit [Remote host closed the connection]
millenialhacker has joined #asahi-dev
<jannau> are missing interrupts only a problem with the usb3+dp hub? I see tps6598x irq on dp connect and disconnect with a sample usb-c to dp dongle
<sven> yes
<sven> it works fine on my usb-c to hdmi and my usb-c to dp cable
<sven> it only doesn't work with this USB3/DP hub that has a HDMI out when I disconnect the HDMI side
thelounge7571340 has joined #asahi-dev
<sven> #define APPLE_CD_DATA_STATUS_DP_HPD BIT(15)
<sven> that's what works for HPD in TPS_REG_DATA_STATUS most of the time
<sven> but for the usb3/dp hub it only transitions to 1 once and is then stuck there
<jannau> could it be that the dp to hdmi brigde in the hub keeps the dp connection up after the hdmi unplug?
<jannau> or maybe not up but in a weird state?
thelounge7571340 has quit [Remote host closed the connection]
jluthra has quit [Remote host closed the connection]
as400 has joined #asahi-dev
jluthra has joined #asahi-dev
<sven> yeah, pretty much
<sven> but the HPD state in that DP SID register does change
<sven> and macos somehow notices that the HDMI cable is disconnected and removes the display from system settings
<sven> #define TPS_REG_DP_SID0x58 <-- that thing is updated
thelounge7571340 has joined #asahi-dev
<sven> BIT(7) in byte 5 of that thing
<sven> I can just plug the hdmi in again and it recovers the connection
<sven> but I assume it will break if I e.g. plug in a different screen that can't work with the previously negotiated link
<sven> oh well, I think I'll spend some time to clean this up a bit tomorrow so that other people can play with it as well
<jannau> I guess I should then start looking into why dcpext0 doesn't work on m1 max/ultra
<sven> there's also the DT bindings, right now they are pretty hack as you will notice tomorrow
<sven> *pretty big
cylm has quit [Quit: WeeChat 3.7.1]
cylm has joined #asahi-dev
lamlam has joined #asahi-dev
<lamlam> millenialhacker: that's really nice work. thank you, it's helping me understand alot regarding the channels.
<lamlam> would not be surprised if it's the same team behind it. there's an entire apfs file-sharing protocol between the two. first ane wake is actually called by isp to init apfs lol.
<lamlam> also i boot guest w/ these ane-specific args added:
<lamlam> "amfi_allow_any_signature=1 enforceModelSignatureChecks=0 removeAuthCodeChecks=1 IOReportEnable=1 aneFWTrace=1 aneFWTraceBuffer=1 aneDebug=1 aneLogging=1"
<lamlam> not sure which is the culprit but am seeing some *really* detailed isp logs by ane (log show --last 5m --debug --info)... might help
as400 has quit [Ping timeout: 480 seconds]
as400 has joined #asahi-dev
thelounge7571340 has quit []
<povik> wait, what's that? how does ane/isp need to know anything about apfs?
os has quit [Ping timeout: 480 seconds]
ajv009 has quit [Remote host closed the connection]
millenialhacker has quit [Remote host closed the connection]
as400 has quit [Ping timeout: 480 seconds]
millenialhacker has joined #asahi-dev
<amarioguy> marcan: okay so preparing the v4 now (and testing it and all)
<amarioguy> since you authored the improved error recovery, i'm intentionally not including it in my v4 (my patch purely adds back the reg_write in the IRQ and increases the timeout) to preserve your authorship and all
<amarioguy> do we want to send both patches as a 2 patch series? (this seems like best option in my view - gets both in at the same time but i'm open to other views on this)
as400 has joined #asahi-dev
<amarioguy> reg_write in the IRQ handler*
millenialhacker has quit [Ping timeout: 480 seconds]
<sven> I’d just send your patch first, it strictly improves things
<sven> and then the error handling can come later and make things even better
<sven> I’d only send them as a single series if they are strongly related (e.g. new dt bindings or subsystem quirks/changes followed by a driver)
<jannau> I would also leave the error recovery patch out. it has little to do with the topic of this already in progress "series".
cylm has quit [Quit: WeeChat 3.7.1]
<jannau> some might prefer it though if the timeout increase and the irq change are two separate commits
<jannau> the justification to send them both together is that 10ms timeout breaks the typec chip on some apple silicon system in combination with faster processing with irqs
<sven> if you do decide to split the timeout off I’d make sure that patch comes first. otherwise the in between state is broken
<jannau> +1
os has joined #asahi-dev
<amarioguy> alright, i'll probably just keep the increased timeout on my patch here, it's just easier in that case
<amarioguy> going to do some testing here then it's off to the mailing lists (hopefully this time, we won't need a v5)
<amarioguy> (though in fairness i've seen v11 patches before, the SEV series was a lot lol)
<amarioguy> (think it was also the case for the tdx series lol)
lamlam has quit [Remote host closed the connection]
<amarioguy> one thing i do think should be clarified though - given that i'm keeping the timeout change should i also change the polled mode case?
cy8aer has quit [Remote host closed the connection]
<amarioguy> oh wait, my patch does that by default, nvm lol had a dumb moment
cy8aer has joined #asahi-dev
SSJ_GZ has quit [Ping timeout: 480 seconds]
<amarioguy> alright so i've formatted the patch, testing is good on the irq path, should be good to go
<amarioguy> just want to make sure i don't need to send a v5 lol
<amarioguy> so the changes are simply as such from v3 - added the reg_imask write in the irq handler, bumped the timeout to 100 ms
<amarioguy> commit message will simply be the description of the patch with the signed-off-by, changelog after the '---' and no tested-by tags
<amarioguy> sorry i just get a bit nervous, esp. now as this is the 4th time i've tried for upstreaming lol