From: Simon Horman <horms@kernel.org>
To: Marc Kleine-Budde <mkl@pengutronix.de>
Cc: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>,
Thomas Kopp <thomas.kopp@microchip.com>,
Vincent Mailhol <mailhol.vincent@wanadoo.fr>,
Sven Schuchmann <schuchmann@schleissheimer.de>,
linux-can@vger.kernel.org, kernel@pengutronix.de,
netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
stable@vger.kernel.org
Subject: Re: [PATCH can v3] can: mcp251xfd: mcp251xfd_get_tef_len(): fix length calculation
Date: Wed, 6 Nov 2024 15:17:14 +0000 [thread overview]
Message-ID: <20241106151714.GR4507@kernel.org> (raw)
In-Reply-To: <20241104-mcp251xfd-fix-length-calculation-v3-1-608b6e7e2197@pengutronix.de>
On Mon, Nov 04, 2024 at 05:42:40PM +0100, Marc Kleine-Budde wrote:
> Commit b8e0ddd36ce9 ("can: mcp251xfd: tef: prepare to workaround
> broken TEF FIFO tail index erratum") introduced
> mcp251xfd_get_tef_len() to get the number of unhandled transmit events
> from the Transmit Event FIFO (TEF).
>
> As the TEF has no head pointer, the driver uses the TX FIFO's tail
> pointer instead, assuming that send frames are completed. However the
> check for the TEF being full was not correct. This leads to the driver
> stop working if the TEF is full.
>
> Fix the TEF full check by assuming that if, from the driver's point of
> view, there are no free TX buffers in the chip and the TX FIFO is
> empty, all messages must have been sent and the TEF must therefore be
> full.
>
> Reported-by: Sven Schuchmann <schuchmann@schleissheimer.de>
> Closes: https://patch.msgid.link/FR3P281MB155216711EFF900AD9791B7ED9692@FR3P281MB1552.DEUP281.PROD.OUTLOOK.COM
> Fixes: b8e0ddd36ce9 ("can: mcp251xfd: tef: prepare to workaround broken TEF FIFO tail index erratum")
> Tested-by: Sven Schuchmann <schuchmann@schleissheimer.de>
> Cc: stable@vger.kernel.org
> Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Reviewed-by: Simon Horman <horms@kernel.org>
...
prev parent reply other threads:[~2024-11-06 15:17 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-11-04 16:42 [PATCH can v3] can: mcp251xfd: mcp251xfd_get_tef_len(): fix length calculation Marc Kleine-Budde
2024-11-06 15:17 ` Simon Horman [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=20241106151714.GR4507@kernel.org \
--to=horms@kernel.org \
--cc=kernel@pengutronix.de \
--cc=linux-can@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mailhol.vincent@wanadoo.fr \
--cc=manivannan.sadhasivam@linaro.org \
--cc=mkl@pengutronix.de \
--cc=netdev@vger.kernel.org \
--cc=schuchmann@schleissheimer.de \
--cc=stable@vger.kernel.org \
--cc=thomas.kopp@microchip.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;
as well as URLs for NNTP newsgroup(s).