Commit graph

884,321 commits

Author SHA1 Message Date
Felipe Balbi
3bd550d058 usb: dwc3: trace: print enqueue/dequeue pointers too
By printing enqueue/dequeue pointers, we can make sure that our TRB
handling is correct. We've had a recent situation where we were not
always dequeueing all TRBs in an SG list and this helped figure out
what the problem was.

Change-Id: Ied1c5d57b4f324c40dd219153b49a1e244b6773c
Signed-off-by: Felipe Balbi <balbi@kernel.org>
Git-commit: 30ad6273adad76017ddad737d45f8931cac554ad
Git-repo: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
Signed-off-by: Mayank Rana <mrana@codeaurora.org>
2020-06-16 13:25:06 -07:00
Thinh Nguyen
f0b846ce93 usb: dwc3: gadget: Properly handle failed kick_transfer
If dwc3 fails to issue START_TRANSFER/UPDATE_TRANSFER command, then we
should properly end an active transfer and give back all the started
requests. However if it's for an isoc endpoint, the failure maybe due to
bus-expiry status. In this case, don't give back the requests and wait
for the next retry.

Change-Id: I64ff69a663a9ad7701f877a0cf3bcd87b93c792a
Fixes: 72246da40f ("usb: Introduce DesignWare USB3 DRD Driver")
Signed-off-by: Thinh Nguyen <thinhn@synopsys.com>
Signed-off-by: Felipe Balbi <balbi@kernel.org>
Git-commit: 8d99087c2db863c5fa3a4a1f3cb82b3a493705ca
Git-repo: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
Signed-off-by: Mayank Rana <mrana@codeaurora.org>
2020-06-16 13:25:05 -07:00
Thinh Nguyen
d831e159b5 usb: dwc3: gadget: Fix request completion check
A request may not be completed because not all the TRBs are prepared for
it. This happens when we run out of available TRBs. When some TRBs are
completed, the driver needs to prepare the rest of the TRBs for the
request. The check dwc3_gadget_ep_request_completed() shouldn't be
checking the amount of data received but rather the number of pending
TRBs. Revise this request completion check.

Change-Id: If806e69c32a84caa0c839286a33ee0b092cd372a
Cc: stable@vger.kernel.org
Fixes: e0c42ce590 ("usb: dwc3: gadget: simplify IOC handling")
Signed-off-by: Thinh Nguyen <thinhn@synopsys.com>
Signed-off-by: Felipe Balbi <balbi@kernel.org>
Git-commit: 49e0590e3a60e75b493e5df879e216e5073c7663
Git-repo: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
Signed-off-by: Mayank Rana <mrana@codeaurora.org>
2020-06-16 13:25:05 -07:00
Mayank Rana
f9296fedb2 usb: dwc3: gadget: Refactor dwc3_gadget_ep_dequeue
The flow from function dwc3_gadget_ep_dequeue() is not easy to follow.
Refactor it for easier read. No functional change in this commit.

Change-Id: I254081abaf3ff7c6a7a598bf859804ecf3454a15
Signed-off-by: Thinh Nguyen <thinhn@synopsys.com>
Signed-off-by: Felipe Balbi <balbi@kernel.org>
Git-commit: fcd2def6639293c2bde2dc4f5dab63641a60b5b3
Git-repo: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
[mrana@codeaurora.org: resolve merge conflict related to debug log]
Signed-off-by: Mayank Rana <mrana@codeaurora.org>
2020-06-16 13:24:07 -07:00
Thinh Nguyen
5d1c891218 usb: dwc3: gadget: Remove unnecessary checks
Remove 2 unnecessary checks:
1) A request in the started_list must have its trb field set. So
checking for req->trb is unnecessary.

