lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Wed, 30 May 2018 03:20:04 +0300
From:   Andy Shevchenko <andy.shevchenko@...il.com>
To:     Eddie James <eajames@...ux.vnet.ibm.com>
Cc:     linux-i2c <linux-i2c@...r.kernel.org>,
        Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
        devicetree <devicetree@...r.kernel.org>,
        Wolfram Sang <wsa@...-dreams.de>,
        Rob Herring <robh+dt@...nel.org>,
        Benjamin Herrenschmidt <benh@...nel.crashing.org>,
        Joel Stanley <joel@....id.au>,
        Mark Rutland <mark.rutland@....com>,
        Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
        "Edward A. James" <eajames@...ibm.com>
Subject: Re: [PATCH v7 4/7] drivers/i2c: Add abort and hardware reset procedures

On Wed, May 30, 2018 at 1:24 AM, Eddie James <eajames@...ux.vnet.ibm.com> wrote:
> From: "Edward A. James" <eajames@...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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