]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/log
linux-2.6-omap-h63xx.git
15 years agoide: move IDE{FLOPPY,TAPE}_WAIT_CMD defines to <linux/ide.h>
Bartlomiej Zolnierkiewicz [Fri, 10 Oct 2008 20:39:39 +0000 (22:39 +0200)]
ide: move IDE{FLOPPY,TAPE}_WAIT_CMD defines to <linux/ide.h>

While at it:

* IDE{FLOPPY,TAPE}_WAIT_CMD -> WAIT_{FLOPPY,TAPE}_CMD

* Use enum for WAIT_* defines.

There should be no functional changes caused by this patch.

Acked-by: Borislav Petkov <petkovbb@gmail.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
15 years agoide: add ide_do_test_unit_ready() helper
Bartlomiej Zolnierkiewicz [Fri, 10 Oct 2008 20:39:39 +0000 (22:39 +0200)]
ide: add ide_do_test_unit_ready() helper

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

* Remove no longer used idetape_create_test_unit_ready_cmd().

There should be no functional changes caused by this patch.

Acked-by: Borislav Petkov <petkovbb@gmail.com>
Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
15 years agoide: add ide_do_start_stop() helper
Bartlomiej Zolnierkiewicz [Fri, 10 Oct 2008 20:39:39 +0000 (22:39 +0200)]
ide: add ide_do_start_stop() helper

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

* Remove no longer used idefloppy_create_start_stop_cmd()
  and idetape_create_load_unload_cmd().

There should be no functional changes caused by this patch.

Acked-by: Borislav Petkov <petkovbb@gmail.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
15 years agoide: add ide_set_media_lock() helper
Bartlomiej Zolnierkiewicz [Fri, 10 Oct 2008 20:39:38 +0000 (22:39 +0200)]
ide: add ide_set_media_lock() helper

* 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 <linux/ide.h> accordingly.

Acked-by: Borislav Petkov <petkovbb@gmail.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
15 years agoide-floppy: move floppy ioctls handling to ide-floppy_ioctl.c
Bartlomiej Zolnierkiewicz [Fri, 10 Oct 2008 20:39:38 +0000 (22:39 +0200)]
ide-floppy: move floppy ioctls handling to ide-floppy_ioctl.c

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 <petkovbb@gmail.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
15 years agoide-floppy: ->{srfp,wp} -> IDE_AFLAG_{SRFP,WP}
Bartlomiej Zolnierkiewicz [Fri, 10 Oct 2008 20:39:38 +0000 (22:39 +0200)]
ide-floppy: ->{srfp,wp} -> IDE_AFLAG_{SRFP,WP}

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 <petkovbb@gmail.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
15 years agoide: add ide_queue_pc_tail() helper
Bartlomiej Zolnierkiewicz [Fri, 10 Oct 2008 20:39:38 +0000 (22:39 +0200)]
ide: add ide_queue_pc_tail() helper

* 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 <petkovbb@gmail.com>
Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
15 years agoide: add ide_queue_pc_head() helper
Bartlomiej Zolnierkiewicz [Fri, 10 Oct 2008 20:39:37 +0000 (22:39 +0200)]
ide: add ide_queue_pc_head() helper

* Move REQ_IDETAPE_* enums to <linux/ide.h>.

* 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 <petkovbb@gmail.com>
Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
15 years agoide: add ide_init_pc() helper
Bartlomiej Zolnierkiewicz [Fri, 10 Oct 2008 20:39:37 +0000 (22:39 +0200)]
ide: add ide_init_pc() helper

* 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 <petkovbb@gmail.com>
Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
15 years agoide-tape: add ide_tape_set_media_lock() helper
Bartlomiej Zolnierkiewicz [Fri, 10 Oct 2008 20:39:37 +0000 (22:39 +0200)]
ide-tape: add ide_tape_set_media_lock() helper

Add ide_tape_set_media_lock() helper and convert idetape_mtioctop(),
idetape_chrdev_open() and idetape_chrdev_release() to use it.

There should be no functional changes caused by this patch (it is
OK to modify ->door_locked if idetape_create_prevent_cmd() fails).

Acked-by: Borislav Petkov <petkovbb@gmail.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
15 years agoide-floppy: add ide_floppy_set_media_lock() helper
Bartlomiej Zolnierkiewicz [Fri, 10 Oct 2008 20:39:37 +0000 (22:39 +0200)]
ide-floppy: add ide_floppy_set_media_lock() helper

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 <petkovbb@gmail.com>
Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
15 years agoide: add ide_io_buffers() helper
Bartlomiej Zolnierkiewicz [Fri, 10 Oct 2008 20:39:36 +0000 (22:39 +0200)]
ide: add ide_io_buffers() helper

* 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 <petkovbb@gmail.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
15 years agoide-scsi: cleanup ide_scsi_io_buffers()
Bartlomiej Zolnierkiewicz [Fri, 10 Oct 2008 20:39:36 +0000 (22:39 +0200)]
ide-scsi: cleanup ide_scsi_io_buffers()

Preparation for ide_{floppy,scsi}_io_buffers() unification.

Acked-by: Borislav Petkov <petkovbb@gmail.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
15 years agoide-floppy: remove MODE_SENSE_* defines
Bartlomiej Zolnierkiewicz [Fri, 10 Oct 2008 20:39:36 +0000 (22:39 +0200)]
ide-floppy: remove MODE_SENSE_* defines

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 <petkovbb@gmail.com>
Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
15 years agoide-{floppy,tape}: remove packet command stack
Bartlomiej Zolnierkiewicz [Fri, 10 Oct 2008 20:39:36 +0000 (22:39 +0200)]
ide-{floppy,tape}: remove packet command stack

* 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 <petkovbb@gmail.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
15 years agoide-{floppy,tape}: remove request stack
Bartlomiej Zolnierkiewicz [Fri, 10 Oct 2008 20:39:35 +0000 (22:39 +0200)]
ide-{floppy,tape}: remove request stack

* 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 <petkovbb@gmail.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
15 years agoide-generic: handle probing of legacy io-ports v5
Borislav Petkov [Fri, 10 Oct 2008 20:39:35 +0000 (22:39 +0200)]
ide-generic: handle probing of legacy io-ports v5

Avoid probing the io-ports in case an IDE PCI controller is present and it
uses the legacy iobases. If we still want to enforce the probing, we do

ide_generic.probe_mask=0x3f

on the kernel command line. The iobase checking code is
adapted from drivers/ata/pata_legacy.c after converting hex
pci ids into their corresponding macros in <linux/pci_ids.h>.

