From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B5605348C4E for ; Fri, 12 Jun 2026 13:54:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781272467; cv=none; b=BdjUnTrPjbUvulTryhPk+B1tLqfc7Rkqtl/66XoMWdxEeuwuK9qjm+jUswLsV/S0J3FubugxAV+XgBVzsCsvQxf3LFqkBGXyPXRKtJB1AMtjlOWAqpzKcinrNPiXImP5h9Dtg9HVeb//3DhoCWEiQ7KpT2/7/IIcVqF6qwom/5k= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781272467; c=relaxed/simple; bh=mpmpGW+MCEfXXyWOnroMWvjhaZ0eijkdkHSn/yk15Vo=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=dzB17yS4zL4MouQz1U3RTpoUssZMM/EkVGwUHG/uK1IORcA4ykdVmmWPQFjbVrzrsgij6YZu9CQse1UoRxLotj1rCtUzj+Db+NoYPorMBqeTecBhkJhOQ+V0pIw4CmDevT4YosEZ4PJcQfGEBkntqa6+XuSFufTJJOxQqVRXbcs= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com; spf=pass smtp.mailfrom=linux.intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=Vh/onb7d; arc=none smtp.client-ip=198.175.65.18 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="Vh/onb7d" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1781272466; x=1812808466; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=mpmpGW+MCEfXXyWOnroMWvjhaZ0eijkdkHSn/yk15Vo=; b=Vh/onb7d5LXcB9xJkl/NLOsrQi/76yrFLlT2AS4pn262JlkBixGYSle6 xYKk/NLwm40sMvE5b2gJZLH7X0oU7vuBzJA5KEZMvWoWw2q0j4T5oPXff 6GG4FFUeKQJdn8s1V31fhpaBabLVAKwH2qKEwODQCDpIPS+23M6COc4Zr chH8eFGzJgLVNy8tktbnYVNc33PScpfxFnkoBjHYD6apqZPNgL7DsRCgn umvnEjcZ5oP816VkgFodk46k+EinCv3IklNSyKENCtcvtkdc83mUqkSjY qVoB50hHFasgdI4zVUHUUZryUEwzOTkC6UXkPJyD+MCGsWoTmMLGDEgwP w==; X-CSE-ConnectionGUID: oBo39dSJR66CjrdgPMUQFw== X-CSE-MsgGUID: mCkLDeYDR/2fJqKEXbWjdg== X-IronPort-AV: E=McAfee;i="6800,10657,11813"; a="82163319" X-IronPort-AV: E=Sophos;i="6.24,200,1774335600"; d="scan'208";a="82163319" Received: from fmviesa006.fm.intel.com ([10.60.135.146]) by orvoesa110.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Jun 2026 06:54:26 -0700 X-CSE-ConnectionGUID: C77P05NFQuqrguWisOlbUA== X-CSE-MsgGUID: 09WONNwoR3itXxQQQ50Qsg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.24,200,1774335600"; d="scan'208";a="242446577" Received: from slindbla-desk.ger.corp.intel.com (HELO fedora) ([10.245.245.68]) by fmviesa006-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Jun 2026 06:54:22 -0700 From: =?UTF-8?q?Thomas=20Hellstr=C3=B6m?= To: intel-xe@lists.freedesktop.org Cc: =?UTF-8?q?Thomas=20Hellstr=C3=B6m?= , Matthew Brost , Maarten Lankhorst , Michal Mrozek , John Falkowski , Rodrigo Vivi , Lahtinen Joonas , David Howells , Christian Brauner , Kees Cook , Davidlohr Bueso , =?UTF-8?q?Christian=20K=C3=B6nig?= , Dave Airlie , Simona Vetter , dri-devel@lists.freedesktop.org, LMKL Subject: [PATCH 3/4] watch_queue: Add a DRM_XE_NOTIFY watch type and export init_watch() Date: Fri, 12 Jun 2026 15:53:39 +0200 Message-ID: <20260612135340.116100-4-thomas.hellstrom@linux.intel.com> X-Mailer: git-send-email 2.54.0 In-Reply-To: <20260612135340.116100-1-thomas.hellstrom@linux.intel.com> References: <20260612135340.116100-1-thomas.hellstrom@linux.intel.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add a DRM_XE_NOTIFY watch type for asynchronous error notifications from the DRM_XE kernel module. The reason for not registering a DRM - wide notification type is that the notification type is 24 bits wide, the subtype is only 8, If this is a concern one could define the DRM - wide subtypes to be per driver, not common across DRM. Also export the init_watch() function for use from kernel drivers. Use EXPORT_SYMBOL() to align with other exports from the same file. Assisted-by: GitHub_Copilot:claude-sonnet-4.6 Signed-off-by: Thomas Hellström --- include/uapi/drm/xe_drm.h | 4 ++-- include/uapi/linux/watch_queue.h | 3 ++- kernel/watch_queue.c | 13 ++++++++++--- 3 files changed, 14 insertions(+), 6 deletions(-) diff --git a/include/uapi/drm/xe_drm.h b/include/uapi/drm/xe_drm.h index bebb0167bd31..8d5e3f06b8d4 100644 --- a/include/uapi/drm/xe_drm.h +++ b/include/uapi/drm/xe_drm.h @@ -2550,8 +2550,8 @@ struct drm_xe_exec_queue_set_property { * preempt-fence mode or not restartable. * * An optional @timestamp_ns can be provided to measure the latency between - * event delivery and the point the worker is queued; the driver logs this - * once all sanity checks have passed. + * event delivery and locking; the driver logs this regardless of whether the + * VM was paused. */ /** diff --git a/include/uapi/linux/watch_queue.h b/include/uapi/linux/watch_queue.h index c3d8320b5d3a..c800c153989d 100644 --- a/include/uapi/linux/watch_queue.h +++ b/include/uapi/linux/watch_queue.h @@ -14,7 +14,8 @@ enum watch_notification_type { WATCH_TYPE_META = 0, /* Special record */ WATCH_TYPE_KEY_NOTIFY = 1, /* Key change event notification */ - WATCH_TYPE__NR = 2 + WATCH_TYPE_DRM_XE_NOTIFY = 2, /* DRM device event notification */ + WATCH_TYPE__NR = 3 }; enum watch_meta_notification_subtype { diff --git a/kernel/watch_queue.c b/kernel/watch_queue.c index 538520861e8b..701b5c388808 100644 --- a/kernel/watch_queue.c +++ b/kernel/watch_queue.c @@ -445,11 +445,17 @@ static void put_watch(struct watch *watch) } /** - * init_watch - Initialise a watch + * init_watch() - Initialise a watch subscription * @watch: The watch to initialise. - * @wqueue: The queue to assign. + * @wqueue: The watch queue (notification pipe) to associate with the watch. * - * Initialise a watch and set the watch queue. + * Initialise a newly allocated watch object and associate it with @wqueue. + * The caller must subsequently set @watch->id and @watch->info_id before + * calling add_watch_to_object() to subscribe the watch to a notification + * source. + * + * The watch queue reference is held internally; call put_watch_queue() if + * the watch is not successfully passed to add_watch_to_object(). */ void init_watch(struct watch *watch, struct watch_queue *wqueue) { @@ -458,6 +464,7 @@ void init_watch(struct watch *watch, struct watch_queue *wqueue) INIT_HLIST_NODE(&watch->queue_node); rcu_assign_pointer(watch->queue, wqueue); } +EXPORT_SYMBOL(init_watch); static int add_one_watch(struct watch *watch, struct watch_list *wlist, struct watch_queue *wqueue) { -- 2.54.0