From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752104AbdHDVY4 (ORCPT ); Fri, 4 Aug 2017 17:24:56 -0400 Received: from galahad.ideasonboard.com ([185.26.127.97]:60795 "EHLO galahad.ideasonboard.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751260AbdHDVYz (ORCPT ); Fri, 4 Aug 2017 17:24:55 -0400 From: Laurent Pinchart To: Eric Anholt Cc: dri-devel@lists.freedesktop.org, Archit Taneja , Andrzej Hajda , Thierry Reding , linux-kernel@vger.kernel.org, Daniel Vetter Subject: Re: [PATCH v5 2/6] drm/bridge: Add a devm_ allocator for panel bridge. Date: Sat, 05 Aug 2017 00:25:08 +0300 Message-ID: <1610977.GUN5zSZ7yI@avalon> User-Agent: KMail/4.14.10 (Linux/4.9.34-gentoo; KDE/4.14.32; x86_64; ; ) In-Reply-To: <87zibfqd1u.fsf@eliezer.anholt.net> References: <20170718210510.12229-1-eric@anholt.net> <2023170.2CE3xBA9bq@avalon> <87zibfqd1u.fsf@eliezer.anholt.net> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Eric, On Friday 04 Aug 2017 13:43:25 Eric Anholt wrote: > Laurent Pinchart writes: > > On Tuesday 18 Jul 2017 14:05:06 Eric Anholt wrote: > >> This will let drivers reduce the error cleanup they need, in > >> particular the "is_panel_bridge" flag. > >> > >> v2: Slight cleanup of remove function by Andrzej > > > > I just want to point out that, in the context of Daniel's work on > > hot-unplug, 90% of the devm_* allocations are wrong and will get in the > > way. All DRM core objects that are accessible one way or another from > > userspace will need to be properly reference-counted and freed only when > > the last reference disappears, which could be well after the > > corresponding device is removed. I believe this could be one such objects > > :-/ > > Sure, if you're hotplugging, your life is pain. For non-hotpluggable > devices, like our SOC platform devices (current panel-bridge consumers), > this still seems like an excellent simplification of memory management. It encourages driver writers to write code that they will have to fix later. That's certainly a simplification, but certainly not a good thing in my opinion :-) -- Regards, Laurent Pinchart