Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp3560257pxb; Mon, 24 Jan 2022 12:13:43 -0800 (PST) X-Google-Smtp-Source: ABdhPJy/zZ12f6v7/mvaedI9bbgx6rCuviaNoi5cwsQThSvgHER6/AoT62t84te+UnNZtm7nCO1T X-Received: by 2002:a63:79c4:: with SMTP id u187mr12730553pgc.27.1643055223625; Mon, 24 Jan 2022 12:13:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643055223; cv=none; d=google.com; s=arc-20160816; b=lsWcgU7P6i9anItTIDBrNn6xZyETYHL5bhgRS+tf0NO4eGYU6hnbXSxtNiNT8gMW17 yLevsyWh7xM8SDGJCh7h5LEKNghAHONFmwjLc8xHCh49h5hsQ0JMV2CQLzAsD4PJMhj2 dp8Mm7JS63IAASF0iHMjPdbIXgaze5V0Pe50yzYU1y2pg/ujdOmQJ1z0OvPOSvIzCrig IyA5BkRhuPmYUQotjhhSX2AKhzO87OnUzBVhVJjx0lCXJiGjnGbpx3Iq8PBnlIZSzKKC +WUAg+BKFRu56fRw7NwdmzJY53vCHGYCQ2FgFLpmzhOigtlgSU22U1K0+lly+bJjqoXN guNQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=y587/JZAPp3v4njlwZxmofr/8ut7XbNlYjqAo89sb/k=; b=1KRnNV/HHJgCNCsWSSL2AUd+b56dMAxTJjj2u0LeQ8DvS7QUSxa2flnrl+/Osu813r wihk4QxBYgGpeJSQLw7bld3d4XjiOB7lknai5a7LXDHyC/ml9tilAeLxokXiOeWgbK+c gq7AIZNOIOVHXm5QYMxNjJzhAfktDhIrKf2oEkubkMZIcnt19gXniJVQ+I/d0u6gy3lw Zt+vDcNXhUNeImY7+0RlW0ttNyduhmHV9nrluiDQgPUHupl+pabYCk0WacZyTeEF86kt 5cfPNL0jupQGDenSVYX/Soqz5WDH9CVt0JVLnsRsrK+82F3E0Iu1mehmrsq9I2b9N1Ix fxEg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=jcQgnORZ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id u7si17567029plh.522.2022.01.24.12.13.29; Mon, 24 Jan 2022 12:13:43 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=jcQgnORZ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346878AbiAXTQi (ORCPT + 99 others); Mon, 24 Jan 2022 14:16:38 -0500 Received: from dfw.source.kernel.org ([139.178.84.217]:35056 "EHLO dfw.source.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345976AbiAXTEw (ORCPT ); Mon, 24 Jan 2022 14:04:52 -0500 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id DB83560010; Mon, 24 Jan 2022 19:04:51 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id B116FC340E8; Mon, 24 Jan 2022 19:04:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1643051091; bh=S7ZEIWzMdk4Sc8mk01LSm9diY0irORwMdlm88oUPVS4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=jcQgnORZX/03iGmftvoPct94vI+YfJTkR0RnQpuCH402oHGDybaBdnPYJW973Sw5x K8u++PV9RzV5SfF32SnVBdY5VtjnTrHJTjUJ2TY5mC04/ZvcfT9om2Dz8D/rVJf9XU w3EQpmk+rA8jIjS2nkUqCUv5JoemcqgE5tgwm45w= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Robert Schlabbach , Mauro Carvalho Chehab , Sasha Levin Subject: [PATCH 4.14 052/186] media: si2157: Fix "warm" tuner state detection Date: Mon, 24 Jan 2022 19:42:07 +0100 Message-Id: <20220124183938.804948234@linuxfoundation.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220124183937.101330125@linuxfoundation.org> References: <20220124183937.101330125@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Robert Schlabbach [ Upstream commit a6441ea29cb2c9314654e093a1cd8020b9b851c8 ] Commit e955f959ac52 ("media: si2157: Better check for running tuner in init") completely broke the "warm" tuner detection of the si2157 driver due to a simple endian error: The Si2157 CRYSTAL_TRIM property code is 0x0402 and needs to be transmitted LSB first. However, it was inserted MSB first, causing the warm detection to always fail and spam the kernel log with tuner initialization messages each time the DVB frontend device was closed and reopened: [ 312.215682] si2157 16-0060: found a 'Silicon Labs Si2157-A30' [ 312.264334] si2157 16-0060: firmware version: 3.0.5 [ 342.248593] si2157 16-0060: found a 'Silicon Labs Si2157-A30' [ 342.295743] si2157 16-0060: firmware version: 3.0.5 [ 372.328574] si2157 16-0060: found a 'Silicon Labs Si2157-A30' [ 372.385035] si2157 16-0060: firmware version: 3.0.5 Also, the reinitializations were observed disturb _other_ tuners on multi-tuner cards such as the Hauppauge WinTV-QuadHD, leading to missed or errored packets when one of the other DVB frontend devices on that card was opened. Fix the order of the property code bytes to make the warm detection work again, also reducing the tuner initialization message in the kernel log to once per power-on, as well as fixing the interference with other tuners. Link: https://lore.kernel.org/linux-media/trinity-2a86eb9d-6264-4387-95e1-ba7b79a4050f-1638392923493@3c-app-gmx-bap03 Fixes: e955f959ac52 ("media: si2157: Better check for running tuner in init") Reported-by: Robert Schlabbach Signed-off-by: Robert Schlabbach Signed-off-by: Mauro Carvalho Chehab Signed-off-by: Sasha Levin --- drivers/media/tuners/si2157.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/media/tuners/si2157.c b/drivers/media/tuners/si2157.c index c826997f54330..229fea019e99e 100644 --- a/drivers/media/tuners/si2157.c +++ b/drivers/media/tuners/si2157.c @@ -89,7 +89,7 @@ static int si2157_init(struct dvb_frontend *fe) dev_dbg(&client->dev, "\n"); /* Try to get Xtal trim property, to verify tuner still running */ - memcpy(cmd.args, "\x15\x00\x04\x02", 4); + memcpy(cmd.args, "\x15\x00\x02\x04", 4); cmd.wlen = 4; cmd.rlen = 4; ret = si2157_cmd_execute(client, &cmd); -- 2.34.1