#asahi-dev · 2023-04-10 20:01
kettenis_s/know/now/ s/startx/starts/#asahi-dev · 2023-04-10 20:01
kettenis_but they know start at offset 0xc000 in the region that startx at 0x59e000000#asahi-dev · 2023-04-10 20:00
kettenis_those used to start at offset 0x84000 in the "rc" register region#asahi-dev · 2023-04-10 19:59
kettenis_in particular, the CORE_LANE_* registers#asahi-dev · 2023-04-10 19:59
kettenis_so it seems they just moved the registers around a bit#asahi-dev · 2023-04-10 19:56
kettenis_usb0 at xhci0: USB revision 3.0#asahi-dev · 2023-04-10 19:55
kettenis_xhci0 at pci3 dev 0 function 0 "ASMedia ASM2142 xHCI" rev 0x00: msi, xHCI 1.10#asahi-dev · 2023-04-10 19:55
kettenis_pci3 at ppb2 bus 4#asahi-dev · 2023-04-10 19:55
kettenis_ppb2 at pci0 dev 3 function 0 "Apple M1 PCIe" rev 0x01#asahi-dev · 2023-04-10 19:55
kettenis_vendor "Aquantia", unknown product 0x04c0 (class network subclass ethernet, rev 0x03) at pci2 dev 0 function 0 not configured#asahi-dev · 2023-04-10 19:55
kettenis_pci2 at ppb1 bus 3#asahi-dev · 2023-04-10 19:55
kettenis_ppb1 at pci0 dev 2 function 0 "Apple M1 PCIe" rev 0x01#asahi-dev · 2023-04-10 19:55
kettenis_vendor "Broadcom", unknown product 0x5f72 (class network subclass miscellaneous, rev 0x04) at pci1 dev 0 function 1 not configured#asahi-dev · 2023-04-10 19:55
kettenis_vendor "Broadcom", unknown product 0x4434 (class network subclass miscellaneous, rev 0x04) at pci1 dev 0 function 0 not configured#asahi-dev · 2023-04-10 19:54
kettenis_pci1 at ppb0 bus 1#asahi-dev · 2023-04-10 19:54
kettenis_ppb0 at pci0 dev 0 function 0 "Apple M1 PCIe" rev 0x01#asahi-dev · 2023-04-10 19:54
kettenis_pci0 at aplpcie0#asahi-dev · 2023-04-10 17:53
marcannow I really need to sleep :p#asahi-dev · 2023-04-10 17:53
marcanI hope I didn't break anything#asahi-dev · 2023-04-10 17:53
marcanjannau: pushed#asahi-dev · 2023-04-10 17:53
marcan*finally* it works with that#asahi-dev · 2023-04-10 17:51
marcanack#asahi-dev · 2023-04-10 17:51
robhermarcan: Again, talk to Robin as he understands the IOMMU interaction much better than I do.#asahi-dev · 2023-04-10 17:50
marcanyou do (with a warning), but for 64bit it overflows the size and breaks#asahi-dev · 2023-04-10 17:49
robhermarcan: I think for 32-bit sizes we handle that case (DT with ~0 size).#asahi-dev · 2023-04-10 17:48
marcan*working around#asahi-dev · 2023-04-10 17:48
marcanwe shouldn't be working Linux silliness in the device tree#asahi-dev · 2023-04-10 17:48
marcandma-ranges = <0 0 0 0 0xffffffff 0xfffffffe>; I guess? This feels silly.#asahi-dev · 2023-04-10 17:48
marcan(since it gets adjusted)#asahi-dev · 2023-04-10 17:48
marcanand dma-ranges = <0 0 0 0 0xffffffff 0xffffffff>; does not work because it overflows then fails the zero check#asahi-dev · 2023-04-10 17:47
marcanheh it's actually impossible to declare all 64-bit AS as dma-ranges because 1<<64 does not fit in a u64#asahi-dev · 2023-04-10 17:46
jannauI think we ought to set dma-ranges although it's counterintuitive since the iommu dt bindings say it will be ignored if we use the iommu#asahi-dev · 2023-04-10 17:44
marcanand that breaks because those ops see that the device is asking for 32 bits and the IOMMU *cannot support that* (because its range is restricted to only a higher aperture than the low 32 bits)#asahi-dev · 2023-04-10 17:44
robherby default#asahi-dev · 2023-04-10 17:44
marcanyes, but that isn't working because that OF codepath is calling arch_setup_dma_ops/iommu_setup_dma_ops with a 32bit mask *before* that can happen#asahi-dev · 2023-04-10 17:44
robherWith an iommu in the middle, I don't know if you can get all 64-bits.#asahi-dev · 2023-04-10 17:43
robherA device that supports >32bit should set their mask to what they support (at the device, ignoring bus level restrictions)#asahi-dev · 2023-04-10 17:41
marcanbut also isn't that kind of backwards? what I want is drivers to be able to set their own DMA mask and OF not get in their way by clamping it further#asahi-dev · 2023-04-10 17:41
robherAs for the specifics in of_dma_configure_id(), that's a conversation to have with Robin who is not here.#asahi-dev · 2023-04-10 17:41
marcanhow do you get "all 64bit"?#asahi-dev · 2023-04-10 17:40
robhermarcan: generally, if you want anything other than all 32bit or all 64bit, then you need to use dma-ranges. #asahi-dev · 2023-04-10 17:39
marcanIMO the default size in that function should be 64-bit on 64-bit platforms period; the actual dma_mask can remain 32-bit by default of course#asahi-dev · 2023-04-10 17:39
marcanput another way: of_dma_configure_id() is doing something fairly silly, taking the device DMA mask as a default size (or 32bit if not set), then clamping the DMA mask to that again#asahi-dev · 2023-04-10 17:37
marcan(only, that's all the max is used for, which is why this hasn't actually broken everyone by *forcing* 32bit DMA for everything)#asahi-dev · 2023-04-10 17:37
marcanthe problem is not the default, it's that the OF code is running before that default can be overridden and then eventually that codepath ends up in a sanity check that we fail#asahi-dev · 2023-04-10 17:37
marcanrobher: ^^#asahi-dev · 2023-04-10 17:37
robhermarcan: a default greater than 32-bit mask would break lots of things. #asahi-dev · 2023-04-10 17:37
marcanalso I think the reason nobody noticed this yet is that the subsequent arch_setup_dma_ops -> iommu_setup_dma_ops codepath only uses the size for a sanity check, it doesn't keep it anywhere. so it will pass as long as IOMMUs will at least *support* the 32-bit DMA range, and we're probably the first one that doesn't when we specify a restricted high aperture.#asahi-dev · 2023-04-10 17:32
marcanrobher: the call chain here is really_probe -> platform_dma_configure -> of_dma_configure_id. that ends up pulling a default 32-bit DMA mask since the device driver probe() hasn't run yet. that seems wrong.#asahi-dev · 2023-04-10 17:30
marcangoing to do this for now pending robher's response