From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751960AbeAZRqs (ORCPT ); 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 X-Google-Smtp-Source: AH8x224iiw9mgigr0wnjK3HlUOIfja3F/gyzgzYh3GRBiZfx2VCQ3c0uiU9Ik7aZLg7GTyH0eOlPoMYCLRIYQdh9pyg= MIME-Version: 1.0 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 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