From patchwork Sun Oct 15 18:54:52 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Scheller X-Patchwork-Id: 10007237 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 3813260235 for ; Sun, 15 Oct 2017 18:55:04 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1DF0722A6B for ; Sun, 15 Oct 2017 18:55:04 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id F3D3822B1F; Sun, 15 Oct 2017 18:55:03 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.5 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 388FC22A6B for ; Sun, 15 Oct 2017 18:55:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751261AbdJOSy5 (ORCPT ); Sun, 15 Oct 2017 14:54:57 -0400 Received: from mail-wm0-f66.google.com ([74.125.82.66]:34817 "EHLO mail-wm0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750971AbdJOSy4 (ORCPT ); Sun, 15 Oct 2017 14:54:56 -0400 Received: by mail-wm0-f66.google.com with SMTP id b189so6038834wmd.2 for ; Sun, 15 Oct 2017 11:54:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id; bh=YmceRtskU496ZWKTxEqt14RYF8YFonXeIU/OomlWHwE=; b=APA+EJnWSmjlslme3zDKxYkl8B0kazPsKMgs0kz18dBHMb6fkdWF6ymX+V4G1TLQWF 0s1Xo+UEL6uYu8DJQFlooaroRbAul0+dHyEkGhB2dGTY8Vr9WmOEjrd3UtAloaOiwVLM rPV7mHsumDbQoE1eS5C/ZboDM1amVq9ON/R4PHSDCMRYph04Wi2kUVgRRjeKDF1JaYp4 kbzbuT8V5/ES7Le+t+okxZqNRvxS4ePF7oGEdS8b8obwySdgzLcE8DrC20+aOFeXrc6H HCsfVuIdnWoUiY3lRc7AoV9F9bquuEk37YJlnpjwXVfteQPu4OvCL9CFsJoFDOrWz8PW 4viw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id; bh=YmceRtskU496ZWKTxEqt14RYF8YFonXeIU/OomlWHwE=; b=ZMfizazWIdEVn/Jqb0O0NyXAhKgz4gcyxCYBVdheLP6TKbuWu5YvAHfzphMjnV11eh VZ1hLbEQF/9xl2t0SrVgP0UiT7KCLOQgdy69zwyLZK2inH9VX+lLFh+12nnEotepwk3F Qke0O4L0SLPn5DmdLqnvUoYa8i27p8p9TLLWbhbnLVwIn6lUY/rrc7xvN/Fq8IYVVWOA TwoIkK7Cp88omdG57guDJsUWMec2vrsnhhwhbJNY7Ml7SEHPC8bLZPVSbLxQd0Y+H5q6 7o6GXCgJF0ZRpA8IhmnjKhWKIMFytWDvmag0Z6uN1qGVLZdmNhDbYqNZviaqLKi0yX9y WVoA== X-Gm-Message-State: AMCzsaU1o3VXbBiN1NaKQW9wx4MHhOAiNeJP96/1rmJW7ux0X5A1yrzQ pmTC7BvmcgLZm58Ln1NZJWnp0A== X-Google-Smtp-Source: AOwi7QDxJog7OF65KAKJJ6aZ8B/Uf/zxW4u3Al8wW0p1HyUn7M+MEPYxFGrbm8z7SeLSn3fAOt6NsQ== X-Received: by 10.223.148.38 with SMTP id 35mr7054508wrq.49.1508093695183; Sun, 15 Oct 2017 11:54:55 -0700 (PDT) Received: from dvbdev.wuest.de (ip-37-201-239-211.hsi13.unitymediagroup.de. [37.201.239.211]) by smtp.gmail.com with ESMTPSA id 31sm3415409wrm.0.2017.10.15.11.54.54 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 15 Oct 2017 11:54:54 -0700 (PDT) From: Daniel Scheller To: linux-media@vger.kernel.org, mchehab@kernel.org, mchehab@s-opensource.com Subject: [PATCH RESEND] media: mxl5xx: fix tuning logic Date: Sun, 15 Oct 2017 20:54:52 +0200 Message-Id: <20171015185452.13775-1-d.scheller.oss@gmail.com> X-Mailer: git-send-email 2.13.6 Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Mauro Carvalho Chehab The tuning logic is broken with regards to status report: it relies on a previously-cached value that may not be valid if retuned. Change the logic to always read the status. Signed-off-by: Mauro Carvalho Chehab Acked-by: Daniel Scheller --- Resend (ref. https://patchwork.linuxtv.org/patch/43541/) so this doesn't get lost - this fix really should go in. drivers/media/dvb-frontends/mxl5xx.c | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/drivers/media/dvb-frontends/mxl5xx.c b/drivers/media/dvb-frontends/mxl5xx.c index 676c96c216c3..4b449a6943c5 100644 --- a/drivers/media/dvb-frontends/mxl5xx.c +++ b/drivers/media/dvb-frontends/mxl5xx.c @@ -636,16 +636,9 @@ static int tune(struct dvb_frontend *fe, bool re_tune, if (r) return r; state->tune_time = jiffies; - return 0; } - if (*status & FE_HAS_LOCK) - return 0; - r = read_status(fe, status); - if (r) - return r; - - return 0; + return read_status(fe, status); } static enum fe_code_rate conv_fec(enum MXL_HYDRA_FEC_E fec)