From patchwork Mon Jun 24 15:35:18 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Javier Martinez Canillas X-Patchwork-Id: 2772041 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id F3167C0AB1 for ; Mon, 24 Jun 2013 15:36:12 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id A8739200C7 for ; Mon, 24 Jun 2013 15:36:11 +0000 (UTC) Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 3951F2009C for ; Mon, 24 Jun 2013 15:36:10 +0000 (UTC) Received: from merlin.infradead.org ([2001:4978:20e::2]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1Ur8oI-0002lY-QP; Mon, 24 Jun 2013 15:36:07 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1Ur8oG-0005I3-6K; Mon, 24 Jun 2013 15:36:04 +0000 Received: from mail-vb0-x234.google.com ([2607:f8b0:400c:c02::234]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1Ur8oB-0005HK-VI for linux-arm-kernel@lists.infradead.org; Mon, 24 Jun 2013 15:36:01 +0000 Received: by mail-vb0-f52.google.com with SMTP id f12so8269086vbg.39 for ; Mon, 24 Jun 2013 08:35:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type; bh=yGbLkAFEhlm1UddV/cj+g0eEa+aF0o/+X6a3iuozMZo=; b=gvxdYlx2u10d9SOnqKKlT1fa8gN2wkmDQUVUkMayMXk7cZzMG7v2TzTxicu/wyDeve qROqyk0mmkcdUx4XPqSyboCESQzST1c+336VkXUcBjOfYS7wX4s/1Qlpt7omON7PZcir DSGG2GiOKkcaOm7a2YJEMKvQy+Bl/HpbgRkn7kZsXy38dJK+LGttIN8KamhpKX8RWE5m 6YFvjntAcG+WqM8gK6InC6uJryq3CmGepL1QBF2u9Fkkil3PD7LzLOGmeFf4BKsjnn2L OBAJR+pS66gRPlSP58diEVFLKAitj9iXdW9xpw/aTru10uAoehw+ZrHFijp1X12EES9F IcdA== X-Received: by 10.58.236.42 with SMTP id ur10mr11612711vec.48.1372088138719; Mon, 24 Jun 2013 08:35:38 -0700 (PDT) MIME-Version: 1.0 Received: by 10.58.155.66 with HTTP; Mon, 24 Jun 2013 08:35:18 -0700 (PDT) In-Reply-To: <20130624072112.GQ5523@atomide.com> References: <20130516180933.GG5600@atomide.com> <20130516210006.GA31836@blackmetal.musicnaut.iki.fi> <20130516214430.GN5600@atomide.com> <20130520174621.GI10378@atomide.com> <20130605223355.EDC113E10E4@localhost> <20130606155341.GL3331@atomide.com> <20130623221605.GA3150@blackmetal.musicnaut.iki.fi> <20130623234326.GA20703@blackmetal.musicnaut.iki.fi> <20130624072112.GQ5523@atomide.com> From: Javier Martinez Canillas Date: Mon, 24 Jun 2013 17:35:18 +0200 Message-ID: Subject: Re: [BISECTED] 3.10-rc1 OMAP1 GPIO IRQ regression To: Tony Lindgren X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20130624_113600_179789_9A99A832 X-CRM114-Status: GOOD ( 37.18 ) X-Spam-Score: -2.0 (--) Cc: Grant Likely , Jon Hunter , linux-omap@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Aaro Koskinen X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-5.2 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP On Mon, Jun 24, 2013 at 9:21 AM, Tony Lindgren wrote: > * Javier Martinez Canillas [130623 18:08]: >> On Mon, Jun 24, 2013 at 1:43 AM, Aaro Koskinen wrote: >> > Hi, >> > >> > On Mon, Jun 24, 2013 at 01:06:37AM +0200, Javier Martinez Canillas wrote: >> >> On Mon, Jun 24, 2013 at 12:16 AM, Aaro Koskinen wrote: >> >> > What is the status of this patch? We're already at 3.10-rc7 and GPIO >> >> > IRQs are still broken on OMAP1. >> > >> > [...] >> > >> >> There is a problem with this patch. >> > >> > [...] >> > >> >> So I think that the correct solution is to add SPARSE_IRQ support to >> >> omap1 and not reverting Jon's patch. Of course this may not be >> >> possible since we are so close to 3.10 and most OMAP patches already >> >> merged for 3.11 but we should definitely try to have this at least for >> >> 3.12. Otherwise we won't be able to move to DT-only booting for >> >> OMAP2+. >> > >> > OMAP1 does not use DT. So we could put this code under #ifdef >> > CONFIG_ARCH_OMAP1 or similar. It's just a few lines of code. OMAP2+ >> > work should not regress OMAP1. >> > >> > Demanding SPARSE_IRQ support for OMAP1 should have been discussed before >> > these changes were made. It's not reasonable to assume such things can >> > be made during rc-cycle. Also, now, I don't think it's reasonable to >> > wait for that to be done, as it would take until 3.12 or even later to >> > get OMAP1 functional again. >> > >> > A. >> >> Hi, >> >> Yes, since we are so late in the -rc cycle and OMAP1 is currently >> broken I agree that the only sensible solution is to revert the patch >> for now. > > Agreed. > >> I just wanted to point out the issue that keeping the OMAP GPIO driver >> using legacy mapping domain represents a blocker to have GPIO-IRQ >> working with Device Tree for OMAP2+ > > Yes. We can do the ifdef Aaro suggested, and let's also plan on > converting omap1 to use SPARSE_IRQ. But with the ifdef we can cut > away the dependency between these two. > > Regards, > > Tony Ok, so something like the following patch should do it (tested on an OMAP3 board): From b9e262c688fb7f3ad733f140b55dddbc8e4716e6 Mon Sep 17 00:00:00 2001 From: Javier Martinez Canillas Date: Mon, 24 Jun 2013 17:13:23 +0200 Subject: [PATCH 1/1] gpio/omap: don't use linear domain mapping for OMAP1 commit ede4d7a5 ("gpio/omap: convert gpio irq domain to linear mapping") converted the OMAP GPIO driver to use a linear mapping for the GPIO IRQ domain instead of using a legacy mapping. Not using a legacy mapping has a number of benefits but it requires the platform to support SPARSE_IRQ which currently is not supported on OMAP1. So this change caused a regression on OMAP1 platforms [1]. Since this issue is not present on all OMAP2+ platforms, there is no need to revert the driver to use legacy domain mapping for all the platforms. [1]: http://www.mail-archive.com/linux-omap@vger.kernel.org/msg89005.html Signed-off-by: Javier Martinez Canillas Tested-by: Aaro Koskinen --- drivers/gpio/gpio-omap.c | 22 +++++++++++++++++++++- 1 files changed, 21 insertions(+), 1 deletions(-) diff --git a/drivers/gpio/gpio-omap.c b/drivers/gpio/gpio-omap.c index d3f7d2d..4a43036 100644 --- a/drivers/gpio/gpio-omap.c +++ b/drivers/gpio/gpio-omap.c @@ -1094,6 +1094,9 @@ static int omap_gpio_probe(struct platform_device *pdev) const struct omap_gpio_platform_data *pdata; struct resource *res; struct gpio_bank *bank; +#ifdef CONFIG_ARCH_OMAP1 + int irq_base; +#endif match = of_match_device(of_match_ptr(omap_gpio_match), dev); @@ -1135,11 +1138,28 @@ static int omap_gpio_probe(struct platform_device *pdev) pdata->get_context_loss_count; } +#ifdef CONFIG_ARCH_OMAP1 + /* + * REVISIT: Once we have OMAP1 supporting SPARSE_IRQ, we can drop + * irq_alloc_descs() and irq_domain_add_legacy() and just use a + * linear IRQ domain mapping for all OMAP platforms. + */ + irq_base = irq_alloc_descs(-1, 0, bank->width, 0); + if (irq_base < 0) { + dev_err(dev, "Couldn't allocate IRQ numbers\n"); + return -ENODEV; + } + bank->domain = irq_domain_add_legacy(node, bank->width, irq_base, + 0, &irq_domain_simple_ops, NULL); +#else bank->domain = irq_domain_add_linear(node, bank->width, &irq_domain_simple_ops, NULL); - if (!bank->domain) +#endif + if (!bank->domain) { + dev_err(dev, "Couldn't register an IRQ domain\n"); return -ENODEV; + } if (bank->regs->set_dataout && bank->regs->clr_dataout) bank->set_dataout = _set_gpio_dataout_reg;