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>] [day] [month] [year] [list]
Message-ID: <s5hzkhne5iz.wl%tiwai@suse.de>
Date:	Thu, 29 Sep 2011 17:23:48 +0200
From:	Takashi Iwai <tiwai@...e.de>
To:	Eric Piel <eric.piel@...mplin-utc.net>
Cc:	Samu Onkalo <samu.p.onkalo@...ia.com>,
	Andrew Morton <akpm@...gle.com>, linux-kernel@...r.kernel.org
Subject: [PATCH] lis3: Fix regression of HP DriveGuard with 8bit chip

The commit 2a7fade7e03a7c773f91e2e5ff26ad6fafda5a9f
    hwmon: lis3: Power on corrections
caused a regression on HP laptops with 8bit chip.
Writing CTRL2_BOOT_8B bit seems clearing the BIOS setup, and no proper
interrupt for DriveGuard will be triggered any more.

Since the init code there is basically only for embedded devices,
put a pdata check so that the problematic initialization will be
skipped for hp_accel stuff.

Cc: <stable@...nel.org>
Signed-off-by: Takashi Iwai <tiwai@...e.de>
---
 drivers/misc/lis3lv02d/lis3lv02d.c |   14 ++++++++------
 1 files changed, 8 insertions(+), 6 deletions(-)

diff --git a/drivers/misc/lis3lv02d/lis3lv02d.c b/drivers/misc/lis3lv02d/lis3lv02d.c
index b928bc1..8b51cd6 100644
--- a/drivers/misc/lis3lv02d/lis3lv02d.c
+++ b/drivers/misc/lis3lv02d/lis3lv02d.c
@@ -375,12 +375,14 @@ void lis3lv02d_poweron(struct lis3lv02d *lis3)
 	 *      both have been read. So the value read will always be correct.
 	 * Set BOOT bit to refresh factory tuning values.
 	 */
-	lis3->read(lis3, CTRL_REG2, &reg);
-	if (lis3->whoami ==  WAI_12B)
-		reg |= CTRL2_BDU | CTRL2_BOOT;
-	else
-		reg |= CTRL2_BOOT_8B;
-	lis3->write(lis3, CTRL_REG2, reg);
+	if (lis3->pdata) {
+		lis3->read(lis3, CTRL_REG2, &reg);
+		if (lis3->whoami ==  WAI_12B)
+			reg |= CTRL2_BDU | CTRL2_BOOT;
+		else
+			reg |= CTRL2_BOOT_8B;
+		lis3->write(lis3, CTRL_REG2, reg);
+	}
 
 	/* LIS3 power on delay is quite long */
 	msleep(lis3->pwron_delay / lis3lv02d_get_odr());
-- 
1.7.6.4

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