Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp6877457ybi; Mon, 22 Jul 2019 03:14:29 -0700 (PDT) X-Google-Smtp-Source: APXvYqyUB0lHYzlJpiE0xu+b962GaBBswBHIpYOrvLQy2NK1KazNlnbWiTm+F3lEN2RkuXLbXjSB X-Received: by 2002:a17:902:aa03:: with SMTP id be3mr74302566plb.240.1563790469638; Mon, 22 Jul 2019 03:14:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1563790469; cv=none; d=google.com; s=arc-20160816; b=JA4W5Ek3WIv1lA8gbY0YUDHVaXSTvDOFYoo7ahsCuoTBOV1AgcNwJGSxmV8xN4zl17 zV/wBclDiVfJEUWPhDHOgf0apfjzb2ucDx5eNeTUEftLdKI3yVZHmG54yAlPWJUigoOm K3c+CFd9gk5DUtEKTjNn9qb0wAEFdWFzNyci4dXN+EYVvvxRhbUhd607ZJit1I0ridOx 4RW9E5NvpOoCuwq9f/8T/airl8XphtPKIRyYQXeQKc+gjPHwZCZ0ILegc6yuut8AX6XS zASlhufK/1e169Ld24pjPrVS1IjgkdMjMubKl+i8Y+8GNhAH4Qd1GZW59RaosopmJv/r qMZA== 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:autocrypt:openpgp:from:references:cc:to :subject; bh=E5H5mFrMbdcDEdR/fqwkYO+eNijzHPyshvuaSTyk95o=; b=TzmbbydWCbxjPT2/NBUse1BX1CVWbjakGk2Rbs1qlChRGlVp2wvhbTc55trYNQOP5U J2dE9Z8K7p3nbql66EFILyJsLwUs6Ppt7UntUKM6rgJFujWkparSVxpPzUOg9PA0/nqQ nqObMUwxmVa5kmZXG93KCSTvjGZeVLz7keO55MssfER6NvaxSOd7Zltscr/fWS7UtKMx DWwAdmhX0pHcZwrFGQM1kw48vUVlOETQ+O7sbsqdRkRqh0AFgw3Fd7kPvO3YtBx/Uldf sBzYW3+dpdVQ2gW5B7akf84iIoDDkluy9ZmHX49yySYYad9yTp7ce/8XwlZuPmntF173 7Dxg== 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 k16si8061475pfi.174.2019.07.22.03.14.13; Mon, 22 Jul 2019 03:14: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; 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 S1729504AbfGVKNY (ORCPT + 99 others); Mon, 22 Jul 2019 06:13:24 -0400 Received: from foss.arm.com ([217.140.110.172]:35016 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726846AbfGVKNX (ORCPT ); Mon, 22 Jul 2019 06:13:23 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 236F328; Mon, 22 Jul 2019 03:13:22 -0700 (PDT) Received: from [10.1.197.61] (usa-sjc-imap-foss1.foss.arm.com [10.121.207.14]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 73BB73F71A; Mon, 22 Jul 2019 03:13:17 -0700 (PDT) Subject: Re: [PATCH V6 01/21] irqchip: tegra: Do not disable COP IRQ during suspend To: Dmitry Osipenko , Sowjanya Komatineni , thierry.reding@gmail.com, jonathanh@nvidia.com, tglx@linutronix.de, jason@lakedaemon.net, linus.walleij@linaro.org, stefan@agner.ch, mark.rutland@arm.com Cc: pdeschrijver@nvidia.com, pgaikwad@nvidia.com, sboyd@kernel.org, linux-clk@vger.kernel.org, linux-gpio@vger.kernel.org, jckuo@nvidia.com, josephl@nvidia.com, talho@nvidia.com, linux-tegra@vger.kernel.org, linux-kernel@vger.kernel.org, mperttunen@nvidia.com, spatra@nvidia.com, robh+dt@kernel.org, devicetree@vger.kernel.org References: <1563738060-30213-1-git-send-email-skomatineni@nvidia.com> <1563738060-30213-2-git-send-email-skomatineni@nvidia.com> From: Marc Zyngier Openpgp: preference=signencrypt Autocrypt: addr=marc.zyngier@arm.com; prefer-encrypt=mutual; keydata= mQINBE6Jf0UBEADLCxpix34Ch3kQKA9SNlVQroj9aHAEzzl0+V8jrvT9a9GkK+FjBOIQz4KE g+3p+lqgJH4NfwPm9H5I5e3wa+Scz9wAqWLTT772Rqb6hf6kx0kKd0P2jGv79qXSmwru28vJ t9NNsmIhEYwS5eTfCbsZZDCnR31J6qxozsDHpCGLHlYym/VbC199Uq/pN5gH+5JHZyhyZiNW ozUCjMqC4eNW42nYVKZQfbj/k4W9xFfudFaFEhAf/Vb1r6F05eBP1uopuzNkAN7vqS8XcgQH qXI357YC4ToCbmqLue4HK9+2mtf7MTdHZYGZ939OfTlOGuxFW+bhtPQzsHiW7eNe0ew0+LaL 3wdNzT5abPBscqXWVGsZWCAzBmrZato+Pd2bSCDPLInZV0j+rjt7MWiSxEAEowue3IcZA++7 ifTDIscQdpeKT8hcL+9eHLgoSDH62SlubO/y8bB1hV8JjLW/jQpLnae0oz25h39ij4ijcp8N t5slf5DNRi1NLz5+iaaLg4gaM3ywVK2VEKdBTg+JTg3dfrb3DH7ctTQquyKun9IVY8AsxMc6 lxl4HxrpLX7HgF10685GG5fFla7R1RUnW5svgQhz6YVU33yJjk5lIIrrxKI/wLlhn066mtu1 DoD9TEAjwOmpa6ofV6rHeBPehUwMZEsLqlKfLsl0PpsJwov8TQARAQABtCNNYXJjIFp5bmdp ZXIgPG1hcmMuenluZ2llck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LiVTtlhZnJWyEJrQi9O2nXTzlG1PeqGH2ahuRxn7txA5j5PHZEZdL1 Z46HaNmN2hZS/oJ69c1DI5Rcww== Organization: ARM Ltd Message-ID: <20c1d733-60f5-6375-c03c-639de5e41739@arm.com> Date: Mon, 22 Jul 2019 11:13:16 +0100 User-Agent: Mozilla/5.0 (X11; Linux aarch64; rv:60.0) Gecko/20100101 Thunderbird/60.7.2 MIME-Version: 1.0 In-Reply-To: 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 22/07/2019 10:54, Dmitry Osipenko wrote: > 21.07.2019 22:40, Sowjanya Komatineni пишет: >> Tegra210 platforms use sc7 entry firmware to program Tegra LP0/SC7 entry >> sequence and sc7 entry firmware is run from COP/BPMP-Lite. >> >> So, COP/BPMP-Lite still need IRQ function to finish SC7 suspend sequence >> for Tegra210. >> >> This patch has fix for leaving the COP IRQ enabled for Tegra210 during >> interrupt controller suspend operation. >> >> Acked-by: Thierry Reding >> Signed-off-by: Sowjanya Komatineni >> --- >> drivers/irqchip/irq-tegra.c | 20 ++++++++++++++++++-- >> 1 file changed, 18 insertions(+), 2 deletions(-) >> >> diff --git a/drivers/irqchip/irq-tegra.c b/drivers/irqchip/irq-tegra.c >> index e1f771c72fc4..851f88cef508 100644 >> --- a/drivers/irqchip/irq-tegra.c >> +++ b/drivers/irqchip/irq-tegra.c >> @@ -44,6 +44,7 @@ static unsigned int num_ictlrs; >> >> struct tegra_ictlr_soc { >> unsigned int num_ictlrs; >> + bool supports_sc7; >> }; >> >> static const struct tegra_ictlr_soc tegra20_ictlr_soc = { >> @@ -56,6 +57,7 @@ static const struct tegra_ictlr_soc tegra30_ictlr_soc = { >> >> static const struct tegra_ictlr_soc tegra210_ictlr_soc = { >> .num_ictlrs = 6, >> + .supports_sc7 = true, >> }; >> >> static const struct of_device_id ictlr_matches[] = { >> @@ -67,6 +69,7 @@ static const struct of_device_id ictlr_matches[] = { >> >> struct tegra_ictlr_info { >> void __iomem *base[TEGRA_MAX_NUM_ICTLRS]; >> + const struct tegra_ictlr_soc *soc; >> #ifdef CONFIG_PM_SLEEP >> u32 cop_ier[TEGRA_MAX_NUM_ICTLRS]; >> u32 cop_iep[TEGRA_MAX_NUM_ICTLRS]; >> @@ -147,8 +150,20 @@ static int tegra_ictlr_suspend(void) >> lic->cop_ier[i] = readl_relaxed(ictlr + ICTLR_COP_IER); >> lic->cop_iep[i] = readl_relaxed(ictlr + ICTLR_COP_IEP_CLASS); >> >> - /* Disable COP interrupts */ >> - writel_relaxed(~0ul, ictlr + ICTLR_COP_IER_CLR); >> + /* >> + * AVP/COP/BPMP-Lite is the Tegra boot processor. >> + * >> + * Tegra210 system suspend flow uses sc7entry firmware which >> + * is executed by COP/BPMP and it includes disabling COP IRQ, >> + * clamping CPU rail, turning off VDD_CPU, and preparing the >> + * system to go to SC7/LP0. >> + * >> + * COP/BPMP wakes up when COP IRQ is triggered and runs >> + * sc7entry-firmware. So need to keep COP interrupt enabled. >> + */ >> + if (!lic->soc->supports_sc7) >> + /* Disable COP interrupts if SC7 is not supported */ > > All Tegra SoCs support SC7, hence the 'supports_sc7' and the comment > doesn't sound correct to me. Something like 'firmware_sc7' should suit > better here. If what you're saying is true, then the whole patch is wrong, and the SC7 property should come from DT. > >> + writel_relaxed(~0ul, ictlr + ICTLR_COP_IER_CLR); > > Secondly, I'm also not sure why COP interrupts need to be disabled for > pre-T210 at all, since COP is unused. This looks to me like it was > cut-n-pasted from downstream kernel without a good reason and could be > simply removed. Please verify that this is actually the case. Tegra-2 definitely needed some level of poking, and I'm not keen on changing anything there until you (or someone else) has verified it on actual HW (see e307cc8941fc). Joseph, can you please shed some light here? M. -- Jazz is not dead. It just smells funny...