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]
Message-ID: <877bd82d-2333-44a8-aedc-1a6a8fe2cb44@gmx.net>
Date: Sat, 14 Sep 2024 10:18:45 +0200
From: Hans-Frieder Vogt <hfdevel@....net>
To: FUJITA Tomonori <fujita.tomonori@...il.com>
Cc: netdev@...r.kernel.org, andrew@...n.ch, hkallweit1@...il.com,
 linux@...linux.org.uk, davem@...emloft.net, edumazet@...gle.com,
 kuba@...nel.org, pabeni@...hat.com
Subject: Re: [PATCH net-next 5/5] net: tn40xx: register swnode and connect it
 to the mdiobus

On 13.09.2024 08.55, FUJITA Tomonori wrote:
> Hi,
> Thanks a lot for the work!
Thank you! You did the biggest part of bringing tn40xx into mainline!
>
> On Wed, 11 Sep 2024 21:34:47 +0200
> Hans-Frieder Vogt <hfdevel@....net> wrote:
>
>> diff --git a/drivers/net/ethernet/tehuti/tn40.c b/drivers/net/ethernet/tehuti/tn40.c
>> index 4e6f2f781ffc..240a79a08d58 100644
>> --- a/drivers/net/ethernet/tehuti/tn40.c
>> +++ b/drivers/net/ethernet/tehuti/tn40.c
>> @@ -1781,7 +1781,7 @@ static int tn40_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
>>   	ret = tn40_phy_register(priv);
>>   	if (ret) {
>>   		dev_err(&pdev->dev, "failed to set up PHY.\n");
>> -		goto err_free_irq;
>> +		goto err_unregister_swnodes;
>>   	}
>>
>>   	ret = tn40_priv_init(priv);
>> @@ -1798,6 +1798,10 @@ static int tn40_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
>>   	return 0;
>>   err_unregister_phydev:
>>   	tn40_phy_unregister(priv);
>> +err_unregister_swnodes:
>> +	device_remove_software_node(&priv->mdio->dev);
>> +	software_node_unregister_node_group(priv->nodes.group);
>> +	software_node_unregister(priv->nodes.group[SWNODE_MDIO]);
> Why this workaround is necessary? The problem lies on software node
> side?
I don't understand it either. Need to further dig into, where the usage
counters are incremented and how
to get them decremented again.
>
>> diff --git a/drivers/net/ethernet/tehuti/tn40_mdio.c b/drivers/net/ethernet/tehuti/tn40_mdio.c
>> index af18615d64a8..bbd95fabbea0 100644
>> --- a/drivers/net/ethernet/tehuti/tn40_mdio.c
>> +++ b/drivers/net/ethernet/tehuti/tn40_mdio.c
>> @@ -14,6 +14,8 @@
>>   	 (FIELD_PREP(TN40_MDIO_PRTAD_MASK, (port))))
>>   #define TN40_MDIO_CMD_READ BIT(15)
>>
>> +#define AQR105_FIRMWARE "tehuti/aqr105-tn40xx.cld"
> This firmware is for AQR PHY so aquantia directory is the better
> place?
this has been addressed by Andrew already.
>
>> +static int tn40_swnodes_register(struct tn40_priv *priv)
>> +{
>> +	struct tn40_nodes *nodes = &priv->nodes;
>> +	struct pci_dev *pdev = priv->pdev;
>> +	struct software_node *swnodes;
>> +	u32 id;
>> +
>> +	id = pci_dev_id(pdev);
>> +
>> +	snprintf(nodes->phy_name, sizeof(nodes->phy_name), "tn40_aqr105_phy");
> This doesn't work on a system having multiple TN40 cards because it
> tries create duplicated sysfs directory.
>
> I uses a machine with TN9310 (QT2025 PHY) and TN9510 (AQR105 PHY).
Thanks, I didn't think of this problem. I have a solution though, and
will correct it in the
next version of the patch.
>
>> +MODULE_FIRMWARE(AQR105_FIRMWARE);
> AQR PHY driver better to have the above? Otherwise, how about adding
> it to tn40.c? It already has MODULE_FIRMWARE(TN40_FIRMWARE_NAME).
I understand your rationale, but moving MODULE_FIRMWARE to tn40.c would
require moving the definition
of AQR105_FIRMWARE to tn40.h. And I would prefer to keep definitions as
local as possible.

Thanks!
Hans

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