public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Ralf Baechle <ralf@linux-mips.org>
To: zhzhl555@gmail.com
Cc: a.zummo@towertech.it, rtc-linux@googlegroups.com,
	linux-mips@linux-mips.org, linux-kernel@vger.kernel.org,
	keguang.zhang@gmail.com, wuzhangjin@gmail.com,
	r0bertz@gentoo.org
Subject: Re: [PATCH] MIPS: Add RTC support for loongson1B
Date: Thu, 8 Dec 2011 13:08:35 +0000	[thread overview]
Message-ID: <20111208130835.GC10113@linux-mips.org> (raw)
In-Reply-To: <1322729078-6141-1-git-send-email-zhzhl555@gmail.com>

On Thu, Dec 01, 2011 at 04:44:38PM +0800, zhzhl555@gmail.com wrote:

> +	writel(t, SYS_TOYWRITE1);
> +	__asm__ volatile ("sync");
> +	c = 0x10000;
> +	while ((readl(SYS_COUNTER_CNTRL) & SYS_CNTRL_TS) && --c)
> +		usleep_range(1000, 3000);

Why the SYNC instruction?  This is an uncached write and on all MIPS CPUs
the SYNC instruction will only make sure the write has left the CPU's
write buffers.  There is no guarantee that by the time the SYNC has completed
the write has actually reached its destination.  If that is what you want,
read something from device.  Reads will only complete after all preceeding
writes have completed.

In this driver all instances of SYNC instructions are followed by polling
loops reading from the RTC which means all SYNCs should be unnecessary.

Or?

  Ralf

  parent reply	other threads:[~2011-12-08 13:09 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-12-01  8:44 [PATCH] MIPS: Add RTC support for loongson1B zhzhl555
2011-12-05 15:53 ` [rtc-linux] " Jean-Christophe PLAGNIOL-VILLARD
2011-12-08 13:08 ` Ralf Baechle [this message]
  -- strict thread matches above, loose matches on Subject: below --
2011-11-21  8:37 zhzhl555
2011-11-22  9:47 ` Linus Walleij

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20111208130835.GC10113@linux-mips.org \
    --to=ralf@linux-mips.org \
    --cc=a.zummo@towertech.it \
    --cc=keguang.zhang@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mips@linux-mips.org \
    --cc=r0bertz@gentoo.org \
    --cc=rtc-linux@googlegroups.com \
    --cc=wuzhangjin@gmail.com \
    --cc=zhzhl555@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox