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: <20121126143002.121FF3E1A11@localhost>
Date:	Mon, 26 Nov 2012 14:30:02 +0000
From:	Grant Likely <grant.likely@...retlab.ca>
To:	Jason Gunthorpe <jgunthorpe@...idianresearch.com>
Cc:	Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
	Rob Herring <rob.herring@...xeda.com>,
	Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
	devicetree-discuss <devicetree-discuss@...ts.ozlabs.org>
Subject: Re: [PATCH] of: Have of_device_add call platform_device_add rather than device_add

On Thu, 22 Nov 2012 10:30:20 -0700, Jason Gunthorpe <jgunthorpe@...idianresearch.com> wrote:
> On Thu, Nov 22, 2012 at 03:36:21PM +0000, Grant Likely wrote:
> 
> > Hmm... I've not tried it with assigned-address. I tried with two sibling
> > platform devices using just the 'reg' property. That the kernel will
> > complain about. For powerpc-only, the patch I posted allows the device
> > to get registered anyway even though the range incorrectly overlaps.
> 
> My second example was done with the reg property..
> 
>                 gpio0: gpio@...00 {
>                         compatible = "marvell,orion-gpio";
>                         #gpio-cells = <2>;
>                         gpio-controller;
>                         reg = <0x10100 0x40>;
>                 }
>                 chip_cfg@0 {
>                         compatible = "orc,chip_config";
>                         // Doubles up on gpio0
>                         reg = <0x10100 0x4>;
>                 };
> 
> 
> f1010100-f101013f : /internal@...00000/gpio@...00
>   f1010100-f1010103 : /internal@...00000/chip_cfg@0
> 
> What did you try? Maybe order matters?

It might. I tried on qemu with versatile. I've written a new test block
with different overlaps. Here's the block and the results:

     dummy@...01000 {
             compatible = "acme,test";
             reg = <0x10201000 0x1000>;
     };

     overlap@...00800 {
             compatible = "acme,test";
             reg = <0x10200800 0x1000>;
     };

     overlap@...01800 {
             compatible = "acme,test";
             reg = <0x10201800 0x1000>;
     };

     overlap@...01400 {
             compatible = "acme,test";
             reg = <0x10201400 0x800>;
     };

     overlap@...00c00 {
             compatible = "acme,test";
             reg = <0x10200c00 0x1800>;
     };

>From the kernel log:
10200800.overlap: failed to claim resource 0
10201800.overlap: failed to claim resource 0

# ls /sys/bus/platform/devices/
10002000.i2c      10010000.net      10201000.dummy    alarmtimer
10003000.intc     10140000.intc     10201400.overlap  amba.0
10008000.lcd      10200c00.overlap  34000000.flash    fpga.1

So, overlaps that are completely inside or completely outside the
already registered range don't appear to be detected. That may be a bug
(unless it is designed to work that way)

g.

-- 
Grant Likely, B.Sc, P.Eng.
Secret Lab Technologies, Ltd.
--
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