From patchwork Thu Sep 26 19:22:58 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Grant Grundler X-Patchwork-Id: 2951031 Return-Path: X-Original-To: patchwork-linux-mmc@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 398F19F288 for ; Thu, 26 Sep 2013 19:24:31 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 1DCE9202EC for ; Thu, 26 Sep 2013 19:24:30 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 4351E202C8 for ; Thu, 26 Sep 2013 19:24:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754261Ab3IZTXw (ORCPT ); Thu, 26 Sep 2013 15:23:52 -0400 Received: from mail-pd0-f181.google.com ([209.85.192.181]:51256 "EHLO mail-pd0-f181.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753547Ab3IZTXq (ORCPT ); Thu, 26 Sep 2013 15:23:46 -0400 Received: by mail-pd0-f181.google.com with SMTP id g10so1569329pdj.26 for ; Thu, 26 Sep 2013 12:23:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=vkGpYcadATlN5WV3WeoeBTUzQlmvgrqpmBS1FKNok9c=; b=LSYEPt8gexjtanPKn0xXEpYFi1UJ9xIK7wn8nrDFLT6PozCmpPwsPpxjZ68NttZ9nd uAX+Rmr4oiKzm9Uxo33OjHN66hKRGN9QQZreK2KJPWWPosD2qAVqBBx7UnL4kEHPgHOn lgW4ZzUwBAPiMU8QAqGAbu1XNjfzm3QHMRgsU= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=vkGpYcadATlN5WV3WeoeBTUzQlmvgrqpmBS1FKNok9c=; b=hesuXS/mA4W+wbp3KRVVwHbE+mfJot0fQW94pkWJavPw6/MG66TvDTSq0ACn7EXgmh +u9T2DRHWUCDyr2f9Fib0vBTqmAXqgf3WXA9fWbrg08QKDOL0TlKS6Qv0L3KwAGqqIpe TPP3i/H6II0S2Ha7/pnaV9Z+lHq57pFQhMMA1ZYIabm7cxuD41gpM7emEvnU4sQ9TLwA Qa3T92e1nwPTjNbEOf32uWftuo/h/AI7vz3MeX3jgia01nN1JmEpx3W3r/V712iVyBD0 GcvkULrWNpOPVEZGXsOqLZThRGfwjAM8nEK5cLaoZInlGhyaJh1mUP+CP/xiOgPcJS1F GoIg== X-Gm-Message-State: ALoCoQnFGeeKg77LM5R9t6wOgwYLj10xWIiBi9BsY8vJabqb7FdO5pj11dITsaBeNKQxqEF2/WSa X-Received: by 10.66.66.161 with SMTP id g1mr5101077pat.175.1380223425909; Thu, 26 Sep 2013 12:23:45 -0700 (PDT) Received: from firesword.mtv.corp.google.com (firesword.mtv.corp.google.com [172.22.73.90]) by mx.google.com with ESMTPSA id ar1sm3900253pbc.34.1969.12.31.16.00.00 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 26 Sep 2013 12:23:45 -0700 (PDT) From: Grant Grundler To: Chris Ball , Ulf Hansson , Seungwon Jeon Cc: linux-mmc@vger.kernel.org, linux-kernel@vger.kernel.org, Grant Grundler Subject: [PATCH 5/7] mmc: core: handling polling more gracefully Date: Thu, 26 Sep 2013 12:22:58 -0700 Message-Id: <1380223380-22451-6-git-send-email-grundler@chromium.org> X-Mailer: git-send-email 1.8.4 In-Reply-To: <1380223380-22451-1-git-send-email-grundler@chromium.org> References: <1380223380-22451-1-git-send-email-grundler@chromium.org> Sender: linux-mmc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mmc@vger.kernel.org X-Spam-Status: No, score=-9.2 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,RP_MATCHES_RCVD,T_DKIM_INVALID,UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP In case threads "race" to harvest async req completions, just return. Signed-off-by: Grant Grundler --- drivers/mmc/core/core.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/mmc/core/core.c b/drivers/mmc/core/core.c index deb0ee5..36cfe91 100644 --- a/drivers/mmc/core/core.c +++ b/drivers/mmc/core/core.c @@ -531,6 +531,10 @@ struct mmc_async_req *mmc_start_req(struct mmc_host *host, int start_err = 0; struct mmc_async_req *saved_areq = host->areq; + if (!saved_areq && !areq) + /* Nothing to do...some code is polling. */ + goto set_error; + /* Prepare a new request */ if (areq) mmc_pre_req(host, areq->mrq, !saved_areq);