From 0890d74f295be849032fd4390ee00422dfda83b1 Mon Sep 17 00:00:00 2001 From: Date: Sun, 3 Apr 2005 14:52:44 -0500 Subject: [PATCH] consolidate timeout defintions in scsi.h Adapted from a patch in SuSE's kernel SRPM. Signed-off-by: James Bottomley --- include/scsi/scsi.h | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'include') diff --git a/include/scsi/scsi.h b/include/scsi/scsi.h index 1d54c063ae5..3507b3d7c0e 100644 --- a/include/scsi/scsi.h +++ b/include/scsi/scsi.h @@ -360,6 +360,15 @@ struct scsi_lun { #define sense_error(sense) ((sense) & 0xf) #define sense_valid(sense) ((sense) & 0x80); +/* + * default timeouts +*/ +#define FORMAT_UNIT_TIMEOUT (2 * 60 * 60 * HZ) +#define START_STOP_TIMEOUT (60 * HZ) +#define MOVE_MEDIUM_TIMEOUT (5 * 60 * HZ) +#define READ_ELEMENT_STATUS_TIMEOUT (5 * 60 * HZ) +#define READ_DEFECT_DATA_TIMEOUT (60 * HZ ) + #define IDENTIFY_BASE 0x80 #define IDENTIFY(can_disconnect, lun) (IDENTIFY_BASE |\ -- cgit v1.2.3 From 97665e9c22991401dc56968619c6b8b9c09f3268 Mon Sep 17 00:00:00 2001 From: Date: Sun, 3 Apr 2005 14:55:06 -0500 Subject: [PATCH] scsi: remove unused scsi_cmnd->internal_timeout field scsi_cmnd->internal_timeout field doesn't have any meaning anymore. Kill the field. Signed-off-by: Tejun Heo Signed-off-by: James Bottomley --- include/scsi/scsi_cmnd.h | 6 ------ 1 file changed, 6 deletions(-) (limited to 'include') diff --git a/include/scsi/scsi_cmnd.h b/include/scsi/scsi_cmnd.h index 9d9871c28ab..ae45d6f8f98 100644 --- a/include/scsi/scsi_cmnd.h +++ b/include/scsi/scsi_cmnd.h @@ -65,12 +65,6 @@ struct scsi_cmnd { int timeout_total; int timeout; - /* - * We handle the timeout differently if it happens when a reset, - * abort, etc are in process. - */ - unsigned volatile char internal_timeout; - unsigned char cmd_len; unsigned char old_cmd_len; enum dma_data_direction sc_data_direction; -- cgit v1.2.3 From 84011ae88da62a20b3ae7b48e2ae3b1ef0fc810a Mon Sep 17 00:00:00 2001 From: Date: Sun, 3 Apr 2005 14:59:11 -0500 Subject: [PATCH] scsi: remove meaningless scsi_cmnd->serial_number_at_timeout field scsi_cmnd->serial_number_at_timeout doesn't serve any purpose anymore. All serial_number == serial_number_at_timeout tests are always true in abort callbacks. Kill the field. Also, as ->pid always equals ->serial_number and ->serial_number doesn't have any special meaning anymore, update comments above ->serial_number accordingly. Once we remove all uses of this field from all lldd's, this field should go. Signed-off-by: Tejun Heo Signed-off-by: James Bottomley --- include/scsi/scsi_cmnd.h | 22 +++++++++------------- 1 file changed, 9 insertions(+), 13 deletions(-) (limited to 'include') diff --git a/include/scsi/scsi_cmnd.h b/include/scsi/scsi_cmnd.h index ae45d6f8f98..07f5c699eaa 100644 --- a/include/scsi/scsi_cmnd.h +++ b/include/scsi/scsi_cmnd.h @@ -43,21 +43,17 @@ struct scsi_cmnd { void (*done) (struct scsi_cmnd *); /* Mid-level done function */ /* - * A SCSI Command is assigned a nonzero serial_number when internal_cmnd - * passes it to the driver's queue command function. The serial_number - * is cleared when scsi_done is entered indicating that the command has - * been completed. If a timeout occurs, the serial number at the moment - * of timeout is copied into serial_number_at_timeout. By subsequently - * comparing the serial_number and serial_number_at_timeout fields - * during abort or reset processing, we can detect whether the command - * has already completed. This also detects cases where the command has - * completed and the SCSI Command structure has already being reused - * for another command, so that we can avoid incorrectly aborting or - * resetting the new command. - * The serial number is only unique per host. + * A SCSI Command is assigned a nonzero serial_number before passed + * to the driver's queue command function. The serial_number is + * cleared when scsi_done is entered indicating that the command + * has been completed. It currently doesn't have much use other + * than printk's. Some lldd's use this number for other purposes. + * It's almost certain that such usages are either incorrect or + * meaningless. Please kill all usages other than printk's. Also, + * as this number is always identical to ->pid, please convert + * printk's to use ->pid, so that we can kill this field. */ unsigned long serial_number; - unsigned long serial_number_at_timeout; int retries; int allowed; -- cgit v1.2.3 From 686579d95d48c713bdb7008cc76af8398219e687 Mon Sep 17 00:00:00 2001 From: Date: Tue, 12 Apr 2005 17:49:09 -0500 Subject: scsi: add DID_REQUEUE to the error handling We have a DID_IMM_RETRY to require a retry at once, but we could do with a DID_REQUEUE to instruct the mid-layer to treat this command in the same manner as QUEUE_FULL or BUSY (i.e. halt the submission until another command returns ... or the queue pressure builds if there are no outstanding commands). Signed-off-by: James Bottomley --- include/scsi/scsi.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'include') diff --git a/include/scsi/scsi.h b/include/scsi/scsi.h index 3507b3d7c0e..659ecf48fb4 100644 --- a/include/scsi/scsi.h +++ b/include/scsi/scsi.h @@ -295,6 +295,8 @@ struct scsi_lun { #define DID_PASSTHROUGH 0x0a /* Force command past mid-layer */ #define DID_SOFT_ERROR 0x0b /* The low level driver just wish a retry */ #define DID_IMM_RETRY 0x0c /* Retry without decrementing retry count */ +#define DID_REQUEUE 0x0d /* Requeue command (no immediate retry) also + * without decrementing the retry count */ #define DRIVER_OK 0x00 /* Driver status */ /* -- cgit v1.2.3 From 652a12ef98d16ccd1ee5cdf2c832ce5411ed3262 Mon Sep 17 00:00:00 2001 From: Russell King Date: Sun, 17 Apr 2005 15:50:36 +0100 Subject: [PATCH] ARM: showregs Fix show_regs() to provide a backtrace. Provide a new __show_regs() function which implements the common subset of show_regs() and die(). Add prototypes to asm-arm/system.h Signed-off-by: Russell King --- include/asm-arm/ptrace.h | 5 +---- include/asm-arm/system.h | 3 +++ 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'include') diff --git a/include/asm-arm/ptrace.h b/include/asm-arm/ptrace.h index 604e3a186cf..4377e22b7e1 100644 --- a/include/asm-arm/ptrace.h +++ b/include/asm-arm/ptrace.h @@ -142,11 +142,8 @@ extern unsigned long profile_pc(struct pt_regs *regs); #endif #ifdef __KERNEL__ -extern void show_regs(struct pt_regs *); - -#define predicate(x) (x & 0xf0000000) +#define predicate(x) ((x) & 0xf0000000) #define PREDICATE_ALWAYS 0xe0000000 - #endif #endif /* __ASSEMBLY__ */ diff --git a/include/asm-arm/system.h b/include/asm-arm/system.h index b5731290b4e..b13a8da4847 100644 --- a/include/asm-arm/system.h +++ b/include/asm-arm/system.h @@ -99,6 +99,9 @@ void hook_fault_code(int nr, int (*fn)(unsigned long, unsigned int, #define tas(ptr) (xchg((ptr),1)) extern asmlinkage void __backtrace(void); +extern asmlinkage void c_backtrace(unsigned long fp, int pmode); +extern void show_pte(struct mm_struct *mm, unsigned long addr); +extern void __show_regs(struct pt_regs *); extern int cpu_architecture(void); -- cgit v1.2.3 From cc56449f53ba45646c6f0a2edf77c4acb342caed Mon Sep 17 00:00:00 2001 From: Russell King Date: Sun, 17 Apr 2005 16:28:31 +0100 Subject: [PATCH] ARM: fix debug macros Fix debug EBSA285 and RiscPC debugging macros to detect whether the MMU is enabled. Signed-off-by: Russell King --- include/asm-arm/arch-ebsa285/debug-macro.S | 7 +++++-- include/asm-arm/arch-rpc/debug-macro.S | 5 ++++- 2 files changed, 9 insertions(+), 3 deletions(-) (limited to 'include') diff --git a/include/asm-arm/arch-ebsa285/debug-macro.S b/include/asm-arm/arch-ebsa285/debug-macro.S index 237853db6e2..97d15fc629a 100644 --- a/include/asm-arm/arch-ebsa285/debug-macro.S +++ b/include/asm-arm/arch-ebsa285/debug-macro.S @@ -45,9 +45,12 @@ .equ dc21285_low, ARMCSR_BASE & 0x00ffffff .macro addruart,rx - mov \rx, #dc21285_high + mrc p15, 0, \rx, c1, c0 + tst \rx, #1 @ MMU enabled? + moveq \rx, #0x42000000 + movne \rx, #dc21285_high .if dc21285_low - orr \rx, \rx, #dc21285_low + orrne \rx, \rx, #dc21285_low .endif .endm diff --git a/include/asm-arm/arch-rpc/debug-macro.S b/include/asm-arm/arch-rpc/debug-macro.S index 0711828164c..456d3d754c3 100644 --- a/include/asm-arm/arch-rpc/debug-macro.S +++ b/include/asm-arm/arch-rpc/debug-macro.S @@ -12,7 +12,10 @@ */ .macro addruart,rx - mov \rx, #0xe0000000 + mrc p15, 0, \rx, c1, c0 + tst \rx, #1 @ MMU enabled? + moveq \rx, #0x03000000 + movne \rx, #0xe0000000 orr \rx, \rx, #0x00010000 orr \rx, \rx, #0x00000fe0 .endm -- cgit v1.2.3 From dadeafdfc8da8c27e5a68e0706b9856eaac89391 Mon Sep 17 00:00:00 2001 From: "David S. Miller" Date: Sun, 17 Apr 2005 18:03:11 -0700 Subject: [PATCH] sparc64: Reduce ptrace cache flushing We were flushing the D-cache excessively for ptrace() processing and this makes debugging threads so slow as to be totally unusable. All process page accesses via ptrace() go via access_process_vm(). This routine, for each process page, uses get_user_pages(). That in turn does a flush_dcache_page() on the child pages before we copy in/out the ptrace request data. Therefore, all we need to do after the data movement is: 1) Flush the D-cache pages if the kernel maps the page to a different color than userspace does. 2) If we wrote to the page, we need to flush the I-cache on older cpus. Previously we just flushed the entire cache at the end of a ptrace() request, and that was beyond stupid. Signed-off-by: David S. Miller Signed-off-by: Linus Torvalds --- include/asm-sparc64/cacheflush.h | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) (limited to 'include') diff --git a/include/asm-sparc64/cacheflush.h b/include/asm-sparc64/cacheflush.h index 86f02937ff1..51b26e81d82 100644 --- a/include/asm-sparc64/cacheflush.h +++ b/include/asm-sparc64/cacheflush.h @@ -49,16 +49,22 @@ extern void flush_dcache_page(struct page *page); #define flush_icache_page(vma, pg) do { } while(0) #define flush_icache_user_range(vma,pg,adr,len) do { } while (0) -#define copy_to_user_page(vma, page, vaddr, dst, src, len) \ - do { \ - flush_cache_page(vma, vaddr, page_to_pfn(page));\ - memcpy(dst, src, len); \ +extern void flush_ptrace_access(struct vm_area_struct *, struct page *, + unsigned long uaddr, void *kaddr, + unsigned long len, int write); + +#define copy_to_user_page(vma, page, vaddr, dst, src, len) \ + do { \ + flush_cache_page(vma, vaddr, page_to_pfn(page)); \ + memcpy(dst, src, len); \ + flush_ptrace_access(vma, page, vaddr, src, len, 0); \ } while (0) -#define copy_from_user_page(vma, page, vaddr, dst, src, len) \ - do { \ - flush_cache_page(vma, vaddr, page_to_pfn(page));\ - memcpy(dst, src, len); \ +#define copy_from_user_page(vma, page, vaddr, dst, src, len) \ + do { \ + flush_cache_page(vma, vaddr, page_to_pfn(page)); \ + memcpy(dst, src, len); \ + flush_ptrace_access(vma, page, vaddr, dst, len, 1); \ } while (0) #define flush_dcache_mmap_lock(mapping) do { } while (0) -- cgit v1.2.3 From 0ba4da03cc84f54b2574e1abcdaa18ef8456a9fb Mon Sep 17 00:00:00 2001 From: "David S. Miller" Date: Mon, 18 Apr 2005 15:13:15 -0700 Subject: [PATCH] sparc64: Fix stat Like Alpha, sparc64's struct stat was defined before we had the nanosecond et al. fields added. So like Alpha I have to cons up a struct stat64 to get this stuff. I'll work on the glibc bits soon. Also, we were forgetting to fill in the nanosecond fields in the sparc compat stat64 syscalls. Signed-off-by: David S. Miller Signed-off-by: Linus Torvalds --- include/asm-sparc/unistd.h | 6 +++--- include/asm-sparc64/compat.h | 40 +++++++++++++++++++++++++++++++++--- include/asm-sparc64/stat.h | 49 +++++++++++++++----------------------------- include/asm-sparc64/unistd.h | 6 +++--- 4 files changed, 60 insertions(+), 41 deletions(-) (limited to 'include') diff --git a/include/asm-sparc/unistd.h b/include/asm-sparc/unistd.h index d1f63caaa32..84670840390 100644 --- a/include/asm-sparc/unistd.h +++ b/include/asm-sparc/unistd.h @@ -79,7 +79,7 @@ #define __NR_umask 60 /* Common */ #define __NR_chroot 61 /* Common */ #define __NR_fstat 62 /* Common */ -#define __NR_fstat64 63 /* Linux sparc32 Specific */ +#define __NR_fstat64 63 /* Linux Specific */ #define __NR_getpagesize 64 /* Common */ #define __NR_msync 65 /* Common in newer 1.3.x revs... */ #define __NR_vfork 66 /* Common */ @@ -148,14 +148,14 @@ #define __NR_truncate 129 /* Common */ #define __NR_ftruncate 130 /* Common */ #define __NR_flock 131 /* Common */ -#define __NR_lstat64 132 /* Linux sparc32 Specific */ +#define __NR_lstat64 132 /* Linux Specific */ #define __NR_sendto 133 /* Common */ #define __NR_shutdown 134 /* Common */ #define __NR_socketpair 135 /* Common */ #define __NR_mkdir 136 /* Common */ #define __NR_rmdir 137 /* Common */ #define __NR_utimes 138 /* SunOS Specific */ -#define __NR_stat64 139 /* Linux sparc32 Specific */ +#define __NR_stat64 139 /* Linux Specific */ #define __NR_sendfile64 140 /* adjtime under SunOS */ #define __NR_getpeername 141 /* Common */ #define __NR_futex 142 /* gethostid under SunOS */ diff --git a/include/asm-sparc64/compat.h b/include/asm-sparc64/compat.h index 2950279dd77..22f58055b8a 100644 --- a/include/asm-sparc64/compat.h +++ b/include/asm-sparc64/compat.h @@ -51,16 +51,50 @@ struct compat_stat { compat_dev_t st_rdev; compat_off_t st_size; compat_time_t st_atime; - u32 __unused1; + compat_ulong_t st_atime_nsec; compat_time_t st_mtime; - u32 __unused2; + compat_ulong_t st_mtime_nsec; compat_time_t st_ctime; - u32 __unused3; + compat_ulong_t st_ctime_nsec; compat_off_t st_blksize; compat_off_t st_blocks; u32 __unused4[2]; }; +struct compat_stat64 { + unsigned long long st_dev; + + unsigned long long st_ino; + + unsigned int st_mode; + unsigned int st_nlink; + + unsigned int st_uid; + unsigned int st_gid; + + unsigned long long st_rdev; + + unsigned char __pad3[8]; + + long long st_size; + unsigned int st_blksize; + + unsigned char __pad4[8]; + unsigned int st_blocks; + + unsigned int st_atime; + unsigned int st_atime_nsec; + + unsigned int st_mtime; + unsigned int st_mtime_nsec; + + unsigned int st_ctime; + unsigned int st_ctime_nsec; + + unsigned int __unused4; + unsigned int __unused5; +}; + struct compat_flock { short l_type; short l_whence; diff --git a/include/asm-sparc64/stat.h b/include/asm-sparc64/stat.h index 48e06618a5a..128c27e57f0 100644 --- a/include/asm-sparc64/stat.h +++ b/include/asm-sparc64/stat.h @@ -21,43 +21,28 @@ struct stat { unsigned long __unused4[2]; }; -#ifdef __KERNEL__ -/* This is sparc32 stat64 structure. */ - struct stat64 { - unsigned long long st_dev; - - unsigned long long st_ino; + unsigned long st_dev; + unsigned long st_ino; + unsigned long st_nlink; unsigned int st_mode; - unsigned int st_nlink; - unsigned int st_uid; unsigned int st_gid; - - unsigned long long st_rdev; - - unsigned char __pad3[8]; - - long long st_size; - unsigned int st_blksize; - - unsigned char __pad4[8]; - unsigned int st_blocks; - - unsigned int st_atime; - unsigned int st_atime_nsec; - - unsigned int st_mtime; - unsigned int st_mtime_nsec; - - unsigned int st_ctime; - unsigned int st_ctime_nsec; - - unsigned int __unused4; - unsigned int __unused5; + unsigned int __pad0; + + unsigned long st_rdev; + long st_size; + long st_blksize; + long st_blocks; + + unsigned long st_atime; + unsigned long st_atime_nsec; + unsigned long st_mtime; + unsigned long st_mtime_nsec; + unsigned long st_ctime; + unsigned long st_ctime_nsec; + long __unused[3]; }; #endif - -#endif diff --git a/include/asm-sparc64/unistd.h b/include/asm-sparc64/unistd.h index 3c00065eea8..5b8dcf5786a 100644 --- a/include/asm-sparc64/unistd.h +++ b/include/asm-sparc64/unistd.h @@ -79,7 +79,7 @@ #define __NR_umask 60 /* Common */ #define __NR_chroot 61 /* Common */ #define __NR_fstat 62 /* Common */ -/* #define __NR_fstat64 63 Linux sparc32 Specific */ +#define __NR_fstat64 63 /* Linux Specific */ #define __NR_getpagesize 64 /* Common */ #define __NR_msync 65 /* Common in newer 1.3.x revs... */ #define __NR_vfork 66 /* Common */ @@ -148,14 +148,14 @@ #define __NR_truncate 129 /* Common */ #define __NR_ftruncate 130 /* Common */ #define __NR_flock 131 /* Common */ -/* #define __NR_lstat64 132 Linux sparc32 Specific */ +#define __NR_lstat64 132 /* Linux Specific */ #define __NR_sendto 133 /* Common */ #define __NR_shutdown 134 /* Common */ #define __NR_socketpair 135 /* Common */ #define __NR_mkdir 136 /* Common */ #define __NR_rmdir 137 /* Common */ #define __NR_utimes 138 /* SunOS Specific */ -/* #define __NR_stat64 139 Linux sparc32 Specific */ +#define __NR_stat64 139 /* Linux Specific */ #define __NR_sendfile64 140 /* adjtime under SunOS */ #define __NR_getpeername 141 /* Common */ #define __NR_futex 142 /* gethostid under SunOS */ -- cgit v1.2.3