mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-09 12:17:12 +09:00
Revert "ANDROID: driver core: Add device link support for SYNC_STATE_ONLY flag"
This reverts commit 6b3cf9491b.
Change-Id: I39125ddfff9397a7d86d81c6e66597501dc66718
Cc: Saravana Kannan <saravanak@google.com>
Signed-off-by: Saravana Kannan <saravanak@google.com>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
6a8f31853d
commit
cbec6a3c0d
@@ -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;
|
||||
|
||||
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user