Commit eb796b17 authored by Martin Dalecki's avatar Martin Dalecki Committed by Linus Torvalds

[PATCH] 2.5.18 IDE 73

 - Merge ide-probe.c and ide-features.c in to one single file.  They are
   mutually doing basically the same and in esp. in case of the device ID
   retrieval there *is* quite a lot of code duplication between them.
   ide-geometry.c fits there as well.

 - Remove ide_xfer_verbose - it wasn't really used.

 - Don't allow check_partition to be more clever then the writer of a driver.
   It was interfering with drivers which check partitions as they go and
   finally if we want to spew something about it - we can do it ourself.

 - Eliminate ide_geninit(). We scan for partitions now inside the recently
   introduced attach method. register_disk() is broken by the way and 90% of
   places where it's used it is doing literally nothing. Either some one didn't
   finish some code or the code is basically just junk from the past.

   Anyway we grok the partitions now one by one as we detect the channels.

 - ide_driveid_update is gone. We don't report the drive id through /proc/ide
   and we don't have to update it any longer on the fly. Still someone out there
   complaining that it went away!?

 - Use the global driver spin-lock to protect data structure access in the
   ide_register_subdriver() function instead of blatantly disabling all
   interrupts.
parent 18c16b33
...@@ -212,7 +212,7 @@ When ide.c is used as a module, you can pass command line parameters to the ...@@ -212,7 +212,7 @@ When ide.c is used as a module, you can pass command line parameters to the
driver using the "options=" keyword to insmod, while replacing any ',' with driver using the "options=" keyword to insmod, while replacing any ',' with
';'. For example: ';'. For example:
insmod ide.o options="ide0=serialize ide2=0x1e8;0x3ee;11" insmod ide.o options="ide0=serialize ide1=serialize ide2=0x1e8;0x3ee;11"
================================================================================ ================================================================================
...@@ -220,50 +220,69 @@ driver using the "options=" keyword to insmod, while replacing any ',' with ...@@ -220,50 +220,69 @@ driver using the "options=" keyword to insmod, while replacing any ',' with
Summary of ide driver parameters for kernel "command line": Summary of ide driver parameters for kernel "command line":
---------------------------------------------------------- ----------------------------------------------------------
"hdx=" is recognized for all "x" from "a" to "h", such as "hdc". "hdx=" is recognized for all "x" from "a" to "h", such as "hdc".
"idex=" is recognized for all "x" from "0" to "3", such as "ide1". "idex=" is recognized for all "x" from "0" to "3", such as "ide1".
"hdx=noprobe" : drive may be present, but do not probe for it "hdx=noprobe" : drive may be present, but do not probe for it
"hdx=none" : drive is NOT present, ignore cmos and do not probe "hdx=none" : drive is NOT present, ignore cmos and do not probe
"hdx=nowerr" : ignore the WRERR_STAT bit on this drive "hdx=nowerr" : ignore the WRERR_STAT bit on this drive
"hdx=cdrom" : drive is present, and is a cdrom drive "hdx=cdrom" : drive is present, and is a cdrom drive
"hdx=cyl,head,sect" : disk drive is present, with specified geometry "hdx=cyl,head,sect" : disk drive is present, with specified geometry
"hdx=autotune" : driver will attempt to tune interface speed "hdx=autotune" : driver will attempt to tune interface speed
to the fastest PIO mode supported, to the fastest PIO mode supported,
if possible for this drive only. if possible for this drive only.
Not fully supported by all chipset types, Not fully supported by all chipset types,
and quite likely to cause trouble with and quite likely to cause trouble with
older/odd IDE drives. older/odd IDE drives.
"hdx=slow" : insert a huge pause after each access to the data "hdx=slow" : insert a huge pause after each access to the data
port. Should be used only as a last resort. port. Should be used only as a last resort.
"hdxlun=xx" : set the drive last logical unit "hdxlun=xx" : set the drive last logical unit
"idebus=xx" : inform IDE driver of VESA/PCI bus speed in MHz, "idebus=xx" : inform IDE driver of VESA/PCI bus speed in MHz,
where "xx" is between 20 and 66 inclusive, where "xx" is between 20 and 66 inclusive,
used when tuning chipset PIO modes. used when tuning chipset PIO modes.
For PCI bus, 25 is correct for a P75 system, For PCI bus, 25 is correct for a P75 system,
30 is correct for P90,P120,P180 systems, 30 is correct for P90,P120,P180 systems,
and 33 is used for P100,P133,P166 systems. and 33 is used for P100,P133,P166 systems.
If in doubt, use idebus=33 for PCI. If in doubt, use idebus=33 for PCI.
As for VLB, it is safest to not specify it. As for VLB, it is safest to not specify it.
Bigger values are safer than smaller ones. Bigger values are safer than smaller ones.
"idex=noprobe" : do not attempt to access/use this interface "idex=noprobe" : do not attempt to access/use this interface
"idex=base" : probe for an interface at the addr specified, "idex=base" : probe for an interface at the addr specified,
where "base" is usually 0x1f0 or 0x170 where "base" is usually 0x1f0 or 0x170
and "ctl" is assumed to be "base"+0x206 and "ctl" is assumed to be "base"+0x206
"idex=base,ctl" : specify both base and ctl "idex=base,ctl" : specify both base and ctl
"idex=base,ctl,irq" : specify base, ctl, and irq number "idex=base,ctl,irq" : specify base, ctl, and irq number
"idex=autotune" : driver will attempt to tune interface speed "idex=autotune" : driver will attempt to tune interface speed
to the fastest PIO mode supported, to the fastest PIO mode supported,
for all drives on this interface. for all drives on this interface.
Not fully supported by all chipset types, Not fully supported by all chipset types,
and quite likely to cause trouble with and quite likely to cause trouble with
older/odd IDE drives. older/odd IDE drives.
"idex=noautotune" : driver will NOT attempt to tune interface speed
This is the default for most chipsets, "idex=noautotune" : driver will NOT attempt to tune interface speed
except the cmd640. This is the default for most chipsets,
"idex=serialize" : do not overlap operations on idex and ide(x^1) except the cmd640.
"idex=serialize" : do not overlap operations on idex. Please note
that you will have to specify this option for
both the respecitve primary and secondary channel
to take effect.
"idex=reset" : reset interface after probe "idex=reset" : reset interface after probe
"idex=dma" : automatically configure/use DMA if possible. "idex=dma" : automatically configure/use DMA if possible.
The following are valid ONLY on ide0, which usually corresponds to the first The following are valid ONLY on ide0, which usually corresponds to the first
...@@ -304,6 +323,6 @@ drives. ...@@ -304,6 +323,6 @@ drives.
mlord@pobox.com mlord@pobox.com
-- --
Wed Apr 17 22:52:44 CEST 2002 edited by Marcin Dalecki
For current maintainers of this stuff, please see the linux/MAINTAINERS file. Wed Apr 17 22:52:44 CEST 2002 edited by Marcin Dalecki, the current
maintainer.
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
# In the future, some of these should be built conditionally. # In the future, some of these should be built conditionally.
# #
export-objs := ide-taskfile.o main.o ide.o ide-features.o ide-probe.o quirks.o pcidma.o tcq.o \ export-objs := ide-taskfile.o main.o ide.o probe.o quirks.o pcidma.o tcq.o \
atapi.o ataraid.o atapi.o ataraid.o
obj-$(CONFIG_BLK_DEV_HD) += hd.o obj-$(CONFIG_BLK_DEV_HD) += hd.o
...@@ -68,7 +68,7 @@ obj-$(CONFIG_BLK_DEV_ATARAID) += ataraid.o ...@@ -68,7 +68,7 @@ obj-$(CONFIG_BLK_DEV_ATARAID) += ataraid.o
obj-$(CONFIG_BLK_DEV_ATARAID_PDC) += pdcraid.o obj-$(CONFIG_BLK_DEV_ATARAID_PDC) += pdcraid.o
obj-$(CONFIG_BLK_DEV_ATARAID_HPT) += hptraid.o obj-$(CONFIG_BLK_DEV_ATARAID_HPT) += hptraid.o
ide-mod-objs := ide-taskfile.o main.o ide.o ide-probe.o ide-geometry.o ide-features.o \ ide-mod-objs := ide-taskfile.o main.o ide.o probe.o \
ioctl.o atapi.o ata-timing.o$(ide-obj-y) ioctl.o atapi.o ata-timing.o$(ide-obj-y)
include $(TOPDIR)/Rules.make include $(TOPDIR)/Rules.make
...@@ -82,4 +82,5 @@ extern void ata_timing_merge(struct ata_timing *a, struct ata_timing *b, ...@@ -82,4 +82,5 @@ extern void ata_timing_merge(struct ata_timing *a, struct ata_timing *b,
extern struct ata_timing* ata_timing_data(short speed); extern struct ata_timing* ata_timing_data(short speed);
extern int ata_timing_compute(struct ata_device *drive, extern int ata_timing_compute(struct ata_device *drive,
short speed, struct ata_timing *t, int T, int UT); short speed, struct ata_timing *t, int T, int UT);
#endif #endif
...@@ -76,8 +76,6 @@ static int cs5530_get_info (char *buffer, char **addr, off_t offset, int count) ...@@ -76,8 +76,6 @@ static int cs5530_get_info (char *buffer, char **addr, off_t offset, int count)
byte cs5530_proc = 0; byte cs5530_proc = 0;
extern char *ide_xfer_verbose (byte xfer_rate);
/* /*
* Set a new transfer mode at the drive * Set a new transfer mode at the drive
*/ */
...@@ -85,7 +83,7 @@ int cs5530_set_xfer_mode(struct ata_device *drive, byte mode) ...@@ -85,7 +83,7 @@ int cs5530_set_xfer_mode(struct ata_device *drive, byte mode)
{ {
int error = 0; int error = 0;
printk("%s: cs5530_set_xfer_mode(%s)\n", drive->name, ide_xfer_verbose(mode)); printk("%s: cs5530_set_xfer_mode(%02x)\n", drive->name, mode);
error = ide_config_drive_speed(drive, mode); error = ide_config_drive_speed(drive, mode);
return error; return error;
......
...@@ -94,8 +94,6 @@ static int hpt34x_get_info (char *buffer, char **addr, off_t offset, int count) ...@@ -94,8 +94,6 @@ static int hpt34x_get_info (char *buffer, char **addr, off_t offset, int count)
byte hpt34x_proc = 0; byte hpt34x_proc = 0;
extern char *ide_xfer_verbose(byte xfer_rate);
static void hpt34x_clear_chipset(struct ata_device *drive) static void hpt34x_clear_chipset(struct ata_device *drive)
{ {
unsigned int reg1 = 0, tmp1 = 0; unsigned int reg1 = 0, tmp1 = 0;
...@@ -132,12 +130,12 @@ static int hpt34x_tune_chipset(struct ata_device *drive, byte speed) ...@@ -132,12 +130,12 @@ static int hpt34x_tune_chipset(struct ata_device *drive, byte speed)
pci_write_config_dword(drive->channel->pci_dev, 0x48, tmp2); pci_write_config_dword(drive->channel->pci_dev, 0x48, tmp2);
#if HPT343_DEBUG_DRIVE_INFO #if HPT343_DEBUG_DRIVE_INFO
printk("%s: %s drive%d (0x%04x 0x%04x) (0x%04x 0x%04x)" \ printk("%s: %02x drive%d (0x%04x 0x%04x) (0x%04x 0x%04x)" \
" (0x%02x 0x%02x) 0x%04x\n", " (0x%02x 0x%02x) 0x%04x\n",
drive->name, ide_xfer_verbose(speed), drive->name, speed,
drive->dn, reg1, tmp1, reg2, tmp2, drive->dn, reg1, tmp1, reg2, tmp2,
hi_speed, lo_speed, err); hi_speed, lo_speed, err);
#endif /* HPT343_DEBUG_DRIVE_INFO */ #endif
if (!drive->init_speed) if (!drive->init_speed)
drive->init_speed = speed; drive->init_speed = speed;
......
...@@ -27,8 +27,6 @@ ...@@ -27,8 +27,6 @@
#include <asm/io.h> #include <asm/io.h>
#include <asm/page.h> #include <asm/page.h>
extern char *ide_xfer_verbose (byte xfer_rate);
/* /*
* Maximum number of interfaces per card * Maximum number of interfaces per card
*/ */
...@@ -372,8 +370,8 @@ icside_config_if(struct ata_device *drive, int xfer_mode) ...@@ -372,8 +370,8 @@ icside_config_if(struct ata_device *drive, int xfer_mode)
else else
drive->drive_data = 480; drive->drive_data = 480;
printk("%s: %s selected (peak %dMB/s)\n", drive->name, printk("%s: %02x selected (peak %dMB/s)\n", drive->name,
ide_xfer_verbose(xfer_mode), 2000 / drive->drive_data); xfer_mode, 2000 / drive->drive_data);
drive->current_speed = xfer_mode; drive->current_speed = xfer_mode;
......
...@@ -871,9 +871,10 @@ int cdrom_read_check_ireason(struct ata_device *drive, struct request *rq, int l ...@@ -871,9 +871,10 @@ int cdrom_read_check_ireason(struct ata_device *drive, struct request *rq, int l
/* Throw some data at the drive so it doesn't hang /* Throw some data at the drive so it doesn't hang
and quit this request. */ and quit this request. */
while (len > 0) { while (len > 0) {
int dum = 0; u8 dummy[4];
atapi_write(drive, &dum, sizeof (dum));
len -= sizeof (dum); atapi_write(drive, dummy, sizeof(dummy));
len -= sizeof(dummy);
} }
} else if (ireason == 1) { } else if (ireason == 1) {
/* Some drives (ASUS) seem to tell us that status /* Some drives (ASUS) seem to tell us that status
...@@ -1293,10 +1294,10 @@ static ide_startstop_t cdrom_pc_intr(struct ata_device *drive, struct request *r ...@@ -1293,10 +1294,10 @@ static ide_startstop_t cdrom_pc_intr(struct ata_device *drive, struct request *r
/* If we haven't moved enough data to satisfy the drive, /* If we haven't moved enough data to satisfy the drive,
add some padding. */ add some padding. */
while (len > thislen) { while (len > thislen) {
int dum = 0; u8 dummy[4];
atapi_write(drive, &dum, sizeof (dum)); atapi_write(drive, dummy, sizeof(dummy));
len -= sizeof (dum); len -= sizeof(dummy);
} }
/* Keep count of how much data we've moved. */ /* Keep count of how much data we've moved. */
...@@ -1312,9 +1313,10 @@ static ide_startstop_t cdrom_pc_intr(struct ata_device *drive, struct request *r ...@@ -1312,9 +1313,10 @@ static ide_startstop_t cdrom_pc_intr(struct ata_device *drive, struct request *r
/* If we haven't moved enough data to satisfy the drive, /* If we haven't moved enough data to satisfy the drive,
add some padding. */ add some padding. */
while (len > thislen) { while (len > thislen) {
int dum = 0; u8 dummy[4];
atapi_read(drive, &dum, sizeof (dum));
len -= sizeof (dum); atapi_read(drive, dummy, sizeof(dummy));
len -= sizeof(dummy);
} }
/* Keep count of how much data we've moved. */ /* Keep count of how much data we've moved. */
...@@ -1456,9 +1458,9 @@ static inline int cdrom_write_check_ireason(struct ata_device *drive, struct req ...@@ -1456,9 +1458,9 @@ static inline int cdrom_write_check_ireason(struct ata_device *drive, struct req
/* Throw some data at the drive so it doesn't hang /* Throw some data at the drive so it doesn't hang
and quit this request. */ and quit this request. */
while (len > 0) { while (len > 0) {
int dum = 0; u8 dummy[4];
atapi_write(drive, &dum, sizeof(dum)); atapi_write(drive, dummy, sizeof(dummy));
len -= sizeof(dum); len -= sizeof(dummy);
} }
} else { } else {
/* Drive wants a command packet, or invalid ireason... */ /* Drive wants a command packet, or invalid ireason... */
......
This diff is collapsed.
/*
* Sun Feb 24 23:13:03 CET 2002: Patch by Andries Brouwer to remove the
* confused CMOS probe applied. This is solving more problems than it may
* (unexpectedly) introduce.
*/
#include <linux/config.h>
#include <linux/types.h>
#include <linux/ide.h>
#include <linux/mc146818rtc.h>
#include <asm/io.h>
#if defined(CONFIG_BLK_DEV_IDE) || defined(CONFIG_BLK_DEV_IDE_MODULE)
extern struct ata_device * get_info_ptr(kdev_t);
/*
* If heads is nonzero: find a translation with this many heads and S=63.
* Otherwise: find out how OnTrack Disk Manager would translate the disk.
*/
static void
ontrack(struct ata_device *drive, int heads, unsigned int *c, int *h, int *s)
{
static const u8 dm_head_vals[] = {4, 8, 16, 32, 64, 128, 255, 0};
const u8 *headp = dm_head_vals;
unsigned long total;
/*
* The specs say: take geometry as obtained from Identify, compute
* total capacity C*H*S from that, and truncate to 1024*255*63. Now
* take S=63, H the first in the sequence 4, 8, 16, 32, 64, 128, 255
* such that 63*H*1024 >= total. [Please tell aeb@cwi.nl in case this
* computes a geometry different from what OnTrack uses.]
*/
total = ata_capacity(drive);
*s = 63;
if (heads) {
*h = heads;
*c = total / (63 * heads);
return;
}
while (63 * headp[0] * 1024 < total && headp[1] != 0)
headp++;
*h = headp[0];
*c = total / (63 * headp[0]);
}
/*
* This routine is called from the partition-table code in pt/msdos.c.
* It has two tasks:
* (i) to handle Ontrack DiskManager by offsetting everything by 63 sectors,
* or to handle EZdrive by remapping sector 0 to sector 1.
* (ii) to invent a translated geometry.
* Part (i) is suppressed if the user specifies the "noremap" option
* on the command line.
* Part (ii) is suppressed if the user specifies an explicit geometry.
*
* The ptheads parameter is either 0 or tells about the number of
* heads shown by the end of the first nonempty partition.
* If this is either 16, 32, 64, 128, 240 or 255 we'll believe it.
*
* The xparm parameter has the following meaning:
* 0 = convert to CHS with fewer than 1024 cyls
* using the same method as Ontrack DiskManager.
* 1 = same as "0", plus offset everything by 63 sectors.
* -1 = similar to "0", plus redirect sector 0 to sector 1.
* 2 = convert to a CHS geometry with "ptheads" heads.
*
* Returns 0 if the translation was not possible, if the device was not
* an IDE disk drive, or if a geometry was "forced" on the commandline.
* Returns 1 if the geometry translation was successful.
*/
int ide_xlate_1024(kdev_t i_rdev, int xparm, int ptheads, const char *msg)
{
struct ata_device *drive;
const char *msg1 = "";
int heads = 0;
int c, h, s;
int transl = 1; /* try translation */
int ret = 0;
drive = get_info_ptr(i_rdev);
if (!drive)
return 0;
/* remap? */
if (drive->remap_0_to_1 != 2) {
if (xparm == 1) { /* DM */
drive->sect0 = 63;
msg1 = " [remap +63]";
ret = 1;
} else if (xparm == -1) { /* EZ-Drive */
if (drive->remap_0_to_1 == 0) {
drive->remap_0_to_1 = 1;
msg1 = " [remap 0->1]";
ret = 1;
}
}
}
/* There used to be code here that assigned drive->id->CHS
to drive->CHS and that to drive->bios_CHS. However,
some disks have id->C/H/S = 4092/16/63 but are larger than 2.1 GB.
In such cases that code was wrong. Moreover,
there seems to be no reason to do any of these things. */
/* translate? */
if (drive->forced_geom)
transl = 0;
/* does ptheads look reasonable? */
if (ptheads == 32 || ptheads == 64 || ptheads == 128 ||
ptheads == 240 || ptheads == 255)
heads = ptheads;
if (xparm == 2) {
if (!heads ||
(drive->bios_head >= heads && drive->bios_sect == 63))
transl = 0;
}
if (xparm == -1) {
if (drive->bios_head > 16)
transl = 0; /* we already have a translation */
}
if (transl) {
ontrack(drive, heads, &c, &h, &s);
drive->bios_cyl = c;
drive->bios_head = h;
drive->bios_sect = s;
ret = 1;
}
drive->part[0].nr_sects = ata_capacity(drive);
if (ret)
printk("%s%s [%d/%d/%d]", msg, msg1,
drive->bios_cyl, drive->bios_head, drive->bios_sect);
return ret;
}
#endif
...@@ -977,7 +977,6 @@ int ide_cmd_ioctl(struct ata_device *drive, unsigned long arg) ...@@ -977,7 +977,6 @@ int ide_cmd_ioctl(struct ata_device *drive, unsigned long arg)
/* FIXME: what about the setup for the drive?! */ /* FIXME: what about the setup for the drive?! */
if (drive->channel->speedproc) if (drive->channel->speedproc)
drive->channel->speedproc(drive, pio); drive->channel->speedproc(drive, pio);
ide_driveid_update(drive);
} }
abort: abort:
......
...@@ -219,31 +219,6 @@ static void init_hwif_data(struct ata_channel *ch, unsigned int index) ...@@ -219,31 +219,6 @@ static void init_hwif_data(struct ata_channel *ch, unsigned int index)
extern struct block_device_operations ide_fops[]; extern struct block_device_operations ide_fops[];
/*
* This is called exactly *once* for each channel.
*/
void ide_geninit(struct ata_channel *ch)
{
unsigned int unit;
struct gendisk *gd = ch->gd;
for (unit = 0; unit < MAX_DRIVES; ++unit) {
struct ata_device *drive = &ch->drives[unit];
if (!drive->present)
continue;
if (drive->type != ATA_DISK && drive->type != ATA_FLOPPY)
continue;
register_disk(gd,mk_kdev(ch->major,unit<<PARTN_BITS),
#ifdef CONFIG_BLK_DEV_ISAPNP
(drive->forced_geom && drive->noprobe) ? 1 :
#endif
1 << PARTN_BITS, ide_fops, ata_capacity(drive));
}
}
/* /*
* Returns the (struct ata_device *) for a given device number. Return * Returns the (struct ata_device *) for a given device number. Return
* NULL if the given device number does not match any present drives. * NULL if the given device number does not match any present drives.
...@@ -303,7 +278,10 @@ int ata_revalidate(kdev_t i_rdev) ...@@ -303,7 +278,10 @@ int ata_revalidate(kdev_t i_rdev)
if (!res) { if (!res) {
if (ata_ops(drive) && ata_ops(drive)->revalidate) { if (ata_ops(drive) && ata_ops(drive)->revalidate) {
ata_get(ata_ops(drive)); ata_get(ata_ops(drive));
/* this is a no-op for tapes and SCSI based access */
/* This is expected to be a no-op for tapes and SCSI
* based access.
*/
ata_ops(drive)->revalidate(drive); ata_ops(drive)->revalidate(drive);
ata_put(ata_ops(drive)); ata_put(ata_ops(drive));
} else } else
...@@ -312,6 +290,7 @@ int ata_revalidate(kdev_t i_rdev) ...@@ -312,6 +290,7 @@ int ata_revalidate(kdev_t i_rdev)
drive->busy = 0; drive->busy = 0;
wake_up(&drive->wqueue); wake_up(&drive->wqueue);
MOD_DEC_USE_COUNT; MOD_DEC_USE_COUNT;
return res; return res;
...@@ -359,6 +338,9 @@ void ide_driver_module(void) ...@@ -359,6 +338,9 @@ void ide_driver_module(void)
revalidate_drives(); revalidate_drives();
} }
/*
* Release the data associated with a channel.
*/
void ide_unregister(struct ata_channel *ch) void ide_unregister(struct ata_channel *ch)
{ {
struct gendisk *gd; struct gendisk *gd;
...@@ -614,7 +596,7 @@ static struct ata_operations * subdriver_iterator(struct ata_operations *prev) ...@@ -614,7 +596,7 @@ static struct ata_operations * subdriver_iterator(struct ata_operations *prev)
/* /*
* Register an IDE interface, specifing exactly the registers etc * Register an IDE interface, specifing exactly the registers etc
* Set init=1 iff calling before probes have taken place. * Set initializing=1 iff calling before probes have taken place.
*/ */
int ide_register_hw(hw_regs_t *hw) int ide_register_hw(hw_regs_t *hw)
{ {
...@@ -776,80 +758,8 @@ static void __init init_global_data(void) ...@@ -776,80 +758,8 @@ static void __init init_global_data(void)
* line" strings beginning with "hdx=" or "ide".It gets called even before the * line" strings beginning with "hdx=" or "ide".It gets called even before the
* actual module gets initialized. * actual module gets initialized.
* *
* Here is the complete set currently supported comand line options: * Please look at Documentation/ide.txt to see the complete list of supported
* * options.
* "hdx=" is recognized for all "x" from "a" to "h", such as "hdc".
* "idex=" is recognized for all "x" from "0" to "3", such as "ide1".
*
* "hdx=noprobe" : drive may be present, but do not probe for it
* "hdx=none" : drive is NOT present, ignore cmos and do not probe
* "hdx=nowerr" : ignore the WRERR_STAT bit on this drive
* "hdx=cdrom" : drive is present, and is a cdrom drive
* "hdx=cyl,head,sect" : disk drive is present, with specified geometry
* "hdx=noremap" : do not remap 0->1 even though EZD was detected
* "hdx=autotune" : driver will attempt to tune interface speed
* to the fastest PIO mode supported,
* if possible for this drive only.
* Not fully supported by all chipset types,
* and quite likely to cause trouble with
* older/odd IDE drives.
*
* "hdx=slow" : insert a huge pause after each access to the data
* port. Should be used only as a last resort.
*
* "hdxlun=xx" : set the drive last logical unit.
* "hdx=flash" : allows for more than one ata_flash disk to be
* registered. In most cases, only one device
* will be present.
* "hdx=ide-scsi" : the return of the ide-scsi flag, this is useful for
* allowwing ide-floppy, ide-tape, and ide-cdrom|writers
* to use ide-scsi emulation on a device specific option.
* "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.
* For PCI bus, 25 is correct for a P75 system,
* 30 is correct for P90,P120,P180 systems,
* and 33 is used for P100,P133,P166 systems.
* If in doubt, use idebus=33 for PCI.
* As for VLB, it is safest to not specify it.
*
* "idex=noprobe" : do not attempt to access/use this interface
* "idex=base" : probe for an interface at the address specified,
* where "base" is usually 0x1f0 or 0x170
* and "ctl" is assumed to be "base"+0x206
* "idex=base,ctl" : specify both base and ctl
* "idex=base,ctl,irq" : specify base, ctl, and irq number
* "idex=autotune" : driver will attempt to tune interface speed
* to the fastest PIO mode supported,
* for all drives on this interface.
* Not fully supported by all chipset types,
* and quite likely to cause trouble with
* older/odd IDE drives.
* "idex=noautotune" : driver will NOT attempt to tune interface speed
* This is the default for most chipsets,
* except the cmd640.
* "idex=serialize" : do not overlap operations on idex and ide(x^1)
* "idex=four" : four drives on idex and ide(x^1) share same ports
* "idex=reset" : reset interface before first use
* "idex=dma" : enable DMA by default on both drives if possible
* "idex=ata66" : informs the interface that it has an 80c cable
* for chipsets that are ATA-66 capable, but
* the ablity to bit test for detection is
* currently unknown.
* "ide=reverse" : Formerly called to pci sub-system, but now local.
*
* The following are valid ONLY on ide0, (except dc4030)
* and the defaults for the base,ctl ports must not be altered.
*
* "ide0=dtc2278" : probe/support DTC2278 interface
* "ide0=ht6560b" : probe/support HT6560B interface
* "ide0=cmd640_vlb" : *REQUIRED* for VLB cards with the CMD640 chip
* (not for PCI -- automatically detected)
* "ide0=qd65xx" : probe/support qd65xx interface
* "ide0=ali14xx" : probe/support ali14xx chipsets (ALI M1439, M1443, M1445)
* "ide0=umc8672" : probe/support umc8672 chipsets
* "idex=dc4030" : probe/support Promise DC4030VL interface
* "ide=doubler" : probe/support IDE doublers on Amiga
*/ */
int __init ide_setup(char *s) int __init ide_setup(char *s)
{ {
...@@ -1098,14 +1008,14 @@ int __init ide_setup(char *s) ...@@ -1098,14 +1008,14 @@ int __init ide_setup(char *s)
case -6: /* dma */ case -6: /* dma */
ch->autodma = 1; ch->autodma = 1;
goto done; goto done;
case -5: /* "reset" */ case -5: /* reset */
ch->reset = 1; ch->reset = 1;
goto done; goto done;
case -4: /* "noautotune" */ case -4: /* noautotune */
ch->drives[0].autotune = 2; ch->drives[0].autotune = 2;
ch->drives[1].autotune = 2; ch->drives[1].autotune = 2;
goto done; goto done;
case -3: /* "autotune" */ case -3: /* autotune */
ch->drives[0].autotune = 1; ch->drives[0].autotune = 1;
ch->drives[1].autotune = 1; ch->drives[1].autotune = 1;
goto done; goto done;
...@@ -1167,21 +1077,21 @@ int ide_register_subdriver(struct ata_device *drive, struct ata_operations *driv ...@@ -1167,21 +1077,21 @@ int ide_register_subdriver(struct ata_device *drive, struct ata_operations *driv
{ {
unsigned long flags; unsigned long flags;
save_flags(flags); /* all CPUs */ /* FIXME: The locking here doesn't make the slightest sense! */
cli(); /* all CPUs */ spin_lock_irqsave(&ide_lock, flags);
if (!drive->present || drive->driver != NULL || drive->busy || drive->usage) { if (!drive->present || drive->driver != NULL || drive->busy || drive->usage) {
restore_flags(flags); /* all CPUs */ spin_unlock_irqrestore(&ide_lock, flags);
return 1; return 1;
} }
/* FIXME: This will be pushed to the drivers! Thus allowing us to /* FIXME: This will be pushed to the drivers! Thus allowing us to
* save one parameter here separate this out. * save one parameter here and to separate this out.
*/ */
drive->driver = driver; drive->driver = driver;
restore_flags(flags); /* all CPUs */ spin_unlock_irqrestore(&ide_lock, flags);
/* FIXME: Check what this magic number is supposed to be about? */ /* Default autotune or requested autotune */
if (drive->autotune != 2) { if (drive->autotune != 2) {
if (drive->channel->XXX_udma) { if (drive->channel->XXX_udma) {
...@@ -1380,11 +1290,9 @@ static struct notifier_block ata_notifier = { ...@@ -1380,11 +1290,9 @@ static struct notifier_block ata_notifier = {
*/ */
static int __init ata_module_init(void) static int __init ata_module_init(void)
{ {
int h;
printk(KERN_INFO "ATA/ATAPI device driver v" VERSION "\n"); printk(KERN_INFO "ATA/ATAPI device driver v" VERSION "\n");
ide_devfs_handle = devfs_mk_dir (NULL, "ide", NULL); ide_devfs_handle = devfs_mk_dir(NULL, "ata", NULL);
/* /*
* Because most of the ATA adapters represent the timings in unit of * Because most of the ATA adapters represent the timings in unit of
...@@ -1583,12 +1491,6 @@ static int __init ata_module_init(void) ...@@ -1583,12 +1491,6 @@ static int __init ata_module_init(void)
initializing = 0; initializing = 0;
for (h = 0; h < MAX_HWIFS; ++h) {
struct ata_channel *channel = &ide_hwifs[h];
if (channel->present)
ide_geninit(channel);
}
register_reboot_notifier(&ata_notifier); register_reboot_notifier(&ata_notifier);
return 0; return 0;
......
...@@ -53,8 +53,6 @@ ...@@ -53,8 +53,6 @@
#define PDC202XX_DEBUG_DRIVE_INFO 0 #define PDC202XX_DEBUG_DRIVE_INFO 0
#define PDC202XX_DECODE_REGISTER_INFO 0 #define PDC202XX_DECODE_REGISTER_INFO 0
extern char *ide_xfer_verbose (byte xfer_rate);
/* A Register */ /* A Register */
#define SYNC_ERRDY_EN 0xC0 #define SYNC_ERRDY_EN 0xC0
...@@ -276,12 +274,12 @@ static int pdc202xx_tune_chipset(struct ata_device *drive, byte speed) ...@@ -276,12 +274,12 @@ static int pdc202xx_tune_chipset(struct ata_device *drive, byte speed)
drive->current_speed = speed; drive->current_speed = speed;
#if PDC202XX_DEBUG_DRIVE_INFO #if PDC202XX_DEBUG_DRIVE_INFO
printk("%s: %s drive%d 0x%08x ", printk("%s: %02x drive%d 0x%08x ",
drive->name, ide_xfer_verbose(speed), drive->name, speed,
drive->dn, drive_conf); drive->dn, drive_conf);
pci_read_config_dword(dev, drive_pci, &drive_conf); pci_read_config_dword(dev, drive_pci, &drive_conf);
printk("0x%08x\n", drive_conf); printk("0x%08x\n", drive_conf);
#endif /* PDC202XX_DEBUG_DRIVE_INFO */ #endif
return ide_config_drive_speed(drive, speed); return ide_config_drive_speed(drive, speed);
} }
......
...@@ -237,8 +237,6 @@ static byte svwks_proc; ...@@ -237,8 +237,6 @@ static byte svwks_proc;
#define SVWKS_CSB5_REVISION_NEW 0x92 /* min PCI_REVISION_ID for UDMA5 (A2.0) */ #define SVWKS_CSB5_REVISION_NEW 0x92 /* min PCI_REVISION_ID for UDMA5 (A2.0) */
extern char *ide_xfer_verbose (byte xfer_rate);
static struct pci_dev *isa_dev; static struct pci_dev *isa_dev;
static int svwks_ratemask(struct ata_device *drive) static int svwks_ratemask(struct ata_device *drive)
...@@ -347,8 +345,8 @@ static int svwks_tune_chipset(struct ata_device *drive, byte speed) ...@@ -347,8 +345,8 @@ static int svwks_tune_chipset(struct ata_device *drive, byte speed)
#endif #endif
#if SVWKS_DEBUG_DRIVE_INFO #if SVWKS_DEBUG_DRIVE_INFO
printk("%s: %s drive%d\n", drive->name, ide_xfer_verbose(speed), drive->dn); printk("%s: %02x drive%d\n", drive->name, speed, drive->dn);
#endif /* SVWKS_DEBUG_DRIVE_INFO */ #endif
pci_write_config_byte(dev, drive_pci, pio_timing); pci_write_config_byte(dev, drive_pci, pio_timing);
if (csb5) if (csb5)
......
...@@ -403,11 +403,11 @@ static int sis_get_info (char *buffer, char **addr, off_t offset, int count) ...@@ -403,11 +403,11 @@ static int sis_get_info (char *buffer, char **addr, off_t offset, int count)
return p-buffer; return p-buffer;
} }
#endif /* defined(DISPLAY_SIS_TIMINGS) && defined(CONFIG_PROC_FS) */
byte sis_proc = 0; byte sis_proc = 0;
extern char *ide_xfer_verbose (byte xfer_rate);
#endif
static int sis5513_ratemask(struct ata_device *drive) static int sis5513_ratemask(struct ata_device *drive)
{ {
......
...@@ -29,8 +29,6 @@ ...@@ -29,8 +29,6 @@
#include "ata-timing.h" #include "ata-timing.h"
#include "pcihost.h" #include "pcihost.h"
extern char *ide_xfer_verbose (byte xfer_rate);
/* /*
* SL82C105 PCI config register 0x40 bits. * SL82C105 PCI config register 0x40 bits.
*/ */
...@@ -100,8 +98,9 @@ static void config_for_pio(struct ata_device *drive, int pio, int report) ...@@ -100,8 +98,9 @@ static void config_for_pio(struct ata_device *drive, int pio, int report)
pci_read_config_word(dev, reg, &drv_ctrl); pci_read_config_word(dev, reg, &drv_ctrl);
if (report) { if (report) {
printk("%s: selected %s (%dns) (%04X)\n", drive->name, printk("%s: selected %02x (%dns) (%04X)\n",
ide_xfer_verbose(xfer_mode), t->cycle, drv_ctrl); drive->name, xfer_mode,
t->cycle, drv_ctrl);
} }
} }
} }
......
...@@ -1265,7 +1265,7 @@ int isd200_get_inquiry_data( struct us_data *us ) ...@@ -1265,7 +1265,7 @@ int isd200_get_inquiry_data( struct us_data *us )
/* ATA Command Identify successful */ /* ATA Command Identify successful */
int i; int i;
__u16 *src, *dest; __u16 *src, *dest;
ide_fix_driveid(&info->drive); ata_fix_driveid(&info->drive);
US_DEBUGP(" Identify Data Structure:\n"); US_DEBUGP(" Identify Data Structure:\n");
US_DEBUGP(" config = 0x%x\n", info->drive.config); US_DEBUGP(" config = 0x%x\n", info->drive.config);
......
...@@ -224,15 +224,11 @@ void add_gd_partition(struct gendisk *hd, int minor, int start, int size) ...@@ -224,15 +224,11 @@ void add_gd_partition(struct gendisk *hd, int minor, int start, int size)
static void check_partition(struct gendisk *hd, kdev_t dev, int first_part_minor) static void check_partition(struct gendisk *hd, kdev_t dev, int first_part_minor)
{ {
devfs_handle_t de = NULL; devfs_handle_t de = NULL;
static int first_time = 1;
unsigned long first_sector; unsigned long first_sector;
struct block_device *bdev; struct block_device *bdev;
char buf[64]; char buf[64];
int i; int i;
if (first_time)
printk(KERN_INFO "Partition check:\n");
first_time = 0;
first_sector = hd->part[minor(dev)].start_sect; first_sector = hd->part[minor(dev)].start_sect;
/* /*
......
...@@ -331,10 +331,13 @@ enum { ...@@ -331,10 +331,13 @@ enum {
#define HDIO_GETGEO_BIG_RAW 0x0331 /* */ #define HDIO_GETGEO_BIG_RAW 0x0331 /* */
#define __NEW_HD_DRIVE_ID #define __NEW_HD_DRIVE_ID
/* structure returned by HDIO_GET_IDENTITY,
* as per ANSI NCITS ATA6 rev.1b spec /*
* Structure returned by HDIO_GET_IDENTITY, as per ANSI NCITS ATA6 rev.1b spec.
*
* If you change something here, please remember to update fix_driveid() in
* ide/probe.c.
*/ */
/* if you change something here remember to update ide_fix_driveid() */
struct hd_driveid { struct hd_driveid {
unsigned short config; /* lots of obsolete bit flags */ unsigned short config; /* lots of obsolete bit flags */
unsigned short cyls; /* Obsolete, "physical" cyls */ unsigned short cyls; /* Obsolete, "physical" cyls */
......
...@@ -762,7 +762,6 @@ extern int ide_raw_taskfile(struct ata_device *, struct ata_taskfile *); ...@@ -762,7 +762,6 @@ extern int ide_raw_taskfile(struct ata_device *, struct ata_taskfile *);
extern int ide_cmd_ioctl(struct ata_device *drive, unsigned long arg); extern int ide_cmd_ioctl(struct ata_device *drive, unsigned long arg);
extern void ide_fix_driveid(struct hd_driveid *id); extern void ide_fix_driveid(struct hd_driveid *id);
extern int ide_driveid_update(struct ata_device *);
extern int ide_config_drive_speed(struct ata_device *, byte); extern int ide_config_drive_speed(struct ata_device *, byte);
extern byte eighty_ninty_three(struct ata_device *); extern byte eighty_ninty_three(struct ata_device *);
...@@ -893,11 +892,14 @@ extern void ide_release_dma(struct ata_channel *); ...@@ -893,11 +892,14 @@ extern void ide_release_dma(struct ata_channel *);
extern int ata_start_dma(struct ata_device *, struct request *rq); extern int ata_start_dma(struct ata_device *, struct request *rq);
extern void ata_init_dma(struct ata_channel *, unsigned long) __init; extern void ata_init_dma(struct ata_channel *, unsigned long) __init;
#endif #endif
extern void ata_fix_driveid(struct hd_driveid *);
extern spinlock_t ide_lock; extern spinlock_t ide_lock;
#define DRIVE_LOCK(drive) ((drive)->queue.queue_lock) #define DRIVE_LOCK(drive) ((drive)->queue.queue_lock)
extern int drive_is_ready(struct ata_device *drive); extern int drive_is_ready(struct ata_device *drive);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment