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=-2.2 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 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 A3D79C43603 for ; Thu, 19 Dec 2019 10:03:37 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 83B01206D8 for ; Thu, 19 Dec 2019 10:03:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726744AbfLSKDg (ORCPT ); Thu, 19 Dec 2019 05:03:36 -0500 Received: from lhrrgout.huawei.com ([185.176.76.210]:2209 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726609AbfLSKDg (ORCPT ); Thu, 19 Dec 2019 05:03:36 -0500 Received: from lhreml709-cah.china.huawei.com (unknown [172.18.7.108]) by Forcepoint Email with ESMTP id 966C17D17AC8464734A9; Thu, 19 Dec 2019 10:03:34 +0000 (GMT) Received: from lhreml724-chm.china.huawei.com (10.201.108.75) by lhreml709-cah.china.huawei.com (10.201.108.32) with Microsoft SMTP Server (TLS) id 14.3.408.0; Thu, 19 Dec 2019 10:03:33 +0000 Received: from [127.0.0.1] (10.202.226.46) by lhreml724-chm.china.huawei.com (10.201.108.75) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Thu, 19 Dec 2019 10:03:33 +0000 Subject: Re: Warnings in DRM code when removing/unbinding a driver To: Daniel Vetter CC: Ezequiel Garcia , "kongxinwei (A)" , "Chenfeng (puck)" , "airlied@linux.ie" , Thomas Zimmermann , Linuxarm , "dri-devel@lists.freedesktop.org" , "linux-kernel@vger.kernel.org" , Gerd Hoffmann , References: <07899bd5-e9a5-cff0-395f-b4fb3f0f7f6c@huawei.com> From: John Garry Message-ID: Date: Thu, 19 Dec 2019 10:03:33 +0000 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.1.2 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset="utf-8"; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [10.202.226.46] X-ClientProxiedBy: lhreml712-chm.china.huawei.com (10.201.108.63) To lhreml724-chm.china.huawei.com (10.201.108.75) X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 19/12/2019 09:54, Daniel Vetter wrote: > On Wed, Dec 18, 2019 at 7:08 PM John Garry wrote: >> >> + >> >> So the v5.4 kernel does not have this issue. >> >> I have bisected the initial occurrence to: >> >> commit 37a48adfba6cf6e87df9ba8b75ab85d514ed86d8 >> Author: Thomas Zimmermann >> Date: Fri Sep 6 14:20:53 2019 +0200 >> >> drm/vram: Add kmap ref-counting to GEM VRAM objects >> >> The kmap and kunmap operations of GEM VRAM buffers can now be called >> in interleaving pairs. The first call to drm_gem_vram_kmap() maps the >> buffer's memory to kernel address space and the final call to >> drm_gem_vram_kunmap() unmaps the memory. Intermediate calls to these >> functions increment or decrement a reference counter. >> >> So this either exposes or creates the issue. > > Yeah that's just shooting the messenger. OK, so it exposes it. 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? Thanks, John 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=-2.2 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 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 BBCCCC2D0D3 for ; Mon, 23 Dec 2019 08:11:20 +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 8341E20715 for ; Mon, 23 Dec 2019 08:11:20 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 8341E20715 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=huawei.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 C3F206E1A7; Mon, 23 Dec 2019 08:10:47 +0000 (UTC) Received: from huawei.com (lhrrgout.huawei.com [185.176.76.210]) by gabe.freedesktop.org (Postfix) with ESMTPS id 754486EAFA for ; Thu, 19 Dec 2019 10:03:38 +0000 (UTC) Received: from lhreml709-cah.china.huawei.com (unknown [172.18.7.108]) by Forcepoint Email with ESMTP id 966C17D17AC8464734A9; Thu, 19 Dec 2019 10:03:34 +0000 (GMT) Received: from lhreml724-chm.china.huawei.com (10.201.108.75) by lhreml709-cah.china.huawei.com (10.201.108.32) with Microsoft SMTP Server (TLS) id 14.3.408.0; Thu, 19 Dec 2019 10:03:33 +0000 Received: from [127.0.0.1] (10.202.226.46) by lhreml724-chm.china.huawei.com (10.201.108.75) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Thu, 19 Dec 2019 10:03:33 +0000 Subject: Re: Warnings in DRM code when removing/unbinding a driver To: Daniel Vetter References: <07899bd5-e9a5-cff0-395f-b4fb3f0f7f6c@huawei.com> From: John Garry Message-ID: Date: Thu, 19 Dec 2019 10:03:33 +0000 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.1.2 MIME-Version: 1.0 In-Reply-To: Content-Language: en-US X-Originating-IP: [10.202.226.46] X-ClientProxiedBy: lhreml712-chm.china.huawei.com (10.201.108.63) To lhreml724-chm.china.huawei.com (10.201.108.75) X-CFilter-Loop: Reflected X-Mailman-Approved-At: Mon, 23 Dec 2019 08:10:46 +0000 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\)" , Linuxarm , "dri-devel@lists.freedesktop.org" , "linux-kernel@vger.kernel.org" , "kongxinwei \(A\)" , Gerd Hoffmann , Thomas Zimmermann , Ezequiel Garcia Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" On 19/12/2019 09:54, Daniel Vetter wrote: > On Wed, Dec 18, 2019 at 7:08 PM John Garry wrote: >> >> + >> >> So the v5.4 kernel does not have this issue. >> >> I have bisected the initial occurrence to: >> >> commit 37a48adfba6cf6e87df9ba8b75ab85d514ed86d8 >> Author: Thomas Zimmermann >> Date: Fri Sep 6 14:20:53 2019 +0200 >> >> drm/vram: Add kmap ref-counting to GEM VRAM objects >> >> The kmap and kunmap operations of GEM VRAM buffers can now be called >> in interleaving pairs. The first call to drm_gem_vram_kmap() maps the >> buffer's memory to kernel address space and the final call to >> drm_gem_vram_kunmap() unmaps the memory. Intermediate calls to these >> functions increment or decrement a reference counter. >> >> So this either exposes or creates the issue. > > Yeah that's just shooting the messenger. OK, so it exposes it. 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? Thanks, John _______________________________________________ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel