Port-sparc archive

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

Re: Sun4/110 "Panic: Crazy Interrupts"



Thank you, Julian!

It doesn't seem to like compiling after this patch - I attached the
compiler output.

Regards,
Samuel

On Fri, Apr 19, 2024 at 10:14 AM Julian Coleman <jdc%coris.org.uk@localhost> wrote:
>
> Hi,
>
> > I commented out that block and compiled again - I had to add
> > -Wno-unused to the generated Makefile to get it to build since it
> > didn't like 'bt' and 'i' hanging around unused.
> >
> > It looks like the stray interrupts still happen, and we still panic in
> > that further along spot from before. So I assume we'd just disable
> > these interrupts?
>
> I wondered if that might happen.  Looking at the P4 register definitions:
>
>   https://nxr.netbsd.org/xref/src/sys/dev/sun/pfourreg.h
>
> there is PFOUR_REG_INTEN, so I wonder if this is set and we can clear it on
> attach.  I've attached a patch that tries to adjust the FBC DAC registers to
> be a mix of char and int, plus unset the interrupt enable bit in the P4 reg.
> I assume that because we pass a shift of 24 to BT_INIT in the old code that
> we want to access bt_addr[3] and bt_ctrl[3].  I hope that this will work,
> otherwise we'll need to think of something else.
>
> There is also an interrupt enable register in the FBC control register:
>
>   https://nxr.netbsd.org/xref/src/sys/dev/sun/btreg.h#118
>
> so we might need to also disable that, but I didn't do that in the patch
> (we should be able to access it via &sc->sc_fbc->fbc_ctrl).
>
> Regards,
>
> Julian
>
> --
../../../../arch/sparc/dev/cgfour.c: In function 'cgfourattach':
../../../../arch/sparc/dev/cgfour.c:323:13: error: assignment from incompatible pointer type [-Werror=incompatible-pointer-types]
  sc->sc_fbc = (volatile struct fbcontrol *)bh;
             ^
../../../../arch/sparc/dev/cgfour.c:326:5: error: assignment from incompatible pointer type [-Werror=incompatible-pointer-types]
  bt = &sc->sc_fbc->fbc_dac;
     ^
../../../../arch/sparc/dev/cgfour.c:134:16: error: subscripted value is neither array nor pointer nor vector
   (bt)->bt_addr[3] = 0x06; /* command reg */ \
                ^
../../../../arch/sparc/dev/cgfour.c:331:2: note: in expansion of macro 'P4BT_INIT'
  P4BT_INIT(bt);
  ^~~~~~~~~
../../../../arch/sparc/dev/cgfour.c:135:16: error: subscripted value is neither array nor pointer nor vector
   (bt)->bt_ctrl[3] = 0x73; /* overlay plane */ \
                ^
../../../../arch/sparc/dev/cgfour.c:331:2: note: in expansion of macro 'P4BT_INIT'
  P4BT_INIT(bt);
  ^~~~~~~~~
../../../../arch/sparc/dev/cgfour.c:136:16: error: subscripted value is neither array nor pointer nor vector
   (bt)->bt_addr[3] = 0x04; /* read mask */ \
                ^
../../../../arch/sparc/dev/cgfour.c:331:2: note: in expansion of macro 'P4BT_INIT'
  P4BT_INIT(bt);
  ^~~~~~~~~
../../../../arch/sparc/dev/cgfour.c:137:16: error: subscripted value is neither array nor pointer nor vector
   (bt)->bt_ctrl[3] = 0xff; /* color planes */ \
                ^
../../../../arch/sparc/dev/cgfour.c:331:2: note: in expansion of macro 'P4BT_INIT'
  P4BT_INIT(bt);
  ^~~~~~~~~
../../../../arch/sparc/dev/cgfour.c:344:28: error: format '%x' expects argument of type 'unsigned int', but argument 2 has type 'volatile u_int32_t * {aka volatile unsigned int *}' [-Werror=format=]
 printf("P4 register = 0x%04x\n", fb->fb_pfour);
                         ~~~^     ~~~~~~~~~~~~
                         %04ls
../../../../arch/sparc/dev/cgfour.c:345:15: error: invalid operands to binary & (have 'volatile u_int32_t * {aka volatile unsigned int *}' and 'int')
  fb->fb_pfour &= ~(PFOUR_REG_INTEN);
               ^~
../../../../arch/sparc/dev/cgfour.c: In function 'cgfourloadcmap':
../../../../arch/sparc/dev/cgfour.c:523:5: error: assignment from incompatible pointer type [-Werror=incompatible-pointer-types]
  bt = &sc->sc_fbc->fbc_dac;
     ^
cc1: all warnings being treated as errors

*** Failed target:  cgfour.o
*** Failed command: echo '# ' "compile SUN4KERN-POSTEMAIL/cgfour.o" && echo /home/nebularix/obj/tooldir.NetBSD-9.3-amd64/bin/sparc--netbsdelf-gcc -mno-fpu -Wa,-Av8 -Wno-unused -ffreestanding -fno-zero-initialized-in-bss -fno-delete-null-pointer-checks -O2 -fno-strict-aliasing -fno-common -std=gnu99 -Werror -Wall -Wno-main -Wno-format-zero-length -Wpointer-arith -Wmissing-prototypes -Wstrict-prototypes -Wold-style-definition -Wswitch -Wshadow -Wcast-qual -Wwrite-strings -Wno-unreachable-code -Wno-pointer-sign -Wno-attributes -Wno-sign-compare --sysroot=/home/nebularix/obj/destdir.sparc -I. -I../../../../external/bsd/libnv/dist -I../../../../../common/lib/libx86emu -I../../../../../common/lib/libc/misc -I../../../../../common/include -I../../../../arch -I../../../.. -nostdinc -DCOMPAT_UTILS -DCOMPAT_44 -D_KERNEL -D_KERNEL_OPT -std=gnu99 -I../../../../lib/libkern/../../../common/lib/libc/quad -I../../../../lib/libkern/../../../common/lib/libc/string -I../../../../lib/libkern/../../../common/lib/libc/arch/sparc/string -I../../../../external/bsd/libnv/dist -c ../../../../arch/sparc/dev/cgfour.c -o cgfour.o && /home/nebularix/obj/tooldir.NetBSD-9.3-amd64/bin/sparc--netbsdelf-gcc -mno-fpu -Wa,-Av8 -Wno-unused -ffreestanding -fno-zero-initialized-in-bss -fno-delete-null-pointer-checks -O2 -fno-strict-aliasing -fno-common -std=gnu99 -Werror -Wall -Wno-main -Wno-format-zero-length -Wpointer-arith -Wmissing-prototypes -Wstrict-prototypes -Wold-style-definition -Wswitch -Wshadow -Wcast-qual -Wwrite-strings -Wno-unreachable-code -Wno-pointer-sign -Wno-attributes -Wno-sign-compare --sysroot=/home/nebularix/obj/destdir.sparc -I. -I../../../../external/bsd/libnv/dist -I../../../../../common/lib/libx86emu -I../../../../../common/lib/libc/misc -I../../../../../common/include -I../../../../arch -I../../../.. -nostdinc -DCOMPAT_UTILS -DCOMPAT_44 -D_KERNEL -D_KERNEL_OPT -std=gnu99 -I../../../../lib/libkern/../../../common/lib/libc/quad -I../../../../lib/libkern/../../../common/lib/libc/string -I../../../../lib/libkern/../../../common/lib/libc/arch/sparc/string -I../../../../external/bsd/libnv/dist -c ../../../../arch/sparc/dev/cgfour.c -o cgfour.o && :


Home | Main Index | Thread Index | Old Index