openwrt/staging/blogic.git
16 years agoDon't crash on IOMMU overflow in A100U2W driver
Mikulas Patocka [Tue, 15 Jul 2008 21:19:55 +0000 (17:19 -0400)]
Don't crash on IOMMU overflow in A100U2W driver

Handle IOMMU overflow correctly, by retrying.  IOMMU errors can happen
and drivers must deal with them.

Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agoBUG_ON on kernel misbehavior on A100U2W driver
Mikulas Patocka [Tue, 15 Jul 2008 21:18:38 +0000 (17:18 -0400)]
BUG_ON on kernel misbehavior on A100U2W driver

With broken Sparc64 IOMMU accounting, the kernel submits larger requests
then allowed.  Better to crash on BUG than corrupt memory.

Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Acked-by: James Bottomley <James.Bottomley@HansenPartnership.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agoAdd udelay to A100U2W SCSI driver
Mikulas Patocka [Tue, 15 Jul 2008 21:16:38 +0000 (17:16 -0400)]
Add udelay to A100U2W SCSI driver

udelay is required on Sun Ultra 5.

I don't know any reason or explanation for this, it was found purely
experimentally.

Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agoFix endianity in A100U2W SCSI driver
Mikulas Patocka [Tue, 15 Jul 2008 21:15:41 +0000 (17:15 -0400)]
Fix endianity in A100U2W SCSI driver

Support big endian systems in a100u2w driver.

Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agogeneric ipi function calls: wait on alloc failure fallback
Jeremy Fitzhardinge [Tue, 15 Jul 2008 20:22:49 +0000 (13:22 -0700)]
generic ipi function calls: wait on alloc failure fallback

When a GFP_ATOMIC allocation fails, it falls back to allocating the
data on the stack and converting it to a waiting call.

Make sure we actually wait in this case.

Signed-off-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agoMerge branch 'generic-ipi-for-linus' of git://git.kernel.org/pub/scm/linux/kernel...
Linus Torvalds [Tue, 15 Jul 2008 21:02:33 +0000 (14:02 -0700)]
Merge branch 'generic-ipi-for-linus' of git://git./linux/kernel/git/tip/linux-2.6-tip

* 'generic-ipi-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip: (22 commits)
  generic-ipi: more merge fallout
  generic-ipi: merge fix
  x86, visws: use mach-default/entry_arch.h
  x86, visws: fix generic-ipi build
  generic-ipi: fixlet
  generic-ipi: fix s390 build bug
  generic-ipi: fix linux-next tree build failure
  fix: "smp_call_function: get rid of the unused nonatomic/retry argument"
  fix: "smp_call_function: get rid of the unused nonatomic/retry argument"
  fix "smp_call_function: get rid of the unused nonatomic/retry argument"
  on_each_cpu(): kill unused 'retry' parameter
  smp_call_function: get rid of the unused nonatomic/retry argument
  sh: convert to generic helpers for IPI function calls
  parisc: convert to generic helpers for IPI function calls
  mips: convert to generic helpers for IPI function calls
  m32r: convert to generic helpers for IPI function calls
  arm: convert to generic helpers for IPI function calls
  alpha: convert to generic helpers for IPI function calls
  ia64: convert to generic helpers for IPI function calls
  powerpc: convert to generic helpers for IPI function calls
  ...

Fix trivial conflicts due to rcu updates in kernel/rcupdate.c manually

16 years agoMerge branch 'core/rcu-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git...
Linus Torvalds [Tue, 15 Jul 2008 20:59:31 +0000 (13:59 -0700)]
Merge branch 'core/rcu-for-linus' of git://git./linux/kernel/git/tip/linux-2.6-tip

* 'core/rcu-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip: (23 commits)
  rcu classic: update qlen when cpu offline
  rcu: make rcutorture even more vicious: invoke RCU readers from irq handlers (timers)
  rcu: make quiescent rcutorture less power-hungry
  rcu, rcutorture: make quiescent rcutorture less power-hungry
  rcu: make rcutorture more vicious: reinstate boot-time testing
  rcu: make rcutorture more vicious: add stutter feature
  rcutorture: WARN_ON_ONCE(1) when detecting an error
  rcu: remove unused field struct rcu_data::rcu_tasklet
  Revert "prohibit rcutorture from being compiled into the kernel"
  rcu: fix nf_conntrack_helper.c build bug
  rculist.h: fix include in net/netfilter/nf_conntrack_netlink.c
  rcu: remove duplicated include in kernel/rcupreempt.c
  rcu: remove duplicated include in kernel/rcupreempt_trace.c
  RCU, rculist.h: fix list iterators
  rcu: fix rcu_try_flip_waitack_needed() to prevent grace-period stall
  rculist.h: use the rcu API
  rcu: split list.h and move rcu-protected lists into rculist.h
  sched: 1Q08 RCU doc update, add call_rcu_sched()
  rcu: add call_rcu_sched() and friends to rcutorture
  rcu: add rcu_barrier_sched() and rcu_barrier_bh()
  ...

16 years agomm: fix build on non-mmu machines
Sebastian Siewior [Tue, 15 Jul 2008 20:28:46 +0000 (22:28 +0200)]
mm: fix build on non-mmu machines

Commit 1ea0704e0d aka "mm: add a ptep_modify_prot transaction abstraction"

caused:

|  CC      init/main.o
|In file included from include2/asm/pgtable.h:68,
|                 from /home/bigeasy/git/linux-2.6-m68k/include/linux/mm.h:39,
|                 from include2/asm/uaccess.h:8,
|                 from /home/bigeasy/git/linux-2.6-m68k/include/linux/poll.h:13,
|                 from /home/bigeasy/git/linux-2.6-m68k/include/linux/rtc.h:113,
|                 from /home/bigeasy/git/linux-2.6-m68k/include/linux/efi.h:19,
|                 from /home/bigeasy/git/linux-2.6-m68k/init/main.c:43:
|/linux-2.6/include/asm-generic/pgtable.h: In function '__ptep_modify_prot_start':
|/linux-2.6/include/asm-generic/pgtable.h:209: error: implicit declaration of function 'ptep_get_and_clear'
|/linux-2.6/include/asm-generic/pgtable.h:209: error: incompatible types in return
|/linux-2.6/include/asm-generic/pgtable.h: In function '__ptep_modify_prot_commit':
|/linux-2.6/include/asm-generic/pgtable.h:220: error: implicit declaration of function 'set_pte_at'
|make[2]: *** [init/main.o] Error 1
|make[1]: *** [init] Error 2
|make: *** [sub-make] Error 2

on my m68knommu box.

Acked-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Hugh Dickins <hugh@veritas.com>
Cc: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Sebastian Siewior <bigeasy@linutronix.de>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agoftrace: maintainer
Steven Rostedt [Tue, 15 Jul 2008 17:28:14 +0000 (13:28 -0400)]
ftrace: maintainer

