1. 16 7月, 2008 2 次提交
    • B
      ide: use __generic_unplug_device() in ide_do_drive_cmd() (take 2) · c6866a6f
      Bartlomiej Zolnierkiewicz 提交于
      * Call __elv_add_request() with 'plug' == 1 (so the device will be
        plugged) and then use __generic_unplug_device() instead of calling
        ide_do_request() directly.
      
      v2:
      * For blk_pm_resume_request() requests the queue is stopped so we
        need to call ->request_fn explicitly.
      
        Thanks to:
        - Rafael for reporting/bisecting the bug
        - Borislav/Rafael for testing the fix
      
      This is a preparation for converting IDE to use blk_execute_rq().
      
      Cc: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
      Cc: Borislav Petkov <petkovbb@gmail.com>
      Cc: Jens Axboe <jens.axboe@oracle.com>
      Cc: "Rafael J. Wysocki" <rjw@sisk.pl>
      Signed-off-by: NBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
      c6866a6f
    • B
      ide: set REQ_PREEMPT request flag in ide_do_drive_cmd() users · e8a96aa7
      Bartlomiej Zolnierkiewicz 提交于
      * Set REQ_PREEMPT request flag in ide_do_drive_cmd() users
        for ide_preempt and ide_head_wait action types.
      
      * Remove setting REQ_PREEMPT from ide_do_drive_cmd().
      
      While at it:
      
      * Set 'where' variable outside ide_lock.
      
      This is a preparation for converting IDE to use blk_execute_rq().
      
      There should be no functional changes caused by this patch.
      
      Cc: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
      Cc: Borislav Petkov <petkovbb@gmail.com>
      Cc: Jens Axboe <jens.axboe@oracle.com>
      Signed-off-by: NBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
      e8a96aa7
  2. 29 4月, 2008 8 次提交
  3. 27 4月, 2008 3 次提交
    • B
      ide: add struct ide_io_ports (take 3) · 4c3032d8
      Bartlomiej Zolnierkiewicz 提交于
      * Add struct ide_io_ports and use it instead of `unsigned long io_ports[]`
        in ide_hwif_t.
      
      * Rename io_ports[] in hw_regs_t to io_ports_array[].
      
      * Use un-named union for 'unsigned long io_ports_array[]' and 'struct
        ide_io_ports io_ports' in hw_regs_t.
      
      * Remove IDE_*_OFFSET defines.
      
      v2:
      * scc_pata.c build fix from Stephen Rothwell.
      
      v3:
      * Fix ctl_adrr typo in Sparc-specific part of ns87415.c.
        (Noticed by Andrew Morton)
      Signed-off-by: NBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
      4c3032d8
    • B
      ide: add struct ide_dma_ops (take 3) · 5e37bdc0
      Bartlomiej Zolnierkiewicz 提交于
      Add struct ide_dma_ops and convert core code + drivers to use it.
      
      While at it:
      
      * Drop "ide_" prefix from ->ide_dma_end and ->ide_dma_test_irq methods.
      
      * Drop "ide_" "infixes" from DMA methods.
      
      * au1xxx-ide.c:
        - use auide_dma_{test_irq,end}() directly in auide_dma_timeout()
      
      * pdc202xx_old.c:
        - drop "old_" "infixes" from DMA methods
      
      * siimage.c:
        - add siimage_dma_test_irq() helper
        - print SATA warning in siimage_init_one()
      
      * Remove no longer needed ->init_hwif implementations.
      
      v2:
      * Changes based on review from Sergei:
        - s/siimage_ide_dma_test_irq/siimage_dma_test_irq/
        - s/drive->hwif/hwif/ in idefloppy_pc_intr().
        - fix patch description w.r.t. au1xxx-ide changes
        - fix au1xxx-ide build
        - fix naming for cmd64*_dma_ops
        - drop "ide_" and "old_" infixes
        - s/hpt3xxx_dma_ops/hpt37x_dma_ops/
        - s/hpt370x_dma_ops/hpt370_dma_ops/
        - use correct DMA ops for HPT302/N, HPT371/N and HPT374
        - s/it821x_smart_dma_ops/it821x_pass_through_dma_ops/
      
      v3:
      * Two bugs slipped in v2 (noticed by Sergei):
        - use correct DMA ops for HPT374 (for real this time)
        - handle HPT370/HPT370A properly
      Acked-by: NSergei Shtylyov <sshtylyov@ru.mvista.com>
      Signed-off-by: NBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
      5e37bdc0
    • B
      ide: add struct ide_port_ops (take 2) · ac95beed
      Bartlomiej Zolnierkiewicz 提交于
      * Move hooks for port/host specific methods from ide_hwif_t to
        'struct ide_port_ops'.
      
      * Add 'const struct ide_port_ops *port_ops' to 'struct ide_port_info'
        and ide_hwif_t.
      
      * Update host drivers and core code accordingly.
      
      While at it:
      
      * Rename ata66_*() cable detect functions to *_cable_detect() to match
        the standard naming. (Suggested by Sergei Shtylyov)
      
      v2:
      * Fix build for bast-ide. (Noticed by Andrew Morton)
      Acked-by: NSergei Shtylyov <sshtylyov@ru.mvista.com>
      Signed-off-by: NBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
      ac95beed
  4. 26 4月, 2008 1 次提交
  5. 18 4月, 2008 1 次提交
  6. 11 2月, 2008 2 次提交
    • B
      ide-disk: fix flush requests (take 2) · 395d8ef5
      Bartlomiej Zolnierkiewicz 提交于
      commit 813a0eb2
      Author: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
      Date:   Fri Jan 25 22:17:10 2008 +0100
      
          ide: switch idedisk_prepare_flush() to use REQ_TYPE_ATA_TASKFILE requests
      
      ...
      
      broke flush requests.
      
      Allocating IDE command structure on the stack for flush requests is not
      a very brilliant idea:
      
      - idedisk_prepare_flush() only prepares the request and it doesn't wait
        for it to be completed
      
      - there are can be multiple flush requests queued in the queue
      
      Fix the problem (per hints from James Bottomley) by:
      - dynamically allocating ide_task_t instance using kmalloc(..., GFP_ATOMIC)
      - adding new taskfile flag (IDE_TFLAG_DYN)
      - calling kfree() in ide_end_drive_command() if IDE_TFLAG_DYN is set
        (while at it rename 'args' to 'task' and fix whitespace damage)
      
      [ This will be fixed properly before 2.6.25 but this bug is rather
        critical and the proper solution requires some more work + testing. ]
      
      Thanks to Sebastian Siewior and Christoph Hellwig for reporting the
      problem and testing patches (extra thanks to Sebastian for bisecting
      it to the guilty commmit).
      Tested-by: NSebastian Siewior <ide-bug@ml.breakpoint.cc>
      Cc: Christoph Hellwig <hch@infradead.org>
      Cc: James Bottomley <James.Bottomley@HansenPartnership.com>
      Cc: Jens Axboe <jens.axboe@oracle.com>
      Cc: Tejun Heo <htejun@gmail.com>
      Cc: Sergei Shtylyov <sshtylyov@ru.mvista.com>
      Signed-off-by: NBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
      395d8ef5
    • K
      ide: another possible ide panic fix for blk-end-request · 3b0e044d
      Kiyoshi Ueda 提交于
      I have reviewed all blk-end-request patches again to confirm whether
      there are any similar problems with the last week's ide-cd panic:
          http://lkml.org/lkml/2008/1/29/140
      
      And I found a possible similar bug in ide-io change:
      ide_end_drive_cmd() could be called for blk_pc_request() which could
      have bios.  To complete such requests correctly, we need to pass
      the actual size of the request.
      Otherwise, __blk_end_request() returns 1 because the request still has
      bios, and the system will BUG() unnecessarily.
      
      The following patch fixes the bug and should be applied on top of
      Linus' git.
      Signed-off-by: NKiyoshi Ueda <k-ueda@ct.jp.nec.com>
      Signed-off-by: NJun'ichi Nomura <j-nomura@ce.jp.nec.com>
      Cc: Borislav Petkov <petkovbb@googlemail.com>
      Cc: Jens Axboe <jens.axboe@oracle.com>
      Signed-off-by: NBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
      3b0e044d
  7. 06 2月, 2008 2 次提交
  8. 02 2月, 2008 1 次提交
  9. 28 1月, 2008 1 次提交
    • K
      blk_end_request: changing ide normal caller (take 4) · 5e36bb6e
      Kiyoshi Ueda 提交于
      This patch converts "normal" parts of ide to use blk_end_request
      interfaces.  Related 'uptodate' arguments are converted to 'error'.
      
      The conversion of 'uptodate' to 'error' is done only for the internal
      function, __ide_end_request().
      ide_end_request() was not changed since it's exported and used
      by many ide drivers.
      
      With this patch, blkdev_dequeue_request() in __ide_end_request() is
      moved to blk_end_request, since blk_end_request takes care of
      dequeueing request like below:
      
      	if (!list_empty(&rq->queuelist))
      		blkdev_dequeue_request(rq);
      
      In the case of ide,
        o 'dequeue' variable of __ide_end_request() is 1 only when the request
          is still linked to the queue (i.e. rq->queuelist is not empty)
        o 'dequeue' variable of __ide_end_request() is 0 only when the request
          has already been removed from the queue (i.e. rq->queuelist is empty)
      So blk_end_request can handle it correctly although ide always run
      thought the code above.
      
      Cc: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
      Signed-off-by: NKiyoshi Ueda <k-ueda@ct.jp.nec.com>
      Signed-off-by: NJun'ichi Nomura <j-nomura@ce.jp.nec.com>
      Signed-off-by: NJens Axboe <jens.axboe@oracle.com>
      5e36bb6e
  10. 27 1月, 2008 11 次提交
  11. 26 1月, 2008 8 次提交
    • B
      ide: cleanup ide_set_dma() · 7b905994
      Bartlomiej Zolnierkiewicz 提交于
      * ->dma_off_quietly is always called before ide_set_dma()
        so the call can be moved inside ide_set_dma().
      
      * ide_dma_check() doesn't touch hardware so ->dma_off_quietly
        call for 'rc == -1' case is redundant, remove it.
      
      * '0' and '-1' are the only values returned by ide_dma_check()
        so remove dead code for other cases.
      
      There should be no functionality changes caused by this patch.
      Acked-by: NSergei Shtylyov <sshtylyov@ru.mvista.com>
      Signed-off-by: NBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
      7b905994
    • B
      ide: add ide_tf_read() helper · c2b57cdc
      Bartlomiej Zolnierkiewicz 提交于
      * Factor out code reading taskfile registers from ide_end_drive_cmd()
        to the new ide_tf_read() helper.
      
      * Add IDE_TFLAG_IN_* taskfile flags to indicate the need to load
        particular IDE taskfile register in ide_tf_read().
      
      * Update ide_end_drive_cmd() to set respective IDE_TFLAG_IN_* taksfile flags.
      
      * Add ide_get_lba_addr() for getting LBA sector address from taskfile struct.
      
      * Factor out code getting sector address from ide_dump_ata_status()
        to the new ide_dump_sector() function.
      
      * Convert ide_dump_sector() to use ide_tf_read() and ide_get_lba_addr().
      
      * Remove no longer needed ide_read_24().
      
      The only change in functionality caused by this patch is that
      ide_dump_ata_status() no longer prints "high"/"low" parts of LBA48
      sector address (of course LBA48 sector address is still printed).
      
      Cc: Sergei Shtylyov <sshtylyov@ru.mvista.com>
      Signed-off-by: NBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
      c2b57cdc
    • B
      ide: remove 'handler' field from ide_task_t (take 2) · 57d7366b
      Bartlomiej Zolnierkiewicz 提交于
      * Add IDE_TFLAG_CUSTOM_HANDLER taskfile flag and use it for internal requests
        which require custom handlers.  Check the flag in do_rw_taskfile() and set
        handler accordingly.
      
      * Cleanup ide_init_{specify,restore,setmult}_cmd() and rename it to
        ide_tf_set_{specify,restore,setmult}_cmd().
      
      * Make {set_geometry,recal,set_multmode}_intr() static.
      
      * Remove no longer needed 'handler' field from ide_task_t.
      
      v2:
      * 'handler' in do_rw_taskfile() must be set to NULL initially.
      
      There should be no functionality changes caused by this patch.
      Acked-by: NSergei Shtylyov <sshtylyov@ru.mvista.com>
      Signed-off-by: NBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
      57d7366b
    • B
      ide: use ->data_phase to set ->handler in do_rw_taskfile() · 1192e528
      Bartlomiej Zolnierkiewicz 提交于
      * Use ->data_phase to set ->handler in do_rw_taskfile() instead of
        setting ->handler in callers of ide_raw_taskfile()/do_rw_taskfile().
      
      * Unexport task_no_data_intr() and make it static.
      
      There should be no functionality changes caused by this patch.
      Acked-by: NSergei Shtylyov <sshtylyov@ru.mvista.com>
      Signed-off-by: NBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
      1192e528
    • B
      ide: merge flagged_taskfile() into do_rw_taskfile() · 1edee60e
      Bartlomiej Zolnierkiewicz 提交于
      Based on the earlier work by Tejun Heo.
      
      task->data_phase == TASKFILE_MULTI_{IN,OUT} vs drive->mult_count == 0
      check is needed also for ide_taskfile_ioctl() requests that don't have
      IDE_TFLAG_FLAGGED taskfile flag set.
      
      Cc: Tejun Heo <htejun@gmail.com>
      Acked-by: NSergei Shtylyov <sshtylyov@ru.mvista.com>
      Signed-off-by: NBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
      1edee60e
    • B
      ide: remove 'tf_in_flags' field from ide_task_t · 866e2ec9
      Bartlomiej Zolnierkiewicz 提交于
      * Add IDE_TFLAG_IN_DATA taskfile flag to indicate the need of reading
        IDE_DATA_REG in ide_end_drive_cmd().
      
        Set the new flag in ide_taskfile_ioctl() if ->in_flags.b.data is set.
      
      * Add IDE_TFLAG_FLAGGED_SET_IN_FLAGS taskfile flag to indicate the
        need of modifying ->in_flags in ide_taskfile_ioctl().
      
        Set the new flag in flagged_taskfile() and move the code modifying
        ->tf_in_flags to ide_taskfile_ioctl().
      
        While at it remove the bogus comment: ->tf_in_flags (except .b.data)
        have no effect on selection of registers to read.
      
      * Remove no longer needed 'tf_in_flags' field from ide_task_t.
      
      As the result we finally have the internals of HDIO_DRIVE_TASKFILE ioctl
      separated from the core IDE code.
      
      There should be no functionality changes caused by this patch.
      Acked-by: NSergei Shtylyov <sshtylyov@ru.mvista.com>
      Signed-off-by: NBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
      866e2ec9
    • B
      ide: remove 'command_type' field from ide_task_t · ac026ff2
      Bartlomiej Zolnierkiewicz 提交于
      * Add 'data_buf' and 'nsect' variables in ide_taskfile_ioctl()
        to cache data buffer pointer and number of sectors to transfer
        (this allows us to have only one ide_diag_taskfile() call).
      
      * Add IDE_TFLAG_WRITE taskfile flag and use it to check whether
        the REQ_RW request flag should be set.
      
      * Move ->command_type handling from ide_diag_taskfile() to
        ide_taskfile_ioctl() and use ->req_cmd instead of ->command_type.
      
      * Add 'nsect' parameter to ide_raw_taskfile().
      
      * Merge ide_diag_taskfile() into ide_raw_taskfile().
      
      * Initialize ->data_phase explicitly in idedisk_prepare_flush(),
        ide_start_power_step() and ide_disk_special().
      
      * Remove no longer needed 'command_type' field from ide_task_t.
      
      * Add #ifndef/#endif __KERNEL__ to <linux/hdreg.h> around no
        longer used by kernel IDE_DRIVE_TASK_* and TASKFILE_* defines.
      
      There should be no functionality changes caused by this patch.
      Acked-by: NSergei Shtylyov <sshtylyov@ru.mvista.com>
      Signed-off-by: NBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
      ac026ff2
    • B
      ide: remove hwif->intrproc · 7299a391
      Bartlomiej Zolnierkiewicz 提交于
      Given that:
      
      * hpt366.c::hpt3xx_intrproc() is the only user of hwif->intrproc
      
      * hpt366.c::hpt3xx_quirkproc() sets drive->quirk_list to 1 for quirky drives
        which is a value unique to hpt366 host driver
      
      we can remove hwif->intproc and just check for drive->quirk_list == 1
      in ide_do_request().
      Acked-by: NSergei Shtylyov <sshtylyov@ru.mvista.com>
      Signed-off-by: NBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
      7299a391