public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
From: Arjan van de Ven <arjanv@redhat.com>
To: linux-scsi@vger.kernel.org
Subject: aic7xxx strange code
Date: Wed, 31 Dec 2003 16:46:17 +0100	[thread overview]
Message-ID: <1072885576.10877.6.camel@laptop.fenrus.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 1499 bytes --]

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.
         */
        if (ahc->dev_softc != NULL)
                if (ahc_pci_set_dma_mask(ahc->dev_softc, 0xFFFFFFFF)) {
                        printk(KERN_WARNING "aic7xxx: No suitable DMA
available.\n");
                        return (ENODEV);
                }
        *vaddr = pci_alloc_consistent(ahc->dev_softc,
                                      dmat->maxsize, &map->bus_addr);
        if (ahc->dev_softc != NULL)
                if (ahc_pci_set_dma_mask(ahc->dev_softc,
                                     ahc->platform_data->hw_dma_mask)) {
                        printk(KERN_WARNING "aic7xxx: No suitable DMA
available.\n");
                        return (ENODEV);
                }


consistent memory ALWAYS comes from lower 4Gb regardless of the
pci_set_dma_mask() setting; only the pci_set_consistent_dma_mask()
function controls where consistent memory comes from, even in 2.4.0
already (which the ifdef surrounding this code tests for)

Justin: are you willing to just remove the unneeded dma mask sets? They
can race etc etc and are 100% unneeded.

Greetings,
   Arjan van de Ven

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 189 bytes --]

             reply	other threads:[~2003-12-31 15:46 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-12-31 15:46 Arjan van de Ven [this message]
2003-12-31 18:36 ` aic7xxx strange code Justin T. Gibbs
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=1072885576.10877.6.camel@laptop.fenrus.com \
    --to=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