1. 17 11月, 2015 2 次提交
  2. 10 11月, 2015 2 次提交
  3. 07 11月, 2015 2 次提交
    • O
      signal: turn dequeue_signal_lock() into kernel_dequeue_signal() · be0e6f29
      Oleg Nesterov 提交于
      1. Rename dequeue_signal_lock() to kernel_dequeue_signal(). This
         matches another "for kthreads only" kernel_sigaction() helper.
      
      2. Remove the "tsk" and "mask" arguments, they are always current
         and current->blocked. And it is simply wrong if tsk != current.
      
      3. We could also remove the 3rd "siginfo_t *info" arg but it looks
         potentially useful. However we can simplify the callers if we
         change kernel_dequeue_signal() to accept info => NULL.
      
      4. Remove _irqsave, it is never called from atomic context.
      Signed-off-by: NOleg Nesterov <oleg@redhat.com>
      Reviewed-by: NTejun Heo <tj@kernel.org>
      Cc: David Woodhouse <dwmw2@infradead.org>
      Cc: Felipe Balbi <balbi@ti.com>
      Cc: Markus Pargmann <mpa@pengutronix.de>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      be0e6f29
    • M
      mm, page_alloc: distinguish between being unable to sleep, unwilling to sleep... · d0164adc
      Mel Gorman 提交于
      mm, page_alloc: distinguish between being unable to sleep, unwilling to sleep and avoiding waking kswapd
      
      __GFP_WAIT has been used to identify atomic context in callers that hold
      spinlocks or are in interrupts.  They are expected to be high priority and
      have access one of two watermarks lower than "min" which can be referred
      to as the "atomic reserve".  __GFP_HIGH users get access to the first
      lower watermark and can be called the "high priority reserve".
      
      Over time, callers had a requirement to not block when fallback options
      were available.  Some have abused __GFP_WAIT leading to a situation where
      an optimisitic allocation with a fallback option can access atomic
      reserves.
      
      This patch uses __GFP_ATOMIC to identify callers that are truely atomic,
      cannot sleep and have no alternative.  High priority users continue to use
      __GFP_HIGH.  __GFP_DIRECT_RECLAIM identifies callers that can sleep and
      are willing to enter direct reclaim.  __GFP_KSWAPD_RECLAIM to identify
      callers that want to wake kswapd for background reclaim.  __GFP_WAIT is
      redefined as a caller that is willing to enter direct reclaim and wake
      kswapd for background reclaim.
      
      This patch then converts a number of sites
      
      o __GFP_ATOMIC is used by callers that are high priority and have memory
        pools for those requests. GFP_ATOMIC uses this flag.
      
      o Callers that have a limited mempool to guarantee forward progress clear
        __GFP_DIRECT_RECLAIM but keep __GFP_KSWAPD_RECLAIM. bio allocations fall
        into this category where kswapd will still be woken but atomic reserves
        are not used as there is a one-entry mempool to guarantee progress.
      
      o Callers that are checking if they are non-blocking should use the
        helper gfpflags_allow_blocking() where possible. This is because
        checking for __GFP_WAIT as was done historically now can trigger false
        positives. Some exceptions like dm-crypt.c exist where the code intent
        is clearer if __GFP_DIRECT_RECLAIM is used instead of the helper due to
        flag manipulations.
      
      o Callers that built their own GFP flags instead of starting with GFP_KERNEL
        and friends now also need to specify __GFP_KSWAPD_RECLAIM.
      
      The first key hazard to watch out for is callers that removed __GFP_WAIT
      and was depending on access to atomic reserves for inconspicuous reasons.
      In some cases it may be appropriate for them to use __GFP_HIGH.
      
      The second key hazard is callers that assembled their own combination of
      GFP flags instead of starting with something like GFP_KERNEL.  They may
      now wish to specify __GFP_KSWAPD_RECLAIM.  It's almost certainly harmless
      if it's missed in most cases as other activity will wake kswapd.
      Signed-off-by: NMel Gorman <mgorman@techsingularity.net>
      Acked-by: NVlastimil Babka <vbabka@suse.cz>
      Acked-by: NMichal Hocko <mhocko@suse.com>
      Acked-by: NJohannes Weiner <hannes@cmpxchg.org>
      Cc: Christoph Lameter <cl@linux.com>
      Cc: David Rientjes <rientjes@google.com>
      Cc: Vitaly Wool <vitalywool@gmail.com>
      Cc: Rik van Riel <riel@redhat.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      d0164adc
  4. 29 10月, 2015 1 次提交
    • T
      usb: musb: omap2430: Fix regression caused by driver core change · 8f2279d5
      Tony Lindgren 提交于
      Commit ddef08dd ("Driver core: wakeup the parent device before trying
      probe") started automatically ensuring the parent device is enabled when
      the child gets probed.
      
      This however caused a regression for MUSB omap2430 interface as the
      runtime PM for the parent device needs the child initialized to access
      the MUSB hardware registers.
      
      Let's delay the enabling of PM runtime for the parent until the child
      has been properly initialized as suggested in an earlier patch by
      Grygorii Strashko <grygorii.strashko@ti.com>.
      
      In addition to delaying pm_runtime_enable, we now also need to make sure
      the parent is enabled during omap2430_musb_init. We also want to propagate
      an error from omap2430_runtime_resume if struct musb is not initialized.
      
      Note that we use pm_runtime_put_noidle here for both the child and parent
      to prevent an extra runtime_suspend/resume cycle.
      
      Let's also add some comments to avoid confusion between the
      two different devices.
      
      Fixes: ddef08dd ("Driver core: wakeup the parent device before
      trying probe")
      Suggested-by: NGrygorii Strashko <grygorii.strashko@ti.com>
      Reviewed-by: NGrygorii Strashko <grygorii.strashko@ti.com>
      Acked-by: NFelipe Balbi <balbi@ti.com>
      Signed-off-by: NTony Lindgren <tony@atomide.com>
      8f2279d5
  5. 28 10月, 2015 1 次提交
  6. 26 10月, 2015 1 次提交
  7. 25 10月, 2015 4 次提交
    • A
      usb: misc: usb3503: Use i2c_add_driver helper macro · aa5b477d
      Andrew F. Davis 提交于
      Use i2c_add_driver as it will add THIS_MODULE for us.
      Signed-off-by: NAndrew F. Davis <afd@ti.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      aa5b477d
    • V
      usb: host: lpc32xx: don't unregister phy device · 164f0aa8
      Vladimir Zapolskiy 提交于
      There is no need to unregister the I2C device, which serves as a phy
      from host code, this should be done in the correspondent phy driver.
      Signed-off-by: NVladimir Zapolskiy <vz@mleia.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      164f0aa8
    • V
      usb: host: lpc32xx: balance clk enable/disable on removal · b1a0c423
      Vladimir Zapolskiy 提交于
      The change adds missing clk_disable_unprepare(usb_otg_clk) call, also
      the disabled clocks are sorted in order opposite to enabled clocks.
      Signed-off-by: NVladimir Zapolskiy <vz@mleia.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      b1a0c423
    • V
      usb: host: lpc32xx: fix warnings caused by enabling unprepared clock · 9ae79876
      Vladimir Zapolskiy 提交于
      If common clock framework is configured, the driver generates a warning,
      which is fixed by this change:
      
          WARNING: CPU: 0 PID: 573 at drivers/clk/clk.c:728 clk_core_enable+0x2c/0xf0()
          Modules linked in: ohci_nxp(+) sc16is7xx snd_soc_uda1380
          CPU: 0 PID: 573 Comm: udevd Not tainted 4.3.0-rc2+ #285
          Hardware name: LPC32XX SoC (Flattened Device Tree)
          Backtrace:
          [<>] (dump_backtrace) from [<>] (show_stack+0x18/0x1c)
          [<>] (show_stack) from [<>] (dump_stack+0x20/0x28)
          [<>] (dump_stack) from [<>] (warn_slowpath_common+0x90/0xb8)
          [<>] (warn_slowpath_common) from [<>] (warn_slowpath_null+0x24/0x2c)
          [<>] (warn_slowpath_null) from [<>] (clk_core_enable+0x2c/0xf0)
          [<>] (clk_core_enable) from [<>] (clk_enable+0x24/0x38)
          [<>] (clk_enable) from [<>] (ohci_hcd_nxp_probe+0x1d0/0x518 [ohci_nxp])
          [<>] (ohci_hcd_nxp_probe [ohci_nxp]) from [<>] (platform_drv_probe+0x50/0xa0)
          [<>] (platform_drv_probe) from [<>] (driver_probe_device+0x18c/0x408)
          [<>] (driver_probe_device) from [<>] (__driver_attach+0x70/0x94)
          [<>] (__driver_attach) from [<>] (bus_for_each_dev+0x74/0x98)
          [<>] (bus_for_each_dev) from [<>] (driver_attach+0x20/0x28)
          [<>] (driver_attach) from [<>] (bus_add_driver+0x11c/0x248)
          [<>] (bus_add_driver) from [<>] (driver_register+0xa4/0xe8)
          [<>] (driver_register) from [<>] (__platform_driver_register+0x50/0x64)
          [<>] (__platform_driver_register) from [<>] (ohci_nxp_init+0x3c/0x5c [ohci_nxp])
          [<>] (ohci_nxp_init [ohci_nxp]) from [<>] (do_one_initcall+0x11c/0x1dc)
          [<>] (do_one_initcall) from [<>] (do_init_module+0x60/0x368)
          [<>] (do_init_module) from [<>] (load_module+0x16d0/0x1b7c)
          [<>] (load_module) from [<>] (SyS_finit_module+0x90/0xa4)
          [<>] (SyS_finit_module) from [<>] (ret_fast_syscall+0x0/0x38)
      Signed-off-by: NVladimir Zapolskiy <vz@mleia.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      9ae79876
  8. 23 10月, 2015 1 次提交
  9. 22 10月, 2015 6 次提交
  10. 21 10月, 2015 1 次提交
  11. 20 10月, 2015 1 次提交
  12. 19 10月, 2015 3 次提交
    • M
      usb: gadget: net2280: restore ep_cfg after defect7374 workaround · 81e9d14a
      Mian Yousaf Kaukab 提交于
      Defect 7374 workaround enables all GPEP as endpoint 0. Restore
      endpoint number when defect 7374 workaround is disabled. Otherwise,
      check to match USB endpoint number to hardware endpoint number in
      net2280_enable() fails.
      
      Cc: <stable@vger.kernel.org> # 4.2
      Reported-by: NPaul Jones <p.jones@teclyn.com>
      Signed-off-by: NMian Yousaf Kaukab <yousaf.kaukab@intel.com>
      Signed-off-by: NFelipe Balbi <balbi@ti.com>
      81e9d14a
    • D
      usb: dwc2: host: Fix use after free w/ simultaneous irqs · dc873084
      Doug Anderson 提交于
      While plugging / unplugging on a DWC2 host port with "slub_debug=FZPUA"
      enabled, I found a crash that was quite obviously a use after free.
      
      It appears that in some cases when we handle the various sub-cases of
      HCINT we may end up freeing the QTD.  If there is more than one bit set
      in HCINT we may then end up continuing to use the QTD, which is bad.
      Let's be paranoid and check for this after each sub-case.  This should
      be safe since we officially have the "hsotg->lock" (it was grabbed in
      dwc2_handle_hcd_intr).
      
      The specific crash I found was:
       Unable to handle kernel paging request at virtual address 6b6b6b9f
      
      At the time of the crash, the kernel reported:
       (dwc2_hc_nak_intr+0x5c/0x198)
       (dwc2_handle_hcd_intr+0xa84/0xbf8)
       (_dwc2_hcd_irq+0x1c/0x20)
       (usb_hcd_irq+0x34/0x48)
      
      Popping into kgdb found that "*qtd" was filled with "0x6b", AKA qtd had
      been freed and filled with slub_debug poison.
      
      kgdb gave a little better stack crawl:
       0 dwc2_hc_nak_intr (hsotg=hsotg@entry=0xec42e058,
           chan=chan@entry=0xec546dc0, chnum=chnum@entry=4,
           qtd=qtd@entry=0xec679600) at drivers/usb/dwc2/hcd_intr.c:1237
       1 dwc2_hc_n_intr (chnum=4, hsotg=0xec42e058) at
           drivers/usb/dwc2/hcd_intr.c:2041
       2 dwc2_hc_intr (hsotg=0xec42e058) at drivers/usb/dwc2/hcd_intr.c:2078
       3 dwc2_handle_hcd_intr (hsotg=0xec42e058) at
           drivers/usb/dwc2/hcd_intr.c:2128
       4 _dwc2_hcd_irq (hcd=<optimized out>) at drivers/usb/dwc2/hcd.c:2837
       5 usb_hcd_irq (irq=<optimized out>, __hcd=<optimized out>) at
           drivers/usb/core/hcd.c:2353
      
      Popping up to frame #1 (dwc2_hc_n_intr) found:
       (gdb) print /x hcint
       $12 = 0x12
      
      AKA:
       #define HCINTMSK_CHHLTD  (1 << 1)
       #define HCINTMSK_NAK     (1 << 4)
      
      Further debugging found that by simulating receiving those two
      interrupts at the same time it was trivial to replicate the
      use-after-free.  See <http://crosreview.com/305712> for a patch and
      instructions.  This lead to getting the following stack crawl of the
      actual free:
       0  arch_kgdb_breakpoint () at arch/arm/include/asm/outercache.h:103
       1  kgdb_breakpoint () at kernel/debug/debug_core.c:1054
       2  dwc2_hcd_qtd_unlink_and_free (hsotg=<optimized out>, qh=<optimized
            out>, qtd=0xe4479a00) at drivers/usb/dwc2/hcd.h:488
       3  dwc2_deactivate_qh (free_qtd=<optimized out>, qh=0xe5efa280,
            hsotg=0xed424618) at drivers/usb/dwc2/hcd_intr.c:671
       4  dwc2_release_channel (hsotg=hsotg@entry=0xed424618,
            chan=chan@entry=0xed5be000, qtd=<optimized out>,
            halt_status=<optimized out>) at drivers/usb/dwc2/hcd_intr.c:742
       5  dwc2_halt_channel (hsotg=0xed424618, chan=0xed5be000, qtd=<optimized
            out>, halt_status=<optimized out>) at
            drivers/usb/dwc2/hcd_intr.c:804
       6  dwc2_complete_non_periodic_xfer (chnum=<optimized out>,
            halt_status=<optimized out>, qtd=<optimized out>, chan=<optimized
            out>, hsotg=<optimized out>) at drivers/usb/dwc2/hcd_intr.c:889
       7  dwc2_hc_xfercomp_intr (hsotg=hsotg@entry=0xed424618,
            chan=chan@entry=0xed5be000, chnum=chnum@entry=6,
            qtd=qtd@entry=0xe4479a00) at drivers/usb/dwc2/hcd_intr.c:1065
       8  dwc2_hc_chhltd_intr_dma (qtd=0xe4479a00, chnum=6, chan=0xed5be000,
            hsotg=0xed424618) at drivers/usb/dwc2/hcd_intr.c:1823
       9  dwc2_hc_chhltd_intr (qtd=0xe4479a00, chnum=6, chan=0xed5be000,
            hsotg=0xed424618) at drivers/usb/dwc2/hcd_intr.c:1944
       10 dwc2_hc_n_intr (chnum=6, hsotg=0xed424618) at
            drivers/usb/dwc2/hcd_intr.c:2052
       11 dwc2_hc_intr (hsotg=0xed424618) at drivers/usb/dwc2/hcd_intr.c:2097
       12 dwc2_handle_hcd_intr (hsotg=0xed424618) at
            drivers/usb/dwc2/hcd_intr.c:2147
       13 _dwc2_hcd_irq (hcd=<optimized out>) at drivers/usb/dwc2/hcd.c:2837
       14 usb_hcd_irq (irq=<optimized out>, __hcd=<optimized out>) at
            drivers/usb/core/hcd.c:2353
      
      Though we could add specific code to handle this case, adding the
      general purpose code to check for all cases where qtd might be freed
      seemed safer.
      Acked-by: NJohn Youn <johnyoun@synopsys.com>
      Signed-off-by: NDouglas Anderson <dianders@chromium.org>
      Signed-off-by: NFelipe Balbi <balbi@ti.com>
      dc873084
    • G
      usb: gadget: fix a trivial typo · ebd29385
      Geliang Tang 提交于
      s/regsiter/register/
      Signed-off-by: NGeliang Tang <geliangtang@163.com>
      Signed-off-by: NFelipe Balbi <balbi@ti.com>
      ebd29385
  13. 18 10月, 2015 2 次提交
  14. 17 10月, 2015 13 次提交