Commit Graph

176 Commits

Author SHA1 Message Date
Luca Stefani ff1ebfd98d This is the 3.10.102 stable release
-----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1
 
 iQIcBAABAgAGBQJXXS5iAAoJEE44bZycYXAvDj8P/jbhmGAgW6tw2cnS90QIZDqG
 M/nclEId61jICNvbfP6zsioKeWyrmzr5G7NjqTThsSNhCo/DXs3ddMqLy3pOaFdq
 mytXtHIUpwZoplEib+ODinW40CMqnu11XSWEcee2nrsPuGNsnc7BY0wmFBa6UVCV
 rOZef9SN9lJcZSYY/auvgLDXOXdQ+NMxp5hau30aF5HBO8hTDXStjPRcUwCvz7aR
 govTQJHlS4HzLH3JOYS3Dt8IYFDOrKhQIby2nFdw7eiUxHCRy2F0asabTh3DzCw1
 iLvFroozjyVXwozfWMqLCvMa+514MXJy8Nkva6xiAHraC8UrgfPtcNsTdgtkdH9T
 V2Am9b0L7yiBdG6hsZLxkU3akk7vU/0dtppwzvudANT6i2tGcDSBeaZq3T2pAv7B
 7coY53GzHZdQnbdTZbYeS1fxebxyXw50D5OJkF8DyLhoL7Uj2Dvv0QdjKv+U/e5D
 VQ+ZyGcBdCLuOzflXysI10E01y0/M3FrkubgGBM4Oh0eYKCHJaHG/NCZy5JY/qxy
 S0phem8RbeZPbcL14z+5buWIi1lUkTiCIMG8c32ZEmDh84drnICqABA0RzKmqdkj
 ucQa+PzkMQ1DyhAMUl/CwpBfSqf1Zs3agLo78Kp5MTGfeAA90m0SeVqhmDgWhwqG
 HhSlsPFfMfmJl5S0uJpQ
 =UhFl
 -----END PGP SIGNATURE-----

Merge tag 'v3.10.102' into HEAD

This is the 3.10.102 stable release

Change-Id: Ic7d338fb190966b26aa151361fc37414f701d8b2
2017-04-18 17:22:08 +02:00
Luca Stefani 84d647cae9 mmc: dos2unix
Change-Id: If55e77f51b0257e17067c69949f427d14881a70d
2017-04-18 17:18:58 +02:00
LuK1337 fc9499e55a Import latest Samsung release
* Package version: T713XXU2BQCO

Change-Id: I293d9e7f2df458c512d59b7a06f8ca6add610c99
2017-04-18 03:43:52 +02:00
Adrian Hunter e94c917abb mmc: mmc: Fix partition switch timeout for some eMMCs
commit 1c447116d017a98c90f8f71c8c5a611e0aa42178 upstream.

Some eMMCs set the partition switch timeout too low.

Now typically eMMCs are considered a critical component (e.g. because
they store the root file system) and consequently are expected to be
reliable.  Thus we can neglect the use case where eMMCs can't switch
reliably and we might want a lower timeout to facilitate speedy
recovery.

Although we could employ a quirk for the cards that are affected (if
we could identify them all), as described above, there is little
benefit to having a low timeout, so instead simply set a minimum
timeout.

The minimum is set to 300ms somewhat arbitrarily - the examples that
have been seen had a timeout of 10ms but were sometimes taking 60-70ms.

Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Willy Tarreau <w@1wt.eu>
2016-06-07 10:42:55 +02:00
Krishna Konda 5542892b2f mmc: core: expose info about enhanced rpmb support
Following eMMC JEDEC JESD84-B51 standard, an ehannced form of
rpmb is supported. What this enhanced mode supports is in
addition to be able to write one rpmb or two rpmb frames at a
time,32 frames can be written at a time.

Expose this information present in ext csd field so that the
user space application that wants to make use of this can do
so.

Change-Id: I53fd962fd7e04b5d2d7804c289d7865c2c5618d5
Signed-off-by: Krishna Konda <kkonda@codeaurora.org>
Signed-off-by: Pavan Anamula <pavana@codeaurora.org>
2015-12-23 11:23:34 +05:30
Sahitya Tummala 36354b8cb4 mmc: core: Add hs400 enhanced strobe mode support
This adds hs400 enhanced strobe mode support
in mmc core layer which is emmc 5.1 feature.

