From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
To: Magnus Damm <magnus.damm@gmail.com>
Cc: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>,
SH-Linux <linux-sh@vger.kernel.org>,
Ian Molton <ian@mnementh.co.uk>, Chris Ball <cjb@laptop.org>,
linux-mmc@vger.kernel.org,
Guennadi Liakhovetski <g.liakhovetski@gmx.de>,
"linux-arm-kernel@lists.infradead.org"
<linux-arm-kernel@lists.infradead.org>
Subject: Re: [PATCH] mmc: sdhi: Enable the driver on all ARM platforms
Date: Thu, 31 Oct 2013 13:00:11 +0100 [thread overview]
Message-ID: <3866184.WsFITZrrct@avalon> (raw)
In-Reply-To: <CANqRtoR3Aj-j00=riDuDdWW2+AZD4jrjL2xHLt88ri2kdUB=Eg@mail.gmail.com>
Hi Magnus,
On Thursday 31 October 2013 17:26:30 Magnus Damm wrote:
> On Wed, Oct 30, 2013 at 8:23 PM, Laurent Pinchart wrote:
> > Renesas ARM platforms are transitioning from single-platform to
> > multi-platform kernels using the new ARCH_SHMOBILE_MULTI. Make the
> > driver available on all ARM platforms to enable it on both ARCH_SHMOBILE
> > and ARCH_SHMOBILE_MULTI and increase build testing coverage.
> >
> > Don't enable COMPILE_TEST support as the driver doesn't compile on x86
> > due (possibly among others) to missing readsw/writesw I/O accessors.
> >
> > Whether the CTL_DMA_ENABLE register is part of the standard TMIO
> > controller or is Renesas-specific is unknown and impossible to test as
> > we have no current or planned TMIO DMA users other than SUPERH and
> > ARCH_SHMOBILE. Writing to the register is thus conditionally compiled
> > for SUPERH and ARCH_SHMOBILE only. Adding ARCH_SHMOBILE_MULTI to the
> > list would extend this to multiarch kernels, but would break the driver
> > for non-shmobile platforms if the register is Renesas-specific. We can
> > thus get rid of the conditional compilation completely without
> > introducing any further issue, and let future non-Renesas users deal
> > with the situation if it turns out to be a the problem.
> >
> > Cc: Chris Ball <cjb@laptop.org>
> > Cc: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
> > Cc: Ian Molton <ian@mnementh.co.uk>
> > Cc: linux-mmc@vger.kernel.org
> > Signed-off-by: Laurent Pinchart
> > <laurent.pinchart+renesas@ideasonboard.com>
> > ---
> >
> > drivers/mmc/host/Kconfig | 2 +-
> > drivers/mmc/host/tmio_mmc_dma.c | 4 +---
> > 2 files changed, 2 insertions(+), 4 deletions(-)
> >
> > diff --git a/drivers/mmc/host/Kconfig b/drivers/mmc/host/Kconfig
> > index 7fc5099..51957d4 100644
> > --- a/drivers/mmc/host/Kconfig
> > +++ b/drivers/mmc/host/Kconfig
> > @@ -479,7 +479,7 @@ config MMC_TMIO
> >
> > config MMC_SDHI
> > tristate "SH-Mobile SDHI SD/SDIO controller support"
> > - depends on SUPERH || ARCH_SHMOBILE
> > + depends on SUPERH || ARM
> > select MMC_TMIO_CORE
> > help
> > This provides support for the SDHI SD/SDIO controller found in
> > diff --git a/drivers/mmc/host/tmio_mmc_dma.c
> > b/drivers/mmc/host/tmio_mmc_dma.c index 65edb4a..8a4fd2d 100644
> > --- a/drivers/mmc/host/tmio_mmc_dma.c
> > +++ b/drivers/mmc/host/tmio_mmc_dma.c
> > @@ -28,10 +28,8 @@ void tmio_mmc_enable_dma(struct tmio_mmc_host *host,
> > bool enable)>
> > if (!host->chan_tx || !host->chan_rx)
> > return;
> >
> > -#if defined(CONFIG_SUPERH) || defined(CONFIG_ARCH_SHMOBILE)
> > - /* Switch DMA mode on or off - SuperH specific? */
> > + /* Switch DMA mode on or off. This might be Renesas-specific. */
> > sd_ctrl_write16(host, CTL_DMA_ENABLE, enable ? 2 : 0);
> > -#endif
>
> Hi Laurent,
>
> Thanks for your efforts. Hate to slow things down, but this last hunk looks
> wrong to me. I believe the reason for the #ifdef is that non-Renesas IP may
> be using the tmio_mmc driver, at least they used to. Not sure if anyone is
> using DMA Engine though. If I were you I would play it safe and simply
> update the #ifdef with same kind of dependencies that the Kconfig bits have.
There are several points to consider here.
- drivers/mmc/host/tmio_mmc_dma.c is only compiled in when CONFIG_MMC_SDHI is
selected. The symbol currently depends on SUPERH || ARCH_SHMOBILE. We thus
have no non-Renesas users for TMIO DMA at the moment.
- I don't know whether the CTL_DMA_ENABLE register is specific to Renesas or
not. I haven't been able to find a publicly available copy of the TMIO
documentation. The Renesas datasheets I have access to don't document the SDHI
module. Can you comment on that ?
- Merely adding CONFIG_ARCH_SHMOBILE_MULTI to the CTL_DMA_ENABLE write #if
guard will break on multiplatform kernels anyway. If a non-Renesas platform
uses TMIO DMA, a kernel that supports both a Renesas SoC and that non-Renesas
platform will have the CTL_DMA_ENABLE code compiled in.
For those reasons I have decided to remove the #if and defer the fix (if
needed, if CTL_DMA_ENGINE is indeed Renesas-specific) to the first non-Renesas
TMIO DMA user.
> Also, it would of course be nice to clean up the driver, perhaps with a
> feature flag for this special register or why not simply move the code to
> the sdhi file. But that's not really related to your multiplatform kconfig
> change, is it? =)
No, it isn't :-) I could try to find time to fix that later, but I don't like
adding support for features that are not used. I would first want to be sure
that the CTL_DMA_ENABLE register is indeed Renesas-specific, which might be a
bit hard to ascertain of no non-Renesas chip implements TMIO DMA :-)
--
Regards,
Laurent Pinchart
next prev parent reply other threads:[~2013-10-31 11:59 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-10-29 22:37 [PATCH v2 00/19] Enable various Renesas drivers on all ARM platforms Laurent Pinchart
2013-10-29 22:37 ` [PATCH v2 08/19] mmc: sdhi: Enable the driver " Laurent Pinchart
2013-10-30 11:23 ` [PATCH] " Laurent Pinchart
2013-10-30 11:23 ` Laurent Pinchart
2013-10-31 8:26 ` Magnus Damm
2013-10-31 12:00 ` Laurent Pinchart [this message]
2013-10-29 22:37 ` [PATCH v2 09/19] mmc: sh_mmcif: " Laurent Pinchart
2013-10-30 11:34 ` [PATCH v3 1/3] mmc: sh_mmcif: Factorize DMA channel request and configuration code Laurent Pinchart
2013-10-30 11:34 ` [PATCH v3 2/3] mmc: sh_mmcif: Fix compilation warning on 64-bit platforms Laurent Pinchart
2013-10-30 11:34 ` [PATCH v3 3/3] mmc: sh_mmcif: Enable the driver on all ARM platforms Laurent Pinchart
2013-10-31 5:52 ` [PATCH v2 00/19] Enable various Renesas drivers " Simon Horman
[not found] ` <1383086274-11049-1-git-send-email-laurent.pinchart+renesas-ryLnwIuWjnjg/C1BVhZhaw@public.gmane.org>
2013-11-12 23:32 ` Laurent Pinchart
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=3866184.WsFITZrrct@avalon \
--to=laurent.pinchart@ideasonboard.com \
--cc=cjb@laptop.org \
--cc=g.liakhovetski@gmx.de \
--cc=ian@mnementh.co.uk \
--cc=laurent.pinchart+renesas@ideasonboard.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-mmc@vger.kernel.org \
--cc=linux-sh@vger.kernel.org \
--cc=magnus.damm@gmail.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;
as well as URLs for NNTP newsgroup(s).