Skip to content

Commit

Permalink
mmc: skip detection of nonremovable cards on rescan
Browse files Browse the repository at this point in the history
mmc_rescan() checks whether registered cards are still present before
skipping them, by calling the bus-specific ->detect() handler.

With buses that support runtime PM, the card may be powered off at
this point, so they need to be powered on and fully reinitialized before
->detect() executes.

This whole process is redundant with nonremovable cards; in those cases,
we can safely skip calling ->detect() and implicitly assume its success.

Signed-off-by: Ohad Ben-Cohen <ohad@wizery.com>
Reviewed-by: Chris Ball <cjb@laptop.org>
Signed-off-by: Chris Ball <cjb@laptop.org>
  • Loading branch information
Ohad Ben-Cohen authored and Chris Ball committed Jan 9, 2011
1 parent 8f230f4 commit 30201e7
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions drivers/mmc/core/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -1506,8 +1506,12 @@ void mmc_rescan(struct work_struct *work)

mmc_bus_get(host);

/* if there is a card registered, check whether it is still present */
if ((host->bus_ops != NULL) && host->bus_ops->detect && !host->bus_dead)
/*
* if there is a _removable_ card registered, check whether it is
* still present
*/
if (host->bus_ops && host->bus_ops->detect && !host->bus_dead
&& mmc_card_is_removable(host))
host->bus_ops->detect(host);

mmc_bus_put(host);
Expand Down

0 comments on commit 30201e7

Please sign in to comment.