public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
From: Jeff Garzik <jgarzik@pobox.com>
To: "Moore, Eric Dean" <Emoore@lsil.com>
Cc: linux-scsi@vger.kernel.org, James.Bottomley@steeleye.com,
	ak@suse.de, Alexander.Stohr@gmx.de, rddunlap@osdl.org
Subject: Re: [PATCH 2.6 ] MPT Fusion driver 3.01.02 update
Date: Wed, 17 Mar 2004 17:15:05 -0500	[thread overview]
Message-ID: <4058CDE9.3020902@pobox.com> (raw)
In-Reply-To: <0E3FA95632D6D047BA649F95DAB60E57040DB2A7@exa-atlanta.se.lsil.com>

Moore, Eric Dean wrote:
> The wrappers are there because the system
> interface registers could be memory or IO mapped
> registers depending on the pci device.  The PIO 

Yes, I understand what the wrappers are doing :)  That's why I said it 
was mainly a style issue I was bringing up.  Depending on the hardware 
requirements and installed userbase, it may be better to make PortIO a 
compile-time option.  In general MMIO is preferred.


> wrappers could be removed, but I think its there 
> to be uniform with the other wrappers.  The PIO 
> wrappers there for firmware download which 

If it's directly wrapping a Linux API call, then the Linux API call 
should be used directly in the code.  Wrappers in general inhibit 
compiler optimization opportunities, and occasionally hide bugs.  They 
hinder long term maintainance, and slow down code reviews.

With every vendor-written driver inventing its own wrappers, the problem 
gets unscalable real quick.


> always using IO registers. Id would rather not
> remove the volatile since the registers could
> be memory mapped, and may break things when
> driver compiled with optimized kernel.

No, all that is needed is included in the read[bwl] and write[bwl] 
definitions.  'volatile' occasionally hides bugs, and good code is 
completely volatile-free:  always explicitly flush MMIO writes, and 
employ memory barriers, rather than depending on the compiler to do so.

The compiler does not have 100% of the knowledge necessary -- 
particularly for MMIO writes -- to presume whether a flush is needed or 
not.  Portable code _must_ follow a writel() call with the readl(), to 
guarantee that all PCI- and CPU-posted/delayed writes are flushed 
completely to the PCI device.

	Jeff





  reply	other threads:[~2004-03-17 22:15 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-03-17 22:02 [PATCH 2.6 ] MPT Fusion driver 3.01.02 update Moore, Eric Dean
2004-03-17 22:15 ` Jeff Garzik [this message]
  -- strict thread matches above, loose matches on Subject: below --
2004-03-17 23:49 Moore, Eric Dean
2004-03-17 19:43 Moore, Eric Dean
2004-03-17 20:20 ` Jeff Garzik
2004-03-18  1:09 ` Andi Kleen
2004-03-18  1:38   ` Moore, Eric Dean
2004-03-18  1:58     ` Andi Kleen

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=4058CDE9.3020902@pobox.com \
    --to=jgarzik@pobox.com \
    --cc=Alexander.Stohr@gmx.de \
    --cc=Emoore@lsil.com \
    --cc=James.Bottomley@steeleye.com \
    --cc=ak@suse.de \
    --cc=linux-scsi@vger.kernel.org \
    --cc=rddunlap@osdl.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