Linux Media Controller development
 help / color / mirror / Atom feed
From: Patrick Boettcher <pboettcher@kernellabs.com>
To: grafgrimm77@gmx.de
Cc: Linux Media Mailing List <linux-media@vger.kernel.org>
Subject: Re: dibusb-common.c FE_HAS_LOCK problem
Date: Mon, 23 Nov 2009 14:19:10 +0100 (CET)	[thread overview]
Message-ID: <alpine.LRH.2.00.0911231418350.14263@pub1.ifh.de> (raw)
In-Reply-To: <alpine.LRH.2.00.0911231321270.14263@pub1.ifh.de>

[-- Attachment #1: Type: TEXT/PLAIN, Size: 969 bytes --]

On Mon, 23 Nov 2009, Patrick Boettcher wrote:

> On Mon, 23 Nov 2009, grafgrimm77@gmx.de wrote:
>> [..]
>> ----- hello stupid I2C access ----
>> Pid: 255, comm: khubd Tainted: P       A   2.6.31.6 #1
>> Call Trace:
>> [<ffffffffa0042292>] ? dibusb_i2c_xfer+0xe2/0x130 [dvb_usb_dibusb_common]
>> [<ffffffff81341dc1>] ? i2c_transfer+0x91/0xe0
>> [<ffffffffa0059081>] ? dib3000_write_reg+0x51/0x70 [dib3000mb]
>> [<ffffffffa00855c9>] ? dvb_pll_attach+0xa9/0x238 [dvb_pll]
>> [..]
>
> Voila.
>
> This is the access with makes the dvb-pll-driver not create the tuner driver.
>
> This is (I forgot the correct name) read-without-write-i2caccess. It is bad 
> handled by the dibusb-driver and it can destroy the eeprom on the USB side.
>
> Please try whether the attached patch fixes the whole situation for you.
>
> If so, please send back a line like this:
>
> Tested-by: Your name <email>

The patch attached.

--

Patrick Boettcher - Kernel Labs
http://www.kernellabs.com/

[-- Attachment #2: Type: TEXT/PLAIN, Size: 776 bytes --]

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);

  reply	other threads:[~2009-11-23 13:19 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-11-07  9:56 dibusb-common.c FE_HAS_LOCK problem Mario Bachmann
2009-11-19 15:37 ` Patrick Boettcher
2009-11-21 17:25   ` grafgrimm77
2009-11-23  9:01     ` Patrick Boettcher
2009-11-23 11:03       ` Mario Bachmann
2009-11-23 11:11         ` Patrick Boettcher
2009-11-23 11:33           ` grafgrimm77
2009-11-23 12:24             ` Patrick Boettcher
2009-11-23 13:19               ` Patrick Boettcher [this message]
2009-11-23 13:41                 ` grafgrimm77

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=alpine.LRH.2.00.0911231418350.14263@pub1.ifh.de \
    --to=pboettcher@kernellabs.com \
    --cc=grafgrimm77@gmx.de \
    --cc=linux-media@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox