Commit Graph

3481 Commits

Author SHA1 Message Date
Talel Shenhar 5b79103e09 mmc: card: remove HPI and Cache quirks for Hynix cards
This change removes quirks for Hynix cards.
These quirks were used to avoid HPI and Cache
feature for specific Hynix cards due to
issues such as data corruption.
After further discussion with the card vendor it was
decided to restore the usage of these features.

Change-Id: I3fc85064eb427f6b3b6a4a941d8251341a6137d0
Signed-off-by: Talel Shenhar <tatias@codeaurora.org>
2015-03-09 07:44:06 -07:00
Dov Levenglick 6105c52440 mmc: sdhci-msm: add pm_qos trace-points
Add trace-points for tracking pm_qos voting.
This assists in following the voting for debugging
performance related issues.

Change-Id: I5a9e886c739252043e9f28f100e0493436a0eb75
Signed-off-by: Dov Levenglick <dovl@codeaurora.org>
2015-03-08 18:24:49 +02:00
Dov Levenglick 03e5732d02 mmc: sdhci-msm: support multiple pm_qos configurations
Add support for multiple configurations of setting pm_qos
and have all pm_qos handled from the sdhci-msm driver.
This is used in order to support different hardware
architectures (cpu-to-cluster mapping), different pm_qos
requirements for read/write accesses or to compensate for
different scheduler schemes.

Change-Id: Iade1ec6058e56a7cc81322c2d997df76b7e760a6
Signed-off-by: Dov Levenglick <dovl@codeaurora.org>
2015-03-08 18:24:08 +02:00
Dov Levenglick bdc10e75a8 Revert "mmc: host: sdhci: update pm qos votes based on cpu clusters"
This reverts commit 88cb7597ca4f243bc929fc39e215c4c9969e18fc.
Uploading new solution (Change-Id: Iade1ec6058e56a7cc81322c2d997df76b7e760a6)

Change-Id: I0e223246937c00290472374f44ed5bbf4ec0389f
Signed-off-by: Dov Levenglick <dovl@codeaurora.org>
2015-03-08 18:23:26 +02:00
Jisheng Zhang 5d37544fb1 mmc: sdhci-pxav3: fix setting of pdata->clk_delay_cycles
commit 14460dbaf7a5a0488963fdb8232ad5c8a8cca7b7 upstream.

Current code checks "clk_delay_cycles > 0" to know whether the optional
"mrvl,clk_delay_cycles" is set or not. But of_property_read_u32() doesn't
touch clk_delay_cycles if the property is not set. And type of
clk_delay_cycles is u32, so we may always set pdata->clk_delay_cycles as a
random value.

This patch fix this problem by check the return value of of_property_read_u32()
to know whether the optional clk-delay-cycles is set or not.

Signed-off-by: Jisheng Zhang <jszhang@marvell.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-06 14:40:49 -08:00
Dov Levenglick bd0ba63ef4 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>
2015-03-04 12:59:36 +02:00
Venkat Gopalakrishnan fbc0b6c158 mmc: host: sdhci: update pm qos votes based on cpu clusters
Performance of the workload largely depends on the pm qos votes.
Dynamically identify the core in which the current task is running
and apply the pm qos votes to the cluster that this core belongs to.
This ensures that the performance of the workload is not impacted and
also improves the power efficiency of the system.

Change-Id: I4d7fc5250e73b945fa2cfef63e2be18602233f53
Signed-off-by: Venkat Gopalakrishnan <venkatg@codeaurora.org>
2015-02-18 07:34:02 +02:00
Dov Levenglick e759928d43 Revert "mmc: sdhci-msm: add support for multiple qos configurations"
This reverts commit cd9ba68520.
The original change prevented cpu power collapse.

Change-Id: I9e0d0c2ff71423f9b7bec1f23d96d2340f32c4b7
Signed-off-by: Dov Levenglick <dovl@codeaurora.org>
2015-02-17 17:24:12 -08:00
Linux Build Service Account 9853d6a9ee Merge "mmc: sdhci-msm: Update DLL reset sequence" 2015-02-10 02:28:41 -08:00
Linux Build Service Account afc2117deb Merge "mmc: sdhci-msm: add support for multiple qos configurations" 2015-02-09 16:46:43 -08:00
Venkat Gopalakrishnan d03f1fd922 mmc: sdhci-msm: Update DLL reset sequence
The latest version of the SDCC core requires a change in the reset
sequence for DLL tuning. Make necessary changes as needed.

Change-Id: I69e972c08e89efebff9822de6d0e59692784652e
Signed-off-by: Venkat Gopalakrishnan <venkatg@codeaurora.org>
2015-02-09 11:40:20 -08:00
Dov Levenglick cd9ba68520 mmc: sdhci-msm: add support for multiple qos configurations
Add support for multiple configurations of setting pm_qos
and have all pm_qos handled from the sdhci-msm driver.
This is used in order to support different hardware
architectures (cpu-to-cluster mapping), different pm_qos
requirements for read/write accesses or to compensate for
different scheduler schemes.

Signed-off-by: Dov Levenglick <dovl@codeaurora.org>
Change-Id: I1770ec7dcb35000b64faff0592dd6d81ca2b265c
2015-02-05 15:00:36 +02:00
Sahitya Tummala a4ed76f7e8 mmc: sdhci-msm: Fix SD card detection issue
The change in pull configs might not take into effect immediately
and any value read before it is stabilized will mark incorrect
card status. This causes SD card detection to fail when inserted
for the first time. Fix this by adding enough delay after
configuring the GPIO and before reading its value.

Change-Id: I3a8455ce404988ab5eb3ed04c0f90ab6edf76d86
Signed-off-by: Sahitya Tummala <stummala@codeaurora.org>
2015-02-05 16:09:10 +05:30
Linux Build Service Account 3ca6a17148 Merge "mmc: block: use pr_err_ratelimited for command errors" 2015-02-01 18:00:29 -08:00
Romain Izard d422d9a8b5 mmc: Allow forward compatibility for eMMC
As stated by the eMMC 5.0 specification, a chip should not be rejected
only because of the revision stated in the EXT_CSD_REV field of the
EXT_CSD register.

Remove the control on this value, the control of the CSD_STRUCTURE field
should be sufficient to reject future incompatible changes.

