1. 09 Jan, 2012 1 commit
  2. 08 Jan, 2012 8 commits
  3. 05 Jan, 2012 2 commits
  4. 02 Jan, 2012 2 commits
  5. 21 Dec, 2011 3 commits
    • Daniel Kurtz's avatar
      HID: usbhid: defer LED setting to a workqueue · 4371ea82
      Daniel Kurtz authored
      Defer LED setting action to a workqueue.
      This is more likely to send all LED change events in a single URB.
      Signed-off-by: default avatarDaniel Kurtz <djkurtz@chromium.org>
      Acked-by: default avatarOliver Neukum <oneukum@suse.de>
      Signed-off-by: default avatarJiri Kosina <jkosina@suse.cz>
      4371ea82
    • Daniel Kurtz's avatar
      HID: usbhid: hid-core: submit queued urbs before suspend · f0befcd6
      Daniel Kurtz authored
      If any userspace program has opened a keyboard device, the input core
      de-activates the keyboard's LEDs upon suspend().  It does this by sending
      individual EV_LED[LED_X]=0 events to the underlying device driver by
      directly calling the driver's registered event() handler.
      
      The usb-hid driver event() handler processes each request by immediately
      attempting to submit a CTRL URB to turn off the LED.  USB URB submission
      is asynchronous.  First the URB is added to the head of the ctrl queue.
      Then, if the CTRL_RUNNING flag is false, the URB is submitted immediately
      (and CTRL_RUNNING is set).  If the CTRL_RUNNING flag was already true,
      then the newly queued URB is submitted in the ctrl completion handler when
      all previously submitted URBs have completed.  When all queued URBs have
      been submitted, the completion handler clears the CTRL_RUNNING flag.
      
      In the 2-LED suspend case, at input suspend(), 2 LED event CTRL URBs get
      queued, with only the first actually submitted.  Soon after input
      suspend() handler finishes, the usb-hid suspend() handler gets called.
      Since this is NOT a PM_EVENT_AUTO suspend, the handler sets
      REPORTED_IDLE, then waits for io to complete.
      
      Unfortunately, this usually happens while the first LED request is
      actually still being processed.  Thus when the completion handler tries
      to submit the second LED request it fails, since REPORTED_IDLE is
      already set!  This REPORTED_IDLE check failure causes the completion
      handler to complete, however without clearing the CTRL_RUNNING flag.
      This, in turn, means that the suspend() handler's wait_io() condition
      is never satisfied, and instead it times out after 10 seconds, aborting
      the original system suspend.
      
      This patch changes the behavior to the following:
        (1) allow completion handler to finish submitting all queued URBs, even if
            REPORTED_IDLE is set.  This guarantees that all URBs queued before the
            hid-core suspend() call will be submitted before the system is
            suspended.
        (2) if REPORTED_IDLE is set and the URB queue is empty, queue, but
            don't submit, new URB submission requests.  These queued requests get
            submitted when resume() flushes the URB queue. This is similar to the
            existing behavior, however, any requests that arrive while the queue is
            not yet empty will still get submitted before suspend.
        (3) set the RUNNING flag when flushing the URB queue in resume().
            This keeps URBs that were queued in (2) from colliding with any new
            URBs that are being submitted during the resume process.  The new URB
            submission requests upon resume get properly queued behind the ones
            being flushed instead of the current situation where they collide,
            causing memory corruption and oopses.
      Signed-off-by: default avatarDaniel Kurtz <djkurtz@chromium.org>
      Acked-by: default avatarOliver Neukum <oneukum@suse.de>
      Signed-off-by: default avatarJiri Kosina <jkosina@suse.cz>
      f0befcd6
    • Daniel Kurtz's avatar
      HID: usbhid: remove LED_ON · ede6a8b2
      Daniel Kurtz authored
      LED_ON was defined in the original version of the hid-core autosuspend patch.
      However, during review, the setting and clearing of it was redone
      using ledcount.  The test was left in accidentally.
      Signed-off-by: default avatarDaniel Kurtz <djkurtz@chromium.org>
      Acked-by: default avatarOliver Neukum <oneukum@suse.de>
      Signed-off-by: default avatarJiri Kosina <jkosina@suse.cz>
      ede6a8b2
  6. 20 Dec, 2011 2 commits
  7. 19 Dec, 2011 1 commit
  8. 16 Dec, 2011 1 commit
    • Jiri Kosina's avatar
      HID: introduce proper dependency of HID_BATTERY on POWER_SUPPLY · 7e69ba7c
      Jiri Kosina authored
      ppc6xx_defconfig reveals this:
      
      drivers/built-in.o: In function `hidinput_cleanup_battery': drivers/hid/hid-input.c:351: undefined reference to`power_supply_unregister'
      drivers/built-in.o: In function `hidinput_setup_battery': drivers/hid/hid-input.c:338: undefined reference to `power_supply_register'
      make[1]: *** [.tmp_vmlinux1] Error 1
      
      The defconfig in question doens't mention either option and kbuild is
      genertaing
      
      	CONFIG_HID_BATTERY_STRENGTH=y
      	CONFIG_POWER_SUPPLY=m
      
      which is wrong. Put a proper dependency in place.
      Reported-by: default avatarTony Breeds <tony@bakeyournoodle.com>
      Signed-off-by: default avatarJiri Kosina <jkosina@suse.cz>
      7e69ba7c
  9. 15 Dec, 2011 2 commits
  10. 11 Dec, 2011 1 commit
  11. 06 Dec, 2011 1 commit
  12. 04 Dec, 2011 1 commit
    • Linus Torvalds's avatar
      x86: Fix boot failures on older AMD CPU's · 8e8da023
      Linus Torvalds authored
      People with old AMD chips are getting hung boots, because commit
      bcb80e53 ("x86, microcode, AMD: Add microcode revision to
      /proc/cpuinfo") moved the microcode detection too early into
      "early_init_amd()".
      
      At that point we are *so* early in the booth that the exception tables
      haven't even been set up yet, so the whole
      
      	rdmsr_safe(MSR_AMD64_PATCH_LEVEL, &c->microcode, &dummy);
      
      doesn't actually work: if the rdmsr does a GP fault (due to non-existant
      MSR register on older CPU's), we can't fix it up yet, and the boot fails.
      
      Fix it by simply moving the code to a slightly later point in the boot
      (init_amd() instead of early_init_amd()), since the kernel itself
      doesn't even really care about the microcode patchlevel at this point
      (or really ever: it's made available to user space in /proc/cpuinfo, and
      updated if you do a microcode load).
      Reported-tested-and-bisected-by: default avatarLarry Finger <Larry.Finger@lwfinger.net>
      Tested-by: default avatarBob Tracy <rct@gherkin.frus.com>
      Acked-by: default avatarBorislav Petkov <borislav.petkov@amd.com>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Srivatsa S. Bhat <srivatsa.bhat@linux.vnet.ibm.com>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      8e8da023
  13. 03 Dec, 2011 1 commit
    • Konrad Rzeszutek Wilk's avatar
      xen/pm_idle: Make pm_idle be default_idle under Xen. · e5fd47bf
      Konrad Rzeszutek Wilk authored
      The idea behind commit d91ee586 ("cpuidle: replace xen access to x86
      pm_idle and default_idle") was to have one call - disable_cpuidle()
      which would make pm_idle not be molested by other code.  It disallows
      cpuidle_idle_call to be set to pm_idle (which is excellent).
      
      But in the select_idle_routine() and idle_setup(), the pm_idle can still
      be set to either: amd_e400_idle, mwait_idle or default_idle.  This
      depends on some CPU flags (MWAIT) and in AMD case on the type of CPU.
      
      In case of mwait_idle we can hit some instances where the hypervisor
      (Amazon EC2 specifically) sets the MWAIT and we get:
      
        Brought up 2 CPUs
        invalid opcode: 0000 [#1] SMP
      
        Pid: 0, comm: swapper Not tainted 3.1.0-0.rc6.git0.3.fc16.x86_64 #1
        RIP: e030:[<ffffffff81015d1d>]  [<ffffffff81015d1d>] mwait_idle+0x6f/0xb4
        ...
        Call Trace:
         [<ffffffff8100e2ed>] cpu_idle+0xae/0xe8
         [<ffffffff8149ee78>] cpu_bringup_and_idle+0xe/0x10
        RIP  [<ffffffff81015d1d>] mwait_idle+0x6f/0xb4
         RSP <ffff8801d28ddf10>
      
      In the case of amd_e400_idle we don't get so spectacular crashes, but we
      do end up making an MSR which is trapped in the hypervisor, and then
      follow it up with a yield hypercall.  Meaning we end up going to
      hypervisor twice instead of just once.
      
      The previous behavior before v3.0 was that pm_idle was set to
      default_idle regardless of select_idle_routine/idle_setup.
      
      We want to do that, but only for one specific case: Xen.  This patch
      does that.
      
      Fixes RH BZ #739499 and Ubuntu #881076
      Reported-by: default avatarStefan Bader <stefan.bader@canonical.com>
      Signed-off-by: default avatarKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      e5fd47bf
  14. 02 Dec, 2011 14 commits