Received: by 2002:a25:e7d8:0:0:0:0:0 with SMTP id e207csp1039397ybh; Wed, 11 Mar 2020 16:16:01 -0700 (PDT) X-Google-Smtp-Source: ADFU+vsBKfl0ryV7kQ8dXb+B4iCdIM46z3SeMq5lvt1jOrIGZZtdh+wFiY+NmsX3QY8DZqOxuHi4 X-Received: by 2002:a05:6830:2157:: with SMTP id r23mr4143289otd.98.1583968560883; Wed, 11 Mar 2020 16:16:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1583968560; cv=none; d=google.com; s=arc-20160816; b=nluA85XhYMKnOsVFhpA/P8T4BzttSbODEx5dPfN/LcTojBy0sQ+qrqT7xJ5jR7LLdW Lt/CL6RTrd7qCbbpChJHWDJ+VQ6syjaC1aED04o04YyX7it0u94kZV8JiFMyhrMX4UB/ +Q5Wd1bUPdvs7KPwXFzPZR+iEGu8/ydE7TDZ+1l83xWwex3sqGvioxxx6K22vybl3LMF cUR7nJmmbAwZz6toqvamlohP6C4/7TVOAiDhmA2SJ8TWAQNtts3SBwt0quNQSvhjdjAX EyCmQmeGuzWgcdp2KslqZvMCrA5/O9R3T9xdRf6RAT3w1wH4coSnmdvoR8yVnEvtW2lN uUFw== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=mCMQ2OChqTGNObRkFX9H0wPC+5YSQubFFV/J730ew5s=; b=QO3/YbNP0Gm4kZfV0Hd3BujbaPpdO0qvM2FJk+2bQble9/tB7M6YYS/plv5sBcKhlO 9Y//t+apenmXHb2rzVaGveAEax0FXnhEKLPQReCi3g+P82GPs5gjvmrhKNiVmrLh8udX B9YptpGt4SD+PECPe/yAlHgMdwNCHwakXJ8VE/uCkZD5/f3OwqQyOSA3/IfZvZCAAmUF H8j2MtXOBhU0AjQol9Re5te2QQF7fN01HtrGeVVIOpV1Hf3O85wVJxdG9Et5Mj5+BzFq qcxJ6bcJM0KvtzT/ol8+IKK9KROK53YgnTZedBkOy0QhqFW/JvyWgbEfPsUv517HxuB3 QS4Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=jRtnocXH; 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=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 2si1686775oix.27.2020.03.11.16.15.45; Wed, 11 Mar 2020 16:16:00 -0700 (PDT) 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=@chromium.org header.s=google header.b=jRtnocXH; 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=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731545AbgCKXO2 (ORCPT + 99 others); Wed, 11 Mar 2020 19:14:28 -0400 Received: from mail-pf1-f196.google.com ([209.85.210.196]:42241 "EHLO mail-pf1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731503AbgCKXOV (ORCPT ); Wed, 11 Mar 2020 19:14:21 -0400 Received: by mail-pf1-f196.google.com with SMTP id x2so1840998pfn.9 for ; Wed, 11 Mar 2020 16:14:21 -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:in-reply-to:references :mime-version:content-transfer-encoding; bh=mCMQ2OChqTGNObRkFX9H0wPC+5YSQubFFV/J730ew5s=; b=jRtnocXHHMUP3D+7tOmcprsy5ijnwFjDJ2i50lUH6gswsfBQnvJKVqfR5jpnGxFwWA ce1P1tv5x9Mli/4UNjaB5lE2ae20TKIRXhYPr4twa0iJ1ggbqNqpwjBcmQ2OG/7ZBSjR 1y1aCxYUhYpaVcihAXvzY+Ycp2e/5Am4O665o= 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=mCMQ2OChqTGNObRkFX9H0wPC+5YSQubFFV/J730ew5s=; b=mxgPpXaHQO/3lJUhxV7/pNXb7B/kC9l0iCQsMjCXm1jU3+2OrnnEUlfA/JOGONBTDh K3hMXFaqTrmXlw1YmfK59Og8/Mo2u8fV6wB4pDbTv2yZQH3Z+esuO9m39UHQDfkvgJEa jJ/utHcqb49i39z0ikdgE74HXedD8XIy7+VIJMjKKyO7Koe3PfhhSh7bZboIjCfQX8Z/ 6Am7TlUHk91Dcr+g7Eiz/oMteG7df90khcGwObr/hliBLl4bO+wh0Aw1lMlHGT2um5Us V1SbvSbBfiR/Em/XLnIt2VIXyqCIwdwE7V+a4SR0eDwLhDckwmk0Np6Tv7BhgNzse5ax vxxA== X-Gm-Message-State: ANhLgQ1MzpiVkO84Dtc5OWrgZfvBun+y+xfTj38+UFW/tUDwREhx5mnw Dwfkdvh+WdTtmTHAESUAZpSVSJe3pik= X-Received: by 2002:a63:4555:: with SMTP id u21mr4952213pgk.66.1583968460689; Wed, 11 Mar 2020 16:14:20 -0700 (PDT) Received: from tictac2.mtv.corp.google.com ([2620:15c:202:1:24fa:e766:52c9:e3b2]) by smtp.gmail.com with ESMTPSA id g75sm2606334pje.37.2020.03.11.16.14.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 11 Mar 2020 16:14:20 -0700 (PDT) From: Douglas Anderson To: Andy Gross , Bjorn Andersson , Maulik Shah Cc: mka@chromium.org, Rajendra Nayak , evgreen@chromium.org, Lina Iyer , swboyd@chromium.org, Douglas Anderson , linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [RFT PATCH v2 07/10] drivers: qcom: rpmh-rsc: Warning if tcs_write() used for non-active Date: Wed, 11 Mar 2020 16:13:45 -0700 Message-Id: <20200311161104.RFT.v2.7.I8e187cdfb7a31f5bb7724f1f937f2862ee464a35@changeid> X-Mailer: git-send-email 2.25.1.481.gfbce0eb801-goog In-Reply-To: <20200311231348.129254-1-dianders@chromium.org> References: <20200311231348.129254-1-dianders@chromium.org> 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 tcs_write() is documented to only be useful for writing RPMH_ACTIVE_ONLY_STATE. Let's be loud if someone messes up. Signed-off-by: Douglas Anderson --- Changes in v2: None drivers/soc/qcom/rpmh-rsc.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/soc/qcom/rpmh-rsc.c b/drivers/soc/qcom/rpmh-rsc.c index 93f5d1fb71ca..ba489d18c20e 100644 --- a/drivers/soc/qcom/rpmh-rsc.c +++ b/drivers/soc/qcom/rpmh-rsc.c @@ -573,6 +573,12 @@ static int tcs_write(struct rsc_drv *drv, const struct tcs_request *msg) unsigned long flags; int ret; + /* + * It only makes sense to grab a whole TCS for ourselves if we're + * triggering right away, which we only do for ACTIVE_ONLY. + */ + WARN_ON(msg->state != RPMH_ACTIVE_ONLY_STATE); + /* TODO: get_tcs_for_msg() can return -EAGAIN and nobody handles */ tcs = get_tcs_for_msg(drv, msg); if (IS_ERR(tcs)) -- 2.25.1.481.gfbce0eb801-goog