Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752596AbbG1PWa (ORCPT ); Tue, 28 Jul 2015 11:22:30 -0400 Received: from mail-yk0-f174.google.com ([209.85.160.174]:36007 "EHLO mail-yk0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752246AbbG1PW2 (ORCPT ); Tue, 28 Jul 2015 11:22:28 -0400 Date: Tue, 28 Jul 2015 11:22:25 -0400 From: Tejun Heo To: Laurent Pinchart Cc: Dan Williams , Linux Kernel Mailing List Subject: Re: Is devm_* broken ? Message-ID: <20150728152225.GA454@mtj.duckdns.org> References: <1503739.gVWYM3p8QD@avalon> <20150715180355.GH15934@mtj.duckdns.org> <1643821.fnPPMYQxCt@avalon> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1643821.fnPPMYQxCt@avalon> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1023 Lines: 24 Hello, Laurent. On Tue, Jul 28, 2015 at 05:16:16PM +0300, Laurent Pinchart wrote: > Using devm_kzalloc() in such a way has value though, and reverting drivers to > the pre-devm memory allocation code would make error handling and cleanup code > paths more complex again. Should we introduce a managed allocator for that > purpose that would have a lifespan explicitly handled by drivers ? I don't know. Sure, we can have memory allocations which are tied to open file; however, the distinction between that and regular devm resources, which can't linger on no matter what, would be subtle and confusing. IMHO, a better approach would be implmenting generic revoke feature and sever open files on driver detach so that everything can be shutdown then. Thanks. -- tejun -- 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/