Skip to contentSkip to conversation

IDE updates part 1

GIT PULL Bartlomiej Zolnierkiewicz 1 participant 1 message Mar 25, 2009 libata

lore
Share & tools
lore
#0 lore raw

Hi,

Nothing really earthshaking here:

- IDE ACPI cleanup
- IRQ setup sanitization
- saner code layout
- unified IDENTIFY handling
- by-the-way fixes/cleanups

Linus, please pull from:

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

to receive the following updates:

 drivers/ide/Kconfig           |    8 +
 drivers/ide/Makefile          |    4 +-
 drivers/ide/aec62xx.c         |    4 +-
 drivers/ide/alim15x3.c        |    2 +-
 drivers/ide/amd74xx.c         |   14 +-
 drivers/ide/atiixp.c          |    3 +-
 drivers/ide/cmd64x.c          |    2 +-
 drivers/ide/cs5520.c          |    3 +-
 drivers/ide/cs5530.c          |    2 +-
 drivers/ide/delkin_cb.c       |    2 +-
 drivers/ide/hpt366.c          |    4 +-
 drivers/ide/ide-acpi.c        |  214 +++---------
 drivers/ide/ide-atapi.c       |   41 +++-
 drivers/ide/ide-cd.c          |    4 +-
 drivers/ide/ide-devsets.c     |  190 +++++++++++
 drivers/ide/ide-dma.c         |   57 ++++
 drivers/ide/ide-eh.c          |  428 ++++++++++++++++++++++++
 drivers/ide/ide-io-std.c      |  316 ++++++++++++++++++
 drivers/ide/ide-io.c          |  320 ++----------------
 drivers/ide/ide-iops.c        |  742 ++---------------------------------------
 drivers/ide/ide-lib.c         |  240 -------------
 drivers/ide/ide-park.c        |   25 ++
 drivers/ide/ide-pci-generic.c |    4 +-
 drivers/ide/ide-probe.c       |  248 +++-----------
 drivers/ide/ide-proc.c        |    2 +-
 drivers/ide/ide-xfer-mode.c   |  246 ++++++++++++++
 drivers/ide/ide.c             |  156 +---------
 drivers/ide/it821x.c          |    2 +-
 drivers/ide/ns87415.c         |    4 +-
 drivers/ide/pdc202xx_new.c    |    4 +-
 drivers/ide/pdc202xx_old.c    |    4 +-
 drivers/ide/piix.c            |   13 +-
 drivers/ide/serverworks.c     |   13 +-
 drivers/ide/setup-pci.c       |   27 +-
 drivers/ide/siimage.c         |    2 +-
 drivers/ide/sis5513.c         |    4 +-
 drivers/ide/sl82c105.c        |    4 +-
 drivers/ide/slc90e66.c        |    1 -
 drivers/ide/trm290.c          |    3 -
 drivers/ide/via82cxxx.c       |   12 +-
 include/asm-frv/ide.h         |   24 --
 include/asm-mn10300/ide.h     |   39 ---
 include/asm-mn10300/pci.h     |    5 +
 include/linux/ata.h           |    2 -
 include/linux/ide.h           |   78 ++---
 45 files changed, 1571 insertions(+), 1951 deletions(-)
 create mode 100644 drivers/ide/ide-devsets.c
 create mode 100644 drivers/ide/ide-eh.c
 create mode 100644 drivers/ide/ide-io-std.c
 create mode 100644 drivers/ide/ide-xfer-mode.c
 delete mode 100644 include/asm-frv/ide.h
 delete mode 100644 include/asm-mn10300/ide.h

