Re: ARM: AM335x: Kernel oops when using EDMA and MMC

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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


--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Arm (vger)]     [ARM Kernel]     [ARM MSM]     [Linux Tegra]     [Linux WPAN Networking]     [Linux Wireless Networking]     [Maemo Users]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Trails]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux