From: Takashi Iwai Subject: Re: [PATCH 1/1] ALSA: intel8x0: Improve comments for VM optimization Date: Tue, 08 Nov 2011 07:51:50 +0100 Message-ID: References: <1320683605-38353-1-git-send-email-den@openvz.org> Mime-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mx2.suse.de (cantor2.suse.de [195.135.220.15]) by alsa0.perex.cz (Postfix) with ESMTP id 04C8724525 for ; Tue, 8 Nov 2011 07:51:53 +0100 (CET) In-Reply-To: <1320683605-38353-1-git-send-email-den@openvz.org> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: alsa-devel-bounces@alsa-project.org Errors-To: alsa-devel-bounces@alsa-project.org To: "Denis V. Lunev" Cc: alsa-devel@alsa-project.org, kozerkov@parallels.com, kraxel@redhat.com List-Id: alsa-devel@alsa-project.org At Mon, 7 Nov 2011 20:33:25 +0400, Denis V. Lunev wrote: > > The recently merged 228cf79376f1 looks a bit hackish while it is not. > The change was quite simple. In a virtualized environment the > patch unhacks old kludge introduced for old broken AC97 hardware. > > This patch adds proper comment to "unkludge" code. > > Signed-off-by: Denis V. Lunev > Signed-off-by: Konstantin Ozerkov Applied now. Thanks. Takashi > --- > sound/pci/intel8x0.c | 7 +++++++ > 1 files changed, 7 insertions(+), 0 deletions(-) > > diff --git a/sound/pci/intel8x0.c b/sound/pci/intel8x0.c > index 29e3125..c3b9bd0 100644 > --- a/sound/pci/intel8x0.c > +++ b/sound/pci/intel8x0.c > @@ -1077,6 +1077,13 @@ static snd_pcm_uframes_t snd_intel8x0_pcm_pointer(struct snd_pcm_substream *subs > } > if (civ != igetbyte(chip, ichdev->reg_offset + ICH_REG_OFF_CIV)) > continue; > + > + /* IO read operation is very expensive inside virtual machine > + * as it is emulated. The probability that subsequent PICB read > + * will return different result is high enough to loop till > + * timeout here. > + * Same CIV is strict enough condition to be sure that PICB > + * is valid inside VM on emulated card. */ > if (chip->inside_vm) > break; > if (ptr1 == igetword(chip, ichdev->reg_offset + ichdev->roff_picb)) > -- > 1.7.4.4 >