Linux SCSI subsystem development
 help / color / mirror / Atom feed
From: "J.E.J. Bottomley" <James.Bottomley@steeleye.com>
To: "Adam J. Richter" <adam@yggdrasil.com>
Cc: andmike@us.ibm.com, hch@lst.de, linux-scsi@vger.kernel.org
Subject: Re: [PATCH] get rid of ->detect for upper layer drivers
Date: Thu, 07 Nov 2002 14:02:42 -0500	[thread overview]
Message-ID: <200211071902.gA7J2gU04498@localhost.localdomain> (raw)
In-Reply-To: Message from "Adam J. Richter" <adam@yggdrasil.com> of "Thu, 07 Nov 2002 10:42:56 PST." <200211071842.KAA30050@adam.yggdrasil.com>

adam@yggdrasil.com said:
> 	All of the drivers that I've looked at abort if the initial
> pci_alloc_consistent fails.  Those are the drivers that I had in mind
> to use this facility. 

That's OK on x86, or other fully consistent arch, because it means that 
__get_free_pages failed and we're out of memory.

My worry is that by making this into a mid layer API we're implying that we 
"get it right", rather than get it right for only x86.

> 	I'd be interested in pointers to drivers that soldier on after
> {pci,sbus}_alloc_consistent fails (I think those are the only two
> versions in 2.5.46). 

You're welcome to look through 53c700.c.  It drives the lasi chips on PA-RISC 
and also some odd controllers under x86.  It's actually got a compile flag 
(CONFIG_53C700_USE_CONSISTENT) to check whether it's supposed to do consistent 
allocations (it also has the full fallback stuff for if it fails).  The real 
design of the flag is to optimize out the unnecessary fallback checks on x86.

You can see from the sync points peppering the driver how difficult it would 
be to do a full abstraction.

The ncr8xxx driver is another one used for the Zalon controller in parisc, so 
it will eventually have the same issues.

> 	If there really are a number of device drivers that want to be able
> to continue on if the initial dma_alloc_consistent fails, especially
> if they all do the same thing, like, say, try vmalloc, then, yes I
> would like add a flag to support and a flag in struct device or
> something to communicate the result of the memory allocation, rather
> than have the same logic replicated over N device drivers. It could be
> conditionally compiled and probably put into a separate inline routine
> in drivers/base/bus.c if needed for cleanliness. 

A full abstraction would require the sync point functions that the 53c700 uses 
so that they can optimize away on unnecessary architectures.  If you're 
signing up to do this right, then I can try it out in the 53c700.  I still 
have two parisc machines, one which cannot do consistent allocations and one 
which can.

James



  reply	other threads:[~2002-11-07 19:02 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-11-07 18:42 [PATCH] get rid of ->detect for upper layer drivers Adam J. Richter
2002-11-07 19:02 ` J.E.J. Bottomley [this message]
  -- strict thread matches above, loose matches on Subject: below --
2002-11-07 18:30 Adam J. Richter
2002-11-07 17:47 Adam J. Richter
2002-11-07 18:08 ` J.E.J. Bottomley
2002-11-07 18:56 ` Mike Anderson
2002-11-07 16:22 Adam J. Richter
2002-11-07 16:16 Adam J. Richter
     [not found] <200211071532.HAA21625@freya.yggdrasil.com>
2002-11-07 15:42 ` Christoph Hellwig
2002-11-07 16:27 ` Mike Anderson
2002-11-07 12:25 Adam J. Richter
2002-11-07 14:25 ` Mike Anderson
2002-11-07 15:39   ` Christoph Hellwig
2002-11-07 15:50     ` J.E.J. Bottomley
2002-11-07 15:53       ` Christoph Hellwig
2002-11-07 19:44       ` Patrick Mansfield
2002-11-07 15:36 ` Christoph Hellwig
2002-11-07  2:49 Christoph Hellwig

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=200211071902.gA7J2gU04498@localhost.localdomain \
    --to=james.bottomley@steeleye.com \
    --cc=adam@yggdrasil.com \
    --cc=andmike@us.ibm.com \
    --cc=hch@lst.de \
    --cc=linux-scsi@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