Re: port-sparc64/60428 (NetBSD 11.99.6/sparc64 panics on USB insertion)

Taylor R Campbell <[email protected]>
Newsgroups gmane.os.netbsd.bugs
Message-ID <[email protected]>
> Date: Wed,  8 Jul 2026 17:04:59 +0000 (UTC)
> From: [email protected]
> 
> Since pluggable USB devices almost certainly have no associated OF
> nodes, this is probably a matter of:
> 
> --- src/sys/arch/sparc64/sparc64/autoconf.c
> +++ src/sys/arch/sparc64/sparc64/autoconf.c
> @@ -1237,7 +1237,8 @@
>  		 */
>  		busdev = device_parent(busdev);
>  		devhandle = device_handle(busdev);
> -		KASSERT(devhandle_type(devhandle) == DEVHANDLE_TYPE_OF);
> +		if (devhandle_type(devhandle) != DEVHANDLE_TYPE_OF)
> +			return;
>  		ofnode = devhandle_to_of(devhandle);

Or, better:

--- src/sys/arch/sparc64/sparc64/autoconf.c
+++ src/sys/arch/sparc64/sparc64/autoconf.c
@@ -1235,6 +1235,8 @@
 		 * controller's devhandle.  Hoist it up one more so
 		 * that busdev points at the controller.
 		 */
+		if (devhandle_type(devhandle) != DEVHANDLE_TYPE_OF)
+			return;
 		busdev = device_parent(busdev);
 		devhandle = device_handle(busdev);
 		KASSERT(devhandle_type(devhandle) == DEVHANDLE_TYPE_OF);
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.