diff mbox

v3.5 Oops in i2c_algo_bit.c:bit_xfer+0x23/0x870: i915 or i2c?

Message ID e6945e875aa0667550285cd5da6d473f@bwidawsk.net (mailing list archive)
State Not Applicable
Headers show

Commit Message

Ben Widawsky Aug. 12, 2012, 11:47 p.m. UTC
On 2012-08-08 21:50, George Spelvin wrote:
> I'm trying to run a v3.5 kernel (plus some -stable patches from Ted 
> Ts'o) on
> an Ubuntu system.  Things are generally working except for the 
> following
> Oops on each boot, which prevents the graphics system from loading.
>
> [   36.187972] [drm] Initialized drm 1.1.0 20060810
> [   36.230306] kvm: VM_EXIT_LOAD_IA32_PERF_GLOBAL_CTRL does not work
> properly. Using workaround
> [   36.487606] i915 0000:00:02.0: setting latency timer to 64
> [   36.555464] [drm] GMBUS [i915 gmbus ssc] timed out, falling back
> to bit banging on pin 0
> [   36.555490] BUG: unable to handle kernel NULL pointer dereference
> at 0000000000000028
> [   36.555626] IP: [<ffffffffa01807b3>] bit_xfer+0x23/0x870 
> [i2c_algo_bit]
> [   36.555701] PGD 212cb0067 PUD 212caf067 PMD 0
> [   36.555803] Oops: 0000 [#1] SMP
> [   36.555885] CPU 3
> [   36.555907] Modules linked in: snd_seq_midi joydev i915(+)
> snd_rawmidi snd_seq_midi_event snd_seq drm_kms_helper snd_timer
> snd_seq_device kvm_intel drm kvm snd serio_raw soundcore i2c_algo_bit
> snd_page_alloc lpc_ich video mei microcode mac_hid eeprom it87
> hwmon_vid coretemp lp parport raid10 raid456 async_pq async_xor
> firewire_ohci firewire_core xor async_memcpy async_raid6_recov
> hid_microsoft floppy crc_itu_t r8169 pata_jmicron usbhid hid mptsas
> mptscsih mptbase scsi_transport_sas raid6_pq async_tx raid1 raid0
> multipath linear
> [   36.557232]
> [   36.557271] Pid: 623, comm: modprobe Not tainted 3.5.0 #3 Gigabyte
> Technology Co., Ltd. H57M-USB3/H57M-USB3
> [   36.557398] RIP: 0010:[<ffffffffa01807b3>]  [<ffffffffa01807b3>]
> bit_xfer+0x23/0x870 [i2c_algo_bit]
> [   36.557493] RSP: 0000:ffff880212c6d648  EFLAGS: 00010296
> [   36.557544] RAX: ffff88021222c030 RBX: ffff880212c6d7e8 RCX:
> 0000000000000000
> [   36.557599] RDX: 0000000000000001 RSI: ffff880212c6d7e8 RDI:
> ffff88021222c030
> [   36.557655] RBP: ffff880212c6d6c8 R08: 0000000000000402 R09:
> 0000000000000000
> [   36.557710] R10: 0000000000000000 R11: 0000000000000006 R12:
> 0000000000000001
> [   36.557766] R13: ffff880212c6dfd8 R14: 0000000000000001 R15:
> ffff88021222c030
> [   36.557822] FS:  00007f5a7b85b700(0000) GS:ffff88021fcc0000(0000)
> knlGS:0000000000000000
> [   36.557899] CS:  0010 DS: 0000 ES: 0000 CR0: 000000008005003b
> [   36.557950] CR2: 0000000000000028 CR3: 0000000212cad000 CR4:
> 00000000000007e0
> [   36.558006] DR0: 0000000000000000 DR1: 0000000000000000 DR2:
> 0000000000000000
> [   36.558062] DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7:
> 0000000000000400
> [   36.558119] Process modprobe (pid: 623, threadinfo
> ffff880212c6c000, task ffff88020fdf5b80)
> [   36.558197] Stack:
> [   36.558239]  0000000000000001 ffff880212c6dfd8 0000000000000001
> 000000011222c000
> [   36.558380]  ffff880212c6d6c8 ffffffff8166341e ffff88020ff6ca72
> 000c510c00000018
> [   36.558523]  ffff880212c6d6d8 ffff880212c6d698 0000000000000082
> ffff880212c6d7e8
> [   36.558671] Call Trace:
> [   36.558719]  [<ffffffff8166341e>] ? printk+0x61/0x63
> [   36.558790]  [<ffffffffa02e5a0b>] gmbus_xfer+0x56b/0x6f0 [i915]
> [   36.558847]  [<ffffffff814ee7dc>] i2c_transfer+0x9c/0xe0
> [   36.558899]  [<ffffffff811be91b>] ? ep_poll_callback+0x10b/0x150
> [   36.558953]  [<ffffffff814ee976>] 
> i2c_smbus_xfer_emulated+0x156/0x5d0
> [   36.559010]  [<ffffffff81321d25>] ? idr_get_empty_slot+0x115/0x320
> [   36.559064]  [<ffffffff814eefb3>] i2c_smbus_xfer+0x113/0x130
> [   36.559118]  [<ffffffff8166e51e>] ? _raw_spin_lock+0xe/0x20
> [   36.559173]  [<ffffffff81642fd9>] ? klist_next+0x89/0x110
> [   36.559225]  [<ffffffff814ef61b>] i2c_default_probe+0xeb/0x130
> [   36.559279]  [<ffffffff814ee18b>] ? i2c_check_addr_busy+0x3b/0x60
> [   36.559332]  [<ffffffff814f077b>] i2c_do_add_adapter+0x1bb/0x290
> [   36.559382]  [<ffffffff811ed1cb>] ? 
> sysfs_do_create_link+0xeb/0x200
> [   36.559433]  [<ffffffff81411897>] ? put_device+0x17/0x20
> [   36.559482]  [<ffffffff814f0880>] ? __process_new_driver+0x30/0x30
> [   36.559535]  [<ffffffff814f0892>] __process_new_adapter+0x12/0x20
> [   36.559590]  [<ffffffff814140ee>] bus_for_each_drv+0x4e/0xa0
> [   36.559642]  [<ffffffff814f029d>] i2c_register_adapter+0x16d/0x270
> [   36.559696]  [<ffffffff814f0443>] i2c_add_adapter+0xa3/0xb0
> [   36.559759]  [<ffffffffa02e5cfc>] intel_setup_gmbus+0xcc/0x1f0 
> [i915]
> [   36.559821]  [<ffffffffa02a938c>] i915_driver_load+0x2ac/0xb90 
> [i915]
> [   36.559882]  [<ffffffffa03f1b41>] ? drm_get_minor+0x261/0x300 
> [drm]
> [   36.559940]  [<ffffffffa03f4236>] drm_get_pci_dev+0x186/0x2d0 
> [drm]
> [   36.559995]  [<ffffffff8103c3e9>] ? 
> default_spin_lock_flags+0x9/0x10
> [   36.560060]  [<ffffffffa02f2142>] i915_pci_probe+0x16/0x20 [i915]
> [   36.560115]  [<ffffffff813522ac>] local_pci_probe+0x5c/0xd0
> [   36.560168]  [<ffffffff81352431>] pci_device_probe+0x111/0x120
> [   36.560221]  [<ffffffff81415ede>] driver_probe_device+0x7e/0x220
> [   36.560274]  [<ffffffff8141612b>] __driver_attach+0xab/0xb0
> [   36.560327]  [<ffffffff81416080>] ? 
> driver_probe_device+0x220/0x220
> [   36.560375]  [<ffffffff81414195>] bus_for_each_dev+0x55/0x90
> [   36.560421]  [<ffffffffa0323000>] ? 0xffffffffa0322fff
> [   36.560470]  [<ffffffff814158de>] driver_attach+0x1e/0x20
> [   36.560522]  [<ffffffff81415598>] bus_add_driver+0x198/0x270
> [   36.560573]  [<ffffffffa0323000>] ? 0xffffffffa0322fff
> [   36.560625]  [<ffffffff814167f7>] driver_register+0x77/0x150
> [   36.560677]  [<ffffffffa0323000>] ? 0xffffffffa0322fff
> [   36.560729]  [<ffffffff8135110e>] __pci_register_driver+0x5e/0xe0
> [   36.560784]  [<ffffffffa0323000>] ? 0xffffffffa0322fff
> [   36.560839]  [<ffffffffa03f449a>] drm_pci_init+0x11a/0x130 [drm]
> [   36.560892]  [<ffffffffa0323000>] ? 0xffffffffa0322fff
> [   36.560949]  [<ffffffffa032308b>] i915_init+0x8b/0x8d [i915]
> [   36.561004]  [<ffffffff8100212a>] do_one_initcall+0x12a/0x180
> [   36.561057]  [<ffffffff810af280>] sys_init_module+0x10b0/0x1f40
> [   36.561111]  [<ffffffff810ab760>] ? free_notes_attrs+0x60/0x60
> [   36.561165]  [<ffffffff81676769>] system_call_fastpath+0x16/0x1b
> [   36.561218] Code: 5d c3 45 31 ff eb e9 90 55 48 89 e5 41 57 41 56
> 41 55 41 54 53 48 83 ec 58 66 66 66 66 90 48 8b 4f 18 49 89 ff 48 89
> f3 89 55 9c <48> 8b 41 28 48 89 4d 90 48 85 c0 74 0c ff d0 85 c0 89 
> c1
> 0f 88
> [   36.562478] RIP  [<ffffffffa01807b3>] bit_xfer+0x23/0x870 
> [i2c_algo_bit]
> [   36.562544]  RSP <ffff880212c6d648>
> [   36.562584] CR2: 0000000000000028
> [   36.562667] ---[ end trace f73eb7bcfaa57c45 ]---
>
> As far as I can tell, the passed i2c_adap->algo_data is NULL,
> so the fetch of adap->pre_xfer is oopsing.
>
> Unfortunately, I'm trying to run ext4 + metadata_csum, which requires
> 3.5+patches.  I don't see anything relevant on the mailing list.
> Do any DRM hackers have any ideas what's up?
>
> System is an i3-530 with 8GiB of RAM.  (Its primary job is
> file server, but the display also gets used sometime.)
>
> Thanks!
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/dri-devel


Adding intel-gfx.

I'm not aware of a clean way to force disable gmbus in i915, but you 
can try this in the meanwhile:

Comments

Daniel Vetter Aug. 13, 2012, 2:15 p.m. UTC | #1
On Sun, Aug 12, 2012 at 11:49:22PM -0400, George Spelvin wrote:
> (Bringing this back to the mailing lists after a bit of uninteresting private
> conversation.)
> 
> > Honestly, I think we need a way to force disable gmbus with a module 
> > parameter or something anyway. It's not the first time gmbus has been 
> > implicated with an issue. Maybe it even exists already, but I couldn't 
> > find this. So if you confirm that fixes the problem for you on the ml, 
> > at least maybe such a patch will be the result.
> >
> > If you feel it's a software bug (which I agree it seems likely), a
> > bisect is always much appreciated. Personally, I'll usually step back
> > major releases until something works, or I hit 3.2ish. Even knowing it
> > never worked through 3.2 is helpful.
> 
> It's a friend's machine, which I normally only have remote access to,
> so it's a bit pf a pain, but I can manage.  I just thought a basic
> i3 motherboard was so common I couldn't possibly be the only one with
> this problem.
> 
> Here's the 3.2 dmesg showing the fallback working, but this is an
> Ubuntu-patched kernel (linux-image-3.2.0-29-generic) that may be a fair
> distance from stock:

One thing of interest would be the exact .config you use to build the
kernel and the output of lsmod (after the kernel crashed). I guess the
issue is with the combination of drivers you have (i2c_detect in the
calltrace calls back into other registered i2c drivers ...).

Yours, Daniel

> 
> [   44.401124] [drm] Initialized drm 1.1.0 20060810
> [   44.471549] i915 0000:00:02.0: PCI INT A -> GSI 16 (level, low) -> IRQ 16
> [   44.471553] i915 0000:00:02.0: setting latency timer to 64
> [   44.555865] [drm] GMBUS timed out, falling back to bit banging on pin 0 [i915 gmbus disabled]
> [   44.611882] [drm] GMBUS timed out, falling back to bit banging on pin 0 [i915 gmbus disabled]
> [   44.667876] [drm] GMBUS timed out, falling back to bit banging on pin 0 [i915 gmbus disabled]
> [   44.723831] [drm] GMBUS timed out, falling back to bit banging on pin 0 [i915 gmbus disabled]
> [   44.779841] [drm] GMBUS timed out, falling back to bit banging on pin 0 [i915 gmbus disabled]
> [   44.835854] [drm] GMBUS timed out, falling back to bit banging on pin 0 [i915 gmbus disabled]
> [   44.895843] [drm] GMBUS timed out, falling back to bit banging on pin 0 [i915 gmbus disabled]
> [   44.951836] [drm] GMBUS timed out, falling back to bit banging on pin 0 [i915 gmbus disabled]
> [   45.007798] [drm] GMBUS timed out, falling back to bit banging on pin 0 [i915 gmbus ssc]
> [   45.063716] [drm] GMBUS timed out, falling back to bit banging on pin 0 [i915 gmbus ssc]
> [   45.119776] [drm] GMBUS timed out, falling back to bit banging on pin 0 [i915 gmbus ssc]
> [   45.175716] [drm] GMBUS timed out, falling back to bit banging on pin 0 [i915 gmbus ssc]
> [   45.231689] [drm] GMBUS timed out, falling back to bit banging on pin 0 [i915 gmbus ssc]
> [   45.287696] [drm] GMBUS timed out, falling back to bit banging on pin 0 [i915 gmbus ssc]
> [   45.343704] [drm] GMBUS timed out, falling back to bit banging on pin 0 [i915 gmbus ssc]
> [   45.399667] [drm] GMBUS timed out, falling back to bit banging on pin 0 [i915 gmbus ssc]
> [   45.455651] [drm] GMBUS timed out, falling back to bit banging on pin 0 [i915 gmbus vga]
> [   45.511629] [drm] GMBUS timed out, falling back to bit banging on pin 0 [i915 gmbus vga]
> [   45.567581] [drm] GMBUS timed out, falling back to bit banging on pin 0 [i915 gmbus vga]
> [   45.623645] [drm] GMBUS timed out, falling back to bit banging on pin 0 [i915 gmbus vga]
> [   45.679546] [drm] GMBUS timed out, falling back to bit banging on pin 0 [i915 gmbus vga]
> [   45.735614] [drm] GMBUS timed out, falling back to bit banging on pin 0 [i915 gmbus vga]
> [   45.791596] [drm] GMBUS timed out, falling back to bit banging on pin 0 [i915 gmbus vga]
> [   45.847533] [drm] GMBUS timed out, falling back to bit banging on pin 0 [i915 gmbus vga]
> [   45.903517] [drm] GMBUS timed out, falling back to bit banging on pin 0 [i915 gmbus panel]
> [   45.959547] [drm] GMBUS timed out, falling back to bit banging on pin 0 [i915 gmbus panel]
> [   46.015492] [drm] GMBUS timed out, falling back to bit banging on pin 0 [i915 gmbus panel]
> [   46.071473] [drm] GMBUS timed out, falling back to bit banging on pin 0 [i915 gmbus panel]
> [   46.127430] [drm] GMBUS timed out, falling back to bit banging on pin 0 [i915 gmbus panel]
> [   46.183447] [drm] GMBUS timed out, falling back to bit banging on pin 0 [i915 gmbus panel]
> [   46.239425] [drm] GMBUS timed out, falling back to bit banging on pin 0 [i915 gmbus panel]
> [   46.295407] [drm] GMBUS timed out, falling back to bit banging on pin 0 [i915 gmbus panel]
> [   46.351401] [drm] GMBUS timed out, falling back to bit banging on pin 0 [i915 gmbus dpc]
> [   46.407382] [drm] GMBUS timed out, falling back to bit banging on pin 0 [i915 gmbus dpc]
> [   46.463363] [drm] GMBUS timed out, falling back to bit banging on pin 0 [i915 gmbus dpc]
> [   46.519347] [drm] GMBUS timed out, falling back to bit banging on pin 0 [i915 gmbus dpc]
> [   46.575302] [drm] GMBUS timed out, falling back to bit banging on pin 0 [i915 gmbus dpc]
> [   46.631320] [drm] GMBUS timed out, falling back to bit banging on pin 0 [i915 gmbus dpc]
> [   46.687360] [drm] GMBUS timed out, falling back to bit banging on pin 0 [i915 gmbus dpc]
> [   46.743300] [drm] GMBUS timed out, falling back to bit banging on pin 0 [i915 gmbus dpc]
> [   46.799250] [drm] GMBUS timed out, falling back to bit banging on pin 0 [i915 gmbus dpb]
> [   46.855292] [drm] GMBUS timed out, falling back to bit banging on pin 0 [i915 gmbus dpb]
> [   46.911250] [drm] GMBUS timed out, falling back to bit banging on pin 0 [i915 gmbus dpb]
> [   46.967250] [drm] GMBUS timed out, falling back to bit banging on pin 0 [i915 gmbus dpb]
> [   47.023258] [drm] GMBUS timed out, falling back to bit banging on pin 0 [i915 gmbus dpb]
> [   47.079206] [drm] GMBUS timed out, falling back to bit banging on pin 0 [i915 gmbus dpb]
> [   47.135232] [drm] GMBUS timed out, falling back to bit banging on pin 0 [i915 gmbus dpb]
> [   47.191163] [drm] GMBUS timed out, falling back to bit banging on pin 0 [i915 gmbus dpb]
> [   47.247148] [drm] GMBUS timed out, falling back to bit banging on pin 0 [i915 gmbus reserved]
> [   47.303186] [drm] GMBUS timed out, falling back to bit banging on pin 0 [i915 gmbus reserved]
> [   47.359091] [drm] GMBUS timed out, falling back to bit banging on pin 0 [i915 gmbus reserved]
> [   47.415157] [drm] GMBUS timed out, falling back to bit banging on pin 0 [i915 gmbus reserved]
> [   47.471062] [drm] GMBUS timed out, falling back to bit banging on pin 0 [i915 gmbus reserved]
> [   47.527121] [drm] GMBUS timed out, falling back to bit banging on pin 0 [i915 gmbus reserved]
> [   47.583087] [drm] GMBUS timed out, falling back to bit banging on pin 0 [i915 gmbus reserved]
> [   47.639092] [drm] GMBUS timed out, falling back to bit banging on pin 0 [i915 gmbus reserved]
> [   47.695081] [drm] GMBUS timed out, falling back to bit banging on pin 0 [i915 gmbus dpd]
> [   47.751011] [drm] GMBUS timed out, falling back to bit banging on pin 0 [i915 gmbus dpd]
> [   47.810995] [drm] GMBUS timed out, falling back to bit banging on pin 0 [i915 gmbus dpd]
> [   47.867014] [drm] GMBUS timed out, falling back to bit banging on pin 0 [i915 gmbus dpd]
> [   47.923009] [drm] GMBUS timed out, falling back to bit banging on pin 0 [i915 gmbus dpd]
> [   47.978921] [drm] GMBUS timed out, falling back to bit banging on pin 0 [i915 gmbus dpd]
> [   48.034954] [drm] GMBUS timed out, falling back to bit banging on pin 0 [i915 gmbus dpd]
> [   48.090936] [drm] GMBUS timed out, falling back to bit banging on pin 0 [i915 gmbus dpd]
> [   48.091142] i915 0000:00:02.0: irq 49 for MSI/MSI-X
> [   48.091147] [drm] Supports vblank timestamp caching Rev 1 (10.10.2010).
> [   48.091148] [drm] Driver supports precise vblank timestamp query.
> [   48.091182] vgaarb: device changed decodes: PCI:0000:00:02.0,olddecodes=io+mem,decodes=io+mem:owns=io+mem
> [   48.511902] fbcon: inteldrmfb (fb0) is primary device
> [   48.852752] Console: switching to colour frame buffer device 240x67
> [   48.857087] fb0: inteldrmfb frame buffer device
> [   48.857088] drm: registered panic notifier
> [   48.857205] [drm] Initialized i915 1.6.0 20080730 for 0000:00:02.0 on minor 0
> 
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/dri-devel
Jani Nikula Aug. 13, 2012, 2:40 p.m. UTC | #2
On Mon, 13 Aug 2012, Daniel Vetter <daniel@ffwll.ch> wrote:
> On Sun, Aug 12, 2012 at 11:49:22PM -0400, George Spelvin wrote:
>> (Bringing this back to the mailing lists after a bit of uninteresting private
>> conversation.)
>> 
>> > Honestly, I think we need a way to force disable gmbus with a module 
>> > parameter or something anyway. It's not the first time gmbus has been 
>> > implicated with an issue. Maybe it even exists already, but I couldn't 
>> > find this. So if you confirm that fixes the problem for you on the ml, 
>> > at least maybe such a patch will be the result.
>> >
>> > If you feel it's a software bug (which I agree it seems likely), a
>> > bisect is always much appreciated. Personally, I'll usually step back
>> > major releases until something works, or I hit 3.2ish. Even knowing it
>> > never worked through 3.2 is helpful.
>> 
>> It's a friend's machine, which I normally only have remote access to,
>> so it's a bit pf a pain, but I can manage.  I just thought a basic
>> i3 motherboard was so common I couldn't possibly be the only one with
>> this problem.
>> 
>> Here's the 3.2 dmesg showing the fallback working, but this is an
>> Ubuntu-patched kernel (linux-image-3.2.0-29-generic) that may be a fair
>> distance from stock:
>
> One thing of interest would be the exact .config you use to build the
> kernel and the output of lsmod (after the kernel crashed). I guess the
> issue is with the combination of drivers you have (i2c_detect in the
> calltrace calls back into other registered i2c drivers ...).

Hi all, this smells a bit like [1], don't you think?

George, can you check the patch I just sent to (hopefully) fix that
issue? Thanks.


BR,
Jani.

[1] http://thread.gmane.org/gmane.linux.kernel/1339794
diff mbox

Patch

diff --git a/drivers/gpu/drm/i915/intel_i2c.c 
b/drivers/gpu/drm/i915/intel_i2c.c
index 1991a44..fd04e89 100644
--- a/drivers/gpu/drm/i915/intel_i2c.c
+++ b/drivers/gpu/drm/i915/intel_i2c.c
@@ -494,7 +494,7 @@  int intel_setup_gmbus(struct drm_device *dev)
                 bus->reg0 = port | GMBUS_RATE_100KHZ;

                 /* gmbus seems to be broken on i830 */
-               if (IS_I830(dev))
+               if (1)
                         bus->force_bit = true;

                 intel_gpio_setup(bus, port);