From: James Bottomley <James.Bottomley@steeleye.com>
To: brking@us.ibm.com
Cc: Francois Romieu <romieu@fr.zoreil.com>,
SCSI Mailing List <linux-scsi@vger.kernel.org>
Subject: Re: [PATCH 2.6.7-mm3] ipr: minor fixes and assorted nit
Date: 30 Jun 2004 10:52:40 -0500 [thread overview]
Message-ID: <1088610767.1904.13.camel@mulgrave> (raw)
In-Reply-To: <40E2D66F.9060900@us.ibm.com>
On Wed, 2004-06-30 at 10:04, Brian King wrote:
> Is there any downside to requesting all the memory regions on the
> adapter? Some of these adapters have very large BAR windows that are not
> needed by the device driver. This is the reason I wrote the code the way
> I did, in the thought that I was conserving pci address space.
Yes, there is. There's a particular quad tulip card that seems to have
256k of boot rom for each of it's IO processors, but which only seems to
get 1MB of BAR space for its bridge, so obviously, when it allocates ROM
bars, they don't fit.
However, check out what happens for this adapter. I believe
pci_request_regions() is now more selective about which BARs it maps.
> > - ipr_alloc_mem() can not simply issue a call to ipr_free_mem() when
> > something goes wrong as it would lead to pci_free_consistent() of
> > unset data. Let ipr_alloc_mem() carefully release whatever it has
> > allocated instead;
>
> pci_free_consistent specifically checks for NULL, just like kfree. I
> figured it was cleaner code to rely on the ability to call kfree on NULL
> and pci_free_consistent on NULL. Is this frowned upon?
The API doesn't say that. It works on x86 because dma_free_coherent()
calls free_pages(), which checks for NULLs, but I think you'll find it
will produce a panic or warning on other platforms (arm seems to dump
stack at least).
James
prev parent reply other threads:[~2004-06-30 15:52 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-06-28 14:07 PATCH: Fix assorted dma_addr_t typing errors in ipr driver Alan Cox
2004-06-28 18:11 ` Brian King
2004-06-29 8:20 ` Jeff Garzik
2004-06-29 21:59 ` [PATCH 2.6.7-mm3] ipr: minor fixes and assorted nit Francois Romieu
2004-06-30 15:04 ` Brian King
2004-06-30 15:52 ` James Bottomley [this message]
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=1088610767.1904.13.camel@mulgrave \
--to=james.bottomley@steeleye.com \
--cc=brking@us.ibm.com \
--cc=linux-scsi@vger.kernel.org \
--cc=romieu@fr.zoreil.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