The MHI driver requires the MHI_CB_XFER event handling be atomic.
This change makes the addr map locks into spinlocks so sleep is
avoided while processing the XFER event.
CRs-Fixed: 1089824
Change-Id: I7bd8f606f92095bb47741aa54a846b687fe948b9
Signed-off-by: Chris Lew <clew@codeaurora.org>
Add support for handling FB_BLANK_NORMAL event.
Change-Id: Ifd3c1c1eb2e1101bfcd354252711eb67fc362c57
Signed-off-by: Alex Sarraf <asarraf@codeaurora.org>
If __dwc3_msm_ep_queue() fails, then req_complete is freed
but it is not being removed from mdwc->request_list. This
may result into list_add corruption issue on next USB cable
connect when USB endless request is queued. Fix this issue
by deleting req_complete from mdwc->req_complete_list.
CRs-Fixed: 1007571
Change-Id: I00300bc529db75593939a13fbea33acefa717da5
Signed-off-by: Mayank Rana <mrana@codeaurora.org>
LCDB driver exposes regulators to control the positive and
negative voltage bias for the LCD display panel. It also
allows ability to configure for the various bias-voltage
parameters.
Change-Id: I339345520a47c117e37e57a7b1f37ff2aead3dd8
Signed-off-by: Ashay Jaiswal <ashayj@codeaurora.org>
On certain PMICs, an unexpected assertion on KPDPWR_DBC may
be seen during falling edge of KPDPWR_N when it is closer
to the rising edge of SLEEP_CLK. This triggers spurious
KPDPWR interrupts. Handle this by adding a debounce in SW
when the first KPDPWR_N falling edge is seen.
The debounce logic is enabled by the DT property
'qcom,kpdpwr-sw-debounce'.
CRs-Fixed: 2032520
Change-Id: I7655c13bda47fa6e2983650d7bec21e52aa91c2f
Signed-off-by: Anirudh Ghayal <aghayal@codeaurora.org>
If androidboot.vbmeta.device is set and points to a device with vbmeta
magic, this header will be overwritten upon an irrecoverable dm-verity
error. The side-effect of this is that the slot will fail to verify on
next reboot, effectively triggering the boot loader to fallback to
another slot. This work both if the vbmeta struct is at the start of a
partition or if there's an AVB footer at the end.
This code is based on drivers/md/dm-verity-chromeos.c from ChromiumOS.
Example:
[ 0.000000] Kernel command line: rootfstype=ext4 init=/init console=ttyS0,115200 androidboot.console=ttyS0 androidboot.hardware=uefi_x86_64 enforcing=0 androidboot.selinux=permissive androidboot.debuggable=1 buildvariant=eng dm="1 vroot none ro 1,0 2080496 verity 1 PARTUUID=6779df46-78f6-4c69-bf53-59bb1fbf126b PARTUUID=6779df46-78f6-4c69-bf53-59bb1fbf126b 4096 4096 260062 260062 sha1 4f76354c86e430e27426d584a726f2fbffecae32 7e4085342d634065269631ac9a199e1a43f4632c 1 ignore_zero_blocks" root=0xfd00 androidboot.vbmeta.device=PARTUUID=b865935d-38fb-4c4e-b8b4-70dc67321552 androidboot.slot_suffix=_a androidboot.vbmeta.device_state=unlocked androidboot.vbmeta.hash_alg=sha256 androidboot.vbmeta.size=3200 androidboot.vbmeta.digest=14fe41c2b3696c31b7ad5eae7877d7d188995e1ab122c604aaaf4785850b91f7 skip_initramfs
[...]
[ 0.612802] device-mapper: verity-avb: AVB error handler initialized with vbmeta device: PARTUUID=b865935d-38fb-4c4e-b8b4-70dc67321552
[...]
[ 1.213804] device-mapper: init: attempting early device configuration.
[ 1.214752] device-mapper: init: adding target '0 2080496 verity 1 PARTUUID=6779df46-78f6-4c69-bf53-59bb1fbf126b PARTUUID=6779df46-78f6-4c69-bf53-59bb1fbf126b 4096 4096 260062 260062 sha1 4f76354c86e430e27426d584a726f2fbffecae32 7e4085342d634065269631ac9a199e1a43f4632c 1 ignore_zero_blocks'
[ 1.217643] device-mapper: init: dm-0 is ready
[ 1.226694] device-mapper: verity: 8:6: data block 0 is corrupted
[ 1.227666] device-mapper: verity-avb: AVB error handler called for PARTUUID=b865935d-38fb-4c4e-b8b4-70dc67321552
[ 1.234308] device-mapper: verity-avb: invalidate_vbmeta: found vbmeta partition
[ 1.235848] device-mapper: verity-avb: invalidate_vbmeta: completed.
[...]
Bug: 31622239
Test: Manually tested (other arch).
Change-Id: Idf6be32d6a3d28e15de9302aa26ad6a516d663aa
Signed-off-by: David Zeuthen <zeuthen@google.com>
Git-commit: 8d6f006d60
Git-repo: https://android.googlesource.com/kernel/common/
[runminw@codeaurora.org: resolve trivial merge conflicts]
Signed-off-by: Runmin Wang <runminw@codeaurora.org>
With the upcoming secure code the decision tree for configuration
(deciding where virtual addresses start/stop, etc) is going to get
a bit more complex. Head issues off at the pass by moving the
configuration into the GPU specific code. This does result in a
bit more code duplication but it is a lot cleaner.
Change-Id: Ic0dedbad57c11a4bba01825214d0a7853ab537ba
Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org>
Add support for creating a secure domain in the GPU IOMMU. By default
the secure domain is bound to context bank name "gfx3d_secure".
Change-Id: Ic0dedbad19f69ec4175624dc80f2114bfda2e195
Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org>
None of the existing iommu implementations use the names passed in
at attach time by the API. Save a bit of .data room by removing
the static string definitions and passing NULL to the attach function.
Change-Id: Ic0dedbada9561768b8d9716ea101619e6b549ea4
Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org>
5XX targets that are using per-process pagetables will need to
keep the IOMMU clocks on the entire time because we don't know
exactly when the GPU might touch it. That said there are
occassional depencency issues if the clocks are enabled out
of order. To be certain we should enable the MMU clocks last
and disable them first. Add enable/disable hooks to the MMU
struct to do this cleanly from the GPU pm_resume / pm_suspend
paths.
Change-Id: Ic0dedbad8e2298e55c90b29eed657baa0933ddcf
Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org>
Very soon we will be adding support for secure domains and so a bit of
refactoring is needed the GPU IOMMU code:
* Add support for directly probing the context bank device at create
instead of at attach. This makes it a little bit easier to directly
associate a mmu device with a specific context bank.
* Specify the domain type at create time. Add a new domain type
MSM_DOMAIN_USER to associate the user domain with the gfx3d_user
context bank. Also add MSM_DOMAIN_DEFAULT with no context bank
for legacy devices (read MDP4) with only one context bank
to attach to the parent device. Adding a domain type saves us from
having to create N entry points for each domain type.
Note that dynamic domains stay with their own initalization function.
This is because dynamic domains are cloned from the parent domain
so the semantics are too different to try to smash into the generic
functions.
Change-Id: Ic0dedbad41692e776cddc72cda653ae637f9ec77
Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org>
Now that the SMMU/IOMMU differences have been resolved the only delta
between the SMMU and the IOMMU address space implementations is the
actual address space allocation which we can work around by assuming
the caller doesn't want address generation if they specify the same
start and end address (i.e. 0).
With that optimization we can get rid of the address space
sub functions and a bunch of otherwise duplicated code.
Change-Id: Ic0dedbaddef0fcd3a8f39e30f95c71245d84f111
Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org>
Finish consolidating the MMU map and unmap operations into a single
function. By passing in the meta token to map/unmap the specific
SMMU operations can make a local decision as to which function to
call.
Change-Id: Ic0dedbad52aac6ed1317411b2667755794d1818f
Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org>
For all intents and purposes the mmu ->map function has used a
scatter gather list for some time. Drop the pretense and just
make both the SMMU and IOMMU flavors use the sg flavor of their
respective iommu API functions. As a result we can drop the
map_sg hooks in the SMMU driver and get rid of a considerable
amount of re-invented wheels in the IOMMU driver.
Change-Id: Ic0dedbadc4724c8ae389892fb85610435c5c08cf
Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org>
Pass the bo flags all the way down to the iommu map code and
translate into the IOMMU flags right before mapping. This crosses the
streams a bit by moving BO level knowledge all the way down into the
MMU driver but it removes IOMMU specific knowledge from the address
space level which will be important when the address space code for
the GPU and the display are merged into one.
Change-Id: Ic0dedbad256f8986658bbe50fc2e2bd4051b7a7c
Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org>
copy_from_user_inatomic() is actually a local function that returns
-EFAULT or positive values on error. Otherwise copy_from_user() returns
the number of bytes remaining to be copied. We want to return -EFAULT
here.
I removed an unlikely() because we just did a copy_from_user()
so I don't think it can possibly make a difference.
Change-Id: Ic0dedbad3437020c12053b6d93276a4dd24a577a
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Rob Clark <robdclark@gmail.com>
Git-commit: 21c42da18ef128ca8fb4cc4ead888f5c61e3916a
Git-repo: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
[jcrouse@codeaurora.org: fix minor merge conflict and checkpatch errors]
Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org>
For backwards compatibility the counter group list has some built
in gaps that return NULL when queried. Make sure that all the
functions that query the list are able to handle a NULL pointer.
Change-Id: Ic0dedbadd10ccf3a3b9b1f1b035a46a4f7ee8493
Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org>
I/O coherence has some limitations that make it less preferable than
the usermode cache operations. Given these limitations the user mode
driver teams have requested that I/O coherence be disabled.
Change-Id: Ic0dedbadbc10b3a6239e20df8b527a5738a1a3a4
Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org>
Add sync operations to give the user more control
over the behavior of cached buffers.
Change-Id: Ic0dedbad67e19a6b30b2cc5f6b2c7bbe52c2b708
Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org>
When the stats go out of sync across the 2 VFEs, don't treat it
as a fatal error but allow for recovery.
Change-Id: I5ef16b3e823cec9698d3ee0627335653f13fd60d
Signed-off-by: Lokesh Kumar Aakulu <lkumar@codeaurora.org>
Charger type gets updated in 'smblib_update_usb_type' function
and this should only be called after completion of APSD.
Update the calling sites of 'smblib_update_usb_type' to use
'smblib_get_apsd_result' instead of 'smblib_update_usb_type'.
This ensures charger type doesn't get updated inadvertently.
CRs-Fixed: 2038837
Change-Id: Iaa380c8f02bb71ad0f4367c16ec39d86d825dfa2
Signed-off-by: Ashay Jaiswal <ashayj@codeaurora.org>
Protect the common shared wlan_comm_desc_list with
spin lock to avoid the race condition.
Change-Id: I02ef6c6b663340711e0e2f766424d642aaa8d7af
Acked-by: Mohammed Javid <mjavid@qti.qualcomm.com>
Signed-off-by: Utkarsh Saxena <usaxena@codeaurora.org>