tech-kern archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: 4.0/i386 auich_calibrate() and GENERIC.NOACPI failure



On Sat, Jan 12, 2008 at 02:17:19PM +0000, Andrew Doran wrote:
> You could some printfs to see what happens to curcpu()->ci_ilevel, but it
> should stay at IPL_HIGH because ints are off during autoconf. As Joerg
> mentioned the i8254 based microtime() is incredibly slow. It would be
> interesting to see what happens if you took the microtime call out of the
> loop in auich_calibrate().

The i8254 may be slow, but it seemed to work just fine before this...?

At any rate, Joerg suggested I put the auich_calibrate() loop in an 
splvm(), so I did that plus your curcpu()->ci_ilevel suggestion.   
The results:

 1. splvm() didn't help
 2. splclock() _did_ fix the problem!
 3. the value of curcpu()->ci_ilevel is 0 (zero) before the loop.
    Are you sure we are supposed to be at IPL_HIGH?   I thought zero
    was IPL_NONE?


Here's the auich output at splvm():

auich0 at pci0 dev 31 function 5: i82801BA (ICH2) AC-97 Audio
auich0: interrupting at irq 10
auich0: ac97: Analog Devices AD1885 codec; headphone, Analog Devices Phat Stereo
auich0: ac97: ext id 1<VRA>
auich: BEFORE SPL 0
auich: AFTER SPL 0xa
auich0: measured ac97 link rate at 48416 Hz, will use 48000 Hz
audio0 at auich0: full duplex, mmap, independent


And here is the same output at splclock():

auich0 at pci0 dev 31 function 5: i82801BA (ICH2) AC-97 Audio
auich0: interrupting at irq 10
auich0: ac97: Analog Devices AD1885 codec; headphone, Analog Devices Phat Stereo
auich0: ac97: ext id 1<VRA>
auich: BEFORE SPL 0
auich: AFTER SPL 0xc
auich0: measured ac97 link rate at 55104 Hz, will use 55000 Hz
audio0 at auich0: full duplex, mmap, independent


what do you think?   splvm() version of the diff below.

chuck


Index: auich.c
===================================================================
RCS file: /cvsroot/src/sys/dev/pci/auich.c,v
retrieving revision 1.115
diff -u -r1.115 auich.c
--- auich.c     16 Nov 2006 01:33:08 -0000      1.115
+++ auich.c     12 Jan 2008 16:00:15 -0000
@@ -1731,6 +1731,11 @@
                          (0 - 1) & ICH_LVI_MASK);
 
        /* start */
+{
+int s;
+printf("auich: BEFORE SPL %#x\n", curcpu()->ci_ilevel);
+s=splvm();
+printf("auich: AFTER SPL %#x\n", curcpu()->ci_ilevel);
        microtime(&t1);
        bus_space_write_1(sc->iot, sc->aud_ioh, ICH_PCMI + ICH_CTRL, ICH_RPBM);
 
@@ -1747,6 +1752,8 @@
 
        /* stop */
        bus_space_write_1(sc->iot, sc->aud_ioh, ICH_PCMI + ICH_CTRL, 0);
+splx(s);
+}
 
        /* reset */
        DELAY(100);





Home | Main Index | Thread Index | Old Index