{"id":814972,"url":"http://patchwork.ozlabs.org/api/patches/814972/?format=json","web_url":"http://patchwork.ozlabs.org/project/netdev/patch/20170918153049.44185-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":"<20170918153049.44185-15-mika.westerberg@linux.intel.com>","list_archive_url":null,"date":"2017-09-18T15:30:47","name":"[14/16] thunderbolt: Add function to retrieve DMA device for the ring","commit_ref":null,"pull_url":null,"state":"not-applicable","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/20170918153049.44185-15-mika.westerberg@linux.intel.com/mbox/","series":[{"id":3664,"url":"http://patchwork.ozlabs.org/api/series/3664/?format=json","web_url":"http://patchwork.ozlabs.org/project/netdev/list/?series=3664","date":"2017-09-18T15:30:47","name":"Thunderbolt networking","version":1,"mbox":"http://patchwork.ozlabs.org/series/3664/mbox/"}],"comments":"http://patchwork.ozlabs.org/api/patches/814972/comments/","check":"pending","checks":"http://patchwork.ozlabs.org/api/patches/814972/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 3xwqjS6Y7Pz9s78\n\tfor <patchwork-incoming@ozlabs.org>;\n\tTue, 19 Sep 2017 01:31:24 +1000 (AEST)","(majordomo@vger.kernel.org) by vger.kernel.org via listexpand\n\tid S1755768AbdIRPbE (ORCPT <rfc822;patchwork-incoming@ozlabs.org>);\n\tMon, 18 Sep 2017 11:31:04 -0400","from mga01.intel.com ([192.55.52.88]:32764 \"EHLO mga01.intel.com\"\n\trhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP\n\tid S1755509AbdIRPbC (ORCPT <rfc822;netdev@vger.kernel.org>);\n\tMon, 18 Sep 2017 11:31:02 -0400","from fmsmga002.fm.intel.com ([10.253.24.26])\n\tby fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;\n\t18 Sep 2017 08:31:02 -0700","from black.fi.intel.com ([10.237.72.28])\n\tby fmsmga002.fm.intel.com with ESMTP; 18 Sep 2017 08:30:58 -0700","by black.fi.intel.com (Postfix, from userid 1001)\n\tid 0B0A972A; Mon, 18 Sep 2017 18:30:50 +0300 (EEST)"],"X-ExtLoop1":"1","X-IronPort-AV":"E=Sophos;i=\"5.42,413,1500966000\"; d=\"scan'208\";a=\"1220359589\"","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\tMika Westerberg <mika.westerberg@linux.intel.com>,\n\tlinux-kernel@vger.kernel.org, netdev@vger.kernel.org","Subject":"[PATCH 14/16] thunderbolt: Add function to retrieve DMA device for\n\tthe ring","Date":"Mon, 18 Sep 2017 18:30:47 +0300","Message-Id":"<20170918153049.44185-15-mika.westerberg@linux.intel.com>","X-Mailer":"git-send-email 2.14.1","In-Reply-To":"<20170918153049.44185-1-mika.westerberg@linux.intel.com>","References":"<20170918153049.44185-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 9a63210d5084..d479a9e508cd 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":["14/16"]}