Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp283345pxj; Fri, 28 May 2021 04:02:04 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzQtmeQMba54gm8JW5ZPjJw4CSXVAKagYC6npcBaKqTxZVw2cG6doiXq3OSaIQvsGR6pzbD X-Received: by 2002:a92:cd4c:: with SMTP id v12mr6671031ilq.247.1622199723933; Fri, 28 May 2021 04:02:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622199723; cv=none; d=google.com; s=arc-20160816; b=0eKuH6+wdlbREl6PSUp1aGF3F+lSHe3Dhud4ygS56XAsqQbD4WIeaTcp+N08VHHOGC 4W2ariap6vOV6EHMsPM63ipjsqdwmHKX1z1oWG4jgMJ61xHLU4P3V9OsBxRyMr8hVaNh OGHfowlmzktnCz9jSP9rC1KajsTq3HkFwzRqkJmu+UyvXEJ8Z9cbmLKsqhyJgax6gwKp gxMzIGymlCThhg7dEhcqvpjYa3NrVY1usKxYfEfvXnNEl/bZrm5c0TpDQwwMkg+YYKn9 ytdEzq712IkaWWCr0TjTRV0ml4gsvUHxkXdoQ5ZQqMZH+Q+SidSXHJEhtKUjXlQl0dAL 20Bg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:organization:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :ironport-sdr:ironport-sdr; bh=gcuwW/JWPFe85TxmZO76+GtoSp4Mtu2MYc8GfeldnDI=; b=WpfaTagxkOR6l+RB7795aZaJKsiazleBekrOQiv7EV8lQTzV9Irv3MQFC4il4mtWZH 5HyOooIhMWhMvESpb5CF+rIZABhbr36pXwP+FR0jMsGLSFhdNlLfvI9VVrGGugwVS2Rw 4R06RynSWAaGOwNLLf5k0HYriO5Z3B+fJAiqrRmilgaIBnGBsNsPdlN+NUoj4xMOcv0C odCzkYaLjGDTEUuHTTfDIywcgXQmkVGVwTyMZzZXdVn7x+EDXnDiZRptXf8uxvllTyAA V+8nAviCOvZNs5eKXiWODcpQF/vBJkeaxINYHrAHRYHaBlM+YV7Axk/yC8EMOHQXiPpW f4EQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id t10si5998589ilf.139.2021.05.28.04.01.49; Fri, 28 May 2021 04:02:03 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236636AbhE1LBd (ORCPT + 99 others); Fri, 28 May 2021 07:01:33 -0400 Received: from mga17.intel.com ([192.55.52.151]:26290 "EHLO mga17.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236170AbhE1LBc (ORCPT ); Fri, 28 May 2021 07:01:32 -0400 IronPort-SDR: mSYL3t3iCBuh5FFbDih6cwxrQbngPyabDxhvjewIVCFZBcW9iZT2M//xfMe9ACHb+mByc95wWz bWFOsZ9c/G+A== X-IronPort-AV: E=McAfee;i="6200,9189,9997"; a="183276534" X-IronPort-AV: E=Sophos;i="5.83,229,1616482800"; d="scan'208";a="183276534" Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 May 2021 03:59:58 -0700 IronPort-SDR: uy0r5inqD7b3ySekCdAI9Xs1TWDSN3JJKFkITW47mQ1iH7+JKYS/0+lvwDe4GIk4taAjr/EI7v VHVvCsQauAVw== X-IronPort-AV: E=Sophos;i="5.83,229,1616482800"; d="scan'208";a="465839889" Received: from smile.fi.intel.com (HELO smile) ([10.237.68.40]) by fmsmga004-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 May 2021 03:59:56 -0700 Received: from andy by smile with local (Exim 4.94) (envelope-from ) id 1lmaDZ-00FIOq-9v; Fri, 28 May 2021 13:59:53 +0300 Date: Fri, 28 May 2021 13:59:53 +0300 From: Andy Shevchenko To: Pavel Machek Cc: Amireddy Mallikarjuna reddy , Linus Walleij , Marek =?iso-8859-1?Q?Beh=FAn?= , Abanoub Sameh , Dan Murphy , Krzysztof Kozlowski , linux-leds@vger.kernel.org, linux-kernel@vger.kernel.org, Luca Weiss Subject: Re: [PATCH v1 28/28] leds: sgm3140: Put fwnode in any case during ->probe() Message-ID: References: <20210510095045.3299382-1-andy.shevchenko@gmail.com> <20210510095045.3299382-29-andy.shevchenko@gmail.com> <20210528101454.GJ2209@amd> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210528101454.GJ2209@amd> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, May 28, 2021 at 12:14:54PM +0200, Pavel Machek wrote: > Hi! > > > fwnode_get_next_child_node() bumps a reference counting of a returned variable. > > We have to balance it whenever we return to the caller. > > This (and similar) -- in half of the drivers we hold the handle from > successful probe. Is it a problem and why is it problem only for some > drivers? Hmm... I'm not sure I have understood the question correctly. Any examples of the driver that you think needs some attention? In general the idea is that these kind of for-loops or getting next fwnode should be balanced. In case of for-loops the error or any other breakage means that reference count is bumped, for the get_next API it's always the case. I have checked between drivers and only considered above cases. Wherever there is a for-loop which isn't broken, we are fine. Wherever we have explicit reference counter drop for get_next cases, we are fine. If (any) framework requires the resource to be present that framework should bump and drop reference count on the resource by itself (so I split LED framework out from the consideration and consider that it does the right things) > Thanks for series, btw, I pushed out current version of the tree. Should I rebase the new version on something I can find in your Git tree? -- With Best Regards, Andy Shevchenko