Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752200AbdGGPs3 (ORCPT ); Fri, 7 Jul 2017 11:48:29 -0400 Received: from foss.arm.com ([217.140.101.70]:48778 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750938AbdGGPs0 (ORCPT ); Fri, 7 Jul 2017 11:48:26 -0400 Date: Fri, 7 Jul 2017 16:47:30 +0100 From: Mark Rutland To: Scott Branden Cc: Robin Murphy , Srinath Mannam , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, iommu@lists.linux-foundation.org, Rob Herring , bcm-kernel-feedback-list@broadcom.com, Bjorn Helgaas , Frank Rowand Subject: Re: [RFC PATCH 1/2] dt-bindings: pci: Add drop mask property for MSI and IOMMU Message-ID: <20170707154729.GE3425@leverpostej> References: <1499411399-25103-1-git-send-email-srinath.mannam@broadcom.com> <1499411399-25103-2-git-send-email-srinath.mannam@broadcom.com> <20170707133052.GB3425@leverpostej> <89f871d1-fc28-aa0b-2460-cf834e7e99f6@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2096 Lines: 60 On Fri, Jul 07, 2017 at 08:22:21AM -0700, Scott Branden wrote: > On 17-07-07 07:55 AM, Robin Murphy wrote: > >On 07/07/17 14:30, Mark Rutland wrote: > >>On Fri, Jul 07, 2017 at 12:39:58PM +0530, Srinath Mannam wrote: > >>>+Example (6) > >>>+=========== > >>>+ > >>>+/ { > >>>+ #address-cells = <1>; > >>>+ #size-cells = <1>; > >>>+ > >>>+ msi: msi-controller@a { > >>>+ reg = <0xa 0x1>; > >>>+ compatible = "vendor,some-controller"; > >>>+ msi-controller; > >>>+ #msi-cells = <1>; > >>>+ }; > >>>+ > >>>+ pci: pci@f { > >>>+ reg = <0xf 0x1>; > >>>+ compatible = "vendor,pcie-root-complex"; > >>>+ device_type = "pci"; > >>>+ > >>>+ /* > >>>+ * The sideband data provided to the MSI controller is > >>>+ * a 10bit data derived from the RID by dropping > >>>+ * 4 MSBs of device number and 2 MSBs of function number. > >>>+ */ > >>>+ msi-map = <0x0 &msi_a 0x0 0x100>, > >>>+ msi-map-drop-mask = <0xff09> > >>>+ }; > >>>+}; > >>... likewise on all counts. > >> > >>Your mapping can be expressed today using a number of msi-map entries, > >>which you can easily generate programmatically with a trivial perl > >>script, without requiring a new binding or any new kernel code. > >> > >>Please do that instead. > > > >Indeed. The systems I'm aware of which need to express non-trivial RID > >to SID mappings tend to have the bootloader probe PCI and dynamically > >generate map entries per discovered RID, but even if you wanted to > >statically generate the whole lot for the worst-case bus range that's > >still only 512 entries, which is not unmanageable. Notably, it's also > >what would have to be done (in equivalent) for IORT, although I assume > >this is an embedded platform for which nobody cares about ACPI. > > Actually we will care about ACPI and need to add it (doesn't need to > be in this patchet unless easy to do so...) Similarly to what I said for the DT case, with IORT you can solve this today by using multiple ID mapping entries in a node's ID mappings array. I don't imagine the sort of change you are proposing will sail into the IORT spec. Thanks, Mark.