Bartlomiej Zolnierkiewicz (52):
ide: move ide_pktcmd_tf_load() to ide-atapi.c
ide: no need to touch local IRQs in ide_probe_port()
ide: move ->lock and ->timer init from init_irq() to ide_init_port_data()
ide: init_irq() doesn't need to hold ide_cfg_mtx
ide: remove superfluous check from ide_proc_port_register_devices()
ide-acpi: no need to zero ->acpidata for devices
ide-acpi: init ACPI handles early for devices
ide: add ide_for_each_present_dev() iterator
ide: sanitize ACPI initialization
ide-acpi: cleanup do_drive_get_GTF()
ide-acpi: cleanup do_drive_set_taskfiles()
ide-acpi: remove taskfile_load_raw()
ide: remove stale comments from drive_is_ready()
ide: unexport ide_devset_execute()
ide: move drive_is_ready() to ide-io.c
ide: move ide_dma_timeout_retry() to ide-dma.c
ide: remove ide_do_drive_cmd()
ide: factor out processing of special commands from ide_special_rq()
ide: move ide_do_park_unpark() to ide-park.c
ide: move device settings code to ide-devsets.c
ide: move xfer mode tuning code to ide-xfer-mode.c
ide: move ide_read_bcount_and_ireason() to ide-atapi.c
ide: move standard I/O code to ide-io-std.c
ide: fix printk() levels in [atapi_]reset_pollfunc()
ide: fix comments in ide_config_drive_speed()
ide: checkpatch.pl fixes for ide-iops.c
ide: move error handling code to ide-eh.c (v2)
mn10300: add pci_get_legacy_ide_irq() to <asm/pci.h>
amd74xx: use ide_pci_is_in_compatibility_mode()
ns87415: use pci_get_legacy_ide_irq()
ns87415: small ->init_hwif cleanup
trm290: small ->init_hwif cleanup
ide: handle IDE_HFLAG[_FORCE]_LEGACY_IRQS in ide_pci_init_{one,two}()
ide: use pci_get_legacy_ide_irq() in ide_pci_init_{one,two}()
ide: use ide_pci_is_in_compatibility_mode() in ide_pci_init_{one,two}()
ide: remove no longer needed IDE_HFLAG[_FORCE]_LEGACY_IRQS
amd74xx: remove no longer needed ->init_hwif method
ide: remove no longer needed IRQ fallback code from hwif_init()
ide: remove no longer needed IRQ auto-probing from try_to_identify() (v2)
ide: remove try_to_identify() wrapper
ide: fix ->init_chipset method to return 'int' value
ide: remove pciirq argument from ide_pci_setup_ports()
frv: remove <asm/ide.h>
mn10300: remove <asm/ide.h>
ide: fix kmalloc() failure handling in ide_driveid_update()
ide: propagate AltStatus workarounds to ide_driveid_update()
ide: shorten timeout value in ide_driveid_update()
ide: remove broken EXABYTENEST support
ide: classify device type in do_probe()
ide: sanitize SELECT_MASK() usage in ide_driveid_update()
ide: clear drive IRQ after re-enabling local IRQs in ide_driveid_update()
ide: use try_to_identify() in ide_driveid_update()

drivers/ide/Kconfig +8 -0
index 5ea3bfa..640c992 100644
@@ -56,8 +56,12 @@ if IDE
 
 comment "Please see Documentation/ide/ide.txt for help/info on IDE drives"
 
+config IDE_XFER_MODE
+	bool
+
 config IDE_TIMINGS
 	bool
+	select IDE_XFER_MODE
 
 config IDE_ATAPI
 	bool
@@ -698,6 +702,7 @@ config BLK_DEV_IDE_PMAC_ATA100FIRST
 config BLK_DEV_IDE_AU1XXX
        bool "IDE for AMD Alchemy Au1200"
        depends on SOC_AU1200
+       select IDE_XFER_MODE
 choice
        prompt "IDE Mode for AMD Alchemy Au1200"
        default CONFIG_BLK_DEV_IDE_AU1XXX_PIO_DBDMA
@@ -871,6 +876,7 @@ config BLK_DEV_ALI14XX
 
 config BLK_DEV_DTC2278
 	tristate "DTC-2278 support"
+	select IDE_XFER_MODE
 	select IDE_LEGACY
 	help
 	  This driver is enabled at runtime using the "dtc2278.probe" kernel
@@ -902,6 +908,7 @@ config BLK_DEV_QD65XX
 
 config BLK_DEV_UMC8672
 	tristate "UMC-8672 support"
+	select IDE_XFER_MODE
 	select IDE_LEGACY
 	help
 	  This driver is enabled at runtime using the "umc8672.probe" kernel
@@ -915,5 +922,6 @@ endif
 config BLK_DEV_IDEDMA
 	def_bool BLK_DEV_IDEDMA_SFF || \
 		 BLK_DEV_IDEDMA_ICS || BLK_DEV_IDE_AU1XXX_MDMA2_DBDMA
