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 24B00C636D0 for ; Mon, 30 Jan 2023 15:15:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236554AbjA3PPv (ORCPT ); Mon, 30 Jan 2023 10:15:51 -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-kernel@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