Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp1736464ybl; Thu, 19 Dec 2019 02:06:14 -0800 (PST) X-Google-Smtp-Source: APXvYqyvEXsPTSZxOS91exDZBeLwkgRorwj9/u7VUcdk75SI/WZXwe44bkZSk3Ro6MWudqZ/uvqX X-Received: by 2002:a05:6808:103:: with SMTP id b3mr1718005oie.89.1576749973907; Thu, 19 Dec 2019 02:06:13 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1576749973; cv=none; d=google.com; s=arc-20160816; b=VIyFlWymlsTKMz1UKJyf7cwfi5bU7j/OXMxMAG6IB0fwMv8/6YGzVxS9/dWv8V3Cbg aEEhsTopuo34h7h/4q3Qhc3wq2eIt8pL/a+bP8razDzCwykxTlOCWPcDG9CM37VQvuEx 3oVWJ2FPbPqKZ5cYYYvxrej0O+L3GwDW4Aywu31OUfOobrBhgsiunAIEhfz5eYHtmcvI MJ7ERlHKxAo2t3EIOzudrFcMcRY2qSSOyI/zLStEVx4+8axXjRIumku5MhkHPXiTx5nx J8ceGhY0Lr6B+jW7Bibv3LbsCb1To4BpHDpkXc9f43f+t5xe0M2RgpHn0B5tiLy88YYS FwuA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=KBCrXMy1n6kkbtCSNPQmexhaDHQaDFIxr8UaceHmMnk=; b=gtsbNag/qEWIUF5sRBHMnCfavNyHJUD3Q5fxd2havs+zAY4GBlb2MjqpdTtHikoVX4 zKGtML1KveyK2CxGXjGut4aBEO+t1nacZOPvg1E9MbUqzSKOiZsb8zeUUWp03NdhJSOi SQn1WTl8utpEmgkJQ3CvzH40BsQCB5fQwLuW+rv1fZoQnZU3n613hiv9LFYEBQE4wxbE w92g/WHZp/YFpEdNudUWokq0Uoh4Ef37p5FNVP/+UjVn2vuvw017Ub/OC96xZOs7/FK+ QLZixPc8A5edDDte7AslQwsu6FgTm4H+pd4SXwHGP3u3qEijJnsi1GbvQIRVVICmVX5y 3vgQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m9si2820918oie.148.2019.12.19.02.05.58; Thu, 19 Dec 2019 02:06:13 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726734AbfLSKDg (ORCPT + 99 others); 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