#
5ec32f84 |
| 21-Nov-2016 |
Ulf Hansson <ulf.hansson@linaro.org> |
mmc: core: Check SWITCH_ERROR bit from each CMD13 response when polling According to the JEDEC specification, the SWITCH_ERROR bit in the device status from a R1 response, is an error bi
mmc: core: Check SWITCH_ERROR bit from each CMD13 response when polling According to the JEDEC specification, the SWITCH_ERROR bit in the device status from a R1 response, is an error bit which may be cleared as soon as the response that reports the error is sent. When polling with CMD13 to find out when the card stops signaling busy after a CMD6 has been sent, we currently parse only the last CMD13 response for the SWITCH_ERROR bit. Consequentially we could loose important information about the card. In worst case if the card stops signaling busy within the allowed timeout, we could end up believing that the CMD6 command completed successfully, when in fact it didn't. To improve the behaviour, let's parse each CMD13 response to see if the SWITCH_ERROR bit is set in the device status. In such case, we abort the polling loop and report the error. Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org> Tested-by: Linus Walleij <linus.walleij@linaro.org> Acked-by: Adrian Hunter <adrian.hunter@intel.com>
show more ...
|
#
625228fa |
| 08-Nov-2016 |
Ulf Hansson <ulf.hansson@linaro.org> |
mmc: core: Rename ignore_crc to retry_crc_err to reflect its purpose The ignore_crc parameter/variable name is used at a couple of places in the mmc core. Let's rename it to retry_crc_er
mmc: core: Rename ignore_crc to retry_crc_err to reflect its purpose The ignore_crc parameter/variable name is used at a couple of places in the mmc core. Let's rename it to retry_crc_err to reflect its new purpose. Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org> Tested-by: Linus Walleij <linus.walleij@linaro.org> Acked-by: Adrian Hunter <adrian.hunter@intel.com>
show more ...
|
#
89e57aed |
| 08-Nov-2016 |
Ulf Hansson <ulf.hansson@linaro.org> |
mmc: core: Remove redundant __mmc_send_status() There are only one users left which calls __mmc_send_status(). Moreover, the ignore_crc parameter isn't being used, so let's just remove t
mmc: core: Remove redundant __mmc_send_status() There are only one users left which calls __mmc_send_status(). Moreover, the ignore_crc parameter isn't being used, so let's just remove these redundant parts. Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org> Tested-by: Linus Walleij <linus.walleij@linaro.org> Acked-by: Adrian Hunter <adrian.hunter@intel.com>
show more ...
|
#
437590a1 |
| 08-Nov-2016 |
Ulf Hansson <ulf.hansson@linaro.org> |
mmc: core: Retry instead of ignore at CRC errors when polling for busy After a CMD6 command has been sent, the __mmc_switch() function might be advised to poll the card for busy by using
mmc: core: Retry instead of ignore at CRC errors when polling for busy After a CMD6 command has been sent, the __mmc_switch() function might be advised to poll the card for busy by using CMD13 and also by ignoring CRC errors. In the case of ignoring CRC errors, the mmc core tells the mmc host to also ignore these errors via masking the MMC_RSP_CRC response flag. This seems wrong, as it leads to that the mmc host could propagate an unreliable response, instead of a proper error code. What we really want, is not to ignore CRC errors but instead retry the polling attempt. So, let's change this by treating a CRC error as the card is still being busy and thus continue to run the polling loop. Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org> Tested-by: Linus Walleij <linus.walleij@linaro.org> Acked-by: Adrian Hunter <adrian.hunter@intel.com>
show more ...
|
Revision tags: v4.4.30, v4.4.29, v4.4.28, v4.4.27, v4.7.10, openbmc-4.4-20161021-1, v4.7.9, v4.4.26 |
|
#
70562644 |
| 19-Oct-2016 |
Ulf Hansson <ulf.hansson@linaro.org> |
mmc: core: Don't use ->card_busy() and CMD13 in combination when polling When polling for busy after sending a MMC_SWITCH command, both the optional ->card_busy() callback and CMD13 are
mmc: core: Don't use ->card_busy() and CMD13 in combination when polling When polling for busy after sending a MMC_SWITCH command, both the optional ->card_busy() callback and CMD13 are being used in conjunction. This doesn't make sense. Instead it's more reasonable to rely solely on the ->card_busy() callback when it exists. Let's change that and instead use the CMD13 as a fall-back. In this way we avoid sending CMD13, unless it's really needed. Within this context, let's also take the opportunity to make some additional clean-ups and clarifications to the related code. Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org> Acked-by: Jaehoon Chung <jh80.chung@samsung.com> Tested-by: Jaehoon Chung <jh80.chung@samsung.com>
show more ...
|
#
716bdb89 |
| 19-Oct-2016 |
Ulf Hansson <ulf.hansson@linaro.org> |
mmc: core: Factor out code related to polling in __mmc_switch() In yet another step of cleaning up __mmc_switch(), let's factor out the code that deals with card busy polling. S
mmc: core: Factor out code related to polling in __mmc_switch() In yet another step of cleaning up __mmc_switch(), let's factor out the code that deals with card busy polling. Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org> Acked-by: Jaehoon Chung <jh80.chung@samsung.com> Tested-by: Jaehoon Chung <jh80.chung@samsung.com>
show more ...
|
#
cb26ce06 |
| 19-Oct-2016 |
Ulf Hansson <ulf.hansson@linaro.org> |
mmc: core: Clarify code which deals with polling in __mmc_switch() The __mmc_switch() deserves a clean-up. In this step, let's move some code outside of the do-while loop, which deal dea
mmc: core: Clarify code which deals with polling in __mmc_switch() The __mmc_switch() deserves a clean-up. In this step, let's move some code outside of the do-while loop, which deal deals with the card busy polling. This change simplifies the code in that sense that it becomes easier to follow what is being executed during card busy polling, but it also gives a better understanding for when polling isn't done. Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org> Acked-by: Jaehoon Chung <jh80.chung@samsung.com> Tested-by: Jaehoon Chung <jh80.chung@samsung.com>
show more ...
|
#
20348d19 |
| 19-Oct-2016 |
Ulf Hansson <ulf.hansson@linaro.org> |
mmc: core: Make mmc_switch_status() available for mmc core Following changes needs mmc_switch_status() to be available both from mmc.c and mmc_ops.c. Allow that by moving its implementat
mmc: core: Make mmc_switch_status() available for mmc core Following changes needs mmc_switch_status() to be available both from mmc.c and mmc_ops.c. Allow that by moving its implementation to mmc_ops.c and make it available via mmc_ops.h. Moving mmc_switch_status() to mmc_ops.c, also enables us to turn mmc_switch_status_error() into static function. So let's take the opportunity to change this as well. Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org> Acked-by: Jaehoon Chung <jh80.chung@samsung.com> Tested-by: Jaehoon Chung <jh80.chung@samsung.com>
show more ...
|
Revision tags: v4.7.8, v4.4.25, v4.4.24, v4.7.7, v4.8, v4.4.23, v4.7.6, v4.7.5, v4.4.22, v4.4.21, v4.7.4, v4.7.3, v4.4.20, v4.7.2, v4.4.19, openbmc-4.4-20160819-1, v4.7.1, v4.4.18, v4.4.17, openbmc-4.4-20160804-1, v4.4.16, v4.7, openbmc-4.4-20160722-1, openbmc-20160722-1, openbmc-20160713-1, v4.4.15, v4.6.4, v4.6.3, v4.4.14, v4.6.2, v4.4.13, openbmc-20160606-1, v4.6.1, v4.4.12, openbmc-20160521-1 |
|
#
987aa5f8 |
| 19-May-2016 |
Chaotian Jing <chaotian.jing@mediatek.com> |
mmc: mmc: fix switch timeout issue caused by jiffies precision with CONFIG_HZ=100, the precision of jiffies is 10ms, and the generic_cmd6_time of some card is also 10ms. then, may be cur
mmc: mmc: fix switch timeout issue caused by jiffies precision with CONFIG_HZ=100, the precision of jiffies is 10ms, and the generic_cmd6_time of some card is also 10ms. then, may be current time is only 5ms, but already timed out caused by jiffies precision. Signed-off-by: Chaotian Jing <chaotian.jing@mediatek.com> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
show more ...
|
#
87a18a6a |
| 19-May-2016 |
Chaotian Jing <chaotian.jing@mediatek.com> |
mmc: mmc: Use ->card_busy() to detect busy cards in __mmc_switch() Some MMC hosts do not support MMC_CAP_WAIT_WHILE_BUSY, but implements the ->card_busy() callback. In such cases, extend
mmc: mmc: Use ->card_busy() to detect busy cards in __mmc_switch() Some MMC hosts do not support MMC_CAP_WAIT_WHILE_BUSY, but implements the ->card_busy() callback. In such cases, extend __mmc_switch() to use this method to check card status after switch command. Signed-off-by: Chaotian Jing <chaotian.jing@mediatek.com> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
show more ...
|
Revision tags: v4.4.11, openbmc-20160518-1, v4.6, v4.4.10, openbmc-20160511-1, openbmc-20160505-1, v4.4.9, v4.4.8, v4.4.7, openbmc-20160329-2, openbmc-20160329-1, openbmc-20160321-1, v4.4.6, v4.5, v4.4.5, v4.4.4, v4.4.3, openbmc-20160222-1, v4.4.2, openbmc-20160212-1, openbmc-20160210-1, openbmc-20160202-2, openbmc-20160202-1, v4.4.1, openbmc-20160127-1, openbmc-20160120-1, v4.4 |
|
#
0899e741 |
| 07-Jan-2016 |
Masahiro Yamada <yamada.masahiro@socionext.com> |
mmc: remove unnecessary assignment statements before return Variable assignment just before return is redundant. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com> S
mmc: remove unnecessary assignment statements before return Variable assignment just before return is redundant. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
show more ...
|
Revision tags: openbmc-20151217-1, openbmc-20151210-1, openbmc-20151202-1 |
|
#
3bbb0dee |
| 29-Nov-2015 |
Chaotian Jing <chaotian.jing@mediatek.com> |
mmc: core: fix __mmc_switch timeout caused by preempt there is a time window between __mmc_send_status() and time_afer(), on some eMMC chip, the timeout_ms is only 10ms, if this thread w
mmc: core: fix __mmc_switch timeout caused by preempt there is a time window between __mmc_send_status() and time_afer(), on some eMMC chip, the timeout_ms is only 10ms, if this thread was scheduled out during this period, then, even card has already changes to transfer state by the result of CMD13, this part of code also treat it to timeout error. So, need calculate timeout first, then call __mmc_send_status(), if already timeout and card still in programing state, then treat it to the real timeout error. Signed-off-by: Chaotian Jing <chaotian.jing@mediatek.com> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
show more ...
|
Revision tags: openbmc-20151123-1, openbmc-20151118-1, openbmc-20151104-1, v4.3, openbmc-20151102-1, openbmc-20151028-1 |
|
#
9979dbe5 |
| 27-Oct-2015 |
Chaotian Jing <chaotian.jing@mediatek.com> |
mmc: mmc: extend the mmc_send_tuning() The mmc_execute_tuning() has already prepared the opcode, there is no need to prepare it again at mmc_send_tuning(), and, there is a BUG of mmc
mmc: mmc: extend the mmc_send_tuning() The mmc_execute_tuning() has already prepared the opcode, there is no need to prepare it again at mmc_send_tuning(), and, there is a BUG of mmc_send_tuning() to determine the opcode by bus width, assume eMMC was running at HS200, 4bit mode, then the mmc_send_tuning() will overwrite the opcode from CMD21 to CMD19, then got error. in addition, extend an argument of "cmd_error" to allow getting if there was cmd error when tune response. Signed-off-by: Chaotian Jing <chaotian.jing@mediatek.com> [Ulf: Rebased patch] Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
show more ...
|
#
f90d2e40 |
| 15-Sep-2015 |
Ulf Hansson <ulf.hansson@linaro.org> |
mmc: core: Convert __mmc_switch() into an internal core function As there are no users of the __mmc_switch() API, except for the mmc core itself, let's convert it from an exported functi
mmc: core: Convert __mmc_switch() into an internal core function As there are no users of the __mmc_switch() API, except for the mmc core itself, let's convert it from an exported function into an internal. Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
show more ...
|
Revision tags: v4.3-rc1, v4.2, v4.2-rc8, v4.2-rc7, v4.2-rc6, v4.2-rc5, v4.2-rc4, v4.2-rc3, v4.2-rc2, v4.2-rc1, v4.1, v4.1-rc8, v4.1-rc7, v4.1-rc6, v4.1-rc5, v4.1-rc4, v4.1-rc3 |
|
#
ed16f58d |
| 07-May-2015 |
Adrian Hunter <adrian.hunter@intel.com> |
mmc: core: Separate out the mmc_switch status check so it can be re-used Make a separate function to do the mmc_switch status check so it can be re-used. This is preparation for adding s
mmc: core: Separate out the mmc_switch status check so it can be re-used Make a separate function to do the mmc_switch status check so it can be re-used. This is preparation for adding support for HS400 re-tuning. Signed-off-by: Adrian Hunter <adrian.hunter@intel.com> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
show more ...
|
#
c6dbab9c |
| 07-May-2015 |
Adrian Hunter <adrian.hunter@intel.com> |
mmc: core: Hold re-tuning during switch commands Hold re-tuning during switch commands to prevent it from conflicting with the busy state or the CMD13 verification. Signed-o
mmc: core: Hold re-tuning during switch commands Hold re-tuning during switch commands to prevent it from conflicting with the busy state or the CMD13 verification. Signed-off-by: Adrian Hunter <adrian.hunter@intel.com> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
show more ...
|
Revision tags: v4.1-rc2, v4.1-rc1, v4.0, v4.0-rc7, v4.0-rc6, v4.0-rc5, v4.0-rc4, v4.0-rc3, v4.0-rc2, v4.0-rc1, v3.19, v3.19-rc7, v3.19-rc6, v3.19-rc5, v3.19-rc4, v3.19-rc3, v3.19-rc2, v3.19-rc1, v3.18 |
|
#
04cdbbfa |
| 01-Dec-2014 |
Ulf Hansson <ulf.hansson@linaro.org> |
mmc: core: Make tuning block patterns static Since previous patches removed the need for the tuning block patterns to be exported, let's move them close to the mmc_send_tuning() API.
mmc: core: Make tuning block patterns static Since previous patches removed the need for the tuning block patterns to be exported, let's move them close to the mmc_send_tuning() API. Those are now intended to be used only by the mmc core. Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org> Reviewed-by: Stephen Boyd <sboyd@codeaurora.org> Acked-by: Jaehoon Chung <jh80.chung@samsung.com>
show more ...
|
#
fe5afb13d |
| 05-Dec-2014 |
Ulf Hansson <ulf.hansson@linaro.org> |
mmc: core: Let mmc_send_tuning() to take struct mmc_host* as parameter To be able to use mmc_send_tuning() prior the struct mmc_card has been allocated, let's convert it to take the stru
mmc: core: Let mmc_send_tuning() to take struct mmc_host* as parameter To be able to use mmc_send_tuning() prior the struct mmc_card has been allocated, let's convert it to take the struct mmc_host* as parameter instead. Suggested-by: Stephen Boyd <sboyd@codeaurora.org> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org> Acked-by: Dong Aisheng <b29396@freescale.com> Reviewed-by: Stephen Boyd <sboyd@codeaurora.org>
show more ...
|
Revision tags: v3.18-rc7 |
|
#
996903de |
| 25-Nov-2014 |
Minda Chen <Minda.Chen@csr.com> |
mmc: core: add core-level function for sending tuning commands According to the SD card spec, Add a manual tuning command function for SDR104/HS200. Sending command 19 or command 21
mmc: core: add core-level function for sending tuning commands According to the SD card spec, Add a manual tuning command function for SDR104/HS200. Sending command 19 or command 21 to read data and compare with the tunning block pattern. This patch will help to decrease some platform private codes in SDHCI platform_execute_tuning() callbacks. Signed-off-by: Minda Chen <Minda.Chen@csr.com> Signed-off-by: Barry Song <Baohua.Song@csr.com> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
show more ...
|
Revision tags: v3.18-rc6, v3.18-rc5, v3.18-rc4, v3.18-rc3, v3.18-rc2, v3.18-rc1 |
|
#
22b78700 |
| 17-Oct-2014 |
Ulf Hansson <ulf.hansson@linaro.org> |
mmc: core: Convert to use kzalloc() for CXD register buffers While allocating buffers for CXD data, let's use kzalloc() to make sure those are zeroed. Signed-off-by: Ulf Hansson
mmc: core: Convert to use kzalloc() for CXD register buffers While allocating buffers for CXD data, let's use kzalloc() to make sure those are zeroed. Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
show more ...
|
#
601ed60c |
| 17-Oct-2014 |
Ulf Hansson <ulf.hansson@linaro.org> |
mmc: core: Don't handle buffers on stack while fetching CXD registers Due to previous patches, all callers of mmc_send_cxd_data() now allocates their buffers from the heap. This enables
mmc: core: Don't handle buffers on stack while fetching CXD registers Due to previous patches, all callers of mmc_send_cxd_data() now allocates their buffers from the heap. This enables us to simplify mmc_send_cxd_data() by removing the support of handling buffers, which are allocated from the stack. Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
show more ...
|
#
2fc91e8b |
| 17-Oct-2014 |
Ulf Hansson <ulf.hansson@linaro.org> |
mmc: core: Remove the redundant mmc_send_ext_csd() API Previous patches has replaced the calls to mmc_send_ext_csd() into mmc_get_ext_csd(), thus mmc_send_ext_csd() has become redundant.
mmc: core: Remove the redundant mmc_send_ext_csd() API Previous patches has replaced the calls to mmc_send_ext_csd() into mmc_get_ext_csd(), thus mmc_send_ext_csd() has become redundant. Let's remove it. Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
show more ...
|
#
e21aa519 |
| 17-Oct-2014 |
Ulf Hansson <ulf.hansson@linaro.org> |
mmc: core: Export mmc_get_ext_csd() Callers of mmc_send_ext_csd() will be able to decrease code duplication by using mmc_get_ext_csd() instead. Let's make it available. Signed-o
mmc: core: Export mmc_get_ext_csd() Callers of mmc_send_ext_csd() will be able to decrease code duplication by using mmc_get_ext_csd() instead. Let's make it available. Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
show more ...
|
#
148bcab2 |
| 20-Oct-2014 |
Ulf Hansson <ulf.hansson@linaro.org> |
mmc: core: Add helper function for EXT_CSD support The helper function mmc_can_ext_csd() will return a positive value if the card supports the EXT_CSD register. Start using it at relavan
mmc: core: Add helper function for EXT_CSD support The helper function mmc_can_ext_csd() will return a positive value if the card supports the EXT_CSD register. Start using it at relavant places in the mmc core. Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
show more ...
|
Revision tags: v3.17, v3.17-rc7, v3.17-rc6, v3.17-rc5 |
|
#
6606110d |
| 12-Sep-2014 |
Joe Perches <joe@perches.com> |
mmc: Convert pr_warning to pr_warn Use the much more common pr_warn instead of pr_warning. Other miscellanea: o Coalesce formats o Realign arguments o Remove extra
mmc: Convert pr_warning to pr_warn Use the much more common pr_warn instead of pr_warning. Other miscellanea: o Coalesce formats o Realign arguments o Remove extra spaces when coalescing formats Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
show more ...
|