[2/2] i2c: ismt: dump registers at the end of transactions

Message ID 20170818160128.21228-3-radu.rendec@gmail.com
State Accepted
Headers show

Commit Message

Radu Rendec Aug. 18, 2017, 4:01 p.m.
This patch dumps general and master registers at the end of transactions
when debugging is enabled. Previously, registers were only dumped before
submitting new descriptors (at the beginning of transactions).

This helps debugging if some registers change as result of a failed
transaction (e.g. bits are set in the ERRSTS general register).

Signed-off-by: Radu Rendec <radu.rendec@gmail.com>
---
 drivers/i2c/busses/i2c-ismt.c | 2 ++
 1 file changed, 2 insertions(+)

Comments

Neil Horman Jan. 4, 2018, 1:52 p.m. | #1
On Fri, Aug 18, 2017 at 05:01:28PM +0100, Radu Rendec wrote:
> This patch dumps general and master registers at the end of transactions
> when debugging is enabled. Previously, registers were only dumped before
> submitting new descriptors (at the beginning of transactions).
> 
> This helps debugging if some registers change as result of a failed
> transaction (e.g. bits are set in the ERRSTS general register).
> 
> Signed-off-by: Radu Rendec <radu.rendec@gmail.com>
> ---
>  drivers/i2c/busses/i2c-ismt.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/drivers/i2c/busses/i2c-ismt.c b/drivers/i2c/busses/i2c-ismt.c
> index ccce0ca..003ea53 100644
> --- a/drivers/i2c/busses/i2c-ismt.c
> +++ b/drivers/i2c/busses/i2c-ismt.c
> @@ -324,6 +324,8 @@ static int ismt_process_desc(const struct ismt_desc *desc,
>  
>  	dev_dbg(&priv->pci_dev->dev, "Processing completed descriptor\n");
>  	__ismt_desc_dump(&priv->pci_dev->dev, desc);
> +	ismt_gen_reg_dump(priv);
> +	ismt_mstr_reg_dump(priv);
>  
>  	if (desc->status & ISMT_DESC_SCS) {
>  		if (read_write == I2C_SMBUS_WRITE &&
Acked-by: Neil Horman <nhorman@tuxdriver.com>

Patch

diff --git a/drivers/i2c/busses/i2c-ismt.c b/drivers/i2c/busses/i2c-ismt.c
index ccce0ca..003ea53 100644
--- a/drivers/i2c/busses/i2c-ismt.c
+++ b/drivers/i2c/busses/i2c-ismt.c
@@ -324,6 +324,8 @@  static int ismt_process_desc(const struct ismt_desc *desc,
 
 	dev_dbg(&priv->pci_dev->dev, "Processing completed descriptor\n");
 	__ismt_desc_dump(&priv->pci_dev->dev, desc);
+	ismt_gen_reg_dump(priv);
+	ismt_mstr_reg_dump(priv);
 
 	if (desc->status & ISMT_DESC_SCS) {
 		if (read_write == I2C_SMBUS_WRITE &&