1. 05 Jul, 2010 33 commits
    • Christian Lamparter's avatar
      ar9170usb: add a couple more USB IDs · 5dbabb41
      Christian Lamparter authored
      commit 94d0bbe8 upstream.
      
      This patch adds the following 5 entries to the usbid device table:
      
       * Netgear WNA1000
       * Proxim ORiNOCO Dual Band 802.11n USB Adapter
       * 3Com Dual Band 802.11n USB Adapter
       * H3C Dual Band 802.11n USB Adapter
       * WNC Generic 11n USB dongle
      Signed-off-by: default avatarChristian Lamparter <chunkeey@googlemail.com>
      Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      5dbabb41
    • Cory Maccarrone's avatar
      HID: Add the GYR4101US USB ID to hid-gyration · 10b59786
      Cory Maccarrone authored
      commit c2fd1a4e upstream.
      
      This change adds in the USB product ID for the Gyration
      GYR4101US USB media center remote control.  This remote
      is similar enough to the other two devices that this driver
      can be used without any other changes to get full support
      for the remote.
      Signed-off-by: default avatarCory Maccarrone <darkstar6262@gmail.com>
      Signed-off-by: default avatarJiri Kosina <jkosina@suse.cz>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      10b59786
    • Kamal Mostafa's avatar
      ACPI: video: fix acpi_backlight=video · 5cb55ffd
      Kamal Mostafa authored
      commit eeb4bcb4 upstream.
      
      Make "acpi_backlight=video" param enable ACPI_VIDEO_BACKLIGHT_FORCE_VIDEO
      as intended, instead of incorrectly enabling video output switching.
      
      BugLink: http://bugs.launchpad.net/bugs/573120Signed-off-by: default avatarKamal Mostafa <kamal@canonical.com>
      Acked-by: default avatarZhang Rui <rui.zhang@intel.com>
      Cc: Bjorn Helgaas <bjorn.helgaas@hp.com>
      Cc: Jiri Kosina <jkosina@suse.cz>
      Acked-by: default avatarThomas Renninger <trenn@suse.de>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLen Brown <len.brown@intel.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      5cb55ffd
    • Daniel T Chen's avatar
      ALSA: hda: Use LPIB for a Shuttle device · c661a17e
      Daniel T Chen authored
      commit 61bb42c3 upstream.
      
      BugLink: https://launchpad.net/bugs/551949
      
      Symptom: On the reporter's Shuttle device, using PulseAudio in Ubuntu
      10.04 LTS results in "popping clicking" audio with the PA crashing
      shortly thereafter.
      
      Test case: Using Ubuntu 10.04 LTS (Linux 2.6.32.12), Linux 2.6.33, or
      Linux 2.6.34, adjust the HDA device's volume with PulseAudio.
      
      Resolution: add SSID for this machine to the position_fix quirk table,
      explicitly specifying the LPIB method.
      Reported-and-Tested-By: default avatarChristian Mehlis <mehlis@inf.fu-berlin.de>
      Signed-off-by: default avatarDaniel T Chen <crimsun@ubuntu.com>
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      c661a17e
    • Daniel T Chen's avatar
      ALSA: hda: Use LPIB for Sony VPCS11V9E · e90c613e
      Daniel T Chen authored
      commit e96d3127 upstream.
      
      BugLink: https://launchpad.net/bugs/586347
      
      Symptom: On the Sony VPCS11V9E, using GStreamer-based applications with
      PulseAudio in Ubuntu 10.04 LTS results in stuttering audio. It appears
      to worsen with increased I/O.
      
      Test case: use Rhythmbox under increased I/O pressure. This symptom is
      reproducible in the current daily stable alsa-driver snapshots (at least
      up until 21 May 2010; later snapshots fail to build from source due to
      missing preprocessor directives when compiled against 2.6.32).
      
      Resolution: add SSID for this machine to the position_fix quirk table,
      explicitly specifying the LPIB method.
      Reported-and-Tested-By: default avatarLauri Kainulainen <lauri@sokkelo.net>
      Signed-off-by: default avatarDaniel T Chen <crimsun@ubuntu.com>
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      e90c613e
    • Daniel T Chen's avatar
      ALSA: hda: Use LPIB for Acer Aspire 5110 · 9d1312a1
      Daniel T Chen authored
      commit 7a68be94 upstream.
      
      BugLink: https://launchpad.net/bugs/583983
      
      Symptom: on a significant number of hardware, booting from a live cd
      results in capture working correctly, but once the distribution is
      installed, booting from the install results in capture not working.
      
      Test case: boot from Ubuntu 10.04 LTS live cd; capture works correctly.
      Install to HD and reboot; capture does not work. Reproduced with 2.6.32
      mainline build (vanilla kernel.org compile).
      
      Resolution: add SSID for Acer Aspire 5110 to the position_fix quirk
      table, explicitly specifying the LPIB method.
      
      I'll be sending additional patches for these SSIDs as bug reports are
      confirmed.
      
      Reported-and-Tested-By: Leo
      Signed-off-by: default avatarDaniel T Chen <crimsun@ubuntu.com>
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      9d1312a1
    • Daniel T Chen's avatar
      ALSA: hda: Use LPIB for Toshiba A100-259 · 0596f630
      Daniel T Chen authored
      commit 4e0938db upstream.
      
      BugLink: https://launchpad.net/bugs/549560
      
      Symptom: on a significant number of hardware, booting from a live cd
      results in capture working correctly, but once the distribution is
      installed, booting from the install results in capture not working.
      
      Test case: boot from Ubuntu 10.04 LTS live cd; capture works correctly.
      Install to HD and reboot; capture does not work. Reproduced with 2.6.32
      mainline build (vanilla kernel.org compile)
      
      Resolution: add SSID for Toshiba A100-259 to the position_fix quirk
      table, explicitly specifying the LPIB method.
      
      I'll be sending additional patches for these SSIDs as bug reports are
      confirmed.
      
      This patch also trivially sorts the quirk table in ascending order by
      subsystem vendor.
      
      Reported-and-Tested-by: <davide.molteni@gmail.com>
      Signed-off-by: default avatarDaniel T Chen <crimsun@ubuntu.com>
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      0596f630
    • Daniel T Chen's avatar
      ALSA: hda: Fix model quirk for Dell M1730 · f1d46e6a
      Daniel T Chen authored
      commit 66668b6f upstream.
      
      BugLink: https://launchpad.net/bugs/576160
      
      Symptom: Currently (2.6.32.12) the Dell M1730 uses the 3stack model
      quirk. Unfortunately this means that capture is not functional out-
      of-the-box despite ensuring that capture settings are unmuted and
      raised fully.
      
      Test case: boot from Ubuntu 10.04 LTS live cd; capture does not
      work.
      
      Resolution: Correct the model quirk for Dell M1730 to rely on the
      BIOS configuration.
      
      This patch also trivially sorts the quirk into the correct section
      based on the comments.
      
      Reported-and-Tested-By: <picdragon99@msn.com>
      Tested-By: Daren Hayward
      Tested-By: Tobias Krais
      Signed-off-by: default avatarDaniel T Chen <crimsun@ubuntu.com>
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      f1d46e6a
    • Clemens Ladisch's avatar
      ALSA: pcm: fix the fix of the runtime->boundary calculation · 8882ac1b
      Clemens Ladisch authored
      commit ead4046b upstream.
      
      Commit 7910b4a1 in 2.6.34 changed the
      runtime->boundary calculation to make this value a multiple of both the
      buffer_size and the period_size, because the latter is assumed by the
      runtime->hw_ptr_interrupt calculation.
      
      However, due to the lack of a ioctl that could read the software
      parameters before they are set, the kernel requires that alsa-lib
      calculates the boundary value, too.  The changed algorithm leads to
      a different boundary value used by alsa-lib, which makes, e.g., mplayer
      fail to play a 44.1 kHz file because the silence_size parameter is now
      invalid; bug report:
      <https://bugtrack.alsa-project.org/alsa-bug/view.php?id=5015>.
      
      This patch reverts the change to the boundary calculation, and instead
      fixes the hw_ptr_interrupt calculation to be period-aligned regardless
      of the boundary value.
      Signed-off-by: default avatarClemens Ladisch <clemens@ladisch.de>
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      8882ac1b
    • Clemens Ladisch's avatar
      ALSA: pcm: fix delta calculation at boundary wraparound · 945fb1b1
      Clemens Ladisch authored
      commit b406e610 upstream.
      
      In the cleanup of the hw_ptr update functions in 2.6.33, the calculation
      of the delta value was changed to use the modulo operator to protect
      against a negative difference due to the pointer wrapping around at the
      boundary.
      
      However, the ptr variables are unsigned, so a negative difference would
      result in the two complement's value which has no relation to the actual
      difference relative to the boundary; the result is typically some value
      near LONG_MAX-boundary.  Furthermore, even if the modulo operation would
      be done with signed types, the result of a negative dividend could be
      negative.
      
      The invalid delta value is then caught by the following checks, but this
      means that the pointer update is ignored.
      
      To fix this, use a range check as in the other pointer calculations.
      Signed-off-by: default avatarClemens Ladisch <clemens@ladisch.de>
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      945fb1b1
    • Tony Breeds's avatar
      mutex: Fix optimistic spinning vs. BKL · f3b041d6
      Tony Breeds authored
      commit fd6be105 upstream.
      
      Currently, we can hit a nasty case with optimistic
      spinning on mutexes:
      
          CPU A tries to take a mutex, while holding the BKL
      
          CPU B tried to take the BLK while holding the mutex
      
      This looks like a AB-BA scenario but in practice, is
      allowed and happens due to the auto-release on
      schedule() nature of the BKL.
      
      In that case, the optimistic spinning code can get us
      into a situation where instead of going to sleep, A
      will spin waiting for B who is spinning waiting for
      A, and the only way out of that loop is the
      need_resched() test in mutex_spin_on_owner().
      
      This patch fixes it by completely disabling spinning
      if we own the BKL. This adds one more detail to the
      extensive list of reasons why it's a bad idea for
      kernel code to be holding the BKL.
      Signed-off-by: default avatarTony Breeds <tony@bakeyournoodle.com>
      Acked-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      Acked-by: default avatarPeter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      LKML-Reference: <20100519054636.GC12389@ozlabs.org>
      [ added an unlikely() attribute to the branch ]
      Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      f3b041d6
    • Linus Lüssing's avatar
      Staging: batman-adv: Fixing wrap-around bug in vis · 79ea60d7
      Linus Lüssing authored
      commit ea4ceb18 upstream.
      
      When the seqno for a vis packet had a wrap around from i.e. 255 to 0,
      add_packet() would falsely claim the older packet with the seqno 255 as
      newer as the one with the seqno of 0 and would therefore ignore the new
      packet. This happens with all following vis packets until the old vis
      packet expires after 180 seconds timeout. This patch fixes this issue
      and gets rid of these highly undesired 3min. breaks for the vis-server.
      Signed-off-by: default avatarLinus Lüssing <linus.luessing@web.de>
      Signed-off-by: default avatarSven Eckelmann <sven.eckelmann@gmx.de>
      Signed-off-by: default avatarAndrew Lunn <andrew@lunn.ch>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      79ea60d7
    • Linus Lüssing's avatar
      Staging: batman-adv: Fix VIS output bug for secondary interfaces · 5405f5ae
      Linus Lüssing authored
      commit f6497e38 upstream.
      
      TQ and HNA records for originators on secondary interfaces were
      wrongly being included on the primary interface. Ensure we output a
      line for each source interface on every node, so we correctly separate
      primary and secondary interface records.
      Signed-off-by: default avatarLinus Lüssing <linus.luessing@web.de>
      Signed-off-by: default avatarAndrew Lunn <andrew@lunn.ch>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      5405f5ae
    • Andrew Lunn's avatar
      Staging: batman-adv: don't have interrupts disabled while sending. · 5b159919
      Andrew Lunn authored
      commit 107c32fe upstream.
      
      send_vis_packets() would disable interrupts before calling
      dev_queue_xmit() which resulting in a backtrace in local_bh_enable().
      Fix this by using kref on the vis_info object so that we can call
      send_vis_packets() without holding vis_hash_lock. vis_hash_lock also
      used to protect recv_list, so we now need a new lock to protect that
      instead of vis_hash_lock.
      
      Also a few checkpatch cleanups.
      Reported-by: default avatarLinus Lüssing <linus.luessing@web.de>
      Signed-off-by: default avatarAndrew Lunn <andrew@lunn.ch>
      Signed-off-by: default avatarMarek Lindner <lindner_marek@yahoo.de>
      Signed-off-by: default avatarSimon Wunderlich <siwu@hrz.tu-chemnitz.de>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      5b159919
    • Nobuhiro KUSUNO's avatar
      Staging: rt2870: add device ID of MelCo.,Inc. WLI-UC-G301N · 100cd680
      Nobuhiro KUSUNO authored
      commit de37cd49 upstream.
      
      My wireless LAN module 'MelCo.,Inc. WLI-UC-G301N' works fine,
      if the following line is added into 2870_main_dev.c.
      Signed-off-by: default avatarNobhiro KUSUNO <n-kusuno@fc4.so-net.ne.jp>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      100cd680
    • Larry Finger's avatar
      staging: vt6655: Fix kernel BUG on driver wpa initialization · 04e3c609
      Larry Finger authored
      commit f6551527 upstream.
      
      In http://bugzilla.novell.com/show_bug.cgi?id=597299, the vt6655 driver
      generates a kernel BUG on a NULL pointer dereference at NULL. This problem
      has been traced to a failure in the wpa_set_wpadev() routine. As the vt6656
      driver does not call this routine, the vt6655 code is similarly set to skip
      the call.
      Signed-off-by: default avatarLarry Finger <Larry.Finger@lwfinger.net>
      Tested-by: default avatarRichard Meek <osl2008@googlemail.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      04e3c609
    • John W. Linville's avatar
      rtl8180: fix tx status reporting · 48da1f94
      John W. Linville authored
      commit d989ff7c upstream.
      
      When reporting Tx status, indicate that only one rate was used.
      Otherwise, the rate is frozen at rate index 0 (i.e. 1Mb/s).
      Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      48da1f94
    • Andreas Bombe's avatar
      ARCNET: Limit com20020 PCI ID matches for SOHARD cards · 5f375318
      Andreas Bombe authored
      commit e7971c80 upstream.
      
      The SH SOHARD ARCNET cards are implemented using generic PLX Technology
      PCI<->IOBus bridges. Subvendor and subdevice IDs were not specified,
      causing the driver to attach to any such bridge and likely crash the
      system by attempting to initialize an unrelated device.
      
      Fix by specifying subvendor and subdevice according to the values found
      in the PCI-ID Repository at http://pci-ids.ucw.cz/ .
      Signed-off-by: default avatarAndreas Bombe <aeb@debian.org>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      5f375318
    • Tejun Heo's avatar
      sata_nv: use ata_pci_sff_activate_host() instead of ata_host_activate() · 4b227bf5
      Tejun Heo authored
      commit 95cc2c70 upstream.
      
      sata_nv was incorrectly using ata_host_activate() instead of
      ata_pci_sff_activate_host() leading to IRQ assignment failure in
      legacy mode.  Fix it.
      Signed-off-by: default avatarTejun Heo <tj@kernel.org>
      Cc: Robert Hancock <hancockr@shaw.ca>
      Signed-off-by: default avatarJeff Garzik <jgarzik@redhat.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      4b227bf5
    • Jeff Layton's avatar
      nfsd: don't break lease while servicing a COMMIT · 70e3072d
      Jeff Layton authored
      commit 91885258 upstream.
      
      This is the second attempt to fix the problem whereby a COMMIT call
      causes a lease break and triggers a possible deadlock.
      
      The problem is that nfsd attempts to break a lease on a COMMIT call.
      This triggers a delegation recall if the lease is held for a delegation.
      If the client is the one holding the delegation and it's the same one on
      which it's issuing the COMMIT, then it can't return that delegation
      until the COMMIT is complete. But, nfsd won't complete the COMMIT until
      the delegation is returned. The client and server are essentially
      deadlocked until the state is marked bad (due to the client not
      responding on the callback channel).
      
      The first patch attempted to deal with this by eliminating the open of
      the file altogether and simply had nfsd_commit pass a NULL file pointer
      to the vfs_fsync_range. That would conflict with some work in progress
      by Christoph Hellwig to clean up the fsync interface, so this patch
      takes a different approach.
      
      This declares a new NFSD_MAY_NOT_BREAK_LEASE access flag that indicates
      to nfsd_open that it should not break any leases when opening the file,
      and has nfsd_commit set that flag on the nfsd_open call.
      
      For now, this patch leaves nfsd_commit opening the file with write
      access since I'm not clear on what sort of access would be more
      appropriate.
      Signed-off-by: default avatarJeff Layton <jlayton@redhat.com>
      Signed-off-by: default avatarJ. Bruce Fields <bfields@citi.umich.edu>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      70e3072d
    • Pavel Emelyanov's avatar
      NFSD: don't report compiled-out versions as present · f003956d
      Pavel Emelyanov authored
      commit 15ddb4ae upstream.
      
      The /proc/fs/nfsd/versions file calls nfsd_vers() to check whether
      the particular nfsd version is present/available. The problem is
      that once I turn off e.g. NFSD-V4 this call returns -1 which is
      true from the callers POV which is wrong.
      
      The proposal is to report false in that case.
      
      The bug has existed since 6658d3a7 "[PATCH] knfsd: remove
      nfsd_versbits as intermediate storage for desired versions".
      Signed-off-by: default avatarPavel Emelyanov <xemul@openvz.org>
      Acked-by: default avatarNeilBrown <neilb@suse.de>
      Signed-off-by: default avatarJ. Bruce Fields <bfields@citi.umich.edu>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      f003956d
    • KOSAKI Motohiro's avatar
      cpumask: fix compat getaffinity · 9cd8e627
      KOSAKI Motohiro authored
      commit fa9dc265 upstream.
      
      Commit a45185d2 "cpumask: convert kernel/compat.c" broke libnuma, which
      abuses sched_getaffinity to find out NR_CPUS in order to parse
      /sys/devices/system/node/node*/cpumap.
      
      On NUMA systems with less than 32 possibly CPUs, the current
      compat_sys_sched_getaffinity now returns '4' instead of the actual
      NR_CPUS/8, which makes libnuma bail out when parsing the cpumap.
      
      The libnuma call sched_getaffinity(0, bitmap, 4096) at first.  It mean
      the libnuma expect the return value of sched_getaffinity() is either len
      argument or NR_CPUS.  But it doesn't expect to return nr_cpu_ids.
      
      Strictly speaking, userland requirement are
      
      1) Glibc assume the return value mean the lengh of initialized
         of mask argument. E.g. if sched_getaffinity(1024) return 128,
         glibc make zero fill rest 896 byte.
      2) Libnuma assume the return value can be used to guess NR_CPUS
         in kernel. It assume len-arg<NR_CPUS makes -EINVAL. But
         it try len=4096 at first and 4096 is always bigger than
         NR_CPUS. Then, if we remove strange min_length normalization,
         we never hit -EINVAL case.
      
      sched_getaffinity() already solved this issue.  This patch adapts
      compat_sys_sched_getaffinity() to match the non-compat case.
      Signed-off-by: default avatarKOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
      Acked-by: default avatarRusty Russell <rusty@rustcorp.com.au>
      Acked-by: default avatarArnd Bergmann <arnd@arndb.de>
      Reported-by: default avatarKen Werner <ken.werner@web.de>
      Cc: Andi Kleen <andi@firstfloor.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      9cd8e627
    • Sebastian Andrzej Siewior's avatar
      libata: don't flush dcache on slab pages · 968ada73
      Sebastian Andrzej Siewior authored
      commit 3842e835 upstream.
      
      page_mapping() check this via VM_BUG_ON(PageSlab(page)) so we bug here
      with the according debuging turned on.
      
      Future TODO: replace this with a flush_dcache_page_for_pio() API
      Signed-off-by: default avatarSebastian Andrzej Siewior <sebastian@breakpoint.cc>
      Signed-off-by: default avatarJeff Garzik <jgarzik@redhat.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      968ada73
    • Tejun Heo's avatar
      libata: disable ATAPI AN by default · f7039e09
      Tejun Heo authored
      commit e7ecd435 upstream.
      
      There are ATAPI devices which raise AN when hit by commands issued by
      open().  This leads to infinite loop of AN -> MEDIA_CHANGE uevent ->
      udev open() to check media -> AN.
      
      Both ACS and SerialATA standards don't define in which case ATAPI
      devices are supposed to raise or not raise AN.  They both list media
      insertion event as a possible use case for ATAPI ANs but there is no
      clear description of what constitutes such events.  As such, it seems
      a bit too naive to export ANs directly to userland as MEDIA_CHANGE
      events without further verification (which should behave similarly to
      windows as it apparently is the only thing that some hardware vendors
      are testing against).
      
      This patch adds libata.atapi_an module parameter and disables ATAPI AN
      by default for now.
      Signed-off-by: default avatarTejun Heo <tj@kernel.org>
      Cc: Kay Sievers <kay.sievers@vrfy.org>
      Cc: Nick Bowler <nbowler@elliptictech.com>
      Cc: David Zeuthen <david@fubar.dk>
      Signed-off-by: default avatarJeff Garzik <jgarzik@redhat.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      f7039e09
    • Andrey Vagin's avatar
      posix_timer: Fix error path in timer_create · 4562830d
      Andrey Vagin authored
      commit 45e0fffc upstream.
      
      Move CLOCK_DISPATCH(which_clock, timer_create, (new_timer)) after all
      posible EFAULT erros.
      
      *_timer_create may allocate/get resources.
      (for example posix_cpu_timer_create does get_task_struct)
      
      [ tglx: fold the remove crappy comment patch into this ]
      Signed-off-by: default avatarAndrey Vagin <avagin@openvz.org>
      Cc: Oleg Nesterov <oleg@tv-sign.ru>
      Cc: Pavel Emelyanov <xemul@openvz.org>
      Reviewed-by: default avatarStanislaw Gruszka <sgruszka@redhat.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      4562830d
    • Neil Brown's avatar
      VFS: fix recent breakage of FS_REVAL_DOT · b55e3457
      Neil Brown authored
      commit 176306f5 upstream.
      
      Commit 1f36f774 broke FS_REVAL_DOT semantics.
      
      In particular, before this patch, the command
         ls -l
      in an NFS mounted directory would always check if the directory on the server
      had changed and if so would flush and refill the pagecache for the dir.
      After this patch, the same "ls -l" will repeatedly return stale date until
      the cached attributes for the directory time out.
      
      The following patch fixes this by ensuring the d_revalidate is called by
      do_last when "." is being looked-up.
      link_path_walk has already called d_revalidate, but in that case LOOKUP_OPEN
      is not set so nfs_lookup_verify_inode chooses not to do any validation.
      
      The following patch restores the original behaviour.
      Signed-off-by: default avatarNeilBrown <neilb@suse.de>
      Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      b55e3457
    • Al Viro's avatar
      Fix racy use of anon_inode_getfd() in perf_event.c · 9521ba4a
      Al Viro authored
      commit ea635c64 upstream.
      
      once anon_inode_getfd() is called, you can't expect *anything* about
      struct file that descriptor points to - another thread might be doing
      whatever it likes with descriptor table at that point.
      Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      9521ba4a
    • Peter Zijlstra's avatar
      perf: Fix exit() vs event-groups · 81bec1f5
      Peter Zijlstra authored
      commit 96c21a46 upstream.
      
      Corey reported that the value scale times of group siblings are not
      updated when the monitored task dies.
      
      The problem appears to be that we only update the group leader's
      time values, fix it by updating the whole group.
      Reported-by: default avatarCorey Ashford <cjashfor@linux.vnet.ibm.com>
      Signed-off-by: default avatarPeter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      LKML-Reference: <1273588935.1810.6.camel@laptop>
      Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      81bec1f5
    • Arnaldo Carvalho de Melo's avatar
      perf top: Properly notify the user that vmlinux is missing · ecd8a95f
      Arnaldo Carvalho de Melo authored
      commit b0a9ab62 upstream.
      
      Before this patch this message would very briefly appear on the
      screen and then the screen would get updates only on the top,
      for number of interrupts received, etc, but no annotation would
      be performed:
      
       [root@doppio linux-2.6-tip]# perf top -s n_tty_write > /tmp/bla
       objdump: '[kernel.kallsyms]': No such file
      
      Now this is what the user gets:
      
       [root@doppio linux-2.6-tip]# perf top -s n_tty_write
       Can't annotate n_tty_write: No vmlinux file was found in the
       path: [0] vmlinux
       [1] /boot/vmlinux
       [2] /boot/vmlinux-2.6.33-rc5
       [3] /lib/modules/2.6.33-rc5/build/vmlinux
       [4] /usr/lib/debug/lib/modules/2.6.33-rc5/vmlinux
       [root@doppio linux-2.6-tip]#
      
      This bug was introduced when we added automatic search for
      vmlinux, before that time the user had to specify a vmlinux
      file.
      Reported-by: default avatarDavid S. Miller <davem@davemloft.net>
      Reported-by: default avatarIngo Molnar <mingo@elte.hu>
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      Cc: Frédéric Weisbecker <fweisbec@gmail.com>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Paul Mackerras <paulus@samba.org>
      LKML-Reference: <1268664418-28328-2-git-send-email-acme@infradead.org>
      Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      ecd8a95f
    • Peter Zijlstra's avatar
      perf: Fix exit() vs PERF_FORMAT_GROUP · 03d7c94a
      Peter Zijlstra authored
      commit 050735b0 upstream.
      
      Both Stephane and Corey reported that PERF_FORMAT_GROUP didn't
      work as expected if the task the counters were attached to quit
      before the read() call.
      
      The cause is that we unconditionally destroy the grouping when
      we remove counters from their context. Fix this by splitting off
      the group destroy from the list removal such that
      perf_event_remove_from_context() does not do this and change
      perf_event_release() to do so.
      Reported-by: default avatarCorey Ashford <cjashfor@linux.vnet.ibm.com>
      Reported-by: default avatarStephane Eranian <eranian@google.com>
      Signed-off-by: default avatarPeter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Paul Mackerras <paulus@samba.org>
      LKML-Reference: <1273571513.5605.3527.camel@twins>
      Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      03d7c94a
    • Ian Munsie's avatar
      perf: Fix endianness argument compatibility with OPT_BOOLEAN() and introduce OPT_INCR() · 08959bab
      Ian Munsie authored
      commit c0555642 upstream.
      
      Parsing an option from the command line with OPT_BOOLEAN on a
      bool data type would not work on a big-endian machine due to the
      manner in which the boolean was being cast into an int and
      incremented. For example, running 'perf probe --list' on a
      PowerPC machine would fail to properly set the list_events bool
      and would therefore print out the usage information and
      terminate.
      
      This patch makes OPT_BOOLEAN work as expected with a bool
      datatype. For cases where the original OPT_BOOLEAN was
      intentionally being used to increment an int each time it was
      passed in on the command line, this patch introduces OPT_INCR
      with the old behaviour of OPT_BOOLEAN (the verbose variable is
      currently the only such example of this).
      
      I have reviewed every use of OPT_BOOLEAN to verify that a true
      C99 bool was passed. Where integers were used, I verified that
      they were only being used for boolean logic and changed them to
      bools to ensure that they would not be mistakenly used as ints.
      The major exception was the verbose variable which now uses
      OPT_INCR instead of OPT_BOOLEAN.
      Signed-off-by: default avatarIan Munsie <imunsie@au.ibm.com>
      Acked-by: default avatarDavid S. Miller <davem@davemloft.net>
      Cc: <stable@kernel.org>
      Cc: Git development list <git@vger.kernel.org>
      Cc: Ian Munsie <imunsie@au1.ibm.com>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
      Cc: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
      Cc: Hitoshi Mitake <mitake@dcl.info.waseda.ac.jp>
      Cc: Rusty Russell <rusty@rustcorp.com.au>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Eric B Munson <ebmunson@us.ibm.com>
      Cc: Valdis.Kletnieks@vt.edu
      Cc: WANG Cong <amwang@redhat.com>
      Cc: Thiago Farina <tfransosi@gmail.com>
      Cc: Masami Hiramatsu <mhiramat@redhat.com>
      Cc: Xiao Guangrong <xiaoguangrong@cn.fujitsu.com>
      Cc: Jaswinder Singh Rajput <jaswinderrajput@gmail.com>
      Cc: Arjan van de Ven <arjan@linux.intel.com>
      Cc: OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Tom Zanussi <tzanussi@gmail.com>
      Cc: Anton Blanchard <anton@samba.org>
      Cc: John Kacur <jkacur@redhat.com>
      Cc: Li Zefan <lizf@cn.fujitsu.com>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      LKML-Reference: <1271147857-11604-1-git-send-email-imunsie@au.ibm.com>
      Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      08959bab
    • Andi Kleen's avatar
      oprofile: remove double ring buffering · a3f7f054
      Andi Kleen authored
      commit cb6e943c upstream.
      
      oprofile used a double buffer scheme for its cpu event buffer
      to avoid races on reading with the old locked ring buffer.
      
      But that is obsolete now with the new ring buffer, so simply
      use a single buffer. This greatly simplifies the code and avoids
      a lot of sample drops on large runs, especially with call graph.
      
      Based on suggestions from Steven Rostedt
      
      For stable kernels from v2.6.32, but not earlier.
      Signed-off-by: default avatarAndi Kleen <ak@linux.intel.com>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Signed-off-by: default avatarRobert Richter <robert.richter@amd.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      a3f7f054
    • Robert Richter's avatar
      oprofile/x86: fix uninitialized counter usage during cpu hotplug · ae39937e
      Robert Richter authored
      commit 2623a1d5 upstream.
      
      This fixes a NULL pointer dereference that is triggered when taking a
      cpu offline after oprofile was initialized, e.g.:
      
       $ opcontrol --init
       $ opcontrol --start-daemon
       $ opcontrol --shutdown
       $ opcontrol --deinit
       $ echo 0 > /sys/devices/system/cpu/cpu1/online
      
      See the crash dump below. Though the counter has been disabled the cpu
      notifier is still active and trying to use already freed counter data.
      
      This fix is for linux-stable. To proper fix this, the hotplug code
      must be rewritten. Thus I will leave a WARN_ON_ONCE() message with
      this patch.
      
      BUG: unable to handle kernel NULL pointer dereference at (null)
      IP: [<ffffffff8132ad57>] op_amd_stop+0x2d/0x8e
      PGD 0
      Oops: 0000 [#1] SMP
      last sysfs file: /sys/devices/system/cpu/cpu1/online
      CPU 1
      Modules linked in:
      
      Pid: 0, comm: swapper Not tainted 2.6.34-rc5-oprofile-x86_64-standard-00210-g8c00f06 #16 Anaheim/Anaheim
      RIP: 0010:[<ffffffff8132ad57>]  [<ffffffff8132ad57>] op_amd_stop+0x2d/0x8e
      RSP: 0018:ffff880001843f28  EFLAGS: 00010006
      RAX: 0000000000000000 RBX: 0000000000000000 RCX: dead000000200200
      RDX: ffff880001843f68 RSI: dead000000100100 RDI: 0000000000000000
      RBP: ffff880001843f48 R08: 0000000000000000 R09: ffff880001843f08
      R10: ffffffff8102c9a5 R11: ffff88000184ea80 R12: 0000000000000000
      R13: ffff88000184f6c0 R14: 0000000000000000 R15: 0000000000000000
      FS:  00007fec6a92e6f0(0000) GS:ffff880001840000(0000) knlGS:0000000000000000
      CS:  0010 DS: 0000 ES: 0000 CR0: 000000008005003b
      CR2: 0000000000000000 CR3: 000000000163b000 CR4: 00000000000006e0
      DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
      DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400
      Process swapper (pid: 0, threadinfo ffff88042fcd8000, task ffff88042fcd51d0)
      Stack:
       ffff880001843f48 0000000000000001 ffff88042e9f7d38 ffff880001843f68
      <0> ffff880001843f58 ffffffff8132a602 ffff880001843f98 ffffffff810521b3
      <0> ffff880001843f68 ffff880001843f68 ffff880001843f88 ffff88042fcd9fd8
      Call Trace:
       <IRQ>
       [<ffffffff8132a602>] nmi_cpu_stop+0x21/0x23
       [<ffffffff810521b3>] generic_smp_call_function_single_interrupt+0xdf/0x11b
       [<ffffffff8101804f>] smp_call_function_single_interrupt+0x22/0x31
       [<ffffffff810029f3>] call_function_single_interrupt+0x13/0x20
       <EOI>
       [<ffffffff8102c9a5>] ? wake_up_process+0x10/0x12
       [<ffffffff81008701>] ? default_idle+0x22/0x37
       [<ffffffff8100896d>] c1e_idle+0xdf/0xe6
       [<ffffffff813f1170>] ? atomic_notifier_call_chain+0x13/0x15
       [<ffffffff810012fb>] cpu_idle+0x4b/0x7e
       [<ffffffff813e8a4e>] start_secondary+0x1ae/0x1b2
      Code: 89 e5 41 55 49 89 fd 41 54 45 31 e4 53 31 db 48 83 ec 08 89 df e8 be f8 ff ff 48 98 48 83 3c c5 10 67 7a 81 00 74 1f 49 8b 45 08 <42> 8b 0c 20 0f 32 48 c1 e2 20 25 ff ff bf ff 48 09 d0 48 89 c2
      RIP  [<ffffffff8132ad57>] op_amd_stop+0x2d/0x8e
       RSP <ffff880001843f28>
      CR2: 0000000000000000
      ---[ end trace 679ac372d674b757 ]---
      Kernel panic - not syncing: Fatal exception in interrupt
      Pid: 0, comm: swapper Tainted: G      D    2.6.34-rc5-oprofile-x86_64-standard-00210-g8c00f06 #16
      Call Trace:
       <IRQ>  [<ffffffff813ebd6a>] panic+0x9e/0x10c
       [<ffffffff810474b0>] ? up+0x34/0x39
       [<ffffffff81031ccc>] ? kmsg_dump+0x112/0x12c
       [<ffffffff813eeff1>] oops_end+0x81/0x8e
       [<ffffffff8101efee>] no_context+0x1f3/0x202
       [<ffffffff8101f1b7>] __bad_area_nosemaphore+0x1ba/0x1e0
       [<ffffffff81028d24>] ? enqueue_task_fair+0x16d/0x17a
       [<ffffffff810264dc>] ? activate_task+0x42/0x53
       [<ffffffff8102c967>] ? try_to_wake_up+0x272/0x284
       [<ffffffff8101f1eb>] bad_area_nosemaphore+0xe/0x10
       [<ffffffff813f0f3f>] do_page_fault+0x1c8/0x37c
       [<ffffffff81028d24>] ? enqueue_task_fair+0x16d/0x17a
       [<ffffffff813ee55f>] page_fault+0x1f/0x30
       [<ffffffff8102c9a5>] ? wake_up_process+0x10/0x12
       [<ffffffff8132ad57>] ? op_amd_stop+0x2d/0x8e
       [<ffffffff8132ad46>] ? op_amd_stop+0x1c/0x8e
       [<ffffffff8132a602>] nmi_cpu_stop+0x21/0x23
       [<ffffffff810521b3>] generic_smp_call_function_single_interrupt+0xdf/0x11b
       [<ffffffff8101804f>] smp_call_function_single_interrupt+0x22/0x31
       [<ffffffff810029f3>] call_function_single_interrupt+0x13/0x20
       <EOI>  [<ffffffff8102c9a5>] ? wake_up_process+0x10/0x12
       [<ffffffff81008701>] ? default_idle+0x22/0x37
       [<ffffffff8100896d>] c1e_idle+0xdf/0xe6
       [<ffffffff813f1170>] ? atomic_notifier_call_chain+0x13/0x15
       [<ffffffff810012fb>] cpu_idle+0x4b/0x7e
       [<ffffffff813e8a4e>] start_secondary+0x1ae/0x1b2
      ------------[ cut here ]------------
      WARNING: at /local/rrichter/.source/linux/arch/x86/kernel/smp.c:118 native_smp_send_reschedule+0x27/0x53()
      Hardware name: Anaheim
      Modules linked in:
      Pid: 0, comm: swapper Tainted: G      D    2.6.34-rc5-oprofile-x86_64-standard-00210-g8c00f06 #16
      Call Trace:
       <IRQ>  [<ffffffff81017f32>] ? native_smp_send_reschedule+0x27/0x53
       [<ffffffff81030ee2>] warn_slowpath_common+0x77/0xa4
       [<ffffffff81030f1e>] warn_slowpath_null+0xf/0x11
       [<ffffffff81017f32>] native_smp_send_reschedule+0x27/0x53
       [<ffffffff8102634b>] resched_task+0x60/0x62
       [<ffffffff8102653a>] check_preempt_curr_idle+0x10/0x12
       [<ffffffff8102c8ea>] try_to_wake_up+0x1f5/0x284
       [<ffffffff8102c986>] default_wake_function+0xd/0xf
       [<ffffffff810a110d>] pollwake+0x57/0x5a
       [<ffffffff8102c979>] ? default_wake_function+0x0/0xf
       [<ffffffff81026be5>] __wake_up_common+0x46/0x75
       [<ffffffff81026ed0>] __wake_up+0x38/0x50
       [<ffffffff81031694>] printk_tick+0x39/0x3b
       [<ffffffff8103ac37>] update_process_times+0x3f/0x5c
       [<ffffffff8104dc63>] tick_periodic+0x5d/0x69
       [<ffffffff8104dc90>] tick_handle_periodic+0x21/0x71
       [<ffffffff81018fd0>] smp_apic_timer_interrupt+0x82/0x95
       [<ffffffff81002853>] apic_timer_interrupt+0x13/0x20
       [<ffffffff81030cb5>] ? panic_blink_one_second+0x0/0x7b
       [<ffffffff813ebdd6>] ? panic+0x10a/0x10c
       [<ffffffff810474b0>] ? up+0x34/0x39
       [<ffffffff81031ccc>] ? kmsg_dump+0x112/0x12c
       [<ffffffff813eeff1>] ? oops_end+0x81/0x8e
       [<ffffffff8101efee>] ? no_context+0x1f3/0x202
       [<ffffffff8101f1b7>] ? __bad_area_nosemaphore+0x1ba/0x1e0
       [<ffffffff81028d24>] ? enqueue_task_fair+0x16d/0x17a
       [<ffffffff810264dc>] ? activate_task+0x42/0x53
       [<ffffffff8102c967>] ? try_to_wake_up+0x272/0x284
       [<ffffffff8101f1eb>] ? bad_area_nosemaphore+0xe/0x10
       [<ffffffff813f0f3f>] ? do_page_fault+0x1c8/0x37c
       [<ffffffff81028d24>] ? enqueue_task_fair+0x16d/0x17a
       [<ffffffff813ee55f>] ? page_fault+0x1f/0x30
       [<ffffffff8102c9a5>] ? wake_up_process+0x10/0x12
       [<ffffffff8132ad57>] ? op_amd_stop+0x2d/0x8e
       [<ffffffff8132ad46>] ? op_amd_stop+0x1c/0x8e
       [<ffffffff8132a602>] ? nmi_cpu_stop+0x21/0x23
       [<ffffffff810521b3>] ? generic_smp_call_function_single_interrupt+0xdf/0x11b
       [<ffffffff8101804f>] ? smp_call_function_single_interrupt+0x22/0x31
       [<ffffffff810029f3>] ? call_function_single_interrupt+0x13/0x20
       <EOI>  [<ffffffff8102c9a5>] ? wake_up_process+0x10/0x12
       [<ffffffff81008701>] ? default_idle+0x22/0x37
       [<ffffffff8100896d>] ? c1e_idle+0xdf/0xe6
       [<ffffffff813f1170>] ? atomic_notifier_call_chain+0x13/0x15
       [<ffffffff810012fb>] ? cpu_idle+0x4b/0x7e
       [<ffffffff813e8a4e>] ? start_secondary+0x1ae/0x1b2
      ---[ end trace 679ac372d674b758 ]---
      
      Cc: Andi Kleen <andi@firstfloor.org>
      Signed-off-by: default avatarRobert Richter <robert.richter@amd.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      ae39937e
  2. 16 May, 2010 6 commits
  3. 15 May, 2010 1 commit