NetBSD-Bugs archive

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

Re: kern/54157: aprint_normal_dev without device pointer



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

From: mlelstv%serpens.de@localhost (Michael van Elst)
To: gnats-bugs%netbsd.org@localhost
Cc: 
Subject: Re: kern/54157: aprint_normal_dev without device pointer
Date: Fri, 3 May 2019 13:33:21 -0000 (UTC)

 martin%NetBSD.org@localhost writes:
 
 >Due to a different bug (see kern/54156) during scsi bus probe I get into
 >this (reproducably, on every boot). Since sd/cd/... whatever scsi devices
 >did not (yet?) attach, the periph_dev pointer is NULL.
 
 Maybe following the example of scsi_print_addr:
 
 Index: scsi_base.c
 ===================================================================
 RCS file: /cvsroot/src/sys/dev/scsipi/scsi_base.c,v
 retrieving revision 1.92
 diff -p -u -r1.92 scsi_base.c
 --- scsi_base.c	17 Jun 2017 22:35:50 -0000	1.92
 +++ scsi_base.c	3 May 2019 13:32:19 -0000
 @@ -136,9 +136,17 @@ scsi_kill_pending(struct scsipi_periph *
  static void
  scsi_print_xfer_mode(struct scsipi_periph *periph)
  {
 +	struct scsipi_channel *chan = periph->periph_channel;
 +	struct scsipi_adapter *adapt = chan->chan_adapter;
  	int period, freq, speed, mbs;
  
 -	aprint_normal_dev(periph->periph_dev, "");
 +	if (periph->periph_dev)
 +		aprint_normal_dev(periph->periph_dev, "");
 +	else
 +		aprint_normal("probe(%s:%d:%d:%d): ",
 +			device_xname(adapt->adapt_dev),
 +			chan->chan_channel, periph->periph_target,
 +			periph->periph_lun);
  	if (periph->periph_mode & (PERIPH_CAP_SYNC | PERIPH_CAP_DT)) {
  		period = scsipi_sync_factor_to_period(periph->periph_period);
  		aprint_normal("sync (%d.%02dns offset %d)",
 
 
 -- 
 -- 
                                 Michael van Elst
 Internet: mlelstv%serpens.de@localhost
                                 "A potential Snark may lurk in every tree."
 


Home | Main Index | Thread Index | Old Index