Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753546AbbBEUG4 (ORCPT ); Thu, 5 Feb 2015 15:06:56 -0500 Received: from mailout4.w1.samsung.com ([210.118.77.14]:20099 "EHLO mailout4.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752882AbbBEUGy (ORCPT ); Thu, 5 Feb 2015 15:06:54 -0500 X-AuditID: cbfec7f4-b7f126d000001e9a-bc-54d3cccb8776 Message-id: <54D3CD58.4030902@samsung.com> Date: Thu, 05 Feb 2015 21:06:48 +0100 From: Sylwester Nawrocki User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.1.2 MIME-version: 1.0 To: Tomeu Vizoso Cc: linux-kernel@vger.kernel.org, Mike Turquette , Stephen Boyd , Javier Martinez Canillas , Paul Walmsley , Tony Lindgren , Russell King , linux-omap@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: Re: [PATCH v13 3/6] clk: Make clk API return per-user struct clk instances References: <1422011024-32283-1-git-send-email-tomeu.vizoso@collabora.com> <1422011024-32283-4-git-send-email-tomeu.vizoso@collabora.com> <54D3C803.30706@samsung.com> In-reply-to: <54D3C803.30706@samsung.com> Content-type: text/plain; charset=windows-1252 Content-transfer-encoding: 7bit X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrNLMWRmVeSWpSXmKPExsVy+t/xK7qnz1wOMTi6gdni6O8Ci02Pr7Fa XN41h81i9pJ+Fovbl3ktnk64yGbxYcdfZosfZ7pZLPrWXmKz2H/Fy4HLo6W5h83j29dJLB6X +3qZPP4+v87isePuEkaPO9f2sHlsXlLvceN3L7vH501yAZxRXDYpqTmZZalF+nYJXBlfH71g LTjAVtHWydPAOI+1i5GTQ0LAROLbiotQtpjEhXvr2boYuTiEBJYySjy53wnlfGKU2LhpFSNI Fa+AlsTG/6fAbBYBVYld9xcxgdhsAoYSvUf7wOKiAhESJ+/uYYeoF5T4MfkeSxcjB4eIgK7E yQ1SIDOZBe4xSXzuWMkGUiMsECox5XY7M8SyVYwSixu3gTVzCmhKHNj7CqyZWUBP4v5FLZAw s4C8xOY1b5knMArMQrJiFkLVLCRVCxiZVzGKppYmFxQnpeca6hUn5haX5qXrJefnbmKERMiX HYyLj1kdYhTgYFTi4f0QfzlEiDWxrLgy9xCjBAezkgjvnWagEG9KYmVValF+fFFpTmrxIUYm Dk6pBsaF3mreSWt1uNLmLPIRmM78Q8CE7R6/QYK05mdJG4lvhwMjFf6kVB1/fPhz3tKnts9l vWav2/KM7/Rakxt8YVXLJK8Jv8pPYpFcUeo6V3HLla+qFhapDAF5NYn26VGS3CYLLp4LOP1h p+3ydQ7Wkrtb9nU/23wjjC2rhU2Occ6RTRYB4ts3MiqxFGckGmoxFxUnAgCCEfKCbgIAAA== Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1053 Lines: 29 On 05/02/15 20:44, Sylwester Nawrocki wrote: >> +void __clk_put(struct clk *clk) >> > +{ >> > + if (!clk || WARN_ON_ONCE(IS_ERR(clk))) >> > + return; >> > + >> > + clk_core_put(clk->core); >> > + kfree(clk); > > Why do we have kfree() here? clk_get() doesn't allocate the data structure > being freed here. What happens if we do clk_get(), clk_put(), clk_get() > on same clock? > > I suspect __clk_free_clk() should be called in __clk_release() callback > instead, but then there is an issue of safely getting reference to > struct clk from struct clk_core pointer. Please ignore this comment, I missed __clk_create_clk() calls in clkdev.c Anyway, in current -next I'm seeing random pointer dereferences while booting Odroid U3, I'll get back to debugging this tomorrow morning. -- Regards, Sylwester -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/