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>
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>
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>