: powerpc: pseries: Print PCI slot location code on failure
Subsystems (2)
PATCH 1/1 : powerpc: pseries: Print PCI slot location code on failure
Resending an older patch (from 28 April) that seems to have fallen through the cracks, its not in mailine, is not in -mm and its not controversial (its mostly a printk change). Tested.
--linas
The PCI error recovery code will printk diagnostic info when a PCI error event occurs. Change the messages to include the slot location code, which is how most sysadmins will know the device.
----
arch/powerpc/platforms/pseries/eeh_driver.c | 33 ++++++++++++++++------------ 1 files changed, 20 insertions(+), 13 deletions(-)
arch/powerpc/platforms/pseries/eeh_driver.c +20 -13
@@ -261,16 +261,20 @@ struct pci_dn * handle_eeh_events (strucstruct pci_bus *frozen_bus;int rc =0 ;enum pci_ers_result result =PCI_ERS_RESULT_NONE ; -const char *pci_str, *drv_str; +const char *location, *pci_str, *drv_str; frozen_dn =find_device_pe (event->dn); frozen_bus =pcibios_find_pci_bus (frozen_dn);if (!frozen_dn) { -printk (KERN_ERR "EEH: Error: Cannot find partition endpoint for %s\n" , -pci_name (event->dev)); + + location = (char *)get_property (event->dn,"ibm,loc-code" ,NULL ); +printk (KERN_ERR "EEH: Error: Cannot find partition endpoint " +"for location=%s pci addr=%s\n" , + location,pci_name (event->dev));return NULL ; } + location = (char *)get_property (frozen_dn,"ibm,loc-code" ,NULL );/* There are two different styles for coming up with the PE. * In the old style, it was the highest EEH-capable device
@@ -282,8 +286,9 @@ struct pci_dn * handle_eeh_events (struc frozen_bus =pcibios_find_pci_bus (frozen_dn->parent);if (!frozen_bus) { -printk (KERN_ERR "EEH: Cannot find PCI bus for %s\n" , - frozen_dn->full_name); +printk (KERN_ERR "EEH: Cannot find PCI bus " +"for location=%s dn=%s\n" , + location, frozen_dn->full_name);return NULL ; }
@@ -318,8 +323,9 @@ struct pci_dn * handle_eeh_events (struceeh_slot_error_detail (frozen_pdn,1 /* Temporary Error */ );printk (KERN_WARNING -"EEH: This PCI device has failed %d times since last reboot: %s - %s\n" , - frozen_pdn->eeh_freeze_count, drv_str, pci_str); +"EEH: This PCI device has failed %d times since last reboot: " +"location=%s driver=%s pci addr=%s\n" , + frozen_pdn->eeh_freeze_count, location, drv_str, pci_str);/* Walk the various device drivers attached to this slot through * a reset sequence, giving each an opportunity to do what it needs
@@ -368,17 +374,18 @@ excess_failures:* due to actual, failed cards. */ printk (KERN_ERR -"EEH: PCI device %s - %s has failed %d times \n" -"and has been permanently disabled. Please try reseating\n" -"this device or replacing it.\n" , - drv_str, pci_str, frozen_pdn->eeh_freeze_count); +"EEH: PCI device at location=%s driver=%s pci addr=%s \n" +"has failed %d times and has been permanently disabled. \n" +"Please try reseating this device or replacing it.\n" , + location, drv_str, pci_str, frozen_pdn->eeh_freeze_count); goto perm_error; hard_fail:printk (KERN_ERR -"EEH: Unable to recover from failure of PCI device %s - %s\n" +"EEH: Unable to recover from failure of PCI device " +"at location=%s driver=%s pci addr=%s \n" "Please try reseating this device or replacing it.\n" , - drv_str, pci_str); + location, drv_str, pci_str); perm_error:eeh_slot_error_detail (frozen_pdn,2 /* Permanent Error */ );
Quoted 3 lines · Linas Vepstas
Resending an older patch (from 28 April) that seems to have fallen through the cracks, its not in mailine, is not in -mm and its not controversial (its mostly a printk change). Tested.
I don't like doing printk on things that might be NULL (i.e. the result of get_property). Even though printk doesn't crash, it would be nicer for the user to see "location=unknown" or something rather than "location=<NULL>".
Paul.
Quoted 10 lines · Paul Mackerras
Quoted 3 lines · Linas Vepstas
Resending an older patch (from 28 April) that seems to have fallen through the cracks, its not in mailine, is not in -mm and its not controversial (its mostly a printk change). Tested.
I don't like doing printk on things that might be NULL (i.e. the result of
get_property). Even though printk doesn't crash, it would be nicer for the user to see "location=unknown" or something rather than "location=<NULL>".
Right. Revised patch below.
--------------
[PATCH]: powerpc/pseries: Print PCI slot location code on failure
The PCI error recovery code will printk diagnostic info when a PCI error event occurs. Change the messages to include the slot location code, which is how most sysadmins will know the device.
----
arch/powerpc/platforms/pseries/eeh_driver.c | 35 +++++++++++++++++----------- 1 files changed, 22 insertions(+), 13 deletions(-)
arch/powerpc/platforms/pseries/eeh_driver.c +22 -13
@@ -261,16 +261,22 @@ struct pci_dn * handle_eeh_events (strucstruct pci_bus *frozen_bus;int rc =0 ;enum pci_ers_result result =PCI_ERS_RESULT_NONE ; -const char *pci_str, *drv_str; +const char *location, *pci_str, *drv_str; frozen_dn =find_device_pe (event->dn); frozen_bus =pcibios_find_pci_bus (frozen_dn);if (!frozen_dn) { -printk (KERN_ERR "EEH: Error: Cannot find partition endpoint for %s\n" , -pci_name (event->dev)); + + location = (char *)get_property (event->dn,"ibm,loc-code" ,NULL ); + location = location ? location :"unknown" ; +printk (KERN_ERR "EEH: Error: Cannot find partition endpoint " +"for location=%s pci addr=%s\n" , + location,pci_name (event->dev));return NULL ; } + location = (char *)get_property (frozen_dn,"ibm,loc-code" ,NULL ); + location = location ? location :"unknown" ;/* There are two different styles for coming up with the PE. * In the old style, it was the highest EEH-capable device
@@ -282,8 +288,9 @@ struct pci_dn * handle_eeh_events (struc frozen_bus =pcibios_find_pci_bus (frozen_dn->parent);if (!frozen_bus) { -printk (KERN_ERR "EEH: Cannot find PCI bus for %s\n" , - frozen_dn->full_name); +printk (KERN_ERR "EEH: Cannot find PCI bus " +"for location=%s dn=%s\n" , + location, frozen_dn->full_name);return NULL ; }
@@ -318,8 +325,9 @@ struct pci_dn * handle_eeh_events (struceeh_slot_error_detail (frozen_pdn,1 /* Temporary Error */ );printk (KERN_WARNING -"EEH: This PCI device has failed %d times since last reboot: %s - %s\n" , - frozen_pdn->eeh_freeze_count, drv_str, pci_str); +"EEH: This PCI device has failed %d times since last reboot: " +"location=%s driver=%s pci addr=%s\n" , + frozen_pdn->eeh_freeze_count, location, drv_str, pci_str);/* Walk the various device drivers attached to this slot through * a reset sequence, giving each an opportunity to do what it needs
@@ -368,17 +376,18 @@ excess_failures:* due to actual, failed cards. */ printk (KERN_ERR -"EEH: PCI device %s - %s has failed %d times \n" -"and has been permanently disabled. Please try reseating\n" -"this device or replacing it.\n" , - drv_str, pci_str, frozen_pdn->eeh_freeze_count); +"EEH: PCI device at location=%s driver=%s pci addr=%s \n" +"has failed %d times and has been permanently disabled. \n" +"Please try reseating this device or replacing it.\n" , + location, drv_str, pci_str, frozen_pdn->eeh_freeze_count); goto perm_error; hard_fail:printk (KERN_ERR -"EEH: Unable to recover from failure of PCI device %s - %s\n" +"EEH: Unable to recover from failure of PCI device " +"at location=%s driver=%s pci addr=%s \n" "Please try reseating this device or replacing it.\n" , - drv_str, pci_str); + location, drv_str, pci_str); perm_error:eeh_slot_error_detail (frozen_pdn,2 /* Permanent Error */ );
Quoted 7 lines · Linas Vepstas
Quoted 6 lines · Paul Mackerras
Quoted 3 lines · Linas Vepstas
Resending an older patch (from 28 April) that seems to have fallen through the cracks, its not in mailine, is not in -mm and its not controversial (its mostly a printk change). Tested.
Quoted 6 lines
Quoted 4 lines
I don't like doing printk on things that might be NULL (i.e. the result of
get_property). Even though printk doesn't crash, it would be nicer for the user to see "location=unknown" or something rather than "location=<NULL>".Right. Revised patch below.
Which inadvertently added trailing whitespace. Trying again.
--------------
[PATCH]: powerpc/pseries: Print PCI slot location code on failure
The PCI error recovery code will printk diagnostic info when a PCI error event occurs. Change the messages to include the slot location code, which is how most sysadmins will know the device.
----
arch/powerpc/platforms/pseries/eeh_driver.c | 35 +++++++++++++++++----------- 1 files changed, 22 insertions(+), 13 deletions(-)
arch/powerpc/platforms/pseries/eeh_driver.c +22 -13
@@ -261,16 +261,22 @@ struct pci_dn * handle_eeh_events (strucstruct pci_bus *frozen_bus;int rc =0 ;enum pci_ers_result result =PCI_ERS_RESULT_NONE ; -const char *pci_str, *drv_str; +const char *location, *pci_str, *drv_str; frozen_dn =find_device_pe (event->dn); frozen_bus =pcibios_find_pci_bus (frozen_dn);if (!frozen_dn) { -printk (KERN_ERR "EEH: Error: Cannot find partition endpoint for %s\n" , -pci_name (event->dev)); + + location = (char *)get_property (event->dn,"ibm,loc-code" ,NULL ); + location = location ? location :"unknown" ; +printk (KERN_ERR "EEH: Error: Cannot find partition endpoint " +"for location=%s pci addr=%s\n" , + location,pci_name (event->dev));return NULL ; } + location = (char *)get_property (frozen_dn,"ibm,loc-code" ,NULL ); + location = location ? location :"unknown" ;/* There are two different styles for coming up with the PE. * In the old style, it was the highest EEH-capable device
@@ -282,8 +288,9 @@ struct pci_dn * handle_eeh_events (struc frozen_bus =pcibios_find_pci_bus (frozen_dn->parent);if (!frozen_bus) { -printk (KERN_ERR "EEH: Cannot find PCI bus for %s\n" , - frozen_dn->full_name); +printk (KERN_ERR "EEH: Cannot find PCI bus " +"for location=%s dn=%s\n" , + location, frozen_dn->full_name);return NULL ; }
@@ -318,8 +325,9 @@ struct pci_dn * handle_eeh_events (struceeh_slot_error_detail (frozen_pdn,1 /* Temporary Error */ );printk (KERN_WARNING -"EEH: This PCI device has failed %d times since last reboot: %s - %s\n" , - frozen_pdn->eeh_freeze_count, drv_str, pci_str); +"EEH: This PCI device has failed %d times since last reboot: " +"location=%s driver=%s pci addr=%s\n" , + frozen_pdn->eeh_freeze_count, location, drv_str, pci_str);/* Walk the various device drivers attached to this slot through * a reset sequence, giving each an opportunity to do what it needs
@@ -368,17 +376,18 @@ excess_failures:* due to actual, failed cards. */ printk (KERN_ERR -"EEH: PCI device %s - %s has failed %d times \n" -"and has been permanently disabled. Please try reseating\n" -"this device or replacing it.\n" , - drv_str, pci_str, frozen_pdn->eeh_freeze_count); +"EEH: PCI device at location=%s driver=%s pci addr=%s \n" +"has failed %d times and has been permanently disabled. \n" +"Please try reseating this device or replacing it.\n" , + location, drv_str, pci_str, frozen_pdn->eeh_freeze_count); goto perm_error; hard_fail:printk (KERN_ERR -"EEH: Unable to recover from failure of PCI device %s - %s\n" +"EEH: Unable to recover from failure of PCI device " +"at location=%s driver=%s pci addr=%s \n" "Please try reseating this device or replacing it.\n" , - drv_str, pci_str); + location, drv_str, pci_str); perm_error:eeh_slot_error_detail (frozen_pdn,2 /* Permanent Error */ );