Also, check only BAR0/2 resources since those are guaranteed
by the workaround in drivers/pci/probe.c:pci_setup_device().

Signed-off-by: Borislav Petkov <petkovbb@gmail.com>
Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
[bart: trivial printk() fixups]
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
15 years agoide-floppy: use scatterlists for pio transfers
Borislav Petkov [Fri, 10 Oct 2008 20:39:35 +0000 (22:39 +0200)]
ide-floppy: use scatterlists for pio transfers

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 <petkovbb@gmail.com>
[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 <bzolnier@gmail.com>
15 years agoide-tape: remove idetape_init_rq()
Bartlomiej Zolnierkiewicz [Fri, 10 Oct 2008 20:39:34 +0000 (22:39 +0200)]
ide-tape: remove idetape_init_rq()

idetape_init_rq() is only used in idetape_queue_pc_head()
so inline it there.

Cc: Borislav Petkov <petkovbb@gmail.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
15 years agoide-floppy: add ide_floppy_format_ioctl() helper
Bartlomiej Zolnierkiewicz [Fri, 10 Oct 2008 20:39:34 +0000 (22:39 +0200)]
ide-floppy: add ide_floppy_format_ioctl() helper

* 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 <petkovbb@gmail.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
15 years agoide-floppy: remove needless parens
Bartlomiej Zolnierkiewicz [Fri, 10 Oct 2008 20:39:34 +0000 (22:39 +0200)]
ide-floppy: remove needless parens

Cc: Borislav Petkov <petkovbb@gmail.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
15 years agoide: add ide_check_atapi_device() helper
Bartlomiej Zolnierkiewicz [Fri, 10 Oct 2008 20:39:34 +0000 (22:39 +0200)]
ide: add ide_check_atapi_device() helper

* 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 <petkovbb@gmail.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
15 years agoide: move ioctls handling to ide-ioctls.c
Bartlomiej Zolnierkiewicz [Fri, 10 Oct 2008 20:39:33 +0000 (22:39 +0200)]
ide: move ioctls handling to ide-ioctls.c

* Move ioctls handling to ide-ioctls.c
  (except HDIO_DRIVE_TASKFILE for now).

* Make ide_{cmd,task}() static.

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
15 years agoide: cleanup generic_ide_ioctl()
Bartlomiej Zolnierkiewicz [Fri, 10 Oct 2008 20:39:33 +0000 (22:39 +0200)]
ide: cleanup generic_ide_ioctl()

* Fix intendation for the main 'switch ()'.

* 'switch ()' -> 'if ()' for HDIO_DRIVE_TASKFILE case.

* Move HDIO_SET_NICE case under HDIO_GET_NICE one.

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
15 years agoide: add ide_setting_ioctl() helper
Bartlomiej Zolnierkiewicz [Fri, 10 Oct 2008 20:39:33 +0000 (22:39 +0200)]
ide: add ide_setting_ioctl() helper

* Add struct ide_ioctl_devset representing ioctl device setting.

* Add ide_setting_ioctl() helper for matching given ioctl
  and its parameters against table of ioctl device settings.

* Convert ide_setting_ioctl() and idedisk_ioctl() to use
  ide_setting_ioctl().

* Un-export ide_setting_mtx.

While at it:

* {get,set}_lba_addressing() -> {get,set}_addressing()

There should be no functional changes caused by this patch.

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
15 years agoide: remove ->bus_state field from ide_hwif_t
Bartlomiej Zolnierkiewicz [Fri, 10 Oct 2008 20:39:33 +0000 (22:39 +0200)]
ide: remove ->bus_state field from ide_hwif_t

It is always set to BUSSTATE_ON.

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
15 years agoide: add proper PCI PM support (v2)
Bartlomiej Zolnierkiewicz [Fri, 10 Oct 2008 20:39:32 +0000 (22:39 +0200)]
ide: add proper PCI PM support (v2)

* 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: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
15 years agohpt366: add hpt3xx_disable_fast_irq() helper
Bartlomiej Zolnierkiewicz [Fri, 10 Oct 2008 20:39:32 +0000 (22:39 +0200)]
hpt366: add hpt3xx_disable_fast_irq() helper

* Factor out disabling of "fast interrupt" prediction from
  init_hwif_hpt366() to hpt3xx_disable_fast_irq() helper.

* Use hpt3xx_disable_fast_irq() in ->init_chipset instead of
  ->init_hwif method.

  This is a preparation for adding proper PCI PM support.

While at it:

* Cache chip type in chip_type variable in hpt3xx_disable_fast_irq().

There should be no functional changes caused by this patch.

Cc: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
15 years agoide: lba_capacity_is_ok() -> ata_id_is_lba_capacity_ok()
Bartlomiej Zolnierkiewicz [Fri, 10 Oct 2008 20:39:31 +0000 (22:39 +0200)]
ide: lba_capacity_is_ok() -> ata_id_is_lba_capacity_ok()

Rename lba_capacity_is_ok() to ata_id_is_lba_capacity_ok()
and move it to <linux/ata.h> (remove needless parens while at it).

Cc: Jeff Garzik <jgarzik@pobox.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
15 years agoide: ide_id_to_hd_driveid() -> ata_id_to_hd_driveid()
Bartlomiej Zolnierkiewicz [Fri, 10 Oct 2008 20:39:31 +0000 (22:39 +0200)]
ide: ide_id_to_hd_driveid() -> ata_id_to_hd_driveid()

Rename ide_id_to_hd_driveid() to ata_id_to_hd_driveid()
and move it to <linux/ata.h>.

Cc: Jeff Garzik <jgarzik@pobox.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
15 years agoide: use ata_id_is_cfa()
Bartlomiej Zolnierkiewicz [Fri, 10 Oct 2008 20:39:31 +0000 (22:39 +0200)]
ide: use ata_id_is_cfa()

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: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
15 years agoide: ide_id_has_flush_cache_ext() -> ata_id_flush_ext_enabled()
Bartlomiej Zolnierkiewicz [Fri, 10 Oct 2008 20:39:31 +0000 (22:39 +0200)]
ide: ide_id_has_flush_cache_ext() -> ata_id_flush_ext_enabled()

* Add ata_id_flush_ext_enabled() inline helper to <linux/ata.h>.

* ide_id_has_flush_cache_ext() -> ata_id_flush_ext_enabled()

  The latter one also checks if the command is marked as
  supported in word 83 and validity of words 83 & 86.

Cc: Jeff Garzik <jgarzik@pobox.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
15 years agoide: ide_id_has_flush_cache() -> ata_id_flush_enabled()
Bartlomiej Zolnierkiewicz [Fri, 10 Oct 2008 20:39:30 +0000 (22:39 +0200)]
ide: ide_id_has_flush_cache() -> ata_id_flush_enabled()

* Add ata_id_flush_enabled() inline helper to <linux/ata.h>.

* ide_id_has_flush_cache() -> ata_id_flush_enabled()

  The latter one also checks if the command is marked as
  supported in word 83 and validity of words 83 & 86.

Cc: Jeff Garzik <jgarzik@pobox.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
15 years agoide: check only for CACHE FLUSH command support in ide_id_has_flush_cache()
Bartlomiej Zolnierkiewicz [Fri, 10 Oct 2008 20:39:30 +0000 (22:39 +0200)]
ide: check only for CACHE FLUSH command support in ide_id_has_flush_cache()

All devices supporting CACHE FLUSH EXT command should also support
CACHE FLUSH command so it is sufficient to check only for CACHE FLUSH
in ide_id_has_flush_cache().

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
15 years agoide: idedisk_supports_lba48() -> ata_id_lba48_enabled()
Bartlomiej Zolnierkiewicz [Fri, 10 Oct 2008 20:39:30 +0000 (22:39 +0200)]
ide: idedisk_supports_lba48() -> ata_id_lba48_enabled()

* Add ata_id_lba48_enabled() inline helper to <linux/ata.h>.

* idedisk_supports_lba48() -> ata_id_lba48_enabled()

  The latter one also checks validity of words 83 & 86.

Cc: Jeff Garzik <jgarzik@pobox.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
15 years agoide: ide_dev_is_sata() -> ata_id_is_sata()
Bartlomiej Zolnierkiewicz [Fri, 10 Oct 2008 20:39:30 +0000 (22:39 +0200)]
ide: ide_dev_is_sata() -> ata_id_is_sata()

* Use optimized ATA version check from Sergei in ata_id_is_sata().

* ide_dev_is_sata() -> ata_id_is_sata()

Cc: Jeff Garzik <jgarzik@pobox.com>
Cc: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
15 years agoide: ide_dev_has_iordy() -> ata_id_has_iordy()
Bartlomiej Zolnierkiewicz [Fri, 10 Oct 2008 20:39:29 +0000 (22:39 +0200)]
ide: ide_dev_has_iordy() -> ata_id_has_iordy()

* Remove (id[ATA_ID_FIELD_VALID] & 2) check from ide_dev_has_iordy()
  (it is for validity of words 64-70, IORDY is in word 49).

* ide_dev_has_iordy() -> ata_id_has_iordy()

Cc: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
15 years agoide: factor out HDIO_*_NICE ioctl handling to ide_*_nice_ioctl()
Bartlomiej Zolnierkiewicz [Fri, 10 Oct 2008 20:39:29 +0000 (22:39 +0200)]
ide: factor out HDIO_*_NICE ioctl handling to ide_*_nice_ioctl()

Factor out HDIO_{GET,SET}_NICE ioctl handling from
generic_ide_ioctl() to ide_{get,set}_nice_ioctl().

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
15 years agoide: remove ->supports_dsc_overlap field from ide_driver_t
Bartlomiej Zolnierkiewicz [Fri, 10 Oct 2008 20:39:29 +0000 (22:39 +0200)]
ide: remove ->supports_dsc_overlap field from ide_driver_t

* 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 <bzolnier@gmail.com>
15 years agoide: remove read-only ->atapi_overlap field from ide_drive_t
Bartlomiej Zolnierkiewicz [Fri, 10 Oct 2008 20:39:29 +0000 (22:39 +0200)]
ide: remove read-only ->atapi_overlap field from ide_drive_t

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
15 years agocmd640: add __set_prefetch_mode()
Bartlomiej Zolnierkiewicz [Fri, 10 Oct 2008 20:39:28 +0000 (22:39 +0200)]
cmd640: add __set_prefetch_mode()

Factor out the common code from check_prefetch()
and set_prefetch_mode() to __set_prefetch_mode().

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
15 years agoide: remove SECTOR_WORDS define
Bartlomiej Zolnierkiewicz [Fri, 10 Oct 2008 20:39:28 +0000 (22:39 +0200)]
ide: remove SECTOR_WORDS define

Just use SECTOR_SIZE instead.

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
15 years agoide: /proc/ide/hd*/settings rework
Bartlomiej Zolnierkiewicz [Fri, 10 Oct 2008 20:39:28 +0000 (22:39 +0200)]
ide: /proc/ide/hd*/settings rework

* 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 <bzolnier@gmail.com>
15 years agoide: preparations for /proc/ide/hd*/settings rework
Bartlomiej Zolnierkiewicz [Fri, 10 Oct 2008 20:39:27 +0000 (22:39 +0200)]
ide: preparations for /proc/ide/hd*/settings rework

After rework settings will be no longer created dynamically
for each device so we need to make some fixups first.

* Use set_[ksettings,unmaskirq]() as a set function for
  ["keepsettings","unmaskirq"] setting.

* Allow writes to ["io_32bit","unmaskirq"] settings also when
  drive->no_[io_32bit,unmask] is set (this is checked later inside
  set_[io_32bit,unmaskirq]() anywyay and keeps consistency with
  the corresponding HDIO_SET_[32BIT,UNMASKINTR] ioctls).

* Use max possible multi sectors value (16) as an allowed max for
  "multcount" setting.  set_multcount() set function checks against
  device's max possbile value anyway and it makes the proc setting
  consistent with the corresponding HDIO_SET_MULTCOUNT ioctl.

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
15 years agoide: call ide_proc_register_driver() later
Bartlomiej Zolnierkiewicz [Fri, 10 Oct 2008 20:39:27 +0000 (22:39 +0200)]
ide: call ide_proc_register_driver() later

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 <bzolnier@gmail.com>
15 years agoide: include <linux/hdreg.h> only when needed
Bartlomiej Zolnierkiewicz [Fri, 10 Oct 2008 20:39:27 +0000 (22:39 +0200)]
ide: include <linux/hdreg.h> only when needed

* 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: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
15 years agoide: remove CONFIG_IDEDISK_MULTI_MODE
Bartlomiej Zolnierkiewicz [Fri, 10 Oct 2008 20:39:26 +0000 (22:39 +0200)]
ide: remove CONFIG_IDEDISK_MULTI_MODE

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: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
15 years agoide: check drive->present in ide_get_paired_drive()
Bartlomiej Zolnierkiewicz [Fri, 10 Oct 2008 20:39:26 +0000 (22:39 +0200)]
ide: check drive->present in ide_get_paired_drive()

* Change ide_get_paired_drive() to return NULL if peer device
  is not present and update all users accordingly.

While at it:

* ide_get_paired_drive() -> ide_get_pair_dev()

* Use ide_get_pair_dev() in cs5530.c, sc1200.c and via82cxxx.c.

There should be no functional changes caused by this patch.

Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
15 years agoide: remove needless drive->present checks from device drivers
Bartlomiej Zolnierkiewicz [Fri, 10 Oct 2008 20:39:24 +0000 (22:39 +0200)]
ide: remove needless drive->present checks from device drivers

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

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
15 years agoide: remove unused _IDE_C and _IDE_DISK defines
Bartlomiej Zolnierkiewicz [Fri, 10 Oct 2008 20:39:24 +0000 (22:39 +0200)]
ide: remove unused _IDE_C and _IDE_DISK defines

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
15 years agoide: remove IDE_CHIPSET_* macros
Bartlomiej Zolnierkiewicz [Fri, 10 Oct 2008 20:39:24 +0000 (22:39 +0200)]
ide: remove IDE_CHIPSET_* macros

They just obfuscate the code.

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
15 years agoide: remove no longer needed BUG_ON()-s from init_irq()
Bartlomiej Zolnierkiewicz [Fri, 10 Oct 2008 20:39:23 +0000 (22:39 +0200)]
ide: remove no longer needed BUG_ON()-s from init_irq()

init_irq() is now called only during initial host registration
so these BUG_ON()-s are no loner needed (+ the last one was done
too late anyway).

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
15 years agoide: enhance ide_busy_sleep()
Bartlomiej Zolnierkiewicz [Fri, 10 Oct 2008 20:39:23 +0000 (22:39 +0200)]
ide: enhance ide_busy_sleep()

* Make ide_busy_sleep() take timeout value as a parameter
  and also allow use of AltStatus Register if requested with
  altstatus parameter.  Update existing users accordingly.

* Convert ide_driveid_update() and actual_try_to_identify()
  to use ide_busy_sleep().

There should be no functional changes caused by this patch.

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
15 years agoide: fix EXABYTENEST handling in probe_for_drive()
Bartlomiej Zolnierkiewicz [Fri, 10 Oct 2008 20:39:23 +0000 (22:39 +0200)]
ide: fix EXABYTENEST handling in probe_for_drive()

Fix EXABYTENEST handling in probe_for_drive() (so drive->present
is checked for "nested" device) and cleanup enable_nest().

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
15 years agoide-cd: use the new object_is_in_stack() helper
FUJITA Tomonori [Fri, 10 Oct 2008 20:39:22 +0000 (22:39 +0200)]
ide-cd: use the new object_is_in_stack() helper

Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Cc: Borislav Petkov <petkovbb@gmail.com>
Cc: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
Cc: Tejun Heo <htejun@gmail.com>
Cc: Jens Axboe <jens.axboe@oracle.com>
Cc: James Bottomley <James.Bottomley@HansenPartnership.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
15 years agoide: re-code ide_fixstring() loop to be less evil
Linus Torvalds [Fri, 10 Oct 2008 20:39:22 +0000 (22:39 +0200)]
ide: re-code ide_fixstring() loop to be less evil

On Friday 25 July 2008, Linus Torvalds wrote:
>
> On Fri, 25 Jul 2008, Ben Dooks wrote:
> >
> > personally, i would much prefer to see the loop being less evil
> > like:
> >
> >  for (p = s; p < end; p += 2)
> >  be16_to_cpus((u16 *)p);
>
> Well, in this case, the code actually depends on 'p' being back at the
> start of the buffer by the end of it all, so it would need some more
> changes than that.
>
> But yes, I applied David's patch, but I _also_ suspect that we would be
> better off without code that does horrid things like casts and assignments
> inside the function arguments.
>
> So it would be nice to re-code that loop to be more readable. But due to
> the reliance of 'p' being 's' after the loop, the minimal patch would be
> something like the appended.
>
> Bartlomiej - take this or not, I'm not going to commit it - I haven't
> tested it, nor do I even have any machines that would trigger it. So this
> is more a "maybe something like this" than anything else.

From: Linus Torvalds <torvalds@linux-foundation.org>
CC: Ben Dooks <ben-linux@fluff.org>
Cc: David Miller <davem@davemloft.net>
Cc: harvey.harrison@gmail.com
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
15 years agoide: remove no longer needed ide_drive_t fields
Bartlomiej Zolnierkiewicz [Fri, 10 Oct 2008 20:39:22 +0000 (22:39 +0200)]
ide: remove no longer needed ide_drive_t fields

Remove ->remap_0_to_1 and ->sect0 (they are always zero now).

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
15 years agoide: use ATA_* defines instead of *_STAT and *_ERR ones
Bartlomiej Zolnierkiewicz [Fri, 10 Oct 2008 20:39:21 +0000 (22:39 +0200)]
ide: use ATA_* defines instead of *_STAT and *_ERR ones

* 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 <bzolnier@gmail.com>
15 years agohd: WIN_* -> ATA_CMD_*
Bartlomiej Zolnierkiewicz [Fri, 10 Oct 2008 20:39:21 +0000 (22:39 +0200)]
hd: WIN_* -> ATA_CMD_*

* Use ATA_CMD_* defines instead of WIN_* ones.

* Include <linux/ata.h> directly instead of through <linux/hdreg.h>.

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
15 years agoide: WIN_* -> ATA_CMD_*
Bartlomiej Zolnierkiewicz [Fri, 10 Oct 2008 20:39:21 +0000 (22:39 +0200)]
ide: WIN_* -> ATA_CMD_*

* 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: Chris Wedgwood <cw@f00f.org>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
15 years agolibata: WIN_* -> ATA_CMD_*
Bartlomiej Zolnierkiewicz [Fri, 10 Oct 2008 20:39:20 +0000 (22:39 +0200)]
libata: WIN_* -> ATA_CMD_*

Acked-by: Jeff Garzik <jeff@garzik.org>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
15 years agoide-disk: use ata_id_hpa_enabled()
Bartlomiej Zolnierkiewicz [Fri, 10 Oct 2008 20:39:20 +0000 (22:39 +0200)]
ide-disk: use ata_id_hpa_enabled()

idedisk_supports_hpa() -> ata_id_hpa_enabled().

The latter one also checks validity of words 82 & 85.

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
15 years agoide-disk: use ata_id_wcache_enabled()
Bartlomiej Zolnierkiewicz [Fri, 10 Oct 2008 20:39:20 +0000 (22:39 +0200)]
ide-disk: use ata_id_wcache_enabled()

Replace open-coded check by ata_id_wcache_enabled()
(which also checks validity of word 85).

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
15 years agoide: use ata_id_current_chs_valid()
Bartlomiej Zolnierkiewicz [Fri, 10 Oct 2008 20:39:19 +0000 (22:39 +0200)]
ide: use ata_id_current_chs_valid()

Replace open-coded checks by ata_id_current_chs_valid().

There should be no functional changes caused by this patch.

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
15 years agoide: remove drive->driveid
Bartlomiej Zolnierkiewicz [Fri, 10 Oct 2008 20:39:19 +0000 (22:39 +0200)]
ide: remove drive->driveid

* Factor out HDIO_[OBSOLETE,GET]_IDENTITY ioctls handling
  to ide_get_identity_ioctl().

* Use temporary buffer in ide_get_identity_ioctl() instead
  of accessing drive->id directly.

* Add ide_id_to_hd_driveid() inline to convert raw id into
  struct hd_driveid format (needed on big-endian).

* Use ide_id_to_hd_driveid() in ide_get_identity_ioctl(),
  cleanup ide_fix_driveid() and switch ide to use use raw id.

* Remove no longer needed drive->driveid.

  This leaves us with 3 users of struct hd_driveid in tree:
  - arch/um/drivers/ubd_kern.c
  - drivers/block/xsysace.c
  - drivers/usb/storage/isd200.c

While at it:

* Use ata_id_u{32,64}() and ata_id_has_{dma,lba,iordy}() macros.

There should be no functional changes caused by this patch.

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
15 years agoide: make drive->id an union (take 2)
Bartlomiej Zolnierkiewicz [Fri, 10 Oct 2008 20:39:19 +0000 (22:39 +0200)]
ide: make drive->id an union (take 2)

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 <bzolnier@gmail.com>
15 years agoide: cleanup ide_fix_driveid()
Bartlomiej Zolnierkiewicz [Fri, 10 Oct 2008 20:39:18 +0000 (22:39 +0200)]
ide: cleanup ide_fix_driveid()

Do all __le16_to_cpu() swapping in one loop.

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
15 years agoide: cleanup ide_disk_init_mult_count()
Bartlomiej Zolnierkiewicz [Fri, 10 Oct 2008 20:39:18 +0000 (22:39 +0200)]
ide: cleanup ide_disk_init_mult_count()

* Remove superfluous checks for drive->mult_req.

* No need to zero drive's fields.

* Move the common code out of #ifdef scope.

There should be no functional changes caused by this patch.

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
15 years agoide: remove superfluous check from ide_disk_special()
Bartlomiej Zolnierkiewicz [Fri, 10 Oct 2008 20:39:18 +0000 (22:39 +0200)]
ide: remove superfluous check from ide_disk_special()

This condition is checked by both ide_disk_init_mult_count()
and set_multcount() so no need to do it again in ide_disk_special().

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
15 years agoide-tape: Buildfix when IDETAPE_DEBUG_LOG is set to 1.
Mark de Wever [Fri, 10 Oct 2008 20:39:17 +0000 (22:39 +0200)]
ide-tape: Buildfix when IDETAPE_DEBUG_LOG is set to 1.

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: Mark de Wever <koraq@xs4all.nl>
Acked-by: Borislav Petkov <petkovbb@gmail.com>
[bart: remove trailing whitespace]
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
15 years agoMerge git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6
Linus Torvalds [Fri, 10 Oct 2008 18:20:42 +0000 (11:20 -0700)]
Merge git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6

* git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6:
  crypto: skcipher - Use RNG interface instead of get_random_bytes
  crypto: rng - RNG interface and implementation
  crypto: api - Add fips_enable flag
  crypto: skcipher - Move IV generators into their own modules
  crypto: cryptomgr - Test ciphers using ECB
  crypto: api - Use test infrastructure
  crypto: cryptomgr - Add test infrastructure
  crypto: tcrypt - Add alg_test interface
  crypto: tcrypt - Abort and only log if there is an error
  crypto: crc32c - Use Intel CRC32 instruction
  crypto: tcrypt - Avoid using contiguous pages
  crypto: api - Display larval objects properly
  crypto: api - Export crypto_alg_lookup instead of __crypto_alg_lookup
  crypto: Kconfig - Replace leading spaces with tabs

15 years agoMerge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/roland...
Linus Torvalds [Fri, 10 Oct 2008 18:16:33 +0000 (11:16 -0700)]
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/roland/infiniband

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/roland/infiniband: (29 commits)
  RDMA/nes: Fix slab corruption
  IB/mlx4: Set RLKEY bit for kernel QPs
  RDMA/nes: Correct error_module bit mask
  RDMA/nes: Fix routed RDMA connections
  RDMA/nes: Enhanced PFT management scheme
  RDMA/nes: Handle AE bounds violation
  RDMA/nes: Limit critical error interrupts
  RDMA/nes: Stop spurious MAC interrupts
  RDMA/nes: Correct tso_wqe_length
  RDMA/nes: Fill in firmware version for ethtool
  RDMA/nes: Use ethtool timer value
  RDMA/nes: Correct MAX TSO frags value
  RDMA/nes: Enable MC/UC after changing MTU
  RDMA/nes: Free NIC TX buffers when destroying NIC QP
  RDMA/nes: Fix MDC setting
  RDMA/nes: Add wqm_quanta module option
  RDMA/nes: Module parameter permissions
  RDMA/cxgb3: Set active_mtu in ib_port_attr
  RDMA/nes: Add support for 4-port 1G HP blade card
  RDMA/nes: Make mini_cm_connect() static
  ...

15 years agoMerge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/teigland/dlm
Linus Torvalds [Fri, 10 Oct 2008 18:13:55 +0000 (11:13 -0700)]
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/teigland/dlm

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/teigland/dlm:
  dlm: choose better identifiers
  dlm: remove bkl
  dlm: fix address compare
  dlm: fix locking of lockspace list in dlm_scand
  dlm: detect available userspace daemon
  dlm: allow multiple lockspace creates

15 years agoMerge git://git.kernel.org/pub/scm/linux/kernel/git/agk/linux-2.6-dm
Linus Torvalds [Fri, 10 Oct 2008 18:11:47 +0000 (11:11 -0700)]
Merge git://git.kernel.org/pub/scm/linux/kernel/git/agk/linux-2.6-dm

* git://git.kernel.org/pub/scm/linux/kernel/git/agk/linux-2.6-dm:
  dm: detect lost queue
  dm: publish dm_vcalloc
  dm: publish dm_table_unplug_all
  dm: publish dm_get_mapinfo
  dm: export struct dm_dev
  dm crypt: avoid unnecessary wait when splitting bio
  dm crypt: tidy ctx pending
  dm crypt: fix async inc_pending
  dm crypt: move dec_pending on error into write_io_submit
  dm crypt: remove inc_pending from write_io_submit
  dm crypt: tidy write loop pending
  dm crypt: tidy crypt alloc
  dm crypt: tidy inc pending
  dm exception store: use chunk_t for_areas
  dm exception store: introduce area_location function
  dm raid1: kcopyd should stop on error if errors handled
  dm mpath: remove is_active from struct dm_path
  dm mpath: use more error codes

Fixed up trivial conflict in drivers/md/dm-mpath.c manually.

15 years agoFix barrier fail detection in XFS
Christoph Hellwig [Fri, 10 Oct 2008 06:28:29 +0000 (17:28 +1100)]
Fix barrier fail detection in XFS

Currently we disable barriers as soon as we get a buffer in xlog_iodone
that has the XBF_ORDERED flag cleared.  But this can be the case not only
for buffers where the barrier failed, but also the first buffer of a
split log write in case of a log wraparound.  Due to the disabled
barriers we can easily get directory corruption on unclean shutdowns.
So instead of using this check add a new buffer flag for failed barrier
writes.

This is a regression vs 2.6.26 caused by patch to use the right macro
to check for the ORDERED flag, as we previously got true returned for
every buffer.

Thanks to Toei Rei for reporting the bug.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Eric Sandeen <sandeen@sandeen.net>
Reviewed-by: David Chinner <david@fromorbit.com>
Signed-off-by: Tim Shimmin <tes@sgi.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agoMerge git://git.kernel.org/pub/scm/linux/kernel/git/steve/gfs2-2.6-nmw
Linus Torvalds [Fri, 10 Oct 2008 18:02:22 +0000 (11:02 -0700)]
Merge git://git.kernel.org/pub/scm/linux/kernel/git/steve/gfs2-2.6-nmw

* git://git.kernel.org/pub/scm/linux/kernel/git/steve/gfs2-2.6-nmw:
  GFS2: Support for I/O barriers
  GFS2: Add UUID to GFS2 sb
  GFS2: high time to take some time over atime
  GFS2: The war on bloat
  GFS2: GFS2 will panic if you misspell any mount options
  GFS2: Direct IO write at end of file error
  GFS2: Use an IS_ERR test rather than a NULL test
  GFS2: Fix race relating to glock min-hold time
  GFS2: Fix & clean up GFS2 rename
  GFS2: rm on multiple nodes causes panic
  GFS2: Fix metafs mounts
  GFS2: Fix debugfs glock file iterator

15 years agoMerge git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi-misc-2.6
Linus Torvalds [Fri, 10 Oct 2008 17:53:26 +0000 (10:53 -0700)]
Merge git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi-misc-2.6

* git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi-misc-2.6: (37 commits)
  [SCSI] zfcp: fix double dbf id usage
  [SCSI] zfcp: wait on SCSI work to be finished before proceeding with init dev
  [SCSI] zfcp: fix erp list usage without using locks
  [SCSI] zfcp: prevent fc_remote_port_delete calls for unregistered rport
  [SCSI] zfcp: fix deadlock caused by shared work queue tasks
  [SCSI] zfcp: put threshold data in hba trace
  [SCSI] zfcp: Simplify zfcp data structures
  [SCSI] zfcp: Simplify get_adapter_by_busid
  [SCSI] zfcp: remove all typedefs and replace them with standards
  [SCSI] zfcp: attach and release SAN nameserver port on demand
  [SCSI] zfcp: remove unused references, declarations and flags
  [SCSI] zfcp: Update message with input from review
  [SCSI] zfcp: add queue_full sysfs attribute
  [SCSI] scsi_dh: suppress comparison warning
  [SCSI] scsi_dh: add Dell product information into rdac device handler
  [SCSI] qla2xxx: remove the unused SCSI_QLOGIC_FC_FIRMWARE option
  [SCSI] qla2xxx: fix printk format warnings
  [SCSI] qla2xxx: Update version number to 8.02.01-k8.
  [SCSI] qla2xxx: Ignore payload reserved-bits during RSCN processing.
  [SCSI] qla2xxx: Additional residual-count corrections during UNDERRUN handling.
  ...

15 years agoMerge branch 'for-2.6.28' of git://git.kernel.dk/linux-2.6-block
Linus Torvalds [Fri, 10 Oct 2008 17:52:45 +0000 (10:52 -0700)]
Merge branch 'for-2.6.28' of git://git.kernel.dk/linux-2.6-block

* 'for-2.6.28' of git://git.kernel.dk/linux-2.6-block: (132 commits)
  doc/cdrom: Trvial documentation error, file not present
  block_dev: fix kernel-doc in new functions
  block: add some comments around the bio read-write flags
  block: mark bio_split_pool static
  block: Find bio sector offset given idx and offset
  block: gendisk integrity wrapper
  block: Switch blk_integrity_compare from bdev to gendisk
  block: Fix double put in blk_integrity_unregister
  block: Introduce integrity data ownership flag
  block: revert part of d7533ad0e132f92e75c1b2eb7c26387b25a583c1
  bio.h: Remove unused conditional code
  block: remove end_{queued|dequeued}_request()
  block: change elevator to use __blk_end_request()
  gdrom: change to use __blk_end_request()
  memstick: change to use __blk_end_request()
  virtio_blk: change to use __blk_end_request()
  blktrace: use BLKTRACE_BDEV_SIZE as the name size for setup structure
  block: add lld busy state exporting interface
  block: Fix blk_start_queueing() to not kick a stopped queue
  include blktrace_api.h in headers_install
  ...

15 years agoMerge phase #1 of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip
Linus Torvalds [Fri, 10 Oct 2008 15:07:53 +0000 (08:07 -0700)]
Merge phase #1 of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip

This merges phase 1 of the x86 tree, which is a collection of branches:

  x86/alternatives, x86/cleanups, x86/commandline, x86/crashdump,
  x86/debug, x86/defconfig, x86/doc, x86/exports, x86/fpu, x86/gart,
  x86/idle, x86/mm, x86/mtrr, x86/nmi-watchdog, x86/oprofile,
  x86/paravirt, x86/reboot, x86/sparse-fixes, x86/tsc, x86/urgent and
  x86/vmalloc

and as Ingo says: "these are the easiest, purely independent x86 topics
with no conflicts, in one nice Octopus merge".

* 'x86-v28-for-linus-phase1' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip: (147 commits)
  x86: mtrr_cleanup: treat WRPROT as UNCACHEABLE
  x86: mtrr_cleanup: first 1M may be covered in var mtrrs
  x86: mtrr_cleanup: print out correct type v2
  x86: trivial printk fix in efi.c
  x86, debug: mtrr_cleanup print out var mtrr before change it
  x86: mtrr_cleanup try gran_size to less than 1M, v3
  x86: mtrr_cleanup try gran_size to less than 1M, cleanup
  x86: change MTRR_SANITIZER to def_bool y
  x86, debug printouts: IOMMU setup failures should not be KERN_ERR
  x86: export set_memory_ro and set_memory_rw
  x86: mtrr_cleanup try gran_size to less than 1M
  x86: mtrr_cleanup prepare to make gran_size to less 1M
  x86: mtrr_cleanup safe to get more spare regs now
  x86_64: be less annoying on boot, v2
  x86: mtrr_cleanup hole size should be less than half of chunk_size, v2
  x86: add mtrr_cleanup_debug command line
  x86: mtrr_cleanup optimization, v2
  x86: don't need to go to chunksize to 4G
  x86_64: be less annoying on boot
  x86, olpc: fix endian bug in openfirmware workaround
  ...

15 years agoPnP: move pnpacpi/pnpbios_init to after PCI init
Linus Torvalds [Fri, 10 Oct 2008 15:00:17 +0000 (08:00 -0700)]
PnP: move pnpacpi/pnpbios_init to after PCI init

We already did that a long time ago for pnp_system_init, but
pnpacpi_init and pnpbios_init remained as subsys_initcalls, and get
linked into the kernel before the arch-specific routines that finalize
the PCI resources (pci_subsys_init).

This means that the PnP routines would either register their resources
before the PCI layer could, or would be unable to check whether a PCI
resource had already been registered.  Both are problematic.

I wanted to do this before 2.6.27, but every time we change something
like this, something breaks.  That said, _every_ single time we trust
some firmware (like PnP tables) more than we trust the hardware itself
(like PCI probing), the problems have been worse.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agoMerge branch 'upstream-2.6.28' of git://git.kernel.org/pub/scm/linux/kernel/git/jgarz...
Linus Torvalds [Fri, 10 Oct 2008 14:46:45 +0000 (07:46 -0700)]
Merge branch 'upstream-2.6.28' of git://git.kernel.org/pub/scm/linux/kernel/git/jgarzik/libata-dev

* 'upstream-2.6.28' of git://git.kernel.org/pub/scm/linux/kernel/git/jgarzik/libata-dev:
  ata_piix: IDE Mode SATA patch for Intel Ibex Peak DeviceIDs
  libata-eh: clear UNIT ATTENTION after reset
  ata_piix: add Hercules EC-900 mini-notebook to ich_laptop short cable list
  libata: reorder ata_device to remove 8 bytes of padding on 64 bits
  [libata] pata_bf54x: Add proper PM operation
  pata_sil680: convert CONFIG_PPC_MERGE to CONFIG_PPC
  libata: Implement disk shock protection support
  [libata] Introduce ata_id_has_unload()
  PATA: RPC now selects HAVE_PATA_PLATFORM for pata platform driver
  ata_piix: drop merged SCR access and use slave_link instead
  libata: implement slave_link
  libata: misc updates to prepare for slave link
  libata: reimplement link iterator
  libata: make SCR access ops per-link

15 years agodm: detect lost queue
Alasdair G Kergon [Fri, 10 Oct 2008 12:37:13 +0000 (13:37 +0100)]
dm: detect lost queue

Detect and report buggy drivers that destroy their request_queue.

Signed-off-by: Alasdair G Kergon <agk@redhat.com>
Cc: Stefan Raspl <raspl@linux.vnet.ibm.com>
Cc: Jens Axboe <jens.axboe@oracle.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
15 years agodm: publish dm_vcalloc
Mikulas Patocka [Fri, 10 Oct 2008 12:37:12 +0000 (13:37 +0100)]
dm: publish dm_vcalloc

Publish dm_vcalloc in include/linux/device-mapper.h because this function is
used by targets.

Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Signed-off-by: Alasdair G Kergon <agk@redhat.com>
15 years agodm: publish dm_table_unplug_all
Mikulas Patocka [Fri, 10 Oct 2008 12:37:11 +0000 (13:37 +0100)]
dm: publish dm_table_unplug_all

Publish dm_table_unplug_all in include/linux/device-mapper.h because this
function is used by targets.

Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Signed-off-by: Alasdair G Kergon <agk@redhat.com>
15 years agodm: publish dm_get_mapinfo
Mikulas Patocka [Fri, 10 Oct 2008 12:37:10 +0000 (13:37 +0100)]
dm: publish dm_get_mapinfo

Publish dm_get_mapinfo in include/linux/device-mapper.h because this function
is used by targets.

Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Signed-off-by: Alasdair G Kergon <agk@redhat.com>
15 years agodm: export struct dm_dev
Mikulas Patocka [Fri, 10 Oct 2008 12:37:09 +0000 (13:37 +0100)]
dm: export struct dm_dev

Split struct dm_dev in two and publish the part that other targets need in
include/linux/device-mapper.h.

Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Signed-off-by: Alasdair G Kergon <agk@redhat.com>
15 years agodm crypt: avoid unnecessary wait when splitting bio
Milan Broz [Fri, 10 Oct 2008 12:37:08 +0000 (13:37 +0100)]
dm crypt: avoid unnecessary wait when splitting bio

Don't wait between submitting crypt requests for a bio unless
we are short of memory.

There are two situations when we must split an encrypted bio:
  1) there are no free pages;
  2) the new bio would violate underlying device restrictions
(e.g. max hw segments).

In case (2) we do not need to wait.

Add output variable to crypt_alloc_buffer() to distinguish between
these cases.

Signed-off-by: Milan Broz <mbroz@redhat.com>
Signed-off-by: Alasdair G Kergon <agk@redhat.com>
15 years agodm crypt: tidy ctx pending
Milan Broz [Fri, 10 Oct 2008 12:37:08 +0000 (13:37 +0100)]
dm crypt: tidy ctx pending

Move the initialisation of ctx->pending into one place, at the
start of crypt_convert().

Introduce crypt_finished to indicate whether or not the encryption
is finished, for use in a later patch.

No functional change.

Signed-off-by: Milan Broz <mbroz@redhat.com>
Signed-off-by: Alasdair G Kergon <agk@redhat.com>
15 years agodm crypt: fix async inc_pending
Milan Broz [Fri, 10 Oct 2008 12:37:07 +0000 (13:37 +0100)]
dm crypt: fix async inc_pending

The pending reference count must be incremented *before* the async work is
queued to another thread, not after.  Otherwise there's a race if the
work completes and decrements the reference count before it gets incremented.

Signed-off-by: Milan Broz <mbroz@redhat.com>
Signed-off-by: Alasdair G Kergon <agk@redhat.com>
15 years agodm crypt: move dec_pending on error into write_io_submit
Milan Broz [Fri, 10 Oct 2008 12:37:06 +0000 (13:37 +0100)]
dm crypt: move dec_pending on error into write_io_submit

