Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751906AbdGGNWb (ORCPT ); Fri, 7 Jul 2017 09:22:31 -0400 Received: from foss.arm.com ([217.140.101.70]:47114 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750726AbdGGNWa (ORCPT ); Fri, 7 Jul 2017 09:22:30 -0400 Date: Fri, 7 Jul 2017 14:21:31 +0100 From: Mark Rutland To: Srinath Mannam Cc: Rob Herring , Joerg Roedel , Bjorn Helgaas , Frank Rowand , iommu@lists.linux-foundation.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, bcm-kernel-feedback-list@broadcom.com Subject: Re: [RFC PATCH 0/2] Add sideband data extraction Message-ID: <20170707132131.GA3425@leverpostej> References: <1499411399-25103-1-git-send-email-srinath.mannam@broadcom.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1499411399-25103-1-git-send-email-srinath.mannam@broadcom.com> 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: 1601 Lines: 41 On Fri, Jul 07, 2017 at 12:39:57PM +0530, Srinath Mannam wrote: > These patches implements optional DT properties to generate > smaller sideband data from RID which can be further mapped > to MSI Device ID or Stream ID > > On some of the systems, sideband data is smaller than RID > (16bits). For such system, sideband data has to be generated > by dropping some of the RID bits > > the process of sideband data extracted from RID can be expressed > using optional DT property {iommu/msi}-map-drop-mask. > > Example: If drop-mask is 0xFF09 then sideband data is > 8 bits bus number followed by 1 bit of device number and > 1 bit function number. This means drop-mask=0xFF09 will > convert RID=0x1a10 (16bits) to sideband data 0x6a (10bits). So IIUC, here's you're using this not only to mask bits out, but also to determine a *shift* to apply to the value, implicitly provided by the (contiguous) low bits of the mask. That's really not obvious from the name. Mark. > > Srinath Mannam (2): > dt-bindings: pci: Add drop mask property for MSI and IOMMU > pcie: sideband data by dropping RID bits > > .../devicetree/bindings/pci/pci-iommu.txt | 31 ++++++++++++++ > Documentation/devicetree/bindings/pci/pci-msi.txt | 33 +++++++++++++++ > drivers/iommu/of_iommu.c | 4 +- > drivers/of/irq.c | 3 +- > drivers/of/of_pci.c | 48 ++++++++++++++++++++-- > include/linux/of_pci.h | 6 ++- > 6 files changed, 117 insertions(+), 8 deletions(-) > > -- > 2.7.4 >