[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <472a47da-e442-4335-92f3-9a0263107fc8@linaro.org>
Date: Wed, 11 Jun 2025 16:00:39 +0100
From: James Clark <james.clark@...aro.org>
To: Vladimir Oltean <vladimir.oltean@....com>
Cc: Vladimir Oltean <olteanv@...il.com>, Mark Brown <broonie@...nel.org>,
linux-spi@...r.kernel.org, imx@...ts.linux.dev, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 4/4] spi: spi-fsl-dspi: Report FIFO overflows as errors
On 11/06/2025 3:56 pm, Vladimir Oltean wrote:
> On Wed, Jun 11, 2025 at 03:40:40PM +0100, James Clark wrote:
>>> Also, could there be individual error messages for TFUF and for RFOF?
>>> If you are concerned about the penalty for the error-free case, make the
>>> check two-level. First for all errors, then for individual errors.
>>>
>>
>> If I was going to split them I would probably let the compiler optimize it
>> whichever way was best. The real reason for combining them is because
>> usually you get them both together. As long as the message and fifos are
>> configured correctly you'd always get TFUF and RFOF at the same time and I
>> wanted to avoid printing twice for one event.
>
> In that case, why not:
> if (spi_sr & (SPI_SR_TFUF | SPI_SR_RFOF)) {
> dev_err_ratelimited(dev, "FIFO errors:%s%s\n",
> spi_sr & SPI_SR_TFUF ? " TX underflow," : "",
> spi_sr & SPI_SR_RFOF ? " RX overflow," : "");
> }
> }
Yep that looks good, will do that
Powered by blists - more mailing lists