- 03 Nov, 2016 40 commits
-
-
Felipe Balbi authored
Say we have three requests prepared to the HW (reqA, reqB, and reqC). All of them are composed of SG-lists with several entries and they all requests interrupt only on last TRBs of the SG-list. When we get interrupt for reqA, it could be that reqB is already half-way transferred and some of its TRBs will have HWO already cleared. It's okay to free up TRBs without HWO bit set, but we need to guarantee we don't giveback a request that's half-way transferred as that will confuse gadget drivers. Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
-
Felipe Balbi authored
In cases where we're given an SG-list which is longer than the amount of currently available TRBs, we will be left with the same request on started_list and we should prioritize that request over possible new requests on pending_list. That's a way to guarantee requests complete in order. Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
-
Felipe Balbi authored
This will give us a simpler way of figuring out how many bytes were left in each TRB. It's useful for cases where we queue only part of an SG-list due to amount of available TRBs at the time of kicking the transfer. Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
-
Felipe Balbi authored
If XferNotReady comes before usb_ep_queue() we will set our PENDING request flag and wait for a request. However, originally, we were assuming usb_ep_queue() would always happen before our first XferNotReady and that causes a corner case where we could try to issue ENDTRANSFER command before STARTTRANSFER. Let's fix that by tracking endpoints which have been started. Reported-by: Janusz Dziedzic <januszx.dziedzic@intel.com> Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
-
Baolin Wang authored
Instead of just delaying for 100us, we should actually wait for End Transfer Command Complete interrupt before moving on. Note that this should only be done if we're dealing with one of the core revisions that actually require the interrupt before moving on. [ felipe.balbi@linux.intel.com: minor improvements ] Signed-off-by: Baolin Wang <baolin.wang@linaro.org> Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
-
Torsten Polle authored
dev_kfree_skb_any() is used to free packets that are dropped by the network stack. Therefore the function should not be used for packets that have been successfully processed by the network stack. Instead dev_consume_skb_any() has to be used for such consumed packets. This separation helps to identify dropped packets. Signed-off-by: Torsten Polle <tpolle@de.adit-jv.com> Signed-off-by: Harish Jenny K N <harish_kandiga@mentor.com> Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
-
Torsten Polle authored
Socket buffers should be linked to the (network) device that allocated the buffers. __netdev_alloc_skb performs this task. Signed-off-by: Torsten Polle <tpolle@de.adit-jv.com> Signed-off-by: Jim Baxter <jim_baxter@mentor.com> Signed-off-by: Harish Jenny K N <harish_kandiga@mentor.com> Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
-
Torsten Polle authored
Socket buffers should be linked to the (network) device that allocated the buffers. Signed-off-by: Torsten Polle <tpolle@de.adit-jv.com> Signed-off-by: Harish Jenny K N <harish_kandiga@mentor.com> Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
-
Daniel Wagner authored
There is only one waiter for the completion, therefore there is no need to use complete_all(). Let's make that clear by using complete() instead of complete_all(). The usage pattern of the completion is: waiter context waker context reinit_completion() usb_esp_queue() wait_for_completion_interruptible() ffs_ep0_complete() complete() Acked-by: Michal Nazarewicz <mina86@mina86.com> Signed-off-by: Daniel Wagner <daniel.wagner@bmw-carit.de> Cc: Felipe Balbi <balbi@kernel.org> Cc: Michal Nazarewicz <mina86@mina86.com> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Cc: linux-usb@vger.kernel.org Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
-
Masahiro Yamada authored
The combo of list_empty() check and return list_first_entry() can be replaced with list_first_entry_or_null(). Acked-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com> Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com> Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
-
Masahiro Yamada authored
The combo of list_empty() check and return list_first_entry() can be replaced with list_first_entry_or_null(). Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com> Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
-
Masahiro Yamada authored
The combo of list_empty() check and return list_first_entry() can be replaced with list_first_entry_or_null(). Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com> Acked-by: John Youn <johnyoun@synopsys.com> Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
-
Joe Perches authored
Use the more common logging mechanism. Miscellanea: o Realign multiline statements o Coalesce format Acked-by: Robert Jarzmik <robert.jarzmik@free.fr> Acked-by: Nicolas Ferre <nicolas.ferre@atmel.com> Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
-
Juergen Gross authored
Let's not reimplement generic kernel helpers, instead call kasprintf(). [ felipe.balbi@linux.intel.com: better commit log ] Signed-off-by: Juergen Gross <jgross@suse.com> Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
-
Baolin Wang authored
When we change the USB function with configfs dynamically, we possibly met this situation: one core is doing the control transfer, another core is trying to unregister the USB gadget from userspace, we must wait for completing this control tranfer, or it will hang the controller to set the DEVCTRLHLT flag. [ felipe.balbi@linux.intel.com: several fixes to the patch - call complete() before starting following SETUP transfer - add a macro for ep0_in_setup's timeout - change commit subject slightly - break lines at 72 characters (git adds an 8-character tab) - avoid changes to dwc3_gadget_run_stop() ] Signed-off-by: Baolin Wang <baolin.wang@linaro.org> Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
-
Felipe Balbi authored
That function is unnecessarily called from dwc3_gadget_reset_interrupt(). Gadget drivers (and thus, functions) are required to dequeue all pending requests when they get notified about a USB Bus Reset. Trying to make sure there are no pending requests only serves the purpose of working around possibly bad gadgets. Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
-
Felipe Balbi authored
This helper will be responsible for reading and parsing our properties. No functional changes in this patch, cleanup only. Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
-
Felipe Balbi authored
Kernel will give us page aligned memory anyway. Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
-
Felipe Balbi authored
This little helper will be used to setup anything related to GCTL register. There are no functional changes, this is a cleanup only patch. Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
-
Felipe Balbi authored
This little helper will be used to make sure we're dealing with a valid Synopsys DWC3 or DWC3.1 core. Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
-
John Youn authored
For the usb31 IP and from version 2.90a of the usb3 IP, the core supports HW exit from L1 in HS. Enable it, otherwise the controller may never exit from LPM to do a transfer. Signed-off-by: John Youn <johnyoun@synopsys.com> Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
-
Lu Baolu authored
Member @mem in struct dwc3 is not used in any places. Clean up it. Signed-off-by: Lu Baolu <baolu.lu@linux.intel.com> Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
-
Felipe Balbi authored
We should never kill the machine just because some USB endpoint type is wrong. WARN about it and move on. Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
-
Felipe Balbi authored
We don't need to know about short packets unless gadget driver told us it's not ok to see them on the bus. In the normal situation we can continue processing the list of requests if we get a Short packet. Also, note that we're making sure ISP is only set for OUT endpoints, where that setting is valid. Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
-
Felipe Balbi authored
CSP bit is only valid for OUT endpoints. Synopsys databook is unclear if HW ignores CSP for IN endpoints (chances are, it does) but to avoid problems, let's make sure to set CSP only when valid to do so. Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
-
Felipe Balbi authored
Recent changes have turned this field obsolete. Remove it. Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
-
Felipe Balbi authored
By extracting smaller functions from dwc3_ep0_handle_feature(), it becomes far easier to understand what's going on. Cleanup only, no functional changes. Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
-
Felipe Balbi authored
Cleanup only, no functional changes. Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
-
Felipe Balbi authored
Cleanup only, no functional changes. Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
-
Felipe Balbi authored
We want to reduce the usage of dwc3_trace() in favor of proper tracepoints which can be enabled/disabled by the user. Let's start with our register accessors. Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
-
Felipe Balbi authored
We shouldn't have any glue layer which doesn't compile everywhere. In order to make sure this is always the case, make sure COMPILE_TEST is properly added at dependency list of a config entry. Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
-
Felipe Balbi authored
We don't need dwc3_trace() unless we're building a kernel with CONFIG_FTRACE. This patch reduces dwc3.ko text size a bit while also removing overhead of dwc3_trace() calls. text data bss dec hex filename 50796 581 0 51377 c8b1 drivers/usb/dwc3/dwc3.o 43961 581 0 44542 adfe drivers/usb/dwc3/dwc3.o.patched Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
-
Felipe Balbi authored
We can offset the latency of a full Start Transfer command - where we _must_ poll for its completion - to usb_ep_enable() time. This means that once requests start showing up from the gadget driver, we can rely on No Response Update Transfer command - where we don't need to poll for completion. This patch, starts implementing this method for Bulk endpoints, even though, technically, we could extend it to all other endpoints in future commits. Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
-
Felipe Balbi authored
In case of periodic transfers, let's pretty print the size field as a multiplier followed by length, such as : 3x 1024 instead of: 33555456 Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
-
Felipe Balbi authored
Now that usb_endpoint_maxp() only returns the lowest 11 bits from wMaxPacketSize, we can remove the & operation from this driver. Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
-
Felipe Balbi authored
Now that usb_endpoint_maxp() only returns the lowest 11 bits from wMaxPacketSize, we can remove the & operation from this driver. Cc: Li Yang <leoli@freescale.com> Cc: <linuxppc-dev@lists.ozlabs.org> Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
-
Felipe Balbi authored
Now that usb_endpoint_maxp() only returns the lowest 11 bits from wMaxPacketSize, we can remove the & operation from this driver. Cc: Valentina Manea <valentina.manea.m@gmail.com> Cc: Shuah Khan <shuah@kernel.org> Cc: <linux-usb@vger.kernel.org> Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
-
Felipe Balbi authored
Now that usb_endpoint_maxp() only returns the lowest 11 bits from wMaxPacketSize, we can remove the & operation from this driver. Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
-
Felipe Balbi authored
Now that usb_endpoint_maxp() only returns the lowest 11 bits from wMaxPacketSize, we can remove the & operation from this driver. Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
-
Felipe Balbi authored
Now that usb_endpoint_maxp() only returns the lowest 11 bits from wMaxPacketSize, we can remove the & operation from this driver. Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
-