From patchwork Sat Aug 6 08:18:03 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 73395 Delivered-To: patch@linaro.org Received: by 10.140.29.52 with SMTP id a49csp2547776qga; Sat, 6 Aug 2016 15:17:31 -0700 (PDT) X-Received: by 10.66.52.47 with SMTP id q15mr147538649pao.67.1470521851655; Sat, 06 Aug 2016 15:17:31 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id bn10si28083739pac.174.2016.08.06.15.17.31; Sat, 06 Aug 2016 15:17:31 -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=@linaro.org; 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 dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752112AbcHFWR3 (ORCPT + 27 others); Sat, 6 Aug 2016 18:17:29 -0400 Received: from mail-lf0-f42.google.com ([209.85.215.42]:35861 "EHLO mail-lf0-f42.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751989AbcHFWR2 (ORCPT ); Sat, 6 Aug 2016 18:17:28 -0400 Received: by mail-lf0-f42.google.com with SMTP id g62so224724311lfe.3 for ; Sat, 06 Aug 2016 15:17:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=tW2H8uwLhBxni7YpF5KR3uhn4YrurI93Y4XFHYDhbHQ=; b=F2QpC/M9h8R7Oop9gr3FjuCu7mjUmHssurqdUb/VL/wRQ/zXaW7rqNFw5c6azkfARm wpEHsdErUtZPCiQ0OXxx2oregE7RuyRfHKU3ZnGNMFCdAONyUGoxa2sKnQM4Y5oBOL2V +Q6HKPuDQ3tPCJ3cvu2VmNXMkxAk11Xsq1ZNE= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=tW2H8uwLhBxni7YpF5KR3uhn4YrurI93Y4XFHYDhbHQ=; b=J1eC52532jDFu9IBoJzrar9GFJvUuBFLnSB9upFgqIHRQr0wW/X65LrFFiPKCY/LFQ qvSJ0YJdqxGthmcgWnYSzyo/UIeJlIjNHL5ApiauYQ1OV4uUkdTOnbXLlokMNipkRmwG vWA/J1QsEyJHnOTLHftB3ZxoGFfVck+CAfEjl5kUtGoxmjhd65tfo50m9VFKuXJDAHNl 0YB6HsqjXy4aGzGX7n6gtmwBz0ueKeebGrT1a9ht1TWaoZWrN2XhD1j4M0o1F0IgxFEq tZPxyDa5khHNk85avkiWLrep3wtOnlKMx7LIcGmotgb1GKUccUSw0iiYQWdw116AC7Dh aUBw== X-Gm-Message-State: AEkoouui3qsktqoBFmCDkezlnIPL8WZ1hi2YYahIjyxlOMAYIvyP5I4XK2H0maws4pRqyZv4 X-Received: by 10.25.22.97 with SMTP id m94mr25733775lfi.70.1470471489540; Sat, 06 Aug 2016 01:18:09 -0700 (PDT) Received: from localhost.localdomain.localdomain (c-357171d5.014-348-6c756e10.cust.bredbandsbolaget.se. [213.113.113.53]) by smtp.gmail.com with ESMTPSA id 192sm3809350ljf.17.2016.08.06.01.18.08 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 06 Aug 2016 01:18:08 -0700 (PDT) From: Linus Walleij To: Thomas Gleixner , Marc Zyngier , John Stultz Cc: linux-kernel@vger.kernel.org, Linus Walleij , Jon Hunter , =?UTF-8?q?Bj=C3=B6rn=20Andersson?= , Stephen Boyd , Abhijeet Dharmapurikar Subject: [PATCH] Revert "irqdomain: Don't set type when mapping an IRQ" Date: Sat, 6 Aug 2016 10:18:03 +0200 Message-Id: <1470471483-1432-1-git-send-email-linus.walleij@linaro.org> X-Mailer: git-send-email 2.7.4 MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This reverts commit 1e2a7d78499ec8859d2b469051b7b80bad3b08aa. When using the APQ8060 Dragonboard I have lost all interrupts from the PMIC after this commit: power button, keypad, RTC alarm and all GPIOs. Reverting the commit solves the issue. The affected irqchip driver is drivers/mfd/pm8921-core.c I cannot immediately see what the problem is, so if you have a better solution than just reverting the patch, please suggest. Cc: Jon Hunter Cc: Marc Zyngier Cc: Thomas Gleixner Cc: John Stultz Cc: Björn Andersson Cc: Stephen Boyd Cc: Abhijeet Dharmapurikar Signed-off-by: Linus Walleij --- I am pretty sure that this is the same bug that John Stultz is seeing on the Nexus 7, John: please confirm. --- include/linux/irqdomain.h | 3 --- kernel/irq/irqdomain.c | 23 +++++------------------ 2 files changed, 5 insertions(+), 21 deletions(-) -- 2.7.4 diff --git a/include/linux/irqdomain.h b/include/linux/irqdomain.h index ffb84604c1de..1aee0fbe900e 100644 --- a/include/linux/irqdomain.h +++ b/include/linux/irqdomain.h @@ -455,9 +455,6 @@ static inline int irq_domain_alloc_irqs(struct irq_domain *domain, return -1; } -static inline void irq_domain_free_irqs(unsigned int virq, - unsigned int nr_irqs) { } - static inline bool irq_domain_is_hierarchy(struct irq_domain *domain) { return false; diff --git a/kernel/irq/irqdomain.c b/kernel/irq/irqdomain.c index 4752b43662e0..9ba6a6ec4408 100644 --- a/kernel/irq/irqdomain.c +++ b/kernel/irq/irqdomain.c @@ -567,7 +567,6 @@ static void of_phandle_args_to_fwspec(struct of_phandle_args *irq_data, unsigned int irq_create_fwspec_mapping(struct irq_fwspec *fwspec) { struct irq_domain *domain; - struct irq_data *irq_data; irq_hw_number_t hwirq; unsigned int type = IRQ_TYPE_NONE; int virq; @@ -615,11 +614,7 @@ unsigned int irq_create_fwspec_mapping(struct irq_fwspec *fwspec) * it now and return the interrupt number. */ if (irq_get_trigger_type(virq) == IRQ_TYPE_NONE) { - irq_data = irq_get_irq_data(virq); - if (!irq_data) - return 0; - - irqd_set_trigger_type(irq_data, type); + irq_set_irq_type(virq, type); return virq; } @@ -639,18 +634,10 @@ unsigned int irq_create_fwspec_mapping(struct irq_fwspec *fwspec) return virq; } - irq_data = irq_get_irq_data(virq); - if (!irq_data) { - if (irq_domain_is_hierarchy(domain)) - irq_domain_free_irqs(virq, 1); - else - irq_dispose_mapping(virq); - return 0; - } - - /* Store trigger type */ - irqd_set_trigger_type(irq_data, type); - + /* Set type if specified and different than the current one */ + if (type != IRQ_TYPE_NONE && + type != irq_get_trigger_type(virq)) + irq_set_irq_type(virq, type); return virq; } EXPORT_SYMBOL_GPL(irq_create_fwspec_mapping);