From: "Du, Changbin"
Add debugobject support to track the life time of struct urb.
This feature help us detect violation of urb operations by
generating a warning message from debugobject core. And we fix
the possible issues at runtime to avoid oops if we can.
I have done
From: "Du, Changbin"
Since the buffer size for req is rounded up to maxpacketsize,
then we may end up with more data then user space has space
for.
If it happen, we can keep the excess data for next i/o, or
report an error. But we cannot silently drop data, because
USB
From: "Du, Changbin"
Add the usage of new binding mode 'any'.
$ echo any > UDC
Signed-off-by: Du, Changbin
Signed-off-by: Du, Changbin
---
Documentation/usb/gadget_configfs.txt | 6 --
1 file changed, 4 insertions(+), 2
From: "Du, Changbin"
On most platforms, there is only one device controller available.
In this case, we desn't care the UDC's name. So let's ignore the
name by setting 'UDC' to 'any'. And also we can change UDC name
at any time if it is not binded (no need set to ""
From: "Du, Changbin"
When I am configuring Gadget Configfs, I need found a exactly UDC name before
I can start my gadget. But, really I doesn't care about which UDC name is used,
because I have only controller. "any" is a good option.
Du, Changbin (2):
usb: configfs:
From: "Du, Changbin"
The dwc3 controller can't generate a disconnect event after it is
stopped. Thus gadget dissconnect callback is not invoked when do
soft dissconnect. Call dissconnect here to workaround this issue.
Note, most time we still see disconnect be called that
From: "Du, Changbin"
FIFO/Queue available space info can be used to debug dwc3 issues.
First we remove unnecessary checking for debugfs api call, then add
the new entry.
Du, Changbin (2):
usb: dwc3: make dwc3_debugfs_init return value be void
usb: dwc3: add debugfs
From: "Du, Changbin"
For DWC3 USB controller, the Global Debug Queue/FIFO Space Available
Register(GDBGFIFOSPACE) can be used to dump FIFO/Queue available space.
This can be used to check some special issues, like whether data is
successfully copied from memory to fifo
From: "Du, Changbin"
Debugfs init failure is not so important. We can continue our job on
this failure. Also no break need for debugfs_create_file call failure.
Signed-off-by: Du, Changbin
---
v4:
Do not fail silently, but print error.
---
From: "Du, Changbin"
dwc->regset is allocated on dwc3_debugfs_init, and should
be released on init failure or dwc3_debugfs_exit. Btw,
The line "dwc->root = NULL" is unnecessary, so remove it.
Signed-off-by: Du, Changbin
---
v3:
remove unnecessary
From: "Du, Changbin"
dwc->regset is allocated on dwc3_debugfs_init, and should
be released on init failure or dwc3_debugfs_exit. Btw,
The line "dwc->root = NULL" is unnecessary, so remove it.
Signed-off-by: Du, Changbin
---
v2:
Title changed;
From: "Du, Changbin"
dwc->regset is allocated on dwc3_debugfs_init, and should
be released on dwc3_debugfs_exit.
Signed-off-by: Du, Changbin
---
This patch is seperated from patch set:
[PATCH v2 0/3] Improvement, fix and new entry for dwc3 debugfs
From: "Du, Changbin"
Debugfs init failure is not so important. We can continue our job on
this failure. Also no need to check debugfs_create_file call results.
Signed-off-by: Du, Changbin
---
changes from v2:
no changes
---
From: "Du, Changbin"
FIFO/Queue available space info can be used to debug dwc3 issues.
First we remove unnecessary checking for debugfs api call, then add
the new entry.
changes from v2:
1. Remove commit "usb: dwc3: free dwc->regset on dwc3_debugfs_exit"
Du, Changbin
From: "Du, Changbin"
For DWC3 USB controller, the Global Debug Queue/FIFO Space Available
Register(GDBGFIFOSPACE) can be used to dump FIFO/Queue available space.
This can be used to check some special issues, like whether data is
successfully copied from memory to fifo
From: "Du, Changbin"
Debugfs init failure is not so important. We can continue our job on
this failure. Also no need to check debugfs_create_file call results.
Signed-off-by: Du, Changbin
---
drivers/usb/dwc3/core.c| 10 +-
From: "Du, Changbin"
For DWC3 USB controller, the Global Debug Queue/FIFO Space Available
Register(GDBGFIFOSPACE) can be used to dump FIFO/Queue available space.
This can be used to check some special issues, like whether data is
successfully copied from memory to fifo
From: "Du, Changbin"
Signed-off-by: Du, Changbin
---
drivers/usb/dwc3/debugfs.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/usb/dwc3/debugfs.c b/drivers/usb/dwc3/debugfs.c
index 071b286..2d4f397 100644
---
From: "Du, Changbin"
Actually, the function only clean one trb. So rename the function.
Signed-off-by: Du, Changbin
---
drivers/usb/dwc3/gadget.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/usb/dwc3/gadget.c
From: "Du, Changbin"
This is a reworked patch based on reverted commit d8f00cd685f5 ("usb:
hub: do not clear BOS field during reset device").
The privious one caused double mem-free if run to re_enumerate label.
New patch title changed to distinguish from old one. And I
From: "Du, Changbin"
ffs_epfile_io and ffs_epfile_io_complete runs in different context, but
there is no synchronization between them.
consider the following scenario:
1) ffs_epfile_io interrupted by sigal while
wait_for_completion_interruptible
2) then ffs_epfile_io set
From: "Du, Changbin"
acm, ecm, hid, ncm, phonet, rndis and uvc functions all have double
memory free issue. Set pointers to NULL after freed to avoid this.
Here explain how it happen on acm function, others has analogical case.
If acm_bind fails before allocate
From: "Du, Changbin"
If acm_bind fails before allocate notification and acm->notify_req is
not set to NULL after freed last time, double free will happen.
kernel BUG at mm/slub.c:3392!
invalid opcode: [#1] PREEMPT SMP
EIP is at kfree+0x172/0x180
Call Trace:
From: "Du, Changbin"
Queue a request to disabled ep doesn't make sense, and induce caller
make mistakes.
Here is a example for the android mtp gadget function driver. A mem
corruption can happen on below senario.
1) On disconnect, mtp driver disable its EPs,
2) During
From: "Du, Changbin"
Queue a request to disabled ep doesn't make sense, and induce caller
make mistakes.
Here is a example for the android mtp gadget function driver. A mem
corruption can happen on below senario.
1) On disconnect, mtp driver disable its EPs,
2) During
From: "Du, Changbin"
Queue a request to disabled ep doesn't make sense, and induce caller
make mistakes.
Here is a example for the android mtp gadget function driver. A mem
corruption can happen on below senario.
1) On disconnect, mtp driver disable its EPs,
2) During
From: "Du, Changbin"
When usb_ep_enable on a enabled ep, the configuration of the ep probably
has changed. In this scenario, the ep configuration in hw should be
reprogrammed by udc driver. Hence, it is better to return an error to
inform the caller.
Signed-off-by: Du,
From: "Du, Changbin"
Queue a request to disabled ep doesn't make sense, and induce caller
make mistakes.
Here is a example for the android mtp gadget function driver. A mem
corruption can happen on below senario.
1) On disconnect, mtp driver disable its EPs,
2) During
From: "Du, Changbin"
To stop an out endpoint, software should set sets the Global OUT NAK,
but not the Global Non-periodic IN NAK. This driver bug leads the out-ep
failed be in disabled state with below error.
dwc2_hsotg_ep_stop_xfr: timeout DOEPCTL.EPDisable
From: "Du, Changbin"
With the first patch, enable a enabled ep will return -EBUSY.
The second patch forbid queuing on disabled ep to avoid panic.
Du, Changbin (2):
usb: dwc2: add ep enabled flag to avoid double enable/disable
usb: dwc2: forbid queuing request to a
From: "Du, Changbin"
Enabling a already enabled ep is illegal, because the ep may has trbs
running. Reprogram the ep may break running transfer. So udc driver
must avoid this happening by return an error -EBUSY. Gadget function
driver also should avoid such things, but
From: "Du, Changbin"
Queue a request to disabled ep doesn't make sense, and induce caller
make mistakes.
Here is a example for the android mtp gadget function driver. A mem
corruption can happen on below senario.
1) On disconnect, mtp driver disable its EPs,
2) During
32 matches
Mail list logo