Subject: Re: iwi firmware load related panic
To: Sverre Froyen <sverre@viewmark.com>
From: Nick Hudson <skrll@netbsd.org>
List: current-users
Date: 01/23/2007 08:20:15
--Boundary-00=_/UctFUkMdp9WedV
Content-Type: text/plain;
  charset="iso-8859-1"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

On Monday 22 January 2007 20:54, Sverre Froyen wrote:
> Hi,
>
> Ever since the updates to the new iwi firmware: sysutils/iwi-firmware3, I
> have had intermittent crashes.  I finally got around to compiling a kernel
> with DIAGNOSTIC (and -g) and now I consitently get the following panic when
> using ifconfig to configure iwi0 (which auto-loads the firmware):
>
> panic: free: unaligned addr 0xc1fba010, size 262144, type devfirm, mask
> 4095
>
> This is i386 current from 18 Jan 2007, basically GENERIC_LAPTOP.
>
> Ideas anyone (besides submitting a PR)?

Try the attached patch

Nick

--Boundary-00=_/UctFUkMdp9WedV
Content-Type: text/x-diff;
  charset="iso-8859-1";
  name="iwi.diff"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
	filename="iwi.diff"

Index: sys/dev/pci/if_iwi.c
===================================================================
RCS file: /cvsroot/src/sys/dev/pci/if_iwi.c,v
retrieving revision 1.59
diff -u -p -u -r1.59 if_iwi.c
--- sys/dev/pci/if_iwi.c	20 Dec 2006 16:30:20 -0000	1.59
+++ sys/dev/pci/if_iwi.c	23 Jan 2007 08:19:40 -0000
@@ -2337,14 +2337,11 @@ fail1:
 static void
 iwi_free_firmware(struct iwi_softc *sc)
 {
-	struct iwi_firmware *kfw = &sc->fw;
 
 	if (!(sc->flags & IWI_FLAG_FW_CACHED))
 		return;
 
-	firmware_free(kfw->main, 0);
-	firmware_free(kfw->ucode, 0);
-	firmware_free(kfw->boot, 0);
+	firmware_free(sc->sc_blob, 0);
 
 	sc->flags &= ~IWI_FLAG_FW_CACHED;
 }

--Boundary-00=_/UctFUkMdp9WedV--