From: Daniel Vetter <daniel@ffwll.ch>
To: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>,
Intel Graphics Development <intel-gfx@lists.freedesktop.org>,
Daniel Vetter <daniel.vetter@intel.com>
Subject: Re: [PATCH] drivers/base: use a worker for sysfs unbind
Date: Fri, 7 Dec 2018 12:00:17 +0100 [thread overview]
Message-ID: <20181207110017.GA21184@phenom.ffwll.local> (raw)
In-Reply-To: <154417668607.31489.3921575960258922575@skylake-alporthouse-com>
On Fri, Dec 07, 2018 at 09:58:06AM +0000, Chris Wilson wrote:
> 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?
Ah forgot to mention that in the commit message: This locking is already
done in device_release_driver -> device_release_driver_internal. I'll fix
up the commit message, thanks for the reminder.
-Daniel
--
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
next prev parent reply other threads:[~2018-12-07 11:00 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-12-07 9:31 [PATCH] drivers/base: use a worker for sysfs unbind Daniel Vetter
2018-12-07 9:58 ` Chris Wilson
2018-12-07 11:00 ` Daniel Vetter [this message]
2018-12-07 11:51 ` ✗ Fi.CI.CHECKPATCH: warning for " Patchwork
2018-12-07 12:15 ` ✗ Fi.CI.BAT: failure " Patchwork
2018-12-07 12:24 ` Chris Wilson
2018-12-07 16:01 ` [PATCH] " Daniel Vetter
2018-12-09 17:20 ` Daniel Vetter
2018-12-13 9:39 ` Chris Wilson
2018-12-07 17:12 ` ✗ Fi.CI.CHECKPATCH: warning for drivers/base: use a worker for sysfs unbind (rev2) Patchwork
2018-12-07 17:36 ` ✗ Fi.CI.BAT: failure " Patchwork
2018-12-09 22:05 ` ✗ Fi.CI.CHECKPATCH: warning for drivers/base: use a worker for sysfs unbind (rev3) Patchwork
2018-12-09 22:27 ` ✓ Fi.CI.BAT: success " Patchwork
2018-12-09 23:34 ` ✓ Fi.CI.IGT: " Patchwork
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20181207110017.GA21184@phenom.ffwll.local \
--to=daniel@ffwll.ch \
--cc=chris@chris-wilson.co.uk \
--cc=daniel.vetter@ffwll.ch \
--cc=daniel.vetter@intel.com \
--cc=intel-gfx@lists.freedesktop.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox