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:   Thu, 2 Jul 2020 13:04:30 +0300
From:   Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
To:     Chris Packham <chris.packham@...iedtelesis.co.nz>
Cc:     wsa@...nel.org,
        Mark Tomlinson <mark.tomlinson@...iedtelesis.co.nz>,
        linux-i2c@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2] i2c: algo-pca: Add 0x78 as SCL stuck low status

On Thu, Jul 02, 2020 at 10:39:11AM +1200, Chris Packham wrote:
> The PCA9665 datasheet says that I2CSTA = 78h indicates that SCL is stuck
> low, this differs to the PCA9564 which uses 90h for this indication.
> Treat either 0x78 or 0x90 as an indication that the SCL line is stuck.
> 
> Based on looking through the PCA9564 and PCA9665 datasheets this should
> be safe for both chips. The PCA9564 should not return 0x78 for any valid
> state and the PCA9665 should not return 0x90.

For me as well looks better this way.
Reviewed-by: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>

> Signed-off-by: Chris Packham <chris.packham@...iedtelesis.co.nz>
> ---
> Changes in v2:
> - Note which status corresponds to which chip
> - Move patch commentary to commit message
> 
>  drivers/i2c/algos/i2c-algo-pca.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/i2c/algos/i2c-algo-pca.c b/drivers/i2c/algos/i2c-algo-pca.c
> index 7f10312d1b88..388978775be0 100644
> --- a/drivers/i2c/algos/i2c-algo-pca.c
> +++ b/drivers/i2c/algos/i2c-algo-pca.c
> @@ -314,7 +314,8 @@ static int pca_xfer(struct i2c_adapter *i2c_adap,
>  			DEB2("BUS ERROR - SDA Stuck low\n");
>  			pca_reset(adap);
>  			goto out;
> -		case 0x90: /* Bus error - SCL stuck low */
> +		case 0x78: /* Bus error - SCL stuck low (PCA9665) */
> +		case 0x90: /* Bus error - SCL stuck low (PCA9564) */
>  			DEB2("BUS ERROR - SCL Stuck low\n");
>  			pca_reset(adap);
>  			goto out;
> -- 
> 2.27.0
> 

-- 
With Best Regards,
Andy Shevchenko


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