if (dev->current_state >= PCI_D3hot) 
if (dev->current_state >= PCI_D3hot) { if (!(pmcsr & PCI_PM_CTRL_NO_SOFT_RESET)) need_restore = 1; 
pci_set_power_state(struct pci_dev *dev, pci_power_t state){	int pm;	u16 pmcsr, pmc;	/* bound the state we're entering */	if (state > PCI_D3hot)		state = PCI_D3hot;	/* Validate current state:	 * Can enter D0 from any state, but if we can only go deeper 	 * to sleep if we're already in a low power state	 */	if (state != PCI_D0 && dev->current_state > state)		return -EINVAL;	else if (dev->current_state == state) 		return 0;        /* we're already there */	/* find PCI PM capability in list */	pm = pci_find_capability(dev, PCI_CAP_ID_PM);		/* abort if the device doesn't support PM capabilities */	if (!pm)		return -EIO; 	pci_read_config_word(dev,pm + PCI_PM_PMC,&pmc);	if ((pmc & PCI_PM_CAP_VER_MASK) > 2) {		printk(KERN_DEBUG		       "PCI: %s has unsupported PM cap regs version (%u)\n",		       pci_name(dev), pmc & PCI_PM_CAP_VER_MASK);		return -EIO;	}	/* check if this device supports the desired state */	if (state == PCI_D1 || state == PCI_D2) {		if (state == PCI_D1 && !(pmc & PCI_PM_CAP_D1))			return -EIO;		else if (state == PCI_D2 && !(pmc & PCI_PM_CAP_D2))			return -EIO;	}	/* If we're in D3, force entire word to 0.	 * This doesn't affect PME_Status, disables PME_En, and	 * sets PowerState to 0.	 */	if (dev->current_state >= PCI_D3hot)		pmcsr = 0;	else {		pci_read_config_word(dev, pm + PCI_PM_CTRL, &pmcsr);		pmcsr &= ~PCI_PM_CTRL_STATE_MASK;		pmcsr |= state;	}	/* enter specified state */	pci_write_config_word(dev, pm + PCI_PM_CTRL, pmcsr);	/* Mandatory power management transition delays */	/* see PCI PM 1.1 5.6.1 table 18 */	if (state == PCI_D3hot || dev->current_state == PCI_D3hot)		msleep(10);	else if (state == PCI_D2 || dev->current_state == PCI_D2)		udelay(200);	/*	 * Give firmware a chance to be called, such as ACPI _PRx, _PSx	 * Firmware method after natice method ?	 */	if (platform_pci_set_power_state)		platform_pci_set_power_state(dev, state);	dev->current_state = state;	return 0;}
4520	/local/tlutelli/issta_data/temp/c/2005_temp/2005/4520/fec59a711eef002d4ef9eb8de09dd0a26986eb77/pci.c/clean/drivers/pci/pci.c