wrmsr(MSR_FIDVID_CTL, lo, STOP_GRANT_5NS);  if (query_current_values_with_pending_wait(data)) return 1;
do { wrmsr(MSR_FIDVID_CTL, lo, STOP_GRANT_5NS); if (i++ > 100) { printk(KERN_ERR PFX "internal error - pending bit very stuck - no further pstate changes possible\n"); return 1; } } while (query_current_values_with_pending_wait(data));
static int write_new_vid(struct powernow_k8_data *data, u32 vid){	u32 lo;	u32 savefid = data->currfid;	if ((data->currfid & INVALID_FID_MASK) || (vid & INVALID_VID_MASK)) {		printk(KERN_ERR PFX "internal error - overflow on vid write\n");		return 1;	}	lo = data->currfid | (vid << MSR_C_LO_VID_SHIFT) | MSR_C_LO_INIT_FID_VID;	dprintk("writing vid 0x%x, lo 0x%x, hi 0x%x\n",		vid, lo, STOP_GRANT_5NS);	wrmsr(MSR_FIDVID_CTL, lo, STOP_GRANT_5NS);	if (query_current_values_with_pending_wait(data))		return 1;	if (savefid != data->currfid) {		printk(KERN_ERR PFX "fid changed on vid trans, old 0x%x new 0x%x\n",		       savefid, data->currfid);		return 1;	}	if (vid != data->currvid) {		printk(KERN_ERR PFX "vid trans failed, vid 0x%x, curr 0x%x\n", vid,				data->currvid);		return 1;	}	return 0;}