Change-Id: Ifa80d8ed1544212629193f58f05db4bd0e163adc
Signed-off-by: Ritesh Harjani <riteshh@codeaurora.org>
Signed-off-by: Sahitya Tummala <stummala@codeaurora.org>
2015-12-09 09:18:03 +05:30
Linux Build Service Account 8bdc809e8d Merge "mmc: core: disable clock scaling before mmc suspend" 2015-12-04 12:43:58 -08:00
Ritesh Harjani 02a34eb670 mmc: core: cmdq helper for reset and claim host context
This patch does following-

This adds an API(mmc_cmdq_hw_reset), for RESET_ALL
of SDHCI, power cycle mmc card and
reintialize it, which enables cmdq as well(if supported).

This acquires claim_host before calling mmc_power_restore.
mmc_power_restore should be called with claim_host acquired,
since this function is required from non-claim-host context in
cmdq error handling.

Change-Id: I31c4449dead1d4ad4e10a4822cce2298ec5fb4b6
Signed-off-by: Ritesh Harjani <riteshh@codeaurora.org>
2015-12-01 11:40:53 +05:30
Sahitya Tummala 74ab5d4642 mmc: core: disable clock scaling before mmc suspend
This is to ensure that clock scaling work is either cancelled
or completely done if it is already running before the MMC/SD
suspend is started. Otherwise, the system suspend may fail
unnecessarily if it cannot claim the host due to pending
clock scaling work.

Change-Id: Icc465a607451b29d51e27b733e506060ca9f9dc0
Signed-off-by: Sahitya Tummala <stummala@codeaurora.org>
2015-11-27 01:55:46 -08:00
Sahitya Tummala 2b72e9710e mmc: core: revert recent changes in shutdown handling code
This change reverts the following gerrits as they break the
existing shutdown functionality for eMMC and SD card.

8635767 "mmc: core: Extend shutdown sequence to handle bus operations"
b4f9379 "mmc: core: Add shutdown callback for (e)MMC bus_ops"
e3126b8 "mmc: core: Add shutdown callback for SD bus_ops"

Change-Id: I3d34404e653600d52015afe851ae55b7e60e07dd
Signed-off-by: Sahitya Tummala <stummala@codeaurora.org>
2015-10-12 09:43:40 +05:30
Ulf Hansson 107cd6cb6c mmc: core: Use mmc_flush_cache() during mmc suspend
Earlier we disabled the cache during suspend, which meant a flush was
internally at the eMMC performed as well.

To simplify code we can make use of the mmc_flush_cache(), during mmc
suspend, which makes the mmc_cache_ctrl() redundant so then we can
remove it.

Change-Id: I80c6cbf9ad3e81943aee4b844c267c8e4f360257
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Acked-by: Seungwon Jeon <tgih.jun@samsung.com>
Signed-off-by: Chris Ball <chris@printf.net>
Git-commit: 1a6fd1533dfa409e48f377db1d92ef1cc6b0c4ce
Git-repo: https://android.googlesource.com/kernel/common.git
[kaushalk@codeaurora.org: Resolved context conflicts]
Signed-off-by: Kaushal Kumar <kaushalk@codeaurora.org>
2015-09-16 18:20:22 +05:30
Ulf Hansson 97c8310d50 mmc: core: Invent MMC_CAP2_FULL_PWR_CYCLE
MMC_CAP2_FULL_PWR_CYCLE shall be set by host drivers which are able to
do a complete power cycle of the card. In the eMMC case that includes
both vcc and vccq.

This CAP is providing the protocol layer with important information,
needed to take optimized decisions during card initialization and in
the suspend/resume sequence.

MMC_CAP2_POWEROFF_NOTIFY is replaced by MMC_CAP2_FULL_PWR_CYCLE, since
it makes sense to use a wider scope for it.

Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Signed-off-by: Chris Ball <cjb@laptop.org>
Git-commit: 211f8b40b27a83c8513bcade87188ab168aece90
Git-repo: https://android.googlesource.com/kernel/common.git
Signed-off-by: Kaushal Kumar <kaushalk@codeaurora.org>
2015-09-16 18:20:21 +05:30
Ulf Hansson 3a594af2bf mmc: core: Enable power_off_notify for eMMC shutdown sequence
In suspend mode it is important to save power. If the host is able to
cut buth vcc and vccq, the MMC_CAP2_POWEROFF_NOTIFY shall be set. It
will mean the card will be completely powered down at suspend and the
power off notification cmd will be sent prior power down.

It seems common not being able to cut both vcc and vccq for a host. In
this situation we issue the sleep cmd in favor of the power off
notification cmd, to save more power.

