Received: by 10.223.176.46 with SMTP id f43csp2360300wra; Thu, 25 Jan 2018 08:41:45 -0800 (PST) X-Google-Smtp-Source: AH8x225uaZ26Rw6kmpM9bji8vPUsYH//ttkkhyCnKuFEByRkLgbpidbuMMsnXR9oirQa7bqIv87q X-Received: by 2002:a17:902:8607:: with SMTP id f7-v6mr11969894plo.273.1516898505703; Thu, 25 Jan 2018 08:41:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516898505; cv=none; d=google.com; s=arc-20160816; b=ck5gWA65GbW/eePsmgwXiRfOJZO64JR7rE2B88SIaGJblZcGy8Y5Mw2bbpv6GbjhMJ d6mJ4yznfrtViOyzYOzfjhtCOJGJ4wr2j5sX1ZnM/AcqnoLOt0/09FPJTMdJ7Pmrd9Vf Y/eU4e4fZ6YFJFsnjvBHP7+kcER7dsMiYlICGKpOrmVE3+d5KkhIR6lmorJEIGXkQmM2 94zoB6kTbYXzqq3izO6BHec9FAxqVkDgOU1niuFTddjknCXFtZeYW6oImNnTAWQehPI5 BUOI7DpoJSboETtVg3BmG0lumXNweH8pIhgve9/C2FcuEJJLU/9D19KSx9NpSeenmcwD 6zOQ== 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=bpUMt908uML+jY69pDnchM6QnsBB2QKa4kGmA1XtV04=; b=k9SOEfxMTGyTyi0RV24j2E2f1B00zj2n6S55NsJ9fnrzcjoyPPGqzs24oLig/GXyyd g0wt5kAEdlr2+//rtFXls0WTNt4cicguZQU4G5xZvoaohyl1K+4HnZ/C22fhr8wVRbjR T9fYZwcHidc1lYqY/y/+ddew8WKfMXIbtsJpDPGL2vpApPRGPl8q8GAJ1lOM+hFMCbpn G4O+uO5Liz4vxaxSZw89t8vSmT7Une3u5Tx4h4G+vCf7JvMXc9WZSn+eFSA8dg/676+8 A2+k7rNDDZgqxLJrC9TGqmfQb1w/+Q5jSnPafTeUJDa0rkpjzAiXS9X3o3pVTNiIZCsD 6sfg== 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 70-v6si2208245pla.635.2018.01.25.08.41.31; Thu, 25 Jan 2018 08:41:45 -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 S1751255AbeAYQjc (ORCPT + 99 others); Thu, 25 Jan 2018 11:39:32 -0500 Received: from usa-sjc-mx-foss1.foss.arm.com ([217.140.101.70]:37696 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750980AbeAYQjb (ORCPT ); Thu, 25 Jan 2018 11:39:31 -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 276AA1435; Thu, 25 Jan 2018 08:39:31 -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 1383C3F53D; Thu, 25 Jan 2018 08:39:27 -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> <1ee07421-444d-adf7-bf6f-8a35c4884c14@arm.com> <20180125155428.GC24587@codeaurora.org> From: Sudeep Holla Organization: ARM Message-ID: <403f9685-fd40-8948-d658-5acb63af04fb@arm.com> Date: Thu, 25 Jan 2018 16:39:26 +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: <20180125155428.GC24587@codeaurora.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 25/01/18 15:54, Lina Iyer wrote: > On Wed, Jan 24 2018 at 17:54 +0000, Sudeep Holla wrote: >> >> >> 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: > >>>> 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. >> > That is because platform drivers make the choice of which interrupts are > wake up capable at runtime, based on the usecase. They have to have a > way to tell the firmware to do that. Earlier we used IPC to tell the > remote processor to handle that. Now we do that by writing to the > registers locally from Linux. > >>>> 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 ? >> > Platform drivers leave their interrupts enabled at the GIC. Only > interrupts that are wakeup capable are of interest when the processor is > powered down. The remote processor (or f/w) will need to know the set of > wakeup capable interrupts and then configure the PDC by copying from > GIC. As mentioned earlier, it is simplified by letting Linux write to > the PDC reqisters directly. > OK looks like I have not properly conveyed what I wanted to :( So lets take a peripheral A which has GIC interrupt X and a corresponding PDC interrupt Y. IIUC you want to configure Y from Linux while X is still enabled. 1. GICv3 masks all the interrupts(~X) that are not wakeup sources. So when you say "platform drivers leave their interrupts enabled at the GIC", it's not completely correct. 2. GIC CPU interface is disabled in firmware, so it's better to copy the wakeup source to PDC just before that in the firmware. 3. Remote f/w must just know the mapping to PDC(X) for all the enabled interrupts(Y) at the GIC and enable them accordingly at PDC. Is that not what you have in the array in patch 4 ? I find above approach simpler instead of getting those wakeup interrupts defined per peripheral in DT. Further if there are any secure wakeup interrupts the firmware can also deal with that. >>> 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) >> > Yes. Yes for the former or the latter :) ? -- Regards, Sudeep