mirror of
https://github.com/torvalds/linux.git
synced 2026-05-12 16:18:45 +02:00
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>
This commit is contained in:
parent
f4f64fa8a6
commit
090c3a4a26
|
|
@ -22,6 +22,7 @@
|
|||
/* Register offsets */
|
||||
#define REG_MTXFIFO 0x00
|
||||
#define REG_MRXFIFO 0x04
|
||||
#define REG_XFSTA 0x0c
|
||||
#define REG_SMSTA 0x14
|
||||
#define REG_IMASK 0x18
|
||||
#define REG_CTL 0x1c
|
||||
|
|
@ -99,14 +100,18 @@ static int pasemi_smb_clear(struct pasemi_smbus *smbus)
|
|||
USEC_PER_MSEC * PASEMI_TRANSFER_TIMEOUT_MS);
|
||||
|
||||
if (ret < 0) {
|
||||
dev_err(smbus->dev, "Bus is still stuck (status 0x%08x)\n", status);
|
||||
dev_err(smbus->dev, "Bus is still stuck (status 0x%08x xfstatus 0x%08x)\n",
|
||||
status, reg_read(smbus, REG_XFSTA));
|
||||
return -EIO;
|
||||
}
|
||||
|
||||
/* If any badness happened or there is data in the FIFOs, reset the FIFOs */
|
||||
if ((status & (SMSTA_MRNE | SMSTA_JMD | SMSTA_MTO | SMSTA_TOM | SMSTA_MTN | SMSTA_MTA)) ||
|
||||
!(status & SMSTA_MTE))
|
||||
!(status & SMSTA_MTE)) {
|
||||
dev_warn(smbus->dev, "Issuing reset due to status 0x%08x (xfstatus 0x%08x)\n",
|
||||
status, reg_read(smbus, REG_XFSTA));
|
||||
pasemi_reset(smbus);
|
||||
}
|
||||
|
||||
/* Clear the flags */
|
||||
reg_write(smbus, REG_SMSTA, status);
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user