From patchwork Mon Jul 29 09:47:45 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Walmsley X-Patchwork-Id: 2834872 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 4F9069F9BE for ; Mon, 29 Jul 2013 09:48:20 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 566F320263 for ; Mon, 29 Jul 2013 09:48:19 +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 8E25820260 for ; Mon, 29 Jul 2013 09:48:14 +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 1V3k3o-0003QA-HB; Mon, 29 Jul 2013 09:48:12 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1V3k3m-0000O6-5L; Mon, 29 Jul 2013 09:48:10 +0000 Received: from utopia.booyaka.com ([74.50.51.50]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1V3k3j-0000MK-9Q for linux-arm-kernel@lists.infradead.org; Mon, 29 Jul 2013 09:48:07 +0000 Received: (qmail 6402 invoked by uid 1019); 29 Jul 2013 09:47:45 -0000 Date: Mon, 29 Jul 2013 09:47:45 +0000 (UTC) From: Paul Walmsley To: Javier Martinez Canillas Subject: Re: OMAP5912 boot broken by "gpio/omap: don't create an IRQ mapping for every GPIO on DT" In-Reply-To: <51F633AE.8090308@collabora.co.uk> Message-ID: References: <51F633AE.8090308@collabora.co.uk> User-Agent: Alpine 2.02 (DEB 1266 2009-07-14) MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20130729_054807_397916_258BB06C X-CRM114-Status: GOOD ( 20.46 ) X-Spam-Score: -1.9 (-) Cc: Kevin Hilman , Enric Balletbo i Serra , Linus Walleij , Grant Likely , Santosh Shilimkar , Linux-OMAP , Jean-Christophe PLAGNIOL-VILLARD , "linux-arm-kernel@lists.infradead.org" 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.7 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, 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 Hi On Mon, 29 Jul 2013, Javier Martinez Canillas wrote: > I've looked at this and it seems that irq_create_mapping() does not call the > irq_domain_ops .map function handler since OMAP1 still uses legacy domain > mapping. I don't have an OMAP1 platform to test but could you please see if the > following patch [1] makes your OMAP1 platforms to boot again? > > But I agree with Linus and probably we should just go and revert the whole > series since it is very hard to get it right. In another thread a user reported > that this change also broke his DTS tree. > > I really tried to get this right without breaking anything but there are just > too many OMAP platforms behaving differently and most OMAP drivers are only half > converted to DT so this is really a can of worms. > > Thanks a lot and sorry for the inconvenience, > Javier > > [1]: > diff --git a/drivers/gpio/gpio-omap.c b/drivers/gpio/gpio-omap.c > index c57244e..f1c6da8 100644 > --- a/drivers/gpio/gpio-omap.c > +++ b/drivers/gpio/gpio-omap.c > @@ -1090,8 +1090,18 @@ static void omap_gpio_chip_init(struct gpio_bank *bank) > * are used as interrupts. > */ > if (!omap_gpio_chip_boot_dt(&bank->chip)) > - for (j = 0; j < bank->width; j++) > - irq_create_mapping(bank->domain, j); > + for (j = 0; j < bank->width; j++) { > + int irq = irq_create_mapping(bank->domain, j); > + irq_set_lockdep_class(irq, &gpio_lock_class); > + irq_set_chip_data(irq, bank); > + if (bank->is_mpuio) { > + omap_mpuio_alloc_gc(bank, irq, bank->width); > + } else { > + irq_set_chip_and_handler(irq, &gpio_irq_chip, > + handle_simple_irq); > + set_irq_flags(irq, IRQF_VALID); > + } > + } > irq_set_chained_handler(bank->irq, gpio_irq_handler); > irq_set_handler_data(bank->irq, bank); > For some reason this patch didn't apply cleanly on v3.11-rc3, so hand-applied the following patch. It still doesn't boot on v3.11-rc3: http://www.pwsan.com/omap/testlogs/bisect_5912osk_boot_fail_v3.11-rc3/20130729032525/boot/5912osk/5912osk_log.txt - Paul diff --git a/drivers/gpio/gpio-omap.c b/drivers/gpio/gpio-omap.c index c57244e..23da829 100644 --- a/drivers/gpio/gpio-omap.c +++ b/drivers/gpio/gpio-omap.c @@ -1090,8 +1090,19 @@ static void omap_gpio_chip_init(struct gpio_bank *bank) * are used as interrupts. */ if (!omap_gpio_chip_boot_dt(&bank->chip)) - for (j = 0; j < bank->width; j++) - irq_create_mapping(bank->domain, j); + for (j = 0; j < bank->width; j++) { + int irq = irq_create_mapping(bank->domain, j); + irq_set_lockdep_class(irq, &gpio_lock_class); + irq_set_chip_data(irq, bank); + if (bank->is_mpuio) { + omap_mpuio_alloc_gc(bank, irq, bank->width); + } else { + irq_set_chip_and_handler(irq, &gpio_irq_chip, + handle_simple_irq); + set_irq_flags(irq, IRQF_VALID); + } + } + irq_set_chained_handler(bank->irq, gpio_irq_handler); irq_set_handler_data(bank->irq, bank); }