linux-media.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] si2157: unknown chip version Si2147-A30 ROM 0x50
@ 2022-03-22 23:08 Piotr Chmura
  2022-03-23  8:25 ` Robert Schlabbach
  2022-03-23 17:50 ` Robert Schlabbach
  0 siblings, 2 replies; 3+ messages in thread
From: Piotr Chmura @ 2022-03-22 23:08 UTC (permalink / raw)
  To: linux-media

This patch fixes firmware file names assignment in si2157 tuner.

kernel version: 5.17.0
device: 07ca:1871 AVerMedia Technologies, Inc. TD310 DVB-T/T2/C dongle

modprobe gives error: unknown chip version Si2147-A30 ROM 0x50

device worked fine on 2.16 series

caused by:
1. table si2157_tuners has swapped fields rom_id and required vs struct 
si2157_tuner_info.
2. both firmware file names can be null for devices with required == 
false - device uses build-in firmware in this case


Tested on my device.


Signed-of-by: Piotr Chmura <chmooreck@poczta.onet.pl>
---

diff -u a/drivers/media/tuners/si2157.c b/drivers/media/tuners/si2157.c
--- a/drivers/media/tuners/si2157.c    2022-03-20 21:14:17.000000000 +0100
+++ b/drivers/media/tuners/si2157.c    2022-03-22 23:48:05.604408331 +0100
@@ -77,16 +77,16 @@
  }

  static const struct si2157_tuner_info si2157_tuners[] = {
-    { SI2141, false, 0x60, SI2141_60_FIRMWARE, SI2141_A10_FIRMWARE },
-    { SI2141, false, 0x61, SI2141_61_FIRMWARE, SI2141_A10_FIRMWARE },
-    { SI2146, false, 0x11, SI2146_11_FIRMWARE, NULL },
-    { SI2147, false, 0x50, SI2147_50_FIRMWARE, NULL },
-    { SI2148, true,  0x32, SI2148_32_FIRMWARE, SI2158_A20_FIRMWARE },
-    { SI2148, true,  0x33, SI2148_33_FIRMWARE, SI2158_A20_FIRMWARE },
-    { SI2157, false, 0x50, SI2157_50_FIRMWARE, SI2157_A30_FIRMWARE },
-    { SI2158, false, 0x50, SI2158_50_FIRMWARE, SI2158_A20_FIRMWARE },
-    { SI2158, false, 0x51, SI2158_51_FIRMWARE, SI2158_A20_FIRMWARE },
-    { SI2177, false, 0x50, SI2177_50_FIRMWARE, SI2157_A30_FIRMWARE },
+    { SI2141, 0x60, false, SI2141_60_FIRMWARE, SI2141_A10_FIRMWARE },
+    { SI2141, 0x61, false, SI2141_61_FIRMWARE, SI2141_A10_FIRMWARE },
+    { SI2146, 0x11, false, SI2146_11_FIRMWARE, NULL },
+    { SI2147, 0x50, false, SI2147_50_FIRMWARE, NULL },
+    { SI2148, 0x32, true,  SI2148_32_FIRMWARE, SI2158_A20_FIRMWARE },
+    { SI2148, 0x33, true,  SI2148_33_FIRMWARE, SI2158_A20_FIRMWARE },
+    { SI2157, 0x50, false, SI2157_50_FIRMWARE, SI2157_A30_FIRMWARE },
+    { SI2158, 0x50, false, SI2158_50_FIRMWARE, SI2158_A20_FIRMWARE },
+    { SI2158, 0x51, false, SI2158_51_FIRMWARE, SI2158_A20_FIRMWARE },
+    { SI2177, 0x50, false, SI2177_50_FIRMWARE, SI2157_A30_FIRMWARE },
  };

  static int si2157_load_firmware(struct dvb_frontend *fe,
@@ -178,7 +178,7 @@
          }
      }