Change-Id: I655a59004e7e4997c12077d3a267e71344f10b66
Signed-off-by: Romain Izard <romain.izard.pro@gmail.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Git-commit: 03a59437ef6b6ad7fb0165cb9b96c08d6bf057fc
Git-repo: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
Signed-off-by: Venkat Gopalakrishnan <venkatg@codeaurora.org>
2015-01-28 20:30:56 -08:00
Talel Shenhar 5d6c175415 mmc: block: use pr_err_ratelimited for command errors
Switch to using pr_err_ratelimited in order to avoid
flooding the logs in case of error function gets
called repeatedly.

Change-Id: I636dc933915127a43ad4da87a565f8f585e6df90
Signed-off-by: Talel Shenhar <tatias@codeaurora.org>
2015-01-28 14:44:57 +02:00
Krzysztof Kozlowski 34a322c73a mmc: sdhci: Fix sleep in atomic after inserting SD card
commit 2836766a9d0bd02c66073f8dd44796e6cc23848d upstream.

Sleep in atomic context happened on Trats2 board after inserting or
removing SD card because mmc_gpio_get_cd() was called under spin lock.

Fix this by moving card detection earlier, before acquiring spin lock.
The mmc_gpio_get_cd() call does not have to be protected by spin lock
because it does not access any sdhci internal data.
The sdhci_do_get_cd() call access host flags (SDHCI_DEVICE_DEAD). After
moving it out side of spin lock it could theoretically race with driver
removal but still there is no actual protection against manual card
eject.

Dmesg after inserting SD card:
[   41.663414] BUG: sleeping function called from invalid context at drivers/gpio/gpiolib.c:1511
[   41.670469] in_atomic(): 1, irqs_disabled(): 128, pid: 30, name: kworker/u8:1
[   41.677580] INFO: lockdep is turned off.
[   41.681486] irq event stamp: 61972
[   41.684872] hardirqs last  enabled at (61971): [<c0490ee0>] _raw_spin_unlock_irq+0x24/0x5c
[   41.693118] hardirqs last disabled at (61972): [<c04907ac>] _raw_spin_lock_irq+0x18/0x54
[   41.701190] softirqs last  enabled at (61648): [<c0026fd4>] __do_softirq+0x234/0x2c8
[   41.708914] softirqs last disabled at (61631): [<c00273a0>] irq_exit+0xd0/0x114
[   41.716206] Preemption disabled at:[<  (null)>]   (null)
[   41.721500]
[   41.722985] CPU: 3 PID: 30 Comm: kworker/u8:1 Tainted: G        W      3.18.0-rc5-next-20141121 #883
[   41.732111] Workqueue: kmmcd mmc_rescan
[   41.735945] [<c0014d2c>] (unwind_backtrace) from [<c0011c80>] (show_stack+0x10/0x14)
[   41.743661] [<c0011c80>] (show_stack) from [<c0489d14>] (dump_stack+0x70/0xbc)
[   41.750867] [<c0489d14>] (dump_stack) from [<c0228b74>] (gpiod_get_raw_value_cansleep+0x18/0x30)
[   41.759628] [<c0228b74>] (gpiod_get_raw_value_cansleep) from [<c03646e8>] (mmc_gpio_get_cd+0x38/0x58)
[   41.768821] [<c03646e8>] (mmc_gpio_get_cd) from [<c036d378>] (sdhci_request+0x50/0x1a4)
[   41.776808] [<c036d378>] (sdhci_request) from [<c0357934>] (mmc_start_request+0x138/0x268)
[   41.785051] [<c0357934>] (mmc_start_request) from [<c0357cc8>] (mmc_wait_for_req+0x58/0x1a0)
[   41.793469] [<c0357cc8>] (mmc_wait_for_req) from [<c0357e68>] (mmc_wait_for_cmd+0x58/0x78)
[   41.801714] [<c0357e68>] (mmc_wait_for_cmd) from [<c0361c00>] (mmc_io_rw_direct_host+0x98/0x124)
[   41.810480] [<c0361c00>] (mmc_io_rw_direct_host) from [<c03620f8>] (sdio_reset+0x2c/0x64)
[   41.818641] [<c03620f8>] (sdio_reset) from [<c035a3d8>] (mmc_rescan+0x254/0x2e4)
[   41.826028] [<c035a3d8>] (mmc_rescan) from [<c003a0e0>] (process_one_work+0x180/0x3f4)
[   41.833920] [<c003a0e0>] (process_one_work) from [<c003a3bc>] (worker_thread+0x34/0x4b0)
[   41.841991] [<c003a3bc>] (worker_thread) from [<c003fed8>] (kthread+0xe4/0x104)
[   41.849285] [<c003fed8>] (kthread) from [<c000f268>] (ret_from_fork+0x14/0x2c)
[   42.038276] mmc0: new high speed SDHC card at address 1234

Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
Fixes: 94144a465d ("mmc: sdhci: add get_cd() implementation")
Cc: <stable@vger.kernel.org>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-01-27 07:52:33 -08:00
Gilad Broner 122a0e2b70 mmc: card: fix bug in mmc block test
mmc unit test is run by writing to a debug-fs entry, in
which the mmc_block_test_data structure is kept as private
pointer in the file object.
This private pointer was incorrectly casted to seq_file and
the mmc_block_test_data was extracted from its private data
resulting in a bad pointer.
Fixed the code to properly extract the mmc_block_test_data
structure.

Change-Id: I8a9fea6b45b621b3b7c0abc7aaa078d340dc1c6b
Signed-off-by: Gilad Broner <gbroner@codeaurora.org>
2015-01-22 17:36:14 +02:00
Linux Build Service Account 87fb1e5abc Merge "mmc: block: fix flush timeout error handling" 2015-01-19 18:24:21 -08:00
Talel Shenhar 2b007503ff mmc: block: fix flush timeout error handling
The eMMC card can go into "reset state" due to several
reasons and without host involvement,
e.g. low voltage detection.
This kind of eMMC card reset requires eMMC host to
re-initialize the eMMC card.
In case of eMMC card reset, eMMC card firmware sets its
state to "reset state" which allows CMD0 only.
In case the eMMC host is in the middle of FLUSH request it will
get timeout which will cause the driver to requeue the flush
request and try it later on.
The problem with this is that no one is going to initialize
the eMMC card to move out of "reset state", hence, the flush
request will keep on failing over and over again.
This commit adds a device reset for the case where flush request
fails due to timeout.

