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: <CAMuHMdXvbWrt44T4Sr_bDjS1YFfqZ82JHpH7f00FKYBHntyWSg@mail.gmail.com>
Date:   Fri, 27 Jul 2018 09:51:25 +0200
From:   Geert Uytterhoeven <geert@...ux-m68k.org>
To:     Masahiro Yamada <yamada.masahiro@...ionext.com>
Cc:     Wolfram Sang <wsa+renesas@...g-engineering.com>,
        Linux MMC List <linux-mmc@...r.kernel.org>,
        Ulf Hansson <ulf.hansson@...aro.org>,
        Linux-Renesas <linux-renesas-soc@...r.kernel.org>,
        Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] mmc: tmio: allow DMA request hook to return error status

Hi Yamada-san,

On Fri, Jul 27, 2018 at 3:15 AM Masahiro Yamada
<yamada.masahiro@...ionext.com> wrote:
> dma_request_chan() may return ERR_PTR(-EPROBE_DEFER), but
> tmio_mmc_request_dma() cannot propagate it since it is a
> void function.
>
> Change the return type to int so that the driver can retry
> probing later in case the DMA-engine driver is probed after
> the TMIO MMC driver.
>
> I moved the call for tmio_mmc_request_dma() up because it may
> fail now.  I also removed unneeded clearing of host->chan_{tx,rx}
> because (struct tmio_mmc_host) is allocated by kzalloc().
>
> Signed-off-by: Masahiro Yamada <yamada.masahiro@...ionext.com>

Thanks for your patch!

Isn't the idea to fall back to PIO if the DMA-engine driver is not found?

Unfortunately there's no way to distinguish between "DMA-engine hasn't been
probed yet" and "DMA-engine is not available" (e.g. CONFIG_RCAR_DMAC=n).
In both cases, dma_request_chan() will return -EPROBE_DEFER.
So if you treat this as an actual error, and propagate it, the following
will happen:
  - In case 1, the MMC driver will be reprobed successfully later.
  - In case 2,the MMC driver will never succeed.

Or am I missing something?

Gr{oetje,eeting}s,

                        Geert

-- 
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@...ux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