Re: [PATCH v10 7/7] i2c: fsi: Add bus recovery

2018-07-02 Thread Wolfram Sang

> > This all won't have any effect since you never call i2c_recover_bus
> > which calls back into i2c_bus_recovery_info callbacks.
> 
> Ah, I thought there would be some use of this in the core or in client
> drivers, or some ioctl interface. Would there be any outside users of these
> callbacks in the future?

No. i2c_recover_bus() is only to recover from stalled SDA and the only
place where this can be detected is inside the I2C master driver. It is
not an event which can be controlled by a user.



signature.asc
Description: PGP signature


Re: [PATCH v10 7/7] i2c: fsi: Add bus recovery

2018-07-02 Thread Wolfram Sang

> > This all won't have any effect since you never call i2c_recover_bus
> > which calls back into i2c_bus_recovery_info callbacks.
> 
> Ah, I thought there would be some use of this in the core or in client
> drivers, or some ioctl interface. Would there be any outside users of these
> callbacks in the future?

No. i2c_recover_bus() is only to recover from stalled SDA and the only
place where this can be detected is inside the I2C master driver. It is
not an event which can be controlled by a user.



signature.asc
Description: PGP signature


Re: [PATCH v10 7/7] i2c: fsi: Add bus recovery

2018-06-27 Thread Eddie James




On 06/25/2018 09:38 PM, Wolfram Sang wrote:

On Wed, Jun 13, 2018 at 02:36:19PM -0500, Eddie James wrote:

Bus recovery should reset the engine and force clock the bus 9 times
to recover most situations.

Signed-off-by: Eddie James 
---
  drivers/i2c/busses/i2c-fsi.c | 19 +++
  1 file changed, 19 insertions(+)

diff --git a/drivers/i2c/busses/i2c-fsi.c b/drivers/i2c/busses/i2c-fsi.c
index d6cab4b..940b198 100644
--- a/drivers/i2c/busses/i2c-fsi.c
+++ b/drivers/i2c/busses/i2c-fsi.c
@@ -611,6 +611,24 @@ static u32 fsi_i2c_functionality(struct i2c_adapter *adap)
I2C_FUNC_SMBUS_BLOCK_DATA;
  }
  
+static int fsi_i2c_recover_bus(struct i2c_adapter *adap)

+{
+   int rc;
+   struct fsi_i2c_port *port = adap->algo_data;
+   struct fsi_i2c_master *master = port->master;
+
+   mutex_lock(>lock);
+
+   rc = fsi_i2c_reset(master, port->port);
+
+   mutex_unlock(>lock);
+   return rc;
+}
+
+static struct i2c_bus_recovery_info fsi_i2c_bus_recovery_info = {
+   .recover_bus = fsi_i2c_recover_bus,
+};
+

This all won't have any effect since you never call i2c_recover_bus
which calls back into i2c_bus_recovery_info callbacks.


Ah, I thought there would be some use of this in the core or in client 
drivers, or some ioctl interface. Would there be any outside users of 
these callbacks in the future?





Re: [PATCH v10 7/7] i2c: fsi: Add bus recovery

2018-06-27 Thread Eddie James




On 06/25/2018 09:38 PM, Wolfram Sang wrote:

On Wed, Jun 13, 2018 at 02:36:19PM -0500, Eddie James wrote:

Bus recovery should reset the engine and force clock the bus 9 times
to recover most situations.

Signed-off-by: Eddie James 
---
  drivers/i2c/busses/i2c-fsi.c | 19 +++
  1 file changed, 19 insertions(+)

diff --git a/drivers/i2c/busses/i2c-fsi.c b/drivers/i2c/busses/i2c-fsi.c
index d6cab4b..940b198 100644
--- a/drivers/i2c/busses/i2c-fsi.c
+++ b/drivers/i2c/busses/i2c-fsi.c
@@ -611,6 +611,24 @@ static u32 fsi_i2c_functionality(struct i2c_adapter *adap)
I2C_FUNC_SMBUS_BLOCK_DATA;
  }
  
+static int fsi_i2c_recover_bus(struct i2c_adapter *adap)

+{
+   int rc;
+   struct fsi_i2c_port *port = adap->algo_data;
+   struct fsi_i2c_master *master = port->master;
+
+   mutex_lock(>lock);
+
+   rc = fsi_i2c_reset(master, port->port);
+
+   mutex_unlock(>lock);
+   return rc;
+}
+
+static struct i2c_bus_recovery_info fsi_i2c_bus_recovery_info = {
+   .recover_bus = fsi_i2c_recover_bus,
+};
+

This all won't have any effect since you never call i2c_recover_bus
which calls back into i2c_bus_recovery_info callbacks.


Ah, I thought there would be some use of this in the core or in client 
drivers, or some ioctl interface. Would there be any outside users of 
these callbacks in the future?





Re: [PATCH v10 7/7] i2c: fsi: Add bus recovery

2018-06-25 Thread Wolfram Sang
On Wed, Jun 13, 2018 at 02:36:19PM -0500, Eddie James wrote:
> Bus recovery should reset the engine and force clock the bus 9 times
> to recover most situations.
> 
> Signed-off-by: Eddie James 
> ---
>  drivers/i2c/busses/i2c-fsi.c | 19 +++
>  1 file changed, 19 insertions(+)
> 
> diff --git a/drivers/i2c/busses/i2c-fsi.c b/drivers/i2c/busses/i2c-fsi.c
> index d6cab4b..940b198 100644
> --- a/drivers/i2c/busses/i2c-fsi.c
> +++ b/drivers/i2c/busses/i2c-fsi.c
> @@ -611,6 +611,24 @@ static u32 fsi_i2c_functionality(struct i2c_adapter 
> *adap)
>   I2C_FUNC_SMBUS_BLOCK_DATA;
>  }
>  
> +static int fsi_i2c_recover_bus(struct i2c_adapter *adap)
> +{
> + int rc;
> + struct fsi_i2c_port *port = adap->algo_data;
> + struct fsi_i2c_master *master = port->master;
> +
> + mutex_lock(>lock);
> +
> + rc = fsi_i2c_reset(master, port->port);
> +
> + mutex_unlock(>lock);
> + return rc;
> +}
> +
> +static struct i2c_bus_recovery_info fsi_i2c_bus_recovery_info = {
> + .recover_bus = fsi_i2c_recover_bus,
> +};
> +

This all won't have any effect since you never call i2c_recover_bus
which calls back into i2c_bus_recovery_info callbacks.



Re: [PATCH v10 7/7] i2c: fsi: Add bus recovery

2018-06-25 Thread Wolfram Sang
On Wed, Jun 13, 2018 at 02:36:19PM -0500, Eddie James wrote:
> Bus recovery should reset the engine and force clock the bus 9 times
> to recover most situations.
> 
> Signed-off-by: Eddie James 
> ---
>  drivers/i2c/busses/i2c-fsi.c | 19 +++
>  1 file changed, 19 insertions(+)
> 
> diff --git a/drivers/i2c/busses/i2c-fsi.c b/drivers/i2c/busses/i2c-fsi.c
> index d6cab4b..940b198 100644
> --- a/drivers/i2c/busses/i2c-fsi.c
> +++ b/drivers/i2c/busses/i2c-fsi.c
> @@ -611,6 +611,24 @@ static u32 fsi_i2c_functionality(struct i2c_adapter 
> *adap)
>   I2C_FUNC_SMBUS_BLOCK_DATA;
>  }
>  
> +static int fsi_i2c_recover_bus(struct i2c_adapter *adap)
> +{
> + int rc;
> + struct fsi_i2c_port *port = adap->algo_data;
> + struct fsi_i2c_master *master = port->master;
> +
> + mutex_lock(>lock);
> +
> + rc = fsi_i2c_reset(master, port->port);
> +
> + mutex_unlock(>lock);
> + return rc;
> +}
> +
> +static struct i2c_bus_recovery_info fsi_i2c_bus_recovery_info = {
> + .recover_bus = fsi_i2c_recover_bus,
> +};
> +

This all won't have any effect since you never call i2c_recover_bus
which calls back into i2c_bus_recovery_info callbacks.