From patchwork Tue Apr 9 14:33:06 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Ujfalusi X-Patchwork-Id: 15999 Return-Path: X-Original-To: linaro@staging.patches.linaro.org Delivered-To: linaro@staging.patches.linaro.org Received: from mail-qe0-f69.google.com (mail-qe0-f69.google.com [209.85.128.69]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id B8A5C277CA for ; Tue, 9 Apr 2013 14:33:48 +0000 (UTC) Received: by mail-qe0-f69.google.com with SMTP id 2sf9263496qea.8 for ; Tue, 09 Apr 2013 07:33:31 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:x-beenthere:x-received:received-spf:x-received :x-forwarded-to:x-forwarded-for:delivered-to:x-received:received-spf :from:to:cc:subject:date:message-id:x-mailer:mime-version :x-gm-message-state:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :x-google-group-id:list-post:list-help:list-archive:list-unsubscribe :content-type; bh=mfEa6S7LJbLH2/3tl6WZX9ykcLOQWBi4UBZBJjhzySM=; b=GAr/fhDRBqw9BTJoFKDsVTH0/YrlnJxYIg+0mF9Kuo4+nw+YXAod4Q0lZge1MYaFJS 8AH71JsODqn/FDo2Vmp99zg3zkZt9Ey7ya69ECpzEcQe6UL11RVZIHdO9/BXsaCHCGIi MpCJCROPsjj1DZf3cZgl8gHWk4QxIhHZzbYEiAfOw9ZxrUQ9GToDFKJJZCBpVLWUPd9T DKFo/z66Eq9cHlMlm1jG7vLA5cXo31KS3+onFS2cbqXpC0BnqWu3FhOrYYJK2gy5OeOF ndc7kFUCWApsjksyaTv9KxliekPE+6ymYP+LS7FkX0AP08H0yyjYrBd4ZkvOum/D9+6/ 0iLg== X-Received: by 10.236.119.170 with SMTP id n30mr12118309yhh.51.1365518011814; Tue, 09 Apr 2013 07:33:31 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.5.10 with SMTP id o10ls3542518qeo.69.gmail; Tue, 09 Apr 2013 07:33:31 -0700 (PDT) X-Received: by 10.52.100.5 with SMTP id eu5mr16454090vdb.66.1365518011610; Tue, 09 Apr 2013 07:33:31 -0700 (PDT) Received: from mail-ve0-f182.google.com (mail-ve0-f182.google.com [209.85.128.182]) by mx.google.com with ESMTPS id sa4si95586vdc.88.2013.04.09.07.33.31 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 09 Apr 2013 07:33:31 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.128.182 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.128.182; Received: by mail-ve0-f182.google.com with SMTP id m1so6538465ves.27 for ; Tue, 09 Apr 2013 07:33:31 -0700 (PDT) X-Received: by 10.52.25.72 with SMTP id a8mr2880871vdg.47.1365518011319; Tue, 09 Apr 2013 07:33:31 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.58.85.136 with SMTP id h8csp64365vez; Tue, 9 Apr 2013 07:33:30 -0700 (PDT) X-Received: by 10.182.131.168 with SMTP id on8mr8673011obb.7.1365518010521; Tue, 09 Apr 2013 07:33:30 -0700 (PDT) Received: from devils.ext.ti.com (devils.ext.ti.com. [198.47.26.153]) by mx.google.com with ESMTPS id s7si22948176obw.76.2013.04.09.07.33.29 (version=TLSv1 cipher=RC4-SHA bits=128/128); Tue, 09 Apr 2013 07:33:30 -0700 (PDT) Received-SPF: pass (google.com: domain of peter.ujfalusi@ti.com designates 198.47.26.153 as permitted sender) client-ip=198.47.26.153; Received: from dlelxv30.itg.ti.com ([172.17.2.17]) by devils.ext.ti.com (8.13.7/8.13.7) with ESMTP id r39EXBnn026690; Tue, 9 Apr 2013 09:33:11 -0500 Received: from DFLE73.ent.ti.com (dfle73.ent.ti.com [128.247.5.110]) by dlelxv30.itg.ti.com (8.13.8/8.13.8) with ESMTP id r39EXB6A017451; Tue, 9 Apr 2013 09:33:11 -0500 Received: from dlelxv22.itg.ti.com (172.17.1.197) by DFLE73.ent.ti.com (128.247.5.110) with Microsoft SMTP Server id 14.2.342.3; Tue, 9 Apr 2013 09:33:11 -0500 Received: from barack.itg.ti.com (h16-90.vpn.ti.com [172.24.16.90]) by dlelxv22.itg.ti.com (8.13.8/8.13.8) with ESMTP id r39EX881011386; Tue, 9 Apr 2013 09:33:08 -0500 From: Peter Ujfalusi To: Russell King - ARM Linux , Vinod Koul , Dan Williams CC: Tony Lindgren , Jarkko Nikula , Santosh Shilimkar , Felipe Balbi , , , , Peter Meerwald , , Subject: [PATCH] dmaengine: omap-dma: Start DMA without delay for cyclic channels Date: Tue, 9 Apr 2013 16:33:06 +0200 Message-ID: <1365517986-9401-1-git-send-email-peter.ujfalusi@ti.com> X-Mailer: git-send-email 1.8.1.5 MIME-Version: 1.0 X-Gm-Message-State: ALoCoQlQtsDU3/1CILlht0rX6OvYrkJI1Mn+msj2IeraVC4iLQdrWpPOC3GUnMdOpoKexcmhKprO X-Original-Sender: peter.ujfalusi@ti.com X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.128.182 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , cyclic DMA is only used by audio which needs DMA to be started without a delay. If the DMA for audio is started using the tasklet we experience random channel switch (to be more precise: channel shift). Reported-by: Peter Meerwald CC: stable@vger.kernel.org # v3.7+ Signed-off-by: Peter Ujfalusi Acked-by: Santosh Shilimkar Acked-by: Russell King --- Hi Vinod, Would it be possible to send this patch for 3.9. The channel shift (or switch) issue in audio has been noticed recently and it turns out that it has been present since 3.7 kernel. It would be great if 3.9 kernel could work correctly out of box... Changes since RFCv2: - added Acked-by from Santosh and Russell Thank you, Peter drivers/dma/omap-dma.c | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/drivers/dma/omap-dma.c b/drivers/dma/omap-dma.c index 2ea3d7e..ec3fc4f 100644 --- a/drivers/dma/omap-dma.c +++ b/drivers/dma/omap-dma.c @@ -282,12 +282,20 @@ static void omap_dma_issue_pending(struct dma_chan *chan) spin_lock_irqsave(&c->vc.lock, flags); if (vchan_issue_pending(&c->vc) && !c->desc) { - struct omap_dmadev *d = to_omap_dma_dev(chan->device); - spin_lock(&d->lock); - if (list_empty(&c->node)) - list_add_tail(&c->node, &d->pending); - spin_unlock(&d->lock); - tasklet_schedule(&d->task); + /* + * c->cyclic is used only by audio and in this case the DMA need + * to be started without delay. + */ + if (!c->cyclic) { + struct omap_dmadev *d = to_omap_dma_dev(chan->device); + spin_lock(&d->lock); + if (list_empty(&c->node)) + list_add_tail(&c->node, &d->pending); + spin_unlock(&d->lock); + tasklet_schedule(&d->task); + } else { + omap_dma_start_desc(c); + } } spin_unlock_irqrestore(&c->vc.lock, flags); }