public inbox for linux-m68k@lists.linux-m68k.org
 help / color / mirror / Atom feed
From: Brad Boyer <flar@allandria.com>
To: Finn Thain <fthain@telegraphics.com.au>
Cc: linux-m68k@vger.kernel.org
Subject: Re: write ordering and macfb nop() usage
Date: Tue, 14 Oct 2008 15:04:55 -0700	[thread overview]
Message-ID: <20081014220454.GA6601@cynthia.pants.nu> (raw)
In-Reply-To: <Pine.LNX.4.64.0810150251270.14578@loopy.telegraphics.com.au>

On Wed, Oct 15, 2008 at 03:56:35AM +1100, Finn Thain wrote:
> I've been working on macfb.c, and I notice that it is full of stuff like 
> this:
> 
>         /* the nop's are there to order writes. */
>         nubus_writeb(_regno, &cmap_regs->addr); nop();
>         nubus_writeb(_red, &cmap_regs->lut);    nop();
>         nubus_writeb(_green, &cmap_regs->lut);  nop();
>         nubus_writeb(_blue, &cmap_regs->lut);
> 
> Timing aside, I don't see what are the nop's are for. I thought accessors 
> like nubus_write/raw_out/out are intended to issue these writes in order 
> anyway?

I would expect the accessor functions to do the right thing, but I would
not be surprised if they don't. The NuBus code is pretty hackish in general
due to lack of documentation of all the implementations. This reminds me
of the via memory bogon stuff that used to be in via.c. Some of the early
mac code is very sloppy. The basic nubus.c code could use some attention.
It's on my list, but that list keeps getting longer and this one isn't
that close to the top of my list.

> And why were nop's were used instead of an empty asm() or just a volatile 
> qualifier anyway? Some accident of history like a compiler bug?

My guess is that this was easier in some way.

> Also, can a nop provide a useful timing constraint when bus speed can vary 
> so much from one machine to another?

No, it can't. The bus interface circuits are supposed to do the clock sync
for us in any case. It's possible that we really should be reading some
kind of status from the card and this delay just happens to make it work
most of the time.

> I'm baffled.

I'd think you'd be used to that by now.  :)

	Brad Boyer
	flar@allandria.com


  reply	other threads:[~2008-10-14 22:05 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-10-14 16:56 write ordering and macfb nop() usage Finn Thain
2008-10-14 22:04 ` Brad Boyer [this message]
2008-10-15 15:01   ` Finn Thain
2008-10-15 19:08     ` Brad Boyer

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=20081014220454.GA6601@cynthia.pants.nu \
    --to=flar@allandria.com \
    --cc=fthain@telegraphics.com.au \
    --cc=linux-m68k@vger.kernel.org \
    /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