Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

i2c: pasemi: Log bus reset causes

This ensures we get all information we need to debug issues when users
forward us their logs.

Signed-off-by: Hector Martin <marcan@marcan.st>
Reviewed-by: Neal Gompa <neal@gompa.dev>
Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Signed-off-by: Sven Peter <sven@svenpeter.dev>
Link: https://lore.kernel.org/r/20250427-pasemi-fixes-v3-4-af28568296c0@svenpeter.dev
Signed-off-by: Andi Shyti <andi.shyti@kernel.org>

authored by

Hector Martin and committed by
Andi Shyti
090c3a4a f4f64fa8

+7 -2
+7 -2
drivers/i2c/busses/i2c-pasemi-core.c
··· 22 22 /* Register offsets */ 23 23 #define REG_MTXFIFO 0x00 24 24 #define REG_MRXFIFO 0x04 25 + #define REG_XFSTA 0x0c 25 26 #define REG_SMSTA 0x14 26 27 #define REG_IMASK 0x18 27 28 #define REG_CTL 0x1c ··· 100 99 USEC_PER_MSEC * PASEMI_TRANSFER_TIMEOUT_MS); 101 100 102 101 if (ret < 0) { 103 - dev_err(smbus->dev, "Bus is still stuck (status 0x%08x)\n", status); 102 + dev_err(smbus->dev, "Bus is still stuck (status 0x%08x xfstatus 0x%08x)\n", 103 + status, reg_read(smbus, REG_XFSTA)); 104 104 return -EIO; 105 105 } 106 106 107 107 /* If any badness happened or there is data in the FIFOs, reset the FIFOs */ 108 108 if ((status & (SMSTA_MRNE | SMSTA_JMD | SMSTA_MTO | SMSTA_TOM | SMSTA_MTN | SMSTA_MTA)) || 109 - !(status & SMSTA_MTE)) 109 + !(status & SMSTA_MTE)) { 110 + dev_warn(smbus->dev, "Issuing reset due to status 0x%08x (xfstatus 0x%08x)\n", 111 + status, reg_read(smbus, REG_XFSTA)); 110 112 pasemi_reset(smbus); 113 + } 111 114 112 115 /* Clear the flags */ 113 116 reg_write(smbus, REG_SMSTA, status);