• Tom Lendacky's avatar
    iommu/amd: Reduce delay waiting for command buffer space · 23e967e1
    Tom Lendacky authored
    Currently if there is no room to add a command to the command buffer, the
    driver performs a "completion wait" which only returns when all commands
    on the queue have been processed. There is no need to wait for the entire
    command queue to be executed before adding the next command.
    
    Update the driver to perform the same udelay() loop that the "completion
    wait" performs, but instead re-read the head pointer to determine if
    sufficient space is available.  The very first time it is found that there
    is no space available, the udelay() will be skipped to immediately perform
    the opportunistic read of the head pointer. If it is still found that
    there is not sufficient space, then the udelay() will be performed.
    Signed-off-by: default avatarLeo Duran <leo.duran@amd.com>
    Signed-off-by: default avatarTom Lendacky <thomas.lendacky@amd.com>
    Signed-off-by: default avatarJoerg Roedel <jroedel@suse.de>
    23e967e1
amd_iommu.c 103 KB