From patchwork Sun Jan 10 08:27:48 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christian Pellegrin X-Patchwork-Id: 42567 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 001C4B7C1C for ; Sun, 10 Jan 2010 19:31:41 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752135Ab0AJI1v (ORCPT ); Sun, 10 Jan 2010 03:27:51 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1752040Ab0AJI1v (ORCPT ); Sun, 10 Jan 2010 03:27:51 -0500 Received: from fg-out-1718.google.com ([72.14.220.159]:38078 "EHLO fg-out-1718.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752006Ab0AJI1u (ORCPT ); Sun, 10 Jan 2010 03:27:50 -0500 Received: by fg-out-1718.google.com with SMTP id 22so326362fge.1 for ; Sun, 10 Jan 2010 00:27:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:date:message-id:subject :from:to:content-type; bh=iYSv2VYsx4IwU3phqg3mCfLj6QBj9GH1mI8naYKPHuY=; b=Q1HqIhsFAtmWPuIonVvsLqc0RKHQt03G7i9G9gu/6f6gTTYdYwwa9Zgq0cHULbyNzo XK5hg0VMb4ubwXWKRi2/sIEya0YD4zywsPoibZ0KfDPRaoIjOGQ+aWXNXDUYR5C5kVvs anpxkbEKurTwMhBKZFYwnIzjLJl1eNM3tFw6Y= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=PmmskPwxxugxKh/OyxNYksVj7GoRaL0YXlMTCGQYnZmrfkdkctPiDveAfdYgy0OLBV UQm7//mdLjDzmW3baQPtsJYGmVLhtj3bt62M19K09QvpY2Yi+ILFeDH42/13ZkvfGwy8 hrolysTFeBQw/Ft5/xBlFp+JjAhfPEnq2iPJ8= MIME-Version: 1.0 Received: by 10.87.64.27 with SMTP id r27mr11726210fgk.29.1263112068578; Sun, 10 Jan 2010 00:27:48 -0800 (PST) Date: Sun, 10 Jan 2010 09:27:48 +0100 Message-ID: Subject: problem with kernel ipconfig over usb ethernet on v.2.6.33-rc3 From: christian pellegrin To: netdev@vger.kernel.org Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Hi, I noticed that kernel IP auto-configuration is not usable for USB-ethenet dongles on newer kernel because it starts before the USB devices are found (perhaps as a consequence of parallelization of kernel boot; the built-in delay of 500ms is not enough).I'm using the following patch (with a command line parameter ipconfigdelay=10) to solve this situation, but it's a shameless cut & paste from rootdelay. Is there any better solution or I'm just missing something? Subject: [PATCH] introduced ipconfigdelay this is needed for using ipconfig on usb ethernet devices Signed-off-by: Christian Pellegrin --- net/ipv4/ipconfig.c | 18 +++++++++++++++++- 1 files changed, 17 insertions(+), 1 deletions(-) struct ic_device *d, **last; @@ -1325,8 +1332,16 @@ static int __init ip_auto_config(void) #ifdef IPCONFIG_DYNAMIC try_try_again: #endif + /* Give hardware a chance to settle */ - msleep(CONF_PRE_OPEN); + if (ipconfig_delay) { + printk(KERN_INFO "Waiting %dsec before auto-configuring device...\n", + ipconfig_delay); + ssleep(ipconfig_delay); + } + else { + msleep(CONF_PRE_OPEN); + } /* Setup all network devices */ if (ic_open_devs() < 0) @@ -1576,3 +1591,4 @@ static int __init vendor_class_identifier_setup(char *addrs) __setup("ip=", ip_auto_config_setup); __setup("nfsaddrs=", nfsaddrs_config_setup); __setup("dhcpclass=", vendor_class_identifier_setup); +__setup("ipconfigdelay=", ipconfig_delay_setup); diff --git a/net/ipv4/ipconfig.c b/net/ipv4/ipconfig.c index 10a6a60..8108a8c 100644 --- a/net/ipv4/ipconfig.c +++ b/net/ipv4/ipconfig.c @@ -187,6 +187,13 @@ struct ic_device { static struct ic_device *ic_first_dev __initdata = NULL;/* List of open device */ static struct net_device *ic_dev __initdata = NULL; /* Selected device */ +static unsigned int __initdata ipconfig_delay; +static int __init ipconfig_delay_setup(char *str) +{ + ipconfig_delay = simple_strtoul(str, NULL, 0); + return 1; +} + static int __init ic_open_devs(void) {