linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: John Bradford <john@grabjohn.com>
To: anthony.truong@mascorp.com, linux-kernel@vger.kernel.org
Cc: jamie@shareable.org, willy@debian.org
Subject: Re: Memory mapped IO vs Port IO
Date: Fri, 12 Sep 2003 17:41:47 +0100	[thread overview]
Message-ID: <200309121641.h8CGflK0000145@81-2-122-30.bradfords.org.uk> (raw)

> > My claim is basically:
> > 
> > Change everybody who currently does
> > 
> > #ifdef CONFIG_MMIO
> >         writel(... )
> >         readl(...)
> > #else
> >         outl( ... ) 
> >         inl ( ...) 
> > #endif
> > 
> > to 
> >         if (dev->mmio) { 
> >                 writel(); 
> >                 real();
> >         } else { 
> >                 outl();
> >                 inl();
> >         } 
> > 
> > and you will have a hard time to benchmark the difference on any non
> > ancient system
> > in actual driver operation.

Or an embedded system, maybe?

At the end of the day, it still means loosing a tiny amount of
performance just to make it easier for distributions to have one
generic kernel.  There is nothing wrong with that, but why force it on
systems that are not running a generic kernel?

What's wrong with:

#ifdef CONFIG_MMIO
	writel(... );
        readl(... );
#endif
#ifdef CONFIG_NO_MMIO
	outl(... );
	inl(...);
#endif
#ifdef CONFIG_DONT_CARE_MMIO
	if (dev->mmio) {	
		writel(... );
		readl(... );
	} else {
		outl(... );
		inl(... );
	}
#endif

Although I'm dubious of having a global switch for MMIO anyway.

> Wouldn't it be better if we set the IN and OUT function pointers to the
> right functions during driver init. based on the setting of dev->mmio.
> And throughout the driver, we just call the IN and OUT functions by
> their pointers.  Then we don't have to do if (dev->mmio) every time.
> It's similar to the concept of virtual member function in C++.

It's neater, but still means bloat, however small.

I know we're talking a few bytes here and there, but embedded systems
really care about them.

John.

             reply	other threads:[~2003-09-12 16:28 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-09-12 16:41 John Bradford [this message]
2003-09-12 21:52 ` Memory mapped IO vs Port IO Mike Fedyk
2003-09-13  4:01   ` Mike Fedyk
     [not found] <20030911192550.7dfaf08c.ak@suse.de.suse.lists.linux.kernel>
     [not found] ` <1063308053.4430.37.camel@huykhoi.suse.lists.linux.kernel>
     [not found]   ` <20030912162713.GA4852@sgi.com.suse.lists.linux.kernel>
     [not found]     ` <20030912174807.GA629@sgi.com.suse.lists.linux.kernel>
2003-09-12 18:00       ` Andi Kleen
2003-09-12 18:04         ` Jesse Barnes
2003-09-12 18:09           ` Andi Kleen
2003-09-12 18:11         ` Tim Hockin
2003-09-12 18:24           ` Jesse Barnes
2003-09-12 18:29             ` Andi Kleen
2003-09-12 18:58             ` Martin J. Bligh
2003-09-12 19:51               ` Jesse Barnes
     [not found] <20030911160116.GI21596@parcelfarce.linux.theplanet.co.uk.suse.lists.linux.kernel>
2003-09-11 16:17 ` Andi Kleen
2003-09-11 16:25   ` Matthew Wilcox
2003-09-11 16:31     ` Andi Kleen
2003-09-11 16:42       ` Matthew Wilcox
2003-09-11 17:12       ` Jamie Lokier
2003-09-11 17:25         ` Andi Kleen
2003-09-12  1:39           ` jw schultz
2003-09-12 16:10           ` Anthony Dominic Truong
2003-09-12 16:22             ` Jamie Lokier
2003-09-12 16:27             ` Jesse Barnes
2003-09-12 17:48               ` Jesse Barnes
2003-09-11 17:13   ` Jamie Lokier
     [not found] ` <20030911161450.GA23536@sgi.com.suse.lists.linux.kernel>
2003-09-11 16:20   ` Andi Kleen
  -- strict thread matches above, loose matches on Subject: below --
2003-09-11 16:01 Matthew Wilcox
2003-09-11 16:14 ` Måns Rullgård
2003-09-11 16:14 ` Jesse Barnes

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=200309121641.h8CGflK0000145@81-2-122-30.bradfords.org.uk \
    --to=john@grabjohn.com \
    --cc=anthony.truong@mascorp.com \
    --cc=jamie@shareable.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=willy@debian.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;
as well as URLs for NNTP newsgroup(s).