NetBSD Problem Report #46524

From www@NetBSD.org  Sat Jun  2 16:55:35 2012
Return-Path: <www@NetBSD.org>
Received: from mail.netbsd.org (mail.netbsd.org [149.20.53.66])
	by www.NetBSD.org (Postfix) with ESMTP id 264E563BEE1
	for <gnats-bugs@gnats.NetBSD.org>; Sat,  2 Jun 2012 16:55:35 +0000 (UTC)
Message-Id: <20120602165534.174E163BA27@www.NetBSD.org>
Date: Sat,  2 Jun 2012 16:55:34 +0000 (UTC)
From: nathanialsloss@yahoo.com.au
Reply-To: nathanialsloss@yahoo.com.au
To: gnats-bugs@NetBSD.org
Subject: ubt prevents computer from shutting down.
X-Send-Pr-Version: www-1.0

>Number:         46524
>Category:       kern
>Synopsis:       ubt prevents computer from shutting down.
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    kern-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sat Jun 02 17:00:00 +0000 2012
>Originator:     Nat Sloss
>Release:        NetBSD Current 6.99.6
>Organization:
>Environment:
NetBSD beast 6.99.6 NetBSD 6.99.6 (LOCKDEBUG) #54: Sat Jun  2 17:32:26 EST 2012  build@beast:/usr/src/sys/arch/i386/compile/obj/LOCKDEBUG i386
>Description:
I have a laptop with built in bluetooth.  I seldom turn off my computer or I would have found this earlier.

Bluetooth is supported via ubt and is attached to uhci.
I power down via acpi which works great in NetBSD 5.0.1 but not in current and I assume NetBSD 6.

When shutting down the screen stays on (nothing written on the screen) and I have to shutdown by holding down the power button.

If i disabled bluetooth before shutting down it worked.
>How-To-Repeat:
I don't know if this is reproducible by anyone else it maybe a BIOS/acpi controller problem.

Try to poweroff (ACPI) on a computer with embedded bluetooth supported by ubt(4). 
>Fix:
To fix the problem I patched ubt to detach at shutdown I am unaware if this was the default behavior in NetBSD 5.0.

===================================================================
RCS file: /cvsroot/src/sys/dev/usb/ubt.c,v
retrieving revision 1.47
diff -u -r1.47 ubt.c
--- sys/dev/usb/ubt.c   24 Apr 2012 20:04:49 -0000      1.47
+++ sys/dev/usb/ubt.c   2 Jun 2012 16:52:20 -0000
@@ -298,7 +298,8 @@
 int             ubt_detach(device_t, int);
 int             ubt_activate(device_t, enum devact);
 extern struct cfdriver ubt_cd;
-CFATTACH_DECL_NEW(ubt, sizeof(struct ubt_softc), ubt_match, ubt_attach, ubt_detach, ubt_activate);
+CFATTACH_DECL3_NEW(ubt, sizeof(struct ubt_softc), ubt_match, ubt_attach, ubt_detach, ubt_activate,
+    NULL, NULL, DVF_DETACH_SHUTDOWN);

 static int ubt_set_isoc_config(struct ubt_softc *);
 static int ubt_sysctl_config(SYSCTLFN_PROTO);


Now shutdown and poweroff work as before, but sysctl -w hw.acpi.sleep.state=5 does not and it didn't work in NetBSD 5 unless I called pmf_system_shutdown first but this is probably not related.

Regards,

Nat.

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.39 2013/11/01 18:47:49 spz Exp $
$NetBSD: gnats_config.sh,v 1.8 2006/05/07 09:23:38 tsutsui Exp $
Copyright © 1994-2007 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.