From patchwork Tue Jun 20 16:51:30 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Wahren X-Patchwork-Id: 778413 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 3wsYmj1PNZz9s7f for ; Wed, 21 Jun 2017 02:52:37 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750927AbdFTQwa (ORCPT ); Tue, 20 Jun 2017 12:52:30 -0400 Received: from mout.kundenserver.de ([212.227.126.133]:54447 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751052AbdFTQwS (ORCPT ); Tue, 20 Jun 2017 12:52:18 -0400 Received: from oxbsltgw05.schlund.de ([172.19.249.22]) by mrelayeu.kundenserver.de (mreue003 [212.227.15.167]) with ESMTPSA (Nemesis) id 0M7Ws7-1dkmuK3wfP-00xJMl; Tue, 20 Jun 2017 18:51:31 +0200 Date: Tue, 20 Jun 2017 18:51:30 +0200 (CEST) From: Stefan Wahren To: Linus Walleij Cc: Eric Anholt , linux-gpio@vger.kernel.org, linux-rpi-kernel Message-ID: <975495226.218463.1497977490704@email.1und1.de> In-Reply-To: References: <2049796110.190734.1497905942101@email.1und1.de> Subject: Re: bcm2835_pinctrl_probe: WARNING: CPU: 0 PID: 1 at kernel/irq/chip.c:850 MIME-Version: 1.0 X-Priority: 3 Importance: Medium X-Mailer: Open-Xchange Mailer v7.8.2-Rev34 X-Originating-Client: open-xchange-appsuite X-Provags-ID: V03:K0:Xlk/0xr7RIjBZExCWKTJaAfniQmU/alaeoGcHh5ktlzkHdLsSVb 0cKza2bytuc5Cje6UmrwI8OFxLJqxDXrJ5Z2MnLPAGpkp6/P/OTptYA6yPq35ANX3wRJAvc SdFgXbwHRvSx046FB42YwGiho5v6mAwkzdXhCLACTBqTFwdYT9qYckZk/qYtDPORJGqikkH G3ytK0HDpmsok0ZJ/WPxg== X-UI-Out-Filterresults: notjunk:1; V01:K0:s7eHK+pca3k=:YddpK/S6ETBXP+CvkudT0X M5U5DlsbENJPyBXAH8kgdkO+gYyPyHhGMC3rSar4zVdxCynAPTkKfKq/tY1FpqnbrDyuyH+Wt wv3gKPRTxqPrKr7q4AfXDk6AnBh/hN4nNz2ChL2wzlHiRB0EGENmh8QSHdKpHCJPShWmWf9rw nmzg6Jv10/WHrYcwCg3hISs8gUKI9WOdkoMp84FpOpKJibFVAvewXc2gmO4gRXpvYXjrOhQ20 KWMyxQv3IlF5606neyA3bL5t3iIPNGtif3Jd6Dj7CqIeZlLu63H+PZQZ83HscSB7j4jy9qP4g mOOoJdS5849TwkaA/SVEhzuP69uMxeH0NMPBZYR/ZteQIwhV5TQZw+5EusX+n2omMP7dbUP0y Odqztu+Q86w5gqyVOq8zAWcOwhPlMd0RSwKlcDBuhjLU5Rt2gqPs+BCA7pqUB1B/ui5UhoRFf rj7wAIk45g2DxFgxXL1q1OjBXks64CNA8Z+ilDl5s+VT6H3/fRB4VY8C3rUSZ4OG6QiIcgjmd 3FNNqIVTP11ivf9Id4vp8JWoCM6CM82/JypFXmkW2/WfRfWKML2kpCOeH1nxurK7FW67gTaz8 3QPVCy/vEpnLCOqH2h3lJxvgQHud4L4IdJDIY/To1LfGFqVUfvelM8+qbtWbMMO+05xQUBIgv t8xUDmDyCxTxDbgtahGuvmnz44CZUBTMKc1TqxcGTcoAnOJMN2I++TGqXZRo1Gx1hRUr709F9 7JaLCdC2JMcQ+hP/ Sender: linux-gpio-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-gpio@vger.kernel.org Hi Linus, > Linus Walleij hat am 20. Juni 2017 um 13:32 geschrieben: > > > On Mon, Jun 19, 2017 at 10:59 PM, Stefan Wahren wrote: > > > i'm currently working Raspberry Pi Zero W support and had problems to boot with Mini UART > > (no sign of life after startup). After switching to pl011 with EARLY_PRINTK, the Zero W boots > > and i get the following output: > > (...) > > [ 0.255621] ------------[ cut here ]------------ > > [ 0.255742] WARNING: CPU: 0 PID: 1 at kernel/irq/chip.c:850 __irq_do_set_handler+0x4c/0x14c > > [ 0.255811] Modules linked in: > > [ 0.255862] CPU: 0 PID: 1 Comm: swapper Not tainted 4.12.0-rc5-next-20170616+ #3 > > [ 0.255924] Hardware name: Generic DT based system > > [ 0.256009] [] (unwind_backtrace) from [] (show_stack+0x20/0x24) > > [ 0.256109] [] (show_stack) from [] (dump_stack+0x20/0x28) > > [ 0.256204] [] (dump_stack) from [] (__warn+0xe4/0x110) > > [ 0.256270] [] (__warn) from [] (warn_slowpath_null+0x30/0x38) > > [ 0.256355] [] (warn_slowpath_null) from [] (__irq_do_set_handler+0x4c/0x14c) > > [ 0.256444] [] (__irq_do_set_handler) from [] (irq_set_chained_handler_and_data+0x4c/0x64) > > [ 0.256548] [] (irq_set_chained_handler_and_data) from [] (gpiochip_set_chained_irqchip+0x80/0xa0) > > [ 0.256641] [] (gpiochip_set_chained_irqchip) from [] (bcm2835_pinctrl_probe+0x31c/0x3c8) > > [ 0.256746] [] (bcm2835_pinctrl_probe) from [] (platform_drv_probe+0x60/0xac) > > [ 0.256840] [] (platform_drv_probe) from [] (driver_probe_device+0x1d8/0x438) > > [ 0.256929] [] (driver_probe_device) from [] (__driver_attach+0x9c/0x100) > > [ 0.257014] [] (__driver_attach) from [] (bus_for_each_dev+0x84/0x98) > > [ 0.257098] [] (bus_for_each_dev) from [] (driver_attach+0x28/0x30) > > [ 0.257181] [] (driver_attach) from [] (bus_add_drcm2835_pinctrl_driver_init+0x20/0x28) > > [ 0.257535] [] (bcm2835_pinctrl_driver_init) from [] (do_one_initcall+0xc0/0x188) > > [ 0.257635] [] (do_one_initcall) from [] (kernel_init_freeable+0x170/0x234) > > [ 0.257728] [] (kernel_init_freeable) from [] (kernel_init+0x18/0x11c) > > [ 0.257822] [] (kernel_init) from [] (ret_from_fork+0x14/0x3c) > > [ 0.257904] random: init_oops_id+0x30/0x4c get_random_bytes called with crng_init=0 > > [ 0.257980] ---[ end trace 9c0064da26f1596a ]--- > > [ 0.261962] Serial: 8250/16550 driver, 1 ports, IRQ sharing enabled > > [ 0.265460] libphy: Fixed MDIO Bus: probed > > ... > > > > According to the source code, this is the relevant line: > > > > if (WARN_ON(!irq_data || irq_data->chip == &no_irq_chip)) > > return; > > Isn't that because something is using the irqchip before the irqchip > is registered, so an initcall > problem? > > I don't really know how some stuff like irqchips deal with deferred > probe or if they even can. > > I had some similar patch the other day fixing something like this in > another driver, > I guess you can try reordering the initcalls. (Sorry.) > thanks, but it seems more trivial. The return value of irq_of_parse_and_map() wasn't check before calling gpiochip_set_chained_irqchip(). So this change (similar to a downstream patch) avoid this warning: > Yours, > Linus Walleij --- To unsubscribe from this list: send the line "unsubscribe linux-gpio" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/pinctrl/bcm/pinctrl-bcm2835.c b/drivers/pinctrl/bcm/pinctrl-bcm2835.c index 1eb7a1a..2a29128 100644 --- a/drivers/pinctrl/bcm/pinctrl-bcm2835.c +++ b/drivers/pinctrl/bcm/pinctrl-bcm2835.c @@ -1048,6 +1048,10 @@ static int bcm2835_pinctrl_probe(struct platform_device *pdev) for (i = 0; i < BCM2835_NUM_IRQS; i++) { pc->irq[i] = irq_of_parse_and_map(np, i); pc->irq_group[i] = i; + + if (pc->irq[i] == 0) + continue; + /* * Use the same handler for all groups: this is necessary * since we use one gpiochip to cover all lines - the