Received: by 2002:a25:b794:0:0:0:0:0 with SMTP id n20csp4073235ybh; Tue, 6 Aug 2019 05:58:58 -0700 (PDT) X-Google-Smtp-Source: APXvYqzqfje3sSlMgNNmASlHkPAoiL+Sn/rnG8PGlBfrfYWayzOw1S2aec0K7a3u/AnOb/SWd0bg X-Received: by 2002:a17:90a:228b:: with SMTP id s11mr3020166pjc.23.1565096338442; Tue, 06 Aug 2019 05:58:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1565096338; cv=none; d=google.com; s=arc-20160816; b=sszOLYeSuFUn0F+Bg8/HXB8vwm+ki7oVhtyndYTp/EZwC2DwLWdywgsEiJAOzuVule qKOgl3VD9kxj89qRvmKB+fSb/GOEMqiE8TQ5Plji56SC7nBoby5TTdD2ppe5/+QHvZQo ZS6wViZ9CfR1gxy8YPycjvvW5aWqbh5868/Lq0sqAcSXB0VAeEo5VcOEhkuc0a3jFwaG q7QIasjpcVvQUm4/dpITxjlRo+h2jXbp47GHu+psxz7htyirUDo5bUACPiQ7nYWo5F3N QUtUX2wbvvlozDxiGkqLTeoFQl42kCotL4TNDuJoRddgr9mev4h4a20GigURxoBMpPOz CCCw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=dbqNjhiinWT7B7WKaNqxLR3lRgcuWODp4jFl41+c7PM=; b=ebSQ/wdft9g83mP+yurAWNke0cR7HEdid6znvpcIm3AheFLeAk+xDkys+6bkjpb/L2 QFbFtxgb6MnawyAUIZVDSOALn/fNcXqiBZwxGKbYbs4tnF/IDzpx7XCcseb/S5orn974 zW2xcLuK6QEte8nyz8hu+lCP6eoQmd1X9ygG3FfcXHpUGyD8SMZr2GFR7/KHjZrPK721 AHKOyu3r6uWNwQIGjuv97aZgs+5jjBMCTjaFryeecBK29wtdVW3zRfqTV6uDqChb8cAY 5VPnJcGLyxupr2oA0H3ohewLUVEfyGdz5POzRQjrSjvJwMpCktVLH0ZDwvd94O/AhObD lMow== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t4si45533219plq.93.2019.08.06.05.58.42; Tue, 06 Aug 2019 05:58:58 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731179AbfHFM57 (ORCPT + 99 others); Tue, 6 Aug 2019 08:57:59 -0400 Received: from foss.arm.com ([217.140.110.172]:33032 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730896AbfHFM56 (ORCPT ); Tue, 6 Aug 2019 08:57:58 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 1DBCB28; Tue, 6 Aug 2019 05:57:58 -0700 (PDT) Received: from [10.1.197.57] (e110467-lin.cambridge.arm.com [10.1.197.57]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 395DF3F694; Tue, 6 Aug 2019 05:57:57 -0700 (PDT) Subject: Re: [PATCH 5.2 073/131] dma-direct: correct the physical addr in dma_direct_sync_sg_for_cpu/device To: Sasha Levin , Greg Kroah-Hartman Cc: linux-kernel@vger.kernel.org, stable@vger.kernel.org, Fugang Duan , Christoph Hellwig References: <20190805124951.453337465@linuxfoundation.org> <20190805124956.543654128@linuxfoundation.org> <20190806124143.GF17747@sasha-vm> From: Robin Murphy Message-ID: <9dd82745-1673-afc3-5eb4-8b79ddb5824b@arm.com> Date: Tue, 6 Aug 2019 13:57:56 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 MIME-Version: 1.0 In-Reply-To: <20190806124143.GF17747@sasha-vm> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-GB Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 06/08/2019 13:41, Sasha Levin wrote: > 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. Given that the two commits touch entirely separate files I'm not sure what the imagined dependency could be :/ 0036bc73ccbe is indeed not a fix (frankly I'm not convinced it's even a valid change at all) but even conceptually it bears no relation whatsoever to the genuine bug fixed by 449fa54d6815. Robin. > > If someone wants it in the stable trees, please send a tested backport. > > -- > Thanks, > Sasha