1. 11 10月, 2008 8 次提交
    • B
      ide: remove ->supports_dsc_overlap field from ide_driver_t · 02d599a3
      Bartlomiej Zolnierkiewicz 提交于
      * 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: NBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
      02d599a3
    • B
      ide: /proc/ide/hd*/settings rework · 8185d5aa
      Bartlomiej Zolnierkiewicz 提交于
      * 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: NBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
      8185d5aa
    • B
      ide: call ide_proc_register_driver() later · 1e874f44
      Bartlomiej Zolnierkiewicz 提交于
      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: NBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
      1e874f44
    • B
      ide: include <linux/hdreg.h> only when needed · 3ceca727
      Bartlomiej Zolnierkiewicz 提交于
      * Include <linux/ata.h> directly in <linux/ide.h>
        instead of through <linux/hdreg.h>.
      
      * Include <linux/hdreg.h> only when needed.
      
      Cc: Christoph Hellwig <hch@infradead.org>
      Signed-off-by: NBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
      3ceca727
    • B
      ide: remove needless drive->present checks from device drivers · 2a924662
      Bartlomiej Zolnierkiewicz 提交于
      Remove needless drive->present checks from ->probe methods
      (device model takes care of that).
      Signed-off-by: NBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
      2a924662
    • B
      ide: use ATA_* defines instead of *_STAT and *_ERR ones · 3a7d2484
      Bartlomiej Zolnierkiewicz 提交于
      * ERR_STAT   -> ATA_ERR
      * INDEX_STAT -> ATA_IDX
      * ECC_STAT   -> ATA_CORR
      * DRQ_STAT   -> ATA_DRQ
      * SEEK_STAT  -> ATA_DSC
      * WRERR_STAT -> ATA_DF
      * READY_STAT -> ATA_DRDY
      * BUSY_STAT  -> ATA_BUSY
      
      * MARK_ERR   -> ATA_AMNF
      * TRK0_ERR   -> ATA_TRK0NF
      * ABRT_ERR   -> ATA_ABORTED
      * MCR_ERR    -> ATA_MCR
      * ID_ERR     -> ATA_IDNF
      * MC_ERR     -> ATA_MC
      * ECC_ERR    -> ATA_UNC
      * ICRC_ERR   -> ATA_ICRC
      
      * BBD_ERR    -> ATA_BBK
      
      Also:
      
      * ILI_ERR    -> ATAPI_ILI
      * EOM_ERR    -> ATAPI_EOM
      * LFS_ERR    -> ATAPI_LFS
      
      * CD         -> ATAPI_COD
      * IO         -> ATAPI_IO
      Signed-off-by: NBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
      3a7d2484
    • B
      ide: WIN_* -> ATA_CMD_* · aaaade3f
      Bartlomiej Zolnierkiewicz 提交于
      * Use ATA_CMD_* defines instead of WIN_* ones.
      
      While at it:
      
      * EXABYTE_ENABLE_NEXT -> ATA_EXABYTE_ENABLE_NEST
      
      * SETFEATURES_{EN,DIS}_WCACHE -> SETFEATURES_WC_{ON,OFF}
      
      * SETFEATURES_{EN,DIS}_AAM -> SETFEATURES_AAM_{ON,OFF}
      
      * SMART_* -> ATA_SMART_*
      
      * Remove stale comment from ide-proc.c.
      
      Partially based on earlier work by Chris Wedgwood.
      Acked-by: NChris Wedgwood <cw@f00f.org>
      Signed-off-by: NBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
      aaaade3f
    • B
      ide: make drive->id an union (take 2) · 4dde4492
      Bartlomiej Zolnierkiewicz 提交于
      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().
      
      v2:
      Fix typo in drivers/ide/ppc/pmac.c. (From Stephen Rothwell)
      
      There should be no functional changes caused by this patch.
      Signed-off-by: NBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
      4dde4492
  2. 09 10月, 2008 1 次提交
  3. 06 8月, 2008 1 次提交
    • B
      ide: fix regression caused by ide_device_{get,put}() addition (take 2) · d3e33ff5
      Bartlomiej Zolnierkiewicz 提交于
      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.
      
      v2:
      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: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      Reported-by: NMariusz Kozlowski <m.kozlowski@tuxland.pl>
      Cc: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
      Cc: Borislav Petkov <petkovbb@gmail.com>
      Tested-by: NMariusz Kozlowski <m.kozlowski@tuxland.pl>
      Tested-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      Signed-off-by: NBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
      d3e33ff5
  4. 25 7月, 2008 2 次提交
  5. 24 7月, 2008 6 次提交
  6. 17 7月, 2008 1 次提交
  7. 16 7月, 2008 21 次提交