lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAMuHMdWwdKJQT9aoGmkc7RkeOfGtzO7fKAgH4=x-5fckrOR7tA@mail.gmail.com>
Date:   Mon, 19 Sep 2022 16:51:44 +0200
From:   Geert Uytterhoeven <geert@...ux-m68k.org>
To:     Florian Fainelli <f.fainelli@...il.com>
Cc:     Marek Szyprowski <m.szyprowski@...sung.com>,
        netdev <netdev@...r.kernel.org>,
        Steve Glendinning <steve.glendinning@...well.net>,
        Doug Berger <opendmb@...il.com>, Andrew Lunn <andrew@...n.ch>,
        Heiner Kallweit <hkallweit1@...il.com>,
        Russell King <linux@...linux.org.uk>,
        "David S. Miller" <davem@...emloft.net>,
        Eric Dumazet <edumazet@...gle.com>,
        Jakub Kicinski <kuba@...nel.org>,
        Paolo Abeni <pabeni@...hat.com>,
        open list <linux-kernel@...r.kernel.org>,
        Linux-Renesas <linux-renesas-soc@...r.kernel.org>,
        Sergey Shtylyov <s.shtylyov@....ru>
Subject: Re: [PATCH net] net: phy: Warn about incorrect mdio_bus_phy_resume() state

On Tue, Aug 16, 2022 at 3:20 PM Geert Uytterhoeven <geert@...ux-m68k.org> wrote:
> On Fri, Aug 12, 2022 at 6:39 PM Florian Fainelli <f.fainelli@...il.com> wrote:
> > On 8/12/22 04:19, Marek Szyprowski wrote:
> > > On 02.08.2022 01:34, Florian Fainelli wrote:
> > >> Calling mdio_bus_phy_resume() with neither the PHY state machine set to
> > >> PHY_HALTED nor phydev->mac_managed_pm set to true is a good indication
> > >> that we can produce a race condition looking like this:
> > >>
> > >> CPU0                                         CPU1
> > >> bcmgenet_resume
> > >>    -> phy_resume
> > >>      -> phy_init_hw
> > >>    -> phy_start
> > >>      -> phy_resume
> > >>                                                   phy_start_aneg()
> > >> mdio_bus_phy_resume
> > >>    -> phy_resume
> > >>       -> phy_write(..., BMCR_RESET)
> > >>        -> usleep()                                  -> phy_read()
> > >>
> > >> with the phy_resume() function triggering a PHY behavior that might have
> > >> to be worked around with (see bf8bfc4336f7 ("net: phy: broadcom: Fix
> > >> brcm_fet_config_init()") for instance) that ultimately leads to an error
> > >> reading from the PHY.
> > >>
> > >> Fixes: fba863b81604 ("net: phy: make PHY PM ops a no-op if MAC driver manages PHY PM")
> > >> Signed-off-by: Florian Fainelli <f.fainelli@...il.com>
> > >
> > > This patch, as probably intended, triggers a warning during system
> > > suspend/resume cycle in the SMSC911x driver. I've observed it on ARM
> > > Juno R1 board on the kernel compiled from next-202208010:
> > >
> > >    ------------[ cut here ]------------
> > >    WARNING: CPU: 1 PID: 398 at drivers/net/phy/phy_device.c:323
> > > mdio_bus_phy_resume+0x34/0xc8
>
> I am seeing the same on the ape6evm and kzm9g development
> boards with smsc911x Ethernet, and on various boards with Renesas

So the smsc911x issue was fixed by commit 3ce9f2bef7552893
("net: smsc911x: Stop and start PHY during suspend and resume").

> Ethernet (sh_eth or ravb) if Wake-on-LAN is disabled.

The issue is still seen with sh_eth and ravb.  I have sent to fixes:
https://lore.kernel.org/r/c6e1331b9bef61225fa4c09db3ba3e2e7214ba2d.1663598886.git.geert+renesas@glider.be
https://lore.kernel.org/r/c6e1331b9bef61225fa4c09db3ba3e2e7214ba2d.1663598886.git.geert+renesas@glider.be

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@...ux-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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