• Johannes Berg's avatar
    iwlwifi: pcie: extend hardware workaround to context-info · d84a7a65
    Johannes Berg authored
    After more investigation on the hardware side, it appears that the
    hardware bug regarding 2^32 boundary reaching/crossing also affects
    other uses of the DMA engine, in particular the ones triggered by
    the context-info (image loader) mechanism.
    
    It also turns out that the bug only affects devices with gen2 TX
    hardware engine, so we don't need to change context info for gen3.
    The TX path workarounds are simpler to still keep for both though.
    
    Add the workaround to that code as well; this is a lot simpler as
    we have just a single way to allocate DMA memory there.
    
    I made the algorithm recursive (with a small limit) since it's
    actually (almost) impossible to hit this today - dma_alloc_coherent
    is currently documented to always return 32-bit addressable memory
    regardless of the DMA mask for it, and so we could only get REALLY
    unlucky to get the very last page in that area.
    Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
    Signed-off-by: default avatarLuca Coelho <luciano.coelho@intel.com>
    d84a7a65
ctxt-info.c 8.88 KB