While maintainng the above policy, we also want to make use of the
power off notification in the shutdown sequence, even in the case were
the host has not set MMC_CAP2_POWEROFF_NOTIFY, since we know vcc and
vccq will regardless be cut.

We accomplish this by always enabling the power off notification byte
in the EXT_CSD and issue the power off notification when either
MMC_CAP2_POWEROFF_NOTIFY is set or we are executing a shutdown.

Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Signed-off-by: Chris Ball <cjb@laptop.org>
Git-commit: 020586d24e5dce45b0738d9340636c9f1688237f
Git-repo: https://android.googlesource.com/kernel/common.git
Signed-off-by: Kaushal Kumar <kaushalk@codeaurora.org>
2015-09-16 18:20:21 +05:30
Ulf Hansson 86b94fb2d0 mmc: core: Add shutdown callback for (e)MMC bus_ops
The shutdown sequence of an (e)MMC is very similar to a suspend. We
re-use the suspend function and tell it we are not in suspend context.

Change-Id: Id81922dce7227759f84c24e864d0c24c8aee0fb1
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Signed-off-by: Chris Ball <cjb@laptop.org>
Git-commit: eb91ee02bce94d96560b670508f64a86544f2ecc
Git-repo: https://android.googlesource.com/kernel/common.git
[kaushalk@codeaurora.org: Resolved context conflicts]
Signed-off-by: Kaushal Kumar <kaushalk@codeaurora.org>
2015-09-16 18:20:21 +05:30
Ulf Hansson 5a6809765b mmc: core: Handle both poweroff notification types for eMMC
Depending on the context of the operation while powering down the card,
either POWER_OFF_NOTIFY_SHORT or POWER_OFF_NOTIFY_LONG will be used. In
suspend context a short timeout is preferred while a long timeout would
be acceptable in a shutdown/hibernation context.

We add a new parameter to the mmc_suspend function so we can provide an
indication of what notification type to use.

Change-Id: I4a1db618d8b41dc7851e4cc95f801e3585b665e8
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Signed-off-by: Chris Ball <cjb@laptop.org>
Git-commit: bb09907fdbc4451448e9efb9009f0ef538e52861
Git-repo: https://android.googlesource.com/kernel/common.git
[kaushalk@codeaurora.org: Resolved context conflicts]
Signed-off-by: Kaushal Kumar <kaushalk@codeaurora.org>
2015-09-16 18:20:21 +05:30
Asutosh Das 9384ee40b6 mmc: card: read the firmware version from ext_csd
Read the firmware version from ext_csd register and print it
for debugging purpose.

Change-Id: I4c1fefd5bff753915c9858fb35c958335986c778
Signed-off-by: Asutosh Das <asutoshd@codeaurora.org>
Signed-off-by: Sahitya Tummala <stummala@codeaurora.org>
2015-08-31 21:47:25 -07:00
Sahitya Tummala 5d9d6a9ced mmc: core: Add support for DDR52 mode during eMMC clock scaling
Add support to use the DDR52 bus speed mode during eMMC clock
scaling, if the host supports it. This patch currently adds
support only for scaling up/down from HS400<->DDR52.

Change-Id: I21282c3dcef4605584ed7b1817165cc85b2de034
Signed-off-by: Sahitya Tummala <stummala@codeaurora.org>
2015-08-14 00:31:54 -07:00
xiaonian c2c3c78710 mmc: core: set REL_WR_SEC_C register to 0x1 per eMMC 5.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>
2015-07-18 12:37:57 -07:00
Ritesh Harjani 8509fa81d0 mmc: core: Add clock hold and release pair for cmdq_ops
mmc_host_clk_hold/release pair should be added for relevant
cmdq_ops. Since it enables host->clock which is needed
for register access as well (apart from
MCLK).

Change-Id: I6d9d15a421225c5b4179cb19e467a17d01ad176f
Signed-off-by: Ritesh Harjani <riteshh@codeaurora.org>
2015-06-22 20:01:50 +05:30
Sahitya Tummala f295d19cc9 mmc: core: Update PON based on the system state
As per eMMC specification, the PON (Power Off Notification)
must be sent by host to the card before turning off the power.
This will allow card to prepare itself for the power off and
may even reduce the initialization of eMMC upon next boot-up.

Send long PON during system power off and send short PON during
system reboot to reduce the reboot latency.

