All of lore.kernel.org
 help / color / mirror / Atom feed
From: b.galvani@gmail.com (Beniamino Galvani)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v5 1/4] ethernet: arc: Add support for Rockchip SoC layer device tree bindings
Date: Thu, 4 Sep 2014 21:30:33 +0200	[thread overview]
Message-ID: <20140904192934.GB14583@gmail.com> (raw)
In-Reply-To: <CABgxDoLWqqwGUUt9hWuJdHT_VF0c6-7xeAwgfeH7TwJmu1BN9w@mail.gmail.com>

On Thu, Sep 04, 2014 at 10:45:35AM +0200, PERIER Romain wrote:
> Hi Beniamino,
> 
> I will investigate. Could you please :
> 
> - Load the module
> - Show me the output of lsmod
> - Use your ethernet a bit
> - Try to unload the module
> - If your board did not freeze or if your kernel did not panic , show
> me your dmesg (if it is impossible show me the dmesg before unloading
> the module)
> 
> Perhaps, we could continue this discussion in private (by email or
> IRC). What do you think ?
> 
> I will investigate this evening and tomorrow. Thanks for your feedbacks .

Hi Romain,

the freeze happens in clk_disable_unprepare(), which disables the
macref clock parents up to the dpll, needed by the DDR.

As suggested by Heiko on IRC, the patch "clk: rockchip: protect
critical clocks from getting disabled" [1], modified to include ddrphy
in the list of critical clocks, solves the problem.

During the module unload, if you move the call to arc_emac_remove()
before clk_disable_unprepare() you can avoid a delay of 4-5 seconds
caused by the timeout of the function phy_disconnect(). In any case:

Tested-by: Beniamino Galvani <b.galvani@gmail.com>

[1] https://git.linaro.org/people/mike.turquette/linux.git/commit/fe94f974e9c8b820640a5873d81589ab67380516

> 
> 
> 2014-09-03 23:12 GMT+02:00 Beniamino Galvani <b.galvani@gmail.com>:
> > On Wed, Sep 03, 2014 at 04:52:42PM +0000, Romain Perier wrote:
> >> This patch defines a platform glue layer for Rockchip SoCs which
> >> support arc-emac driver. It ensures that regulator for the rmii is on
> >> before trying to connect to the ethernet controller. It applies right
> >> speed and mode changes to the grf when ethernet settings change.
> >
> > Hi Romain,
> >
> > on a Radxa Rock when I try to remove the emac_rockchip module the
> > board locks up when calling clk_disable_unprepare(priv->refclk). The
> > tree is a net-next + your series, I don't know if I need some other
> > patches.
> >
> > There is also the following build warning due to the emac dependency
> > on REGULATOR which in principle seems correct, but looking at other
> > drivers I wonder why they use the regulator APIs but don't have the
> > same dependency.
> >
> > drivers/regulator/Kconfig:1:error: recursive dependency detected!
> > drivers/regulator/Kconfig:1:       symbol REGULATOR is selected by MDIO_SUN4I
> > drivers/net/phy/Kconfig:159:       symbol MDIO_SUN4I depends on PHYLIB
> > drivers/net/phy/Kconfig:5:         symbol PHYLIB is selected by ARC_EMAC_CORE
> > drivers/net/ethernet/arc/Kconfig:20:      symbol ARC_EMAC_CORE is selected by EMAC_ROCKCHIP
> > drivers/net/ethernet/arc/Kconfig:35:      symbol EMAC_ROCKCHIP depends on REGULATOR
> >
> > Regards,
> > Beniamino

WARNING: multiple messages have this Message-ID (diff)
From: Beniamino Galvani <b.galvani@gmail.com>
To: PERIER Romain <romain.perier@gmail.com>
Cc: "Heiko Stübner" <heiko@sntech.de>,
	linux-rockchip@lists.infradead.org,
	linux-arm-kernel@lists.infradead.org,
	netdev <netdev@vger.kernel.org>,
	devicetree <devicetree@vger.kernel.org>,
	"Arnd Bergmann" <arnd@arndb.de>
Subject: Re: [PATCH v5 1/4] ethernet: arc: Add support for Rockchip SoC layer device tree bindings
Date: Thu, 4 Sep 2014 21:30:33 +0200	[thread overview]
Message-ID: <20140904192934.GB14583@gmail.com> (raw)
In-Reply-To: <CABgxDoLWqqwGUUt9hWuJdHT_VF0c6-7xeAwgfeH7TwJmu1BN9w@mail.gmail.com>

