* [PATCH] mailbox: qcom-cpucp: read mbox hardware register using readq()
@ 2026-09-08 15:50 Sivansh Gupta
2026-09-09 6:20 ` Sibi Sankar
0 siblings, 1 reply; 4+ messages in thread
From: Sivansh Gupta @ 2026-09-08 15:50 UTC (permalink / raw)
To: Sibi Sankar; +Cc: Jassi Brar, linux-arm-msm, linux-kernel, Sivansh Gupta
Mailbox hardware registers are 64 bit but the interrupt handler
currently reads only 32 bits with readl(). Use readq() to read
the complete register value and pass it to the mailbox client.
Fixes: 0e2a9a03106c ("mailbox: Add support for QTI CPUCP mailbox controller")
Signed-off-by: Sivansh Gupta <sivansh.gupta@oss.qualcomm.com>
---
drivers/mailbox/qcom-cpucp-mbox.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/mailbox/qcom-cpucp-mbox.c b/drivers/mailbox/qcom-cpucp-mbox.c
index 7ffc40acea9b..f56a05149281 100644
--- a/drivers/mailbox/qcom-cpucp-mbox.c
+++ b/drivers/mailbox/qcom-cpucp-mbox.c
@@ -61,7 +61,7 @@ static irqreturn_t qcom_cpucp_mbox_irq_fn(int irq, void *data)
status = readq(cpucp->rx_base + APSS_CPUCP_RX_MBOX_STAT);
for_each_set_bit(i, (unsigned long *)&status, cpucp->mbox.num_chans) {
- u32 val = readl(cpucp->rx_base + APSS_CPUCP_RX_MBOX_CMD(i) + APSS_CPUCP_MBOX_CMD_OFF);
+ u64 val = readq(cpucp->rx_base + APSS_CPUCP_RX_MBOX_CMD(i));
struct mbox_chan *chan = &cpucp->chans[i];
unsigned long flags;
--
2.43.0
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: [PATCH] mailbox: qcom-cpucp: read mbox hardware register using readq()
2026-09-08 15:50 [PATCH] mailbox: qcom-cpucp: read mbox hardware register using readq() Sivansh Gupta
@ 2026-09-09 6:20 ` Sibi Sankar
2026-09-15 9:39 ` [PATCH v2] " Sivansh Gupta
0 siblings, 1 reply; 4+ messages in thread
From: Sibi Sankar @ 2026-09-09 6:20 UTC (permalink / raw)
To: Sivansh Gupta; +Cc: Jassi Brar, linux-arm-msm, linux-kernel
On 9/8/2026 9:20 PM, Sivansh Gupta wrote:
> Mailbox hardware registers are 64 bit but the interrupt handler
> currently reads only 32 bits with readl(). Use readq() to read
> the complete register value and pass it to the mailbox client.
Can you please add more details to the commit message? It doesn't describe
how switching to 64 bit would help mailbox or it's clients at the moment.
-Sibi
>
> Fixes: 0e2a9a03106c ("mailbox: Add support for QTI CPUCP mailbox controller")
> Signed-off-by: Sivansh Gupta <sivansh.gupta@oss.qualcomm.com>
> ---
> drivers/mailbox/qcom-cpucp-mbox.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/mailbox/qcom-cpucp-mbox.c b/drivers/mailbox/qcom-cpucp-mbox.c
> index 7ffc40acea9b..f56a05149281 100644
> --- a/drivers/mailbox/qcom-cpucp-mbox.c
> +++ b/drivers/mailbox/qcom-cpucp-mbox.c
> @@ -61,7 +61,7 @@ static irqreturn_t qcom_cpucp_mbox_irq_fn(int irq, void *data)
> status = readq(cpucp->rx_base + APSS_CPUCP_RX_MBOX_STAT);
>
> for_each_set_bit(i, (unsigned long *)&status, cpucp->mbox.num_chans) {
> - u32 val = readl(cpucp->rx_base + APSS_CPUCP_RX_MBOX_CMD(i) + APSS_CPUCP_MBOX_CMD_OFF);
> + u64 val = readq(cpucp->rx_base + APSS_CPUCP_RX_MBOX_CMD(i));
> struct mbox_chan *chan = &cpucp->chans[i];
> unsigned long flags;
>
^ permalink raw reply [flat|nested] 4+ messages in thread* [PATCH v2] mailbox: qcom-cpucp: read mbox hardware register using readq()
2026-09-09 6:20 ` Sibi Sankar
@ 2026-09-15 9:39 ` Sivansh Gupta
2026-09-17 8:07 ` Konrad Dybcio
0 siblings, 1 reply; 4+ messages in thread
From: Sivansh Gupta @ 2026-09-15 9:39 UTC (permalink / raw)
To: Sibi Sankar; +Cc: Jassi Brar, linux-arm-msm, linux-kernel, Sivansh Gupta
Mailbox hardware registers are 64 bit wide, but the interrupt handler
currently reads only 32 bits with readl() at 0x4 offset (upper 32
bits). This does not return the correct value expected by PDP log
driver. Reading the register with readq() at the base address
returns the correct value expected.
Use readq() to access the 64-bit register and pass the correct value
to the mailbox client.
Fixes: 0e2a9a03106c ("mailbox: Add support for QTI CPUCP mailbox controller")
Signed-off-by: Sivansh Gupta <sivansh.gupta@oss.qualcomm.com>
---
v2:
- Expanded the commit message to explain why this change is required.
drivers/mailbox/qcom-cpucp-mbox.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/mailbox/qcom-cpucp-mbox.c b/drivers/mailbox/qcom-cpucp-mbox.c
index 7ffc40acea9b..f56a05149281 100644
--- a/drivers/mailbox/qcom-cpucp-mbox.c
+++ b/drivers/mailbox/qcom-cpucp-mbox.c
@@ -61,7 +61,7 @@ static irqreturn_t qcom_cpucp_mbox_irq_fn(int irq, void *data)
status = readq(cpucp->rx_base + APSS_CPUCP_RX_MBOX_STAT);
for_each_set_bit(i, (unsigned long *)&status, cpucp->mbox.num_chans) {
- u32 val = readl(cpucp->rx_base + APSS_CPUCP_RX_MBOX_CMD(i) + APSS_CPUCP_MBOX_CMD_OFF);
+ u64 val = readq(cpucp->rx_base + APSS_CPUCP_RX_MBOX_CMD(i));
struct mbox_chan *chan = &cpucp->chans[i];
unsigned long flags;
--
2.43.0
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: [PATCH v2] mailbox: qcom-cpucp: read mbox hardware register using readq()
2026-09-15 9:39 ` [PATCH v2] " Sivansh Gupta
@ 2026-09-17 8:07 ` Konrad Dybcio
0 siblings, 0 replies; 4+ messages in thread
From: Konrad Dybcio @ 2026-09-17 8:07 UTC (permalink / raw)
To: Sivansh Gupta, Sibi Sankar; +Cc: Jassi Brar, linux-arm-msm, linux-kernel
On 9/15/26 11:39 AM, Sivansh Gupta wrote:
> Mailbox hardware registers are 64 bit wide, but the interrupt handler
> currently reads only 32 bits with readl() at 0x4 offset (upper 32
> bits). This does not return the correct value expected by PDP log
> driver. Reading the register with readq() at the base address
> returns the correct value expected.
This is a valid reason, but that driver doesn't exist upstream..
If you believe it'd be beneficial, please upstream it. For now,
please focus the reasoning on the actual data being lost, not on
some out-of-tree driver having issues with that
Konrad
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2026-09-17 8:07 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-09-08 15:50 [PATCH] mailbox: qcom-cpucp: read mbox hardware register using readq() Sivansh Gupta
2026-09-09 6:20 ` Sibi Sankar
2026-09-15 9:39 ` [PATCH v2] " Sivansh Gupta
2026-09-17 8:07 ` Konrad Dybcio
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®