-    if (!fw_name && !fw_alt_name) {
+    if (required && !fw_name && !fw_alt_name) {
          dev_err(&client->dev,
              "unknown chip version Si21%d-%c%c%c ROM 0x%02x\n",
              part_id, cmd.args[1], cmd.args[3], cmd.args[4], rom_id);


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] si2157: unknown chip version Si2147-A30 ROM 0x50
  2022-03-22 23:08 [PATCH] si2157: unknown chip version Si2147-A30 ROM 0x50 Piotr Chmura
@ 2022-03-23  8:25 ` Robert Schlabbach
  2022-03-23 17:50 ` Robert Schlabbach
  1 sibling, 0 replies; 3+ messages in thread
From: Robert Schlabbach @ 2022-03-23  8:25 UTC (permalink / raw)
  To: Piotr Chmura; +Cc: linux-media

Hi Piotr,

wow, well spotted! I did not notice this bug with my Si2157, because the ROM file
still has the old "alt" name on my machine, so it was loaded despite this bug.

Best Regards,
-Robert Schlabbach


Gesendet: Mittwoch, 23. März 2022 um 00:08 Uhr
Von: "Piotr Chmura" <chmooreck@gmail.com>
An: linux-media@vger.kernel.org
Betreff: [PATCH] si2157: unknown chip version Si2147-A30 ROM 0x50
This patch fixes firmware file names assignment in si2157 tuner.

kernel version: 5.17.0
device: 07ca:1871 AVerMedia Technologies, Inc. TD310 DVB-T/T2/C dongle

modprobe gives error: unknown chip version Si2147-A30 ROM 0x50

device worked fine on 2.16 series

caused by:
1. table si2157_tuners has swapped fields rom_id and required vs struct
si2157_tuner_info.
2. both firmware file names can be null for devices with required ==
false - device uses build-in firmware in this case


Tested on my device.


Signed-of-by: Piotr Chmura <chmooreck@poczta.onet.pl>
---

diff -u a/drivers/media/tuners/si2157.c b/drivers/media/tuners/si2157.c
--- a/drivers/media/tuners/si2157.c    2022-03-20 21:14:17.000000000 +0100
+++ b/drivers/media/tuners/si2157.c    2022-03-22 23:48:05.604408331 +0100
@@ -77,16 +77,16 @@
 }

 static const struct si2157_tuner_info si2157_tuners[] = {
-    { SI2141, false, 0x60, SI2141_60_FIRMWARE, SI2141_A10_FIRMWARE },
-    { SI2141, false, 0x61, SI2141_61_FIRMWARE, SI2141_A10_FIRMWARE },
-    { SI2146, false, 0x11, SI2146_11_FIRMWARE, NULL },
-    { SI2147, false, 0x50, SI2147_50_FIRMWARE, NULL },
-    { SI2148, true,  0x32, SI2148_32_FIRMWARE, SI2158_A20_FIRMWARE },
-    { SI2148, true,  0x33, SI2148_33_FIRMWARE, SI2158_A20_FIRMWARE },
-    { SI2157, false, 0x50, SI2157_50_FIRMWARE, SI2157_A30_FIRMWARE },
-    { SI2158, false, 0x50, SI2158_50_FIRMWARE, SI2158_A20_FIRMWARE },
-    { SI2158, false, 0x51, SI2158_51_FIRMWARE, SI2158_A20_FIRMWARE },
-    { SI2177, false, 0x50, SI2177_50_FIRMWARE, SI2157_A30_FIRMWARE },
+    { SI2141, 0x60, false, SI2141_60_FIRMWARE, SI2141_A10_FIRMWARE },
+    { SI2141, 0x61, false, SI2141_61_FIRMWARE, SI2141_A10_FIRMWARE },
+    { SI2146, 0x11, false, SI2146_11_FIRMWARE, NULL },
+    { SI2147, 0x50, false, SI2147_50_FIRMWARE, NULL },
+    { SI2148, 0x32, true,  SI2148_32_FIRMWARE, SI2158_A20_FIRMWARE },
+    { SI2148, 0x33, true,  SI2148_33_FIRMWARE, SI2158_A20_FIRMWARE },
+    { SI2157, 0x50, false, SI2157_50_FIRMWARE, SI2157_A30_FIRMWARE },
+    { SI2158, 0x50, false, SI2158_50_FIRMWARE, SI2158_A20_FIRMWARE },
+    { SI2158, 0x51, false, SI2158_51_FIRMWARE, SI2158_A20_FIRMWARE },
+    { SI2177, 0x50, false, SI2177_50_FIRMWARE, SI2157_A30_FIRMWARE },
 };

 static int si2157_load_firmware(struct dvb_frontend *fe,
@@ -178,7 +178,7 @@
         }
     }

