From patchwork Fri Sep 23 14:29:34 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Tvrtko Ursulin X-Patchwork-Id: 12986631 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 7375BC6FA82 for ; Fri, 23 Sep 2022 14:30:16 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 0A5A810E730; Fri, 23 Sep 2022 14:30:10 +0000 (UTC) Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by gabe.freedesktop.org (Postfix) with ESMTPS id 3F5D610E07B; Fri, 23 Sep 2022 14:30:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1663943404; x=1695479404; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=1Wtu+szlawnhlRrixJ/ofPJ7V1Ylsev0u/46OA9g0Sw=; b=duX22e7umChgnvuxNBKCy80R3cXcdO58R9qVYtflNSbB4JmDcL2WHyMV kwMn6vjkoa0444iDl4eC24m8RpmAm3xgMAyMVzAYt5ELrhltq6WTUdJWY Ib9RgJvkvxOHZqHVJCuSEYdxvQAKvhCXkwgQniDcBnxJ5SCkMpL8t3Ivp eyQg8+5lLbPgEikFxZnoM5q8wLPoBDdGJlD7/s7aDPqdvGElt+FKcelyz XtWLW9uoWpckYDv25tRhNrW/K4BRY/pY2OhbCsobHAeD5Pu4EE6C7X9ho WH5BXL9+44YfCJ5RFmLCFtLr73c28ShDZIJD64fujJdMcYEp628LHad12 g==; X-IronPort-AV: E=McAfee;i="6500,9779,10479"; a="280325504" X-IronPort-AV: E=Sophos;i="5.93,339,1654585200"; d="scan'208";a="280325504" Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 23 Sep 2022 07:29:47 -0700 X-IronPort-AV: E=Sophos;i="5.93,339,1654585200"; d="scan'208";a="682676915" Received: from ccislaru-mobl.ger.corp.intel.com (HELO localhost.localdomain) ([10.213.225.140]) by fmsmga008-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 23 Sep 2022 07:29:46 -0700 From: Tvrtko Ursulin To: Intel-gfx@lists.freedesktop.org Subject: [PATCH] drm/i915: Stop using flush_scheduled_work on driver remove Date: Fri, 23 Sep 2022 15:29:34 +0100 Message-Id: <20220923142934.29528-1-tvrtko.ursulin@linux.intel.com> X-Mailer: git-send-email 2.34.1 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: Jani Nikula , Tetsuo Handa , dri-devel@lists.freedesktop.org, Tvrtko Ursulin Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" From: Tvrtko Ursulin Kernel is trying to eliminate callers of flush_scheduled_work so lets try to accommodate. We currently call it from intel_modeset_driver_remove_noirq on the driver remove path but the comment next to it does not tell me what exact work it wants to flush. I can spot three (or four) works using the system_wq: ..hotplug.reenable_work ..hotplug.hotplug_work ..psr.dc3co_work ..crtc->drrs.work So if I replace it with intel_hpd_cancel_work() that appears would handle the first two. What about the other two? Signed-off-by: Tvrtko Ursulin Cc: Jani Nikula Cc: Ville Syrjälä Cc: Tetsuo Handa --- I am clueless about the display paths and only send this because Jani convinced me to send a patch to kick off the discussion. No expectations whatsoever this is correct or complete. --- drivers/gpu/drm/i915/display/intel_display.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/i915/display/intel_display.c b/drivers/gpu/drm/i915/display/intel_display.c index 2d0018ae34b1..0eb72530a003 100644 --- a/drivers/gpu/drm/i915/display/intel_display.c +++ b/drivers/gpu/drm/i915/display/intel_display.c @@ -8980,7 +8980,7 @@ void intel_modeset_driver_remove_noirq(struct drm_i915_private *i915) intel_unregister_dsm_handler(); /* flush any delayed tasks or pending work */ - flush_scheduled_work(); + intel_hpd_cancel_work(i915); intel_hdcp_component_fini(i915);