Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp6358052yba; Wed, 1 May 2019 10:38:11 -0700 (PDT) X-Google-Smtp-Source: APXvYqzUJz+q8zduSHG89pyulYS9lxtymN3o0lHDYqENKC7JnHYSQsNoQUlWv1g5yGS3OyDJ1Qhp X-Received: by 2002:a63:560d:: with SMTP id k13mr21529133pgb.124.1556732291879; Wed, 01 May 2019 10:38:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556732291; cv=none; d=google.com; s=arc-20160816; b=J/fOqQsR29csFsOx5gfyBlXjFDeorWY4E3EqQJOKbqB/ukVkqBQZXeyo3YolK2oFZc dMBpcmiTjYaI2FxDOK3OtsH7pzCBTW1yeJYIK3KtLhEGbIwYVZZUXrEeV9SEd0uRS3JR rXnj7ihecXG2zckFAFWN57yvRpOicI26MKw6YpLYSHonJA7iHCfHk/8Zb+BLgOXMGMrb 6LuHOA1UtRqKZUrRsIt+EOPBEV+thQwcYWSI+DMF0T23AT08Hrxh5dDqIJln0eFcz0Fp w+bM1tck7lLsVWQGsf82NAjRCOwaQR/cQkjUHhYp8gly3cC4vYetKLWCbELGds6Rnqb3 FJMg== 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; bh=WQh6+iJ1c5LV37hewjiOUJ2VVaJB8K0iqnjk0rOcMbE=; b=KhIW7sJgLY4vsaKNY9dToLOLmliNDk1xzgx5z8obLrKV7LIwoYP7bteqN6ob+tAt44 6bAJKwRHraKOJjKjPeQ0aPazRtKRnIRf4DOEMeDAog367cKj2x6M4HgPO1s814gsy0lP rsZq/Tr11HXDSv/GTdGqg/S58x8pN+gIL6DqjkLwPSC9g4tpb3Fma/5Sj5Mlz2POBH6I 6Orbyvg5kU/dF5SLX5GQ0jXS1uyTpKn785yS2GW4gn1EWIiRd47lkOCEPzPBHuDwrS43 O3LIavErZcyoJ3Ga/OEyWNQRhvf7vww7UsgPn2Ui0BGe+d0IyVHfYwukzQxBXVdUVhXB 3i2w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@broadcom.com header.s=google header.b=CEjb4MdJ; 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=broadcom.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u13si32701896pgp.146.2019.05.01.10.37.55; Wed, 01 May 2019 10:38:11 -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=@broadcom.com header.s=google header.b=CEjb4MdJ; 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=broadcom.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726217AbfEARg7 (ORCPT + 99 others); Wed, 1 May 2019 13:36:59 -0400 Received: from mail-ed1-f67.google.com ([209.85.208.67]:38751 "EHLO mail-ed1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726019AbfEARg7 (ORCPT ); Wed, 1 May 2019 13:36:59 -0400 Received: by mail-ed1-f67.google.com with SMTP id w11so8771406edl.5 for ; Wed, 01 May 2019 10:36:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; h=from:to:cc:subject:date:message-id; bh=WQh6+iJ1c5LV37hewjiOUJ2VVaJB8K0iqnjk0rOcMbE=; b=CEjb4MdJxi08K/sHDaK0eh5tzCmNnbKo8l7lks3hzoghFBcg/r6yFxaG++ZgfgWdOW yhDjocgFxXdRp2TXI0xdQdK5/myMxON+Mu0JLn+NQ1dTx8bFetH/46D3fX3SPvCsbFnq MJg+fKzdyXBskAw+hqszBABaL0ctbb+ffQuas= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=WQh6+iJ1c5LV37hewjiOUJ2VVaJB8K0iqnjk0rOcMbE=; b=U20xJiiGaNVKAawTH/0xBndb9VnSk3+v1gph7M78P29f42Ray9bNPMnREb50JVufLd qUULg7an7XWs/c94oWL1gD3YfW3enibCqx1kpaWyeXuBOLELzkHOzK4cNY6v9rDbvqEO GZqmgyWp45Yi9W7/0DdQvwMCDx34qElu2ht51fPgIdOlHu6snM66Gja7sucEnowICaif aqOqxpDcfmFPI1bx1GuIKCiG2BPSQLiP4JEXa3M6q83sT66utzlin7tbDyuPSNSjZo+7 v1AQPHF+fSccYDrMzYwl4NuP627YB06j38pLl+S/tR8Dd3Gtg5/DDyOy6Rkc6GK6bHxw QzKw== X-Gm-Message-State: APjAAAVEB/qCjJzPGlzXEiZAU1iWSI2/GkANlk9t2DlPsO2y3UKRJe9E j/PpCEvMgKjd1zkmDfLOolN6kA== X-Received: by 2002:a17:906:e10e:: with SMTP id gj14mr15158656ejb.285.1556732217818; Wed, 01 May 2019 10:36:57 -0700 (PDT) Received: from mannams-OptiPlex-7010.dhcp.broadcom.net ([192.19.234.250]) by smtp.gmail.com with ESMTPSA id s6sm2462671eji.13.2019.05.01.10.36.51 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 01 May 2019 10:36:56 -0700 (PDT) From: Srinath Mannam To: Bjorn Helgaas , Robin Murphy , Eric Auger , Joerg Roedel , Lorenzo Pieralisi , poza@codeaurora.org, Ray Jui Cc: bcm-kernel-feedback-list@broadcom.com, linux-pci@vger.kernel.org, iommu@lists.linux-foundation.org, linux-kernel@vger.kernel.org, Srinath Mannam Subject: [PATCH v5 0/3] PCIe Host request to reserve IOVA Date: Wed, 1 May 2019 23:06:23 +0530 Message-Id: <1556732186-21630-1-git-send-email-srinath.mannam@broadcom.com> X-Mailer: git-send-email 2.7.4 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Few SOCs have limitation that their PCIe host can't allow few inbound address ranges. Allowed inbound address ranges are listed in dma-ranges DT property and this address ranges are required to do IOVA mapping. Remaining address ranges have to be reserved in IOVA mapping. PCIe Host driver of those SOCs has to list resource entries of allowed address ranges given in dma-ranges DT property in sorted order. This sorted list of resources will be processed and reserve IOVA address for inaccessible address holes while initializing IOMMU domain. This patch set is based on Linux-5.1-rc3. Changes from v4: - Addressed Bjorn, Robin Murphy and Auger Eric review comments. - Commit message modification. - Change DMA_BIT_MASK to "~(dma_addr_t)0". Changes from v3: - Addressed Robin Murphy review comments. - pcie-iproc: parse dma-ranges and make sorted resource list. - dma-iommu: process list and reserve gaps between entries Changes from v2: - Patch set rebased to Linux-5.0-rc2 Changes from v1: - Addressed Oza review comments. Srinath Mannam (3): PCI: Add dma_ranges window list iommu/dma: Reserve IOVA for PCIe inaccessible DMA address PCI: iproc: Add sorted dma ranges resource entries to host bridge drivers/iommu/dma-iommu.c | 19 ++++++++++++++++ drivers/pci/controller/pcie-iproc.c | 44 ++++++++++++++++++++++++++++++++++++- drivers/pci/probe.c | 3 +++ include/linux/pci.h | 1 + 4 files changed, 66 insertions(+), 1 deletion(-) -- 2.7.4