Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp1056876ybl; Wed, 28 Aug 2019 09:03:01 -0700 (PDT) X-Google-Smtp-Source: APXvYqzn6/yfbwvpzty5LqBU+6V98I0uQ2WZnGfE7AT9MeUkENdeV5ixHa2K13xOD3Pa/vaV6X/Y X-Received: by 2002:a17:90b:14c:: with SMTP id em12mr5205625pjb.28.1567008181220; Wed, 28 Aug 2019 09:03:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567008181; cv=none; d=google.com; s=arc-20160816; b=NIUKG+f96Ll/DXo1EnaDJzD/ItWDWJpGztv0hGrXlawzTeTX4hsmjsFb4sUoh7F7q5 l+iNLEmlxPCWapvovjiYWj/2ks44hcP9en8+hFSFItWboYrbnfdJDYxM8O4UOSZEijNO T1fFsd0KraNraO0qgCwsddTrGyFmBUIIHjXRgmBPLqvla8TMSE3k5Eatey5nJQSbo56Y jM7zM81E4k4a8OyklNeYI2M2bBsz2+JaK15n/Y0WjX+q579Z6jazNnMPw0AA5rBzhzbK TX0iffCuV3lu0HBjsmkI4iYw2kc2KemOOX+ntEqH0R88yBZPJ/BunlB5UrwuGU5YS4Mx KeeQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=yR3tqYiTxpppS/HN0rTYfpt0BO2DjSod+qzn1YFlyUY=; b=dg8MuQoyT92rHSdDw/8yC3mkRBsYz93PDDE0FQlPGrX6HKsDU1FMqKrVPZjK0Q7o3i 1JBX7o4HHK4wu27QVdLCGXi8KPPmkpPTX/BGbr44uECuMA3TV/27Y1QlxAPWYcaelKL0 n4/NaQjub50KM557YTzqD/fVDT32zYI7GT7AcCdKAfsHyF/8UBAfx3l0qxMs6cdZa1HE ygfnc58NbSI9CZWTs3NRCUEligswpLFZ2LW2zrU1T/0Zh2g02lGE1gBfgzKOA+bGb0Cw 8OEp4bYAxdssF2E7hvfTFg2HxqkmQnM75b2N7S7gldr3IOzMfLQhmwMtKBQL5Mq+/pAI OL7g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=t82bo+7n; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g6si2352686pgl.30.2019.08.28.09.02.39; Wed, 28 Aug 2019 09:03:01 -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; dkim=pass header.i=@gmail.com header.s=20161025 header.b=t82bo+7n; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726713AbfH1QBd (ORCPT + 99 others); Wed, 28 Aug 2019 12:01:33 -0400 Received: from mail-lj1-f195.google.com ([209.85.208.195]:42172 "EHLO mail-lj1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726415AbfH1QBd (ORCPT ); Wed, 28 Aug 2019 12:01:33 -0400 Received: by mail-lj1-f195.google.com with SMTP id l14so22166ljj.9 for ; Wed, 28 Aug 2019 09:01:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=yR3tqYiTxpppS/HN0rTYfpt0BO2DjSod+qzn1YFlyUY=; b=t82bo+7nReRN8qUwONp3FOyUNOQe+SJmGjj43nMjkurkeSF72Pd1VV3hRf1OgE66RR KDWoG2kZQnBVJzkM8KDZCFy7mqz9bcKdJSmmEx2dYdkoTRZLvN6pnCl8E0pBhjwKdkJ4 sf49qG2yOviuQ4Fu1Tm1UKeNFc43o8A1iRxF9LdpIDyvUrr/EXGEZPFdILgnN8BLCa2n KW3jLLC38MeV3yMp6xS8/rl6fTmU4XS6EpBjg41uqXmYE0AhDM2igs87zJIiHIANDVPC XsI6R22UTUjfppFtkbsj92qJogfUbp92F2UjpP47UJCKAq9rZ+NXm3mNfnDYXCPxjkdA RFnQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=yR3tqYiTxpppS/HN0rTYfpt0BO2DjSod+qzn1YFlyUY=; b=WEo/8rEeQuhKTpBnvZe+9SVACV/uRId6GkItilRfJbI/fX8Ka3adtcF/McwlCOPhuG VODWQIcwOp2uzruR+u4XWfXEYBtevkBIob3CpGiTzhgHn2yfmsjZ4qW80aYdKWsJ0/vb 8SpEkYsiSBpnkX/9FYyUb5xrUtuPJFolp27SCvpHk1XQfFeVBpBAEIophDw9+jZuydW8 BWBoNq/3SDAQntG630VzBxJeRL4xh+kzXsCN4ROTgBpWZWEYz7SdM11r90i80hdA6IAm 1XATxC6RugQw6htP4tR5/sacpX2Sj9vjDTPOQZ1d2wC8gZMW+EgGpKfy8bqiojx8ZJSz R+RA== X-Gm-Message-State: APjAAAV7ny4WCP5Fn/p9/eUuRZ1x1LzEXJY6IrtHgjuALnwRAc71vx0U iqSjMnocOYrVvkOhByi5P/VLi02Yu4yYyW4B1j4= X-Received: by 2002:a2e:978e:: with SMTP id y14mr2524405lji.10.1567008091865; Wed, 28 Aug 2019 09:01:31 -0700 (PDT) MIME-Version: 1.0 References: <1567012817-12625-1-git-send-email-shengjiu.wang@nxp.com> In-Reply-To: <1567012817-12625-1-git-send-email-shengjiu.wang@nxp.com> From: Fabio Estevam Date: Wed, 28 Aug 2019 13:02:32 -0300 Message-ID: Subject: Re: [PATCH] ASoC: fsl_ssi: Fix clock control issue in master mode To: Shengjiu Wang Cc: Timur Tabi , Nicolin Chen , Xiubo Li , Liam Girdwood , Mark Brown , Jaroslav Kysela , Takashi Iwai , Linux-ALSA , linuxppc-dev@lists.ozlabs.org, linux-kernel Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Shengjiu, On Wed, Aug 28, 2019 at 2:21 AM Shengjiu Wang wrote: > > The test case is > arecord -Dhw:0 -d 10 -f S16_LE -r 48000 -c 2 temp.wav & > aplay -Dhw:0 -d 30 -f S16_LE -r 48000 -c 2 test.wav > > There will be error after end of arecord: > aplay: pcm_write:2051: write error: Input/output error > > Capture and Playback work in parallel in master mode, one > substream stops, the other substream is impacted, the > reason is that clock is disabled wrongly. > > The clock's reference count is not increased when second > substream starts, the hw_param() function returns in the > beginning because first substream is enabled, then in end > of first substream, the hw_free() disables the clock. > > This patch is to move the clock enablement to the place > before checking of the device enablement in hw_param(). > > Signed-off-by: Shengjiu Wang It would be nice if you could add a Fixes tag as well.