Skip to contentSkip to conversation

IDE updates [part 2]

GIT PULL Bartlomiej Zolnierkiewicz 1 participant 1 message Jul 16, 2008

Subsystems (5)
lore
Share & tools
lore
#0 lore raw

Part 2:

* Fix for it821x OOPS in pass-through mode from Dimitri Gorokhovik.

* Fix for long-standing bugs in HDIO_DRIVE_RESET handling from Elias Oltmanns.

* ide-cd preparations for using generic ATAPI support from Borislav Petkov.

* DMA support for REQ_TYPE_ATA_PC requests in ide-cd from FUJITA Tomonori.

* ide/legacy/hd.c to drivers/block/ move from Adrian Bunk.

* Old bast-ide driver removal (we use PATA platform support now) from Ben Dooks.

* mpc8xx-ide driver removal (since arch/ppc is gone) from Arnd Bergmann.

* ide-timing.h to ide-timings.c helper library conversion.

* Conversion of more host drivers to use struct ide_port_info.

* Preparations for dynamic allocation of ide_hwif_t instances.

* and more...

Thanks to all contributors!

Linus, please pull from:

master.kernel.org:/pub/scm/linux/kernel/git/bart/ide-2.6.git/

to receive the following updates:

 Documentation/ioctl/hdio.txt                |    7 +-
 drivers/block/Kconfig                       |   12 +
 drivers/block/Makefile                      |    1 +
 drivers/{ide/legacy => block}/hd.c          |    3 +-
 drivers/ide/Kconfig                         |   88 +---
 drivers/ide/Makefile                        |   10 +-
 drivers/ide/arm/Makefile                    |    1 -
 drivers/ide/arm/bast-ide.c                  |   90 ---
 drivers/ide/arm/icside.c                    |  105 ++--
 drivers/ide/arm/palm_bk3710.c               |    3 -
 drivers/ide/arm/rapide.c                    |   33 +-
 drivers/ide/h8300/ide-h8300.c               |   19 +-
 drivers/ide/ide-cd.c                        |  160 +++---
 drivers/ide/ide-disk.c                      |    1 -
 drivers/ide/ide-floppy.c                    |   32 +-
 drivers/ide/ide-io.c                        |   72 +--
 drivers/ide/ide-iops.c                      |   24 +-
 drivers/ide/ide-lib.c                       |  151 -----
 drivers/ide/ide-pio-blacklist.c             |   94 +++
 drivers/ide/ide-pnp.c                       |    4 +-
 drivers/ide/ide-probe.c                     |   21 +-
 drivers/ide/ide-tape.c                      |    1 -
 drivers/ide/ide-taskfile.c                  |   33 +-
 drivers/ide/{ide-timing.h => ide-timings.c} |  204 +++----
 drivers/ide/ide.c                           |   76 +--
 drivers/ide/legacy/ali14xx.c                |    3 +-
 drivers/ide/legacy/buddha.c                 |    1 -
 drivers/ide/legacy/falconide.c              |    1 -
 drivers/ide/legacy/gayle.c                  |    1 -
 drivers/ide/legacy/ht6560b.c                |   15 +-
 drivers/ide/legacy/ide-4drives.c            |   25 +-
 drivers/ide/legacy/ide-cs.c                 |    9 +-
 drivers/ide/legacy/ide_platform.c           |    9 +-
 drivers/ide/legacy/macide.c                 |    1 -
 drivers/ide/legacy/q40ide.c                 |    1 -
 drivers/ide/legacy/qd65xx.c                 |   19 +-
 drivers/ide/mips/au1xxx-ide.c               |   13 +-
 drivers/ide/mips/swarm.c                    |   28 +-
 drivers/ide/pci/alim15x3.c                  |    6 +-
 drivers/ide/pci/amd74xx.c                   |    2 -
 drivers/ide/pci/cmd640.c                    |  131 ++---
 drivers/ide/pci/cmd64x.c                    |    6 +-
 drivers/ide/pci/cs5535.c                    |    6 +-
 drivers/ide/pci/cy82c693.c                  |    9 +-
 drivers/ide/pci/delkin_cb.c                 |    1 -
 drivers/ide/pci/it821x.c                    |    6 +
 drivers/ide/pci/scc_pata.c                  |    8 +-
 drivers/ide/pci/sgiioc4.c                   |   23 +-
 drivers/ide/pci/siimage.c                   |    3 +-
 drivers/ide/pci/sis5513.c                   |    3 -
 drivers/ide/pci/sl82c105.c                  |    3 +-
 drivers/ide/pci/via82cxxx.c                 |    2 -
 drivers/ide/ppc/Makefile                    |    1 -
 drivers/ide/ppc/mpc8xx.c                    |  851 ---------------------------
 drivers/ide/ppc/pmac.c                      |   21 +-
 drivers/ide/setup-pci.c                     |   25 +-
 drivers/scsi/ide-scsi.c                     |   14 -
 include/linux/ide.h                         |   74 ++-
 58 files changed, 695 insertions(+), 1871 deletions(-)
 rename drivers/{ide/legacy => block}/hd.c (99%)
 delete mode 100644 drivers/ide/arm/bast-ide.c
 create mode 100644 drivers/ide/ide-pio-blacklist.c
 rename drivers/ide/{ide-timing.h => ide-timings.c} (56%)
 delete mode 100644 drivers/ide/ppc/mpc8xx.c

Adrian Bunk (5):
remove BLK_DEV_HD_ONLY
ide/legacy/hd.c: use late_initcall() move ide/legacy/hd.c to drivers/block/ update the BLK_DEV_HD help text
hd.c: remove the #include <linux/mc146818rtc.h>

Arnd Bergmann (1):
powerpc/ide: remove mpc8xx-ide driver

Bartlomiej Zolnierkiewicz (49):
ide: remove needless includes from ide-lib.c
ide: remove unused XFER_UDMA_SLOW
ide: use u8 for xfer modes in ide-timing.h
ide: move some bits from ide-timing.h to <linux/ide.h>
ide: remove XFER_* masks from ide-timing.h
ide: checkpatch.pl fixes for ide-timing.h
ide: convert ide-timing.h to ide-timings.c library (take 2)
ali14xx: convert to use ide_timing_find_mode()
ht6560b: convert to use ide_timing_find_mode()
qd65xx: convert to use ide_timing_find_mode()
alim15x3: convert to use ide_timing_find_mode()
cmd640: convert to use ide_timing_find_mode()
cmd64x: convert to use ide_timing_find_mode()
cy82c693: convert to use ide_timing_find_mode()
sl82c105: convert to use ide_timing_find_mode()
ide-mpc8xx: convert to use ide_timing_find_mode()
ide-pmac: convert to use ide_timing_find_mode()
ide: move ide_pio_cycle_time() to ide-timings.c
ide: remove no longer used ide_pio_timings[]
ide: move PIO blacklist to ide-pio-blacklist.c
ide: fix hwif-s initialization
ide: make ide_hwifs[] static
ide: set hwif->dev in ide_init_port_hw() (take 2)
au1xxx-ide: don't use hwif->hwif_data
ide_4drives: use struct ide_port_info
ide-cs: use struct ide_port_info
icside: don't use hwif->hwif_data
icside: use ide_init_port_hw()
sgiioc4: use driver name for resource allocation
ide: tighten checks on PCI BARs in ide_hwif_configure()
swarm: use struct ide_port_info
cmd640: fix warm-plug support for the secondary interface
ide: ->port_init_devs -> ->init_dev
cmd640: add ->init_dev method
rapide: use struct ide_port_info
ide-h8300: use struct ide_port_info
ide_platform: use struct ide_port_info
ide: print message on error in ide_find_port_slot()
ide-h8300: print driver banner message early
ide-pnp: print driver banner message early
ide: allow any command requesting DMA data phase for HDIO_DRIVE_TASKFILE
ide: remove superfluous BUG_ON() from set_geometry_intr()
ide: remove needless includes from ide.c
ide: remove needless includes from ide-taskfile.c (take 2)
ide: remove needless includes from setup-pci.c (take 2)
rapide: fix rapide_probe() return value
icside: always try to probe first interface
swarm: call ide_find_port_slot() later
sgiioc4: call ide_find_port_slot() later

Ben Dooks (1):
BAST: Remove old IDE driver

Borislav Petkov (12):
ide-cd: remove wait-for-idle-controller bit in cdrom_start_packet_command
ide-cd: remove ide_cd_drain_data and ide_cd_pad_transfer
ide-cd: ide_do_rw_cdrom: add the catch-all bad request case to the if-else block
ide-cd: cdrom_start_seek: remove unused argument block
ide-cd: mv ide_do_rw_cdrom ide_cd_do_request
ide-cd: simplify request issuing path
ide-cd: fold cdrom_start_seek into ide_cd_do_request
ide-cd: move request prep from cdrom_start_seek_continuation to rq issue path
ide-cd: move request prep from cdrom_start_rw_cont to rq issue path
ide-cd: move request prep chunk from cdrom_do_newpc_cont to rq issue path
ide-floppy: fold idefloppy_create_test_unit_ready_cmd into idefloppy_open
ide-floppy: zero out the whole struct ide_atapi_pc on init

Dimitri Gorokhovik (1):
ide: it821x in pass-through mode segfaults in 2.6.26-stable

Elias Oltmanns (4):
IDE: Fix HDIO_DRIVE_RESET handling
IDE: Remove unused code
Update documentation of HDIO_DRIVE_RESET ioctl
IDE: Report errors during drive reset back to user space

FUJITA Tomonori (2):
ide: avoid DMA on the stack for REQ_TYPE_ATA_PC
ide: use the dma safe check for REQ_TYPE_ATA_PC

Harvey Harrison (1):
ide: endian annotations in ide-floppy.c

Documentation/ioctl/hdio.txt +4 -3
index c19efde..91a6ecb 100644
@@ -508,12 +508,13 @@ HDIO_DRIVE_RESET		execute a device reset
 
 	error returns:
 	  EACCES	Access denied:  requires CAP_SYS_ADMIN
