From patchwork Thu Dec 20 09:20:15 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 13671 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id 7A3142418D for ; Thu, 20 Dec 2012 09:21:19 +0000 (UTC) Received: from mail-ie0-f170.google.com (mail-ie0-f170.google.com [209.85.223.170]) by fiordland.canonical.com (Postfix) with ESMTP id DAD5EA1857D for ; Thu, 20 Dec 2012 09:21:18 +0000 (UTC) Received: by mail-ie0-f170.google.com with SMTP id k10so4304399iea.29 for ; Thu, 20 Dec 2012 01:21:18 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:x-forwarded-to:x-forwarded-for:delivered-to:x-received :received-spf:from:to:cc:subject:date:message-id:x-mailer :mime-version:content-type:x-gm-message-state; bh=bADhRoVSfM9KcMIKz6l/BI0RGxfh6Lyc4QZZ6+0rFmI=; b=g+UmqyoT2/CW81s2P126KKIWuYG6OLSFhQ7p3aTqLPbSSqkA9/kQ9OiIZvNUujjzoM xLIEh+CIEaTYsmC98sIxtWRtDKkMHQ2rx0zjvVJbnm3D3Tr3hNs15Lu/9Y0gJe0qlkU4 YZvrFIJBw2T1sbPCUwzW0zXdTtFr1mDrIZnIHRsgTeqXToLHNDe4DK6+bv/tP3a8OPgl nfSytOogrQf2XYHS4FaU5vtKwaYd7RR/gbaj9eLNO0AzXYm4TjrycvmiFO/kazJVCVnG owd/d+Rg4UYDN461W2coMCS2kZiOvgtKtkd64aR/nnwjCHJrBVyCf6ZdByUphQ6Y0kpy fXVQ== X-Received: by 10.50.190.163 with SMTP id gr3mr4900651igc.106.1355995278313; Thu, 20 Dec 2012 01:21:18 -0800 (PST) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.50.67.115 with SMTP id m19csp16317igt; Thu, 20 Dec 2012 01:21:17 -0800 (PST) X-Received: by 10.14.213.134 with SMTP id a6mr21747712eep.45.1355995276754; Thu, 20 Dec 2012 01:21:16 -0800 (PST) Received: from eu1sys200aog112.obsmtp.com (eu1sys200aog112.obsmtp.com [207.126.144.133]) by mx.google.com with SMTP id s8si18770699eeo.79.2012.12.20.01.21.06 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 20 Dec 2012 01:21:16 -0800 (PST) Received-SPF: neutral (google.com: 207.126.144.133 is neither permitted nor denied by best guess record for domain of linus.walleij@stericsson.com) client-ip=207.126.144.133; Authentication-Results: mx.google.com; spf=neutral (google.com: 207.126.144.133 is neither permitted nor denied by best guess record for domain of linus.walleij@stericsson.com) smtp.mail=linus.walleij@stericsson.com Received: from beta.dmz-ap.st.com ([138.198.100.35]) (using TLSv1) by eu1sys200aob112.postini.com ([207.126.147.11]) with SMTP ID DSNKUNLYfKdKylWKkZMPwSovDSEJdNBz8f2j@postini.com; Thu, 20 Dec 2012 09:21:16 UTC Received: from zeta.dmz-ap.st.com (ns6.st.com [138.198.234.13]) by beta.dmz-ap.st.com (STMicroelectronics) with ESMTP id 21A69D8; Thu, 20 Dec 2012 09:12:09 +0000 (GMT) Received: from relay1.stm.gmessaging.net (unknown [10.230.100.17]) by zeta.dmz-ap.st.com (STMicroelectronics) with ESMTP id F36E01031; Thu, 20 Dec 2012 09:20:19 +0000 (GMT) Received: from exdcvycastm022.EQ1STM.local (alteon-source-exch [10.230.100.61]) (using TLSv1 with cipher RC4-MD5 (128/128 bits)) (Client CN "exdcvycastm022", Issuer "exdcvycastm022" (not verified)) by relay1.stm.gmessaging.net (Postfix) with ESMTPS id 7240724C2FE; Thu, 20 Dec 2012 10:20:14 +0100 (CET) Received: from steludxu4075.lud.stericsson.com (10.230.100.153) by smtp.stericsson.com (10.230.100.30) with Microsoft SMTP Server (TLS) id 8.3.83.0; Thu, 20 Dec 2012 10:20:18 +0100 From: Linus Walleij To: Samuel Ortiz , Cc: Anmar Oueja , Linus Walleij , , Lee Jones Subject: [PATCH v2] mfd: db8500-prcmu: fix irqdomain usage Date: Thu, 20 Dec 2012 10:20:15 +0100 Message-ID: <1355995215-6273-1-git-send-email-linus.walleij@stericsson.com> X-Mailer: git-send-email 1.7.11.3 MIME-Version: 1.0 X-Gm-Message-State: ALoCoQnjIFa6HXcUzjdJPM6sR45Yjo8lapHMJ0vZeVi3YyUDCzk4mqzZ3PGiJM4NtaYx/aoXq56r From: Linus Walleij This fixes two issues with the DB8500 PRCMU irqdomain: - You have to state the irq base 0 to get a linear domain for the DT case from irq_domain_add_simple() - The irqdomain was not used to translate the initial irq request using irq_create_mapping() making the linear case fail as it was lacking a proper descriptor. I took this opportunity to fix two lines of whitespace errors in related code as I was anyway messing around with it. Cc: stable@kernel.org Cc: Lee Jones Signed-off-by: Linus Walleij --- ChangeLog v1->v2: - Fix smallish whitespace error - Make sure not to call irq_create_mapping() in the fastpath, instead, right after creating the irqdomain call that for each wakeup source, and use irq_find_mapping() in fastpath. Hi Sam, this is a regression and as such should go into the -rc series. As you can see I also added the Cc: stable tag. Yours, Linus Walleij --- drivers/mfd/db8500-prcmu.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/drivers/mfd/db8500-prcmu.c b/drivers/mfd/db8500-prcmu.c index dc8826d..268f45d 100644 --- a/drivers/mfd/db8500-prcmu.c +++ b/drivers/mfd/db8500-prcmu.c @@ -2524,7 +2524,7 @@ static bool read_mailbox_0(void) for (n = 0; n < NUM_PRCMU_WAKEUPS; n++) { if (ev & prcmu_irq_bit[n]) - generic_handle_irq(IRQ_PRCMU_BASE + n); + generic_handle_irq(irq_find_mapping(db8500_irq_domain, n)); } r = true; break; @@ -2737,13 +2737,14 @@ static int db8500_irq_map(struct irq_domain *d, unsigned int virq, } static struct irq_domain_ops db8500_irq_ops = { - .map = db8500_irq_map, - .xlate = irq_domain_xlate_twocell, + .map = db8500_irq_map, + .xlate = irq_domain_xlate_twocell, }; static int db8500_irq_init(struct device_node *np) { - int irq_base = -1; + int irq_base = 0; + int i; /* In the device tree case, just take some IRQs */ if (!np) @@ -2758,6 +2759,10 @@ static int db8500_irq_init(struct device_node *np) return -ENOSYS; } + /* All wakeups will be used, so create mappings for all */ + for (i = 0; i < NUM_PRCMU_WAKEUPS; i++) + irq_create_mapping(db8500_irq_domain, i); + return 0; }