Received: by 2002:a25:b794:0:0:0:0:0 with SMTP id n20csp4057675ybh; Tue, 6 Aug 2019 05:42:51 -0700 (PDT) X-Google-Smtp-Source: APXvYqxkhhZ/2dyOr/L+jLQWU9R2gomSLPRu557pHls0Yd+XJOZIARMILUpV77QvKUXu18du/lCT X-Received: by 2002:aa7:8b51:: with SMTP id i17mr3525910pfd.33.1565095371155; Tue, 06 Aug 2019 05:42:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1565095371; cv=none; d=google.com; s=arc-20160816; b=HH2U7PCAhcMHPQ4y3lBimb+nt5rdfJgZh7QDfSX4K8Bz0BBUvjbcZugsINkzIs3jDT PibJlg273IP4Q3oz4aVlpks8Q210+TCurQsnQnVcvvU1xBzG7hoWr0XJHe0BVAqGUH2m 0SHfq3HMjnd5CKtBkdHiYekGdlrJll0HaN4QXCrhUvNWYgFquFax3nJXB1kSPqsRkNMU 43pylNBLFMrXt6PUbCngjAn+xSN/YHe6tAtKVQKvaRhOiM1dhuIV1dB4S+HUqpukbAx4 OyfO0Zvyb6GAt91mVmspuJ9+3UuLSvFNfNpMUA2sAEyNPLca7gMpJE67XQhlyqSmN6PX Aigw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=sjfhFWQ5x2b/DhkPQyuMAP9uKEZFaCHi7CluBzpWE9c=; b=A1LHYWcRzQ+U/lOiJWHfL/FsDiZWSP4vp8vTEW5aTPMC0UXSEF4wgtihxkxiFocMmm p9feecVPS/+cc88d9ZQWzpdBEeGIVwPskulka9QQnFffBkFqk3F7SO8huyvWQc5B5atc ZTgDlBZyYubK6ZbNUazL7S/bQoHmzPTSzsdAQb+wA4434IHjcvxuNfFyLnAMCr74y65+ n2SdVG6tzg7zUPy5+OS7+bJ8oxYbpMdyzDgfzirRybZOcuwdtrHuCbkpfY1+4GvEs8En aACUtJiP1RFDhs8LxfPkuDWtdd5bjRQFPHcbankBAGX5A/K9YZ+mHTiCxn1kTNnuVpnF 9U1A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=Pb4DE6Yk; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e14si50156529pfl.261.2019.08.06.05.42.35; Tue, 06 Aug 2019 05:42:51 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=Pb4DE6Yk; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731560AbfHFMlq (ORCPT + 99 others); Tue, 6 Aug 2019 08:41:46 -0400 Received: from mail.kernel.org ([198.145.29.99]:50622 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726036AbfHFMlp (ORCPT ); Tue, 6 Aug 2019 08:41:45 -0400 Received: from localhost (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 84A9120818; Tue, 6 Aug 2019 12:41:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1565095304; bh=xNSlvXtmO8YI+JCDc0+g/z1qw41BP+LTgmlaJunBWPI=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=Pb4DE6Yk5/x+GwL6UoJAwpE0fPujt/dU0EmepiQHPs8z8yjoKN9XeTDFVTvuUnaVj 94JfSTjz2ShLdTkptQEOLgXD8qopcptbejyWH8J62oE39KdnEW/tsOpvSLIg52EAGW m2KWNBvJYHuR3ZexgA6cXgjTEOxWPOi69oKUU184= Date: Tue, 6 Aug 2019 08:41:43 -0400 From: Sasha Levin To: Greg Kroah-Hartman Cc: linux-kernel@vger.kernel.org, stable@vger.kernel.org, Fugang Duan , Robin Murphy , Christoph Hellwig Subject: Re: [PATCH 5.2 073/131] dma-direct: correct the physical addr in dma_direct_sync_sg_for_cpu/device Message-ID: <20190806124143.GF17747@sasha-vm> References: <20190805124951.453337465@linuxfoundation.org> <20190805124956.543654128@linuxfoundation.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline In-Reply-To: <20190805124956.543654128@linuxfoundation.org> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Aug 05, 2019 at 03:02:40PM +0200, Greg Kroah-Hartman wrote: >[ Upstream commit 449fa54d6815be8c2c1f68fa9dbbae9384a7c03e ] > >dma_map_sg() may use swiotlb buffer when the kernel command line includes >"swiotlb=force" or the dma_addr is out of dev->dma_mask range. After >DMA complete the memory moving from device to memory, then user call >dma_sync_sg_for_cpu() to sync with DMA buffer, and copy the original >virtual buffer to other space. > >So dma_direct_sync_sg_for_cpu() should use swiotlb physical addr, not >the original physical addr from sg_phys(sg). > >dma_direct_sync_sg_for_device() also has the same issue, correct it as >well. > >Fixes: 55897af63091("dma-direct: merge swiotlb_dma_ops into the dma_direct code") >Signed-off-by: Fugang Duan >Reviewed-by: Robin Murphy >Signed-off-by: Christoph Hellwig >Signed-off-by: Sasha Levin I'm going to drop this one. There's a fix to it upstream, but the fix also seems to want 0036bc73ccbe ("drm/msm: stop abusing dma_map/unmap for cache") which we're not taking, so I'm just going to drop this one as well. If someone wants it in the stable trees, please send a tested backport. -- Thanks, Sasha