All of lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Christian Marangi" <ansuelsmth@gmail.com>, devicetree@vger.kernel.org
Cc: robh@kernel.org, conor+dt@kernel.org
Subject: Re: [PATCH net-next v23 04/15] net: pcs: implement Firmware node support for PCS driver
Date: Mon, 30 Nov 2026 23:25:50 +0000	[thread overview]
Message-ID: <sashiko-outbox-242228@kernel.org> (raw)
In-Reply-To: <20261129230558.612526-5-ansuelsmth@gmail.com>

Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [Low] net: pcs: missing struct forward declarations in
  include/linux/pcs/pcs-provider.h
--

commit 99cf1814d7e438ff577e0609ae7abb9287489c81
Author: Christian Marangi <ansuelsmth@gmail.com>

net: pcs: implement Firmware node support for PCS driver

This commit implements a firmware node provider and consumer API for PCS
drivers, allowing MAC drivers to look up PCS instances referenced via the
"pcs-handle" property in DT or ACPI.

> diff --git a/include/linux/pcs/pcs-provider.h b/include/linux/pcs/pcs-provider.h
> new file mode 100644
> index 0000000000000..6b03a635f73c0
> --- /dev/null
> +++ b/include/linux/pcs/pcs-provider.h
> @@ -0,0 +1,72 @@
> +/* SPDX-License-Identifier: GPL-2.0-or-later */
> +#ifndef __LINUX_PCS_PROVIDER_H
> +#define __LINUX_PCS_PROVIDER_H
> +
> +struct fwnode_pcs_provider;
> +
> +/**
> + * fwnode_pcs_simple_xlate - Simple xlate function to retrieve PCS
> + * @pcsspec: reference arguments
> + * @data: Context data (assumed assigned to the single PCS)
> + *
> + * Returns: the PCS pointed by data.
> + */
> +struct phylink_pcs *fwnode_pcs_simple_xlate(struct fwnode_reference_args *pcsspec,
> +					    void *data);
> +
> +/**
> + * fwnode_pcs_add_provider - Registers a new PCS provider
> + * @fwnode: Firmware node
> + * @fwnode_xlate: xlate function to retrieve the PCS
> + * @data: Context data
> + *
> + * Register and add a new PCS provider to the global providers list
> + * for the firmware node. The relevant PCS from the PCS provider
> + * is retrieved from the passed fwnode_xlate function.
> + *
> + * The xlate function MUST return a pointer to an existing, already-allocated
> + * struct phylink_pcs and MUST NOT dynamically allocate a new PCS.
> + * The same PCS object must be returned for a given firmware reference and args,
> + * as PCS pointer identity is used to associate PCS objects with their provider.
> + * A PCS object belongs to one provider and must remain valid until that
> + * provider is removed.
> + *
> + * Returns: A pointer to the registered PCS provider on success, or
> + * an ERR_PTR() encoded error code on failure.
> + */
> +struct fwnode_pcs_provider *
> +fwnode_pcs_add_provider(struct fwnode_handle *fwnode,
> +			struct phylink_pcs *(*fwnode_xlate)(struct fwnode_reference_args *pcsspec,
> +							    void *data),
> +			void *data);
> +
> +/**
> + * fwnode_pcs_del_provider - Removes a PCS provider
> + * @pp: PCS provider returned by fwnode_pcs_add_provider()
> + */
> +void fwnode_pcs_del_provider(struct fwnode_pcs_provider *pp);
> +
> +/**
> + * devm_fwnode_pcs_add_provider - Registers a new PCS provider
> + * @dev: Device of the PCS provider
> + * @fwnode: Firmware node
> + * @fwnode_xlate: xlate function to retrieve the PCS
> + * @data: Context data
> + *
> + * Register and add a new PCS provider to the global providers list
> + * for the firmware node. The relevant PCS from the PCS provider
> + * is retrieved from the passed fwnode_xlate function. While at that, it
> + * also associates the device with the PCS provider using devres.
> + * On driver detach, release function is invoked on the devres data,
> + * then, devres data is freed.
> + *
> + * Returns: A pointer to the registered PCS provider on success, or
> + * an ERR_PTR() encoded error code on failure.
> + */
> +struct fwnode_pcs_provider *
> +devm_fwnode_pcs_add_provider(struct device *dev, struct fwnode_handle *fwnode,
> +			     struct phylink_pcs *(*fwnode_xlate)(struct fwnode_reference_args *pcsspec,
> +								 void *data),
> +			     void *data);

