Commit graph

571045 commits

Author SHA1 Message Date
Konstantin Dorfman
22543d78b8 mmc: cmdq: add platform device reference counting for runtime pm
Access to the registers of CQE HCI wrapped by increment/decrement of pm
core usage counter for the platform device.

Change-Id: I9da4aa7d28dbf8e1d2bf62f6d5fa0875bd5b6064
Signed-off-by: Konstantin Dorfman <kdorfman@codeaurora.org>
2016-05-31 15:26:42 -07:00
Konstantin Dorfman
108d3eb6e6 mmc: cmdq-host: add post halt helper after halt ack interrupt
After the CQE halt on some controllers need additional actions, before
wakeup of waiting thread.

Change-Id: I742baa48eb3f6eccf782d77a03aafe16ab7188f1
Signed-off-by: Konstantin Dorfman <kdorfman@codeaurora.org>
2016-05-31 15:26:41 -07:00
Konstantin Dorfman
6739d00347 mmc: cmdq: configure task descriptor list base register on enable
When enabling cmdq mode for the first time, need to allocate descriptors
table. After controller reset and enabling cmdq next time, still need to
update CQTDLBA and CQTDLBAU registers with already allocated descriptors
table (desc_dma_base).

Change-Id: Ide89eebbce5a193cd44a1ea4ec65403f98e2a7ab
Signed-off-by: Konstantin Dorfman <kdorfman@codeaurora.org>
2016-05-31 15:26:41 -07:00
Sahitya Tummala
83ed2ae95e mmc: block: Add cache barrier support
eMMC cache barrier provides a way to perform delayed
and in-order flushing of cached data. Host can use this
to avoid flushing delays but still maintain the order
between the data requests in cache.

In case the device gets more barrier requests than it
supports, then a barrier request is treated as a normal flush
request in the device.

If the eMMC cache flushing policy is set to 1, then the device
inherently flushes all the cached requests in FIFO order. For such
devices, as per spec, it is redundant to send any barrier requests
to the device. This may add unnecessary overhead to both host and
the device. So make sure to not send barrier requests in such cases.

Change-Id: Ia7af316800a6895942d3cabcd64600d56fab25a6
Signed-off-by: Sahitya Tummala <stummala@codeaurora.org>
[subhashj@codeaurora.org: fixed trivial merge conflicts]
Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org>
2016-05-31 15:26:40 -07:00
Ritesh Harjani
c3475c8734 mmc: Enable clock gating for cmdq
Enable clock gating for cmdq by adding respective
API to clk hold/release. CMDQ also uses the same
legacy clock gating API.

Change-Id: I3d4f28cedb24ff2292ab08bdd7470358cf134dd5
Signed-off-by: Ritesh Harjani <riteshh@codeaurora.org>
2016-05-31 15:26:40 -07:00
Venkat Gopalakrishnan
047440f975 mmc: host: Reorder MMC_SDHCI_MSM_ICE config
MMC_SDHCI_MSM_ICE is enabled only if MMC_SDHCI_MSM config
is enabled. Reorder this so that it shows up appropriately
in the kernel config menu.

Change-Id: Ic6af2979e7c8c56841d509f3f25fadd4dd2fe9d2
Signed-off-by: Venkat Gopalakrishnan <venkatg@codeaurora.org>
[subhashj@codeaurora.org: fixed trivial merge conflicts]
Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org>
2016-05-31 15:26:39 -07:00
Venkat Gopalakrishnan
51468e6b17 mmc: sdhci-msm: Free pltfm_host on probe defer
The platform host has been initialized and should be freed
in case we defer the probe.

Change-Id: Iadce572fa4618b18f2fadf9e00812e75144af1c9
Signed-off-by: Venkat Gopalakrishnan <venkatg@codeaurora.org>
2016-05-31 15:26:39 -07:00
Sahitya Tummala
b8fc176b81 mmc: block: support RPMB with CMDQ framework
CMDQ is not supported for RPMB partition. Hence, for RPMB requests
the controller is kept in HALT state and then CMDQ is disabled in
the card.

