drivers/mmc/core/block.c | 2 +- drivers/mmc/core/core.c | 30 +++++++++ drivers/mmc/core/core.h | 2 + drivers/mmc/core/mmc.c | 127 +++++++++++++++++++++++++++++------ drivers/mmc/core/queue.c | 2 +- drivers/mmc/core/regulator.c | 124 ++++++++++++++++++++++++++++++++++ include/linux/mmc/host.h | 8 +++ 7 files changed, 274 insertions(+), 21 deletions(-)
changes v4:
- drop HPI and SDHCI related patches
This patch set introduces a framework for handling undervoltage events
in the MMC subsystem. The goal is to improve system reliability by
ensuring graceful handling of power fluctuations that could otherwise
lead to metadata corruption, potentially rendering the eMMC chip
unusable or causing significant data loss.
## Problem Statement
Power fluctuations and sudden losses can leave eMMC devices in an
undefined state, leading to severe consequences. The worst case can
result in metadata corruption, making the entire storage inaccessible.
While some eMMC devices promise to handle such situations internally,
experience shows that some chip variants are still affected. This has
led vendors to take a more protective approach, implementing external
undervoltage handling as a precautionary measure to avoid costly field
failures and returns.
The existence of the "Power Off Notification" feature in the eMMC
standard itself serves as indirect evidence that this is a real-world
issue. While some projects have already faced the consequences of
ignoring this problem (often at significant cost), specific cases cannot
be disclosed due to NDAs.
## Challenges and Implementation Approach
1. **Raising awareness of the problem**: While vendors have used
proprietary solutions for years, a unified approach is needed upstream.
This patch set is a first step in making that happen.
2. **Finding an acceptable implementation path**: There are multiple
ways to handle undervoltage - either in the kernel or in user space,
through a global shutdown mechanism, or using the regulator framework.
This patch set takes the kernel-based approach but does not prevent
future extensions, such as allowing user-space handoff once available.
3. **Preparing for vendor adoption and testing**: By providing a
structured solution upstream, this patch set lowers the barrier for
vendors to standardize their undervoltage handling instead of relying on
fragmented, out-of-tree implementations.
## Current Limitations
This patch set is an initial step and does not yet cover all possible
design restrictions or edge cases. Future improvements may include
better coordination with user space and enhancements based on broader
testing.
## Testing Details
The implementation was tested on an iMX8MP-based system. The board had
approximately 100ms of available power hold-up time. The Power Off
Notification was sent ~4ms after the board was detached from the power
supply, allowing sufficient time for the eMMC to handle the event
properly. Tests were conducted under both idle conditions and active
read/write operations.
Oleksij Rempel (4):
mmc: core: Handle undervoltage events and register regulator notifiers
mmc: core: refactor _mmc_suspend() for undervoltage handling
mmc: core: add undervoltage handler for MMC/eMMC devices
mmc: block: abort requests and suppress errors after undervoltage
shutdown
drivers/mmc/core/block.c | 2 +-
drivers/mmc/core/core.c | 30 +++++++++
drivers/mmc/core/core.h | 2 +
drivers/mmc/core/mmc.c | 127 +++++++++++++++++++++++++++++------
drivers/mmc/core/queue.c | 2 +-
drivers/mmc/core/regulator.c | 124 ++++++++++++++++++++++++++++++++++
include/linux/mmc/host.h | 8 +++
7 files changed, 274 insertions(+), 21 deletions(-)
--
2.39.5
Hi Oleksij, On Mon, 10 Mar 2025 at 11:22, Oleksij Rempel <o.rempel@pengutronix.de> wrote: > > changes v4: > - drop HPI and SDHCI related patches > > This patch set introduces a framework for handling undervoltage events > in the MMC subsystem. The goal is to improve system reliability by > ensuring graceful handling of power fluctuations that could otherwise > lead to metadata corruption, potentially rendering the eMMC chip > unusable or causing significant data loss. Thanks for posting this! I will spend some time reviewing this next week and let you know my comments then. However, I just wanted to let you know that I just posted a series [1] (forgot to cc you, sorry), which also reworks the way _mmc_suspend() understands what scenario it should be running. I am guessing that re-work is simplifying for your $subject series too. Maybe you would like to have a look? Kind regards Uffe [1] https://lore.kernel.org/all/20250320140040.162416-1-ulf.hansson@linaro.org/ > > ## Problem Statement > > Power fluctuations and sudden losses can leave eMMC devices in an > undefined state, leading to severe consequences. The worst case can > result in metadata corruption, making the entire storage inaccessible. > While some eMMC devices promise to handle such situations internally, > experience shows that some chip variants are still affected. This has > led vendors to take a more protective approach, implementing external > undervoltage handling as a precautionary measure to avoid costly field > failures and returns. > > The existence of the "Power Off Notification" feature in the eMMC > standard itself serves as indirect evidence that this is a real-world > issue. While some projects have already faced the consequences of > ignoring this problem (often at significant cost), specific cases cannot > be disclosed due to NDAs. > > ## Challenges and Implementation Approach > > 1. **Raising awareness of the problem**: While vendors have used > proprietary solutions for years, a unified approach is needed upstream. > This patch set is a first step in making that happen. > > 2. **Finding an acceptable implementation path**: There are multiple > ways to handle undervoltage - either in the kernel or in user space, > through a global shutdown mechanism, or using the regulator framework. > This patch set takes the kernel-based approach but does not prevent > future extensions, such as allowing user-space handoff once available. > > 3. **Preparing for vendor adoption and testing**: By providing a > structured solution upstream, this patch set lowers the barrier for > vendors to standardize their undervoltage handling instead of relying on > fragmented, out-of-tree implementations. > > ## Current Limitations > > This patch set is an initial step and does not yet cover all possible > design restrictions or edge cases. Future improvements may include > better coordination with user space and enhancements based on broader > testing. > > ## Testing Details > > The implementation was tested on an iMX8MP-based system. The board had > approximately 100ms of available power hold-up time. The Power Off > Notification was sent ~4ms after the board was detached from the power > supply, allowing sufficient time for the eMMC to handle the event > properly. Tests were conducted under both idle conditions and active > read/write operations. > > Oleksij Rempel (4): > mmc: core: Handle undervoltage events and register regulator notifiers > mmc: core: refactor _mmc_suspend() for undervoltage handling > mmc: core: add undervoltage handler for MMC/eMMC devices > mmc: block: abort requests and suppress errors after undervoltage > shutdown > > drivers/mmc/core/block.c | 2 +- > drivers/mmc/core/core.c | 30 +++++++++ > drivers/mmc/core/core.h | 2 + > drivers/mmc/core/mmc.c | 127 +++++++++++++++++++++++++++++------ > drivers/mmc/core/queue.c | 2 +- > drivers/mmc/core/regulator.c | 124 ++++++++++++++++++++++++++++++++++ > include/linux/mmc/host.h | 8 +++ > 7 files changed, 274 insertions(+), 21 deletions(-) > > -- > 2.39.5 >
Hi Ulf, Sorry for very late replay, On Thu, Mar 20, 2025 at 03:36:32PM +0100, Ulf Hansson wrote: > Hi Oleksij, > > On Mon, 10 Mar 2025 at 11:22, Oleksij Rempel <o.rempel@pengutronix.de> wrote: > > > > changes v4: > > - drop HPI and SDHCI related patches > > > > This patch set introduces a framework for handling undervoltage events > > in the MMC subsystem. The goal is to improve system reliability by > > ensuring graceful handling of power fluctuations that could otherwise > > lead to metadata corruption, potentially rendering the eMMC chip > > unusable or causing significant data loss. > > Thanks for posting this! I will spend some time reviewing this next > week and let you know my comments then. > > However, I just wanted to let you know that I just posted a series [1] > (forgot to cc you, sorry), which also reworks the way _mmc_suspend() > understands what scenario it should be running. I am guessing that > re-work is simplifying for your $subject series too. Maybe you would > like to have a look? Ah, very nice. The integration of undervoltage support is easier now. I rebased by match on top of mmc/next branch and do some testing tomorrow. If you have no other comments I'll send updated patches after testing. By the way, are you on embedded recipes this year? Best Regards, Oleksij -- Pengutronix e.K. | | Steuerwalder Str. 21 | http://www.pengutronix.de/ | 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
On Mon, 5 May 2025 at 14:48, Oleksij Rempel <o.rempel@pengutronix.de> wrote: > > Hi Ulf, > > Sorry for very late replay, > > On Thu, Mar 20, 2025 at 03:36:32PM +0100, Ulf Hansson wrote: > > Hi Oleksij, > > > > On Mon, 10 Mar 2025 at 11:22, Oleksij Rempel <o.rempel@pengutronix.de> wrote: > > > > > > changes v4: > > > - drop HPI and SDHCI related patches > > > > > > This patch set introduces a framework for handling undervoltage events > > > in the MMC subsystem. The goal is to improve system reliability by > > > ensuring graceful handling of power fluctuations that could otherwise > > > lead to metadata corruption, potentially rendering the eMMC chip > > > unusable or causing significant data loss. > > > > Thanks for posting this! I will spend some time reviewing this next > > week and let you know my comments then. > > > > However, I just wanted to let you know that I just posted a series [1] > > (forgot to cc you, sorry), which also reworks the way _mmc_suspend() > > understands what scenario it should be running. I am guessing that > > re-work is simplifying for your $subject series too. Maybe you would > > like to have a look? > > Ah, very nice. The integration of undervoltage support is easier now. > > I rebased by match on top of mmc/next branch and do some testing > tomorrow. If you have no other comments I'll send updated patches after > testing. That's great! I have started to review the series in more detail, but feel free to post a new version, I can look at that instead. > > By the way, are you on embedded recipes this year? Unfortunately not. Linaro Connect in Lisbon clashes with these dates. Kind regards Uffe
© 2016 - 2026 Red Hat, Inc.