Commit graph

564971 commits

Author SHA1 Message Date
Sudheer Papothi
74e78b3452 ALSA: core: Add support to handle compressed audio IOCTLs
This is needed to support the compressed audio till the
compressed core is done with development.

Signed-off-by: Asish Bhattacharya <asishb@codeaurora.org>
Signed-off-by: Banajit Goswami <bgoswami@codeaurora.org>
Signed-off-by: Sudheer Papothi <spapothi@codeaurora.org>
2016-03-23 20:10:13 -07:00
Laxminath Kasam
62c476312a ALSA: core: Fix crash by avoiding appl_ptr crossing 32-bit boundary
Incase of A2DP usecase using proxy driver, appl_ptr has
boundary value as 0x60000000 frames in sw_params for stereo(2 channels).
When this value crosses 0x40000000, then userspace calculating
appl_ptr at bytes results in crossing 32-bit value 0x100000000,
and points to 0x0 offset which can result in crash or pop.
To avoid above scenario, set the sw_params appl_ptr boundary value
within 0x40000000. Added proper check at sw_params update
to set this value correctly within 32-bit boundary(frames).

Change-Id: I537a04156699d90549a0a468ae19539ecd552d3b
CRs-Fixed: 483203
Signed-off-by: Laxminath Kasam <lkasam@codeaurora.org>
2016-03-23 20:10:12 -07:00
Santosh Mardi
96debfed1c ASoC: core: Update ALSA core to issue restart in underrun.
When compressed and pcm session is started the buffer pull will
Be from the DSP, in mmap mode for the scenario Hardware pointer
Is same as application pointer implies application has not filled the
Buffer to be send to DSP, and platform driver has to break and restart
The de queue process when the application has sufficient buffers.

When hardware pointer is same as application pointer it is an under run
Scenario where the ALSA framework has to trigger the under run and in HAL
The session has to re-prepare and re-triggered. based on the stop
Threshold, but in our system the stop threshold is INT_MAX which
Indicates that under run is not triggered in practical cases.

We have a brodcast usecase in which the mentioned under run case
Is hit mulitple times, and every time re-prepare and re-trigger will be
Expensive

Update the ASoC core framework to restart de queue process stopped
By platform Driver when the under run is hit, based on the available
Buffer and render flag, so the System will recover from the hang state.

To restart de queue process the ASoC core will be calling the restart
Callback registered by platform driver and this callback will be running in
Atomic context.

Change-Id: Ic9ea05a0dc6246346e9913493232882e2f5447d1
Signed-off-by: Santosh Mardi <gsantosh@codeaurora.org>
2016-03-23 20:10:11 -07:00
Sudheer Papothi
a3dd24f2ca ASoC: dapm: fix race condition in dapm
Dirty widget list can be accessed by multiple paths
in dapm framework. Dirty list is protected by dapm mutex.
Since dapm_force_enable_pin function accesses the dirty
list, protect it using the dapm mutex.

Signed-off-by: Aviral Gupta <aviralg@codeaurora.org>
Signed-off-by: Banajit Goswami <bgoswami@codeaurora.org>
Signed-off-by: Sudheer Papothi <spapothi@codeaurora.org>
2016-03-23 20:10:10 -07:00
Sudheer Papothi
c1ba99c89b ASoC: core: Skip suspending widgets with ignore flag
For wigdets which have set the suspend ignore flag asoc framework
shouldn't mark them as dirty when ASoC suspend function is called.
This change adds check to skip suspending the widgets with the flag set.

Signed-off-by: Gopikrishnaiah Anandan <agopik@codeaurora.org>
Signed-off-by: Sudheer Papothi <spapothi@codeaurora.org>
2016-03-23 20:10:10 -07:00
Banajit Goswami
bd0a8e5b32 ASoC: Add debug message to track widget power up/down
Add a debug message which can be used for tracking widgets being
power-up and powered-down by DAPM, mainly used for debugging
purpose.

Change-Id: I291a381da44edca3bc2bb07be53b1969c03a48f0
Signed-off-by: Banajit Goswami <bgoswami@codeaurora.org>
2016-03-23 20:10:09 -07:00
Sudheer Papothi
d5208bea97 ASoC: Update the widgets power up/down sequence
Widgets power up/down sequence in dapm is specific
to platform. Change makes msm specific changes to the
sequence.

Signed-off-by: Gopikrishnaiah Anandan <agopik@codeaurora.org>
Signed-off-by: Banajit Goswami <bgoswami@codeaurora.org>
Signed-off-by: Sudheer Papothi <spapothi@codeaurora.org>
2016-03-23 20:10:08 -07:00
Banajit Goswami
e7c9402974 ASoC: wcd9xxx: Fix the ANC CnP
Add virtual ANC widgets which are used to enable ANC
before PA is turned on, and to disable ANC before TX is
turned off.

CRs-fixed: 387904
Change-Id: Id3eca8c09d1d1d3c3d89ebe3d58be9bf676eb9c0
Signed-off-by: Damir Didjusto <damird@codeaurora.org>
Signed-off-by: Banajit Goswami <bgoswami@codeaurora.org>
2016-03-23 20:10:07 -07:00
Banajit Goswami
99f846e32c ASoC: msm: unblock the calls sent to the driver during SSR
Return error code ENETRESET from the platform driver
during the SSR recovery.
This facilitates the client to handle the error code
and take corrective measures rather than being blocked
on the call.

CRs-Fixed: 683288
Change-Id: I618edf0276bbe8826b47edec39df0dd4f87ffe93
Signed-off-by: Aviral Gupta <aviralg@codeaurora.org>
Signed-off-by: Banajit Goswami <bgoswami@codeaurora.org>
2016-03-23 20:10:06 -07:00
Phani Kumar Uppalapati
0d6fe3a626 ASoC: core: call digital mute ops for capture use case
Currently digital mute ops are called only for playback
use cases. Add support to call into codec digital mute
even for capture use cases.

CRs-Fixed: 662372
Change-Id: Idf5d1a823deb04d5ccb9139be745b6f936121a0c
Signed-off-by: Phani Kumar Uppalapati <phaniu@codeaurora.org>
2016-03-23 20:10:05 -07:00
Banajit Goswami
2b5acaa668 ASoC: Add locking in DAPM widget power update
While playback and capture is done concurrently the dapm widget
data is accessed parallelly which results in data corruption and
kernel panic. Fix this problem by serializing the stream event
operation by adding lock

dapm_seq_run will invoke dapm power sequence for pre-sorted list
of widgets to be powered up. Kernel panic issue is observed
during stability runs with the above sequence caused by null
pointer dereference in dapm_seq_run_coalesced. Fix kernel panic
issue by checking for valid snd_soc_dapm_context pointer in
dapm_seq_run before invoking dapm_seq_run_coalesced

Widget list in dapm is getting corrupted during concurrent
use cases where dapm_power_widget is accessed. This corruption
is resulting in kernel crash in dapm. Fix the issue by adding
protection in dapm_power_widgets API.

Change-Id: I49d19860277726cf3152e104ab40627fd56c021c
CRs-Fixed: 388785
Signed-off-by: Sriranjan Srikantam <cssrika@codeaurora.org>
Signed-off-by: Gopikrishnaiah Anandan <agopik@codeaurora.org>
Signed-off-by: Banajit Goswami <bgoswami@codeaurora.org>
2016-03-23 20:10:04 -07:00
Sudheer Papothi
42152f3e36 ASoC: Update the Max value of integer controls.
When control value is queried framework is returning the
min value as zero even if min is negative.
This change will make sure that frame work will update
the max value in cases where min is negative.

Signed-off-by: Gopikrishnaiah Anandan <agopik@codeaurora.org>
Signed-off-by: Banajit Goswami <bgoswami@codeaurora.org>
Signed-off-by: Sudheer Papothi <spapothi@codeaurora.org>
2016-03-23 20:10:03 -07:00
Banajit Goswami
de4a233227 ASoC: core: Add support for getting TX and RX channels
Based on which codec dai is selected, slimbus channel numbers
have to be queried when use case is being enabled.
Change adds support to get the channel numbers.

