Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp541764imm; Wed, 3 Oct 2018 22:25:18 -0700 (PDT) X-Google-Smtp-Source: ACcGV60R1Y5mWprEPLq1bu5uicSOtKEOexU42dJG1jpoa4LDCJb6MH0JLn2lEHSbSh2Vm3apT6YU X-Received: by 2002:a17:902:22cc:: with SMTP id o12-v6mr4918187plg.108.1538630718805; Wed, 03 Oct 2018 22:25:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1538630718; cv=none; d=google.com; s=arc-20160816; b=s5AmLFrJLaR005ByiCxE4HJ42rqOFuu0BGXFOnTns9oBBLqPDbGdK8ie7SLzRSFH2G MgoVerZG32rlQcjKYp6HGpPh45DZlMdmJaLE1VIMDWxolV8sHUyqdxov6CLwSTLaP5xm ZS5qkF2izf7CmyClLarG3ZAbCt9P9LTfHxlimal9mDiRIedxEp4kSrnEGlS8H0UFBrHZ 0+uD2jHACWy8HK6HK+jkviJyTSZKE+yiEoEhj8Pn5bEe3teK5gcJ648/eU5783goz7NX JOaKpynPv4pQv9GsoNrufNlaK9gK7vVJlB+0cHbBoac/DTxXyRCpI77LCKI9L6O4RroJ 1IGA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:subject:cc:to:from:message-id:date; bh=lhFAk9OTwRp+glri8wh2Lqtfb3nd1d8DzlTACwpQtOc=; b=cVttbF9Vi7ghlfXUgSg1fnBBzwPzuzxNDbQHApsxI8ffUWj29QjT/SBvkvGG6YH253 p5thwHExMkddmv0aH/zK85tWrFxBUddpMsVEa47YZXD7xQ/bR5vZWuJUw3ITWV0nONsg PeCQ5uUliFVrriljCR6Y9HPGDFrTg2gSTZ/famj9JzMbIIBALVrLOYSPEudFXTLf8XqG XDnKIB2dqvGWxf0t8mRBjvs+R5Tech68EeRKgtsXoRi5O2PIVp5mbz6dySOuJQLvD/2U Yl18azWEYd3TxtZ30B1bCon4CWaKzxGAYJCa4pm4CZI5LvYfX7sBAyOzNlXb2n1lB12B Kk/w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t30-v6si3609454pga.582.2018.10.03.22.25.02; Wed, 03 Oct 2018 22:25:18 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727009AbeJDMQ2 (ORCPT + 99 others); Thu, 4 Oct 2018 08:16:28 -0400 Received: from mx2.suse.de ([195.135.220.15]:50514 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726438AbeJDMQ2 (ORCPT ); Thu, 4 Oct 2018 08:16:28 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 99B57AF53; Thu, 4 Oct 2018 05:24:56 +0000 (UTC) Date: Thu, 04 Oct 2018 07:24:56 +0200 Message-ID: From: Takashi Iwai To: Jia-Ju Bai Cc: keescook@chromium.org, perex@perex.cz, alsa-devel@alsa-project.org, Linux Kernel Mailing List Subject: Re: [BUG] sound: pci: trident: a possible data race In-Reply-To: References: <864e211c-8be5-6a34-902a-a71f176111db@gmail.com> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI/1.14.6 (Maruoka) FLIM/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL/10.8 Emacs/26 (x86_64-suse-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 04 Oct 2018 05:08:45 +0200, Jia-Ju Bai wrote: > > Thanks for the reply :) > > > On 2018/10/3 23:54, Takashi Iwai wrote: > > On Wed, 03 Oct 2018 14:50:25 +0200, > > Jia-Ju Bai wrote: > >> CPU0: > >> snd_trident_hw_free > >> snd_trident_free_voice > >> line 3870: spin_lock_irqsave() > >> line 3881: voice->substream = NULL; [WRITE] > >> CPU1: > >> snd_trident_interrupt > >> line 3798: snd_pcm_period_elapsed(voice->substream); [READ] > >> > >> As for voice->substream, the WRITE operation in CPU0 is performed > >> with holding a spinlock, but the READ operation in CPU1 is performed > >> without holding this spinlock, so there may exist a data race. > > Thanks for the report. > > > > The actual crash must be very unlikely, almost 0%, though. > > snd_trident_hw_free() is called always after the PCM stream gets > > stopped via trigger callback, i.e. at the moment, there is no > > corresponding interrupt is generated for that voice entry. > > How about the case that playback and capture are performed concurrently? > Namely, snd_trident_hw_free() is called for playback, and the > interrupt is generated for capture. They are different substreams, hence it won't pick up the substream object. > > And the hardware is very old, I bet only a handful people still using > > in the whole world :) > > I have this hardware, so I am the one of these handful people ;) Wow, that's fun. Then we can really fix the issue, if any. Did you actually hit any relevant bug? thanks, Takashi