Re: PCI MSI (was Re: What current Dell Systems are supported/work)

2008-01-19 Thread Parv
in message [EMAIL PROTECTED],
wrote John Baldwin thusly...

 On Friday 18 January 2008 08:50:31 am John Baldwin wrote:
  On Friday 18 January 2008 05:30:06 am Parv wrote:
   There was no page fault or trap 12 message when the panic
   happened.  After some of messages are printed (as in dmesg),
   kdb is entered ...
   
 ioapic0: Assigning PCI IRQ 23 to local APIC 1
 msi: Assigning MSI IRQ 256 to local APIC 0
 panic: blockabke sleep block (sleep mutex) msi @ 
   /misc/src-6/sys/i386/i386/msi.c:381
 cpuid: 0
 kdb: stack backtrace
 kbd_backtrace( c0adc531,0,c0abaafd,c1020c34,c0bab700,...) at ... \
   [I skipped from here to the db prompt]
...
   Tomorrow, rather later today, I will type up the trace
   output.  Please let me know if you would like to see any other
   output that I could possibly provide.
  
  This is good enough for me to see the bug, I'll work on fixing
  it.  There are some locking changes in the x86 interrupt code I
  need to MFC.
 
 Try this patch:
...

Thanks much John.  Your patch allowed my computer to resume normal
operation without disabling MSI via hw.pci.enable_msi*.

Lest I forget, mahalo for saving me from typing up the trace output.


  - Parv

-- 

___
freebsd-stable@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-stable
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: PCI MSI (was Re: What current Dell Systems are supported/work)

2008-01-18 Thread Parv
(Dropped Vivek K from recipient list; edited the URLs in my previous
message.)

in message [EMAIL PROTECTED],
wrote John Baldwin thusly...

 On Thursday 17 January 2008 06:05:17 am Parv wrote:
...
  Speaking of MSI being on by default in recent 6-STABLE ... well,
  that caused my ThinkPad T61 (8859-CTO) ...
 
dmesg:

  http://www103.pair.com/parv/comp/unix/freebsd/thinkpad-t61-8897-cto/sys/dmesg
 
kernel (combined for easy perusal):

  http://www103.pair.com/parv/comp/unix/freebsd/thinkpad-t61-8897-cto/cf/kern/combined/T61-SMP.debug--combined
 
/boot/device.hints:

  http://www103.pair.com/parv/comp/unix/freebsd/thinkpad-t61-8897-cto/cf/boot/device.hints
 
 
  ... to go in panic[0]
...
[0] I could not save the dump for neither do I have access to
serial console, nor could the file system be mounted.
Missing also here is a digital camera.  If anybody is
interested, I could write screen down, and repeat to them.

 For starters, can you get the output of 'pciconf -lc'?

Hi John,

You can find pciconf -lc at ...

  
http://www103.pair.com/parv/comp/unix/freebsd/thinkpad-t61-8897-cto/sys/pciconf-lc

  and pciconf -lv, just in case ...
  
http://www103.pair.com/parv/comp/unix/freebsd/thinkpad-t61-8897-cto/sys/pciconf-lv


 Secondly, I really will need the kernel panic message.  If it is a
 page fault (trap 12) then write down the faulting virtual address
 and the faulting IP.  If you can scribble down any of the stack
 trace from DDB that would be helpful as well.

There was no page fault or trap 12 message when the panic happened.
After some of messages are printed (as in dmesg), kdb is entered ...

  ioapic0: Assigning PCI IRQ 23 to local APIC 1
  msi: Assigning MSI IRQ 256 to local APIC 0
  panic: blockabke sleep block (sleep mutex) msi @ 
/misc/src-6/sys/i386/i386/msi.c:381
  cpuid: 0
  kdb: stack backtrace
  kbd_backtrace( c0adc531,0,c0abaafd,c1020c34,c0bab700,...) at ... \
[I skipped from here to the db prompt]
  .
  .
  .

Tomorrow, rather later today, I will type up the trace output.
Please let me know if you would like to see any other output that I
could possibly provide.


  - Parv

-- 

___
freebsd-stable@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-stable
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: PCI MSI (was Re: What current Dell Systems are supported/work)

