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]
Message-ID: <20200521020256.mfdark6vzinuktf7@mobilestation>
Date:   Thu, 21 May 2020 05:02:56 +0300
From:   Serge Semin <Sergey.Semin@...kalelectronics.ru>
To:     Jarkko Nikula <jarkko.nikula@...ux.intel.com>
CC:     Serge Semin <fancer.lancer@...il.com>,
        Andy Shevchenko <andriy.shevchenko@...ux.intel.com>,
        Mika Westerberg <mika.westerberg@...ux.intel.com>,
        Alexey Malahov <Alexey.Malahov@...kalelectronics.ru>,
        Thomas Bogendoerfer <tsbogend@...ha.franken.de>,
        Paul Burton <paulburton@...nel.org>,
        Ralf Baechle <ralf@...ux-mips.org>,
        Wolfram Sang <wsa@...-dreams.de>,
        Rob Herring <robh+dt@...nel.org>,
        Frank Rowand <frowand.list@...il.com>,
        <devicetree@...r.kernel.org>, <linux-mips@...r.kernel.org>,
        Wolfram Sang <wsa+renesas@...g-engineering.com>,
        Jean Delvare <jdelvare@...e.de>,
        Krzysztof Kozlowski <krzk@...nel.org>,
        Max Staudt <max@...as.org>, Stefan Roese <sr@...x.de>,
        Uwe Kleine-König <uwe@...ine-koenig.org>,
        Shaokun Zhang <zhangshaokun@...ilicon.com>,
        <linux-i2c@...r.kernel.org>, <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v2 04/12] i2c: designware: Convert driver to using regmap
 API

On Wed, May 20, 2020 at 03:16:07PM +0300, Jarkko Nikula wrote:
> On 5/10/20 12:50 PM, Serge Semin wrote:
> > Seeing the DW I2C driver is using flags-based accessors with two
> > conditional clauses it would be better to replace them with the regmap
> > API IO methods and to initialize the regmap object with read/write
> > callbacks specific to the controller registers map implementation. This
> > will be also handy for the drivers with non-standard registers mapping
> > (like an embedded into the Baikal-T1 System Controller DW I2C block, which
> > glue-driver is a part of this series).
> > 
> > As before the driver tries to detect the mapping setup at probe stage and
> > creates a regmap object accordingly, which will be used by the rest of the
> > code to correctly access the controller registers. In two places it was
> > appropriate to convert the hand-written read-modify-write and
> > read-poll-loop design patterns to the corresponding regmap API
> > ready-to-use methods.
> > 
> > Note the regmap IO methods return value is checked only at the probe
> > stage. The rest of the code won't do this because basically we have
> > MMIO-based regmap so non of the read/write methods can fail (this also
> > won't be needed for the Baikal-T1-specific I2C controller).
> > 
> > Suggested-by: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
> > Signed-off-by: Serge Semin <Sergey.Semin@...kalelectronics.ru>
> > Cc: Alexey Malahov <Alexey.Malahov@...kalelectronics.ru>
> > Cc: Thomas Bogendoerfer <tsbogend@...ha.franken.de>
> > Cc: Paul Burton <paulburton@...nel.org>
> > Cc: Ralf Baechle <ralf@...ux-mips.org>
> > Cc: Wolfram Sang <wsa@...-dreams.de>
> > Cc: Rob Herring <robh+dt@...nel.org>
> > Cc: Frank Rowand <frowand.list@...il.com>
> > Cc: devicetree@...r.kernel.org
> > Cc: linux-mips@...r.kernel.org
> > ---
> >   drivers/i2c/busses/Kconfig                 |   1 +
> >   drivers/i2c/busses/i2c-designware-common.c | 171 +++++++++++++++------
> >   drivers/i2c/busses/i2c-designware-core.h   |  18 +--
> >   drivers/i2c/busses/i2c-designware-master.c | 125 ++++++++-------
> >   drivers/i2c/busses/i2c-designware-slave.c  |  77 +++++-----
> >   5 files changed, 239 insertions(+), 153 deletions(-)
> > 
> Looking at patches 4/12-12/12 I think it would be good to move fixes and
> less invasive patches before this. Like
> 
> i2c: designware: slave: Set DW I2C core module dependency
> i2c: designware: Use `-y` to build multi-object modules
> i2c: designware: Move Baytrail sem config to the platform if-clause
> 
> That said, you may add:
> 
> Tested-by: Jarkko Nikula <jarkko.nikula@...ux.intel.com>
> Acked-by: Jarkko Nikula <jarkko.nikula@...ux.intel.com>

Ok. I'll move those three patches to be before this one in v3. Thanks.

-Sergey

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