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=-9.6 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=unavailable 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 4311EC3F2CD for ; Mon, 23 Mar 2020 14:50:10 +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 19FB020753 for ; Mon, 23 Mar 2020 14:50:10 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=ffwll.ch header.i=@ffwll.ch header.b="kQG+AiMt" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 19FB020753 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=ffwll.ch 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 63EC16E135; Mon, 23 Mar 2020 14:50:04 +0000 (UTC) Received: from mail-wm1-x344.google.com (mail-wm1-x344.google.com [IPv6:2a00:1450:4864:20::344]) by gabe.freedesktop.org (Postfix) with ESMTPS id 31D3A6E134 for ; Mon, 23 Mar 2020 14:50:01 +0000 (UTC) Received: by mail-wm1-x344.google.com with SMTP id m3so15130961wmi.0 for ; Mon, 23 Mar 2020 07:50:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ffwll.ch; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=tcmBK1cUXpb2AukNNuBGatxvJwqs04jt1DOiiyzm5hE=; b=kQG+AiMtkiPZntaXzKg4DLduZo4SNb8CenqPQ68/vqfhlOu1l69HP0QlfpNgud0d61 uEPrFC/uWt5uaJ1tsM7re76O4zFyaxecfQuFioIunlw2sMfoV64gdRQ8vJ1z72YNkpT4 rWXRdZ3EEakE8NX2mAx4YLxGCQy2ZAqFM/JEY= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=tcmBK1cUXpb2AukNNuBGatxvJwqs04jt1DOiiyzm5hE=; b=ZRqHuFJEe8Es6eNwSu+Nr1agjMQnF7t0G7i10hW5rAeDFtgxLNsP7AvbrWj99gXaD4 wUb+wC9Oj27Afex6gz4RtxGbCZ5Vq6fAkG48fDga1jvVeSSARnQr2qmFw/id4Mm3ojET Ls9K7te9U8DxlPPtd3Zo/BXIDcK/XVxMSmVYbXtQXazXcaGzFm7Xwz4hQ82+9NPDXTWd 4PKik4Xt7rTpFu0faif5RADxEu/6BeTAeKzhZrAqAmXOdCDI1t74fkqKqoqy0MC2bzzy aR1bUcFHKLraT4efgfpKhxaouMVyJpj9fjwWldhlvqeT0oloKI92JQRFMV0dJ22sh/tR 5Aag== X-Gm-Message-State: ANhLgQ2p/i23oCLCSCiY/vmHHZYSsc0HQCgMjQpTdES+QeuvsYs2kZQg s07L5pa6FlBudoYWFySpE5IztfyH8wCzEQ== X-Google-Smtp-Source: ADFU+vsG/j/kSec8KLdXDJFaoxEVisRWQYLP6F5qV52N4Cn28M8h5b5aOsUS9AZqRPyqNvkhKFe07A== X-Received: by 2002:a05:600c:20c7:: with SMTP id y7mr28557771wmm.38.1584974999427; Mon, 23 Mar 2020 07:49:59 -0700 (PDT) Received: from phenom.ffwll.local ([2a02:168:57f4:0:efd0:b9e5:5ae6:c2fa]) by smtp.gmail.com with ESMTPSA id s22sm20376522wmc.16.2020.03.23.07.49.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 Mar 2020 07:49:58 -0700 (PDT) From: Daniel Vetter To: DRI Development Subject: [PATCH 02/51] drm/i915: Don't clear drvdata in ->release Date: Mon, 23 Mar 2020 15:49:01 +0100 Message-Id: <20200323144950.3018436-3-daniel.vetter@ffwll.ch> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200323144950.3018436-1-daniel.vetter@ffwll.ch> References: <20200323144950.3018436-1-daniel.vetter@ffwll.ch> MIME-Version: 1.0 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: Daniel Vetter , Daniel Vetter , Intel Graphics Development , Greg Kroah-Hartman Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" For two reasons: - The driver core clears this already for us after we're unloaded in __device_release_driver(). - It's way too late, the drm_device ->release callback might massively outlive the underlying physical device, since a drm_device can't be kept alive by open drm_file or well really anything else userspace is still hanging onto. So if we clear this ourselves, we should clear it in the pci ->remove callback, not in the drm_device ->relase callback. Looking at git history this was fixed in the driver core with commit 0998d0631001288a5974afc0b2a5f568bcdecb4d Author: Hans de Goede Date: Wed May 23 00:09:34 2012 +0200 device-core: Ensure drvdata = NULL when no driver is bound v2: Cite the core fix in the commit message (Chris). Cc: Greg Kroah-Hartman Cc: Chris Wilson Signed-off-by: Daniel Vetter --- drivers/gpu/drm/i915/i915_drv.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c index 48ba37e35bea..4792051e9e2e 100644 --- a/drivers/gpu/drm/i915/i915_drv.c +++ b/drivers/gpu/drm/i915/i915_drv.c @@ -909,9 +909,6 @@ static void i915_driver_destroy(struct drm_i915_private *i915) drm_dev_fini(&i915->drm); kfree(i915); - - /* And make sure we never chase our dangling pointer from pci_dev */ - pci_set_drvdata(pdev, NULL); } /** -- 2.25.1 _______________________________________________ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel 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=-9.6 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham 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 AD285C3F2CD for ; Mon, 23 Mar 2020 14:50:05 +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 85F1820842 for ; Mon, 23 Mar 2020 14:50:05 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=ffwll.ch header.i=@ffwll.ch header.b="kQG+AiMt" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 85F1820842 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=ffwll.ch Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=intel-gfx-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 3B67D6E127; Mon, 23 Mar 2020 14:50:02 +0000 (UTC) Received: from mail-wm1-x341.google.com (mail-wm1-x341.google.com [IPv6:2a00:1450:4864:20::341]) by gabe.freedesktop.org (Postfix) with ESMTPS id BF7EE6E127 for ; Mon, 23 Mar 2020 14:50:00 +0000 (UTC) Received: by mail-wm1-x341.google.com with SMTP id r7so210969wmg.0 for ; Mon, 23 Mar 2020 07:50:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ffwll.ch; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=tcmBK1cUXpb2AukNNuBGatxvJwqs04jt1DOiiyzm5hE=; b=kQG+AiMtkiPZntaXzKg4DLduZo4SNb8CenqPQ68/vqfhlOu1l69HP0QlfpNgud0d61 uEPrFC/uWt5uaJ1tsM7re76O4zFyaxecfQuFioIunlw2sMfoV64gdRQ8vJ1z72YNkpT4 rWXRdZ3EEakE8NX2mAx4YLxGCQy2ZAqFM/JEY= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=tcmBK1cUXpb2AukNNuBGatxvJwqs04jt1DOiiyzm5hE=; b=eFUuHCdKGpLA8OisTZSduOay/TahQ8yhHOGfpimiZtNF2m7Lvqh+37a7HKRGCm5Ab7 EQ66PFoJvpHYwrf7iiKDpkZ476Vux429TyK5723b3/qF8qaFlzDOxHEFExvQHlouCZ+D fc1aedestpmANdy036CIs7ISXt21VDE0RR9PkDq2WqLwD7nEDey30dwtb5QztvRpbF/R WQ+9FYRQSEJlreZPS5cnSERcD/ziA925D0W7YgHnQlyy2eBR5BHICz8aZZ9PWuTJiCUr FG2q0OzpZvYjjpdppFvz+6K+uRwX4N2DMVtkx9lCUPiLWgluBu0JLha5eWUg78hgWIKk G2aQ== X-Gm-Message-State: ANhLgQ2CyBR2Kyy3DyEFZPVvqcUX5gXwKAf6kRYVwvahmpYW3PgvnpeA BTe1kQwwVLvs7+qTnzBJSjhRW3h+rildKw== X-Google-Smtp-Source: ADFU+vsG/j/kSec8KLdXDJFaoxEVisRWQYLP6F5qV52N4Cn28M8h5b5aOsUS9AZqRPyqNvkhKFe07A== X-Received: by 2002:a05:600c:20c7:: with SMTP id y7mr28557771wmm.38.1584974999427; Mon, 23 Mar 2020 07:49:59 -0700 (PDT) Received: from phenom.ffwll.local ([2a02:168:57f4:0:efd0:b9e5:5ae6:c2fa]) by smtp.gmail.com with ESMTPSA id s22sm20376522wmc.16.2020.03.23.07.49.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 Mar 2020 07:49:58 -0700 (PDT) From: Daniel Vetter To: DRI Development Date: Mon, 23 Mar 2020 15:49:01 +0100 Message-Id: <20200323144950.3018436-3-daniel.vetter@ffwll.ch> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200323144950.3018436-1-daniel.vetter@ffwll.ch> References: <20200323144950.3018436-1-daniel.vetter@ffwll.ch> MIME-Version: 1.0 Subject: [Intel-gfx] [PATCH 02/51] drm/i915: Don't clear drvdata in ->release X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Daniel Vetter , Daniel Vetter , Intel Graphics Development , Greg Kroah-Hartman Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" For two reasons: - The driver core clears this already for us after we're unloaded in __device_release_driver(). - It's way too late, the drm_device ->release callback might massively outlive the underlying physical device, since a drm_device can't be kept alive by open drm_file or well really anything else userspace is still hanging onto. So if we clear this ourselves, we should clear it in the pci ->remove callback, not in the drm_device ->relase callback. Looking at git history this was fixed in the driver core with commit 0998d0631001288a5974afc0b2a5f568bcdecb4d Author: Hans de Goede Date: Wed May 23 00:09:34 2012 +0200 device-core: Ensure drvdata = NULL when no driver is bound v2: Cite the core fix in the commit message (Chris). Cc: Greg Kroah-Hartman Cc: Chris Wilson Signed-off-by: Daniel Vetter --- drivers/gpu/drm/i915/i915_drv.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c index 48ba37e35bea..4792051e9e2e 100644 --- a/drivers/gpu/drm/i915/i915_drv.c +++ b/drivers/gpu/drm/i915/i915_drv.c @@ -909,9 +909,6 @@ static void i915_driver_destroy(struct drm_i915_private *i915) drm_dev_fini(&i915->drm); kfree(i915); - - /* And make sure we never chase our dangling pointer from pci_dev */ - pci_set_drvdata(pdev, NULL); } /** -- 2.25.1 _______________________________________________ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/intel-gfx