Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp4779467imm; Fri, 18 May 2018 10:30:11 -0700 (PDT) X-Google-Smtp-Source: AB8JxZrISLXj1mHm+GcCm4JpDKH9K66sq3HBUKx+786xcppfVnewToEKawxg2aG5IbKB1BCBulvX X-Received: by 2002:a63:7848:: with SMTP id t69-v6mr8261360pgc.380.1526664611489; Fri, 18 May 2018 10:30:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526664611; cv=none; d=google.com; s=arc-20160816; b=k54jkJ1dusimvNnZTlaif6CaseIh2zjRqFanYckOpwwTkO+PuBrxf8ndyuvwzkNlZR g2t3lPeuorZl159KU1sFaoaw6kSkjV8fraRfxp8BZQdRNsVnn+6YT+AKghYTbL/n0mG6 sFiNJfPvlsyhkDaQHDj96gGzZvpI2mI4g48ewmqXZBlf4/MBf4RFvre/WzJtUJqOgP4F CLyJat7ZTwqM1F+wQnwEbmfqvO7hHAoZVFPWWYTW8DJ05cc4kXpP/EZKDJVfbNQhaD/c vybqq0PPoqCzRmVspW3KMPpstmGsKPHjgI3Mp2MYJVoAz4oY19QwRsBbaErczeKcofIo OY3g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-language :content-transfer-encoding:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature :arc-authentication-results; bh=DFyV7rMfRTKjhovBpXokiICtcd2uTqVwcDHrzRiyZrY=; b=VAKcg5+Hi0raoyd/QCXNyotXkRmZxnADByN0AWT5XdHgYijzSk9VKJj4jdF7WQ1yQM uM4OT3deJoGgw4GCTtw8xh2GTC64ojv6VQCbeP+InYDS2OWbglZCOkPx4wGpwAMIN0eG T49k/LROuAktIeuzZMd+bHtMfXbL2PuK0MpaTm4bqcpQFlQq5AW+zz7QZlfX6ImWvDpn U5BvZFZX/QbzB4YsrZWH5UFHPLpp/dHMWDF3+Q+hr/hLoQpLwIqBfNPxI3ozqixEb2tM uHbH+B2coEFvIHpDeBN++Zzp5Ymq9UsldaFBg/ktKuYC9DkhpMWaMaDfTio6bDXYojUW UIoA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@synopsys.com header.s=mail header.b=kpCn2I81; 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=synopsys.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x128-v6si7980663pfb.237.2018.05.18.10.29.56; Fri, 18 May 2018 10:30:11 -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=@synopsys.com header.s=mail header.b=kpCn2I81; 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=synopsys.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751693AbeERR23 (ORCPT + 99 others); Fri, 18 May 2018 13:28:29 -0400 Received: from smtprelay6.synopsys.com ([198.182.37.59]:58524 "EHLO smtprelay.synopsys.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751488AbeERR2Z (ORCPT ); Fri, 18 May 2018 13:28:25 -0400 Received: from mailhost.synopsys.com (mailhost1.synopsys.com [10.12.238.239]) by smtprelay.synopsys.com (Postfix) with ESMTP id 62A531E04FE; Fri, 18 May 2018 19:28:23 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=synopsys.com; s=mail; t=1526664503; bh=LesMEtyMDIzrCSW0Wss513Ck7qIPIOrZ56dHHPito5k=; h=Subject:To:CC:References:From:Date:In-Reply-To:From; b=kpCn2I81OHTrosoqL98iwugMI2gl0ie2JSM130J4d9sMU0m9+lyJZx41C5yz57kL3 cYBB8vNcpM1T2GlbEm0QSGJPWk0t02qKAGrrU444cBVYPA6UCDRpWnLT37UtH6Jxj0 y4eczmoJUwxcBuKVp2fcFJUiL7zcRQtig+fcEQqSw/Yo5XJHaFRMl9UuBI0u7YESHJ pxnjZ7SiSzKkzaGefUM2tD2zVBaDFEg6T6GGq7qMW/CaPxqFLU2t8+ZJ+W3Z+j2fa5 U5/eGWJvPEb0v0kZ3SpNTV3I13umCC0hckio08ph0bowHIhs2CKpNTHLAQUleMw3Ig eYAMlGvTMD6mQ== Received: from US01WEHTC2.internal.synopsys.com (us01wehtc2.internal.synopsys.com [10.12.239.237]) by mailhost.synopsys.com (Postfix) with ESMTP id 5AA7A595A; Fri, 18 May 2018 10:28:22 -0700 (PDT) Received: from IN01WEHTCB.internal.synopsys.com (10.144.199.106) by US01WEHTC2.internal.synopsys.com (10.12.239.237) with Microsoft SMTP Server (TLS) id 14.3.361.1; Fri, 18 May 2018 10:28:22 -0700 Received: from IN01WEHTCA.internal.synopsys.com (10.144.199.103) by IN01WEHTCB.internal.synopsys.com (10.144.199.105) with Microsoft SMTP Server (TLS) id 14.3.361.1; Fri, 18 May 2018 22:58:19 +0530 Received: from [10.10.161.52] (10.10.161.52) by IN01WEHTCA.internal.synopsys.com (10.144.199.243) with Microsoft SMTP Server (TLS) id 14.3.361.1; Fri, 18 May 2018 22:58:19 +0530 Subject: Re: [PATCH 02/20] dma-mapping: provide a generic dma-noncoherent implementation To: "hch@lst.de" , Alexey Brodkin CC: "linux-arch@vger.kernel.org" , "linux-xtensa@linux-xtensa.org" , "monstr@monstr.eu" , "linux-snps-arc@lists.infradead.org" , "linux-c6x-dev@linux-c6x.org" , "linux-parisc@vger.kernel.org" , "linux-sh@vger.kernel.org" , "linux-hexagon@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "iommu@lists.linux-foundation.org" , "linux-m68k@lists.linux-m68k.org" , "openrisc@lists.librecores.org" , "green.hu@gmail.com" , "linux-alpha@vger.kernel.org" , "sparclinux@vger.kernel.org" , "nios2-dev@lists.rocketboards.org" , "deanbo422@gmail.com" , "linux-arm-kernel@lists.infradead.org" , "linux-mm@kvack.org" , Andrew Morton References: <20180511075945.16548-1-hch@lst.de> <20180511075945.16548-3-hch@lst.de> <20180518132731.GA31125@lst.de> From: Vineet Gupta Message-ID: <482e343c-bc87-9c0e-b6a8-bb69bcbeecda@synopsys.com> Date: Fri, 18 May 2018 10:28:09 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 MIME-Version: 1.0 In-Reply-To: <20180518132731.GA31125@lst.de> Content-Type: text/plain; charset="utf-8"; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US X-Originating-IP: [10.10.161.52] Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 05/18/2018 06:23 AM, hch@lst.de wrote: > Fri, May 18, 2018 at 01:03:46PM +0000, Alexey Brodkin wrote: >> Note mmc_get_dma_dir() is just "data->flags & MMC_DATA_WRITE ? DMA_TO_DEVICE : DMA_FROM_DEVICE". >> I.e. if we're preparing for sending data dma_noncoherent_map_sg() will have DMA_TO_DEVICE which >> is quite OK for passing to dma_noncoherent_sync_sg_for_device() but in case of reading we'll have >> DMA_FROM_DEVICE which we'll pass to dma_noncoherent_sync_sg_for_device() in dma_noncoherent_map_sg(). >> >> I'd say this is not entirely correct because IMHO arch_sync_dma_for_cpu() is supposed to only be used >> in case of DMA_FROM_DEVICE and arch_sync_dma_for_device() only in case of DMA_TO_DEVICE. > arc overrides the dir paramter of the dma_sync_single_for_device/ > dma_sync_single_for_cpu calls. My patches dropped that, and I have > restored that, and audit for the other architectures is pending. Right, for now lets retain that and do a sweeping audit of @direction - to me it seems extraneous (as it did 10 years ago), but I'm not an expert in this are so perhaps it is needed for some device / arches and it would be good to understand that finally. > That being said the existing arc code still looks rather odd as it > didn't do the same thing for the scatterlist versions of the calls. > I've thrown in a few patches into my new tree to make the sg versions > make the normal calls, and to clean up the area a bit. Not calling names or anything here, but it doesn't exist for sg variants, because I didn't write that code :-) It was introduced by your commi: 2016-01-20 052c96dbe33b arc: convert to dma_map_ops