Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp3419016ybb; Mon, 6 Apr 2020 08:35:29 -0700 (PDT) X-Google-Smtp-Source: APiQypJVnGU1wleKt5942MHyp0t3C+fq298S3sm+thmMnSLsxZxikWqWO5vaWvVr/f2LRO5Rc69q X-Received: by 2002:aca:130d:: with SMTP id e13mr13537303oii.98.1586187329770; Mon, 06 Apr 2020 08:35:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1586187329; cv=none; d=google.com; s=arc-20160816; b=eTJSHBG6PY4rHnNsrEkk06uOmEAmVHMSRo8+0zvsNvcPxT1UiANBYDMshuCTBEiNJx 2Z3T8qH5Nj8gDnvXOiftcXkClMl4voVkzPAduLEzwR3sXr6ztZsX/3CK3aVU/rIlLtaL ViZ4ufxWribGlzyxv4758jPq/ijCR8DgexswzpGx0NzTFjCFHyvWQmKvMxsl6/ZfkuT/ uqCFOO23reYXeeB1p7RC57vC2vmeJbtebXt7fss10K5WMLAk8wDOsGG6/AV026SlmV2b 0Xq6nGBxouDJI+W1dNYwBXnS4ZH9iRU0LFOmIwRJec4mP6x+b+DW2VCRvaKiTnlMtwAJ mELg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=9cMvg7h/oulOhGRqUiRCctY34trH980/U/Kq5XqfKrw=; b=Cz2iLnUFpgsuBgfQy9gpmpdwsopcE20B3vv5e1BB9pjEHK/KMdKzKi74EnCMeB9FKc VdEWR2Hq75IBj7WrlRQjaO3cmLubvti8iAtqljmPHQ21oBnQeiuLahJe5JVNIzYfypiw Epske1AR5hNAsSfYs0nqkN49k4z3s1QQjEDDoApPGjuJgZfWR321kBfOBrMQebfiCva3 cZaLrfIP4dNVfirhKKB06dvsQIdZ45tTd453ya5473moSIJE8t+vdXV887iHJfyfeL43 oFY6CTJNlxq0SpPMy383aV7kRykJpCb+sDgaeUH+YMsRQzbyCncASSS2p0O53rrsCIhO 9MhA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=E0DvGB4h; 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 30si7923010oth.68.2020.04.06.08.35.06; Mon, 06 Apr 2020 08:35:29 -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=E0DvGB4h; 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 S1728975AbgDFPeP (ORCPT + 99 others); Mon, 6 Apr 2020 11:34:15 -0400 Received: from mail-vs1-f65.google.com ([209.85.217.65]:35345 "EHLO mail-vs1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728792AbgDFPeP (ORCPT ); Mon, 6 Apr 2020 11:34:15 -0400 Received: by mail-vs1-f65.google.com with SMTP id u11so99489vsg.2 for ; Mon, 06 Apr 2020 08:34:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=9cMvg7h/oulOhGRqUiRCctY34trH980/U/Kq5XqfKrw=; b=E0DvGB4hrP97mss+BsJg46f1cmsxu437DfT1QJitEIvdJiVPNsiOco+dY5/jRQAV/D IJNRoFnMdOoGbnrlvm3TqWUo79zzcAE49wFNBdiONcfRXyfP6ckrH/oUSV6HAiQNbJYy cXLsNIH66kgWP2PmQG/RhlOhDCsS1MW4gKPx8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=9cMvg7h/oulOhGRqUiRCctY34trH980/U/Kq5XqfKrw=; b=DkoHGOQH/aHneXCbQwLotQDYGd7vBRvwj9fABfQtwBUfEaf+LZofNpaVGMLeJT7sMf vsJ6eLAhjL5jr9ujQbc4nWzjcZF9t0DJnuad1OOviyPZ0EECethBV/N0KBp/0++D8VIP t73e4BHr1oCmo8ff+c7YrvRB17oztWrqUtUJ2HxwZFYiI2hLOYtJbfWMNkXg3RtxuhMH lgc3lJtC8KYHciklIWE6ht3z/XjQ/Cjr6TswuitldPZFxvmJewK2dVTWeOXrj+BEtrHf 9hJlYKankFiBCDZVDCthCa5BKPpCbDj8h+Ogp505fBPGn/1QA92Lc8ctNXbQxnwoQKXV GWww== X-Gm-Message-State: AGi0PuZsQeyR3X9UKC98Mm3iWT10HyEHRNUkitxfX+2btaAcIxbScpST 3oRt//ebKpL+uBWURb+UL0IxBpOit2k= X-Received: by 2002:a05:6102:3104:: with SMTP id e4mr155859vsh.61.1586187251980; Mon, 06 Apr 2020 08:34:11 -0700 (PDT) Received: from mail-ua1-f51.google.com (mail-ua1-f51.google.com. [209.85.222.51]) by smtp.gmail.com with ESMTPSA id s186sm4707335vkg.2.2020.04.06.08.34.10 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 06 Apr 2020 08:34:10 -0700 (PDT) Received: by mail-ua1-f51.google.com with SMTP id l18so83671uak.4 for ; Mon, 06 Apr 2020 08:34:10 -0700 (PDT) X-Received: by 2002:ab0:1d10:: with SMTP id j16mr26743uak.91.1586187250041; Mon, 06 Apr 2020 08:34:10 -0700 (PDT) MIME-Version: 1.0 References: <1585660782-23416-1-git-send-email-mkshah@codeaurora.org> <1585660782-23416-7-git-send-email-mkshah@codeaurora.org> <855bb87e-6c5c-8fee-e237-f48f9d95e2ac@codeaurora.org> In-Reply-To: <855bb87e-6c5c-8fee-e237-f48f9d95e2ac@codeaurora.org> From: Doug Anderson Date: Mon, 6 Apr 2020 08:33:58 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v15 6/7] soc: qcom: rpmh-rsc: Clear active mode configuration for wake TCS To: Maulik Shah Cc: Stephen Boyd , Evan Green , Bjorn Andersson , LKML , linux-arm-msm , Andy Gross , Matthias Kaehlcke , Rajendra Nayak , Lina Iyer , lsrao@codeaurora.org, "Raju P.L.S.S.S.N" Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, On Sun, Apr 5, 2020 at 10:08 PM Maulik Shah wrote: > > Hi, > > On 4/3/2020 1:44 AM, Doug Anderson wrote: > > Hi, > > > > On Tue, Mar 31, 2020 at 6:21 AM Maulik Shah wrote: > >> @@ -243,6 +279,14 @@ static irqreturn_t tcs_tx_done(int irq, void *p) > >> } > >> > >> trace_rpmh_tx_done(drv, i, req, err); > >> + > >> + /* > >> + * If wake tcs was re-purposed for sending active > >> + * votes, clear AMC trigger & enable modes and > >> + * disable interrupt for this TCS > >> + */ > >> + if (!drv->tcs[ACTIVE_TCS].num_tcs) > >> + __tcs_set_trigger(drv, i, false); > > Still seems weird that we have to do the untrigger in the IRQ routine > > here and also weird that we _don't_ do it in the IRQ routine for > > non-borrowed TCSes. I guess it's not the end of the world, though. > > > > Reviewed-by: Douglas Anderson > > Thanks Doug for the review. > > IRQ is only needed to be enabled for TCSes used as ACTIVE_TCS. > > When we have dedicated ACTIVE_TCS, we leave IRQ always enabled from > probe (one time configuration), since the TCS won't be used for anything > other than to send ACTIVE transaction. > > When we don't have dedicated ACTIVE_TCS, we enable it when borrowed TCS > is used for ACTIVE transaction and then once its done using it, we > disable it again to leave it in its original configuration. Sure, I get the concept. ...but: * It seems like it would be ideal to not call __tcs_set_trigger() from the IRQ handler. It uses write_tcs_reg_sync() which has a wait loop in it. That's not something you normally want in an IRQ handler. * It seems like it would be a common case for the WAKE_TCS to be borrowed several times in-between actually using it as a WAKE_TCS. To make both of the above things better, it seems like you could just leave the WAKE_TCS configured for active-mode transfers and just switch all that stuff off when you actually need it as a WAKE_TCS. To some extent we could conceptually re-envision this and think of this as being the ACTIVE_TCS that is occasionally borrowed to make up for not having a WAKE_TCS. In any case, I think the patch you have right now is good enough and it feels like it's overdue to land this series. I'd suggest against spinning at this point. Maybe we can try to improve this in a future patch after your series lands. -Doug