@@ -379,8 +379,7 @@ int eeh_add_to_parent_pe(struct eeh_dev *edev)
379379
380380 /* Check if the PE number is valid */
381381 if (!eeh_has_flag (EEH_VALID_PE_ZERO ) && !edev -> pe_config_addr ) {
382- pr_err ("%s: Invalid PE#0 for edev 0x%x on PHB#%x\n" ,
383- __func__ , config_addr , pdn -> phb -> global_number );
382+ eeh_edev_err (edev , "PE#0 is invalid for this PHB!\n" );
384383 return - EINVAL ;
385384 }
386385
@@ -398,12 +397,7 @@ int eeh_add_to_parent_pe(struct eeh_dev *edev)
398397
399398 /* Put the edev to PE */
400399 list_add_tail (& edev -> entry , & pe -> edevs );
401- pr_debug ("EEH: Add %04x:%02x:%02x.%01x to Bus PE#%x\n" ,
402- pdn -> phb -> global_number ,
403- pdn -> busno ,
404- PCI_SLOT (pdn -> devfn ),
405- PCI_FUNC (pdn -> devfn ),
406- pe -> addr );
400+ eeh_edev_dbg (edev , "Added to bus PE\n" );
407401 return 0 ;
408402 } else if (pe && (pe -> type & EEH_PE_INVALID )) {
409403 list_add_tail (& edev -> entry , & pe -> edevs );
@@ -420,13 +414,8 @@ int eeh_add_to_parent_pe(struct eeh_dev *edev)
420414 parent = parent -> parent ;
421415 }
422416
423- pr_debug ("EEH: Add %04x:%02x:%02x.%01x to Device "
424- "PE#%x, Parent PE#%x\n" ,
425- pdn -> phb -> global_number ,
426- pdn -> busno ,
427- PCI_SLOT (pdn -> devfn ),
428- PCI_FUNC (pdn -> devfn ),
429- pe -> addr , pe -> parent -> addr );
417+ eeh_edev_dbg (edev , "Added to device PE (parent: PE#%x)\n" ,
418+ pe -> parent -> addr );
430419 return 0 ;
431420 }
432421
@@ -468,13 +457,8 @@ int eeh_add_to_parent_pe(struct eeh_dev *edev)
468457 list_add_tail (& pe -> child , & parent -> child_list );
469458 list_add_tail (& edev -> entry , & pe -> edevs );
470459 edev -> pe = pe ;
471- pr_debug ("EEH: Add %04x:%02x:%02x.%01x to "
472- "Device PE#%x, Parent PE#%x\n" ,
473- pdn -> phb -> global_number ,
474- pdn -> busno ,
475- PCI_SLOT (pdn -> devfn ),
476- PCI_FUNC (pdn -> devfn ),
477- pe -> addr , pe -> parent -> addr );
460+ eeh_edev_dbg (edev , "Added to device PE (parent: PE#%x)\n" ,
461+ pe -> parent -> addr );
478462
479463 return 0 ;
480464}
@@ -492,15 +476,10 @@ int eeh_rmv_from_parent_pe(struct eeh_dev *edev)
492476{
493477 struct eeh_pe * pe , * parent , * child ;
494478 int cnt ;
495- struct pci_dn * pdn = eeh_dev_to_pdn (edev );
496479
497480 pe = eeh_dev_to_pe (edev );
498481 if (!pe ) {
499- pr_debug ("%s: No PE found for device %04x:%02x:%02x.%01x\n" ,
500- __func__ , pdn -> phb -> global_number ,
501- pdn -> busno ,
502- PCI_SLOT (pdn -> devfn ),
503- PCI_FUNC (pdn -> devfn ));
482+ eeh_edev_dbg (edev , "No PE found for device.\n" );
504483 return - EEXIST ;
505484 }
506485
@@ -717,17 +696,13 @@ static void eeh_bridge_check_link(struct eeh_dev *edev)
717696 if (!(edev -> mode & (EEH_DEV_ROOT_PORT | EEH_DEV_DS_PORT )))
718697 return ;
719698
720- pr_debug ("%s: Check PCIe link for %04x:%02x:%02x.%01x ...\n" ,
721- __func__ , pdn -> phb -> global_number ,
722- pdn -> busno ,
723- PCI_SLOT (pdn -> devfn ),
724- PCI_FUNC (pdn -> devfn ));
699+ eeh_edev_dbg (edev , "Checking PCIe link...\n" );
725700
726701 /* Check slot status */
727702 cap = edev -> pcie_cap ;
728703 eeh_ops -> read_config (pdn , cap + PCI_EXP_SLTSTA , 2 , & val );
729704 if (!(val & PCI_EXP_SLTSTA_PDS )) {
730- pr_debug ( " No card in the slot (0x%04x) !\n" , val );
705+ eeh_edev_dbg ( edev , " No card in the slot (0x%04x) !\n" , val );
731706 return ;
732707 }
733708
@@ -736,7 +711,7 @@ static void eeh_bridge_check_link(struct eeh_dev *edev)
736711 if (val & PCI_EXP_SLTCAP_PCP ) {
737712 eeh_ops -> read_config (pdn , cap + PCI_EXP_SLTCTL , 2 , & val );
738713 if (val & PCI_EXP_SLTCTL_PCC ) {
739- pr_debug ( " In power-off state, power it on ...\n" );
714+ eeh_edev_dbg ( edev , " In power-off state, power it on ...\n" );
740715 val &= ~(PCI_EXP_SLTCTL_PCC | PCI_EXP_SLTCTL_PIC );
741716 val |= (0x0100 & PCI_EXP_SLTCTL_PIC );
742717 eeh_ops -> write_config (pdn , cap + PCI_EXP_SLTCTL , 2 , val );
@@ -752,7 +727,7 @@ static void eeh_bridge_check_link(struct eeh_dev *edev)
752727 /* Check link */
753728 eeh_ops -> read_config (pdn , cap + PCI_EXP_LNKCAP , 4 , & val );
754729 if (!(val & PCI_EXP_LNKCAP_DLLLARC )) {
755- pr_debug ( " No link reporting capability (0x%08x) \n" , val );
730+ eeh_edev_dbg ( edev , " No link reporting capability (0x%08x) \n" , val );
756731 msleep (1000 );
757732 return ;
758733 }
@@ -769,10 +744,10 @@ static void eeh_bridge_check_link(struct eeh_dev *edev)
769744 }
770745
771746 if (val & PCI_EXP_LNKSTA_DLLLA )
772- pr_debug ( " Link up (%s)\n" ,
747+ eeh_edev_dbg ( edev , " Link up (%s)\n" ,
773748 (val & PCI_EXP_LNKSTA_CLS_2_5GB ) ? "2.5GB" : "5GB" );
774749 else
775- pr_debug ( " Link not ready (0x%04x)\n" , val );
750+ eeh_edev_dbg ( edev , " Link not ready (0x%04x)\n" , val );
776751}
777752
778753#define BYTE_SWAP (OFF ) (8*((OFF)/4)+3-(OFF))
0 commit comments