From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753885AbbCPK3f (ORCPT ); Mon, 16 Mar 2015 06:29:35 -0400 Received: from mga09.intel.com ([134.134.136.24]:62452 "EHLO mga09.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753825AbbCPK3c (ORCPT ); Mon, 16 Mar 2015 06:29:32 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.11,407,1422950400"; d="scan'208";a="665788625" Date: Mon, 16 Mar 2015 15:55:50 +0530 From: Vinod Koul To: Robin Gong Cc: dan.j.williams@intel.com, dmaengine@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v4] dma: imx-sdma: switch to dynamic context mode after script loaded Message-ID: <20150316102550.GL32683@intel.com> References: <1423965635-13915-1-git-send-email-b38343@freescale.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1423965635-13915-1-git-send-email-b38343@freescale.com> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, Feb 15, 2015 at 10:00:35AM +0800, Robin Gong wrote: > Below comments got from Page4724 of Reference Manual of i.mx6q: > http://cache.freescale.com/files/32bit/doc/ref_manual/IMX6DQRM.pdf > > --"Static context mode should be used for the first channel called > after reset to ensure that the all context RAM for that channel is > initialized during the context SAVE phase when the channel is > done or yields. Subsequent calls to the same channel or > different channels may use any of the dynamic context modes. > This will ensure that all context locations for the bootload > channel are initialized, and prevent undefined values in context > RAM from being loaded during the context restore if the > channel is re-started later" > > Unfortunately, the rule was broken by commit(5b28aa319bba96987316425a1131813d87cbab35) > .This patch just take them back. Applied, thanks -- ~Vinod > > Signed-off-by: Robin Gong > --- > drivers/dma/imx-sdma.c | 7 ++++--- > 1 file changed, 4 insertions(+), 3 deletions(-) > > diff --git a/drivers/dma/imx-sdma.c b/drivers/dma/imx-sdma.c > index d0df198..644cfa0 100644 > --- a/drivers/dma/imx-sdma.c > +++ b/drivers/dma/imx-sdma.c > @@ -531,6 +531,10 @@ static int sdma_run_channel0(struct sdma_engine *sdma) > dev_err(sdma->dev, "Timeout waiting for CH0 ready\n"); > } > > + /* Set bits of CONFIG register with dynamic context switching */ > + if (readl(sdma->regs + SDMA_H_CONFIG) == 0) > + writel_relaxed(SDMA_H_CONFIG_CSM, sdma->regs + SDMA_H_CONFIG); > + > return ret ? 0 : -ETIMEDOUT; > } > > @@ -1401,9 +1405,6 @@ static int sdma_init(struct sdma_engine *sdma) > > writel_relaxed(ccb_phys, sdma->regs + SDMA_H_C0PTR); > > - /* Set bits of CONFIG register with given context switching mode */ > - writel_relaxed(SDMA_H_CONFIG_CSM, sdma->regs + SDMA_H_CONFIG); > - > /* Initializes channel's priorities */ > sdma_set_channel_priority(&sdma->channel[0], 7); > > -- > 1.9.1 > > -- > To unsubscribe from this list: send the line "unsubscribe dmaengine" in > the body of a message to majordomo@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html --