From patchwork Thu May 11 12:39:01 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ulf Hansson X-Patchwork-Id: 99640 Delivered-To: patches@linaro.org Received: by 10.140.96.100 with SMTP id j91csp708978qge; Thu, 11 May 2017 05:39:08 -0700 (PDT) X-Received: by 10.28.29.205 with SMTP id d196mr4909130wmd.30.1494506348683; Thu, 11 May 2017 05:39:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1494506348; cv=none; d=google.com; s=arc-20160816; b=sx1wAHAFdPghlghlrIOAYxQQcnf6hvHfzQ+3Y89QLoOz8b4edxj1J389IoyI5zzaXe dUcMcqoMjuc6bk9SRsjCkEp89idJVwiXDqwlK+o+t34PEqKrCUihs0jJG+PysMklyFPK YmBok8OP3TuRQ6pFQwgMkcTlqowQzYLWqjgAhrVk2Pm7cGCN+3xuZ2a823/MhCabEtAi r5zDtXqQf34xEu4BhxCtJiBF3+Lnw1IXYl++MMmBElnau0tOpj31Bkz2P8HTWUIu9s+c JiW+E7vHRvmSMOIKBa2MhMrb/H1YDquDSdSaR38Zs/5JhkljaaUTrHT6XIeSQVMIvCZu HP/Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature:arc-authentication-results; bh=6Z+X5DV4GGgVpcea4LF0/4EAHFhaXZ0ONLEJGWGi1VI=; b=SzGCbaDca/nMcL5R+GGy3brNEgDhogblpnMyGNbhUoCMf2u6WjexeSXQDMF+Ufsa2t dYvhE+Fks3gFzR5m9sH26BaZpP4pgOT6shrZZNPySlbztzFRVRal82mzVMihkLveWQm/ 6fVtFCk1YXDnebNAS912xonRJKiQLGav91DedXRjAMH4x36i+Dvi1Go/KJ/MlAuoTupo iaDNR1tUfuB9oWB5CM4gRCMP6PZHduxIpOrhRwQzv+uMO3UHuNq2NWzt5Hzi5Qm/wlhq Zs+k8y4U7tCW0eGMm4VHrSy9umTArAV954n3BggciYW2Y0AGOBnpkbLG4Bh7BPkYF/fN MtbQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org; spf=pass (google.com: domain of ulf.hansson@linaro.org designates 2a00:1450:400c:c0c::22a as permitted sender) smtp.mailfrom=ulf.hansson@linaro.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from mail-wr0-x22a.google.com (mail-wr0-x22a.google.com. [2a00:1450:400c:c0c::22a]) by mx.google.com with ESMTPS id i8si54544wrb.99.2017.05.11.05.39.08 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 11 May 2017 05:39:08 -0700 (PDT) Received-SPF: pass (google.com: domain of ulf.hansson@linaro.org designates 2a00:1450:400c:c0c::22a as permitted sender) client-ip=2a00:1450:400c:c0c::22a; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org; spf=pass (google.com: domain of ulf.hansson@linaro.org designates 2a00:1450:400c:c0c::22a as permitted sender) smtp.mailfrom=ulf.hansson@linaro.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: by mail-wr0-x22a.google.com with SMTP id l9so19527623wre.1 for ; Thu, 11 May 2017 05:39:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=6Z+X5DV4GGgVpcea4LF0/4EAHFhaXZ0ONLEJGWGi1VI=; b=JAgjfJr0n4WSVsy+IF+RpskwN2lilT/hHA2guvYK3snaFSoefEzHS60xZgsDBh2S6m 2PARDZhdOBVLIDSyzEvAikgb4axj1fcl07J1Z0WxfXTMOfGDz0gA9CyYTURP2ux2CCSl ETjmeZJQiiQJ+K94gp46CshMWMP5S54M62RHI= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=6Z+X5DV4GGgVpcea4LF0/4EAHFhaXZ0ONLEJGWGi1VI=; b=G0YY2x4vbCHZ3u5TwE0IExlAlfO+pZOWCsmVaCnHDg2+eciXrjs2FtuLTAG0ncxgOo LS1iOlyY68uW9+U8ASKk0o8lIjsj0WhQNlRScI/1d+PrHUbrlseLhcWOeggOjFRAupLa TjrxCX1On9OF4q3CYTWdVDt1vxSNDkj8xychsbA5TpgD+yuq39MSxYLeq5NMiz1A2tjb T2rkj61V063HLmqkkHIPtlIHV5OtKVXF773FA1JvUlmbPuiXvjq+qSUH/xqyElJo7OGz HyKV0edTY5ZeOTJ3rCN3E7LooGBY2qXtheoXFJrQeVtnCFLcP5BMbhhMkIsqWsMJSFO4 pvvg== X-Gm-Message-State: AODbwcC46bAL8xKmvlKUCxe+9BYNQFfToLdwHMLTrPb/P2/s6lo12cgZ LXFMXx+rvzrRS2N/i+4= X-Received: by 10.46.14.9 with SMTP id 9mr35545ljo.27.1494506348285; Thu, 11 May 2017 05:39:08 -0700 (PDT) Return-Path: Received: from localhost.localdomain (h-155-4-221-67.na.cust.bahnhof.se. [155.4.221.67]) by smtp.gmail.com with ESMTPSA id h13sm13935ljh.5.2017.05.11.05.39.07 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 11 May 2017 05:39:07 -0700 (PDT) From: Ulf Hansson To: linux-mmc@vger.kernel.org, Ulf Hansson Cc: Jens Axboe , Paolo Valente , linux-block@vger.kernel.org, Linus Walleij , Mark Brown , Adrian Hunter Subject: [RFC PATCH 2/3] mmc: core: Remove redundant abort-able claim host API Date: Thu, 11 May 2017 14:39:01 +0200 Message-Id: <1494506343-28572-3-git-send-email-ulf.hansson@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1494506343-28572-1-git-send-email-ulf.hansson@linaro.org> References: <1494506343-28572-1-git-send-email-ulf.hansson@linaro.org> The only user of the abort-able claim host API was the SDIO IRQ thread, but as that use has now been removed, let's simplify the code and remove the API. Signed-off-by: Ulf Hansson --- drivers/mmc/core/core.c | 31 ++++++++++--------------------- drivers/mmc/core/core.h | 13 +------------ 2 files changed, 11 insertions(+), 33 deletions(-) -- 2.7.4 diff --git a/drivers/mmc/core/core.c b/drivers/mmc/core/core.c index 82c45dd..0701e30 100644 --- a/drivers/mmc/core/core.c +++ b/drivers/mmc/core/core.c @@ -1019,20 +1019,15 @@ unsigned int mmc_align_data_size(struct mmc_card *card, unsigned int sz) EXPORT_SYMBOL(mmc_align_data_size); /** - * __mmc_claim_host - exclusively claim a host + * mmc_claim_host - exclusively claim a host * @host: mmc host to claim - * @abort: whether or not the operation should be aborted * - * Claim a host for a set of operations. If @abort is non null and - * dereference a non-zero value then this will return prematurely with - * that non-zero value without acquiring the lock. Returns zero - * with the lock held otherwise. + * Claim a host for a set of operations. */ -int __mmc_claim_host(struct mmc_host *host, atomic_t *abort) +void mmc_claim_host(struct mmc_host *host) { DECLARE_WAITQUEUE(wait, current); unsigned long flags; - int stop; bool pm = false; might_sleep(); @@ -1041,31 +1036,25 @@ int __mmc_claim_host(struct mmc_host *host, atomic_t *abort) spin_lock_irqsave(&host->lock, flags); while (1) { set_current_state(TASK_UNINTERRUPTIBLE); - stop = abort ? atomic_read(abort) : 0; - if (stop || !host->claimed || host->claimer == current) + if (!host->claimed || host->claimer == current) break; spin_unlock_irqrestore(&host->lock, flags); schedule(); spin_lock_irqsave(&host->lock, flags); } set_current_state(TASK_RUNNING); - if (!stop) { - host->claimed = 1; - host->claimer = current; - host->claim_cnt += 1; - if (host->claim_cnt == 1) - pm = true; - } else - wake_up(&host->wq); + host->claimed = 1; + host->claimer = current; + host->claim_cnt += 1; + if (host->claim_cnt == 1) + pm = true; spin_unlock_irqrestore(&host->lock, flags); remove_wait_queue(&host->wq, &wait); if (pm) pm_runtime_get_sync(mmc_dev(host)); - - return stop; } -EXPORT_SYMBOL(__mmc_claim_host); +EXPORT_SYMBOL(mmc_claim_host); /** * mmc_release_host - release a host diff --git a/drivers/mmc/core/core.h b/drivers/mmc/core/core.h index 55f543f..b247b1f 100644 --- a/drivers/mmc/core/core.h +++ b/drivers/mmc/core/core.h @@ -122,20 +122,9 @@ int mmc_set_blocklen(struct mmc_card *card, unsigned int blocklen); int mmc_set_blockcount(struct mmc_card *card, unsigned int blockcount, bool is_rel_write); -int __mmc_claim_host(struct mmc_host *host, atomic_t *abort); +void mmc_claim_host(struct mmc_host *host); void mmc_release_host(struct mmc_host *host); void mmc_get_card(struct mmc_card *card); void mmc_put_card(struct mmc_card *card); -/** - * mmc_claim_host - exclusively claim a host - * @host: mmc host to claim - * - * Claim a host for a set of operations. - */ -static inline void mmc_claim_host(struct mmc_host *host) -{ - __mmc_claim_host(host, NULL); -} - #endif