History log of /openbmc/linux/drivers/mmc/core/mmc_ops.c (Results 51 – 75 of 240)
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
Revision tags: v4.12
# 0796e439 08-Jun-2017 Ulf Hansson <ulf.hansson@linaro.org>

mmc: core: Clarify code for sending CSD

To make the code more consistent and to increase readability, add an
mmc_spi_send_csd() function, which gets called from mmc_send_csd() in case
of SPI mode.

mmc: core: Clarify code for sending CSD

To make the code more consistent and to increase readability, add an
mmc_spi_send_csd() function, which gets called from mmc_send_csd() in case
of SPI mode.

Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Reviewed-by: Shawn Lin <shawn.lin@rock-chips.com>

show more ...


# c92e68d8 08-Jun-2017 Ulf Hansson <ulf.hansson@linaro.org>

mmc: core: Drop mmc_all_send_cid() and use mmc_send_cxd_native() instead

Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Reviewed-by: Shawn

mmc: core: Drop mmc_all_send_cid() and use mmc_send_cxd_native() instead

Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Reviewed-by: Shawn Lin <shawn.lin@rock-chips.com>

show more ...


# a1473732 08-Jun-2017 Ulf Hansson <ulf.hansson@linaro.org>

mmc: core: Re-factor code for sending CID

Instead of having the caller to check for SPI mode, let's leave that to
internals of mmc_send_cid(). In this way the code gets cleaner and it
becomes clear

mmc: core: Re-factor code for sending CID

Instead of having the caller to check for SPI mode, let's leave that to
internals of mmc_send_cid(). In this way the code gets cleaner and it
becomes clear what is specific to SPI and non-SPI mode.

Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Reviewed-by: Shawn Lin <shawn.lin@rock-chips.com>

show more ...


# 3df66e77 08-Jun-2017 Ulf Hansson <ulf.hansson@linaro.org>

mmc: core: Remove redundant code in mmc_send_cid()

The mmc_send_cid() is never called using non SPI mode. Thus, let's remove
the redundant code dealing with this.

Signed-off-by: Ulf Hansson <ulf.ha

mmc: core: Remove redundant code in mmc_send_cid()

The mmc_send_cid() is never called using non SPI mode. Thus, let's remove
the redundant code dealing with this.

Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Reviewed-by: Shawn Lin <shawn.lin@rock-chips.com>

show more ...


# d9df1737 08-Jun-2017 Ulf Hansson <ulf.hansson@linaro.org>

mmc: core: Move mmc_flush_cache() from core.c to mmc_ops.c

The mmc_flush_cache() is a eMMC specific function, let's move it to
mmc_ops.c to make that clear.

Signed-off-by: Ulf Hansson <ulf.hansson@

mmc: core: Move mmc_flush_cache() from core.c to mmc_ops.c

The mmc_flush_cache() is a eMMC specific function, let's move it to
mmc_ops.c to make that clear.

Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Reviewed-by: Shawn Lin <shawn.lin@rock-chips.com>

show more ...


# 0f2c0512 08-Jun-2017 Ulf Hansson <ulf.hansson@linaro.org>

mmc: core: Move mmc_interrupt_hpi() from core.c to mmc_ops.c

The mmc_interrupt_hpi() is a eMMC specific function, let's move it to
mmc_ops.c to make that clear. The move also enables us to make
mmc_

mmc: core: Move mmc_interrupt_hpi() from core.c to mmc_ops.c

The mmc_interrupt_hpi() is a eMMC specific function, let's move it to
mmc_ops.c to make that clear. The move also enables us to make
mmc_send_hpi_cmd() static, so let's do that change as well.

Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Reviewed-by: Shawn Lin <shawn.lin@rock-chips.com>

show more ...


# 1cf8f7e5 09-Jun-2017 Ulf Hansson <ulf.hansson@linaro.org>

mmc: core: Move mmc bkops functions from core.c to mmc_ops.c

The mmc_start_bkops(), mmc_stop_bkops() and mmc_read_bkops_status()
functions are all specific to eMMCs. To make this clear, let's move t

mmc: core: Move mmc bkops functions from core.c to mmc_ops.c

The mmc_start_bkops(), mmc_stop_bkops() and mmc_read_bkops_status()
functions are all specific to eMMCs. To make this clear, let's move them
from from core.c to mmc_ops.c and take the opportunity to make
mmc_read_bkops_status() static.