Change-Id: I1242841d5fa063b542e35dcff95694ef5e88737a
Signed-off-by: Sahitya Tummala <stummala@codeaurora.org>
2016-05-31 15:26:38 -07:00
Sahitya Tummala
10fc703640 mmc: block: add discard and secdiscard support for CMDQ mode
Discard is supported in CMDQ mode only when device queue is empty.
Hence, discard commands should be sent using DCMD slot with
QBR (Queue Barrier) flag set.

Change-Id: I630091cbd94ffcdcec71626257f912c15fd2e21e
Signed-off-by: Sahitya Tummala <stummala@codeaurora.org>
[subhashj@codeaurora.org: fixed trivial merge conflicts]
Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org>
2016-05-31 15:26:38 -07:00
Vinayak Menon
af6c02b830 lowmemorykiller: add zcache awareness
zcache stores compressed file pages which should be
considered as reclaimable pages by lowmemorykiller
in calculating values to be compared against minfree.

Change-Id: Ia3e08bc14ba61c0a45ed54ba5cd525717a572060
Signed-off-by: Vinayak Menon <vinmenon@codeaurora.org>
2016-05-31 15:26:37 -07:00
Sahitya Tummala
6b78c6e6d1 mmc: cmdq_hci: Add DCMD response to mrq
This will be needed by core layers to check the status for
CMD13 that is sent in CMDQ mode.

Change-Id: If3d062bad4cf87c2543e6d5345f9ab6a0afa23bf
Signed-off-by: Sahitya Tummala <stummala@codeaurora.org>
2016-05-31 15:26:37 -07:00
Talel Shenhar
0d897b8fc4 mmc: sdhci-msm: enable clock scaling capability
This change enables clock scaling capability for sdhci-msm
platform driver.

Change-Id: I9582bbb4b37594d4d59a7398a00656846516d675
Signed-off-by: Talel Shenhar <tatias@codeaurora.org>
2016-05-31 15:26:37 -07:00
Talel Shenhar
cdb1137c3b mmc: sd: add support for UHS card to get max frequency
This change adds UHS cards to mmc_sd_get_max_clock() API.
Cards that support UHS can set timing of SDR104 which
supports frequency up to 208Mhz.

Change-Id: I25bcb35aa2cecd98f6f04cd98a616a76c75b6784
Signed-off-by: Talel Shenhar <tatias@codeaurora.org>
2016-05-31 15:26:36 -07:00
Sahitya Tummala
9f3305d698 mmc: cmdq_hci: Add Inline Crypto Engine (ICE) support
Add changes to configure ICE for data encryption/decryption
using CMDQ.

Change-Id: I9a10d18d617102916526e994e9f9d22d2aa5446b
Signed-off-by: Sahitya Tummala <stummala@codeaurora.org>
2016-05-31 15:26:36 -07:00
Sahitya Tummala
1c6a2272ff mmc: cmdq_hci: Fix timing and response type for busy commands
The response type and command timing for busy commands are
set incorrectly due to wrong cmd->flags check. Correct this
to check for MMC_RSP_BUSY flag.

Change-Id: I4498c302914a81bf19f61d20b30bd4426e21d3d0
Signed-off-by: Sahitya Tummala <stummala@codeaurora.org>
2016-05-31 15:26:35 -07:00
Asutosh Das
b099847e11 mmc: host: Fix spinbug in performance sysfs nodes
In CMDQ, the mmc_release_host runs in softirq context.
There's a potential race condition between show/set_perf
since it doesn't disable pre-emption. Change this to
disable preemption.

Change-Id: I20918a459e8b35ac666971b8ebf179f44aa9c40f
Signed-off-by: Asutosh Das <asutoshd@codeaurora.org>
Signed-off-by: Venkat Gopalakrishnan <venkatg@codeaurora.org>
2016-05-31 15:26:35 -07:00
Asutosh Das
4d105602c4 mmc: queue: issue requests when dcmd is in progress
Requests can still be issued when dcmd is in progress.
Only when discard is in progress, should the requests not
be issued.

Change-Id: Ief70cf2f86e9eb3817f8a390626be8433180ed87
Signed-off-by: Asutosh Das <asutoshd@codeaurora.org>
Signed-off-by: Venkat Gopalakrishnan <venkatg@codeaurora.org>
2016-05-31 15:26:34 -07:00
Asutosh Das
5bec5e8420 mmc: core: fix shutdown in cmdq mode
During the shutdown process,
	- Stop the queue
	- Flush all the pending requests
	- Halt the Controller
	- Put the card in legacy mode

Change-Id: I5fe4e998bc04bfd8f50de63f3beae3cb25f1c8ba
Signed-off-by: Asutosh Das <asutoshd@codeaurora.org>
Signed-off-by: Venkat Gopalakrishnan <venkatg@codeaurora.org>
2016-05-31 15:26:34 -07:00
Venkat Gopalakrishnan
d10ca4a6ad mmc: sdhci-msm: increase number of testbuses to 60
Dump out testbus values till 60. This would facilitate
triaging command-queue issues.

Change-Id: Icac865629b21ce0207c46c1907cf25401d6e8339
Signed-off-by: Venkat Gopalakrishnan <venkatg@codeaurora.org>
Signed-off-by: Asutosh Das <asutoshd@codeaurora.org>
2016-05-31 15:26:33 -07:00
Asutosh Das
eb2587ce53 mmc: queue: add timeout capability to requests
Individual requests can have timeouts defined. The default
timeout is set to 120 seconds. On a timeout, the block layer
notifies the driver and error can be handled thereafter.

Change-Id: Ifcd690411770ab266c12a01bb0993f92b0f18bc6
Signed-off-by: Asutosh Das <asutoshd@codeaurora.org>
Signed-off-by: Venkat Gopalakrishnan <venkatg@codeaurora.org>
2016-05-31 15:26:33 -07:00
Asutosh Das
f446730be1 mmc: sdhci: propagate error to command queue engine
eMMC controller detects error, generates error interrupt and
notifies the CQE. Hence, parse the correct error and propagate
it to CQE handler for further processing.

Command queue interrupt handler may return IRQ_NONE
or IRQ_HANDLED. Check for the return value and either
proceed or return from handler.

Change-Id: I29c7b22848d3d728a79ba215f8d2f594d19fba63
Signed-off-by: Asutosh Das <asutoshd@codeaurora.org>
Signed-off-by: Venkat Gopalakrishnan <venkatg@codeaurora.org>
2016-05-31 15:26:32 -07:00
Asutosh Das
444223d884 mmc: block: Add error handling to command queue host
On error, the CMDQ engine stops processing requests. It is then
halted and error handled.
The error have been categorized as below:
1. Command error
	a. time-out
		- invalidate all pending tags & requeue
		- reset both card & controller
	b. crc
		- end the error mrq
		- tune
		- unhalt
2. Data error
	a. time-out
		- invalidate all pending tags & requeue
		- reset both card and controller
	b. crc
		- end the error mrq
		- tune
		- unhalt
3. RED error
	This is device specific error and is not recoverable.
	The card and controller are reset in this case and all
	pending tags are invalidated and requeued.

Change-Id: I791d05f6b31d8f9b35a56fe85007b320c14e8b46
Signed-off-by: Asutosh Das <asutoshd@codeaurora.org>
Signed-off-by: Venkat Gopalakrishnan <venkatg@codeaurora.org>
[subhashj@codeaurora.org: fixed trivial merge conflicts]
Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org>
2016-05-31 15:26:32 -07:00
Asutosh Das
99b730eb03 mmc: block: add support for partition switch
There could be a switch of partition while RPMB access.
RPMB thread would then hand-off the control to mmc-cmdq-thread
in the following state:
	- partition set to RPMB in card
	- CMDQ mode disabled in card
	- Controller in halt state

