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 for Android: free password hash cracker in your pocket
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date:   Sat, 19 Nov 2016 10:48:38 +0100
From:   Peter Rosin <peda@...ntia.se>
To:     <linux-kernel@...r.kernel.org>
CC:     Alex Hemme <ahemme@...co.com>, Wolfram Sang <wsa@...-dreams.de>,
        "Wolfram Sang" <wsa-dev@...g-engineering.com>,
        MakeB <mabnhdev@...il.com>, <linux-i2c@...r.kernel.org>,
        <stable@...r.kernel.org>, Ziyang Wu <ziywu@...co.com>,
        Peter Rosin <peda@...ntia.se>
Subject: [PATCH] i2c: i2c-mux-pca954x: fix deselect enabling for device-tree

From: Alex Hemme <ahemme@...co.com>

Deselect functionality can be ignored for device-trees with
"i2c-mux-idle-disconnect" entries if no platform_data is available.
By enabling the deselect functionality outside the platform_data
block the logic works as it did in previous kernels.

Fixes: 7fcac9807175 ("i2c: i2c-mux-pca954x: convert to use an explicit i2c mux core")
Cc: <stable@...r.kernel.org> # v4.7+
Signed-off-by: Alex Hemme <ahemme@...co.com>
Signed-off-by: Ziyang Wu <ziywu@...co.com>
[touched up a few minor issues /peda]
Signed-off-by: Peter Rosin <peda@...ntia.se>
---
 drivers/i2c/muxes/i2c-mux-pca954x.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Hi!

I got this regression report and patch off-list, and am now
feeding it on to the appropriate places.

I would like to thank Alex (and team?) for finding the bug and
providing a fix for the bug that I introduced.

Cheers,
Peter

diff --git a/drivers/i2c/muxes/i2c-mux-pca954x.c b/drivers/i2c/muxes/i2c-mux-pca954x.c
index 1091346f2480..8bc3d36d2837 100644
--- a/drivers/i2c/muxes/i2c-mux-pca954x.c
+++ b/drivers/i2c/muxes/i2c-mux-pca954x.c
@@ -268,9 +268,9 @@ static int pca954x_probe(struct i2c_client *client,
 				/* discard unconfigured channels */
 				break;
 			idle_disconnect_pd = pdata->modes[num].deselect_on_exit;
-			data->deselect |= (idle_disconnect_pd
-					   || idle_disconnect_dt) << num;
 		}
+		data->deselect |= (idle_disconnect_pd ||
+				   idle_disconnect_dt) << num;
 
 		ret = i2c_mux_add_adapter(muxc, force, num, class);
 
-- 
2.1.4

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