Re: [PATCH RFC 3/6] dmaengine: qcom: gpi: Accept protocol ID hints

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

 



Hi Konrad,

On Wed, 30 Jul 2025 at 11:35, Konrad Dybcio <konradybcio@xxxxxxxxxx> wrote:
> From: Konrad Dybcio <konrad.dybcio@xxxxxxxxxxxxxxxx>
>
> Client drivers may now pass hints to dmaengine drivers. GPI DMA's only
> consumers (GENI SEs) need to pass a protocol (I2C, I3C, SPI, etc.) ID
> to the DMA engine driver, for it to take different actions.
>
> Currently, that's done through passing that ID through device tree,
> with each Serial Engine expressed NUM_PROTOCOL times, resulting in
> terrible dt-bindings that are full of useless copypasta.
>
> To help get rid of that, accept the driver cookie instead, while
> keeping backwards compatibility.
>
> Signed-off-by: Konrad Dybcio <konrad.dybcio@xxxxxxxxxxxxxxxx>

Thanks for your patch!

> --- a/drivers/dma/qcom/gpi.c
> +++ b/drivers/dma/qcom/gpi.c
> @@ -2145,7 +2151,8 @@ static struct dma_chan *gpi_of_dma_xlate(struct of_phandle_args *args,
>         }
>
>         gchan->seid = seid;
> -       gchan->protocol = args->args[2];
> +       /* The protocol ID is in the teens range, simply ignore the higher bits */
> +       gchan->protocol = (u32)((u64)proto);

A single cast "(uintptr_t)" should be sufficient.
Casing the pointer to u64 on 32-bit may trigger:

    warning: cast from pointer to integer of different size
[-Wpointer-to-int-cast]

>
>         return dma_get_slave_channel(&gchan->vc.chan);
>  }

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