Change-Id: Ic268e13cb19d0cdce0070174bf7847e6253e4513
Signed-off-by: Talel Shenhar <tatias@codeaurora.org>
2015-01-18 15:34:18 +02:00
Linux Build Service Account 9195406ed3 Merge "block: test-iosched: fix bio allocation for test requests" 2015-01-13 02:35:19 -08:00
Linux Build Service Account 74c42670df Merge "block: test-iosched: enable running of simultaneous tests" 2015-01-13 02:35:17 -08:00
Gilad Broner 8aeb623c2d block: test-iosched: fix bio allocation for test requests
Unit tests submit large requests of 512KB made of 128 bios.
Current allocation was done via kmalloc which may not be able
to allocate such a large buffer which is also physically contiguous.
Using kmalloc to allocate each bio separately is also problematic as
it might not be page aligned. Some bio may end up using more than a
single memory segment which will fail the mapping of the bios to
the request which supports up to 128 physical segments.
To avoid such failure, allocate a separate page for each bio
(bio size is single page size).

Change-Id: Id0da394d458942e093d924bc7aa23aa3231cdca7
Signed-off-by: Gilad Broner <gbroner@codeaurora.org>
2015-01-12 09:02:24 -08:00
Gilad Broner 4ab0976786 block: test-iosched: enable running of simultaneous tests
Current test-iosched design enables running only a single test
for a single block device.
This change modifies the test-iosched framework to allow running
several tests on several block devices.

Change-Id: I051d842733873488b64e89053d9c4e30e1249870
Signed-off-by: Gilad Broner <gbroner@codeaurora.org>
2015-01-12 18:58:02 +02:00
Baruch Siach 5d316a3163 mmc: block: add newline to sysfs display of force_ro
commit 0031a98a85e9fca282624bfc887f9531b2768396 upstream.

Make force_ro consistent with other sysfs entries.

Fixes: 371a689f64 ('mmc: MMC boot partitions support')
Cc: Andrei Warkentin <andrey.warkentin@gmail.com>
Signed-off-by: Baruch Siach <baruch@tkos.co.il>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-01-08 09:58:15 -08:00
Linux Build Service Account 291eca8b62 Merge "mmc: sdhci: Fix unclocked register access" 2015-01-08 02:04:07 -08:00
Talel Shenhar 18a5a61a84 mmc: core: enable BKOPS by read-modify-write instead of override
This change adds a read-modify-write logic to BKOPS feature enable.
It is required in order to avoid overriding other fields defined
in BKOPS_EN register.

Change-Id: I689f5cd14d9ec1bb881f503a0418026a59e6c197
Signed-off-by: Talel Shenhar <tatias@codeaurora.org>
2015-01-04 15:56:31 +02:00
Linux Build Service Account 5742c327fe Merge "mmc: card: fix timeout on erase/trim command due to sanitize" 2014-12-25 07:01:25 -08:00
Linux Build Service Account 9619cf3c3e Merge "mmc: sdhci-msm: add no-1-8-v to remove UHS SD card support" 2014-12-24 14:53:42 -08:00
Guoping Yu 651b8ba258 mmc: sdhci-msm: add no-1-8-v to remove UHS SD card support
Some system physically doesn't support 1.8v, even if the sdhci
host support it. With no-1-8-v, SDHCI_QUIRK2_NO_1_8_V will be
set, and SDR104, SDR50, DDR50 capability will be removed which
work at 1.8v.

Change-Id: Ica88896e9db566c0fc7abb044ab6601023dcb8a2
Signed-off-by: Guoping Yu <guopingy@codeaurora.org>
2014-12-23 14:46:26 +08:00
Maya Erez ad160c8d74 mmc: card: fix timeout on erase/trim command due to sanitize
Sanitize command should never be issued with timeout argument of 0,
cause then it invokes timeout.
Moreover, sanitize command should not be called from routines that
does erase/trim/secure-discard commands, but only from a routine that
issues the sanitize specifically.(mmc_blk_issue_sanitize_rq)

Change-Id: I2fc9d17d876de3440f7cdee5fce0158a919c7c6f
Signed-off-by: Yaniv Gardi <ygardi@codeaurora.org>
Signed-off-by: Maya Erez <merez@codeaurora.org>
2014-12-18 16:35:45 +02:00
Ritesh Harjani d012137d04 mmc: sdhci: add dynamic Qos for cpu-dma-latency.
Currently there was only 1 cpu_dma_latency value which
we pass from DT for pm_qos due to which certain I/O use
cases have power/performance impact.

This patch adds support for dynamic Qos using clk scaling.
Using clk_scaling algo we dynamically decide which Qos value
to request for (i.e. Performance/Init/Power_save_mode).

Pass cpu-dma-latency table with 3 values from DT, which can
be used by sdhci layer to update pm_qos dynamically.
This patch also has backward compatibility with platforms that
does not support dynamic Qos and only pass 1 value from DT.

3 values in DT for following states of sdhci (for dynamic Qos)
1. SDHCI_PERFORMANCE_MODE       -- least cpu_dma_latency
2. SDHCI_PERFORMANCE_MODE_INIT  -- avg val
3. SDHCI_POWER_SAVE_MODE        -- higher then avg.
                                  may get updated with default val
                                  based on sdhci_[enable/disable]

Change-Id: Ibce1681e9087c944a827bedb4bf406701b8ff959
Signed-off-by: Ritesh Harjani <riteshh@codeaurora.org>
2014-12-18 15:48:27 +05:30
Linux Build Service Account a4635cbf55 Merge "mmc: core: Include one more state for mmc_load during init" 2014-12-17 08:14:14 -08:00
Ritesh Harjani 48eb10dafe mmc: core: Include one more state for mmc_load during init
Include one more state of MMC_LOAD_INIT when resume (which
calls for mmc clk init algorithm) is called
to notify sdhci with SDHCI_PERMORMANCE_MODE_INIT.

Change-Id: I80661d7c9a927ed16925c0b9c00ac7abec608cee
Signed-off-by: Ritesh Harjani <riteshh@codeaurora.org>
2014-12-16 22:55:14 +05:30
Venkat Gopalakrishnan 4c97380cd9 mmc: sdhci: Fix unclocked register access
During platform driver probe we call mmc_start_host in sdhci_add_host,
which could start the mmc_rescan work immediately and trigger a runtime
suspend. This creates a race condition where the clocks could be turned off
even before the probe has completed leading to unclocked register access.

