Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 2320e1e8 authored by Mohan Srinivasan's avatar Mohan Srinivasan Committed by Amit Pundir
Browse files

Fix a build breakage in IO latency hist code.



Fix a build breakage where MMC is enabled, but BLOCK is not.

Change-Id: I0eb422d12264f0371f3368ae7c37342ef9efabaa
Signed-off-by: default avatarMohan Srinivasan <srmohan@google.com>
parent 048871b8
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -201,6 +201,7 @@ 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);
#ifdef CONFIG_BLOCK
			if (mrq->lat_hist_enabled) {
				ktime_t completion;
				u_int64_t delta_us;
@@ -212,6 +213,7 @@ void mmc_request_done(struct mmc_host *host, struct mmc_request *mrq)
					(mrq->data->flags & MMC_DATA_READ),
					delta_us);
			}
#endif
		}

		if (mrq->stop) {
@@ -711,11 +713,13 @@ struct mmc_async_req *mmc_start_req(struct mmc_host *host,
	}

	if (!err && areq) {
#ifdef CONFIG_BLOCK
		if (host->latency_hist_enabled) {
			areq->mrq->io_start = ktime_get();
			areq->mrq->lat_hist_enabled = 1;
		} else
			areq->mrq->lat_hist_enabled = 0;
#endif
		start_err = __mmc_start_data_req(host, areq->mrq);
	}

@@ -3091,6 +3095,7 @@ static void __exit mmc_exit(void)
	mmc_unregister_bus();
}

#ifdef CONFIG_BLOCK
static ssize_t
latency_hist_show(struct device *dev, struct device_attribute *attr, char *buf)
{
@@ -3138,6 +3143,7 @@ mmc_latency_hist_sysfs_exit(struct mmc_host *host)
{
	device_remove_file(&host->class_dev, &dev_attr_latency_hist);
}
#endif

subsys_initcall(mmc_init);
module_exit(mmc_exit);
+4 −0
Original line number Diff line number Diff line
@@ -428,7 +428,9 @@ int mmc_add_host(struct mmc_host *host)
	mmc_add_host_debugfs(host);
#endif

#ifdef CONFIG_BLOCK
	mmc_latency_hist_sysfs_init(host);
#endif

	mmc_start_host(host);
	if (!(host->pm_flags & MMC_PM_IGNORE_PM_NOTIFY))
@@ -458,7 +460,9 @@ void mmc_remove_host(struct mmc_host *host)
	mmc_remove_host_debugfs(host);
#endif

#ifdef CONFIG_BLOCK
	mmc_latency_hist_sysfs_exit(host);
#endif

	device_del(&host->class_dev);

+2 −0
Original line number Diff line number Diff line
@@ -144,7 +144,9 @@ struct mmc_request {
	bool			cap_cmd_during_tfr;

	ktime_t			io_start;
#ifdef CONFIG_BLOCK
	int			lat_hist_enabled;
#endif
};

struct mmc_card;