linux-mips
[Top] [All Lists]

Re: [PATCH] use rtc_lock to protect RTC operations

To: Ralf Baechle <ralf@linux-mips.org>
Subject: Re: [PATCH] use rtc_lock to protect RTC operations
From: "Maciej W. Rozycki" <macro@linux-mips.org>
Date: Thu, 3 Nov 2005 13:15:32 +0000 (GMT)
Cc: Atsushi Nemoto <anemo@mba.ocn.ne.jp>, linux-mips@linux-mips.org
In-reply-to: <20051103125926.GB3149@linux-mips.org>
Original-recipient: rfc822;linux-mips@linux-mips.org
References: <20051103.010115.07642880.anemo@mba.ocn.ne.jp> <20051103125926.GB3149@linux-mips.org>
Sender: linux-mips-bounce@linux-mips.org
On Thu, 3 Nov 2005, Ralf Baechle wrote:

> Unlike on PC CMOS_READ on a DEC is a single read operation, so atomic
> and so doesn't need to be protected.  I'd have to check the datasheet
> for any other reason why it might need locking though, so I apply your
> patch for now and leave this to Maciej for later optimization.

 You are correct -- unless you need to perform multiple RTC access cycles
uninterrupted in a row, a lock is not needed.  Single accesses are
executed as single cycles on the system bus, with some glue logic attached
to the RTC chip converting them into pairs of chip accesses consisting of
an index register write and the actual data cycle.  Even the exact latency
of the whole operation is specified for some system models. ;-)

 Welcome to a clean design!

  Maciej

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