From: Florian Fainelli <f.fainelli@gmail.com>
To: Andrew Lunn <andrew@lunn.ch>
Cc: narmstrong@baylibre.com, vivien.didelot@savoirfairelinux.com,
netdev <netdev@vger.kernel.org>
Subject: Re: [PATCH RFC 25/28] Documentation: DSA: Describe how probe of DSA and switches work.
Date: Thu, 24 Dec 2015 17:29:58 -0800 [thread overview]
Message-ID: <567C9C16.5020005@gmail.com> (raw)
In-Reply-To: <20151223225322.GE25485@lunn.ch>
Le 23/12/2015 14:53, Andrew Lunn a écrit :
> On Wed, Dec 23, 2015 at 12:48:28PM -0800, Florian Fainelli wrote:
>> Le 23/12/2015 04:56, Andrew Lunn a écrit :
>>> With the introduction of switches as linux devices and the use of the
>>> component framework, probing has become more complex. Add some
>>> documentation.
>>>
>>> Signed-off-by: Andrew Lunn <andrew@lunn.ch>
>>> ---
>>> Documentation/networking/dsa/dsa.txt | 48 ++++++++++++++++++++++++++++++++++++
>>> 1 file changed, 48 insertions(+)
>>>
>>> diff --git a/Documentation/networking/dsa/dsa.txt b/Documentation/networking/dsa/dsa.txt
>>> index aa9c1f9313cd..376afa135a81 100644
>>> --- a/Documentation/networking/dsa/dsa.txt
>>> +++ b/Documentation/networking/dsa/dsa.txt
>>> @@ -398,6 +398,54 @@ Switch configuration
>>> on the management interface and "hardcode"/"force" this MAC address for the
>>> CPU/management interface as an optimization
>>>
>>> +Call flow
>>> +---------
>>> +
>>> +With the ability for switch devices to be true linux devices, the call
>>> +flow is somewhat complex. The component framework is used to link the
>>> +dsa framework as the master, with switch devices, as slaves.
>>> +
>>> +A switch device should add itself as a component in its probe
>>> +function.
>>> +
>>> +The DSA framework can either be configured using a platform_data
>>> +structure or from the device tree. If device tree is being used, the
>>> +dsa framework probe function will allocate a platform_data structure,
>>> +and populate it using the device tree, via the dsa_of_probe()
>>> +function. Within the DSA device tree, switch devices are represented
>>> +by a phandle to the switch device. These phandles are saved into the
>>> +platform data so that when switch slaves register themselves, they can
>>> +be correctly positioned in the DSA cluster.
>>
>> Humm, I guess I am still not clear on that, in a DT-only system, do I
>> still need to get the DSA platform device to be probed via DT, along
>> with references to the switches I want? If that is the case, that seems
>> a little awkward, could not we probe the individual switches, and see if
>> they need DSA instead? Or is that how the component framework works,
>> just being a bit confused here.
>
> The component framework needs one master device and a number of slave
> devices. The master device effectively gives the framework a list of
> slave devices it needs. When the slave devices probe they register
> with the component framework. The master then asks the framework if
> its slaves are present, and if not returns -EPRODE_DEFERS and tries
> again later.
>
> So the dsa platform device is the master, and the switch devices are
> the slaves.
Ok, but then that means I still need to have a "marvell,dsa" node in
Device Tree, that does not make sense to me with your changes, because
the individual compatible and nodes for the switches are enough
information to get their driver to probe, and as a consequence, register
with DSA their switch devices, but let's keep following this point in
the cover letter thread.
>
> It sounds like you want to 'optimise' for a DSA cluster consisting of
> a single switch, throwing away the D in DSA. Now the SF2 is a bit
> 'odd'. Since it is embedded in the SoC, you cannot have multiple of
> them in a cluster. So such an optimization could make sense for the
> SF2. But can we do this without adding too more complexity?
The distributed case is the complex one, the one with a single switch
hanging off an Ethernet MAC is the most common one and is much simpler
to deal with.
--
Florian
next prev parent reply other threads:[~2015-12-25 1:30 UTC|newest]
Thread overview: 60+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-12-23 12:56 [PATCH RFC 00/28] DSA: Restructure probing Andrew Lunn
2015-12-23 12:56 ` [PATCH RFC 01/28] component: remove old add_components method Andrew Lunn
2015-12-23 13:21 ` Russell King - ARM Linux
2015-12-23 15:57 ` Andrew Lunn
2015-12-23 12:56 ` [PATCH RFC 02/28] ARM: VF610: Add Zodiac Inflight Innovations development boards Andrew Lunn
2015-12-23 12:56 ` [PATCH RFC 03/28] net: dsa: Move platform data allocation for OF Andrew Lunn
2015-12-23 12:56 ` [PATCH RFC 04/28] dsa: Rename mv88e6123_61_65 to mv88e6123 to be consistent Andrew Lunn
2015-12-23 12:56 ` [PATCH RFC 05/28] net: dsa: Pass the dsa device to the switch drivers Andrew Lunn
2015-12-23 20:36 ` Florian Fainelli
2015-12-23 12:56 ` [PATCH RFC 06/28] net: dsa: Have the switch driver allocate there own private memory Andrew Lunn
2015-12-23 20:39 ` Florian Fainelli
2015-12-23 12:56 ` [PATCH RFC 07/28] net: dsa: Remove allocation of driver " Andrew Lunn
2015-12-23 20:39 ` Florian Fainelli
2015-12-23 12:56 ` [PATCH RFC 08/28] net: dsa: Keep the mii bus and address in the private structure Andrew Lunn
2015-12-23 20:40 ` Florian Fainelli
2016-01-21 20:41 ` Vivien Didelot
2016-01-21 20:50 ` Andrew Lunn
2015-12-23 12:56 ` [PATCH RFC 09/28] net: dsa: Add basic support for component master support Andrew Lunn
2015-12-23 12:56 ` [PATCH RFC 10/28] net: dsa: Keep a reference to the switch device for component matching Andrew Lunn
2015-12-23 12:56 ` [PATCH RFC 11/28] net: dsa: Add slave component matches based on a phandle to the slave Andrew Lunn
2015-12-23 12:56 ` [PATCH RFC 12/28] net: dsa: Make dsa,mii-bus optional Andrew Lunn
2015-12-23 20:42 ` Florian Fainelli
2015-12-23 12:56 ` [PATCH RFC 13/28] net: dsa: Add register/unregister functions for switch drivers Andrew Lunn
2015-12-23 12:56 ` [PATCH RFC 14/28] net: dsa: Rename DSA probe function Andrew Lunn
2015-12-23 12:56 ` [PATCH RFC 15/28] of_mdio: Add "mii-bus" and address property parser Andrew Lunn
2015-12-23 12:56 ` [PATCH RFC 16/28] dsa: mv88e6xxx: Use bus in mv88e6xxx_lookup_name() Andrew Lunn
2016-01-21 20:54 ` Vivien Didelot
2015-12-23 12:56 ` [PATCH RFC 17/28] dsa: mv88e6xxx: Add shared code for binding/unbinding a switch driver Andrew Lunn
2015-12-23 12:56 ` [PATCH RFC 18/28] dsa: Add platform device support to Marvell switches Andrew Lunn
2016-01-21 21:05 ` Vivien Didelot
2015-12-23 12:56 ` [PATCH RFC 19/28] net: dsa: bcm_sf2: make it a real platform driver Andrew Lunn
2015-12-23 20:32 ` Florian Fainelli
2015-12-23 12:56 ` [PATCH RFC 20/28] vf610: Zii: Convert rev b to switches as individual devices Andrew Lunn
2015-12-23 12:56 ` [PATCH RFC 21/28] net: dsa: Add some debug prints for error cases Andrew Lunn
2015-12-23 20:42 ` Florian Fainelli
2015-12-23 12:56 ` [PATCH RFC 22/28] net: dsa: Setup the switches after all have been probed Andrew Lunn
2015-12-23 12:56 ` [PATCH RFC 23/28] net: dsa: Only setup platform switches, not device switches Andrew Lunn
2015-12-23 12:56 ` [PATCH RFC 24/28] net: dsa: If a switch fails to probe, defer probing Andrew Lunn
2015-12-23 20:46 ` Florian Fainelli
2015-12-23 12:56 ` [PATCH RFC 25/28] Documentation: DSA: Describe how probe of DSA and switches work Andrew Lunn
2015-12-23 20:48 ` Florian Fainelli
2015-12-23 22:53 ` Andrew Lunn
2015-12-25 1:29 ` Florian Fainelli [this message]
2015-12-25 10:00 ` Andrew Lunn
2015-12-23 12:56 ` [PATCH RFC 26/28] dsa: Convert mv88e6xxx into a library allowing driver modules Andrew Lunn
2015-12-25 21:47 ` Florian Fainelli
2016-01-21 21:29 ` Vivien Didelot
2016-01-21 21:54 ` Andrew Lunn
2015-12-23 12:56 ` [PATCH RFC 27/28] dsa: slave: Don't reference NULL pointer during phy_disconnect Andrew Lunn
2015-12-23 20:45 ` Florian Fainelli
2015-12-23 12:56 ` [PATCH RFC 28/28] dsa: Destroy fixed link phys after the phy has been disconnected Andrew Lunn
2015-12-23 20:45 ` Florian Fainelli
2015-12-23 20:44 ` [PATCH RFC 00/28] DSA: Restructure probing Florian Fainelli
2015-12-23 22:33 ` Andrew Lunn
2015-12-23 23:13 ` Florian Fainelli
2015-12-24 12:58 ` Andrew Lunn
2015-12-25 1:47 ` Florian Fainelli
2015-12-25 11:31 ` Andrew Lunn
2015-12-25 22:00 ` Florian Fainelli
2015-12-25 23:41 ` Andrew Lunn
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=567C9C16.5020005@gmail.com \
--to=f.fainelli@gmail.com \
--cc=andrew@lunn.ch \
--cc=narmstrong@baylibre.com \
--cc=netdev@vger.kernel.org \
--cc=vivien.didelot@savoirfairelinux.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.