From 689239d283d02a74ed2df7e112ad19cd5f837f6d Mon Sep 17 00:00:00 2001 From: Dragos Motrea Date: Fri, 17 Mar 2017 16:35:21 +0100 Subject: ipv4: fix for waiting 2 minutes at boot time Signed-off-by: Adrian Dudau --- ...-rtnl_mutex-before-waiting-for-carrier-on.patch | 44 ++++++++++++++++++++++ patches/ipv4/ipv4wait.scc | 1 + 2 files changed, 45 insertions(+) create mode 100644 patches/ipv4/0001-IPV4-unlock-rtnl_mutex-before-waiting-for-carrier-on.patch create mode 100644 patches/ipv4/ipv4wait.scc diff --git a/patches/ipv4/0001-IPV4-unlock-rtnl_mutex-before-waiting-for-carrier-on.patch b/patches/ipv4/0001-IPV4-unlock-rtnl_mutex-before-waiting-for-carrier-on.patch new file mode 100644 index 0000000..5133075 --- /dev/null +++ b/patches/ipv4/0001-IPV4-unlock-rtnl_mutex-before-waiting-for-carrier-on.patch @@ -0,0 +1,44 @@ +From 1828e68d8f0b99dbe388de4b6703afd90fdd7493 Mon Sep 17 00:00:00 2001 +From: Dragos Motrea +Date: Thu, 16 Mar 2017 14:04:17 +0100 +Subject: [PATCH] IPV4: unlock rtnl_mutex before waiting for carrier on + +There is a race condition between ip auto configuration and the ethernet +driver. The ip configuration is taking the rtnl_mutex in the ic_open_devs() +function and then is waiting 120 seconds for a carrier on at least +one network device. The driver is locked in the mutex and the carrier on +is not sent. After 120 seconds, the mutex is unlocked and the driver is +continuing its task execution. + +The mutex should be unlocked in the ip auto configuration before waiting the +carrier on from the ethernet driver. + +Signed-off-by: Dragos Motrea +--- + net/ipv4/ipconfig.c | 3 +-- + 1 file changed, 1 insertion(+), 2 deletions(-) + +diff --git a/net/ipv4/ipconfig.c b/net/ipv4/ipconfig.c +index 071a785..55c95cc 100644 +--- a/net/ipv4/ipconfig.c ++++ b/net/ipv4/ipconfig.c +@@ -254,6 +254,7 @@ static int __init ic_open_devs(void) + dev->name, able, d->xid); + } + } ++ rtnl_unlock(); + + /* no point in waiting if we could not bring up at least one device */ + if (!ic_first_dev) +@@ -281,8 +282,6 @@ static int __init ic_open_devs(void) + next_msg = jiffies + msecs_to_jiffies(CONF_CARRIER_TIMEOUT/12); + } + have_carrier: +- rtnl_unlock(); +- + *last = NULL; + + if (!ic_first_dev) { +-- +2.7.4 + diff --git a/patches/ipv4/ipv4wait.scc b/patches/ipv4/ipv4wait.scc new file mode 100644 index 0000000..93e8cdc --- /dev/null +++ b/patches/ipv4/ipv4wait.scc @@ -0,0 +1 @@ +patch 0001-IPV4-unlock-rtnl_mutex-before-waiting-for-carrier-on.patch -- cgit v1.2.3-54-g00ecf