From patchwork Sat Dec 28 12:16:10 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mauro Carvalho Chehab X-Patchwork-Id: 3413721 Return-Path: X-Original-To: patchwork-linux-media@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 77B9F9F37A for ; Sat, 28 Dec 2013 12:16:56 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id A6A762012B for ; Sat, 28 Dec 2013 12:16:55 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 161BF2015D for ; Sat, 28 Dec 2013 12:16:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755284Ab3L1MQv (ORCPT ); Sat, 28 Dec 2013 07:16:51 -0500 Received: from bombadil.infradead.org ([198.137.202.9]:50217 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755250Ab3L1MQ3 (ORCPT ); Sat, 28 Dec 2013 07:16:29 -0500 Received: from [177.28.171.132] (helo=smtp.w2.samsung.com) by bombadil.infradead.org with esmtpsa (Exim 4.80.1 #2 (Red Hat Linux)) id 1Vwsof-0002UW-9j; Sat, 28 Dec 2013 12:16:29 +0000 Received: from mchehab by smtp.w2.samsung.com with local (Exim 4.80.1) (envelope-from ) id 1VwsoU-0007t6-Tj; Sat, 28 Dec 2013 10:16:18 -0200 From: Mauro Carvalho Chehab Cc: Mauro Carvalho Chehab , Linux Media Mailing List , Mauro Carvalho Chehab Subject: [PATCH v3 18/24] em28xx: improve I2C timeout error message Date: Sat, 28 Dec 2013 10:16:10 -0200 Message-Id: <1388232976-20061-19-git-send-email-mchehab@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1388232976-20061-1-git-send-email-mchehab@redhat.com> References: <1388232976-20061-1-git-send-email-mchehab@redhat.com> To: unlisted-recipients:; (no To-header on input) Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Spam-Status: No, score=-7.5 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Mauro Carvalho Chehab Since sometimes em28xx is returning 0x02 or 0x04 at the I2C status register, output what's the returned status: [ 1090.939820] em2882/3 #0: write to i2c device at 0xc2 timed out (ret=0x04) [ 1090.939826] xc2028 19-0061: Error on line 1290: -5 [ 1091.140136] em2882/3 #0: write to i2c device at 0xc2 timed out (ret=0x04) [ 1091.140155] xc2028 19-0061: Error on line 1290: -5 [ 1091.828622] em2882/3 #0: write to i2c device at 0xc2 timed out (ret=0x02) [ 1091.828625] xc2028 19-0061: i2c input error: rc = -5 (should be 2) [ 1091.928731] em2882/3 #0: write to i2c device at 0xc2 timed out (ret=0x02) [ 1091.928734] xc2028 19-0061: i2c input error: rc = -5 (should be 2) As that may help to latter improve the code. Also, as those errors are now present, remove that bogus comment that only 0x00 and 0x10 values are present. Signed-off-by: Mauro Carvalho Chehab --- drivers/media/usb/em28xx/em28xx-i2c.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/drivers/media/usb/em28xx/em28xx-i2c.c b/drivers/media/usb/em28xx/em28xx-i2c.c index d972e2f67214..420fddf7da3a 100644 --- a/drivers/media/usb/em28xx/em28xx-i2c.c +++ b/drivers/media/usb/em28xx/em28xx-i2c.c @@ -209,11 +209,6 @@ retry: return ret; } msleep(5); - /* - * NOTE: do we really have to wait for success ? - * Never seen anything else than 0x00 or 0x10 - * (even with high payload) ... - */ } if (ret == 0x10) { @@ -221,7 +216,8 @@ retry: addr); return -ENODEV; } - em28xx_warn("write to i2c device at 0x%x timed out\n", addr); + em28xx_warn("write to i2c device at 0x%x timed out (ret=0x%02x)\n", + addr, ret); return -EIO; }