cnxsoft has quit [Read error: Connection reset by peer]
JohnDoe_71Rus has joined #linux-sunxi
sunshavi has quit [Ping timeout: 480 seconds]
JohnDoe_71Rus has quit []
cnxsoft1 has quit [Ping timeout: 480 seconds]
dikiy has joined #linux-sunxi
apritzel_ has joined #linux-sunxi
vagrantc has joined #linux-sunxi
cnxsoft has joined #linux-sunxi
vagrantc has quit [Ping timeout: 480 seconds]
cnxsoft has quit [Read error: Connection reset by peer]
cnxsoft has joined #linux-sunxi
apritzel_ has quit [Ping timeout: 480 seconds]
apritzel_ has joined #linux-sunxi
apritzel_ has quit [Ping timeout: 480 seconds]
cnxsoft1 has joined #linux-sunxi
cnxsoft has quit [Ping timeout: 480 seconds]
chuangzhu has quit [Read error: Connection reset by peer]
chuangzhu has joined #linux-sunxi
dikiy has quit [Ping timeout: 480 seconds]
JohnDoe_71Rus has joined #linux-sunxi
dikiy has joined #linux-sunxi
dikiy has quit [Ping timeout: 480 seconds]
apritzel_ has joined #linux-sunxi
Danct12 has quit [Quit: Quitting]
Danct12 has joined #linux-sunxi
sunshavi has joined #linux-sunxi
cnxsoft1 has quit [Ping timeout: 480 seconds]
cnxsoft has joined #linux-sunxi
Danct12 has quit [Remote host closed the connection]
<MoeIcenowy>
smaeul: do your `dt-bindings: interrupt-controller: Require trigger type for T-HEAD PLIC` patch break DT compatibility?
<MoeIcenowy>
the DT binding w/ 1 cell for c900-plic is available in 5.19 stable version
chewitt has joined #linux-sunxi
Danct12 has joined #linux-sunxi
<MoeIcenowy>
BTW should we just change the binding to suggest 2 cells for all PLICs?
<MoeIcenowy>
It's only SiFive's PLIC assumes level for all interrupts
chewitt has quit [Quit: Zzz..]
ftg has joined #linux-sunxi
dikiy has joined #linux-sunxi
cnxsoft has quit []
<smaeul>
MoeIcenowy: technically yes, but nothing should have been using it yet. if you want, it would not be too hard to accept either number of cells for all variants
<MoeIcenowy>
smaeul: well in fact I am doing my custom SoC with C906 on a FPGA
<MoeIcenowy>
and discovered this ;-)
<smaeul>
in that case you should fix the bugs in the PLIC and use a different compatible anyway ;-)
<smaeul>
at least in openc906, neither the edge nor level trigger behavior is quite correct
grming has joined #linux-sunxi
dikiy has quit [Read error: Connection reset by peer]
bauen1_ has quit [Ping timeout: 480 seconds]
apritzel_ has quit [Ping timeout: 480 seconds]
dikiy has joined #linux-sunxi
apritzel_ has joined #linux-sunxi
vagrantc has joined #linux-sunxi
<MoeIcenowy>
smaeul: how are they incorrect?
<MoeIcenowy>
smaeul: BTW what timer is you WIP D1 kernel using now?
<MoeIcenowy>
riscv-timer or sun4i-timer?
<MoeIcenowy>
if the former, how is it initialized?
<smaeul>
MoeIcenowy: edge mode has no queue or double-pending state, so if a second edge arrives before the first EOI, it is lost entirely
<smaeul>
level mode is implemented as edge mode with retriggering during EOI (if level is high during EOI, set pending again), so it doesn't have true level semantics of removing the pending state if the level goes low before the interrupt is handled
<smaeul>
(if the interrupt goes away, due to external events or polling, the interrupt handler should never run)
apritzel_ has left #linux-sunxi [#linux-sunxi]
apritzel has joined #linux-sunxi
<smaeul>
MoeIcenowy: Linux currently chooses sun4i timer for both clocksource and clockevent. ideally it would choose riscv timer for clocksource
<apritzel>
smaeul: so this is T-HEADs implementation not conforming to the PLIC spec? Or a flaw in the spec?
bauen1 has joined #linux-sunxi
<smaeul>
apritzel: the spec leaves the trigger type unspecified, with the intention that software should not have to know/care
<apritzel>
so the PLIC input line handling has to match what the device implements, and handle this in hardware?
<smaeul>
that's the intention, yes
<smaeul>
so the C906 PLIC is technically conformant here, but in such a way that software needs to know the trigger type anyway to avoid missing interrupts
<smaeul>
because the spec itself is bad and suggests that queueing edges is optional
<apritzel>
but missing edge triggered IRQs is somewhat unavoidable, or at least coalescing is expected?
<smaeul>
coalescing is fine, and is what you get if you reset the trigger at ack (at the beginning of the ISR), but you miss interrupts if you reset the trigger at eoi (at the end of the ISR)
<smaeul>
> So an interrupt will never go pending while it is active.
<smaeul>
that's the important part
<smaeul>
s/ack/claim/ to use the PLIC terminology
<apritzel>
ah, was just wondering how this matches the diagram on Github ;-)
<apritzel>
so this "reset the trigger" is happening automatically at EOI? Or can a driver do this explicitly?
<smaeul>
yes, the reset happens at EOI by writing the claim/completion register. so the driver can work around it by doing the EOI write before actually running the ISR
<smaeul>
but that means the software flow differs based on the trigger type -- so you need the trigger type in the DT -- and that breaks the intention of software not having to know/care about the trigger type
<apritzel>
isn't the trigger type something that the device dictates anyway? So a driver could know this without looking at firmware tables?
bauen1_ has joined #linux-sunxi
<smaeul>
assuming the trigger type isn't configurable in the device's HDL, sure
bauen1 has quit [Ping timeout: 480 seconds]
dikiy_ has joined #linux-sunxi
<MoeIcenowy>
smaeul: if the spec is written in this way, maybe we should make all device interrupt-cells = <2>
<MoeIcenowy>
and keep sifive level-only things only as compatibility fallbacks
<smaeul>
apritzel: but I'll bet there are some compatibles out there for devices with multiple variants, where the trigger type isn't discoverable via reading a register
<smaeul>
so in a sense, the DT cell is there for the benefit of the client device driver
dikiy has quit [Ping timeout: 480 seconds]
<smaeul>
at least for the D1, I'm pretty sure everything is level anyway, so this is all just for "correctness"
<smaeul>
MoeIcenowy: I think this is already handled by the base compatible, e.g. thead,c900-plic is not compatible with sifive,plic-1.0.0
<smaeul>
so we could accomplish this by not using sifive,plic-1.0.0 for new devices
<apritzel>
mmh, I would assume that the trigger type is more driven by the IRQ (and device) *semantic*, so for instance a UART FIFO full IRQ is inherently level
dikiy has joined #linux-sunxi
dikiy_ has quit [Ping timeout: 480 seconds]
megi has quit [Quit: WeeChat 3.6]
megi has joined #linux-sunxi
grming has quit [Quit: Konversation terminated!]
apritzel has quit [Ping timeout: 480 seconds]
digetx is now known as Guest488
digetx has joined #linux-sunxi
Guest488 has quit [Ping timeout: 480 seconds]
JohnDoe_71Rus has quit []
dikiy_ has joined #linux-sunxi
dikiy has quit [Ping timeout: 480 seconds]
dikiy_ has quit [Read error: Connection reset by peer]
dikiy has joined #linux-sunxi
apritzel has joined #linux-sunxi
grming has joined #linux-sunxi
bauen1_ has quit [Ping timeout: 480 seconds]
bauen1 has joined #linux-sunxi
bauen1 has quit [Remote host closed the connection]