From nobody Fri Dec 19 01:09:20 2025 Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.19]) (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 55BED5338F for ; Mon, 29 Apr 2024 12:09:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.19 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714392560; cv=none; b=oAukk06YxWA+t7+aIVNX2uclpam2AobrmrkWDqshjwQZ2oBvpgsaOxcjvMcgw3cvU+cyYdiIB3Jk3Yl1Z0WGySIj9Amz/1rcMk+2INTb3o4K48WkVqymh4cmWY58WvM85CTcBOVHNUkO8kVKyxDjtGXLBJ0gLbaz/xmdccWvCrA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714392560; c=relaxed/simple; bh=kZea8gg6v2oPK+AP92ObeW+V0830/M7URcyFuYoYhaU=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=ukrAVUGpk+I/UCrc4VfDZhVYIy622d/k4e6fainMNYO/dB7PfyBUV8kmNgLHdCrpBlsdUnQy9pjyPHObcMh2EGFPjOC4CJYJ5+IQWnQjBEZsKorZegucvciOg1eRqejesCK21VCIUDusb2ZgGesXBH2wNBG6S339cR4CscX4C9w= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com; spf=none smtp.mailfrom=linux.intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=G/Eq66ke; arc=none smtp.client-ip=198.175.65.19 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=none 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="G/Eq66ke" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1714392560; x=1745928560; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=kZea8gg6v2oPK+AP92ObeW+V0830/M7URcyFuYoYhaU=; b=G/Eq66kea7Mxr3Dqy4Fd+4RvDiS1JpGv82Ca2xwnKT2sJZBLmvVjGEY5 mTLkWmoBVL6QHkcnqi7hTbMbszbkYuw+KE54ri+JVa3yKiTztSWhpNAjT WAbONNyM96xBgS7TOkccY2hWGbagyCZbuzH6mBn4najUaAKShbnFlGKPi M9a87zPNktGrbCVcPi+4o56msMd3jB918mdFODNEcEKMRHvRcO97MGage OcxqxmIglNxiqBwxSVoozegV8NbFmFcJM4VGEh54u+PAjilRO8H83CLOc TfstJnPE8lsAx7FvIrEda4+6hXIuuMlgyTPJTzwEw8M+PfVpe7DBWXnIb g==; X-CSE-ConnectionGUID: RZG+9WxKS3qLYYjjfJQVMw== X-CSE-MsgGUID: 0YaMFGHpTVmy2hdA/GwjgQ== X-IronPort-AV: E=McAfee;i="6600,9927,11057"; a="9908208" X-IronPort-AV: E=Sophos;i="6.07,239,1708416000"; d="scan'208";a="9908208" Received: from fmviesa010.fm.intel.com ([10.60.135.150]) by orvoesa111.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 Apr 2024 05:09:19 -0700 X-CSE-ConnectionGUID: qCQceCV0RxujTN5kXVSSZg== X-CSE-MsgGUID: UaxK+OLWTWOyq6qtogwPxQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.07,239,1708416000"; d="scan'208";a="26166606" Received: from black.fi.intel.com (HELO black.fi.intel.com.) ([10.237.72.28]) by fmviesa010.fm.intel.com with ESMTP; 29 Apr 2024 05:09:16 -0700 From: Alexander Shishkin To: Greg Kroah-Hartman Cc: linux-kernel@vger.kernel.org, Dan Carpenter , Amelie Delaunay , Andy Shevchenko , Alexander Shishkin Subject: [PATCH 01/14] stm class: Fix a double free in stm_register_device() Date: Mon, 29 Apr 2024 15:08:55 +0300 Message-ID: <20240429120908.3723458-2-alexander.shishkin@linux.intel.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240429120908.3723458-1-alexander.shishkin@linux.intel.com> References: <20240429120908.3723458-1-alexander.shishkin@linux.intel.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Dan Carpenter The put_device(&stm->dev) call will trigger stm_device_release() which frees "stm" so the vfree(stm) on the next line is a double free. Fixes: 389b6699a2aa ("stm class: Fix stm device initialization order") Signed-off-by: Dan Carpenter Reviewed-by: Amelie Delaunay Reviewed-by: Andy Shevchenko Signed-off-by: Alexander Shishkin --- drivers/hwtracing/stm/core.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/drivers/hwtracing/stm/core.c b/drivers/hwtracing/stm/core.c index 534fbefc7f6a..20895d391562 100644 --- a/drivers/hwtracing/stm/core.c +++ b/drivers/hwtracing/stm/core.c @@ -868,8 +868,11 @@ int stm_register_device(struct device *parent, struct = stm_data *stm_data, return -ENOMEM; =20 stm->major =3D register_chrdev(0, stm_data->name, &stm_fops); - if (stm->major < 0) - goto err_free; + if (stm->major < 0) { + err =3D stm->major; + vfree(stm); + return err; + } =20 device_initialize(&stm->dev); stm->dev.devt =3D MKDEV(stm->major, 0); @@ -913,10 +916,8 @@ int stm_register_device(struct device *parent, struct = stm_data *stm_data, err_device: unregister_chrdev(stm->major, stm_data->name); =20 - /* matches device_initialize() above */ + /* calls stm_device_release() */ put_device(&stm->dev); -err_free: - vfree(stm); =20 return err; } --=20 2.43.0 From nobody Fri Dec 19 01:09:20 2025 Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.19]) (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 8EF7D537E0 for ; Mon, 29 Apr 2024 12:09:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.19 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714392562; cv=none; b=RIYYfjFXWpH18/WpGwpvwwIy/QkOdCRO7ngr7Oj1/st0t8ycrRjEDzr4iIr7itYe8CcT9AQ3e8eAZAe8QKhFMCf/NXTzuEgjTkLLwUgIiklMT8J14vsgMKJqEv/XXny/uUit9XVtTmLTnwE+icDbw/6q7ei1i3NmMJxwxUCqNXw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714392562; c=relaxed/simple; bh=ni7xzfycKKP1MKVU8EmsUqb3361Wz7LPiZp+v1kH+eQ=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Zo6gRadhUwG1yJ4MLyVoCDWJeOx/sMwlPYuuZkEhRg90I7xOIQoS0DP4H7ZOw4/iwNj3FQrmYnYZXrxR0lsP3Nc8uUBGlvHU3C0sN0qEOmbw0Bw0PDWXcI1+A1W7eKx/1StAEesLLew7zStrqGVq3XwEFC6A3LRkMQcUWmTdXoc= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com; spf=none smtp.mailfrom=linux.intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=jreTv6z5; arc=none smtp.client-ip=198.175.65.19 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=none 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="jreTv6z5" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1714392561; x=1745928561; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=ni7xzfycKKP1MKVU8EmsUqb3361Wz7LPiZp+v1kH+eQ=; b=jreTv6z5Lqtst1K42qZvld9Fa+GCShFYJs7t3IXdihuQZDFqk7gRM3X3 izeARhTxnCyL4zhBbbki6qlI8/6zS3ww6Jvknm12ZOViygSYi/KsUeg2C BiXbKgv1B/R+tsqmT70IYR4aKI+FbKOS+lu57WHyw/zEUoPqkHylz+dSW BqUKdi1hH4OEFndeY0rUHoF476nRBWVStSavAHQWGRd4y4FvOIzud+D0Z UwEsqJSP/zFfFcMVKlNnGuD/lCNM4tTEu/0ZjMBwMy2k5B80/rVKkpjjM Q7xfyouwPaJlw1TNmvR6GsOa6gsabs52nxzZwLTZhwQTRwwUwikaDYIMQ A==; X-CSE-ConnectionGUID: f6oHwzDtTAC26JueOoaVsQ== X-CSE-MsgGUID: Tq31DkfqS7an3uRoxS4eiA== X-IronPort-AV: E=McAfee;i="6600,9927,11057"; a="9908216" X-IronPort-AV: E=Sophos;i="6.07,239,1708416000"; d="scan'208";a="9908216" Received: from fmviesa010.fm.intel.com ([10.60.135.150]) by orvoesa111.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 Apr 2024 05:09:21 -0700 X-CSE-ConnectionGUID: 9kqqu18kRXa+a8BUdZFOEA== X-CSE-MsgGUID: ZvehNrR7T0+syPKBda//Fw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.07,239,1708416000"; d="scan'208";a="26166609" Received: from black.fi.intel.com (HELO black.fi.intel.com.) ([10.237.72.28]) by fmviesa010.fm.intel.com with ESMTP; 29 Apr 2024 05:09:18 -0700 From: Alexander Shishkin To: Greg Kroah-Hartman Cc: linux-kernel@vger.kernel.org, Mikhail Lappo , Alexander Shishkin , Andy Shevchenko Subject: [PATCH 02/14] stm class: Add source type Date: Mon, 29 Apr 2024 15:08:56 +0300 Message-ID: <20240429120908.3723458-3-alexander.shishkin@linux.intel.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240429120908.3723458-1-alexander.shishkin@linux.intel.com> References: <20240429120908.3723458-1-alexander.shishkin@linux.intel.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Mikhail Lappo Currently kernel HW tracing infrastrtucture and specifically its SyS-T part treats all source data in the same way. Treating and encoding different trace data sources differently might allow decoding software to make use of e.g. ftrace event ids by converting them to a SyS-T message catalog. The solution is to keep source type stored within stm_source_data structure to allow different handling by stm output/protocol. Currently we only differentiate between STM_USER and STM_FTRACE sources. Signed-off-by: Mikhail Lappo Signed-off-by: Alexander Shishkin Reviewed-by: Andy Shevchenko --- drivers/hwtracing/stm/console.c | 1 + drivers/hwtracing/stm/ftrace.c | 1 + drivers/hwtracing/stm/heartbeat.c | 1 + include/linux/stm.h | 12 ++++++++++++ 4 files changed, 15 insertions(+) diff --git a/drivers/hwtracing/stm/console.c b/drivers/hwtracing/stm/consol= e.c index a00f65e21747..097a00ac43a7 100644 --- a/drivers/hwtracing/stm/console.c +++ b/drivers/hwtracing/stm/console.c @@ -22,6 +22,7 @@ static struct stm_console { .data =3D { .name =3D "console", .nr_chans =3D 1, + .type =3D STM_USER, .link =3D stm_console_link, .unlink =3D stm_console_unlink, }, diff --git a/drivers/hwtracing/stm/ftrace.c b/drivers/hwtracing/stm/ftrace.c index 3bb606dfa634..a7cea7ea0163 100644 --- a/drivers/hwtracing/stm/ftrace.c +++ b/drivers/hwtracing/stm/ftrace.c @@ -23,6 +23,7 @@ static struct stm_ftrace { .data =3D { .name =3D "ftrace", .nr_chans =3D STM_FTRACE_NR_CHANNELS, + .type =3D STM_FTRACE, .link =3D stm_ftrace_link, .unlink =3D stm_ftrace_unlink, }, diff --git a/drivers/hwtracing/stm/heartbeat.c b/drivers/hwtracing/stm/hear= tbeat.c index 81d7b21d31ec..e9496fe97baa 100644 --- a/drivers/hwtracing/stm/heartbeat.c +++ b/drivers/hwtracing/stm/heartbeat.c @@ -78,6 +78,7 @@ static int stm_heartbeat_init(void) } =20 stm_heartbeat[i].data.nr_chans =3D 1; + stm_heartbeat[i].data.type =3D STM_USER; stm_heartbeat[i].data.link =3D stm_heartbeat_link; stm_heartbeat[i].data.unlink =3D stm_heartbeat_unlink; hrtimer_init(&stm_heartbeat[i].hrtimer, CLOCK_MONOTONIC, diff --git a/include/linux/stm.h b/include/linux/stm.h index 3b22689512be..2fcbef9608f6 100644 --- a/include/linux/stm.h +++ b/include/linux/stm.h @@ -30,6 +30,16 @@ enum stp_packet_flags { STP_PACKET_TIMESTAMPED =3D 0x2, }; =20 +/** + * enum stm_source_type - STM source driver + * @STM_USER: any STM trace source + * @STM_FTRACE: ftrace STM source + */ +enum stm_source_type { + STM_USER, + STM_FTRACE, +}; + struct stp_policy; =20 struct stm_device; @@ -106,6 +116,7 @@ struct stm_source_device; * @name: device name, will be used for policy lookup * @src: internal structure, only used by stm class code * @nr_chans: number of channels to allocate + * @type: type of STM source driver represented by stm_source_type * @link: called when this source gets linked to an STM device * @unlink: called when this source is about to get unlinked from its STM * @@ -117,6 +128,7 @@ struct stm_source_data { struct stm_source_device *src; unsigned int percpu; unsigned int nr_chans; + unsigned int type; int (*link)(struct stm_source_data *data); void (*unlink)(struct stm_source_data *data); }; --=20 2.43.0 From nobody Fri Dec 19 01:09:20 2025 Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.19]) (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 B880954743 for ; Mon, 29 Apr 2024 12:09:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.19 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714392564; cv=none; b=NIWgOOaqcnBQY/3HSXsujQO+0FXf9QImgGfYb/X+PiMKn7OHXDLlyo8dGdzuP2lQXeTCWM9mbIENlcdGnSyVZVxkq7h83A6TYW6QVm32YgHZIQOhBpOCL4Lk2W85+9RAGAcdDHwdyqnmgFJLlOlpTzwCI9NQUF/I2Nrq2Ohc5/8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714392564; c=relaxed/simple; bh=BmzzzNy0Qq0vMdNau1EvSHuLwokSd2AWKX8qj1/Jr6Q=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=o7RKa5fJcQoKZBFJf9bilQ1HHR9VfT/IcvmOJpRDEz/CCiV8V0WYCvmZyB3NgRfycYIMs7M+McARit/AHsfvUztNy3O5V7lJt6tqkwO37DPTG3k/sFOmSIHHBmS6lskFitrzC7F8cqB2rNjcTw3L4pcGsE0jRJYD2IgoiRhOnK4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com; spf=none smtp.mailfrom=linux.intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=ZJvNYxPY; arc=none smtp.client-ip=198.175.65.19 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=none 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="ZJvNYxPY" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1714392563; x=1745928563; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=BmzzzNy0Qq0vMdNau1EvSHuLwokSd2AWKX8qj1/Jr6Q=; b=ZJvNYxPY77Z80SORpv8UsArrveRAm3ic4xG50lmMckc7SsJ7uws+xosr ph7QMvOasfLZhHVLFNvCXaJXxdf6wV3xWJgjJml9kaGcm9H3ZmE9npEiF KSaKE6/u67aEZWCddRZ0bbRIWNpzK4cVn9SXKTuLMrM0nUYf2HvSR3Y0q 53InJqe9h+CmnNH0TMBAbnO+F5PFiNALLyaZ168aHnSmXEwO+zZS1gQve a17kuEfHpkDbe5mKbm93KQbaCe77NSsXJvyIW+DmsU7u+po+0PNmBGMXB rVPGOIZLlhjt2Y1uk7/l1ySp7SEpKczA2n5PaptomG+WL2S+YrPY4/TZt Q==; X-CSE-ConnectionGUID: 6fFZH/PoQJOpF7cNFrjTOQ== X-CSE-MsgGUID: tHJwHojjQlGkXgP50PtnRg== X-IronPort-AV: E=McAfee;i="6600,9927,11057"; a="9908222" X-IronPort-AV: E=Sophos;i="6.07,239,1708416000"; d="scan'208";a="9908222" Received: from fmviesa010.fm.intel.com ([10.60.135.150]) by orvoesa111.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 Apr 2024 05:09:22 -0700 X-CSE-ConnectionGUID: DQykfGYrSxm1SPBtu9Tzzg== X-CSE-MsgGUID: JysAfQlgSle4dJgF6PQYxg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.07,239,1708416000"; d="scan'208";a="26166613" Received: from black.fi.intel.com (HELO black.fi.intel.com.) ([10.237.72.28]) by fmviesa010.fm.intel.com with ESMTP; 29 Apr 2024 05:09:20 -0700 From: Alexander Shishkin To: Greg Kroah-Hartman Cc: linux-kernel@vger.kernel.org, Mikhail Lappo , Alexander Shishkin , Andy Shevchenko Subject: [PATCH 03/14] stm class: Propagate source type to protocols Date: Mon, 29 Apr 2024 15:08:57 +0300 Message-ID: <20240429120908.3723458-4-alexander.shishkin@linux.intel.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240429120908.3723458-1-alexander.shishkin@linux.intel.com> References: <20240429120908.3723458-1-alexander.shishkin@linux.intel.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Mikhail Lappo Pass stm source type via stm_write() to allow different handling on protocol level. The measure above should allow protocol level encoder to differentiate and accordingly pack the messages. As an example SyS-T might get use of ftrace message ID's and instead of applying regular header, pack them as SyS-T catalog or SyS-T Structured Binary Data message to allow proper decoding on the other side. Signed-off-by: Mikhail Lappo Signed-off-by: Alexander Shishkin Reviewed-by: Andy Shevchenko --- drivers/hwtracing/stm/core.c | 8 ++++---- drivers/hwtracing/stm/p_basic.c | 3 ++- drivers/hwtracing/stm/p_sys-t.c | 3 ++- drivers/hwtracing/stm/stm.h | 2 +- 4 files changed, 9 insertions(+), 7 deletions(-) diff --git a/drivers/hwtracing/stm/core.c b/drivers/hwtracing/stm/core.c index 20895d391562..ccf39a80dc4f 100644 --- a/drivers/hwtracing/stm/core.c +++ b/drivers/hwtracing/stm/core.c @@ -600,7 +600,7 @@ EXPORT_SYMBOL_GPL(stm_data_write); =20 static ssize_t notrace stm_write(struct stm_device *stm, struct stm_output *output, - unsigned int chan, const char *buf, size_t count) + unsigned int chan, const char *buf, size_t count, struct stm_source_dat= a *source) { int err; =20 @@ -608,7 +608,7 @@ stm_write(struct stm_device *stm, struct stm_output *ou= tput, if (!stm->pdrv) return -ENODEV; =20 - err =3D stm->pdrv->write(stm->data, output, chan, buf, count); + err =3D stm->pdrv->write(stm->data, output, chan, buf, count, source); if (err < 0) return err; =20 @@ -657,7 +657,7 @@ static ssize_t stm_char_write(struct file *file, const = char __user *buf, =20 pm_runtime_get_sync(&stm->dev); =20 - count =3D stm_write(stm, &stmf->output, 0, kbuf, count); + count =3D stm_write(stm, &stmf->output, 0, kbuf, count, NULL); =20 pm_runtime_mark_last_busy(&stm->dev); pm_runtime_put_autosuspend(&stm->dev); @@ -1299,7 +1299,7 @@ int notrace stm_source_write(struct stm_source_data *= data, =20 stm =3D srcu_dereference(src->link, &stm_source_srcu); if (stm) - count =3D stm_write(stm, &src->output, chan, buf, count); + count =3D stm_write(stm, &src->output, chan, buf, count, data); else count =3D -ENODEV; =20 diff --git a/drivers/hwtracing/stm/p_basic.c b/drivers/hwtracing/stm/p_basi= c.c index 8980a6a5fd6c..5525c975cc6f 100644 --- a/drivers/hwtracing/stm/p_basic.c +++ b/drivers/hwtracing/stm/p_basic.c @@ -10,7 +10,8 @@ #include "stm.h" =20 static ssize_t basic_write(struct stm_data *data, struct stm_output *outpu= t, - unsigned int chan, const char *buf, size_t count) + unsigned int chan, const char *buf, size_t count, + struct stm_source_data *source) { unsigned int c =3D output->channel + chan; unsigned int m =3D output->master; diff --git a/drivers/hwtracing/stm/p_sys-t.c b/drivers/hwtracing/stm/p_sys-= t.c index 8254971c02e7..5b4b9f350ec1 100644 --- a/drivers/hwtracing/stm/p_sys-t.c +++ b/drivers/hwtracing/stm/p_sys-t.c @@ -285,7 +285,8 @@ sys_t_clock_sync(struct stm_data *data, unsigned int m,= unsigned int c) } =20 static ssize_t sys_t_write(struct stm_data *data, struct stm_output *outpu= t, - unsigned int chan, const char *buf, size_t count) + unsigned int chan, const char *buf, size_t count, + struct stm_source_data *source) { struct sys_t_output *op =3D output->pdrv_private; unsigned int c =3D output->channel + chan; diff --git a/drivers/hwtracing/stm/stm.h b/drivers/hwtracing/stm/stm.h index a9be49fc7a6b..85dda6e0d10c 100644 --- a/drivers/hwtracing/stm/stm.h +++ b/drivers/hwtracing/stm/stm.h @@ -96,7 +96,7 @@ struct stm_protocol_driver { const char *name; ssize_t (*write)(struct stm_data *data, struct stm_output *output, unsigned int chan, - const char *buf, size_t count); + const char *buf, size_t count, struct stm_source_data *source); void (*policy_node_init)(void *arg); int (*output_open)(void *priv, struct stm_output *output); void (*output_close)(struct stm_output *output); --=20 2.43.0 From nobody Fri Dec 19 01:09:20 2025 Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.19]) (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 994D654902 for ; Mon, 29 Apr 2024 12:09:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.19 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714392567; cv=none; b=G6LmBK8JqVOyBCuz6OA/CvbeH26rSk53tRfaUEj74P30ny3Dxis6wJ4hoRLGemYckRmLNorgwLHe5BsA46V9FQK0Om/AQ6+4789dFHF18LMguxLyntod/u1GLDa5kbvl8TlF6mE+9ZUdFlnSFrPFznrPqk2rMCAUSenGtD4c6nY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714392567; c=relaxed/simple; bh=h27EgWOLsss6t7NKo0NXSZGbrkKNJW9OOXO9eHyRHqY=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=h9z7HbFOaqPWpMFo+OFy5tdpxQnMIppEF/IF1JH2bI5rznI6k3L0/eo6KoiAq5ZDOX4KKlbWD8+NZfpRuRMpWfoewzK2x92gYcPiMgM0Bqt8c7Rft0p4aw+O/9zzZpOTjd60t3qQClQq9pWX3qB1TV5h874Ex04A3ETMKnOWL6E= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com; spf=none smtp.mailfrom=linux.intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=IggoCRPY; arc=none smtp.client-ip=198.175.65.19 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=none 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="IggoCRPY" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1714392566; x=1745928566; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=h27EgWOLsss6t7NKo0NXSZGbrkKNJW9OOXO9eHyRHqY=; b=IggoCRPYE6VImiftFdDzGdHxaJoRP0F/aDG4Bvyvn7R6D8hJ3vsX8h+a N2/EFFWBnrVBjCJLffysnq9pE/4txvTmnnSdDOr+JBtt1iKEtJoiINRj9 RdVS/kH3dACSR6jq9vOok+RcxgBJ+wYzpy7OQLZ4T+miLrtCxUxWnntes dl4Lx1GPIy+Ge4ffrP7sA8vc+HFpX9kd9cmugcqabX8wMwULi/olxopSX Zd7khAf40J9MUSlKfEiYNnKO/Tyo+nVAx3ILzobCISiL+zs0ZMHuUPhEL pIH/zcUFpXwg4atbNv6f3aFfeedTcWWd2BdIX4IopoFMyztQemV6eqewJ w==; X-CSE-ConnectionGUID: 1LopK+glQYKzrRHGNXDlCA== X-CSE-MsgGUID: Eqj4gQGJQvSQd/OL7ROhGw== X-IronPort-AV: E=McAfee;i="6600,9927,11057"; a="9908233" X-IronPort-AV: E=Sophos;i="6.07,239,1708416000"; d="scan'208";a="9908233" Received: from fmviesa010.fm.intel.com ([10.60.135.150]) by orvoesa111.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 Apr 2024 05:09:24 -0700 X-CSE-ConnectionGUID: wSg0S4RzQaWdrbkCCu9LHA== X-CSE-MsgGUID: 42BxqwBkRYuzFRIIlsI1YA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.07,239,1708416000"; d="scan'208";a="26166617" Received: from black.fi.intel.com (HELO black.fi.intel.com.) ([10.237.72.28]) by fmviesa010.fm.intel.com with ESMTP; 29 Apr 2024 05:09:22 -0700 From: Alexander Shishkin To: Greg Kroah-Hartman Cc: linux-kernel@vger.kernel.org, Mikhail Lappo , Alexander Shishkin , Andy Shevchenko Subject: [PATCH 04/14] stm class: sys-t: Improve ftrace source handling Date: Mon, 29 Apr 2024 15:08:58 +0300 Message-ID: <20240429120908.3723458-5-alexander.shishkin@linux.intel.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240429120908.3723458-1-alexander.shishkin@linux.intel.com> References: <20240429120908.3723458-1-alexander.shishkin@linux.intel.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Mikhail Lappo Package messages from ftrace source with SyS-T Structured Binary Data (later SBD) header and 64-bit ID. This provides modification-free compatibility between ftrace and SyS-T arguments structure by applying 0xFFFF mask on message ID. This happens due to the fact that SBD and ftrace structures have the same principle of data storage:
. The headers are bit-to-bit compatible and both contain event/catalog ID with the exception, that ftrace header contains more fields within 64 bits which needs to be masked during encoding process, since SBD standard doesn't support mask of ID field. 0 15 16 23 24 31 32 39 40 63 ftrace: <-pid-> <----> SBD: <------- msg_id ------------------------------> Signed-off-by: Mikhail Lappo Signed-off-by: Alexander Shishkin Reviewed-by: Andy Shevchenko --- drivers/hwtracing/stm/p_sys-t.c | 90 ++++++++++++++++++++++++++++++--- 1 file changed, 83 insertions(+), 7 deletions(-) diff --git a/drivers/hwtracing/stm/p_sys-t.c b/drivers/hwtracing/stm/p_sys-= t.c index 5b4b9f350ec1..1e75aa0025a3 100644 --- a/drivers/hwtracing/stm/p_sys-t.c +++ b/drivers/hwtracing/stm/p_sys-t.c @@ -20,6 +20,7 @@ enum sys_t_message_type { MIPI_SYST_TYPE_RAW =3D 6, MIPI_SYST_TYPE_SHORT64, MIPI_SYST_TYPE_CLOCK, + MIPI_SYST_TYPE_SBD, }; =20 enum sys_t_message_severity { @@ -53,6 +54,19 @@ enum sys_t_message_string_subtype { MIPI_SYST_STRING_PRINTF_64 =3D 12, }; =20 +/** + * enum sys_t_message_sbd_subtype - SyS-T SBD message subtypes + * @MIPI_SYST_SBD_ID32: SBD message with 32-bit message ID + * @MIPI_SYST_SBD_ID64: SBD message with 64-bit message ID + * + * Structured Binary Data messages can send information of arbitrary lengt= h, + * together with ID's that describe BLOB's content and layout. + */ +enum sys_t_message_sbd_subtype { + MIPI_SYST_SBD_ID32 =3D 0, + MIPI_SYST_SBD_ID64 =3D 1, +}; + #define MIPI_SYST_TYPE(t) ((u32)(MIPI_SYST_TYPE_ ## t)) #define MIPI_SYST_SEVERITY(s) ((u32)(MIPI_SYST_SEVERITY_ ## s) << 4) #define MIPI_SYST_OPT_LOC BIT(8) @@ -75,6 +89,20 @@ enum sys_t_message_string_subtype { #define CLOCK_SYNC_HEADER (MIPI_SYST_TYPES(CLOCK, TRANSPORT_SYNC) | \ MIPI_SYST_SEVERITY(MAX)) =20 +/* + * SyS-T and ftrace headers are compatible to an extent that ftrace event = ID + * and args can be treated as SyS-T SBD message with 64-bit ID and argumen= ts + * BLOB right behind the header without modification. Bits [16:63] coming + * together with message ID from ftrace aren't used by SBD and must be zer= oed. + * + * 0 15 16 23 24 31 32 39 40 63 + * ftrace: <-pid-> <----> + * SBD: <------- msg_id ------------------------------> + */ +#define SBD_HEADER (MIPI_SYST_TYPES(SBD, ID64) | \ + MIPI_SYST_SEVERITY(INFO) | \ + MIPI_SYST_OPT_GUID) + struct sys_t_policy_node { uuid_t uuid; bool do_len; @@ -284,6 +312,59 @@ sys_t_clock_sync(struct stm_data *data, unsigned int m= , unsigned int c) return sizeof(header) + sizeof(payload); } =20 +static inline u32 sys_t_header(struct stm_source_data *source) +{ + if (source && source->type =3D=3D STM_FTRACE) + return SBD_HEADER; + return DATA_HEADER; +} + +static ssize_t sys_t_write_data(struct stm_data *data, + struct stm_source_data *source, + unsigned int master, unsigned int channel, + bool ts_first, const void *buf, size_t count) +{ + ssize_t sz; + const unsigned char nil =3D 0; + + /* + * Ftrace is zero-copy compatible with SyS-T SBD, but requires + * special handling of first 64 bits. Trim and send them separately + * to avoid damage on original ftrace buffer. + */ + if (source && source->type =3D=3D STM_FTRACE) { + u64 compat_ftrace_header; + ssize_t header_sz; + ssize_t buf_sz; + + if (count < sizeof(compat_ftrace_header)) + return -EINVAL; + + /* SBD only makes use of low 16 bits (event ID) from ftrace event */ + compat_ftrace_header =3D *(u64 *)buf & 0xffff; + header_sz =3D stm_data_write(data, master, channel, false, + &compat_ftrace_header, + sizeof(compat_ftrace_header)); + if (header_sz !=3D sizeof(compat_ftrace_header)) + return header_sz; + + buf_sz =3D stm_data_write(data, master, channel, false, + buf + header_sz, count - header_sz); + if (buf_sz !=3D count - header_sz) + return buf_sz; + sz =3D header_sz + buf_sz; + } else { + sz =3D stm_data_write(data, master, channel, false, buf, count); + } + + if (sz <=3D 0) + return sz; + + data->packet(data, master, channel, STP_PACKET_FLAG, 0, 0, &nil); + + return sz; +} + static ssize_t sys_t_write(struct stm_data *data, struct stm_output *outpu= t, unsigned int chan, const char *buf, size_t count, struct stm_source_data *source) @@ -291,8 +372,7 @@ static ssize_t sys_t_write(struct stm_data *data, struc= t stm_output *output, struct sys_t_output *op =3D output->pdrv_private; unsigned int c =3D output->channel + chan; unsigned int m =3D output->master; - const unsigned char nil =3D 0; - u32 header =3D DATA_HEADER; + u32 header =3D sys_t_header(source); u8 uuid[UUID_SIZE]; ssize_t sz; =20 @@ -349,11 +429,7 @@ static ssize_t sys_t_write(struct stm_data *data, stru= ct stm_output *output, } =20 /* DATA */ - sz =3D stm_data_write(data, m, c, false, buf, count); - if (sz > 0) - data->packet(data, m, c, STP_PACKET_FLAG, 0, 0, &nil); - - return sz; + return sys_t_write_data(data, source, m, c, false, buf, count); } =20 static const struct stm_protocol_driver sys_t_pdrv =3D { --=20 2.43.0 From nobody Fri Dec 19 01:09:20 2025 Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.19]) (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 AA1FE54905 for ; Mon, 29 Apr 2024 12:09:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.19 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714392567; cv=none; b=R/xb44JwIUe6n10P6NZ91veCPnv2tVgeQJHuWO1y8I9Kp4hMnEmp3pgjZJNaKcupoxar228veQrwO/Lly4jX9UTPMxGI15vGV9Uk1vhmTy+16Jir0rWbPNorKQ8giwlqpn81y2a30tr1sPKyiGd92msA0Sv3107yWFiDr8p2A48= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714392567; c=relaxed/simple; bh=DArV7j/szx7co+lsS5KqZv3unCNqezb1USQ5LCYCZyI=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=dytpuyvjZcFJ3iglPVm4OC9XAjAXAi6o8xafxVfNToJ7/pR0zwpdmP86IT5zebKrVclj7m5CwyO+8N1ThX3jdUK+8l/Q4WTXyq33nE93LRIfdPvW5uzpmJYR2Qrt6hhI2U6t9E0pOmwrvcg440byvi+2uxlqu1x4cADLy+E0Yc0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com; spf=none smtp.mailfrom=linux.intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=dIv29yvj; arc=none smtp.client-ip=198.175.65.19 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=none 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="dIv29yvj" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1714392566; x=1745928566; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=DArV7j/szx7co+lsS5KqZv3unCNqezb1USQ5LCYCZyI=; b=dIv29yvj8urmtKFWeBEp1wl8DEH6/a9D+OW97ggMJeHneXh7Y5ogAYh0 MDT4YZ9TZqoaK1djpJDhZSYLxOCkVzPdwPAgHMGHw1DhO87QfqipIIWgd s9ydPGGDeGh4d0RYGlRorfcfd9zNB1b8aLjoCEZqoRbyLahs/JXcRlj16 jjgUAPIogxjT+ypNmo6j5P0GJPJ1SbGPfd+yAvKsy9R52TRZSIIrtZEzX rkYaT/9yG/Pz+Gj56iS22LrfQBTw9HhLDJxChox7QcTbciUz57eWc4Tl2 q/WAqNgSXIJO1Iokwe2FchC1hU4L3FYdpI+LMhdtWlYziGA6Yx6b6hPP6 g==; X-CSE-ConnectionGUID: oPVOdxbwSKiw4uHqGTqbBg== X-CSE-MsgGUID: +znorXDMSrGGEvzJXMELXQ== X-IronPort-AV: E=McAfee;i="6600,9927,11057"; a="9908242" X-IronPort-AV: E=Sophos;i="6.07,239,1708416000"; d="scan'208";a="9908242" Received: from fmviesa010.fm.intel.com ([10.60.135.150]) by orvoesa111.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 Apr 2024 05:09:26 -0700 X-CSE-ConnectionGUID: OG/5I1r0S0Ctk5Pj/kTiDA== X-CSE-MsgGUID: 5hJ2fJwbQYaXTD1yI50OGg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.07,239,1708416000"; d="scan'208";a="26166623" Received: from black.fi.intel.com (HELO black.fi.intel.com.) ([10.237.72.28]) by fmviesa010.fm.intel.com with ESMTP; 29 Apr 2024 05:09:23 -0700 From: Alexander Shishkin To: Greg Kroah-Hartman Cc: linux-kernel@vger.kernel.org, "Ricardo B. Marliere" , Alexander Shishkin , Andy Shevchenko Subject: [PATCH 05/14] intel_th: Constify the struct device_type usage Date: Mon, 29 Apr 2024 15:08:59 +0300 Message-ID: <20240429120908.3723458-6-alexander.shishkin@linux.intel.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240429120908.3723458-1-alexander.shishkin@linux.intel.com> References: <20240429120908.3723458-1-alexander.shishkin@linux.intel.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: "Ricardo B. Marliere" Since commit aed65af1cc2f ("drivers: make device_type const"), the driver core can properly handle constant struct device_type. Move the intel_th_source_device_type, intel_th_output_device_type, intel_th_switch_device_type and intel_th_device_type variables to be constant structures as well, placing it into read-only memory which can not be modified at runtime. Signed-off-by: Ricardo B. Marliere Signed-off-by: Alexander Shishkin Reviewed-by: Andy Shevchenko --- drivers/hwtracing/intel_th/core.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/hwtracing/intel_th/core.c b/drivers/hwtracing/intel_th= /core.c index cc7f879bb175..3511f3618f2d 100644 --- a/drivers/hwtracing/intel_th/core.c +++ b/drivers/hwtracing/intel_th/core.c @@ -180,7 +180,7 @@ static void intel_th_device_release(struct device *dev) intel_th_device_free(to_intel_th_device(dev)); } =20 -static struct device_type intel_th_source_device_type =3D { +static const struct device_type intel_th_source_device_type =3D { .name =3D "intel_th_source_device", .release =3D intel_th_device_release, }; @@ -333,19 +333,19 @@ static struct attribute *intel_th_output_attrs[] =3D { =20 ATTRIBUTE_GROUPS(intel_th_output); =20 -static struct device_type intel_th_output_device_type =3D { +static const struct device_type intel_th_output_device_type =3D { .name =3D "intel_th_output_device", .groups =3D intel_th_output_groups, .release =3D intel_th_device_release, .devnode =3D intel_th_output_devnode, }; =20 -static struct device_type intel_th_switch_device_type =3D { +static const struct device_type intel_th_switch_device_type =3D { .name =3D "intel_th_switch_device", .release =3D intel_th_device_release, }; =20 -static struct device_type *intel_th_device_type[] =3D { +static const struct device_type *intel_th_device_type[] =3D { [INTEL_TH_SOURCE] =3D &intel_th_source_device_type, [INTEL_TH_OUTPUT] =3D &intel_th_output_device_type, [INTEL_TH_SWITCH] =3D &intel_th_switch_device_type, --=20 2.43.0 From nobody Fri Dec 19 01:09:20 2025 Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.19]) (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 3EEFC54919 for ; Mon, 29 Apr 2024 12:09:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.19 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714392568; cv=none; b=aEiajFyDwpcxyZwa1jZinIHoSHA4uXqD7vCLziuX3vCHO9CtRkk22dPycoynvlw32AAOJQxedTudJYwGLifwUszR/+MWpZTiSyTyArGtzFwNdPlBJFPIR7husU11uzJAbkYfeVQexQdD/KCYFG9AN0STcSHJNzsXwVpCDklAtxs= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714392568; c=relaxed/simple; bh=NfZcypoD1CZ34fuMUBVKQlaVjj4H35Y4xSOcxQL65lQ=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Lv9iBMjKCkPh1N4b1rJiQ6PqEEatc4sAvVZK29luI4WDG96PtTTWKK+WsZIMcyDqA44+gD2pM6rJnFQzUKrFp9URhQPZJsVYkMwuLLkSuIwh0Lx1wOGL1a2h1AAYv1cx0KgzlAzH/cXS95qj4jUMmdoLwM/aWGKgjZxev0888WA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com; spf=none smtp.mailfrom=linux.intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=U4/0xUXY; arc=none smtp.client-ip=198.175.65.19 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=none 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="U4/0xUXY" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1714392568; x=1745928568; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=NfZcypoD1CZ34fuMUBVKQlaVjj4H35Y4xSOcxQL65lQ=; b=U4/0xUXYLiXM7tNClTzaDxPtFeskchT9N6RhKnyac69XFnlY+UHug5uC LNkN/7wn+X4NgBXcvccKWTbbrRpGI/GHKDdNRmzYSDJ+BmAJoJSvbLZeY TjnxSu++GQVOJuW+IsdivWlv41XMlURlvKHzTrNNkXHZODIrlvpBDhwYv Bq9n5/VqpcRuWPl/qQ+ZGciDzH/95X54axJ5JDW1np28qAA2zhalz9yLU 5eE84w03H3lq+yxmEOshTOJwhBa/t7iAE/do1TGkgRblboCyE1BkoWI91 RGcgrxXQBPVkxt5x+jinnjSmyoRPUN53Er7iW/DxNSxmeaoVGNg0OLBaU g==; X-CSE-ConnectionGUID: EcZN3ZbzTg2eaxRl6hf3tw== X-CSE-MsgGUID: Glqko+JXSh+dIZBPspGETw== X-IronPort-AV: E=McAfee;i="6600,9927,11057"; a="9908249" X-IronPort-AV: E=Sophos;i="6.07,239,1708416000"; d="scan'208";a="9908249" Received: from fmviesa010.fm.intel.com ([10.60.135.150]) by orvoesa111.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 Apr 2024 05:09:27 -0700 X-CSE-ConnectionGUID: jGbHB7zUSOm2Cra/AexmAQ== X-CSE-MsgGUID: d4ABijVXQX+IkYWI/rcQBA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.07,239,1708416000"; d="scan'208";a="26166625" Received: from black.fi.intel.com (HELO black.fi.intel.com.) ([10.237.72.28]) by fmviesa010.fm.intel.com with ESMTP; 29 Apr 2024 05:09:25 -0700 From: Alexander Shishkin To: Greg Kroah-Hartman Cc: linux-kernel@vger.kernel.org, Li Zhijian , Alexander Shishkin , Andy Shevchenko Subject: [PATCH 06/14] intel_th: Convert sprintf/snprintf to sysfs_emit Date: Mon, 29 Apr 2024 15:09:00 +0300 Message-ID: <20240429120908.3723458-7-alexander.shishkin@linux.intel.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240429120908.3723458-1-alexander.shishkin@linux.intel.com> References: <20240429120908.3723458-1-alexander.shishkin@linux.intel.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Li Zhijian Per filesystems/sysfs.rst, show() should only use sysfs_emit() or sysfs_emit_at() when formatting the value to be returned to user space. coccinelle complains that there are still a couple of functions that use snprintf(). Convert them to sysfs_emit(). sprintf() will be converted as weel if they have. Generally, this patch is generated by make coccicheck M=3D MODE=3Dpatch \ COCCI=3Dscripts/coccinelle/api/device_attr_show.cocci No functional change intended Signed-off-by: Li Zhijian Signed-off-by: Alexander Shishkin Reviewed-by: Andy Shevchenko --- drivers/hwtracing/intel_th/gth.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/hwtracing/intel_th/gth.c b/drivers/hwtracing/intel_th/= gth.c index b3308934a687..3883f99fd5d5 100644 --- a/drivers/hwtracing/intel_th/gth.c +++ b/drivers/hwtracing/intel_th/gth.c @@ -154,9 +154,9 @@ static ssize_t master_attr_show(struct device *dev, spin_unlock(>h->gth_lock); =20 if (port >=3D 0) - count =3D snprintf(buf, PAGE_SIZE, "%x\n", port); + count =3D sysfs_emit(buf, "%x\n", port); else - count =3D snprintf(buf, PAGE_SIZE, "disabled\n"); + count =3D sysfs_emit(buf, "disabled\n"); =20 return count; } @@ -332,8 +332,8 @@ static ssize_t output_attr_show(struct device *dev, pm_runtime_get_sync(dev); =20 spin_lock(>h->gth_lock); - count =3D snprintf(buf, PAGE_SIZE, "%x\n", - gth_output_parm_get(gth, oa->port, oa->parm)); + count =3D sysfs_emit(buf, "%x\n", + gth_output_parm_get(gth, oa->port, oa->parm)); spin_unlock(>h->gth_lock); =20 pm_runtime_put(dev); --=20 2.43.0 From nobody Fri Dec 19 01:09:20 2025 Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.19]) (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 B9CD46AFB5 for ; Mon, 29 Apr 2024 12:09:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.19 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714392571; cv=none; b=HwOMIsMnyHtfYfqDL7ELvTtvIr1mQrnRD1k9DEzqlXcMjbFSRLVKGCbqjkAbg3tXjq0WAqJ4X45Dg9hTBVsoqumbTh/5+GZPuuemk+5K7gPrEeLsytEZyFRITzxAtSf/V96F8aIx7CsAKsiRPnuCdcrzLMV8K8TTCXNUUuGp9ho= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714392571; c=relaxed/simple; bh=JzxYEt5O7zxHEt/Z8bns47/1CXCnPIbwbW+u3fqIlbI=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=upLjddokFdB75lcQSY7SvktoDhvKblp4VBb2jNzgVdQ9UE2PCdFjkZiVezN06qtlfd4VNgg8YdzCFP5lGnQYhYkZhCtWr4Z9wTWcwchsYqlsd4PMBWiZ1U5aNqZHYR+HpWj1/hSZVG5auJW43zRelav5uL74CH3RFHL5IF8lHSQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com; spf=none smtp.mailfrom=linux.intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=NluAY1O1; arc=none smtp.client-ip=198.175.65.19 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=none 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="NluAY1O1" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1714392570; x=1745928570; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=JzxYEt5O7zxHEt/Z8bns47/1CXCnPIbwbW+u3fqIlbI=; b=NluAY1O1mCx7DMeZntHKfw4Lbq+8pasSsftRhLAgnE5UShU+l02Ynftg 5QT3cwajSD07kRKzvfaoy1X55qA4c56ukPbb5IqJfffKY7DhfSsDpXtBp ceBLOwRXayeZBsxff7aghmXZ+IDg210zDMfiEFiPldF+FWujkya9ChbfR NA/PvqhzJO2fhzN1ib6VUMWIojkkFCR0L9zz70DnYNQs8sTPa0GanBKDK VEciTgErL1rTwyp1adMJJA6AEXAoTAON7P5aPu0PnJXUfirfb2zb4iUYU qZpP1oc/g8t1M5zvzfxbUSXPnAlKAs1iETn65GgubC2J3pXumAiuZrabg Q==; X-CSE-ConnectionGUID: PB+0qjK/Sx66K0Z0wbSKSA== X-CSE-MsgGUID: b21YA6ReRom7sfarb0k71A== X-IronPort-AV: E=McAfee;i="6600,9927,11057"; a="9908260" X-IronPort-AV: E=Sophos;i="6.07,239,1708416000"; d="scan'208";a="9908260" Received: from fmviesa010.fm.intel.com ([10.60.135.150]) by orvoesa111.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 Apr 2024 05:09:30 -0700 X-CSE-ConnectionGUID: KLkOLTXASEGaGeGadL/QIw== X-CSE-MsgGUID: tUPvs+rOR/GlgExXGifRlA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.07,239,1708416000"; d="scan'208";a="26166626" Received: from black.fi.intel.com (HELO black.fi.intel.com.) ([10.237.72.28]) by fmviesa010.fm.intel.com with ESMTP; 29 Apr 2024 05:09:27 -0700 From: Alexander Shishkin To: Greg Kroah-Hartman Cc: linux-kernel@vger.kernel.org, Colin Ian King , Alexander Shishkin , Andy Shevchenko Subject: [PATCH 07/14] intel_th: Remove redundant initialization of pointer outp Date: Mon, 29 Apr 2024 15:09:01 +0300 Message-ID: <20240429120908.3723458-8-alexander.shishkin@linux.intel.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240429120908.3723458-1-alexander.shishkin@linux.intel.com> References: <20240429120908.3723458-1-alexander.shishkin@linux.intel.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Colin Ian King The pointer outp is being initialized with a value that is never read. All the reads of outp occur after outp has neen set to an appropriate value rather than using the first value is initialized with. The assignment is redundant and can be removed. Cleans up clang scan warning: drivers/hwtracing/intel_th/sth.c:73:15: warning: Value stored to 'outp' during its initialization is never read [deadcode.DeadStores] Signed-off-by: Colin Ian King Signed-off-by: Alexander Shishkin Reviewed-by: Andy Shevchenko --- drivers/hwtracing/intel_th/sth.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/hwtracing/intel_th/sth.c b/drivers/hwtracing/intel_th/= sth.c index 9ca8c4e045f8..428f595a28a0 100644 --- a/drivers/hwtracing/intel_th/sth.c +++ b/drivers/hwtracing/intel_th/sth.c @@ -70,8 +70,8 @@ static ssize_t notrace sth_stm_packet(struct stm_data *st= m_data, struct sth_device *sth =3D container_of(stm_data, struct sth_device, stm); struct intel_th_channel __iomem *out =3D sth_channel(sth, master, channel); - u64 __iomem *outp =3D &out->Dn; unsigned long reg =3D REG_STH_TRIG; + u64 __iomem *outp; =20 #ifndef CONFIG_64BIT if (size > 4) --=20 2.43.0 From nobody Fri Dec 19 01:09:20 2025 Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.19]) (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 343506EB6F for ; Mon, 29 Apr 2024 12:09:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.19 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714392572; cv=none; b=GAIFKwQ/cwz5OEkNU+aNLmak9Y5DVi+WCw3ampbI93cQqRaerZJwjGrGUKf69BOKVPtWJG2D2eVw2dTTlIZwfJSHjbmxWltsfIrep/2qxOmDZQkZM06krqp+YI828e8K2irrzPnAxgie+zm/YG+nU/KdzYoB0kgz0eVH7dmBZKA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714392572; c=relaxed/simple; bh=J9FY2ipo2lxecD7Za9X7g2Z+V+7tNAF/Om/EeWGmizU=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=WXRaU+M7+idtNEvTqaw76EzFfh2SEf4rQERQ6DtbzVXGjDDHGEGhxg4bk3sSJrz4YrMfgHUCrab0ULK8vv1JtPiR0jt9PNWAetBR1w4f77qrrWZDL1XqFEq5ZXz/9xiuKhjSEC/zZrdp4ZYcR62FzXh54ifvicCAyQ2mMtU6DCw= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com; spf=none smtp.mailfrom=linux.intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=khJtnEAt; arc=none smtp.client-ip=198.175.65.19 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=none 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="khJtnEAt" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1714392572; x=1745928572; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=J9FY2ipo2lxecD7Za9X7g2Z+V+7tNAF/Om/EeWGmizU=; b=khJtnEAtHthfl/3lkymHwvT513Z5nnCeo5cG0cOzu7CDDbbke86GhGzy +g8Ass/Qy1ezwWiN/7fDyFHKhSO12WKca+6j9qZa6tu6qb4D/oFrNI7vk KYV1x6EuvA6cj2eLAgsChmX/7Zk2tCgnxv5j+h/NEB7bkoFIUUKafi3Xd J7n1SOs0l61DfdOtyerLFXr3BkkS5JAOVWTgsiu9VFmRrv+HoOYQ5c0vm 9pDHLrm+A7r+NGIUOvBT8f5I0K7bEVqP33y1BZhYMxzT7f34P7ZvmHyLt KuBRzafuEyz402AdcLy1KqySvpsgQs3azSAxaxTuZc71o6+OTWDhVwMiQ g==; X-CSE-ConnectionGUID: OEYvmlmbRtCGK+WImS+tpQ== X-CSE-MsgGUID: lmeugz1hSaWFR77UpljEeA== X-IronPort-AV: E=McAfee;i="6600,9927,11057"; a="9908267" X-IronPort-AV: E=Sophos;i="6.07,239,1708416000"; d="scan'208";a="9908267" Received: from fmviesa010.fm.intel.com ([10.60.135.150]) by orvoesa111.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 Apr 2024 05:09:31 -0700 X-CSE-ConnectionGUID: WchvvseIQnyeTacoQeFBfg== X-CSE-MsgGUID: 7Bes899vR0Syg//Bed5mTQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.07,239,1708416000"; d="scan'208";a="26166640" Received: from black.fi.intel.com (HELO black.fi.intel.com.) ([10.237.72.28]) by fmviesa010.fm.intel.com with ESMTP; 29 Apr 2024 05:09:29 -0700 From: Alexander Shishkin To: Greg Kroah-Hartman Cc: linux-kernel@vger.kernel.org, Randy Dunlap , Alexander Shishkin , Andy Shevchenko Subject: [PATCH 08/14] intel_th: msu: Fix kernel-doc warnings Date: Mon, 29 Apr 2024 15:09:02 +0300 Message-ID: <20240429120908.3723458-9-alexander.shishkin@linux.intel.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240429120908.3723458-1-alexander.shishkin@linux.intel.com> References: <20240429120908.3723458-1-alexander.shishkin@linux.intel.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Randy Dunlap Correct function comments to prevent kernel-doc warnings found when using "W=3D1". msu.c:77: warning: Function parameter or member 'msc' not described in 'msc= _window' msu.c:122: warning: bad line: msu.c:760: warning: No description found for return value of 'msc_configure' msu.c:1309: warning: Function parameter or member 'nr_pages' not described = in 'msc_buffer_alloc' msu.c:1309: warning: Function parameter or member 'nr_wins' not described i= n 'msc_buffer_alloc' msu.c:1309: warning: Excess function parameter 'size' description in 'msc_b= uffer_alloc' msu.c:1376: warning: No description found for return value of 'msc_buffer_f= ree_unless_used' msu.c:1444: warning: No description found for return value of 'msc_win_to_u= ser' Signed-off-by: Randy Dunlap Signed-off-by: Alexander Shishkin Reviewed-by: Andy Shevchenko --- drivers/hwtracing/intel_th/msu.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/drivers/hwtracing/intel_th/msu.c b/drivers/hwtracing/intel_th/= msu.c index 9621efe0e95c..be63d5b8f193 100644 --- a/drivers/hwtracing/intel_th/msu.c +++ b/drivers/hwtracing/intel_th/msu.c @@ -61,6 +61,7 @@ enum lockout_state { * @lo_lock: lockout state serialization * @nr_blocks: number of blocks (pages) in this window * @nr_segs: number of segments in this window (<=3D @nr_blocks) + * @msc: pointer to the MSC device * @_sgt: array of block descriptors * @sgt: array of block descriptors */ @@ -119,7 +120,6 @@ struct msc_iter { * @user_count: number of users of the buffer * @mmap_count: number of mappings * @buf_mutex: mutex to serialize access to buffer-related bits - * @enabled: MSC is enabled * @wrap: wrapping is enabled * @mode: MSC operating mode @@ -755,6 +755,8 @@ static int msc_win_set_lockout(struct msc_window *win, * Program storage mode, wrapping, burst length and trace buffer address * into a given MSC. Then, enable tracing and set msc::enabled. * The latter is serialized on msc::buf_mutex, so make sure to hold it. + * + * Return: %0 for success or a negative error code otherwise. */ static int msc_configure(struct msc *msc) { @@ -1291,7 +1293,8 @@ static void msc_buffer_free(struct msc *msc) /** * msc_buffer_alloc() - allocate a buffer for MSC * @msc: MSC device - * @size: allocation size in bytes + * @nr_pages: number of pages for each window + * @nr_wins: number of windows * * Allocate a storage buffer for MSC, depending on the msc::mode, it will = be * either done via msc_buffer_contig_alloc() for SINGLE operation mode or @@ -1370,6 +1373,9 @@ static int msc_buffer_unlocked_free_unless_used(struc= t msc *msc) * @msc: MSC device * * This is a locked version of msc_buffer_unlocked_free_unless_used(). + * + * Return: 0 on successful deallocation or if there was no buffer to + * deallocate, -EBUSY if there are active users. */ static int msc_buffer_free_unless_used(struct msc *msc) { @@ -1438,6 +1444,8 @@ struct msc_win_to_user_struct { * @data: callback's private data * @src: source buffer * @len: amount of data to copy from the source buffer + * + * Return: >=3D %0 for success or -errno for error. */ static unsigned long msc_win_to_user(void *data, void *src, size_t len) { --=20 2.43.0 From nobody Fri Dec 19 01:09:20 2025 Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.19]) (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 1FFB77172F for ; Mon, 29 Apr 2024 12:09:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.19 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714392574; cv=none; b=qSYmSPGsxxjMvutqIIyhK+moW6SspaRo01mZJTqPjOUYbS6UtFT4eAAQYlcLNA/TrN+CJytlAFqLTEG4a9slUFgL6XSfELY6HPaUA7f/P8gELotmw3t4BWcRt7G5c+uzo2I9XRUhtd9TMW3N172pwceNiZyIQ2ttgqKANSmY2UI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714392574; c=relaxed/simple; bh=O/tPLmmDVxjWqjenqSekjhHbDwgCsVPjYLagOWXNRp4=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=r+8kA3Ox/ogIs4uhM48CbON6T4X8KBSB1dSEXahMcaVQqisuXtOACmOjZbi7Jo7emUpgL1McglAJXtzRILJUVvaTDRM2NUr3E/25Q66tcc9NZoQGGNA3JHUPwnPb6ieBNMySiQWHXyi+ATmMIE/W4tXex5SiL4Y0q9jblKU8bMU= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com; spf=none smtp.mailfrom=linux.intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=OI2NDMoK; arc=none smtp.client-ip=198.175.65.19 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=none 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="OI2NDMoK" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1714392574; x=1745928574; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=O/tPLmmDVxjWqjenqSekjhHbDwgCsVPjYLagOWXNRp4=; b=OI2NDMoKkW2DqsVryK0e9usaAIGA810T5XY1xo0dhBkyr1kMFKNdz3YC 5aRyxh1B7nS2rIoGY3DMhiSwDKg6kzVY+vRQF0C6D7KrPKy1/95a6Z0BQ d9gnTchLBMDUojcSfirTI8qnIvRAaEte8BgCOTZk0yCEFE4R5WG1uAxUf 254xom6frJ92LBZQ9wui/wO4f/Ue1tX0GFgtSfW+S+AXl81BaZX32sdSE NaUbOuqf1JhlXfCsw7LwLGdcaikCpjezZWBl/hZtx2DeEJPIellEQjTvw yNOK3s9cJRx25dIZ/BQbV9NDfbhSvNmYpE37wv7htTUl+srxeNBZGtG1i g==; X-CSE-ConnectionGUID: JS4nHBeLTM+hGkZKdZa68A== X-CSE-MsgGUID: 7ved6F7dRDexdhUahYbv+g== X-IronPort-AV: E=McAfee;i="6600,9927,11057"; a="9908273" X-IronPort-AV: E=Sophos;i="6.07,239,1708416000"; d="scan'208";a="9908273" Received: from fmviesa010.fm.intel.com ([10.60.135.150]) by orvoesa111.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 Apr 2024 05:09:33 -0700 X-CSE-ConnectionGUID: C047f2fIQheXzXzzLbaS3w== X-CSE-MsgGUID: dBOOQmHvRRahGC3vX9h26w== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.07,239,1708416000"; d="scan'208";a="26166644" Received: from black.fi.intel.com (HELO black.fi.intel.com.) ([10.237.72.28]) by fmviesa010.fm.intel.com with ESMTP; 29 Apr 2024 05:09:31 -0700 From: Alexander Shishkin To: Greg Kroah-Hartman Cc: linux-kernel@vger.kernel.org, Alexander Shishkin , Andy Shevchenko , stable@kernel.org Subject: [PATCH 09/14] intel_th: pci: Add Granite Rapids support Date: Mon, 29 Apr 2024 15:09:03 +0300 Message-ID: <20240429120908.3723458-10-alexander.shishkin@linux.intel.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240429120908.3723458-1-alexander.shishkin@linux.intel.com> References: <20240429120908.3723458-1-alexander.shishkin@linux.intel.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Add support for the Trace Hub in Granite Rapids. Signed-off-by: Alexander Shishkin Reviewed-by: Andy Shevchenko Cc: stable@kernel.org --- drivers/hwtracing/intel_th/pci.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/hwtracing/intel_th/pci.c b/drivers/hwtracing/intel_th/= pci.c index 147d338c191e..beb4b2766aae 100644 --- a/drivers/hwtracing/intel_th/pci.c +++ b/drivers/hwtracing/intel_th/pci.c @@ -299,6 +299,11 @@ static const struct pci_device_id intel_th_pci_id_tabl= e[] =3D { PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0xa76f), .driver_data =3D (kernel_ulong_t)&intel_th_2x, }, + { + /* Granite Rapids */ + PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0x0963), + .driver_data =3D (kernel_ulong_t)&intel_th_2x, + }, { /* Alder Lake CPU */ PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0x466f), --=20 2.43.0 From nobody Fri Dec 19 01:09:20 2025 Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.19]) (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 7822673534 for ; Mon, 29 Apr 2024 12:09:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.19 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714392575; cv=none; b=G12bOmINiDFK90XxhK7juR4sTizKL/K7NxXLyka/ttHIb6hK1YQNnW1Jy03CIXeoW8wDio5VuTpQ0+wqCzCwinQmjTTFPYl3gz0H6BHy6O3kovNKJimpToBGE1rsVWzElfZ8mGcFpQ4G6G0T3dgqBJwB4gel2sl87y+bNXIQdr8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714392575; c=relaxed/simple; bh=bxIRmwYGyryCI32YPKm+QfLssD8VLAYd6uQrJuFO2ko=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=FYP7tiy1/FqAL9Hwk58F+zbjj7xSLAyazkjGVYVwFVEdVX11lpchyKdvJesefrGSFtQESlgFJugPKVb7UMTjpZUTppt7R+/epvDEOYZxqIOf9BYdb70JwpffOtONboKQzWO37I+W/wuvJX4rhw4tUDFt5IcIplsn6gfl+yAKTTc= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com; spf=none smtp.mailfrom=linux.intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=BMCC97gD; arc=none smtp.client-ip=198.175.65.19 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=none 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="BMCC97gD" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1714392575; x=1745928575; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=bxIRmwYGyryCI32YPKm+QfLssD8VLAYd6uQrJuFO2ko=; b=BMCC97gDu6JA5CYff6r/tcMbJyUDvorQOpSIgx8ehqfK01ipZKTjqMV5 yGEL5Zh7Mm+FL/+UwnrP7obYIzIXgOEcIFVO0TJ28/aUGretHYnuUT7fS /LiqjrdBfSnhknaRKC6Gr+BXq8eI6j/cjYj1s2e7naG/RSc/w5bVgRPvS DS0mK7HQTguKoPaAa/gHD7eSmgKjdmGN2ebQpFlUtR6pX0SUTbYUqtsoE 8zB+InYTmwm7BT/aPvRcqe8dbZzJ59C1KwVL9OilPTOQNCYWTY9tVhMRC YNX99WkkAiGtVhDgsonaJqHGqw+ErfZxSwpMtrZHovqrgbeALIHWi8m95 Q==; X-CSE-ConnectionGUID: d+Ac1TDTSXaclN2nVGbtAQ== X-CSE-MsgGUID: FaN42iaET+W/xbTdcGdl2A== X-IronPort-AV: E=McAfee;i="6600,9927,11057"; a="9908277" X-IronPort-AV: E=Sophos;i="6.07,239,1708416000"; d="scan'208";a="9908277" Received: from fmviesa010.fm.intel.com ([10.60.135.150]) by orvoesa111.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 Apr 2024 05:09:35 -0700 X-CSE-ConnectionGUID: cKegIMa7TGyKiQJM0zOFYw== X-CSE-MsgGUID: 8+ROLR8KRjm1V9rtqHEcNA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.07,239,1708416000"; d="scan'208";a="26166649" Received: from black.fi.intel.com (HELO black.fi.intel.com.) ([10.237.72.28]) by fmviesa010.fm.intel.com with ESMTP; 29 Apr 2024 05:09:32 -0700 From: Alexander Shishkin To: Greg Kroah-Hartman Cc: linux-kernel@vger.kernel.org, Alexander Shishkin , Andy Shevchenko , stable@kernel.org Subject: [PATCH 10/14] intel_th: pci: Add Granite Rapids SOC support Date: Mon, 29 Apr 2024 15:09:04 +0300 Message-ID: <20240429120908.3723458-11-alexander.shishkin@linux.intel.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240429120908.3723458-1-alexander.shishkin@linux.intel.com> References: <20240429120908.3723458-1-alexander.shishkin@linux.intel.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Add support for the Trace Hub in Granite Rapids SOC. Signed-off-by: Alexander Shishkin Reviewed-by: Andy Shevchenko Cc: stable@kernel.org --- drivers/hwtracing/intel_th/pci.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/hwtracing/intel_th/pci.c b/drivers/hwtracing/intel_th/= pci.c index beb4b2766aae..44c08db253d8 100644 --- a/drivers/hwtracing/intel_th/pci.c +++ b/drivers/hwtracing/intel_th/pci.c @@ -304,6 +304,11 @@ static const struct pci_device_id intel_th_pci_id_tabl= e[] =3D { PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0x0963), .driver_data =3D (kernel_ulong_t)&intel_th_2x, }, + { + /* Granite Rapids SOC */ + PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0x3256), + .driver_data =3D (kernel_ulong_t)&intel_th_2x, + }, { /* Alder Lake CPU */ PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0x466f), --=20 2.43.0 From nobody Fri Dec 19 01:09:20 2025 Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.19]) (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 795F3745E5 for ; Mon, 29 Apr 2024 12:09:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.19 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714392577; cv=none; b=KOwlcjeN33aAGFP4izzK59/wKMZ9U9llIsySBK5Gnl9Szr908fJzRsmBhk7Caeq2BfhJA8PAyDK5BQTMHY+/AuD7MTwFn1YoO6eeKPyGtri2IYHpdKIGmS0mEgpYua8MBXCAR/puSc8r9qfOGeyTrKeNgwtdVuO4ikljeiTyZOI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714392577; c=relaxed/simple; bh=wLYBlxedLAthkJZqqlPpyzb7ig9rN7jLeqrZ6Jbe1HE=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=g8bwQ+F2BSCnB0WvRgRA8jt1s19MqCg2XuQdJmkUqzxNB4lukZLZctET+UqYCQuRJ5miEEr6YssL3gEKt7QBZ27I3yX/gO3tB37yrOZhXFyyeCohos1xYtHUZ/bAOLTq8tvaXzjUg0MmNN9w1fFLMMAiah0rwitNn3ok3QqxgKk= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com; spf=none smtp.mailfrom=linux.intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=LgLsbs3E; arc=none smtp.client-ip=198.175.65.19 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=none 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="LgLsbs3E" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1714392577; x=1745928577; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=wLYBlxedLAthkJZqqlPpyzb7ig9rN7jLeqrZ6Jbe1HE=; b=LgLsbs3ENPu9nCm2pMP175SmwtRZ0TN3Ui2kLybsL3dWNxexmc7X4cwk Wnoza/rqGbgwnjt55eFgqMChLgRu/KOh1jBMChFuZtOpD3YSgzzSqL41u IYqDiuz65eo8QmQmw0bdu7HbtR5aGCz8zLzTRtFKCi9qihdpxp5LvxpDm conP5oI++fexV5Z5+is5cR7KLvntyyu7LlgcyNgzGi0T90d9MPPYsj66o g5DzvjLpWXmc7fvT1jCI8Sg+c36q/1QcuqqiwK659fKh3RIOVS+fAy9Rt zVQyZZxtDvkKDMqty3Fx/F5m2W2fCCczQOa/nZ1afFaD/bOk1PxBF1yib w==; X-CSE-ConnectionGUID: uFZ/3b7jROaYPTfN5pYcdQ== X-CSE-MsgGUID: JxzlNQv6S0m0Rmmomxczsw== X-IronPort-AV: E=McAfee;i="6600,9927,11057"; a="9908280" X-IronPort-AV: E=Sophos;i="6.07,239,1708416000"; d="scan'208";a="9908280" Received: from fmviesa010.fm.intel.com ([10.60.135.150]) by orvoesa111.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 Apr 2024 05:09:36 -0700 X-CSE-ConnectionGUID: DJReRyvzTOOiCTbAQMlVCA== X-CSE-MsgGUID: 4h4ZkCnqRBOPfZDmPc4H+A== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.07,239,1708416000"; d="scan'208";a="26166654" Received: from black.fi.intel.com (HELO black.fi.intel.com.) ([10.237.72.28]) by fmviesa010.fm.intel.com with ESMTP; 29 Apr 2024 05:09:34 -0700 From: Alexander Shishkin To: Greg Kroah-Hartman Cc: linux-kernel@vger.kernel.org, Alexander Shishkin , Andy Shevchenko , stable@kernel.org Subject: [PATCH 11/14] intel_th: pci: Add Sapphire Rapids SOC support Date: Mon, 29 Apr 2024 15:09:05 +0300 Message-ID: <20240429120908.3723458-12-alexander.shishkin@linux.intel.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240429120908.3723458-1-alexander.shishkin@linux.intel.com> References: <20240429120908.3723458-1-alexander.shishkin@linux.intel.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Add support for the Trace Hub in Sapphire Rapids SOC. Signed-off-by: Alexander Shishkin Reviewed-by: Andy Shevchenko Cc: stable@kernel.org --- drivers/hwtracing/intel_th/pci.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/hwtracing/intel_th/pci.c b/drivers/hwtracing/intel_th/= pci.c index 44c08db253d8..08c956fb4995 100644 --- a/drivers/hwtracing/intel_th/pci.c +++ b/drivers/hwtracing/intel_th/pci.c @@ -309,6 +309,11 @@ static const struct pci_device_id intel_th_pci_id_tabl= e[] =3D { PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0x3256), .driver_data =3D (kernel_ulong_t)&intel_th_2x, }, + { + /* Sapphire Rapids SOC */ + PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0x3456), + .driver_data =3D (kernel_ulong_t)&intel_th_2x, + }, { /* Alder Lake CPU */ PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0x466f), --=20 2.43.0 From nobody Fri Dec 19 01:09:20 2025 Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.19]) (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 C7E8574C07 for ; Mon, 29 Apr 2024 12:09:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.19 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714392579; cv=none; b=WXR86EpevLicWfJqsbwF+UESylnqSx16WyBe8VpUhrYgvSdmImwtAhk5DQcl2m75LTY1YyLxuxNNhTBf9aNHL47sL7aqr1D1ZZcZX2u/l4rUHgzfUmzlqQIj64XYB9E84NghaM9MSDSQiaj9CsUqEBhNTYnm2e+K1BrJiOUIKHE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714392579; c=relaxed/simple; bh=6oEQ8SmB24y33MxFtl+D/rMkW5uAGu9qGTWbUveLuYk=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=pqDoHhbbZUijIQL5Q3xRo2IOQ9i7bBZskJ/Yixz12Fh+52YXLnFmzyp7XSe8P59iHNc8e1MbU125SBxbyJSAMNlR6/+NDSC2UtfzvL98mTi1F6Jeg3Lf4DoaQrgtZNLCRPDVXuOcetYRegfS/ZW52ig0RRS3d7ElUtlBMgkeexM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com; spf=none smtp.mailfrom=linux.intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=fqAKCN0e; arc=none smtp.client-ip=198.175.65.19 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=none 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="fqAKCN0e" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1714392578; x=1745928578; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=6oEQ8SmB24y33MxFtl+D/rMkW5uAGu9qGTWbUveLuYk=; b=fqAKCN0etbtcUrCg7LnJqAJTnunHAHdUx1vzYCxJ0qn2A6RjQdsDQAFf j5NKkXdCD/Owe52/AfnOcFznL4L6s5eDSGJKxL1hK4cK7brGqu0JDCYQU D87cMRKx2R+FIslqa7gJHpew2HWLQTC/zyLDx+rsw/K2k255d11Y5snjt FVkBwMFaU1uZVYqTj1FKUAzP3iA2g1lg0v8D71EwGzfumjmP9McSKyUyh 1ZWnR+Zqk89G6YZUMYNK8DeTrynUoZ0BKzDHecsHWSBkOffdxHx2WsKg1 wOKGe/+04l/PeeAoaFkDYQeorFKohhA31OTs7Ya9Tg6OVfJqPR9+CYd+o g==; X-CSE-ConnectionGUID: kHiAWewdQ+i8J4qSANSgrA== X-CSE-MsgGUID: Rp/VGpBTR1ad43a1trSGyg== X-IronPort-AV: E=McAfee;i="6600,9927,11057"; a="9908283" X-IronPort-AV: E=Sophos;i="6.07,239,1708416000"; d="scan'208";a="9908283" Received: from fmviesa010.fm.intel.com ([10.60.135.150]) by orvoesa111.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 Apr 2024 05:09:38 -0700 X-CSE-ConnectionGUID: +fqvG9R1Rmus9DGVjPtRQw== X-CSE-MsgGUID: slNfCorNR06f6euAjbpI4A== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.07,239,1708416000"; d="scan'208";a="26166660" Received: from black.fi.intel.com (HELO black.fi.intel.com.) ([10.237.72.28]) by fmviesa010.fm.intel.com with ESMTP; 29 Apr 2024 05:09:36 -0700 From: Alexander Shishkin To: Greg Kroah-Hartman Cc: linux-kernel@vger.kernel.org, Alexander Shishkin , Andy Shevchenko , stable@kernel.org Subject: [PATCH 12/14] intel_th: pci: Add Meteor Lake-S support Date: Mon, 29 Apr 2024 15:09:06 +0300 Message-ID: <20240429120908.3723458-13-alexander.shishkin@linux.intel.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240429120908.3723458-1-alexander.shishkin@linux.intel.com> References: <20240429120908.3723458-1-alexander.shishkin@linux.intel.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Add support for the Trace Hub in Meteor Lake-S. Signed-off-by: Alexander Shishkin Reviewed-by: Andy Shevchenko Cc: stable@kernel.org --- drivers/hwtracing/intel_th/pci.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/hwtracing/intel_th/pci.c b/drivers/hwtracing/intel_th/= pci.c index 08c956fb4995..7bb50d414027 100644 --- a/drivers/hwtracing/intel_th/pci.c +++ b/drivers/hwtracing/intel_th/pci.c @@ -289,6 +289,11 @@ static const struct pci_device_id intel_th_pci_id_tabl= e[] =3D { PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0x7e24), .driver_data =3D (kernel_ulong_t)&intel_th_2x, }, + { + /* Meteor Lake-S */ + PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0x7f26), + .driver_data =3D (kernel_ulong_t)&intel_th_2x, + }, { /* Raptor Lake-S */ PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0x7a26), --=20 2.43.0 From nobody Fri Dec 19 01:09:20 2025 Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.19]) (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 7D984762DE for ; Mon, 29 Apr 2024 12:09:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.19 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714392580; cv=none; b=bvPPWKnAy5iLw1TsxSA9MIIIwkbm5R6HGRPmGb+Lkd82eDW8O38sekTtdSFkN3us6YCQO0ZS7rL99CLHT3C/CbrFR1ZkXlB4w7xNEV0ZTvktseHsELgBaO2WgtS7k1RONsVmDBR4wxtATSnMmNSBVX8df6AYIoiEmtDdYt7ndLU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714392580; c=relaxed/simple; bh=4mjB5jRD2LZdYg+WgATpyA8orwgL1dsnFryoaxKiQOw=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=HUOpW5ckTFgwNR4fcdN+5MRlQcuQb2oox/jIMSqpBn3Sx1dow2SdA6MPIc+Gp4pPQYcINVzUK+wQj6baI1wsbxcUVQq2hb5CKjH2TFBVxw5kPV8Vbz7Ykenks7+vYrX5Q2qXkELyqZQxRyUDuLY4BauoZGCgkK8AxluUt/7qpbU= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com; spf=none smtp.mailfrom=linux.intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=Zat8eIaF; arc=none smtp.client-ip=198.175.65.19 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=none 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="Zat8eIaF" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1714392580; x=1745928580; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=4mjB5jRD2LZdYg+WgATpyA8orwgL1dsnFryoaxKiQOw=; b=Zat8eIaFTGcBmM+fxqNZRvJ634Aza34jgb2/8q+fVhkRT49ozMLAlJ8y yphc0oX1MpuGOYqZwgPXN7XtdjR3WLGIwX1w6z2gj5gMdhB3HNs+8/Hqo gileqH8Ps/JYf2JeWoM4ahFTX6Y/9xOby7BdLylYdDW2bZNn/T1wvl0VD DzETL0ZoUSjAKz+jZ7iayKusPqA2/rFxNv5KX5u2BhKj67M4bQET/HAYd capZyfB0dr2h8LSkVxTMv60coE7Fvh1I8YMM3LukYy0RRapIOHwi42WZU /XlHxO5vJ6yvst0xKEBSU/5o22iHzY6JdQyMi+2SA0kCQimA9FpvcMErU A==; X-CSE-ConnectionGUID: JiYb3dvhSgi87nObjrBBiA== X-CSE-MsgGUID: RVqhXVepR7KjJtZ79IJMfA== X-IronPort-AV: E=McAfee;i="6600,9927,11057"; a="9908286" X-IronPort-AV: E=Sophos;i="6.07,239,1708416000"; d="scan'208";a="9908286" Received: from fmviesa010.fm.intel.com ([10.60.135.150]) by orvoesa111.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 Apr 2024 05:09:40 -0700 X-CSE-ConnectionGUID: bOcKuZJhTXKaZsjDJZIgrA== X-CSE-MsgGUID: 3gLlW+INTwmiGs0yEJgsjw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.07,239,1708416000"; d="scan'208";a="26166663" Received: from black.fi.intel.com (HELO black.fi.intel.com.) ([10.237.72.28]) by fmviesa010.fm.intel.com with ESMTP; 29 Apr 2024 05:09:38 -0700 From: Alexander Shishkin To: Greg Kroah-Hartman Cc: linux-kernel@vger.kernel.org, Alexander Shishkin , Andy Shevchenko , stable@kernel.org Subject: [PATCH 13/14] intel_th: pci: Add Meteor Lake-S CPU support Date: Mon, 29 Apr 2024 15:09:07 +0300 Message-ID: <20240429120908.3723458-14-alexander.shishkin@linux.intel.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240429120908.3723458-1-alexander.shishkin@linux.intel.com> References: <20240429120908.3723458-1-alexander.shishkin@linux.intel.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Add support for the Trace Hub in Meteor Lake-S CPU. Signed-off-by: Alexander Shishkin Reviewed-by: Andy Shevchenko Cc: stable@kernel.org --- drivers/hwtracing/intel_th/pci.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/hwtracing/intel_th/pci.c b/drivers/hwtracing/intel_th/= pci.c index 7bb50d414027..0db8ff9b1c48 100644 --- a/drivers/hwtracing/intel_th/pci.c +++ b/drivers/hwtracing/intel_th/pci.c @@ -294,6 +294,11 @@ static const struct pci_device_id intel_th_pci_id_tabl= e[] =3D { PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0x7f26), .driver_data =3D (kernel_ulong_t)&intel_th_2x, }, + { + /* Meteor Lake-S CPU */ + PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0xae24), + .driver_data =3D (kernel_ulong_t)&intel_th_2x, + }, { /* Raptor Lake-S */ PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0x7a26), --=20 2.43.0 From nobody Fri Dec 19 01:09:20 2025 Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.19]) (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 30F157BAF0 for ; Mon, 29 Apr 2024 12:09:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.19 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714392582; cv=none; b=Uiu/HaYxqThi/YpI6OD8e3WDupM8Lam4cuuUooUmT9Dq8Llule0/p3m5XIWvHiB19dVHe5y/c74ZWrejBf3Gp1MNG5It15X41AZssfEXfQTM2m8crNEpqcGQsuqD6y+P99xZjuLPxNBU3wDcSyTN9SGofcu+h3H/kzUSfjyz5lg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714392582; c=relaxed/simple; bh=XHEQAft4tZaQ2JdNqTSsJ60xy1/uNy4H7i3u5WPmZVk=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=h+kfgVEWnqCRkf6UgfIlzz0QTlKwZXlNEMpf6gkFYQaZG/GUN6jpiicUHGDtb2XieAQti7kQ6c+5mQtUkVYKY/73eBv5Z7lYI3OZlJfqMv+0o/+FzMu681fScj+BCbBHJzqPR53qu1aGzF3DwpHTNRPIeqr0y5JjsdubqGPysU4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com; spf=none smtp.mailfrom=linux.intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=LX6crxyU; arc=none smtp.client-ip=198.175.65.19 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=none 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="LX6crxyU" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1714392582; x=1745928582; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=XHEQAft4tZaQ2JdNqTSsJ60xy1/uNy4H7i3u5WPmZVk=; b=LX6crxyUDHH60d1smChuQaPDWHvYwGqNVVEuYIdrHZX0U9j+dNmPD8d9 XFdVNy6NPN8QGm4VE7pXhFd/0g7KxGY1vJZTW5EVjlmHDHaInXqBWQD1m MTreowtuRM87/Ot4UiusJMtYn7Sals5ZFvLeQX/ebNASc5PvlqzJN5ZWu GlmzPzJ9SytyFd+94c/LQ3mVCyPbuhn09OJu51FsFqTvTVN/6BFst584o 6Og9XHMVdSgRazAJ1E9p6m/T1rtlZN+RPlHLteStAOKiqLPJ4njS6CgFN 2QSqGK6ryMS4JFz5qD/c+Y5o/5lFb18+0g1fdHfBJQNdZuAmStg0rWH61 g==; X-CSE-ConnectionGUID: QJdr9GNZSkeytM+7yWo9OA== X-CSE-MsgGUID: FmOOn1M+ThaIIoOPedxtnw== X-IronPort-AV: E=McAfee;i="6600,9927,11057"; a="9908290" X-IronPort-AV: E=Sophos;i="6.07,239,1708416000"; d="scan'208";a="9908290" Received: from fmviesa010.fm.intel.com ([10.60.135.150]) by orvoesa111.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 Apr 2024 05:09:41 -0700 X-CSE-ConnectionGUID: PJE1vwbLRg6Jcp8QmDf5LA== X-CSE-MsgGUID: Dw/naGPRSFCY9zv9oRLF0A== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.07,239,1708416000"; d="scan'208";a="26166667" Received: from black.fi.intel.com (HELO black.fi.intel.com.) ([10.237.72.28]) by fmviesa010.fm.intel.com with ESMTP; 29 Apr 2024 05:09:39 -0700 From: Alexander Shishkin To: Greg Kroah-Hartman Cc: linux-kernel@vger.kernel.org, Alexander Shishkin , Andy Shevchenko , stable@kernel.org Subject: [PATCH 14/14] intel_th: pci: Add Lunar Lake support Date: Mon, 29 Apr 2024 15:09:08 +0300 Message-ID: <20240429120908.3723458-15-alexander.shishkin@linux.intel.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240429120908.3723458-1-alexander.shishkin@linux.intel.com> References: <20240429120908.3723458-1-alexander.shishkin@linux.intel.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Add support for the Trace Hub in Lunar Lake. Signed-off-by: Alexander Shishkin Reviewed-by: Andy Shevchenko Cc: stable@kernel.org --- drivers/hwtracing/intel_th/pci.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/hwtracing/intel_th/pci.c b/drivers/hwtracing/intel_th/= pci.c index 0db8ff9b1c48..0d7b9839e5b6 100644 --- a/drivers/hwtracing/intel_th/pci.c +++ b/drivers/hwtracing/intel_th/pci.c @@ -324,6 +324,11 @@ static const struct pci_device_id intel_th_pci_id_tabl= e[] =3D { PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0x3456), .driver_data =3D (kernel_ulong_t)&intel_th_2x, }, + { + /* Lunar Lake */ + PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0xa824), + .driver_data =3D (kernel_ulong_t)&intel_th_2x, + }, { /* Alder Lake CPU */ PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0x466f), --=20 2.43.0