Signed-off-by: Banajit Goswami <bgoswami@codeaurora.org>
2016-03-23 20:10:03 -07:00
Anish Kumar
4b4b82dab4 ASoC: pcm: Add support for compat mode
When kernel is compiled for 64 bit and userspace client is in 32 bit
mode compat ioctl path will be taken.If platform driver supports compat
mode asoc framework should call compat function pointers.
Change adds support in asoc framework to call snd_pcm_lib_ioctl
in compat mode.

Change-Id: Ib4254648666aedfc2037a267cd7ffe4af4be398f
Signed-off-by: Anish Kumar <kanish@codeaurora.org>
2016-03-23 20:10:02 -07:00
Gopikrishnaiah Anandan
c3b0e4c033 ASoC: pcm: Fix the compat pointer assignment
Compat ioctl pointer is assigned to ioctl field instead of compat_ioctl
member variable. Change updates the assignment.

CRs-fixed: 688027
Change-Id: I248e3225493f0ceafcb5e70ce0ff827ab77c7a74
Signed-off-by: Gopikrishnaiah Anandan <agopik@codeaurora.org>
2016-03-23 20:10:01 -07:00
Sudheer Papothi
23b12cca62 soc: Add audio backend to hwdep interface
Add audio backend to hwdep interface. This is to provide ioctl
interface to communicate to routing driver.

Signed-off-by: Subhash Chandra Bose Naripeddy <snariped@codeaurora.org>
Signed-off-by: Krishnankutty Kolathappilly <kkolat@codeaurora.org>
Signed-off-by: Banajit Goswami <bgoswami@codeaurora.org>
Signed-off-by: Sudheer Papothi <spapothi@codeaurora.org>
2016-03-23 20:10:00 -07:00
Gopikrishnaiah Anand
edf8d7c336 ASoC: pcm: Add support for compat mode
When kernel is compiled for 64 bit and userspace client is in 32 bit
mode compat ioctl path will be taken.If platform driver supports compat
mode asoc framework should call compat function pointers.
Change adds support in asoc framework to support compat mode.

Change-Id: I4929bc89c2ad467cdc83f5a00fe9d38e425c3ca2
Signed-off-by: Gopikrishnaiah Anand <agopik@codeaurora.org>
2016-03-23 20:09:59 -07:00
Ravi Kumar Alamanda
53aea8efd3 ASoC: Compress: Check and set pcm_new driver op
Check and set if pcm_new driver op is initialized by the driver.
This allows the compress offload drivers to register mixer
controls.

Change-Id: If54fa36cf19cbca7239d6e3e30455472e9a173d8
Signed-off-by: Ravi Kumar Alamanda <ralama@codeaurora.org>
2016-03-23 20:09:58 -07:00
Neema Shetty
20040e1da8 ASoC: core: Update DMA mask for hostless pcm devices
Hostless pcm device coherent DMA mask is hardcorded to 32.
Update it based on size of dma address to support both
32 and 64 bit

Change-Id: I604d440cfd5abcf473ec87b18b5cc6ee8ff42b49
Signed-off-by: Neema Shetty <nshetty@codeaurora.org>
Signed-off-by: Vidyakumar Athota <vathota@codeaurora.org>
2016-03-23 20:09:57 -07:00
Sudheer Papothi
4b0ad86df7 ASoC: core: Add support for hostless playback/capture
For capture/playback usecases in which host doesn't exchange
PCM data, audio driver creates hostless pcm devices.
Change adds support for hostless pcm devices.

Signed-off-by: Gopikrishnaiah Anandan <agopik@codeaurora.org>
Signed-off-by: Banajit Goswami <bgoswami@codeaurora.org>
Signed-off-by: Sudheer Papothi <spapothi@codeaurora.org>
2016-03-23 20:09:56 -07:00
Banajit Goswami
1da9ca94be ASoC: Don't close shared back end dailink
Multiple front end dailinks can use a single backend dailink.
When front end dailink is closed, associated back end dailink shouldn't
be closed if it is connected to other front ends.
Change ensures that back end dai is closed after all connected front end
dailinks are closed.

