[PATCH 7/9] swiotlb: don't modify orig_addr in swiotlb_tbl_sync_single
Kleber Souza
kleber.souza at canonical.com
Tue Sep 21 09:17:58 UTC 2021
On 21.09.21 03:28, Khalid Elmously wrote:
> From: Christoph Hellwig <hch at lst.de>
>
> BugLink: https://bugs.launchpad.net/bugs/1943902
>
> swiotlb_tbl_map_single currently nevers sets a tlb_addr that is not
> aligned to the tlb bucket size. But we're going to add such a case
> soon, for which this adjustment would be bogus.
>
> Signed-off-by: Christoph Hellwig <hch at lst.de>
> Acked-by: Jianxiong Gao <jxgao at google.com>
> Tested-by: Jianxiong Gao <jxgao at google.com>
> Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk at oracle.com>
> (cherry picked from commit 16fc3cef33a04632ab6b31758abdd77563a20759)
> Signed-off-by: Khalid Elmously <khalid.elmously at canonical.com>
> ---
> kernel/dma/swiotlb.c | 1 -
> 1 file changed, 1 deletion(-)
>
> diff --git a/kernel/dma/swiotlb.c b/kernel/dma/swiotlb.c
> index 5a0d9d4864aca..2c52acf1135e9 100644
> --- a/kernel/dma/swiotlb.c
> +++ b/kernel/dma/swiotlb.c
> @@ -647,7 +647,6 @@ void swiotlb_tbl_sync_single(struct device *hwdev, phys_addr_t tlb_addr,
>
> if (orig_addr == INVALID_PHYS_ADDR)
> return;
> - orig_addr += (unsigned long)tlb_addr & (IO_TLB_SIZE - 1);
This seems to be broken and affecting NVME according to
5f89468e2f060031cd89fd4287298e0eaf246bf6 ("swiotlb: manipulate orig_addr when tlb_addr
has offset"). This fix was applied to 5.13 and I have not looked much deeply into it
to see if there are other commits that we are not adding here but would affect the
behavior, but anyway I believe it's worthy considering adding it to the patchset.
>
> switch (target) {
> case SYNC_FOR_CPU:
>
More information about the kernel-team
mailing list