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  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Thu, 22 Jul 2021 11:12:35 +0200
From:   Jacopo Mondi <jacopo+renesas@...ndi.org>
To:     Geert Uytterhoeven <geert+renesas@...der.be>,
        Magnus Damm <magnus.damm@...il.com>,
        Laurent Pinchart <laurent.pinchart@...asonboard.com>,
        Kieran Bingham <kieran.bingham@...asonboard.com>,
        Niklas Söderlund 
        <niklas.soderlund+renesas@...natech.se>,
        Rob Herring <robh+dt@...nel.org>
Cc:     Jacopo Mondi <jacopo+renesas@...ndi.org>,
        linux-renesas-soc@...r.kernel.org, linux-media@...r.kernel.org,
        devicetree@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: [PATCH v6 4/8] media: i2c: rdacm20: Re-program chip address earlier

The current implementation of the camera module initialization
re-programs the chip address during the post-registration phase, once
the reverse channel amplitude has been compensated. While this guarantees
more reliable communications, reprogramming the chip address at probe()
time guarantees that the embedded MCU cannot over-write the settings
programmed by the driver.

Re-program the chip address at probe() time, to avoid conflicts on the
i2c bus due to messages sent by the embedded MCU to the default chip
address which render capture operations unstable.

Signed-off-by: Jacopo Mondi <jacopo+renesas@...ndi.org>
---
 drivers/media/i2c/rdacm20.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/media/i2c/rdacm20.c b/drivers/media/i2c/rdacm20.c
index ba956733aa89..eb0e3dc22cc3 100644
--- a/drivers/media/i2c/rdacm20.c
+++ b/drivers/media/i2c/rdacm20.c
@@ -462,11 +462,6 @@ static int rdacm20_post_register(struct v4l2_subdev *sd)
 	if (ret < 0)
 		return ret;
 
-	ret = max9271_set_address(&dev->serializer, dev->addrs[0]);
-	if (ret < 0)
-		return ret;
-	dev->serializer.client->addr = dev->addrs[0];
-
 	/*
 	 * Release ov10635 from reset and initialize it. The image sensor
 	 * requires at least 2048 XVCLK cycles (85 micro-seconds at 24MHz)
@@ -562,6 +557,11 @@ static int rdacm20_initialize(struct rdacm20_device *dev)
 	if (ret)
 		return ret;
 
+	ret = max9271_set_address(&dev->serializer, dev->addrs[0]);
+	if (ret < 0)
+		return ret;
+	dev->serializer.client->addr = dev->addrs[0];
+
 	/*
 	 * Set reverse channel high threshold to increase noise immunity.
 	 *
-- 
2.32.0

Powered by blists - more mailing lists