From: Andre Werner <andre.werner@systec-electronic.com>
To: Horatiu Vultur <horatiu.vultur@microchip.com>
Cc: Andre Werner <andre.werner@systec-electronic.com>,
andrew@lunn.ch, hkallweit1@gmail.com, davem@davemloft.net,
edumazet@google.com, kuba@kernel.org, pabeni@redhat.com,
linux@armlinux.org.uk, netdev@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [RFC net-next v4 2/2] net: phy: adin1100: Add interrupt support for link change
Date: Mon, 29 Jan 2024 13:51:11 +0100 (CET) [thread overview]
Message-ID: <e8a14edd-0879-a6f8-0e7a-edf09998f6e9@systec-electronic.com> (raw)
In-Reply-To: <20240122074258.zmbzngrl7dzhkvwo@DEN-DL-M31836.microchip.com>
Dear Maintainers,
I'm a bit confused about the patch submitting process for net-next.
Do I need to send the patchset again, if the merge window is opened again and
the patchset was previously submitted as RFC?
Best regards.
Andre
On Mon, 22 Jan 2024, Horatiu Vultur wrote:
> The 01/21/2024 20:54, Andre Werner wrote:
>
> Hi Andre,
>
>
>> An interrupt handler was added to the driver as well as functions
>> to enable interrupts at the phy.
>>
>> There are several interrupts maskable at the phy, but only link change
>> interrupts are handled by the driver yet.
>>
>> Signed-off-by: Andre Werner <andre.werner@systec-electronic.com>
>> ---
>> v4:
>> - Change read-modify-write behavior as suggested to phy_modify_mmd.
>
> Usually it is good to keep the change log also from the previous
> versions, so it is easier to see what has been changed.
>
>> ---
>> drivers/net/phy/adin1100.c | 56 ++++++++++++++++++++++++++++++++++++++
>> 1 file changed, 56 insertions(+)
>>
>> diff --git a/drivers/net/phy/adin1100.c b/drivers/net/phy/adin1100.c
>> index 7619d6185801..7c82384e5d30 100644
>> --- a/drivers/net/phy/adin1100.c
>> +++ b/drivers/net/phy/adin1100.c
>> @@ -18,6 +18,12 @@
>> #define PHY_ID_ADIN1110 0x0283bc91
>> #define PHY_ID_ADIN2111 0x0283bca1
>>
>> +#define ADIN_PHY_SUBSYS_IRQ_MASK 0x0021
>> +#define ADIN_LINK_STAT_CHNG_IRQ_EN BIT(1)
>> +
>> +#define ADIN_PHY_SUBSYS_IRQ_STATUS 0x0011
>> +#define ADIN_LINK_STAT_CHNG BIT(1)
>> +
>> #define ADIN_FORCED_MODE 0x8000
>> #define ADIN_FORCED_MODE_EN BIT(0)
>>
>> @@ -136,6 +142,54 @@ static int adin_config_aneg(struct phy_device *phydev)
>> return genphy_c45_config_aneg(phydev);
>> }
>>
>> +static int adin_phy_ack_intr(struct phy_device *phydev)
>> +{
>> + /* Clear pending interrupts */
>> + int rc = phy_read_mmd(phydev, MDIO_MMD_VEND2,
>> + ADIN_PHY_SUBSYS_IRQ_STATUS);
>> +
>> + return rc < 0 ? rc : 0;
>> +}
>> +
>> +static int adin_config_intr(struct phy_device *phydev)
>> +{
>> + int ret;
>> + u16 irq_mask;
>
> Please use reverse x-mas notation here.
>
>> +
>> + ret = adin_phy_ack_intr(phydev);
>> +
>
> No new line here, between ret and if.
>
>> + if (ret)
>> + return ret;
>> +
>> + if (phydev->interrupts == PHY_INTERRUPT_ENABLED)
>> + irq_mask = ADIN_LINK_STAT_CHNG_IRQ_EN;
>> + else
>> + irq_mask = 0;
>> +
>> + return phy_modify_mmd(phydev, MDIO_MMD_VEND2,
>> + ADIN_PHY_SUBSYS_IRQ_MASK,
>> + ADIN_LINK_STAT_CHNG_IRQ_EN, irq_mask);
>> +}
>> +
>> +static irqreturn_t adin_phy_handle_interrupt(struct phy_device *phydev)
>> +{
>> + int irq_status;
>> +
>> + irq_status = phy_read_mmd(phydev, MDIO_MMD_VEND2,
>> + ADIN_PHY_SUBSYS_IRQ_STATUS);
>> + if (irq_status < 0) {
>> + phy_error(phydev);
>> + return IRQ_NONE;
>> + }
>> +
>> + if (!(irq_status & ADIN_LINK_STAT_CHNG))
>> + return IRQ_NONE;
>> +
>> + phy_trigger_machine(phydev);
>> +
>> + return IRQ_HANDLED;
>> +}
>> +
>> static int adin_set_powerdown_mode(struct phy_device *phydev, bool en)
>> {
>> int ret;
>> @@ -275,6 +329,8 @@ static struct phy_driver adin_driver[] = {
>> .probe = adin_probe,
>> .config_aneg = adin_config_aneg,
>> .read_status = adin_read_status,
>> + .config_intr = adin_config_intr,
>> + .handle_interrupt = adin_phy_handle_interrupt,
>> .set_loopback = adin_set_loopback,
>> .suspend = adin_suspend,
>> .resume = adin_resume,
>> --
>> 2.43.0
>>
>>
>
> --
> /Horatiu
>
next prev parent reply other threads:[~2024-01-29 12:51 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-01-21 19:54 [RFC net-next v4 0/2] Prevent nullptr exceptions in ISR Andre Werner
2024-01-21 19:54 ` [RFC net-next v4 1/2] net: phy: phy_device: Prevent nullptr exceptions on ISR Andre Werner
2024-01-21 20:23 ` Andrew Lunn
2024-01-29 13:29 ` Andrew Lunn
2024-01-21 19:54 ` [RFC net-next v4 2/2] net: phy: adin1100: Add interrupt support for link change Andre Werner
2024-01-22 7:42 ` Horatiu Vultur
2024-01-29 12:51 ` Andre Werner [this message]
2024-01-29 13:28 ` Andrew Lunn
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=e8a14edd-0879-a6f8-0e7a-edf09998f6e9@systec-electronic.com \
--to=andre.werner@systec-electronic.com \
--cc=andrew@lunn.ch \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=hkallweit1@gmail.com \
--cc=horatiu.vultur@microchip.com \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@armlinux.org.uk \
--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
all inboxes | Powered by JetHome®