Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp2247523pxk; Mon, 14 Sep 2020 08:21:42 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxG+vsxWeDlvLAecUL9oB+q8ZjDUIFqGsVySAOcOixhj44eRcP8u7CTXDpTJ1s8aeDf7C6s X-Received: by 2002:aa7:dac5:: with SMTP id x5mr13467016eds.72.1600096902120; Mon, 14 Sep 2020 08:21:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1600096902; cv=none; d=google.com; s=arc-20160816; b=g4A7KcrGiBRraIiwCOXtWDzDLVuYY5PU3wv4PLM0Ww9PyewMc9zWEL/Xv3S+ajzY7f uU0q2LQISBvdu2RvG3BcApxW5yrcoA/mdsHZy2uyv/ZqTkEEXxDOs8BEJvBoSBNxQ+6i athz3sQaDSpOXJkwcXqICid6tZMTNn4hsCgd9pSJS5F1xrL/oXN8m3IEetRk1PULx+Bn CVwykKxlWxAE2pgBh7TyKtVaV0oI3GRZAjfZ6/RWvb0fJTnqnMy1EkAuQtQd+ku25buc yrUdXV3Tw29eWYguUU6ZEJ2ppqW/g5UE/dM76YNeaNIHy2/+y7JR44fNJjsgIPbpYEbU jC1A== 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:mime-version :references:in-reply-to:date:cc:to:from:subject:message-id :dkim-signature:dkim-signature; bh=2ok0xPj19aOGKQzGQm4ViN7xZ2YmU73NIKzkqOWYqJY=; b=wz03jcyiYyVGPyZPpNTgsJORjquIgP/2q96aT5B+TB3RRNFeUBrX+NQ6pA77VIc1PT v8rdtnEGwD2iOIDfqIkPxYYNwvkHGlrpI3+lh001YZSRG5J8pz/P1xwgjtD4hBsmCqPA 37V9K6f5zjLB3BTFiv2aIOqA4Y+NTmNTDimR/+JhwK8Uubbz/fL3MovHm+dFtAOAhK2l YwqwwEp3+WdXqViVUDRa0nzrn2kkhV6CN4QXxmV/1skujGif15R1prdbao+2/bG+y26M DHuqIuVT/jleJoymlLtky/vFWKNVkwEuL5Is07KxrKLEdimQqE/scr4vCMF9W2QlCS9N ngjw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@hansenpartnership.com header.s=20151216 header.b=MwCEKT1C; dkim=fail header.i=@hansenpartnership.com header.s=20151216 header.b=MwCEKT1C; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=hansenpartnership.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id d23si7705529edy.117.2020.09.14.08.21.19; Mon, 14 Sep 2020 08:21:42 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=fail header.i=@hansenpartnership.com header.s=20151216 header.b=MwCEKT1C; dkim=fail header.i=@hansenpartnership.com header.s=20151216 header.b=MwCEKT1C; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=hansenpartnership.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725976AbgINPUo (ORCPT + 99 others); Mon, 14 Sep 2020 11:20:44 -0400 Received: from bedivere.hansenpartnership.com ([66.63.167.143]:48832 "EHLO bedivere.hansenpartnership.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726090AbgINPU1 (ORCPT ); Mon, 14 Sep 2020 11:20:27 -0400 Received: from localhost (localhost [127.0.0.1]) by bedivere.hansenpartnership.com (Postfix) with ESMTP id D94B18EE188; Mon, 14 Sep 2020 08:20:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=hansenpartnership.com; s=20151216; t=1600096820; bh=GKXYjllCOYoz9s1DCxjF5LhZlRPIv8wDG6prJomb0DU=; h=Subject:From:To:Cc:Date:In-Reply-To:References:From; b=MwCEKT1C51gNQI4k2c/TW5TFLSyvCL+DaM8jG72BtMupIn9VJeN1dkJcyAJV4JkG0 n6sSw+D1WaOUFen3nc5d+f9REcdFZ8Klept06jhzp/Us0zXjri6r0Pype5gmTqA+88 YuaiMKfDE+athYdKXtMltIVOrUi9whs+u8kR+5FU= Received: from bedivere.hansenpartnership.com ([127.0.0.1]) by localhost (bedivere.hansenpartnership.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id d819rpRvd1Od; Mon, 14 Sep 2020 08:20:20 -0700 (PDT) Received: from [153.66.254.174] (c-73-35-198-56.hsd1.wa.comcast.net [73.35.198.56]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by bedivere.hansenpartnership.com (Postfix) with ESMTPSA id 4E7098EE111; Mon, 14 Sep 2020 08:20:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=hansenpartnership.com; s=20151216; t=1600096820; bh=GKXYjllCOYoz9s1DCxjF5LhZlRPIv8wDG6prJomb0DU=; h=Subject:From:To:Cc:Date:In-Reply-To:References:From; b=MwCEKT1C51gNQI4k2c/TW5TFLSyvCL+DaM8jG72BtMupIn9VJeN1dkJcyAJV4JkG0 n6sSw+D1WaOUFen3nc5d+f9REcdFZ8Klept06jhzp/Us0zXjri6r0Pype5gmTqA+88 YuaiMKfDE+athYdKXtMltIVOrUi9whs+u8kR+5FU= Message-ID: <1600096818.4061.7.camel@HansenPartnership.com> Subject: Re: [PATCH 07/17] 53c700: improve non-coherent DMA handling From: James Bottomley To: Christoph Hellwig , Mauro Carvalho Chehab , Thomas Bogendoerfer , Joonyoung Shim , Seung-Woo Kim , Ben Skeggs , Marek Szyprowski , Tomasz Figa , Matt Porter , iommu@lists.linux-foundation.org Cc: Stefan Richter , linux1394-devel@lists.sourceforge.net, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-media@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mips@vger.kernel.org, linux-parisc@vger.kernel.org, linux-samsung-soc@vger.kernel.org, nouveau@lists.freedesktop.org, netdev@vger.kernel.org, linux-scsi@vger.kernel.org, linux-mm@kvack.org, alsa-devel@alsa-project.org Date: Mon, 14 Sep 2020 08:20:18 -0700 In-Reply-To: <20200914144433.1622958-8-hch@lst.de> References: <20200914144433.1622958-1-hch@lst.de> <20200914144433.1622958-8-hch@lst.de> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.26.6 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 2020-09-14 at 16:44 +0200, Christoph Hellwig wrote: > @@ -429,7 +430,7 @@ struct NCR_700_Host_Parameters { > for(i=0; i< (sizeof(A_##symbol##_used) / sizeof(__u32)); > i++) { \ > __u32 val = > bS_to_cpu((script)[A_##symbol##_used[i]]) + da; \ > (script)[A_##symbol##_used[i]] = bS_to_host(val); \ > - dma_cache_sync((dev), > &(script)[A_##symbol##_used[i]], 4, DMA_TO_DEVICE); \ > + dma_sync_to_dev((dev), > &(script)[A_##symbol##_used[i]], 4); \ > DEBUG((" script, patching %s at %d to %pad\n", \ > #symbol, A_##symbol##_used[i], &da)); \ > } \ > @@ -441,7 +442,7 @@ struct NCR_700_Host_Parameters { > dma_addr_t da = value; \ > for(i=0; i< (sizeof(A_##symbol##_used) / sizeof(__u32)); > i++) { \ > (script)[A_##symbol##_used[i]] = bS_to_host(da); \ > - dma_cache_sync((dev), > &(script)[A_##symbol##_used[i]], 4, DMA_TO_DEVICE); \ > + dma_sync_to_dev((dev), > &(script)[A_##symbol##_used[i]], 4); \ > DEBUG((" script, patching %s at %d to %pad\n", \ > #symbol, A_##symbol##_used[i], &da)); \ > } \ > @@ -456,7 +457,7 @@ struct NCR_700_Host_Parameters { > val &= 0xff00ffff; \ > val |= ((value) & 0xff) << 16; \ > (script)[A_##symbol##_used[i]] = bS_to_host(val); \ > - dma_cache_sync((dev), > &(script)[A_##symbol##_used[i]], 4, DMA_TO_DEVICE); \ > + dma_sync_to_dev((dev), > &(script)[A_##symbol##_used[i]], 4); \ > DEBUG((" script, patching ID field %s at %d to > 0x%x\n", \ > #symbol, A_##symbol##_used[i], val)); \ > } \ > @@ -470,7 +471,7 @@ struct NCR_700_Host_Parameters { > val &= 0xffff0000; \ > val |= ((value) & 0xffff); \ > (script)[A_##symbol##_used[i]] = bS_to_host(val); \ > - dma_cache_sync((dev), > &(script)[A_##symbol##_used[i]], 4, DMA_TO_DEVICE); \ > + dma_sync_to_dev((dev), > &(script)[A_##symbol##_used[i]], 4); \ > DEBUG((" script, patching short field %s at %d to > 0x%x\n", \ > #symbol, A_##symbol##_used[i], val)); \ > } \ If you're going to change the macros from taking a device to taking a hostdata structure then the descriptive argument name needs to change ... it can't be dev anymore. I'm happy with it simply becoming 'h' if hostdata is too long. I already asked for this on the first go around: https://lore.kernel.org/alsa-devel/1598971960.4238.5.camel@HansenPartnership.com/ James