Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 13746
b: refs/heads/master
c: 7c43ee4
h: refs/heads/master
v: v3
  • Loading branch information
Paul Mackerras committed Nov 10, 2005
1 parent 519989f commit 1b3df13
Show file tree
Hide file tree
Showing 6 changed files with 45 additions and 18 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: fe360cdfd26503a6def1dfebc0ef8371c5071340
refs/heads/master: 7c43ee40ec602db3fa27e6e2d4f092f06ab0901c
48 changes: 32 additions & 16 deletions trunk/arch/powerpc/platforms/pseries/eeh.c
Original file line number Diff line number Diff line change
Expand Up @@ -478,32 +478,47 @@ static struct device_node * find_device_pe(struct device_node *dn)
* an interrupt context, which is bad.
*/

static void __eeh_mark_slot (struct device_node *dn)
static void __eeh_mark_slot (struct device_node *dn, int mode_flag)
{
while (dn) {
PCI_DN(dn)->eeh_mode |= EEH_MODE_ISOLATED;
if (PCI_DN(dn)) {
PCI_DN(dn)->eeh_mode |= mode_flag;

if (dn->child)
__eeh_mark_slot (dn->child);
if (dn->child)
__eeh_mark_slot (dn->child, mode_flag);
}
dn = dn->sibling;
}
}

static void __eeh_clear_slot (struct device_node *dn)
void eeh_mark_slot (struct device_node *dn, int mode_flag)
{
dn = find_device_pe (dn);
PCI_DN(dn)->eeh_mode |= mode_flag;
__eeh_mark_slot (dn->child, mode_flag);
}

static void __eeh_clear_slot (struct device_node *dn, int mode_flag)
{
while (dn) {
PCI_DN(dn)->eeh_mode &= ~EEH_MODE_ISOLATED;
if (dn->child)
__eeh_clear_slot (dn->child);
if (PCI_DN(dn)) {
PCI_DN(dn)->eeh_mode &= ~mode_flag;
PCI_DN(dn)->eeh_check_count = 0;
if (dn->child)
__eeh_clear_slot (dn->child, mode_flag);
}
dn = dn->sibling;
}
}

static inline void eeh_clear_slot (struct device_node *dn)
void eeh_clear_slot (struct device_node *dn, int mode_flag)
{
unsigned long flags;
spin_lock_irqsave(&confirm_error_lock, flags);
__eeh_clear_slot (dn);
dn = find_device_pe (dn);
PCI_DN(dn)->eeh_mode &= ~mode_flag;
PCI_DN(dn)->eeh_check_count = 0;
__eeh_clear_slot (dn->child, mode_flag);
spin_unlock_irqrestore(&confirm_error_lock, flags);
}

Expand All @@ -528,7 +543,6 @@ int eeh_dn_check_failure(struct device_node *dn, struct pci_dev *dev)
int rets[3];
unsigned long flags;
struct pci_dn *pdn;
struct device_node *pe_dn;
int rc = 0;

__get_cpu_var(total_mmio_ffs)++;
Expand Down Expand Up @@ -630,8 +644,7 @@ int eeh_dn_check_failure(struct device_node *dn, struct pci_dev *dev)
/* Avoid repeated reports of this failure, including problems
* with other functions on this device, and functions under
* bridges. */
pe_dn = find_device_pe (dn);
__eeh_mark_slot (pe_dn);
eeh_mark_slot (dn, EEH_MODE_ISOLATED);
spin_unlock_irqrestore(&confirm_error_lock, flags);

eeh_send_failure_event (dn, dev, rets[0], rets[2]);
Expand Down Expand Up @@ -743,9 +756,6 @@ rtas_pci_slot_reset(struct pci_dn *pdn, int state)
rc, state, pdn->node->full_name);
return;
}

if (state == 0)
eeh_clear_slot (pdn->node->parent->child);
}

/** rtas_set_slot_reset -- assert the pci #RST line for 1/4 second
Expand All @@ -764,6 +774,12 @@ rtas_set_slot_reset(struct pci_dn *pdn)

#define PCI_BUS_RST_HOLD_TIME_MSEC 250
msleep (PCI_BUS_RST_HOLD_TIME_MSEC);

/* We might get hit with another EEH freeze as soon as the
* pci slot reset line is dropped. Make sure we don't miss
* these, and clear the flag now. */
eeh_clear_slot (pdn->node, EEH_MODE_ISOLATED);

rtas_pci_slot_reset (pdn, 0);

/* After a PCI slot has been reset, the PCI Express spec requires
Expand Down
2 changes: 1 addition & 1 deletion trunk/drivers/pci/hotplug/rpadlpar_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,7 @@ static int dlpar_add_phb(char *drc_name, struct device_node *dn)
{
struct pci_controller *phb;

if (PCI_DN(dn)->phb) {
if (PCI_DN(dn) && PCI_DN(dn)->phb) {
/* PHB already exists */
return -EINVAL;
}
Expand Down
7 changes: 7 additions & 0 deletions trunk/include/asm-powerpc/ppc-pci.h
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,13 @@ void rtas_configure_bridge(struct pci_dn *);

int rtas_write_config(struct pci_dn *, int where, int size, u32 val);

/**
* mark and clear slots: find "partition endpoint" PE and set or
* clear the flags for each subnode of the PE.
*/
void eeh_mark_slot (struct device_node *dn, int mode_flag);
void eeh_clear_slot (struct device_node *dn, int mode_flag);

#endif

#endif /* _ASM_POWERPC_PPC_PCI_H */
2 changes: 2 additions & 0 deletions trunk/include/asm-ppc64/prom.h
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,8 @@ extern void of_detach_node(const struct device_node *);
extern unsigned long prom_init(unsigned long, unsigned long, unsigned long,
unsigned long, unsigned long);
extern void finish_device_tree(void);
extern void unflatten_device_tree(void);
extern void early_init_devtree(void *);
extern int device_is_compatible(struct device_node *device, const char *);
extern int machine_is_compatible(const char *compat);
extern unsigned char *get_property(struct device_node *node, const char *name,
Expand Down
2 changes: 2 additions & 0 deletions trunk/include/asm-ppc64/system.h
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,8 @@ struct thread_struct;
extern struct task_struct * _switch(struct thread_struct *prev,
struct thread_struct *next);

extern unsigned long klimit;

extern int powersave_nap; /* set if nap mode can be used in idle loop */

/*
Expand Down

0 comments on commit 1b3df13

Please sign in to comment.