[PATCH] mmc: mmci: Fixup error handling for dma

Ulf Hansson ulf.hansson at stericsson.com
Mon Dec 5 12:00:08 EST 2011


Linus Walleij wrote:
> On Wed, Nov 30, 2011 at 11:21 PM, Russell King - ARM Linux
> <linux at arm.linux.org.uk> wrote:
> 
>>>       if (!cmd->data || cmd->error) {
>>> -             if (host->data)
>>> +             if (host->data) {
>>> +                     /* Terminate the DMA transfer */
>>> +                     if (dma_inprogress(host))
>>> +                             mmci_dma_data_error(host);
>> Doesn't this leave the DMA buffers mapped?

Correct, but it will be handled in post_request function.

> 
> Yep it needs an mmci_dma_unmap() call too AFAICT,
> Ulf will you update?

Actually it's needs only dma_unmap_sg, but as stated this should be 
handled in mmci_post_request.

By, the way - I spoke to Per Förlin who implemented the pre_request and 
post_request functions; we will soon push some clean-up patches for 
improved error handling and how to manage the cookie better. Right now 
it is kind of hard to follow the error path, I think. We hope this shall 
be improved then.

Although it should have nothing to do with this patch directly, since 
this is a bugfix only.

BR
Ulf Hansson



More information about the linux-arm-kernel mailing list