From patchwork Mon May 19 09:23:53 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tushar Behera X-Patchwork-Id: 30370 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ob0-f198.google.com (mail-ob0-f198.google.com [209.85.214.198]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id A2066202FE for ; Mon, 19 May 2014 09:26:08 +0000 (UTC) Received: by mail-ob0-f198.google.com with SMTP id va2sf29085298obc.1 for ; Mon, 19 May 2014 02:26:08 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:sender:precedence:list-id:x-original-sender :x-original-authentication-results:mailing-list:list-post:list-help :list-archive:list-unsubscribe; bh=OfjuArodCAbYGypfAAqEy4UIK2hOsLDE5nXnJI5P0Uo=; b=lucuBpQhKtbL8KTqLjiqhXsXvTagoQLYdzhzrLdnC51IqZtg8np0OUzTKqTSjHrVp0 lxYyn4l8Zald0On1rTZ7Zf820rJuMipg24WBHB2bm1bYB9+If9y4rtiOxSi2YxXameAr eXWx3lbBQfdLzFFPayiigQ2RliQA6csy7VW3gYtcX+1E/gcoRRPwF6doklfNzpihyLa8 h3HOvoxhR+x2qKtNKf9XIcQGOJeqy6Nvy7GHVBEdNhizoz22Z5JJ3miiV3hMLZSDU4Xd 0oit67Gye0AifyViaDTbW98DHc4rVHE1CnmKPu9CBgQYtbL0iom5R3T/+chbcfy+FSpV /3vw== X-Gm-Message-State: ALoCoQn29fkFKP5g4cUanrbV2X3UgbpiJ8kaONN8Gti0rMLB/APO3Bbr9d86QA9/n16rQDM2e8w0 X-Received: by 10.50.35.229 with SMTP id l5mr6551543igj.0.1400491568171; Mon, 19 May 2014 02:26:08 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.93.131 with SMTP id d3ls1678355qge.52.gmail; Mon, 19 May 2014 02:26:08 -0700 (PDT) X-Received: by 10.140.22.42 with SMTP id 39mr36200774qgm.63.1400491568041; Mon, 19 May 2014 02:26:08 -0700 (PDT) Received: from mail-qg0-f49.google.com (mail-qg0-f49.google.com [209.85.192.49]) by mx.google.com with ESMTPS id m4si8290647qae.211.2014.05.19.02.26.08 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 19 May 2014 02:26:08 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.192.49 as permitted sender) client-ip=209.85.192.49; Received: by mail-qg0-f49.google.com with SMTP id a108so8160760qge.36 for ; Mon, 19 May 2014 02:26:07 -0700 (PDT) X-Received: by 10.229.89.65 with SMTP id d1mr47764161qcm.14.1400491567935; Mon, 19 May 2014 02:26:07 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.96.8.167 with SMTP id s7csp211961qda; Mon, 19 May 2014 02:26:07 -0700 (PDT) X-Received: by 10.68.189.232 with SMTP id gl8mr41387491pbc.89.1400491566834; Mon, 19 May 2014 02:26:06 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id xq7si1859848pab.27.2014.05.19.02.26.06; Mon, 19 May 2014 02:26:06 -0700 (PDT) Received-SPF: none (google.com: linux-kernel-owner@vger.kernel.org does not designate permitted sender hosts) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754102AbaESJZ6 (ORCPT + 27 others); Mon, 19 May 2014 05:25:58 -0400 Received: from mail-pb0-f43.google.com ([209.85.160.43]:56700 "EHLO mail-pb0-f43.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753293AbaESJZ4 (ORCPT ); Mon, 19 May 2014 05:25:56 -0400 Received: by mail-pb0-f43.google.com with SMTP id up15so5633895pbc.2 for ; Mon, 19 May 2014 02:25:56 -0700 (PDT) X-Received: by 10.68.203.233 with SMTP id kt9mr26306461pbc.61.1400491555923; Mon, 19 May 2014 02:25:55 -0700 (PDT) Received: from linaro.sisodomain.com ([14.140.216.146]) by mx.google.com with ESMTPSA id px10sm73143123pac.41.2014.05.19.02.25.53 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 19 May 2014 02:25:55 -0700 (PDT) From: Tushar Behera To: linux-kernel@vger.kernel.org, alsa-devel@alsa-project.org Cc: tiwai@suse.de, perex@perex.cz, lars@metafoo.de Subject: [PATCH] ALSA: pcm_dmaengine: Add check during device suspend Date: Mon, 19 May 2014 14:53:53 +0530 Message-Id: <1400491433-16860-1-git-send-email-tushar.behera@linaro.org> X-Mailer: git-send-email 1.7.9.5 Sender: linux-kernel-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: tushar.behera@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.192.49 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , Currently snd_dmaengine_pcm_trigger() calls dmaengine_pause() unconditinally during device suspend. In case where DMA controller doesn't support PAUSE/RESUME functionality, this call is not able to stop the DMA controller. In this scenario, audio playback doesn't resume after device resume. Calling dmaengine_pause/dmaengine_terminate_all conditionally fixes the issue. It has been tested with audio playback on Samsung platform having PL330 DMA controller which doesn't support PAUSE/RESUME. Signed-off-by: Tushar Behera Acked-by: Lars-Peter Clausen --- sound/core/pcm_dmaengine.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/sound/core/pcm_dmaengine.c b/sound/core/pcm_dmaengine.c index 94d0873..76cbb9e 100644 --- a/sound/core/pcm_dmaengine.c +++ b/sound/core/pcm_dmaengine.c @@ -182,6 +182,7 @@ static int dmaengine_pcm_prepare_and_submit(struct snd_pcm_substream *substream) int snd_dmaengine_pcm_trigger(struct snd_pcm_substream *substream, int cmd) { struct dmaengine_pcm_runtime_data *prtd = substream_to_prtd(substream); + struct snd_pcm_runtime *runtime = substream->runtime; int ret; switch (cmd) { @@ -196,6 +197,11 @@ int snd_dmaengine_pcm_trigger(struct snd_pcm_substream *substream, int cmd) dmaengine_resume(prtd->dma_chan); break; case SNDRV_PCM_TRIGGER_SUSPEND: + if (runtime->info & SNDRV_PCM_INFO_PAUSE) + dmaengine_pause(prtd->dma_chan); + else + dmaengine_terminate_all(prtd->dma_chan); + break; case SNDRV_PCM_TRIGGER_PAUSE_PUSH: dmaengine_pause(prtd->dma_chan); break;