[Severity: Low]
Does include/linux/pcs/pcs-provider.h need forward declarations for struct
device, struct fwnode_handle, struct fwnode_reference_args, and struct
phylink_pcs?

Because this header has no #include directives and only forward-declares
struct fwnode_pcs_provider, including it before linux/fwnode.h or
linux/device.h declares those structs inside the parameter lists with
prototype scope, triggering -Wvisibility warnings and incompatible pointer
type errors.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261129230558.612526-1-ansuelsmth@gmail.com?part=4

  reply	other threads:[~2026-11-30 23:25 UTC|newest]

Thread overview: 39+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-29 23:05 [PATCH net-next v23 00/15] net: pcs: Introduce support for fwnode PCS Christian Marangi
2026-11-29 23:05 ` [PATCH net-next v23 01/15] net: phylink: make PCS phylink instance access RCU protected Christian Marangi
2026-11-30 23:47   ` netdev-bot+sashiko
2026-11-29 23:05 ` [PATCH net-next v23 02/15] net: phylink: keep and use MAC supported_interfaces in phylink struct Christian Marangi
2026-11-29 23:05 ` [PATCH net-next v23 03/15] net: phylink: introduce internal phylink PCS handling Christian Marangi
2026-11-30 23:25   ` sashiko-bot
2026-11-30 23:47   ` netdev-bot+sashiko
2026-11-29 23:05 ` [PATCH net-next v23 04/15] net: pcs: implement Firmware node support for PCS driver Christian Marangi
2026-11-30 23:25   ` sashiko-bot [this message]
2026-11-30 23:47   ` netdev-bot+sashiko
2026-11-29 23:05 ` [PATCH net-next v23 05/15] net: phylink: make phylink_validate state locked Christian Marangi
2026-11-30 23:47   ` netdev-bot+sashiko
2026-11-29 23:05 ` [PATCH net-next v23 06/15] net: phylink: add capabilities helpers and track modified advertising Christian Marangi
2026-11-30 23:25   ` sashiko-bot
2026-11-30 23:47   ` netdev-bot+sashiko
2026-11-29 23:05 ` [PATCH net-next v23 07/15] net: sfp: support deferred module insertion Christian Marangi
2026-11-30 23:47   ` netdev-bot+sashiko
2026-11-29 23:05 ` [PATCH net-next v23 08/15] net: phylink: support PCS provider release Christian Marangi
2026-11-30 23:25   ` sashiko-bot
2026-11-30 23:47   ` netdev-bot+sashiko
2026-11-29 23:05 ` [PATCH net-next v23 09/15] net: phylink: support late PCS provider attach Christian Marangi
2026-11-30 23:25   ` sashiko-bot
2026-11-30 23:47   ` netdev-bot+sashiko
2026-11-29 23:05 ` [PATCH net-next v23 10/15] net: Document PCS subsystem Christian Marangi
2026-11-30 23:25   ` sashiko-bot
2026-11-30 23:47   ` netdev-bot+sashiko
2026-11-29 23:05 ` [PATCH net-next v23 11/15] MAINTAINERS: add myself as PCS subsystem maintainer Christian Marangi
2026-11-29 23:05 ` [PATCH net-next v23 12/15] net: phylink: add .pcs_link_down PCS OP Christian Marangi
2026-11-30 23:47   ` netdev-bot+sashiko
2026-11-29 23:05 ` [PATCH net-next v23 13/15] dt-bindings: net: pcs: Document support for Airoha Ethernet PCS Christian Marangi
2026-11-30 23:25   ` sashiko-bot
2026-11-30 23:47   ` netdev-bot+sashiko
2026-11-29 23:05 ` [PATCH net-next v23 14/15] net: pcs: airoha: add PCS driver for Airoha AN7581 SoC Christian Marangi
2026-11-30 23:25   ` sashiko-bot
2026-11-30 23:47   ` netdev-bot+sashiko
2026-11-29 23:05 ` [PATCH net-next v23 15/15] net: airoha: add phylink support Christian Marangi
2026-11-30 23:25   ` sashiko-bot
2026-11-30 23:48   ` netdev-bot+sashiko
2026-11-29 23:09 ` [PATCH net-next v23 00/15] net: pcs: Introduce support for fwnode PCS netdev-bot+sinfo

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=sashiko-outbox-242228@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=ansuelsmth@gmail.com \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=robh@kernel.org \
    --cc=sashiko-reviews@lists.linux.dev \
    /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.