[PATCH] CXL: Fix device_node reference counting

Ian Munsie imunsie at au1.ibm.com
Wed Jan 28 16:53:44 AEDT 2015


Excerpts from Michael Ellerman's message of 2015-01-28 16:04:40 +1100:
> > I just wanted to check the status of this one? I can't see it in your
> > tree and wanted to make sure you didn't simply miss it.
> 
> It looked fishy, but I never got around to replying.
> 
> The second sentence in the explanation should never be true:

Right, that was the point of the fix ;)

> You shouldn't have np unless you did an of_node_get() to get it, otherwise it's
> pointing at something you don't have a reference for and it might go away at
> any time.
> 
> So the patch may fix the bug but I don't think it's correct.
> 
> I think pnv_pci_to_phb_node() should be doing a get for you, before returning
> the pointer.

Agreed - we should probably also rename it to have 'get' in the name,
like pnv_pci_get_phb_node().

> See as a comparison pcibios_get_phb_of_node().

We could almost use that instead, except it's not exported for modules
and I'm not sure if that even works with __weak functions?


Ryan - do you want to respin this, or would you rather I take it?

Cheers,
-Ian



More information about the Linuxppc-dev mailing list