<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux-dev/drivers/spmi, branch master</title>
<subtitle>Linux kernel development work - see feature branches</subtitle>
<id>https://git.zx2c4.com/linux-dev/atom/drivers/spmi?h=master</id>
<link rel='self' href='https://git.zx2c4.com/linux-dev/atom/drivers/spmi?h=master'/>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/'/>
<updated>2022-09-30T12:33:23Z</updated>
<entry>
<title>spmi: pmic-arb: increase SPMI transaction timeout delay</title>
<updated>2022-09-30T12:33:23Z</updated>
<author>
<name>David Collins</name>
<email>collinsd@codeaurora.org</email>
</author>
<published>2022-09-30T00:50:18Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=9c573cdcf913e0a38bc260634017be3174595c56'/>
<id>urn:sha1:9c573cdcf913e0a38bc260634017be3174595c56</id>
<content type='text'>
Increase the SPMI transaction timeout delay from 100 us to
1000 us in order to account for the slower execution time
found on some simulator targets.

Signed-off-by: David Collins &lt;collinsd@codeaurora.org&gt;
Signed-off-by: Fenglin Wu &lt;quic_fenglinw@quicinc.com&gt;
Link: https://lore.kernel.org/r/1655004286-11493-11-git-send-email-quic_fenglinw@quicinc.com
Signed-off-by: Stephen Boyd &lt;sboyd@kernel.org&gt;
Link: https://lore.kernel.org/r/20220930005019.2663064-10-sboyd@kernel.org
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>spmi: pmic-arb: block access for invalid PMIC arbiter v5 SPMI writes</title>
<updated>2022-09-30T12:33:23Z</updated>
<author>
<name>David Collins</name>
<email>collinsd@codeaurora.org</email>
</author>
<published>2022-09-30T00:50:17Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=c8669773c74e26ceb2412215a2db40399e3fe119'/>
<id>urn:sha1:c8669773c74e26ceb2412215a2db40399e3fe119</id>
<content type='text'>
The system crashes due to an access permission violation when
writing to a PMIC peripheral which is not owned by the current
ee.  Add a check for PMIC arbiter version 5 for such invalid
write requests and return an error instead of crashing the
system.

Signed-off-by: David Collins &lt;collinsd@codeaurora.org&gt;
Signed-off-by: Fenglin Wu &lt;quic_fenglinw@quicinc.com&gt;
Link: https://lore.kernel.org/r/1655004286-11493-8-git-send-email-quic_fenglinw@quicinc.com
Signed-off-by: Stephen Boyd &lt;sboyd@kernel.org&gt;
Link: https://lore.kernel.org/r/20220930005019.2663064-9-sboyd@kernel.org
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>spmi: pmic-arb: correct duplicate APID to PPID mapping logic</title>
<updated>2022-09-30T12:33:23Z</updated>
<author>
<name>David Collins</name>
<email>collinsd@codeaurora.org</email>
</author>
<published>2022-09-30T00:50:16Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=1f1693118c2476cb1666ad357edcf3cf48bf9b16'/>
<id>urn:sha1:1f1693118c2476cb1666ad357edcf3cf48bf9b16</id>
<content type='text'>
Correct the way that duplicate PPID mappings are handled for PMIC
arbiter v5.  The final APID mapped to a given PPID should be the
one which has write owner = APPS EE, if it exists, or if not
that, then the first APID mapped to the PPID, if it exists.

Fixes: 40f318f0ed67 ("spmi: pmic-arb: add support for HW version 5")
Signed-off-by: David Collins &lt;collinsd@codeaurora.org&gt;
Signed-off-by: Fenglin Wu &lt;quic_fenglinw@quicinc.com&gt;
Link: https://lore.kernel.org/r/1655004286-11493-7-git-send-email-quic_fenglinw@quicinc.com
Signed-off-by: Stephen Boyd &lt;sboyd@kernel.org&gt;
Link: https://lore.kernel.org/r/20220930005019.2663064-8-sboyd@kernel.org
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>spmi: pmic-arb: add support to dispatch interrupt based on IRQ status</title>
<updated>2022-09-30T12:33:23Z</updated>
<author>
<name>Ashay Jaiswal</name>
<email>ashayj@codeaurora.org</email>
</author>
<published>2022-09-30T00:50:15Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=4df88fe5b631bb9e381880b4cca73e91750afffe'/>
<id>urn:sha1:4df88fe5b631bb9e381880b4cca73e91750afffe</id>
<content type='text'>
Current implementation of SPMI arbiter dispatches interrupt based on the
Arbiter's accumulator status, in some cases the accumulator status may
remain zero and the interrupt remains un-handled. Add logic to dispatch
interrupts based Arbiter's IRQ status if the accumulator status is zero.

