1. 02 1月, 2009 1 次提交
    • B
      ide: don't execute the next queued command from the hard-IRQ context (v2) · 295f0004
      Bartlomiej Zolnierkiewicz 提交于
      * Tell the block layer that we are not done handling requests by using
        blk_plug_device() in ide_do_request() (request handling function)
        and ide_timer_expiry() (timeout handler) if the queue is not empty.
      
      * Remove optimization which directly calls ide_do_request() for the next
        queued command from the ide_intr() (IRQ handler) and ide_timer_expiry().
      
      * Remove no longer needed IRQ masking from ide_do_request() - in case of
        IDE ports needing serialization disable_irq_nosync()/enable_irq() was
        used for the (possibly shared) IRQ of the other IDE port.
      
      * Put the misplaced comment in the right place in ide_do_request().
      
      * Drop no longer needed 'int masked_irq' argument from ide_do_request().
      
      * Merge ide_do_request() into do_ide_request().
      
      * Remove no longer needed IDE_NO_IRQ define.
      
      While at it:
      
      * Don't use HWGROUP() macro in do_ide_request().
      
      * Use __func__ in ide_intr().
      
      This patch reduces IRQ hadling latency for IDE and improves the system-wide
      handling of shared IRQs (which should result in more timeout resistant and
      stable IDE systems).  It also makes it possible to do some further changes
      later (i.e. replace some busy-waiting delays with sleeping equivalents).
      
      v2:
      Changes per review from Elias Oltmanns:
      - fix wrong goto statement in 'if (startstop == ide_stopped)' block
      - use spin_unlock_irq()
      - don't use obsolete HWIF() macro
      
      Cc: Elias Oltmanns <eo@nebensachen.de>
      Signed-off-by: NBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
      295f0004
  2. 30 12月, 2008 11 次提交
  3. 09 12月, 2008 1 次提交
  4. 03 12月, 2008 3 次提交
  5. 17 10月, 2008 1 次提交
  6. 14 10月, 2008 9 次提交
    • E
      ide: Implement disk shock protection support (v4) · 4abdc6ee
      Elias Oltmanns 提交于
      On user request (through sysfs), the IDLE IMMEDIATE command with UNLOAD
      FEATURE as specified in ATA-7 is issued to the device and processing of
      the request queue is stopped thereafter until the specified timeout
      expires or user space asks to resume normal operation. This is supposed
      to prevent the heads of a hard drive from accidentally crashing onto the
      platter when a heavy shock is anticipated (like a falling laptop expected
      to hit the floor). Port resets are deferred whenever a device on that
      port is in the parked state.
      
      v3:
      Elias Oltmanns <eo@nebensachen.de> wrote:
      [...]
      > >> 1. Make sure that no negative value is being passed to
      > >>    jiffies_to_msecs() in ide_park_show().
      > >> 2. Drop the superfluous variable hwif in ide_special_rq().
      > >> 3. Skip initialisation of task and tf in ide_special_rq() if we are not
      > >>    handling a (un)park request.
      > >
      > > Well, #3 should have been done differently because we donn't want to
      > > check for REQ_(UN)?PARK_HEADS more often than is necessary.
      > 
      > While preparing the backport to 2.6.27, it has just occurred to me that
      > we need to clear the IDE_DFLAG_PARKED flag in ide_disk_pre_reset()
      > because this flag must not be set after *any* sort of access to the
      > device.
      
      v4:
      Fix a memory leak due to a missing blk_put_request() in
      issue_park_cmd(). Additionally, we should plug the queue when enqueueing
      the unpark request because there is no guarantee that the park timeout
      has not expired by then. Even though the chance for that to happen is
      very slim, the request might end up hanging in the queue until the next
      I/O operation is queued up. While at it, clean up the code a little:
      - make issue_park_cmd() a function of type void since nobody cares for
        the return value anyway;
      - use blk_start_queueing() instead of __blk_run_queue() since we don't
        have to worry about recursion;
      - remove a superfluous pointer deference in task_no_data_intr().
      Signed-off-by: NElias Oltmanns <eo@nebensachen.de>
      Cc: Jeff Garzik <jeff@garzik.org>,
      Cc: Randy Dunlap <randy.dunlap@oracle.com>
      Cc: Tejun Heo <htejun@gmail.com>
      Signed-off-by: NBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
      4abdc6ee
    • E
      ide: Two fixes regarding memory allocation · e415e495
      Elias Oltmanns 提交于
      In function ide_devset_execute() we should use __GFP_WAIT rather than
      GFP_KERNEL. Also, the allocation cannot possibly fail at that point.
      More importantly, there is a potential memory leak in the device probing
      code. The infrastructure seems rather complex and I hope I haven't messed
      anything up by trying to fix this.
      Signed-off-by: NElias Oltmanns <eo@nebensachen.de>
      [bart: remove superfluous ide_lock taking]
      Signed-off-by: NBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
      e415e495
    • B
      ide: ->ide_dma_clear_irq() -> ->clear_irq() · bfa7d8e5
      Bartlomiej Zolnierkiewicz 提交于
      * Rename ->ide_dma_clear_irq method to ->clear_irq
        and move it from ide_hwif_t to struct ide_port_ops.
      
      * Move ->waiting_for_dma check inside ->clear_irq method.
      
      * Move ->dma_base check inside ->clear_irq method.
      
      piix.c:
      * Add ich_port_ops and remove init_hwif_ich() wrapper.
      
      There should be no functional changes caused by this patch.
      Acked-by: NSergei Shtylyov <sshtylyov@ru.mvista.com>
      Signed-off-by: NBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
      bfa7d8e5
    • B
      ide: convert 'pio_mode' device setting to use DS_SYNC flag · 6982daf7
      Bartlomiej Zolnierkiewicz 提交于
      * Convert 'pio_mode' device setting to use DS_SYNC flag.
      
      * Remove unused special_t.b.{set_tune,serviced} and ide_drive_t.tune_req.
      Signed-off-by: NBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
      6982daf7
    • B
      ide: remove [ata_]select_t · 7f612f27
      Bartlomiej Zolnierkiewicz 提交于
      * Use 'drive->dn & 1' in ide_init_disk().
      
      * remove [ata_]select_t.
      
      While at it:
      
      * Use ATA_DEVICE_OBS define in ide_port_init_devices_data().
      Acked-by: NSergei Shtylyov <sshtylyov@ru.mvista.com>
      Signed-off-by: NBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
      7f612f27
    • B
      ide: sanitize ide*_pm_* enums · 0d346ba0
      Bartlomiej Zolnierkiewicz 提交于
      * Move ide*_pm_* enums from ide-io.c to <linux/ide.h>.
      
      * idedisk_pm_* -> ide_pm_*
      
      * ide_pm_state_* -> ide_pm_*
      
      * No need to set ide_pm_* enums to the fixed values.
      
      * Uppercase ide_pm_* enums.
      
      * Fix/update comments.
      Signed-off-by: NBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
      0d346ba0
    • B
      ide: fix HDIO_DRIVE_TASK[FILE] ioctls for CHS commands on LBA devices · d1d76714
      Bartlomiej Zolnierkiewicz 提交于
      Add IDE_DFLAG_LBA device flag and use it instead of ->select.b.lba.
      
      Since ->tf_load uses ->select.all for ATA Device/Head register this
      fixes HDIO_DRIVE_TASK[FILE] ioctls for CHS commands on LBA devices.
      Signed-off-by: NBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
      d1d76714
    • B
      ide: DMA_PIO_RETRY -> IDE_DFLAG_DMA_PIO_RETRY · c3922048
      Bartlomiej Zolnierkiewicz 提交于
      Add IDE_DFLAG_DMA_PIO_RETRY and use it instead of
      ide_drive_t.state + DMA_PIO_RETRY.
      
      There should be no functional changes cause by this patch.
      Signed-off-by: NBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
      c3922048
    • B
      ide: add device flags · 97100fc8
      Bartlomiej Zolnierkiewicz 提交于
      Add 'unsigned long dev_flags' to ide_drive_t and convert bitfields
      to IDE_DFLAG_* flags.
      
      While at it:
      - IDE_DFLAG_ADDRESSING -> IDE_DFLAG_LBA48
      - fixup some comments
      - remove needless g->flags zeroing from ide*_probe()
      
      There should be no functional changes caused by this patch.
      Signed-off-by: NBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
      97100fc8
  7. 11 10月, 2008 8 次提交
  8. 24 7月, 2008 4 次提交
    • B
      ide: add struct ide_tp_ops (take 2) · 374e042c
      Bartlomiej Zolnierkiewicz 提交于
      * Add struct ide_tp_ops for transport methods.
      
      * Add 'const struct ide_tp_ops *tp_ops' to struct ide_port_info
        and ide_hwif_t.
      
      * Set the default hwif->tp_ops in ide_init_port_data().
      
      * Set host driver specific hwif->tp_ops in ide_init_port().
      
      * Export ide_exec_command(), ide_read_status(), ide_read_altstatus(),
        ide_read_sff_dma_status(), ide_set_irq(), ide_tf_{load,read}()
        and ata_{in,out}put_data().
      
      * Convert host drivers and core code to use struct ide_tp_ops.
      
      * Remove no longer needed default_hwif_transport().
      
      * Cleanup ide_hwif_t from methods that are now in struct ide_tp_ops.
      
      While at it:
      
      * Use struct ide_port_info in falconide.c and q40ide.c.
      
      * Rename ata_{in,out}put_data() to ide_{in,out}put_data().
      
      v2:
      
      * Fix missing convertion in ns87415.c.
      
      There should be no functional changes caused by this patch.
      Signed-off-by: NBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
      374e042c
    • B
      ide: add ->set_irq method · 6e6afb3b
      Bartlomiej Zolnierkiewicz 提交于
      Add ->set_irq method for setting nIEN bit of ATA Device Control
      register and use it instead of ide_set_irq().
      
      While at it:
      
      * Use ->set_irq in init_irq() and do_reset1().
      
      * Don't use HWIF() macro in ide_check_pm_state().
      
      There should be no functional changes caused by this patch.
      Signed-off-by: NBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
      6e6afb3b
    • B
      ide: add ->read_status method · b73c7ee2
      Bartlomiej Zolnierkiewicz 提交于
      * Remove ide_read_status() inline helper.
      
      * Add ->read_status method for reading ATA Status register
        and use it instead of ->INB.
      
      While at it:
      
      * Don't use HWGROUP() macro.
      
      There should be no functional changes caused by this patch.
      Signed-off-by: NBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
      b73c7ee2
    • B
      ide: add ->exec_command method · c6dfa867
      Bartlomiej Zolnierkiewicz 提交于
      Add ->exec_command method for writing ATA Command register
      and use it instead of ->OUTBSYNC.
      
      There should be no functional changes caused by this patch.
      Signed-off-by: NBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
      c6dfa867
  9. 17 7月, 2008 2 次提交