From: Vadim Fedorenko <vadim.fedorenko@linux.dev>
To: Daniel Golle <daniel@makrotopia.org>,
Qingfang Deng <dqfext@gmail.com>,
SkyLake Huang <SkyLake.Huang@mediatek.com>,
Andrew Lunn <andrew@lunn.ch>,
Heiner Kallweit <hkallweit1@gmail.com>,
Russell King <linux@armlinux.org.uk>,
"David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
Matthias Brugger <matthias.bgg@gmail.com>,
AngeloGioacchino Del Regno
<angelogioacchino.delregno@collabora.com>,
netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-arm-kernel@lists.infradead.org,
linux-mediatek@lists.infradead.org
Subject: Re: [PATCH net-next] net: phy: mediatek-ge-soc: support PHY LEDs
Date: Fri, 11 Aug 2023 17:30:01 +0100 [thread overview]
Message-ID: <ac6a4318-3a47-2c77-6b81-b5f04765c04e@linux.dev> (raw)
In-Reply-To: <a21288bf80f26dda6c9729edb5b25d0995df5e38.1691724757.git.daniel@makrotopia.org>
On 11/08/2023 04:35, Daniel Golle wrote:
> Implement netdev trigger and primitive bliking offloading as well as
> simple set_brigthness function for both PHY LEDs of the in-SoC PHYs
> found in MT7981 and MT7988.
>
> On MT7988 it is necessary to read the boottrap register and apply LED
> polarities accordingly to get uniform behavior from all LEDs.
>
> Signed-off-by: Daniel Golle <daniel@makrotopia.org>
[...]
> +
> +static int mt7988_phy_fix_leds_polarities(struct phy_device *phydev)
> +{
> + struct pinctrl *pinctrl;
> + int index;
> +
> + /* Setup LED polarity according to bootstrap use of LED pins */
> + for (index = 0; index < 2; ++index)
> + phy_modify_mmd(phydev, MDIO_MMD_VEND2, index ?
> + MTK_PHY_LED1_ON_CTRL : MTK_PHY_LED0_ON_CTRL,
> + MTK_PHY_LED_ON_POLARITY,
> + mt7988_phy_led_get_polarity(phydev, index) ?
> + MTK_PHY_LED_ON_POLARITY : 0);
> +
> + /* Only now setup pinctrl to avoid bogus blinking */
> + pinctrl = devm_pinctrl_get_select(&phydev->mdio.dev, "gbe-led");
This function gets reference on phydev->mdio.dev, but there is no code
to release it. It looks like a leak which will prevent module unload,
but I don't have hardware now to prove it.
> + if (IS_ERR(pinctrl))
> + dev_err(&phydev->mdio.bus->dev, "Failed to setup PHY LED pinctrl\n");
> +
> + return 0;
> +}
next prev parent reply other threads:[~2023-08-11 16:30 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-08-11 3:35 [PATCH net-next] net: phy: mediatek-ge-soc: support PHY LEDs Daniel Golle
2023-08-11 12:14 ` Simon Horman
2023-08-11 13:13 ` Andrew Lunn
2023-08-11 16:30 ` Vadim Fedorenko [this message]
2023-08-11 16:39 ` Andrew Lunn
2023-08-11 16:44 ` Vadim Fedorenko
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=ac6a4318-3a47-2c77-6b81-b5f04765c04e@linux.dev \
--to=vadim.fedorenko@linux.dev \
--cc=SkyLake.Huang@mediatek.com \
--cc=andrew@lunn.ch \
--cc=angelogioacchino.delregno@collabora.com \
--cc=daniel@makrotopia.org \
--cc=davem@davemloft.net \
--cc=dqfext@gmail.com \
--cc=edumazet@google.com \
--cc=hkallweit1@gmail.com \
--cc=kuba@kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mediatek@lists.infradead.org \
--cc=linux@armlinux.org.uk \
--cc=matthias.bgg@gmail.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).