Re: [PATCH v2 4/7] spmi: apple: Implement remaining commands

Sasha Finkelstein <[email protected]> Sun, 2 Aug 2026 13:33:34 +0200
Newsgroups dev.linux.lists.asahi,org.infradead.lists.linux-arm-kernel,org.kernel.vger.linux-devicetree,org.kernel.vger.linux-kernel
Message-ID <[email protected]>
On Aug 2, 2026, at 13:18, Janne Grunau <[email protected]> wrote:
[...]

>> if (!(readl(spmi->regs + SPMI_STATUS_REG) & SPMI_RX_FIFO_EMPTY))
>> dev_warn(&ctrl->dev, "FIFO has extra data\n");
>> 
>> - if ((~reply >> SPMI_REPLY_FRAME_PARITY_OFFSET) & ((1 << len) - 1)) {
>> + if (!ilen && !(reply & SPMI_REPLY_ACK)) {
>> + dev_err(&ctrl->dev, "command not acknowledged\n");
>> + return -EIO;
>> + }
>> + if ((~reply >> SPMI_REPLY_FRAME_PARITY_OFFSET) & ((1 << ilen) - 1)) {
> 
> Is the parity check useful for write commands? I'm not sure if packing
> all command processing into a single function is a good idea for code
> readability. The diff is annoying to read.

Not useful, but on the contrary I like that every command is sent via
a unified path, instead of using similar, but slightly different
functions