From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751336AbdKUIQq (ORCPT ); Tue, 21 Nov 2017 03:16:46 -0500 Received: from galahad.ideasonboard.com ([185.26.127.97]:40676 "EHLO galahad.ideasonboard.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751154AbdKUIQp (ORCPT ); Tue, 21 Nov 2017 03:16:45 -0500 From: Laurent Pinchart To: Geert Uytterhoeven Cc: Kuninori Morimoto , Dan Williams , Vinod Koul , Niklas =?ISO-8859-1?Q?S=F6derlund?= , dmaengine@vger.kernel.org, "linux-kernel@vger.kernel.org" , Hiroyuki Yokoyama Subject: Re: [PATCH 1/2 v2] dmaengine: rcar-dmac: ensure CHCR DE bit is actually 0 after clear Date: Tue, 21 Nov 2017 10:16:58 +0200 Message-ID: <1874044.cuZmJqfgp6@avalon> Organization: Ideas on Board Oy In-Reply-To: References: <87po8ig8eg.wl%kuninori.morimoto.gx@renesas.com> <87mv3lrcxg.wl%kuninori.morimoto.gx@renesas.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Friday, 17 November 2017 10:41:05 EET Geert Uytterhoeven wrote: > On Fri, Nov 17, 2017 at 1:10 AM, Kuninori Morimoto wrote: > >>> +static void rcar_dmac_chcr_de_barrier(struct rcar_dmac_chan *chan) > >>> +{ > >>> + u32 chcr; > >>> + int i; > >> > >> unsigned int > >> > >>> + > >>> + /* > >>> + * Ensure that the setting of the DE bit is actually 0 after > >>> + * clearing it. > >>> + */ > >>> + for (i = 0; i < 1024; i++) { > >>> + chcr = rcar_dmac_chan_read(chan, RCAR_DMACHCR); > >>> + if (!(chcr & RCAR_DMACHCR_DE)) > >>> + return; > >>> + udelay(1); > >>> + } > >> > >> What's a typical number of loops needed before DE is really cleared? > > > > It case by case, but I don't want to use while(1) loop > > I understand that, and I agree wholeheartedly with limiting the number > of cycles. So do I, but I'd still like to know what the typical values are :-) -- Regards, Laurent Pinchart