While moving them, get rid of MMC_BKOPS_MAX_TIMEOUT (4 min) and use the
common default timeout MMC_OPS_TIMEOUT_MS (10 min) instead, as there is no
need to have specific default timeout for bkops.

Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Reviewed-by: Shawn Lin <shawn.lin@rock-chips.com>

show more ...


# 2185bc2c 22-May-2017 Ulf Hansson <ulf.hansson@linaro.org>

mmc: block: Use __mmc_send_status() and drop get_card_status()

The only reason to why the mmc block device driver needs to implements its
own version of how to get the status of the card, is that it

mmc: block: Use __mmc_send_status() and drop get_card_status()

The only reason to why the mmc block device driver needs to implements its
own version of how to get the status of the card, is that it needs to
specify a different amount of retries.

Therefore add a new exported function which allows the caller to specify
the number of retries and convert everybody to use it, as this simplifies
the code.

Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>

show more ...


Revision tags: v4.10.17, v4.10.16, v4.10.15, v4.10.14, v4.10.13, v4.10.12, v4.10.11, v4.10.10, v4.10.9
# 06c9ccb7 02-Apr-2017 Winkler, Tomas <tomas.winkler@intel.com>

mmc: core: add proper be32 annotation

Annotate big endian values correctly and make sparse happy.
In mmc_app_send_scr remove scr function parameter as it was
updating card->raw_scr anyway.

Signed-o

mmc: core: add proper be32 annotation

Annotate big endian values correctly and make sparse happy.
In mmc_app_send_scr remove scr function parameter as it was
updating card->raw_scr anyway.

Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>

show more ...


Revision tags: v4.10.8, v4.10.7, v4.10.6, v4.10.5, v4.10.4, v4.10.3
# b658af71 13-Mar-2017 Adrian Hunter <adrian.hunter@intel.com>

mmc: mmc: Add functions to enable / disable the Command Queue

Add helper functions to enable or disable the Command Queue.

Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
Reviewed-by: Linus

mmc: mmc: Add functions to enable / disable the Command Queue

Add helper functions to enable or disable the Command Queue.

Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>

show more ...


Revision tags: v4.10.2, v4.10.1, v4.10
# c7836d15 19-Dec-2016 Masahiro Yamada <yamada.masahiro@socionext.com>

mmc: use empty initializer list to zero-clear structures

In the MMC subsystem, we see such initializers that only clears the
first member explicitly.

For example,

struct mmc_request mrq = {NULL}

mmc: use empty initializer list to zero-clear structures

In the MMC subsystem, we see such initializers that only clears the
first member explicitly.

For example,

struct mmc_request mrq = {NULL};

sets the first member (.sbc) to NULL explicitly. However, this is
an unstable form because we may insert a non-pointer member at the
top of the struct mmc_request in the future. (if we do so, the
compiler will spit warnings.)

So, using a designated initializer is preferred coding style. The
expression above is equivalent to:

struct mmc_request mrq = { .sbc = NULL };

Of course, this does not express our intention. We want to fill
all struct members with zeros. Please note struct members are
implicitly zero-cleared unless otherwise specified in the initializer.

After all, the most reasonable (and stable) form is:

struct mmc_request mrq = {};

Do likewise for mmc_command, mmc_data as well.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>

show more ...


# ee6ff743 13-Jan-2017 Ulf Hansson <ulf.hansson@linaro.org>

mmc: core: Restore parts of the polling policy when switch to HS/HS DDR

Regressions for not being able to detect an eMMC HS DDR mode card has been
reported for the sdhci-esdhc-imx driver, but potent

mmc: core: Restore parts of the polling policy when switch to HS/HS DDR

Regressions for not being able to detect an eMMC HS DDR mode card has been
reported for the sdhci-esdhc-imx driver, but potentially other sdhci
variants may suffer from the similar problem.

The commit e173f8911f09 ("mmc: core: Update CMD13 polling policy when
switch to HS DDR mode"), is causing the problem. It seems that change moved
one step to far, regarding changing the host's timing before polling for a
busy card.

To fix this, let's move back to the behaviour when the host's timing is
updated after the polling, but before the switch status is fetched and
validated.

In cases when polling with CMD13, we keep validating the switch status at
each attempt. However, to align with the other card busy detections
mechanism, let's fetch and validate the switch status also after the host's
timing is updated.

Reported-by: Clemens Gruber <clemens.gruber@pqgruber.com>
Reported-by: Gary Bisson <gary.bisson@boundarydevices.com>
Fixes: e173f8911f09 ("mmc: core: Update CMD13 polling policy when switch..")
Cc: Shawn Lin <shawn.lin@rock-chips.com>
Cc: Dong Aisheng <aisheng.dong@nxp.com>
Cc: Haibo Chen <haibo.chen@nxp.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Tested-by: Clemens Gruber <clemens.gruber@pqgruber.com>
Tested-by: Jagan Teki <jagan@amarulasolutions.com>
Reviewed-by: Shawn Lin <shawn.lin@rock-chips.com>
Tested-by: Haibo Chen <haibo.chen@nxp.com>
Reviewed-by: Dong Aisheng <aisheng.dong@nxp.com>

show more ...


Revision tags: v4.9
# e711f030 02-Dec-2016 Adrian Hunter <adrian.hunter@intel.com>

mmc: mmc: Introduce mmc_abort_tuning()

If a tuning command times out, the card could still be processing it, which
will cause problems for recovery. The eMMC specification says that CMD12
can be use

mmc: mmc: Introduce mmc_abort_tuning()

If a tuning command times out, the card could still be processing it, which
will cause problems for recovery. The eMMC specification says that CMD12
can be used to stop CMD21, so add a function that does that.

Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>

show more ...


# ef3d2322 02-Dec-2016 Adrian Hunter <adrian.hunter@intel.com>

mmc: mmc: Relax checking for switch errors after HS200 switch

The JEDEC specification indicates CMD13 can be used after a HS200 switch
to check for errors. However in practice some boards experience

mmc: mmc: Relax checking for switch errors after HS200 switch

The JEDEC specification indicates CMD13 can be used after a HS200 switch
to check for errors. However in practice some boards experience CRC errors
in the CMD13 response. Consequently, for HS200, CRC errors are not a
reliable way to know the switch failed. If there really is a problem, we
would expect tuning will fail and the result ends up the same. So change
the error condition to ignore CRC errors in that case.

Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
Acked-by: Jaehoon Chung <jh80.chung@samsung.com>
Reviewed-by: Shawn Lin <shawn.lin@rock-chips.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>

show more ...


Revision tags: openbmc-4.4-20161121-1, v4.4.33, v4.4.32, v4.4.31
# 8cce3ecc 02-Nov-2016 Shawn Lin <shawn.lin@rock-chips.com>

mmc: core: remove BUG_ONs from mmc

BUG_ONs doesn't help anything except for stop the system from
running. If it occurs, it implies we should deploy proper error
handling for that. So this patch is g

mmc: core: remove BUG_ONs from mmc

BUG_ONs doesn't help anything except for stop the system from
running. If it occurs, it implies we should deploy proper error
handling for that. So this patch is gonna discard these meaningless
BUG_ONs and deploy error handling if needed.

Signed-off-by: Shawn Lin <shawn.lin@rock-chips.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>

show more ...


# aa33ce3c 09-Nov-2016 Ulf Hansson <ulf.hansson@linaro.org>

mmc: core: Enable __mmc_switch() to change bus speed timing for the host

In cases when a speed mode change is requested for mmc cards, a CMD6 is
sent by calling __mmc_switch() during the card initia

mmc: core: Enable __mmc_switch() to change bus speed timing for the host

In cases when a speed mode change is requested for mmc cards, a CMD6 is
sent by calling __mmc_switch() during the card initialization. The CMD6
leads to the card entering a busy period. When that is completed, the host
must parse the CMD6 status to find out whether the change of the speed mode
succeeded.

To enable the mmc core to poll the card by using CMD13 to find out when the
busy period is completed, it's reasonable to make sure polling is done by
having the mmc host and the mmc card, being configured to operate at the
same selected bus speed timing.

Therefore, let's extend __mmc_switch() to take yet another parameter, which
allow its callers to update the bus speed timing of the mmc host. In this
way, __mmc_switch() also becomes capable of reading and validating the CMD6
status by sending a CMD13, in cases when that's desired.

If __mmc_switch() encounters a failure, we make sure to restores the old
bus speed timing for the mmc host, before propagating the error code.

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 ...


# 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 bit which may

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_err to reflect

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 these
redunda

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 CMD13 and a

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 being used i

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.

Signed-off-by: Ulf Ha

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 deals with the

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 implementation to mmc_o

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 current
time is

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 ...


12345678910