All of lore.kernel.org
 help / color / mirror / Atom feed
From: Heiner Kallweit <hkallweit1@gmail.com>
To: Enguerrand de Ribaucourt 
	<enguerrand.de-ribaucourt@savoirfairelinux.com>
Cc: netdev <netdev@vger.kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	woojung huh <woojung.huh@microchip.com>,
	davem <davem@davemloft.net>,
	UNGLinuxDriver <UNGLinuxDriver@microchip.com>,
	Andrew Lunn <andrew@lunn.ch>,
	Russell King - ARM Linux <linux@armlinux.org.uk>
Subject: Re: [PATCH v3 1/3] net: phy: add EXPORT_SYMBOL to phy_disable_interrupts()
Date: Tue, 20 Dec 2022 16:19:40 +0100	[thread overview]
Message-ID: <cc720a28-9e73-7c88-86af-8814b02ee580@gmail.com> (raw)
In-Reply-To: <1721908413.470634.1671548576554.JavaMail.zimbra@savoirfairelinux.com>

On 20.12.2022 16:02, Enguerrand de Ribaucourt wrote:
>> From: "Heiner Kallweit" <hkallweit1@gmail.com>
>> To: "Enguerrand de Ribaucourt" <enguerrand.de-ribaucourt@savoirfairelinux.com>,
>> "netdev" <netdev@vger.kernel.org>
>> Cc: "Paolo Abeni" <pabeni@redhat.com>, "woojung huh"
>> <woojung.huh@microchip.com>, "davem" <davem@davemloft.net>, "UNGLinuxDriver"
>> <UNGLinuxDriver@microchip.com>, "Andrew Lunn" <andrew@lunn.ch>, "Russell King -
>> ARM Linux" <linux@armlinux.org.uk>
>> Sent: Tuesday, December 20, 2022 3:40:15 PM
>> Subject: Re: [PATCH v3 1/3] net: phy: add EXPORT_SYMBOL to
>> phy_disable_interrupts()
> 
>> On 20.12.2022 14:19, Enguerrand de Ribaucourt wrote:
>>> It seems EXPORT_SYMBOL was forgotten when phy_disable_interrupts() was
>>> made non static. For consistency with the other exported functions in
>>> this file, EXPORT_SYMBOL should be used.
> 
>> No, it wasn't forgotten. It's intentional. The function is supposed to
>> be used within phylib only.
> 
>> None of the phylib maintainers was on the addressee list of your patch.
>> Seems you didn't check with get_maintainers.pl.
> 
>> You should explain your use case to the phylib maintainers. Maybe lan78xx
>> uses phylib in a wrong way, maybe an extension to phylib is needed.
>> Best start with explaining why lan78xx_link_status_change() needs to
>> fiddle with the PHY interrupt. It would help be helpful to understand
>> what "chip" refers to in the comment. The MAC, or the PHY?
>> Does the lan78xx code assume that a specific PHY is used, and the
>> functionality would actually belong to the respective PHY driver?
> 
> Thank you for your swift reply,
> 
> The requirement to toggle the PHY interrupt in lan78xx_link_status_change() (the
> LAN7801 MAC driver) comes from a workaround by the original author which resets
> the fixed speed in the PHY when the Ethernet cable is swapped. According to his
> message, the link could not be correctly setup without this workaround.
> 
> Unfortunately, I don't have the cables to test the code without the workaround
> and it's description doesn't explain what problem happens more precisely.
> 
> The PHY the original author used is a LAN8835. The workaround code directly
> modified the interrupt configuration registers of this LAN8835 PHY within
> lan78xx_link_status_change(). This caused problems if a different PHY was used
> because the register at this address did not correspond to the interrupts
> configuration. As suggested by the lan78xx.c maintainer, a generic function
> should be used instead to toggle the interrupts of the PHY. However, it seems
> that maybe the MAC driver shouldn't meddle with the PHY's interrupts according
> to you. Would you consider this use case a valid one?
> 
So this workaround works around a silicon bug in LAN8835?
Then the code supposedly should go to the link_change_notify handler of the
Microchip PHY driver for LAN8835.
There's just a generic PHY driver for LAN88xx. Would be helpful to know
which Microchip PHY's are affected.

> Enguerrand
> 
>>> Fixes: 3dd4ef1bdbac ("net: phy: make phy_disable_interrupts() non-static")
>>> Signed-off-by: Enguerrand de Ribaucourt
>>> <enguerrand.de-ribaucourt@savoirfairelinux.com>
>>> ---
>>> drivers/net/phy/phy.c | 1 +
>>> 1 file changed, 1 insertion(+)
> 
>>> diff --git a/drivers/net/phy/phy.c b/drivers/net/phy/phy.c
>>> index e5b6cb1a77f9..33250da76466 100644
>>> --- a/drivers/net/phy/phy.c
>>> +++ b/drivers/net/phy/phy.c
>>> @@ -992,6 +992,7 @@ int phy_disable_interrupts(struct phy_device *phydev)
>>> /* Disable PHY interrupts */
>>> return phy_config_interrupt(phydev, PHY_INTERRUPT_DISABLED);
>>> }
>>> +EXPORT_SYMBOL(phy_disable_interrupts);
> 
>>> /**
>>> * phy_interrupt - PHY interrupt handler


  parent reply	other threads:[~2022-12-20 15:19 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-25 22:22 [PATCH 2/2 net] lan78xx: workaround of forced 100 Full/Half duplex mode error Woojung.Huh
2016-04-28 20:36 ` David Miller
2021-01-22 14:19 ` Marc Kleine-Budde
2022-12-16 14:49 ` [PATCH] net: lan78xx: isolate LAN88XX specific operations Enguerrand de Ribaucourt
2022-12-20  9:40   ` Paolo Abeni
2022-12-20 11:37 ` [PATCH v2] net: lan78xx: prevent " Enguerrand de Ribaucourt
2022-12-20 12:41   ` Paolo Abeni
2022-12-20 12:47     ` Enguerrand de Ribaucourt
2022-12-20 12:45   ` Paolo Abeni
2022-12-20 13:10     ` Enguerrand de Ribaucourt
2022-12-21 16:40   ` kernel test robot
2022-12-20 13:19 ` [PATCH v3 0/3] " Enguerrand de Ribaucourt
2022-12-20 13:19 ` [PATCH v3 1/3] net: phy: add EXPORT_SYMBOL to phy_disable_interrupts() Enguerrand de Ribaucourt
2022-12-20 14:40   ` Heiner Kallweit
2022-12-20 15:02     ` Enguerrand de Ribaucourt
2022-12-20 15:17       ` Andrew Lunn
2022-12-20 15:19       ` Heiner Kallweit [this message]
2022-12-20 15:48         ` Enguerrand de Ribaucourt
2022-12-20 16:55           ` Andrew Lunn
2022-12-20 19:43             ` Woojung.Huh
2022-12-21 18:03               ` Yuiko.Oshino
2022-12-20 16:13       ` Russell King (Oracle)
2022-12-20 16:22         ` Enguerrand de Ribaucourt
2022-12-20 16:47           ` AW: " Sven Schuchmann
2022-12-20 13:19 ` [PATCH v3 2/3] net: phy: make phy_enable_interrupts() non-static Enguerrand de Ribaucourt
2022-12-20 13:19 ` [PATCH v3 3/3] net: lan78xx: prevent LAN88XX specific operations Enguerrand de Ribaucourt

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=cc720a28-9e73-7c88-86af-8814b02ee580@gmail.com \
    --to=hkallweit1@gmail.com \
    --cc=UNGLinuxDriver@microchip.com \
    --cc=andrew@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=enguerrand.de-ribaucourt@savoirfairelinux.com \
    --cc=linux@armlinux.org.uk \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=woojung.huh@microchip.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 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.