[PATCHv4 1/2] ppc64: perform proper max_bus_speed detection

Tony Breeds tony at bakeyournoodle.com
Fri May 3 16:40:08 EST 2013


On Thu, May 02, 2013 at 12:21:37PM -0300, Kleber Sacilotto de Souza wrote:

> Hi Tony,
> 
> It seems Lucas' change is a bit incomplete and is not handling the reference counter to
> the device_node correctly. Is the following change what you had in mind?

Ahh Sorry I expected there would be a for_each_parent_of_node macro.
I did a quick grep and it seems that's not very common, so open coding
it should be fine.
 
> 
> 	dn = pcibios_get_phb_of_node(bus);
> 	if (!dn)
> 		return 0;
> 
> 	for (pdn = dn; pdn != NULL; pdn = of_get_next_parent(pdn)) {
> 		pcie_link_speed_stats = (const uint32_t *) of_get_property(pdn,
> 			"ibm,pcie-link-speed-stats", NULL);
> 		if (pcie_link_speed_stats)
> 			break;
> 	}
> 
> 	of_node_put(pdn);

I think you need the of_node_put() in the body of the loop, otherwise
aren't you leaking refcounts?
 
Yours Tony
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: not available
URL: <http://lists.ozlabs.org/pipermail/linuxppc-dev/attachments/20130503/90d47969/attachment.sig>


More information about the Linuxppc-dev mailing list