- 02 10月, 2015 40 次提交
-
-
由 Mian Yousaf Kaukab 提交于
Make sure there are no requests pending on ep0 before reinitializing core. Otherwise, dwc2_hsotg_enqueue_setup will fail afterwards. Also, take hsotg->lock before calling dwc2_hsotg_core_init_disconnected() from dwc2_conn_id_status_change() as dwc2_hsotg_complete_request() expect lock to be held. Signed-off-by: NMian Yousaf Kaukab <yousaf.kaukab@intel.com> Tested-by: NRobert Baldyga <r.baldyga@samsung.com> Tested-by: NDinh Nguyen <dinguyen@opensource.altera.com> Tested-by: NJohn Youn <johnyoun@synopsys.com> Acked-by: NJohn Youn <johnyoun@synopsys.com> Signed-off-by: NFelipe Balbi <balbi@ti.com>
-
由 Mian Yousaf Kaukab 提交于
If the request being dequeued is already started, disable endpoint to stop the transfer and then call dwc2_hsotg_complete_request(). Endpoint will be re-enabled on next call to dwc2_hsotg_start_req(). Signed-off-by: NMian Yousaf Kaukab <yousaf.kaukab@intel.com> Tested-by: NRobert Baldyga <r.baldyga@samsung.com> Tested-by: NDinh Nguyen <dinguyen@opensource.altera.com> Tested-by: NJohn Youn <johnyoun@synopsys.com> Acked-by: NJohn Youn <johnyoun@synopsys.com> Signed-off-by: NFelipe Balbi <balbi@ti.com>
-
由 Mian Yousaf Kaukab 提交于
wIndex field was missing. Also print in natural order instead of Req first, so that its easier to compare for example against bus analyzer logs. Signed-off-by: NMian Yousaf Kaukab <yousaf.kaukab@intel.com> Tested-by: NRobert Baldyga <r.baldyga@samsung.com> Tested-by: NDinh Nguyen <dinguyen@opensource.altera.com> Tested-by: NJohn Youn <johnyoun@synopsys.com> Acked-by: NJohn Youn <johnyoun@synopsys.com> Signed-off-by: NFelipe Balbi <balbi@ti.com>
-
由 Mian Yousaf Kaukab 提交于
dwc2_hsotg_start_req starts a request only if endpoint is not stalled. Ignore this check for ep0 as core will clear DOEPCTL0.Stall after sending stall handshake. Prepare instead for receiving next setup packet. Signed-off-by: NMian Yousaf Kaukab <yousaf.kaukab@intel.com> Tested-by: NRobert Baldyga <r.baldyga@samsung.com> Tested-by: NDinh Nguyen <dinguyen@opensource.altera.com> Tested-by: NJohn Youn <johnyoun@synopsys.com> Acked-by: NJohn Youn <johnyoun@synopsys.com> Signed-off-by: NFelipe Balbi <balbi@ti.com>
-
由 Gregory Herrero 提交于
No point of continue with initialization if core is not in a sane state. Signed-off-by: NGregory Herrero <gregory.herrero@intel.com> Signed-off-by: NMian Yousaf Kaukab <yousaf.kaukab@intel.com> Tested-by: NRobert Baldyga <r.baldyga@samsung.com> Tested-by: NDinh Nguyen <dinguyen@opensource.altera.com> Tested-by: NJohn Youn <johnyoun@synopsys.com> Acked-by: NJohn Youn <johnyoun@synopsys.com> Signed-off-by: NFelipe Balbi <balbi@ti.com>
-
由 Gregory Herrero 提交于
Some device may have external id pin control enabled, so op_state will not be set on id pin interrupt change. Thus, ensure op_state is set to peripheral during vbus detection. Signed-off-by: NGregory Herrero <gregory.herrero@intel.com> Signed-off-by: NMian Yousaf Kaukab <yousaf.kaukab@intel.com> Tested-by: NRobert Baldyga <r.baldyga@samsung.com> Tested-by: NDinh Nguyen <dinguyen@opensource.altera.com> Tested-by: NJohn Youn <johnyoun@synopsys.com> Acked-by: NJohn Youn <johnyoun@synopsys.com> Signed-off-by: NFelipe Balbi <balbi@ti.com>
-
由 Gregory Herrero 提交于
Modifying the pullup state during host mode trig a new enumeration of attached device. Thus, avoid modifying pullup in host mode. Signed-off-by: NGregory Herrero <gregory.herrero@intel.com> Signed-off-by: NMian Yousaf Kaukab <yousaf.kaukab@intel.com> Tested-by: NRobert Baldyga <r.baldyga@samsung.com> Tested-by: NDinh Nguyen <dinguyen@opensource.altera.com> Tested-by: NJohn Youn <johnyoun@synopsys.com> Acked-by: NJohn Youn <johnyoun@synopsys.com> Signed-off-by: NFelipe Balbi <balbi@ti.com>
-
由 Mian Yousaf Kaukab 提交于
If dual role configuration is not selected, check and force dr_mode based on the selected configuration. Signed-off-by: NMian Yousaf Kaukab <yousaf.kaukab@intel.com> Tested-by: NRobert Baldyga <r.baldyga@samsung.com> Tested-by: NDinh Nguyen <dinguyen@opensource.altera.com> Tested-by: NJohn Youn <johnyoun@synopsys.com> Acked-by: NJohn Youn <johnyoun@synopsys.com> Signed-off-by: NFelipe Balbi <balbi@ti.com>
-
由 Krzysztof Opasiak 提交于
Most of USB functions place new line after attribute value. Let's follow this convention also in source sink function as it improves readability. Signed-off-by: NKrzysztof Opasiak <k.opasiak@samsung.com> Signed-off-by: NFelipe Balbi <balbi@ti.com>
-
由 Krzysztof Opasiak 提交于
Most of USB functions place new line after attribute value. Let's follow this convention also in loopback function as it improves readability. Signed-off-by: NKrzysztof Opasiak <k.opasiak@samsung.com> Signed-off-by: NFelipe Balbi <balbi@ti.com>
-
由 Sudip Mukherjee 提交于
While building allmodconfig on avr32 the build failed with the error: "at91_pmc_base" [drivers/usb/gadget/udc/atmel_usba_udc.ko] undefined! On checking the code it turned out that if CONFIG_OF is defined then it is using at91_pmc_read() which is using at91_pmc_base. And unless COMMON_CLK_AT91 is defined we donot have at91_pmc_base. And COMMON_CLK_AT91 is available with AT91 architecture. Mention the dependency such that this driver builds with avr32 only if OF is not enabled. Signed-off-by: NSudip Mukherjee <sudip@vectorindia.org> Signed-off-by: NFelipe Balbi <balbi@ti.com>
-
由 Sudip Mukherjee 提交于
A NULL comparison can be written as if (var) or if (!var). Signed-off-by: NSudip Mukherjee <sudip@vectorindia.org> Signed-off-by: NFelipe Balbi <balbi@ti.com>
-
由 Sudip Mukherjee 提交于
Rearrange the udc_basic_init function to remove the forward declaration. Signed-off-by: NSudip Mukherjee <sudip@vectorindia.org> Signed-off-by: NFelipe Balbi <balbi@ti.com>
-
由 Sudip Mukherjee 提交于
Remove the forward declarations of udc_pci_probe and udc_pci_remove. Signed-off-by: NSudip Mukherjee <sudip@vectorindia.org> Signed-off-by: NFelipe Balbi <balbi@ti.com>
-
由 Sudip Mukherjee 提交于
Rearrange udc_free_dma_chain to remove the forward declaration. While at it fixed all the relevant checkpatch warnings. Signed-off-by: NSudip Mukherjee <sudip@vectorindia.org> Signed-off-by: NFelipe Balbi <balbi@ti.com>
-
由 Sudip Mukherjee 提交于
Rearrange udc_create_dma_chain to remove the forward declaration. While rearranging fixed the relevant checkpatch warnings. Signed-off-by: NSudip Mukherjee <sudip@vectorindia.org> Signed-off-by: NFelipe Balbi <balbi@ti.com>
-
由 Sudip Mukherjee 提交于
Rearrange the udc_remote_wakeup function to remove the forward declaration. Signed-off-by: NSudip Mukherjee <sudip@vectorindia.org> Signed-off-by: NFelipe Balbi <balbi@ti.com>
-
由 Sudip Mukherjee 提交于
Rearrange the udc_probe function to remove the forward declarations. While rearranging also fixed the relevant checkpatch warnings. Signed-off-by: NSudip Mukherjee <sudip@vectorindia.org> Signed-off-by: NFelipe Balbi <balbi@ti.com>
-
由 Sudip Mukherjee 提交于
The condition checking for irq_registered, regs, mem_region and active are not required as this is the remove function. And we are in the remove means that probe was successful and they can never be NULL at this point of code. It was required in the original code as the remove function was part of the error handler of probe function. Signed-off-by: NSudip Mukherjee <sudip@vectorindia.org> Signed-off-by: NFelipe Balbi <balbi@ti.com>
-
由 Sudip Mukherjee 提交于
We have the function free_dma_pools() which frees all the dma pools. Use it instead of calling all the functions separately. The if conditions for data_requests and stp_requests are also not required here as this is the remove function and we are here means probe has succeeded and dma has been successfully allocated, so they cannot be NULL here. Signed-off-by: NSudip Mukherjee <sudip@vectorindia.org> Signed-off-by: NFelipe Balbi <balbi@ti.com>
-
由 Sudip Mukherjee 提交于
Use WARN_ON() instead of halting the kernel with BUG_ON() and also fix the checkpatch warning. Signed-off-by: NSudip Mukherjee <sudip@vectorindia.org> Signed-off-by: NFelipe Balbi <balbi@ti.com>
-
由 Sudip Mukherjee 提交于
Handle the error properly instead of calling the pci remove function. Signed-off-by: NSudip Mukherjee <sudip@vectorindia.org> Signed-off-by: NFelipe Balbi <balbi@ti.com>
-
由 Sudip Mukherjee 提交于
A rewrite of init_dma_pools() with proper error handling. Signed-off-by: NSudip Mukherjee <sudip@vectorindia.org> Signed-off-by: NFelipe Balbi <balbi@ti.com>
-
由 Mian Yousaf Kaukab 提交于
ID status change interrupt will not be handled in peripheral only configuration. So initialize op_state during gadget init. Signed-off-by: NMian Yousaf Kaukab <yousaf.kaukab@intel.com> Tested-by: NRobert Baldyga <r.baldyga@samsung.com> Tested-by: NDinh Nguyen <dinguyen@opensource.altera.com> Tested-by: NJohn Youn <johnyoun@synopsys.com> Acked-by: NJohn Youn <johnyoun@synopsys.com> Signed-off-by: NFelipe Balbi <balbi@ti.com>
-
由 Gregory Herrero 提交于
Correctly update lx_state on gadget connection and disconnection. When usb cable is disconnected, lx_state must be updated to L3 as controller could be in power off state. When usb cable is connected, lx_state must be updated to L0 as controller is powered. Signed-off-by: NGregory Herrero <gregory.herrero@intel.com> Signed-off-by: NMian Yousaf Kaukab <yousaf.kaukab@intel.com> Tested-by: NRobert Baldyga <r.baldyga@samsung.com> Tested-by: NDinh Nguyen <dinguyen@opensource.altera.com> Tested-by: NJohn Youn <johnyoun@synopsys.com> Acked-by: NJohn Youn <johnyoun@synopsys.com> Signed-off-by: NFelipe Balbi <balbi@ti.com>
-
由 Gregory Herrero 提交于
On a disconnect, dwc2 will kill all remaining urbs from qh list. urbs are given back to hcd with -ETIMEDOUT status. Some usb device driver, like mass storage, will unlink all urbs using usb_hcd_unlink_urb when receiving a negative status different from -ECONNRESET. The following flow will then happen: dwc2_hcd_disconnect() -> dwc2_kill_all_urbs() try to kill first pending urb. -> dwc2_host_complete(-ETIMEDOUT) -> usb_hcd_giveback_urb(-ETIMEDOUT) -> sg_complete() -> usb_unlink_urb() -> usb_put_dev(urb->dev) -> dwc2_kill_all_urbs() try to kill next pending urb. -> dwc2_host_complete(-ETIMEDOUT) -> usb_hcd_giveback_urb(-ETIMEDOUT) -> NULL pointer dereferencing because urb->dev has been freed for all urbs of this device. The root cause of this NULL pointer is to call call usb_unlink_urb() while we are killing all urbs. To avoid this return urb with -ECONNRESET status This issue usually happens while removing mass storage device during transfer. Signed-off-by: NGregory Herrero <gregory.herrero@intel.com> Signed-off-by: NMian Yousaf Kaukab <yousaf.kaukab@intel.com> Tested-by: NRobert Baldyga <r.baldyga@samsung.com> Tested-by: NDinh Nguyen <dinguyen@opensource.altera.com> Tested-by: NJohn Youn <johnyoun@synopsys.com> Acked-by: NJohn Youn <johnyoun@synopsys.com> Signed-off-by: NFelipe Balbi <balbi@ti.com>
-
由 Gregory Herrero 提交于
On first qh initialization, hsotg->frame_number is not corresponding to reality. So read it from host controller to get correct value. Signed-off-by: NGregory Herrero <gregory.herrero@intel.com> Signed-off-by: NMian Yousaf Kaukab <yousaf.kaukab@intel.com> Tested-by: NRobert Baldyga <r.baldyga@samsung.com> Tested-by: NDinh Nguyen <dinguyen@opensource.altera.com> Tested-by: NJohn Youn <johnyoun@synopsys.com> Acked-by: NJohn Youn <johnyoun@synopsys.com> Signed-off-by: NFelipe Balbi <balbi@ti.com>
-
由 Gregory Herrero 提交于
Print urb->iso_frame_desc.status after it has been updated using dwc2_hcd_urb_get_iso_desc_status(). Signed-off-by: NGregory Herrero <gregory.herrero@intel.com> Signed-off-by: NMian Yousaf Kaukab <yousaf.kaukab@intel.com> Tested-by: NRobert Baldyga <r.baldyga@samsung.com> Tested-by: NDinh Nguyen <dinguyen@opensource.altera.com> Tested-by: NJohn Youn <johnyoun@synopsys.com> Acked-by: NJohn Youn <johnyoun@synopsys.com> Signed-off-by: NFelipe Balbi <balbi@ti.com>
-
由 Gregory Herrero 提交于
Some high speed mass storage devices fail to enumerate with following error: Cannot enable port %i. Maybe the USB cable is bad? This happens only when the device is plugged while the controller is in hibernation state. After exiting hibernation, the controller detects the device as a low speed device and fail to enumerate it. Problem occurs only if HPRT0.PWR bit is programmed in a too short delay after exiting hibernation. Dumping hprt register in _dwc2_hcd_resume() directly after dwc2_exit_hibernation() shows that HPRT0.LNSTS (D+/D- level) becomes valid approximately 2ms after exiting hibernation. Since dwc2_exit_hibernation() is called from atomic context, move the delay out of this function. Delay value is experimental and not mentioned in Synopsys documentation. To be on the safe side 3ms delay is used. Signed-off-by: NGregory Herrero <gregory.herrero@intel.com> Signed-off-by: NMian Yousaf Kaukab <yousaf.kaukab@intel.com> Tested-by: NRobert Baldyga <r.baldyga@samsung.com> Tested-by: NDinh Nguyen <dinguyen@opensource.altera.com> Tested-by: NJohn Youn <johnyoun@synopsys.com> Acked-by: NJohn Youn <johnyoun@synopsys.com> Signed-off-by: NFelipe Balbi <balbi@ti.com>
-
由 Gregory Herrero 提交于
If an interrupt rises during hibernation process, dwc2 will assert interrupt line to interrupt controller. If interrupt is level sensitive, interrupt handler will be called in a loop because dwc2 will not be able to clear it while controller is hibernated. Thus, clear all controller interrupts before hibernation entry. Signed-off-by: NGregory Herrero <gregory.herrero@intel.com> Signed-off-by: NMian Yousaf Kaukab <yousaf.kaukab@intel.com> Tested-by: NRobert Baldyga <r.baldyga@samsung.com> Tested-by: NDinh Nguyen <dinguyen@opensource.altera.com> Tested-by: NJohn Youn <johnyoun@synopsys.com> Acked-by: NJohn Youn <johnyoun@synopsys.com> Signed-off-by: NFelipe Balbi <balbi@ti.com>
-
由 Gregory Herrero 提交于
Disable host interrupts before synchronising dwc2 irq. So that interrupts are not generated once controller is stopped. Signed-off-by: NGregory Herrero <gregory.herrero@intel.com> Signed-off-by: NMian Yousaf Kaukab <yousaf.kaukab@intel.com> Tested-by: NRobert Baldyga <r.baldyga@samsung.com> Tested-by: NDinh Nguyen <dinguyen@opensource.altera.com> Tested-by: NJohn Youn <johnyoun@synopsys.com> Acked-by: NJohn Youn <johnyoun@synopsys.com> Signed-off-by: NFelipe Balbi <balbi@ti.com>
-
由 Mian Yousaf Kaukab 提交于
GINTSTS.DisconnInt is host only interrupt and should be disable after dwc2_disable_host_interrupts is called. Signed-off-by: NMian Yousaf Kaukab <yousaf.kaukab@intel.com> Tested-by: NRobert Baldyga <r.baldyga@samsung.com> Tested-by: NDinh Nguyen <dinguyen@opensource.altera.com> Tested-by: NJohn Youn <johnyoun@synopsys.com> Acked-by: NJohn Youn <johnyoun@synopsys.com> Signed-off-by: NFelipe Balbi <balbi@ti.com>
-
由 Gregory Herrero 提交于
In case controller is asked to stop while devices are connected, disconnect all devices and clean up before stopping. Signed-off-by: NGregory Herrero <gregory.herrero@intel.com> Signed-off-by: NMian Yousaf Kaukab <yousaf.kaukab@intel.com> Tested-by: NRobert Baldyga <r.baldyga@samsung.com> Tested-by: NDinh Nguyen <dinguyen@opensource.altera.com> Tested-by: NJohn Youn <johnyoun@synopsys.com> Acked-by: NJohn Youn <johnyoun@synopsys.com> Signed-off-by: NFelipe Balbi <balbi@ti.com>
-
由 Gregory Herrero 提交于
Frame number is reset in hardware after exiting hibernation. Thus, reset frame_number and ensure qh are queued with correct sched_frame. Otherwise, qh->sched_frame may be too high compared to current frame number (which is 0). This can delay addition of qh in the list of transfers until frame number reaches qh->sched_frame. Signed-off-by: NGregory Herrero <gregory.herrero@intel.com> Signed-off-by: NMian Yousaf Kaukab <yousaf.kaukab@intel.com> Tested-by: NRobert Baldyga <r.baldyga@samsung.com> Tested-by: NDinh Nguyen <dinguyen@opensource.altera.com> Tested-by: NJohn Youn <johnyoun@synopsys.com> Acked-by: NJohn Youn <johnyoun@synopsys.com> Signed-off-by: NFelipe Balbi <balbi@ti.com>
-
由 Gregory Herrero 提交于
Port can be resumed in bus_resume callback. In this case, there is no need to drive resume a second time when hcd ask for it. Signed-off-by: NGregory Herrero <gregory.herrero@intel.com> Signed-off-by: NMian Yousaf Kaukab <yousaf.kaukab@intel.com> Tested-by: NRobert Baldyga <r.baldyga@samsung.com> Tested-by: NDinh Nguyen <dinguyen@opensource.altera.com> Tested-by: NJohn Youn <johnyoun@synopsys.com> Acked-by: NJohn Youn <johnyoun@synopsys.com> Signed-off-by: NFelipe Balbi <balbi@ti.com>
-
由 Gregory Herrero 提交于
If hibernation is supported, resume of devices will be handled in bus_resume callback. Signed-off-by: NGregory Herrero <gregory.herrero@intel.com> Signed-off-by: NMian Yousaf Kaukab <yousaf.kaukab@intel.com> Tested-by: NRobert Baldyga <r.baldyga@samsung.com> Tested-by: NDinh Nguyen <dinguyen@opensource.altera.com> Tested-by: NJohn Youn <johnyoun@synopsys.com> Acked-by: NJohn Youn <johnyoun@synopsys.com> Signed-off-by: NFelipe Balbi <balbi@ti.com>
-
由 Gregory Herrero 提交于
When a device is disconnected, lx_state must not be changed since the device may be disconnected whereas controller is still powered. Signed-off-by: NGregory Herrero <gregory.herrero@intel.com> Signed-off-by: NMian Yousaf Kaukab <yousaf.kaukab@intel.com> Tested-by: NRobert Baldyga <r.baldyga@samsung.com> Tested-by: NDinh Nguyen <dinguyen@opensource.altera.com> Tested-by: NJohn Youn <johnyoun@synopsys.com> Acked-by: NJohn Youn <johnyoun@synopsys.com> Signed-off-by: NFelipe Balbi <balbi@ti.com>
-
由 Gregory Herrero 提交于
During hcd initialization, hardware accessible flag and lx_state must be reset to the working state since controller is powered at this stage. Same logic applied for stop callback. Signed-off-by: NGregory Herrero <gregory.herrero@intel.com> Signed-off-by: NMian Yousaf Kaukab <yousaf.kaukab@intel.com> Tested-by: NRobert Baldyga <r.baldyga@samsung.com> Tested-by: NDinh Nguyen <dinguyen@opensource.altera.com> Tested-by: NJohn Youn <johnyoun@synopsys.com> Acked-by: NJohn Youn <johnyoun@synopsys.com> Signed-off-by: NFelipe Balbi <balbi@ti.com>
-
由 Gregory Herrero 提交于
Disable controller power and enter hibernation when usb bus is suspended. A phy driver is required to disable the power of the controller and detect remote-wakeup or disconnection since the controller will not be able to detect these in this state. Once the phy driver detects bus activity, it must call usb_hcd_resume_root_hub. Signed-off-by: NGregory Herrero <gregory.herrero@intel.com> Signed-off-by: NMian Yousaf Kaukab <yousaf.kaukab@intel.com> Tested-by: NRobert Baldyga <r.baldyga@samsung.com> Tested-by: NDinh Nguyen <dinguyen@opensource.altera.com> Tested-by: NJohn Youn <johnyoun@synopsys.com> Acked-by: NJohn Youn <johnyoun@synopsys.com> Signed-off-by: NFelipe Balbi <balbi@ti.com>
-
由 Gregory Herrero 提交于
lx_state must be used to reflect controller power state only and not bus state. Thus add a flag to track state during bus suspend. Signed-off-by: NGregory Herrero <gregory.herrero@intel.com> Signed-off-by: NMian Yousaf Kaukab <yousaf.kaukab@intel.com> Tested-by: NRobert Baldyga <r.baldyga@samsung.com> Tested-by: NDinh Nguyen <dinguyen@opensource.altera.com> Tested-by: NJohn Youn <johnyoun@synopsys.com> Acked-by: NJohn Youn <johnyoun@synopsys.com> Signed-off-by: NFelipe Balbi <balbi@ti.com>
-