Commit graph

571125 commits

Author SHA1 Message Date
Skylar Chang
9f3090c43d msm: ipa: support GRO feature on msmcobalt
For this GRO feature, IPA-driver should not
de-aggregate the pkt received from modem, also
no need to attach status. Also netmgrd will
call ioctl to wan-driver to indicate when
this feature will be enable.

Change-Id: I1bc6fb87684ee8da6126dc331debf5880adceb4f
Signed-off-by: Skylar Chang <chiaweic@codeaurora.org>
2016-06-01 15:27:49 -07:00
Rohit Gupta
7668a3726f PM / devfreq: memlat: Prevent deadlock with hotplug in start_hwmon
When start_hwmon() runs with another thread trying to hotplug a
CPU the two threads can enter a deadlock situation as follows:

Thread A (start_hwmon())		Thread B (CPU down)
get_online_cpus()
	|
atomic_inc(&cpu_hotplug.refcount)
					     CPU down
						|
				     mutex_lock(&cpu_add_remove_lock)
						|
				     cpu_hotplug_begin() waits on
				     cpu_hotplug.refcount to reset
register_cpu_notifier()
	|
mutex_lock(&cpu_add_remove_lock)

With this change the notifers are registered and unregistered per
device rather than having a common notifier block for all the memlat
devices and unregistration only happens on stop_hwmon. This makes it
possible to move the registration outside the hotplug lock without
any race between multiple memlat devices.

Change-Id: I6ad561fe4967042e45190aea2c9b7fcfe05bafdd
Signed-off-by: Rohit Gupta <rohgup@codeaurora.org>
2016-06-01 15:27:34 -07:00
Siddartha Mohanadoss
8b2d1771d2 thermal: tsens: Update critical temperature threshold value
Existing controller health detection uses a critical
temperature threshold of -40degC. Update the value to -95degC
so that there are no false positives seen when min threshold
is disabled and temperature goes below the threshold value.

Change-Id: If27ecfbb7b080080074bfe142f493fbf8f53f673
Signed-off-by: Siddartha Mohanadoss <smohanad@codeaurora.org>
2016-06-01 15:27:21 -07:00
Skylar Chang
687ab4acbd msm: ipa: enable power save to ODU
Remove keep_awake flag from ODU bridge to allow IPA to
go to clock gating.

CRs-Fixed: 1013927
Change-Id: Ic9efb8555ec4bdad2c099719de4ed56677b194ca
Acked-by: Ady Abraham <adya@qti.qualcomm.com>
Signed-off-by: Skylar Chang <chiaweic@codeaurora.org>
2016-06-01 15:27:08 -07:00
Skylar Chang
db200c1e6e msm: ipa3: fix to read hw tables from debugfs
Fix to IPA driver debugfs logic to read filtering
and routing directly from HW.

CRs-Fixed: 1020271
Change-Id: I6bb5f9a01e3f41107d7b5bdf7c19557546573463
Acked-by: Ady Abraham <adya@qti.qualcomm.com>
Signed-off-by: Skylar Chang <chiaweic@codeaurora.org>
2016-06-01 15:26:55 -07:00
Tatenda Chipeperekwa
57799c7a59 Revert "msm: mdss: hdmi: check clk state before power on"
This reverts commit 05f3cbbe5c
("msm: mdss: hdmi: check clk state before power on"). The check
for clock state was required for earlier target's fast hot plug
use cases, and uses the clock framework for check for clock rates.
This approach does not work on msmcobalt and causes the power on
sequence for HDMI to fail.

CRs-Fixed: 1022772
Change-Id: I320427f810fd35b11335685bae95b3c5fb9c8fee
Signed-off-by: Tatenda Chipeperekwa <tatendac@codeaurora.org>
2016-06-01 15:26:40 -07:00
Satya Durga Srinivasu Prabhala
7149162d4e ARM: dts: msm: Add support for MSM8996pro v1.1
Add device tree support for MSM8996pro v1.1 along with different PMIC
configurations it supports.

