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: <09FBC53C1B46AC96B6483AA4@[172.22.2.41]>
Date:	Tue, 04 Mar 2014 15:06:16 +0100
From:	Christian Riesch <christian.riesch@...cron.at>
To:	Jon Ringle <jon@...gle.org>
cc:	linux-omap@...r.kernel.org, linux-kernel@...r.kernel.org,
	rafael.j.wysocki@...el.com, netdev@...r.kernel.org,
	davinci-linux-open-source@...ux.davincidsp.com,
	Prabhakar Lad <prabhakar.csengg@...il.com>
Subject: Re: Fwd: Ethernet controller not starting

Hi Jon,

[Now also cc'ed Prabhakar Lad]

--On March 04, 2014 07:34 -0500 Jon Ringle <jon@...gle.org> wrote:

> On Tue, Mar 4, 2014 at 4:06 AM, Christian Riesch
> <christian.riesch@...cron.at> wrote:
>> [cc'ed netdev and davinci-linux-open-source]
>>
>>
>> --On March 03, 2014 19:39 -0500 Jon Ringle <jon@...gle.org> wrote:
>>
>>> On Mon, Mar 3, 2014 at 6:43 PM, Rafael J. Wysocki <rjw@...ysocki.net>
>>> wrote:
>>>>
>>>> On Monday, March 03, 2014 02:41:01 PM Jon Ringle wrote:
>>>>>
>>>>> I'm working on porting an ARM board from linux-3.10 to linux-3.12 (now
>>>>> the latest LTS kernel).
>>>>> I found that Ethernet controller on the board no longer comes up on
>>>>> linux-3.12. I was able to bisect the issue I'm having to the following
>>>>> commit:
>>>>>
>>>>> >   45f0a85c8258741d11bda25c0a5669c06267204a is the first bad commit
>>>>> >   commit 45f0a85c8258741d11bda25c0a5669c06267204a
>>>>> >   Author: Rafael J. Wysocki <rafael.j.wysocki@...el.com>
>>>>> >   Date:   Mon Jun 3 21:49:52 2013 +0200
>>>>> >
[...]
>>>>>
>>>>> Can anyone offer any suggestions on what I should be looking for to
>>>>> fix this on my board?
>>>>
>>>>
>>>> Any pointers to the driver in question?
>>>
>>>
>>> drivers/net/ethernet/ti/davinci_emac.c
>>>
>>
>> Hi Jon,
>> I have successfully used the davinci_emac driver on a custom board with
>> an AM1808 SoC with Kernel 3.13 a few weeks ago. So at least 3.13 should
>> work. Did you try more recent kernel versions than 3.12?
>
> I have not tried 3.13, but will do so today. Could I get a copy of
> your .config for comparison purposes?
>

I would like to apologize, apparently my testing with 3.13 was quite bad. 
Ethernet comes up on my board and works fine after booting, but I can 
easily reproduce your problem by just doing ifconfig eth0 down /ifconfig 
eth0 up (which should call emac_dev_stop/emac_dev_open).

# ifconfig eth0 up
genirq: Flags mismatch irq 33. .....

So probably one of your start scripts (or dhcp or similar) does some 
ifconfig down/up, which then fails.

I had a look at the code again, emac_dev_open requests the interrupts, 
whereas emac_dev_stop does not free them. If emac_dev_open is then called 
again by ifconfig eth0 up, it tries to request the interrupts again, 
resulting in the error above.

I think the problem is a regression caused by

Commit	6892b41d9701283085b655c6086fb57a5d63fa47
net: davinci: emac: Convert to devm_* api
Signed-off-by: Lad, Prabhakar <prabhakar.csengg@...il.com>

This patch replaces request_irq() by devm_request_irq() in emac_dev_open 
and removes free_irq() from emac_dev_stop. But since emac_dev_open is 
called every time we do an ifconfig eth0 up, it tries to request the 
interrupts again and again and again (and fails).

So I guess the correct solution would be to move the calls of 
devm_request_irq() to davinci_emac_probe(). I will send a patch to netdev, 
it solves the problem on my board.

Christian










--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