Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1350380

[PATCH 2.6.32 21/55] tda1004x: only update the frontend properties if locked

Path csiph.com!news.mixmin.net!aioe.org!bofh.it!news.nic.it!robomod
From Willy Tarreau <w@1wt.eu>
Newsgroups linux.kernel
Subject [PATCH 2.6.32 21/55] tda1004x: only update the frontend properties if locked
Date Fri, 04 Mar 2016 17:20:02 +0100
Message-ID <r90Cm-R6-13@gated-at.bofh.it> (permalink)
References <r90sF-Ls-3@gated-at.bofh.it>
X-Original-To linux-kernel@vger.kernel.org, stable@vger.kernel.org
User-Agent quilt/0.63-1
MIME-Version 1.0
Content-Type text/plain; charset=ISO-8859-15
Sender robomod@news.nic.it
List-ID <linux-kernel.vger.kernel.org>
X-Mailing-List linux-kernel@vger.kernel.org
Approved robomod@news.nic.it
Lines 52
Organization linux.* mail to news gateway
X-Original-Cc Mauro Carvalho Chehab <mchehab@osg.samsung.com>, Ben Hutchings <ben@decadent.org.uk>, Willy Tarreau <w@1wt.eu>
X-Original-Date Fri, 04 Mar 2016 16:30:21 +0100
X-Original-Message-ID <20160304153001.623981917@1wt.eu>
X-Original-References <148ee355b419e9976ca727513a1405c8@local>
X-Original-Sender linux-kernel-owner@vger.kernel.org
Xref csiph.com linux.kernel:1350380

Show key headers only | View raw


2.6.32-longterm review patch.  If anyone has any objections, please let me know.

------------------

From: Mauro Carvalho Chehab <mchehab@osg.samsung.com>

commit e8beb02343e7582980c6705816cd957cf4f74c7a upstream.

The tda1004x was updating the properties cache before locking.
If the device is not locked, the data at the registers are just
random values with no real meaning.

This caused the driver to fail with libdvbv5, as such library
calls GET_PROPERTY from time to time, in order to return the
DVB stats.

Tested with a saa7134 card 78:
	ASUSTeK P7131 Dual, vendor PCI ID: 1043:4862

Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
[bwh: Backported to 3.2: adjust filename]
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
Signed-off-by: Willy Tarreau <w@1wt.eu>
---
 drivers/media/dvb/frontends/tda1004x.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/drivers/media/dvb/frontends/tda1004x.c b/drivers/media/dvb/frontends/tda1004x.c
index f2a8abe..97696c3 100644
--- a/drivers/media/dvb/frontends/tda1004x.c
+++ b/drivers/media/dvb/frontends/tda1004x.c
@@ -898,9 +898,18 @@ static int tda1004x_set_fe(struct dvb_frontend* fe,
 static int tda1004x_get_fe(struct dvb_frontend* fe, struct dvb_frontend_parameters *fe_params)
 {
 	struct tda1004x_state* state = fe->demodulator_priv;
+	int status;
 
 	dprintk("%s\n", __func__);
 
+	status = tda1004x_read_byte(state, TDA1004X_STATUS_CD);
+	if (status == -1)
+		return -EIO;
+
+	/* Only update the properties cache if device is locked */
+	if (!(status & 8))
+		return 0;
+
 	// inversion status
 	fe_params->inversion = INVERSION_OFF;
 	if (tda1004x_read_byte(state, TDA1004X_CONFC1) & 0x20)
-- 
1.7.12.2.21.g234cd45.dirty

Back to linux.kernel | Previous | Next | Find similar | Unroll thread


Thread

[PATCH 2.6.32 21/55] tda1004x: only update the frontend properties if  locked Willy Tarreau <w@1wt.eu> - 2016-03-04 17:20 +0100

csiph-web