CRs-Fixed: 1004223
Change-Id: I46f2ec5170fb204e9e0535aca1482b5e39e21de3
Signed-off-by: Satya Durga Srinivasu Prabhala <satyap@codeaurora.org>
2016-06-01 15:26:24 -07:00
Susheel Khiani
3b2e2a3ded msm: secure_buffer: Fix possible NULL pointer dereference
Presently we were passing NULL dma_handle while
making dma_alloc_coherent call. This is an issue
as alloc function would try to populate handle
value with dma address and would end up getting
NULL pointer error. Fix this.

Change-Id: I38ebb9bbae2d6e1e1311fe438b3c8fc3f65e5692
Signed-off-by: Susheel Khiani <skhiani@codeaurora.org>
2016-06-01 15:26:08 -07:00
Shiraz Hashim
9735edbe89 arm: dma-mapping: fix data types to hold size_t
size_t type data should not be held under variable of type
int, as this can truncate large values especially on a
64bit system. Fix it.

Change-Id: I5ad1ab321738772a99920e3fa287bda266cb05ed
Signed-off-by: Shiraz Hashim <shashim@codeaurora.org>
2016-06-01 15:25:54 -07:00
Gilad Landau
1750551815 msm: ipa3: Move IPA RAM mapping to DTS file
Use DTS configuration file to initialize IPA memory partitions
in order to allow per target configuration decoupled from code.

Change-Id: If770b9315807e51e46cd94dec6234ef186cf4fcb
CRs-Fixed: 1022125
Signed-off-by: Gilad Landau <glandau@codeaurora.org>
2016-06-01 15:25:42 -07:00
Chen Feng
13e4f13fde staging: ion : Donnot wakeup kswapd in ion system alloc
Since ion alloc can be called by userspace,eg gralloc.
When it is called frequently, the efficiency of kswapd is
to low. And the reclaimed memory is too lower. In this way,
the kswapd can use to much cpu resources.

With 3.5GB DMA Zone and 0.5 Normal Zone.

pgsteal_kswapd_dma 9364140
pgsteal_kswapd_normal 7071043
pgscan_kswapd_dma 10428250
pgscan_kswapd_normal 37840094

With this change the reclaim ratio has greatly improved
18.9% -> 72.5%

Change-Id: I20ea0e4ad0537f6e90efbc59fb8d56d691ee3bde
Signed-off-by: Chen Feng <puck.chen@hisilicon.com>
Signed-off-by: Lu bing <albert.lubing@hisilicon.com>
Reviewed-by: Laura Abbott <labbott@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Git-commit: 2ef230531ee171a475fc3ddad5516dd7e09a8a77
Git-repo: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
[vinmenon@codeaurora.org: Resolved minor merge conflicts]
Signed-off-by: Vinayak Menon <vinmenon@codeaurora.org>
2016-06-01 15:25:30 -07:00
Vijay kumar Tumati
c136a71701 msm: camera: Add support for DPCM modes
DPCM8 and DPCM6 are 10 bit to 8 and 10 bit
to 6 bit compression formats respectively
which sensor outputs and it is decompressed
to 10 bit in CSID

Change-Id: I8ec4de7d9cfa5e9c86d97bd9cb81feddc97dc7b8
Signed-off-by: Vijay kumar Tumati <vtumati@codeaurora.org>
Signed-off-by: Sureshnaidu Laveti <lsuresh@codeaurora.org>
2016-06-01 15:25:18 -07:00
Abhijeet Dharmapurikar
0849a61bdf platform: qpnp-revid: add definitions for pmicobalt versions
Some workarounds need to be applied only for v1.0 and v1.1 of
pmicobalt. For drivers to check and compare the versions, add
definitions for pmicobalt versions.

CRs-Fixed: 1018090
Change-Id: I3c6c0b470c7d15802c7cf4cb8ced85548dbb81c7
Signed-off-by: Abhijeet Dharmapurikar <adharmap@codeaurora.org>
2016-06-01 15:24:57 -07:00
Deepak Katragadda
6b6fc205b0 clk: msm: clock: Support graphics clocks on MSMCOBALT v2
Add support for controlling the graphics clocks on
MSMCOBALT v2.

CRs-Fixed: 1015446
Change-Id: Ia94606113b112a5e363e342a0ad1d977a48b3d72
Signed-off-by: Deepak Katragadda <dkatraga@codeaurora.org>
2016-06-01 15:24:46 -07:00
Deepak Katragadda
ddeec52110 ARM: dts: msm: Add MSMCOBALT v2 specific gfx_stub regulator changes
Use the gfx_stub_vreg regulator node for sourcing the graphics
clocks and GDSC on the pre-silicon platforms. Note that CPR
changes are still required for the graphics rail on the actual
target.

