Commit graph

872,913 commits

Author SHA1 Message Date
qctecmdr
310a5c3075 Merge "usb: dwc3: Fix USB gadget initialization sequence" 2019-10-28 13:39:03 -07:00
qctecmdr
6d73fbad77 Merge "usb: dwc3: Avoid NULL pointer access in dwc3_calc_trbs_left" 2019-10-28 13:03:02 -07:00
qctecmdr
8d79cb85f0 Merge "usb: dwc3: Do not traverse list using list_for_each_safe" 2019-10-28 12:27:37 -07:00
qctecmdr
3c7ed8087d Merge "usb: dwc3: gadget: delay clearing run/stop when setup just arrived" 2019-10-28 11:47:22 -07:00
qctecmdr
dc87488bd4 Merge "dwc3: gadget: Stop active transfer pending on ep0 out/in during reset" 2019-10-28 11:08:09 -07:00
qctecmdr
c2e15eef58 Merge "usb: dwc3: Fix incorrect ep0 state on reset" 2019-10-28 10:32:57 -07:00
qctecmdr
a7d5a85aa0 Merge "usb: dwc3: resize txfifo of IN/INT endpoint before enabling it" 2019-10-28 09:55:51 -07:00
qctecmdr
4c196dd091 Merge "usb: dwc3: Add QTI MSM platform specific feature and other changes" 2019-10-28 09:24:14 -07:00
qctecmdr
86cb2da52a Merge "ASoC: Add a debug message to track widget power up/down" 2019-10-27 20:51:11 -07:00
qctecmdr
f53b149a86 Merge "ASoC: Change info logs to debug" 2019-10-27 20:13:16 -07:00
qctecmdr
6c77d64802 Merge "msm: qdsp6v2: Add timestamp support for compress capture" 2019-10-27 19:32:59 -07:00
qctecmdr
18dc13d57e Merge "msm: ipa3: Query stats from Q6 NLO PROD/CONS" 2019-10-27 02:42:23 -07:00
Mayank Rana
47636fc5a2 usb: dwc3: Fix USB gadget initialization sequence
This change fixes below issues:
1. registering UDC driver with udc core with dwc3 probe itself, so USB
composition script can find UDC device while trying to select UDC.
2. creation of required USB endpoints related debugfs entries useful for
debugging.
3. USB high speed only functionality fallback mechanism when USB super
speed phy is not initialized.

Change-Id: I893e6221ceb6af448695f5399e857be0c25f41b1
Signed-off-by: Mayank Rana <mrana@codeaurora.org>
Signed-off-by: Hemant Kumar <hemantk@codeaurora.org>
Signed-off-by: Jack Pham <jackp@codeaurora.org>
2019-10-26 23:24:02 -07:00
Pratham Pratap
7972f5f996 usb: dwc3: Avoid NULL pointer access in dwc3_calc_trbs_left
dwc3_calc_trbs_left function is calling dwc3_ep_prev_trb
which can return NULL if trb pool is empty. This change adds
check for the return value of dwc3_ep_prev_trb function to
avoid NULL pointer dereference.

Change-Id: Id11d5ffd23da7c070d5e0b26842d8738b073b212
Signed-off-by: Pratham Pratap <prathampratap@codeaurora.org>
Signed-off-by: Jack Pham <jackp@codeaurora.org>
2019-10-26 23:24:02 -07:00
Hemant Kumar
bd1c66bfdb usb: dwc3: Do not traverse list using list_for_each_safe
There is a possibility of race between endpoint transfer
completion context and stop active transfer context. As
a result dwc3_gadget_ep_cleanup_completed_requests() iterates
over started_list using list_for_each_safe while
dwc3_remove_requests() is deleting req from started list.
While iterating over current list node list_for_each_safe caches
next list node. If the cached list node is getting deleted by
dwc3_remove_requests() then request for same list node would be
given back as part of endpoint transfer completion. This result
into list_del corruption because list node is getting deleted
twice. Fix this issue by iterating started_list using while loop
and always accessing first node from list head.

Change-Id: I64104a43ade015923deeb1f230a17dea08817052
Signed-off-by: Hemant Kumar <hemantk@codeaurora.org>
Signed-off-by: Jack Pham <jackp@codeaurora.org>
2019-10-26 23:24:02 -07:00
Jack Pham
44775a35a9 usb: dwc3: gadget: delay clearing run/stop when setup just arrived
There still exists a small window in which dwc3_gadget_pullup()
is called while a new control transfer setup packet had newly
arrived. In the case where it needs to be delegated to the gadget
driver, it releases dwc3->lock and allows pullup() to proceed to
call run_stop() to attempt to stop the controller. The lock will
get released again when calling dwc3_stop_active_transfers()
which allows the gadget driver to meanwhile call ep_queue() for
a three-stage control transfer and sneak in a Start Transfer. By
the time the DCTL register is written, the controller will fail
to halt due to having an outstanding transfer in progress.

CPU0                               CPU1
...dwc3->lock held...
dwc3_ep0_inspect_setup()           dwc3_gadget_pullup()
 dwc3_ep0_delegate_req()            spin_lock_irq_save()
  spin_unlock()                     ... unblocked
   composite_setup()                dwc3_gadget_run_stop()
    usb_ep_queue()                      dwc3_stop_active_transfers()
     dwc3_gadget_ep0_queue()          dwc3_gadget_remove_requests()
      spin_lock_irqsave()              dwc3_gadget_giveback()
      ... unblocked                     spin_unlock()
       __dwc3_ep0_do_control_data()     spin_lock()
        issues Start Transfer
      spin_unlock_irqrestore()          ... unblocked
  spin_lock()                        clear DCTL_RUN_STOP
  ...                                wait for DSTS_DEVCTRLHLT
                                     time out

This change attempts to fix the issue by additionally checking
the dwc->ep0_next_event state in dwc3_gadget_pullup() to catch
the case when a SETUP packet had just been received and handled
by dwc3_ep0_inspect_setup but is still waiting to proceed to
either a DATA or STATUS stage. This allows pullup() to wait for
completion of the transfer before moving on to clear run/stop.

Change-Id: Ib2da3c86213ade1a61fb82f95a1f7c9534d9df3f
Signed-off-by: Jack Pham <jackp@codeaurora.org>
2019-10-26 23:24:02 -07:00
Vijayavardhan Vennapusa
d0acc50c66 dwc3: gadget: Stop active transfer pending on ep0 out/in during reset
if USB bus reset is received from Host in middle of control transfer
request, SW needs to complete pending control transfer and setup core
for next setup stage as per data book. Hence check ep0 state during
reset interrupt handling and make sure active transfers on ep0 out/in
endpoint are stopped by queuing ENDXFER command for that endpoint
and restart ep0 out again to receive next setup packet.

Change-Id: Idf8adf3c2416e7945d879bf88c321e1eea3c31d4
Signed-off-by: Vijayavardhan Vennapusa <vvreddy@codeaurora.org>
Signed-off-by: Hemant Kumar <hemantk@codeaurora.org>
Signed-off-by: Jack Pham <jackp@codeaurora.org>
2019-10-26 23:24:02 -07:00
Sriharsha Allenki
f7a9e06d4f usb: dwc3: Fix incorrect ep0 state on reset
According to the databook ep0 should be in setup
phase during reset. If host issues reset between
control transfers, ep0 will be  in an invalid state.
Fix this my issuing stall and restart on ep0 if it
is not in setup phase.

CRs-Fixed: 2136658
Change-Id: I6dc20c2735a6ce772533ccb5b63ba5d1b01f89d7
Signed-off-by: Sriharsha Allenki <sallenki@codeaurora.org>
Signed-off-by: Hemant Kumar <hemantk@codeaurora.org>
Signed-off-by: Jack Pham <jackp@codeaurora.org>
2019-10-26 23:24:01 -07:00
Mayank Rana
ec2321135d usb: dwc3: resize txfifo of IN/INT endpoint before enabling it
USB IN/INT endpoint stalls when performing TX FIFO resize functionality
when IN/INT endpoint is already active i.e. usb endpoint is enabled and
usb request is pending with it. Fix this issue by making sure that TX
FIFO resize is performed before enabling endpoint which shall happen
after set_alt(1) and before any function queues request with its
allocated USB endpoint.

This commit also squashes the following commits from previous kernels:

  Revert "usb: dwc3: drop FIFO resizing logic"
  dwc3: gadget: Improve TX FIFO resize functionality
  dwc3: gadget: Use default TX FIFO size as 1024 bytes with each IN eps
  usb: gadget: Use mult as 3 for GSI related USB IN endpoint always
  USB: dwc3: gadget: Fix TxFIFO resizing logic
  dwc3: Preserve TxFIFO of IN/INT EP for UDC without tx-fifo-resize
  dwc3: gadget: Use TXFIFO register based on used dwc3 version
  dwc3: gadget: Increase TXFIFO size as 6KB for GSI IN endpoint
  usb: dwc3: Change TXFIFO size for GSI IN EP based on controller
  usb: dwc3: gadget: Fix TXFIFO resize logic for non-zero EPs
  usb: dwc3: Increase the TxFIFO resize factor

Change-Id: I13a590f87ab8492f7c95a15b2da9f00c9c63c4f9
Signed-off-by: Mayank Rana <mrana@codeaurora.org>
Signed-off-by: Jack Pham <jackp@codeaurora.org>
2019-10-26 23:24:01 -07:00
Jack Pham
f84c92f1ec usb: dwc3: Add QTI MSM platform specific feature and other changes
This change adds the following QTI MSM platform specific features
to the USB DWC3 core & gadget drivers:
  - BAM/DBM endpoint support
  - GSI endpoint support
  - low power mode
  - glue layer notifications
  - high speed-only fallback
  - additional debug logging

