Received: by 2002:a05:6a10:6744:0:0:0:0 with SMTP id w4csp3484652pxu; Sun, 11 Oct 2020 11:22:07 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxWOKEwC3z7Cw4tzZPTIecuYGBu//ISSt2cSfsUIgSaZYrLzQTlwsKy9Qb3YKQ5u9ZtJLR5 X-Received: by 2002:a17:906:a988:: with SMTP id jr8mr24412302ejb.508.1602440527564; Sun, 11 Oct 2020 11:22:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1602440527; cv=none; d=google.com; s=arc-20160816; b=iuer0xfj7eXjBuOA3Xcf2PW72rP2Lwg+cKEhL837s+XxLlRNgIqCBCuTvSqs35IemQ 1C/yarIXoRNtrWig+qqbLJifQE1OPcNRxi5RH3HQ5SRtOlR3hyfrXBtHgk3Uiv9om2Mg GoY46mtRuImXPNRjI/wOfVCbUDgaQyz9dL/tVftuqwfarGBSqJMAFxdIAjBwqs7esMaH Ho0A/6xz8d/meMIxkQaCzpbHt3rJIM0lkBScgtlC1sMoKA8OSgQAEKTVq5/u4Va8/Qt3 CIhJYeE0es7P+kmCREFms99Xjd5niNcD0xjLR74s/hrqegLnn34VOZTMWEJ9nOcLw9Gt GxXA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:robot-unsubscribe :robot-id:message-id:mime-version:references:in-reply-to:cc:subject :to:reply-to:sender:from:dkim-signature:dkim-signature:date; bh=iuZ10mAL+l0Nz/GblEK5GBOtUpOL23tqeHwYw9k95Zg=; b=gw/NoMCE9KEFJOmpjhbRAZpgtuwVWPqTDmS4klvV0iQ0fcxm/mtiGhSbFJbPWcmSnB 2ngvLduFNrkYeUV2yeDfxYQwI+69V/vzxS/8PrYC/dU+NfZ2x8N47L81NmyAI0K3LwCM 2zC6fYzMywjtjKrfRp6MdgwbJ7Vm3Z/FF15zYKyon/uRCx+i5KBKx/XzoAFhD0N0kgP8 vOQhCJX4ME4ULun9Ss7I1/xuAgTBwAKgHjRBaXVFUan2aarn0s2MNEnqPI85/b1sVN2T ibv3meRiBwALOY5TM2MfE8UUBaLFRGrWjylBnA0eVM0eP79FyAhrbyfMmVVovt+RHPKU 2WGA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=uX+Rk63p; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=OLCdhIYa; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id l17si10471732eds.322.2020.10.11.11.21.44; Sun, 11 Oct 2020 11:22:07 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=uX+Rk63p; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=OLCdhIYa; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726547AbgJKSBD (ORCPT + 99 others); Sun, 11 Oct 2020 14:01:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46684 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388377AbgJKR5X (ORCPT ); Sun, 11 Oct 2020 13:57:23 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A7A4FC0613D0; Sun, 11 Oct 2020 10:57:23 -0700 (PDT) Date: Sun, 11 Oct 2020 17:57:21 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1602439042; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=iuZ10mAL+l0Nz/GblEK5GBOtUpOL23tqeHwYw9k95Zg=; b=uX+Rk63pugUc3drd2fCQ8RJHlSJrnGjvHrrl8q8tSFTIwGBoRMK3yynR+JfK6kLmAw/QkH 2usZTQe8ZCRs92QWbSoAXz8/dxz4VodB1eVXso8+mjHDGS/UpdC/NFfBsxmlj5wz/FR0D/ c7TdjtVToS9WECWq2Ab9NVEu82yA1oPcsDtmm9GTECJ0TShmZgEuSQiTh5Ma+wMAE4wnlM xk6JxLD8d6QahlEc29Sv8QK9emAKh9ChKa69IFVm3vIjCyOXJIZIu4ybPUPX+SGmrRlfV6 ku2nnHC8Oyx/Z+bV9L7IdrEJFtrFNv7UQD23oS7PB0U9iizT8XMe23H1zyrFKQ== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1602439042; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=iuZ10mAL+l0Nz/GblEK5GBOtUpOL23tqeHwYw9k95Zg=; b=OLCdhIYarZFqUFLCVdpfvMZtizGe18hjp4FXYQBIOXjHOw0Z5yMGs/JR+/pXnDeoothpbL hTn+getCuYSD2PBw== From: "tip-bot2 for Maulik Shah" Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: irq/core] irqchip/qcom-pdc: Reset PDC interrupts during init Cc: Stephen Boyd , Maulik Shah , Marc Zyngier , Douglas Anderson , Linus Walleij , x86 , LKML In-Reply-To: <1601267524-20199-7-git-send-email-mkshah@codeaurora.org> References: <1601267524-20199-7-git-send-email-mkshah@codeaurora.org> MIME-Version: 1.0 Message-ID: <160243904120.7002.16402371248887672522.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The following commit has been merged into the irq/core branch of tip: Commit-ID: d7bc63fa20b8a3b0d0645bed1887848c65c01529 Gitweb: https://git.kernel.org/tip/d7bc63fa20b8a3b0d0645bed1887848c65c01529 Author: Maulik Shah AuthorDate: Mon, 28 Sep 2020 10:02:04 +05:30 Committer: Marc Zyngier CommitterDate: Tue, 06 Oct 2020 11:26:41 +01:00 irqchip/qcom-pdc: Reset PDC interrupts during init Kexec can directly boot into a new kernel without going to complete reboot. This can leave the previous kernel's configuration for PDC interrupts as is. Clear previous kernel's configuration during init by setting interrupts in enable bank to zero. The IRQs specified in qcom,pdc-ranges property are the only ones that can be used by the new kernel so clear only those IRQs. The remaining ones may be in use by a different kernel and should not be set by new kernel. Suggested-by: Stephen Boyd Signed-off-by: Maulik Shah Signed-off-by: Marc Zyngier Tested-by: Stephen Boyd Reviewed-by: Stephen Boyd Reviewed-by: Douglas Anderson Acked-by: Linus Walleij Link: https://lore.kernel.org/r/1601267524-20199-7-git-send-email-mkshah@codeaurora.org --- drivers/irqchip/qcom-pdc.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/drivers/irqchip/qcom-pdc.c b/drivers/irqchip/qcom-pdc.c index acc0620..bd39e9d 100644 --- a/drivers/irqchip/qcom-pdc.c +++ b/drivers/irqchip/qcom-pdc.c @@ -341,7 +341,8 @@ static const struct irq_domain_ops qcom_pdc_gpio_ops = { static int pdc_setup_pin_mapping(struct device_node *np) { - int ret, n; + int ret, n, i; + u32 irq_index, reg_index, val; n = of_property_count_elems_of_size(np, "qcom,pdc-ranges", sizeof(u32)); if (n <= 0 || n % 3) @@ -370,6 +371,14 @@ static int pdc_setup_pin_mapping(struct device_node *np) &pdc_region[n].cnt); if (ret) return ret; + + for (i = 0; i < pdc_region[n].cnt; i++) { + reg_index = (i + pdc_region[n].pin_base) >> 5; + irq_index = (i + pdc_region[n].pin_base) & 0x1f; + val = pdc_reg_read(IRQ_ENABLE_BANK, reg_index); + val &= ~BIT(irq_index); + pdc_reg_write(IRQ_ENABLE_BANK, reg_index, val); + } } return 0;