diff mbox series

[net,2/4] docs: net: dsa: update platform_data documentation

Message ID 20231208193518.2018114-3-vladimir.oltean@nxp.com (mailing list archive)
State Changes Requested
Delegated to: Netdev Maintainers
Headers show
Series Add some history to the DSA documentation | expand

Checks

Context Check Description
netdev/series_format success Posting correctly formatted
netdev/tree_selection success Clearly marked for net
netdev/ynl success SINGLE THREAD; Generated files up to date; no warnings/errors; no diff in generated;
netdev/fixes_present success No Fixes tags, but series doesn't touch code
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 8 this patch: 8
netdev/cc_maintainers warning 2 maintainers not CCed: florian.fainelli@broadcom.com linux-doc@vger.kernel.org
netdev/build_clang success Errors and warnings before: 8 this patch: 8
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/deprecated_api success None detected
netdev/check_selftest success No net selftest shell script
netdev/verify_fixes success No Fixes tag
netdev/build_allmodconfig_warn success Errors and warnings before: 8 this patch: 8
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 29 lines checked
netdev/build_clang_rust success No Rust files in patch. Skipping build
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0

Commit Message

Vladimir Oltean Dec. 8, 2023, 7:35 p.m. UTC
We were documenting a bunch of stuff which was removed in commit
93e86b3bc842 ("net: dsa: Remove legacy probing support"). There's some
further cleanup to do in struct dsa_chip_data, so rather than describing
every possible field (when maybe we should be switching to kerneldoc
format), just say what's important about it.

Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
---
 Documentation/networking/dsa/dsa.rst | 23 +++++++++++------------
 1 file changed, 11 insertions(+), 12 deletions(-)

Comments

Linus Walleij Dec. 8, 2023, 10:19 p.m. UTC | #1
On Fri, Dec 8, 2023 at 8:36 PM Vladimir Oltean <vladimir.oltean@nxp.com> wrote:

> We were documenting a bunch of stuff which was removed in commit
> 93e86b3bc842 ("net: dsa: Remove legacy probing support"). There's some
> further cleanup to do in struct dsa_chip_data, so rather than describing
> every possible field (when maybe we should be switching to kerneldoc
> format), just say what's important about it.
>
> Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
(...)
> +  ``ds->dev->platform_data`` pointer at ``dsa_register_switch()`` time. It is
> +  populated by board-specific code. The hardware switch driver may also have

I tend to avoid talking about "board-specific" since that has an embedded
tone to it, and rather say "system-specific". But DSA switches are certainly
in 99% of the cases embedded so it's definitely no big deal.

Reviewed-by: Linus Walleij <linus.walleij@linaro.org>

Yours,
Linus Walleij
Florian Fainelli Dec. 8, 2023, 10:33 p.m. UTC | #2
On 12/8/23 11:35, Vladimir Oltean wrote:
> We were documenting a bunch of stuff which was removed in commit
> 93e86b3bc842 ("net: dsa: Remove legacy probing support"). There's some
> further cleanup to do in struct dsa_chip_data, so rather than describing
> every possible field (when maybe we should be switching to kerneldoc
> format), just say what's important about it.
> 
> Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>

Reviewed-by: Florian Fainelli <florian.fainelli@broadcom.com>
Vladimir Oltean Dec. 9, 2023, 12:52 a.m. UTC | #3
On Fri, Dec 08, 2023 at 11:19:28PM +0100, Linus Walleij wrote:
> On Fri, Dec 8, 2023 at 8:36 PM Vladimir Oltean <vladimir.oltean@nxp.com> wrote:
> > +  ``ds->dev->platform_data`` pointer at ``dsa_register_switch()`` time. It is
> > +  populated by board-specific code. The hardware switch driver may also have
> 
> I tend to avoid talking about "board-specific" since that has an embedded
> tone to it, and rather say "system-specific". But DSA switches are certainly
> in 99% of the cases embedded so it's definitely no big deal.

I've changed this to "system-specific".

> Reviewed-by: Linus Walleij <linus.walleij@linaro.org>

Thanks for the review, I appreciate it!
Alvin Šipraga Dec. 10, 2023, 1:37 p.m. UTC | #4
On Fri, Dec 08, 2023 at 09:35:16PM +0200, Vladimir Oltean wrote:
> We were documenting a bunch of stuff which was removed in commit
> 93e86b3bc842 ("net: dsa: Remove legacy probing support"). There's some
> further cleanup to do in struct dsa_chip_data, so rather than describing
> every possible field (when maybe we should be switching to kerneldoc
> format), just say what's important about it.
> 
> Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>

