From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id CFACEC10F25 for ; Fri, 6 Mar 2020 10:08:21 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id A32E5207FD for ; Fri, 6 Mar 2020 10:08:21 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="nEcPiVzX" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726368AbgCFKIU (ORCPT ); Fri, 6 Mar 2020 05:08:20 -0500 Received: from mail-ua1-f65.google.com ([209.85.222.65]:44260 "EHLO mail-ua1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726079AbgCFKIU (ORCPT ); Fri, 6 Mar 2020 05:08:20 -0500 Received: by mail-ua1-f65.google.com with SMTP id a33so478786uad.11 for ; Fri, 06 Mar 2020 02:08:19 -0800 (PST) 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=uNKCod9HWXu3nxzrNq2A6yL231Mu94A886+59BwdSMs=; b=nEcPiVzXVIU3Kib52ncsdTxiBqwhamhygdS+O38NTLUeFv61aJ1sn68iVJc6k7JB7r o/j/pLXeg7SUehGbmsn/QpATLwr7LQLZHvZApBZRExxELPQt213sRW113dkv9Il0TbzN ymGZ/uZahmlGI2HkF99JYMa5ZWivoDErDZL+qUPAeu9fb6lEsWWejI5H2DoH1SvahW8D KVsWYpzheANfyigtJZ8q6TipmSY1e30WUruYvr3nRpgkGAKSYDPF4JeR3QLQ1UjITByX QTyh6GXV7tFacA2/ugy49rkZl8Ute2lZfcgMiqmbpl1lmSPwNRJXlr3Jk+Zce1xc/4Fa jzOQ== 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=uNKCod9HWXu3nxzrNq2A6yL231Mu94A886+59BwdSMs=; b=Lx9cHQpAer+RZ4MpVjNUMYo9VCk47QYmr7U/JX6DWLbI7b1G/tMNG9y2RYPclWVR81 9gs6Eh49FuhhFQYpzvOL7c1nKBYnuj2mwOaAE/bfzjD+tAlp3fg1idrgoWX2fqlZ8sSp Bhov0Rw8rwb0L93ejQzP1fFudcLn53MTZc55QkdbzAf218gsvziYzeYZC/E9ZRAU405Q zf9nRSgpHrf0IrBX55uG8boZJQFJW0XPcVNrqLT4Jrl6bRlE229vlaNx4LR+2XQayL+T GrhJUQtbVmfavUIPxA7uWcvxkdbFAfBGla15siGdpCHxkLeMifBIalH8El7XMBx2lYkC T+yQ== X-Gm-Message-State: ANhLgQ02yRHAGrQaiji9zIFTfOHC8oe+4GCgST0VoJRr1gSJM+W9GcuT 9vmjOSr1jQvxTRNzo+lqk7H1eyF7wuqKljbqnJ0/dQ== X-Google-Smtp-Source: ADFU+vsPFcu0IamYO7zcUHclxL6+QOvOPAC3udRj76VGvSDRr2MgjVWcGiwDFu6MaHE/Uqw+4BybbwlP2HJccNuaWOc= X-Received: by 2002:ab0:7802:: with SMTP id x2mr1248889uaq.100.1583489298936; Fri, 06 Mar 2020 02:08:18 -0800 (PST) MIME-Version: 1.0 References: <1582181100-29914-1-git-send-email-sbhanu@codeaurora.org> <158334039680.7173.16159724456027777605@swboyd.mtv.corp.google.com> In-Reply-To: <158334039680.7173.16159724456027777605@swboyd.mtv.corp.google.com> From: Ulf Hansson Date: Fri, 6 Mar 2020 11:07:41 +0100 Message-ID: Subject: Re: [PATCH V4] mmc: sdhci-msm: Update system suspend/resume callbacks of sdhci-msm platform driver To: Stephen Boyd , Shaik Sajida Bhanu Cc: 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 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 > > > --- > > > Changes since V3: > > > Invoking sdhci & cqhci resume if sdhci_host_suspend fails. > > > Removed condition check before invoking cqhci_resume since its a dummy function. > > > > > > Changes since V2: > > > Removed disabling/enabling pwr-irq from system pm ops. > > > > > > Changes since V1: > > > Invoking pm_runtime_force_suspend/resume instead of > > > sdhci_msm_runtime_suepend/resume. > > > diff --git a/drivers/mmc/host/sdhci-msm.c b/drivers/mmc/host/sdhci-msm.c > > > index 3955fa5d..3559b50 100644 > > > --- a/drivers/mmc/host/sdhci-msm.c > > > +++ b/drivers/mmc/host/sdhci-msm.c > > > @@ -2159,9 +2159,52 @@ static __maybe_unused int sdhci_msm_runtime_resume(struct device *dev) > [...] > > > + > > > + ret = sdhci_suspend_host(host); > > > + if (ret) > > > + goto resume_cqhci; > > > > sdhci_suspend_host() can't be called on a device that has been runtime > > suspended, as that would lead to accessing device registers when > > clocks/PM domains are gated. > > > > Depending on how the corresponding cqhci device is managed from a > > runtime PM point of view, it could also be problematic to call > > cqhci_suspend(). > > There seems to be another patch floating around here[1] that is an > attempt at a fix to this patch. They should probably be combined so that > it's not confusing what's going on. Yeah, it would be easier if these are discussed together. > > > > > > + > > > + 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? > > > > like disabling controller, disabling card detection, enabling wake-up events. > > [1] https://lore.kernel.org/linux-arm-msm/1583322863-21790-1-git-send-email-vbadigan@codeaurora.org/ Kind regards Uffe