Commit 4dabe948 authored by Martin Dalecki's avatar Martin Dalecki Committed by Linus Torvalds

[PATCH] 2.5.6 IDE 18

No fixes for new problems which occured since today, just syncup.

 - Remove help text about suitable compiler versions, which is obsoleted
   by the overall kernel reality.

 - Remove traces of not progressing work in progress code for the
   CONFIG_BLK_DEV_ADMA option as well as the empty ide-adma.c file as
   well as CONFIG_BLK_DEV_IDEDMA_TCQ.

 - Remove redundant CONFIG_BLK_DEV_IDE != n check in ide/Config.in. Hugh,
   this is a tricky one...

 - Add EXPORT_SYMBOL(ide_fops) again, since it's used in ide-cd.c add a
   note there that this is actually possibly adding the same device twice
   to the devfs stuff.

 - Finally change the MAINTAINER entry. Just too many persons bogged me
   about it and it doesn't take me too much time apparently.

 - Apply sis.patch.20020304_1.

 - Don't call ide_release_dma twice in cleanup_ata, since ide_unregister
   is already calling it for us. Change prototype of ide_unregister to
   take a hwif as parameter and disable an ioctl for removing/scanning
   hwif from the list of handled interfaces. I see no reasons for having
   it and doing it is the fastest DOS attack on my home system I know
   about it. Contrary to the comments found here and there, hdparm
   doesn't use it. There are better hot plugging interfaces coming to the
   kernel right now anyway.

 - Wrap invalidate_drives in ide_unregister under the ide_lock instead of
   disabling and enabling interrupts during this operation. There are
   plenty of other places where the IDE drivers are enabling and
   disabling interrupts just to protect some data structures.

 - Don't call destroy_proc_ide_drives(hwif) for every single drive out
   there.This routine takes a hwif as a parameter.

 - Resync with the instable 2.5.6...
