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] [thread-next>] [day] [month] [year] [list]
Message-Id: <6901e775290445a93c39c11a4f544d6127452418.1570194906.git.mchehab+samsung@kernel.org>
Date:   Fri,  4 Oct 2019 10:15:23 -0300
From:   Mauro Carvalho Chehab <mchehab+samsung@...nel.org>
To:     Linux Media Mailing List <linux-media@...r.kernel.org>
Cc:     Mauro Carvalho Chehab <mchehab+samsung@...nel.org>,
        Mauro Carvalho Chehab <mchehab@...radead.org>,
        JP <jp@...w.nl>, Gonsolo <gonsolo@...il.com>, crope@....fi,
        Sean Young <sean@...s.org>,
        Linux Kernel <linux-kernel@...r.kernel.org>
Subject: [PATCH 2/4] media: si2168: add support for not loading a firmware

Some devices (Logilink VG0022A) don't work properly with the
standard firmware. Upgrading the firmware makes I2C transfers
to fail when talking to the tuner.

While we don't have a better alternative, add support to
disable the firmware load on such devices.

Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@...nel.org>
---
 drivers/media/dvb-frontends/si2168.c      | 5 +++++
 drivers/media/dvb-frontends/si2168.h      | 3 +++
 drivers/media/dvb-frontends/si2168_priv.h | 1 +
 3 files changed, 9 insertions(+)

diff --git a/drivers/media/dvb-frontends/si2168.c b/drivers/media/dvb-frontends/si2168.c
index 14b93a7d3358..3a3cb7a7d45a 100644
--- a/drivers/media/dvb-frontends/si2168.c
+++ b/drivers/media/dvb-frontends/si2168.c
@@ -445,6 +445,9 @@ static int si2168_init(struct dvb_frontend *fe)
 	if (ret)
 		goto err;
 
+	if (dev->dont_load_firmware)
+		goto dont_load;
+
 	/* request the firmware, this will block and timeout */
 	ret = request_firmware(&fw, dev->firmware_name, &client->dev);
 	if (ret) {
@@ -504,6 +507,7 @@ static int si2168_init(struct dvb_frontend *fe)
 
 	release_firmware(fw);
 
+dont_load:
 	cmd_init(&cmd, "\x01\x01", 2, 1);
 	ret = si2168_cmd_execute(client, &cmd);
 	if (ret)
@@ -749,6 +753,7 @@ static int si2168_probe(struct i2c_client *client,
 	dev->ts_clock_inv = config->ts_clock_inv;
 	dev->ts_clock_gapped = config->ts_clock_gapped;
 	dev->spectral_inversion = config->spectral_inversion;
+	dev->dont_load_firmware = config->dont_load_firmware;
 
 	dev_info(&client->dev, "Silicon Labs Si2168-%c%d%d successfully identified\n",
 		 dev->version >> 24 & 0xff, dev->version >> 16 & 0xff,
diff --git a/drivers/media/dvb-frontends/si2168.h b/drivers/media/dvb-frontends/si2168.h
index ecd21adf8950..5e5de4619c3b 100644
--- a/drivers/media/dvb-frontends/si2168.h
+++ b/drivers/media/dvb-frontends/si2168.h
@@ -28,6 +28,8 @@
  *	TS clock gapped
  * @spectral_inversion:
  *	Inverted spectrum
+ * @dont_load_firmware:
+ *	Instead of uploading a new firmware, use the existing one
  *
  * Note:
  *	The I2C address of this demod is 0x64.
@@ -46,6 +48,7 @@ struct si2168_config {
 	unsigned int ts_clock_inv:1;
 	unsigned int ts_clock_gapped:1;
 	unsigned int spectral_inversion:1;
+	unsigned int dont_load_firmware:1;
 };
 
 #endif
diff --git a/drivers/media/dvb-frontends/si2168_priv.h b/drivers/media/dvb-frontends/si2168_priv.h
index 18bea5222082..bdc1754da747 100644
--- a/drivers/media/dvb-frontends/si2168_priv.h
+++ b/drivers/media/dvb-frontends/si2168_priv.h
@@ -40,6 +40,7 @@ struct si2168_dev {
 	unsigned int ts_clock_inv:1;
 	unsigned int ts_clock_gapped:1;
 	unsigned int spectral_inversion:1;
+	unsigned int dont_load_firmware:1;
 };
 
 /* firmware command struct */
-- 
2.21.0

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