spapr_pci: fix the path while fetching loc-code from host DT
PATCH 1/1 spapr_pci: fix the path while fetching loc-code from host DT
The function spapr_phb_vfio_get_loc_code uses wrong path for fetching loc-code from host DT
this is the call that needs to be fixed:
/* Construct and read from host device tree the loc-code */ path = g_strdup_printf("/proc/device-tree%s/ibm,loc-code", buf);
--- hw/ppc/spapr_pci.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
hw/ppc/spapr_pci.c +1 -1
@@ -762,7 +762,7 @@ static char *spapr_phb_vfio_get_loc_code(sPAPRPHBState *sphb, PCIDevice *pdev)g_free (path);/* Construct and read from host device tree the loc-code */ - path =g_strdup_printf ("/proc/device-tree%s/ibm,loc-code" , buf); + path =g_strdup_printf ("/proc/device-tree/%s/ibm,loc-code" , buf);g_free (buf);if (!g_file_get_contents (path, &buf,NULL ,NULL )) { goto err_out;
Signature · 1 line
1.8.3.1
Quoted 6 lines · Seeteena Thoufeek
The function
spapr_phb_vfio_get_loc_codeuses wrong path for fetching loc-code from host DTthis is the call that needs to be fixed:
/* Construct and read from host device tree the loc-code */ path =g_strdup_printf("/proc/device-tree%s/ibm,loc-code", buf);
I do not see why would extra '/' hurt but where does it really fail?
My machines have leading '/' in devspec, do not yours?
aik@garrison2:~$ cat /sys/bus/pci/devices/0009:03:00.0/devspec && echo -e '\n' /pciex@3fffe40500000/pci@0/pci@0/pci@1/usb-xhci@0
Quoted 20 lines
Signed-off-by Seeteena Thoufeek <[email protected]>--- hw/ppc/spapr_pci.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)hw/ppc/spapr_pci.c +1
-1@@ -762,7 +762,7 @@ static char *spapr_phb_vfio_get_loc_code(sPAPRPHBState *sphb, PCIDevice *pdev)g_free (path);/* Construct and read from host device tree the loc-code */ - path =g_strdup_printf ("/proc/device-tree%s/ibm,loc-code" , buf); + path =g_strdup_printf ("/proc/device-tree/%s/ibm,loc-code" , buf);g_free (buf);if (!g_file_get_contents (path, &buf,NULL ,NULL )) { goto err_out;
Signature · 1 line
Alexey
Quoted 9 lines · Alexey Kardashevskiy
Quoted 6 lines · Seeteena Thoufeek
The function
spapr_phb_vfio_get_loc_codeuses wrong path for fetching loc-code from host DTthis is the call that needs to be fixed:
/* Construct and read from host device tree the loc-code */ path =g_strdup_printf("/proc/device-tree%s/ibm,loc-code", buf);
Quoted 6 lines
I do not see why would extra '/' hurt but where does it really fail?
My machines have leading '/' in devspec, do not yours?
aik@garrison2:~$ cat /sys/bus/pci/devices/0009:03:00.0/devspec && echo -e '\n' /pciex@3fffe40500000/pci@0/pci@0/pci@1/usb-xhci@0
Right, what Alexey said. I see no reason to change this.
Quoted 26 lines
Quoted 24 lines
Signed-off-by Seeteena Thoufeek <[email protected]>--- hw/ppc/spapr_pci.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)hw/ppc/spapr_pci.c +1
-1@@ -762,7 +762,7 @@ static char *spapr_phb_vfio_get_loc_code(sPAPRPHBState *sphb, PCIDevice *pdev)g_free (path);/* Construct and read from host device tree the loc-code */ - path =g_strdup_printf ("/proc/device-tree%s/ibm,loc-code" , buf); + path =g_strdup_printf ("/proc/device-tree/%s/ibm,loc-code" , buf);g_free (buf);if (!g_file_get_contents (path, &buf,NULL ,NULL )) { goto err_out;
Signature · 4 lines
David Gibson | I'll have my music baroque, and my code david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_ | _way_ _around_! http://www.ozlabs.org/~dgibson
Quoted 3 lines · On Tue, 7 Nov 2017 18:48:58 +0530 Seeteena Thoufeek…
The function
spapr_phb_vfio_get_loc_codeuses wrong path for fetching loc-code from host DT
Why is it wrong ? Are you experiencing actual issues ?
Quoted 4 lines
this is the call that needs to be fixed:
/* Construct and read from host device tree the loc-code */ path =g_strdup_printf("/proc/device-tree%s/ibm,loc-code", buf);
This statement is useless, especially with such a trivial patch.
Have a look at the following page:
https://robots.thoughtbot.com/5-useful-tips-for-a-better-commit-message
Cheers,
--
Greg
Quoted 18 lines
Signed-off-by Seeteena Thoufeek <[email protected]>--- hw/ppc/spapr_pci.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)hw/ppc/spapr_pci.c +1
-1@@ -762,7 +762,7 @@ static char *spapr_phb_vfio_get_loc_code(sPAPRPHBState *sphb, PCIDevice *pdev)g_free (path);/* Construct and read from host device tree the loc-code */ - path =g_strdup_printf ("/proc/device-tree%s/ibm,loc-code" , buf); + path =g_strdup_printf ("/proc/device-tree/%s/ibm,loc-code" , buf);g_free (buf);if (!g_file_get_contents (path, &buf,NULL ,NULL )) { goto err_out;
Apologize for the confusion. I thought devspec is not having leading '/'.
I checked devspec in my system and it works as expected.
Quoted 38 lines · Alexey Kardashevskiy
Quoted 6 lines · Seeteena Thoufeek
The function
spapr_phb_vfio_get_loc_codeuses wrong path for fetching loc-code from host DTthis is the call that needs to be fixed:
/* Construct and read from host device tree the loc-code */ path =g_strdup_printf("/proc/device-tree%s/ibm,loc-code", buf);I do not see why would extra '/' hurt but where does it really fail?
My machines have leading '/' in devspec, do not yours?
aik@garrison2:~$ cat /sys/bus/pci/devices/0009:03:00.0/devspec && echo -e '\n' /pciex@3fffe40500000/pci@0/pci@0/pci@1/usb-xhci@0Quoted 19 lines
Signed-off-by Seeteena Thoufeek <[email protected]>--- hw/ppc/spapr_pci.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)hw/ppc/spapr_pci.c +1
-1@@ -762,7 +762,7 @@ static char *spapr_phb_vfio_get_loc_code(sPAPRPHBState *sphb, PCIDevice *pdev)g_free (path);/* Construct and read from host device tree the loc-code */ - path =g_strdup_printf ("/proc/device-tree%s/ibm,loc-code" , buf); + path =g_strdup_printf ("/proc/device-tree/%s/ibm,loc-code" , buf);g_free (buf);if (!g_file_get_contents (path, &buf,NULL ,NULL )) { goto err_out;