Commit e2d02589 authored by Mark Haverkamp's avatar Mark Haverkamp Committed by James Bottomley

[PATCH] Work around aacraid FW problem

If you have a 4gig or greater system, some versions of aacraid firmware
have problems if you set HostPhysMemPages >= 0x100000.  This can
potentially cause data corruption.  If you have 4gig or greater memory,
this patch sets the HostPhysMemPages to something that the firmware can
deal with.
parent d0e5f8c0
......@@ -14,6 +14,8 @@
#define AAC_MAX_TARGET (MAXIMUM_NUM_CONTAINERS+1)
#define AAC_MAX_LUN (8)
#define AAC_MAX_HOSTPHYSMEMPAGES (0xfffff)
/*
* These macros convert from physical channels to virtual channels
*/
......
......@@ -92,7 +92,21 @@ static int aac_alloc_comm(struct aac_dev *dev, void **commaddr, unsigned long co
init->AdapterFibsPhysicalAddress = cpu_to_le32((u32)phys);
init->AdapterFibsSize = cpu_to_le32(fibsize);
init->AdapterFibAlign = cpu_to_le32(sizeof(struct hw_fib));
init->HostPhysMemPages = cpu_to_le32(num_physpages); // number of 4k pages of host physical memory
/*
* number of 4k pages of host physical memory. The aacraid fw needs
* this number to be less than 4gb worth of pages. num_physpages is in
* system page units. New firmware doesn't have any issues with the
* mapping system, but older Firmware did, and had *troubles* dealing
* with the math overloading past 32 bits, thus we must limit this
* field.
*/
if ((num_physpages << (PAGE_SHIFT - 12)) <= AAC_MAX_HOSTPHYSMEMPAGES) {
init->HostPhysMemPages =
cpu_to_le32(num_physpages << (PAGE_SHIFT-12));
} else {
init->HostPhysMemPages = cpu_to_le32(AAC_MAX_HOSTPHYSMEMPAGES);
}
/*
* Increment the base address by the amount already used
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment