Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 15 Jan 2005 00:28:55 +0300
From:      Vladimir Grebenschikov <vova@fbsd.ru>
To:        current@freebsd.org
Cc:        Julian Elischer <julian@elischer.org>
Subject:   Re: USB problems
Message-ID:  <1105738135.1124.9.camel@localhost>
In-Reply-To: <1105138987.1401.5.camel@localhost>
References:  <20041228010938.GA39686@freebsd3.cimlogic.com.au> <20041230.111631.13597845.imp@bsdimp.com> <1104542138.3084.9.camel@localhost>	 <41D67753.60202@elischer.org> <1105138987.1401.5.camel@localhost>

next in thread | previous in thread | raw e-mail | index | archive | help

--=-/aV4VwvMH0ZArwudcSpB
Content-Type: text/plain; charset=KOI8-R
Content-Transfer-Encoding: quoted-printable

=F7 =D3=C2, 08/01/2005 =D7 02:03 +0300, Vladimir Grebenschikov =D0=C9=DB=C5=
=D4:
> =F7 =D3=C2, 01/01/2005 =D7 02:11 -0800, Julian Elischer =D0=C9=DB=C5=D4:
> > Vladimir Grebenschikov wrote:
> > > =F7 =D0=D4, 31/12/2004 =D7 05:05 -1000, Randy Bush =D0=C9=DB=C5=D4:
> > >=20
> > >>possibly related?
> > >>
> > >>just so you know, on a thinkpad t41 with any current in the last
> > >>few weeks, i kernel panic on boot if a usb device is not plugged
> > >>in.  turning off acpi also allows boot.  see
> > >>
> > >>   <http://rip.psg.com/~randy/041215.crash>;
> > >>
> > >>i can help debug if anyone is on the trail
> > >=20
> > >=20
> > > I have also problems with USB on recent current (previous was few wee=
ks
> > > old).
> > >=20
> >=20
> > the most salient thiing you could do is find the date of the problem by=
 checking=20
> > out  sys/dev/usb on dec 9 and seeing if that fixes it (you said dec 9 w=
as ok)
> > and if so, gradually moving it forward using a binary search and narrow=
ing in on=20
> > the commit that broke it.

I have found the exact reason - it stats fail after following patch:

sos         2004-12-08 11:16:33 UTC

  FreeBSD src repository

  Modified files:
    sys/dev/ata          ata-queue.c=20
  Log:
  Reset timeout when we are back from interrupt.
 =20
  Revision  Changes    Path
  1.41      +3 -0      src/sys/dev/ata/ata-queue.c


@@ -216,6 +216,9 @@
        ata_completed(request, 0);
     }
     else {
+       if (!dumping)
+           callout_reset(&request->callout, request->timeout * hz,
+                         (timeout_t*)ata_timeout, request);
        if (request->bio && !(request->flags & ATA_R_TIMEOUT)) {
            ATA_DEBUG_RQ(request, "finish bio_taskqueue");
            bio_taskqueue(request->bio, (bio_task_t *)ata_completed, reques=
t);

Looks like something bad happens with locking while this timeout.
With this patch reverse applied - all is ok.

Can anybody advise, what wrong happens there with locking ?

(original panic description in attachment)

This panic happens after ATA initialization. But If I boot with plugged USB=
 hub (it has keyboard and mouse)
I've get panic on ATAPICAM init.


Should I fill PR ?

(last try with very last current)

--=20
Vladimir B. Grebenchikov
vova@fbsd.ru

--=-/aV4VwvMH0ZArwudcSpB
Content-Disposition: inline
Content-Description: =?koi8-r?Q?=F7=CC=CF=D6=C5=CE=CE=CF=C5?=
	=?koi8-r?Q?_=D3=CF=CF=C2=DD=C5=CE=C9=C5?= - Re: USB problems
Content-Type: message/rfc822

Return-path: <owner-freebsd-current@freebsd.org>
Envelope-to: vova@fbsd.ru
Delivery-date: Sat, 01 Jan 2005 04:16:33 +0300
Received: from mx2.freebsd.org ([216.136.204.119]) by fbsd.ru with esmtp
	(Exim 3.36 #1) id 1CkXse-00062r-00 for vova@fbsd.ru; Sat, 01 Jan 2005
	04:16:33 +0300
Received: from hub.freebsd.org (hub.freebsd.org [216.136.204.18]) by
	mx2.freebsd.org (Postfix) with ESMTP id 2637E579E0; Sat,  1 Jan 2005
	01:16:00 +0000 (GMT) (envelope-from owner-freebsd-current@freebsd.org)
Received: from hub.freebsd.org (localhost [127.0.0.1]) by hub.freebsd.org
	(Postfix) with ESMTP id EE66F16A4FC;
	Sat,  1 Jan 2005 01:15:56 +0000 (GMT)
Delivered-To: freebsd-current@freebsd.org
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by
	hub.freebsd.org (Postfix) with ESMTP id 3C9B516A4CE; Sat,  1 Jan 2005
	01:15:49 +0000 (GMT)
Received: from vbook.fbsd.ru (user181.hovrino.net [82.179.232.181]) by
	mx1.FreeBSD.org (Postfix) with ESMTP id 6FAC443D4C; Sat,  1 Jan 2005
	01:15:48 +0000 (GMT) (envelope-from vova@vbook.fbsd.ru)
Received: from vova by vbook.fbsd.ru with local (Exim 4.43 (FreeBSD)) id
	1CkXrn-0000p2-Ca; Sat, 01 Jan 2005 04:15:39 +0300
From: Vladimir Grebenschikov <vova@fbsd.ru>
To: Randy Bush <randy@psg.com>
In-Reply-To: <16853.27324.504672.6086@roam.psg.com>
References: <20041228010938.GA39686@freebsd3.cimlogic.com.au>
	 <20041230.111631.13597845.imp@bsdimp.com>
	 <16853.27324.504672.6086@roam.psg.com>
Content-Type: text/plain; charset=KOI8-R
Content-Transfer-Encoding: quoted-printable
Organization: SWsoft
Date: Sat, 01 Jan 2005 04:15:38 +0300
Message-Id: <1104542138.3084.9.camel@localhost>
Mime-Version: 1.0
X-Mailer: Evolution 2.0.0FreeBSD GNOME Team Port 
Cc: "M. Warner Losh" <imp@bsdimp.com>
Subject: Re: USB problems
X-BeenThere: freebsd-current@freebsd.org
X-Mailman-Version: 2.1.1
Precedence: list
Reply-To: vova@fbsd.ru
List-Id: Discussions about the use of FreeBSD-current
	<freebsd-current.freebsd.org>
List-Unsubscribe: 
	<http://lists.freebsd.org/mailman/listinfo/freebsd-current>,
	<mailto:freebsd-current-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/freebsd-current>;
List-Post: <mailto:freebsd-current@freebsd.org>
List-Help: <mailto:freebsd-current-request@freebsd.org?subject=help>
List-Subscribe: 
	<http://lists.freebsd.org/mailman/listinfo/freebsd-current>,
	<mailto:freebsd-current-request@freebsd.org?subject=subscribe>
Sender: owner-freebsd-current@freebsd.org
Errors-To: owner-freebsd-current@freebsd.org
X-Evolution-Source: mbox:/var/mail/vova

=F7 =D0=D4, 31/12/2004 =D7 05:05 -1000, Randy Bush =D0=C9=DB=C5=D4:
> possibly related?
>=20
> just so you know, on a thinkpad t41 with any current in the last
> few weeks, i kernel panic on boot if a usb device is not plugged
> in.  turning off acpi also allows boot.  see
>=20
>    <http://rip.psg.com/~randy/041215.crash>;
>=20
> i can help debug if anyone is on the trail

I have also problems with USB on recent current (previous was few weeks
old).

It panics on each boot:

Fatal trap 12: page fault while in kernel mode
fault virtual address   =3D 0x1ff0383
fault code              =3D supervisor write, page not present
instruction pointer     =3D 0x8:0xc07bc886
stack pointer           =3D 0x10:0xe6923a8c
frame pointer           =3D 0x10:0xe6923a90
code segment            =3D base 0x0, limit 0xfffff, type 0x1b
                        =3D DPL 0, pres 1, def32 1, gran 1
processor eflags        =3D interrupt enabled, resume, IOPL =3D 0
current process         =3D 477 (usbd)
[thread pid 477 tid 100078 ]
Stopped at      usb_get_next_event+0x6e:        movl    %eax,0x184(%edx)
db> trace
Tracing pid 477 tid 100078 td 0xc212bb80
usb_get_next_event(1ff01ff,1ff01ff,1ff01ff,1ff01ff,1ff01ff) at
usb_get_next_event+0x6e
usbread(c1a60200,e6923c7c,10,7000000,0) at usbread+0x43
devfs_read_f(c1d3f264,e6923c7c,c1977c80,0,c212bb80) at devfs_read_f+0xd4
dofileread(c212bb80,c1d3f264,7,bfbfeb50,180) at dofileread+0x7e
read(c212bb80,e6923d14,c,c212bb80,7) at read+0x6b
syscall(2f,2f,2f,7,7) at syscall+0x300
Xint0x80_syscall() at Xint0x80_syscall+0x1f
--- syscall (3, FreeBSD ELF32, read), eip =3D 0x280cbc17, esp =3D
0xbfbfeb2c, ebp =3D 0xbfbfecd8 ---
db> ps
  pid   proc     uid  ppid  pgrp  flag   stat  wmesg    wchan  cmd
  514 c212a3f0    0     1    48 0000002 [LOCK  Giant c2019040] hcsecd
  512 c212a000 65534     1   512 0000100 [SLPQ select 0xc06b8d04][SLP]
sdpd
  477 c212a5e8    0   472    48 0004002 [CPU 0] usbd
  472 c1a475e8    0    48    48 0000002 [SLPQ wait 0xc1a475e8][SLP] sh
...=20
db> trace 514
Tracing pid 514 tid 100079 td 0xc212bcf0
sched_switch(c212bcf0,0,1,7066308c,418ddef8) at sched_switch+0x170
mi_switch(1,0,c05238cd,c19939a4,c1d65484) at mi_switch+0x1d9
turnstile_wait(c06b2ae0,c212bb80,0,bfbfe000,e69b9cbc) at turnstile_wait
+0x350
_mtx_lock_sleep(c06b2ae0,c212bcf0,0,0,0) at _mtx_lock_sleep+0xb4
vm_fault(c1993960,bfbfe000,2,8,e69b9cfc) at vm_fault+0x211
trap_pfault(e69b9d48,1,bfbfeb4c,e69b9d34,bfbfeb4c) at trap_pfault+0x13b
trap(2f,2f,2f,0,bfbfeb60) at trap+0x21a
calltrap() at calltrap+0x5
--- trap 0xc, eip =3D 0x280cc601, esp =3D 0xbfbfeb50, ebp =3D 0xbfbfebb8 --=
-
db>
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D


I have found way how to workaround panic.
If I turn on USB dongle while boot (after usb bus detected) it boots ok.
But If I boot with turned off USB dongle - it panics, same If I boot
with turned on USB dongle. (also it is same with usb mice or keyboard).

I have allways turned on umass on-board card reader.

There is my usual list of USB devides:

# usbdevs -v
Controller /dev/usb0:
addr 1: full speed, self powered, config 1, UHCI root hub(0x0000), Intel(0x=
0000), rev 1.00
 port 1 powered
 port 2 powered
Controller /dev/usb1:
addr 1: full speed, self powered, config 1, UHCI root hub(0x0000), Intel(0x=
0000), rev 1.00
 port 1 powered
 port 2 powered
Controller /dev/usb2:
addr 1: full speed, self powered, config 1, UHCI root hub(0x0000), Intel(0x=
0000), rev 1.00
 port 1 powered
 port 2 addr 2: full speed, power 100 mA, config 1, UGX(0x3003), ALPS(0x044=
e), rev 7.81
Controller /dev/usb3:
addr 1: high speed, self powered, config 1, EHCI root hub(0x0000), Intel(0x=
0000), rev 1.00
 port 1 powered
 port 2 powered
 port 3 powered
 port 4 powered
 port 5 addr 2: high speed, self powered, config 1, USB Memory Stick Slot(0=
x014d), Sony(0x054c), rev 1.10
 port 6 powered
#

Last "good" kernel dated Dec 9 2004. (or near this date).

As I notice it allways panics when some process gets Giant, (usually it
is bluetooth process)

Looks like it is USB problem, but probably it is bluetooth related. I am
not sure.

I can provide more details.

> randy

--=20
Vladimir B. Grebenchikov
vova@fbsd.ru
_______________________________________________
freebsd-current@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "freebsd-current-unsubscribe@freebsd.org"

--=-/aV4VwvMH0ZArwudcSpB--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?1105738135.1124.9.camel>