Skip to content

Commit 1840bfa

Browse files
Pull up following revision(s) (requested by rin in ticket #44):
sys/dev/usb/ehci.c: revision 1.333 ehci: usb_syncmem against qtd **after** KASSERT for that qtd Otherwise, we end up with stale data for DIAGNOSTIC kernel. Fix device-probe failures discussed in PR kern/58730 for me. (The main topic of the PR, NFS client lock-up, is not addressed.)
1 parent a584b01 commit 1840bfa

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

sys/dev/usb/ehci.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* $NetBSD: ehci.c,v 1.332 2025/04/26 07:05:56 skrll Exp $ */
1+
/* $NetBSD: ehci.c,v 1.332.2.1 2025/10/01 17:21:19 martin Exp $ */
22

33
/*
44
* Copyright (c) 2004-2012,2016,2020 The NetBSD Foundation, Inc.
@@ -54,7 +54,7 @@
5454
*/
5555

5656
#include <sys/cdefs.h>
57-
__KERNEL_RCSID(0, "$NetBSD: ehci.c,v 1.332 2025/04/26 07:05:56 skrll Exp $");
57+
__KERNEL_RCSID(0, "$NetBSD: ehci.c,v 1.332.2.1 2025/10/01 17:21:19 martin Exp $");
5858

5959
#include "ohci.h"
6060
#include "uhci.h"
@@ -3822,11 +3822,11 @@ ehci_device_ctrl_start(struct usbd_xfer *xfer)
38223822
usb_syncmem(&setup->dma, setup->offs, sizeof(*setup->qtd),
38233823
BUS_DMASYNC_PREWRITE | BUS_DMASYNC_PREREAD);
38243824

3825-
usb_syncmem(&status->dma, status->offs, sizeof(*status->qtd),
3826-
BUS_DMASYNC_PREWRITE | BUS_DMASYNC_PREREAD);
3827-
38283825
KASSERT(status->qtd->qtd_status & htole32(EHCI_QTD_TOGGLE_MASK));
38293826

3827+
usb_syncmem(&status->dma, status->offs, sizeof(*status->qtd),
3828+
BUS_DMASYNC_PREWRITE | BUS_DMASYNC_PREREAD);
3829+
38303830
#ifdef EHCI_DEBUG
38313831
DPRINTFN(5, "--- dump start ---", 0, 0, 0, 0);
38323832
ehci_dump_sqh(sqh);

0 commit comments

Comments
 (0)