Skip to contentSkip to conversation

ide-2.6 update

PATCH New Bartlomiej Zolnierkiewicz 1 participant 1 message Oct 29, 2004

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

PATCH 1/1 ide-2.6 update

Please do a

	bk pull bk://bart.bkbits.net/ide-2.6

This will update the following files:

 drivers/ide/pci/hpt34x.h   |   29 -----------------------
 Documentation/ide.txt      |    7 -----
 drivers/ide/Kconfig        |   13 ----------
 drivers/ide/ide-disk.c     |    3 --
 drivers/ide/ide-proc.c     |   25 ++++++++++----------
 drivers/ide/ide-taskfile.c |   10 ++++++--
 drivers/ide/ide.c          |    9 +------
 drivers/ide/pci/cs5520.c   |    2 -
 drivers/ide/pci/cs5530.c   |    1 
 drivers/ide/pci/hpt34x.c   |   17 +++++++++++--
 drivers/ide/ppc/pmac.c     |    7 -----
 drivers/ide/setup-pci.c    |   56 +++++++++------------------------------------
 include/linux/ide.h        |   10 +++-----
 13 files changed, 55 insertions(+), 134 deletions(-)

through these ChangeSets:

<bzolnier@trik.(none)> (04/10/29 1.2341)
[ide] ide-disk: enable stroke by default

From: Jens Axboe <[email protected]>

<bzolnier@trik.(none)> (04/10/29 1.2340)
[ide] make destroy_proc_ide_interfaces static

destroy_proc_ide_interfaces is only used inside ide-proc.c; so lets make it static.

<bzolnier@trik.(none)> (04/10/29 1.2339)
[ide] kill IDEPCI_FLAG_FORCE_MASTER

cs5530 overrides hwif->autodma anyway.

<bzolnier@trik.(none)> (04/10/29 1.2338)
[ide] setup-pci: simplify autodma logic

Do not set hwif->autodma in ide_pci_setup_ports(). All DMA capable PCI host drivers override it.

<bzolnier@trik.(none)> (04/10/29 1.2337)
[ide] setup-pci: small ide_get_or_set_dma_base() cleanup

* hwif->dma_base is set in ->init_iops() for MMIO
* if !dma_base then dma_base is really equal to zero
* remove dead code from simplex check

<bzolnier@trik.(none)> (04/10/29 1.2336)
[ide] pmac: kill CONFIG_BLK_DEV_IDEDMA_PMAC_AUTO

DMA is always used by default (->autodma is never checked).

<bzolnier@trik.(none)> (04/10/29 1.2335)
[ide] hpt34x: kill hpt34x.h

<bzolnier@trik.(none)> (04/10/29 1.2334)
[ide] remove hwif from /proc/ide/ as part of ide_unregister_hwif()

Original patch from Mark Lord <[email protected]>.

<bzolnier@trik.(none)> (04/10/29 1.2333)
[ide] PIO bugfix

We need to k[un]map_atomic() the current page not the first page of the scatterlist segment. Fixes OOPS when using HIGHMEM.

Big thanks to Randy Dunlap for a lot of debugging/testing.

Documentation/ide.txt +0 -7
diff -Nru a/Documentation/ide.txt b/Documentation/ide.txt
@@ -248,13 +248,6 @@
  			  allowing ide-floppy, ide-tape, and ide-cdrom|writers
  			  to use ide-scsi emulation on a device specific option.
 
- "hdx=stroke"		: Should you have a system w/ an AWARD Bios and your
-			  drives are larger than 32GB and it will not boot,
-			  one is required to perform a few OEM operations first.
-			  The option is called "stroke" because it allows one
-			  to "soft clip" the drive to work around a barrier
-			  limit.
-
  "idebus=xx"		: inform IDE driver of VESA/PCI bus speed in MHz,
 			  where "xx" is between 20 and 66 inclusive,
 			  used when tuning chipset PIO modes.
drivers/ide/Kconfig +1 -12
diff -Nru a/drivers/ide/Kconfig b/drivers/ide/Kconfig
@@ -772,17 +772,6 @@
 	  This option enables the use of the sleep LED as a hard drive
 	  activity LED.
 
