u-boot.lists.denx.de archive mirror
 help / color / mirror / Atom feed
From: Ramon Fried <rfried.dev@gmail.com>
To: Marek Vasut <marek.vasut+renesas@mailbox.org>
Cc: u-boot@lists.denx.de,
	"Ariel D'Alessandro" <ariel.dalessandro@collabora.com>,
	"Cédric Le Goater" <clg@kaod.org>,
	"Marek Behún" <kabel@kernel.org>,
	"Alex Nemirovsky" <alex.nemirovsky@cortina-access.com>,
	"Haolin Li" <li.haolin@qq.com>,
	"Heinrich Schuchardt" <xypron.glpk@gmx.de>,
	"Joe Hershberger" <joe.hershberger@ni.com>,
	"Joel Stanley" <joel@jms.id.au>,
	"Josua Mayer" <josua@solid-run.com>,
	"Michael Trimarchi" <michael@amarulasolutions.com>,
	"Michal Simek" <michal.simek@amd.com>,
	"Nate Drude" <nate.d@variscite.com>,
	"Neil Armstrong" <neil.armstrong@linaro.org>,
	"Radu Pirea" <radu-nicolae.pirea@oss.nxp.com>,
	"Samuel Mendoza-Jonas" <sam@mendozajonas.com>,
	"Stefan Roese" <sr@denx.de>,
	"T Karthik Reddy" <t.karthik.reddy@xilinx.com>,
	"Tim Harvey" <tharvey@gateworks.com>,
	"Vladimir Oltean" <vladimir.oltean@nxp.com>,
	u-boot-amlogic@groups.io
Subject: Re: [PATCH 38/41] net: phy: Drop static phy_drivers list
Date: Sat, 1 Apr 2023 21:47:18 +0300	[thread overview]
Message-ID: <CAGi-RULv3jio60-PKpLCV_ivd+mt62rh2w_AQjk4KrepcRw7GA@mail.gmail.com> (raw)
In-Reply-To: <20230319170317.27711-38-marek.vasut+renesas@mailbox.org>

On Sun, Mar 19, 2023 at 7:05 PM Marek Vasut
<marek.vasut+renesas@mailbox.org> wrote:
>
> The static phy_drivers list is superseded by linker list of struct phy_drivers
> now that all drivers have been converted to the later. Drop the phy_drivers
> list as well as list_head from struct phy_driver.
>
> Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
> ---
> Cc: "Ariel D'Alessandro" <ariel.dalessandro@collabora.com>
> Cc: "Cédric Le Goater" <clg@kaod.org>
> Cc: "Marek Behún" <kabel@kernel.org>
> Cc: Alex Nemirovsky <alex.nemirovsky@cortina-access.com>
> Cc: Haolin Li <li.haolin@qq.com>
> Cc: Heinrich Schuchardt <xypron.glpk@gmx.de>
> Cc: Joe Hershberger <joe.hershberger@ni.com>
> Cc: Joel Stanley <joel@jms.id.au>
> Cc: Josua Mayer <josua@solid-run.com>
> Cc: Marek Vasut <marek.vasut+renesas@mailbox.org>
> Cc: Michael Trimarchi <michael@amarulasolutions.com>
> Cc: Michal Simek <michal.simek@amd.com>
> Cc: Nate Drude <nate.d@variscite.com>
> Cc: Neil Armstrong <neil.armstrong@linaro.org>
> Cc: Radu Pirea <radu-nicolae.pirea@oss.nxp.com>
> Cc: Ramon Fried <rfried.dev@gmail.com>
> Cc: Samuel Mendoza-Jonas <sam@mendozajonas.com>
> Cc: Stefan Roese <sr@denx.de>
> Cc: T Karthik Reddy <t.karthik.reddy@xilinx.com>
> Cc: Tim Harvey <tharvey@gateworks.com>
> Cc: Vladimir Oltean <vladimir.oltean@nxp.com>
> Cc: u-boot-amlogic@groups.io
> ---
>  drivers/net/phy/phy.c | 26 ++------------------------
>  include/phy.h         |  2 --
>  2 files changed, 2 insertions(+), 26 deletions(-)
>
> diff --git a/drivers/net/phy/phy.c b/drivers/net/phy/phy.c
> index bd9c576f459..f4aa1f664cb 100644
> --- a/drivers/net/phy/phy.c
> +++ b/drivers/net/phy/phy.c
> @@ -463,8 +463,6 @@ U_BOOT_PHY_DRIVER(genphy) = {
>         .shutdown       = genphy_shutdown,
>  };
>
> -static LIST_HEAD(phy_drivers);
> -
>  #ifdef CONFIG_NEEDS_MANUAL_RELOC
>  static void phy_drv_reloc(struct phy_driver *drv)
>  {
> @@ -493,16 +491,6 @@ int phy_init(void)
>         const int ll_n_ents = ll_entry_count(struct phy_driver, phy_driver);
>         struct phy_driver *drv, *ll_entry;
>
> -       /*
> -        * The pointers inside phy_drivers also needs to be updated incase of
> -        * manual reloc, without which these points to some invalid
> -        * pre reloc address and leads to invalid accesses, hangs.
> -        */
> -       struct list_head *head = &phy_drivers;
> -
> -       head->next = (void *)head->next + gd->reloc_off;
> -       head->prev = (void *)head->prev + gd->reloc_off;
> -
>         /* Perform manual relocation on linker list based PHY drivers */
>         ll_entry = ll_entry_start(struct phy_driver, phy_driver);
>         for (drv = ll_entry; drv != ll_entry + ll_n_ents; drv++)
> @@ -514,9 +502,6 @@ int phy_init(void)
>
>  int phy_register(struct phy_driver *drv)
>  {
> -       INIT_LIST_HEAD(&drv->list);
> -       list_add_tail(&drv->list, &phy_drivers);
> -
>  #ifdef CONFIG_NEEDS_MANUAL_RELOC
>         phy_drv_reloc(drv);
>  #endif
> @@ -575,16 +560,9 @@ static struct phy_driver *generic_for_phy(struct phy_device *phydev)
>  static struct phy_driver *get_phy_driver(struct phy_device *phydev)
>  {
>         const int ll_n_ents = ll_entry_count(struct phy_driver, phy_driver);
> -       struct phy_driver *ll_entry;
> -       struct list_head *entry;
>         int phy_id = phydev->phy_id;
> -       struct phy_driver *drv = NULL;
> -
> -       list_for_each(entry, &phy_drivers) {
> -               drv = list_entry(entry, struct phy_driver, list);
> -               if ((drv->uid & drv->mask) == (phy_id & drv->mask))
> -                       return drv;
> -       }
> +       struct phy_driver *ll_entry;
> +       struct phy_driver *drv;
>
>         ll_entry = ll_entry_start(struct phy_driver, phy_driver);
>         for (drv = ll_entry; drv != ll_entry + ll_n_ents; drv++)
> diff --git a/include/phy.h b/include/phy.h
> index 5f4967cb150..5e8ae5e29aa 100644
> --- a/include/phy.h
> +++ b/include/phy.h
> @@ -125,8 +125,6 @@ struct phy_driver {
>         int (*write_mmd)(struct phy_device *phydev, int devad, int reg,
>                          u16 val);
>
> -       struct list_head list;
> -
>         /* driver private data */
>         ulong data;
>  };
> --
> 2.39.2
>
Reviewed-by: Ramon Fried <rfried.dev@gmail.com>

  reply	other threads:[~2023-04-01 18:47 UTC|newest]

Thread overview: 56+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-19 17:02 [PATCH 01/41] net: phy: aquantia: Staticize PHY driver entries Marek Vasut
2023-03-19 17:02 ` [PATCH 02/41] net: phy: ca_phy: " Marek Vasut
2023-03-19 17:02 ` [PATCH 03/41] net: phy: cortina: " Marek Vasut
2023-03-19 17:02 ` [PATCH 04/41] net: phy: teranetics: " Marek Vasut
2023-03-19 17:02 ` [PATCH 05/41] net: phy: Factor manual relocation into separate function Marek Vasut
2023-03-19 17:02 ` [PATCH 06/41] net: phy: Iterate over both registered PHYs and struct phy_driver linker list Marek Vasut
2023-03-19 17:02 ` [PATCH 07/41] net: phy: adin: Convert to U_BOOT_PHY_DRIVER() Marek Vasut
2023-03-19 17:02 ` [PATCH 08/41] net: phy: aquantia: " Marek Vasut
2023-03-19 17:02 ` [PATCH 09/41] net: phy: atheros: " Marek Vasut
2023-03-19 17:02 ` [PATCH 10/41] net: phy: b53: " Marek Vasut
2023-03-19 17:02 ` [PATCH 11/41] net: phy: broadcom: " Marek Vasut
2023-03-19 17:02 ` [PATCH 12/41] net: phy: ca_phy: " Marek Vasut
2023-03-19 17:02 ` [PATCH 13/41] net: phy: cortina: " Marek Vasut
2023-03-19 17:02 ` [PATCH 14/41] net: phy: davicom: " Marek Vasut
2023-03-19 17:02 ` [PATCH 15/41] net: phy: mv88e61xx: " Marek Vasut
2023-03-19 17:02 ` [PATCH 16/41] net: phy: et1011c: " Marek Vasut
2023-03-19 17:02 ` [PATCH 17/41] net: phy: lxt: " Marek Vasut
2023-03-19 17:02 ` [PATCH 18/41] net: phy: marvell: " Marek Vasut
2023-03-19 17:02 ` [PATCH 19/41] net: phy: ksz8xxx: " Marek Vasut
2023-03-19 17:02 ` [PATCH 20/41] net: phy: ksz90x1: " Marek Vasut
2023-03-19 17:02 ` [PATCH 21/41] net: phy: meson-gxl: " Marek Vasut
2023-03-19 17:02 ` [PATCH 22/41] net: phy: natsemi: " Marek Vasut
2023-03-19 17:02 ` [PATCH 23/41] net: phy: nxp-c45-tja11xx: " Marek Vasut
2023-03-19 17:03 ` [PATCH 24/41] net: phy: nxp-tja11xx: " Marek Vasut
2023-03-19 17:03 ` [PATCH 25/41] net: phy: realtek: " Marek Vasut
2023-03-19 17:03 ` [PATCH 26/41] net: phy: smsc: " Marek Vasut
2023-03-19 17:03 ` [PATCH 27/41] net: phy: teranetics: " Marek Vasut
2023-03-19 17:03 ` [PATCH 28/41] net: phy: ti: " Marek Vasut
2023-03-19 17:03 ` [PATCH 29/41] net: phy: vitesse: " Marek Vasut
2023-04-01 18:45   ` Ramon Fried
2023-03-19 17:03 ` [PATCH 30/41] net: phy: xilinx: " Marek Vasut
2023-04-01 18:45   ` Ramon Fried
2023-03-19 17:03 ` [PATCH 31/41] net: phy: intel-xway: " Marek Vasut
2023-04-01 18:45   ` Ramon Fried
2023-03-19 17:03 ` [PATCH 32/41] net: phy: mscc: " Marek Vasut
2023-04-01 18:45   ` Ramon Fried
2023-03-19 17:03 ` [PATCH 33/41] net: phy: fixed: " Marek Vasut
2023-04-01 18:45   ` Ramon Fried
2023-03-19 17:03 ` [PATCH 34/41] net: phy: ncsi: " Marek Vasut
2023-04-01 18:46   ` Ramon Fried
2023-03-19 17:03 ` [PATCH 35/41] net: phy: xilinx-gmii2rgmii: " Marek Vasut
2023-04-01 18:46   ` Ramon Fried
2023-03-19 17:03 ` [PATCH 36/41] net: phy: genphy: " Marek Vasut
2023-03-19 17:03 ` [PATCH 37/41] net: phy: gen10g: " Marek Vasut
2023-04-01 18:46   ` Ramon Fried
2023-03-19 17:03 ` [PATCH 38/41] net: phy: Drop static phy_drivers list Marek Vasut
2023-04-01 18:47   ` Ramon Fried [this message]
2023-03-19 17:03 ` [PATCH 39/41] net: phy: Drop unused phy_register() Marek Vasut
2023-04-01 18:47   ` Ramon Fried
2023-03-19 17:03 ` [PATCH 40/41] net: phy: Re-inline phy_drv_reloc() Marek Vasut
2023-04-01 18:47   ` Ramon Fried
2023-03-19 17:03 ` [PATCH 41/41] net: phy: Only call phy_init() on systems needing manual relocation Marek Vasut
2023-04-01 18:48   ` Ramon Fried
2023-03-21 14:39 ` [PATCH 01/41] net: phy: aquantia: Staticize PHY driver entries Michal Simek
2023-03-21 17:28   ` Vladimir Oltean
2023-04-01 18:59 ` Ramon Fried

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=CAGi-RULv3jio60-PKpLCV_ivd+mt62rh2w_AQjk4KrepcRw7GA@mail.gmail.com \
    --to=rfried.dev@gmail.com \
    --cc=alex.nemirovsky@cortina-access.com \
    --cc=ariel.dalessandro@collabora.com \
    --cc=clg@kaod.org \
    --cc=joe.hershberger@ni.com \
    --cc=joel@jms.id.au \
    --cc=josua@solid-run.com \
    --cc=kabel@kernel.org \
    --cc=li.haolin@qq.com \
    --cc=marek.vasut+renesas@mailbox.org \
    --cc=michael@amarulasolutions.com \
    --cc=michal.simek@amd.com \
    --cc=nate.d@variscite.com \
    --cc=neil.armstrong@linaro.org \
    --cc=radu-nicolae.pirea@oss.nxp.com \
    --cc=sam@mendozajonas.com \
    --cc=sr@denx.de \
    --cc=t.karthik.reddy@xilinx.com \
    --cc=tharvey@gateworks.com \
    --cc=u-boot-amlogic@groups.io \
    --cc=u-boot@lists.denx.de \
    --cc=vladimir.oltean@nxp.com \
    --cc=xypron.glpk@gmx.de \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).