Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp1163272ybz; Wed, 22 Apr 2020 14:58:04 -0700 (PDT) X-Google-Smtp-Source: APiQypIurF0tEFwiaUGNJ+CkiFoGQJ9ANe8yeWrvwrwX2/u/hQa/9zW35ox/nN0F8pWNiOU1DU3b X-Received: by 2002:aa7:df0a:: with SMTP id c10mr567836edy.306.1587592684419; Wed, 22 Apr 2020 14:58:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1587592684; cv=none; d=google.com; s=arc-20160816; b=pMj2lW2I1b1Fu25PEqfvCUm3eki6t/UthZxVaRMvej1p3KOuYgMc3joUU9rVUIux5e ccNjk25+g6yQMVBRM0wWVwEl9hviwyUpnS0ulBa6CwudC32TTLiv5kBC00Ev/+PyMg5I tnVnNz5jx80Uzm39GG71zSWIo/KiMIkuNJ9lEYPzVqM+3UeerMkU56CCJYHHDjaje/oj fSyaBXChbG5i/9BClAKy0p7DMW68MQFWW4/iTLOodkJ5/S5xC0Jy7ROzSTGBzE0li4dX GuR4BN9dp1/CXCzjhUD8FKRufgDGolCS1ccqB3RvDmobA0z/X46BrDyuuMxDs3V656K2 PJSQ== 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=VcN3ZrHWXlIPIuh298G1lUnACYhPjzKzp7jscayIaS4=; b=dN7hOZaz8WfkMlSDyK/8W294XpneZfX96h5lTh2x3QUZfOByG5uZtP4WJ0+Qqi0Fa5 u6Wu0XzdzDySFgmGgtStMGSBEb1Ltv1rskzhKQl9T8XrkGACYa1nX7dpyeIyFSetbGYx SibRfB/uBPcRU2kNkRX7+dMc8aV/FORKjZjXsngOqtr9HwRtk7vFkujGnqkMd3XyknvX iFtHNjqf4L6Lp5TNwv8BhYmCQYdoMbDtac5KF2BT52XDP6PfCSgqT631EyKpf+0hI/sB bo/HkvIiwiVS8ewztdNHUNbHexivvJ1iFbd1zKKBCUMd59c3S0kB6WwE7z+b7quRLGaP 8ROA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=JG4Xp5iA; 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 j19si252433ejx.382.2020.04.22.14.57.42; Wed, 22 Apr 2020 14:58:04 -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=JG4Xp5iA; 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 S1726100AbgDVVz0 (ORCPT + 99 others); Wed, 22 Apr 2020 17:55:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58550 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726006AbgDVVzZ (ORCPT ); Wed, 22 Apr 2020 17:55:25 -0400 Received: from mail-pf1-x444.google.com (mail-pf1-x444.google.com [IPv6:2607:f8b0:4864:20::444]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 60CD7C03C1A9 for ; Wed, 22 Apr 2020 14:55:25 -0700 (PDT) Received: by mail-pf1-x444.google.com with SMTP id x3so1817784pfp.7 for ; Wed, 22 Apr 2020 14:55:25 -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=VcN3ZrHWXlIPIuh298G1lUnACYhPjzKzp7jscayIaS4=; b=JG4Xp5iAXo+CrWZdn/y4r+OZsOjzrMLbL1ltQWdthqarbD2q+yMDBjC/j/8ONTKO67 izd7bl01J9AylLWiyA8vjPLcbySNq6/vcVFp/ymDArLe3+jWLxvoIZvbXLOiQsHhbcg5 pGgNdAykwkPFFmQVqht88gJI6UEnach0gbPYs= 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=VcN3ZrHWXlIPIuh298G1lUnACYhPjzKzp7jscayIaS4=; b=OSja9xEr4cyPg66zYApYkC9ZpqUwcHXzlzruIrtNDrYcnf0G3oQcXyWXQxY8GyYK6o /n8gpSfqBRcWIDZRDq34Morn4ZXUdxj5cD1vxwHdfptzlhZWCTm/Xpqs6GBhv15pWOOL 39CjNMugmJQXs2V4CtPhxcW4TI2a/0SpO0F3inuBFti2MhwaRomz003V+aqnZnm+URbS E2shiAFRM09J5p4/COogIlLkeY/dwjhzV8cp4G265+FYnMWEISJ+j17UaakEKGnl2CMJ aZSlKKhm5jAiWjkEu4DiK5rDXNkF57RpH7rphW8OKKveSkNTFb4kXz3nyOX3hRhj613L HmmQ== X-Gm-Message-State: AGi0PuY2oSBxhGV/vzWgAga3SlCOVTPi3jmChzETGARMGOg1ydTKN73+ yj2DHi7IpMz11/Ccp51uPcsHUw== X-Received: by 2002:a62:8202:: with SMTP id w2mr594501pfd.117.1587592524740; Wed, 22 Apr 2020 14:55:24 -0700 (PDT) Received: from tictac2.mtv.corp.google.com ([2620:15c:202:1:24fa:e766:52c9:e3b2]) by smtp.gmail.com with ESMTPSA id r4sm211072pgi.6.2020.04.22.14.55.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 22 Apr 2020 14:55:24 -0700 (PDT) From: Douglas Anderson To: Greg Kroah-Hartman , rafael.j.wysocki@intel.com, Andy Gross , Bjorn Andersson Cc: mka@chromium.org, swboyd@chromium.org, mkshah@codeaurora.org, evgreen@chromium.org, Douglas Anderson , linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v4 1/5] soc: qcom: rpmh-rsc: Corrently ignore CPU_CLUSTER_PM notifications Date: Wed, 22 Apr 2020 14:54:59 -0700 Message-Id: <20200422145408.v4.1.Ic7096b3b9b7828cdd41cd5469a6dee5eb6abf549@changeid> X-Mailer: git-send-email 2.26.1.301.g55bc3eb7cb9-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 --- 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.1.301.g55bc3eb7cb9-goog