if (mdev->mthca_flags & MTHCA_FLAG_SRQ) mthca_free_icm_table(mdev, mdev->srq_table.table); mthca_free_icm_table(mdev, mdev->cq_table.table); mthca_free_icm_table(mdev, mdev->qp_table.rdb_table); mthca_free_icm_table(mdev, mdev->qp_table.eqp_table); mthca_free_icm_table(mdev, mdev->qp_table.qp_table); mthca_free_icm_table(mdev, mdev->mr_table.mpt_table); mthca_free_icm_table(mdev, mdev->mr_table.mtt_table); mthca_unmap_eq_icm(mdev);  mthca_UNMAP_ICM_AUX(mdev, &status); mthca_free_icm(mdev, mdev->fw.arbel.aux_icm); 
mthca_free_icms(mdev); 
static int __devinit mthca_init_arbel(struct mthca_dev *mdev){	struct mthca_dev_lim        dev_lim;	struct mthca_profile        profile;	struct mthca_init_hca_param init_hca;	u64 icm_size;	u8 status;	int err;	err = mthca_QUERY_FW(mdev, &status);	if (err) {		mthca_err(mdev, "QUERY_FW command failed, aborting.\n");		return err;	}	if (status) {		mthca_err(mdev, "QUERY_FW returned status 0x%02x, "			  "aborting.\n", status);		return -EINVAL;	}	err = mthca_ENABLE_LAM(mdev, &status);	if (err) {		mthca_err(mdev, "ENABLE_LAM command failed, aborting.\n");		return err;	}	if (status == MTHCA_CMD_STAT_LAM_NOT_PRE) {		mthca_dbg(mdev, "No HCA-attached memory (running in MemFree mode)\n");		mdev->mthca_flags |= MTHCA_FLAG_NO_LAM;	} else if (status) {		mthca_err(mdev, "ENABLE_LAM returned status 0x%02x, "			  "aborting.\n", status);		return -EINVAL;	}	err = mthca_load_fw(mdev);	if (err) {		mthca_err(mdev, "Failed to start FW, aborting.\n");		goto err_disable;	}	err = mthca_dev_lim(mdev, &dev_lim);	if (err) {		mthca_err(mdev, "QUERY_DEV_LIM command failed, aborting.\n");		goto err_stop_fw;	}	profile = default_profile;	profile.num_uar  = dev_lim.uar_size / PAGE_SIZE;	profile.num_udav = 0;	if (mdev->mthca_flags & MTHCA_FLAG_SRQ)		profile.num_srq = dev_lim.max_srqs;	icm_size = mthca_make_profile(mdev, &profile, &dev_lim, &init_hca);	if ((int) icm_size < 0) {		err = icm_size;		goto err_stop_fw;	}	err = mthca_init_icm(mdev, &dev_lim, &init_hca, icm_size);	if (err)		goto err_stop_fw;	err = mthca_INIT_HCA(mdev, &init_hca, &status);	if (err) {		mthca_err(mdev, "INIT_HCA command failed, aborting.\n");		goto err_free_icm;	}	if (status) {		mthca_err(mdev, "INIT_HCA returned status 0x%02x, "			  "aborting.\n", status);		err = -EINVAL;		goto err_free_icm;	}	return 0;err_free_icm:	if (mdev->mthca_flags & MTHCA_FLAG_SRQ)		mthca_free_icm_table(mdev, mdev->srq_table.table);	mthca_free_icm_table(mdev, mdev->cq_table.table);	mthca_free_icm_table(mdev, mdev->qp_table.rdb_table);	mthca_free_icm_table(mdev, mdev->qp_table.eqp_table);	mthca_free_icm_table(mdev, mdev->qp_table.qp_table);	mthca_free_icm_table(mdev, mdev->mr_table.mpt_table);	mthca_free_icm_table(mdev, mdev->mr_table.mtt_table);	mthca_unmap_eq_icm(mdev);	mthca_UNMAP_ICM_AUX(mdev, &status);	mthca_free_icm(mdev, mdev->fw.arbel.aux_icm);err_stop_fw:	mthca_UNMAP_FA(mdev, &status);	mthca_free_icm(mdev, mdev->fw.arbel.fw_icm);err_disable:	if (!(mdev->mthca_flags & MTHCA_FLAG_NO_LAM))		mthca_DISABLE_LAM(mdev, &status);	return err;}
10457	/local/tlutelli/issta_data/temp/c/2005_temp/2005/10457/aba7a22f291c13448177b28e0e3d01260ed04fbe/mthca_main.c/clean/drivers/infiniband/hw/mthca/mthca_main.c