In cases where client driver would call the API lpm_get_latency before the
lpm_root_node is initialized, would result in a NULL pointer exception. Fix
the same by moving the node check before.
CRs-Fixed: 973895
Change-Id: Ib2c7257bb7289f68d2bcb621ad311ceefe88a5f3
Signed-off-by: Taniya Das <tdas@codeaurora.org>
Add API to get latency for a low power mode with particular
affinity level and reset level. Reset level is level at which
only control logic power collpase happen or both control and
memory logic power collapse happen or Retention state.
The API returns the minum latency out of all clusters in the
particular affinity level and reset level if cluster name is
not passed or the latency of the specific cluster for which
the cluster name is passed.
Change-Id: I2facd9a1fa2dba7e7103d65544537799bd8ba518
Signed-off-by: Srinivas Rao L <lsrao@codeaurora.org>
Conflicts:
arch/arm/boot/dts/qcom/mdm9607-pm.dtsi
arch/arm/boot/dts/qcom/mdm9640-pm.dtsi
arch/arm/boot/dts/qcom/mdmcalifornium-pm.dtsi
arch/arm/boot/dts/qcom/msm8909-pm8909-pm.dtsi
arch/arm/boot/dts/qcom/msm8909-pm8916-pm.dtsi
arch/arm/boot/dts/qcom/msm8937-pm.dtsi
arch/arm/boot/dts/qcom/msm8952-pm.dtsi
arch/arm/boot/dts/qcom/msmgold-pm.dtsi
arch/arm/boot/dts/qcom/msmtitanium-pm.dtsi
Stats for cpu and cluster exit path query the ktime for every level and
this increases the overall idle exit latency. Get the timestamp only
once and use the same information to populate into different level.
Change-Id: Iece36015910fcb16bd04a25dae1bf0396ab463e2
Signed-off-by: Archana Sathyakumar <asathyak@codeaurora.org>
Conflicts:
drivers/cpuidle/lpm-levels.c
drivers/power/qcom/lpm-stats.c
Currently framework uses menu as governor and the mode selection happens
again in lpm driver. Register QCOM cpuidle governor, use the mode
selected for cpu to enter and further select the mode for the cluster to
enter.
Change-Id: Ifa98c4c90859f70fb5406715b53c89276ac1a4f4
Signed-off-by: Archana Sathyakumar <asathyak@codeaurora.org>
Conflicts:
drivers/cpuidle/lpm-levels.c
In 4.4 kernel, regulator_set_optimum_mode() is replaced by
regulator_set_load(). Hence update it accordingly for CNSS
driver in 4.4 kernel to avoid compilation issue.
Signed-off-by: Yue Ma <yuem@codeaurora.org>
Calling usb_remove_hcd() on both of the xHCI HCDs may race with
hub_event() which executes on its own workqueue. When xhci_halt()
is called and stops the command ring, the hub thread may have
already issued a command such as xhci_configure_endpoint() and
is currently waiting for the command to complete while holding
the device lock. Meanwhile since the controller is already halted,
no events are expected to complete and the command timer will
continually timeout every 5 seconds and re-arm itself. Since the
completion for the command is never issued, the threads are
essentially deadlocked.
Avoid this situation when halting the controller by forcing the
command queue to be cleaned up.
Change-Id: I88150e3435b5f06e37e9881dddaeff4807c24cc9
Signed-off-by: Jack Pham <jackp@codeaurora.org>
ADB function is mainly used for debugging, hence it is
not expected to allow USB LPM followed by system suspend
in device bus suspend. Driver also doesn't handle
usb_ep_dequeue failure in LPM when adbd is interrupted
by signal as buffer is left queued to the hardware after
usb_ep_dequeue failure and can cause memory corruption.
Change-Id: Ib89c80318dcdd0dbb35d122a2ab77fb61f83518e
Signed-off-by: Manu Gautam <mgautam@codeaurora.org>
Whenever data is transmitted from device to Host PC, MTP daemon sitting
in userspace writes to mtp driver through ioctl, which eventually
calls send_file_work to send data. Currently header length is not updated
properly to reflect correct length in case data file size is greater
than 4GB. Due to this, Host PC throws error when file of size > 4GB is
copied from device to Host PC. Hence fix the issue by updating header
length to (2 ^ 32 - 1) if length is greater than 4GB.
CRs-Fixed: 953737
Change-Id: I3840afb63f365c28bf3638b13b728800bc2419f4
Signed-off-by: Vijayavardhan Vennapusa <vvreddy@codeaurora.org>
Higher value allows xhci core to moderate interrupts resulting
in fewer interrupts from xhci core. This results in lower CPU
utilization during peak throughput scenarios.
Change-Id: I69548fd9a1adff1b8eafee40c0f92639efd93b2e
Signed-off-by: Devdutt Patnaik <dpatnaik@codeaurora.org>
Signed-off-by: Azhar Shaikh <azhars@codeaurora.org>
xhci allows interrupts to be moderated at 250ns interval;
provide an sysfs interface to modify interrupt rate from
userspace to understand throughput variation by changing imod.
Usage:
Below command will moderate interrupts at 1ms or (4000 * 250ns)
interval.
echo 4000 > /sys/devices/8a00000.ssusb/8a00000.dwc3/xhci-hcd.0.auto/
config_imod
Change-Id: I455d5a0f9a0314e86f711efd35315002b20f5343
Signed-off-by: Devdutt Patnaik <dpatnaik@codeaurora.org>
Signed-off-by: Azhar Shaikh <azhars@codeaurora.org>
Signed-off-by: Mayank Rana <mrana@codeaurora.org>
Audio function driver (f_uac1.c) may call gaudio_cleanup back
to back without calling gaudio_setup. Handle this gracefully
by marking file pointer as NULL on file_close as gaudio_cleanup
routine already checks for NULL before file_close.
Change-Id: Ib6acb05578105d64cceaa766d0b0434d1a467c8f
Signed-off-by: Manu Gautam <mgautam@codeaurora.org>
This change removes DP DM pulsing functionality related support
from QUSB PHY driver as it is not required.
Signed-off-by: Mayank Rana <mrana@codeaurora.org>
Instead of having the controller driver call the PHY's DP/DM
properties on behalf of the charger driver to enable and disable
the regulator, allow the PHY to expose a regulator device.
The charger driver then obtains a handle to this regulator to
perform regulator enable and disable directly.
Change-Id: I266a8cffb4912c2eb6724d73b7ed8c87b83a9e80
Signed-off-by: Jack Pham <jackp@codeaurora.org>
Signed-off-by: Azhar Shaikh <azhars@codeaurora.org>
Configfs framework expects to have free_func() supported with each
registered USB function. This change adds free_func() functionality
and also frees diag_context as part of it, otherwise there would be
memory leak for each composition switch when performing composition
switch having USB DIAG interface.
Change-Id: I1311cfd5265bd468dc62b6735596afb7cf36a7d2
Signed-off-by: Mayank Rana <mrana@codeaurora.org>
preemption_schedule() is not implemented for A3xx targets.
Invoking this function without NULL check result into crash
in A3xx target. Fix this by adding a NULL check before invoking
the preemption_schedule().
Change-Id: Ic600235f149cade57fedc5454bdc0f6794c67bd9
Signed-off-by: Hareesh Gundu <hareeshg@codeaurora.org>
Initialize coresight at boot time so that it is available to be
configured before the first open of /dev/kgsl-3d0 to get GPU
scan dumps during initial power up.
Change-Id: Ic0dedbadbda251f12855895cc0aa53852f79a8b8
Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org>
It is possible that 'error' variable is used uninitialized. This
change avoids usage of uninitialized usage of the variable.
CRs-fixed: 973871
Change-Id: Ibd6baf84473f2fe0e54bd04b0bbf9387307f97c1
Signed-off-by: Himanshu Aggarwal <haggarwa@codeaurora.org>
Correct if condition that checks the touch resolution of the
touch panel.
Signed-off-by: Shantanu Jain <shjain@codeaurora.org>
Change-Id: I925cfb306c5503efccc833117ff1753b2e2fcc6a
In certain situations, due to resolution mismatch, we may need to
scale up/down the X and Y co-ordinates returned by the touch controller.
Add support for the same where we scale up/down the X and Y touch
co-ordinates returned from the touch controller before sending it to
android. In such cases, we also need to ensure that the display resolution
matches the touch resolution. Add support for that as well.
Change-Id: Ia2dabf480478e26db1e1f0d92ca9ba5a252f18eb
Signed-off-by: Shantanu Jain <shjain@codeaurora.org>
During device resume, the touch resume function is called after
display resume. Touch resume function will take about >200ms.
Defer the touch resume function to a workqueue to reduce the total
device resume time. An optional DT property is added to enable this
on targets that need this feature.
Change-Id: Ia9b055144c5a7f29f0f0d57428cccbe15a7d7a87
Signed-off-by: zhaoyuan <yzhao@codeaurora.org>
Pass the correct QUP instance to the scm call. This is required
for QUP ownership transfer to other subsystems to support the
secure touch usecase.
Change-Id: I3ff53544fc58db908669cddce155f786dde23c41
Signed-off-by: Himanshu Aggarwal <haggarwa@codeaurora.org>
S332U needs to pull down the reset pin after it enters onto
sleep mode to ensure the LPM is enabled.
Change-Id: Ia8d8c1e788eb7d3524df979ad2d9e17ee15c26f2
Signed-off-by: Mao Li <maol@codeaurora.org>
Add support for QUP ownership transfer to other subsystems to
support the secure touch usecase.
Change-Id: I70fd5fb81ce8763095bcfa2feb71d9d806d14bd4
Signed-off-by: Himanshu Aggarwal <haggarwa@codeaurora.org>
Add support for configuring short circuit debounce cycles in
both LCD mode and AMOLED mode. Also, when configuring the
WLED SHORT_PROTECT register, the bits corresponding to DBNC_SHORT
bit fields are incorrectly written, so correct the corresponding
bitmask and the associated code logic to avoid this. Add an
explicit SPMI write to WLED1_CTRL_SOFTSTART_RAMP_DELAY register
as well for LCD mode.
Change-Id: Ibae8926262c52c8db3d04ab355651e5df44ec090
Signed-off-by: Himanshu Aggarwal <haggarwa@codeaurora.org>
Signed-off-by: Shantanu Jain <shjain@codeaurora.org>
Rename the vdd-level header file included from vdd-level-californium
to vdd-level-cobalt, which is the correct name. Also update the
header file to include the FMAX mappings needed for the cobalt
GPUCC driver.
Signed-off-by: Devesh Jhunjhunwala <deveshj@codeaurora.org>
Add part numbers for Kryo2xx seriels of Gold and Silver CPUs.
CRs-Fixed: 969563
Change-Id: I11d2e09483075f2496415cb64fb16d2f599f9f7f
Signed-off-by: Trilok Soni <tsoni@codeaurora.org>
Linux Kernel 4.4 enforces the use of cvt timers in kernel and userspace.
Fix this in the tsens driver.
Signed-off-by: David Keitel <dkeitel@codeaurora.org>
Modify the round_rate() callback function so that it selects
the nearest configured fmax frequency instead of the closest
possible supported frequency of the parent clock. This ensures
that clk_round_rate() always returns power efficient frequencies
for 8996 CPU clocks.
Change-Id: Icc27ba64b9c8af74ee0f81443fea37c4564b9f94
CRs-Fixed: 981475
Signed-off-by: David Collins <collinsd@codeaurora.org>
Allow the VDD_GFX CPR open-loop voltage to be adjusted based
upon aging measurements. This ensures that the closed-loop
voltage has room to increase as necessary.
Change-Id: I7ae8a4f90628f36f5e6164d18a4457552a20a8a1
CRs-Fixed: 949622
Signed-off-by: David Collins <collinsd@codeaurora.org>
Allow the VDD_APCC CPR open-loop voltage to be adjusted based
upon aging measurements. This ensures that the closed-loop
voltage has room to increase as necessary.
Change-Id: I84d5d434cac039b3fbf7f476939de1c968b519a4
CRs-Fixed: 949622
Signed-off-by: David Collins <collinsd@codeaurora.org>
Add support for fuse corner to corner mappings in which the
highest fuse corner is mapped to a corner lower than the
highest corner. This can be used to define a corner which has
a constant voltage offset above the highest fuse corner but which
does not impact interpolation for the lower corners.
Change-Id: Ie41522cb06ca81898f58458694067a567f608df0
CRs-Fixed: 981475
Signed-off-by: David Collins <collinsd@codeaurora.org>
It is only necessary to poll the power gate retention status register
when disallowing LDO retention mode. Once the power control override
register is cleared, any power domain is allowed to utilize LDO
retention. Therefore, polling of APCC_PGS_RET_STATUS must only be done
when VDD_APCC is scaled below retention voltage plus LDO headroom
voltage and the voltage is not sufficient to safely support power
domains using LDO retention.
Change-Id: I6578a75167ee4174be6ff8f1895d2d86d2ae8d76
CRs-Fixed: 980775
Signed-off-by: Osvaldo Banuelos <osvaldob@codeaurora.org>
For CONFIG_KALLSYMS, we keep two symbol tables and two string tables.
There's one full copy, marked SHF_ALLOC and laid out at the end of the
module's init section. There's also a cut-down version that only
contains core symbols and strings, and lives in the module's core
section.
After module init (and before we free the module memory), we switch
the mod->symtab, mod->num_symtab and mod->strtab to point to the core
versions. We do this under the module_mutex.
However, kallsyms doesn't take the module_mutex: it uses
preempt_disable() and rcu tricks to walk through the modules, because
it's used in the oops path. It's also used in /proc/kallsyms.
There's nothing atomic about the change of these variables, so we can
get the old (larger!) num_symtab and the new symtab pointer; in fact
this is what I saw when trying to reproduce.
By grouping these variables together, we can use a
carefully-dereferenced pointer to ensure we always get one or the
other (the free of the module init section is already done in an RCU
callback, so that's safe). We allocate the init one at the end of the
module init section, and keep the core one inside the struct module
itself (it could also have been allocated at the end of the module
core, but that's probably overkill).
CRs-Fixed: 982779
Change-Id: I519f081967785e44a6ea33b16b1da64b14979963
Reported-by: Weilong Chen <chenweilong@huawei.com>
Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=111541
Cc: stable@kernel.org
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Git-commit: 8244062ef1e54502ef55f54cced659913f244c3e
Git-repo: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
[salvares@codeaurora.org: resolved context conflicts in module.c]
Signed-off-by: Sanrio Alvares <salvares@codeaurora.org>
Create a debugfs node for PCIe which users have the
option to panic on linkdown instead of trying to recover.
Change-Id: Iba485b7312e99ceaaf23997f766a23964670b2ff
Signed-off-by: Tony Truong <truong@codeaurora.org>
Create a debugfs node in PCIe bus driver so that users
can enable or disable EP wakeirq for each root complex.
Change-Id: I7940001453c08593f2940fda378341ae43ff5bad
Signed-off-by: Tony Truong <truong@codeaurora.org>
Update the devfreq CPU cluster to CBF clock frequency mapping
tables based upon characterization results. This ensures that
minimum power is consumed for each CPU cluster frequency with
minimal performance impact.
Change-Id: If6ffd89f2faf3cd40dba3b7b09e38f46ac1007e9
CRs-Fixed: 980877
Signed-off-by: David Collins <collinsd@codeaurora.org>
commit 347fe47cccb8
("soc: qcom: glink_smd_xprt: Fix race condition of open ack").
After SSR, GLINK_CTRL channel remains up, IPC router send open over
GLINK_CTRL channel. Then process_ctl_event process the ack sent by remote
side and add platform driver without notifyig glink core.Later
platform_driver get probed, the channel has opened and glink is notified
of only remote_open event. Therefore local state will never reach
LOCAL_OPENED.
glink core should be notified about open ack from precess_ctl_event on
receiving open ack event.
CRs-Fixed: 974508
Change-Id: Ibbed8e680246659af2c6b58d91a62b9ff805d43c
Signed-off-by: Dhoat Harpal <hdhoat@codeaurora.org>
In dual VFE case, VFE0 and VFE1 will have different behavior
during stoping pix stream. We should disable write master sync
to ensure both VFEs stop as expected.
Change-Id: Ib63b52a948e526e0d2518cb563a4fc4d67340d0f
Signed-off-by: chiz <chiz@codeaurora.org>
CRs-Fixed: 977856
G-Link driver notifies IPC Router about intent request events in atomic
context. IPC router is allocating from with GFP_KERNEL.
Allocate the memory from atomic pool with GFP_ATOMIC.
CRs-Fixed: 978562
Change-Id: I75a38a2765e06aa490f91a79e5fd5c83f3c12c23
Signed-off-by: Dhoat Harpal <hdhoat@codeaurora.org>
Create a scm group to enable profiling time spent in a scm call.
This will help determine which scm call is spending how much time in
a higher execution level.
To enable "echo 1 > /sys/kernel/debug/tracing/events/scm/enable".
It is disabled by default. If enabled, traces can be found in
Ftrace logs.
Ftrace Output Example:
PROCESS CPU TIME SCM ID, X0, Number of args, args[0-2], X5, return values [0-2]
kworker/u8:4-329 [002] 128.201129: scm_call_start: func id=0x42000904 (args: 0x6, 0x2, 0x200000000, 0x65b8000000019, 0x142e0f000)
kworker/u8:4-329 [002] 128.201383: scm_call_end: ret: 0, 0, 0x4a07e00000001
kworker/u8:4-329 [002] 128.201464: scm_call_start: func id=0x42000904 (args: 0x6, 0x3, 0x1312d0000000000, 0x17900000000, 0x142e0f000)
kworker/u8:4-329 [002] 128.201542: scm_call_end: ret: 0x1bf03dddddd, 0x2f72656b726f776b, 0x343a32
CRs-Fixed: 969770
Change-Id: I4e5aaff796dbc9457c55fa529114dcb57780b7ec
Signed-off-by: Sanrio Alvares <salvares@codeaurora.org>
Add a quirk to mask out the RB 1-3 activity signals in the hang
detection logic. Set this quirk in the devicetree for 8996v2 and
v3.
CRs-Fixed: 978849
Change-Id: I63073b5973644453e775b41a9361de55d7933a07
Signed-off-by: Shrenuj Bansal <shrenujb@codeaurora.org>
During the initialization sequence, submit a set of important
packets to the GPU in order to pre-load the I-cache with the
critical ucode instructions.
CRs-Fixed: 978777
Change-Id: Ic6a17b24d8c3aa383af8e25cf9ef771459d65796
Signed-off-by: Shrenuj Bansal <shrenujb@codeaurora.org>
Add Qualcomm CPU Implementer ID macro. This is required for the
Errata framework.
CRs-Fixed: 969563
Change-Id: I354ed0d131c80805915f0a7533351187a89b7e91
Signed-off-by: Trilok Soni <tsoni@codeaurora.org>
Kryo2xx Silver CPUs support L1 and L2 cache error reporting. Add
support for the same.
CRs-Fixed: 969563
Change-Id: Ia2c860803169843a227eacebc9869e11673ffc7a
Signed-off-by: Trilok Soni <tsoni@codeaurora.org>
Specify VDD_APCC CPR open-loop and closed-loop voltage
adjustments for CPR revision 0 parts according to the most
recent hardware characterization results. These adjustments
result in major power savings for most corners and also ensure
stable operation for all corners.
Change-Id: I4fc66df626a102c478c1bf20a736869f5e389089
CRs-Fixed: 980877
Signed-off-by: David Collins <collinsd@codeaurora.org>
Increase the max threshold value so that user has more flexiblity
to tune the value.
CRs-Fixed: 971774
Change-Id: Id6408b7ee6779e95c48bcf9087ea7c87b54d42fd
Signed-off-by: Runmin Wang <runminw@codeaurora.org>