In some cases with IPA3 received qmi_service_exit from
modem but still uses invalid qmi-handler to send QMI-msg
to modem which leads to crash. The fix is to add the
check before sending QMI msg to modem.
Change-Id: Iac48747a188b234cc640285e181984985fc3c012
Signed-off-by: Skylar Chang <chiaweic@codeaurora.org>
The measured battery current can be read from the parallel slave
charger. Expose this through the CURRENT_NOW property in the parallel
power supply.
Change-Id: Icd717147adc018a076a72bd5ce1a52a765f34f7b
Signed-off-by: Nicholas Troast <ntroast@codeaurora.org>
Use the PARALLEL_DISABLE property to enable or disable parallel
charging. When writing to this property the effect is immediate.
Change-Id: Ia9cd9d352935be19e9383141cf279a34796ff642
Signed-off-by: Nicholas Troast <ntroast@codeaurora.org>
The PARALLEL_DISABLE property is used to enable or disable parallel
charging.
Change-Id: If2845efa942abc5849890b45de525222632b32db
Signed-off-by: Nicholas Troast <ntroast@codeaurora.org>
When parallel charging is enabled the charge current read by the fuel
gauage will not include the parallel charging current. Enable VCHG to
report the parallel charge current.
Change-Id: I6090d4163e760dc02a7dce45f1246bb59b2e195b
Signed-off-by: Nicholas Troast <ntroast@codeaurora.org>
Add a new property to read the lpg-lut size for the
qpnp-pwm device tree nodes for pmicobalt.
CRs-Fixed: 1060896
Change-Id: I93bf7c406471b5877008e2000260adfa62336b93
Signed-off-by: Devesh Jhunjhunwala <deveshj@codeaurora.org>
Add support to read the qcom,lpg-lut-size property from
the device tree instead of using the value returned by the
of_get_address API.
CRs-Fixed: 1060896
Change-Id: I0f84baf29a141719dd44dabb67e9d599d9646d49
Signed-off-by: Devesh Jhunjhunwala <deveshj@codeaurora.org>
Yue Cao claims that current host rate limiting of challenge ACKS
(RFC 5961) could leak enough information to allow a patient attacker
to hijack TCP sessions. He will soon provide details in an academic
paper.
This patch increases the default limit from 100 to 1000, and adds
some randomization so that the attacker can no longer hijack
sessions without spending a considerable amount of probes.
Based on initial analysis and patch from Linus.
Note that we also have per socket rate limiting, so it is tempting
to remove the host limit in the future.
v2: randomize the count of challenge acks per second, not the period.
Fixes: 282f23c6ee ("tcp: implement RFC 5961 3.2")
Reported-by: Yue Cao <ycao009@ucr.edu>
Signed-off-by: Eric Dumazet <edumazet@google.com>
Suggested-by: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Yuchung Cheng <ycheng@google.com>
Cc: Neal Cardwell <ncardwell@google.com>
Acked-by: Neal Cardwell <ncardwell@google.com>
Acked-by: Yuchung Cheng <ycheng@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Change-Id: I1bf93d033e788c37899837f0c9e930bc4e20aa4c
Git-repo: http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git
Git-commit: 75ff39ccc1bd5d3c455b6822ab09e533c551f758
[d-cagle@codeaurora.org: Resolve trivial merge conflict]
Signed-off-by: Dennis Cagle <d-cagle@codeaurora.org>
Move target specific initialization and setup into target
specific init functions. The change is required to port the GPU
driver to support future generation GPUs.
CRs-Fixed: 1053516
Change-Id: I808e247669fab61a6a64131858fe2f9e19754242
Signed-off-by: George Shen <sqiao@codeaurora.org>
This fixes CVE-2016-0758.
In the ASN.1 decoder, when the length field of an ASN.1 value is extracted,
it isn't validated against the remaining amount of data before being added
to the cursor. With a sufficiently large size indicated, the check:
datalen - dp < 2
may then fail due to integer overflow.
Fix this by checking the length indicated against the amount of remaining
data in both places a definite length is determined.
Whilst we're at it, make the following changes:
(1) Check the maximum size of extended length does not exceed the capacity
of the variable it's being stored in (len) rather than the type that
variable is assumed to be (size_t).
(2) Compare the EOC tag to the symbolic constant ASN1_EOC rather than the
integer 0.
(3) To reduce confusion, move the initialisation of len outside of:
for (len = 0; n > 0; n--) {
since it doesn't have anything to do with the loop counter n.
Change-Id: I13b15885df9dc0c17a3e1670ae9606bf3ce4ba05
Signed-off-by: David Howells <dhowells@redhat.com>
Reviewed-by: Mimi Zohar <zohar@linux.vnet.ibm.com>
Acked-by: David Woodhouse <David.Woodhouse@intel.com>
Acked-by: Peter Jones <pjones@redhat.com>
Git-repo: http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git
Git-commit: 23c8a812dc3c621009e4f0e5342aa4e2ede1ceaa
Signed-off-by: Dennis Cagle <d-cagle@codeaurora.org>
USB GSI endpoint related TRB ring is allocated with EP_OPS. Each USB
endpoint related TRB ring is zeroed with usb_ep_disable() operation. Hence
if USB composition switch or USB cable disconnect is performed when there
is active data transfer with USB GSI endpoint, it results into IPA GSI
accessing 0x0 address causing bus errors. Hence fix this issue by not
memsetting TRB ring with zero for USB GSI endpoint.
CRs-Fixed: 1072782
Change-Id: I92df514e31d5168b8dff4b249f4d8fd3e70c0118
Signed-off-by: Mayank Rana <mrana@codeaurora.org>
This is required to allow tasks to freely move between cgroups associated
with the tune controller.
Change-Id: I1f39b957462034586edc2fdc0a35488b314e9c8c
Signed-off-by: Syed Rameez Mustafa <rameezmustafa@codeaurora.org>
The schedtune controller will mimic the cpusets controller configuration
for now. For that we need to make 4 groups in addition to the root
group present by default.
Change-Id: I082f1e4e4ebf863e623cf66ee127eac70a3e2716
Signed-off-by: Syed Rameez Mustafa <rameezmustafa@codeaurora.org>
To support task performance boosting, the usage of a single knob has the
advantage to be a simple solution, both from the implementation and the
usability standpoint. However, on a real system it can be difficult to
identify a single value for the knob which fits the needs of multiple
different tasks. For example, some kernel threads and/or user-space
background services should be better managed the "standard" way while we
still want to be able to boost the performance of specific workloads.
In order to improve the flexibility of the task boosting mechanism this
patch is the first of a small series which extends the previous
implementation to introduce a "per task group" support.
This first patch introduces just the basic CGroups support, a new
"schedtune" CGroups controller is added which allows to configure
different boost value for different groups of tasks.
To keep the implementation simple but still effective for a boosting
strategy, the new controller:
1. allows only a two layer hierarchy
2. supports only a limited number of boost groups
A two layer hierarchy allows to place each task either:
a) in the root control group
thus being subject to a system-wide boosting value
b) in a child of the root group
thus being subject to the specific boost value defined by that
"boost group"
The limited number of "boost groups" supported is mainly motivated by
the observation that in a real system it could be useful to have only
few classes of tasks which deserve different treatment.
For example, background vs foreground or interactive vs low-priority.
As an additional benefit, a limited number of boost groups allows also
to have a simpler implementation especially for the code required to
compute the boost value for CPUs which have runnable tasks belonging to
different boost groups.
Change-Id: I1304e33a8440bfdad9c8bcf8129ff390216f2e32
cc: Tejun Heo <tj@kernel.org>
cc: Li Zefan <lizefan@huawei.com>
cc: Johannes Weiner <hannes@cmpxchg.org>
cc: Ingo Molnar <mingo@redhat.com>
cc: Peter Zijlstra <peterz@infradead.org>
Signed-off-by: Patrick Bellasi <patrick.bellasi@arm.com>
Git-commit: 13001f47c9
Git-repo: https://android.googlesource.com/kernel/common
Signed-off-by: Vikram Mulukutla <markivx@codeaurora.org>
Use the ddrss_gcc_dbg_clk mux index to get the rate
measurement of the DDR clock on MSMCOBALT. Note that
this feature is only supported on v2 platforms.
CRs-Fixed: 1068034
Change-Id: Ib472c226b7e35079e6b8391848a0a0d1c38962c0
Signed-off-by: Deepak Katragadda <dkatraga@codeaurora.org>
Battery temperature delta configuration can be used to know the
battery temperature change. There is an interrupt associated
with this configuration which can be used to update the battery
health of the device.
Change-Id: Ic55b9bb34ac9912f88dab6a11ec365814b525ca2
Signed-off-by: Subbaraman Narayanamurthy <subbaram@codeaurora.org>
GEN3 FG has jeita hysteresis support in hardware. Add support
to configure the hysteresis applied to jeita temperature via
a device tree property.
While at it, fix reading the JEITA thresholds from device tree
property where the total size of the elements was used instead
of the total number of elements.
Change-Id: I1d468f1291224de0f781ca71cbc1374a29d7c790
Signed-off-by: Subbaraman Narayanamurthy <subbaram@codeaurora.org>
When the battery is removed and a strong charger is plugged in,
device will be kept powered. However, because of missing battery
SRAM access over IMA can fail leading to errors. Eventually, the
errors will go away when the battery is inserted again. However,
if the user tries to access SRAM registers or bms power supply
properties, it can cause further errors flooding logs. Handle
this gracefully by returning an error upon battery missing is
detected.
CRs-Fixed: 1072401
Change-Id: I764442548cb076dad89856d75394ef9cf355f83a
Signed-off-by: Subbaraman Narayanamurthy <subbaram@codeaurora.org>
Open circuit voltage and predicted battery voltage are read from
16 bits. However, the real value is present only in 15 bits.
Mask the bit 16 to get the proper readings.
Change-Id: I196ccc64fd221fead87a88f43dce1a21ba800908
Signed-off-by: Subbaraman Narayanamurthy <subbaram@codeaurora.org>
Add a module parameter "fg_restart" to restart the fuel gauge
without loading the battery profile. This will be useful in
geting a fresh SOC estimate whenever required.
Change-Id: I0c054ad523a0eab72f777d010807bb3a55f63f7e
Signed-off-by: Subbaraman Narayanamurthy <subbaram@codeaurora.org>
Batteries age across the time. Capacity learning is a feature
which uses the hardware autonomous coulomb counter to determine
the actual battery capacity against the advertised full capacity.
This will be useful to determine how much degradation has
happened to the battery. Capacity learning algorithm will start
based on some pre-set conditions like start SOC, battery
temperature and ends when the charging cycle is complete.
Actual capacity will be exposed through charge_full property.
Change-Id: I89cc14d213b0de10bc8d052dd76e1468fe9c30e5
Signed-off-by: Subbaraman Narayanamurthy <subbaram@codeaurora.org>
Currently, FG_GEN3 driver loads the battery profile if it finds
out the profile loaded earlier doesn't match with the available
profile. This will be done when the profile integrity bit is
set already. Make this force profile loading as a configurable
parameter through a device tree property.
While at it, add a module parameter to dump the profile contents
conditionally. This will be helpful in debugging.
Change-Id: Ibaff55aa5434ee283e6d597485d193e9e52bb74e
Signed-off-by: Subbaraman Narayanamurthy <subbaram@codeaurora.org>
msoc-full is not used to determine when the battery is full. The charger
will wakeup the device when it has terminated charging indicating that
the battery is full. Disable the msoc-full IRQ as a wakeup source.
The msoc-delta IRQ is used to wakeup the device when the SOC changes
therefore having the bsoc-delta IRQ as a wakeup source is unnecessary.
Disable the bsoc-delta IRQ as a wakeup source.
Change-Id: Iab7087ce3d6727abc852d3a84590cfa570ec584d
Signed-off-by: Nicholas Troast <ntroast@codeaurora.org>