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]
Date:   Tue, 13 Sep 2022 11:45:08 +0200
From:   Michael Walle <michael@...le.cc>
To:     michael@...le.cc
Cc:     UNGLinuxDriver@...rochip.com, andrew@...n.ch, davem@...emloft.net,
        edumazet@...gle.com, hkallweit1@...il.com,
        horatiu.vultur@...rochip.com, kuba@...nel.org,
        linux-kernel@...r.kernel.org, linux@...linux.org.uk,
        netdev@...r.kernel.org, pabeni@...hat.com
Subject: Re: [PATCH net-next] net: phy: micrel: Add interrupts support for LAN8804 PHY

>> Add support for interrupts for LAN8804 PHY.
>> 
>> Signed-off-by: Horatiu Vultur <horatiu.vultur@...rochip.com>
>> ---
>>  drivers/net/phy/micrel.c | 55 ++++++++++++++++++++++++++++++++++++++++
>>  1 file changed, 55 insertions(+)
>> 
>> diff --git a/drivers/net/phy/micrel.c b/drivers/net/phy/micrel.c
>> index 7b8c5c8d013e..98e9bc101d96 100644
>> --- a/drivers/net/phy/micrel.c
>> +++ b/drivers/net/phy/micrel.c
>> @@ -2676,6 +2676,59 @@ static int lan8804_config_init(struct phy_device *phydev)
>>  	return 0;
>>  }
>>  
>> +static irqreturn_t lan8804_handle_interrupt(struct phy_device *phydev)
>> +{
>> +	int status;
>> +
>> +	status = phy_read(phydev, LAN8814_INTS);
>> +	if (status < 0) {
>> +		phy_error(phydev);
>> +		return IRQ_NONE;
>> +	}
>> +
>> +	if (status > 0)
>> +		phy_trigger_machine(phydev);
>> +
>> +	return IRQ_HANDLED;
>> +}
>> +
>> +#define LAN8804_OUTPUT_CONTROL			25
>> +#define LAN8804_OUTPUT_CONTROL_INTR_BUFFER	BIT(14)
>> +#define LAN8804_CONTROL				31
>> +#define LAN8804_CONTROL_INTR_POLARITY		BIT(14)
>> +
>> +static int lan8804_config_intr(struct phy_device *phydev)
>> +{
>> +	int err;
>> +
>> +	/* Change interrupt polarity */
>> +	phy_write(phydev, LAN8804_CONTROL, LAN8804_CONTROL_INTR_POLARITY);
>
> I assume you change the polarity to high active? Could you add a note?
> The LAN966x nor the LAN8804 datasheet describe this bit. You might also add
> a note, that this is an internal PHY and you cannot change the polarity on
> the GIC. Which begs the question, is this really only an internal PHY or
> can you actually buy it as a dedicated one. Then you'd change the polarity
> in a really unusual way.
> 
> 
> > +
> > +	/* Change interrupt buffer type */
> 
> To what? Push-pull?

Regardless of my remarks, the code itself is working fine:

Tested-by: Michael Walle <michael@...le.cc> # on kontron-kswitch-d10

-michael

> +	phy_write(phydev, LAN8804_OUTPUT_CONTROL,
> +		  LAN8804_OUTPUT_CONTROL_INTR_BUFFER);
> +

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