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-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <14233302.P9onBQovHz@wuerfel>
Date:	Tue, 08 Dec 2015 17:59:44 +0100
From:	Arnd Bergmann <arnd@...db.de>
To:	Masahiro Yamada <yamada.masahiro@...ionext.com>
Cc:	arm@...nel.org, Mark Rutland <mark.rutland@....com>,
	devicetree@...r.kernel.org, Kumar Gala <galak@...eaurora.org>,
	linux-kernel@...r.kernel.org,
	Ian Campbell <ijc+devicetree@...lion.org.uk>,
	Rob Herring <robh+dt@...nel.org>,
	Pawel Moll <pawel.moll@....com>,
	linux-arm-kernel@...ts.infradead.org
Subject: Re: [PATCH v3] bus: uniphier-system-bus: add UniPhier System Bus driver

On Wednesday 09 December 2015 01:21:58 Masahiro Yamada wrote:
> The UniPhier System Bus is an external that connects on-board devices
> to the UniPhier SoC.  Each bank (chip select) is dynamically mapped
> to the CPU-viewed address base via the bus controller.  The bus
> controller must be configured before any access to the bus.
> 
> This driver parses the "ranges" property of the System Bus node and
> initialized the bus controller.  After the bus becomes ready, devices
> below it are populated.
> 
> Note:
> Each bank can be mapped anywhere in the supported address space;
> there is nothing preventing us from assigning bank 0 on 0x42000000,
> 0x43000000, or anywhere as long as such region is not used by others.
> So, the "ranges" is just one possible software configuration, which
> does not seem to fit in device tree because device tree is a hardware
> description language.  However, of_translate_address() requires
> "ranges" in every bus node between CPUs and device mapped on the CPU
> address space.  In other words, "ranges" properties must be statically
> defined in device tree.  After some discussion, I decided the dynamic
> address reassignment by the driver is too bothersome.  Instead, the
> device tree should provide a reasonable translation setup that the OS
> can rely on.
> 
> Signed-off-by: Masahiro Yamada <yamada.masahiro@...ionext.com>
> Acked-by: Rob Herring <robh@...nel.org>

Looks very nice.

Acked-by: Arnd Bergmann <arnd@...db.de>

Just a little thought about one thing I found odd:

> +static int uniphier_system_bus_check_overlap(
> +					struct uniphier_system_bus_priv tmp)
> +{

Did you intentionally pass this by value? Maybe do it explicitly using a pointer
and memcpy to a local variable, which has a similar effect. Alternatively
just check each newly probed child node for conflicts with any of the
previous children. That is slightly more expensive at O(n^2) instead of O(n)
but n is always small here and you can avoid sorting first.

	Arnd
--
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