-    if (!fw_name && !fw_alt_name) {
+    if (required && !fw_name && !fw_alt_name) {
         dev_err(&client->dev,
             "unknown chip version Si21%d-%c%c%c ROM 0x%02x\n",
             part_id, cmd.args[1], cmd.args[3], cmd.args[4], rom_id);
 

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] si2157: unknown chip version Si2147-A30 ROM 0x50
  2022-03-22 23:08 [PATCH] si2157: unknown chip version Si2147-A30 ROM 0x50 Piotr Chmura
  2022-03-23  8:25 ` Robert Schlabbach
@ 2022-03-23 17:50 ` Robert Schlabbach
  1 sibling, 0 replies; 3+ messages in thread
From: Robert Schlabbach @ 2022-03-23 17:50 UTC (permalink / raw)
  To: Piotr Chmura; +Cc: linux-media

Hi,

I have now tested the patch and confirmed that it corrects the firmware
load behavior.

Before this patch it was:

[Mi Mär 23 16:24:32 2022] si2157 12-0060: found a 'Silicon Labs Si2157-A30 ROM 0x50'
[Mi Mär 23 16:24:32 2022] si2157 12-0060: firmware: direct-loading firmware dvb-tuner-si2157-a30-01.fw
[Mi Mär 23 16:24:32 2022] si2157 12-0060: downloading firmware from file 'dvb-tuner-si2157-a30-01.fw'
[Mi Mär 23 16:24:32 2022] si2157 12-0060: firmware version: 3.1.3

I.e. it directly loaded the "alt" firmware file.

After applying this patch the behavior changed to:

[Mi Mär 23 16:45:01 2022] si2157 12-0060: found a 'Silicon Labs Si2157-A30 ROM 0x50'
[Mi Mär 23 16:45:01 2022] si2157 12-0060: firmware: failed to load dvb_driver_si2157_rom50.fw (-2)
[Mi Mär 23 16:45:01 2022] firmware_class: See https://wiki.debian.org/Firmware for information about missing firmware
[Mi Mär 23 16:45:01 2022] si2157 12-0060: firmware: direct-loading firmware dvb-tuner-si2157-a30-01.fw
[Mi Mär 23 16:45:01 2022] si2157 12-0060: downloading firmware from file 'dvb-tuner-si2157-a30-01.fw'
[Mi Mär 23 16:45:01 2022] si2157 12-0060: firmware version: 3.1.3

So it first tried to load the new firmware file and then fell back to the
"alt" one.

And after renaming the firmware file to the new filename, I get:

[Mi Mär 23 16:47:19 2022] si2157 12-0062: found a 'Silicon Labs Si2157-A30 ROM 0x50'
[Mi Mär 23 16:47:19 2022] si2157 12-0062: firmware: direct-loading firmware dvb_driver_si2157_rom50.fw
[Mi Mär 23 16:47:19 2022] si2157 12-0062: downloading firmware from file 'dvb_driver_si2157_rom50.fw'
[Mi Mär 23 16:47:20 2022] si2157 12-0062: firmware version: 3.1.3

Tested-by: Robert Schlabbach <robert_s@gmx.net>



Gesendet: Mittwoch, 23. März 2022 um 00:08 Uhr
Von: "Piotr Chmura" <chmooreck@gmail.com>
An: linux-media@vger.kernel.org
Betreff: [PATCH] si2157: unknown chip version Si2147-A30 ROM 0x50
This patch fixes firmware file names assignment in si2157 tuner.

kernel version: 5.17.0
device: 07ca:1871 AVerMedia Technologies, Inc. TD310 DVB-T/T2/C dongle

modprobe gives error: unknown chip version Si2147-A30 ROM 0x50

device worked fine on 2.16 series

caused by:
1. table si2157_tuners has swapped fields rom_id and required vs struct
si2157_tuner_info.
2. both firmware file names can be null for devices with required ==
false - device uses build-in firmware in this case


Tested on my device.


Signed-of-by: Piotr Chmura <chmooreck@poczta.onet.pl>
---

diff -u a/drivers/media/tuners/si2157.c b/drivers/media/tuners/si2157.c
--- a/drivers/media/tuners/si2157.c    2022-03-20 21:14:17.000000000 +0100
+++ b/drivers/media/tuners/si2157.c    2022-03-22 23:48:05.604408331 +0100
@@ -77,16 +77,16 @@
 }

 static const struct si2157_tuner_info si2157_tuners[] = {
-    { SI2141, false, 0x60, SI2141_60_FIRMWARE, SI2141_A10_FIRMWARE },
-    { SI2141, false, 0x61, SI2141_61_FIRMWARE, SI2141_A10_FIRMWARE },
-    { SI2146, false, 0x11, SI2146_11_FIRMWARE, NULL },
-    { SI2147, false, 0x50, SI2147_50_FIRMWARE, NULL },
-    { SI2148, true,  0x32, SI2148_32_FIRMWARE, SI2158_A20_FIRMWARE },
-    { SI2148, true,  0x33, SI2148_33_FIRMWARE, SI2158_A20_FIRMWARE },
-    { SI2157, false, 0x50, SI2157_50_FIRMWARE, SI2157_A30_FIRMWARE },
-    { SI2158, false, 0x50, SI2158_50_FIRMWARE, SI2158_A20_FIRMWARE },
-    { SI2158, false, 0x51, SI2158_51_FIRMWARE, SI2158_A20_FIRMWARE },
-    { SI2177, false, 0x50, SI2177_50_FIRMWARE, SI2157_A30_FIRMWARE },
+    { SI2141, 0x60, false, SI2141_60_FIRMWARE, SI2141_A10_FIRMWARE },
+    { SI2141, 0x61, false, SI2141_61_FIRMWARE, SI2141_A10_FIRMWARE },
+    { SI2146, 0x11, false, SI2146_11_FIRMWARE, NULL },
+    { SI2147, 0x50, false, SI2147_50_FIRMWARE, NULL },
+    { SI2148, 0x32, true,  SI2148_32_FIRMWARE, SI2158_A20_FIRMWARE },
+    { SI2148, 0x33, true,  SI2148_33_FIRMWARE, SI2158_A20_FIRMWARE },
+    { SI2157, 0x50, false, SI2157_50_FIRMWARE, SI2157_A30_FIRMWARE },
+    { SI2158, 0x50, false, SI2158_50_FIRMWARE, SI2158_A20_FIRMWARE },
+    { SI2158, 0x51, false, SI2158_51_FIRMWARE, SI2158_A20_FIRMWARE },
+    { SI2177, 0x50, false, SI2177_50_FIRMWARE, SI2157_A30_FIRMWARE },
 };

 static int si2157_load_firmware(struct dvb_frontend *fe,
@@ -178,7 +178,7 @@
         }
     }

-    if (!fw_name && !fw_alt_name) {
+    if (required && !fw_name && !fw_alt_name) {
         dev_err(&client->dev,
             "unknown chip version Si21%d-%c%c%c ROM 0x%02x\n",
             part_id, cmd.args[1], cmd.args[3], cmd.args[4], rom_id);
 

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-03-23 17:50 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-03-22 23:08 [PATCH] si2157: unknown chip version Si2147-A30 ROM 0x50 Piotr Chmura
2022-03-23  8:25 ` Robert Schlabbach
2022-03-23 17:50 ` Robert Schlabbach

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).