From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751849AbdBMKWU (ORCPT ); Mon, 13 Feb 2017 05:22:20 -0500 Received: from mga09.intel.com ([134.134.136.24]:59982 "EHLO mga09.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750943AbdBMKWT (ORCPT ); Mon, 13 Feb 2017 05:22:19 -0500 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.35,156,1484035200"; d="scan'208";a="1094124729" Date: Mon, 13 Feb 2017 15:52:55 +0530 From: Vinod Koul To: Jiada Wang Cc: dan.j.williams@intel.com, dmaengine@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 1/1] dma: imx-sdma: add 1ms delay to ensure SDMA channel is stopped Message-ID: <20170213102254.GK2843@localhost> References: <1486738005-4297-1-git-send-email-jiada_wang@mentor.com> <20170213020530.GI2843@localhost> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: 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 Mon, Feb 13, 2017 at 03:30:19PM +0900, Jiada Wang wrote: > >>+static int sdma_disable_channel_with_delay(struct dma_chan *chan) > >>+{ > >>+ sdma_disable_channel(chan); > >>+ mdelay(1); > > > >what is the gaurantee that 1ms is fine? Shouldn't you poll the bit to see > >channel is disabled properly.. > > > I got the information from NXP (freescale) R&D team, > according to them, by write '1' to SDMA_H_STATSTOP, only disables > the related sdma channel (so poll HE bit will indicates the channel > has been disabled), > but it cannot ensure SDMA core stop to access modules' FIFO, > SDMA core may still is running, this is a bug in HW. Okay b ut you are not doing the HE bit here..?? > > regarding if the '1ms' is enough to ensure SDMA core has stopped, > NXP R&D team mentioned: > "we should add some delay of one BD SDMA cost time after disable the > channel bit, the maximum is 1ms" > so I assume 1ms should work for all cases At least please document this in changelog and comments in code. -- ~Vinod