CRs-Fixed: 1015446
Change-Id: Ib92b11c23785e737f91ad09bcbb3d0b849d3a2bf
Signed-off-by: Deepak Katragadda <dkatraga@codeaurora.org>
2016-06-01 15:24:31 -07:00
Deepak Katragadda
d7a39b708a ARM: dts: msm: Enable the MMSS clock driver on MSMCOBALT v2
Enable the linux clock driver support for multimedia
clocks on MSMCOBALT v2.

CRs-Fixed: 1015446
Change-Id: Ice373ce1656f1ab045eefd57dcd700a4c20deedf
Signed-off-by: Deepak Katragadda <dkatraga@codeaurora.org>
2016-06-01 15:24:17 -07:00
Deepak Katragadda
ef382ea0ea clk: msm: clock: Support multimedia clocks on MSMCOBALT v2
Add support for controlling the multimedia clocks on
MSMCOBALT v2.

CRs-Fixed: 1015446
Change-Id: I636001ea91e7be1e2adec2ea7cd3d9aadfcc39a2
Signed-off-by: Deepak Katragadda <dkatraga@codeaurora.org>
2016-06-01 15:24:04 -07:00
Mayank Rana
30c04a7b2b Revert "usb: gadget: gsi: Decrement USB gadget pm usage count on cable disconnect"
'commit 3a7ce1db5661 ("usb: gadget: gsi: Decrement USB gadget pm usage
count on cable disconnect")' added decrementing USB gadget device's pm
usage count from STATE_INITIALIZED which results into multiple time
decrementing USB gadget device's pm usage count on USB cable disconnect
as below:

1. On USB cable disconnect, USB bus suspend event is being received which
post EVT_DISCONNECTED. If state is STATE_CONNECTED, ipa_work_handles()
decrements USB gadget device's pm usage count, and move state to
STATE_INITIALIZED.

2. Due to USB cable disconnect, gsi_disable() posts EVT_DISCONNECTED.
This event is processed into STATE_CONNECTED causing additional decrement
of USB gadget device's pm usage count.

Due to above case, USB goes into low power mode with dwc3's pm usage
count negative. On connecting USB host mode cable, xhci resume is failing
due to dwc3's (parent of xhci) is having negative usage count which results
into no USB host mode functionality (pm_runtime_get_sync() returns -EBUSY).
Hence revert commit to allow USB Host mode functionality.

CRs-Fixed: 1020388
Change-Id: I853aba1d2d03945ee49adde7f0ea483cd406ce2b
Signed-off-by: Mayank Rana <mrana@codeaurora.org>
2016-06-01 15:23:52 -07:00
Stephen Boyd
b06bf2fc36 clk: qcom: Add MSM8996 Global Clock Control (GCC) driver
Add support for the global clock controller found on MSM8996
based devices. This should allow most non-multimedia device
drivers to probe and control their clocks.

Change-Id: I559f5976b56bf8933df2c68fc4e29b2bd0ce1160
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
Signed-off-by: Taniya Das <tdas@codeaurora.org>
2016-06-01 15:21:57 -07:00
Prashanth Bhatta
e8d675996c icnss: Add IPC logging
Add IPC logging mechanism so that all the driver logs can be
retrieved on the need basis.
Also use pr_fmt to format the logs so that icnss driver logs are
consistent.

Change-Id: I977b04964ac28c18f4ad85094746aa864f03d0c3
Signed-off-by: Prashanth Bhatta <bhattap@codeaurora.org>
2016-06-01 15:21:42 -07:00
Joonwoo Park
d009f9c149 sched: eliminate sched_enable_power_aware knob and parameter
Kill unused scheduler knob and parameter sched_enable_power_aware.  HMP
scheduler always take into account power cost for placing task.

Change-Id: Ib26a21df9b903baac26c026862b0a41b4a8834f3
Signed-off-by: Joonwoo Park <joonwoop@codeaurora.org>
2016-06-01 15:21:29 -07:00
Joonwoo Park
462213d1ac sched: eliminate sched_freq_account_wait_time knob
Kill unused scheduler knob sched_freq_account_wait_time.

Change-Id: Ib74123ebd69dfa3f86cf7335099f50c12a6e93c3
Signed-off-by: Joonwoo Park <joonwoop@codeaurora.org>
2016-06-01 15:21:18 -07:00
Joonwoo Park
5160d93b6d sched: eliminate sched_account_wait_time knob
Kill unused scheduler knob sched_account_wait_time.  With this change
scheduler always accounts task's wait time into demand.

Change-Id: Ifa4bcb5685798f48fd020f3d0c9853220b3f5fdc
Signed-off-by: Joonwoo Park <joonwoop@codeaurora.org>
2016-06-01 15:21:04 -07:00
Laura Abbott
a2ac6d40d3 fs/buffer.c: Revoke LRU when trying to drop buffers
When a buffer is added to the LRU list, a reference is taken which is
not dropped until the buffer is evicted from the LRU list. This is the
correct behavior, however this LRU reference will prevent the buffer
from being dropped. This means that the buffer can't actually be dropped
until it is selected for eviction. There's no bound on the time spent
on the LRU list, which means that the buffer may be undroppable for
very long periods of time. Given that migration involves dropping
buffers, the associated page is now unmigratible for long periods of
time as well. CMA relies on being able to migrate a specific range
of pages, so these these types of failures make CMA significantly
less reliable, especially under high filesystem usage.

Rather than waiting for the LRU algorithm to eventually kick out
the buffer, explicitly remove the buffer from the LRU list when trying
to drop it. There is still the possibility that the buffer
could be added back on the list, but that indicates the buffer is
still in use and would probably have other 'in use' indicates to
prevent dropping.

Change-Id: I253f4ee2069e190c1115afc421dadd27a7fa87dc
Signed-off-by: Laura Abbott <lauraa@codeaurora.org>
Signed-off-by: Vinayak Menon <vinmenon@codeaurora.org>
2016-06-01 15:20:51 -07:00
Sahitya Tummala
2c1f2ce7a8 mmc: sdhci-msm: fix few compilation issues
This change fixes few compilations issues seen
if we enable the SDHCi MSM driver.

Change-Id: Iaa556e189cbbc6a7f9c3d485e94a43cb21a968a7
Signed-off-by: Sahitya Tummala <stummala@codeaurora.org>
Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org>
2016-05-31 15:28:20 -07:00
Sahitya Tummala
3b5d76efd7 mmc: cmdq_hci: fix compilation issue
This change fixes the compilation issue when CMDQ feature
is enabled.

Change-Id: I1c792f7b32d79267f5c39f8bdbd2bd6884fb0dde
Signed-off-by: Sahitya Tummala <stummala@codeaurora.org>
Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org>
2016-05-31 15:28:20 -07:00
Sathish Ambley
7099c2a6d2 msm: ADSPRPC: Validate the SMMU session count
Make sure that the session count does not exceed the maximum
sessions to avoid buffer overflow.

Change-Id: I1a9830a6f859d7d525247d27d0a143997998d997
Acked-by: Bharath Kumar <bkumar@qti.qualcomm.com>
Signed-off-by: Sathish Ambley <sathishambley@codeaurora.org>
2016-05-31 15:28:19 -07:00
Sahitya Tummala
7043a9fe7b mmc: host: fix compilation issue when clk_gating config is disabled
This change fixes the compilation issue seen when CONFIG_MMC_CLKGATE
isn't enabled.

Change-Id: Ia2765c302bd16be5ee87c42629ff8f36b41242ca
Signed-off-by: Sahitya Tummala <stummala@codeaurora.org>
Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org>
2016-05-31 15:28:19 -07:00
Subhash Jadavani
95dee386c5 mmc: sdhci: clean up legacy adma related variables
msm-3.18 kernel had our own implementation of 64-bit ADMA support but
upstream kernel have now added its own implementation of 64-bit ADMA
support hence this patch removes some of the remaining variables from
our implementation.

Change-Id: I3ea8e9e498b25b75fb1f5ccc4ffe5f6986cd564a
Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org>
2016-05-31 15:28:19 -07:00
Subhash Jadavani
330d3d586e mmc: sdhci: enable 64-bit DMA support only if chipset supports 64-bit
This patch adds check to enable the 64-bit DMA only if the chipset
supports the same.

