[Intel-gfx] [PATCH] drivers/base: use a worker for sysfs unbind

Chris Wilson chris at chris-wilson.co.uk
Fri Dec 7 09:58:06 UTC 2018


Quoting Daniel Vetter (2018-12-07 09:31:33)
> +void unbind_work_fn(struct work_struct *work)
> +{
> +       struct unbind_work *unbind_work =
> +               container_of(work, struct unbind_work, work);
> +
> +       device_release_driver(unbind_work->dev);
> +       put_device(unbind_work->dev);
> +}
> +
>  /* Manually detach a device from its associated driver. */
>  static ssize_t unbind_store(struct device_driver *drv, const char *buf,
>                             size_t count)
>  {
>         struct bus_type *bus = bus_get(drv->bus);
> +       struct unbind_work *unbind_work;
>         struct device *dev;
>         int err = -ENODEV;
>  
>         dev = bus_find_device_by_name(bus, NULL, buf);
>         if (dev && dev->driver == drv) {
> -               if (dev->parent && dev->bus->need_parent_lock)
> -                       device_lock(dev->parent);

Do we not need to keep this locking in the worker?
-Chris


More information about the Intel-gfx mailing list