public inbox for linux-mmc@vger.kernel.org
 help / color / mirror / Atom feed
From: Simon Horman <horms@verge.net.au>
To: Arnd Bergmann <arnd@arndb.de>
Cc: Wolfram Sang <wsa+renesas@sang-engineering.com>,
	Ulf Hansson <ulf.hansson@linaro.org>,
	Magnus Damm <magnus.damm@gmail.com>,
	linux-mmc@vger.kernel.org, linux-renesas-soc@vger.kernel.org
Subject: Re: [PATCH/RFC v3 5/6] mmc: renesas_sdhi: add support for R-Car Gen3 SDHI DMAC
Date: Thu, 7 Jul 2016 08:57:46 +0200	[thread overview]
Message-ID: <20160707065746.GA18871@verge.net.au> (raw)
In-Reply-To: <4446440.WBAWGRgdkJ@wuerfel>

On Wed, Jul 06, 2016 at 11:21:40PM +0200, Arnd Bergmann wrote:
> On Wednesday, July 6, 2016 10:23:29 PM CEST Simon Horman wrote:
> > @@ -117,6 +124,23 @@ void sdhi_sys_dmac_init_dma(void);
> >  static void sdhi_sys_dmac_init_dma(void) { }
> >  #endif
> >  
> > +#if IS_ENABLED(CONFIG_MMC_SDHI_INTERNAL_DMA)
> > +void sdhi_internal_dmac_init_dma(void);
> > +#else
> > +static void sdhi_internal_dmac_init_dma(void) { }
> > +#endif
> > +
> > +static void sh_mobile_sdhi_init_dma(enum tmio_mmc_dmac_type dmac_type)
> > +{
> > +       switch (dmac_type) {
> > +       case TMIO_MMC_INTERNAL_DMAC:
> > +               return sdhi_internal_dmac_init_dma();
> > +
> > +       case TMIO_MMC_SYSC_DMAC:
> > +               return sdhi_sys_dmac_init_dma();
> > +       }
> > +}
> > +
> >  static void sh_mobile_sdhi_sdbuf_width(struct tmio_mmc_host *host, int width)
> >  {
> >         u32 val;
> > 
> 
> I've commented on this part for v2 already but got no reply. This
> time I took a little more care to understand the structure of the
> driver and how it gets modified.

Hi Arnd,

somehow I completely missed that feedback, sorry about that.

In general I think there is ample scope to restructure the TMIO/SDHI
drivers as they have grown in various directions over time. I'll look
over your proposal in more detail and see how it fits with my understanding
of TMIO/SDHI.

Wolfram, could you also take a look over this?

> 
> The way I see it, we have the MMC_TMIO_CORE driver that consists of
> tmio_mmc_pio.c and tmio_mmc_dma.c, which are tightly connected though the
> second one is optional, and two front-ends named tmio_mmc.c and
> sh_mobile_sdhi.c.
> 
> The first front-end never uses DMA, while the second one may or may
> not use DMA but is always built with the DMA support linked into the
> core driver.
> 
> I think abstracting the two DMA modes through a structure of
> function pointers as you do is the right strategy, but to build on
> top of that, we can change the link order:
> 
> - rename tmio_mmc_pio.c to tmio_mmc_core.c and make that the actual
>   driver core (without DMA)
> - tmio_mmc_dma.c becomes the main driver module for sh_mobile_sdhi
>   and gets the sh_mobile_sdhi_driver structure, sh_mobile_sdhi_of_match
>   table and module_platform_driver() statement
> - the existing sh_mobile_sdhi.c is a library module that exports
>   sh_mobile_sdhi_probe() and sh_mobile_sdhi_remove(), which now
>   gain a 'struct tmio_mmc_dma_ops *' and a 'struct sh_mobile_sdhi_of_data *'
>   argument and get called by the new probe function in what used to
>   be tmio_mmc_dma.c.
> - The new renesas_sdhi_internal_dmac.c becomes a third top-level
>   module that also calls sh_mobile_sdhi_probe() but passes its
>   own struct tmio_mmc_dma_ops and registers a different
>   platform_driver that only matches the of_rcar_gen3_compatible.
> 
> 	Arnd
> 

  reply	other threads:[~2016-07-07  6:57 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-07-06 20:23 [PATCH/RFC v3 0/6] mmc: renesas_sdhi: add R-Car Gen-3 DMA support Simon Horman
2016-07-06 20:23 ` [PATCH/RFC v3 1/6] mmc: sh_mobile_sdhi, tmio: make dma more modular Simon Horman
2016-07-06 20:43   ` Arnd Bergmann
2016-07-06 20:23 ` [PATCH/RFC v3 2/6] mmc: sh_mobile_sdhi: rename DMA source file as renesas_sdhi_sys_dmac.c Simon Horman
2016-07-06 20:23 ` [PATCH/RFC v3 3/6] mmc: tmio: add max_segs and max_blk_count in tmio_mmc_data Simon Horman
2016-07-06 20:23 ` [PATCH/RFC v3 4/6] mmc: sh_mobile_sdhi: add some SoC specific data for R-Car Gen3 Simon Horman
2016-07-06 20:23 ` [PATCH/RFC v3 5/6] mmc: renesas_sdhi: add support for R-Car Gen3 SDHI DMAC Simon Horman
2016-07-06 21:21   ` Arnd Bergmann
2016-07-07  6:57     ` Simon Horman [this message]
2016-07-06 20:23 ` [PATCH/RFC v3 6/6] arm64: defconfig: Enable SDHI SD/SDIO controller Simon Horman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20160707065746.GA18871@verge.net.au \
    --to=horms@verge.net.au \
    --cc=arnd@arndb.de \
    --cc=linux-mmc@vger.kernel.org \
    --cc=linux-renesas-soc@vger.kernel.org \
    --cc=magnus.damm@gmail.com \
    --cc=ulf.hansson@linaro.org \
    --cc=wsa+renesas@sang-engineering.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox