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

Commit 3a88ff89 authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "Revert "mmc: core: Hold a wake lock accross delayed work + mmc rescan""

parents 711133ef 2f2d1df8
Loading
Loading
Loading
Loading
+1 −21
Original line number Diff line number Diff line
@@ -30,7 +30,6 @@
#include <linux/random.h>
#include <linux/slab.h>
#include <linux/of.h>
#include <linux/wakelock.h>
#include <linux/pm.h>
#include <linux/jiffies.h>

@@ -61,7 +60,6 @@
#define MMC_BKOPS_MAX_TIMEOUT	(30 * 1000) /* max time to wait in ms */

static struct workqueue_struct *workqueue;
static struct wake_lock mmc_delayed_work_wake_lock;
static const unsigned freqs[] = { 400000, 300000, 200000, 100000 };

/*
@@ -78,7 +76,6 @@ module_param(use_spi_crc, bool, 0);
static int mmc_schedule_delayed_work(struct delayed_work *work,
				     unsigned long delay)
{
	wake_lock(&mmc_delayed_work_wake_lock);
	return queue_delayed_work(workqueue, work, delay);
}

@@ -3649,7 +3646,6 @@ void mmc_rescan(struct work_struct *work)
{
	struct mmc_host *host =
		container_of(work, struct mmc_host, detect.work);
	bool extend_wakelock = false;

	if (host->trigger_card_event && host->ops->card_event) {
		host->ops->card_event(host);
@@ -3676,12 +3672,6 @@ void mmc_rescan(struct work_struct *work)

	host->detect_change = 0;

	/* If the card was removed the bus will be marked
	 * as dead - extend the wakelock so userspace
	 * can respond */
	if (host->bus_dead)
		extend_wakelock = 1;

	/*
	 * Let mmc_bus_put() free the bus/bus_ops if we've found that
	 * the card is no longer present.
@@ -3710,15 +3700,10 @@ void mmc_rescan(struct work_struct *work)
	}

	mmc_claim_host(host);
	if (!mmc_rescan_try_freq(host, host->f_min))
		extend_wakelock = true;
	(void) mmc_rescan_try_freq(host, host->f_min);
	mmc_release_host(host);

 out:
	if (extend_wakelock)
		wake_lock_timeout(&mmc_delayed_work_wake_lock, HZ / 2);
	else
		wake_unlock(&mmc_delayed_work_wake_lock);
	if (host->caps & MMC_CAP_NEEDS_POLL)
		mmc_schedule_delayed_work(&host->detect, HZ);
}
@@ -3986,9 +3971,6 @@ static int __init mmc_init(void)
	if (!workqueue)
		return -ENOMEM;

	wake_lock_init(&mmc_delayed_work_wake_lock, WAKE_LOCK_SUSPEND,
		       "mmc_delayed_work");

	ret = mmc_register_bus();
	if (ret)
		goto destroy_workqueue;
@@ -4009,7 +3991,6 @@ unregister_bus:
	mmc_unregister_bus();
destroy_workqueue:
	destroy_workqueue(workqueue);
	wake_lock_destroy(&mmc_delayed_work_wake_lock);

	return ret;
}
@@ -4020,7 +4001,6 @@ static void __exit mmc_exit(void)
	mmc_unregister_host_class();
	mmc_unregister_bus();
	destroy_workqueue(workqueue);
	wake_lock_destroy(&mmc_delayed_work_wake_lock);
}

subsys_initcall(mmc_init);