1. 19 11月, 2015 3 次提交
    • M
      xhci: Fix a race in usb2 LPM resume, blocking U3 for usb2 devices · dad67d5f
      Mathias Nyman 提交于
      Clear device initiated resume variables once device is fully up and running
      in U0 state.
      
      Resume needs to be signaled for 20ms for usb2 devices before they can be
      moved to U0 state.
      
      An interrupt is triggered if a device initiates resume. As we handle the
      event in interrupt context we can not sleep for 20ms, so we instead set
      a resume flag, a timestamp, and start the roothub polling.
      
      The roothub code will later move the port to U0 when it finds a port in
      resume state with the resume flag set, and timestamp passed by 20ms.
      
      A host initiated resume is however not done in interrupt context, and
      host initiated resume code will directly signal resume, wait 20ms and then
      move the port to U0.
      
      These two codepaths can race, if we are in the middle of a host initated
      resume, while sleeping for 20ms, we may handle a port event and find the
      port in resume state. The port event handling code will assume the resume
      was device initiated and set the resume flag and timestamp.
      
      Root hub code will however not catch the port in resume state again as the
      host initated resume code has already moved the port to U0.
      The resume flag and timestamp will remain set for this port preventing port
      from suspending again  (LPM setting port to U3)
      
      Fix this for now by always clearing the device initated resume parameters
      once port is in U0
      
      Cc: stable <stable@vger.kernel.org>
      Signed-off-by: NMathias Nyman <mathias.nyman@linux.intel.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      dad67d5f
    • L
      usb: xhci: fix checking ep busy for CFC · 42df7215
      Lu Baolu 提交于
      Function ep_ring_is_processing() checks the dequeue pointer
      in endpoint context to know whether an endpoint is busy with
      processing TRBs. This is not correct since dequeue pointer
      field in an endpoint context is only valid when the endpoint
      is in Halted or Stopped states. This buggy code causes audio
      noise when playing sound with USB headset connected to host
      controllers which support CFC (one of xhci 1.1 features).
      
      This patch should exist in stable kernel since v4.3.
      Reported-and-tested-by: NYD Tseng <yd_tseng@asmedia.com.tw>
      Signed-off-by: NLu Baolu <baolu.lu@linux.intel.com>
      Cc: stable <stable@vger.kernel.org> # v4.3
      Signed-off-by: NMathias Nyman <mathias.nyman@linux.intel.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      42df7215
    • R
      xhci: Workaround to get Intel xHCI reset working more reliably · a5964396
      Rajmohan Mani 提交于
      Existing Intel xHCI controllers require a delay of 1 mS,
      after setting the CMD_RESET bit in command register, before
      accessing any HC registers. This allows the HC to complete
      the reset operation and be ready for HC register access.
      Without this delay, the subsequent HC register access,
      may result in a system hang, very rarely.
      
      Verified CherryView / Braswell platforms go through over
      5000 warm reboot cycles (which was not possible without
      this patch), without any xHCI reset hang.
      Signed-off-by: NRajmohan Mani <rajmohan.mani@intel.com>
      Tested-by: NJoe Lawrence <joe.lawrence@stratus.com>
      Cc: stable <stable@vger.kernel.org>
      Signed-off-by: NMathias Nyman <mathias.nyman@linux.intel.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      a5964396
  2. 18 11月, 2015 13 次提交
    • L
      usb: chipidea: imx: fix a possible NULL dereference · 6f51bc34
      LABBE Corentin 提交于
      of_match_device could return NULL, and so cause a NULL pointer
      dereference later.
      
      Reported-by: coverity (CID 1324138)
      Signed-off-by: NLABBE Corentin <clabbe.montjoie@gmail.com>
      Signed-off-by: NPeter Chen <peter.chen@freescale.com>
      6f51bc34
    • L
      usb: chipidea: usbmisc_imx: fix a possible NULL dereference · 090bc267
      LABBE Corentin 提交于
      of_match_device could return NULL, and so cause a NULL pointer
      dereference later. Renaming tmp_dev to of_id (like all others do) in the
      process.
      
      Reported-by: coverity (CID 1324135)
      Signed-off-by: NLABBE Corentin <clabbe.montjoie@gmail.com>
      Signed-off-by: NPeter Chen <peter.chen@freescale.com>
      090bc267
    • L
      usb: chipidea: otg: gadget module load and unload support · 85da852d
      Li Jun 提交于
      This patch is to support load and unload gadget driver in full OTG mode.
      Signed-off-by: NLi Jun <jun.li@freescale.com>
      Signed-off-by: NPeter Chen <peter.chen@freescale.com>
      Tested-by: NJiada Wang <jiada_wang@mentor.com>
      Cc: <stable@vger.kernel.org> #v4.0+
      85da852d
    • L
      usb: chipidea: debug: disable usb irq while role switch · 251b3c8b
      Li Jun 提交于
      Since the ci->role will be set after the host role start is complete, there
      will be nobody cared irq during start host if usb irq enabled. This error
      can be reproduced on i.mx6 sololite EVK board by:
      1. disable otg id irq(IDIE) and disable all real otg properties of usbotg1
         in dts.
      2. boot up the board with ID cable and usb device connected.
      3. echo gadget > /sys/kernel/debug/ci_hdrc.0/role
      4. echo host > /sys/kernel/debug/ci_hdrc.0/role
      5. irq 212: nobody cared.
      
      Cc: <stable@vger.kernel.org> # v3.10+
      Signed-off-by: NLi Jun <jun.li@freescale.com>
      Signed-off-by: NPeter Chen <peter.chen@freescale.com>
      251b3c8b
    • P
      usb: chipidea: imx: refine clock operations to adapt for all platforms · ae3e57ae
      Peter Chen 提交于
      Some i.mx platforms need three clocks to let controller work, but
      others only need one, refine clock operation to adapt for all
      platforms, it fixes a regression found at i.mx27.
      Signed-off-by: NPeter Chen <peter.chen@freescale.com>
      Tested-by: NFabio Estevam <fabio.estevam@freescale.com>
      Cc: <stable@vger.kernel.org> #v4.1+
      ae3e57ae
    • D
      usb: gadget: atmel_usba_udc: Expose correct device speed · d134c48d
      Douglas Gilbert 提交于
      Following changes that appeared in lk 4.0.0, the gadget udc driver for
      some ARM based Atmel SoCs (e.g. at91sam9x5 and sama5d3 families)
      incorrectly deduced full-speed USB link speed even when the hardware
      had negotiated a high-speed link. The fix is to make sure that the
      UDPHS Interrupt Enable Register value does not mask the SPEED bit
      in the Interrupt Status Register.
      
      For a mass storage gadget this problem lead to failures when the host
      had a USB 3 port with the xhci_hcd driver. If the host was a USB 2
      port using the ehci_hcd driver then the mass storage gadget worked
      (but probably at a lower speed than it should have).
      Signed-off-by: NDouglas Gilbert <dgilbert@interlog.com>
      Reviewed-by: NBoris Brezillon <boris.brezillon@free-electrons.com>
      Cc: <stable@vger.kernel.org> #4.0+
      Fixes: 9870d895 ("usb: atmel_usba_udc: Mask status with enabled irqs")
      Signed-off-by: NFelipe Balbi <balbi@ti.com>
      d134c48d
    • B
      usb: musb: enable usb_dma parameter · 51676c8d
      Bin Liu 提交于
      Change the permission of usb_dma parameter so it can
      be used for runtime debug without reboot.
      Signed-off-by: NBin Liu <b-liu@ti.com>
      Signed-off-by: NFelipe Balbi <balbi@ti.com>
      51676c8d
    • L
      usb: phy: phy-mxs-usb: fix a possible NULL dereference · 89d99aea
      LABBE Corentin 提交于
      of_match_device could return NULL, and so cause a NULL pointer
      dereference later.
      Signed-off-by: NLABBE Corentin <clabbe.montjoie@gmail.com>
      Signed-off-by: NFelipe Balbi <balbi@ti.com>
      89d99aea
    • B
      usb: dwc3: gadget: let us set lower max_speed · b9e51b2b
      Ben McCauley 提交于
      In some SoCs, dwc3 is implemented as a USB2.0 only
      core, meaning that it can't ever achieve SuperSpeed.
      
      Currect driver always sets gadget.max_speed to
      USB_SPEED_SUPER unconditionally. This can causes
      issues to some Host stacks where the host will issue
      a GetBOS() request and we will reply with a BOS
      containing Superspeed Capability Descriptor.
      
      At least Windows seems to be upset by this fact and
      prints a warning that we should connect $this device
      to another port.
      
      [ balbi@ti.com : rewrote entire commit, including
      source code comment to make a lot clearer what the
      problem is ]
      
      Cc: <stable@vger.kernel.org>
      Signed-off-by: NBen McCauley <ben.mccauley@garmin.com>
      Signed-off-by: NFelipe Balbi <balbi@ti.com>
      b9e51b2b
    • B
      usb: musb: fix tx fifo flush handling · 68fe05e2
      Bin Liu 提交于
      Here are a few changes in musb_h_tx_flush_fifo().
      
      - It has been observed that sometimes (if not always) musb is unable
        to flush tx fifo during urb dequeue when disconnect a device. But
        it seems to be harmless, since the tx fifo flush is done again in
        musb_ep_program() when re-use the hw_ep.
      
        But the WARN() floods the console in the case when multiple tx urbs
        are queued, so change it to dev_WARN_ONCE().
      
      - applications could queue up many tx urbs, then the 1ms delay could
        causes minutes of delay in device disconnect. So remove it to get
        better user experience. The 1ms delay does not help the flushing
        anyway.
      
      - cleanup the debug code - related to lastcsr.
      
      ----
      Note: The tx fifo flush issue has been observed during device disconnect
      on AM335x.
      
      To reproduce the issue, ensure tx urb(s) are queued when unplug the usb
      device which is connected to AM335x usb host port.
      
      I found using a usb-ethernet device and running iperf (client on AM335x)
      has very high chance to trigger the problem.
      
      Better to turn on dev_dbg() in musb_cleanup_urb() with CPPI enabled to
      see the issue when aborting the tx channel.
      Signed-off-by: NBin Liu <b-liu@ti.com>
      Signed-off-by: NFelipe Balbi <balbi@ti.com>
      68fe05e2
    • P
      usb: gadget: f_loopback: fix the warning during the enumeration · 5e216d54
      Peter Chen 提交于
      The current code tries to allocate memory with GFP_KERNEL at
      interrupt context, it would show below warning during the enumeration
      when I test it with chipidea hardware, change GFP flag as GFP_ATOMIC
      can fix this issue.
      
      [   40.438237] zero gadget: high-speed config #2: loopback
      [   40.444924] ------------[ cut here ]------------
      [   40.449609] WARNING: CPU: 0 PID: 0 at kernel/locking/lockdep.c:2755 lockdep_trace_alloc+0x108/0x128()
      [   40.461715] DEBUG_LOCKS_WARN_ON(irqs_disabled_flags(flags))
      [   40.467130] Modules linked in:
      [   40.470216]  usb_f_ss_lb g_zero libcomposite evbug
      [   40.473822] CPU: 0 PID: 0 Comm: swapper/0 Not tainted 4.3.0-rc5-00168-gb730aaf #604
      [   40.481496] Hardware name: Freescale i.MX6 SoloX (Device Tree)
      [   40.487345] Backtrace:
      [   40.489857] [<80014e94>] (dump_backtrace) from [<80015088>] (show_stack+0x18/0x1c)
      [   40.497445]  r6:80b67a80 r5:00000000 r4:00000000 r3:00000000
      [   40.503234] [<80015070>] (show_stack) from [<802e27b4>] (dump_stack+0x8c/0xa4)
      [   40.510503] [<802e2728>] (dump_stack) from [<8002cfe8>] (warn_slowpath_common+0x80/0xbc)
      [   40.518612]  r6:8007510c r5:00000009 r4:80b49c88 r3:00000001
      [   40.524396] [<8002cf68>] (warn_slowpath_common) from [<8002d05c>] (warn_slowpath_fmt+0x38/0x40)
      [   40.533109]  r8:bcfdef80 r7:bdb705cc r6:000080d0 r5:be001e80 r4:809cc278
      [   40.539965] [<8002d028>] (warn_slowpath_fmt) from [<8007510c>] (lockdep_trace_alloc+0x108/0x128)
      [   40.548766]  r3:809d0128 r2:809cc278
      [   40.552401]  r4:600b0193
      [   40.554990] [<80075004>] (lockdep_trace_alloc) from [<801093d4>] (kmem_cache_alloc+0x28/0x15c)
      [   40.563618]  r4:000080d0 r3:80b4aa8c
      [   40.567270] [<801093ac>] (kmem_cache_alloc) from [<804d95e4>] (ep_alloc_request+0x58/0x68)
      [   40.575550]  r10:7f01f104 r9:00000001 r8:bcfdef80 r7:bdb705cc r6:bc178700 r5:00000000
      [   40.583512]  r4:bcfdef80 r3:813c0a38
      [   40.587183] [<804d958c>] (ep_alloc_request) from [<7f01f7ec>] (loopback_set_alt+0x114/0x21c [usb_f_ss_lb])
      [   40.596929] [<7f01f6d8>] (loopback_set_alt [usb_f_ss_lb]) from [<7f006910>] (composite_setup+0xbd0/0x17e8 [libcomposite])
      [   40.607902]  r10:bd3a2c0c r9:00000000 r8:bcfdef80 r7:bc178700 r6:bdb702d0 r5:bcfdefdc
      [   40.615866]  r4:7f0199b4 r3:00000002
      [   40.619542] [<7f005d40>] (composite_setup [libcomposite]) from [<804dae88>] (udc_irq+0x784/0xd1c)
      [   40.628431]  r10:80bb5619 r9:c0876140 r8:00012001 r7:bdb71010 r6:bdb70568 r5:00010001
      [   40.636392]  r4:bdb70014
      [   40.638985] [<804da704>] (udc_irq) from [<804d64f8>] (ci_irq+0x5c/0x118)
      [   40.645702]  r10:80bb5619 r9:be11e000 r8:00000117 r7:00000000 r6:bdb71010 r5:be11e060
      [   40.653666]  r4:bdb70010
      [   40.656261] [<804d649c>] (ci_irq) from [<8007f638>] (handle_irq_event_percpu+0x7c/0x13c)
      [   40.664367]  r6:00000000 r5:be11e060 r4:bdb05cc0 r3:804d649c
      [   40.670149] [<8007f5bc>] (handle_irq_event_percpu) from [<8007f740>] (handle_irq_event+0x48/0x6c)
      [   40.679036]  r10:00000000 r9:be008000 r8:00000001 r7:00000000 r6:bdb05cc0 r5:be11e060
      [   40.686998]  r4:be11e000
      [   40.689581] [<8007f6f8>] (handle_irq_event) from [<80082850>] (handle_fasteoi_irq+0xd4/0x1b0)
      [   40.698120]  r6:80b56a30 r5:be11e060 r4:be11e000 r3:00000000
      [   40.703898] [<8008277c>] (handle_fasteoi_irq) from [<8007ec04>] (generic_handle_irq+0x28/0x3c)
      [   40.712524]  r7:00000000 r6:80b4aaf4 r5:00000117 r4:80b445fc
      [   40.718304] [<8007ebdc>] (generic_handle_irq) from [<8007ef20>] (__handle_domain_irq+0x6c/0xe8)
      [   40.727033] [<8007eeb4>] (__handle_domain_irq) from [<800095d4>] (gic_handle_irq+0x48/0x94)
      [   40.735402]  r9:c080f100 r8:80b4ac6c r7:c080e100 r6:80b67d40 r5:80b49f00 r4:c080e10c
      [   40.743290] [<8000958c>] (gic_handle_irq) from [<80015d38>] (__irq_svc+0x58/0x78)
      [   40.750791] Exception stack(0x80b49f00 to 0x80b49f48)
      [   40.755873] 9f00: 00000001 00000001 00000000 80024320 80b48000 80b4a9d0 80b4a984 80b433e4
      [   40.764078] 9f20: 00000001 807f4680 00000000 80b49f5c 80b49f20 80b49f50 80071ca4 800113fc
      [   40.772272] 9f40: 200b0013 ffffffff
      [   40.775776]  r9:807f4680 r8:00000001 r7:80b49f34 r6:ffffffff r5:200b0013 r4:800113fc
      [   40.783677] [<800113d4>] (arch_cpu_idle) from [<8006c5bc>] (default_idle_call+0x28/0x38)
      [   40.791798] [<8006c594>] (default_idle_call) from [<8006c6dc>] (cpu_startup_entry+0x110/0x1b0)
      [   40.800445] [<8006c5cc>] (cpu_startup_entry) from [<807e95dc>] (rest_init+0x12c/0x168)
      [   40.808376]  r7:80b4a8c0 r3:807f4b7c
      [   40.812030] [<807e94b0>] (rest_init) from [<80ad7cc0>] (start_kernel+0x360/0x3d4)
      [   40.819528]  r5:80bcb000 r4:80bcb050
      [   40.823171] [<80ad7960>] (start_kernel) from [<8000807c>] (0x8000807c)
      
      It fixes commit 91c42b0d ("usb: gadget: loopback: Fix looping back
      logic implementation").
      
      Cc: <stable@vger.kernel.org> # v3.18+
      Signed-off-by: NPeter Chen <peter.chen@freescale.com>
      Reviewed-by: NKrzysztof Opasiak <k.opasiak@samsung.com>
      Signed-off-by: NFelipe Balbi <balbi@ti.com>
      5e216d54
    • D
      usb: dwc2: host: Fix remote wakeup when not in DWC2_L2 · 1fb7f12d
      Douglas Anderson 提交于
      In commit 734643df ("usb: dwc2: host: add flag to reflect bus
      state") we changed dwc2_port_suspend() not to set the lx_state
      anymore (instead it sets the new bus_suspended variable).  This
      introduced a bug where we would fail to detect device insertions if:
      
      1. Plug empty hub into dwc2
      2. Plug USB flash drive into the empty hub.
      3. Wait a few seconds
      4. Unplug USB flash drive
      5. Less than 2 seconds after step 4, plug the USB flash drive in again.
      
      The dwc2_hcd_rem_wakeup() function should have been changed to look at
      the new bus_suspended variable.
      
      Let's fix it.  Since commit b46146d5 ("usb: dwc2: host: resume root
      hub on remote wakeup") talks about needing the root hub resumed if the
      bus was suspended, we'll include it in our test.
      
      It appears that the "port_l1_change" should only be set to 1 if we were
      in DWC2_L1 (the driver currently never sets this), so we'll update the
      former "else" case based on this test.
      
      Fixes: 734643df ("usb: dwc2: host: add flag to reflect bus state")
      Acked-by: NJohn Youn <johnyoun@synopsys.com>
      Tested-by: NGregory Herrero <gregory.herrero@intel.com>
      Reviewed-by: NHeiko Stuebner <heiko@sntech.de>
      Signed-off-by: NDouglas Anderson <dianders@chromium.org>
      Signed-off-by: NFelipe Balbi <balbi@ti.com>
      1fb7f12d
    • D
      usb: dwc2: host: Fix ahbcfg for rk3066 · f1659303
      Douglas Anderson 提交于
      The comment for ahbcfg for rk3066 parameters (also used for rk3288)
      claimed that ahbcfg was INCR16, but it wasn't.  Since the bits weren't
      shifted properly, the 0x7 ended up being masked and we ended up
      programming 0x3 for the HBstLen.  Let's set it to INCR16 properly.
      
      As per Wu Liang Feng at Rockchip this may increase transmission
      efficiency.  I did blackbox tests with writing 0s to a USB-based SD
      reader (forcefully capping CPU Freq to try to measure efficiency):
        cd /sys/devices/system/cpu/cpu0/cpufreq
        echo userspace > scaling_governor
        echo 126000 > scaling_setspeed
        for i in $(seq 10); do
          dd if=/dev/zero of=/dev/sdb bs=1M count=750
        done
      
      With the above tests I found that speeds went from ~15MB/s to ~18MB/s.
      Note that most other tests I did (including reading from the same USB
      reader) didn't show any difference in performance.
      Tested-by: NHeiko Stuebner <heiko@sntech.de>
      Acked-by: NJohn Youn <johnyoun@synopsys.com>
      Reviewed-by: NLiangfeng Wu <wulf@rock-chips.com>
      Signed-off-by: NDouglas Anderson <dianders@chromium.org>
      Signed-off-by: NFelipe Balbi <balbi@ti.com>
      f1659303
  3. 17 11月, 2015 4 次提交
  4. 16 11月, 2015 3 次提交
    • D
      USB: ti_usb_3410_5052: Add Honeywell HGI80 ID · 1bcb49e6
      David Woodhouse 提交于
      The Honeywell HGI80 is a wireless interface to the evohome connected
      thermostat. It uses a TI 3410 USB-serial port.
      Signed-off-by: NDavid Woodhouse <David.Woodhouse@intel.com>
      Cc: stable@vger.kernel.org
      Signed-off-by: NJohan Hovold <johan@kernel.org>
      1bcb49e6
    • A
      USB: serial: option: add support for Novatel MiFi USB620L · e07af133
      Aleksander Morgado 提交于
      Also known as Verizon U620L.
      
      The device is modeswitched from 1410:9020 to 1410:9022 by selecting the
      4th USB configuration:
      
       $ sudo usb_modeswitch –v 0x1410 –p 0x9020 –u 4
      
      This configuration provides a ECM interface as well as TTYs ('Enterprise
      Mode' according to the U620 Linux integration guide).
      Signed-off-by: NAleksander Morgado <aleksander@aleksander.es>
      Cc: stable <stable@vger.kernel.org>
      Signed-off-by: NJohan Hovold <johan@kernel.org>
      e07af133
    • P
      USB: qcserial: Add support for Quectel EC20 Mini PCIe module · 9d5b5ed7
      Petr Štetiar 提交于
      It seems like this device has same vendor and product IDs as G2K
      devices, but it has different number of interfaces(4 vs 5) and also
      different interface layout which makes it currently unusable:
      
      	usbcore: registered new interface driver qcserial
      	usbserial: USB Serial support registered for Qualcomm USB modem
      	usb 2-1.2: unknown number of interfaces: 5
      
      lsusb output:
      
      	Bus 002 Device 003: ID 05c6:9215 Qualcomm, Inc. Acer Gobi 2000 Wireless
      	Device Descriptor:
      	  bLength                18
      	  bDescriptorType         1
      	  bcdUSB               2.00
      	  bDeviceClass            0 (Defined at Interface level)
      	  bDeviceSubClass         0
      	  bDeviceProtocol         0
      	  bMaxPacketSize0        64
      	  idVendor           0x05c6 Qualcomm, Inc.
      	  idProduct          0x9215 Acer Gobi 2000 Wireless Modem
      	  bcdDevice            2.32
      	  iManufacturer           1 Quectel
      	  iProduct                2 Quectel LTE Module
      	  iSerial                 0
      	  bNumConfigurations      1
      	  Configuration Descriptor:
      	    bLength                 9
      	    bDescriptorType         2
      	    wTotalLength          209
      	    bNumInterfaces          5
      	    bConfigurationValue     1
      	    iConfiguration          0
      	    bmAttributes         0xa0
      	      (Bus Powered)
      	      Remote Wakeup
      	    MaxPower              500mA
      Signed-off-by: NPetr Štetiar <ynezz@true.cz>
      Cc: stable <stable@vger.kernel.org>
      [johan: rename define and add comment ]
      Signed-off-by: NJohan Hovold <johan@kernel.org>
      9d5b5ed7
  5. 10 11月, 2015 2 次提交
  6. 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
  7. 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
  8. 28 10月, 2015 1 次提交
  9. 26 10月, 2015 1 次提交
  10. 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
  11. 23 10月, 2015 1 次提交
  12. 22 10月, 2015 5 次提交