cpufreq: msm: remove gov_mutex from stop.

The stop could end up calling set_frequency callback. The set_frequency
callback takes the same gov_mutex lock and we end up in a deadlock.

Fix this by removing the locks around stop.

Signed-off-by: Abhijeet Dharmapurikar <adharmap@codeaurora.org>
(cherry picked from commit 5106c477a747279dbf045eed5a6ab4f68ac3501c)

Signed-off-by: Ram Kumar Chakravarthy Chebathini <rcheba@codeaurora.org>
(cherry picked from commit e0fa1831db0c57a8be8d5471ee3382b0f8a9165e)

Change-Id: I306f9cd2c05ce1e9c4c36d22d16b775a42881f0d
Signed-off-by: Sudhir Sharma <sudsha@codeaurora.org>
cpufreq: msm: fix race in cpufreq.

__cpufreq_driver_target expects to be called with the rw semaphore
held. We are not doing this when the frequency is asked to be changed
by dcvs.

Use cpufreq_driver_target variant of that function which gets the
rw semaphore before setting the frequency.

Signed-off-by: Abhijeet Dharmapurikar <adharmap@codeaurora.org>
(cherry picked from commit 54fc08ea6d33c6c561167f369cba060fe33755c9)

Signed-off-by: Ram Kumar Chakravarthy Chebathini <rcheba@codeaurora.org>
(cherry picked from commit a63446bcd75909db632ffc8ff3c4e6a96c8593c5)

Change-Id: I33cdac0aaac7fb44acf6f9eb451a80ff94175c46
Signed-off-by: Sudhir Sharma <sudsha@codeaurora.org>
msm: dcvs: update dcvs if the governor limits change.

We had seen issues where dcvs goes out of sync with the actual
freq the cpu is running at. The root cause was if the userspace
changes the limits on the governor, the governor ends up changing
the frequency without notifying dcvs.

Provide an api for the governor to call dcvs when a frequency change
happens.

Signed-off-by: Abhijeet Dharmapurikar <adharmap@codeaurora.org>
(cherry picked from commit 68c970e38fcb700d851301dbacc56da9387294c6)

Signed-off-by: Ram Kumar Chakravarthy Chebathini <rcheba@codeaurora.org>
(cherry picked from commit a7d720e513cfae2d3f9c03c25f2ce2f10c2e9de7)

Change-Id: I3f321df0270e997531d1a4cf3ee2251f86aef0bc
Signed-off-by: Sudhir Sharma <sudsha@codeaurora.org>
msm: dcvs: provide frequency set/get callbacks at registration.

There is no need to register a separate structure for setting and
getting frequency.

Simply pass function pointers to set and get callbacks when a
core is registered.

While at it rename the msm_dcvs_freq_sink_register/unregister to
msm_dcvs_freq_sink_start/stop to better reflect that those
apis are meant to do.

Signed-off-by: Abhijeet Dharmapurikar <adharmap@codeaurora.org>
(cherry picked from commit 69134111c2a24002d1995a05c99f84403ac6a7e8)

Signed-off-by: Ram Kumar Chakravarthy Chebathini <rcheba@codeaurora.org>
(cherry picked from commit 52cb57c3c6bc1c0d08c1ae9eb5dd0ff1e1125a96)

Change-Id: Iee7aee1cbb2f33ed2852f1816ab62416b96fa7e6
Signed-off-by: Sudhir Sharma <sudsha@codeaurora.org>
msm: dcvs: remove idle notification registration.

Register the idle enable callback along with the core. The code
becomes cleaner and easy to update.

Importantly, the msm_dcvs_idle driver becomes useless. Remove it
and instead let the msm governor handle idle enabling and disabling.

Signed-off-by: Abhijeet Dharmapurikar <adharmap@codeaurora.org>
(cherry picked from commit c1ed66c9035b4fbf240e46837d86a9a6442531f1)

Signed-off-by: Ram Kumar Chakravarthy Chebathini <rcheba@codeaurora.org>
(cherry picked from commit b4f5c2274fa2180b53563f2db0922eef212c0fcd)

Change-Id: Ice039e608d45bdeb9b8b718e5fbbf82a698d584d
Signed-off-by: Sudhir Sharma <sudsha@codeaurora.org>

Conflicts:

	arch/arm/mach-msm/devices-8064.c
	arch/arm/mach-msm/msm_dcvs_idle.c