From mboxrd@z Thu Jan 1 00:00:00 1970 From: Timur Tabi Subject: Re: [PATCH] gianfar: Wait for both RX and TX to stop Date: Tue, 20 Apr 2010 10:59:57 -0500 Message-ID: References: <1271632401-2472-1-git-send-email-afleming@freescale.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: QUOTED-PRINTABLE Cc: Andy Fleming , davem@davemloft.net, netdev@vger.kernel.org To: Kumar Gala Return-path: Received: from mail-pw0-f46.google.com ([209.85.160.46]:52546 "EHLO mail-pw0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752985Ab0DTQA2 convert rfc822-to-8bit (ORCPT ); Tue, 20 Apr 2010 12:00:28 -0400 Received: by pwj9 with SMTP id 9so4349828pwj.19 for ; Tue, 20 Apr 2010 09:00:28 -0700 (PDT) In-Reply-To: Sender: netdev-owner@vger.kernel.org List-ID: On Tue, Apr 20, 2010 at 10:01 AM, Timur Tabi wro= te: > On Mon, Apr 19, 2010 at 11:43 PM, Kumar Gala wrote: > >> spin_event_timeout doesn't make sense for this. =A0The patch is fine= =2E > > Can you please elaborate on that? =A0I don't understand why you think > that. =A0spin_event_timeout() takes an expression and a timeout, and > loops over the expression calling cpu_relax(), just like this loop > does. I haven't tested it, but I think this should work: spin_event_timeout((gfar_read(®s->ievent) & (IEVENT_GRSC | IEVENT_GTSC)) =3D=3D (IEVENT_GRSC | IEVENT_GTSC), -1, 0); Ideally, Andy should use a timeout value other than -1, and then test the result like this: u32 ret; ret =3D spin_event_timeout((gfar_read(®s->ievent) & (IEVENT_GRSC | IEVENT_GTSC)) =3D=3D (IEVENT_GRSC | IEVENT_GTSC), 1000, 0); if (!ret) /* timeout has occurred */ --=20 Timur Tabi Linux kernel developer at Freescale