lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Fri, 14 Oct 2022 10:10:45 +0530
From:   Nipun Gupta <nipun.gupta@....com>
To:     <robh+dt@...nel.org>, <krzysztof.kozlowski+dt@...aro.org>,
        <gregkh@...uxfoundation.org>, <rafael@...nel.org>,
        <eric.auger@...hat.com>, <alex.williamson@...hat.com>,
        <cohuck@...hat.com>, <puneet.gupta@....com>,
        <song.bao.hua@...ilicon.com>, <mchehab+huawei@...nel.org>,
        <maz@...nel.org>, <f.fainelli@...il.com>,
        <jeffrey.l.hugo@...il.com>, <saravanak@...gle.com>,
        <Michael.Srba@...nam.cz>, <mani@...nel.org>, <yishaih@...dia.com>,
        <jgg@...pe.ca>, <jgg@...dia.com>, <robin.murphy@....com>,
        <will@...nel.org>, <joro@...tes.org>, <masahiroy@...nel.org>,
        <ndesaulniers@...gle.com>, <linux-arm-kernel@...ts.infradead.org>,
        <linux-kbuild@...r.kernel.org>, <linux-kernel@...r.kernel.org>,
        <devicetree@...r.kernel.org>, <kvm@...r.kernel.org>
CC:     <okaya@...nel.org>, <harpreet.anand@....com>,
        <nikhil.agarwal@....com>, <michal.simek@....com>,
        <aleksandar.radovanovic@....com>, <git@....com>,
        Nipun Gupta <nipun.gupta@....com>
Subject: [RFC PATCH v4 4/8] bux/cdx: support dma configuration for CDX devices

With CDX bus supported in SMMU, devices on CDX bus can be
configured to support DMA configuration. This change adds
the dma configure callback for CDX bus.

Signed-off-by: Nipun Gupta <nipun.gupta@....com>
---
 drivers/bus/cdx/cdx.c | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

diff --git a/drivers/bus/cdx/cdx.c b/drivers/bus/cdx/cdx.c
index 5a366f4ae69c..b2a7e0b34df8 100644
--- a/drivers/bus/cdx/cdx.c
+++ b/drivers/bus/cdx/cdx.c
@@ -57,6 +57,7 @@
 
 #include <linux/init.h>
 #include <linux/kernel.h>
+#include <linux/of_device.h>
 #include <linux/slab.h>
 #include <linux/cdx/cdx_bus.h>
 
@@ -180,10 +181,26 @@ static void cdx_remove(struct device *dev)
 		cdx_drv->remove(cdx_dev);
 }
 
+static int cdx_dma_configure(struct device *dev)
+{
+	struct cdx_device *cdx_dev = to_cdx_device(dev);
+	u32 input_id = cdx_dev->req_id;
+	int ret;
+
+	ret = of_dma_configure_id(dev, dev->parent->of_node, 0, &input_id);
+	if (ret) {
+		dev_err(dev, "of_dma_configure_id() failed\n");
+		return ret;
+	}
+
+	return 0;
+}
+
 struct bus_type cdx_bus_type = {
 	.name		= "cdx",
 	.match		= cdx_bus_match,
 	.remove		= cdx_remove,
+	.dma_configure  = cdx_dma_configure,
 };
 EXPORT_SYMBOL_GPL(cdx_bus_type);
 
-- 
2.25.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