Reviewed-by: Alvin Šipraga <alsi@bang-olufsen.dk>

> ---
>  Documentation/networking/dsa/dsa.rst | 23 +++++++++++------------
>  1 file changed, 11 insertions(+), 12 deletions(-)
> 
> diff --git a/Documentation/networking/dsa/dsa.rst b/Documentation/networking/dsa/dsa.rst
> index 0c326a42eb81..676c92136a0e 100644
> --- a/Documentation/networking/dsa/dsa.rst
> +++ b/Documentation/networking/dsa/dsa.rst
> @@ -413,18 +413,17 @@ PHYs, external PHYs, or even external switches.
>  Data structures
>  ---------------
>  
> -DSA data structures are defined in ``include/net/dsa.h`` as well as
> -``net/dsa/dsa_priv.h``:
> -
> -- ``dsa_chip_data``: platform data configuration for a given switch device,
> -  this structure describes a switch device's parent device, its address, as
> -  well as various properties of its ports: names/labels, and finally a routing
> -  table indication (when cascading switches)
> -
> -- ``dsa_platform_data``: platform device configuration data which can reference
> -  a collection of dsa_chip_data structures if multiple switches are cascaded,
> -  the conduit network device this switch tree is attached to needs to be
> -  referenced
> +DSA data structures are defined in ``include/linux/platform_data/dsa.h``,
> +``include/net/dsa.h`` as well as ``net/dsa/dsa_priv.h``:
> +
> +- ``dsa_chip_data``: platform data configuration for a given switch device.
> +  Most notably, it is necessary to the DSA core because it holds a reference to
> +  the conduit interface. It must be accessible through the
> +  ``ds->dev->platform_data`` pointer at ``dsa_register_switch()`` time. It is
> +  populated by board-specific code. The hardware switch driver may also have
> +  its own portion of ``platform_data`` description. In that case,
> +  ``ds->dev->platform_data`` can point to a switch-specific structure, which
> +  encapsulates ``struct dsa_chip_data`` as its first element.
>  
>  - ``dsa_switch_tree``: structure assigned to the conduit network device under
>    ``dsa_ptr``, this structure references a dsa_platform_data structure as well as
> -- 
> 2.34.1
>
diff mbox series

Patch

diff --git a/Documentation/networking/dsa/dsa.rst b/Documentation/networking/dsa/dsa.rst
index 0c326a42eb81..676c92136a0e 100644
--- a/Documentation/networking/dsa/dsa.rst
+++ b/Documentation/networking/dsa/dsa.rst
@@ -413,18 +413,17 @@  PHYs, external PHYs, or even external switches.
 Data structures
 ---------------
 
-DSA data structures are defined in ``include/net/dsa.h`` as well as
-``net/dsa/dsa_priv.h``:
-
-- ``dsa_chip_data``: platform data configuration for a given switch device,
-  this structure describes a switch device's parent device, its address, as
-  well as various properties of its ports: names/labels, and finally a routing
-  table indication (when cascading switches)
-
-- ``dsa_platform_data``: platform device configuration data which can reference
-  a collection of dsa_chip_data structures if multiple switches are cascaded,
-  the conduit network device this switch tree is attached to needs to be
-  referenced
+DSA data structures are defined in ``include/linux/platform_data/dsa.h``,
+``include/net/dsa.h`` as well as ``net/dsa/dsa_priv.h``:
+
+- ``dsa_chip_data``: platform data configuration for a given switch device.
+  Most notably, it is necessary to the DSA core because it holds a reference to
+  the conduit interface. It must be accessible through the
+  ``ds->dev->platform_data`` pointer at ``dsa_register_switch()`` time. It is
+  populated by board-specific code. The hardware switch driver may also have
+  its own portion of ``platform_data`` description. In that case,
+  ``ds->dev->platform_data`` can point to a switch-specific structure, which
+  encapsulates ``struct dsa_chip_data`` as its first element.
 
 - ``dsa_switch_tree``: structure assigned to the conduit network device under
   ``dsa_ptr``, this structure references a dsa_platform_data structure as well as