1. 10 7月, 2007 17 次提交
  2. 19 5月, 2007 1 次提交
    • R
      IB/ipath: Fix potential deadlock with multicast spinlocks · 8b8c8bca
      Roland Dreier 提交于
      Lockdep found the following potential deadlock between mcast_lock and
      n_mcast_grps_lock: mcast_lock is taken from both interrupt context and
      process context, so spin_lock_irqsave() must be used to take it.
      n_mcast_grps_lock is only taken from process context, so at first it
      seems safe to take it with plain spin_lock(); however, it also nests
      inside mcast_lock, and hence we could deadlock:
      
        cpu A                                   cpu B
          ipath_mcast_add():
            spin_lock_irq(&mcast_lock);
      
                                                  ipath_mcast_detach():
                                                    spin_lock(&n_mcast_grps_lock);
      
                                                  <enter interrupt>
      
                                                  ipath_mcast_find():
                                                    spin_lock_irqsave(&mcast_lock);
      
            spin_lock(&n_mcast_grps_lock);
      
      Fix this by using spin_lock_irq() to take n_mcast_grps_lock.
      Signed-off-by: NRoland Dreier <rolandd@cisco.com>
      8b8c8bca
  3. 15 5月, 2007 1 次提交
    • A
      IB/ipath: Shadow the gpio_mask register · 8f140b40
      Arthur Jones 提交于
      Once upon a time, GPIO interrupts were rare.  But then a chip bug in
      the waldo series forced the use of a GPIO interrupt to signal packet
      reception.  This greatly increased the frequency of GPIO interrupts
      which have the gpio_mask bits set on the waldo chips.  Other bits in
      the gpio_status register are used for I2C clock and data lines, these
      bits are usually on.  An "unlikely" annotation leftover from the old
      days was improperly applied to these bits, and an unnecessary chip
      mmio read was being accessed in the interrupt fast path on waldo.
      
      Remove the stagnant unlikely annotation in the interrupt handler and
      keep a shadow copy of the gpio_mask register to avoid the slow mmio
      read when testing for interruptable GPIO bits.
      Signed-off-by: NArthur Jones <arthur.jones@qlogic.com>
      Signed-off-by: NRoland Dreier <rolandd@cisco.com>
      8f140b40
  4. 09 5月, 2007 2 次提交
    • R
      IB/uverbs: Export ib_umem_get()/ib_umem_release() to modules · f7c6a7b5
      Roland Dreier 提交于
      Export ib_umem_get()/ib_umem_release() and put low-level drivers in
      control of when to call ib_umem_get() to pin and DMA map userspace,
      rather than always calling it in ib_uverbs_reg_mr() before calling the
      low-level driver's reg_user_mr method.
      
      Also move these functions to be in the ib_core module instead of
      ib_uverbs, so that driver modules using them do not depend on
      ib_uverbs.
      
      This has a number of advantages:
       - It is better design from the standpoint of making generic code a
         library that can be used or overridden by device-specific code as
         the details of specific devices dictate.
       - Drivers that do not need to pin userspace memory regions do not
         need to take the performance hit of calling ib_mem_get().  For
         example, although I have not tried to implement it in this patch,
         the ipath driver should be able to avoid pinning memory and just
         use copy_{to,from}_user() to access userspace memory regions.
       - Buffers that need special mapping treatment can be identified by
         the low-level driver.  For example, it may be possible to solve
         some Altix-specific memory ordering issues with mthca CQs in
         userspace by mapping CQ buffers with extra flags.
       - Drivers that need to pin and DMA map userspace memory for things
         other than memory regions can use ib_umem_get() directly, instead
         of hacks using extra parameters to their reg_phys_mr method.  For
         example, the mlx4 driver that is pending being merged needs to pin
         and DMA map QP and CQ buffers, but it does not need to create a
         memory key for these buffers.  So the cleanest solution is for mlx4
         to call ib_umem_get() in the create_qp and create_cq methods.
      Signed-off-by: NRoland Dreier <rolandd@cisco.com>
      f7c6a7b5
    • J
      inode numbering: change libfs sb creation routines to avoid collisions with their root inodes · 1a1c9bb4
      Jeff Layton 提交于
      This patch makes it so that simple_fill_super and get_sb_pseudo assign their
      root inodes to be number 1.  It also fixes up a couple of callers of
      simple_fill_super that were passing in files arrays that had an index at
      number 1, and adds a warning for any caller that sends in such an array.
      
      It would have been nice to have made it so that it wasn't possible to make
      such a collision, but some callers need to be able to control what inode
      number their entries get, so I think this is the best that can be done.
      Signed-off-by: NJeff Layton <jlayton@redhat.com>
      Cc: Christoph Hellwig <hch@lst.de>
      Cc: Al Viro <viro@zeniv.linux.org.uk>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      1a1c9bb4
  5. 07 5月, 2007 4 次提交
    • R
      IB: Return "maybe missed event" hint from ib_req_notify_cq() · ed23a727
      Roland Dreier 提交于
      The semantics defined by the InfiniBand specification say that
      completion events are only generated when a completions is added to a
      completion queue (CQ) after completion notification is requested.  In
      other words, this means that the following race is possible:
      
      	while (CQ is not empty)
      		ib_poll_cq(CQ);
      	// new completion is added after while loop is exited
      	ib_req_notify_cq(CQ);
      	// no event is generated for the existing completion
      
      To close this race, the IB spec recommends doing another poll of the
      CQ after requesting notification.
      
      However, it is not always possible to arrange code this way (for
      example, we have found that NAPI for IPoIB cannot poll after
      requesting notification).  Also, some hardware (eg Mellanox HCAs)
      actually will generate an event for completions added before the call
      to ib_req_notify_cq() -- which is allowed by the spec, since there's
      no way for any upper-layer consumer to know exactly when a completion
      was really added -- so the extra poll of the CQ is just a waste.
      
      Motivated by this, we add a new flag "IB_CQ_REPORT_MISSED_EVENTS" for
      ib_req_notify_cq() so that it can return a hint about whether the a
      completion may have been added before the request for notification.
      The return value of ib_req_notify_cq() is extended so:
      
      	 < 0	means an error occurred while requesting notification
      	== 0	means notification was requested successfully, and if
      		IB_CQ_REPORT_MISSED_EVENTS was passed in, then no
      		events were missed and it is safe to wait for another
      		event.
      	 > 0	is only returned if IB_CQ_REPORT_MISSED_EVENTS was
      		passed in.  It means that the consumer must poll the
      		CQ again to make sure it is empty to avoid the race
      		described above.
      
      We add a flag to enable this behavior rather than turning it on
      unconditionally, because checking for missed events may incur
      significant overhead for some low-level drivers, and consumers that
      don't care about the results of this test shouldn't be forced to pay
      for the test.
      Signed-off-by: NRoland Dreier <rolandd@cisco.com>
      ed23a727
    • M
      IB: Add CQ comp_vector support · f4fd0b22
      Michael S. Tsirkin 提交于
      Add a num_comp_vectors member to struct ib_device and extend
      ib_create_cq() to pass in a comp_vector parameter -- this parallels
      the userspace libibverbs API.  Update all hardware drivers to set
      num_comp_vectors to 1 and have all ULPs pass 0 for the comp_vector
      value.  Pass the value of num_comp_vectors to userspace rather than
      hard-coding a value of 1.
      
      We want multiple CQ event vector support (via MSI-X or similar for
      adapters that can generate multiple interrupts), but it's not clear
      how many vectors we want, or how we want to deal with policy issues
      such as how to decide which vector to use or how to set up interrupt
      affinity.  This patch is useful for experimenting, since no core
      changes will be necessary when updating a driver to support multiple
      vectors, and we know that we want to make at least these changes
      anyway.
      Signed-off-by: NMichael S. Tsirkin <mst@dev.mellanox.co.il>
      Signed-off-by: NRoland Dreier <rolandd@cisco.com>
      f4fd0b22
    • R
      IB/ipath: Fix a race condition when generating ACKs · 154257f3
      Ralph Campbell 提交于
      Fix a problem where simple ACKs can be sent ahead of RDMA read
      responses thus implicitly NAKing the RDMA read.
      Signed-off-by: NRalph Campbell <ralph.cambpell@qlogic.com>
      Signed-off-by: NRobert Walsh <robert.walsh@qlogic.com>
      Signed-off-by: NRoland Dreier <rolandd@cisco.com>
      154257f3
    • R
      IB/ipath: Fix two more spin lock problems · 6ed89b95
      Ralph Campbell 提交于
      Fix a missing unlock in ipath_rc_rcv_resp() and remove an extra unlock
      from ipath_rc_rcv_error().
      Signed-off-by: NRalph Campbell <ralph.campbell@qlogic.com>
      Signed-off-by: NRoland Dreier <rolandd@cisco.com>
      6ed89b95
  6. 03 5月, 2007 1 次提交
    • J
      PCI: Cleanup the includes of <linux/pci.h> · 6473d160
      Jean Delvare 提交于
      I noticed that many source files include <linux/pci.h> while they do
      not appear to need it. Here is an attempt to clean it all up.
      
      In order to find all possibly affected files, I searched for all
      files including <linux/pci.h> but without any other occurence of "pci"
      or "PCI". I removed the include statement from all of these, then I
      compiled an allmodconfig kernel on both i386 and x86_64 and fixed the
      false positives manually.
      
      My tests covered 66% of the affected files, so there could be false
      positives remaining. Untested files are:
      
      arch/alpha/kernel/err_common.c
      arch/alpha/kernel/err_ev6.c
      arch/alpha/kernel/err_ev7.c
      arch/ia64/sn/kernel/huberror.c
      arch/ia64/sn/kernel/xpnet.c
      arch/m68knommu/kernel/dma.c
      arch/mips/lib/iomap.c
      arch/powerpc/platforms/pseries/ras.c
      arch/ppc/8260_io/enet.c
      arch/ppc/8260_io/fcc_enet.c
      arch/ppc/8xx_io/enet.c
      arch/ppc/syslib/ppc4xx_sgdma.c
      arch/sh64/mach-cayman/iomap.c
      arch/xtensa/kernel/xtensa_ksyms.c
      arch/xtensa/platform-iss/setup.c
      drivers/i2c/busses/i2c-at91.c
      drivers/i2c/busses/i2c-mpc.c
      drivers/media/video/saa711x.c
      drivers/misc/hdpuftrs/hdpu_cpustate.c
      drivers/misc/hdpuftrs/hdpu_nexus.c
      drivers/net/au1000_eth.c
      drivers/net/fec_8xx/fec_main.c
      drivers/net/fec_8xx/fec_mii.c
      drivers/net/fs_enet/fs_enet-main.c
      drivers/net/fs_enet/mac-fcc.c
      drivers/net/fs_enet/mac-fec.c
      drivers/net/fs_enet/mac-scc.c
      drivers/net/fs_enet/mii-bitbang.c
      drivers/net/fs_enet/mii-fec.c
      drivers/net/ibm_emac/ibm_emac_core.c
      drivers/net/lasi_82596.c
      drivers/parisc/hppb.c
      drivers/sbus/sbus.c
      drivers/video/g364fb.c
      drivers/video/platinumfb.c
      drivers/video/stifb.c
      drivers/video/valkyriefb.c
      include/asm-arm/arch-ixp4xx/dma.h
      sound/oss/au1550_ac97.c
      
      I would welcome test reports for these files. I am fine with removing
      the untested files from the patch if the general opinion is that these
      changes aren't safe. The tested part would still be nice to have.
      
      Note that this patch depends on another header fixup patch I submitted
      to LKML yesterday:
        [PATCH] scatterlist.h needs types.h
        http://lkml.org/lkml/2007/3/01/141Signed-off-by: NJean Delvare <khali@linux-fr.org>
      Cc: Badari Pulavarty <pbadari@us.ibm.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      6473d160
  7. 01 5月, 2007 3 次提交
  8. 25 4月, 2007 1 次提交
  9. 19 4月, 2007 10 次提交