When the next request is received, the following has to be done
	- switch partition to the current partition
	- enable CMDQ in card
	- unhalt controller

Change-Id: I9eca350572fd88476dfee9642696a223c5cd7ada
Signed-off-by: Asutosh Das <asutoshd@codeaurora.org>
Signed-off-by: Venkat Gopalakrishnan <venkatg@codeaurora.org>
[subhashj@codeaurora.org: fixed compilation error]
Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org>
2016-05-31 15:26:31 -07:00
Venkat Gopalakrishnan
6761d88e7c mmc: sdhci-msm: do not disable test-bus
There is a hardware ring-buffer that logs the commands
sent and doorbells rung. This is helpful for debugging
in case of errors. This requires that the testbus be
enabled. Hence don't disable testbus.

Change-Id: I9c2fa984740aa9a0f8135d2196be6b3639ec22d1
Signed-off-by: Asutosh Das <asutoshd@codeaurora.org>
Signed-off-by: Venkat Gopalakrishnan <venkatg@codeaurora.org>
2016-05-31 15:26:31 -07:00
Venkat Gopalakrishnan
11bb322287 mmc: sdhci-msm: add support for command-queue
Adds support for command-queue (CQ).
MSM driver supports CQ in the hardware. The controller
can send commands to the card and read statuses from the
device. This patch adds support for the same.

Change-Id: I1b19a2ce4c124c96dc6c3852d8f58ad076851f4b
Signed-off-by: Asutosh Das <asutoshd@codeaurora.org>
Signed-off-by: Konstantin Dorfman <kdorfman@codeaurora.org>
Signed-off-by: Venkat Gopalakrishnan <venkatg@codeaurora.org>
2016-05-31 15:26:30 -07:00
Asutosh Das
c4dd8dad71 mmc: sdhci: add command queue support to sdhci
Adds command-queue support to SDHCi compliant drivers.

Change-Id: I1efee7f1c86e102364083e9158e4d45c887dd06e
Signed-off-by: Asutosh Das <asutoshd@codeaurora.org>
Signed-off-by: Konstantin Dorfman <kdorfman@codeaurora.org>
Signed-off-by: Venkat Gopalakrishnan <venkatg@codeaurora.org>
[subhashj@codeaurora.org: fixed trivial merge conflicts and
compilation error]
Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org>
2016-05-31 15:26:30 -07:00
Asutosh Das
5434534be0 mmc: cmdq-host: add halt support to command queue host
Halt can be used in error cases to get control of the
bus. This is used to remove a task from device queue
and/or other recovery mechanisms.

Change-Id: I4ada286aefe57b90bfd20d60f8fbe2c013d9db71
Signed-off-by: Asutosh Das <asutoshd@codeaurora.org>
Signed-off-by: Venkat Gopalakrishnan <venkatg@codeaurora.org>
2016-05-31 15:26:29 -07:00
Asutosh Das
44a464b93c mmc: core: Add halt support
Halt is a controller feature that can change the controller mode
from command-queue to legacy. This feature is very helpful in
error cases.

Change-Id: I7f1465b609afed68886256bd605d4019716964f4
Signed-off-by: Asutosh Das <asutoshd@codeaurora.org>
Signed-off-by: Venkat Gopalakrishnan <venkatg@codeaurora.org>
2016-05-31 15:26:29 -07:00
Amir Samuelov
f8a4373fea spcom: fix modify ion addr
It is expected that the 64 bit ion buffer address,
will be located on the request/response buffer at an offset
that is 64 bit aligned.
However, the user may pack the request/response on his own risk,
and the offset might not be 64 bit aligned.

