Re: [PATCH V3] mmc: mmci: Fixup and cleanup code for DMA handling

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

 



On 13 January 2013 20:24, Russell King - ARM Linux
<linux@xxxxxxxxxxxxxxxx> wrote:
> On Mon, Jan 07, 2013 at 03:58:27PM +0100, Ulf Hansson wrote:
>> @@ -374,19 +415,12 @@ static void mmci_dma_unmap(struct mmci_host *host, struct mmc_data *data)
>>        * contiguous buffers.  On TX, we'll get a FIFO underrun error.
>>        */
>>       if (status & MCI_RXDATAAVLBLMASK) {
>> -             dmaengine_terminate_all(chan);
>> -             if (!data->error)
>> -                     data->error = -EIO;
>> -     }
>> -
>> -     if (data->flags & MMC_DATA_WRITE) {
>> -             dir = DMA_TO_DEVICE;
>> -     } else {
>> -             dir = DMA_FROM_DEVICE;
>> +             data->error = -EIO;
>> +             mmci_dma_data_error(host);
>
> Please explain the change of behaviour here.  Before your change, we _only_
> set data->error if the error is not set.  Here, we overwrite the error code
> no matter what.  What is the reasoning for that change?
>
> The reason the code is like it _was_ is so that any bytes remaining in the
> FIFO are _only_ reported as an error if there wasn't a preceding error.
> That is the behaviour I desired when I wrote this code.

Since we need to do dmaengine_terminate_all(chan), that will mean
another request could potentially already be prepared and thus it
could also be terminated.

Then by always reporting an error the async request handling in the
mmc protocol layer, can do proper error handling and clean up the
previously prepared request.

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


[Index of Archives]     [Linux USB Devel]     [Linux Media]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux