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: <c99f9d0b-876b-478b-9acc-7961d442497c@huawei.com>
Date: Thu, 1 Aug 2024 19:31:57 +0800
From: Jijie Shao <shaojijie@...wei.com>
To: Joe Damato <jdamato@...tly.com>, <yisen.zhuang@...wei.com>,
	<salil.mehta@...wei.com>, <davem@...emloft.net>, <edumazet@...gle.com>,
	<kuba@...nel.org>, <pabeni@...hat.com>, <horms@...nel.org>,
	<shenjian15@...wei.com>, <wangpeiyang1@...wei.com>, <liuyonglong@...wei.com>,
	<sudongming1@...wei.com>, <xujunsheng@...wei.com>, <shiyongbang@...wei.com>,
	<netdev@...r.kernel.org>, <linux-kernel@...r.kernel.org>
CC: <shaojijie@...wei.com>
Subject: Re: [RFC PATCH net-next 04/10] net: hibmcge: Add interrupt supported
 in this module


on 2024/7/31 21:14, Joe Damato wrote:
>> +		dev_err(&priv->pdev->dev,
>> +			"failed to allocate MSI vectors, vectors = %d\n", ret);
>> +		return ret;
>> +	}
>> +
>> +	if (ret != HBG_VECTOR_NUM) {
>> +		dev_err(&priv->pdev->dev,
>> +			"requested %u MSI, but allocated %d MSI\n",
>> +			HBG_VECTOR_NUM, ret);
>> +		ret = -EINVAL;
>> +		goto free_vectors;
>> +	}
>> +
>> +	vectors->irqs = devm_kcalloc(&priv->pdev->dev, HBG_VECTOR_NUM,
>> +				     sizeof(struct hbg_irq), GFP_KERNEL);
>> +	if (!vectors->irqs) {
>> +		ret = -ENOMEM;
>> +		goto free_vectors;
>> +	}
>> +
>> +	/* mdio irq not request */
>> +	vectors->irq_count = HBG_VECTOR_NUM - 1;
> Here the comment says mdio is not requested? But it does seem like
> the IRQ is allocated above, it's just unused?

Yes, not request_irq only alloc

>
> Maybe above you should remove mdio completely if its not in use?
>
> Or is it used later in some other patch or something?

MDIO is required because the PHY is used.

However, the mdio interrupt provided by the hardware is not used.


If only 3 interrupts are alloc, an error is reported
when the driver is loaded and unloaded again,

log:
     insmod hibmcge.ko
     Generic PHY mii-0000:83:00.1:02: attached PHY driver (mii_bus:phy_addr=mii-0000:83:00.1:02, irq=POLL)
     hibmcge 0000:83:00.1 enp131s0f1: renamed from eth0
     IPv6: ADDRCONF(NETDEV_CHANGE): enp131s0f1: link becomes ready
     hibmcge 0000:83:00.1: link up!

     rmmod hibmcge.ko
     insmod hibmcge.ko
     hibmcge 0000:83:00.1: failed to allocate MSI vectors, vectors = -28
     hibmcge: probe of 0000:83:00.1 failed with error -28

>
>> +	for (i = 0; i < vectors->irq_count; i++) {

Therefore, only three interrupts are requested by request_irq
because "vectors->irq_count = HBG_VECTOR_NUM - 1"


Thanks,

Jijie Shao


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