dn->eeh_mode |= EEH_MODE_ISOLATED;
pdn->eeh_mode |= EEH_MODE_ISOLATED;
int eeh_dn_check_failure(struct device_node *dn, struct pci_dev *dev){	int ret;	int rets[3];	unsigned long flags;	int rc, reset_state;	struct eeh_event  *event;	__get_cpu_var(total_mmio_ffs)++;	if (!eeh_subsystem_enabled)		return 0;	if (!dn)		return 0;	/* Access to IO BARs might get this far and still not want checking. */	if (!(dn->eeh_mode & EEH_MODE_SUPPORTED) ||	    dn->eeh_mode & EEH_MODE_NOCHECK) {		return 0;	}	if (!dn->eeh_config_addr) {		return 0;	}	/*	 * If we already have a pending isolation event for this	 * slot, we know it's bad already, we don't need to check...	 */	if (dn->eeh_mode & EEH_MODE_ISOLATED) {		atomic_inc(&eeh_fail_count);		if (atomic_read(&eeh_fail_count) >= EEH_MAX_FAILS) {			/* re-read the slot reset state */			if (read_slot_reset_state(dn, rets) != 0)				rets[0] = -1;	/* reset state unknown */			eeh_panic(dev, rets[0]);		}		return 0;	}	/*	 * Now test for an EEH failure.  This is VERY expensive.	 * Note that the eeh_config_addr may be a parent device	 * in the case of a device behind a bridge, or it may be	 * function zero of a multi-function device.	 * In any case they must share a common PHB.	 */	ret = read_slot_reset_state(dn, rets);	if (!(ret == 0 && rets[1] == 1 && (rets[0] == 2 || rets[0] == 4))) {		__get_cpu_var(false_positives)++;		return 0;	}	/* prevent repeated reports of this failure */	dn->eeh_mode |= EEH_MODE_ISOLATED;	reset_state = rets[0];	spin_lock_irqsave(&slot_errbuf_lock, flags);	memset(slot_errbuf, 0, eeh_error_buf_size);	rc = rtas_call(ibm_slot_error_detail,	               8, 1, NULL, dn->eeh_config_addr,	               BUID_HI(dn->phb->buid),	               BUID_LO(dn->phb->buid), NULL, 0,	               virt_to_phys(slot_errbuf),	               eeh_error_buf_size,	               1 /* Temporary Error */);	if (rc == 0)		log_error(slot_errbuf, ERR_TYPE_RTAS_LOG, 0);	spin_unlock_irqrestore(&slot_errbuf_lock, flags);	printk(KERN_INFO "EEH: MMIO failure (%d) on device: %s %s\n",	       rets[0], dn->name, dn->full_name);	event = kmalloc(sizeof(*event), GFP_ATOMIC);	if (event == NULL) {		eeh_panic(dev, reset_state);		return 1; 	}	event->dev = dev;	event->dn = dn;	event->reset_state = reset_state;	/* We may or may not be called in an interrupt context */	spin_lock_irqsave(&eeh_eventlist_lock, flags);	list_add(&event->list, &eeh_eventlist);	spin_unlock_irqrestore(&eeh_eventlist_lock, flags);	/* Most EEH events are due to device driver bugs.  Having	 * a stack trace will help the device-driver authors figure	 * out what happened.  So print that out. */	dump_stack();	schedule_work(&eeh_event_wq);	return 0;}