High number of spurious interrupts on Pi2 - 12STABLE

Karl Denninger karl at denninger.net
Wed Mar 6 01:19:57 UTC 2019


On 3/4/2019 22:34, Karl Denninger wrote:
> I'm getting a bunch of these on a 12-STABLE build on a Pi2..
>
> intc0: Spurious interrupt detected
> intc0: Spurious interrupt detected
> intc0: Spurious interrupt detected
> intc0: Spurious interrupt detected
> intc0: Spurious interrupt detected
> intc0: Spurious interrupt detected
> local_intc0: Spurious interrupt detected
> intc0: Spurious interrupt detected
> intc0: Spurious interrupt detected
> intc0: Spurious interrupt detected
> intc0: Spurious interrupt detected
> local_intc0: Spurious interrupt detected
> local_intc0: Spurious interrupt detected
> local_intc0: Spurious interrupt detected
> local_intc0: Spurious interrupt detected
> local_intc0: Spurious interrupt detected
> local_intc0: Spurious interrupt detected
>
> Operationally the unit appears to be fine but this is trashing my
> console log..... I have i2c enabled and am using it, but ceasing using
> it doesn't appear to stop it, so that appears unrelated...
>
> Any ideas on tracking this down appreciated.
>
> FreeBSD 12.0-STABLE r344038 GENERIC

This is coming from the i2c driver; if I disable it in my software the
error goes away (but so does the functionality, obviously.)

The code that is causing it is as follows:

(iic_handle is an open FD on /dev/iic0)

            iic_buf[0] = 0x01;  /* Write register 1 */
            iic_buf[1] = 0x81;  /* Base first byte */
            iic_buf[2] = 0x83;  /* 1600 s/s, normal */
            switch(x) {     /* Unit number */
                case 0:
                    iic_buf[1] |= 0x40;
                    break;
                case 1:
                    iic_buf[1] |= 0x50;
                    break;
                case 2:
                    iic_buf[1] |= 0x60;
                    break;
                case 4:
                    iic_buf[1] |= 0x70;
                    break;
                default:
                    break;
            }
            iic_buf[1] |= (analog_gain & 0x0e); /* Gain */
            i2c_msg[0].slave = analog_address << 1;
            i2c_msg[0].flags = !IIC_M_RD;
            i2c_msg[0].len = 3; /* 3 bytes to send */
            i2c_msg[0].buf = (unsigned char *) &iic_buf;
            iic_rdwr.msgs = i2c_msg;
            iic_rdwr.nmsgs = 1; /* Send register write */
            if (ioctl(iic_handle, I2CRDWR, &iic_rdwr) < 0) {
                sprintf(sysbuf, "I2c select failed for analog input on
address [0x%x]", analog_address);
                addlog(sysbuf, LOG_WARNING);
                analog_available = 0;
            }
            usleep(analog_delay * 1000);/* Delay for conversion */

            iic_buf[0] = 0; /* Clear response area */
            iic_buf[1] = 0;
            i2c_msg[0].slave = analog_address << 1 | !IIC_M_RD;
            i2c_msg[0].flags = !IIC_M_RD;   /* Write select */
            i2c_msg[0].len = sizeof(offset);
            i2c_msg[0].buf = &offset;

            i2c_msg[1].slave = analog_address << 1 | IIC_M_RD;
            i2c_msg[1].flags = IIC_M_RD;
            i2c_msg[1].len = 2; /* Get two bytes of value */
            i2c_msg[1].buf = (unsigned char *) &iic_buf;
            iic_rdwr.msgs = i2c_msg;
            iic_rdwr.nmsgs = 2;
            if (ioctl(iic_handle, I2CRDWR, &iic_rdwr) < 0) {
                sprintf(sysbuf, "I2c read failed for analog input");
                addlog(sysbuf, LOG_WARNING);
                analog_available = 0;
            }
            analog_val = ((iic_buf[0] << 8) + iic_buf[1]) >> analog_shift;

This code has been working perfectly fine until 12.x..... it STILL works
perfectly fine (that is, I AM getting proper data back) but I'm also
getting the complaints about spurious interrupts.

In addition what the blankety-blank is this?  This happens on a decent
percentage of the boots from a cold start and it doesn't matter whether
my code is running or not.


    1 users    Load  1.07  1.08  0.93                  Mar  5 19:18
   Mem usage:  15%Phy  7%Kmem
Mem: KB    REAL            VIRTUAL                      VN PAGER   SWAP
PAGER
        Tot   Share      Tot    Share    Free           in   out    
in   out
Act   29544    9300   136180    10092  796532  count
All   30208    9944   138040    11808          pages
Proc:                                                            Interrupts
  r   p   d   s   w   Csw  Trp  Sys  Int  Sof  Flt        ioflt  531k total
             27       949   46  274 9479  108             cow    1177
local_intc
                                                          zfod   495k
local_intc
 0.5%Sys   0.0%Intr  0.2%User  0.0%Nice 99.2%Idle         ozfod  8109
local_intc
|    |    |    |    |    |    |    |    |    |           %ozfod      
local_intc
                                                          daefr      
intc0,1: m
                                           dtbuf          prcfr      
intc0,2: v
Namei     Name-cache   Dir-cache     30805 desvn          totfr 26467
intc0,17:
   Calls    hits   %    hits   %      2492 numvn          react      
intc0,28:
    2420    2418 100                  1027 frevn          pdwak     4
intc0,61:
                                                        5 pdpgs      
intc0,65:
Disks mmcsd                                               intrn      
intc0,70:
KB/t   0.00                                        117920 wire       
cpu0:rende
tps       0                                         22048 act        
cpu1:rende
MB/s   0.00                                          2116 inact      
cpu2:rende
%busy     0                                               laund      
cpu3:rende
                                                   796532 free       
cpu0:ast
                                                    89128 buf        
cpu2:ast
                                                                     
cpu3:ast
                                                                    7
cpu0:preem
                                                                   96
cpu2:preem
                                                                  131
cpu3:preem

How do I find out what is pounding the daylights out of the interrupts?

FreeBSD 12.0-STABLE r344818 GENERIC on a Pi2

-- 
Karl Denninger
karl at denninger.net <mailto:karl at denninger.net>
/The Market Ticker/
/[S/MIME encrypted email preferred]/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 4897 bytes
Desc: S/MIME Cryptographic Signature
URL: <http://lists.freebsd.org/pipermail/freebsd-arm/attachments/20190305/8b9df6f4/attachment.bin>


More information about the freebsd-arm mailing list