Subject: Re: kern/34070: btconfig: SIOCSBTFLAGS: Resource temporarily
To: None <kern-bug-people@netbsd.org, gnats-admin@netbsd.org,>
From: Iain Hibbert <plunky@rya-online.net>
List: netbsd-bugs
Date: 11/25/2006 09:35:02
The following reply was made to PR kern/34070; it has been noted by GNATS.

From: Iain Hibbert <plunky@rya-online.net>
To: Matthias Drochner <M.Drochner@fz-juelich.de>
Cc: gnats-bugs@NetBSD.org, kern-bug-people@NetBSD.org,
	gnats-admin@NetBSD.org, netbsd-bugs@NetBSD.org, wulf@NetBSD.org
Subject: Re: kern/34070: btconfig: SIOCSBTFLAGS: Resource temporarily 
 unavailable
Date: Sat, 25 Nov 2006 09:32:02 +0000 (GMT)

 On Fri, 24 Nov 2006, Matthias Drochner wrote:
 
 > [data toggle code in ehci.c]
 > M.Drochner@fz-juelich.de said:
 > > The code above looks bogus - I can't imagine how transactions which
 > > are not executed could contribute to the state of the data toggle
 > > protocol.
 >
 > Now I understand that that code (partially) rolls back a data toggle
 > pre-computation in ehci_alloc_sqtd_chain().
 
 > There is an obvious flaw however: It doesn't care about alignment
 > wrt wMaxPacketSize, so it will miss a packet under some conditions.
 
 > I'm not so eager to mess with that code right now, but I see an easy
 > workaround which is at least good to prove that theory: Allocate
 > transfer buffers in multiples of wMaxPacketSize.
 
 > With the appended patch my ubt initializes, and an "btconfig -vvv"
 > finishes successfully.
 
 Why 272, does 256 work?  HCI_EVENT_PKT_SIZE is 256 - I only subtract the 1
 because USB adaptors do not provide the type octet, but it does not really
 matter if an extra byte is allocated.
 
 Not that I can suggest masking such a bug by conforming to a hidden magic
 number (I wonder if 16 is a generally used value)
 
 iain