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:	Fri, 12 Apr 2013 20:05:43 +0200
From:	Javier Martinez Canillas <javier.martinez@...labora.co.uk>
To:	Steve Glendinning <steve.glendinning@...well.net>
Cc:	David Miller <davem@...emloft.net>,
	Thomas Gleixner <tglx@...utronix.de>,
	Ingo Molnar <mingo@...nel.org>,
	Rob Herring <robherring2@...il.com>,
	Stephen Warren <swarren@...dotorg.org>,
	Grant Likely <grant.likely@...retlab.ca>,
	Jon Hunter <jon-hunter@...com>,
	devicetree-discuss@...ts.ozlabs.org,
	linux-omap <linux-omap@...r.kernel.org>, netdev@...r.kernel.org,
	Javier Martinez Canillas <javier.martinez@...labora.co.uk>
Subject: [PATCH 2/2] net: smsc911x: get IRQ flags from chip if not present in IORESOURCE_IRQ

When defining an IRQ trigger type and level flags from a Device Tree
a call to of_irq_to_resource() is made to parse the "interrupts"
property cells and return a struct resource.

But the flags are not saved on this struct resource which means that
drivers that try to obtain this information from an IORESOURCE_IRQ
will not be able to get it.

So, is more safe to fallback and query this information from the irq
chip directly if it was not found on the struct resource.

Signed-off-by: Javier Martinez Canillas <javier.martinez@...labora.co.uk>
---
 drivers/net/ethernet/smsc/smsc911x.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/drivers/net/ethernet/smsc/smsc911x.c b/drivers/net/ethernet/smsc/smsc911x.c
index da5cc9a..3d535b3 100644
--- a/drivers/net/ethernet/smsc/smsc911x.c
+++ b/drivers/net/ethernet/smsc/smsc911x.c
@@ -2390,6 +2390,10 @@ static int smsc911x_drv_probe(struct platform_device *pdev)
 	pdata = netdev_priv(dev);
 	dev->irq = irq_res->start;
 	irq_flags = irq_res->flags & IRQF_TRIGGER_MASK;
+
+	if (!irq_flags)
+		irq_flags = irq_get_trigger_type(dev->irq);
+
 	pdata->ioaddr = ioremap_nocache(res->start, res_size);
 
 	pdata->dev = dev;
-- 
1.7.7.6

--
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