1. 07 Oct, 2012 8 commits
    • John Stultz's avatar
      ntp: Fix leap-second hrtimer livelock · 6a29b109
      John Stultz authored
      This is a backport of 6b43ae8a
      
      This should have been backported when it was commited, but I
      mistook the problem as requiring the ntp_lock changes
      that landed in 3.4 in order for it to occur.
      
      Unfortunately the same issue can happen (with only one cpu)
      as follows:
      do_adjtimex()
       write_seqlock_irq(&xtime_lock);
        process_adjtimex_modes()
         process_adj_status()
          ntp_start_leap_timer()
           hrtimer_start()
            hrtimer_reprogram()
             tick_program_event()
              clockevents_program_event()
               ktime_get()
                seq = req_seqbegin(xtime_lock); [DEADLOCK]
      
      This deadlock will no always occur, as it requires the
      leap_timer to force a hrtimer_reprogram which only happens
      if its set and there's no sooner timer to expire.
      
      NOTE: This patch, being faithful to the original commit,
      introduces a bug (we don't update wall_to_monotonic),
      which will be resovled by backporting a following fix.
      
      Original commit message below:
      
      Since commit 7dffa3c6 the ntp
      subsystem has used an hrtimer for triggering the leapsecond
      adjustment. However, this can cause a potential livelock.
      
      Thomas diagnosed this as the following pattern:
      CPU 0                                                    CPU 1
      do_adjtimex()
        spin_lock_irq(&ntp_lock);
          process_adjtimex_modes();				 timer_interrupt()
            process_adj_status();                                do_timer()
              ntp_start_leap_timer();                             write_lock(&xtime_lock);
                hrtimer_start();                                  update_wall_time();
                   hrtimer_reprogram();                            ntp_tick_length()
                     tick_program_event()                            spin_lock(&ntp_lock);
                       clockevents_program_event()
      		   ktime_get()
                           seq = req_seqbegin(xtime_lock);
      
      This patch tries to avoid the problem by reverting back to not using
      an hrtimer to inject leapseconds, and instead we handle the leapsecond
      processing in the second_overflow() function.
      
      The downside to this change is that on systems that support highres
      timers, the leap second processing will occur on a HZ tick boundary,
      (ie: ~1-10ms, depending on HZ)  after the leap second instead of
      possibly sooner (~34us in my tests w/ x86_64 lapic).
      
      This patch applies on top of tip/timers/core.
      
      CC: Sasha Levin <levinsasha928@gmail.com>
      CC: Thomas Gleixner <tglx@linutronix.de>
      Reported-by: default avatarSasha Levin <levinsasha928@gmail.com>
      Diagnoised-by: default avatarThomas Gleixner <tglx@linutronix.de>
      Tested-by: default avatarSasha Levin <levinsasha928@gmail.com>
      Cc: Prarit Bhargava <prarit@redhat.com>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Linux Kernel <linux-kernel@vger.kernel.org>
      Signed-off-by: default avatarJohn Stultz <john.stultz@linaro.org>
      Signed-off-by: default avatarWilly Tarreau <w@1wt.eu>
      6a29b109
    • Hugh Dickins's avatar
      futex: Fix uninterruptible loop due to gate_area · a5bd5781
      Hugh Dickins authored
      commit e6780f72 upstream.
      
      It was found (by Sasha) that if you use a futex located in the gate
      area we get stuck in an uninterruptible infinite loop, much like the
      ZERO_PAGE issue.
      
      While looking at this problem, PeterZ realized you'll get into similar
      trouble when hitting any install_special_pages() mapping.  And are there
      still drivers setting up their own special mmaps without page->mapping,
      and without special VM or pte flags to make get_user_pages fail?
      
      In most cases, if page->mapping is NULL, we do not need to retry at all:
      Linus points out that even /proc/sys/vm/drop_caches poses no problem,
      because it ends up using remove_mapping(), which takes care not to
      interfere when the page reference count is raised.
      
      But there is still one case which does need a retry: if memory pressure
      called shmem_writepage in between get_user_pages_fast dropping page
      table lock and our acquiring page lock, then the page gets switched from
      filecache to swapcache (and ->mapping set to NULL) whatever the refcount.
      Fault it back in to get the page->mapping needed for key->shared.inode.
      Reported-by: default avatarSasha Levin <levinsasha928@gmail.com>
      Signed-off-by: default avatarHugh Dickins <hughd@google.com>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      [PG: 2.6.34 variable is page, not page_head, since it doesn't have a5b338f2]
      Signed-off-by: default avatarPaul Gortmaker <paul.gortmaker@windriver.com>
      Signed-off-by: default avatarWilly Tarreau <w@1wt.eu>
      a5bd5781
    • Philipp Hahn's avatar
      fix pgd_lock deadlock · f4bced84
      Philipp Hahn authored
      commit a79e53d8 upstream.
      
      On Wednesday 16 February 2011 15:49:47 Andrea Arcangeli wrote:
      > Subject: fix pgd_lock deadlock
      >
      > From: Andrea Arcangeli <aarcange@redhat.com>
      >
      > It's forbidden to take the page_table_lock with the irq disabled or if
      > there's contention the IPIs (for tlb flushes) sent with the page_table_lock
      > held will never run leading to a deadlock.
      >
      > Apparently nobody takes the pgd_lock from irq so the _irqsave can be
      > removed.
      >
      > Signed-off-by: Andrea Arcangeli <aarcange@redhat.com>
      
      This patch (original commit Id for 2.6.38 a79e53d8)
      needs to be back-ported to 2.6.32.x as well.
      I observed a dead-lock problem when running a PAE enabled Debian 2.6.32.46+
      kernel with 6 VCPUs as a KVM on (2.6.32, 3.2, 3.3) kernel, which showed the
      following behaviour:
      
      1 VCPU is stuck in
        pgd_alloc() =E2=86=92 pgd_prepopulate_pmb() =E2=86=92... =E2=86=92  flush_tlb_others_ipi()
      while (!cpumask_empty(to_cpumask(f->flush_cpumask)))
          cpu_relax();
      (gdb) print f->flush_cpumask
      $5 = {1}
      
      while all other VCPUs are stuck in
        pgd_alloc() =E2=86=92 spin_lock_irqsave(pgd_lock)
      
      I tracked it down to the commit
       2.6.39-rc1: 4981d01e
       2.6.32.34: ba456fd7
       x86: Flush TLB if PGD entry is changed in i386 PAE mode
      which when reverted made the bug disappear.
      
      Comparing 3.2 to 2.6.32.34 showed that the 'pgd-deadlock'-patch went into
      2.6.38, that is before the 'PAE correctness'-patch, so the problem was
      probably never observed in the main development branch.
      But for 2.6.32 the 'pgd-deadlock' patch is still missing, so the 'PAE
      corretness'-patch made the problem worse with 2.6.32.
      
      The Patch was also back-ported to the OpenSUSE Kernel
      <http://kernel.opensuse.org/cgit/kernel-source/commit/?id=ac27c01aa880c65d17043ab87249c613ac4c3635>,
      Since the patch didn't apply cleanly on the current Debian kernel, I had to
      backport it for us and Debian. The patch is also available from our (German)
      Bugzilla <https://forge.univention.org/bugzilla/show_bug.cgi?id=26661> or
      from the Debian BTS at <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=669335>.
      
      I have no easy test case, but running multiple parallel builds inside the VM
      normally triggers the bug within seconds to minutes. With the patch applied
      the VM survived a night building packages without any problem.
      Signed-off-by: default avatarPhilipp Hahn <hahn@univention.de>
      
      Sincerely
      Philipp
      -
      Philipp Hahn           Open Source Software Engineer      hahn@univention.de
      Univention GmbH        be open.                       fon: +49 421 22 232- 0
      Mary-Somerville-Str.1  D-28359 Bremen                 fax: +49 421 22 232-99
                                                         http://www.univention.de/
      
      It's forbidden to take the page_table_lock with the irq disabled
      or if there's contention the IPIs (for tlb flushes) sent with
      the page_table_lock held will never run leading to a deadlock.
      
      Nobody takes the pgd_lock from irq context so the _irqsave can be
      removed.
      Signed-off-by: default avatarAndrea Arcangeli <aarcange@redhat.com>
      Acked-by: default avatarRik van Riel <riel@redhat.com>
      Tested-by: default avatarKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: <stable@kernel.org>
      LKML-Reference: <201102162345.p1GNjMjm021738@imap1.linux-foundation.org>
      Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
      Git-commit: a79e53d8Signed-off-by: default avatarWilly Tarreau <w@1wt.eu>
      f4bced84
    • Eric Sandeen's avatar
      jbd2: clear BH_Delay & BH_Unwritten in journal_unmap_buffer · 7cfe055f
      Eric Sandeen authored
      commit 15291164 upstream.
      
      journal_unmap_buffer()'s zap_buffer: code clears a lot of buffer head
      state ala discard_buffer(), but does not touch _Delay or _Unwritten as
      discard_buffer() does.
      
      This can be problematic in some areas of the ext4 code which assume
      that if they have found a buffer marked unwritten or delay, then it's
      a live one.  Perhaps those spots should check whether it is mapped
      as well, but if jbd2 is going to tear down a buffer, let's really
      tear it down completely.
      
      Without this I get some fsx failures on sub-page-block filesystems
      up until v3.2, at which point 4e96b2db
      and 189e868f make the failures go
      away, because buried within that large change is some more flag
      clearing.  I still think it's worth doing in jbd2, since
      ->invalidatepage leads here directly, and it's the right place
      to clear away these flags.
      Signed-off-by: default avatarEric Sandeen <sandeen@redhat.com>
      Signed-off-by: default avatar"Theodore Ts'o" <tytso@mit.edu>
      Cc: stable@vger.kernel.org
      
      BugLink: http://bugs.launchpad.net/bugs/929781
      CVE-2011-4086
      Signed-off-by: default avatarStefan Bader <stefan.bader@canonical.com>
      Signed-off-by: default avatarWilly Tarreau <w@1wt.eu>
      7cfe055f
    • Bing Zhao's avatar
      Bluetooth: btusb: fix bInterval for high/super speed isochronous endpoints · b87881d8
      Bing Zhao authored
      commit fa0fb93f upstream
      
      For high-speed/super-speed isochronous endpoints, the bInterval
      value is used as exponent, 2^(bInterval-1). Luckily we have
      usb_fill_int_urb() function that handles it correctly. So we just
      call this function to fill in the RX URB.
      
      Cc: Marcel Holtmann <marcel@holtmann.org>
      Signed-off-by: default avatarBing Zhao <bzhao@marvell.com>
      Acked-by: default avatarMarcel Holtmann <marcel@holtmann.org>
      Signed-off-by: default avatarGustavo F. Padovan <padovan@profusion.mobi>
      Signed-off-by: default avatarWilly Tarreau <w@1wt.eu>
      b87881d8
    • Benjamin Herrenschmidt's avatar
      powerpc/pmac: Fix SMP kernels on pre-core99 UP machines · bff4680d
      Benjamin Herrenschmidt authored
      commit 78c5c68a upstream.
      
      The code for "powersurge" SMP would kick in and cause a crash
      at boot due to the lack of a NULL test.
      
      Adam Conrad reports that the 3.2 kernel, with CONFIG_SMP=y, will not
      boot on an OldWorld G3; we're unconditionally writing to psurge_start,
      but this is only set on powersurge machines.
      Signed-off-by: default avatarBenjamin Herrenschmidt <benh@kernel.crashing.org>
      Signed-off-by: default avatarJeremy Kerr <jeremy.kerr@canonical.com>
      Reported-by: default avatarAdam Conrad <adconrad@ubuntu.com>
      Tested-by: default avatarAdam Conrad <adconrad@ubuntu.com>
      Signed-off-by: default avatarWilly Tarreau <w@1wt.eu>
      bff4680d
    • David Miller's avatar
      Fix sparc build with newer tools. · 99612d20
      David Miller authored
      commit e0adb990 upstream.
      
      Newer version of binutils are more strict about specifying the
      correct options to enable certain classes of instructions.
      
      The sparc32 build is done for v7 in order to support sun4c systems
      which lack hardware integer multiply and divide instructions.
      
      So we have to pass -Av8 when building the assembler routines that
      use these instructions and get patched into the kernel when we find
      out that we have a v8 capable cpu.
      Reported-by: default avatarPaul Gortmaker <paul.gortmaker@windriver.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      Signed-off-by: default avatarWilly Tarreau <w@1wt.eu>
      99612d20
    • Sony Chacko's avatar
      netxen: support for GbE port settings · ef1ff0d0
      Sony Chacko authored
      commit bfd823bd upstream.
      
      o Enable setting speed and auto negotiation parameters for GbE ports.
      o Hardware do not support half duplex setting currently.
      
      David Miller:
      	Amit please update your patch to silently reject link setting
      	attempts that are unsupported by the device.
      
      [jn: backported for 2.6.32.y by Ana Guerrero]
      Signed-off-by: default avatarSony Chacko <sony.chacko@qlogic.com>
      Signed-off-by: default avatarAmit Kumar Salecha <amit.salecha@qlogic.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      Tested-by: Ana Guerrero <ana@debian.org> # HP NC375i
      Signed-off-by: default avatarJonathan Nieder <jrnieder@gmail.com>
      Signed-off-by: default avatarWilly Tarreau <w@1wt.eu>
      Acked-by: default avatarSony Chacko <sony.chacko@qlogic.com>
      Signed-off-by: default avatarWilly Tarreau <w@1wt.eu>
      ef1ff0d0
  2. 17 Mar, 2012 13 commits
  3. 04 Mar, 2012 19 commits