1. 27 Jul, 2010 9 commits
    • Stefan Richter's avatar
      firewire: nosy: fix device shutdown with active client · 424d66ce
      Stefan Richter authored
      Fix race between nosy_open() and remove_card() by replacing the
      unprotected array of card pointers by a mutex-protected list of cards.
      
      Make card instances reference-counted and let each client hold a
      reference.
      
      Notify clients about card removal via POLLHUP in poll()'s events
      bitmap; also let read() fail with errno=ENODEV if the card was removed
      and everything in the buffer was read.
      Signed-off-by: default avatarStefan Richter <stefanr@s5r6.in-berlin.de>
      424d66ce
    • Stefan Richter's avatar
      firewire: nosy: handle errors in device probe · b6d9c125
      Stefan Richter authored
      and add a missing pci_disable_device() to device shutdown.
      Signed-off-by: default avatarStefan Richter <stefanr@s5r6.in-berlin.de>
      b6d9c125
    • Stefan Richter's avatar
      firewire: nosy: fix IRQ handler for card ejection · 16547667
      Stefan Richter authored
      Untested, I don't have a PCILynx CardBus card.
      Signed-off-by: default avatarStefan Richter <stefanr@s5r6.in-berlin.de>
      16547667
    • Stefan Richter's avatar
      firewire: nosy: unroll some simple functions · 55e77c06
      Stefan Richter authored
      nosy_start/stop_snoop() and nosy_add/remove_client() are simple enough
      to be inlined into their callers.
      Signed-off-by: default avatarStefan Richter <stefanr@s5r6.in-berlin.de>
      55e77c06
    • Stefan Richter's avatar
      firewire: nosy: use flagless variants of spinlock accessors · 685c3f80
      Stefan Richter authored
      nosy_start/stop_snoop() are always only called by the ioctl method, i.e.
      with IRQs enabled.  packet_handler() and bus_reset_handler() are always
      only called by the IRQ handler.  Hence neither one needs to track IRQ
      flags.
      
      To underline the call context of packet_handler() and
      bus_reset_handler(), rename these functions to *_irq_handler().
      Signed-off-by: default avatarStefan Richter <stefanr@s5r6.in-berlin.de>
      685c3f80
    • Stefan Richter's avatar
      firewire: nosy: fix list corruption by NOSY_IOC_STOP · a2d39db9
      Stefan Richter authored
      nosy_stop_snoop() would blow up the second time it was called without
      nosy_start_snoop() in between.
      Signed-off-by: default avatarStefan Richter <stefanr@s5r6.in-berlin.de>
      a2d39db9
    • Stefan Richter's avatar
      firewire: nosy: convert to unlocked ioctl · c7b2a99c
      Stefan Richter authored
      The required serialization of NOSY_IOC_START and NOSY_IOC_STOP is
      already provided by the client_list_lock.
      
      NOSY_IOC_FILTER does not really require serialization since accesses
      to tcode_mask are atomic on any sane CPU architecture.  Nevertheless,
      make it explicit that we want this to be atomic by means of
      client_list_lock (which also surrounds the other tcode_mask access in
      the IRQ handler).  While we are at it, change the type of tcode_mask to
      u32 for consistency with the user API.
      
      NOSY_IOC_GET_STATS does not require serialization against itself.  But
      there is a bug here regarding concurrent updates of the two counters
      by the IRQ handler.  Fix it by taking the client_list_lock in this ioctl
      too.
      Signed-off-by: default avatarStefan Richter <stefanr@s5r6.in-berlin.de>
      c7b2a99c
    • Stefan Richter's avatar
      firewire: nosy: misc cleanups · b5e47729
      Stefan Richter authored
      Extend copyright note to 2007, c.f. Kristian's git log.
      
      Includes:
        - replace some <asm/*.h> by <linux/*.h>
        - add required indirectly included <linux/spinlock.h>
        - order alphabetically
      
      Coding style related changes:
        - change to utf8
        - normalize whitespace
        - normalize comment style
        - remove usages of __FUNCTION__
        - remove an unnecessary cast from void *
      
      Const and static declarations:
        - driver_name is not const in pci_driver.name, drop const qualifier
        - driver_name can be taken from KBUILD_MODNAME
        - the global variable minors[] can and should be static
        - constify struct file_operations instance
      
      Data types:
        - Remove unused struct member struct packet.code.  struct packet is
          only used for driver-internal bookkeeping; it does not appear on the
          wire or in DMA programs or the userspace ABI.  Hence the unused
          member .code can be removed without worries.
      
      Preprocessor macros:
        - unroll a preprocessor macro that containd a return
        - use list_for_each_entry
      
      Printk:
        - add missing terminating \n in some format strings
      Signed-off-by: default avatarStefan Richter <stefanr@s5r6.in-berlin.de>
      b5e47729
    • Stefan Richter's avatar
      firewire: new driver: nosy - IEEE 1394 traffic sniffer · 28646821
      Stefan Richter authored
      This adds the traffic sniffer driver for Texas Instruments PCILynx/
      PCILynx2 based cards.  The use cases for nosy are analysis of
      nonstandard protocols and as an aid in development of drivers,
      applications, or firmwares.
      
      Author of the driver is Kristian Høgsberg.  Known contributers are
      Jody McIntyre and Jonathan Woithe.
      
      Nosy programs PCILynx chips to operate in promiscuous mode, which is a
      feature that is not found in OHCI-1394 controllers.  Hence, only special
      hardware as mentioned in the Kconfig help text is suitable for nosy.
      
      This is only the kernelspace part of nosy.  There is a userspace
      interface to it, called nosy-dump, proposed to be added into the tools/
      subdirectory of the kernel sources in a subsequent change.  Kernelspace
      and userspave component of nosy communicate via a 'misc' character
      device file called /dev/nosy with a simple ioctl() and read() based
      protocol, as described by nosy-user.h.
      
      The files added here are taken from
      git://anongit.freedesktop.org/~krh/nosy commit ee29be97 (2009-11-10)
      with the following changes by Stefan Richter:
        - Kconfig and Makefile hunks are written from scratch.
        - Commented out version printk in nosy.c.
        - Included missing <linux/sched.h>, reported by Stephen Rothwell.
      
      "git shortlog nosy{-user.h,.c,.h}" from nosy's git repository:
      
      Jonathan Woithe (2):
            Nosy updates for recent kernels
            Fix uninitialised memory (needed for 2.6.31 kernel)
      
      Kristian Høgsberg (5):
            Pull over nosy from mercurial repo.
            Use a misc device instead.
            Add simple AV/C decoder.
            Don't break down on big payloads.
            Set parent device for misc device.
      
      As a low-level IEEE 1394 driver, its files are placed into
      drivers/firewire/ although nosy is not part of the firewire driver
      stack.
      
      I am aware of the following literature from Texas Instruments about
      PCILynx programming:
            SCPA020A - PCILynx 1394 to PCI Bus Interface TSB12LV21BPGF
                       Functional Specification
            SLLA023  - Initialization and Asynchronous Programming of the
                       TSB12LV21A 1394 Device
      Signed-off-by: default avatarStefan Richter <stefanr@s5r6.in-berlin.de>
      Acked-by: default avatarKristian Høgsberg <krh@bitplanet.net>
      28646821
  2. 16 May, 2010 6 commits
  3. 15 May, 2010 17 commits
  4. 14 May, 2010 8 commits
    • H. Peter Anvin's avatar
      x86, mrst: Don't blindly access extended config space · e9b1d5d0
      H. Peter Anvin authored
      Do not blindly access extended configuration space unless we actively
      know we're on a Moorestown platform.  The fixed-size BAR capability
      lives in the extended configuration space, and thus is not applicable
      if the configuration space isn't appropriately sized.
      
      This fixes booting certain VMware configurations with CONFIG_MRST=y.
      
      Moorestown will add a fake PCI-X 266 capability to advertise the
      presence of extended configuration space.
      Reported-and-tested-by: default avatarPetr Vandrovec <petr@vandrovec.name>
      Signed-off-by: default avatarH. Peter Anvin <hpa@linux.intel.com>
      Acked-by: default avatarJacob Pan <jacob.jun.pan@intel.com>
      Acked-by: default avatarJesse Barnes <jbarnes@virtuousgeek.org>
      LKML-Reference: <AANLkTiltKUa3TrKR1M51eGw8FLNoQJSLT0k0_K5X3-OJ@mail.gmail.com>
      e9b1d5d0
    • Linus Torvalds's avatar
      Merge branch 'x86-fixes-for-linus' of... · ef0e9180
      Linus Torvalds authored
      Merge branch 'x86-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip
      
      * 'x86-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
        x86, cacheinfo: Turn off L3 cache index disable feature in virtualized environments
        x86, k8: Fix build error when K8_NB is disabled
        x86, amd: Check X86_FEATURE_OSVW bit before accessing OSVW MSRs
        x86: Fix fake apicid to node mapping for numa emulation
      ef0e9180
    • Frank Arnold's avatar
      x86, cacheinfo: Turn off L3 cache index disable feature in virtualized environments · 7f284d3c
      Frank Arnold authored
      When running a quest kernel on xen we get:
      
      BUG: unable to handle kernel NULL pointer dereference at 0000000000000038
      IP: [<ffffffff8142f2fb>] cpuid4_cache_lookup_regs+0x2ca/0x3df
      PGD 0
      Oops: 0000 [#1] SMP
      last sysfs file:
      CPU 0
      Modules linked in:
      
      Pid: 0, comm: swapper Tainted: G        W  2.6.34-rc3 #1 /HVM domU
      RIP: 0010:[<ffffffff8142f2fb>]  [<ffffffff8142f2fb>] cpuid4_cache_lookup_regs+0x
      2ca/0x3df
      RSP: 0018:ffff880002203e08  EFLAGS: 00010046
      RAX: 0000000000000000 RBX: 0000000000000003 RCX: 0000000000000060
      RDX: 0000000000000000 RSI: 0000000000000040 RDI: 0000000000000000
      RBP: ffff880002203ed8 R08: 00000000000017c0 R09: ffff880002203e38
      R10: ffff8800023d5d40 R11: ffffffff81a01e28 R12: ffff880187e6f5c0
      R13: ffff880002203e34 R14: ffff880002203e58 R15: ffff880002203e68
      FS:  0000000000000000(0000) GS:ffff880002200000(0000) knlGS:0000000000000000
      CS:  0010 DS: 0000 ES: 0000 CR0: 000000008005003b
      CR2: 0000000000000038 CR3: 0000000001a3c000 CR4: 00000000000006f0
      DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
      DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400
      Process swapper (pid: 0, threadinfo ffffffff81a00000, task ffffffff81a44020)
      Stack:
       ffffffff810d7ecb ffff880002203e20 ffffffff81059140 ffff880002203e30
      <0> ffffffff810d7ec9 0000000002203e40 000000000050d140 ffff880002203e70
      <0> 0000000002008140 0000000000000086 ffff880040020140 ffffffff81068b8b
      Call Trace:
       <IRQ>
       [<ffffffff810d7ecb>] ? sync_supers_timer_fn+0x0/0x1c
       [<ffffffff81059140>] ? mod_timer+0x23/0x25
       [<ffffffff810d7ec9>] ? arm_supers_timer+0x34/0x36
       [<ffffffff81068b8b>] ? hrtimer_get_next_event+0xa7/0xc3
       [<ffffffff81058e85>] ? get_next_timer_interrupt+0x19a/0x20d
       [<ffffffff8142fa23>] get_cpu_leaves+0x5c/0x232
       [<ffffffff8106a7b1>] ? sched_clock_local+0x1c/0x82
       [<ffffffff8106a9a0>] ? sched_clock_tick+0x75/0x7a
       [<ffffffff8107748c>] generic_smp_call_function_single_interrupt+0xae/0xd0
       [<ffffffff8101f6ef>] smp_call_function_single_interrupt+0x18/0x27
       [<ffffffff8100a773>] call_function_single_interrupt+0x13/0x20
       <EOI>
       [<ffffffff8143c468>] ? notifier_call_chain+0x14/0x63
       [<ffffffff810295c6>] ? native_safe_halt+0xc/0xd
       [<ffffffff810114eb>] ? default_idle+0x36/0x53
       [<ffffffff81008c22>] cpu_idle+0xaa/0xe4
       [<ffffffff81423a9a>] rest_init+0x7e/0x80
       [<ffffffff81b10dd2>] start_kernel+0x40e/0x419
       [<ffffffff81b102c8>] x86_64_start_reservations+0xb3/0xb7
       [<ffffffff81b103c4>] x86_64_start_kernel+0xf8/0x107
      Code: 14 d5 40 ff ae 81 8b 14 02 31 c0 3b 15 47 1c 8b 00 7d 0e 48 8b 05 36 1c 8b
       00 48 63 d2 48 8b 04 d0 c7 85 5c ff ff ff 00 00 00 00 <8b> 70 38 48 8d 8d 5c ff
       ff ff 48 8b 78 10 ba c4 01 00 00 e8 eb
      RIP  [<ffffffff8142f2fb>] cpuid4_cache_lookup_regs+0x2ca/0x3df
       RSP <ffff880002203e08>
      CR2: 0000000000000038
      ---[ end trace a7919e7f17c0a726 ]---
      
      The L3 cache index disable feature of AMD CPUs has to be disabled if the
      kernel is running as guest on top of a hypervisor because northbridge
      devices are not available to the guest. Currently, this fixes a boot
      crash on top of Xen. In the future this will become an issue on KVM as
      well.
      
      Check if northbridge devices are present and do not enable the feature
      if there are none.
      
      [ hpa: backported to 2.6.34 ]
      Signed-off-by: default avatarFrank Arnold <frank.arnold@amd.com>
      LKML-Reference: <1271945222-5283-3-git-send-email-bp@amd64.org>
      Acked-by: default avatarBorislav Petkov <borislav.petkov@amd.com>
      Signed-off-by: default avatarH. Peter Anvin <hpa@zytor.com>
      Cc: <stable@kernel.org>
      7f284d3c
    • Borislav Petkov's avatar
      x86, k8: Fix build error when K8_NB is disabled · ade029e2
      Borislav Petkov authored
      K8_NB depends on PCI and when the last is disabled (allnoconfig) we fail
      at the final linking stage due to missing exported num_k8_northbridges.
      Add a header stub for that.
      Signed-off-by: default avatarBorislav Petkov <borislav.petkov@amd.com>
      LKML-Reference: <20100503183036.GJ26107@aftab>
      Signed-off-by: default avatarH. Peter Anvin <hpa@zytor.com>
      Cc: <stable@kernel.org>
      ade029e2
    • Linus Torvalds's avatar
      Merge branch 'for-linus' of git://git.infradead.org/users/eparis/notify · 4fc4c3ce
      Linus Torvalds authored
      * 'for-linus' of git://git.infradead.org/users/eparis/notify:
        inotify: don't leak user struct on inotify release
        inotify: race use after free/double free in inotify inode marks
        inotify: clean up the inotify_add_watch out path
        Inotify: undefined reference to `anon_inode_getfd'
      
      Manual merge to remove duplicate "select ANON_INODES" from Kconfig file
      4fc4c3ce
    • Linus Torvalds's avatar
      Merge branch 'davinci-fixes-for-linus-2' of... · 97b2073f
      Linus Torvalds authored
      Merge branch 'davinci-fixes-for-linus-2' of git://git.kernel.org/pub/scm/linux/kernel/git/khilman/linux-davinci
      
      * 'davinci-fixes-for-linus-2' of git://git.kernel.org/pub/scm/linux/kernel/git/khilman/linux-davinci:
        DA830: fix USB 2.0 clock entry
      97b2073f
    • Sergei Shtylyov's avatar
      DA830: fix USB 2.0 clock entry · b9af5ddf
      Sergei Shtylyov authored
      DA8xx OHCI driver fails to load due to failing clk_get() call for the USB 2.0
      clock. Arrange matching USB 2.0 clock by the clock name instead of the device.
      (Adding another CLK() entry for "ohci.0" device won't do -- in the future I'll
      also have to enable USB 2.0 clock to configure CPPI 4.1 module, in which case
      I won't have any device at all.)
      Signed-off-by: default avatarSergei Shtylyov <sshtylyov@ru.mvista.com>
      Signed-off-by: default avatarKevin Hilman <khilman@deeprootsystems.com>
      b9af5ddf
    • Pavel Emelyanov's avatar
      inotify: don't leak user struct on inotify release · b3b38d84
      Pavel Emelyanov authored
      inotify_new_group() receives a get_uid-ed user_struct and saves the
      reference on group->inotify_data.user.  The problem is that free_uid() is
      never called on it.
      
      Issue seem to be introduced by 63c882a0 (inotify: reimplement inotify
      using fsnotify) after 2.6.30.
      Signed-off-by: default avatarPavel Emelyanov <xemul@openvz.org>
      Eric Paris <eparis@parisplace.org>
      Cc: <stable@kernel.org>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarEric Paris <eparis@redhat.com>
      b3b38d84