• Johannes Berg's avatar
    iwlwifi: pcie: work around DMA hardware bug · c4a786b3
    Johannes Berg authored
    There's a hardware bug in the flow handler (DMA engine), if the
    address + len of some TB wraps around a 2^32 boundary, the carry
    bit is then carried over into the next TB.
    
    Work around this by copying the data to a new page when we find
    this situation, and then copy it in a way that we cannot hit the
    very end of the page.
    
    To be able to free the new page again later we need to chain it
    to the TSO page, use the last pointer there to make sure we can
    never use the page fully for DMA, and thus cannot cause the same
    overflow situation on this page.
    
    This leaves a few potential places (where we didn't observe the
    problem) unaddressed:
     * The second TB could reach or cross the end of a page (and thus
       2^32) due to the way we allocate the dev_cmd for the header
     * For host commands, a similar thing could happen since they're
       just kmalloc().
    We'll address these in further commits.
    Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
    Signed-off-by: default avatarLuca Coelho <luciano.coelho@intel.com>
    c4a786b3
tx.c 70.6 KB