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=-8.6 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=unavailable 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 B2994C433E1 for ; Mon, 13 Jul 2020 03:02:40 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 889F220725 for ; Mon, 13 Jul 2020 03:02:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1594609360; bh=A6MPJdy59dkFtPa9jX+vGeKW7O3CRBwsu/PGmPjn/m8=; h=Date:From:To:Cc:Subject:References:In-Reply-To:List-ID:From; b=t1PJ3ZPkNmSulRHqQSMxKaCVVrFKvzaPZA8J8CYsFIZ/1vOd4PSeAzT8RR7VMSslE nP6YVIkFIfHJwMW2zqKR3ce51MK5cirUjBhHwOFjlD4GwgnrV2g6y+XTR2F+OaezOy 6Ho2uarnc29vEgFsL5fA5KWa84ROvTQElEmwqQ9I= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728382AbgGMDCj (ORCPT ); Sun, 12 Jul 2020 23:02:39 -0400 Received: from mail.kernel.org ([198.145.29.99]:60728 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725892AbgGMDCj (ORCPT ); Sun, 12 Jul 2020 23:02:39 -0400 Received: from dragon (80.251.214.228.16clouds.com [80.251.214.228]) (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 9469B206B6; Mon, 13 Jul 2020 03:02:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1594609358; bh=A6MPJdy59dkFtPa9jX+vGeKW7O3CRBwsu/PGmPjn/m8=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=sx3PcbYwo+zXw2RRuF8lp9DRqlIbxefoNHvUhg3JrzbmOc7KUM66c//BUPPIjKXpD aaD8pLeI6enKfN/RguUjg6kOwmv9IXQzolScyTx+RbpP4kLIHcHgmpMmWRNVklT5dB S/QmUy+IarrpW8gny58ZmeiHR6XaZ4EuSC3qt5aM= Date: Mon, 13 Jul 2020 11:02:33 +0800 From: Shawn Guo To: Guenter Roeck Cc: Russell King , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , NXP Linux Team , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Bjorn Helgaas Subject: Re: [PATCH] imx: Provide correct number of resources when registering gpio devices Message-ID: <20200713030232.GA21277@dragon> References: <20200701032651.12420-1-linux@roeck-us.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200701032651.12420-1-linux@roeck-us.net> User-Agent: Mutt/1.9.4 (2018-02-28) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jun 30, 2020 at 08:26:51PM -0700, Guenter Roeck wrote: > Since commit a85a6c86c25be ("driver core: platform: Clarify that IRQ 0 is > invalid"), the kernel is a bit touchy when it encounters interrupt 0. > As a result, there are lots of warnings such as the following when booting > systems such as 'kzm'. > > WARNING: CPU: 0 PID: 1 at drivers/base/platform.c:224 platform_get_irq_optional+0x118/0x128 > 0 is an invalid IRQ number > Modules linked in: > CPU: 0 PID: 1 Comm: swapper/0 Not tainted 5.8.0-rc3 #1 > Hardware name: Kyoto Microcomputer Co., Ltd. KZM-ARM11-01 > [] (unwind_backtrace) from [] (show_stack+0x10/0x14) > [] (show_stack) from [] (dump_stack+0xe8/0x120) > [] (dump_stack) from [] (__warn+0xe4/0x108) > [] (__warn) from [] (warn_slowpath_fmt+0x74/0xbc) > [] (warn_slowpath_fmt) from [] (platform_get_irq_optional+0x118/0x128) > [] (platform_get_irq_optional) from [] (platform_irq_count+0x20/0x3c) > [] (platform_irq_count) from [] (mxc_gpio_probe+0x8c/0x494) > [] (mxc_gpio_probe) from [] (platform_drv_probe+0x48/0x98) > [] (platform_drv_probe) from [] (really_probe+0x214/0x344) > [] (really_probe) from [] (driver_probe_device+0x58/0xb4) > [] (driver_probe_device) from [] (device_driver_attach+0x58/0x60) > [] (device_driver_attach) from [] (__driver_attach+0x84/0xc0) > [] (__driver_attach) from [] (bus_for_each_dev+0x78/0xb8) > [] (bus_for_each_dev) from [] (bus_add_driver+0x154/0x1e0) > [] (bus_add_driver) from [] (driver_register+0x74/0x108) > [] (driver_register) from [] (do_one_initcall+0x80/0x3b4) > [] (do_one_initcall) from [] (kernel_init_freeable+0x170/0x208) > [] (kernel_init_freeable) from [] (kernel_init+0x8/0x11c) > [] (kernel_init) from [] (ret_from_fork+0x14/0x20) > > As it turns out, mxc_register_gpio() is a bit lax when setting the > number of resources: it registers a resource with interrupt 0 when in > reality there is no such interrupt. Fix the problem by not declaring > the second interrupt resource if there is no second interrupt. > > Fixes: a85a6c86c25be ("driver core: platform: Clarify that IRQ 0 is invalid") > Cc: Bjorn Helgaas > Signed-off-by: Guenter Roeck I changed the subject prefix to 'ARM: imx: ...' and applied the patch. Shawn