1. 14 Jan, 2016 1 commit
  2. 13 Jan, 2016 1 commit
    • Jiri Kosina's avatar
      Revert "INPUT: xpad: switch Logitech G920 Wheel into HID mode" · 5f008c98
      Jiri Kosina authored
      This reverts commit 27b9d5a2.
      
      I am reverting this one, while keeping the rest of the G920 support in,
      so that it immediately starts working once proper HID-mode switching
      is implemented.
      
      Quoting Dmitry Torokhov for rationale:
      
      ==
      It is wrong. Aside form the fact that IMO xpad.c is the wrong place for
      this code to be in, why are we waiting for the input device to be
      opened by userspace before we do the switch instead of doing it
      immediately?
      ==
      
      Several people (Simon Wood and Michal Maly) expressed the intent to work
      on proper HID switching in a short term.
      Signed-off-by: default avatarJiri Kosina <jkosina@suse.cz>
      5f008c98
  3. 08 Jan, 2016 3 commits
  4. 30 Dec, 2015 1 commit
    • Mika Westerberg's avatar
      HID: i2c-hid: Prevent sending reports from racing with device reset · 9a327405
      Mika Westerberg authored
      When an i2c-hid device is resumed from system sleep the driver resets
      the device to be sure it is in known state. The device is expected to
      issue an interrupt when reset is complete.
      
      This reset might take few milliseconds to complete so if the HID driver
      on top (hid-rmi) starts to set up the device by sending feature reports
      etc. the device might not issue the reset complete interrupt anymore.
      
      Below is what happens to touchpad on Lenovo Yoga 900 during resume from
      system sleep:
      
        [   24.790951] i2c_hid i2c-SYNA2B29:00: i2c_hid_hwreset
        [   24.790973] i2c_hid i2c-SYNA2B29:00: i2c_hid_set_power
        [   24.790982] i2c_hid i2c-SYNA2B29:00: __i2c_hid_command: cmd=22 00 00 08
        [   24.793011] i2c_hid i2c-SYNA2B29:00: resetting...
        [   24.793016] i2c_hid i2c-SYNA2B29:00: __i2c_hid_command: cmd=22 00 00 01
      
      Here i2c-hid sends reset command to the touchpad.
      
        [   24.794012] i2c_hid i2c-SYNA2B29:00: input: 06 00 01 00 00 00
        [   24.794051] i2c_hid i2c-SYNA2B29:00: i2c_hid_set_or_send_report
        [   24.794059] i2c_hid i2c-SYNA2B29:00: __i2c_hid_command:
                       cmd=22 00 3f 03 0f 23 00 04 00 0f 01
      
      Now hid-rmi puts the touchpad to correct mode by sending it a feature
      report. This makes the touchpad not to issue reset complete interrupt.
      
        [   24.796092] i2c_hid i2c-SYNA2B29:00: __i2c_hid_command: waiting...
      
      i2c-hid starts to wait for the reset interrupt to trigger which never
      happens.
      
        [   24.798304] i2c_hid i2c-SYNA2B29:00: i2c_hid_set_or_send_report
        [   24.798313] i2c_hid i2c-SYNA2B29:00: __i2c_hid_command:
                       cmd=25 00 17 00 09 01 42 00 2e 00 19 19 00 10 cc 06 74 04 0f
                           19 00 00 00 00 00
      
      Yet another output report from hid-rmi driver.
      
        [   29.795630] i2c_hid i2c-SYNA2B29:00: __i2c_hid_command: finished.
        [   29.795637] i2c_hid i2c-SYNA2B29:00: failed to reset device.
      
      After 5 seconds i2c-hid driver times out.
      
        [   29.795642] i2c_hid i2c-SYNA2B29:00: i2c_hid_set_power
        [   29.795649] i2c_hid i2c-SYNA2B29:00: __i2c_hid_command: cmd=22 00 01 08
        [   29.797576] dpm_run_callback(): i2c_hid_resume+0x0/0xb0 returns -61
        [   29.797584] PM: Device i2c-SYNA2B29:00 failed to resume: error -61
      
      After this the touchpad does not work anymore (and also resume itself
      gets slowed down because of the timeout).
      
      Prevent sending of feature/output reports while the device is being
      reset by adding a mutex which is held during that time.
      Reported-and-tested-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      Reported-by: default avatarNish Aravamudan <nish.aravamudan@gmail.com>
      Suggested-by: default avatarBenjamin Tissoires <benjamin.tissoires@redhat.com>
      Reviewed-by: default avatarBenjamin Tissoires <benjamin.tissoires@redhat.com>
      Signed-off-by: default avatarMika Westerberg <mika.westerberg@linux.intel.com>
      Signed-off-by: default avatarJiri Kosina <jkosina@suse.cz>
      9a327405
  5. 28 Dec, 2015 7 commits
  6. 17 Dec, 2015 6 commits
  7. 08 Dec, 2015 1 commit
  8. 03 Dec, 2015 1 commit
  9. 02 Dec, 2015 12 commits
  10. 01 Dec, 2015 4 commits
    • Linus Torvalds's avatar
      Merge tag 'remoteproc-4.4-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/ohad/remoteproc · 6a24e72d
      Linus Torvalds authored
      Pull remoteproc fixes from Ohad Ben-Cohen:
       "Two one-liners coming from Suman and Arnd"
      
      * tag 'remoteproc-4.4-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/ohad/remoteproc:
        remoteproc: fix memory leak of remoteproc ida cache layers
        remoteproc: avoid stack overflow in debugfs file
      6a24e72d
    • Ioan-Adrian Ratiu's avatar
      HID: usbhid: fix recursive deadlock · e470127e
      Ioan-Adrian Ratiu authored
      The critical section protected by usbhid->lock in hid_ctrl() is too
      big and because of this it causes a recursive deadlock. "Too big" means
      the case statement and the call to hid_input_report() do not need to be
      protected by the spinlock (no URB operations are done inside them).
      
      The deadlock happens because in certain rare cases drivers try to grab
      the lock while handling the ctrl irq which grabs the lock before them
      as described above. For example newer wacom tablets like 056a:033c try
      to reschedule proximity reads from wacom_intuos_schedule_prox_event()
      calling hid_hw_request() -> usbhid_request() -> usbhid_submit_report()
      which tries to grab the usbhid lock already held by hid_ctrl().
      
      There are two ways to get out of this deadlock:
          1. Make the drivers work "around" the ctrl critical region, in the
          wacom case for ex. by delaying the scheduling of the proximity read
          request itself to a workqueue.
          2. Shrink the critical region so the usbhid lock protects only the
          instructions which modify usbhid state, calling hid_input_report()
          with the spinlock unlocked, allowing the device driver to grab the
          lock first, finish and then grab the lock afterwards in hid_ctrl().
      
      This patch implements the 2nd solution.
      Signed-off-by: default avatarIoan-Adrian Ratiu <adi@adirat.com>
      Signed-off-by: default avatarJiri Kosina <jkosina@suse.cz>
      e470127e
    • Geert Uytterhoeven's avatar
      pinctrl: sh-pfc: sh7734: Add missing cfg macro parameter to fix build · 48111b79
      Geert Uytterhoeven authored
      When building for SH7734:
      
          drivers/pinctrl/sh-pfc/pfc-sh7734.c:586:1: error: macro "_GP_DATA" passed 5 arguments, but takes just 4
          drivers/pinctrl/sh-pfc/pfc-sh7734.c:586:2: error: '_GP_DATA' undeclared here (not in a function)
          drivers/pinctrl/sh-pfc/pfc-sh7734.c:586:1: error: macro "_GP_DATA" passed 5 arguments, but takes just 4
          drivers/pinctrl/sh-pfc/pfc-sh7734.c:586:1: error: macro "_GP_DATA" passed 5 arguments, but takes just 4
          ...
          drivers/pinctrl/sh-pfc/pfc-sh7734.c:2389:1: error: macro "_GP_INOUTSEL" passed 5 arguments, but takes just 4
          drivers/pinctrl/sh-pfc/pfc-sh7734.c:2389:53: error: '_GP_INOUTSEL' undeclared here (not in a function)
          drivers/pinctrl/sh-pfc/pfc-sh7734.c:2389:2: warning: initialization makes integer from pointer without a cast [enabled by default]
          drivers/pinctrl/sh-pfc/pfc-sh7734.c:2389:2: warning: (near initialization for '(anonymous)[0]') [enabled by default]
          ...
          drivers/pinctrl/sh-pfc/pfc-sh7734.c:2416:1: error: macro "_GP_INDT" passed 5 arguments, but takes just 4
          drivers/pinctrl/sh-pfc/pfc-sh7734.c:2416:47: error: '_GP_INDT' undeclared here (not in a function)
          drivers/pinctrl/sh-pfc/pfc-sh7734.c:2416:2: warning: initialization makes integer from pointer without a cast [enabled by default]
          drivers/pinctrl/sh-pfc/pfc-sh7734.c:2416:2: warning: (near initialization for '(anonymous)[0]') [enabled by default]
          ...
      
      Add the missing "cfg" macro parameters to the sh7734-specific
      _GP_DATA(), _GP_INOUTSEL(), and _GP_INDT() macros to fix this.
      
      Fixes: 22768fc6 ("pinctrl: sh-pfc: Add macros defining GP ports with config flags")
      Signed-off-by: default avatarGeert Uytterhoeven <geert+renesas@glider.be>
      Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
      48111b79
    • Linus Torvalds's avatar
      Merge tag 'mn10300-for-linus-v4.4-rc4' of... · 2255702d
      Linus Torvalds authored
      Merge tag 'mn10300-for-linus-v4.4-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging
      
      Pull mn10300 fix from Guenter Roeck:
       "A single patch to fix mn10300 build failures"
      
      * tag 'mn10300-for-linus-v4.4-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging:
        mn10300: Select CONFIG_HAVE_UID16 to fix build failure
      2255702d
  11. 30 Nov, 2015 3 commits
    • Linus Torvalds's avatar
      Merge tag 'trace-v4.4-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace · 9e5d25e8
      Linus Torvalds authored
      Pull tracing fixes from Steven Rostedt:
       "I found two minor bugs while doing development on the ring buffer
        code.
      
        The first is something that's been there since its creation.  If a
        reader reads a page out of the ring buffer before there's any events
        on it, it can get an out of date timestamp for that event.  It may be
        off by a few microseconds, more if the first event gets discarded.
        The fix was to only update the reader time stamp when it actually sees
        an event on the page, instead of just reading the timestamp from the
        page even if it has no events on it.  That timestamp is still volatile
        until an event is present.
      
        The second bug is more recent.  Instead of passing around parameters a
        descriptor was made and the parameters are passed via a single
        descriptor.  This simplified the code a bit.  But there was one place
        that expected the parameter to be passed by value not reference (which
        a descriptor now does).  And it added to the length of the event,
        which may be ignored later, but the length should not have been
        increased.  The only real problem with this bug is that it may
        allocate more than was needed for the event"
      
      * tag 'trace-v4.4-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace:
        ring-buffer: Put back the length if crossed page with add_timestamp
        ring-buffer: Update read stamp with first real commit on page
      9e5d25e8
    • Guenter Roeck's avatar
      mn10300: Select CONFIG_HAVE_UID16 to fix build failure · c86576ea
      Guenter Roeck authored
      mn10300 builds fail with
      
      fs/stat.c: In function 'cp_old_stat':
      fs/stat.c:163:2: error: 'old_uid_t' undeclared
      
      ipc/util.c: In function 'ipc64_perm_to_ipc_perm':
      ipc/util.c:540:2: error: 'old_uid_t' undeclared
      
      Select CONFIG_HAVE_UID16 and remove local definition of CONFIG_UID16
      to fix the problem.
      
      Fixes: fbc416ff ("arm64: fix building without CONFIG_UID16")
      Cc: Arnd Bergmann <arnd@arndb.de>
      Acked-by: default avatarArnd Bergmann <arnd@arndb.de>
      Acked-by: default avatarAcked-by: David Howells <dhowells@redhat.com>
      Signed-off-by: default avatarGuenter Roeck <linux@roeck-us.net>
      c86576ea
    • Grygorii Strashko's avatar
      gpio: omap: drop omap1 mpuio specific irq_mask/unmask callbacks · 000255b7
      Grygorii Strashko authored
      Originally OMAP MPUIO GPIO irqchip was implemented using Generic irq
      chip, but after set of reworks Generic irq chip code was replaced by
      common OMAP GPIO implementation and finally removed by
      commit d2d05c65 ("gpio: omap: Fix regression for MPUIO interrupts").
      Unfortunately, above commit left .irq_mask/unmask callbacks assigned
      as below for MPUIO GPIO case:
      	irqc->irq_mask = irq_gc_mask_set_bit;
      	irqc->irq_unmask = irq_gc_mask_clr_bit;
      
      This now causes boot failure on OMAP1 platforms, after
      commit 450fa54c ("gpio: omap: convert to use generic irq handler")
      which forces these callbacks to be called during GPIO IRQs mapping
      from gpiochip_irq_map:
      
      Unable to handle kernel NULL pointer dereference at virtual address 00000000
      pgd = c0004000
      [00000000] *pgd=00000000
      Internal error: Oops: 75 [#1] ARM
      Modules linked in:
      CPU: 0 PID: 1 Comm: swapper Not tainted 4.4.0-rc1-e3-los_afe0c+-00002-g25379c0-dirty #1
      Hardware name: Amstrad E3 (Delta)
      task: c1836000 ti: c1838000 task.ti: c1838000
      PC is at irq_gc_mask_set_bit+0x1c/0x60
      LR is at __irq_do_set_handler+0x118/0x15c
      pc : [<c004848c>]    lr : [<c0047d4c>]    psr: 600000d3
      sp : c1839c90  ip : c1862c64  fp : c1839c9c
      r10: 00000000  r9 : c0411950  r8 : c0411bbc
      r7 : 00000000  r6 : c185c310  r5 : c00444e8  r4 : c185c300
      r3 : c1854b50  r2 : 00000000  r1 : 00000000  r0 : c185c310
      Flags: nZCv  IRQs off  FIQs off  Mode SVC_32  ISA ARM  Segment kernel
      Control: 0000317f  Table: 10004000  DAC: 00000057
      Process swapper (pid: 1, stack limit = 0xc1838190)
      Stack: (0xc1839c90 to 0xc183a000)
      
      [...]
      
      Backtrace:
      [<c0048470>] (irq_gc_mask_set_bit) from [<c0047d4c>] (__irq_do_set_handler+0x118/0x15c)
      [<c0047c34>] (__irq_do_set_handler) from [<c0047dd4>] (__irq_set_handler+0x44/0x5c)
       r6:00000000 r5:c00444e8 r4:c185c300
      [<c0047d90>] (__irq_set_handler) from [<c0047e1c>] (irq_set_chip_and_handler_name+0x30/0x34)
       r7:00000050 r6:00000000 r5:c00444e8 r4:00000050
      [<c0047dec>] (irq_set_chip_and_handler_name) from [<c01b345c>] (gpiochip_irq_map+0x3c/0x8c)
       r7:00000050 r6:00000000 r5:00000050 r4:c1862c64
      [<c01b3420>] (gpiochip_irq_map) from [<c0049670>] (irq_domain_associate+0x7c/0x1c4)
       r5:c185c310 r4:c185cb00
      [<c00495f4>] (irq_domain_associate) from [<c0049894>] (irq_domain_add_simple+0x98/0xc0)
       r8:c0411bbc r7:c185cb00 r6:00000050 r5:00000010 r4:00000001
      [<c00497fc>] (irq_domain_add_simple) from [<c01b3328>] (_gpiochip_irqchip_add+0x64/0x10c)
       r7:c1862c64 r6:c0419280 r5:c1862c64 r4:c1854b50
      [<c01b32c4>] (_gpiochip_irqchip_add) from [<c01b79f4>] (omap_gpio_probe+0x2fc/0x63c)
       r5:c1854b50 r4:c1862c10
      [<c01b76f8>] (omap_gpio_probe) from [<c01fcf58>] (platform_drv_probe+0x2c/0x64)
       r10:00000000 r9:c03e45e8 r8:00000000 r7:c0419294 r6:c0411984 r5:c0419294
       r4:c0411950
      [<c01fcf2c>] (platform_drv_probe) from [<c01fb668>] (really_probe+0x160/0x29c)
      
      Hence, fix it by remove obsolete callbacks assignment. After this
      change 	omap_gpio_mask_irq()/omap_gpio_unmask_irq() will be used
      for MPUIO IRQs masking, but this now happens anyway from
      omap_gpio_irq_startup/shutdown().
      
      Cc: Tony Lindgren <tony@atomide.com>
      Fixes: commit d2d05c65 ("gpio: omap: Fix regression for MPUIO interrupts")
      Reported-by: default avatarAaro Koskinen <aaro.koskinen@iki.fi>
      Signed-off-by: default avatarGrygorii Strashko <grygorii.strashko@ti.com>
      Acked-by: default avatarSantosh Shilimkar <ssantosh@kernel.org>
      Tested-by: default avatarAaro Koskinen <aaro.koskinen@iki.fi>
      Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
      000255b7