Using memory barriers does not guarantee that the writes will
be completed before moving further unless the memory is marked
as strongly ordered. Use a read instead to make sure that the
previous writes take effect before the read can be processed
and we continue further.
CRs-Fixed: 1074277
Change-Id: Id1ec59664fb457c37dd63df008fbd6c540dffd67
Signed-off-by: Deepak Katragadda <dkatraga@codeaurora.org>
RNDIS IAD descriptor needs to get updated to support auto detection
of RNDIS device so that windows OS can load the RNDIS driver without
manually loading the driver.
Change-Id: Ia0cb418d886d6dd066d956c359a39af3ab47c9f2
Signed-off-by: Hemant Kumar <hemantk@codeaurora.org>
When WLAN driver calls unregister driver, an event is posted to
event work queue and the calling thread waits for the event to
complete. In some cases like during suspend, calling thread gets
interrupted and wait_for_completion returns. Once it is returned,
WLAN module resources are freed including code segments and work
queue gets into Synchronous Abort.
Fix the issue by making unregister uninterruptible to make sure
WLAN driver clean-up happens gracefully without interrupted by
user space.
CRs-fixed: 1073854
Change-Id: Id0f8634641fa2be12ffe00ddbc96a9e400e40739
Signed-off-by: Prashanth Bhatta <bhattap@codeaurora.org>
Power collapsing while processing events posted to work queue
causes stability issues because of suspending while in the
process of bring-up, bring-down or recovery. Prevent suspend
while processing events by calling pm_stay_awake().
CRs-fixed: 1073854
Change-Id: I6c7ae3b6e52529b14075fb2212bc2c5f76ae5730
Signed-off-by: Prashanth Bhatta <bhattap@codeaurora.org>
The current (CFS) scheduler implementation does not allow "to boost"
tasks performance by running them at a higher OPP compared to the
minimum required to meet their workload demands.
To support tasks performance boosting the scheduler should provide a
"knob" which allows to tune how much the system is going to be optimised
for energy efficiency vs performance.
This patch is the first of a series which provides a simple interface to
define a tuning knob. One system-wide "boost" tunable is exposed via:
/proc/sys/kernel/sched_cfs_boost
which can be configured in the range [0..100], to define a percentage
where:
- 0% boost requires to operate in "standard" mode by scheduling
tasks at the minimum capacities required by the workload demand
- 100% boost requires to push at maximum the task performances,
"regardless" of the incurred energy consumption
A boost value in between these two boundaries is used to bias the
power/performance trade-off, the higher the boost value the more the
scheduler is biased toward performance boosting instead of energy
efficiency.
Change-Id: I59a41725e2d8f9238a61dfb0c909071b53560fc0
cc: Ingo Molnar <mingo@redhat.com>
cc: Peter Zijlstra <peterz@infradead.org>
Signed-off-by: Patrick Bellasi <patrick.bellasi@arm.com>
Git-commit: 63c8fad2b06805ef88f1220551289f0a3c3529f1
Git-repo: https://source.codeaurora.org/quic/la/kernel/msm-4.4
Signed-off-by: Vikram Mulukutla <markivx@codeaurora.org>
This ensures that the load balancer always works correctly even
without compiler optimizations.
Change-Id: I36408ae65833b624401e60edfb50c19cc061d7bf
Signed-off-by: Syed Rameez Mustafa <rameezmustafa@codeaurora.org>
Rename all cmdbatch to drawobj. This forms a platform
for future changes where cmdbatch is split into different
types of drawobjs.
CRs-Fixed: 1054353
Change-Id: Ib84bee679e859db34e0d1f8a0ac70319eabddf53
Signed-off-by: Tarun Karra <tkarra@codeaurora.org>
Instead of using MTP dtsi, add a separate file for
msmcobalt QRD device.
CRs-fixed: 1069735
Change-Id: I8421d4a6ffef7657d3808de0fef95bdea400fe20
Signed-off-by: Xu Han <hanxu@codeaurora.org>
Update the diag header with latest log, message
and event information to match the list maintained
by the peripherals.
CRs-Fixed: 1074803
Change-Id: I2df3304029a05ce0f4cb11551e9ed768cd89f8b5
Signed-off-by: Chris Lew <clew@codeaurora.org>
Add support to read the initial CPR aging sensor skew fuse value
and to perform an aging measurement and subsequent voltage
adjustment.
Change-Id: I51a6762d026e7b5a4e39e957144f1b21c5ef121a
CRs-Fixed: 1048890
Signed-off-by: David Collins <collinsd@codeaurora.org>
Add support to perform a CPR aging measurement and subsequent
target quotient and open-loop voltage adjustments for CPRh
controllers at registration time.
Change-Id: I3a48a912fb9dea37a6197c1a13c2b41454d2dcff
CRs-Fixed: 1048890
Signed-off-by: David Collins <collinsd@codeaurora.org>
Potential use after free possibility when trying to access qmi client
data in the ssr notification and root pd_down notification handling.
CRs-Fixed: 1074483
Change-Id: I5390810861dbc1da368757df2b20e5daa35bd081
Signed-off-by: Gaurav Kohli <gkohli@codeaurora.org>
There is possibility where any control request for USB GSI endpint
e.g. CLEAR_FEATURE racing against USB GSI endpoint operation. Hence
acquire lock for USB GSI endpoint related operations which involves
sending required USB commands for the endpoint operation.
Change-Id: If14af809c443e12bd64e54910602c4aeeca4f0df
Signed-off-by: Mayank Rana <mrana@codeaurora.org>
Allow for easy track of step charging. Show step charging
status (enable/disable) and phases.
CRs-Fixed: 1052854
Change-Id: I525fcedda71c4928c61825faeea519355675457a
Signed-off-by: Harry Yang <harryy@codeaurora.org>
Interrupts are subject to storming in bad or unexpected circumstances.
Add the necessary structures to detect interrupt storms using storm watch.
Change-Id: Id3491b6f8927cb1ae7cbc8260defa697ca555765
Signed-off-by: Nicholas Troast <ntroast@codeaurora.org>
Storm watch provides a simple API for tracking the occurrence of event
storms.
An event storm is defined as a cluster of events where there are
X events with no more than Y milliseconds between them, where X and Y
are configurable per event.
Querying whether a storm has occurred marks a new event.
Change-Id: Idf4bb1421d0dbec295f92f84174cd4bbc6130250
Signed-off-by: Nicholas Troast <ntroast@codeaurora.org>
CC_OUT is the signal/status to the PD that indicates which of
the CC line is active. When its low CC1 is active and when
high CC2 is active.
During Source -> Sink Power Role Swap, CC_OUT is reset default
low (CC1 = CC) when SW sets the UFP/SNK_EN_CMD bit, losing the
plug orientation info and causing USB PD message error if CC2
was the CC pin.
Fix this by ensuring that s/w overrides the CC_OUT signal to
reflect the actual one, in preparation for a possible upcoming
power
CRs-Fixed: 1050738
Change-Id: I5877666c39ac9cad713a5802521527dd8552440c
Signed-off-by: Harry Yang <harryy@codeaurora.org>
Currently we have a workaround for A540 which inserts
WFI after every direct-render 3D mode and every 2D
mode draw. Add a check to enable this only on A540v1
as this workaround is not required for A540v2.
CRs-Fixed: 1072767
Change-Id: I679bbf68ee3dcc1aee30d56a646a42b6ff09fb6f
Signed-off-by: Harshdeep Dhatt <hdhatt@codeaurora.org>
Upstream kernel has deprecated the use of arch_counter_get_cntpct() and the
drivers are expected to switch to arch_counter_get_cntvct.
Switch to using arch_counter_get_cntvct().
Change-Id: I3eeefff492889b57837a8334eb933c22d0e4917a
Signed-off-by: Mahesh Sivasubramanian <msivasub@codeaurora.org>
Specify the GPU temperature sensor name in the device tree.
This name is used to get the sensor's temperature by querying the
thermal driver API.
CRs-Fixed: 1064728
Change-Id: Ia93d93a442aa848cbd42a5fb8ecad5ef875f9abf
Signed-off-by: Harshdeep Dhatt <hdhatt@codeaurora.org>
Add new sysfs nodes which satisfy a generic format requested
by customer. Also add a new node to track GPU temperature.
Create links to these nodes at a generic location:
/sys/kernel/gpu/
CRs-Fixed: 1064728
Change-Id: I414a07ff4f9ee14b8f882d15644b06a73d5fcf76
Signed-off-by: Harshdeep Dhatt <hdhatt@codeaurora.org>
All the buffers allocated for TZ related communication are not page
aligned. Make all the buffers page aligned.
Change-Id: I2640b20f35339449b9bf44c885e8baf9651596bc
Signed-off-by: Ram Chandrasekar <rkumbako@codeaurora.org>
Update msmcobalt machine driver to support S32LE format.
Also add support of 384Khz for USB_AUDIO_RX.
Change-Id: I576bd9c3c776ad5c24a15adf1447a9206dc61b89
Signed-off-by: Ashish Jain <ashishj@codeaurora.org>
Add support for 32 bit data format (SNDRV_PCM_FORMAT_S32_LE)
and sampling rate of 384Khz. Also update platform drivers
to use latest version of pcm media format command
ASM_MEDIA_FMT_MULTI_CHANNEL_PCM_V4.
Change-Id: I6b7ea860a398a7e4dd5f7e23ac3906ff0c6f2b3e
Signed-off-by: Ashish Jain <ashishj@codeaurora.org>
Add support for ASM_MEDIA_FMT_MULTI_CHANNEL_PCM_V4
command. This command adds support to playback/record 32 bit data
in 32 bit word and also provides a way to inform DSP about the
endianness of the data.
Change-Id: I3b013bedde8ccfa97a02e255e237df0cf2de13b8
Signed-off-by: Ashish Jain <ashishj@codeaurora.org>
Add support for configurable bit width for AFE encoder.
Add new mixer ctl to set for usecases which enables
configuring different input/output bit format
on AFE for usecases such as APTXHD encoder for 24bit input
and 16bit output.
Change-Id: I62326a097cbd71a3ec2b93a0120284d8f71f5d57
Signed-off-by: Naresh Tanniru <ntanniru@codeaurora.org>
Using %pK instead of %p to hide kernel pointers
based on kptr_restrict.
Change-Id: I065cff2a9e092d74d0e8c35da6551fab3805e83e
Signed-off-by: Ashwanth Goli <ashwanth@codeaurora.org>
Add the IOMMU config options that are used for the correct operation of
IOMMU driver on msmfalcon.
Change-Id: Ia6c446eca8a42800e781dfdaf46eab7bd44c126f
Signed-off-by: Charan Teja Reddy <charante@codeaurora.org>
Fix the dangling pointer issues on CoreSight that can cause the kernel
panic.
Change-Id: Ic20405cf2f64c6bc38e994780577b7da42cf6aba
Signed-off-by: Charan Teja Reddy <charante@codeaurora.org>
Add device tree configuration corresponding to all supported ion heaps
for msmtriton.
Change-Id: Ia4709c8be580f9a2de9e3e80819097144c2413ee
Signed-off-by: Charan Teja Reddy <charante@codeaurora.org>
Reschedule the idle work in case transition to idle state is rejected
because the GPU is busy. This change avoids the condition where
transition to NAP state gets rejected due to a pending IRQ which is
currently getting served by IRQ handler because of which GPU remains
in active state even when GPU is idle.
Change-Id: I472a30b6a0e83cdd6957ed12eaa39d0c7731fcb5
Signed-off-by: Deepak Kumar <dkumar@codeaurora.org>
The bimc-bwmon4 hardware module is only available on msmcobalt-v2.
Therefore move the bimc-bwmon4 setting to msmcobalt-v2 DT so
that msmcobalt-v1 can continue to use bimc-bwmon3 to measure DDR
bandwidth.
Change-Id: If6a44d83a4088e34eda3604ffa770b46653989f5
Signed-off-by: Rohit Gupta <rohgup@codeaurora.org>
During image download, the status is set after post download events
are broadcasted. This could possibly lead to race condition if other
drivers requested to boot the dsp before the status was set. Change
makes sure the wdsp status is set prior to broadcasting post download
events to avoid possible race conditions.
CRs-fixed: 1071949
Change-Id: If3ec6202b4729b24ee839c3a8aa4edf2482d6e59
Signed-off-by: Bhalchandra Gajare <gajare@codeaurora.org>
Change the mapping table of mincpubw to vote for 681MHz at the Fmax
of the lower speed bins of the CPUs.
Change-Id: Ie8b9abaceaa8585ab5b132076772b9c7ca71cbfe
Signed-off-by: Rohit Gupta <rohgup@codeaurora.org>
Remove unused suspend/resume functions as pm_suspend/pm_resume
are the functions that being called during system suspend/resume.
CRs-Fixed: 1074250
Change-Id: Ifd1d90402d6f79dc96246c4825d46d41296b0ba5
Signed-off-by: Yuanyuan Liu <yuanliu@codeaurora.org>
The clock driver does not currently use the secure API to write the
APM threshold value. This leads to the value being always left as 0.
Fix the write.
CRs-Fixed: 1074198
Change-Id: I61d8f930f7fe8c3539803a1e9b942095df0b0f86
Signed-off-by: Deepak Katragadda <dkatraga@codeaurora.org>
BCL gets the state of charge(soc) from the BMS power supply, which will
not capture the HLOS overidden soc value. This can create a scenario
where the mitigation will not be released if the soc value is
overridden in HLOS.
Use the battery supply notification, which can get the state of charge
value from the BMS or the HLOS overridden soc value if present.
Change-Id: I66d1ba1c6c3a942a80d3cee24746b00541fde3bc
Signed-off-by: Ram Chandrasekar <rkumbako@codeaurora.org>
Add a bit mask to enable workarounds only if they are needed for a
particular hardware revision.
Change-Id: Ibd9a896ff6746a48ddab249d7c8ab762ed3c2fbe
Signed-off-by: Harry Yang <harryy@codeaurora.org>
Signed-off-by: Nicholas Troast <ntroast@codeaurora.org>
Signed-off-by: Subbaraman Narayanamurthy <subbaram@codeaurora.org>
When the codec DSP is crashed / unresponsive, in order to recover
from the crash, it is required to shutdown and restart the DSP.
Add support for subsystem restart feature to recover from crashes.
CRs-fixed: 1071949
Change-Id: Ibe1918cbf525c41d8fa82fc772b3afe20cac6eb7
Signed-off-by: Bhalchandra Gajare <gajare@codeaurora.org>
Currently, the clock request is performed during init and the clock
is kept on assuming that there will be code download event followed
by init. This assumption may not always be true and might cause the
clock to be enabled when it is really not needed. Change fixes clock
disable such that clock is disabled right after init and re-enabled
again if code download event is raised.
CRs-fixed: 1071949
Change-Id: Icc415e911653012726e5b81b4fc09199560d5691
Signed-off-by: Bhalchandra Gajare <gajare@codeaurora.org>
It is possible that wcd codec DSP can crash or become unresponsive.
During such case, an error interrupt is generated by the codec. Add
support in manager driver to handle this interrupt and perform
subsystem restart to shutdown and reboot the DSP so that the DSP
can be recovered from the crash.
CRs-fixed: 1071949
Change-Id: I4662b5120bf7f731e399a27d8a613e2f3b648b00
Signed-off-by: Bhalchandra Gajare <gajare@codeaurora.org>
On MSMCOBALT v2, the qcom,llm-sw-overr flag is no longer needed.
This causes an issue where the corresponding array in code is not
filled up but the check to make the writes to the llm register
still succeeds. This leads to us writing 0 to the register
erroneously multiple times. Fix this check.
CRs-Fixed: 1074141
Change-Id: I2dd529a78d06ac08a34546df39cb01ad4c6cb3d5
Signed-off-by: Deepak Katragadda <dkatraga@codeaurora.org>
Add support to collect the codec memory dumps when any fatal
interrupt is raised from the DSP indicating the DSP is either
unresponsive/crashed. The memory dumps are only collected if
the debugfs node 'ramdump_enable' is set to true since ramdump
collection is debug only support.
Change-Id: I805ec63d125770b869cac892db8cf56f45510d6d
Signed-off-by: Bhalchandra Gajare <gajare@codeaurora.org>
It is possible that the manager driver may try to read codec memory
section through the wcd-spi driver. Add support in the wcd-spi driver
to handle the WDSP_EVENT_READ_SECTION event and perform reading of
the requested memory section.
Change-Id: If7fb228dc15cb47079c8a791443c4d12c29eeb9c
Signed-off-by: Bhalchandra Gajare <gajare@codeaurora.org>
The codec driver is notified through interrupt whenever the
DSP in codec is unresponsive/crashed. In such cases, collecting
dumps of the codec memory is useful in debugging the issues.
Change adds support in the wcd dsp manager driver to collect
the memory dumps upon notification of error interrupt.
Change-Id: Ib91cd4fc1476ee1a9ec448cde1a083070443f726
Signed-off-by: Bhalchandra Gajare <gajare@codeaurora.org>