On Thu, Sep 04, 2014 at 10:45:35AM +0200, PERIER Romain wrote:
> Hi Beniamino,
> 
> I will investigate. Could you please :
> 
> - Load the module
> - Show me the output of lsmod
> - Use your ethernet a bit
> - Try to unload the module
> - If your board did not freeze or if your kernel did not panic , show
> me your dmesg (if it is impossible show me the dmesg before unloading
> the module)
> 
> Perhaps, we could continue this discussion in private (by email or
> IRC). What do you think ?
> 
> I will investigate this evening and tomorrow. Thanks for your feedbacks .

Hi Romain,

the freeze happens in clk_disable_unprepare(), which disables the
macref clock parents up to the dpll, needed by the DDR.

As suggested by Heiko on IRC, the patch "clk: rockchip: protect
critical clocks from getting disabled" [1], modified to include ddrphy
in the list of critical clocks, solves the problem.

During the module unload, if you move the call to arc_emac_remove()
before clk_disable_unprepare() you can avoid a delay of 4-5 seconds
caused by the timeout of the function phy_disconnect(). In any case:

Tested-by: Beniamino Galvani <b.galvani@gmail.com>

[1] https://git.linaro.org/people/mike.turquette/linux.git/commit/fe94f974e9c8b820640a5873d81589ab67380516

> 
> 
> 2014-09-03 23:12 GMT+02:00 Beniamino Galvani <b.galvani@gmail.com>:
> > On Wed, Sep 03, 2014 at 04:52:42PM +0000, Romain Perier wrote:
> >> This patch defines a platform glue layer for Rockchip SoCs which
> >> support arc-emac driver. It ensures that regulator for the rmii is on
> >> before trying to connect to the ethernet controller. It applies right
> >> speed and mode changes to the grf when ethernet settings change.
> >
> > Hi Romain,
> >
> > on a Radxa Rock when I try to remove the emac_rockchip module the
> > board locks up when calling clk_disable_unprepare(priv->refclk). The
> > tree is a net-next + your series, I don't know if I need some other
> > patches.
> >
> > There is also the following build warning due to the emac dependency
> > on REGULATOR which in principle seems correct, but looking at other
> > drivers I wonder why they use the regulator APIs but don't have the
> > same dependency.
> >
> > drivers/regulator/Kconfig:1:error: recursive dependency detected!
> > drivers/regulator/Kconfig:1:       symbol REGULATOR is selected by MDIO_SUN4I
> > drivers/net/phy/Kconfig:159:       symbol MDIO_SUN4I depends on PHYLIB
> > drivers/net/phy/Kconfig:5:         symbol PHYLIB is selected by ARC_EMAC_CORE
> > drivers/net/ethernet/arc/Kconfig:20:      symbol ARC_EMAC_CORE is selected by EMAC_ROCKCHIP
> > drivers/net/ethernet/arc/Kconfig:35:      symbol EMAC_ROCKCHIP depends on REGULATOR
> >
> > Regards,
> > Beniamino

  reply	other threads:[~2014-09-04 19:30 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-03 16:52 [PATCH v5 1/4] ethernet: arc: Add support for Rockchip SoC layer device tree bindings Romain Perier
2014-09-03 16:52 ` Romain Perier
2014-09-03 16:52 ` [PATCH v2 2/4] dt-bindings: Document EMAC Rockchip Romain Perier
2014-09-03 16:52   ` Romain Perier
2014-09-03 18:41   ` PERIER Romain
2014-09-04 12:13   ` Heiko Stübner
2014-09-04 12:13     ` Heiko Stübner
2014-09-03 16:52 ` [PATCH 3/4] ARM: dts: Add emac nodes to the rk3188 device tree Romain Perier
2014-09-03 16:52   ` Romain Perier
2014-09-04 12:11   ` Heiko Stübner
2014-09-04 12:11     ` Heiko Stübner
2014-09-03 16:52 ` [PATCH v2 4/4] ARM: dts: Enable emac node on the rk3188-radxarock boards Romain Perier
2014-09-03 16:52   ` Romain Perier
2014-09-03 18:17 ` [PATCH v5 1/4] ethernet: arc: Add support for Rockchip SoC layer device tree bindings Arnd Bergmann
2014-09-03 18:17   ` Arnd Bergmann
2014-09-03 21:12 ` Beniamino Galvani
2014-09-03 21:12   ` Beniamino Galvani
2014-09-04  8:45   ` PERIER Romain
2014-09-04 19:30     ` Beniamino Galvani [this message]
2014-09-04 19:30       ` Beniamino Galvani
2014-09-04  9:33   ` Arnd Bergmann
2014-09-04 21:38     ` Beniamino Galvani
2014-09-04 21:38       ` Beniamino Galvani
2014-09-04 12:05 ` Heiko Stübner
2014-09-04 12:05   ` Heiko Stübner
2014-09-05 22:10 ` David Miller
2014-09-05 22:10   ` David Miller

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=20140904192934.GB14583@gmail.com \
    --to=b.galvani@gmail.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    /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.