From patchwork Thu Jul 5 21:06:13 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Drake X-Patchwork-Id: 1162251 Return-Path: X-Original-To: patchwork-linux-mmc@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id E8D0840B05 for ; Thu, 5 Jul 2012 21:06:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751536Ab2GEVGf (ORCPT ); Thu, 5 Jul 2012 17:06:35 -0400 Received: from mtaout02-winn.ispmail.ntl.com ([81.103.221.48]:39418 "EHLO mtaout02-winn.ispmail.ntl.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751974Ab2GEVGe (ORCPT ); Thu, 5 Jul 2012 17:06:34 -0400 Received: from aamtaout02-winn.ispmail.ntl.com ([81.103.221.35]) by mtaout02-winn.ispmail.ntl.com (InterMail vM.7.08.04.00 201-2186-134-20080326) with ESMTP id <20120705210618.OFQC14795.mtaout02-winn.ispmail.ntl.com@aamtaout02-winn.ispmail.ntl.com>; Thu, 5 Jul 2012 22:06:18 +0100 Received: from zog.reactivated.net ([86.14.215.141]) by aamtaout02-winn.ispmail.ntl.com (InterMail vG.3.00.04.00 201-2196-133-20080908) with ESMTP id <20120705210616.NSDF3795.aamtaout02-winn.ispmail.ntl.com@zog.reactivated.net>; Thu, 5 Jul 2012 22:06:16 +0100 Received: by zog.reactivated.net (Postfix, from userid 1000) id 8B3F89D401E; Thu, 5 Jul 2012 22:06:13 +0100 (BST) From: Daniel Drake To: cjb@laptop.org Cc: linux-mmc@vger.kernel.org Subject: [PATCH] sdhci: poll for card even when card is logically unremovable Message-Id: <20120705210613.8B3F89D401E@zog.reactivated.net> Date: Thu, 5 Jul 2012 22:06:13 +0100 (BST) X-Cloudmark-Analysis: v=1.1 cv=R50lirqlHffDPPkwUlkuVa99MrvKdVWo//yz83qex8g= c=1 sm=0 a=OAkOnnzUjIAA:10 a=vJ1w_8FsMGIA:10 a=Op-mwl0xAAAA:8 a=hmXyiGsmy-ABnsSdHdsA:9 a=d4CUUju0HPYA:10 a=HpAAvcLHHh0Zw7uRqdWCyQ==:117 Sender: linux-mmc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mmc@vger.kernel.org The Marvell CaFe is now marked as having bad card detection to fix a problem during system resume. Now on the OLPC XO-1 we are facing the issue that the card is marked as logically unremovable (via MMC_UNSAFE_RESUME), which means that mmc_card_is_removable considers the card non-removable. The existing code logic decides not to poll for card presence in this case, and card detection is also disabled because of the quirk being set. This means that no SD cards are detected when inserted after boot. Refine the logic to enable card presence polling in the case when a card is logically unremovable, only avoiding the poll in the case when the card is physically non-removable (denoted with MMC_CAP_NONREMOVABLE). Signed-off-by: Daniel Drake --- drivers/mmc/host/sdhci.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c index f4b8b4d..dd71a05 100644 --- a/drivers/mmc/host/sdhci.c +++ b/drivers/mmc/host/sdhci.c @@ -2779,7 +2779,7 @@ int sdhci_add_host(struct sdhci_host *host) mmc->caps |= MMC_CAP_SD_HIGHSPEED | MMC_CAP_MMC_HIGHSPEED; if ((host->quirks & SDHCI_QUIRK_BROKEN_CARD_DETECTION) && - mmc_card_is_removable(mmc)) + !(host->mmc->caps & MMC_CAP_NONREMOVABLE)) mmc->caps |= MMC_CAP_NEEDS_POLL; /* Any UHS-I mode in caps implies SDR12 and SDR25 support. */