Skip to contentSkip to conversation

MTD: SM_FTL: remove CONFIG_SM_FTL_MUSEUM and make it always on

PATCH In review Maxim Levitsky 1 participant 4 messages Mar 19, 2010 – Mar 24, 2010

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 MTD: SM_FTL: remove CONFIG_SM_FTL_MUSEUM and make it always on

The sole purpose of this settings was to avoid depedency on MTD_NAND. It seems that such configuration isn't well supported by Kconfig/is ugly to implement/I don't know how to do.

---
 drivers/mtd/Kconfig  |    9 ---------
 drivers/mtd/sm_ftl.c |    8 +-------
 2 files changed, 1 insertions(+), 16 deletions(-)
drivers/mtd/Kconfig +0 -9
index dbee14d..d90652f 100644
@@ -316,15 +316,6 @@ config SM_FTL
 	  eat your card, so please don't use it together with valuable data.
 	  Use readonly driver (CONFIG_SSFDC) instead.
 
-config SM_FTL_MUSEUM
-	boolean "Additional Support for 1MiB and 2MiB SmartMedia cards"
-	depends on SM_FTL
-	select MTD_NAND_ECC_SMC
-	help
-	  Very old SmartMedia cards need ECC to be calculated in the FTL.
-	  Such cards are very rare, thus enabling this option is mostly useless.
-	  Also this support is completely UNTESTED.
-
 config MTD_OOPS
 	tristate "Log panic/oops to an MTD buffer"
 	depends on MTD
drivers/mtd/sm_ftl.c +1 -7
index 9fb56c7..812e212 100644
@@ -15,12 +15,10 @@
 #include <linux/freezer.h>
 #include <linux/sysfs.h>
 #include <linux/bitops.h>
+#include <linux/mtd/nand_ecc.h>
 #include "nand/sm_common.h"
 #include "sm_ftl.h"
 
-#ifdef CONFIG_SM_FTL_MUSEUM
-#include <linux/mtd/nand_ecc.h>
-#endif
 
 
 struct workqueue_struct *cache_flush_workqueue;
@@ -204,7 +202,6 @@ static void sm_break_offset(struct sm_ftl *ftl, loff_t offset,
 
 static int sm_correct_sector(uint8_t *buffer, struct sm_oob *oob)
 {
-#ifdef CONFIG_SM_FTL_MUSEUM
 	uint8_t ecc[3];
 
 	__nand_calculate_ecc(buffer, SM_SMALL_PAGE, ecc);
@@ -216,7 +213,6 @@ static int sm_correct_sector(uint8_t *buffer, struct sm_oob *oob)
 	__nand_calculate_ecc(buffer, SM_SMALL_PAGE, ecc);
 	if (__nand_correct_data(buffer, ecc, oob->ecc2, SM_SMALL_PAGE) < 0)
 		return -EIO;
-#endif
 	return 0;
 }
 
@@ -380,7 +376,6 @@ restart:
 			oob.data_status = 0;
 		}
 
-#ifdef CONFIG_SM_FTL_MUSEUM
 		if (ftl->smallpagenand) {
 			__nand_calculate_ecc(buf + boffset,
 						SM_SMALL_PAGE, oob.ecc1);
@@ -388,7 +383,6 @@ restart:
 			__nand_calculate_ecc(buf + boffset + SM_SMALL_PAGE,
 						SM_SMALL_PAGE, oob.ecc2);
 		}
-#endif
 		if (!sm_write_sector(ftl, zone, block, boffset,
 							buf + boffset, &oob))
 			continue;
Signature · 1 line
1.6.3.3
#1 lore raw

PATCH 1/2 MTD: SM_FTL: initialize sysfs attributes This is new requirement in 2.6.34

---
 drivers/mtd/sm_ftl.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
drivers/mtd/sm_ftl.c +2 -0
index 812e212..a9b4e34 100644
@@ -70,6 +70,8 @@ struct attribute_group *sm_create_sysfs_attributes(struct sm_ftl *ftl)
 	vendor_attribute =
 		kzalloc(sizeof(struct sm_sysfs_attribute), GFP_KERNEL);
 
+	sysfs_attr_init(&vendor_attribute->dev_attr.attr);
+
 	vendor_attribute->data = vendor;
 	vendor_attribute->len = vendor_len;
 	vendor_attribute->dev_attr.attr.name = "vendor";
Signature · 1 line
1.6.3.3
#2 lore raw

PATCH 2/2 MTD: NAND: split out ECC module

In reply to Maxim Levitsky

This way drivers could use ecc routines without depedency on whole nand

---
 drivers/mtd/Kconfig       |    3 ++-
 drivers/mtd/nand/Kconfig  |    4 ++++
 drivers/mtd/nand/Makefile |    3 ++-
 3 files changed, 8 insertions(+), 2 deletions(-)
drivers/mtd/Kconfig +2 -1
index d90652f..f8210bf 100644
@@ -307,8 +307,9 @@ config SSFDC
 
 config SM_FTL
 	tristate "SmartMedia/xD new translation layer"
