On Fri, Jan 24, 2020 at 04:16:47PM +0530, Sreekanth Reddy wrote: > Our HBA hardware has a requirement that each set of RDPQ reply > descriptor pools should be within the 4gb region. so to accommodate > this requirement driver is first setting the DMA coherent mask to 32 > bit then allocating the RDPQ pools So far the requirement makes sense. > and then resetting the DMA coherent > make to 64 and allocating the remaining pools. And this is where the trouble start. You simply can't reset the mask with outstanding allocations. This breaks various implementations that change the allocator based on the mask. > if we completely set the DMA coherent mask to 32 bit then there are > chances that sometimes driver may not get requested memory within the > first 4gb region and HBA initialization may fail. So instead of > setting the DMA coherent mask to 32 bit, we follow the same below > logic which megaraid_sas driver is doing now. i.e we first allocate > set of rdpq pools at once and check this allocated block is within the > 4gb region, if not then free this block and allocate a new block from > aligned pci pool. Which is completely broken.