Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp997085ybt; Wed, 1 Jul 2020 15:44:17 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzMxyy1T2cOLhqA/3nKKvXXMkOlrITEfuhO/DvI0rV5zhGrm6mhd0L//jtZPtJmNGUNQZLr X-Received: by 2002:a50:ab53:: with SMTP id t19mr32013782edc.179.1593643457748; Wed, 01 Jul 2020 15:44:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1593643457; cv=none; d=google.com; s=arc-20160816; b=gdQrtD+5D7IKUttIdpiuk8DDPjC8gnFAKfm2S3Y4uVTLUEMBWQRvbMBwuKEkn6Oi1V Ho/nrXh1f2GJIx4S6gHcRiSH2MqTcctBKc1H5UF1kiqLUrZHwncMfqqSgaxWMb/GYc1Q l7WGoagT3qklHzxRQvppyZqMH9yzJQq/DEOngVP+c6jaLqA4adrQZwgbuXLCuAr5bWvI W1A42CW3DdVZQfr48hcz5l5QAV+i7UkmVXvlmdCtmMIAzIuwge3hE0P1MYyc5UsVtHo0 wVO4pmKWfLQgHL4LT2weEsCGuBa0rAQKVZVlLhGipC1V5eAim4sFAPfpOOb8M7mWEnpl 25Kw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:message-id:subject:cc:to:from:date:dkim-signature; bh=DOZ+sHgCKRlTDyYZBtj08kjwHV8JTAaWt7zFkP0IQM4=; b=AMqnVSsMBK2ajIPcuPRG4nwH4rEBHJ8SQWyxfTp582E0vryNr5cnx5O/hit3/NnW4K zMpUA9YPtXdSm7NQ6+aNUiLsG8YI+I0xAPclwoIpcntqPAjqgxKW4GD/hpBgqwMmBub5 auW2qqyDOfhDSaFgjIlTrAOLmMh11S1iJVKmbxfcG0n0ORqTmuwAYag7QPvltSYHKJHg CO3GKWfYuz+YIjyy+gz6epMBdLd2VjpCOreboNg9mDpqDdsolIp3wUYOK+94P/FIPLun oPipQlpu/eQ//fQccKABrbBBS1puCf7HgxmX2RKdjxs0kIzxdrLph3S7Je2ZIPWdTzLj 8m+Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=TUG0m1Dm; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id dt2si5482463ejc.596.2020.07.01.15.43.54; Wed, 01 Jul 2020 15:44:17 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=TUG0m1Dm; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726667AbgGAWls (ORCPT + 99 others); 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-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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.