[PATCH] Onenand Reset IOBE bit in SYS_CFG register in onenand_release
Gaurav Singh
gausinghnsit at gmail.com
Mon Apr 27 23:54:54 EDT 2009
Hi,
> I think that the interrupt mode will help when there is high load on
> the CPU. Will run tests in interrupt and polling mode in two
> scenarios. 1. Copy of a large file to ONENAND with no CPU load. 2.
> Copy of a Large file to ONENAND with an infinite loop running in the
> background - this generates CPU load. Little bit busy today but will
> run it and mail the results by tomorrow. In my opinion Scenario 2
> should give better results in interrupt mode.
Interrupt mode is giving better results than the normal polling mode.
In terms of time taken to copy both the modes are taking the same time
for both scenarios. But in the case of interrupt mode the CPU usage is
coming out to be less as indicated by top. Average CPU usage in
Scenario 2 is 40% for interrupt mode whereas it is 57% for polling
mode.
diff --git a/drivers/mtd/onenand/onenand_base.c
b/drivers/mtd/onenand/onenand_base.c
index 0e168d8..9b2f9aa 100644
--- a/drivers/mtd/onenand/onenand_base.c
+++ b/drivers/mtd/onenand/onenand_base.c
@@ -2728,6 +2728,13 @@ void onenand_release(struct mtd_info *mtd)
/* Deregister partitions */
del_mtd_partitions (mtd);
#endif
+ /* Reset the IOBE bit in SYS_CFG Register */
+ if ( this->wait == onenand_interrupt_wait ) {
+ int syscfg = this->read_word(this->base +
ONENAND_REG_SYS_CFG1);
+ syscfg &= ~ONENAND_SYS_CFG1_IOBE;
+ this->write_word(syscfg, this->base + ONENAND_REG_SYS_CFG1);
+ }
/* Deregister the device */
del_mtd_device (mtd);
Regards
Gaurav Singh
More information about the linux-mtd
mailing list