* [PATCH 2/8] mmc: omap: Fix DMA configuration to not rely on device id [not found] <1384396537-3486-1-git-send-email-tony@atomide.com> @ 2013-11-14 2:35 ` Tony Lindgren 2013-11-18 18:47 ` Tony Lindgren 2013-11-30 0:38 ` Joel Fernandes 2013-11-14 2:35 ` [PATCH 3/8] mmc: omap: Fix I2C dependency and make driver usable with device tree Tony Lindgren 1 sibling, 2 replies; 18+ messages in thread From: Tony Lindgren @ 2013-11-14 2:35 UTC (permalink / raw) To: linux-arm-kernel, linux-omap; +Cc: Chris Ball, linux-mmc We are wrongly relying on device id for the DMA configuration which can lead to wrong DMA channel being selected. Fix the issue by using the standard resources like we should. Cc: Chris Ball <cjb@laptop.org> Cc: linux-mmc@vger.kernel.org Signed-off-by: Tony Lindgren <tony@atomide.com> --- If this looks OK, I'd like to merge this as a fix via arm-soc tree along with the other patches in this series as my later patches depend on patches in this series. --- drivers/mmc/host/omap.c | 32 +++++++++++--------------------- 1 file changed, 11 insertions(+), 21 deletions(-) diff --git a/drivers/mmc/host/omap.c b/drivers/mmc/host/omap.c index b94f38e..ed56868 100644 --- a/drivers/mmc/host/omap.c +++ b/drivers/mmc/host/omap.c @@ -90,17 +90,6 @@ #define OMAP_MMC_CMDTYPE_AC 2 #define OMAP_MMC_CMDTYPE_ADTC 3 -#define OMAP_DMA_MMC_TX 21 -#define OMAP_DMA_MMC_RX 22 -#define OMAP_DMA_MMC2_TX 54 -#define OMAP_DMA_MMC2_RX 55 - -#define OMAP24XX_DMA_MMC2_TX 47 -#define OMAP24XX_DMA_MMC2_RX 48 -#define OMAP24XX_DMA_MMC1_TX 61 -#define OMAP24XX_DMA_MMC1_RX 62 - - #define DRIVER_NAME "mmci-omap" /* Specifies how often in millisecs to poll for card status changes @@ -1408,19 +1397,20 @@ static int mmc_omap_probe(struct platform_device *pdev) host->dma_tx_burst = -1; host->dma_rx_burst = -1; - if (mmc_omap2()) - sig = host->id == 0 ? OMAP24XX_DMA_MMC1_TX : OMAP24XX_DMA_MMC2_TX; - else - sig = host->id == 0 ? OMAP_DMA_MMC_TX : OMAP_DMA_MMC2_TX; - host->dma_tx = dma_request_channel(mask, omap_dma_filter_fn, &sig); + res = platform_get_resource_byname(pdev, IORESOURCE_DMA, "tx"); + if (res) + sig = res->start; + host->dma_tx = dma_request_slave_channel_compat(mask, + omap_dma_filter_fn, &sig, &pdev->dev, "tx"); if (!host->dma_tx) dev_warn(host->dev, "unable to obtain TX DMA engine channel %u\n", sig); - if (mmc_omap2()) - sig = host->id == 0 ? OMAP24XX_DMA_MMC1_RX : OMAP24XX_DMA_MMC2_RX; - else - sig = host->id == 0 ? OMAP_DMA_MMC_RX : OMAP_DMA_MMC2_RX; - host->dma_rx = dma_request_channel(mask, omap_dma_filter_fn, &sig); + + res = platform_get_resource_byname(pdev, IORESOURCE_DMA, "rx"); + if (res) + sig = res->start; + host->dma_rx = dma_request_slave_channel_compat(mask, + omap_dma_filter_fn, &sig, &pdev->dev, "rx"); if (!host->dma_rx) dev_warn(host->dev, "unable to obtain RX DMA engine channel %u\n", sig); -- 1.8.1.1 ^ permalink raw reply related [flat|nested] 18+ messages in thread
* Re: [PATCH 2/8] mmc: omap: Fix DMA configuration to not rely on device id 2013-11-14 2:35 ` [PATCH 2/8] mmc: omap: Fix DMA configuration to not rely on device id Tony Lindgren @ 2013-11-18 18:47 ` Tony Lindgren 2013-11-26 23:33 ` Chris Ball 2013-11-30 0:38 ` Joel Fernandes 1 sibling, 1 reply; 18+ messages in thread From: Tony Lindgren @ 2013-11-18 18:47 UTC (permalink / raw) To: linux-arm-kernel, linux-omap; +Cc: Chris Ball, linux-mmc * Tony Lindgren <tony@atomide.com> [131113 18:36]: > We are wrongly relying on device id for the DMA configuration > which can lead to wrong DMA channel being selected. > > Fix the issue by using the standard resources like we should. > > Cc: Chris Ball <cjb@laptop.org> > Cc: linux-mmc@vger.kernel.org > Signed-off-by: Tony Lindgren <tony@atomide.com> > --- > > If this looks OK, I'd like to merge this as a fix via arm-soc tree > along with the other patches in this series as my later patches > depend on patches in this series. Looks like we need sig initialized in this patch to avoid some uninitialized warnings. Regards, Tony From: Tony Lindgren <tony@atomide.com> Date: Thu, 14 Nov 2013 15:25:06 -0800 Subject: [PATCH] mmc: omap: Fix DMA configuration to not rely on device id We are wrongly relying on device id for the DMA configuration which can lead to wrong DMA channel being selected. Fix the issue by using the standard resources like we should. Cc: Chris Ball <cjb@laptop.org> Cc: linux-mmc@vger.kernel.org Signed-off-by: Tony Lindgren <tony@atomide.com> --- a/drivers/mmc/host/omap.c +++ b/drivers/mmc/host/omap.c @@ -90,17 +90,6 @@ #define OMAP_MMC_CMDTYPE_AC 2 #define OMAP_MMC_CMDTYPE_ADTC 3 -#define OMAP_DMA_MMC_TX 21 -#define OMAP_DMA_MMC_RX 22 -#define OMAP_DMA_MMC2_TX 54 -#define OMAP_DMA_MMC2_RX 55 - -#define OMAP24XX_DMA_MMC2_TX 47 -#define OMAP24XX_DMA_MMC2_RX 48 -#define OMAP24XX_DMA_MMC1_TX 61 -#define OMAP24XX_DMA_MMC1_RX 62 - - #define DRIVER_NAME "mmci-omap" /* Specifies how often in millisecs to poll for card status changes @@ -1331,7 +1320,7 @@ static int mmc_omap_probe(struct platform_device *pdev) struct mmc_omap_host *host = NULL; struct resource *res; dma_cap_mask_t mask; - unsigned sig; + unsigned sig = 0; int i, ret = 0; int irq; @@ -1408,19 +1397,20 @@ static int mmc_omap_probe(struct platform_device *pdev) host->dma_tx_burst = -1; host->dma_rx_burst = -1; - if (mmc_omap2()) - sig = host->id == 0 ? OMAP24XX_DMA_MMC1_TX : OMAP24XX_DMA_MMC2_TX; - else - sig = host->id == 0 ? OMAP_DMA_MMC_TX : OMAP_DMA_MMC2_TX; - host->dma_tx = dma_request_channel(mask, omap_dma_filter_fn, &sig); + res = platform_get_resource_byname(pdev, IORESOURCE_DMA, "tx"); + if (res) + sig = res->start; + host->dma_tx = dma_request_slave_channel_compat(mask, + omap_dma_filter_fn, &sig, &pdev->dev, "tx"); if (!host->dma_tx) dev_warn(host->dev, "unable to obtain TX DMA engine channel %u\n", sig); - if (mmc_omap2()) - sig = host->id == 0 ? OMAP24XX_DMA_MMC1_RX : OMAP24XX_DMA_MMC2_RX; - else - sig = host->id == 0 ? OMAP_DMA_MMC_RX : OMAP_DMA_MMC2_RX; - host->dma_rx = dma_request_channel(mask, omap_dma_filter_fn, &sig); + + res = platform_get_resource_byname(pdev, IORESOURCE_DMA, "rx"); + if (res) + sig = res->start; + host->dma_rx = dma_request_slave_channel_compat(mask, + omap_dma_filter_fn, &sig, &pdev->dev, "rx"); if (!host->dma_rx) dev_warn(host->dev, "unable to obtain RX DMA engine channel %u\n", sig); ^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [PATCH 2/8] mmc: omap: Fix DMA configuration to not rely on device id 2013-11-18 18:47 ` Tony Lindgren @ 2013-11-26 23:33 ` Chris Ball 2013-11-26 23:52 ` Tony Lindgren 2013-11-27 20:57 ` Jarkko Nikula 0 siblings, 2 replies; 18+ messages in thread From: Chris Ball @ 2013-11-26 23:33 UTC (permalink / raw) To: Tony Lindgren; +Cc: linux-arm-kernel, linux-omap, linux-mmc Hi Tony, On Mon, Nov 18 2013, Tony Lindgren wrote: > We are wrongly relying on device id for the DMA configuration > which can lead to wrong DMA channel being selected. > > Fix the issue by using the standard resources like we should. > > Cc: Chris Ball <cjb@laptop.org> > Cc: linux-mmc@vger.kernel.org > Signed-off-by: Tony Lindgren <tony@atomide.com> Feel free to merge via your tree: Acked-by: Chris Ball <cjb@laptop.org> - Chris. -- Chris Ball <cjb@laptop.org> <http://printf.net/> ^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [PATCH 2/8] mmc: omap: Fix DMA configuration to not rely on device id 2013-11-26 23:33 ` Chris Ball @ 2013-11-26 23:52 ` Tony Lindgren 2013-11-27 20:57 ` Jarkko Nikula 1 sibling, 0 replies; 18+ messages in thread From: Tony Lindgren @ 2013-11-26 23:52 UTC (permalink / raw) To: Chris Ball; +Cc: linux-arm-kernel, linux-omap, linux-mmc * Chris Ball <cjb@laptop.org> [131126 15:35]: > Hi Tony, > > On Mon, Nov 18 2013, Tony Lindgren wrote: > > We are wrongly relying on device id for the DMA configuration > > which can lead to wrong DMA channel being selected. > > > > Fix the issue by using the standard resources like we should. > > > > Cc: Chris Ball <cjb@laptop.org> > > Cc: linux-mmc@vger.kernel.org > > Signed-off-by: Tony Lindgren <tony@atomide.com> > > Feel free to merge via your tree: > > Acked-by: Chris Ball <cjb@laptop.org> OK thanks will merge both mmc fixes. Tony ^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [PATCH 2/8] mmc: omap: Fix DMA configuration to not rely on device id 2013-11-26 23:33 ` Chris Ball 2013-11-26 23:52 ` Tony Lindgren @ 2013-11-27 20:57 ` Jarkko Nikula 2013-11-27 21:37 ` Tony Lindgren 2013-11-27 21:47 ` Chris Ball 1 sibling, 2 replies; 18+ messages in thread From: Jarkko Nikula @ 2013-11-27 20:57 UTC (permalink / raw) To: Chris Ball; +Cc: Tony Lindgren, linux-arm-kernel, linux-omap, linux-mmc Hi Chris On Tue, 26 Nov 2013 18:33:50 -0500 Chris Ball <cjb@laptop.org> wrote: > Hi Tony, > > On Mon, Nov 18 2013, Tony Lindgren wrote: > > We are wrongly relying on device id for the DMA configuration > > which can lead to wrong DMA channel being selected. > > > > Fix the issue by using the standard resources like we should. > > > > Cc: Chris Ball <cjb@laptop.org> > > Cc: linux-mmc@vger.kernel.org > > Signed-off-by: Tony Lindgren <tony@atomide.com> > > Feel free to merge via your tree: > > Acked-by: Chris Ball <cjb@laptop.org> > Can you enlighten me what's the proper way to get patches to mmc since I cannot figure out working methodology from MAINTAINERS file? I happened to notice that Tony had this similar patch in linux-omap list I sent first time already September to you and linux-mmc (sorry linux-omap folks, I didn't want to spam multiple lists): http://www.spinics.net/lists/linux-mmc/msg22137.html After that I've resend the set a few times including a fix to user triggable NULL pointer dereference: http://www.spinics.net/lists/linux-mmc/msg22610.html I'm fine if mmc patches should go through other subsystems but at least it should be documented in MAINTAINERS file. -- Jarkko ^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [PATCH 2/8] mmc: omap: Fix DMA configuration to not rely on device id 2013-11-27 20:57 ` Jarkko Nikula @ 2013-11-27 21:37 ` Tony Lindgren 2013-11-28 17:02 ` Jarkko Nikula 2013-11-27 21:47 ` Chris Ball 1 sibling, 1 reply; 18+ messages in thread From: Tony Lindgren @ 2013-11-27 21:37 UTC (permalink / raw) To: Jarkko Nikula Cc: Chris Ball, linux-arm-kernel, linux-omap, linux-mmc, Aaro Koskinen * Jarkko Nikula <jarkko.nikula@bitmer.com> [131127 12:55]: > Hi Chris > > On Tue, 26 Nov 2013 18:33:50 -0500 > Chris Ball <cjb@laptop.org> wrote: > > > Hi Tony, > > > > On Mon, Nov 18 2013, Tony Lindgren wrote: > > > We are wrongly relying on device id for the DMA configuration > > > which can lead to wrong DMA channel being selected. > > > > > > Fix the issue by using the standard resources like we should. > > > > > > Cc: Chris Ball <cjb@laptop.org> > > > Cc: linux-mmc@vger.kernel.org > > > Signed-off-by: Tony Lindgren <tony@atomide.com> > > > > Feel free to merge via your tree: > > > > Acked-by: Chris Ball <cjb@laptop.org> > > > Can you enlighten me what's the proper way to get patches to mmc since > I cannot figure out working methodology from MAINTAINERS file? > > I happened to notice that Tony had this similar patch in linux-omap > list I sent first time already September to you and linux-mmc (sorry > linux-omap folks, I didn't want to spam multiple lists): > > http://www.spinics.net/lists/linux-mmc/msg22137.html > > After that I've resend the set a few times including a fix to > user triggable NULL pointer dereference: > > http://www.spinics.net/lists/linux-mmc/msg22610.html > > I'm fine if mmc patches should go through other subsystems but at least > it should be documented in MAINTAINERS file. Bummer, sounds like some duplicate work could have been avoided :( I suggest resend to Chris and linux-mmc one more time as Chris should pick up the MMC patches in general. I've been just trying to get things working in general for v3.13-rc series for omaps with device tree based booting and patching all over the place. This is to make it easy for us to just drop the legacy platform based booting for v3.14 while keeping things working. Chris, as far as I'm concerned, Aaro and Jarkko are good people to review and ack the drivers/mmc/omap.c patches, so adding Aaro to Cc as well. Regards, Tony ^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [PATCH 2/8] mmc: omap: Fix DMA configuration to not rely on device id 2013-11-27 21:37 ` Tony Lindgren @ 2013-11-28 17:02 ` Jarkko Nikula 2013-11-29 16:34 ` Tony Lindgren 0 siblings, 1 reply; 18+ messages in thread From: Jarkko Nikula @ 2013-11-28 17:02 UTC (permalink / raw) To: Tony Lindgren Cc: Chris Ball, linux-arm-kernel, linux-omap, linux-mmc, Aaro Koskinen Hi On 11/27/2013 11:37 PM, Tony Lindgren wrote: > * Jarkko Nikula <jarkko.nikula@bitmer.com> [131127 12:55]: > Bummer, sounds like some duplicate work could have been avoided :( > I suggest resend to Chris and linux-mmc one more time as Chris should > pick up the MMC patches in general. > Before that should Chris merge your 2 patches in order to avoid couple trivial merge conflicts with my set when linux-omap and mmc are merged? -- Jarkko ^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [PATCH 2/8] mmc: omap: Fix DMA configuration to not rely on device id 2013-11-28 17:02 ` Jarkko Nikula @ 2013-11-29 16:34 ` Tony Lindgren 0 siblings, 0 replies; 18+ messages in thread From: Tony Lindgren @ 2013-11-29 16:34 UTC (permalink / raw) To: Jarkko Nikula Cc: Chris Ball, linux-arm-kernel, linux-omap, linux-mmc, Aaro Koskinen * Jarkko Nikula <jarkko.nikula@bitmer.com> [131128 09:03]: > Hi > > On 11/27/2013 11:37 PM, Tony Lindgren wrote: > > * Jarkko Nikula <jarkko.nikula@bitmer.com> [131127 12:55]: > > Bummer, sounds like some duplicate work could have been avoided :( > > I suggest resend to Chris and linux-mmc one more time as Chris should > > pick up the MMC patches in general. > > > Before that should Chris merge your 2 patches in order to avoid couple > trivial merge conflicts with my set when linux-omap and mmc are merged? Those are already queued to arm-soc/fixes branch and should hit the mainline tree within next few days, hopefully before -rc2 so it's probably to wait for that for that for further fixes. Regards, Tony ^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [PATCH 2/8] mmc: omap: Fix DMA configuration to not rely on device id 2013-11-27 20:57 ` Jarkko Nikula 2013-11-27 21:37 ` Tony Lindgren @ 2013-11-27 21:47 ` Chris Ball 2013-11-27 21:59 ` Tony Lindgren 1 sibling, 1 reply; 18+ messages in thread From: Chris Ball @ 2013-11-27 21:47 UTC (permalink / raw) To: Jarkko Nikula Cc: Tony Lindgren, linux-arm-kernel, linux-omap, linux-mmc, Jarkko Lavinen Hi, On Wed, Nov 27 2013, Jarkko Nikula wrote: > Can you enlighten me what's the proper way to get patches to mmc since > I cannot figure out working methodology from MAINTAINERS file? Sorry about this, Jarkko. Since I don't have omap.c hardware, I'm generally going to wait for a Tested-by/Acked-by from someone else on patches like these. We actually have a maintainer already listed for the driver, Jarkko Lavinen <jarkko.lavinen@nokia.com>. So, maybe the MAINTAINERS section for drivers/mmc/host/omap.c needs an update? Feel free to send me patches to it. Either way, I'll start treating Aaro and Jarkko (Nikula) as maintainers for this driver. Thanks! - Chris. -- Chris Ball <cjb@laptop.org> <http://printf.net/> ^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [PATCH 2/8] mmc: omap: Fix DMA configuration to not rely on device id 2013-11-27 21:47 ` Chris Ball @ 2013-11-27 21:59 ` Tony Lindgren 2013-11-28 16:13 ` Jarkko Nikula 0 siblings, 1 reply; 18+ messages in thread From: Tony Lindgren @ 2013-11-27 21:59 UTC (permalink / raw) To: Chris Ball Cc: Jarkko Nikula, linux-arm-kernel, linux-omap, linux-mmc, Jarkko Lavinen * Chris Ball <cjb@laptop.org> [131127 13:48]: > Hi, > > On Wed, Nov 27 2013, Jarkko Nikula wrote: > > Can you enlighten me what's the proper way to get patches to mmc since > > I cannot figure out working methodology from MAINTAINERS file? > > Sorry about this, Jarkko. > > Since I don't have omap.c hardware, I'm generally going to wait for > a Tested-by/Acked-by from someone else on patches like these. We > actually have a maintainer already listed for the driver, Jarkko > Lavinen <jarkko.lavinen@nokia.com>. > > So, maybe the MAINTAINERS section for drivers/mmc/host/omap.c needs > an update? Feel free to send me patches to it. Either way, I'll > start treating Aaro and Jarkko (Nikula) as maintainers for this > driver. Hmm looks like here's a reasonably recent update that we've missed from Jarkko Lavinen to update his email address: http://lkml.org/lkml/2013/10/4/142 I've updated Jarkko Lavinen's address in this mail, we should probably also patch the MAINTAINERS file for that, and then see if Aaro and Jarkko Nikula are interested to be listed there as well. Regards, Tony ^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [PATCH 2/8] mmc: omap: Fix DMA configuration to not rely on device id 2013-11-27 21:59 ` Tony Lindgren @ 2013-11-28 16:13 ` Jarkko Nikula 2013-11-29 17:13 ` Tony Lindgren 0 siblings, 1 reply; 18+ messages in thread From: Jarkko Nikula @ 2013-11-28 16:13 UTC (permalink / raw) To: Tony Lindgren Cc: Chris Ball, linux-arm-kernel, linux-omap, linux-mmc, Jarkko Lavinen Hi On 11/27/2013 11:59 PM, Tony Lindgren wrote: > * Chris Ball <cjb@laptop.org> [131127 13:48]: >> Hi, >> >> On Wed, Nov 27 2013, Jarkko Nikula wrote: >>> Can you enlighten me what's the proper way to get patches to mmc since >>> I cannot figure out working methodology from MAINTAINERS file? >> >> Sorry about this, Jarkko. >> >> Since I don't have omap.c hardware, I'm generally going to wait for >> a Tested-by/Acked-by from someone else on patches like these. We >> actually have a maintainer already listed for the driver, Jarkko >> Lavinen <jarkko.lavinen@nokia.com>. >> >> So, maybe the MAINTAINERS section for drivers/mmc/host/omap.c needs >> an update? Feel free to send me patches to it. Either way, I'll >> start treating Aaro and Jarkko (Nikula) as maintainers for this >> driver. > Oh, I see. I even didn't check ./scripts/get_maintainer.pl nor check MAINTAINERS file further than main MMC entry as I knew Jarkko L. is not working anymore for Nokia. Sorry, we should have noticed that. > Hmm looks like here's a reasonably recent update that we've missed > from Jarkko Lavinen to update his email address: > > http://lkml.org/lkml/2013/10/4/142 > > I've updated Jarkko Lavinen's address in this mail, we should > probably also patch the MAINTAINERS file for that, and then see if > Aaro and Jarkko Nikula are interested to be listed there as well. > I can volunteer. Not that I know much about mmc but I like to keep my legacy hw still running :-) -- Jarkko ^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [PATCH 2/8] mmc: omap: Fix DMA configuration to not rely on device id 2013-11-28 16:13 ` Jarkko Nikula @ 2013-11-29 17:13 ` Tony Lindgren 0 siblings, 0 replies; 18+ messages in thread From: Tony Lindgren @ 2013-11-29 17:13 UTC (permalink / raw) To: Jarkko Nikula Cc: Chris Ball, linux-arm-kernel, linux-omap, linux-mmc, Jarkko Lavinen * Jarkko Nikula <jarkko.nikula@bitmer.com> [131128 08:14]: > Hi > > On 11/27/2013 11:59 PM, Tony Lindgren wrote: > > * Chris Ball <cjb@laptop.org> [131127 13:48]: > >> Hi, > >> > >> On Wed, Nov 27 2013, Jarkko Nikula wrote: > >>> Can you enlighten me what's the proper way to get patches to mmc since > >>> I cannot figure out working methodology from MAINTAINERS file? > >> > >> Sorry about this, Jarkko. > >> > >> Since I don't have omap.c hardware, I'm generally going to wait for > >> a Tested-by/Acked-by from someone else on patches like these. We > >> actually have a maintainer already listed for the driver, Jarkko > >> Lavinen <jarkko.lavinen@nokia.com>. > >> > >> So, maybe the MAINTAINERS section for drivers/mmc/host/omap.c needs > >> an update? Feel free to send me patches to it. Either way, I'll > >> start treating Aaro and Jarkko (Nikula) as maintainers for this > >> driver. > > > Oh, I see. I even didn't check ./scripts/get_maintainer.pl nor check > MAINTAINERS file further than main MMC entry as I knew Jarkko L. is not > working anymore for Nokia. Sorry, we should have noticed that. > > > Hmm looks like here's a reasonably recent update that we've missed > > from Jarkko Lavinen to update his email address: > > > > http://lkml.org/lkml/2013/10/4/142 > > > > I've updated Jarkko Lavinen's address in this mail, we should > > probably also patch the MAINTAINERS file for that, and then see if > > Aaro and Jarkko Nikula are interested to be listed there as well. > > > I can volunteer. Not that I know much about mmc but I like to keep my > legacy hw still running :-) Sounds good to me, good to hear :) Regards, Tony ^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [PATCH 2/8] mmc: omap: Fix DMA configuration to not rely on device id 2013-11-14 2:35 ` [PATCH 2/8] mmc: omap: Fix DMA configuration to not rely on device id Tony Lindgren 2013-11-18 18:47 ` Tony Lindgren @ 2013-11-30 0:38 ` Joel Fernandes 2013-11-30 17:33 ` Tony Lindgren 1 sibling, 1 reply; 18+ messages in thread From: Joel Fernandes @ 2013-11-30 0:38 UTC (permalink / raw) To: Tony Lindgren, linux-arm-kernel, linux-omap; +Cc: Chris Ball, linux-mmc On 11/13/2013 08:35 PM, Tony Lindgren wrote: > We are wrongly relying on device id for the DMA configuration > which can lead to wrong DMA channel being selected. > > Fix the issue by using the standard resources like we should. > > Cc: Chris Ball <cjb@laptop.org> > Cc: linux-mmc@vger.kernel.org > Signed-off-by: Tony Lindgren <tony@atomide.com> > --- > > If this looks OK, I'd like to merge this as a fix via arm-soc tree > along with the other patches in this series as my later patches > depend on patches in this series. > > --- > > drivers/mmc/host/omap.c | 32 +++++++++++--------------------- > 1 file changed, 11 insertions(+), 21 deletions(-) > > diff --git a/drivers/mmc/host/omap.c b/drivers/mmc/host/omap.c > index b94f38e..ed56868 100644 > --- a/drivers/mmc/host/omap.c > +++ b/drivers/mmc/host/omap.c > @@ -90,17 +90,6 @@ > #define OMAP_MMC_CMDTYPE_AC 2 > #define OMAP_MMC_CMDTYPE_ADTC 3 > > -#define OMAP_DMA_MMC_TX 21 > -#define OMAP_DMA_MMC_RX 22 > -#define OMAP_DMA_MMC2_TX 54 > -#define OMAP_DMA_MMC2_RX 55 > - > -#define OMAP24XX_DMA_MMC2_TX 47 > -#define OMAP24XX_DMA_MMC2_RX 48 > -#define OMAP24XX_DMA_MMC1_TX 61 > -#define OMAP24XX_DMA_MMC1_RX 62 > - > - > #define DRIVER_NAME "mmci-omap" > > /* Specifies how often in millisecs to poll for card status changes > @@ -1408,19 +1397,20 @@ static int mmc_omap_probe(struct platform_device *pdev) > host->dma_tx_burst = -1; > host->dma_rx_burst = -1; > > - if (mmc_omap2()) > - sig = host->id == 0 ? OMAP24XX_DMA_MMC1_TX : OMAP24XX_DMA_MMC2_TX; > - else > - sig = host->id == 0 ? OMAP_DMA_MMC_TX : OMAP_DMA_MMC2_TX; > - host->dma_tx = dma_request_channel(mask, omap_dma_filter_fn, &sig); > + res = platform_get_resource_byname(pdev, IORESOURCE_DMA, "tx"); > + if (res) > + sig = res->start; > + host->dma_tx = dma_request_slave_channel_compat(mask, > + omap_dma_filter_fn, &sig, &pdev->dev, "tx"); Minor comment, since we're moving to DT-only for platforms using this driver (hope I'm right about that), why not just do: dma_request_slave_channel_(&pdev->dev, "tx"); IORESOURCE_DMA is not created by OF layer so I guess no need to call platform_get_resource either. thanks, -Joel ^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [PATCH 2/8] mmc: omap: Fix DMA configuration to not rely on device id 2013-11-30 0:38 ` Joel Fernandes @ 2013-11-30 17:33 ` Tony Lindgren 0 siblings, 0 replies; 18+ messages in thread From: Tony Lindgren @ 2013-11-30 17:33 UTC (permalink / raw) To: Joel Fernandes; +Cc: linux-arm-kernel, linux-omap, Chris Ball, linux-mmc * Joel Fernandes <joelf@ti.com> [131129 16:39]: > On 11/13/2013 08:35 PM, Tony Lindgren wrote: > > --- a/drivers/mmc/host/omap.c > > +++ b/drivers/mmc/host/omap.c > > @@ -90,17 +90,6 @@ > > #define OMAP_MMC_CMDTYPE_AC 2 > > #define OMAP_MMC_CMDTYPE_ADTC 3 > > > > -#define OMAP_DMA_MMC_TX 21 > > -#define OMAP_DMA_MMC_RX 22 > > -#define OMAP_DMA_MMC2_TX 54 > > -#define OMAP_DMA_MMC2_RX 55 > > - > > -#define OMAP24XX_DMA_MMC2_TX 47 > > -#define OMAP24XX_DMA_MMC2_RX 48 > > -#define OMAP24XX_DMA_MMC1_TX 61 > > -#define OMAP24XX_DMA_MMC1_RX 62 > > - > > - > > #define DRIVER_NAME "mmci-omap" > > > > /* Specifies how often in millisecs to poll for card status changes > > @@ -1408,19 +1397,20 @@ static int mmc_omap_probe(struct platform_device *pdev) > > host->dma_tx_burst = -1; > > host->dma_rx_burst = -1; > > > > - if (mmc_omap2()) > > - sig = host->id == 0 ? OMAP24XX_DMA_MMC1_TX : OMAP24XX_DMA_MMC2_TX; > > - else > > - sig = host->id == 0 ? OMAP_DMA_MMC_TX : OMAP_DMA_MMC2_TX; > > - host->dma_tx = dma_request_channel(mask, omap_dma_filter_fn, &sig); > > + res = platform_get_resource_byname(pdev, IORESOURCE_DMA, "tx"); > > + if (res) > > + sig = res->start; > > + host->dma_tx = dma_request_slave_channel_compat(mask, > > + omap_dma_filter_fn, &sig, &pdev->dev, "tx"); > > Minor comment, since we're moving to DT-only for platforms using this driver > (hope I'm right about that), why not just do: > dma_request_slave_channel_(&pdev->dev, "tx"); > > IORESOURCE_DMA is not created by OF layer so I guess no need to call > platform_get_resource either. Well this is not the omap_hsmmc.c driver, this is the one for earlier hardware that's available on omap1 and 2420. All the later ones use the omap_hsmmc.c driver instead. So this one we cannot make DT only unless we make mach-omap1 DT only, which is doable, but may never happen because of the effort needed. Most of the effort would be quite trivial, except for the conversion to use the common clock framework. Regards, Tony ^ permalink raw reply [flat|nested] 18+ messages in thread
* [PATCH 3/8] mmc: omap: Fix I2C dependency and make driver usable with device tree [not found] <1384396537-3486-1-git-send-email-tony@atomide.com> 2013-11-14 2:35 ` [PATCH 2/8] mmc: omap: Fix DMA configuration to not rely on device id Tony Lindgren @ 2013-11-14 2:35 ` Tony Lindgren 2013-11-14 11:05 ` Mark Rutland 1 sibling, 1 reply; 18+ messages in thread From: Tony Lindgren @ 2013-11-14 2:35 UTC (permalink / raw) To: linux-arm-kernel, linux-omap; +Cc: Chris Ball, linux-mmc Some features can be configured by the companion I2C chips, which may not be available at the probe time. Fix the issue by returning -EPROBE_DEFER when the MMC controller slots are not configured. While at it, let's also add minimal device tree support so omap24xx platforms can use this driver without legacy mode since we claim to support device tree for mach-omap2 based systems. Although adding the minimal device tree support is not strictly a fix, it does remove one of the last blockers for dropping a bunch of legacy platform data for mach-omap2. Cc: Chris Ball <cjb@laptop.org> Cc: linux-mmc@vger.kernel.org Signed-off-by: Tony Lindgren <tony@atomide.com> --- If this looks OK, I'd like to merge this as a fix via arm-soc tree along with the other patches in this series as my later patches depend on patches in this series. --- drivers/mmc/host/omap.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/drivers/mmc/host/omap.c b/drivers/mmc/host/omap.c index ed56868..43c66ad 100644 --- a/drivers/mmc/host/omap.c +++ b/drivers/mmc/host/omap.c @@ -22,6 +22,7 @@ #include <linux/delay.h> #include <linux/spinlock.h> #include <linux/timer.h> +#include <linux/of.h> #include <linux/omap-dma.h> #include <linux/mmc/host.h> #include <linux/mmc/card.h> @@ -1330,7 +1331,7 @@ static int mmc_omap_probe(struct platform_device *pdev) } if (pdata->nr_slots == 0) { dev_err(&pdev->dev, "no slots\n"); - return -ENXIO; + return -EPROBE_DEFER; } res = platform_get_resource(pdev, IORESOURCE_MEM, 0); @@ -1553,6 +1554,12 @@ static int mmc_omap_resume(struct platform_device *pdev) #define mmc_omap_resume NULL #endif +#if IS_BUILTIN(CONFIG_OF) +static const struct of_device_id mmc_omap_match[] = { + { .compatible = "ti,omap2420-mmc", }, + { }, +}; +#endif static struct platform_driver mmc_omap_driver = { .probe = mmc_omap_probe, .remove = mmc_omap_remove, @@ -1561,6 +1568,7 @@ static struct platform_driver mmc_omap_driver = { .driver = { .name = DRIVER_NAME, .owner = THIS_MODULE, + .of_match_table = of_match_ptr(mmc_omap_match), }, }; -- 1.8.1.1 ^ permalink raw reply related [flat|nested] 18+ messages in thread
* Re: [PATCH 3/8] mmc: omap: Fix I2C dependency and make driver usable with device tree 2013-11-14 2:35 ` [PATCH 3/8] mmc: omap: Fix I2C dependency and make driver usable with device tree Tony Lindgren @ 2013-11-14 11:05 ` Mark Rutland 2013-11-14 17:25 ` Tony Lindgren 0 siblings, 1 reply; 18+ messages in thread From: Mark Rutland @ 2013-11-14 11:05 UTC (permalink / raw) To: Tony Lindgren Cc: linux-arm-kernel@lists.infradead.org, linux-omap@vger.kernel.org, Chris Ball, linux-mmc@vger.kernel.org On Thu, Nov 14, 2013 at 02:35:32AM +0000, Tony Lindgren wrote: > Some features can be configured by the companion I2C chips, > which may not be available at the probe time. Fix the issue > by returning -EPROBE_DEFER when the MMC controller slots > are not configured. > > While at it, let's also add minimal device tree support so > omap24xx platforms can use this driver without legacy mode > since we claim to support device tree for mach-omap2 based > systems. > > Although adding the minimal device tree support is not strictly > a fix, it does remove one of the last blockers for dropping a > bunch of legacy platform data for mach-omap2. > > Cc: Chris Ball <cjb@laptop.org> > Cc: linux-mmc@vger.kernel.org > Signed-off-by: Tony Lindgren <tony@atomide.com> > --- > > If this looks OK, I'd like to merge this as a fix via arm-soc tree > along with the other patches in this series as my later patches > depend on patches in this series. > > --- > drivers/mmc/host/omap.c | 10 +++++++++- > 1 file changed, 9 insertions(+), 1 deletion(-) > > diff --git a/drivers/mmc/host/omap.c b/drivers/mmc/host/omap.c > index ed56868..43c66ad 100644 > --- a/drivers/mmc/host/omap.c > +++ b/drivers/mmc/host/omap.c > @@ -22,6 +22,7 @@ > #include <linux/delay.h> > #include <linux/spinlock.h> > #include <linux/timer.h> > +#include <linux/of.h> > #include <linux/omap-dma.h> > #include <linux/mmc/host.h> > #include <linux/mmc/card.h> > @@ -1330,7 +1331,7 @@ static int mmc_omap_probe(struct platform_device *pdev) > } > if (pdata->nr_slots == 0) { > dev_err(&pdev->dev, "no slots\n"); > - return -ENXIO; > + return -EPROBE_DEFER; > } > > res = platform_get_resource(pdev, IORESOURCE_MEM, 0); > @@ -1553,6 +1554,12 @@ static int mmc_omap_resume(struct platform_device *pdev) > #define mmc_omap_resume NULL > #endif > > +#if IS_BUILTIN(CONFIG_OF) > +static const struct of_device_id mmc_omap_match[] = { > + { .compatible = "ti,omap2420-mmc", }, Missing binding document. Thanks, Mark. ^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [PATCH 3/8] mmc: omap: Fix I2C dependency and make driver usable with device tree 2013-11-14 11:05 ` Mark Rutland @ 2013-11-14 17:25 ` Tony Lindgren 2013-11-26 23:34 ` Chris Ball 0 siblings, 1 reply; 18+ messages in thread From: Tony Lindgren @ 2013-11-14 17:25 UTC (permalink / raw) To: Mark Rutland Cc: linux-arm-kernel@lists.infradead.org, linux-omap@vger.kernel.org, Chris Ball, linux-mmc@vger.kernel.org * Mark Rutland <mark.rutland@arm.com> [131114 03:06]: > > Missing binding document. Here's this one updated with a minimal binding document. The ti,hwmods is still needed until we have removed the dependencies to hwmod code for omaps. Regards, Tony From: Tony Lindgren <tony@atomide.com> Date: Wed, 13 Nov 2013 16:36:37 -0800 Subject: [PATCH] mmc: omap: Fix I2C dependency and make driver usable with device tree Some features can be configured by the companion I2C chips, which may not be available at the probe time. Fix the issue by returning -EPROBE_DEFER when the MMC controller slots are not configured. While at it, let's also add minimal device tree support so omap24xx platforms can use this driver without legacy mode since we claim to support device tree for mach-omap2 based systems. Although adding the minimal device tree support is not strictly a fix, it does remove one of the last blockers for dropping a bunch of legacy platform data for mach-omap2. Cc: Chris Ball <cjb@laptop.org> Cc: linux-mmc@vger.kernel.org Signed-off-by: Tony Lindgren <tony@atomide.com> +++ b/Documentation/devicetree/bindings/mmc/ti-omap.txt @@ -0,0 +1,27 @@ +* TI MMC host controller for OMAP1 and 2420 + +The MMC Host Controller on TI OMAP1 and 2420 family provides +an interface for MMC, SD, and SDIO types of memory cards. + +This file documents differences between the core properties described +by mmc.txt and the properties used by the omap mmc driver. + +Note that this driver will not work with omap2430 or later omaps, +please see the omap hsmmc driver for the current omaps. + +Required properties: +- compatible: Must be "ti,omap2420-mmc", for OMAP2420 controllers +- ti,hwmods: For 2420, must be "msdi<n>", where n is controller + instance starting 1 + +Examples: + + msdi1: mmc@4809c000 { + compatible = "ti,omap2420-mmc"; + ti,hwmods = "msdi1"; + reg = <0x4809c000 0x80>; + interrupts = <83>; + dmas = <&sdma 61 &sdma 62>; + dma-names = "tx", "rx"; + }; + --- a/drivers/mmc/host/omap.c +++ b/drivers/mmc/host/omap.c @@ -22,6 +22,7 @@ #include <linux/delay.h> #include <linux/spinlock.h> #include <linux/timer.h> +#include <linux/of.h> #include <linux/omap-dma.h> #include <linux/mmc/host.h> #include <linux/mmc/card.h> @@ -1330,7 +1331,7 @@ static int mmc_omap_probe(struct platform_device *pdev) } if (pdata->nr_slots == 0) { dev_err(&pdev->dev, "no slots\n"); - return -ENXIO; + return -EPROBE_DEFER; } res = platform_get_resource(pdev, IORESOURCE_MEM, 0); @@ -1553,6 +1554,12 @@ static int mmc_omap_resume(struct platform_device *pdev) #define mmc_omap_resume NULL #endif +#if IS_BUILTIN(CONFIG_OF) +static const struct of_device_id mmc_omap_match[] = { + { .compatible = "ti,omap2420-mmc", }, + { }, +}; +#endif static struct platform_driver mmc_omap_driver = { .probe = mmc_omap_probe, .remove = mmc_omap_remove, @@ -1561,6 +1568,7 @@ static struct platform_driver mmc_omap_driver = { .driver = { .name = DRIVER_NAME, .owner = THIS_MODULE, + .of_match_table = of_match_ptr(mmc_omap_match), }, }; ^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [PATCH 3/8] mmc: omap: Fix I2C dependency and make driver usable with device tree 2013-11-14 17:25 ` Tony Lindgren @ 2013-11-26 23:34 ` Chris Ball 0 siblings, 0 replies; 18+ messages in thread From: Chris Ball @ 2013-11-26 23:34 UTC (permalink / raw) To: Tony Lindgren Cc: Mark Rutland, linux-arm-kernel@lists.infradead.org, linux-omap@vger.kernel.org, linux-mmc@vger.kernel.org Hi Tony, On Thu, Nov 14 2013, Tony Lindgren wrote: > Some features can be configured by the companion I2C chips, > which may not be available at the probe time. Fix the issue > by returning -EPROBE_DEFER when the MMC controller slots > are not configured. > > While at it, let's also add minimal device tree support so > omap24xx platforms can use this driver without legacy mode > since we claim to support device tree for mach-omap2 based > systems. > > Although adding the minimal device tree support is not strictly > a fix, it does remove one of the last blockers for dropping a > bunch of legacy platform data for mach-omap2. > > Cc: Chris Ball <cjb@laptop.org> > Cc: linux-mmc@vger.kernel.org > Signed-off-by: Tony Lindgren <tony@atomide.com> Feel free to merge via your tree: Acked-by: Chris Ball <cjb@laptop.org> - Chris. -- Chris Ball <cjb@laptop.org> <http://printf.net/> ^ permalink raw reply [flat|nested] 18+ messages in thread
end of thread, other threads:[~2013-11-30 17:33 UTC | newest] Thread overview: 18+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- [not found] <1384396537-3486-1-git-send-email-tony@atomide.com> 2013-11-14 2:35 ` [PATCH 2/8] mmc: omap: Fix DMA configuration to not rely on device id Tony Lindgren 2013-11-18 18:47 ` Tony Lindgren 2013-11-26 23:33 ` Chris Ball 2013-11-26 23:52 ` Tony Lindgren 2013-11-27 20:57 ` Jarkko Nikula 2013-11-27 21:37 ` Tony Lindgren 2013-11-28 17:02 ` Jarkko Nikula 2013-11-29 16:34 ` Tony Lindgren 2013-11-27 21:47 ` Chris Ball 2013-11-27 21:59 ` Tony Lindgren 2013-11-28 16:13 ` Jarkko Nikula 2013-11-29 17:13 ` Tony Lindgren 2013-11-30 0:38 ` Joel Fernandes 2013-11-30 17:33 ` Tony Lindgren 2013-11-14 2:35 ` [PATCH 3/8] mmc: omap: Fix I2C dependency and make driver usable with device tree Tony Lindgren 2013-11-14 11:05 ` Mark Rutland 2013-11-14 17:25 ` Tony Lindgren 2013-11-26 23:34 ` Chris Ball
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).