Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp3277350ybz; Sun, 3 May 2020 22:56:59 -0700 (PDT) X-Google-Smtp-Source: APiQypJZietbyJWynIPO7WQA2uIwVykI0ATePS3H1E14g5/oSMnYFQOkiHl5MiCHeTNi8NaK+r8v X-Received: by 2002:a17:906:78c:: with SMTP id l12mr12658250ejc.189.1588571819090; Sun, 03 May 2020 22:56:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588571819; cv=none; d=google.com; s=arc-20160816; b=G7rH73O9502HL58Ir6qjNxi4nEjr8C7L6gfgep4rfAzA/rMKz/yMH6KvTsk/HoC48c ZIcecmO5F5xkV2XofSgRLvq5Z5xxn2aKSRQcWnRBxIwEHKa5F0Ld6nbeWNG5io611JMR J3lo4kiCCPPKWCE4LemOpvW9okulrrnOvOQxNLyPOlXgieInZsbMTB8dxbHEETH+12he RgpDw0fp7qjiP9XuIle0GR4up6Zsl43/Xlo43XT95+detxYP9CT0BnV6kp0lMkracC1v ReBNQ+xZOVzGKRvnqYvUDe5QXazXU6z+5pb8h65KVg8y7zSZo0zj85Qfq0xtqDHtVyrH 9kfQ== 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=MxVD4lIGNr5TTM6n/CVOQaK8MEvwp2IKXE3ld2sTRzw=; b=f6TqR6nnWJ4X/4bqgxRwJ+Igi0BQZsL8zg+QMIUyxY7uO6Kq1cptr9LPFwYGmtZmsP zBYrBRd9qUGTg6iu0VGTiseKkvkjWN1Ml/C/m3j9pox8KzABt/6FHpGZqb64Lo2QB+Rn hpjesXdrWC/oC1oi+0sJaK7Dyx3uaxOCqS3cztlVU3gKpQ65fGYCMDRGrOY+DC/qtn42 6pRTpBEHaSb/duyq00EFkE9vHRnvKUWYXLiRsqSWFkGmtdl09/eeee4TtmY26eV7xXYX mQwWAEVJlPjmxBQY+xaT6DSRxSp6FhMzUTgILS9SEe3XAJoF+dA2ZHlRxJLfP3wavWOk KQiw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@mg.codeaurora.org header.s=smtp header.b=cfZRFvM3; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id v28si5841384edb.497.2020.05.03.22.56.36; Sun, 03 May 2020 22:56:59 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=fail header.i=@mg.codeaurora.org header.s=smtp header.b=cfZRFvM3; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726937AbgEDFTm (ORCPT + 99 others); Mon, 4 May 2020 01:19:42 -0400 Received: from mail27.static.mailgun.info ([104.130.122.27]:60963 "EHLO mail27.static.mailgun.info" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726509AbgEDFTl (ORCPT ); Mon, 4 May 2020 01:19:41 -0400 DKIM-Signature: a=rsa-sha256; v=1; c=relaxed/relaxed; d=mg.codeaurora.org; q=dns/txt; s=smtp; t=1588569581; h=Content-Transfer-Encoding: Content-Type: In-Reply-To: MIME-Version: Date: Message-ID: From: References: Cc: To: Subject: Sender; bh=MxVD4lIGNr5TTM6n/CVOQaK8MEvwp2IKXE3ld2sTRzw=; b=cfZRFvM3WHNdSPUVFVGr1EiMNfqB7QUX10a4vhlO6XZp+UwGKPft7p2TCY1Y2jPl1jK2i26Q /ZptJS3+59o4F/92rag+r1f1l+9JFGyk5UgRc074+C9QcYPn/dDQJi1jDATwStUjpCQg4K0a DQIjVOD/ENLQ6MwOP5HSNuRKSWQ= 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 5eafa5e5.7efd188171f0-smtp-out-n02; Mon, 04 May 2020 05:19:33 -0000 (UTC) Received: by smtp.codeaurora.org (Postfix, from userid 1001) id 64BB9C433D2; Mon, 4 May 2020 05:19:33 +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 autolearn=unavailable autolearn_force=no version=3.4.0 Received: from [192.168.43.137] (unknown [106.213.157.33]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: mkshah) by smtp.codeaurora.org (Postfix) with ESMTPSA id 825AAC433CB; Mon, 4 May 2020 05:19:27 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 825AAC433CB 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=mkshah@codeaurora.org Subject: Re: [PATCH v5 1/5] soc: qcom: rpmh-rsc: Correctly ignore CPU_CLUSTER_PM notifications To: Douglas Anderson , Greg Kroah-Hartman , rafael.j.wysocki@intel.com, Andy Gross , Bjorn Andersson Cc: evgreen@chromium.org, mka@chromium.org, swboyd@chromium.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org References: <20200424094610.v5.1.Ic7096b3b9b7828cdd41cd5469a6dee5eb6abf549@changeid> From: Maulik Shah Message-ID: Date: Mon, 4 May 2020 10:49:24 +0530 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.7.0 MIME-Version: 1.0 In-Reply-To: <20200424094610.v5.1.Ic7096b3b9b7828cdd41cd5469a6dee5eb6abf549@changeid> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-GB Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, On 4/24/2020 10:16 PM, Douglas Anderson wrote: > Our switch statement doesn't have entries for CPU_CLUSTER_PM_ENTER, > CPU_CLUSTER_PM_ENTER_FAILED, and CPU_CLUSTER_PM_EXIT and doesn't have > a default. This means that we'll try to do a flush in those cases but > we won't necessarily be the last CPU down. That's not so ideal since > our (lack of) locking assumes we're on the last CPU. > > Luckily this isn't as big a problem as you'd think since (at least on > the SoC I tested) we don't get these notifications except on full > system suspend. ...and on full system suspend we get them on the last > CPU down. That means that the worst problem we hit is flushing twice. > Still, it's good to make it correct. > > Fixes: 985427f997b6 ("soc: qcom: rpmh: Invoke rpmh_flush() for dirty caches") > Reported-by: Stephen Boyd > Signed-off-by: Douglas Anderson > Reviewed-by: Maulik Shah > Reviewed-by: Stephen Boyd > --- > > Changes in v5: > - Corrently => Correctly > > Changes in v4: > - ("...Corrently ignore CPU_CLUSTER_PM notifications") split out for v4. > > Changes in v3: None > Changes in v2: None > > drivers/soc/qcom/rpmh-rsc.c | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/drivers/soc/qcom/rpmh-rsc.c b/drivers/soc/qcom/rpmh-rsc.c > index a9e15699f55f..3571a99fc839 100644 > --- a/drivers/soc/qcom/rpmh-rsc.c > +++ b/drivers/soc/qcom/rpmh-rsc.c > @@ -806,6 +806,8 @@ static int rpmh_rsc_cpu_pm_callback(struct notifier_block *nfb, > case CPU_PM_EXIT: > cpumask_clear_cpu(smp_processor_id(), &drv->cpus_entered_pm); > goto exit; > + default: > + return NOTIFY_DONE; I noticed a bug here, Either need to unlock and return here. + default: +               ret = NOTIFY_DONE; + goto exit; Or If you move this patch at the end of series, it should will work fine as is. Since in patch 5 of this series,  pm_lock is removed, so return NOTIFY_DONE; do not any unlock. When i pulled in only first two changes in this series i got spinlock recursion during suspend-resume. Back when i pull in entire series for validation, the issue do not come because last patch removes pm_lock. Thanks, Maulik > } > > ret = rpmh_rsc_ctrlr_is_busy(drv); -- QUALCOMM INDIA, on behalf of Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, hosted by The Linux Foundation