I'm willing to take responsibility for ftrace, and follow up on any
issues that arise due to it.

Signed-off-by: Steven Rostedt <srostedt@redhat.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agogeneric-ipi: more merge fallout
Ingo Molnar [Tue, 15 Jul 2008 20:08:52 +0000 (22:08 +0200)]
generic-ipi: more merge fallout

fix more API change fallout in recently merged upstream changes.

Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agogeneric-ipi: merge fix
Ingo Molnar [Tue, 15 Jul 2008 20:03:56 +0000 (22:03 +0200)]
generic-ipi: merge fix

fix merge fallout:

arch/x86/pci/amd_bus.c: In function ‘enable_pci_io_ecs':
arch/x86/pci/amd_bus.c:581: error: too many arguments to function ‘on_each_cpu'

Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agoMerge branch 'generic-ipi' into generic-ipi-for-linus
Ingo Molnar [Tue, 15 Jul 2008 19:55:59 +0000 (21:55 +0200)]
Merge branch 'generic-ipi' into generic-ipi-for-linus

Conflicts:

arch/powerpc/Kconfig
arch/s390/kernel/time.c
arch/x86/kernel/apic_32.c
arch/x86/kernel/cpu/perfctr-watchdog.c
arch/x86/kernel/i8259_64.c
arch/x86/kernel/ldt.c
arch/x86/kernel/nmi_64.c
arch/x86/kernel/smpboot.c
arch/x86/xen/smp.c
include/asm-x86/hw_irq_32.h
include/asm-x86/hw_irq_64.h
include/asm-x86/mach-default/irq_vectors.h
include/asm-x86/mach-voyager/irq_vectors.h
include/asm-x86/smp.h
kernel/Makefile

Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agoMerge branch 'sbp2-spindown' of git://git.kernel.org/pub/scm/linux/kernel/git/ieee139...
Linus Torvalds [Tue, 15 Jul 2008 19:39:44 +0000 (12:39 -0700)]
Merge branch 'sbp2-spindown' of git://git./linux/kernel/git/ieee1394/linux1394-2.6

* 'sbp2-spindown' of git://git.kernel.org/pub/scm/linux/kernel/git/ieee1394/linux1394-2.6:
  ieee1394: sbp2: spin disks down on suspend and shutdown
  firewire: fw-sbp2: spin disks down on suspend and shutdown
  ieee1394: sbp2: fix spindown for PL-3507 and TSB42AA9 firmwares
  firewire: fw-sbp2: fix spindown for PL-3507 and TSB42AA9 firmwares
  scsi: sd: optionally set power condition in START STOP UNIT

16 years agoMerge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ieee1394...
Linus Torvalds [Tue, 15 Jul 2008 19:39:13 +0000 (12:39 -0700)]
Merge branch 'for-linus' of git://git./linux/kernel/git/ieee1394/linux1394-2.6

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ieee1394/linux1394-2.6:
  firewire: don't respond to broadcast write requests
  firewire: clean up fw_card reference counting
  firewire: clean up some includes
  firewire: remove unused struct members
  firewire: implement broadcast_channel CSR for 1394a compliance
  ieee1394: dump mmapped iso buffers in core files
  ieee1394: raw1394: Push the BKL down into the driver ioctls
  ieee1394: video1394: reorder module init, prepare BKL removal
  ieee1394: reduce log noise about config ROM CRC errors

16 years agoMerge branch 'core/rcu' into core/rcu-for-linus
Ingo Molnar [Tue, 15 Jul 2008 19:10:12 +0000 (21:10 +0200)]
Merge branch 'core/rcu' into core/rcu-for-linus

16 years agoMerge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/penberg...
Linus Torvalds [Tue, 15 Jul 2008 18:26:14 +0000 (11:26 -0700)]
Merge branch 'for-linus' of git://git./linux/kernel/git/penberg/slab-2.6

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/penberg/slab-2.6:
  slab: rename slab_destroy_objs
  slub: current is always valid
  slub: Add check for kfree() of non slab objects.

16 years agoMerge branch 'upstream-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jgarzi...
Linus Torvalds [Tue, 15 Jul 2008 18:18:10 +0000 (11:18 -0700)]
Merge branch 'upstream-linus' of git://git./linux/kernel/git/jgarzik/libata-dev

* 'upstream-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jgarzik/libata-dev:
  AHCI: Remove an unnecessary flush from ahci_qc_issue
  AHCI: speed up resume
  [libata] Add support for VPD page b1
  ata: endianness annotations in pata drivers
  libata-eh: update atapi_eh_request_sense() to take @dev instead of @qc
  [libata] sata_svw: update code comments relating to data corruption
  libata/ahci: enclosure management support
  libata: improve EH internal command timeout handling
  libata: use ULONG_MAX to terminate reset timeout table
  libata: improve EH retry delay handling
  libata: consistently use msecs for time durations

16 years agoMerge branch 'i2c-for-linus' of git://jdelvare.pck.nerim.net/jdelvare-2.6
Linus Torvalds [Tue, 15 Jul 2008 18:16:05 +0000 (11:16 -0700)]
Merge branch 'i2c-for-linus' of git://jdelvare.pck.nerim.net/jdelvare-2.6

* 'i2c-for-linus' of git://jdelvare.pck.nerim.net/jdelvare-2.6: (56 commits)
  i2c: Add detection capability to new-style drivers
  i2c: Call client_unregister for new-style devices too
  i2c: Clean up old chip drivers
  i2c-ibm_iic: Register child nodes
  i2c: New-style EEPROM driver using device IDs
  i2c: Export the i2c_bus_type symbol
  i2c-au1550: Fix PM support
  i2c-dev: Delete empty detach_client callback
  i2c: Drop stray references to lm_sensors
  i2c: Check for ACPI resource conflicts
  i2c-ocores: basic PM support
  i2c-sibyte: SWARM I2C board initialization
  i2c-i801: Fix handling of error conditions
  i2c-i801: Rename local variable temp to status
  i2c-i801: Properly report bus arbitration loss
  i2c-i801: Remove verbose debugging messages
  i2c-algo-pcf: Drop unused struct members
  i2c-algo-pcf: Multi-master lost-arbitration improvement
  i2c: Deprecate the legacy gpio drivers
  i2c-pxa: Initialize early
  ...

16 years agoMerge git://git.kernel.org/pub/scm/linux/kernel/git/bart/ide-2.6
Linus Torvalds [Tue, 15 Jul 2008 18:15:36 +0000 (11:15 -0700)]
Merge git://git./linux/kernel/git/bart/ide-2.6

