Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 2 Feb 2007 20:27:40 +0100
From:      Max Laier <max@love2party.net>
To:        John Baldwin <jhb@freebsd.org>
Cc:        cvs-src@freebsd.org, src-committers@freebsd.org, cvs-all@freebsd.org
Subject:   Re: cvs commit: src/sys/kern subr_firmware.c
Message-ID:  <200702022027.47269.max@love2party.net>
In-Reply-To: <200701311257.56169.jhb@freebsd.org>
References:  <200701302354.l0UNsoF4091229@repoman.freebsd.org> <200701311257.56169.jhb@freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
--nextPart1222717.BtXxDjBbX1
Content-Type: multipart/mixed;
  boundary="Boundary-01=_uC5wF2iYuQh4ovE"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

--Boundary-01=_uC5wF2iYuQh4ovE
Content-Type: text/plain;
  charset="iso-8859-15"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline

On Wednesday 31 January 2007 18:57, John Baldwin wrote:
> On Tuesday 30 January 2007 18:54, Max Laier wrote:
> > mlaier      2007-01-30 23:54:50 UTC
> >
> >   FreeBSD src repository
> >
> >   Modified files:        (Branch: RELENG_6)
> >     sys/kern             subr_firmware.c
> >   Log:
> >   Revert 1.1.2.2 as linker_release_module is not in RELENG_6.  Will
> > have to look for a better way and will compile test "trivial changes"
> > in the future.
>
> Probably trivial to backport the function.

Do you plan to?  Otherwise, I'd just solve it locally like attached.  Your=
=20
addition of linker_release module is a bit interlocked with the locking=20
changes and I'd rather not get into that, atm.

=2D-=20
/"\  Best regards,                      | mlaier@freebsd.org
\ /  Max Laier                          | ICQ #67774661
 X   http://pf4freebsd.love2party.net/  | mlaier@EFnet
/ \  ASCII Ribbon Campaign              | Against HTML Mail and News

--Boundary-01=_uC5wF2iYuQh4ovE
Content-Type: text/plain; charset="iso-8859-15";
	name="subr_firmware.c.releng_6.diff"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: attachment;
	filename="subr_firmware.c.releng_6.diff"

Index: subr_firmware.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
RCS file: /usr/store/mlaier/fcvs/src/sys/kern/subr_firmware.c,v
retrieving revision 1.1.2.3
diff -u -r1.1.2.3 subr_firmware.c
=2D-- subr_firmware.c	30 Jan 2007 23:54:49 -0000	1.1.2.3
+++ subr_firmware.c	2 Feb 2007 19:23:46 -0000
@@ -169,7 +169,7 @@
 	struct thread *td;
 	struct firmware *fp;
 	linker_file_t result;
=2D	int requested_load =3D 0;
+	int error, requested_load =3D 0;
=20
 again:
 	mtx_lock(&firmware_mtx);
@@ -189,6 +189,9 @@
 	if (requested_load) {
 		printf("%s: failed to load firmware image %s\n",
 		    __func__, imagename);
+		mtx_lock(&Giant);		/* XXX */
+		(void) linker_file_unload(result, LINKER_UNLOAD_NORMAL);
+		mtx_unlock(&Giant);		/* XXX */
 		return NULL;
 	}
 	td =3D curthread;
@@ -198,8 +201,13 @@
 		return NULL;
 	}
 	mtx_lock(&Giant);		/* XXX */
=2D	(void) linker_reference_module(imagename, NULL, &result);
+	error =3D linker_reference_module(imagename, NULL, &result)
 	mtx_unlock(&Giant);		/* XXX */
+	if (error !=3D 0) {
+		printf("%s: failed to load firmware image %s\n",
+		    __func__, imagename);
+		return NULL;
+	}
 	requested_load =3D 1;
 	goto again;		/* sort of an Algol-style for loop */
 }

--Boundary-01=_uC5wF2iYuQh4ovE--

--nextPart1222717.BtXxDjBbX1
Content-Type: application/pgp-signature

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (FreeBSD)

iD8DBQBFw5CzXyyEoT62BG0RAu9tAJ9C8pcGHLAaYsjth1ebcaADsexaWACfQayO
SUP49Icxp+lCZkIOJFImY14=
=2MHo
-----END PGP SIGNATURE-----

--nextPart1222717.BtXxDjBbX1--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200702022027.47269.max>