1. 07 1月, 2009 1 次提交
  2. 30 11月, 2008 1 次提交
    • R
      [ARM] Hide ISA DMA API when ISA_DMA_API is unset · dcea83ad
      Russell King 提交于
      When ISA_DMA_API is unset, we're not implementing the ISA DMA API,
      so there's no point in publishing the prototypes via asm/dma.h, nor
      including the machine dependent parts of that API.
      
      This allows us to remove a lot of mach/dma.h files which don't contain
      any useful code.  Unfortunately though, some platforms put their own
      private non-ISA definitions into mach/dma.h, so we leave these behind
      and fix the appropriate #include statments.
      Signed-off-by: NRussell King <rmk+kernel@arm.linux.org.uk>
      dcea83ad
  3. 20 11月, 2008 1 次提交
    • N
      pxa2xx_spi: bugfix full duplex dma data corruption · 393df744
      Ned Forrester 提交于
      Fixes a data corruption bug in pxa2xx_spi.c when operating in full duplex
      mode with DMA and using buffers that overlap.
      
      SPI transmit and receive buffers are allowed to be the same or to overlap.
       However, this driver fails if such overlap is attempted in DMA mode
      because it maps the rx and tx buffers in the wrong order.  By mapping
      DMA_FROM_DEVICE (read) before DMA_TO_DEVICE (write), it invalidates the
      cache before flushing it, thus discarding data which should have been
      transmitted.
      
      The patch corrects the order of mapping.  This bug exists in all versions
      of pxa2xx_spi.c; similar bugs are in the drivers for two other SPI
      controllers (au1500, imx).
      
      A version of this patch has been tested on kernel 2.6.20 using
      verification of loopback data with: random transfer length, random
      bits-per-word, random positive offsets (both larger and smaller than
      transfer length) between the start of the rx and tx buffers, and varying
      clock rates.
      Signed-off-by: NNed Forrester <nforrester@whoi.edu>
      Cc: Vernon Sauder <vernoninhand@gmail.com>
      Cc: J. Scott Merritt <merrij3@rpi.edu>
      Signed-off-by: NDavid Brownell <dbrownell@users.sourceforge.net>
      Cc: <stable@kernel.org>		[2.6.27.x]
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      393df744
  4. 17 10月, 2008 2 次提交
  5. 02 10月, 2008 1 次提交
  6. 14 9月, 2008 2 次提交
    • N
      pxa2xx_spi: dma bugfixes · 7e964455
      Ned Forrester 提交于
      Fixes two DMA bugs in the pxa2xx_spi driver.  The first bug is in all
      versions of this driver; the second was introduced in the 2.6.20 kernel,
      and prevents using the driver with chips like m25p16 flash (which can
      issue large DMA reads).
      
       1. Zero length transfers are permitted for use to insert timing,
          but pxa2xx_spi.c will fail if this is requested in DMA mode.
          Fixed by using programmed I/O (PIO) mode for such transfers.
      
       2. Transfers larger than 8191 are not permitted in DMA mode.  A
          test for length rejects all large transfers regardless of DMA
          or PIO mode.  Worked around by rejecting only large transfers
          with DMA mapped buffers, and forcing all other transfers
          larger than 8191 to use PIO mode.  A rate limited warning is
          issued for DMA transfers forced to PIO mode.
      
      This patch should apply to all kernels back to and including 2.6.20;
      it was test patched against 2.6.20.  An additional patch would be
      required for older kernels, but those versions are very buggy anyway.
      Signed-off-by: NNed Forrester <nforrester@whoi.edu>
      Cc: Vernon Sauder <vernoninhand@gmail.com>
      Cc: Eric Miao <eric.y.miao@gmail.com>
      Signed-off-by: NDavid Brownell <dbrownell@users.sourceforge.net>
      Cc: <stable@kernel.org>		[2.6.25.x, 2.6.26.x]
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      7e964455
    • N
      pxa2xx_spi: chipselect bugfixes · 8423597d
      Ned Forrester 提交于
      Fixes several chipselect bugs in the pxa2xx_spi driver.  These bugs are in
      all versions of this driver and prevent using it with chips like m25p16
      flash.
      
       1. The spi_transfer.cs_change flag is handled too early:
          before spi_transfer.delay_usecs applies, thus making the
          delay ineffective at holding chip select.
      
       2. spi_transfer.delay_usecs is ignored on the last transfer
          of a message (likewise not holding chipselect long enough).
      
       3. If spi_transfer.cs_change is set on the last transfer, the
          chip select is always disabled, instead of the intended
          meaning: optionally holding chip select enabled for the
          next message.
      
      Those first three bugs were fixed with a relocation of delays
      and chip select de-assertions.
      
       4. If a message has the cs_change flag set on the last transfer,
          and had the chip select stayed enabled as requested (see 3,
          above), it would not have been disabled if the next message is
          for a different chip.  Fixed by dropping chip select regardless
          of cs_change at end of a message, if there is no next message
          or if the next message is for a different chip.
      
      This patch should apply to all kernels back to and including 2.6.20;
      it was test patched against 2.6.20.  An additional patch would be
      required for older kernels, but those versions are very buggy anyway.
      Signed-off-by: NNed Forrester <nforrester@whoi.edu>
      Cc: Vernon Sauder <vernoninhand@gmail.com>
      Cc: Eric Miao <eric.y.miao@gmail.com>
      Signed-off-by: NDavid Brownell <dbrownell@users.sourceforge.net>
      Cc: <stable@kernel.org>		[2.6.25.x, 2.6.26.x]
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      8423597d
  7. 07 8月, 2008 2 次提交
  8. 27 7月, 2008 1 次提交
    • F
      dma-mapping: add the device argument to dma_mapping_error() · 8d8bb39b
      FUJITA Tomonori 提交于
      Add per-device dma_mapping_ops support for CONFIG_X86_64 as POWER
      architecture does:
      
      This enables us to cleanly fix the Calgary IOMMU issue that some devices
      are not behind the IOMMU (http://lkml.org/lkml/2008/5/8/423).
      
      I think that per-device dma_mapping_ops support would be also helpful for
      KVM people to support PCI passthrough but Andi thinks that this makes it
      difficult to support the PCI passthrough (see the above thread).  So I
      CC'ed this to KVM camp.  Comments are appreciated.
      
      A pointer to dma_mapping_ops to struct dev_archdata is added.  If the
      pointer is non NULL, DMA operations in asm/dma-mapping.h use it.  If it's
      NULL, the system-wide dma_ops pointer is used as before.
      
      If it's useful for KVM people, I plan to implement a mechanism to register
      a hook called when a new pci (or dma capable) device is created (it works
      with hot plugging).  It enables IOMMUs to set up an appropriate
      dma_mapping_ops per device.
      
      The major obstacle is that dma_mapping_error doesn't take a pointer to the
      device unlike other DMA operations.  So x86 can't have dma_mapping_ops per
      device.  Note all the POWER IOMMUs use the same dma_mapping_error function
      so this is not a problem for POWER but x86 IOMMUs use different
      dma_mapping_error functions.
      
      The first patch adds the device argument to dma_mapping_error.  The patch
      is trivial but large since it touches lots of drivers and dma-mapping.h in
      all the architecture.
      
      This patch:
      
      dma_mapping_error() doesn't take a pointer to the device unlike other DMA
      operations.  So we can't have dma_mapping_ops per device.
      
      Note that POWER already has dma_mapping_ops per device but all the POWER
      IOMMUs use the same dma_mapping_error function.  x86 IOMMUs use device
      argument.
      
      [akpm@linux-foundation.org: fix sge]
      [akpm@linux-foundation.org: fix svc_rdma]
      [akpm@linux-foundation.org: build fix]
      [akpm@linux-foundation.org: fix bnx2x]
      [akpm@linux-foundation.org: fix s2io]
      [akpm@linux-foundation.org: fix pasemi_mac]
      [akpm@linux-foundation.org: fix sdhci]
      [akpm@linux-foundation.org: build fix]
      [akpm@linux-foundation.org: fix sparc]
      [akpm@linux-foundation.org: fix ibmvscsi]
      Signed-off-by: NFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
      Cc: Muli Ben-Yehuda <muli@il.ibm.com>
      Cc: Andi Kleen <andi@firstfloor.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Avi Kivity <avi@qumranet.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      8d8bb39b
  9. 13 5月, 2008 1 次提交
  10. 28 4月, 2008 1 次提交
  11. 11 4月, 2008 1 次提交
  12. 24 2月, 2008 1 次提交
    • N
      spi: pxa2xx_spi clock polarity fix · b97c74bd
      Ned Forrester 提交于
      Fixes a sequencing bug in spi driver pxa2xx_spi.c in which the chip select
      for a transfer may be asserted before the clock polarity is set on the
      interface.  As a result of this bug, the clock signal may have the wrong
      polarity at transfer start, so it may need to make an extra half transition
      before the intended clock/data signals begin.  (This probably means all
      transfers are one bit out of sequence.)
      
      This only occurs on the first transfer following a change in clock polarity
      in systems using more than one more than one such polarity.  The fix
      assures that the clock mode is properly set before asserting chip select.
      
      This bug was introduced in a patch merged on 2006/12/10, kernel 2.6.20.
      The patch defines an additional bit in: include/asm-arm/arch-pxa/regs-ssp.h
      for 2.6.25 and newer kernels but this addition must be made in:
      include/asm-arm/arch-pxa/pxa-regs.h for kernels between 2.6.20 and 2.6.24,
      inclusive
      Signed-off-by: NNed Forrester <nforrester@whoi.edu>
      Signed-off-by: NDavid Brownell <dbrownell@users.sourceforge.net>
      Cc: Russell King <rmk@arm.linux.org.uk>
      Cc: <stable@kernel.org>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      b97c74bd
  13. 07 2月, 2008 1 次提交
  14. 26 1月, 2008 2 次提交
  15. 11 12月, 2007 1 次提交
  16. 17 10月, 2007 3 次提交
  17. 18 7月, 2007 1 次提交
  18. 13 2月, 2007 1 次提交
  19. 08 2月, 2007 2 次提交
  20. 27 1月, 2007 1 次提交
  21. 11 12月, 2006 1 次提交
    • S
      [PATCH] spi: stabilize PIO mode transfers on PXA2xx systems · 8d94cc50
      Stephen Street 提交于
      Stabilize PIO mode transfers against a range of word sizes and FIFO
      thresholds and fixes word size setup/override issues.
      
      1) 16 and 32 bit DMA/PIO transfers broken due to timing differences.
      2) Potential for bad transfer counts due to transfer size assumptions.
      3) Setup function broken is multiple ways.
      4) Per transfer bit_per_word changes break DMA setup in pump_tranfers.
      5) False positive timeout are not errors.
      6) Changes in pxa2xx_spi_chip not effective in calls to setup.
      7) Timeout scaling wrong for PXA255 NSSP.
      8) Driver leaks memory while busy during unloading.
      
      Known issues:
      
      SPI_CS_HIGH and SPI_LSB_FIRST settings in struct spi_device are not handled.
      
      Testing:
      
      This patch has been test against the "random length, random bits/word,
      random data (verified on loopback) and stepped baud rate by octaves
      (3.6MHz to 115kHz)" test.  It is robust in PIO mode, using any
      combination of tx and rx thresholds, and also in DMA mode (which
      internally computes the thresholds).
      
      Much thanks to Ned Forrester for exhaustive reviews, fixes and testing.
      The driver is substantially better for his efforts.
      Signed-off-by: NStephen Street <stephen@streetfiresound.com>
      Signed-off-by: NDavid Brownell <dbrownell@users.sourceforge.net>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      8d94cc50
  22. 06 12月, 2006 1 次提交
  23. 07 10月, 2006 1 次提交
    • J
      Various drivers' irq handlers: kill dead code, needless casts · c7bec5ab
      Jeff Garzik 提交于
      - Eliminate casts to/from void*
      
      - Eliminate checks for conditions that never occur.  These typically
        fall into two classes:
      
      	1) Checking for 'dev_id == NULL', then it is never called with
      	NULL as an argument.
      
      	2) Checking for invalid irq number, when the only caller (the
      	system) guarantees the irq handler is called with the proper
      	'irq' number argument.
      Signed-off-by: NJeff Garzik <jeff@garzik.org>
      c7bec5ab
  24. 05 10月, 2006 1 次提交
    • D
      IRQ: Maintain regs pointer globally rather than passing to IRQ handlers · 7d12e780
      David Howells 提交于
      Maintain a per-CPU global "struct pt_regs *" variable which can be used instead
      of passing regs around manually through all ~1800 interrupt handlers in the
      Linux kernel.
      
      The regs pointer is used in few places, but it potentially costs both stack
      space and code to pass it around.  On the FRV arch, removing the regs parameter
      from all the genirq function results in a 20% speed up of the IRQ exit path
      (ie: from leaving timer_interrupt() to leaving do_IRQ()).
      
      Where appropriate, an arch may override the generic storage facility and do
      something different with the variable.  On FRV, for instance, the address is
      maintained in GR28 at all times inside the kernel as part of general exception
      handling.
      
      Having looked over the code, it appears that the parameter may be handed down
      through up to twenty or so layers of functions.  Consider a USB character
      device attached to a USB hub, attached to a USB controller that posts its
      interrupts through a cascaded auxiliary interrupt controller.  A character
      device driver may want to pass regs to the sysrq handler through the input
      layer which adds another few layers of parameter passing.
      
      I've build this code with allyesconfig for x86_64 and i386.  I've runtested the
      main part of the code on FRV and i386, though I can't test most of the drivers.
      I've also done partial conversion for powerpc and MIPS - these at least compile
      with minimal configurations.
      
      This will affect all archs.  Mostly the changes should be relatively easy.
      Take do_IRQ(), store the regs pointer at the beginning, saving the old one:
      
      	struct pt_regs *old_regs = set_irq_regs(regs);
      
      And put the old one back at the end:
      
      	set_irq_regs(old_regs);
      
      Don't pass regs through to generic_handle_irq() or __do_IRQ().
      
      In timer_interrupt(), this sort of change will be necessary:
      
      	-	update_process_times(user_mode(regs));
      	-	profile_tick(CPU_PROFILING, regs);
      	+	update_process_times(user_mode(get_irq_regs()));
      	+	profile_tick(CPU_PROFILING);
      
      I'd like to move update_process_times()'s use of get_irq_regs() into itself,
      except that i386, alone of the archs, uses something other than user_mode().
      
      Some notes on the interrupt handling in the drivers:
      
       (*) input_dev() is now gone entirely.  The regs pointer is no longer stored in
           the input_dev struct.
      
       (*) finish_unlinks() in drivers/usb/host/ohci-q.c needs checking.  It does
           something different depending on whether it's been supplied with a regs
           pointer or not.
      
       (*) Various IRQ handler function pointers have been moved to type
           irq_handler_t.
      Signed-Off-By: NDavid Howells <dhowells@redhat.com>
      (cherry picked from 1b16e7ac850969f38b375e511e3fa2f474a33867 commit)
      7d12e780
  25. 22 5月, 2006 1 次提交
  26. 17 5月, 2006 2 次提交