[1/3] spi-topcliff-pch: Transform noisy message to dev_dbg
diff mbox

Message ID 1392802569-11148-1-git-send-email-alexander.stein@systec-electronic.com
State New, archived
Delegated to: Mark Brown
Headers show

Commit Message

Alexander Stein Feb. 19, 2014, 9:36 a.m. UTC
If during a SPI transfer with len larger than PCH_MAX_FIFO_DEPTH and the
IRQ handler happens to be called when the transmit FIFO is already empty,
and SPSR_FI_BIT is set consequently, the message
"spi_master spi32766: pch_spi_handler_sub : Transfer is not completed"
is spammed to the systemlog, because tx_index has already increased
further due to the next bytes to be written. This case is uncritical as
new bytes have already been written.

Signed-off-by: Alexander Stein <alexander.stein@systec-electronic.com>
---
 drivers/spi/spi-topcliff-pch.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Mark Brown Feb. 19, 2014, 12:41 p.m. UTC | #1
On Wed, Feb 19, 2014 at 10:36:07AM +0100, Alexander Stein wrote:
> If during a SPI transfer with len larger than PCH_MAX_FIFO_DEPTH and the
> IRQ handler happens to be called when the transmit FIFO is already empty,
> and SPSR_FI_BIT is set consequently, the message
> "spi_master spi32766: pch_spi_handler_sub : Transfer is not completed"
> is spammed to the systemlog, because tx_index has already increased
> further due to the next bytes to be written. This case is uncritical as
> new bytes have already been written.

When you say "spammed" does that mean "printed once" or "is continually
printed"?  I'd have assumed the latter in which case it might be better
to go as low as _vdbg() or even remove the message entirely if it's not
possible to suppress it entirely.
Alexander Stein Feb. 19, 2014, 5:23 p.m. UTC | #2
Hello Mark,

On Wednesday 19 February 2014 21:41:50, Mark Brown wrote:
> On Wed, Feb 19, 2014 at 10:36:07AM +0100, Alexander Stein wrote:
> > If during a SPI transfer with len larger than PCH_MAX_FIFO_DEPTH and the
> > IRQ handler happens to be called when the transmit FIFO is already empty,
> > and SPSR_FI_BIT is set consequently, the message
> > "spi_master spi32766: pch_spi_handler_sub : Transfer is not completed"
> > is spammed to the systemlog, because tx_index has already increased
> > further due to the next bytes to be written. This case is uncritical as
> > new bytes have already been written.
> 
> When you say "spammed" does that mean "printed once" or "is continually
> printed"?  I'd have assumed the latter in which case it might be better
> to go as low as _vdbg() or even remove the message entirely if it's not
> possible to suppress it entirely.

It is printed continually during the whole SPI transfer, e.g. dumping a 256k AT25 EEPROM.
I don't know this hardware good enough to judge if it can be suppressed at all. Maybe if the interrupt thresholds are appropriately this doesn't happen. But maybe if someone changes that, maybe this driver can be changed to a queued driver instead which could simplify the driver.

Best regards,
Alexander

--
To unsubscribe from this list: send the line "unsubscribe linux-spi" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Patch
diff mbox

diff --git a/drivers/spi/spi-topcliff-pch.c b/drivers/spi/spi-topcliff-pch.c
index 4461313..d038a7b 100644
--- a/drivers/spi/spi-topcliff-pch.c
+++ b/drivers/spi/spi-topcliff-pch.c
@@ -332,7 +332,7 @@  static void pch_spi_handler_sub(struct pch_spi_data *data, u32 reg_spsr_val,
 				data->transfer_active = false;
 				wake_up(&data->wait);
 			} else {
-				dev_err(&data->master->dev,
+				dev_dbg(&data->master->dev,
 					"%s : Transfer is not completed",
 					__func__);
 			}