From patchwork Mon Nov 23 13:19:10 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Patrick Boettcher X-Patchwork-Id: 62161 X-Patchwork-Delegate: dougsland@redhat.com Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id nANDJIUh004607 for ; Mon, 23 Nov 2009 13:19:19 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757294AbZKWNTL (ORCPT ); Mon, 23 Nov 2009 08:19:11 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1757290AbZKWNTL (ORCPT ); Mon, 23 Nov 2009 08:19:11 -0500 Received: from znsun1.ifh.de ([141.34.1.16]:42824 "EHLO znsun1.ifh.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757238AbZKWNTK (ORCPT ); Mon, 23 Nov 2009 08:19:10 -0500 Received: from pub1.ifh.de (pub1.ifh.de [141.34.15.191]) by znsun1.ifh.de (8.12.11.20060614/8.12.11) with ESMTP id nANDJAwx018456; Mon, 23 Nov 2009 14:19:10 +0100 (MET) Received: by pub1.ifh.de (Postfix, from userid 11503) id 5C841200066; Mon, 23 Nov 2009 14:19:10 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by pub1.ifh.de (Postfix) with ESMTP id 420291F0186; Mon, 23 Nov 2009 14:19:10 +0100 (CET) Date: Mon, 23 Nov 2009 14:19:10 +0100 (CET) From: Patrick Boettcher X-X-Sender: pboettch@pub1.ifh.de To: grafgrimm77@gmx.de cc: Linux Media Mailing List Subject: Re: dibusb-common.c FE_HAS_LOCK problem In-Reply-To: Message-ID: References: <20091107105614.7a51f2f5@x2.grafnetz> <20091121182514.61b39d23@x2.grafnetz> <20091123120310.5b10c9cc@x2.grafnetz> <20091123123338.7273255b@x2.grafnetz> User-Agent: Alpine 2.00 (LRH 1167 2008-08-23) MIME-Version: 1.0 X-Spam-Report: ALL_TRUSTED,AWL,BAYES_00 Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org diff -r 52da57b5e800 linux/drivers/media/dvb/dvb-usb/dibusb-common.c --- a/linux/drivers/media/dvb/dvb-usb/dibusb-common.c Thu Nov 19 17:15:37 2009 +0100 +++ b/linux/drivers/media/dvb/dvb-usb/dibusb-common.c Mon Nov 23 13:20:10 2009 +0100 @@ -142,8 +142,13 @@ } else if ((msg[i].flags & I2C_M_RD) == 0) { if (dibusb_i2c_msg(d, msg[i].addr, msg[i].buf,msg[i].len,NULL,0) < 0) break; - } else - break; + } else if (msg[i].addr != 0x50) { + /* 0x50 is the address of the eeprom - we need to protect it + * from dibusb's bad i2c implementation: reads without + * writing the offset before are forbidden */ + if (dibusb_i2c_msg(d, msg[i].addr, NULL, 0, msg[i].buf, msg[i].len) < 0) + break; + } } mutex_unlock(&d->i2c_mutex);