+	  ENXIO		No such device:	phy dead or ctl_addr == 0
+	  EIO		I/O error:	reset timed out or hardware error
 
 	notes:
 
-	  Abort any current command, prevent anything else from being
-	  queued, execute a reset on the device, and issue BLKRRPART
-	  ioctl on the block device.
+	  Execute a reset on the device as soon as the current IO
+	  operation has completed.
 
 	  Executes an ATAPI soft reset if applicable, otherwise
 	  executes an ATA soft reset on the controller.
drivers/block/Kconfig +12 -0
index 0d1d213..61ad8d6 100644
@@ -433,4 +433,16 @@ config VIRTIO_BLK
 	  This is the virtual block driver for virtio.  It can be used with
           lguest or QEMU based VMMs (like KVM or Xen).  Say Y or M.
 
+config BLK_DEV_HD
+	bool "Very old hard disk (MFM/RLL/IDE) driver"
+	depends on HAVE_IDE
+	depends on !ARM || ARCH_RPC || ARCH_SHARK || BROKEN
+	help
+	  This is a very old hard disk driver that lacks the enhanced
+	  functionality of the newer ones.
+
+	  It is required for systems with ancient MFM/RLL/ESDI drives.
+
+	  If unsure, say N.
+
 endif # BLK_DEV
drivers/block/Makefile +1 -0
index 5e58430..204332b 100644
@@ -29,5 +29,6 @@ obj-$(CONFIG_VIRTIO_BLK)	+= virtio_blk.o
 obj-$(CONFIG_VIODASD)		+= viodasd.o
 obj-$(CONFIG_BLK_DEV_SX8)	+= sx8.o
 obj-$(CONFIG_BLK_DEV_UB)	+= ub.o
+obj-$(CONFIG_BLK_DEV_HD)	+= hd.o
 
 obj-$(CONFIG_XEN_BLKDEV_FRONTEND)	+= xen-blkfront.o
drivers/block/hd.c new file +814 -0

814 lines not on this page · raw message

drivers/ide/Kconfig +15 -73

181 lines not on this page · raw message

drivers/ide/Makefile +3 -7
index a2b3f84..5d414e3 100644
@@ -11,9 +11,11 @@
 
 EXTRA_CFLAGS				+= -Idrivers/ide
 
-ide-core-y += ide.o ide-io.o ide-iops.o ide-lib.o ide-probe.o ide-taskfile.o
+ide-core-y += ide.o ide-io.o ide-iops.o ide-lib.o ide-probe.o ide-taskfile.o \
+	      ide-pio-blacklist.o
 
 # core IDE code
+ide-core-$(CONFIG_IDE_TIMINGS)		+= ide-timings.o
 ide-core-$(CONFIG_IDE_ATAPI)		+= ide-atapi.o
 ide-core-$(CONFIG_BLK_DEV_IDEPCI)	+= setup-pci.o
 ide-core-$(CONFIG_BLK_DEV_IDEDMA)	+= ide-dma.o
@@ -59,9 +61,3 @@ ifeq ($(CONFIG_BLK_DEV_PLATFORM), y)
 endif
 
 obj-$(CONFIG_BLK_DEV_IDE)		+= arm/ mips/
-
-# old hd driver must be last
-ifeq ($(CONFIG_BLK_DEV_HD), y)
-	hd-core-y += legacy/hd.o
-	obj-y += hd-core.o
-endif
drivers/ide/arm/Makefile +0 -1
index 936e7b0..5bc2605 100644
@@ -1,7 +1,6 @@
 
 obj-$(CONFIG_BLK_DEV_IDE_ICSIDE)	+= icside.o
 obj-$(CONFIG_BLK_DEV_IDE_RAPIDE)	+= rapide.o
-obj-$(CONFIG_BLK_DEV_IDE_BAST)		+= bast-ide.o
 obj-$(CONFIG_BLK_DEV_PALMCHIP_BK3710)	+= palm_bk3710.o
 
 ifeq ($(CONFIG_IDE_ARM), m)
drivers/ide/arm/bast-ide.c deleted +0 -90

90 lines not on this page · raw message

drivers/ide/arm/icside.c +55 -50

207 lines not on this page · raw message

