[PATCH] powerpc/kernel: Change retrieval of pci_dn
Bryant G. Ly
bryantly at linux.vnet.ibm.com
Tue Aug 29 23:19:47 AEST 2017
On 8/29/17 1:20 AM, Sam Bobroff wrote:
> On Mon, Aug 28, 2017 at 11:05:03AM -0500, Bryant G. Ly wrote:
>> For a PCI device it's pci_dn can be retrieved from
>> pdev->dev.archdata.firmware_data, PCI_DN(devnode), or parent's list.
>> Thus, we should just use the generic function pci_get_pdn_by_devfn
>> to get the pci_dn.
>>
>> Signed-off-by: Bryant G. Ly <bgly at us.ibm.com>
> Reviewed-by: Sam Bobroff <sam.bobroff at au1.ibm.com>
>
> I don't know this area but I tested it using a patched kernel with the
> old and new code together. My test kernel booted fine (in QEMU+KVM) and
> I saw 26 reads and 4 writes, all of which got the same value with either
> code block.
>
> I also checked that the error result in the "not found" case is the same
> as well, which it is, because rtas_{read,write}_config() will return
> PCIBIOS_DEVICE_NOT_FOUND if given a NULL pdn.
>
> So, looks good to me.
>
> Cheers,
> Sam.
>
Thanks for the review Sam!
More information about the Linuxppc-dev
mailing list