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:   Mon, 6 Jun 2022 16:00:40 +0100
From:   Jonathan Cameron <Jonathan.Cameron@...wei.com>
To:     Jagath Jog J <jagathjog1996@...il.com>
CC:     Jonathan Cameron <jic23@...nel.org>,
        Andy Shevchenko <andy.shevchenko@...il.com>,
        linux-iio <linux-iio@...r.kernel.org>,
        "Linux Kernel Mailing List" <linux-kernel@...r.kernel.org>
Subject: Re: [RFC 2/2] iio: accel: bma400: Add support for single and double
 tap events

On Sun, 5 Jun 2022 10:38:10 +0530
Jagath Jog J <jagathjog1996@...il.com> wrote:

> Hi Jonathan and Andy.
> 
> On Sat, Jun 4, 2022 at 8:22 PM Jonathan Cameron <jic23@...nel.org> wrote:
> >
> > On Sun, 29 May 2022 09:31:53 +0530
> > Jagath Jog J <jagathjog1996@...il.com> wrote:
> >  
> > > Add support for single and double tap events based on the tap threshold
> > > value and minimum quite time value between the taps. INT1 pin is used to
> > > interrupt and event is pushed to userspace.
> > >
> > > Signed-off-by: Jagath Jog J <jagathjog1996@...il.com>  
> >
> > Hi Jagath,
> >
> > A few comments inline.
> >
> > Thanks,
> >
> > Jonathan



> > > +
> > > +     /*
> > > +      * acc_filt1 is the data source for the tap interrupt and it is
> > > +      * operating on an input data rate of 200Hz.
> > > +      */
> > > +     if (!data->tap_event_en) {  
> >
> > Feels like checking the wrong thing.  If we need 200Hz, check if the
> > data rate is at 200Hz rather than if the tap_event is not enabled.
> > Obviously same result, but one seems more obvious.  
> 
> if (!data->tap_event_en)
> This checking is to make sure not to execute
> bma400_set_accel_output_data_rate() function while disabling the
> tap event to avoid the negative (-EBUSY) return value from the
> function bma400_set_accel_output_data_rate() when either of
> the tap is enabled.

Ah. Fair enough. It's a little odd looking though. You could push
the check out of bma400_set_accel_output_data_rate() and into
write_raw though would need to be within the lock to avoid potential
race conditions.  Perhaps just not worth the effort.

Jonathan


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