From: Sasha Levin <sashal@kernel.org>
To: linux-kernel@vger.kernel.org, stable@vger.kernel.org
Cc: "Xiaowu.ding" <xiaowu.ding@jaguarmicro.com>,
Viresh Kumar <viresh.kumar@linaro.org>,
Jassi Brar <jaswinder.singh@linaro.org>,
Sasha Levin <sashal@kernel.org>,
Tushar.Khandelwal@arm.com, jassisinghbrar@gmail.com
Subject: [PATCH AUTOSEL 5.15 9/9] mailbox: arm_mhuv2: Fix a bug for mhuv2_sender_interrupt
Date: Wed, 24 Jan 2024 09:30:12 -0500 [thread overview]
Message-ID: <20240124143024.1284046-9-sashal@kernel.org> (raw)
In-Reply-To: <20240124143024.1284046-1-sashal@kernel.org>
From: "Xiaowu.ding" <xiaowu.ding@jaguarmicro.com>
[ Upstream commit ee01c0b4384d19ecc5dfa7db3fd4303f965c3eba ]
Message Handling Unit version is v2.1.
When arm_mhuv2 working with the data protocol transfer mode.
We have split one mhu into two channels, and every channel
include four channel windows, the two channels share
one gic spi interrupt.
There is a problem with the sending scenario.
The first channel will take up 0-3 channel windows, and the second
channel take up 4-7 channel windows. When the first channel send the
data, and the receiver will clear all the four channels status.
Although we only enabled the interrupt on the last channel window with
register CH_INT_EN,the register CHCOMB_INT_ST0 will be 0xf, not be 0x8.
Currently we just clear the last channel windows int status with the
data proctol mode.So after that,the CHCOMB_INT_ST0 status will be 0x7,
not be the 0x0.
Then the second channel send the data, the receiver read the
data, clear all the four channel windows status, trigger the sender
interrupt. But currently the CHCOMB_INT_ST0 register will be 0xf7,
get_irq_chan_comb function will always return the first channel.
So this patch clear all channel windows int status to avoid this interrupt
confusion.
Signed-off-by: Xiaowu.ding <xiaowu.ding@jaguarmicro.com>
Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Jassi Brar <jaswinder.singh@linaro.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/mailbox/arm_mhuv2.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/mailbox/arm_mhuv2.c b/drivers/mailbox/arm_mhuv2.c
index 3af15083a25a..68f766621b9b 100644
--- a/drivers/mailbox/arm_mhuv2.c
+++ b/drivers/mailbox/arm_mhuv2.c
@@ -552,7 +552,8 @@ static irqreturn_t mhuv2_sender_interrupt(int irq, void *data)
priv = chan->con_priv;
if (!IS_PROTOCOL_DOORBELL(priv)) {
- writel_relaxed(1, &mhu->send->ch_wn[priv->ch_wn_idx + priv->windows - 1].int_clr);
+ for (i = 0; i < priv->windows; i++)
+ writel_relaxed(1, &mhu->send->ch_wn[priv->ch_wn_idx + i].int_clr);
if (chan->cl) {
mbox_chan_txdone(chan, 0);
--
2.43.0
prev parent reply other threads:[~2024-01-24 14:30 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-01-24 14:30 [PATCH AUTOSEL 5.15 1/9] leds: trigger: panic: Don't register panic notifier if creating the trigger failed Sasha Levin
2024-01-24 14:30 ` [PATCH AUTOSEL 5.15 2/9] um: Fix naming clash between UML and scheduler Sasha Levin
2024-01-24 14:30 ` [PATCH AUTOSEL 5.15 3/9] um: Don't use vfprintf() for os_info() Sasha Levin
2024-01-24 14:30 ` [PATCH AUTOSEL 5.15 4/9] um: net: Fix return type of uml_net_start_xmit() Sasha Levin
2024-01-24 14:30 ` [PATCH AUTOSEL 5.15 5/9] um: time-travel: fix time corruption Sasha Levin
2024-01-24 14:30 ` [PATCH AUTOSEL 5.15 6/9] i3c: master: cdns: Update maximum prescaler value for i2c clock Sasha Levin
2024-01-24 14:30 ` [PATCH AUTOSEL 5.15 7/9] xen/gntdev: Fix the abuse of underlying struct page in DMA-buf import Sasha Levin
2024-01-24 14:30 ` [PATCH AUTOSEL 5.15 8/9] mfd: ti_am335x_tscadc: Fix TI SoC dependencies Sasha Levin
2024-01-24 14:30 ` Sasha Levin [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240124143024.1284046-9-sashal@kernel.org \
--to=sashal@kernel.org \
--cc=Tushar.Khandelwal@arm.com \
--cc=jassisinghbrar@gmail.com \
--cc=jaswinder.singh@linaro.org \
--cc=linux-kernel@vger.kernel.org \
--cc=stable@vger.kernel.org \
--cc=viresh.kumar@linaro.org \
--cc=xiaowu.ding@jaguarmicro.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox