27 Sep, 2010

1 commit


14 May, 2010

1 commit

  • This patch removes from drivers/net/ all the unnecessary
    return; statements that precede the last closing brace of
    void functions.

    It does not remove the returns that are immediately
    preceded by a label as gcc doesn't like that.

    It also does not remove null void functions with return.

    Done via:
    $ grep -rP --include=*.[ch] -l "return;\n}" net/ | \
    xargs perl -i -e 'local $/ ; while (<>) { s/\n[ \t\n]+return;\n}/\n}/g; print; }'

    with some cleanups by hand.

    Compile tested x86 allmodconfig only.

    Signed-off-by: Joe Perches
    Signed-off-by: David S. Miller

    Joe Perches
     

10 May, 2010

1 commit

  • Now that core network takes care of trans_start updates, dont do it
    in drivers themselves, if possible. Drivers can avoid one cache miss
    (on dev->trans_start) in their start_xmit() handler.

    Exceptions are NETIF_F_LLTX drivers

    Signed-off-by: Eric Dumazet
    Signed-off-by: David S. Miller

    Eric Dumazet
     

28 Jan, 2010

1 commit


02 Oct, 2009

1 commit

  • The function meth_remove is defined using __exit, so don't use __devexit_p
    but __exit_p to wrap it.

    Signed-off-by: Uwe Kleine-König
    Cc: David S. Miller
    Cc: Ralf Baechle
    Cc: Patrick McHardy
    Cc: Johannes Berg
    Cc: netdev@vger.kernel.org
    Cc: linux-kernel@vger.kernel.org
    Signed-off-by: David S. Miller

    Uwe Kleine-König
     

24 Jul, 2009

1 commit

  • A pointer to meth_probe is passed to the core via
    platform_driver_register and so the function must not disappear when the
    .init sections are discarded. Otherwise (if also having HOTPLUG=y)
    unbinding and binding a device to the driver via sysfs will result in an
    oops as does a device being registered late.

    An alternative to this patch is using platform_driver_probe instead of
    platform_driver_register plus removing the pointer to the probe function
    from the struct platform_driver.

    Signed-off-by: Uwe Kleine-König
    Cc: David S. Miller
    Cc: Thomas Bogendoerfer
    Cc: Christoph Lameter
    Cc: Jeff Garzik
    Acked-by: Ralf Baechle
    Cc: Andrew Morton
    Cc: netdev@vger.kernel.org
    Cc: Greg Kroah-Hartman
    Signed-off-by: David S. Miller

    Uwe Kleine-König
     

06 Jul, 2009

1 commit


19 May, 2009

1 commit


18 May, 2009

