From mboxrd@z Thu Jan 1 00:00:00 1970 From: Takashi Iwai Subject: Re: A bug about cache inconsistency report Date: Tue, 31 Jul 2018 13:59:20 +0200 Message-ID: References: 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 mx1.suse.de (mx2.suse.de [195.135.220.15]) by alsa0.perex.cz (Postfix) with ESMTP id 84AFB267365 for ; Tue, 31 Jul 2018 13:59:21 +0200 (CEST) In-Reply-To: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org To: "Hans Hu(SH-RD)" Cc: "'alsa-devel@alsa-project.org'" List-Id: alsa-devel@alsa-project.org On Tue, 31 Jul 2018 12:52:04 +0200, Hans Hu(SH-RD) wrote: > > Hi All, > > Try send an email. > > Appearance: > when use non-snoop + ioctl path combination, an issue occurs: > usage: aplay -D plughw:0,0 44100_S16_LE_2c.wav > Ubuntu, it performance intermittently noise; > > Root case: > Function set_pages_array_wc marked the PTE of the original address; Function set_memory_wc marked the PTE both original and after vmaped address. > [cid:image002.png@01D428FF.92621520] > However, cache or not in transmission process is based on the PTE of the later, and the set_pages_array_wc did't mark it, so a cache inconsistency issue occurs. > > Related bug: > SHA1 ID: 9ddf1aeb2134e72275c97a2c6ff2e3eb04f2f27a OK, so did you confirm that dropping the SG buffer support "fixes" the noise problem on your system? The easiest test would be like: --- a/sound/pci/hda/hda_controller.c +++ b/sound/pci/hda/hda_controller.c @@ -770,7 +770,7 @@ int snd_hda_attach_pcm_stream(struct hda_bus *_bus, struct hda_codec *codec, size = CONFIG_SND_HDA_PREALLOC_SIZE * 1024; if (size > MAX_PREALLOC_SIZE) size = MAX_PREALLOC_SIZE; - snd_pcm_lib_preallocate_pages_for_all(pcm, SNDRV_DMA_TYPE_DEV_SG, + snd_pcm_lib_preallocate_pages_for_all(pcm, SNDRV_DMA_TYPE_DEV, chip->card->dev, size, MAX_PREALLOC_SIZE); return 0; thanks, Takashi