From patchwork Mon Jun 10 15:03:43 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ulf Hansson X-Patchwork-Id: 17742 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-vb0-f70.google.com (mail-vb0-f70.google.com [209.85.212.70]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 5693A25DFB for ; Mon, 10 Jun 2013 15:04:26 +0000 (UTC) Received: by mail-vb0-f70.google.com with SMTP id q12sf2371092vbe.5 for ; Mon, 10 Jun 2013 08:04:24 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-beenthere:x-forwarded-to:x-forwarded-for:delivered-to:from:to:cc :subject:date:message-id:x-mailer:in-reply-to:references :mime-version:x-gm-message-state:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :x-google-group-id:list-post:list-help:list-archive:list-unsubscribe :content-type; bh=MCDuYZTvwGyQRzOlR2uZ4FxJEl3Q3Ur9XNTmEXz42DA=; b=ddvddb0k2b9cjrVL33lZFt3TIiEG8b/CDJxfP/uzO4iP/+J1g8PBbOtO380I8FDpnE J1Db3Usto+L5CaWVz55m7oPnwzF7ahpAvglU5JVwzpbr9/vJDkli0xTC3sbs5Gn7MSYE hx7/6jHK37edj24HagA3uvNXpxYiMLqGy2zMuauPCUijSYt8gTxyxFsOF3sOgFTIFl5O QJsa2Vt7PEgOga9IhQTxo09fMkmBPgF4uKnen2bf63pWdKSZy+g46y/wC9YbXnNAioMb 2Of3259yc1nxI5f6JJzkLE0w5vHhZi+mWDStsXDdJt3LKgRT+Wd10ha/vyo223+GhZf4 S3tQ== X-Received: by 10.58.118.169 with SMTP id kn9mr1540793veb.34.1370876664779; Mon, 10 Jun 2013 08:04:24 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.130.233 with SMTP id oh9ls2728510qeb.5.gmail; Mon, 10 Jun 2013 08:04:24 -0700 (PDT) X-Received: by 10.58.75.41 with SMTP id z9mr5767680vev.4.1370876664568; Mon, 10 Jun 2013 08:04:24 -0700 (PDT) Received: from mail-vc0-f178.google.com (mail-vc0-f178.google.com [209.85.220.178]) by mx.google.com with ESMTPS id s7si3061530vcr.70.2013.06.10.08.04.24 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 10 Jun 2013 08:04:24 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.220.178 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.220.178; Received: by mail-vc0-f178.google.com with SMTP id m17so391312vca.37 for ; Mon, 10 Jun 2013 08:04:24 -0700 (PDT) X-Received: by 10.52.157.138 with SMTP id wm10mr4961023vdb.57.1370876664413; Mon, 10 Jun 2013 08:04:24 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.221.10.206 with SMTP id pb14csp71495vcb; Mon, 10 Jun 2013 08:04:23 -0700 (PDT) X-Received: by 10.15.43.203 with SMTP id x51mr11730026eev.144.1370876662177; Mon, 10 Jun 2013 08:04:22 -0700 (PDT) Received: from eu1sys200aog122.obsmtp.com (eu1sys200aog122.obsmtp.com [207.126.144.153]) by mx.google.com with SMTP id s8si7610099ees.148.2013.06.10.08.04.20 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Mon, 10 Jun 2013 08:04:22 -0700 (PDT) Received-SPF: neutral (google.com: 207.126.144.153 is neither permitted nor denied by best guess record for domain of ulf.hansson@stericsson.com) client-ip=207.126.144.153; Received: from beta.dmz-eu.st.com ([164.129.1.35]) (using TLSv1) by eu1sys200aob122.postini.com ([207.126.147.11]) with SMTP ID DSNKUbXq8/YTZcAhR07A8xDHzBiMffRz7BYs@postini.com; Mon, 10 Jun 2013 15:04:22 UTC Received: from zeta.dmz-eu.st.com (zeta.dmz-eu.st.com [164.129.230.9]) by beta.dmz-eu.st.com (STMicroelectronics) with ESMTP id B3FAA1F9; Mon, 10 Jun 2013 15:04:16 +0000 (GMT) Received: from relay1.stm.gmessaging.net (unknown [10.230.100.17]) by zeta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 91B675383; Mon, 10 Jun 2013 15:03:56 +0000 (GMT) Received: from exdcvycastm003.EQ1STM.local (alteon-source-exch [10.230.100.61]) (using TLSv1 with cipher RC4-MD5 (128/128 bits)) (Client CN "exdcvycastm003", Issuer "exdcvycastm003" (not verified)) by relay1.stm.gmessaging.net (Postfix) with ESMTPS id E4D7D24C07C; Mon, 10 Jun 2013 17:04:07 +0200 (CEST) Received: from steludxu1397.lud.stericsson.com (10.230.100.153) by smtp.stericsson.com (10.230.100.1) with Microsoft SMTP Server (TLS) id 8.3.279.5; Mon, 10 Jun 2013 17:04:15 +0200 From: Ulf Hansson To: , Chris Ball Cc: Ulf Hansson Subject: [PATCH 08/12] mmc: core: Handle both poweroff notification types for eMMC Date: Mon, 10 Jun 2013 17:03:43 +0200 Message-ID: <1370876627-13439-9-git-send-email-ulf.hansson@stericsson.com> X-Mailer: git-send-email 1.7.10 In-Reply-To: <1370876627-13439-1-git-send-email-ulf.hansson@stericsson.com> References: <1370876627-13439-1-git-send-email-ulf.hansson@stericsson.com> MIME-Version: 1.0 X-Gm-Message-State: ALoCoQkx8slbmzPRTdaIaB4gCA+RviFDHXJjdiSoDb+r9XqiyLdJZiRzTLfVeMiAT+v+If8rUV2d X-Original-Sender: patch@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.220.178 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , From: Ulf Hansson Depending on the context of the operation while powering down the card, either POWER_OFF_NOTIFY_SHORT or POWER_OFF_NOTIFY_LONG will be used. In suspend context a short timeout is preferred while a long timeout would be acceptable in a shutdown/hibernation context. We add a new parameter to the mmc_suspend function so we can provide an indication of what notification type to use. Signed-off-by: Ulf Hansson --- drivers/mmc/core/mmc.c | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/drivers/mmc/core/mmc.c b/drivers/mmc/core/mmc.c index 86ca103..dcf0169 100644 --- a/drivers/mmc/core/mmc.c +++ b/drivers/mmc/core/mmc.c @@ -1464,12 +1464,11 @@ static void mmc_detect(struct mmc_host *host) } } -/* - * Suspend callback from host. - */ -static int mmc_suspend(struct mmc_host *host) +static int _mmc_suspend(struct mmc_host *host, bool is_suspend) { int err = 0; + unsigned int notify_type = is_suspend ? EXT_CSD_POWER_OFF_SHORT : + EXT_CSD_POWER_OFF_LONG; BUG_ON(!host); BUG_ON(!host->card); @@ -1487,7 +1486,7 @@ static int mmc_suspend(struct mmc_host *host) goto out; if (mmc_can_poweroff_notify(host->card)) - err = mmc_poweroff_notify(host->card, EXT_CSD_POWER_OFF_SHORT); + err = mmc_poweroff_notify(host->card, notify_type); else if (mmc_can_sleep(host->card)) err = mmc_sleep(host); else if (!mmc_host_is_spi(host)) @@ -1502,6 +1501,14 @@ out: } /* + * Suspend callback from host. + */ +static int mmc_suspend(struct mmc_host *host) +{ + return _mmc_suspend(host, true); +} + +/* * Resume callback from host. * * This function tries to determine if the same card is still present