-config BLK_DEV_IDEDMA_PMAC_AUTO
-	bool "Use DMA by default"
-	depends on BLK_DEV_IDEDMA_PMAC
-	help
-	  This option allows the driver for the built-in IDE controller on
-	  Power Macintoshes and PowerBooks to use DMA automatically, without
-	  it having to be explicitly enabled.  This option is provided because
-	  of concerns about a couple of cases where using DMA on buggy PC
-	  hardware may have caused damage.  Saying Y should be safe on all
-	  Apple machines.
-
 config IDE_ARM
 	def_bool ARM && (ARCH_A5K || ARCH_CLPS7500 || ARCH_RPC || ARCH_SHARK)
 
@@ -1037,7 +1026,7 @@
 	  It is normally safe to answer Y; however, the default is N.
 
 config IDEDMA_AUTO
-	def_bool IDEDMA_PCI_AUTO || BLK_DEV_IDEDMA_PMAC_AUTO || IDEDMA_ICS_AUTO
+	def_bool IDEDMA_PCI_AUTO || IDEDMA_ICS_AUTO
 
 endif
 
drivers/ide/ide-disk.c +0 -3
diff -Nru a/drivers/ide/ide-disk.c b/drivers/ide/ide-disk.c
@@ -643,9 +643,6 @@
 			 capacity, sectors_to_MB(capacity),
 			 set_max, sectors_to_MB(set_max));
 
-	if (!drive->stroke)
-		return;
-
 	if (lba48)
 		set_max = idedisk_set_max_address_ext(drive, set_max);
 	else
drivers/ide/ide-proc.c +13 -12
diff -Nru a/drivers/ide/ide-proc.c b/drivers/ide/ide-proc.c
@@ -418,7 +418,7 @@
 	}
 }
 
-void destroy_proc_ide_drives(ide_hwif_t *hwif)
+static void destroy_proc_ide_drives(ide_hwif_t *hwif)
 {
 	int	d;
 
@@ -466,28 +466,29 @@
 EXPORT_SYMBOL_GPL(ide_pci_create_host_proc);
 #endif
 
-void destroy_proc_ide_interfaces(void)
+void destroy_proc_ide_interface(ide_hwif_t *hwif)
+{
+	if (hwif->proc) {
+		destroy_proc_ide_drives(hwif);
+		ide_remove_proc_entries(hwif->proc, hwif_entries);
+		remove_proc_entry(hwif->name, proc_ide_root);
+		hwif->proc = NULL;
+	}
+}
+
+static void destroy_proc_ide_interfaces(void)
 {
 	int	h;
 
 	for (h = 0; h < MAX_HWIFS; h++) {
 		ide_hwif_t *hwif = &ide_hwifs[h];
-		int exist = (hwif->proc != NULL);
 #if 0
 		if (!hwif->present)
 			continue;
 #endif
-		if (exist) {
-			destroy_proc_ide_drives(hwif);
-			ide_remove_proc_entries(hwif->proc, hwif_entries);
-			remove_proc_entry(hwif->name, proc_ide_root);
-			hwif->proc = NULL;
-		} else
-			continue;
+		destroy_proc_ide_interface(hwif);
 	}
 }
-
-EXPORT_SYMBOL(destroy_proc_ide_interfaces);
 
 extern struct seq_operations ide_drivers_op;
 static int ide_drivers_open(struct inode *inode, struct file *file)
drivers/ide/ide-taskfile.c +8 -2
diff -Nru a/drivers/ide/ide-taskfile.c b/drivers/ide/ide-taskfile.c
@@ -274,14 +274,20 @@
 #ifdef CONFIG_HIGHMEM
 	unsigned long flags;
 #endif
+	unsigned int offset;
 	u8 *buf;
 
 	page = sg[hwif->cursg].page;
+	offset = sg[hwif->cursg].offset + hwif->cursg_ofs * SECTOR_SIZE;
+
+	/* get the current page and offset */
+	page = nth_page(page, (offset >> PAGE_SHIFT));
+	offset %= PAGE_SIZE;
+
 #ifdef CONFIG_HIGHMEM
 	local_irq_save(flags);
 #endif
-	buf = kmap_atomic(page, KM_BIO_SRC_IRQ) +
-	      sg[hwif->cursg].offset + (hwif->cursg_ofs * SECTOR_SIZE);
+	buf = kmap_atomic(page, KM_BIO_SRC_IRQ) + offset;
 
 	hwif->nleft--;
 	hwif->cursg_ofs++;
drivers/ide/ide.c +2 -7
diff -Nru a/drivers/ide/ide.c b/drivers/ide/ide.c
@@ -796,9 +796,7 @@
 		DRIVER(drive)->cleanup(drive);
 	}
 