Change-Id: I85e7644aa05d8c5249e2d204a61d03b5fb2f9220
Signed-off-by: Amir Samuelov <amirs@codeaurora.org>
2016-05-31 15:26:28 -07:00
Venkat Gopalakrishnan
c811ac5993 mmc: cmdq: support for command queue enabled host
This patch adds CMDQ support for command-queue compatible
hosts.

Command queue is added in eMMC-5.1 specification. This
enables the controller to process upto 32 requests at
a time.

Change-Id: I0486495ef57c64bf8427e917daeb184c69b8dc73
Signed-off-by: Asutosh Das <asutoshd@codeaurora.org>
Signed-off-by: Sujit Reddy Thumma <sthumma@codeaurora.org>
Signed-off-by: Konstantin Dorfman <kdorfman@codeaurora.org>
Signed-off-by: Venkat Gopalakrishnan <venkatg@codeaurora.org>
[subhashj@codeaurora.org: fixed trivial merge conflicts]
Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org>
2016-05-31 15:26:28 -07:00
Asutosh Das
89ada7fc6d mmc: core: add flush request support to command queue
Adds flush request support to command-queue. This uses DCMD
feature of the controller for sending commands in
command-queue mode. DCMD is a direct command feature that uses
a pre-configured slot for sending commands other than Class 11.

Change-Id: Iebf6b74173dc91b0dc7230d1e87c65983d15148e
Signed-off-by: Asutosh Das <asutoshd@codeaurora.org>
Signed-off-by: Venkat Gopalakrishnan <venkatg@codeaurora.org>
[subhashj@codeaurora.org: fixed trivial merge conflicts]
Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org>
2016-05-31 15:26:28 -07:00
Venkat Gopalakrishnan
fc4b531dfd mmc: card: add read/write support in command queue mode
Command queueing is defined in eMMC-5.1. It is designed for
higher performance by ensuring upto 32 requests to be serviced
at a time.

Adds read/write support for CMDQ enabled devices.

Change-Id: I136ddea8e5ca57eb4f85ca6e72c60001a7e24f78
Signed-off-by: Sujit Reddy Thumma <sthumma@codeaurora.org>
Signed-off-by: Asutosh Das <asutoshd@codeaurora.org>
Signed-off-by: Konstantin Dorfman <kdorfman@codeaurora.org>
Signed-off-by: Venkat Gopalakrishnan <venkatg@codeaurora.org>
[subhashj@codeaurora.org: fixed trivial merge conflicts]
Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org>
2016-05-31 15:26:27 -07:00
Asutosh Das
ee66ddaa07 mmc: core: Add command queue initialzation support
Command Queueing (CQ) feature is introduced to eMMC
standard in revision 5.1. CQ includes new commands
for issuing tasks to the device, for ordering the
execution of previously issued tasks and for
additional task management functions.

This patch adds initialization and enabling of command
queue in the card and controller. If the card and the
controller support CQ, then it is enabled.

Change-Id: I92d893d1503396d4b00848813cc546fc263e77fd
Signed-off-by: Asutosh Das <asutoshd@codeaurora.org>
Signed-off-by: Venkat Gopalakrishnan <venkatg@codeaurora.org>
[subhashj@codeaurora.org: fixed trivial merge conflicts]
Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org>
2016-05-31 15:26:27 -07:00
Asutosh Das
6d1be7e42b mmc: queue: initialization of command queue
Command Queueing (CQ) feature is introduced to eMMC
standard in revision 5.1. CQ includes new commands
for issuing tasks to the device, for ordering the
execution of previously issued tasks and for
additional task management functions.

The idea is to keep the legacy and CQ code as discrete
as possible. Hence, a separate queue is created for CQ.
The issuing path is non-blocking since several requests
(max. 32) can be queued at a time.

