Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755173AbcCBBwP (ORCPT ); Tue, 1 Mar 2016 20:52:15 -0500 Received: from mail333.us4.mandrillapp.com ([205.201.137.77]:44579 "EHLO mail333.us4.mandrillapp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754887AbcCAXxd (ORCPT ); Tue, 1 Mar 2016 18:53:33 -0500 DomainKey-Signature: a=rsa-sha1; c=nofws; q=dns; s=mandrill; d=linuxfoundation.org; b=OgCzTpiTMX50RSn509KC2SH54mWJdy+W/PR4LHQPIGL+1AxZYJJ8YLDEeWcdH+F0YGpmZUMWNQ5L yDJ424rMQDMQCzZUxr+NRjuCd91QkQyEy3TMW030FCwdlseUDVII0bKdGa1eDAecseRVvjPGSu6O 01NBp2232A2XYnnrT2Q=; From: Greg Kroah-Hartman Subject: [PATCH 3.14 096/130] [media] tda1004x: only update the frontend properties if locked X-Mailer: git-send-email 2.7.2 To: Cc: Greg Kroah-Hartman , , Mauro Carvalho Chehab Message-Id: <20160301234503.223991305@linuxfoundation.org> In-Reply-To: <20160301234459.768886030@linuxfoundation.org> References: <20160301234459.768886030@linuxfoundation.org> X-Report-Abuse: Please forward a copy of this message, including all headers, to abuse@mandrill.com X-Report-Abuse: You can also report abuse here: http://mandrillapp.com/contact/abuse?id=30481620.fa7e9e2efd724526895fe6faebda1f30 X-Mandrill-User: md_30481620 Date: Tue, 01 Mar 2016 23:53:29 +0000 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1451 Lines: 47 3.14-stable review patch. If anyone has any objections, please let me know. ------------------ From: Mauro Carvalho Chehab 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 Signed-off-by: Greg Kroah-Hartman --- drivers/media/dvb-frontends/tda1004x.c | 9 +++++++++ 1 file changed, 9 insertions(+) --- a/drivers/media/dvb-frontends/tda1004x.c +++ b/drivers/media/dvb-frontends/tda1004x.c @@ -903,9 +903,18 @@ static int tda1004x_get_fe(struct dvb_fr { struct dtv_frontend_properties *fe_params = &fe->dtv_property_cache; 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)