Unverified Commit e1161426 authored by openeuler-ci-bot's avatar openeuler-ci-bot Committed by Gitee
Browse files

!1707 Mainline bugfix patches backport 5.10

Merge Pull Request from: @ci-robot 
 
PR sync from: Guo Mengqi <guomengqi3@huawei.com>
https://mailweb.openeuler.org/hyperkitty/list/kernel@openeuler.org/message/AYXIAD7WTNXTTOHZT4J7NYVFK2CC3GKH/ 
Andy Shevchenko (1):
  lib/cmdline: fix get_option() for strings starting with hyphen

Huang Shijie (1):
  lib/genalloc.c: change return type to unsigned long for bitmap_set_ll

Saravana Kannan (1):
  driver core: Update device link status properly for
    device_bind_driver()

Sumera Priyadarsini (1):
  bus: arm-integrator-lm: Add of_node_put() before return statement


-- 
2.17.1
 
https://gitee.com/openeuler/kernel/issues/I7R8MK 
 
Link:https://gitee.com/openeuler/kernel/pulls/1707

 

Reviewed-by: default avatarWeilong Chen <chenweilong@huawei.com>
Reviewed-by: default avatarJialin Zhang <zhangjialin11@huawei.com>
Signed-off-by: default avatarJialin Zhang <zhangjialin11@huawei.com>
parents 087aa59e a7f095f2
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -186,6 +186,7 @@ extern int device_links_read_lock(void);
extern void device_links_read_unlock(int idx);
extern int device_links_read_lock_held(void);
extern int device_links_check_suppliers(struct device *dev);
extern void device_links_force_bind(struct device *dev);
extern void device_links_driver_bound(struct device *dev);
extern void device_links_driver_cleanup(struct device *dev);
extern void device_links_no_driver(struct device *dev);
+35 −0
Original line number Diff line number Diff line
@@ -1099,6 +1099,41 @@ static ssize_t waiting_for_supplier_show(struct device *dev,
}
static DEVICE_ATTR_RO(waiting_for_supplier);

/**
 * device_links_force_bind - Prepares device to be force bound
 * @dev: Consumer device.
 *
 * device_bind_driver() force binds a device to a driver without calling any
 * driver probe functions. So the consumer really isn't going to wait for any
 * supplier before it's bound to the driver. We still want the device link
 * states to be sensible when this happens.
 *
 * In preparation for device_bind_driver(), this function goes through each
 * supplier device links and checks if the supplier is bound. If it is, then
 * the device link status is set to CONSUMER_PROBE. Otherwise, the device link
 * is dropped. Links without the DL_FLAG_MANAGED flag set are ignored.
 */
void device_links_force_bind(struct device *dev)
{
	struct device_link *link, *ln;

	device_links_write_lock();

	list_for_each_entry_safe(link, ln, &dev->links.suppliers, c_node) {
		if (!(link->flags & DL_FLAG_MANAGED))
			continue;

		if (link->status != DL_STATE_AVAILABLE) {
			device_link_drop_managed(link);
			continue;
		}
		WRITE_ONCE(link->status, DL_STATE_CONSUMER_PROBE);
	}
	dev->links.status = DL_DEV_PROBING;

	device_links_write_unlock();
}

/**
 * device_links_driver_bound - Update device links after probing its driver.
 * @dev: Device to update the links for.
+3 −1
Original line number Diff line number Diff line
@@ -460,8 +460,10 @@ int device_bind_driver(struct device *dev)
	int ret;

	ret = driver_sysfs_add(dev);
	if (!ret)
	if (!ret) {
		device_links_force_bind(dev);
		driver_bound(dev);
	}
	else if (dev->bus)
		blocking_notifier_call_chain(&dev->bus->p->bus_notifier,
					     BUS_NOTIFY_DRIVER_NOT_BOUND, dev);
+1 −0
Original line number Diff line number Diff line
@@ -54,6 +54,7 @@ static int integrator_lm_populate(int num, struct device *dev)
			ret = of_platform_default_populate(child, NULL, dev);
			if (ret) {
				dev_err(dev, "failed to populate module\n");
				of_node_put(child);
				return ret;
			}
		}
+7 −1
Original line number Diff line number Diff line
@@ -45,6 +45,9 @@ static int get_range(char **str, int *pint, int n)
 *	1 - int found, no subsequent comma
 *	2 - int found including a subsequent comma
 *	3 - hyphen found to denote a range
 *
 *	Leading hyphen without integer is no integer case, but we consume it
 *	for the sake of simplification.
 */

int get_option(char **str, int *pint)
@@ -53,7 +56,10 @@ int get_option(char **str, int *pint)

	if (!cur || !(*cur))
		return 0;
	*pint = simple_strtol(cur, str, 0);
	if (*cur == '-')
		*pint = -simple_strtoull(++cur, str, 0);
	else
		*pint = simple_strtoull(cur, str, 0);
	if (cur == *str)
		return 0;
	if (**str == ',') {
Loading