2) An endpoint must have started (and have not ended) for the request to
still be in the started_list. There's no point to check if the endpoint
is started. We had this check because previously the driver didn't
handle the endpoint's started/ended flags for END_TRANSFER command
properly. See commit 9f45581f5e ("usb: dwc3: gadget: early giveback
if End Transfer already completed").

Change-Id: I5d55f02d25abe06d5601730f1d1d88ee24809d2c
Signed-off-by: Thinh Nguyen <thinhn@synopsys.com>
Signed-off-by: Felipe Balbi <balbi@kernel.org>
Git-commit: 8411993e79df8e54da67613025d620a8a23a24fe
Git-repo: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
Signed-off-by: Mayank Rana <mrana@codeaurora.org>
2020-06-15 20:16:49 -07:00
Thinh Nguyen
db3765662a usb: dwc3: gadget: Check for in-progress END_TRANSFER
While handling TRBs completion, if a END_TRANSFER command isn't
completed, don't kick new transfer or issue END_TRANSFER command.

Change-Id: Ic1d6b942c6c7993165d574dcc70078fb269365dd
Signed-off-by: Thinh Nguyen <thinhn@synopsys.com>
Signed-off-by: Felipe Balbi <balbi@kernel.org>
Git-commit: b6842d4938c3101cb54dc262a6a89a5445f8fba8
Git-repo: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
Signed-off-by: Mayank Rana <mrana@codeaurora.org>
2020-06-15 20:12:28 -07:00
qctecmdr
19a5a7fa3b Merge "iommu: arm-smmu: Add support for new attributes" 2020-06-15 06:15:40 -07:00
qctecmdr
df997bf3be Merge "cnss2: Ignore debugfs non availability during init" 2020-06-15 06:15:39 -07:00
qctecmdr
766387ed99 Merge "power: qti_battery_charger: call power_supply_changed() if fake_soc is set" 2020-06-15 06:15:39 -07:00
qctecmdr
c8bbc5bda6 Merge "msm: kgsl: Enable IFPC on A660 target" 2020-06-15 06:15:39 -07:00
qctecmdr
9a94640833 Merge "lib: stackdepot: Add support to configure STACK_HASH_SIZE" 2020-06-15 06:15:38 -07:00
qctecmdr
da16bbb59f Merge "soc: qcom: mem-buf: Add support for consumers to import dma-bufs" 2020-06-15 06:15:37 -07:00
qctecmdr
514fa165a3 Merge "taskstats: handle NULL nla case in taskstats2" 2020-06-15 02:08:40 -07:00
qctecmdr
3309ec470b Merge "clk: qcom: videocc: Update frequency table of video_cc_mvs0_clk_src" 2020-06-15 02:08:39 -07:00
qctecmdr
1806fc87aa Merge "ABI: Update internal whitelist with debugfs symbols" 2020-06-15 02:08:39 -07:00
qctecmdr
5655d2b2cc Merge "genirq/cpuhotplug: Reduce logging level for couple of prints" 2020-06-15 02:08:39 -07:00
qctecmdr
eac6ffcdf1 Merge "uapi: sound: add support for TTP render mode" 2020-06-15 02:08:38 -07:00
qctecmdr
c122110c39 Merge "build.config: Add build.config files for Lahaina" 2020-06-15 02:08:38 -07:00
qctecmdr
8b9a1aa61f Merge "dma-mapping-fast: reduce TLBI during map" 2020-06-15 02:08:38 -07:00
qctecmdr
1b86a92815 Merge "scsi: ufs-qcom: Remove unnecessary devm_kfree" 2020-06-15 02:08:37 -07:00
qctecmdr
acc5971e09 Merge "mmc: sdhci_msm: keep a reference to the sdhc host instance" 2020-06-14 20:37:55 -07:00
qctecmdr
773bbee1f1 Merge "msm: kgsl: PERFCNTR_CTRL needs to be at end of restore list" 2020-06-14 20:37:55 -07:00
qctecmdr
978ed221d8 Merge "qcom: whitelist: Remove symbol from whitelist" 2020-06-14 20:37:54 -07:00
qctecmdr
a925659342 Merge "msm: synx: default user callback fix" 2020-06-14 20:37:54 -07:00
qctecmdr
acaddaaadd Merge "defconfig: Update initial defconfig fragments for Holi" 2020-06-14 20:37:54 -07:00
qctecmdr
55235dfe2c Merge "pci: controller: msm: Remove support for loopback" 2020-06-14 20:37:54 -07:00
qctecmdr
e69d2cded7 Merge "ABI: Update rmnet_ctl symbols" 2020-06-14 11:32:34 -07:00
qctecmdr
cdfa64e6ac Merge "arm64: defconfig: enable USB redriver on Lahaina QRD" 2020-06-14 11:32:34 -07:00
qctecmdr
177466fc36 Merge "PM / devfreq: bw_hwmon: remove unused variable" 2020-06-14 11:32:33 -07:00
qctecmdr
756620e2bb Merge "uapi: qg: Fix UAPI header to enable UAPI_HEADER_TEST" 2020-06-14 11:32:33 -07:00
qctecmdr
1e20a25a5b Merge "ion: Derive CMA buffer struct page without using priv_virt" 2020-06-14 11:32:33 -07:00
qctecmdr
75a9e21c8d Merge "net: qrtr: Use radix_tree_iter_delete" 2020-06-14 11:32:33 -07:00
qctecmdr
d38c3e9e52 Merge "mhi: core: Trigger host resume if client requests device vote" 2020-06-14 11:32:32 -07:00
qctecmdr
1034f3b8dc Merge "usb: dwc3: gadget: Avoid spuriously printing NO_PULLUP in log" 2020-06-14 11:32:32 -07:00
qctecmdr
a67ecbe913 Merge "soc: qti_battery_debug: Move qbg_context to device bin file" 2020-06-14 11:32:32 -07:00
qctecmdr
e8d67e52f4 Merge "llcc_perfmon: Initialize variable before use" 2020-06-14 11:32:31 -07:00
qctecmdr
56b8382cfb Merge ".gitignore: ignore GKI generated defconfigs" 2020-06-14 11:32:30 -07:00
qctecmdr
5c48d77d23 Merge "sched: Improve the scheduler" 2020-06-14 04:58:10 -07:00
qctecmdr
7d16328867 Merge "arm64: defconfig: Remove unnecessary configs in genericarmv8-64" 2020-06-14 04:58:09 -07:00
qctecmdr
5c6275f041 Merge "cnss2: Make sure PCIe/MHI is up before collecting RAM dump" 2020-06-14 04:58:09 -07:00
qctecmdr
955e4e41e9 Merge "dma: gpi: Add support to assign static GPII for I2C Touch on Lahaina" 2020-06-14 04:58:09 -07:00
qctecmdr
aea646dce9 Merge "msm: cvp: Rename cvpss to evass" 2020-06-13 17:37:51 -07:00
qctecmdr
e6c44b0944 Merge "msm: cvp: Allow re-send DSP HFI queue after SSR" 2020-06-13 17:37:51 -07:00
qctecmdr
8fe8b521b0 Merge "msm: cvp: Fix a CVP SSR deadlock" 2020-06-13 17:37:51 -07:00
qctecmdr
0dcf1779de Merge "arm: mm: Fix compilation error when IOMMU is disabled" 2020-06-13 17:37:50 -07:00
qctecmdr
e15fb218da Merge "sched/tracing: Fix format specifiers in sched_compute_energy" 2020-06-13 17:37:50 -07:00
Isaac J. Manjarres
eb749ee5d9 soc: qcom: mem-buf: Add support for consumers to import dma-bufs
Supplier virtual machines (VMs) support exporting dma-bufs to
a consumer VM. However, consumers do not support importing dma-bufs
into their VMs, so add an IOCTL command to import a dma-buf into
a consumer VM.

The client must provide a memory parcel handle that corresponds to a
dma-buf that has been shared with the consumer VM, as well as an
access control list that is used for validating the access control
rules for the buffer. Upon success, the client is given a dma-buf
fd, which they can use to map the buffer and access it from both
the CPU, and peripherals.

Change-Id: I548e004e73543421b932430fbd9f84ad76658ef8
Signed-off-by: Isaac J. Manjarres <isaacm@codeaurora.org>
2020-06-12 19:10:06 -07:00
Isaac J. Manjarres
50c067fc65 soc: qcom: mem-buf: Add support for suppliers to export dma-bufs
Currently, mem-buf suppliers can only provide a consumer with a memory
buffer if the consumer requests for the memory buffer, in which case
the supplier has no control over the contents of the buffer that is
given to the consumer. This is not ideal in cases where the supplier
virtual machine (VM) may have data that is of interest to the consumer,
which can be shared using a memory buffer.

Introduce a new IOCTL command which allows a client to specify a
dma-buf that they would like to share with a consumer VM, as well
as the access control rules that should be applied to the buffer.

Change-Id: I1e4ec1205ad4e69039ec0ab26b4209512896a354
Signed-off-by: Isaac J. Manjarres <isaacm@codeaurora.org>
2020-06-12 19:10:06 -07:00
Isaac J. Manjarres
253aacc2ad ion: msm: Add support for dynamically preventing dma-buf mappings
The current rules for determining if a buffer can or cannot be mapped
to depend on how a buffer was allocated. This is restrictive
in environments where the security state of a buffer can change
dynamically, as the accessibility of the buffer has to change with
respect to the security state of the buffer.

Thus, add support to track the number of userspace mappings associated
with an ION buffer, as well as an interface to allow drivers to lock
and unlock a buffer. In this context, locking a buffer means that the
buffer will no longer be mappable, and the buffer does not
have any outstanding mappings at the time the buffer is locked.
Unlocking the buffer means that the buffer can be mapped again.

Change-Id: I6aa73b9ac7c301b12106ad3d3bcb4c2aac959e55
Signed-off-by: Isaac J. Manjarres <isaacm@codeaurora.org>
2020-06-12 19:10:01 -07:00
Manikandan Mohan
659efe65b5 cnss2: Ignore debugfs non availability during init
Debugfs is used for bringup support and debug. Ignore debugfs
setup failure if it is not supported in kernel config.

Change-Id: I07a56a0ce4adf53e0aa5b00ce73310d0c7ed2f6a
Signed-off-by: Manikandan Mohan <manikand@codeaurora.org>
2020-06-12 18:14:13 -07:00