-#ifdef CONFIG_PROC_FS
-	destroy_proc_ide_drives(hwif);
-#endif
+	destroy_proc_ide_interface(hwif);
 
 	hwgroup = hwif->hwgroup;
 	/*
@@ -1854,7 +1852,7 @@
 	if (s[0] == 'h' && s[1] == 'd' && s[2] >= 'a' && s[2] <= max_drive) {
 		const char *hd_words[] = {
 			"none", "noprobe", "nowerr", "cdrom", "serialize",
-			"autotune", "noautotune", "stroke", "swapdata", "bswap",
+			"autotune", "noautotune", "minus8", "swapdata", "bswap",
 			"minus11", "remap", "remap63", "scsi", NULL };
 		unit = s[2] - 'a';
 		hw   = unit / MAX_DRIVES;
@@ -1887,9 +1885,6 @@
 				goto done;
 			case -7: /* "noautotune" */
 				drive->autotune = IDE_TUNE_NOAUTO;
-				goto done;
-			case -8: /* stroke */
-				drive->stroke = 1;
 				goto done;
 			case -9: /* "swapdata" */
 			case -10: /* "bswap" */
drivers/ide/pci/cs5520.c +1 -1
diff -Nru a/drivers/ide/pci/cs5520.c b/drivers/ide/pci/cs5520.c
@@ -239,7 +239,7 @@
 	 *	do all the device setup for us
 	 */
 
-	ide_pci_setup_ports(dev, d, 1, 14, &index);
+	ide_pci_setup_ports(dev, d, 14, &index);
 
 	printk("Index.b %d %d\n", index.b.low, index.b.high);
 	mdelay(2000);
drivers/ide/pci/cs5530.c +0 -1
diff -Nru a/drivers/ide/pci/cs5530.c b/drivers/ide/pci/cs5530.c
@@ -353,7 +353,6 @@
 	.channels	= 2,
 	.autodma	= AUTODMA,
 	.bootable	= ON_BOARD,
-	.flags		= IDEPCI_FLAG_FORCE_MASTER,
 };
 
 static int __devinit cs5530_init_one(struct pci_dev *dev, const struct pci_device_id *id)
drivers/ide/pci/hpt34x.c +14 -3
diff -Nru a/drivers/ide/pci/hpt34x.c b/drivers/ide/pci/hpt34x.c
@@ -42,7 +42,7 @@
 #include <asm/io.h>
 #include <asm/irq.h>
 
