From patchwork Thu Jul 26 23:16:19 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Osipenko X-Patchwork-Id: 10546647 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 7E09C180E for ; Fri, 27 Jul 2018 07:01:27 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6F5552B4C9 for ; Fri, 27 Jul 2018 07:01:27 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 625E82B4CC; Fri, 27 Jul 2018 07:01:27 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 18C802B4C9 for ; Fri, 27 Jul 2018 07:01:27 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 6D27C6E8EE; Fri, 27 Jul 2018 07:01:21 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-lf1-x144.google.com (mail-lf1-x144.google.com [IPv6:2a00:1450:4864:20::144]) by gabe.freedesktop.org (Postfix) with ESMTPS id 98C466E34A; Thu, 26 Jul 2018 23:22:32 +0000 (UTC) Received: by mail-lf1-x144.google.com with SMTP id l16-v6so2319926lfc.13; Thu, 26 Jul 2018 16:22:32 -0700 (PDT) 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=ZzKlBfHITiaIhtCR4V6lsjIteXVyc3M0dFCxH8acLzM=; b=l6f9JYDNXVsqEBS5AUnsQHSzwsIj+OHFK06KGklVDzN3tvvhzXpcPjm2CSGOUDyuia jMHaZgIlG8CBKmmIB5Nd0cTtNc1fB9N9FAaryIHmG8vjeVq/DZxzamYGDTPlN2S835Fl y7yEjN/Ic0dQR4AIyK/ITcaQSbUeUn38ybhaMxJVJvvM6Ycxd8c2J5qoi46c9br9iAnR FeVTbC517Z9HjJlt1aB+9w0jXMy77Wm7RTMI2EhGejGqM6Eg4Vxkr0F5h7DMCREphHPv TzmpkBbycqUK0aILuXTmAk9ftD6WQ89iK6Cf//j2trb9el6jxQfukXWWl01Ff8kuFAeA FOUA== X-Gm-Message-State: AOUpUlHwaZoK8qojPNmPwoGrQqERZNAld2XCOzGu8WH0qxRu9PKDv8DR GiWtc6f6MWoihnIOtkWv3o8= X-Google-Smtp-Source: AAOMgpeZ8ThHp5dveQGg7S7v+EtCA82C+70lNknFeTUoQIbF+mooW1gljvR35DN7sxYDiv2telrhfA== X-Received: by 2002:a19:9646:: with SMTP id y67-v6mr2420505lfd.130.1532647351075; Thu, 26 Jul 2018 16:22:31 -0700 (PDT) Received: from localhost.localdomain (109-252-90-13.nat.spd-mgts.ru. [109.252.90.13]) by smtp.gmail.com with ESMTPSA id q15-v6sm411541ljg.62.2018.07.26.16.22.29 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 26 Jul 2018 16:22:30 -0700 (PDT) From: Dmitry Osipenko To: Greg Kroah-Hartman , "Rafael J. Wysocki" , Thierry Reding , Jonathan Hunter , Mikko Perttunen , Rob Herring , Frank Rowand , Ben Skeggs , Russell King , Catalin Marinas , Will Deacon , Joerg Roedel , Nicolas Chauvet Subject: [RFC PATCH v1 1/6] driver core: Add option for disabling of backing devices DMA with IOMMU Date: Fri, 27 Jul 2018 02:16:19 +0300 Message-Id: <20180726231624.21084-2-digetx@gmail.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180726231624.21084-1-digetx@gmail.com> References: <20180726231624.21084-1-digetx@gmail.com> X-Mailman-Approved-At: Fri, 27 Jul 2018 07:01:20 +0000 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: devicetree@vger.kernel.org, nouveau@lists.freedesktop.org, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, iommu@lists.linux-foundation.org, linux-tegra@vger.kernel.org MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP This allows device drivers to convey the drivers core that implicit IOMMU backing for devices DMA shouldn't happen. It is needed for drivers that manage IOMMU by themselves, like for example it is needed by the NVIDIA Tegra GPU driver. Signed-off-by: Dmitry Osipenko --- include/linux/device.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/include/linux/device.h b/include/linux/device.h index ad43a97b50c8..f9e3c1d42abd 100644 --- a/include/linux/device.h +++ b/include/linux/device.h @@ -244,6 +244,7 @@ enum probe_type { * @bus: The bus which the device of this driver belongs to. * @owner: The module owner. * @mod_name: Used for built-in modules. + * @no_implicit_iommu: Disables backing DMA allocations with IOMMU mapping. * @suppress_bind_attrs: Disables bind/unbind via sysfs. * @probe_type: Type of the probe (synchronous or asynchronous) to use. * @of_match_table: The open firmware table. @@ -281,6 +282,7 @@ struct device_driver { struct module *owner; const char *mod_name; /* used for built-in modules */ + bool no_implicit_iommu; /* disables implicit IOMMU for DMA */ bool suppress_bind_attrs; /* disables bind/unbind via sysfs */ enum probe_type probe_type;