U-Boot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [PATCH] usb: dwc3: fixes crash in dwc3 driver due to types size mismatch
@ 2016-07-21 10:41 Ravi Babu
  2016-07-21 11:42 ` Marek Vasut
  0 siblings, 1 reply; 15+ messages in thread
From: Ravi Babu @ 2016-07-21 10:41 UTC (permalink / raw)
  To: u-boot

The crash at dwc3 driver observed due to offset misalignment
of structure members across files causing wrong code generation
and leads to crash, the issue is found during dfu test.

For instance, ther is is mismatch in code generation to
access the address of structure member dwc->dep[0] in
gadget.c and ep0.c. This leads to NULL pointer reference
casuing the crash. The inclusion of common.h fixes the issue.

The crash occurs due to below commit[1], revert of this patch
resolves the issue.

>>[1] commit 95ebc253e6d4a3370e3dab14743bfc99fcd9cf1b
>>Author: Masahiro Yamada <yamada.masahiro@socionext.com>
>>Date:   Tue Jun 28 10:48:40 2016 +0900

types.h: move and redefine resource_size_t

Currently, this is only defined in arch/arm/include/asm/types.h,
so move it to include/linux/types.h to make it available for all
architectures.

I defined it with phys_addr_t as Linux does.  I needed to surround
the define with #ifdef __KERNEL__ ... #endif to avoid build errors
in tools building.  (Host tools should not include <linux/types.h>
in the first place, but this is already messy in U-Boot...)

>>Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
>>Reviewed-by: Simon Glass <sjg@chromium.org>

Signed-off-by: Ravi Babu <ravibabu@ti.com>
---
 drivers/usb/dwc3/ep0.c |    1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/usb/dwc3/ep0.c b/drivers/usb/dwc3/ep0.c
index 12b133f..f49a06e 100644
--- a/drivers/usb/dwc3/ep0.c
+++ b/drivers/usb/dwc3/ep0.c
@@ -14,6 +14,7 @@
  * SPDX-License-Identifier:     GPL-2.0
  */
 
+#include <common.h>
 #include <linux/kernel.h>
 #include <linux/list.h>
 
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2016-07-26 13:16 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-07-21 10:41 [U-Boot] [PATCH] usb: dwc3: fixes crash in dwc3 driver due to types size mismatch Ravi Babu
2016-07-21 11:42 ` Marek Vasut
2016-07-21 12:29   ` B, Ravi
2016-07-21 12:35     ` Marek Vasut
2016-07-21 12:44       ` B, Ravi
2016-07-21 12:54         ` Marek Vasut
2016-07-21 13:03           ` B, Ravi
2016-07-21 13:05             ` Marek Vasut
2016-07-22  5:10     ` Masahiro Yamada
2016-07-22  8:06       ` B, Ravi
2016-07-22 10:19       ` Marek Vasut
2016-07-22 11:55       ` Tom Rini
2016-07-26 12:59         ` B, Ravi
2016-07-26 13:04           ` Tom Rini
2016-07-26 13:16             ` B, Ravi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox