diff options
| author | Martin Dalecki <dalecki@evision-ventures.com> | 2002-07-18 19:26:04 -0700 |
|---|---|---|
| committer | Trond Myklebust <trond.myklebust@fys.uio.no> | 2002-07-18 19:26:04 -0700 |
| commit | e9356da889878f12ef8be47d291e78affbc71750 (patch) | |
| tree | 6535d1b0ce28ecf590a9c8e8090719f0585b90b6 /include/linux | |
| parent | 3ec593609c703bd8242dfde60bdb821bef5c1ff6 (diff) | |
[PATCH] 2.5.26 IDE 99
Most noticable in the patch:
1. we handle IRQ sharing now better then ever
2. survives quite a lot of testing by few people. Forexample
cat /dev/hdb > /dev/null, where /dev/hdb contains a CD-ROM
with a big cratch on the surface making sure it's broken :-).
it's BTW. amanzing how wide the cratch had to be until errors
ocurred.
3. Doesn't play with rq_rdev and friends
Fri Jul 12 05:04:32 CEST 2002 ide-clean-99
- Push nIEN disabling down at the place where we are finished with a particular
request.
- First round of command line parser cleanups by Gerald Champagne.
- Unfold the drive eviction functions in do_request(). This allowed us to
realize that we don't have to re-get the major/minor numbers of the device we
are action on from the raw device field of the currently running request. One
significant place less in kernel where major/minor data gets manipulated.
- Move the big IDE_BUSY loop out of do_request to do_ide_request(). This makes
us realize that we don't have to clear the IDE_BUSY bit just before
reentering do_request to look for more requests still pending on the queue
and set it immediately again.
This is fixing a tinny race on the code path from IRQ or timer function,
where we had a tinny window between the clearing of the IDE_BUSY bit and
reentering the request queue for completely unrelated requests to come in to
our way.
- Don't return any value in do_reset1(). It's always ATA_OP_CONTINUES. Split it
up in to two functions one for disks (well in fact channels) and one for
ATAPI devices. It turns out that they can be moved to the places where they
are used to clarify the code flow. The only function remaining is
do_reset_channel() now.
- Duplicate code from ide_do_drive_code explicitely in ide_raw_taskfile().
Simplify ide_raw_taskfile() thereafter. Realize that ide_do_drive_cmd()
is now only used by ATAPI devices. Move it therefore to atapi.c.
- Do busy polling for ATAPI reset operations. This is much safer then the
previous timer games played there. It simply doesn't make sense to give the
bus up during such a subtile operation. We don't have to disable IRQs here as
well, since we are already under the protection of the do_request mechanisms.
(Well hopefully...)
- Remove no longer used reset_poll() function. poll_timeout and friends are now
used only in pdc4030 code. Those function where not called from IRQ context
but they where set as handlers and not as expiry functions.
- Return ATA_OP_CONTINUES instead of ATA_OP_FINISHED in ata_error(), to signal
that we are willing to retry the operation until the maximal number of retry
attempts is exceeded. Returning ATA_OP_FINISHED without prior end_request()
hangs the system.
- Apply trivia from DJ patch set.
- Apply small configuration fix to ide-pci.c from Muli Ben-Yehuda.
- Feed add_blkdev_randomness with information we already have in struct
ata_channel *ch->major, instead of using the major(macro) on the request in
question.
- Make ide_raw_taskfile use the same request submission mechanism as
tcq_invalidate_queue(). Something similar would be ideal for ioctl() code as
well.
- Implement actual device reset. Realize that the recalibration procedure is
doomed by the standard. Don't try to recover by recalibrating devices
therefore -just our retry mechanism should work in those cases. And suddenly
the error handling code is IRQ safe.
- Reinvent the ATA reset operation, since it is apparently needed. We still
have to do the whole transfer timing reconfiguration there.
- Move drive_is_ready(), which is in reality an attempt to check for IRQ
requesters without clearing the IRQ line, over to the place where it belongs:
device.c, which is the direct device access abstraction place. Rename it to
ata_status_irq() to prevent global name space pollution.
- Updates to the pdc202xxx host chip controller setup code by Bart³omiej
¯o³nierkiewicz:
Forward port 2.4 patch by Hank Yang from Promise:
- Add PDC20271 support
- Disable LBA48 support on PDC20262
- Fix ATAPI UDMA port value
- Add new quirk drive
- Adjust timings for all drives when using ATA133
- Update pdc202xx_reset() waiting time
- Mark TCQ as dangerous and add some bits about it to the help.
- Add some missing exports.
- Some small ide-scsi.c host allocation fixes by sullivan.
Diffstat (limited to 'include/linux')
| -rw-r--r-- | include/linux/atapi.h | 26 | ||||
| -rw-r--r-- | include/linux/ide.h | 62 | ||||
| -rw-r--r-- | include/linux/pci_ids.h | 1 |
3 files changed, 41 insertions, 48 deletions
diff --git a/include/linux/atapi.h b/include/linux/atapi.h index 0ac305922e3a..806aa4e49146 100644 --- a/include/linux/atapi.h +++ b/include/linux/atapi.h @@ -74,15 +74,6 @@ struct atapi_packet_command { } s; }; -extern void atapi_init_pc(struct atapi_packet_command *pc); - -extern void atapi_discard_data(struct ata_device *, unsigned int); -extern void atapi_write_zeros(struct ata_device *, unsigned int); - -extern void atapi_read(struct ata_device *, u8 *, unsigned int); -extern void atapi_write(struct ata_device *, u8 *, unsigned int); - - /* * ATAPI Status Register. */ @@ -360,3 +351,20 @@ typedef struct atapi_request_sense { u8 sk_specific[2]; /* Sense Key Specific */ u8 pad[2]; /* Padding to 20 bytes */ } atapi_request_sense_result_t; + + +extern void atapi_init_pc(struct atapi_packet_command *pc); + +extern void atapi_discard_data(struct ata_device *, unsigned int); +extern void atapi_write_zeros(struct ata_device *, unsigned int); + +extern void atapi_read(struct ata_device *, u8 *, unsigned int); +extern void atapi_write(struct ata_device *, u8 *, unsigned int); + +typedef enum { + ide_wait, /* insert rq at end of list, and wait for it */ + ide_preempt, /* insert rq in front of current request */ + ide_end /* insert rq at end of list, but don't wait for it */ +} ide_action_t; + +extern int ide_do_drive_cmd(struct ata_device *, struct request *, ide_action_t); diff --git a/include/linux/ide.h b/include/linux/ide.h index 4076310675f8..7b9c5cce01cf 100644 --- a/include/linux/ide.h +++ b/include/linux/ide.h @@ -1,5 +1,6 @@ #ifndef _IDE_H #define _IDE_H + /* * Copyright (C) 1994-2002 Linus Torvalds & authors */ @@ -57,15 +58,14 @@ typedef unsigned char byte; /* used everywhere */ */ #define ERROR_MAX 8 /* Max read/write errors per sector */ #define ERROR_RESET 3 /* Reset controller every 4th retry */ -#define ERROR_RECAL 1 /* Recalibrate every 2nd retry */ /* - * state flags + * State flags. */ #define DMA_PIO_RETRY 1 /* retrying in PIO */ /* - * Definitions for accessing IDE controller registers + * Definitions for accessing IDE controller registers. */ enum { @@ -192,23 +192,21 @@ typedef enum { * Structure to hold all information about the location of this port */ typedef struct hw_regs_s { - ide_ioreg_t io_ports[IDE_NR_PORTS]; /* task file registers */ - int irq; /* our irq number */ - int dma; /* our dma entry */ - ide_ack_intr_t *ack_intr; /* acknowledge interrupt */ + ide_ioreg_t io_ports[IDE_NR_PORTS]; /* task file registers */ + int irq; /* our irq number */ + int dma; /* our dma entry */ + int (*ack_intr)(struct ata_channel *); /* acknowledge interrupt */ hwif_chipset_t chipset; } hw_regs_t; /* * Set up hw_regs_t structure before calling ide_register_hw (optional) */ -void ide_setup_ports(hw_regs_t *hw, - ide_ioreg_t base, - int *offsets, - ide_ioreg_t ctrl, - ide_ioreg_t intr, - ide_ack_intr_t *ack_intr, - int irq); +extern void ide_setup_ports(hw_regs_t *hw, + ide_ioreg_t base, int *offsets, + ide_ioreg_t ctrl, ide_ioreg_t intr, + int (*ack_intr)(struct ata_channel *), + int irq); #include <asm/ide.h> @@ -282,14 +280,10 @@ struct ata_device { unsigned int usage; /* current "open()" count for drive */ char type; /* distingiush different devices: disk, cdrom, tape, floppy, ... */ - /* NOTE: If we had proper separation between channel and host chip, we - * could move this to the channel and many sync problems would - * magically just go away. - */ - request_queue_t queue; /* per device request queue */ + request_queue_t queue; /* per device request queue */ struct request *rq; /* current request */ - unsigned long sleep; /* sleep until this time */ + unsigned long sleep; /* sleep until this time */ byte retry_pio; /* retrying dma capable host in pio */ byte state; /* retry state */ @@ -341,6 +335,7 @@ struct ata_device { void *driver_data; /* extra driver data */ devfs_handle_t de; /* directory for device */ + char driver_req[10]; /* requests specific driver */ int last_lun; /* last logical unit */ @@ -392,6 +387,7 @@ enum { enum { IDE_BUSY, /* awaiting an interrupt */ IDE_SLEEP, + IDE_PIO, /* PIO in progress */ IDE_DMA /* DMA in progress */ }; @@ -404,11 +400,15 @@ struct ata_channel { */ spinlock_t *lock; unsigned long *active; /* active processing request */ - ide_startstop_t (*handler)(struct ata_device *, struct request *); /* irq handler, if active */ + + /* FIXME: Only still used in PDC4030. Localize this code there by + * replacing with busy waits. + */ struct timer_list timer; /* failsafe timer */ ide_startstop_t (*expiry)(struct ata_device *, struct request *, unsigned long *); /* irq handler, if active */ unsigned long poll_timeout; /* timeout value during polled operations */ + struct ata_device *drive; /* last serviced drive */ @@ -508,8 +508,6 @@ struct ata_channel { extern int ide_register_hw(hw_regs_t *hw); extern void ide_unregister(struct ata_channel *); -struct ata_taskfile; - #define IDE_MAX_TAG 32 #ifdef CONFIG_BLK_DEV_IDE_TCQ @@ -605,8 +603,7 @@ extern int noautodma; #define DEVICE_NR(device) (minor(device) >> PARTN_BITS) #include <linux/blk.h> -extern int __ata_end_request(struct ata_device *, struct request *, int, unsigned int); - +extern int ata_end_request(struct ata_device *, struct request *, int, unsigned int); extern void ata_set_handler(struct ata_device *drive, ata_handler_t handler, unsigned long timeout, ata_expiry_t expiry); @@ -627,21 +624,10 @@ int ide_xlate_1024(kdev_t, int, int, const char *); struct ata_device *get_info_ptr(kdev_t i_rdev); /* - * "action" parameter type for ide_do_drive_cmd() below. - */ -typedef enum { - ide_wait, /* insert rq at end of list, and wait for it */ - ide_preempt, /* insert rq in front of current request */ - ide_end /* insert rq at end of list, but don't wait for it */ -} ide_action_t; - -/* * temporarily mapping a (possible) highmem bio for PIO transfer */ #define ide_rq_offset(rq) (((rq)->hard_cur_sectors - (rq)->current_nr_sectors) << 9) -extern int ide_do_drive_cmd(struct ata_device *, struct request *, ide_action_t); - struct ata_taskfile { struct hd_drive_task_hdr taskfile; struct hd_drive_task_hdr hobfile; @@ -654,7 +640,6 @@ extern void ata_read(struct ata_device *, void *, unsigned int); extern void ata_write(struct ata_device *, void *, unsigned int); extern int ide_raw_taskfile(struct ata_device *, struct ata_taskfile *, char *); -extern void ide_fix_driveid(struct hd_driveid *id); extern int ide_config_drive_speed(struct ata_device *, byte); extern byte eighty_ninty_three(struct ata_device *); @@ -803,13 +788,12 @@ extern spinlock_t ide_lock; #define DRIVE_LOCK(drive) ((drive)->queue.queue_lock) -extern int drive_is_ready(struct ata_device *drive); - /* Low level device access functions. */ extern void ata_select(struct ata_device *, unsigned long); extern void ata_mask(struct ata_device *); extern int ata_status(struct ata_device *, u8, u8); +extern int ata_status_irq(struct ata_device *drive); extern int ata_status_poll( struct ata_device *, u8, u8, unsigned long, struct request *rq); diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h index 6758bf742e0c..c1f391bf8f62 100644 --- a/include/linux/pci_ids.h +++ b/include/linux/pci_ids.h @@ -610,6 +610,7 @@ #define PCI_DEVICE_ID_PROMISE_20268 0x4d68 #define PCI_DEVICE_ID_PROMISE_20268R 0x6268 #define PCI_DEVICE_ID_PROMISE_20269 0x4d69 +#define PCI_DEVICE_ID_PROMISE_20271 0x6269 #define PCI_DEVICE_ID_PROMISE_20275 0x1275 #define PCI_DEVICE_ID_PROMISE_20276 0x5275 #define PCI_DEVICE_ID_PROMISE_5300 0x5300 |
