From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752232AbdLHFfd (ORCPT ); Fri, 8 Dec 2017 00:35:33 -0500 Received: from relay1.mentorg.com ([192.94.38.131]:33125 "EHLO relay1.mentorg.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751616AbdLHFfb (ORCPT ); Fri, 8 Dec 2017 00:35:31 -0500 Message-ID: <5A2A2494.2080202@mentor.com> Date: Thu, 7 Dec 2017 21:35:16 -0800 From: Jiada Wang User-Agent: Mozilla/5.0 (X11; Linux i686; rv:11.0) Gecko/20120411 Thunderbird/11.0.1 MIME-Version: 1.0 To: Kuninori Morimoto CC: , , , , , Subject: Re: [PATCH v1 1/2] ASoC: rsnd: ssi: fix race condition in rsnd_ssi_pointer_update References: <1512634956-17760-1-git-send-email-jiada_wang@mentor.com> <1512634956-17760-2-git-send-email-jiada_wang@mentor.com> <87y3me7uce.wl%kuninori.morimoto.gx@renesas.com> In-Reply-To: <87y3me7uce.wl%kuninori.morimoto.gx@renesas.com> Content-Type: text/plain; charset="ISO-8859-1"; format=flowed Content-Transfer-Encoding: 7bit X-ClientProxiedBy: svr-orw-mbx-03.mgc.mentorg.com (147.34.90.203) To svr-orw-mbx-03.mgc.mentorg.com (147.34.90.203) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hello Morimoto-san On 12/07/2017 01:45 AM, Kuninori Morimoto wrote: > Hi Jiada > > Thank you for your patch > >> Currently there is race condition between set of byte_pos and wrap >> it around when new buffer starts. If .pointer is called in-between >> it will result in inconsistent pointer position be returned >> from .pointer callback. >> >> This patch increments buffer pointer atomically to avoid this issue. >> >> Signed-off-by: Jiada Wang >> Reviewed-by: Takashi Sakamoto >> --- > You using playback with PIO mode ? > Because this function is no longer used on DMA mode No, we are using rcar sound in DMA mode, our original patch resolves the issue in core.c for both PIO & DMA mode. but with your commit a97a06c ("ASoC: rsnd: cleanup pointer related code"), DMA mode no longer has the race condition issue, so I ported our fix patch to only address the issue in PIO mode Thanks, Jiada > Best regards > --- > Kuninori Morimoto