Make kcryptd_crypt_write_io_submit() responsible for decrementing
the pending count after an error.

Also fixes a bug in the async path that forgot to decrement it.

Signed-off-by: Milan Broz <mbroz@redhat.com>
Signed-off-by: Alasdair G Kergon <agk@redhat.com>
15 years agodm crypt: remove inc_pending from write_io_submit
Alasdair G Kergon [Fri, 10 Oct 2008 12:37:05 +0000 (13:37 +0100)]
dm crypt: remove inc_pending from write_io_submit

Make the caller reponsible for incrementing the pending count before calling
kcryptd_crypt_write_io_submit() in the non-async case to bring it into line
with the async case.

Signed-off-by: Alasdair G Kergon <agk@redhat.com>
15 years agodm crypt: tidy write loop pending
Milan Broz [Fri, 10 Oct 2008 12:37:04 +0000 (13:37 +0100)]
dm crypt: tidy write loop pending

Move kcryptd_crypt_write_convert_loop inside kcryptd_crypt_write_convert.
This change is needed for a later patch.

No functional change.

Signed-off-by: Milan Broz <mbroz@redhat.com>
Signed-off-by: Alasdair G Kergon <agk@redhat.com>
15 years agodm crypt: tidy crypt alloc
Milan Broz [Fri, 10 Oct 2008 12:37:03 +0000 (13:37 +0100)]
dm crypt: tidy crypt alloc