Change-Id: I5dbe6f91d5e530b289f4cf395ae7b673acd85fcf
Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org>
2016-05-31 15:28:18 -07:00
Subhash Jadavani
a037c5f8a5 mmc: sdhci: Replace SDHCI_USE_ADMA_64BIT flag
SDHCI_USE_ADMA_64BIT flag was being used by msm-3.18 kernel but now that
upstream sdhci driver has introduced support for 64-bit ADMA, it defined
new flag SDHCI_USE_64_BIT_DMA. Hence replace all the SDHCI_USE_ADMA_64BIT
references with SDHCI_USE_64_BIT_DMA flag.

Change-Id: I6a1e426c156d4ddb92bba00b5ec0cfb156d9550b
Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org>
2016-05-31 15:28:18 -07:00
Subhash Jadavani
e8032e07d1 mmc: auto bkops fixes
Change "man_bkops_en" to "bkops_en" to hold the status of
both manual and auto bkops.

Change-Id: I60029bae67cebb2c91147ad741b96f4caed9c1d9
Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org>
2016-05-31 15:28:17 -07:00
Subhash Jadavani
79d2f1626b mmc: card: fix quirk bit map
There seems to be bit map usage overlap between few MMC_QUIRKS_*,
this change fixes it.

Change-Id: I717a2de1261ed2de1a8c730b005b137f0687d969
Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org>
2016-05-31 15:28:17 -07:00
Subhash Jadavani
b58dd25cc3 Revert "mmc: core: get drive types supported by eMMC cards"
This reverts commit 82ccc79fd3c4456b7b344db4576e874d324c6243.
Similar change is already present and this one just added the
duplicate code hence revert it.

Change-Id: Ia96ebe80e4fb7987f9e98e42575ff2ebe153dd23
Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org>
2016-05-31 15:28:16 -07:00
Subhash Jadavani
8cd010a89a mmc: host: sdhci: don't queue zero length descriptor
If zero length ADMA descriptor with "Tran" attribute is queued to ADMA
descriptor table then host controller ADMA engine might get stuck.
Currently we are seeing zero length descriptor getting queued in for
SDIO transactions:

SDHCi driver requires that any data buffer address should be 4-byte
aligned for 32-bit ADMA and 8-bytes aligned for 64-bit ADMA. For 64-bit
ADMA, it forces 8-byte alignment for any data buffer addresses. This
aligment requirement is not an issue with eMMC/SD cards as their
transactions are always in multiple of 512-bytes (block size) and hence
sdhci driver would always get the data buffers whose address is properly
aligned.

SDIO can have transactions less than 512-bytes. Hence its quite possible
for driver to receives data buffer addresses which are not properly
aligned. And if they are not aligned, SDHCi driver bounces the non-aligned
bytes to pre-allocated aligned buffer until the rest of the data buffer
becomes aligned. But this logic has a bug where after moving the
non-aligned number of bytes to aligned buffer, it assumes that we will
always be left with non-zero number of bytes in original data buffer and
hence driver ends up queuing one more descriptor which can be of zero
length.

Fix this by checking for the remaining data length before queuing up the
next descriptor.

Change-Id: I7af77b2a2661c00f2b1da47953717b1506bdba83
Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org>
[subhashj@codeaurora.org: fixed merge conflicts]
Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org>
2016-05-31 15:28:16 -07:00
Asutosh Das
d69edcbcae mmc: core: fix deadlock between runtime-suspend and devfreq
There's a deadlock between runtime-suspend and devfreq monitor.

runtime-suspend context:
    [<ffffffc00008771c>] __switch_to+0x7c
    [<ffffffc000e0212c>] __schedule+0x53c
    [<ffffffc000e02404>] schedule+0x74
    [<ffffffc000e02770>] schedule_preempt_disabled+0x14
    [<ffffffc000e04c8c>] __mutex_lock_slowpath+0x1dc
    [<ffffffc000e04e54>] mutex_lock+0x2c
    [<ffffffc000acfc98>] devfreq_monitor_suspend+0x1c
    [<ffffffc000ad160c>] devfreq_simple_ondemand_handler+0x4c
    [<ffffffc000acf8b4>] devfreq_suspend_device+0x2c
    [<ffffffc0008fa5a0>] mmc_suspend_clk_scaling+0xac
    [<ffffffc000900398>] _mmc_suspend.isra.11+0x38
    [<ffffffc000900798>] mmc_runtime_suspend+0x1cc
    [<ffffffc0008fd4c4>] mmc_runtime_suspend+0x18
    [<ffffffc000579c98>] __rpm_callback+0x40
    [<ffffffc000579d0c>] rpm_callback+0x40
    [<ffffffc00057a338>] rpm_suspend+0x25c

In the above stack, runtime-suspend is waiting on the devfreq mutex.
In the below stack, the mutex has been acquired and since the device
power state is DEV_SUSPENDING, devfreq is waiting for the device to
resume, thus causing a deadlock.

    [<ffffffc000e02404>] schedule+0x74
    [<ffffffc00057abdc>] rpm_resume+0x264
    [<ffffffc00057ae80>] __pm_runtime_resume+0x70
    [<ffffffc0008f880c>] mmc_get_card+0x1c
    [<ffffffc0008f9d08>] mmc_devfreq_set_target+0x154
    [<ffffffc000acf9d0>] update_devfreq+0xd0
    [<ffffffc000acfb38>] devfreq_monitor+0x2c

Fix this by not waiting for device to resume in devfreq. The suspend would
ensure that this devfreq monitor thread is suspended before suspending the
device.

Change-Id: Ic0e89becbfded35c90c4061f0fe03d61125f66d5
Signed-off-by: Asutosh Das <asutoshd@codeaurora.org>
2016-05-31 15:28:15 -07:00
Ritesh Harjani
e4db7c6cf6 mmc: block: Add quirk and increase read data timeout for hynix emmc
Hynix emmc cards are causing read data timeout.
Increase timeout value to max of 4sec and add card
quirk for all Hynix emmc cards.

Change-Id: I78637dc787964ec5cafe297587d6a12ecf1d31c6
Signed-off-by: Ritesh Harjani <riteshh@codeaurora.org>
2016-05-31 15:28:15 -07:00
Sahitya Tummala
a1202f10d9 mmc: card: Fix broken clock gating
The commit '77dacd' misses to add mmc_host_clk_release() in the
completion path of a CQ request i.e., in mmc_blk_cmdq_complete_rq().
Hence, the reference counter of clocks (host->clk_requests) never
becomes 0, preventing the clocks from gating. However, the clocks
are still turned off through other power management features such as
runtime/system suspend.

Change-Id: I0032861b1e5218bdf3c5bed664869c708ce50148
Signed-off-by: Sahitya Tummala <stummala@codeaurora.org>
2016-05-31 15:28:14 -07:00
Konstantin Dorfman
5c8d743546 mmc: core: postpone runtime suspend in case BKOPS is required
Some devices require long BKOPs time in order to provide high performance.
In the current solution, the host disables auto BKOPs or stops manual BKOPs
in runtime suspend, regardless of the device need for BKOPs.
This patch adds a check for device BKOPs status and defers suspend in case
when BKOPs need.

CRs-Fixed: 979630
Change-Id: Ib38d1ce58e4195d4969e9a367b5738c8e598d0ba
Signed-off-by: Konstantin Dorfman <kdorfman@codeaurora.org>
[subhashj@codeaurora.org: fixed merge conflicts]
Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org>
2016-05-31 15:28:14 -07:00
Konstantin Dorfman
127468f482 mmc: core: update AUTO_EN in BKOPS_EN field on runtime resume
On runtime suspend flow, AUTO_EN must be turned off (see eMMC 5.1
specification 6.6.28). During runtime resume, it should be restored again.
When partial card initialization flow is used on runtime resume (instead of
full card initialization), this flow should restore AUTO_EN bit if needed.

CRs-Fixed: 979630
Change-Id: I4ac3b7c45fdba36d014f4c88cb704bbf36011d59
Signed-off-by: Konstantin Dorfman <kdorfman@codeaurora.org>
2016-05-31 15:28:13 -07:00
Konstantin Dorfman
f4c7f1c573 mmc: revert runtime idle state
Remove the runtime idle state. It was introduced by
217cf95511d23f703d0e7e597d3132739739654b
Instead of checking BKOPS logic in the runtime idle state, all relevant
logic should be performed in runtime suspend callback.

CRs-Fixed: 979630
Change-Id: Iaf0d8326c0e3fd6507b075339f2cc87ae1bdf6b2
Signed-off-by: Konstantin Dorfman <kdorfman@codeaurora.org>
[subhashj@codeaurora.org: fixed trivial merge conflicts]
Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org>
2016-05-31 15:28:13 -07:00
Venkat Gopalakrishnan
47bbd75b7b mmc: host: Set max frequency when disabling clock scaling
The mmc host needs to perform at its peak when clock scaling
is disabled, hence switch the frequency to max.

CRs-fixed: 981387
Change-Id: Ie959b8e565ee2dad53cdd9d913bcb8696519d7ca
Signed-off-by: Venkat Gopalakrishnan <venkatg@codeaurora.org>
2016-05-31 15:28:12 -07:00
Ritesh Harjani
284f065551 mmc: queue: Fix queue_lock spinlock bug from CMDQ shutdown path
CMDQ shutdown path calls blk_cleanup_queue, which changes queue_lock
from driver lock to it's original request_queue lock.
Hence during above shutdown process if below sequence is exercised
as well then may see below spinlock bug.

a) Some process say iozoneA has already acquired queue_lock (which
   is md->lock).
b) adb reboot has been issued and CMDQ driver has completed calling
   blk_cleanup_queue which switches the queue_lock from md->lock to
   q->__queue_lock.
c) ProcessA tries to release queue_lock but finds an unbalance that
   the lock is already released

Hence remove blk_cleanup_queue and instead make sure there are no
active_reqs in flight by mmccmdqd before this kthread is exited.

Callstack:
<6> BUG: spinlock already unlocked on CPU#6, iozone/4391
<6> lock: 0xffffffc06ab8be80, .magic: dead4ead,
.owner: <none>/-1, .owner_cpu: -1
[ffffffc0420e3b28] __delay at ffffffc00031a328
[ffffffc0420e3b38] __const_udelay at ffffffc00031a304
[ffffffc0420e3b58] msm_trigger_wdog_bite at ffffffc0004476cc
[ffffffc0420e3b68] spin_bug at ffffffc0000e4554
[ffffffc0420e3b98] do_raw_spin_unlock at ffffffc0000e47a0
[ffffffc0420e3bc8] _raw_spin_unlock_irq at ffffffc000db3ee0
[ffffffc0420e3be8] blk_queue_bio at ffffffc0002ff1e4
[ffffffc0420e3bf8] generic_make_request at ffffffc0002fd210
[ffffffc0420e3c58] submit_bio at ffffffc0002fd328
[ffffffc0420e3ca8] submit_bio_wait at ffffffc0002f5768
[ffffffc0420e3d00] compat_sys_call_table at ffffffc00008e000
[ffffffc0420e3d18] submit_bio_wait at ffffffc0002f574c
[ffffffc0420e3d38] __blkdev_issue_flush at ffffffc00030043c
[ffffffc0420e3da8] blkdev_issue_flush at ffffffc000300494
[ffffffc0420e3dd8] ext4_sync_fs at ffffffc0002597a4

CRs-fixed: 953541
Change-Id: I769cc25c14b6d873f64a898d6b73f33cc59d9c5d
Signed-off-by: Ritesh Harjani <riteshh@codeaurora.org>
2016-05-31 15:28:12 -07:00
Sahitya Tummala
cc6df31db6 mmc: core: fix issue with devfreq clock scaling
Due to recent DDR52 lower bus speed mode in clock scaling,
there is a mismatch between the clock frequencies used by
the devfreq framework and the MMC driver. Due to this, SDCC
clock is sometimes running at DDR25 and ICE clock is running
at 100MHz causing the power regression. Fix this mismatch by
initializing the frequencies properly during MMC resume based
on the current ios.clock.

