All of lore.kernel.org
 help / color / mirror / Atom feed
From: Daniel Mack <zonque@gmail.com>
To: Balaji T K <balajitk@ti.com>
Cc: Joel Fernandes <joelf@ti.com>,
	Mark Jackson <mpfj-list@newflow.co.uk>,
	"linux-omap@vger.kernel.org" <linux-omap@vger.kernel.org>,
	"linux-arm-kernel@lists.infradead.org"
	<linux-arm-kernel@lists.infradead.org>,
	Tony Lindgren <tony@atomide.com>,
	Linux MMC List <linux-mmc@vger.kernel.org>,
	Chris Ball <cjb@laptop.org>
Subject: Re: ARM: AM335x: Kernel oops when using EDMA and MMC
Date: Thu, 18 Jul 2013 18:47:10 +0200	[thread overview]
Message-ID: <51E81C0E.6070709@gmail.com> (raw)
In-Reply-To: <51E81A7E.9030805@ti.com>

Hi Balaji,

On 18.07.2013 18:40, Balaji T K wrote:
> With DMA channel info retrieved from dt binding on 3.11rc1,
> unused_chan_list is broken after hwmod cleanup removing mmc sdma
> resource info, hence pdev resource wont have DMA resource populated.
> 
> arch/arm/common/edma.c
> static int prepare_unused_channel_list(struct device *dev, void *data)
> {
> 	struct platform_device *pdev = to_platform_device(dev);
> 	int i, ctlr;
> 
> 	for (i = 0; i < pdev->num_resources; i++) {
> 		if ((pdev->resource[i].flags & IORESOURCE_DMA) &&
> 				(int)pdev->resource[i].start >= 0) {
> 			ctlr = EDMA_CTLR(pdev->resource[i].start);
> 			clear_bit(EDMA_CHAN_SLOT(pdev->resource[i].start),
> 					edma_cc[ctlr]->edma_unused);
> 		}
> 	}
> 
> 	return 0;
> }
> 
> int edma_alloc_channel(int channel,
> 	if (!unused_chan_list_done) {
> 		/*
> 		 * Scan all the platform devices to find out the EDMA channels
> 		 * used and clear them in the unused list, making the rest
> 		 * available for ARM usage.
> 		 */
> 		ret = bus_for_each_dev(&platform_bus_type, NULL, NULL,
> 				prepare_unused_channel_list);
> 		if (ret < 0)
> 			return ret;
> 
> 		unused_chan_list_done = true;
> 	}
> 
> ===========
> 
> with the below hack patch, edma is working fine with mmc on your 3.11rc1+ branch
> 
> diff --git a/arch/arm/common/edma.c b/arch/arm/common/edma.c
> index a432e6c..5a19164 100644
> --- a/arch/arm/common/edma.c
> +++ b/arch/arm/common/edma.c
> @@ -1262,8 +1262,8 @@ int edma_start(unsigned channel)
>   		if (test_bit(channel, edma_cc[ctlr]->edma_unused)) {
>   			pr_debug("EDMA: ESR%d %08x\n", j,
>   				edma_shadow0_read_array(ctlr, SH_ESR, j));
> -			edma_shadow0_write_array(ctlr, SH_ESR, j, mask);
> -			return 0;
> +//			edma_shadow0_write_array(ctlr, SH_ESR, j, mask);
> +//			return 0;
>   		}
> 
>   		/* EDMA channel with event association */
> 

Yes, this in fact works for me as well. Thanks for the quick reply! What
would be the proper fix for this?


Best,
Daniel



WARNING: multiple messages have this Message-ID (diff)
From: zonque@gmail.com (Daniel Mack)
To: linux-arm-kernel@lists.infradead.org
Subject: ARM: AM335x: Kernel oops when using EDMA and MMC
Date: Thu, 18 Jul 2013 18:47:10 +0200	[thread overview]
Message-ID: <51E81C0E.6070709@gmail.com> (raw)
In-Reply-To: <51E81A7E.9030805@ti.com>

Hi Balaji,

On 18.07.2013 18:40, Balaji T K wrote:
> With DMA channel info retrieved from dt binding on 3.11rc1,
> unused_chan_list is broken after hwmod cleanup removing mmc sdma
> resource info, hence pdev resource wont have DMA resource populated.
> 
> arch/arm/common/edma.c
> static int prepare_unused_channel_list(struct device *dev, void *data)
> {
> 	struct platform_device *pdev = to_platform_device(dev);
> 	int i, ctlr;
> 
> 	for (i = 0; i < pdev->num_resources; i++) {
> 		if ((pdev->resource[i].flags & IORESOURCE_DMA) &&
> 				(int)pdev->resource[i].start >= 0) {
> 			ctlr = EDMA_CTLR(pdev->resource[i].start);
> 			clear_bit(EDMA_CHAN_SLOT(pdev->resource[i].start),
> 					edma_cc[ctlr]->edma_unused);
> 		}
> 	}
> 
> 	return 0;
> }
> 
> int edma_alloc_channel(int channel,
> 	if (!unused_chan_list_done) {
> 		/*
> 		 * Scan all the platform devices to find out the EDMA channels
> 		 * used and clear them in the unused list, making the rest
> 		 * available for ARM usage.
> 		 */
> 		ret = bus_for_each_dev(&platform_bus_type, NULL, NULL,
> 				prepare_unused_channel_list);
> 		if (ret < 0)
> 			return ret;
> 
> 		unused_chan_list_done = true;
> 	}
> 
> ===========
> 
> with the below hack patch, edma is working fine with mmc on your 3.11rc1+ branch
> 
> diff --git a/arch/arm/common/edma.c b/arch/arm/common/edma.c
> index a432e6c..5a19164 100644
> --- a/arch/arm/common/edma.c
> +++ b/arch/arm/common/edma.c
> @@ -1262,8 +1262,8 @@ int edma_start(unsigned channel)
>   		if (test_bit(channel, edma_cc[ctlr]->edma_unused)) {
>   			pr_debug("EDMA: ESR%d %08x\n", j,
>   				edma_shadow0_read_array(ctlr, SH_ESR, j));
> -			edma_shadow0_write_array(ctlr, SH_ESR, j, mask);
> -			return 0;
> +//			edma_shadow0_write_array(ctlr, SH_ESR, j, mask);
> +//			return 0;
>   		}
> 
>   		/* EDMA channel with event association */
> 

Yes, this in fact works for me as well. Thanks for the quick reply! What
would be the proper fix for this?


Best,
Daniel

  reply	other threads:[~2013-07-18 16:46 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-07-17 15:55 ARM: AM335x: Kernel oops when using EDMA and MMC Mark Jackson
2013-07-17 15:55 ` Mark Jackson
2013-07-17 16:28 ` Mark Jackson
2013-07-17 16:28   ` Mark Jackson
2013-07-17 16:38 ` Joel Fernandes
2013-07-17 16:38   ` Joel Fernandes
2013-07-18  8:55   ` Mark Jackson
2013-07-18  8:55     ` Mark Jackson
2013-07-18 16:40   ` Balaji T K
2013-07-18 16:40     ` Balaji T K
2013-07-18 16:47     ` Daniel Mack [this message]
2013-07-18 16:47       ` Daniel Mack
2013-07-18 17:02       ` Joel Fernandes
2013-07-18 17:02         ` Joel Fernandes
2013-07-18 17:00     ` Joel Fernandes
2013-07-18 17:00       ` Joel Fernandes

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=51E81C0E.6070709@gmail.com \
    --to=zonque@gmail.com \
    --cc=balajitk@ti.com \
    --cc=cjb@laptop.org \
    --cc=joelf@ti.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-mmc@vger.kernel.org \
    --cc=linux-omap@vger.kernel.org \
    --cc=mpfj-list@newflow.co.uk \
    --cc=tony@atomide.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.