1. 08 Mar, 2012 2 commits
    • Grant Likely's avatar
      drivercore: Add driver probe deferral mechanism · d1c3414c
      Grant Likely authored
      Allow drivers to report at probe time that they cannot get all the resources
      required by the device, and should be retried at a later time.
      
      This should completely solve the problem of getting devices
      initialized in the right order.  Right now this is mostly handled by
      mucking about with initcall ordering which is a complete hack, and
      doesn't even remotely handle the case where device drivers are in
      modules.  This approach completely sidesteps the issues by allowing
      driver registration to occur in any order, and any driver can request
      to be retried after a few more other drivers get probed.
      
      v4: - Integrate Manjunath's addition of a separate workqueue
          - Change -EAGAIN to -EPROBE_DEFER for drivers to trigger deferral
          - Update comment blocks to reflect how the code really works
      v3: - Hold off workqueue scheduling until late_initcall so that the bulk
            of driver probes are complete before we start retrying deferred devices.
          - Tested with simple use cases.  Still needs more testing though.
            Using it to get rid of the gpio early_initcall madness, or to replace
            the ASoC internal probe deferral code would be ideal.
      v2: - added locking so it should no longer be utterly broken in that regard
          - remove device from deferred list at device_del time.
          - Still completely untested with any real use case, but has been
            boot tested.
      Signed-off-by: default avatarGrant Likely <grant.likely@secretlab.ca>
      Cc: Mark Brown <broonie@opensource.wolfsonmicro.com>
      Cc: Arnd Bergmann <arnd@arndb.de>
      Cc: Dilan Lee <dilee@nvidia.com>
      Cc: Manjunath GKondaiah <manjunath.gkondaiah@linaro.org>
      Cc: Alan Stern <stern@rowland.harvard.edu>
      Cc: Tony Lindgren <tony@atomide.com>
      Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
      Reviewed-by: default avatarMark Brown <broonie@opensource.wolfsonmicro.com>
      Acked-by: default avatarDavid Daney <david.daney@cavium.com>
      Reviewed-by: default avatarArnd Bergmann <arnd@arndb.de>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      d1c3414c
    • Renata Sayakhova's avatar
  2. 24 Feb, 2012 4 commits
    • NeilBrown's avatar
      w1_bq27000: Only one thread can access the bq27000 at a time. · f6e8a1d7
      NeilBrown authored
      If multiple threads try, they trip over each other badly.
      Signed-off-by: default avatarNeilBrown <neilb@suse.de>
      Acked-by: default avatarEvgeniy Polyakov <zbr@ioremap.net>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      f6e8a1d7
    • NeilBrown's avatar
      w1_bq27000 - remove w1_bq27000_write · df7019f3
      NeilBrown authored
      The function is never used so remove it to avoid bit-rot.
      It can trivially be re-added if there is ever a need.
      Signed-off-by: default avatarNeilBrown <neilb@suse.de>
      Acked-by: default avatarEvgeniy Polyakov <zbr@ioremap.net>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      df7019f3
    • NeilBrown's avatar
      w1_bq27000: remove unnecessary NULL test. · b6c40b85
      NeilBrown authored
      As recent change means that we now dereference 'dev' before testing
      for NULL.
      
      That means either the change was wrong, or the test isn't needed.
      As this function is only called from one driver (bq27x000_battery) and
      it always passed a non-NULL dev, it seems good to assume that the
      test isn't needed.
      
      So remove it.
      Reported-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
      Signed-off-by: default avatarNeilBrown <neilb@suse.de>
      Acked-by: default avatarEvgeniy Polyakov <zbr@ioremap.net>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      b6c40b85
    • Masami Ichikawa's avatar
      sysfs: Fix memory leak in sysfs_sd_setsecdata(). · 93518dd2
      Masami Ichikawa authored
      This patch fixies follwing two memory leak patterns that reported by kmemleak.
      sysfs_sd_setsecdata() is called during sys_lsetxattr() operation.
      It checks sd->s_iattr is NULL or not. Then if it is NULL, it calls
      sysfs_init_inode_attrs() to allocate memory.
      That code is this.
      
      iattrs = sd->s_iattr;
      if (!iattrs)
                      iattrs = sysfs_init_inode_attrs(sd);
      
      The iattrs recieves sysfs_init_inode_attrs()'s result,  but sd->s_iattr
      doesn't know the address. so it needs to set correct address to
      sd->s_iattr to free memory in other function.
      
      unreferenced object 0xffff880250b73e60 (size 32):
        comm "systemd", pid 1, jiffies 4294683888 (age 94.553s)
        hex dump (first 32 bytes):
          73 79 73 74 65 6d 5f 75 3a 6f 62 6a 65 63 74 5f  system_u:object_
          72 3a 73 79 73 66 73 5f 74 3a 73 30 00 00 00 00  r:sysfs_t:s0....
        backtrace:
          [<ffffffff814cb1d0>] kmemleak_alloc+0x73/0x98
          [<ffffffff811270ab>] __kmalloc+0x100/0x12c
          [<ffffffff8120775a>] context_struct_to_string+0x106/0x210
          [<ffffffff81207cc1>] security_sid_to_context_core+0x10b/0x129
          [<ffffffff812090ef>] security_sid_to_context+0x10/0x12
          [<ffffffff811fb0da>] selinux_inode_getsecurity+0x7d/0xa8
          [<ffffffff811fb127>] selinux_inode_getsecctx+0x22/0x2e
          [<ffffffff811f4d62>] security_inode_getsecctx+0x16/0x18
          [<ffffffff81191dad>] sysfs_setxattr+0x96/0x117
          [<ffffffff811542f0>] __vfs_setxattr_noperm+0x73/0xd9
          [<ffffffff811543d9>] vfs_setxattr+0x83/0xa1
          [<ffffffff811544c6>] setxattr+0xcf/0x101
          [<ffffffff81154745>] sys_lsetxattr+0x6a/0x8f
          [<ffffffff814efda9>] system_call_fastpath+0x16/0x1b
          [<ffffffffffffffff>] 0xffffffffffffffff
      unreferenced object 0xffff88024163c5a0 (size 96):
        comm "systemd", pid 1, jiffies 4294683888 (age 94.553s)
        hex dump (first 32 bytes):
          00 00 00 00 ed 41 00 00 00 00 00 00 00 00 00 00  .....A..........
          00 00 00 00 00 00 00 00 0c 64 42 4f 00 00 00 00  .........dBO....
        backtrace:
          [<ffffffff814cb1d0>] kmemleak_alloc+0x73/0x98
          [<ffffffff81127402>] kmem_cache_alloc_trace+0xc4/0xee
          [<ffffffff81191cbe>] sysfs_init_inode_attrs+0x2a/0x83
          [<ffffffff81191dd6>] sysfs_setxattr+0xbf/0x117
          [<ffffffff811542f0>] __vfs_setxattr_noperm+0x73/0xd9
          [<ffffffff811543d9>] vfs_setxattr+0x83/0xa1
          [<ffffffff811544c6>] setxattr+0xcf/0x101
          [<ffffffff81154745>] sys_lsetxattr+0x6a/0x8f
          [<ffffffff814efda9>] system_call_fastpath+0x16/0x1b
          [<ffffffffffffffff>] 0xffffffffffffffff
      `
      Signed-off-by: default avatarMasami Ichikawa <masami256@gmail.com>
      Cc: stable <stable@vger.kernel.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      93518dd2
  3. 16 Feb, 2012 2 commits
  4. 15 Feb, 2012 1 commit
  5. 13 Feb, 2012 5 commits
  6. 10 Feb, 2012 2 commits
  7. 09 Feb, 2012 8 commits
  8. 02 Feb, 2012 4 commits
  9. 31 Jan, 2012 5 commits
  10. 30 Jan, 2012 7 commits
    • Linus Torvalds's avatar
      Merge tag 'tty-3.3-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty · 27ba234c
      Linus Torvalds authored
      Here are some tty/serial patches for 3.3-rc1
      
      Big thing here is the movement of the 8250 serial drivers to their own
      directory, now that the patch churn has calmed down.
      
      Other than that, only minor stuff (omap patches were reverted as they
      were found to be wrong), and another broken driver removed from the
      system.
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      
      * tag 'tty-3.3-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty:
        serial: Kill off Moorestown code
        Revert "tty: serial: OMAP: ensure FIFO levels are set correctly in non-DMA mode"
        Revert "tty: serial: OMAP: transmit FIFO threshold interrupts don't wake the chip"
        serial: Fix wakeup init logic to speed up startup
        docbook: don't use serial_core.h in device-drivers book
        serial: amba-pl011: lock console writes against interrupts
        amba-pl011: do not disable RTS during shutdown
        tty: serial: OMAP: transmit FIFO threshold interrupts don't wake the chip
        tty: serial: OMAP: ensure FIFO levels are set correctly in non-DMA mode
        omap-serial: make serial_omap_restore_context depend on CONFIG_PM_RUNTIME
        omap-serial :Make the suspend/resume functions depend on CONFIG_PM_SLEEP.
        TTY: fix UV serial console regression
        jsm: Fixed EEH recovery error
        Updated TTY MAINTAINERS info
        serial: group all the 8250 related code together
      27ba234c
    • Linus Torvalds's avatar
      Merge tag 'usb-3.3-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb · 6bc2b95e
      Linus Torvalds authored
      Here are a bunch of USB patches for 3.3-rc1.
      
      Nothing major, largest thing here is the removal of some drivers that
      did not work at all.  Other than that, the normal collection of bugfixes
      and new device ids.
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      
      * tag 'usb-3.3-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb: (52 commits)
        uwb & wusb: fix kconfig error
        USB: Realtek cr: fix autopm scheduling while atomic
        USB: ftdi_sio: Add more identifiers
        xHCI: Cleanup isoc transfer ring when TD length mismatch found
        usb: musb: omap2430: minor cleanups.
        qcaux: add more Pantech UML190 and UML290 ports
        Revert "drivers: usb: Fix dependency for USB_HWA_HCD"
        usb: mv-otg - Fix build if CONFIG_USB is not set
        USB: cdc-wdm: Avoid hanging on interface with no USB_CDC_DMM_TYPE
        usb: add support for STA2X11 host driver
        drivers: usb: Fix dependency for USB_HWA_HCD
        kernel-doc: fix new warning in usb.h
        USB: OHCI: fix new compiler warnings
        usb: serial: kobil_sct: fix compile warning:
        drivers/usb/host/ehci-fsl.c: add missing iounmap
        USB: cdc-wdm: better allocate a buffer that is at least as big as we tell the USB core
        USB: cdc-wdm: call wake_up_all to allow driver to shutdown on device removal
        USB: cdc-wdm: use two mutexes to allow simultaneous read and write
        USB: cdc-wdm: updating desc->length must be protected by spin_lock
        USB: usbsevseg: fix max length
        ...
      6bc2b95e
    • Linus Torvalds's avatar
      Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net · a14a8d93
      Linus Torvalds authored
      1) Setting link attributes can modify the size of the attributes that
         would be reported on a subsequent getlink netlink operation,
         therefore min_ifinfo_dump_size needs to be adjusted.  From Stefan
         Gula.
      
      2) Resegmentation of TSO frames while trimming can violate invariants
         expected by callers, namely that the number of segments can only stay
         the same or decrease, never increase.  If MSS changes, however, we
         can trim data but then end up with more segments.  Fix this by only
         segmenting to the MSS already recorded in the SKB.  That's the
         simplest fix for now and if we want to get more fancy in the future
         that's a more involved change.
      
         This probably explains some retransmit counter inaccuracies.
      
         From Neal Cardwell.
      
      3) Fix too-many-wakeups in POLL with AF_UNIX sockets, from Eric Dumazet.
      
      4) Fix CAIF crashes wrt.  namespace handling.  From Eric Dumazet and
         Eric W. Biederman.
      
      5) TCP port selection fixes from Flavio Leitner.
      
      6) More socket memory cgroup build fixes in certain randonfig
         situations.  From Glauber Costa.
      
      7) Fix TCP memory sysctl regression reported by Ingo Molnar, also from
         Glauber Costa.
      
      * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net:
        af_unix: fix EPOLLET regression for stream sockets
        tcp: fix tcp_trim_head() to adjust segment count with skb MSS
        net/tcp: Fix tcp memory limits initialization when !CONFIG_SYSCTL
        net caif: Register properly as a pernet subsystem.
        netns: Fail conspicously if someone uses net_generic at an inappropriate time.
        net: explicitly add jump_label.h header to sock.h
        net: RTNETLINK adjusting values of min_ifinfo_dump_size
        ipv6: Fix ip_gre lockless xmits.
        xen-netfront: correct MAX_TX_TARGET calculation.
        netns: fix net_alloc_generic()
        tcp: bind() optimize port allocation
        tcp: bind() fix autoselection to share ports
        l2tp: l2tp_ip - fix possible oops on packet receive
        iwlwifi: fix PCI-E transport "inta" race
        mac80211: set bss_conf.idle when vif is connected
        mac80211: update oper_channel on ibss join
      a14a8d93
    • Linus Torvalds's avatar
      Merge tag 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator · b527a233
      Linus Torvalds authored
      This fixes an integration issue with the regulator device tree bindings
      which shook out in -rc.  The bindings were overly enthusiatic when
      deciding to set a voltage on a regulator and would try to set zero volts
      on an unconfigured regulator which isn't supported.
      
      * tag 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator:
        regulator: Set apply_uV only when min and max voltages are defined
      b527a233
    • Eric Dumazet's avatar
      af_unix: fix EPOLLET regression for stream sockets · 6f01fd6e
      Eric Dumazet authored
      Commit 0884d7aa (AF_UNIX: Fix poll blocking problem when reading from
      a stream socket) added a regression for epoll() in Edge Triggered mode
      (EPOLLET)
      
      Appropriate fix is to use skb_peek()/skb_unlink() instead of
      skb_dequeue(), and only call skb_unlink() when skb is fully consumed.
      
      This remove the need to requeue a partial skb into sk_receive_queue head
      and the extra sk->sk_data_ready() calls that added the regression.
      
      This is safe because once skb is given to sk_receive_queue, it is not
      modified by a writer, and readers are serialized by u->readlock mutex.
      
      This also reduce number of spinlock acquisition for small reads or
      MSG_PEEK users so should improve overall performance.
      Reported-by: default avatarNick Mathewson <nickm@freehaven.net>
      Signed-off-by: default avatarEric Dumazet <eric.dumazet@gmail.com>
      Cc: Alexey Moiseytsev <himeraster@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      6f01fd6e
    • Neal Cardwell's avatar
      tcp: fix tcp_trim_head() to adjust segment count with skb MSS · 5b35e1e6
      Neal Cardwell authored
      This commit fixes tcp_trim_head() to recalculate the number of
      segments in the skb with the skb's existing MSS, so trimming the head
      causes the skb segment count to be monotonically non-increasing - it
      should stay the same or go down, but not increase.
      
      Previously tcp_trim_head() used the current MSS of the connection. But
      if there was a decrease in MSS between original transmission and ACK
      (e.g. due to PMTUD), this could cause tcp_trim_head() to
      counter-intuitively increase the segment count when trimming bytes off
      the head of an skb. This violated assumptions in tcp_tso_acked() that
      tcp_trim_head() only decreases the packet count, so that packets_acked
      in tcp_tso_acked() could underflow, leading tcp_clean_rtx_queue() to
      pass u32 pkts_acked values as large as 0xffffffff to
      ca_ops->pkts_acked().
      
      As an aside, if tcp_trim_head() had really wanted the skb to reflect
      the current MSS, it should have called tcp_set_skb_tso_segs()
      unconditionally, since a decrease in MSS would mean that a
      single-packet skb should now be sliced into multiple segments.
      Signed-off-by: default avatarNeal Cardwell <ncardwell@google.com>
      Acked-by: default avatarNandita Dukkipati <nanditad@google.com>
      Acked-by: default avatarIlpo Järvinen <ilpo.jarvinen@helsinki.fi>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      5b35e1e6
    • Glauber Costa's avatar
      net/tcp: Fix tcp memory limits initialization when !CONFIG_SYSCTL · 4acb4190
      Glauber Costa authored
      sysctl_tcp_mem() initialization was moved to sysctl_tcp_ipv4.c
      in commit 3dc43e3e, since it
      became a per-ns value.
      
      That code, however, will never run when CONFIG_SYSCTL is
      disabled, leading to bogus values on those fields - causing hung
      TCP sockets.
      
      This patch fixes it by keeping an initialization code in
      tcp_init(). It will be overwritten by the first net namespace
      init if CONFIG_SYSCTL is compiled in, and do the right thing if
      it is compiled out.
      
      It is also named properly as tcp_init_mem(), to properly signal
      its non-sysctl side effect on TCP limits.
      Reported-by: default avatarIngo Molnar <mingo@elte.hu>
      Signed-off-by: default avatarGlauber Costa <glommer@parallels.com>
      Cc: David S. Miller <davem@davemloft.net>
      Link: http://lkml.kernel.org/r/4F22D05A.8030604@parallels.com
      [ renamed the function, tidied up the changelog a bit ]
      Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      4acb4190