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: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date:	Wed, 29 Jun 2016 13:19:37 -0400
From:	Vitaly Andrianov <vitalya@...com>
To:	Mark Brown <broonie@...nel.org>, Lee Jones <lee.jones@...aro.org>,
	Arnd Bergmann <arnd@...db.de>, <linux-kernel@...r.kernel.org>
Subject: using the same regmap by multiple device drivers

Hello,

I'm working on two drivers "crypto" and "hwrng", which use the same 
hardware module and the same block of registers. Actually the drivers 
don't need to access the same registers except several common ones.

Here is fragment of dts.

sa_subsys: subsys@...4000 {
	compatible	= "syscon";
	reg		= <0x1234000 0x1000>;
};

crypto@...4000 {
	compatible = "ti,netcp-sa-crypto";
	syscon-subsys = <&sa_subsys>;
	clocks = <&clksa>;
	.....
};

rng@...4000 {
	compatible = "ti,keystone-rng";
	syscon-subsys = <&sa_subsys>;
	clocks = <&clksa>;
};

The both drivers use

regmap = syscon_regmap_lookup_by_phandle(pdev->dev.of_node,
				  	"syscon-subsys");

to get pointers to "struct regmap".

Unfortunately I can get the first driver working only. When the second 
driver tries to call regmap_read() kernel gives "Division by zero in 
kernel" error.

Here is my question. Is that actually possible to use in regmap 
framework the same registers in multiple different drivers?

Thank you,
-Vitaly

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