2022-10-24
00:40thelounge7571340 has joined #asahi-dev
00:41thelounge7571340 has quit [Remote host closed the connection]
01:39Etrien_ has joined #asahi-dev
01:41thelounge7571340 has joined #asahi-dev
01:41thelounge7571340 has quit [Remote host closed the connection]
01:45Etrien has quit [Ping timeout: 480 seconds]
02:19Etrien_ has quit [Read error: Connection reset by peer]
02:19Etrien has joined #asahi-dev
02:43thelounge7571340 has joined #asahi-dev
02:44thelounge7571340 has quit [Remote host closed the connection]
03:46marcanI've reverse engineered custom ISAs before, it's not terribly hard once you can load your own code and get some output from it
03:50thelounge7571340 has joined #asahi-dev
03:51thelounge7571340 has quit [Remote host closed the connection]
03:56user982492 has joined #asahi-dev
04:08user982492 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
04:42kenzie7 has quit []
04:44kenzie7 has joined #asahi-dev
04:52thelounge7571340 has joined #asahi-dev
04:53thelounge7571340 has quit [Remote host closed the connection]
05:17chengsun has quit [Quit: Quit]
05:17chengsun has joined #asahi-dev
05:53thelounge7571340 has joined #asahi-dev
05:54thelounge7571340 has quit [Remote host closed the connection]
06:23Etrien_ has joined #asahi-dev
06:28chadmedthat only gives me 3 codecs, which i guess makes sense since the speaker array is across two cpu links
06:29chadmedthat was my first thought i just didnt want to make that assumption without checking first
06:30Etrien has quit [Ping timeout: 480 seconds]
06:30poviki thought you were suspecting ->dai_link->num_codecs is not the same as what was in ->num_codecs
06:31chadmedyeah the only thing is getting it out of hw params still gives me 8 since it creates enough to consume the entire clock, so what im trying to do is constrain the fe on startup based on the number of codecs the backend its connected to is comprised of
06:42Etrien_ has quit [Read error: Connection reset by peer]
06:43Etrien has joined #asahi-dev
06:48SSJ_GZ has joined #asahi-dev
06:57nepeat has quit [Ping timeout: 480 seconds]
07:09thelounge7571340 has joined #asahi-dev
07:09thelounge7571340 has quit [Remote host closed the connection]
07:44pjakobsson has quit []
07:46chipxxx has joined #asahi-dev
07:47pjakobsson has joined #asahi-dev
07:52chip_x has quit [Ping timeout: 480 seconds]
08:07marcandoes anyone know what the kernel policy is re sparse and drivers that will only ever run in same-endian platforms?
08:07marcanthere's a lot of test robot spam about mixing endianness types, but I get the feeling the solution here isn't to add a truckload of dummy endian conversions to drivers which are guaranteed to never need them
08:08sven[ 2.980643] apple-dcp 271c00000.dcp: RTKit: Message (id=1): ringbuffer abort at iop_ringbuffer.h:856 <-- uh oh
08:08svenso the previous problem was that I messed up the afk dp->ap call handling. looks like now I also broke the ringbuffer handling itself :D
08:12svenmarcan: I kinda like the __leXX types because that way it's obvious when some buffer is sent across to some other processor vs. when it's just some internal data structure
08:17marcansometimes it's questionable... I'm adding those to spi-hid-apple-core because there's a chance a crazy person exists that will try to connect a modern Apple SPI trackpad to a PowerBook or something
08:18svenyeah, same for bluetooth. who knows if there's someone crazy enough to connect that pcie card to big endian machine with a pcie bus
08:23marcandrivers/soc/apple/dockchannel.c:229:25: sparse: sparse: cast removes address space '__iomem' of expression
08:23marcan... I have no idea what the right way to shut it up here is, short of converting through an int and back which is dumb
08:25thelounge7571340 has joined #asahi-dev
08:26thelounge7571340 has quit [Remote host closed the connection]
08:36pjakobsson has quit [Remote host closed the connection]
08:40pjakobsson has joined #asahi-dev
08:44chadmed_ has joined #asahi-dev
09:06davido has joined #asahi-dev
09:06davido is now known as capta1nt0ad
09:08nepeat has joined #asahi-dev
09:09King_In0 has joined #asahi-dev
09:09King_InuYasha has quit [Read error: Connection reset by peer]
09:14capta1nt0ad has quit [Quit: Konversation terminated!]
09:17capta1nt0ad has joined #asahi-dev
09:19capta1nt0ad has quit []
09:24svenhuh, so my code sets the write pointer from 0xc80 to 0xd40 but in the tracer it looks like DCP tries to read past that for some reason from 0xd40 to 0xd80 and sets the read pointer to 0xd80 then and continues to increment it by 0x10 until it eventually crashes
09:25capta1nt0ad has joined #asahi-dev
09:35chadmed_ has quit [Quit: Konversation terminated!]
09:39thelounge7571340 has joined #asahi-dev
09:39thelounge7571340 has quit [Remote host closed the connection]
09:40capta1nt0ad has quit [Quit: Konversation terminated!]
09:40capta1nt0ad has joined #asahi-dev
09:52marcanit has this thing where if a message doesn't fit at the tail of the buffer, you're supposed to just have the header there and then the header again at 0
10:22capta1nt0ad has quit [Quit: Konversation terminated!]
10:22capta1nt0ad has joined #asahi-dev
10:36capta1nt0ad has quit [Quit: Konversation terminated!]
10:37capta1nt0ad has joined #asahi-dev
10:40kov has quit [Quit: Coyote finally caught me]
10:42thelounge7571340 has joined #asahi-dev
10:42thelounge7571340 has quit [Remote host closed the connection]
10:45chadmed_ has joined #asahi-dev
10:46chadmed_povik: https://tpaste.us/pnVx <-- frontends opening with zero channels before being populated
10:48chadmed_dev_info(rtd->dev, "Starting FE with %d channels", fe_chans); fe_chans being the number of channels from rtd->dpcm->hw_params
10:48chadmed_opening the frontend in .startup while it is in this state results in an -EINVAL regardless
10:51chadmed_yeah but the problem is that .startup tries opening it while its in that state to set the constraint
10:51chadmed_which is why i gated that behind waiting for it to have some channels associated with it
10:56povikor rather the primary frontend, it gets a <2 channels constraint from MCA because of slots
10:56chadmed_thats what im thinking, which is why i now have the constraint gated behind if (fe_chans > ma->max_channels)
10:58povikthat fe_chans is meaningless, by .startup stage the PCM doesn't yet have a fixed number of channels
10:59marcanfor those who like playing with patch stats: https://gist.github.com/marcan/b4328c490ff4f4f6d45509ac117edb93
10:59marcanthat tells you stats per branch and correctly handles (ignores) base branch merges, the way I'm doing it now
11:09chadmed_ has quit [Quit: Konversation terminated!]
11:25capta1nt0ad has quit [Quit: Konversation terminated!]
11:31j`eyalso for reasons unknown I had to change: if git rev-parse --verify "bases/$name" &>/dev/null; then
11:33capta1nt0ad has joined #asahi-dev
11:47thelounge7571340 has joined #asahi-dev
11:48thelounge7571340 has quit [Remote host closed the connection]
11:56svenhttps://f.svpe.de/2a0f24d3b7ede3dac32f71ec8bb2a4bcd22983aaa7307d1e27d1bd2c7dea586a_dcpext.png \o/
11:56jannaumarcan: notchless modes are missing in dcp, I have code for that but I haven't figured out why it breaks fbcon, results black console but X and wayland compositors are working as expected
12:02chadmedi also realised that the IRs would have sounded like crap for anyone who didnt know to force PW to resample everything to 96khz, so the config fragment now does that
12:12jannaumarcan: if you test dcp a t8103 laptop would be a good target to start. the imac comes back from dpms/sleep with minimal brightness. If that happens on m1 air and pro 13" as well we to look into display brightness control
12:12capta1nt0ad has quit [Quit: Konversation terminated!]
12:15jannauI think brightness control requires set_block_dcp() calls (I suspect either calibration or temperature data) and then set property calls with numeric IDs which at least differ betwee m1 (imac) and m1 max (macbook pro 14")
12:15j`eymarcan: ah, git rev-parse --verify "bases/$name" changed to git rev-parse --verify "$ROOT/bases/$name" and now I get: 210-gpu 0
12:18chadmed has quit [Remote host closed the connection]
12:19povikonce the time comes i will squash it into base macaudio commit for upstream submission, is that okay by you?
12:36_jannau_with lina's gpu branch? the dcp branch in there might trigger the dpms code path on ending WMs
12:40marcan[ 2.600009] apple-dcp 231c00000.dcp: RTKit: syslog message: nifiedPipeline.cpp:6548: set_digital_out_mode returned 8000000b
12:55thelounge7571340 has joined #asahi-dev
12:56thelounge7571340 has quit [Remote host closed the connection]
13:20marcanI'm getting random SMC command timeouts when running dmesg in a hypervisor console, and I don't know why but I suspect mailbox again
13:29svenit's just silly how much issue we have with that should be a irq handler with a MMIO read in a loop + a function that does a single MMIO write
13:36svenjannau: you can also drop all dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(32)) since 32bit is the default dma mask anyway
13:38_jannau_marcan: I don't see that on j314c or j457. is dcp turing the backlight off or is it simpldedrm on unload?
13:46marcanI'm going to make it a separate kconfig for backlight support and make them mutually exclusive
13:53marcan_jannau_: are you sure the brightness control problems aren't just due to the same conflict?
13:59thelounge7571340 has joined #asahi-dev
13:59thelounge7571340 has quit [Remote host closed the connection]
13:59kov has joined #asahi-dev
14:02Dementor has quit [Remote host closed the connection]
14:03Dementor has joined #asahi-dev
14:21marcananyway, pushed another kernel batch with a config to disable the backlight stuff if DCP is compiled in
14:25jannauI wonder how that looks on the 14/16" macbooks pros but I guess most additional powerdraw (if any) there is the the backlight and 120Hz display refresh which we currently do not use
14:43Gaspare has joined #asahi-dev
15:02_jannau_don't do that then. I thought I prevented that with completions but I haven't stress tested it
15:04svenit also breaks forever when it needs to switch the link rate but that's kinda expected since I fake all that atm
15:06marcan(seriously though, this needs to be actually reliable/stable for us to push it to users, not just in light testing but abuse too)
15:09thelounge7571340 has joined #asahi-dev
15:09thelounge7571340 has quit [Remote host closed the connection]
15:10_jannau_I'm proably far too optimistic with the timeout duration and don't have a good idea what to do when the completion timeouts and dcp hasn't crashed
15:20_jannau_dcp crash on swap calls if there is already ongoing communication. drm more or less guarantees that there are no concurrent calls but we porbably should use a mutex
15:27marcanit failed trying to map the dcpext4 carveout, so it sounds like it would only work on Ultra? unless the Max iBoot also has the Ultra regions (but then the Pro one has the Max ones?)
15:28marcanyou should probably actually return an error on missing alias, and just have the calling code not propagate it and break the loop
15:39marcan_jannau_: so should I schedule a stream to work out brightness control, or do you want to look at that yourself? :)
15:44_jannau_how fast do we want to have brightness control? I suspect some binary reversing could be helpful (which I haven't started with according to policy)
15:46_jannau_there is a set property call with a numeric id which looks like it is brightness control
15:58svenhttps://github.com/svenpeter42/linux/commit/6147785db5c5255c81de76cd10af4c4434bb4a97 if anyone wants a sneak peak for the altmode mess
15:58marcanbacklight-marketing-table = 0000000000000400e1fa050066a60800703d0c007a1411005c8f1700c2352000c2b52b0014ee3a008f024f006666690000008c003333b900291cf400a4b040010000a401
16:00svenand if anyone on t8103 with a display connected to atcphy1 that will negotiate link rate 0xa actually wants to try it run this before booting the kernel https://f.svpe.de/d97f0ab6924026d2377b11bdd7a1cdf68383fb6b2965ba1d912680ed168dde47_atc_dpaltmode.py
16:01marcan_jannau_: it sounds like we probably need to upload some/all that data and then just set the backlight property, probably?
16:03_jannau_strings on the firmware suggests it's afk calls which I don't see in macos tracing so maybe iboot does that already
16:13thelounge7571340 has joined #asahi-dev
16:13thelounge7571340 has quit [Remote host closed the connection]
16:25King_In0 has quit []
16:26marcannull: I'm certainly fine with non-UEFI if you think we can specify exactly what the call semantics should be cleanly (especially re the MMU)
16:26marcanISTR that back in the day that was considered and the conclusion was we'd be reinventing UEFI, but it's been a while
16:26King_InuYasha has joined #asahi-dev
16:27marcan(and yes, this is for the ML at some point, but it also doesn't hurt to have a PoC and it's not like we haven't shipped dozens of those to our users already, and changed them 3 times each, much to kettenis' chagrin :p)
16:28marcanso I'm very interested in what you think a first approximation take should be like and I'd be happy to run with that and see how it goes
16:28nullmarcan: I don't recall the discussions for the "reinventing UEFI" part, but I think there's been a lot of point-to-point conversions between people and not necessarily a single joined up story
16:29nullA first approximation would be spin-table with a cpu-return-address or similar to do hotplug, specified a bit like the ePAPR spin-table (which arm64's spin-table is a not-quite-clone of), but I'll admit I haven't thought much about idle rather than hotplug
16:30marcanyeah, we'd need something for idle, but also that doesn't really work power-wise unless we come up with a signaling mechanism more refined than "just spin on a wfe"
16:31marcanI think regardless of whether UEFI is in the mix or not, we're going to end up reinventing PSCI poorly...
16:32marcannot that I'm opposed to doing "PSCI, but simpler" if you think it's the way to go, but it's going to have to be some kind of call-based interface at some point
16:32nullI think wahatever we do we'll end up reinventing PSCI; I just don't want us to be under the illusion that what we're making is PSCI, since there are big differences in a number of areas
16:33nullIf that has to go thourhg UEFI runtime services then my main concern would be that it is plumbed separately from PSCI, even if it's PSCI-inspired
16:34marcanI think if it's not going to be PSCI, and it's going to be via runtime services, then we might as well drop the layer and just call it a bespoke UEFI protocol
16:34marcanbut my impression was that people were really dead set on PSCI as the One True Way, hence the idea of tunneling it via UEFI
16:35marcanif you think there's room for something other than spin-table and psci that isn't just a version of either, then that changes the situation
16:35nullThis is a bit difficult to write-up since there's a number of overlapping concerns, and I need to think for a bit to get the concepts in order
16:36marcanalso re MMU off, that *works* but performance of these things with caches off is pretty abysmal, FWIW
16:36marcanmight be okay for just a cpuidle trampoline though, that doesn't have to touch RAM other than for the GPR save/restore...
16:38nullFor the *conduit*, HVC/SMC vs UEFI: HVC/SMC are easy to do in any kernel context, but UEFI means we have to mess with TTBRs, and use a lot more infrastrucure, which ends up interacting with things like lockdep/rcu/context-tracking more painfully, and will need a lot of thought. That's definitely an ML disucssion
16:40marcanrequire that the entire runtime thing is position-independent, and provide a descriptor of what MMIO/RAM regions it wants mapped. kernel makes sure those are mapped, fills in the pointers, maps it in kernel space, then just calls it
16:40nullFor the "one true way", I understand and agree with the principle that PSCI *should* be the one way, and we don't want any more implementations than strictly necessary. If we need a generic PSCI analogue for systems without EL2 I'm ok with that, and would prefer that we don't articifically try to force that into PSCI, but others seem to have different views there
16:42nullMaybe, but then you have to always have that mapped, and for things like control flow integrity we don't really want to have FW-provided pages mapped executable all the time
16:43nullI guess my major point of contention here is "pretending this is PSCI"; if this is a "PSCI-like, but separate" UEFI runtime service, I'm not opposoed to that. That way we can manage the distinct parts (e.g. all the conduit subtleties above) separately and more manageably
16:44nullI'm afraid I need to disappear shortly, but I can reply to things tomorrow and/or follow up on the list
16:46nullI reckon just linux-arm-kernel would be good, with Ard Biesheuvel, Will Deacon, Catalin Marinas, and myselfg
16:50marcankettenis, j`ey, sven, jannau, anyone else? I assume everyone's subscribed to asahi@ anyway, but let me know if you're explicitly interested
16:51nullOh, now I re-read the above, to clarify: the set I listed was a "please include" rather than "please limit to"
17:15thelounge7571340 has joined #asahi-dev
17:15thelounge7571340 has quit [Remote host closed the connection]
17:23r0ni has quit [Quit: Textual IRC Client: www.textualapp.com]
18:28thelounge7571340 has joined #asahi-dev
18:28thelounge7571340 has quit [Remote host closed the connection]
18:30nela has quit [Ping timeout: 480 seconds]
18:35nela has joined #asahi-dev
19:02philm has joined #asahi-dev
19:17jluthra_ has quit [Remote host closed the connection]
19:18jluthra_ has joined #asahi-dev
19:29thelounge7571340 has joined #asahi-dev
19:30thelounge7571340 has quit [Remote host closed the connection]
19:38thelounge7571340 has joined #asahi-dev
19:38thelounge7571340 has quit [Remote host closed the connection]
19:39jannaulol, fbcon with dcp works only accidentially on the macbook pro 14/16". due to the notchless framebuffer none of the modes match in size and and it sets the preferred 120Hz mode
19:40MajorBiscuit has joined #asahi-dev
19:42jannauif dcp offers notchless modes too, fbcon selects 60 Hz since it matches the boot mode (60 Hz is assumed default), this requires a modeset and fails somehow
19:52jannauhmm, still broken with 120Hz simpledrm, issue seems to be that the atomic_modeset has no changed flags set if drm debug is to be trusted
20:25ad0 has joined #asahi-dev
20:28ad0 is now known as ad1
20:29capta1nt0ad has joined #asahi-dev
20:30kettenisbut to me the whole point about the idea of having a UEFI conduit for PSCI is that you could have the MMU *on*
20:32kettenisand that the same conditions under which you'd make EFI runtime calls would apply to PSCI calls
20:32kettenisalso, whatever regions are needed for the code to function would part of the UEFI memory map
20:33kettenisif the actual code that implements the PSCI calls would live in m1n1, we'd still need a way to communicate this through the device tree
20:40thelounge7571340 has joined #asahi-dev
20:40thelounge7571340 has quit [Remote host closed the connection]
20:54ChaosPrincessacpi has a thing called platform runtime mechanism, which is basically doing what we want - calling into firmware w/o going to another exception level. Maybe we can reuse that, but hook it up with the device tree instead of acpi?
21:00MajorBiscuit has quit [Read error: No route to host]
21:03j`ey(it was recently enabled for arm64 acpi https://lore.kernel.org/linux-arm-kernel/20220628125346.693304-1-sudeep.holla@arm.com/T/#u)
21:14Etrien_ has joined #asahi-dev
21:18kettenisthat PRM stuff reads as typical ACPI stuff; overdesigned and yet woefully underspecified at the same time
21:19kettenisand besides that, we don't have (and as far as I'm concerned won't have) ACPI on these systems
21:21Etrien has quit [Ping timeout: 480 seconds]
21:30Etrien_ has quit [Read error: Connection reset by peer]
21:31Etrien has joined #asahi-dev
21:31ChaosPrincessyes, that is correct, but you can use the binary abi, while putting the acpi table goop in device tree instead
21:42SSJ_GZ has quit [Ping timeout: 480 seconds]
21:42thelounge7571340 has joined #asahi-dev
21:42thelounge7571340 has quit [Remote host closed the connection]
22:12roblg has joined #asahi-dev
22:19roblg has quit [Quit: Page closed]
22:19nicolas17 has joined #asahi-dev
22:38jannaulol, fbcon and dcp apparently have conflicting ideas where the framebuffer is. the mapped physical memory in dart-dcp is just back. verified with proxy memsets
22:46thelounge7571340 has joined #asahi-dev
22:46thelounge7571340 has quit [Remote host closed the connection]
22:49ad1 has quit [Quit: Textual IRC Client: www.textualapp.com]
22:49ager has joined #asahi-dev
22:58Gaspare has quit [Quit: Gaspare]
23:03qyousef has joined #asahi-dev
23:18ager has quit [Quit: Textual IRC Client: www.textualapp.com]
23:20metis has joined #asahi-dev
23:26nullroute has quit [Read error: Connection reset by peer]
23:28nullroute has joined #asahi-dev
23:33user982492 has joined #asahi-dev
23:34metis is now known as icarus
23:35icarus has quit [Quit: Textual IRC Client: www.textualapp.com]
23:40roblg has joined #asahi-dev
23:49gamma has joined #asahi-dev
23:51thelounge7571340 has joined #asahi-dev
23:52thelounge7571340 has quit [Remote host closed the connection]