+	select IDE_XFER_MODE
 
 endif # IDE
drivers/ide/Makefile +3 -1
index 1c326d9..9b4bbe1 100644
@@ -5,9 +5,11 @@
 EXTRA_CFLAGS				+= -Idrivers/ide
 
 ide-core-y += ide.o ide-ioctls.o ide-io.o ide-iops.o ide-lib.o ide-probe.o \
-	      ide-taskfile.o ide-pm.o ide-park.o ide-pio-blacklist.o ide-sysfs.o
+	      ide-taskfile.o ide-pm.o ide-park.o ide-sysfs.o ide-devsets.o \
+	      ide-io-std.o ide-eh.o
 
 # core IDE code
+ide-core-$(CONFIG_IDE_XFER_MODE)	+= ide-pio-blacklist.o ide-xfer-mode.o
 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
drivers/ide/aec62xx.c +2 -2
index 4485b9c..878f8ec 100644
@@ -139,7 +139,7 @@ static void aec_set_pio_mode(ide_drive_t *drive, const u8 pio)
 	drive->hwif->port_ops->set_dma_mode(drive, pio + XFER_PIO_0);
 }
 
-static unsigned int init_chipset_aec62xx(struct pci_dev *dev)
+static int init_chipset_aec62xx(struct pci_dev *dev)
 {
 	/* These are necessary to get AEC6280 Macintosh cards to work */
 	if ((dev->device == PCI_DEVICE_ID_ARTOP_ATP865) ||
@@ -156,7 +156,7 @@ static unsigned int init_chipset_aec62xx(struct pci_dev *dev)
 		pci_write_config_byte(dev, 0x4a, reg4ah | 0x80);
 	}
 
-	return dev->irq;
+	return 0;
 }
 
 static u8 atp86x_cable_detect(ide_hwif_t *hwif)
drivers/ide/alim15x3.c +1 -1
index 66f4308..d3513b6 100644
@@ -212,7 +212,7 @@ static int ali15x3_dma_setup(ide_drive_t *drive)
  *	appropriate also sets up the 1533 southbridge.
  */
 
-static unsigned int init_chipset_ali15x3(struct pci_dev *dev)
+static int init_chipset_ali15x3(struct pci_dev *dev)
 {
 	unsigned long flags;
 	u8 tmpbyte;
drivers/ide/amd74xx.c +2 -12
index 77267c8..628cd2e 100644
@@ -140,7 +140,7 @@ static void amd7411_cable_detect(struct pci_dev *dev)
  * The initialization callback.  Initialize drive independent registers.
  */
 
-static unsigned int init_chipset_amd74xx(struct pci_dev *dev)
+static int init_chipset_amd74xx(struct pci_dev *dev)
 {
 	u8 t = 0, offset = amd_offset(dev);
 
@@ -172,7 +172,7 @@ static unsigned int init_chipset_amd74xx(struct pci_dev *dev)
 		t |= 0xf0;
 	pci_write_config_byte(dev, AMD_IDE_CONFIG + offset, t);
 
-	return dev->irq;
+	return 0;
 }
 
 static u8 amd_cable_detect(ide_hwif_t *hwif)
@@ -183,14 +183,6 @@ static u8 amd_cable_detect(ide_hwif_t *hwif)
 		return ATA_CBL_PATA40;
 }
 
-static void __devinit init_hwif_amd74xx(ide_hwif_t *hwif)
-{
-	struct pci_dev *dev = to_pci_dev(hwif->dev);
-
-	if (hwif->irq == 0) /* 0 is bogus but will do for now */
-		hwif->irq = pci_get_legacy_ide_irq(dev, hwif->channel);
-}
-
 static const struct ide_port_ops amd_port_ops = {
 	.set_pio_mode		= amd_set_pio_mode,
 	.set_dma_mode		= amd_set_drive,
@@ -207,7 +199,6 @@ static const struct ide_port_ops amd_port_ops = {
 	{								\
 		.name		= DRV_NAME,				\
 		.init_chipset	= init_chipset_amd74xx,			\
-		.init_hwif	= init_hwif_amd74xx,			\
 		.enablebits	= {{0x40,0x02,0x02}, {0x40,0x01,0x01}},	\
 		.port_ops	= &amd_port_ops,			\
 		.host_flags	= IDE_HFLAGS_AMD,			\
@@ -221,7 +212,6 @@ static const struct ide_port_ops amd_port_ops = {
 	{								\
 		.name		= DRV_NAME,				\
 		.init_chipset	= init_chipset_amd74xx,			\
-		.init_hwif	= init_hwif_amd74xx,			\
 		.enablebits	= {{0x50,0x02,0x02}, {0x50,0x01,0x01}},	\
 		.port_ops	= &amd_port_ops,			\
 		.host_flags	= IDE_HFLAGS_AMD,			\
drivers/ide/atiixp.c +1 -2
index ecd1e62..923cbfe 100644
@@ -142,7 +142,6 @@ static const struct ide_port_info atiixp_pci_info[] __devinitdata = {
 		.name		= DRV_NAME,
 		.enablebits	= {{0x48,0x01,0x00}, {0x48,0x08,0x00}},
 		.port_ops	= &atiixp_port_ops,
-		.host_flags	= IDE_HFLAG_LEGACY_IRQS,
 		.pio_mask	= ATA_PIO4,
 		.mwdma_mask	= ATA_MWDMA2,
 		.udma_mask	= ATA_UDMA5,
@@ -151,7 +150,7 @@ static const struct ide_port_info atiixp_pci_info[] __devinitdata = {
 		.name		= DRV_NAME,
 		.enablebits	= {{0x48,0x01,0x00}, {0x00,0x00,0x00}},
 		.port_ops	= &atiixp_port_ops,
-		.host_flags	= IDE_HFLAG_SINGLE | IDE_HFLAG_LEGACY_IRQS,
+		.host_flags	= IDE_HFLAG_SINGLE,
 		.pio_mask	= ATA_PIO4,
 		.mwdma_mask	= ATA_MWDMA2,
 		.udma_mask	= ATA_UDMA5,
drivers/ide/cmd64x.c +1 -1
index 2f9688d..aeee036 100644
@@ -333,7 +333,7 @@ static int cmd646_1_dma_end(ide_drive_t *drive)
 	return (dma_stat & 7) != 4;
 }
 
-static unsigned int init_chipset_cmd64x(struct pci_dev *dev)
+static int init_chipset_cmd64x(struct pci_dev *dev)
 {
 	u8 mrdmode = 0;
 
drivers/ide/cs5520.c +2 -1
index d003bec..58fb90e 100644
@@ -133,7 +133,8 @@ static int __devinit cs5520_init_one(struct pci_dev *dev, const struct pci_devic
 	 *	do all the device setup for us
 	 */
 
-	ide_pci_setup_ports(dev, d, 14, &hw[0], &hws[0]);
+	ide_pci_setup_ports(dev, d, &hw[0], &hws[0]);
+	hw[0].irq = 14;
 
 	return ide_host_add(d, hws, NULL);
 }
drivers/ide/cs5530.c +1 -1
index d8ede85..8e8b35a 100644
@@ -135,7 +135,7 @@ static void cs5530_set_dma_mode(ide_drive_t *drive, const u8 mode)
  *	Initialize the cs5530 bridge for reliable IDE DMA operation.
  */
 
-static unsigned int init_chipset_cs5530(struct pci_dev *dev)
+static int init_chipset_cs5530(struct pci_dev *dev)
 {
 	struct pci_dev *master_0 = NULL, *cs5530_0 = NULL;
 
drivers/ide/delkin_cb.c +1 -1
index 8f1b2d9..bacb119 100644
@@ -46,7 +46,7 @@ static const struct ide_port_ops delkin_cb_port_ops = {
 	.quirkproc		= ide_undecoded_slave,
 };
 
-static unsigned int delkin_cb_init_chipset(struct pci_dev *dev)
+static int delkin_cb_init_chipset(struct pci_dev *dev)
 {
 	unsigned long base = pci_resource_start(dev, 0);
 	int i;
drivers/ide/hpt366.c +2 -2
index 3eb9b5c..d3b3e82 100644
@@ -995,7 +995,7 @@ static void hpt3xx_disable_fast_irq(struct pci_dev *dev, u8 mcr_addr)
 		pci_write_config_byte(dev, mcr_addr + 1, new_mcr);
 }
 
-static unsigned int init_chipset_hpt366(struct pci_dev *dev)
+static int init_chipset_hpt366(struct pci_dev *dev)
 {
 	unsigned long io_base	= pci_resource_start(dev, 4);
 	struct hpt_info *info	= hpt3xx_get_info(&dev->dev);
@@ -1237,7 +1237,7 @@ static unsigned int init_chipset_hpt366(struct pci_dev *dev)
 	hpt3xx_disable_fast_irq(dev, 0x50);
 	hpt3xx_disable_fast_irq(dev, 0x54);
 
-	return dev->irq;
+	return 0;
 }
 
 static u8 hpt3xx_cable_detect(ide_hwif_t *hwif)
drivers/ide/ide-acpi.c +52 -162

306 lines not on this page · raw message

drivers/ide/ide-atapi.c +39 -2

65 lines not on this page · raw message

drivers/ide/ide-cd.c +3 -1
index ddfbea4..2177cd1 100644
@@ -242,7 +242,9 @@ static void cdrom_queue_request_sense(ide_drive_t *drive, void *sense,
 		ide_debug_log(IDE_DBG_SENSE, "failed_cmd: 0x%x\n",
 			      failed_command->cmd[0]);
 
-	ide_do_drive_cmd(drive, rq);
+	drive->hwif->rq = NULL;
+
+	elv_add_request(drive->queue, rq, ELEVATOR_INSERT_FRONT, 0);
 }
 
 static void cdrom_end_request(ide_drive_t *drive, int uptodate)
drivers/ide/ide-devsets.c new file +190 -0

190 lines not on this page · raw message

drivers/ide/ide-dma.c +57 -0

63 lines not on this page · raw message

drivers/ide/ide-eh.c new file +428 -0

428 lines not on this page · raw message

drivers/ide/ide-io-std.c new file +316 -0

316 lines not on this page · raw message

drivers/ide/ide-io.c +28 -292

362 lines not on this page · raw message

drivers/ide/ide-iops.c +29 -713

865 lines not on this page · raw message

drivers/ide/ide-lib.c +0 -240

212 lines not on this page · raw message

drivers/ide/ide-park.c +25 -0
index c875a95..f30e521 100644

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

drivers/ide/ide-pci-generic.c +1 -3
index bddae2b..61111fd 100644

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

drivers/ide/ide-probe.c +56 -192

248 lines not on this page · raw message

drivers/ide/ide-proc.c +1 -1
index a7b9287..417cde5 100644

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

drivers/ide/ide-xfer-mode.c new file +246 -0

246 lines not on this page · raw message

drivers/ide/ide.c +2 -154

156 lines not on this page · raw message

drivers/ide/it821x.c +1 -1
index 13b8153..6b9fc95 100644

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

drivers/ide/ns87415.c +1 -3
index 83643ed..ea48a3e 100644

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

drivers/ide/pdc202xx_new.c +2 -2
index f21290c..b68906c 100644

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

drivers/ide/pdc202xx_old.c +2 -2
index 9719332..cba66eb 100644

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

drivers/ide/piix.c +2 -11
index f1e2e4e..2aa6999 100644

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

drivers/ide/serverworks.c +4 -9
index 382102b..b6554ef 100644

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

drivers/ide/setup-pci.c +16 -11
index e85d1ed..24bc884 100644

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

drivers/ide/siimage.c +1 -1
index cb2b352..1811ae9 100644

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

drivers/ide/sis5513.c +2 -2
index 9ec1a4a..afca22b 100644

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

drivers/ide/sl82c105.c +2 -2
index 6297956..dba213c 100644

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

drivers/ide/slc90e66.c +0 -1
index 40b4b94..f55d7d6 100644

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

drivers/ide/trm290.c +0 -3
index b6a1285..1c09e54 100644

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

drivers/ide/via82cxxx.c +1 -11
index 6092fe3..3ff7231 100644

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

include/asm-frv/ide.h deleted +0 -24
deleted file mode 100644
index 3610766..0000000

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

include/asm-mn10300/ide.h deleted +0 -39
deleted file mode 100644
index 6adcdd9..0000000

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

include/asm-mn10300/pci.h +5 -0
index cd9cc5c..0517b45 100644

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

include/linux/ata.h +0 -2
index 9a061ac..68132c4 100644

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

include/linux/ide.h +35 -43

78 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.