* git://git.kernel.org/pub/scm/linux/kernel/git/bart/ide-2.6: (80 commits)
  ide-floppy: fix unfortunate function naming
  ide-tape: unify idetape_create_read/write_cmd
  ide: add ide_pc_intr() helper
  ide-{floppy,scsi}: read Status Register before stopping DMA engine
  ide-scsi: add more debugging to idescsi_pc_intr()
  ide-scsi: use pc->callback
  ide-floppy: add more debugging to idefloppy_pc_intr()
  ide-tape: always log debug info in idetape_pc_intr() if debugging is enabled
  ide-tape: add ide_tape_io_buffers() helper
  ide-tape: factor out DSC handling from idetape_pc_intr()
  ide-{floppy,tape}: move checking of ->failed_pc to ->callback
  ide: add ide_issue_pc() helper
  ide: add PC_FLAG_DRQ_INTERRUPT pc flag
  ide-scsi: move idescsi_map_sg() call out from idescsi_issue_pc()
  ide: add ide_transfer_pc() helper
  ide-scsi: set drive->scsi flag for devices handled by the driver
  ide-{cd,floppy,tape}: remove checking for drive->scsi
  ide: add PC_FLAG_ZIP_DRIVE pc flag
  ide-tape: factor out waiting for good ireason from idetape_transfer_pc()
  ide-tape: set PC_FLAG_DMA_IN_PROGRESS flag in idetape_transfer_pc()
  ...

16 years agoide-floppy: fix unfortunate function naming
Borislav Petkov [Tue, 15 Jul 2008 19:22:03 +0000 (21:22 +0200)]
ide-floppy: fix unfortunate function naming

mv idefloppy_transfer_pc1 idefloppy_start_pc_transfer
mv idefloppy_transfer_pc2 idefloppy_transfer_pc

which describes their functionality and disambiguates them. There should be no
functionality change introduced by this patch.

Signed-off-by: Borislav Petkov <petkovbb@gmail.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide-tape: unify idetape_create_read/write_cmd
Borislav Petkov [Tue, 15 Jul 2008 19:22:03 +0000 (21:22 +0200)]
ide-tape: unify idetape_create_read/write_cmd

A straightforward one. There should be no functional change resulting from this
change.

[bart: minor fixups]

Signed-off-by: Borislav Petkov <petkovbb@gmail.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide: add ide_pc_intr() helper
Bartlomiej Zolnierkiewicz [Tue, 15 Jul 2008 19:22:03 +0000 (21:22 +0200)]
ide: add ide_pc_intr() helper

* ide-tape.c: add 'drive' argument to idetape_update_buffers().

* Add generic ide_pc_intr() helper to ide-atapi.c and then
  convert ide-{floppy,tape,scsi} device drivers to use it.

* ide-tape.c: remove no longer needed DBG_PC_INTR.

There should be no functional changes caused by this patch
(unless the debugging is explicitely compiled in).

Cc: Borislav Petkov <petkovbb@gmail.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide-{floppy,scsi}: read Status Register before stopping DMA engine
Bartlomiej Zolnierkiewicz [Tue, 15 Jul 2008 19:22:03 +0000 (21:22 +0200)]
ide-{floppy,scsi}: read Status Register before stopping DMA engine

Read Status Register before stopping DMA engine to match ide-tape
device driver - it should be safe and shouldn't affect anything.

This is a preparation for adding generic ide_pc_intr() helper.

Cc: Borislav Petkov <petkovbb@gmail.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide-scsi: add more debugging to idescsi_pc_intr()
Bartlomiej Zolnierkiewicz [Tue, 15 Jul 2008 19:22:02 +0000 (21:22 +0200)]
ide-scsi: add more debugging to idescsi_pc_intr()

Add more debugging to idescsi_pc_intr() to match ide-tape's
idetape_pc_intr().

While at it:

* Correct the first debug message.

This is a preparation for adding generic ide_pc_intr() helper.

Cc: Borislav Petkov <petkovbb@gmail.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide-scsi: use pc->callback
Bartlomiej Zolnierkiewicz [Tue, 15 Jul 2008 19:22:02 +0000 (21:22 +0200)]
ide-scsi: use pc->callback

* Add ide_scsi_callback() pc->callback implementation, then update
  idescsi_check_condition() and idescsi_queue() to setup ->callback.

* Convert idescsi_pc_intr() to use pc->callback.

This is a preparation for adding generic ide_pc_intr() helper.

Cc: Borislav Petkov <petkovbb@gmail.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide-floppy: add more debugging to idefloppy_pc_intr()
Bartlomiej Zolnierkiewicz [Tue, 15 Jul 2008 19:22:02 +0000 (21:22 +0200)]
ide-floppy: add more debugging to idefloppy_pc_intr()

Add more debugging to idefloppy_pc_intr() to match ide-tape's
idetape_pc_intr().

While at it:

* Correct the first debug message.

* Log device name with "DMA finished" message.

This is a preparation for adding generic ide_pc_intr() helper.

Cc: Borislav Petkov <petkovbb@gmail.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide-tape: always log debug info in idetape_pc_intr() if debugging is enabled
Bartlomiej Zolnierkiewicz [Tue, 15 Jul 2008 19:22:01 +0000 (21:22 +0200)]
ide-tape: always log debug info in idetape_pc_intr() if debugging is enabled

Add DBG_PC_INTR debug level and use it to always log debug info
in idetape_pc_intr() if debugging is enabled.

While at it:

* Use drive->name instead of tape->name.

* Log device name with "DMA finished" message.

This is a preparation for adding generic ide_pc_intr() helper.

Cc: Borislav Petkov <petkovbb@gmail.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide-tape: add ide_tape_io_buffers() helper
Bartlomiej Zolnierkiewicz [Tue, 15 Jul 2008 19:22:01 +0000 (21:22 +0200)]
ide-tape: add ide_tape_io_buffers() helper

* Add ide_tape_io_buffers() helper which is a wrapper for
  idetape_{in,out}put_buffers() and convert idetape_pc_intr()
  to use it.

* Remove no longer used idetape_io_buf typedef.

There should be no functional changes caused by this patch.

Cc: Borislav Petkov <petkovbb@gmail.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>---
16 years agoide-tape: factor out DSC handling from idetape_pc_intr()
Bartlomiej Zolnierkiewicz [Tue, 15 Jul 2008 19:22:01 +0000 (21:22 +0200)]
ide-tape: factor out DSC handling from idetape_pc_intr()

Factor out DSC handling from idetape_pc_intr() to ide_tape_handle_dsc()
helper as a preparation for adding generic ide_pc_intr() helper.

There should be no functional changes caused by this patch.

Cc: Borislav Petkov <petkovbb@gmail.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide-{floppy,tape}: move checking of ->failed_pc to ->callback
Bartlomiej Zolnierkiewicz [Tue, 15 Jul 2008 19:22:01 +0000 (21:22 +0200)]
ide-{floppy,tape}: move checking of ->failed_pc to ->callback

Move checking/resetting of ->failed_pc from ide*_pc_intr() to ->callback
as a preparation for adding generic ide_pc_intr() helper.

There should be no functional changes caused by this patch.