Factor out crypt io allocation code.
Later patches will call it from another place.

No functional change.

Signed-off-by: Milan Broz <mbroz@redhat.com>
Signed-off-by: Alasdair G Kergon <agk@redhat.com>
15 years agodm crypt: tidy inc pending
Milan Broz [Fri, 10 Oct 2008 12:37:02 +0000 (13:37 +0100)]
dm crypt: tidy inc pending

Move io pending to one place.

No functional change, usefull to simplify debugging.

Signed-off-by: Milan Broz <mbroz@redhat.com>
Signed-off-by: Alasdair G Kergon <agk@redhat.com>
15 years agodm exception store: use chunk_t for_areas
Mikulas Patocka [Fri, 10 Oct 2008 12:37:01 +0000 (13:37 +0100)]
dm exception store: use chunk_t for_areas

Change uint32_t into chunk_t to remove 32-bit limitation on the
number of chunks on systems with 64-bit sector numbers.

Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Signed-off-by: Alasdair G Kergon <agk@redhat.com>
15 years agodm exception store: introduce area_location function
Mikulas Patocka [Fri, 10 Oct 2008 12:37:00 +0000 (13:37 +0100)]
dm exception store: introduce area_location function

Move this logic to a function, because it will be reused later.

Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Signed-off-by: Alasdair G Kergon <agk@redhat.com>
15 years agodm raid1: kcopyd should stop on error if errors handled
Jonathan Brassow [Fri, 10 Oct 2008 12:36:59 +0000 (13:36 +0100)]
dm raid1: kcopyd should stop on error if errors handled

