Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1650562
| From | Mika Westerberg <mika.westerberg@linux.intel.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH 15/24] thunderbolt: Rework control channel to be more reliable |
| Date | 2017-05-25 16:40 +0200 |
| Message-ID | <tL25H-WE-3@gated-at.bofh.it> (permalink) |
| References | <tIuKR-3YK-5@gated-at.bofh.it> <tIuUy-44c-21@gated-at.bofh.it> <tL0ZZ-iP-23@gated-at.bofh.it> |
| Organization | Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo |
On Thu, May 25, 2017 at 03:25:46PM +0200, Greg Kroah-Hartman wrote:
> > +/**
> > + * tb_cfg_request_put() - Decrease refcount and possibly release the request
> > + * @req: Request whose refcount is decreased
> > + *
> > + * Call this function when you are done with the request. When refcount
> > + * goes to %0 the object is released.
> > + */
> > +void tb_cfg_request_put(struct tb_cfg_request *req)
> > +{
> > + kref_put(&req->kref, tb_cfg_request_destroy);
> > +}
>
> What prevents this call from being called twice on the same object from
> different threads at the same time? You still need a lock somewhere to
> protect yourself from that, am I just missing where that lock is?
No, you are right - it is missing a lock. I will add it there in the
next version.
Thanks.
Back to linux.kernel | Previous | Next — Previous in thread | Find similar | Unroll thread
Re: [PATCH 15/24] thunderbolt: Rework control channel to be more reliable Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-05-25 15:30 +0200 Re: [PATCH 15/24] thunderbolt: Rework control channel to be more reliable Mika Westerberg <mika.westerberg@linux.intel.com> - 2017-05-25 16:40 +0200
csiph-web