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-next>] [day] [month] [year] [list]
Message-Id: <20201028090010.2689060-1-Sandeep.Singh@amd.com>
Date:   Wed, 28 Oct 2020 14:30:10 +0530
From:   Sandeep Singh <Sandeep.Singh@....com>
To:     jikos@...nel.org, benjamin.tissoires@...hat.com,
        linux-kernel@...r.kernel.org, linux-input@...r.kernel.org,
        jic23@...nel.org, Nehal-bakulchandra.Shah@....com
Cc:     mail@...hard-neumann.de, Shyam-sundar.S-k@....com,
        lipheng@...mail.net, Sandeep Singh <sandeep.singh@....com>
Subject: [PATCH v3] AMD_SFH: Fix for incorrect Sensor index

From: Sandeep Singh <sandeep.singh@....com>

It appears like the accelerometer/magnetometer and gyroscope
indices were interchanged in the patch series which got into
for-5.11/amd-sfh-hid until Mandoli/Richard reported to us.
Ideally sensor indices should be 0,1,2 for the accelerometer,
Gyroscope, Magnetometer respectively, but this interchanged
possibly could be because i was using a test MP2 firmware
on my machine.

This patch fixes the earlier commit with the right sensor
indices and also removing unused structures
_hid_report_descriptor,
_hid_device_descriptor as reported by Richard.

Reported-by: Mandoli <lipheng@...mail.net>
Reported-by: Richard Neumann <mail@...hard-neumann.de>
Signed-off-by: Sandeep Singh <sandeep.singh@....com>
Fixes: SFH: PCIe driver to add support of AMD sensor fusion hub (4f567b9f8141)
---

Changes since v1:(https://lkml.org/lkml/2020/10/23/172)
	-> Add Reported by : Richard Neumann

Changes since v2:(https://lkml.org/lkml/2020/10/24/22)
	-> Modified commit message 

 drivers/hid/amd-sfh-hid/amd_sfh_pcie.c             |  6 +++---
 .../amd-sfh-hid/hid_descriptor/amd_sfh_hid_desc.h  | 14 --------------
 2 files changed, 3 insertions(+), 17 deletions(-)

diff --git a/drivers/hid/amd-sfh-hid/amd_sfh_pcie.c b/drivers/hid/amd-sfh-hid/amd_sfh_pcie.c
index 9c5eb442e1a6..a51c7b76283b 100644
--- a/drivers/hid/amd-sfh-hid/amd_sfh_pcie.c
+++ b/drivers/hid/amd-sfh-hid/amd_sfh_pcie.c
@@ -20,9 +20,9 @@
 #define DRIVER_NAME	"pcie_mp2_amd"
 #define DRIVER_DESC	"AMD(R) PCIe MP2 Communication Driver"
 
-#define ACEL_EN		BIT(1)
-#define GYRO_EN		BIT(2)
-#define MAGNO_EN	BIT(3)
+#define ACEL_EN		BIT(0)
+#define GYRO_EN		BIT(1)
+#define MAGNO_EN		BIT(2)
 #define ALS_EN		BIT(19)
 
 void amd_start_sensor(struct amd_mp2_dev *privdata, struct amd_mp2_sensor_info info)
diff --git a/drivers/hid/amd-sfh-hid/hid_descriptor/amd_sfh_hid_desc.h b/drivers/hid/amd-sfh-hid/hid_descriptor/amd_sfh_hid_desc.h
index ac9a01cc1454..095c471d8fd6 100644
--- a/drivers/hid/amd-sfh-hid/hid_descriptor/amd_sfh_hid_desc.h
+++ b/drivers/hid/amd-sfh-hid/hid_descriptor/amd_sfh_hid_desc.h
@@ -16,11 +16,6 @@ enum desc_type {
 	feature_size,
 };
 
-struct _hid_report_descriptor {
-	u8 bDescriptorType;
-	u8 wDescriptorLength;
-};
-
 struct common_feature_property {
 	/* common properties */
 	u8 report_id;
@@ -38,15 +33,6 @@ struct common_input_property {
 	u8 event_type;
 } __packed;
 
-struct _hid_device_descriptor {
-	u8 bLength;
-	u8 bDescriptorType;
-	u8 bcdHID[2];
-	u8 bCountryCode;
-	u8 bNumDescriptors;
-	struct _hid_report_descriptor *reports;
-};
-
 struct accel3_feature_report {
 	struct common_feature_property common_property;
 	/* properties specific to this sensor */
-- 
2.25.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