Received: by 10.223.176.46 with SMTP id f43csp1056390wra; Wed, 24 Jan 2018 09:55:09 -0800 (PST) X-Google-Smtp-Source: AH8x226y8kK4Eat2mCgdLNGUEp90H7BL4xAr2ylL06QAQhRbHuh+tPclwlPUCqwP7PYtaaG007PJ X-Received: by 2002:a17:902:a60d:: with SMTP id u13-v6mr8781073plq.114.1516816509174; Wed, 24 Jan 2018 09:55:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516816509; cv=none; d=google.com; s=arc-20160816; b=UDqX4h+w0+ma2kERj0a6svtQnjVhxthuHlba7gg2MbQlqn6lE2CxF7dS7wAjMlzPXf wVvOQKo62FdcmPcEDCu9oCM0J1CyIMWgtzTTmRzp/60OeaG5IxkXfDn8IuoS54Kee6Ka LRpJRt+xW3797yXMXe4bSrJ4ST04Digsaj8qFnuUw9P1IKg/u2Bhz8gxXmEy7NaUqZJF UQ8JVl5IKij9UDTeap4JiUN8ciY/FdBjnLcQNaIfI8WxkO6HUudHk1yrxDm8WNCVjLjs no7nP7cFCLXKI4tNzjsewCoclC6G6BEEKY+BYei1Z0v3vi43zUkfba3Wt8fW3gbfusIO KKCQ== 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 :content-language:in-reply-to:mime-version:user-agent:date :message-id:organization:from:references:to:subject:cc :arc-authentication-results; bh=0THltvKvhMKrtvXwYeTYPFluoIlBKwWC4oov/EQmRKU=; b=BhHazvmqzvaklf1d0GrOrkPvVknK7AiAFP4+xa+8e+opZjyBCl7lKVMB7U9qZWf4S4 B+JjEX+3e3jWVBppgEDEn5kC5pW1Eyojoengog38YfOEwwj9LuxzIxRgCsT3PIfI+Iah FWLn1yKBaOVriP6MC2n9T9b09RiYuk94JDOzC8ccdOXCjiTsIzAQCX2mkRLmaGtO0eN9 D/+QWYG0MzwmGWN7FG8y8Wdg3EXFSKoU1+08H7KdFnUsiQJ6fb2zsew7x2Ye0bg8pyy6 QGhF98i11CMOymi36ULzKdS/qKGWKm9q52iQbgCXls3Y3zDwK0V8Ekp5S0KZtfpUhJUu Ltiw== 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 j1-v6si516980pld.253.2018.01.24.09.54.54; Wed, 24 Jan 2018 09:55:09 -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 S964989AbeAXRyc (ORCPT + 99 others); Wed, 24 Jan 2018 12:54:32 -0500 Received: from foss.arm.com ([217.140.101.70]:56190 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S964850AbeAXRya (ORCPT ); Wed, 24 Jan 2018 12:54:30 -0500 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 82CE615AD; Wed, 24 Jan 2018 09:54:30 -0800 (PST) Received: from [10.1.210.28] (e107155-lin.cambridge.arm.com [10.1.210.28]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 8BBF03F53D; Wed, 24 Jan 2018 09:54:26 -0800 (PST) Cc: Sudeep Holla , Thomas Gleixner , Jason Cooper , Marc Zyngier , open list , linux-arm-msm@vger.kernel.org, Stephen Boyd , "Nayak, Rajendra" , asathyak@codeaurora.org Subject: Re: [PATCH RFC 0/4] irqchip: qcom: add support for PDC interrupt controller To: Lina Iyer References: <20180123175656.11942-1-ilina@codeaurora.org> <20180123184442.GA12243@codeaurora.org> <494fa715-aff0-19f2-0ee9-78d8c0b33775@arm.com> <20180124174310.GA24587@codeaurora.org> From: Sudeep Holla Organization: ARM Message-ID: <1ee07421-444d-adf7-bf6f-8a35c4884c14@arm.com> Date: Wed, 24 Jan 2018 17:54:24 +0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.5.0 MIME-Version: 1.0 In-Reply-To: <20180124174310.GA24587@codeaurora.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 24/01/18 17:43, Lina Iyer wrote: > On Wed, Jan 24 2018 at 10:10 +0000, Sudeep Holla wrote: >> >> >> On 23/01/18 18:44, Lina Iyer wrote: >>> On Tue, Jan 23 2018 at 18:15 +0000, Sudeep Holla wrote: >>>> Hi Lina, >>>> >>>> On Tue, Jan 23, 2018 at 5:56 PM, Lina Iyer >>>> wrote: >>>>> On newer Qualcomm Techonologies Inc's SoCs like the SDM845, the GIC >>>>> is in a >>>>> power domain that can be powered off when not needed. Interrupts that >>>>> need to >>>>> be sensed even when the GIC is powered off, are routed through an >>>>> interrupt >>>>> controller in an always-on domain called the Power Domain Controller >>>>> a.k.a PDC. >>>>> This series adds support for the PDC's interrupt controller. >>>>> >>>> >>>> Sorry for the basic questions: >>>> >>>> 1. Will the GIC be powered off in any other state other than System >>>> suspend ? >>>> >>> Yes. When all the CPUs are in idle, there is an opportunity to power off >>> the CPU's power domain and the GIC. QCOM SoCs have been doing that for >>> many generations now. >>> >> >> OK interesting, in that case so either GIC state is saved/restored with >> some out of tree patches or the firmware takes care of it and it's >> transparent to Linux ? >> > Yes. It is handled by a remote processor, which is aware that the > application processor subsystem has been powered off. > OK, better. >> Also when will this PDC wakeup interrupts get configured ? >> > The platform drivers configure the IRQ as a wake source and if the IRQ > is one of those listed as routed to the PDC, the PDC is configured to > sense the interrupt and when the application processor domain is powered > on and the GIC can sense the interrupts, it is replayed to the GIC, > which then wakes up the processor. > Now why can't this be done in the firmware entirely, if it can save/restore GIC state. >>>> 2. Why this needs to be done in Linux, why can't it be transparent and >>>> hidden >>>>    in the firmware doing the actual GIC power down ? I assume Linux is >>>> not >>>>    powering down the GIC. >>> No. You are right, Linux is not powering off the GIC directly. A >>> dedicated processor for power management in the SoC does that. Platform >>> drivers in Linux, know and configure the wakeup interrupts (depending on >>> the usecase). This is runtime specific and this is the way to tell the >>> SoC to wake up the processor even if the GIC and the CPU domain were >>> powered off. >>> >> >> OK, understood. By transparent, I mean firmware can copy the interrupts >> enabled in the GIC to the PDC. It need not be kernel driven. >> > Yes, through the hierarchy. > /me confused. Are you saying it's possible for f/w to copy wakeup sources from GIC to PDC or not ? >>>> >>>> 3. I see some bits that enable secure interrupts in one of the patch. >>>> Is that even >>>>    safe to allow Linux to enable some secure interrupts in PDC ? >>>> >>> Linux should not and would not configure secure interrupts. We would not >>> have permissions for secure interrupts. The interrupt names might be a >>> misnomer, but the interrupts listed in patch #4 are all non-secure >>> interrupts. >>> >> >> OK. So I can assume PDC is partitioned in secure and non-secure. If not >> it's safe not have any access for PDC in the kernel. Couple of designs >> of similar PDC I have seen is system wide and does handle even secure >> part of the system. That was the main reason for checking. >> > Yes. There is a partition and protected. So only permitted ELs can write > to the registers. This is done by the firmware at boot. > Just for myself to understand better, so you have multiple partitions in PDC and one of them is given to EL1 or it just has one partition and that can be configured so that only permitted ELx is allowed to access it(in your case it's EL1) -- Regards, Sudeep