From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id EAE8E3C2F; Wed, 21 Feb 2024 13:39:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708522756; cv=none; b=mxUNDs2dtZtTuuf5wXUGnSRDgrV2n0WWogZl0I60NxgyTHObN+57CXQyeWgfgjcM/1X2TC/Pu/JJTn1XlGsGABI80VP1w0XFkANsrSLkXZ4IVDfant9zueaUmq6o931cfOIWJqFWfD6M6HU/WUV8V2oAWZSGCGQ/opYIpe33yXs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708522756; c=relaxed/simple; bh=GYS3fiEHc0KPo9dBBVRqjaxqEywi+lSbH08OShwIIwk=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=WqHV+HnrRdA0sWCa2L2SGOJbtlICaAb9WSJXHrpOhKxN8K0/zljCv1xteuhsG1uSm7NUsjqjKfMIYX3EbNrOaZCmQ/aYRWzwMQTRhOaEzLi6Rw/UJGl75LmwV8jYbiSdiTHIUrDz7K9AIC+shRP8bDhGzPQFPJW/ojXjXdpMC9M= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=dzvomMMI; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="dzvomMMI" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7503EC433F1; Wed, 21 Feb 2024 13:39:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1708522755; bh=GYS3fiEHc0KPo9dBBVRqjaxqEywi+lSbH08OShwIIwk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=dzvomMMIJCdintvyMrSZyTKmjRXiqgZYiywoc641KRbxgdJaeMRhVi9ymlvXXC607 sawZ6rIvQ63VvNxzyGbBYrlveWm6kYYFrU5ZDl1Z3fnDP8DWD0Mj6c4jfLQPjoo2Tn r7dGWqdUfDyucaAS9CkkREb/UYkAXrClmiSYPS4w= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, "Xiaowu.ding" , Viresh Kumar , Jassi Brar , Sasha Levin Subject: [PATCH 5.15 248/476] mailbox: arm_mhuv2: Fix a bug for mhuv2_sender_interrupt Date: Wed, 21 Feb 2024 14:04:59 +0100 Message-ID: <20240221130017.029844073@linuxfoundation.org> X-Mailer: git-send-email 2.43.2 In-Reply-To: <20240221130007.738356493@linuxfoundation.org> References: <20240221130007.738356493@linuxfoundation.org> User-Agent: quilt/0.67 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 5.15-stable review patch. If anyone has any objections, please let me know. ------------------ From: Xiaowu.ding [ 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 Acked-by: Viresh Kumar Signed-off-by: Jassi Brar Signed-off-by: Sasha Levin --- 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