rem: for (i = 0; i < PCIE_MAX_PWR_LEVELS; i++) { total += (pwr_p->pwr_counters)[i]; } if (total == 0 && pwr_p->pwr_hold > 0) { DBG(DBG_PWR, dip, "pm_add_comps: decrementing hold \n"); pwr_p->pwr_hold--; ASSERT(pwr_p->pwr_flags & PCIE_PM_BUSY); }
context: pcie_add_comps(dev_info_t *dip, dev_info_t *cdip, pcie_pwr_t *pwr_p){	int comps = PM_NUMCMPTS(cdip);	pcie_pm_t *pcie_pm_p;	pcie_pwr_child_t *cpwr_p;	int i, total = 0;	ASSERT(MUTEX_HELD(&pwr_p->pwr_lock));	if (!comps)		return;	/*	 * Remove the hold done at the time of our attach.	 * This is done when we add the first child. If the	 * sum of our counters is zero, that means we are	 * adding the first child.	 */	for (i = 0; i < PCIE_MAX_PWR_LEVELS; i++) {		total += (pwr_p->pwr_counters)[i];	}	if (total == 0 && pwr_p->pwr_hold > 0) {		DBG(DBG_PWR, dip, "pm_add_comps: decrementing hold \n");		pwr_p->pwr_hold--;		ASSERT(pwr_p->pwr_flags & PCIE_PM_BUSY);	}	DBG(DBG_PWR, dip, "pcie_add_comps: unknown level counter incremented "	    "from %d by %d because of %s@%d\n",	    (pwr_p->pwr_counters)[PCIE_UNKNOWN_INDEX], comps,	    ddi_driver_name(cdip), ddi_get_instance(cdip));	(pwr_p->pwr_counters)[PCIE_UNKNOWN_INDEX] += comps;	/*	 * Allocate counters per child. This is a part of pcie	 * pm info. If there is no pcie pm info, allocate it here.	 * pcie pm info might already be there for pci express nexus	 * driver e.g. px_pci. For all leaf nodes, it is allocated here.	 */	if ((pcie_pm_p = PCIE_PMINFO(cdip)) == NULL) {		pcie_pm_p = (pcie_pm_t *)kmem_zalloc(		    sizeof (pcie_pm_t), KM_SLEEP);		PCIE_SET_PMINFO(cdip, pcie_pm_p);	}	cpwr_p = (pcie_pwr_child_t *)kmem_zalloc(sizeof (pcie_pwr_child_t),		    KM_SLEEP);	pcie_pm_p->pcie_par_pminfo = cpwr_p;	(cpwr_p->pwr_child_counters)[PCIE_UNKNOWN_INDEX] += comps;}