Received: by 2002:a25:c205:0:0:0:0:0 with SMTP id s5csp492993ybf; Wed, 26 Feb 2020 17:10:12 -0800 (PST) X-Google-Smtp-Source: APXvYqyCf+bP60hePGu5Nky3m7MCpx7v4SEBHZbkKOU6wYNpsLCMwskVoV63LfuJ+YjmggZB9OFF X-Received: by 2002:aca:c1c2:: with SMTP id r185mr1520143oif.19.1582765811995; Wed, 26 Feb 2020 17:10:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582765811; cv=none; d=google.com; s=arc-20160816; b=SBGtFG15wAjU7OkHAjUBqb/x6kWQZhGUrf26H4XYoIbdP3uHv0jb6UlMSy+KO0zAbX TZF6JByZAe4sbmaqssxDkpmh656iLYtTBVfZjtcG85EqY56LL2vdwZ9fgjDMpmq1FTyz 8+Rq6bz7isKGpdfsgf2oDIF8zHfzkkIxZLYt2/f2iMKxelsJbxmVPjcOJOERsn0lDesC PxXB9BAhhZhFBHjK2y8T1RNnIWjAxvVv3vBAYR8c7ODfw0dDfzjvnL1B5eIN0AHdBuyG a8YcgcVbrPfWPmEwGuDtaQmJnDWOi0K5ob81VhTHC8wVsBllyGxwv86EdriRVzg7SZQ9 HRJA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:message-id:references :in-reply-to:subject:cc:to:from:date:content-transfer-encoding :mime-version; bh=ry82SBByw+cqYtzXN+kwtwqWp1azGSM+cXW/RXVbGzg=; b=wPYV/NuiFglsIuolWNb4yYZm71cw8hkrmOIK0o0q1ant1ITCxi7iJfewHMozlOHgYH JhbZVh96td8yzZLovmVN4VDVKWlsP5dTJ/Nw4cVs+FLwQvLy1C6k+WJzfXg0DO0+wy0m O7JyIYnoKEr3R2JU4ZhAtuYgy1qZhDj3agg4+nWBEBAAV2zDT5KUrwgUbwflzmDBCxFD 6Ar3Oe+O3KpM/agK1VhQMWIvJZuRL61KEXE42r07NGdMVAphgS6GYwgfKZl3pHt8dTWq ME0gi/rY2/oZv7tdl+EtjMnRmvorTOVE2b6WZm+Srq7oGv3/M8PNnxi6xnhMHj69a+yv AstQ== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p26si592723oto.240.2020.02.26.17.09.58; Wed, 26 Feb 2020 17:10:11 -0800 (PST) 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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728094AbgB0BJW (ORCPT + 99 others); Wed, 26 Feb 2020 20:09:22 -0500 Received: from disco-boy.misterjones.org ([51.254.78.96]:43698 "EHLO disco-boy.misterjones.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727964AbgB0BJW (ORCPT ); Wed, 26 Feb 2020 20:09:22 -0500 Received: from disco-boy.misterjones.org ([51.254.78.96] helo=www.loen.fr) by disco-boy.misterjones.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1j77fv-008I1Q-2D; Thu, 27 Feb 2020 01:09:15 +0000 MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Thu, 27 Feb 2020 01:09:14 +0000 From: Marc Zyngier To: Stephen Boyd , Maulik Shah Cc: bjorn.andersson@linaro.org, evgreen@chromium.org, mka@chromium.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, agross@kernel.org, linus.walleij@linaro.org, tglx@linutronix.de, dianders@chromium.org, rnayak@codeaurora.org, ilina@codeaurora.org, lsrao@codeaurora.org, linux-kernel-owner@vger.kernel.org Subject: Re: [RFC 1/2] irqchip: qcom: pdc: Introduce irq_set_wake call In-Reply-To: <158265096050.177367.409185999509868538@swboyd.mtv.corp.google.com> References: <1581944408-7656-1-git-send-email-mkshah@codeaurora.org> <1581944408-7656-2-git-send-email-mkshah@codeaurora.org> <158216527227.184098.17500969657143611632@swboyd.mtv.corp.google.com> <4c80783d-8ad0-9bd8-c42e-01659fa81afe@codeaurora.org> <158265096050.177367.409185999509868538@swboyd.mtv.corp.google.com> Message-ID: <55bfc524f6c45419227c228c86fb20dc@misterjones.org> X-Sender: maz@misterjones.org User-Agent: Roundcube Webmail/1.3.10 X-SA-Exim-Connect-IP: 51.254.78.96 X-SA-Exim-Rcpt-To: swboyd@chromium.org, mkshah@codeaurora.org, bjorn.andersson@linaro.org, evgreen@chromium.org, mka@chromium.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, agross@kernel.org, linus.walleij@linaro.org, tglx@linutronix.de, dianders@chromium.org, rnayak@codeaurora.org, ilina@codeaurora.org, lsrao@codeaurora.org, linux-kernel-owner@vger.kernel.org X-SA-Exim-Mail-From: maz@misterjones.org X-SA-Exim-Scanned: No (on disco-boy.misterjones.org); SAEximRunCond expanded to false Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Maulik, I'd appreciate if you could Cc me on all irqchip patches. On 2020-02-25 17:16, Stephen Boyd wrote: > Quoting Maulik Shah (2020-02-21 03:20:59) >> >> On 2/20/2020 7:51 AM, Stephen Boyd wrote: >> >> How are wakeups supposed to work when the CPU cluster power is >> disabled >> in low power CPU idle modes? Presumably the parent irq controller >> is >> powered off (in this case it's an ARM GIC) and we would need to >> have the >> interrupt be "enabled" or "unmasked" at the PDC for the irq to >> wakeup >> the cluster. >> >> Correct. Interrupt needs to be "enabled" or "unmasked" at wakeup >> capable PDC >> for irqchip to wakeup from "deep" low power modes where parent GIC may >> not be >> monitoring interrupt and only PDC is monitoring. >> these "deep" low power modes can either be triggered by kernel >> "suspend" or >> "cpuidle" path for which drivers may or may not have registered for >> suspend or >> cpu/cluster pm notifications to make a decision of enabling wakeup >> capability. Loosing interrupt delivery in idle is not an acceptable behaviour. Idle != suspend. >> >> >> We shouldn't need to enable irq wake on any irq for the CPU >> to get that interrupt in deep CPU idle states. >> >> + * >> + * Note: irq enable/disable state is completely orthogonal >> + * to the enable/disable state of irq wake. >> >> i think that's what above documentation said to have wakeup capability >> is >> orthogonal to enable/disable state of irq, no? >> >> A deep cpuidle entry is also orthogonal to drivers unless they >> register for cpu >> pm notifications. >> >> so with this change, >> if the drivers want their interrupt to be wakeup capable during both >> "suspend" >> and "cpuidle" they can call "enable_irq_wake" and leave it there to be >> wake up >> capable. > > Where is there a mention about drivers registering for cpu PM > notifications? I'm not aware of this being mentioned as a requirement. > Instead, my understanding is that deep idle states shouldn't affect > irqs > from being raised to the CPU. If such an irq is enabled and can't wake > the system from deep idle and it's expected to interrupt during this > idle time then perhaps the PDC driver needs to block deep idle states > until that irq is disabled. Indeed. Idle states shouldn't affect irq delivery. The irq_set_wake() call deals with suspend, and idle is rather different from suspend. Conflating the two seems pretty broken, and definitely goes against the expected behaviour of device drivers. Is the expectation now that we are going to see a flurry of patches adding irq_set_wake() calls all over the map? > Does this scenario exist? It sounds like broken system design to have > an > irq that can't wake from deep idle, but I see that PDC has a selective > set of pins so maybe some irqs just aren't expected to wake the system > up during idle. That'd be terribly broken. We've had a similar discussion about a NXP platform where only some interrupts could wake take the CPU out of idle. The end result is that we don't idle on this system. If the PDC can't take the CPU out of idle, then idle shouldn't be entered when these broken interrupts are enabled. Thanks, M. -- Who you jivin' with that Cosmik Debris?