Change-Id: I5b48d1b3ed17585b907ec70ff7c8d583003ec9e1
Signed-off-by: Asutosh Das <asutoshd@codeaurora.org>
Signed-off-by: Venkat Gopalakrishnan <venkatg@codeaurora.org>
[subhashj@codeaurora.org: fixed trivial merge conflicts & compilation
error]
Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org>
2016-05-31 15:26:26 -07:00
Sahitya Tummala
534f1ea89d mmc: sdhci: Add Inline Crypto Engine (ICE) support
This patch adds ICE support to sdhci driver. It uses the
new ICE host->ops like config/reset to configure/reset the
ICE HW as appropriate.

Change-Id: I64946d15d2f6ec8981e95c8817e82a2115b1196c
Signed-off-by: Sahitya Tummala <stummala@codeaurora.org>
Signed-off-by: Venkat Gopalakrishnan <venkatg@codeaurora.org>
[subhashj@codeaurora.org: fixed trivial merge conflicts]
Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org>
2016-05-31 15:26:26 -07:00
Sahitya Tummala
755824a894 mmc: sdhci-msm: Add Inline Crypto Engine (ICE) support
Add ICE support to low-level driver sdhci-msm.c. This code is
primarily responsible for enabling ICE (if present),
managing ICE clocks, managing ICE suspend/resume and also provides
a few host->ops for sdhci driver to use ICE functionality.

Change-Id: I3ec62146982c9db0263d5e19f60274163f514859
Signed-off-by: Krishna Konda <kkonda@codeaurora.org>
Signed-off-by: Sahitya Tummala <stummala@codeaurora.org>
Signed-off-by: Venkat Gopalakrishnan <venkatg@codeaurora.org>
[subhashj@codeaurora.org: fixed trivial merge conflicts]
Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org>
2016-05-31 15:26:25 -07:00
Sahitya Tummala
f32bccfb7f mmc: sdhci-msm-ice: Add Inline Crypto Engine (ICE) support
eMMC controller may have an Inline Crypto Engine (ICE) attached,
which can be used to encrypt/decrypt data going to/from eMMC.
This patch adds a new client driver sdhci-msm-ice.c which interacts
with ICE driver present in (drivers/crypto/msm/) and thus provides
an interface to the low-level SDHCI driver to do the data
encryption/decryption.

Change-Id: I6ac78072563f77c481425a5ec149ec46a9b0a80d
Signed-off-by: Krishna Konda <kkonda@codeaurora.org>
Signed-off-by: Sahitya Tummala <stummala@codeaurora.org>
Signed-off-by: Venkat Gopalakrishnan <venkatg@codeaurora.org>
[subhashj@codeaurora.org: fixed trivial merge conflicts]
Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org>
2016-05-31 15:26:25 -07:00
Ritesh Harjani
5e2fbf9a0d mmc: core: Fix crash in mmc clk-scaling
kernel crashes with below signature on trying to
acquire uninitialized clk-scaling spinlock.
Fix it by checking that clk scaling is
initialized before acquiring this lock.

BUG: spinlock bad magic on CPU#0, kworker/0:1/39
Backtrace:
 __delay+0x1c
 __const_udelay+0x24
 msm_trigger_wdog_bite+0xbc
 spin_bug+0x8c
 do_raw_spin_lock+0x34
 _raw_spin_lock_irqsave+0x28
 mmc_reset_clk_scale_stats+0x40
 mmc_host_clk_hold+0x5c
 mmc_start_request+0x1ec
 mmc_wait_for_req+0x98
 mmc_wait_for_cmd+0x70
 __mmc_switch+0xd0
 mmc_switch+0x18
 mmc_flush_cache+0x4c
 _mmc_suspend.isra.8+0x6c
 mmc_runtime_suspend+0x38
 mmc_runtime_suspend+0x18
 __rpm_callback+0x40
 rpm_callback+0x44
 rpm_suspend+0x2a4
 pm_runtime_work+0x78
 process_one_work+0x264
 worker_thread+0x1f8
 kthread+0xdc
 ret_from_fork+0x10

