#
…

2023-04-11

00:00deteg1337 has joined #asahi-dev
00:08deteg1337 has quit [Ping timeout: 480 seconds]
00:15stsmwg has joined #asahi-dev
00:32deteg1337 has joined #asahi-dev
00:40deteg1337 has quit [Ping timeout: 480 seconds]
00:49deteg1337 has joined #asahi-dev
00:50hightower2 has joined #asahi-dev
00:57deteg1337 has quit [Ping timeout: 480 seconds]
01:23deteg1337 has joined #asahi-dev
01:28stsmwg has quit [Quit: Lost terminal]
01:31leah2 has quit [Ping timeout: 480 seconds]
01:32deteg1337 has quit [Ping timeout: 480 seconds]
01:41deteg1337 has joined #asahi-dev
01:49deteg1337 has quit [Ping timeout: 480 seconds]
01:49greguu has quit [Ping timeout: 480 seconds]
01:56deteg1337 has joined #asahi-dev
01:58raveling has quit [Ping timeout: 480 seconds]
02:00greguu has joined #asahi-dev
02:04leah2 has joined #asahi-dev
02:04deteg1337 has quit [Ping timeout: 480 seconds]
02:05marcanjannau: m1n1 gets the links up at least I think, so linux probably takes them down during its init (and then fails to do the right dance to bring them up again)
02:29deteg1337 has joined #asahi-dev
02:37deteg1337 has quit [Ping timeout: 480 seconds]
03:02deteg1337 has joined #asahi-dev
03:10deteg1337 has quit [Ping timeout: 480 seconds]
03:17A_L_I_C_E has quit [Read error: Connection reset by peer]
03:18A_L_I_C_E has joined #asahi-dev
03:19deteg1337 has joined #asahi-dev
03:27deteg1337 has quit [Ping timeout: 480 seconds]
03:53deteg1337 has joined #asahi-dev
04:01deteg1337 has quit [Read error: Connection reset by peer]
04:08deteg1337 has joined #asahi-dev
04:15Thsf has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
04:16deteg1337 has quit [Ping timeout: 480 seconds]
04:26deteg1337 has joined #asahi-dev
04:26A_L_I_C_E has quit [Quit: Quit]
04:26A_L_I_C_E has joined #asahi-dev
04:34deteg1337 has quit [Ping timeout: 480 seconds]
04:50A_L_I_C_E has quit [Remote host closed the connection]
04:58deteg1337 has joined #asahi-dev
05:08deteg1337 has quit [Ping timeout: 480 seconds]
05:17deteg1337 has joined #asahi-dev
05:27deteg1337 has quit [Ping timeout: 480 seconds]
05:45dottedmagjannau: Would you like to see the more traces from that two-tile 5K monitor, or the ones I made last year are enough to understand how M1 drives it?
05:54deteg1337 has joined #asahi-dev
06:07deteg1337 has quit [Ping timeout: 480 seconds]
06:10newiz has joined #asahi-dev
06:10newiz has quit [Quit: Konversation terminated!]
06:11MajorBiscuit has joined #asahi-dev
06:18Hibyehello_ has joined #asahi-dev
06:18Hibyehello has quit [Read error: Connection reset by peer]
06:19marcanok, re pcie, more registers moved individually, so this is going to be a proper device variant now
06:21deteg1337 has joined #asahi-dev
06:24i509vcb has quit [Quit: Connection closed for inactivity]
06:31chadmed_ has quit [Remote host closed the connection]
06:33jannaudottedmag: that's a thunderbolt display? thanks but not at this time. m2* mac mini hdmi out has priority
06:34dottedmagjannau: Yep, TB. OK.
06:34jannaure pcie: shifting registers to make space for more ports?
06:36marcanper port changed too
06:36marcanrid2sid got moved out, presumably to make a lot more space there
06:36marcanthis is probably Mac Pro related, they're preparing for real general purpose PCIe slots
06:46marcanlooks like MSIs changed too, there's now a table thing
07:04nafod has quit [Quit: Ping timeout (120 seconds)]
07:04nafod has joined #asahi-dev
07:05deteg133_ has joined #asahi-dev
07:12deteg1337 has quit [Ping timeout: 480 seconds]
07:17bps has joined #asahi-dev
07:18A_L_I_C_E has joined #asahi-dev
07:25alex_ has joined #asahi-dev
07:26alex_certainly worth looking for USB4 eGPU support there then
07:26alex_ has quit []
07:27nyilas has joined #asahi-dev
07:33nyilas has quit [Remote host closed the connection]
07:34nyilas has joined #asahi-dev
07:34nyilas has quit [Remote host closed the connection]
07:38nyilas has joined #asahi-dev
07:41arekm has quit [Quit: leaving]
07:42arekm has joined #asahi-dev
07:51raveling has joined #asahi-dev
08:07deteg133_ has quit [Remote host closed the connection]
08:08deteg1337 has joined #asahi-dev
08:28marcanpushed a bunch of stuff to linux/m1n1 on t602x/bringup for both, but pcie still doesn't work :/
08:31marcanok, config space is fully dead so something is wrong here
08:44marcanaaaaargh, it's the power gate
08:44marcan[ 1.341841] pci 0000:02:00.0: [17a0:9755] type 00 class 0x080501
08:44marcanpushed, will clean up the commits later
08:45marcan# [ 46.861422] mmc0: new ultra high speed SDR104 SDXC card at address 59b4
08:45marcan[ 46.878307] mmcblk0: mmc0:59b4 ED2S5 119 GiB
08:45marcan[ 46.894306] mmcblk0: p1
08:45marcansd card reader works even :)
08:46marcanok, so now really just DCP/GPU left (and wifi I guess, we'll see how bad the new chips are)
08:46_jannau_DCP might just work on the macbooks
08:47marcando you have m1n1 changes?
08:48marcanwe need the reserved-regions stuff right?
08:53nsklaus has joined #asahi-dev
09:12mkurz has quit [Ping timeout: 480 seconds]
09:14tanty has quit [Remote host closed the connection]
09:16tanty has joined #asahi-dev
09:17kettenis_marcan, jannau: regarding reserved-regions, I noticed that U-Boot complained about reserved regions with size 0
09:19kettenis_ERROR: reserving fdt memory region failed (addr=0 size=0 flags=0)
09:20kettenis_guess that is because the dcp setup stuff in m1n1 doesn't run?
09:29kettenis_marcan: added two comments to https://github.com/AsahiLinux/linux/commit/7400cf11996a4715f65a64949db1b0cf407268a9 for things that you probably want to fix when cleaning up the linux pcie diff
09:29_jannau_yes, probably due to DCP setup issues on m2 (pro) mini. not intended to end up with empty reserved regions
09:30kettenis_U-Boot runs so we can wait until DCP is fixed
09:33raveling has quit [Ping timeout: 480 seconds]
09:55raveling has joined #asahi-dev
09:59hightower3 has joined #asahi-dev
10:06hightower2 has quit [Ping timeout: 480 seconds]
10:21marcanpushed the m1n1 changes back to main, hope I didn't regress the other socs :p
10:23cylm_ has joined #asahi-dev
10:26* svenshould get back to staring at thunderbolt
10:29jannaupcie devices show up on the m2 pro mini but there's an interrupt storm of translation errors for pcie0_dart_2
10:29jannauapple-dart 596000000.iommu: translation fault: status:0x80180004 stream:1 code:0x4 (NO PMD FOR IOVA) at 0x1001e2a0000
10:31jannaudevices are non-functional as far as I can tell
10:38jannaukettenis_: the GPU is at least to blame as well "OF: fdt: Reserved memory: failed to reserve memory for node 'uat-handoff': base 0x0000000000000000, size 0 MiB"
10:40marcanjannau: that fault has a physical address, something went wrong with the DMA mappings if devices are hitting physical
10:40marcanpossibly DMA mapping failed entirely and it's trying and failing to use passthrough
10:41jannaut602x/bringup (2dfa86cad319) lost the pcie changes
10:44marcanyeah I know
10:44marcanworking on it
10:54marcanwat, I lost the screen now
10:55marcanjannau: the m1n1 change (without any kernel change) broke the screen :D
10:55marcanI bet I know what this is
10:56marcanhm no, we do have no-map
10:56marcaninteresting...
10:56marcanreally interesting...
10:57raveling has quit [Read error: No route to host]
10:59jannaumarcan: does it screw up the mapping tables?
10:59raveling has joined #asahi-dev
10:59jannautry making dart_setup_pt_region() a no-op
11:00jannauit's confused by dart-disp0 sid 0 starting at l2 idx 2 instead of 0
11:01jannauI thought that was just during fb mapping in display.c
11:01marcanwhat I don't get is why it only happens after the m1n1 change
11:02jannaubecause we don't touch the darts without the m1n1 change
11:03jannaudart_setup_pt_region() is only called from dcp_init() so it shouldn't be used
11:03marcanisn't it just dart_get_mapping?
11:05marcanah but that does do dart_init
11:06marcanoh wait, the locked check
11:08marcanbut no, that wasn't it...
11:08jannaudoes it lock dart-disp0?
11:09jannauwhen does the screen break? during linux dart probe or earlier?
11:10marcanI think it's during Linux dart probe
11:13jannauthe reserved mem code seems to be broken with 4 levels in a way I do not understand
11:14jannauI didn't try hard though since the locked dart io-pgtbl interaction needs to be rewritten
11:15marcanwith your patches it worked
11:15marcanso it's the 4-level thing then
11:20marcanjannau: isn't it just that if it's locked we can't change the TCR/TTBR level config so we need to just inherit?
11:22raveling has quit [Read error: Connection timed out]
11:24jannauthat sounds plausible
11:30deteg1337 has quit [Remote host closed the connection]
11:35deteg1337 has joined #asahi-dev
11:41deteg133_ has joined #asahi-dev
11:43hightower3 has quit [Remote host closed the connection]
11:44deteg1337 has quit [Ping timeout: 480 seconds]
11:44jannaumarcan: pcie is confused by disabling port01. ethernet and usb xhci work if port01 is left enabled. pcie0_dart_1 needs to be disabled though. SErrors on probe
11:48marcanjannau: left enabled as in the DT?
11:49deteg133_ has quit [Ping timeout: 480 seconds]
11:50marcansounds like a pcie bug
11:50jannaulooks like the dart <-> port mapping breaks if there are gaps in the ports
11:50jannauor an OF iommu/pcie bug
11:50kettenis_so the iommu-map uses bus numbers
11:51kettenis_if there is a gap in the ports but not a corresponding gap in the bus numbers that would explain the issue
11:52jannauthe bus numbers have a gap at the disabled port
11:54marcanprobably some index confusion somewhere
11:56marcanjannau: lol there was another bug, we were always limiting ias to 32 due to fls() being 32-bit
11:56deteg1337 has joined #asahi-dev
12:02jannaulol, I grepped for __builtin_clz and was then confused by 'return x ? sizeof(x) * 8 - __builtin_clz(x) : 0;' in builtin-fls.h. I didn't parse that fully and assumed it is a macro taking the width of the argument into account
12:03marcanok, pushed with the fixes
12:03marcannow I can actually try DCP :)
12:03marcanjannau: dropped your dma-range limit since it's now implied
12:06marcan[ 0.439608] apple-dcp 389c00000.dcp: received unknown callback D113
12:06marcan[ 0.949179] apple-dcp 389c00000.dcp: unexpected busy command channel
12:06marcangot fairly far though :)
12:07kedde has joined #asahi-dev
12:10jannauplease add a noop callback for that, should be set_idle_caching_state_ap
12:10marcanit's upload_trace_start
12:11marcanadded return true callbacks for all 3
12:12marcan[ 0.434703] apple-dcp 389c00000.dcp: RTKit: syslog message: ck_PCC2DBlm_v5.cpp:3306: Quiescing callback
12:12marcan[ 0.486200] apple-dcp 389c00000.dcp: RTKit: co-processor has crashed
12:12marcan[ 0.486208] apple-dcp 389c00000.dcp: FAR = 0x10000000590
12:15jannauso one of the new callbacks moving the others around. not used on m1*/m2
12:15jannauI guess either you or me have to look at macos traces
12:15marcanD113 was always what I said I think?
12:18jannauI think create_nvram_service was inserted as D112
12:19CoolStar has joined #asahi-dev
12:20jannauI left the call/callback list in trace_dcp as is
12:20marcanI confirmed D113 with the driver
12:21marcanand D112 is still set_idle_caching_state_ap
12:22jannauipc.py can handle both 12.3 and 13.2 but needs the FW version set via env variable for 13.2
12:22marcanah wait no
12:22marcanI'm dumb
12:22jannauI didn't look at driver or firmware
12:23marcanD113 is... get_tiling_state?
12:23marcanlots of stuff got inserted there
12:24jannaupossibly. there should be 3 insertions before D116
12:40marcan[ 0.454192] apple-dcp 389c00000.dcp: RTKit: syslog message: PPipeDCP_H13P.cpp:17276: Dual pipe enabled offset 1
12:40marcanok so this is wrong, macOS gets disabled there
12:41marcanand that's right after the callback, ok
12:45_jannau_so change get_tiling_state to a false callback
12:51marcannah, needs to return true and write 0 to the argument
12:51marcanso custom
12:58marcanjannau: still the same crash, wasn't the dual pipe thing
13:03_jannau_at which point is this? before/after the modeset? do you have the last few calls / syslog messages before the crash?
13:08marcanfixing the RT bandwidth stuff now
13:10raveling has joined #asahi-dev
13:13_jannau_have you checked if the reg layout is still the same? it differs between m1 and m2 iirc
13:14_jannau_differences there would explain crashes
13:16_jannau_would show in the rt_bandwidth and map_reg cbs
13:18marcanjannau: it's dying in set_digital_out_mode
13:18marcanI fixed the RT thing
13:19raveling has quit [Ping timeout: 480 seconds]
13:19deteg1337 has quit [Remote host closed the connection]
13:22marcanjannau: ha.
13:22marcanso it works in 120Hz mode
13:22marcanit's dying switching to 60Hz mode
13:22marcanI'm going to be annoyed if this is an outright firmware bug that macOS just never hits...
13:22_jannau_I'd check the mapped display registers and memory mappings shared between dart-dcp and dart-disp0.4
13:23_jannau_disregard that
13:23marcanso it dies during a real modeset
13:23marcanbut I don't know if macOS ever does a real modeset? maybe after DPMS?
13:23_jannau_macos display setting offers a selection of the refresh rate
13:23_jannau_at least it did in 12.3
13:24_jannau_or at least it offered to disable promotion. I don't remember
13:25deteg1337 has joined #asahi-dev
13:26raveling has joined #asahi-dev
13:29marcanit's the RT thing I think
13:31deteg133_ has joined #asahi-dev
13:32deteg1337 has quit [Read error: Connection reset by peer]
13:32deteg133_ has quit [Read error: Connection reset by peer]
13:32deteg1337 has joined #asahi-dev
13:33marcanI think it's missing the dma mask stuff
13:34raveling has quit [Ping timeout: 480 seconds]
13:40_jannau_so 'apple,asc-dram-mask = <0x100 0x00000000>;' instead of <0x1f0 0x00000000>?
13:40_jannau_in the dcp dt node
13:42mkurz has joined #asahi-dev
13:42deteg1337 has quit [Remote host closed the connection]
13:43marcanactually just 0
13:43marcanI'm using the dma-range stuff now
13:43marcanbut, that's not the issue, the issue is dma_map_resource() is failing
13:47deteg1337 has joined #asahi-dev
13:49marcanohh I think I get it
13:50marcanthe new u64 in the dcpep_cb_map_reg is the dva
13:50marcanwe're supposed to just map it there
13:50marcanmakes sense, this is the design fix for their stupid vuln
13:50marcaninstead of requesting addrs, just map it by index
13:52i509vcb has joined #asahi-dev
13:53_jannau_that means I have to change the locked dart handling so that we can switch to unmanaged dma domains to map things at fixed dva
13:53marcanit's an output
13:53marcanwe just map it there and give it the dva
13:53marcanwe pick the dva
13:53deteg1337 has quit [Read error: Connection reset by peer]
13:53deteg1337 has joined #asahi-dev
13:54marcanok, let me commit :)
14:00marcanI think we can get rid of the asc-dram-mask stuff entirely now, assuming this also works out on M2
14:00marcanthe dma-range can contain upper bits which does what we want here
14:00marcan(even outside the ias)
14:00marcan(even if ias is downgraded in locked mode)
14:01marcanhopefully I got the DART logic right but I think I did
14:01marcanit just needs not to straddle an ias boundary (so the size needs to be right)
14:02deteg1337 has quit [Ping timeout: 480 seconds]
14:03marcanjannau: feel free to refactor as you see fit, I left the commits broken out so you can see what I did (except the DT squash)
14:07marcanso... wifi left?
14:10_jannau_I think it can be stay as is for now it will get squashed eventually. I don't mind fixups being squashed at the next rebase
14:11deteg1337 has joined #asahi-dev
14:15_jannau_we will need a new mesa release to retain 30 bit color support. kwin will use xrgb2101010 with argb8888 cursor overlay if both are available
14:19deteg1337 has quit [Ping timeout: 480 seconds]
14:22Dementor has quit [Read error: Connection reset by peer]
14:22Dementor has joined #asahi-dev
14:25marcanoh, did we grow cursor plane support?
14:25marcan(and why does that affect mesa?)
14:26_jannau_no, just local testing
14:26_jannau_I removed the fake support for argb210101010 after alyssa added support for xrgb2101010
14:27_jannau_see d11332288beb
14:28deteg1337 has joined #asahi-dev
14:28marcanyeah okay
14:28marcanwe're doing a new mesa soon anyway
14:36deteg1337 has quit [Ping timeout: 480 seconds]
14:41Thsf has joined #asahi-dev
14:44deteg1337 has joined #asahi-dev
14:52deteg1337 has quit [Ping timeout: 480 seconds]
14:57bps has quit [Ping timeout: 480 seconds]
15:00deteg1337 has joined #asahi-dev
15:00raveling has joined #asahi-dev
15:08raveling has quit [Ping timeout: 480 seconds]
15:08deteg1337 has quit [Ping timeout: 480 seconds]
15:17deteg1337 has joined #asahi-dev
15:19svenI also wonder if the older atcphys already keep the fuses on pd power off and/or reset or if apple changed their kext to skip that reset
15:19svenwould be nice if the fuses could also just be applied from m1n1
15:19sveni thought they got dropped but maybe I messed up when I checked that ages ago
15:23marcanit's possible we now have to save/restore
15:24marcanbut I was thinking the same
15:24marcansave/restore was my plan for PCIe too given m1n1 sets that up
15:25marcansven: also I think they're now gating the USB_AON power domains which they weren't before, so at least ont t602x they're gating *more*
15:25marcanbut yeah, we should be able to skip upstreaming the whole atcphy fuse mess if we can move that to m1n1 for older fw/soc compat
15:26deteg1337 has quit [Ping timeout: 480 seconds]
15:30svenI’ll take a look this weekend
15:34deteg1337 has joined #asahi-dev
15:36A_L_I_C_E has quit [Ping timeout: 480 seconds]
15:36A_L_I_C_E has joined #asahi-dev
15:41_jannau_at least a short reset of the m1 max pcie pd in u-boot doesn't break anything. even the links stayed up. either config space or dart-apcie accesses resulted in SErrors though
15:42deteg1337 has quit [Ping timeout: 480 seconds]
15:51deteg1337 has joined #asahi-dev
15:56deteg1337 has quit [Read error: Connection reset by peer]
15:56deteg1337 has joined #asahi-dev
16:14A_L_I_C_E has quit [Ping timeout: 480 seconds]
16:14A_L_I_C_E has joined #asahi-dev
16:39MajorBiscuit has quit [Ping timeout: 480 seconds]
16:48raveling has joined #asahi-dev
16:52chipxxx has quit [Remote host closed the connection]
16:54chipxxx has joined #asahi-dev
16:54chipxxx has quit [Remote host closed the connection]
16:55chipxxx has joined #asahi-dev
16:56raveling has quit [Ping timeout: 480 seconds]
16:59cy8aer has quit [Remote host closed the connection]
17:35siglazin has joined #asahi-dev
17:45Thsf has quit [Ping timeout: 480 seconds]
17:53gabuscus has quit []
18:00hightower2 has joined #asahi-dev
18:05A_L_I_C_E has quit [Read error: Connection reset by peer]
18:23gabuscus has joined #asahi-dev
18:28cy8aer has joined #asahi-dev
18:36raveling has joined #asahi-dev
18:44raveling has quit [Ping timeout: 480 seconds]
18:46raveling has joined #asahi-dev
18:46pthariensflame has joined #asahi-dev
18:48pthariensflame has quit []
19:03siglazin has quit [Remote host closed the connection]
19:11___nick___ has joined #asahi-dev
19:23MajorBiscuit has joined #asahi-dev
19:41___nick___ has quit []
19:44___nick___ has joined #asahi-dev
19:44___nick___ has quit []
19:47___nick___ has joined #asahi-dev
20:08___nick___ has quit [Ping timeout: 480 seconds]
20:43MajorBiscuit has quit [Quit: WeeChat 3.6]
20:58gabuscus has quit []
21:02gabuscus has joined #asahi-dev
21:02gabuscus has quit []
21:06cylm has joined #asahi-dev
21:08gabuscus has joined #asahi-dev
21:08cylm_ has quit [Ping timeout: 480 seconds]
21:10gabuscus has quit []
21:13A_L_I_C_E has joined #asahi-dev
21:16nyilas has quit [Remote host closed the connection]
21:26tanty has quit [Quit: Ciao!]
21:31bcrumb has joined #asahi-dev
21:36chipxxx has quit [Ping timeout: 480 seconds]
21:42deteg1337 has quit [Remote host closed the connection]
21:47tanty has joined #asahi-dev
21:48deteg1337 has joined #asahi-dev
21:49tanty has quit []
21:49bps has joined #asahi-dev
21:52bcrumb has quit [Quit: WeeChat 3.8]
21:54deteg133_ has joined #asahi-dev
21:56deteg1337 has quit [Ping timeout: 480 seconds]
22:01tanty has joined #asahi-dev
22:02axboe_ is now known as axboe
22:02deteg133_ has quit [Ping timeout: 480 seconds]
22:07gabuscus has joined #asahi-dev
22:10deteg1337 has joined #asahi-dev
22:10axboe has quit [Ping timeout: 480 seconds]
22:12bps has quit [Ping timeout: 480 seconds]
22:13axboe has joined #asahi-dev
22:13WindowPa- has quit [Read error: Connection reset by peer]
22:16WindowPain has joined #asahi-dev
22:19A_L_I_C_E has quit [Remote host closed the connection]
22:19deteg1337 has quit [Ping timeout: 480 seconds]
22:27deteg1337 has joined #asahi-dev
22:35chadmed_ has joined #asahi-dev
22:36jannaumarcan: small PCIe copy'n'paste fix for pre t6020-pcie in https://github.com/AsahiLinux/linux/pull/134
22:36deteg1337 has quit [Ping timeout: 480 seconds]
22:37jannaut602x/bringup works otherwise on mac studio with both 12.3 and 13.2 firmware
22:39jannauwith working Night Color (kwin_wayland 5.27.4)
22:44deteg1337 has joined #asahi-dev
22:52deteg1337 has quit [Ping timeout: 480 seconds]
22:59ChaosPrincessGreat, linux manages to power gate something in the time after it starts but before it loads modules and so the mipi link explodes in a serror.
23:01deteg1337 has joined #asahi-dev
23:02jannauadd pd_ignore_unused to the kernel command line or make the power-domain always-on. Is it shared between two or more devices?
23:03ChaosPrincessI am doing pd_ignore_unused for now, i just hoped that i could drop it by adding all the necessary stuff to power-domains
23:12jannaudo we have a problem with dart runtime PM? dart is probed first due to the iommu dependency, might immediately power-down since it is unused. if the device is not so far probed that it forces the pd on, the pd will power down
23:15deteg1337 has quit [Ping timeout: 480 seconds]
23:23deteg1337 has joined #asahi-dev
23:31deteg1337 has quit [Ping timeout: 480 seconds]
23:37nsklaus has quit [Quit: ZZZzzz…]
23:39deteg1337 has joined #asahi-dev
23:46CoolStarChaosPrincess: does M1 use MIPI for the webcam? since I noticed an ISP in the DT but haven't looked much further into it
23:47A_L_I_C_E has joined #asahi-dev
23:48deteg1337 has quit [Ping timeout: 480 seconds]
23:56deteg1337 has joined #asahi-dev
…