Received: by 10.213.65.68 with SMTP id h4csp2117774imn; Sun, 8 Apr 2018 20:08:54 -0700 (PDT) X-Google-Smtp-Source: AIpwx49MiQeA7JinhknHwpaxQL+lMBEoo9yC4WQszVizxoQ5um7PnY5RpwVvUqEyVfxkuY/IN9Le X-Received: by 10.99.121.131 with SMTP id u125mr24319026pgc.48.1523243333957; Sun, 08 Apr 2018 20:08:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523243333; cv=none; d=google.com; s=arc-20160816; b=s0r6ueaNwUTR/9xy+4aSb8QXJQXe2g+1/vgqD58QTFPhCJD2uzeJthZilkpwAZubpD /lkcNnUl/OxzsMe1yu8ElbcCznZ4Ycpbzd7xyZ4UGb4YwPth2xofxYq1hgc/KI0x0Kpe dpaAWvbgA7Zv05SP8vPjpT5ZZCetCj0ekWdjnQsVQ5Jhgr3oCANGR67ZB+lvPiFt2QJy iFPJKStuc0eldqd/rSdE44X+oCt6NNPwZ0vtD8CHoQpHiqFM2m7acgjVjXMXaUzChNEx fwIoGy80rwY+m4NGMU/H4eJchWzvFxOw2WQYPHYHvqSrYU7U1Cw2cR48/OB++4Yw2eSB 8kZg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:content-transfer-encoding :spamdiagnosticmetadata:spamdiagnosticoutput:content-language :accept-language:in-reply-to:references:message-id:date:thread-index :thread-topic:subject:cc:to:from:dkim-signature :arc-authentication-results; bh=/0e1WDLrcr9A71fPuyWvzMNVGEQRAswhpq4qCzlKKAo=; b=WuXkCCqn0GcGKIemM3wizhJw6KCvUARtzBWCHlX+VFoSFqlesq/g2D6rGujyoy5mmj 8UkAwmEf9PJhmLcszPHwZFcAlEmDptco6namaUCag//YKl/KmGc1/3R9ExsaklZZz5HX S/kl/OWjDmA65rXpsEUc4jmvz1rGjKikfnN1wHOZYkg55waKIZsceOJyeQMMaj6qFPdC YZDXsAm5nx5tl8ejGqj8RuFVDDPWmSKiVlJeICKO6Ixk/rrugcj/sqbBc+LTlxmRMy7s rm0dvILtdi11CUP+cDf5mHsAbPooBOwWNVkxqi8JSlc6NME+4IY9XXFprsGZzPqUryJR A48Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@microsoft.com header.s=selector1 header.b=Y6udrNWl; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=microsoft.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k70si10568852pga.118.2018.04.08.20.08.17; Sun, 08 Apr 2018 20:08:53 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@microsoft.com header.s=selector1 header.b=Y6udrNWl; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=microsoft.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932380AbeDICQB (ORCPT + 99 others); Sun, 8 Apr 2018 22:16:01 -0400 Received: from mail-dm3nam03on0093.outbound.protection.outlook.com ([104.47.41.93]:60032 "EHLO NAM03-DM3-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1756097AbeDIAae (ORCPT ); Sun, 8 Apr 2018 20:30:34 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=/0e1WDLrcr9A71fPuyWvzMNVGEQRAswhpq4qCzlKKAo=; b=Y6udrNWlWwtalYmf3wz7d0SP1O7M4N5pXJRzkBcXJUQIZGl2LjoHPj6wXAUCHFBzA+WBhozEZqz9NrAsa9B5Hlmnvfs6L/PK1jFvCxKW1lXuXNlxDBKPIXvUWhCWjSqJrWw78uRdUK5LbR74fTbzOX0QfkpDt+rtmzXC0d7+AaA= Received: from DM5PR2101MB1032.namprd21.prod.outlook.com (52.132.128.13) by DM5PR2101MB0807.namprd21.prod.outlook.com (10.167.110.154) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.696.3; Mon, 9 Apr 2018 00:30:29 +0000 Received: from DM5PR2101MB1032.namprd21.prod.outlook.com ([fe80::8109:aef0:a777:7059]) by DM5PR2101MB1032.namprd21.prod.outlook.com ([fe80::8109:aef0:a777:7059%2]) with mapi id 15.20.0696.003; Mon, 9 Apr 2018 00:30:29 +0000 From: Sasha Levin To: "stable@vger.kernel.org" , "linux-kernel@vger.kernel.org" CC: Daniel Scheller , Mauro Carvalho Chehab , Sasha Levin Subject: [PATCH AUTOSEL for 4.9 141/293] media: dvb-frontends/cxd2841er: require STATE_ACTIVE_* for agc readout Thread-Topic: [PATCH AUTOSEL for 4.9 141/293] media: dvb-frontends/cxd2841er: require STATE_ACTIVE_* for agc readout Thread-Index: AQHTz5knD/t7gb0GBEG7i9l1syJYYA== Date: Mon, 9 Apr 2018 00:24:43 +0000 Message-ID: <20180409002239.163177-141-alexander.levin@microsoft.com> References: <20180409002239.163177-1-alexander.levin@microsoft.com> In-Reply-To: <20180409002239.163177-1-alexander.levin@microsoft.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [52.168.54.252] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1;DM5PR2101MB0807;7:qaNVtEYe3rms8/iT4eBsMWYgMXE4gP8xSJx8zesgyQAtfyV4OVBajDhrkHC4D1FCVB5oa53wMCDrloEjsfss5N26CVGb3rdh7w5D3+Kkcc3DsVNuNt1jYy/YFUYDcncz2zEmw9txwyU0djmSXzpABj0XAMmOx14eFT6LE57cM28Hw33Sluos/TlUtYmnbWFj34xHPtz+RoavTTqYZs2QAn3MN4fKbXShzg75GSVnt/GxFGEjP6xc5Cr/eFKj2CWM;20:ouJ0AsnTEc2yN69uEqO2bBBlW+uHhXWfGa8mOEA4kqD17Rvc0ZdlkFN5aNDrI5n7sJ7F9teRlG5m+/S6WSkhxPZhtmv2F2HR52N41zAW6rZUK3qhMM7R5Y64DE+X5YN9adDM+saIGdpa/JtjakxmKPtwkkGtAVfVyqIUQ4Gdq+M= x-ms-office365-filtering-ht: Tenant X-MS-Office365-Filtering-Correlation-Id: 1d4ccee7-824e-484c-aa3a-08d59db118ab x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:(7020095)(4652020)(48565401081)(5600026)(4604075)(3008032)(4534165)(4627221)(201703031133081)(201702281549075)(2017052603328)(7193020);SRVR:DM5PR2101MB0807; x-ms-traffictypediagnostic: DM5PR2101MB0807: authentication-results: spf=none (sender IP is ) smtp.mailfrom=Alexander.Levin@microsoft.com; x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(28532068793085)(89211679590171)(248736688235697); x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(8211001083)(61425038)(6040522)(2401047)(5005006)(8121501046)(93006095)(93001095)(10201501046)(3231221)(944501327)(52105095)(3002001)(6055026)(61426038)(61427038)(6041310)(20161123562045)(20161123558120)(20161123564045)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(6072148)(201708071742011);SRVR:DM5PR2101MB0807;BCL:0;PCL:0;RULEID:;SRVR:DM5PR2101MB0807; x-forefront-prvs: 0637FCE711 x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(39380400002)(39860400002)(396003)(366004)(376002)(346002)(199004)(189003)(14454004)(4326008)(54906003)(25786009)(53936002)(2900100001)(1076002)(3280700002)(6486002)(186003)(2616005)(68736007)(110136005)(11346002)(10090500001)(6116002)(107886003)(3846002)(36756003)(8676002)(72206003)(22452003)(66066001)(26005)(6512007)(478600001)(3660700001)(81156014)(86362001)(81166006)(86612001)(7736002)(305945005)(8936002)(10290500003)(6436002)(105586002)(6666003)(316002)(575784001)(59450400001)(76176011)(5660300001)(476003)(106356001)(2906002)(6506007)(446003)(2501003)(99286004)(5250100002)(486006)(102836004)(97736004)(22906009)(217873001);DIR:OUT;SFP:1102;SCL:1;SRVR:DM5PR2101MB0807;H:DM5PR2101MB1032.namprd21.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;A:1;MX:1; received-spf: None (protection.outlook.com: microsoft.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: rw3gHc+mKH6hhwjk+nm4UNqVMZWnl7OFjIancFGDw77DKYHqCdfZcDngKzqMayeci48KxIqGA/jBL/8eVNcl0g6rbrZg9yp3+i+/HChpANTdWYVW9IXSKL17M2J6y+BdXJBpwy4unqqUd6gAe+u+WtDjZAXYoA1sAQbcp8mOQHBNg2IMnj6cSn2I4Jkhwa422A2975BLd58HH+FWZm2Unrdg6QNL7lkuLPR+1z5lquO8xLbS10lZUhFWADvLqV3vTlQSNSYsRijqxPakj7jeXCqfHswmUTGQrNtWHVDInZyiCGYRZ9ouku0ojePjGRafvK/AWsNTyN/TwERitdYpn1KUJuMHjnqYhlgnYii33L7AMSqsLMXMfAU9Bms26f6i7T15yRD4XXfO0KZEEwbZqpwV1cfQJYa2tkCvFbujhDw= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: microsoft.com X-MS-Exchange-CrossTenant-Network-Message-Id: 1d4ccee7-824e-484c-aa3a-08d59db118ab X-MS-Exchange-CrossTenant-originalarrivaltime: 09 Apr 2018 00:24:43.2688 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 72f988bf-86f1-41af-91ab-2d7cd011db47 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR2101MB0807 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Daniel Scheller [ Upstream commit 8982735f8dd02096b75255e3c0a0df28aeaa9955 ] When the demod driver puts the demod into sleep or shutdown state and it's status is then polled e.g. via "dvb-fe-tool -m", i2c errors are printed to the kernel log. If the last delsys was DVB-T/T2: cxd2841er: i2c wr failed=3D-5 addr=3D6c reg=3D00 len=3D1 cxd2841er: i2c rd failed=3D-5 addr=3D6c reg=3D26 and if it was DVB-C: cxd2841er: i2c wr failed=3D-5 addr=3D6c reg=3D00 len=3D1 cxd2841er: i2c rd failed=3D-5 addr=3D6c reg=3D49 This happens when read_status unconditionally calls into the read_signal_strength() function which triggers the read_agc_gain_*() functions, where these registered are polled. This isn't a critical thing since when the demod is active again, no more such errors are logged, however this might make users suspecting defects. Fix this by requiring STATE_ACTIVE_* in priv->state. If it isn't in any active state, additionally set the strength scale to NOT_AVAILABLE. Signed-off-by: Daniel Scheller Signed-off-by: Mauro Carvalho Chehab Signed-off-by: Sasha Levin --- drivers/media/dvb-frontends/cxd2841er.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/media/dvb-frontends/cxd2841er.c b/drivers/media/dvb-fr= ontends/cxd2841er.c index b97647cd7dc6..8c175d959038 100644 --- a/drivers/media/dvb-frontends/cxd2841er.c +++ b/drivers/media/dvb-frontends/cxd2841er.c @@ -3210,7 +3210,10 @@ static int cxd2841er_get_frontend(struct dvb_fronten= d *fe, else if (priv->state =3D=3D STATE_ACTIVE_TC) cxd2841er_read_status_tc(fe, &status); =20 - cxd2841er_read_signal_strength(fe); + if (priv->state =3D=3D STATE_ACTIVE_TC || priv->state =3D=3D STATE_ACTIVE= _S) + cxd2841er_read_signal_strength(fe); + else + p->strength.stat[0].scale =3D FE_SCALE_NOT_AVAILABLE; =20 if (status & FE_HAS_LOCK) { cxd2841er_read_snr(fe); --=20 2.15.1