summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVenkat Moganty <vmoganty@nvidia.com>2010-09-05 12:59:15 -0700
committerYu-Huan Hsu <yhsu@nvidia.com>2010-09-09 09:49:59 -0700
commit9053084636be53fab6c0d9f80863b890e981096a (patch)
tree60cadfaeb2b810ceaba77ecf72e5c3cda0bbeff9
parent0e52d7fe25b11a656c376a37890be219470661fb (diff)
[usb-msd]Fix to increase MSD write performance
MSD write performance is decreased due to the file_sync() called in the write path this is introduced in the K32. After removing this write performance is increased and it is back to K29. Bug 727609 (cherry picked from commit 3674a60b8d4ede5d9305bf59a205e9f16e025f2a) Change-Id: I99e63302e1b189b600163c216847eae437e86a9f Reviewed-on: http://git-master/r/6246 Reviewed-by: Hanumanth Venkateswa Moganty <vmoganty@nvidia.com> Tested-by: Hanumanth Venkateswa Moganty <vmoganty@nvidia.com> Reviewed-by: Yu-Huan Hsu <yhsu@nvidia.com>
-rw-r--r--arch/arm/mach-tegra/nvddk/nvddk_usbphy_priv.h2
-rw-r--r--drivers/usb/gadget/f_mass_storage.c13
2 files changed, 2 insertions, 13 deletions
diff --git a/arch/arm/mach-tegra/nvddk/nvddk_usbphy_priv.h b/arch/arm/mach-tegra/nvddk/nvddk_usbphy_priv.h
index 3b4c0e074552..3ed53a20dfb4 100644
--- a/arch/arm/mach-tegra/nvddk/nvddk_usbphy_priv.h
+++ b/arch/arm/mach-tegra/nvddk/nvddk_usbphy_priv.h
@@ -63,7 +63,7 @@ enum {USB_HW_MIN_SYSTEM_FREQ_KH = 100000};
/**
* Minimum cpu frequency required for USB for optimal performance
*/
-enum {USB_HW_MIN_CPU_FREQ_KH = 200000};
+enum {USB_HW_MIN_CPU_FREQ_KH = 300000};
/**
* Wait time(1 second) for controller H/W status to change before giving up.
diff --git a/drivers/usb/gadget/f_mass_storage.c b/drivers/usb/gadget/f_mass_storage.c
index 845d98c0b5c6..209dae73408d 100644
--- a/drivers/usb/gadget/f_mass_storage.c
+++ b/drivers/usb/gadget/f_mass_storage.c
@@ -79,8 +79,6 @@
#define BULK_BUFFER_SIZE 4096
-/* flush after every 4 meg of writes to avoid excessive block level caching */
-#define MAX_UNFLUSHED_BYTES (4 * 1024 * 1024)
/*-------------------------------------------------------------------------*/
@@ -229,7 +227,6 @@ struct lun {
struct file *filp;
loff_t file_length;
loff_t num_sectors;
- unsigned int unflushed_bytes;
unsigned int ro : 1;
unsigned int prevent_medium_removal : 1;
@@ -396,7 +393,7 @@ static struct fsg_dev *the_fsg;
static void close_backing_file(struct fsg_dev *fsg, struct lun *curlun);
static void close_all_backing_files(struct fsg_dev *fsg);
-static int fsync_sub(struct lun *curlun);
+
/*-------------------------------------------------------------------------*/
@@ -1046,13 +1043,6 @@ static int do_write(struct fsg_dev *fsg)
amount_left_to_write -= nwritten;
fsg->residue -= nwritten;
-#ifdef MAX_UNFLUSHED_BYTES
- curlun->unflushed_bytes += nwritten;
- if (curlun->unflushed_bytes >= MAX_UNFLUSHED_BYTES) {
- fsync_sub(curlun);
- curlun->unflushed_bytes = 0;
- }
-#endif
/* If an error occurred, report it and its position */
if (nwritten < amount) {
curlun->sense_data = SS_WRITE_ERROR;
@@ -2557,7 +2547,6 @@ static int open_backing_file(struct fsg_dev *fsg, struct lun *curlun,
curlun->ro = ro;
curlun->filp = filp;
curlun->file_length = size;
- curlun->unflushed_bytes = 0;
curlun->num_sectors = num_sectors;
LDBG(curlun, "open backing file: %s size: %lld num_sectors: %lld\n",
filename, size, num_sectors);