1. 01 4月, 2010 1 次提交
    • H
      ide: Requeue request after DMA timeout · 6072f749
      Herbert Xu 提交于
      I noticed that my KVM virtual machines were experiencing IDE
      issues resulting in processes stuck on waiting for buffers to
      complete.
      
      The root cause is of course race conditions in the ancient qemu
      backend that I'm using.  However, the fact that the guest isn't
      recovering is a bug.
      
      I've tracked it down to the change made last year to dequeue
      requests at the start rather than at the end in the IDE layer.
      
      commit 8f6205cd
      Author: Tejun Heo <tj@kernel.org>
      Date:   Fri May 8 11:53:59 2009 +0900
      
          ide: dequeue in-flight request
      
      The problem is that the function ide_dma_timeout_retry does not
      requeue the current request, causing one request to be lost for
      each DMA timeout.
      
      This patch fixes this by requeueing the request.
      Signed-off-by: NHerbert Xu <herbert@gondor.apana.org.au>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      6072f749
  2. 30 3月, 2010 1 次提交
    • T
      include cleanup: Update gfp.h and slab.h includes to prepare for breaking... · 5a0e3ad6
      Tejun Heo 提交于
      include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h
      
      percpu.h is included by sched.h and module.h and thus ends up being
      included when building most .c files.  percpu.h includes slab.h which
      in turn includes gfp.h making everything defined by the two files
      universally available and complicating inclusion dependencies.
      
      percpu.h -> slab.h dependency is about to be removed.  Prepare for
      this change by updating users of gfp and slab facilities include those
      headers directly instead of assuming availability.  As this conversion
      needs to touch large number of source files, the following script is
      used as the basis of conversion.
      
        http://userweb.kernel.org/~tj/misc/slabh-sweep.py
      
      The script does the followings.
      
      * Scan files for gfp and slab usages and update includes such that
        only the necessary includes are there.  ie. if only gfp is used,
        gfp.h, if slab is used, slab.h.
      
      * When the script inserts a new include, it looks at the include
        blocks and try to put the new include such that its order conforms
        to its surrounding.  It's put in the include block which contains
        core kernel includes, in the same order that the rest are ordered -
        alphabetical, Christmas tree, rev-Xmas-tree or at the end if there
        doesn't seem to be any matching order.
      
      * If the script can't find a place to put a new include (mostly
        because the file doesn't have fitting include block), it prints out
        an error message indicating which .h file needs to be added to the
        file.
      
      The conversion was done in the following steps.
      
      1. The initial automatic conversion of all .c files updated slightly
         over 4000 files, deleting around 700 includes and adding ~480 gfp.h
         and ~3000 slab.h inclusions.  The script emitted errors for ~400
         files.
      
      2. Each error was manually checked.  Some didn't need the inclusion,
         some needed manual addition while adding it to implementation .h or
         embedding .c file was more appropriate for others.  This step added
         inclusions to around 150 files.
      
      3. The script was run again and the output was compared to the edits
         from #2 to make sure no file was left behind.
      
      4. Several build tests were done and a couple of problems were fixed.
         e.g. lib/decompress_*.c used malloc/free() wrappers around slab
         APIs requiring slab.h to be added manually.
      
      5. The script was run on all .h files but without automatically
         editing them as sprinkling gfp.h and slab.h inclusions around .h
         files could easily lead to inclusion dependency hell.  Most gfp.h
         inclusion directives were ignored as stuff from gfp.h was usually
         wildly available and often used in preprocessor macros.  Each
         slab.h inclusion directive was examined and added manually as
         necessary.
      
      6. percpu.h was updated not to include slab.h.
      
      7. Build test were done on the following configurations and failures
         were fixed.  CONFIG_GCOV_KERNEL was turned off for all tests (as my
         distributed build env didn't work with gcov compiles) and a few
         more options had to be turned off depending on archs to make things
         build (like ipr on powerpc/64 which failed due to missing writeq).
      
         * x86 and x86_64 UP and SMP allmodconfig and a custom test config.
         * powerpc and powerpc64 SMP allmodconfig
         * sparc and sparc64 SMP allmodconfig
         * ia64 SMP allmodconfig
         * s390 SMP allmodconfig
         * alpha SMP allmodconfig
         * um on x86_64 SMP allmodconfig
      
      8. percpu.h modifications were reverted so that it could be applied as
         a separate patch and serve as bisection point.
      
      Given the fact that I had only a couple of failures from tests on step
      6, I'm fairly confident about the coverage of this conversion patch.
      If there is a breakage, it's likely to be something in one of the arch
      headers which should be easily discoverable easily on most builds of
      the specific arch.
      Signed-off-by: NTejun Heo <tj@kernel.org>
      Guess-its-ok-by: NChristoph Lameter <cl@linux-foundation.org>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: Lee Schermerhorn <Lee.Schermerhorn@hp.com>
      5a0e3ad6
  3. 24 6月, 2009 1 次提交
    • B
      ide: relax DMA info validity checking · 346c17a6
      Bartlomiej Zolnierkiewicz 提交于
      There are some broken devices that report multiple DMA xfer modes
      enabled at once (ATA spec doesn't allow it) but otherwise work fine
      with DMA so just delete ide_id_dma_bug().
      
      [ As discovered by detective work by Frans and Bart, due to how
        handling of the ID block was handled before commit c4199930
        ("ide-iops: only clear DMA words on setting DMA mode") this
        check was always seeing zeros in the fields or other similar
        garbage.  Therefore this check wasn't actually checking anything.
        Now that the tests actually check the real bits, all we see are
        devices that trigger the check yet work perfectly fine, therefore
        killing this useless check is the best thing to do. -DaveM ]
      Reported-by: NFrans Pop <elendil@planet.nl>
      Signed-off-by: NBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      346c17a6
  4. 10 6月, 2009 1 次提交
  5. 11 5月, 2009 1 次提交
  6. 28 4月, 2009 1 次提交
  7. 21 4月, 2009 1 次提交
  8. 01 4月, 2009 10 次提交
  9. 27 3月, 2009 7 次提交
    • B
      ide: add ->dma_timer_expiry method and remove ->dma_exec_cmd one (v2) · 22117d6e
      Bartlomiej Zolnierkiewicz 提交于
      * Rename dma_timer_expiry() to ide_dma_sff_timer_expiry() and export it.
      
      * Add ->dma_timer_expiry method and use it to set hwif->expiry for
        ATA_PROT_DMA protocol in do_rw_taskfile().
      
      * Initialize ->dma_timer_expiry to ide_dma_sff_timer_expiry() for SFF hosts.
      
      * Move setting hwif->expiry from ide_execute_command() to its users and drop
        'expiry' argument.
      
      * Use ide_execute_command() instead of ->dma_exec_cmd in do_rw_taskfile().
      
      * Remove ->dma_exec_cmd method and its implementations.
      
      * Unexport ide_execute_command() and ide_dma_intr().
      
      v2:
      * Fix CONFIG_BLK_DEV_IDEDMA=n build (noticed by Randy Dunlap).
      
      * Fix *dma_expiry naming (suggested by Sergei Shtylyov).
      
      There should be no functional changes caused by this patch.
      
      Cc: Randy Dunlap <randy.dunlap@oracle.com>
      Cc: Sergei Shtylyov <sshtylyov@ru.mvista.com>
      Signed-off-by: NBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
      22117d6e
    • B
      ide: pass command to ide_map_sg() · 22981694
      Bartlomiej Zolnierkiewicz 提交于
      * Set IDE_TFLAG_WRITE flag and ->rq also for ATA_CMD_PACKET
        commands.
      
      * Pass command to ->dma_setup method and update all its
        implementations accordingly.
      
      * Pass command instead of request to ide_build_sglist(),
        *_build_dmatable() and ide_map_sg().
      
      While at it:
      
      * Fix scc_dma_setup() documentation + use ATA_DMA_WR define.
      
      * Rename sgiioc4_build_dma_table() to sgiioc4_build_dmatable(),
        change return value type to 'int' and drop unused 'ddir'
        argument.
      
      * Do some minor cleanups in [tx4939]ide_dma_setup().
      
      There should be no functional changes caused by this patch.
      Acked-by: NBorislav Petkov <petkovbb@gmail.com>
      Signed-off-by: NBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
      22981694
    • B
      ide: remove ide_end_request() · 130e8867
      Bartlomiej Zolnierkiewicz 提交于
      * Add ide_rq_bytes() helper.
      
      * Add blk_noretry_request() quirk to ide_complete_rq() (currently only fs
        requests can be marked as "noretry" so there is no change in behavior).
      
      * Switch current ide_end_request() users to use ide_complete_rq().
      
        [ No need to check for rq->nr_sectors == 0 in {ide_dma,task_pio}_intr(),
          nsectors == 0 in cdrom_end_request() and err == 0 in ide_do_devset(). ]
      
      * Remove no longer needed ide_end_request().
      
      There should be no functional changes caused by this patch.
      Signed-off-by: NBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
      130e8867
    • B
      ide: sanitize ide_finish_cmd() · 2230d90d
      Bartlomiej Zolnierkiewicz 提交于
      * Move ide_end_request() call out from ide_finish_cmd() to its users.
      
      * Use ide_finish_cmd() in task_no_data_intr().
      
      There should be no functional changes caused by this patch.
      Signed-off-by: NBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
      2230d90d
    • B
      ide: move command related fields from ide_hwif_t to struct ide_cmd · b6308ee0
      Bartlomiej Zolnierkiewicz 提交于
      * Move command related fields from ide_hwif_t to struct ide_cmd.
      
      * Make ide_init_sg_cmd() take command and sectors number as arguments.
      
      There should be no functional changes caused by this patch.
      Signed-off-by: NBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
      b6308ee0
    • B
      ide: pass command instead of request to ide_pio_datablock() · adb1af98
      Bartlomiej Zolnierkiewicz 提交于
      * Add IDE_TFLAG_FS taskfile flag and set it for REQ_TYPE_FS requests.
      
      * Convert ->{in,out}put_data methods to take command instead of request
        as an argument.  Then convert pre_task_out_intr(), task_end_request(),
        task_error(), task_in_unexpected(), ide_pio_sector(), ide_pio_multi()
        and ide_pio_datablock() in similar way.
      
      * Rename task_end_request() to ide_finish_cmd().
      
      There should be no functional changes caused by this patch.
      Signed-off-by: NBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
      adb1af98
    • B
      ide: call ide_build_sglist() prior to ->dma_setup (v2) · e6830a86
      Bartlomiej Zolnierkiewicz 提交于
      * Re-map sg table if needed in ide_build_sglist().
      
      * Move ide_build_sglist() call from ->dma_setup to its users.
      
      * Un-export ide_build_sglist().
      
      v2:
      * Build fix for CONFIG_BLK_DEV_IDEDMA=n (noticed by Randy Dunlap).
      
      There should be no functional changes caused by this patch.
      
      Cc: Randy Dunlap <randy.dunlap@oracle.com>
      Signed-off-by: NBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
      e6830a86
  10. 25 3月, 2009 1 次提交
  11. 14 3月, 2009 1 次提交
  12. 07 1月, 2009 1 次提交
  13. 14 10月, 2008 12 次提交
  14. 11 10月, 2008 1 次提交
    • B
      ide: use ATA_* defines instead of *_STAT and *_ERR ones · 3a7d2484
      Bartlomiej Zolnierkiewicz 提交于
      * ERR_STAT   -> ATA_ERR
      * INDEX_STAT -> ATA_IDX
      * ECC_STAT   -> ATA_CORR
      * DRQ_STAT   -> ATA_DRQ
      * SEEK_STAT  -> ATA_DSC
      * WRERR_STAT -> ATA_DF
      * READY_STAT -> ATA_DRDY
      * BUSY_STAT  -> ATA_BUSY
      
      * MARK_ERR   -> ATA_AMNF
      * TRK0_ERR   -> ATA_TRK0NF
      * ABRT_ERR   -> ATA_ABORTED
      * MCR_ERR    -> ATA_MCR
      * ID_ERR     -> ATA_IDNF
      * MC_ERR     -> ATA_MC
      * ECC_ERR    -> ATA_UNC
      * ICRC_ERR   -> ATA_ICRC
      
      * BBD_ERR    -> ATA_BBK
      
      Also:
      
      * ILI_ERR    -> ATAPI_ILI
      * EOM_ERR    -> ATAPI_EOM
      * LFS_ERR    -> ATAPI_LFS
      
      * CD         -> ATAPI_COD
      * IO         -> ATAPI_IO
      Signed-off-by: NBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
      3a7d2484