Cc: Borislav Petkov <petkovbb@gmail.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>---
16 years agoide: add ide_issue_pc() helper
Bartlomiej Zolnierkiewicz [Tue, 15 Jul 2008 19:22:00 +0000 (21:22 +0200)]
ide: add ide_issue_pc() helper

Add generic ide_issue_pc() helper to ide-atapi.c and then
convert ide-{floppy,tape,scsi} device drivers to use it.

There should be no functional changes caused by this patch.

Cc: Borislav Petkov <petkovbb@gmail.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide: add PC_FLAG_DRQ_INTERRUPT pc flag
Bartlomiej Zolnierkiewicz [Tue, 15 Jul 2008 19:21:59 +0000 (21:21 +0200)]
ide: add PC_FLAG_DRQ_INTERRUPT pc flag

Add PC_FLAG_DRQ_INTERRUPT pc flag, set it in ide*_do_request()
and check for it (instead of checking for IDE*_FLAG_DRQ_INTERRUPT)
in ide*_issue_pc().  This is a preparation for adding generic
ide_issue_pc() helper.

There should be no functional changes caused by this patch.

Cc: Borislav Petkov <petkovbb@gmail.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide-scsi: move idescsi_map_sg() call out from idescsi_issue_pc()
Bartlomiej Zolnierkiewicz [Tue, 15 Jul 2008 19:21:58 +0000 (21:21 +0200)]
ide-scsi: move idescsi_map_sg() call out from idescsi_issue_pc()

Move idescsi_map_sg() call out from idescsi_issue_pc()
to idescsi_do_request() as a preparation to adding generic
ide_issue_pc() helper.

There should be no functional changes caused by this patch.

Cc: Borislav Petkov <petkovbb@gmail.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide: add ide_transfer_pc() helper
Bartlomiej Zolnierkiewicz [Tue, 15 Jul 2008 19:21:58 +0000 (21:21 +0200)]
ide: add ide_transfer_pc() helper

* Add ide-atapi.c file for generic ATAPI support together with
  CONFIG_IDE_ATAPI config option.

* Add generic ide_transfer_pc() helper to ide-atapi.c and then
  convert ide-{floppy,tape,scsi} device drivers to use it.

There should be no functional changes caused by this patch.

Cc: Borislav Petkov <petkovbb@gmail.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide-scsi: set drive->scsi flag for devices handled by the driver
Bartlomiej Zolnierkiewicz [Tue, 15 Jul 2008 19:21:58 +0000 (21:21 +0200)]
ide-scsi: set drive->scsi flag for devices handled by the driver

This is a preparation for adding generic ide_transfer_pc() helper.

There should be no functional changes caused by this patch.

Cc: Borislav Petkov <petkovbb@gmail.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide-{cd,floppy,tape}: remove checking for drive->scsi
Bartlomiej Zolnierkiewicz [Tue, 15 Jul 2008 19:21:57 +0000 (21:21 +0200)]
ide-{cd,floppy,tape}: remove checking for drive->scsi

Remove checking for drive->scsi which is no longer set by IDE core code
(leave the flag since it will be re-used for generic ATAPI support).

Cc: Borislav Petkov <petkovbb@gmail.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide: add PC_FLAG_ZIP_DRIVE pc flag
Bartlomiej Zolnierkiewicz [Tue, 15 Jul 2008 19:21:57 +0000 (21:21 +0200)]
ide: add PC_FLAG_ZIP_DRIVE pc flag

Add PC_FLAG_ZIP_DRIVE pc flag, set it in idefloppy_do_request()
and check for it (instead of checking for IDEFLOPPY_FLAG_ZIP_DRIVE)
in idefloppy_transfer_pc().  This is a preparation for adding
generic ide_transfer_pc() helper.

There should be no functional changes caused by this patch.

Cc: Borislav Petkov <petkovbb@gmail.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide-tape: factor out waiting for good ireason from idetape_transfer_pc()
Bartlomiej Zolnierkiewicz [Tue, 15 Jul 2008 19:21:57 +0000 (21:21 +0200)]
ide-tape: factor out waiting for good ireason from idetape_transfer_pc()

Factor out waiting for good ireason from idetape_transfer_pc()
to ide_tape_wait_ireason() as a preparation for adding generic
ide_transfer_pc() helper.

There should be no functional changes caused by this patch.

Cc: Borislav Petkov <petkovbb@gmail.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide-tape: set PC_FLAG_DMA_IN_PROGRESS flag in idetape_transfer_pc()
Bartlomiej Zolnierkiewicz [Tue, 15 Jul 2008 19:21:57 +0000 (21:21 +0200)]
ide-tape: set PC_FLAG_DMA_IN_PROGRESS flag in idetape_transfer_pc()

Set PC_FLAG_DMA_IN_PROGRESS flag in idetape_transfer_pc() instead of
idetape_issue_pc() to match the other ATAPI device drivers.

Cc: Borislav Petkov <petkovbb@gmail.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide-floppy: start DMA engine in idefloppy_transfer_pc1()
Bartlomiej Zolnierkiewicz [Tue, 15 Jul 2008 19:21:56 +0000 (21:21 +0200)]
ide-floppy: start DMA engine in idefloppy_transfer_pc1()

Start DMA engine and set PC_FLAG_DMA_IN_PROGRESS flag in
idefloppy_transfer_pc1() instead of idefloppy_issue_pc()
so the Status Register and the Interrupt Reason Register
are checked first.

Cc: Borislav Petkov <petkovbb@gmail.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide-{floppy,tape}: PC_FLAG_DMA_RECOMMENDED -> PC_FLAG_DMA_OK
Bartlomiej Zolnierkiewicz [Tue, 15 Jul 2008 19:21:56 +0000 (21:21 +0200)]
ide-{floppy,tape}: PC_FLAG_DMA_RECOMMENDED -> PC_FLAG_DMA_OK

* Use PC_FLAG_DMA_OK flag instead of PC_FLAG_DMA_RECOMMENDED one.

* Remove no longer used PC_FLAG_DMA_RECOMMENDED flag.

There should be no functional changes caused by this patch.

Cc: Borislav Petkov <petkovbb@gmail.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide-{floppy,tape}: merge pc->idefloppy_callback and pc->idetape_callback
Bartlomiej Zolnierkiewicz [Tue, 15 Jul 2008 19:21:56 +0000 (21:21 +0200)]
ide-{floppy,tape}: merge pc->idefloppy_callback and pc->idetape_callback

Merge pc->idefloppy_callback and pc->idetape_callback into pc->callback.

There should be no functional changes caused by this patch.

Cc: Borislav Petkov <petkovbb@gmail.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide-floppy: merge callbacks
Borislav Petkov [Tue, 15 Jul 2008 19:21:56 +0000 (21:21 +0200)]
ide-floppy: merge callbacks

The appropriate functionality of the callback is established through querying
the ATAPI packet command in pc->c[0].

