diff mbox series

[3/3] net: tsec: Make redundant_init() static

Message ID 20210929055046.4326-3-bmeng.cn@gmail.com
State Superseded
Delegated to: Ramon Fried
Headers show
Series [1/3] net: dsa: Use true instead of 1 in the set_promisc() call | expand

Commit Message

Bin Meng Sept. 29, 2021, 5:50 a.m. UTC
redundant_init() is only called in the tsec driver. Make it static.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
---

 drivers/net/tsec.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Vladimir Oltean Sept. 29, 2021, 1:44 p.m. UTC | #1
On Wed, Sep 29, 2021 at 01:50:46PM +0800, Bin Meng wrote:
> redundant_init() is only called in the tsec driver. Make it static.
> 
> Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
> ---
> 
>  drivers/net/tsec.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/net/tsec.c b/drivers/net/tsec.c
> index ee820aae15..b433e411bd 100644
> --- a/drivers/net/tsec.c
> +++ b/drivers/net/tsec.c
> @@ -432,7 +432,7 @@ static void tsec_halt(struct udevice *dev)
>   * of the eTSEC port initialization sequence,
>   * the eTSEC Rx logic may not be properly initialized.
>   */
> -void redundant_init(struct tsec_private *priv)
> +static void redundant_init(struct tsec_private *priv)
>  {
>  	struct tsec __iomem *regs = priv->regs;
>  	uint t, count = 0;
> -- 
> 2.25.1
> 

Reviewed-by: Vladimir Oltean <vladimir.oltean@nxp.com>

About this whole redundant_init thing... the Linux gianfar driver
doesn't do it, and it was added by this commit:

commit aada81de703e0fb26ae1a8dc8fc8d6a7a37fa3c9
Author: chenhui zhao <chenhui.zhao@freescale.com>
Date:   Mon Oct 3 08:38:50 2011 -0500

    powerpc/mpc8548: Add workaround for erratum NMG_eTSEC129

    Erratum NMG_eTSEC129 (eTSEC86 in MPC8548 document) applies to some early
    verion silicons. This workaround detects if the eTSEC Rx logic is properly
    initialized, and reinitialize the eTSEC Rx logic.

    Signed-off-by: Gong Chen <g.chen@freescale.com>
    Signed-off-by: Zhao Chenhui <chenhui.zhao@freescale.com>
    Signed-off-by: Kumar Gala <galak@kernel.crashing.org>

Internally I could find a single reference to the eTSEC 86 erratum
("eTSEC receivers may not be properly initialized"), dated 08/2007, and
it says it was fixed in MPC8548 silicon version 2.1.

On the other hand it consumes 90 lines of code (10%) of the tsec driver.
It would be nice if we could just remove it, I am not sure if anyone
would even notice.

Priyanka?
Ramon Fried Oct. 16, 2021, 6:27 p.m. UTC | #2
On Wed, Sep 29, 2021 at 8:50 AM Bin Meng <bmeng.cn@gmail.com> wrote:
>
> redundant_init() is only called in the tsec driver. Make it static.
>
> Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
> ---
>
>  drivers/net/tsec.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/net/tsec.c b/drivers/net/tsec.c
> index ee820aae15..b433e411bd 100644
> --- a/drivers/net/tsec.c
> +++ b/drivers/net/tsec.c
> @@ -432,7 +432,7 @@ static void tsec_halt(struct udevice *dev)
>   * of the eTSEC port initialization sequence,
>   * the eTSEC Rx logic may not be properly initialized.
>   */
> -void redundant_init(struct tsec_private *priv)
> +static void redundant_init(struct tsec_private *priv)
>  {
>         struct tsec __iomem *regs = priv->regs;
>         uint t, count = 0;
> --
> 2.25.1
>
Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
diff mbox series

Patch

diff --git a/drivers/net/tsec.c b/drivers/net/tsec.c
index ee820aae15..b433e411bd 100644
--- a/drivers/net/tsec.c
+++ b/drivers/net/tsec.c
@@ -432,7 +432,7 @@  static void tsec_halt(struct udevice *dev)
  * of the eTSEC port initialization sequence,
  * the eTSEC Rx logic may not be properly initialized.
  */
-void redundant_init(struct tsec_private *priv)
+static void redundant_init(struct tsec_private *priv)
 {
 	struct tsec __iomem *regs = priv->regs;
 	uint t, count = 0;