1. 10 Oct, 2008 7 commits
    • Bartlomiej Zolnierkiewicz's avatar
      ide: remove ->supports_dsc_overlap field from ide_driver_t · 02d599a3
      Bartlomiej Zolnierkiewicz authored
      * Use drive->media and drive->scsi to check if ->dsc_overlap
        can be set by HDIO_SET_NICE ioctl in generic_ide_ioctl().
      * Remove unused ->supports_dsc_overlap field from ide_driver_t.
      There should be no functional changes caused by this patch.
      Signed-off-by: default avatarBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
    • 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>
    • Bartlomiej Zolnierkiewicz's avatar
      ide: call ide_proc_register_driver() later · 1e874f44
      Bartlomiej Zolnierkiewicz authored
      Call ide_proc_register_driver() in ide*_setup() (just before
      ide*_add_settings() call) instead of in ->probe method.
      Despite being basically a preparation for /proc/ide/hd*/settings
      rework this is a nice cleanup in itself.
      Signed-off-by: default avatarBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
    • Bartlomiej Zolnierkiewicz's avatar
      ide: remove needless drive->present checks from device drivers · 2a924662
      Bartlomiej Zolnierkiewicz authored
      Remove needless drive->present checks from ->probe methods
      (device model takes care of that).
      Signed-off-by: default avatarBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
    • Bartlomiej Zolnierkiewicz's avatar
      ide: use ATA_* defines instead of *_STAT and *_ERR ones · 3a7d2484
      Bartlomiej Zolnierkiewicz authored
      * ERR_STAT   -> ATA_ERR
      * ECC_STAT   -> ATA_CORR
      * DRQ_STAT   -> ATA_DRQ
      * SEEK_STAT  -> ATA_DSC
      * WRERR_STAT -> ATA_DF
      * BUSY_STAT  -> ATA_BUSY
      * MARK_ERR   -> ATA_AMNF
      * TRK0_ERR   -> ATA_TRK0NF
      * MCR_ERR    -> ATA_MCR
      * ID_ERR     -> ATA_IDNF
      * MC_ERR     -> ATA_MC
      * ECC_ERR    -> ATA_UNC
      * ICRC_ERR   -> ATA_ICRC
      * BBD_ERR    -> ATA_BBK
      * ILI_ERR    -> ATAPI_ILI
      * EOM_ERR    -> ATAPI_EOM
      * LFS_ERR    -> ATAPI_LFS
      * CD         -> ATAPI_COD
      * IO         -> ATAPI_IO
      Signed-off-by: default avatarBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
    • Bartlomiej Zolnierkiewicz's avatar
      ide: make drive->id an union (take 2) · 4dde4492
      Bartlomiej Zolnierkiewicz authored
      Make drive->id an unnamed union so id can be accessed either by using
      'u16 *id' or 'struct hd_driveid *driveid'.  Then convert all existing
      drive->id users accordingly (using 'u16 *id' when possible).
      This is an intermediate step to make ide 'struct hd_driveid'-free.
      While at it:
      - Add missing KERN_CONTs in it821x.c.
      - Use ATA_ID_WORDS and ATA_ID_*_LEN defines.
      - Remove unnecessary checks for drive->id.
      - s/drive_table/table/ in ide_in_drive_list().
      - Cleanup ide_config_drive_speed() a bit.
      - s/drive1/dev1/ & s/drive0/dev0/ in ide_undecoded_slave().
      Fix typo in drivers/ide/ppc/pmac.c. (From Stephen Rothwell)
      There should be no functional changes caused by this patch.
      Signed-off-by: default avatarBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
    • Mark de Wever's avatar
      ide-tape: Buildfix when IDETAPE_DEBUG_LOG is set to 1. · 730616b2
      Mark de Wever authored
      The format specifier for rq->sector didn't specify the proper size and
      signedness. Borislav Petkov discovered that the signedness for
      rq->nr_sectors and rq->current_nr_sectors also were incorrect.
      Signed-off-by: default avatarMark de Wever <koraq@xs4all.nl>
      Acked-by: default avatarBorislav Petkov <petkovbb@gmail.com>
      [bart: remove trailing whitespace]
      Signed-off-by: default avatarBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
  2. 27 Sep, 2008 1 commit
  3. 05 Aug, 2008 1 commit
    • Bartlomiej Zolnierkiewicz's avatar
      ide: fix regression caused by ide_device_{get,put}() addition (take 2) · d3e33ff5
      Bartlomiej Zolnierkiewicz authored
      On Monday 28 July 2008, Benjamin Herrenschmidt wrote:
      > Vector: 300 (Data Access) at [c58b7b80]
      >     pc: c014f264: elv_may_queue+0x10/0x44
      >     lr: c0152750: get_request+0x2c/0x2c0
      >     sp: c58b7c30
      >    msr: 1032
      >    dar: c
      >  dsisr: 40000000
      >   current = 0xc58aaae0
      >     pid   = 854, comm = media-bay
      > enter ? for help
      > mon> t
      > [c58b7c40] c0152750 get_request+0x2c/0x2c0
      > [c58b7c70] c0152a08 get_request_wait+0x24/0xec
      > [c58b7cc0] c0225674 ide_cd_queue_pc+0x58/0x1a0
      > [c58b7d40] c022672c ide_cdrom_packet+0x9c/0xdc
      > [c58b7d70] c0261810 cdrom_get_disc_info+0x60/0xd0
      > [c58b7dc0] c026208c cdrom_mrw_exit+0x1c/0x11c
      > [c58b7e30] c0260f7c unregister_cdrom+0x84/0xe8
      > [c58b7e50] c022395c ide_cd_release+0x80/0x84
      > [c58b7e70] c0163650 kref_put+0x54/0x6c
      > [c58b7e80] c0223884 ide_cd_put+0x40/0x5c
      > [c58b7ea0] c0211100 generic_ide_remove+0x28/0x3c
      > [c58b7eb0] c01e9d34 __device_release_driver+0x78/0xb4
      > [c58b7ec0] c01e9e44 device_release_driver+0x28/0x44
      > [c58b7ee0] c01e8f7c bus_remove_device+0xac/0xd8
      > [c58b7f00] c01e7424 device_del+0x104/0x198
      > [c58b7f20] c01e74d0 device_unregister+0x18/0x30
      > [c58b7f40] c02121c4 __ide_port_unregister_devices+0x6c/0x88
      > [c58b7f60] c0212398 ide_port_unregister_devices+0x38/0x80
      > [c58b7f80] c0208ca4 media_bay_step+0x1cc/0x5c0
      > [c58b7fb0] c0209124 media_bay_task+0x8c/0xcc
      > [c58b7fd0] c00485c0 kthread+0x48/0x84
      > [c58b7ff0] c0011b20 kernel_thread+0x44/0x60
      The guilty commit turned out to be 08da591e
      ("ide: add ide_device_{get,put}() helpers").  ide_device_put() is called
      before kref_put() in ide_cd_put() so IDE device is already gone by the time
      ide_cd_release() is reached.
      Fix it by calling ide_device_get() before kref_get() and ide_device_put()
      after kref_put() in all affected device drivers.
      Brown paper bag time.  In v1 cd->drive was referenced after dropping last
      reference on cd object (which could result in OOPS in ide_device_put() as
      reported/debugged by Mariusz Kozlowski).  Fix it by caching cd->drive in
      the local variable (fix other device drivers too).
      Reported-by: default avatarBenjamin Herrenschmidt <benh@kernel.crashing.org>
      Reported-by: default avatarMariusz Kozlowski <m.kozlowski@tuxland.pl>
      Cc: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
      Cc: Borislav Petkov <petkovbb@gmail.com>
      Tested-by: default avatarMariusz Kozlowski <m.kozlowski@tuxland.pl>
      Tested-by: default avatarBenjamin Herrenschmidt <benh@kernel.crashing.org>
      Signed-off-by: default avatarBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
  4. 24 Jul, 2008 2 commits
  5. 23 Jul, 2008 7 commits
  6. 21 Jul, 2008 1 commit
  7. 16 Jul, 2008 1 commit
  8. 15 Jul, 2008 20 commits