Initialize cur_freq variable of each online cpu to the current
running cpu clock frequency. This avoids zeroing out the load
calculations until the first notification of the change in CPU
frequency comes in after CPUFREQ governors are intialized.
Also when a non boot cpu is up, update its cur_freq variable.
(cherry picked from commit 1633a48b16614e6b85c047a19ec93867c2ced3b3)
Change-Id: I950686deff02e2339eefae7d09392dda2174a545
CRs-fixed: 446017
Signed-off-by: Venkat Devarasetty <vdevaras@codeaurora.org>
If macroblock count per second goes beyond 1080p 30fps,
then bump the clock to turbo on supported platforms.
CRs-fixed: 455464
Change-Id: I48c34c9b6987706ea3e6b412b57791e2ae07ba52
Signed-off-by: Maheshwar Ajja <majja@codeaurora.org>
sysmon.h is present in arch/arm/mach-msm directory.
Fixes following compilation error:
arch/arm/mach-msm/include/mach/mdm2.h:15:20:
fatal error: sysmon.h: No such file or directory
Change-Id: I3b109b98c3a2581595e87b8ef56214ddc307cb6c
Signed-off-by: Satya Durga Srinivasu Prabhala <satyap@codeaurora.org>
We saw a problem where the charger was locked up and it reported
incorrect FSM states.
The root cause was that PMIC could be doing short sleeps while
LPM is set to 0. This means it would enter 32Khz and exit 32Khz
fairly quickly causing the lockup.
For e.g.
pm_chg_write gets called
write LPM = 0
pmic enters and exits sleep quickly.
charger locks up
the writes and reads are unreliable from this point on.
To prevent the lock up instead of using the LPM bit force
the charger to run from 19.2Mhz while doing a write.
Change-Id: I2211f030e053378ed01d564dec4fb9aea24ccb9d
Signed-off-by: Abhijeet Dharmapurikar <adharmap@codeaurora.org>
There are certain conditions where AICL should be disabled. For example,
cases where a strong usb charger capable of supporting the usb_max_current
or cases where a wireless charger is used.
Use the power supply property HEALTH to indicate whether AICL is desired
or not. If HEALTH is unknown enable AICL, if HEALTH is good disable
AICL.
While at it clean up the vbus_draw callback
- there is no need of the vbus_lock, remove it
- there were , comma separated statements in the probe function, use ;
instead
- the commit to verify the_chip is initialized, defeats the purpose of
remembering the usb current when the_chip is not initialized. Clean
this up
Change-Id: I8b21ccdf5ed69ea917cb370d2e8930c9d8a5003f
Signed-off-by: Abhijeet Dharmapurikar <adharmap@codeaurora.org>
ACA chargers can generate multiple vbus current draw requests
based on the number of USB peripherals connected to the dock.
Handle this by allowing runtime modification to the max target
current limit.
CRs-Fixed: 427933
Change-Id: Ie508a85bbbe129d77af48c05235376779d799128
Signed-off-by: Anirudh Ghayal <aghayal@codeaurora.org>
There is a potential out of bound array access to find the
max adjustment value for battery current. Fix it.
Change-Id: I73856b7cdc85204e501b33b3412490148867576e
Signed-off-by: Abhijeet Dharmapurikar <adharmap@codeaurora.org>
Add checking for NULL. Two parameters shouldn't be NULL.
Change-Id: Ied9e9e6238f6498305844bf3a08370c7cf751fc7
Signed-off-by: Fred Oh <fred@codeaurora.org>
Fixed incorrect logic to check if the next pagefault
is in the 4k address range of previous pagefaults.
Change-Id: I76c2e13f3b1cb287af0ef9c8af2f4452df23ec54
Signed-off-by: Tarun Karra <tkarra@codeaurora.org>
Signed-off-by: Rajeev Kulkarni <krajeev@codeaurora.org>
Commit f0b04dee "net: rmnet_usb: Support multiple instances" changed
the storage of the pre-allocated control device structures by adding
them to a list. The problem with that approach is that across
disconnect/re-probe, each instance may not be re-associated with the
interface as used previously. This coupling must be ensured to allow
users of the control device files to continue to access the same
interfaces across subsystem restarts.
Fix this by creating the instances in a dynamically-allocated array.
Since we assume probe order is in increasing interface number per
USB device, use this to assign the same instance when the
device/interface is re-probed.
CRs-fixed: 453167
Change-Id: Ide20abdd7acf0194dfb9bbdd9d039a8888b23d93
Signed-off-by: Jack Pham <jackp@codeaurora.org>
Previously the WFD driver was reponsible for signalling the
online/offline events to userspace listeners. This led to redundant
notifications due to the manner in which the WFD driver is used. The
signalling is better purposed when done from MDP driver.
Change-Id: Ifffbacb565f8758b65139f7b0e32df0773247e2d
Signed-off-by: Deva Ramasubramanian <dramasub@codeaurora.org>
The copied sync_pt was activated immediately. If the sync_pt was
signaled before the entire merge was completed, the new fence's pt_list
could be iterated over while it is still in the process of being
created.
Moving the the sync_pt_activate call for all new sync_pts to after both
the sync_fence_copy_pts and the sync_fence_merge_pts calls ensure that
the pt_list is complete and immutable before it can be reached from the
timeline's active list.
Change-Id: I7aa4d404a822347b6ce148018d2a66e4f6a20c78
Signed-off-by: Erik Gilling <konkers@android.com>
Signed-off-by: Naseer Ahmed <naseer@codeaurora.org>
Signed-off-by: Uma Maheshwari Bhiram <ubhira@codeaurora.org>
A killed task can stay in the task list long after its
memory has been returned to the system, therefore
ignore any tasks whose mm struct has been freed.
Change-Id: I76394b203b4ab2312437c839976f0ecb7b6dde4e
CRs-fixed: 450383
Signed-off-by: Liam Mark <lmark@codeaurora.org>
Scale filter FIR uses the adjacent pixels as part of the
processing. Source address registers should be program such that
they point to the first valid pixel so that non-ROI pixels are
ignored. This is done by making source x,y offsets to zero and
adding the computed offset to source address.
CRs-Fixed: 380020
Change-Id: I998fdd46f39dc67f32c422ec209da59d1add2e95
Signed-off-by: Mayank Chopra <makchopra@codeaurora.org>
Conflicts:
drivers/video/msm/mdp4_overlay.c
Signed-off-by: Mayank Chopra <makchopra@codeaurora.org>
All 8930 platform boards using the 1.2 SoC have been reworked so that
the sd card detect line's esd circuit is no longer powered by the sd
card's voltage regulator. The soc-info check was incorrect thus missing
out on 2.0 version.
Update the check to properly include all the correct versions of SoC.
Change-Id: I665933d3099b8576ef3085dd0989aaa5a2b9af97
Signed-off-by: Pratibhasagar V <pratibha@codeaurora.org>
update_stats() in wfd-utils gets called from various thread contexts.
Make this thread-safe to avoid list corruptions.
CRs-Fixed: 441415
Change-Id: I71c1da78b1f4e11b4f25852063a578e43ff18fb6
Signed-off-by: Rajeshwar Kurapaty <rkurapat@codeaurora.org>
Other WFI based hotplug implementations set the pen variable to
-1 in C code and do the appropriate flushing operations in one
location. They also don't try to invalidate the cache on a
spurious wakeup and report how many spurious wakeups there were.
Let's do the same in our code so that we can remove our
dependence on the dmac_{inv,flush}_range() functions (which are
no longer upstream) and easily report spurious wakeups to the
kernel logs.
This does delay the time we set the pen back to its default
value, but that doesn't actually matter because generic ARM
hotplug code already waits for a completion before continuing.
Change-Id: Ic36fbf744fe8abeda20ad9859a207b5e37c5e63c
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
Incorrect PMIC_THERM/XO_THERM readings are seen when
the XO clock is disabled.
The internal PMIC therm relies on the PMIC band gap
reference which in turn is enabled when any of the
PMIC clock buffers are enabled. The XO_THERM relies
on the VREF_XO as its reference source which gets
enabled when any of the PMIC clock buffers are
switched on. Therefore vote for a clock buffer when
a PMIC_THERM/XO_THERM is requested.
CRs-Fixed: 392602
Signed-off-by: Siddartha Mohanadoss <smohanad@codeaurora.org>
(cherry picked from commit f9dfe1b7b70b634422fbbbf65756aa997536bd33)
Change-Id: I09e132dbc4e635b96cd08ece245a766d68ed27b4
Signed-off-by: Sridhar Gujje <sgujje@codeaurora.org>
Conflicts:
drivers/hwmon/pm8xxx-adc.c
Signed-off-by: Sridhar Gujje <sgujje@codeaurora.org>
Signed-off-by: Sivasri Kumar Vanka <sivasri@codeaurora.org>
(cherry picked from commit 8ab75c713cef66317f9507b35cc08a5d7b49ae44)
Conflicts:
drivers/hwmon/pm8xxx-adc.c
Signed-off-by: Sridhar Gujje <sgujje@codeaurora.org>
-In afe_open, trying to unlock mutex on variable
that is already freed.
-correct the sequence by unlock mutex first then
free the variable.
CRs-Fixed: 423196
Change-Id: If7df0e0f46c7d16843c6d52ae821974cc74539ff
Signed-off-by: Laxminath Kasam <lkasam@codeaurora.org>
(cherry picked from commit 4c120ae85c6c5ac2adfdf61956b45d02461a93e3)
mdm bridge driver needs to get loaded for two mdm9x15 devices enumeration
for PID 0x9048 and 0x9079. In this case driver probe and disconnect can
happen in parallel on two different cores. Hence identify the available
bridge device instance and mark is as claimed by acquiring a global mutex.
Unclaime the device instance upon device disconnect.
Change-Id: I8f0f8fb7d76e8a4f1a68b3fad288782ff571c653
Signed-off-by: Hemant Kumar <hemantk@codeaurora.org>
This patch make sure active queue is not empty before signal
timeline.
Crs-fixed: 453745
Change-Id: I450c0923a67bdc90d06249e3ba83edb0b3b4b319
Signed-off-by: Kuogee Hsieh <khsieh@codeaurora.org>
CMA pages are designed to be used as fallback for movable allocations
and cannot be used for non-movable allocations. If CMA pages are
utilized poorly, non-movable allocations may end up getting starved if
all regular movable pages are allocated and the only pages left are
CMA. Always using CMA pages first creates unacceptable performance
problems. As a midway alternative, use CMA pages for certain
userspace allocations. The userspace pages can be migrated or dropped
quickly which giving decent utilization.
Change-Id: I6165dda01b705309eebabc6dfa67146b7a95c174
CRs-Fixed: 452508
[lauraa@codeaurora.org: Missing CONFIG_CMA guards, add commit text]
Signed-off-by: Laura Abbott <lauraa@codeaurora.org>
This reverts commit b5662d64fa5ee483b985b351dec993402422fee3.
Using CMA pages first creates good utilization but has some
unfortunate side effects. Many movable allocations come from
the filesystem layer which can hold on to pages for long periods
of time which causes high allocation times (~200ms) and high
rates of failure. Revert this patch and use alternate allocation
strategies to get better utilization.
Change-Id: I917e137d5fb292c9f8282506f71a799a6451ccfa
CRs-Fixed: 452508
Signed-off-by: Laura Abbott <lauraa@codeaurora.org>
CMA allocations rely on being able to migrate pages out
quickly to fulfill the allocations. Most use cases for
movable allocations meet this requirement. File system
allocations may take an unaccpetably long time to
migrate, which creates delays from CMA. Prevent CMA
pages from ending up on the per-cpu lists to avoid
code paths grabbing CMA pages on the fast path. CMA
pages can still be allocated as a fallback under tight
memory pressure.
CRs-Fixed: 452508
Change-Id: I79a28f697275a2a1870caabae53c8ea345b4b47d
Signed-off-by: Laura Abbott <lauraa@codeaurora.org>
Mdp has hardware bug which cause fetch engine stalled if less than
3 pixels at begin or end of line be cropped into destination. Reset
mixer can fix this problem. However frame work can provide better
work around solution by falling back to gpu if the condition detected.
This patch will not reset mixer but provide mixer reset function in
case of mixer reset is need in future.
CRs-fixed: 443018
Change-Id: I38ee591f28bf1b81f4fbd58838281b43ba0a8498
Signed-off-by: Kuogee Hsieh <khsieh@codeaurora.org>
Change reduces the priority of unwanted logs
which are coming in kernel logs by default
in video driver. Now these logs will come
only when enabled.
Change-Id: I18a534c7aaf8a2819be1b8812fad9e0710c49bd3
CRs-fixed: 454273
Signed-off-by: Maheshwar Ajja <majja@codeaurora.org>
Add ability to check MDP revision to the calibration config API. Allows
calibration tool to check specific MDP revision for proper tuning.
Change-Id: I926ed21704507cb390c283e5c4383dcf7fbf8030
Signed-off-by: Carl Vanderlip <carlv@codeaurora.org>
The solidfill color was getting reset to to default state to white.
Correctly reseting to black by default.
Crs-Fixed: 453600
Change-Id: I203ce61867d009509bf6acd01169f1fb0b223652
Signed-off-by: Siddhartha Agrawal <agrawals@codeaurora.org>
Add data structures for picture adjustment, IGC, QSEED2 sharpening/smooth
feature support on MSM8974.
These data structures are needed by the hardware/qcom/display project,
which is shared between multiple jb branches, including B-family jb
branches.
Change-Id: I0e228c90b70dbe4655173b753032eaae5748f7d9
Signed-off-by: Ping Li <quicpingli@codeaurora.org>
WCD9310 codec supports loopback through IIR filters. Either IIR1
or IIR2 can be used to setup loopback path. Add support and routing
to enable loopback through IIR2 filter path
CRs-fixed: 364236
Change-Id: I52cb455ad31aa129f81bac3852ac50d4a5a99bc2
Signed-off-by: Bhalchandra Gajare <gajare@codeaurora.org>
Signed-off-by: Kiran Kandi <kkandi@codeaurora.org>
(cherry picked from commit 8ba4446a571ed5f7033dc6cb651e19f5d9485abb)
Also change delay to pollrate_ms. This is for easy integration
with the sensor HALs.
Change-Id: I06e5e1f41caf2cee21ea2b218d672681b24ccd22
Signed-off-by: Orkhan Karimov <okarimov@codeaurora.org>
Signed-off-by: Wentao Xu <wentaox@codeaurora.org>
After all the current events are processed in the main loop, the next
pending event is marked to fire an interrupt to start the cycle anew.
When the event is marked, we check the timestamp again to make sure that
we are always caught up with the GPU. If the timestamp for the next
event happens to be retired when we get to this point, we silently leave
the function.
If there are no other subsequent events or waittimestamp requests, then
it is possible that another interrupt might never be fired for that context
and then the event gets missed. Return a 1 in this case all the way back
up the stack and make the event code keep processing events until we are
positive that none are past.
Change-Id: I5a770e7f06612e1aecbfe2e8ccbfeebdab3fc9fc
CRs-Fixed: 441191
Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org>
Instead of sending the currently expired timestamp to expired
events, send the timestamp that the event expected. This avoids
confusion for events that don't compare the actual timestamp
to the one they expected. Canceled events send the current
timestamp when they were canceled.
The kgsl_sync handler wasn't prepared for the second case so
add a check to prevent strange things from happening on the
timeline when a event is canceled.
Change-Id: Ic0dedbad3681db6222720884688dcddb9b06bda2
Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org>
Add reference counting to all KGSL events since they are dependent
on the context. This avoids a race condition where the context
could be destroyed while the events are being processed during cleanup.
Change-Id: Ifcd9655a6335d22c01f2606a0fbc5346d9a0314f
CRs-fixed: 438134
Signed-off-by: Carter Cooper <ccooper@codeaurora.org>
Move the event accounting from a master list on the device to individual
context lists. This makes the management code more simple and reduces
the amount of extra cycles taken trying to walk a single largish list.
The new added code makes the event code slightly bigger than kgsl.c can
bear. As events become more commonplace this code will be more important
and it will be easier to maintain in a dedicated file so move all the event
related code into kgsl_events.c
Change-Id: Ic0dedbadf00b96eee53aea1d26acb195f1a916ce
Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org>
Event based as well as interruptible based timestamp checks
use the same code, they differ on if the mutex is held or not.
Separate the common code out to avoid confusion.
Change-Id: Ie2ee01d7a07ff2ba7755ab8d327796345f9ca9ea
Signed-off-by: Carter Cooper <ccooper@codeaurora.org>
Signed-off-by: Rajeev Kulkarni <krajeev@codeaurora.org>
Add a field to the PMIC thermal alarm core data named
allow_software_override which is used to control whether or not
userspace may switch the mode of a PMIC thermal device to
"enabled" in order to enable software override of PMIC automatic
over temperature shutdown.
allow_software_override -
true: writing "enabled" to thermalfs mode file results in
software override of PMIC automatic over temperature
shutdown.
false: PMIC automatic over temperature shutdown is always
enabled. mode file cannot be set to "enabled".
Change-Id: I4c47fdf0c0c4704008591755296118ad7fac95ae
Signed-off-by: David Collins <collinsd@codeaurora.org>
(cherry picked from commit 8f6d8a8e7e1d149687819af7f9abbb24a8459cc0)
Use a delayed_work task to wait at least 40 ms in order for the
temp alarm status value to be updated after the TEMP_STAT IRQ
goes high. Also remove IRQ enable and disable calls in the ISR
since the work item can only be enqueued once before it is run.
Change-Id: Ib5f13d0e82258b399749de96152c081d71981909
Signed-off-by: David Collins <collinsd@codeaurora.org>
(cherry picked from commit a42ed24bdc1a1ab8e2c0148430df063ee0679d18)
Modify the kernel log message which is output when the PMIC
temperature alarm triggers so that the current (or estimated)
PMIC die temperature is shown regardless of ADC type.
Also change the log message printing and userspace notification
logic so that they only happen when the PMIC temp alarm stage
differs from what was previously seen. This will reduce the
number of messages seen while the temperature fluctuates around
one of the thresholds.
Change-Id: I5ee2206ea05dee86666308d11dad1fc5560e58e0
Signed-off-by: David Collins <collinsd@codeaurora.org>
(cherry picked from commit 76e6e2a17d89d79711ecff9182f12460368bd5d9)
Change the userspace notification mechanism in the over
temperature interrupt handler from kobject_uevent() to
sysfs_notify() in order to simplify userspace notification
handling. Ensure that the new notification mechanism is
independent from the current pm8xxx-tm mode. This means that the
"mode" thermalfs file does not need to be modified in order for
sysfs_notify() to get called in the interrupt handler.
As before, writing "enabled" to mode will enable the software
override of the automatic PMIC hardware stage 2 partial shutdown
and stage 3 full shutdown. Turning off these features is
typically undesirable and should be avoided unless userspace is
able to take immediate corrective action.
Change-Id: Ibd92b790778fd559df5ce74231e6cf71bef16370
Signed-off-by: David Collins <collinsd@codeaurora.org>
(cherry picked from commit 729c3ae9646cb8dc2a0ad0f301f7222bec70f6c6)
This device is present on 8x30 MTP/MDP platforms
Change-Id: Icfecc1a396e98782b4590ed68bd268608cae1c35
Signed-off-by: Orkhan Karimov <okarimov@codeaurora.org>
In the case that vsync ctrl is unbalanced, vsync IRQ is cleared
in suspend, vsync cannot be enabled after resume.
Clear the status when display is turned on
CRs-fixed: 449155
Change-Id: I5ecf23053b60d1fbd91f042758d67d39c83ab444
Signed-off-by: Ken Zhang <kenz@codeaurora.org>
Time stamp is unsigned. There is no need to check for
negative value.
Change-Id: I15e380f81e46908f6a9fe8d29c174de1b7c33173
CRs-fixed: 423372
Signed-off-by: Patrick Lai <plai@codeaurora.org>
In each vsync cycle there will be two vsync interrupts
generated, need ignore the wrong one to provide the correct vsync
timestamp.
CRs-fixed: 452269
Change-Id: Ic13eea77d15eb46f4879f818d346425c63efe41a
Signed-off-by: Ken Zhang <kenz@codeaurora.org>
Limit number of TS packets available to secure demux for processing
in any single processing session. This is done in order to prevent
large input buffer that require a long processing time and may cause
latency and overflow situations.
The limit can be fine-tuned as it is a module parameter.
Change-Id: I36f007da1b8152be27885ba4674bf42e6eb86ffa
Signed-off-by: Gilad Broner <gbroner@codeaurora.org>
Add support for the following features in the secure demux API:
* Setting TS output format for recording filters.
* PES counters reported by the secure demux.
* Filter flags support - CRC checking for section can be disabled.
Change-Id: I621f395154137c6470c278907961792c85c6c09c
Signed-off-by: Gilad Broner <gbroner@codeaurora.org>
The pm_qos request is removed before unregistering the HCD in remove
function. If root hub resume runs in parallel, there is a possibility
of adding the pm_qos request back to the active list. The pm_qos request
memory is freed after unregistering the HCD and this would lead to
pm_qos list corruption. A crash is observed when another driver is
submitting a pm_qos request after HSIC controller is removed during
shutdown. Remove HCD prior to releasing controller resources.
CRs-Fixed: 444928
Change-Id: Iaed6964e7d4245b8ae6c295ed6c76f5a9d32e20f
Signed-off-by: Pavankumar Kondeti <pkondeti@codeaurora.org>
port->port_usb could be NULL as part of assigning to in endpoint, so,
check port->port_usb is valid before assigning the endpoint.
CRs-Fixed: 451723
Change-Id: I3b5f7acaaeaae399f9a2482eb3f75b51fb36080b
Signed-off-by: Chiranjeevi Velempati <cvelempa@codeaurora.org>