Commit 8d7d9cca authored by Robert Jarzmik's avatar Robert Jarzmik Committed by David S. Miller

Revert "smc91x: retrieve IRQ and trigger flags in a modern way"

The commit breaks the legacy platforms, ie. these not using device-tree,
and setting up the interrupt resources with a flag to activate edge
detection. The issue was found on the zylonite platform.

The reason is that zylonite uses platform resources to pass the interrupt number
and the irq flags (here IORESOURCE_IRQ_HIGHEDGE). It expects the driver to
request the irq with these flags, which in turn setups the irq as high edge
triggered.

After the patch, this was supposed to be taken care of with :
  irq_resflags = irqd_get_trigger_type(irq_get_irq_data(ndev->irq));

But irq_resflags is 0 for legacy platforms, while for example in
arch/arm/mach-pxa/zylonite.c, in struct resource smc91x_resources[] the
irq flag is specified. This breaks zylonite because the interrupt is not
setup as triggered, and hardware doesn't provide interrupts.
Signed-off-by: default avatarRobert Jarzmik <robert.jarzmik@free.fr>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent cb7cf8a3
...@@ -2248,10 +2248,9 @@ static int smc_drv_probe(struct platform_device *pdev) ...@@ -2248,10 +2248,9 @@ static int smc_drv_probe(struct platform_device *pdev)
const struct of_device_id *match = NULL; const struct of_device_id *match = NULL;
struct smc_local *lp; struct smc_local *lp;
struct net_device *ndev; struct net_device *ndev;
struct resource *res; struct resource *res, *ires;
unsigned int __iomem *addr; unsigned int __iomem *addr;
unsigned long irq_flags = SMC_IRQ_FLAGS; unsigned long irq_flags = SMC_IRQ_FLAGS;
unsigned long irq_resflags;
int ret; int ret;
ndev = alloc_etherdev(sizeof(struct smc_local)); ndev = alloc_etherdev(sizeof(struct smc_local));
...@@ -2343,19 +2342,16 @@ static int smc_drv_probe(struct platform_device *pdev) ...@@ -2343,19 +2342,16 @@ static int smc_drv_probe(struct platform_device *pdev)
goto out_free_netdev; goto out_free_netdev;
} }
ndev->irq = platform_get_irq(pdev, 0); ires = platform_get_resource(pdev, IORESOURCE_IRQ, 0);
if (ndev->irq <= 0) { if (!ires) {
ret = -ENODEV; ret = -ENODEV;
goto out_release_io; goto out_release_io;
} }
/*
* If this platform does not specify any special irqflags, or if ndev->irq = ires->start;
* the resource supplies a trigger, override the irqflags with
* the trigger flags from the resource. if (irq_flags == -1 || ires->flags & IRQF_TRIGGER_MASK)
*/ irq_flags = ires->flags & IRQF_TRIGGER_MASK;
irq_resflags = irqd_get_trigger_type(irq_get_irq_data(ndev->irq));
if (irq_flags == -1 || irq_resflags & IRQF_TRIGGER_MASK)
irq_flags = irq_resflags & IRQF_TRIGGER_MASK;
ret = smc_request_attrib(pdev, ndev); ret = smc_request_attrib(pdev, ndev);
if (ret) if (ret)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment