lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <ea183f5a-b4c8-4dc0-960f-dba0db5a5abb@lucaweiss.eu>
Date: Wed, 18 Jun 2025 21:19:42 +0200
From: Luca Weiss <luca@...aweiss.eu>
To: Yassine Oudjana <y.oudjana@...tonmail.com>,
 Jonathan Cameron <jic23@...nel.org>, Lars-Peter Clausen <lars@...afoo.de>,
 Bjorn Andersson <andersson@...nel.org>,
 Konrad Dybcio <konradybcio@...nel.org>,
 Manivannan Sadhasivam <manivannan.sadhasivam@...aro.org>,
 "David S. Miller" <davem@...emloft.net>, Eric Dumazet <edumazet@...gle.com>,
 Jakub Kicinski <kuba@...nel.org>, Paolo Abeni <pabeni@...hat.com>,
 Simon Horman <horms@...nel.org>, Masahiro Yamada <masahiroy@...nel.org>,
 Nathan Chancellor <nathan@...nel.org>,
 Nicolas Schier <nicolas.schier@...ux.dev>,
 Alexander Sverdlin <alexander.sverdlin@...il.com>,
 Sean Nyekjaer <sean@...nix.com>,
 Javier Carrasco <javier.carrasco.cruz@...il.com>,
 Matti Vaittinen <mazziesaccount@...il.com>,
 Antoniu Miclaus <antoniu.miclaus@...log.com>,
 Ramona Gradinariu <ramona.gradinariu@...log.com>,
 "Yo-Jung (Leo) Lin" <0xff07@...il.com>,
 Andy Shevchenko <andriy.shevchenko@...ux.intel.com>,
 Neil Armstrong <neil.armstrong@...aro.org>,
 Barnabás Czémán <barnabas.czeman@...nlining.org>,
 Danila Tikhonov <danila@...xyga.com>,
 Antoni Pokusinski <apokusinski01@...il.com>,
 Vasileios Amoiridis <vassilisamir@...il.com>,
 Petar Stoykov <pd.pstoykov@...il.com>,
 shuaijie wang <wangshuaijie@...nic.com>, Yasin Lee <yasin.lee.x@...il.com>,
 "Borislav Petkov (AMD)" <bp@...en8.de>,
 Dave Hansen <dave.hansen@...ux.intel.com>, Tony Luck <tony.luck@...el.com>,
 Pawan Gupta <pawan.kumar.gupta@...ux.intel.com>,
 Ingo Molnar <mingo@...nel.org>
Cc: Yassine Oudjana <yassine.oudjana@...il.com>,
 linux-kernel@...r.kernel.org, linux-iio@...r.kernel.org,
 linux-arm-msm@...r.kernel.org, netdev@...r.kernel.org,
 linux-kbuild@...r.kernel.org
Subject: Re: [PATCH 3/3] iio: Add Qualcomm Sensor Manager drivers

Hi Yassine!

On 06-04-2025 4:08 p.m., Yassine Oudjana wrote:
> Add drivers for sensors exposed by the Qualcomm Sensor Manager service,
> which is provided by SLPI or ADSP on Qualcomm SoCs. Supported sensors
> include accelerometers, gyroscopes, pressure sensors, proximity sensors
> and magnetometers.
> 
> Signed-off-by: Yassine Oudjana <y.oudjana@...tonmail.com>

<snip>

> +static const char *const qcom_smgr_sensor_type_platform_names[] = {
> +	[SNS_SMGR_SENSOR_TYPE_ACCEL] = "qcom-smgr-accel",
> +	[SNS_SMGR_SENSOR_TYPE_GYRO] = "qcom-smgr-gyro",
> +	[SNS_SMGR_SENSOR_TYPE_MAG] = "qcom-smgr-mag",
> +	[SNS_SMGR_SENSOR_TYPE_PROX_LIGHT] = "qcom-smgr-prox-light",
> +	[SNS_SMGR_SENSOR_TYPE_PRESSURE] = "qcom-smgr-pressure",
> +	[SNS_SMGR_SENSOR_TYPE_HALL_EFFECT] = "qcom-smgr-hall-effect"
> +};
> +
> +static void qcom_smgr_unregister_sensor(void *data)
> +{
> +	struct platform_device *pdev = data;
> +
> +	platform_device_unregister(pdev);
> +}
> +
> +static int qcom_smgr_register_sensor(struct qcom_smgr *smgr,
> +				     struct qcom_smgr_sensor *sensor)
> +{
> +	struct platform_device *pdev;
> +	const char *name = qcom_smgr_sensor_type_platform_names[sensor->type];

On msm8226 lg-lenok I get NULL here leading to a crash with the next call.

I get sensor->type=0 for some heart rate sensor on that watch. I've 
added this patch on top to fix that (excuse the formatting):

<snip>

> diff --git a/drivers/iio/common/qcom_smgr/qmi/sns_smgr.h b/drivers/iio/common/qcom_smgr/qmi/sns_smgr.h
> new file mode 100644
> index 000000000000..a741dfd87452
> --- /dev/null
> +++ b/drivers/iio/common/qcom_smgr/qmi/sns_smgr.h
> @@ -0,0 +1,163 @@
> +/* SPDX-License-Identifier: GPL-2.0-only */
> +
> +#ifndef __SSC_SNS_SMGR_H__
> +#define __SSC_SNS_SMGR_H__
> +
> +#include <linux/iio/common/qcom_smgr.h>
> +#include <linux/soc/qcom/qmi.h>
> +#include <linux/types.h>
> +
> +/*
> + * The structures of QMI messages used by the service were determined
> + * purely by watching transactions between proprietary Android userspace
> + * components and SSC. along with comparing values reported by Android APIs
> + * to values received in response messages. Due to that, the purpose or
> + * meaning of many fields remains unknown. Such fields are named "val*",
> + * "data*" or similar. Furthermore, the true maximum sizes of some messages
> + * with unknown array fields may be different than defined here.
> + */
> +
> +#define SNS_SMGR_QMI_SVC_ID			0x0100
> +#define SNS_SMGR_QMI_SVC_V1			1
> +#define SNS_SMGR_QMI_INS_ID			50
This instance ID needs to be 0 on msm8974 and msm8226, so I assume we 
don't want to make this a define but just add the 50 and the 0 as-is to 
the match table?

Regards
Luca

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