#asahi-dev · 2023-09-08 16:41
kevans91maz: oh yeah, sorry, didnt mean to give that impression; I'll store them somewhere safe just in case a need arises, I just won't keep broadcasting it here. that works for me, thanks#asahi-dev · 2023-09-08 16:28
mazkevans91: don't throw them away -- if someone asks, we can always direct them to you.#asahi-dev · 2023-09-08 15:14
kevans91noting at a different time of this day, and probably the last time: I have three of the v3.1 central scrutinizer PCBs unpopulated showing up what looks like tomorrow from OSHPark if anyone's interested in them (for just the cost of shipping to you)#asahi-dev · 2023-09-08 13:17
svenhm, true. weird.#asahi-dev · 2023-09-08 13:14
marcanhttps://oftc.irclog.whitequark.org/asahi-dev/2023-04-10#32054931#asahi-dev · 2023-09-08 13:14
marcanif no dma-ranges are specified#asahi-dev · 2023-09-08 13:14
marcanthat is the broken code that runs before the probe() gets called, which means the DMA mask is unset, then defaults to 32bit#asahi-dev · 2023-09-08 13:14
marcansven: see of_dma_configure_id#asahi-dev · 2023-09-08 13:12
svenor maybe that was just a bug that was fixed at some point #asahi-dev · 2023-09-08 13:12
sveni thought with an iommu enabled the iommu would fully decide virt/phys mapping instead of dma-ranges which is used without an iommu #asahi-dev · 2023-09-08 13:11
svenhrm, maybe I remember it wrong then #asahi-dev · 2023-09-08 13:11
marcansomewhere in the OF/whatever code was defaulting to 32bit range if dma-ranges is not present#asahi-dev · 2023-09-08 13:10
marcanto get it to (mostly) allow 64bit dma#asahi-dev · 2023-09-08 13:10
marcanbecause end=0xffffffffffffffff will actually overflow into 0 in the code #asahi-dev · 2023-09-08 13:10
marcanwe had to add this ridiculous hack: dma-ranges = <0 0 0 0 0xffffffff 0xffffc000>;#asahi-dev · 2023-09-08 13:10
marcanwithout dma-ranges#asahi-dev · 2023-09-08 13:10
marcanthere's a stupid 32bit limit that creeps in and was clamping everything to 4GiB, that I remember#asahi-dev · 2023-09-08 13:09
marcansven: also dma-ranges is NOT ignored#asahi-dev · 2023-09-08 13:09
marcanah yeah maybe that was it, I was trying to use the dma_mask to limit iommu page table levels and failing miserably#asahi-dev · 2023-09-08 11:31
svenso i guess "new from the factory" actually means "stripped from some broken apple mainboard"#asahi-dev · 2023-09-08 11:31
svenlol, my cd3217/8 "new from the factory" chips arrived from china and they are obviously reballed :D#asahi-dev · 2023-09-08 11:26
svenso dma_set_mask_and_coherent is for device limits (e.g. this device has only 36 address bits for dma) while the iommu domain aperture is for iommu limits (e.g. only 32bit of the device address lines are actually connected to the iommu)#asahi-dev · 2023-09-08 11:24
svenyeah, from what i can tell dma-iommu.c respects the dma mask set by dma_set_mask_and_coherent#asahi-dev · 2023-09-08 11:22
svenif that 36bit thing indeed is an iommu limitation and not just a limitation of the dma device i guess#asahi-dev · 2023-09-08 11:21
sventhat makes more sense#asahi-dev · 2023-09-08 11:20
jannauit does, I think the issue was to limit dart and iopgtbl to 36 bits / 3 levels#asahi-dev · 2023-09-08 11:19
svenbut then again, dma-ranges is ignored when an iommu is present#asahi-dev · 2023-09-08 11:19
sveniirc dma_set_mask_and_coherent is meant to express "this device can handle n bits of dma address" independently of whatever the iommu does#asahi-dev · 2023-09-08 11:17
svenhuh, dma set coherent should work independently of the iommu subsystem I thought #asahi-dev · 2023-09-08 11:09
jannauI think we have also a zero apple,asc-dram-mask in the t600x dtsi#asahi-dev · 2023-09-08 11:07
marcanwe need to get rid of the remaining users of apple,asc-dram-mask, I think only t8103 dcp has anything nonzero there and should be changed to dma-range (and then this removes a bunch of code from dcp)#asahi-dev · 2023-09-08 10:56
marcanand there's logic in the DART code that allows address space truncation (which is what the hardware does) as long as the range is smaller than the DART address space and does not straddle natural boundaries#asahi-dev · 2023-09-08 10:56
marcanthat's why we now have apple,dma-range = <0x100 0x0 0x10 0x0>;#asahi-dev · 2023-09-08 10:54
marcanI spent way too long figuring this mess out#asahi-dev · 2023-09-08 10:54
marcansven: turned out that function is useless because by the time the driver probe() is called, the iommu aperture is already initialized#asahi-dev · 2023-09-08 10:48
marcanand MTP too I think#asahi-dev · 2023-09-08 10:48
marcanIIRC I made DCP use that (which fixed a bunch of weird)#asahi-dev · 2023-09-08 10:07
_jannau__not sure if we already use it somewhere#asahi-dev · 2023-09-08 10:06
_jannau__we added dart dts properties to limit the aperture as well. basicly the same as vm-base, vm-size in the adt#asahi-dev · 2023-09-08 10:00
svendma_set_mask_and_coherent is the thing he's talking about fwiw#asahi-dev · 2023-09-08 03:32
marcanand yeah, for ane you're allowed to use the drm_mm stuff if necessary since that's in accel/ which is morally drm, so if it makes sense there I wouldn't worry about it, but for ISP it'd be nice (and probably simplify things quite a bit) to switch back to the regular iova allocator#asahi-dev · 2023-09-08 03:31
marcanpresumably it doesn't matter where in that AS you allocate, right?#asahi-dev · 2023-09-08 03:30
marcanyou can tell the iommu stuff how many bits of address space you have, then it'll restrict itself to that range#asahi-dev · 2023-09-08 03:30
marcaneiln: does it need to be bottom up?#asahi-dev · 2023-09-07 19:07
ah-i've got one fix for the mbox addr: https://github.com/ah-/kernel-asahi/commit/1f303f442dfe7fd74d1224389b2e91748422666f and a few for isp_ctrr_init to match the macos trace: https://github.com/ah-/m1n1/commit/03927f4f343c4b261d388fdcfd4a2503af272039#asahi-dev · 2023-09-07 19:05
ah-i was staring at the macos trace a bit (https://textbin.net/raw/dwnb1wyhud) and latest theory is that the boot_args data is somehow different. I can see the place where it writes the bootargs addr to the gpio, but the contents look different. e.g. I can't find args.unk_size = 0x1800000 or args.unk5 = 0x40; in the macos trace#asahi-dev · 2023-09-07 19:02
ah-still getting the same "ISPASC: ASSERT: ./h10isp/common/misc/H13/CSystemConfiguratorConnectivityH13Jade.cpp, 472: 0" and then timeouts with ctrr_size=0xf00000#asahi-dev · 2023-09-07 19:02
ah-eiln: was kinda fun playing with m1n1 and debugging this all a bit#asahi-dev · 2023-09-07 18:53
svenlike, does that dma go through some additional path or whatever because the device can’t handle that many bits in the dma address??#asahi-dev · 2023-09-07 18:52
svendma to higher iovas is *slower*? how the hell did they mess that up