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: <Ycjuwqgj9UV//dxd@glsvmlin.ini.cmu.edu>
Date:   Sun, 26 Dec 2021 17:37:54 -0500
From:   "Gabriel L. Somlo" <gsomlo@...il.com>
To:     Andy Shevchenko <andy.shevchenko@...il.com>
Cc:     Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
        Rob Herring <robh+dt@...nel.org>,
        devicetree <devicetree@...r.kernel.org>,
        Ulf Hansson <ulf.hansson@...aro.org>,
        linux-mmc <linux-mmc@...r.kernel.org>,
        Karol Gugala <kgugala@...micro.com>,
        Mateusz Holenko <mholenko@...micro.com>, krakoczy@...micro.com,
        mdudek@...ernships.antmicro.com, paulus@...abs.org,
        Joel Stanley <joel@....id.au>,
        Stafford Horne <shorne@...il.com>,
        Geert Uytterhoeven <geert@...ux-m68k.org>,
        david.abdurachmanov@...ive.com, florent@...oy-digital.fr,
        Randy Dunlap <rdunlap@...radead.org>
Subject: Re: [PATCH v5 3/3] mmc: Add driver for LiteX's LiteSDCard interface

On Sun, Dec 26, 2021 at 04:01:03PM +0200, Andy Shevchenko wrote:
> On Sun, Dec 26, 2021 at 3:36 PM Gabriel L. Somlo <gsomlo@...il.com> wrote:
> > On Sun, Dec 26, 2021 at 03:13:21PM +0200, Andy Shevchenko wrote:
> > > On Sun, Dec 26, 2021 at 1:45 PM Gabriel L. Somlo <gsomlo@...il.com> wrote:
> > > > On Sat, Dec 25, 2021 at 06:43:22PM +0200, Andy Shevchenko wrote:
> > > > > On Wed, Dec 15, 2021 at 10:00 PM Gabriel Somlo <gsomlo@...il.com> wrote:
> 
> ...
> 
> > > > > > +#ifdef CONFIG_ARCH_DMA_ADDR_T_64BIT
> > > > >
> > > > > Why under ifdeffery?
> > > >
> > > > Because I only want to do it on 64-bit capable architectures.
> > > >
> > > > The alternative would be to call
> > > >
> > > >   dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(64));
> > > >
> > > > on *all* architectures, but ignore the returned error (-EIO,
> > > > presumably on architetures that only support 32-bit DMA).
> > >
> > > I don't understand why you are supposed to ignore errors and why you
> > > expect to get such.
> >
> > If I call `dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(64));`
> > on a machine where `CONFIG_ARCH_DMA_ADDR_T_64BIT` is *not* set, I
> > expect an error. The implicit default
> > (per Documentation/core-api/dma-api-howto.rst), is DMA_BIT_MASK(32).
> > I'm working under the impression that on machines with
> > CONFIG_ARCH_DMA_ADDR_T_64BIT I should increase that to DMA_BIT_MASK(64).
> >
> > So if I don't #ifdef it, that call will fail on machines supporting
> > only 32-bits.
> >
> > What am I missing?
> 
> This thread: https://lkml.org/lkml/2021/6/7/398 ?

OK, so just call `dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(64));`
regardless of 32- or 64-bit dma capability, *do* check the return value,
and it should *not* fail on 32-bit systems.

I'll do that in v6 (should go out in early January '22, since I'm traveling
with only occasional email access at the moment).

Thanks,
--Gabriel

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