-#include "hpt34x.h"
+#define HPT343_DEBUG_DRIVE_INFO		0
 
 static u8 hpt34x_ratemask (ide_drive_t *drive)
 {
@@ -69,7 +69,8 @@
 	u32 reg1= 0, tmp1 = 0, reg2 = 0, tmp2 = 0;
 	u8			hi_speed, lo_speed;
 
-	SPLIT_BYTE(speed, hi_speed, lo_speed);
+	hi_speed = speed >> 4;
+	lo_speed = speed & 0x0f;
 
 	if (hi_speed & 7) {
 		hi_speed = (hi_speed & 4) ? 0x01 : 0x10;
@@ -229,9 +230,19 @@
 	hwif->drives[1].autodma = hwif->autodma;
 }
 
+static ide_pci_device_t hpt34x_chipset __devinitdata = {
+	.name		= "HPT34X",
+	.init_chipset	= init_chipset_hpt34x,
+	.init_hwif	= init_hwif_hpt34x,
+	.channels	= 2,
+	.autodma	= NOAUTODMA,
+	.bootable	= NEVER_BOARD,
+	.extra		= 16
+};
+
 static int __devinit hpt34x_init_one(struct pci_dev *dev, const struct pci_device_id *id)
 {
-	ide_pci_device_t *d = &hpt34x_chipsets[id->driver_data];
+	ide_pci_device_t *d = &hpt34x_chipset;
 	static char *chipset_names[] = {"HPT343", "HPT345"};
 	u16 pcicmd = 0;
 
drivers/ide/pci/hpt34x.h deleted +0 -29
diff -Nru a/drivers/ide/pci/hpt34x.h b/drivers/ide/pci/hpt34x.h
@@ -1,29 +0,0 @@
-#ifndef HPT34X_H
-#define HPT34X_H
-
-#include <linux/config.h>
-#include <linux/pci.h>
-#include <linux/ide.h>
-
-#define HPT343_DEBUG_DRIVE_INFO		0
-
-#ifndef SPLIT_BYTE
-#define SPLIT_BYTE(B,H,L)	((H)=(B>>4), (L)=(B-((B>>4)<<4)))
-#endif
-
-static unsigned int init_chipset_hpt34x(struct pci_dev *, const char *);
-static void init_hwif_hpt34x(ide_hwif_t *);
-
-static ide_pci_device_t hpt34x_chipsets[] __devinitdata = {
-	{	/* 0 */
-		.name		= "HPT34X",
-		.init_chipset	= init_chipset_hpt34x,
-		.init_hwif	= init_hwif_hpt34x,
-		.channels	= 2,
-		.autodma	= NOAUTODMA,
-		.bootable	= NEVER_BOARD,
-		.extra		= 16
-	}
-};
-
-#endif /* HPT34X_H */
drivers/ide/ppc/pmac.c +0 -7
diff -Nru a/drivers/ide/ppc/pmac.c b/drivers/ide/ppc/pmac.c
@@ -2028,13 +2028,6 @@
 	hwif->ide_dma_timeout = &__ide_dma_timeout;
 	hwif->ide_dma_lostirq = &pmac_ide_dma_lostirq;
 
-#ifdef CONFIG_BLK_DEV_IDEDMA_PMAC_AUTO
-	if (!noautodma)
-		hwif->autodma = 1;
-#endif
-	hwif->drives[0].autodma = hwif->autodma;
-	hwif->drives[1].autodma = hwif->autodma;
-
 	hwif->atapi_dma = 1;
 	switch(pmif->kind) {
 		case controller_un_ata6:
drivers/ide/setup-pci.c +12 -44

141 lines not on this page · raw message

include/linux/ide.h +4 -6
diff -Nru a/include/linux/ide.h b/include/linux/ide.h
@@ -739,7 +739,6 @@
 	unsigned remap_0_to_1	: 1;	/* 0=noremap, 1=remap 0->1 (for EZDrive) */
 	unsigned blocked        : 1;	/* 1=powermanagment told us not to do anything, so sleep nicely */
 	unsigned vdma		: 1;	/* 1=doing PIO over DMA 0=doing normal DMA */
-	unsigned stroke		: 1;	/* from:  hdx=stroke */
 	unsigned addressing;		/*      : 3;
 					 *  0=28-bit
 					 *  1=48-bit
@@ -1045,8 +1044,8 @@
 
 extern void proc_ide_create(void);
 extern void proc_ide_destroy(void);
-extern void destroy_proc_ide_drives(ide_hwif_t *);
 extern void create_proc_ide_interfaces(void);
+void destroy_proc_ide_interface(ide_hwif_t *);
 extern void ide_add_proc_entries(struct proc_dir_entry *, ide_proc_entry_t *, void *);
 extern void ide_remove_proc_entries(struct proc_dir_entry *, ide_proc_entry_t *);
 read_proc_t proc_ide_read_capacity;
@@ -1073,6 +1072,7 @@
 }
 #else
 static inline void create_proc_ide_interfaces(void) { ; }
+static inline void destroy_proc_ide_interface(ide_hwif_t *hwif) { ; }
 #define PROC_IDE_READ_RETURN(page,start,off,count,eof,len) return 0;
 #endif
 
@@ -1417,7 +1417,7 @@
 extern void ide_scan_pcibus(int scan_direction) __init;
 extern int ide_pci_register_driver(struct pci_driver *driver);
 extern void ide_pci_unregister_driver(struct pci_driver *driver);
-extern void ide_pci_setup_ports(struct pci_dev *dev, struct ide_pci_device_s *d, int autodma, int pciirq, ata_index_t *index);
+void ide_pci_setup_ports(struct pci_dev *, struct ide_pci_device_s *, int, ata_index_t *);
 extern void ide_setup_pci_noise (struct pci_dev *dev, struct ide_pci_device_s *d);
 
 extern void default_hwif_iops(ide_hwif_t *);
@@ -1452,9 +1452,7 @@
 enum {
 	/* Uses ISA control ports not PCI ones. */
 	IDEPCI_FLAG_ISA_PORTS		= (1 << 0),
-
-	IDEPCI_FLAG_FORCE_MASTER	= (1 << 1),
-	IDEPCI_FLAG_FORCE_PDC		= (1 << 2),
+	IDEPCI_FLAG_FORCE_PDC		= (1 << 1),
 };
 
 typedef struct ide_pci_device_s {