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: <CAD=FV=V-3js3TfbymYAmZ-ruubv8X74-LsJ0-p8GZp3w3_fK8A@mail.gmail.com>
Date:   Thu, 8 Dec 2022 18:24:36 -0800
From:   Doug Anderson <dianders@...omium.org>
To:     Dmitry Torokhov <dmitry.torokhov@...il.com>
Cc:     Bjorn Andersson <andersson@...nel.org>,
        linux-arm-msm@...r.kernel.org, mka@...omium.org,
        Yunlong Jia <ecs.beijing2022@...il.com>,
        Konrad Dybcio <konrad.dybcio@...aro.org>,
        linux-input@...r.kernel.org, swboyd@...omium.org,
        Johnny Chuang <johnny.chuang.emc@...il.com>,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2 5/5] Input: elants_i2c: Delay longer with reset asserted

Hi,

On Thu, Dec 8, 2022 at 6:21 PM Dmitry Torokhov
<dmitry.torokhov@...il.com> wrote:
>
> On Thu, Dec 08, 2022 at 06:06:12PM -0800, Douglas Anderson wrote:
> > The elan touchscreen datasheet says that the reset GPIO only needs to
> > be asserted for 500us in order to reset the regulator. The problem is
> > that some boards need a level shifter between the signals on the GPIO
> > controller and the signals on the touchscreen. All of these extra
> > components on the line can slow the transition of the signals. On one
> > board, we measured the reset line and saw that it took almost 1.8ms to
> > go low. Even after we bumped up the "drive strength" of the signal
> > from the default 2mA to 8mA we still saw it take 421us for the signal
> > to go low.
> >
> > In order to account for this let's lengthen the amount of time that we
> > keep the reset asserted. Let's bump it up from 500us to 5000us.
> > That's still a relatively short amount of time and is much safer.
> >
> > It should be noted that this fixes real problems. Case in point:
> > 1. The touchscreen power rail may be shared with another device (like
> >    an eDP panel). That means that at probe time power might already be
> >    on.
> > 2. In probe we grab the reset GPIO and assert it (make it low).
> > 3. We turn on power (a noop since it was already on).
> > 4. We wait 500us.
> > 5. We deassert the reset GPIO.
> >
> > With the above case and only a 500us delay we saw only a partial reset
> > asserted, which is bad. Giving it 5ms is overkill but feels safer in
> > case someone else has a different level shifter setup.
> >
> > Note that bumping up the delay to 5000 means that some configs yell
> > about using udelay(). We'll change to using usleep_range(). We give a
> > small range here because:
> > - This isn't a delay that happens very often so we don't need to worry
> >   about giving a big range to allow for power efficiency.
> > - usleep_range() is known to almost always pick the upper bound and
> >   delay that long and we really don't want to slow down the power on
> >   of the touchscreen that much.
> >
> > Signed-off-by: Douglas Anderson <dianders@...omium.org>
> > Reviewed-by: Matthias Kaehlcke <mka@...omium.org>
> > ---
> >
> > Changes in v2:
> > - Fix typo in commit message (Matthias)
> > - udelay -> usleep_range (Patches Robot, Dmitry)
> >
> >  drivers/input/touchscreen/elants_i2c.c | 4 ++--
> >  1 file changed, 2 insertions(+), 2 deletions(-)

Ah, right. I posted it against the Qualcomm tree which, of course,
doesn't have the previous patch I posted to this driver. Thanks for
fixing it up. :-)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