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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9E114C636CB for ; Mon, 30 Jan 2023 15:15:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235767AbjA3PPu (ORCPT ); Mon, 30 Jan 2023 10:15:50 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56360 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233899AbjA3PPt (ORCPT ); Mon, 30 Jan 2023 10:15:49 -0500 Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 44B4B7D9E; Mon, 30 Jan 2023 07:15:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1675091731; x=1706627731; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=sHTH4Fb1UVQO0e1p03P9FkMbWtn4FgWc5eKBC3Ljb/o=; b=bWzAiYkStroU8t6C33fojEm8z83H6KZy/YDyq9+2RO6PwjRna6IgTIeI b4c0SY1BRRNb4a88Cklt1jYfm1OFn3/PP1oYVhs++rF/SiS3dPLf8Bfcg 6o51xnFsc7IlG64U5x/VtarXpdqxOqN1a+cBbx0dc8jWjhZLxDPclVZrJ frDC1jGSAa6IIUooH5J63ZkThCv8fhEcjBFCmznJPFPuLPD/PNLVsKBbw B15+TmoqIY4fAkSkya6IbcmcLl8bqGUAJ2WST0+XraemYSCcsv99uNA1C hsjYGltax66nn2vc4JrYtf0HNFnC0T7uGhEeIuRHvHDc4w6RQO32TBam+ A==; X-IronPort-AV: E=McAfee;i="6500,9779,10606"; a="325277255" X-IronPort-AV: E=Sophos;i="5.97,258,1669104000"; d="scan'208";a="325277255" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 Jan 2023 07:14:50 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10606"; a="694585450" X-IronPort-AV: E=Sophos;i="5.97,258,1669104000"; d="scan'208";a="694585450" Received: from smile.fi.intel.com ([10.237.72.54]) by orsmga008.jf.intel.com with ESMTP; 30 Jan 2023 07:14:38 -0800 Received: from andy by smile.fi.intel.com with local (Exim 4.96) (envelope-from ) id 1pMVrd-00HPJg-2Q; Mon, 30 Jan 2023 17:14:33 +0200 Date: Mon, 30 Jan 2023 17:14:33 +0200 From: Andy Shevchenko To: Sudeep Holla Cc: Saravana Kannan , Greg Kroah-Hartman , "Rafael J. Wysocki" , Cristian Marussi , Linus Walleij , Bartosz Golaszewski , Thomas Gleixner , Marc Zyngier , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , NXP Linux Team , Rob Herring , Frank Rowand , Geert Uytterhoeven , Magnus Damm , Len Brown , Daniel Scally , Heikki Krogerus , Sakari Ailus , Tony Lindgren , Linux Kernel Functional Testing , Naresh Kamboju , Abel Vesa , Alexander Stein , Geert Uytterhoeven , John Stultz , Doug Anderson , Guenter Roeck , Dmitry Baryshkov , Maxim Kiselev , Maxim Kochetkov , Miquel Raynal , Luca Weiss , Colin Foster , Martin Kepplinger , Jean-Philippe Brucker , kernel-team@android.com, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-gpio@vger.kernel.org, devicetree@vger.kernel.org, linux-renesas-soc@vger.kernel.org, linux-acpi@vger.kernel.org Subject: Re: [PATCH v2 04/11] gpiolib: Clear the gpio_device's fwnode initialized flag before adding Message-ID: References: <20230127001141.407071-1-saravanak@google.com> <20230127001141.407071-5-saravanak@google.com> <20230130143153.67dsxn4lugfetfwb@bogus> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230130143153.67dsxn4lugfetfwb@bogus> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org On Mon, Jan 30, 2023 at 02:31:53PM +0000, Sudeep Holla wrote: > On Thu, Jan 26, 2023 at 04:11:31PM -0800, Saravana Kannan wrote: > > Registering an irqdomain sets the flag for the fwnode. But having the > > flag set when a device is added is interpreted by fw_devlink to mean the > > device has already been initialized and will never probe. This prevents > > fw_devlink from creating device links with the gpio_device as a > > supplier. So, clear the flag before adding the device. ... > > + /* > > + * If fwnode doesn't belong to another device, it's safe to clear its > > + * initialized flag. > > + */ > > + if (!gdev->dev.fwnode->dev) > > + fwnode_dev_initialized(gdev->dev.fwnode, false); > > This is the one causing the kernel crash during the boot on FVP which > Naresh has reported. Just reverted this and was able to boot, confirming > the issue with this patch. I'm wondering if if (!dev_fwnode(&gdev->dev)->dev) fwnode_dev_initialized(&dev_fwnode(gdev->dev), false); works. -- With Best Regards, Andy Shevchenko 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 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id F2787C54EAA for ; Mon, 30 Jan 2023 17:39:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=FsRxpAnLq5pIRXwqIprnz4Lpc7RtRsJr3ANFQ7pNG4A=; b=1ywL1ZOhIk2viI XDcTWAZeWHvFp6lkQBfIIHW9XuhhyKumP/FZovY0zTmS7ZdBDGA5vDJIOjaYfWTayv+rs4OnZlTRV K1nxIRuj/H1pnzzdNs6WddytoaeDU4/rr1NHKfAFNmr2WgVUvpbD446EHkeXON2zlcYC6SDfNMLkX sCjxp6BbD4kMLp3yqpHeO0NuYqtX5bWU3vcoW7BlNgY9GlkPsdv4+ebappHPYZPGiEbTvJHGZwvW+ N1cg14TQ/lhr3uuf4BJRKEJcAKZaNTHvL29eWVbFEB8NDk+nmVeoU0cGR29XYrcz/MalCfchfSueN bLdGugtYTbon1rGv2+6w==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1pMY6j-004dC4-8u; Mon, 30 Jan 2023 17:38:18 +0000 Received: from mga11.intel.com ([192.55.52.93]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1pMY5m-004cf2-UR for linux-arm-kernel@lists.infradead.org; Mon, 30 Jan 2023 17:37:20 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1675100238; x=1706636238; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=sHTH4Fb1UVQO0e1p03P9FkMbWtn4FgWc5eKBC3Ljb/o=; b=igWq4RufQlbw765dVN4uF8kOcUftxV2wKo3KlmZmSTBU2f0QOsBJbzR4 po3Zk2BT9GG4opObZ36HlDzQeF0TCaAEPagOkSM5E4dK7Gy8tIbkd+vze Kh/4Wkox+Ga7usWzrh7wyMO79HIfKOXYRbIhNjRmUvO3jzRgaFBF4S2OE 7Q2eWq8FSR8FG8SdtmJ12TRmPgH0jHhjYiQz+QGVR9SScjVyk9TrIGC1z IxX8U0rZPCy+P27Nx/3O7/qm6y55wlMusulayY1Khw01fWbsVrtHw5rUZ E3iXLtzZM6p7malhZdMoUxfe2QEqMbE6qtRjM/HbiATOEerKyJFJYLLHf Q==; X-IronPort-AV: E=McAfee;i="6500,9779,10606"; a="325277260" X-IronPort-AV: E=Sophos;i="5.97,258,1669104000"; d="scan'208";a="325277260" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 Jan 2023 07:14:50 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10606"; a="694585450" X-IronPort-AV: E=Sophos;i="5.97,258,1669104000"; d="scan'208";a="694585450" Received: from smile.fi.intel.com ([10.237.72.54]) by orsmga008.jf.intel.com with ESMTP; 30 Jan 2023 07:14:38 -0800 Received: from andy by smile.fi.intel.com with local (Exim 4.96) (envelope-from ) id 1pMVrd-00HPJg-2Q; Mon, 30 Jan 2023 17:14:33 +0200 Date: Mon, 30 Jan 2023 17:14:33 +0200 From: Andy Shevchenko To: Sudeep Holla Cc: Saravana Kannan , Greg Kroah-Hartman , "Rafael J. Wysocki" , Cristian Marussi , Linus Walleij , Bartosz Golaszewski , Thomas Gleixner , Marc Zyngier , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , NXP Linux Team , Rob Herring , Frank Rowand , Geert Uytterhoeven , Magnus Damm , Len Brown , Daniel Scally , Heikki Krogerus , Sakari Ailus , Tony Lindgren , Linux Kernel Functional Testing , Naresh Kamboju , Abel Vesa , Alexander Stein , Geert Uytterhoeven , John Stultz , Doug Anderson , Guenter Roeck , Dmitry Baryshkov , Maxim Kiselev , Maxim Kochetkov , Miquel Raynal , Luca Weiss , Colin Foster , Martin Kepplinger , Jean-Philippe Brucker , kernel-team@android.com, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-gpio@vger.kernel.org, devicetree@vger.kernel.org, linux-renesas-soc@vger.kernel.org, linux-acpi@vger.kernel.org Subject: Re: [PATCH v2 04/11] gpiolib: Clear the gpio_device's fwnode initialized flag before adding Message-ID: References: <20230127001141.407071-1-saravanak@google.com> <20230127001141.407071-5-saravanak@google.com> <20230130143153.67dsxn4lugfetfwb@bogus> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20230130143153.67dsxn4lugfetfwb@bogus> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230130_093719_048012_30F6C68C X-CRM114-Status: GOOD ( 21.12 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Mon, Jan 30, 2023 at 02:31:53PM +0000, Sudeep Holla wrote: > On Thu, Jan 26, 2023 at 04:11:31PM -0800, Saravana Kannan wrote: > > Registering an irqdomain sets the flag for the fwnode. But having the > > flag set when a device is added is interpreted by fw_devlink to mean the > > device has already been initialized and will never probe. This prevents > > fw_devlink from creating device links with the gpio_device as a > > supplier. So, clear the flag before adding the device. ... > > + /* > > + * If fwnode doesn't belong to another device, it's safe to clear its > > + * initialized flag. > > + */ > > + if (!gdev->dev.fwnode->dev) > > + fwnode_dev_initialized(gdev->dev.fwnode, false); > > This is the one causing the kernel crash during the boot on FVP which > Naresh has reported. Just reverted this and was able to boot, confirming > the issue with this patch. I'm wondering if if (!dev_fwnode(&gdev->dev)->dev) fwnode_dev_initialized(&dev_fwnode(gdev->dev), false); works. -- With Best Regards, Andy Shevchenko _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel