An error occurred fetching the project authors.
- 27 Jan, 2015 1 commit
-
-
Amit Virdi authored
commit ec512fb8 upstream. When scatter gather (SG) is used, multiple TRBs are prepared from one DWC3 request (dwc3_request). So while preparing TRBs, the 'last' flag should be set only when it is the last TRB being prepared from the last dwc3_request entry. The current implementation uses list_is_last to check if the dwc3_request is the last entry from the request_list. However, list_is_last returns false for the last entry too. This is because, while preparing the first TRB from a request, the function dwc3_prepare_one_trb modifies the request's next and prev pointers while moving the URB to req_queued. Hence, list_is_last always returns false no matter what. The correct way is not to access the modified pointers of dwc3_request but to use list_empty macro instead. Fixes: e5ba5ec8 (usb: dwc3: gadget: fix scatter gather implementation) Signed-off-by:
Amit Virdi <amit.virdi@st.com> Signed-off-by:
Felipe Balbi <balbi@ti.com> Signed-off-by:
Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
- 14 Nov, 2014 2 commits
-
-
Felipe Balbi authored
[ Upstream commit 7a608559 ] According to our Gadget Framework API documentation, ->set_halt() *must* return -EAGAIN if we have pending transfers (on either direction) or FIFO isn't empty (on TX endpoints). Fix this bug so that the mass storage gadget can be used without stall=0 parameter. This patch should be backported to all kernels since v3.2. Suggested-by:
Alan Stern <stern@rowland.harvard.edu> Signed-off-by:
Felipe Balbi <balbi@ti.com> Signed-off-by:
Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Jack Pham authored
commit 1200a82a upstream. On ISOC endpoints the last trb_pool entry used as a LINK TRB is not getting zeroed out correctly due to memset being called incorrectly and in the wrong place. If pool allocated from DMA was not zero-initialized to begin with this will result in the size and ctrl values being random garbage. Call memset correctly after assignment of the trb_link pointer. Fixes: f6bafc6a ("usb: dwc3: convert TRBs into bitshifts") Signed-off-by:
Jack Pham <jackp@codeaurora.org> Signed-off-by:
Felipe Balbi <balbi@ti.com> Signed-off-by:
Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
- 01 Jul, 2014 1 commit
-
-
Felipe Balbi authored
commit 687ef981 upstream. so it seems like DWC3 IP doesn't clear stalls automatically when we disable an endpoint, because of that, we _must_ make sure stalls are cleared before clearing the proper bit in DALEPENA register. Reported-by:
Johannes Stezenbach <js@sig21.net> Signed-off-by:
Felipe Balbi <balbi@ti.com> Signed-off-by:
Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
- 20 Dec, 2013 1 commit
-
-
Alan Stern authored
commit a535d81c upstream. The dwc3 UDC driver doesn't implement endpoint wedging correctly. When an endpoint is wedged, the gadget driver should be allowed to clear the wedge by calling usb_ep_clear_halt(). Only the host is prevented from resetting the endpoint. This patch fixes the implementation. Signed-off-by:
Alan Stern <stern@rowland.harvard.edu> Tested-by:
Pratyush Anand <pratyush.anand@st.com> Signed-off-by:
Felipe Balbi <balbi@ti.com> Signed-off-by:
Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
- 27 Sep, 2013 1 commit
-
-
Felipe Balbi authored
commit b0d7ffd4 upstream. We cannot request an IRQ with spinlocks held as that would trigger a sleeping inside spinlock warning. Reported-by:
Stephen Boyd <sboyd@codeaurora.org> Signed-off-by:
Felipe Balbi <balbi@ti.com> Signed-off-by:
Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
- 04 Aug, 2013 1 commit
-
-
Felipe Balbi authored
commit cdcedd69 upstream. In case we fail our ->udc_start() callback, we should be ready to accept another modprobe following the failed one. We had forgotten to clear dwc->gadget_driver back to NULL and, because of that, we were preventing gadget driver modprobe from being retried. Signed-off-by:
Felipe Balbi <balbi@ti.com> Signed-off-by:
Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
- 28 May, 2013 1 commit
-
-
George Cherian authored
we never allocate a TRB pool for physical endpoints 0 and 1 so trying to free it (a invalid TRB pool pointer) will lead us in a warning while removing dwc3.ko module. In order to fix the situation, all we have to do is skip dwc3_free_trb_pool() for physical endpoints 0 and 1 just as we while deleting endpoints from the endpoints list. Cc: stable@vger.kernel.org Signed-off-by:
George Cherian <george.cherian@ti.com> Signed-off-by:
Felipe Balbi <balbi@ti.com>
-
- 18 Mar, 2013 12 commits
-
-
Felipe Balbi authored
that way we will only tell gadget framework about the endpoints we actually have. Signed-off-by:
Felipe Balbi <balbi@ti.com>
-
Felipe Balbi authored
In DWC3 versions < 2.50a configured without Hibernation mode enabled, there will be an extra link status change interrupt if device detects host-initiated U3 exit. In that case, core will generate an unnecessary U3 -> RESUME transition which should be ignored by the driver. Signed-off-by:
Felipe Balbi <balbi@ti.com>
-
Felipe Balbi authored
udc-core provides a better way to handle release methods, let's use it. Signed-off-by:
Felipe Balbi <balbi@ti.com>
-
Felipe Balbi authored
udc-core now handles that for us, which means we can remove it from our driver. Signed-off-by:
Felipe Balbi <balbi@ti.com>
-
Felipe Balbi authored
udc-core now sets dma-related and parent fields for us, we don't need to do it ourselves. Signed-off-by:
Felipe Balbi <balbi@ti.com>
-
Felipe Balbi authored
make use of the previously introduced gadget->state field. Signed-off-by:
Felipe Balbi <balbi@ti.com>
-
Felipe Balbi authored
by moving to threaded IRQs, we allow our IRQ priorities to be configurable when running with realtime patch. Also, since we're running in thread context, we can call functions which might sleep, such as sysfs_notify() without problems. Signed-off-by:
Felipe Balbi <balbi@ti.com>
-
Felipe Balbi authored
Add support for basic power management on the dwc3 driver. While there is still lots to improve for full PM support, this minimal patch will already make sure that we survive suspend-to-ram and suspend-to-disk without major issues. Cc: Vikas C Sajjan <vikas.sajjan@linaro.org> Tested-by:
Vivek Gautam <gautam.vivek@samsung.com> Signed-off-by:
Felipe Balbi <balbi@ti.com>
-
Felipe Balbi authored
This will be used during resume to verify if we should reconnect our pullups or not. Tested-by:
Vivek Gautam <gautam.vivek@samsung.com> Signed-off-by:
Felipe Balbi <balbi@ti.com>
-
Felipe Balbi authored
we don't need to enable IRQs until we have a gadget driver loaded and ready to work, so let's delay IRQ enable to ->udc_start() and IRQ disable to ->udc_stop(). While at that, also move the related use of request_irq() and free_irq(). Tested-by:
Vivek Gautam <gautam.vivek@samsung.com> Signed-off-by:
Felipe Balbi <balbi@ti.com>
-
Felipe Balbi authored
We don't need the ->register_my_device flag anymore because all UDC drivers have been properly converted. Let's remove every history of it. Signed-off-by:
Felipe Balbi <balbi@ti.com>
-
Felipe Balbi authored
We don't need to register that device ourselves if we simply set gadget->register_my_device. Signed-off-by:
Felipe Balbi <balbi@ti.com>
-
- 04 Mar, 2013 1 commit
-
-
Felipe Balbi authored
the params variables on dwc3_gadget_conndone_interrupt() is only memset() to zero but never used in that function, so we can safely drop the variable and memset() call. Signed-off-by:
Felipe Balbi <balbi@ti.com>
-
- 24 Jan, 2013 1 commit
-
-
Felipe Balbi authored
First of all, that 28 value makes no sense as HIRD threshold is a 4-bit value, second of all it's causing issues for OMAP5. Using 12 because commit cbc725b3 (usb: dwc3: keep default hird threshold value as 4b1100) had the intention of setting the maximum allowed value of 0xc. Also, original code has been wrong forever, so this should be backported as far back as possible. Cc: <stable@vger.kernel.org> Signed-off-by:
Felipe Balbi <balbi@ti.com>
-
- 18 Jan, 2013 10 commits
-
-
Pratyush Anand authored
I am not sure, why I found it during SG debugging. But, I noticed that even when req_queued list was empty, there were some request in request_list having queued flag true. If I run test second time, it first removes all request from request_list and hence busy_slot was wrongly incremented. Cc: <stable@vger.kernel.org> Signed-off-by:
Pratyush Anand <pratyush.anand@st.com> Signed-off-by:
Felipe Balbi <balbi@ti.com>
-
Pratyush Anand authored
To work with scatter gather properly, fixes have been done in number of functions. I will explain requirement of each fixes one by one. start_slot: used to retrieve all request of SG during cleanup dwc3_gadget_giveback: We need to skip link TRB if it was one of the intermediate TRB of SG. dwc3_prepare_one_trb: We need to track all submitted TRBs during cleanup. Since, all TRBs would be serially allocated, so we can just keep starting slot info and we can always find rest of them. We need to pass sg node number, so that we cab appropriately program ISOC_FIRST/ISOC, Chain etc. dwc3_prepare_trbs: last_one should be set when it is last node of SG as well as last node of request_list. __dwc3_cleanup_done_trbs: It has been prepared after re-factorization of dwc3_cleanup_done_reqs. It is called for each TRB of SG. Signed-off-by:
Pratyush Anand <pratyush.anand@st.com> Signed-off-by:
Felipe Balbi <balbi@ti.com>
-
Pratyush Anand authored
UPDATE_TRANSFER does not need any parameters. So, no need to prepare it. Signed-off-by:
Pratyush Anand <pratyush.anand@st.com> Signed-off-by:
Felipe Balbi <balbi@ti.com>
-
Pratyush Anand authored
When we reach to link trb, we just need to increase free_slot and then calculate TRB. Return is not correct, as it will cause wrong TRB DMA address to fetch in case of update transfer. Cc: <stable@vger.kernel.org> Signed-off-by:
Pratyush Anand <pratyush.anand@st.com> Signed-off-by:
Felipe Balbi <balbi@ti.com>
-
Pratyush Anand authored
There were still some corner cases where isoc transfer was not able to restart, specially when missed isoc does not happen , and in fact gadget does not queue any new request during giveback. Cleanup function calls giveback first, which provides a way to queue another request to gadget. But gadget did not had any data. So , it did not call ep_queue. To twist it further, gadget did not queue till cleanup for last queued TRB is called. If we ever reach this scenario, we must call END TRANSFER, so that we receive a new xfernotready with information about current microframe number. Also insure that there is no request submitted to core when issuing END TRANSFER. Cc: <stable@vger.kernel.org> # v3.8 Signed-off-by:
Pratyush Anand <pratyush.anand@st.com> Signed-off-by:
Felipe Balbi <balbi@ti.com>
-
Pratyush Anand authored
Its better to return from each if condition as they are mutually exclusive. Signed-off-by:
Pratyush Anand <pratyush.anand@st.com> Signed-off-by:
Felipe Balbi <balbi@ti.com>
-
Pratyush Anand authored
There are two reasons to generate missed isoc. 1. when the host does not poll for all the data. 2. because of application-side delays that prevent all the data from being transferred in programmed microframe. Current code was able to handle first case only. This patch handles scenario 2 as well.Scenario 2 sometime may occur with complex gadget application, however it can be easily reproduced for testing purpose as follows: a. use isoc binterval as 1 in f_sourcesink. b. use pattern=0 c. introduce a delay of 150us deliberately in source_sink_complete, so that after few frames it lands into scenario 2. d. now run testusb 16 (isoc in test). You will notice that if this patch is not applied then isoc transfer is not able to recover after first missed. Current patch's approach is as under: If missed isoc occurs and there is no request queued then issue END TRANSFER, so that core generates next xfernotready and we will issue a fresh START TRANSFER. If there are still queued request then wait, do not issue either END or UPDATE TRANSFER, just attach next request in request_list during giveback. If any future queued request is successfully transferred then we will issue UPDATE TRANSFER for all request in the request_list. Cc: <stable@vger.kernel.org> # v3.6 v3.7 v3.8 Signed-off-by:
Pratyush Anand <pratyush.anand@st.com> Signed-off-by:
Felipe Balbi <balbi@ti.com>
-
Pratyush Anand authored
Synopsys says: The HIRD Threshold field must be set to ‘0’ when the device core is operating in super speed mode. This patch implements above statement. Cc: <stable@vger.kernel.org> # v3.6 v3.7 v3.8 Acked-by:
Paul Zimmerman <paulz@synopsys.com> Signed-off-by:
Pratyush Anand <pratyush.anand@st.com> Signed-off-by:
Felipe Balbi <balbi@ti.com>
-
Pratyush Anand authored
dwc3_gadget_set_ep_config expects maxburst as incremented by 1. So, by default initialize ep->maxburst to 1 for ep0. Cc: <stable@vger.kernel.org> Signed-off-by:
Pratyush Anand <pratyush.anand@st.com> Signed-off-by:
Felipe Balbi <balbi@ti.com>
-
Felipe Balbi authored
we have an extra 'ret' variable shadowing a previous definition. Remove it. Signed-off-by:
Felipe Balbi <balbi@ti.com>
-
- 21 Nov, 2012 1 commit
-
-
Bill Pemberton authored
CONFIG_HOTPLUG is going away as an option so __devinit is no longer needed. Signed-off-by:
Bill Pemberton <wfp5p@virginia.edu> Cc: Peter Korsgaard <jacmet@sunsite.dk> Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com> Acked-by:
Felipe Balbi <balbi@ti.com> Cc: Li Yang <leoli@freescale.com> Acked-by:
Alan Stern <stern@rowland.harvard.edu> Cc: Geoff Levand <geoff@infradead.org> Cc: Wan ZongShun <mcuos.com@gmail.com> Cc: Olav Kongas <ok@artecdesign.ee> Cc: Lennert Buytenhek <kernel@wantstofly.org> Cc: Ben Dooks <ben-linux@fluff.org> Cc: Kukjin Kim <kgene.kim@samsung.com> Acked-by:
Nicolas Ferre <nicolas.ferre@atmel.com> Signed-off-by:
Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
- 15 Oct, 2012 1 commit
-
-
Felipe Balbi authored
If a USB transfer has already been started, meaning we have already issued StartTransfer command to that particular endpoint, DWC3_EP_BUSY flag has also already been set. When we try to cancel this transfer which is already in controller's cache, we will not receive XferComplete event and we must clear DWC3_EP_BUSY in order to allow subsequent requests to be properly started. The best place to clear that flag is right after issuing DWC3_DEPCMD_ENDTRANSFER. Cc: stable@vger.kernel.org # v3.4 v3.5 v3.6 Reported-by:
Moiz Sonasath <m-sonasath@ti.com> Signed-off-by:
Felipe Balbi <balbi@ti.com>
-
- 06 Sep, 2012 2 commits
-
-
Pratyush Anand authored
If xfernotready is received and there is no request in request_list then REQUEST_PENDING flag must be set, so that next request in ep queue is executed. In case of isoc transfer, if xfernotready is already elapsed and even first request has not been queued to request_list, then issue END TRANSFER, so that you can receive xfernotready again and can have notion of current microframe. Signed-off-by:
Pratyush Anand <pratyush.anand@st.com> Signed-off-by:
Felipe Balbi <balbi@ti.com>
-
Pratyush Anand authored
In case of ep0 out, if length is not aligned to maxpacket size then we use dwc->ep_bounce_addr for dma transfer and not request->dma. Since, we have alreday done memcpy from dwc->ep0_bounce to request->buf, so we do not need to issue cache sync function. In fact, cache sync function will bring wrong data in request->buf from request->dma in this scenario. So, cache sync function must not be executed in case of ep0 bounced. Cc: <stable@vger.kernel.org> # v3.4 v3.5 Signed-off-by:
Pratyush Anand <pratyush.anand@st.com> Signed-off-by:
Felipe Balbi <balbi@ti.com>
-
- 31 Aug, 2012 1 commit
-
-
Chanho Park authored
When connection is established non-ss mode, endpoint.maxburst is correctly set to 0, this means that current code will set maxburst bitfield on DEPCFG's parameter 0 to the highest possible value (0x0f) which is wrong. Even though this hasn't caused any issues so far (HW seems to ignore that when not running in SS mode) we want to make sure maxburst bitfield is only set to anything other than zero if we're running on SuperSpeed mode. In order to achieve that, let's check for gadget's operating speed before setting maxburst bitfield when issuing DEPCFG command. [ balbi@ti.com : improved commit log a bit in order to clarify the situation ] Signed-off-by:
Chanho Park <chanho61.park@samsung.com> Signed-off-by:
Kyungmin Park <kyungmin.park@samsung.com> Signed-off-by:
Felipe Balbi <balbi@ti.com>
-
- 15 Aug, 2012 1 commit
-
-
Felipe Balbi authored
In case some gadget driver tries to enable an endpoint which is already enabled, we print a nice WARN so we can track broken gadget drivers. The only problem is that we're printing the WARN when we already changed endpoint's name, which would result in endpoints named as: ep1in-bulk-bulk-bulk-bulk-bulk-bulk-bulk To prevent that, we will continue to print the WARN, but do so before changing endpoint's name and return early. Signed-off-by:
Felipe Balbi <balbi@ti.com>
-
- 09 Aug, 2012 1 commit
-
-
Pratyush Anand authored
dwc3_stop_active_transfer has been called from two places. After each calling of this function , we should allow 100 us delay to synchronize with interconnect. It would be better if we put this delay in that function only, rather than into calling routine of this function. Signed-off-by:
Pratyush Anand <pratyush.anand@st.com> Reported-by:
Michel Sanches <michel.sanches@st.com> Signed-off-by:
Felipe Balbi <balbi@ti.com>
-
- 07 Aug, 2012 1 commit
-
-
Pratyush Anand authored
When MISSED_ISOC is set, BUSY is also set. Since, we are handling MISSED_ISOC as a separate case in third scenario, therefore handle only BUSY but not MISSED_ISOC in second scenario. Signed-off-by:
Pratyush Anand <pratyush.anand@st.com> Signed-off-by:
Felipe Balbi <balbi@ti.com>
-