RE: [PATCH] mmc: host: renesas_internal_dmac: add pre_req and post_req support

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

 



Hi Wolfram-san again,

> From: Yoshihiro Shimoda, Sent: Tuesday, December 15, 2020 10:32 AM
> > From: Wolfram Sang, Sent: Tuesday, December 15, 2020 12:50 AM
> > On Fri, Dec 04, 2020 at 10:17:33PM +0900, Yoshihiro Shimoda wrote:
> > >  /*
> > >   * Specification of this driver:
> > >   * - host->chan_{rx,tx} will be used as a flag of enabling/disabling the dma
> > > @@ -172,6 +178,47 @@ renesas_sdhi_internal_dmac_dataend_dma(struct tmio_mmc_host *host) {
> > >  	tasklet_schedule(&priv->dma_priv.dma_complete);
> > >  }
> > >
> > > +/* Should not use host->sg_ptr/sg_len in the following function */
> >
> > Maybe a short explanation why we shouldn't use the functions?
> 
> I tried to update the comment as below:
> /*
>  * tmio_mmc_request() only sets host->sg_{ptr,len} and
>  * renesas_sdhi_internal_dmac_pre_req() doesn't set host->sg_{ptr,len} so that
>  * we should not use the values in the following function.
>  */
> 
> Hmm... Perhaps, I should modify the code to use host->sg_{ptr,len}
> in both paths (.request() and .pre_req()) and remove this comments.
> So, I'll try to modify. I guess tmio_mmc_init_sg() is called in pre_req(),
> we can use host->sg_{ptr,len}.

I'm sorry. I was completely wrong. If we use {pre,post}_req,
the MMC core will call pre_req() twice with each mmc_data before
pre_req() is called. So that, second pre_req() will overwrite
the host->sg_ptr. So, we should not use host->sg_ptr here.
So, I'll update the comments like below.

/*
 * Since pre_req() will be called twice before post_req() is called,
 * host->sg_ptr will be overwritten by second pre_req(). So, to use
 * suitable sg pointer, should use data->sg/sg_len instead of
 * host->sg_ptr/sg_len.
 */

Best regards,
Yoshihiro Shimoda





[Index of Archives]     [Linux Samsung SOC]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]

  Powered by Linux