From: Subhash Jadavani <subhashj@codeaurora.org>
To: Jaehoon Chung <jh80.chung@samsung.com>
Cc: linux-mmc <linux-mmc@vger.kernel.org>,
Chris Ball <cjb@laptop.org>,
Konstantin Dorfman <kdorfman@codeaurora.org>,
Kyungmin Park <kyungmin.park@samsung.com>,
Per FORLIN <per.forlin@stericsson.com>,
Maya Erez <merez@codeaurora.org>
Subject: Re: [PATCH] mmc: core: fix the aysync mechanism when card removed
Date: Thu, 31 Jan 2013 14:12:17 +0530 [thread overview]
Message-ID: <510A2E69.6000608@codeaurora.org> (raw)
In-Reply-To: <50FE838C.5010709@samsung.com>
On 1/22/2013 5:48 PM, Jaehoon Chung wrote:
> When card removed, then didn't complete the previously data.
> (It didn't wakeup any interrupt.)
> If card is removed, then we can assume to complete the previously data.
> And wakeup the interrupt for wait_event of data.
>
> This problem is produced when sd-card is removed.(Sd-card is running some operation)
>
> Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
> Signed-off-by: Kyungmin Park <Kyungmin.park@samsung.com>
> ---
> drivers/mmc/core/core.c | 31 ++++++++++++++++++++-----------
> 1 files changed, 20 insertions(+), 11 deletions(-)
>
> diff --git a/drivers/mmc/core/core.c b/drivers/mmc/core/core.c
> index 8b3a122..bc1d627 100644
> --- a/drivers/mmc/core/core.c
> +++ b/drivers/mmc/core/core.c
> @@ -515,17 +515,26 @@ struct mmc_async_req *mmc_start_req(struct mmc_host *host,
> mmc_pre_req(host, areq->mrq, !host->areq);
>
> if (host->areq) {
> - err = mmc_wait_for_data_req_done(host, host->areq->mrq,
> - areq);
> - if (err == MMC_BLK_NEW_REQUEST) {
> - if (error)
> - *error = err;
> - /*
> - * The previous request was not completed,
> - * nothing to return
> - */
> - return NULL;
> - }
> + err = mmc_wait_for_data_req_done(host, host->areq->mrq,
> + areq);
> + if (err == MMC_BLK_NEW_REQUEST) {
> + if (error)
> + *error = err;
> + /*
> + * The previous request was not completed,
> + * nothing to return
> + */
> + return NULL;
> + } else if (err == MMC_BLK_NOMEDIUM && areq) {
> + struct mmc_context_info *ctnx = &host->context_info;
> + /*
> + * If crad is removed,
> + * then we didn't wait for data completed.
> + * Assume that data-recieve done.
> + */
> + ctnx->is_done_rcv = true;
> + wake_up_interruptible(&ctnx->wait);
Can you please explain more on what exactly we are trying to do here
(may be you can list down the call flow)? I am not sure if i understood
this correctly. But why would you need to wakeup the thread here? We are
here because thread is already woken up. mmc_wait_for_data_req_done()
would return only if either the new request is received or the currently
running request on controller is completed.
Regards,
Subhash
> + }
> /*
> * Check BKOPS urgency for each R1 response
> */
next prev parent reply other threads:[~2013-01-31 8:42 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-01-22 12:18 [PATCH] mmc: core: fix the aysync mechanism when card removed Jaehoon Chung
2013-01-31 7:06 ` Jaehoon Chung
2013-01-31 8:42 ` Subhash Jadavani [this message]
2013-01-31 9:46 ` Jaehoon Chung
2013-01-31 10:48 ` Seungwon Jeon
2013-01-31 11:03 ` Jaehoon Chung
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=510A2E69.6000608@codeaurora.org \
--to=subhashj@codeaurora.org \
--cc=cjb@laptop.org \
--cc=jh80.chung@samsung.com \
--cc=kdorfman@codeaurora.org \
--cc=kyungmin.park@samsung.com \
--cc=linux-mmc@vger.kernel.org \
--cc=merez@codeaurora.org \
--cc=per.forlin@stericsson.com \
/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;
as well as URLs for NNTP newsgroup(s).