Change-Id: Ie00abca8391011377a9566adb837b3e46d499a5a
Signed-off-by: Gopikrishnaiah Anandan <agopik@codeaurora.org>
Signed-off-by: Banajit Goswami <bgoswami@codeaurora.org>
2016-03-23 20:09:56 -07:00
Banajit Goswami
f794212e7c ASoC: soc-pcm: Fix playback shutdown sequence
Change closes the frontend pcm substream followed by the
backend substream to ensure correct playback shutdown
sequence.

CRs-fixed: 445499
Change-Id: Ifc6327e9b07ad40e5b4952b4db270d528b3b633b
Signed-off-by: Gopikrishnaiah Anandan <agopik@codeaurora.org>
Signed-off-by: Banajit Goswami <bgoswami@codeaurora.org>
2016-03-23 20:09:55 -07:00
Banajit Goswami
7b3d99edbb ASoC: Avoid putting stream state to STOP when stream paused
When multiple Front-end are using the same Back-end, putting
the stream state for a Front-end to STOP will make the the Backend
stream to be released, when the front-end is paused. This will avoid
the Backend to be released (when another active front-end stream is
present).
Instead, put the stream state to PAUSED, which will keep the Back-end
ON.

Change-Id: Ic31bf90a09b605b91f6b9fe3c09361b1145581fb
CRs-fixed: 428825
Signed-off-by: Banajit Goswami <bgoswa@codeaurora.org>
2016-03-23 20:09:54 -07:00
Sudheer Papothi
5d092152c9 ALSA: jack: Add support to report second microphone
ALSA jack framework currently supports reporting only
one single microphone. Add support to report presence of
second microphone to userspace.

Signed-off-by: Phani Kumar Uppalapati <phaniu@codeaurora.org>
Signed-off-by: Banajit Goswami <bgoswami@codeaurora.org>
Signed-off-by: Sudheer Papothi <spapothi@codeaurora.org>
2016-03-23 20:09:53 -07:00
Sudheer Papothi
545e868e05 ALSA: jack: Update supported jack switch types
Change adds support for jack switch types supported
by platform.

Signed-off-by: Gopikrishnaiah Anandan <agopik@codeaurora.org>
Signed-off-by: Banajit Goswami <bgoswami@codeaurora.org>
Signed-off-by: Sudheer Papothi <spapothi@codeaurora.org>
2016-03-23 20:09:52 -07:00
Sudheer Papothi
9710603b49 ALSA: jack: update jack types
Change updates the jack types that will be supported
by the platform.

Signed-off-by: Banajit Goswami <bgoswami@codeaurora.org>
Signed-off-by: Sudheer Papothi <spapothi@codeaurora.org>
2016-03-23 20:09:51 -07:00
Sudheer Papothi
93a336484a ALSA: core: Expose sound card online/offline state
Expose sound card online/offline state to procfs so userspace application
can poll and read sound card's state.

Signed-off-by: Joonwoo Park <joonwoop@codeaurora.org>
Signed-off-by: Banajit Goswami <bgoswami@codeaurora.org>
Signed-off-by: Sudheer Papothi <spapothi@codeaurora.org>
2016-03-23 20:09:50 -07:00
Sudheer Papothi
7ed3e44771 ASoC: core: Introduce macro SOC_SINGLE_MULTI_EXT
For some of the mixer controls client would like to register
count as a parameter. Macro adds support to specify the count.

Signed-off-by: Banajit Goswami <bgoswami@codeaurora.org>
Signed-off-by: Sudheer Papothi <spapothi@codeaurora.org>
2016-03-23 20:09:50 -07:00
Subash Abhinov Kasiviswanathan
ac913a4be3 defconfig: arm64: msm: Enable data features
Enable configurations needed for the operation of data specific
features such as IPv4 and IPv6 tethering and packet filtering
using QoS. Enable ESP match target in iptables to provide the ability
to match packets based on the SPI (Security Parameters Index) value
in the ESP (Encapsulating Security Payload) header.

Signed-off-by: Subash Abhinov Kasiviswanathan <subashab@codeaurora.org>
2016-03-23 20:09:49 -07:00
Ravinder Konka
c60a91f21f skb: Adding trace event for gso.
This patch adds trace events to help with debug for gso feature
by identifying the packets(and their lenghts) that are using
the segmentation offload feature.

