Received: by 2002:a25:c205:0:0:0:0:0 with SMTP id s5csp5722250ybf; Thu, 5 Mar 2020 05:58:33 -0800 (PST) X-Google-Smtp-Source: ADFU+vtmln4tQtPrduPLbg2/ETTvW/KqtqkcsH46XBdC5rsApwVy4MM7Hv/YKK8rl31uip9VYDow X-Received: by 2002:a9d:740d:: with SMTP id n13mr6928207otk.140.1583416713127; Thu, 05 Mar 2020 05:58:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1583416713; cv=none; d=google.com; s=arc-20160816; b=hSOVfBfXtVLqqJZmLvLmZw9S3zuApjT66Lzuhg4EiGubO+mK3588w+kBk6W+hBZgql dXq2TfeIKkrJxRhhyORSTO+rDpUOz9bMo8EfUJgQKrUwb6R7Xc402WEAsEI1SsD3A7ds 2u62yqFjmCzJ/PwAuqrBvKMy+JIxvLGlu1PG8dW6Tl64f5q+RvCkG4S59el8OndBh3Ec rg6B8aU0Ds4Fb5rN8c6dgazbckoGxNoo8C65bYxRElLQ0eQ4bzYsArgL7r9PYaEtJibl HchhQOufT6I7bsPfPUQohlFnSuIdXlpXxo/xnD+COD71LvO1Mfi4z8WdUkECH3NyaMVY E0Ug== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-language :content-transfer-encoding:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dmarc-filter :dkim-signature; bh=zOieWkAjoEw8P19n/t7PzYyxX8NrouzGC34JBMcgWuQ=; b=i94Minv4VW2Ax/cYkMBEnRXxR1FVVDJVPuOykwGH4UuB+zhA7Q6gdC1kbt5z5HsDHF c9W2w0nq1bg4XKBzDaxr42Q5Njv4Pxjj6wCj3C33R+/ueHQPvsBrhm7gerwdtZz52lgM tgjPifPvcC4dhIy0jKQp6A4Wyzq4RIAOi2H+eL+8RS3nFFHM1ngO4TyLb8/xjiseDEKT 8FDjz90vBz0MNTvFqTBUI9jUNYxei7fyoArVi6Mlhl/juvvcnuetELKMBE6LQrXZLiZ4 VQyJAGRKKeuTEHB/bdL9ziXaywq7EakceCL9UHeWAi3P83fxbVFb98zPJ7MiwoOI94Lr +K5Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@mg.codeaurora.org header.s=smtp header.b="Oeu+u/K9"; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l25si3586255otq.76.2020.03.05.05.58.20; Thu, 05 Mar 2020 05:58:33 -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=fail header.i=@mg.codeaurora.org header.s=smtp header.b="Oeu+u/K9"; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726259AbgCEN5N (ORCPT + 99 others); Thu, 5 Mar 2020 08:57:13 -0500 Received: from mail27.static.mailgun.info ([104.130.122.27]:33807 "EHLO mail27.static.mailgun.info" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726209AbgCEN5N (ORCPT ); Thu, 5 Mar 2020 08:57:13 -0500 DKIM-Signature: a=rsa-sha256; v=1; c=relaxed/relaxed; d=mg.codeaurora.org; q=dns/txt; s=smtp; t=1583416632; h=Content-Transfer-Encoding: Content-Type: In-Reply-To: MIME-Version: Date: Message-ID: From: References: Cc: To: Subject: Sender; bh=zOieWkAjoEw8P19n/t7PzYyxX8NrouzGC34JBMcgWuQ=; b=Oeu+u/K9+4A0n+03x8XwiMwLk1jZg7UOW1a3l66pEbCBQLH3kBxn3I/J4lKaYgxCgszODszw huET20BZJUdXLZNcO1nN5i+SImvd+PcgNSjovke4+qDmxUXML75CKcymzBMPZ3JUe0qwmbCt Q7B17mBk+I5RlqwAFycMo+M+HqM= X-Mailgun-Sending-Ip: 104.130.122.27 X-Mailgun-Sid: WyI0MWYwYSIsICJsaW51eC1rZXJuZWxAdmdlci5rZXJuZWwub3JnIiwgImJlOWU0YSJd Received: from smtp.codeaurora.org (ec2-35-166-182-171.us-west-2.compute.amazonaws.com [35.166.182.171]) by mxa.mailgun.org with ESMTP id 5e610531.7f1308bc18f0-smtp-out-n03; Thu, 05 Mar 2020 13:57:05 -0000 (UTC) Received: by smtp.codeaurora.org (Postfix, from userid 1001) id 35012C433A2; Thu, 5 Mar 2020 13:57:04 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-caf-mail-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.0 required=2.0 tests=ALL_TRUSTED,SPF_NONE, URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.0 Received: from [10.206.25.140] (blr-c-bdr-fw-01_GlobalNAT_AllZones-Outside.qualcomm.com [103.229.19.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: vbadigan) by smtp.codeaurora.org (Postfix) with ESMTPSA id 20689C43383; Thu, 5 Mar 2020 13:56:56 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 20689C43383 Authentication-Results: aws-us-west-2-caf-mail-1.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: aws-us-west-2-caf-mail-1.web.codeaurora.org; spf=none smtp.mailfrom=vbadigan@codeaurora.org Subject: Re: [PATCH V4] mmc: sdhci-msm: Update system suspend/resume callbacks of sdhci-msm platform driver To: Stephen Boyd , Shaik Sajida Bhanu , Ulf Hansson Cc: Adrian Hunter , Rob Herring , Matthias Kaehlcke , Asutosh Das , Sahitya Tummala , Sayali Lokhande , cang@codeaurora.org, Ram Prakash Gupta , "linux-mmc@vger.kernel.org" , Linux Kernel Mailing List , linux-arm-msm , DTML , Andy Gross , Bjorn Andersson References: <1582181100-29914-1-git-send-email-sbhanu@codeaurora.org> <158334039680.7173.16159724456027777605@swboyd.mtv.corp.google.com> From: Veerabhadrarao Badiganti Message-ID: <5f854baa-3bb1-8cea-b605-dfabae8d8b2a@codeaurora.org> Date: Thu, 5 Mar 2020 19:26:54 +0530 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.5.0 MIME-Version: 1.0 In-Reply-To: <158334039680.7173.16159724456027777605@swboyd.mtv.corp.google.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 3/4/2020 10:16 PM, 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. The other fix is altogether different. It is the fix for the issue seen with run-time pm. whereas this change is for system pm. >>> + >>> + 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? > >>> 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/