lkml.org 
[lkml]   [2018]   [May]   [29]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH v7 4/7] drivers/i2c: Add abort and hardware reset procedures
On Wed, May 30, 2018 at 1:24 AM, Eddie James <eajames@linux.vnet.ibm.com> wrote:
> From: "Edward A. James" <eajames@us.ibm.com>
>
> Add abort procedure for failed transfers. Add engine and bus reset
> procedures to recover from as many faults as possible.

> +#define I2C_PORT_BUSY_RESET 0x80000000

BIT() ?

> + for (i = 0; i < 9; ++i) {

i++ would work as well.

> + rc = fsi_i2c_write_reg(i2c->fsi, I2C_FSI_RESET_SCL, &dummy);
> + if (rc)
> + return rc;
> +
> + rc = fsi_i2c_write_reg(i2c->fsi, I2C_FSI_SET_SCL, &dummy);
> + if (rc)
> + return rc;
> + }

> + /* reset errors */
> + dummy = 0;
> + rc = fsi_i2c_write_reg(i2c->fsi, I2C_FSI_RESET_ERR, &dummy);
> + if (rc)
> + return rc;

Ah, okay, discard my previous comments on dummy assignments. It seems
input and output.

> + msleep(1);

msleep(1) usually a bad idea.
usleep_range() I guess what you need here.

> +}

> + return -ETIME;

ETIMEDOUT ?

--
With Best Regards,
Andy Shevchenko

\
 
 \ /
  Last update: 2018-05-30 02:20    [W:0.124 / U:2.040 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site