From patchwork Thu Jun 23 10:40:26 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adrian Hunter X-Patchwork-Id: 908582 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.4) with ESMTP id p5NAf5J8031252 for ; Thu, 23 Jun 2011 10:41:13 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1759203Ab1FWKlM (ORCPT ); Thu, 23 Jun 2011 06:41:12 -0400 Received: from mga09.intel.com ([134.134.136.24]:21043 "EHLO mga09.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1759157Ab1FWKlM (ORCPT ); Thu, 23 Jun 2011 06:41:12 -0400 Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga102.jf.intel.com with ESMTP; 23 Jun 2011 03:41:11 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.65,412,1304319600"; d="scan'208";a="18730899" Received: from unknown (HELO ahunter-desktop.localhost.com) ([10.255.17.28]) by orsmga001.jf.intel.com with ESMTP; 23 Jun 2011 03:41:09 -0700 From: Adrian Hunter To: Chris Ball Cc: linux-mmc , Adrian Hunter , Andrei Warkentin Subject: [PATCH 1/4] mmc: block: switch card to User Data Area when removing the block driver Date: Thu, 23 Jun 2011 13:40:26 +0300 Message-Id: <1308825629-27375-2-git-send-email-adrian.hunter@intel.com> X-Mailer: git-send-email 1.7.4.4 In-Reply-To: <1308825629-27375-1-git-send-email-adrian.hunter@intel.com> References: <1308825629-27375-1-git-send-email-adrian.hunter@intel.com> Organization: Intel Finland Oy, Registered Address: PL 281, 00181 Helsinki, Business Identity Code: 0357606 - 4, Domiciled in Helsinki Sender: linux-mmc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mmc@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Thu, 23 Jun 2011 10:41:13 +0000 (UTC) The MMC block driver and other drivers (e.g. mmc-test) will expect the card to be switched to the User Data Area eMMC partition when they start. Hence the MMC block driver should ensure it is that way when it is removed. Signed-off-by: Adrian Hunter Cc: Andrei Warkentin --- drivers/mmc/card/block.c | 3 +++ 1 files changed, 3 insertions(+), 0 deletions(-) diff --git a/drivers/mmc/card/block.c b/drivers/mmc/card/block.c index e5d1c8a..d36b7ea 100644 --- a/drivers/mmc/card/block.c +++ b/drivers/mmc/card/block.c @@ -1440,6 +1440,9 @@ static void mmc_blk_remove(struct mmc_card *card) struct mmc_blk_data *md = mmc_get_drvdata(card); mmc_blk_remove_parts(card, md); + mmc_claim_host(card->host); + mmc_blk_part_switch(card, md); + mmc_release_host(card->host); mmc_blk_remove_req(md); mmc_set_drvdata(card, NULL); }