Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp820848ybz; Fri, 24 Apr 2020 09:49:18 -0700 (PDT) X-Google-Smtp-Source: APiQypLwYMGMQYxybsWrulxizWnn8UFSp8l4YsybmPzyVOJC3WSo5kSivrXmiAmopTRCnx6s+Qbm X-Received: by 2002:a05:6402:3076:: with SMTP id bs22mr8562591edb.112.1587746958149; Fri, 24 Apr 2020 09:49:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1587746958; cv=none; d=google.com; s=arc-20160816; b=yRQlcGw5NBcuyDx6iUdkqytbbyiHLs58o9yAnN7eW81z+N40GimSL704tbLstl4VBf 3bKBP6cbKo3Vnv2lEKzs5ZyG9Q9rj4/pCeiQxEv2GSUSA9FNeJDX1VinzqH2DEtY5wxl Uf4RWM0W4UveyiZayEDSIuJ8XSKPiIiYeMpzmjf5ojSM+mBM53sUPdfMPrC+53u+ObLT deDmkFVYIcmSNrON6YIXV6hDw3YavndFGTxet77AqJLiKmrf+UaTcLi+nSZ53xGEfUpc UehpAnhlfq1HImqJ7ZTINGWzZlX7p13OVpYyRKaOkaQ/6Yyj76Qy7AOsVXpgG9K1az5s 9r6g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=8LMkNBqXB+CeQceWfD+1N1s9IOWokLMqWssX/DZezGQ=; b=JJ6TVnkTBvr+hqjQLN0dJoWB5CVig9+wY9UEidaCBCbc1eqavxMYYSwQ+3ISh2XZT3 83deFRPrlUXG8fIvJfJedUIrT0kzLS4oqtLkAvpsMl/3PHOSdK3wg2GXxU7Wfk7kwO5+ C3ZAWYp2v+4/cLesSLD7BKflouJAodM3fLrOa5S0eJK7RxdKdEsqkUfPSrsX64n9D9WE Vdg35mRJMMJJcoFPAmrV+IgF67V7ds+YIWhKLuYWiJJry5zBs2nAGEt4MNIUc41KJJLe IkVSlW9724RPsx7H+HTV8jviLIXhTmwifbhasuc0XStI8UbAhlkUaZwfuxv3e8bRh4x3 fbYQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=QsUZIst0; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id w16si3404386edq.89.2020.04.24.09.48.54; Fri, 24 Apr 2020 09:49:18 -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=pass header.i=@chromium.org header.s=google header.b=QsUZIst0; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728435AbgDXQrU (ORCPT + 99 others); Fri, 24 Apr 2020 12:47:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36428 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726698AbgDXQrT (ORCPT ); Fri, 24 Apr 2020 12:47:19 -0400 Received: from mail-pg1-x542.google.com (mail-pg1-x542.google.com [IPv6:2607:f8b0:4864:20::542]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6774AC09B046 for ; Fri, 24 Apr 2020 09:47:19 -0700 (PDT) Received: by mail-pg1-x542.google.com with SMTP id d17so4897304pgo.0 for ; Fri, 24 Apr 2020 09:47:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=8LMkNBqXB+CeQceWfD+1N1s9IOWokLMqWssX/DZezGQ=; b=QsUZIst0n7NitTwTbPskwHB/A9M3npMfgM+TRceAN2YLnBjo7TiuFLgIDIAlNhloZQ Hhw57EsdqXMyumDsh1p+qtH9Zn5ICKQGQ58SLXj71jnWAYQwMA/6Pufm5DvprHi4Cef4 rH4sHfsgJYbQ0P7x2TuhVvmMmpEyWPlY6KftQ= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=8LMkNBqXB+CeQceWfD+1N1s9IOWokLMqWssX/DZezGQ=; b=kn+S/KMJ2ILZdCOQR+MEYYhfaSOK/tjvewuecDEqk4NQLJGoWVsux2WX9e7YbdbU5U a6I6v0HOrvSwS5q6alOzopxLwD8Et/jux1rZf6ZPYaGh2UMtk4u2szLOnvWPzS7UZHk2 sut6Hby0SwgaKTSlRFK0pKvsv4jrWYWCI5ou5X/dYQwyHT5fAA9ityeguUfg50nfop0q jOkCT590hHxrIOrERHzwtroQlMnIfEGyhhsfZof1geoC/whV9PotBY3liRL4XA2zWSUi 2Biqx8bqXgON/4tj+p/5d2C9DQnE2zYuI7k5w0cMqHM0S/Ct/A9PF62vOdskuNg/gRbL AYyw== X-Gm-Message-State: AGi0PuZC3DGAKeYFSKXfxdYDPHy2Je0qFK8yZqAD6lPPVOdcYCYaDVTk EHNvadUjvI6Gi2V1cIjjHPEJkj0FUHrbVg== X-Received: by 2002:a63:f30a:: with SMTP id l10mr10233893pgh.372.1587746838702; Fri, 24 Apr 2020 09:47:18 -0700 (PDT) Received: from tictac2.mtv.corp.google.com ([2620:15c:202:1:24fa:e766:52c9:e3b2]) by smtp.gmail.com with ESMTPSA id r28sm6319205pfg.186.2020.04.24.09.47.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Apr 2020 09:47:17 -0700 (PDT) From: Douglas Anderson To: Greg Kroah-Hartman , rafael.j.wysocki@intel.com, Andy Gross , Bjorn Andersson Cc: evgreen@chromium.org, mka@chromium.org, mkshah@codeaurora.org, swboyd@chromium.org, Douglas Anderson , linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v5 1/5] soc: qcom: rpmh-rsc: Correctly ignore CPU_CLUSTER_PM notifications Date: Fri, 24 Apr 2020 09:46:53 -0700 Message-Id: <20200424094610.v5.1.Ic7096b3b9b7828cdd41cd5469a6dee5eb6abf549@changeid> X-Mailer: git-send-email 2.26.2.303.gf8c07b1a785-goog MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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; } ret = rpmh_rsc_ctrlr_is_busy(drv); -- 2.26.2.303.gf8c07b1a785-goog