Re: [PATCH] net: davinci_emac: Move call of devm_request_irq to emac_dev_open

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 





--On March 04, 2014 09:53 -0800 Florian Fainelli <f.fainelli@xxxxxxxxx> wrote:

2014-03-04 9:30 GMT-08:00 Prabhakar Lad <prabhakar.csengg@xxxxxxxxx>:
Hi Christian,

Thanks for the patch.


On Tue, Mar 4, 2014 at 7:37 PM, Christian Riesch
<christian.riesch@xxxxxxxxxx> wrote:
In commit 6892b41d9701283085b655c6086fb57a5d63fa47

Author: Lad, Prabhakar <prabhakar.csengg@xxxxxxxxx>
Date:   Tue Jun 25 21:24:51 2013 +0530
net: davinci: emac: Convert to devm_* api

the call of request_irq is replaced by devm_request_irq and the call
of free_irq is removed. But since interrupts are requested in
emac_dev_open, doing ifconfig up/down on the board requests the
interrupts again each time, causing devm_request_irq to fail.

This patch moves the interrupt requests to emac_dev_open and thus
fixes this regression.

Reported-by: Jon Ringle <jon@xxxxxxxxxx>
Signed-off-by: Christian Riesch <christian.riesch@xxxxxxxxxx>
Cc: Lad, Prabhakar <prabhakar.csengg@xxxxxxxxx>
Cc: <stable@xxxxxxxxxxxxxxx>

This patch fixes issue pointed at
http://comments.gmane.org/gmane.linux.davinci/28135
tested on Logic PD.

 Reported-and-tested-by: Lad, Prabhakar <prabhakar.csengg@xxxxxxxxx>

Assuming you will respin the patch fixing the header.
---

Hi,
This is an attempt to fix the bug discussed in
https://lkml.org/lkml/2014/3/4/218

Since I am not really familiar with interrupts I am not sure if this is
the right way to do it. I am looking forward to your comments.

Looks OK.

I think a plain revert of Prabhakar patch would bring us in an "usual"
situation where the drivers's ndo_open():

- masks all interrupts bits at the Ethernet MAC level
- calls request_irq()
- unmask relevant interrupts bits at the Ethernet Mac level

just in case some uncontrolled interrupt bit triggers an interrupt
while the interface is down for instance...

I am fine with either solution and I will be happy to prepare a patch if we agree that we should revert the patch. What was the reason for commit 6892b41d9701283085b655c6086fb57a5d63fa47 in the first place? Does it fix a problem?

Should the full commit 6892b41d9701283085b655c6086fb57a5d63fa47 be reverted? Actually it consists of two parts, the first part replaces request_irq with devm_request_irq and throws out free_irq, the second part replaces devm_request_mem_region/devm_ioremap with devm_ioremap_resource. The first part causes the problem. Shall we keep the second part or shall this be reverted as well?

Christian



On a wider note, it would be good to get some tool to notify people
that attempting to replace devm_request_irq() in a network driver's
ndo_open() function is not going to produce the expected results as
the two are not strictly identical.
--
Florian
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




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




[Index of Archives]     [Linux Kernel]     [Kernel Development Newbies]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Hiking]     [Linux Kernel]     [Linux SCSI]