2008-01-18 Thread John Baldwin
On Friday 18 January 2008 05:30:06 am Parv wrote:
 (Dropped Vivek K from recipient list; edited the URLs in my previous
 message.)
 
 in message [EMAIL PROTECTED],
 wrote John Baldwin thusly...
 
  On Thursday 17 January 2008 06:05:17 am Parv wrote:
 ...
   Speaking of MSI being on by default in recent 6-STABLE ... well,
   that caused my ThinkPad T61 (8859-CTO) ...
  
 dmesg:
 
   http://www103.pair.com/parv/comp/unix/freebsd/thinkpad-t61-8897-cto/sys/dmesg
  
 kernel (combined for easy perusal):
 
   http://www103.pair.com/parv/comp/unix/freebsd/thinkpad-t61-8897-cto/cf/kern/combined/T61-SMP.debug--combined
  
 /boot/device.hints:
 
   http://www103.pair.com/parv/comp/unix/freebsd/thinkpad-t61-8897-cto/cf/boot/device.hints
  
  
   ... to go in panic[0]
 ...
 [0] I could not save the dump for neither do I have access to
 serial console, nor could the file system be mounted.
 Missing also here is a digital camera.  If anybody is
 interested, I could write screen down, and repeat to them.
 
  For starters, can you get the output of 'pciconf -lc'?
 
 Hi John,
 
 You can find pciconf -lc at ...
 
   
 http://www103.pair.com/parv/comp/unix/freebsd/thinkpad-t61-8897-cto/sys/pciconf-lc
 
   and pciconf -lv, just in case ...
   
 http://www103.pair.com/parv/comp/unix/freebsd/thinkpad-t61-8897-cto/sys/pciconf-lv
 
 
  Secondly, I really will need the kernel panic message.  If it is a
  page fault (trap 12) then write down the faulting virtual address
  and the faulting IP.  If you can scribble down any of the stack
  trace from DDB that would be helpful as well.
 
 There was no page fault or trap 12 message when the panic happened.
 After some of messages are printed (as in dmesg), kdb is entered ...
 
   ioapic0: Assigning PCI IRQ 23 to local APIC 1
   msi: Assigning MSI IRQ 256 to local APIC 0
   panic: blockabke sleep block (sleep mutex) msi @ 
 /misc/src-6/sys/i386/i386/msi.c:381
   cpuid: 0
   kdb: stack backtrace
   kbd_backtrace( c0adc531,0,c0abaafd,c1020c34,c0bab700,...) at ... \
 [I skipped from here to the db prompt]
   .
   .
   .
 
 Tomorrow, rather later today, I will type up the trace output.
 Please let me know if you would like to see any other output that I
 could possibly provide.

This is good enough for me to see the bug, I'll work on fixing it.  There are
some locking changes in the x86 interrupt code I need to MFC.

-- 
John Baldwin
___
freebsd-stable@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-stable
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: PCI MSI (was Re: What current Dell Systems are supported/work)

2008-01-18 Thread John Baldwin
On Friday 18 January 2008 08:50:31 am John Baldwin wrote:
 On Friday 18 January 2008 05:30:06 am Parv wrote:
  There was no page fault or trap 12 message when the panic happened.
  After some of messages are printed (as in dmesg), kdb is entered ...
  
ioapic0: Assigning PCI IRQ 23 to local APIC 1
msi: Assigning MSI IRQ 256 to local APIC 0
panic: blockabke sleep block (sleep mutex) msi @ 
  /misc/src-6/sys/i386/i386/msi.c:381
cpuid: 0
kdb: stack backtrace
kbd_backtrace( c0adc531,0,c0abaafd,c1020c34,c0bab700,...) at ... \
  [I skipped from here to the db prompt]
.
.
.
  
  Tomorrow, rather later today, I will type up the trace output.
  Please let me know if you would like to see any other output that I
  could possibly provide.
 
 This is good enough for me to see the bug, I'll work on fixing it.  There are
 some locking changes in the x86 interrupt code I need to MFC.

Try this patch:

Index: amd64/amd64/intr_machdep.c
===
RCS file: /host/cvs/usr/cvs/src/sys/amd64/amd64/intr_machdep.c,v
retrieving revision 1.15.2.5
diff -u -r1.15.2.5 intr_machdep.c
--- amd64/amd64/intr_machdep.c  26 Nov 2007 15:08:35 -  1.15.2.5
+++ amd64/amd64/intr_machdep.c  18 Jan 2008 15:05:08 -
@@ -43,13 +43,14 @@
 #include sys/param.h
 #include sys/bus.h
 #include sys/interrupt.h
