NetBSD-Bugs archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
Re: kern/50278: umidi(4) loses first incoming message after second open
The following reply was made to PR kern/50278; it has been noted by GNATS.
From: Andreas Gustafsson <gson%gson.org@localhost>
To: gnats-bugs%NetBSD.org@localhost
Cc: Nick Hudson <nick.hudson%gmx.co.uk@localhost>
Subject: Re: kern/50278: umidi(4) loses first incoming message after second open
Date: Thu, 28 Nov 2019 11:34:24 +0200
I have found the cause of the problem in the OHCI case: the toggle
carry gets reset in ohci_abort_xfer() when the MIDI device is closed
as the test program exits for the first time. The following patch
fixes it. It's similar to the patch in PR 54070, but applies to
ohci_abort_xfer() rather than ohci_softintr().
Index: ohci.c
===================================================================
RCS file: /bracket/repo/src/sys/dev/usb/ohci.c,v
retrieving revision 1.290
diff -u -r1.290 ohci.c
--- ohci.c 11 Aug 2019 22:55:03 -0000 1.290
+++ ohci.c 28 Nov 2019 08:57:02 -0000
@@ -2348,7 +2348,9 @@
if (hit) {
DPRINTFN(1, "set hd=0x%08jx, tl=0x%08jx", (int)p->physaddr,
(int)O32TOH(sed->ed.ed_tailp), 0, 0);
- sed->ed.ed_headp = HTOO32(p->physaddr); /* unlink TDs */
+ /* unlink TDs, preserving toggle carry */
+ sed->ed.ed_headp = HTOO32(p->physaddr |
+ (O32TOH(sed->ed.ed_headp) & OHCI_TOGGLECARRY));
usb_syncmem(&sed->dma,
sed->offs + offsetof(ohci_ed_t, ed_headp),
sizeof(sed->ed.ed_headp),
--
Andreas Gustafsson, gson%gson.org@localhost
Home |
Main Index |
Thread Index |
Old Index