CRs-Fixed: 770843
Change-Id: I77ae36f805e496d56ed96db3ccaa83f2c37c926c
Signed-off-by: Venkat Gopalakrishnan <venkatg@codeaurora.org>
2014-12-15 18:05:11 -08:00
Yaniv Gardi e533d60d81 mmc: host: add support to allow SANITIZE operation
SANITIZE is an operation performed by the storage device and its purpose
is to delete its unmap memory regions.
This change adds support for the SANITIZE capability.

Change-Id: Id409cb99b0b65dcc45d505cef80340df93fa36b1
Signed-off-by: Yaniv Gardi <ygardi@codeaurora.org>
2014-12-15 07:11:05 -08:00
Dov Levenglick 665b1c3428 mmc: sdhci-msm: change the rclk delay value
Change the rclk delay value to 0.9ns since testing shows
that the valid window may vary for different platforms and the
default value (1.25ns) might fall outside the valid window.

CRs-Fixed: 766702
Change-Id: I039d61b96bb86731471c4efb27b8c7bda1a7bb8c
Signed-off-by: Dov Levenglick <dovl@codeaurora.org>
2014-12-09 10:44:31 +02:00
Ritesh Harjani 29d9282648 mmc: sdhci-msm: Correct the CDR toggle logic
We should keep either one of CDR_EN or CDR_EXT_EN enabled.
So correct this logic in toggle CDR function.

CRs-fixed: 759398
Change-Id: Ic137ae2a28e912ab131644ff9d81e41f4256dd05
Signed-off-by: Ritesh Harjani <riteshh@codeaurora.org>
2014-12-01 21:59:57 -08:00
Ritesh Harjani f81efd1248 mmc: sdhci: Dont enable CDR for tuning commands
Currently we enable CDR for every read command including
for tuning procedure which is not correct (as CDR if
enabled might correct the phase during tuning and we
wont be able to detect the correct phase during tuning).

So, disable CDR for read tuning commands.

CRs-fixed: 759398
Change-Id: I051b6e3b204dde22cdc973759c3e32d0a81c369a
Signed-off-by: Ritesh Harjani <riteshh@codeaurora.org>
2014-12-01 21:59:45 -08:00
Konstantin Dorfman f2d381a8d8 sdhci: sdhci-msm: define pm qos cpu affinity mask through DT
PM QoS request type PM_QOS_REQ_AFFINE_CORES specifies for
which CPU cores the voting will be done by the cpu affinity
mask. Define the cpu mask in the DT to be used for the voting
so it can be customized for each target.

Change-Id: Iea745e4ad60cd16fb7bf6df1b5e2447b52944e70
Signed-off-by: Konstantin Dorfman <kdorfman@codeaurora.org>
2014-11-25 10:18:07 +02:00
Roger Tseng b6e03bbd14 mmc: rtsx_pci_sdmmc: fix incorrect last byte in R2 response
commit d1419d50c1bf711e9fd27b516a739c86b23f7cf9 upstream.

Current code erroneously fill the last byte of R2 response with an undefined
value. In addition, the controller actually 'offloads' the last byte
(CRC7, end bit) while receiving R2 response and thus it's impossible to get the
actual value. This could cause mmc stack to obtain inconsistent CID from the
same card after resume and misidentify it as a different card.