CRs-Fixed: 974940
Change-Id: I09fe888d0fbd1fde3f6a6f32806315ddbb5bf6e1
Signed-off-by: Sahitya Tummala <stummala@codeaurora.org>
2016-05-31 15:28:11 -07:00
xiaonian
d6a8e003e0 mmc: core: set REL_WR_SEC_C register to 0x1 per eMMC5.0 spec
Some eMMC vendors violate eMMC 5.0 spec and set REL_WR_SEC_C
register to 0x10 to indicate the ability of RPMB throughput
improvement thus lead to failure when TZ module write data to
RPMB partition. This change will check bit[4] of EXT_CSD[166]
and if it is not set then change value of REL_WR_SEC_C to 0x1
directly ignoring value of EXT_CSD[222].

CRs-Fixed: 866059
Change-Id: Ibd12c94ad691eca1fa3ea2049b750a6e98178678
Signed-off-by: xiaonian <xiaonian@codeaurora.org>
Signed-off-by: Pavan Anamula <pavana@codeaurora.org>
2016-05-31 15:28:11 -07:00
Sahitya Tummala
34167033d4 mmc: card: set dma_mask as the queue bounce limit
Some controllers doesn't have any limitation on the memory
it can address. Hence, the bounce limit parameter must be taken
based on the device dma_mask.

Currently it is set to BLK_BOUNCE_HIGH, which may cause bouncing
of memory higher than this limit. Use dma_mask as the limit for
queue bounce parameter to avoid this unncessary memory bouncing
in the block layer.

CRs-Fixed: 964435
Change-Id: I0955438a540ca9adf5bcd3a0dbf9201a5ef456a5
Signed-off-by: Sahitya Tummala <stummala@codeaurora.org>
2016-05-31 15:28:10 -07:00
Sahitya Tummala
bb0fb32d8a mmc: sdhci-msm: Fix recursive tuning issue
For any commands, that are sent during tuning sequence
CRC errors are expected. But if SDHCI_NEEDS_RETUNING flag
is set, then it will recursively do the tuning and gets
stuck in tuning. Fix this by not allowing the re-tuning to
happen while it is already in tuning process.

Change-Id: I9cc39f03a01c34f2f5639d4c20776fd575c25231
Signed-off-by: Sahitya Tummala <stummala@codeaurora.org>
2016-05-31 15:28:10 -07:00
Venkat Gopalakrishnan
861ecf399b mmc: queue: Don't peek requests when queue is stopped
Make sure we don't peek the block layer queue and act on it when
block queue is stopped. The block queue will be stopped when mmc
block is suspended, wait till it is properly resumed before pulling
new requests.

Change-Id: Ifc369687c13dae904271e8f92d3604edbd667d82
Signed-off-by: Venkat Gopalakrishnan <venkatg@codeaurora.org>
2016-05-31 15:28:09 -07:00
Sahitya Tummala
e78c713435 mmc: sdhci-msm: Set sdio_pending_processing default state to false
It seems that when we are configuring sdiowakeup_irq, we are
receiving a spurious interrupt which sets sdio_pending_processing
state to true.
Now, if the sdio card is physically connected but wifi not enabled
in that case suspend functionality will be broken sdhci_msm_suspend_noirq
will return -EBUSY if sdio_pending_processing is set to true.

Thus fix it by setting this flag to false after we have disabled
sdiowakeup_irq.

CRs-Fixed: 957968
Change-Id: I755b0b5602345ad6bf557c6055b9057012de0797
Signed-off-by: Ritesh Harjani <riteshh@codeaurora.org>
Signed-off-by: Sahitya Tummala <stummala@codeaurora.org>
2016-05-31 15:28:09 -07:00
Lior David
857cb953f0 wil6210: allow empty WMI commands in debugfs wmi_send
There are many valid WMI commands with only header without any
additional payload. Such WMI commands could not be sent using
the debugfs wmi_send facility. Fix the code to allow sending
of such commands.

Change-Id: I581e099db5d2ee81be4345101aa54352b1d9564f
Signed-off-by: Lior David <qca_liord@qca.qualcomm.com>
Signed-off-by: Maya Erez <qca_merez@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
Git-commit: 69218a48005d0c93b8e9ec483f42ead481a43034
Git-repo: git://git.kernel.org/pub/scm/linux/kernel/git/kvalo/ath.git
CRs-Fixed: 1015627
Signed-off-by: Maya Erez <merez@codeaurora.org>
2016-05-31 15:28:08 -07:00