From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965535AbdKQIlN (ORCPT ); Fri, 17 Nov 2017 03:41:13 -0500 Received: from mail-qt0-f180.google.com ([209.85.216.180]:41578 "EHLO mail-qt0-f180.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S965444AbdKQIlG (ORCPT ); Fri, 17 Nov 2017 03:41:06 -0500 X-Google-Smtp-Source: AGs4zMbg8yBOjMhlwBHlD4bT9DyDWc7F4cwqByaH61SmXiciobZrKtnvgfEdfKEB6P6ZLyT5+vZ7k1KEj/bnqCTlclU= MIME-Version: 1.0 In-Reply-To: <87mv3lrcxg.wl%kuninori.morimoto.gx@renesas.com> References: <87po8ig8eg.wl%kuninori.morimoto.gx@renesas.com> <87o9o2g8ab.wl%kuninori.morimoto.gx@renesas.com> <87mv3lrcxg.wl%kuninori.morimoto.gx@renesas.com> From: Geert Uytterhoeven Date: Fri, 17 Nov 2017 09:41:05 +0100 X-Google-Sender-Auth: 4XxsbQiSfodAZfEIBrspqpo3POo Message-ID: Subject: Re: [PATCH 1/2 v2] dmaengine: rcar-dmac: ensure CHCR DE bit is actually 0 after clear To: Kuninori Morimoto Cc: Laurent Pinchart , Dan Williams , Vinod Koul , =?UTF-8?Q?Niklas_S=C3=B6derlund?= , dmaengine@vger.kernel.org, "linux-kernel@vger.kernel.org" , Hiroyuki Yokoyama Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Morimoto-san, 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. Gr{oetje,eeting}s, Geert -- Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that. -- Linus Torvalds