Fix by assigning dummy CRC and end bit: {7'b0, 1} = 0x1 to the last byte of R2.

Fixes: ff984e57d3 ("mmc: Add realtek pcie sdmmc host driver")
Signed-off-by: Roger Tseng <rogerable@realtek.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-11-14 08:47:53 -08:00
Ritesh Harjani 90ce8e9c99 mmc: sdhci-msm: Dont wait infinitely for pwr_irq interrupt
Currently there is one rare case where suspend thread trying
to suspend sdhci-msm waits infinitely for pwr_irq interrupt
from hardware which never gets raised and thus watchdog barks
happens.

Change this waiting to wait_for_completion_timeout.

Change-Id: Ic4e9bca91b5496409b4afe2be2892c83aa390e95
Signed-off-by: Ritesh Harjani <riteshh@codeaurora.org>
2014-11-12 10:01:14 +05:30
Linux Build Service Account 5e3a69fdaf Merge "mmc: core: resolve divded by zero panic" 2014-11-10 03:57:55 -08:00
Linux Build Service Account 4da3a8d651 Merge "mmc: sdhci-msm: support dual voltage pad for eMMC" 2014-11-10 03:57:11 -08:00
Linux Build Service Account 5143c7f932 Merge "mmc: core: Fix error handling of MMC_BLK_DATA_ERR" 2014-11-08 16:01:10 -08:00
Linux Build Service Account bbe67c7873 Merge "mmc: sdhci: rate limit sdhci_dumpregs() prints" 2014-11-06 05:26:08 -08:00
Krishna Konda 2a6c648052 mmc: sdhci-msm: support dual voltage pad for eMMC
Only 1.8V is used on IO pad lines for eMMCs' on msm platforms. So this
means for any SDHC core on msm platforms used with eMMCs' should have
PAD_PWR_SWITCH bit set indicating that 1.8V is used for IO lines. So far
this did not matter as all eMMCs' SDHC pads were single voltage and the
PAD_PWR_SWTICH bit did not make a difference.

But when a SDHC core that supports dual voltage pad is used for
initializing eMMC, the BUS_ON pwr_irq generated would cause the pad
to be set at a logical HIGH in the driver (as it should since the
bus is being turned ON) but then the driver does not set or clear
the PAD_PWR_SWITCH for eMMCs which causes the communication between
the host and card to break down. So even though the IO pad is driven
at 1.8V, the host is not told that it should switch to 1.8V IO from
3.0V (default).

This does not matter for SD cards for when they are turned ON, they always
start with 3.0V on IO pad. But for eMMC instead of not setting or clearing
the PAD_PWR_SWITCH bit when the bus is turned ON, check the voltage being
supplied on the IO pad and based on that set or clear the PAD_PWR_SWITCH.

Change-Id: I7756731760298c6766d00a22160c6328faaaf4a7
Signed-off-by: Krishna Konda <kkonda@codeaurora.org>
2014-11-05 13:42:00 -08:00
Maya Erez 0b20bf4bfa mmc: sdhci: Dump out descriptors information in case of req timeout
Recently we observed an interrupt timeout issue on SDIO use case,
that was caused by a SW bug in the preparation of the ADMA descriptor
table.

Dumping out the descriptor information in requests timeouts, will help
to quickly debug such issues in the future.

Change-Id: Ifa18e514df3fdb2e5808dd7e7b54deed467b1d35
Signed-off-by: Maya Erez <merez@codeaurora.org>
2014-11-04 00:07:11 +02:00
Chuanxiao Dong 4ed3f695f8 mmc: core: resolve divded by zero panic
With one special SD card, below divide by zero error observed:
...
[    2.144300] divide error: 0000 [#1] PREEMPT SMP
[    2.148860] Modules linked in:
[    2.151898]
[    2.152685] Set up 4031 stolen pages starting at 0x0001f000, GTT offset 0K
[    2.157330] Set up 0 CI stolen pages starting at 0x00000000, GTT offset 131072K
[    2.167581] Pid: 5, comm: kworker/u:0 Not tainted 3.0.8-138216-g974a2ab #1
[    2.169506] [drm] PSB GTT mem manager ready, tt_start 4031, tt_size 28737 pages
[    2.169906] [drm] SGX core id = 0x00000000
[    2.169920] [drm] SGX core rev major = 0x00, minor = 0x00
[    2.169934] [drm] SGX core rev maintenance = 0x00, designer = 0x00
[    2.197370]  Intel Corporation Medfield/iCDKB
[    2.201716] EIP: 0060:[<c1697ca6>] EFLAGS: 00010246 CPU: 1
[    2.207198] EIP is at mmc_init_erase+0x76/0x150
[    2.211704] EAX: 00002000 EBX: dcd1b400 ECX: 00002000 EDX: 00000000
[    2.217957] ESI: 00000000 EDI: dcd5c800 EBP: dd867e84 ESP: dd867e7c
[    2.224214]  DS: 007b ES: 007b FS: 00d8 GS: 0000 SS: 0068
[    2.229605] Process kworker/u:0 (pid: 5, ti=dd866000 task=dd868000 task.ti=dd866000)
[    2.237325] Stack:
[    2.239322]  dcd1b400 00000000 dd867eb0 c16a06da c1ab7c44 dd995aa8 00000003 00000000
[    2.247054]  00000000 00000000 dcd5c800 00000000 dcd1b400 dd867ef8 c16a1012 c1698b00
[    2.254785]  00000029 00000001 c194eb80 dcd5c9ec dd867e00 c1239b00 00000000 00000000
[    2.262519] Call Trace:
[    2.264975]  [<c16a06da>] mmc_sd_setup_card+0x1da/0x4f0
[    2.270183]  [<c16a1012>] mmc_sd_init_card+0x192/0xc40
[    2.275304]  [<c1698b00>] ? __mmc_claim_host+0x160/0x160
[    2.280610]  [<c1239b00>] ? __schedule_bug+0x50/0x80
[    2.285556]  [<c16a1b89>] mmc_attach_sd+0xc9/0x230
[    2.290333]  [<c169b6ef>] mmc_rescan+0x25f/0x2c0
[    2.294943]  [<c1274223>] process_one_work+0x103/0x400
[    2.300065]  [<c12670fd>] ? mod_timer+0x1ad/0x3c0
[    2.304756]  [<c169b490>] ? mmc_suspend_host+0x1a0/0x1a0
[    2.310056]  [<c127502d>] worker_thread+0x12d/0x4a0
[    2.314921]  [<c18fcfbd>] ? preempt_schedule+0x2d/0x50
[    2.320047]  [<c1274f00[    2.323976] ---[ end trace 5398ec2720494438 ]---
...

So, seems this bad SD card does not set valid value in related SSR / CSD register fields.
And then the driver will set card->erase_size to 0.
Then it triggered this divided by zero error when calculate card->pref_erase.

Submit this patch to fix the issue.

Signed-off-by: Yunpeng Gao <yunpeng.gao@intel.com>
Signed-off-by: Chuanxiao Dong <chuanxiao.dong@intel.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Git commit: cc8aa7de48277f62fe3fced762d75f01ce57e909
Git-repo: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
Change-Id: Icd28093ab823e20456fac9c2cb0c51475b389e1d
Signed-off-by: Sahitya Tummala <stummala@codeaurora.org>
2014-10-31 15:39:30 +05:30
Sahitya Tummala a65da33f08 mmc: sdhci: rate limit sdhci_dumpregs() prints
Rate limit sdhci_dumpregs() prints to avoid unnecessary
and exessive logging which can sometimes lead to watchdog
timeouts (especially due to bad cards).

Change-Id: Ib6be6d563e47c2d2e9e1b6b0410c2c45712a9b17
Signed-off-by: Sahitya Tummala <stummala@codeaurora.org>
2014-10-31 14:59:42 +05:30
Sahitya Tummala 6087341b36 mmc: core: Fix error handling of MMC_BLK_DATA_ERR
Avoid retrying using single block for read commands that
fail with MMC_BLK_DATA_ERR. The single block read retry
is needed only in case of a CRC error for which
MMC_BLK_ECC_ERR will be set anyway by mmc_blk_err_check().

Change-Id: Iec9487fd73ecf2bdd5e62732cd42cdb3a639d0dc
Signed-off-by: Sahitya Tummala <stummala@codeaurora.org>
2014-10-31 14:56:34 +05:30
Maya Erez 5bb065d433 mmc: sdhci: disable controller interrupts after card is powered off
If SDHCi controller's native card detection functionality is disabled,
there is no need to keep the sdhci controller interrupt enabled after
the card is powered off. This should help masking any spurious controller
interrupt while clocks are disabled.

Change-Id: Iad56b3b9860983fe220fb7e52d863cfd216e5b09
Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org>
Signed-off-by: Konstantin Dorfman <kdorfman@codeaurora.org>
Signed-off-by: Maya Erez <merez@codeaurora.org>
2014-10-28 15:52:03 +02:00
Maya Erez 8034e2fe74 Revert "mmc: host: disable only sdhci irqs in sdhci_request"
This reverts commit b680bce536.

Spin lock recursion introduced, when SD card inserted during sdhci
transaction, because it is not enough to disable sdhci irq and power irq,
besides this card detect irq need to be disabled.

Change-Id: If6aa64e9d92aec70237ab8fe72a6ea7c212530b9
CRs-Fixed: 744511
Signed-off-by: Maya Erez <merez@codeaurora.org>
Signed-off-by: Konstantin Dorfman <kdorfman@codeaurora.org>
2014-10-28 14:19:39 +02:00
Linux Build Service Account 9c456b8c03 Merge "mmc: host: sdhci: allow definition of pm QoS via dts file" 2014-10-23 11:53:59 -07:00
Maya Erez 042f8bdc09 mmc: host: sdhci: allow definition of pm QoS via dts file
Add a new dts entry to define the CPU affinity in order to maintain
the IRQ pm_qos (Quality of Service) for targets that don't have little
cluster and allow setting the pm_qos to the little cluster,
to improve its performance.

Change-Id: Icf6125066d96331392d98a387974e54c96553306
Signed-off-by: Vince Leung <vincentl@codeaurora.org>
Signed-off-by: Maya Erez <merez@codeaurora.org>
2014-10-21 20:22:04 +03:00
Sahitya Tummala 2d3196585d mmc: core: Fix unclocked access in get_xfer_remain/stop_request
The unclocked access could happen in the following scenario -

1. mmcqd thread is waiting for previously submitted io to be done
2. before this io is done, it is woken up due to is_urgent event
3. mmcqd thread is running and is processing the is_urgent event
4. Just about the same time the previously submitted io is done and
it sets is_done_rcv flag, tries to wake up mmcqd thread and release
host clock so as to gate the clocks.

If step 3 and 4 happen at the same time, then clocks will be gated off
before is_urgent is completely handled. Hence, make sure to hold the
clock before invoking get_xfer_remain and stop_request host->op.

Change-Id: If03177bf5e28cc217cc8e86b10d81d4adbab78b9
Signed-off-by: Sahitya Tummala <stummala@codeaurora.org>
2014-10-17 09:07:41 +05:30
Linux Build Service Account 6e3436ea55 Merge "Revert "mmc: core: increase delay between power-up and power-on"" 2014-10-14 08:50:04 -07:00
Guoping Yu 02a9497a17 Revert "mmc: core: increase delay between power-up and power-on"
This reverts commit 3ec1ed2a8d.

The original 10ms delay is enough to reach power on from power
up. Increase delay is workaround to resovle resume Re-init
retries time out error. The root cause is additional QDSD block
would impact SD fucntionality as they are multiplex with SD
interface. If cd-gpio is HW floating and has a pulse, QDSD 100ms
search process would be triggerred is prior to SD block and SD
interface work as QDSD instead of SD.

The fix is merged, so revert the workaround.

Change-Id: I647be754de4a6a13678cbb1456a9db88c2714f94
Signed-off-by: Guoping Yu <guopingy@codeaurora.org>
2014-10-14 14:45:41 +08:00
Linux Build Service Account b3fce17ea2 Merge "mmc: host: disable only sdhci irqs in sdhci_request" 2014-10-12 08:39:46 -07:00
Linux Build Service Account 90480c85c4 Merge "mmc: sdhci: Reset cmd err only for sbc commands" 2014-10-12 00:52:14 -07:00
Linux Build Service Account 2e8551eb83 Merge "mmc: core: use cache flush timeout as cache disable timeout" 2014-10-07 21:19:50 -07:00
Linux Build Service Account 6a695fc705 Merge "sdhci: disable sg list fixing for ADMA alignment" 2014-10-07 21:19:46 -07:00
Venkat Gopalakrishnan d558f7a9af mmc: sdhci: Reset cmd err only for sbc commands
The data complete interrupt is also used to indicate that a
busy state has ended. Fix a race condition between sdhci_cmd_irq()
that sets any cmd err and sdhci_data_irq() (received to indicate
end of busy state) that clears cmd error. This can happen when a
cmd err is set and finish tasklet is scheduled but sdhci_data_irq()
executes before the tasklet. The cmd err status is critical for the
tasklet handler to reset the controller's state machine. This
should be cleared only when we have successfully processed a sbc
command and are ready to submit the actual command next, not when
there is an actual cmd err.

CRs-fixed: 733074
Change-Id: I91ea2b949c34446fb629446aabb21505734e27bb
Signed-off-by: Venkat Gopalakrishnan <venkatg@codeaurora.org>
2014-10-07 18:18:55 -07:00
Konstantin Dorfman 266b8e2f1c sdhci: disable sg list fixing for ADMA alignment
Some SDHCi controller implementations did not require alignment
for ADMA buffers. When SDHCI_QUIRK2_ADMA_SKIP_DATA_ALIGNMENT defined,
the logic that fixes scatter gather list buffers is skipped.

CRs-fixed: 719302
Change-Id: I822b394a0ae4f9b8a132c13831c0cdf78684cb36
Signed-off-by: Konstantin Dorfman <kdorfman@codeaurora.org>
2014-10-07 09:01:23 +03:00
Lee Susman b680bce536 mmc: host: disable only sdhci irqs in sdhci_request
When using the _irqsave variant of spin_lock, irqs are disabled. In the
case of sdhci_request, this can result in relatively long periods of time
in which the irqs are disabled (up to at least 170us observed).
Since in this flow not all interrupts need to be disabled,
we use regular spin_locks here, and disable only sdhci-specific interrupts.
For this, introduce a new sdhci_ops function for enabling/disabling the
platform-specific power irqs.

CRs-Fixed: 709331
Change-Id: Ia9fb0498aab3053b393d677bae097fcd846d8180
Signed-off-by: Lee Susman <lsusman@codeaurora.org>
Signed-off-by: Konstantin Dorfman <kdorfman@codeaurora.org>
2014-10-06 09:40:36 +03:00
Gilad Broner b2c33f68a4 mmc: sdhci-msm: force 32bit ADMA descriptors
SDCC AXI master uses 32-bit addressing so there's no need to use
64-bit descriptors. Using 32-bit descriptors instead will reduce
the memory footprint.
This change masks the 64-bit capability to force 32-bit ADMA
descriptors.

CRs-Fixed: 719303
Change-Id: Ifb8095763136bbc795227bdfcb346d1e1fae42c7
Signed-off-by: Gilad Broner <gbroner@codeaurora.org>
2014-10-05 15:34:03 +03:00
Konstantin Dorfman ac28baee40 mmc: core: use cache flush timeout as cache disable timeout
When eMMC cache is disabled, the card has to flush all the data in its
cache.
This change increases the timeout for cache flush operation and also uses
the cache flush timeout in cache disable operation.

Change-Id: I373050a99816c95e784a957de4271955a511b9f9
CRs-Fixed: 723701
Signed-off-by: Konstantin Dorfman <kdorfman@codeaurora.org>
2014-09-23 12:26:42 +03:00
Linux Build Service Account f9b22ac388 Merge "mmc: core: increase delay between power-up and power-on" 2014-09-12 22:50:24 -07:00
Linux Build Service Account cd1e9e677d Merge "mmc: host: sdhci: don't queue zero length descriptor" 2014-09-09 00:56:19 -07:00
Linux Build Service Account 29d1cf1277 Merge "mmc: host: sdhci: don't set SDMA buffer boundary in ADMA mode" 2014-09-09 00:56:18 -07:00
Guoping Yu 3ec1ed2a8d mmc: core: increase delay between power-up and power-on
Add a capability to selectively increase the delay between
power_up and power_on. This delay was arrived at after performing
a series of experiments to find the minimum value. It is required
in some scenarios to avoid command timeouts during resume.

Change-Id: I857e740aa20a33e08515d054e5c9bf128db229c6
Signed-off-by: Guoping Yu <guopingy@codeaurora.org>
2014-09-08 22:15:50 -07:00
Venkat Gopalakrishnan e036d7e01a mmc: sdhci-msm: Add dual voltage capability
SDCC5 controller doesn't advertise 1.8v capability by default.
Dual voltage capability is required for SD3.0 support. Add this
capability for controllers that support this based on
device tree configuration.

Change-Id: Ie4cd6db2e7230bc22cd393c8e37d99f49c777cd0
Signed-off-by: Venkat Gopalakrishnan <venkatg@codeaurora.org>
2014-09-03 10:59:02 -07:00
Subhash Jadavani 734b921945 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>
2014-09-03 09:25:18 -07:00
Subhash Jadavani 6167d89203 mmc: host: sdhci: don't set SDMA buffer boundary in ADMA mode
SDMA buffer boundary size parameter in block size register should only be
programmed if host controller DMA is operating in SDMA mode otherwise its
better not to set this parameter to avoid any side effect when DMA is
operating in ADMA mode operation.

Change-Id: Ia29ca4759ead2e4c9ea1d72908444a03bf205bac
Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org>
2014-09-03 09:24:31 -07:00
Linux Build Service Account 82da7dd157 Merge "mmc: sdhci-msm: add nonhotplug support" 2014-08-24 13:52:14 -07:00
Linux Build Service Account ce7e53c27c Merge "mmc: sdhci: add support nonhotplug" 2014-08-24 13:52:13 -07:00
Guoping Yu 861d67e19d mmc: sdhci-msm: add nonhotplug support
With some devices like QRD SKUK, SD card could not support
hotplug as there is no cd-gpio, and also could not use polling
way due to power comsumption. So add nonhotplug to meet such
requirement and when SD card lost or removed manually, device
will not crash until next reboot process to detect SD card.

Change-Id: I318d3db72fc09248c5dada2fb6d69ade1bbf85cb
Signed-off-by: Guoping Yu <guopingy@codeaurora.org>
2014-08-21 19:14:32 +08:00
Guoping Yu 98dc1c244c mmc: sdhci: add support nonhotplug
With some devices, SD card could not support hotplug as there is
no cd-gpio, and also could not use polling way due to power
comsumption. So add nonhotplug to meet such requirement and when
SD card lost or removed manually, device will not crash until
next reboot process to detect SD card.

Change-Id: Ie8ea8ec57015f36689a119249003eeaa48391393
Signed-off-by: Guoping Yu <guopingy@codeaurora.org>
2014-08-20 21:31:02 -07:00
Ian Maund 6440f462f9 Merge upstream tag 'v3.10.49' into msm-3.10
* commit 'v3.10.49': (529 commits)
  Linux 3.10.49
  ACPI / battery: Retry to get battery information if failed during probing
  x86, ioremap: Speed up check for RAM pages
  Score: Modify the Makefile of Score, remove -mlong-calls for compiling
  Score: The commit is for compiling successfully.
  Score: Implement the function csum_ipv6_magic
  score: normalize global variables exported by vmlinux.lds
  rtmutex: Plug slow unlock race
  rtmutex: Handle deadlock detection smarter
  rtmutex: Detect changes in the pi lock chain
  rtmutex: Fix deadlock detector for real
  ring-buffer: Check if buffer exists before polling
  drm/radeon: stop poisoning the GART TLB
  drm/radeon: fix typo in golden register setup on evergreen
  ext4: disable synchronous transaction batching if max_batch_time==0
  ext4: clarify error count warning messages
  ext4: fix unjournalled bg descriptor while initializing inode bitmap
  dm io: fix a race condition in the wake up code for sync_io
  Drivers: hv: vmbus: Fix a bug in the channel callback dispatch code
  clk: spear3xx: Use proper control register offset
  ...

In addition to bringing in upstream commits, this merge also makes minor
changes to mainitain compatibility with upstream:

The definition of list_next_entry in qcrypto.c and ipa_dp.c has been
removed, as upstream has moved the definition to list.h. The implementation
of list_next_entry was identical between the two.

irq.c, for both arm and arm64 architecture, has had its calls to
__irq_set_affinity_locked updated to reflect changes to the API upstream.

Finally, as we have removed the sleep_length member variable of the
tick_sched struct, all changes made by upstream commit ec804bd do not
apply to our tree and have been removed from this merge. Only
kernel/time/tick-sched.c is impacted.

Change-Id: I63b7e0c1354812921c94804e1f3b33d1ad6ee3f1
Signed-off-by: Ian Maund <imaund@codeaurora.org>
2014-08-20 13:23:09 -07:00
Venkat Gopalakrishnan ba820a42b5 mmc: core: Optimize entering HS400 mode
In the current HS400 selection sequence high speed mode is entered
twice unnecessarily. Skip the first hs selection as it is also done
as part of entering high speed DDR mode.

CRs-fixed: 707453
Change-Id: Id027af977fe416056a6fbef39da1a84e41d89e53
Signed-off-by: Venkat Gopalakrishnan <venkatg@codeaurora.org>
2014-08-15 10:53:33 -07:00
Linux Build Service Account eae662b871 Merge "mmc: card: fix errors for NULL pointer deference" 2014-08-10 08:47:28 -07:00
Linux Build Service Account c3f4be32f6 Merge "mmc: sdhci-msm: fix possible NULL pointer dereference" 2014-08-09 14:58:11 -07:00
Linux Build Service Account 9ca336b95c Merge "mmc: sdhci-msm: Reduce the max descriptors" 2014-08-08 23:00:00 -07:00
Linux Build Service Account e6523d3bba Merge "mmc: sdhci: convert align buffer to a coherent allocation" 2014-08-08 22:59:58 -07:00
Linux Build Service Account bc1098b352 Merge "mmc: sdhci: Enumerate sglist only on read" 2014-08-08 22:59:57 -07:00
Linux Build Service Account e83379fced Merge "mmc: sdhci: avoid sync'ing the SG if there's no misalignment" 2014-08-08 22:59:55 -07:00
Linux Build Service Account 46199631f4 Merge "mmc: core: assert in case NULL pointer dereference" 2014-08-08 22:59:27 -07:00
Asutosh Das d97d2762a4 mmc: sdhci-msm: fix possible NULL pointer dereference
The platform_get_resource API may return NULL, hence check
the return value before using the mapped memory.

Change-Id: I28741554f8e1b5843671ee0d6b08bdcf8e4469c9
Signed-off-by: Asutosh Das <asutoshd@codeaurora.org>
2014-08-08 23:15:10 +05:30
Konstantin Dorfman 54c7580744 mmc: card: fix errors for NULL pointer deference
This change fixes pointer de-references without NULL check before.

Change-Id: I624e56513c09a2d5919cb91f650f4e2982eb3d71
Signed-off-by: Konstantin Dorfman <kdorfman@codeaurora.org>
2014-08-07 16:09:42 +03:00
Guoping Yu 35e0143842 mmc: core: add long read time fixup for certain Samsung eMMC
Certain Samsung eMMC meet multi read timeout, and could not
reponse status CMD anymore after that. Add long read timeout
fixup to resolve it.

Change-Id: Ibeb0e6ab3d889d48fdee91244bec720a6994b907
Signed-off-by: Guoping Yu <guopingy@codeaurora.org>
2014-08-07 00:54:18 -07:00
Venkat Gopalakrishnan c69a15f2bb mmc: sdhci-msm: Reduce the max descriptors
8K is the max descriptors supported by the hardware per transfer.
On normal use cases we never use that many descriptors even if
the memory is extremely fragmented. The memory allocated for these
descriptors are never freed hence wasting memory otherwise
available for the system. Reduce the max descriptors to 512 to save
memory (128K with 8K descriptors vs 8K with 512 descriptors) and
still support maximum performance.

CRs-fixed: 684185
Change-Id: Ib57ce03834d741c0fda4195a58d6b287ee9fb0a0
Signed-off-by: Venkat Gopalakrishnan <venkatg@codeaurora.org>
2014-08-05 09:52:48 -07:00
Venkat Gopalakrishnan 7a1765dc67 mmc: sdhci: convert align buffer to a coherent allocation
Rather than using the streaming API, use the coherent allocator to
provide this memory, thereby eliminating cache flushing of it each
time we map and unmap it.

CRs-fixed: 684185
Change-Id: I615133da06a04fa23c6bca4078e484299147eb34
Signed-off-by: Venkat Gopalakrishnan <venkatg@codeaurora.org>
2014-08-05 09:52:27 -07:00
Venkat Gopalakrishnan 72791ad237 mmc: sdhci: Enumerate sglist only on read
Save sglist enumeration for write since identifying misalignment is only
required on read use cases.

CRs-fixed: 684185
Change-Id: Iacb362e8a9cd68d487ea6bd8ce8e56eef49f471e
Signed-off-by: Venkat Gopalakrishnan <venkatg@codeaurora.org>
2014-08-05 09:51:52 -07:00
Russell King 2a6b494ca9 mmc: sdhci: avoid sync'ing the SG if there's no misalignment
On read, we don't need to sync the whole scatterlist and then check
whether any segments need copying - if we check first, we avoid
potentially expensive cache handling.

CRs-fixed: 684185
Change-Id: I9a07b1b1e83d0299765f80adc14bbff44f7ed114
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Tested-by: Markus Pargmann <mpa@pengutronix.de>
Tested-by: Stephen Warren <swarren@nvidia.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Signed-off-by: Chris Ball <chris@printf.net>
Git-commit: de0b65a786ae83c8f6dfb712f65b9a36af70a981
Git-repo: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
[venkatg@codeaurora.org: use align_bytes - 1 for alignment check]
Signed-off-by: Venkat Gopalakrishnan <venkatg@codeaurora.org>
2014-08-05 09:51:36 -07:00
Linux Build Service Account 6cb73e412b Merge "mmc: sdhci: convert ADMA descriptors to a coherent allocation" 2014-08-05 00:14:00 -07:00
Linux Build Service Account 7dd146b7f3 Merge "mmc: core: remove duplicate code in mmc_rescan" 2014-08-04 08:30:50 -07:00
Asutosh Das 2ffe104c02 mmc: core: remove duplicate code in mmc_rescan
If the card is removed, the wakelock has to be held for
an extended period of time to enable the user-space to
respond. The code to extend the wakelock has been
duplicated. This patch removes this duplicate code.

CRs-fixed: 684724
Change-Id: I96e4e9dec46ada7853724c36f0c2c6329f696e5d
Signed-off-by: Asutosh Das <asutoshd@codeaurora.org>
2014-08-04 09:56:31 +05:30
Konstantin Dorfman 0ffedec59f mmc: core: assert in case NULL pointer dereference
This changes ensures that pointer to card struct is valid.

Change-Id: I11405cd7dd3a1a43fdb3010152a07c1c7944fc9d
Signed-off-by: Konstantin Dorfman <kdorfman@codeaurora.org>
2014-08-03 17:39:53 +03:00
Venkat Gopalakrishnan 7fe6d9abe5 mmc: sdhci: Add tracepoints to enhance debugging
Instrument the sdhci driver with tracepoints to aid in
debugging issues and identifying latencies in the following
path:
* CMD completion
* DATA completion
* DMA preparation
* Post DMA cleanup

Change-Id: Ie8cd0c2fb6c1bd6ab13883123be021081f8b8f78
Signed-off-by: Venkat Gopalakrishnan <venkatg@codeaurora.org>
2014-08-01 17:29:25 -07:00
Linux Build Service Account 5141eb2ed6 Merge "mmc: block: fix race in deferred resume" 2014-07-31 06:00:03 -07:00