2021-08-10
00:00quarkyalice_ has joined #asahi
00:00quarkyalice has quit [Remote host closed the connection]
00:08quarkyalice_ has quit [Remote host closed the connection]
00:16yuyichao has quit [Ping timeout: 480 seconds]
00:39amwsven: Just a note, dart/dev rev 6756bb246de5, very dangerous to run. It reliable corrupts my USB drive I use for rootfs
00:40amwIt was confusing so I added a brief note to Wiki: https://github.com/AsahiLinux/docs/wiki/SW:Linux#nvme--usb
01:20amwdevel did corrupt USB drive after running about 10mins and then shutdown. Unrecoverable fail to recover on next boot
01:23yuyichao has joined #asahi
01:56chadmedarnd: bit of a necro i know but re the thing about the spi drivers all being the same, convergent hardware design might actually be worth a long term research project. in biology, convergent evolution happens when multiple species evolve the same trait in response to a common environmental pressure
01:58chadmedin computer hardware design im all but certain that this has happened also due to the influence of ubiquitous software like linux, where you see hardware start to be designed around better support/ease of development for a particular software solution, rather than the software solution conforming to a set of hardware
01:59chadmeda good example of this (though not specifically convergent) would be the addition of specific SQL query acceleration logic to fujitsu's most recent SPARC chips, or the integration of FPUs to x86 SoCs in the 90s as more and more people were using the PC platform for multimedia tasks that required fast floating point arithmetic
02:18PhilippvK has joined #asahi
02:21phiologe has quit [Ping timeout: 480 seconds]
03:00skipwich has quit [Quit: DISCONNECT]
03:01skipwich has joined #asahi
03:11marvin24 has joined #asahi
03:14marvin24_ has quit [Ping timeout: 480 seconds]
04:11quarkyalice has joined #asahi
04:20quarkyalice has quit [Quit: Leaving]
05:17quarkyalice has joined #asahi
06:12svenamw: uh.. so dart/devel wouldn't surprise me since that one has that 4k pagesize shenanigans
06:17sorearquestion about the split iommu pagesize thing. Does AGX require the IOMMU to be configured per-process to control what memory each shader has access to, or is that handled somewhere else in the stack? (My relevant knowledge is limited to one AMD HSA slide deck a few years ago)
06:19sorearso AGX doesn't need to be treated by DART as an "untrusted device" using the terminology of the thread, but only because AGX is out of scope for DART entirely?
06:21sorearif user-provided shaders could tell it to access arbitrary memory in the device address space, and if DART was the only line of defense against that, it would quack a lot like an untrusted device (vfio/VM PCI passthrough being the other interesting case but that's much further down the road)
06:23sven(please don't let it be part of that framework. i really don't want to also implement multiple iommu per bus support in there)
07:24arisn't "GART" is what iommu for gpus used to be called ages ago (as in, gpus in agp slot era)? i find it funny they've reused the name, though it kinda makes sense
07:31marcanchadmed: SPI hardware isn't all the same because linux, it's all the same because SPI is a stupid simple protocol and there is effectively one obvious way to do it
07:32marcanif vendors were actually trying to help linux the worst thing they could do is exactly what they do, design an incompatible variant for no reason
07:39chadmedyeah perhaps an spi controller, being (relatively) simple and dumb, is a poor example of what i was trying to describe. of course, i dont for a second think that these companies are trying to "help" linux, but moreso just take advantage of the fact that these code paths exist and only add enough voodoo such that you still need _their_ driver, but that driver can be mostly copy-pasted or otherwise adapted from
07:44eichin has quit [Read error: Connection reset by peer]
07:44eichin has joined #asahi
07:44eric_engestrom has quit [Read error: Connection reset by peer]
07:44steev has quit [Read error: No route to host]
07:44eric_engestrom has joined #asahi
07:44steev has joined #asahi
07:50kettenis_ has joined #asahi
07:50kettenis has quit [Read error: Connection reset by peer]
07:53pipcet[m]I'd follow the streams, but no audio on the M1 yet ;-) (seriously, haven't seen them but I think it's a great idea!)
08:15chadmedi think ive only ever had a good experience with their DSL chipsets since theyre more stable on long phone lines
08:16JTLmarcan: Don't know if you got the memo, but GitHub now allows enabling "one time donations" for sponsorship
08:17tophevich[m]JTL: AFAIK they don't take a cut, right?
08:18amwHelp appreciated on debugging why platform drivers are not called - I cherry-picked the corellium pinctrl/gpio/keyboard drivers got them compiling but they are never probed!
08:20j_eyamw: can you make a branch with your changes? I can look, I got this working yesterday, but cant share it immediately
08:25j_eyamw: for the delay thing replace it with 'ndelay(spi_delay_to_ns(&t->delay, t));' dont delete it
08:28marvin24_ has joined #asahi
08:30j_eyamw: and you've enabled all the CONFIGs? PINCTRL_APPLE_GPIO, SPI_APPLE_MC, KEYBOARD_APPLESPI?
08:31marvin24 has quit [Ping timeout: 480 seconds]
08:32amwThat last one was a pain until I added CONFIG_LEDS_CLASS - completely ignored until that is set!
08:34amwI think I have to plaster the platform probing stuff with prints until I can figure out why nothing is probed.
08:36amwI figured it would just complain in the probe when it asked for it - not totally non-probe ....
08:37jeffmiw has joined #asahi
08:49amwOk - now I'm probing! ... Get's an SError in clk_apple_pmgr_gate_disable - but that I can investigate
08:52amwOk - I have to go now - but I'm not surprised my raw patches crash - at least the code is being run now....
08:53j_eyamw: cool, but as pipcet[m] said.. that probably shouldnt be called. double check youre getting "clk: Not disabling unused clocks" in dmesg
08:55amwj_ey: The stack trace shows it's called from clk_disable_unused from do_one_initcall() - so it's not happy
09:00amwOk - falling over trying to get an interrupt - but I was expecting something like that - didn't try to take that stuff
09:01amwI was thinking trying to get polling working rather than work through all the interrupt stuff I'm not not familar with
09:01pipcet[m]amw: I had polling working at some point, but I don't remember which of the seventeen branches it's in :(
09:07amwpipcet[m]: As in just took the whole DT entry for those spi/keyboard with the IRQ but didn't take any code patches for the IRQs
09:28phiologe has joined #asahi
09:31PhilippvK has quit [Ping timeout: 480 seconds]
09:40jeffmiw has quit [Quit: Konversation terminated!]
09:45amwDidn't remove anything from the patches I took - didn't take b8ecd5924678 "SMP on Apple M1" or "Support for Apple Interrupt Controller (AIC)" but perhaps that's ok
10:09amwj_ey: now crashing SError in spi probe on the clk_enable - I might try commenting it out of the DT
10:23amwok - my fixed refclk stopped it crashing but it's now winging about IRQ index 0 not found...
10:31j_eyso basically undo this snippet https://github.com/amworsley/AsahiLinux/commit/aa1e2fd763667f41992b05f838674197f7e8a197#diff-845c07f30f0f94856b22d7b50c0ff3d27a961abeffefcdfab01f2e8cd64569ccL300
10:35j_eymaybe it didnt link properly, i mean change the keyboard@'s interrupt parent back to the nub_gpio again
10:40amwHmm - weird - that made no difference - it booted up and the spi failed with the same IRQ index 0 not found
11:43yrlf is now known as Guest3798
11:43yrlf has joined #asahi
11:45jelly-hme has joined #asahi
11:45minecrell has quit [Quit: Ping timeout (120 seconds)]
11:46minecrell has joined #asahi
11:49Guest3798 has quit [Ping timeout: 480 seconds]
11:49jelly has quit [Ping timeout: 480 seconds]
12:14kov has joined #asahi
12:24pipcet[m]amw: so what's the next step? replacing all the corellium code one driver at a time? :-)
12:25pipcet[m]first things first, let's add fn+esc as sysrq and fn+1234 as F1, F2, F3, F4 to the hardcoded translation table ;-)
12:30j_eynice, mine was a gift so I had no choice to upgrade, I have the 8GB model. but my other main machine has 4GB sooo
12:33amwj_ey: Still don't understand all where and why all those interrupt parent things are needed - so glad you could put it all together!
12:36pipcet[m]amw: ooh, any chance you could test whether the keyboard backlight works the same on MBA as it does on MBP?
12:36amwpipcet[m]: You probably know this but drivers/input/keyboard/applespi.c has Function keys and such already
12:37amwpipcet[m]: You could "push a pull request" to https://github.com/amworsley/AsahiLinux/tree/asahi-keyboard
12:37pipcet[m]amw: the MBP doesn't have physical function keys, just the touchbar, so I had to add those.
12:39pipcet[m]it's an SPI device that responds nonsensically until you complete a lengthy initialization sequence, when it sends lots of data that needs to be interpreted...
12:39pipcet[m]that's for input. For output there's a display controller behind its own dart, plus the phy driver
12:42pipcet[m][ 3.793436] applespi spi1.0: Received corrupted packet (invalid message length 8 - num-fingers 0, tp-len 48)
12:43pipcet[m]amw: oh, any chance you could check your ADT first? I don't feel good about just writing to MMIO that I really have no reason to believe is there or does the same thing on MBA...
12:44amwHmm there are exactly 4 of those corrupted packet messages in the keyboard driver : git grep "corrupted packet" drivers/input/keyboard/applespi.c
12:49pipcet[m]I suspect the initial message is just the weird boot mode the keyboard is in. It also sends an interrupt when the first key is hit, even when there is no driver.
12:56pipcet[m]j_ey was right, it's the same (is it possible the macbook pro is really just an overpriced mba without function keys? ;-) )
13:00pipcet[m](there's another patch which exposes the PWM as a brightness control for an LED, but that's just DT magic)
13:07jelly-hme is now known as jelly
13:13pipcet[m]that's okay, that's the SPI keyboard backlight code in the applespi driver, for intel macs
13:14pipcet[m]you should see a device in /sys/class/pwm; cd to /sys/class/pwm/pwmchip0; echo 0 > export; then a directory shows up with "enable", "duty_cycle" and so on. You can play with those (units in nanoseconds) :-)
13:16pipcet[m]did you set duty cycle and period first? if the duty cycle is longer than the period the pwm code will fail to enable.
13:17j_eyoh right, I disabled CONFIG_EFI, thats why I didnt see that. but this untested patch might fix it https://paste.gg/p/anonymous/e6649fe2f74f4c028adfa27aebfabfc2
13:18amwOh that wasn't so good : echo 100 > period gave SError and stack trace... no keyboard working ...
13:23pipcet[m](that's part of the reason I'm trying to push the fpwm driver: it actually needs a clock and will do something visibly wrong if it's disabled while it's on)
13:26amwYou can see a photo at https://raw.githubusercontent.com/amworsley/asahi-wiki/main/images/backlight-crash2.png
13:30pipcet[m]it's 0x23b7001e0 here, I think, though I'd enable the gate before and after that just to be sure.
13:32amwok - enabled clock and booted it back up and no crashes - so far - but no backliht that I can see?
13:37pipcet[m]thank you very much, that's great. One last thing before I shut up; can you test a period of 1000000000 (that's a US billion) and a duty_cycle of half a US billion and see whether it flashes once per second, roughly?
13:38amwimage at https://raw.githubusercontent.com/amworsley/asahi-wiki/main/images/backlight-working.jpg
13:43amwOk - see if you can display - https://raw.githubusercontent.com/amworsley/asahi-wiki/main/images/flashing-backlight.mp4
13:44amwIf you wanted to go really gaudy you could try updating the Asahi Wiki with that and see if it displays the flashing keyboard ...
13:50yuyichao has quit [Ping timeout: 480 seconds]
13:59pipcet[m]nope, displays the alt text. Maybe my browser doesn't understand your fancy new mp4s :-)
14:00pipcet[m]oh, btw, and this is a lot simpler, does the caps lock LED work? that gives us a grand total of two user-controllable LEDs!
14:01floxf5[m] has joined #asahi
14:02pipcet[m]in my day, that's all we needed to get a system up and running, but now you kids have fancy frame buffers and all that
14:33svenamw: can you elaborate on that corruption? do you get any error messages? does this usb drive work with other machines? 'cause i've been using that branch for a while without issues so far
14:42jeffmiw has joined #asahi
15:21yuyichao has joined #asahi
16:59chadmed has quit [Remote host closed the connection]
17:00chadmed has joined #asahi
17:16WhyNotHugo_ has joined #asahi
17:17DarkShadow44 has quit [Quit: ZNC - https://znc.in]
17:20WhyNotHugo has quit [Ping timeout: 480 seconds]
17:20WhyNotHugo_ is now known as WhyNotHugo
17:29quarkyalice has quit [Remote host closed the connection]
17:32WhyNotHugo has quit [Ping timeout: 480 seconds]
17:35DarkShadow44 has joined #asahi
17:35WhyNotHugo has joined #asahi
17:36quarkyalice has joined #asahi
17:45quarkyalice has quit [Remote host closed the connection]
17:49quarkyalice has joined #asahi
17:50quarkyalice has quit [Remote host closed the connection]
17:52quarkyalice has joined #asahi
18:27quarkyalice has quit [Remote host closed the connection]
18:29quarkyalice has joined #asahi
19:17quarkyalice has quit [Ping timeout: 480 seconds]
19:32quarkyalice has joined #asahi
20:25quarkyalice has quit [Ping timeout: 480 seconds]
21:47bps has quit [Ping timeout: 480 seconds]
22:11jn has quit [Remote host closed the connection]
22:14riker77_ has joined #asahi
22:14jn has joined #asahi
22:16riker77 has quit [Ping timeout: 480 seconds]
22:16riker77_ is now known as riker77
22:49amwpipcet[m]: mplayer says '[H264] 1920x1080 24bpp 120.000 fps 20315.1 kbps + aac audio' - just raw from the phone
22:50amwsven: The devel branch is much more stable but still has issues, files disappear and have wrong permissions