Signed-off-by: Ashay Jaiswal &lt;ashayj@codeaurora.org&gt;
Signed-off-by: David Collins &lt;collinsd@codeaurora.org&gt;
Signed-off-by: Fenglin Wu &lt;quic_fenglinw@quicinc.com&gt;
Link: https://lore.kernel.org/r/1655004286-11493-6-git-send-email-quic_fenglinw@quicinc.com
Signed-off-by: Stephen Boyd &lt;sboyd@kernel.org&gt;
Link: https://lore.kernel.org/r/20220930005019.2663064-7-sboyd@kernel.org
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>spmi: pmic-arb: check apid against limits before calling irq handler</title>
<updated>2022-09-30T12:33:23Z</updated>
<author>
<name>David Collins</name>
<email>collinsd@codeaurora.org</email>
</author>
<published>2022-09-30T00:50:14Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=191adbdd26f1a26c9302369b2701bfddf8c0780e'/>
<id>urn:sha1:191adbdd26f1a26c9302369b2701bfddf8c0780e</id>
<content type='text'>
Check that the apid for an SPMI interrupt falls between the
min_apid and max_apid that can be handled by the APPS processor
before invoking the per-apid interrupt handler:
periph_interrupt().

This avoids an access violation in rare cases where the status
bit is set for an interrupt that is not owned by the APPS
processor.

Signed-off-by: David Collins &lt;collinsd@codeaurora.org&gt;
Signed-off-by: Fenglin Wu &lt;quic_fenglinw@quicinc.com&gt;
Link: https://lore.kernel.org/r/1655004286-11493-5-git-send-email-quic_fenglinw@quicinc.com
Signed-off-by: Stephen Boyd &lt;sboyd@kernel.org&gt;
Link: https://lore.kernel.org/r/20220930005019.2663064-6-sboyd@kernel.org
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>spmi: pmic-arb: do not ack and clear peripheral interrupts in cleanup_irq</title>
<updated>2022-09-30T12:33:23Z</updated>
<author>
<name>Subbaraman Narayanamurthy</name>
<email>subbaram@codeaurora.org</email>
</author>
<published>2022-09-30T00:50:13Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=b6c1761721193c52234e3ed048e4d16ab527bb74'/>
<id>urn:sha1:b6c1761721193c52234e3ed048e4d16ab527bb74</id>
<content type='text'>
Currently, cleanup_irq() is invoked when a peripheral's interrupt
fires and there is no mapping present in the interrupt domain of
spmi interrupt controller.

The cleanup_irq clears the arbiter bit, clears the pmic interrupt
and disables it at the pmic in that order. The last disable in
cleanup_irq races with request_irq() in that it stomps over the
enable issued by request_irq. Fix this by not writing to the pmic
in cleanup_irq. The latched bit will be left set in the pmic,
which will not send us more interrupts even if the enable bit
stays enabled.

When a client wants to request an interrupt, use the activate
callback on the irq_domain to clear latched bit. This ensures
that the latched, if set due to the above changes in cleanup_irq
or when the bootloader leaves it set, gets cleaned up, paving way
for upcoming interrupts to trigger.

With this, there is a possibility of unwanted triggering of
interrupt right after the latched bit is cleared - the interrupt
may be left enabled too. To avoid that, clear the enable first
followed by clearing the latched bit in the activate callback.

Fixes: 6bc546e71e50 ("spmi: pmic-arb: cleanup unrequested irqs")
Fixes: 02abec3616c1 ("spmi: pmic-arb: rename pa_xx to pmic_arb_xx and other cleanup")
Signed-off-by: Subbaraman Narayanamurthy &lt;subbaram@codeaurora.org&gt;
[collinsd@codeaurora.org: fix merge conflict]
Signed-off-by: David Collins &lt;collinsd@codeaurora.org&gt;
Signed-off-by: Fenglin Wu &lt;quic_fenglinw@quicinc.com&gt;
Link: https://lore.kernel.org/r/1655004286-11493-4-git-send-email-quic_fenglinw@quicinc.com
Signed-off-by: Stephen Boyd &lt;sboyd@kernel.org&gt;
Link: https://lore.kernel.org/r/20220930005019.2663064-5-sboyd@kernel.org
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>spmi: pmic-arb: handle spurious interrupt</title>
<updated>2022-09-30T12:33:23Z</updated>
<author>
<name>Fenglin Wu</name>
<email>quic_fenglinw@quicinc.com</email>
</author>
<published>2022-09-30T00:50:12Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=abb9088b3a39cfec1321e93170ee3c0c1255fd9d'/>
<id>urn:sha1:abb9088b3a39cfec1321e93170ee3c0c1255fd9d</id>
<content type='text'>
Call handle_bad_irq() when the summary interrupt is fired spuriously.

Signed-off-by: Fenglin Wu &lt;quic_fenglinw@quicinc.com&gt;
Link: https://lore.kernel.org/r/1655004286-11493-3-git-send-email-quic_fenglinw@quicinc.com
Signed-off-by: Stephen Boyd &lt;sboyd@kernel.org&gt;
Link: https://lore.kernel.org/r/20220930005019.2663064-4-sboyd@kernel.org
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>spmi: pmic-arb: add a print in cleanup_irq</title>
<updated>2022-09-30T12:33:22Z</updated>
<author>
<name>Abhijeet Dharmapurikar</name>
<email>adharmap@codeaurora.org</email>
</author>
<published>2022-09-30T00:50:11Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=33c912d3c5efea62298921627fad7f5ad396b8fb'/>
<id>urn:sha1:33c912d3c5efea62298921627fad7f5ad396b8fb</id>
<content type='text'>
The cleanup_irq() was meant to clear and mask interrupts that were
left enabled in the hardware but there was no interrupt handler
registered for it. Add an error print when it gets invoked.

Signed-off-by: Abhijeet Dharmapurikar &lt;adharmap@codeaurora.org&gt;
Signed-off-by: David Collins &lt;collinsd@codeaurora.org&gt;
Signed-off-by: Fenglin Wu &lt;quic_fenglinw@quicinc.com&gt;
Link: https://lore.kernel.org/r/1655004286-11493-2-git-send-email-quic_fenglinw@quicinc.com
Signed-off-by: Stephen Boyd &lt;sboyd@kernel.org&gt;
Link: https://lore.kernel.org/r/20220930005019.2663064-3-sboyd@kernel.org
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>drivers: spmi: Directly use ida_alloc()/free()</title>
<updated>2022-09-30T12:33:22Z</updated>
<author>
<name>keliu</name>
<email>liuke94@huawei.com</email>
</author>
<published>2022-09-30T00:50:10Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=9357fc3b3b85a7d9f0dedf5446222a26957852b4'/>
<id>urn:sha1:9357fc3b3b85a7d9f0dedf5446222a26957852b4</id>
<content type='text'>
Use ida_alloc()/ida_free() instead of deprecated
ida_simple_get()/ida_simple_remove() .

Signed-off-by: keliu &lt;liuke94@huawei.com&gt;
Link: https://lore.kernel.org/r/20220527071338.2359733-1-liuke94@huawei.com
Signed-off-by: Stephen Boyd &lt;sboyd@kernel.org&gt;
Link: https://lore.kernel.org/r/20220930005019.2663064-2-sboyd@kernel.org
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>spmi: add a helper to look up an SPMI device from a device node</title>
<updated>2022-06-18T12:48:19Z</updated>
<author>
<name>Caleb Connolly</name>
<email>caleb.connolly@linaro.org</email>
</author>
<published>2022-04-29T22:08:56Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=9a2139c2912ea64e288749c21452930dc752d4fd'/>
<id>urn:sha1:9a2139c2912ea64e288749c21452930dc752d4fd</id>
<content type='text'>
The helper function spmi_device_from_of() takes a device node and
returns the SPMI device associated with it.
This is like of_find_device_by_node but for SPMI devices.

Signed-off-by: Caleb Connolly &lt;caleb.connolly@linaro.org&gt;
Acked-by: Stephen Boyd &lt;sboyd@kernel.org&gt;
Link: https://lore.kernel.org/r/20220429220904.137297-2-caleb.connolly@linaro.org
Signed-off-by: Jonathan Cameron &lt;Jonathan.Cameron@huawei.com&gt;
</content>
</entry>
</feed>
