Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp1351770pxb; Fri, 1 Apr 2022 10:58:30 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzy5qR/sWJVbHTN8Q5LYrCdad1ayq/kVtbYdaMKKu3kH0Lpi9+bN+LKJMECOekQiMeMhyAg X-Received: by 2002:a17:907:7f0b:b0:6e0:a336:a3f5 with SMTP id qf11-20020a1709077f0b00b006e0a336a3f5mr778900ejc.541.1648835910517; Fri, 01 Apr 2022 10:58:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1648835910; cv=none; d=google.com; s=arc-20160816; b=q6EpGASw0ZrsfYNxEsoPmsmnEWg8B/pRIbWYss2sx2pUwAwGgf4E+JIMwfkknarfqT 2cTmy5tsLxn3Rk/c0nnKVO5qtERXr50Y7pWrQM0+llMT3BsctbBZkyX8/I7zK98TZxGF fCHlZaIs1B45Qd5RpHU9OF8f6c+fPBS0Ek4ys7ObQJ0Mqj/pbXOqErt2kiZNj0BlwQc4 +emYhsXJTnbuOwReNW3j1otYg4wWzLwlt4ifp5QQSS2/n4wad4VQA3R7TrFkrBqApAId dnG9pGkRZ2X+vW2uDAaEfFH9sKumkGNwqUyyvoQW+dhGpu56dgcVbuQytWdgpzOhtUaa 180Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject:from :content-language:user-agent:mime-version:date:message-id :dkim-signature; bh=fygLA6FCziDtx1VVgJ2qLCPIBE2mOveDYVKTX7/lkjk=; b=y7ji9oDpw9C91ufz8aP0YPyfrBg0uPj5fL3xkh7e8RphXvVMgPxZUlP0WF0Tu1F6oj 6TQ2R41bNUglboA4bRqSPAnG8GpqAD1l/AqyVmBiERqJGaTYB0vMjtRm5fsEb7nsCcsz p6HS1EoiFSYKRRuSyFpa8JO2oXdumqq4bzC1bAP6vN6BE+hJ5QZXy427jDCe0zShRMRC PiTCbDAmIY98hDaaCmWIsev/eqcYgXZpo54pDMqpmF7tyPsmq20bfwgYdaeyVETxtsEr 5TgEAGryB71IJbK/i+CK1dqWnGv8Skv+/ACvIYbrQeCb+BFAjdBh/7oQv3xIvB7DNcT5 TIxg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b="ABe8/cH+"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id qh2-20020a170906eca200b006df76385e71si1914312ejb.785.2022.04.01.10.58.06; Fri, 01 Apr 2022 10:58:30 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b="ABe8/cH+"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232245AbiCaHg4 (ORCPT + 99 others); Thu, 31 Mar 2022 03:36:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60976 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230313AbiCaHgy (ORCPT ); Thu, 31 Mar 2022 03:36:54 -0400 Received: from mail-lf1-x134.google.com (mail-lf1-x134.google.com [IPv6:2a00:1450:4864:20::134]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2CB7837A3D; Thu, 31 Mar 2022 00:35:06 -0700 (PDT) Received: by mail-lf1-x134.google.com with SMTP id t25so39903022lfg.7; Thu, 31 Mar 2022 00:35:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=message-id:date:mime-version:user-agent:content-language:from :subject:to:cc:content-transfer-encoding; bh=fygLA6FCziDtx1VVgJ2qLCPIBE2mOveDYVKTX7/lkjk=; b=ABe8/cH+f1dBFRiwJ4AEsV7aww+qn4+vKIMuvvv9tuCNrfepOW/5gy728C9WlHwSGv xpTlfYK6g5vAi28UNiMJOLB1fjXE8sMPi0c/5qZIDlyJgwUvg/klQwe8ZV+ScUudEU4/ rRFpNnD//uLJ56Gh4R0F7UBJZVUlsBv8Szbjn5ZojwunVTI+lWkN1gCUYTos7E6Weg3Q +x/OOUhKvsHzQ4dELQVUbORt/wHgyAf+enniNwuPh3ADeEwzUifAIyAs4UOdf9nGJ/jp 6K9dDZANzfnqn61QCv9YvEzM51D1mKBmU/pBjLChmdF1r/7EzlLr36TFrtM68CE2nPTv vaYg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent :content-language:from:subject:to:cc:content-transfer-encoding; bh=fygLA6FCziDtx1VVgJ2qLCPIBE2mOveDYVKTX7/lkjk=; b=aUqU5hO9kEP6o3kdyp18laLltoJP8En7wNY5cWxbWMtDIr7yIe+jBR1TsxPPN4LgNZ Hu0OgVWNswOBGyebuIUTsH4KNrX82e5sgrnkOEtl2Hh3rd5ZoobLupeKE2nWVziXzAVG 3Y9v6Zrxlb5YwNIsfNrcvWgkhRkkD8jvQCj7ExGONxWLrpCdwsDeKx0MeqJMtQDJjDgN BWzSjh/2KETlAJldEGxmG1v8IPg2ObaMZxpGkvs+0ZOzk3tovnM1fD5xq/E7IhJPOrEt C5MTF+8ZlZUkTGwFmJOv+3b2KFBfvosgddHsyL7QFhIGtp5fBe6uV+Y2/sBuNaWaVcvS mHFg== X-Gm-Message-State: AOAM531t7Q+QtgOYnMej3h/LxTlONmi8UWfzCKz9/jGfEg/FnQyxszhr yKmnTP+KqG4Ocvb881StucU= X-Received: by 2002:ac2:5bcb:0:b0:44a:1fd6:6b14 with SMTP id u11-20020ac25bcb000000b0044a1fd66b14mr10099860lfn.186.1648712101124; Thu, 31 Mar 2022 00:35:01 -0700 (PDT) Received: from [192.168.1.105] (235.132.246.94.ip4.artcom.pl. [94.246.132.235]) by smtp.gmail.com with ESMTPSA id y21-20020a2e9d55000000b0024aa6b3feb3sm1978389ljj.29.2022.03.31.00.35.00 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 31 Mar 2022 00:35:00 -0700 (PDT) Message-ID: <9ccce84f-3573-46bd-0444-e812ea2524a9@gmail.com> Date: Thu, 31 Mar 2022 09:36:36 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.7.0 Content-Language: en-US From: Piotr Chmura Subject: [PATCH v2] si2157: unknown chip version Si2147-A30 ROM 0x50 To: Thorsten Leemhuis Cc: robert Schlabbach , Mauro Carvalho Chehab , Linux Media Mailing List , Linux Kernel Mailing List , Antti Palosaari Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Fix firmware file names assignment in si2157 tuner, allow for running devices without firmware files needed. It's regression in kernel 5.17.0, worked fine in 5.16 series. device: 07ca:1871 AVerMedia Technologies, Inc. TD310 DVB-T/T2/C dongle modprobe gives error: unknown chip version Si2147-A30 ROM 0x50 Device initialization is interrupted. 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 Fix: 1. Rearrange fields in table si2157_tuners 2. Allow both firmware file names be NULL for devices defined with required == false Fixes: 1c35ba3bf972 ("media: si2157: use a different namespace for firmware") Link: https://bugzilla.kernel.org/show_bug.cgi?id=215726 Link: https://lore.kernel.org/lkml/5f660108-8812-383c-83e4-29ee0558d623@leemhuis.info/ Cc: stable@vger.kernel.org # 5.17.x Signed-of-by: Piotr Chmura Tested-by: Robert Schlabbach --- --- 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 @@ err_mutex_unlock:  }  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 @@ static int si2157_find_and_load_firmware          }      } -    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);