30 Oct, 2009

6 commits

  • pcnet_cs,serial_cs:

    add cis of PreMax ethernet pcmcia card,
    and some Sierra Wireless serial card(AC555, AC7xx, AC8xx).

    use PROD_ID for AC7xx, because MANF_ID of AC7xx and AC8xx are the same.

    Signed-off-by: Ken Kawasaki
    Signed-off-by: David S. Miller

    Ken Kawasaki
     
  • r8169 card drop incoming VLAN tagged MTU byte large jumbo frames

    It looks to compare current and maximal packet sizes hardware use
    '
    Signed-off-by: David S. Miller

    Raimonds Cicans
     
  • Prevent read outside array bounds.

    Signed-off-by: Roel Kluin
    Signed-off-by: David S. Miller

    roel kluin
     
  • This patch reworks a previous workaround (commit 7d3cabbcc) for an issue
    in hardware where noise on the interconnect between the MAC and PHY could
    be generated by a lower power mode (K1) at 1000Mbps resulting in bad
    packets. Disable K1 while at 1000 Mbps but keep it enabled for 10/100Mbps
    and when the cable is disconnected. The original version of this
    workaround was found to be incomplete.

    Signed-off-by: Bruce Allan
    Signed-off-by: Jeff Kirsher
    Signed-off-by: David S. Miller

    Bruce Allan
     
  • On PCH-based (82577/82578) and some ICH8-based parts (82566) there is an
    issue with the hardware automatically configuring the PHY with contents
    from the EEPROM after the PHY is reset, so do the configuration by the
    driver instead. This was already similarly done for some 82566 parts in
    e1000_phy_hw_reset_ich8lan() but needs to be done after other resets,
    so move the PHY configuration code to its own function and call after
    all PHY resets.

    Signed-off-by: Bruce Allan
    Signed-off-by: Jeff Kirsher
    Signed-off-by: David S. Miller

    Bruce Allan
     
  • A change in how PHYs are electrically isolated caused all PHYs to be
    isolated followed by reverting that isolation for the selected PHY.
    Unfortunately, isolating the selected PHY for even a short period of
    time can result in DHCP negotiation taking more than 10 seconds on certain
    embedded configurations delaying boot time as reported by Bernhard Kaindl.
    This patch reverts the change to how PHYs are isolated yet still works
    around the issue for 82552 needing the selected PHY's BMCR register to
    be written after the unused PHYs are isolated. This code is moved below
    the setting of nic->phy ID in order to do the 82552-specific workaround.

    Cc: Bernhard Kaindl
    Signed-off-by: Bruce Allan
    Signed-off-by: Jeff Kirsher
    Signed-off-by: David S. Miller

    Bruce Allan
     

29 Oct, 2009

5 commits

  • I found that the current version of drivers/net/usb/dm9601.c can be used to
    successfully drive a low-power, low-cost network adapter with USB ID
    0a46:9000, based on a DM9000E chipset. As no device with this ID is yet
    present in the kernel, I have created a patch that adds support for the device
    to the dm9601 driver.

    Created and tested against linux-2.6.32-rc5.

    Signed-off-by: Janusz Krzysztofik
    Acked-by: Peter Korsgaard
    Signed-off-by: David S. Miller

    Janusz Krzysztofik
     
  • The mailbox command process would only process a maximum of 5 unrelated
    firmware events while waiting for it's command completion status.
    It should process an unlimited number of events while waiting for a maximum of 5 seconds.

    Signed-off-by: Ron Mercer
    Signed-off-by: David S. Miller

    Ron Mercer
     
  • Clean up driver resources without touch the hardware. Add pci
    save/restore state.

    Signed-off-by: Ron Mercer
    Signed-off-by: David S. Miller

    Ron Mercer
     
  • David S. Miller
     
  • In mii monitor mode, bond_check_dev_link() calls the the ioctl
    handler of slave devices. It stores the ndo_do_ioctl function
    pointer to a static (!) ioctl variable and later uses it to call the
    handler with the IOCTL macro.

    If another thread executes bond_check_dev_link() at the same time
    (even with a different bond, which none of the locks prevent), a
    race condition occurs. If the two racing slaves have different
    drivers, this may result in one driver's ioctl handler being
    called with a pointer to a net_device controlled with a different
    driver, resulting in unpredictable breakage.

    Unless I am overlooking something, the "static" must be a
    copy'n'paste error (?).

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

    Jiri Bohac
     

