Received: by 2002:a25:c205:0:0:0:0:0 with SMTP id s5csp6665512ybf; Fri, 6 Mar 2020 02:08:53 -0800 (PST) X-Google-Smtp-Source: ADFU+vuoKYaVfQeP4WIa05U8HJvaX7Akgfww5KYgiIk03crah/+XhBm+vkv8FfCeCoGY17nArJ5z X-Received: by 2002:a05:6808:6cd:: with SMTP id m13mr1959314oih.53.1583489333413; Fri, 06 Mar 2020 02:08:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1583489333; cv=none; d=google.com; s=arc-20160816; b=EAq7F8WHtCFI/mmBDpmoCpa97oOOmPuRtUTX17TD6J21X4szEdoKMhjVwmH8HISixg j5eSDS92gRuK2cSOef8Uh5Ex7g5W9eLiFyWBtPtzuYYAJ1IzWswJzWh9OCnG4c6PvBND +lWZ6lk8hOr7D62WhTRCp8yCmBLZsY1LEvY7HYe55J2iyIXpx7f+RHauue24pN20OmpF RNB1EM93reaIwpnyGDapIZorwJnj18BxvmLD3hf8R1bkiICgkkqSI3ut4a9rJVfIzB2t QbqTHM4R3Gq5Ktq/H9hAwSKOONVAmlwNE8JurqR86sQ2+kg0azTHnzSaKLOFS2YqVlu6 3q5w== 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=uNKCod9HWXu3nxzrNq2A6yL231Mu94A886+59BwdSMs=; b=udRKUzoFJlcH5iUtxs86crJ5kjN0lWVh5CZA1yFVByPYVx3Z0KjmAsOGur4wIQ1T8U 0TZz5EXAfEQURox38oerG3DVc+mb095XzHspH1y1m8yhpgPerLDZ6EbdEkdV/e/NtHfC cx0o018OEwO9taIB6ebp5/DcSU/X91MqOERwzelPp1WDhclZcH32oW33M53PpIt/5hib xuAtgyEHdm/J5GqDuruqyDnXRpHcICi+qqWTx/H5wsjWhsWpP/j/hUHPYcUAr7j2gXLC YLq4rcgSSvMeAGbMFXiTxMmeD88Sf/DVeuCNMTPsG/kt3XRWuPFXND03roDTpJJXNooA DmmQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=nEcPiVzX; 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 j68si1203459otj.56.2020.03.06.02.08.41; Fri, 06 Mar 2020 02:08:53 -0800 (PST) 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=nEcPiVzX; 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 S1726300AbgCFKIU (ORCPT + 99 others); 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-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