Re: Query regarding modifying the DMA Mask based on the available memory in the system

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, 2008-04-17 at 16:40 +0800, Prakash, Sathya wrote:
> Currently the MPT Fusion drivers set DMA Mask to 64 bit if the
> architecture of the system is 64bit and if the hardware supports 64 bit
> DMA address. 
> Also in all 64 bit systems the fusion drivers use SGESimple64_t to send
> scatter gather elements to firmware. 
> 
> Even with 64 bit systems which has available memory less than 4GB the
> SGESimple64_t is used, to increase the performance I am thinking of
> modifying the driver to check the system memory in the system using the
> function si_meminfo() and if the memory is less than 4GB, then the
> driver will set the 32 bit DMA mask and will use SGESimple32_t to send
> the SGE to firmware. 
> 
> I am not sure whether this change works fine? I couldn't see any SCSI
> driver using the si_meminfo and this function seems not to return the
> physical layout of the memory. 

That's because it's not the right way to do this.

For drivers that can alter their descriptor types, we have this
function:

dma_get_required_mask()

It returns the largest mask necessary to reach all of memory.  Note:
This isn't necessarily the same as the largest physical memory on
systems because some systems with IOMMUs deliberately always return
addresses in 32 bits even in a 64 bit system.

For a usage example, see:

aic79xx_osm_pci.c:ahd_linux_pci_dev_probe()

The aic79xx has three possible descriptor formats:  A 32 bit one; a
packed 39 bit one and a full 64 bit one (which takes double the space).
It uses the above function to find out what it needs to use (the 64 bit
descriptor is operationally slower on the chip).

James


--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Device Mapper]
  Powered by Linux