Commit bd991fd8 authored by popcornmix's avatar popcornmix
Browse files

Merge remote-tracking branch 'stable/linux-4.19.y' into rpi-4.19.y

parents ea2c11a1 893af1c7
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
# SPDX-License-Identifier: GPL-2.0
VERSION = 4
PATCHLEVEL = 19
SUBLEVEL = 65
SUBLEVEL = 66
EXTRAVERSION =
NAME = "People's Front"

+6 −2
Original line number Diff line number Diff line
@@ -63,6 +63,7 @@
#include <asm/byteorder.h>  
#include <linux/vmalloc.h>
#include <linux/jiffies.h>
#include <linux/nospec.h>
#include "iphase.h"		  
#include "suni.h"		  
#define swap_byte_order(x) (((x & 0xff) << 8) | ((x & 0xff00) >> 8))
@@ -2760,8 +2761,11 @@ static int ia_ioctl(struct atm_dev *dev, unsigned int cmd, void __user *arg)
   }
   if (copy_from_user(&ia_cmds, arg, sizeof ia_cmds)) return -EFAULT; 
   board = ia_cmds.status;

	if ((board < 0) || (board > iadev_count))
		board = 0;
	board = array_index_nospec(board, iadev_count + 1);

   iadev = ia_dev[board];
   switch (ia_cmds.cmd) {
   case MEMDUMP:
+4 −0
Original line number Diff line number Diff line
@@ -66,6 +66,9 @@ struct driver_private {
 *	probed first.
 * @device - pointer back to the struct device that this structure is
 * associated with.
 * @dead - This device is currently either in the process of or has been
 *	removed from the system. Any asynchronous events scheduled for this
 *	device should exit without taking any action.
 *
 * Nothing outside of the driver core should ever touch these fields.
 */
@@ -76,6 +79,7 @@ struct device_private {
	struct klist_node knode_bus;
	struct list_head deferred_probe;
	struct device *device;
	u8 dead:1;
};
#define to_device_private_parent(obj)	\
	container_of(obj, struct device_private, knode_parent)
+22 −0
Original line number Diff line number Diff line
@@ -2031,6 +2031,24 @@ void put_device(struct device *dev)
}
EXPORT_SYMBOL_GPL(put_device);

bool kill_device(struct device *dev)
{
	/*
	 * Require the device lock and set the "dead" flag to guarantee that
	 * the update behavior is consistent with the other bitfields near
	 * it and that we cannot have an asynchronous probe routine trying
	 * to run while we are tearing out the bus/class/sysfs from
	 * underneath the device.
	 */
	lockdep_assert_held(&dev->mutex);

	if (dev->p->dead)
		return false;
	dev->p->dead = true;
	return true;
}
EXPORT_SYMBOL_GPL(kill_device);

/**
 * device_del - delete device from system.
 * @dev: device.
@@ -2050,6 +2068,10 @@ void device_del(struct device *dev)
	struct kobject *glue_dir = NULL;
	struct class_interface *class_intf;

	device_lock(dev);
	kill_device(dev);
	device_unlock(dev);

	/* Notify clients of device removal.  This call must come
	 * before dpm_sysfs_remove().
	 */
+11 −11
Original line number Diff line number Diff line
@@ -725,15 +725,6 @@ static int __device_attach_driver(struct device_driver *drv, void *_data)
	bool async_allowed;
	int ret;

	/*
	 * Check if device has already been claimed. This may
	 * happen with driver loading, device discovery/registration,
	 * and deferred probe processing happens all at once with
	 * multiple threads.
	 */
	if (dev->driver)
		return -EBUSY;

	ret = driver_match_device(drv, dev);
	if (ret == 0) {
		/* no match */
@@ -768,6 +759,15 @@ static void __device_attach_async_helper(void *_dev, async_cookie_t cookie)

	device_lock(dev);

	/*
	 * Check if device has already been removed or claimed. This may
	 * happen with driver loading, device discovery/registration,
	 * and deferred probe processing happens all at once with
	 * multiple threads.
	 */
	if (dev->p->dead || dev->driver)
		goto out_unlock;

	if (dev->parent)
		pm_runtime_get_sync(dev->parent);

@@ -778,7 +778,7 @@ static void __device_attach_async_helper(void *_dev, async_cookie_t cookie)

	if (dev->parent)
		pm_runtime_put(dev->parent);

out_unlock:
	device_unlock(dev);

	put_device(dev);
@@ -891,7 +891,7 @@ static int __driver_attach(struct device *dev, void *data)
	if (dev->parent && dev->bus->need_parent_lock)
		device_lock(dev->parent);
	device_lock(dev);
	if (!dev->driver)
	if (!dev->p->dead && !dev->driver)
		driver_probe_device(drv, dev);
	device_unlock(dev);
	if (dev->parent && dev->bus->need_parent_lock)
Loading