From: "Justin T. Gibbs" <gibbs@scsiguy.com>
To: arjanv@redhat.com, linux-scsi@vger.kernel.org
Subject: Re: aic7xxx strange code
Date: Wed, 31 Dec 2003 11:36:26 -0700 [thread overview]
Message-ID: <960352704.1072895786@aslan.btc.adaptec.com> (raw)
In-Reply-To: <1072885576.10877.6.camel@laptop.fenrus.com>
> Hi,
>
>
> the snippet below (from aic7xxx driver) is rather strange and probably
> broken:
>
> /*
> * Although we can dma data above 4GB, our
> * "consistent" memory is below 4GB for
> * space efficiency reasons (only need a 4byte
> * address). For this reason, we have to reset
> * our dma mask when doing allocations.
> */
...
> consistent memory ALWAYS comes from lower 4Gb regardless of the
> pci_set_dma_mask() setting;
This isn't true on some architectures in the 2.4 kernel. Look at, for
example, arch/ia64/hp/common/sba_iommu.c in the RedHat 2.4.18-e.31 kernel.
This is why this particular hack was added.
> Justin: are you willing to just remove the unneeded dma mask sets? They
> can race etc etc and are 100% unneeded.
The hack is not racy for any mapping calls within the driver since they
are protected by the softc lock. For any other clients that are
looking at the mask, the worse case is that they end up mapping some
transaction below the 4GB boundary that could have been sent unmapped.
I'm more than happy to change the #ifdefs on the hack to exclude 2.6
so long as all platforms the driver operates under behave as expected.
If 2.4 is any guide, however, there may still be some bogus code lurking
around that uses the "normal" dma mask incorrectly.
--
Justin
next prev parent reply other threads:[~2003-12-31 18:30 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-12-31 15:46 aic7xxx strange code Arjan van de Ven
2003-12-31 18:36 ` Justin T. Gibbs [this message]
2004-01-01 10:08 ` Arjan van de Ven
2004-01-01 16:16 ` Justin T. Gibbs
2004-01-01 16:17 ` Arjan van de Ven
2004-01-01 16:21 ` Justin T. Gibbs
2004-01-01 16:28 ` Arjan van de Ven
2004-01-01 22:31 ` Andi Kleen
2004-01-01 22:34 ` Arjan van de Ven
2004-01-01 23:14 ` 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=960352704.1072895786@aslan.btc.adaptec.com \
--to=gibbs@scsiguy.com \
--cc=arjanv@redhat.com \
--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