lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Tue, 30 Oct 2012 17:30:02 +0800
From:	yongd <yongd@...vell.com>
To:	Chris Ball <cjb@...top.org>,
	Anton Vorontsov <anton.vorontsov@...aro.org>,
	Marek Szyprowski <m.szyprowski@...sung.com>,
	Shawn Guo <shawn.guo@...aro.org>,
	Wolfram Sang <w.sang@...gutronix.de>,
	Daniel Drake <dsd@...top.org>,
	Sascha Hauer <s.hauer@...gutronix.de>,
	Wilson Callan <wilson.callan@...antsystems.com>,
	Ben Dooks <ben-linux@...ff.org>
Cc:	zhangfei.gao@...vell.com, kevin.liu@...vell.com,
	linux-mmc@...r.kernel.org, linux-kernel@...r.kernel.org,
	yongd <yongd@...vell.com>
Subject: [PATCH V2 2/3] mmc: sdhci-s3c: enable polling to detect card by itself

SDHCI_QUIRK_BROKEN_CARD_DETECTION is used to disable host internal
card detection method. So it should be set for all card detection types
except S3C_SDHCI_CD_INTERNAL, or host internal card detection interrupts
will be redundantly enabled. So, the 1st change of this patch expands such
flag setting.

Moreover, we need move further after the above change.

In the current code logic, sdhci_add_host() will enable the polling method
(set MMC_CAP_NEEDS_POLL) for a removable card (MMC_CAP_NONREMOVABLE is not
set) whose host's internal card detection method is disabled.

Apparently, this is arbitrary since we can have some other detection types.
As a result, sdhci_add_host() will redundantly enable polling for a card with
S3C_SDHCI_CD_GPIO/S3C_SDHCI_CD_EXTERNAL type.

So, we plan to remove such improper setting in sdhci_add_host(). But
before this, this 2nd change of this patch is a MUST, which enables polling
in host driver itself for S3C_SDHCI_CD_NONE type. Currently, we rely on the
above improper logic for this.

Change-Id: I28bd6765e6c6a9dd6c288ff4ca6ecf7268a2d8ed
Signed-off-by: yongd <yongd@...vell.com>
---
 drivers/mmc/host/sdhci-s3c.c |    6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/mmc/host/sdhci-s3c.c b/drivers/mmc/host/sdhci-s3c.c
index a093e2e..a669616 100644
--- a/drivers/mmc/host/sdhci-s3c.c
+++ b/drivers/mmc/host/sdhci-s3c.c
@@ -683,10 +683,12 @@ static int __devinit sdhci_s3c_probe(struct platform_device *pdev)
 	/* Samsung SoCs need BROKEN_ADMA_ZEROLEN_DESC */
 	host->quirks |= SDHCI_QUIRK_BROKEN_ADMA_ZEROLEN_DESC;
 
-	if (pdata->cd_type == S3C_SDHCI_CD_NONE ||
-	    pdata->cd_type == S3C_SDHCI_CD_PERMANENT)
+	if (pdata->cd_type != S3C_SDHCI_CD_INTERNAL)
 		host->quirks |= SDHCI_QUIRK_BROKEN_CARD_DETECTION;
 
+	if (pdata->cd_type == S3C_SDHCI_CD_NONE)
+		host->mmc->caps = MMC_CAP_NEEDS_POLL;
+
 	if (pdata->cd_type == S3C_SDHCI_CD_PERMANENT)
 		host->mmc->caps = MMC_CAP_NONREMOVABLE;
 
-- 
1.7.9.5

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