28 Oct, 2009

8 commits

  • virtio net used to unlink skbs from send queues on error,
    but ever since 48925e372f04f5e35fec6269127c62b2c71ab794
    we do not do this. This causes guest data corruption and crashes
    with vhost since net core can requeue the skb or free it without
    it being taken off the list.

    This patch fixes this by queueing the skb after successful
    transmit.

    Signed-off-by: Michael S. Tsirkin
    Signed-off-by: Rusty Russell
    Signed-off-by: David S. Miller

    Michael S. Tsirkin
     
  • Page buffers containing packets with an incorrect checksum or using a
    protocol not handled by hardware checksum offload were previously not
    passed to LRO. The conversion to GRO changed this, but did not set
    the ip_summed value accordingly.

    Signed-off-by: Ben Hutchings
    Signed-off-by: David S. Miller

    Ben Hutchings
     
  • The BNX2_L2CTX_STATUSB_NUM definition needs to be changed to match
    the recent firmware update:

    commit 078b0735881c7969aaf21469f3577831cddd9f8c
    bnx2: Update firmware to 5.0.0.j3.

    Without the fix, bnx2 can crash intermittently in bnx2_rx_int() when
    iSCSI is enabled.

    Signed-off-by: Michael Chan
    Signed-off-by: Benjamin Li
    Signed-off-by: David S. Miller

    Michael Chan
     
  • Test whether index is within bounds before reading the element

    Signed-off-by: Roel Kluin
    Signed-off-by: John W. Linville

    Roel Kluin
     
  • This fixes the following sparse warnings:

    $ make modules SUBDIRS=drivers/net/wireless/libertas C=1 CF=-D__CHECK_ENDIAN__
    make: Entering directory `/usr/src/linux-wl'
    CHECK drivers/net/wireless/libertas/if_spi.c
    drivers/net/wireless/libertas/if_spi.c:137:16: warning: incorrect type in initializer (different base types)
    drivers/net/wireless/libertas/if_spi.c:137:16: expected unsigned short [unsigned] [usertype] reg_out
    drivers/net/wireless/libertas/if_spi.c:137:16: got restricted __le16 [usertype]
    drivers/net/wireless/libertas/if_spi.c:191:16: warning: incorrect type in initializer (different base types)
    drivers/net/wireless/libertas/if_spi.c:191:16: expected unsigned short [unsigned] [usertype] reg_out
    drivers/net/wireless/libertas/if_spi.c:191:16: got restricted __le16 [usertype]
    drivers/net/wireless/libertas/if_spi.c:256:24: warning: incorrect type in argument 1 (different base types)
    drivers/net/wireless/libertas/if_spi.c:256:24: expected restricted __le32 const [usertype] *p
    drivers/net/wireless/libertas/if_spi.c:256:24: got unsigned int *
    drivers/net/wireless/libertas/if_spi.c:243:24: warning: incorrect type in argument 1 (different base types)
    drivers/net/wireless/libertas/if_spi.c:243:24: expected restricted __le16 const [usertype] *p
    drivers/net/wireless/libertas/if_spi.c:243:24: got unsigned short *
    drivers/net/wireless/libertas/if_spi.c:171:7: warning: incorrect type in assignment (different base types)
    drivers/net/wireless/libertas/if_spi.c:171:7: expected unsigned short [unsigned] [usertype] buff
    drivers/net/wireless/libertas/if_spi.c:171:7: got restricted __le16 [usertype]
    drivers/net/wireless/libertas/if_spi.c:171:7: warning: incorrect type in assignment (different base types)
    drivers/net/wireless/libertas/if_spi.c:171:7: expected unsigned short [unsigned] [usertype] buff
    drivers/net/wireless/libertas/if_spi.c:171:7: got restricted __le16 [usertype]
    drivers/net/wireless/libertas/if_spi.c:171:7: warning: incorrect type in assignment (different base types)
    drivers/net/wireless/libertas/if_spi.c:171:7: expected unsigned short [unsigned] [usertype] buff
    drivers/net/wireless/libertas/if_spi.c:171:7: got restricted __le16 [usertype]
    drivers/net/wireless/libertas/if_spi.c:171:7: warning: incorrect type in assignment (different base types)
    drivers/net/wireless/libertas/if_spi.c:171:7: expected unsigned short [unsigned] [usertype] buff
    drivers/net/wireless/libertas/if_spi.c:171:7: got restricted __le16 [usertype]
    drivers/net/wireless/libertas/if_spi.c:171:7: warning: incorrect type in assignment (different base types)
    drivers/net/wireless/libertas/if_spi.c:171:7: expected unsigned short [unsigned] [usertype] buff
    drivers/net/wireless/libertas/if_spi.c:171:7: got restricted __le16 [usertype]
    drivers/net/wireless/libertas/if_spi.c:243:24: warning: incorrect type in argument 1 (different base types)
    drivers/net/wireless/libertas/if_spi.c:243:24: expected restricted __le16 const [usertype] *p
    drivers/net/wireless/libertas/if_spi.c:243:24: got unsigned short *
    drivers/net/wireless/libertas/if_spi.c:171:7: warning: incorrect type in assignment (different base types)
    drivers/net/wireless/libertas/if_spi.c:171:7: expected unsigned short [unsigned] [usertype] buff
    drivers/net/wireless/libertas/if_spi.c:171:7: got restricted __le16 [usertype]
    drivers/net/wireless/libertas/if_spi.c:171:7: warning: incorrect type in assignment (different base types)
    drivers/net/wireless/libertas/if_spi.c:171:7: expected unsigned short [unsigned] [usertype] buff
    drivers/net/wireless/libertas/if_spi.c:171:7: got restricted __le16 [usertype]
    drivers/net/wireless/libertas/if_spi.c:171:7: warning: incorrect type in assignment (different base types)
    drivers/net/wireless/libertas/if_spi.c:171:7: expected unsigned short [unsigned] [usertype] buff
    drivers/net/wireless/libertas/if_spi.c:171:7: got restricted __le16 [usertype]
    drivers/net/wireless/libertas/if_spi.c:171:7: warning: incorrect type in assignment (different base types)
    drivers/net/wireless/libertas/if_spi.c:171:7: expected unsigned short [unsigned] [usertype] buff
    drivers/net/wireless/libertas/if_spi.c:171:7: got restricted __le16 [usertype]
    drivers/net/wireless/libertas/if_spi.c:171:7: warning: incorrect type in assignment (different base types)
    drivers/net/wireless/libertas/if_spi.c:171:7: expected unsigned short [unsigned] [usertype] buff
    drivers/net/wireless/libertas/if_spi.c:171:7: got restricted __le16 [usertype]
    drivers/net/wireless/libertas/if_spi.c:171:7: warning: incorrect type in assignment (different base types)
    drivers/net/wireless/libertas/if_spi.c:171:7: expected unsigned short [unsigned] [usertype] buff
    drivers/net/wireless/libertas/if_spi.c:171:7: got restricted __le16 [usertype]
    drivers/net/wireless/libertas/if_spi.c:243:24: warning: incorrect type in argument 1 (different base types)
    drivers/net/wireless/libertas/if_spi.c:243:24: expected restricted __le16 const [usertype] *p
    drivers/net/wireless/libertas/if_spi.c:243:24: got unsigned short *
    drivers/net/wireless/libertas/if_spi.c:171:7: warning: incorrect type in assignment (different base types)
    drivers/net/wireless/libertas/if_spi.c:171:7: expected unsigned short [unsigned] [usertype] buff
    drivers/net/wireless/libertas/if_spi.c:171:7: got restricted __le16 [usertype]
    drivers/net/wireless/libertas/if_spi.c:171:7: warning: incorrect type in assignment (different base types)
    drivers/net/wireless/libertas/if_spi.c:171:7: expected unsigned short [unsigned] [usertype] buff
    drivers/net/wireless/libertas/if_spi.c:171:7: got restricted __le16 [usertype]
    drivers/net/wireless/libertas/if_spi.c:243:24: warning: incorrect type in argument 1 (different base types)
    drivers/net/wireless/libertas/if_spi.c:243:24: expected restricted __le16 const [usertype] *p
    drivers/net/wireless/libertas/if_spi.c:243:24: got unsigned short *
    drivers/net/wireless/libertas/if_spi.c:243:24: warning: incorrect type in argument 1 (different base types)
    drivers/net/wireless/libertas/if_spi.c:243:24: expected restricted __le16 const [usertype] *p
    drivers/net/wireless/libertas/if_spi.c:243:24: got unsigned short *
    drivers/net/wireless/libertas/if_spi.c:171:7: warning: incorrect type in assignment (different base types)
    drivers/net/wireless/libertas/if_spi.c:171:7: expected unsigned short [unsigned] [usertype] buff
    drivers/net/wireless/libertas/if_spi.c:171:7: got restricted __le16 [usertype]
    drivers/net/wireless/libertas/if_spi.c:171:7: warning: incorrect type in assignment (different base types)
    drivers/net/wireless/libertas/if_spi.c:171:7: expected unsigned short [unsigned] [usertype] buff
    drivers/net/wireless/libertas/if_spi.c:171:7: got restricted __le16 [usertype]
    drivers/net/wireless/libertas/if_spi.c:243:24: warning: incorrect type in argument 1 (different base types)
    drivers/net/wireless/libertas/if_spi.c:243:24: expected restricted __le16 const [usertype] *p
    drivers/net/wireless/libertas/if_spi.c:243:24: got unsigned short *

    Signed-off-by: Holger Schurig
    Signed-off-by: John W. Linville

    Holger Schurig
     
  • 'struct b43_wl' declaration is missing at 'leds.h'.
    It should be declared to avoid getting some GCC warnings at 'b43_leds_unregister'.

    Signed-off-by: Miguel Botón
    Signed-off-by: John W. Linville

    Miguel Boton
     
  • "b43: Fix PPC crash in rfkill polling on unload" fixed the bug reported
    in Bugzilla No. 14181; however, it introduced a new bug. Whenever the
    radio switch was turned off, it was necessary to unload and reload
    the driver for it to recognize the switch again.

    This patch fixes both the original bug in #14181 and the bug introduced by
    the previous patch. It must be stated, however, that if there is a BCM4306/3
    with an rfkill switch (not yet proven), then the driver will need an
    unload/reload cycle to turn the device back on.

    Signed-off-by: Larry Finger
    Signed-off-by: John W. Linville

    Larry Finger
     
  • Signed-off-by: Benoit PAPILLAULT
    Signed-off-by: Ivo van Doorn
    Signed-off-by: John W. Linville

    Benoit PAPILLAULT
     

27 Oct, 2009

10 commits

  • Add include asm/cacheflush.h, because declaration of __flush_purge_region
    moved to asm/cacheflush.h.

    Signed-off-by: Nobuhiro Iwamatsu
    Signed-off-by: David S. Miller

    Nobuhiro Iwamatsu
     
  • Be more careful about the state of pointers during tear-down.
    The "pppoe_dev" field can only be looked at safely while holding socket locks.
    This subsequently allows for the flush_lock to be killed.

    We depend on the PPPOX_CONNECTED state to tell us that that those fields are
    valid, so whoever clears that state (pppox_unbind_sock()) is responsible for
    the dev_put() call.

    We also have to ensure that we delete_item() on all sockets before they are
    cleaned up.

    The need for these changes has been exposed by scenarios wherein namespace
    bindings of ethernet devices change while there are ongoing PPPoE sessions,
    which resulted in oopses due to unusual socket connection termination paths,
    exposing these issues.

    Signed-off-by: Michal Ostrowski
    Reviewed-by: Cyril Gorcunov
    Reported-by: Denys Fedoryschenko
    Tested-by: Denys Fedoryschenko

    Michal Ostrowski
     
  • PCH-based parts (82577/82578) and some ICH8-based parts (82566) need to
    hold the swflag (sw/fw/hw hardware semaphore) over consecutive PHY accesses
    in order to perform sw-driven PHY configuration during initialization to
    workaround known hardware issues (see follow-on patch). This patch
    provides new PHY read/write functions (and function pointers) that will
    allow accessing the PHY registers assuming the swflag has already been
    acquired. The actual PHY register access code has moved into helper
    functions that are called with a flag indicating whether or not the swflag
    has already been acquired and acquires/releases it if not.

    The functions called from within the updated PHY access functions had to be
    updated to assume the swflag was already acquired, and other functions that
    called those functions were also updated to acquire/release the swflag.

    Signed-off-by: Bruce Allan
    Signed-off-by: Jeff Kirsher
    Signed-off-by: David S. Miller

    Bruce Allan
     
  • Accesses to NVM and PHY/CSR registers on ICHx/PCH-based parts are protected
    from concurrent accesses with a mutex that is acquired when the access is
    initiated and released when the access has completed. However, the two
    types of accesses should not be protected by the same mutex because the
    driver may have to access the NVM while already holding the mutex over
    several consecutive PHY/CSR accesses which would result in livelock.

    Signed-off-by: Bruce Allan
    Signed-off-by: Jeff Kirsher
    Signed-off-by: David S. Miller

    Bruce Allan
     
  • Unlike previous ICHx-based parts, the PCH-based parts (82577/82578) require
    LPLU (Low Power Link Up, or "reverse auto-negotiation") to be configured in
    the PHY rather than the MAC.

    Signed-off-by: Bruce Allan
    Signed-off-by: Jeff Kirsher
    Signed-off-by: David S. Miller

    Bruce Allan
     
  • In some conditions (e.g. when AMT is enabled on the system), it is possible
    to take an extended period of time to for the driver to acquire the sw/fw/hw
    hardware semaphore used to protect against concurrent access of a shared
    resource (e.g. PHY registers). This could cause PHY registers to not get
    configured properly resulting in link issues.

    Signed-off-by: Bruce Allan
    Signed-off-by: Jeff Kirsher
    Signed-off-by: David S. Miller

    Bruce Allan
     
  • Performing a dummy read of the PHY Wakeup Control (WUC) register clears the
    wakeup enable bit set by an PHY reset. If this bit remains set, link
    problems may occur.

    Signed-off-by: Bruce Allan
    Signed-off-by: Jeff Kirsher
    Signed-off-by: David S. Miller

    Bruce Allan
     
  • This patch resolves a memory leak which occurs while changing the ring size
    while the interface is down.

    Signed-off-by: Alexander Duyck
    Signed-off-by: Jeff Kirsher
    Signed-off-by: David S. Miller

    Alexander Duyck
     
  • This patch resolves a memory leak that occurs when you resize the rings via
    the ethtool -G option while the interface is down.

    Signed-off-by: Alexander Duyck
    Signed-off-by: Jeff Kirsher
    Signed-off-by: David S. Miller

    Alexander Duyck
     
  • Changing ring sizes while the interface was down was causing a double
    allocation of the receive and transmit rings. This issue is amplified when
    there are multiple rings enabled. To prevent this we need to add an
    additional check which will just update the ring counts when the interface
    is not up and skip the allocation steps.

    Signed-off-by: Alexander Duyck
    Signed-off-by: Jeff Kirsher
    Signed-off-by: David S. Miller

    Alexander Duyck
     

24 Oct, 2009

3 commits

  • Modify bonding hash transmit policies to use the psource MAC address of
    the packet instead of the MAC address configured for the bonding device.

    The old sitation conflicts with the documentation.

    Signed-off-by: Jasper Spaans
    Acked-by: Eric Dumazet
    Signed-off-by: Jay Vosburgh
    Signed-off-by: David S. Miller

    Jasper Spaans
     
  • The DM9000B revision ID is 0x1A, not 0x1B as set in the curernt
    dm9000.h header.

    Fix bug reported by Paolo Zebelloni.

    Signed-off-by: Ben Dooks
    Signed-off-by: Simtec Linux Team
    Signed-off-by: David S. Miller

    Ben Dooks
     
  • The 8110SC rev d chip on our board shows a regression which the 8110SB chip
    did not have. When inbound traffic is overflowing the receive descriptor queue,
    "holes" in the ring buffer may occur which lead to a hangup until the buffer
    is filled again. The packets are than completely processed, but the ring
    remains porous and no packets are processed until the next overflow. Setting
    the interface down and up can fix the problem temporary from userspace.

    For some reason we don't know, this behaviour is not occuring if the RxVlan
    bit for hardware VLAN untagging is set. There is another "Work around for
    AMD plateform" in the current code which checks the VLAN status
    word in receive descriptors, but does never come to effect when hardware
    VLAN support is enabled. We assume that this is a bug in the chip.

    The following patch fixes the problem. Without the patch we could reproduce
    the hang within minutes (given other devices also generating lots of
    interrupts), without we couldn't reproduce within a few days of long term
    testing.

    This version contains minor style adjustments and is sent with mutt which
    will hopefully not destroy the formatting again.

    Signed-off-by: Bernhard Schmidt
    Signed-off-by: Simon Wunderlich
    Acked-by: Francois Romieu
    Signed-off-by: David S. Miller

    Simon Wunderlich
     

23 Oct, 2009

8 commits

  • At this point (ri_tasklet()), RTNL or dev_base_lock are not held,
    we must use dev_get_by_index() instead of __dev_get_by_index()

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

    Eric Dumazet
     
  • fixes the following build failure:
    CC drivers/net/au1000_eth.o
    /drivers/net/au1000_eth.c: In function 'au1000_set_settings':
    /drivers/net/au1000_eth.c:623: error: implicit declaration of function 'capable'
    /drivers/net/au1000_eth.c:623: error: 'CAP_NET_ADMIN' undeclared (first use in this function)
    /drivers/net/au1000_eth.c:623: error: (Each undeclared identifier is reported only once
    /drivers/net/au1000_eth.c:623: error: for each function it appears in.

    Signed-off-by: Manuel Lauss
    Signed-off-by: David S. Miller

    Manuel Lauss
     
  • Improve the reporting of myri10ge port type in ethtool,
    and update for new boards.

    Signed-off-by: Brice Goglin
    Signed-off-by: Andrew Gallatin
    Signed-off-by: David S. Miller

    Brice Goglin
     
  • The PHY on 82577/82578 parts needs a soft reset when transitioning to Sx
    state in order for the PHY write which disables gigabit speed to take
    effect. Gigabit speed must be disabled in order for the PHY writes to
    registers on page 800 (the wakeup control registers) to work as expected
    otherwise the system might not wake via WoL.

    Signed-off-by: Bruce Allan
    Signed-off-by: Jeff Kirsher
    Signed-off-by: David S. Miller

    Bruce Allan
     
  • There's a circular locking dependency:

    ---> isdn_net_get_locked_lp
        --->lock &nd->queue_lock
        --->lock &nd->queue->xmit_lock
        .....................
        ---->unlock &nd->queue_lock

    ---> isdn_net_writebuf_skb (called with &nd->queue->xmit_lock locked)
        ---->isdn_net_inc_frame_cnt
             ---->isdn_net_device_busy
                  ----> lock &nd->queue_lock

    This will trigger lockdep warnings:

     =======================================================
     [ INFO: possible circular locking dependency detected ]
     2.6.32-rc4-testing #7
     -------------------------------------------------------
     ipppd/28379 is trying to acquire lock:
     (&netdev->queue_lock){......}, at: [] isdn_net_device_busy+0x2c/0x74 [isdn]

     but task is already holding lock:
     (&netdev->local->xmit_lock){+.....}, at: [] isdn_net_write_super+0x3f/0x6e [isdn]

     which lock already depends on the new lock.
    .......

    We don't need to lock nd->queue->xmit_lock to protect single
    isdn_net_lp_busy(). This can fix above lockdep warnings.

    Reported-and-tested-by: Tilman Schmidt
    Signed-off-by: Xiaotian Feng
    Signed-off-by: David S. Miller

    Xiaotian Feng
     
  • Old code assumed board config version in the flash to be 1.
    When this will get changed by tools, driver just refuses to
    attach. This is unnecessary since driver does not have to
    parse board config structure directly (maintained by firmware).

    Signed-off-by: Dhananjay Phadke
    Signed-off-by: David S. Miller

    Dhananjay Phadke
     
  • Clear NX_RESETING bit in netxen_tx_timeout_task() so that
    the firmware watchdog task can catch need_reset request
    from tx timeout.

    Signed-off-by: Amit Kumar Salecha
    Signed-off-by: Dhananjay Phadke
    Signed-off-by: David S. Miller

    Amit Kumar Salecha
     
  • Avoid resetting subsys ID in i2c block. Also remove duplicate
    check for address tranlsation error.

    Signed-off-by: Dhananjay Phadke
    Signed-off-by: David S. Miller

    Dhananjay Phadke