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: <cf8ea0b6-11ac-3dbd-29a1-337c06d9a991@gmail.com>
Date:   Wed, 24 Feb 2021 14:01:38 -0800
From:   Florian Fainelli <f.fainelli@...il.com>
To:     Heiner Kallweit <hkallweit1@...il.com>,
        Daniel González Cabanelas <dgcbueu@...il.com>,
        davem@...emloft.net
Cc:     kuba@...nel.org, gregkh@...uxfoundation.org,
        netdev@...r.kernel.org, noltari@...il.com
Subject: Re: [PATCH v2] bcm63xx_enet: fix internal phy IRQ assignment



On 2/24/2021 1:44 PM, Heiner Kallweit wrote:
> On 24.02.2021 16:44, Daniel González Cabanelas wrote:
>> The current bcm63xx_enet driver doesn't asign the internal phy IRQ. As a
>> result of this it works in polling mode.
>>
>> Fix it using the phy_device structure to assign the platform IRQ.
>>
>> Tested under a BCM6348 board. Kernel dmesg before the patch:
>>    Broadcom BCM63XX (1) bcm63xx_enet-0:01: attached PHY driver [Broadcom
>>               BCM63XX (1)] (mii_bus:phy_addr=bcm63xx_enet-0:01, irq=POLL)
>>
>> After the patch:
>>    Broadcom BCM63XX (1) bcm63xx_enet-0:01: attached PHY driver [Broadcom
>>               BCM63XX (1)] (mii_bus:phy_addr=bcm63xx_enet-0:01, irq=17)
>>
>> Pluging and uplugging the ethernet cable now generates interrupts and the
>> PHY goes up and down as expected.
>>
>> Signed-off-by: Daniel González Cabanelas <dgcbueu@...il.com>
>> ---
>> changes in V2: 
>>   - snippet moved after the mdiobus registration
>>   - added missing brackets
>>
>>  drivers/net/ethernet/broadcom/bcm63xx_enet.c | 13 +++++++++++--
>>  1 file changed, 11 insertions(+), 2 deletions(-)
>>
>> diff --git a/drivers/net/ethernet/broadcom/bcm63xx_enet.c b/drivers/net/ethernet/broadcom/bcm63xx_enet.c
>> index fd876721316..dd218722560 100644
>> --- a/drivers/net/ethernet/broadcom/bcm63xx_enet.c
>> +++ b/drivers/net/ethernet/broadcom/bcm63xx_enet.c
>> @@ -1818,10 +1818,19 @@ static int bcm_enet_probe(struct platform_device *pdev)
>>  		 * if a slave is not present on hw */
>>  		bus->phy_mask = ~(1 << priv->phy_id);
>>  
>> -		if (priv->has_phy_interrupt)
>> +		ret = mdiobus_register(bus);
>> +
>> +		if (priv->has_phy_interrupt) {
>> +			phydev = mdiobus_get_phy(bus, priv->phy_id);
>> +			if (!phydev) {
>> +				dev_err(&dev->dev, "no PHY found\n");
>> +				goto out_unregister_mdio;
>> +			}
>> +
>>  			bus->irq[priv->phy_id] = priv->phy_interrupt;
>> +			phydev->irq = priv->phy_interrupt;
>> +		}
>>  
>> -		ret = mdiobus_register(bus);
> 
> You shouldn't have to set phydev->irq, this is done by phy_device_create().
> For this to work bus->irq[] needs to be set before calling mdiobus_register().

Yes good point, and that is what the unchanged code does actually.
Daniel, any idea why that is not working?
-- 
Florian

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