Received: by 10.223.176.46 with SMTP id f43csp976795wra; Fri, 26 Jan 2018 09:47:35 -0800 (PST) X-Google-Smtp-Source: AH8x226WESEQ0hQzp4CJT7/uWtGOoXD6HtiXRui1yEEwa2/u25/HD2sTkw2KzjUTaxcWEqAmsULm X-Received: by 10.99.165.87 with SMTP id r23mr16057341pgu.93.1516988854901; Fri, 26 Jan 2018 09:47:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516988854; cv=none; d=google.com; s=arc-20160816; b=YWoefvW3v0KVFwwEFKURGGr4BmGbsXw+mxMFnd6MKBCLjrVtjxzQqP1m7sSoYQiYgQ FR+ZmuHRjA6GPYC6pttXe0Ih9E2CGySdbDP/ZBIc9T8V4vLFdUZd+XG2Rg1Ij4kk7+ZC wy0BMZmpYr6XJ0WsHw15WJcsw29TzGFU0zzPG0Des1cvvYPAXYx/HjI4zUUqEPmPeGQn s8UdMCP+GAgViuB61mfGzspzijobZflzfJSrtpLKOnl9vN82hZjroCjtMUYOF/d7e8uz Vj5Q26rKTkW1qfWxnluAbNeamdf+BWC/nUMnsXz2EhaqsNe4UUucee42mtQpHoc+WbVb yPQA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:dkim-signature :arc-authentication-results; bh=63vpePTo/Gxz4tLg+VvXG6N1DvFEAltssPjs8xZShw0=; b=XW7B6XPQtF5nMwLm/zoQuHbRMVBX5gK8Qvy6vJhxbFyvUCqx2cxxdh54jcMG53RPIR Nq25WcYLK8u5ilAjR0pirB2EJOfztj91+BFfQOCk+ddP0CkSh7WLbRRVoVcNnqCBIfU7 0zhYJhw7XiyXt3VzHq6WdJDpjMqEyLTP75WXJoJv5qheGtkhDsIWKOcpS9KXLa3YwXWQ T2lv4t3bJ7xL5BwfsbAl5xXEaF8cxXAQ21pg+TJKZlew64k0JmzvFHgOCq5NzVDl5ULt slDew4AYnkX4xd+OP539/fu+a5usjtx7qsMvMos5FCp2Hwyp2zQPf4wNzhxICrriz6Wl vzCw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=jFX1OcMy; 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=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u19si6596865pfh.154.2018.01.26.09.47.20; Fri, 26 Jan 2018 09:47:34 -0800 (PST) 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=@gmail.com header.s=20161025 header.b=jFX1OcMy; 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=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751948AbeAZRqs (ORCPT + 99 others); Fri, 26 Jan 2018 12:46:48 -0500 Received: from mail-io0-f180.google.com ([209.85.223.180]:38823 "EHLO mail-io0-f180.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751506AbeAZRqp (ORCPT ); Fri, 26 Jan 2018 12:46:45 -0500 Received: by mail-io0-f180.google.com with SMTP id d13so1235780iog.5; Fri, 26 Jan 2018 09:46:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=63vpePTo/Gxz4tLg+VvXG6N1DvFEAltssPjs8xZShw0=; b=jFX1OcMy5jgzcFsv0oKMfnqxU0r07u/pKgGcKeKRoAxlTftPWCK5FWeTHutytwCrBE RAF6Y9z1/f/DaKHVEhu64EZQ/wKo3VM0SKNnWcHSg/lsnH6L2anABqRFr6P/TV/H9hG6 0brlNwJPFajFESq5mrqlOKLzkriFfJBdsFis0C1Oyl3PnWDX5oaxdKOQ24gTbqU7v7Oq cLnAop5S0Nxf3l9FmcEQ6uY8F8Ic9lOLP7H7ETqQsElXjE6yPWfF91SCqWyMkCCFgiRE 4l/lJ3SN/oj7N8wE9iErW+hetbw8cwqbf0n5wjjQ8tkIBwJa43C7iDiXWRmHiv+cau6v u8Sg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=63vpePTo/Gxz4tLg+VvXG6N1DvFEAltssPjs8xZShw0=; b=SR9Q9x/RaY5IhdKH0ujH1bf1iFgK+OpTHag4RCVBA4i1r3xoCbkWcp/d2dCeuke1KP QyrG+ZmCW3Et0QATxcZYWWH48nGyDUr3RkCLfkvEbaU8nzy7m5pYjggpjWEircd6j/Yz kfCG+PStLRfmXn0YgraLRBQf67D6qULReLjceZFYvieEShYb9530RnARcPZm80Zw46GD 2geTr0SZgg4x3T7jwgJFGYF2WqcRLtYpXJFCDhyf01XKREkVuSmGGQVfT7TuEAlDNtAl DsG8F3eRsn1Ez2ke1hoqSvS9a010Un0gbQm80s2VGvgUeFsow4fRr7kF2XgmX5jLg7Ok +CHg== X-Gm-Message-State: AKwxytcsTvBduuJrPADcVOIHnVA8Upk1HPMSHsEu0R7fAkm2ZaL3rQeR RlkDkPfHhtXOHwpKMa8te5kis9+uJugcPjgwwiQ= X-Received: by 10.107.132.224 with SMTP id o93mr3544245ioi.58.1516988805129; Fri, 26 Jan 2018 09:46:45 -0800 (PST) MIME-Version: 1.0 Received: by 10.107.8.9 with HTTP; Fri, 26 Jan 2018 09:46:44 -0800 (PST) In-Reply-To: <20180126075343.GB2356@lst.de> References: <1516058925-46522-1-git-send-email-jim2101024@gmail.com> <1516058925-46522-5-git-send-email-jim2101024@gmail.com> <20180118073123.GA15766@lst.de> <20180118152331.GA24461@lst.de> <20180123132033.GA21438@lst.de> <20180126075343.GB2356@lst.de> From: Jim Quinlan Date: Fri, 26 Jan 2018 12:46:44 -0500 Message-ID: Subject: Re: [PATCH v4 4/8] PCI: brcmstb: Add dma-range mapping for inbound traffic To: Christoph Hellwig Cc: Florian Fainelli , Rob Herring , "linux-kernel@vger.kernel.org" , Bjorn Helgaas , Catalin Marinas , Will Deacon , Brian Norris , Russell King , Robin Murphy , Jonas Gorski , Lorenzo Pieralisi , Mark Rutland , "open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS" , Linux-MIPS , linux-pci , Kevin Cernekee , Ralf Baechle , bcm-kernel-feedback-list , Gregory Fong , "moderated list:ARM/FREESCALE IMX / MXC ARM ARCHITECTURE" Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jan 26, 2018 at 2:53 AM, Christoph Hellwig wrote: > On Wed, Jan 24, 2018 at 12:04:58PM -0800, Florian Fainelli wrote: >> This looks nicer than the current shape, but this still requires to >> register a PCI fixup to override phys_to_dma() and dma_to_phys(), and it >> would appear that you have dodged my question about how this is supposed >> to fit with an entirely modular PCIe root complex driver? Are you >> suggesting that we split the module into a built-in part and a modular part? > > I don't think entirely modular PCI root bridges should be a focal point > for the design. If we happen to support them by other design choices: > fine, but they should not be a priority. I disagree. If there is one common thing our customers request it is the ability to remove (or control the insmod of after boot) the pcie RC driver. I didn't add this in as a "nice-to-have". > > That being said if we have core dma mapping or PCIe code that has > a list of offsets and the root complex only populates them it should > work just fine. I'm looking at arch/arm/include/asm/dma-mapping.h. In addition to overriding dma_to_phsy() and phys_to_dma(), it looks like I may have to define __arch_pfn_to_dma(), __arch_dma_to_pfn(), __arch_dma_to_virt(), __arch_virt_to_dma(). Do you agree or is this not necessary? If it is, this seems more intrusive than our pcie-brcmstb-dma.c solution which doesn't require tentacles into major include files and Kconfigs. Another issue is that our function wrappers -- depending upon whether we are dealing with a pci device or not -- will have to possibly call the actual ARM and ARM64 definitions of these functions, which have been of course #ifdef'd out. This means that our code must contain identical copies of these functions' code and that the code must somehow be kept in sync. Do you see a solution to this? Jim