02 Dec, 2010

1 commit

  • The code for the b44_wap54g10_workaround was never included, because
    the config option was wrong. The nvram_get function was never in
    mainline kernel, only in external OpenWrt patches.

    The code should be compiled in when CONFIG_BCM47XX is selected and not
    when CONFIG_SSB_DRIVER_MIPS is selected, because nvram_getenv is only
    available on bcm47xx platforms and now in the mainline kernel code.
    Using an include is better than a second function declaration, to fix
    this when the function signature changes.

    Signed-off-by: Hauke Mehrtens
    Signed-off-by: David S. Miller

    Hauke Mehrtens
     

21 Oct, 2010

2 commits


12 Oct, 2010

1 commit

  • For carrier detection to work properly when binding the driver with a cable
    unplugged, netif_carrier_off() should be called after register_netdev(),
    not before.

    Signed-off-by: Paul Fertser
    Signed-off-by: David S. Miller

    Paul Fertser
     

10 Sep, 2010

1 commit


08 Sep, 2010

1 commit

  • This patch is a simplified version of the original patch from James Courtier-Dutton.

    >From: James Courtier-Dutton
    >Subject: [PATCH] Fix b44 RX FIFO overflow recovery.
    >Date: Wednesday, June 30, 2010 - 1:11 pm
    >
    >This patch improves the recovery after a RX FIFO overflow on the b44
    >Ethernet NIC.
    >Before it would do a complete chip reset, resulting is loss of link
    >for a few seconds.
    >This patch improves this to do recovery in about 20ms without loss of link.
    >
    >Signed off by: James@superbug.co.uk

    Signed-off-by: Mark Lord
    Signed-off-by: David S. Miller

    Mark Lord
     

03 Sep, 2010

1 commit

  • fresh skbs have ip_summed set to CHECKSUM_NONE (0)

    We can avoid setting again skb->ip_summed to CHECKSUM_NONE in drivers.

    Introduce skb_checksum_none_assert() helper so that we keep this
    assertion documented in driver sources.

    Change most occurrences of :

    skb->ip_summed = CHECKSUM_NONE;

    by :

    skb_checksum_none_assert(skb);

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

    Eric Dumazet
     

08 Jul, 2010

1 commit


05 Jun, 2010

1 commit


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
     

12 Apr, 2010

1 commit


04 Apr, 2010

1 commit

  • Converts the list and the core manipulating with it to be the same as uc_list.

    +uses two functions for adding/removing mc address (normal and "global"
    variant) instead of a function parameter.
    +removes dev_mcast.c completely.
    +exposes netdev_hw_addr_list_* macros along with __hw_addr_* functions for
    manipulation with lists on a sandbox (used in bonding and 80211 drivers)

    Signed-off-by: Jiri Pirko
    Signed-off-by: David S. Miller

    Jiri Pirko
     

30 Mar, 2010

1 commit

  • …it slab.h inclusion from percpu.h

    percpu.h is included by sched.h and module.h and thus ends up being
    included when building most .c files. percpu.h includes slab.h which
    in turn includes gfp.h making everything defined by the two files
    universally available and complicating inclusion dependencies.

    percpu.h -> slab.h dependency is about to be removed. Prepare for
    this change by updating users of gfp and slab facilities include those
    headers directly instead of assuming availability. As this conversion
    needs to touch large number of source files, the following script is
    used as the basis of conversion.

    http://userweb.kernel.org/~tj/misc/slabh-sweep.py

    The script does the followings.

    * Scan files for gfp and slab usages and update includes such that
    only the necessary includes are there. ie. if only gfp is used,
    gfp.h, if slab is used, slab.h.

    * When the script inserts a new include, it looks at the include
    blocks and try to put the new include such that its order conforms
    to its surrounding. It's put in the include block which contains
    core kernel includes, in the same order that the rest are ordered -
    alphabetical, Christmas tree, rev-Xmas-tree or at the end if there
    doesn't seem to be any matching order.

    * If the script can't find a place to put a new include (mostly
    because the file doesn't have fitting include block), it prints out
    an error message indicating which .h file needs to be added to the
    file.

    The conversion was done in the following steps.

    1. The initial automatic conversion of all .c files updated slightly
    over 4000 files, deleting around 700 includes and adding ~480 gfp.h
    and ~3000 slab.h inclusions. The script emitted errors for ~400
    files.

    2. Each error was manually checked. Some didn't need the inclusion,
    some needed manual addition while adding it to implementation .h or
    embedding .c file was more appropriate for others. This step added
    inclusions to around 150 files.

    3. The script was run again and the output was compared to the edits
    from #2 to make sure no file was left behind.

    4. Several build tests were done and a couple of problems were fixed.
    e.g. lib/decompress_*.c used malloc/free() wrappers around slab
    APIs requiring slab.h to be added manually.

    5. The script was run on all .h files but without automatically
    editing them as sprinkling gfp.h and slab.h inclusions around .h
    files could easily lead to inclusion dependency hell. Most gfp.h
    inclusion directives were ignored as stuff from gfp.h was usually
    wildly available and often used in preprocessor macros. Each
    slab.h inclusion directive was examined and added manually as
    necessary.

    6. percpu.h was updated not to include slab.h.

    7. Build test were done on the following configurations and failures
    were fixed. CONFIG_GCOV_KERNEL was turned off for all tests (as my
    distributed build env didn't work with gcov compiles) and a few
    more options had to be turned off depending on archs to make things
    build (like ipr on powerpc/64 which failed due to missing writeq).

    * x86 and x86_64 UP and SMP allmodconfig and a custom test config.
    * powerpc and powerpc64 SMP allmodconfig
    * sparc and sparc64 SMP allmodconfig
    * ia64 SMP allmodconfig
    * s390 SMP allmodconfig
    * alpha SMP allmodconfig
    * um on x86_64 SMP allmodconfig

    8. percpu.h modifications were reverted so that it could be applied as
    a separate patch and serve as bisection point.

    Given the fact that I had only a couple of failures from tests on step
    6, I'm fairly confident about the coverage of this conversion patch.
    If there is a breakage, it's likely to be something in one of the arch
    headers which should be easily discoverable easily on most builds of
    the specific arch.

    Signed-off-by: Tejun Heo <tj@kernel.org>
    Guess-its-ok-by: Christoph Lameter <cl@linux-foundation.org>
    Cc: Ingo Molnar <mingo@redhat.com>
    Cc: Lee Schermerhorn <Lee.Schermerhorn@hp.com>

    Tejun Heo
     

23 Feb, 2010

3 commits


18 Feb, 2010

1 commit


17 Feb, 2010

1 commit


13 Feb, 2010

1 commit


08 Jan, 2010

1 commit


09 Dec, 2009

1 commit

  • About 50% of shutdowns of b44 Ethernet adapter ends by kernel panic
    with kernels compiled with stack-protector.

    Checking b44_magic_pattern() return values, one call of
    b44_magic_pattern() returns 127. It means, that set_bit(128, pmask)
    was called on line 1509. It means that bit 0 of 17th byte of pmask was
    overwritten. But pmask has only 16 bytes. Stack corruption happens.

    It seems that set_bit() on line 1509 always writes one bit off.

    The fix does not only solve the stack corruption, but also makes Wake
    On LAN working on my onboard B44 on Asus A7V-333X mainboard.

    It seems that this problem affects all kernel versions since commit
    725ad800 ([PATCH] b44: add wol for old nic) on 2006-06-20.

    Signed-off-by: Stanislav Brabec
    Signed-off-by: David S. Miller

    Stanislav Brabec
     

30 Nov, 2009

1 commit

  • Fixes kernel bugzilla #14691

    Due to the way netpoll works, it is perfectly legal to see
    NAPI already scheduled when new device events are pending
    in b44_interrupt().

    So logging a message about it is wrong and in fact harmful.

    Based upon a patch by Andreas Mohr.

    Signed-off-by: David S. Miller

    David S. Miller
     

17 Sep, 2009

1 commit

  • net/core/netpoll.c::netpoll_send_skb() calls the poll handler when
    it is available. As netconsole can be used from almost any context,
    IRQ must not be enabled blindly in the NAPI handler of the driver
    which supports netpoll.

    Call trace:
    netpoll_send_skb()
    {
    local_irq_save(flags)
    -> netpoll_poll()
    -> poll_napi()
    -> poll_one_napi()
    -> napi->poll()
    -> b44_poll()
    local_irq_restore(flags)
    }

    Signed-off-by: Dongdong Deng
    Signed-off-by: David S. Miller

    Dongdong Deng
     

09 Sep, 2009

1 commit


02 Sep, 2009

1 commit


01 Sep, 2009

1 commit


15 Aug, 2009

1 commit

  • The NETPOLL API requires that interrupts remain disabled in
    netpoll_send_skb(). The use of spin_lock_irq() and spin_unlock_irq()
    in the NETPOLL API callbacks causes the interrupts to get enabled and
    can lead to kernel instability.

    The solution is to use spin_lock_irqsave() and spin_unlock_restore()
    to prevent the irqs from getting enabled while in netpoll_send_skb().

    Call trace:
    netpoll_send_skb()
    {
    -> local_irq_save(flags)
    ---> dev->ndo_start_xmit(skb, dev)
    ---> spin_lock_irq()
    ---> spin_unlock_irq() *******here would enable the interrupt.
    ...
    -> local_irq_restore(flags)
    }

    Signed-off-by: Dongdong Deng
    Signed-off-by: Jason Wessel
    Acked-by: Bruce Ashfield
    Acked-by: Matt Mackall
    Signed-off-by: David S. Miller

    Dongdong Deng
     

03 Aug, 2009

1 commit

  • The kernel.h macro DIV_ROUND_CLOSEST performs the computation (x + d/2)/d
    but is perhaps more readable.

    The semantic patch that makes this change is as follows:
    (http://www.emn.fr/x-info/coccinelle/)

    //
    @haskernel@
    @@

    #include

    @depends on haskernel@
    expression x,__divisor;
    @@

    - (((x) + ((__divisor) / 2)) / (__divisor))
    + DIV_ROUND_CLOSEST(x,__divisor)
    //

    Signed-off-by: Julia Lawall
    Signed-off-by: David S. Miller

    Julia Lawall
     

20 Jul, 2009

1 commit


28 May, 2009

1 commit


07 Apr, 2009

2 commits


05 Apr, 2009

1 commit

  • > > ------------[ cut here ]------------
    > > WARNING: at lib/dma-debug.c:539 check_sync+0xe9/0x341() (Not tainted)
    > > Hardware name: HP Compaq nx6110 (PY501EA#AB9)
    > > b44 0000:02:0e.0: DMA-API: device driver tries to sync DMA memory it has not
    > > allocated [device address=0x0000000075941040] [size=1566 bytes]
    > > Modules linked in: llc bnep l2cap bluetooth autofs4 lm90 hwmon i2c_i801 sunrpc
    > > ipv6 cpufreq_ondemand acpi_cpufreq uinput snd_intel8x0m snd_intel8x0
    > > snd_ac97_codec snd_seq_dummy ac97_bus snd_seq_oss snd_seq_midi_event snd_seq
    > > snd_seq_device snd_pcm_oss snd_mixer_oss snd_pcm b44 ssb firewire_ohci
    > > snd_timer ipw2200 iTCO_wdt mii firewire_core snd iTCO_vendor_support libipw
    > > yenta_socket crc_itu_t lib80211 rsrc_nonstatic soundcore snd_page_alloc joydev
    > > pcspkr wmi serio_raw ata_generic pata_acpi i915 drm i2c_algo_bit i2c_core video
    > > output [last unloaded: scsi_wait_scan]
    > > Pid: 2418, comm: S58ntpd Not tainted 2.6.29-16.fc10.i686.PAE #1
    > > Call Trace:
    > > [] warn_slowpath+0x7c/0xbd
    > > [] ? register_lock_class+0x17/0x290
    > > [] ? mark_lock+0x1e/0x349
    > > [] ? _raw_spin_unlock+0x74/0x78
    > > [] ? mark_lock+0x1e/0x349
    > > [] ? check_sync+0x37/0x341
    > > [] check_sync+0xe9/0x341
    > > [] ? _spin_unlock_irqrestore+0x45/0x55
    > > [] ? trace_hardirqs_on+0xb/0xd
    > > [] debug_dma_sync_single_for_device+0x2f/0x39
    > > [] dma_sync_single_for_device+0x4a/0x59 [b44]
    > > [] ssb_dma_sync_single_for_device+0x3e/0x48 [b44]
    > > [] b44_recycle_rx+0x18c/0x196 [b44]
    > > [] b44_poll+0x277/0x3c0 [b44]
    > > [] net_rx_action+0xa1/0x1ca
    > > [] __do_softirq+0x9d/0x154
    > > [] do_softirq+0x52/0x7e
    > > [] irq_exit+0x49/0x77
    > > [] do_IRQ+0x97/0xad
    > > [] common_interrupt+0x2c/0x34

    I don't know if this is related, but the following patch seems to fix some DMA
    mapping bug. Can somebody comment who does understand the code better than me?

    (completely untested)

    Signed-off-by: David S. Miller

    Michael Buesch
     

02 Mar, 2009

1 commit


27 Feb, 2009

2 commits

  • Disable the SSB core on device shutdown.
    This has two advantages:
    1) A clean device shutdown is always desired here, because we disable
    the device's global crystal in the next statement.
    2) This fixes a bug where the device will come up with the enable-bit
    set on the next initialization (without a reboot inbetween).
    This causes breakage on the second initialization due to code that
    checks this bit (ssb_device_is_enabled() checks).

    Reported-by: Pantelis Koukousoulas
    Signed-off-by: Michael Buesch
    Signed-off-by: David S. Miller

    Michael Buesch
     
  • Unconditionally setup the IRQ routing on chip reset.
    It's safe to call ssb_pcicore_dev_irqvecs_enable() unconditionally, because
    it has internal checks for redundant calls.

    This fixes problems where hardware will not come up properly
    due to quirks in the enable-bit hardware.

    Reported-by: Pantelis Koukousoulas
    Signed-off-by: Michael Buesch
    Signed-off-by: David S. Miller

    Michael Buesch
     

10 Feb, 2009

1 commit


22 Jan, 2009

1 commit

  • Following the removal of the unused struct net_device * parameter from
    the NAPI functions named *netif_rx_* in commit 908a7a1, they are
    exactly equivalent to the corresponding *napi_* functions and are
    therefore redundant.

    Signed-off-by: Ben Hutchings
    Acked-by: Neil Horman
    Signed-off-by: David S. Miller

    Ben Hutchings
     

16 Jan, 2009

1 commit

  • b44 chip has some hardware limitations, that need GFP_DMA bounce
    buffers in some situations.

    In order to not deplete DMA zone, we should keep allocated GFP_DMA skb
    only for driver use. At rx time, we copy such skb to newly allocated
    skb, reusing existing copybreak infrastructure.

    On machines with low amount of memory, all skb meet the hardware limitation,
    so no copy is needed. We detect this situation using a new device flag, set
    to one if one GFP_DMA skb was ever allocated by b44_alloc_rx_skb().

    Previously allocated skb, even outside from DMA zone will then be recycled,
    to have minimal impact on DMA zone use.

    Signed-off-by: Eric Dumazet
    Tested-by: Ionut Leonte
    Signed-off-by: David S. Miller

    Eric Dumazet
     

11 Jan, 2009

1 commit

  • Broadcom 4400 puts a header of configurable size (apparently needs
    to be at least 28 bytes) in front of received packets. When handling
    this, the previous code accidentally added the offset 30 *twice* for
    the software and once for the hardware, thereby cancelling out the
    IP alignment effect of the 30 byte padding and wasting an additional
    30 bytes of memory per packet.

    This patch fixes this problem and improves routing throughput by
    about 30% on MIPS, where unaligned access is expensive.

    Signed-off-by: Felix Fietkau
    Signed-off-by: David S. Miller

    Felix Fietkau