Re: [PATCH 1/2] omap: hsmmc: Normalize dma cleanup operations

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

 



On 14 September 2011 15:40, S, Venkatraman <svenkatr@xxxxxx> wrote:
> On Tue, Sep 13, 2011 at 1:26 AM, Per Forlin <per.forlin@xxxxxxxxxx> wrote:
>> On 1 September 2011 21:05, Venkatraman S <svenkatr@xxxxxx> wrote:
>>> Reuse omap_hsmmc_dma_cleanup even for normal dma teardown in
>>> omap_hsmmc_dma_cb. Consolidate multiple points of dma unmap into a
>>> single location in post_req function, to prevent double unmapping.
>> It's optional to use pre_req() and post_req(). The SDIO framework
>> doesn't utilise these hooks. For instance this wont work together with
>> SDIO-wlan on the pandaboard.
>> If pre_req() has been issued it's fine to defer dma_unmap() until
>> post_req(). If pre_req() is not called the driver should call
>> dma_unmap() directly.
>>
>
> In that case, can the actual 'request' function just call pre_req and post_req
> (at the beginning and at the end), if host_cookie is not set ?
>
Which request() function do your refer to? The mmc_host_ops.request()
returns before the transfer is finished.
Apart from that, I would say yes. It's nice to have the same code path
for valid cookie and invalid cookie scenario.

Note that the host_cookie could be set but with an invalid value.
host driver:
1. validate cookie
2. if invalid cookie call pre_req()
3. run request
4. done -> if (has called pre_req() #2) -> call post_req().

A general fix would be to put this logic in mmc_wait_for_req() in
core.c, but at this level it's not possible to validate the cookie. In
the current implementation the host driver controls the cookie value.

/Per
--
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