Re: [PATCH 3/6] mmc: It is not an error for the card to be removed while suspended

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 25/09/2014 11:27 a.m., Ulf Hansson wrote:
On 23 September 2014 22:00, Adrian Hunter <adrian.hunter@xxxxxxxxx> wrote:
A removable card can be removed while it is runtime suspended.
Do not print an error message.

Signed-off-by: Adrian Hunter <adrian.hunter@xxxxxxxxx>
---
  drivers/mmc/core/mmc.c | 2 +-
  drivers/mmc/core/sd.c  | 2 +-
  2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/mmc/core/mmc.c b/drivers/mmc/core/mmc.c
index ce11d89..1d827eb 100644
--- a/drivers/mmc/core/mmc.c
+++ b/drivers/mmc/core/mmc.c
@@ -1804,7 +1804,7 @@ static int mmc_runtime_resume(struct mmc_host *host)
                 return 0;

         err = _mmc_resume(host);
-       if (err)
+       if (err && (err != -ENOMEDIUM || (host->caps & MMC_CAP_NONREMOVABLE)))

The check for NONREMOVABLE cap shouldn't be needed!? I mean -ENOMEDIUM
can't be set for such devices anyway.

So it would be a bug if it did return -ENOMEDIUM so we should
definitely print the error message, which is what the code does.


                 pr_err("%s: error %d doing aggessive resume\n",
                         mmc_hostname(host), err);

diff --git a/drivers/mmc/core/sd.c b/drivers/mmc/core/sd.c
index 2591388..28089b3 100644
--- a/drivers/mmc/core/sd.c
+++ b/drivers/mmc/core/sd.c
@@ -1178,7 +1178,7 @@ static int mmc_sd_runtime_resume(struct mmc_host *host)
                 return 0;

         err = _mmc_sd_resume(host);
-       if (err)
+       if (err && (err != -ENOMEDIUM || (host->caps & MMC_CAP_NONREMOVABLE)))

Same comment as above.

                 pr_err("%s: error %d doing aggessive resume\n",
                         mmc_hostname(host), err);

--
1.8.3.2


Kind regards
Uffe

--
To unsubscribe from this list: send the line "unsubscribe linux-mmc" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux USB Devel]     [Linux Media]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux