Skip to content

Commit e7ae055

Browse files
Pull up following revision(s) (requested by rin in ticket #1169):
sys/dev/usb/ehci.c: revision 1.333 (patch) 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 0b18ada commit e7ae055

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

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.315.2.4 2024/02/17 11:27:30 martin Exp $ */
1+
/* $NetBSD: ehci.c,v 1.315.2.5 2025/10/01 17:23:32 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.315.2.4 2024/02/17 11:27:30 martin Exp $");
57+
__KERNEL_RCSID(0, "$NetBSD: ehci.c,v 1.315.2.5 2025/10/01 17:23:32 martin Exp $");
5858

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

3783-
usb_syncmem(&status->dma, status->offs, sizeof(status->qtd),
3784-
BUS_DMASYNC_PREWRITE | BUS_DMASYNC_PREREAD);
3785-
37863783
KASSERT(status->qtd.qtd_status & htole32(EHCI_QTD_TOGGLE_MASK));
37873784

3785+
usb_syncmem(&status->dma, status->offs, sizeof(status->qtd),
3786+
BUS_DMASYNC_PREWRITE | BUS_DMASYNC_PREREAD);
3787+
37883788
#ifdef EHCI_DEBUG
37893789
DPRINTFN(5, "--- dump start ---", 0, 0, 0, 0);
37903790
ehci_dump_sqh(sqh);

0 commit comments

Comments
 (0)