drivers/ide/arm/palm_bk3710.c +0 -3
index 3839f57..c79b85b 100644
@@ -74,8 +74,6 @@ struct palm_bk3710_udmatiming {
 #define BK3710_IORDYTMP		0x78
 #define BK3710_IORDYTMS		0x7C
 
-#include "../ide-timing.h"
-
 static unsigned ideclk_period; /* in nanoseconds */
 
 static const struct palm_bk3710_udmatiming palm_bk3710_udmatimings[6] = {
@@ -402,7 +400,6 @@ static int __devinit palm_bk3710_probe(struct platform_device *pdev)
 
 	i = hwif->index;
 
-	ide_init_port_data(hwif, i);
 	ide_init_port_hw(hwif, &hw);
 
 	default_hwif_mmiops(hwif);
drivers/ide/arm/rapide.c +19 -14
index 1747b23..43057e0 100644
@@ -11,6 +11,10 @@
 
 #include <asm/ecard.h>
 
+static struct const ide_port_info rapide_port_info = {
+	.host_flags		= IDE_HFLAG_MMIO | IDE_HFLAG_NO_DMA,
+};
+
 static void rapide_setup_ports(hw_regs_t *hw, void __iomem *base,
 			       void __iomem *ctrl, unsigned int sz, int irq)
 {
@@ -44,25 +48,26 @@ rapide_probe(struct expansion_card *ec, const struct ecard_id *id)
 		goto release;
 	}
 
-	hwif = ide_find_port();
-	if (hwif) {
-		memset(&hw, 0, sizeof(hw));
-		rapide_setup_ports(&hw, base, base + 0x818, 1 << 6, ec->irq);
-		hw.chipset = ide_generic;
-		hw.dev = &ec->dev;
+	memset(&hw, 0, sizeof(hw));
+	rapide_setup_ports(&hw, base, base + 0x818, 1 << 6, ec->irq);
+	hw.chipset = ide_generic;
+	hw.dev = &ec->dev;
 
-		ide_init_port_hw(hwif, &hw);
+	hwif = ide_find_port();
+	if (hwif == NULL) {
+		ret = -ENOENT;
+		goto release;
+	}
 
-		hwif->host_flags = IDE_HFLAG_MMIO;
-		default_hwif_mmiops(hwif);
+	ide_init_port_hw(hwif, &hw);
+	default_hwif_mmiops(hwif);
 
-		idx[0] = hwif->index;
+	idx[0] = hwif->index;
 
-		ide_device_add(idx, NULL);
+	ide_device_add(idx, &rapide_port_info);
 
-		ecard_set_drvdata(ec, hwif);
-		goto out;
-	}
+	ecard_set_drvdata(ec, hwif);
+	goto out;
 
  release:
 	ecard_release_resources(ec);
drivers/ide/h8300/ide-h8300.c +11 -8
index ae37ee5..20fad6d 100644
@@ -8,6 +8,8 @@
 #include <asm/io.h>
 #include <asm/irq.h>
 
+#define DRV_NAME "ide-h8300"
+
 #define bswap(d) \
 ({					\
 	u16 r;				\
@@ -176,6 +178,10 @@ static inline void hwif_setup(ide_hwif_t *hwif)
 	hwif->output_data = h8300_output_data;
 }
 
+static const struct ide_port_info h8300_port_info = {
+	.host_flags		= IDE_HFLAG_NO_IO_32BIT | IDE_HFLAG_NO_DMA,
+};
+
 static int __init h8300_ide_init(void)
 {
 	hw_regs_t hw;
@@ -183,6 +189,8 @@ static int __init h8300_ide_init(void)
 	int index;
 	u8 idx[4] = { 0xff, 0xff, 0xff, 0xff };
 
+	printk(KERN_INFO DRV_NAME ": H8/300 generic IDE interface\n");
+
 	if (!request_region(CONFIG_H8300_IDE_BASE, H8300_IDE_GAP*8, "ide-h8300"))
 		goto out_busy;
 	if (!request_region(CONFIG_H8300_IDE_ALT, H8300_IDE_GAP, "ide-h8300")) {
@@ -192,22 +200,17 @@ static int __init h8300_ide_init(void)
 
 	hw_setup(&hw);
 
-	hwif = ide_find_port();
-	if (hwif == NULL) {
-		printk(KERN_ERR "ide-h8300: IDE I/F register failed\n");
+	hwif = ide_find_port_slot(&h8300_port_info);
+	if (hwif == NULL)
 		return -ENOENT;
-	}
 
 	index = hwif->index;
-	ide_init_port_data(hwif, index);
 	ide_init_port_hw(hwif, &hw);
 	hwif_setup(hwif);
-	hwif->host_flags = IDE_HFLAG_NO_IO_32BIT;
-	printk(KERN_INFO "ide%d: H8/300 generic IDE interface\n", index);
 
 	idx[0] = index;
 
-	ide_device_add(idx, NULL);
+	ide_device_add(idx, &h8300_port_info);
 
 	return 0;
 
drivers/ide/ide-cd.c +77 -83

302 lines not on this page · raw message

drivers/ide/ide-disk.c +0 -1
index 5f49a4a..3a2e802 100644
@@ -985,7 +985,6 @@ static ide_driver_t idedisk_driver = {
 	.do_request		= ide_do_rw_disk,
 	.end_request		= ide_end_request,
 	.error			= __ide_error,
-	.abort			= __ide_abort,
 #ifdef CONFIG_IDE_PROC_FS
 	.proc			= idedisk_proc,
 #endif
drivers/ide/ide-floppy.c +12 -20
index b368943..011d720 100644
@@ -351,10 +351,7 @@ static void ide_floppy_callback(ide_drive_t *drive)
 
 static void idefloppy_init_pc(struct ide_atapi_pc *pc)
 {
-	memset(pc->c, 0, 12);
-	pc->retries = 0;
-	pc->flags = 0;
-	pc->req_xfer = 0;
+	memset(pc, 0, sizeof(*pc));
 	pc->buf = pc->pc_buf;
 	pc->buf_size = IDEFLOPPY_PC_BUFFER_SIZE;
 	pc->callback = ide_floppy_callback;
@@ -561,12 +558,6 @@ static void idefloppy_create_start_stop_cmd(struct ide_atapi_pc *pc, int start)
 	pc->c[4] = start;
 }
 
-static void idefloppy_create_test_unit_ready_cmd(struct ide_atapi_pc *pc)
-{
-	idefloppy_init_pc(pc);
-	pc->c[0] = GPCMD_TEST_UNIT_READY;
-}
-
 static void idefloppy_create_rw_cmd(idefloppy_floppy_t *floppy,
 				    struct ide_atapi_pc *pc, struct request *rq,
 				    unsigned long sector)
@@ -711,10 +702,10 @@ static int ide_floppy_get_flexible_disk_page(ide_drive_t *drive)
 	set_disk_ro(floppy->disk, floppy->wp);
 	page = &pc.buf[8];
 
-	transfer_rate = be16_to_cpu(*(u16 *)&pc.buf[8 + 2]);
-	sector_size   = be16_to_cpu(*(u16 *)&pc.buf[8 + 6]);
-	cyls          = be16_to_cpu(*(u16 *)&pc.buf[8 + 8]);
-	rpm           = be16_to_cpu(*(u16 *)&pc.buf[8 + 28]);
+	transfer_rate = be16_to_cpup((__be16 *)&pc.buf[8 + 2]);
+	sector_size   = be16_to_cpup((__be16 *)&pc.buf[8 + 6]);
+	cyls          = be16_to_cpup((__be16 *)&pc.buf[8 + 8]);
+	rpm           = be16_to_cpup((__be16 *)&pc.buf[8 + 28]);
 	heads         = pc.buf[8 + 4];
 	sectors       = pc.buf[8 + 5];
 
@@ -789,8 +780,8 @@ static int ide_floppy_get_capacity(ide_drive_t *drive)
 	for (i = 0; i < desc_cnt; i++) {
 		unsigned int desc_start = 4 + i*8;
 
-		blocks = be32_to_cpu(*(u32 *)&pc.buf[desc_start]);
-		length = be16_to_cpu(*(u16 *)&pc.buf[desc_start + 6]);
+		blocks = be32_to_cpup((__be32 *)&pc.buf[desc_start]);
+		length = be16_to_cpup((__be16 *)&pc.buf[desc_start + 6]);
 
 		debug_log("Descriptor %d: %dkB, %d blocks, %d sector size\n",
 				i, blocks * length / 1024, blocks, length);
@@ -911,8 +902,8 @@ static int ide_floppy_get_format_capacities(ide_drive_t *drive, int __user *arg)
 		if (u_index >= u_array_size)
 			break;	/* User-supplied buffer too small */
 
-		blocks = be32_to_cpu(*(u32 *)&pc.buf[desc_start]);
-		length = be16_to_cpu(*(u16 *)&pc.buf[desc_start + 6]);
+		blocks = be32_to_cpup((__be32 *)&pc.buf[desc_start]);
+		length = be16_to_cpup((__be16 *)&pc.buf[desc_start + 6]);
 
 		if (put_user(blocks, argp))
 			return(-EFAULT);
@@ -1138,7 +1129,6 @@ static ide_driver_t idefloppy_driver = {
 	.do_request		= idefloppy_do_request,
 	.end_request		= idefloppy_end_request,
 	.error			= __ide_error,
-	.abort			= __ide_abort,
 #ifdef CONFIG_IDE_PROC_FS
 	.proc			= idefloppy_proc,
 #endif
@@ -1166,7 +1156,9 @@ static int idefloppy_open(struct inode *inode, struct file *filp)
 		floppy->flags &= ~IDEFLOPPY_FLAG_FORMAT_IN_PROGRESS;
 		/* Just in case */
 
-		idefloppy_create_test_unit_ready_cmd(&pc);
+		idefloppy_init_pc(&pc);
+		pc.c[0] = GPCMD_TEST_UNIT_READY;
+
 		if (idefloppy_queue_pc_tail(drive, &pc)) {
 			idefloppy_create_start_stop_cmd(&pc, 1);
 			(void) idefloppy_queue_pc_tail(drive, &pc);
drivers/ide/ide-io.c +22 -50

90 lines not on this page · raw message

drivers/ide/ide-iops.c +18 -6
index 80ad4f2..44aaec2 100644
@@ -905,6 +905,14 @@ void ide_execute_pkt_cmd(ide_drive_t *drive)
 }
 EXPORT_SYMBOL_GPL(ide_execute_pkt_cmd);
 
+static inline void ide_complete_drive_reset(ide_drive_t *drive, int err)
+{
+	struct request *rq = drive->hwif->hwgroup->rq;
+
+	if (rq && blk_special_request(rq) && rq->cmd[0] == REQ_DRIVE_RESET)
+		ide_end_request(drive, err ? err : 1, 0);
+}
+
 /* needed below */
 static ide_startstop_t do_reset1 (ide_drive_t *, int);
 
@@ -940,7 +948,7 @@ static ide_startstop_t atapi_reset_pollfunc (ide_drive_t *drive)
 	}
 	/* done polling */
 	hwgroup->polling = 0;
-	hwgroup->resetting = 0;
+	ide_complete_drive_reset(drive, 0);
 	return ide_stopped;
 }
 
@@ -956,12 +964,14 @@ static ide_startstop_t reset_pollfunc (ide_drive_t *drive)
 	ide_hwif_t *hwif	= HWIF(drive);
 	const struct ide_port_ops *port_ops = hwif->port_ops;
 	u8 tmp;
+	int err = 0;
 
 	if (port_ops && port_ops->reset_poll) {
-		if (port_ops->reset_poll(drive)) {
+		err = port_ops->reset_poll(drive);
+		if (err) {
 			printk(KERN_ERR "%s: host reset_poll failure for %s.\n",
 				hwif->name, drive->name);
-			return ide_stopped;
+			goto out;
 		}
 	}
 
@@ -975,6 +985,7 @@ static ide_startstop_t reset_pollfunc (ide_drive_t *drive)
 		}
 		printk("%s: reset timed-out, status=0x%02x\n", hwif->name, tmp);
 		drive->failures++;
+		err = -EIO;
 	} else  {
 		printk("%s: reset: ", hwif->name);
 		tmp = ide_read_error(drive);
@@ -1001,10 +1012,12 @@ static ide_startstop_t reset_pollfunc (ide_drive_t *drive)
 			if (tmp & 0x80)
 				printk("; slave: failed");
 			printk("\n");
+			err = -EIO;
 		}
 	}
+out:
 	hwgroup->polling = 0;	/* done polling */
-	hwgroup->resetting = 0; /* done reset attempt */
+	ide_complete_drive_reset(drive, err);
 	return ide_stopped;
 }
 
@@ -1090,7 +1103,6 @@ static ide_startstop_t do_reset1 (ide_drive_t *drive, int do_not_try_atapi)
 
 	/* For an ATAPI device, first try an ATAPI SRST. */
 	if (drive->media != ide_disk && !do_not_try_atapi) {
-		hwgroup->resetting = 1;
 		pre_reset(drive);
 		SELECT_DRIVE(drive);
 		udelay (20);
@@ -1112,10 +1124,10 @@ static ide_startstop_t do_reset1 (ide_drive_t *drive, int do_not_try_atapi)
 
 	if (io_ports->ctl_addr == 0) {
 		spin_unlock_irqrestore(&ide_lock, flags);
+		ide_complete_drive_reset(drive, -ENXIO);
 		return ide_stopped;
 	}
 
-	hwgroup->resetting = 1;
 	/*
 	 * Note that we also set nIEN while resetting the device,
 	 * to mask unwanted interrupts from the interface during the reset.
drivers/ide/ide-lib.c +0 -151

168 lines not on this page · raw message

drivers/ide/ide-pio-blacklist.c new file +94 -0

94 lines not on this page · raw message

drivers/ide/ide-pnp.c +2 -2
index adbd017..03f2ef5 100644
@@ -33,6 +33,8 @@ static int idepnp_probe(struct pnp_dev *dev, const struct pnp_device_id *dev_id)
 	ide_hwif_t *hwif;
 	unsigned long base, ctl;
 
+	printk(KERN_INFO DRV_NAME ": generic PnP IDE interface\n");
+
 	if (!(pnp_port_valid(dev, 0) && pnp_port_valid(dev, 1) && pnp_irq_valid(dev, 0)))
 		return -1;
 
@@ -62,10 +64,8 @@ static int idepnp_probe(struct pnp_dev *dev, const struct pnp_device_id *dev_id)
 		u8 index = hwif->index;
 		u8 idx[4] = { index, 0xff, 0xff, 0xff };
 
-		ide_init_port_data(hwif, index);
 		ide_init_port_hw(hwif, &hw);
 
-		printk(KERN_INFO "ide%d: generic PnP IDE interface\n", index);
 		pnp_set_drvdata(dev, hwif);
 
 		ide_device_add(idx, NULL);
drivers/ide/ide-probe.c +15 -6
index d21e51a..235ebdb 100644
@@ -39,6 +39,8 @@
 #include <asm/uaccess.h>
 #include <asm/io.h>
 
+static ide_hwif_t ide_hwifs[MAX_HWIFS]; /* master data repository */
+
 /**
  *	generic_id		-	add a generic drive id
  *	@drive:	drive to make an ID block for
@@ -1318,10 +1320,10 @@ static void ide_port_init_devices(ide_hwif_t *hwif)
 			drive->unmask = 1;
 		if (hwif->host_flags & IDE_HFLAG_NO_UNMASK_IRQS)
 			drive->no_unmask = 1;
-	}
 
-	if (port_ops && port_ops->port_init_devs)
-		port_ops->port_init_devs(hwif);
+		if (port_ops && port_ops->init_dev)
+			port_ops->init_dev(drive);
+	}
 }
 
 static void ide_init_port(ide_hwif_t *hwif, unsigned int port,
@@ -1473,22 +1475,29 @@ ide_hwif_t *ide_find_port_slot(const struct ide_port_info *d)
 		for (; i < MAX_HWIFS; i++) {
 			hwif = &ide_hwifs[i];
 			if (hwif->chipset == ide_unknown)
-				return hwif;
+				goto out_found;
 		}
 	} else {
 		for (i = 2; i < MAX_HWIFS; i++) {
 			hwif = &ide_hwifs[i];
 			if (hwif->chipset == ide_unknown)
-				return hwif;
+				goto out_found;
 		}
 		for (i = 0; i < 2 && i < MAX_HWIFS; i++) {
 			hwif = &ide_hwifs[i];
 			if (hwif->chipset == ide_unknown)
-				return hwif;
+				goto out_found;
 		}
 	}
 
+	printk(KERN_ERR "%s: no free slot for interface\n",
+			d ? d->name : "ide");
+
 	return NULL;
+
+out_found:
+	ide_init_port_data(hwif, i);
+	return hwif;
 }
 EXPORT_SYMBOL_GPL(ide_find_port_slot);
 
drivers/ide/ide-tape.c +0 -1
index f9cf167..b711ab9 100644
@@ -2591,7 +2591,6 @@ static ide_driver_t idetape_driver = {
 	.do_request		= idetape_do_request,
 	.end_request		= idetape_end_request,
 	.error			= __ide_error,
-	.abort			= __ide_abort,
 #ifdef CONFIG_IDE_PROC_FS
 	.proc			= idetape_proc,
 #endif
drivers/ide/ide-taskfile.c +1 -32
index cf55a48..1fbdb74 100644
@@ -8,28 +8,18 @@
  *  The big the bad and the ugly.
  */
 
-#include <linux/module.h>
 #include <linux/types.h>
 #include <linux/string.h>
 #include <linux/kernel.h>
-#include <linux/timer.h>
-#include <linux/mm.h>
 #include <linux/sched.h>
 #include <linux/interrupt.h>
-#include <linux/major.h>
 #include <linux/errno.h>
-#include <linux/genhd.h>
-#include <linux/blkpg.h>
 #include <linux/slab.h>
-#include <linux/pci.h>
 #include <linux/delay.h>
 #include <linux/hdreg.h>
 #include <linux/ide.h>
-#include <linux/bitops.h>
 #include <linux/scatterlist.h>
 
-#include <asm/byteorder.h>
-#include <asm/irq.h>
 #include <asm/uaccess.h>
 #include <asm/io.h>
 
@@ -62,25 +52,6 @@ int taskfile_lib_get_identify (ide_drive_t *drive, u8 *buf)
 	return ide_raw_taskfile(drive, &args, buf, 1);
 }
 
-static int inline task_dma_ok(ide_task_t *task)
-{
-	if (blk_fs_request(task->rq) || (task->tf_flags & IDE_TFLAG_FLAGGED))
-		return 1;
-
-	switch (task->tf.command) {
-		case WIN_WRITEDMA_ONCE:
-		case WIN_WRITEDMA:
-		case WIN_WRITEDMA_EXT:
-		case WIN_READDMA_ONCE:
-		case WIN_READDMA:
-		case WIN_READDMA_EXT:
-		case WIN_IDENTIFY_DMA:
-			return 1;
-	}
-
-	return 0;
-}
-
 static ide_startstop_t task_no_data_intr(ide_drive_t *);
 static ide_startstop_t set_geometry_intr(ide_drive_t *);
 static ide_startstop_t recal_intr(ide_drive_t *);
@@ -139,8 +110,7 @@ ide_startstop_t do_rw_taskfile (ide_drive_t *drive, ide_task_t *task)
 				    WAIT_WORSTCASE, NULL);
 		return ide_started;
 	default:
-		if (task_dma_ok(task) == 0 || drive->using_dma == 0 ||
-		    dma_ops->dma_setup(drive))
+		if (drive->using_dma == 0 || dma_ops->dma_setup(drive))
 			return ide_stopped;
 		dma_ops->dma_exec_cmd(drive, tf->command);
 		dma_ops->dma_start(drive);
@@ -183,7 +153,6 @@ static ide_startstop_t set_geometry_intr(ide_drive_t *drive)
 	if (stat & (ERR_STAT|DRQ_STAT))
 		return ide_error(drive, "set_geometry_intr", stat);
 
-	BUG_ON(HWGROUP(drive)->handler != NULL);
 	ide_set_handler(drive, &set_geometry_intr, WAIT_WORSTCASE, NULL);
 	return ide_started;
 }
drivers/ide/ide-timing.h deleted +0 -217

217 lines not on this page · raw message

drivers/ide/ide-timings.c new file +205 -0

205 lines not on this page · raw message

drivers/ide/ide.c +19 -57

135 lines not on this page · raw message

drivers/ide/legacy/ali14xx.c +2 -1
index 052125f..4ec1973 100644
@@ -117,10 +117,11 @@ static void ali14xx_set_pio_mode(ide_drive_t *drive, const u8 pio)
 	u8 param1, param2, param3, param4;
 	unsigned long flags;
 	int bus_speed = ide_vlb_clk ? ide_vlb_clk : 50;
+	struct ide_timing *t = ide_timing_find_mode(XFER_PIO_0 + pio);
 
 	/* calculate timing, according to PIO mode */
 	time1 = ide_pio_cycle_time(drive, pio);
-	time2 = ide_pio_timings[pio].active_time;
+	time2 = t->active;
 	param3 = param1 = (time2 * bus_speed + 999) / 1000;
 	param4 = param2 = (time1 * bus_speed + 999) / 1000 - param1;
[… more lines in the raw message]

Lines of this file are not shown. View the raw message.

drivers/ide/legacy/buddha.c +0 -1
index 9a1d27e..0497e7f 100644

Lines of this file are not shown. View the raw message.

drivers/ide/legacy/falconide.c +0 -1
index af11028..129a812 100644

Lines of this file are not shown. View the raw message.

drivers/ide/legacy/gayle.c +0 -1
index b789416..7e74b20 100644

Lines of this file are not shown. View the raw message.

drivers/ide/legacy/hd.c deleted +0 -815

815 lines not on this page · raw message

drivers/ide/legacy/ht6560b.c +7 -8
index dd6dfb3..7bc8fd5 100644

Lines of this file are not shown. View the raw message.

drivers/ide/legacy/ide-4drives.c +16 -9
index ecae916..89c8ff0 100644

Lines of this file are not shown. View the raw message.

drivers/ide/legacy/ide-cs.c +6 -3
index 8dbf4d9..fc53dcf 100644

Lines of this file are not shown. View the raw message.

drivers/ide/legacy/ide_platform.c +7 -2
index d3bc3f2..a249562 100644

Lines of this file are not shown. View the raw message.

drivers/ide/legacy/macide.c +0 -1
index 2e84290..0a6195b 100644

Lines of this file are not shown. View the raw message.

drivers/ide/legacy/q40ide.c +0 -1
index 8ff6e2d..9c2b9d0 100644

Lines of this file are not shown. View the raw message.

drivers/ide/legacy/qd65xx.c +10 -9
index 51dba82..2338f34 100644

Lines of this file are not shown. View the raw message.

drivers/ide/mips/au1xxx-ide.c +3 -10
index 1a6c27b..48d57ca 100644

Lines of this file are not shown. View the raw message.

drivers/ide/mips/swarm.c +17 -11
index 52fee3d..9f1212c 100644

Lines of this file are not shown. View the raw message.

drivers/ide/pci/alim15x3.c +2 -4
index f2de00a..80d19c0 100644

Lines of this file are not shown. View the raw message.

drivers/ide/pci/amd74xx.c +0 -2
index ad22220..0bfcdd0 100644

Lines of this file are not shown. View the raw message.

drivers/ide/pci/cmd640.c +57 -74

131 lines not on this page · raw message

drivers/ide/pci/cmd64x.c +3 -3
index ca4774a..cfa784b 100644

Lines of this file are not shown. View the raw message.

drivers/ide/pci/cs5535.c +1 -5
index 99fe91a..dc97c48 100644

Lines of this file are not shown. View the raw message.

drivers/ide/pci/cy82c693.c +4 -5
index 8c534af..e14ad55 100644

Lines of this file are not shown. View the raw message.

drivers/ide/pci/delkin_cb.c +0 -1
index af0f300..0106e2a 100644

Lines of this file are not shown. View the raw message.

drivers/ide/pci/it821x.c +6 -0
index 6ab0411..cbf6472 100644

Lines of this file are not shown. View the raw message.

drivers/ide/pci/scc_pata.c +2 -6
index 1584ebb..789c66d 100644

Lines of this file are not shown. View the raw message.

drivers/ide/pci/sgiioc4.c +12 -11
index 24513e3..c79ff5b 100644

Lines of this file are not shown. View the raw message.

drivers/ide/pci/siimage.c +1 -2
index b75e9bb..6e9d765 100644

Lines of this file are not shown. View the raw message.

drivers/ide/pci/sis5513.c +0 -3
index e127eb2..2389945 100644

Lines of this file are not shown. View the raw message.

drivers/ide/pci/sl82c105.c +2 -1
index ce84fa0..6efbde2 100644

Lines of this file are not shown. View the raw message.

drivers/ide/pci/via82cxxx.c +0 -2
index 3ed9728..e47384c 100644

Lines of this file are not shown. View the raw message.

drivers/ide/ppc/Makefile +0 -1
index 65af584..74e52ad 100644

Lines of this file are not shown. View the raw message.

drivers/ide/ppc/mpc8xx.c deleted +0 -851

851 lines not on this page · raw message

drivers/ide/ppc/pmac.c +8 -13
index dcb2c46..93fb906 100644

Lines of this file are not shown. View the raw message.

drivers/ide/setup-pci.c +8 -17
index abcfb17..65fc08b 100644

Lines of this file are not shown. View the raw message.

drivers/scsi/ide-scsi.c +0 -14
index 683bce3..f843c13 100644

Lines of this file are not shown. View the raw message.

include/linux/ide.h +44 -30

74 lines not on this page · raw message

The rest of this diff is not shown. View the raw message.

Part of the diff is not shown here. View the raw message.