Message ID | 1344307634-11673-8-git-send-email-dheitmueller@kernellabs.com (mailing list archive) |
---|---|
State | Accepted, archived |
Headers |
Received: from mail.tu-berlin.de ([130.149.7.33]) by www.linuxtv.org with esmtp (Exim 4.72) (envelope-from <linux-media-owner@vger.kernel.org>) id 1SyZpu-00071q-8e for patchwork@linuxtv.org; Tue, 07 Aug 2012 04:47:58 +0200 X-tubIT-Incoming-IP: 209.132.180.67 Received: from vger.kernel.org ([209.132.180.67]) by mail.tu-berlin.de (exim-4.75/mailfrontend-4) with esmtp for <patchwork@linuxtv.org> id 1SyZpt-0002JB-Bk; Tue, 07 Aug 2012 04:47:58 +0200 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932512Ab2HGCry (ORCPT <rfc822;patchwork@linuxtv.org>); Mon, 6 Aug 2012 22:47:54 -0400 Received: from mail-vc0-f174.google.com ([209.85.220.174]:52727 "EHLO mail-vc0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932480Ab2HGCrx (ORCPT <rfc822; linux-media@vger.kernel.org>); Mon, 6 Aug 2012 22:47:53 -0400 Received: by mail-vc0-f174.google.com with SMTP id fk26so3432709vcb.19 for <linux-media@vger.kernel.org>; Mon, 06 Aug 2012 19:47:52 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references :x-gm-message-state; bh=qHoJI32AceIgqd6sqUsrl2+PX1eTLG1xJnJb5+AowYo=; b=DDpkuIzKEId8lIYOT/ucSfEbbnOIOiLKxzbPjBNY56eu8VsE29esS9YBd/zTJJ2EJd THLlDM5Tlw02lMG3HG8GkuSSXSlYpK84wip/CvkNJzw/L9YiLXAeelUEVyrcAeqfGAOi eHA1t0gixyEhMIx0GsW1cuJ8VugH9OE0uVZZhS3YLbYBJTpC9yP3YCRMWIVp6batp9Jg dLfi/1tRzAemDj1plUoy3sQ3E8TXihYIlhpe+u2GNKQziXFdgJDYBIPQpJwW+zMj36qL y+4SnwBocvYSLSrRKdiy9YZaFyBG3XBnn2A/Ckci4APEi7qWM2GoUA/jUt3zK0Bz0B9h 1n8Q== Received: by 10.52.21.99 with SMTP id u3mr8468944vde.56.1344307672823; Mon, 06 Aug 2012 19:47:52 -0700 (PDT) Received: from localhost.localdomain (pool-108-54-72-165.nycmny.fios.verizon.net. [108.54.72.165]) by mx.google.com with ESMTPS id e9sm17555638vdf.21.2012.08.06.19.47.51 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 06 Aug 2012 19:47:52 -0700 (PDT) From: Devin Heitmueller <dheitmueller@kernellabs.com> To: linux-media@vger.kernel.org Cc: Devin Heitmueller <dheitmueller@kernellabs.com> Subject: [PATCH 07/24] xc5000: properly report i2c write failures Date: Mon, 6 Aug 2012 22:46:57 -0400 Message-Id: <1344307634-11673-8-git-send-email-dheitmueller@kernellabs.com> X-Mailer: git-send-email 1.7.1 In-Reply-To: <1344307634-11673-1-git-send-email-dheitmueller@kernellabs.com> References: <1344307634-11673-1-git-send-email-dheitmueller@kernellabs.com> X-Gm-Message-State: ALoCoQlLvLr6Ff6AJXlP2YAFQP6EWmS1PbWxzohhkvRjtCYCOqxhgjca4oZUPRG9Ur/teHw+CkI0 Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: <linux-media.vger.kernel.org> X-Mailing-List: linux-media@vger.kernel.org X-PMX-Version: 5.6.1.2065439, Antispam-Engine: 2.7.2.376379, Antispam-Data: 2012.8.7.23921 X-PMX-Spam: Gauge=IIIIIIII, Probability=8%, Report=' HTML_00_01 0.05, HTML_00_10 0.05, BODYTEXTP_SIZE_3000_LESS 0, BODY_SIZE_1000_LESS 0, BODY_SIZE_2000_LESS 0, BODY_SIZE_5000_LESS 0, BODY_SIZE_7000_LESS 0, BODY_SIZE_900_999 0, DATE_TZ_NA 0, URI_ENDS_IN_HTML 0, __ANY_URI 0, __CP_URI_IN_BODY 0, __HAS_FROM 0, __HAS_MSGID 0, __HAS_X_MAILER 0, __HAS_X_MAILING_LIST 0, __MIME_TEXT_ONLY 0, __SANE_MSGID 0, __SUBJ_ALPHA_END 0, __TO_MALFORMED_2 0, __TO_NO_NAME 0, __URI_NO_WWW 0, __URI_NS ' |
Commit Message
Devin Heitmueller
Aug. 7, 2012, 2:46 a.m. UTC
The logic as written would *never* actually return an error condition, since
the loop would run until the counter hit zero but the check was for a value
less than zero.
Signed-off-by: Devin Heitmueller <dheitmueller@kernellabs.com>
---
drivers/media/common/tuners/xc5000.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
Comments
> I can't load firmware like error of below link. > > https://bugs.launchpad.net/ubuntu/+source/linux-firmware-nonfree/+bug/1263837 > > This error is related with this patch. This fix is right but above error is > created after this fix > because my device makes WatchDogTimer to 0 when load firmware. > Maybe it will be related with XREG_BUSY register but i can't check it. > > I removed this fix, but i have faced at other error with "xc5000: PLL not > running after fwload" > So i have commented like below. > > static const struct xc5000_fw_cfg xc5000a_1_6_114 = { > .name = XC5000A_FIRMWARE, > .size = 12401, > //.pll_reg = 0x806c, > }; > > Then, xc5000 device works well. > > I don't have xc5000 datasheet so i can't debug xc5000 driver anymore. Hi Joonyoung, Assuming this is the DViCO FusionHDTV7 device that uses the au0828/au8522, I suspect that what's happening here is your I2C controller is not stable. The I2C clock stretching done by the xc5000 often exposed bugs in various bridge drivers and the au0828 was no exception. I had to work around these hardware bugs in the au0828 driver but I made them specific to the HVR-950q since that was the only device I could test with. In other words, the xc5000 is most likely doing exactly what it is supposed to, and the increased robustness of the tuner driver with those two patches exposed intermittent I2C failures in au0828 that were previously being silently discarded (resulting in indeterminate behavior). I would recommending looking at the changes in au0828-cards.c for the HVR-950q and add the code necessary to make them also apply for the DVICO device, and that should resolve your problems (in particular the i2c_clk_divider field should be set). Devin
diff --git a/drivers/media/common/tuners/xc5000.c b/drivers/media/common/tuners/xc5000.c index f660e33..a7fa17e 100644 --- a/drivers/media/common/tuners/xc5000.c +++ b/drivers/media/common/tuners/xc5000.c @@ -341,7 +341,7 @@ static int xc_write_reg(struct xc5000_priv *priv, u16 regAddr, u16 i2cData) } } } - if (WatchDogTimer < 0) + if (WatchDogTimer <= 0) result = XC_RESULT_I2C_WRITE_FAILURE; return result;