Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp4150715imm; Mon, 30 Jul 2018 09:27:55 -0700 (PDT) X-Google-Smtp-Source: AAOMgpfBefSkoZju57737YtLeNeIb+DAicLuHU7HCYtrTCPTyl0HMog0UReH2L+WEoLNSK6uxuPs X-Received: by 2002:a17:902:8c88:: with SMTP id t8-v6mr11404308plo.117.1532968075764; Mon, 30 Jul 2018 09:27:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532968075; cv=none; d=google.com; s=arc-20160816; b=EEaePuZ4+kgfyQQeKioFbKwtReO6qgPyZp+rWGMtj1WOAD8qaEvGdW1h5KM0qVB3qj CB03MiSiYdCgOHDk0fhgSpZmNY3kOZOMx/RRoheM/WxD2CIL60x9qcYbCj6cHoimRgQG hbeEDiVctpFpzsJ6MLOMqBdOgpK0CU5ygPt3Am5ii0boMxDINPUkT1s6E7krOTamLeXI golRq0Y+w4BCNYJtSlb55gzhSbRi+tnxM8E4E06uFrjaz8UYKYcah8R4fOqyGlN0aTKH nMMMb8zAa1b7XzvTVPMDOavYc6B2l7mcLul/2BMUScg/E2NPeI7BPn8vvkqjZi5EJDmv Ldaw== 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=UIxN9aWqCIo2XmAO1YCFVhKyG4mN+GL8wGvsJsKlARk=; b=dNo3v+EpOU5NPrXUkTu1JwO+Jn8Lk3EBCOyiy/mc985CzDlBg53R5umW7gvqaxxeYF ILMjoGFapWrYbrHMJ1/v12sqKXlIcv+X4Ur5gFQiBmlw+twK9H0LLp86L4OW/ZGCVA93 7jVAlWNjXVr+9TMsrQ5Fcn4B72qWQ1ShMgdzWI+cBUOt21UYRvAV7OaCgZQMyOtGgkL3 VEZWYkxc2heLG/5s7CjdK1O8BlnkMeBNK5WwJMryOFNdq8ii3LcVVDXvwbLKryhzOKPq Gi8qDN47Hj9HteeNWBmFV10Nk7JOMNrq7roIfq956D6Sf0J0DpK1SkBx5gqZnqzPwVHk 8rYw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@synopsys.com header.s=mail header.b=AZvceG92; 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 c14-v6si11713904pfl.319.2018.07.30.09.27.41; Mon, 30 Jul 2018 09:27:55 -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=AZvceG92; 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 S1731760AbeG3SC0 (ORCPT + 99 others); Mon, 30 Jul 2018 14:02:26 -0400 Received: from smtprelay4.synopsys.com ([198.182.47.9]:43636 "EHLO smtprelay.synopsys.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726760AbeG3SC0 (ORCPT ); Mon, 30 Jul 2018 14:02:26 -0400 Received: from mailhost.synopsys.com (mailhost3.synopsys.com [10.12.238.238]) by smtprelay.synopsys.com (Postfix) with ESMTP id C320A24E071D; Mon, 30 Jul 2018 09:26:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=synopsys.com; s=mail; t=1532968002; bh=/+xzHONe1WwpXfZ4Cc8MXPVK+iiK/GUO+4yIHyB1Cw4=; h=From:To:Cc:Subject:Date:From; b=AZvceG92pphJI9GeyGyuLKHNd/14FG9ys/KeH1Us0K/E6M8TaRYKgHxc0DOm6U6DZ nQTwCtIRpHEspFmj/Cq/sEA2XFZuDAIa/2S7zMAOMcgPsAqpuLKwRa85bq29yHUyKz BzWOg3ajFp3zHVUm/LEVqNrdbZAaH8eq8nXx9v5CVi0tUHT4Gm7YpwoMClE8V4sFUO MCnaPn3rAW8QAoBADMUNClH+5oJP67wroN+cS1s7gzbA5F6ptwtXkqJFed6mqS0Tpl G2RKrL4uksm0bkmjyXW0zOeIl6FL8vgeBlFq+K47wEuy/f/aRXDzFy0alrc1uY9XRB f6K6frILKKQxA== Received: from paltsev-e7480.internal.synopsys.com (unknown [10.121.8.86]) by mailhost.synopsys.com (Postfix) with ESMTP id 059E33F3C; Mon, 30 Jul 2018 09:26:39 -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 v2 0/4] ARC: allow to use IOC and non-IOC DMA devices simultaneously Date: Mon, 30 Jul 2018 19:26:32 +0300 Message-Id: <20180730162636.3556-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) in three configurations: * IOC enabled globaly * IOC disabled globaly * IOC enabled partially (USB & SDIO are connected via IOC AXI port, ethernet is connected to DDR AXI port (non-IOC port) 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 apply 3 following patches firstly: https://www.mail-archive.com/linux-snps-arc@lists.infradead.org/msg03865.html https://www.mail-archive.com/linux-snps-arc@lists.infradead.org/msg03889.html https://www.mail-archive.com/linux-snps-arc@lists.infradead.org/msg03887.html 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. Changes v1->v2 (Thanks to Christoph): * Don't select DMA_DIRECT_OPS explicitly as it is already selected by DMA_NONCOHERENT_OPS * Remove check for HIGHMEM pages from arch_dma_{alloc, free} 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: IOC: panic if both IOC and ZONE_HIGHMEM enabled ARC: don't check for HIGHMEM pages in arch_dma_alloc 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 | 62 +++++++++++++++++++------------------- 6 files changed, 115 insertions(+), 46 deletions(-) create mode 100644 arch/arc/include/asm/dma-mapping.h -- 2.14.4