Change-Id: I8347e2d5ad1816f549ef8ab2607546203aa4a21d
Signed-off-by: Ritesh Harjani <riteshh@codeaurora.org>
2016-05-31 15:26:24 -07:00
Talel Shenhar
a968943d35 mmc: fix MMC clock scaling to meet upstream HS400 implementation
On the 3.10 kernel branch we had an implementation
supporting HS400 that was different than that in the
Linux community code base.
As part of the transition to kernel 3.14, the
community's implementation was used.
However, as this implementation does not properly
support up/down clock scaling - this patch adds
the missing functionality.

Change-Id: I096132bc715909b1ff2ac84448ec0adb32ca06ba
Signed-off-by: Talel Shenhar <tatias@codeaurora.org>
2016-05-31 15:26:24 -07:00
Talel Shenhar
ae479fa29f mmc: core: devfreq: migrate to devfreq based clock scaling
This change adds the use of devfreq to MMC.
Both eMMC and SD card will use it.
For some workloads, such as video playback, it isn't
necessary for these cards to run at high speed.
Running at lower frequency, for example 52MHz, in such
cases can still meet the deadlines for data transfers.
Scaling down the clock frequency dynamically has power
savings not only because the bus is running at lower frequency
but also has an advantage of scaling down the system core
voltage, if supported.
Provide an ondemand clock scaling support similar to the
cpufreq ondemand governor having two thresholds,
up_threshold and down_threshold to decide whether to
increase the frequency or scale it down respectively.
The sampling interval is in the order of milliseconds.
If sampling interval is too low, frequent switching of
frequencies can lead to high power consumption and if
sampling interval is too high, the clock scaling logic
would take long time to realize that the underlying
hardware (controller and card) is busy and scale up
the clocks.

Change-Id: I58ddbd93648ded82b304411956e035fb353cd97e
Signed-off-by: Talel Shenhar <tatias@codeaurora.org>
[subhashj@codeaurora.org: fixed trivial merge conflicts & compilation
errors]
Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org>
2016-05-31 15:26:23 -07:00
Venkat Gopalakrishnan
cff87b3cda Revert "mmc: sdhci-msm: Disable pm functionalities"
This reverts commit 2fabf4b6aea9f66fb340f556f3cad1d0d99c8e0f.
Reverting the temporarily disabled clk gating feature.
Clk scaling still remains disabled.

Change-Id: If984ff1f393968c0d76eb6eb8a98c83fb5a7bc92
Signed-off-by: Venkat Gopalakrishnan <venkatg@codeaurora.org>
[subhashj@codeaurora.org: fixed trivial merge conflicts]
Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org>
2016-05-31 15:26:23 -07:00
Dov Levenglick
ed9551c160 mmc: add support for scheduling mmcqd on idle CPU
In order to boost mmc performance on various platforms,
add support for configuring whether set_wake_up_idle()
should be called on the mmc queue thread (mmcqd).
The decision will be set in each individual platform's
dts file.

CRs-Fixed: 787554
Change-Id: I3989d3f5b8228785e6d3bc49c7eb01ebf2fa2f38
Signed-off-by: Dov Levenglick <dovl@codeaurora.org>
[subhashj@codeaurora.org: fixed trivial merge conflicts]
Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org>
2016-05-31 15:26:22 -07:00
Talel Shenhar
326454ec69 mmc: sdhci-msm: Fix clk gating on MSM8996-v2/v3 revisions
MSM8996-V2 and MSM8996-V3 has different sdcc minor
number compared to MSM8996-v1.
Include these minor numbers as well for fixing
clk-gating logic.

