Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1674924

Re: [PATCH 1/2] fsl/fman: propagate dma_ops

From Geert Uytterhoeven <geert@linux-m68k.org>
Newsgroups linux.kernel
Subject Re: [PATCH 1/2] fsl/fman: propagate dma_ops
Date 2017-06-26 18:30 +0200
Message-ID <tWF3H-4Dv-15@gated-at.bofh.it> (permalink)
References <tUvrQ-3dH-5@gated-at.bofh.it> <tWwWt-7SR-19@gated-at.bofh.it> <tWwWt-7SR-17@gated-at.bofh.it> <tWDEC-3EY-17@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


Hi Madalin,

On Mon, Jun 26, 2017 at 4:55 PM, Madalin-cristian Bucur
<madalin.bucur@nxp.com> wrote:
>> -----Original Message-----
>> From: geert.uytterhoeven@gmail.com [mailto:geert.uytterhoeven@gmail.com]
>> On Behalf Of Geert Uytterhoeven
>> Sent: Monday, June 26, 2017 10:49 AM
>> To: Madalin-cristian Bucur <madalin.bucur@nxp.com>
>> Cc: netdev@vger.kernel.org; David S. Miller <davem@davemloft.net>;
>> linuxppc-dev@lists.ozlabs.org; linux-kernel@vger.kernel.org
>> Subject: Re: [PATCH 1/2] fsl/fman: propagate dma_ops
>>
> On Mon, Jun 19, 2017 at 5:04 PM, Madalin Bucur <madalin.bucur@nxp.com>
>> wrote:
>> > Make sure dma_ops are set, to be later used by the Ethernet driver.
>> >
>> > Signed-off-by: Madalin Bucur <madalin.bucur@nxp.com>
>> > ---
>> >  drivers/net/ethernet/freescale/fman/mac.c | 2 ++
>> >  1 file changed, 2 insertions(+)
>> >
>> > diff --git a/drivers/net/ethernet/freescale/fman/mac.c
>> b/drivers/net/ethernet/freescale/fman/mac.c
>> > index 0b31f85..6e67d22f 100644
>> > --- a/drivers/net/ethernet/freescale/fman/mac.c
>> > +++ b/drivers/net/ethernet/freescale/fman/mac.c
>> > @@ -623,6 +623,8 @@ static struct platform_device
>> *dpaa_eth_add_device(int fman_id,
>> >                 goto no_mem;
>> >         }
>> >
>> > +       set_dma_ops(&pdev->dev, get_dma_ops(priv->dev));
>> > +
>>
>> When compile-testing with f NO_DMA=y:
>>
>>     drivers/net/ethernet/freescale/fman/mac.c: In function
>> ‘dpaa_eth_add_device’:
>>     drivers/net/ethernet/freescale/fman/mac.c:626: error: implicit
>> declaration of function ‘set_dma_ops’
>>
>> Reverting commit 5567e989198b5a8d fixes this regression in v4.12-rc7.
>>
>> Why is this change needed?
>> There's no single other call to the DMA API in this file?
>
> We're setting here the dma_ops that are later used in the other driver/patch.
> The problem is we now depend upon DMA but do not explicitly declare it:
>
> <<Code that depends on the dma-mapping API needs to set 'depends on HAS_DMA'
> in its Kconfig>>

Sure. But only if the driver really uses DMA.
I can stick a set_dma_ops() call in whatever driver, but that doesn't
mean it will
suddenly use DMA.
Why does the FMan driver suddenly has a dependency on DMA, if it doesn't
use DMA?

> I'll need to add this to the FMan driver Kconfig.

Why does the FMan driver need this?
Why can't his call be done in the driver that uses the DMA APIO?

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-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

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Re: [PATCH 1/2] fsl/fman: propagate dma_ops Geert Uytterhoeven <geert@linux-m68k.org> - 2017-06-26 09:50 +0200
  RE: [PATCH 1/2] fsl/fman: propagate dma_ops Madalin-cristian Bucur <madalin.bucur@nxp.com> - 2017-06-26 17:00 +0200
    Re: [PATCH 1/2] fsl/fman: propagate dma_ops Geert Uytterhoeven <geert@linux-m68k.org> - 2017-06-26 18:30 +0200
      RE: [PATCH 1/2] fsl/fman: propagate dma_ops Madalin-cristian Bucur <madalin.bucur@nxp.com> - 2017-06-27 08:50 +0200

csiph-web