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


Groups > linux.kernel > #1728989

Re: [PATCH 05/10] dmaengine: sun6i: Move number of pchans/vchans/request to device struct

From Maxime Ripard <maxime.ripard@free-electrons.com>
Newsgroups linux.kernel
Subject Re: [PATCH 05/10] dmaengine: sun6i: Move number of pchans/vchans/request to device struct
Date 2017-09-08 16:40 +0200
Message-ID <unsBQ-8jV-27@gated-at.bofh.it> (permalink)
References <ulLSh-5Nr-3@gated-at.bofh.it> <ulLSh-5Nr-1@gated-at.bofh.it> <ulUiR-2F5-3@gated-at.bofh.it> <um0HG-6DI-9@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


[Multipart message — attachments visible in raw view] - view raw

On Mon, Sep 04, 2017 at 02:30:59PM +0000, Brüns, Stefan wrote:
> On Montag, 4. September 2017 09:43:55 CEST Maxime Ripard wrote:
> > On Mon, Sep 04, 2017 at 12:40:56AM +0200, Stefan Brüns wrote:
> > > Preparatory patch: If the same compatible is used for different SoCs which
> > > have a common register layout, but different number of channels, the
> > > channel count can no longer be stored in the config. Store it in the
> > > device structure instead.
> > > 
> > > Signed-off-by: Stefan Brüns <stefan.bruens@rwth-aachen.de>
> > 
> > As stated already, we already are going to have a different
> > compatible, and this is not something that will change from one
> > instance to the other. Having code is therefore:
> >   A) Making the code more complex
> >   B) For no particular reason.
> 
> If the dma channel count (which is a standard dma binding, likely for a 
> reason) goes into the devicetree, it has to be moved out of the config.
>
> The R40 (which has register manuals available) has the same register layout as 
> the A64, but *does* have a different channel count. So you think it is a good 
> idea to introduce a new compatible again?
> 
> If you had been half as picky when merging the H3 and A83T support, we would 
> not have this mess now.
> 
> There is also the H6, where there is no register manual available yet, but I  
> bet it has the H3 (and A64, H5, R40) register layout, but unlikely the same 
> number of DMA channels *and* the same number of ports.

The thing is that this kind of things usually grow organically until
you can't just add a simple if case any more.

I'm sorry you were at the tipping point, but I'm sure you also
understand that adding more to the mess until the next one shows up
isn't viable either.

That being said, thinking a bit more on that one, if you add to the
binding that we need to have both the current SoC compatible (to
workaround any variation / bugs we might encounter in the future) and
the "generation" one (to avoid adding one for each new IP), plus the
mandatory dma-channels / dma-requests properties, that would work for
me.

Maxime

-- 
Maxime Ripard, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com

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


Thread

[PATCH 05/10] dmaengine: sun6i: Move number of pchans/vchans/request to device struct Stefan Brüns <stefan.bruens@rwth-aachen.de> - 2017-09-04 00:50 +0200
  Re: [PATCH 05/10] dmaengine: sun6i: Move number of  pchans/vchans/request to device struct Maxime Ripard <maxime.ripard@free-electrons.com> - 2017-09-04 09:50 +0200
    Re: [PATCH 05/10] dmaengine: sun6i: Move number of  pchans/vchans/request to device struct Brüns, Stefan <Stefan.Bruens@rwth-aachen.de> - 2017-09-04 16:40 +0200
      Re: [PATCH 05/10] dmaengine: sun6i: Move number of  pchans/vchans/request to device struct Maxime Ripard <maxime.ripard@free-electrons.com> - 2017-09-08 16:40 +0200

csiph-web