parent 24237d11
......@@ -709,14 +709,12 @@ W: http://www.developer.ibm.com/welcome/netfinity/serveraid.html
S: Supported
IDE DRIVER [GENERAL]
P: Andre Hedrick
M: andre@linux-ide.org
M: andre@linuxdiskcert.org
P: Martin Dalecki
M: martin@dalecki.de
I: pl_PL.ISO8859-2, de_DE.ISO8859-15, (en_US.ISO8859-1)
L: linux-kernel@vger.kernel.org
W: http://www.kernel.org/pub/linux/kernel/people/hedrick/
W: http://www.linux-ide.org/
W: http://www.linuxdiskcert.org/
S: Maintained
W: http://www.dalecki.de
S: Developement
IDE/ATAPI CDROM DRIVER
P: Jens Axboe
......
......@@ -255,7 +255,6 @@ CONFIG_BLK_DEV_IDEDMA=y
# CONFIG_IDEDMA_PCI_WIP is not set
# CONFIG_BLK_DEV_IDEDMA_TIMEOUT is not set
# CONFIG_IDEDMA_NEW_DRIVE_LISTINGS is not set
CONFIG_BLK_DEV_ADMA=y
# CONFIG_BLK_DEV_AEC62XX is not set
# CONFIG_AEC62XX_TUNING is not set
CONFIG_BLK_DEV_ALI15X3=y
......
......@@ -454,7 +454,6 @@ CONFIG_BLK_DEV_IDECD=y
CONFIG_BLK_DEV_IDEPCI=y
# CONFIG_IDEPCI_SHARE_IRQ is not set
CONFIG_BLK_DEV_IDEDMA_PCI=y
CONFIG_BLK_DEV_ADMA=y
# CONFIG_BLK_DEV_OFFBOARD is not set
CONFIG_IDEDMA_PCI_AUTO=y
CONFIG_BLK_DEV_IDEDMA=y
......
......@@ -258,7 +258,6 @@ CONFIG_BLK_DEV_IDEDMA=y
# CONFIG_IDEDMA_PCI_WIP is not set
# CONFIG_BLK_DEV_IDEDMA_TIMEOUT is not set
# CONFIG_IDEDMA_NEW_DRIVE_LISTINGS is not set
CONFIG_BLK_DEV_ADMA=y
# CONFIG_BLK_DEV_AEC62XX is not set
# CONFIG_AEC62XX_TUNING is not set
# CONFIG_BLK_DEV_ALI15X3 is not set
......
......@@ -207,7 +207,6 @@ CONFIG_BLK_DEV_IDESCSI=y
CONFIG_BLK_DEV_IDEPCI=y
CONFIG_IDEPCI_SHARE_IRQ=y
CONFIG_BLK_DEV_IDEDMA_PCI=y
CONFIG_BLK_DEV_ADMA=y
# CONFIG_BLK_DEV_OFFBOARD is not set
# CONFIG_IDEDMA_PCI_AUTO is not set
CONFIG_BLK_DEV_IDEDMA=y
......
......@@ -224,7 +224,6 @@ CONFIG_BLK_DEV_IDEDISK=y
CONFIG_BLK_DEV_IDEPCI=y
# CONFIG_IDEPCI_SHARE_IRQ is not set
# CONFIG_BLK_DEV_IDEDMA_PCI is not set
# CONFIG_BLK_DEV_ADMA is not set
# CONFIG_BLK_DEV_OFFBOARD is not set
# CONFIG_IDEDMA_PCI_AUTO is not set
# CONFIG_BLK_DEV_IDEDMA is not set
......
......@@ -289,7 +289,6 @@ CONFIG_BLK_DEV_IDEDISK=y
CONFIG_BLK_DEV_IDEPCI=y
CONFIG_IDEPCI_SHARE_IRQ=y
CONFIG_BLK_DEV_IDEDMA_PCI=y
CONFIG_BLK_DEV_ADMA=y
# CONFIG_BLK_DEV_OFFBOARD is not set
CONFIG_IDEDMA_PCI_AUTO=y
CONFIG_BLK_DEV_IDEDMA=y
......
......@@ -750,9 +750,7 @@ static struct ioctl32_list ioctl32_handler_table[] = {
IOCTL32_DEFAULT(HDIO_SET_NOWERR),
IOCTL32_DEFAULT(HDIO_SET_DMA),
IOCTL32_DEFAULT(HDIO_SET_PIO_MODE),
IOCTL32_DEFAULT(HDIO_SCAN_HWIF),
IOCTL32_DEFAULT(HDIO_SET_NICE),
//HDIO_UNREGISTER_HWIF
IOCTL32_DEFAULT(BLKROSET), /* fs.h ioctls */
IOCTL32_DEFAULT(BLKROGET),
......
......@@ -252,7 +252,6 @@ CONFIG_BLK_DEV_IDESCSI=y
CONFIG_BLK_DEV_IDEPCI=y
CONFIG_IDEPCI_SHARE_IRQ=y
CONFIG_BLK_DEV_IDEDMA_PCI=y
CONFIG_BLK_DEV_ADMA=y
# CONFIG_BLK_DEV_OFFBOARD is not set
CONFIG_IDEDMA_PCI_AUTO=y
CONFIG_BLK_DEV_IDEDMA=y
......
......@@ -235,7 +235,6 @@ CONFIG_BLK_DEV_IDEDISK=y
CONFIG_BLK_DEV_IDEPCI=y
CONFIG_IDEPCI_SHARE_IRQ=y
CONFIG_BLK_DEV_IDEDMA_PCI=y
CONFIG_BLK_DEV_ADMA=y
# CONFIG_BLK_DEV_OFFBOARD is not set
# CONFIG_IDEDMA_PCI_AUTO is not set
CONFIG_BLK_DEV_IDEDMA=y
......
......@@ -239,7 +239,6 @@ CONFIG_BLK_DEV_IDECD=y
CONFIG_BLK_DEV_IDEPCI=y
# CONFIG_IDEPCI_SHARE_IRQ is not set
# CONFIG_BLK_DEV_IDEDMA_PCI is not set
# CONFIG_BLK_DEV_ADMA is not set
# CONFIG_BLK_DEV_OFFBOARD is not set
# CONFIG_IDEDMA_PCI_AUTO is not set
# CONFIG_BLK_DEV_IDEDMA is not set
......
......@@ -242,7 +242,6 @@ CONFIG_BLK_DEV_IDESCSI=y
CONFIG_BLK_DEV_IDEPCI=y
CONFIG_IDEPCI_SHARE_IRQ=y
CONFIG_BLK_DEV_IDEDMA_PCI=y
CONFIG_BLK_DEV_ADMA=y
# CONFIG_BLK_DEV_OFFBOARD is not set
CONFIG_IDEDMA_PCI_AUTO=y
CONFIG_BLK_DEV_IDEDMA=y
......
......@@ -246,7 +246,6 @@ CONFIG_BLK_DEV_IDESCSI=y
CONFIG_BLK_DEV_IDEPCI=y
CONFIG_IDEPCI_SHARE_IRQ=y
CONFIG_BLK_DEV_IDEDMA_PCI=y
CONFIG_BLK_DEV_ADMA=y
# CONFIG_BLK_DEV_OFFBOARD is not set
# CONFIG_IDEDMA_PCI_AUTO is not set
CONFIG_BLK_DEV_IDEDMA=y
......
......@@ -209,7 +209,6 @@ CONFIG_BLK_DEV_IDECD=y
CONFIG_BLK_DEV_IDEPCI=y
CONFIG_IDEPCI_SHARE_IRQ=y
CONFIG_BLK_DEV_IDEDMA_PCI=y
CONFIG_BLK_DEV_ADMA=y
# CONFIG_BLK_DEV_OFFBOARD is not set
# CONFIG_IDEDMA_PCI_AUTO is not set
CONFIG_BLK_DEV_IDEDMA=y
......
......@@ -252,7 +252,6 @@ CONFIG_BLK_DEV_IDESCSI=y
CONFIG_BLK_DEV_IDEPCI=y
CONFIG_IDEPCI_SHARE_IRQ=y
CONFIG_BLK_DEV_IDEDMA_PCI=y
CONFIG_BLK_DEV_ADMA=y
# CONFIG_BLK_DEV_OFFBOARD is not set
CONFIG_IDEDMA_PCI_AUTO=y
CONFIG_BLK_DEV_IDEDMA=y
......
......@@ -3713,7 +3713,6 @@ COMPATIBLE_IOCTL(HDIO_SET_32BIT),
COMPATIBLE_IOCTL(HDIO_SET_MULTCOUNT),
COMPATIBLE_IOCTL(HDIO_DRIVE_CMD),
COMPATIBLE_IOCTL(HDIO_SET_PIO_MODE),
COMPATIBLE_IOCTL(HDIO_SCAN_HWIF),
COMPATIBLE_IOCTL(HDIO_SET_NICE),
/* 0x02 -- Floppy ioctls */
COMPATIBLE_IOCTL(FDMSGON),
......
......@@ -291,7 +291,6 @@ CONFIG_BLK_DEV_IDEDMA=y
# CONFIG_IDEDMA_PCI_WIP is not set
# CONFIG_BLK_DEV_IDEDMA_TIMEOUT is not set
# CONFIG_IDEDMA_NEW_DRIVE_LISTINGS is not set
CONFIG_BLK_DEV_ADMA=y
# CONFIG_BLK_DEV_AEC62XX is not set
# CONFIG_AEC62XX_TUNING is not set
CONFIG_BLK_DEV_ALI15X3=y
......
......@@ -3973,7 +3973,6 @@ COMPATIBLE_IOCTL(HDIO_SET_32BIT)
COMPATIBLE_IOCTL(HDIO_SET_MULTCOUNT)
COMPATIBLE_IOCTL(HDIO_DRIVE_CMD)
COMPATIBLE_IOCTL(HDIO_SET_PIO_MODE)
COMPATIBLE_IOCTL(HDIO_SCAN_HWIF)
COMPATIBLE_IOCTL(HDIO_SET_NICE)
/* 0x02 -- Floppy ioctls */
COMPATIBLE_IOCTL(FDMSGON)
......
......@@ -3059,7 +3059,6 @@ COMPATIBLE_IOCTL(HDIO_SET_32BIT)
COMPATIBLE_IOCTL(HDIO_SET_MULTCOUNT)
COMPATIBLE_IOCTL(HDIO_DRIVE_CMD)
COMPATIBLE_IOCTL(HDIO_SET_PIO_MODE)
COMPATIBLE_IOCTL(HDIO_SCAN_HWIF)
COMPATIBLE_IOCTL(HDIO_SET_NICE)
/* 0x02 -- Floppy ioctls */
COMPATIBLE_IOCTL(FDMSGON)
......
......@@ -251,10 +251,6 @@ CONFIG_IDEDMA_NEW_DRIVE_LISTINGS
be (U)DMA capable but aren't. This is a blanket on/off test with no
speed limit options.
Straight GNU GCC 2.7.3/2.8.X compilers are known to be safe;
whereas, many versions of EGCS have a problem and miscompile if you
say Y here.
If in doubt, say N.
CONFIG_BLK_DEV_IDEDMA_TIMEOUT
......@@ -319,10 +315,6 @@ CONFIG_IDEDMA_PCI_WIP
It is SAFEST to say N to this question.
CONFIG_BLK_DEV_ADMA
Please read the comments at the top of
<file:drivers/ide/ide-adma.c>.
CONFIG_BLK_DEV_PDC_ADMA
Please read the comments at the top of <file:drivers/ide/ide-pci.c>.
......@@ -515,10 +507,16 @@ CONFIG_PDC202XX_FORCE
For FastTrak enable overriding BIOS.
CONFIG_BLK_DEV_SIS5513
This driver ensures (U)DMA support for SIS5513 chipset based
mainboards. SiS620/530 UDMA mode 4, SiS5600/5597 UDMA mode 2, all
other DMA mode 2 limited chipsets are unsupported to date.
This driver ensures (U)DMA support for SIS5513 chipset family based
mainboards.
The following chipsets are supported:
ATA16: SiS5511, SiS5513
ATA33: SiS5591, SiS5597, SiS5598, SiS5600
ATA66: SiS530, SiS540, SiS620, SiS630, SiS640
ATA100: SiS635, SiS645, SiS650, SiS730, SiS735, SiS740,
SiS745, SiS750
If you say Y here, you need to say Y to "Use DMA by default when
available" as well.
......
This diff is collapsed.
......@@ -44,7 +44,6 @@ ide-obj-$(CONFIG_BLK_DEV_HPT34X) += hpt34x.o
ide-obj-$(CONFIG_BLK_DEV_HPT366) += hpt366.o
ide-obj-$(CONFIG_BLK_DEV_HT6560B) += ht6560b.o
ide-obj-$(CONFIG_BLK_DEV_IDE_ICSIDE) += icside.o
ide-obj-$(CONFIG_BLK_DEV_ADMA) += ide-adma.o
ide-obj-$(CONFIG_BLK_DEV_IDEDMA_PCI) += ide-dma.o
ide-obj-$(CONFIG_BLK_DEV_IDEPCI) += ide-pci.o
ide-obj-$(CONFIG_BLK_DEV_ISAPNP) += ide-pnp.o
......
/*
* linux/drivers/ide/ide-adma.c Version 0.00 June 24, 2001
*
* Copyright (c) 2001 Andre Hedrick <andre@linux-ide.org>
*
* Asynchronous DMA -- TBA, this is a holding file.
*
*/
......@@ -2508,6 +2508,11 @@ static int ide_cdrom_register (ide_drive_t *drive, int nslots)
if (!CDROM_CONFIG_FLAGS (drive)->close_tray)
devinfo->mask |= CDC_CLOSE_TRAY;
/* FIXME: I'm less that sure that this is the proper thing to do, since
* ware already adding the devices to devfs int ide.c upon device
* registration.
*/
devinfo->de = devfs_register(drive->de, "cd", DEVFS_FL_DEFAULT,
HWIF(drive)->major, minor,
S_IFBLK | S_IRUGO | S_IWUGO,
......
......@@ -401,7 +401,7 @@ void ide_release(u_long arg)
DEBUG(0, "ide_release(0x%p)\n", link);
if (info->ndev) {
ide_unregister(info->hd);
ide_unregister(&ide_hwifs[info->hd]);
MOD_DEC_USE_COUNT;
}
......
......@@ -707,8 +707,11 @@ int ide_dmaproc (ide_dma_action_t func, ide_drive_t *drive)
/*
* Needed for allowing full modular support of ide-driver
*/
int ide_release_dma (ide_hwif_t *hwif)
int ide_release_dma(ide_hwif_t *hwif)
{
if (!hwif->dma_base)
return;
if (hwif->dmatable_cpu) {
pci_free_consistent(hwif->pci_dev,
PRD_ENTRIES * PRD_BYTES,
......@@ -723,6 +726,8 @@ int ide_release_dma (ide_hwif_t *hwif)
if ((hwif->dma_extra) && (hwif->channel == 0))
release_region((hwif->dma_base + 16), hwif->dma_extra);
release_region(hwif->dma_base, 8);
hwif->dma_base = 0;
return 1;
}
......
......@@ -6,15 +6,8 @@
*/
/*
* This module provides support for automatic detection and
* configuration of all PCI IDE interfaces present in a system.
*/
/*
* Chipsets that are on the IDE_IGNORE list because of problems of not being
* set at compile time.
*
* CONFIG_BLK_DEV_PDC202XX
* This module provides support for automatic detection and configuration of
* all PCI ATA host chip chanells interfaces present in a system.
*/
#include <linux/config.h>
......@@ -34,8 +27,14 @@
#define PCI_VENDOR_ID_HINT 0x3388
#define PCI_DEVICE_ID_HINT 0x8013
#define IDE_IGNORE ((void *)-1)
#define IDE_NO_DRIVER ((void *)-2)
/*
* Some combi chips, which can be used on the PCI bus or the VL bus can be in
* some systems acessed either through the PCI config space or through the
* hosts IO bus. If the corresponding initialization driver is using the host
* IO space to deal with them please define the following.
*/
#define ATA_PCI_IGNORE ((void *)-1)
#ifdef CONFIG_BLK_DEV_AEC62XX
extern unsigned int pci_init_aec62xx(struct pci_dev *);
......@@ -306,7 +305,7 @@ static ide_pci_device_t pci_chipsets[] __initdata = {
* but which still need some generic quirk handling.
*/
{PCI_VENDOR_ID_PCTECH, PCI_DEVICE_ID_PCTECH_SAMURAI_IDE, NULL, NULL, NULL, NULL, {{0x00,0x00,0x00}, {0x00,0x00,0x00}}, ON_BOARD, 0, 0 },
{PCI_VENDOR_ID_CMD, PCI_DEVICE_ID_CMD_640, NULL, NULL, IDE_IGNORE, NULL, {{0x00,0x00,0x00}, {0x00,0x00,0x00}}, ON_BOARD, 0, 0 },
{PCI_VENDOR_ID_CMD, PCI_DEVICE_ID_CMD_640, NULL, NULL, ATA_PCI_IGNORE, NULL, {{0x00,0x00,0x00}, {0x00,0x00,0x00}}, ON_BOARD, 0, 0 },
{PCI_VENDOR_ID_NS, PCI_DEVICE_ID_NS_87410, NULL, NULL, NULL, NULL, {{0x43,0x08,0x08}, {0x47,0x08,0x08}}, ON_BOARD, 0, 0 },
{PCI_VENDOR_ID_HINT, PCI_DEVICE_ID_HINT, NULL, NULL, NULL, NULL, {{0x00,0x00,0x00}, {0x00,0x00,0x00}}, ON_BOARD, 0, 0 },
{PCI_VENDOR_ID_HOLTEK, PCI_DEVICE_ID_HOLTEK_6565, NULL, NULL, NULL, NULL, {{0x00,0x00,0x00}, {0x00,0x00,0x00}}, ON_BOARD, 0, 0 },
......@@ -314,7 +313,7 @@ static ide_pci_device_t pci_chipsets[] __initdata = {
{PCI_VENDOR_ID_UMC, PCI_DEVICE_ID_UMC_UM8886A, NULL, NULL, NULL, NULL, {{0x00,0x00,0x00}, {0x00,0x00,0x00}}, ON_BOARD, 0, ATA_F_FIXIRQ },
{PCI_VENDOR_ID_UMC, PCI_DEVICE_ID_UMC_UM8886BF, NULL, NULL, NULL, NULL, {{0x00,0x00,0x00}, {0x00,0x00,0x00}}, ON_BOARD, 0, ATA_F_FIXIRQ },
{PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_82C561, NULL, NULL, NULL, NULL, {{0x00,0x00,0x00}, {0x00,0x00,0x00}}, ON_BOARD, 0, ATA_F_NOADMA },
{PCI_VENDOR_ID_TTI, PCI_DEVICE_ID_TTI_HPT366, NULL, NULL, IDE_NO_DRIVER, NULL, {{0x00,0x00,0x00}, {0x00,0x00,0x00}}, OFF_BOARD, 240, ATA_F_IRQ | ATA_F_HPTHACK },
{PCI_VENDOR_ID_TTI, PCI_DEVICE_ID_TTI_HPT366, NULL, NULL, NULL, NULL, {{0x00,0x00,0x00}, {0x00,0x00,0x00}}, OFF_BOARD, 240, ATA_F_IRQ | ATA_F_HPTHACK },
{0, 0, NULL, NULL, NULL, NULL, {{0x00,0x00,0x00}, {0x00,0x00,0x00}}, ON_BOARD, 0 }};
/*
......@@ -683,11 +682,6 @@ static void __init setup_pci_device(struct pci_dev *dev, ide_pci_device_t *d)
autodma = 1;
#endif
if (d->init_hwif == IDE_NO_DRIVER) {
printk(KERN_WARNING "%s: detected chipset, but driver not compiled in!\n", dev->name);
d->init_hwif = NULL;
}
if (pci_enable_device(dev)) {
printk(KERN_WARNING "%s: Could not enable PCI device.\n", dev->name);
return;
......@@ -883,11 +877,11 @@ static void __init hpt366_device_order_fixup (struct pci_dev *dev, ide_pci_devic
* This finds all PCI IDE controllers and calls appropriate initialization
* functions for them.
*/
static void __init ide_scan_pcidev(struct pci_dev *dev)
static void __init scan_pcidev(struct pci_dev *dev)
{
unsigned short vendor;
unsigned short device;
ide_pci_device_t *d;
ide_pci_device_t *d;
vendor = dev->vendor;
device = dev->device;
......@@ -898,7 +892,7 @@ static void __init ide_scan_pcidev(struct pci_dev *dev)
while (d->vendor && !(d->vendor == vendor && d->device == device))
++d;
if (d->init_hwif == IDE_IGNORE)
if (d->init_hwif == ATA_PCI_IGNORE)
printk("%s: has been ignored by PCI bus scan\n", dev->name);
else if ((d->vendor == PCI_VENDOR_ID_OPTI && d->device == PCI_DEVICE_ID_OPTI_82C558) && !(PCI_FUNC(dev->devfn) & 1))
return;
......@@ -927,12 +921,10 @@ void __init ide_scan_pcibus (int scan_direction)
struct pci_dev *dev;
if (!scan_direction) {
pci_for_each_dev(dev) {
ide_scan_pcidev(dev);
}
pci_for_each_dev(dev)
scan_pcidev(dev);
} else {
pci_for_each_dev_reverse(dev) {
ide_scan_pcidev(dev);
}
pci_for_each_dev_reverse(dev)
scan_pcidev(dev);
}
}
......@@ -576,18 +576,19 @@ static void ide_init_queue(ide_drive_t *drive)
{
request_queue_t *q = &drive->queue;
int max_sectors;
#ifdef CONFIG_BLK_DEV_PDC4030
int is_pdc4030_chipset = (HWIF(drive)->chipset == ide_pdc4030);
#else
const int is_pdc4030_chipset = 0;
#endif
q->queuedata = HWGROUP(drive);
blk_init_queue(q, do_ide_request, &ide_lock);
blk_queue_segment_boundary(q, 0xffff);
/* IDE can do up to 128K per request, pdc4030 needs smaller limit */
max_sectors = (is_pdc4030_chipset ? 127 : 255);
#ifdef CONFIG_BLK_DEV_PDC4030
if (HWIF(drive)->chipset == ide_pdc4030)
max_sectors = 127;
else
#else
max_sectors = 255;
#endif
blk_queue_max_sectors(q, max_sectors);
/* IDE DMA can do PRD_ENTRIES number of segments. */
......
......@@ -445,7 +445,7 @@ static inline void set_recovery_timer (ide_hwif_t *hwif)
/*
* Do not even *think* about calling this!
*/
static void init_hwif_data (unsigned int index)
static void init_hwif_data(ide_hwif_t *hwif, int index)
{
static const byte ide_major[] = {
IDE0_MAJOR, IDE1_MAJOR, IDE2_MAJOR, IDE3_MAJOR, IDE4_MAJOR,
......@@ -454,7 +454,6 @@ static void init_hwif_data (unsigned int index)
unsigned int unit;
hw_regs_t hw;
ide_hwif_t *hwif = &ide_hwifs[index];
/* bulk initialize hwif & drive info with zeros */
memset(hwif, 0, sizeof(ide_hwif_t));
......@@ -507,7 +506,7 @@ static void init_hwif_data (unsigned int index)
#define MAGIC_COOKIE 0x12345678
static void __init init_ide_data (void)
{
unsigned int index;
unsigned int h;
static unsigned long magic_cookie = MAGIC_COOKIE;
if (magic_cookie != MAGIC_COOKIE)
......@@ -515,8 +514,8 @@ static void __init init_ide_data (void)
magic_cookie = 0;
/* Initialize all interface structures */
for (index = 0; index < MAX_HWIFS; ++index)
init_hwif_data(index);
for (h = 0; h < MAX_HWIFS; ++h)
init_hwif_data(&ide_hwifs[h], h);
/* Add default hw interfaces */
ide_init_default_hwifs();
......@@ -1629,7 +1628,7 @@ void ide_dma_timeout_retry(ide_drive_t *drive)
* But note that it can also be invoked as a result of a "sleep" operation
* triggered by the mod_timer() call in ide_do_request.
*/
void ide_timer_expiry (unsigned long data)
void ide_timer_expiry(unsigned long data)
{
ide_hwgroup_t *hwgroup = (ide_hwgroup_t *) data;
ide_handler_t *handler;
......@@ -1667,7 +1666,7 @@ void ide_timer_expiry (unsigned long data)
if ((expiry = hwgroup->expiry) != NULL) {
/* continue */
if ((wait = expiry(drive)) != 0) {
/* reset timer */
/* reengage timer */
hwgroup->timer.expires = jiffies + wait;
add_timer(&hwgroup->timer);
spin_unlock_irqrestore(&ide_lock, flags);
......@@ -1869,13 +1868,13 @@ void ide_intr (int irq, void *dev_id, struct pt_regs *regs)
*/
ide_drive_t *get_info_ptr (kdev_t i_rdev)
{
int major = major(i_rdev);
unsigned int h;
unsigned int major = major(i_rdev);
int h;
for (h = 0; h < MAX_HWIFS; ++h) {
ide_hwif_t *hwif = &ide_hwifs[h];
if (hwif->present && major == hwif->major) {
unsigned unit = DEVICE_NR(i_rdev);
int unit = DEVICE_NR(i_rdev);
if (unit < MAX_DRIVES) {
ide_drive_t *drive = &hwif->drives[unit];
if (drive->present)
......@@ -2012,13 +2011,13 @@ void revalidate_drives(void)
{
ide_hwif_t *hwif;
ide_drive_t *drive;
int index;
int unit;
int h;
for (index = 0; index < MAX_HWIFS; ++index) {
hwif = &ide_hwifs[index];
for (h = 0; h < MAX_HWIFS; ++h) {
int unit;
hwif = &ide_hwifs[h];
for (unit = 0; unit < MAX_DRIVES; ++unit) {
drive = &ide_hwifs[index].drives[unit];
drive = &ide_hwifs[h].drives[unit];
if (drive->revalidate) {
drive->revalidate = 0;
if (!initializing)
......@@ -2164,22 +2163,19 @@ static void hwif_unregister(ide_hwif_t *hwif)
#endif
}
void ide_unregister (unsigned int index)
void ide_unregister(ide_hwif_t *hwif)
{
struct gendisk *gd;
ide_drive_t *drive, *d;
ide_hwif_t *hwif, *g;
ide_hwif_t *g;
ide_hwgroup_t *hwgroup;
int irq_count = 0, unit, i;
unsigned long flags;
unsigned int p, minor;
ide_hwif_t old_hwif;
if (index >= MAX_HWIFS)
return;
save_flags(flags); /* all CPUs */
cli(); /* all CPUs */
hwif = &ide_hwifs[index];
if (!hwif->present)
goto abort;
put_device(&hwif->device);
......@@ -2202,7 +2198,7 @@ void ide_unregister (unsigned int index)
/*
* All clear? Then blow away the buffer cache
*/
sti();
spin_lock_irqsave(&ide_lock, flags);
for (unit = 0; unit < MAX_DRIVES; ++unit) {
drive = &hwif->drives[unit];
if (!drive->present)
......@@ -2214,11 +2210,13 @@ void ide_unregister (unsigned int index)
invalidate_device(devp, 0);
}
}
}
#ifdef CONFIG_PROC_FS
destroy_proc_ide_drives(hwif);
destroy_proc_ide_drives(hwif);
#endif
}
cli();
spin_unlock_irqrestore(&ide_lock, flags);
hwgroup = hwif->hwgroup;
/*
......@@ -2271,11 +2269,8 @@ void ide_unregister (unsigned int index)
hwgroup->hwif = HWIF(hwgroup->drive);
#if defined(CONFIG_BLK_DEV_IDEDMA) && !defined(CONFIG_DMA_NONPCI)
if (hwif->dma_base) {
(void) ide_release_dma(hwif);
hwif->dma_base = 0;
}
#endif /* (CONFIG_BLK_DEV_IDEDMA) && !(CONFIG_DMA_NONPCI) */
ide_release_dma(hwif);
#endif
/*
* Remove us from the kernel's knowledge
......@@ -2297,8 +2292,14 @@ void ide_unregister (unsigned int index)
kfree(gd);
hwif->gd = NULL;
}
/*
* Reinitialize the hwif handler, but preserve any special methods for
* it.
*/
old_hwif = *hwif;
init_hwif_data(index); /* restore hwif data to pristine status */
init_hwif_data(hwif, hwif->index);
hwif->hwgroup = old_hwif.hwgroup;
hwif->tuneproc = old_hwif.tuneproc;
hwif->speedproc = old_hwif.speedproc;
......@@ -2390,12 +2391,11 @@ int ide_register_hw(hw_regs_t *hw, ide_hwif_t **hwifp)
goto found;
}
for (index = 0; index < MAX_HWIFS; index++)
ide_unregister(index);
ide_unregister(&ide_hwifs[index]);
} while (retry--);
return -1;
found:
if (hwif->present)
ide_unregister(index);
ide_unregister(hwif);
if (hwif->present)
return -1;
memcpy(&hwif->hw, hw, sizeof(*hw));
......@@ -2756,21 +2756,6 @@ static int ide_ioctl (struct inode *inode, struct file *file,
return -EACCES;
return ide_task_ioctl(drive, inode, file, cmd, arg);
case HDIO_SCAN_HWIF:
{
int args[3];
if (!capable(CAP_SYS_ADMIN)) return -EACCES;
if (copy_from_user(args, (void *)arg, 3 * sizeof(int)))
return -EFAULT;
if (ide_register(args[0], args[1], args[2]) == -1)
return -EIO;
return 0;
}
case HDIO_UNREGISTER_HWIF:
if (!capable(CAP_SYS_ADMIN)) return -EACCES;
/* (arg > MAX_HWIFS) checked in function */
ide_unregister(arg);
return 0;
case HDIO_SET_NICE:
if (!capable(CAP_SYS_ADMIN)) return -EACCES;
if (arg != (arg & ((1 << IDE_NICE_DSC_OVERLAP) | (1 << IDE_NICE_1))))
......@@ -3479,6 +3464,7 @@ struct block_device_operations ide_fops[] = {{
revalidate: ide_revalidate_disk
}};
EXPORT_SYMBOL(ide_fops);
EXPORT_SYMBOL(ide_hwifs);
EXPORT_SYMBOL(ide_spin_wait_hwgroup);
EXPORT_SYMBOL(revalidate_drives);
......@@ -3490,7 +3476,6 @@ devfs_handle_t ide_devfs_handle;
EXPORT_SYMBOL(ide_lock);
EXPORT_SYMBOL(drive_is_flashcard);
EXPORT_SYMBOL(ide_timer_expiry);
EXPORT_SYMBOL(ide_intr);
EXPORT_SYMBOL(ide_get_queue);
EXPORT_SYMBOL(ide_add_generic_settings);
......@@ -3584,7 +3569,7 @@ static struct notifier_block ide_notifier = {
*/
static int __init ata_module_init(void)
{
int i;
int h;
printk(KERN_INFO "Uniform Multi-Platform E-IDE driver ver.:" VERSION "\n");
......@@ -3714,8 +3699,8 @@ static int __init ata_module_init(void)
initializing = 0;
for (i = 0; i < MAX_HWIFS; ++i) {
ide_hwif_t *hwif = &ide_hwifs[i];
for (h = 0; h < MAX_HWIFS; ++h) {
ide_hwif_t *hwif = &ide_hwifs[h];
if (hwif->present)
ide_geninit(hwif);
}
......@@ -3750,21 +3735,17 @@ static int __init init_ata (void)
static void __exit cleanup_ata (void)
{
int index;
int h;
unregister_reboot_notifier(&ide_notifier);
for (index = 0; index < MAX_HWIFS; ++index) {
ide_unregister(index);
# if defined(CONFIG_BLK_DEV_IDEDMA) && !defined(CONFIG_DMA_NONPCI)
if (ide_hwifs[index].dma_base)
ide_release_dma(&ide_hwifs[index]);
# endif /* (CONFIG_BLK_DEV_IDEDMA) && !(CONFIG_DMA_NONPCI) */
for (h = 0; h < MAX_HWIFS; ++h) {
ide_unregister(&ide_hwifs[h]);
}
# ifdef CONFIG_PROC_FS
proc_ide_destroy();
# endif
devfs_unregister (ide_devfs_handle);
devfs_unregister(ide_devfs_handle);
}
module_init(init_ata);
......
This diff is collapsed.
......@@ -368,9 +368,7 @@ struct hd_big_geometry {
#define HDIO_SET_NOWERR 0x0325 /* change ignore-write-error flag */
#define HDIO_SET_DMA 0x0326 /* change use-dma flag */
#define HDIO_SET_PIO_MODE 0x0327 /* reconfig interface to new speed */
#define HDIO_SCAN_HWIF 0x0328 /* register and (re)scan interface */
#define HDIO_SET_NICE 0x0329 /* set nice flags */
#define HDIO_UNREGISTER_HWIF 0x032a /* unregister interface */
#define HDIO_SET_WCACHE 0x032b /* change write cache enable-disable */
#define HDIO_SET_ACOUSTIC 0x032c /* change acoustic behavior */
#define HDIO_SET_BUSSTATE 0x032d /* set the bus state of the hwif */
......@@ -645,17 +643,4 @@ struct hd_driveid {
#define IDE_NICE_1 (3) /* when probably won't affect us much */
#define IDE_NICE_2 (4) /* when we know it's on our expense */
#ifdef __KERNEL__
/*
* These routines are used for kernel command line parameters from main.c:
*/
#include <linux/config.h>
#if defined(CONFIG_BLK_DEV_IDE) || defined(CONFIG_BLK_DEV_IDE_MODULE)
int ide_register(int io_port, int ctl_port, int irq);
void ide_unregister(unsigned int);
#endif /* CONFIG_BLK_DEV_IDE || CONFIG_BLK_DEV_IDE_MODULE */
#endif /* __KERNEL__ */
#endif /* _LINUX_HDREG_H */
......@@ -242,8 +242,7 @@ typedef struct hw_regs_s {
/*
* Register new hardware with ide
*/
int ide_register_hw(hw_regs_t *hw, struct hwif_s **hwifp);
extern int ide_register_hw(hw_regs_t *hw, struct hwif_s **hwifp);
/*
* Set up hw_regs_t structure before calling ide_register_hw (optional)
*/
......@@ -506,6 +505,8 @@ typedef struct hwif_s {
struct device device; /* global device tree handle */
} ide_hwif_t;
extern void ide_unregister(ide_hwif_t *hwif);
/*
* Status returned from various ide_ functions
*/
......
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