-	depends on EXPERIMENTAL && BLOCK && MTD_NAND
+	depends on EXPERIMENTAL && BLOCK
 	select MTD_BLKDEVS
+	select MTD_NAND_ECC
 	help
 	  This enables new and very EXPERMENTAL support for SmartMedia/xD
 	  FTL (Flash translation layer).
drivers/mtd/nand/Kconfig +4 -0
index 983a641..dfde30b 100644
@@ -2,6 +2,7 @@ menuconfig MTD_NAND
 	tristate "NAND Device Support"
 	depends on MTD
 	select MTD_NAND_IDS
+	select MTD_NAND_ECC
 	help
 	  This enables support for accessing all type of NAND flash
 	  devices. For further information see
@@ -102,6 +103,9 @@ config MTD_NAND_OMAP_PREFETCH_DMA
 config MTD_NAND_IDS
 	tristate
 
+config MTD_NAND_ECC
+	tristate
+
 config MTD_NAND_RICOH
 	tristate "Ricoh xD card reader"
 	default n
drivers/mtd/nand/Makefile +2 -1
index 5fbd1f8..04bccf9 100644
@@ -2,7 +2,8 @@
 # linux/drivers/nand/Makefile
 #
 
-obj-$(CONFIG_MTD_NAND)			+= nand.o nand_ecc.o
+obj-$(CONFIG_MTD_NAND)			+= nand.o
+obj-$(CONFIG_MTD_NAND_ECC)		+= nand_ecc.o
 obj-$(CONFIG_MTD_NAND_IDS)		+= nand_ids.o
 obj-$(CONFIG_MTD_SM_COMMON) 		+= sm_common.o
 
Signature · 1 line
1.6.3.3
#3 lore raw
In reply to Maxim Levitsky
Quoted 73 lines · Maxim Levitsky

The sole purpose of this settings was to avoid depedency on MTD_NAND. It seems that such configuration isn't well supported by Kconfig/is ugly to implement/I don't know how to do.

---
 drivers/mtd/Kconfig  |    9 ---------
 drivers/mtd/sm_ftl.c |    8 +-------
 2 files changed, 1 insertions(+), 16 deletions(-)
drivers/mtd/Kconfig +0 -9
index dbee14d..d90652f 100644
@@ -316,15 +316,6 @@ config SM_FTL
 	  eat your card, so please don't use it together with valuable data.
 	  Use readonly driver (CONFIG_SSFDC) instead.
 
-config SM_FTL_MUSEUM
-	boolean "Additional Support for 1MiB and 2MiB SmartMedia cards"
-	depends on SM_FTL
-	select MTD_NAND_ECC_SMC
-	help
-	  Very old SmartMedia cards need ECC to be calculated in the FTL.
-	  Such cards are very rare, thus enabling this option is mostly useless.
-	  Also this support is completely UNTESTED.
-
 config MTD_OOPS
 	tristate "Log panic/oops to an MTD buffer"
 	depends on MTD
drivers/mtd/sm_ftl.c +1 -6
index 9fb56c7..812e212 100644
@@ -15,12 +15,10 @@
 #include <linux/freezer.h>
 #include <linux/sysfs.h>
 #include <linux/bitops.h>
+#include <linux/mtd/nand_ecc.h>
 #include "nand/sm_common.h"
 #include "sm_ftl.h"
 
-#ifdef CONFIG_SM_FTL_MUSEUM
-#include <linux/mtd/nand_ecc.h>
-#endif
 
 
 struct workqueue_struct *cache_flush_workqueue;
@@ -204,7 +202,6 @@ static void sm_break_offset(struct sm_ftl *ftl, loff_t offset,
 
 static int sm_correct_sector(uint8_t *buffer, struct sm_oob *oob)
 {
-#ifdef CONFIG_SM_FTL_MUSEUM
 	uint8_t ecc[3];
 
 	__nand_calculate_ecc(buffer, SM_SMALL_PAGE, ecc);
@@ -216,7 +213,6 @@ static int sm_correct_sector(uint8_t *buffer, struct sm_oob *oob)
 	__nand_calculate_ecc(buffer, SM_SMALL_PAGE, ecc);
 	if (__nand_correct_data(buffer, ecc, oob->ecc2, SM_SMALL_PAGE) < 0)
 		return -EIO;
-#endif
 	return 0;
 }
 
@@ -380,7 +376,6 @@ restart:
 			oob.data_status = 0;
 		}
 
-#ifdef CONFIG_SM_FTL_MUSEUM
 		if (ftl->smallpagenand) {
 			__nand_calculate_ecc(buf + boffset,
 						SM_SMALL_PAGE, oob.ecc1);

drivers/mtd/sm_ftl.c restart: · line 388

Quoted 7 lines
drivers/mtd/sm_ftl.c +0 -1
@@ -388,7 +383,6 @@ restart:
 			__nand_calculate_ecc(buf + boffset + SM_SMALL_PAGE,
 						SM_SMALL_PAGE, oob.ecc2);
 		}
-#endif
 		if (!sm_write_sector(ftl, zone, block, boffset,
 							buf + boffset, &oob))
 			continue;

Ping?