From patchwork Thu Aug 23 11:40:55 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johan Rudholm X-Patchwork-Id: 10904 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id 97BE623E00 for ; Thu, 23 Aug 2012 11:42:34 +0000 (UTC) Received: from mail-iy0-f180.google.com (mail-iy0-f180.google.com [209.85.210.180]) by fiordland.canonical.com (Postfix) with ESMTP id 0C35EA18FC0 for ; Thu, 23 Aug 2012 11:42:19 +0000 (UTC) Received: by iadj38 with SMTP id j38so1103055iad.11 for ; Thu, 23 Aug 2012 04:42:33 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-forwarded-to:x-forwarded-for:delivered-to:received-spf:from:to:cc :subject:date:message-id:x-mailer:mime-version:content-type :x-gm-message-state; bh=+CPkx/Mh8e0UXyFZKrAYb4Bh2xEviXvTDgEZBlLwjew=; b=kwOUhA7toDkgbk005mP/yobF36F8Q5JP+TLqPH5b+hqUCbj8HheeOkspk5Jcenuuzi OjXJCzO+eFyOOKKHJjsb5DPjx8AbaBHUqg5sF5Xx8YlIgMAIXfnsizEX5zCcYiXZXMuc HpB4u7tyCAYff4RWNLJJSn+Wg0irXTZ0lEhJG6sN4Z+HXG+oDg5FVuY3jpA3l/2gfgH9 MzPqVqzJhOxPUg6mxdSPPtqEuaNTtWyHxFjD2/4fGEM7+sYIHE49YB6+3aJ3HeJQs0QL FT9l2TwElnbZ1LA6F1iu2UawEfv+L2CIemAFzEpNzOX7zQEek9GPxyMCeT266W7N/qmT wVNg== Received: by 10.50.45.162 with SMTP id o2mr1222389igm.0.1345722153386; Thu, 23 Aug 2012 04:42:33 -0700 (PDT) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.50.184.232 with SMTP id ex8csp254477igc; Thu, 23 Aug 2012 04:42:32 -0700 (PDT) Received: by 10.14.206.200 with SMTP id l48mr1505424eeo.41.1345722152028; Thu, 23 Aug 2012 04:42:32 -0700 (PDT) Received: from eu1sys200aog110.obsmtp.com (eu1sys200aog110.obsmtp.com. [207.126.144.129]) by mx.google.com with SMTP id c41si4584056eem.122.2012.08.23.04.42.29 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 23 Aug 2012 04:42:32 -0700 (PDT) Received-SPF: neutral (google.com: 207.126.144.129 is neither permitted nor denied by best guess record for domain of johan.rudholm@stericsson.com) client-ip=207.126.144.129; Authentication-Results: mx.google.com; spf=neutral (google.com: 207.126.144.129 is neither permitted nor denied by best guess record for domain of johan.rudholm@stericsson.com) smtp.mail=johan.rudholm@stericsson.com Received: from beta.dmz-ap.st.com ([138.198.100.35]) (using TLSv1) by eu1sys200aob110.postini.com ([207.126.147.11]) with SMTP ID DSNKUDYXIpEvzC70VuQ1LCoeaVS0y3aH/YPM@postini.com; Thu, 23 Aug 2012 11:42:31 UTC Received: from zeta.dmz-ap.st.com (ns6.st.com [138.198.234.13]) by beta.dmz-ap.st.com (STMicroelectronics) with ESMTP id 16004B9; Thu, 23 Aug 2012 11:34:02 +0000 (GMT) Received: from relay1.stm.gmessaging.net (unknown [10.230.100.17]) by zeta.dmz-ap.st.com (STMicroelectronics) with ESMTP id C49011372; Thu, 23 Aug 2012 11:42:16 +0000 (GMT) Received: from exdcvycastm004.EQ1STM.local (alteon-source-exch [10.230.100.61]) (using TLSv1 with cipher RC4-MD5 (128/128 bits)) (Client CN "exdcvycastm004", Issuer "exdcvycastm004" (not verified)) by relay1.stm.gmessaging.net (Postfix) with ESMTPS id B3BFE24C07C; Thu, 23 Aug 2012 13:42:09 +0200 (CEST) Received: from steludxu1610.lud.stericsson.com (10.230.100.153) by smtp.stericsson.com (10.230.100.2) with Microsoft SMTP Server (TLS) id 8.3.83.0; Thu, 23 Aug 2012 13:42:16 +0200 From: Johan Rudholm To: , Chris Ball Cc: Per Forlin , Ulf Hansson , Johan Rudholm Subject: [PATCH] mmc: core: Do not rescan non-removable devices Date: Thu, 23 Aug 2012 13:40:55 +0200 Message-ID: <1345722055-12459-1-git-send-email-johan.rudholm@stericsson.com> X-Mailer: git-send-email 1.7.10 MIME-Version: 1.0 X-Gm-Message-State: ALoCoQkNjr1OkD/+Kq3xtr6O7/f5eYDzNUcjzutZ52davYHsCCh0QBTO82KJczZDeis4b2+L/gwx If MMC_CAP_NONREMOVABLE is set, only issue a detect job on init. Signed-off-by: Johan Rudholm Acked-by: Ulf Hansson --- drivers/mmc/core/core.c | 5 +++++ include/linux/mmc/host.h | 1 + 2 files changed, 6 insertions(+) diff --git a/drivers/mmc/core/core.c b/drivers/mmc/core/core.c index 8ac5246..2f4e273 100644 --- a/drivers/mmc/core/core.c +++ b/drivers/mmc/core/core.c @@ -2052,6 +2052,11 @@ void mmc_rescan(struct work_struct *work) if (host->rescan_disable) return; + /* If there is a non-removable card registered, only scan once */ + if ((host->caps & MMC_CAP_NONREMOVABLE) && host->rescan_entered) + return; + host->rescan_entered = 1; + mmc_bus_get(host); /* diff --git a/include/linux/mmc/host.h b/include/linux/mmc/host.h index f578a71..d5d9bd4 100644 --- a/include/linux/mmc/host.h +++ b/include/linux/mmc/host.h @@ -300,6 +300,7 @@ struct mmc_host { #endif int rescan_disable; /* disable card detection */ + int rescan_entered; /* used with nonremovable devices */ struct mmc_card *card; /* device attached to this host */