[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250611145634.ncbzl6wwwxlidjl7@skbuf>
Date: Wed, 11 Jun 2025 17:56:34 +0300
From: Vladimir Oltean <vladimir.oltean@....com>
To: James Clark <james.clark@...aro.org>
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 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," : "");
}
}
Powered by blists - more mailing lists