From mboxrd@z Thu Jan 1 00:00:00 1970 From: Joel Fernandes Subject: Re: [PATCH] dma: edma: fix incorrect SG list handling Date: Tue, 18 Mar 2014 13:46:04 -0500 Message-ID: <5328946C.3010508@ti.com> References: <1395057448-22904-1-git-send-email-nsekhar@ti.com> <5326F2BF.6040702@ti.com> <20140318152840.GD1976@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <20140318152840.GD1976-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: Errors-To: davinci-linux-open-source-bounces-VycZQUHpC/PFrsHnngEfi1aTQe2KTcn/@public.gmane.org To: Vinod Koul , Jon Ringle Cc: Linux DaVinci Mailing List , "Ringle, Jonathan" , DMA Engine Mailing List , Dan Williams , "linux-omap-u79uwXL29TY76Z2rM5mHXA@public.gmane.org" List-Id: linux-omap@vger.kernel.org On 03/18/2014 10:28 AM, Vinod Koul wrote: > On Mon, Mar 17, 2014 at 09:14:14AM -0400, Jon Ringle wrote: >> On Mon, 17 Mar 2014, Sekhar Nori wrote: >> >>> Hi Jon, >>> >>> On Monday 17 March 2014 06:28 PM, Jon Ringle wrote: >>>> >>>> On Mon, 17 Mar 2014, Sekhar Nori wrote: >>>> >>>>> The code to handle any length SG lists calls edma_resume() >>>>> even before edma_start() is called. This is incorrect >>>>> because edma_resume() enables edma events on the channel >>>>> after which CPU (in edma_start) cannot clear posted >>>>> events by writing to ECR (per the EDMA user's guide). >>>>> >>>>> Because of this EDMA transfers fail to start if due >>>>> to some reason there is a pending EDMA event registered >>>>> even before EDMA transfers are started. This can happen if >>>>> an EDMA event is a byproduct of device initialization. >>>>> >>>>> Fix this by calling edma_resume() only if it is not the >>>>> first batch of MAX_NR_SG elements. >>>>> >>>>> Without this patch, MMC/SD fails to function on DA850 EVM >>>>> with DMA. The behaviour is triggered by specific IP and >>>>> this can explain why the issue was not reported before >>>>> (example with MMC/SD on AM335x). >>>>> >>>>> Tested on DA850 EVM and AM335x EVM-SK using MMC/SD card. >>>>> >>>>> Cc: # v3.12.x+ >>>>> Cc: Joel Fernandes >>>>> Reported-by: Jon Ringle >>>>> Signed-off-by: Sekhar Nori >>>>> --- >>>>> Jon, can you please confirm this fixes the issue you >>>>> reported? >>>> >>>> The patch does not apply on linux-3.12 due to changes to the 3 context >>>> lines at the start of the hunk. >>>> >>>> But, I manually fixed up the code and it does fix the issue on our AM1808 >>>> board. >>> >>> Thanks for the testing. The patch is meant for latest mainline but based >>> on what you said, a manual backport to v3.12-stable will be required. >>> >>> Can you please reply with a formal Tested-by: ? >> >> Tested-by: Jon Ringle > where is this patch, somehow am not able to find in my inbox or archives... > I found it archived here: http://comments.gmane.org/gmane.linux.davinci/28569 Patch doesn't breaking anything for > MAX_NR_SG list size on AM335x, so it looks good. Acked-by: Joel Fernandes Regards, -Joel