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 CDCADC04A6A for ; Wed, 2 Aug 2023 03:36:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231668AbjHBDgY (ORCPT ); Tue, 1 Aug 2023 23:36:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60314 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229685AbjHBDfr (ORCPT ); Tue, 1 Aug 2023 23:35:47 -0400 Received: from mgamail.intel.com (unknown [192.55.52.88]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 79EE3E9; Tue, 1 Aug 2023 20:35:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1690947312; x=1722483312; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=6seOVYkZPhd0/nRx3CimmnLqX740zVArqWZ8lxRy1n4=; b=C8ANfuBIMnhWF7po+sAHP3xNU56maQmIZkdI2VGd6ESaUmttXG1ZgSql A14oRcRVWoP13BzBYNyW3r6k2oaUeTHKv+M8jeSTgxeQSgV+LRpvBiOkA eKZGDLJv06qSv5kZyEigJtc5SMA96mqIqBBgGVUDPu+BjRwov4l7LKcxZ PDjnEmG2uJU+6ksTeyz/GsPONEvC1+X4giH6ycY7fL+6hnENFRkCNYaak k80I0vJoVkIlM1fBUeikl8uJ2KGJDYq0X01+KzrAqcLphtiX/bBXnDe6j tdQLmaUXJ3/rGnLuEf/nCQayT3lG3tRLy93+ZGzEVaiYjLYdk/R0WJRIU w==; X-IronPort-AV: E=McAfee;i="6600,9927,10789"; a="400417417" X-IronPort-AV: E=Sophos;i="6.01,248,1684825200"; d="scan'208";a="400417417" Received: from orsmga006.jf.intel.com ([10.7.209.51]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 01 Aug 2023 20:35:12 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10789"; a="706023612" X-IronPort-AV: E=Sophos;i="6.01,248,1684825200"; d="scan'208";a="706023612" Received: from smile.fi.intel.com ([10.237.72.54]) by orsmga006.jf.intel.com with ESMTP; 01 Aug 2023 20:35:09 -0700 Received: from andy by smile.fi.intel.com with local (Exim 4.96) (envelope-from ) id 1qR2df-00FWdW-2K; Wed, 02 Aug 2023 06:35:07 +0300 Date: Wed, 2 Aug 2023 06:35:07 +0300 From: Andy Shevchenko To: Rob Herring Cc: Frank Rowand , "Enrico Weigelt, metux IT consult" , "Rafael J. Wysocki" , Sakari Ailus , Petr Mladek , Geert Uytterhoeven , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 2/5] of: dynamic: Refactor action prints to not use "%pOF" inside devtree_lock Message-ID: References: <20230801-dt-changeset-fixes-v1-0-b5203e3fc22f@kernel.org> <20230801-dt-changeset-fixes-v1-2-b5203e3fc22f@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Aug 02, 2023 at 06:28:48AM +0300, Andy Shevchenko wrote: > On Tue, Aug 01, 2023 at 03:54:45PM -0600, Rob Herring wrote: > > While originally it was fine to format strings using "%pOF" while > > holding devtree_lock, this now causes a deadlock. Lockdep reports: > > > > of_get_parent from of_fwnode_get_parent+0x18/0x24 > > ^^^^^^^^^^^^^ > > of_fwnode_get_parent from fwnode_count_parents+0xc/0x28 > > fwnode_count_parents from fwnode_full_name_string+0x18/0xac > > fwnode_full_name_string from device_node_string+0x1a0/0x404 > > device_node_string from pointer+0x3c0/0x534 > > pointer from vsnprintf+0x248/0x36c > > vsnprintf from vprintk_store+0x130/0x3b4 > > > > To fix this, move the printing in __of_changeset_entry_apply() outside the > > lock. As there's already similar printing of the same changeset actions, > > refactor all of them to use a common action print function. This has the > > side benefit of getting rid of some ifdefs. ... > > v3: > > - Add missing 'static' reported by 0-day > > It reported two issues (at least what I see). ... > > + if (pr_debug("notify ")) > > This is weird. How did you compile it? Urgh, you need to fix dynamic debug macros to return an error code. > > + of_changeset_action_print(action, pr->dn, pr->prop ? pr->prop->name : NULL); -- With Best Regards, Andy Shevchenko