Received: by 2002:a25:5b86:0:0:0:0:0 with SMTP id p128csp337463ybb; Thu, 28 Mar 2019 03:39:24 -0700 (PDT) X-Google-Smtp-Source: APXvYqw/giyZZ1uo7zzfLrnz6EbCMBxDhU/CBrbVTXtMWpGBZEIyNGW7AUUfmXOPLsYRuEtlUf6T X-Received: by 2002:a65:6299:: with SMTP id f25mr39835378pgv.376.1553769564198; Thu, 28 Mar 2019 03:39:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553769564; cv=none; d=google.com; s=arc-20160816; b=gvgUnnMhpxMtNIK0s4hFpH0zam0DiAToM9MM4/CZDbOZmrnwIv9pFfa+6eXUOtg8xe fum3kSN8qvL05i6c5Wx3KmnDBkA2oIFd1sK6F6DKHyoOlEALNXJ38OWKPm/1d6J9t9/1 RpoQWNyUYKahxN2qU+9bf3wBdHV6Y0K4tSLF5B9hMnTWgzWRra5pMeI12QtzrWxqN+BJ 58m7I0JqosrYr+xOd4vQ0KPhuWj26moXjLNNzYEcQc/BcCj2XQsflBN0MnH3i8KuHlG1 5gS3U+FCBEzBwtL/meWKsPO0grcct8Oit2qzolsCjOrTa6OWJRDm7yOCNDofjVs/e5IE Fzcw== 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; bh=zRenVyEX+H3dGX1Jy1oFvXpqD9veujY2epfpQlXI+jk=; b=lV+qRduif3MltqXJB44cq8SOYJSSB//O5vYAHa8gwLmIF+cMly/WbMcbehJ8ERjzSl EFZ3HSiqdqAkzKSayOJqz3zDBx72kf3lODX5Or0loo43+A0ga9qc5IwOfdn67ZsYiyTK tfMo79FJWxrsCBQ02nbSuTcF6gsCUk5fUBKxg8w7WpHfndGGqt/I3POQMHXRnWutfAwG 2Kr0UYkyVu1bm9v7e2rS2gNFQGYcKTkzlH8+UbfShCbNMoHX2/7KNhm8UhyzuWP9MV5P rdhjq6vCdq21YqR7oYz2OpbJSK0j/7KvNPsPDtWca+aALsOxqR95STWxXsuogctq/xsh JSAA== 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 g5si20907958plt.77.2019.03.28.03.39.08; Thu, 28 Mar 2019 03:39:24 -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; 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 S1726185AbfC1KiU (ORCPT + 99 others); Thu, 28 Mar 2019 06:38:20 -0400 Received: from cloudserver094114.home.pl ([79.96.170.134]:52961 "EHLO cloudserver094114.home.pl" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725779AbfC1KiU (ORCPT ); Thu, 28 Mar 2019 06:38:20 -0400 Received: from 79.184.253.239.ipv4.supernova.orange.pl (79.184.253.239) (HELO aspire.rjw.lan) by serwer1319399.home.pl (79.96.170.134) with SMTP (IdeaSmtpServer 0.83.213) id 5a898933f5c9dee8; Thu, 28 Mar 2019 11:38:16 +0100 From: "Rafael J. Wysocki" To: Marc Zyngier Cc: Leonard Crestez , "l.stach@pengutronix.de" , Abel Vesa , Jacky Bai , dl-linux-imx , "linux-kernel@vger.kernel.org" , Aisheng Dong , "linux-pm@vger.kernel.org" , "lorenzo.pieralisi@arm.com" , Fabio Estevam , "mark.rutland@arm.com" , "catalin.marinas@arm.com" , "will.deacon@arm.com" , "robh@kernel.org" , "shawnguo@kernel.org" , "linux-arm-kernel@lists.infradead.org" , "sudeep.holla@arm.com" , Anson Huang , "kernel@pengutronix.de" Subject: Re: [RFC 0/7] cpuidle: Add poking mechanism to support non-IPI wakeup Date: Thu, 28 Mar 2019 11:36:17 +0100 Message-ID: <7512439.MQbgvXz0nx@aspire.rjw.lan> In-Reply-To: References: <1553692845-20983-1-git-send-email-abel.vesa@nxp.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thursday, March 28, 2019 11:35:23 AM CET Marc Zyngier wrote: > On 27/03/2019 18:40, Leonard Crestez wrote: > > On Wed, 2019-03-27 at 17:45 +0000, Marc Zyngier wrote: > >> On 27/03/2019 16:06, Lucas Stach wrote: > >>> Am Mittwoch, den 27.03.2019, 15:57 +0000 schrieb Marc Zyngier: > >>>> On 27/03/2019 15:44, Lucas Stach wrote: > >>>>> Am Mittwoch, den 27.03.2019, 13:21 +0000 schrieb Abel Vesa: > >>>>>> This work is a workaround I'm looking into (more as a background task) > >>>>>> in order to add support for cpuidle on i.MX8MQ based platforms. > >>>>>> > >>>>>> The main idea here is getting around the missing GIC wake_request signal > >>>>>> (due to integration design issue) by waking up a each individual core through > >>>>>> some dedicated SW power-up bits inside the power controller (GPC) right before > >>>>>> every IPI is requested for that each individual core. > >>>>> > >>>>> Just a general comment, without going into the details of this series: > >>>>> this issue is not only affecting IPIs, but also MSIs terminated at the > >>>>> GIC. Currently MSIs are terminated at the PCIe core, but terminating > >>>>> them at the GIC is clearly preferable, as this allows assigning CPU > >>>>> affinity to individual MSIs and lowers IRQ service overhead. > >>>>> > >>>>> I'm not sure what the consequences are for upstream Linux support yet, > >>>>> but we should keep in mind that having a workaround for IPIs is only > >>>>> solving part of the issue. > >>>> > >>>> If this erratum is affecting more than just IPIs, then indeed I don't > >>>> see how this patch series solves anything. > >>>> > >>>> But the erratum documentation seems to imply that only SGIs are > >>>> affected, and goes as far as suggesting to use an external interrupt > >>>> would solve it. How comes this is not the case? Or is it that anything > >>>> directly routed to a redistributor is also affected? This would break > >>>> LPIs (and thus MSIs) and PPIs (the CPU timer, among others). > >>> > >>> Anything that isn't visible to the GPC and requires the GIC > >>> wake_request signal to behave as specified is broken by this erratum. > >> > >> I really wonder how a timer interrupt (a PPI, hence not routed through > >> the GPC) can wake up the CPU in this case. It really feels like > >> something like "program CNTV_CVAL_EL0 to expire at some later point; > >> WFI" could result in the CPU going to a deep sleep state, and not > >> wake-up at all. > > > > This is already a common issue for cpuidle implementions handled by the > > "local-timer-stop" property. imx has other timer blocks in the SOC, > > they generate SPIs which are connected to GPC. > > > >> This would indicate that not only cpuidle is broken with this, but > >> absolutely every interrupt that is not routed through the GPC. > > > > Yes, cpuidle is broken for irqs not routed through GPC. However: > > > > * All SPIs are connected to GPC in a 1:1 mapping > > * This series deals with SGIs > > * The timer PPIs are not required; covered by local-timer-stop > > * LPIs are currently unused (I understand imx-pci uses SPI by default > > from Lucas) > > > > Anything missing? > > > > My understanding is that this wake request feature via GIC is new in v3 > > and this is maybe why HW team missed it during integration. Older > > imx6/7 has GICv2 and has deep idle states which always rely on GPC to > > wakeup so the approach can work. > > Certainly the approach can work. The question is whether we want to > support this in a mainline kernel, spreading random hooks in the generic > code and adding a firmware interface on top of that. Not really. > By all accounts, this HW is broken. You can indeed impose limitations > (dumb down PCI, mandate the use of a broadcast timer), or you can just > flag cpuidle as unsupported on this HW. My vote is on the latter. Agreed. Thanks, Rafael