Change-Id: If4188b8b80aaa0e6c4e00e1807aa9589d5e7efdb
Signed-off-by: Sahitya Tummala <stummala@codeaurora.org>
2015-06-16 08:56:46 +05:30
Asutosh Das a47572ac91 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>
2015-05-26 15:38:19 +05:30
Asutosh Das 5a720d693e 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>
2015-05-22 17:03:52 +05:30
Talel Shenhar 44b9d99e7b mmc: card: remove Cache quirk for Micron cards
This change removes a quirk for Micron cards.
This quirk was used to avoid Cache feature usage for
specific Micron cards due to issues such as data corruption.
After further discussion with the card vendor it was decided
to restore the usage of this feature.

Change-Id: Iec7f3855a15f3fbc751bfd43beeb4232d30341d3
Signed-off-by: Talel Shenhar <tatias@codeaurora.org>
2015-02-18 18:05:23 +02:00
Talel Shenhar 56652a15d0 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-02-18 18:05:02 +02: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 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
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
Venkat Gopalakrishnan 7a7528c0f8 mmc: core: Fix power class config for HS400
Use the correct power class field from the extended CSD register
for HS400 mode as defined in the eMMC5.0 specification.

CRs-fixed: 690341
Change-Id: Ie10e35941fd3c6ee49c686f721bf5af6fcd74862
Signed-off-by: Venkat Gopalakrishnan <venkatg@codeaurora.org>
2014-07-28 14:26:56 -07:00
Sahitya Tummala 17febdf753 mmc: core: Add retry mechanism for MMC resume failure
Enhance the error handling/recovery path during eMMC resume by
adding retry mechanism and by adding additional error messages
to failure cases. This may help some of the bad parts which fail
to resume sporadically.

Change-Id: I895068edb487e6a44205e0769342b2ec2c89c876
Signed-off-by: Sahitya Tummala <stummala@codeaurora.org>
2014-06-12 16:48:34 +05:30
Sahitya Tummala 9c6009c0e4 mmc: core: disable cache for micron eMMC devices
Enabling cache in micron devices with manufacturer ID 0xFE
is resulting in data corruption issues during power-off tests.

CRs-fixed: 654661
Change-Id: Ifcdecb26c4c75b055a128a8d9b883fc028521930
Signed-off-by: Sahitya Tummala <stummala@codeaurora.org>
2014-05-09 09:37:13 +05:30
Linux Build Service Account af3070fcb9 Merge "mmc: core: fix issue with sleep cmd that follows an RPMB access" 2014-04-23 21:30:04 -07:00
Sahitya Tummala 50384b8c2f mmc: core: fix issue with sleep cmd that follows an RPMB access
If the last access to eMMC before runtime/system suspend is an
RPMB access, the partition type within EXT_CSD[179] will be set
to RPMB. As per specification, the deselect CMD7 and sleep CMD5
are ignored by the card and are treated as illegal commands in
this state. This causes eMMC sleep command to timeout and thus
fails runtime/system suspend. Hence, switch to default partition
config before sending deselect CMD7 and sleep CMD5.

CRs-fixed: 630894
Change-Id: I40f3fb590aeba787de8ca3356a8eed5f2780bcc1
Signed-off-by: Sahitya Tummala <stummala@codeaurora.org>
2014-04-22 16:33:29 +05:30
Linux Build Service Account 24bb7c34fc Merge "mmc: card: quirk: disable HPI for Kingston card" 2014-04-20 22:49:30 -07:00
Konstantin Dorfman 173f45318a mmc: card: quirk: disable cache for Kingstone card
This change prevents enabling cache during card init for specific
Kingstone card.
This change is workaround the problem of long timeouts for cache
operations.

Change-Id: I6be53a408c7d6422556585d4ea2f9b1c487563e0
Signed-off-by: Konstantin Dorfman <kdorfman@codeaurora.org>
2014-04-17 02:14:22 -07:00
Konstantin Dorfman 0539ab03cc mmc: card: quirk: disable HPI for Kingston card
Certain Kingston eMMC 4.41 cards might get broken when HPI feature.
This quirk will disable the HPI feature for such buggy cards.

There are features depending on HPI, the change will disable them:
- BKOPS support
- stop transmission flow
- CACHE_CTRL

Change-Id: Ie675f6cb0646c06458ac8eee9a38d12fbc485be5
Signed-off-by: Konstantin Dorfman <kdorfman@codeaurora.org>
2014-04-13 12:11:53 +03:00
Pratibhasagar V 549a18305c mmc: core: Exit clock scaling prior to removing the card
After removing the SD/MMC 'card' from the driver model we
are cancelling the pending clock scaling work which accesses
card->dev. This could cause NULL pointer issue as the card
is already removed.

CRs-Fixed: 640344
Change-Id: I8c5ee817e3f116dedf0bf4fb51eb6b70d52467b7
Signed-off-by: Pratibhasagar V <pratibha@codeaurora.org>
2014-04-10 12:59:20 +05:30
Sujit Reddy Thumma cb808fc8f7 mmc: core: Fix disabling of cache for Hynix cards
Commit 6932a01cd (mmc: card: quirk: disable cache for Hynix card)
claims to disable cache because of data corruption issues when cache
it is enabled. In reality, the patch allows enabling of cache during
card initialization but disallow flushing of cache during suspend or
file system sync operations. This is more dangerous than without
the commit. Move the fixups for disabling cache to mmc_fixups so as
to enable the quirk during initialization itself. Also, remove obvious
warnings everytime card is initialized during runtime resume.

Change-Id: I3f71eaccf90ffdea83f418b7c05be68f5d89d227
Signed-off-by: Sujit Reddy Thumma <sthumma@codeaurora.org>
2014-03-07 11:43:55 +05:30
Krishna Konda e2598c92c7 mmc: sdhci-msm: improve tuning process
In newer hardware, the tuning process is not able to always
find a reliable phase to use for sampling data. This is mostly
due to hardware. This problem manifests itself as all successful
tuning phases, which means that the phase choosen could be a bad
one but is not identified as such at the time of tuning. So in
order to work around this, rely on optional drive types implemented
by the eMMC card, in addition to the mandatory drive type (50 ohm).

By using drive types supported by the card, when all phases are
sucessful in tuning, change drive type to a different value in the
list of supported drive types and retune. This will continue for all
tuning phases until a valid one is found. After that the drive type
is reset to the default one, if changed.

Change-Id: I348fb30daa43d97c58f83f7e4a22019f94ef4954
Signed-off-by: Krishna Konda <kkonda@codeaurora.org>
Signed-off-by: Asutosh Das <asutoshd@codeaurora.org>
2014-02-27 16:38:26 -08:00
Krishna Konda 4198388529 mmc: core: get drive types supported by eMMC cards
Get the various drive types other than the default supported
by the card.

Change-Id: I122971e4fb4a3ab98f0078ceafca3380e9c0e2d1
Signed-off-by: Krishna Konda <kkonda@codeaurora.org>
2014-02-26 10:31:26 -08:00
Konstantin Dorfman 6932a01cda mmc: card: quirk: disable cache for Hynix card
This change prevents enabling cache during card init for Hynix cards.
This change is workaround the problem of Hynix cards behavior for
adb reboot flow, when as a result of power cycle with cache enabled,
ext4 journal get aborted, because of meta data corruption.

Change-Id: I3198c940a334c8e5fbc3e68e0fea638e76467a75
Signed-off-by: Konstantin Dorfman <kdorfman@codeaurora.org>
2014-01-28 13:31:40 +02:00
Subhash Jadavani 79983b1d7f mmc: core: fix the issue with clock scaling in HS400 mode
Clock scaling feature would scale up/down the MMC interface clock
frequency based on the load on storage. During clock scale up in HS400
bus speed mode, SW is unncesserily doing the tuning even after HS400
switch is done. This change fixes this bug.

Change-Id: Ica39acc41b14095438a7ccf536c3c7e5792d9c41
Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org>
2013-12-20 13:15:29 -08:00
Sujit Reddy Thumma 039ac4401b mmc: core: fix buffer overflow during memcpy of ext_csd
Fix buffer overflow while caching the mmc ext_csd content.
Also, to avoid duplicate allocation keep the allocated ext_csd
till the card is removed.

CRs-Fixed: 583929
Change-Id: I5d69e37f6fd1f5249479d454c353be050df40b6d
Signed-off-by: Sujit Reddy Thumma <sthumma@codeaurora.org>
2013-12-05 19:40:31 +05:30
Asutosh Das 611766c039 mmc: core: add clock-scaling support to HS400 cards
This patch adds clock scaling support to HS400 cards.
Scaling down to 52MHz from HS400 involves:
 - switching the bus-speed mode to HS at 52MHz

Scaling up to HS400 would require all of the initialization
process upto HS400 mode selection.

Change-Id: I8196d6666bcc0ef327659253df53a17792fa51f7
Signed-off-by: Asutosh Das <asutoshd@codeaurora.org>
Signed-off-by: Krishna Konda <kkonda@codeaurora.org>
2013-10-14 16:01:51 -07:00
Pratibhasagar V ae3cf0b8a0 mmc: core: Disable HPI for certain Hynix eMMC cards
Certain Hynix eMMC 4.41 cards might get broken when HPI feature is used
and hence this patch disables the HPI feature for such buggy cards.

As some of the other features like BKOPs/Cache/Sanitize are dependent on
HPI feature, those features would also get disabled if HPI is disabled.

Change-Id: I6a638ce089cbd977122e47aecb721bc3f0adf7b0
Signed-off-by: Pratibhasagar V <pratibha@codeaurora.org>
Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org>
2013-09-04 17:28:23 -07:00
Sahitya Tummala 9c78953e13 HACK! mmc: core: Fix power IRQ issues with SDHCI on msm 3.9 kernel
With the new 3.9 kernel there is a change in power up and set IO
voltage sequence due to which the driver waits for an interrupt
that never trigers. Similarly, for eMMC slot, power IRQ will not
be triggered when IO voltage is changed to 1.8V. As a temporary
workaround change the power up sequence and also change the core
layer driver to not issue set voltage request to 1.8V as eMMC will
anyways be set to 1.8V as part of power up by SDHCI driver.

Change-Id: Ibb7c48219b57693c9f3d26b062d18d6d4b6b8b71
Signed-off-by: Sahitya Tummala <stummala@codeaurora.org>
2013-09-04 17:24:43 -07:00
Venkat Gopalakrishnan 24d46be822 mmc: core: Add support for HS400
HS400 is a new bus speed mode introduced in eMMC5.0 specification. This
patch adds the capability in mmc core to switch to HS400 mode when both
the host and the card supports it.

Change-Id: I53ee4982eae9e5cfccafe065b532d4a2f7225d17
Signed-off-by: Venkat Gopalakrishnan <venkatg@codeaurora.org>
2013-09-04 17:22:50 -07:00
Venkat Gopalakrishnan e3e4c348d3 mmc: core: Refactor bus speed selection code
The bus speed selection code in mmc_card_init() is convoluted, refactor
the code to simplify this and make it simpler for adding new bus speed
capabilities.

Change-Id: I1ee5365eaad42298a053d0b2d64b87b64bd05c5e
Signed-off-by: Venkat Gopalakrishnan <venkatg@codeaurora.org>
2013-09-04 17:19:49 -07:00
Krishna Konda 652629a356 mmc: core: dont send PON during suspend
During suspend, eMMC VCC can be turned off. So instead of sending
a power off notification, send a sleep command. According to the
eMMC 4.5 specification, this is the only time where its clearly
mentioned that the VCC regulator can be turned OFF.

This has been clarified in eMMC 5.0 specification and this applies
even if PON with sleep is not sent to the card.

Change-Id: I6c424bed3158132af7f9c2a2a701af7369fd5ec7
Signed-off-by: Krishna Konda <kkonda@codeaurora.org>
2013-09-04 17:10:07 -07:00
Tatyana Brokhman eda002fcab mmc: Add long power off notification support
At the moment only POWER_OFF_SHORT is sent to the device in case the host
is suspended. This patch adds the support of sending POWER_OFF_LONG
notification in case the device is powered off.

According to device vendors the POWER_OFF_LONG notification will shorten
the initialization time of the eMMC card during next boot up.

Change-Id: I3c6f224398450cf10463cbb316613fd430d1e8d2
Signed-off-by: Tatyana Brokhman <tlinder@codeaurora.org>
Signed-off-by: Sujit Reddy Thumma <sthumma@codeaurora.org>
2013-09-04 16:45:19 -07:00
Maya Erez 3cdd8eba4a mmc: core: remove the polling for BKOPS completion
The original intention of polling for BKOPS completion was to give
the card enough time to perform the BKOPS before it is runtime suspended.
But as the BKOPS completion polling was happening in a different
context, it may race with card runtime/platform suspend which is quite
difficult to fix. So instead of BKOPS polling, let the runtime suspend
get deferred if the BKOPS is running on the card. Also if BKOPS is running
when platform suspend is triggered, stop the BKOPS before suspending the
card.

CRs-Fixed: 489523
Change-Id: I21e524dc2da37c4985c210abfaca00a28049c651
Signed-off-by: Maya Erez <merez@codeaurora.org>
Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org>
2013-09-04 16:44:20 -07:00