dm-raid1 is setting the 'DM_KCOPYD_IGNORE_ERROR' flag unconditionally
when assigning kcopyd work.  kcopyd is responsible for copying an
assigned section of disk to one or more other disks.  The
'DM_KCOPYD_IGNORE_ERROR' flag affects kcopyd in the following way:

When not set:
kcopyd will immediately stop the copy operation when an error is
encountered.

When set:
kcopyd will try to proceed regardless of errors and try to continue
copying any remaining amount.

Since dm-raid1 tracks regions of the address space that are (or
are not) in sync and it now has the ability to handle these
errors, we can safely enable this optimization.  This optimization
is conditional on whether mirror error handling has been enabled.

Signed-off-by: Jonathan Brassow <jbrassow@redhat.com>
Signed-off-by: Alasdair G Kergon <agk@redhat.com>
15 years agodm mpath: remove is_active from struct dm_path
Kiyoshi Ueda [Fri, 10 Oct 2008 12:36:58 +0000 (13:36 +0100)]
dm mpath: remove is_active from struct dm_path

This patch moves 'is_active' from struct dm_path to struct pgpath
as it does not need exporting.

Signed-off-by: Kiyoshi Ueda <k-ueda@ct.jp.nec.com>
Signed-off-by: Jun'ichi Nomura <j-nomura@ce.jp.nec.com>
Signed-off-by: Alasdair G Kergon <agk@redhat.com>
15 years agodm mpath: use more error codes
Benjamin Marzinski [Fri, 10 Oct 2008 12:36:57 +0000 (13:36 +0100)]
dm mpath: use more error codes

This patch allows path errors from the multipath ctr function to
propagate up to userspace as errno values from the ioctl() call.

This is in response to
  https://www.redhat.com/archives/dm-devel/2008-May/msg00000.html
and
  https://bugzilla.redhat.com/show_bug.cgi?id=444421

The patch only lets through the errors that it needs to in order to
get the path errors from parse_path().

Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com>
Signed-off-by: Alasdair G Kergon <agk@redhat.com>
15 years agodoc/cdrom: Trvial documentation error, file not present
Randy Dunlap [Fri, 10 Oct 2008 06:22:44 +0000 (08:22 +0200)]
doc/cdrom: Trvial documentation error, file not present

The sbpcd tester program is not included in the kernel source tree,
so remove the reference to it.

Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
Reported-by: Nick Warne <nick@ukfsn.org>
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>