1. 06 Jan, 2009 10 commits
  2. 02 Jan, 2009 6 commits
    • Borislav Petkov's avatar
    • Bartlomiej Zolnierkiewicz's avatar
      ide: use per-device request queue locks (v2) · 201bffa4
      Bartlomiej Zolnierkiewicz authored
      
      
      * Move hack for flush requests from choose_drive() to do_ide_request().
      
      * Add ide_plug_device() helper and convert core IDE code from using
        per-hwgroup lock as a request lock to use the ->queue_lock instead.
      
      * Remove no longer needed:
        - choose_drive() function
        - WAKEUP() macro
        - 'sleeping' flag from ide_hwif_t
        - 'service_{start,time}' fields from ide_drive_t
      
      This patch results in much simpler and more maintainable code
      (besides being a scalability improvement).
      
      v2:
      * Fixes/improvements based on review from Elias:
        - take as many requests off the queue as possible
        - remove now redundant BUG_ON()
      
      Cc: Elias Oltmanns <eo@nebensachen.de>
      Signed-off-by: default avatarBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
      201bffa4
    • Bartlomiej Zolnierkiewicz's avatar
      ide: add ide_[un]lock_hwgroup() helpers · 631de370
      Bartlomiej Zolnierkiewicz authored
      
      
      Add ide_[un]lock_hwgroup() inline helpers for obtaining exclusive
      access to the given hwgroup and update the core code accordingly.
      
      [ This change besides making code saner results in more efficient
        use of ide_{get,release}_lock(). ]
      
      Cc: Michael Schmitz <schmitz@biophys.uni-duesseldorf.de>
      Cc: Geert Uytterhoeven <geert@linux-m68k.org>
      Cc: Elias Oltmanns <eo@nebensachen.de>
      Signed-off-by: default avatarBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
      631de370
    • Bartlomiej Zolnierkiewicz's avatar
      ide: remove "paranoia" checks for hwgroup->busy · b2cfb05a
      Bartlomiej Zolnierkiewicz authored
      
      
      Remove "paranoia" checks for hwgroup->busy from ide_timer_expiry()
      and ide_intr().  This is a preparation for future changes.
      
      Cc: Michael Schmitz <schmitz@biophys.uni-duesseldorf.de>
      Cc: Geert Uytterhoeven <geert@linux-m68k.org>
      Cc: Elias Oltmanns <eo@nebensachen.de>
      Signed-off-by: default avatarBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
      b2cfb05a
    • Bartlomiej Zolnierkiewicz's avatar
      ide: remove IDE PM hack from do_ide_request() · 2fb21150
      Bartlomiej Zolnierkiewicz authored
      
      
      We now tell block layer that there is still work to do using
      blk_plug_device() so hack for IDE Power Management can be removed
      (it was buggy for hwgroups having more than 4 devices anyway).
      Signed-off-by: default avatarBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
      2fb21150
    • Bartlomiej Zolnierkiewicz's avatar
      ide: don't execute the next queued command from the hard-IRQ context (v2) · 295f0004
      Bartlomiej Zolnierkiewicz authored
      
      
      * 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: default avatarBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
      295f0004
  3. 29 Dec, 2008 11 commits
  4. 08 Dec, 2008 1 commit
  5. 02 Dec, 2008 3 commits
  6. 17 Oct, 2008 1 commit
  7. 13 Oct, 2008 8 commits
    • Elias Oltmanns's avatar
      ide: Implement disk shock protection support (v4) · 4abdc6ee
      Elias Oltmanns authored
      
      
      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: default avatarElias 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: default avatarBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
      4abdc6ee
    • Elias Oltmanns's avatar
      ide: Two fixes regarding memory allocation · e415e495
      Elias Oltmanns authored
      
      
      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: default avatarElias Oltmanns <eo@nebensachen.de>
      [bart: remove superfluous ide_lock taking]
      Signed-off-by: default avatarBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
      e415e495
    • Bartlomiej Zolnierkiewicz's avatar
      ide: ->ide_dma_clear_irq() -> ->clear_irq() · bfa7d8e5
      Bartlomiej Zolnierkiewicz authored
      
      
      * 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: default avatarSergei Shtylyov <sshtylyov@ru.mvista.com>
      Signed-off-by: default avatarBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
      bfa7d8e5
    • Bartlomiej Zolnierkiewicz's avatar
      ide: convert 'pio_mode' device setting to use DS_SYNC flag · 6982daf7
      Bartlomiej Zolnierkiewicz authored
      
      
      * 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: default avatarBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
      6982daf7
    • Bartlomiej Zolnierkiewicz's avatar
      ide: remove [ata_]select_t · 7f612f27
      Bartlomiej Zolnierkiewicz authored
      
      
      * 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: default avatarSergei Shtylyov <sshtylyov@ru.mvista.com>
      Signed-off-by: default avatarBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
      7f612f27
    • Bartlomiej Zolnierkiewicz's avatar
      ide: sanitize ide*_pm_* enums · 0d346ba0
      Bartlomiej Zolnierkiewicz authored
      
      
      * 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: default avatarBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
      0d346ba0
    • Bartlomiej Zolnierkiewicz's avatar
      ide: fix HDIO_DRIVE_TASK[FILE] ioctls for CHS commands on LBA devices · d1d76714
      Bartlomiej Zolnierkiewicz authored
      
      
      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: default avatarBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
      d1d76714
    • Bartlomiej Zolnierkiewicz's avatar
      ide: DMA_PIO_RETRY -> IDE_DFLAG_DMA_PIO_RETRY · c3922048
      Bartlomiej Zolnierkiewicz authored
      
      
      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: default avatarBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
      c3922048