Change-Id: Ie9c797589151bcfc17c7ddee33dd93d9ea683822
Signed-off-by: Ritesh Harjani <riteshh@codeaurora.org>
Signed-off-by: Talel Shenhar <tatias@codeaurora.org>
2016-05-31 15:26:22 -07:00
Asutosh Das
f4a1662928 mmc: core: Add support to read command queue parameters
eMMC cards with EXT_CSD version >= 7, optionally support command
queuing feature as defined by JEDEC eMMC5.1. Add support for probing
command queue feature for such type of cards.

Change-Id: I9454d0d6997ccbd1778a147354859467f4a9a7d3
Signed-off-by: Sujit Reddy Thumma <sthumma@codeaurora.org>
Signed-off-by: Asutosh Das <asutoshd@codeaurora.org>
Signed-off-by: Venkat Gopalakrishnan <venkatg@codeaurora.org>
[subhashj@codeaurora.org: fixed trivial merge conflicts]
Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org>
2016-05-31 15:26:21 -07:00
Sahitya Tummala
a4a793c49e mmc: sdhci-msm: Move common definitions to header file
This is needed by Inline Crypto Engine (ICE) driver.

Change-Id: Ibfe151098f4f0395b5b9dbdc463723b8e0265487
Signed-off-by: Sahitya Tummala <stummala@codeaurora.org>
Signed-off-by: Venkat Gopalakrishnan <venkatg@codeaurora.org>
2016-05-31 15:26:21 -07:00
Sahitya Tummala
71e326e078 mmc: block: add req pointer to mmc request
This is needed by ICE (Inline Crypto Engine) driver to get
the ICE configuration data from the request.

Change-Id: Ie69c64f4dc0c31290dec50d905e8b3d436c86d62
Signed-off-by: Sahitya Tummala <stummala@codeaurora.org>
Signed-off-by: Venkat Gopalakrishnan <venkatg@codeaurora.org>
2016-05-31 15:26:20 -07:00
Talel Shenhar
3006336d10 mmc: sd: fix SD card runtime suspend sequence for clock scaling
This change fixes the sequence for runtime suspend.
Before this change, clock scaling logic was initialized
during runtime suspend instead of calling
destruction API of clock scaling.
This change fixes this issue by calling the right clock scaling
API during SD runtime suspend/resume.

Change-Id: I6044f65de55f3eb683747a09b1e20322342222c2
Signed-off-by: Talel Shenhar <tatias@codeaurora.org>
[subhashj@codeaurora.org: fixed trivial merge conflicts]
Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org>
2016-05-31 15:26:20 -07:00
Ritesh Harjani
a5b878365a mmc: sdhci-msm: Dont enable PWRSAVE_DLL for certain sdhc hosts
SDHC core with new 14lpp tech DLL should not enable
PWRSAVE_DLL since such controller's internal gating
cannot meet following MCLK requirement:
when MCLK is gated OFF, it is not gated for less than 0.5us
and MCLK must be switched on for at-least 1us before DATA
starts coming.
Add support for this new requirement.

Change-Id: Ief03926e0b9c6ff2f6335a422c576dd489fba9d5
Signed-off-by: Ritesh Harjani <riteshh@codeaurora.org>
2016-05-31 15:26:19 -07:00
Venkat Gopalakrishnan
5dddfdcab8 include: mmc: Export sanitized mmc headers
Export sanitized mmc.h and core.h for userspace.

Change-Id: I3a6eadde2023d974b0ce260a77082b01d8ba0b5d
Signed-off-by: Venkat Gopalakrishnan <venkatg@codeaurora.org>
[subhashj@codeaurora.org: fixed trivial merge conflicts]
Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org>
2016-05-31 15:26:19 -07:00
Amir Samuelov
d8b33a2dac spcom: fix lock ION buffer
Check if ION buffer is locked based on comparing the kernel ion handle,
rather than comparing the user file descriptor.

Change-Id: I7a41df3eebf22de2cc6b14327978923bcdbb7142
Signed-off-by: Amir Samuelov <amirs@codeaurora.org>
2016-05-31 15:26:18 -07:00