-#include sys/lock.h
 #include sys/ktr.h
 #include sys/kernel.h
+#include sys/lock.h
 #include sys/mutex.h
 #include sys/proc.h
 #include sys/syslog.h
 #include sys/systm.h
+#include sys/sx.h
 #include machine/clock.h
 #include machine/intr_machdep.h
 #ifdef DDB
@@ -70,7 +71,8 @@
 
 static int intrcnt_index;
 static struct intsrc *interrupt_sources[NUM_IO_INTS];
-static struct mtx intr_table_lock;
+static struct sx intr_table_lock;
+static struct mtx intrcnt_lock;
 static STAILQ_HEAD(, pic) pics;
 
 #ifdef SMP
@@ -108,14 +110,14 @@
 {
int error;
 
-   mtx_lock_spin(intr_table_lock);
+   sx_xlock(intr_table_lock);
if (intr_pic_registered(pic))
error = EBUSY;
else {
STAILQ_INSERT_TAIL(pics, pic, pics);
error = 0;
}
-   mtx_unlock_spin(intr_table_lock);
+   sx_xunlock(intr_table_lock);
return (error);
 }
 
@@ -137,16 +139,16 @@
(mask_fn)isrc-is_pic-pic_enable_source, irq%d:, vector);
if (error)
return (error);
-   mtx_lock_spin(intr_table_lock);
+   sx_xlock(intr_table_lock);
if (interrupt_sources[vector] != NULL) {
-   mtx_unlock_spin(intr_table_lock);
+   sx_xunlock(intr_table_lock);
intr_event_destroy(isrc-is_event);
return (EEXIST);
}
intrcnt_register(isrc);
interrupt_sources[vector] = isrc;
isrc-is_enabled = 0;
-   mtx_unlock_spin(intr_table_lock);
+   sx_xunlock(intr_table_lock);
return (0);
 }
 
@@ -170,19 +172,18 @@
error = intr_event_add_handler(isrc-is_event, name, handler, arg,
intr_priority(flags), flags, cookiep);
if (error == 0) {
+   sx_xlock(intr_table_lock);
intrcnt_updatename(isrc);
-   mtx_lock_spin(intr_table_lock);
if (!isrc-is_enabled) {
isrc-is_enabled = 1;
 #ifdef SMP
if (assign_cpu)
intr_assign_next_cpu(isrc);
 #endif
-   mtx_unlock_spin(intr_table_lock);
isrc-is_pic-pic_enable_intr(isrc);
-   } else
-   mtx_unlock_spin(intr_table_lock);
+   }
isrc-is_pic-pic_enable_source(isrc);
+   sx_xunlock(intr_table_lock);
}
return (error);
 }
@@ -306,12 +307,12 @@
 #ifndef DEV_ATPIC
atpic_reset();
 #endif
-   mtx_lock_spin(intr_table_lock);
+   sx_xlock(intr_table_lock);
STAILQ_FOREACH(pic, pics, pics) {
if (pic-pic_resume != NULL)
pic-pic_resume(pic);
}
-   mtx_unlock_spin(intr_table_lock);
+   sx_xunlock(intr_table_lock);
 }
 
 void
@@ -319,12 +320,12 @@
 {
struct pic *pic;
 
-   mtx_lock_spin(intr_table_lock);
+   sx_xlock(intr_table_lock);
STAILQ_FOREACH(pic, pics, pics) {
if (pic-pic_suspend != NULL)
pic-pic_suspend(pic);
}
-   mtx_unlock_spin(intr_table_lock);
+   sx_xunlock(intr_table_lock);
 }
 
 static void
