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:   Tue, 9 Mar 2021 22:42:46 +0000
From:   Adam Ward <Adam.Ward.opensource@...semi.com>
To:     Lee Jones <lee.jones@...aro.org>, Mark Jonas <toertel@...il.com>
CC:     Mark Jonas <mark.jonas@...bosch.com>,
        Support Opensource <Support.Opensource@...semi.com>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        "linux-i2c@...r.kernel.org" <linux-i2c@...r.kernel.org>,
        Adam Thomson <Adam.Thomson.Opensource@...semi.com>,
        Steve Twiss <stwiss.opensource@...semi.com>,
        "marek.vasut@...il.com" <marek.vasut@...il.com>,
        "RUAN Tingquan (BT-FIR/ENG1-Zhu)" <tingquan.ruan@...bosch.com>,
        "Streidl Hubert (BT-FIR/ENG1-Grb)" <hubert.streidl@...bosch.com>,
        Wolfram Sang <wsa@...nel.org>
Subject: RE: [PATCH v4] mfd: da9063: Support SMBus and I2C mode

Hi Lee,

Tidy, but I've noticed the logic got inverted along the way:

> On Tue 09 Mar 2021, Lee Jones wrote:
> On Tue, 09 Mar 2021, Mark Jonas wrote:
> This is my suggestion:
> 
> 	/* If SMBus Mode is not available, enter Two-Wire Mode */
> 	if (!i2c_check_functionality(i2c->adapter, I2C_FUNC_I2C)) {

Determine bus *is* I2C, so assume SMBus timings not supported...
 	if (i2c_check_functionality(i2c->adapter, I2C_FUNC_I2C)) {

> 		ret = regmap_update_bits(da9063->regmap, DA9063_REG_CONFIG_J,
> 					 DA9063_TWOWIRE_TO,  DA9063_TWOWIRE_TO);

...and *clear* the (currently set by default) timeout bit:
 					 DA9063_TWOWIRE_TO,  0);

> 		if (ret < 0) {
> 			dev_err(da9063->dev, "Failed to set Two-Wire Bus
> Mode\n");
> 			return -EIO;
> 		}
> 	}

I think you're right to exclude a case; vendor motivation to override the TO default seems inherently trustworthy.

Best regards,
Adam

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