Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp6792680imm; Tue, 24 Jul 2018 03:12:16 -0700 (PDT) X-Google-Smtp-Source: AAOMgpcDlMSx7I6qtJFnwxHD+vKoaYlrFo4AhgSUY8D8RiaoBGTcSy/7yujY9poRJgJ3Ud9BZ1p1 X-Received: by 2002:a17:902:b58b:: with SMTP id a11-v6mr15327259pls.34.1532427136693; Tue, 24 Jul 2018 03:12:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532427136; cv=none; d=google.com; s=arc-20160816; b=qkG8/3id+Q1F5Xw30yqMACdNksWPPUg19lWV3BPurQiR646YWDS+8D5QHFHki6zosr cPJxH3LKdjFBCgRWmJx/mgX79HVlDjkipUeNcfQrRVXBbu5t9AoZfAxBzQJx0IAS/1O1 h/Mb/1UBDWDW9ZgNdq+M6KrnLHUVdMqU9RQ3nYFHVBmJAb4nKdDR1acaHrfnMLW1bC/8 +lnC/WD6C/9cxnqBDrXw0iL3MLAPjztLMLuxNKu6fybeTXC0eoEW+D5q2z7ecXmaXIhE lXliry9ppSLnXYT7/b6z+SMuZgtvk9grAD4z91Ql8T8xi1/VGY4ca4hx9yqxtqtYsXdd E1ZQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature:arc-authentication-results; bh=Xioo8zyW/92eVftkWRjIYDD2oTKnX34q2OCp56mWKuc=; b=x5NhSI25kGAvv90GJrNw3TbeZA2eSniskg+5wv+uq1Det06jDEFOD/o2hCTDsIEF8B W6ZyjxnR+jwT7LRDRPDs3lpil5SzRfJtFpSS+Y0W2a0S2JIBjqkU6v0rJMm4Ch0zdZPg A69CPktHimGZwT53+8D0Di4abQY0cntzAGTrokL088aM57vRnqLHSz/NUgVMIbCFJv03 28LtS+M7kv/+pkv8RJ5M10jAA/IbCY0BqpAqqNuoTXYxYSXeOHAYOUJ6AAIBvC29dbjq XOkxHR4S4YD13kod2qBREJNH7+NHH4/AA92XW9gAg3Jh98SvRTr3dQlVuCsIkBk3F/7O EaIw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@synopsys.com header.s=mail header.b=SrRJK4Cz; 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 q1-v6si10987652pgr.68.2018.07.24.03.12.02; Tue, 24 Jul 2018 03:12:16 -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=SrRJK4Cz; 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 S2388370AbeGXLQT (ORCPT + 99 others); Tue, 24 Jul 2018 07:16:19 -0400 Received: from smtprelay.synopsys.com ([198.182.60.111]:40123 "EHLO smtprelay.synopsys.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388251AbeGXLQT (ORCPT ); Tue, 24 Jul 2018 07:16:19 -0400 Received: from mailhost.synopsys.com (mailhost3.synopsys.com [10.12.238.238]) by smtprelay.synopsys.com (Postfix) with ESMTP id F23F210C0721; Tue, 24 Jul 2018 03:10:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=synopsys.com; s=mail; t=1532427036; bh=vzvuSMnHdTN2sQ60h+iWe+yw6d1UHKYEcrWy/R0i4xI=; h=From:To:Cc:Subject:Date:From; b=SrRJK4CzEK4nVrl7s6hu9KQfLMUoFW5gQJZ36vLSDebwTpe3AB/6eEQeXY0Sjt7vf CJNLfl0yyJMnR7edn5NR9aGY5M1PNu8xO0z9RYa2tuY+TKgy6iPnBstwZY1OSPp4YF WxujXfi2vDthcls8Jj96GrdWX+xpniWf7nzuRGn8QhC4kodOc5MuyE7YnOU5HuGaXw 27iVktl0r86hpbsI41mLNc/hXlsBHuyxxhX9RGB6hDdzflL1DJVIj+l7Da3sPlpCVj 1cJRUWQ/5NEp1cvJjJ8W8GnpyTXet63tk/R1yhINNFQ3Zao9A4TqOM4Yo4Ady3YTOF VyJuEKXeww+pQ== Received: from paltsev-e7480.internal.synopsys.com (unknown [10.121.8.86]) by mailhost.synopsys.com (Postfix) with ESMTP id D73773319; Tue, 24 Jul 2018 03:10:33 -0700 (PDT) From: Eugeniy Paltsev To: linux-snps-arc@lists.infradead.org Cc: linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org, Vineet Gupta , Alexey Brodkin , hch@lst.de, Eugeniy Paltsev Subject: [PATCH 0/4] ARC: allow to use IOC and non-IOC DMA devices simultaneously Date: Tue, 24 Jul 2018 13:09:57 +0300 Message-Id: <20180724101001.31965-1-Eugeniy.Paltsev@synopsys.com> X-Mailer: git-send-email 2.14.4 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The ARC HS processor provides an IOC port (I/O coherency bus interface) that allows external devices such as DMA devices to access memory through the cache hierarchy, providing coherency between I/O transactions and the complete memory hierarchy. Some recent SoC with ARC HS (like HSDK) allow to select bus port (IOC or non-IOC port) for connecting DMA devices in runtime. With this patch we can use both HW-coherent and regular DMA peripherals simultaneously. NOTE: This patch series was stress tested on HSDK with iperf3 (ethernet) and bonie++ (usb and sdio). NOTE: If you want to test some device without IOC it is not enough to remove "dma-coherent" property from dts. You had to remap this device to regular DDR AXI port intead of IOC AXI port. You also need to take into account that all DMA devices on ARC will not work without IOC after commit: a8eb92d02dd7 - arc: fix arc_dma_{map,unmap}_page (I will create fix soon, see STAR 9001374807) NOTE: We don't touch any aperture configuration in this patch series. So we don't switch any devices between IOC and non-IOC AXI ports on any board. It can be done later if it is required. Eugeniy Paltsev (4): ARC: DTS: mark DMA devices connected through IOC port as dma-coherent ARC: allow to use IOC and non-IOC DMA devices simultaneously ARC: refactor arch/arc/mm/dma.c ARC: IOC: panic if both IOC and ZONE_HIGHMEM enabled arch/arc/Kconfig | 1 + arch/arc/boot/dts/axc003.dtsi | 26 +++++++++++++++++ arch/arc/boot/dts/axc003_idu.dtsi | 26 +++++++++++++++++ arch/arc/boot/dts/hsdk.dts | 4 +++ arch/arc/include/asm/dma-mapping.h | 13 +++++++++ arch/arc/mm/cache.c | 30 ++++++++++---------- arch/arc/mm/dma.c | 58 ++++++++++++++++++-------------------- 7 files changed, 112 insertions(+), 46 deletions(-) create mode 100644 arch/arc/include/asm/dma-mapping.h -- 2.14.4