While at it, simplify if (floppy->failed_pc)-branch to be found in the original
idefloppy_request_sense_callback().

Bart:
- keep handling for blk_pc_request() requests unchanged + add FIXME
- add uptodate variable + leave just one idefloppy_end_request() call
- add newline to the debug message

Signed-off-by: Borislav Petkov <petkovbb@gmail.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide-tape: make pc->idetape_callback void
Bartlomiej Zolnierkiewicz [Tue, 15 Jul 2008 19:21:55 +0000 (21:21 +0200)]
ide-tape: make pc->idetape_callback void

There should be no functional changes caused by this patch.

Cc: Borislav Petkov <petkovbb@gmail.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide-tape: merge callbacks
Bartlomiej Zolnierkiewicz [Tue, 15 Jul 2008 19:21:55 +0000 (21:21 +0200)]
ide-tape: merge callbacks

The appropriate functionality of the callback is established through querying
the ATAPI packet command in pc->c[0].

While at it:
- add uptodate variable + leave just one idetape_end_request() call
- don't use HWGROUP() macro

Cc: Borislav Petkov <petkovbb@gmail.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide-tape: make idetape_retry_pc() void
Bartlomiej Zolnierkiewicz [Tue, 15 Jul 2008 19:21:55 +0000 (21:21 +0200)]
ide-tape: make idetape_retry_pc() void

idetape_retry_pc() always returns ide_stopped so make it void.

There should be no functional changes caused by this patch.

Cc: Borislav Petkov <petkovbb@gmail.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide-{floppy,tape,scsi}: log device name instead of driver name
Bartlomiej Zolnierkiewicz [Tue, 15 Jul 2008 19:21:54 +0000 (21:21 +0200)]
ide-{floppy,tape,scsi}: log device name instead of driver name

Log device name instead of driver name in *_pc_intr() and *_transfer_pc*().

While at it:

* Merge two consecutive printk()-s in *_pc_intr() together.

* Replace "floppy"/"tape"/"scsi" references in printk()-s by "device".

Cc: Borislav Petkov <petkovbb@gmail.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide-floppy: merge idefloppy_transfer_pc() and idefloppy_transfer_pc1()
Bartlomiej Zolnierkiewicz [Tue, 15 Jul 2008 19:21:54 +0000 (21:21 +0200)]
ide-floppy: merge idefloppy_transfer_pc() and idefloppy_transfer_pc1()

* Check IDEFLOPPY_FLAG_ZIP_DRIVE flag in idefloppy_transfer_pc1()
  and skip idefloppy_transfer_pc2()-phase if the flag is not set.

* Always use idefloppy_transfer_pc1() in idefloppy_issue_pc()
  and remove no longer needed idefloppy_transfer_pc().

There should be no functional changes caused by this patch.

Cc: Borislav Petkov <petkovbb@gmail.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide-tape: remove SIMULATE_ERRORS debug code
Bartlomiej Zolnierkiewicz [Tue, 15 Jul 2008 19:21:54 +0000 (21:21 +0200)]
ide-tape: remove SIMULATE_ERRORS debug code

Cc: Borislav Petkov <petkovbb@gmail.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide-tape: remove stale comments from idetape_pc_intr()
Bartlomiej Zolnierkiewicz [Tue, 15 Jul 2008 19:21:54 +0000 (21:21 +0200)]
ide-tape: remove stale comments from idetape_pc_intr()

Cc: Borislav Petkov <petkovbb@gmail.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide-tape: remove unneeded CONFIG_BLK_DEV_IDEDMA ifdef
Bartlomiej Zolnierkiewicz [Tue, 15 Jul 2008 19:21:54 +0000 (21:21 +0200)]
ide-tape: remove unneeded CONFIG_BLK_DEV_IDEDMA ifdef

PC_FLAG_DMA_IN_PROGRESS flag is never set if DMA support is disabled.

Cc: Borislav Petkov <petkovbb@gmail.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide-tape: remove superfluous warning message from idetape_issue_pc()
Bartlomiej Zolnierkiewicz [Tue, 15 Jul 2008 19:21:53 +0000 (21:21 +0200)]
ide-tape: remove superfluous warning message from idetape_issue_pc()

ide_dma_off() prints info about DMA being disabled.

Cc: Borislav Petkov <petkovbb@gmail.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide-tape: remove superfluous error message from idetape_pc_intr()
Bartlomiej Zolnierkiewicz [Tue, 15 Jul 2008 19:21:53 +0000 (21:21 +0200)]
ide-tape: remove superfluous error message from idetape_pc_intr()

ide_dma_off() prints info about DMA being disabled.

Cc: Borislav Petkov <petkovbb@gmail.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide-tape: idetape_pc_intr() should use local_irq_enable_in_hardirq()
Bartlomiej Zolnierkiewicz [Tue, 15 Jul 2008 19:21:53 +0000 (21:21 +0200)]
ide-tape: idetape_pc_intr() should use local_irq_enable_in_hardirq()

Cc: Borislav Petkov <petkovbb@gmail.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide-scsi: add debug_log() macro
Bartlomiej Zolnierkiewicz [Tue, 15 Jul 2008 19:21:52 +0000 (21:21 +0200)]
ide-scsi: add debug_log() macro

Add debug_log() macro and convert the driver to use it.

[ This makes debug messages to be always prefixed with "ide-scsi: "
  and use KERN_INFO level. ]

While at it:

* Change "DMA complete" debug message to "DMA finished" to match
  other ATAPI device drivers.

* Use __func__.

Cc: Borislav Petkov <petkovbb@gmail.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide-scsi: remove superfluous BUG_ON() from idescsi_transfer_pc()
Bartlomiej Zolnierkiewicz [Tue, 15 Jul 2008 19:21:52 +0000 (21:21 +0200)]
ide-scsi: remove superfluous BUG_ON() from idescsi_transfer_pc()

ide_set_handler() bugs on ->handler == NULL so no need to do it
in idescsi_transfer_pc().

There should be no functional changes caused by this patch.

Cc: Borislav Petkov <petkovbb@gmail.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide-scsi: merge idescsi_input_buffers() and idescsi_output_buffers()
Bartlomiej Zolnierkiewicz [Tue, 15 Jul 2008 19:21:52 +0000 (21:21 +0200)]
ide-scsi: merge idescsi_input_buffers() and idescsi_output_buffers()

* Merge idescsi_input_buffers() and idescsi_output_buffers()
  into ide_scsi_io_buffers() helper.

While at it:

* Log device name instead of driver name on error.

* Use xfer_func_t.

Cc: Borislav Petkov <petkovbb@gmail.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide-scsi: fix Interrupt Reason checking in idescsi_pc_intr()
Bartlomiej Zolnierkiewicz [Tue, 15 Jul 2008 19:21:52 +0000 (21:21 +0200)]
ide-scsi: fix Interrupt Reason checking in idescsi_pc_intr()

Set PC_FLAG_WRITING pc flag in idescsi_queue() (if needed)
and then fix Interrupt Reason checking in idescsi_pc_intr().

Cc: Borislav Petkov <petkovbb@gmail.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide-scsi: fix handling of DMA errors in idescsi_pc_intr()
Bartlomiej Zolnierkiewicz [Tue, 15 Jul 2008 19:21:51 +0000 (21:21 +0200)]
ide-scsi: fix handling of DMA errors in idescsi_pc_intr()

Check return value of ->dma_end method and if there was a DMA error
handle it accordingly (set PC_FLAG_DMA_ERROR pc flag, don't update
pc->xferred and increase rq->errors).

Also move debug message in the right place while at it.

Cc: Borislav Petkov <petkovbb@gmail.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide-scsi: fix DRQ checking for DMA transfers in idescsi_pc_intr()
Bartlomiej Zolnierkiewicz [Tue, 15 Jul 2008 19:21:51 +0000 (21:21 +0200)]
ide-scsi: fix DRQ checking for DMA transfers in idescsi_pc_intr()

If DRQ bit of Status Register is not cleared it is an error condition
and should be handled accordingly (disable DMA + reset the device).

Cc: Borislav Petkov <petkovbb@gmail.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide-scsi: fix race in idescsi_transfer_pc()
Bartlomiej Zolnierkiewicz [Tue, 15 Jul 2008 19:21:51 +0000 (21:21 +0200)]
ide-scsi: fix race in idescsi_transfer_pc()

Start DMA engine before sending content of packet command (otherwise
it is possible that IRQ will happen before DMA engine is started).

Cc: Borislav Petkov <petkovbb@gmail.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide: remove action argument in ide_do_drive_cmd
FUJITA Tomonori [Tue, 15 Jul 2008 19:21:51 +0000 (21:21 +0200)]
ide: remove action argument in ide_do_drive_cmd

ide_do_drive_cmd is called only with ide_preempt action argument. So
we can remove the action argument in ide_do_drive_cmd and ide_action_t
typedef.

This patch also includes two minor cleanups: 1) ide_do_drive_cmd
always succeeds so we don't need the return value; 2) the callers use
blk_rq_init before ide_do_drive_cmd so there is no need to initialize
rq->errors.

Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Cc: Borislav Petkov <petkovbb@gmail.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide-scsi: replace ide_do_drive_cmd with blk_execute_rq_nowait
FUJITA Tomonori [Tue, 15 Jul 2008 19:21:50 +0000 (21:21 +0200)]
ide-scsi: replace ide_do_drive_cmd with blk_execute_rq_nowait

All the callers of ide_do_drive_cmd() except for ide-scsi use
ide_preempt action argument. This converts ide-scsi to use
blk_execute_rq_nowait instead of ide_do_drive_cmd so that we can
remove the action argument in ide_do_drive_cmd and ide_action_t
typedef.

Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Cc: Borislav Petkov <petkovbb@gmail.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide: remove drive->ctl
Bartlomiej Zolnierkiewicz [Tue, 15 Jul 2008 19:21:50 +0000 (21:21 +0200)]
ide: remove drive->ctl

Remove drive->ctl (it is always equal to 0x08 after init time).

While at it:

* Use ATA_DEVCTL_OBS define.

There should be no functional changes caused by this patch.

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide: use ->OUTBSYNC in ide_set_irq()
Bartlomiej Zolnierkiewicz [Tue, 15 Jul 2008 19:21:50 +0000 (21:21 +0200)]
ide: use ->OUTBSYNC in ide_set_irq()

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide: use ->OUTBSYNC in init_irq()
Bartlomiej Zolnierkiewicz [Tue, 15 Jul 2008 19:21:50 +0000 (21:21 +0200)]
ide: use ->OUTBSYNC in init_irq()

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide: pass 'hwif *' instead of 'drive *' to ->OUTBSYNC method
Bartlomiej Zolnierkiewicz [Tue, 15 Jul 2008 19:21:49 +0000 (21:21 +0200)]
ide: pass 'hwif *' instead of 'drive *' to ->OUTBSYNC method

There should be no functional changes caused by this patch.

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide: remove ->mmio flag from ide_hwif_t
Bartlomiej Zolnierkiewicz [Tue, 15 Jul 2008 19:21:49 +0000 (21:21 +0200)]
ide: remove ->mmio flag from ide_hwif_t

Since scc_pata host driver no longer uses IDE PCI layer / ide_dma_setup()
and all other ->mmio users set also IDE_HFLAG_MMIO host flag we can safely
remove ->mmio flag.

There should be no functional changes caused by this patch.

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide: move IRQ unmasking out from ->tf_load method
Bartlomiej Zolnierkiewicz [Tue, 15 Jul 2008 19:21:48 +0000 (21:21 +0200)]
ide: move IRQ unmasking out from ->tf_load method

Move IRQ unmasking out from ->tf_load method to its users.

There should be no functional changes caused by this patch
(SELECT_MASK() is NOP except for hpt366, icside and sgiioc4).

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide: remove IDE_TFLAG_NO_SELECT_MASK taskfile flag
Bartlomiej Zolnierkiewicz [Tue, 15 Jul 2008 19:21:48 +0000 (21:21 +0200)]
ide: remove IDE_TFLAG_NO_SELECT_MASK taskfile flag

Always call SELECT_MASK(..., 0) in ide_tf_load() (needs to be done
to match ide_set_irq(..., 1)) and then remove IDE_TFLAG_NO_SELECT_MASK
taskfile flag.

This change should only affect hpt366 and icside host drivers since
->maskproc(..., 0) for sgiioc4 is equivalent to ide_set_irq(..., 1).

Cc: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Cc: Russell King <rmk@arm.linux.org.uk>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide: fix do_probe() to use SELECT_DRIVE()
Bartlomiej Zolnierkiewicz [Tue, 15 Jul 2008 19:21:48 +0000 (21:21 +0200)]
ide: fix do_probe() to use SELECT_DRIVE()

Fix one place in do_probe() which used ->OUTB directly instead
of calling SELECT_DRIVE() (so ->selectproc method is also used).

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide: remove commented out code from ide_config_drive_speed()
Bartlomiej Zolnierkiewicz [Tue, 15 Jul 2008 19:21:47 +0000 (21:21 +0200)]
ide: remove commented out code from ide_config_drive_speed()

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agosgiioc4: use ->extra_base instead of ->dma_status for dma_handle
Bartlomiej Zolnierkiewicz [Tue, 15 Jul 2008 19:21:47 +0000 (21:21 +0200)]
sgiioc4: use ->extra_base instead of ->dma_status for dma_handle

This is a preparation for removal of ->dma_status field from ide_hwif_t.

There should be no functional changes caused by this patch.

Acked-by: Jeremy Higdon <jeremy@sgi.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide: remove try_to_flush_leftover_data()
Bartlomiej Zolnierkiewicz [Tue, 15 Jul 2008 19:21:47 +0000 (21:21 +0200)]
ide: remove try_to_flush_leftover_data()

Just use the new & shiny ide_pad_transfer() helper instead.

Also remove the superfluous check for 'drive->media == ide_disk'
while at it (ide_ata_error() is used only for ide_disk devices).

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide: remove obsoleted "ide=" kernel parameters
Bartlomiej Zolnierkiewicz [Tue, 15 Jul 2008 19:21:47 +0000 (21:21 +0200)]
ide: remove obsoleted "ide=" kernel parameters

* Remove obsoleted "ide=" kernel parameters.

* Remove no longer needed:
  - ide_setup()
  - parse_options()
  - __setup("", ...)
  - module_param(options, ...)

* Use module_{init,exit}() for MODULE=y case and remove MODULE ifdef.

* Make ide_*acpi* and ide_doubler variables static.

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide: cleanup init_ide_data()
Bartlomiej Zolnierkiewicz [Tue, 15 Jul 2008 19:21:46 +0000 (21:21 +0200)]
ide: cleanup init_ide_data()

* Remove no longer need init_ide_data() call from ide_setup().

* Cleanup init_ide_data().

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide: remove obsoleted "hdx=" kernel parameters
Bartlomiej Zolnierkiewicz [Tue, 15 Jul 2008 19:21:46 +0000 (21:21 +0200)]
ide: remove obsoleted "hdx=" kernel parameters

* Remove obsoleted "hdx=" kernel parameters.

* Remove no longer used stridx() and match_parm().

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide: remove obsoleted "idebus=" kernel parameter
Bartlomiej Zolnierkiewicz [Tue, 15 Jul 2008 19:21:46 +0000 (21:21 +0200)]
ide: remove obsoleted "idebus=" kernel parameter

* Remove obsoleted "idebus=" kernel parameter.

* Remove no longer needed ide_system_bus_speed() and system_bus_clock()
  (together with idebus_parameter and system_bus_speed variables).

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoblock: unexport blk_end_sync_rq
FUJITA Tomonori [Tue, 15 Jul 2008 19:21:45 +0000 (21:21 +0200)]
block: unexport blk_end_sync_rq

All the users of blk_end_sync_rq has gone (they are converted to use
blk_execute_rq). This unexports blk_end_sync_rq.

Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Cc: Borislav Petkov <petkovbb@gmail.com>
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoblock: remove the checking for NULL queue in blk_put_request
FUJITA Tomonori [Tue, 15 Jul 2008 19:21:45 +0000 (21:21 +0200)]
block: remove the checking for NULL queue in blk_put_request

Some uses blk_put_request asymmetrically, that is, they uses it with
requests that not allocated by blk_get_request. As a result,
blk_put_request has a hack to catch a NULL request_queue. Now such
callers are fixed (they use blk_get_request properly). So we can
safely remove the hack in blk_put_request.

Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Cc: Borislav Petkov <petkovbb@gmail.com>
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoblock: convert pd_special_command to use blk_execute_rq
FUJITA Tomonori [Tue, 15 Jul 2008 19:21:45 +0000 (21:21 +0200)]
block: convert pd_special_command to use blk_execute_rq

pd_special_command uses blk_put_request with struct request on the
stack. As a result, blk_put_request needs a hack to catch a NULL
request_queue.  This converts pd_special_command to use
blk_execute_rq.

Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Cc: Borislav Petkov <petkovbb@gmail.com>
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide-cd: remove ide_cd_init_rq
FUJITA Tomonori [Tue, 15 Jul 2008 19:21:45 +0000 (21:21 +0200)]
ide-cd: remove ide_cd_init_rq

ide_cd_init_rq is not used by ide-cd_ioctl any more. Only
cdrom_queue_request_sense use it. This converts
cdrom_queue_request_sense to use blk_rq_init directly and removes
ide_cd_init_rq.

Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Cc: Borislav Petkov <petkovbb@gmail.com>
Cc: Jens Axboe <jens.axboe@oracle.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide: remove ide_init_drive_cmd
FUJITA Tomonori [Tue, 15 Jul 2008 19:21:44 +0000 (21:21 +0200)]
ide: remove ide_init_drive_cmd

ide_init_drive_cmd just calls blk_rq_init. This converts the users of
ide_init_drive_cmd to use blk_rq_init directly and removes
ide_init_drive_cmd.

Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Cc: Borislav Petkov <petkovbb@gmail.com>
Cc: Jens Axboe <jens.axboe@oracle.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide: remove ide_wait/head_wait path in ide_do_drive_cmd
FUJITA Tomonori [Tue, 15 Jul 2008 19:21:44 +0000 (21:21 +0200)]
ide: remove ide_wait/head_wait path in ide_do_drive_cmd

Now all the users of ide_do_drive_cmd using ide_wait/head_wait are
converted to use blk_execute_rq this removes the ide_wait/head_wait
path in ide_do_drive_cmd.

Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Cc: Borislav Petkov <petkovbb@gmail.com>
Cc: Jens Axboe <jens.axboe@oracle.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide: convert ide_do_drive_cmd path to use blk_execute_rq
FUJITA Tomonori [Tue, 15 Jul 2008 19:21:44 +0000 (21:21 +0200)]
ide: convert ide_do_drive_cmd path to use blk_execute_rq

This converts the ide_do_drive_cmd path using ide_[head_]wait to use
blk_execute_rq.

Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Cc: Borislav Petkov <petkovbb@gmail.com>
Cc: Jens Axboe <jens.axboe@oracle.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoblock: handle blk_pm_resume_request() requests in blk_execute_rq_nowait()
Bartlomiej Zolnierkiewicz [Tue, 15 Jul 2008 19:21:43 +0000 (21:21 +0200)]
block: handle blk_pm_resume_request() requests in blk_execute_rq_nowait()

For blk_pm_resume_request() requests (which are used only by IDE subsystem
currently) the queue is stopped so we need to call ->request_fn explicitly.

Thanks to:
- Rafael for reporting/bisecting the bug
- Borislav/Rafael for testing the fix

This is a preparation for converting IDE to use blk_execute_rq().

Cc: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Cc: Borislav Petkov <petkovbb@gmail.com>
Cc: Jens Axboe <jens.axboe@oracle.com>
Cc: "Rafael J. Wysocki" <rjw@sisk.pl>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide-tape: convert ide_do_drive_cmd path to use blk_execute_rq
FUJITA Tomonori [Tue, 15 Jul 2008 19:21:43 +0000 (21:21 +0200)]
ide-tape: convert ide_do_drive_cmd path to use blk_execute_rq

This converts the ide_do_drive_cmd path using ide_wait to use
blk_execute_rq.

Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Cc: Borislav Petkov <petkovbb@gmail.com>
Cc: Jens Axboe <jens.axboe@oracle.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide-taskfile: convert ide_do_drive_cmd path to use blk_execute_rq
FUJITA Tomonori [Tue, 15 Jul 2008 19:21:43 +0000 (21:21 +0200)]
ide-taskfile: convert ide_do_drive_cmd path to use blk_execute_rq

This converts the ide_do_drive_cmd path using ide_wait to use
blk_execute_rq.

Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Cc: Borislav Petkov <petkovbb@gmail.com>
Cc: Jens Axboe <jens.axboe@oracle.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide-floppy: convert ide_do_drive_cmd path to use blk_execute_rq
FUJITA Tomonori [Tue, 15 Jul 2008 19:21:43 +0000 (21:21 +0200)]
ide-floppy: convert ide_do_drive_cmd path to use blk_execute_rq

This converts the ide_do_drive_cmd path using ide_wait to use
blk_execute_rq.

Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Cc: Borislav Petkov <petkovbb@gmail.com>
Cc: Jens Axboe <jens.axboe@oracle.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide-disk: convert ide_do_drive_cmd path to use blk_execute_rq
FUJITA Tomonori [Tue, 15 Jul 2008 19:21:43 +0000 (21:21 +0200)]
ide-disk: convert ide_do_drive_cmd path to use blk_execute_rq

This converts the ide_do_drive_cmd path using ide_wait to use
blk_execute_rq.

Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Cc: Borislav Petkov <petkovbb@gmail.com>
Cc: Jens Axboe <jens.axboe@oracle.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide-cd: convert ide_do_drive_cmd path to use blk_execute_rq
FUJITA Tomonori [Tue, 15 Jul 2008 19:21:42 +0000 (21:21 +0200)]
ide-cd: convert ide_do_drive_cmd path to use blk_execute_rq

This converts the ide_do_drive_cmd path using ide_wait to use
blk_execute_rq.

Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Cc: Borislav Petkov <petkovbb@gmail.com>
Cc: Jens Axboe <jens.axboe@oracle.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide-cd: convert ide_cd_queue_pc to use blk_execute_rq
FUJITA Tomonori [Tue, 15 Jul 2008 19:21:42 +0000 (21:21 +0200)]
ide-cd: convert ide_cd_queue_pc to use blk_execute_rq

This converts ide_cd_queue_pc to use blk_execute_rq, necessitating
changing the ide_cd_queue_pc prototype into a form that doesn't takes
a pointer to request struct. ide_cd_queue_pc works like scsi_execute.

Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Cc: Borislav Petkov <petkovbb@gmail.com>
Cc: Jens Axboe <jens.axboe@oracle.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide: use __generic_unplug_device() in ide_do_drive_cmd() (take 2)
Bartlomiej Zolnierkiewicz [Tue, 15 Jul 2008 19:21:42 +0000 (21:21 +0200)]
ide: use __generic_unplug_device() in ide_do_drive_cmd() (take 2)

* Call __elv_add_request() with 'plug' == 1 (so the device will be
  plugged) and then use __generic_unplug_device() instead of calling
  ide_do_request() directly.

v2:
* For blk_pm_resume_request() requests the queue is stopped so we
  need to call ->request_fn explicitly.

  Thanks to:
  - Rafael for reporting/bisecting the bug
  - Borislav/Rafael for testing the fix

This is a preparation for converting IDE to use blk_execute_rq().

Cc: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Cc: Borislav Petkov <petkovbb@gmail.com>
Cc: Jens Axboe <jens.axboe@oracle.com>
Cc: "Rafael J. Wysocki" <rjw@sisk.pl>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide: set REQ_PREEMPT request flag in ide_do_drive_cmd() users
Bartlomiej Zolnierkiewicz [Tue, 15 Jul 2008 19:21:41 +0000 (21:21 +0200)]
ide: set REQ_PREEMPT request flag in ide_do_drive_cmd() users

* Set REQ_PREEMPT request flag in ide_do_drive_cmd() users
  for ide_preempt and ide_head_wait action types.

* Remove setting REQ_PREEMPT from ide_do_drive_cmd().

While at it:

* Set 'where' variable outside ide_lock.

This is a preparation for converting IDE to use blk_execute_rq().

There should be no functional changes caused by this patch.

Cc: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Cc: Borislav Petkov <petkovbb@gmail.com>
Cc: Jens Axboe <jens.axboe@oracle.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide: use get_unaligned_* helpers
Harvey Harrison [Tue, 15 Jul 2008 19:21:41 +0000 (21:21 +0200)]
ide: use get_unaligned_* helpers

Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide-tape: use clamp_t() rather than nested min_t()/max_t()
Harvey Harrison [Tue, 15 Jul 2008 19:21:41 +0000 (21:21 +0200)]
ide-tape: use clamp_t() rather than nested min_t()/max_t()

Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide: eliminate FIT() macro
Harvey Harrison [Tue, 15 Jul 2008 19:21:41 +0000 (21:21 +0200)]
ide: eliminate FIT() macro

Replace the FIT() macro with the kernel-provided clamp_val() macro.

FIT was always being called with a member of a struct ide_timing,
which are shorts, and constant constraints for the min and max.

Thus we can use clamp_val, rather than clamp_t.

Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide: disable drive interrupts in ide_driveid_update()
Mikhail Cherkashin [Tue, 15 Jul 2008 19:21:40 +0000 (21:21 +0200)]
ide: disable drive interrupts in ide_driveid_update()

Since ide_driveid_update() uses polling to execute the IDENTIFY DEVICE command
but clears nIEN bit in the control register and doesn't mask the IDE interrupt,
the latter does happen and lead to the corresponding message to appear:

ide0: unexpected interrupt, status=0x58, count=1

when e.g. running hdparm with option -X with a non-PCI IDE driver...

Signed-off-by: Mikhail Cherkashin <mcherkashin@ru.mvista.com>
Signed-off-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agopalm_bk3710: fix tRP for UDMA mode 4
Mikhail Cherkashin [Tue, 15 Jul 2008 19:21:40 +0000 (21:21 +0200)]
palm_bk3710: fix tRP for UDMA mode 4

Fix tRP timing for UDMA mode 4 according to the ATA specification.

Signed-off-by: Mikhail Cherkashin <mcherkhashin@ru.mvista.com>
Signed-off-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoMerge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/shaggy...
Linus Torvalds [Tue, 15 Jul 2008 18:03:19 +0000 (11:03 -0700)]
Merge branch 'for-linus' of git://git./linux/kernel/git/shaggy/jfs-2.6

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/shaggy/jfs-2.6:
  jfs: remove DIRENTSIZ
  JFS: diAlloc() should return -EIO rather than EIO
  JFS: skip bad iput() call in error path
  JFS: switch to seq_files
  JFS: 0 is not valid errno value so return NULL from jfs_lookup