Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp4227833pxa; Mon, 10 Aug 2020 04:23:49 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwyfOvxj7KrcOLca5q5mgb0AExl13RU8LaHycEVxUoH06uGOb/JPjX+jhY7JV8tcvunGqzp X-Received: by 2002:aa7:c606:: with SMTP id h6mr21064999edq.288.1597058629409; Mon, 10 Aug 2020 04:23:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597058629; cv=none; d=google.com; s=arc-20160816; b=ILFMau5Vk5pyXngrnaDFEa6hScoJyqfLqk2jcQVHei72kKlTCNXS6hBtO7HC2F+v98 S1GngEF9CU1S+Lcx3QTHpjxoFCTEENH0RGEkQMebw3eq04c6BXqFJGqsBUhFXd5dwUtt Ll1U3x0agZuBeene+p9v1YX1Io1xXaXSGqA2TAAOa90tMg+Qdwgo+x53sLELbRmHB4QK ozL9SBrkSjTYBMVQioVzophYxPeyx7UzqJfFLmtLaeUNFPjC3Lp6+diKZddDzoQr1GHd sZWXvT72EQ7gx5MHLmEYKSe1mHgNxv6DjqGxpJUDUlAnMkPfmMp5ArSeASb5VofVqYk2 5lLQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dmarc-filter:dkim-signature; bh=fN1O+CEn+T+UdmGb1lWQQ2jsczTWCZ35SAZ54oGtO1Q=; b=Jai/iOtkR0uwOBPuPJ2nwkqjfCqftrVW0LdChg5qkwWfqY3NOGqTElD6sxXC9if2Nc FNDazoFreL50HGe7bOCBhGNtxv37qpqotVlSqlskFfz8yEFLhoUf5LOlcWsZRV/gmxVf 7gVW6Sl0xS/UrAU8eWzMZKwGlfexMneNvmDb9qSBkcRMRpwGfGBzFS4cEYHGGis0ica7 eu2uWDwepLhVeNNxO3nb8kzyrz1/mRusjFy1jTF38Y2G986eNIBTcQoGa+Zut744gyLp 9Tc0npltA4uPZc6IurGpv1EiwMZ11i9+r59836i2+k1Zz1FiT9beviKOMonM8pHSwQDe 9BIA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@mg.codeaurora.org header.s=smtp header.b=Job7S8LU; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id j7si12581908ejo.127.2020.08.10.04.23.26; Mon, 10 Aug 2020 04:23:49 -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=fail header.i=@mg.codeaurora.org header.s=smtp header.b=Job7S8LU; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726537AbgHJLWd (ORCPT + 99 others); Mon, 10 Aug 2020 07:22:33 -0400 Received: from m43-7.mailgun.net ([69.72.43.7]:50212 "EHLO m43-7.mailgun.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726611AbgHJLVz (ORCPT ); Mon, 10 Aug 2020 07:21:55 -0400 DKIM-Signature: a=rsa-sha256; v=1; c=relaxed/relaxed; d=mg.codeaurora.org; q=dns/txt; s=smtp; t=1597058514; h=References: In-Reply-To: Message-Id: Date: Subject: Cc: To: From: Sender; bh=fN1O+CEn+T+UdmGb1lWQQ2jsczTWCZ35SAZ54oGtO1Q=; b=Job7S8LUaQpWfgyX+f029S0gHRXR+ngjWoPJHpHuIM2Acca58wdjFxm/dOJHDQRhb8I7Y/lz QCA2NFEroevn97pFZC6XBM73FA2jtz8XaYIHbdvYrI4/Vi7SGMUgy4njsqSIluYJsrXzNSgc G17iFDwroO7S30tvP5nbYF4AnIE= X-Mailgun-Sending-Ip: 69.72.43.7 X-Mailgun-Sid: WyI0MWYwYSIsICJsaW51eC1rZXJuZWxAdmdlci5rZXJuZWwub3JnIiwgImJlOWU0YSJd Received: from smtp.codeaurora.org (ec2-35-166-182-171.us-west-2.compute.amazonaws.com [35.166.182.171]) by smtp-out-n07.prod.us-west-2.postgun.com with SMTP id 5f312dd21e4d3989d44f1a4c (version=TLS1.2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256); Mon, 10 Aug 2020 11:21:54 GMT Received: by smtp.codeaurora.org (Postfix, from userid 1001) id EA1D5C433CA; Mon, 10 Aug 2020 11:21:53 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-caf-mail-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.0 required=2.0 tests=ALL_TRUSTED,SPF_NONE autolearn=ham autolearn_force=no version=3.4.0 Received: from mkshah-linux.qualcomm.com (unknown [202.46.22.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: mkshah) by smtp.codeaurora.org (Postfix) with ESMTPSA id ECA6DC433C9; Mon, 10 Aug 2020 11:21:48 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org ECA6DC433C9 Authentication-Results: aws-us-west-2-caf-mail-1.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: aws-us-west-2-caf-mail-1.web.codeaurora.org; spf=none smtp.mailfrom=mkshah@codeaurora.org From: Maulik Shah To: bjorn.andersson@linaro.org, maz@kernel.org, linus.walleij@linaro.org, swboyd@chromium.org, evgreen@chromium.org, mka@chromium.org Cc: linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-gpio@vger.kernel.org, agross@kernel.org, tglx@linutronix.de, jason@lakedaemon.net, dianders@chromium.org, rnayak@codeaurora.org, ilina@codeaurora.org, lsrao@codeaurora.org, Maulik Shah Subject: [PATCH v4 7/7] irqchip: qcom-pdc: Reset all pdc interrupts during init Date: Mon, 10 Aug 2020 16:51:00 +0530 Message-Id: <1597058460-16211-8-git-send-email-mkshah@codeaurora.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1597058460-16211-1-git-send-email-mkshah@codeaurora.org> References: <1597058460-16211-1-git-send-email-mkshah@codeaurora.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Clear previous kernel's configuration during init by resetting interrupts in enable bank to zero. Suggested-by: Stephen Boyd Signed-off-by: Maulik Shah --- drivers/irqchip/qcom-pdc.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/drivers/irqchip/qcom-pdc.c b/drivers/irqchip/qcom-pdc.c index dfcdfc5..80e0dfb 100644 --- a/drivers/irqchip/qcom-pdc.c +++ b/drivers/irqchip/qcom-pdc.c @@ -389,7 +389,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) @@ -418,6 +419,15 @@ static int pdc_setup_pin_mapping(struct device_node *np) &pdc_region[n].cnt); if (ret) return ret; + + for (i = pdc_region[n].pin_base; i < pdc_region[n].pin_base + + pdc_region[n].cnt; i++) { + reg_index = i / 32; + irq_index = i % 32; + val = pdc_reg_read(IRQ_ENABLE_BANK, reg_index); + val &= ~BIT(irq_index); + pdc_reg_write(IRQ_ENABLE_BANK, reg_index, val); + } } return 0; -- QUALCOMM INDIA, on behalf of Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, hosted by The Linux Foundation