1. 02 12月, 2012 1 次提交
  2. 30 11月, 2012 3 次提交
    • N
      bonding: fix race condition in bonding_store_slaves_active · e196c0e5
      nikolay@redhat.com 提交于
      Race between bonding_store_slaves_active() and slave manipulation
       functions. The bond_for_each_slave use in bonding_store_slaves_active()
       is not protected by any synchronization mechanism.
       NULL pointer dereference is easy to reach.
       Fixed by acquiring the bond->lock for the slave walk.
      
       v2: Make description text < 75 columns
      Signed-off-by: NNikolay Aleksandrov <nikolay@redhat.com>
      Signed-off-by: NJay Vosburgh <fubar@us.ibm.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      e196c0e5
    • N
      bonding: make arp_ip_target parameter checks consistent with sysfs · 90fb6250
      nikolay@redhat.com 提交于
      The module can be loaded with arp_ip_target="255.255.255.255" which makes
       it impossible to remove as the function in sysfs checks for that value,
       so we make the parameter checks consistent with sysfs.
      
       v2: Fix formatting
       v3: Make description text < 75 columns
      Signed-off-by: NNikolay Aleksandrov <nikolay@redhat.com>
      Signed-off-by: NJay Vosburgh <fubar@us.ibm.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      90fb6250
    • N
      bonding: fix miimon and arp_interval delayed work race conditions · fbb0c41b
      nikolay@redhat.com 提交于
      First I would give three observations which will be used later.
      Observation 1: if (delayed_work_pending(wq)) cancel_delayed_work(wq)
       This usage is wrong because the pending bit is cleared just before the
       work's fn is executed and if the function re-arms itself we might end up
       with the work still running. It's safe to call cancel_delayed_work_sync()
       even if the work is not queued at all.
      Observation 2: Use of INIT_DELAYED_WORK()
       Work needs to be initialized only once prior to (de/en)queueing.
      Observation 3: IFF_UP is set only after ndo_open is called
      
      Related race conditions:
      1. Race between bonding_store_miimon() and bonding_store_arp_interval()
       Because of Obs.1 we can end up having both works enqueued.
      2. Multiple races with INIT_DELAYED_WORK()
       Since the works are not protected by anything between INIT_DELAYED_WORK()
       and calls to (en/de)queue it is possible for races between the following
       functions:
       (races are also possible between the calls to INIT_DELAYED_WORK()
        and workqueue code)
       bonding_store_miimon() - bonding_store_arp_interval(), bond_close(),
      			  bond_open(), enqueued functions
       bonding_store_arp_interval() - bonding_store_miimon(), bond_close(),
      				bond_open(), enqueued functions
      3. By Obs.1 we need to change bond_cancel_all()
      
      Bugs 1 and 2 are fixed by moving all work initializations in bond_open
      which by Obs. 2 and Obs. 3 and the fact that we make sure that all works
      are cancelled in bond_close(), is guaranteed not to have any work
      enqueued.
      Also RTNL lock is now acquired in bonding_store_miimon/arp_interval so
      they can't race with bond_close and bond_open. The opposing work is
      cancelled only if the IFF_UP flag is set and it is cancelled
      unconditionally. The opposing work is already cancelled if the interface
      is down so no need to cancel it again. This way we don't need new
      synchronizations for the bonding workqueue. These bugs (and fixes) are
      tied together and belong in the same patch.
      Note: I have left 1 line intentionally over 80 characters (84) because I
            didn't like how it looks broken down. If you'd prefer it otherwise,
            then simply break it.
      
       v2: Make description text < 75 columns
      Signed-off-by: NNikolay Aleksandrov <nikolay@redhat.com>
      Signed-off-by: NJay Vosburgh <fubar@us.ibm.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      fbb0c41b
  3. 29 11月, 2012 3 次提交
  4. 27 11月, 2012 1 次提交
  5. 24 11月, 2012 2 次提交
  6. 22 11月, 2012 4 次提交
  7. 21 11月, 2012 6 次提交
  8. 20 11月, 2012 1 次提交
    • S
      of/net/mdio-gpio: Fix pdev->id issue when using devicetrees. · 3272dd9b
      Srinivas Kandagatla 提交于
      When the mdio-gpio driver is probed via device trees, the platform
      device id is set as -1, However the pdev->id is re-used as bus-id for
      while creating mdio gpio bus.
      So
      For device tree case the mdio-gpio bus name appears as "gpio-ffffffff"
      where as
      for non-device tree case the bus name appears as "gpio-<bus-num>"
      
      Which means the bus_id is fixed in device tree case, so we can't have
      two mdio gpio buses via device trees. Assigning a logical bus number
      via device tree solves the problem and the bus name is much consistent
      with non-device tree bus name.
      
      Without this patch
      1. we can't support two mdio-gpio buses via device trees.
      2. we should always pass gpio-ffffffff as bus name to phy_connect, very
      different to non-device tree bus name.
      
      So, setting up the bus_id via aliases from device tree is the right
      solution and other drivers do similar thing.
      Signed-off-by: NSrinivas Kandagatla <srinivas.kandagatla@st.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      3272dd9b
  9. 19 11月, 2012 2 次提交
  10. 18 11月, 2012 1 次提交
  11. 17 11月, 2012 3 次提交
  12. 16 11月, 2012 1 次提交
  13. 15 11月, 2012 4 次提交
    • D
      Revert "drivers/net/phy/mdio-bitbang.c: Call mdiobus_unregister before mdiobus_free" · 80d11788
      David S. Miller 提交于
      This reverts commit aa731872.
      
      As pointed out by Ben Hutchings, this change is not correct.
      
      mdiobus_unregister() can't be called if the bus isn't registered yet,
      however this change can result in situations which cause that to
      happen.
      
      Part of the confusion here revolves around the fact that the
      callers of this module control registration/unregistration,
      rather than the module itself.
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      80d11788
    • K
      net/smsc911x: Fix ready check in cases where WORD_SWAP is needed · 769ce4c9
      Kamlakant Patel 提交于
      The chip ready check added by the commit 3ac3546e [Always wait for
      the chip to be ready] does not work when the register read/write
      is word swapped. This check has been added before the WORD_SWAP
      register is programmed, so we need to check for swapped register
      value as well.
      
      Bit 16 is marked as RESERVED in SMSC datasheet, Steve Glendinning
      <steve@shawell.net> checked with SMSC and wrote:
      
        The chip architects have concluded we should be reading PMT_CTRL
        until we see any of bits 0, 8, 16 or 24 set.  Then we should read
        BYTE_TEST to check the byte order is correct (as we already do).
      
        The rationale behind this is that some of the chip variants have
        word order swapping features too, so the READY bit could actually
        be in any of the 4 possible locations.  The architects have confirmed
        that if any of these 4 positions is set the chip is ready.  The other
        3 locations will either never be set or can only go high after READY
        does (so also indicate the device is ready).
      
      This change will check for the READY bit at the 16th position. We do
      not check the other two cases (bit 8 and 24) since the driver does not
      support byte-swapped register read/write.
      Signed-off-by: NKamlakant Patel <kamlakant.patel@broadcom.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      769ce4c9
    • X
      drivers/net: fix tasklet misuse issue · 71c6c837
      Xiaotian Feng 提交于
      In commit 175c0dff, drivers uses tasklet_kill to avoid put disabled tasklet
      on the tasklet vec. But some of the drivers uses tasklet_init & tasklet_disable
      in the driver init code, then tasklet_enable when it is opened. This makes
      tasklet_enable on a killed tasklet and make ksoftirqd crazy then. Normally,
      drivers should use tasklet_init/tasklet_kill on device open/remove, and use
      tasklet_disable/tasklet_enable on device suspend/resume.
      Reported-by: NPeter Wu <lekensteyn@gmail.com>
      Tested-by: NPeter Wu <lekensteyn@gmail.com>
      Signed-off-by: NXiaotian Feng <dannyfeng@tencent.com>
      Cc: "David S. Miller" <davem@davemloft.net>
      Cc: netdev@vger.kernel.org
      Cc: linux-kernel@vger.kernel.org
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      71c6c837
    • H
      brcmfmac: fix typo in CONFIG_BRCMISCAN · d61f978b
      Hauke Mehrtens 提交于
      The old ifdef CONFIG_BRCMFISCAN looks wrong to me and it makes more
      sense when CONFIG_BRCMISCAN is used.
      This patch was just compile tested by me, but not runtime tested.
      Signed-off-by: NHauke Mehrtens <hauke@hauke-m.de>
      Acked-by: NFranky Lin <frankyl@broadcom.com>
      Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
      d61f978b
  14. 14 11月, 2012 6 次提交
  15. 10 11月, 2012 2 次提交