From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.1 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D6D66C433DF for ; Wed, 1 Jul 2020 22:41:48 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id B2BA420853 for ; Wed, 1 Jul 2020 22:41:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1593643308; bh=n2vGfZSBPjybhWDA+g1S8i5WOzxKsIimFmP4WaB3i/k=; h=Date:From:To:Cc:Subject:In-Reply-To:List-ID:From; b=J/Y7yL8KyKW1ojRjxEaytBwBDEwx3S9hIe0sszJakZhW0mjUTYCF0LlPsQbO1K8+F xnRyItQsO3CdqSY6e455/zAg95TfadVIWA4NEA+J68rAmQeS2nuv1YLnKjyCfHcN2b PqJeFbPPzv7SPY/n1Z3RxjYDrvGzRlIX4UG/s/TY= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726312AbgGAWls (ORCPT ); Wed, 1 Jul 2020 18:41:48 -0400 Received: from mail.kernel.org ([198.145.29.99]:55040 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726114AbgGAWlr (ORCPT ); Wed, 1 Jul 2020 18:41:47 -0400 Received: from localhost (mobile-166-175-191-139.mycingular.net [166.175.191.139]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id ED3362082F; Wed, 1 Jul 2020 22:41:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1593643307; bh=n2vGfZSBPjybhWDA+g1S8i5WOzxKsIimFmP4WaB3i/k=; h=Date:From:To:Cc:Subject:In-Reply-To:From; b=TUG0m1DmEwhAYs7l/5QTJrOhDJDby5unDa852whT5oB/UNlvATBgfsnl/26I5DcA/ vpv2Nom93bhpOJJw0DR+hmCK4/MgE+GNHnfgbqO005+8G7SDuA6AOtBSfyjIbvWSd3 yiteYTEVRnZ5ALyh3h6W2QSfOliqQVipE5abOG0s= Date: Wed, 1 Jul 2020 17:41:45 -0500 From: Bjorn Helgaas To: Fabio Estevam Cc: Marek Vasut , Ksenija Stanojevic , Dmitry Torokhov , linux-input@vger.kernel.org, linux-kernel@vger.kernel.org, Rob Herring Subject: Re: mxs_lradc_ts: Warning due to "0 is an invalid IRQ number" Message-ID: <20200701224145.GA3616172@bjorn-Precision-5520> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org [+cc Rob, LKML for visibility & archive] On Wed, Jul 01, 2020 at 12:32:48PM -0300, Fabio Estevam wrote: > On Tue, Jun 16, 2020 at 8:52 PM Fabio Estevam wrote: > > I am seeing the following warning on a imx28-evk running linux-next: > > > > [ 7.625012] ------------[ cut here ]------------ > > [ 7.630111] WARNING: CPU: 0 PID: 1 at drivers/base/platform.c:317 > > __platform_get_irq_byname+0x74/0x90 > > [ 7.639692] 0 is an invalid IRQ number > > [ 7.643540] Modules linked in: > > [ 7.646961] CPU: 0 PID: 1 Comm: swapper Not tainted > > 5.8.0-rc1-next-20200616-dirty #92 > > [ 7.654896] Hardware name: Freescale MXS (Device Tree) > > [ 7.660434] [] (unwind_backtrace) from [] > > (show_stack+0x10/0x14) > > [ 7.668591] [] (show_stack) from [] (__warn+0xe4/0x108) > > [ 7.675941] [] (__warn) from [] > > (warn_slowpath_fmt+0x6c/0xb8) > > [ 7.683575] [] (warn_slowpath_fmt) from [] > > (__platform_get_irq_byname+0x74/0x90) > > [ 7.693101] [] (__platform_get_irq_byname) from > > [] (platform_get_irq_byname+0x10/0x48) > > [ 7.703154] [] (platform_get_irq_byname) from > > [] (mxs_lradc_ts_probe+0x190/0x384) > > [ 7.712771] [] (mxs_lradc_ts_probe) from [] > > (platform_drv_probe+0x48/0x98) > > [ 7.722806] [] (platform_drv_probe) from [] > > (really_probe+0x218/0x348) > > [ 7.731530] [] (really_probe) from [] > > (driver_probe_device+0x58/0xb4) > > [ 7.740189] [] (driver_probe_device) from [] > > (device_driver_attach+0x58/0x60) > > [ 7.749471] [] (device_driver_attach) from [] > > (__driver_attach+0x84/0xc0) > > [ 7.758394] [] (__driver_attach) from [] > > (bus_for_each_dev+0x70/0xb4) > > [ 7.766977] [] (bus_for_each_dev) from [] > > (bus_add_driver+0x154/0x1e0) > > [ 7.775385] [] (bus_add_driver) from [] > > (driver_register+0x74/0x108) > > [ 7.783872] [] (driver_register) from [] > > (do_one_initcall+0x68/0x268) > > [ 7.792467] [] (do_one_initcall) from [] > > (kernel_init_freeable+0x160/0x1f4) > > [ 7.801661] [] (kernel_init_freeable) from [] > > (kernel_init+0x8/0xf4) > > [ 7.810165] [] (kernel_init) from [] > > (ret_from_fork+0x14/0x24) > > [ 7.818101] Exception stack(0xc748dfb0 to 0xc748dff8) > > [ 7.823273] dfa0: 00000000 > > 00000000 00000000 00000000 > > [ 7.831815] dfc0: 00000000 00000000 00000000 00000000 00000000 > > 00000000 00000000 00000000 > > [ 7.840351] dfe0: 00000000 00000000 00000000 00000000 00000013 00000000 > > [ 7.847322] irq event stamp: 273303 > > [ 7.850940] hardirqs last enabled at (273311): [] > > console_unlock+0x390/0x534 > > [ 7.859314] hardirqs last disabled at (273328): [] > > console_unlock+0x44/0x534 > > [ 7.867605] softirqs last enabled at (273344): [] > > __do_softirq+0x2d4/0x450 > > [ 7.875817] softirqs last disabled at (273355): [] > > irq_exit+0x150/0x174 > > [ 7.883472] ---[ end trace ddb222ada5cbf5cd ]--- > > [ 7.900004] input: mxs-lradc-ts as > > /devices/soc0/80000000.apb/80040000.apbx/80050000.lradc/mxs-lradc-ts/input/input0 > > > > The touchscreen irq is defined as: > > > > enum mx28_lradc_irqs { > > MX28_LRADC_TS_IRQ = 0, > > > > Shouldn't we retrieve the IRQ number from the device tree instead? mxs_lradc_ts_probe() { ... irq = platform_get_irq_byname(pdev, mxs_lradc_ts_irq_names[i]); if (irq < 0) return irq; virq = irq_of_parse_and_map(node, irq); ... } That's not right, is it? irq_of_parse_and_map() takes an *index*, but we're passing an IRQ. mxs_lradc_adc_probe() also has the same pattern.