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]
Date:   Mon, 12 Nov 2018 11:23:30 -0500
From:   Sven Van Asbroeck <thesven73@...il.com>
To:     Arnd Bergmann <arnd@...db.de>
Cc:     Sven Van Asbroeck <svendev@...x.com>, robh+dt@...nel.org,
        Linus Walleij <linus.walleij@...aro.org>,
        Lee Jones <lee.jones@...aro.org>, mark.rutland@....com,
        Andreas Färber <afaerber@...e.de>,
        treding@...dia.com, David Lechner <david@...hnology.com>,
        noralf@...nnes.org, johan@...nel.org,
        Michal Simek <monstr@...str.eu>, michal.vokac@...ft.com,
        gregkh@...uxfoundation.org, john.garry@...wei.com,
        geert+renesas@...der.be, robin.murphy@....com,
        paul.gortmaker@...driver.com,
        sebastien.bourdelin@...oirfairelinux.com, icenowy@...c.io,
        Stuart Yoder <stuyoder@...il.com>, maxime.ripard@...tlin.com,
        Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
        devicetree <devicetree@...r.kernel.org>
Subject: Re: [PATCH anybus v3 4/6] bus: support HMS Anybus-S bus

On Thu, Nov 8, 2018 at 9:07 AM Arnd Bergmann <arnd@...db.de> wrote:
>
>
> > +struct anybuss_host {
> > +       struct device *dev;
> > +       struct anybuss_client *client;
> > +       struct reset_control *reset;
> > +       struct regmap *regmap;
> > +       int irq;
> > +       struct task_struct *qthread;
> > +       wait_queue_head_t wq;
> > +       struct completion card_boot;
> > +       atomic_t ind_ab;
> > +       spinlock_t qlock;
> > +       struct kmem_cache *qcache;
> > +       struct kfifo qs[3];
> > +       struct kfifo *powerq;
> > +       struct kfifo *mboxq;
> > +       struct kfifo *areaq;
> > +       bool power_on;
> > +       bool softint_pending;
> > +       atomic_t dc_event;
> > +       wait_queue_head_t dc_wq;
> > +       atomic_t fieldbus_online;
> > +       struct kernfs_node *fieldbus_online_sd;
> > +};
>
> Similarly, should that anybuss_host sturcture maybe be based on
> a 'struct device' itself? What is the hierarchy of devices in sysfs?
>

The anybus host 'is-a' platform device. The dev member in struct anybuss_host is
actually &pdev->dev.

The host's platform device shows up in sysfs under
/sys/bus/platform/devices/anybuss-host.0.auto
where .0 is the first anybus slot on the bridge, .1 the second slot.
If there is more than one bridge, we'll see .2, .3 etc.

Here are the virtual files in that dir:

drwxr-xr-x    3 root     root             0 Nov 12 11:02
anybuss-host.0.auto.card0
lrwxrwxrwx    1 root     root             0 Nov 12 11:11 driver ->
../../../../../../../bus/platform/drivers/anybuss-host
-rw-r--r--    1 root     root          4096 Nov 12 11:11 driver_override
drwxr-xr-x    3 root     root             0 Nov 12 11:02 misc
-r--r--r--    1 root     root          4096 Nov 12 11:11 modalias
drwxr-xr-x    2 root     root             0 Nov 12 11:11 power
-r--r--r--    1 root     root          4096 Nov 12 11:11 state
lrwxrwxrwx    1 root     root             0 Nov 12 11:11 subsystem ->
../../../../../../../bus/platform
-rw-r--r--    1 root     root          4096 Nov 12 11:02 uevent

Where
anybuss-host.0.auto.card0 just points to the detected anybus card, if any.
Nothing to see there, it's just an artefact of the bus/device abstraction.
misc points to the detected anybus card driver (which is implemented as a
misc class device).

This sysfs hierarchy makes sense to me. Is there something I should be
doing (or not doing) ?

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