Change-Id: Ibfe1194cc63e74c75047040b0c540713d539992e
Acked-by: Ashwanth Goli <ashwanth@qti.qualcomm.com>
Signed-off-by: Ravinder Konka <rkonka@codeaurora.org>
2016-03-23 20:09:48 -07:00
Subash Abhinov Kasiviswanathan
410646778a net: rmnet_data: Fix QMAP ACK's to work with DL checksum offload
Specifications state that the MAP packet length in the MAP header do
not account for the number of bytes of packet trailer from DL checksum
offload. Current implementation takes this into account for data
packets but not for command packets. As a result, the additional
8 bytes were sent to hardware as part of the MAP ACK's and were
subsequently dropped.

Fix this by truncating the extra bytes of the DL checksum trailer from
the MAP ACK.

CRs-Fixed: 961336
Change-Id: I175dde695e7ee09d16c99fb71898d635c7a812ab
Signed-off-by: Subash Abhinov Kasiviswanathan <subashab@codeaurora.org>
2016-03-23 20:09:47 -07:00
Subash Abhinov Kasiviswanathan
2a7e0a52fa net: rmnet_data: Set the protocol when sending MAP ACK's
Set the protocol as ETH_P_MAP when sending a MAP ACK as a response
to a MAP command packet. Physical device drivers may drop these
packets if the ETH_P_MAP protocol is not present on the skb.

CRs-Fixed: 961336
Change-Id: I05ca1350fb16747b0300106654a74d3318389a30
Signed-off-by: Subash Abhinov Kasiviswanathan <subashab@codeaurora.org>
2016-03-23 20:09:46 -07:00
Subash Abhinov Kasiviswanathan
d922877a06 ipv6: addrconf: Fix recursive spin lock call
A rcu stall with the following backtrace was seen on a system with
forwarding, optimistic_dad and use_optimistic set. To reproduce,
set these flags and allow ipv6 autoconf.

This occurs because the device write_lock is acquired while already
holding the read_lock. Back trace below -

INFO: rcu_preempt self-detected stall on CPU { 1}  (t=2100 jiffies
 g=3992 c=3991 q=4471)
<6> Task dump for CPU 1:
<2> kworker/1:0     R  running task    12168    15   2 0x00000002
<2> Workqueue: ipv6_addrconf addrconf_dad_work
<6> Call trace:
<2> [<ffffffc000084da8>] el1_irq+0x68/0xdc
<2> [<ffffffc000cc4e0c>] _raw_write_lock_bh+0x20/0x30
<2> [<ffffffc000bc5dd8>] __ipv6_dev_ac_inc+0x64/0x1b4
<2> [<ffffffc000bcbd2c>] addrconf_join_anycast+0x9c/0xc4
<2> [<ffffffc000bcf9f0>] __ipv6_ifa_notify+0x160/0x29c
<2> [<ffffffc000bcfb7c>] ipv6_ifa_notify+0x50/0x70
<2> [<ffffffc000bd035c>] addrconf_dad_work+0x314/0x334
<2> [<ffffffc0000b64c8>] process_one_work+0x244/0x3fc
<2> [<ffffffc0000b7324>] worker_thread+0x2f8/0x418
<2> [<ffffffc0000bb40c>] kthread+0xe0/0xec

v2: do addrconf_dad_kick inside read lock and then acquire write
lock for ipv6_ifa_notify as suggested by Eric

