* Re: Linux v2.5.29
2002-07-27 3:12 Linux v2.5.29 Linus Torvalds
@ 2002-07-27 3:23 ` Linus Torvalds
2002-07-27 6:26 ` Rusty Russell
` (4 subsequent siblings)
5 siblings, 0 replies; 12+ messages in thread
From: Linus Torvalds @ 2002-07-27 3:23 UTC (permalink / raw)
To: Kernel Mailing List
I forgot to mention.. You have all been busy little critters, and I
probably missed a number of merges. Give me a day to catch my breath (and
take the kids to the aquarium), and if you think I overlooked or forgot
your patch, you should probably re-send.
Linus
^ permalink raw reply [flat|nested] 12+ messages in thread* Re: Linux v2.5.29
2002-07-27 3:12 Linux v2.5.29 Linus Torvalds
2002-07-27 3:23 ` Linus Torvalds
@ 2002-07-27 6:26 ` Rusty Russell
2002-07-27 9:06 ` 2.5.29: oops on boot Ville Herva
` (3 subsequent siblings)
5 siblings, 0 replies; 12+ messages in thread
From: Rusty Russell @ 2002-07-27 6:26 UTC (permalink / raw)
To: Linus Torvalds; +Cc: linux-kernel
On Fri, 26 Jul 2002 20:12:00 -0700 (PDT)
Linus Torvalds <torvalds@transmeta.com> wrote:
>
> Hmm.. All over the map. IDE patches as usual, USB updates, tons of C99
> named initializers work, ACPI update, fixes from Alan, driverfs race fixes
> and cleanups, SCSI driver fixes from Doug and tons of input layer updates.
>
> Oh, and a new LDM driver, Rusty's CPU hotplug infrastructure
Badly broken on SMP by Linus.
You'll only get one migration thread, and one ksoftirqd.
Issue is that some initcalls (softirq.c and sched.c) are way easier before
other CPUs are brought up, but doing it the other way broke AGP and Linus
decided to call all the initcalls after CPUs are brought up in case someone
else needed it (I still strongly disagree).
This hack fixes it: real fix is the explicit initcall ordering patch,
which Linus hasn't commented on 8(
Name: Hot-plug CPU Boot ksoftirqd and migration fix
Author: Rusty Russell
Status: Tested on 2.5.29, x86 SMP
D: This patch fixes the calls to initialize ksoftirqd and the
D: migration threads. This really should be done by the initcall
D: depends patch.
diff -urNp -I \$.*\$ --exclude TAGS -X /home/rusty/current-dontdiff --minimal linux-2.5.29/init/main.c working-2.5.29/init/main.c
--- linux-2.5.29/init/main.c Sat Jul 27 15:24:39 2002
+++ working-2.5.29/init/main.c Sat Jul 27 16:09:42 2002
@@ -524,6 +524,15 @@ static void __init do_basic_setup(void)
do_initcalls();
}
+static void do_pre_smp_initcalls(void)
+{
+ extern int migration_init(void);
+ extern int spawn_ksoftirqd(void);
+
+ migration_init();
+ spawn_ksoftirqd();
+}
+
extern void prepare_namespace(void);
static int init(void * unused)
@@ -533,6 +542,9 @@ static int init(void * unused)
lock_kernel();
/* Sets up cpus_possible() */
smp_prepare_cpus(max_cpus);
+
+ do_pre_smp_initcalls();
+
smp_init();
do_basic_setup();
diff -urNp -I \$.*\$ --exclude TAGS -X /home/rusty/current-dontdiff --minimal linux-2.5.29/kernel/sched.c working-2.5.29/kernel/sched.c
--- linux-2.5.29/kernel/sched.c Sat Jul 27 15:24:39 2002
+++ working-2.5.29/kernel/sched.c Sat Jul 27 16:21:58 2002
@@ -1894,6 +1894,8 @@ static int migration_call(struct notifie
(long)hcpu);
kernel_thread(migration_thread, hcpu,
CLONE_FS | CLONE_FILES | CLONE_SIGNAL);
+ while (!cpu_rq((long)hcpu)->migration_thread)
+ yield();
break;
}
return NOTIFY_OK;
@@ -1901,7 +1903,7 @@ static int migration_call(struct notifie
static struct notifier_block migration_notifier = { &migration_call, NULL, 0 };
-int __init migration_init(void)
+__init int migration_init(void)
{
/* Start one for boot CPU. */
migration_call(&migration_notifier, CPU_ONLINE,
@@ -1910,7 +1912,6 @@ int __init migration_init(void)
return 0;
}
-__initcall(migration_init);
#endif
extern void init_timervecs(void);
diff -urNp -I \$.*\$ --exclude TAGS -X /home/rusty/current-dontdiff --minimal linux-2.5.29/kernel/softirq.c working-2.5.29/kernel/softirq.c
--- linux-2.5.29/kernel/softirq.c Sat Jul 27 15:24:39 2002
+++ working-2.5.29/kernel/softirq.c Sat Jul 27 16:07:53 2002
@@ -410,11 +410,9 @@ static int __devinit cpu_callback(struct
static struct notifier_block cpu_nfb = { &cpu_callback, NULL, 0 };
-static __init int spawn_ksoftirqd(void)
+__init int spawn_ksoftirqd(void)
{
cpu_callback(&cpu_nfb, CPU_ONLINE, (void *)smp_processor_id());
register_cpu_notifier(&cpu_nfb);
return 0;
}
-
-__initcall(spawn_ksoftirqd);
--
there are those who do and those who hang on and you don't see too
many doers quoting their contemporaries. -- Larry McVoy
^ permalink raw reply [flat|nested] 12+ messages in thread* 2.5.29: oops on boot
2002-07-27 3:12 Linux v2.5.29 Linus Torvalds
2002-07-27 3:23 ` Linus Torvalds
2002-07-27 6:26 ` Rusty Russell
@ 2002-07-27 9:06 ` Ville Herva
2002-07-27 9:33 ` Ville Herva
2002-07-27 11:40 ` Linux v2.5.29 Peter Osterlund
` (2 subsequent siblings)
5 siblings, 1 reply; 12+ messages in thread
From: Ville Herva @ 2002-07-27 9:06 UTC (permalink / raw)
To: linux-kernel
2.5.27 and 2.5.28 wouldn't boot at all (they hung at ide probe). 2.5.29
boots, but oopses after freeing unused memory.
Again, root = hdc = cdrom with ext2 fs on it.
HW is vmware, which may be the cause of the problem (but frankly I don't
dare to run 2.5 on real hw at this point :).
<...>
NET4: Linux TCP/IP 1.0 for NET4.0
IP Protocols: ICMP, UDP, TCP, IGMP
IP: routing cache hash table of 512 buckets, 4Kbytes
TCP: Hash tables configured (established 4096 bind 8192)
NET4: Unix domain sockets 1.0/SMP for Linux NET4.0.
ds: no socket drivers loaded!
VFS: Mounted root (ext2 filesystem) readonly.
Freeing unused kernel memory: 216k freed
Unable to handle kernel paging request at virtual address 645f00ad
c013f646
*pde = 00000000
Oops: 0000
CPU: 0
EIP: 0010:[<c013f646>] Not tainted
Using defaults from ksymoops -t elf32-i386 -a i386
EFLAGS: 00000246
eax: 00000000 ebx: c109d138 ecx: c109d138 edx: c109d138
esi: 00000000 edi: 645f0065 ebp: c10cda68 esp: c10cda0c
ds: 0018 es: 0018 ss: 0018
Stack: 00000002 00000060 fffffff5 00000000 c3ee1090 000224b3 00000000 00000000
000001d0 c10cda50 00112538 645f0065 c11e2620 0000000c c10cda54 c01a68ce
0000000c 00000000 c10cda68 c015923c c109d138 00000000 0000000c c10cdaf8
Call Trace: [<c01a68ce>] [<c015923c>] [<c0159512>] [<c0168c10>] [<c017a136>]
[<c017a16f>] [<c012a457>] [<c0159675>] [<c0168c10>] [<c0168e57>] [<c0168c10>]
[<c0138d26>] [<c0138e06>] [<c0138ecc>] [<c012ab54>] [<c012adb0>] [<c012afa8>]
[<c012adb0>] [<c0144db1>] [<c0144e36>] [<c015bda7>] [<c0107afb>] [<c0138ecc>]
[<c012ac98>] [<c0131ba1>] [<c015b1c0>] [<c0145624>] [<c01459ae>] [<c0107c1d>]
[<c01094df>] [<c0105147>] [<c0105000>] [<c01076be>] [<c0105060>]
Code: 8b 5f 48 c7 45 c4 01 00 00 00 8b 7d 08 88 d9 d3 65 c4 8b 47
>>EIP; c013f646 <block_read_full_page+36/2b0> <=====
Trace; c01a68ce <submit_bio+3e/80>
Trace; c015923c <mpage_bio_submit+3c/50>
Trace; c0159512 <do_mpage_readpage+222/2c0>
Trace; c0168c10 <ext2_get_block+0/1e0>
Trace; c017a136 <radix_tree_reserve+e6/100>
Trace; c017a16f <radix_tree_insert+1f/40>
Trace; c012a457 <add_to_page_cache+c7/f0>
Trace; c0159675 <mpage_readpages+c5/d0>
Trace; c0168c10 <ext2_get_block+0/1e0>
Trace; c0168e57 <ext2_readpages+27/30>
Trace; c0168c10 <ext2_get_block+0/1e0>
Trace; c0138d26 <read_pages+96/a0>
Trace; c0138e06 <do_page_cache_readahead+d6/130>
Trace; c0138ecc <page_cache_readahead+6c/180>
Trace; c012ab54 <do_generic_file_read+84/2e0>
Trace; c012adb0 <file_read_actor+0/a0>
Trace; c012afa8 <generic_file_read+158/180>
Trace; c012adb0 <file_read_actor+0/a0>
Trace; c0144db1 <open_exec+c1/e0>
Trace; c0144e36 <kernel_read+66/70>
Trace; c015bda7 <load_elf_binary+be7/c50>
Trace; c0107afb <__switch_to+10b/110>
Trace; c0138ecc <page_cache_readahead+6c/180>
Trace; c012ac98 <do_generic_file_read+1c8/2e0>
Trace; c0131ba1 <rmqueue+2b1/2f0>
Trace; c015b1c0 <load_elf_binary+0/c50>
Trace; c0145624 <search_binary_handler+94/210>
Trace; c01459ae <do_execve+20e/230>
Trace; c0107c1d <sys_execve+4d/80>
Trace; c01094df <syscall_call+7/b>
Trace; c0105147 <init+e7/1a0>
Trace; c0105000 <_stext+0/0>
Trace; c01076be <kernel_thread+2e/40>
Trace; c0105060 <init+0/1a0>
Code; c013f646 <block_read_full_page+36/2b0>
00000000 <_EIP>:
Code; c013f646 <block_read_full_page+36/2b0> <=====
0: 8b 5f 48 mov 0x48(%edi),%ebx <=====
Code; c013f649 <block_read_full_page+39/2b0>
3: c7 45 c4 01 00 00 00 movl $0x1,0xffffffc4(%ebp)
Code; c013f650 <block_read_full_page+40/2b0>
a: 8b 7d 08 mov 0x8(%ebp),%edi
Code; c013f653 <block_read_full_page+43/2b0>
d: 88 d9 mov %bl,%cl
Code; c013f655 <block_read_full_page+45/2b0>
f: d3 65 c4 shll %cl,0xffffffc4(%ebp)
Code; c013f658 <block_read_full_page+48/2b0>
12: 8b 47 00 mov 0x0(%edi),%eax
<0>Kernel panic: Attempted to kill init!
-- v --
v@iki.fi
^ permalink raw reply [flat|nested] 12+ messages in thread* Re: 2.5.29: oops on boot
2002-07-27 9:06 ` 2.5.29: oops on boot Ville Herva
@ 2002-07-27 9:33 ` Ville Herva
0 siblings, 0 replies; 12+ messages in thread
From: Ville Herva @ 2002-07-27 9:33 UTC (permalink / raw)
To: linux-kernel
On Sat, Jul 27, 2002 at 12:06:26PM +0300, you [Ville Herva] wrote:
> 2.5.27 and 2.5.28 wouldn't boot at all (they hung at ide probe). 2.5.29
> boots, but oopses after freeing unused memory.
>
> Again, root = hdc = cdrom with ext2 fs on it.
>
> HW is vmware, which may be the cause of the problem (but frankly I don't
> dare to run 2.5 on real hw at this point :).
>
>
> <...>
> NET4: Linux TCP/IP 1.0 for NET4.0
> IP Protocols: ICMP, UDP, TCP, IGMP
> IP: routing cache hash table of 512 buckets, 4Kbytes
> TCP: Hash tables configured (established 4096 bind 8192)
> NET4: Unix domain sockets 1.0/SMP for Linux NET4.0.
> ds: no socket drivers loaded!
> VFS: Mounted root (ext2 filesystem) readonly.
> Freeing unused kernel memory: 216k freed
> Unable to handle kernel paging request at virtual address 645f00ad
> c013f646
> *pde = 00000000
That was with gcc (GCC) 3.1 20020620. With 2.96.110, I get this:
<...>
TCP: Hash tables configured (established 4096 bind 8192)
NET4: Unix domain sockets 1.0/SMP for Linux NET4.0.
ds: no socket drivers loaded!
VFS: Mounted root (ext2 filesystem) readonly.
Freeing unused kernel memory: 216k freed
Unable to handle kernel paging request at virtual address 645f00ad
c013f646
*pde = 00000000
Oops: 0000
CPU: 0
EIP: 0010:[<c013f646>] Not tainted
Using defaults from ksymoops -t elf32-i386 -a i386
EFLAGS: 00000246
eax: 00000000 ebx: c109d138 ecx: c109d138 edx: c109d138
esi: 00000000 edi: 645f0065 ebp: c10cda68 esp: c10cda0c
ds: 0018 es: 0018 ss: 0018
Stack: 00000002 00000060 fffffff5 00000000 c3ee1090 000224b3 00000000 00000000
000001d0 c10cda50 00112538 645f0065 c11e2620 0000000c c10cda54 c01a68ce
0000000c 00000000 c10cda68 c015923c c109d138 00000000 0000000c c10cdaf8
Call Trace: [<c01a68ce>] [<c015923c>] [<c0159512>] [<c0168c10>] [<c017a136>]
[<c017a16f>] [<c012a457>] [<c0159675>] [<c0168c10>] [<c0168e57>] [<c0168c10>]
[<c0138d26>] [<c0138e06>] [<c0138ecc>] [<c012ab54>] [<c012adb0>] [<c012afa8>]
[<c012adb0>] [<c0144db1>] [<c0144e36>] [<c015bda7>] [<c0107afb>] [<c0138ecc>]
[<c012ac98>] [<c0131ba1>] [<c015b1c0>] [<c0145624>] [<c01459ae>] [<c0107c1d>]
[<c01094df>] [<c0105147>] [<c0105000>] [<c01076be>] [<c0105060>]
Code: 8b 5f 48 c7 45 c4 01 00 00 00 8b 7d 08 88 d9 d3 65 c4 8b 47
>>EIP; c013f646 <real_lookup+56/d0> <=====
Trace; c01a68ce <ray_interrupt+de/280>
Trace; c015923c <msdos_partition+1dc/320>
Trace; c0159512 <driverfs_get_inode+72/f0>
Trace; c0168c10 <shm_close+60/e0>
Trace; c017a136 <uart_line_info+6/340>
Trace; c017a16f <uart_line_info+3f/340>
Trace; c012a457 <__kmem_cache_shrink+27/b0>
Trace; c0159675 <driverfs_symlink+15/b0>
Trace; c0168c10 <shm_close+60/e0>
Trace; c0168e57 <newseg+117/170>
Trace; c0168c10 <shm_close+60/e0>
Trace; c0138d26 <__block_commit_write+66/b0>
Trace; c0138e06 <block_read_full_page+96/270>
Trace; c0138ecc <block_read_full_page+15c/270>
Trace; c012ab54 <kfree+44/c0>
Trace; c012adb0 <kmem_cache_reap+1a0/230>
Trace; c012afa8 <s_show+a8/1e0>
Trace; c012adb0 <kmem_cache_reap+1a0/230>
Trace; c0144db1 <fifo_open+1d1/2bd>
Trace; c0144e36 <fifo_open+256/2bd>
Trace; c015bda7 <ext2_set_link+57/e0>
Trace; c0107afb <__down_trylock+3b/50>
Trace; c0138ecc <block_read_full_page+15c/270>
Trace; c012ac98 <kmem_cache_reap+88/230>
Trace; c0131ba1 <bounce_end_io_write+61/90>
Trace; c015b1c0 <ext2_new_block+4f0/740>
Trace; c0145624 <locks_delete_lock+94/d0>
Trace; c01459ae <locks_mandatory_locked+1e/80>
Trace; c0107c1d <sys_sigsuspend+dd/e0>
Trace; c01094df <do_device_not_available+f/80>
Trace; c0105147 <init+f7/190>
Trace; c0105000 <_stext+0/0>
Trace; c01076be <get_wchan+1e/70>
Trace; c0105060 <init+10/190>
Code; c013f646 <real_lookup+56/d0>
00000000 <_EIP>:
Code; c013f646 <real_lookup+56/d0> <=====
0: 8b 5f 48 mov 0x48(%edi),%ebx <=====
Code; c013f649 <real_lookup+59/d0>
3: c7 45 c4 01 00 00 00 movl $0x1,0xffffffc4(%ebp)
Code; c013f650 <real_lookup+60/d0>
a: 8b 7d 08 mov 0x8(%ebp),%edi
Code; c013f653 <real_lookup+63/d0>
d: 88 d9 mov %bl,%cl
Code; c013f655 <real_lookup+65/d0>
f: d3 65 c4 shll %cl,0xffffffc4(%ebp)
Code; c013f658 <real_lookup+68/d0>
12: 8b 47 00 mov 0x0(%edi),%eax
<0>Kernel panic: Attempted to kill init!
-- v --
v@iki.fi
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: Linux v2.5.29
2002-07-27 3:12 Linux v2.5.29 Linus Torvalds
` (2 preceding siblings ...)
2002-07-27 9:06 ` 2.5.29: oops on boot Ville Herva
@ 2002-07-27 11:40 ` Peter Osterlund
2002-07-29 19:27 ` [PATCH] 2.5.29 IDE 108 Marcin Dalecki
2002-07-29 20:51 ` [PATCH] 2.5.29 IDE 109 Marcin Dalecki
5 siblings, 0 replies; 12+ messages in thread
From: Peter Osterlund @ 2002-07-27 11:40 UTC (permalink / raw)
To: Linus Torvalds; +Cc: Kernel Mailing List, ldm
Linus Torvalds <torvalds@transmeta.com> writes:
> <ldm@flatcap.org>:
> o New LDM Driver (Windows Dynamic Disks)
Breaks "make xconfig". Here is a patch to fix it:
--- linux/fs/partitions/Config.in.orig Sat Jul 27 13:31:54 2002
+++ linux/fs/partitions/Config.in Sat Jul 27 13:16:15 2002
@@ -25,7 +25,7 @@
bool ' Solaris (x86) partition table support' CONFIG_SOLARIS_X86_PARTITION
bool ' Unixware slices support' CONFIG_UNIXWARE_DISKLABEL
fi
- dep_bool ' Windows Logical Disk Manager (Dynamic Disk) support' CONFIG_LDM_PARTITION
+ bool ' Windows Logical Disk Manager (Dynamic Disk) support' CONFIG_LDM_PARTITION
if [ "$CONFIG_LDM_PARTITION" = "y" ]; then
bool ' Windows LDM extra logging' CONFIG_LDM_DEBUG
fi
--
Peter Osterlund - petero2@telia.com
http://w1.894.telia.com/~u89404340
^ permalink raw reply [flat|nested] 12+ messages in thread* [PATCH] 2.5.29 IDE 108
2002-07-27 3:12 Linux v2.5.29 Linus Torvalds
` (3 preceding siblings ...)
2002-07-27 11:40 ` Linux v2.5.29 Peter Osterlund
@ 2002-07-29 19:27 ` Marcin Dalecki
2002-07-30 11:02 ` Alan Cox
2002-07-29 20:51 ` [PATCH] 2.5.29 IDE 109 Marcin Dalecki
5 siblings, 1 reply; 12+ messages in thread
From: Marcin Dalecki @ 2002-07-29 19:27 UTC (permalink / raw)
To: Linus Torvalds; +Cc: Kernel Mailing List
[-- Attachment #1: Type: text/plain, Size: 888 bytes --]
- typedef unsigned char byte; is finally gone. Everything using it should
be just ported to u8 if I missed some place where it still gets used.
- Next round of parameter parsing cleanups by Gerald Champagne.
Adjusted a bit to harmonize with hd.c.
- Move IDE register bitfields declarations over from hdparm.h to
ide.h.
- Fixup cmd640 fix by LT.
- Don't manipulate REQ_QUEUED in blk_insert_special() as discussed on
lkml. The single only affected file is ll_rw_blk.c of course.
- Declare constants needed by hd.c directly there. Those are standard
values not subject to change and we prefer a bit of code duplication
in favour of making the two drivers independant from each other.
- Move everything not ioctl related away from hdreg.h to ide.h.
This header is in effect not private to the ATA code and should
therefore not contain stuff only usefull there.
[-- Attachment #2: ide-108.diff --]
[-- Type: text/plain, Size: 61100 bytes --]
diff -durNp -X /tmp/diff.8vxI0X linux-2.5.29/drivers/block/ll_rw_blk.c linux/drivers/block/ll_rw_blk.c
--- linux-2.5.29/drivers/block/ll_rw_blk.c 2002-07-27 04:58:28.000000000 +0200
+++ linux/drivers/block/ll_rw_blk.c 2002-07-29 17:28:23.000000000 +0200
@@ -1253,7 +1253,7 @@ struct request *__blk_get_request(reques
* host that is unable to accept a particular command.
*/
void blk_insert_request(request_queue_t *q, struct request *rq,
- int at_head, void *data)
+ int at_head, void *data)
{
unsigned long flags;
@@ -1262,15 +1262,18 @@ void blk_insert_request(request_queue_t
* must not attempt merges on this) and that it acts as a soft
* barrier
*/
- rq->flags &= REQ_QUEUED;
rq->flags |= REQ_SPECIAL | REQ_BARRIER;
rq->special = data;
spin_lock_irqsave(q->queue_lock, flags);
- /* If command is tagged, release the tag */
- if(blk_rq_tagged(rq))
+
+ /*
+ * If command is tagged, release the tag
+ */
+ if (blk_rq_tagged(rq))
blk_queue_end_tag(q, rq);
+
_elv_add_request(q, rq, !at_head, 0);
q->request_fn(q);
spin_unlock_irqrestore(q->queue_lock, flags);
diff -durNp -X /tmp/diff.8vxI0X linux-2.5.29/drivers/ide/cmd640.c linux/drivers/ide/cmd640.c
--- linux-2.5.29/drivers/ide/cmd640.c 2002-07-27 04:58:37.000000000 +0200
+++ linux/drivers/ide/cmd640.c 2002-07-27 10:31:49.000000000 +0200
@@ -167,16 +167,18 @@ int cmd640_vlb = 0;
* Registers and masks for easy access by drive index:
*/
static u8 prefetch_regs[4] = {CNTRL, CNTRL, ARTTIM23, ARTTIM23};
-static u8 prefetch_masks[4] = {CNTRL_DIS_RA0, CNTRL_DIS_RA1, ARTTIM23_DIS_RA2, ARTTIM23_DIS_RA3};
-
-#ifdef CONFIG_BLK_DEV_CMD640_ENHANCED
/*
* Protects register file access from overlapping on primary and secondary
* channel, since those share hardware resources.
*/
+/* This is broken, but no more so than the old code.. */
static spinlock_t cmd640_lock __cacheline_aligned = SPIN_LOCK_UNLOCKED;
+static u8 prefetch_masks[4] = {CNTRL_DIS_RA0, CNTRL_DIS_RA1, ARTTIM23_DIS_RA2, ARTTIM23_DIS_RA3};
+
+#ifdef CONFIG_BLK_DEV_CMD640_ENHANCED
+
static u8 arttim_regs[4] = {ARTTIM0, ARTTIM1, ARTTIM23, ARTTIM23};
static u8 drwtim_regs[4] = {DRWTIM0, DRWTIM1, DRWTIM23, DRWTIM23};
@@ -214,9 +216,6 @@ static unsigned int cmd640_chip_version;
* Therefore, we must use direct IO instead.
*/
-/* This is broken, but no more so than the old code.. */
-static spinlock_t cmd640_lock = SPIN_LOCK_UNLOCKED;
-
/* PCI method 1 access */
static void put_cmd640_reg_pci1 (unsigned short reg, u8 val)
@@ -574,7 +573,7 @@ static void program_drive_counts (unsign
/*
* Now that everything is ready, program the new timings
*/
- spin_lock(&cmd640_lock, flags);
+ spin_lock_irqsave(&cmd640_lock, flags);
/*
* Program the address_setup clocks into ARTTIM reg,
* and then the active/recovery counts into the DRWTIM reg
diff -durNp -X /tmp/diff.8vxI0X linux-2.5.29/drivers/ide/hd.c linux/drivers/ide/hd.c
--- linux-2.5.29/drivers/ide/hd.c 2002-07-27 04:58:30.000000000 +0200
+++ linux/drivers/ide/hd.c 2002-07-29 17:31:30.000000000 +0200
@@ -1,15 +1,11 @@
/*
- * linux/drivers/ide/hd.c
- *
* Copyright (C) 1991, 1992 Linus Torvalds
- */
-
-/*
+ *
* This is the low-level hd interrupt support. It traverses the
* request-list, using interrupts to jump between functions. As
* all the functions are called within interrupts, we may not
* sleep. Special care is recommended.
- *
+ *
* modified by Drew Eckhardt to check nr of hd's from the CMOS.
*
* Thanks to Branko Lankester, lankeste@fwi.uva.nl, who found a bug
@@ -26,10 +22,10 @@
* Bugfix: max_sectors must be <= 255 or the wheels tend to come
* off in a hurry once you queue things up - Paul G. 02/2001
*/
-
+
/* Uncomment the following if you want verbose error reports. */
/* #define VERBOSE_ERRORS */
-
+
#include <linux/errno.h>
#include <linux/signal.h>
#include <linux/sched.h>
@@ -37,7 +33,6 @@
#include <linux/fs.h>
#include <linux/devfs_fs_kernel.h>
#include <linux/kernel.h>
-#include <linux/hdreg.h>
#include <linux/genhd.h>
#include <linux/slab.h>
#include <linux/string.h>
@@ -45,6 +40,7 @@
#include <linux/mc146818rtc.h> /* CMOS defines */
#include <linux/init.h>
#include <linux/blkpg.h>
+#include <linux/hdreg.h>
#define REALLY_SLOW_IO
#include <asm/system.h>
@@ -55,6 +51,15 @@
#define DEVICE_NR(device) (minor(device)>>6)
#include <linux/blk.h>
+/* ATA commands we use.
+ */
+#define WIN_SPECIFY 0x91 /* set drive geometry translation */
+#define WIN_RESTORE 0x10
+#define WIN_READ 0x20 /* 28-Bit */
+#define WIN_WRITE 0x30 /* 28-Bit */
+
+#define HD_IRQ 14 /* the standard disk interrupt */
+
#ifdef __arm__
#undef HD_IRQ
#endif
@@ -63,6 +68,45 @@
#define HD_IRQ IRQ_HARDDISK
#endif
+/* Hd controller regster ports */
+
+#define HD_DATA 0x1f0 /* _CTL when writing */
+#define HD_ERROR 0x1f1 /* see err-bits */
+#define HD_NSECTOR 0x1f2 /* nr of sectors to read/write */
+#define HD_SECTOR 0x1f3 /* starting sector */
+#define HD_LCYL 0x1f4 /* starting cylinder */
+#define HD_HCYL 0x1f5 /* high byte of starting cyl */
+#define HD_CURRENT 0x1f6 /* 101dhhhh , d=drive, hhhh=head */
+#define HD_STATUS 0x1f7 /* see status-bits */
+#define HD_FEATURE HD_ERROR /* same io address, read=error, write=feature */
+#define HD_PRECOMP HD_FEATURE /* obsolete use of this port - predates IDE */
+#define HD_COMMAND HD_STATUS /* same io address, read=status, write=cmd */
+
+#define HD_CMD 0x3f6 /* used for resets */
+#define HD_ALTSTATUS 0x3f6 /* same as HD_STATUS but doesn't clear irq */
+
+/* Bits of HD_STATUS */
+#define ERR_STAT 0x01
+#define INDEX_STAT 0x02
+#define ECC_STAT 0x04 /* Corrected error */
+#define DRQ_STAT 0x08
+#define SEEK_STAT 0x10
+#define SERVICE_STAT SEEK_STAT
+#define WRERR_STAT 0x20
+#define READY_STAT 0x40
+#define BUSY_STAT 0x80
+
+/* Bits for HD_ERROR */
+#define MARK_ERR 0x01 /* Bad address mark */
+#define TRK0_ERR 0x02 /* couldn't find track 0 */
+#define ABRT_ERR 0x04 /* Command aborted */
+#define MCR_ERR 0x08 /* media change request */
+#define ID_ERR 0x10 /* ID field not found */
+#define MC_ERR 0x20 /* media changed */
+#define ECC_ERR 0x40 /* Uncorrectable ECC error */
+#define BBD_ERR 0x80 /* pre-EIDE meaning: block marked bad */
+#define ICRC_ERR 0x80 /* new meaning: CRC error during transfer */
+
static spinlock_t hd_lock = SPIN_LOCK_UNLOCKED;
static int revalidate_hddisk(kdev_t, int);
@@ -162,12 +206,9 @@ void __init hd_setup(char *str, int *int
static void dump_status (const char *msg, unsigned int stat)
{
- unsigned long flags;
char devc;
devc = !blk_queue_empty(QUEUE) ? 'a' + DEVICE_NR(CURRENT->rq_dev) : '?';
- save_flags (flags);
- sti();
#ifdef VERBOSE_ERRORS
printk("hd%c: %s: status=0x%02x { ", devc, msg, stat & 0xff);
if (stat & BUSY_STAT) printk("Busy ");
@@ -207,8 +248,7 @@ static void dump_status (const char *msg
hd_error = inb(HD_ERROR);
printk("hd%c: %s: error=0x%02x.\n", devc, msg, hd_error & 0xff);
}
-#endif /* verbose errors */
- restore_flags (flags);
+#endif
}
void check_status(void)
@@ -467,7 +507,7 @@ ok_to_write:
if (i > 0) {
SET_HANDLER(&write_intr);
outsw(HD_DATA,CURRENT->buffer,256);
- sti();
+ local_irq_enable();
} else {
#if (HD_DELAY > 0)
last_req = read_timer();
@@ -500,7 +540,7 @@ static void hd_times_out(unsigned long d
return;
disable_irq(HD_IRQ);
- sti();
+ local_irq_enable();
reset = 1;
dev = DEVICE_NR(CURRENT->rq_dev);
printk("hd%c: timeout\n", dev+'a');
@@ -510,7 +550,7 @@ static void hd_times_out(unsigned long d
#endif
end_request(CURRENT, 0);
}
- cli();
+ local_irq_disable();
hd_request();
enable_irq(HD_IRQ);
}
@@ -548,7 +588,7 @@ static void hd_request(void)
return;
repeat:
del_timer(&device_timer);
- sti();
+ local_irq_enable();
if (blk_queue_empty(QUEUE)) {
do_hd = NULL;
@@ -556,7 +596,7 @@ repeat:
}
if (reset) {
- cli();
+ local_irq_disable();
reset_hd();
return;
}
@@ -688,7 +728,7 @@ static void hd_interrupt(int irq, void *
if (!handler)
handler = unexpected_hd_interrupt;
handler();
- sti();
+ local_irq_enable();
}
static struct block_device_operations hd_fops = {
diff -durNp -X /tmp/diff.8vxI0X linux-2.5.29/drivers/ide/ide-cd.c linux/drivers/ide/ide-cd.c
--- linux-2.5.29/drivers/ide/ide-cd.c 2002-07-27 04:58:37.000000000 +0200
+++ linux/drivers/ide/ide-cd.c 2002-07-29 15:10:31.000000000 +0200
@@ -305,8 +305,9 @@
#include <linux/interrupt.h>
#include <linux/errno.h>
#include <linux/cdrom.h>
-#include <linux/ide.h>
#include <linux/completion.h>
+#include <linux/hdreg.h>
+#include <linux/ide.h>
#include <asm/irq.h>
#include <asm/io.h>
diff -durNp -X /tmp/diff.8vxI0X linux-2.5.29/drivers/ide/ide-floppy.c linux/drivers/ide/ide-floppy.c
--- linux-2.5.29/drivers/ide/ide-floppy.c 2002-07-27 04:58:32.000000000 +0200
+++ linux/drivers/ide/ide-floppy.c 2002-07-29 15:12:30.000000000 +0200
@@ -94,9 +94,10 @@
#include <linux/genhd.h>
#include <linux/slab.h>
#include <linux/cdrom.h>
+#include <linux/buffer_head.h>
+#include <linux/hdreg.h>
#include <linux/ide.h>
#include <linux/atapi.h>
-#include <linux/buffer_head.h>
#include <asm/byteorder.h>
#include <asm/irq.h>
diff -durNp -X /tmp/diff.8vxI0X linux-2.5.29/drivers/ide/ide-pci.c linux/drivers/ide/ide-pci.c
--- linux-2.5.29/drivers/ide/ide-pci.c 2002-07-27 04:58:41.000000000 +0200
+++ linux/drivers/ide/ide-pci.c 2002-07-28 23:00:42.000000000 +0200
@@ -550,7 +550,8 @@ static void __init hpt374_device_order_f
if (!dev2) {
return;
} else {
- byte irq = 0, irq2 = 0;
+ u8 irq = 0;
+ u8 irq2 = 0;
pci_read_config_byte(dev, PCI_INTERRUPT_LINE, &irq);
pci_read_config_byte(dev2, PCI_INTERRUPT_LINE, &irq2);
if (irq != irq2) {
diff -durNp -X /tmp/diff.8vxI0X linux-2.5.29/drivers/ide/ide-tape.c linux/drivers/ide/ide-tape.c
--- linux-2.5.29/drivers/ide/ide-tape.c 2002-07-27 04:58:30.000000000 +0200
+++ linux/drivers/ide/ide-tape.c 2002-07-29 15:11:40.000000000 +0200
@@ -419,9 +419,10 @@
#include <linux/pci.h>
#include <linux/smp_lock.h>
#include <linux/completion.h>
+#include <linux/buffer_head.h>
+#include <linux/hdreg.h>
#include <linux/ide.h>
#include <linux/atapi.h>
-#include <linux/buffer_head.h>
#include <asm/byteorder.h>
#include <asm/irq.h>
@@ -1249,7 +1250,7 @@ char *idetape_sense_key_verbose(u8 ideta
}
}
-char *idetape_command_key_verbose (byte idetape_command_key)
+char *idetape_command_key_verbose(u8 idetape_command_key)
{
switch (idetape_command_key) {
case IDETAPE_TEST_UNIT_READY_CMD: return("TEST_UNIT_READY_CMD");
@@ -1439,7 +1440,7 @@ static void idetape_analyze_error(struct
# if IDETAPE_DEBUG_LOG_VERBOSE
if (tape->debug_level >= 1)
printk (KERN_INFO "ide-tape: pc = %s, sense key = %x, asc = %x, ascq = %x\n",
- idetape_command_key_verbose((byte) pc->c[0]),
+ idetape_command_key_verbose(pc->c[0]),
result->sense_key,
result->asc,
result->ascq);
@@ -2166,7 +2167,7 @@ static void idetape_pc_callback(struct a
/*
* A mode sense command is used to "sense" tape parameters.
*/
-static void idetape_create_mode_sense_cmd(struct atapi_packet_command *pc, byte page_code)
+static void idetape_create_mode_sense_cmd(struct atapi_packet_command *pc, u8 page_code)
{
atapi_init_pc(pc);
pc->c[0] = IDETAPE_MODE_SENSE_CMD;
@@ -3225,7 +3226,7 @@ static int __idetape_discard_read_pipeli
* of the request queue and wait for their completion.
*
*/
-static int idetape_position_tape(struct ata_device *drive, unsigned int block, byte partition, int skip)
+static int idetape_position_tape(struct ata_device *drive, unsigned int block, u8 partition, int skip)
{
idetape_tape_t *tape = drive->driver_data;
int retval;
@@ -3981,7 +3982,7 @@ static int idetape_add_chrdev_read_reque
printk (KERN_ERR "ide-tape: bug: trying to return more bytes than requested\n");
bytes_read=blocks*tape->tape_block_size;
}
-#endif /* IDETAPE_DEBUG_BUGS */
+#endif
return (bytes_read);
}
diff -durNp -X /tmp/diff.8vxI0X linux-2.5.29/drivers/ide/ioctl.c linux/drivers/ide/ioctl.c
--- linux-2.5.29/drivers/ide/ioctl.c 2002-07-27 04:58:33.000000000 +0200
+++ linux/drivers/ide/ioctl.c 2002-07-29 16:20:57.000000000 +0200
@@ -33,6 +33,15 @@
#include "ioctl.h"
+
+/* BIG GEOMETRY - dying, used only by HDIO_GETGEO_BIG_RAW */
+struct hd_big_geometry {
+ u8 heads;
+ u8 sectors;
+ u32 cylinders;
+ unsigned long start;
+};
+
/*
* Implement generic ioctls invoked from userspace to imlpement specific
* functionality.
diff -durNp -X /tmp/diff.8vxI0X linux-2.5.29/drivers/ide/main.c linux/drivers/ide/main.c
--- linux-2.5.29/drivers/ide/main.c 2002-07-27 04:58:24.000000000 +0200
+++ linux/drivers/ide/main.c 2002-07-29 17:27:48.000000000 +0200
@@ -191,7 +191,11 @@ static void init_hwif_data(struct ata_ch
ch->noprobe = !ch->io_ports[IDE_DATA_OFFSET];
#ifdef CONFIG_BLK_DEV_HD
- if (ch->io_ports[IDE_DATA_OFFSET] == HD_DATA)
+
+ /* Ignore disks for which handling by the legacy driver was requested
+ * by the used.
+ */
+ if (ch->io_ports[IDE_DATA_OFFSET] == 0x1f0)
ch->noprobe = 1; /* may be overridden by ide_setup() */
#endif
@@ -701,79 +705,46 @@ static void __init init_global_data(void
/*
* This gets called VERY EARLY during initialization, to handle kernel "command
- * line" strings beginning with "hdx=" or "ide".It gets called even before the
- * actual module gets initialized.
+ * line" strings beginning with "hdx=". It gets called even before the actual
+ * module gets initialized.
*
* Please look at Documentation/ide.txt to see the complete list of supported
* options.
*/
-int __init ide_setup(char *s)
+static int __init ata_hd_setup(char *s)
{
- int i, vals[4];
- struct ata_channel *ch;
+ int vals[4];
+ struct ata_channel *ch; /* FIXME: Channel parms should not be accessed in ata_hd_setup */
struct ata_device *drive;
unsigned int hw, unit;
const char max_drive = 'a' + ((MAX_HWIFS * MAX_DRIVES) - 1);
- const char max_ch = '0' + (MAX_HWIFS - 1);
- if (!strncmp(s, "hd=", 3)) /* hd= is for hd.c driver and not us */
- return 0;
-
- if (strncmp(s,"ide",3) &&
- strncmp(s,"hd",2)) /* hdx= & hdxlun= */
+ if (s[0] == '=') /* hd= is for hd.c driver and not us */
return 0;
- printk(KERN_INFO "ide_setup: %s", s);
+ printk(KERN_INFO "hd%s", s);
init_global_data();
-#ifdef CONFIG_BLK_DEV_IDEDOUBLER
- if (!strcmp(s, "ide=doubler")) {
- extern int ide_doubler;
-
- printk(KERN_INFO" : Enabled support for IDE doublers\n");
- ide_doubler = 1;
-
- return 1;
- }
-#endif
-
- if (!strcmp(s, "ide=nodma")) {
- printk(KERN_INFO "ATA: Prevented DMA\n");
- noautodma = 1;
-
- return 1;
- }
-
-#ifdef CONFIG_PCI
- if (!strcmp(s, "ide=reverse")) {
- ide_scan_direction = 1;
- printk(" : Enabled support for IDE inverse scan order.\n");
-
- return 1;
- }
-#endif
-
- /*
- * Look for drive options: "hdx="
- */
- if (!strncmp(s, "hd", 2) && s[2] >= 'a' && s[2] <= max_drive) {
- const char *hd_words[] = {"none", "noprobe", "nowerr", "cdrom",
+ if (s[0] >= 'a' && s[0] <= max_drive) {
+ static const char *hd_words[] = {"none", "noprobe", "nowerr", "cdrom",
"serialize", "autotune", "noautotune",
"slow", "flash", "remap", "noremap", "scsi", NULL};
- unit = s[2] - 'a';
+ unit = s[0] - 'a';
hw = unit / MAX_DRIVES;
unit = unit % MAX_DRIVES;
ch = &ide_hwifs[hw];
drive = &ch->drives[unit];
- if (!strncmp(s+3, "=ide-", 5)) {
- strncpy(drive->driver_req, s + 4, 9);
+
+ /* Look for hdx=ide-* */
+ if (!strncmp(s+1, "=ide-", 5)) {
+ strncpy(drive->driver_req, s+2, 9);
goto done;
}
/*
* Look for last lun option: "hdxlun="
*/
- if (!strncmp(s+3, "lun=", 4)) {
- if (*get_options(s+7, 2, vals) || vals[0]!=1)
+ if (!strncmp(s+1, "lun=", 4)) {
+ if (*get_options(s+5, 2, vals) || vals[0]!=1)
goto bad_option;
if (vals[1] >= 0 && vals[1] <= 7) {
drive->last_lun = vals[1];
@@ -782,7 +753,7 @@ int __init ide_setup(char *s)
printk(" -- BAD LAST LUN! Expected value from 0 to 7");
goto done;
}
- switch (match_parm(s+3, hd_words, vals, 3)) {
+ switch (match_parm(s+1, hd_words, vals, 3)) {
case -1: /* "none" */
drive->nobios = 1; /* drop into "noprobe" */
case -2: /* "noprobe" */
@@ -790,16 +761,16 @@ int __init ide_setup(char *s)
goto done;
case -3: /* "nowerr" */
drive->bad_wstat = BAD_R_STAT;
- ch->noprobe = 0;
+ ch->noprobe = 0; /* FIXME: Channel parm */
goto done;
case -4: /* "cdrom" */
drive->present = 1;
drive->type = ATA_ROM;
- ch->noprobe = 0;
+ ch->noprobe = 0; /* FIXME: Channel parm */
goto done;
case -5: /* "serialize" */
printk(" -- USE \"ide%d=serialize\" INSTEAD", hw);
- goto do_serialize;
+ goto bad_option;
case -6: /* "autotune" */
drive->autotune = 1;
goto done;
@@ -807,7 +778,7 @@ int __init ide_setup(char *s)
drive->autotune = 2;
goto done;
case -8: /* "slow" */
- ch->slow = 1;
+ ch->slow = 1; /* FIXME: Channel parm */
goto done;
case -9: /* "flash" */
drive->ata_flash = 1;
@@ -840,11 +811,63 @@ int __init ide_setup(char *s)
}
}
+bad_option:
+ printk(" -- BAD OPTION\n");
+ return 1;
+
+done:
+ printk("\n");
+
+ return 1;
+}
+
+/*
+ * This gets called VERY EARLY during initialization, to handle kernel "command
+ * line" strings beginning with "ide". It gets called even before the actual
+ * module gets initialized.
+ *
+ * Please look at Documentation/ide.txt to see the complete list of supported
+ * options.
+ */
+int __init ide_setup(char *s)
+{
+ int i, vals[4];
+ struct ata_channel *ch;
+ unsigned int hw;
+ const char max_ch = '0' + (MAX_HWIFS - 1);
+
+ printk(KERN_INFO "ide_setup: ide%s", s);
+ init_global_data();
+
+#ifdef CONFIG_BLK_DEV_IDEDOUBLER
+ if (!strcmp(s, "=doubler")) {
+ extern int ide_doubler;
+
+ printk(KERN_INFO" : Enabled support for IDE doublers\n");
+ ide_doubler = 1;
+ return 1;
+ }
+#endif
+
+ if (!strcmp(s, "=nodma")) {
+ printk(KERN_INFO "ATA: Prevented DMA\n");
+ noautodma = 1;
+ return 1;
+ }
+
+#ifdef CONFIG_PCI
+ if (!strcmp(s, "=reverse")) {
+ ide_scan_direction = 1;
+ printk(" : Enabled support for IDE inverse scan order.\n");
+ return 1;
+ }
+#endif
+
/*
* Look for bus speed option: "idebus="
*/
- if (!strncmp(s, "idebus=", 7)) {
- if (*get_options(s+7, 2, vals) || vals[0] != 1)
+ if (!strncmp(s, "bus=", 4)) {
+ if (*get_options(s+4, 2, vals) || vals[0] != 1)
goto bad_option;
idebus_parameter = vals[1];
goto done;
@@ -853,7 +876,7 @@ int __init ide_setup(char *s)
/*
* Look for interface options: "idex="
*/
- if (!strncmp(s, "ide", 3) && s[3] >= '0' && s[3] <= max_ch) {
+ if (s[0] >= '0' && s[0] <= max_ch) {
/*
* Be VERY CAREFUL changing this: note hardcoded indexes below
*/
@@ -861,11 +884,11 @@ int __init ide_setup(char *s)
"noprobe", "serialize", "autotune", "noautotune", "reset", "dma", "ata66", NULL };
const char *ide_words[] = {
"qd65xx", "ht6560b", "cmd640_vlb", "dtc2278", "umc8672", "ali14xx", "dc4030", NULL };
- hw = s[3] - '0';
+ hw = s[0] - '0';
ch = &ide_hwifs[hw];
- switch (match_parm(s+4, ide_options, vals, 1)) {
+ switch (match_parm(s+1, ide_options, vals, 1)) {
case -7: /* ata66 */
#ifdef CONFIG_PCI
ch->udma_four = 1;
@@ -889,7 +912,6 @@ int __init ide_setup(char *s)
ch->drives[1].autotune = 1;
goto done;
case -2: /* "serialize" */
- do_serialize:
{
struct ata_channel *mate;
@@ -904,7 +926,10 @@ int __init ide_setup(char *s)
goto done;
}
- i = match_parm(&s[4], ide_words, vals, 3);
+ /*
+ * Check for specific chipset name
+ */
+ i = match_parm(s+1, ide_words, vals, 3);
/*
* Cryptic check to ensure chipset not already set for a channel:
@@ -913,7 +938,7 @@ int __init ide_setup(char *s)
if (ide_hwifs[hw].chipset != ide_unknown)
goto bad_option; /* chipset already specified */
if (i != -7 && hw != 0)
- goto bad_channel; /* chipset drivers are for "ide0=" only */
+ goto bad_channel; /* chipset drivers are for "ide0=" only */
if (i != -7 && ide_hwifs[1].chipset != ide_unknown)
goto bad_option; /* chipset for 2nd port already specified */
printk("\n");
@@ -1432,8 +1457,14 @@ static int __init init_ata(void)
while ((options = next) != NULL) {
if ((next = strchr(options,' ')) != NULL)
*next++ = 0;
- if (!ide_setup(options))
- printk(KERN_ERR "Unknown option '%s'\n", options);
+ if (!strncmp(options,"hd",2)) {
+ if (!ata_hd_setup(options+2))
+ printk(KERN_ERR "Unknown option '%s'\n", options);
+ }
+ else if (!strncmp(options,"ide",3)) {
+ if (!ide_setup(options+3))
+ printk(KERN_ERR "Unknown option '%s'\n", options);
+ }
}
}
return ata_module_init();
@@ -1457,6 +1488,7 @@ module_exit(cleanup_ata);
#ifndef MODULE
/* command line option parser */
-__setup("", ide_setup);
+__setup("ide", ide_setup);
+__setup("hd", ata_hd_setup);
#endif
diff -durNp -X /tmp/diff.8vxI0X linux-2.5.29/drivers/ide/probe.c linux/drivers/ide/probe.c
--- linux-2.5.29/drivers/ide/probe.c 2002-07-27 04:58:23.000000000 +0200
+++ linux/drivers/ide/probe.c 2002-07-29 17:22:49.000000000 +0200
@@ -1082,7 +1082,12 @@ static void channel_init(struct ata_chan
}
}
#ifdef CONFIG_BLK_DEV_HD
- if (ch->irq == HD_IRQ && ch->io_ports[IDE_DATA_OFFSET] != HD_DATA) {
+
+ /* The first "legacy" HD gets distinguished by the IRQ it is attached
+ * to and the IO port it takes.
+ */
+
+ if (ch->irq == 14 && ch->io_ports[IDE_DATA_OFFSET] != 0x1f0) {
printk("%s: CANNOT SHARE IRQ WITH OLD HARDDISK DRIVER (hd.c)\n", ch->name);
return;
diff -durNp -X /tmp/diff.8vxI0X linux-2.5.29/drivers/usb/storage/freecom.c linux/drivers/usb/storage/freecom.c
--- linux-2.5.29/drivers/usb/storage/freecom.c 2002-07-27 04:58:46.000000000 +0200
+++ linux/drivers/usb/storage/freecom.c 2002-07-29 17:37:40.000000000 +0200
@@ -40,43 +40,47 @@
static void pdump (void *, int);
#endif
+/* Bits of HD_STATUS */
+#define ERR_STAT 0x01
+#define DRQ_STAT 0x08
+
struct freecom_udata {
- __u8 buffer[64]; /* Common command block. */
+ u8 buffer[64]; /* Common command block. */
};
typedef struct freecom_udata *freecom_udata_t;
/* All of the outgoing packets are 64 bytes long. */
struct freecom_cb_wrap {
- __u8 Type; /* Command type. */
- __u8 Timeout; /* Timeout in seconds. */
- __u8 Atapi[12]; /* An ATAPI packet. */
- __u8 Filler[50]; /* Padding Data. */
+ u8 Type; /* Command type. */
+ u8 Timeout; /* Timeout in seconds. */
+ u8 Atapi[12]; /* An ATAPI packet. */
+ u8 Filler[50]; /* Padding Data. */
};
struct freecom_xfer_wrap {
- __u8 Type; /* Command type. */
- __u8 Timeout; /* Timeout in seconds. */
- __u32 Count; /* Number of bytes to transfer. */
- __u8 Pad[58];
+ u8 Type; /* Command type. */
+ u8 Timeout; /* Timeout in seconds. */
+ u32 Count; /* Number of bytes to transfer. */
+ u8 Pad[58];
} __attribute__ ((packed));
struct freecom_ide_out {
- __u8 Type; /* Type + IDE register. */
- __u8 Pad;
- __u16 Value; /* Value to write. */
- __u8 Pad2[60];
+ u8 Type; /* Type + IDE register. */
+ u8 Pad;
+ u16 Value; /* Value to write. */
+ u8 Pad2[60];
};
struct freecom_ide_in {
- __u8 Type; /* Type | IDE register. */
- __u8 Pad[63];
+ u8 Type; /* Type | IDE register. */
+ u8 Pad[63];
};
struct freecom_status {
- __u8 Status;
- __u8 Reason;
- __u16 Count;
- __u8 Pad[60];
+ u8 Status;
+ u8 Reason;
+ u16 Count;
+ u8 Pad[60];
};
/* Freecom stuffs the interrupt status in the INDEX_STAT bit of the ide
diff -durNp -X /tmp/diff.8vxI0X linux-2.5.29/include/linux/hdreg.h linux/include/linux/hdreg.h
--- linux-2.5.29/include/linux/hdreg.h 2002-07-27 04:58:37.000000000 +0200
+++ linux/include/linux/hdreg.h 2002-07-29 17:30:30.000000000 +0200
@@ -2,279 +2,18 @@
#define _LINUX_HDREG_H
/*
- * This file contains some defines for the AT-hd-controller.
- * Various sources.
- */
-
-#define HD_IRQ 14 /* the standard disk interrupt */
-
-/* ide.c has its own port definitions in "ide.h" */
-
-/* Hd controller regs. Ref: IBM AT Bios-listing */
-#define HD_DATA 0x1f0 /* _CTL when writing */
-#define HD_ERROR 0x1f1 /* see err-bits */
-#define HD_NSECTOR 0x1f2 /* nr of sectors to read/write */
-#define HD_SECTOR 0x1f3 /* starting sector */
-#define HD_LCYL 0x1f4 /* starting cylinder */
-#define HD_HCYL 0x1f5 /* high byte of starting cyl */
-#define HD_CURRENT 0x1f6 /* 101dhhhh , d=drive, hhhh=head */
-#define HD_STATUS 0x1f7 /* see status-bits */
-#define HD_FEATURE HD_ERROR /* same io address, read=error, write=feature */
-#define HD_PRECOMP HD_FEATURE /* obsolete use of this port - predates IDE */
-#define HD_COMMAND HD_STATUS /* same io address, read=status, write=cmd */
-
-#define HD_CMD 0x3f6 /* used for resets */
-#define HD_ALTSTATUS 0x3f6 /* same as HD_STATUS but doesn't clear irq */
-
-/* remainder is shared between hd.c, ide.c, ide-cd.c, and the hdparm utility */
-
-/* Bits of HD_STATUS */
-#define ERR_STAT 0x01
-#define INDEX_STAT 0x02
-#define ECC_STAT 0x04 /* Corrected error */
-#define DRQ_STAT 0x08
-#define SEEK_STAT 0x10
-#define SERVICE_STAT SEEK_STAT
-#define WRERR_STAT 0x20
-#define READY_STAT 0x40
-#define BUSY_STAT 0x80
-
-/* Bits for HD_ERROR */
-#define MARK_ERR 0x01 /* Bad address mark */
-#define TRK0_ERR 0x02 /* couldn't find track 0 */
-#define ABRT_ERR 0x04 /* Command aborted */
-#define MCR_ERR 0x08 /* media change request */
-#define ID_ERR 0x10 /* ID field not found */
-#define MC_ERR 0x20 /* media changed */
-#define ECC_ERR 0x40 /* Uncorrectable ECC error */
-#define BBD_ERR 0x80 /* pre-EIDE meaning: block marked bad */
-#define ICRC_ERR 0x80 /* new meaning: CRC error during transfer */
-
-/*
- * sector count bits
- */
-#define NSEC_CD 0x01
-#define NSEC_IO 0x02
-#define NSEC_REL 0x04
-
-/*
* Command Header sizes for IOCTL commands
*/
-
#define HDIO_DRIVE_CMD_HDR_SIZE (4 * sizeof(u8))
#define HDIO_DRIVE_HOB_HDR_SIZE (8 * sizeof(u8))
-#define IDE_DRIVE_TASK_INVALID -1
-#define IDE_DRIVE_TASK_NO_DATA 0
-#define IDE_DRIVE_TASK_SET_XFER 1
-
-#define IDE_DRIVE_TASK_IN 2
-
-#define IDE_DRIVE_TASK_OUT 3
-#define IDE_DRIVE_TASK_RAW_WRITE 4
-
-struct hd_drive_task_hdr {
- u8 feature;
- u8 sector_count;
- u8 sector_number;
- u8 low_cylinder;
- u8 high_cylinder;
- u8 device_head;
-} __attribute__((packed));
-
-/*
- * Define standard taskfile in/out register
- */
-#define IDE_TASKFILE_STD_OUT_FLAGS 0xFE
-#define IDE_TASKFILE_STD_IN_FLAGS 0xFE
-#define IDE_HOB_STD_OUT_FLAGS 0xC0
-#define IDE_HOB_STD_IN_FLAGS 0xC0
-
-#define TASKFILE_INVALID 0x7fff
-#define TASKFILE_48 0x8000
-
-#define TASKFILE_NO_DATA 0x0000
-
-#define TASKFILE_IN 0x0001
-#define TASKFILE_MULTI_IN 0x0002
-
-#define TASKFILE_OUT 0x0004
-#define TASKFILE_MULTI_OUT 0x0008
-#define TASKFILE_IN_OUT 0x0010
-
-#define TASKFILE_IN_DMA 0x0020
-#define TASKFILE_OUT_DMA 0x0040
-#define TASKFILE_IN_DMAQ 0x0080
-#define TASKFILE_OUT_DMAQ 0x0100
-
-#define TASKFILE_P_IN 0x0200
-#define TASKFILE_P_OUT 0x0400
-#define TASKFILE_P_IN_DMA 0x0800
-#define TASKFILE_P_OUT_DMA 0x1000
-#define TASKFILE_P_IN_DMAQ 0x2000
-#define TASKFILE_P_OUT_DMAQ 0x4000
-
-/* ATA/ATAPI Commands pre T13 Spec */
-#define WIN_NOP 0x00
-#define CFA_REQ_EXT_ERROR_CODE 0x03 /* CFA Request Extended Error Code */
-#define WIN_SRST 0x08 /* ATAPI soft reset command */
-#define WIN_DEVICE_RESET 0x08
-#define WIN_RESTORE 0x10
-#define WIN_READ 0x20 /* 28-Bit */
-#define WIN_READ_EXT 0x24 /* 48-Bit */
-#define WIN_READDMA_EXT 0x25 /* 48-Bit */
-#define WIN_READDMA_QUEUED_EXT 0x26 /* 48-Bit */
-#define WIN_READ_NATIVE_MAX_EXT 0x27 /* 48-Bit */
-#define WIN_MULTREAD_EXT 0x29 /* 48-Bit */
-#define WIN_WRITE 0x30 /* 28-Bit */
-#define WIN_WRITE_EXT 0x34 /* 48-Bit */
-#define WIN_WRITEDMA_EXT 0x35 /* 48-Bit */
-#define WIN_WRITEDMA_QUEUED_EXT 0x36 /* 48-Bit */
-#define WIN_SET_MAX_EXT 0x37 /* 48-Bit */
-#define CFA_WRITE_SECT_WO_ERASE 0x38 /* CFA Write Sectors without erase */
-#define WIN_MULTWRITE_EXT 0x39 /* 48-Bit */
-#define WIN_WRITE_VERIFY 0x3C /* 28-Bit */
-#define WIN_VERIFY 0x40 /* 28-Bit - Read Verify Sectors */
-#define WIN_VERIFY_EXT 0x42 /* 48-Bit */
-#define WIN_FORMAT 0x50
-#define WIN_INIT 0x60
-#define WIN_SEEK 0x70
-#define CFA_TRANSLATE_SECTOR 0x87 /* CFA Translate Sector */
-#define WIN_DIAGNOSE 0x90
-#define WIN_SPECIFY 0x91 /* set drive geometry translation */
-#define WIN_DOWNLOAD_MICROCODE 0x92
-#define WIN_STANDBYNOW2 0x94
-#define WIN_SETIDLE2 0x97
-#define WIN_CHECKPOWERMODE2 0x98
-#define WIN_SLEEPNOW2 0x99
-#define WIN_PACKETCMD 0xA0 /* Send a packet command. */
-#define WIN_PIDENTIFY 0xA1 /* identify ATAPI device */
-#define WIN_QUEUED_SERVICE 0xA2
-#define WIN_SMART 0xB0 /* self-monitoring and reporting */
-#define CFA_ERASE_SECTORS 0xC0
-#define WIN_MULTREAD 0xC4 /* read sectors using multiple mode*/
-#define WIN_MULTWRITE 0xC5 /* write sectors using multiple mode */
-#define WIN_SETMULT 0xC6 /* enable/disable multiple mode */
-#define WIN_READDMA_QUEUED 0xC7 /* read sectors using Queued DMA transfers */
-#define WIN_READDMA 0xC8 /* read sectors using DMA transfers */
-#define WIN_WRITEDMA 0xCA /* write sectors using DMA transfers */
-#define WIN_WRITEDMA_QUEUED 0xCC /* write sectors using Queued DMA transfers */
-#define CFA_WRITE_MULTI_WO_ERASE 0xCD /* CFA Write multiple without erase */
-#define WIN_GETMEDIASTATUS 0xDA
-#define WIN_DOORLOCK 0xDE /* lock door on removable drives */
-#define WIN_DOORUNLOCK 0xDF /* unlock door on removable drives */
-#define WIN_STANDBYNOW1 0xE0
-#define WIN_IDLEIMMEDIATE 0xE1 /* force drive to become "ready" */
-#define WIN_STANDBY 0xE2 /* Set device in Standby Mode */
-#define WIN_SETIDLE1 0xE3
-#define WIN_READ_BUFFER 0xE4 /* force read only 1 sector */
-#define WIN_CHECKPOWERMODE1 0xE5
-#define WIN_SLEEPNOW1 0xE6
-#define WIN_FLUSH_CACHE 0xE7
-#define WIN_WRITE_BUFFER 0xE8 /* force write only 1 sector */
-#define WIN_FLUSH_CACHE_EXT 0xEA /* 48-Bit */
-#define WIN_IDENTIFY 0xEC /* ask drive to identify itself */
-#define WIN_MEDIAEJECT 0xED
-#define WIN_IDENTIFY_DMA 0xEE /* same as WIN_IDENTIFY, but DMA */
-#define WIN_SETFEATURES 0xEF /* set special drive features */
-#define EXABYTE_ENABLE_NEST 0xF0
-#define WIN_SECURITY_SET_PASS 0xF1
-#define WIN_SECURITY_UNLOCK 0xF2
-#define WIN_SECURITY_ERASE_PREPARE 0xF3
-#define WIN_SECURITY_ERASE_UNIT 0xF4
-#define WIN_SECURITY_FREEZE_LOCK 0xF5
-#define WIN_SECURITY_DISABLE 0xF6
-#define WIN_READ_NATIVE_MAX 0xF8 /* return the native maximum address */
-#define WIN_SET_MAX 0xF9
-#define DISABLE_SEAGATE 0xFB
-
-/* WIN_SMART sub-commands */
-
-#define SMART_READ_VALUES 0xD0
-#define SMART_READ_THRESHOLDS 0xD1
-#define SMART_AUTOSAVE 0xD2
-#define SMART_SAVE 0xD3
-#define SMART_IMMEDIATE_OFFLINE 0xD4
-#define SMART_READ_LOG_SECTOR 0xD5
-#define SMART_WRITE_LOG_SECTOR 0xD6
-#define SMART_WRITE_THRESHOLDS 0xD7
-#define SMART_ENABLE 0xD8
-#define SMART_DISABLE 0xD9
-#define SMART_STATUS 0xDA
-#define SMART_AUTO_OFFLINE 0xDB
-
-/* Password used in TF4 & TF5 executing SMART commands */
-
-#define SMART_LCYL_PASS 0x4F
-#define SMART_HCYL_PASS 0xC2
-
-/* WIN_SETFEATURES sub-commands */
-
-#define SETFEATURES_EN_WCACHE 0x02 /* Enable write cache */
-#define SETFEATURES_XFER 0x03 /* Set transfer mode */
-# define XFER_UDMA_7 0x47 /* 0100|0111 */
-# define XFER_UDMA_6 0x46 /* 0100|0110 */
-# define XFER_UDMA_5 0x45 /* 0100|0101 */
-# define XFER_UDMA_4 0x44 /* 0100|0100 */
-# define XFER_UDMA_3 0x43 /* 0100|0011 */
-# define XFER_UDMA_2 0x42 /* 0100|0010 */
-# define XFER_UDMA_1 0x41 /* 0100|0001 */
-# define XFER_UDMA_0 0x40 /* 0100|0000 */
-# define XFER_MW_DMA_2 0x22 /* 0010|0010 */
-# define XFER_MW_DMA_1 0x21 /* 0010|0001 */
-# define XFER_MW_DMA_0 0x20 /* 0010|0000 */
-# define XFER_SW_DMA_2 0x12 /* 0001|0010 */
-# define XFER_SW_DMA_1 0x11 /* 0001|0001 */
-# define XFER_SW_DMA_0 0x10 /* 0001|0000 */
-# define XFER_PIO_4 0x0C /* 0000|1100 */
-# define XFER_PIO_3 0x0B /* 0000|1011 */
-# define XFER_PIO_2 0x0A /* 0000|1010 */
-# define XFER_PIO_1 0x09 /* 0000|1001 */
-# define XFER_PIO_0 0x08 /* 0000|1000 */
-# define XFER_PIO_SLOW 0x00 /* 0000|0000 */
-#define SETFEATURES_DIS_DEFECT 0x04 /* Disable Defect Management */
-#define SETFEATURES_EN_APM 0x05 /* Enable advanced power management */
-#define SETFEATURES_DIS_MSN 0x31 /* Disable Media Status Notification */
-#define SETFEATURES_EN_AAM 0x42 /* Enable Automatic Acoustic Management */
-#define SETFEATURES_DIS_RLA 0x55 /* Disable read look-ahead feature */
-#define SETFEATURES_EN_RI 0x5D /* Enable release interrupt */
-#define SETFEATURES_EN_SI 0x5E /* Enable SERVICE interrupt */
-#define SETFEATURES_DIS_RPOD 0x66 /* Disable reverting to power on defaults */
-#define SETFEATURES_DIS_WCACHE 0x82 /* Disable write cache */
-#define SETFEATURES_EN_DEFECT 0x84 /* Enable Defect Management */
-#define SETFEATURES_DIS_APM 0x85 /* Disable advanced power management */
-#define SETFEATURES_EN_MSN 0x95 /* Enable Media Status Notification */
-#define SETFEATURES_EN_RLA 0xAA /* Enable read look-ahead feature */
-#define SETFEATURES_PREFETCH 0xAB /* Sets drive prefetch value */
-#define SETFEATURES_DIS_AAM 0xC2 /* Disable Automatic Acoustic Management */
-#define SETFEATURES_EN_RPOD 0xCC /* Enable reverting to power on defaults */
-#define SETFEATURES_DIS_RI 0xDD /* Disable release interrupt */
-#define SETFEATURES_DIS_SI 0xDE /* Disable SERVICE interrupt */
-
-/* WIN_SECURITY sub-commands */
-
-#define SECURITY_SET_PASSWORD 0xBA
-#define SECURITY_UNLOCK 0xBB
-#define SECURITY_ERASE_PREPARE 0xBC
-#define SECURITY_ERASE_UNIT 0xBD
-#define SECURITY_FREEZE_LOCK 0xBE
-#define SECURITY_DISABLE_PASSWORD 0xBF
-
struct hd_geometry {
- u8 heads;
- u8 sectors;
- u16 cylinders;
+ __u8 heads;
+ __u8 sectors;
+ __u16 cylinders;
unsigned long start;
};
-/* BIG GEOMETRY - dying, used only by HDIO_GETGEO_BIG_RAW */
-struct hd_big_geometry {
- u8 heads;
- u8 sectors;
- u32 cylinders;
- unsigned long start;
-};
-
/* hd/ide ctl's that pass (arg) ptrs to user space are numbered 0x030n/0x031n */
#define HDIO_GETGEO 0x0301 /* get device geometry */
#define HDIO_GET_UNMASKINTR 0x0302 /* get current unmask setting */
@@ -306,263 +45,8 @@ struct hd_big_geometry {
#define HDIO_SET_QDMA 0x032e /* change use-qdma flag */
#define HDIO_SET_ADDRESS 0x032f /* change lba addressing modes */
-/* bus states */
-enum {
- BUSSTATE_OFF = 0,
- BUSSTATE_ON,
- BUSSTATE_TRISTATE
-};
-
/* hd/ide ctl's that pass (arg) ptrs to user space are numbered 0x033n/0x033n */
/* 0x330 is reserved - used to be HDIO_GETGEO_BIG */
#define HDIO_GETGEO_BIG_RAW 0x0331 /* */
-#define __NEW_HD_DRIVE_ID
-
-/*
- * 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.
- */
-struct hd_driveid {
- u16 config; /* lots of obsolete bit flags */
- u16 cyls; /* Obsolete, "physical" cyls */
- u16 reserved2; /* reserved (word 2) */
- u16 heads; /* Obsolete, "physical" heads */
- u16 track_bytes; /* unformatted bytes per track */
- u16 sector_bytes; /* unformatted bytes per sector */
- u16 sectors; /* Obsolete, "physical" sectors per track */
- u16 vendor0; /* vendor unique */
- u16 vendor1; /* vendor unique */
- u16 vendor2; /* Retired vendor unique */
- u8 serial_no[20]; /* 0 = not_specified */
- u16 buf_type; /* Retired */
- u16 buf_size; /* Retired, 512 byte increments
- * 0 = not_specified
- */
- u16 ecc_bytes; /* for r/w long cmds; 0 = not_specified */
- u8 fw_rev[8]; /* 0 = not_specified */
- char model[40]; /* 0 = not_specified */
- u8 max_multsect; /* 0=not_implemented */
- u8 vendor3; /* vendor unique */
- u16 dword_io; /* 0=not_implemented; 1=implemented */
- u8 vendor4; /* vendor unique */
- u8 capability; /* (upper byte of word 49)
- * 3: IORDYsup
- * 2: IORDYsw
- * 1: LBA
- * 0: DMA
- */
- u16 reserved50; /* reserved (word 50) */
- u8 vendor5; /* Obsolete, vendor unique */
- u8 tPIO; /* Obsolete, 0=slow, 1=medium, 2=fast */
- u8 vendor6; /* Obsolete, vendor unique */
- u8 tDMA; /* Obsolete, 0=slow, 1=medium, 2=fast */
- u16 field_valid; /* (word 53)
- * 2: ultra_ok word 88
- * 1: eide_ok words 64-70
- * 0: cur_ok words 54-58
- */
- u16 cur_cyls; /* Obsolete, logical cylinders */
- u16 cur_heads; /* Obsolete, l heads */
- u16 cur_sectors; /* Obsolete, l sectors per track */
- u16 cur_capacity0; /* Obsolete, l total sectors on drive */
- u16 cur_capacity1; /* Obsolete, (2 words, misaligned int) */
- u8 multsect; /* current multiple sector count */
- u8 multsect_valid; /* when (bit0==1) multsect is ok */
- u32 lba_capacity; /* Obsolete, total number of sectors */
- u16 dma_1word; /* Obsolete, single-word dma info */
- u16 dma_mword; /* multiple-word dma info */
- u16 eide_pio_modes; /* bits 0:mode3 1:mode4 */
- u16 eide_dma_min; /* min mword dma cycle time (ns) */
- u16 eide_dma_time; /* recommended mword dma cycle time (ns) */
- u16 eide_pio; /* min cycle time (ns), no IORDY */
- u16 eide_pio_iordy; /* min cycle time (ns), with IORDY */
- u16 words69_70[2]; /* reserved words 69-70
- * future command overlap and queuing
- */
- /* HDIO_GET_IDENTITY currently returns only words 0 through 70 */
- u16 words71_74[4]; /* reserved words 71-74
- * for IDENTIFY PACKET DEVICE command
- */
- u16 queue_depth; /* (word 75)
- * 15:5 reserved
- * 4:0 Maximum queue depth -1
- */
- u16 words76_79[4]; /* reserved words 76-79 */
- u16 major_rev_num; /* (word 80) */
- u16 minor_rev_num; /* (word 81) */
- u16 command_set_1; /* (word 82) supported
- * 15: Obsolete
- * 14: NOP command
- * 13: READ_BUFFER
- * 12: WRITE_BUFFER
- * 11: Obsolete
- * 10: Host Protected Area
- * 9: DEVICE Reset
- * 8: SERVICE Interrupt
- * 7: Release Interrupt
- * 6: look-ahead
- * 5: write cache
- * 4: PACKET Command
- * 3: Power Management Feature Set
- * 2: Removable Feature Set
- * 1: Security Feature Set
- * 0: SMART Feature Set
- */
- u16 command_set_2; /* (word 83)
- * 15: Shall be ZERO
- * 14: Shall be ONE
- * 13: FLUSH CACHE EXT
- * 12: FLUSH CACHE
- * 11: Device Configuration Overlay
- * 10: 48-bit Address Feature Set
- * 9: Automatic Acoustic Management
- * 8: SET MAX security
- * 7: reserved 1407DT PARTIES
- * 6: SetF sub-command Power-Up
- * 5: Power-Up in Standby Feature Set
- * 4: Removable Media Notification
- * 3: APM Feature Set
- * 2: CFA Feature Set
- * 1: READ/WRITE DMA QUEUED
- * 0: Download MicroCode
- */
- u16 cfsse; /* (word 84)
- * cmd set-feature supported extensions
- * 15: Shall be ZERO
- * 14: Shall be ONE
- * 13:3 reserved
- * 2: Media Serial Number Valid
- * 1: SMART selt-test supported
- * 0: SMART error logging
- */
- u16 cfs_enable_1; /* (word 85)
- * command set-feature enabled
- * 15: Obsolete
- * 14: NOP command
- * 13: READ_BUFFER
- * 12: WRITE_BUFFER
- * 11: Obsolete
- * 10: Host Protected Area
- * 9: DEVICE Reset
- * 8: SERVICE Interrupt
- * 7: Release Interrupt
- * 6: look-ahead
- * 5: write cache
- * 4: PACKET Command
- * 3: Power Management Feature Set
- * 2: Removable Feature Set
- * 1: Security Feature Set
- * 0: SMART Feature Set
- */
- u16 cfs_enable_2; /* (word 86)
- * command set-feature enabled
- * 15: Shall be ZERO
- * 14: Shall be ONE
- * 13: FLUSH CACHE EXT
- * 12: FLUSH CACHE
- * 11: Device Configuration Overlay
- * 10: 48-bit Address Feature Set
- * 9: Automatic Acoustic Management
- * 8: SET MAX security
- * 7: reserved 1407DT PARTIES
- * 6: SetF sub-command Power-Up
- * 5: Power-Up in Standby Feature Set
- * 4: Removable Media Notification
- * 3: APM Feature Set
- * 2: CFA Feature Set
- * 1: READ/WRITE DMA QUEUED
- * 0: Download MicroCode
- */
- u16 csf_default; /* (word 87)
- * command set-feature default
- * 15: Shall be ZERO
- * 14: Shall be ONE
- * 13:3 reserved
- * 2: Media Serial Number Valid
- * 1: SMART selt-test supported
- * 0: SMART error logging
- */
- u16 dma_ultra; /* (word 88) */
- u16 word89; /* reserved (word 89) */
- u16 word90; /* reserved (word 90) */
- u16 CurAPMvalues; /* current APM values */
- u16 word92; /* reserved (word 92) */
- u16 hw_config; /* hardware config (word 93)
- * 15:
- * 14:
- * 13:
- * 12:
- * 11:
- * 10:
- * 9:
- * 8:
- * 7:
- * 6:
- * 5:
- * 4:
- * 3:
- * 2:
- * 1:
- * 0:
- */
- u16 acoustic; /* (word 94)
- * 15:8 Vendor's recommended value
- * 7:0 current value
- */
- u16 words95_99[5]; /* reserved words 95-99 */
- u64 lba_capacity_2; /* 48-bit total number of sectors */
- u16 words104_125[22];/* reserved words 104-125 */
- u16 last_lun; /* (word 126) */
- u16 word127; /* (word 127) Feature Set
- * Removable Media Notification
- * 15:2 reserved
- * 1:0 00 = not supported
- * 01 = supported
- * 10 = reserved
- * 11 = reserved
- */
- u16 dlf; /* (word 128)
- * device lock function
- * 15:9 reserved
- * 8 security level 1:max 0:high
- * 7:6 reserved
- * 5 enhanced erase
- * 4 expire
- * 3 frozen
- * 2 locked
- * 1 en/disabled
- * 0 capability
- */
- u16 csfo; /* (word 129)
- * current set features options
- * 15:4 reserved
- * 3: auto reassign
- * 2: reverting
- * 1: read-look-ahead
- * 0: write cache
- */
- u16 words130_155[26];/* reserved vendor words 130-155 */
- u16 word156; /* reserved vendor word 156 */
- u16 words157_159[3];/* reserved vendor words 157-159 */
- u16 cfa_power; /* (word 160) CFA Power Mode
- * 15 word 160 supported
- * 14 reserved
- * 13
- * 12
- * 11:0
- */
- u16 words161_175[14];/* Reserved for CFA */
- u16 words176_205[31];/* Current Media Serial Number */
- u16 words206_254[48];/* reserved words 206-254 */
- u16 integrity_word; /* (word 255)
- * 15:8 Checksum
- * 7:0 Signature
- */
-} __attribute__((packed));
-
-#define IDE_NICE_DSC_OVERLAP (0) /* per the DSC overlap protocol */
-
#endif
diff -durNp -X /tmp/diff.8vxI0X linux-2.5.29/include/linux/ide.h linux/include/linux/ide.h
--- linux-2.5.29/include/linux/ide.h 2002-07-27 04:58:31.000000000 +0200
+++ linux/include/linux/ide.h 2002-07-29 17:31:33.000000000 +0200
@@ -8,7 +8,6 @@
#include <linux/config.h>
#include <linux/init.h>
#include <linux/ioport.h>
-#include <linux/hdreg.h>
#include <linux/hdsmart.h>
#include <linux/blkdev.h>
#include <linux/proc_fs.h>
@@ -51,7 +50,460 @@
* "No user-serviceable parts" beyond this point
*****************************************************************************/
-typedef unsigned char byte; /* used everywhere */
+
+/* ATA/ATAPI Commands pre T13 Spec */
+#define WIN_NOP 0x00
+#define CFA_REQ_EXT_ERROR_CODE 0x03 /* CFA Request Extended Error Code */
+#define WIN_SRST 0x08 /* ATAPI soft reset command */
+#define WIN_DEVICE_RESET 0x08
+#define WIN_RESTORE 0x10
+#define WIN_READ 0x20 /* 28-Bit */
+#define WIN_READ_EXT 0x24 /* 48-Bit */
+#define WIN_READDMA_EXT 0x25 /* 48-Bit */
+#define WIN_READDMA_QUEUED_EXT 0x26 /* 48-Bit */
+#define WIN_READ_NATIVE_MAX_EXT 0x27 /* 48-Bit */
+#define WIN_MULTREAD_EXT 0x29 /* 48-Bit */
+#define WIN_WRITE 0x30 /* 28-Bit */
+#define WIN_WRITE_EXT 0x34 /* 48-Bit */
+#define WIN_WRITEDMA_EXT 0x35 /* 48-Bit */
+#define WIN_WRITEDMA_QUEUED_EXT 0x36 /* 48-Bit */
+#define WIN_SET_MAX_EXT 0x37 /* 48-Bit */
+#define CFA_WRITE_SECT_WO_ERASE 0x38 /* CFA Write Sectors without erase */
+#define WIN_MULTWRITE_EXT 0x39 /* 48-Bit */
+#define WIN_WRITE_VERIFY 0x3C /* 28-Bit */
+#define WIN_VERIFY 0x40 /* 28-Bit - Read Verify Sectors */
+#define WIN_VERIFY_EXT 0x42 /* 48-Bit */
+#define WIN_FORMAT 0x50
+#define WIN_INIT 0x60
+#define WIN_SEEK 0x70
+#define CFA_TRANSLATE_SECTOR 0x87 /* CFA Translate Sector */
+#define WIN_DIAGNOSE 0x90
+#define WIN_SPECIFY 0x91 /* set drive geometry translation */
+#define WIN_DOWNLOAD_MICROCODE 0x92
+#define WIN_STANDBYNOW2 0x94
+#define WIN_SETIDLE2 0x97
+#define WIN_CHECKPOWERMODE2 0x98
+#define WIN_SLEEPNOW2 0x99
+#define WIN_PACKETCMD 0xA0 /* Send a packet command. */
+#define WIN_PIDENTIFY 0xA1 /* identify ATAPI device */
+#define WIN_QUEUED_SERVICE 0xA2
+#define WIN_SMART 0xB0 /* self-monitoring and reporting */
+#define CFA_ERASE_SECTORS 0xC0
+#define WIN_MULTREAD 0xC4 /* read sectors using multiple mode*/
+#define WIN_MULTWRITE 0xC5 /* write sectors using multiple mode */
+#define WIN_SETMULT 0xC6 /* enable/disable multiple mode */
+#define WIN_READDMA_QUEUED 0xC7 /* read sectors using Queued DMA transfers */
+#define WIN_READDMA 0xC8 /* read sectors using DMA transfers */
+#define WIN_WRITEDMA 0xCA /* write sectors using DMA transfers */
+#define WIN_WRITEDMA_QUEUED 0xCC /* write sectors using Queued DMA transfers */
+#define CFA_WRITE_MULTI_WO_ERASE 0xCD /* CFA Write multiple without erase */
+#define WIN_GETMEDIASTATUS 0xDA
+#define WIN_DOORLOCK 0xDE /* lock door on removable drives */
+#define WIN_DOORUNLOCK 0xDF /* unlock door on removable drives */
+#define WIN_STANDBYNOW1 0xE0
+#define WIN_IDLEIMMEDIATE 0xE1 /* force drive to become "ready" */
+#define WIN_STANDBY 0xE2 /* Set device in Standby Mode */
+#define WIN_SETIDLE1 0xE3
+#define WIN_READ_BUFFER 0xE4 /* force read only 1 sector */
+#define WIN_CHECKPOWERMODE1 0xE5
+#define WIN_SLEEPNOW1 0xE6
+#define WIN_FLUSH_CACHE 0xE7
+#define WIN_WRITE_BUFFER 0xE8 /* force write only 1 sector */
+#define WIN_FLUSH_CACHE_EXT 0xEA /* 48-Bit */
+#define WIN_IDENTIFY 0xEC /* ask drive to identify itself */
+#define WIN_MEDIAEJECT 0xED
+#define WIN_IDENTIFY_DMA 0xEE /* same as WIN_IDENTIFY, but DMA */
+#define WIN_SETFEATURES 0xEF /* set special drive features */
+#define EXABYTE_ENABLE_NEST 0xF0
+#define WIN_SECURITY_SET_PASS 0xF1
+#define WIN_SECURITY_UNLOCK 0xF2
+#define WIN_SECURITY_ERASE_PREPARE 0xF3
+#define WIN_SECURITY_ERASE_UNIT 0xF4
+#define WIN_SECURITY_FREEZE_LOCK 0xF5
+#define WIN_SECURITY_DISABLE 0xF6
+#define WIN_READ_NATIVE_MAX 0xF8 /* return the native maximum address */
+#define WIN_SET_MAX 0xF9
+#define DISABLE_SEAGATE 0xFB
+
+/* WIN_SMART sub-commands */
+
+#define SMART_READ_VALUES 0xD0
+#define SMART_READ_THRESHOLDS 0xD1
+#define SMART_AUTOSAVE 0xD2
+#define SMART_SAVE 0xD3
+#define SMART_IMMEDIATE_OFFLINE 0xD4
+#define SMART_READ_LOG_SECTOR 0xD5
+#define SMART_WRITE_LOG_SECTOR 0xD6
+#define SMART_WRITE_THRESHOLDS 0xD7
+#define SMART_ENABLE 0xD8
+#define SMART_DISABLE 0xD9
+#define SMART_STATUS 0xDA
+#define SMART_AUTO_OFFLINE 0xDB
+
+/* Password used in TF4 & TF5 executing SMART commands */
+
+#define SMART_LCYL_PASS 0x4F
+#define SMART_HCYL_PASS 0xC2
+
+/* WIN_SETFEATURES sub-commands */
+
+#define SETFEATURES_EN_WCACHE 0x02 /* Enable write cache */
+
+#define SETFEATURES_XFER 0x03 /* Set transfer mode */
+# define XFER_UDMA_7 0x47 /* 0100|0111 */
+# define XFER_UDMA_6 0x46 /* 0100|0110 */
+# define XFER_UDMA_5 0x45 /* 0100|0101 */
+# define XFER_UDMA_4 0x44 /* 0100|0100 */
+# define XFER_UDMA_3 0x43 /* 0100|0011 */
+# define XFER_UDMA_2 0x42 /* 0100|0010 */
+# define XFER_UDMA_1 0x41 /* 0100|0001 */
+# define XFER_UDMA_0 0x40 /* 0100|0000 */
+# define XFER_MW_DMA_2 0x22 /* 0010|0010 */
+# define XFER_MW_DMA_1 0x21 /* 0010|0001 */
+# define XFER_MW_DMA_0 0x20 /* 0010|0000 */
+# define XFER_SW_DMA_2 0x12 /* 0001|0010 */
+# define XFER_SW_DMA_1 0x11 /* 0001|0001 */
+# define XFER_SW_DMA_0 0x10 /* 0001|0000 */
+# define XFER_PIO_4 0x0C /* 0000|1100 */
+# define XFER_PIO_3 0x0B /* 0000|1011 */
+# define XFER_PIO_2 0x0A /* 0000|1010 */
+# define XFER_PIO_1 0x09 /* 0000|1001 */
+# define XFER_PIO_0 0x08 /* 0000|1000 */
+# define XFER_PIO_SLOW 0x00 /* 0000|0000 */
+
+#define SETFEATURES_DIS_DEFECT 0x04 /* Disable Defect Management */
+#define SETFEATURES_EN_APM 0x05 /* Enable advanced power management */
+#define SETFEATURES_DIS_MSN 0x31 /* Disable Media Status Notification */
+#define SETFEATURES_EN_AAM 0x42 /* Enable Automatic Acoustic Management */
+#define SETFEATURES_DIS_RLA 0x55 /* Disable read look-ahead feature */
+#define SETFEATURES_EN_RI 0x5D /* Enable release interrupt */
+#define SETFEATURES_EN_SI 0x5E /* Enable SERVICE interrupt */
+#define SETFEATURES_DIS_RPOD 0x66 /* Disable reverting to power on defaults */
+#define SETFEATURES_DIS_WCACHE 0x82 /* Disable write cache */
+#define SETFEATURES_EN_DEFECT 0x84 /* Enable Defect Management */
+#define SETFEATURES_DIS_APM 0x85 /* Disable advanced power management */
+#define SETFEATURES_EN_MSN 0x95 /* Enable Media Status Notification */
+#define SETFEATURES_EN_RLA 0xAA /* Enable read look-ahead feature */
+#define SETFEATURES_PREFETCH 0xAB /* Sets drive prefetch value */
+#define SETFEATURES_DIS_AAM 0xC2 /* Disable Automatic Acoustic Management */
+#define SETFEATURES_EN_RPOD 0xCC /* Enable reverting to power on defaults */
+#define SETFEATURES_DIS_RI 0xDD /* Disable release interrupt */
+#define SETFEATURES_DIS_SI 0xDE /* Disable SERVICE interrupt */
+
+/* WIN_SECURITY sub-commands */
+
+#define SECURITY_SET_PASSWORD 0xBA
+#define SECURITY_UNLOCK 0xBB
+#define SECURITY_ERASE_PREPARE 0xBC
+#define SECURITY_ERASE_UNIT 0xBD
+#define SECURITY_FREEZE_LOCK 0xBE
+#define SECURITY_DISABLE_PASSWORD 0xBF
+
+
+/* Taskfile related constants.
+ */
+#define IDE_DRIVE_TASK_INVALID -1
+#define IDE_DRIVE_TASK_NO_DATA 0
+#define IDE_DRIVE_TASK_SET_XFER 1
+
+#define IDE_DRIVE_TASK_IN 2
+
+#define IDE_DRIVE_TASK_OUT 3
+#define IDE_DRIVE_TASK_RAW_WRITE 4
+
+struct hd_drive_task_hdr {
+ u8 feature;
+ u8 sector_count;
+ u8 sector_number;
+ u8 low_cylinder;
+ u8 high_cylinder;
+ u8 device_head;
+} __attribute__((packed));
+
+/*
+ * Define standard taskfile in/out register
+ */
+#define IDE_TASKFILE_STD_OUT_FLAGS 0xFE
+#define IDE_TASKFILE_STD_IN_FLAGS 0xFE
+#define IDE_HOB_STD_OUT_FLAGS 0xC0
+#define IDE_HOB_STD_IN_FLAGS 0xC0
+
+#define TASKFILE_INVALID 0x7fff
+#define TASKFILE_48 0x8000
+
+#define TASKFILE_NO_DATA 0x0000
+
+#define TASKFILE_IN 0x0001
+#define TASKFILE_MULTI_IN 0x0002
+
+#define TASKFILE_OUT 0x0004
+#define TASKFILE_MULTI_OUT 0x0008
+#define TASKFILE_IN_OUT 0x0010
+
+#define TASKFILE_IN_DMA 0x0020
+#define TASKFILE_OUT_DMA 0x0040
+#define TASKFILE_IN_DMAQ 0x0080
+#define TASKFILE_OUT_DMAQ 0x0100
+
+#define TASKFILE_P_IN 0x0200
+#define TASKFILE_P_OUT 0x0400
+#define TASKFILE_P_IN_DMA 0x0800
+#define TASKFILE_P_OUT_DMA 0x1000
+#define TASKFILE_P_IN_DMAQ 0x2000
+#define TASKFILE_P_OUT_DMAQ 0x4000
+
+/* bus states */
+enum {
+ BUSSTATE_OFF = 0,
+ BUSSTATE_ON,
+ BUSSTATE_TRISTATE
+};
+
+/*
+ * 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.
+ */
+struct hd_driveid {
+ u16 config; /* lots of obsolete bit flags */
+ u16 cyls; /* Obsolete, "physical" cyls */
+ u16 reserved2; /* reserved (word 2) */
+ u16 heads; /* Obsolete, "physical" heads */
+ u16 track_bytes; /* unformatted bytes per track */
+ u16 sector_bytes; /* unformatted bytes per sector */
+ u16 sectors; /* Obsolete, "physical" sectors per track */
+ u16 vendor0; /* vendor unique */
+ u16 vendor1; /* vendor unique */
+ u16 vendor2; /* Retired vendor unique */
+ u8 serial_no[20]; /* 0 = not_specified */
+ u16 buf_type; /* Retired */
+ u16 buf_size; /* Retired, 512 byte increments
+ * 0 = not_specified
+ */
+ u16 ecc_bytes; /* for r/w long cmds; 0 = not_specified */
+ u8 fw_rev[8]; /* 0 = not_specified */
+ char model[40]; /* 0 = not_specified */
+ u8 max_multsect; /* 0=not_implemented */
+ u8 vendor3; /* vendor unique */
+ u16 dword_io; /* 0=not_implemented; 1=implemented */
+ u8 vendor4; /* vendor unique */
+ u8 capability; /* (upper byte of word 49)
+ * 3: IORDYsup
+ * 2: IORDYsw
+ * 1: LBA
+ * 0: DMA
+ */
+ u16 reserved50; /* reserved (word 50) */
+ u8 vendor5; /* Obsolete, vendor unique */
+ u8 tPIO; /* Obsolete, 0=slow, 1=medium, 2=fast */
+ u8 vendor6; /* Obsolete, vendor unique */
+ u8 tDMA; /* Obsolete, 0=slow, 1=medium, 2=fast */
+ u16 field_valid; /* (word 53)
+ * 2: ultra_ok word 88
+ * 1: eide_ok words 64-70
+ * 0: cur_ok words 54-58
+ */
+ u16 cur_cyls; /* Obsolete, logical cylinders */
+ u16 cur_heads; /* Obsolete, l heads */
+ u16 cur_sectors; /* Obsolete, l sectors per track */
+ u16 cur_capacity0; /* Obsolete, l total sectors on drive */
+ u16 cur_capacity1; /* Obsolete, (2 words, misaligned int) */
+ u8 multsect; /* current multiple sector count */
+ u8 multsect_valid; /* when (bit0==1) multsect is ok */
+ u32 lba_capacity; /* Obsolete, total number of sectors */
+ u16 dma_1word; /* Obsolete, single-word dma info */
+ u16 dma_mword; /* multiple-word dma info */
+ u16 eide_pio_modes; /* bits 0:mode3 1:mode4 */
+ u16 eide_dma_min; /* min mword dma cycle time (ns) */
+ u16 eide_dma_time; /* recommended mword dma cycle time (ns) */
+ u16 eide_pio; /* min cycle time (ns), no IORDY */
+ u16 eide_pio_iordy; /* min cycle time (ns), with IORDY */
+ u16 words69_70[2]; /* reserved words 69-70
+ * future command overlap and queuing
+ */
+ /* HDIO_GET_IDENTITY currently returns only words 0 through 70 */
+ u16 words71_74[4]; /* reserved words 71-74
+ * for IDENTIFY PACKET DEVICE command
+ */
+ u16 queue_depth; /* (word 75)
+ * 15:5 reserved
+ * 4:0 Maximum queue depth -1
+ */
+ u16 words76_79[4]; /* reserved words 76-79 */
+ u16 major_rev_num; /* (word 80) */
+ u16 minor_rev_num; /* (word 81) */
+ u16 command_set_1; /* (word 82) supported
+ * 15: Obsolete
+ * 14: NOP command
+ * 13: READ_BUFFER
+ * 12: WRITE_BUFFER
+ * 11: Obsolete
+ * 10: Host Protected Area
+ * 9: DEVICE Reset
+ * 8: SERVICE Interrupt
+ * 7: Release Interrupt
+ * 6: look-ahead
+ * 5: write cache
+ * 4: PACKET Command
+ * 3: Power Management Feature Set
+ * 2: Removable Feature Set
+ * 1: Security Feature Set
+ * 0: SMART Feature Set
+ */
+ u16 command_set_2; /* (word 83)
+ * 15: Shall be ZERO
+ * 14: Shall be ONE
+ * 13: FLUSH CACHE EXT
+ * 12: FLUSH CACHE
+ * 11: Device Configuration Overlay
+ * 10: 48-bit Address Feature Set
+ * 9: Automatic Acoustic Management
+ * 8: SET MAX security
+ * 7: reserved 1407DT PARTIES
+ * 6: SetF sub-command Power-Up
+ * 5: Power-Up in Standby Feature Set
+ * 4: Removable Media Notification
+ * 3: APM Feature Set
+ * 2: CFA Feature Set
+ * 1: READ/WRITE DMA QUEUED
+ * 0: Download MicroCode
+ */
+ u16 cfsse; /* (word 84)
+ * cmd set-feature supported extensions
+ * 15: Shall be ZERO
+ * 14: Shall be ONE
+ * 13:3 reserved
+ * 2: Media Serial Number Valid
+ * 1: SMART selt-test supported
+ * 0: SMART error logging
+ */
+ u16 cfs_enable_1; /* (word 85)
+ * command set-feature enabled
+ * 15: Obsolete
+ * 14: NOP command
+ * 13: READ_BUFFER
+ * 12: WRITE_BUFFER
+ * 11: Obsolete
+ * 10: Host Protected Area
+ * 9: DEVICE Reset
+ * 8: SERVICE Interrupt
+ * 7: Release Interrupt
+ * 6: look-ahead
+ * 5: write cache
+ * 4: PACKET Command
+ * 3: Power Management Feature Set
+ * 2: Removable Feature Set
+ * 1: Security Feature Set
+ * 0: SMART Feature Set
+ */
+ u16 cfs_enable_2; /* (word 86)
+ * command set-feature enabled
+ * 15: Shall be ZERO
+ * 14: Shall be ONE
+ * 13: FLUSH CACHE EXT
+ * 12: FLUSH CACHE
+ * 11: Device Configuration Overlay
+ * 10: 48-bit Address Feature Set
+ * 9: Automatic Acoustic Management
+ * 8: SET MAX security
+ * 7: reserved 1407DT PARTIES
+ * 6: SetF sub-command Power-Up
+ * 5: Power-Up in Standby Feature Set
+ * 4: Removable Media Notification
+ * 3: APM Feature Set
+ * 2: CFA Feature Set
+ * 1: READ/WRITE DMA QUEUED
+ * 0: Download MicroCode
+ */
+ u16 csf_default; /* (word 87)
+ * command set-feature default
+ * 15: Shall be ZERO
+ * 14: Shall be ONE
+ * 13:3 reserved
+ * 2: Media Serial Number Valid
+ * 1: SMART selt-test supported
+ * 0: SMART error logging
+ */
+ u16 dma_ultra; /* (word 88) */
+ u16 word89; /* reserved (word 89) */
+ u16 word90; /* reserved (word 90) */
+ u16 CurAPMvalues; /* current APM values */
+ u16 word92; /* reserved (word 92) */
+ u16 hw_config; /* hardware config (word 93)
+ * 15:
+ * 14:
+ * 13:
+ * 12:
+ * 11:
+ * 10:
+ * 9:
+ * 8:
+ * 7:
+ * 6:
+ * 5:
+ * 4:
+ * 3:
+ * 2:
+ * 1:
+ * 0:
+ */
+ u16 acoustic; /* (word 94)
+ * 15:8 Vendor's recommended value
+ * 7:0 current value
+ */
+ u16 words95_99[5]; /* reserved words 95-99 */
+ u64 lba_capacity_2; /* 48-bit total number of sectors */
+ u16 words104_125[22];/* reserved words 104-125 */
+ u16 last_lun; /* (word 126) */
+ u16 word127; /* (word 127) Feature Set
+ * Removable Media Notification
+ * 15:2 reserved
+ * 1:0 00 = not supported
+ * 01 = supported
+ * 10 = reserved
+ * 11 = reserved
+ */
+ u16 dlf; /* (word 128)
+ * device lock function
+ * 15:9 reserved
+ * 8 security level 1:max 0:high
+ * 7:6 reserved
+ * 5 enhanced erase
+ * 4 expire
+ * 3 frozen
+ * 2 locked
+ * 1 en/disabled
+ * 0 capability
+ */
+ u16 csfo; /* (word 129)
+ * current set features options
+ * 15:4 reserved
+ * 3: auto reassign
+ * 2: reverting
+ * 1: read-look-ahead
+ * 0: write cache
+ */
+ u16 words130_155[26];/* reserved vendor words 130-155 */
+ u16 word156; /* reserved vendor word 156 */
+ u16 words157_159[3];/* reserved vendor words 157-159 */
+ u16 cfa_power; /* (word 160) CFA Power Mode
+ * 15 word 160 supported
+ * 14 reserved
+ * 13
+ * 12
+ * 11:0
+ */
+ u16 words161_175[14];/* Reserved for CFA */
+ u16 words176_205[31];/* Current Media Serial Number */
+ u16 words206_254[48];/* reserved words 206-254 */
+ u16 integrity_word; /* (word 255)
+ * 15:8 Checksum
+ * 7:0 Signature
+ */
+} __attribute__((packed));
+
+#define IDE_NICE_DSC_OVERLAP (0) /* per the DSC overlap protocol */
/*
* Probably not wise to fiddle with these
@@ -105,6 +557,35 @@ enum {
#define GET_ALTSTAT() IN_BYTE(drive->channel->io_ports[IDE_CONTROL_OFFSET])
#define GET_FEAT() IN_BYTE(IDE_NSECTOR_REG)
+/* Bits of HD_STATUS */
+#define ERR_STAT 0x01
+#define INDEX_STAT 0x02
+#define ECC_STAT 0x04 /* Corrected error */
+#define DRQ_STAT 0x08
+#define SEEK_STAT 0x10
+#define SERVICE_STAT SEEK_STAT
+#define WRERR_STAT 0x20
+#define READY_STAT 0x40
+#define BUSY_STAT 0x80
+
+/* Bits for HD_ERROR */
+#define MARK_ERR 0x01 /* Bad address mark */
+#define TRK0_ERR 0x02 /* couldn't find track 0 */
+#define ABRT_ERR 0x04 /* Command aborted */
+#define MCR_ERR 0x08 /* media change request */
+#define ID_ERR 0x10 /* ID field not found */
+#define MC_ERR 0x20 /* media changed */
+#define ECC_ERR 0x40 /* Uncorrectable ECC error */
+#define BBD_ERR 0x80 /* pre-EIDE meaning: block marked bad */
+#define ICRC_ERR 0x80 /* new meaning: CRC error during transfer */
+
+/*
+ * sector count bits
+ */
+#define NSEC_CD 0x01
+#define NSEC_IO 0x02
+#define NSEC_REL 0x04
+
#define BAD_R_STAT (BUSY_STAT | ERR_STAT)
#define BAD_W_STAT (BAD_R_STAT | WRERR_STAT)
#define BAD_STAT (BAD_R_STAT | DRQ_STAT)
Binary files linux-2.5.29/scripts/docproc and linux/scripts/docproc differ
Binary files linux-2.5.29/scripts/lxdialog/lxdialog and linux/scripts/lxdialog/lxdialog differ
^ permalink raw reply [flat|nested] 12+ messages in thread* Re: [PATCH] 2.5.29 IDE 108
2002-07-29 19:27 ` [PATCH] 2.5.29 IDE 108 Marcin Dalecki
@ 2002-07-30 11:02 ` Alan Cox
2002-07-30 9:45 ` Marcin Dalecki
0 siblings, 1 reply; 12+ messages in thread
From: Alan Cox @ 2002-07-30 11:02 UTC (permalink / raw)
To: martin; +Cc: Linus Torvalds, Kernel Mailing List
On Mon, 2002-07-29 at 20:27, Marcin Dalecki wrote:
> - Fixup cmd640 fix by LT.
The CMD640 fix is wrong. You must take pci_lock to protected the cmd640
pci access functions. You also need to check if conf1/conf2 is available
otherwise you will crash some systems when the driver init runs (found
by Justin Gibbs at Adaptec). I sent Linus the proper patch for this a
few days ago and cc'd the list.
Basically conf1/conf2 is protected elsewhere in the kernel via arch
specific locks and via a higher level config lock. Since the non x86
folks use CMD640 we have to take the higher level lock.
Alan
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH] 2.5.29 IDE 108
2002-07-30 11:02 ` Alan Cox
@ 2002-07-30 9:45 ` Marcin Dalecki
0 siblings, 0 replies; 12+ messages in thread
From: Marcin Dalecki @ 2002-07-30 9:45 UTC (permalink / raw)
To: Alan Cox; +Cc: martin, Linus Torvalds, Kernel Mailing List
Alan Cox wrote:
> On Mon, 2002-07-29 at 20:27, Marcin Dalecki wrote:
>
>>- Fixup cmd640 fix by LT.
>
>
> The CMD640 fix is wrong. You must take pci_lock to protected the cmd640
> pci access functions. You also need to check if conf1/conf2 is available
> otherwise you will crash some systems when the driver init runs (found
> by Justin Gibbs at Adaptec). I sent Linus the proper patch for this a
> few days ago and cc'd the list.
>
> Basically conf1/conf2 is protected elsewhere in the kernel via arch
> specific locks and via a higher level config lock. Since the non x86
> folks use CMD640 we have to take the higher level lock.
Yes I know. However I see the bk-tree drifting and therefore I have
postponed the integration of your patch a bit. The chunk above I did
immediately after 2.5.29 release. Hope this explains. OK?
^ permalink raw reply [flat|nested] 12+ messages in thread
* [PATCH] 2.5.29 IDE 109
2002-07-27 3:12 Linux v2.5.29 Linus Torvalds
` (4 preceding siblings ...)
2002-07-29 19:27 ` [PATCH] 2.5.29 IDE 108 Marcin Dalecki
@ 2002-07-29 20:51 ` Marcin Dalecki
2002-07-30 10:59 ` Alan Cox
5 siblings, 1 reply; 12+ messages in thread
From: Marcin Dalecki @ 2002-07-29 20:51 UTC (permalink / raw)
To: Linus Torvalds; +Cc: Kernel Mailing List
[-- Attachment #1: Type: text/plain, Size: 377 bytes --]
- Include first cut by Adam J. Richter on proper lock protection for
tuning functions.
- Rename ide_register_subdriver() to ata_register_device() and
ide_unregister_subdriver() accordingly to ata_unregister_device(),
since this is reflecting better what those functions are about.
- Remove tons of "curicum vite" style useless documentation here and
there.
[-- Attachment #2: ide-109.diff --]
[-- Type: text/plain, Size: 49243 bytes --]
diff -durNp -X /tmp/diff.X8zbex linux-2.5.29/Documentation/ide.txt linux/Documentation/ide.txt
--- linux-2.5.29/Documentation/ide.txt 2002-07-27 04:58:29.000000000 +0200
+++ linux/Documentation/ide.txt 2002-07-29 22:14:20.000000000 +0200
@@ -1,9 +1,6 @@
-
-
Information regarding the Enhanced IDE drive in Linux 2.5
-
==============================================================================
@@ -303,6 +300,53 @@ Everything else is rejected with a "BAD
================================================================================
+IDE ATAPI streaming tape driver
+-------------------------------
+
+This driver is a part of the Linux ide driver and works in co-operation
+with linux/drivers/block/ide.c.
+
+The driver, in co-operation with ide.c, basically traverses the
+request-list for the block device interface. The character device
+interface, on the other hand, creates new requests, adds them
+to the request-list of the block device, and waits for their completion.
+
+Pipelined operation mode is now supported on both reads and writes.
+
+The block device major and minor numbers are determined from the
+tape's relative position in the ide interfaces, as explained in ide.c.
+
+The character device interface consists of the following devices:
+
+ ht0 major 37, minor 0 first IDE tape, rewind on close.
+ ht1 major 37, minor 1 second IDE tape, rewind on close.
+ ...
+ nht0 major 37, minor 128 first IDE tape, no rewind on close.
+ nht1 major 37, minor 129 second IDE tape, no rewind on close.
+ ...
+
+Run linux/scripts/MAKEDEV.ide to create the above entries.
+
+The general magnetic tape commands compatible interface, as defined by
+include/linux/mtio.h, is accessible through the character device.
+
+General ide driver configuration options, such as the interrupt-unmask
+flag, can be configured by issuing an ioctl to the block device interface,
+as any other ide device.
+
+Our own ide-tape ioctl's can be issued to either the block device or
+the character device interface.
+
+Maximal throughput with minimal bus load will usually be achieved in the
+following scenario:
+
+ 1. ide-tape is operating in the pipelined operation mode.
+ 2. No buffering is performed by the user backup program.
+
+
+
+================================================================================
+
Some Terminology
----------------
IDE = Integrated Drive Electronics, meaning that each drive has a built-in
diff -durNp -X /tmp/diff.X8zbex linux-2.5.29/drivers/ide/ali14xx.c linux/drivers/ide/ali14xx.c
--- linux-2.5.29/drivers/ide/ali14xx.c 2002-07-27 04:58:37.000000000 +0200
+++ linux/drivers/ide/ali14xx.c 2002-07-29 21:35:50.000000000 +0200
@@ -107,13 +107,14 @@ static inline void out_reg(u8 data, u8 r
* Set PIO mode for the specified drive.
* This function computes timing parameters
* and sets controller registers accordingly.
+ * It assumes IRQ's are disabled or at least that no other process will
+ * attempt to access the IDE registers concurrently.
*/
static void ali14xx_tune_drive(struct ata_device *drive, u8 pio)
{
int drive_num;
int time1, time2;
u8 param1, param2, param3, param4;
- unsigned long flags;
struct ata_timing *t;
if (pio == 255)
@@ -140,15 +141,12 @@ static void ali14xx_tune_drive(struct at
/* stuff timing parameters into controller registers */
drive_num = (drive->channel->index << 1) + drive->select.b.unit;
- save_flags(flags); /* all CPUs */
- cli(); /* all CPUs */
outb_p(reg_on, base_port);
out_reg(param1, reg_tab[drive_num].reg1);
out_reg(param2, reg_tab[drive_num].reg2);
out_reg(param3, reg_tab[drive_num].reg3);
out_reg(param4, reg_tab[drive_num].reg4);
outb_p(reg_off, base_port);
- restore_flags(flags); /* all CPUs */
}
/*
diff -durNp -X /tmp/diff.X8zbex linux-2.5.29/drivers/ide/cs5530.c linux/drivers/ide/cs5530.c
--- linux-2.5.29/drivers/ide/cs5530.c 2002-07-27 04:58:39.000000000 +0200
+++ linux/drivers/ide/cs5530.c 2002-07-29 21:35:50.000000000 +0200
@@ -227,8 +227,8 @@ static unsigned int __init pci_init_cs55
return 0;
}
- save_flags(flags);
- cli(); /* all CPUs (there should only be one CPU with this chipset) */
+ local_irq_save(flags); /* There should only be one CPU with this
+ chipset. */
/*
* Enable BusMaster and MemoryWriteAndInvalidate for the cs5530:
@@ -274,7 +274,7 @@ static unsigned int __init pci_init_cs55
pci_write_config_byte(master_0, 0x42, 0x00);
pci_write_config_byte(master_0, 0x43, 0xc1);
- restore_flags(flags);
+ local_irq_restore(flags);
return 0;
}
diff -durNp -X /tmp/diff.X8zbex linux-2.5.29/drivers/ide/dtc2278.c linux/drivers/ide/dtc2278.c
--- linux-2.5.29/drivers/ide/dtc2278.c 2002-07-27 04:58:37.000000000 +0200
+++ linux/drivers/ide/dtc2278.c 2002-07-29 21:35:50.000000000 +0200
@@ -66,21 +66,18 @@ static void sub22 (char b, char c)
}
}
+/* Assumes IRQ's are disabled or at least that no other process will
+ attempt to access the IDE registers concurrently. */
static void tune_dtc2278(struct ata_device *drive, u8 pio)
{
- unsigned long flags;
-
pio = ata_timing_mode(drive, XFER_PIO | XFER_EPIO) - XFER_PIO_0;
if (pio >= 3) {
- save_flags(flags); /* all CPUs */
- cli(); /* all CPUs */
/*
* This enables PIO mode4 (3?) on the first interface
*/
sub22(1,0xc3);
sub22(0,0xa0);
- restore_flags(flags); /* all CPUs */
} else {
/* we don't know how to set it back again.. */
}
diff -durNp -X /tmp/diff.X8zbex linux-2.5.29/drivers/ide/ht6560b.c linux/drivers/ide/ht6560b.c
--- linux-2.5.29/drivers/ide/ht6560b.c 2002-07-27 04:58:31.000000000 +0200
+++ linux/drivers/ide/ht6560b.c 2002-07-29 21:43:52.000000000 +0200
@@ -249,12 +249,8 @@ static u8 ht_pio2timings(struct ata_devi
*/
static void ht_set_prefetch(struct ata_device *drive, u8 state)
{
- unsigned long flags;
int t = HT_PREFETCH_MODE << 8;
- save_flags (flags); /* all CPUs */
- cli(); /* all CPUs */
-
/*
* Prefetch mode and unmask irq seems to conflict
*/
@@ -267,16 +263,16 @@ static void ht_set_prefetch(struct ata_d
drive->channel->no_unmask = 0;
}
- restore_flags (flags); /* all CPUs */
-
#ifdef DEBUG
printk("ht6560b: drive %s prefetch mode %sabled\n", drive->name, (state ? "en" : "dis"));
#endif
}
+/* Assumes IRQ's are disabled or at least that no other process will attempt to
+ * access the IDE registers concurrently.
+ */
static void tune_ht6560b(struct ata_device *drive, u8 pio)
{
- unsigned long flags;
u8 timing;
switch (pio) {
@@ -288,14 +284,9 @@ static void tune_ht6560b(struct ata_devi
timing = ht_pio2timings(drive, pio);
- save_flags (flags); /* all CPUs */
- cli(); /* all CPUs */
-
drive->drive_data &= 0xff00;
drive->drive_data |= timing;
- restore_flags (flags); /* all CPUs */
-
#ifdef DEBUG
printk("ht6560b: drive %s tuned to pio mode %#x timing=%#x\n", drive->name, pio, timing);
#endif
diff -durNp -X /tmp/diff.X8zbex linux-2.5.29/drivers/ide/ide-cd.c linux/drivers/ide/ide-cd.c
--- linux-2.5.29/drivers/ide/ide-cd.c 2002-07-29 21:27:35.000000000 +0200
+++ linux/drivers/ide/ide-cd.c 2002-07-29 22:18:01.000000000 +0200
@@ -2915,7 +2915,7 @@ int ide_cdrom_cleanup(struct ata_device
struct cdrom_info *info = drive->driver_data;
struct cdrom_device_info *devinfo = &info->devinfo;
- if (ide_unregister_subdriver (drive))
+ if (ata_unregister_device(drive))
return 1;
if (info->buffer != NULL)
kfree(info->buffer);
@@ -2974,7 +2974,7 @@ static void ide_cdrom_attach(struct ata_
printk(KERN_ERR "%s: Can't allocate a cdrom structure\n", drive->name);
return;
}
- if (ide_register_subdriver (drive, &ide_cdrom_driver)) {
+ if (ata_register_device(drive, &ide_cdrom_driver)) {
printk(KERN_ERR "%s: Failed to register the driver with ide.c\n", drive->name);
kfree (info);
return;
diff -durNp -X /tmp/diff.X8zbex linux-2.5.29/drivers/ide/ide-disk.c linux/drivers/ide/ide-disk.c
--- linux-2.5.29/drivers/ide/ide-disk.c 2002-07-27 04:58:24.000000000 +0200
+++ linux/drivers/ide/ide-disk.c 2002-07-29 22:17:16.000000000 +0200
@@ -1279,7 +1279,7 @@ static int idedisk_cleanup(struct ata_de
printk (KERN_INFO "%s: Write Cache FAILED Flushing!\n",
drive->name);
}
- ret = ide_unregister_subdriver(drive);
+ ret = ata_unregister_device(drive);
/* FIXME: This is killing the kernel with BUG 185 at asm/spinlocks.h
* horribly. Check whatever we did REGISTER the device properly
@@ -1471,8 +1471,8 @@ static void idedisk_attach(struct ata_de
if (req[0] != '\0' && strcmp(req, "ide-disk"))
return;
- if (ide_register_subdriver(drive, &idedisk_driver)) {
- printk (KERN_ERR "ide-disk: %s: Failed to register the driver with ide.c\n", drive->name);
+ if (ata_register_device(drive, &idedisk_driver)) {
+ printk(KERN_ERR "%s: Failed to register the driver with ide.c\n", drive->name);
return;
}
diff -durNp -X /tmp/diff.X8zbex linux-2.5.29/drivers/ide/ide-floppy.c linux/drivers/ide/ide-floppy.c
--- linux-2.5.29/drivers/ide/ide-floppy.c 2002-07-29 21:27:35.000000000 +0200
+++ linux/drivers/ide/ide-floppy.c 2002-07-29 22:17:48.000000000 +0200
@@ -1723,10 +1723,10 @@ static int idefloppy_cleanup(struct ata_
{
idefloppy_floppy_t *floppy = drive->driver_data;
- if (ide_unregister_subdriver (drive))
+ if (ata_unregister_device(drive))
return 1;
drive->driver_data = NULL;
- kfree (floppy);
+ kfree(floppy);
return 0;
}
@@ -1780,7 +1780,7 @@ static void idefloppy_attach(struct ata_
drive->name);
return;
}
- if (ide_register_subdriver(drive, &idefloppy_driver)) {
+ if (ata_register_device(drive, &idefloppy_driver)) {
printk(KERN_ERR "ide-floppy: %s: Failed to register the driver with ide.c\n", drive->name);
kfree (floppy);
return;
diff -durNp -X /tmp/diff.X8zbex linux-2.5.29/drivers/ide/ide-tape.c linux/drivers/ide/ide-tape.c
--- linux-2.5.29/drivers/ide/ide-tape.c 2002-07-29 21:27:35.000000000 +0200
+++ linux/drivers/ide/ide-tape.c 2002-07-29 22:17:27.000000000 +0200
@@ -7,401 +7,18 @@
*
* It is hereby placed under the terms of the GNU general public license.
* (See linux/COPYING).
- */
-
-/*
- * BIG FAT FIXME: clean tape->spinlock locking --bzolnier
- */
-
-/*
- * IDE ATAPI streaming tape driver.
- *
- * This driver is a part of the Linux ide driver and works in co-operation
- * with linux/drivers/block/ide.c.
- *
- * The driver, in co-operation with ide.c, basically traverses the
- * request-list for the block device interface. The character device
- * interface, on the other hand, creates new requests, adds them
- * to the request-list of the block device, and waits for their completion.
- *
- * Pipelined operation mode is now supported on both reads and writes.
- *
- * The block device major and minor numbers are determined from the
- * tape's relative position in the ide interfaces, as explained in ide.c.
- *
- * The character device interface consists of the following devices:
- *
- * ht0 major 37, minor 0 first IDE tape, rewind on close.
- * ht1 major 37, minor 1 second IDE tape, rewind on close.
- * ...
- * nht0 major 37, minor 128 first IDE tape, no rewind on close.
- * nht1 major 37, minor 129 second IDE tape, no rewind on close.
- * ...
- *
- * Run linux/scripts/MAKEDEV.ide to create the above entries.
- *
- * The general magnetic tape commands compatible interface, as defined by
- * include/linux/mtio.h, is accessible through the character device.
- *
- * General ide driver configuration options, such as the interrupt-unmask
- * flag, can be configured by issuing an ioctl to the block device interface,
- * as any other ide device.
*
- * Our own ide-tape ioctl's can be issued to either the block device or
- * the character device interface.
- *
- * Maximal throughput with minimal bus load will usually be achieved in the
- * following scenario:
- *
- * 1. ide-tape is operating in the pipelined operation mode.
- * 2. No buffering is performed by the user backup program.
- *
- * Testing was done with a 2 GB CONNER CTMA 4000 IDE ATAPI Streaming Tape Drive.
- *
- * Ver 0.1 Nov 1 95 Pre-working code :-)
- * Ver 0.2 Nov 23 95 A short backup (few megabytes) and restore procedure
- * was successful ! (Using tar cvf ... on the block
- * device interface).
- * A longer backup resulted in major swapping, bad
- * overall Linux performance and eventually failed as
- * we received non serial read-ahead requests from the
- * buffer cache.
- * Ver 0.3 Nov 28 95 Long backups are now possible, thanks to the
- * character device interface. Linux's responsiveness
- * and performance doesn't seem to be much affected
- * from the background backup procedure.
- * Some general mtio.h magnetic tape operations are
- * now supported by our character device. As a result,
- * popular tape utilities are starting to work with
- * ide tapes :-)
- * The following configurations were tested:
- * 1. An IDE ATAPI TAPE shares the same interface
- * and irq with an IDE ATAPI CDROM.
- * 2. An IDE ATAPI TAPE shares the same interface
- * and irq with a normal IDE disk.
- * Both configurations seemed to work just fine !
- * However, to be on the safe side, it is meanwhile
- * recommended to give the IDE TAPE its own interface
- * and irq.
- * The one thing which needs to be done here is to
- * add a "request postpone" feature to ide.c,
- * so that we won't have to wait for the tape to finish
- * performing a long media access (DSC) request (such
- * as a rewind) before we can access the other device
- * on the same interface. This effect doesn't disturb
- * normal operation most of the time because read/write
- * requests are relatively fast, and once we are
- * performing one tape r/w request, a lot of requests
- * from the other device can be queued and ide.c will
- * service all of them after this single tape request.
- * Ver 1.0 Dec 11 95 Integrated into Linux 1.3.46 development tree.
- * On each read / write request, we now ask the drive
- * if we can transfer a constant number of bytes
- * (a parameter of the drive) only to its buffers,
- * without causing actual media access. If we can't,
- * we just wait until we can by polling the DSC bit.
- * This ensures that while we are not transferring
- * more bytes than the constant referred to above, the
- * interrupt latency will not become too high and
- * we won't cause an interrupt timeout, as happened
- * occasionally in the previous version.
- * While polling for DSC, the current request is
- * postponed and ide.c is free to handle requests from
- * the other device. This is handled transparently to
- * ide.c. The hwgroup locking method which was used
- * in the previous version was removed.
- * Use of new general features which are provided by
- * ide.c for use with atapi devices.
- * (Programming done by Mark Lord)
- * Few potential bug fixes (Again, suggested by Mark)
- * Single character device data transfers are now
- * not limited in size, as they were before.
- * We are asking the tape about its recommended
- * transfer unit and send a larger data transfer
- * as several transfers of the above size.
- * For best results, use an integral number of this
- * basic unit (which is shown during driver
- * initialization). I will soon add an ioctl to get
- * this important parameter.
- * Our data transfer buffer is allocated on startup,
- * rather than before each data transfer. This should
- * ensure that we will indeed have a data buffer.
- * Ver 1.1 Dec 14 95 Fixed random problems which occurred when the tape
- * shared an interface with another device.
- * (poll_for_dsc was a complete mess).
- * Removed some old (non-active) code which had
- * to do with supporting buffer cache originated
- * requests.
- * The block device interface can now be opened, so
- * that general ide driver features like the unmask
- * interrupts flag can be selected with an ioctl.
- * This is the only use of the block device interface.
- * New fast pipelined operation mode (currently only on
- * writes). When using the pipelined mode, the
- * throughput can potentially reach the maximum
- * tape supported throughput, regardless of the
- * user backup program. On my tape drive, it sometimes
- * boosted performance by a factor of 2. Pipelined
- * mode is enabled by default, but since it has a few
- * downfalls as well, you may want to disable it.
- * A short explanation of the pipelined operation mode
- * is available below.
- * Ver 1.2 Jan 1 96 Eliminated pipelined mode race condition.
- * Added pipeline read mode. As a result, restores
- * are now as fast as backups.
- * Optimized shared interface behavior. The new behavior
- * typically results in better IDE bus efficiency and
- * higher tape throughput.
- * Pre-calculation of the expected read/write request
- * service time, based on the tape's parameters. In
- * the pipelined operation mode, this allows us to
- * adjust our polling frequency to a much lower value,
- * and thus to dramatically reduce our load on Linux,
- * without any decrease in performance.
- * Implemented additional mtio.h operations.
- * The recommended user block size is returned by
- * the MTIOCGET ioctl.
- * Additional minor changes.
- * Ver 1.3 Feb 9 96 Fixed pipelined read mode bug which prevented the
- * use of some block sizes during a restore procedure.
- * The character device interface will now present a
- * continuous view of the media - any mix of block sizes
- * during a backup/restore procedure is supported. The
- * driver will buffer the requests internally and
- * convert them to the tape's recommended transfer
- * unit, making performance almost independent of the
- * chosen user block size.
- * Some improvements in error recovery.
- * By cooperating with ide-dma.c, bus mastering DMA can
- * now sometimes be used with IDE tape drives as well.
- * Bus mastering DMA has the potential to dramatically
- * reduce the CPU's overhead when accessing the device,
- * and can be enabled by using hdparm -d1 on the tape's
- * block device interface. For more info, read the
- * comments in ide-dma.c.
- * Ver 1.4 Mar 13 96 Fixed serialize support.
- * Ver 1.5 Apr 12 96 Fixed shared interface operation, broken in 1.3.85.
- * Fixed pipelined read mode inefficiency.
- * Fixed nasty null dereferencing bug.
- * Ver 1.6 Aug 16 96 Fixed FPU usage in the driver.
- * Fixed end of media bug.
- * Ver 1.7 Sep 10 96 Minor changes for the CONNER CTT8000-A model.
- * Ver 1.8 Sep 26 96 Attempt to find a better balance between good
- * interactive response and high system throughput.
- * Ver 1.9 Nov 5 96 Automatically cross encountered filemarks rather
- * than requiring an explicit FSF command.
- * Abort pending requests at end of media.
- * MTTELL was sometimes returning incorrect results.
- * Return the real block size in the MTIOCGET ioctl.
- * Some error recovery bug fixes.
- * Ver 1.10 Nov 5 96 Major reorganization.
- * Reduced CPU overhead a bit by eliminating internal
- * bounce buffers.
- * Added module support.
- * Added multiple tape drives support.
- * Added partition support.
- * Rewrote DSC handling.
- * Some portability fixes.
- * Removed ide-tape.h.
- * Additional minor changes.
- * Ver 1.11 Dec 2 96 Bug fix in previous DSC timeout handling.
- * Use ide_stall_queue() for DSC overlap.
- * Use the maximum speed rather than the current speed
- * to compute the request service time.
- * Ver 1.12 Dec 7 97 Fix random memory overwriting and/or last block data
- * corruption, which could occur if the total number
- * of bytes written to the tape was not an integral
- * number of tape blocks.
- * Add support for INTERRUPT DRQ devices.
- * Ver 1.13 Jan 2 98 Add "speed == 0" work-around for HP COLORADO 5GB
- * Ver 1.14 Dec 30 98 Partial fixes for the Sony/AIWA tape drives.
- * Replace cli()/sti() with hwgroup spinlocks.
- * Ver 1.15 Mar 25 99 Fix SMP race condition by replacing hwgroup
- * spinlock with private per-tape spinlock.
- * Ver 1.16 Sep 1 99 Add OnStream tape support.
- * Abort read pipeline on EOD.
- * Wait for the tape to become ready in case it returns
- * "in the process of becoming ready" on open().
- * Fix zero padding of the last written block in
- * case the tape block size is larger than PAGE_SIZE.
- * Decrease the default disconnection time to tn.
- * Ver 1.16e Oct 3 99 Minor fixes.
- * Ver 1.16e1 Oct 13 99 Patches by Arnold Niessen,
- * niessen@iae.nl / arnold.niessen@philips.com
- * GO-1) Undefined code in idetape_read_position
- * according to Gadi's email
- * AJN-1) Minor fix asc == 11 should be asc == 0x11
- * in idetape_issue_packet_command (did effect
- * debugging output only)
- * AJN-2) Added more debugging output, and
- * added ide-tape: where missing. I would also
- * like to add tape->name where possible
- * AJN-3) Added different debug_level's
- * via /proc/ide/hdc/settings
- * "debug_level" determines amount of debugging output;
- * can be changed using /proc/ide/hdx/settings
- * 0 : almost no debugging output
- * 1 : 0+output errors only
- * 2 : 1+output all sensekey/asc
- * 3 : 2+follow all chrdev related procedures
- * 4 : 3+follow all procedures
- * 5 : 4+include pc_stack rq_stack info
- * 6 : 5+USE_COUNT updates
- * AJN-4) Fixed timeout for retension in idetape_queue_pc_tail
- * from 5 to 10 minutes
- * AJN-5) Changed maximum number of blocks to skip when
- * reading tapes with multiple consecutive write
- * errors from 100 to 1000 in idetape_get_logical_blk
- * Proposed changes to code:
- * 1) output "logical_blk_num" via /proc
- * 2) output "current_operation" via /proc
- * 3) Either solve or document the fact that `mt rewind' is
- * required after reading from /dev/nhtx to be
- * able to rmmod the idetape module;
- * Also, sometimes an application finishes but the
- * device remains `busy' for some time. Same cause ?
- * Proposed changes to release-notes:
- * 4) write a simple `quickstart' section in the
- * release notes; I volunteer if you don't want to
- * 5) include a pointer to video4linux in the doc
- * to stimulate video applications
- * 6) release notes lines 331 and 362: explain what happens
- * if the application data rate is higher than 1100 KB/s;
- * similar approach to lower-than-500 kB/s ?
- * 7) 6.6 Comparison; wouldn't it be better to allow different
- * strategies for read and write ?
- * Wouldn't it be better to control the tape buffer
- * contents instead of the bandwidth ?
- * 8) line 536: replace will by would (if I understand
- * this section correctly, a hypothetical and unwanted situation
- * is being described)
- * Ver 1.16f Dec 15 99 Change place of the secondary OnStream header frames.
- * Ver 1.17 Nov 2000 / Jan 2001 Marcel Mol, marcel@mesa.nl
- * - Add idetape_onstream_mode_sense_tape_parameter_page
- * function to get tape capacity in frames: tape->capacity.
- * - Add support for DI-50 drives( or any DI- drive).
- * - 'workaround' for read error/blank block arround block 3000.
- * - Implement Early warning for end of media for Onstream.
- * - Cosmetic code changes for readability.
- * - Idetape_position_tape should not use SKIP bit during
- * Onstream read recovery.
- * - Add capacity, logical_blk_num and first/last_frame_position
- * to /proc/ide/hd?/settings.
- * - Module use count was gone in the Linux 2.4 driver.
- * Ver 1.17a Apr 2001 Willem Riede osst@riede.org
- * - Get drive's actual block size from mode sense block descriptor
- * - Limit size of pipeline
- *
- * Here are some words from the first releases of hd.c, which are quoted
- * in ide.c and apply here as well:
- *
- * | Special care is recommended. Have Fun!
- *
- */
-
-/*
- * An overview of the pipelined operation mode.
- *
- * In the pipelined write mode, we will usually just add requests to our
- * pipeline and return immediately, before we even start to service them. The
- * user program will then have enough time to prepare the next request while
- * we are still busy servicing previous requests. In the pipelined read mode,
- * the situation is similar - we add read-ahead requests into the pipeline,
- * before the user even requested them.
- *
- * The pipeline can be viewed as a "safety net" which will be activated when
- * the system load is high and prevents the user backup program from keeping up
- * with the current tape speed. At this point, the pipeline will get
- * shorter and shorter but the tape will still be streaming at the same speed.
- * Assuming we have enough pipeline stages, the system load will hopefully
- * decrease before the pipeline is completely empty, and the backup program
- * will be able to "catch up" and refill the pipeline again.
- *
- * When using the pipelined mode, it would be best to disable any type of
- * buffering done by the user program, as ide-tape already provides all the
- * benefits in the kernel, where it can be done in a more efficient way.
- * As we will usually not block the user program on a request, the most
- * efficient user code will then be a simple read-write-read-... cycle.
- * Any additional logic will usually just slow down the backup process.
- *
- * Using the pipelined mode, I get a constant over 400 KBps throughput,
- * which seems to be the maximum throughput supported by my tape.
- *
- * However, there are some downfalls:
- *
- * 1. We use memory (for data buffers) in proportional to the number
- * of pipeline stages (each stage is about 26 KB with my tape).
- * 2. In the pipelined write mode, we cheat and postpone error codes
- * to the user task. In read mode, the actual tape position
- * will be a bit further than the last requested block.
- *
- * Concerning (1):
- *
- * 1. We allocate stages dynamically only when we need them. When
- * we don't need them, we don't consume additional memory. In
- * case we can't allocate stages, we just manage without them
- * (at the expense of decreased throughput) so when Linux is
- * tight in memory, we will not pose additional difficulties.
- *
- * 2. The maximum number of stages (which is, in fact, the maximum
- * amount of memory) which we allocate is limited by the compile
- * time parameter IDETAPE_MAX_PIPELINE_STAGES.
- *
- * 3. The maximum number of stages is a controlled parameter - We
- * don't start from the user defined maximum number of stages
- * but from the lower IDETAPE_MIN_PIPELINE_STAGES (again, we
- * will not even allocate this amount of stages if the user
- * program can't handle the speed). We then implement a feedback
- * loop which checks if the pipeline is empty, and if it is, we
- * increase the maximum number of stages as necessary until we
- * reach the optimum value which just manages to keep the tape
- * busy with minimum allocated memory or until we reach
- * IDETAPE_MAX_PIPELINE_STAGES.
- *
- * Concerning (2):
- *
- * In pipelined write mode, ide-tape can not return accurate error codes
- * to the user program since we usually just add the request to the
- * pipeline without waiting for it to be serviced. In case an error
- * occurs, I will report it on the next user request.
- *
- * In the pipelined read mode, subsequent read requests or forward
- * filemark spacing will perform correctly, as we preserve all blocks
- * and filemarks which we encountered during our excess read-ahead.
- *
- * For accurate tape positioning and error reporting, disabling
- * pipelined mode might be the best option.
+ * Contributors:
*
- * You can enable/disable/tune the pipelined operation mode by adjusting
- * the compile time parameters below.
+ * Oct 1999 Arnold Niessen, <niessen@iae.nl>, <arnold.niessen@philips.com>
+ * Nov 2000, Jan 2001 Marcel Mol, <marcel@mesa.nl>
+ * Apr 2001 Willem Riede, <osst@riede.org>
*/
/*
- * Possible improvements.
- *
- * 1. Support for the ATAPI overlap protocol.
- *
- * In order to maximize bus throughput, we currently use the DSC
- * overlap method which enables ide.c to service requests from the
- * other device while the tape is busy executing a command. The
- * DSC overlap method involves polling the tape's status register
- * for the DSC bit, and servicing the other device while the tape
- * isn't ready.
- *
- * In the current QIC development standard (December 1995),
- * it is recommended that new tape drives will *in addition*
- * implement the ATAPI overlap protocol, which is used for the
- * same purpose - efficient use of the IDE bus, but is interrupt
- * driven and thus has much less CPU overhead.
- *
- * ATAPI overlap is likely to be supported in most new ATAPI
- * devices, including new ATAPI cdroms, and thus provides us
- * a method by which we can achieve higher throughput when
- * sharing a (fast) ATA-2 disk with any (slow) new ATAPI device.
+ * FIXME: clean tape->spinlock locking --bzolnier
*/
-#define IDETAPE_VERSION "1.17a"
-
#include <linux/config.h>
#include <linux/module.h>
#include <linux/types.h>
@@ -446,6 +63,7 @@
#define OS_DATA_STARTFRAME1 20
#define OS_DATA_ENDFRAME1 2980
+
/*
* partition
*/
@@ -5893,18 +5511,17 @@ static int idetape_cleanup(struct ata_de
int minor = tape->minor;
unsigned long flags;
- save_flags (flags); /* all CPUs (overkill?) */
- cli(); /* all CPUs (overkill?) */
+ spin_lock_irqsave (&tape->spinlock, flags); /* overkill? */
if (test_bit (IDETAPE_BUSY, &tape->flags) || tape->first_stage != NULL || tape->merge_stage_size || drive->usage) {
- restore_flags(flags); /* all CPUs (overkill?) */
+ spin_unlock_irqrestore(&tape->spinlock, flags);
return 1;
}
idetape_chrdevs[minor].drive = NULL;
- restore_flags (flags); /* all CPUs (overkill?) */
+ spin_unlock_irqrestore(&tape->spinlock, flags);
MOD_DEC_USE_COUNT;
- ide_unregister_subdriver (drive);
+ ata_unregister_device(drive);
drive->driver_data = NULL;
devfs_unregister (tape->de_r);
devfs_unregister (tape->de_n);
@@ -5993,11 +5610,11 @@ static void idetape_attach(struct ata_de
}
tape = (idetape_tape_t *) kmalloc (sizeof (idetape_tape_t), GFP_KERNEL);
if (!tape) {
- printk (KERN_ERR "ide-tape: %s: Can't allocate a tape structure\n", drive->name);
+ printk(KERN_ERR "ide-tape: %s: Can't allocate a tape structure\n", drive->name);
return;
}
- if (ide_register_subdriver (drive, &idetape_driver)) {
- printk (KERN_ERR "ide-tape: %s: Failed to register the driver with ide.c\n", drive->name);
+ if (ata_register_device(drive, &idetape_driver)) {
+ printk(KERN_ERR "ide-tape: %s: Failed to register the driver with ide.c\n", drive->name);
kfree (tape);
return;
}
diff -durNp -X /tmp/diff.X8zbex linux-2.5.29/drivers/ide/it8172.c linux/drivers/ide/it8172.c
--- linux-2.5.29/drivers/ide/it8172.c 2002-07-27 04:58:27.000000000 +0200
+++ linux/drivers/ide/it8172.c 2002-07-29 21:35:50.000000000 +0200
@@ -89,10 +89,7 @@ static void it8172_tune_drive (struct at
drive_enables |= 0x0006;
}
- save_flags(flags);
- cli();
pci_write_config_word(dev, master_port, master_data);
- restore_flags(flags);
}
#if defined(CONFIG_BLK_DEV_IDEDMA) && defined(CONFIG_IT8172_TUNING)
diff -durNp -X /tmp/diff.X8zbex linux-2.5.29/drivers/ide/main.c linux/drivers/ide/main.c
--- linux-2.5.29/drivers/ide/main.c 2002-07-29 21:27:35.000000000 +0200
+++ linux/drivers/ide/main.c 2002-07-29 22:31:31.000000000 +0200
@@ -365,7 +365,7 @@ void ide_unregister(struct ata_channel *
if (ata_ops(drive)->cleanup(drive))
goto abort;
} else
- ide_unregister_subdriver(drive);
+ ata_unregister_device(drive);
}
}
ch->present = 0;
@@ -1037,10 +1037,7 @@ done:
/****************************************************************************/
-/*
- * This is in fact registering a device not a driver.
- */
-int ide_register_subdriver(struct ata_device *drive, struct ata_operations *driver)
+int ata_register_device(struct ata_device *drive, struct ata_operations *driver)
{
unsigned long flags;
@@ -1052,12 +1049,9 @@ int ide_register_subdriver(struct ata_de
return 1;
}
- /* FIXME: This will be pushed to the drivers! Thus allowing us to
- * save one parameter here and to separate this out.
- */
drive->driver = driver;
-
spin_unlock_irqrestore(&ide_lock, flags);
+
/* Default autotune or requested autotune */
if (drive->autotune != 2) {
struct ata_channel *ch = drive->channel;
@@ -1071,11 +1065,13 @@ int ide_register_subdriver(struct ata_de
* PARANOIA!!!
*/
+ spin_lock_irqsave(ch->lock, flags);
udma_enable(drive, 0, 0);
ch->udma_setup(drive, ch->modes_map);
#ifdef CONFIG_BLK_DEV_IDE_TCQ_DEFAULT
udma_tcq_enable(drive, 1);
#endif
+ spin_unlock_irqrestore(ch->lock, flags);
}
/* Only CD-ROMs and tape drives support DSC overlap. But only
@@ -1103,13 +1099,8 @@ int ide_register_subdriver(struct ata_de
*
* FIXME: Check whatever we maybe don't call it twice!.
*/
-int ide_unregister_subdriver(struct ata_device *drive)
+int ata_unregister_device(struct ata_device *drive)
{
-#if 0
- if (__MOD_IN_USE(ata_ops(drive)->owner))
- return 1;
-#endif
-
if (drive->usage || drive->busy || !ata_ops(drive))
return 1;
@@ -1181,8 +1172,8 @@ EXPORT_SYMBOL(ide_lock);
devfs_handle_t ide_devfs_handle;
-EXPORT_SYMBOL(ide_register_subdriver);
-EXPORT_SYMBOL(ide_unregister_subdriver);
+EXPORT_SYMBOL(ata_register_device);
+EXPORT_SYMBOL(ata_unregister_device);
EXPORT_SYMBOL(ata_revalidate);
EXPORT_SYMBOL(ide_register_hw);
EXPORT_SYMBOL(ide_unregister);
diff -durNp -X /tmp/diff.X8zbex linux-2.5.29/drivers/ide/opti621.c linux/drivers/ide/opti621.c
--- linux-2.5.29/drivers/ide/opti621.c 2002-07-27 04:58:30.000000000 +0200
+++ linux/drivers/ide/opti621.c 2002-07-29 21:35:50.000000000 +0200
@@ -244,13 +244,15 @@ static void compute_clocks(int pio, pio_
}
-/* Main tune procedure, called from tuneproc. */
+/* Main tune procedure, called from tuneproc.
+ Assumes IRQ's are disabled or at least that no other process will
+ attempt to access the IDE registers concurrently.
+*/
static void opti621_tune_drive(struct ata_device *drive, u8 pio)
{
/* primary and secondary drives share some registers,
* so we have to program both drives
*/
- unsigned long flags;
u8 pio1, pio2;
pio_clocks_t first, second;
int ax, drdy;
@@ -281,9 +283,6 @@ static void opti621_tune_drive(struct at
hwif->name, ax, second.data_time, second.recovery_time, drdy);
#endif
- save_flags(flags); /* all CPUs */
- cli(); /* all CPUs */
-
reg_base = hwif->io_ports[IDE_DATA_OFFSET];
outb(0xc0, reg_base+CNTRL_REG); /* allow Register-B */
outb(0xff, reg_base+5); /* hmm, setupvic.exe does this ;-) */
@@ -306,8 +305,6 @@ static void opti621_tune_drive(struct at
write_reg(misc, MISC_REG); /* set address setup, DRDY timings, */
/* and read prefetch for both drives */
-
- restore_flags(flags); /* all CPUs */
}
/*
diff -durNp -X /tmp/diff.X8zbex linux-2.5.29/drivers/ide/qd65xx.c linux/drivers/ide/qd65xx.c
--- linux-2.5.29/drivers/ide/qd65xx.c 2002-07-27 04:58:33.000000000 +0200
+++ linux/drivers/ide/qd65xx.c 2002-07-29 21:42:28.000000000 +0200
@@ -1,8 +1,6 @@
/*
* Copyright (C) 1996-2001 Linus Torvalds & author (see below)
- */
-
-/*
+ *
* Version 0.03 Cleaned auto-tune, added probe
* Version 0.04 Added second channel tuning
* Version 0.05 Enhanced tuning ; added qd6500 support
@@ -81,36 +79,12 @@
* bit 5 : status, but of what ?
* bit 6 : always set 1 by dos driver
* bit 7 : set 1 for non-ATAPI devices on primary port
- * (maybe read-ahead and post-write buffer ?)
+ * (maybe read-ahead and post-write buffer ?)
*/
static int timings[4]={-1,-1,-1,-1}; /* stores current timing for each timer */
-static void qd_write_reg(u8 content, unsigned int reg)
-{
- unsigned long flags;
-
- save_flags(flags); /* all CPUs */
- cli(); /* all CPUs */
- outb(content,reg);
- restore_flags(flags); /* all CPUs */
-}
-
-static u8 __init qd_read_reg(unsigned int reg)
-{
- unsigned long flags;
- u8 read;
-
- save_flags(flags); /* all CPUs */
- cli(); /* all CPUs */
- read = inb(reg);
- restore_flags(flags); /* all CPUs */
- return read;
-}
-
/*
- * qd_select:
- *
* This routine is invoked from ide.c to prepare for access to a given drive.
*/
@@ -120,12 +94,10 @@ static void qd_select(struct ata_device
(QD_TIMREG(drive) & 0x02);
if (timings[index] != QD_TIMING(drive))
- qd_write_reg(timings[index] = QD_TIMING(drive), QD_TIMREG(drive));
+ outb(timings[index] = QD_TIMING(drive), QD_TIMREG(drive));
}
/*
- * qd6500_compute_timing
- *
* computes the timing value where
* lower nibble represents active time, in count of VLB clocks
* upper nibble represents recovery time, in count of VLB clocks
@@ -147,8 +119,6 @@ static u8 qd6500_compute_timing(struct a
}
/*
- * qd6580_compute_timing
- *
* idem for qd6580
*/
@@ -161,8 +131,6 @@ static u8 qd6580_compute_timing(int acti
}
/*
- * qd_find_disk_type
- *
* tries to find timing from dos driver's table
*/
@@ -187,8 +155,6 @@ static int qd_find_disk_type(struct ata_
}
/*
- * qd_timing_ok:
- *
* check whether timings don't conflict
*/
@@ -201,8 +167,6 @@ static int qd_timing_ok(struct ata_devic
}
/*
- * qd_set_timing:
- *
* records the timing, and enables selectproc as needed
*/
@@ -221,10 +185,6 @@ static void qd_set_timing(struct ata_dev
printk(KERN_DEBUG "%s: %#x\n", drive->name, timing);
}
-/*
- * qd6500_tune_drive
- */
-
static void qd6500_tune_drive(struct ata_device *drive, u8 pio)
{
int active_time = 175;
@@ -242,10 +202,6 @@ static void qd6500_tune_drive(struct ata
qd_set_timing(drive, qd6500_compute_timing(drive->channel, active_time, recovery_time));
}
-/*
- * qd6580_tune_drive
- */
-
static void qd6580_tune_drive(struct ata_device *drive, u8 pio)
{
struct ata_timing *t;
@@ -291,7 +247,7 @@ static void qd6580_tune_drive(struct ata
}
if (!drive->channel->unit && drive->type != ATA_DISK) {
- qd_write_reg(0x5f, QD_CONTROL_PORT);
+ outb(0x5f, QD_CONTROL_PORT);
printk(KERN_WARNING "%s: ATAPI: disabled read-ahead FIFO and post-write buffer on %s.\n", drive->name, drive->channel->name);
}
@@ -299,8 +255,6 @@ static void qd6580_tune_drive(struct ata
}
/*
- * qd_testreg
- *
* tests if the given port is a register
*/
@@ -329,8 +283,6 @@ static int __init qd_testreg(int port)
}
/*
- * qd_setup:
- *
* called to setup an ata channel : adjusts attributes & links for tuning
*/
@@ -349,8 +301,6 @@ void __init qd_setup(int unit, int base,
}
/*
- * qd_unsetup:
- *
* called to unsetup an ata channel : back to default values, unlinks tuning
*/
void __init qd_unsetup(int unit) {
@@ -368,13 +318,13 @@ void __init qd_unsetup(int unit) {
if (tuneproc == (void *) qd6500_tune_drive) {
// will do it for both
- qd_write_reg(QD6500_DEF_DATA, QD_TIMREG(&hwif->drives[0]));
+ outb(QD6500_DEF_DATA, QD_TIMREG(&hwif->drives[0]));
} else if (tuneproc == (void *) qd6580_tune_drive) {
if (QD_CONTROL(hwif) & QD_CONTR_SEC_DISABLED) {
- qd_write_reg(QD6580_DEF_DATA, QD_TIMREG(&hwif->drives[0]));
- qd_write_reg(QD6580_DEF_DATA2, QD_TIMREG(&hwif->drives[1]));
+ outb(QD6580_DEF_DATA, QD_TIMREG(&hwif->drives[0]));
+ outb(QD6580_DEF_DATA2, QD_TIMREG(&hwif->drives[1]));
} else {
- qd_write_reg(unit?QD6580_DEF_DATA2:QD6580_DEF_DATA, QD_TIMREG(&hwif->drives[0]));
+ outb(unit ? QD6580_DEF_DATA2 : QD6580_DEF_DATA, QD_TIMREG(&hwif->drives[0]));
}
} else {
printk(KERN_WARNING "Unknown qd65xx tuning fonction !\n");
@@ -383,8 +333,6 @@ void __init qd_unsetup(int unit) {
}
/*
- * qd_probe:
- *
* looks at the specified baseport, and if qd found, registers & initialises it
* return 1 if another qd may be probed
*/
@@ -394,7 +342,7 @@ int __init qd_probe(int base)
u8 config;
int unit;
- config = qd_read_reg(QD_CONFIG_PORT);
+ config = inb(QD_CONFIG_PORT);
if (! ((config & QD_CONFIG_BASEPORT) >> 1 == (base == 0xb0)) ) return 1;
@@ -425,7 +373,7 @@ int __init qd_probe(int base)
/* qd6580 found */
- control = qd_read_reg(QD_CONTROL_PORT);
+ control = inb(QD_CONTROL_PORT);
printk(KERN_NOTICE "qd6580 at %#x\n", base);
printk(KERN_DEBUG "qd6580: config=%#x, control=%#x, ID3=%u\n", config, control, QD_ID3);
@@ -434,7 +382,7 @@ int __init qd_probe(int base)
/* secondary disabled */
printk(KERN_INFO "%s: qd6580: single IDE board\n", ide_hwifs[unit].name);
qd_setup(unit, base, config | (control << 8), QD6580_DEF_DATA, QD6580_DEF_DATA2, &qd6580_tune_drive);
- qd_write_reg(QD_DEF_CONTR, QD_CONTROL_PORT);
+ outb(QD_DEF_CONTR, QD_CONTROL_PORT);
return 1;
} else {
@@ -443,7 +391,7 @@ int __init qd_probe(int base)
qd_setup(ATA_PRIMARY, base, config | (control << 8), QD6580_DEF_DATA, QD6580_DEF_DATA, &qd6580_tune_drive);
qd_setup(ATA_SECONDARY, base, config | (control << 8), QD6580_DEF_DATA2, QD6580_DEF_DATA2, &qd6580_tune_drive);
- qd_write_reg(QD_DEF_CONTR, QD_CONTROL_PORT);
+ outb(QD_DEF_CONTR, QD_CONTROL_PORT);
return 0; /* no other qd65xx possible */
}
@@ -454,8 +402,6 @@ int __init qd_probe(int base)
#ifndef MODULE
/*
- * init_qd65xx:
- *
* called by ide.c when parsing command line
*/
diff -durNp -X /tmp/diff.X8zbex linux-2.5.29/drivers/scsi/ide-scsi.c linux/drivers/scsi/ide-scsi.c
--- linux-2.5.29/drivers/scsi/ide-scsi.c 2002-07-27 04:58:26.000000000 +0200
+++ linux/drivers/scsi/ide-scsi.c 2002-07-29 22:16:47.000000000 +0200
@@ -1,33 +1,12 @@
/*
* Copyright (C) 1996 - 1999 Gadi Oxman <gadio@netvision.net.il>
- */
-/*
+ *
* Emulation of a SCSI host adapter for IDE ATAPI devices.
*
* With this driver, one can use the Linux SCSI drivers instead of the
* native IDE ATAPI drivers.
- *
- * Ver 0.1 Dec 3 96 Initial version.
- * Ver 0.2 Jan 26 97 Fixed bug in cleanup_module() and added emulation
- * of MODE_SENSE_6/MODE_SELECT_6 for cdroms. Thanks
- * to Janos Farkas for pointing this out.
- * Avoid using bitfields in structures for m68k.
- * Added Scatter/Gather and DMA support.
- * Ver 0.4 Dec 7 97 Add support for ATAPI PD/CD drives.
- * Use variable timeout for each command.
- * Ver 0.5 Jan 2 98 Fix previous PD/CD support.
- * Allow disabling of SCSI-6 to SCSI-10 transformation.
- * Ver 0.6 Jan 27 98 Allow disabling of SCSI command translation layer
- * for access through /dev/sg.
- * Fix MODE_SENSE_6/MODE_SELECT_6/INQUIRY translation.
- * Ver 0.7 Dec 04 98 Ignore commands where lun != 0 to avoid multiple
- * detection of devices with CONFIG_SCSI_MULTI_LUN
- * Ver 0.8 Feb 05 99 Optical media need translation too. Reverse 0.7.
- * Ver 0.9 Jul 04 99 Fix a bug in SG_SET_TRANSFORM.
*/
-#define IDESCSI_VERSION "0.9"
-
#include <linux/module.h>
#include <linux/types.h>
#include <linux/string.h>
@@ -495,9 +474,8 @@ static void idescsi_release(struct inode
static Scsi_Host_Template template;
static int idescsi_cleanup (struct ata_device *drive)
{
- if (ide_unregister_subdriver (drive)) {
+ if (ata_unregister_device(drive))
return 1;
- }
scsi_unregister_host(&template);
return 0;
@@ -762,7 +740,7 @@ static void idescsi_attach(struct ata_de
host = scsi_register(&template, sizeof(idescsi_scsi_t));
if (!host) {
- printk (KERN_ERR
+ printk(KERN_ERR
"ide-scsi: %s: Can't allocate a scsi host structure\n",
drive->name);
return;
@@ -771,8 +749,8 @@ static void idescsi_attach(struct ata_de
host->max_lun = drive->last_lun + 1;
host->max_id = 1;
- if (ide_register_subdriver(drive, &ata_ops)) {
- printk (KERN_ERR "ide-scsi: %s: Failed to register the driver with ide.c\n", drive->name);
+ if (ata_register_device(drive, &ata_ops)) {
+ printk(KERN_ERR "ide-scsi: %s: Failed to register the driver with ide.c\n", drive->name);
scsi_unregister(host);
return;
}
diff -durNp -X /tmp/diff.X8zbex linux-2.5.29/include/linux/ide.h linux/include/linux/ide.h
--- linux-2.5.29/include/linux/ide.h 2002-07-29 21:27:35.000000000 +0200
+++ linux/include/linux/ide.h 2002-07-29 22:19:21.000000000 +0200
@@ -1146,23 +1146,23 @@ extern struct block_device_operations id
*/
extern int ideprobe_init(void);
#ifdef CONFIG_BLK_DEV_IDEDISK
-extern int idedisk_init (void);
+extern int idedisk_init(void);
#endif
#ifdef CONFIG_BLK_DEV_IDECD
-extern int ide_cdrom_init (void);
+extern int ide_cdrom_init(void);
#endif
#ifdef CONFIG_BLK_DEV_IDETAPE
-extern int idetape_init (void);
+extern int idetape_init(void);
#endif
#ifdef CONFIG_BLK_DEV_IDEFLOPPY
-extern int idefloppy_init (void);
+extern int idefloppy_init(void);
#endif
#ifdef CONFIG_BLK_DEV_IDESCSI
-extern int idescsi_init (void);
+extern int idescsi_init(void);
#endif
-extern int ide_register_subdriver(struct ata_device *, struct ata_operations *);
-extern int ide_unregister_subdriver(struct ata_device *drive);
+extern int ata_register_device(struct ata_device *, struct ata_operations *);
+extern int ata_unregister_device(struct ata_device *drive);
extern int ata_revalidate(kdev_t i_rdev);
extern void ide_driver_module(void);
Binary files linux-2.5.29/scripts/docproc and linux/scripts/docproc differ
Binary files linux-2.5.29/scripts/lxdialog/lxdialog and linux/scripts/lxdialog/lxdialog differ
^ permalink raw reply [flat|nested] 12+ messages in thread* Re: [PATCH] 2.5.29 IDE 109
2002-07-29 20:51 ` [PATCH] 2.5.29 IDE 109 Marcin Dalecki
@ 2002-07-30 10:59 ` Alan Cox
2002-07-30 9:51 ` Marcin Dalecki
0 siblings, 1 reply; 12+ messages in thread
From: Alan Cox @ 2002-07-30 10:59 UTC (permalink / raw)
To: martin; +Cc: Linus Torvalds, Kernel Mailing List
Martin. The CS5530 one seems unneeded looking at the databook. Try the
patch below instead, which removes the irq lock and uses the proper
kernel functions to enable MWI and master.
I'm not sure I like the fact you've deleted the ide-tape documentation.
IDE tape is a pretty tricky thing, especially all the command handling
weirdnesses. How about moving it into Changelog.idetape if you dont want
it in the code itself ?
diff -u --exclude-from /usr/src/exclude --new-file --recursive linux-2.5.29/drivers/ide/cs5530.c linux-2.5.29-ac1/drivers/ide/cs5530.c
--- linux-2.5.29/drivers/ide/cs5530.c 2002-07-27 15:33:52.000000000 +0100
+++ linux-2.5.29-ac1/drivers/ide/cs5530.c 2002-07-28 00:41:53.000000000 +0100
@@ -218,6 +218,7 @@
}
}
}
+
if (!master_0) {
printk("%s: unable to locate PCI MASTER function\n", dev->name);
return 0;
@@ -227,15 +228,13 @@
return 0;
}
- save_flags(flags);
- cli(); /* all CPUs (there should only be one CPU with this chipset) */
-
/*
* Enable BusMaster and MemoryWriteAndInvalidate for the cs5530:
* --> OR 0x14 into 16-bit PCI COMMAND reg of function 0 of the cs5530
*/
- pci_read_config_word (cs5530_0, PCI_COMMAND, &pcicmd);
- pci_write_config_word(cs5530_0, PCI_COMMAND, pcicmd | PCI_COMMAND_MASTER | PCI_COMMAND_INVALIDATE);
+
+ pci_set_master(cs5530_0);
+ pci_set_mwi(cs5530_0);
/*
* Set PCI CacheLineSize to 16-bytes:
@@ -274,8 +273,6 @@
pci_write_config_byte(master_0, 0x42, 0x00);
pci_write_config_byte(master_0, 0x43, 0xc1);
- restore_flags(flags);
-
return 0;
}
^ permalink raw reply [flat|nested] 12+ messages in thread* Re: [PATCH] 2.5.29 IDE 109
2002-07-30 10:59 ` Alan Cox
@ 2002-07-30 9:51 ` Marcin Dalecki
0 siblings, 0 replies; 12+ messages in thread
From: Marcin Dalecki @ 2002-07-30 9:51 UTC (permalink / raw)
To: Alan Cox; +Cc: martin, Linus Torvalds, Kernel Mailing List
Alan Cox wrote:
> Martin. The CS5530 one seems unneeded looking at the databook. Try the
> patch below instead, which removes the irq lock and uses the proper
> kernel functions to enable MWI and master.
Thanks for reaffirmation. This will be already in the upcomming 110.
> I'm not sure I like the fact you've deleted the ide-tape documentation.
> IDE tape is a pretty tricky thing, especially all the command handling
> weirdnesses. How about moving it into Changelog.idetape if you dont want
> it in the code itself ?
The interresting parts I have moved over to ide.txt in Documentation.
The "inner workings" part was:
a) ehm, very very terse in style.
b) not quite revealing the reality.
I decided that it would be better to have no docu then misguiding docu.
In esp. the description of DSC handling was not adequate.
The "history of the human race" kind of documentation was certainly
not worth it, becouse: kernel release -> bandwidth consumption ->
energy production -> environmental pollution -> not good for this
planet and not of much value for the developer reading it. I checked the
contents in first place ;-). I tried to preserve credentials of course.
^ permalink raw reply [flat|nested] 12+ messages in thread