From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.11]) (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 7DAA53B8BCB for ; Tue, 10 Mar 2026 15:58:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.11 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773158290; cv=none; b=mC9p+y7BWRQNzXZKZywV+UG4Ajooqz5MjhJuZWrhmAfBS9sXYMS16wILoVN/NxUB5tNqIF6UCYUFHoC2ja+CxP1yo3ndQrvp1kKTfTOwW28JR7BNfPIeuWLb1ZJA6k/unUBg3MlOMXV/rigdeTOdLG9tdP9irxKs8G4fYRVEV5g= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773158290; c=relaxed/simple; bh=suJDybSf2bJqRVbjzEF27konpZySIM4+uxLXQPLFNOQ=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=mShN0si+sJ9fD7EVWP24wcoMDtwYtjYTt3ps97Ueq/IOadckhIKyOimEAZzJhwHjUFe/3DKsXboINFmT+i5gMDxQt4kucYURZ5hjF5ueKUXldSa++US4wp2lwxzT4cCYHomaWPikzHB4LPOXJROQdakxVxUTddv27nYxQl8T5Wg= 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=ReO47uHN; arc=none smtp.client-ip=192.198.163.11 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="ReO47uHN" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1773158288; x=1804694288; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=suJDybSf2bJqRVbjzEF27konpZySIM4+uxLXQPLFNOQ=; b=ReO47uHNH9k9BunfAypS04DP906Ubcxs14jgQqLsDmwFStuZqfcarUkR 2md2vpxnCOhRUQY86sqKTPPV5rqjnsAqJyOmh5HeZpATIdFYS9NiXc9jL FzBaxyFLveFN6yOuWssIsDN+r2TYXOWxgDRefsFkdJ1X6eRGm8GFTHNwe iT6khaiYuQaeov8zUMICZ6TH32CJBpUiKPsVeTEZdrdg+PDO1ed9XUTeO UW4oPgIJVpeVFL4k464NKGHM4BvS6nbsg30Or0eQKy3R8V+xk+BZkGIbi aNKmKXMzCZhBwuEW25xNribYYXPB3lrgyKZE7L48RNkp5oHgtUBLNrffg A==; X-CSE-ConnectionGUID: NsF5wga3TD6pQ5JbxuymzQ== X-CSE-MsgGUID: jONKHPMsTK2RJU4SxpsMnA== X-IronPort-AV: E=McAfee;i="6800,10657,11725"; a="84842726" X-IronPort-AV: E=Sophos;i="6.23,112,1770624000"; d="scan'208";a="84842726" Received: from orviesa004.jf.intel.com ([10.64.159.144]) by fmvoesa105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Mar 2026 08:58:08 -0700 X-CSE-ConnectionGUID: 9lrVPpsOQMOw2aUR9hxX3g== X-CSE-MsgGUID: qevIcnH6Sci9p6WR8mT8Jw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.23,112,1770624000"; d="scan'208";a="224615389" Received: from fpallare-mobl4.ger.corp.intel.com (HELO fedora) ([10.245.244.90]) by orviesa004-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Mar 2026 08:58:04 -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: [RFC PATCH RESEND 1/2] watch_queue: Add a DRM_XE_NOTIFY watch type and export init_watch() Date: Tue, 10 Mar 2026 16:57:40 +0100 Message-ID: <20260310155741.87191-2-thomas.hellstrom@linux.intel.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260310155741.87191-1-thomas.hellstrom@linux.intel.com> References: <20260310155741.87191-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. 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/linux/watch_queue.h | 3 ++- kernel/watch_queue.c | 13 ++++++++++--- 2 files changed, 12 insertions(+), 4 deletions(-) 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.53.0