public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
* aic7xxx strange code
@ 2003-12-31 15:46 Arjan van de Ven
  2003-12-31 18:36 ` Justin T. Gibbs
  0 siblings, 1 reply; 10+ messages in thread
From: Arjan van de Ven @ 2003-12-31 15:46 UTC (permalink / raw)
  To: linux-scsi

[-- 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 --]

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2004-01-01 23:14 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-12-31 15:46 aic7xxx strange code Arjan van de Ven
2003-12-31 18:36 ` 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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox