11 Oct, 2008

22 commits

  • * Set IDE_AFLAG_NO_DOORLOCK in idetape_get_mode_sense_result(), check it
    in ide_tape_set_media_lock() and cleanup idetape_create_prevent_cmd().

    * Set IDE_AFLAG_NO_DOORLOCK in ide_floppy_create_read_capacity_cmd() and
    check it instead of IDE_AFLAG_CLIK_DRIVE in ide_floppy_set_media_lock().

    * Add ide_set_media_lock() helper and convert ide-{floppy,tape}.c to use it.

    * Remove no longer used ide*_create_prevent_cmd()/ide*_set_media_lock().

    * Update comment in accordingly.

    Acked-by: Borislav Petkov
    Signed-off-by: Bartlomiej Zolnierkiewicz

    Bartlomiej Zolnierkiewicz
     
  • While at it:

    - idefloppy_create_read_capacity_cmd() -> ide_floppy_create_read_capacity_cmd()
    - idefloppy_create_mode_sense_cmd() -> ide_floppy_create_mode_sense_cmd()
    - idefloppy_create_request_sense_cmd() -> ide_floppy_create_request_sense_cmd()
    - idefloppy_create_format_unit_cmd() -> ide_floppy_create_format_unit_cmd()
    - idefloppy_get_sfrp_bit() -> ide_floppy_get_sfrp_bit()

    Acked-by: Borislav Petkov
    Signed-off-by: Bartlomiej Zolnierkiewicz

    Bartlomiej Zolnierkiewicz
     
  • Add IDE_AFLAG_{SRFP,WP} drive->atapi_flags and use them
    instead of ->{srfp,wp} struct ide_floppy_obj fields.

    There should be no functional changes caused by this patch.

    Acked-by: Borislav Petkov
    Signed-off-by: Bartlomiej Zolnierkiewicz

    Bartlomiej Zolnierkiewicz
     
  • * Add ide_queue_pc_tail() and convert ide-{floppy,tape}.c to use it
    instead of ide*_queue_pc_tail().

    * Remove no longer used ide*_queue_pc_tail().

    There should be no functional changes caused by this patch.

    Acked-by: Borislav Petkov
    Acked-by: Sergei Shtylyov
    Signed-off-by: Bartlomiej Zolnierkiewicz

    Bartlomiej Zolnierkiewicz
     
  • * Move REQ_IDETAPE_* enums to .

    * Add ide_queue_pc_head() and convert ide-{floppy,tape}.c to use it
    instead of ide*_queue_pc_head().

    * Remove no longer used ide*_queue_pc_head().

    There should be no functional changes caused by this patch.

    Acked-by: Borislav Petkov
    Acked-by: Sergei Shtylyov
    Signed-off-by: Bartlomiej Zolnierkiewicz

    Bartlomiej Zolnierkiewicz
     
  • * Add IDE_PC_BUFFER_SIZE define.

    * Add ide_init_pc() and convert ide-{floppy,tape}.c to use it
    instead of ide*_init_pc().

    * Remove no longer used IDE*_PC_BUFFER_SIZE and ide*_init_pc().

    There should be no functional changes caused by this patch.

    Acked-by: Borislav Petkov
    Acked-by: Sergei Shtylyov
    Signed-off-by: Bartlomiej Zolnierkiewicz

    Bartlomiej Zolnierkiewicz
     
  • Add ide_floppy_set_media_lock() helper and convert idefloppy_open(),
    idefloppy_release() and ide_floppy_lockdoor() to use it.

    There should be no functional changes caused by this patch.

    Acked-by: Borislav Petkov
    Acked-by: Sergei Shtylyov
    Signed-off-by: Bartlomiej Zolnierkiewicz

    Bartlomiej Zolnierkiewicz
     
  • * Make ->io_buffers method return number of bytes transferred.

    * Use ide_end_request() instead of idefloppy_end_request()
    in ide_floppy_io_buffers() and then move the call out to
    ide_pc_intr().

    * Add ide_io_buffers() helper and convert ide-{floppy,scsi}.c
    to use it instead of ide*_io_buffers().

    There should be no functional changes caused by this patch.

    Acked-by: Borislav Petkov
    Signed-off-by: Bartlomiej Zolnierkiewicz

    Bartlomiej Zolnierkiewicz
     
  • Only MODE_SENSE_CURRENT (0x00) is ever used so just remove
    these defines and then drop no longer needed 'type' argument
    from idefloppy_create_mode_sense_cmd().

    Cc: Borislav Petkov
    Acked-by: Sergei Shtylyov
    Signed-off-by: Bartlomiej Zolnierkiewicz

    Bartlomiej Zolnierkiewicz
     
  • * Add 'struct ide_atapi_pc queued_pc' to struct ide_{floppy,tape}_obj
    and switch ide*_do_request() to use it (there can be only one active
    request for a given device).

    * Add 'struct ide_atapi_pc request_sense_pc' to struct ide_*_obj
    and switch ide*_retry_pc() to use it.

    * Remove needless {floppy,tape}->pc assignment from ide*_setup().

    * Remove no longer needed ide*_next_pc_storage(), pc_stack[],
    rq_stack_index, IDE*_PC_STACK and DBG_PC_STACK.

    There should be no functional changes caused by this patch.

    Cc: Borislav Petkov
    Signed-off-by: Bartlomiej Zolnierkiewicz

    Bartlomiej Zolnierkiewicz
     
  • * Add 'struct request request_sense_rq' to struct ide_{floppy,tape}_obj
    and switch ide*_retry_pc() to use it (there can be only one REQUEST SENSE
    request active for a given device).

    * Remove no longer needed ide*_next_rq_storage(), rq_stack[]
    and rq_stack_index.

    * DBG_PCRQ_STACK -> DBG_PC_STACK

    * Update comments for IDE*_PC_STACK and idetape_queue_pc_{head,tail}().

    There should be no functional changes caused by this patch.

    Cc: Borislav Petkov
    Signed-off-by: Bartlomiej Zolnierkiewicz

    Bartlomiej Zolnierkiewicz
     
  • Use hwif->sg_table for pio transfers instead of fumbling
    with block layer internals in the driver. Also, make debug
    statements more informative in .._do_request() while at it.

    Signed-off-by: Borislav Petkov
    [bart: fixup pc->b_count in idefloppy_blockpc_cmd()]
    [bart: add missing include (noticed by Stephen Rothwell)]
    [bart: map hwif->sg_{table,nents} on pc->{sg,sg_cnt} (multi-IRQs-per-sg fix)]
    Signed-off-by: Bartlomiej Zolnierkiewicz

    Borislav Petkov
     
  • * Factor out IDEFLOPPY_IOCTL_FORMAT_* ioctls handling from
    idefloppy_ioctl() to ide_floppy_format_ioctl().

    While at it:

    * Pass 'drive' instead of 'floppy' to ide_floppy_format_unit().

    * idefloppy_get_format_progress() -> ide_floppy_get_format_progress()

    There should be no functional changes caused by this patch.

    Cc: Borislav Petkov
    Signed-off-by: Bartlomiej Zolnierkiewicz

    Bartlomiej Zolnierkiewicz
     
  • Cc: Borislav Petkov
    Signed-off-by: Bartlomiej Zolnierkiewicz

    Bartlomiej Zolnierkiewicz
     
  • * Add ide_check_atapi_device() to ide-atapi.c and convert
    ide-{floppy,tape}.c to use it instead of ide*_identify_device().

    While at it:

    * Add DRV_NAME defines to ide-{floppy,tape}.c.

    Cc: Borislav Petkov
    Signed-off-by: Bartlomiej Zolnierkiewicz

    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: Bartlomiej Zolnierkiewicz

    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: Bartlomiej Zolnierkiewicz

    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: Bartlomiej Zolnierkiewicz

    Bartlomiej Zolnierkiewicz
     
  • * Include directly in
    instead of through .

    * Include only when needed.

    Cc: Christoph Hellwig
    Signed-off-by: Bartlomiej Zolnierkiewicz

    Bartlomiej Zolnierkiewicz
     
  • Remove needless drive->present checks from ->probe methods
    (device model takes care of that).

    Signed-off-by: Bartlomiej Zolnierkiewicz

    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: Bartlomiej Zolnierkiewicz

    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: Bartlomiej Zolnierkiewicz

    Bartlomiej Zolnierkiewicz
     

06 Aug, 2008

1 commit

  • 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 08da591e14cf87247ec09b17c350235157a92fc3
    ("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: Benjamin Herrenschmidt
    Reported-by: Mariusz Kozlowski
    Cc: FUJITA Tomonori
    Cc: Borislav Petkov
    Tested-by: Mariusz Kozlowski
    Tested-by: Benjamin Herrenschmidt
    Signed-off-by: Bartlomiej Zolnierkiewicz

    Bartlomiej Zolnierkiewicz
     

25 Jul, 2008

1 commit


24 Jul, 2008

5 commits

  • while at it, remove PC_FLAG_ZIP_DRIVE from the packed command flags altogether
    and query the drive type through drive->atapi_flags.

    v2:
    ide-floppy fix.

    There should be no functionality change resulting from this patch.

    [bart: IDE_FLAG_* -> IDE_AFLAG_*, dev_flags -> atapi_flags]

    Signed-off-by: Borislav Petkov
    Signed-off-by: Bartlomiej Zolnierkiewicz

    Borislav Petkov
     
  • Make a redundant copy of the packet command bits into rq->cmd.
    Later, after all drivers have been converted, it'll be
    switched to use that in the common code instead of pc->c.

    There should be no functionality change resulting from this patch.

    Signed-off-by: Borislav Petkov
    Signed-off-by: Bartlomiej Zolnierkiewicz

    Borislav Petkov
     
  • It is important that drive->pc_callback is set prior to enabling IRQs on the
    device since this is called from the IRQ handler. Otherwise it hurts as I learnt
    the hard way from the several "Kernel panic - not synching: Fatal exception in
    interrupt" during the weekend :).

    The if-else block in the IRQ handler is only temporary so that bisect searches
    don't break and it'll be removed after converting the remainder of the drivers.

    There should be no functionality change resulting from this patch.

    Signed-off-by: Borislav Petkov
    Signed-off-by: Bartlomiej Zolnierkiewicz

    Borislav Petkov
     
  • * 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: Bartlomiej Zolnierkiewicz

    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: Bartlomiej Zolnierkiewicz

    Bartlomiej Zolnierkiewicz
     

17 Jul, 2008

4 commits


16 Jul, 2008

7 commits