RE: [PATCH net-next 1/1] net: phy: marvell10g: Add WAKE_PHY support to WOL event

From: Song, Yoong Siang
Date: Mon Aug 16 2021 - 04:05:19 EST


> On Mon, Aug 16, 2021 at 05:40:18AM +0000, Song, Yoong Siang wrote:
> > > On Mon, Aug 16, 2021 at 03:52:06AM +0000, Song, Yoong Siang wrote:
> > > > > > Agreed. If the interrupt register is being used, i think we
> > > > > > need this patchset to add proper interrupt support. Can you
> > > > > > recommend a board they can buy off the shelf with the
> > > > > > interrupt wired up? Or maybe Intel can find a hardware
> > > > > > engineer to add a patch wire to link the interrupt output to a SoC pin
> that can do interrupts.
> > > > >
> > > > > The only board I'm aware of with the 88x3310 interrupt wired is
> > > > > the Macchiatobin double-shot. :)
> > > > >
> > > > > I forget why I didn't implement interrupt support though - I
> > > > > probably need to revisit that. Sure enough, looking at the code
> > > > > I was tinkering with, adding interrupt support would certainly
> > > > > conflict with
> > > this patch.
> > > >
> > > > Hi Russell,
> > > >
> > > > For EHL board, both WoL interrupt and link change interrupt are
> > > > the same
> > > pin.
> > > > Based on your knowledge, is this common across other platforms?
> > >
> > > Other PHYs? Yes. WoL is just another interrupt, and any interrupt
> > > can wake the system, so longer as the interrupt controller can
> > > actually wake the system.
> > >
> > > > Can we take set wol function as one of the ways to control the
> > > > interrupts?
> > >
> > > WOl does not control the interrupt, it is an interrupt source. And
> > > you need to service it as an interrupt. So long as your PMC is also
> > > an interrupt controller, it should all work.
> > >
> > > Andrew
> >
> > Sorry, I should not use the word "control". Actually what I am trying
> > to said was "can we take set_wol() as one of the ways to enable/disable
> link change interrupt?".
> > PMC is not an interrupt controller. I guess the confusion here is due
> > to I am using polling mode. Let me ask the question differently.
> >
> > What is the conflict that will happen when interrupt support is added?
> > I can help to add config_intr() and handle_interrupt() callback
> > support If they will help to solve the conflict.
>
> The conflict is - when interrupt support is added, the link change interrupt
> will be enabled all the time the PHY is in use. This will have the effect with
> your patch of making the PHY appear to have WoL enabled, even when it
> hasn't been configured through a set_wol call.
>
> Essentially, your proposal for WoL on link-change fundamentally conflicts
> with proper interrupt support.
>

Thanks for your explanation. I understand your concern better now.

In the case of WoL hasn't been enabled through a set_wol call, the PHY will
be suspended, so we no need worry the link change interrupt will create
an undesired WoL event.

In the case of set_wol is called to disable WAKE_PHY event, we can keep
the link change interrupt enable, so that it won't affect the interrupt
support.

Since any interrupts can wake the system, as long as we handle the
future going-to-implement interrupt support properly, things should work
fine. Any other thoughts?

> --
> RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
> FTTP is here! 40Mbps down 10Mbps up. Decent connectivity at last!