From: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
To: Ben Dooks <ben.dooks@codethink.co.uk>, netdev@vger.kernel.org
Cc: linux-sh@vger.kernel.org, nobuhiro.iwamatsu.yj@renesas.com,
magnus.damn@opensource.se, horms@verge.net.au
Subject: Re: [PATCH] sh_net: runtime pm wrap mdio read and write
Date: Wed, 26 Feb 2014 18:21:41 +0000 [thread overview]
Message-ID: <530E3EBC.5060408@cogentembedded.com> (raw)
In-Reply-To: <1393433319-22685-1-git-send-email-ben.dooks@codethink.co.uk>
On 02/26/2014 07:48 PM, Ben Dooks wrote:
> On the R8A7790, if the device has been suspended by pm_runtime
> and the MII code tries to access the bus then there is a possiblity
s/possiblity/possibility/.
> that it will fail to read any data from the MII bus.
> Change the MDIO read and write calls to be wrappered by calls to
s/wrappered/wrapped/.
> pm_runtime_{get,put}_sync so that the device will be enabled during
> these calls. It is put here to avoid having to enable and disable
> the clock for every bit that is sent by the MII bit-banging code.
> This has been exposed by the change to using OF and a fix to enable
> the pm_runtime clock management which seems to have been broken for
> some time for the device-tree booted Renesas kernels.
What fix to enable run-time PM are you talking about?
> Signed-off-by: Ben Dooks <ben.dooks@codethink.co.uk>
> ---
> drivers/net/ethernet/renesas/sh_eth.c | 39 +++++++++++++++++++++++++++++++++++
> 1 file changed, 39 insertions(+)
> diff --git a/drivers/net/ethernet/renesas/sh_eth.c b/drivers/net/ethernet/renesas/sh_eth.c
> index b92034c..8d1b84e 100644
> --- a/drivers/net/ethernet/renesas/sh_eth.c
> +++ b/drivers/net/ethernet/renesas/sh_eth.c
> @@ -983,6 +983,8 @@ static unsigned long sh_eth_get_edtrr_trns(struct sh_eth_private *mdp)
>
> struct bb_info {
> void (*set_gate)(void *addr);
> + int (*mdio_read)(struct mii_bus *bus, int phy_id, int regnum);
> + int (*mdio_write)(struct mii_bus *bus, int phy_id, int regnum, u16 val);
Please indent with tabs.
> @@ -1071,6 +1073,38 @@ static struct mdiobb_ops bb_ops = {
> .get_mdio_data = sh_get_mdio,
> };
>
> +/* Wrapper to ensure bitbang ops have device runtime-pm enabled */
> +
> +static inline struct bb_info *mii_to_bitbang(struct mii_bus *bus)
> +{
> + struct mdiobb_ctrl *ctrl = bus->priv;
Empty line between declaration and the other code needed.
> + return container_of(ctrl, struct bb_info, ctrl);
> +}
[...]
WBR, Sergei
WARNING: multiple messages have this Message-ID (diff)
From: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
To: Ben Dooks <ben.dooks@codethink.co.uk>, netdev@vger.kernel.org
Cc: linux-sh@vger.kernel.org, nobuhiro.iwamatsu.yj@renesas.com,
magnus.damn@opensource.se, horms@verge.net.au
Subject: Re: [PATCH] sh_net: runtime pm wrap mdio read and write
Date: Wed, 26 Feb 2014 22:21:32 +0300 [thread overview]
Message-ID: <530E3EBC.5060408@cogentembedded.com> (raw)
In-Reply-To: <1393433319-22685-1-git-send-email-ben.dooks@codethink.co.uk>
On 02/26/2014 07:48 PM, Ben Dooks wrote:
> On the R8A7790, if the device has been suspended by pm_runtime
> and the MII code tries to access the bus then there is a possiblity
s/possiblity/possibility/.
> that it will fail to read any data from the MII bus.
> Change the MDIO read and write calls to be wrappered by calls to
s/wrappered/wrapped/.
> pm_runtime_{get,put}_sync so that the device will be enabled during
> these calls. It is put here to avoid having to enable and disable
> the clock for every bit that is sent by the MII bit-banging code.
> This has been exposed by the change to using OF and a fix to enable
> the pm_runtime clock management which seems to have been broken for
> some time for the device-tree booted Renesas kernels.
What fix to enable run-time PM are you talking about?
> Signed-off-by: Ben Dooks <ben.dooks@codethink.co.uk>
> ---
> drivers/net/ethernet/renesas/sh_eth.c | 39 +++++++++++++++++++++++++++++++++++
> 1 file changed, 39 insertions(+)
> diff --git a/drivers/net/ethernet/renesas/sh_eth.c b/drivers/net/ethernet/renesas/sh_eth.c
> index b92034c..8d1b84e 100644
> --- a/drivers/net/ethernet/renesas/sh_eth.c
> +++ b/drivers/net/ethernet/renesas/sh_eth.c
> @@ -983,6 +983,8 @@ static unsigned long sh_eth_get_edtrr_trns(struct sh_eth_private *mdp)
>
> struct bb_info {
> void (*set_gate)(void *addr);
> + int (*mdio_read)(struct mii_bus *bus, int phy_id, int regnum);
> + int (*mdio_write)(struct mii_bus *bus, int phy_id, int regnum, u16 val);
Please indent with tabs.
> @@ -1071,6 +1073,38 @@ static struct mdiobb_ops bb_ops = {
> .get_mdio_data = sh_get_mdio,
> };
>
> +/* Wrapper to ensure bitbang ops have device runtime-pm enabled */
> +
> +static inline struct bb_info *mii_to_bitbang(struct mii_bus *bus)
> +{
> + struct mdiobb_ctrl *ctrl = bus->priv;
Empty line between declaration and the other code needed.
> + return container_of(ctrl, struct bb_info, ctrl);
> +}
[...]
WBR, Sergei
next prev parent reply other threads:[~2014-02-26 18:21 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-02-26 16:48 [PATCH] sh_net: runtime pm wrap mdio read and write Ben Dooks
2014-02-26 18:21 ` Sergei Shtylyov [this message]
2014-02-26 19:21 ` Sergei Shtylyov
2014-02-26 18:25 ` Ben Dooks
2014-02-26 18:23 ` Sergei Shtylyov
2014-02-26 19:23 ` Sergei Shtylyov
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=530E3EBC.5060408@cogentembedded.com \
--to=sergei.shtylyov@cogentembedded.com \
--cc=ben.dooks@codethink.co.uk \
--cc=horms@verge.net.au \
--cc=linux-sh@vger.kernel.org \
--cc=magnus.damn@opensource.se \
--cc=netdev@vger.kernel.org \
--cc=nobuhiro.iwamatsu.yj@renesas.com \
/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.