From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-0.9 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4EA8CC43603 for ; Thu, 19 Dec 2019 11:32:10 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 103BE20716 for ; Thu, 19 Dec 2019 11:32:10 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="epPaeNaK" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726779AbfLSLcJ (ORCPT ); Thu, 19 Dec 2019 06:32:09 -0500 Received: from us-smtp-delivery-1.mimecast.com ([207.211.31.120]:54900 "EHLO us-smtp-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726656AbfLSLcI (ORCPT ); Thu, 19 Dec 2019 06:32:08 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1576755127; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=KQVy1060cIcwdmA+aV3D7jzIs8ekG/8Yaj3TYu2HIws=; b=epPaeNaKmi+ogpQYq5/P7IsgijAekT88f9uUs7Jlxm9egU3iGO8/xjnmxdwECe/dW9TtLQ MJ6Ff/rEuxiwLWn8uYVPEEYZKVZa6pNN+gook/kGqypSOsnFYE9OtF8TAMcAV5ZVPl1OnN LwUt73xBK3xdCjo3dd+bIPaM/Edus/o= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-177-1dfDxRcXPu6wUynMAn751g-1; Thu, 19 Dec 2019 06:32:02 -0500 X-MC-Unique: 1dfDxRcXPu6wUynMAn751g-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 34B2D803A4C; Thu, 19 Dec 2019 11:31:56 +0000 (UTC) Received: from sirius.home.kraxel.org (ovpn-116-98.ams2.redhat.com [10.36.116.98]) by smtp.corp.redhat.com (Postfix) with ESMTP id 3D99963B89; Thu, 19 Dec 2019 11:31:53 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id C695311AAA; Thu, 19 Dec 2019 12:31:51 +0100 (CET) Date: Thu, 19 Dec 2019 12:31:51 +0100 From: Gerd Hoffmann To: Daniel Vetter Cc: John Garry , Ezequiel Garcia , "kongxinwei (A)" , "Chenfeng (puck)" , "airlied@linux.ie" , Thomas Zimmermann , Linuxarm , "dri-devel@lists.freedesktop.org" , "linux-kernel@vger.kernel.org" , dbueso@suse.de Subject: Re: Warnings in DRM code when removing/unbinding a driver Message-ID: <20191219113151.sytkoi3m7rrxzps2@sirius.home.kraxel.org> References: <07899bd5-e9a5-cff0-395f-b4fb3f0f7f6c@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, > > Like I said, for most drivers > > > you can pretty much assume that their unload sequence has been broken > > > since forever. It's not often tested, and especially the hotunbind > > > from a device (as opposed to driver unload) stuff wasn't even possible > > > to get right until just recently. > > > > Do you think it's worth trying to fix this for 5.5 and earlier, or just > > switch to the device-managed interface for 5.6 and forget about 5.5 and > > earlier? > > I suspect it's going to be quite some trickery to fix this properly > and everywhere, even for just one driver. Lots of drm drivers > unfortunately use anti-patterns with wrong lifetimes (e.g. you can't > use devm_kmalloc for anything that hangs of a drm_device, like > plane/crtc/connector). Except when it's for a real hotunpluggable > device (usb) we've never bothered backporting these fixes. Too much > broken stuff unfortunately. While being at it: How would a driver cleanup properly cleanup gem objects created by userspace on hotunbind? Specifically a gem object pinned to vram? cheers, Gerd From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-0.6 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 75127C2D0C0 for ; Thu, 19 Dec 2019 11:32:11 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 4C5C121D7D for ; Thu, 19 Dec 2019 11:32:11 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="eeVhEDPf" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 4C5C121D7D Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 8B7836EB50; Thu, 19 Dec 2019 11:32:10 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [207.211.31.120]) by gabe.freedesktop.org (Postfix) with ESMTPS id 8BE0C6EB50 for ; Thu, 19 Dec 2019 11:32:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1576755128; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=KQVy1060cIcwdmA+aV3D7jzIs8ekG/8Yaj3TYu2HIws=; b=eeVhEDPfbk7YMhqxUDgi4yMtzYg7eQ3bYY9Hq1je21RrAG//+efOEZVmCCprUD61JQ3YYl 7gc9jgm1c/W38tOAUB+TpBQ0DAC6RBH0xlEd2aWNAOF2VK9jnldpGXu9qxGdNL9WJWsTsq zmS7jBdb5TcNg4GRSCUfbe6PEM5gs+8= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-177-1dfDxRcXPu6wUynMAn751g-1; Thu, 19 Dec 2019 06:32:02 -0500 X-MC-Unique: 1dfDxRcXPu6wUynMAn751g-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 34B2D803A4C; Thu, 19 Dec 2019 11:31:56 +0000 (UTC) Received: from sirius.home.kraxel.org (ovpn-116-98.ams2.redhat.com [10.36.116.98]) by smtp.corp.redhat.com (Postfix) with ESMTP id 3D99963B89; Thu, 19 Dec 2019 11:31:53 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id C695311AAA; Thu, 19 Dec 2019 12:31:51 +0100 (CET) Date: Thu, 19 Dec 2019 12:31:51 +0100 From: Gerd Hoffmann To: Daniel Vetter Subject: Re: Warnings in DRM code when removing/unbinding a driver Message-ID: <20191219113151.sytkoi3m7rrxzps2@sirius.home.kraxel.org> References: <07899bd5-e9a5-cff0-395f-b4fb3f0f7f6c@huawei.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: dbueso@suse.de, "airlied@linux.ie" , "Chenfeng \(puck\)" , John Garry , Linuxarm , "dri-devel@lists.freedesktop.org" , "linux-kernel@vger.kernel.org" , "kongxinwei \(A\)" , Thomas Zimmermann , Ezequiel Garcia Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Hi, > > Like I said, for most drivers > > > you can pretty much assume that their unload sequence has been broken > > > since forever. It's not often tested, and especially the hotunbind > > > from a device (as opposed to driver unload) stuff wasn't even possible > > > to get right until just recently. > > > > Do you think it's worth trying to fix this for 5.5 and earlier, or just > > switch to the device-managed interface for 5.6 and forget about 5.5 and > > earlier? > > I suspect it's going to be quite some trickery to fix this properly > and everywhere, even for just one driver. Lots of drm drivers > unfortunately use anti-patterns with wrong lifetimes (e.g. you can't > use devm_kmalloc for anything that hangs of a drm_device, like > plane/crtc/connector). Except when it's for a real hotunpluggable > device (usb) we've never bothered backporting these fixes. Too much > broken stuff unfortunately. While being at it: How would a driver cleanup properly cleanup gem objects created by userspace on hotunbind? Specifically a gem object pinned to vram? cheers, Gerd _______________________________________________ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel