Add support to report INPUT_SUSPEND state in case of slave charger
configuration. This is used by user-space to determine parallel
charger state.
Change-Id: I97a7c18180c0aceddd2b90177949f87487aad22b
Signed-off-by: Ashay Jaiswal <ashayj@codeaurora.org>
Add support to early mount vendor partition so that venodr modules
can be loaded during early init.
Change-Id: I668a7c3b1716816d497b7f170b554dfe8960701c
Signed-off-by: Imran Khan <kimran@codeaurora.org>
Skip VMA_LOCKED vmas from being reclaimed. Not doing so results
in pages in unevictable lrus to be passed for reclaim which can
cause issues. In one such reported problem, the trylock_page in
shrink_page_list fails and reclaim path decides to keep the page
and hits VM_BUG_ON_PAGE since PageUnevictable is set.
Change-Id: I58947faeb5226cf8578541d7fdcd474a24f8c40f
Signed-off-by: Vinayak Menon <vinmenon@codeaurora.org>
For video mode panels, when secure display has ended and non-secure
layers are being committed, check if secure display is still enabled.
Ideally there should be a NULL commit before non-secure content starts,
to clean up the secure display. If this isn't the case, add code to
detect, validate, and return failure.
Change-Id: I574547307073e38a19a42ff21679b17e1ec29b3b
Signed-off-by: Krishna Chaitanya Devarakonda <kdevarak@codeaurora.org>
trigger_ssr_write directly accesses user buffer, which can lead
to crash. Copy user buffer to kernel memory before access.
Also, set initial value for ssr_trigger_val, and use kstrtoul
instead of sscanf, with proper checking of return code.
Change-Id: I94b1c14a8ae4628cb6ac0ee7f3bd38b0c79f088b
Signed-off-by: Surajit Podder <spodder@codeaurora.org>
With ESR discharge timer retry, max having same value, ESR pulse
can fire frequently when battery FET is open past charge
termination. This frequent ESR pulses increase power consumption
when the device is idle.
Upon charge termination, change the ESR discharging timer retry
to 0 so that ESR pulse can fire less frequently saving power.
Add support for this through fg_esr_timer_config() based on end
of charge and sleep conditions.
Currently, retry/max for ESR charging and discharging timers are
configured with the same value specified through device tree.
Extend the device tree property to take in different retry/max
values for those timers.
Change-Id: Ib30b8ae7d893b5cab00ed83dd7318b53e3b63ac1
Signed-off-by: Subbaraman Narayanamurthy <subbaram@codeaurora.org>
The cycle counter read is a bit of an expensive operation and requires
locking across all CPUs in a cluster. Optimize this by returning the
same value if the delta between two reads is zero (so if two reads are
done in the same sched context) or if the last read was within a
specific time period prior to the current read.
Change-Id: I99da5a704d3652f53c8564ba7532783d3288f227
Signed-off-by: Vikram Mulukutla <markivx@codeaurora.org>
We observe that while PR_SWAP is done from PD stack, the typeC
block could be running its tCC debounce timer. This causes the
driver to prematurely declare that the cable is removed.
Fix this by reducing the tCC debounce time to 20mS while in
PR_SWAP.
Change-Id: Ie8b3628cd6931ff2da92d95c153d0d2c7ddb20b2
Signed-off-by: Abhijeet Dharmapurikar <adharmap@codeaurora.org>
These are all driver changes needed for disablement of
CONFIG_CC_OPTIMIZE_FOR_SIZE. CONFIG_CC_OPTIMIZE_FOR_PERFORMANCE
is enabled by default once CONFIG_CC_OPTIMIZE_FOR_SIZE is disabled.
Change-Id: Ia46a1f24e8a082a29ea6151e41e6d3a85a05fd4f
Signed-off-by: Prasad Sodagudi <psodagud@codeaurora.org>
Signed-off-by: Sridhar Parasuram <sridhar@codeaurora.org>
At a higher level, all objects are created with definite size i.e. 0 is
illegal. In forthcoming patches, this assumption is dependent upon in
the drm_mm range manager, i.e. trying to create a drm_mm node with size
0 will have undefined behaviour. Add a couple of WARNs upon creating the
drm_mm node to prevent later bugs.
Change-Id: Ieb81a8ef5a05a32dd37dfc040ea3f78243b59161
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: David Herrmann <dh.herrmann@gmail.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: http://patchwork.freedesktop.org/patch/msgid/1470248788-30873-1-git-send-email-chris@chris-wilson.co.uk
Git-commit: aafdcfd3f9aa3c9f77ae4e9385f21bf9ae120d3e
Git-repo: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
Signed-off-by: Sushmita Susheelendra <ssusheel@codeaurora.org>
As we always add this to the drm_mm->hole_stack as our first operation,
we do not need to initialise the list node.
Change-Id: If2e9e06141bdb9a9411ef875cb83e41a48e5f1a9
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: David Herrmann <dh.herrmann@gmail.com>
Cc: dri-devel@lists.freedesktop.org
Reviewed-by: David Herrmann <dh.herrmann@gmail.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: http://patchwork.freedesktop.org/patch/msgid/1470236651-678-3-git-send-email-chris@chris-wilson.co.uk
Git-commit: a787900564ffc6eebbcb7086b45e04a0bc3370f0
Git-repo: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
Signed-off-by: Sushmita Susheelendra <ssusheel@codeaurora.org>
In addition to the last-in/first-out stack for accessing drm_mm nodes,
we occasionally and in the future often want to find a drm_mm_node by an
address. To do so efficiently we need to track the nodes in an interval
tree - lookups for a particular address will then be O(lg(N)), where N
is the number of nodes in the range manager as opposed to O(N).
Insertion however gains an extra O(lg(N)) step for all nodes
irrespective of whether the interval tree is in use. For future i915
patches, eliminating the linear walk is a significant improvement.
v2: Use generic interval-tree template for u64 and faster insertion.
Change-Id: Iddcb7891480ca7d6e0469c8d394fcd1962ed4583
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: David Herrmann <dh.herrmann@gmail.com>
Cc: dri-devel@lists.freedesktop.org
Reviewed-by: David Herrmann <dh.herrmann@gmail.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: http://patchwork.freedesktop.org/patch/msgid/1470236651-678-1-git-send-email-chris@chris-wilson.co.uk
Git-commit: 202b52b7fbf70858609ec20829c7d69a13ffa351
Git-repo: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
Signed-off-by: Sushmita Susheelendra <ssusheel@codeaurora.org>
Buffer object specific resources like pages, domains, sg list
need not be protected with struct_mutex. They can be protected
with a buffer object level lock. This simplifies locking and
makes it easier to avoid potential recursive locking scenarios
for SVM involving mmap_sem and struct_mutex. This also removes
unnecessary serialization when creating buffer objects, and also
between buffer object creation and GPU command submission.
Change-Id: I40cb437d0186c3d9aac365c9baba0aa4792f0aa1
Signed-off-by: Sushmita Susheelendra <ssusheel@codeaurora.org>
Not all endpoints support all channels supported by MHI host. Only allow
clients to register if requested channel is supported by endpoint.
CRs-Fixed: 2053250
Change-Id: Ib4bd8d21b8f43d693da30b8fafe2cb9d2e128a17
Signed-off-by: Sujeev Dias <sdias@codeaurora.org>
During MHI INIT, memory is allocated for firmware and
rddm vector table. This memory is not freed when DE_INIT
is called.
CRs-Fixed: 2053206
Change-Id: I85b2644189915dd25d8ac31190f16799f86cbd12
Signed-off-by: Sujeev Dias <sdias@codeaurora.org>
MHI is not supported by all targets, however many MHI client drivers
have a common driver that include MHI APIs. Create dummy APIs such
that even if MHI not present, does not cause any compile errors.
CRs-Fixed: 2053159
Change-Id: I427d925a658518d230a1d14df0cf27a7b19f207e
Signed-off-by: Sujeev Dias <sdias@codeaurora.org>
Restrict the virtual address size to 39-bits to allow
a maximum of 3 pagetable levels.
Change-Id: I264f23a2e16cc7599bdad8a161854bcf6e24dd4a
Signed-off-by: Sushmita Susheelendra <ssusheel@codeaurora.org>
Define a 36-bit address space for TTBR1 which is used for
kernel side GPU buffer objects.
Change-Id: I1c4eaee0fd92236793621c7d3dba1700e56fefd2
Signed-off-by: Sushmita Susheelendra <ssusheel@codeaurora.org>
Due to an egregious misunderstanding of the specification it
was thought that to do the TTBR1 matching correctly the sign
extension bit needed to match the input address space. This
is incorrect - the TTBR1 range is determined by the size of
the TTBR1 space (in our case, the same as the input address
space). For example if the input address size is 36, the
effective range of the pagetables are:
TTBR0: 0x00000000_00000000 - 0x0000000f_ffffffff
TTBR1: 0xfffffff0_00000000 - 0xffffffff_ffffffff
For its part the sign extension bit needs should be set based on
the upstream bus size. If the device has a UBS of 49 then the
sign extension bit is assumed by design to be 48 otherwise
the driver needs to pick the highest available bit and reduce
the input address space by 1.
Because the client driver shouldn't need to know the upstream
bus size, convention is to use a fully sign extended unsigned
long address for TTBR1 mappings. If the sign extension bit is set
lower than the upstream bus size some implementations assume that
bits above the sign extension bit need to be zero and breaks the
convention. Setting the sign extension bit correctly for the
upstream bus size ensures that sign extension always works.
The hardware will match an address to the TTBR1 if all the bits
between the sign extension bit and the input address size are set
to 1. We emulate this behavior in software when looking up a pagetable
for a software operation.
Change-Id: Ic0dedbad80c72f11bc8a7e6792f0e3c2f58bc674
Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org>
When the CC state change IRQ fires on USB removal the debounce done
status may still be high, and the removal cleanup will not be called.
Use the UFP/DFP status bits to determine whether the CC lines are
present or not instead.
While at it cache the CC state so it doesn't have to be derived
everywhere it is needed. The status bits are already cached, so there
should be no functional difference.
Change-Id: Ifb89c78a032ae9d38fbc8c281518698941e131c2
Signed-off-by: Nicholas Troast <ntroast@codeaurora.org>
Upon receiving a PD message the state machine is queued to
act on it. However, if another message is received quickly
before usbpd_sm is scheduled, it will only process the first
message. Add a check if the RX queue is not empty in order
to drain the messages properly.
Change-Id: Ie9e079a51a5740024c9a1be5ba27b3edacf9b2df
Signed-off-by: Jack Pham <jackp@codeaurora.org>
Checking RX_FIFO allocation status from deferred thread also causes
in_ssr flag reset and reading stale data from FIFO, If the deferred
thread schedules after the execution of ssr() function.
Check RX_FIFO status only after receiving the interrupt from remote
side which happens after remote sub-system recover from SSR.
CRs-Fixed: 2054480
Change-Id: I39269f6b2e1f1cb9aecd25fa40e73c2d6f12dbd5
Signed-off-by: Arun Kumar Neelakantam <aneela@codeaurora.org>
get_pages doesn't keep a reference of the pages allocated
when it fails later in the code path. This can lead to
a memory leak. Keep reference of the allocated pages so
that it can be freed when msm_gem_free_object gets called
later during cleanup.
Change-Id: I44dea20e10c056c1c5e80d01bab0a274ff768b1c
Signed-off-by: Prakash Kamliya <pkamliya@codeaurora.org>
There are two definitions of struct dss_vreg in mdss driver.
One is used during parsing regulators from device tree file,
the other is used when operating regulators. This introduces
different understanding of dss_vreg data in these two places.
Future plan is to have only one definition for these shared
data structure. Currently only make dss_vreg in sync to fix
this issue.
CRs-Fixed: 2054371
Change-Id: I4f16e1409c832432fa1df73b0ae030176b664e58
Signed-off-by: Ray Zhang <rayz@codeaurora.org>