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] [day] [month] [year] [list]
Message-ID: <20210310085809.GE4931@dell>
Date:   Wed, 10 Mar 2021 08:58:09 +0000
From:   Lee Jones <lee.jones@...aro.org>
To:     Adam Ward <Adam.Ward.opensource@...semi.com>
Cc:     Mark Jonas <toertel@...il.com>,
        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

On Tue, 09 Mar 2021, Adam Ward wrote:

> 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);

Thanks for checking this.  You're right.

The example was provided as a back-of-a-fag-packet design, not a
fully tested (or even compiled) solution.  It took me 2 mins to type
out.

> > 		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.

A default value is a default value. :)

-- 
Lee Jones [李琼斯]
Senior Technical Lead - Developer Services
Linaro.org │ Open source software for Arm SoCs
Follow Linaro: Facebook | Twitter | Blog

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