1 commit

  • Mixing of normal and irq spinlocks results in the following lockdep messages
    on bootup on IP32:

    [...]
    Sending DHCP requests .
    ======================================================
    [ INFO: SOFTIRQ-safe -> SOFTIRQ-unsafe lock order detected ]
    2.6.30-rc5-00164-g41baeef #30
    ------------------------------------------------------
    swapper/1 [HC0[0]:SC0[1]:HE0:SE0] is trying to acquire:
    (&priv->meth_lock){+.+...}, at: [] meth_tx+0x48/0x43c

    and this task is already holding:
    (_xmit_ETHER#2){+.-...}, at: [] __qdisc_run+0x118/0x30c
    which would create a new lock dependency:
    (_xmit_ETHER#2){+.-...} -> (&priv->meth_lock){+.+...}

    but this new dependency connects a SOFTIRQ-irq-safe lock:
    (_xmit_ETHER#2){+.-...}
    ... which became SOFTIRQ-irq-safe at:
    [] __lock_acquire+0x784/0x1a14
    [] lock_acquire+0xf8/0x150
    [] _spin_lock+0x30/0x44
    [] dev_watchdog+0x70/0x398
    [] run_timer_softirq+0x1a8/0x248
    [] __do_softirq+0xec/0x208
    [] do_softirq+0x60/0xe4
    [] irq_exit+0x54/0x9c
    [] ret_from_irq+0x0/0x4
    [] r4k_wait+0x20/0x40
    [] cpu_idle+0x30/0x60
    [] start_kernel+0x3ec/0x404

    to a SOFTIRQ-irq-unsafe lock:
    (&priv->meth_lock){+.+...}
    ... which became SOFTIRQ-irq-unsafe at:
    ... [] __lock_acquire+0x824/0x1a14
    [] lock_acquire+0xf8/0x150
    [] _spin_lock+0x30/0x44
    [] meth_reset+0x118/0x2d8
    [] meth_open+0x28/0x140
    [] dev_open+0xe0/0x18c
    [] dev_change_flags+0xd8/0x1d4
    [] ip_auto_config+0x1d4/0xf28
    [] do_one_initcall+0x58/0x170
    [] kernel_init+0x98/0x104
    [] kernel_thread_helper+0x10/0x18

    other info that might help us debug this:

    2 locks held by swapper/1:
    #0: (rcu_read_lock){.+.+..}, at: [] dev_queue_xmit+0x1e0/0x4b0
    #1: (_xmit_ETHER#2){+.-...}, at: [] __qdisc_run+0x118/0x30c

    the SOFTIRQ-irq-safe lock's dependencies:
    -> (_xmit_ETHER#2){+.-...} ops: 0 {
    HARDIRQ-ON-W at:
    [] __lock_acquire+0x7fc/0x1a14
    [] lock_acquire+0xf8/0x150
    [] _spin_lock+0x30/0x44
    [] dev_watchdog+0x70/0x398
    [] run_timer_softirq+0x1a8/0x248
    [] __do_softirq+0xec/0x208
    [] do_softirq+0x60/0xe4
    [] irq_exit+0x54/0x9c
    [] ret_from_irq+0x0/0x4
    [] r4k_wait+0x20/0x40
    [] cpu_idle+0x30/0x60
    [] start_kernel+0x3ec/0x404
    IN-SOFTIRQ-W at:
    [] __lock_acquire+0x784/0x1a14
    [] lock_acquire+0xf8/0x150
    [] _spin_lock+0x30/0x44
    [] dev_watchdog+0x70/0x398
    [] run_timer_softirq+0x1a8/0x248
    [] __do_softirq+0xec/0x208
    [] do_softirq+0x60/0xe4
    [] irq_exit+0x54/0x9c
    [] ret_from_irq+0x0/0x4
    [] r4k_wait+0x20/0x40
    [] cpu_idle+0x30/0x60
    [] start_kernel+0x3ec/0x404
    INITIAL USE at:
    [] __lock_acquire+0x89c/0x1a14
    [] lock_acquire+0xf8/0x150
    [] _spin_lock+0x30/0x44
    [] dev_watchdog+0x70/0x398
    [] run_timer_softirq+0x1a8/0x248
    [] __do_softirq+0xec/0x208
    [] do_softirq+0x60/0xe4
    [] irq_exit+0x54/0x9c
    [] ret_from_irq+0x0/0x4
    [] r4k_wait+0x20/0x40
    [] cpu_idle+0x30/0x60
    [] start_kernel+0x3ec/0x404
    }
    ... key at: [] netdev_xmit_lock_key+0x8/0x1c8

    the SOFTIRQ-irq-unsafe lock's dependencies:
    -> (&priv->meth_lock){+.+...} ops: 0 {
    HARDIRQ-ON-W at:
    [] __lock_acquire+0x7fc/0x1a14
    [] lock_acquire+0xf8/0x150
    [] _spin_lock+0x30/0x44
    [] meth_reset+0x118/0x2d8
    [] meth_open+0x28/0x140
    [] dev_open+0xe0/0x18c
    [] dev_change_flags+0xd8/0x1d4
    [] ip_auto_config+0x1d4/0xf28
    [] do_one_initcall+0x58/0x170
    [] kernel_init+0x98/0x104
    [] kernel_thread_helper+0x10/0x18
    SOFTIRQ-ON-W at:
    [] __lock_acquire+0x824/0x1a14
    [] lock_acquire+0xf8/0x150
    [] _spin_lock+0x30/0x44
    [] meth_reset+0x118/0x2d8
    [] meth_open+0x28/0x140
    [] dev_open+0xe0/0x18c
    [] dev_change_flags+0xd8/0x1d4
    [] ip_auto_config+0x1d4/0xf28
    [] do_one_initcall+0x58/0x170
    [] kernel_init+0x98/0x104
    [] kernel_thread_helper+0x10/0x18
    INITIAL USE at:
    [] __lock_acquire+0x89c/0x1a14
    [] lock_acquire+0xf8/0x150
    [] _spin_lock+0x30/0x44
    [] meth_reset+0x118/0x2d8
    [] meth_open+0x28/0x140
    [] dev_open+0xe0/0x18c
    [] dev_change_flags+0xd8/0x1d4
    [] ip_auto_config+0x1d4/0xf28
    [] do_one_initcall+0x58/0x170
    [] kernel_init+0x98/0x104
    [] kernel_thread_helper+0x10/0x18
    }
    ... key at: [] __key.32424+0x0/0x8

    stack backtrace:
    Call Trace:
    [] dump_stack+0x8/0x34
    [] check_usage+0x470/0x4a0
    [] check_irq_usage+0x90/0x130
    [] __lock_acquire+0x12a4/0x1a14
    [] lock_acquire+0xf8/0x150
    [] _spin_lock_irqsave+0x60/0x84
    [] meth_tx+0x48/0x43c
    [] __qdisc_run+0x150/0x30c
    [] dev_queue_xmit+0x334/0x4b0
    [] ip_auto_config+0x8d0/0xf28
    [] do_one_initcall+0x58/0x170
    [] kernel_init+0x98/0x104
    [] kernel_thread_helper+0x10/0x18

    ..... timed out!
    IP-Config: Retrying forever (NFS root)...
    Sending DHCP requests ., OK
    [...]

    Fixed by converting all locks to irq locks.

    Signed-off-by: Ralf Baechle
    Tested-by: Andrew Randrianasulu
    Signed-off-by: David S. Miller

    Ralf Baechle
     

16 Apr, 2009

1 commit


30 Mar, 2009

1 commit


04 Nov, 2008

1 commit


28 Oct, 2008

1 commit

  • This converts pretty much everything to print_mac. There were
    a few things that had conflicts which I have just dropped for
    now, no harm done.

    I've built an allyesconfig with this and looked at the files
    that weren't built very carefully, but it's a huge patch.

    Signed-off-by: Johannes Berg
    Signed-off-by: David S. Miller

    Johannes Berg
     

25 Sep, 2008

1 commit


07 Aug, 2008

1 commit


23 Jul, 2008

1 commit

  • An | in an if statement to check a bit? I think this needs to be a &.
    As a result of this typo meth will always operate in promiscuous mode.

    Signed-off-by: Christoph Lameter
    Signed-off-by: Jeff Garzik

    Christoph Lameter
     

25 Apr, 2008

1 commit

  • Since 43cc71eed1250755986da4c0f9898f9a635cb3bf, the platform modalias is
    prefixed with "platform:". Add MODULE_ALIAS() to the hotpluggable network
    platform drivers, to re-enable auto loading.

    NOTE: didn't change drivers/net/fs_enet/fs_enet-main.c "old binding" support.
    That looks problematic in the first place (it even uses the ancient "struct
    device_driver" binding scheme for platform_bus!) and I suspect it will vanish
    soonish when arch/powerpc rules the world. Also, drivers/net/ne.c would have
    needed more thought to sort out.

    [akpm@linux-foundation.org: fix sgiseeq.c]
    [dbrownell@users.sourceforge.net: more drivers, registration fixes]
    Signed-off-by: Kay Sievers
    Signed-off-by: David Brownell
    Cc: Scott Wood
    Cc: Vitaly Bordug
    Cc: Dale Farnsworth
    Cc: Ben Dooks
    Cc: Ralf Baechle
    Cc: Andrew Victor
    Cc: Bryan Wu
    Signed-off-by: Andrew Morton
    Signed-off-by: Jeff Garzik

    Kay Sievers
     

09 Jan, 2008

1 commit

  • meth didn't set a valid mac address during probing, but later during
    open. Newer kernel refuse to open device with 00:00:00:00:00:00 as mac
    address -> dead ethernet. This patch sets the mac address in the probe
    function and uses only the mac address from the netdevice struct when
    setting up the hardware.

    Signed-off-by: Thomas Bogendoerfer
    Signed-off-by: David S. Miller

    Thomas Bogendoerfer
     

02 Nov, 2007

1 commit


11 Oct, 2007

2 commits


25 Aug, 2007

1 commit


25 May, 2007

1 commit

  • The meth ethernet driver for the SGI IP32 aka O2 is so far still an old
    style driver which does not use the device driver model. This is now
    causing issues with some udev based gadgetry in debian-stable. Fixed by
    converting the meth driver to a platform device.

    Signed-off-by: Ralf Baechle

    --
    Fixes since previous patch:

    o Fixed typo in meth_exit_module()
    Signed-off-by: Jeff Garzik

    Ralf Baechle
     

26 Apr, 2007

2 commits


18 Feb, 2007

1 commit


15 Feb, 2007

1 commit

  • After Al Viro (finally) succeeded in removing the sched.h #include in module.h
    recently, it makes sense again to remove other superfluous sched.h includes.
    There are quite a lot of files which include it but don't actually need
    anything defined in there. Presumably these includes were once needed for
    macros that used to live in sched.h, but moved to other header files in the
    course of cleaning it up.

    To ease the pain, this time I did not fiddle with any header files and only
    removed #includes from .c-files, which tend to cause less trouble.

    Compile tested against 2.6.20-rc2 and 2.6.20-rc2-mm2 (with offsets) on alpha,
    arm, i386, ia64, mips, powerpc, and x86_64 with allnoconfig, defconfig,
    allmodconfig, and allyesconfig as well as a few randconfigs on x86_64 and all
    configs in arch/arm/configs on arm. I also checked that no new warnings were
    introduced by the patch (actually, some warnings are removed that were emitted
    by unnecessarily included header files).

    Signed-off-by: Tim Schmielau
    Acked-by: Russell King
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Tim Schmielau
     

03 Dec, 2006

1 commit


05 Oct, 2006

1 commit

  • Maintain a per-CPU global "struct pt_regs *" variable which can be used instead
    of passing regs around manually through all ~1800 interrupt handlers in the
    Linux kernel.

    The regs pointer is used in few places, but it potentially costs both stack
    space and code to pass it around. On the FRV arch, removing the regs parameter
    from all the genirq function results in a 20% speed up of the IRQ exit path
    (ie: from leaving timer_interrupt() to leaving do_IRQ()).

    Where appropriate, an arch may override the generic storage facility and do
    something different with the variable. On FRV, for instance, the address is
    maintained in GR28 at all times inside the kernel as part of general exception
    handling.

    Having looked over the code, it appears that the parameter may be handed down
    through up to twenty or so layers of functions. Consider a USB character
    device attached to a USB hub, attached to a USB controller that posts its
    interrupts through a cascaded auxiliary interrupt controller. A character
    device driver may want to pass regs to the sysrq handler through the input
    layer which adds another few layers of parameter passing.

    I've build this code with allyesconfig for x86_64 and i386. I've runtested the
    main part of the code on FRV and i386, though I can't test most of the drivers.
    I've also done partial conversion for powerpc and MIPS - these at least compile
    with minimal configurations.

    This will affect all archs. Mostly the changes should be relatively easy.
    Take do_IRQ(), store the regs pointer at the beginning, saving the old one:

    struct pt_regs *old_regs = set_irq_regs(regs);

    And put the old one back at the end:

    set_irq_regs(old_regs);

    Don't pass regs through to generic_handle_irq() or __do_IRQ().

    In timer_interrupt(), this sort of change will be necessary:

    - update_process_times(user_mode(regs));
    - profile_tick(CPU_PROFILING, regs);
    + update_process_times(user_mode(get_irq_regs()));
    + profile_tick(CPU_PROFILING);

    I'd like to move update_process_times()'s use of get_irq_regs() into itself,
    except that i386, alone of the archs, uses something other than user_mode().

    Some notes on the interrupt handling in the drivers:

    (*) input_dev() is now gone entirely. The regs pointer is no longer stored in
    the input_dev struct.

    (*) finish_unlinks() in drivers/usb/host/ohci-q.c needs checking. It does
    something different depending on whether it's been supplied with a regs
    pointer or not.

    (*) Various IRQ handler function pointers have been moved to type
    irq_handler_t.

    Signed-Off-By: David Howells
    (cherry picked from 1b16e7ac850969f38b375e511e3fa2f474a33867 commit)

    David Howells
     

14 Sep, 2006

1 commit


26 Mar, 2006

1 commit

  • MODULE_PARM was actually breaking: recent gcc version optimize them out as
    unused. It's time to replace the last users, which are generally in the
    most unloved drivers anyway.

    Signed-off-by: Rusty Russell
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Rusty Russell
     

17 Apr, 2005

1 commit

  • Initial git repository build. I'm not bothering with the full history,
    even though we have it. We can create a separate "historical" git
    archive of that later if we want to, and in the meantime it's about
    3.2GB when imported into git - space that would just make the early
    git days unnecessarily complicated, when we don't have a lot of good
    infrastructure for it.

    Let it rip!

    Linus Torvalds