Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp285535imu; Fri, 25 Jan 2019 02:14:38 -0800 (PST) X-Google-Smtp-Source: ALg8bN60suBFWuDghhn+fTpMS+zpwy+H9i1I6S+w18/NCxbheoU69z/1tBSGQjpbZMbR2F3JTizF X-Received: by 2002:a63:d846:: with SMTP id k6mr9529796pgj.251.1548411278011; Fri, 25 Jan 2019 02:14:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548411277; cv=none; d=google.com; s=arc-20160816; b=HTLz280zorIGxpthQMcAq+z0f5CBcTAE4wRrdEhTnAwmivTaYXOpIqfgTHSugthwar 0weUO+fK27qrp7f2JGA5nxnTixYnPVqWiO031L3r/iB1tqwbC4hd6si4JoDSsTXZQ12k hYxDhHpdYdrcbUInGUr8G3IdhUShlmgPitEr3Q8QMXIYXisSc29+wDW8Fv1atT+iNGHR l8n1HaxjcZ6H+MQJYNPsbRBiDpUDjI6OEB5zKQ++zVLcs9c0oJnLJ7dorjrJpBZSSIHo pFjt09Yi7R7hjNDTDFS8LpYK3nlEt/tITvpiw8LIyg7gXyozo+wDkYIW8ePsKvcgH//h yowg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature; bh=FyX1ArXOVKvRPOp9yrfUP0CSUTYZC9LeUmgndjP+YYQ=; b=A3JbmrDnRsuo60yhj8m5H4qkdtmJi1aIp7YQMGp8Eg/N0BH1b77nmSb2jQy3EbNnMa wCr9tjdZUkdsncrmLZxrUa5ckrEfn+yM+hrCc3KL+v3jYUsQxAzut0LKyHV8TRH5joyl 3T18dkMMLaQXJVgw2S128zdTi5mQoIAFAI7ymyDyLdKr34BPf8mIjX8o6tnNhuJnKa+t 6y4H9/ONGwaLBzsOSXRaIRcIILjrqDM+l9ZiUMZp0tn5gTWSvBtG9cjttABY2ds/T/Q1 pZINZZKQTjNGEP4zQqTaVY7Eh4kAUaEiLeDOvAYsF/kOiXPMobxXlQV056HQzNcuWIFs uZow== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@broadcom.com header.s=google header.b=Gom59CLt; 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 o21si23649814pgj.415.2019.01.25.02.14.22; Fri, 25 Jan 2019 02:14:37 -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=@broadcom.com header.s=google header.b=Gom59CLt; 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 S1729183AbfAYKOK (ORCPT + 99 others); Fri, 25 Jan 2019 05:14:10 -0500 Received: from mail-yb1-f193.google.com ([209.85.219.193]:33157 "EHLO mail-yb1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727955AbfAYKOK (ORCPT ); Fri, 25 Jan 2019 05:14:10 -0500 Received: by mail-yb1-f193.google.com with SMTP id m132so1890444ybf.0 for ; Fri, 25 Jan 2019 02:14:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=FyX1ArXOVKvRPOp9yrfUP0CSUTYZC9LeUmgndjP+YYQ=; b=Gom59CLttiaYZxslOybT9vf3fqbH7AFri5n3BxXtJ7RNSLMgi0cCWDVthrbS+GZRR2 6B3qCmBp+yQI7dvQ3hWw/X1/tJvOzj3z4ETB+L5eKi3cuSp8NMp/eru2OUFayEmRH2ge DSor2h+FVtKHhp7AJzc1cWNsGhVRmN03vL6Kw= 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:in-reply-to :references; bh=FyX1ArXOVKvRPOp9yrfUP0CSUTYZC9LeUmgndjP+YYQ=; b=pyMGu7doQUvbVk6SewD8dMZorPPpdCmZFI5fY8Lx8HA75cNDlzQPESn4zBodeBCNlz NehibKSnKdL61XW7H2fc1HGmMpAHJJfoGWKm2CDj89SBSFxCk9SyQ0ptMBUL/y2Nde24 RBw+7v/nZ7DMUhpnvPOoaEneWkjyVRz3zgLLfTiHN4oGss+Ju5xcM9zF2LJdA3HqTwqk R97WMxhJmO7z38a1Uo5VU5myPpdqB9MWTemWO6/tu0qN1p2vKCMoHLzSNeh7PD5krc/D nLqplksvuHemapsNY5mZwaIceGYsueZSoZWPYaVRQfrqBuMSHFlhscTyqCV69j2qguwL ZyLg== X-Gm-Message-State: AJcUukdyCC7w5TKof912dJpdeAI78fy164E1XiRAqGDcD6KQJ5cRf4+A YWwIug4AOWiSNkApaAP1NGopUg== X-Received: by 2002:a25:6a44:: with SMTP id f65mr9656151ybc.25.1548411249438; Fri, 25 Jan 2019 02:14:09 -0800 (PST) Received: from mannams-OptiPlex-7010.dhcp.broadcom.net ([192.19.234.250]) by smtp.gmail.com with ESMTPSA id x203sm11868695ywd.41.2019.01.25.02.14.05 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 25 Jan 2019 02:14:08 -0800 (PST) From: Srinath Mannam To: Bjorn Helgaas , Robin Murphy , 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 v3 1/3] PCI: Add dma-resv window list Date: Fri, 25 Jan 2019 15:43:49 +0530 Message-Id: <1548411231-27549-2-git-send-email-srinath.mannam@broadcom.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1548411231-27549-1-git-send-email-srinath.mannam@broadcom.com> References: <1548411231-27549-1-git-send-email-srinath.mannam@broadcom.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Add a dma_resv parameter in PCI host bridge structure to hold resource entries list of memory regions for which IOVAs have to reserve. PCIe host driver will add resource entries to this list based on its requirements. Few inbound address ranges can't be allowed by few PCIe host, so those address ranges will be add to this list to avoid IOMMU mapping. While initializing IOMMU domain of PCI EPs connected to that host bridge IOVAs for this given list of address ranges will be reserved. Signed-off-by: Srinath Mannam Based-on-patch-by: Oza Pawandeep Reviewed-by: Oza Pawandeep --- drivers/pci/probe.c | 3 +++ include/linux/pci.h | 1 + 2 files changed, 4 insertions(+) diff --git a/drivers/pci/probe.c b/drivers/pci/probe.c index 257b9f6..fd4b143 100644 --- a/drivers/pci/probe.c +++ b/drivers/pci/probe.c @@ -544,6 +544,7 @@ struct pci_host_bridge *pci_alloc_host_bridge(size_t priv) return NULL; INIT_LIST_HEAD(&bridge->windows); + INIT_LIST_HEAD(&bridge->dma_resv); bridge->dev.release = pci_release_host_bridge_dev; /* @@ -572,6 +573,7 @@ struct pci_host_bridge *devm_pci_alloc_host_bridge(struct device *dev, return NULL; INIT_LIST_HEAD(&bridge->windows); + INIT_LIST_HEAD(&bridge->dma_resv); bridge->dev.release = devm_pci_release_host_bridge_dev; return bridge; @@ -581,6 +583,7 @@ EXPORT_SYMBOL(devm_pci_alloc_host_bridge); void pci_free_host_bridge(struct pci_host_bridge *bridge) { pci_free_resource_list(&bridge->windows); + pci_free_resource_list(&bridge->dma_resv); kfree(bridge); } diff --git a/include/linux/pci.h b/include/linux/pci.h index 65f1d8c..aa06105 100644 --- a/include/linux/pci.h +++ b/include/linux/pci.h @@ -487,6 +487,7 @@ struct pci_host_bridge { void *sysdata; int busnr; struct list_head windows; /* resource_entry */ + struct list_head dma_resv; /* reserv dma ranges */ u8 (*swizzle_irq)(struct pci_dev *, u8 *); /* Platform IRQ swizzler */ int (*map_irq)(const struct pci_dev *, u8, u8); void (*release_fn)(struct pci_host_bridge *); -- 2.7.4