Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/external/bsd/dwc2 Do not call usb_syncmem(9) with len = ...



details:   https://anonhg.NetBSD.org/src/rev/91aa7c3e2d79
branches:  trunk
changeset: 363688:91aa7c3e2d79
user:      rin <rin%NetBSD.org@localhost>
date:      Tue Aug 07 08:36:30 2018 +0000

description:
Do not call usb_syncmem(9) with len = 0 to avoid diagnostic assertion
failure in bus_dmamap_sync(9) on Raspberry Pi 3 Model B running in
aarch64 mode.

Workaround for PR port-evbarm/53503.

diffstat:

 sys/external/bsd/dwc2/dwc2.c |  8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)

diffs (29 lines):

diff -r c6074a38adcf -r 91aa7c3e2d79 sys/external/bsd/dwc2/dwc2.c
--- a/sys/external/bsd/dwc2/dwc2.c      Tue Aug 07 08:26:42 2018 +0000
+++ b/sys/external/bsd/dwc2/dwc2.c      Tue Aug 07 08:36:30 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: dwc2.c,v 1.49 2018/04/09 16:21:11 jakllsch Exp $       */
+/*     $NetBSD: dwc2.c,v 1.50 2018/08/07 08:36:30 rin Exp $    */
 
 /*-
  * Copyright (c) 2013 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: dwc2.c,v 1.49 2018/04/09 16:21:11 jakllsch Exp $");
+__KERNEL_RCSID(0, "$NetBSD: dwc2.c,v 1.50 2018/08/07 08:36:30 rin Exp $");
 
 #include "opt_usb.h"
 
@@ -1475,7 +1475,9 @@
                 * everything else does.
                 */
                if (!(xfertype == UE_CONTROL &&
-                   UGETW(xfer->ux_request.wLength) == 0)) {
+                   UGETW(xfer->ux_request.wLength) == 0) &&
+                   xfer->ux_actlen > 0 /* XXX PR/53503 */
+                   ) {
                        int rd = usbd_xfer_isread(xfer);
 
                        usb_syncmem(&xfer->ux_dmabuf, 0, xfer->ux_actlen,



Home | Main Index | Thread Index | Old Index