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:   Sun, 3 Dec 2017 20:43:47 +0100
From:   Wolfram Sang <wsa@...-dreams.de>
To:     Mark Brown <broonie@...nel.org>
Cc:     Wolfram Sang <wsa+renesas@...g-engineering.com>,
        linux-i2c@...r.kernel.org, linux-kernel@...r.kernel.org,
        linux-renesas-soc@...r.kernel.org, linux-iio@...r.kernel.org,
        linux-input@...r.kernel.org, linux-media@...r.kernel.org
Subject: Re: [PATCH v6 0/9] i2c: document DMA handling and add helpers for it


> > > We pretty much assume everything is DMA safe already, the majority of
> > > transfers go to/from kmalloc()ed scratch buffers so actually are DMA
> > > safe but for bulk transfers we use the caller buffer and there might be
> > > some problem users.
> 
> > So, pretty much the situation I2C was in before this patch set: we
> > pretty much assume DMA safety but there might be problem users.
> 
> It's a bit different in that it's much more likely that a SPI controller
> will actually do DMA than an I2C one since the speeds are higher and
> there's frequent applications that do large transfers so it's more
> likely that people will do the right thing as issues would tend to come
> up if they don't.

Yes, for SPI this is true. I was thinking more of regmap with its
usage of different transport mechanisms. But I guess they should all be
DMA safe because some of them need to be DMA safe?

> > > I can't really think of a particularly good way of
> > > handling it off the top of my head, obviously not setting the flag is
> > > easy but doesn't get the benefit while always using a bounce buffer
> > > would involve lots of unneeded memcpy().  Doing _dmasafe() isn't
> > > particularly appealing either but might be what we end up with.
> 
> > Okay. That sounds you are fine with the approach taken here, in general?
> 
> It's hard to summon enthusiasm but yes, without changes to the DMA stuff
> it's probably as good as we can do.

That sums it up pretty nicely. However, despite even my limited
enthusiasm for this extra flag, I think this set of rules has value. For
some platforms, DMA works more or less by coincidence and can lead to
surprises with e.g. virtual stacks. This is not good engineering
practice, I'd say.

I am going to apply this series now. Thanks for your input!


Download attachment "signature.asc" of type "application/pgp-signature" (834 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