From 1c6df5fdcb19a03fb6b652090b4b968a6377fb14 Mon Sep 17 00:00:00 2001 From: Mohamad Ayyash Date: Thu, 25 Aug 2016 00:59:21 +0000 Subject: Revert "Android: MMC/UFS IO Latency Histograms." This reverts commit 8d525c512280bb7d8218fd59c04de985b1886eca. Change-Id: I69350b98d9de9b1c9f591e03a90f133e328ba72a --- drivers/mmc/core/core.c | 66 +------------------------------------------------ drivers/mmc/core/host.c | 6 ++--- drivers/mmc/core/host.h | 5 ---- 3 files changed, 3 insertions(+), 74 deletions(-) (limited to 'drivers/mmc') diff --git a/drivers/mmc/core/core.c b/drivers/mmc/core/core.c index b503249950df..9fab52559a8c 100644 --- a/drivers/mmc/core/core.c +++ b/drivers/mmc/core/core.c @@ -183,17 +183,6 @@ void mmc_request_done(struct mmc_host *host, struct mmc_request *mrq) pr_debug("%s: %d bytes transferred: %d\n", mmc_hostname(host), mrq->data->bytes_xfered, mrq->data->error); - if (mrq->lat_hist_enabled) { - ktime_t completion; - u_int64_t delta_us; - - completion = ktime_get(); - delta_us = ktime_us_delta(completion, - mrq->io_start); - blk_update_latency_hist(&host->io_lat_s, - (mrq->data->flags & MMC_DATA_READ), - delta_us); - } trace_mmc_blk_rw_end(cmd->opcode, cmd->arg, mrq->data); } @@ -638,11 +627,6 @@ struct mmc_async_req *mmc_start_req(struct mmc_host *host, } if (!err && areq) { - if (host->latency_hist_enabled) { - areq->mrq->io_start = ktime_get(); - areq->mrq->lat_hist_enabled = 1; - } else - areq->mrq->lat_hist_enabled = 0; trace_mmc_blk_rw_start(areq->mrq->cmd->opcode, areq->mrq->cmd->arg, areq->mrq->data); @@ -1980,7 +1964,7 @@ void mmc_init_erase(struct mmc_card *card) } static unsigned int mmc_mmc_erase_timeout(struct mmc_card *card, - unsigned int arg, unsigned int qty) + unsigned int arg, unsigned int qty) { unsigned int erase_timeout; @@ -2923,54 +2907,6 @@ static void __exit mmc_exit(void) destroy_workqueue(workqueue); } -static ssize_t -latency_hist_show(struct device *dev, struct device_attribute *attr, char *buf) -{ - struct mmc_host *host = cls_dev_to_mmc_host(dev); - - return blk_latency_hist_show(&host->io_lat_s, buf); -} - -/* - * Values permitted 0, 1, 2. - * 0 -> Disable IO latency histograms (default) - * 1 -> Enable IO latency histograms - * 2 -> Zero out IO latency histograms - */ -static ssize_t -latency_hist_store(struct device *dev, struct device_attribute *attr, - const char *buf, size_t count) -{ - struct mmc_host *host = cls_dev_to_mmc_host(dev); - long value; - - if (kstrtol(buf, 0, &value)) - return -EINVAL; - if (value == BLK_IO_LAT_HIST_ZERO) - blk_zero_latency_hist(&host->io_lat_s); - else if (value == BLK_IO_LAT_HIST_ENABLE || - value == BLK_IO_LAT_HIST_DISABLE) - host->latency_hist_enabled = value; - return count; -} - -static DEVICE_ATTR(latency_hist, S_IRUGO | S_IWUSR, - latency_hist_show, latency_hist_store); - -void -mmc_latency_hist_sysfs_init(struct mmc_host *host) -{ - if (device_create_file(&host->class_dev, &dev_attr_latency_hist)) - dev_err(&host->class_dev, - "Failed to create latency_hist sysfs entry\n"); -} - -void -mmc_latency_hist_sysfs_exit(struct mmc_host *host) -{ - device_remove_file(&host->class_dev, &dev_attr_latency_hist); -} - subsys_initcall(mmc_init); module_exit(mmc_exit); diff --git a/drivers/mmc/core/host.c b/drivers/mmc/core/host.c index 17068839c74b..fcf7829c759e 100644 --- a/drivers/mmc/core/host.c +++ b/drivers/mmc/core/host.c @@ -32,6 +32,8 @@ #include "slot-gpio.h" #include "pwrseq.h" +#define cls_dev_to_mmc_host(d) container_of(d, struct mmc_host, class_dev) + static DEFINE_IDR(mmc_host_idr); static DEFINE_SPINLOCK(mmc_host_lock); @@ -392,8 +394,6 @@ int mmc_add_host(struct mmc_host *host) mmc_add_host_debugfs(host); #endif - mmc_latency_hist_sysfs_init(host); - mmc_start_host(host); if (!(host->pm_flags & MMC_PM_IGNORE_PM_NOTIFY)) register_pm_notifier(&host->pm_notify); @@ -422,8 +422,6 @@ void mmc_remove_host(struct mmc_host *host) mmc_remove_host_debugfs(host); #endif - mmc_latency_hist_sysfs_exit(host); - device_del(&host->class_dev); led_trigger_unregister_simple(host->led); diff --git a/drivers/mmc/core/host.h b/drivers/mmc/core/host.h index bf38533406fd..992bf5397633 100644 --- a/drivers/mmc/core/host.h +++ b/drivers/mmc/core/host.h @@ -12,8 +12,6 @@ #define _MMC_CORE_HOST_H #include -#define cls_dev_to_mmc_host(d) container_of(d, struct mmc_host, class_dev) - int mmc_register_host_class(void); void mmc_unregister_host_class(void); @@ -23,8 +21,5 @@ void mmc_retune_hold(struct mmc_host *host); void mmc_retune_release(struct mmc_host *host); int mmc_retune(struct mmc_host *host); -void mmc_latency_hist_sysfs_init(struct mmc_host *host); -void mmc_latency_hist_sysfs_exit(struct mmc_host *host); - #endif -- cgit v1.2.3