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] [day] [month] [year] [list]
Date:   Tue, 21 Dec 2021 10:00:49 +0100
From:   Andrew Lunn <andrew@...n.ch>
To:     Divya Koppera <Divya.Koppera@...rochip.com>
Cc:     hkallweit1@...il.com, linux@...linux.org.uk, davem@...emloft.net,
        kuba@...nel.org, netdev@...r.kernel.org,
        linux-kernel@...r.kernel.org, UNGLinuxDriver@...rochip.com
Subject: Re: [PATCH net-next] net: phy: micrel: Adding interrupt support for
 Link up/Link down in LAN8814 Quad phy

On Tue, Dec 21, 2021 at 12:35:02PM +0530, Divya Koppera wrote:
> This patch add support for Link up or Link down
> interrupt support in LAN8814 Quad phy.
> 
> Signed-off-by: Divya Koppera <Divya.Koppera@...rochip.com>
> ---
>  drivers/net/phy/micrel.c | 71 ++++++++++++++++++++++++++++++++++++++++
>  1 file changed, 71 insertions(+)
> 
> diff --git a/drivers/net/phy/micrel.c b/drivers/net/phy/micrel.c
> index 44a24b99c894..46931020ef84 100644
> --- a/drivers/net/phy/micrel.c
> +++ b/drivers/net/phy/micrel.c
> @@ -66,6 +66,23 @@
>  #define KSZ8081_LMD_SHORT_INDICATOR		BIT(12)
>  #define KSZ8081_LMD_DELTA_TIME_MASK		GENMASK(8, 0)
>  
> +/* Lan8814 general Interrupt control/status reg in GPHY specific block. */
> +#define LAN8814_INTC				0x18
> +#define LAN8814_INTC_LINK_DOWN			BIT(2)
> +#define LAN8814_INTC_LINK_UP			BIT(0)
> +#define LAN8814_INTC_LINK			(LAN8814_INTC_LINK_UP |\
> +						 LAN8814_INTC_LINK_DOWN)
> +
> +#define LAN8814_INTS				0x1B
> +#define LAN8814_INTS_LINK_DOWN			BIT(2)
> +#define LAN8814_INTS_LINK_UP			BIT(0)
> +#define LAN8814_INTS_LINK			(LAN8814_INTS_LINK_UP |\

I've never seen an interrupt controller where the interrupt control
bits and the interrupt status bits are different. So just define the
two interesting bits as LAN8814_INT_LINK_DOWN and LAN8814_INT_LINK_UP
and share them across the two registers.

Otherwise this looks good.

    Andrew

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