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: <c798181a-c8b6-516d-b6b0-258965db225b@gmail.com>
Date:   Sat, 23 Feb 2019 10:00:36 +0100
From:   Heiner Kallweit <hkallweit1@...il.com>
To:     Linus Walleij <linus.walleij@...aro.org>,
        Andrew Lunn <andrew@...n.ch>,
        Florian Fainelli <f.fainelli@...il.com>
Cc:     netdev@...r.kernel.org
Subject: Re: [PATCH] net: phy: realtek: Dummy IRQ calls for RTL8366RB

On 23.02.2019 03:36, Linus Walleij wrote:
> This fixes a regression introduced by
> commit 0d2e778e38e0ddffab4bb2b0e9ed2ad5165c4bf7
> "net: phy: replace PHY_HAS_INTERRUPT with a check for
> config_intr and ack_interrupt".
> 
> This assumes that a PHY cannot trigger interrupt unless
> it has .config_intr() or .ack_interrupt() implemented.
> A later patch makes the code assume both need to be
> implemented for interrupts to be present.
> 
> But this PHY (which is inside a DSA) will happily
> fire interrupts without either callback.
> 
> Implement a dummy callback for .config_intr() and
> .ack_interrupt() as a workaround.
> 
> Tested on the RTL8366RB on D-Link DIR-685.
> 
> Fixes: 0d2e778e38e0 ("net: phy: replace PHY_HAS_INTERRUPT with a check for config_intr and ack_interrupt")
> Cc: Heiner Kallweit <hkallweit1@...il.com>
> Signed-off-by: Linus Walleij <linus.walleij@...aro.org>
> ---
>  drivers/net/phy/realtek.c | 13 +++++++++++++
>  1 file changed, 13 insertions(+)
> 
> diff --git a/drivers/net/phy/realtek.c b/drivers/net/phy/realtek.c
> index c6010fb1aa0f..31372be44570 100644
> --- a/drivers/net/phy/realtek.c
> +++ b/drivers/net/phy/realtek.c
> @@ -211,6 +211,17 @@ static int rtl8366rb_config_init(struct phy_device *phydev)
>  	return ret;
>  }
>  
> +static int rtl8366rb_ack_interrupt(struct phy_device *phydev)
> +{
> +	return 0;
> +}
> +
> +static int rtl8366rb_config_intr(struct phy_device *phydev)
> +{
> +	/* Dummy function to make sure we get interrupts */
> +	return 0;
> +}
> +

Maybe we should place these dummy calls in the core. We have this for
other cases already, see e.g. genphy_no_soft_reset. Then these dummies
can be re-used by other drivers that may have the need to do so.
Names could be:
genphy_no_ack_interrupt
genphy_no_config_intr

>  static struct phy_driver realtek_drvs[] = {
>  	{
>  		PHY_ID_MATCH_EXACT(0x00008201),
> @@ -282,6 +293,8 @@ static struct phy_driver realtek_drvs[] = {
>  		.name		= "RTL8366RB Gigabit Ethernet",
>  		.features	= PHY_GBIT_FEATURES,
>  		.config_init	= &rtl8366rb_config_init,
> +		.ack_interrupt	= &rtl8366rb_ack_interrupt,
> +		.config_intr	= &rtl8366rb_config_intr,
>  		.suspend	= genphy_suspend,
>  		.resume		= genphy_resume,
>  	},
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