[PATCH 2/2] Proper MMC command classes support

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

 



Removes the check for high command classes and instead checks that the
command classes needed are present.
Previous solution killed forward compatibility at no apparent gain.

Signed-of-by: Pierre Ossman <[email protected]>

This patch only checks for CCC_BLOCK_READ even though CCC_BLOCK_WRITE is
also needed. My intention is to make the card read-only if the write
command class is unavailable. But such a patch will conflict with the SD
patches previously submitted. So I need to know which version should be
used as a base.

Index: linux-wbsd/drivers/mmc/mmc_block.c
===================================================================
--- linux-wbsd/drivers/mmc/mmc_block.c	(revision 134)
+++ linux-wbsd/drivers/mmc/mmc_block.c	(working copy)
@@ -443,7 +443,10 @@
 	struct mmc_blk_data *md;
 	int err;
 
-	if (card->csd.cmdclass & ~0x1ff)
+	/*
+	 * Check that the card supports the command class(es) we need.
+	 */
+	if (!(card->csd.cmdclass & CCC_BLOCK_READ))
 		return -ENODEV;
 
 	if (card->csd.read_blkbits < 9) {

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux