Ross wrote:
Starting from 0.3.6o (happens even with 0.3.7a), my machine
spontaneously reboots when loading ivtv. After the reboot however, the
problem does not occur until I cold boot again.
I have a PVR-500 MCE, running on debian stable (sarge). I'm running
sid kernel 2.6.12-1-k7. I've also tried 2.6.11 with no luck. I've
managed to track this back to Bryan's patch: "Convert wm8775 and
saa7115 to smbus", specifically the wm8775 part of it.
Jul 23 17:34:19 mythbe kernel: cx25840: starting probe for adapter SMBus Via
Pro adapter at 0400 (0x0)
Jul 23 17:34:19 mythbe kernel: cx25840: starting probe for adapter ivtv i2c
driver #0 (0x10005)
Jul 23 17:34:21 mythbe kernel: i2c_adapter i2c-0: I2C level transfers not
supported
Excellent bug report! I didn't even have to do any poking around,
asking a ton of questions, or diffing ivtv versions to tell exactly what
your problem is. Here's what's going on:
-- In the old ivtv version, the wm8775 module would load, detect a chip
on i2c-0 0x1b and try to set it up using an i2c-level write. Hint:
that's probably not a wm8775 on your motherboard. This would fail
because i2c-0 is actually your SMBus Via Pro host bus. Thank goodness
we couldn't write to it, that could cause your machine to reboot itself!
-- In the new wm8775 module, we don't need a raw i2c-level write any
more, the wm8775 is detected on i2c-0 0x1b, and the Via Pro SMBus lets
us write all we want to whatever is on 0x1b on your motherboard.
Bleep! Reboot.
I'll get to fixing this right now.
1. The easiest way would be to add an i2c_enable flag but that will get
confusing again, considering the other modules increment on finding a
ivtv card, this would increment on finding any SMBus chips.
2. I could check in the probe to look for default register values, but
that would probably fail if the module had been loaded once before (and
I don't think doing a RESET write in the probe is a good idea).
3. I could change the probe to only look on ivtv cards, but that would
prevent the module from being able to be used anywhere else.
I think I'm just going to do #3 for now, since I can't find a better way
to do it. Any other ideas are welcome.
PS - And here's the patch to do that!
Index: driver/wm8775.c
===================================================================
--- driver/wm8775.c (revision 343)
+++ driver/wm8775.c (working copy)
@@ -562,9 +562,12 @@
static int attach_adapter(struct i2c_adapter *adapter)
{
- DEB(1, "starting probe for adapter %s (0x%x)",
- adapter->name, adapter->id);
- return i2c_probe(adapter, &addr_data, &detect_client);
+ if (adapter->id == (I2C_ALGO_BIT | I2C_HW_B_BT848)) {
+ DEB(1, "starting probe for adapter %s (0x%x)",
+ adapter->name, adapter->id);
+ return i2c_probe(adapter, &addr_data, &detect_client);
+ }
+
return 0;
}