From: Daniel Vetter Subject: Re: [PATCH] drm/sysfs: fix hotplug regression since lifetime changes Date: Thu, 21 Nov 2013 11:20:02 +0100 Message-ID: <20131121102002.GM27344@phenom.ffwll.local> References: <1384998664-5680-1-git-send-email-airlied@gmail.com> <20131121092255.GL27344@phenom.ffwll.local> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail-bk0-f52.google.com (mail-bk0-f52.google.com [209.85.214.52]) by gabe.freedesktop.org (Postfix) with ESMTP id 73989FCC17 for ; Thu, 21 Nov 2013 02:19:30 -0800 (PST) Received: by mail-bk0-f52.google.com with SMTP id u14so222315bkz.25 for ; Thu, 21 Nov 2013 02:19:26 -0800 (PST) Content-Disposition: inline In-Reply-To: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: dri-devel-bounces@lists.freedesktop.org Errors-To: dri-devel-bounces@lists.freedesktop.org To: Dave Airlie Cc: Greg KH , dri-devel List-Id: dri-devel@lists.freedesktop.org On Thu, Nov 21, 2013 at 07:25:39PM +1000, Dave Airlie wrote: > On Thu, Nov 21, 2013 at 7:22 PM, Daniel Vetter wrote: > > On Thu, Nov 21, 2013 at 11:51:04AM +1000, Dave Airlie wrote: > >> 5bdebb183c9702a8c57a01dff09337be3de337a6 changed the lifetimes, but it > >> also meant we no longer set the device_type field properly, so the > >> hotplug events in userspace weren't fully formed enough for drivers to care. > >> > >> Reported-by: Jesse Barnes > >> Signed-off-by: Dave Airlie > >> --- > >> drivers/gpu/drm/drm_sysfs.c | 1 + > >> 1 file changed, 1 insertion(+) > >> > >> diff --git a/drivers/gpu/drm/drm_sysfs.c b/drivers/gpu/drm/drm_sysfs.c > >> index 1a35ea5..c6a3902 100644 > >> --- a/drivers/gpu/drm/drm_sysfs.c > >> +++ b/drivers/gpu/drm/drm_sysfs.c > >> @@ -516,6 +516,7 @@ int drm_sysfs_device_add(struct drm_minor *minor) > >> DRM_ERROR("device create failed %ld\n", PTR_ERR(minor->kdev)); > >> return PTR_ERR(minor->kdev); > >> } > >> + minor->kdev->type = &drm_sysfs_device_minor; > > > > Isn't this one of the sysfs races Greg is fighting against? At least from > > a cursor read through the driver core it looks like we'd better set the > > dev->type before we set it up with device_create(). > > Possibly but how can we do that? since minor->kdev is something we > just created 2 lines earlier > unless there is another create function I should be calling, I don't > see a device_create_with_type. > > > > Cc'ing Greg for insight. > > > > Aside: I wonder whether we could get rid of our drm_minor type and use it > > for something more useful like the render node vs legacy node split ... > > Its ABI now. all the userspace drivers need it in the uevents for > hotplug to keep working. Yeah I know that the drm_minor is abi now on legacy node. More thought of a drm_render type for the render nodes. Could help with finding them through udev (e.g. for headless usage in transcode jobs or for opencl). I think we should waste a few braincycles on this before making rendernodes official. -Daniel -- Daniel Vetter Software Engineer, Intel Corporation +41 (0) 79 365 57 48 - http://blog.ffwll.ch