NetBSD-Bugs archive

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

Re: kern/56436: panic from scsibus scan



The following reply was made to PR kern/56436; it has been noted by GNATS.

From: mlelstv%serpens.de@localhost (Michael van Elst)
To: gnats-bugs%netbsd.org@localhost
Cc: 
Subject: Re: kern/56436: panic from scsibus scan
Date: Sat, 2 Oct 2021 20:24:50 -0000 (UTC)

 kim%netbsd.org@localhost (Kimmo Suominen) writes:
 
 >	System panics from initiating a scsibus scan:
 >	# scsisctl /dev/scsibus0 scan 0 3
 
 >	[ 304916.143145] panic: kernel diagnostic assertion "KERNEL_LOCKED_P()" failed: file "/p/netbsd/cvs/src/sys/kern/subr_autoconf.c", line 1053
 >	[ 304916.143145] cpu1: Begin traceback...
 >	[ 304916.143145] vpanic() at netbsd:vpanic+0x156
 >	[ 304916.153145] __x86_indirect_thunk_rax() at netbsd:__x86_indirect_thunk_rax
 >	[ 304916.153145] config_match() at netbsd:config_match+0x85
 >	[ 304916.153145] mapply() at netbsd:mapply+0x26
 >	[ 304916.153145] config_search_internal() at netbsd:config_search_internal+0x16e
 >	[ 304916.153145] config_search() at netbsd:config_search+0x7d
 >	[ 304916.153145] scsi_probe_bus() at netbsd:scsi_probe_bus+0x4be
 
 
 The autoconf routines now largerly enforce that the kernel lock is held.
 
 Index: sys/dev/scsipi/scsiconf.c
 ===================================================================
 RCS file: /cvsroot/src/sys/dev/scsipi/scsiconf.c,v
 retrieving revision 1.292
 diff -p -u -r1.292 scsiconf.c
 --- sys/dev/scsipi/scsiconf.c	7 Aug 2021 16:19:16 -0000	1.292
 +++ sys/dev/scsipi/scsiconf.c	2 Oct 2021 20:19:33 -0000
 @@ -1012,6 +1012,7 @@ scsi_probe_device(struct scsibus_softc *
  	locs[SCSIBUSCF_TARGET] = target;
  	locs[SCSIBUSCF_LUN] = lun;
  
 +	KERNEL_LOCK(1, curlwp);
  	if ((cf = config_search(sc->sc_dev, &sa,
  				CFARGS(.submatch = config_stdsubmatch,
  				       .locators = locs))) != NULL) {
 @@ -1034,7 +1035,9 @@ scsi_probe_device(struct scsibus_softc *
  		 */
  		config_attach(sc->sc_dev, cf, &sa, scsibusprint,
  		    CFARGS(.locators = locs));
 +		KERNEL_UNLOCK_ONE(curlwp);
  	} else {
 +		KERNEL_UNLOCK_ONE(curlwp);
  		scsibusprint(&sa, device_xname(sc->sc_dev));
  		aprint_normal(" not configured\n");
  		goto bad;
 
 


Home | Main Index | Thread Index | Old Index