1. 16 Oct, 2011 9 commits
    • Michel Dänzer's avatar
      drm/radeon: Update AVIVO cursor coordinate origin before x/yorigin calculation. · 1a795f75
      Michel Dänzer authored
      commit b8aee294 upstream.
      
      Fixes cursor disappearing prematurely when moving off a top/left edge which
      is not located at the desktop top/left edge.
      Signed-off-by: default avatarMichel Dänzer <michel.daenzer@amd.com>
      Reviewed-by: default avatarAlex Deucher <alexander.deucher@amd.com>
      Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      1a795f75
    • Axel Lin's avatar
      ASoC: Fix setting update bits for WM8753_LADC and WM8753_RADC · a671258d
      Axel Lin authored
      commit 21d17dd2 upstream.
      
      Current code set update bits for WM8753_LDAC and WM8753_RDAC twice,
      but missed setting update bits for WM8753_LADC and WM8753_RADC.
      
      I think it is a copy-paste bug in commit 776065
      "ASoC: codecs: wm8753: Fix register cache incoherency".
      Signed-off-by: default avatarAxel Lin <axel.lin@gmail.com>
      Signed-off-by: default avatarMark Brown <broonie@opensource.wolfsonmicro.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      a671258d
    • Arnd Bergmann's avatar
      ASoC: use a valid device for dev_err() in Zylonite · 4f2b7b91
      Arnd Bergmann authored
      commit eff919ac upstream.
      
      A recent conversion has introduced references to &pdev->dev, which does
      not actually exist in all the contexts it's used in.
      
      Replace this with card->dev where necessary, in order to let
      the driver build again.
      Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
      Signed-off-by: default avatarMark Brown <broonie@opensource.wolfsonmicro.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      4f2b7b91
    • Takashi Iwai's avatar
      lis3: fix regression of HP DriveGuard with 8bit chip · d694ac34
      Takashi Iwai authored
      commit 05faadcf upstream.
      
      Commit 2a7fade7 ("hwmon: lis3: Power on corrections") caused a
      regression on HP laptops with 8bit chip.  Writing CTRL2_BOOT_8B bit seems
      clearing the BIOS setup, and no proper interrupt for DriveGuard will be
      triggered any more.
      
      Since the init code there is basically only for embedded devices, put a
      pdata check so that the problematic initialization will be skipped for
      hp_accel stuff.
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      Cc: Eric Piel <eric.piel@tremplin-utc.net>
      Cc: Samu Onkalo <samu.p.onkalo@nokia.com>
      Signed-off-by: default avatarAndrew Morton <akpm@google.com>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      d694ac34
    • Peter Zijlstra's avatar
      posix-cpu-timers: Cure SMP wobbles · 249cf808
      Peter Zijlstra authored
      commit d670ec13 upstream.
      
      David reported:
      
        Attached below is a watered-down version of rt/tst-cpuclock2.c from
        GLIBC.  Just build it with "gcc -o test test.c -lpthread -lrt" or
        similar.
      
        Run it several times, and you will see cases where the main thread
        will measure a process clock difference before and after the nanosleep
        which is smaller than the cpu-burner thread's individual thread clock
        difference.  This doesn't make any sense since the cpu-burner thread
        is part of the top-level process's thread group.
      
        I've reproduced this on both x86-64 and sparc64 (using both 32-bit and
        64-bit binaries).
      
        For example:
      
        [davem@boricha build-x86_64-linux]$ ./test
        process: before(0.001221967) after(0.498624371) diff(497402404)
        thread:  before(0.000081692) after(0.498316431) diff(498234739)
        self:    before(0.001223521) after(0.001240219) diff(16698)
        [davem@boricha build-x86_64-linux]$
      
        The diff of 'process' should always be >= the diff of 'thread'.
      
        I make sure to wrap the 'thread' clock measurements the most tightly
        around the nanosleep() call, and that the 'process' clock measurements
        are the outer-most ones.
      
        ---
        #include <unistd.h>
        #include <stdio.h>
        #include <stdlib.h>
        #include <time.h>
        #include <fcntl.h>
        #include <string.h>
        #include <errno.h>
        #include <pthread.h>
      
        static pthread_barrier_t barrier;
      
        static void *chew_cpu(void *arg)
        {
      	  pthread_barrier_wait(&barrier);
      	  while (1)
      		  __asm__ __volatile__("" : : : "memory");
      	  return NULL;
        }
      
        int main(void)
        {
      	  clockid_t process_clock, my_thread_clock, th_clock;
      	  struct timespec process_before, process_after;
      	  struct timespec me_before, me_after;
      	  struct timespec th_before, th_after;
      	  struct timespec sleeptime;
      	  unsigned long diff;
      	  pthread_t th;
      	  int err;
      
      	  err = clock_getcpuclockid(0, &process_clock);
      	  if (err)
      		  return 1;
      
      	  err = pthread_getcpuclockid(pthread_self(), &my_thread_clock);
      	  if (err)
      		  return 1;
      
      	  pthread_barrier_init(&barrier, NULL, 2);
      	  err = pthread_create(&th, NULL, chew_cpu, NULL);
      	  if (err)
      		  return 1;
      
      	  err = pthread_getcpuclockid(th, &th_clock);
      	  if (err)
      		  return 1;
      
      	  pthread_barrier_wait(&barrier);
      
      	  err = clock_gettime(process_clock, &process_before);
      	  if (err)
      		  return 1;
      
      	  err = clock_gettime(my_thread_clock, &me_before);
      	  if (err)
      		  return 1;
      
      	  err = clock_gettime(th_clock, &th_before);
      	  if (err)
      		  return 1;
      
      	  sleeptime.tv_sec = 0;
      	  sleeptime.tv_nsec = 500000000;
      	  nanosleep(&sleeptime, NULL);
      
      	  err = clock_gettime(th_clock, &th_after);
      	  if (err)
      		  return 1;
      
      	  err = clock_gettime(my_thread_clock, &me_after);
      	  if (err)
      		  return 1;
      
      	  err = clock_gettime(process_clock, &process_after);
      	  if (err)
      		  return 1;
      
      	  diff = process_after.tv_nsec - process_before.tv_nsec;
      	  printf("process: before(%lu.%.9lu) after(%lu.%.9lu) diff(%lu)\n",
      		 process_before.tv_sec, process_before.tv_nsec,
      		 process_after.tv_sec, process_after.tv_nsec, diff);
      	  diff = th_after.tv_nsec - th_before.tv_nsec;
      	  printf("thread:  before(%lu.%.9lu) after(%lu.%.9lu) diff(%lu)\n",
      		 th_before.tv_sec, th_before.tv_nsec,
      		 th_after.tv_sec, th_after.tv_nsec, diff);
      	  diff = me_after.tv_nsec - me_before.tv_nsec;
      	  printf("self:    before(%lu.%.9lu) after(%lu.%.9lu) diff(%lu)\n",
      		 me_before.tv_sec, me_before.tv_nsec,
      		 me_after.tv_sec, me_after.tv_nsec, diff);
      
      	  return 0;
        }
      
      This is due to us using p->se.sum_exec_runtime in
      thread_group_cputime() where we iterate the thread group and sum all
      data. This does not take time since the last schedule operation (tick
      or otherwise) into account. We can cure this by using
      task_sched_runtime() at the cost of having to take locks.
      
      This also means we can (and must) do away with
      thread_group_sched_runtime() since the modified thread_group_cputime()
      is now more accurate and would deadlock when called from
      thread_group_sched_runtime().
      
      Aside of that it makes the function safe on 32 bit systems. The old
      code added t->se.sum_exec_runtime unprotected. sum_exec_runtime is a
      64bit value and could be changed on another cpu at the same time.
      Reported-by: default avatarDavid Miller <davem@davemloft.net>
      Signed-off-by: default avatarPeter Zijlstra <a.p.zijlstra@chello.nl>
      Link: http://lkml.kernel.org/r/1314874459.7945.22.camel@twinsTested-by: default avatarDavid Miller <davem@davemloft.net>
      Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      249cf808
    • Borislav Petkov's avatar
      ide-disk: Fix request requeuing · 3217df8e
      Borislav Petkov authored
      commit 2c8fc867 upstream.
      
      Simon Kirby reported that on his RAID setup with idedisk underneath
      the box OOMs after a couple of days of runtime. Running with
      CONFIG_DEBUG_KMEMLEAK pointed to idedisk_prep_fn() which unconditionally
      allocates an ide_cmd struct. However, ide_requeue_and_plug() can be
      called more than once per request, either from the request issue or the
      IRQ handler path and do blk_peek_request() ends up in idedisk_prep_fn()
      repeatedly, allocating a struct ide_cmd everytime and "forgetting" the
      previous pointer.
      
      Make sure the code reuses the old allocated chunk.
      Reported-and-tested-by: default avatarSimon Kirby <sim@hostway.ca>
      Link: http://marc.info/?l=linux-kernel&m=131667641517919
      Link: http://lkml.kernel.org/r/20110922072643.GA27232@hostway.caSigned-off-by: default avatarBorislav Petkov <bp@alien8.de>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      3217df8e
    • Simon Kirby's avatar
      sched: Fix up wchan borkage · 4e41ce69
      Simon Kirby authored
      commit 6ebbe7a0 upstream.
      
      Commit c259e01a ("sched: Separate the scheduler entry for
      preemption") contained a boo-boo wrecking wchan output. It forgot to
      put the new schedule() function in the __sched section and thereby
      doesn't get properly ignored for things like wchan.
      Tested-by: default avatarSimon Kirby <sim@hostway.ca>
      Signed-off-by: default avatarPeter Zijlstra <a.p.zijlstra@chello.nl>
      Link: http://lkml.kernel.org/r/20110923000346.GA25425@hostway.caSigned-off-by: default avatarIngo Molnar <mingo@elte.hu>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      4e41ce69
    • Shawn Bohrer's avatar
      sched/rt: Migrate equal priority tasks to available CPUs · 113f8b8f
      Shawn Bohrer authored
      commit 3be209a8 upstream.
      
      Commit 43fa5460 ("sched: Try not to
      migrate higher priority RT tasks") also introduced a change in behavior
      which keeps RT tasks on the same CPU if there is an equal priority RT
      task currently running even if there are empty CPUs available.
      
      This can cause unnecessary wakeup latencies, and can prevent the
      scheduler from balancing all RT tasks across available CPUs.
      
      This change causes an RT task to search for a new CPU if an equal
      priority RT task is already running on wakeup.  Lower priority tasks
      will still have to wait on higher priority tasks, but the system should
      still balance out because there is always the possibility that if there
      are both a high and low priority RT tasks on a given CPU that the high
      priority task could wakeup while the low priority task is running and
      force it to search for a better runqueue.
      Signed-off-by: default avatarShawn Bohrer <sbohrer@rgmadvisors.com>
      Acked-by: default avatarSteven Rostedt <rostedt@goodmis.org>
      Tested-by: default avatarSteven Rostedt <rostedt@goodmis.org>
      Signed-off-by: default avatarPeter Zijlstra <a.p.zijlstra@chello.nl>
      Link: http://lkml.kernel.org/r/1315837684-18733-1-git-send-email-sbohrer@rgmadvisors.comSigned-off-by: default avatarIngo Molnar <mingo@elte.hu>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      113f8b8f
    • David S. Miller's avatar
      sparc64: Force the execute bit in OpenFirmware's translation entries. · ca64baea
      David S. Miller authored
      In the OF 'translations' property, the template TTEs in the mappings
      never specify the executable bit.  This is the case even though some
      of these mappings are for OF's code segment.
      
      Therefore, we need to force the execute bit on in every mapping.
      
      This problem can only really trigger on Niagara/sun4v machines and the
      history behind this is a little complicated.
      
      Previous to sun4v, the sun4u TTE entries lacked a hardware execute
      permission bit.  So OF didn't have to ever worry about setting
      anything to handle executable pages.  Any valid TTE loaded into the
      I-TLB would be respected by the chip.
      
      But sun4v Niagara chips have a real hardware enforced executable bit
      in their TTEs.  So it has to be set or else the I-TLB throws an
      instruction access exception with type code 6 (protection violation).
      
      We've been extremely fortunate to not get bitten by this in the past.
      
      The best I can tell is that the OF's mappings for it's executable code
      were mapped using permanent locked mappings on sun4v in the past.
      Therefore, the fact that we didn't have the exec bit set in the OF
      translations we would use did not matter in practice.
      
      Thanks to Greg Onufer for helping me track this down.
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      ca64baea
  2. 03 Oct, 2011 31 commits