Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Macros | Functions
eeh_pe.c File Reference
#include <linux/export.h>
#include <linux/gfp.h>
#include <linux/init.h>
#include <linux/kernel.h>
#include <linux/pci.h>
#include <linux/string.h>
#include <asm/pci-bridge.h>
#include <asm/ppc-pci.h>

Go to the source code of this file.

Macros

#define BYTE_SWAP(OFF)   (8*((OFF)/4)+3-(OFF))
 
#define SAVED_BYTE(OFF)   (((u8 *)(edev->config_space))[BYTE_SWAP(OFF)])
 

Functions

int __devinit eeh_phb_pe_create (struct pci_controller *phb)
 
voideeh_pe_dev_traverse (struct eeh_pe *root, eeh_traverse_func fn, void *flag)
 
int eeh_add_to_parent_pe (struct eeh_dev *edev)
 
int eeh_rmv_from_parent_pe (struct eeh_dev *edev, int purge_pe)
 
void eeh_pe_state_mark (struct eeh_pe *pe, int state)
 
void eeh_pe_state_clear (struct eeh_pe *pe, int state)
 
void eeh_pe_restore_bars (struct eeh_pe *pe)
 
struct pci_buseeh_pe_bus_get (struct eeh_pe *pe)
 

Macro Definition Documentation

#define BYTE_SWAP (   OFF)    (8*((OFF)/4)+3-(OFF))
#define SAVED_BYTE (   OFF)    (((u8 *)(edev->config_space))[BYTE_SWAP(OFF)])

Function Documentation

int eeh_add_to_parent_pe ( struct eeh_dev *  edev)

eeh_add_to_parent_pe - Add EEH device to parent PE : EEH device

Add EEH device to the parent PE. If the parent PE already exists, the PE type will be changed to EEH_PE_BUS. Otherwise, we have to create new PE to hold the EEH device and the new PE will be linked to its parent PE as well.

Definition at line 304 of file eeh_pe.c.

struct pci_bus* eeh_pe_bus_get ( struct eeh_pe *  pe)
read

eeh_pe_bus_get - Retrieve PCI bus according to the given PE : EEH PE

Retrieve the PCI bus according to the given PE. Basically, there're 3 types of PEs: PHB/Bus/Device. For PHB PE, the primary PCI bus will be retrieved. The parent bus will be returned for BUS PE. However, we don't have associated PCI bus for DEVICE PE.

Definition at line 632 of file eeh_pe.c.

void* eeh_pe_dev_traverse ( struct eeh_pe *  root,
eeh_traverse_func  fn,
void flag 
)

Definition at line 176 of file eeh_pe.c.

void eeh_pe_restore_bars ( struct eeh_pe *  pe)

eeh_pe_restore_bars - Restore the PCI config space info : EEH PE

This routine performs a recursive walk to the children of this device as well.

Definition at line 613 of file eeh_pe.c.

void eeh_pe_state_clear ( struct eeh_pe *  pe,
int  state 
)

eeh_pe_state_clear - Clear state for the PE and its children : PE : state to be cleared

When the PE and its children has been recovered from error, we need clear the error state for that. The function is used for the purpose.

Definition at line 549 of file eeh_pe.c.

void eeh_pe_state_mark ( struct eeh_pe *  pe,
int  state 
)

eeh_pe_state_mark - Mark specified state for PE and its associated device : EEH PE

EEH error affects the current PE and its child PEs. The function is used to mark appropriate state for the affected PEs and the associated devices.

Definition at line 513 of file eeh_pe.c.

int __devinit eeh_phb_pe_create ( struct pci_controller phb)

eeh_phb_pe_create - Create PHB PE : PCI controller

The function should be called while the PHB is detected during system boot or PCI hotplug in order to create PHB PE.

Definition at line 69 of file eeh_pe.c.

int eeh_rmv_from_parent_pe ( struct eeh_dev *  edev,
int  purge_pe 
)

eeh_rmv_from_parent_pe - Remove one EEH device from the associated PE : EEH device : remove PE or not

The PE hierarchy tree might be changed when doing PCI hotplug. Also, the PCI devices or buses could be removed from the system during EEH recovery. So we have to call the function remove the corresponding PE accordingly if necessary.

Definition at line 411 of file eeh_pe.c.