<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux-stable.git/drivers/mailbox, branch v6.11</title>
<subtitle>Linux kernel stable tree</subtitle>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/'/>
<entry>
<title>mailbox: mtk-cmdq: Move devm_mbox_controller_register() after devm_pm_runtime_enable()</title>
<updated>2024-07-20T02:25:23+00:00</updated>
<author>
<name>Jason-JH.Lin</name>
<email>jason-jh.lin@mediatek.com</email>
</author>
<published>2024-07-18T14:17:04+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=a8bd68e4329f9a0ad1b878733e0f80be6a971649'/>
<id>a8bd68e4329f9a0ad1b878733e0f80be6a971649</id>
<content type='text'>
When mtk-cmdq unbinds, a WARN_ON message with condition
pm_runtime_get_sync() &lt; 0 occurs.

According to the call tracei below:
  cmdq_mbox_shutdown
  mbox_free_channel
  mbox_controller_unregister
  __devm_mbox_controller_unregister
  ...

The root cause can be deduced to be calling pm_runtime_get_sync() after
calling pm_runtime_disable() as observed below:
1. CMDQ driver uses devm_mbox_controller_register() in cmdq_probe()
   to bind the cmdq device to the mbox_controller, so
   devm_mbox_controller_unregister() will automatically unregister
   the device bound to the mailbox controller when the device-managed
   resource is removed. That means devm_mbox_controller_unregister()
   and cmdq_mbox_shoutdown() will be called after cmdq_remove().
2. CMDQ driver also uses devm_pm_runtime_enable() in cmdq_probe() after
   devm_mbox_controller_register(), so that devm_pm_runtime_disable()
   will be called after cmdq_remove(), but before
   devm_mbox_controller_unregister().

To fix this problem, cmdq_probe() needs to move
devm_mbox_controller_register() after devm_pm_runtime_enable() to make
devm_pm_runtime_disable() be called after
devm_mbox_controller_unregister().

Fixes: 623a6143a845 ("mailbox: mediatek: Add Mediatek CMDQ driver")
Signed-off-by: Jason-JH.Lin &lt;jason-jh.lin@mediatek.com&gt;
Reviewed-by: AngeloGioacchino Del Regno &lt;angelogioacchino.delregno@collabora.com&gt;
Signed-off-by: Jassi Brar &lt;jassisinghbrar@gmail.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
When mtk-cmdq unbinds, a WARN_ON message with condition
pm_runtime_get_sync() &lt; 0 occurs.

According to the call tracei below:
  cmdq_mbox_shutdown
  mbox_free_channel
  mbox_controller_unregister
  __devm_mbox_controller_unregister
  ...

The root cause can be deduced to be calling pm_runtime_get_sync() after
calling pm_runtime_disable() as observed below:
1. CMDQ driver uses devm_mbox_controller_register() in cmdq_probe()
   to bind the cmdq device to the mbox_controller, so
   devm_mbox_controller_unregister() will automatically unregister
   the device bound to the mailbox controller when the device-managed
   resource is removed. That means devm_mbox_controller_unregister()
   and cmdq_mbox_shoutdown() will be called after cmdq_remove().
2. CMDQ driver also uses devm_pm_runtime_enable() in cmdq_probe() after
   devm_mbox_controller_register(), so that devm_pm_runtime_disable()
   will be called after cmdq_remove(), but before
   devm_mbox_controller_unregister().

To fix this problem, cmdq_probe() needs to move
devm_mbox_controller_register() after devm_pm_runtime_enable() to make
devm_pm_runtime_disable() be called after
devm_mbox_controller_unregister().

Fixes: 623a6143a845 ("mailbox: mediatek: Add Mediatek CMDQ driver")
Signed-off-by: Jason-JH.Lin &lt;jason-jh.lin@mediatek.com&gt;
Reviewed-by: AngeloGioacchino Del Regno &lt;angelogioacchino.delregno@collabora.com&gt;
Signed-off-by: Jassi Brar &lt;jassisinghbrar@gmail.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>mailbox: zynqmp-ipi: Make polling period configurable</title>
<updated>2024-07-20T02:23:16+00:00</updated>
<author>
<name>Ben Levinsky</name>
<email>ben.levinsky@amd.com</email>
</author>
<published>2024-07-18T20:40:57+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=0e3bb6ee88874fc052a6f7a8eb18463faea0a63d'/>
<id>0e3bb6ee88874fc052a6f7a8eb18463faea0a63d</id>
<content type='text'>
There are cases where remote that is acking mailbox message can take longer
than the default tx_poll_period value. Therefore, enable this to be mutable.

Added tx_poll_period field while inserting the module to set the
poll period for ack after sending mailbox message.

Signed-off-by: Ben Levinsky &lt;ben.levinsky@amd.com&gt;
Acked-by: Michal Simek &lt;michal.simek@amd.com&gt;
Signed-off-by: Jassi Brar &lt;jassisinghbrar@gmail.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
There are cases where remote that is acking mailbox message can take longer
than the default tx_poll_period value. Therefore, enable this to be mutable.

Added tx_poll_period field while inserting the module to set the
poll period for ack after sending mailbox message.

Signed-off-by: Ben Levinsky &lt;ben.levinsky@amd.com&gt;
Acked-by: Michal Simek &lt;michal.simek@amd.com&gt;
Signed-off-by: Jassi Brar &lt;jassisinghbrar@gmail.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>mailbox: qcom-cpucp: fix 64BIT dependency</title>
<updated>2024-07-20T02:21:06+00:00</updated>
<author>
<name>Arnd Bergmann</name>
<email>arnd@arndb.de</email>
</author>
<published>2024-07-19T10:02:23+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=cbf5009580c7c86e9822b3e675df1762ea0a5a0a'/>
<id>cbf5009580c7c86e9822b3e675df1762ea0a5a0a</id>
<content type='text'>
This newly added driver fails compile testing on 32-bit architectures
because it relies on 64-bit MMIO register access:

drivers/mailbox/qcom-cpucp-mbox.c: In function 'qcom_cpucp_mbox_irq_fn':
drivers/mailbox/qcom-cpucp-mbox.c:54:18: error: implicit declaration of function 'readq'; did you mean 'readb'? [-Wimplicit-function-declaration]
   54 |         status = readq(cpucp-&gt;rx_base + APSS_CPUCP_RX_MBOX_STAT);
      |                  ^~~~~
      |                  readb
drivers/mailbox/qcom-cpucp-mbox.c:65:17: error: implicit declaration of function 'writeq'; did you mean 'writeb'? [-Wimplicit-function-declaration]
   65 |                 writeq(BIT(i), cpucp-&gt;rx_base + APSS_CPUCP_RX_MBOX_CLEAR);
      |                 ^~~~~~
      |                 writeb

Change the Kconfig dependency to disallow that configuration as well.

Fixes: 0e2a9a03106c ("mailbox: Add support for QTI CPUCP mailbox controller")
Signed-off-by: Arnd Bergmann &lt;arnd@arndb.de&gt;
Reviewed-by: Konrad Dybcio &lt;konrad.dybcio@linaro.org&gt;
Signed-off-by: Jassi Brar &lt;jassisinghbrar@gmail.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This newly added driver fails compile testing on 32-bit architectures
because it relies on 64-bit MMIO register access:

drivers/mailbox/qcom-cpucp-mbox.c: In function 'qcom_cpucp_mbox_irq_fn':
drivers/mailbox/qcom-cpucp-mbox.c:54:18: error: implicit declaration of function 'readq'; did you mean 'readb'? [-Wimplicit-function-declaration]
   54 |         status = readq(cpucp-&gt;rx_base + APSS_CPUCP_RX_MBOX_STAT);
      |                  ^~~~~
      |                  readb
drivers/mailbox/qcom-cpucp-mbox.c:65:17: error: implicit declaration of function 'writeq'; did you mean 'writeb'? [-Wimplicit-function-declaration]
   65 |                 writeq(BIT(i), cpucp-&gt;rx_base + APSS_CPUCP_RX_MBOX_CLEAR);
      |                 ^~~~~~
      |                 writeb

Change the Kconfig dependency to disallow that configuration as well.

Fixes: 0e2a9a03106c ("mailbox: Add support for QTI CPUCP mailbox controller")
Signed-off-by: Arnd Bergmann &lt;arnd@arndb.de&gt;
Reviewed-by: Konrad Dybcio &lt;konrad.dybcio@linaro.org&gt;
Signed-off-by: Jassi Brar &lt;jassisinghbrar@gmail.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>mailbox: Add support for QTI CPUCP mailbox controller</title>
<updated>2024-07-10T18:24:55+00:00</updated>
<author>
<name>Sibi Sankar</name>
<email>quic_sibis@quicinc.com</email>
</author>
<published>2024-06-12T12:40:53+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=0e2a9a03106cd5fa0dbc9047675e7645c55e2669'/>
<id>0e2a9a03106cd5fa0dbc9047675e7645c55e2669</id>
<content type='text'>
Add support for CPUSS Control Processor (CPUCP) mailbox controller,
this driver enables communication between AP and CPUCP by acting as
a doorbell between them.

