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] [day] [month] [year] [list]
Date:   Thu, 6 Jun 2019 12:53:28 -0700
From:   Andrey Smirnov <andrew.smirnov@...il.com>
To:     Andrzej Hajda <a.hajda@...sung.com>
Cc:     dri-devel@...ts.freedesktop.org,
        Archit Taneja <architt@...eaurora.org>,
        Laurent Pinchart <Laurent.pinchart@...asonboard.com>,
        Tomi Valkeinen <tomi.valkeinen@...com>,
        Andrey Gusakov <andrey.gusakov@...entembedded.com>,
        Philipp Zabel <p.zabel@...gutronix.de>,
        Cory Tusar <cory.tusar@....aero>,
        Chris Healy <cphealy@...il.com>,
        Lucas Stach <l.stach@...gutronix.de>,
        linux-kernel <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v3 06/15] drm/bridge: tc358767: Simplify AUX data read

On Thu, Jun 6, 2019 at 3:59 AM Andrzej Hajda <a.hajda@...sung.com> wrote:
>
> On 05.06.2019 09:04, Andrey Smirnov wrote:
> > Simplify AUX data read by removing index arithmetic and shifting with
> > a helper functions that does three things:
> >
> >     1. Fetch data from up to 4 32-bit registers from the chip
> >     2. Optionally fix data endianness (not needed on LE hosts)
> >     3. Copy read data into user provided array.
> >
> > Signed-off-by: Andrey Smirnov <andrew.smirnov@...il.com>
> > Cc: Archit Taneja <architt@...eaurora.org>
> > Cc: Andrzej Hajda <a.hajda@...sung.com>
> > Cc: Laurent Pinchart <Laurent.pinchart@...asonboard.com>
> > Cc: Tomi Valkeinen <tomi.valkeinen@...com>
> > Cc: Andrey Gusakov <andrey.gusakov@...entembedded.com>
> > Cc: Philipp Zabel <p.zabel@...gutronix.de>
> > Cc: Cory Tusar <cory.tusar@....aero>
> > Cc: Chris Healy <cphealy@...il.com>
> > Cc: Lucas Stach <l.stach@...gutronix.de>
> > Cc: dri-devel@...ts.freedesktop.org
> > Cc: linux-kernel@...r.kernel.org
> > ---
> >  drivers/gpu/drm/bridge/tc358767.c | 40 +++++++++++++++++++++----------
> >  1 file changed, 27 insertions(+), 13 deletions(-)
> >
> > diff --git a/drivers/gpu/drm/bridge/tc358767.c b/drivers/gpu/drm/bridge/tc358767.c
> > index e197ce0fb166..da47d81e7109 100644
> > --- a/drivers/gpu/drm/bridge/tc358767.c
> > +++ b/drivers/gpu/drm/bridge/tc358767.c
> > @@ -321,6 +321,29 @@ static int tc_aux_get_status(struct tc_data *tc, u8 *reply)
> >       return 0;
> >  }
> >
> > +static int tc_aux_read_data(struct tc_data *tc, void *data, size_t size)
> > +{
> > +     u32 auxrdata[DP_AUX_MAX_PAYLOAD_BYTES / sizeof(u32)];
> > +     int ret, i, count = DIV_ROUND_UP(size, sizeof(u32));
> > +
> > +     ret = regmap_bulk_read(tc->regmap, DP0_AUXRDATA(0), auxrdata, count);
> > +     if (ret)
> > +             return ret;
> > +
> > +     for (i = 0; i < count; i++) {
> > +             /*
> > +              * Our regmap is configured as LE for register data,
> > +              * so we need undo any byte swapping that might have
> > +              * happened to preserve original byte order.
> > +              */
> > +             le32_to_cpus(&auxrdata[i]);
> > +     }
> > +
> > +     memcpy(data, auxrdata, size);
> > +
> > +     return size;
> > +}
> > +
>
>
> Hmm, cannot we just use regmap_raw_read?

I'll give it a try in v4.

Thanks,
Andrey Smirnov

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