Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1259368

Re: [RFD] Functional dependencies between devices

From Linus Walleij <linus.walleij@linaro.org>
Newsgroups linux.kernel
Subject Re: [RFD] Functional dependencies between devices
Date 2015-10-30 11:00 +0100
Message-ID <qpeDw-4cd-9@gated-at.bofh.it> (permalink)
References <qodTc-6r2-21@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Tue, Oct 27, 2015 at 4:24 PM, Rafael J. Wysocki <rjw@rjwysocki.net> wrote:

> My idea is to represent a supplier-consumer dependency between devices (or
> more precisely between device+driver combos) as a "link" object containing
> pointers to the devices in question, a list node for each of them and some
> additional information related to the management of those objects, ie.
> something like:
>
> struct device_link {
>         struct device *supplier;
>         struct list_head supplier_node;
>         struct device *consumer;
>         struct list_head consumer_node;
>         <flags, status etc>
> };
>
> In general, there will be two lists of those things per device, one list
> of links to consumers and one list of links to suppliers.

I like this idea. I earlier have written that the device core needs to know
the dependencies of devices as a graph. This mechanism does that.

IIUC the mechanism does not inheritly protect against creating
cyclic graphs (you can get stuck in a loop) but that is just the
nature of the things and even deferred probe has the ability
to shoot oneself in the foot. Besides we're not doing computer
science here, we're solving practical problems.

What I further like about the approach is that it can even be used
by archs still doing boardfiles and not using any HW description
mechanism: it is there for anyone. Those platforms can define
dependencies with good old code.

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

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[RFD] Functional dependencies between devices "Rafael J. Wysocki" <rjw@rjwysocki.net> - 2015-10-27 16:00 +0100
  Re: [RFD] Functional dependencies between devices Tomeu Vizoso <tomeu.vizoso@collabora.com> - 2015-10-27 16:30 +0100
    Re: [RFD] Functional dependencies between devices "Rafael J. Wysocki" <rjw@rjwysocki.net> - 2015-10-28 02:50 +0100
      Re: [RFD] Functional dependencies between devices Tomeu Vizoso <tomeu.vizoso@collabora.com> - 2015-10-28 15:30 +0100
        Re: [RFD] Functional dependencies between devices "Rafael J. Wysocki" <rjw@rjwysocki.net> - 2015-10-28 16:30 +0100
          Re: [RFD] Functional dependencies between devices Mark Brown <broonie@kernel.org> - 2015-10-29 01:20 +0100
          Re: [RFD] Functional dependencies between devices Tomeu Vizoso <tomeu.vizoso@collabora.com> - 2015-10-29 15:20 +0100
            Re: [RFD] Functional dependencies between devices Alan Stern <stern@rowland.harvard.edu> - 2015-10-29 15:40 +0100
              Re: [RFD] Functional dependencies between devices "Rafael J. Wysocki" <rjw@rjwysocki.net> - 2015-10-31 03:00 +0100
  Re: [RFD] Functional dependencies between devices Mark Brown <broonie@kernel.org> - 2015-10-29 01:20 +0100
    Re: [RFD] Functional dependencies between devices "Rafael J. Wysocki" <rjw@rjwysocki.net> - 2015-10-31 02:50 +0100
      Re: [RFD] Functional dependencies between devices Mark Brown <broonie@kernel.org> - 2015-10-31 03:50 +0100
  Re: [RFD] Functional dependencies between devices Linus Walleij <linus.walleij@linaro.org> - 2015-10-30 11:00 +0100
  Re: [RFD] Functional dependencies between devices Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2015-10-31 00:00 +0100

csiph-web