1. 06 Jan, 2009 8 commits
  2. 02 Jan, 2009 6 commits
  3. 29 Dec, 2008 10 commits
  4. 02 Dec, 2008 1 commit
  5. 17 Oct, 2008 1 commit
  6. 16 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: set IDE_AFLAG_DRQ_INTERRUPT in do_identify() · 4ab3d502
      Bartlomiej Zolnierkiewicz authored
      
      
      Set IDE_AFLAG_DRQ_INTERRUPT in do_identify() instead of ATAPI
      device drivers *_setup() methods.
      
      While at it:
      - use ata_id_cdb_intr()
      
      There should be no functional changes caused by this patch.
      
      Cc: Borislav Petkov <petkovbb@gmail.com>
      Signed-off-by: default avatarBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
      4ab3d502
    • Bartlomiej Zolnierkiewicz's avatar
      ide: remove ide_host_alloc_all() · a36223b0
      Bartlomiej Zolnierkiewicz authored
      
      
      * Remove no longer used ide_host_alloc_all().
      
      * Add MAX_HOST_PORTS define and use it instead of MAX_HWIFS
        as the maximum number of host ports possible.
      
      Signed-off-by: default avatarBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
      a36223b0
    • 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: use 'drive->dn & 1' instead of drive->select.b.unit · 123995b9
      Bartlomiej Zolnierkiewicz authored
      
      
      * Call ide_port_init_devices() in ide_host_register()
        also if 'struct ide_port_info *d' is not available.
      
      * Init drive->dn in ide_port_init_devices() instead of
        ide_probe_port() so it is valid also in ->init_dev.
      
      * Pass device number to ide_dev_apply_params().
      
      * Use 'drive->dn & 1' instead of drive->select.b.unit.
      
      There should be no functional changes caused by this patch.
      
      Signed-off-by: default avatarBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
      123995b9
    • Bartlomiej Zolnierkiewicz's avatar
      ide: add device flags · 97100fc8
      Bartlomiej Zolnierkiewicz authored
      
      
      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: default avatarBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
      97100fc8
    • Bartlomiej Zolnierkiewicz's avatar
      ide: remove unnecessary MAX_HWIFS checks from ide-probe.c · 75d21fff
      Bartlomiej Zolnierkiewicz authored
      
      
      MAX_HWIFS is now always equal to the number of IDE major numbers.
      
      Signed-off-by: default avatarBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
      75d21fff
  8. 10 Oct, 2008 5 commits
    • Bartlomiej Zolnierkiewicz's avatar
      ide: add proper PCI PM support (v2) · feb22b7f
      Bartlomiej Zolnierkiewicz authored
      
      
      * Keep pointer to ->init_chipset method also in
        struct ide_host and set it in ide_host_alloc_all().
      
      * Add ide_pci_suspend() and ide_pci_resume() helpers
        (default ->suspend and ->resume implementations).
      
      * ->init_chipset can no longer be marked __devinit.
      
      * Add proper PCI PM support to IDE PCI host drivers
        (rz1000.c and tc86c001.c are skipped for now since
        they need to be converted from using ->init_hwif
        to use ->init_chipset instead).
      
      v2:
      * Cleanup CONFIG_PM #ifdef-s per akpm's suggestion.
      
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Cc: "Rafael J. Wysocki" <rjw@sisk.pl>
      Signed-off-by: default avatarBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
      feb22b7f
    • Bartlomiej Zolnierkiewicz's avatar
      ide: use ata_id_is_cfa() · 718c72e8
      Bartlomiej Zolnierkiewicz authored
      
      
      Use ata_id_is_cfa() in do_identify() instead of open-coding
      check for CompactFlash devices (the inline helper also takes
      care of detecting CFs advertising themselves as ATA disks).
      
      Signed-off-by: default avatarBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
      718c72e8
    • Bartlomiej Zolnierkiewicz's avatar
      ide: remove SECTOR_WORDS define · 151a6701
      Bartlomiej Zolnierkiewicz authored
      
      
      Just use SECTOR_SIZE instead.
      
      Signed-off-by: default avatarBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
      151a6701
    • Bartlomiej Zolnierkiewicz's avatar
      ide: /proc/ide/hd*/settings rework · 8185d5aa
      Bartlomiej Zolnierkiewicz authored
      
      
      * Add struct ide_devset, S_* flags, *DEVSET() & ide*_devset_*() macros.
      
      * Add 'const struct ide_devset **settings' to ide_driver_t.
      
      * Use 'const struct ide_devset **settings' in ide_drive_t instead of
        'struct ide_settings_s *settings'.  Then convert core code and device
        drivers to use struct ide_devset and co.:
      
        - device settings are no longer allocated dynamically for each device
          but instead there is an unique struct ide_devset instance per setting
      
        - device driver keeps the pointer to the table of pointers to its
          settings in ide_driver_t.settings
      
        - generic settings are kept in ide_generic_setting[]
      
        - ide_proc_[un]register_driver(), ide_find_setting_by_name(),
          ide_{read,write}_setting() and proc_ide_{read,write}_settings()
          are updated accordingly
      
        - ide*_add_settings() are removed
      
      * Remove no longer used __ide_add_setting(), ide_add_setting(),
        __ide_remove_setting() and auto_remove_settings().
      
      * Remove no longer used TYPE_*, SETTING_*, ide_procset_t
        and ide_settings_t.
      
      * ->keep_settings, ->using_dma, ->unmask, ->noflush, ->dsc_overlap,
        ->nice1, ->addressing, ->wcache and ->nowerr ide_drive_t fields
        can now be bitfield flags.
      
      While at it:
      
      * Rename ide_find_setting_by_name() to ide_find_setting().
      
      * Rename write_wcache() to set_wcache().
      
      There should be no functional changes caused by this patch.
      
      Signed-off-by: default avatarBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
      8185d5aa
    • Bartlomiej Zolnierkiewicz's avatar
      ide: remove CONFIG_IDEDISK_MULTI_MODE · 7c51c17e
      Bartlomiej Zolnierkiewicz authored
      
      
      Use multi PIO by default when available and remove no longer
      needed CONFIG_IDEDISK_MULTI_MODE (it should be safe nowadays,
      despite to what help entry has been saying).
      
      Signed-off-by: default avatarBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
      7c51c17e