lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <BANLkTikk14y_tweX45JdDb+qqYtOTuMnbg@mail.gmail.com>
Date:	Fri, 17 Jun 2011 12:15:55 +0200
From:	Per Forlin <per.forlin@...aro.org>
To:	"S, Venkatraman" <svenkatr@...com>
Cc:	linux-mmc <linux-mmc@...r.kernel.org>,
	linux-arm-kernel <linux-arm-kernel@...ts.infradead.org>,
	linux-kernel <linux-kernel@...r.kernel.org>,
	linaro-dev <linaro-dev@...ts.linaro.org>,
	David Vrabel <david.vrabel@....com>
Subject: Re: [PATCH v4 03/12] omap_hsmmc: add support for pre_req and post_req

On 16 June 2011 15:14, S, Venkatraman <svenkatr@...com> wrote:
> On Thu, May 26, 2011 at 3:27 AM, Per Forlin <per.forlin@...aro.org> wrote:
>> pre_req() runs dma_map_sg(), post_req() runs dma_unmap_sg.
>> If not calling pre_req() before omap_hsmmc_request()
>> dma_map_sg will be issued before starting the transfer.
>> It is optional to use pre_req(). If issuing pre_req()
>> post_req() must be to be called as well.
>>
>> Signed-off-by: Per Forlin <per.forlin@...aro.org>
>> ---
>>  drivers/mmc/host/omap_hsmmc.c |   87 +++++++++++++++++++++++++++++++++++++++--
>>  1 files changed, 83 insertions(+), 4 deletions(-)
>>
>> diff --git a/drivers/mmc/host/omap_hsmmc.c b/drivers/mmc/host/omap_hsmmc.c
>> index ad3731a..2116c09 100644
>> --- a/drivers/mmc/host/omap_hsmmc.c
>> +++ b/drivers/mmc/host/omap_hsmmc.c
>> @@ -141,6 +141,11 @@
>>  #define OMAP_HSMMC_WRITE(base, reg, val) \
>>        __raw_writel((val), (base) + OMAP_HSMMC_##reg)
>>
>> +struct omap_hsmmc_next {
>> +       unsigned int    dma_len;
>> +       s32             cookie;
>> +};
>> +
>>  struct omap_hsmmc_host {
>>        struct  device          *dev;
>>        struct  mmc_host        *mmc;
>> @@ -184,6 +189,7 @@ struct omap_hsmmc_host {
>>        int                     reqs_blocked;
>>        int                     use_reg;
>>        int                     req_in_progress;
>> +       struct omap_hsmmc_next  next_data;
>>
>>        struct  omap_mmc_platform_data  *pdata;
>>  };
>> @@ -1344,8 +1350,9 @@ static void omap_hsmmc_dma_cb(int lch, u16 ch_status, void *cb_data)
>>                return;
>>        }
>>
>> -       dma_unmap_sg(mmc_dev(host->mmc), data->sg, data->sg_len,
>> -               omap_hsmmc_get_dma_dir(host, data));
>> +       if (!data->host_cookie)
>> +               dma_unmap_sg(mmc_dev(host->mmc), data->sg, data->sg_len,
>> +                            omap_hsmmc_get_dma_dir(host, data));
>>
>>        req_in_progress = host->req_in_progress;
>>        dma_ch = host->dma_ch;
>> @@ -1363,6 +1370,45 @@ static void omap_hsmmc_dma_cb(int lch, u16 ch_status, void *cb_data)
>>        }
>>  }
>>
>> +static int omap_hsmmc_pre_dma_transfer(struct omap_hsmmc_host *host,
>> +                                      struct mmc_data *data,
>> +                                      struct omap_hsmmc_next *next)
>> +{
>
> As you are passing &host->next_data into next, next will always be a
> valid pointer. So..
>
omap_hsmmc_pre_dma_transfer() is called from two places. in pre_req()
and start_dma_transfer().
next is NULL if called from start_dma_transfer.

/Per
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