Re: [PATCH 6/6] mmc: renesas_sdhi: make 'dmac_only_one_rx' a quirk

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Wolfram,

On Mon, Mar 21, 2022 at 6:33 PM Wolfram Sang
<wsa+renesas@xxxxxxxxxxxxxxxxxxxx> wrote:
> After Shimoda-san's much appreciated refactoring of the quirk handling,
> we can convert now 'dmac_only_one_rx' from an ugly global flag to a
> regular quirk. This makes quirk handling more consistent and easier to
> maintain. After this patch, soc_dma_quirks is completely gone, hooray!
>
> Signed-off-by: Wolfram Sang <wsa+renesas@xxxxxxxxxxxxxxxxxxxx>

Thanks for your patch!

> --- a/drivers/mmc/host/renesas_sdhi_internal_dmac.c
> +++ b/drivers/mmc/host/renesas_sdhi_internal_dmac.c
> @@ -372,7 +378,7 @@ renesas_sdhi_internal_dmac_start_dma(struct tmio_mmc_host *host,
>
>         if (data->flags & MMC_DATA_READ) {
>                 dtran_mode |= DTRAN_MODE_CH_NUM_CH1;
> -               if (test_bit(SDHI_INTERNAL_DMAC_ONE_RX_ONLY, &global_flags) &&
> +               if (priv->quirks->dma_one_rx_only &&

If there are no quirks (yes, we do have such systems ;-), this will
crash with a NULL-pointer dereference.  Actually patch 5/6 has the
same problem.

As I could reproduce the issue, and Ulf has already applied
this series, I've sent a patch:
https://lore.kernel.org/r/cc3178c2ff60f640f4d5a071d51f6b0b1db37656.1648822020.git.geert+renesas@xxxxxxxxx

>                     test_and_set_bit(SDHI_INTERNAL_DMAC_RX_IN_USE, &global_flags))
>                         goto force_pio_with_unmap;
>         } else {

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@xxxxxxxxxxxxxx

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



[Index of Archives]     [Linux Samsung SOC]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]

  Powered by Linux