#asahi-dev · 2022-10-12 11:25
svenI don't think that would work :D#asahi-dev · 2022-10-12 11:23
svenbut it doesn't use dma-iommu#asahi-dev · 2022-10-12 11:23
svenyes, nvme is behind something called SART that vaguely resembles an iommu#asahi-dev · 2022-10-12 11:21
svenso whenever you get a large transfer that warning will fire#asahi-dev · 2022-10-12 11:21
sven64K seems to be the default max sg list length but the nvme controlelr can do more than that#asahi-dev · 2022-10-12 11:21
svensounds like the first issue to me ;)#asahi-dev · 2022-10-12 11:21
sven * whoever generated the list forgot to check them.#asahi-dev · 2022-10-12 11:21
sven * Either the driver forgot to set dma_parms appropriately, or#asahi-dev · 2022-10-12 11:20
svennot sure it needs that, let me check what that does#asahi-dev · 2022-10-12 11:20
svendma_set_min_align_mask is a few lines above in pci.c#asahi-dev · 2022-10-12 11:19
svenyeah, sounds about right#asahi-dev · 2022-10-12 11:18
svenpretty sure apple.c just needs https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/drivers/nvme/host/pci.c#n2850 as well#asahi-dev · 2022-10-12 11:17
svenrmk: er, sorry, I meant "it doesn't use dma-iommu"#asahi-dev · 2022-10-12 11:17
svenyeah... pci.c calls dma_set_max_seg_size(dev->dev, 0xffffffff); which I must've dropped when writing apple.c by accident #asahi-dev · 2022-10-12 11:16
svenI guess dma_get_max_seg_size falls back to SZ_64K#asahi-dev · 2022-10-12 11:14
svenI don't think I ever ran a kernel with that#asahi-dev · 2022-10-12 11:14
svenlooks like that warning is only triggered when DMA_API_DEBUG_SG is enabled#asahi-dev · 2022-10-12 11:14
svennvme doesn't use dma-api#asahi-dev · 2022-10-12 11:14
sveni'd be surprised#asahi-dev · 2022-10-12 11:13
svensounds like a bug somewhere in the nvme code then#asahi-dev · 2022-10-12 11:13
svenhuh, interesting. i never saw it#asahi-dev · 2022-10-12 11:12
svenmaybe that warning was only introduced in 6.0?#asahi-dev · 2022-10-12 11:10
svenhuh, nvme isn't behind an iommu (well, at least from dmaapi's point of view) so that should be unrelated to the 4k patch#asahi-dev · 2022-10-12 07:10
svenoh... nvm. that happens in afk_epic_rx_ack#asahi-dev · 2022-10-12 07:06
svenmarcan: https://github.com/AsahiLinux/m1n1/blob/main/src/afk.c#L257 i'm a bit confused by that code. shouldn't it always update rptr and not only when the buffer wraps around?#asahi-dev · 2022-10-12 06:27
svenyeah, __TEXT is mapped inside DAPF iirc#asahi-dev · 2022-10-11 15:42
svenI’ll push what I have later this week#asahi-dev · 2022-10-11 15:42
svenprobably hard to fix that blindly ;)#asahi-dev · 2022-10-11 15:38
svenI also have a better idea how DCP and atcphy will interact. Just need to figure out the typec/tps6598x part now#asahi-dev · 2022-10-11 15:37
sveni got some initial afk code working btw., seems to be able to talk to the system endpoint and enable extra logging. I’ll try to get dptx up next #asahi-dev · 2022-10-11 15:33
svenbut yeah, if it’s real hardware I agree #asahi-dev · 2022-10-11 15:33
svenI dunno what piodma is, I just saw the slightly awkward way the DCP driver currently deals with it ;)#asahi-dev · 2022-10-11 15:22
svenhmm… i guess it actually was in a downstream tree :/#asahi-dev · 2022-10-11 15:21
svennvm, I just confused myself #asahi-dev · 2022-10-11 15:21
svenEr, no#asahi-dev · 2022-10-11 15:21
sventegra_smmu_configure I think#asahi-dev · 2022-10-11 15:18
svenhmmm… don’t think so. maybe I saw it in some downstream tree#asahi-dev · 2022-10-11 15:08
svennot sure which approach is better#asahi-dev · 2022-10-11 15:07
svenit’s a bit of a hack since you have to manually create the fwnodes but so is that fake piodma device I guess #asahi-dev · 2022-10-11 15:05
sventhere‘s something in drm (tegra maybe?) that does something similar iirc#asahi-dev · 2022-10-11 15:05
svenfwiw, it’d also possible to manually create a new device and attach it to some apple,piodma-iommu#asahi-dev · 2022-10-11 11:50
svenshould still be much easier to get a rust binary into a initramfs than an entire Python distribution #asahi-dev · 2022-10-11 11:45
sventhe tricky part is in dma-iommu and I don’t think that change much #asahi-dev · 2022-10-08 21:19
svenand just to be sure: you are using a full macOS install where you replaced the kernel manually with m1n1, aren’t you?#asahi-dev · 2022-10-08 21:18
svendoes the kernelcache match the installer macOS?#asahi-dev · 2022-10-08 21:10
svenI‘d probably just write a userspace program tbh#asahi-dev · 2022-10-08 21:09
svenit’s inside that nor flash, isn’t it?#asahi-dev · 2022-10-08 11:56
svenand yeah, I can confirm that DCP contains lots of madness #asahi-dev · 2022-10-08 11:55
svenamarioguy: SEP IPC should be backwards compatible since you can’t downgrade its firmware which is shared across all installs #asahi-dev · 2022-10-08 11:54
svenjannau: no, only tested it with my Mac mini