From nobody Fri Dec 19 02:49:52 2025 Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.13]) (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 2E1185338A for ; Mon, 29 Apr 2024 13:01:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.13 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714395711; cv=none; b=UoJNzPup2dtAtoaVqK36X1cWqfIinqeR2isJ5hOEiDpqbictsmn2HsRjzix7glC7qzyGOiXgciK+KyZS7QUEy5aReT3ol+tLW41IEhAVXDJ3a24dQ8L6SmayXRSy5et1BqstAxKjGNk70kWZP2zxZVK52p0GB31pnYc/iflnvkU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714395711; c=relaxed/simple; bh=kZea8gg6v2oPK+AP92ObeW+V0830/M7URcyFuYoYhaU=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=VN/g2YPDrh15HZCtqENgT0JlUA6bRIy3K3+qenngEb/xRC0RrzBzDgy29Bj1m2ibYyaAuQQ8BPjd4WsDaOsCR2GYupYBOghz/a8a66hlXYK7rMDQqhRKp/Bn00NTE/ZVR9OdAewH4DgEttQ/4RDWE/GdBuIqUNLkj4liccljBy8= 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=IyiM95L4; arc=none smtp.client-ip=192.198.163.13 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="IyiM95L4" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1714395710; x=1745931710; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=kZea8gg6v2oPK+AP92ObeW+V0830/M7URcyFuYoYhaU=; b=IyiM95L417pBwaVDEfcPFGZu0srsngPiQCuX4vO6MCB5Gf4twaZ+Jo5X bwe8EIDNzyEspO3ZMMVBg3pS596cfeLOcGLkBQvtzLiP3ki2fibx2Twss AD9IWzsb2l2Wj7UlULvtgYuevt9Y7ezSpDxKrjow3A64r/bob+7SUiVUu t/8F0hXyWUQ1dvEc2+A6ky9mHfkMK0pOTGXuuenGovfVEJ74cOjYwj7Cx S3Jg10fOmIPyD0UKKeUa+xTa1hDwr9JMUk1IKDf9mfJ4tTKFoveGT3wW2 +Ot89/p62GFUvDDZriwWmoMlubw/46G/7tjc4x3CXYtJz6wd1uxvnl9+1 A==; X-CSE-ConnectionGUID: cCWRkA4mRGe/3M+ba0+sWQ== X-CSE-MsgGUID: /p4Df2F9QTi8KbLtkIUoVw== X-IronPort-AV: E=McAfee;i="6600,9927,11057"; a="12986813" X-IronPort-AV: E=Sophos;i="6.07,239,1708416000"; d="scan'208";a="12986813" Received: from orviesa006.jf.intel.com ([10.64.159.146]) by fmvoesa107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 Apr 2024 06:01:45 -0700 X-CSE-ConnectionGUID: wwstNud9TFKdbhvToRJzjw== X-CSE-MsgGUID: MGY5mLirQrWP03Yest6uLA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.07,239,1708416000"; d="scan'208";a="26507044" Received: from black.fi.intel.com (HELO black.fi.intel.com.) ([10.237.72.28]) by orviesa006.jf.intel.com with ESMTP; 29 Apr 2024 06:01:42 -0700 From: Alexander Shishkin To: Greg Kroah-Hartman Cc: linux-kernel@vger.kernel.org, Dan Carpenter , Amelie Delaunay , Andy Shevchenko , Alexander Shishkin Subject: [PATCH v1 01/15] stm class: Fix a double free in stm_register_device() Date: Mon, 29 Apr 2024 16:01:05 +0300 Message-ID: <20240429130119.1518073-2-alexander.shishkin@linux.intel.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240429130119.1518073-1-alexander.shishkin@linux.intel.com> References: <20240429130119.1518073-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 02:49:52 2025 Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.13]) (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 98E91548EC for ; Mon, 29 Apr 2024 13:01:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.13 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714395712; cv=none; b=tpcBRsrZrHUiaw8F4gG5cnZZG4TWyKQNojkj60Qg8g5GRS+KSURUcNzlVBHqgLgBOTgr/q3OlxT2IPauTnIMqhFNDry0f+XsobaiVn5o2Uiah+CpzwGLHqeP3VmflFoGr4bRfk3RqO1zLeN22wcG+KSu/hb8TZ12JwxAFNpuxrg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714395712; c=relaxed/simple; bh=ni7xzfycKKP1MKVU8EmsUqb3361Wz7LPiZp+v1kH+eQ=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=WbMCserUmiOkFQH1BPO1gNsipYgnnf+auZ8oeqIf0drUyCN3cK+rYwbDfK242SSmMDmv6tJSKsgJSiUUl2AT8IjqwrvRe/BkWIfKwQ2kz3Nn7dtfM2xiuxIgl/9FUmuHzbZdLzGYhY6I3TdGqDX6P1je7Lj+hppGZ6VB13rcwWU= 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=UhwHTv+9; arc=none smtp.client-ip=192.198.163.13 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="UhwHTv+9" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1714395710; x=1745931710; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=ni7xzfycKKP1MKVU8EmsUqb3361Wz7LPiZp+v1kH+eQ=; b=UhwHTv+9n1lwLNWv8Hi/hPP/DOoYOGnrE1d5jOHDJkhetgA72ukdvFAK lJJoUbsucfa4Dgg72DCXw3dxs8/15KKrvSPPOuXZV+jvuSo3b916A8MI+ kW3oHd8l1DLPyjiGZf+6jHR0Ieemad7mU2eGFadPx87VaXfLtntfmCjW9 h+LCW+1sCoobLIa5SrkVuf1P4Xnw7iBsFN1EDf3S1/zEnwaEDOOidWL4B ifgvZlfyTkRWBr4dw0Q/qAI4dPfmkcYklaVpkC/1zijVsgvZrzmTmcZsW po/tTp9ifS7U2VQqeCANvledLz5N809yPXxMTG8UNiPi0GvSerIMopNE2 Q==; X-CSE-ConnectionGUID: 5LXlqQFCSvOUYEJmIygpMQ== X-CSE-MsgGUID: F4+BIsicSUqweMq/YjWdhQ== X-IronPort-AV: E=McAfee;i="6600,9927,11057"; a="12986822" X-IronPort-AV: E=Sophos;i="6.07,239,1708416000"; d="scan'208";a="12986822" Received: from orviesa006.jf.intel.com ([10.64.159.146]) by fmvoesa107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 Apr 2024 06:01:47 -0700 X-CSE-ConnectionGUID: SfmXNeZdR3qCnAqorRUrSg== X-CSE-MsgGUID: LT5mhXZUT2ejWhJyjUkkbQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.07,239,1708416000"; d="scan'208";a="26507056" Received: from black.fi.intel.com (HELO black.fi.intel.com.) ([10.237.72.28]) by orviesa006.jf.intel.com with ESMTP; 29 Apr 2024 06:01:44 -0700 From: Alexander Shishkin To: Greg Kroah-Hartman Cc: linux-kernel@vger.kernel.org, Mikhail Lappo , Alexander Shishkin , Andy Shevchenko Subject: [PATCH v1 02/15] stm class: Add source type Date: Mon, 29 Apr 2024 16:01:06 +0300 Message-ID: <20240429130119.1518073-3-alexander.shishkin@linux.intel.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240429130119.1518073-1-alexander.shishkin@linux.intel.com> References: <20240429130119.1518073-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 02:49:52 2025 Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.13]) (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 11EE654907 for ; Mon, 29 Apr 2024 13:01:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.13 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714395712; cv=none; b=fmzLaHOygOgaInWGAH6ADljshlPyrEjEzXZPNv50V3prspRlTLHWM5R9BMFfs0e1W/uO0oF1s9VWDZfdjCL0BNJNiUvbeI2bPw4YQGN5v7yJ1gnD9uT2ahZQxVhzll0a4qDCYYV9AFDwbP0lDpy3xG6UjEV5BE9UK5W7QqmDIMY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714395712; c=relaxed/simple; bh=BmzzzNy0Qq0vMdNau1EvSHuLwokSd2AWKX8qj1/Jr6Q=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=TAvFNxug9Gw8igzRcpo5ioaogC34ZhmRS2ZdaiSX401yGTTEAfxs07ZRH0Qn5xb8zXRTrYd46Pyf8ztBaNUakG22ggb3vNJyOFy7rs4DbzQAEQ4lg/l87VV3kpsXdoQUx9afhHy5w3t2efYmt8S0wv34pp0X1hk6rVkTLfnV9dU= 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=VkaCtLaA; arc=none smtp.client-ip=192.198.163.13 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="VkaCtLaA" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1714395711; x=1745931711; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=BmzzzNy0Qq0vMdNau1EvSHuLwokSd2AWKX8qj1/Jr6Q=; b=VkaCtLaAeXk4lXRiHGm1icYAfolpwoKBYlXc1EVIWE1OXYEa8ypSpqAm tDoAk3M+6fGlzPsOmZKZza6br8YDZlvIJVCnbMOIs+iNWAwjApb1Sv5x9 THxA+IG+/MchH8FdgvzN5gzoV4Y595rQAc44QewK/wijCAXEITwYQ83uL dCjiPEMF7KCd+bBCuWRLTvXDWtrZp51KapT2ArHlRSdFGI8gVivoiR5jY J5WQ5NmW3pPBOQT/GyxLVJn5z45DfL/ieo1w7W7V4xN3oakWnDPielSeY ewDqV68ZzyFuEmn7LGti1ti4X6eCA0aUT9wZ/b2nHHHuPR67Q7HeWK7EB Q==; X-CSE-ConnectionGUID: UQ70tuntT3KopJtYJ+pHTw== X-CSE-MsgGUID: H/FBSiL5S2yE5aybOd9cSw== X-IronPort-AV: E=McAfee;i="6600,9927,11057"; a="12986828" X-IronPort-AV: E=Sophos;i="6.07,239,1708416000"; d="scan'208";a="12986828" Received: from orviesa006.jf.intel.com ([10.64.159.146]) by fmvoesa107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 Apr 2024 06:01:49 -0700 X-CSE-ConnectionGUID: 0ROJO89lSCi4s4Jjrgni5Q== X-CSE-MsgGUID: +sPx+m99S/OpvOyrYf4u+g== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.07,239,1708416000"; d="scan'208";a="26507060" Received: from black.fi.intel.com (HELO black.fi.intel.com.) ([10.237.72.28]) by orviesa006.jf.intel.com with ESMTP; 29 Apr 2024 06:01:46 -0700 From: Alexander Shishkin To: Greg Kroah-Hartman Cc: linux-kernel@vger.kernel.org, Mikhail Lappo , Alexander Shishkin , Andy Shevchenko Subject: [PATCH v1 03/15] stm class: Propagate source type to protocols Date: Mon, 29 Apr 2024 16:01:07 +0300 Message-ID: <20240429130119.1518073-4-alexander.shishkin@linux.intel.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240429130119.1518073-1-alexander.shishkin@linux.intel.com> References: <20240429130119.1518073-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 02:49:52 2025 Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.13]) (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 F0E0156B69 for ; Mon, 29 Apr 2024 13:01:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.13 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714395713; cv=none; b=acvNCYviNsfIAnXoeixZ3LWiyJ1HQ+Aa+gfbHBTNka6rkOZ7D3fe4mpvCvpnK1ILD6ALlkle9Ro65uDlrpmRAs2I76mWlvlHjXqLhJjmechdRIB6/PtzeKDGqCW6mCMZlDBlLsMlUqJmkMJBmsCPMOs4M8o2unZFi5RzS3t5S5g= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714395713; c=relaxed/simple; bh=h27EgWOLsss6t7NKo0NXSZGbrkKNJW9OOXO9eHyRHqY=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=cBp9F+JCON0KENNvVcAnY794+aPBxEDP0MAUdxyF48vWOeFcDE/s3ovOqJWSfu4Ou4lQtOQG3wN8y2iUFjuLUaOOAxs6hFBBCfIAPoY5eH1g02aPIodbvY51hhnUJSJ1+ahjFsQdLK1pmbdcSThEVpMIvg/bT5rl8eAQcCzsNQE= 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=UJ1/fQ5K; arc=none smtp.client-ip=192.198.163.13 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="UJ1/fQ5K" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1714395712; x=1745931712; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=h27EgWOLsss6t7NKo0NXSZGbrkKNJW9OOXO9eHyRHqY=; b=UJ1/fQ5KyMeYtQZH11BbEELTg4HZ58ATkfRrus579yPzifZ5k2jrTX5h SG94JkJjCO6hWrBjoCpbtyCxQ5XUyPwHr72DkLFBvn0CbUyKrrzZaQmSq TFO0BlG+McN9dGuZi/9kGGdqw71iy27vVzxPEZQEgJi3dNyU0tBlt5cpw 8apq3Ua+9t8BZgvhcbiEEsw3IRQTGFrAFd2Eat982djHzSaJ2J1NKFvM5 YhzG8JVjrRqtzC28+j471UNUkTuzd87YWl0sjoRqBQyFdHSw8bO2IgzG7 Tl12+ASELDnU22wQ/3lSa1EXASHXvxPv30cudzl60K0ohc/nIC1YEXIQa g==; X-CSE-ConnectionGUID: 94+dWof7SMmt/LwmRigsVg== X-CSE-MsgGUID: gC9jIFYZTS67DyJ0nlowfQ== X-IronPort-AV: E=McAfee;i="6600,9927,11057"; a="12986849" X-IronPort-AV: E=Sophos;i="6.07,239,1708416000"; d="scan'208";a="12986849" Received: from orviesa006.jf.intel.com ([10.64.159.146]) by fmvoesa107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 Apr 2024 06:01:51 -0700 X-CSE-ConnectionGUID: 3H4HBRWHSmmlaSRaeGNWLA== X-CSE-MsgGUID: 17gOKDBURu6647a9Spa7uw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.07,239,1708416000"; d="scan'208";a="26507066" Received: from black.fi.intel.com (HELO black.fi.intel.com.) ([10.237.72.28]) by orviesa006.jf.intel.com with ESMTP; 29 Apr 2024 06:01:48 -0700 From: Alexander Shishkin To: Greg Kroah-Hartman Cc: linux-kernel@vger.kernel.org, Mikhail Lappo , Alexander Shishkin , Andy Shevchenko Subject: [PATCH v1 04/15] stm class: sys-t: Improve ftrace source handling Date: Mon, 29 Apr 2024 16:01:08 +0300 Message-ID: <20240429130119.1518073-5-alexander.shishkin@linux.intel.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240429130119.1518073-1-alexander.shishkin@linux.intel.com> References: <20240429130119.1518073-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 02:49:52 2025 Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.13]) (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 980AB71727 for ; Mon, 29 Apr 2024 13:01:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.13 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714395714; cv=none; b=bjiHV7wB6SWlSHv7Slc1m+n7xgkPKzpUBhAbkSH47jlGmTi3q8+PA3P5vy6mzuvTZgTvBXdx28NvyaVTQGdF+4fm2s+DeDWPMcmY+WClyjTrx9Ytp8/eayr/M5SYRYu0Dj3bItmgc9VkNZM+f3MHtUByoyLdJvh1OFANJgxpF+g= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714395714; c=relaxed/simple; bh=dJCLkDppjN/Ufgt5KZBYseEOdz+RGtxNFrfVMP03WhQ=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=TvIADxKdRLuEMokPgOs1bgZSENX5bx4q3GomJ3Te/ETEq6hep7Jpr64Zy6JMfrlen7+mwHvo9umDpdObIfYeqD4ZA+rLAms3mGBPabeC2CxZGt6TVLjSBwF02a5Ijwzh6dUTgeL13NdPD2XW60cjEhOzJz2VWgluWXr8+o0y1Hs= 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=KHjDByE7; arc=none smtp.client-ip=192.198.163.13 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="KHjDByE7" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1714395713; x=1745931713; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=dJCLkDppjN/Ufgt5KZBYseEOdz+RGtxNFrfVMP03WhQ=; b=KHjDByE7IqfJQBWQ33d9l9uun5/ZYGSURBbokMq/DRAFAlkzAewbE9/A WBelsPXy9Wz/c77Zkdd9drBnNOcZubRVgOY/qhuu5Fskrg9Xcfb7yuGkS bbE9uVJwesu3uHhuPvvc5cTv/+xPxeVlSYi0qE9QJhSPobr/8Avv3QlVM Zo5FAZlt4O13Z/TXUWGcU43zfz0UxWdFZFPTswqg8VoTFhVW4qhcbnX94 XLCopaPv9KExqsj2IW72HnQQQVw2HA4w+/fI3OTLQtl661LAknZiWqJhX kUvcrcDTt5W3j0E/b4UQuIBXrqnRLSE3HfZkE0BKcVnKO3bFDtJ1UJpOI g==; X-CSE-ConnectionGUID: YwUr0g7zSQivOjPGbDbEDQ== X-CSE-MsgGUID: e0d1gDtFRCqwLp1Gf1nBiw== X-IronPort-AV: E=McAfee;i="6600,9927,11057"; a="12986864" X-IronPort-AV: E=Sophos;i="6.07,239,1708416000"; d="scan'208";a="12986864" Received: from orviesa006.jf.intel.com ([10.64.159.146]) by fmvoesa107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 Apr 2024 06:01:52 -0700 X-CSE-ConnectionGUID: t4bOZk+JQv6mUfldiznOwQ== X-CSE-MsgGUID: vVZa0E+nSnC+ZgJTtKNwRA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.07,239,1708416000"; d="scan'208";a="26507072" Received: from black.fi.intel.com (HELO black.fi.intel.com.) ([10.237.72.28]) by orviesa006.jf.intel.com with ESMTP; 29 Apr 2024 06:01:50 -0700 From: Alexander Shishkin To: Greg Kroah-Hartman Cc: linux-kernel@vger.kernel.org, =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= , Alexander Shishkin , Andy Shevchenko Subject: [PATCH v1 05/15] intel_th: Convert to platform remove callback returning void Date: Mon, 29 Apr 2024 16:01:09 +0300 Message-ID: <20240429130119.1518073-6-alexander.shishkin@linux.intel.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240429130119.1518073-1-alexander.shishkin@linux.intel.com> References: <20240429130119.1518073-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-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable From: Uwe Kleine-K=C3=B6nig The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new(), which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-K=C3=B6nig Signed-off-by: Alexander Shishkin Reviewed-by: Andy Shevchenko --- drivers/hwtracing/intel_th/acpi.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/hwtracing/intel_th/acpi.c b/drivers/hwtracing/intel_th= /acpi.c index 87f9024e4bbb..503620e9fd10 100644 --- a/drivers/hwtracing/intel_th/acpi.c +++ b/drivers/hwtracing/intel_th/acpi.c @@ -60,18 +60,16 @@ static int intel_th_acpi_probe(struct platform_device *= pdev) return 0; } =20 -static int intel_th_acpi_remove(struct platform_device *pdev) +static void intel_th_acpi_remove(struct platform_device *pdev) { struct intel_th *th =3D platform_get_drvdata(pdev); =20 intel_th_free(th); - - return 0; } =20 static struct platform_driver intel_th_acpi_driver =3D { .probe =3D intel_th_acpi_probe, - .remove =3D intel_th_acpi_remove, + .remove_new =3D intel_th_acpi_remove, .driver =3D { .name =3D DRIVER_NAME, .acpi_match_table =3D intel_th_acpi_ids, --=20 2.43.0 From nobody Fri Dec 19 02:49:52 2025 Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.13]) (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 019F3745FA for ; Mon, 29 Apr 2024 13:01:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.13 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714395716; cv=none; b=aeiIMe8MUk94gcu7OxwBthYx+cp4tfN++EksOLsGVbk330Ch9SlILY1GntSq6DuV2qS1Ry0AXrY5CEubHUDMd9Bxx9kSzepUpUUQL1k5ozHrhru2hNpZoM7sj8jMoiXzhmjisVDMbPpqgI/h30kGaWFPR8mLdu2wNQU9+XmmYtA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714395716; c=relaxed/simple; bh=DArV7j/szx7co+lsS5KqZv3unCNqezb1USQ5LCYCZyI=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=SxIwMYai4PbhHQ8w8ZecOw0AGTMby4XKVy1WtINzIaoq5Sq61v8NEc9TE0TPeOV182NxcSuapAgBskYyssYC6tMLHESBC5fDhiT9/En6gHk77bvjmbA7LFwNw7Ll2CI9V4OQdQQVG8NBbntWt6nW/TasibslwreZupJiBwzlci8= 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=GZs8e3ZS; arc=none smtp.client-ip=192.198.163.13 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="GZs8e3ZS" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1714395715; x=1745931715; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=DArV7j/szx7co+lsS5KqZv3unCNqezb1USQ5LCYCZyI=; b=GZs8e3ZSnJDAN2rzJSm15LblsPHdLcLtggo7FGjCnT7Zdhf4BaiaeOwg OBxf+QK1XYB+Vvf7FqT8yBgU1vLnx8K8JZHnGOHVajtpTy0JRNKi6UR3c 51kSfogjuREcib86SKD+tGOw2JYnOMs5JAIsn3xaapdJEJX1IpegbwAx2 NYLI+xsoVpzXnu6xRKYj9RCMhIuEo9pWuc1a2vgA9yuCoRZGwyc1+1oJV jjEus1izPt1iaX4RLN3GnIkNbFoCgYBn2hP3uZDMCYDLLmZHnS/21Wxhx 1+JZM9CCZnPixut/ah+5iIhwufmjzv6IuUsemoMYMwCURpjVX6MecHiwn Q==; X-CSE-ConnectionGUID: HaZVQfU3TJeRwQ+6GWm2Jw== X-CSE-MsgGUID: DXA0xUG6Qh+iIzAu1+XBwg== X-IronPort-AV: E=McAfee;i="6600,9927,11057"; a="12986879" X-IronPort-AV: E=Sophos;i="6.07,239,1708416000"; d="scan'208";a="12986879" Received: from orviesa006.jf.intel.com ([10.64.159.146]) by fmvoesa107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 Apr 2024 06:01:54 -0700 X-CSE-ConnectionGUID: 0rsYsUexRiqHGuF/23yvhA== X-CSE-MsgGUID: RpVeWMmaSU+2si/LYMdpng== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.07,239,1708416000"; d="scan'208";a="26507081" Received: from black.fi.intel.com (HELO black.fi.intel.com.) ([10.237.72.28]) by orviesa006.jf.intel.com with ESMTP; 29 Apr 2024 06:01:52 -0700 From: Alexander Shishkin To: Greg Kroah-Hartman Cc: linux-kernel@vger.kernel.org, "Ricardo B. Marliere" , Alexander Shishkin , Andy Shevchenko Subject: [PATCH v1 06/15] intel_th: Constify the struct device_type usage Date: Mon, 29 Apr 2024 16:01:10 +0300 Message-ID: <20240429130119.1518073-7-alexander.shishkin@linux.intel.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240429130119.1518073-1-alexander.shishkin@linux.intel.com> References: <20240429130119.1518073-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 02:49:52 2025 Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.13]) (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 31F57768EF for ; Mon, 29 Apr 2024 13:01:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.13 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714395718; cv=none; b=rrsmb1NqSw6ptjczGU2F3VPnlg36EBlrKnMObZ1nTNdygwQovl2XtFFYaNKwafVj6/Fm7Ck9phD/9ahAbSrhHIATxwv1XSInCA9K+GVUn9uZhnBvgz5Wn0S62cc2J0ysJH+cXVGTZ4f4pwC40amud3MlPBUwlB1AVLqT2/2lz/c= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714395718; c=relaxed/simple; bh=NfZcypoD1CZ34fuMUBVKQlaVjj4H35Y4xSOcxQL65lQ=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=cQXqB9nYqo2XYGdND0CcdUhyF/0Wa/+SPuLO4JxQMPVYXUPDppmubiSG5xonz8kyNN0VOZGx0P1NBKASrp+8VzlWwTTD8aqtYI0YBIWKmIho/dp6KMXeeaKR0JcQoCnO1Y/KY+oHFxm1W44+GjTS/e1xKO9FuFyLVkUDbmsX1/M= 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=O8apVw3Q; arc=none smtp.client-ip=192.198.163.13 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="O8apVw3Q" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1714395717; x=1745931717; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=NfZcypoD1CZ34fuMUBVKQlaVjj4H35Y4xSOcxQL65lQ=; b=O8apVw3Qo9RPJJm7sNr/5/0LJcvqtrSeDqdSG1zGlj+MueggdLOtyVvT medO8iZQ3PHgq9xf4niKorJEg7IsdX85M1ZhZrjJTzM+orKjs1nreB1aw 8sy7nmnfSH/kKYizWomERBTWaeSUCmEjgIkppvneqaNvFEpc4O0u8g5Bx A1SnxKKTE0L5cGz2zlEyHqSU0JbvYo3PNA65u0EZRb7ogVAyLw4ukq+Xb AocD1xSsCmAwGXGCzl80ElyDCV5B3TrLuQLI0XE3UvZW3k4onHK9s1u/y k7wGEy6gmL7VFUEzv4lsK/C3tTkeKQ0VKbol0RTG+hZXySzxQh+PRXk5P A==; X-CSE-ConnectionGUID: I8dmqWhWSCifDXvg2nGTIQ== X-CSE-MsgGUID: s2lWpEFGSJ2skGjfCFJ9fA== X-IronPort-AV: E=McAfee;i="6600,9927,11057"; a="12986892" X-IronPort-AV: E=Sophos;i="6.07,239,1708416000"; d="scan'208";a="12986892" Received: from orviesa006.jf.intel.com ([10.64.159.146]) by fmvoesa107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 Apr 2024 06:01:56 -0700 X-CSE-ConnectionGUID: xho7eiCgR3uwaHCBL6rwXQ== X-CSE-MsgGUID: ljapeiPYR+6ztpyeJkJ3EQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.07,239,1708416000"; d="scan'208";a="26507087" Received: from black.fi.intel.com (HELO black.fi.intel.com.) ([10.237.72.28]) by orviesa006.jf.intel.com with ESMTP; 29 Apr 2024 06:01:54 -0700 From: Alexander Shishkin To: Greg Kroah-Hartman Cc: linux-kernel@vger.kernel.org, Li Zhijian , Alexander Shishkin , Andy Shevchenko Subject: [PATCH v1 07/15] intel_th: Convert sprintf/snprintf to sysfs_emit Date: Mon, 29 Apr 2024 16:01:11 +0300 Message-ID: <20240429130119.1518073-8-alexander.shishkin@linux.intel.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240429130119.1518073-1-alexander.shishkin@linux.intel.com> References: <20240429130119.1518073-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 02:49:52 2025 Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.13]) (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 D40B17BAE3 for ; Mon, 29 Apr 2024 13:01:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.13 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714395720; cv=none; b=MCpT5op+uX5+Z8dM/BMNCCqBcrOTwghb/6LSU1muea0BT92Pa8uSWNStvUNGxpcs+7/aSLqyuUQiNO+eziqHLmjMSGP9NLGO8qUjUErxdC9cqLWrfRsZixu95KlOoWhj4UmAIibeF8Uoyf+PS97zYjK7pWTh/gZzpDX8p8i8vS4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714395720; c=relaxed/simple; bh=JzxYEt5O7zxHEt/Z8bns47/1CXCnPIbwbW+u3fqIlbI=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=nnJMhyUZHVV0r6coY2Ok57cUIh9DbhKVnypH1Qd3w+gpZBTy17z59RFV0wxyn70fEwKPfT2z4wKBUCxNwAeIUmkecuG4X4v9FWc3iH40fR57I1XH6plh9fIHAmA6+zVTVJyN4FiW4TgefgtmrZ4lkWaMTn5zI9sCk0Z/QWS8u3M= 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=kryx1d+i; arc=none smtp.client-ip=192.198.163.13 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="kryx1d+i" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1714395719; x=1745931719; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=JzxYEt5O7zxHEt/Z8bns47/1CXCnPIbwbW+u3fqIlbI=; b=kryx1d+iSXe7VvihpyJg9fZtJSlk9yJJqbrZatC6rZaN8nKS9yIbJNqG T+yotv5HYa9PqlfHdNZdIRfhPWruikDGwiHAZThKBx63pwr475NZk1hTB YwHPZLryjwVRlbOM49YJ2V8el9PFx5tcoCSS4Uw9+AMpQAJ1zUBQEpA5M KH8XINDt/zql175iDqKOMZfucG3PRFtOOogTDObeKO9rWPrySXlrGNfVT /eTLGu2jIwC9E24nbS0Ljnf7g/hSNbm/26UJ6Iu9AVbFi+Q+O21Fhzico /Kow17LzVGxZpTCKyr70qhYV2rlb2CMV9dnW+dOpjiPqc9xY40FgUu//4 A==; X-CSE-ConnectionGUID: v+4hvcDURI2HpncxT68U8w== X-CSE-MsgGUID: OGrFd8lMRQS37sPqbZgprg== X-IronPort-AV: E=McAfee;i="6600,9927,11057"; a="12986905" X-IronPort-AV: E=Sophos;i="6.07,239,1708416000"; d="scan'208";a="12986905" Received: from orviesa006.jf.intel.com ([10.64.159.146]) by fmvoesa107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 Apr 2024 06:01:58 -0700 X-CSE-ConnectionGUID: NX35Vbs6SS6ltVg0ivCMhQ== X-CSE-MsgGUID: /cDeG+g8S8ObH3pHs6uf3A== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.07,239,1708416000"; d="scan'208";a="26507109" Received: from black.fi.intel.com (HELO black.fi.intel.com.) ([10.237.72.28]) by orviesa006.jf.intel.com with ESMTP; 29 Apr 2024 06:01:56 -0700 From: Alexander Shishkin To: Greg Kroah-Hartman Cc: linux-kernel@vger.kernel.org, Colin Ian King , Alexander Shishkin , Andy Shevchenko Subject: [PATCH v1 08/15] intel_th: Remove redundant initialization of pointer outp Date: Mon, 29 Apr 2024 16:01:12 +0300 Message-ID: <20240429130119.1518073-9-alexander.shishkin@linux.intel.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240429130119.1518073-1-alexander.shishkin@linux.intel.com> References: <20240429130119.1518073-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 02:49:52 2025 Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.13]) (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 C83197BAEC for ; Mon, 29 Apr 2024 13:02:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.13 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714395722; cv=none; b=AXgQG5KFKjUQUaUAjVqbZtlUSAgYz0nFAfXBCKx+nA/EQxlLZu2ztgKACAGbPBOqRiBxAXnrQlOy3ZaToQhXXRFKNOUjsHQZass44e4OkdlBuTlxmIJ16rTZReHsoARYI2LELbJv+2xfBRlM/UmusG79OuGYv3bC/XSYda85SBA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714395722; c=relaxed/simple; bh=J9FY2ipo2lxecD7Za9X7g2Z+V+7tNAF/Om/EeWGmizU=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=b2Dd7DEa88ZeiF7gezNNN+EvKBCI0f/ihfItLdQiZKCmcNiqodXlCcS+cU91xodRQp3CV7Ac7T7T252FM11RxuSGr84Ke40U8cZTF/6BL88gpHoNL9aa00+sOJHH4Xrm7IoiP6HdR+Whmk03/5RXeLdhgrA2BcvXwA0Cq8Xf4NM= 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=ABQlV6pu; arc=none smtp.client-ip=192.198.163.13 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="ABQlV6pu" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1714395720; x=1745931720; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=J9FY2ipo2lxecD7Za9X7g2Z+V+7tNAF/Om/EeWGmizU=; b=ABQlV6puLPR2AmORjbZSM4lq+10339ZC7Wo0CJLncYPTHSelyOu8fwR7 kKEReVLos74AFP8xs+JiBIh/gM/yiHQn8+Hr06kOmLAY7BXLaM3+4j1qV dAEl3C4GeFBNAIga/1VYRERHVfglGoGQMAHXhykGCzh5kjLiitFC6q/S0 LaEMfGcR/9FgUpM+gk0KWnalx6NeSpvGqqrXAnFrJ6vnBU3QyuG9/7sD2 DUssp60QXJG1AQXVDl0jEFVr9fxCupPz958gZZDUvxODpEFWwrkKubM/t sikR4fgh9QxNn1JZHPZbxICFd+7LLAup/Vu24zZHSxqwDYfkr7HnNIrGP w==; X-CSE-ConnectionGUID: 5nRky0n7RxWKqRPi1A4n/Q== X-CSE-MsgGUID: ydcx1ShFQG6SoqZwC/8eqA== X-IronPort-AV: E=McAfee;i="6600,9927,11057"; a="12986922" X-IronPort-AV: E=Sophos;i="6.07,239,1708416000"; d="scan'208";a="12986922" Received: from orviesa006.jf.intel.com ([10.64.159.146]) by fmvoesa107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 Apr 2024 06:02:00 -0700 X-CSE-ConnectionGUID: 8axicsZOTdCDJSKZh3PAGw== X-CSE-MsgGUID: ZeMfmJgzRG21bEE/sR6SzQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.07,239,1708416000"; d="scan'208";a="26507132" Received: from black.fi.intel.com (HELO black.fi.intel.com.) ([10.237.72.28]) by orviesa006.jf.intel.com with ESMTP; 29 Apr 2024 06:01:57 -0700 From: Alexander Shishkin To: Greg Kroah-Hartman Cc: linux-kernel@vger.kernel.org, Randy Dunlap , Alexander Shishkin , Andy Shevchenko Subject: [PATCH v1 09/15] intel_th: msu: Fix kernel-doc warnings Date: Mon, 29 Apr 2024 16:01:13 +0300 Message-ID: <20240429130119.1518073-10-alexander.shishkin@linux.intel.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240429130119.1518073-1-alexander.shishkin@linux.intel.com> References: <20240429130119.1518073-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 02:49:52 2025 Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.13]) (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 834687CF1A for ; Mon, 29 Apr 2024 13:02:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.13 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714395723; cv=none; b=hLaK2brcenzp3kk0AmGVyIHFbuBSTBNk/se+B8G9B/968C+97RtXhMJq/jMwLaaFRhGCDcWSub58BNBm+oaIrX1MWPE5zJqaL4g4vsGnIxso7py5Znv5QpJrvZvy3InSI8ESv/3U9dNUforBaYu1UfMdfEsramcAFvA22Z81/f0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714395723; c=relaxed/simple; bh=O/tPLmmDVxjWqjenqSekjhHbDwgCsVPjYLagOWXNRp4=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=IwJrGdhCK9v00hOl27EMU9Nyz+DFXGe9DliDRqlwRYnoQQyW4SYTuUTQXfnLgiUNfTKAiwOfMZZFWQIK4Pgpt0JUVexOk7pkCF4aP5SLFGqh3w78F5+M/xqBvIRYcAqAi+MLvH+hcYDmU4ckYlqBZWJVBhBaQCczow2ANedm1Ek= 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=ZrvcziBm; arc=none smtp.client-ip=192.198.163.13 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="ZrvcziBm" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1714395722; x=1745931722; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=O/tPLmmDVxjWqjenqSekjhHbDwgCsVPjYLagOWXNRp4=; b=ZrvcziBmJ0VpxvOOMLtFQ1XuvWSbxuVu1FaXCgfYo0YA/f56jfIGJTf0 mWIlclwSfRt++mzUiADiIh3NNtDwXTAbGvJN+0Vv1RMyFRky/4oEydFyC dhVsftMzX+slRGWoAEdqtjnAP1vNxq6R/CJUP+P6FHW+tMm8lPUTC6ppL 8iLD97WlmwHttajcQ0sBK825NAoHGdIcBB8jDj5K8rH63UN8l9HVrwRPg r0D8ow+1wgCXBWoRms5MQI6s9eMXoKUKUG6Oom5o53lXqB9ZbJgz3RiLQ uL/8fe04+lj6swRw8leSVjVSCnjXP6BGF2P6ajZ6510iEXHhdvUdwIOpH Q==; X-CSE-ConnectionGUID: iNN07Kl9TnCUQlMTSWYZEw== X-CSE-MsgGUID: MVGL8hKkSgW5NfQ/bcSmmQ== X-IronPort-AV: E=McAfee;i="6600,9927,11057"; a="12986932" X-IronPort-AV: E=Sophos;i="6.07,239,1708416000"; d="scan'208";a="12986932" Received: from orviesa006.jf.intel.com ([10.64.159.146]) by fmvoesa107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 Apr 2024 06:02:02 -0700 X-CSE-ConnectionGUID: FJ57NaCrS1KvpHo8ExWBVQ== X-CSE-MsgGUID: d0S+fIV/TF+0oPJ4LGwhNg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.07,239,1708416000"; d="scan'208";a="26507156" Received: from black.fi.intel.com (HELO black.fi.intel.com.) ([10.237.72.28]) by orviesa006.jf.intel.com with ESMTP; 29 Apr 2024 06:01:59 -0700 From: Alexander Shishkin To: Greg Kroah-Hartman Cc: linux-kernel@vger.kernel.org, Alexander Shishkin , Andy Shevchenko , stable@kernel.org Subject: [PATCH v1 10/15] intel_th: pci: Add Granite Rapids support Date: Mon, 29 Apr 2024 16:01:14 +0300 Message-ID: <20240429130119.1518073-11-alexander.shishkin@linux.intel.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240429130119.1518073-1-alexander.shishkin@linux.intel.com> References: <20240429130119.1518073-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 02:49:53 2025 Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.13]) (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 6FC9E7D414 for ; Mon, 29 Apr 2024 13:02:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.13 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714395725; cv=none; b=DNMJhmjPQyOpXEJUfO28SmJORGr1pahCco8lt3zQsOWrryI84bKVSvzH3rpxfEHNgcuYegTF+MUqG+w/vwYquUFhADEAdFIUyLXCaEZqkxC51xYaiakQQXE6Hm/SbjBc8/JI/BSGpY7w2ro1J4EfFQtH983f7chXix7aonng2LQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714395725; c=relaxed/simple; bh=bxIRmwYGyryCI32YPKm+QfLssD8VLAYd6uQrJuFO2ko=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=YYWykTzd12bX+34geFAudMj5RhtfARN4rBpX4/Ks7ZiqkwdG6rvfSe+JOvKogru5TEIDAhxJen4DD3cN3ubTniuCmbTLmmSopnB6eDt+B7oHBLIPLl1mzI7wcdouCJ5oHhGBn24cMQZUAIlrtWblwIbDSNLIR9twnjj5OXcnTm0= 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=msvPWP39; arc=none smtp.client-ip=192.198.163.13 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="msvPWP39" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1714395724; x=1745931724; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=bxIRmwYGyryCI32YPKm+QfLssD8VLAYd6uQrJuFO2ko=; b=msvPWP392qYoXRHxR0y4JKsCcGzkiDxNmG2rgs6cBQoycl6SvBzd5/qF nX4l7EWP25fk1T5FSUU15v95og73Kcni66T2m5nHiLyeyam8+BNzNgo8+ abMQMmadkT/ngFmX+mcbrMxjRJxYDDAW16J9cTn8r7VLejrcP+q3GEf+u bOPbxrOxWez/53UQuraE9sCw1N99zqnQdUmv3BKvZTVxbacOWz4m5uaxi Kldg8STZ2R6RDDYVkZQ3BVZbb6s8U8z5ZRpQF2HZAG96kNk8WZBcIwblq g6WcHpaGqZgwTGUhsgWiJf4bcBITGRRA+Wywd1+GMcEsVQCkFwkaSt9vf w==; X-CSE-ConnectionGUID: bjYAnKjDSr6t7sx0D4f27Q== X-CSE-MsgGUID: oEjT9ntvTsafzWfYYG+E9Q== X-IronPort-AV: E=McAfee;i="6600,9927,11057"; a="12986944" X-IronPort-AV: E=Sophos;i="6.07,239,1708416000"; d="scan'208";a="12986944" Received: from orviesa006.jf.intel.com ([10.64.159.146]) by fmvoesa107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 Apr 2024 06:02:04 -0700 X-CSE-ConnectionGUID: q2RJV0q8SMyBFnh+XbYcmQ== X-CSE-MsgGUID: o0vrrZRARmKRRTPGJjGGbA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.07,239,1708416000"; d="scan'208";a="26507194" Received: from black.fi.intel.com (HELO black.fi.intel.com.) ([10.237.72.28]) by orviesa006.jf.intel.com with ESMTP; 29 Apr 2024 06:02:01 -0700 From: Alexander Shishkin To: Greg Kroah-Hartman Cc: linux-kernel@vger.kernel.org, Alexander Shishkin , Andy Shevchenko , stable@kernel.org Subject: [PATCH v1 11/15] intel_th: pci: Add Granite Rapids SOC support Date: Mon, 29 Apr 2024 16:01:15 +0300 Message-ID: <20240429130119.1518073-12-alexander.shishkin@linux.intel.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240429130119.1518073-1-alexander.shishkin@linux.intel.com> References: <20240429130119.1518073-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 02:49:53 2025 Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.13]) (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 50BB67F48C for ; Mon, 29 Apr 2024 13:02:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.13 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714395727; cv=none; b=qkIrBTLfNC11LjFHu2PiU0pTA0qjOQ1w6AvZeS1SbUOwoND6s6EdD6fZZpSvKSMfoKpkmU2Pq/nNejzekEvKPN/XmjkSwmljn/KGdGMoNQKBd1062nx/GbCTpR6VdS/OiNpWTjYAd5/5k8yA5DDRQXplZ0Gfluv+HgYXccw23Qc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714395727; c=relaxed/simple; bh=wLYBlxedLAthkJZqqlPpyzb7ig9rN7jLeqrZ6Jbe1HE=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=tHNMEpDybM3Nw+/rof5rtlHW6hyyruRppOHfx7fFJAi/zp0NZKxkU1B7orl8wj1MxnnDIUFz4HZ8oc772Oji1lN43WJDOIdO95mQoAueDV1YeyfXWuktgom9+WNxUbBudbRoddGvdjr2aqzq1STApeomiSj7883X4M/7LRZjD2g= 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=OMMtTJfn; arc=none smtp.client-ip=192.198.163.13 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="OMMtTJfn" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1714395726; x=1745931726; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=wLYBlxedLAthkJZqqlPpyzb7ig9rN7jLeqrZ6Jbe1HE=; b=OMMtTJfnE//xJnemWa+V6o4DPfrVssxx3CM5I6ctbFQIQgSk3wKR3dmn 1xqh0cu2IFHT0p46n5Mh6+LzMCxLiqmF8IICYISgpmPSA5lsxFXgyQiE0 sGzB0mg8a2gmWuGQ9HqBZNg5W6IOCB0AYCtuMsXLcgq+loSA9U86Jmvjc qRbYksqnysxjvCi9OSKN5fES/V2ApeI4Uq+sxzYxj852Sz0hFfDkn9B9u 2hYJ3TCLnxL5E0k8SB4N675/5CfyF2Q4puXyXoF2hRmPGBEn2YgXHyWEU XMvs/h/5PNzTcHe7tY2nzSks8h0jKWgxESPDSjNPMoRUuhj8X6Qp1QW8Y w==; X-CSE-ConnectionGUID: WvtpcqVsQWqFLNM+gWUh5Q== X-CSE-MsgGUID: jhzogL1KS7+LSskHfAze4Q== X-IronPort-AV: E=McAfee;i="6600,9927,11057"; a="12986956" X-IronPort-AV: E=Sophos;i="6.07,239,1708416000"; d="scan'208";a="12986956" Received: from orviesa006.jf.intel.com ([10.64.159.146]) by fmvoesa107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 Apr 2024 06:02:06 -0700 X-CSE-ConnectionGUID: MkqZ6cdRTymCour0pe9o+w== X-CSE-MsgGUID: uKbvR911SqyRL4W/Vh+tbg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.07,239,1708416000"; d="scan'208";a="26507201" Received: from black.fi.intel.com (HELO black.fi.intel.com.) ([10.237.72.28]) by orviesa006.jf.intel.com with ESMTP; 29 Apr 2024 06:02:03 -0700 From: Alexander Shishkin To: Greg Kroah-Hartman Cc: linux-kernel@vger.kernel.org, Alexander Shishkin , Andy Shevchenko , stable@kernel.org Subject: [PATCH v1 12/15] intel_th: pci: Add Sapphire Rapids SOC support Date: Mon, 29 Apr 2024 16:01:16 +0300 Message-ID: <20240429130119.1518073-13-alexander.shishkin@linux.intel.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240429130119.1518073-1-alexander.shishkin@linux.intel.com> References: <20240429130119.1518073-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 02:49:53 2025 Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.13]) (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 34EAC8060A for ; Mon, 29 Apr 2024 13:02:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.13 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714395729; cv=none; b=Y4Wo7L7SniUJw3R3op+CE3Vt62DAIWqJCCaJ14m9WdYsPREqpaSupiS2QRF2Jrv7iS0KsssgsWgu68XOOmMUyTbG/3fGr1iVZnJN/XBZdu9Ze4cm9FTQlJ3SR6S3WCmDkFfT9i6TICPJxiObRMYsMO4XTBkseHGgZHkMlyv/12s= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714395729; c=relaxed/simple; bh=6oEQ8SmB24y33MxFtl+D/rMkW5uAGu9qGTWbUveLuYk=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=a1WgJ7GKlIKC7jeLQVW+ZT//mGX4+GyKZp9rti3eoFi8joU9OShNKuxxMXoW638/CG89q6/TQzD2msbIr5xUn5JDEdTFSnU+kfLaOv2ZcF/w4xU/6M7TLUzK6KRYgWLB1ChUaENLAthD6fXu7xGZE2ZCw7vFJvjUASTmAHEyVys= 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=SiI0IzXt; arc=none smtp.client-ip=192.198.163.13 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="SiI0IzXt" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1714395728; x=1745931728; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=6oEQ8SmB24y33MxFtl+D/rMkW5uAGu9qGTWbUveLuYk=; b=SiI0IzXti8bBwG1QeNOW/gaq/jaGAq+0qzNCZqaubX65hftYiJUtlfkN fGwO6hUps0XYzS5lE7RLHXFVpTpVn7bcQHJDDZEYmyDylOalTFP+L3ctE 2kIVcqCDuANGTygVqoOuQ3yPWzKAyMZJ6s8jQbM8VgWPZEhpCmaFDpFij 9yRXhIt9tV8fEhDmzwU6qvo7CnbeXI0eHvg1oobtqkf78cstujzioV1jh +LITQEh3C2DQvoRS7UM7mFi5oX1CcA+qbkMvsgJjxQsYANqTTX8gND1iX es+4WHILKABDdDVL/AxfUJcRrWeYCEcoS7Of00UmbtYYKBADUDQIscdUl A==; X-CSE-ConnectionGUID: WhZD3Os+ShSfrG0guuiyQA== X-CSE-MsgGUID: sZJwrwc4Rxi8Kr9CKixc5A== X-IronPort-AV: E=McAfee;i="6600,9927,11057"; a="12986967" X-IronPort-AV: E=Sophos;i="6.07,239,1708416000"; d="scan'208";a="12986967" Received: from orviesa006.jf.intel.com ([10.64.159.146]) by fmvoesa107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 Apr 2024 06:02:08 -0700 X-CSE-ConnectionGUID: OVy405HkRWmQBAoOhQC/xA== X-CSE-MsgGUID: fDqrNWCLQBqSxcw8fAjkNA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.07,239,1708416000"; d="scan'208";a="26507206" Received: from black.fi.intel.com (HELO black.fi.intel.com.) ([10.237.72.28]) by orviesa006.jf.intel.com with ESMTP; 29 Apr 2024 06:02:05 -0700 From: Alexander Shishkin To: Greg Kroah-Hartman Cc: linux-kernel@vger.kernel.org, Alexander Shishkin , Andy Shevchenko , stable@kernel.org Subject: [PATCH v1 13/15] intel_th: pci: Add Meteor Lake-S support Date: Mon, 29 Apr 2024 16:01:17 +0300 Message-ID: <20240429130119.1518073-14-alexander.shishkin@linux.intel.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240429130119.1518073-1-alexander.shishkin@linux.intel.com> References: <20240429130119.1518073-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 02:49:53 2025 Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.13]) (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 2DB2B81723 for ; Mon, 29 Apr 2024 13:02:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.13 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714395731; cv=none; b=H87mzzq523X+PBQNnh4ix5C9FysHYnnagzTsCcCR/HE0g0Pdv1s+wtK6EWiydKiJe+tJVNQ++Shq0xuLt5YtwWMWEiAB5DBA6/F+x70vmf/mJyxw89bJBbgGhJu+Sr5V9fOgX+N+IkVmkj+sEC7k5rtDGgeqR4xlUxM4zz6tl7o= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714395731; c=relaxed/simple; bh=4mjB5jRD2LZdYg+WgATpyA8orwgL1dsnFryoaxKiQOw=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=a81230v3dnhK+4MX9e3TYJflcwhTYHyaxmp/V1jlB9qj82TzpTox/AISkEr8bAKjQATnCn4eDtnwzItkQL/GW4gPf7iXXOWLjMvj4ZNnOt6qxzLx/7cOkLvlMOTMQBRVN0u0ZldwWu5Oj0ptr7kkgnmkrcEGaJerZAOMyd8jesY= 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=P/IztecN; arc=none smtp.client-ip=192.198.163.13 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="P/IztecN" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1714395730; x=1745931730; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=4mjB5jRD2LZdYg+WgATpyA8orwgL1dsnFryoaxKiQOw=; b=P/IztecNcE6AYh+7xMzfcl8z0fS0qJtK7PbJKiXUQ/DmGAKEdlroO8wl DS5SR/Uxp1HfNsZy+UqIwbZyMeEvdm+2hkxrP2RNnu7VYf94cRPv1gdOZ mEQjMf6wcEY0wMP74bIpYdAw1CCnYuLkjRU9Vfi5x49891TK92qkFiFjM 77cKtaG8+/LuWPCsWtwzVB1ukzsthgAac9i4dJMfUO2Spt4oCUTsAxtD1 8sk59SHFEfloSVaUQdI9d9ei4e1ToVPzxrYHvQCVCTunnotjdv29CKXxw c9coZMOMO9pRxC4HUv2bq9F8BEyKNWzA0YXIt2Gk2xUl5QH3EmA7y+X5u w==; X-CSE-ConnectionGUID: uJpZveYvRaOUg6l5sJSkxQ== X-CSE-MsgGUID: lRU2wrx9TbO0IMHFvedgBw== X-IronPort-AV: E=McAfee;i="6600,9927,11057"; a="12986981" X-IronPort-AV: E=Sophos;i="6.07,239,1708416000"; d="scan'208";a="12986981" Received: from orviesa006.jf.intel.com ([10.64.159.146]) by fmvoesa107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 Apr 2024 06:02:10 -0700 X-CSE-ConnectionGUID: GyQSFSRLSOGOwiM5uf0GNw== X-CSE-MsgGUID: ecBTNo0NRLWu+ggsPkN6yA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.07,239,1708416000"; d="scan'208";a="26507215" Received: from black.fi.intel.com (HELO black.fi.intel.com.) ([10.237.72.28]) by orviesa006.jf.intel.com with ESMTP; 29 Apr 2024 06:02:07 -0700 From: Alexander Shishkin To: Greg Kroah-Hartman Cc: linux-kernel@vger.kernel.org, Alexander Shishkin , Andy Shevchenko , stable@kernel.org Subject: [PATCH v1 14/15] intel_th: pci: Add Meteor Lake-S CPU support Date: Mon, 29 Apr 2024 16:01:18 +0300 Message-ID: <20240429130119.1518073-15-alexander.shishkin@linux.intel.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240429130119.1518073-1-alexander.shishkin@linux.intel.com> References: <20240429130119.1518073-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 02:49:53 2025 Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.13]) (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 1794F6E5EF for ; Mon, 29 Apr 2024 13:02:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.13 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714395733; cv=none; b=XpizbJE/qvO0AReS5g0yOdnw4hekA7UUyxijCBlddZ55XSQzZkXQwupErclixj5CnFVRBvn0kfxwYZEpIi/wgBkKAMb3yTDdKsBT9putPnYoXVv3zDIg9oc8qjvduBH4va3ilf1JYZyH+kYKqLjBUN7KR7/qf8pwwQ6v6FVR2KI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714395733; c=relaxed/simple; bh=XHEQAft4tZaQ2JdNqTSsJ60xy1/uNy4H7i3u5WPmZVk=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=W88Wb+RD3d/G0KzZt5G0Y/7MFgRDe49951v+LIoXe2LziqeT0LJx9ZL2lvzye2p7dlKuoLHbM9rEDRzWQH4L1knkmiLyslsxpc3CmHwVO056McP41jaZlmprFiUy5J0js6pxpJlaZEZt/groLzgePAgyRJi5tjZeXnYb9zsjimw= 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=fNu4S6J+; arc=none smtp.client-ip=192.198.163.13 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="fNu4S6J+" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1714395732; x=1745931732; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=XHEQAft4tZaQ2JdNqTSsJ60xy1/uNy4H7i3u5WPmZVk=; b=fNu4S6J+VvcIxGYPd02J7ac77ITSXHxKmQGslLj1t6BBHLvEc4jsgIFN gHu+ZjemRaRIAsxTC6Xty4X1bupFf/ikx5Z5Euuzg+v9lvdr6LT3x/v+I /zd4oBWCNMAAwFZfmffA4MLJDECWbkj68fF/sZhz5SdHgaxSrVKhi3WJJ beY1dTUCDR0e0wVmj+MrryPOuF1BGufyQBKtSjWfaB8c11Jd+4da5IT6i itDoGS4hX3kKqvNQAuZQ5i31ZL4Pd4UjJvZ5Qm5j0/YeXtXiPUOqFxd3f BP/jLAQSsipZ8SuXQgXwBybjTU6mIsUXR1OKMQbmyILsKkL92+k5iUHT5 w==; X-CSE-ConnectionGUID: UkKW/IYlRFS4AkxADYWvXA== X-CSE-MsgGUID: THZnSlxURLa8HpkGuIzQ+A== X-IronPort-AV: E=McAfee;i="6600,9927,11057"; a="12986991" X-IronPort-AV: E=Sophos;i="6.07,239,1708416000"; d="scan'208";a="12986991" Received: from orviesa006.jf.intel.com ([10.64.159.146]) by fmvoesa107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 Apr 2024 06:02:12 -0700 X-CSE-ConnectionGUID: Wcmsk7B3SPyVEee2IPaVZw== X-CSE-MsgGUID: TgdXCZUOTT2TppTd1Nyopw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.07,239,1708416000"; d="scan'208";a="26507223" Received: from black.fi.intel.com (HELO black.fi.intel.com.) ([10.237.72.28]) by orviesa006.jf.intel.com with ESMTP; 29 Apr 2024 06:02:09 -0700 From: Alexander Shishkin To: Greg Kroah-Hartman Cc: linux-kernel@vger.kernel.org, Alexander Shishkin , Andy Shevchenko , stable@kernel.org Subject: [PATCH v1 15/15] intel_th: pci: Add Lunar Lake support Date: Mon, 29 Apr 2024 16:01:19 +0300 Message-ID: <20240429130119.1518073-16-alexander.shishkin@linux.intel.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240429130119.1518073-1-alexander.shishkin@linux.intel.com> References: <20240429130119.1518073-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