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

Commit cbec6a3c authored by Saravana Kannan's avatar Saravana Kannan Committed by Greg Kroah-Hartman
Browse files

Revert "ANDROID: driver core: Add device link support for SYNC_STATE_ONLY flag"



This reverts commit 6b3cf949.

Change-Id: I39125ddfff9397a7d86d81c6e66597501dc66718
Cc: Saravana Kannan <saravanak@google.com>
Signed-off-by: default avatarSaravana Kannan <saravanak@google.com>
parent 6a8f3185
Loading
Loading
Loading
Loading
+6 −28
Original line number Diff line number Diff line
@@ -118,9 +118,6 @@ static int device_is_dependent(struct device *dev, void *target)
		return ret;

	list_for_each_entry(link, &dev->links.consumers, s_node) {
		if (link->flags == DL_FLAG_SYNC_STATE_ONLY)
			continue;

		if (link->consumer == target)
			return 1;

@@ -146,11 +143,8 @@ static int device_reorder_to_tail(struct device *dev, void *not_used)
		device_pm_move_last(dev);

	device_for_each_child(dev, NULL, device_reorder_to_tail);
	list_for_each_entry(link, &dev->links.consumers, s_node) {
		if (link->flags == DL_FLAG_SYNC_STATE_ONLY)
			continue;
	list_for_each_entry(link, &dev->links.consumers, s_node)
		device_reorder_to_tail(link->consumer, NULL);
	}

	return 0;
}
@@ -213,8 +207,6 @@ struct device_link *device_link_add(struct device *consumer,
	struct device_link *link;

	if (!consumer || !supplier ||
	    (flags & DL_FLAG_SYNC_STATE_ONLY &&
	     flags != DL_FLAG_SYNC_STATE_ONLY) ||
	    (flags & DL_FLAG_STATELESS &&
	     flags & (DL_FLAG_AUTOREMOVE_CONSUMER | DL_FLAG_AUTOREMOVE_SUPPLIER)))
		return NULL;
@@ -231,14 +223,11 @@ struct device_link *device_link_add(struct device *consumer,

	/*
	 * If the supplier has not been fully registered yet or there is a
	 * reverse (non-SYNC_STATE_ONLY) dependency between the consumer and
	 * the supplier already in the graph, return NULL. If the link is a
	 * SYNC_STATE_ONLY link, we don't check for reverse dependencies
	 * because it only affects sync_state() callbacks.
	 * reverse dependency between the consumer and the supplier already in
	 * the graph, return NULL.
	 */
	if (!device_pm_initialized(supplier)
	    || (!(flags & DL_FLAG_SYNC_STATE_ONLY) &&
		  device_is_dependent(consumer, supplier))) {
	    || device_is_dependent(consumer, supplier)) {
		link = NULL;
		goto out;
	}
@@ -272,12 +261,6 @@ struct device_link *device_link_add(struct device *consumer,
		}

		kref_get(&link->kref);

		if (link->flags & DL_FLAG_SYNC_STATE_ONLY &&
		    !(flags & DL_FLAG_SYNC_STATE_ONLY)) {
			link->flags &= ~DL_FLAG_SYNC_STATE_ONLY;
			goto reorder;
		}
		goto out;
	}

@@ -338,9 +321,6 @@ struct device_link *device_link_add(struct device *consumer,
		}
	}

	if (flags & DL_FLAG_SYNC_STATE_ONLY)
		goto out;
reorder:
	/*
	 * Move the consumer and all of the devices depending on it to the end
	 * of dpm_list and the devices_kset list.
@@ -575,8 +555,7 @@ int device_links_check_suppliers(struct device *dev)
	device_links_write_lock();

	list_for_each_entry(link, &dev->links.suppliers, c_node) {
		if (link->flags & DL_FLAG_STATELESS ||
		    link->flags & DL_FLAG_SYNC_STATE_ONLY)
		if (link->flags & DL_FLAG_STATELESS)
			continue;

		if (link->status != DL_STATE_AVAILABLE) {
@@ -922,8 +901,7 @@ void device_links_unbind_consumers(struct device *dev)
	list_for_each_entry(link, &dev->links.consumers, s_node) {
		enum device_link_state status;

		if (link->flags & DL_FLAG_STATELESS ||
		    link->flags & DL_FLAG_SYNC_STATE_ONLY)
		if (link->flags & DL_FLAG_STATELESS)
			continue;

		status = link->status;
+0 −2
Original line number Diff line number Diff line
@@ -846,14 +846,12 @@ enum device_link_state {
 * PM_RUNTIME: If set, the runtime PM framework will use this link.
 * RPM_ACTIVE: Run pm_runtime_get_sync() on the supplier during link creation.
 * AUTOREMOVE_SUPPLIER: Remove the link automatically on supplier driver unbind.
 * SYNC_STATE_ONLY: Link only affects sync_state() behavior.
 */
#define DL_FLAG_STATELESS		BIT(0)
#define DL_FLAG_AUTOREMOVE_CONSUMER	BIT(1)
#define DL_FLAG_PM_RUNTIME		BIT(2)
#define DL_FLAG_RPM_ACTIVE		BIT(3)
#define DL_FLAG_AUTOREMOVE_SUPPLIER	BIT(4)
#define DL_FLAG_SYNC_STATE_ONLY		BIT(7)

/**
 * struct device_link - Device link representation.