CVS commit: src/sys/external/bsd/dwc2/dist

2023-04-09 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sun Apr  9 12:31:10 UTC 2023

Modified Files:
src/sys/external/bsd/dwc2/dist: dwc2_hcdddma.c

Log Message:
dwc2: KASSERT(A && B) -> KASSERT(A); KASSERT(B)


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/sys/external/bsd/dwc2/dist/dwc2_hcdddma.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/external/bsd/dwc2/dist/dwc2_hcdddma.c
diff -u src/sys/external/bsd/dwc2/dist/dwc2_hcdddma.c:1.10 src/sys/external/bsd/dwc2/dist/dwc2_hcdddma.c:1.11
--- src/sys/external/bsd/dwc2/dist/dwc2_hcdddma.c:1.10	Tue Dec 21 09:51:22 2021
+++ src/sys/external/bsd/dwc2/dist/dwc2_hcdddma.c	Sun Apr  9 12:31:10 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: dwc2_hcdddma.c,v 1.10 2021/12/21 09:51:22 skrll Exp $	*/
+/*	$NetBSD: dwc2_hcdddma.c,v 1.11 2023/04/09 12:31:10 riastradh Exp $	*/
 
 /*
  * hcd_ddma.c - DesignWare HS OTG Controller descriptor DMA routines
@@ -40,7 +40,7 @@
  * This file contains the Descriptor DMA implementation for Host mode
  */
 #include 
-__KERNEL_RCSID(0, "$NetBSD: dwc2_hcdddma.c,v 1.10 2021/12/21 09:51:22 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: dwc2_hcdddma.c,v 1.11 2023/04/09 12:31:10 riastradh Exp $");
 
 #include 
 #include 
@@ -99,7 +99,8 @@ static int dwc2_desc_list_alloc(struct d
 {
 	int err;
 
-	KASSERT(!cpu_intr_p() && !cpu_softintr_p());
+	KASSERT(!cpu_intr_p());
+	KASSERT(!cpu_softintr_p());
 
 	qh->desc_list = NULL;
 	qh->desc_list_sz = sizeof(struct dwc2_hcd_dma_desc) *



CVS commit: src/sys/external/bsd/dwc2/dist

2023-04-09 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sun Apr  9 12:31:10 UTC 2023

Modified Files:
src/sys/external/bsd/dwc2/dist: dwc2_hcdddma.c

Log Message:
dwc2: KASSERT(A && B) -> KASSERT(A); KASSERT(B)


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/sys/external/bsd/dwc2/dist/dwc2_hcdddma.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/external/bsd/dwc2/dist

2019-07-14 Thread Michael van Elst
Module Name:src
Committed By:   mlelstv
Date:   Sun Jul 14 13:55:43 UTC 2019

Modified Files:
src/sys/external/bsd/dwc2/dist: dwc2_hcd.c

Log Message:
Fix error path, kmem_free doesn't allow NULL pointers.
Fix compilation with CONFIG_USB_DWC2_TRACK_MISSED_SOFS.


To generate a diff of this commit:
cvs rdiff -u -r1.22 -r1.23 src/sys/external/bsd/dwc2/dist/dwc2_hcd.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/external/bsd/dwc2/dist

2019-07-14 Thread Michael van Elst
Module Name:src
Committed By:   mlelstv
Date:   Sun Jul 14 13:55:43 UTC 2019

Modified Files:
src/sys/external/bsd/dwc2/dist: dwc2_hcd.c

Log Message:
Fix error path, kmem_free doesn't allow NULL pointers.
Fix compilation with CONFIG_USB_DWC2_TRACK_MISSED_SOFS.


To generate a diff of this commit:
cvs rdiff -u -r1.22 -r1.23 src/sys/external/bsd/dwc2/dist/dwc2_hcd.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/external/bsd/dwc2/dist/dwc2_hcd.c
diff -u src/sys/external/bsd/dwc2/dist/dwc2_hcd.c:1.22 src/sys/external/bsd/dwc2/dist/dwc2_hcd.c:1.23
--- src/sys/external/bsd/dwc2/dist/dwc2_hcd.c:1.22	Mon Aug 27 17:13:07 2018
+++ src/sys/external/bsd/dwc2/dist/dwc2_hcd.c	Sun Jul 14 13:55:43 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: dwc2_hcd.c,v 1.22 2018/08/27 17:13:07 riastradh Exp $	*/
+/*	$NetBSD: dwc2_hcd.c,v 1.23 2019/07/14 13:55:43 mlelstv Exp $	*/
 
 /*
  * hcd.c - DesignWare HS OTG Controller host-mode routines
@@ -42,7 +42,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: dwc2_hcd.c,v 1.22 2018/08/27 17:13:07 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: dwc2_hcd.c,v 1.23 2019/07/14 13:55:43 mlelstv Exp $");
 
 #include 
 #include 
@@ -2424,13 +2424,16 @@ int dwc2_hcd_init(struct dwc2_hsotg *hso
 error3:
 	dwc2_hcd_release(hsotg);
 error2:
-	kmem_free(hsotg->core_params, sizeof(*hsotg->core_params));
+	if (hsotg->core_params != NULL)
+		kmem_free(hsotg->core_params, sizeof(*hsotg->core_params));
 
 #ifdef CONFIG_USB_DWC2_TRACK_MISSED_SOFS
-	kmem_free(hsotg->last_frame_num_array,
-	  sizeof(*hsotg->last_frame_num_array) * FRAME_NUM_ARRAY_SIZE);
-	kmem_free(hsotg->frame_num_array,
-		  sizeof(*hsotg->frame_num_array) * FRAME_NUM_ARRAY_SIZE);
+	if (hsotg->last_frame_num_array != NULL)
+		kmem_free(hsotg->last_frame_num_array,
+		  sizeof(*hsotg->last_frame_num_array) * FRAME_NUM_ARRAY_SIZE);
+	if (hsotg->frame_num_array != NULL)
+		kmem_free(hsotg->frame_num_array,
+			  sizeof(*hsotg->frame_num_array) * FRAME_NUM_ARRAY_SIZE);
 #endif
 
 	dev_err(hsotg->dev, "%s() FAILED, returning %d\n", __func__, retval);
@@ -2460,7 +2463,7 @@ void dwc2_hcd_remove(struct dwc2_hsotg *
 	dwc2_hcd_release(hsotg);
 
 #ifdef CONFIG_USB_DWC2_TRACK_MISSED_SOFS
-	kfree(hsotg->last_frame_num_array);
-	kfree(hsotg->frame_num_array);
+	kmem_free(hsotg->last_frame_num_array, sizeof(*hsotg->last_frame_num_array) * FRAME_NUM_ARRAY_SIZE);
+	kmem_free(hsotg->frame_num_array, sizeof(*hsotg->frame_num_array) * FRAME_NUM_ARRAY_SIZE);
 #endif
 }



Re: CVS commit: src/sys/external/bsd/dwc2/dist

2014-07-26 Thread Takahiro HAYASHI

(07/26/14 18:18), Nick Hudson wrote:

Log Message:
Recover from channel halt errors by using the 3 strikes xacterr rule.

Adapted from the RaspberryPI linux driver.

This allows the rum(4) I was sent to be somewhat usable. Need to
investigate further what is causing the problem in the first place.

Might help PR/49019 (RPI: interrupt storm when url0 is up)


I tried this but still get intr storm when if is up.


--
t-hash