Change-Id: I0f733d05f3f88a4a734d8489b5eb548391ab3af3
Signed-off-by: Jack Pham <jackp@codeaurora.org>
2019-10-26 23:19:08 -07:00
qctecmdr
cc4575e377 Merge "ion: Simplify carveout heap base/size retrieval/error handling" 2019-10-25 23:55:06 -07:00
qctecmdr
b9d2daee17 Merge "ion: msm: Remove [cma/dma]_get_[base/size] usage" 2019-10-25 23:21:43 -07:00
qctecmdr
b116d136aa Merge "msm: camera: Add camera dt binding definitions" 2019-10-25 22:45:56 -07:00
qctecmdr
dc1f76410c Merge "iommu/arm-smmu: report BID, PID and MID of client on context fault" 2019-10-25 22:06:18 -07:00
qctecmdr
b0093c18ee Merge "iommu/arm-smmu: bypass hypervisor and read sync/inval status register" 2019-10-25 21:32:09 -07:00
qctecmdr
05e3ee327e Merge "synx: Add synx cancel signaling status" 2019-10-25 20:56:24 -07:00
qctecmdr
0380c9f41c Merge "interconnect: qcom: lahaina: Remove stub functions" 2019-10-25 20:23:51 -07:00
qctecmdr
fb260342cc Merge "interconnect: qcom: fix up endianness for rpmh messages" 2019-10-25 19:47:15 -07:00
qctecmdr
92d776643b Merge "defconfig: lahaina-gki: Enable DISP_CC clock driver" 2019-10-25 19:14:07 -07:00
qctecmdr
e57f7c7d90 Merge "clk: qcom: Add DISP_CC clock driver for Lahaina" 2019-10-25 17:51:55 -07:00
qctecmdr
6ae0f4df39 Merge "defconfig: lahaina-gki: Enable VIDEO_CC clock driver" 2019-10-25 16:43:50 -07:00
qctecmdr
19d4c23d99 Merge "ion: Conditionally compile page pool refill code" 2019-10-25 15:16:52 -07:00
qctecmdr
dce6dcf388 Merge "arm64: defconfig: Enable CONFIG_VM_EVENT_COUNTERS on Lahaina" 2019-10-25 14:19:26 -07:00
qctecmdr
1c59c5c9fa Merge "drivers: cpuidle: lpm-levels-of: conform to arm,idle-state definition" 2019-10-25 13:44:41 -07:00
qctecmdr
3ad8b20ba6 Merge "drivers: soc: qcom: snapshot of sleep drivers for Lahaina" 2019-10-25 13:09:23 -07:00
qctecmdr
8062cba26a Merge "usb: gadget: Add check gadget function bind or not" 2019-10-25 12:16:48 -07:00
qctecmdr
23db3d58bf Merge "usb: dwc3: gadget: Keep track of IRQ timing statistics" 2019-10-25 11:33:09 -07:00
qctecmdr
e47b3563e4 Merge "usb: dwc3: Keep track of interrupt statistics" 2019-10-25 10:55:58 -07:00
qctecmdr
ffc159f25b Merge "usb: dwc3: debug: Add logging APIs using IPC logging framework" 2019-10-25 10:19:26 -07:00
qctecmdr
7a8fe7f744 Merge "usb: xhci-plat: Add DT parameter to program xhci imod_interval" 2019-10-25 09:42:20 -07:00
qctecmdr
c4cf9870ca Merge "usb: dwc3: Increase the inter packet gap for USB 2.0" 2019-10-25 09:06:52 -07:00
qctecmdr
ceb8561931 Merge "clk: dt-bindings: gpu-cc: Update gpu clock driver header for Lahaina" 2019-10-25 06:11:16 -07:00
qctecmdr
f8479eca07 Merge "net: qrtr: Add IPC logging for qrtr" 2019-10-25 04:44:31 -07:00
qctecmdr
039c7ea65a Merge "msm: IPA: mhi_proxy: correct the mhi vote for both bus and device" 2019-10-25 03:24:32 -07:00
qctecmdr
f4de4c753b Merge "mm: vmscan: support complete shrinker reclaim" 2019-10-25 02:45:51 -07:00
qctecmdr
6500d721cf Merge "mm: run the showmem notifier in alloc failure" 2019-10-25 02:00:47 -07:00
qctecmdr
1a805820af Merge "mm, oom: run the showmem notifier in oom" 2019-10-25 01:05:34 -07:00
qctecmdr
7cadb9f2ea Merge "mm: cma: retry only on EBUSY" 2019-10-25 00:25:58 -07:00
qctecmdr
b95c1d307e Merge "mm: cma: Increase retries if less blocks available" 2019-10-24 23:39:33 -07:00
qctecmdr
6324083247 Merge "mm: cma: Register with show_mem notification framework" 2019-10-24 22:55:53 -07:00