Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp6241626ybi; Sun, 21 Jul 2019 12:45:10 -0700 (PDT) X-Google-Smtp-Source: APXvYqyIscdiDjdS9GQpV3K6l1jt0jsA9f7xqaa2uMJMTD5BigEoN+LuMR43U7PO3zWS6KzLMzA1 X-Received: by 2002:a17:90a:8c92:: with SMTP id b18mr71626899pjo.97.1563738309933; Sun, 21 Jul 2019 12:45:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1563738309; cv=none; d=google.com; s=arc-20160816; b=VM2W4M2OPGC/HilRoPn34gvvM2Ic1iYr2OdclZdJd8Knwf8eVmi+7Z8j4D5rbjQRwv ZlIdVtBYbXlZbKL83Alq8XhfkH19CzTpV7yiPTn6tF9LTl9blGM6TRW0IuH6Ek39iefm q0jGLNc/SXbZbXTRIih03HfVdG6bJ0x1DGVrAEdWRr9dtg78h5Wxpidshp+PAJn2h9ft 3slRyUkhbnMk0g++rr/9SZMRufuWnXuyboUOm2+o9kyl+3qWb+OnLFMEK34L8J6Lg/+t XhEnyZB8ZwaN9dGeCGCwOYC4Bheqwv5+BzJkDCYUCNV2VERwvsSnUh3ybd3s7ccPw6Jp me4w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:dkim-signature:mime-version:references :in-reply-to:message-id:date:subject:cc:to:from; bh=s1XnuLcDk97/CuRHD9/IW+GAX3pxhADV42EQBIG7j4Y=; b=DePDCMPc5YyiiKuCqazqNAMIoJFaUA8MPlKquHhDo1dsYDk9G8MWETyB1dacqaV/RK 6dG8qYKVzm06bLQp6X8iffCQzbf9CAxkytcgCAStqoM3J/qJNciFupsBHqnVCqu9Ahr1 qu9sT1J6CgyaeDu5imja5kKrZKgUpxtCZQcF/K5dM1XxObh50brJBXi8sp3W5INEfeTD arjiamLNavZ9EhZuOsfHIng6h/F+AYEqm7ipJcc0Tc9oKZmdGYVnjGP7m9J6LKgMjeYd ww3RYq67QfCciDFe9WzhppLcZ/c0WoVVByFxlb/YyuUIIZ64y2nYQQ9OVG4P0GzXDMDL FruQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nvidia.com header.s=n1 header.b=mdxvnyLh; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nvidia.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l70si6637886pje.68.2019.07.21.12.44.54; Sun, 21 Jul 2019 12:45:09 -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; dkim=pass header.i=@nvidia.com header.s=n1 header.b=mdxvnyLh; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nvidia.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726944AbfGUTkz (ORCPT + 99 others); Sun, 21 Jul 2019 15:40:55 -0400 Received: from hqemgate16.nvidia.com ([216.228.121.65]:8980 "EHLO hqemgate16.nvidia.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726323AbfGUTky (ORCPT ); Sun, 21 Jul 2019 15:40:54 -0400 Received: from hqpgpgate101.nvidia.com (Not Verified[216.228.121.13]) by hqemgate16.nvidia.com (using TLS: TLSv1.2, DES-CBC3-SHA) id ; Sun, 21 Jul 2019 12:40:50 -0700 Received: from hqmail.nvidia.com ([172.20.161.6]) by hqpgpgate101.nvidia.com (PGP Universal service); Sun, 21 Jul 2019 12:40:52 -0700 X-PGP-Universal: processed; by hqpgpgate101.nvidia.com on Sun, 21 Jul 2019 12:40:52 -0700 Received: from HQMAIL102.nvidia.com (172.18.146.10) by HQMAIL106.nvidia.com (172.18.146.12) with Microsoft SMTP Server (TLS) id 15.0.1473.3; Sun, 21 Jul 2019 19:40:52 +0000 Received: from HQMAIL104.nvidia.com (172.18.146.11) by HQMAIL102.nvidia.com (172.18.146.10) with Microsoft SMTP Server (TLS) id 15.0.1473.3; Sun, 21 Jul 2019 19:40:51 +0000 Received: from hqnvemgw02.nvidia.com (172.16.227.111) by HQMAIL104.nvidia.com (172.18.146.11) with Microsoft SMTP Server (TLS) id 15.0.1473.3 via Frontend Transport; Sun, 21 Jul 2019 19:40:51 +0000 Received: from skomatineni-linux.nvidia.com (Not Verified[10.2.164.85]) by hqnvemgw02.nvidia.com with Trustwave SEG (v7,5,8,10121) id ; Sun, 21 Jul 2019 12:40:51 -0700 From: Sowjanya Komatineni To: , , , , , , , CC: , , , , , , , , , , , , , , , Subject: [PATCH V6 01/21] irqchip: tegra: Do not disable COP IRQ during suspend Date: Sun, 21 Jul 2019 12:40:40 -0700 Message-ID: <1563738060-30213-2-git-send-email-skomatineni@nvidia.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1563738060-30213-1-git-send-email-skomatineni@nvidia.com> References: <1563738060-30213-1-git-send-email-skomatineni@nvidia.com> X-NVConfidentiality: public MIME-Version: 1.0 Content-Type: text/plain DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nvidia.com; s=n1; t=1563738050; bh=s1XnuLcDk97/CuRHD9/IW+GAX3pxhADV42EQBIG7j4Y=; h=X-PGP-Universal:From:To:CC:Subject:Date:Message-ID:X-Mailer: In-Reply-To:References:X-NVConfidentiality:MIME-Version: Content-Type; b=mdxvnyLhSwkqXvEeRBRJCBab2gnmFHKfiZBKqodjHscL+sMBNf3UQgJbVdvV3j4y9 T0Zjz6UVUXEsnTRG7I0u+wI0hCcyiU+sYN9URPzsnvxDsVaU1COed2h+zpBQvfY6eV emvwCRm8TkLR3xMZYzlnyUY108P/VhQB6KPS01QLUjX3+SC6aHBLM/S6lvz98j5Jcr 2iXsmyo+cv983GD5j1VJIiMXOjIdLT49xG6Hvq2aF1knKsRSd+zi9k9p85Lv6sLW58 eqyh7i38poPXl51BJlNaC1d7hzr37JKqsRSd7n8oaVI0ZxNwKYaWEwSkRFRU00WVvE sZFGwUXCNIc8A== Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 */ + writel_relaxed(~0ul, ictlr + ICTLR_COP_IER_CLR); /* Disable CPU interrupts */ writel_relaxed(~0ul, ictlr + ICTLR_CPU_IER_CLR); @@ -339,6 +354,7 @@ static int __init tegra_ictlr_init(struct device_node *node, goto out_unmap; } + lic->soc = soc; tegra_ictlr_syscore_init(); pr_info("%pOF: %d interrupts forwarded to %pOF\n", -- 2.7.4