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: <CAL_JsqKfmg+MBazWXC4oe_mn3Uw_GSJf+oiYS3NsT02baH9GeA@mail.gmail.com>
Date:	Wed, 28 May 2014 08:30:35 -0500
From:	Rob Herring <robh@...nel.org>
To:	Chen-Yu Tsai <wens@...e.org>
Cc:	"David S. Miller" <davem@...emloft.net>,
	Giuseppe Cavallaro <peppe.cavallaro@...com>,
	netdev <netdev@...r.kernel.org>,
	Grygorii Strashko <grygorii.strashko@...com>,
	Russell King <linux@....linux.org.uk>,
	Maxime Ripard <maxime.ripard@...e-electrons.com>,
	Kevin Hilman <khilman@...aro.org>
Subject: Re: [PATCH net-next] net: stmmac: Handle different error codes from platform_get_irq_byname

On Wed, May 28, 2014 at 1:44 AM, Chen-Yu Tsai <wens@...e.org> wrote:
> On Wed, May 28, 2014 at 8:58 AM, Rob Herring <robh@...nel.org> wrote:
>> On Mon, May 26, 2014 at 11:49 PM, Chen-Yu Tsai <wens@...e.org> wrote:
>>> The following patch moved device tree interrupt resolution into
>>> platform_get_irq_byname:
>>>
>>>   ad69674 of/irq: do irq resolution in platform_get_irq_byname()
>>>
>>> As a result, the function no longer only return -ENXIO on error.
>>> This breaks DT based probing of stmmac, as seen in test runs of
>>> linux-next next-20140526 cubie2-sunxi_defconfig:

[...]

>>>         priv->lpi_irq = platform_get_irq_byname(pdev, "eth_lpi");
>>> +       if (priv->lpi_irq < 0) {
>>
>> You don't need this if.
>
> stmmac core driver checks lpi_irq != -ENXIO for valid interrupt.
> Might as well change that check to  lpi_irq >= 0.
> (0 is a valid interrupt, correct?)

No. NO_IRQ is defined to 0 (preferred) or -1 depending on the arch.
You should be testing for "> 0" for valid irq rather than only ENXIO.

My comment still stands. If lpi_irq is already <0, then there is no
reason to set it to -ENXIO (again). If there are other error codes
returned, changing the error code is not good practice.

> Interestingly, stmmac_pci never sets lpi_irq, there might be a glitch
> there.

I believe they would have to be combined to a single interrrupt for PCI.

Rob
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