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, 30 Jul 2020 12:18:14 +0200
From:   Christian Eggers <ceggers@...i.de>
To:     Andy Shevchenko <andy.shevchenko@...il.com>
CC:     Rob Herring <robh+dt@...nel.org>,
        Jonathan Cameron <jic23@...nel.org>,
        Hartmut Knaack <knaack.h@....de>,
        Lars-Peter Clausen <lars@...afoo.de>,
        "Peter Meerwald-Stadler" <pmeerw@...erw.net>,
        linux-iio <linux-iio@...r.kernel.org>,
        devicetree <devicetree@...r.kernel.org>,
        Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v2 2/2] iio: light: as73211: New driver

Hi Andy,

thanks for the extensive review. Almost all of you comments will be integrated 
into v3. 

On Tuesday, 28 July 2020, 20:00:31 CEST, Andy Shevchenko wrote:
> On Tue, Jul 28, 2020 at 9:32 AM Christian Eggers <ceggers@...i.de> wrote:

> > +       if (data->client->irq)
> > +               init_completion(&data->completion);
> I believe it should be reinit_completion().
added missing init_completion() in probe().

> > +       /* During measurement, there should be no traffic on the i2c bus 
*/
> > +       i2c_lock_bus(data->client->adapter, I2C_LOCK_SEGMENT);
> Hmm.. Really?
yes. According to the datasheet, the device is very sensitive to external 
noise
during measurement.

> > +               *val = (1 << (data->creg3 & 0b11)) * 1024 * 1000;
> 
> BIT()? GENMASK() ? 1000 I believe defined already.
Please recheck in v3. What shall I use instead of "1000"?

> > +                       /* saturate all channels (useful for overflows) */
> > +                       iio_buffer[1] = 0xffff;
> > +                       iio_buffer[2] = 0xffff;
> > +                       iio_buffer[3] = 0xffff;
> 
> Magic!
Replaced by U16_MAX. Do you want to see something else here? It is required
to communicate measurement errors to user space as the application will have
to adjust integration time and gain.

> > +static ssize_t as73211_show_samp_freq_available(
> > +               struct device *dev __always_unused,
> > +               struct device_attribute *attr __always_unused,
> > +               char *buf)
> > +{
> > +       size_t len = 0;
> > +       int i;
> > +
> > +       for (i = 0; i < 4; i++) {
> > +               len += scnprintf(buf + len, PAGE_SIZE - len, "%d ",
> > +                       (1 << (i + 10)) * 1000);
> > +       }
> > +
> > +       /* replace trailing space by newline */
> > +       buf[len - 1] = '\n';
> > +
> > +       return len;
> > +}
> 
> Repetition of IIO core functionality?
> 
> Ditto question for the other similar functions.
Can you please give me a pointer to an example? The list of available values 
of
some attributes depend on the current value of other attributes.

regards
Christian



Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