ChanServ changed the topic of #asahi to: Asahi Linux: porting Linux to Apple Silicon macs | General project discussion | GitHub: https://alx.sh/g | Wiki: https://alx.sh/w | Topics: #asahi-dev #asahi-re #asahi-gpu #asahi-offtopic | Keep things on topic | Logs: https://alx.sh/l/asahi
tsida has quit [Remote host closed the connection]
al3xtjames has quit [Quit: Ping timeout (120 seconds)]
al3xtjames has joined #asahi
al3xtjames9 has joined #asahi
al3xtjames has quit [Ping timeout: 480 seconds]
al3xtjames9 is now known as al3xtjames
PhilippvK has joined #asahi
phiologe has quit [Ping timeout: 480 seconds]
skipwich has quit [Ping timeout: 480 seconds]
quarkyalice has quit [Ping timeout: 480 seconds]
TheJollyRoger2 is now known as TheJollyRoger
trippeh has quit [Quit: leaving]
tomtastic_ has joined #asahi
tomtastic has quit [Ping timeout: 480 seconds]
tsida has joined #asahi
tomtastic_ has quit [Ping timeout: 480 seconds]
bps has quit [Ping timeout: 480 seconds]
tomtastic has joined #asahi
tomtastic has quit [Ping timeout: 480 seconds]
tomtastic has joined #asahi
tomtastic_ has joined #asahi
tomtastic has quit [Ping timeout: 480 seconds]
tomtastic_ has quit [Ping timeout: 480 seconds]
tomtastic has joined #asahi
bps has joined #asahi
johnnywalkins has joined #asahi
aleasto has joined #asahi
bps has quit [Ping timeout: 480 seconds]
<sven> alright, i think i'm happy with dart/dev now. would be great if some people could test it to make sure everything still works and then i'll probably send v5 a week or so from now
yuyichao has quit [Remote host closed the connection]
yuyichao_ has joined #asahi
aleasto has quit [Ping timeout: 480 seconds]
aleasto has joined #asahi
aleasto has quit [Remote host closed the connection]
bps has joined #asahi
frode_0xa has joined #asahi
frode_0xa has quit []
frode_0xa has joined #asahi
Mary has quit [Quit: byeee]
amw has quit [Ping timeout: 480 seconds]
skipwich has joined #asahi
amw has joined #asahi
johnnywalkins has quit [Remote host closed the connection]
skipwich has quit [Quit: DISCONNECT]
skipwich has joined #asahi
skipwich has quit []
skipwich has joined #asahi
Mary has joined #asahi
everslick has quit [Ping timeout: 480 seconds]
<marcan> sven: hopefully I get back on a dev flow next week, and I want to spend a day or two poking at linux merge branches and testing all that stuff
<sven> the only thing that just works is the dart branch fwiw. the rest is in various state of broken and/or requires hacks :D
<sven> *states
<marcan> good reason to fix things!
<marcan> also I want to get my head around how we'd handle the DART lock situation
<sven> ugh, yeah. that's gonna be fun
<marcan> it should be doable, but annoying
<sven> for the rest of the branches.. i2c needs a gpio controller for the interrupt, pcie needs the dt bindings (i think kettenis submitted some but i don't want what their status is)+u-boot for the bringup+dart
<sven> and nvme kinda works if you boot through u-boot as well
<sven> *but i don't know what
<marcan> now might be a good time to start writing an ASC driver
<marcan> that would also bring up nvme
<sven> nvme needs ASC + SART
<sven> or, well, nvme needs ASC which usually goes through a DART but here is uses SART
<marcan> yeah
<marcan> what was the SART anyway? just some filters?
<sven> SART is just a dumb DMA address filter and i haven't thought about how to implement that
<sven> it's litterally 16x2 registers. first one is the address and second one is the lengths (+some flags)
<marcan> I was thinking we might as well have an apple nvme ASC driver that would also take care of that
<marcan> and then that instantiates or links with the actual nvme device
<sven> so the actual nvme device doesn't need SART actually
<marcan> yeah, this would just be a driver for the ASC instantiation for ANS
<sven> but yeah, maybe just a special compatible for the mailbox driver that whitelists the shared memory in SART
<marcan> really an ans driver
<marcan> or that
<marcan> does ANS have any endpoints other than the system stuff?
<sven> technically yes
<sven> but i haven't seen them being used
<sven> 0x20 and 0x21 i think
<marcan> any idea what they do?
<sven> nope
<sven> i haven't seen any traffic on them when running the hv
<sven> and i don't think we have the ANS firmware
<marcan> we do
<sven> where?
<marcan> or at least I swear I saw it
<sven> it's not in the preboot volume
<marcan> ansf.t8103.release.im4p in the restore ipsw
<sven> ah, that's where it's hidden
<sven> either way, we can just have a apple,mbox = <&ans_mbox 0x20>, <&ans_mbox 0x21>; or something like that in the nvme node. that should bring up ANS then. or maybe have it send a ping message to the asc and wait for the reply
<marcan> yeah, it probably makes sense to just have a special nvme subdriver that mostly does nothing
<marcan> do you think SART can be implemented as a really dumb passthrough only iommu?
<sven> nope
<sven> two reasons: there's only one iommu per bus and there's no domain type for "passthrough only"
<sven> the second one might be fixable, the first one would be painful to fix
<marcan> per bus?
<marcan> like for the whole arm soc bus?
<sven> yeah, one type(!) of iommu
<marcan> wait what
<marcan> why
<sven> i guess there was no need for more than one type so far?
<marcan> heh
<marcan> oh well, this can be an ugly special case in the ans driver then
<marcan> we could just throw ans in a sub-bus though
<marcan> dummy devtree buses are free
<sven> ah, true
<sven> hrm, though i guess i'd have to look up how to make that work. usually bus_set_iommu is called with platform_bus_type or pci_bus_type
<marcan> wait, are those singlets?
<sven> but i guess you could just call it with dev->bus for the ans device and it should do the right thing
<sven> yes
<marcan> argh
<marcan> so it's not even per bus instance, it's per bus type?!
<sven> no, i think platform_bus_type is just the "virtual" top-level bus for platform devices
<sven> but i haven't read much of that code yet
<marcan> /home/marcan/asahi/git/linux/drivers/iommu/arm/arm-smmu/arm-smmu.c: err = bus_set_iommu(&fsl_mc_bus_type, ops);
<marcan> there's definitely other cases, but it's rare
<marcan> like it needs a bus type
<marcan> so a bus driver
<marcan> I'm not sure we want to go there just for SART
<sven> i don't think so ;)
<sven> it's not really an iommu anyway
<marcan> meh, special case in ANS it is then
<sven> it's also only used inside the ANS afaict
<marcan> it can be a separate tiny driver referenced from ANS if we want, to make it less ugly
<marcan> er, from ASC
<sven> if it was used in multiple places we could probably implement our own dma_map_ops or something for it, but meh.
<marcan> yeah
<marcan> nah
<marcan> not worth it
<marcan> actually one way to do it would be to have the ASC driver just have a callback to set some kind of extra map_ops
<marcan> and then the (very simple) ANS driver knows about SART and sets that prior to calling init on the ASC device
<marcan> implementing SART internally
<sven> there's also the clock gates left to do
<sven> not very important because we can just turn them all on from m1n1, but uh.. i think we should have them at some point
tobikoch has quit [Quit: WeeChat 2.8]
pinskia has quit [Remote host closed the connection]
pinskia has joined #asahi
<alyssa> sven: initramfs.cpio.gz is now on your link list
<alyssa> not
<sven> oh, you can use whatever or nothing at all i think
<alyssa> ack
<sven> last time i tried to give it to you you wanted me to send you the busybox source code via snailmail :-P
<alyssa> usually i dont use initramfs, but there's not an nvme driver on here so errrr
<alyssa> Ah yes, that does sound like something I'd do.
tomtastic_ has joined #asahi
<alyssa> why does booting 1tr take so long
<sven> you could just use a usb stick for the rootfs with that kernel :P
<alyssa> nod, does that work?
<sven> it should
<sven> i think someone in here did that (amw maybe?)
<alyssa> alright, I think I have a debian arm64 rootfs kicking somewhere
tomtastic has quit [Ping timeout: 480 seconds]
<sven> you could also try to boot the kernel without that initrd at first
<sven> it'll die, but at least you should see something on the screen and/or your serial console
<alyssa> ok, your kernel boots
<sven> :)
<alyssa> (and immediate dies due to no rootfs, but that's what it should do)
<alyssa> 8 penguins, snazzy
<alyssa> so what's wrong with mine..
<sven> you did enable ARCH_APPLE, didn't you?
<alyssa> uhhh
<alyssa> y
<sven> hm. let me see if i can upload my .config
<alyssa> k diff'ing
<alyssa> let me reprovision this vps because please
<alyssa> sven: my kernel boots with your config :tada:
<sven> nice :)
<alyssa> sven: which usb ports work rn, just type-c?
<sven> yes
<sven> unless you want also mess around with u-boot, then you can also make the usb a ports work
<sven> oh, they also only work once. so better plug in the usb device before booting the kernel
<alyssa> nod
<alyssa> okay it sees my usb drive and partitions, but says no filesystem could mount root
<alyssa> `root=/dev/sda2 rootwait` is this wrong syuntax lol
<sven> i'm also not sure i have any filesystems enabled in my config fwiw
<alyssa> that could be it lol
<alyssa> let's see
<sven> i started with a pretty minimal .config
<alyssa> sure
<sven> i'd actually be surprised if any filesystem is enabled :D
<alyssa> lol enabled ext4
<alyssa> rebuilding
<sven> are you using the latest dart/dev btw? not that it matters, but i'd like more people to test the current version :)
<alyssa> no, but one thing at a time
<sven> sure
<alyssa> ok, progress. systemd is unhappy, looks like more .config stuff missing for proper debian
<sven> iirc someone had a .config that boots debian here a few days (weeks?) ago
<sven> i've been happy with busybox, userland is boring ;)
<cth451_desktop> (I'll be happy with a initrd sh, but no luck so far)
<cth451_desktop> maybe i should try strip down my initrd.
<alyssa> sven: you
<alyssa> you disabled unix sockets
<sven> :D
<sven> that's not true. i just didn't enable them!
<alyssa> sven: seeing a bunch of blk_update_request I/O errors btw
<alyssa> though that might just be FS corruption lmao
<sven> uh
<sven> what did you do to your fs?
<alyssa> it's a years old USB pendrive..
<alyssa> i dont know how to work efficiently with .config ugh
<alyssa> here let's try this new config.
<alyssa> why is this recompiling everything and why isn't ccache helping :V
<sven> hm
<alyssa> erm
<alyssa> cache hit rate 21.78 %
<sven> did you switch cpu page sizes?
<alyssa> i guess it is helping.
crabbedhaloablut has joined #asahi
loki_val_ has joined #asahi
loki_val has quit [Ping timeout: 480 seconds]
crabbedhaloablut has quit [Ping timeout: 480 seconds]
<alyssa> sven: With more config enabled, it's getting further but still hanging(?)
<alyssa> getting a USB disconnect, looks like
<alyssa> and then it reconnects as /dev/sdb instead of /dev/sda
<sven> uh.. that sounds strange
<sven> can you upload the log somewhere?
<alyssa> I don't have uart, this is onscreen
<sven> usb disconnect and reconnect shouldn't work at all :s
<alyssa> it's behind a hub
<sven> oh, okay
<sven> still very strange
<sven> can you take a photo? :D
<alyssa> sec, trying something
julianp[m] has joined #asahi
<alyssa> sometimes m1n1 boots (confirmed by usb) without the display ever coming on. ugh
<alyssa> oh and also
<alyssa> Waiting for reconnection... . Connected
<alyssa> m1n1.proxy.UartTimeout: Expected 1 bytes, got 0 bytes
<alyssa> though that might be buggy kenrel on my lapto
<sven> hrm, i've seen that happen when i try to chainload too early after a reboot. but that's kinda expected i think
loki_val_ has quit []
crabbedhaloablut has joined #asahi
<alyssa> race condition in m1n1?
<sven> the uart doesn't exactly have any flow control. so if i chainload too early it'll send the first request, the request will get lost and i will never get a reply
<sven> easily fixed with a highly sophisticated sleep 6 in my linux.sh :D
<kettenis> sven, the SART is already partly setup
<sven> yes, i know. it's just missing the entry for the shared mailbox buffers
<kettenis> u-boot adds entries for syslog/crashlog pages of the ASC
<kettenis> you want to move that into m1n1?
<sven> i don't have any plans
<kettenis> or is this just for playing around with this
<sven> i mean, i could move it into mini, but does that buy us anything?
<kettenis> nothing from my point of view ;)
<kettenis> so after processing a few more mailbox messages in u-boot I don't see any further messages when using NVMe in OpenBSD
<kettenis> I also have a workaround for the hangs I was seeing, so I can actually run off the NVMe and do a full build of the OS now
<sven> nice :)
<sven> what were those hangs caused by?
<kettenis> don't know unfortunately
<sven> hm
<kettenis> but they disappear if I don't issue multiple commands in parallel
<kettenis> so I suspect the code we have that deals with the weird way apple does the command queues isn't quite right yet
<sven> hm, ok
<sven> what was the last status of those pcie bindings you submitted btw.?
<kettenis> still waiting for maz to bless the MSI stuff
<kettenis> maybe I should do a respin to fix the unneeded include issue that was spotted in v4
<kettenis> someone threw me a riscv curveball so that has distracted me a bit
<sven> :-)
<kettenis> looks like the pinctrl binding has made it into linus' tree
<sven> nice!
<kettenis> at some point we'll need to coordinate changes to the actual device tree
<sven> the dart binding has been reviewed as well. i'll probably need one or two more versions for the driver itself though
<kettenis> so maybe I should try to move u-boot over to your dart bindings then
<sven> yeah, i don't expect it to change anymore
<alyssa> sven: Just updated to the new version
<alyssa> the stacktrace isn't there but the bug still is
<alyssa> New version isn't any more broken anyway
<alyssa> also curious, it takes 90 seconds for "random: crng init" ? that's questionable
<sven> that's... good i guess? :D
<sven> did you try bypass mode? if that also has the bug it's not inside the dart driver
<alyssa> it still won't boot to a shell for me
<alyssa> oh uhhhh
<alyssa> bypass mode is still broken
<sven> make sure your kernel has 45d39448b4d0260743f25d88fd929451ec8296f2, otherwise dwc3 can't do 64 bit reads/writes
<sven> erm
<sven> *64bit DMA
<alyssa> uhh
<sven> should be in 5.14
<alyssa> dont have it
<sven> ah, wait
<sven> xhci. nevermind.
<sven> erm.. wait..
<sven> dwc3 probe should fail without that one i think
<alyssa> wait do i have it uh
<sven> clearly we're professionals here :-P
<alyssa> I do have the patch just didn't see it at first because of shallow clone
<sven> but if you also get the same bug in bypass mode it's outside of the dart driver
<alyssa> yeah
<sven> phew :)
<alyssa> sven: I have a more specific symptom now -- sometime during boot, the USB device (hub) itself gets disconnected -- like, power cut -- then immmediately reconnecetd
<alyssa> and then presumably the reconnect fails due to PHY nonsense
<alyssa> but the disconnect is itself visible -- the LED on my mouse cuts out
<alyssa> although, no, maybe not PHY
<sven> uh
<alyssa> hold on
<alyssa> ok curious
<alyssa> usb-a flash drive --> usb-a hub --> usb-c port behaves differently than usb-a flash drive --> usb-c port
<alyssa> it's still not running my init, even though nothing seems wrong
<alyssa> it has "VFS: Mounted root..." and "Run /bin/sh as init process", but no shell
<alyssa> unless that's just missing keyboard and the shell is over UART or something
<sven> i've only been using a shell over uart
<alyssa> oh maybe it's just super slow
<sven> uh, that would also be weird
<alyssa> i mean. yes.
<alyssa> sven: okay yeah there's definitely something screwed up with my hub
<alyssa> now it's in a loop of connected/disconnecting usb over on over yikes
<alyssa> this is bizarre
<sven> sounds like a normal day when you're using usb
<alyssa> maybe it's underucrrent
<alyssa> underpowered
<alyssa> seems odd
<alyssa> Benson help
<kettenis> I would expect apple to provide a decent amount of power through the type-C ports
<alyssa> might be a crummy hub though
<sven> not sure if we need to do something special (like sending another message to that pd chip) for hi-power modes though
<alyssa> Using an externally powered hub "fixes" the problem.
<alyssa> ok, next up, figure out what I need for usb ethernet
<alyssa> ("is this all for a twitter pic?" "definitely")
jabashque has quit [Quit: Connection closed for inactivity]
yrlf has quit [Quit: The Lounge - https://thelounge.chat]
yrlf has joined #asahi
<alyssa> enabled the CONFIG so now it sees the interface, still not resolving.