public inbox for linux-mmc@vger.kernel.org
 help / color / mirror / Atom feed
From: Seungwon Jeon <tgih.jun@samsung.com>
To: 'Kyoungil Kim' <ki0351.kim@samsung.com>, linux-mmc@vger.kernel.org
Cc: 'Chris Ball' <cjb@laptop.org>, 'Jaehoon Chung' <jh80.chung@samsung.com>
Subject: RE: [PATCH v3] mmc: dw_mmc: read all data in FIFO after Data transfer over interrupt in pio mode
Date: Mon, 18 Feb 2013 19:51:32 +0900	[thread overview]
Message-ID: <001401ce0dc5$ea3b0d20$beb12760$%jun@samsung.com> (raw)
In-Reply-To: <000401cdf874$97e25620$c7a70260$%kim@samsung.com>

Hi Chris,

Could you merge this patch in your tree.
We've verified.

Thanks,
Seungwon Jeon

On Tuesday, January 22, 2013, Kyoungil Kim wrote:
> In dwc manual, the below contents are described.
> "During end of packet, interrupt is not generated if threshold
> programming is larger than any remaining data. It is responsibility
> of host to read remaining bytes on seeing Data Transfer Done
> interrupt"
> We also have seen the data cannot be read fully
> when "sg_miter->length" is less than FIFO size.
> 
> Signed-off-by: Kyoungil Kim <ki0351.kim@samsung.com>
> Signed-off-by: Seungwon Jeon <tgih.jun@samsung.com>
> Acked-by: Jaehoon Chung <jh80.chung@samsung.com>
> ---
>  drivers/mmc/host/dw_mmc.c |   10 ++++++----
>  1 files changed, 6 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/mmc/host/dw_mmc.c b/drivers/mmc/host/dw_mmc.c
> index 323c502..41d59da 100644
> --- a/drivers/mmc/host/dw_mmc.c
> +++ b/drivers/mmc/host/dw_mmc.c
> @@ -1430,7 +1430,7 @@ static void dw_mci_pull_data(struct dw_mci *host, void *buf, int cnt)
>  	host->pull_data(host, buf, cnt);
>  }
> 
> -static void dw_mci_read_data_pio(struct dw_mci *host)
> +static void dw_mci_read_data_pio(struct dw_mci *host, bool dto)
>  {
>  	struct sg_mapping_iter *sg_miter = &host->sg_miter;
>  	void *buf;
> @@ -1465,7 +1465,9 @@ static void dw_mci_read_data_pio(struct dw_mci *host)
>  		sg_miter->consumed = offset;
>  		status = mci_readl(host, MINTSTS);
>  		mci_writel(host, RINTSTS, SDMMC_INT_RXDR);
> -	} while (status & SDMMC_INT_RXDR); /*if the RXDR is ready read again*/
> +	/* if the RXDR is ready read again */
> +	} while ((status & SDMMC_INT_RXDR) ||
> +			(dto && SDMMC_GET_FCNT(mci_readl(host, STATUS))));
>  	data->bytes_xfered += nbytes;
> 
>  	if (!remain) {
> @@ -1597,7 +1599,7 @@ static irqreturn_t dw_mci_interrupt(int irq, void *dev_id)
>  			smp_wmb();
>  			if (host->dir_status == DW_MCI_RECV_STATUS) {
>  				if (host->sg != NULL)
> -					dw_mci_read_data_pio(host);
> +					dw_mci_read_data_pio(host, true);
>  			}
>  			set_bit(EVENT_DATA_COMPLETE, &host->pending_events);
>  			tasklet_schedule(&host->tasklet);
> @@ -1606,7 +1608,7 @@ static irqreturn_t dw_mci_interrupt(int irq, void *dev_id)
>  		if (pending & SDMMC_INT_RXDR) {
>  			mci_writel(host, RINTSTS, SDMMC_INT_RXDR);
>  			if (host->dir_status == DW_MCI_RECV_STATUS && host->sg)
> -				dw_mci_read_data_pio(host);
> +				dw_mci_read_data_pio(host, false);
>  		}
> 
>  		if (pending & SDMMC_INT_TXDR) {
> --
> 1.7.4.1
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-mmc" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html


  reply	other threads:[~2013-02-18 10:51 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-01-22  7:46 [PATCH v3] mmc: dw_mmc: read all data in FIFO after Data transfer over interrupt in pio mode Kyoungil Kim
2013-02-18 10:51 ` Seungwon Jeon [this message]
2013-03-22 16:01   ` Chris Ball

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='001401ce0dc5$ea3b0d20$beb12760$%jun@samsung.com' \
    --to=tgih.jun@samsung.com \
    --cc=cjb@laptop.org \
    --cc=jh80.chung@samsung.com \
    --cc=ki0351.kim@samsung.com \
    --cc=linux-mmc@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox