From patchwork Fri Feb 8 12:36:35 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Brian Masney X-Patchwork-Id: 10803025 X-Patchwork-Delegate: agross@codeaurora.org Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id AD6BB922 for ; Fri, 8 Feb 2019 12:36:55 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 98A522DCC5 for ; Fri, 8 Feb 2019 12:36:55 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8BFAB2DE75; Fri, 8 Feb 2019 12:36:55 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.7 required=2.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EF9B72DCC5 for ; Fri, 8 Feb 2019 12:36:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727253AbfBHMgt (ORCPT ); Fri, 8 Feb 2019 07:36:49 -0500 Received: from onstation.org ([52.200.56.107]:36118 "EHLO onstation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726547AbfBHMgr (ORCPT ); Fri, 8 Feb 2019 07:36:47 -0500 Received: from xilitla.corp.homestore.net (c-98-239-145-235.hsd1.wv.comcast.net [98.239.145.235]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: masneyb) by onstation.org (Postfix) with ESMTPSA id 5B8CF167; Fri, 8 Feb 2019 12:36:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=onstation.org; s=default; t=1549629406; bh=NQAgLIkej0qo4K7KZhSM4e805UeNbxIJ95v1NUnfvg0=; h=From:To:Cc:Subject:Date:From; b=lfXbiGgz9wfP+1clODanCTXXv0Ur5UM7vRXN9oj8fQkrGPq/mkbkdWWRJrnWsQXm6 vWALCX8gQlMfNxmMNEN//+2V4E1zOGAMAYsMjL3SBxLDLh5gRHayqRoB4kd8pkbI56 NMv/yOt9/qi30f+rBbeN/jfWQGprC6xg84Jzjg7s= From: Brian Masney To: linus.walleij@linaro.org Cc: sboyd@kernel.org, bjorn.andersson@linaro.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-gpio@vger.kernel.org Subject: [PATCH -next] spmi: pmic-arb: revert "validate type when mapping IRQ" Date: Fri, 8 Feb 2019 07:36:35 -0500 Message-Id: <20190208123635.26755-1-masneyb@onstation.org> X-Mailer: git-send-email 2.17.2 Sender: linux-arm-msm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Validation of the IRQ type was added to spmi pmic-arb, however spmi-mpp in device tree still uses IRQ_TYPE_NONE. This commit caused the spmi-mpp probe to fail since platform_irq_count() would return 0. Correct this by backing out the previous patch. Signed-off-by: Brian Masney Fixes: 135ef21ab064 ("spmi: pmic-arb: validate type when mapping IRQ") --- Linus: I think that the better longer-term approach is to just embed the IRQ counts similar to what is now in spmi-gpio. Since we are getting close to the end of the dev cycle, I think it is safer to just drop the old patch for the time being. I'll commit to doing that work for the next dev cycle, although I can send you that change this weekend if you prefer that we go that route instead. My ssbi-gpio series does not have this issue. drivers/spmi/spmi-pmic-arb.c | 21 +++++++-------------- 1 file changed, 7 insertions(+), 14 deletions(-) diff --git a/drivers/spmi/spmi-pmic-arb.c b/drivers/spmi/spmi-pmic-arb.c index 316e2708f3ba..928759242e42 100644 --- a/drivers/spmi/spmi-pmic-arb.c +++ b/drivers/spmi/spmi-pmic-arb.c @@ -740,9 +740,9 @@ static int qpnpint_irq_domain_translate(struct irq_domain *d, } -static int qpnpint_irq_domain_map(struct spmi_pmic_arb *pmic_arb, - struct irq_domain *domain, unsigned int virq, - irq_hw_number_t hwirq, unsigned int type) +static void qpnpint_irq_domain_map(struct spmi_pmic_arb *pmic_arb, + struct irq_domain *domain, unsigned int virq, + irq_hw_number_t hwirq, unsigned int type) { irq_flow_handler_t handler; @@ -751,15 +751,11 @@ static int qpnpint_irq_domain_map(struct spmi_pmic_arb *pmic_arb, if (type & IRQ_TYPE_EDGE_BOTH) handler = handle_edge_irq; - else if (type & (IRQ_TYPE_LEVEL_LOW | IRQ_TYPE_LEVEL_HIGH)) - handler = handle_level_irq; else - return -EINVAL; + handler = handle_level_irq; irq_domain_set_info(domain, virq, hwirq, &pmic_arb_irqchip, pmic_arb, handler, NULL, NULL); - - return 0; } static int qpnpint_irq_domain_alloc(struct irq_domain *domain, @@ -776,12 +772,9 @@ static int qpnpint_irq_domain_alloc(struct irq_domain *domain, if (ret) return ret; - for (i = 0; i < nr_irqs; i++) { - ret = qpnpint_irq_domain_map(pmic_arb, domain, virq + i, - hwirq + i, type); - if (ret) - return ret; - } + for (i = 0; i < nr_irqs; i++) + qpnpint_irq_domain_map(pmic_arb, domain, virq + i, hwirq + i, + type); return 0; }