All of lore.kernel.org
 help / color / mirror / Atom feed
From: Geert Uytterhoeven <geert@linux-m68k.org>
To: Sergey Shtylyov <s.shtylyov@omp.ru>
Cc: "David S . Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	Heiner Kallweit <hkallweit1@gmail.com>,
	Florian Fainelli <f.fainelli@gmail.com>,
	netdev@vger.kernel.org, linux-renesas-soc@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] net: ravb: Fix PHY state warning splat during system resume
Date: Tue, 20 Sep 2022 09:07:19 +0200	[thread overview]
Message-ID: <CAMuHMdX7tn4EgG5YCN8FZTmY3+42zLGAxoUnCt5GNk24Hs+c5w@mail.gmail.com> (raw)
In-Reply-To: <00e5b86b-fe51-98c9-92b7-349b6a03fc1b@omp.ru>

Hi Sergey,

On Mon, Sep 19, 2022 at 8:40 PM Sergey Shtylyov <s.shtylyov@omp.ru> wrote:
> On 9/19/22 5:48 PM, Geert Uytterhoeven wrote:
> > Since commit 744d23c71af39c7d ("net: phy: Warn about incorrect
> > mdio_bus_phy_resume() state"), a warning splat is printed during system
> > resume with Wake-on-LAN disabled:
> >
> >         WARNING: CPU: 0 PID: 1197 at drivers/net/phy/phy_device.c:323 mdio_bus_phy_resume+0xbc/0xc8
> >
> > As the Renesas Ethernet AVB driver already calls phy_{stop,start}() in
> > its suspend/resume callbacks, it is sufficient to just mark the MAC
> > responsible for managing the power state of the PHY.
> >
> > Fixes: fba863b816049b03 ("net: phy: make PHY PM ops a no-op if MAC driver manages PHY PM")
> > Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
>
> Reviewed-by: Sergey Shtylyov <s.shtylyov@omp.ru>

Thanks for your review!

> > --- a/drivers/net/ethernet/renesas/ravb_main.c
> > +++ b/drivers/net/ethernet/renesas/ravb_main.c
> > @@ -1449,6 +1449,8 @@ static int ravb_phy_init(struct net_device *ndev)
> >               phy_remove_link_mode(phydev, ETHTOOL_LINK_MODE_100baseT_Half_BIT);
> >       }
> >
> > +     /* Indicate that the MAC is responsible for managing PHY PM */
> > +     phydev->mac_managed_pm = true;
>
>    Hm, this field is declared as *unsigned*...

True, I copied this from drivers/net/ethernet/broadcom/genet/bcmmii.c.
But true/false are fully compatible with single-bit values.

The linuxdoc suggests to use true, like for all other single-bit fields used
as booleans:

include/linux/phy.h: * @mac_managed_pm: Set true if MAC driver takes
of suspending/resuming PHY

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

  reply	other threads:[~2022-09-20  7:07 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-19 14:48 [PATCH] net: ravb: Fix PHY state warning splat during system resume Geert Uytterhoeven
2022-09-19 16:55 ` Florian Fainelli
2022-09-19 18:40 ` Sergey Shtylyov
2022-09-20  7:07   ` Geert Uytterhoeven [this message]
2022-09-20 12:43     ` Sergey Shtylyov
2022-09-19 18:41 ` Sergey Shtylyov
2022-09-21  0:10 ` patchwork-bot+netdevbpf

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=CAMuHMdX7tn4EgG5YCN8FZTmY3+42zLGAxoUnCt5GNk24Hs+c5w@mail.gmail.com \
    --to=geert@linux-m68k.org \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=f.fainelli@gmail.com \
    --cc=hkallweit1@gmail.com \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-renesas-soc@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=s.shtylyov@omp.ru \
    /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.