ChanServ changed the topic of #asahi-dev to: Asahi Linux: porting Linux to Apple Silicon macs | Non-development talk: #asahi | General development | GitHub: https://alx.sh/g | Wiki: https://alx.sh/w | Logs: https://alx.sh/l/asahi-dev
ddxtanx has quit [Remote host closed the connection]
john-cabaj has joined #asahi-dev
ddxtanx has joined #asahi-dev
hdbngr has joined #asahi-dev
hdbngr has quit [Ping timeout: 480 seconds]
DannyB has joined #asahi-dev
hexdump02 has joined #asahi-dev
hexdump01 has quit [Ping timeout: 480 seconds]
tobhe has joined #asahi-dev
tobhe_ has quit [Ping timeout: 480 seconds]
skipwich has quit [Remote host closed the connection]
skipwich has joined #asahi-dev
john-cabaj has quit [Ping timeout: 480 seconds]
hdbngr has joined #asahi-dev
hdbngr has quit [Ping timeout: 480 seconds]
ece314378925355451680698427415 has joined #asahi-dev
cylm has quit [Ping timeout: 480 seconds]
john-cabaj has joined #asahi-dev
nora_ has joined #asahi-dev
nora has quit [Ping timeout: 480 seconds]
skipwich has quit [Ping timeout: 480 seconds]
skipwich has joined #asahi-dev
john-cabaj has quit [Ping timeout: 480 seconds]
hdbngr has joined #asahi-dev
hdbngr has quit [Ping timeout: 480 seconds]
al3xtjames2 has joined #asahi-dev
al3xtjames2 has quit [Quit: al3xtjames2]
al3xtjames2 has joined #asahi-dev
hdbngr has joined #asahi-dev
hdbngr has quit [Ping timeout: 480 seconds]
hdbngr has joined #asahi-dev
hdbngr has quit [Ping timeout: 480 seconds]
hdbngr has joined #asahi-dev
hdbngr has quit [Ping timeout: 480 seconds]
hdbngr has joined #asahi-dev
hdbngr has quit [Ping timeout: 480 seconds]
ravikant_ has joined #asahi-dev
ece314378925355451680698427415 has quit [Ping timeout: 480 seconds]
<chaos_princess> anyone knows how to tell the kernel to not light up a core cluster unless necessary?
<sven> ah well. i'm starting to remember the tbt mess now. acio depends on the iommu but the iommu only works once acio is at least partially up. this is going to be fun 🙃
<chaos_princess> kinda like with aop and admac where aop wants to do admac power management itself
<sven> it's gonna be rather annoying to represent this in the device tree
<sven> how did you solve aop and admac?
<chaos_princess> removing all register accesses from probe
<sven> this gets extra complicated because i have to shut down the iommu again before i shut down the PHY
<sven> but maybe i can do something similar. just have to check if there's a point in the iommu api where i can trigger that deferred probe and the shutdown again
<jannau> chaos_princess: how is the kernel to decide necessary? Are you looking into some sort of CPU idle management which tries to keep an entire cluster idle? i.e. keeps one of the perf core cluster idle on t60x0 when only 4 perf cores are used
<chaos_princess> yep
<chaos_princess> i am not even fully sure what "necessary" means, kinda hoped android already has some solution, but probably to not light up the second p-cluster if utilization of the first one is below some threshold
<jannau> I'd not be surprised if android has some out of band management for that otherwise I'd expect that's something the scheduler needs to handle
chadmed has quit [Quit: Konversation terminated!]
<jannau> https://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git/commit/?h=sched/core&id=778c558f49a2cb3dc7b18a80ff515e82aa813627 has you covered except that does the opposite of what you want
chadmed has joined #asahi-dev
<chaos_princess> lol. thanks, looks helpful.
<jannau> maybe there is a sched_ext scheduler which does this (or it's easy to add this via sched_ext)
<jannau> scx_nest seems match somewhat
<jannau> otherwise I'd say that's something https://docs.kernel.org/scheduler/sched-energy.html should consider
<chadmed> android has a litany of insane schedulers that all do weird shit incompatible with upstream
<chadmed> i think what youre after is probably the job of EAS and a cpuidle driver working in concert
<jannau> is it acceptable to add bcm4388 to brcmfmac's dt-bindings without driver support?
<chaos_princess> iirc bindings need either a driver, or a tree that uses them
<chadmed> unfortunately i dont think EAS has any smarts in it to deal with clusters sanely
<sven> should be fine, we also got those gpu bindings upstream and only chaos tree is using them so far
<sven> after all the bindings are supposed to just describe hardware...
<chadmed> according to some theyre not even supposed to do that :P
hdbngr has joined #asahi-dev
<jannau> I have the wifi node in the t602x DT submission so the compatible is used (and causes dtbs_check complaints if it's omitted from the bindings)
<chaos_princess> it should be ok then
<sven> yeah
<kettenis> jannau: at some point we need to discuss the power control for the wifi chip with upstream
hdbngr has quit [Ping timeout: 480 seconds]
ravikant_ has quit [Ping timeout: 480 seconds]
<chadmed> v2 of smc stuff sent
<jannau> I plan to send it later today
<jannau> kettenis: I've seen there is power handling in marcan's outstanding patches prior to bcm4388 support
<jannau> shall I ask for acked-by to take the dt-bindings patches through the asahi tree?
<sven> https://lore.kernel.org/asahi/12ab93b7-1fc2-4ce0-926e-c8141cfe81bf@kernel.org/ "You just need to remember not to grow the old items/pattern with generic compatible." i'm not sure if he also wants us to stop adding any compatible hardware to the generic fallback list
<jannau> I missed that. That would require driver changes as we would have to add :apple,t8110-dart" to the driver to use compatible = "apple,t6020-dart", "apple,t8110-dart"; in new device trees
<jannau> I'll ask for a clarification
<sven> ack
<sven> i think dart is actually fine because there's no "apple,dart" fallback
<sven> but he may want something like "apple,t6020-spi", "apple,t8103-spi" instead of "apple,t6020-spi", "apple,spi"
<chaos_princess> does anyone know anything about "ioa-parent" (it is dart and maybe pmgr related)
<jannau> no. looks like mmio addresses but the trailing 31 zeros are suspicios
<chaos_princess> it is a mmio address, and it writes there
ravikant_ has joined #asahi-dev
john-cabaj has joined #asahi-dev
nafod has quit [Ping timeout: 480 seconds]
<kettenis> jannau: do you remember where? We have pwren-gpios in the PCIe port nodes, but that got NACKed IIRC
<jannau> the driver code is D3 handling. i.e. completely unrelated
<jannau> why did I think we had the pwren-gpios in in the dt-bindings? I looked for mac pro support where it's more complicated due to the pcie switch
<jannau> linux has since a while a PCI slot power control driver.
<jannau> that alone is not enough since it needs to be synchronized with port probing
<jannau> I want to look if https://lore.kernel.org/linux-pci/20250819-pci-pwrctrl-perst-v1-0-4b74978d2007@oss.qualcomm.com/ works for the mac pro. if it does it should work for all other devices
<jannau> the pci slot power control driver uses the pcie supplies from https://github.com/devicetree-org/dt-schema/blob/v2024.11/dtschema/schemas/pci/pci-bus-common.yaml#L153 which we could back by gpio driven dummy regulator
<kettenis> I remember at some point during the discussion the point was raised that there is no "slot"
<kettenis> I think a similar discussion eventually led to drivers/power/sequencing/pwrseq-qcom-wcn.c
<kettenis> although that seems overkill for when there just is a single GPIO that needs to be toggled
<jannau> the "slot" controller matches "pciclass,0604" which we have
<jannau> ah, the supplies mention slot
<kettenis> so yes, for the mac pro that is the answer
<jannau> it uses of_regulator_bulk_get_all() so we could add our own -supplies
<jannau> the mac pro has this problem only for internal devices (which are still behind the pcie switch) so speaking about slots sounds equally wrong
<jannau> Krzysztof replied. 15 or so more patches, redoing the dt-bindings and updating the device trees
nafod has joined #asahi-dev
<jannau> I'll add the generic compatibles for apple,t6020-* in m1n1
<sven> yeah, i think it makes sense here to keep the generic ones around for a while
<sven> maybe drop them a year or two down the road
<jannau> feels silly to do with "apple,pmgr" which isn't even used in a driver. it's relying on "syscon", "simple-mfd"
<kettenis> OpenBSD uses apple,pmgr
<kettenis> I thought the plan was to keep adding the generic compatibles that are already upstream?
cylm has joined #asahi-dev
<jannau> maybe we should ask for an exception for t6020 which already has downstream use outside of linux
<jannau> apparently not for new submissions even if they are compatible with generic one
<nickchan> ill post a patch that fixes the sart binding description I guess
<sven> nah
<sven> it's about the commit description
<nickchan> the existing binding description does say it is incompatible though so I don't get where the "unusual" thing come from
<nickchan> (the only? difference between sart v0 and v1 is differences in the config flags)
<sven> he might've only read the patch. i can still adjust the commit description since i haven't send out the pull request yet
<kettenis> sigh, oh well, I guess I just give up
<sven> mood
<sven> let's add least add back the generic compatible inside m1n1
<kettenis> just keep shipping the device trees I have now and see what needs to be done in a year when they've finally decided what shade to paint their bikeshed in
<jannau> I'll re-add the missing generic compatibles for t6020 in m1n1. for all I care we can leave the code in m1n1 forever
<sven> we'd probably forgot to remove it even if we planned to do it 2 years from now tbh
<nickchan> sven: how about the content of the sart binding commit? I can send a fixed version.
<sven> what content needs to change? i can always back up the full commit and replace it with another one
<nickchan> The binding description
<sven> oh, it doesn't already mention SARTv0 but only 1,2 and 3?
<nickchan> sven: right and a14 has sartv1
<nickchan> not v2
<sven> hrm
<sven> let me think about it, but i could also just replace the entire commit
<nickchan> i am thinking about replacing the entire commit as well
<jannau> I'll use M1 as base compatible (if applicable) as that's what the driver was written for
<sven> jannau: ack
<sven> nickchan: some part of me just wants to be like "oh well, the commit is already upstream, too late" tbh :D
<sven> let me reply to him on the weekend, then we can figure out what we'll do
<jannau> let's see if there's a significant runtime impact of patching the whole DT. that might remind us of removing it
chadmed has quit [Quit: Konversation terminated!]
chadmed has joined #asahi-dev
<sven> do we already increase the cpu frequency to maximum inside m1n1? :>
<nickchan> no
<nickchan> well not any apple silicon mac socs anyways
<nickchan> some of the olders socs does use maxed frequency in m1n1
<nickchan> also looking at the sart0 code that I did submit it looks like the filter entry size is up to... 31-bit?
<nickchan> APPLE_SART0_CONFIG_SIZE shifted by APPLE_SART0_CONFIG_SIZE_SHIFT
<nickchan> the config size bits is the range of low bits the hw allowed me to set the bits to 1
<nickchan> sven: in case if you want a more rigorous description of what I just said see here: https://github.com/HoolockLinux/linux/commit/eeebce3a2bafc707ea67c1db85ba8028ef345092
<nickchan> this is also a draft of a possible replacement commit
<nickchan> well the whole knowledge of sart0 comes from me trying to set the registers in all to 0xffffffffffffffff and see what actually gets set
<sven> "Add bindings for SARTv0 as found on Apple A11 SoC." -> "dd bindings for SARTv0 as found on Apple A11 SoC, which is incompatible with the previously described versions since it uses a different MMIO layout"
<jannau> I'm actually not quite about what exactly Krzysztof complains. I don't think generic implementation / version compatibles like "nvme-ans2", "asc-mailbox-v4", "aic2" are uncommon nor did we start with that.
<jannau> "apple,spi" wasn't a good idea and in our case having just the unrelieable information from the ADT is an argument for only using SoC specific ones
<nickchan> there's at least two incompatible variants for the spi
<nickchan> one found on Samsung S5L8700 all the way to T8030 and another one found since T8101
<kettenis> but that's a samsung hardware block, not an apple one
<jannau> the samsung one wouldn't use "apple,spi" though
<nickchan> the new one is still based on the old one
<nickchan> it'd just be apple,s5l8960x-spi most likely
<nickchan> maybe I should look at whatever the ipod linux people are doing
<sven> jannau: yeah, i dunno, but not a fight i'm willing to fight. i think with nvme the mistake was just nvme-ans2 while the controller is actually nvme-ans3 on the M!
<sven> *M1
<chaos_princess> just to be thorough, i assume we don't care about fabric and ecc errors, right?
<sven> what did you run into? :D
<chaos_princess> pmgr turns on error reporting on a bunch of fabric bits, and then... idk, i have no idea how to decode fabric errors as i can't observe them :P
opticron has quit [Read error: Connection reset by peer]
opticron has joined #asahi-dev
<sven> ah, in that case it sounds like a curiosity but nothing i'd spend time on right now
ravikant_ has quit []
<jannau> I'm troubled by writing a justification beyond "we agreed to not use them" for the commit messages
<jannau> I'm annoyed but not annoyed enought to fight it either
<sven> yeah :/
<sven> maybe put a link to the thread in there?
<sven> "After discussion with the devicetree maintainers we agreed to not extend the list with the generic compatible anymore [1]"
myrrhk has joined #asahi-dev
myrrhk has quit [Remote host closed the connection]
___nick___ has joined #asahi-dev
<sven> https://git.kernel.org/pub/scm/linux/kernel/git/sven/linux.git/log/?h=wip/atcphy pretty happy with this now, will wait for feedback from heikki for tipd and then submit that afterwards
___nick___ has quit []
___nick___ has joined #asahi-dev
___nick___ has quit []
<sven> https://github.com/AsahiLinux/m1n1/pull/489/files fully untested fuses for !t8103 converted with a hacky python script
___nick___ has joined #asahi-dev
<chaos_princess> commit message says 6002, but i don't see any of those
<sven> uh.. let me double check what happened there
<sven> ah, they are the same as for 6000 and I deleted too much :D
<sven> do you have a t6002 adt and can check the atcphy compatible?
<chaos_princess> sec
<sven> might just be atc-phy,t6000 there as well, then I'll just adjust the commit message
<chaos_princess> atc-phy,t6000
<sven> ok
<sven> i'll add a comment
<sven> pushed
<chaos_princess> ok, i might be reading it wrong but the offsets don't really make sense
<chaos_princess> every single mmio under atc-phy5 starts with the second die offset
<chaos_princess> and in the tunables, those seem to be on first
<sven> hrm.. did i mess something up in the python script then
<sven> or did we mess up the fdt?
<chaos_princess> Container: addr = 0x00000020922BC000 size = 0x0000000000002000 - this seems to be the tunable mmio from atcphy 5
<jannau> the fdt doesn't have the real mmio offsets
<chaos_princess> (add 2000000000 for io offset)
<jannau> the addresses are translated via ranges in soc
<sven> the script uses libfdt via python bindings on the .dtb file fwiw
<sven> oh, but i'm using it wrong i think
<jannau> libfdt doesn't do the translation, see dt_get_address() in m1n1's src/devicetree.c
<sven> yeah
<sven> that's the issue
<sven> good catch
<sven> updated
hdbngr has joined #asahi-dev
<sven> should've just adjusted the address manually instead of trying to fix that script :D
john-cabaj has quit [Ping timeout: 480 seconds]
hdbngr has quit [Ping timeout: 480 seconds]
jkangas has joined #asahi-dev
Mary has quit [Quit: .]
Mary has joined #asahi-dev
rivendell has joined #asahi-dev
hdbngr has joined #asahi-dev
rivendell has quit [Ping timeout: 480 seconds]
rivendell has joined #asahi-dev
hdbngr has quit [Ping timeout: 480 seconds]
hdbngr has joined #asahi-dev
hdbngr has quit [Ping timeout: 480 seconds]
hdbngr has joined #asahi-dev
bgb_ has quit [Remote host closed the connection]
bgb has joined #asahi-dev
i509vcb has joined #asahi-dev
___nick___ has quit [Remote host closed the connection]
DarkShadow4444 has joined #asahi-dev
DarkShadow44 has quit [Read error: Connection reset by peer]
bgb has quit [Remote host closed the connection]
bgb has joined #asahi-dev
Mary has quit [Quit: .]
Mary has joined #asahi-dev
john-cabaj has joined #asahi-dev
john-cabaj has quit [Ping timeout: 480 seconds]
hdbngr has quit [Ping timeout: 480 seconds]
linuxgemini has quit [Quit: Ping timeout (120 seconds)]
linuxgemini has joined #asahi-dev
rivendell has quit [Remote host closed the connection]
hdbngr has joined #asahi-dev
john-cabaj has joined #asahi-dev