NetBSD Problem Report #57947

From dholland@netbsd.org  Mon Feb 19 04:27:41 2024
Return-Path: <dholland@netbsd.org>
Received: from mail.netbsd.org (mail.netbsd.org [199.233.217.200])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits))
	(Client CN "mail.NetBSD.org", Issuer "mail.NetBSD.org CA" (not verified))
	by mollari.NetBSD.org (Postfix) with ESMTPS id 96C461A9239
	for <gnats-bugs@gnats.NetBSD.org>; Mon, 19 Feb 2024 04:27:41 +0000 (UTC)
Message-Id: <20240219042740.7BE0D84ECC@mail.netbsd.org>
Date: Mon, 19 Feb 2024 04:27:40 +0000 (UTC)
From: dholland@NetBSD.org
Reply-To: dholland@NetBSD.org
To: gnats-bugs@NetBSD.org
Subject: autoconfig errors probing card reader
X-Send-Pr-Version: 3.95

>Number:         57947
>Category:       kern
>Synopsis:       autoconfig errors probing card reader
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    kern-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon Feb 19 04:30:00 +0000 2024
>Last-Modified:  Tue Feb 20 06:20:01 +0000 2024
>Originator:     David A. Holland
>Release:        NetBSD 10.99.10 (20240218)
>Organization:
>Environment:
System: NetBSD valkyrie 10.99.10 NetBSD 10.99.10 (VALKYRIE2) #0: Sun Feb 18 22:10:52 EST 2024  dholland@valkyrie:/usr/obj/sys/arch/amd64/compile/VALKYRIE2 amd64
Architecture: x86_64
Machine: amd64
>Description:

I have a random card reader in this machine (I think it's part of the
case) and I noticed today while looking at other things that it probes
like this:

umass0 at uhub1 port 5 configuration 1 interface 0
umass0: Generic (0x058f) Mass Storage Device (0x6362), rev 2.00/1.29, addr 2
umass0: using SCSI over Bulk-Only
scsibus0 at umass0: 2 targets, 4 luns per target
sd0 at scsibus0 target 0 lun 0: <Generic, USB SD Reader, 1.00> disk removable
sd0: drive offline
autoconfiguration error: sd0: unable to open device, error = 19
sd1 at scsibus0 target 0 lun 1: <Generic, USB CF Reader, 1.01> disk removable
sd1: drive offline
autoconfiguration error: sd1: unable to open device, error = 19
sd2 at scsibus0 target 0 lun 2: <Generic, USB SM Reader, 1.02> disk removable
sd2: drive offline
autoconfiguration error: sd2: unable to open device, error = 19
sd3 at scsibus0 target 0 lun 3: <Generic, USB MS Reader, 1.03> disk removable
sd3: drive offline
autoconfiguration error: sd3: unable to open device, error = 19

which seems not entirely optimal. It has no cards in it so being
offline is reasonable, but it also seems like that shouldn't be an
error.

Haven't _used_ the thing in ages (possibly never) so I'm not sure if
this is new behavior, or if so how new.

>How-To-Repeat:

boot, read dmesg carefully

>Fix:

dunno

>Audit-Trail:
From: matthew green <mrg@eterna23.net>
To: gnats-bugs@netbsd.org
Cc: kern-bug-people@netbsd.org, gnats-admin@netbsd.org,
    netbsd-bugs@netbsd.org
Subject: re: kern/57947: autoconfig errors probing card reader
Date: Tue, 20 Feb 2024 08:12:05 +1100

 FWIW, this is not new behaviour.  i see it on some card readers
 and not others.  some attach the various ports, sometimes as
 separate sdN devices, sometimes not, at initial probe time, and
 some only attach the sdN when you insert a card.

 i'm not sure what the best way to handle this is, but it is in
 some sense expected by some devices, so perhaps we can make the
 message debug-only in these cases (if we can be sure?)


 .mrg.

From: mlelstv@serpens.de (Michael van Elst)
To: gnats-bugs@netbsd.org
Cc: 
Subject: Re: kern/57947: autoconfig errors probing card reader
Date: Tue, 20 Feb 2024 06:15:51 -0000 (UTC)

 mrg@eterna23.net (matthew green) writes:

 > FWIW, this is not new behaviour.  i see it on some card readers
 > and not others.  some attach the various ports, sometimes as
 > separate sdN devices, sometimes not, at initial probe time, and
 > some only attach the sdN when you insert a card.


 "drive offline" is a common state for a SCSI device with a removable
 medium and sometimes even for fixed disks.

 You could suppress the error message from the wedge scanner for
 error = ENODEV. But a more specific handling of this case is
 to run dkwedge_discover() in sd.c only when the detected state
 is SDGP_RESULT_OK.

 You still have to handle the transition from offline to online
 and back manually, with or without wedges.

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.47 2022/09/11 19:34:41 kim Exp $
$NetBSD: gnats_config.sh,v 1.9 2014/08/02 14:16:04 spz Exp $
Copyright © 1994-2024 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.