Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1683208

Re: [PATCH 2/2] net: ethernet: fsl: add phy reset after clk enable option

From Andrew Lunn <andrew@lunn.ch>
Newsgroups linux.kernel
Subject Re: [PATCH 2/2] net: ethernet: fsl: add phy reset after clk enable option
Date 2017-07-07 16:10 +0200
Message-ID <u0C7g-57u-5@gated-at.bofh.it> (permalink)
References (3 earlier) <u0uCJ-8iW-5@gated-at.bofh.it> <u0vyO-sw-21@gated-at.bofh.it> <u0ydk-2cj-23@gated-at.bofh.it> <u0zj4-3e7-27@gated-at.bofh.it> <u0zsJ-3i4-1@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


> Ok. I'm fine with moving the phy-reset-gpios binding into the PHY.
> But one question still remains: Who should then trigger the "hard
> reset" of the PHY?

Hi Richard

I think i see a few whys to do this, but first i need to check
something. Is the clock which is causing a problem this one:

        /* clk_ref is optional, depends on board */
        fep->clk_ref = devm_clk_get(&pdev->dev, "enet_clk_ref");
        if (IS_ERR(fep->clk_ref))
                fep->clk_ref = NULL;

Possible solutions:

1) clocks are referenced counted. If it is turned on twice, it needs
   to be turned off twice before it is actually turned off. So, make
   the PHY driver also clk_prepare_enable() this clock. When the FEC
   tries to turn it off, it will stay ticking. Problem avoided, at the
   expense of some power.

2) More complex, but make the PHY driver also a clock driver. Have the
   PHY driver export a clock which the FEC use, as "enet_clk_ref". The
   implementation of this clock, would both turn the real clock on,
   and the perform the reset.

Both require no changes to the FEC, or any other MAC driver using this
PHY, so long as the MAC driver uses the common clock infrastructure to
control the clock to the PHY.

	Andrew


 

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH 2/2] net: ethernet: fsl: add phy reset after clk enable option Richard Leitner <richard.leitner@skidata.com> - 2017-07-06 15:20 +0200
  Re: [PATCH 2/2] net: ethernet: fsl: add phy reset after clk enable  option Andrew Lunn <andrew@lunn.ch> - 2017-07-06 16:00 +0200
    Re: [PATCH 2/2] net: ethernet: fsl: add phy reset after clk enable  option Richard Leitner <richard.leitner@skidata.com> - 2017-07-06 16:40 +0200
  RE: [PATCH 2/2] net: ethernet: fsl: add phy reset after clk enable  option Andy Duan <fugang.duan@nxp.com> - 2017-07-07 07:40 +0200
    Re: [PATCH 2/2] net: ethernet: fsl: add phy reset after clk enable  option Richard Leitner <richard.leitner@skidata.com> - 2017-07-07 08:10 +0200
      RE: [PATCH 2/2] net: ethernet: fsl: add phy reset after clk enable  option Andy Duan <fugang.duan@nxp.com> - 2017-07-07 09:10 +0200
        Re: [PATCH 2/2] net: ethernet: fsl: add phy reset after clk enable  option Richard Leitner <richard.leitner@skidata.com> - 2017-07-07 12:00 +0200
          RE: [PATCH 2/2] net: ethernet: fsl: add phy reset after clk enable  option Andy Duan <fugang.duan@nxp.com> - 2017-07-07 13:10 +0200
            Re: [PATCH 2/2] net: ethernet: fsl: add phy reset after clk enable  option Richard Leitner <richard.leitner@skidata.com> - 2017-07-07 13:20 +0200
              Re: [PATCH 2/2] net: ethernet: fsl: add phy reset after clk enable  option Andrew Lunn <andrew@lunn.ch> - 2017-07-07 16:10 +0200
                Re: [PATCH 2/2] net: ethernet: fsl: add phy reset after clk enable  option Richard Leitner <richard.leitner@skidata.com> - 2017-07-12 11:40 +0200
                Re: [PATCH 2/2] net: ethernet: fsl: add phy reset after clk enable  option Andrew Lunn <andrew@lunn.ch> - 2017-07-12 15:50 +0200
  Re: [PATCH 2/2] net: ethernet: fsl: add phy reset after clk enable  option Rob Herring <robh@kernel.org> - 2017-07-10 15:30 +0200

csiph-web