summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorMohit Kataria <mkataria@nvidia.com>2012-06-05 15:05:31 +0530
committerSimone Willett <swillett@nvidia.com>2012-06-11 16:27:31 -0700
commit5702f8c67472c05feb28a3f45550bb7ab1ca865d (patch)
tree5f0e8d293cbd0df207e69136c28c856cf1fd8be6 /include
parenta79e68c19180953ba479b3730e2945974660b43d (diff)
mmc: proactively issue bkops_start and refresh
Adding CMD56 implementation. Doing the following for manfid 0x90 and FW revisions 0x73 and 0x7b (both are non-standard custom FW): 1. Adding change to issue BKOPS_START whenever 20 seconds have gone by without any slow write operations. 2. Adding change to issue CMD56 to refresh (custom feature) 1 block whenever 60 seconds have gone by without any slow write operations. Corresponding changes are already there in embedded branches: http://git-master/r/#change,93247 http://git-master/r/#change,97555 Bug 847037. Bug 874256. Bug 963737. Change-Id: Ie36b52620a75320abfedc36d1408647b36eddb46 Signed-off-by: Vishal Singh <vissingh@nvidia.com> Reviewed-on: http://git-master/r/102259 Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: Luis Dib <ldib@nvidia.com> Reviewed-by: Varun Wadekar <vwadekar@nvidia.com> GVS: Gerrit_Virtual_Submit Reviewed-by: Sachin Nikam <snikam@nvidia.com>
Diffstat (limited to 'include')
-rw-r--r--include/linux/mmc/card.h8
-rw-r--r--include/linux/mmc/core.h5
2 files changed, 13 insertions, 0 deletions
diff --git a/include/linux/mmc/card.h b/include/linux/mmc/card.h
index 9178aa48209a..8f17619931ab 100644
--- a/include/linux/mmc/card.h
+++ b/include/linux/mmc/card.h
@@ -22,6 +22,7 @@ struct mmc_cid {
unsigned char hwrev;
unsigned char fwrev;
unsigned char month;
+ unsigned short prod_rev;
};
struct mmc_csd {
@@ -83,6 +84,9 @@ struct mmc_ext_csd {
u8 out_of_int_time; /* out of int time */
bool bk_ops; /* BK ops support bit */
bool bk_ops_en; /* BK ops enable bit */
+ bool refresh; /* refresh of blocks supported */
+ __kernel_time_t last_tv_sec; /* last time a block was refreshed */
+ __kernel_time_t last_bkops_tv_sec; /* last time bkops was done */
};
struct sd_scr {
@@ -224,6 +228,10 @@ struct mmc_card {
unsigned int sd_bus_speed; /* Bus Speed Mode set for the card */
struct dentry *debugfs_root;
+
+ struct timer_list timer;
+ struct work_struct bkops;
+ struct work_struct refresh;
};
/*
diff --git a/include/linux/mmc/core.h b/include/linux/mmc/core.h
index c3e55fa63fb6..0c4472eff796 100644
--- a/include/linux/mmc/core.h
+++ b/include/linux/mmc/core.h
@@ -11,6 +11,10 @@
#include <linux/interrupt.h>
#include <linux/device.h>
+#define MMC_SLOW_WRITE_TIME 500000 /* time (us) */
+#define MMC_REFRESH_INTERVAL 60 /* time (s) */
+#define MMC_BKOPS_INTERVAL 20 /* time (s) */
+
struct request;
struct mmc_data;
struct mmc_request;
@@ -138,6 +142,7 @@ extern struct mmc_async_req *mmc_start_req(struct mmc_host *,
struct mmc_async_req *, int *);
extern int mmc_interrupt_hpi(struct mmc_card *);
extern int mmc_bkops_start(struct mmc_card *card, bool is_synchronous);
+extern void mmc_refresh(unsigned long data);
extern void mmc_wait_for_req(struct mmc_host *, struct mmc_request *);
extern int mmc_wait_for_cmd(struct mmc_host *, struct mmc_command *, int);