Reviewed-by: Dmitry Baryshkov &lt;dmitry.baryshkov@linaro.org&gt;
Signed-off-by: Sibi Sankar &lt;quic_sibis@quicinc.com&gt;
Reviewed-by: Bjorn Andersson &lt;andersson@kernel.org&gt;
Reviewed-by: Konrad Dybcio &lt;konrad.dybcio@linaro.org&gt;
Signed-off-by: Jassi Brar &lt;jassisinghbrar@gmail.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Add support for CPUSS Control Processor (CPUCP) mailbox controller,
this driver enables communication between AP and CPUCP by acting as
a doorbell between them.

Reviewed-by: Dmitry Baryshkov &lt;dmitry.baryshkov@linaro.org&gt;
Signed-off-by: Sibi Sankar &lt;quic_sibis@quicinc.com&gt;
Reviewed-by: Bjorn Andersson &lt;andersson@kernel.org&gt;
Reviewed-by: Konrad Dybcio &lt;konrad.dybcio@linaro.org&gt;
Signed-off-by: Jassi Brar &lt;jassisinghbrar@gmail.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>mailbox: mtk-cmdq: add missing MODULE_DESCRIPTION() macro</title>
<updated>2024-07-10T18:24:55+00:00</updated>
<author>
<name>Jeff Johnson</name>
<email>quic_jjohnson@quicinc.com</email>
</author>
<published>2024-06-24T16:09:48+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=203e038d23c43e37f43e675e6cc7ac0e38ef939d'/>
<id>203e038d23c43e37f43e675e6cc7ac0e38ef939d</id>
<content type='text'>
make allmodconfig &amp;&amp; make W=1 C=1 reports:
WARNING: modpost: missing MODULE_DESCRIPTION() in drivers/mailbox/mtk-cmdq-mailbox.o

Add the missing invocation of the MODULE_DESCRIPTION() macro.

Reviewed-by: AngeloGioacchino Del Regno &lt;angelogioacchino.delregno@collabora.com&gt;
Signed-off-by: Jeff Johnson &lt;quic_jjohnson@quicinc.com&gt;
Signed-off-by: Jassi Brar &lt;jassisinghbrar@gmail.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
make allmodconfig &amp;&amp; make W=1 C=1 reports:
WARNING: modpost: missing MODULE_DESCRIPTION() in drivers/mailbox/mtk-cmdq-mailbox.o

Add the missing invocation of the MODULE_DESCRIPTION() macro.

Reviewed-by: AngeloGioacchino Del Regno &lt;angelogioacchino.delregno@collabora.com&gt;
Signed-off-by: Jeff Johnson &lt;quic_jjohnson@quicinc.com&gt;
Signed-off-by: Jassi Brar &lt;jassisinghbrar@gmail.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>mailbox: bcm-pdc: remove unused struct 'pdc_dma_map'</title>
<updated>2024-07-10T18:24:55+00:00</updated>
<author>
<name>Dr. David Alan Gilbert</name>
<email>linux@treblig.org</email>
</author>
<published>2024-05-23T20:37:41+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=63c31d4a9169fd4eebf08c259ba8688d15668ae5'/>
<id>63c31d4a9169fd4eebf08c259ba8688d15668ae5</id>
<content type='text'>
'pdf_dma_map' has been unused since the original
commit a24532f8d17b ("mailbox: Add Broadcom PDC mailbox driver").

Remove it.

Signed-off-by: Dr. David Alan Gilbert &lt;linux@treblig.org&gt;
Signed-off-by: Jassi Brar &lt;jassisinghbrar@gmail.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
'pdf_dma_map' has been unused since the original
commit a24532f8d17b ("mailbox: Add Broadcom PDC mailbox driver").

Remove it.

Signed-off-by: Dr. David Alan Gilbert &lt;linux@treblig.org&gt;
Signed-off-by: Jassi Brar &lt;jassisinghbrar@gmail.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>mailbox: imx: fix TXDB_V2 channel race condition</title>
<updated>2024-07-10T18:24:55+00:00</updated>
<author>
<name>Peng Fan</name>
<email>peng.fan@nxp.com</email>
</author>
<published>2024-05-24T07:56:32+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=b5ef17917f3a797a7b12d1edd51f676554e44a07'/>
<id>b5ef17917f3a797a7b12d1edd51f676554e44a07</id>
<content type='text'>
Two TXDB_V2 channels are used between Linux and System Manager(SM).
Channel0 for normal TX, Channel 1 for notification completion.
The TXDB_V2 trigger logic is using imx_mu_xcr_rmw which uses
read/modify/update logic.

Note: clear MUB GSR BITs, the MUA side GCR BITs will also got cleared per
hardware design.
Channel0 Linux
read GCR-&gt;modify GCR-&gt;write GCR-&gt;M33 SM-&gt;read GSR-----&gt;clear GSR
                                                |-(1)-|
Channel1 Linux start in time slot(1)
read GCR-&gt;modify GCR-&gt;write GCR-&gt;M33 SM-&gt;read GSR-&gt;clear GSR
So Channel1 read GCR will read back the GCR that Channel0 wrote, because
M33 has not finish clear GSR, this means Channel1 GCR writing will
trigger Channel1 and Channel0 interrupt both which is wrong.

Channel0 will be freed(SCMI channel status set to FREE) in M33 SM when
processing the 1st Channel0 interrupt. So when 2nd interrupt trigger
(channel 0/1 trigger together), SM will see a freed Channel0, and report
protocol error.

To address the issue, not using read/modify/update logic, just use
write, because write 0 to GCR will be ignored. And after write MUA GCR,
wait the SM to clear MUB GSR by looping MUA GCR value.

Fixes: 5bfe4067d350 ("mailbox: imx: support channel type tx doorbell v2")
Reviewed-by: Ranjani Vaidyanathan &lt;ranjani.vaidyanathan@nxp.com&gt;
Signed-off-by: Peng Fan &lt;peng.fan@nxp.com&gt;
Signed-off-by: Jassi Brar &lt;jassisinghbrar@gmail.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Two TXDB_V2 channels are used between Linux and System Manager(SM).
Channel0 for normal TX, Channel 1 for notification completion.
The TXDB_V2 trigger logic is using imx_mu_xcr_rmw which uses
read/modify/update logic.

Note: clear MUB GSR BITs, the MUA side GCR BITs will also got cleared per
hardware design.
Channel0 Linux
read GCR-&gt;modify GCR-&gt;write GCR-&gt;M33 SM-&gt;read GSR-----&gt;clear GSR
                                                |-(1)-|
Channel1 Linux start in time slot(1)
read GCR-&gt;modify GCR-&gt;write GCR-&gt;M33 SM-&gt;read GSR-&gt;clear GSR
So Channel1 read GCR will read back the GCR that Channel0 wrote, because
M33 has not finish clear GSR, this means Channel1 GCR writing will
trigger Channel1 and Channel0 interrupt both which is wrong.

Channel0 will be freed(SCMI channel status set to FREE) in M33 SM when
processing the 1st Channel0 interrupt. So when 2nd interrupt trigger
(channel 0/1 trigger together), SM will see a freed Channel0, and report
protocol error.

To address the issue, not using read/modify/update logic, just use
write, because write 0 to GCR will be ignored. And after write MUA GCR,
wait the SM to clear MUB GSR by looping MUA GCR value.

Fixes: 5bfe4067d350 ("mailbox: imx: support channel type tx doorbell v2")
Reviewed-by: Ranjani Vaidyanathan &lt;ranjani.vaidyanathan@nxp.com&gt;
Signed-off-by: Peng Fan &lt;peng.fan@nxp.com&gt;
Signed-off-by: Jassi Brar &lt;jassisinghbrar@gmail.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>mailbox: omap: Fix mailbox interrupt sharing</title>
<updated>2024-07-10T18:24:55+00:00</updated>
<author>
<name>Andrew Davis</name>
<email>afd@ti.com</email>
</author>
<published>2024-06-11T17:04:56+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=0a02bc0a34cd53c7fe5bf4bae6efb56ad47677fa'/>
<id>0a02bc0a34cd53c7fe5bf4bae6efb56ad47677fa</id>
<content type='text'>
Multiple mailbox users can share one interrupt line. This flag was
mistakenly dropped as part of the FIFO removal. Mark the IRQ as shared.

Reported-by: Beleswar Padhi &lt;b-padhi@ti.com&gt;
Fixes: 3f58c1f4206f ("mailbox: omap: Remove kernel FIFO message queuing")
Signed-off-by: Andrew Davis &lt;afd@ti.com&gt;
Tested-by: Beleswar Padhi &lt;b-padhi@ti.com&gt;
Signed-off-by: Jassi Brar &lt;jassisinghbrar@gmail.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Multiple mailbox users can share one interrupt line. This flag was
mistakenly dropped as part of the FIFO removal. Mark the IRQ as shared.

Reported-by: Beleswar Padhi &lt;b-padhi@ti.com&gt;
Fixes: 3f58c1f4206f ("mailbox: omap: Remove kernel FIFO message queuing")
Signed-off-by: Andrew Davis &lt;afd@ti.com&gt;
Tested-by: Beleswar Padhi &lt;b-padhi@ti.com&gt;
Signed-off-by: Jassi Brar &lt;jassisinghbrar@gmail.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>mailbox: mtk-cmdq: Dynamically allocate clk_bulk_data structure</title>
<updated>2024-07-10T18:24:55+00:00</updated>
<author>
<name>AngeloGioacchino Del Regno</name>
<email>angelogioacchino.delregno@collabora.com</email>
</author>
<published>2024-06-20T10:07:49+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=aa1609f571caba0db102c611829d48adf226bb70'/>
<id>aa1609f571caba0db102c611829d48adf226bb70</id>
<content type='text'>
Now that the clock probing code uses devm_kasprintf(), there is
no more restriction on the number of GCEs: dynamically allocate
the clk_bulk_data clocks array to improve flexibility and also
to get a slight memory saving on platforms featuring only one
CMDQ mailbox (and consequently only one Global Command Engine).

Signed-off-by: AngeloGioacchino Del Regno &lt;angelogioacchino.delregno@collabora.com&gt;
Signed-off-by: Jassi Brar &lt;jassisinghbrar@gmail.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Now that the clock probing code uses devm_kasprintf(), there is
no more restriction on the number of GCEs: dynamically allocate
the clk_bulk_data clocks array to improve flexibility and also
to get a slight memory saving on platforms featuring only one
CMDQ mailbox (and consequently only one Global Command Engine).

Signed-off-by: AngeloGioacchino Del Regno &lt;angelogioacchino.delregno@collabora.com&gt;
Signed-off-by: Jassi Brar &lt;jassisinghbrar@gmail.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>mailbox: mtk-cmdq: Move and partially refactor clocks probe</title>
<updated>2024-07-10T18:24:55+00:00</updated>
<author>
<name>AngeloGioacchino Del Regno</name>
<email>angelogioacchino.delregno@collabora.com</email>
</author>
<published>2024-06-20T10:07:48+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=0af932c5fc44d2709c9f87a15bcd6cd376901e23'/>
<id>0af932c5fc44d2709c9f87a15bcd6cd376901e23</id>
<content type='text'>
Move the clocks probe to a new cmdq_get_clocks() function; while
at it, partially refactor the code:

Drop the clk_names[] array and assign clock names to the array
of clk_bulk_data with devm_kasprintf() instead, slightly reduce
the indentation for the multi-gce clock probe path and add a
comment describing the reason why we get clocks of other GCE
instance instead of just the clock from the one that it is
getting probed.

Signed-off-by: AngeloGioacchino Del Regno &lt;angelogioacchino.delregno@collabora.com&gt;
Signed-off-by: Jassi Brar &lt;jassisinghbrar@gmail.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Move the clocks probe to a new cmdq_get_clocks() function; while
at it, partially refactor the code:

Drop the clk_names[] array and assign clock names to the array
of clk_bulk_data with devm_kasprintf() instead, slightly reduce
the indentation for the multi-gce clock probe path and add a
comment describing the reason why we get clocks of other GCE
instance instead of just the clock from the one that it is
getting probed.

Signed-off-by: AngeloGioacchino Del Regno &lt;angelogioacchino.delregno@collabora.com&gt;
Signed-off-by: Jassi Brar &lt;jassisinghbrar@gmail.com&gt;
</pre>
</div>
</content>
</entry>
</feed>
