Thread (107 messages) 107 messages, 5 authors, 2019-11-27

Re: [Very RFC 40/46] powernv/npu: Don't drop refcount when looking up GPU pci_devs

From: Greg Kurz <hidden>
Date: 2019-11-27 12:23:25

On Wed, 27 Nov 2019 20:40:00 +1100
"Oliver O'Halloran" [off-list ref] wrote:
On Wed, Nov 27, 2019 at 8:34 PM Greg Kurz [off-list ref] wrote:
quoted

If everyone is ok with leaking a reference in the NPU case, I guess
this isn't a problem. But if we move forward with Oliver's patch, a
pci_dev_put() would be needed for OpenCAPI, correct ?
Yes, but I think that's fair enough. By convention it's the callers
responsibility to drop the ref when it calls a function that returns a
refcounted object. Doing anything else creates a race condition since
the object's count could drop to zero before the caller starts using
it.
Sure, you're right, especially with Frederic's patch that drops
the pci_dev_get(dev) in pnv_ioda_setup_dev_PE().
Oliver
  
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help