1. 27 Jun, 2014 5 commits
    • Thomas Gleixner's avatar
      usb: musb: Ensure that cppi41 timer gets armed on premature DMA TX irq · c58d80f5
      Thomas Gleixner authored
      Some TI chips raise the DMA complete interrupt before the actual
      transfer has been completed. The code tries to busy wait for a few
      microseconds and if that fails it arms an hrtimer to recheck. So far
      so good, but that has the following issue:
      
      CPU 0					CPU1
      
      start_next_transfer(RQ1);
      
      DMA interrupt
        if (premature_irq(RQ1))
          if (!hrtimer_active(timer))
             hrtimer_start(timer);
      
      hrtimer expires
        timer->state = CALLBACK_RUNNING;
        timer->fn()
          cppi41_recheck_tx_req()
            complete_request(RQ1);
            if (requests_pending())
              start_next_transfer(RQ2);
      
      					DMA interrupt
      					  if (premature_irq(RQ2))
      					    if (!hrtimer_active(timer))
      					       hrtimer_start(timer);
        timer->state = INACTIVE;
      
      The premature interrupt of request2 on CPU1 does not arm the timer and
      therefor the request completion never happens because it checks for
      !hrtimer_active(). hrtimer_active() evaluates:
      
        timer->state != HRTIMER_STATE_INACTIVE
      
      which of course evaluates to true in the above case as timer->state is
      CALLBACK_RUNNING.
      
      That's clearly documented:
      
       * A timer is active, when it is enqueued into the rbtree or the
       * callback function is running or it's in the state of being migrated
       * to another cpu.
      
      But that's not what the code wants to check. The code wants to check
      whether the timer is queued, i.e. whether its armed and waiting for
      expiry.
      
      We have a helper function for this: hrtimer_is_queued(). This
      evaluates:
      
        timer->state & HRTIMER_STATE_QUEUED
      
      So in the above case this evaluates to false and therefor forces the
      DMA interrupt on CPU1 to call hrtimer_start().
      
      Use hrtimer_is_queued() instead of hrtimer_active() and evrything is
      good.
      Reported-by: default avatarTorben Hohn <torbenh@linutronix.de>
      Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
      Cc: stable@vger.kernel.org
      Signed-off-by: default avatarFelipe Balbi <balbi@ti.com>
      c58d80f5
    • Andreas Larsson's avatar
      usb: gadget: gr_udc: Fix check for invalid number of microframes · 6ee96cc0
      Andreas Larsson authored
      The value 0x3 (not 0x11) in the field for additional transaction/microframe
      is reserved and should not be let through. Be clear in the error message about
      what value caused the error return.
      Reported-by: default avatarDavid Binderman <dcb314@hotmail.com>
      Signed-off-by: default avatarAndreas Larsson <andreas@gaisler.com>
      Signed-off-by: default avatarFelipe Balbi <balbi@ti.com>
      6ee96cc0
    • Ezequiel Garcia's avatar
      usb: musb: Fix panic upon musb_am335x module removal · 7adb5c87
      Ezequiel Garcia authored
      At probe time, the musb_am335x driver register its childs by
      calling of_platform_populate(), which registers all childs in
      the devicetree hierarchy recursively.
      
      On the other side, the driver's remove() function uses of_device_unregister()
      to remove each child of musb_am335x's.
      
      However, when musb_dsps is loaded, its devices are attached to the musb_am335x
      device as musb_am335x childs. Hence, musb_am335x remove() will attempt to
      unregister the devices registered by musb_dsps, which produces a kernel panic.
      
      In other words, the childs in the "struct device" hierarchy are not the same
      as the childs in the "devicetree" hierarchy.
      
      Ideally, we should enforce the removal of the devices registered by
      musb_am335x *only*, instead of all its child devices. However, because of the
      recursive nature of of_platform_populate, this doesn't seem possible.
      
      Therefore, as the only solution at hand, this commit disables musb_am335x
      driver removal capability, preventing it from being ever removed. This was
      originally suggested by Sebastian Siewior:
      
      https://www.mail-archive.com/linux-omap@vger.kernel.org/msg104946.html
      
      And for reference, here's the panic upon module removal:
      
      musb-hdrc musb-hdrc.0.auto: remove, state 4
      usb usb1: USB disconnect, device number 1
      musb-hdrc musb-hdrc.0.auto: USB bus 1 deregistered
      Unable to handle kernel NULL pointer dereference at virtual address 0000008c
      pgd = de11c000
      [0000008c] *pgd=9e174831, *pte=00000000, *ppte=00000000
      Internal error: Oops: 17 [#1] ARM
      Modules linked in: musb_am335x(-) musb_dsps musb_hdrc usbcore usb_common
      CPU: 0 PID: 623 Comm: modprobe Not tainted 3.15.0-rc4-00001-g24efd13 #69
      task: de1b7500 ti: de122000 task.ti: de122000
      PC is at am335x_shutdown+0x10/0x28
      LR is at am335x_shutdown+0xc/0x28
      pc : [<c0327798>]    lr : [<c0327794>]    psr: a0000013
      sp : de123df8  ip : 00000004  fp : 00028f00
      r10: 00000000  r9 : de122000  r8 : c000e6c4
      r7 : de0e3c10  r6 : de0e3800  r5 : de624010  r4 : de1ec750
      r3 : de0e3810  r2 : 00000000  r1 : 00000001  r0 : 00000000
      Flags: NzCv  IRQs on  FIQs on  Mode SVC_32  ISA ARM  Segment user
      Control: 10c5387d  Table: 9e11c019  DAC: 00000015
      Process modprobe (pid: 623, stack limit = 0xde122240)
      Stack: (0xde123df8 to 0xde124000)
      3de0:                                                       de0e3810 bf054488
      3e00: bf05444c de624010 60000013 bf043650 000012fc de624010 de0e3810 bf043a20
      3e20: de0e3810 bf04b240 c0635b88 c02ca37c c02ca364 c02c8db0 de1b7500 de0e3844
      3e40: de0e3810 c02c8e28 c0635b88 de02824c de0e3810 c02c884c de0e3800 de0e3810
      3e60: de0e3818 c02c5b20 bf05417c de0e3800 de0e3800 c0635b88 de0f2410 c02ca838
      3e80: bf05417c de0e3800 bf055438 c02ca8cc de0e3c10 bf054194 de0e3c10 c02ca37c
      3ea0: c02ca364 c02c8db0 de1b7500 de0e3c44 de0e3c10 c02c8e28 c0635b88 de02824c
      3ec0: de0e3c10 c02c884c de0e3c10 de0e3c10 de0e3c18 c02c5b20 de0e3c10 de0e3c10
      3ee0: 00000000 bf059000 a0000013 c02c5bc0 00000000 bf05900c de0e3c10 c02c5c48
      3f00: de0dd0c0 de1ec970 de0f2410 bf05929c de0f2444 bf05902c de0f2410 c02ca37c
      3f20: c02ca364 c02c8db0 bf05929c de0f2410 bf05929c c02c94c8 bf05929c 00000000
      3f40: 00000800 c02c8ab4 bf0592e0 c007fc40 c00dd820 6273756d 336d615f 00783533
      3f60: c064a0ac de1b7500 de122000 de1b7500 c000e590 00000001 c000e6c4 c0060160
      3f80: 00028e70 00028e70 00028ea4 00000081 60000010 00028e70 00028e70 00028ea4
      3fa0: 00000081 c000e500 00028e70 00028e70 00028ea4 00000800 becb59f8 00027608
      3fc0: 00028e70 00028e70 00028ea4 00000081 00000001 00000001 00000000 00028f00
      3fe0: b6e6b6f0 becb59d4 000160e8 b6e6b6fc 60000010 00028ea4 00000000 00000000
      [<c0327798>] (am335x_shutdown) from [<bf054488>] (dsps_musb_exit+0x3c/0x4c [musb_dsps])
      [<bf054488>] (dsps_musb_exit [musb_dsps]) from [<bf043650>] (musb_shutdown+0x80/0x90 [musb_hdrc])
      [<bf043650>] (musb_shutdown [musb_hdrc]) from [<bf043a20>] (musb_remove+0x24/0x68 [musb_hdrc])
      [<bf043a20>] (musb_remove [musb_hdrc]) from [<c02ca37c>] (platform_drv_remove+0x18/0x1c)
      [<c02ca37c>] (platform_drv_remove) from [<c02c8db0>] (__device_release_driver+0x70/0xc8)
      [<c02c8db0>] (__device_release_driver) from [<c02c8e28>] (device_release_driver+0x20/0x2c)
      [<c02c8e28>] (device_release_driver) from [<c02c884c>] (bus_remove_device+0xdc/0x10c)
      [<c02c884c>] (bus_remove_device) from [<c02c5b20>] (device_del+0x104/0x198)
      [<c02c5b20>] (device_del) from [<c02ca838>] (platform_device_del+0x14/0x9c)
      [<c02ca838>] (platform_device_del) from [<c02ca8cc>] (platform_device_unregister+0xc/0x20)
      [<c02ca8cc>] (platform_device_unregister) from [<bf054194>] (dsps_remove+0x18/0x38 [musb_dsps])
      [<bf054194>] (dsps_remove [musb_dsps]) from [<c02ca37c>] (platform_drv_remove+0x18/0x1c)
      [<c02ca37c>] (platform_drv_remove) from [<c02c8db0>] (__device_release_driver+0x70/0xc8)
      [<c02c8db0>] (__device_release_driver) from [<c02c8e28>] (device_release_driver+0x20/0x2c)
      [<c02c8e28>] (device_release_driver) from [<c02c884c>] (bus_remove_device+0xdc/0x10c)
      [<c02c884c>] (bus_remove_device) from [<c02c5b20>] (device_del+0x104/0x198)
      [<c02c5b20>] (device_del) from [<c02c5bc0>] (device_unregister+0xc/0x20)
      [<c02c5bc0>] (device_unregister) from [<bf05900c>] (of_remove_populated_child+0xc/0x14 [musb_am335x])
      [<bf05900c>] (of_remove_populated_child [musb_am335x]) from [<c02c5c48>] (device_for_each_child+0x44/0x70)
      [<c02c5c48>] (device_for_each_child) from [<bf05902c>] (am335x_child_remove+0x18/0x30 [musb_am335x])
      [<bf05902c>] (am335x_child_remove [musb_am335x]) from [<c02ca37c>] (platform_drv_remove+0x18/0x1c)
      [<c02ca37c>] (platform_drv_remove) from [<c02c8db0>] (__device_release_driver+0x70/0xc8)
      [<c02c8db0>] (__device_release_driver) from [<c02c94c8>] (driver_detach+0xb4/0xb8)
      [<c02c94c8>] (driver_detach) from [<c02c8ab4>] (bus_remove_driver+0x4c/0xa0)
      [<c02c8ab4>] (bus_remove_driver) from [<c007fc40>] (SyS_delete_module+0x128/0x1cc)
      [<c007fc40>] (SyS_delete_module) from [<c000e500>] (ret_fast_syscall+0x0/0x48)
      
      Fixes: 97238b35 ("usb: musb: dsps: use proper child nodes")
      Cc: <stable@vger.kernel.org> # v3.12+
      Acked-by: default avatarGeorge Cherian <george.cherian@ti.com>
      Signed-off-by: default avatarEzequiel Garcia <ezequiel@vanguardiasur.com.ar>
      Signed-off-by: default avatarFelipe Balbi <balbi@ti.com>
      7adb5c87
    • Michal Nazarewicz's avatar
      usb: gadget: f_fs: resurect usb_functionfs_descs_head structure · 09122141
      Michal Nazarewicz authored
      Even though usb_functionfs_descs_head structure is now deprecated,
      it has been used by some user space tools.  Its removel in commit
      [ac8dde11: “Add flags to descriptors block”] was an oversight
      leading to build breakage for such tools.
      
      Bring it back so that old user space tools can still be build
      without problems on newer kernel versions.
      
      Cc: <stable@vger.kernel.org>  # 3.14
      Reported-by: default avatarLad, Prabhakar <prabhakar.csengg@gmail.com>
      Reported-by: default avatarKrzysztof Opasiak <k.opasiak@samsung.com>
      Signed-off-by: default avatarMichal Nazarewicz <mina86@mina86.com>
      Signed-off-by: default avatarFelipe Balbi <balbi@ti.com>
      09122141
    • Felipe Balbi's avatar
      Revert "tools: ffs-test: convert to new descriptor format fixing compilation error" · 9ad78604
      Felipe Balbi authored
      This reverts commit f2af7412.
      
      There is a better fix for this build error coming in a following
      patch.
      Signed-of-by: default avatarFelipe Balbi <balbi@ti.com>
      9ad78604
  2. 19 Jun, 2014 13 commits
    • George Cherian's avatar
      usb: musb: core: Handle Babble condition only in HOST mode · 5d881802
      George Cherian authored
      BABBLE and RESET share the same interrupt. The interrupt
      is considered to be RESET if MUSB is in peripheral mode and
      as a BABBLE if MUSB is in HOST mode.
      
      Handle babble condition iff MUSB is in HOST mode.
      
      Fixes: ca88fc2e (usb: musb: add a work_struct to recover from babble errors)
      Tested-by: default avatarTony Lindgren <tony@atomide.com>
      Signed-off-by: default avatarGeorge Cherian <george.cherian@ti.com>
      Signed-off-by: default avatarFelipe Balbi <balbi@ti.com>
      5d881802
    • Marcus Nutzinger's avatar
      usb: gadget: gadgetfs: correct dev state · f0cae93f
      Marcus Nutzinger authored
      This reverts commit 1826e9b1 (usb: gadget: gadgetfs: use
      after free in dev_release()) and places the call to
      put_dev() after setting the state.
      
      If this is not the final call to dev_release() and the
      state is not reset to STATE_DEV_DISABLED and hence all
      further open() calls to the gadgetfs ep0 device will
      fail with EBUSY.
      Signed-off-by: default avatarMarcus Nutzinger <marcus.nutzinger@theobroma-systems.com>
      Reviewed-by: default avatarChristoph Muellner <christoph.muellner@theobroma-systems.com>
      Signed-off-by: default avatarFelipe Balbi <balbi@ti.com>
      f0cae93f
    • Andrzej Pietrasiewicz's avatar
      usb: gadget: OS descriptors: provide interface directory names · 14574b54
      Andrzej Pietrasiewicz authored
      Function's interface directories need to be created when the function
      directory is created, but interface numbers are not known until
      the gadget is ready and bound to udc, so we cannot use numbers
      as part of interface directory names.
      Let the client decide what names to use.
      Signed-off-by: default avatarAndrzej Pietrasiewicz <andrzej.p@samsung.com>
      Signed-off-by: default avatarFelipe Balbi <balbi@ti.com>
      14574b54
    • Andrzej Pietrasiewicz's avatar
      usb: gadget: OS descriptors configfs cleanup · fe00b138
      Andrzej Pietrasiewicz authored
      A number of variables serve a generic purpose of handling
      "compatible id" and "subcompatible id", but the names suggest they
      are for rndis only. Rename to reflect variables' purpose.
      Signed-off-by: default avatarAndrzej Pietrasiewicz <andrzej.p@samsung.com>
      Signed-off-by: default avatarFelipe Balbi <balbi@ti.com>
      fe00b138
    • Michal Nazarewicz's avatar
      usb: gadget: f_fs: fix NULL pointer dereference when there are no strings · f0688c8b
      Michal Nazarewicz authored
      If the descriptors do not need any strings and user space sends empty
      set of strings, the ffs->stringtabs field remains NULL.  Thus
      *ffs->stringtabs in functionfs_bind leads to a NULL pointer
      dereferenece.
      
      The bug was introduced by commit [fd7c9a00: “use usb_string_ids_n()”].
      
      While at it, remove double initialisation of lang local variable in
      that function.
      
      ffs->strings_count does not need to be checked in any way since in
      the above scenario it will remain zero and usb_string_ids_n() is
      a no-operation when colled with 0 argument.
      
      Cc: <stable@vger.kernel.org>  # v2.6.36+
      Signed-off-by: default avatarMichal Nazarewicz <mina86@mina86.com>
      Signed-off-by: default avatarFelipe Balbi <balbi@ti.com>
      f0688c8b
    • Linus Walleij's avatar
      usb: musb: ux500: don't propagate the OF node · 82363cf2
      Linus Walleij authored
      There is a regression in the upcoming v3.16-rc1, that is caused
      by a problem that has been around for a while but now finally
      hangs the system. The bootcrawl looks like this:
      
      pinctrl-nomadik soc:pinctrl: pin GPIO256_AF28 already
      requested by a03e0000.usb_per5; cannot claim for musb-hdrc.0.auto
      pinctrl-nomadik soc:pinctrl: pin-256 (musb-hdrc.0.auto) status -22
      pinctrl-nomadik soc:pinctrl: could not request pin 256
      (GPIO256_AF28) from group usb_a_1  on device pinctrl-nomadik
      musb-hdrc musb-hdrc.0.auto: Error applying setting, reverse
      things back
      HS USB OTG: no transceiver configured
      musb-hdrc musb-hdrc.0.auto: musb_init_controller failed
      with status -517
      platform musb-hdrc.0.auto: Driver musb-hdrc requests
      probe deferral
      (...)
      
      The ux500 MUSB driver propagates the OF node to the dynamically
      created musb-hdrc device, which is incorrect as it makes the OF
      core believe there are two devices spun from the very same
      DT node, which confuses other parts of the device core, notably
      the pin control subsystem, which will try to apply all the pin
      control settings also to the HDRC device as it gets
      instantiated. (The OMAP2430 for example, does not set the
      of_node member.)
      
      Cc: <stable@vger.kernel.org>
      Cc: Arnd Bergmann <arnd@arndb.de>
      Acked-by: default avatarLee Jones <lee.jones@linaro.org>
      Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
      Signed-off-by: default avatarFelipe Balbi <balbi@ti.com>
      82363cf2
    • Kuninori Morimoto's avatar
      usb: renesas: gadget: fixup: complete STATUS stage after receiving · 3fe15505
      Kuninori Morimoto authored
      Current usbhs gadget driver didn't complete STATUS stage after receiving.
      It wasn't problem for us before, because some USB class doesn't use
      DATA OUT stage in control transfer.
      But, it is required on some device.
      Signed-off-by: default avatarYoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
      Signed-off-by: default avatarKuninori Morimoto <kuninori.morimoto.gx@renesas.com>
      Signed-off-by: default avatarFelipe Balbi <balbi@ti.com>
      3fe15505
    • Jeff Westfahl's avatar
      usb: gadget: u_ether: synchronize with transmit when stopping queue · a9232076
      Jeff Westfahl authored
      When disconnecting, it's possible that another thread has already made it
      into eth_start_xmit before we call netif_stop_queue. This can lead to a
      crash as eth_start_xmit tries to use resources that gether_disconnect is
      freeing. Use netif_tx_lock/unlock around netif_stop_queue to ensure no
      threads are executing during the remainder of gether_disconnect.
      Signed-off-by: default avatarJeff Westfahl <jeff.westfahl@ni.com>
      Tested-by: default avatarJaeden Amero <jaeden.amero@ni.com>
      Signed-off-by: default avatarFelipe Balbi <balbi@ti.com>
      a9232076
    • George Cherian's avatar
      usb: dwc3: dwc3-omap: Disable/Enable only wrapper interrupts in prepare/complete · 02dae36a
      George Cherian authored
      The dwc3 wrapper driver should not be fiddling with the core interrupts.
      Disabling the core interrupts in prepare stops xhci from proper operation.
      So remove disable/enable of core interrupts from prepare/complete.
      Signed-off-by: default avatarGeorge Cherian <george.cherian@ti.com>
      Signed-off-by: default avatarFelipe Balbi <balbi@ti.com>
      02dae36a
    • George Cherian's avatar
      usb: dwc3: dwc3-omap: Fix the crash on module removal · c5a1fbca
      George Cherian authored
      Following crash is seen on dwc3_omap removal
      Unable to handle kernel NULL pointer dereference at virtual address 00000018
      pgd = ec098000
      [00000018] *pgd=ad1f9831, *pte=00000000, *ppte=00000000
      Internal error: Oops: 17 [#1] SMP ARM
      Modules linked in: usb_f_ss_lb g_zero usb_f_acm u_serial usb_f_ecm u_ether libcomposite configfs snd_usb_audio snd_usbmidi_lib snd_rawmidi snd_hwdep snd_soc_omap snd_pcm_dmaengine snd_soc_core snd_compress snd_pcm snd_tim]
      CPU: 0 PID: 1296 Comm: rmmod Tainted: G        W     3.15.0-rc4-02716-g95c4e18-dirty #10
      task: ed05a080 ti: ec368000 task.ti: ec368000
      PC is at release_resource+0x14/0x7c
      LR is at release_resource+0x10/0x7c
      pc : [<c0044724>]    lr : [<c0044720>]    psr: 60000013
      sp : ec369ec0  ip : 60000013  fp : 00021008
      r10: 00000000  r9 : ec368000  r8 : c000e7a4
      r7 : 00000081  r6 : bf0062c0  r5 : ed7cd000  r4 : ed7d85c0
      r3 : 00000000  r2 : 00000000  r1 : 00000011  r0 : c086d08c
      Flags: nZCv  IRQs on  FIQs on  Mode SVC_32  ISA ARM  Segment user
      Control: 10c5387d  Table: ac098059  DAC: 00000015
      Process rmmod (pid: 1296, stack limit = 0xec368248)
      Stack: (0xec369ec0 to 0xec36a000)
      9ec0: 00000000 00000001 ed7cd000 c034de94 ed7cd010 ed7cd000 00000000 c034e194
      9ee0: 00000000 bf0062cc ed7cd010 c03490b0 ed154cc0 ed4c2570 ed2b8410 ed156810
      ed156810 bf006d24 c034db9c c034db84 c034c518
      9f20: bf006d24 ed156810 bf006d24 c034cd2c bf006d24 bf006d68 00000800 c034c340
      9f40: 00000000 c00a9e5c 00000020 00000000 bf006d68 00000800 ec369f4c 33637764
      9f60: 616d6f5f 00000070 00000001 ec368000 ed05a080 c000e670 00000001 c0084010
      9f80: 00021088 00000800 00021088 00000081 80000010 0000e6f4 00021088 00000800
      9fa0: 00021088 c000e5e0 00021088 00000800 000210b8 00000800 e04f6d00 e04f6d00
      9fc0: 00021088 00000800 00021088 00000081 00000001 00000000 be91de08 00021008
      9fe0: 4d768880 be91dbb4 b6fc5984 4d76888c 80000010 000210b8 00000000 00000000
      [<c0044724>] (release_resource) from [<c034de94>] (platform_device_del+0x6c/0x9c)
      [<c034de94>] (platform_device_del) from [<c034e194>] (platform_device_unregister+0xc/0x18)
      [<c034e194>] (platform_device_unregister) from [<bf0062cc>] (dwc3_omap_remove_core+0xc/0x14 [dwc3_omap])
      [<bf0062cc>] (dwc3_omap_remove_core [dwc3_omap]) from [<c03490b0>] (device_for_each_child+0x34/0x74)
      [<c03490b0>] (device_for_each_child) from [<bf0062b4>] (dwc3_omap_remove+0x6c/0x78 [dwc3_omap])
      [<bf0062b4>] (dwc3_omap_remove [dwc3_omap]) from [<c034db9c>] (platform_drv_remove+0x18/0x1c)
      [<c034db9c>] (platform_drv_remove) from [<c034c518>] (__device_release_driver+0x70/0xc8)
      [<c034c518>] (__device_release_driver) from [<c034cd2c>] (driver_detach+0xb4/0xb8)
      [<c034cd2c>] (driver_detach) from [<c034c340>] (bus_remove_driver+0x4c/0x90)
      [<c034c340>] (bus_remove_driver) from [<c00a9e5c>] (SyS_delete_module+0x10c/0x198)
      [<c00a9e5c>] (SyS_delete_module) from [<c000e5e0>] (ret_fast_syscall+0x0/0x48)
      Code: e1a04000 e59f0068 eb14505e e5943010 (e5932018)
      ---[ end trace 7e2a8746ff4fc811 ]---
      Segmentation fault
      
      [ balbi@ti.com : add CONFIG_OF dependency ]
      Signed-off-by: default avatarGeorge Cherian <george.cherian@ti.com>
      Signed-off-by: default avatarFelipe Balbi <balbi@ti.com>
      c5a1fbca
    • Dan Carpenter's avatar
      usb: gadget: f_rndis: fix an error code on allocation failure · 4683ae86
      Dan Carpenter authored
      This should be return -ENOMEM.  The current code returns successs.
      
      Fixes: de7a8d2d ('usb: gadget: f_rndis: OS descriptors support')
      Acked-by: default avatarAndrzej Pietrasiewicz <andrzej.p@samsung.com>
      Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
      Signed-off-by: default avatarFelipe Balbi <balbi@ti.com>
      4683ae86
    • Michal Nazarewicz's avatar
      tools: ffs-test: convert to new descriptor format fixing compilation error · f2af7412
      Michal Nazarewicz authored
      Commit [ac8dde11: “usb: gadget: f_fs: Add flags to descriptors block”]
      which introduced a new descriptor format for FunctionFS removed the
      usb_functionfs_descs_head structure, which is still used by ffs-test.
      tool.
      
      Convert ffs-test by converting it to use the new header format.  For
      testing kernels prior to 3.14 (when the new format was introduced) and
      parsing of the legacy headers in the new kernels, provide a compilation
      flag to make the tool use the old format.
      
      Finally, include information as to when the legacy FunctionFS headers
      format has been deprecated (which is also when the new one has been
      introduced).
      Reported-by: default avatarLad, Prabhakar <prabhakar.csengg@gmail.com>
      Signed-off-by: default avatarMichal Nazarewicz <mina86@mina86.com>
      Signed-off-by: default avatarFelipe Balbi <balbi@ti.com>
      f2af7412
    • Zhuang Jin Can's avatar
      usb: dwc3: gadget: check link trb after free_slot is increased · 5cd8c48d
      Zhuang Jin Can authored
      In ISOC transfers, when free_slot points to the last TRB (i.e. Link
      TRB), and all queued requests meet Missed Interval Isoc error, busy_slot
      points to trb0.
      	busy_slot->trb0
      		   trb1
      		   ...
      	free_slot->trb31(Link TRB)
      
      After end transfer and receiving the XferNotReady event, trb_left is
      caculated as 1 which is wrong, and no TRB will be primed to the
      endpoint.
      
      The root cause is free_slot is not increased the same way as busy_slot.
      When busy_slot is increased by one, it checks if points to a link TRB
      after increasement, but free_slot checks it before increasement.
      free_slot should behave the same as busy_slot to make the trb_left
      caculation correct.
      Reviewed-by: default avatarPratyush Anand <pratyush.anand@st.com>
      Signed-off-by: default avatarZhuang Jin Can <jin.can.zhuang@intel.com>
      Signed-off-by: default avatarJiebing Li <jiebing.li@intel.com>
      Signed-off-by: default avatarFelipe Balbi <balbi@ti.com>
      5cd8c48d
  3. 16 Jun, 2014 4 commits
    • Linus Torvalds's avatar
      Linux 3.16-rc1 · 7171511e
      Linus Torvalds authored
      7171511e
    • Linus Torvalds's avatar
      Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net · a9be2242
      Linus Torvalds authored
      Pull networking fixes from David Miller:
      
       1) Fix checksumming regressions, from Tom Herbert.
      
       2) Undo unintentional permissions changes for SCTP rto_alpha and
          rto_beta sysfs knobs, from Denial Borkmann.
      
       3) VXLAN, like other IP tunnels, should advertize it's encapsulation
          size using dev->needed_headroom instead of dev->hard_header_len.
          From Cong Wang.
      
      * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net:
        net: sctp: fix permissions for rto_alpha and rto_beta knobs
        vxlan: Checksum fixes
        net: add skb_pop_rcv_encapsulation
        udp: call __skb_checksum_complete when doing full checksum
        net: Fix save software checksum complete
        net: Fix GSO constants to match NETIF flags
        udp: ipv4: do not waste time in __udp4_lib_mcast_demux_lookup
        vxlan: use dev->needed_headroom instead of dev->hard_header_len
        MAINTAINERS: update cxgb4 maintainer
      a9be2242
    • Linus Torvalds's avatar
      Merge tag 'clk-for-linus-3.16-part2' of git://git.linaro.org/people/mike.turquette/linux · dd1845af
      Linus Torvalds authored
      Pull more clock framework updates from Mike Turquette:
       "This contains the second half the of the clk changes for 3.16.
      
        They are simply fixes and code refactoring for the OMAP clock drivers.
        The sunxi clock driver changes include splitting out the one
        mega-driver into several smaller pieces and adding support for the A31
        SoC clocks"
      
      * tag 'clk-for-linus-3.16-part2' of git://git.linaro.org/people/mike.turquette/linux: (25 commits)
        clk: sunxi: document PRCM clock compatible strings
        clk: sunxi: add PRCM (Power/Reset/Clock Management) clks support
        clk: sun6i: Protect SDRAM gating bit
        clk: sun6i: Protect CPU clock
        clk: sunxi: Rework clock protection code
        clk: sunxi: Move the GMAC clock to a file of its own
        clk: sunxi: Move the 24M oscillator to a file of its own
        clk: sunxi: Remove calls to clk_put
        clk: sunxi: document new A31 USB clock compatible
        clk: sunxi: Implement A31 USB clock
        ARM: dts: OMAP5/DRA7: use omap5-mpu-dpll-clock capable of dealing with higher frequencies
        CLK: TI: dpll: support OMAP5 MPU DPLL that need special handling for higher frequencies
        ARM: OMAP5+: dpll: support Duty Cycle Correction(DCC)
        CLK: TI: clk-54xx: Set the rate for dpll_abe_m2x2_ck
        CLK: TI: Driver for DRA7 ATL (Audio Tracking Logic)
        dt:/bindings: DRA7 ATL (Audio Tracking Logic) clock bindings
        ARM: dts: dra7xx-clocks: Correct name for atl clkin3 clock
        CLK: TI: gate: add composite interface clock to OMAP2 only build
        ARM: OMAP2: clock: add DT boot support for cpufreq_ck
        CLK: TI: OMAP2: add clock init support
        ...
      dd1845af
    • Linus Torvalds's avatar
      Merge git://git.infradead.org/users/willy/linux-nvme · b55b3902
      Linus Torvalds authored
      Pull NVMe update from Matthew Wilcox:
       "Mostly bugfixes again for the NVMe driver.  I'd like to call out the
        exported tracepoint in the block layer; I believe Keith has cleared
        this with Jens.
      
        We've had a few reports from people who're really pounding on NVMe
        devices at scale, hence the timeout changes (and new module
        parameters), hotplug cpu deadlock, tracepoints, and minor performance
        tweaks"
      
      [ Jens hadn't seen that tracepoint thing, but is ok with it - it will
        end up going away when mq conversion happens ]
      
      * git://git.infradead.org/users/willy/linux-nvme: (22 commits)
        NVMe: Fix START_STOP_UNIT Scsi->NVMe translation.
        NVMe: Use Log Page constants in SCSI emulation
        NVMe: Define Log Page constants
        NVMe: Fix hot cpu notification dead lock
        NVMe: Rename io_timeout to nvme_io_timeout
        NVMe: Use last bytes of f/w rev SCSI Inquiry
        NVMe: Adhere to request queue block accounting enable/disable
        NVMe: Fix nvme get/put queue semantics
        NVMe: Delete NVME_GET_FEAT_TEMP_THRESH
        NVMe: Make admin timeout a module parameter
        NVMe: Make iod bio timeout a parameter
        NVMe: Prevent possible NULL pointer dereference
        NVMe: Fix the buffer size passed in GetLogPage(CDW10.NUMD)
        NVMe: Update data structures for NVMe 1.2
        NVMe: Enable BUILD_BUG_ON checks
        NVMe: Update namespace and controller identify structures to the 1.1a spec
        NVMe: Flush with data support
        NVMe: Configure support for block flush
        NVMe: Add tracepoints
        NVMe: Protect against badly formatted CQEs
        ...
      b55b3902
  4. 15 Jun, 2014 11 commits
    • Daniel Borkmann's avatar
      net: sctp: fix permissions for rto_alpha and rto_beta knobs · b58537a1
      Daniel Borkmann authored
      Commit 3fd091e7 ("[SCTP]: Remove multiple levels of msecs
      to jiffies conversions.") has silently changed permissions for
      rto_alpha and rto_beta knobs from 0644 to 0444. The purpose of
      this was to discourage users from tweaking rto_alpha and
      rto_beta knobs in production environments since they are key
      to correctly compute rtt/srtt.
      
      RFC4960 under section 6.3.1. RTO Calculation says regarding
      rto_alpha and rto_beta under rule C3 and C4:
      
        [...]
        C3)  When a new RTT measurement R' is made, set
      
             RTTVAR <- (1 - RTO.Beta) * RTTVAR + RTO.Beta * |SRTT - R'|
      
             and
      
             SRTT <- (1 - RTO.Alpha) * SRTT + RTO.Alpha * R'
      
             Note: The value of SRTT used in the update to RTTVAR
             is its value before updating SRTT itself using the
             second assignment. After the computation, update
             RTO <- SRTT + 4 * RTTVAR.
      
        C4)  When data is in flight and when allowed by rule C5
             below, a new RTT measurement MUST be made each round
             trip. Furthermore, new RTT measurements SHOULD be
             made no more than once per round trip for a given
             destination transport address. There are two reasons
             for this recommendation: First, it appears that
             measuring more frequently often does not in practice
             yield any significant benefit [ALLMAN99]; second,
             if measurements are made more often, then the values
             of RTO.Alpha and RTO.Beta in rule C3 above should be
             adjusted so that SRTT and RTTVAR still adjust to
             changes at roughly the same rate (in terms of how many
             round trips it takes them to reflect new values) as
             they would if making only one measurement per
             round-trip and using RTO.Alpha and RTO.Beta as given
             in rule C3. However, the exact nature of these
             adjustments remains a research issue.
        [...]
      
      While it is discouraged to adjust rto_alpha and rto_beta
      and not further specified how to adjust them, the RFC also
      doesn't explicitly forbid it, but rather gives a RECOMMENDED
      default value (rto_alpha=3, rto_beta=2). We have a couple
      of users relying on the old permissions before they got
      changed. That said, if someone really has the urge to adjust
      them, we could allow it with a warning in the log.
      
      Fixes: 3fd091e7 ("[SCTP]: Remove multiple levels of msecs to jiffies conversions.")
      Signed-off-by: default avatarDaniel Borkmann <dborkman@redhat.com>
      Cc: Vlad Yasevich <vyasevich@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      b58537a1
    • David S. Miller's avatar
      Merge branch 'csum_fixes' · e4f7ae93
      David S. Miller authored
      Tom Herbert says:
      
      ====================
      Fixes related to some recent checksum modifications.
      
      - Fix GSO constants to match NETIF flags
      - Fix logic in saving checksum complete in __skb_checksum_complete
      - Call __skb_checksum_complete from UDP if we are checksumming over
        whole packet in order to save checksum.
      - Fixes to VXLAN to work correctly with checksum complete
      ====================
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      e4f7ae93
    • Tom Herbert's avatar
      vxlan: Checksum fixes · f79b064c
      Tom Herbert authored
      Call skb_pop_rcv_encapsulation and postpull_rcsum for the Ethernet
      header to work properly with checksum complete.
      Signed-off-by: default avatarTom Herbert <therbert@google.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      f79b064c
    • Tom Herbert's avatar
      net: add skb_pop_rcv_encapsulation · e5eb4e30
      Tom Herbert authored
      This function is used by UDP encapsulation protocols in RX when
      crossing encapsulation boundary. If ip_summed is set to
      CHECKSUM_UNNECESSARY and encapsulation is not set, change to
      CHECKSUM_NONE since the checksum has not been validated within the
      encapsulation. Clears csum_valid by the same rationale.
      Signed-off-by: default avatarTom Herbert <therbert@google.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      e5eb4e30
    • Tom Herbert's avatar
      udp: call __skb_checksum_complete when doing full checksum · bbdff225
      Tom Herbert authored
      In __udp_lib_checksum_complete check if checksum is being done over all
      the data (len is equal to skb->len) and if it is call
      __skb_checksum_complete instead of __skb_checksum_complete_head. This
      allows checksum to be saved in checksum complete.
      Signed-off-by: default avatarTom Herbert <therbert@google.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      bbdff225
    • Tom Herbert's avatar
      net: Fix save software checksum complete · 46fb51eb
      Tom Herbert authored
      Geert reported issues regarding checksum complete and UDP.
      The logic introduced in commit 7e3cead5
      ("net: Save software checksum complete") is not correct.
      
      This patch:
      1) Restores code in __skb_checksum_complete_header except for setting
         CHECKSUM_UNNECESSARY. This function may be calculating checksum on
         something less than skb->len.
      2) Adds saving checksum to __skb_checksum_complete. The full packet
         checksum 0..skb->len is calculated without adding in pseudo header.
         This value is saved in skb->csum and then the pseudo header is added
         to that to derive the checksum for validation.
      3) In both __skb_checksum_complete_header and __skb_checksum_complete,
         set skb->csum_valid to whether checksum of zero was computed. This
         allows skb_csum_unnecessary to return true without changing to
         CHECKSUM_UNNECESSARY which was done previously.
      4) Copy new csum related bits in __copy_skb_header.
      Reported-by: default avatarGeert Uytterhoeven <geert@linux-m68k.org>
      Signed-off-by: default avatarTom Herbert <therbert@google.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      46fb51eb
    • Tom Herbert's avatar
      net: Fix GSO constants to match NETIF flags · 4b28252c
      Tom Herbert authored
      Joseph Gasparakis reported that VXLAN GSO offload stopped working with
      i40e device after recent UDP changes. The problem is that the
      SKB_GSO_* bits are out of sync with the corresponding NETIF flags. This
      patch fixes that. Also, we add BUILD_BUG_ONs in net_gso_ok for several
      GSO constants that were missing to avoid the problem in the future.
      Reported-by: default avatarJoseph Gasparakis <joseph.gasparakis@intel.com>
      Signed-off-by: default avatarTom Herbert <therbert@google.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      4b28252c
    • Linus Torvalds's avatar
      Merge tag 'scsi-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi · abf04af7
      Linus Torvalds authored
      Pull more SCSI updates from James Bottomley:
       "This is just a couple of drivers (hpsa and lpfc) that got left out for
        further testing in linux-next.  We also have one fix to a prior
        submission (qla2xxx sparse)"
      
      * tag 'scsi-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi: (36 commits)
        qla2xxx: fix sparse warnings introduced by previous target mode t10-dif patch
        lpfc: Update lpfc version to driver version 10.2.8001.0
        lpfc: Fix ExpressLane priority setup
        lpfc: mark old devices as obsolete
        lpfc: Fix for initializing RRQ bitmap
        lpfc: Fix for cleaning up stale ring flag and sp_queue_event entries
        lpfc: Update lpfc version to driver version 10.2.8000.0
        lpfc: Update Copyright on changed files from 8.3.45 patches
        lpfc: Update Copyright on changed files
        lpfc: Fixed locking for scsi task management commands
        lpfc: Convert runtime references to old xlane cfg param to fof cfg param
        lpfc: Fix FW dump using sysfs
        lpfc: Fix SLI4 s abort loop to process all FCP rings and under ring_lock
        lpfc: Fixed kernel panic in lpfc_abort_handler
        lpfc: Fix locking for postbufq when freeing
        lpfc: Fix locking for lpfc_hba_down_post
        lpfc: Fix dynamic transitions of FirstBurst from on to off
        hpsa: fix handling of hpsa_volume_offline return value
        hpsa: return -ENOMEM not -1 on kzalloc failure in hpsa_get_device_id
        hpsa: remove messages about volume status VPD inquiry page not supported
        ...
      abf04af7
    • Linus Torvalds's avatar
      Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mason/linux-btrfs · 16d52ef7
      Linus Torvalds authored
      Pull more btrfs updates from Chris Mason:
       "This has a few fixes since our last pull and a new ioctl for doing
        btree searches from userland.  It's very similar to the existing
        ioctl, but lets us return larger items back down to the app"
      
      * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mason/linux-btrfs:
        btrfs: fix error handling in create_pending_snapshot
        btrfs: fix use of uninit "ret" in end_extent_writepage()
        btrfs: free ulist in qgroup_shared_accounting() error path
        Btrfs: fix qgroups sanity test crash or hang
        btrfs: prevent RCU warning when dereferencing radix tree slot
        Btrfs: fix unfinished readahead thread for raid5/6 degraded mounting
        btrfs: new ioctl TREE_SEARCH_V2
        btrfs: tree_search, search_ioctl: direct copy to userspace
        btrfs: new function read_extent_buffer_to_user
        btrfs: tree_search, copy_to_sk: return needed size on EOVERFLOW
        btrfs: tree_search, copy_to_sk: return EOVERFLOW for too small buffer
        btrfs: tree_search, search_ioctl: accept varying buffer
        btrfs: tree_search: eliminate redundant nr_items check
      16d52ef7
    • Linus Torvalds's avatar
      Merge git://git.kvack.org/~bcrl/aio-next · a311c480
      Linus Torvalds authored
      Pull aio fix and cleanups from Ben LaHaise:
       "This consists of a couple of code cleanups plus a minor bug fix"
      
      * git://git.kvack.org/~bcrl/aio-next:
        aio: cleanup: flatten kill_ioctx()
        aio: report error from io_destroy() when threads race in io_destroy()
        fs/aio.c: Remove ctx parameter in kiocb_cancel
      a311c480
    • Al Viro's avatar
      fix __swap_writepage() compile failure on old gcc versions · 05064084
      Al Viro authored
      Tetsuo Handa wrote:
       "Commit 62a8067a ("bio_vec-backed iov_iter") introduced an unnamed
        union inside a struct which gcc-4.4.7 cannot handle.  Name the unnamed
         union as u in order to fix build failure"
      
      Let's do this instead: there is only one place in the entire tree that
      steps into this breakage.  Anon structs and unions work in older gcc
      versions; as the matter of fact, we have those in the tree - see e.g.
      struct ieee80211_tx_info in include/net/mac80211.h
      
      What doesn't work is handling their initializers:
      
      struct {
      	int a;
      	union {
      		int b;
      		char c;
      	};
      } x[2] = {{.a = 1, .c = 'a'}, {.a = 0, .b = 1}};
      
      is the obvious syntax for initializer, perfectly fine for C11 and
      handled correctly by gcc-4.7 or later.
      
      Earlier versions, though, break on it - declaration is fine and so's
      access to fields (i.e.  x[0].c = 'a'; would produce the right code), but
      members of the anon structs and unions are not inserted into the right
      namespace.  Tellingly, those older versions will not barf on struct {int
      a; struct {int a;};}; - looks like they just have it hacked up somewhere
      around the handling of .  and -> instead of doing the right thing.
      
      The easiest way to deal with that crap is to turn initialization of
      those fields (in the only place where we have such initializer of
      iov_iter) into plain assignment.
      Reported-by: default avatarTetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
      Reported-by: default avatarRussell King <rmk+kernel@arm.linux.org.uk>
      Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      05064084
  5. 14 Jun, 2014 4 commits
  6. 13 Jun, 2014 3 commits