linux-mips
[Top] [All Lists]

Re: [PATCH 1/1] Char: ds1286, eliminate busy waiting

To: Ralf Baechle <ralf@linux-mips.org>
Subject: Re: [PATCH 1/1] Char: ds1286, eliminate busy waiting
From: Jiri Slaby <jirislaby@gmail.com>
Date: Tue, 29 Jul 2008 11:42:08 +0200
Cc: Andrew Morton <akpm@linux-foundation.org>, linux-mips@linux-mips.org, linux-kernel@vger.kernel.org
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from :user-agent:mime-version:to:cc:subject:references:in-reply-to :x-enigmail-version:content-type:content-transfer-encoding; bh=B4K9+uOCaTi1jNWalT2u4mImhCygQch1wU97Hl8x+WQ=; b=hstPCMGc1p141XfMeNWPq+LFBOT6We/GyHnEtsy9w1KAGzNpYmHPEHTxD9kFxQXebu gfqfoRg7XfCs8ckoKPtaNCXJsPDFooHvcIFni7VAMXBzW1iSftgquEv18k1A5+/vE71j v5uXjG6R+Ne1dPLOgrBLjt4xikH7/JlfoUFos=
Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:x-enigmail-version:content-type :content-transfer-encoding; b=SwMfQuAmiR9D2R+jAOBHBxofOy9j8OoFlyH2+MJzx+c+0RriLh5OM58Pq2n+SICzm5 onK3K1B6qV1WJHXfFbanFT/Qi7MFLUlvLnmX34axL7Ls+bQHQpZMvDsIaKNYu2bwH60r fXdNTmWiVYX4neKq7DqNViaK3yk//SuZsRr24=
In-reply-to: <20080728230533.GB1430@linux-mips.org>
Original-recipient: rfc822;linux-mips@linux-mips.org
References: <1217008198-17143-1-git-send-email-jirislaby@gmail.com> <20080728230533.GB1430@linux-mips.org>
Sender: linux-mips-bounce@linux-mips.org
User-agent: Thunderbird 2.0.0.16 (X11/20080720)
Ralf Baechle napsal(a):
On Fri, Jul 25, 2008 at 07:49:58PM +0200, Jiri Slaby wrote:

ds1286_get_time(); is not called from atomic context, sleep for 20 ms is
better choice than a (home-made) busy waiting for such a situation.

Looks ok to me I guess.  Though I don't really think it matters ...

I think RT people has different opinion ;).

The same condition also appears in drivers/char/rtc.c and maybe a few
others.  Rtc.c has been copies and modified several times.

In rtc.c there is something completely different:
        while (rtc_is_updating() != 0 &&
               time_before(jiffies, uip_watchdog + 2*HZ/100))
                cpu_relax();

It's a conditional busy-waiting. It reads the rtc status after each busy cycle while in the ds1286 there was
        if (ds1286_is_updating() != 0)
                while (time_before(jiffies, uip_watchdog + 2*HZ/100))
                        barrier();

<Prev in Thread] Current Thread [Next in Thread>