Fixes: 7fd2561e4e ("net: ipv6: Add a sysctl to make optimistic
addresses useful candidates")

CRs-Fixed: 970640
Change-Id: I2d8ef58108e2ab29594bd0179af8523eaea6fff9
Cc: Eric Dumazet <edumazet@google.com>
Cc: Erik Kline <ek@google.com>
Cc: Hannes Frederic Sowa <hannes@stressinduktion.org>
Signed-off-by: Subash Abhinov Kasiviswanathan <subashab@codeaurora.org>
Acked-by: Hannes Frederic Sowa <hannes@stressinduktion.org>
Acked-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Git-commit: 16186a82de1fdd868255448274e64ae2616e2640
Git-repo: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
2016-03-23 20:09:45 -07:00
Skylar Chang
e6749c42e0 msm: ipa3: defconfig change to compile ipa3
Signed-off-by: Skylar Chang <chiaweic@codeaurora.org>
2016-03-23 20:09:44 -07:00
Skylar Chang
14bf6793b8 msm: ipa3: support IPA driver
Signed-off-by: Skylar Chang <chiaweic@codeaurora.org>
2016-03-23 20:09:44 -07:00
Devesh Jhunjhunwala
d9ca088b7e defconfig: msmcortex: Enable the stub regulator driver
Add configs to enable the stub regulator driver for the
debug and perf configs for msmcortex.

Signed-off-by: Devesh Jhunjhunwala <deveshj@codeaurora.org>
2016-03-23 20:09:43 -07:00
Devesh Jhunjhunwala
54b0cb4a1e regulator: msm: Add snapshot of the stub regulator driver
This is a snapshot of the Documentation and header file for
the stub regulator driver as of msm-3.18 kernel commit:
2642c0adc79c06c0f3225da0177e910a1cea8cb5 ("Merge "ARM: dts:
msm: Add support for truly 720p command mode panel on msmgold"")

Signed-off-by: Devesh Jhunjhunwala <deveshj@codeaurora.org>
2016-03-23 20:09:42 -07:00
Satya Durga Srinivasu Prabhala
25a33bfca9 defconfig: arm64: msmcortex: Enable sensors SSC driver
Enable sensors SSC driver for msmcortex.

Signed-off-by: Satya Durga Srinivasu Prabhala <satyap@codeaurora.org>
2016-03-23 20:09:41 -07:00
Satya Durga Srinivasu Prabhala
4576c785fb ARM64: dts: msm: Add sensors SSC node for msmcobalt
To support Sensors on msmcobalt, Add sensors SSC
device tree node with status = "ok".

Change-Id: I2a81ea6a5acc1043a6d28f718580d6a4eb1d39ea
Signed-off-by: Satya Durga Srinivasu Prabhala <satyap@codeaurora.org>
2016-03-23 20:09:40 -07:00
Zhen Kong
bafc698ecf defconfig: arm64: msm: Enable tz_log
This is necessary to support tz_log functionality

Acked-by: Shabnam Aboughadareh <shabnama@qti.qualcomm.com>
Signed-off-by: Zhen Kong <zkong@codeaurora.org>
2016-03-23 20:08:52 -07:00
Zhen Kong
3c3595e2cd firmware: qcom: add snapshot of tz_log.c
This snapshot is taken as of msm-3.18 commit e70ad0cd
(Promotion of kernel.lnx.3.18-151201.)

Acked-by: Shabnam Aboughadareh <shabnama@qti.qualcomm.com>
Signed-off-by: Zhen Kong <zkong@codeaurora.org>
2016-03-23 20:08:20 -07:00
Rohit Gupta
659e5fc580 defconfig: Enable PM_DEVFREQ related configs
Enable devfreq device and governors.

Change-Id: Ifbdb959caab5715dd71c366a38250367ae032605
Signed-off-by: Junjie Wu <junjiew@codeaurora.org>
2016-03-23 20:04:46 -07:00
Junjie Wu
ee74d929b8 PM / devfreq: Kconfig: Replace ARCH_MSM with ARCH_QCOM
ARCH_MSM has been replaced by ARCH_QCOM. Fix Kconfig for various
devfreq governors and devices.

Change-Id: Ifa85494785cea7eb03be6c02d5664ee6bb2110c6
Signed-off-by: Junjie Wu <junjiew@codeaurora.org>
2016-03-23 20:04:45 -07:00
Rohit Gupta
9c9b504f06 PM / devfreq: Fix the return value check in memlat governor
The return value of kstrtouint is erroneously checked while setting
the tunables for mem_latency governor due to which the tunables
cannot be changed from their default values.
This change rectifies that behavior.

Change-Id: Ief7dda4638ede2c97b26229f1188a1559b238920
Signed-off-by: Rohit Gupta <rohgup@codeaurora.org>
2016-03-23 20:04:44 -07:00
Rohit Gupta
44cac5da6a PM / devfreq: Fix perf event initialization to avoid memory leaks
Currently stop_hwmon only releases the perf events for each CPU
in the memlat device group. This leaves out the perf_event_attrs
that are not needed anymore leading to memory leaks.
This patch frees perf_event_attrs right after the perf events are
created because they are copied into the perf_event structure
when it is created for a particular event and hence do not need
to exist beyond that point.

Change-Id: If0871739ef477dfbcbbfc6ab2a631ce25deaf71c
Signed-off-by: Rohit Gupta <rohgup@codeaurora.org>
2016-03-23 20:04:43 -07:00
Rohit Gupta
6f55f08b06 PM / devfreq: Handle offline CPUs while creating events
If any of the CPUs monitored by a memlat device is offline while
trying to register for perf events, the registration fails
returning an error code to the governor's start_monitor function
which then fails the setting of governor and leaves the system in
a bad state.
To avoid this scenario, this patch allows for initialization errors
while registering for perf events and remembers the failing offline
CPUs. Perf event registration is tried for the failing CPUs when they
come back online. Once all the CPUs have registered for perf events
hotplug notifiers callbacks are unregistered.

Change-Id: I36c33d9dc627f60ab9d7db41913661927938e850
Signed-off-by: Rohit Gupta <rohgup@codeaurora.org>
2016-03-23 20:04:42 -07:00
Hanumath Prasad
69d2c9fae6 devfreq: devfreq_simple_dev: call clk_round_rate in dev_target
clk_set_rate is failing for some of the frequencies due to higher
precision introduced in clock driver. Hence call the clk_round_rate
again in dev_target to make sure we send the correct frequency to
clk_set_rate.

Change-Id: I3e40690bf794d99debbcecdcaf05aaac3363caa8
Signed-off-by: Hanumath Prasad <hpprasad@codeaurora.org>
2016-03-23 20:04:42 -07:00
Saravana Kannan
4b5b233f04 PM / devfreq: governor_cpufreq: Fix incorrect refcounting of OF node
The of_node_put(of_child) call was put in to balance the of_node_get()
that's done inside for_each_child_of_node(). But that's not the right thing
to do because for_each_child_of_node() already takes care of doing
of_node_put(). So, delete the unnecessary of_node_put(of_child) call. We
still need the of_node_put(of_par) though.

Change-Id: Iff7744839cfcf01d5a472449f74859e9030b7e16
Signed-off-by: Saravana Kannan <skannan@codeaurora.org>
2016-03-23 20:04:41 -07:00
Rohit Gupta
e0bb9942b4 PM / devfreq: memlat: Get complete CPU list during the probe
Currently arm-memlat-mon driver uses cpu_coregroup_mask to get
the sibling CPUs for the first CPU specified during the probe.
However if any of the CPUs in a cluster isn't hotplugged in
even once before the probe runs then the call to cpu_coregroup_mask
might not give the updated list of all the sibling CPUs for the
specified CPU.
With this change the initialization of the cpumask for the memlat
device is obtained from the list of CPU phandles specified in the
dtsi file.

Change-Id: Ide97d60d9eecbbe1d33deda72a13951059822896
Signed-off-by: Rohit Gupta <rohgup@codeaurora.org>
[junjiew@codeaurora.org: dropped changes in dtsi files.]
Signed-off-by: Junjie Wu <junjiew@codeaurora.org>
2016-03-23 20:04:40 -07:00
Rohit Gupta
43f61ed8aa PM / devfreq : Introduce a memory-latency governor
Use performance counters to detect the memory latency sensitivity
of CPU workloads and vote for higher DDR frequency if required.

Change-Id: Ie77a3523bc5713fc0315bd0abc3913f485a96e0e
Signed-off-by: Rohit Gupta <rohgup@codeaurora.org>
Suggested-by: Saravana Kannan <skannan@codeaurora.org>
[junjiew@codeaurora.org: dropped changes in arch/arm64/Kconfig]
Signed-off-by: Junjie Wu <junjiew@codeaurora.org>
2016-03-23 20:04:39 -07:00