@@ -347,8 +348,8 @@
 {
char straystr[MAXCOMLEN + 1];
 
-   /* mtx_assert(intr_table_lock, MA_OWNED); */
KASSERT(is-is_event != NULL, (%s: isrc with no event, __func__));
+   mtx_lock_spin(intrcnt_lock);
is-is_index = intrcnt_index;
intrcnt_index += 2;
snprintf(straystr, MAXCOMLEN + 1, stray irq%d,
@@ -357,17 +358,18 @@
is-is_count = intrcnt[is-is_index];

PCI MSI (was Re: What current Dell Systems are supported/work)

2008-01-17 Thread Parv
in message [EMAIL PROTECTED],
wrote Vivek Khera thusly...

 
 On Jan 10, 2008, at 11:09 AM, John Baldwin wrote:
 
 *: This is the default behavior for 7.0, I have not encountered
 the problem mentioned above on any 1950/2950 boxes so far I have
 tested.
 
 I will enable MSI by default on 6.x now (so will take affect for
 6.4).  We've also enabled it by default on 6.x at work.
 
 
 Where can one go to read up on what MSI is and how it helps us?
 
 Is enabling it just setting a sysctl?  Does that have to be done
 in loader.conf or can it happen later?

Speaking of MSI being on by default in recent 6-STABLE ... well,
that caused my ThinkPad T61 (8859-CTO) ...

  dmesg:
  http://www103.pair.com/parv/comp/unix/freebsd/thinkpad-t61-8859-cto/sys/dmesg

  kernel (combined for easy perusal):
  
http://www103.pair.com/parv/comp/unix/freebsd/thinkpad-t61-8859-cto/cf/kern/combined/T61-SMP.debug--combined

  /boot/device.hints:
  
http://www103.pair.com/parv/comp/unix/freebsd/thinkpad-t61-8859-cto/cf/boot/device.hints


... to go in panic[0].  So, for now I have added ...

  #  Since MSI turned on by default on 2008.01.10.21.17.12 UTC,
  #  causes panic so disable MSI.
  hw.pci.enable_msix=0
  hw.pci.enable_msi=0


... to /boot/loader.conf.


  [0] I could not save the dump for neither do I have access to
  serial console, nor could the file system be mounted.  Missing
  also here is a digital camera.  If anybody is interested, I
  could write screen down, and repeat to them.


  - Parv

-- 

___
freebsd-stable@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-stable
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: PCI MSI (was Re: What current Dell Systems are supported/work)

2008-01-17 Thread John Baldwin
On Thursday 17 January 2008 06:05:17 am Parv wrote:
 in message [EMAIL PROTECTED],
 wrote Vivek Khera thusly...
 
  
  On Jan 10, 2008, at 11:09 AM, John Baldwin wrote:
  
  *: This is the default behavior for 7.0, I have not encountered
  the problem mentioned above on any 1950/2950 boxes so far I have
  tested.
  
  I will enable MSI by default on 6.x now (so will take affect for
  6.4).  We've also enabled it by default on 6.x at work.
  
  
  Where can one go to read up on what MSI is and how it helps us?
  
  Is enabling it just setting a sysctl?  Does that have to be done
  in loader.conf or can it happen later?
 
 Speaking of MSI being on by default in recent 6-STABLE ... well,
 that caused my ThinkPad T61 (8859-CTO) ...
 
   dmesg:
   
http://www103.pair.com/parv/comp/unix/freebsd/thinkpad-t61-8859-cto/sys/dmesg
 
   kernel (combined for easy perusal):
   
http://www103.pair.com/parv/comp/unix/freebsd/thinkpad-t61-8859-cto/cf/kern/combined/T61-SMP.debug--combined
 
   /boot/device.hints:
   
http://www103.pair.com/parv/comp/unix/freebsd/thinkpad-t61-8859-cto/cf/boot/device.hints
 
 
 ... to go in panic[0].  So, for now I have added ...
 
   #  Since MSI turned on by default on 2008.01.10.21.17.12 UTC,
   #  causes panic so disable MSI.
   hw.pci.enable_msix=0
   hw.pci.enable_msi=0
 
 
 ... to /boot/loader.conf.
 
 
   [0] I could not save the dump for neither do I have access to
   serial console, nor could the file system be mounted.  Missing
   also here is a digital camera.  If anybody is interested, I
   could write screen down, and repeat to them.

For starters, can you get the output of 'pciconf -lc'?  Secondly, I really 
will need the kernel panic message.  If it is a page fault (trap 12) then 
write down the faulting virtual address and the faulting IP.  If you can 
scribble down any of the stack trace from DDB that would be helpful as well.

-- 
John Baldwin
___
freebsd-stable@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-stable
To unsubscribe, send any mail to [EMAIL PROTECTED]