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]
Message-Id: <1434548543-22949-8-git-send-email-tomeu.vizoso@collabora.com>
Date:	Wed, 17 Jun 2015 15:42:17 +0200
From:	Tomeu Vizoso <tomeu.vizoso@...labora.com>
To:	linux-arm-kernel@...ts.infradead.org
Cc:	Tomeu Vizoso <tomeu.vizoso@...labora.com>,
	Alexander Holler <holler@...oftware.de>,
	Alexandre Courbot <gnurou@...il.com>,
	Andrzej Hajda <a.hajda@...sung.com>,
	Arnd Bergmann <arnd@...db.de>,
	Dmitry Torokhov <dmitry.torokhov@...il.com>,
	Grant Likely <grant.likely@...aro.org>,
	Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
	Ian Campbell <ijc+devicetree@...lion.org.uk>,
	Javier Martinez Canillas <javier.martinez@...labora.co.uk>,
	Krzysztof Kozlowski <k.kozlowski@...sung.com>,
	Kumar Gala <galak@...eaurora.org>, Len Brown <lenb@...nel.org>,
	Linus Walleij <linus.walleij@...aro.org>,
	linux-kernel@...r.kernel.org, Lv Zheng <lv.zheng@...el.com>,
	Mark Brown <broonie@...nel.org>,
	Mark Rutland <mark.rutland@....com>,
	Pawel Moll <pawel.moll@....com>,
	"Rafael J. Wysocki" <rjw@...ysocki.net>,
	Robert Moore <robert.moore@...el.com>,
	Rob Herring <robh+dt@...nel.org>,
	Russell King <linux@....linux.org.uk>,
	Stephen Warren <swarren@...dotorg.org>,
	Terje Bergström <tbergstrom@...dia.com>,
	Thierry Reding <thierry.reding@...il.com>
Subject: [PATCH 07/13] driver-core: Add class.get_dependencies() callback

Classes can implement this callback to provide a list of dependencies
for a firmware node. These dependencies can be used to probe devices in
order and to give proper warnings when dependencies cannot be fulfilled.

This functionality is implemented in a class callback because subsystems
implement the bindings that define how dependencies are expressed in the
firmware.

Adds struct fwnode_dependency, to be used to represent lists of
dependencies of fwnodes.

Signed-off-by: Tomeu Vizoso <tomeu.vizoso@...labora.com>
---
 include/linux/device.h | 6 ++++++
 include/linux/fwnode.h | 5 +++++
 2 files changed, 11 insertions(+)

diff --git a/include/linux/device.h b/include/linux/device.h
index 5a31bf3..c52f290 100644
--- a/include/linux/device.h
+++ b/include/linux/device.h
@@ -367,6 +367,10 @@ int subsys_virtual_register(struct bus_type *subsys,
  * @dev_release: Called to release the device.
  * @suspend:	Used to put the device to sleep mode, usually to a low power
  *		state.
+ * @get_dependencies: Returns a list of struct fwnode_dependency containing
+ *		the dependencies of the passed firmware node. The class is
+ *		expected to inspect the firmware node and extract dependencies
+ *		from its properties, based on bindings documentation.
  * @resume:	Used to bring the device from the sleep mode.
  * @ns_type:	Callbacks so sysfs can detemine namespaces.
  * @namespace:	Namespace of the device belongs to this class.
@@ -397,6 +401,8 @@ struct class {
 	int (*suspend)(struct device *dev, pm_message_t state);
 	int (*resume)(struct device *dev);
 
+	struct list_head *(*get_dependencies)(struct fwnode_handle *fwnode);
+
 	const struct kobj_ns_type_operations *ns_type;
 	const void *(*namespace)(struct device *dev);
 
diff --git a/include/linux/fwnode.h b/include/linux/fwnode.h
index 0408545..68ab558 100644
--- a/include/linux/fwnode.h
+++ b/include/linux/fwnode.h
@@ -24,4 +24,9 @@ struct fwnode_handle {
 	struct fwnode_handle *secondary;
 };
 
+struct fwnode_dependency {
+	struct fwnode_handle *fwnode;
+	struct list_head dependency;
+};
+
 #endif
-- 
2.4.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