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-next>] [day] [month] [year] [list]
Message-ID: <793f587a5bc744b393cf677258bce50e@hisilicon.com>
Date:   Wed, 31 Mar 2021 08:53:02 +0000
From:   "Song Bao Hua (Barry Song)" <song.bao.hua@...ilicon.com>
To:     Andy Shevchenko <andy.shevchenko@...il.com>
CC:     yangyicong <yangyicong@...wei.com>,
        "wsa@...nel.org" <wsa@...nel.org>,
        "andriy.shevchenko@...ux.intel.com" 
        <andriy.shevchenko@...ux.intel.com>,
        "linux-i2c@...r.kernel.org" <linux-i2c@...r.kernel.org>,
        "Sergey.Semin@...kalelectronics.ru" 
        <Sergey.Semin@...kalelectronics.ru>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        "digetx@...il.com" <digetx@...il.com>,
        "treding@...dia.com" <treding@...dia.com>,
        "jarkko.nikula@...ux.intel.com" <jarkko.nikula@...ux.intel.com>,
        "rmk+kernel@...linux.org.uk" <rmk+kernel@...linux.org.uk>,
        John Garry <john.garry@...wei.com>,
        "mika.westerberg@...ux.intel.com" <mika.westerberg@...ux.intel.com>,
        "Zengtao (B)" <prime.zeng@...ilicon.com>,
        Linuxarm <linuxarm@...wei.com>
Subject: RE: [PATCH 5/5] i2c: designware: Switch over to
 i2c_freq_mode_string()


> No, please read the code carefully.
> We can duplicate conditional, but it brings a bit of inconsistency to how the counters are printed.

Thanks for clarification, I am still confused as the original
code print the real mode based on dev->master_cfg, the new
code is printing mode based on frequency.

My understanding is the original code could fall back to a lower
speed when higher speed modes were not set successfully. For
example, high speed mode falls back to fast mode:

if ((dev->master_cfg & DW_IC_CON_SPEED_MASK) ==
		DW_IC_CON_SPEED_HIGH) {
		if ((comp_param1 & DW_IC_COMP_PARAM_1_SPEED_MODE_MASK)
			!= DW_IC_COMP_PARAM_1_SPEED_MODE_HIGH) {
			dev_err(dev->dev, "High Speed not supported!\n");
			dev->master_cfg &= ~DW_IC_CON_SPEED_MASK;
			dev->master_cfg |= DW_IC_CON_SPEED_FAST;
			dev->hs_hcnt = 0;
			dev->hs_lcnt = 0;
		}

the original code was printing the mode based on the new
fallback dev->master_cfg but not the mode calculated from
frequency:

	switch (dev->master_cfg & DW_IC_CON_SPEED_MASK) {
	case DW_IC_CON_SPEED_STD:
		mode_str = "Standard Mode";
		break;
	case DW_IC_CON_SPEED_HIGH:
		mode_str = "High Speed Mode";
		break;
	default:
		mode_str = "Fast Mode";
	}

> > +     return 0;
> >  }
> >
> >  /**
> > --
> > 2.8.1
> 
> 
> --
> With Best Regards,
> Andy Shevchenko


-- 
With Best Regards,
Andy Shevchenko

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