{"id":818185,"url":"http://patchwork.ozlabs.org/api/patches/818185/?format=json","web_url":"http://patchwork.ozlabs.org/project/netdev/patch/20170925110738.68382-15-mika.westerberg@linux.intel.com/","project":{"id":7,"url":"http://patchwork.ozlabs.org/api/projects/7/?format=json","name":"Linux network development","link_name":"netdev","list_id":"netdev.vger.kernel.org","list_email":"netdev@vger.kernel.org","web_url":null,"scm_url":null,"webscm_url":null,"list_archive_url":"","list_archive_url_format":"","commit_url_format":""},"msgid":"<20170925110738.68382-15-mika.westerberg@linux.intel.com>","list_archive_url":null,"date":"2017-09-25T11:07:36","name":"[v2,14/16] thunderbolt: Add function to retrieve DMA device for the ring","commit_ref":null,"pull_url":null,"state":"changes-requested","archived":true,"hash":"76511b69a2b48765f58131833bd61161df551383","submitter":{"id":14534,"url":"http://patchwork.ozlabs.org/api/people/14534/?format=json","name":"Mika Westerberg","email":"mika.westerberg@linux.intel.com"},"delegate":{"id":34,"url":"http://patchwork.ozlabs.org/api/users/34/?format=json","username":"davem","first_name":"David","last_name":"Miller","email":"davem@davemloft.net"},"mbox":"http://patchwork.ozlabs.org/project/netdev/patch/20170925110738.68382-15-mika.westerberg@linux.intel.com/mbox/","series":[{"id":4937,"url":"http://patchwork.ozlabs.org/api/series/4937/?format=json","web_url":"http://patchwork.ozlabs.org/project/netdev/list/?series=4937","date":"2017-09-25T11:07:27","name":"Thunderbolt networking","version":2,"mbox":"http://patchwork.ozlabs.org/series/4937/mbox/"}],"comments":"http://patchwork.ozlabs.org/api/patches/818185/comments/","check":"pending","checks":"http://patchwork.ozlabs.org/api/patches/818185/checks/","tags":{},"related":[],"headers":{"Return-Path":"<netdev-owner@vger.kernel.org>","X-Original-To":"patchwork-incoming@ozlabs.org","Delivered-To":"patchwork-incoming@ozlabs.org","Authentication-Results":"ozlabs.org;\n\tspf=none (mailfrom) smtp.mailfrom=vger.kernel.org\n\t(client-ip=209.132.180.67; helo=vger.kernel.org;\n\tenvelope-from=netdev-owner@vger.kernel.org;\n\treceiver=<UNKNOWN>)","Received":["from vger.kernel.org (vger.kernel.org [209.132.180.67])\n\tby ozlabs.org (Postfix) with ESMTP id 3y11YG2dbVz9t4Z\n\tfor <patchwork-incoming@ozlabs.org>;\n\tMon, 25 Sep 2017 21:08:50 +1000 (AEST)","(majordomo@vger.kernel.org) by vger.kernel.org via listexpand\n\tid S935028AbdIYLI1 (ORCPT <rfc822;patchwork-incoming@ozlabs.org>);\n\tMon, 25 Sep 2017 07:08:27 -0400","from mga09.intel.com ([134.134.136.24]:50614 \"EHLO mga09.intel.com\"\n\trhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP\n\tid S935018AbdIYLIZ (ORCPT <rfc822;netdev@vger.kernel.org>);\n\tMon, 25 Sep 2017 07:08:25 -0400","from fmsmga001.fm.intel.com ([10.253.24.23])\n\tby orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;\n\t25 Sep 2017 04:08:17 -0700","from black.fi.intel.com ([10.237.72.28])\n\tby fmsmga001.fm.intel.com with ESMTP; 25 Sep 2017 04:08:14 -0700","by black.fi.intel.com (Postfix, from userid 1001)\n\tid 12CA6549; Mon, 25 Sep 2017 14:07:39 +0300 (EEST)"],"X-ExtLoop1":"1","X-IronPort-AV":"E=Sophos;i=\"5.42,435,1500966000\"; d=\"scan'208\";a=\"1198690628\"","From":"Mika Westerberg <mika.westerberg@linux.intel.com>","To":"Greg Kroah-Hartman <gregkh@linuxfoundation.org>,\n\t\"David S . Miller\" <davem@davemloft.net>","Cc":"Andreas Noever <andreas.noever@gmail.com>,\n\tMichael Jamet <michael.jamet@intel.com>,\n\tYehezkel Bernat <yehezkel.bernat@intel.com>,\n\tAmir Levy <amir.jer.levy@intel.com>,\n\tMario.Limonciello@dell.com, Lukas Wunner <lukas@wunner.de>,\n\tAndy Shevchenko <andriy.shevchenko@linux.intel.com>,\n\tAndrew Lunn <andrew@lunn.ch>,\n\tMika Westerberg <mika.westerberg@linux.intel.com>,\n\tlinux-kernel@vger.kernel.org, netdev@vger.kernel.org","Subject":"[PATCH v2 14/16] thunderbolt: Add function to retrieve DMA device\n\tfor the ring","Date":"Mon, 25 Sep 2017 14:07:36 +0300","Message-Id":"<20170925110738.68382-15-mika.westerberg@linux.intel.com>","X-Mailer":"git-send-email 2.14.1","In-Reply-To":"<20170925110738.68382-1-mika.westerberg@linux.intel.com>","References":"<20170925110738.68382-1-mika.westerberg@linux.intel.com>","Sender":"netdev-owner@vger.kernel.org","Precedence":"bulk","List-ID":"<netdev.vger.kernel.org>","X-Mailing-List":"netdev@vger.kernel.org"},"content":"This is needed when Thunderbolt service drivers need to DMA map memory\nbefore it is passed down to the ring.\n\nSigned-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>\nReviewed-by: Michael Jamet <michael.jamet@intel.com>\nReviewed-by: Yehezkel Bernat <yehezkel.bernat@intel.com>\n---\n include/linux/thunderbolt.h | 13 +++++++++++++\n 1 file changed, 13 insertions(+)","diff":"diff --git a/include/linux/thunderbolt.h b/include/linux/thunderbolt.h\nindex 36925e3aec7c..7b69853188b1 100644\n--- a/include/linux/thunderbolt.h\n+++ b/include/linux/thunderbolt.h\n@@ -19,6 +19,7 @@\n #include <linux/list.h>\n #include <linux/mutex.h>\n #include <linux/mod_devicetable.h>\n+#include <linux/pci.h>\n #include <linux/uuid.h>\n #include <linux/workqueue.h>\n \n@@ -582,4 +583,16 @@ static inline int tb_ring_tx(struct tb_ring *ring, struct ring_frame *frame)\n struct ring_frame *tb_ring_poll(struct tb_ring *ring);\n void tb_ring_poll_complete(struct tb_ring *ring);\n \n+/**\n+ * tb_ring_dma_device() - Return device used for DMA mapping\n+ * @ring: Ring whose DMA device is retrieved\n+ *\n+ * Use this function when you are mapping DMA for buffers that are\n+ * passed to the ring for sending/receiving.\n+ */\n+static inline struct device *tb_ring_dma_device(struct tb_ring *ring)\n+{\n+\treturn &ring->nhi->pdev->dev;\n+}\n+\n #endif /* THUNDERBOLT_H_ */\n","prefixes":["v2","14/16"]}