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 D54A9C001DF for ; Wed, 2 Aug 2023 15:21:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234958AbjHBPVz (ORCPT ); Wed, 2 Aug 2023 11:21:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43566 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234992AbjHBPVj (ORCPT ); Wed, 2 Aug 2023 11:21:39 -0400 Received: from mgamail.intel.com (unknown [134.134.136.31]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 097293AA4; Wed, 2 Aug 2023 08:18:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1690989507; x=1722525507; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=c4x99QoiLN8BrAgqpLS2SVCvTXSrSU7F9mL186k74oA=; b=P8DCLwgoaZPAfMzrDWchcl1kRaALgb9aUPdmeL/jCD3C6NYT4WpSXMZM UKe6DLP452VUxpb8b0HfuvvOLiqZJnXV7ST8tKREI8X10tHSuvU3yTfjy M5xYEO0jw5wpdU+YQzbrcHnKsesc+pAW8cNj9UPZyN7pHI4TcmG8tprwt SV2YgrWH7ZL057gzqrWLjU5EgBWUxg24xhevDXZ8qck4KAsoCwFeqLfPz b21C97DiILd7PH2X6LGJy3lssbqwhMvfixVhpRiS155HFC59TrvrcV2pi htEjMoEJCdcO5kjkB4Gs7Ha5r9fYLK+VxHnDqGAvD5iFMVYSA4U9+YqVt w==; X-IronPort-AV: E=McAfee;i="6600,9927,10790"; a="433452764" X-IronPort-AV: E=Sophos;i="6.01,249,1684825200"; d="scan'208";a="433452764" Received: from orsmga006.jf.intel.com ([10.7.209.51]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Aug 2023 08:14:56 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10790"; a="706210933" X-IronPort-AV: E=Sophos;i="6.01,249,1684825200"; d="scan'208";a="706210933" Received: from smile.fi.intel.com ([10.237.72.54]) by orsmga006.jf.intel.com with ESMTP; 02 Aug 2023 08:14:53 -0700 Received: from andy by smile.fi.intel.com with local (Exim 4.96) (envelope-from ) id 1qRDYp-0045bG-1l; Wed, 02 Aug 2023 18:14:51 +0300 Date: Wed, 2 Aug 2023 18:14:51 +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 5/5] of: Refactor node and property manipulation function locking Message-ID: References: <20230801-dt-changeset-fixes-v1-0-b5203e3fc22f@kernel.org> <20230801-dt-changeset-fixes-v1-5-b5203e3fc22f@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230801-dt-changeset-fixes-v1-5-b5203e3fc22f@kernel.org> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org On Tue, Aug 01, 2023 at 03:54:48PM -0600, Rob Herring wrote: > All callers of __of_{add,remove,update}_property() and > __of_{attach,detach}_node() wrap the call with the devtree_lock > spinlock. Let's move the spinlock into the functions. This allows moving > the sysfs update functions into those functions as well. ... > +out: out_unlock: ? > + raw_spin_unlock_irqrestore(&devtree_lock, flags); > + if (!rc) > + __of_add_property_sysfs(np, prop); > + > + return rc; Why not if (rc) return rc; __of_add_property_sysfs(np, prop); return 0; ? ... > +out: > + raw_spin_unlock_irqrestore(&devtree_lock, flags); > + if (!rc) > + __of_remove_property_sysfs(np, prop); > + return rc; As per above. -- With Best Regards, Andy Shevchenko