Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp516571ybb; Fri, 20 Mar 2020 03:23:45 -0700 (PDT) X-Google-Smtp-Source: ADFU+vvPYd/QYSrLhI456EmsvwWejt74MIv4HitXKn5B9pidvGM4VfIs4tNAv6sKzsCGJKp7KuEM X-Received: by 2002:aca:b605:: with SMTP id g5mr5871455oif.159.1584699825539; Fri, 20 Mar 2020 03:23:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1584699825; cv=none; d=google.com; s=arc-20160816; b=K5bfIrEE89JoQ26iU8aM3PF4vlw+9W2AtAyy3Z7FVa2GtTfvudKiDIifn1o9aiAs6A Efje75rex0WQcZ/8J8ghM7FNIHIBMalLMKGlefvX5jl4OQSlBwOumsFddREQtzhiez3w X/3C22lh9/nzlfOJPgGjnIEHCb9KLGsl9a6LZnl/LHWBeSzGVczRDzknfwKm6Gmhtm4i qpW8BWG2Kzam3UsPRTP+IHK/gRc1VShiB4oWvWR5mndvOSiYJeNmqQonx+YTDjIAtuOb doKhqsBPKQ48Tpg5q+jjLSKc+HOYE7solpEoU7ojOCClmrnJdjlSCY4yIZHNswrdb/eI am1g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=8Ahg+K1LklBOYWBRqmStRbuNfs/FmsalbYYMIdthFUE=; b=TqagPwsFfe073WuOwoup+0kV1QbPhINnpfyn9ioZrgV9Ekk5KiV8Ktq5tbR5YOpWeJ Ycptq/8DkA2K9pW8s2i2hBs7duskVFfJkPPMZXGKZzlEyJ8GQbXrQg94NjPa4bsL6dxh JJwD8SgBOG6dk4j9MoBaguJeepUB0/BgZ4NCioS87ya3AFk6Y0oycFwZtJZYVcQ7MtHP OMAr2zdPc4Wya0TQVEHUeJA470hVyuIrBZF6toJwCnArnvQBTVTVvc7oMXK2Htvz6f/T 25QkDm/rmix7NX7WPmnydNEnP0lOujqKMdZyZ4Fg1u6vxS7O+mJs+SsiRJoy3tacup3Z JW4Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=pnQNW5h4; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c201si2452816oib.57.2020.03.20.03.23.33; Fri, 20 Mar 2020 03:23:45 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=pnQNW5h4; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726654AbgCTKWj (ORCPT + 99 others); Fri, 20 Mar 2020 06:22:39 -0400 Received: from mail-vk1-f193.google.com ([209.85.221.193]:36125 "EHLO mail-vk1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726657AbgCTKWi (ORCPT ); Fri, 20 Mar 2020 06:22:38 -0400 Received: by mail-vk1-f193.google.com with SMTP id m131so1584798vkh.3 for ; Fri, 20 Mar 2020 03:22:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=8Ahg+K1LklBOYWBRqmStRbuNfs/FmsalbYYMIdthFUE=; b=pnQNW5h4aMDIgh8RiTJcOrlLJPuG2Sy9cfcvjMPaQ7UYihYb1g1mZbvAvrxoa+Sbry ZzZUm3jwhLJFzwiphhQOkznH3NY+RHCdBWCUmeyw+0NlzARUqQzVr9Ayq+0mVn7AFdIH bpj0coq3pT7GieHK2dRjvUKLbWVasGg/BAvmXagNzJNKWni07lFLN0ckVK0ZS/sP3dAr sVVky75+pEfM6wgXZS0hfZAWH2SptLcSJhDOPeoPOSZHU8hqDd+An/SiAa48K32BlJ06 K0TtrIPXZEAWP8bq3MZNQCyKOEVPGAavLqlmB+PRmvNDNDr6FHW/9mS4JN9hLfed0F2a qQrA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=8Ahg+K1LklBOYWBRqmStRbuNfs/FmsalbYYMIdthFUE=; b=obF+dIQQ4hldquWWpnK7xXIsdmOHL/2G+mweDCKGhLLwtpw4Uy4DLoqLJHProgZd6o 6sWbS4tpbP/ZT/MCHwfOVTJSJVyllh1ZL5WpwSJJW6zK1medyONeF2zeehi5OSoQOA4M pjRiL/3IA7LPJsYyyCe0GO2rn3b8RJBfYoEk/hLEbVZwQ/uGQaNvwpXGoWfL2pduGyMh oxfj4zBjREL/vS26lgogsg7kiYNw+YEz7iEmZ9OLoqQk9D4LVs/hCaadA+3wXLxBsgtz nJXudv39l4GrGnGEFMgF6bChqpJBihZiFBWEgpVTfwfvFW5l3pPED78E99hVCZLfSMx0 84lQ== X-Gm-Message-State: ANhLgQ0Xu7u3uT391eN/p6hewfD0N7/uXq6GSnVm7H8peaJGM2vcpezV hWsEbWfat3gCKbtbRJNmCN+2nx0swUuTGGswFtjTeA== X-Received: by 2002:a1f:7f1d:: with SMTP id o29mr5723265vki.101.1584699757213; Fri, 20 Mar 2020 03:22:37 -0700 (PDT) MIME-Version: 1.0 References: <1582181100-29914-1-git-send-email-sbhanu@codeaurora.org> <158334039680.7173.16159724456027777605@swboyd.mtv.corp.google.com> <158463974696.152100.8345578995373250448@swboyd.mtv.corp.google.com> In-Reply-To: <158463974696.152100.8345578995373250448@swboyd.mtv.corp.google.com> From: Ulf Hansson Date: Fri, 20 Mar 2020 11:22:01 +0100 Message-ID: Subject: Re: [PATCH V4] mmc: sdhci-msm: Update system suspend/resume callbacks of sdhci-msm platform driver To: Stephen Boyd Cc: Shaik Sajida Bhanu , Adrian Hunter , Rob Herring , Matthias Kaehlcke , Asutosh Das , Sahitya Tummala , Sayali Lokhande , cang@codeaurora.org, Veerabhadrarao Badiganti , Ram Prakash Gupta , "linux-mmc@vger.kernel.org" , Linux Kernel Mailing List , linux-arm-msm , DTML , Andy Gross , Bjorn Andersson Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 19 Mar 2020 at 18:42, Stephen Boyd wrote: > > Quoting Ulf Hansson (2020-03-06 02:07:41) > > On Wed, 4 Mar 2020 at 17:46, Stephen Boyd wrote: > > > > > > Quoting Ulf Hansson (2020-03-04 07:34:29) > > > > On Thu, 20 Feb 2020 at 07:45, Shaik Sajida Bhanu wrote: > > > > > > > > > > The existing suspend/resume callbacks of sdhci-msm driver are just > > > > > gating/un-gating the clocks. During suspend cycle more can be done > > > > > like disabling controller, disabling card detection, enabling wake-up events. > > > > > > > > > > So updating the system pm callbacks for performing these extra > > > > > actions besides controlling the clocks. > > > > > > > > > > Signed-off-by: Shaik Sajida Bhanu > > > > > Reviewed-by: Stephen Boyd > > > > > --- > [...] > > > > > > > > > > > > > > + > > > > > + ret = pm_runtime_force_suspend(dev); > > > > > > > > It looks to me that perhaps you could make use of solely > > > > pm_runtime_force_suspend(), then just skip calling > > > > sdhci_suspend|resume_host() altogether. Do you think that could work? > > > > > > Does that do all the things the commit text mentions is desired for > > > system suspend? > > > > No. :-) > > > > But why is system wakeup needed for an eMMC card? > > > > I don't know if system wakeup is needed for an eMMC card. Probably only > if you plug in a card and some daemon wants to wake up and probe the > card for auto-play or something like that? Seems possible so might as > well expose the CD gpio as a wakeup in that case and let userspace > decide if it wants to do that. Right, card detect IRQs could be useful for system wakeups. I assume you are using a GPIO IRQ for that, which is easily managed, as the runtime PM status of the mmc controller is irrelevant when configuring the GPIO IRQ as wakeup. We even have a helper for doing this, mmc_gpio_set_cd_wake(). > > Is runtime suspended state the same as system suspended state here > though? The commit text seems to imply that only clks are disabled when > it's desirable to disable the entire controller. I'm still fuzzy on how > runtime PM and system PM interact because it seems to have changed since > I looked last a few years ago. If the driver can stay in a runtime > suspended state across system suspend then I'm all for it. That would > save time for system PM transitions. In most cases this should be possible. And so far, for this case, I haven't found a good reason to why it shouldn't work. Although, perhaps we need to improve some of the sdhci's library functions for PM, to better support this. Kind regards Uffe