diff options
128 files changed, 3128 insertions, 2220 deletions
diff --git a/Documentation/scsi/ChangeLog.megaraid_sas b/Documentation/scsi/ChangeLog.megaraid_sas new file mode 100644 index 00000000000..f8c16cbf56b --- /dev/null +++ b/Documentation/scsi/ChangeLog.megaraid_sas @@ -0,0 +1,24 @@ +1 Release Date : Mon Jan 23 14:09:01 PST 2006 - Sumant Patro <Sumant.Patro@lsil.com> +2 Current Version : 00.00.02.02 +3 Older Version : 00.00.02.01 + +i. New template defined to represent each family of controllers (identified by processor used). + The template will have defintions that will be initialised to appropritae values for a specific family of controllers. The template definition has four function pointers. During driver initialisation the function pointers will be set based on the controller family type. This change is done to support new controllers that has different processors and thus different register set. + + -Sumant Patro <Sumant.Patro@lsil.com> + +1 Release Date : Mon Dec 19 14:36:26 PST 2005 - Sumant Patro <Sumant.Patro@lsil.com> +2 Current Version : 00.00.02.00-rc4 +3 Older Version : 00.00.02.01 + +i. Code reorganized to remove code duplication in megasas_build_cmd. + + "There's a lot of duplicate code megasas_build_cmd. Move that out of the different codepathes and merge the reminder of megasas_build_cmd into megasas_queue_command" + + - Christoph Hellwig <hch@lst.de> + +ii. Defined MEGASAS_IOC_FIRMWARE32 for code paths that handles 32 bit applications in 64 bit systems. + + "MEGASAS_IOC_FIRMWARE can't be redefined if CONFIG_COMPAT is set, we need to define a MEGASAS_IOC_FIRMWARE32 define so native binaries continue to work" + + - Christoph Hellwig <hch@lst.de> diff --git a/Documentation/scsi/aic79xx.txt b/Documentation/scsi/aic79xx.txt index 0aeef740a95..382b439b439 100644 --- a/Documentation/scsi/aic79xx.txt +++ b/Documentation/scsi/aic79xx.txt @@ -1,5 +1,5 @@ ==================================================================== -= Adaptec Ultra320 Family Manager Set v1.3.11 = += Adaptec Ultra320 Family Manager Set = = = = README for = = The Linux Operating System = @@ -63,6 +63,11 @@ The following information is available in this file: 68-pin) 2. Version History + 3.0 (December 1st, 2005) + - Updated driver to use SCSI transport class infrastructure + - Upported sequencer and core fixes from adaptec released + version 2.0.15 of the driver. + 1.3.11 (July 11, 2003) - Fix several deadlock issues. - Add 29320ALP and 39320B Id's. @@ -194,7 +199,7 @@ The following information is available in this file: supported) - Support for the PCI-X standard up to 133MHz - Support for the PCI v2.2 standard - - Domain Validation + - Domain Validation 2.2. Operating System Support: - Redhat Linux 7.2, 7.3, 8.0, Advanced Server 2.1 @@ -411,77 +416,53 @@ The following information is available in this file: http://www.adaptec.com. -5. Contacting Adaptec +5. Adaptec Customer Support A Technical Support Identification (TSID) Number is required for Adaptec technical support. - The 12-digit TSID can be found on the white barcode-type label - included inside the box with your product. The TSID helps us + included inside the box with your product. The TSID helps us provide more efficient service by accurately identifying your product and support status. + Support Options - Search the Adaptec Support Knowledgebase (ASK) at http://ask.adaptec.com for articles, troubleshooting tips, and - frequently asked questions for your product. + frequently asked questions about your product. - For support via Email, submit your question to Adaptec's - Technical Support Specialists at http://ask.adaptec.com. + Technical Support Specialists at http://ask.adaptec.com/. North America - - Visit our Web site at http://www.adaptec.com. - - To speak with a Fibre Channel/RAID/External Storage Technical - Support Specialist, call 1-321-207-2000, - Hours: Monday-Friday, 3:00 A.M. to 5:00 P.M., PST. - (Not open on holidays) - - For Technical Support in all other technologies including - SCSI, call 1-408-934-7274, - Hours: Monday-Friday, 6:00 A.M. to 5:00 P.M., PST. - (Not open on holidays) - - For after hours support, call 1-800-416-8066 ($99/call, - $149/call on holidays) - - To order Adaptec products including software and cables, call - 1-800-442-7274 or 1-408-957-7274. You can also visit our - online store at http://www.adaptecstore.com + - Visit our Web site at http://www.adaptec.com/. + - For information about Adaptec's support options, call + 408-957-2550, 24 hours a day, 7 days a week. + - To speak with a Technical Support Specialist, + * For hardware products, call 408-934-7274, + Monday to Friday, 3:00 am to 5:00 pm, PDT. + * For RAID and Fibre Channel products, call 321-207-2000, + Monday to Friday, 3:00 am to 5:00 pm, PDT. + To expedite your service, have your computer with you. + - To order Adaptec products, including accessories and cables, + call 408-957-7274. To order cables online go to + http://www.adaptec.com/buy-cables/. Europe - - Visit our Web site at http://www.adaptec-europe.com. - - English and French: To speak with a Technical Support - Specialist, call one of the following numbers: - - English: +32-2-352-3470 - - French: +32-2-352-3460 - Hours: Monday-Thursday, 10:00 to 12:30, 13:30 to 17:30 CET - Friday, 10:00 to 12:30, 13:30 to 16:30 CET - - German: To speak with a Technical Support Specialist, - call +49-89-456-40660 - Hours: Monday-Thursday, 09:30 to 12:30, 13:30 to 16:30 CET - Friday, 09:30 to 12:30, 13:30 to 15:00 CET - - To order Adaptec products, including accessories and cables: - - UK: +0800-96-65-26 or fax +0800-731-02-95 - - Other European countries: +32-11-300-379 - - Australia and New Zealand - - Visit our Web site at http://www.adaptec.com.au. - - To speak with a Technical Support Specialist, call - +612-9416-0698 - Hours: Monday-Friday, 10:00 A.M. to 4:30 P.M., EAT - (Not open on holidays) + - Visit our Web site at http://www.adaptec-europe.com/. + - To speak with a Technical Support Specialist, call, or email, + * German: +49 89 4366 5522, Monday-Friday, 9:00-17:00 CET, + http://ask-de.adaptec.com/. + * French: +49 89 4366 5533, Monday-Friday, 9:00-17:00 CET, + http://ask-fr.adaptec.com/. + * English: +49 89 4366 5544, Monday-Friday, 9:00-17:00 GMT, + http://ask.adaptec.com/. + - You can order Adaptec cables online at + http://www.adaptec.com/buy-cables/. Japan + - Visit our web site at http://www.adaptec.co.jp/. - To speak with a Technical Support Specialist, call - +81-3-5308-6120 - Hours: Monday-Friday, 9:00 a.m. to 12:00 p.m., 1:00 p.m. to - 6:00 p.m. TSC - - Hong Kong and China - - To speak with a Technical Support Specialist, call - +852-2869-7200 - Hours: Monday-Friday, 10:00 to 17:00. - - Fax Technical Support at +852-2869-7100. - - Singapore - - To speak with a Technical Support Specialist, call - +65-245-7470 - Hours: Monday-Friday, 10:00 to 17:00. - - Fax Technical Support at +852-2869-7100 + +81 3 5308 6120, Monday-Friday, 9:00 a.m. to 12:00 p.m., + 1:00 p.m. to 6:00 p.m. ------------------------------------------------------------------- /* diff --git a/Documentation/scsi/aic7xxx.txt b/Documentation/scsi/aic7xxx.txt index 47e74ddc4bc..3481fcded4c 100644 --- a/Documentation/scsi/aic7xxx.txt +++ b/Documentation/scsi/aic7xxx.txt @@ -309,81 +309,57 @@ The following information is available in this file: ----------------------------------------------------------------- Example: - 'options aic7xxx aic7xxx=verbose,no_probe,tag_info:{{},{,,10}},seltime:1" + 'options aic7xxx aic7xxx=verbose,no_probe,tag_info:{{},{,,10}},seltime:1' enables verbose logging, Disable EISA/VLB probing, and set tag depth on Controller 1/Target 2 to 10 tags. -3. Contacting Adaptec +4. Adaptec Customer Support A Technical Support Identification (TSID) Number is required for Adaptec technical support. - The 12-digit TSID can be found on the white barcode-type label - included inside the box with your product. The TSID helps us + included inside the box with your product. The TSID helps us provide more efficient service by accurately identifying your product and support status. + Support Options - Search the Adaptec Support Knowledgebase (ASK) at http://ask.adaptec.com for articles, troubleshooting tips, and - frequently asked questions for your product. + frequently asked questions about your product. - For support via Email, submit your question to Adaptec's - Technical Support Specialists at http://ask.adaptec.com. + Technical Support Specialists at http://ask.adaptec.com/. North America - - Visit our Web site at http://www.adaptec.com. - - To speak with a Fibre Channel/RAID/External Storage Technical - Support Specialist, call 1-321-207-2000, - Hours: Monday-Friday, 3:00 A.M. to 5:00 P.M., PST. - (Not open on holidays) - - For Technical Support in all other technologies including - SCSI, call 1-408-934-7274, - Hours: Monday-Friday, 6:00 A.M. to 5:00 P.M., PST. - (Not open on holidays) - - For after hours support, call 1-800-416-8066 ($99/call, - $149/call on holidays) - - To order Adaptec products including software and cables, call - 1-800-442-7274 or 1-408-957-7274. You can also visit our - online store at http://www.adaptecstore.com + - Visit our Web site at http://www.adaptec.com/. + - For information about Adaptec's support options, call + 408-957-2550, 24 hours a day, 7 days a week. + - To speak with a Technical Support Specialist, + * For hardware products, call 408-934-7274, + Monday to Friday, 3:00 am to 5:00 pm, PDT. + * For RAID and Fibre Channel products, call 321-207-2000, + Monday to Friday, 3:00 am to 5:00 pm, PDT. + To expedite your service, have your computer with you. + - To order Adaptec products, including accessories and cables, + call 408-957-7274. To order cables online go to + http://www.adaptec.com/buy-cables/. Europe - - Visit our Web site at http://www.adaptec-europe.com. - - English and French: To speak with a Technical Support - Specialist, call one of the following numbers: - - English: +32-2-352-3470 - - French: +32-2-352-3460 - Hours: Monday-Thursday, 10:00 to 12:30, 13:30 to 17:30 CET - Friday, 10:00 to 12:30, 13:30 to 16:30 CET - - German: To speak with a Technical Support Specialist, - call +49-89-456-40660 - Hours: Monday-Thursday, 09:30 to 12:30, 13:30 to 16:30 CET - Friday, 09:30 to 12:30, 13:30 to 15:00 CET - - To order Adaptec products, including accessories and cables: - - UK: +0800-96-65-26 or fax +0800-731-02-95 - - Other European countries: +32-11-300-379 - - Australia and New Zealand - - Visit our Web site at http://www.adaptec.com.au. - - To speak with a Technical Support Specialist, call - +612-9416-0698 - Hours: Monday-Friday, 10:00 A.M. to 4:30 P.M., EAT - (Not open on holidays) + - Visit our Web site at http://www.adaptec-europe.com/. + - To speak with a Technical Support Specialist, call, or email, + * German: +49 89 4366 5522, Monday-Friday, 9:00-17:00 CET, + http://ask-de.adaptec.com/. + * French: +49 89 4366 5533, Monday-Friday, 9:00-17:00 CET, + http://ask-fr.adaptec.com/. + * English: +49 89 4366 5544, Monday-Friday, 9:00-17:00 GMT, + http://ask.adaptec.com/. + - You can order Adaptec cables online at + http://www.adaptec.com/buy-cables/. Japan + - Visit our web site at http://www.adaptec.co.jp/. - To speak with a Technical Support Specialist, call - +81-3-5308-6120 - Hours: Monday-Friday, 9:00 a.m. to 12:00 p.m., 1:00 p.m. to - 6:00 p.m. TSC - - Hong Kong and China - - To speak with a Technical Support Specialist, call - +852-2869-7200 - Hours: Monday-Friday, 10:00 to 17:00. - - Fax Technical Support at +852-2869-7100. - - Singapore - - To speak with a Technical Support Specialist, call - +65-245-7470 - Hours: Monday-Friday, 10:00 to 17:00. - - Fax Technical Support at +852-2869-7100 + +81 3 5308 6120, Monday-Friday, 9:00 a.m. to 12:00 p.m., + 1:00 p.m. to 6:00 p.m. ------------------------------------------------------------------- /* diff --git a/arch/arm/configs/bast_defconfig b/arch/arm/configs/bast_defconfig index 6886001b536..4a8564f386a 100644 --- a/arch/arm/configs/bast_defconfig +++ b/arch/arm/configs/bast_defconfig @@ -14,8 +14,7 @@ CONFIG_GENERIC_IOMAP=y # Code maturity level options # CONFIG_EXPERIMENTAL=y -# CONFIG_CLEAN_COMPILE is not set -CONFIG_BROKEN=y +CONFIG_CLEAN_COMPILE=y CONFIG_BROKEN_ON_SMP=y # @@ -360,7 +359,6 @@ CONFIG_BLK_DEV_IDE_BAST=y # # IEEE 1394 (FireWire) support # -# CONFIG_IEEE1394 is not set # # I2O device support @@ -781,7 +779,6 @@ CONFIG_SYSFS=y # CONFIG_DEVFS_FS is not set # CONFIG_DEVPTS_FS_XATTR is not set # CONFIG_TMPFS is not set -# CONFIG_HUGETLBFS is not set # CONFIG_HUGETLB_PAGE is not set CONFIG_RAMFS=y diff --git a/arch/arm/configs/collie_defconfig b/arch/arm/configs/collie_defconfig index 15468a0cf70..c9aa878e610 100644 --- a/arch/arm/configs/collie_defconfig +++ b/arch/arm/configs/collie_defconfig @@ -13,8 +13,7 @@ CONFIG_GENERIC_CALIBRATE_DELAY=y # Code maturity level options # CONFIG_EXPERIMENTAL=y -# CONFIG_CLEAN_COMPILE is not set -CONFIG_BROKEN=y +CONFIG_CLEAN_COMPILE=y CONFIG_BROKEN_ON_SMP=y CONFIG_LOCK_KERNEL=y CONFIG_INIT_ENV_ARG_LIMIT=32 @@ -308,9 +307,7 @@ CONFIG_MTD_CFI_I2=y # CONFIG_MTD_ROM is not set # CONFIG_MTD_ABSENT is not set CONFIG_MTD_OBSOLETE_CHIPS=y -# CONFIG_MTD_AMDSTD is not set CONFIG_MTD_SHARP=y -# CONFIG_MTD_JEDEC is not set # # Mapping drivers for chip access @@ -396,7 +393,6 @@ CONFIG_ATA_OVER_ETH=m # # IEEE 1394 (FireWire) support # -# CONFIG_IEEE1394 is not set # # I2O device support @@ -741,7 +737,6 @@ CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1" CONFIG_PROC_FS=y CONFIG_SYSFS=y CONFIG_TMPFS=y -# CONFIG_HUGETLBFS is not set # CONFIG_HUGETLB_PAGE is not set CONFIG_RAMFS=y # CONFIG_RELAYFS_FS is not set diff --git a/arch/arm/configs/s3c2410_defconfig b/arch/arm/configs/s3c2410_defconfig index 33f31080a98..1964ccd8a71 100644 --- a/arch/arm/configs/s3c2410_defconfig +++ b/arch/arm/configs/s3c2410_defconfig @@ -13,8 +13,7 @@ CONFIG_GENERIC_CALIBRATE_DELAY=y # Code maturity level options # CONFIG_EXPERIMENTAL=y -# CONFIG_CLEAN_COMPILE is not set -CONFIG_BROKEN=y +CONFIG_CLEAN_COMPILE=y CONFIG_BROKEN_ON_SMP=y CONFIG_INIT_ENV_ARG_LIMIT=32 @@ -473,7 +472,6 @@ CONFIG_BLK_DEV_IDE_BAST=y # # IEEE 1394 (FireWire) support # -# CONFIG_IEEE1394 is not set # # I2O device support @@ -896,7 +894,6 @@ CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1" CONFIG_PROC_FS=y CONFIG_SYSFS=y # CONFIG_TMPFS is not set -# CONFIG_HUGETLBFS is not set # CONFIG_HUGETLB_PAGE is not set CONFIG_RAMFS=y # CONFIG_RELAYFS_FS is not set diff --git a/arch/arm/kernel/calls.S b/arch/arm/kernel/calls.S index 75e6f9a9471..d058e7c1256 100644 --- a/arch/arm/kernel/calls.S +++ b/arch/arm/kernel/calls.S @@ -7,337 +7,334 @@ * it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation. * - * This file is included twice in entry-common.S + * This file is included thrice in entry-common.S */ -#ifndef NR_syscalls -#define NR_syscalls 328 -#else - -100: -/* 0 */ .long sys_restart_syscall - .long sys_exit - .long sys_fork_wrapper - .long sys_read - .long sys_write -/* 5 */ .long sys_open - .long sys_close - .long sys_ni_syscall /* was sys_waitpid */ - .long sys_creat - .long sys_link -/* 10 */ .long sys_unlink - .long sys_execve_wrapper - .long sys_chdir - .long OBSOLETE(sys_time) /* used by libc4 */ - .long sys_mknod -/* 15 */ .long sys_chmod - .long sys_lchown16 - .long sys_ni_syscall /* was sys_break */ - .long sys_ni_syscall /* was sys_stat */ - .long sys_lseek -/* 20 */ .long sys_getpid - .long sys_mount - .long OBSOLETE(sys_oldumount) /* used by libc4 */ - .long sys_setuid16 - .long sys_getuid16 -/* 25 */ .long OBSOLETE(sys_stime) - .long sys_ptrace - .long OBSOLETE(sys_alarm) /* used by libc4 */ - .long sys_ni_syscall /* was sys_fstat */ - .long sys_pause -/* 30 */ .long OBSOLETE(sys_utime) /* used by libc4 */ - .long sys_ni_syscall /* was sys_stty */ - .long sys_ni_syscall /* was sys_getty */ - .long sys_access - .long sys_nice -/* 35 */ .long sys_ni_syscall /* was sys_ftime */ - .long sys_sync - .long sys_kill - .long sys_rename - .long sys_mkdir -/* 40 */ .long sys_rmdir - .long sys_dup - .long sys_pipe - .long sys_times - .long sys_ni_syscall /* was sys_prof */ -/* 45 */ .long sys_brk - .long sys_setgid16 - .long sys_getgid16 - .long sys_ni_syscall /* was sys_signal */ - .long sys_geteuid16 -/* 50 */ .long sys_getegid16 - .long sys_acct - .long sys_umount - .long sys_ni_syscall /* was sys_lock */ - .long sys_ioctl -/* 55 */ .long sys_fcntl - .long sys_ni_syscall /* was sys_mpx */ - .long sys_setpgid - .long sys_ni_syscall /* was sys_ulimit */ - .long sys_ni_syscall /* was sys_olduname */ -/* 60 */ .long sys_umask - .long sys_chroot - .long sys_ustat - .long sys_dup2 - .long sys_getppid -/* 65 */ .long sys_getpgrp - .long sys_setsid - .long sys_sigaction - .long sys_ni_syscall /* was sys_sgetmask */ - .long sys_ni_syscall /* was sys_ssetmask */ -/* 70 */ .long sys_setreuid16 - .long sys_setregid16 - .long sys_sigsuspend_wrapper - .long sys_sigpending - .long sys_sethostname -/* 75 */ .long sys_setrlimit - .long OBSOLETE(sys_old_getrlimit) /* used by libc4 */ - .long sys_getrusage - .long sys_gettimeofday - .long sys_settimeofday -/* 80 */ .long sys_getgroups16 - .long sys_setgroups16 - .long OBSOLETE(old_select) /* used by libc4 */ - .long sys_symlink - .long sys_ni_syscall /* was sys_lstat */ -/* 85 */ .long sys_readlink - .long sys_uselib - .long sys_swapon - .long sys_reboot - .long OBSOLETE(old_readdir) /* used by libc4 */ -/* 90 */ .long OBSOLETE(old_mmap) /* used by libc4 */ - .long sys_munmap - .long sys_truncate - .long sys_ftruncate - .long sys_fchmod -/* 95 */ .long sys_fchown16 - .long sys_getpriority - .long sys_setpriority - .long sys_ni_syscall /* was sys_profil */ - .long sys_statfs -/* 100 */ .long sys_fstatfs - .long sys_ni_syscall - .long OBSOLETE(sys_socketcall) - .long sys_syslog - .long sys_setitimer -/* 105 */ .long sys_getitimer - .long sys_newstat - .long sys_newlstat - .long sys_newfstat - .long sys_ni_syscall /* was sys_uname */ -/* 110 */ .long sys_ni_syscall /* was sys_iopl */ - .long sys_vhangup - .long sys_ni_syscall - .long OBSOLETE(sys_syscall) /* call a syscall */ - .long sys_wait4 -/* 115 */ .long sys_swapoff - .long sys_sysinfo - .long OBSOLETE(ABI(sys_ipc, sys_oabi_ipc)) - .long sys_fsync - .long sys_sigreturn_wrapper -/* 120 */ .long sys_clone_wrapper - .long sys_setdomainname - .long sys_newuname - .long sys_ni_syscall - .long sys_adjtimex -/* 125 */ .long sys_mprotect - .long sys_sigprocmask - .long sys_ni_syscall /* was sys_create_module */ - .long sys_init_module - .long sys_delete_module -/* 130 */ .long sys_ni_syscall /* was sys_get_kernel_syms */ - .long sys_quotactl - .long sys_getpgid - .long sys_fchdir - .long sys_bdflush -/* 135 */ .long sys_sysfs - .long sys_personality - .long sys_ni_syscall /* .long _sys_afs_syscall */ - .long sys_setfsuid16 - .long sys_setfsgid16 -/* 140 */ .long sys_llseek - .long sys_getdents - .long sys_select - .long sys_flock - .long sys_msync -/* 145 */ .long sys_readv - .long sys_writev - .long sys_getsid - .long sys_fdatasync - .long sys_sysctl -/* 150 */ .long sys_mlock - .long sys_munlock - .long sys_mlockall - .long sys_munlockall - .long sys_sched_setparam -/* 155 */ .long sys_sched_getparam - .long sys_sched_setscheduler - .long sys_sched_getscheduler - .long sys_sched_yield - .long sys_sched_get_priority_max -/* 160 */ .long sys_sched_get_priority_min - .long sys_sched_rr_get_interval - .long sys_nanosleep - .long sys_arm_mremap - .long sys_setresuid16 -/* 165 */ .long sys_getresuid16 - .long sys_ni_syscall - .long sys_ni_syscall /* was sys_query_module */ - .long sys_poll - .long sys_nfsservctl -/* 170 */ .long sys_setresgid16 - .long sys_getresgid16 - .long sys_prctl - .long sys_rt_sigreturn_wrapper - .long sys_rt_sigaction -/* 175 */ .long sys_rt_sigprocmask - .long sys_rt_sigpending - .long sys_rt_sigtimedwait - .long sys_rt_sigqueueinfo - .long sys_rt_sigsuspend_wrapper -/* 180 */ .long ABI(sys_pread64, sys_oabi_pread64) - .long ABI(sys_pwrite64, sys_oabi_pwrite64) - .long sys_chown16 - .long sys_getcwd - .long sys_capget -/* 185 */ .long sys_capset - .long sys_sigaltstack_wrapper - .long sys_sendfile - .long sys_ni_syscall - .long sys_ni_syscall -/* 190 */ .long sys_vfork_wrapper - .long sys_getrlimit - .long sys_mmap2 - .long ABI(sys_truncate64, sys_oabi_truncate64) - .long ABI(sys_ftruncate64, sys_oabi_ftruncate64) -/* 195 */ .long ABI(sys_stat64, sys_oabi_stat64) - .long ABI(sys_lstat64, sys_oabi_lstat64) - .long ABI(sys_fstat64, sys_oabi_fstat64) - .long sys_lchown - .long sys_getuid -/* 200 */ .long sys_getgid - .long sys_geteuid - .long sys_getegid - .long sys_setreuid - .long sys_setregid -/* 205 */ .long sys_getgroups - .long sys_setgroups - .long sys_fchown - .long sys_setresuid - .long sys_getresuid -/* 210 */ .long sys_setresgid - .long sys_getresgid - .long sys_chown - .long sys_setuid - .long sys_setgid -/* 215 */ .long sys_setfsuid - .long sys_setfsgid - .long sys_getdents64 - .long sys_pivot_root - .long sys_mincore -/* 220 */ .long sys_madvise - .long ABI(sys_fcntl64, sys_oabi_fcntl64) - .long sys_ni_syscall /* TUX */ - .long sys_ni_syscall - .long sys_gettid -/* 225 */ .long ABI(sys_readahead, sys_oabi_readahead) - .long sys_setxattr - .long sys_lsetxattr - .long sys_fsetxattr - .long sys_getxattr -/* 230 */ .long sys_lgetxattr - .long sys_fgetxattr - .long sys_listxattr - .long sys_llistxattr - .long sys_flistxattr -/* 235 */ .long sys_removexattr - .long sys_lremovexattr - .long sys_fremovexattr - .long sys_tkill - .long sys_sendfile64 -/* 240 */ .long sys_futex - .long sys_sched_setaffinity - .long sys_sched_getaffinity - .long sys_io_setup - .long sys_io_destroy -/* 245 */ .long sys_io_getevents - .long sys_io_submit - .long sys_io_cancel - .long sys_exit_group - .long sys_lookup_dcookie -/* 250 */ .long sys_epoll_create - .long ABI(sys_epoll_ctl, sys_oabi_epoll_ctl) - .long ABI(sys_epoll_wait, sys_oabi_epoll_wait) - .long sys_remap_file_pages - .long sys_ni_syscall /* sys_set_thread_area */ -/* 255 */ .long sys_ni_syscall /* sys_get_thread_area */ - .long sys_set_tid_address - .long sys_timer_create - .long sys_timer_settime - .long sys_timer_gettime -/* 260 */ .long sys_timer_getoverrun - .long sys_timer_delete - .long sys_clock_settime - .long sys_clock_gettime - .long sys_clock_getres -/* 265 */ .long sys_clock_nanosleep - .long sys_statfs64_wrapper - .long sys_fstatfs64_wrapper - .long sys_tgkill - .long sys_utimes -/* 270 */ .long sys_arm_fadvise64_64 - .long sys_pciconfig_iobase - .long sys_pciconfig_read - .long sys_pciconfig_write - .long sys_mq_open -/* 275 */ .long sys_mq_unlink - .long sys_mq_timedsend - .long sys_mq_timedreceive - .long sys_mq_notify - .long sys_mq_getsetattr -/* 280 */ .long sys_waitid - .long sys_socket - .long sys_bind - .long sys_connect - .long sys_listen -/* 285 */ .long sys_accept - .long sys_getsockname - .long sys_getpeername - .long sys_socketpair - .long sys_send -/* 290 */ .long sys_sendto - .long sys_recv - .long sys_recvfrom - .long sys_shutdown - .long sys_setsockopt -/* 295 */ .long sys_getsockopt - .long sys_sendmsg - .long sys_recvmsg - .long ABI(sys_semop, sys_oabi_semop) - .long sys_semget -/* 300 */ .long sys_semctl - .long sys_msgsnd - .long sys_msgrcv - .long sys_msgget - .long sys_msgctl -/* 305 */ .long sys_shmat - .long sys_shmdt - .long sys_shmget - .long sys_shmctl - .long sys_add_key -/* 310 */ .long sys_request_key - .long sys_keyctl - .long ABI(sys_semtimedop, sys_oabi_semtimedop) -/* vserver */ .long sys_ni_syscall - .long sys_ioprio_set -/* 315 */ .long sys_ioprio_get - .long sys_inotify_init - .long sys_inotify_add_watch - .long sys_inotify_rm_watch - .long sys_mbind -/* 320 */ .long sys_get_mempolicy - .long sys_set_mempolicy - - .rept NR_syscalls - (. - 100b) / 4 - .long sys_ni_syscall - .endr +/* 0 */ CALL(sys_restart_syscall) + CALL(sys_exit) + CALL(sys_fork_wrapper) + CALL(sys_read) + CALL(sys_write) +/* 5 */ CALL(sys_open) + CALL(sys_close) + CALL(sys_ni_syscall) /* was sys_waitpid */ + CALL(sys_creat) + CALL(sys_link) +/* 10 */ CALL(sys_unlink) + CALL(sys_execve_wrapper) + CALL(sys_chdir) + CALL(OBSOLETE(sys_time)) /* used by libc4 */ + CALL(sys_mknod) +/* 15 */ CALL(sys_chmod) + CALL(sys_lchown16) + CALL(sys_ni_syscall) /* was sys_break */ + CALL(sys_ni_syscall) /* was sys_stat */ + CALL(sys_lseek) +/* 20 */ CALL(sys_getpid) + CALL(sys_mount) + CALL(OBSOLETE(sys_oldumount)) /* used by libc4 */ + CALL(sys_setuid16) + CALL(sys_getuid16) +/* 25 */ CALL(OBSOLETE(sys_stime)) + CALL(sys_ptrace) + CALL(OBSOLETE(sys_alarm)) /* used by libc4 */ + CALL(sys_ni_syscall) /* was sys_fstat */ + CALL(sys_pause) +/* 30 */ CALL(OBSOLETE(sys_utime)) /* used by libc4 */ + CALL(sys_ni_syscall) /* was sys_stty */ + CALL(sys_ni_syscall) /* was sys_getty */ + CALL(sys_access) + CALL(sys_nice) +/* 35 */ CALL(sys_ni_syscall) /* was sys_ftime */ + CALL(sys_sync) + CALL(sys_kill) + CALL(sys_rename) + CALL(sys_mkdir) +/* 40 */ CALL(sys_rmdir) + CALL(sys_dup) + CALL(sys_pipe) + CALL(sys_times) + CALL(sys_ni_syscall) /* was sys_prof */ +/* 45 */ CALL(sys_brk) + CALL(sys_setgid16) + CALL(sys_getgid16) + CALL(sys_ni_syscall) /* was sys_signal */ + CALL(sys_geteuid16) +/* 50 */ CALL(sys_getegid16) + CALL(sys_acct) + CALL(sys_umount) + CALL(sys_ni_syscall) /* was sys_lock */ + CALL(sys_ioctl) +/* 55 */ CALL(sys_fcntl) + CALL(sys_ni_syscall) /* was sys_mpx */ + CALL(sys_setpgid) + CALL(sys_ni_syscall) /* was sys_ulimit */ + CALL(sys_ni_syscall) /* was sys_olduname */ +/* 60 */ CALL(sys_umask) + CALL(sys_chroot) + CALL(sys_ustat) + CALL(sys_dup2) + CALL(sys_getppid) +/* 65 */ CALL(sys_getpgrp) + CALL(sys_setsid) + CALL(sys_sigaction) + CALL(sys_ni_syscall) /* was sys_sgetmask */ + CALL(sys_ni_syscall) /* was sys_ssetmask */ +/* 70 */ CALL(sys_setreuid16) + CALL(sys_setregid16) + CALL(sys_sigsuspend_wrapper) + CALL(sys_sigpending) + CALL(sys_sethostname) +/* 75 */ CALL(sys_setrlimit) + CALL(OBSOLETE(sys_old_getrlimit)) /* used by libc4 */ + CALL(sys_getrusage) + CALL(sys_gettimeofday) + CALL(sys_settimeofday) +/* 80 */ CALL(sys_getgroups16) + CALL(sys_setgroups16) + CALL(OBSOLETE(old_select)) /* used by libc4 */ + CALL(sys_symlink) + CALL(sys_ni_syscall) /* was sys_lstat */ +/* 85 */ CALL(sys_readlink) + CALL(sys_uselib) + CALL(sys_swapon) + CALL(sys_reboot) + CALL(OBSOLETE(old_readdir)) /* used by libc4 */ +/* 90 */ CALL(OBSOLETE(old_mmap)) /* used by libc4 */ + CALL(sys_munmap) + CALL(sys_truncate) + CALL(sys_ftruncate) + CALL(sys_fchmod) +/* 95 */ CALL(sys_fchown16) + CALL(sys_getpriority) + CALL(sys_setpriority) + CALL(sys_ni_syscall) /* was sys_profil */ + CALL(sys_statfs) +/* 100 */ CALL(sys_fstatfs) + CALL(sys_ni_syscall) + CALL(OBSOLETE(sys_socketcall)) + CALL(sys_syslog) + CALL(sys_setitimer) +/* 105 */ CALL(sys_getitimer) + CALL(sys_newstat) + CALL(sys_newlstat) + CALL(sys_newfstat) + CALL(sys_ni_syscall) /* was sys_uname */ +/* 110 */ CALL(sys_ni_syscall) /* was sys_iopl */ + CALL(sys_vhangup) + CALL(sys_ni_syscall) + CALL(OBSOLETE(sys_syscall)) /* call a syscall */ + CALL(sys_wait4) +/* 115 */ CALL(sys_swapoff) + CALL(sys_sysinfo) + CALL(OBSOLETE(ABI(sys_ipc, sys_oabi_ipc))) + CALL(sys_fsync) + CALL(sys_sigreturn_wrapper) +/* 120 */ CALL(sys_clone_wrapper) + CALL(sys_setdomainname) + CALL(sys_newuname) + CALL(sys_ni_syscall) + CALL(sys_adjtimex) +/* 125 */ CALL(sys_mprotect) + CALL(sys_sigprocmask) + CALL(sys_ni_syscall) /* was sys_create_module */ + CALL(sys_init_module) + CALL(sys_delete_module) +/* 130 */ CALL(sys_ni_syscall) /* was sys_get_kernel_syms */ + CALL(sys_quotactl) + CALL(sys_getpgid) + CALL(sys_fchdir) + CALL(sys_bdflush) +/* 135 */ CALL(sys_sysfs) + CALL(sys_personality) + CALL(sys_ni_syscall) /* CALL(_sys_afs_syscall) */ + CALL(sys_setfsuid16) + CALL(sys_setfsgid16) +/* 140 */ CALL(sys_llseek) + CALL(sys_getdents) + CALL(sys_select) + CALL(sys_flock) + CALL(sys_msync) +/* 145 */ CALL(sys_readv) + CALL(sys_writev) + CALL(sys_getsid) + CALL(sys_fdatasync) + CALL(sys_sysctl) +/* 150 */ CALL(sys_mlock) + CALL(sys_munlock) + CALL(sys_mlockall) + CALL(sys_munlockall) + CALL(sys_sched_setparam) +/* 155 */ CALL(sys_sched_getparam) + CALL(sys_sched_setscheduler) + CALL(sys_sched_getscheduler) + CALL(sys_sched_yield) + CALL(sys_sched_get_priority_max) +/* 160 */ CALL(sys_sched_get_priority_min) + CALL(sys_sched_rr_get_interval) + CALL(sys_nanosleep) + CALL(sys_arm_mremap) + CALL(sys_setresuid16) +/* 165 */ CALL(sys_getresuid16) + CALL(sys_ni_syscall) + CALL(sys_ni_syscall) /* was sys_query_module */ + CALL(sys_poll) + CALL(sys_nfsservctl) +/* 170 */ CALL(sys_setresgid16) + CALL(sys_getresgid16) + CALL(sys_prctl) + CALL(sys_rt_sigreturn_wrapper) + CALL(sys_rt_sigaction) +/* 175 */ CALL(sys_rt_sigprocmask) + CALL(sys_rt_sigpending) + CALL(sys_rt_sigtimedwait) + CALL(sys_rt_sigqueueinfo) + CALL(sys_rt_sigsuspend_wrapper) +/* 180 */ CALL(ABI(sys_pread64, sys_oabi_pread64)) + CALL(ABI(sys_pwrite64, sys_oabi_pwrite64)) + CALL(sys_chown16) + CALL(sys_getcwd) + CALL(sys_capget) +/* 185 */ CALL(sys_capset) + CALL(sys_sigaltstack_wrapper) + CALL(sys_sendfile) + CALL(sys_ni_syscall) + CALL(sys_ni_syscall) +/* 190 */ CALL(sys_vfork_wrapper) + CALL(sys_getrlimit) + CALL(sys_mmap2) + CALL(ABI(sys_truncate64, sys_oabi_truncate64)) + CALL(ABI(sys_ftruncate64, sys_oabi_ftruncate64)) +/* 195 */ CALL(ABI(sys_stat64, sys_oabi_stat64)) + CALL(ABI(sys_lstat64, sys_oabi_lstat64)) + CALL(ABI(sys_fstat64, sys_oabi_fstat64)) + CALL(sys_lchown) + CALL(sys_getuid) +/* 200 */ CALL(sys_getgid) + CALL(sys_geteuid) + CALL(sys_getegid) + CALL(sys_setreuid) + CALL(sys_setregid) +/* 205 */ CALL(sys_getgroups) + CALL(sys_setgroups) + CALL(sys_fchown) + CALL(sys_setresuid) + CALL(sys_getresuid) +/* 210 */ CALL(sys_setresgid) + CALL(sys_getresgid) + CALL(sys_chown) + CALL(sys_setuid) + CALL(sys_setgid) +/* 215 */ CALL(sys_setfsuid) + CALL(sys_setfsgid) + CALL(sys_getdents64) + CALL(sys_pivot_root) + CALL(sys_mincore) +/* 220 */ CALL(sys_madvise) + CALL(ABI(sys_fcntl64, sys_oabi_fcntl64)) + CALL(sys_ni_syscall) /* TUX */ + CALL(sys_ni_syscall) + CALL(sys_gettid) +/* 225 */ CALL(ABI(sys_readahead, sys_oabi_readahead)) + CALL(sys_setxattr) + CALL(sys_lsetxattr) + CALL(sys_fsetxattr) + CALL(sys_getxattr) +/* 230 */ CALL(sys_lgetxattr) + CALL(sys_fgetxattr) + CALL(sys_listxattr) + CALL(sys_llistxattr) + CALL(sys_flistxattr) +/* 235 */ CALL(sys_removexattr) + CALL(sys_lremovexattr) + CALL(sys_fremovexattr) + CALL(sys_tkill) + CALL(sys_sendfile64) +/* 240 */ CALL(sys_futex) + CALL(sys_sched_setaffinity) + CALL(sys_sched_getaffinity) + CALL(sys_io_setup) + CALL(sys_io_destroy) +/* 245 */ CALL(sys_io_getevents) + CALL(sys_io_submit) + CALL(sys_io_cancel) + CALL(sys_exit_group) + CALL(sys_lookup_dcookie) +/* 250 */ CALL(sys_epoll_create) + CALL(ABI(sys_epoll_ctl, sys_oabi_epoll_ctl)) + CALL(ABI(sys_epoll_wait, sys_oabi_epoll_wait)) + CALL(sys_remap_file_pages) + CALL(sys_ni_syscall) /* sys_set_thread_area */ +/* 255 */ CALL(sys_ni_syscall) /* sys_get_thread_area */ + CALL(sys_set_tid_address) + CALL(sys_timer_create) + CALL(sys_timer_settime) + CALL(sys_timer_gettime) +/* 260 */ CALL(sys_timer_getoverrun) + CALL(sys_timer_delete) + CALL(sys_clock_settime) + CALL(sys_clock_gettime) + CALL(sys_clock_getres) +/* 265 */ CALL(sys_clock_nanosleep) + CALL(sys_statfs64_wrapper) + CALL(sys_fstatfs64_wrapper) + CALL(sys_tgkill) + CALL(sys_utimes) +/* 270 */ CALL(sys_arm_fadvise64_64) + CALL(sys_pciconfig_iobase) + CALL(sys_pciconfig_read) + CALL(sys_pciconfig_write) + CALL(sys_mq_open) +/* 275 */ CALL(sys_mq_unlink) + CALL(sys_mq_timedsend) + CALL(sys_mq_timedreceive) + CALL(sys_mq_notify) + CALL(sys_mq_getsetattr) +/* 280 */ CALL(sys_waitid) + CALL(sys_socket) + CALL(sys_bind) + CALL(sys_connect) + CALL(sys_listen) +/* 285 */ CALL(sys_accept) + CALL(sys_getsockname) + CALL(sys_getpeername) + CALL(sys_socketpair) + CALL(sys_send) +/* 290 */ CALL(sys_sendto) + CALL(sys_recv) + CALL(sys_recvfrom) + CALL(sys_shutdown) + CALL(sys_setsockopt) +/* 295 */ CALL(sys_getsockopt) + CALL(sys_sendmsg) + CALL(sys_recvmsg) + CALL(ABI(sys_semop, sys_oabi_semop)) + CALL(sys_semget) +/* 300 */ CALL(sys_semctl) + CALL(sys_msgsnd) + CALL(sys_msgrcv) + CALL(sys_msgget) + CALL(sys_msgctl) +/* 305 */ CALL(sys_shmat) + CALL(sys_shmdt) + CALL(sys_shmget) + CALL(sys_shmctl) + CALL(sys_add_key) +/* 310 */ CALL(sys_request_key) + CALL(sys_keyctl) + CALL(ABI(sys_semtimedop, sys_oabi_semtimedop)) +/* vserver */ CALL(sys_ni_syscall) + CALL(sys_ioprio_set) +/* 315 */ CALL(sys_ioprio_get) + CALL(sys_inotify_init) + CALL(sys_inotify_add_watch) + CALL(sys_inotify_rm_watch) + CALL(sys_mbind) +/* 320 */ CALL(sys_get_mempolicy) + CALL(sys_set_mempolicy) +#ifndef syscalls_counted +.equ syscalls_padding, ((NR_syscalls + 3) & ~3) - NR_syscalls +#define syscalls_counted #endif +.rept syscalls_padding + CALL(sys_ni_syscall) +.endr diff --git a/arch/arm/kernel/entry-common.S b/arch/arm/kernel/entry-common.S index 2b92ce85f97..dbcb11a31f7 100644 --- a/arch/arm/kernel/entry-common.S +++ b/arch/arm/kernel/entry-common.S @@ -87,7 +87,11 @@ ENTRY(ret_from_fork) b ret_slow_syscall + .equ NR_syscalls,0 +#define CALL(x) .equ NR_syscalls,NR_syscalls+1 #include "calls.S" +#undef CALL +#define CALL(x) .long x /*============================================================================= * SWI handler diff --git a/arch/arm/mach-integrator/integrator_cp.c b/arch/arm/mach-integrator/integrator_cp.c index 31820170f30..a0724f2b24c 100644 --- a/arch/arm/mach-integrator/integrator_cp.c +++ b/arch/arm/mach-integrator/integrator_cp.c @@ -469,7 +469,9 @@ static void cp_clcd_enable(struct clcd_fb *fb) if (fb->fb.var.bits_per_pixel <= 8) val = CM_CTRL_LCDMUXSEL_VGA_8421BPP; else if (fb->fb.var.bits_per_pixel <= 16) - val = CM_CTRL_LCDMUXSEL_VGA_16BPP; + val = CM_CTRL_LCDMUXSEL_VGA_16BPP + | CM_CTRL_LCDEN0 | CM_CTRL_LCDEN1 + | CM_CTRL_STATIC1 | CM_CTRL_STATIC2; else val = 0; /* no idea for this, don't trust the docs */ diff --git a/arch/arm/mach-s3c2410/cpu.h b/arch/arm/mach-s3c2410/cpu.h index 9cbe5eef492..fc1067783f6 100644 --- a/arch/arm/mach-s3c2410/cpu.h +++ b/arch/arm/mach-s3c2410/cpu.h @@ -17,11 +17,12 @@ * 14-Jan-2005 BJD Added s3c24xx_init_clocks() call * 10-Mar-2005 LCVR Changed S3C2410_{VA,SZ} to S3C24XX_{VA,SZ} & IODESC_ENT * 14-Mar-2005 BJD Updated for __iomem + * 15-Jan-2006 LCVR Updated S3C2410_PA_##x to new S3C24XX_PA_##x macro */ /* todo - fix when rmk changes iodescs to use `void __iomem *` */ -#define IODESC_ENT(x) { (unsigned long)S3C24XX_VA_##x, __phys_to_pfn(S3C2410_PA_##x), S3C24XX_SZ_##x, MT_DEVICE } +#define IODESC_ENT(x) { (unsigned long)S3C24XX_VA_##x, __phys_to_pfn(S3C24XX_PA_##x), S3C24XX_SZ_##x, MT_DEVICE } #ifndef MHZ #define MHZ (1000*1000) diff --git a/arch/arm/mach-s3c2410/devs.c b/arch/arm/mach-s3c2410/devs.c index f58406e6ef5..b8d994a24d1 100644 --- a/arch/arm/mach-s3c2410/devs.c +++ b/arch/arm/mach-s3c2410/devs.c @@ -10,6 +10,7 @@ * published by the Free Software Foundation. * * Modifications: + * 15-Jan-2006 LCVR Using S3C24XX_PA_##x macro for common S3C24XX devices * 10-Mar-2005 LCVR Changed S3C2410_{VA,SZ} to S3C24XX_{VA,SZ} * 10-Feb-2005 BJD Added camera from guillaume.gourat@nexvision.tv * 29-Aug-2004 BJD Added timers 0 through 3 @@ -46,8 +47,8 @@ struct platform_device *s3c24xx_uart_devs[3]; static struct resource s3c_usb_resource[] = { [0] = { - .start = S3C2410_PA_USBHOST, - .end = S3C2410_PA_USBHOST + S3C24XX_SZ_USBHOST - 1, + .start = S3C24XX_PA_USBHOST, + .end = S3C24XX_PA_USBHOST + S3C24XX_SZ_USBHOST - 1, .flags = IORESOURCE_MEM, }, [1] = { @@ -76,8 +77,8 @@ EXPORT_SYMBOL(s3c_device_usb); static struct resource s3c_lcd_resource[] = { [0] = { - .start = S3C2410_PA_LCD, - .end = S3C2410_PA_LCD + S3C24XX_SZ_LCD - 1, + .start = S3C24XX_PA_LCD, + .end = S3C24XX_PA_LCD + S3C24XX_SZ_LCD - 1, .flags = IORESOURCE_MEM, }, [1] = { @@ -139,8 +140,8 @@ EXPORT_SYMBOL(s3c_device_nand); static struct resource s3c_usbgadget_resource[] = { [0] = { - .start = S3C2410_PA_USBDEV, - .end = S3C2410_PA_USBDEV + S3C24XX_SZ_USBDEV - 1, + .start = S3C24XX_PA_USBDEV, + .end = S3C24XX_PA_USBDEV + S3C24XX_SZ_USBDEV - 1, .flags = IORESOURCE_MEM, }, [1] = { @@ -164,8 +165,8 @@ EXPORT_SYMBOL(s3c_device_usbgadget); static struct resource s3c_wdt_resource[] = { [0] = { - .start = S3C2410_PA_WATCHDOG, - .end = S3C2410_PA_WATCHDOG + S3C24XX_SZ_WATCHDOG - 1, + .start = S3C24XX_PA_WATCHDOG, + .end = S3C24XX_PA_WATCHDOG + S3C24XX_SZ_WATCHDOG - 1, .flags = IORESOURCE_MEM, }, [1] = { @@ -189,8 +190,8 @@ EXPORT_SYMBOL(s3c_device_wdt); static struct resource s3c_i2c_resource[] = { [0] = { - .start = S3C2410_PA_IIC, - .end = S3C2410_PA_IIC + S3C24XX_SZ_IIC - 1, + .start = S3C24XX_PA_IIC, + .end = S3C24XX_PA_IIC + S3C24XX_SZ_IIC - 1, .flags = IORESOURCE_MEM, }, [1] = { @@ -214,8 +215,8 @@ EXPORT_SYMBOL(s3c_device_i2c); static struct resource s3c_iis_resource[] = { [0] = { - .start = S3C2410_PA_IIS, - .end = S3C2410_PA_IIS + S3C24XX_SZ_IIS -1, + .start = S3C24XX_PA_IIS, + .end = S3C24XX_PA_IIS + S3C24XX_SZ_IIS -1, .flags = IORESOURCE_MEM, } }; @@ -239,8 +240,8 @@ EXPORT_SYMBOL(s3c_device_iis); static struct resource s3c_rtc_resource[] = { [0] = { - .start = S3C2410_PA_RTC, - .end = S3C2410_PA_RTC + 0xff, + .start = S3C24XX_PA_RTC, + .end = S3C24XX_PA_RTC + 0xff, .flags = IORESOURCE_MEM, }, [1] = { @@ -268,8 +269,8 @@ EXPORT_SYMBOL(s3c_device_rtc); static struct resource s3c_adc_resource[] = { [0] = { - .start = S3C2410_PA_ADC, - .end = S3C2410_PA_ADC + S3C24XX_SZ_ADC - 1, + .start = S3C24XX_PA_ADC, + .end = S3C24XX_PA_ADC + S3C24XX_SZ_ADC - 1, .flags = IORESOURCE_MEM, }, [1] = { @@ -316,8 +317,8 @@ EXPORT_SYMBOL(s3c_device_sdi); static struct resource s3c_spi0_resource[] = { [0] = { - .start = S3C2410_PA_SPI, - .end = S3C2410_PA_SPI + 0x1f, + .start = S3C24XX_PA_SPI, + .end = S3C24XX_PA_SPI + 0x1f, .flags = IORESOURCE_MEM, }, [1] = { @@ -341,8 +342,8 @@ EXPORT_SYMBOL(s3c_device_spi0); static struct resource s3c_spi1_resource[] = { [0] = { - .start = S3C2410_PA_SPI + 0x20, - .end = S3C2410_PA_SPI + 0x20 + 0x1f, + .start = S3C24XX_PA_SPI + 0x20, + .end = S3C24XX_PA_SPI + 0x20 + 0x1f, .flags = IORESOURCE_MEM, }, [1] = { @@ -366,8 +367,8 @@ EXPORT_SYMBOL(s3c_device_spi1); static struct resource s3c_timer0_resource[] = { [0] = { - .start = S3C2410_PA_TIMER + 0x0C, - .end = S3C2410_PA_TIMER + 0x0C + 0xB, + .start = S3C24XX_PA_TIMER + 0x0C, + .end = S3C24XX_PA_TIMER + 0x0C + 0xB, .flags = IORESOURCE_MEM, }, [1] = { @@ -391,8 +392,8 @@ EXPORT_SYMBOL(s3c_device_timer0); static struct resource s3c_timer1_resource[] = { [0] = { - .start = S3C2410_PA_TIMER + 0x18, - .end = S3C2410_PA_TIMER + 0x23, + .start = S3C24XX_PA_TIMER + 0x18, + .end = S3C24XX_PA_TIMER + 0x23, .flags = IORESOURCE_MEM, }, [1] = { @@ -416,8 +417,8 @@ EXPORT_SYMBOL(s3c_device_timer1); static struct resource s3c_timer2_resource[] = { [0] = { - .start = S3C2410_PA_TIMER + 0x24, - .end = S3C2410_PA_TIMER + 0x2F, + .start = S3C24XX_PA_TIMER + 0x24, + .end = S3C24XX_PA_TIMER + 0x2F, .flags = IORESOURCE_MEM, }, [1] = { @@ -441,8 +442,8 @@ EXPORT_SYMBOL(s3c_device_timer2); static struct resource s3c_timer3_resource[] = { [0] = { - .start = S3C2410_PA_TIMER + 0x30, - .end = S3C2410_PA_TIMER + 0x3B, + .start = S3C24XX_PA_TIMER + 0x30, + .end = S3C24XX_PA_TIMER + 0x3B, .flags = IORESOURCE_MEM, }, [1] = { diff --git a/arch/arm/mach-s3c2410/dma.c b/arch/arm/mach-s3c2410/dma.c index 65feaf20d23..4dbd8e758ea 100644 --- a/arch/arm/mach-s3c2410/dma.c +++ b/arch/arm/mach-s3c2410/dma.c @@ -1152,7 +1152,7 @@ static int __init s3c2410_init_dma(void) printk("S3C2410 DMA Driver, (c) 2003-2004 Simtec Electronics\n"); - dma_base = ioremap(S3C2410_PA_DMA, 0x200); + dma_base = ioremap(S3C24XX_PA_DMA, 0x200); if (dma_base == NULL) { printk(KERN_ERR "dma failed to remap register block\n"); return -ENOMEM; diff --git a/arch/arm/mach-s3c2410/sleep.S b/arch/arm/mach-s3c2410/sleep.S index 61768dac7fe..e9a055b779b 100644 --- a/arch/arm/mach-s3c2410/sleep.S +++ b/arch/arm/mach-s3c2410/sleep.S @@ -133,12 +133,12 @@ ENTRY(s3c2410_cpu_resume) @@ load UART to allow us to print the two characters for @@ resume debug - mov r2, #S3C2410_PA_UART & 0xff000000 - orr r2, r2, #S3C2410_PA_UART & 0xff000 + mov r2, #S3C24XX_PA_UART & 0xff000000 + orr r2, r2, #S3C24XX_PA_UART & 0xff000 #if 0 /* SMDK2440 LED set */ - mov r14, #S3C2410_PA_GPIO + mov r14, #S3C24XX_PA_GPIO ldr r12, [ r14, #0x54 ] bic r12, r12, #3<<4 orr r12, r12, #1<<7 diff --git a/arch/arm/mm/ioremap.c b/arch/arm/mm/ioremap.c index de3ce1eec2e..da9b3597411 100644 --- a/arch/arm/mm/ioremap.c +++ b/arch/arm/mm/ioremap.c @@ -142,7 +142,7 @@ __ioremap_pfn(unsigned long pfn, unsigned long offset, size_t size, return NULL; addr = (unsigned long)area->addr; if (remap_area_pages(addr, pfn, size, flags)) { - vfree(addr); + vfree((void *)addr); return NULL; } return (void __iomem *) (offset + (char *)addr); diff --git a/arch/arm/mm/mm-armv.c b/arch/arm/mm/mm-armv.c index d0245a31d4d..ef8d30a185a 100644 --- a/arch/arm/mm/mm-armv.c +++ b/arch/arm/mm/mm-armv.c @@ -343,6 +343,12 @@ static struct mem_types mem_types[] __initdata = { PMD_SECT_AP_WRITE | PMD_SECT_BUFFERABLE | PMD_SECT_TEX(1), .domain = DOMAIN_IO, + }, + [MT_NONSHARED_DEVICE] = { + .prot_l1 = PMD_TYPE_TABLE, + .prot_sect = PMD_TYPE_SECT | PMD_SECT_NONSHARED_DEV | + PMD_SECT_AP_WRITE, + .domain = DOMAIN_IO, } }; diff --git a/arch/powerpc/platforms/powermac/feature.c b/arch/powerpc/platforms/powermac/feature.c index 558dd069209..2296f3d46ca 100644 --- a/arch/powerpc/platforms/powermac/feature.c +++ b/arch/powerpc/platforms/powermac/feature.c @@ -910,16 +910,18 @@ core99_gmac_phy_reset(struct device_node *node, long param, long value) macio->type != macio_intrepid) return -ENODEV; + printk(KERN_DEBUG "Hard reset of PHY chip ...\n"); + LOCK(flags); MACIO_OUT8(KL_GPIO_ETH_PHY_RESET, KEYLARGO_GPIO_OUTPUT_ENABLE); (void)MACIO_IN8(KL_GPIO_ETH_PHY_RESET); UNLOCK(flags); - mdelay(10); + msleep(10); LOCK(flags); MACIO_OUT8(KL_GPIO_ETH_PHY_RESET, /*KEYLARGO_GPIO_OUTPUT_ENABLE | */ KEYLARGO_GPIO_OUTOUT_DATA); UNLOCK(flags); - mdelay(10); + msleep(10); return 0; } diff --git a/arch/ppc/syslib/mv64x60.c b/arch/ppc/syslib/mv64x60.c index 94ea346b7b4..1f01b7e2376 100644 --- a/arch/ppc/syslib/mv64x60.c +++ b/arch/ppc/syslib/mv64x60.c @@ -313,7 +313,7 @@ static struct platform_device mpsc1_device = { }; #endif -#ifdef CONFIG_MV643XX_ETH +#if defined(CONFIG_MV643XX_ETH) || defined(CONFIG_MV643XX_ETH_MODULE) static struct resource mv64x60_eth_shared_resources[] = { [0] = { .name = "ethernet shared base", @@ -456,7 +456,7 @@ static struct platform_device *mv64x60_pd_devs[] __initdata = { &mpsc0_device, &mpsc1_device, #endif -#ifdef CONFIG_MV643XX_ETH +#if defined(CONFIG_MV643XX_ETH) || defined(CONFIG_MV643XX_ETH_MODULE) &mv64x60_eth_shared_device, #endif #ifdef CONFIG_MV643XX_ETH_0 diff --git a/arch/sparc/kernel/entry.S b/arch/sparc/kernel/entry.S index c51d08d218e..267ec8f6fb5 100644 --- a/arch/sparc/kernel/entry.S +++ b/arch/sparc/kernel/entry.S @@ -38,7 +38,7 @@ #define curptr g6 -#define NR_SYSCALLS 284 /* Each OS is different... */ +#define NR_SYSCALLS 299 /* Each OS is different... */ /* These are just handy. */ #define _SV save %sp, -STACKFRAME_SZ, %sp diff --git a/arch/sparc/math-emu/math.c b/arch/sparc/math-emu/math.c index be2c80932e2..8613b3eb877 100644 --- a/arch/sparc/math-emu/math.c +++ b/arch/sparc/math-emu/math.c @@ -323,11 +323,6 @@ static int do_one_mathemu(u32 insn, unsigned long *pfsr, unsigned long *fregs) case FMOVS: case FABSS: case FNEGS: TYPE(2,1,0,1,0,0,0); break; - default: -#ifdef DEBUG_MATHEMU - printk("unknown FPop1: %03lx\n",(insn>>5)&0x1ff); -#endif - break; } } else if ((insn & 0xc1f80000) == 0x81a80000) /* FPOP2 */ { switch ((insn >> 5) & 0x1ff) { @@ -337,11 +332,6 @@ static int do_one_mathemu(u32 insn, unsigned long *pfsr, unsigned long *fregs) case FCMPED: TYPE(3,0,0,2,1,2,1); break; case FCMPQ: TYPE(3,0,0,3,1,3,1); break; case FCMPEQ: TYPE(3,0,0,3,1,3,1); break; - default: -#ifdef DEBUG_MATHEMU - printk("unknown FPop2: %03lx\n",(insn>>5)&0x1ff); -#endif - break; } } diff --git a/arch/sparc64/kernel/entry.S b/arch/sparc64/kernel/entry.S index e50e56e4ab6..12911e7463f 100644 --- a/arch/sparc64/kernel/entry.S +++ b/arch/sparc64/kernel/entry.S @@ -25,7 +25,7 @@ #define curptr g6 -#define NR_SYSCALLS 284 /* Each OS is different... */ +#define NR_SYSCALLS 299 /* Each OS is different... */ .text .align 32 diff --git a/arch/sparc64/kernel/sys32.S b/arch/sparc64/kernel/sys32.S index 9cd272ac3ac..60b59375aa7 100644 --- a/arch/sparc64/kernel/sys32.S +++ b/arch/sparc64/kernel/sys32.S @@ -84,7 +84,6 @@ SIGN2(sys32_fadvise64_64, compat_sys_fadvise64_64, %o0, %o5) SIGN2(sys32_bdflush, sys_bdflush, %o0, %o1) SIGN1(sys32_mlockall, sys_mlockall, %o0) SIGN1(sys32_nfsservctl, compat_sys_nfsservctl, %o0) -SIGN1(sys32_clock_settime, compat_sys_clock_settime, %o1) SIGN1(sys32_clock_nanosleep, compat_sys_clock_nanosleep, %o1) SIGN1(sys32_timer_settime, compat_sys_timer_settime, %o1) SIGN1(sys32_io_submit, compat_sys_io_submit, %o1) diff --git a/arch/sparc64/kernel/systbls.S b/arch/sparc64/kernel/systbls.S index bf0fc5bfbfb..2881faf3663 100644 --- a/arch/sparc64/kernel/systbls.S +++ b/arch/sparc64/kernel/systbls.S @@ -71,7 +71,7 @@ sys_call_table32: /*240*/ .word sys_munlockall, sys32_sched_setparam, sys32_sched_getparam, sys32_sched_setscheduler, sys32_sched_getscheduler .word sys_sched_yield, sys32_sched_get_priority_max, sys32_sched_get_priority_min, sys32_sched_rr_get_interval, compat_sys_nanosleep /*250*/ .word sys32_mremap, sys32_sysctl, sys32_getsid, sys_fdatasync, sys32_nfsservctl - .word sys_ni_syscall, sys32_clock_settime, compat_sys_clock_gettime, compat_sys_clock_getres, sys32_clock_nanosleep + .word sys_ni_syscall, compat_sys_clock_settime, compat_sys_clock_gettime, compat_sys_clock_getres, sys32_clock_nanosleep /*260*/ .word compat_sys_sched_getaffinity, compat_sys_sched_setaffinity, sys32_timer_settime, compat_sys_timer_gettime, sys_timer_getoverrun .word sys_timer_delete, compat_sys_timer_create, sys_ni_syscall, compat_sys_io_setup, sys_io_destroy /*270*/ .word sys32_io_submit, sys_io_cancel, compat_sys_io_getevents, sys32_mq_open, sys_mq_unlink diff --git a/block/elevator.c b/block/elevator.c index c9f424d5399..96a61e029ce 100644 --- a/block/elevator.c +++ b/block/elevator.c @@ -139,35 +139,16 @@ static int elevator_attach(request_queue_t *q, struct elevator_type *e, static char chosen_elevator[16]; -static void elevator_setup_default(void) +static int __init elevator_setup(char *str) { - struct elevator_type *e; - - /* - * If default has not been set, use the compiled-in selection. - */ - if (!chosen_elevator[0]) - strcpy(chosen_elevator, CONFIG_DEFAULT_IOSCHED); - /* * Be backwards-compatible with previous kernels, so users * won't get the wrong elevator. */ - if (!strcmp(chosen_elevator, "as")) + if (!strcmp(str, "as")) strcpy(chosen_elevator, "anticipatory"); - - /* - * If the given scheduler is not available, fall back to the default - */ - if ((e = elevator_find(chosen_elevator))) - elevator_put(e); else - strcpy(chosen_elevator, CONFIG_DEFAULT_IOSCHED); -} - -static int __init elevator_setup(char *str) -{ - strncpy(chosen_elevator, str, sizeof(chosen_elevator) - 1); + strncpy(chosen_elevator, str, sizeof(chosen_elevator) - 1); return 0; } @@ -184,14 +165,16 @@ int elevator_init(request_queue_t *q, char *name) q->end_sector = 0; q->boundary_rq = NULL; - elevator_setup_default(); + if (name && !(e = elevator_get(name))) + return -EINVAL; - if (!name) - name = chosen_elevator; + if (!e && *chosen_elevator && !(e = elevator_get(chosen_elevator))) + printk("I/O scheduler %s not found\n", chosen_elevator); - e = elevator_get(name); - if (!e) - return -EINVAL; + if (!e && !(e = elevator_get(CONFIG_DEFAULT_IOSCHED))) { + printk("Default I/O scheduler not found, using no-op\n"); + e = elevator_get("noop"); + } eq = kmalloc(sizeof(struct elevator_queue), GFP_KERNEL); if (!eq) { @@ -669,8 +652,10 @@ int elv_register(struct elevator_type *e) spin_unlock_irq(&elv_list_lock); printk(KERN_INFO "io scheduler %s registered", e->elevator_name); - if (!strcmp(e->elevator_name, chosen_elevator)) - printk(" (default)"); + if (!strcmp(e->elevator_name, chosen_elevator) || + (!*chosen_elevator && + !strcmp(e->elevator_name, CONFIG_DEFAULT_IOSCHED))) + printk(" (default)"); printk("\n"); return 0; } diff --git a/block/ll_rw_blk.c b/block/ll_rw_blk.c index 8e27d0ab0d7..d38b4afa37e 100644 --- a/block/ll_rw_blk.c +++ b/block/ll_rw_blk.c @@ -304,6 +304,7 @@ static inline void rq_init(request_queue_t *q, struct request *rq) * blk_queue_ordered - does this queue support ordered writes * @q: the request queue * @ordered: one of QUEUE_ORDERED_* + * @prepare_flush_fn: rq setup helper for cache flush ordered writes * * Description: * For journalled file systems, doing ordered writes on a commit @@ -332,6 +333,7 @@ int blk_queue_ordered(request_queue_t *q, unsigned ordered, return -EINVAL; } + q->ordered = ordered; q->next_ordered = ordered; q->prepare_flush_fn = prepare_flush_fn; @@ -662,7 +664,7 @@ EXPORT_SYMBOL(blk_queue_bounce_limit); * Enables a low level driver to set an upper limit on the size of * received requests. **/ -void blk_queue_max_sectors(request_queue_t *q, unsigned short max_sectors) +void blk_queue_max_sectors(request_queue_t *q, unsigned int max_sectors) { if ((max_sectors << 9) < PAGE_CACHE_SIZE) { max_sectors = 1 << (PAGE_CACHE_SHIFT - 9); @@ -2632,6 +2634,7 @@ EXPORT_SYMBOL(blk_put_request); /** * blk_end_sync_rq - executes a completion event on a request * @rq: request to complete + * @error: end io status of the request */ void blk_end_sync_rq(struct request *rq, int error) { @@ -3153,7 +3156,7 @@ static int __end_that_request_first(struct request *req, int uptodate, if (blk_fs_request(req) && req->rq_disk) { const int rw = rq_data_dir(req); - __disk_stat_add(req->rq_disk, sectors[rw], nr_bytes >> 9); + disk_stat_add(req->rq_disk, sectors[rw], nr_bytes >> 9); } total_bytes = bio_nbytes = 0; diff --git a/drivers/input/touchscreen/ads7846.c b/drivers/input/touchscreen/ads7846.c index dd8c6a9ffc7..b45a45ca7cc 100644 --- a/drivers/input/touchscreen/ads7846.c +++ b/drivers/input/touchscreen/ads7846.c @@ -29,9 +29,6 @@ #ifdef CONFIG_ARCH_OMAP #include <asm/arch/gpio.h> #endif - -#else -#define set_irq_type(irq,type) do{}while(0) #endif @@ -509,14 +506,14 @@ static int __devinit ads7846_probe(struct spi_device *spi) ts->msg.complete = ads7846_rx; ts->msg.context = ts; - if (request_irq(spi->irq, ads7846_irq, SA_SAMPLE_RANDOM, - spi->dev.bus_id, ts)) { + if (request_irq(spi->irq, ads7846_irq, + SA_SAMPLE_RANDOM | SA_TRIGGER_FALLING, + spi->dev.bus_id, ts)) { dev_dbg(&spi->dev, "irq %d busy?\n", spi->irq); input_unregister_device(&ts->input); kfree(ts); return -EBUSY; } - set_irq_type(spi->irq, IRQT_FALLING); dev_info(&spi->dev, "touchscreen, irq %d\n", spi->irq); diff --git a/drivers/message/fusion/Makefile b/drivers/message/fusion/Makefile index 8a2e2657f4c..33ace373241 100644 --- a/drivers/message/fusion/Makefile +++ b/drivers/message/fusion/Makefile @@ -29,6 +29,8 @@ # For mptctl: #CFLAGS_mptctl.o += -DMPT_DEBUG_IOCTL # +# For mptfc: +#CFLAGS_mptfc.o += -DMPT_DEBUG_FC #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-} LSI_LOGIC diff --git a/drivers/message/fusion/mptbase.c b/drivers/message/fusion/mptbase.c index d890b2b8a93..9a2c7605d49 100644 --- a/drivers/message/fusion/mptbase.c +++ b/drivers/message/fusion/mptbase.c @@ -81,6 +81,10 @@ MODULE_LICENSE("GPL"); /* * cmd line parameters */ +static int mpt_msi_enable; +module_param(mpt_msi_enable, int, 0); +MODULE_PARM_DESC(mpt_msi_enable, " MSI Support Enable (default=0)"); + #ifdef MFCNT static int mfcounter = 0; #define PRINT_MF_COUNT 20000 @@ -174,7 +178,7 @@ static void mpt_get_fw_exp_ver(char *buf, MPT_ADAPTER *ioc); static int ProcessEventNotification(MPT_ADAPTER *ioc, EventNotificationReply_t *evReply, int *evHandlers); static void mpt_sp_ioc_info(MPT_ADAPTER *ioc, u32 ioc_status, MPT_FRAME_HDR *mf); static void mpt_fc_log_info(MPT_ADAPTER *ioc, u32 log_info); -static void mpt_sp_log_info(MPT_ADAPTER *ioc, u32 log_info); +static void mpt_spi_log_info(MPT_ADAPTER *ioc, u32 log_info); static void mpt_sas_log_info(MPT_ADAPTER *ioc, u32 log_info); /* module entry point */ @@ -313,7 +317,7 @@ mpt_reply(MPT_ADAPTER *ioc, u32 pa) if (ioc->bus_type == FC) mpt_fc_log_info(ioc, log_info); else if (ioc->bus_type == SPI) - mpt_sp_log_info(ioc, log_info); + mpt_spi_log_info(ioc, log_info); else if (ioc->bus_type == SAS) mpt_sas_log_info(ioc, log_info); } @@ -1444,6 +1448,9 @@ mpt_attach(struct pci_dev *pdev, const struct pci_device_id *id) ioc->pci_irq = -1; if (pdev->irq) { + if (mpt_msi_enable && !pci_enable_msi(pdev)) + printk(MYIOC_s_INFO_FMT "PCI-MSI enabled\n", ioc->name); + r = request_irq(pdev->irq, mpt_interrupt, SA_SHIRQ, ioc->name, ioc); if (r < 0) { @@ -1483,6 +1490,10 @@ mpt_attach(struct pci_dev *pdev, const struct pci_device_id *id) list_del(&ioc->list); free_irq(ioc->pci_irq, ioc); + if (mpt_msi_enable) + pci_disable_msi(pdev); + if (ioc->alt_ioc) + ioc->alt_ioc->alt_ioc = NULL; iounmap(mem); kfree(ioc); pci_set_drvdata(pdev, NULL); @@ -2136,6 +2147,8 @@ mpt_adapter_dispose(MPT_ADAPTER *ioc) if (ioc->pci_irq != -1) { free_irq(ioc->pci_irq, ioc); + if (mpt_msi_enable) + pci_disable_msi(ioc->pcidev); ioc->pci_irq = -1; } @@ -2157,6 +2170,10 @@ mpt_adapter_dispose(MPT_ADAPTER *ioc) sz_last = ioc->alloc_total; dprintk((KERN_INFO MYNAM ": %s: free'd %d of %d bytes\n", ioc->name, sz_first-sz_last+(int)sizeof(*ioc), sz_first)); + + if (ioc->alt_ioc) + ioc->alt_ioc->alt_ioc = NULL; + kfree(ioc); } @@ -2770,13 +2787,16 @@ SendPortEnable(MPT_ADAPTER *ioc, int portnum, int sleepFlag) /* RAID FW may take a long time to enable */ - if ( (ioc->facts.ProductID & MPI_FW_HEADER_PID_PROD_MASK) - > MPI_FW_HEADER_PID_PROD_TARGET_SCSI ) { - rc = mpt_handshake_req_reply_wait(ioc, req_sz, (u32*)&port_enable, - reply_sz, (u16*)&reply_buf, 300 /*seconds*/, sleepFlag); + if (((ioc->facts.ProductID & MPI_FW_HEADER_PID_PROD_MASK) + > MPI_FW_HEADER_PID_PROD_TARGET_SCSI) || + (ioc->bus_type == SAS)) { + rc = mpt_handshake_req_reply_wait(ioc, req_sz, + (u32*)&port_enable, reply_sz, (u16*)&reply_buf, + 300 /*seconds*/, sleepFlag); } else { - rc = mpt_handshake_req_reply_wait(ioc, req_sz, (u32*)&port_enable, - reply_sz, (u16*)&reply_buf, 30 /*seconds*/, sleepFlag); + rc = mpt_handshake_req_reply_wait(ioc, req_sz, + (u32*)&port_enable, reply_sz, (u16*)&reply_buf, + 30 /*seconds*/, sleepFlag); } return rc; } @@ -4387,6 +4407,138 @@ mptbase_sas_persist_operation(MPT_ADAPTER *ioc, u8 persist_opcode) } /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ + +static void +mptbase_raid_process_event_data(MPT_ADAPTER *ioc, + MpiEventDataRaid_t * pRaidEventData) +{ + int volume; + int reason; + int disk; + int status; + int flags; + int state; + + volume = pRaidEventData->VolumeID; + reason = pRaidEventData->ReasonCode; + disk = pRaidEventData->PhysDiskNum; + status = le32_to_cpu(pRaidEventData->SettingsStatus); + flags = (status >> 0) & 0xff; + state = (status >> 8) & 0xff; + + if (reason == MPI_EVENT_RAID_RC_DOMAIN_VAL_NEEDED) { + return; + } + + if ((reason >= MPI_EVENT_RAID_RC_PHYSDISK_CREATED && + reason <= MPI_EVENT_RAID_RC_PHYSDISK_STATUS_CHANGED) || + (reason == MPI_EVENT_RAID_RC_SMART_DATA)) { + printk(MYIOC_s_INFO_FMT "RAID STATUS CHANGE for PhysDisk %d\n", + ioc->name, disk); + } else { + printk(MYIOC_s_INFO_FMT "RAID STATUS CHANGE for VolumeID %d\n", + ioc->name, volume); + } + + switch(reason) { + case MPI_EVENT_RAID_RC_VOLUME_CREATED: + printk(MYIOC_s_INFO_FMT " volume has been created\n", + ioc->name); + break; + + case MPI_EVENT_RAID_RC_VOLUME_DELETED: + + printk(MYIOC_s_INFO_FMT " volume has been deleted\n", + ioc->name); + break; + + case MPI_EVENT_RAID_RC_VOLUME_SETTINGS_CHANGED: + printk(MYIOC_s_INFO_FMT " volume settings have been changed\n", + ioc->name); + break; + + case MPI_EVENT_RAID_RC_VOLUME_STATUS_CHANGED: + printk(MYIOC_s_INFO_FMT " volume is now %s%s%s%s\n", + ioc->name, + state == MPI_RAIDVOL0_STATUS_STATE_OPTIMAL + ? "optimal" + : state == MPI_RAIDVOL0_STATUS_STATE_DEGRADED + ? "degraded" + : state == MPI_RAIDVOL0_STATUS_STATE_FAILED + ? "failed" + : "state unknown", + flags & MPI_RAIDVOL0_STATUS_FLAG_ENABLED + ? ", enabled" : "", + flags & MPI_RAIDVOL0_STATUS_FLAG_QUIESCED + ? ", quiesced" : "", + flags & MPI_RAIDVOL0_STATUS_FLAG_RESYNC_IN_PROGRESS + ? ", resync in progress" : "" ); + break; + + case MPI_EVENT_RAID_RC_VOLUME_PHYSDISK_CHANGED: + printk(MYIOC_s_INFO_FMT " volume membership of PhysDisk %d has changed\n", + ioc->name, disk); + break; + + case MPI_EVENT_RAID_RC_PHYSDISK_CREATED: + printk(MYIOC_s_INFO_FMT " PhysDisk has been created\n", + ioc->name); + break; + + case MPI_EVENT_RAID_RC_PHYSDISK_DELETED: + printk(MYIOC_s_INFO_FMT " PhysDisk has been deleted\n", + ioc->name); + break; + + case MPI_EVENT_RAID_RC_PHYSDISK_SETTINGS_CHANGED: + printk(MYIOC_s_INFO_FMT " PhysDisk settings have been changed\n", + ioc->name); + break; + + case MPI_EVENT_RAID_RC_PHYSDISK_STATUS_CHANGED: + printk(MYIOC_s_INFO_FMT " PhysDisk is now %s%s%s\n", + ioc->name, + state == MPI_PHYSDISK0_STATUS_ONLINE + ? "online" + : state == MPI_PHYSDISK0_STATUS_MISSING + ? "missing" + : state == MPI_PHYSDISK0_STATUS_NOT_COMPATIBLE + ? "not compatible" + : state == MPI_PHYSDISK0_STATUS_FAILED + ? "failed" + : state == MPI_PHYSDISK0_STATUS_INITIALIZING + ? "initializing" + : state == MPI_PHYSDISK0_STATUS_OFFLINE_REQUESTED + ? "offline requested" + : state == MPI_PHYSDISK0_STATUS_FAILED_REQUESTED + ? "failed requested" + : state == MPI_PHYSDISK0_STATUS_OTHER_OFFLINE + ? "offline" + : "state unknown", + flags & MPI_PHYSDISK0_STATUS_FLAG_OUT_OF_SYNC + ? ", out of sync" : "", + flags & MPI_PHYSDISK0_STATUS_FLAG_QUIESCED + ? ", quiesced" : "" ); + break; + + case MPI_EVENT_RAID_RC_DOMAIN_VAL_NEEDED: + printk(MYIOC_s_INFO_FMT " Domain Validation needed for PhysDisk %d\n", + ioc->name, disk); + break; + + case MPI_EVENT_RAID_RC_SMART_DATA: + printk(MYIOC_s_INFO_FMT " SMART data received, ASC/ASCQ = %02xh/%02xh\n", + ioc->name, pRaidEventData->ASC, pRaidEventData->ASCQ); + break; + + case MPI_EVENT_RAID_RC_REPLACE_ACTION_STARTED: + printk(MYIOC_s_INFO_FMT " replacement of PhysDisk %d has started\n", + ioc->name, disk); + break; + } +} + +/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ /* * GetIoUnitPage2 - Retrieve BIOS version and boot order information. * @ioc: Pointer to MPT_ADAPTER structure @@ -4598,6 +4750,14 @@ mpt_GetScsiPortSettings(MPT_ADAPTER *ioc, int portnum) SCSIPortPage2_t *pPP2 = (SCSIPortPage2_t *) pbuf; MpiDeviceInfo_t *pdevice = NULL; + /* + * Save "Set to Avoid SCSI Bus Resets" flag + */ + ioc->spi_data.bus_reset = + (le32_to_cpu(pPP2->PortFlags) & + MPI_SCSIPORTPAGE2_PORT_FLAGS_AVOID_SCSI_RESET) ? + 0 : 1 ; + /* Save the Port Page 2 data * (reformat into a 32bit quantity) */ @@ -5967,6 +6127,10 @@ ProcessEventNotification(MPT_ADAPTER *ioc, EventNotificationReply_t *pEventReply } } break; + case MPI_EVENT_INTEGRATED_RAID: + mptbase_raid_process_event_data(ioc, + (MpiEventDataRaid_t *)pEventReply->Data); + break; default: break; } @@ -6046,7 +6210,7 @@ mpt_fc_log_info(MPT_ADAPTER *ioc, u32 log_info) /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ /* - * mpt_sp_log_info - Log information returned from SCSI Parallel IOC. + * mpt_spi_log_info - Log information returned from SCSI Parallel IOC. * @ioc: Pointer to MPT_ADAPTER structure * @mr: Pointer to MPT reply frame * @log_info: U32 LogInfo word from the IOC @@ -6054,7 +6218,7 @@ mpt_fc_log_info(MPT_ADAPTER *ioc, u32 log_info) * Refer to lsi/sp_log.h. */ static void -mpt_sp_log_info(MPT_ADAPTER *ioc, u32 log_info) +mpt_spi_log_info(MPT_ADAPTER *ioc, u32 log_info) { u32 info = log_info & 0x00FF0000; char *desc = "unknown"; diff --git a/drivers/message/fusion/mptbase.h b/drivers/message/fusion/mptbase.h index 47053ac6506..ea2649ecad1 100644 --- a/drivers/message/fusion/mptbase.h +++ b/drivers/message/fusion/mptbase.h @@ -76,8 +76,8 @@ #define COPYRIGHT "Copyright (c) 1999-2005 " MODULEAUTHOR #endif -#define MPT_LINUX_VERSION_COMMON "3.03.06" -#define MPT_LINUX_PACKAGE_NAME "@(#)mptlinux-3.03.06" +#define MPT_LINUX_VERSION_COMMON "3.03.07" +#define MPT_LINUX_PACKAGE_NAME "@(#)mptlinux-3.03.07" #define WHAT_MAGIC_STRING "@" "(" "#" ")" #define show_mptmod_ver(s,ver) \ @@ -123,7 +123,7 @@ #define MPT_MAX_FRAME_SIZE 128 #define MPT_DEFAULT_FRAME_SIZE 128 -#define MPT_REPLY_FRAME_SIZE 0x40 /* Must be a multiple of 8 */ +#define MPT_REPLY_FRAME_SIZE 0x50 /* Must be a multiple of 8 */ #define MPT_SG_REQ_128_SCALE 1 #define MPT_SG_REQ_96_SCALE 2 @@ -510,9 +510,10 @@ struct mptfc_rport_info { struct list_head list; struct fc_rport *rport; - VirtDevice *vdev; + struct scsi_target *starget; FCDevicePage0_t pg0; u8 flags; + u8 remap_needed; }; /* @@ -631,6 +632,7 @@ typedef struct _MPT_ADAPTER struct mutex sas_topology_mutex; MPT_SAS_MGMT sas_mgmt; int num_ports; + struct work_struct mptscsih_persistTask; struct list_head fc_rports; spinlock_t fc_rport_lock; /* list and ri flags */ @@ -803,6 +805,12 @@ typedef struct _mpt_sge { #define dreplyprintk(x) #endif +#ifdef DMPT_DEBUG_FC +#define dfcprintk(x) printk x +#else +#define dfcprintk(x) +#endif + #ifdef MPT_DEBUG_TM #define dtmprintk(x) printk x #define DBG_DUMP_TM_REQUEST_FRAME(mfp) \ diff --git a/drivers/message/fusion/mptfc.c b/drivers/message/fusion/mptfc.c index b102c7666d0..c3a3499bce2 100644 --- a/drivers/message/fusion/mptfc.c +++ b/drivers/message/fusion/mptfc.c @@ -93,10 +93,11 @@ static int mptfcDoneCtx = -1; static int mptfcTaskCtx = -1; static int mptfcInternalCtx = -1; /* Used only for internal commands */ -int mptfc_slave_alloc(struct scsi_device *device); +static int mptfc_target_alloc(struct scsi_target *starget); +static int mptfc_slave_alloc(struct scsi_device *sdev); static int mptfc_qcmd(struct scsi_cmnd *SCpnt, - void (*done)(struct scsi_cmnd *)); - + void (*done)(struct scsi_cmnd *)); +static void mptfc_target_destroy(struct scsi_target *starget); static void mptfc_set_rport_loss_tmo(struct fc_rport *rport, uint32_t timeout); static void __devexit mptfc_remove(struct pci_dev *pdev); @@ -107,10 +108,10 @@ static struct scsi_host_template mptfc_driver_template = { .name = "MPT FC Host", .info = mptscsih_info, .queuecommand = mptfc_qcmd, - .target_alloc = mptscsih_target_alloc, + .target_alloc = mptfc_target_alloc, .slave_alloc = mptfc_slave_alloc, .slave_configure = mptscsih_slave_configure, - .target_destroy = mptscsih_target_destroy, + .target_destroy = mptfc_target_destroy, .slave_destroy = mptscsih_slave_destroy, .change_queue_depth = mptscsih_change_queue_depth, .eh_abort_handler = mptscsih_abort, @@ -348,14 +349,33 @@ mptfc_generate_rport_ids(FCDevicePage0_t *pg0, struct fc_rport_identifiers *rid) } static void +mptfc_remap_sdev(struct scsi_device *sdev, void *arg) +{ + VirtDevice *vdev; + VirtTarget *vtarget; + struct scsi_target *starget; + + starget = scsi_target(sdev); + if (starget->hostdata == arg) { + vtarget = arg; + vdev = sdev->hostdata; + if (vdev) { + vdev->bus_id = vtarget->bus_id; + vdev->target_id = vtarget->target_id; + } + } +} + +static void mptfc_register_dev(MPT_ADAPTER *ioc, int channel, FCDevicePage0_t *pg0) { struct fc_rport_identifiers rport_ids; struct fc_rport *rport; struct mptfc_rport_info *ri; - int match = 0; - u64 port_name; + int new_ri = 1; + u64 pn; unsigned long flags; + VirtTarget *vtarget; if (mptfc_generate_rport_ids(pg0, &rport_ids) < 0) return; @@ -363,14 +383,14 @@ mptfc_register_dev(MPT_ADAPTER *ioc, int channel, FCDevicePage0_t *pg0) /* scan list looking for a match */ spin_lock_irqsave(&ioc->fc_rport_lock, flags); list_for_each_entry(ri, &ioc->fc_rports, list) { - port_name = (u64)ri->pg0.WWPN.High << 32 | (u64)ri->pg0.WWPN.Low; - if (port_name == rport_ids.port_name) { /* match */ + pn = (u64)ri->pg0.WWPN.High << 32 | (u64)ri->pg0.WWPN.Low; + if (pn == rport_ids.port_name) { /* match */ list_move_tail(&ri->list, &ioc->fc_rports); - match = 1; + new_ri = 0; break; } } - if (!match) { /* allocate one */ + if (new_ri) { /* allocate one */ spin_unlock_irqrestore(&ioc->fc_rport_lock, flags); ri = kzalloc(sizeof(struct mptfc_rport_info), GFP_KERNEL); if (!ri) @@ -382,40 +402,43 @@ mptfc_register_dev(MPT_ADAPTER *ioc, int channel, FCDevicePage0_t *pg0) ri->pg0 = *pg0; /* add/update pg0 data */ ri->flags &= ~MPT_RPORT_INFO_FLAGS_MISSING; + /* MPT_RPORT_INFO_FLAGS_REGISTERED - rport not previously deleted */ if (!(ri->flags & MPT_RPORT_INFO_FLAGS_REGISTERED)) { ri->flags |= MPT_RPORT_INFO_FLAGS_REGISTERED; spin_unlock_irqrestore(&ioc->fc_rport_lock, flags); - rport = fc_remote_port_add(ioc->sh,channel, &rport_ids); + rport = fc_remote_port_add(ioc->sh, channel, &rport_ids); spin_lock_irqsave(&ioc->fc_rport_lock, flags); if (rport) { - if (*((struct mptfc_rport_info **)rport->dd_data) != ri) { - ri->flags &= ~MPT_RPORT_INFO_FLAGS_MAPPED_VDEV; - ri->vdev = NULL; - ri->rport = rport; - *((struct mptfc_rport_info **)rport->dd_data) = ri; - } - rport->dev_loss_tmo = mptfc_dev_loss_tmo; + ri->rport = rport; + if (new_ri) /* may have been reset by user */ + rport->dev_loss_tmo = mptfc_dev_loss_tmo; + *((struct mptfc_rport_info **)rport->dd_data) = ri; /* * if already mapped, remap here. If not mapped, - * slave_alloc will allocate vdev and map + * target_alloc will allocate vtarget and map, + * slave_alloc will fill in vdev from vtarget. */ - if (ri->flags & MPT_RPORT_INFO_FLAGS_MAPPED_VDEV) { - ri->vdev->target_id = ri->pg0.CurrentTargetID; - ri->vdev->bus_id = ri->pg0.CurrentBus; - ri->vdev->vtarget->target_id = ri->vdev->target_id; - ri->vdev->vtarget->bus_id = ri->vdev->bus_id; + if (ri->starget) { + vtarget = ri->starget->hostdata; + if (vtarget) { + vtarget->target_id = pg0->CurrentTargetID; + vtarget->bus_id = pg0->CurrentBus; + starget_for_each_device(ri->starget, + vtarget,mptfc_remap_sdev); + } + ri->remap_needed = 0; } - #ifdef MPT_DEBUG - printk ("mptfc_reg_dev.%d: %x, %llx / %llx, tid %d, " + dfcprintk ((MYIOC_s_INFO_FMT + "mptfc_reg_dev.%d: %x, %llx / %llx, tid %d, " "rport tid %d, tmo %d\n", - ioc->sh->host_no, + ioc->name, + oc->sh->host_no, pg0->PortIdentifier, pg0->WWNN, pg0->WWPN, pg0->CurrentTargetID, ri->rport->scsi_target_id, - ri->rport->dev_loss_tmo); - #endif + ri->rport->dev_loss_tmo)); } else { list_del(&ri->list); kfree(ri); @@ -427,6 +450,65 @@ mptfc_register_dev(MPT_ADAPTER *ioc, int channel, FCDevicePage0_t *pg0) } /* + * OS entry point to allow for host driver to free allocated memory + * Called if no device present or device being unloaded + */ +static void +mptfc_target_destroy(struct scsi_target *starget) +{ + struct fc_rport *rport; + struct mptfc_rport_info *ri; + + rport = starget_to_rport(starget); + if (rport) { + ri = *((struct mptfc_rport_info **)rport->dd_data); + if (ri) /* better be! */ + ri->starget = NULL; + } + if (starget->hostdata) + kfree(starget->hostdata); + starget->hostdata = NULL; +} + +/* + * OS entry point to allow host driver to alloc memory + * for each scsi target. Called once per device the bus scan. + * Return non-zero if allocation fails. + */ +static int +mptfc_target_alloc(struct scsi_target *starget) +{ + VirtTarget *vtarget; + struct fc_rport *rport; + struct mptfc_rport_info *ri; + int rc; + + vtarget = kzalloc(sizeof(VirtTarget), GFP_KERNEL); + if (!vtarget) + return -ENOMEM; + starget->hostdata = vtarget; + + rc = -ENODEV; + rport = starget_to_rport(starget); + if (rport) { + ri = *((struct mptfc_rport_info **)rport->dd_data); + if (ri) { /* better be! */ + vtarget->target_id = ri->pg0.CurrentTargetID; + vtarget->bus_id = ri->pg0.CurrentBus; + ri->starget = starget; + ri->remap_needed = 0; + rc = 0; + } + } + if (rc != 0) { + kfree(vtarget); + starget->hostdata = NULL; + } + + return rc; +} + +/* * OS entry point to allow host driver to alloc memory * for each scsi device. Called once per device the bus scan. * Return non-zero if allocation fails. @@ -440,7 +522,6 @@ mptfc_slave_alloc(struct scsi_device *sdev) VirtDevice *vdev; struct scsi_target *starget; struct fc_rport *rport; - struct mptfc_rport_info *ri; unsigned long flags; @@ -451,55 +532,44 @@ mptfc_slave_alloc(struct scsi_device *sdev) hd = (MPT_SCSI_HOST *)sdev->host->hostdata; - vdev = kmalloc(sizeof(VirtDevice), GFP_KERNEL); + vdev = kzalloc(sizeof(VirtDevice), GFP_KERNEL); if (!vdev) { printk(MYIOC_s_ERR_FMT "slave_alloc kmalloc(%zd) FAILED!\n", hd->ioc->name, sizeof(VirtDevice)); return -ENOMEM; } - memset(vdev, 0, sizeof(VirtDevice)); spin_lock_irqsave(&hd->ioc->fc_rport_lock,flags); - if (!(ri = *((struct mptfc_rport_info **)rport->dd_data))) { - spin_unlock_irqrestore(&hd->ioc->fc_rport_lock,flags); - kfree(vdev); - return -ENODEV; - } - sdev->hostdata = vdev; starget = scsi_target(sdev); vtarget = starget->hostdata; + if (vtarget->num_luns == 0) { + vtarget->ioc_id = hd->ioc->id; vtarget->tflags = MPT_TARGET_FLAGS_Q_YES | MPT_TARGET_FLAGS_VALID_INQUIRY; hd->Targets[sdev->id] = vtarget; } - vtarget->target_id = vdev->target_id; - vtarget->bus_id = vdev->bus_id; - vdev->vtarget = vtarget; vdev->ioc_id = hd->ioc->id; vdev->lun = sdev->lun; - vdev->target_id = ri->pg0.CurrentTargetID; - vdev->bus_id = ri->pg0.CurrentBus; - - ri->flags |= MPT_RPORT_INFO_FLAGS_MAPPED_VDEV; - ri->vdev = vdev; + vdev->target_id = vtarget->target_id; + vdev->bus_id = vtarget->bus_id; spin_unlock_irqrestore(&hd->ioc->fc_rport_lock,flags); vtarget->num_luns++; -#ifdef MPT_DEBUG - printk ("mptfc_slv_alloc.%d: num_luns %d, sdev.id %d, " + dfcprintk ((MYIOC_s_INFO_FMT + "mptfc_slv_alloc.%d: num_luns %d, sdev.id %d, " "CurrentTargetID %d, %x %llx %llx\n", - sdev->host->host_no, - vtarget->num_luns, - sdev->id, ri->pg0.CurrentTargetID, - ri->pg0.PortIdentifier, ri->pg0.WWPN, ri->pg0.WWNN); -#endif + ioc->name, + sdev->host->host_no, + vtarget->num_luns, + sdev->id, ri->pg0.CurrentTargetID, + ri->pg0.PortIdentifier, ri->pg0.WWPN, ri->pg0.WWNN)); return 0; } @@ -507,6 +577,7 @@ mptfc_slave_alloc(struct scsi_device *sdev) static int mptfc_qcmd(struct scsi_cmnd *SCpnt, void (*done)(struct scsi_cmnd *)) { + struct mptfc_rport_info *ri; struct fc_rport *rport = starget_to_rport(scsi_target(SCpnt->device)); int err; @@ -516,6 +587,10 @@ mptfc_qcmd(struct scsi_cmnd *SCpnt, void (*done)(struct scsi_cmnd *)) done(SCpnt); return 0; } + ri = *((struct mptfc_rport_info **)rport->dd_data); + if (unlikely(ri->remap_needed)) + return SCSI_MLQUEUE_HOST_BUSY; + return mptscsih_qcmd(SCpnt,done); } @@ -591,16 +666,20 @@ mptfc_rescan_devices(void *arg) ri->flags &= ~(MPT_RPORT_INFO_FLAGS_REGISTERED| MPT_RPORT_INFO_FLAGS_MISSING); + ri->remap_needed = 1; fc_remote_port_delete(ri->rport); /* * remote port not really deleted 'cause * binding is by WWPN and driver only - * registers FCP_TARGETs + * registers FCP_TARGETs but cannot trust + * data structures. */ - #ifdef MPT_DEBUG - printk ("mptfc_rescan.%d: %llx deleted\n", - ioc->sh->host_no, ri->pg0.WWPN); - #endif + ri->rport = NULL; + dfcprintk ((MYIOC_s_INFO_FMT + "mptfc_rescan.%d: %llx deleted\n", + ioc->name, + ioc->sh->host_no, + ri->pg0.WWPN)); } } spin_unlock_irqrestore(&ioc->fc_rport_lock,flags); @@ -872,9 +951,8 @@ mptfc_init(void) } error = pci_register_driver(&mptfc_driver); - if (error) { + if (error) fc_release_transport(mptfc_transport_template); - } return error; } @@ -885,7 +963,8 @@ mptfc_init(void) * @pdev: Pointer to pci_dev structure * */ -static void __devexit mptfc_remove(struct pci_dev *pdev) +static void __devexit +mptfc_remove(struct pci_dev *pdev) { MPT_ADAPTER *ioc = pci_get_drvdata(pdev); struct mptfc_rport_info *p, *n; diff --git a/drivers/message/fusion/mptsas.c b/drivers/message/fusion/mptsas.c index 5a06d8d8694..2512d0e6155 100644 --- a/drivers/message/fusion/mptsas.c +++ b/drivers/message/fusion/mptsas.c @@ -89,6 +89,8 @@ static int mptsasMgmtCtx = -1; enum mptsas_hotplug_action { MPTSAS_ADD_DEVICE, MPTSAS_DEL_DEVICE, + MPTSAS_ADD_RAID, + MPTSAS_DEL_RAID, }; struct mptsas_hotplug_event { @@ -114,6 +116,7 @@ struct mptsas_hotplug_event { struct mptsas_devinfo { u16 handle; /* unique id to address this device */ + u16 handle_parent; /* unique id to address parent device */ u8 phy_id; /* phy number of parent device */ u8 port_id; /* sas physical port this device is assoc'd with */ @@ -301,9 +304,8 @@ mptsas_slave_alloc(struct scsi_device *sdev) } mutex_unlock(&hd->ioc->sas_topology_mutex); - printk("No matching SAS device found!!\n"); kfree(vdev); - return -ENODEV; + return -ENXIO; out: vtarget->ioc_id = vdev->ioc_id; @@ -321,6 +323,7 @@ mptsas_slave_destroy(struct scsi_device *sdev) struct sas_rphy *rphy; struct mptsas_portinfo *p; int i; + VirtDevice *vdev; /* * Handle hotplug removal case. @@ -344,8 +347,29 @@ mptsas_slave_destroy(struct scsi_device *sdev) out: mutex_unlock(&hd->ioc->sas_topology_mutex); /* - * TODO: Issue target reset to flush firmware outstanding commands. + * Issue target reset to flush firmware outstanding commands. */ + vdev = sdev->hostdata; + if (vdev->configured_lun){ + if (mptscsih_TMHandler(hd, + MPI_SCSITASKMGMT_TASKTYPE_TARGET_RESET, + vdev->bus_id, + vdev->target_id, + 0, 0, 5 /* 5 second timeout */) + < 0){ + + /* The TM request failed! + * Fatal error case. + */ + printk(MYIOC_s_WARN_FMT + "Error processing TaskMgmt id=%d TARGET_RESET\n", + hd->ioc->name, + vdev->target_id); + + hd->tmPending = 0; + hd->tmState = TM_STATE_NONE; + } + } mptscsih_slave_destroy(sdev); } @@ -714,6 +738,7 @@ mptsas_sas_device_pg0(MPT_ADAPTER *ioc, struct mptsas_devinfo *device_info, mptsas_print_device_pg0(buffer); device_info->handle = le16_to_cpu(buffer->DevHandle); + device_info->handle_parent = le16_to_cpu(buffer->ParentDevHandle); device_info->phy_id = buffer->PhyNum; device_info->port_id = buffer->PhysicalPort; device_info->id = buffer->TargetID; @@ -863,6 +888,26 @@ mptsas_sas_expander_pg1(MPT_ADAPTER *ioc, struct mptsas_phyinfo *phy_info, return error; } +/* + * Returns true if there is a scsi end device + */ +static inline int +mptsas_is_end_device(struct mptsas_devinfo * attached) +{ + if ((attached->handle) && + (attached->device_info & + MPI_SAS_DEVICE_INFO_END_DEVICE) && + ((attached->device_info & + MPI_SAS_DEVICE_INFO_SSP_TARGET) | + (attached->device_info & + MPI_SAS_DEVICE_INFO_STP_TARGET) | + (attached->device_info & + MPI_SAS_DEVICE_INFO_SATA_DEVICE))) + return 1; + else + return 0; +} + static void mptsas_parse_device_info(struct sas_identify *identify, struct mptsas_devinfo *device_info) @@ -1227,7 +1272,7 @@ mptsas_find_phyinfo_by_parent(MPT_ADAPTER *ioc, u16 parent_handle, u8 phy_id) } static struct mptsas_phyinfo * -mptsas_find_phyinfo_by_handle(MPT_ADAPTER *ioc, u16 handle) +mptsas_find_phyinfo_by_target(MPT_ADAPTER *ioc, u32 id) { struct mptsas_portinfo *port_info; struct mptsas_phyinfo *phy_info = NULL; @@ -1239,12 +1284,12 @@ mptsas_find_phyinfo_by_handle(MPT_ADAPTER *ioc, u16 handle) */ mutex_lock(&ioc->sas_topology_mutex); list_for_each_entry(port_info, &ioc->sas_topology, list) { - for (i = 0; i < port_info->num_phys; i++) { - if (port_info->phy_info[i].attached.handle == handle) { - phy_info = &port_info->phy_info[i]; - break; - } - } + for (i = 0; i < port_info->num_phys; i++) + if (mptsas_is_end_device(&port_info->phy_info[i].attached)) + if (port_info->phy_info[i].attached.id == id) { + phy_info = &port_info->phy_info[i]; + break; + } } mutex_unlock(&ioc->sas_topology_mutex); @@ -1258,36 +1303,58 @@ mptsas_hotplug_work(void *arg) MPT_ADAPTER *ioc = ev->ioc; struct mptsas_phyinfo *phy_info; struct sas_rphy *rphy; + struct scsi_device *sdev; char *ds = NULL; - - if (ev->device_info & MPI_SAS_DEVICE_INFO_SSP_TARGET) - ds = "ssp"; - if (ev->device_info & MPI_SAS_DEVICE_INFO_STP_TARGET) - ds = "stp"; - if (ev->device_info & MPI_SAS_DEVICE_INFO_SATA_DEVICE) - ds = "sata"; + struct mptsas_devinfo sas_device; switch (ev->event_type) { case MPTSAS_DEL_DEVICE: - printk(MYIOC_s_INFO_FMT - "removing %s device, channel %d, id %d, phy %d\n", - ioc->name, ds, ev->channel, ev->id, ev->phy_id); - phy_info = mptsas_find_phyinfo_by_handle(ioc, ev->handle); + phy_info = mptsas_find_phyinfo_by_target(ioc, ev->id); if (!phy_info) { printk("mptsas: remove event for non-existant PHY.\n"); break; } + if (phy_info->attached.device_info & MPI_SAS_DEVICE_INFO_SSP_TARGET) + ds = "ssp"; + if (phy_info->attached.device_info & MPI_SAS_DEVICE_INFO_STP_TARGET) + ds = "stp"; + if (phy_info->attached.device_info & MPI_SAS_DEVICE_INFO_SATA_DEVICE) + ds = "sata"; + + printk(MYIOC_s_INFO_FMT + "removing %s device, channel %d, id %d, phy %d\n", + ioc->name, ds, ev->channel, ev->id, phy_info->phy_id); + if (phy_info->rphy) { sas_rphy_delete(phy_info->rphy); phy_info->rphy = NULL; } break; case MPTSAS_ADD_DEVICE: - printk(MYIOC_s_INFO_FMT - "attaching %s device, channel %d, id %d, phy %d\n", - ioc->name, ds, ev->channel, ev->id, ev->phy_id); + + /* + * When there is no sas address, + * RAID volumes are being deleted, + * and hidden phy disk are being added. + * We don't know the SAS data yet, + * so lookup sas device page to get + * pertaining info + */ + if (!ev->sas_address) { + if (mptsas_sas_device_pg0(ioc, + &sas_device, ev->id, + (MPI_SAS_DEVICE_PGAD_FORM_BUS_TARGET_ID << + MPI_SAS_DEVICE_PGAD_FORM_SHIFT))) + break; + ev->handle = sas_device.handle; + ev->parent_handle = sas_device.handle_parent; + ev->channel = sas_device.channel; + ev->phy_id = sas_device.phy_id; + ev->sas_address = sas_device.sas_address; + ev->device_info = sas_device.device_info; + } phy_info = mptsas_find_phyinfo_by_parent(ioc, ev->parent_handle, ev->phy_id); @@ -1310,10 +1377,23 @@ mptsas_hotplug_work(void *arg) phy_info->attached.sas_address = ev->sas_address; phy_info->attached.device_info = ev->device_info; + if (phy_info->attached.device_info & MPI_SAS_DEVICE_INFO_SSP_TARGET) + ds = "ssp"; + if (phy_info->attached.device_info & MPI_SAS_DEVICE_INFO_STP_TARGET) + ds = "stp"; + if (phy_info->attached.device_info & MPI_SAS_DEVICE_INFO_SATA_DEVICE) + ds = "sata"; + + printk(MYIOC_s_INFO_FMT + "attaching %s device, channel %d, id %d, phy %d\n", + ioc->name, ds, ev->channel, ev->id, ev->phy_id); + + rphy = sas_rphy_alloc(phy_info->phy); if (!rphy) break; /* non-fatal: an rphy can be added later */ + rphy->scsi_target_id = phy_info->attached.id; mptsas_parse_device_info(&rphy->identify, &phy_info->attached); if (sas_rphy_add(rphy)) { sas_rphy_free(rphy); @@ -1322,6 +1402,40 @@ mptsas_hotplug_work(void *arg) phy_info->rphy = rphy; break; + case MPTSAS_ADD_RAID: + sdev = scsi_device_lookup( + ioc->sh, + ioc->num_ports, + ev->id, + 0); + if (sdev) { + scsi_device_put(sdev); + break; + } + printk(MYIOC_s_INFO_FMT + "attaching device, channel %d, id %d\n", + ioc->name, ioc->num_ports, ev->id); + scsi_add_device(ioc->sh, + ioc->num_ports, + ev->id, + 0); + mpt_findImVolumes(ioc); + break; + case MPTSAS_DEL_RAID: + sdev = scsi_device_lookup( + ioc->sh, + ioc->num_ports, + ev->id, + 0); + if (!sdev) + break; + printk(MYIOC_s_INFO_FMT + "removing device, channel %d, id %d\n", + ioc->name, ioc->num_ports, ev->id); + scsi_remove_device(sdev); + scsi_device_put(sdev); + mpt_findImVolumes(ioc); + break; } kfree(ev); @@ -1372,23 +1486,94 @@ mptscsih_send_sas_event(MPT_ADAPTER *ioc, schedule_work(&ev->work); } +static void +mptscsih_send_raid_event(MPT_ADAPTER *ioc, + EVENT_DATA_RAID *raid_event_data) +{ + struct mptsas_hotplug_event *ev; + RAID_VOL0_STATUS * volumeStatus; + + if (ioc->bus_type != SAS) + return; + + ev = kmalloc(sizeof(*ev), GFP_ATOMIC); + if (!ev) { + printk(KERN_WARNING "mptsas: lost hotplug event\n"); + return; + } + + memset(ev,0,sizeof(struct mptsas_hotplug_event)); + INIT_WORK(&ev->work, mptsas_hotplug_work, ev); + ev->ioc = ioc; + ev->id = raid_event_data->VolumeID; + + switch (raid_event_data->ReasonCode) { + case MPI_EVENT_RAID_RC_PHYSDISK_DELETED: + ev->event_type = MPTSAS_ADD_DEVICE; + break; + case MPI_EVENT_RAID_RC_PHYSDISK_CREATED: + ev->event_type = MPTSAS_DEL_DEVICE; + break; + case MPI_EVENT_RAID_RC_VOLUME_DELETED: + ev->event_type = MPTSAS_DEL_RAID; + break; + case MPI_EVENT_RAID_RC_VOLUME_CREATED: + ev->event_type = MPTSAS_ADD_RAID; + break; + case MPI_EVENT_RAID_RC_VOLUME_STATUS_CHANGED: + volumeStatus = (RAID_VOL0_STATUS *) & + raid_event_data->SettingsStatus; + ev->event_type = (volumeStatus->State == + MPI_RAIDVOL0_STATUS_STATE_FAILED) ? + MPTSAS_DEL_RAID : MPTSAS_ADD_RAID; + break; + default: + break; + } + schedule_work(&ev->work); +} + +/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ +/* work queue thread to clear the persitency table */ +static void +mptscsih_sas_persist_clear_table(void * arg) +{ + MPT_ADAPTER *ioc = (MPT_ADAPTER *)arg; + + mptbase_sas_persist_operation(ioc, MPI_SAS_OP_CLEAR_NOT_PRESENT); +} + static int mptsas_event_process(MPT_ADAPTER *ioc, EventNotificationReply_t *reply) { + int rc=1; u8 event = le32_to_cpu(reply->Event) & 0xFF; if (!ioc->sh) - return 1; + goto out; switch (event) { case MPI_EVENT_SAS_DEVICE_STATUS_CHANGE: mptscsih_send_sas_event(ioc, (EVENT_DATA_SAS_DEVICE_STATUS_CHANGE *)reply->Data); - return 1; /* currently means nothing really */ - + break; + case MPI_EVENT_INTEGRATED_RAID: + mptscsih_send_raid_event(ioc, + (EVENT_DATA_RAID *)reply->Data); + break; + case MPI_EVENT_PERSISTENT_TABLE_FULL: + INIT_WORK(&ioc->mptscsih_persistTask, + mptscsih_sas_persist_clear_table, + (void *)ioc); + schedule_work(&ioc->mptscsih_persistTask); + break; default: - return mptscsih_event_process(ioc, reply); + rc = mptscsih_event_process(ioc, reply); + break; } + out: + + return rc; } static int diff --git a/drivers/message/fusion/mptscsih.c b/drivers/message/fusion/mptscsih.c index cdac5578fdf..05789e50546 100644 --- a/drivers/message/fusion/mptscsih.c +++ b/drivers/message/fusion/mptscsih.c @@ -144,7 +144,6 @@ static int mptscsih_tm_pending_wait(MPT_SCSI_HOST * hd); static int mptscsih_tm_wait_for_completion(MPT_SCSI_HOST * hd, ulong timeout ); static u32 SCPNT_TO_LOOKUP_IDX(struct scsi_cmnd *sc); -static int mptscsih_TMHandler(MPT_SCSI_HOST *hd, u8 type, u8 channel, u8 target, u8 lun, int ctx2abort, ulong timeout); static int mptscsih_IssueTaskMgmt(MPT_SCSI_HOST *hd, u8 type, u8 channel, u8 target, u8 lun, int ctx2abort, ulong timeout); int mptscsih_ioc_reset(MPT_ADAPTER *ioc, int post_reset); @@ -159,11 +158,9 @@ static int mptscsih_writeIOCPage4(MPT_SCSI_HOST *hd, int target_id, int bus); int mptscsih_scandv_complete(MPT_ADAPTER *ioc, MPT_FRAME_HDR *mf, MPT_FRAME_HDR *r); static int mptscsih_do_cmd(MPT_SCSI_HOST *hd, INTERNAL_CMD *iocmd); static void mptscsih_synchronize_cache(MPT_SCSI_HOST *hd, VirtDevice *vdevice); -static void mptscsih_negotiate_to_asyn_narrow(MPT_SCSI_HOST *hd, VirtTarget *vtarget); +static void mptscsih_negotiate_to_asyn_narrow(MPT_SCSI_HOST *hd, VirtDevice *vdevice); static int mptscsih_is_phys_disk(MPT_ADAPTER *ioc, int id); -static struct work_struct mptscsih_persistTask; - #ifdef MPTSCSIH_ENABLE_DOMAIN_VALIDATION static int mptscsih_do_raid(MPT_SCSI_HOST *hd, u8 action, INTERNAL_CMD *io); static void mptscsih_domainValidation(void *hd); @@ -563,11 +560,24 @@ mptscsih_io_done(MPT_ADAPTER *ioc, MPT_FRAME_HDR *mf, MPT_FRAME_HDR *mr) MPT_SCSI_HOST *hd; SCSIIORequest_t *pScsiReq; SCSIIOReply_t *pScsiReply; - u16 req_idx; + u16 req_idx, req_idx_MR; hd = (MPT_SCSI_HOST *) ioc->sh->hostdata; req_idx = le16_to_cpu(mf->u.frame.hwhdr.msgctxu.fld.req_idx); + req_idx_MR = (mr != NULL) ? + le16_to_cpu(mr->u.frame.hwhdr.msgctxu.fld.req_idx) : req_idx; + if ((req_idx != req_idx_MR) || + (mf->u.frame.linkage.arg1 == 0xdeadbeaf)) { + printk(MYIOC_s_ERR_FMT "Received a mf that was already freed\n", + ioc->name); + printk (MYIOC_s_ERR_FMT + "req_idx=%x req_idx_MR=%x mf=%p mr=%p sc=%p\n", + ioc->name, req_idx, req_idx_MR, mf, mr, + hd->ScsiLookup[req_idx_MR]); + return 0; + } + sc = hd->ScsiLookup[req_idx]; if (sc == NULL) { MPIHeader_t *hdr = (MPIHeader_t *)mf; @@ -730,6 +740,8 @@ mptscsih_io_done(MPT_ADAPTER *ioc, MPT_FRAME_HDR *mf, MPT_FRAME_HDR *mr) break; + case MPI_IOCSTATUS_SCSI_DATA_OVERRUN: /* 0x0044 */ + sc->resid=0; case MPI_IOCSTATUS_SCSI_RECOVERED_ERROR: /* 0x0040 */ case MPI_IOCSTATUS_SUCCESS: /* 0x0000 */ if (scsi_status == MPI_SCSI_STATUS_BUSY) @@ -789,7 +801,6 @@ mptscsih_io_done(MPT_ADAPTER *ioc, MPT_FRAME_HDR *mf, MPT_FRAME_HDR *mr) case MPI_IOCSTATUS_INSUFFICIENT_RESOURCES: /* 0x0006 */ case MPI_IOCSTATUS_INVALID_FIELD: /* 0x0007 */ case MPI_IOCSTATUS_INVALID_STATE: /* 0x0008 */ - case MPI_IOCSTATUS_SCSI_DATA_OVERRUN: /* 0x0044 */ case MPI_IOCSTATUS_SCSI_IO_DATA_ERROR: /* 0x0046 */ case MPI_IOCSTATUS_SCSI_TASK_MGMT_FAILED: /* 0x004A */ default: @@ -1530,7 +1541,7 @@ mptscsih_freeChainBuffers(MPT_ADAPTER *ioc, int req_idx) * * Returns 0 for SUCCESS or -1 if FAILED. */ -static int +int mptscsih_TMHandler(MPT_SCSI_HOST *hd, u8 type, u8 channel, u8 target, u8 lun, int ctx2abort, ulong timeout) { MPT_ADAPTER *ioc; @@ -1721,6 +1732,20 @@ mptscsih_IssueTaskMgmt(MPT_SCSI_HOST *hd, u8 type, u8 channel, u8 target, u8 lun return retval; } +static int +mptscsih_get_tm_timeout(MPT_ADAPTER *ioc) +{ + switch (ioc->bus_type) { + case FC: + return 40; + case SAS: + return 10; + case SPI: + default: + return 2; + } +} + /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ /** * mptscsih_abort - Abort linux scsi_cmnd routine, new_eh variant @@ -1792,7 +1817,7 @@ mptscsih_abort(struct scsi_cmnd * SCpnt) vdev = SCpnt->device->hostdata; retval = mptscsih_TMHandler(hd, MPI_SCSITASKMGMT_TASKTYPE_ABORT_TASK, vdev->bus_id, vdev->target_id, vdev->lun, - ctx2abort, 2 /* 2 second timeout */); + ctx2abort, mptscsih_get_tm_timeout(ioc)); printk (KERN_WARNING MYNAM ": %s: task abort: %s (sc=%p)\n", hd->ioc->name, @@ -1843,7 +1868,7 @@ mptscsih_dev_reset(struct scsi_cmnd * SCpnt) vdev = SCpnt->device->hostdata; retval = mptscsih_TMHandler(hd, MPI_SCSITASKMGMT_TASKTYPE_TARGET_RESET, vdev->bus_id, vdev->target_id, - 0, 0, 5 /* 5 second timeout */); + 0, 0, mptscsih_get_tm_timeout(hd->ioc)); printk (KERN_WARNING MYNAM ": %s: target reset: %s (sc=%p)\n", hd->ioc->name, @@ -1893,7 +1918,7 @@ mptscsih_bus_reset(struct scsi_cmnd * SCpnt) vdev = SCpnt->device->hostdata; retval = mptscsih_TMHandler(hd, MPI_SCSITASKMGMT_TASKTYPE_RESET_BUS, - vdev->bus_id, 0, 0, 0, 5 /* 5 second timeout */); + vdev->bus_id, 0, 0, 0, mptscsih_get_tm_timeout(hd->ioc)); printk (KERN_WARNING MYNAM ": %s: bus reset: %s (sc=%p)\n", hd->ioc->name, @@ -2016,6 +2041,42 @@ mptscsih_tm_wait_for_completion(MPT_SCSI_HOST * hd, ulong timeout ) } /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ +static void +mptscsih_taskmgmt_response_code(MPT_ADAPTER *ioc, u8 response_code) +{ + char *desc; + + switch (response_code) { + case MPI_SCSITASKMGMT_RSP_TM_COMPLETE: + desc = "The task completed."; + break; + case MPI_SCSITASKMGMT_RSP_INVALID_FRAME: + desc = "The IOC received an invalid frame status."; + break; + case MPI_SCSITASKMGMT_RSP_TM_NOT_SUPPORTED: + desc = "The task type is not supported."; + break; + case MPI_SCSITASKMGMT_RSP_TM_FAILED: + desc = "The requested task failed."; + break; + case MPI_SCSITASKMGMT_RSP_TM_SUCCEEDED: + desc = "The task completed successfully."; + break; + case MPI_SCSITASKMGMT_RSP_TM_INVALID_LUN: + desc = "The LUN request is invalid."; + break; + case MPI_SCSITASKMGMT_RSP_IO_QUEUED_ON_IOC: + desc = "The task is in the IOC queue and has not been sent to target."; + break; + default: + desc = "unknown"; + break; + } + printk(MYIOC_s_INFO_FMT "Response Code(0x%08x): F/W: %s\n", + ioc->name, response_code, desc); +} + +/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ /** * mptscsih_taskmgmt_complete - Registered with Fusion MPT base driver * @ioc: Pointer to MPT_ADAPTER structure @@ -2064,6 +2125,11 @@ mptscsih_taskmgmt_complete(MPT_ADAPTER *ioc, MPT_FRAME_HDR *mf, MPT_FRAME_HDR *m /* Figure out if this was ABORT_TASK, TARGET_RESET, or BUS_RESET! */ tmType = pScsiTmReq->TaskType; + if (ioc->facts.MsgVersion >= MPI_VERSION_01_05 && + pScsiTmReply->ResponseCode) + mptscsih_taskmgmt_response_code(ioc, + pScsiTmReply->ResponseCode); + dtmprintk((MYIOC_s_WARN_FMT " TaskType = %d, TerminationCount=%d\n", ioc->name, tmType, le32_to_cpu(pScsiTmReply->TerminationCount))); DBG_DUMP_TM_REPLY_FRAME((u32 *)pScsiTmReply); @@ -2255,7 +2321,7 @@ mptscsih_slave_destroy(struct scsi_device *sdev) vtarget->luns[0] &= ~(1 << vdevice->lun); vtarget->num_luns--; if (vtarget->num_luns == 0) { - mptscsih_negotiate_to_asyn_narrow(hd, vtarget); + mptscsih_negotiate_to_asyn_narrow(hd, vdevice); if (hd->ioc->bus_type == SPI) { if (mptscsih_is_phys_disk(hd->ioc, vtarget->target_id)) { hd->ioc->spi_data.forceDv |= MPT_SCSICFG_RELOAD_IOC_PG3; @@ -2585,16 +2651,6 @@ mptscsih_ioc_reset(MPT_ADAPTER *ioc, int reset_phase) } /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ -/* work queue thread to clear the persitency table */ -static void -mptscsih_sas_persist_clear_table(void * arg) -{ - MPT_ADAPTER *ioc = (MPT_ADAPTER *)arg; - - mptbase_sas_persist_operation(ioc, MPI_SAS_OP_CLEAR_NOT_PRESENT); -} - -/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ int mptscsih_event_process(MPT_ADAPTER *ioc, EventNotificationReply_t *pEvReply) { @@ -2656,13 +2712,6 @@ mptscsih_event_process(MPT_ADAPTER *ioc, EventNotificationReply_t *pEvReply) break; } - /* Persistent table is full. */ - case MPI_EVENT_PERSISTENT_TABLE_FULL: - INIT_WORK(&mptscsih_persistTask, - mptscsih_sas_persist_clear_table,(void *)ioc); - schedule_work(&mptscsih_persistTask); - break; - case MPI_EVENT_NONE: /* 00 */ case MPI_EVENT_LOG_DATA: /* 01 */ case MPI_EVENT_STATE_CHANGE: /* 02 */ @@ -3863,8 +3912,9 @@ mptscsih_do_cmd(MPT_SCSI_HOST *hd, INTERNAL_CMD *io) * */ static void -mptscsih_negotiate_to_asyn_narrow(MPT_SCSI_HOST *hd, VirtTarget *vtarget) +mptscsih_negotiate_to_asyn_narrow(MPT_SCSI_HOST *hd, VirtDevice *vdevice) { + VirtTarget *vtarget = vdevice->vtarget; MPT_ADAPTER *ioc= hd->ioc; SCSIDevicePage1_t *pcfg1Data; CONFIGPARMS cfg; @@ -3874,7 +3924,8 @@ mptscsih_negotiate_to_asyn_narrow(MPT_SCSI_HOST *hd, VirtTarget *vtarget) int requested, configuration, data,i; u8 flags, factor; - if (ioc->bus_type != SPI) + if ((ioc->bus_type != SPI) || + (!vdevice->configured_lun)) return; if (!ioc->spi_data.sdp1length) @@ -3910,7 +3961,7 @@ mptscsih_negotiate_to_asyn_narrow(MPT_SCSI_HOST *hd, VirtTarget *vtarget) } mptscsih_setDevicePage1Flags(0, MPT_ASYNC, 0, &requested, &configuration, flags); - dnegoprintk(("syncronize cache: id=%d width=0 factor=MPT_ASYNC " + dnegoprintk(("nego asyn narrow: id=%d width=0 factor=MPT_ASYNC " "offset=0 negoFlags=%x request=%x config=%x\n", id, flags, requested, configuration)); pcfg1Data->RequestedParameters = cpu_to_le32(requested); @@ -3923,7 +3974,7 @@ mptscsih_negotiate_to_asyn_narrow(MPT_SCSI_HOST *hd, VirtTarget *vtarget) flags = vtarget->negoFlags; mptscsih_setDevicePage1Flags(0, MPT_ASYNC, 0, &requested, &configuration, flags); - dnegoprintk(("syncronize cache: id=%d width=0 factor=MPT_ASYNC " + dnegoprintk(("nego asyn narrow: id=%d width=0 factor=MPT_ASYNC " "offset=0 negoFlags=%x request=%x config=%x\n", vtarget->target_id, flags, requested, configuration)); pcfg1Data->RequestedParameters = cpu_to_le32(requested); @@ -5620,5 +5671,6 @@ EXPORT_SYMBOL(mptscsih_event_process); EXPORT_SYMBOL(mptscsih_ioc_reset); EXPORT_SYMBOL(mptscsih_change_queue_depth); EXPORT_SYMBOL(mptscsih_timer_expired); +EXPORT_SYMBOL(mptscsih_TMHandler); /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ diff --git a/drivers/message/fusion/mptscsih.h b/drivers/message/fusion/mptscsih.h index d3cba12f4bd..44b248d51ea 100644 --- a/drivers/message/fusion/mptscsih.h +++ b/drivers/message/fusion/mptscsih.h @@ -108,3 +108,4 @@ extern int mptscsih_event_process(MPT_ADAPTER *ioc, EventNotificationReply_t *pE extern int mptscsih_ioc_reset(MPT_ADAPTER *ioc, int post_reset); extern int mptscsih_change_queue_depth(struct scsi_device *sdev, int qdepth); extern void mptscsih_timer_expired(unsigned long data); +extern int mptscsih_TMHandler(MPT_SCSI_HOST *hd, u8 type, u8 channel, u8 target, u8 lun, int ctx2abort, ulong timeout); diff --git a/drivers/message/fusion/mptspi.c b/drivers/message/fusion/mptspi.c index 7dce29277cb..f148dfa3911 100644 --- a/drivers/message/fusion/mptspi.c +++ b/drivers/message/fusion/mptspi.c @@ -384,6 +384,14 @@ mptspi_probe(struct pci_dev *pdev, const struct pci_device_id *id) goto out_mptspi_probe; } + /* + * issue internal bus reset + */ + if (ioc->spi_data.bus_reset) + mptscsih_TMHandler(hd, + MPI_SCSITASKMGMT_TASKTYPE_RESET_BUS, + 0, 0, 0, 0, 5); + scsi_scan_host(sh); return 0; @@ -445,7 +453,7 @@ static void __exit mptspi_exit(void) { pci_unregister_driver(&mptspi_driver); - + mpt_reset_deregister(mptspiDoneCtx); dprintk((KERN_INFO MYNAM ": Deregistered for IOC reset notifications\n")); diff --git a/drivers/misc/ibmasm/uart.c b/drivers/misc/ibmasm/uart.c index 7e98434cfa3..9783caf4969 100644 --- a/drivers/misc/ibmasm/uart.c +++ b/drivers/misc/ibmasm/uart.c @@ -50,7 +50,7 @@ void ibmasm_register_uart(struct service_processor *sp) memset(&uport, 0, sizeof(struct uart_port)); uport.irq = sp->irq; uport.uartclk = 3686400; - uport.flags = UPF_AUTOPROBE | UPF_SHARE_IRQ; + uport.flags = UPF_SHARE_IRQ; uport.iotype = UPIO_MEM; uport.membase = iomem_base; diff --git a/drivers/net/Kconfig b/drivers/net/Kconfig index 626508afe1b..6a6a0844180 100644 --- a/drivers/net/Kconfig +++ b/drivers/net/Kconfig @@ -2034,13 +2034,28 @@ config SKGE It does not support the link failover and network management features that "portable" vendor supplied sk98lin driver does. + This driver supports adapters based on the original Yukon chipset: + Marvell 88E8001, Belkin F5D5005, CNet GigaCard, DLink DGE-530T, + Linksys EG1032/EG1064, 3Com 3C940/3C940B, SysKonnect SK-9871/9872. + + It does not support the newer Yukon2 chipset: a separate driver, + sky2, is provided for Yukon2-based adapters. + + To compile this driver as a module, choose M here: the module + will be called skge. This is recommended. config SKY2 tristate "SysKonnect Yukon2 support (EXPERIMENTAL)" depends on PCI && EXPERIMENTAL select CRC32 ---help--- - This driver support the Marvell Yukon 2 Gigabit Ethernet adapter. + This driver supports Gigabit Ethernet adapters based on the the + Marvell Yukon 2 chipset: + Marvell 88E8021/88E8022/88E8035/88E8036/88E8038/88E8050/88E8052/ + 88E8053/88E8055/88E8061/88E8062, SysKonnect SK-9E21D/SK-9S21 + + This driver does not support the original Yukon chipset: a seperate + driver, skge, is provided for Yukon-based adapters. To compile this driver as a module, choose M here: the module will be called sky2. This is recommended. @@ -2050,8 +2065,15 @@ config SK98LIN depends on PCI ---help--- Say Y here if you have a Marvell Yukon or SysKonnect SK-98xx/SK-95xx - compliant Gigabit Ethernet Adapter. The following adapters are supported - by this driver: + compliant Gigabit Ethernet Adapter. + + This driver supports the original Yukon chipset. A cleaner driver is + also available (skge) which seems to work better than this one. + + This driver does not support the newer Yukon2 chipset. A seperate + driver, sky2, is provided to support Yukon2-based adapters. + + The following adapters are supported by this driver: - 3Com 3C940 Gigabit LOM Ethernet Adapter - 3Com 3C941 Gigabit LOM Ethernet Adapter - Allied Telesyn AT-2970LX Gigabit Ethernet Adapter diff --git a/drivers/net/acenic.c b/drivers/net/acenic.c index b8953de5664..b508812e97a 100644 --- a/drivers/net/acenic.c +++ b/drivers/net/acenic.c @@ -1002,6 +1002,8 @@ static int __devinit ace_init(struct net_device *dev) mac1 = 0; for(i = 0; i < 4; i++) { + int tmp; + mac1 = mac1 << 8; tmp = read_eeprom_byte(dev, 0x8c+i); if (tmp < 0) { @@ -1012,6 +1014,8 @@ static int __devinit ace_init(struct net_device *dev) } mac2 = 0; for(i = 4; i < 8; i++) { + int tmp; + mac2 = mac2 << 8; tmp = read_eeprom_byte(dev, 0x8c+i); if (tmp < 0) { diff --git a/drivers/net/b44.c b/drivers/net/b44.c index df9d6e80c4f..c3267e4e1bb 100644 --- a/drivers/net/b44.c +++ b/drivers/net/b44.c @@ -1399,7 +1399,6 @@ static int b44_open(struct net_device *dev) b44_init_rings(bp); b44_init_hw(bp); - netif_carrier_off(dev); b44_check_phy(bp); err = request_irq(dev->irq, b44_interrupt, SA_SHIRQ, dev->name, dev); @@ -1464,7 +1463,7 @@ static int b44_close(struct net_device *dev) #endif b44_halt(bp); b44_free_rings(bp); - netif_carrier_off(bp->dev); + netif_carrier_off(dev); spin_unlock_irq(&bp->lock); @@ -2000,6 +1999,8 @@ static int __devinit b44_init_one(struct pci_dev *pdev, dev->irq = pdev->irq; SET_ETHTOOL_OPS(dev, &b44_ethtool_ops); + netif_carrier_off(dev); + err = b44_get_invariants(bp); if (err) { printk(KERN_ERR PFX "Problem fetching invariants of chip, " diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c index 2582d98ef5c..4ff006c3762 100644 --- a/drivers/net/bonding/bond_main.c +++ b/drivers/net/bonding/bond_main.c @@ -576,7 +576,7 @@ static int bond_update_speed_duplex(struct slave *slave) slave->duplex = DUPLEX_FULL; if (slave_dev->ethtool_ops) { - u32 res; + int res; if (!slave_dev->ethtool_ops->get_settings) { return -1; diff --git a/drivers/net/mv643xx_eth.c b/drivers/net/mv643xx_eth.c index 40ae36b20c9..7ef4b0434a3 100644 --- a/drivers/net/mv643xx_eth.c +++ b/drivers/net/mv643xx_eth.c @@ -444,6 +444,7 @@ static int mv643xx_eth_receive_queue(struct net_device *dev) netif_rx(skb); #endif } + dev->last_rx = jiffies; } return received_packets; @@ -461,7 +462,7 @@ static int mv643xx_eth_receive_queue(struct net_device *dev) */ static irqreturn_t mv643xx_eth_int_handler(int irq, void *dev_id, - struct pt_regs *regs) + struct pt_regs *regs) { struct net_device *dev = (struct net_device *)dev_id; struct mv643xx_private *mp = netdev_priv(dev); @@ -1047,16 +1048,15 @@ static int mv643xx_poll(struct net_device *dev, int *budget) static inline unsigned int has_tiny_unaligned_frags(struct sk_buff *skb) { - unsigned int frag; - skb_frag_t *fragp; + unsigned int frag; + skb_frag_t *fragp; - for (frag = 0; frag < skb_shinfo(skb)->nr_frags; frag++) { - fragp = &skb_shinfo(skb)->frags[frag]; - if (fragp->size <= 8 && fragp->page_offset & 0x7) - return 1; - - } - return 0; + for (frag = 0; frag < skb_shinfo(skb)->nr_frags; frag++) { + fragp = &skb_shinfo(skb)->frags[frag]; + if (fragp->size <= 8 && fragp->page_offset & 0x7) + return 1; + } + return 0; } @@ -2137,26 +2137,26 @@ static void eth_port_set_multicast_list(struct net_device *dev) */ if ((dev->flags & IFF_PROMISC) || (dev->flags & IFF_ALLMULTI)) { for (table_index = 0; table_index <= 0xFC; table_index += 4) { - /* Set all entries in DA filter special multicast - * table (Ex_dFSMT) - * Set for ETH_Q0 for now - * Bits - * 0 Accept=1, Drop=0 - * 3-1 Queue ETH_Q0=0 - * 7-4 Reserved = 0; - */ - mv_write(MV643XX_ETH_DA_FILTER_SPECIAL_MULTICAST_TABLE_BASE(eth_port_num) + table_index, 0x01010101); - - /* Set all entries in DA filter other multicast - * table (Ex_dFOMT) - * Set for ETH_Q0 for now - * Bits - * 0 Accept=1, Drop=0 - * 3-1 Queue ETH_Q0=0 - * 7-4 Reserved = 0; - */ - mv_write(MV643XX_ETH_DA_FILTER_OTHER_MULTICAST_TABLE_BASE(eth_port_num) + table_index, 0x01010101); - } + /* Set all entries in DA filter special multicast + * table (Ex_dFSMT) + * Set for ETH_Q0 for now + * Bits + * 0 Accept=1, Drop=0 + * 3-1 Queue ETH_Q0=0 + * 7-4 Reserved = 0; + */ + mv_write(MV643XX_ETH_DA_FILTER_SPECIAL_MULTICAST_TABLE_BASE(eth_port_num) + table_index, 0x01010101); + + /* Set all entries in DA filter other multicast + * table (Ex_dFOMT) + * Set for ETH_Q0 for now + * Bits + * 0 Accept=1, Drop=0 + * 3-1 Queue ETH_Q0=0 + * 7-4 Reserved = 0; + */ + mv_write(MV643XX_ETH_DA_FILTER_OTHER_MULTICAST_TABLE_BASE(eth_port_num) + table_index, 0x01010101); + } return; } @@ -2617,7 +2617,6 @@ static ETH_FUNC_RET_STATUS eth_port_send(struct mv643xx_private *mp, struct eth_tx_desc *current_descriptor; struct eth_tx_desc *first_descriptor; u32 command; - unsigned long flags; /* Do not process Tx ring in case of Tx ring resource error */ if (mp->tx_resource_err) @@ -2634,8 +2633,6 @@ static ETH_FUNC_RET_STATUS eth_port_send(struct mv643xx_private *mp, return ETH_ERROR; } - spin_lock_irqsave(&mp->lock, flags); - mp->tx_ring_skbs++; BUG_ON(mp->tx_ring_skbs > mp->tx_ring_size); @@ -2685,15 +2682,11 @@ static ETH_FUNC_RET_STATUS eth_port_send(struct mv643xx_private *mp, mp->tx_resource_err = 1; mp->tx_curr_desc_q = tx_first_desc; - spin_unlock_irqrestore(&mp->lock, flags); - return ETH_QUEUE_LAST_RESOURCE; } mp->tx_curr_desc_q = tx_next_desc; - spin_unlock_irqrestore(&mp->lock, flags); - return ETH_OK; } #else @@ -2704,14 +2697,11 @@ static ETH_FUNC_RET_STATUS eth_port_send(struct mv643xx_private *mp, int tx_desc_used; struct eth_tx_desc *current_descriptor; unsigned int command_status; - unsigned long flags; /* Do not process Tx ring in case of Tx ring resource error */ if (mp->tx_resource_err) return ETH_QUEUE_FULL; - spin_lock_irqsave(&mp->lock, flags); - mp->tx_ring_skbs++; BUG_ON(mp->tx_ring_skbs > mp->tx_ring_size); @@ -2742,12 +2732,9 @@ static ETH_FUNC_RET_STATUS eth_port_send(struct mv643xx_private *mp, /* Check for ring index overlap in the Tx desc ring */ if (tx_desc_curr == tx_desc_used) { mp->tx_resource_err = 1; - - spin_unlock_irqrestore(&mp->lock, flags); return ETH_QUEUE_LAST_RESOURCE; } - spin_unlock_irqrestore(&mp->lock, flags); return ETH_OK; } #endif @@ -2898,8 +2885,10 @@ static ETH_FUNC_RET_STATUS eth_port_receive(struct mv643xx_private *mp, p_pkt_info->return_info = mp->rx_skb[rx_curr_desc]; p_pkt_info->l4i_chk = p_rx_desc->buf_size; - /* Clean the return info field to indicate that the packet has been */ - /* moved to the upper layers */ + /* + * Clean the return info field to indicate that the + * packet has been moved to the upper layers + */ mp->rx_skb[rx_curr_desc] = NULL; /* Update current index in data structure */ @@ -2980,7 +2969,7 @@ struct mv643xx_stats { }; #define MV643XX_STAT(m) sizeof(((struct mv643xx_private *)0)->m), \ - offsetof(struct mv643xx_private, m) + offsetof(struct mv643xx_private, m) static const struct mv643xx_stats mv643xx_gstrings_stats[] = { { "rx_packets", MV643XX_STAT(stats.rx_packets) }, @@ -3131,9 +3120,8 @@ mv643xx_get_settings(struct net_device *netdev, struct ethtool_cmd *ecmd) return 0; } -static void -mv643xx_get_drvinfo(struct net_device *netdev, - struct ethtool_drvinfo *drvinfo) +static void mv643xx_get_drvinfo(struct net_device *netdev, + struct ethtool_drvinfo *drvinfo) { strncpy(drvinfo->driver, mv643xx_driver_name, 32); strncpy(drvinfo->version, mv643xx_driver_version, 32); @@ -3142,39 +3130,37 @@ mv643xx_get_drvinfo(struct net_device *netdev, drvinfo->n_stats = MV643XX_STATS_LEN; } -static int -mv643xx_get_stats_count(struct net_device *netdev) +static int mv643xx_get_stats_count(struct net_device *netdev) { return MV643XX_STATS_LEN; } -static void -mv643xx_get_ethtool_stats(struct net_device *netdev, - struct ethtool_stats *stats, uint64_t *data) +static void mv643xx_get_ethtool_stats(struct net_device *netdev, + struct ethtool_stats *stats, uint64_t *data) { struct mv643xx_private *mp = netdev->priv; int i; eth_update_mib_counters(mp); - for(i = 0; i < MV643XX_STATS_LEN; i++) { + for (i = 0; i < MV643XX_STATS_LEN; i++) { char *p = (char *)mp+mv643xx_gstrings_stats[i].stat_offset; - data[i] = (mv643xx_gstrings_stats[i].sizeof_stat == + data[i] = (mv643xx_gstrings_stats[i].sizeof_stat == sizeof(uint64_t)) ? *(uint64_t *)p : *(uint32_t *)p; } } -static void -mv643xx_get_strings(struct net_device *netdev, uint32_t stringset, uint8_t *data) +static void mv643xx_get_strings(struct net_device *netdev, uint32_t stringset, + uint8_t *data) { int i; switch(stringset) { case ETH_SS_STATS: for (i=0; i < MV643XX_STATS_LEN; i++) { - memcpy(data + i * ETH_GSTRING_LEN, - mv643xx_gstrings_stats[i].stat_string, - ETH_GSTRING_LEN); + memcpy(data + i * ETH_GSTRING_LEN, + mv643xx_gstrings_stats[i].stat_string, + ETH_GSTRING_LEN); } break; } diff --git a/drivers/net/s2io.c b/drivers/net/s2io.c index 89c46787676..49b597cbc19 100644 --- a/drivers/net/s2io.c +++ b/drivers/net/s2io.c @@ -3586,7 +3586,7 @@ static int s2io_xmit(struct sk_buff *skb, struct net_device *dev) txdp->Buffer_Pointer = (u64) pci_map_page (sp->pdev, frag->page, frag->page_offset, frag->size, PCI_DMA_TODEVICE); - txdp->Control_1 |= TXD_BUFFER0_SIZE(frag->size); + txdp->Control_1 = TXD_BUFFER0_SIZE(frag->size); if (skb_shinfo(skb)->ufo_size) txdp->Control_1 |= TXD_UFO_EN; } diff --git a/drivers/net/sungem.c b/drivers/net/sungem.c index 28ce47a0240..55f3b856236 100644 --- a/drivers/net/sungem.c +++ b/drivers/net/sungem.c @@ -1653,36 +1653,40 @@ static void gem_init_rings(struct gem *gp) /* Init PHY interface and start link poll state machine */ static void gem_init_phy(struct gem *gp) { - u32 mifcfg; + u32 mif_cfg; /* Revert MIF CFG setting done on stop_phy */ - mifcfg = readl(gp->regs + MIF_CFG); - mifcfg &= ~MIF_CFG_BBMODE; - writel(mifcfg, gp->regs + MIF_CFG); + mif_cfg = readl(gp->regs + MIF_CFG); + mif_cfg &= ~(MIF_CFG_PSELECT|MIF_CFG_POLL|MIF_CFG_BBMODE|MIF_CFG_MDI1); + mif_cfg |= MIF_CFG_MDI0; + writel(mif_cfg, gp->regs + MIF_CFG); + writel(PCS_DMODE_MGM, gp->regs + PCS_DMODE); + writel(MAC_XIFCFG_OE, gp->regs + MAC_XIFCFG); if (gp->pdev->vendor == PCI_VENDOR_ID_APPLE) { int i; + u16 ctrl; - /* Those delay sucks, the HW seem to love them though, I'll - * serisouly consider breaking some locks here to be able - * to schedule instead - */ - for (i = 0; i < 3; i++) { #ifdef CONFIG_PPC_PMAC - pmac_call_feature(PMAC_FTR_GMAC_PHY_RESET, gp->of_node, 0, 0); - msleep(20); + pmac_call_feature(PMAC_FTR_GMAC_PHY_RESET, gp->of_node, 0, 0); #endif - /* Some PHYs used by apple have problem getting back to us, - * we do an additional reset here - */ - phy_write(gp, MII_BMCR, BMCR_RESET); - msleep(20); - if (phy_read(gp, MII_BMCR) != 0xffff) + + /* Some PHYs used by apple have problem getting back + * to us, we do an additional reset here + */ + phy_write(gp, MII_BMCR, BMCR_RESET); + for (i = 0; i < 50; i++) { + if ((phy_read(gp, MII_BMCR) & BMCR_RESET) == 0) break; - if (i == 2) - printk(KERN_WARNING "%s: GMAC PHY not responding !\n", - gp->dev->name); + msleep(10); } + if (i == 50) + printk(KERN_WARNING "%s: GMAC PHY not responding !\n", + gp->dev->name); + /* Make sure isolate is off */ + ctrl = phy_read(gp, MII_BMCR); + if (ctrl & BMCR_ISOLATE) + phy_write(gp, MII_BMCR, ctrl & ~BMCR_ISOLATE); } if (gp->pdev->vendor == PCI_VENDOR_ID_SUN && @@ -2119,7 +2123,7 @@ static void gem_reinit_chip(struct gem *gp) /* Must be invoked with no lock held. */ static void gem_stop_phy(struct gem *gp, int wol) { - u32 mifcfg; + u32 mif_cfg; unsigned long flags; /* Let the chip settle down a bit, it seems that helps @@ -2130,9 +2134,9 @@ static void gem_stop_phy(struct gem *gp, int wol) /* Make sure we aren't polling PHY status change. We * don't currently use that feature though */ - mifcfg = readl(gp->regs + MIF_CFG); - mifcfg &= ~MIF_CFG_POLL; - writel(mifcfg, gp->regs + MIF_CFG); + mif_cfg = readl(gp->regs + MIF_CFG); + mif_cfg &= ~MIF_CFG_POLL; + writel(mif_cfg, gp->regs + MIF_CFG); if (wol && gp->has_wol) { unsigned char *e = &gp->dev->dev_addr[0]; @@ -2182,7 +2186,8 @@ static void gem_stop_phy(struct gem *gp, int wol) /* According to Apple, we must set the MDIO pins to this begnign * state or we may 1) eat more current, 2) damage some PHYs */ - writel(mifcfg | MIF_CFG_BBMODE, gp->regs + MIF_CFG); + mif_cfg = 0; + writel(mif_cfg | MIF_CFG_BBMODE, gp->regs + MIF_CFG); writel(0, gp->regs + MIF_BBCLK); writel(0, gp->regs + MIF_BBDATA); writel(0, gp->regs + MIF_BBOENAB); diff --git a/drivers/net/wireless/hostap/Kconfig b/drivers/net/wireless/hostap/Kconfig index c8f6286dd35..308f773ad56 100644 --- a/drivers/net/wireless/hostap/Kconfig +++ b/drivers/net/wireless/hostap/Kconfig @@ -75,7 +75,7 @@ config HOSTAP_PCI config HOSTAP_CS tristate "Host AP driver for Prism2/2.5/3 PC Cards" - depends on PCMCIA!=n && HOSTAP + depends on PCMCIA && HOSTAP ---help--- Host AP driver's version for Prism2/2.5/3 PC Cards. diff --git a/drivers/net/wireless/ipw2100.c b/drivers/net/wireless/ipw2100.c index 8bf02763b5c..6290c9f7e93 100644 --- a/drivers/net/wireless/ipw2100.c +++ b/drivers/net/wireless/ipw2100.c @@ -2201,6 +2201,17 @@ static int ipw2100_alloc_skb(struct ipw2100_priv *priv, #define SEARCH_SNAPSHOT 1 #define SNAPSHOT_ADDR(ofs) (priv->snapshot[((ofs) >> 12) & 0xff] + ((ofs) & 0xfff)) +static void ipw2100_snapshot_free(struct ipw2100_priv *priv) +{ + int i; + if (!priv->snapshot[0]) + return; + for (i = 0; i < 0x30; i++) + kfree(priv->snapshot[i]); + priv->snapshot[0] = NULL; +} + +#ifdef CONFIG_IPW2100_DEBUG_C3 static int ipw2100_snapshot_alloc(struct ipw2100_priv *priv) { int i; @@ -2221,16 +2232,6 @@ static int ipw2100_snapshot_alloc(struct ipw2100_priv *priv) return 1; } -static void ipw2100_snapshot_free(struct ipw2100_priv *priv) -{ - int i; - if (!priv->snapshot[0]) - return; - for (i = 0; i < 0x30; i++) - kfree(priv->snapshot[i]); - priv->snapshot[0] = NULL; -} - static u32 ipw2100_match_buf(struct ipw2100_priv *priv, u8 * in_buf, size_t len, int mode) { @@ -2269,6 +2270,7 @@ static u32 ipw2100_match_buf(struct ipw2100_priv *priv, u8 * in_buf, return ret; } +#endif /* * @@ -7112,11 +7114,17 @@ static int ipw2100_wx_set_txpow(struct net_device *dev, { struct ipw2100_priv *priv = ieee80211_priv(dev); int err = 0, value; + + if (ipw_radio_kill_sw(priv, wrqu->txpower.disabled)) + return -EINPROGRESS; if (priv->ieee->iw_mode != IW_MODE_ADHOC) + return 0; + + if ((wrqu->txpower.flags & IW_TXPOW_TYPE) != IW_TXPOW_DBM) return -EINVAL; - if (wrqu->txpower.disabled == 1 || wrqu->txpower.fixed == 0) + if (wrqu->txpower.fixed == 0) value = IPW_TX_POWER_DEFAULT; else { if (wrqu->txpower.value < IPW_TX_POWER_MIN_DBM || @@ -7151,24 +7159,19 @@ static int ipw2100_wx_get_txpow(struct net_device *dev, struct ipw2100_priv *priv = ieee80211_priv(dev); - if (priv->ieee->iw_mode != IW_MODE_ADHOC) { - wrqu->power.disabled = 1; - return 0; - } + wrqu->txpower.disabled = (priv->status & STATUS_RF_KILL_MASK) ? 1 : 0; if (priv->tx_power == IPW_TX_POWER_DEFAULT) { - wrqu->power.fixed = 0; - wrqu->power.value = IPW_TX_POWER_MAX_DBM; - wrqu->power.disabled = 1; + wrqu->txpower.fixed = 0; + wrqu->txpower.value = IPW_TX_POWER_MAX_DBM; } else { - wrqu->power.disabled = 0; - wrqu->power.fixed = 1; - wrqu->power.value = priv->tx_power; + wrqu->txpower.fixed = 1; + wrqu->txpower.value = priv->tx_power; } - wrqu->power.flags = IW_TXPOW_DBM; + wrqu->txpower.flags = IW_TXPOW_DBM; - IPW_DEBUG_WX("GET TX Power -> %d \n", wrqu->power.value); + IPW_DEBUG_WX("GET TX Power -> %d \n", wrqu->txpower.value); return 0; } diff --git a/drivers/net/wireless/ipw2200.c b/drivers/net/wireless/ipw2200.c index 4c28e332ecc..916b24c544e 100644 --- a/drivers/net/wireless/ipw2200.c +++ b/drivers/net/wireless/ipw2200.c @@ -8012,6 +8012,10 @@ static int ipw_sw_reset(struct ipw_priv *priv, int init) else IPW_DEBUG_INFO("Auto adhoc creation disabled.\n"); + priv->config &= ~CFG_STATIC_ESSID; + priv->essid_len = 0; + memset(priv->essid, 0, IW_ESSID_MAX_SIZE); + if (disable) { priv->status |= STATUS_RF_KILL_SW; IPW_DEBUG_INFO("Radio disabled.\n"); @@ -11035,7 +11039,6 @@ static int ipw_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent) net_dev->set_multicast_list = ipw_net_set_multicast_list; net_dev->set_mac_address = ipw_net_set_mac_address; priv->wireless_data.spy_data = &priv->ieee->spy_data; - priv->wireless_data.ieee80211 = priv->ieee; net_dev->wireless_data = &priv->wireless_data; net_dev->wireless_handlers = &ipw_wx_handler_def; net_dev->ethtool_ops = &ipw_ethtool_ops; @@ -11121,8 +11124,8 @@ static void ipw_pci_remove(struct pci_dev *pdev) /* Free MAC hash list for ADHOC */ for (i = 0; i < IPW_IBSS_MAC_HASH_SIZE; i++) { list_for_each_safe(p, q, &priv->ibss_mac_hash[i]) { - kfree(list_entry(p, struct ipw_ibss_seq, list)); list_del(p); + kfree(list_entry(p, struct ipw_ibss_seq, list)); } } diff --git a/drivers/net/wireless/orinoco_cs.c b/drivers/net/wireless/orinoco_cs.c index b664708481c..3c128b692bc 100644 --- a/drivers/net/wireless/orinoco_cs.c +++ b/drivers/net/wireless/orinoco_cs.c @@ -261,13 +261,13 @@ orinoco_cs_config(dev_link_t *link) /* Note that the CIS values need to be rescaled */ if (cfg->vcc.present & (1 << CISTPL_POWER_VNOM)) { if (conf.Vcc != cfg->vcc.param[CISTPL_POWER_VNOM] / 10000) { - DEBUG(2, "orinoco_cs_config: Vcc mismatch (conf.Vcc = %d, CIS = %d)\n", conf.Vcc, cfg->vcc.param[CISTPL_POWER_VNOM] / 10000); + DEBUG(2, "orinoco_cs_config: Vcc mismatch (conf.Vcc = %d, cfg CIS = %d)\n", conf.Vcc, cfg->vcc.param[CISTPL_POWER_VNOM] / 10000); if (!ignore_cis_vcc) goto next_entry; } } else if (dflt.vcc.present & (1 << CISTPL_POWER_VNOM)) { if (conf.Vcc != dflt.vcc.param[CISTPL_POWER_VNOM] / 10000) { - DEBUG(2, "orinoco_cs_config: Vcc mismatch (conf.Vcc = %d, CIS = %d)\n", conf.Vcc, dflt.vcc.param[CISTPL_POWER_VNOM] / 10000); + DEBUG(2, "orinoco_cs_config: Vcc mismatch (conf.Vcc = %d, dflt CIS = %d)\n", conf.Vcc, dflt.vcc.param[CISTPL_POWER_VNOM] / 10000); if(!ignore_cis_vcc) goto next_entry; } diff --git a/drivers/pci/msi.c b/drivers/pci/msi.c index 202b7507a35..8e1ba0b7a8e 100644 --- a/drivers/pci/msi.c +++ b/drivers/pci/msi.c @@ -416,7 +416,9 @@ static void attach_msi_entry(struct msi_desc *entry, int vector) static void irq_handler_init(int cap_id, int pos, int mask) { - spin_lock(&irq_desc[pos].lock); + unsigned long flags; + + spin_lock_irqsave(&irq_desc[pos].lock, flags); if (cap_id == PCI_CAP_ID_MSIX) irq_desc[pos].handler = &msix_irq_type; else { @@ -425,7 +427,7 @@ static void irq_handler_init(int cap_id, int pos, int mask) else irq_desc[pos].handler = &msi_irq_w_maskbit_type; } - spin_unlock(&irq_desc[pos].lock); + spin_unlock_irqrestore(&irq_desc[pos].lock, flags); } static void enable_msi_mode(struct pci_dev *dev, int pos, int type) diff --git a/drivers/scsi/aic7xxx/Kconfig.aic79xx b/drivers/scsi/aic7xxx/Kconfig.aic79xx index 69ed77fcb71..7955ebe8e1e 100644 --- a/drivers/scsi/aic7xxx/Kconfig.aic79xx +++ b/drivers/scsi/aic7xxx/Kconfig.aic79xx @@ -37,13 +37,13 @@ config AIC79XX_CMDS_PER_DEVICE config AIC79XX_RESET_DELAY_MS int "Initial bus reset delay in milli-seconds" depends on SCSI_AIC79XX - default "15000" + default "5000" ---help--- The number of milliseconds to delay after an initial bus reset. The bus settle delay following all error recovery actions is dictated by the SCSI layer and is not affected by this value. - Default: 15000 (15 seconds) + Default: 5000 (5 seconds) config AIC79XX_BUILD_FIRMWARE bool "Build Adapter Firmware with Kernel Build" diff --git a/drivers/scsi/aic7xxx/aic79xx.h b/drivers/scsi/aic7xxx/aic79xx.h index 2cfdbef447d..1d11f7e7756 100644 --- a/drivers/scsi/aic7xxx/aic79xx.h +++ b/drivers/scsi/aic7xxx/aic79xx.h @@ -37,7 +37,7 @@ * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGES. * - * $Id: //depot/aic7xxx/aic7xxx/aic79xx.h#108 $ + * $Id: //depot/aic7xxx/aic7xxx/aic79xx.h#109 $ * * $FreeBSD$ */ @@ -222,6 +222,7 @@ typedef enum { typedef enum { AHD_FENONE = 0x00000, AHD_WIDE = 0x00001,/* Wide Channel */ + AHD_AIC79XXB_SLOWCRC = 0x00002,/* SLOWCRC bit should be set */ AHD_MULTI_FUNC = 0x00100,/* Multi-Function/Channel Device */ AHD_TARGETMODE = 0x01000,/* Has tested target mode support */ AHD_MULTIROLE = 0x02000,/* Space for two roles at a time */ diff --git a/drivers/scsi/aic7xxx/aic79xx.reg b/drivers/scsi/aic7xxx/aic79xx.reg index 3a3204703b1..be14e2ecb8f 100644 --- a/drivers/scsi/aic7xxx/aic79xx.reg +++ b/drivers/scsi/aic7xxx/aic79xx.reg @@ -1,7 +1,7 @@ /* * Aic79xx register and scratch ram definitions. * - * Copyright (c) 1994-2001 Justin T. Gibbs. + * Copyright (c) 1994-2001, 2004 Justin T. Gibbs. * Copyright (c) 2000-2002 Adaptec Inc. * All rights reserved. * @@ -39,7 +39,7 @@ * * $FreeBSD$ */ -VERSION = "$Id: //depot/aic7xxx/aic7xxx/aic79xx.reg#76 $" +VERSION = "$Id: //depot/aic7xxx/aic7xxx/aic79xx.reg#77 $" /* * This file is processed by the aic7xxx_asm utility for use in assembling @@ -3715,8 +3715,9 @@ scratch_ram { SEQ_FLAGS2 { size 1 - field TARGET_MSG_PENDING 0x02 - field SELECTOUT_QFROZEN 0x04 + field PENDING_MK_MESSAGE 0x01 + field TARGET_MSG_PENDING 0x02 + field SELECTOUT_QFROZEN 0x04 } ALLOCFIFO_SCBPTR { @@ -3777,6 +3778,26 @@ scratch_ram { CMDSIZE_TABLE { size 8 } + /* + * When an SCB with the MK_MESSAGE flag is + * queued to the controller, it cannot enter + * the waiting for selection list until the + * selections for any previously queued + * commands to that target complete. During + * the wait, the MK_MESSAGE SCB is queued + * here. + */ + MK_MESSAGE_SCB { + size 2 + } + /* + * Saved SCSIID of MK_MESSAGE_SCB to avoid + * an extra SCBPTR operation when deciding + * if the MK_MESSAGE_SCB can be run. + */ + MK_MESSAGE_SCSIID { + size 1 + } } /************************* Hardware SCB Definition ****************************/ diff --git a/drivers/scsi/aic7xxx/aic79xx.seq b/drivers/scsi/aic7xxx/aic79xx.seq index bef1f9d369b..58bc17591b5 100644 --- a/drivers/scsi/aic7xxx/aic79xx.seq +++ b/drivers/scsi/aic7xxx/aic79xx.seq @@ -1,7 +1,7 @@ /* * Adaptec U320 device driver firmware for Linux and FreeBSD. * - * Copyright (c) 1994-2001 Justin T. Gibbs. + * Copyright (c) 1994-2001, 2004 Justin T. Gibbs. * Copyright (c) 2000-2002 Adaptec Inc. * All rights reserved. * @@ -40,7 +40,7 @@ * $FreeBSD$ */ -VERSION = "$Id: //depot/aic7xxx/aic7xxx/aic79xx.seq#119 $" +VERSION = "$Id: //depot/aic7xxx/aic7xxx/aic79xx.seq#120 $" PATCH_ARG_LIST = "struct ahd_softc *ahd" PREFIX = "ahd_" @@ -110,10 +110,8 @@ check_waiting_list: * one last time. */ test SSTAT0, SELDO jnz select_out; -END_CRITICAL; call start_selection; idle_loop_checkbus: -BEGIN_CRITICAL; test SSTAT0, SELDO jnz select_out; END_CRITICAL; test SSTAT0, SELDI jnz select_in; @@ -294,7 +292,6 @@ fetch_new_scb_inprog: test CCSCBCTL, ARRDONE jz return; fetch_new_scb_done: and CCSCBCTL, ~(CCARREN|CCSCBEN); - bmov REG0, SCBPTR, 2; clr A; add CMDS_PENDING, 1; adc CMDS_PENDING[1], A; @@ -316,43 +313,117 @@ fetch_new_scb_done: clr SCB_FIFO_USE_COUNT; /* Update the next SCB address to download. */ bmov NEXT_QUEUED_SCB_ADDR, SCB_NEXT_SCB_BUSADDR, 4; + /* + * NULL out the SCB links since these fields + * occupy the same location as SCB_NEXT_SCB_BUSADDR. + */ mvi SCB_NEXT[1], SCB_LIST_NULL; mvi SCB_NEXT2[1], SCB_LIST_NULL; /* Increment our position in the QINFIFO. */ mov NONE, SNSCB_QOFF; + /* - * SCBs that want to send messages are always - * queued independently. This ensures that they - * are at the head of the SCB list to select out - * to a target and we will see the MK_MESSAGE flag. + * Save SCBID of this SCB in REG0 since + * SCBPTR will be clobbered during target + * list updates. We also record the SCB's + * flags so that we can refer to them even + * after SCBPTR has been changed. + */ + bmov REG0, SCBPTR, 2; + mov A, SCB_CONTROL; + + /* + * Find the tail SCB of the execution queue + * for this target. */ - test SCB_CONTROL, MK_MESSAGE jnz first_new_target_scb; shr SINDEX, 3, SCB_SCSIID; and SINDEX, ~0x1; mvi SINDEX[1], (WAITING_SCB_TAILS >> 8); bmov DINDEX, SINDEX, 2; bmov SCBPTR, SINDIR, 2; + + /* + * Update the tail to point to the new SCB. + */ bmov DINDIR, REG0, 2; + + /* + * If the queue was empty, queue this SCB as + * the first for this target. + */ cmp SCBPTR[1], SCB_LIST_NULL je first_new_target_scb; + + /* + * SCBs that want to send messages must always be + * at the head of their per-target queue so that + * ATN can be asserted even if the current + * negotiation agreement is packetized. If the + * target queue is empty, the SCB can be queued + * immediately. If the queue is not empty, we must + * wait for it to empty before entering this SCB + * into the waiting for selection queue. Otherwise + * our batching and round-robin selection scheme + * could allow commands to be queued out of order. + * To simplify the implementation, we stop pulling + * new commands from the host until the MK_MESSAGE + * SCB can be queued to the waiting for selection + * list. + */ + test A, MK_MESSAGE jz batch_scb; + + /* + * If the last SCB is also a MK_MESSAGE SCB, then + * order is preserved even if we batch. + */ + test SCB_CONTROL, MK_MESSAGE jz batch_scb; + + /* + * Defer this SCB and stop fetching new SCBs until + * it can be queued. Since the SCB_SCSIID of the + * tail SCB must be the same as that of the newly + * queued SCB, there is no need to restore the SCBID + * here. + */ + or SEQ_FLAGS2, PENDING_MK_MESSAGE; + bmov MK_MESSAGE_SCB, REG0, 2; + mov MK_MESSAGE_SCSIID, SCB_SCSIID ret; + +batch_scb: + /* + * Otherwise just update the previous tail SCB to + * point to the new tail. + */ bmov SCB_NEXT, REG0, 2 ret; + first_new_target_scb: + /* + * Append SCB to the tail of the waiting for + * selection list. + */ cmp WAITING_TID_HEAD[1], SCB_LIST_NULL je first_new_scb; bmov SCBPTR, WAITING_TID_TAIL, 2; bmov SCB_NEXT2, REG0, 2; bmov WAITING_TID_TAIL, REG0, 2 ret; first_new_scb: + /* + * Whole list is empty, so the head of + * the list must be initialized too. + */ bmov WAITING_TID_HEAD, REG0, 2; bmov WAITING_TID_TAIL, REG0, 2 ret; END_CRITICAL; scbdma_idle: /* - * Give precedence to downloading new SCBs to execute - * unless select-outs are currently frozen. + * Don't bother downloading new SCBs to execute + * if select-outs are currently frozen or we have + * a MK_MESSAGE SCB waiting to enter the queue. */ - test SEQ_FLAGS2, SELECTOUT_QFROZEN jnz . + 2; + test SEQ_FLAGS2, SELECTOUT_QFROZEN|PENDING_MK_MESSAGE + jnz scbdma_no_new_scbs; BEGIN_CRITICAL; test QOFF_CTLSTA, NEW_SCB_AVAIL jnz fetch_new_scb; +scbdma_no_new_scbs: cmp COMPLETE_DMA_SCB_HEAD[1], SCB_LIST_NULL jne dma_complete_scb; cmp COMPLETE_SCB_HEAD[1], SCB_LIST_NULL je return; /* FALLTHROUGH */ @@ -671,27 +742,41 @@ curscb_ww_done: } /* - * Requeue any SCBs not sent, to the tail of the waiting Q. + * The whole list made it. Clear our tail pointer to indicate + * that the per-target selection queue is now empty. */ - cmp SCB_NEXT[1], SCB_LIST_NULL je select_out_list_done; + cmp SCB_NEXT[1], SCB_LIST_NULL je select_out_clear_tail; /* + * Requeue any SCBs not sent, to the tail of the waiting Q. * We know that neither the per-TID list nor the list of - * TIDs is empty. Use this knowledge to our advantage. + * TIDs is empty. Use this knowledge to our advantage and + * queue the remainder to the tail of the global execution + * queue. */ bmov REG0, SCB_NEXT, 2; +select_out_queue_remainder: bmov SCBPTR, WAITING_TID_TAIL, 2; bmov SCB_NEXT2, REG0, 2; bmov WAITING_TID_TAIL, REG0, 2; jmp select_out_inc_tid_q; -select_out_list_done: +select_out_clear_tail: + /* + * Queue any pending MK_MESSAGE SCB for this target now + * that the queue is empty. + */ + test SEQ_FLAGS2, PENDING_MK_MESSAGE jz select_out_no_mk_message_scb; + mov A, MK_MESSAGE_SCSIID; + cmp SCB_SCSIID, A jne select_out_no_mk_message_scb; + and SEQ_FLAGS2, ~PENDING_MK_MESSAGE; + bmov REG0, MK_MESSAGE_SCB, 2; + jmp select_out_queue_remainder; + +select_out_no_mk_message_scb: /* - * The whole list made it. Just clear our TID's tail pointer - * unless we were queued independently due to our need to - * send a message. + * Clear this target's execution tail and increment the queue. */ - test SCB_CONTROL, MK_MESSAGE jnz select_out_inc_tid_q; shr DINDEX, 3, SCB_SCSIID; or DINDEX, 1; /* Want only the second byte */ mvi DINDEX[1], ((WAITING_SCB_TAILS) >> 8); @@ -703,8 +788,8 @@ select_out_inc_tid_q: mvi WAITING_TID_TAIL[1], SCB_LIST_NULL; bmov SCBPTR, CURRSCB, 2; mvi CLRSINT0, CLRSELDO; - test LQOSTAT2, LQOPHACHGOUTPKT jnz unexpected_nonpkt_phase; - test LQOSTAT1, LQOPHACHGINPKT jnz unexpected_nonpkt_phase; + test LQOSTAT2, LQOPHACHGOUTPKT jnz unexpected_nonpkt_mode_cleared; + test LQOSTAT1, LQOPHACHGINPKT jnz unexpected_nonpkt_mode_cleared; /* * If this is a packetized connection, return to our @@ -2127,6 +2212,18 @@ SET_DST_MODE M_DFF0; mvi DFFSXFRCTL, CLRCHN; unexpected_nonpkt_mode_cleared: mvi CLRSINT2, CLRNONPACKREQ; + if ((ahd->bugs & AHD_BUSFREEREV_BUG) != 0) { + /* + * Test to ensure that the bus has not + * already gone free prior to clearing + * any stale busfree status. This avoids + * a window whereby a busfree just after + * a selection could be missed. + */ + test SCSISIGI, BSYI jz . + 2; + mvi CLRSINT1,CLRBUSFREE; + or SIMODE1, ENBUSFREE; + } test SCSIPHASE, ~(MSG_IN_PHASE|MSG_OUT_PHASE) jnz illegal_phase; SET_SEQINTCODE(ENTERING_NONPACK) jmp ITloop; diff --git a/drivers/scsi/aic7xxx/aic79xx_core.c b/drivers/scsi/aic7xxx/aic79xx_core.c index db8f5ce99ee..342f77966a5 100644 --- a/drivers/scsi/aic7xxx/aic79xx_core.c +++ b/drivers/scsi/aic7xxx/aic79xx_core.c @@ -37,7 +37,7 @@ * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGES. * - * $Id: //depot/aic7xxx/aic7xxx/aic79xx.c#247 $ + * $Id: //depot/aic7xxx/aic7xxx/aic79xx.c#250 $ */ #ifdef __linux__ @@ -197,7 +197,8 @@ static int ahd_search_scb_list(struct ahd_softc *ahd, int target, char channel, int lun, u_int tag, role_t role, uint32_t status, ahd_search_action action, - u_int *list_head, u_int tid); + u_int *list_head, u_int *list_tail, + u_int tid); static void ahd_stitch_tid_list(struct ahd_softc *ahd, u_int tid_prev, u_int tid_cur, u_int tid_next); @@ -1660,7 +1661,8 @@ ahd_handle_scsiint(struct ahd_softc *ahd, u_int intstat) * so just clear the error. */ ahd_outb(ahd, CLRLQIINT1, CLRLQICRCI_NLQ); - } else if ((status & BUSFREE) != 0) { + } else if ((status & BUSFREE) != 0 + || (lqistat1 & LQOBUSFREE) != 0) { u_int lqostat1; int restart; int clear_fifo; @@ -2025,10 +2027,6 @@ ahd_handle_pkt_busfree(struct ahd_softc *ahd, u_int busfreetime) u_int waiting_t; u_int next; - if ((busfreetime & BUSFREE_LQO) == 0) - printf("%s: Warning, BUSFREE time is 0x%x. " - "Expected BUSFREE_LQO.\n", - ahd_name(ahd), busfreetime); /* * The LQO manager detected an unexpected busfree * either: @@ -2251,8 +2249,14 @@ ahd_handle_nonpkt_busfree(struct ahd_softc *ahd) struct ahd_tmode_tstate *tstate; /* - * PPR Rejected. Try non-ppr negotiation - * and retry command. + * PPR Rejected. + * + * If the previous negotiation was packetized, + * this could be because the device has been + * reset without our knowledge. Force our + * current negotiation to async and retry the + * negotiation. Otherwise retry the command + * with non-ppr negotiation. */ #ifdef AHD_DEBUG if ((ahd_debug & AHD_SHOW_MESSAGES) != 0) @@ -2261,11 +2265,34 @@ ahd_handle_nonpkt_busfree(struct ahd_softc *ahd) tinfo = ahd_fetch_transinfo(ahd, devinfo.channel, devinfo.our_scsiid, devinfo.target, &tstate); - tinfo->curr.transport_version = 2; - tinfo->goal.transport_version = 2; - tinfo->goal.ppr_options = 0; - ahd_qinfifo_requeue_tail(ahd, scb); - printerror = 0; + if ((tinfo->curr.ppr_options & MSG_EXT_PPR_IU_REQ)!=0) { + ahd_set_width(ahd, &devinfo, + MSG_EXT_WDTR_BUS_8_BIT, + AHD_TRANS_CUR, + /*paused*/TRUE); + ahd_set_syncrate(ahd, &devinfo, + /*period*/0, /*offset*/0, + /*ppr_options*/0, + AHD_TRANS_CUR, + /*paused*/TRUE); + /* + * The expect PPR busfree handler below + * will effect the retry and necessary + * abort. + */ + } else { + tinfo->curr.transport_version = 2; + tinfo->goal.transport_version = 2; + tinfo->goal.ppr_options = 0; + /* + * Remove any SCBs in the waiting for selection + * queue that may also be for this target so + * that command ordering is preserved. + */ + ahd_freeze_devq(ahd, scb); + ahd_qinfifo_requeue_tail(ahd, scb); + printerror = 0; + } } else if (ahd_sent_msg(ahd, AHDMSG_EXT, MSG_EXT_WDTR, FALSE) && ppr_busfree == 0) { /* @@ -2280,6 +2307,12 @@ ahd_handle_nonpkt_busfree(struct ahd_softc *ahd) MSG_EXT_WDTR_BUS_8_BIT, AHD_TRANS_CUR|AHD_TRANS_GOAL, /*paused*/TRUE); + /* + * Remove any SCBs in the waiting for selection + * queue that may also be for this target so that + * command ordering is preserved. + */ + ahd_freeze_devq(ahd, scb); ahd_qinfifo_requeue_tail(ahd, scb); printerror = 0; } else if (ahd_sent_msg(ahd, AHDMSG_EXT, MSG_EXT_SDTR, FALSE) @@ -2297,6 +2330,12 @@ ahd_handle_nonpkt_busfree(struct ahd_softc *ahd) /*ppr_options*/0, AHD_TRANS_CUR|AHD_TRANS_GOAL, /*paused*/TRUE); + /* + * Remove any SCBs in the waiting for selection + * queue that may also be for this target so that + * command ordering is preserved. + */ + ahd_freeze_devq(ahd, scb); ahd_qinfifo_requeue_tail(ahd, scb); printerror = 0; } else if ((ahd->msg_flags & MSG_FLAG_EXPECT_IDE_BUSFREE) != 0 @@ -2369,14 +2408,14 @@ ahd_handle_nonpkt_busfree(struct ahd_softc *ahd) */ printf("%s: ", ahd_name(ahd)); } - if (lastphase != P_BUSFREE) - ahd_force_renegotiation(ahd, &devinfo); printf("Unexpected busfree %s, %d SCBs aborted, " "PRGMCNT == 0x%x\n", ahd_lookup_phase_entry(lastphase)->phasemsg, aborted, ahd_inw(ahd, PRGMCNT)); ahd_dump_card_state(ahd); + if (lastphase != P_BUSFREE) + ahd_force_renegotiation(ahd, &devinfo); } /* Always restart the sequencer. */ return (1); @@ -3293,6 +3332,15 @@ ahd_update_neg_table(struct ahd_softc *ahd, struct ahd_devinfo *devinfo, con_opts |= WIDEXFER; /* + * Slow down our CRC interval to be + * compatible with packetized U320 devices + * that can't handle a CRC at full speed + */ + if (ahd->features & AHD_AIC79XXB_SLOWCRC) { + con_opts |= ENSLOWCRC; + } + + /* * During packetized transfers, the target will * give us the oportunity to send command packets * without us asserting attention. @@ -3315,7 +3363,6 @@ ahd_update_pending_scbs(struct ahd_softc *ahd) { struct scb *pending_scb; int pending_scb_count; - u_int scb_tag; int paused; u_int saved_scbptr; ahd_mode_state saved_modes; @@ -3333,7 +3380,6 @@ ahd_update_pending_scbs(struct ahd_softc *ahd) pending_scb_count = 0; LIST_FOREACH(pending_scb, &ahd->pending_scbs, pending_links) { struct ahd_devinfo devinfo; - struct hardware_scb *pending_hscb; struct ahd_initiator_tinfo *tinfo; struct ahd_tmode_tstate *tstate; @@ -3341,11 +3387,10 @@ ahd_update_pending_scbs(struct ahd_softc *ahd) tinfo = ahd_fetch_transinfo(ahd, devinfo.channel, devinfo.our_scsiid, devinfo.target, &tstate); - pending_hscb = pending_scb->hscb; if ((tstate->auto_negotiate & devinfo.target_mask) == 0 && (pending_scb->flags & SCB_AUTO_NEGOTIATE) != 0) { pending_scb->flags &= ~SCB_AUTO_NEGOTIATE; - pending_hscb->control &= ~MK_MESSAGE; + pending_scb->hscb->control &= ~MK_MESSAGE; } ahd_sync_scb(ahd, pending_scb, BUS_DMASYNC_PREREAD|BUS_DMASYNC_PREWRITE); @@ -3377,18 +3422,15 @@ ahd_update_pending_scbs(struct ahd_softc *ahd) ahd_outb(ahd, SCSISEQ0, ahd_inb(ahd, SCSISEQ0) & ~ENSELO); saved_scbptr = ahd_get_scbptr(ahd); /* Ensure that the hscbs down on the card match the new information */ - for (scb_tag = 0; scb_tag < ahd->scb_data.maxhscbs; scb_tag++) { - struct hardware_scb *pending_hscb; + LIST_FOREACH(pending_scb, &ahd->pending_scbs, pending_links) { + u_int scb_tag; u_int control; - pending_scb = ahd_lookup_scb(ahd, scb_tag); - if (pending_scb == NULL) - continue; + scb_tag = SCB_GET_TAG(pending_scb); ahd_set_scbptr(ahd, scb_tag); - pending_hscb = pending_scb->hscb; control = ahd_inb_scbram(ahd, SCB_CONTROL); control &= ~MK_MESSAGE; - control |= pending_hscb->control & MK_MESSAGE; + control |= pending_scb->hscb->control & MK_MESSAGE; ahd_outb(ahd, SCB_CONTROL, control); } ahd_set_scbptr(ahd, saved_scbptr); @@ -6500,13 +6542,14 @@ ahd_chip_init(struct ahd_softc *ahd) | ENLQIOVERI_LQ|ENLQIOVERI_NLQ); ahd_outb(ahd, LQOMODE0, ENLQOATNLQ|ENLQOATNPKT|ENLQOTCRC); /* - * An interrupt from LQOBUSFREE is made redundant by the - * BUSFREE interrupt. We choose to have the sequencer catch - * LQOPHCHGINPKT errors manually for the command phase at the - * start of a packetized selection case. - ahd_outb(ahd, LQOMODE1, ENLQOBUSFREE|ENLQOPHACHGINPKT); + * We choose to have the sequencer catch LQOPHCHGINPKT errors + * manually for the command phase at the start of a packetized + * selection case. ENLQOBUSFREE should be made redundant by + * the BUSFREE interrupt, but it seems that some LQOBUSFREE + * events fail to assert the BUSFREE interrupt so we must + * also enable LQOBUSFREE interrupts. */ - ahd_outb(ahd, LQOMODE1, 0); + ahd_outb(ahd, LQOMODE1, ENLQOBUSFREE); /* * Setup sequencer interrupt handlers. @@ -6617,6 +6660,8 @@ ahd_chip_init(struct ahd_softc *ahd) /* We don't have any waiting selections */ ahd_outw(ahd, WAITING_TID_HEAD, SCB_LIST_NULL); ahd_outw(ahd, WAITING_TID_TAIL, SCB_LIST_NULL); + ahd_outw(ahd, MK_MESSAGE_SCB, SCB_LIST_NULL); + ahd_outw(ahd, MK_MESSAGE_SCSIID, 0xFF); for (i = 0; i < AHD_NUM_TARGETS; i++) ahd_outw(ahd, WAITING_SCB_TAILS + (2 * i), SCB_LIST_NULL); @@ -6704,6 +6749,18 @@ ahd_chip_init(struct ahd_softc *ahd) ahd_loadseq(ahd); ahd_set_modes(ahd, AHD_MODE_SCSI, AHD_MODE_SCSI); + + if (ahd->features & AHD_AIC79XXB_SLOWCRC) { + u_int negodat3 = ahd_inb(ahd, NEGCONOPTS); + + negodat3 |= ENSLOWCRC; + ahd_outb(ahd, NEGCONOPTS, negodat3); + negodat3 = ahd_inb(ahd, NEGCONOPTS); + if (!(negodat3 & ENSLOWCRC)) + printf("aic79xx: failed to set the SLOWCRC bit\n"); + else + printf("aic79xx: SLOWCRC bit set\n"); + } } /* @@ -7260,12 +7317,28 @@ ahd_reset_cmds_pending(struct ahd_softc *ahd) ahd->flags &= ~AHD_UPDATE_PEND_CMDS; } +void +ahd_done_with_status(struct ahd_softc *ahd, struct scb *scb, uint32_t status) +{ + cam_status ostat; + cam_status cstat; + + ostat = ahd_get_transaction_status(scb); + if (ostat == CAM_REQ_INPROG) + ahd_set_transaction_status(scb, status); + cstat = ahd_get_transaction_status(scb); + if (cstat != CAM_REQ_CMP) + ahd_freeze_scb(scb); + ahd_done(ahd, scb); +} + int ahd_search_qinfifo(struct ahd_softc *ahd, int target, char channel, int lun, u_int tag, role_t role, uint32_t status, ahd_search_action action) { struct scb *scb; + struct scb *mk_msg_scb; struct scb *prev_scb; ahd_mode_state saved_modes; u_int qinstart; @@ -7274,6 +7347,7 @@ ahd_search_qinfifo(struct ahd_softc *ahd, int target, char channel, u_int tid_next; u_int tid_prev; u_int scbid; + u_int seq_flags2; u_int savedscbptr; uint32_t busaddr; int found; @@ -7329,23 +7403,10 @@ ahd_search_qinfifo(struct ahd_softc *ahd, int target, char channel, found++; switch (action) { case SEARCH_COMPLETE: - { - cam_status ostat; - cam_status cstat; - - ostat = ahd_get_transaction_status(scb); - if (ostat == CAM_REQ_INPROG) - ahd_set_transaction_status(scb, - status); - cstat = ahd_get_transaction_status(scb); - if (cstat != CAM_REQ_CMP) - ahd_freeze_scb(scb); if ((scb->flags & SCB_ACTIVE) == 0) printf("Inactive SCB in qinfifo\n"); - ahd_done(ahd, scb); - + ahd_done_with_status(ahd, scb, status); /* FALLTHROUGH */ - } case SEARCH_REMOVE: break; case SEARCH_PRINT: @@ -7375,21 +7436,24 @@ ahd_search_qinfifo(struct ahd_softc *ahd, int target, char channel, * looking for matches. */ ahd_set_modes(ahd, AHD_MODE_SCSI, AHD_MODE_SCSI); + seq_flags2 = ahd_inb(ahd, SEQ_FLAGS2); + if ((seq_flags2 & PENDING_MK_MESSAGE) != 0) { + scbid = ahd_inw(ahd, MK_MESSAGE_SCB); + mk_msg_scb = ahd_lookup_scb(ahd, scbid); + } else + mk_msg_scb = NULL; savedscbptr = ahd_get_scbptr(ahd); tid_next = ahd_inw(ahd, WAITING_TID_HEAD); tid_prev = SCB_LIST_NULL; targets = 0; for (scbid = tid_next; !SCBID_IS_NULL(scbid); scbid = tid_next) { u_int tid_head; + u_int tid_tail; - /* - * We limit based on the number of SCBs since - * MK_MESSAGE SCBs are not in the per-tid lists. - */ targets++; - if (targets > AHD_SCB_MAX) { + if (targets > AHD_NUM_TARGETS) panic("TID LIST LOOP"); - } + if (scbid >= ahd->scb_data.numscbs) { printf("%s: Waiting TID List inconsistency. " "SCB index == 0x%x, yet numscbs == 0x%x.", @@ -7419,8 +7483,71 @@ ahd_search_qinfifo(struct ahd_softc *ahd, int target, char channel, tid_head = scbid; found += ahd_search_scb_list(ahd, target, channel, lun, tag, role, status, - action, &tid_head, + action, &tid_head, &tid_tail, SCB_GET_TARGET(ahd, scb)); + /* + * Check any MK_MESSAGE SCB that is still waiting to + * enter this target's waiting for selection queue. + */ + if (mk_msg_scb != NULL + && ahd_match_scb(ahd, mk_msg_scb, target, channel, + lun, tag, role)) { + + /* + * We found an scb that needs to be acted on. + */ + found++; + switch (action) { + case SEARCH_COMPLETE: + if ((mk_msg_scb->flags & SCB_ACTIVE) == 0) + printf("Inactive SCB pending MK_MSG\n"); + ahd_done_with_status(ahd, mk_msg_scb, status); + /* FALLTHROUGH */ + case SEARCH_REMOVE: + { + u_int tail_offset; + + printf("Removing MK_MSG scb\n"); + + /* + * Reset our tail to the tail of the + * main per-target list. + */ + tail_offset = WAITING_SCB_TAILS + + (2 * SCB_GET_TARGET(ahd, mk_msg_scb)); + ahd_outw(ahd, tail_offset, tid_tail); + + seq_flags2 &= ~PENDING_MK_MESSAGE; + ahd_outb(ahd, SEQ_FLAGS2, seq_flags2); + ahd_outw(ahd, CMDS_PENDING, + ahd_inw(ahd, CMDS_PENDING)-1); + mk_msg_scb = NULL; + break; + } + case SEARCH_PRINT: + printf(" 0x%x", SCB_GET_TAG(scb)); + /* FALLTHROUGH */ + case SEARCH_COUNT: + break; + } + } + + if (mk_msg_scb != NULL + && SCBID_IS_NULL(tid_head) + && ahd_match_scb(ahd, scb, target, channel, CAM_LUN_WILDCARD, + SCB_LIST_NULL, ROLE_UNKNOWN)) { + + /* + * When removing the last SCB for a target + * queue with a pending MK_MESSAGE scb, we + * must queue the MK_MESSAGE scb. + */ + printf("Queueing mk_msg_scb\n"); + tid_head = ahd_inw(ahd, MK_MESSAGE_SCB); + seq_flags2 &= ~PENDING_MK_MESSAGE; + ahd_outb(ahd, SEQ_FLAGS2, seq_flags2); + mk_msg_scb = NULL; + } if (tid_head != scbid) ahd_stitch_tid_list(ahd, tid_prev, tid_head, tid_next); if (!SCBID_IS_NULL(tid_head)) @@ -7428,6 +7555,8 @@ ahd_search_qinfifo(struct ahd_softc *ahd, int target, char channel, if (action == SEARCH_PRINT) printf(")\n"); } + + /* Restore saved state. */ ahd_set_scbptr(ahd, savedscbptr); ahd_restore_modes(ahd, saved_modes); return (found); @@ -7436,7 +7565,8 @@ ahd_search_qinfifo(struct ahd_softc *ahd, int target, char channel, static int ahd_search_scb_list(struct ahd_softc *ahd, int target, char channel, int lun, u_int tag, role_t role, uint32_t status, - ahd_search_action action, u_int *list_head, u_int tid) + ahd_search_action action, u_int *list_head, + u_int *list_tail, u_int tid) { struct scb *scb; u_int scbid; @@ -7448,6 +7578,7 @@ ahd_search_scb_list(struct ahd_softc *ahd, int target, char channel, found = 0; prev = SCB_LIST_NULL; next = *list_head; + *list_tail = SCB_LIST_NULL; for (scbid = next; !SCBID_IS_NULL(scbid); scbid = next) { if (scbid >= ahd->scb_data.numscbs) { printf("%s:SCB List inconsistency. " @@ -7463,6 +7594,7 @@ ahd_search_scb_list(struct ahd_softc *ahd, int target, char channel, panic("Waiting List traversal\n"); } ahd_set_scbptr(ahd, scbid); + *list_tail = scbid; next = ahd_inw_scbram(ahd, SCB_NEXT); if (ahd_match_scb(ahd, scb, target, channel, lun, SCB_LIST_NULL, role) == 0) { @@ -7472,24 +7604,14 @@ ahd_search_scb_list(struct ahd_softc *ahd, int target, char channel, found++; switch (action) { case SEARCH_COMPLETE: - { - cam_status ostat; - cam_status cstat; - - ostat = ahd_get_transaction_status(scb); - if (ostat == CAM_REQ_INPROG) - ahd_set_transaction_status(scb, status); - cstat = ahd_get_transaction_status(scb); - if (cstat != CAM_REQ_CMP) - ahd_freeze_scb(scb); if ((scb->flags & SCB_ACTIVE) == 0) printf("Inactive SCB in Waiting List\n"); - ahd_done(ahd, scb); + ahd_done_with_status(ahd, scb, status); /* FALLTHROUGH */ - } case SEARCH_REMOVE: ahd_rem_wscb(ahd, scbid, prev, next, tid); - if (prev == SCB_LIST_NULL) + *list_tail = prev; + if (SCBID_IS_NULL(prev)) *list_head = next; break; case SEARCH_PRINT: @@ -7558,14 +7680,17 @@ ahd_rem_wscb(struct ahd_softc *ahd, u_int scbid, } /* - * SCBs that had MK_MESSAGE set in them will not - * be queued to the per-target lists, so don't - * blindly clear the tail pointer. + * SCBs that have MK_MESSAGE set in them may + * cause the tail pointer to be updated without + * setting the next pointer of the previous tail. + * Only clear the tail if the removed SCB was + * the tail. */ tail_offset = WAITING_SCB_TAILS + (2 * tid); if (SCBID_IS_NULL(next) && ahd_inw(ahd, tail_offset) == scbid) ahd_outw(ahd, tail_offset, prev); + ahd_add_scb_to_free_list(ahd, scbid); return (next); } @@ -8148,11 +8273,6 @@ ahd_handle_scsi_status(struct ahd_softc *ahd, struct scb *scb) ahd_setup_data_scb(ahd, scb); scb->flags |= SCB_SENSE; ahd_queue_scb(ahd, scb); - /* - * Ensure we have enough time to actually - * retrieve the sense. - */ - ahd_scb_timer_reset(scb, 5 * 1000000); break; } case SCSI_STATUS_OK: @@ -8793,6 +8913,9 @@ ahd_dump_card_state(struct ahd_softc *ahd) * Mode independent registers. */ cur_col = 0; + ahd_intstat_print(ahd_inb(ahd, INTSTAT), &cur_col, 50); + ahd_seloid_print(ahd_inb(ahd, SELOID), &cur_col, 50); + ahd_selid_print(ahd_inb(ahd, SELID), &cur_col, 50); ahd_hs_mailbox_print(ahd_inb(ahd, LOCAL_HS_MAILBOX), &cur_col, 50); ahd_intctl_print(ahd_inb(ahd, INTCTL), &cur_col, 50); ahd_seqintstat_print(ahd_inb(ahd, SEQINTSTAT), &cur_col, 50); @@ -8808,6 +8931,12 @@ ahd_dump_card_state(struct ahd_softc *ahd) ahd_seqintctl_print(ahd_inb(ahd, SEQINTCTL), &cur_col, 50); ahd_seq_flags_print(ahd_inb(ahd, SEQ_FLAGS), &cur_col, 50); ahd_seq_flags2_print(ahd_inb(ahd, SEQ_FLAGS2), &cur_col, 50); + ahd_qfreeze_count_print(ahd_inw(ahd, QFREEZE_COUNT), &cur_col, 50); + ahd_kernel_qfreeze_count_print(ahd_inw(ahd, KERNEL_QFREEZE_COUNT), + &cur_col, 50); + ahd_mk_message_scb_print(ahd_inw(ahd, MK_MESSAGE_SCB), &cur_col, 50); + ahd_mk_message_scsiid_print(ahd_inb(ahd, MK_MESSAGE_SCSIID), + &cur_col, 50); ahd_sstat0_print(ahd_inb(ahd, SSTAT0), &cur_col, 50); ahd_sstat1_print(ahd_inb(ahd, SSTAT1), &cur_col, 50); ahd_sstat2_print(ahd_inb(ahd, SSTAT2), &cur_col, 50); @@ -8915,7 +9044,7 @@ ahd_dump_card_state(struct ahd_softc *ahd) ahd_set_modes(ahd, AHD_MODE_DFF0 + i, AHD_MODE_DFF0 + i); fifo_scbptr = ahd_get_scbptr(ahd); - printf("\n%s: FIFO%d %s, LONGJMP == 0x%x, SCB 0x%x\n", + printf("\n\n%s: FIFO%d %s, LONGJMP == 0x%x, SCB 0x%x\n", ahd_name(ahd), i, (dffstat & (FIFO0FREE << i)) ? "Free" : "Active", ahd_inw(ahd, LONGJMP_ADDR), fifo_scbptr); @@ -8970,6 +9099,9 @@ ahd_dump_card_state(struct ahd_softc *ahd) printf("%s: OS_SPACE_CNT = 0x%x MAXCMDCNT = 0x%x\n", ahd_name(ahd), ahd_inb(ahd, OS_SPACE_CNT), ahd_inb(ahd, MAXCMDCNT)); + printf("%s: SAVED_SCSIID = 0x%x SAVED_LUN = 0x%x\n", + ahd_name(ahd), ahd_inb(ahd, SAVED_SCSIID), + ahd_inb(ahd, SAVED_LUN)); ahd_simode0_print(ahd_inb(ahd, SIMODE0), &cur_col, 50); printf("\n"); ahd_set_modes(ahd, AHD_MODE_CCHAN, AHD_MODE_CCHAN); diff --git a/drivers/scsi/aic7xxx/aic79xx_inline.h b/drivers/scsi/aic7xxx/aic79xx_inline.h index 91c4f7f484b..8ad3ce945b9 100644 --- a/drivers/scsi/aic7xxx/aic79xx_inline.h +++ b/drivers/scsi/aic7xxx/aic79xx_inline.h @@ -37,7 +37,7 @@ * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGES. * - * $Id: //depot/aic7xxx/aic7xxx/aic79xx_inline.h#58 $ + * $Id: //depot/aic7xxx/aic7xxx/aic79xx_inline.h#59 $ * * $FreeBSD$ */ @@ -804,9 +804,10 @@ ahd_queue_scb(struct ahd_softc *ahd, struct scb *scb) uint64_t host_dataptr; host_dataptr = ahd_le64toh(scb->hscb->dataptr); - printf("%s: Queueing SCB 0x%x bus addr 0x%x - 0x%x%x/0x%x\n", + printf("%s: Queueing SCB %d:0x%x bus addr 0x%x - 0x%x%x/0x%x\n", ahd_name(ahd), - SCB_GET_TAG(scb), ahd_le32toh(scb->hscb->hscb_busaddr), + SCB_GET_TAG(scb), scb->hscb->scsiid, + ahd_le32toh(scb->hscb->hscb_busaddr), (u_int)((host_dataptr >> 32) & 0xFFFFFFFF), (u_int)(host_dataptr & 0xFFFFFFFF), ahd_le32toh(scb->hscb->datacnt)); diff --git a/drivers/scsi/aic7xxx/aic79xx_osm.c b/drivers/scsi/aic7xxx/aic79xx_osm.c index 2567e29960b..7254ea535a1 100644 --- a/drivers/scsi/aic7xxx/aic79xx_osm.c +++ b/drivers/scsi/aic7xxx/aic79xx_osm.c @@ -314,6 +314,21 @@ static uint32_t aic79xx_seltime; */ uint32_t aic79xx_periodic_otag; +/* Some storage boxes are using an LSI chip which has a bug making it + * impossible to use aic79xx Rev B chip in 320 speeds. The following + * storage boxes have been reported to be buggy: + * EonStor 3U 16-Bay: U16U-G3A3 + * EonStor 2U 12-Bay: U12U-G3A3 + * SentinelRAID: 2500F R5 / R6 + * SentinelRAID: 2500F R1 + * SentinelRAID: 2500F/1500F + * SentinelRAID: 150F + * + * To get around this LSI bug, you can set your board to 160 mode + * or you can enable the SLOWCRC bit. + */ +uint32_t aic79xx_slowcrc; + /* * Module information and settable options. */ @@ -343,6 +358,7 @@ MODULE_PARM_DESC(aic79xx, " amplitude:<int> Set the signal amplitude (0-7).\n" " seltime:<int> Selection Timeout:\n" " (0/256ms,1/128ms,2/64ms,3/32ms)\n" +" slowcrc Turn on the SLOWCRC bit (Rev B only)\n" "\n" " Sample /etc/modprobe.conf line:\n" " Enable verbose logging\n" @@ -1003,6 +1019,7 @@ aic79xx_setup(char *s) { "slewrate", NULL }, { "precomp", NULL }, { "amplitude", NULL }, + { "slowcrc", &aic79xx_slowcrc }, }; end = strchr(s, '\0'); @@ -1072,7 +1089,6 @@ ahd_linux_register_host(struct ahd_softc *ahd, struct scsi_host_template *templa return (ENOMEM); *((struct ahd_softc **)host->hostdata) = ahd; - ahd_lock(ahd, &s); ahd->platform_data->host = host; host->can_queue = AHD_MAX_QUEUE; host->cmd_per_lun = 2; @@ -1083,7 +1099,9 @@ ahd_linux_register_host(struct ahd_softc *ahd, struct scsi_host_template *templa host->max_lun = AHD_NUM_LUNS; host->max_channel = 0; host->sg_tablesize = AHD_NSEG; + ahd_lock(ahd, &s); ahd_set_unit(ahd, ahd_linux_unit++); + ahd_unlock(ahd, &s); sprintf(buf, "scsi%d", host->host_no); new_name = malloc(strlen(buf) + 1, M_DEVBUF, M_NOWAIT); if (new_name != NULL) { @@ -1093,7 +1111,6 @@ ahd_linux_register_host(struct ahd_softc *ahd, struct scsi_host_template *templa host->unique_id = ahd->unit; ahd_linux_initialize_scsi_bus(ahd); ahd_intr_enable(ahd, TRUE); - ahd_unlock(ahd, &s); host->transportt = ahd_linux_transport_template; @@ -1127,6 +1144,7 @@ ahd_linux_initialize_scsi_bus(struct ahd_softc *ahd) { u_int target_id; u_int numtarg; + unsigned long s; target_id = 0; numtarg = 0; @@ -1139,6 +1157,8 @@ ahd_linux_initialize_scsi_bus(struct ahd_softc *ahd) else numtarg = (ahd->features & AHD_WIDE) ? 16 : 8; + ahd_lock(ahd, &s); + /* * Force negotiation to async for all targets that * will not see an initial bus reset. @@ -1155,16 +1175,12 @@ ahd_linux_initialize_scsi_bus(struct ahd_softc *ahd) ahd_update_neg_request(ahd, &devinfo, tstate, tinfo, AHD_NEG_ALWAYS); } + ahd_unlock(ahd, &s); /* Give the bus some time to recover */ if ((ahd->flags & AHD_RESET_BUS_A) != 0) { ahd_freeze_simq(ahd); - init_timer(&ahd->platform_data->reset_timer); - ahd->platform_data->reset_timer.data = (u_long)ahd; - ahd->platform_data->reset_timer.expires = - jiffies + (AIC79XX_RESET_DELAY * HZ)/1000; - ahd->platform_data->reset_timer.function = - (ahd_linux_callback_t *)ahd_release_simq; - add_timer(&ahd->platform_data->reset_timer); + msleep(AIC79XX_RESET_DELAY); + ahd_release_simq(ahd); } } @@ -2033,6 +2049,9 @@ ahd_linux_sem_timeout(u_long arg) void ahd_freeze_simq(struct ahd_softc *ahd) { + unsigned long s; + + ahd_lock(ahd, &s); ahd->platform_data->qfrozen++; if (ahd->platform_data->qfrozen == 1) { scsi_block_requests(ahd->platform_data->host); @@ -2040,6 +2059,7 @@ ahd_freeze_simq(struct ahd_softc *ahd) CAM_LUN_WILDCARD, SCB_LIST_NULL, ROLE_INITIATOR, CAM_REQUEUE_REQ); } + ahd_unlock(ahd, &s); } void @@ -2344,8 +2364,9 @@ done: ahd_name(ahd), dev->active); retval = FAILED; } - } - ahd_unlock(ahd, &flags); + } else + ahd_unlock(ahd, &flags); + return (retval); } diff --git a/drivers/scsi/aic7xxx/aic79xx_osm.h b/drivers/scsi/aic7xxx/aic79xx_osm.h index cb74fccc810..9cb10134510 100644 --- a/drivers/scsi/aic7xxx/aic79xx_osm.h +++ b/drivers/scsi/aic7xxx/aic79xx_osm.h @@ -36,7 +36,7 @@ * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGES. * - * $Id: //depot/aic7xxx/linux/drivers/scsi/aic7xxx/aic79xx_osm.h#137 $ + * $Id: //depot/aic7xxx/linux/drivers/scsi/aic7xxx/aic79xx_osm.h#166 $ * */ #ifndef _AIC79XX_LINUX_H_ @@ -228,7 +228,6 @@ typedef struct timer_list ahd_timer_t; typedef void ahd_linux_callback_t (u_long); static __inline void ahd_timer_reset(ahd_timer_t *timer, int usec, ahd_callback_t *func, void *arg); -static __inline void ahd_scb_timer_reset(struct scb *scb, u_int usec); static __inline void ahd_timer_reset(ahd_timer_t *timer, int usec, ahd_callback_t *func, void *arg) @@ -243,12 +242,6 @@ ahd_timer_reset(ahd_timer_t *timer, int usec, ahd_callback_t *func, void *arg) add_timer(timer); } -static __inline void -ahd_scb_timer_reset(struct scb *scb, u_int usec) -{ - mod_timer(&scb->io_ctx->eh_timeout, jiffies + (usec * HZ)/1000000); -} - /***************************** SMP support ************************************/ #include <linux/spinlock.h> @@ -389,7 +382,6 @@ struct ahd_platform_data { spinlock_t spin_lock; u_int qfrozen; - struct timer_list reset_timer; struct semaphore eh_sem; struct Scsi_Host *host; /* pointer to scsi host */ #define AHD_LINUX_NOIRQ ((uint32_t)~0) diff --git a/drivers/scsi/aic7xxx/aic79xx_osm_pci.c b/drivers/scsi/aic7xxx/aic79xx_osm_pci.c index bf360ae021a..ebbf7e4ff4c 100644 --- a/drivers/scsi/aic7xxx/aic79xx_osm_pci.c +++ b/drivers/scsi/aic7xxx/aic79xx_osm_pci.c @@ -220,10 +220,10 @@ ahd_linux_pci_reserve_io_regions(struct ahd_softc *ahd, u_long *base, *base2 = pci_resource_start(ahd->dev_softc, 3); if (*base == 0 || *base2 == 0) return (ENOMEM); - if (request_region(*base, 256, "aic79xx") == 0) + if (!request_region(*base, 256, "aic79xx")) return (ENOMEM); - if (request_region(*base2, 256, "aic79xx") == 0) { - release_region(*base2, 256); + if (!request_region(*base2, 256, "aic79xx")) { + release_region(*base, 256); return (ENOMEM); } return (0); @@ -237,7 +237,7 @@ ahd_linux_pci_reserve_mem_region(struct ahd_softc *ahd, u_long start; u_long base_page; u_long base_offset; - int error; + int error = 0; if (aic79xx_allow_memio == 0) return (ENOMEM); @@ -245,16 +245,15 @@ ahd_linux_pci_reserve_mem_region(struct ahd_softc *ahd, if ((ahd->bugs & AHD_PCIX_MMAPIO_BUG) != 0) return (ENOMEM); - error = 0; start = pci_resource_start(ahd->dev_softc, 1); base_page = start & PAGE_MASK; base_offset = start - base_page; if (start != 0) { *bus_addr = start; - if (request_mem_region(start, 0x1000, "aic79xx") == 0) + if (!request_mem_region(start, 0x1000, "aic79xx")) error = ENOMEM; - if (error == 0) { - *maddr = ioremap_nocache(base_page, base_offset + 256); + if (!error) { + *maddr = ioremap_nocache(base_page, base_offset + 512); if (*maddr == NULL) { error = ENOMEM; release_mem_region(start, 0x1000); @@ -344,7 +343,7 @@ ahd_pci_map_int(struct ahd_softc *ahd) error = request_irq(ahd->dev_softc->irq, ahd_linux_isr, SA_SHIRQ, "aic79xx", ahd); - if (error == 0) + if (!error) ahd->platform_data->irq = ahd->dev_softc->irq; return (-error); diff --git a/drivers/scsi/aic7xxx/aic79xx_pci.c b/drivers/scsi/aic7xxx/aic79xx_pci.c index 196a6344b03..757242e522c 100644 --- a/drivers/scsi/aic7xxx/aic79xx_pci.c +++ b/drivers/scsi/aic7xxx/aic79xx_pci.c @@ -38,7 +38,7 @@ * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGES. * - * $Id: //depot/aic7xxx/aic7xxx/aic79xx_pci.c#89 $ + * $Id: //depot/aic7xxx/aic7xxx/aic79xx_pci.c#92 $ */ #ifdef __linux__ @@ -950,12 +950,19 @@ ahd_aic790X_setup(struct ahd_softc *ahd) if ((ahd->flags & AHD_HP_BOARD) == 0) AHD_SET_SLEWRATE(ahd, AHD_SLEWRATE_DEF_REVA); } else { + /* This is revision B and newer. */ + extern uint32_t aic79xx_slowcrc; u_int devconfig1; ahd->features |= AHD_RTI|AHD_NEW_IOCELL_OPTS - | AHD_NEW_DFCNTRL_OPTS|AHD_FAST_CDB_DELIVERY; + | AHD_NEW_DFCNTRL_OPTS|AHD_FAST_CDB_DELIVERY + | AHD_BUSFREEREV_BUG; ahd->bugs |= AHD_LQOOVERRUN_BUG|AHD_EARLY_REQ_BUG; + /* If the user requested the the SLOWCRC bit to be set. */ + if (aic79xx_slowcrc) + ahd->features |= AHD_AIC79XXB_SLOWCRC; + /* * Some issues have been resolved in the 7901B. */ diff --git a/drivers/scsi/aic7xxx/aic79xx_reg.h_shipped b/drivers/scsi/aic7xxx/aic79xx_reg.h_shipped index 8763b158856..2068e00d2c7 100644 --- a/drivers/scsi/aic7xxx/aic79xx_reg.h_shipped +++ b/drivers/scsi/aic7xxx/aic79xx_reg.h_shipped @@ -2,8 +2,8 @@ * DO NOT EDIT - This file is automatically generated * from the following source files: * - * $Id: //depot/aic7xxx/aic7xxx/aic79xx.seq#119 $ - * $Id: //depot/aic7xxx/aic7xxx/aic79xx.reg#76 $ + * $Id: //depot/aic7xxx/aic7xxx/aic79xx.seq#120 $ + * $Id: //depot/aic7xxx/aic7xxx/aic79xx.reg#77 $ */ typedef int (ahd_reg_print_t)(u_int, u_int *, u_int); typedef struct ahd_reg_parse_entry { @@ -2204,6 +2204,20 @@ ahd_reg_print_t ahd_cmdsize_table_print; #endif #if AIC_DEBUG_REGISTERS +ahd_reg_print_t ahd_mk_message_scb_print; +#else +#define ahd_mk_message_scb_print(regvalue, cur_col, wrap) \ + ahd_print_register(NULL, 0, "MK_MESSAGE_SCB", 0x160, regvalue, cur_col, wrap) +#endif + +#if AIC_DEBUG_REGISTERS +ahd_reg_print_t ahd_mk_message_scsiid_print; +#else +#define ahd_mk_message_scsiid_print(regvalue, cur_col, wrap) \ + ahd_print_register(NULL, 0, "MK_MESSAGE_SCSIID", 0x162, regvalue, cur_col, wrap) +#endif + +#if AIC_DEBUG_REGISTERS ahd_reg_print_t ahd_scb_base_print; #else #define ahd_scb_base_print(regvalue, cur_col, wrap) \ @@ -3638,6 +3652,7 @@ ahd_reg_print_t ahd_scb_disconnected_lists_print; #define SEQ_FLAGS2 0x14d #define SELECTOUT_QFROZEN 0x04 #define TARGET_MSG_PENDING 0x02 +#define PENDING_MK_MESSAGE 0x01 #define ALLOCFIFO_SCBPTR 0x14e @@ -3655,6 +3670,10 @@ ahd_reg_print_t ahd_scb_disconnected_lists_print; #define CMDSIZE_TABLE 0x158 +#define MK_MESSAGE_SCB 0x160 + +#define MK_MESSAGE_SCSIID 0x162 + #define SCB_BASE 0x180 #define SCB_RESIDUAL_DATACNT 0x180 @@ -3800,5 +3819,5 @@ ahd_reg_print_t ahd_scb_disconnected_lists_print; /* Exported Labels */ -#define LABEL_seq_isr 0x285 -#define LABEL_timer_isr 0x281 +#define LABEL_seq_isr 0x28f +#define LABEL_timer_isr 0x28b diff --git a/drivers/scsi/aic7xxx/aic79xx_reg_print.c_shipped b/drivers/scsi/aic7xxx/aic79xx_reg_print.c_shipped index a4137c98537..db38a61a8cb 100644 --- a/drivers/scsi/aic7xxx/aic79xx_reg_print.c_shipped +++ b/drivers/scsi/aic7xxx/aic79xx_reg_print.c_shipped @@ -2,8 +2,8 @@ * DO NOT EDIT - This file is automatically generated * from the following source files: * - * $Id: //depot/aic7xxx/aic7xxx/aic79xx.seq#118 $ - * $Id: //depot/aic7xxx/aic7xxx/aic79xx.reg#75 $ + * $Id: //depot/aic7xxx/aic7xxx/aic79xx.seq#120 $ + * $Id: //depot/aic7xxx/aic7xxx/aic79xx.reg#77 $ */ #include "aic79xx_osm.h" @@ -3382,6 +3382,7 @@ ahd_initiator_tag_print(u_int regvalue, u_int *cur_col, u_int wrap) } static ahd_reg_parse_entry_t SEQ_FLAGS2_parse_table[] = { + { "PENDING_MK_MESSAGE", 0x01, 0x01 }, { "TARGET_MSG_PENDING", 0x02, 0x02 }, { "SELECTOUT_QFROZEN", 0x04, 0x04 } }; @@ -3389,7 +3390,7 @@ static ahd_reg_parse_entry_t SEQ_FLAGS2_parse_table[] = { int ahd_seq_flags2_print(u_int regvalue, u_int *cur_col, u_int wrap) { - return (ahd_print_register(SEQ_FLAGS2_parse_table, 2, "SEQ_FLAGS2", + return (ahd_print_register(SEQ_FLAGS2_parse_table, 3, "SEQ_FLAGS2", 0x14d, regvalue, cur_col, wrap)); } @@ -3450,6 +3451,20 @@ ahd_cmdsize_table_print(u_int regvalue, u_int *cur_col, u_int wrap) } int +ahd_mk_message_scb_print(u_int regvalue, u_int *cur_col, u_int wrap) +{ + return (ahd_print_register(NULL, 0, "MK_MESSAGE_SCB", + 0x160, regvalue, cur_col, wrap)); +} + +int +ahd_mk_message_scsiid_print(u_int regvalue, u_int *cur_col, u_int wrap) +{ + return (ahd_print_register(NULL, 0, "MK_MESSAGE_SCSIID", + 0x162, regvalue, cur_col, wrap)); +} + +int ahd_scb_base_print(u_int regvalue, u_int *cur_col, u_int wrap) { return (ahd_print_register(NULL, 0, "SCB_BASE", diff --git a/drivers/scsi/aic7xxx/aic79xx_seq.h_shipped b/drivers/scsi/aic7xxx/aic79xx_seq.h_shipped index b1e5365be23..11bed07e90b 100644 --- a/drivers/scsi/aic7xxx/aic79xx_seq.h_shipped +++ b/drivers/scsi/aic7xxx/aic79xx_seq.h_shipped @@ -2,17 +2,17 @@ * DO NOT EDIT - This file is automatically generated * from the following source files: * - * $Id: //depot/aic7xxx/aic7xxx/aic79xx.seq#119 $ - * $Id: //depot/aic7xxx/aic7xxx/aic79xx.reg#76 $ + * $Id: //depot/aic7xxx/aic7xxx/aic79xx.seq#120 $ + * $Id: //depot/aic7xxx/aic7xxx/aic79xx.reg#77 $ */ static uint8_t seqprog[] = { 0xff, 0x02, 0x06, 0x78, - 0x00, 0xea, 0x64, 0x59, + 0x00, 0xea, 0x6e, 0x59, 0x01, 0xea, 0x04, 0x30, 0xff, 0x04, 0x0c, 0x78, - 0x19, 0xea, 0x64, 0x59, + 0x19, 0xea, 0x6e, 0x59, 0x19, 0xea, 0x04, 0x00, - 0x33, 0xea, 0x5e, 0x59, + 0x33, 0xea, 0x68, 0x59, 0x33, 0xea, 0x00, 0x00, 0x60, 0x3a, 0x3a, 0x68, 0x04, 0x4d, 0x35, 0x78, @@ -33,15 +33,15 @@ static uint8_t seqprog[] = { 0xff, 0xea, 0x62, 0x02, 0x00, 0xe2, 0x3a, 0x40, 0xff, 0x21, 0x3b, 0x70, - 0x40, 0x4b, 0xaa, 0x69, - 0x00, 0xe2, 0x68, 0x59, - 0x40, 0x4b, 0xaa, 0x69, - 0x20, 0x4b, 0x96, 0x69, + 0x40, 0x4b, 0xb4, 0x69, + 0x00, 0xe2, 0x72, 0x59, + 0x40, 0x4b, 0xb4, 0x69, + 0x20, 0x4b, 0xa0, 0x69, 0xfc, 0x42, 0x44, 0x78, 0x10, 0x40, 0x44, 0x78, - 0x00, 0xe2, 0xfc, 0x5d, + 0x00, 0xe2, 0x10, 0x5e, 0x20, 0x4d, 0x48, 0x78, - 0x00, 0xe2, 0xfc, 0x5d, + 0x00, 0xe2, 0x10, 0x5e, 0x30, 0x3f, 0xc0, 0x09, 0x30, 0xe0, 0x50, 0x60, 0x7f, 0x4a, 0x94, 0x08, @@ -51,7 +51,7 @@ static uint8_t seqprog[] = { 0x00, 0xe2, 0x76, 0x58, 0x00, 0xe2, 0x86, 0x58, 0x00, 0xe2, 0x06, 0x40, - 0x33, 0xea, 0x5e, 0x59, + 0x33, 0xea, 0x68, 0x59, 0x33, 0xea, 0x00, 0x00, 0x01, 0x52, 0x84, 0x78, 0x02, 0x58, 0x50, 0x31, @@ -59,26 +59,26 @@ static uint8_t seqprog[] = { 0xff, 0x97, 0x6f, 0x78, 0x50, 0x4b, 0x6a, 0x68, 0xbf, 0x3a, 0x74, 0x08, - 0x14, 0xea, 0x64, 0x59, + 0x14, 0xea, 0x6e, 0x59, 0x14, 0xea, 0x04, 0x00, 0x08, 0x92, 0x25, 0x03, 0xff, 0x90, 0x5f, 0x68, - 0x00, 0xe2, 0x76, 0x5b, + 0x00, 0xe2, 0x8a, 0x5b, 0x00, 0xe2, 0x5e, 0x40, - 0x00, 0xea, 0x5e, 0x59, + 0x00, 0xea, 0x68, 0x59, 0x01, 0xea, 0x00, 0x30, 0x80, 0xf9, 0x7e, 0x68, - 0x00, 0xe2, 0x5c, 0x59, - 0x11, 0xea, 0x5e, 0x59, + 0x00, 0xe2, 0x66, 0x59, + 0x11, 0xea, 0x68, 0x59, 0x11, 0xea, 0x00, 0x00, - 0x80, 0xf9, 0x5c, 0x79, + 0x80, 0xf9, 0x66, 0x79, 0xff, 0xea, 0xd4, 0x0d, - 0x22, 0xea, 0x5e, 0x59, + 0x22, 0xea, 0x68, 0x59, 0x22, 0xea, 0x00, 0x00, 0x10, 0x16, 0x90, 0x78, 0x10, 0x16, 0x2c, 0x00, 0x01, 0x0b, 0xae, 0x32, - 0x18, 0xad, 0x12, 0x79, + 0x18, 0xad, 0x1c, 0x79, 0x04, 0xad, 0xdc, 0x68, 0x80, 0xad, 0x84, 0x78, 0x10, 0xad, 0xaa, 0x78, @@ -118,7 +118,6 @@ static uint8_t seqprog[] = { 0x80, 0x18, 0x30, 0x04, 0x40, 0xad, 0x84, 0x78, 0xe7, 0xad, 0x5a, 0x09, - 0x02, 0xa8, 0x40, 0x31, 0xff, 0xea, 0xc0, 0x09, 0x01, 0x54, 0xa9, 0x1a, 0x00, 0x55, 0xab, 0x22, @@ -128,24 +127,30 @@ static uint8_t seqprog[] = { 0xff, 0xea, 0x5a, 0x03, 0xff, 0xea, 0x5e, 0x03, 0x01, 0x10, 0xd4, 0x31, - 0x10, 0x92, 0x07, 0x69, + 0x02, 0xa8, 0x40, 0x31, + 0x01, 0x92, 0xc1, 0x31, 0x3d, 0x93, 0xc5, 0x29, 0xfe, 0xe2, 0xc4, 0x09, 0x01, 0xea, 0xc6, 0x01, 0x02, 0xe2, 0xc8, 0x31, 0x02, 0xec, 0x50, 0x31, 0x02, 0xa0, 0xda, 0x31, - 0xff, 0xa9, 0x06, 0x71, + 0xff, 0xa9, 0x10, 0x71, + 0x10, 0xe0, 0x0e, 0x79, + 0x10, 0x92, 0x0f, 0x79, + 0x01, 0x4d, 0x9b, 0x02, + 0x02, 0xa0, 0xc0, 0x32, + 0x01, 0x93, 0xc5, 0x36, 0x02, 0xa0, 0x58, 0x37, - 0xff, 0x21, 0x0f, 0x71, + 0xff, 0x21, 0x19, 0x71, 0x02, 0x22, 0x51, 0x31, 0x02, 0xa0, 0x5c, 0x33, 0x02, 0xa0, 0x44, 0x36, 0x02, 0xa0, 0x40, 0x32, 0x02, 0xa0, 0x44, 0x36, - 0x04, 0x4d, 0x17, 0x69, - 0x40, 0x16, 0x48, 0x69, - 0xff, 0x2d, 0x4d, 0x61, + 0x05, 0x4d, 0x21, 0x69, + 0x40, 0x16, 0x52, 0x69, + 0xff, 0x2d, 0x57, 0x61, 0xff, 0x29, 0x85, 0x70, 0x02, 0x28, 0x55, 0x32, 0x01, 0xea, 0x5a, 0x01, @@ -159,22 +164,22 @@ static uint8_t seqprog[] = { 0x01, 0x56, 0xad, 0x1a, 0xff, 0x54, 0xa9, 0x1a, 0xff, 0x55, 0xab, 0x22, - 0xff, 0x8d, 0x41, 0x71, - 0x80, 0xac, 0x40, 0x71, - 0x20, 0x16, 0x40, 0x69, + 0xff, 0x8d, 0x4b, 0x71, + 0x80, 0xac, 0x4a, 0x71, + 0x20, 0x16, 0x4a, 0x69, 0x00, 0xac, 0xc4, 0x19, - 0x07, 0xe2, 0x40, 0xf9, + 0x07, 0xe2, 0x4a, 0xf9, 0x02, 0x8c, 0x51, 0x31, - 0x00, 0xe2, 0x24, 0x41, + 0x00, 0xe2, 0x2e, 0x41, 0x01, 0xac, 0x08, 0x31, 0x09, 0xea, 0x5a, 0x01, 0x02, 0x8c, 0x51, 0x32, 0xff, 0xea, 0x1a, 0x07, 0x04, 0x24, 0xf9, 0x30, - 0x1d, 0xea, 0x52, 0x41, + 0x1d, 0xea, 0x5c, 0x41, 0x02, 0x2c, 0x51, 0x31, 0x04, 0xa8, 0xf9, 0x30, - 0x19, 0xea, 0x52, 0x41, + 0x19, 0xea, 0x5c, 0x41, 0x06, 0xea, 0x08, 0x81, 0x01, 0xe2, 0x5a, 0x35, 0x02, 0xf2, 0xf0, 0x31, @@ -190,27 +195,27 @@ static uint8_t seqprog[] = { 0x02, 0x20, 0xb9, 0x30, 0x02, 0x20, 0x51, 0x31, 0x4c, 0x93, 0xd7, 0x28, - 0x10, 0x92, 0x77, 0x79, + 0x10, 0x92, 0x81, 0x79, 0x01, 0x6b, 0xc0, 0x30, 0x02, 0x64, 0xc8, 0x00, 0x40, 0x3a, 0x74, 0x04, 0x00, 0xe2, 0x76, 0x58, - 0x33, 0xea, 0x5e, 0x59, + 0x33, 0xea, 0x68, 0x59, 0x33, 0xea, 0x00, 0x00, 0x30, 0x3f, 0xc0, 0x09, - 0x30, 0xe0, 0x78, 0x61, - 0x20, 0x3f, 0x8e, 0x69, - 0x10, 0x3f, 0x78, 0x79, + 0x30, 0xe0, 0x82, 0x61, + 0x20, 0x3f, 0x98, 0x69, + 0x10, 0x3f, 0x82, 0x79, 0x02, 0xea, 0x7e, 0x00, - 0x00, 0xea, 0x5e, 0x59, + 0x00, 0xea, 0x68, 0x59, 0x01, 0xea, 0x00, 0x30, 0x02, 0x4e, 0x51, 0x35, 0x01, 0xea, 0x7e, 0x00, - 0x11, 0xea, 0x5e, 0x59, + 0x11, 0xea, 0x68, 0x59, 0x11, 0xea, 0x00, 0x00, 0x02, 0x4e, 0x51, 0x35, 0xc0, 0x4a, 0x94, 0x00, - 0x04, 0x41, 0x9c, 0x79, + 0x04, 0x41, 0xa6, 0x79, 0x08, 0xea, 0x98, 0x00, 0x08, 0x57, 0xae, 0x00, 0x08, 0x3c, 0x78, 0x00, @@ -218,12 +223,12 @@ static uint8_t seqprog[] = { 0x0f, 0x67, 0xc0, 0x09, 0x00, 0x3a, 0x75, 0x02, 0x20, 0xea, 0x96, 0x00, - 0x00, 0xe2, 0x14, 0x42, + 0x00, 0xe2, 0x28, 0x42, 0xc0, 0x4a, 0x94, 0x00, - 0x40, 0x3a, 0xc8, 0x69, + 0x40, 0x3a, 0xd2, 0x69, 0x02, 0x55, 0x06, 0x68, - 0x02, 0x56, 0xc8, 0x69, - 0xff, 0x5b, 0xc8, 0x61, + 0x02, 0x56, 0xd2, 0x69, + 0xff, 0x5b, 0xd2, 0x61, 0x02, 0x20, 0x51, 0x31, 0x80, 0xea, 0xb2, 0x01, 0x44, 0xea, 0x00, 0x00, @@ -231,40 +236,45 @@ static uint8_t seqprog[] = { 0x33, 0xea, 0x00, 0x00, 0xff, 0xea, 0xb2, 0x09, 0xff, 0xe0, 0xc0, 0x19, - 0xff, 0xe0, 0xca, 0x79, + 0xff, 0xe0, 0xd4, 0x79, 0x02, 0xac, 0x51, 0x31, - 0x00, 0xe2, 0xc0, 0x41, + 0x00, 0xe2, 0xca, 0x41, 0x02, 0x5e, 0x50, 0x31, 0x02, 0xa8, 0xb8, 0x30, 0x02, 0x5c, 0x50, 0x31, - 0xff, 0xad, 0xdb, 0x71, + 0xff, 0xad, 0xe5, 0x71, 0x02, 0xac, 0x41, 0x31, 0x02, 0x22, 0x51, 0x31, 0x02, 0xa0, 0x5c, 0x33, 0x02, 0xa0, 0x44, 0x32, - 0x00, 0xe2, 0xe4, 0x41, - 0x10, 0x92, 0xe5, 0x69, + 0x00, 0xe2, 0xf8, 0x41, + 0x01, 0x4d, 0xf1, 0x79, + 0x01, 0x62, 0xc1, 0x31, + 0x00, 0x93, 0xf1, 0x61, + 0xfe, 0x4d, 0x9b, 0x0a, + 0x02, 0x60, 0x41, 0x31, + 0x00, 0xe2, 0xdc, 0x41, 0x3d, 0x93, 0xc9, 0x29, 0x01, 0xe4, 0xc8, 0x01, 0x01, 0xea, 0xca, 0x01, 0xff, 0xea, 0xda, 0x01, 0x02, 0x20, 0x51, 0x31, 0x02, 0xae, 0x41, 0x32, - 0xff, 0x21, 0xed, 0x61, + 0xff, 0x21, 0x01, 0x62, 0xff, 0xea, 0x46, 0x02, 0x02, 0x5c, 0x50, 0x31, 0x40, 0xea, 0x96, 0x00, - 0x02, 0x56, 0x04, 0x6e, - 0x01, 0x55, 0x04, 0x6e, - 0x10, 0x92, 0xf9, 0x79, - 0x10, 0x40, 0x02, 0x6a, - 0x01, 0x56, 0x02, 0x7a, + 0x02, 0x56, 0x20, 0x6e, + 0x01, 0x55, 0x20, 0x6e, + 0x10, 0x92, 0x0d, 0x7a, + 0x10, 0x40, 0x16, 0x6a, + 0x01, 0x56, 0x16, 0x7a, 0xff, 0x97, 0x07, 0x78, - 0x13, 0xea, 0x64, 0x59, + 0x13, 0xea, 0x6e, 0x59, 0x13, 0xea, 0x04, 0x00, 0x00, 0xe2, 0x06, 0x40, 0xbf, 0x3a, 0x74, 0x08, - 0x04, 0x41, 0x08, 0x7a, + 0x04, 0x41, 0x1c, 0x7a, 0x08, 0xea, 0x98, 0x00, 0x08, 0x57, 0xae, 0x00, 0x01, 0x93, 0x75, 0x32, @@ -272,108 +282,108 @@ static uint8_t seqprog[] = { 0x40, 0xea, 0x72, 0x02, 0x08, 0x3c, 0x78, 0x00, 0x80, 0xea, 0x6e, 0x02, - 0x00, 0xe2, 0xe2, 0x5b, + 0x00, 0xe2, 0xf6, 0x5b, 0x01, 0x3c, 0xc1, 0x31, - 0x9f, 0xe0, 0x84, 0x7c, - 0x80, 0xe0, 0x28, 0x72, - 0xa0, 0xe0, 0x64, 0x72, - 0xc0, 0xe0, 0x5a, 0x72, - 0xe0, 0xe0, 0x94, 0x72, - 0x01, 0xea, 0x64, 0x59, + 0x9f, 0xe0, 0x98, 0x7c, + 0x80, 0xe0, 0x3c, 0x72, + 0xa0, 0xe0, 0x78, 0x72, + 0xc0, 0xe0, 0x6e, 0x72, + 0xe0, 0xe0, 0xa8, 0x72, + 0x01, 0xea, 0x6e, 0x59, 0x01, 0xea, 0x04, 0x00, - 0x00, 0xe2, 0x14, 0x42, - 0x80, 0x39, 0x2f, 0x7a, - 0x03, 0xea, 0x64, 0x59, + 0x00, 0xe2, 0x28, 0x42, + 0x80, 0x39, 0x43, 0x7a, + 0x03, 0xea, 0x6e, 0x59, 0x03, 0xea, 0x04, 0x00, - 0xee, 0x00, 0x36, 0x6a, + 0xee, 0x00, 0x4a, 0x6a, 0x05, 0xea, 0xb4, 0x00, - 0x33, 0xea, 0x5e, 0x59, + 0x33, 0xea, 0x68, 0x59, 0x33, 0xea, 0x00, 0x00, 0x02, 0xa8, 0x9c, 0x32, - 0x00, 0xe2, 0x7e, 0x59, + 0x00, 0xe2, 0x88, 0x59, 0xef, 0x96, 0xd5, 0x19, - 0x00, 0xe2, 0x46, 0x52, + 0x00, 0xe2, 0x5a, 0x52, 0x09, 0x80, 0xe1, 0x30, 0x02, 0xea, 0x36, 0x00, 0xa8, 0xea, 0x32, 0x00, - 0x00, 0xe2, 0x4c, 0x42, + 0x00, 0xe2, 0x60, 0x42, 0x01, 0x96, 0xd1, 0x30, 0x10, 0x80, 0x89, 0x31, 0x20, 0xea, 0x32, 0x00, 0xbf, 0x39, 0x73, 0x0a, - 0x10, 0x4c, 0x56, 0x6a, - 0x20, 0x19, 0x4e, 0x6a, - 0x20, 0x19, 0x52, 0x6a, - 0x02, 0x4d, 0x14, 0x6a, + 0x10, 0x4c, 0x6a, 0x6a, + 0x20, 0x19, 0x62, 0x6a, + 0x20, 0x19, 0x66, 0x6a, + 0x02, 0x4d, 0x28, 0x6a, 0x40, 0x39, 0x73, 0x02, - 0x00, 0xe2, 0x14, 0x42, - 0x80, 0x39, 0xd5, 0x6a, + 0x00, 0xe2, 0x28, 0x42, + 0x80, 0x39, 0xe9, 0x6a, 0x01, 0x44, 0x10, 0x33, 0x08, 0x92, 0x25, 0x03, - 0x00, 0xe2, 0x14, 0x42, + 0x00, 0xe2, 0x28, 0x42, 0x10, 0xea, 0x80, 0x00, 0x01, 0x37, 0xc5, 0x31, - 0x80, 0xe2, 0x80, 0x62, - 0x10, 0x92, 0xa5, 0x6a, + 0x80, 0xe2, 0x94, 0x62, + 0x10, 0x92, 0xb9, 0x6a, 0xc0, 0x94, 0xc5, 0x01, - 0x40, 0x92, 0x71, 0x6a, + 0x40, 0x92, 0x85, 0x6a, 0xbf, 0xe2, 0xc4, 0x09, - 0x20, 0x92, 0x85, 0x7a, + 0x20, 0x92, 0x99, 0x7a, 0x01, 0xe2, 0x88, 0x30, - 0x00, 0xe2, 0xe2, 0x5b, - 0xa0, 0x3c, 0x8d, 0x62, + 0x00, 0xe2, 0xf6, 0x5b, + 0xa0, 0x3c, 0xa1, 0x62, 0x23, 0x92, 0x89, 0x08, - 0x00, 0xe2, 0xe2, 0x5b, - 0xa0, 0x3c, 0x8d, 0x62, - 0x00, 0xa8, 0x84, 0x42, - 0xff, 0xe2, 0x84, 0x62, - 0x00, 0xe2, 0xa4, 0x42, + 0x00, 0xe2, 0xf6, 0x5b, + 0xa0, 0x3c, 0xa1, 0x62, + 0x00, 0xa8, 0x98, 0x42, + 0xff, 0xe2, 0x98, 0x62, + 0x00, 0xe2, 0xb8, 0x42, 0x40, 0xea, 0x98, 0x00, 0x01, 0xe2, 0x88, 0x30, - 0x00, 0xe2, 0xe2, 0x5b, - 0xa0, 0x3c, 0x63, 0x72, + 0x00, 0xe2, 0xf6, 0x5b, + 0xa0, 0x3c, 0x77, 0x72, 0x40, 0xea, 0x98, 0x00, 0x01, 0x37, 0x95, 0x32, 0x08, 0xea, 0x6e, 0x02, - 0x00, 0xe2, 0x14, 0x42, - 0xe0, 0xea, 0xfe, 0x5b, - 0x80, 0xe0, 0xe0, 0x6a, - 0x04, 0xe0, 0x92, 0x73, - 0x02, 0xe0, 0xc4, 0x73, - 0x00, 0xea, 0x3e, 0x73, - 0x03, 0xe0, 0xd4, 0x73, - 0x23, 0xe0, 0xb6, 0x72, - 0x08, 0xe0, 0xdc, 0x72, - 0x00, 0xe2, 0xe2, 0x5b, - 0x07, 0xea, 0x64, 0x59, + 0x00, 0xe2, 0x28, 0x42, + 0xe0, 0xea, 0x12, 0x5c, + 0x80, 0xe0, 0xf4, 0x6a, + 0x04, 0xe0, 0xa6, 0x73, + 0x02, 0xe0, 0xd8, 0x73, + 0x00, 0xea, 0x52, 0x73, + 0x03, 0xe0, 0xe8, 0x73, + 0x23, 0xe0, 0xca, 0x72, + 0x08, 0xe0, 0xf0, 0x72, + 0x00, 0xe2, 0xf6, 0x5b, + 0x07, 0xea, 0x6e, 0x59, 0x07, 0xea, 0x04, 0x00, - 0x08, 0x48, 0x15, 0x72, - 0x04, 0x48, 0xb3, 0x62, + 0x08, 0x48, 0x29, 0x72, + 0x04, 0x48, 0xc7, 0x62, 0x01, 0x49, 0x89, 0x30, - 0x00, 0xe2, 0xa4, 0x42, + 0x00, 0xe2, 0xb8, 0x42, 0x01, 0x44, 0xd4, 0x31, - 0x00, 0xe2, 0xa4, 0x42, + 0x00, 0xe2, 0xb8, 0x42, 0x01, 0x00, 0x6c, 0x32, - 0x33, 0xea, 0x5e, 0x59, + 0x33, 0xea, 0x68, 0x59, 0x33, 0xea, 0x00, 0x00, 0x4c, 0x3a, 0xc1, 0x28, 0x01, 0x64, 0xc0, 0x31, - 0x00, 0x36, 0x5f, 0x59, + 0x00, 0x36, 0x69, 0x59, 0x01, 0x36, 0x01, 0x30, - 0x01, 0xe0, 0xda, 0x7a, - 0xa0, 0xea, 0xf4, 0x5b, - 0x01, 0xa0, 0xda, 0x62, - 0x01, 0x84, 0xcf, 0x7a, - 0x01, 0x95, 0xdd, 0x6a, - 0x05, 0xea, 0x64, 0x59, + 0x01, 0xe0, 0xee, 0x7a, + 0xa0, 0xea, 0x08, 0x5c, + 0x01, 0xa0, 0xee, 0x62, + 0x01, 0x84, 0xe3, 0x7a, + 0x01, 0x95, 0xf1, 0x6a, + 0x05, 0xea, 0x6e, 0x59, 0x05, 0xea, 0x04, 0x00, - 0x00, 0xe2, 0xdc, 0x42, - 0x03, 0xea, 0x64, 0x59, + 0x00, 0xe2, 0xf0, 0x42, + 0x03, 0xea, 0x6e, 0x59, 0x03, 0xea, 0x04, 0x00, - 0x00, 0xe2, 0xdc, 0x42, - 0x07, 0xea, 0x06, 0x5c, + 0x00, 0xe2, 0xf0, 0x42, + 0x07, 0xea, 0x1a, 0x5c, 0x01, 0x44, 0xd4, 0x31, - 0x00, 0xe2, 0x14, 0x42, + 0x00, 0xe2, 0x28, 0x42, 0x3f, 0xe0, 0x76, 0x0a, 0xc0, 0x3a, 0xc1, 0x09, 0x00, 0x3b, 0x51, 0x01, @@ -384,54 +394,54 @@ static uint8_t seqprog[] = { 0x01, 0xea, 0xc6, 0x01, 0x02, 0xe2, 0xc8, 0x31, 0x02, 0xec, 0x40, 0x31, - 0xff, 0xa1, 0xfc, 0x72, + 0xff, 0xa1, 0x10, 0x73, 0x02, 0xe8, 0xda, 0x31, 0x02, 0xa0, 0x50, 0x31, - 0x00, 0xe2, 0x1e, 0x43, + 0x00, 0xe2, 0x32, 0x43, 0x80, 0x39, 0x73, 0x02, 0x01, 0x44, 0xd4, 0x31, - 0x00, 0xe2, 0xe2, 0x5b, + 0x00, 0xe2, 0xf6, 0x5b, 0x01, 0x39, 0x73, 0x02, - 0xe0, 0x3c, 0x39, 0x63, + 0xe0, 0x3c, 0x4d, 0x63, 0x02, 0x39, 0x73, 0x02, - 0x20, 0x46, 0x32, 0x63, + 0x20, 0x46, 0x46, 0x63, 0xff, 0xea, 0x52, 0x09, - 0xa8, 0xea, 0xf4, 0x5b, - 0x04, 0x92, 0x19, 0x7b, + 0xa8, 0xea, 0x08, 0x5c, + 0x04, 0x92, 0x2d, 0x7b, 0x01, 0x3a, 0xc1, 0x31, - 0x00, 0x93, 0x19, 0x63, + 0x00, 0x93, 0x2d, 0x63, 0x01, 0x3b, 0xc1, 0x31, - 0x00, 0x94, 0x23, 0x73, + 0x00, 0x94, 0x37, 0x73, 0x01, 0xa9, 0x52, 0x11, - 0xff, 0xa9, 0x0e, 0x6b, - 0x00, 0xe2, 0x32, 0x43, + 0xff, 0xa9, 0x22, 0x6b, + 0x00, 0xe2, 0x46, 0x43, 0x10, 0x39, 0x73, 0x02, - 0x04, 0x92, 0x33, 0x7b, + 0x04, 0x92, 0x47, 0x7b, 0xfb, 0x92, 0x25, 0x0b, 0xff, 0xea, 0x72, 0x0a, - 0x01, 0xa4, 0x2d, 0x6b, + 0x01, 0xa4, 0x41, 0x6b, 0x02, 0xa8, 0x9c, 0x32, - 0x00, 0xe2, 0x7e, 0x59, - 0x10, 0x92, 0xdd, 0x7a, - 0xff, 0xea, 0x06, 0x5c, - 0x00, 0xe2, 0xdc, 0x42, - 0x04, 0xea, 0x64, 0x59, + 0x00, 0xe2, 0x88, 0x59, + 0x10, 0x92, 0xf1, 0x7a, + 0xff, 0xea, 0x1a, 0x5c, + 0x00, 0xe2, 0xf0, 0x42, + 0x04, 0xea, 0x6e, 0x59, 0x04, 0xea, 0x04, 0x00, - 0x00, 0xe2, 0xdc, 0x42, - 0x04, 0xea, 0x64, 0x59, + 0x00, 0xe2, 0xf0, 0x42, + 0x04, 0xea, 0x6e, 0x59, 0x04, 0xea, 0x04, 0x00, - 0x00, 0xe2, 0x14, 0x42, - 0x08, 0x92, 0xd5, 0x7a, - 0xc0, 0x39, 0x49, 0x7b, - 0x80, 0x39, 0xd5, 0x6a, - 0xff, 0x88, 0x49, 0x6b, - 0x40, 0x39, 0xd5, 0x6a, - 0x10, 0x92, 0x4f, 0x7b, - 0x0a, 0xea, 0x64, 0x59, + 0x00, 0xe2, 0x28, 0x42, + 0x08, 0x92, 0xe9, 0x7a, + 0xc0, 0x39, 0x5d, 0x7b, + 0x80, 0x39, 0xe9, 0x6a, + 0xff, 0x88, 0x5d, 0x6b, + 0x40, 0x39, 0xe9, 0x6a, + 0x10, 0x92, 0x63, 0x7b, + 0x0a, 0xea, 0x6e, 0x59, 0x0a, 0xea, 0x04, 0x00, - 0x00, 0xe2, 0x6e, 0x5b, - 0x00, 0xe2, 0xae, 0x43, - 0x50, 0x4b, 0x56, 0x6b, + 0x00, 0xe2, 0x82, 0x5b, + 0x00, 0xe2, 0xc2, 0x43, + 0x50, 0x4b, 0x6a, 0x6b, 0xbf, 0x3a, 0x74, 0x08, 0x01, 0xe0, 0xf4, 0x31, 0xff, 0xea, 0xc0, 0x09, @@ -441,31 +451,31 @@ static uint8_t seqprog[] = { 0x01, 0xfa, 0xc0, 0x35, 0x02, 0xa8, 0x90, 0x32, 0x02, 0xea, 0xb4, 0x00, - 0x33, 0xea, 0x5e, 0x59, + 0x33, 0xea, 0x68, 0x59, 0x33, 0xea, 0x00, 0x00, 0x02, 0x48, 0x51, 0x31, 0xff, 0x90, 0x85, 0x68, - 0xff, 0x88, 0x7b, 0x6b, - 0x01, 0xa4, 0x77, 0x6b, - 0x02, 0xa4, 0x7f, 0x6b, - 0x01, 0x84, 0x7f, 0x7b, + 0xff, 0x88, 0x8f, 0x6b, + 0x01, 0xa4, 0x8b, 0x6b, + 0x02, 0xa4, 0x93, 0x6b, + 0x01, 0x84, 0x93, 0x7b, 0x02, 0x28, 0x19, 0x33, 0x02, 0xa8, 0x50, 0x36, - 0xff, 0x88, 0x7f, 0x73, - 0x00, 0xe2, 0x52, 0x5b, + 0xff, 0x88, 0x93, 0x73, + 0x00, 0xe2, 0x66, 0x5b, 0x02, 0xa8, 0x20, 0x33, 0x04, 0xa4, 0x49, 0x03, 0xff, 0xea, 0x1a, 0x03, - 0xff, 0x2d, 0x8b, 0x63, + 0xff, 0x2d, 0x9f, 0x63, 0x02, 0xa8, 0x58, 0x32, 0x02, 0xa8, 0x5c, 0x36, 0x02, 0xa8, 0x40, 0x31, 0x02, 0x2e, 0x51, 0x31, 0x02, 0xa0, 0x18, 0x33, 0x02, 0xa0, 0x5c, 0x36, - 0xc0, 0x39, 0xd5, 0x6a, + 0xc0, 0x39, 0xe9, 0x6a, 0x04, 0x92, 0x25, 0x03, - 0x20, 0x92, 0xaf, 0x6b, + 0x20, 0x92, 0xc3, 0x6b, 0x02, 0xa8, 0x40, 0x31, 0xc0, 0x3a, 0xc1, 0x09, 0x00, 0x3b, 0x51, 0x01, @@ -480,60 +490,60 @@ static uint8_t seqprog[] = { 0xf7, 0x57, 0xae, 0x08, 0x08, 0xea, 0x98, 0x00, 0x01, 0x44, 0xd4, 0x31, - 0xee, 0x00, 0xb8, 0x6b, + 0xee, 0x00, 0xcc, 0x6b, 0x02, 0xea, 0xb4, 0x00, 0xc0, 0xea, 0x72, 0x02, - 0x09, 0x4c, 0xba, 0x7b, + 0x09, 0x4c, 0xce, 0x7b, 0x01, 0xea, 0x78, 0x02, 0x08, 0x4c, 0x06, 0x68, - 0x0b, 0xea, 0x64, 0x59, + 0x0b, 0xea, 0x6e, 0x59, 0x0b, 0xea, 0x04, 0x00, 0x01, 0x44, 0xd4, 0x31, - 0x20, 0x39, 0x15, 0x7a, - 0x00, 0xe2, 0xcc, 0x5b, - 0x00, 0xe2, 0x14, 0x42, - 0x01, 0x84, 0xd1, 0x7b, + 0x20, 0x39, 0x29, 0x7a, + 0x00, 0xe2, 0xe0, 0x5b, + 0x00, 0xe2, 0x28, 0x42, + 0x01, 0x84, 0xe5, 0x7b, 0x01, 0xa4, 0x49, 0x07, 0x08, 0x60, 0x30, 0x33, 0x08, 0x80, 0x41, 0x37, 0xdf, 0x39, 0x73, 0x0a, - 0xee, 0x00, 0xde, 0x6b, + 0xee, 0x00, 0xf2, 0x6b, 0x05, 0xea, 0xb4, 0x00, - 0x33, 0xea, 0x5e, 0x59, + 0x33, 0xea, 0x68, 0x59, 0x33, 0xea, 0x00, 0x00, - 0x00, 0xe2, 0x7e, 0x59, - 0x00, 0xe2, 0xdc, 0x42, - 0xff, 0x42, 0xee, 0x6b, - 0x01, 0x41, 0xe2, 0x6b, - 0x02, 0x41, 0xe2, 0x7b, - 0xff, 0x42, 0xee, 0x6b, - 0x01, 0x41, 0xe2, 0x6b, - 0x02, 0x41, 0xe2, 0x7b, - 0xff, 0x42, 0xee, 0x7b, - 0x04, 0x4c, 0xe2, 0x6b, + 0x00, 0xe2, 0x88, 0x59, + 0x00, 0xe2, 0xf0, 0x42, + 0xff, 0x42, 0x02, 0x6c, + 0x01, 0x41, 0xf6, 0x6b, + 0x02, 0x41, 0xf6, 0x7b, + 0xff, 0x42, 0x02, 0x6c, + 0x01, 0x41, 0xf6, 0x6b, + 0x02, 0x41, 0xf6, 0x7b, + 0xff, 0x42, 0x02, 0x7c, + 0x04, 0x4c, 0xf6, 0x6b, 0xe0, 0x41, 0x78, 0x0e, 0x01, 0x44, 0xd4, 0x31, - 0xff, 0x42, 0xf6, 0x7b, - 0x04, 0x4c, 0xf6, 0x6b, + 0xff, 0x42, 0x0a, 0x7c, + 0x04, 0x4c, 0x0a, 0x6c, 0xe0, 0x41, 0x78, 0x0a, - 0xe0, 0x3c, 0x15, 0x62, + 0xe0, 0x3c, 0x29, 0x62, 0xff, 0xea, 0xca, 0x09, 0x01, 0xe2, 0xc8, 0x31, 0x01, 0x46, 0xda, 0x35, 0x01, 0x44, 0xd4, 0x35, 0x10, 0xea, 0x80, 0x00, 0x01, 0xe2, 0x6e, 0x36, - 0x04, 0xa6, 0x0e, 0x7c, + 0x04, 0xa6, 0x22, 0x7c, 0xff, 0xea, 0x5a, 0x09, 0xff, 0xea, 0x4c, 0x0d, - 0x01, 0xa6, 0x3a, 0x6c, + 0x01, 0xa6, 0x4e, 0x6c, 0x10, 0xad, 0x84, 0x78, - 0x80, 0xad, 0x32, 0x6c, + 0x80, 0xad, 0x46, 0x6c, 0x08, 0xad, 0x84, 0x68, - 0x20, 0x19, 0x26, 0x7c, + 0x20, 0x19, 0x3a, 0x7c, 0x80, 0xea, 0xb2, 0x01, 0x11, 0x00, 0x00, 0x10, - 0x02, 0xa6, 0x22, 0x7c, + 0x02, 0xa6, 0x36, 0x7c, 0xff, 0xea, 0xb2, 0x0d, 0x11, 0x00, 0x00, 0x10, 0xff, 0xea, 0xb2, 0x09, @@ -561,7 +571,7 @@ static uint8_t seqprog[] = { 0x00, 0x86, 0x0d, 0x23, 0x00, 0x87, 0x0f, 0x23, 0x01, 0x84, 0xc5, 0x31, - 0x80, 0x83, 0x5d, 0x7c, + 0x80, 0x83, 0x71, 0x7c, 0x02, 0xe2, 0xc4, 0x01, 0xff, 0xea, 0x4c, 0x09, 0x01, 0xe2, 0x36, 0x30, @@ -572,75 +582,75 @@ static uint8_t seqprog[] = { 0xfe, 0xa6, 0x4c, 0x0d, 0x0b, 0x98, 0xe1, 0x30, 0xfd, 0xa4, 0x49, 0x09, - 0x80, 0xa3, 0x71, 0x7c, + 0x80, 0xa3, 0x85, 0x7c, 0x02, 0xa4, 0x48, 0x01, 0x01, 0xa4, 0x36, 0x30, 0xa8, 0xea, 0x32, 0x00, 0xfd, 0xa4, 0x49, 0x0b, 0x05, 0xa3, 0x07, 0x33, - 0x80, 0x83, 0x7d, 0x6c, + 0x80, 0x83, 0x91, 0x6c, 0x02, 0xea, 0x4c, 0x05, 0xff, 0xea, 0x4c, 0x0d, - 0x00, 0xe2, 0x56, 0x59, - 0x02, 0xa6, 0x10, 0x6c, + 0x00, 0xe2, 0x60, 0x59, + 0x02, 0xa6, 0x24, 0x6c, 0x80, 0xf9, 0xf2, 0x05, - 0xc0, 0x39, 0x8b, 0x7c, - 0x03, 0xea, 0x64, 0x59, + 0xc0, 0x39, 0x9f, 0x7c, + 0x03, 0xea, 0x6e, 0x59, 0x03, 0xea, 0x04, 0x00, - 0x20, 0x39, 0xaf, 0x7c, - 0x01, 0x84, 0x95, 0x6c, - 0x06, 0xea, 0x64, 0x59, + 0x20, 0x39, 0xc3, 0x7c, + 0x01, 0x84, 0xa9, 0x6c, + 0x06, 0xea, 0x6e, 0x59, 0x06, 0xea, 0x04, 0x00, - 0x00, 0xe2, 0xb2, 0x44, + 0x00, 0xe2, 0xc6, 0x44, 0x01, 0x00, 0x6c, 0x32, - 0xee, 0x00, 0x9e, 0x6c, + 0xee, 0x00, 0xb2, 0x6c, 0x05, 0xea, 0xb4, 0x00, - 0x33, 0xea, 0x5e, 0x59, + 0x33, 0xea, 0x68, 0x59, 0x33, 0xea, 0x00, 0x00, 0x80, 0x3d, 0x7a, 0x00, - 0xfc, 0x42, 0xa0, 0x7c, + 0xfc, 0x42, 0xb4, 0x7c, 0x7f, 0x3d, 0x7a, 0x08, - 0x00, 0x36, 0x5f, 0x59, + 0x00, 0x36, 0x69, 0x59, 0x01, 0x36, 0x01, 0x30, - 0x09, 0xea, 0x64, 0x59, + 0x09, 0xea, 0x6e, 0x59, 0x09, 0xea, 0x04, 0x00, - 0x00, 0xe2, 0x14, 0x42, - 0x01, 0xa4, 0x95, 0x6c, - 0x00, 0xe2, 0x68, 0x5c, + 0x00, 0xe2, 0x28, 0x42, + 0x01, 0xa4, 0xa9, 0x6c, + 0x00, 0xe2, 0x7c, 0x5c, 0x20, 0x39, 0x73, 0x02, 0x01, 0x00, 0x6c, 0x32, - 0x02, 0xa6, 0xba, 0x7c, - 0x00, 0xe2, 0x7e, 0x5c, + 0x02, 0xa6, 0xce, 0x7c, + 0x00, 0xe2, 0x92, 0x5c, 0x00, 0xe2, 0x76, 0x58, 0x00, 0xe2, 0x86, 0x58, 0x00, 0xe2, 0x5a, 0x58, - 0x00, 0x36, 0x5f, 0x59, + 0x00, 0x36, 0x69, 0x59, 0x01, 0x36, 0x01, 0x30, - 0x20, 0x19, 0xba, 0x6c, - 0x00, 0xe2, 0xea, 0x5c, - 0x04, 0x19, 0xd4, 0x6c, + 0x20, 0x19, 0xce, 0x6c, + 0x00, 0xe2, 0xfe, 0x5c, + 0x04, 0x19, 0xe8, 0x6c, 0x02, 0x19, 0x32, 0x00, - 0x01, 0x84, 0xd5, 0x7c, - 0x01, 0x1b, 0xce, 0x7c, - 0x01, 0x1a, 0xd4, 0x6c, - 0x00, 0xe2, 0x84, 0x44, - 0x80, 0x4b, 0xda, 0x6c, - 0x01, 0x4c, 0xd6, 0x7c, - 0x03, 0x42, 0x84, 0x6c, - 0x00, 0xe2, 0x0a, 0x5c, + 0x01, 0x84, 0xe9, 0x7c, + 0x01, 0x1b, 0xe2, 0x7c, + 0x01, 0x1a, 0xe8, 0x6c, + 0x00, 0xe2, 0x98, 0x44, + 0x80, 0x4b, 0xee, 0x6c, + 0x01, 0x4c, 0xea, 0x7c, + 0x03, 0x42, 0x98, 0x6c, + 0x00, 0xe2, 0x1e, 0x5c, 0x80, 0xf9, 0xf2, 0x01, - 0x04, 0x39, 0x15, 0x7a, - 0x00, 0xe2, 0x14, 0x42, - 0x08, 0x5d, 0xf2, 0x6c, + 0x04, 0x39, 0x29, 0x7a, + 0x00, 0xe2, 0x28, 0x42, + 0x08, 0x5d, 0x06, 0x6d, 0x00, 0xe2, 0x76, 0x58, - 0x00, 0x36, 0x5f, 0x59, + 0x00, 0x36, 0x69, 0x59, 0x01, 0x36, 0x01, 0x30, - 0x02, 0x1b, 0xe2, 0x7c, - 0x08, 0x5d, 0xf0, 0x7c, + 0x02, 0x1b, 0xf6, 0x7c, + 0x08, 0x5d, 0x04, 0x7d, 0x03, 0x68, 0x00, 0x37, 0x01, 0x84, 0x09, 0x07, - 0x80, 0x1b, 0xfc, 0x7c, - 0x80, 0x84, 0xfd, 0x6c, + 0x80, 0x1b, 0x10, 0x7d, + 0x80, 0x84, 0x11, 0x6d, 0xff, 0x85, 0x0b, 0x1b, 0xff, 0x86, 0x0d, 0x23, 0xff, 0x87, 0x0f, 0x23, @@ -652,161 +662,164 @@ static uint8_t seqprog[] = { 0xf9, 0xd9, 0xb2, 0x0d, 0x01, 0xd9, 0xb2, 0x05, 0x01, 0x52, 0x48, 0x31, - 0x20, 0xa4, 0x26, 0x7d, - 0x20, 0x5b, 0x26, 0x7d, - 0x80, 0xf9, 0x34, 0x7d, + 0x20, 0xa4, 0x3a, 0x7d, + 0x20, 0x5b, 0x3a, 0x7d, + 0x80, 0xf9, 0x48, 0x7d, 0x02, 0xea, 0xb4, 0x00, 0x11, 0x00, 0x00, 0x10, - 0x04, 0x19, 0x40, 0x7d, + 0x04, 0x19, 0x54, 0x7d, 0xdf, 0x19, 0x32, 0x08, - 0x60, 0x5b, 0x40, 0x6d, - 0x01, 0x4c, 0x1a, 0x7d, + 0x60, 0x5b, 0x54, 0x6d, + 0x01, 0x4c, 0x2e, 0x7d, 0x20, 0x19, 0x32, 0x00, 0x01, 0xd9, 0xb2, 0x05, 0x02, 0xea, 0xb4, 0x00, 0x01, 0xd9, 0xb2, 0x05, - 0x10, 0x5b, 0x38, 0x6d, - 0x08, 0x5b, 0x42, 0x6d, - 0x20, 0x5b, 0x32, 0x6d, - 0x02, 0x5b, 0x62, 0x6d, - 0x0e, 0xea, 0x64, 0x59, + 0x10, 0x5b, 0x4c, 0x6d, + 0x08, 0x5b, 0x56, 0x6d, + 0x20, 0x5b, 0x46, 0x6d, + 0x02, 0x5b, 0x76, 0x6d, + 0x0e, 0xea, 0x6e, 0x59, 0x0e, 0xea, 0x04, 0x00, - 0x80, 0xf9, 0x22, 0x6d, + 0x80, 0xf9, 0x36, 0x6d, 0xdf, 0x5c, 0xb8, 0x08, 0x01, 0xd9, 0xb2, 0x05, - 0x01, 0xa4, 0x1d, 0x6e, - 0x00, 0xe2, 0x68, 0x5c, - 0x00, 0xe2, 0x6c, 0x5d, + 0x01, 0xa4, 0x37, 0x6e, + 0x00, 0xe2, 0x7c, 0x5c, + 0x00, 0xe2, 0x80, 0x5d, 0x01, 0x90, 0x21, 0x1b, 0x01, 0xd9, 0xb2, 0x05, - 0x00, 0xe2, 0x52, 0x5b, + 0x00, 0xe2, 0x66, 0x5b, 0xf3, 0x96, 0xd5, 0x19, - 0x00, 0xe2, 0x50, 0x55, - 0x80, 0x96, 0x51, 0x6d, - 0x0f, 0xea, 0x64, 0x59, + 0x00, 0xe2, 0x64, 0x55, + 0x80, 0x96, 0x65, 0x6d, + 0x0f, 0xea, 0x6e, 0x59, 0x0f, 0xea, 0x04, 0x00, - 0x00, 0xe2, 0x58, 0x45, + 0x00, 0xe2, 0x6c, 0x45, 0x04, 0x8c, 0xe1, 0x30, 0x01, 0xea, 0xf2, 0x00, 0x02, 0xea, 0x36, 0x00, 0xa8, 0xea, 0x32, 0x00, - 0xff, 0x97, 0x5f, 0x7d, - 0x14, 0xea, 0x64, 0x59, + 0xff, 0x97, 0x73, 0x7d, + 0x14, 0xea, 0x6e, 0x59, 0x14, 0xea, 0x04, 0x00, - 0x00, 0xe2, 0xce, 0x5d, + 0x00, 0xe2, 0xe2, 0x5d, 0x01, 0xd9, 0xb2, 0x05, 0x09, 0x80, 0xe1, 0x30, 0x02, 0xea, 0x36, 0x00, 0xa8, 0xea, 0x32, 0x00, - 0x00, 0xe2, 0xc6, 0x5d, + 0x00, 0xe2, 0xda, 0x5d, 0x01, 0xd9, 0xb2, 0x05, - 0x02, 0xa6, 0x7c, 0x7d, - 0x00, 0xe2, 0x56, 0x59, - 0x20, 0x5b, 0x8a, 0x6d, - 0xfc, 0x42, 0x76, 0x7d, - 0x10, 0x40, 0x78, 0x6d, - 0x20, 0x4d, 0x7a, 0x7d, - 0x08, 0x5d, 0x8a, 0x6d, - 0x02, 0xa6, 0x10, 0x6c, - 0x00, 0xe2, 0x56, 0x59, - 0x20, 0x5b, 0x8a, 0x6d, - 0x01, 0x1b, 0xaa, 0x6d, - 0xfc, 0x42, 0x86, 0x7d, - 0x10, 0x40, 0x88, 0x6d, + 0x02, 0xa6, 0x90, 0x7d, + 0x00, 0xe2, 0x60, 0x59, + 0x20, 0x5b, 0x9e, 0x6d, + 0xfc, 0x42, 0x8a, 0x7d, + 0x10, 0x40, 0x8c, 0x6d, + 0x20, 0x4d, 0x8e, 0x7d, + 0x08, 0x5d, 0x9e, 0x6d, + 0x02, 0xa6, 0x24, 0x6c, + 0x00, 0xe2, 0x60, 0x59, + 0x20, 0x5b, 0x9e, 0x6d, + 0x01, 0x1b, 0xbe, 0x6d, + 0xfc, 0x42, 0x9a, 0x7d, + 0x10, 0x40, 0x9c, 0x6d, 0x20, 0x4d, 0x84, 0x78, 0x08, 0x5d, 0x84, 0x78, 0x02, 0x19, 0x32, 0x00, 0x01, 0x5b, 0x40, 0x31, - 0x00, 0xe2, 0xea, 0x5c, - 0x00, 0xe2, 0xcc, 0x5b, + 0x00, 0xe2, 0xfe, 0x5c, + 0x00, 0xe2, 0xe0, 0x5b, 0x20, 0xea, 0xb6, 0x00, - 0x00, 0xe2, 0x0a, 0x5c, + 0x00, 0xe2, 0x1e, 0x5c, 0x20, 0x5c, 0xb8, 0x00, - 0x04, 0x19, 0xa0, 0x6d, - 0x01, 0x1a, 0xa0, 0x6d, - 0x00, 0xe2, 0x56, 0x59, + 0x04, 0x19, 0xb4, 0x6d, + 0x01, 0x1a, 0xb4, 0x6d, + 0x00, 0xe2, 0x60, 0x59, 0x01, 0x1a, 0x84, 0x78, 0x80, 0xf9, 0xf2, 0x01, - 0x20, 0xa0, 0x04, 0x7e, + 0x20, 0xa0, 0x18, 0x7e, 0xff, 0x90, 0x21, 0x1b, - 0x08, 0x92, 0x63, 0x6b, + 0x08, 0x92, 0x77, 0x6b, 0x02, 0xea, 0xb4, 0x04, 0x01, 0xa4, 0x49, 0x03, - 0x40, 0x5b, 0xba, 0x6d, - 0x00, 0xe2, 0x56, 0x59, - 0x40, 0x5b, 0xba, 0x6d, - 0x04, 0x5d, 0x1e, 0x7e, - 0x01, 0x1a, 0x1e, 0x7e, + 0x40, 0x5b, 0xce, 0x6d, + 0x00, 0xe2, 0x60, 0x59, + 0x40, 0x5b, 0xce, 0x6d, + 0x04, 0x5d, 0x38, 0x7e, + 0x01, 0x1a, 0x38, 0x7e, 0x20, 0x4d, 0x84, 0x78, - 0x40, 0x5b, 0x04, 0x7e, - 0x04, 0x5d, 0x1e, 0x7e, - 0x01, 0x1a, 0x1e, 0x7e, + 0x40, 0x5b, 0x18, 0x7e, + 0x04, 0x5d, 0x38, 0x7e, + 0x01, 0x1a, 0x38, 0x7e, 0x80, 0xf9, 0xf2, 0x01, 0xff, 0x90, 0x21, 0x1b, - 0x08, 0x92, 0x63, 0x6b, + 0x08, 0x92, 0x77, 0x6b, 0x02, 0xea, 0xb4, 0x04, - 0x00, 0xe2, 0x56, 0x59, + 0x00, 0xe2, 0x60, 0x59, 0x01, 0x1b, 0x84, 0x78, 0x80, 0xf9, 0xf2, 0x01, 0x02, 0xea, 0xb4, 0x04, - 0x00, 0xe2, 0x56, 0x59, - 0x01, 0x1b, 0xe2, 0x6d, - 0x40, 0x5b, 0xf0, 0x7d, - 0x01, 0x1b, 0xe2, 0x6d, + 0x00, 0xe2, 0x60, 0x59, + 0x01, 0x1b, 0xf6, 0x6d, + 0x40, 0x5b, 0x04, 0x7e, + 0x01, 0x1b, 0xf6, 0x6d, 0x02, 0x19, 0x32, 0x00, 0x01, 0x1a, 0x84, 0x78, 0x80, 0xf9, 0xf2, 0x01, 0xff, 0xea, 0x10, 0x03, 0x08, 0x92, 0x25, 0x03, - 0x00, 0xe2, 0x62, 0x43, - 0x01, 0x1a, 0xec, 0x7d, - 0x40, 0x5b, 0xe8, 0x7d, - 0x01, 0x1a, 0xd6, 0x6d, + 0x00, 0xe2, 0x76, 0x43, + 0x01, 0x1a, 0x00, 0x7e, + 0x40, 0x5b, 0xfc, 0x7d, + 0x01, 0x1a, 0xea, 0x6d, 0xfc, 0x42, 0x84, 0x78, - 0x01, 0x1a, 0xf0, 0x6d, - 0x10, 0xea, 0x64, 0x59, + 0x01, 0x1a, 0x04, 0x6e, + 0x10, 0xea, 0x6e, 0x59, 0x10, 0xea, 0x04, 0x00, 0xfc, 0x42, 0x84, 0x78, - 0x10, 0x40, 0xf6, 0x6d, + 0x10, 0x40, 0x0a, 0x6e, 0x20, 0x4d, 0x84, 0x78, - 0x40, 0x5b, 0xd6, 0x6d, + 0x40, 0x5b, 0xea, 0x6d, 0x01, 0x1a, 0x84, 0x78, 0x01, 0x90, 0x21, 0x1b, 0x30, 0x3f, 0xc0, 0x09, 0x30, 0xe0, 0x84, 0x60, 0x40, 0x4b, 0x84, 0x68, 0xff, 0xea, 0x52, 0x01, - 0xee, 0x00, 0x0c, 0x6e, + 0xee, 0x00, 0x20, 0x6e, 0x80, 0xf9, 0xf2, 0x01, 0xff, 0x90, 0x21, 0x1b, 0x02, 0xea, 0xb4, 0x00, 0x20, 0xea, 0x9a, 0x00, - 0xf3, 0x42, 0x16, 0x6e, - 0x12, 0xea, 0x64, 0x59, + 0x04, 0x41, 0x26, 0x7e, + 0x08, 0xea, 0x98, 0x00, + 0x08, 0x57, 0xae, 0x00, + 0xf3, 0x42, 0x30, 0x6e, + 0x12, 0xea, 0x6e, 0x59, 0x12, 0xea, 0x04, 0x00, - 0x00, 0xe2, 0x14, 0x42, - 0x0d, 0xea, 0x64, 0x59, + 0x00, 0xe2, 0x28, 0x42, + 0x0d, 0xea, 0x6e, 0x59, 0x0d, 0xea, 0x04, 0x00, - 0x00, 0xe2, 0x14, 0x42, + 0x00, 0xe2, 0x28, 0x42, 0x01, 0x90, 0x21, 0x1b, - 0x11, 0xea, 0x64, 0x59, + 0x11, 0xea, 0x6e, 0x59, 0x11, 0xea, 0x04, 0x00, - 0x00, 0xe2, 0x52, 0x5b, + 0x00, 0xe2, 0x66, 0x5b, 0x08, 0x5a, 0xb4, 0x00, - 0x00, 0xe2, 0x44, 0x5e, + 0x00, 0xe2, 0x5e, 0x5e, 0xa8, 0xea, 0x32, 0x00, - 0x00, 0xe2, 0x56, 0x59, - 0x80, 0x1a, 0x32, 0x7e, - 0x00, 0xe2, 0x44, 0x5e, + 0x00, 0xe2, 0x60, 0x59, + 0x80, 0x1a, 0x4c, 0x7e, + 0x00, 0xe2, 0x5e, 0x5e, 0x80, 0x19, 0x32, 0x00, - 0x40, 0x5b, 0x38, 0x6e, - 0x08, 0x5a, 0x38, 0x7e, + 0x40, 0x5b, 0x52, 0x6e, + 0x08, 0x5a, 0x52, 0x7e, 0x20, 0x4d, 0x84, 0x78, 0x02, 0x84, 0x09, 0x03, - 0x40, 0x5b, 0x04, 0x7e, + 0x40, 0x5b, 0x18, 0x7e, 0xff, 0x90, 0x21, 0x1b, 0x80, 0xf9, 0xf2, 0x01, - 0x08, 0x92, 0x63, 0x6b, + 0x08, 0x92, 0x77, 0x6b, 0x02, 0xea, 0xb4, 0x04, 0x01, 0x40, 0xe1, 0x30, 0x05, 0x41, 0xe3, 0x98, @@ -1039,138 +1052,138 @@ static struct patch { { ahd_patch0_func, 64, 1, 1 }, { ahd_patch2_func, 67, 1, 2 }, { ahd_patch0_func, 68, 1, 1 }, - { ahd_patch4_func, 116, 1, 1 }, - { ahd_patch2_func, 175, 3, 1 }, - { ahd_patch1_func, 178, 2, 1 }, - { ahd_patch5_func, 180, 1, 1 }, - { ahd_patch2_func, 189, 1, 2 }, - { ahd_patch0_func, 190, 1, 1 }, - { ahd_patch6_func, 191, 2, 2 }, - { ahd_patch0_func, 193, 6, 3 }, - { ahd_patch2_func, 196, 1, 2 }, - { ahd_patch0_func, 197, 1, 1 }, - { ahd_patch2_func, 200, 1, 2 }, - { ahd_patch0_func, 201, 1, 1 }, - { ahd_patch3_func, 203, 1, 1 }, - { ahd_patch7_func, 204, 3, 1 }, - { ahd_patch3_func, 213, 1, 1 }, - { ahd_patch5_func, 214, 16, 2 }, - { ahd_patch0_func, 230, 1, 1 }, - { ahd_patch8_func, 250, 2, 1 }, - { ahd_patch1_func, 254, 1, 2 }, - { ahd_patch0_func, 255, 1, 1 }, - { ahd_patch7_func, 258, 3, 1 }, - { ahd_patch1_func, 273, 1, 2 }, - { ahd_patch0_func, 274, 1, 1 }, - { ahd_patch1_func, 277, 1, 2 }, - { ahd_patch0_func, 278, 1, 1 }, - { ahd_patch2_func, 281, 1, 2 }, - { ahd_patch0_func, 282, 1, 1 }, - { ahd_patch9_func, 295, 2, 2 }, - { ahd_patch0_func, 297, 1, 1 }, - { ahd_patch1_func, 339, 1, 2 }, - { ahd_patch0_func, 340, 1, 1 }, - { ahd_patch2_func, 348, 1, 2 }, - { ahd_patch0_func, 349, 1, 1 }, - { ahd_patch2_func, 352, 1, 2 }, - { ahd_patch0_func, 353, 1, 1 }, - { ahd_patch1_func, 359, 1, 2 }, - { ahd_patch0_func, 360, 1, 1 }, - { ahd_patch1_func, 362, 1, 2 }, + { ahd_patch4_func, 115, 1, 1 }, + { ahd_patch2_func, 180, 3, 1 }, + { ahd_patch1_func, 183, 2, 1 }, + { ahd_patch5_func, 185, 1, 1 }, + { ahd_patch2_func, 194, 1, 2 }, + { ahd_patch0_func, 195, 1, 1 }, + { ahd_patch6_func, 196, 2, 2 }, + { ahd_patch0_func, 198, 6, 3 }, + { ahd_patch2_func, 201, 1, 2 }, + { ahd_patch0_func, 202, 1, 1 }, + { ahd_patch2_func, 205, 1, 2 }, + { ahd_patch0_func, 206, 1, 1 }, + { ahd_patch3_func, 208, 1, 1 }, + { ahd_patch7_func, 209, 3, 1 }, + { ahd_patch3_func, 218, 1, 1 }, + { ahd_patch5_func, 219, 16, 2 }, + { ahd_patch0_func, 235, 1, 1 }, + { ahd_patch8_func, 260, 2, 1 }, + { ahd_patch1_func, 264, 1, 2 }, + { ahd_patch0_func, 265, 1, 1 }, + { ahd_patch7_func, 268, 3, 1 }, + { ahd_patch1_func, 283, 1, 2 }, + { ahd_patch0_func, 284, 1, 1 }, + { ahd_patch1_func, 287, 1, 2 }, + { ahd_patch0_func, 288, 1, 1 }, + { ahd_patch2_func, 291, 1, 2 }, + { ahd_patch0_func, 292, 1, 1 }, + { ahd_patch9_func, 305, 2, 2 }, + { ahd_patch0_func, 307, 1, 1 }, + { ahd_patch1_func, 349, 1, 2 }, + { ahd_patch0_func, 350, 1, 1 }, + { ahd_patch2_func, 358, 1, 2 }, + { ahd_patch0_func, 359, 1, 1 }, + { ahd_patch2_func, 362, 1, 2 }, { ahd_patch0_func, 363, 1, 1 }, - { ahd_patch10_func, 382, 1, 1 }, - { ahd_patch10_func, 385, 1, 1 }, - { ahd_patch10_func, 387, 1, 1 }, - { ahd_patch10_func, 399, 1, 1 }, - { ahd_patch1_func, 409, 1, 2 }, - { ahd_patch0_func, 410, 1, 1 }, - { ahd_patch1_func, 412, 1, 2 }, - { ahd_patch0_func, 413, 1, 1 }, - { ahd_patch1_func, 421, 1, 2 }, - { ahd_patch0_func, 422, 1, 1 }, - { ahd_patch2_func, 435, 1, 2 }, - { ahd_patch0_func, 436, 1, 1 }, - { ahd_patch11_func, 472, 1, 1 }, - { ahd_patch1_func, 480, 1, 2 }, - { ahd_patch0_func, 481, 1, 1 }, - { ahd_patch2_func, 493, 1, 2 }, - { ahd_patch0_func, 494, 1, 1 }, - { ahd_patch12_func, 497, 6, 2 }, - { ahd_patch0_func, 503, 1, 1 }, - { ahd_patch13_func, 524, 7, 1 }, - { ahd_patch14_func, 533, 1, 1 }, - { ahd_patch15_func, 542, 1, 1 }, - { ahd_patch16_func, 543, 1, 2 }, - { ahd_patch0_func, 544, 1, 1 }, - { ahd_patch17_func, 547, 1, 1 }, - { ahd_patch16_func, 548, 1, 1 }, - { ahd_patch18_func, 559, 1, 2 }, - { ahd_patch0_func, 560, 1, 1 }, - { ahd_patch1_func, 579, 1, 2 }, - { ahd_patch0_func, 580, 1, 1 }, - { ahd_patch1_func, 583, 1, 2 }, - { ahd_patch0_func, 584, 1, 1 }, - { ahd_patch2_func, 589, 1, 2 }, + { ahd_patch1_func, 369, 1, 2 }, + { ahd_patch0_func, 370, 1, 1 }, + { ahd_patch1_func, 372, 1, 2 }, + { ahd_patch0_func, 373, 1, 1 }, + { ahd_patch10_func, 392, 1, 1 }, + { ahd_patch10_func, 395, 1, 1 }, + { ahd_patch10_func, 397, 1, 1 }, + { ahd_patch10_func, 409, 1, 1 }, + { ahd_patch1_func, 419, 1, 2 }, + { ahd_patch0_func, 420, 1, 1 }, + { ahd_patch1_func, 422, 1, 2 }, + { ahd_patch0_func, 423, 1, 1 }, + { ahd_patch1_func, 431, 1, 2 }, + { ahd_patch0_func, 432, 1, 1 }, + { ahd_patch2_func, 445, 1, 2 }, + { ahd_patch0_func, 446, 1, 1 }, + { ahd_patch11_func, 482, 1, 1 }, + { ahd_patch1_func, 490, 1, 2 }, + { ahd_patch0_func, 491, 1, 1 }, + { ahd_patch2_func, 503, 1, 2 }, + { ahd_patch0_func, 504, 1, 1 }, + { ahd_patch12_func, 507, 6, 2 }, + { ahd_patch0_func, 513, 1, 1 }, + { ahd_patch13_func, 534, 7, 1 }, + { ahd_patch14_func, 543, 1, 1 }, + { ahd_patch15_func, 552, 1, 1 }, + { ahd_patch16_func, 553, 1, 2 }, + { ahd_patch0_func, 554, 1, 1 }, + { ahd_patch17_func, 557, 1, 1 }, + { ahd_patch16_func, 558, 1, 1 }, + { ahd_patch18_func, 569, 1, 2 }, + { ahd_patch0_func, 570, 1, 1 }, + { ahd_patch1_func, 589, 1, 2 }, { ahd_patch0_func, 590, 1, 1 }, - { ahd_patch2_func, 594, 1, 2 }, - { ahd_patch0_func, 595, 1, 1 }, - { ahd_patch1_func, 596, 1, 2 }, - { ahd_patch0_func, 597, 1, 1 }, - { ahd_patch2_func, 608, 1, 2 }, - { ahd_patch0_func, 609, 1, 1 }, - { ahd_patch19_func, 613, 1, 1 }, - { ahd_patch20_func, 618, 1, 1 }, - { ahd_patch21_func, 619, 2, 1 }, - { ahd_patch20_func, 623, 1, 2 }, - { ahd_patch0_func, 624, 1, 1 }, - { ahd_patch2_func, 627, 1, 2 }, - { ahd_patch0_func, 628, 1, 1 }, - { ahd_patch2_func, 643, 1, 2 }, - { ahd_patch0_func, 644, 1, 1 }, - { ahd_patch13_func, 645, 14, 1 }, - { ahd_patch1_func, 663, 1, 2 }, - { ahd_patch0_func, 664, 1, 1 }, - { ahd_patch13_func, 665, 1, 1 }, - { ahd_patch1_func, 677, 1, 2 }, - { ahd_patch0_func, 678, 1, 1 }, - { ahd_patch1_func, 685, 1, 2 }, - { ahd_patch0_func, 686, 1, 1 }, - { ahd_patch19_func, 709, 1, 1 }, - { ahd_patch19_func, 747, 1, 1 }, - { ahd_patch1_func, 758, 1, 2 }, - { ahd_patch0_func, 759, 1, 1 }, - { ahd_patch1_func, 776, 1, 2 }, - { ahd_patch0_func, 777, 1, 1 }, - { ahd_patch1_func, 779, 1, 2 }, - { ahd_patch0_func, 780, 1, 1 }, - { ahd_patch1_func, 783, 1, 2 }, - { ahd_patch0_func, 784, 1, 1 }, - { ahd_patch22_func, 786, 1, 2 }, - { ahd_patch0_func, 787, 2, 1 }, - { ahd_patch23_func, 790, 4, 2 }, - { ahd_patch0_func, 794, 1, 1 }, - { ahd_patch23_func, 802, 11, 1 } + { ahd_patch1_func, 593, 1, 2 }, + { ahd_patch0_func, 594, 1, 1 }, + { ahd_patch2_func, 599, 1, 2 }, + { ahd_patch0_func, 600, 1, 1 }, + { ahd_patch2_func, 604, 1, 2 }, + { ahd_patch0_func, 605, 1, 1 }, + { ahd_patch1_func, 606, 1, 2 }, + { ahd_patch0_func, 607, 1, 1 }, + { ahd_patch2_func, 618, 1, 2 }, + { ahd_patch0_func, 619, 1, 1 }, + { ahd_patch19_func, 623, 1, 1 }, + { ahd_patch20_func, 628, 1, 1 }, + { ahd_patch21_func, 629, 2, 1 }, + { ahd_patch20_func, 633, 1, 2 }, + { ahd_patch0_func, 634, 1, 1 }, + { ahd_patch2_func, 637, 1, 2 }, + { ahd_patch0_func, 638, 1, 1 }, + { ahd_patch2_func, 653, 1, 2 }, + { ahd_patch0_func, 654, 1, 1 }, + { ahd_patch13_func, 655, 14, 1 }, + { ahd_patch1_func, 673, 1, 2 }, + { ahd_patch0_func, 674, 1, 1 }, + { ahd_patch13_func, 675, 1, 1 }, + { ahd_patch1_func, 687, 1, 2 }, + { ahd_patch0_func, 688, 1, 1 }, + { ahd_patch1_func, 695, 1, 2 }, + { ahd_patch0_func, 696, 1, 1 }, + { ahd_patch19_func, 719, 1, 1 }, + { ahd_patch19_func, 757, 1, 1 }, + { ahd_patch1_func, 768, 1, 2 }, + { ahd_patch0_func, 769, 1, 1 }, + { ahd_patch7_func, 785, 3, 1 }, + { ahd_patch1_func, 789, 1, 2 }, + { ahd_patch0_func, 790, 1, 1 }, + { ahd_patch1_func, 792, 1, 2 }, + { ahd_patch0_func, 793, 1, 1 }, + { ahd_patch1_func, 796, 1, 2 }, + { ahd_patch0_func, 797, 1, 1 }, + { ahd_patch22_func, 799, 1, 2 }, + { ahd_patch0_func, 800, 2, 1 }, + { ahd_patch23_func, 803, 4, 2 }, + { ahd_patch0_func, 807, 1, 1 }, + { ahd_patch23_func, 815, 11, 1 } }; static struct cs { uint16_t begin; uint16_t end; } critical_sections[] = { - { 17, 28 }, - { 29, 30 }, + { 17, 30 }, { 47, 58 }, { 61, 63 }, { 65, 66 }, { 72, 92 }, - { 110, 137 }, - { 138, 175 }, - { 180, 188 }, - { 213, 264 }, - { 425, 433 }, - { 443, 445 }, - { 448, 457 }, - { 709, 739 }, - { 749, 753 } + { 110, 142 }, + { 143, 180 }, + { 185, 193 }, + { 218, 274 }, + { 435, 443 }, + { 453, 455 }, + { 458, 467 }, + { 719, 749 }, + { 759, 763 } }; static const int num_critical_sections = sizeof(critical_sections) diff --git a/drivers/scsi/aic7xxx/aicasm/aicasm.c b/drivers/scsi/aic7xxx/aicasm/aicasm.c index f936b691232..924102720b1 100644 --- a/drivers/scsi/aic7xxx/aicasm/aicasm.c +++ b/drivers/scsi/aic7xxx/aicasm/aicasm.c @@ -37,7 +37,7 @@ * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGES. * - * $Id: //depot/aic7xxx/aic7xxx/aicasm/aicasm.c#22 $ + * $Id: //depot/aic7xxx/aic7xxx/aicasm/aicasm.c#23 $ * * $FreeBSD$ */ @@ -609,10 +609,10 @@ output_listing(char *ifilename) while (line < cur_instr->srcline) { fgets(buf, sizeof(buf), ifile); - fprintf(listfile, "\t\t%s", buf); + fprintf(listfile, " \t%s", buf); line++; } - fprintf(listfile, "%03x %02x%02x%02x%02x", instrptr, + fprintf(listfile, "%04x %02x%02x%02x%02x", instrptr, #ifdef __LITTLE_ENDIAN cur_instr->format.bytes[0], cur_instr->format.bytes[1], @@ -624,14 +624,23 @@ output_listing(char *ifilename) cur_instr->format.bytes[1], cur_instr->format.bytes[0]); #endif - fgets(buf, sizeof(buf), ifile); - fprintf(listfile, "\t%s", buf); - line++; + /* + * Macro expansions can cause several instructions + * to be output for a single source line. Only + * advance the line once in these cases. + */ + if (line == cur_instr->srcline) { + fgets(buf, sizeof(buf), ifile); + fprintf(listfile, "\t%s", buf); + line++; + } else { + fprintf(listfile, "\n"); + } instrptr++; } /* Dump the remainder of the file */ while(fgets(buf, sizeof(buf), ifile) != NULL) - fprintf(listfile, "\t\t%s", buf); + fprintf(listfile, " %s", buf); fclose(ifile); } diff --git a/drivers/scsi/aic7xxx/aicasm/aicasm_gram.y b/drivers/scsi/aic7xxx/aicasm/aicasm_gram.y index 67e046d9662..c328596def3 100644 --- a/drivers/scsi/aic7xxx/aicasm/aicasm_gram.y +++ b/drivers/scsi/aic7xxx/aicasm/aicasm_gram.y @@ -38,7 +38,7 @@ * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGES. * - * $Id: //depot/aic7xxx/aic7xxx/aicasm/aicasm_gram.y#29 $ + * $Id: //depot/aic7xxx/aic7xxx/aicasm/aicasm_gram.y#30 $ * * $FreeBSD$ */ @@ -157,6 +157,8 @@ static int is_download_const(expression_t *immed); %token T_END_CS +%token T_PAD_PAGE + %token T_FIELD %token T_ENUM @@ -189,6 +191,10 @@ static int is_download_const(expression_t *immed); %token <value> T_OR +/* 16 bit extensions */ +%token <value> T_OR16 T_AND16 T_XOR16 T_ADD16 +%token <value> T_ADC16 T_MVI16 T_TEST16 T_CMP16 T_CMPXCHG + %token T_RET %token T_NOP @@ -207,7 +213,7 @@ static int is_download_const(expression_t *immed); %type <expression> expression immediate immediate_or_a -%type <value> export ret f1_opcode f2_opcode jmp_jc_jnc_call jz_jnz je_jne +%type <value> export ret f1_opcode f2_opcode f4_opcode jmp_jc_jnc_call jz_jnz je_jne %type <value> mode_value mode_list macro_arglist @@ -1304,6 +1310,15 @@ f2_opcode: | T_ROR { $$ = AIC_OP_ROR; } ; +f4_opcode: + T_OR16 { $$ = AIC_OP_OR16; } +| T_AND16 { $$ = AIC_OP_AND16; } +| T_XOR16 { $$ = AIC_OP_XOR16; } +| T_ADD16 { $$ = AIC_OP_ADD16; } +| T_ADC16 { $$ = AIC_OP_ADC16; } +| T_MVI16 { $$ = AIC_OP_MVI16; } +; + code: f2_opcode destination ',' expression opt_source ret ';' { diff --git a/drivers/scsi/aic7xxx/aicasm/aicasm_insformat.h b/drivers/scsi/aic7xxx/aicasm/aicasm_insformat.h index e64f802bbaa..9df9e2ce353 100644 --- a/drivers/scsi/aic7xxx/aicasm/aicasm_insformat.h +++ b/drivers/scsi/aic7xxx/aicasm/aicasm_insformat.h @@ -37,13 +37,14 @@ * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGES. * - * $Id: //depot/aic7xxx/aic7xxx/aicasm/aicasm_insformat.h#11 $ + * $Id: //depot/aic7xxx/aic7xxx/aicasm/aicasm_insformat.h#12 $ * * $FreeBSD$ */ #include <asm/byteorder.h> +/* 8bit ALU logic operations */ struct ins_format1 { #ifdef __LITTLE_ENDIAN uint32_t immediate : 8, @@ -62,6 +63,7 @@ struct ins_format1 { #endif }; +/* 8bit ALU shift/rotate operations */ struct ins_format2 { #ifdef __LITTLE_ENDIAN uint32_t shift_control : 8, @@ -80,6 +82,7 @@ struct ins_format2 { #endif }; +/* 8bit branch control operations */ struct ins_format3 { #ifdef __LITTLE_ENDIAN uint32_t immediate : 8, @@ -96,10 +99,68 @@ struct ins_format3 { #endif }; +/* 16bit ALU logic operations */ +struct ins_format4 { +#ifdef __LITTLE_ENDIAN + uint32_t opcode_ext : 8, + source : 9, + destination : 9, + ret : 1, + opcode : 4, + parity : 1; +#else + uint32_t parity : 1, + opcode : 4, + ret : 1, + destination : 9, + source : 9, + opcode_ext : 8; +#endif +}; + +/* 16bit branch control operations */ +struct ins_format5 { +#ifdef __LITTLE_ENDIAN + uint32_t opcode_ext : 8, + source : 9, + address : 10, + opcode : 4, + parity : 1; +#else + uint32_t parity : 1, + opcode : 4, + address : 10, + source : 9, + opcode_ext : 8; +#endif +}; + +/* Far branch operations */ +struct ins_format6 { +#ifdef __LITTLE_ENDIAN + uint32_t page : 3, + opcode_ext : 5, + source : 9, + address : 10, + opcode : 4, + parity : 1; +#else + uint32_t parity : 1, + opcode : 4, + address : 10, + source : 9, + opcode_ext : 5, + page : 3; +#endif +}; + union ins_formats { struct ins_format1 format1; struct ins_format2 format2; struct ins_format3 format3; + struct ins_format4 format4; + struct ins_format5 format5; + struct ins_format6 format6; uint8_t bytes[4]; uint32_t integer; }; @@ -118,6 +179,8 @@ struct instruction { #define AIC_OP_ROL 0x5 #define AIC_OP_BMOV 0x6 +#define AIC_OP_MVI16 0x7 + #define AIC_OP_JMP 0x8 #define AIC_OP_JC 0x9 #define AIC_OP_JNC 0xa @@ -131,3 +194,26 @@ struct instruction { #define AIC_OP_SHL 0x10 #define AIC_OP_SHR 0x20 #define AIC_OP_ROR 0x30 + +/* 16bit Ops. Low byte main opcode. High byte extended opcode. */ +#define AIC_OP_OR16 0x8005 +#define AIC_OP_AND16 0x8105 +#define AIC_OP_XOR16 0x8205 +#define AIC_OP_ADD16 0x8305 +#define AIC_OP_ADC16 0x8405 +#define AIC_OP_JNE16 0x8805 +#define AIC_OP_JNZ16 0x8905 +#define AIC_OP_JE16 0x8C05 +#define AIC_OP_JZ16 0x8B05 +#define AIC_OP_JMP16 0x9005 +#define AIC_OP_JC16 0x9105 +#define AIC_OP_JNC16 0x9205 +#define AIC_OP_CALL16 0x9305 +#define AIC_OP_CALL16 0x9305 + +/* Page extension is low three bits of second opcode byte. */ +#define AIC_OP_JMPF 0xA005 +#define AIC_OP_CALLF 0xB005 +#define AIC_OP_JCF 0xC005 +#define AIC_OP_JNCF 0xD005 +#define AIC_OP_CMPXCHG 0xE005 diff --git a/drivers/scsi/aic7xxx/aicasm/aicasm_scan.l b/drivers/scsi/aic7xxx/aicasm/aicasm_scan.l index 45c0b233d0b..7c3983f868a 100644 --- a/drivers/scsi/aic7xxx/aicasm/aicasm_scan.l +++ b/drivers/scsi/aic7xxx/aicasm/aicasm_scan.l @@ -38,7 +38,7 @@ * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGES. * - * $Id: //depot/aic7xxx/aic7xxx/aicasm/aicasm_scan.l#19 $ + * $Id: //depot/aic7xxx/aic7xxx/aicasm/aicasm_scan.l#20 $ * * $FreeBSD$ */ @@ -132,7 +132,7 @@ if[ \t]*\( { *string_buf_ptr++ = *yptr++; } } - +else { return T_ELSE; } VERSION { return T_VERSION; } PREFIX { return T_PREFIX; } PATCH_ARG_LIST { return T_PATCH_ARG_LIST; } @@ -173,10 +173,6 @@ RW|RO|WO { yylval.value = WO; return T_MODE; } -BEGIN_CRITICAL { return T_BEGIN_CS; } -END_CRITICAL { return T_END_CS; } -SET_SRC_MODE { return T_SET_SRC_MODE; } -SET_DST_MODE { return T_SET_DST_MODE; } field { return T_FIELD; } enum { return T_ENUM; } mask { return T_MASK; } @@ -192,6 +188,13 @@ none { return T_NONE; } sindex { return T_SINDEX; } A { return T_A; } + /* Instruction Formatting */ +PAD_PAGE { return T_PAD_PAGE; } +BEGIN_CRITICAL { return T_BEGIN_CS; } +END_CRITICAL { return T_END_CS; } +SET_SRC_MODE { return T_SET_SRC_MODE; } +SET_DST_MODE { return T_SET_DST_MODE; } + /* Opcodes */ shl { return T_SHL; } shr { return T_SHR; } @@ -223,7 +226,17 @@ and { return T_AND; } or { return T_OR; } ret { return T_RET; } nop { return T_NOP; } -else { return T_ELSE; } + + /* ARP2 16bit extensions */ +or16 { return T_OR16; } +and16 { return T_AND16; } +xor16 { return T_XOR16; } +add16 { return T_ADD16; } +adc16 { return T_ADC16; } +mvi16 { return T_MVI16; } +test16 { return T_TEST16; } +cmp16 { return T_CMP16; } +cmpxchg { return T_CMPXCHG; } /* Allowed Symbols */ \<\< { return T_EXPR_LSHIFT; } diff --git a/drivers/scsi/dc395x.c b/drivers/scsi/dc395x.c index c8a32cf47d7..cbf825263f3 100644 --- a/drivers/scsi/dc395x.c +++ b/drivers/scsi/dc395x.c @@ -246,6 +246,7 @@ struct ScsiReqBlk { * total_xfer_length in xferred. These values are restored in * pci_unmap_srb_sense. This is the only place xferred is used. */ + unsigned char *virt_addr_req; /* Saved virtual address of the request buffer */ u32 xferred; /* Saved copy of total_xfer_length */ u16 state; @@ -2017,7 +2018,7 @@ static void sg_update_list(struct ScsiReqBlk *srb, u32 left) sg_verify_length(srb); /* we need the corresponding virtual address */ - if (!segment) { + if (!segment || (srb->flag & AUTO_REQSENSE)) { srb->virt_addr += xferred; return; } @@ -3318,6 +3319,7 @@ static void pci_unmap_srb_sense(struct AdapterCtlBlk *acb, srb->segment_x[DC395x_MAX_SG_LISTENTRY - 1].address; srb->segment_x[0].length = srb->segment_x[DC395x_MAX_SG_LISTENTRY - 1].length; + srb->virt_addr = srb->virt_addr_req; } @@ -3711,6 +3713,8 @@ static void request_sense(struct AdapterCtlBlk *acb, struct DeviceCtlBlk *dcb, srb->xferred = srb->total_xfer_length; /* srb->segment_x : a one entry of S/G list table */ srb->total_xfer_length = sizeof(cmd->sense_buffer); + srb->virt_addr_req = srb->virt_addr; + srb->virt_addr = cmd->sense_buffer; srb->segment_x[0].length = sizeof(cmd->sense_buffer); /* Map sense buffer */ srb->segment_x[0].address = diff --git a/drivers/scsi/ibmvscsi/ibmvscsi.c b/drivers/scsi/ibmvscsi/ibmvscsi.c index 822b9fa706f..eaefeddb2b4 100644 --- a/drivers/scsi/ibmvscsi/ibmvscsi.c +++ b/drivers/scsi/ibmvscsi/ibmvscsi.c @@ -87,7 +87,7 @@ static int max_channel = 3; static int init_timeout = 5; static int max_requests = 50; -#define IBMVSCSI_VERSION "1.5.7" +#define IBMVSCSI_VERSION "1.5.8" MODULE_DESCRIPTION("IBM Virtual SCSI"); MODULE_AUTHOR("Dave Boutcher"); @@ -534,7 +534,6 @@ static int map_data_for_srp_cmd(struct scsi_cmnd *cmd, static int ibmvscsi_send_srp_event(struct srp_event_struct *evt_struct, struct ibmvscsi_host_data *hostdata) { - struct scsi_cmnd *cmnd; u64 *crq_as_u64 = (u64 *) &evt_struct->crq; int rc; @@ -544,19 +543,8 @@ static int ibmvscsi_send_srp_event(struct srp_event_struct *evt_struct, * can handle more requests (can_queue) when we actually can't */ if ((evt_struct->crq.format == VIOSRP_SRP_FORMAT) && - (atomic_dec_if_positive(&hostdata->request_limit) < 0)) { - /* See if the adapter is disabled */ - if (atomic_read(&hostdata->request_limit) < 0) - goto send_error; - - printk(KERN_WARNING - "ibmvscsi: Warning, request_limit exceeded\n"); - unmap_cmd_data(&evt_struct->iu.srp.cmd, - evt_struct, - hostdata->dev); - free_event_struct(&hostdata->pool, evt_struct); - return SCSI_MLQUEUE_HOST_BUSY; - } + (atomic_dec_if_positive(&hostdata->request_limit) < 0)) + goto send_error; /* Copy the IU into the transfer area */ *evt_struct->xfer_iu = evt_struct->iu; @@ -572,7 +560,7 @@ static int ibmvscsi_send_srp_event(struct srp_event_struct *evt_struct, ibmvscsi_send_crq(hostdata, crq_as_u64[0], crq_as_u64[1])) != 0) { list_del(&evt_struct->list); - printk(KERN_ERR "ibmvscsi: failed to send event struct rc %d\n", + printk(KERN_ERR "ibmvscsi: send error %d\n", rc); goto send_error; } @@ -582,14 +570,8 @@ static int ibmvscsi_send_srp_event(struct srp_event_struct *evt_struct, send_error: unmap_cmd_data(&evt_struct->iu.srp.cmd, evt_struct, hostdata->dev); - if ((cmnd = evt_struct->cmnd) != NULL) { - cmnd->result = DID_ERROR << 16; - evt_struct->cmnd_done(cmnd); - } else if (evt_struct->done) - evt_struct->done(evt_struct); - free_event_struct(&hostdata->pool, evt_struct); - return 0; + return SCSI_MLQUEUE_HOST_BUSY; } /** @@ -802,7 +784,8 @@ static void login_rsp(struct srp_event_struct *evt_struct) case SRP_LOGIN_RSP_TYPE: /* it worked! */ break; case SRP_LOGIN_REJ_TYPE: /* refused! */ - printk(KERN_INFO "ibmvscsi: SRP_LOGIN_REQ rejected\n"); + printk(KERN_INFO "ibmvscsi: SRP_LOGIN_REJ reason %u\n", + evt_struct->xfer_iu->srp.login_rej.reason); /* Login failed. */ atomic_set(&hostdata->request_limit, -1); return; @@ -834,6 +817,9 @@ static void login_rsp(struct srp_event_struct *evt_struct) return; } + /* If we had any pending I/Os, kick them */ + scsi_unblock_requests(hostdata->host); + send_mad_adapter_info(hostdata); return; } @@ -862,6 +848,7 @@ static int send_srp_login(struct ibmvscsi_host_data *hostdata) init_timeout * HZ); login = &evt_struct->iu.srp.login_req; + memset(login, 0x00, sizeof(struct srp_login_req)); login->type = SRP_LOGIN_REQ_TYPE; login->max_requested_initiator_to_target_iulen = sizeof(union srp_iu); login->required_buffer_formats = 0x0006; @@ -1122,7 +1109,7 @@ static int ibmvscsi_eh_device_reset_handler(struct scsi_cmnd *cmd) * purge_requests: Our virtual adapter just shut down. purge any sent requests * @hostdata: the adapter */ -static void purge_requests(struct ibmvscsi_host_data *hostdata) +static void purge_requests(struct ibmvscsi_host_data *hostdata, int error_code) { struct srp_event_struct *tmp_evt, *pos; unsigned long flags; @@ -1131,7 +1118,7 @@ static void purge_requests(struct ibmvscsi_host_data *hostdata) list_for_each_entry_safe(tmp_evt, pos, &hostdata->sent, list) { list_del(&tmp_evt->list); if (tmp_evt->cmnd) { - tmp_evt->cmnd->result = (DID_ERROR << 16); + tmp_evt->cmnd->result = (error_code << 16); unmap_cmd_data(&tmp_evt->iu.srp.cmd, tmp_evt, tmp_evt->hostdata->dev); @@ -1186,12 +1173,30 @@ void ibmvscsi_handle_crq(struct viosrp_crq *crq, printk(KERN_ERR "ibmvscsi: unknown crq message type\n"); } return; - case 0xFF: /* Hypervisor telling us the connection is closed */ - printk(KERN_INFO "ibmvscsi: Virtual adapter failed!\n"); + case 0xFF: /* Hypervisor telling us the connection is closed */ + scsi_block_requests(hostdata->host); + if (crq->format == 0x06) { + /* We need to re-setup the interpartition connection */ + printk(KERN_INFO + "ibmvscsi: Re-enabling adapter!\n"); + purge_requests(hostdata, DID_REQUEUE); + if (ibmvscsi_reenable_crq_queue(&hostdata->queue, + hostdata) == 0) + if (ibmvscsi_send_crq(hostdata, + 0xC001000000000000LL, 0)) + printk(KERN_ERR + "ibmvscsi: transmit error after" + " enable\n"); + } else { + printk(KERN_INFO + "ibmvscsi: Virtual adapter failed rc %d!\n", + crq->format); - atomic_set(&hostdata->request_limit, -1); - purge_requests(hostdata); - ibmvscsi_reset_crq_queue(&hostdata->queue, hostdata); + atomic_set(&hostdata->request_limit, -1); + purge_requests(hostdata, DID_ERROR); + ibmvscsi_reset_crq_queue(&hostdata->queue, hostdata); + } + scsi_unblock_requests(hostdata->host); return; case 0x80: /* real payload */ break; diff --git a/drivers/scsi/ibmvscsi/ibmvscsi.h b/drivers/scsi/ibmvscsi/ibmvscsi.h index 5b0edd1f192..4550d71e474 100644 --- a/drivers/scsi/ibmvscsi/ibmvscsi.h +++ b/drivers/scsi/ibmvscsi/ibmvscsi.h @@ -103,6 +103,9 @@ void ibmvscsi_release_crq_queue(struct crq_queue *queue, int ibmvscsi_reset_crq_queue(struct crq_queue *queue, struct ibmvscsi_host_data *hostdata); +int ibmvscsi_reenable_crq_queue(struct crq_queue *queue, + struct ibmvscsi_host_data *hostdata); + void ibmvscsi_handle_crq(struct viosrp_crq *crq, struct ibmvscsi_host_data *hostdata); int ibmvscsi_send_crq(struct ibmvscsi_host_data *hostdata, diff --git a/drivers/scsi/ibmvscsi/iseries_vscsi.c b/drivers/scsi/ibmvscsi/iseries_vscsi.c index ce15d9e3962..7eed0b09817 100644 --- a/drivers/scsi/ibmvscsi/iseries_vscsi.c +++ b/drivers/scsi/ibmvscsi/iseries_vscsi.c @@ -124,6 +124,19 @@ int ibmvscsi_reset_crq_queue(struct crq_queue *queue, } /** + * reenable_crq_queue: - reenables a crq after a failure + * @queue: crq_queue to initialize and register + * @hostdata: ibmvscsi_host_data of host + * + * no-op for iSeries + */ +int ibmvscsi_reenable_crq_queue(struct crq_queue *queue, + struct ibmvscsi_host_data *hostdata) +{ + return 0; +} + +/** * ibmvscsi_send_crq: - Send a CRQ * @hostdata: the adapter * @word1: the first 64 bits of the data diff --git a/drivers/scsi/ibmvscsi/rpa_vscsi.c b/drivers/scsi/ibmvscsi/rpa_vscsi.c index 75db2f5c545..f47dd87c05e 100644 --- a/drivers/scsi/ibmvscsi/rpa_vscsi.c +++ b/drivers/scsi/ibmvscsi/rpa_vscsi.c @@ -281,6 +281,28 @@ int ibmvscsi_init_crq_queue(struct crq_queue *queue, } /** + * reenable_crq_queue: - reenables a crq after + * @queue: crq_queue to initialize and register + * @hostdata: ibmvscsi_host_data of host + * + */ +int ibmvscsi_reenable_crq_queue(struct crq_queue *queue, + struct ibmvscsi_host_data *hostdata) +{ + int rc; + struct vio_dev *vdev = to_vio_dev(hostdata->dev); + + /* Re-enable the CRQ */ + do { + rc = plpar_hcall_norets(H_ENABLE_CRQ, vdev->unit_address); + } while ((rc == H_InProgress) || (rc == H_Busy) || (H_isLongBusy(rc))); + + if (rc) + printk(KERN_ERR "ibmvscsi: Error %d enabling adapter\n", rc); + return rc; +} + +/** * reset_crq_queue: - resets a crq after a failure * @queue: crq_queue to initialize and register * @hostdata: ibmvscsi_host_data of host diff --git a/drivers/scsi/ips.c b/drivers/scsi/ips.c index e5e1ca44e1e..86c546164da 100644 --- a/drivers/scsi/ips.c +++ b/drivers/scsi/ips.c @@ -3499,6 +3499,7 @@ ips_map_status(ips_ha_t * ha, ips_scb_t * scb, ips_stat_t * sp) int device_error; uint32_t transfer_len; IPS_DCDB_TABLE_TAPE *tapeDCDB; + IPS_SCSI_INQ_DATA inquiryData; METHOD_TRACE("ips_map_status", 1); @@ -3557,13 +3558,13 @@ ips_map_status(ips_ha_t * ha, ips_scb_t * scb, ips_stat_t * sp) errcode = DID_OK; /* Restrict access to physical DASD */ - if ((scb->scsi_cmd->cmnd[0] == INQUIRY) && - ((((char *) scb->scsi_cmd-> - buffer)[0] & 0x1f) == TYPE_DISK)) { - /* underflow -- no error */ - /* restrict access to physical DASD */ - errcode = DID_TIME_OUT; - break; + if (scb->scsi_cmd->cmnd[0] == INQUIRY) { + ips_scmd_buf_read(scb->scsi_cmd, + &inquiryData, sizeof (inquiryData)); + if ((inquiryData.DeviceType & 0x1f) == TYPE_DISK) { + errcode = DID_TIME_OUT; + break; + } } } else errcode = DID_ERROR; @@ -4135,6 +4136,7 @@ ips_chkstatus(ips_ha_t * ha, IPS_STATUS * pstatus) uint8_t basic_status; uint8_t ext_status; int errcode; + IPS_SCSI_INQ_DATA inquiryData; METHOD_TRACE("ips_chkstatus", 1); @@ -4255,11 +4257,11 @@ ips_chkstatus(ips_ha_t * ha, IPS_STATUS * pstatus) scb->scsi_cmd->result = errcode << 16; } else { /* bus == 0 */ /* restrict access to physical drives */ - if ((scb->scsi_cmd->cmnd[0] == INQUIRY) && - ((((char *) scb->scsi_cmd->buffer)[0] & 0x1f) == - TYPE_DISK)) { - - scb->scsi_cmd->result = DID_TIME_OUT << 16; + if (scb->scsi_cmd->cmnd[0] == INQUIRY) { + ips_scmd_buf_read(scb->scsi_cmd, + &inquiryData, sizeof (inquiryData)); + if ((inquiryData.DeviceType & 0x1f) == TYPE_DISK) + scb->scsi_cmd->result = DID_TIME_OUT << 16; } } /* else */ } else { /* recovered error / success */ @@ -5012,7 +5014,7 @@ ips_init_copperhead(ips_ha_t * ha) break; /* Delay for 1 Second */ - MDELAY(IPS_ONE_SEC); + msleep(IPS_ONE_SEC); } if (j >= 45) @@ -5038,7 +5040,7 @@ ips_init_copperhead(ips_ha_t * ha) break; /* Delay for 1 Second */ - MDELAY(IPS_ONE_SEC); + msleep(IPS_ONE_SEC); } if (j >= 240) @@ -5056,7 +5058,7 @@ ips_init_copperhead(ips_ha_t * ha) break; /* Delay for 1 Second */ - MDELAY(IPS_ONE_SEC); + msleep(IPS_ONE_SEC); } if (i >= 240) @@ -5106,7 +5108,7 @@ ips_init_copperhead_memio(ips_ha_t * ha) break; /* Delay for 1 Second */ - MDELAY(IPS_ONE_SEC); + msleep(IPS_ONE_SEC); } if (j >= 45) @@ -5132,7 +5134,7 @@ ips_init_copperhead_memio(ips_ha_t * ha) break; /* Delay for 1 Second */ - MDELAY(IPS_ONE_SEC); + msleep(IPS_ONE_SEC); } if (j >= 240) @@ -5150,7 +5152,7 @@ ips_init_copperhead_memio(ips_ha_t * ha) break; /* Delay for 1 Second */ - MDELAY(IPS_ONE_SEC); + msleep(IPS_ONE_SEC); } if (i >= 240) @@ -5202,7 +5204,7 @@ ips_init_morpheus(ips_ha_t * ha) break; /* Delay for 1 Second */ - MDELAY(IPS_ONE_SEC); + msleep(IPS_ONE_SEC); } if (i >= 45) { @@ -5228,7 +5230,7 @@ ips_init_morpheus(ips_ha_t * ha) if (Post != 0x4F00) break; /* Delay for 1 Second */ - MDELAY(IPS_ONE_SEC); + msleep(IPS_ONE_SEC); } if (i >= 120) { @@ -5258,7 +5260,7 @@ ips_init_morpheus(ips_ha_t * ha) break; /* Delay for 1 Second */ - MDELAY(IPS_ONE_SEC); + msleep(IPS_ONE_SEC); } if (i >= 240) { @@ -5318,12 +5320,12 @@ ips_reset_copperhead(ips_ha_t * ha) outb(IPS_BIT_RST, ha->io_addr + IPS_REG_SCPR); /* Delay for 1 Second */ - MDELAY(IPS_ONE_SEC); + msleep(IPS_ONE_SEC); outb(0, ha->io_addr + IPS_REG_SCPR); /* Delay for 1 Second */ - MDELAY(IPS_ONE_SEC); + msleep(IPS_ONE_SEC); if ((*ha->func.init) (ha)) break; @@ -5363,12 +5365,12 @@ ips_reset_copperhead_memio(ips_ha_t * ha) writeb(IPS_BIT_RST, ha->mem_ptr + IPS_REG_SCPR); /* Delay for 1 Second */ - MDELAY(IPS_ONE_SEC); + msleep(IPS_ONE_SEC); writeb(0, ha->mem_ptr + IPS_REG_SCPR); /* Delay for 1 Second */ - MDELAY(IPS_ONE_SEC); + msleep(IPS_ONE_SEC); if ((*ha->func.init) (ha)) break; @@ -5409,7 +5411,7 @@ ips_reset_morpheus(ips_ha_t * ha) writel(0x80000000, ha->mem_ptr + IPS_REG_I960_IDR); /* Delay for 5 Seconds */ - MDELAY(5 * IPS_ONE_SEC); + msleep(5 * IPS_ONE_SEC); /* Do a PCI config read to wait for adapter */ pci_read_config_byte(ha->pcidev, 4, &junk); diff --git a/drivers/scsi/libata-scsi.c b/drivers/scsi/libata-scsi.c index cfbceb50471..07b1e7cc61d 100644 --- a/drivers/scsi/libata-scsi.c +++ b/drivers/scsi/libata-scsi.c @@ -1700,6 +1700,31 @@ static unsigned int ata_msense_rw_recovery(u8 **ptr_io, const u8 *last) return sizeof(def_rw_recovery_mpage); } +/* + * We can turn this into a real blacklist if it's needed, for now just + * blacklist any Maxtor BANC1G10 revision firmware + */ +static int ata_dev_supports_fua(u16 *id) +{ + unsigned char model[41], fw[9]; + + if (!ata_id_has_fua(id)) + return 0; + + model[40] = '\0'; + fw[8] = '\0'; + + ata_dev_id_string(id, model, ATA_ID_PROD_OFS, sizeof(model) - 1); + ata_dev_id_string(id, fw, ATA_ID_FW_REV_OFS, sizeof(fw) - 1); + + if (strncmp(model, "Maxtor", 6)) + return 1; + if (strncmp(fw, "BANC1G10", 8)) + return 1; + + return 0; /* blacklisted */ +} + /** * ata_scsiop_mode_sense - Simulate MODE SENSE 6, 10 commands * @args: device IDENTIFY data / SCSI command of interest. @@ -1797,7 +1822,7 @@ unsigned int ata_scsiop_mode_sense(struct ata_scsi_args *args, u8 *rbuf, return 0; dpofua = 0; - if (ata_id_has_fua(args->id) && dev->flags & ATA_DFLAG_LBA48 && + if (ata_dev_supports_fua(args->id) && dev->flags & ATA_DFLAG_LBA48 && (!(dev->flags & ATA_DFLAG_PIO) || dev->multi_count)) dpofua = 1 << 4; diff --git a/drivers/scsi/megaraid/megaraid_sas.c b/drivers/scsi/megaraid/megaraid_sas.c index 511ed52a580..a487f414960 100644 --- a/drivers/scsi/megaraid/megaraid_sas.c +++ b/drivers/scsi/megaraid/megaraid_sas.c @@ -10,7 +10,7 @@ * 2 of the License, or (at your option) any later version. * * FILE : megaraid_sas.c - * Version : v00.00.02.00-rc4 + * Version : v00.00.02.02 * * Authors: * Sreenivas Bagalkote <Sreenivas.Bagalkote@lsil.com> @@ -55,13 +55,13 @@ static struct pci_device_id megasas_pci_table[] = { { PCI_VENDOR_ID_LSI_LOGIC, - PCI_DEVICE_ID_LSI_SAS1064R, + PCI_DEVICE_ID_LSI_SAS1064R, // xscale IOP PCI_ANY_ID, PCI_ANY_ID, }, { PCI_VENDOR_ID_DELL, - PCI_DEVICE_ID_DELL_PERC5, + PCI_DEVICE_ID_DELL_PERC5, // xscale IOP PCI_ANY_ID, PCI_ANY_ID, }, @@ -119,12 +119,18 @@ megasas_return_cmd(struct megasas_instance *instance, struct megasas_cmd *cmd) spin_unlock_irqrestore(&instance->cmd_pool_lock, flags); } + +/** +* The following functions are defined for xscale +* (deviceid : 1064R, PERC5) controllers +*/ + /** - * megasas_enable_intr - Enables interrupts + * megasas_enable_intr_xscale - Enables interrupts * @regs: MFI register set */ static inline void -megasas_enable_intr(struct megasas_register_set __iomem * regs) +megasas_enable_intr_xscale(struct megasas_register_set __iomem * regs) { writel(1, &(regs)->outbound_intr_mask); @@ -133,13 +139,73 @@ megasas_enable_intr(struct megasas_register_set __iomem * regs) } /** + * megasas_read_fw_status_reg_xscale - returns the current FW status value + * @regs: MFI register set + */ +static u32 +megasas_read_fw_status_reg_xscale(struct megasas_register_set __iomem * regs) +{ + return readl(&(regs)->outbound_msg_0); +} +/** + * megasas_clear_interrupt_xscale - Check & clear interrupt + * @regs: MFI register set + */ +static int +megasas_clear_intr_xscale(struct megasas_register_set __iomem * regs) +{ + u32 status; + /* + * Check if it is our interrupt + */ + status = readl(®s->outbound_intr_status); + + if (!(status & MFI_OB_INTR_STATUS_MASK)) { + return 1; + } + + /* + * Clear the interrupt by writing back the same value + */ + writel(status, ®s->outbound_intr_status); + + return 0; +} + +/** + * megasas_fire_cmd_xscale - Sends command to the FW + * @frame_phys_addr : Physical address of cmd + * @frame_count : Number of frames for the command + * @regs : MFI register set + */ +static inline void +megasas_fire_cmd_xscale(dma_addr_t frame_phys_addr,u32 frame_count, struct megasas_register_set __iomem *regs) +{ + writel((frame_phys_addr >> 3)|(frame_count), + &(regs)->inbound_queue_port); +} + +static struct megasas_instance_template megasas_instance_template_xscale = { + + .fire_cmd = megasas_fire_cmd_xscale, + .enable_intr = megasas_enable_intr_xscale, + .clear_intr = megasas_clear_intr_xscale, + .read_fw_status_reg = megasas_read_fw_status_reg_xscale, +}; + +/** +* This is the end of set of functions & definitions specific +* to xscale (deviceid : 1064R, PERC5) controllers +*/ + +/** * megasas_disable_intr - Disables interrupts * @regs: MFI register set */ static inline void megasas_disable_intr(struct megasas_register_set __iomem * regs) { - u32 mask = readl(®s->outbound_intr_mask) & (~0x00000001); + u32 mask = 0x1f; writel(mask, ®s->outbound_intr_mask); /* Dummy readl to force pci flush */ @@ -167,8 +233,7 @@ megasas_issue_polled(struct megasas_instance *instance, struct megasas_cmd *cmd) /* * Issue the frame using inbound queue port */ - writel(cmd->frame_phys_addr >> 3, - &instance->reg_set->inbound_queue_port); + instance->instancet->fire_cmd(cmd->frame_phys_addr ,0,instance->reg_set); /* * Wait for cmd_status to change @@ -198,8 +263,7 @@ megasas_issue_blocked_cmd(struct megasas_instance *instance, { cmd->cmd_status = ENODATA; - writel(cmd->frame_phys_addr >> 3, - &instance->reg_set->inbound_queue_port); + instance->instancet->fire_cmd(cmd->frame_phys_addr ,0,instance->reg_set); wait_event(instance->int_cmd_wait_q, (cmd->cmd_status != ENODATA)); @@ -242,8 +306,7 @@ megasas_issue_blocked_abort_cmd(struct megasas_instance *instance, cmd->sync_cmd = 1; cmd->cmd_status = 0xFF; - writel(cmd->frame_phys_addr >> 3, - &instance->reg_set->inbound_queue_port); + instance->instancet->fire_cmd(cmd->frame_phys_addr ,0,instance->reg_set); /* * Wait for this cmd to complete @@ -558,112 +621,29 @@ megasas_build_ldio(struct megasas_instance *instance, struct scsi_cmnd *scp, } /** - * megasas_build_cmd - Prepares a command packet - * @instance: Adapter soft state - * @scp: SCSI command - * @frame_count: [OUT] Number of frames used to prepare this command + * megasas_is_ldio - Checks if the cmd is for logical drive + * @scmd: SCSI command + * + * Called by megasas_queue_command to find out if the command to be queued + * is a logical drive command */ -static struct megasas_cmd *megasas_build_cmd(struct megasas_instance - *instance, - struct scsi_cmnd *scp, - int *frame_count) +static inline int megasas_is_ldio(struct scsi_cmnd *cmd) { - u32 logical_cmd; - struct megasas_cmd *cmd; - - /* - * Find out if this is logical or physical drive command. - */ - logical_cmd = MEGASAS_IS_LOGICAL(scp); - - /* - * Logical drive command - */ - if (logical_cmd) { - - if (scp->device->id >= MEGASAS_MAX_LD) { - scp->result = DID_BAD_TARGET << 16; - return NULL; - } - - switch (scp->cmnd[0]) { - - case READ_10: - case WRITE_10: - case READ_12: - case WRITE_12: - case READ_6: - case WRITE_6: - case READ_16: - case WRITE_16: - /* - * Fail for LUN > 0 - */ - if (scp->device->lun) { - scp->result = DID_BAD_TARGET << 16; - return NULL; - } - - cmd = megasas_get_cmd(instance); - - if (!cmd) { - scp->result = DID_IMM_RETRY << 16; - return NULL; - } - - *frame_count = megasas_build_ldio(instance, scp, cmd); - - if (!(*frame_count)) { - megasas_return_cmd(instance, cmd); - return NULL; - } - - return cmd; - - default: - /* - * Fail for LUN > 0 - */ - if (scp->device->lun) { - scp->result = DID_BAD_TARGET << 16; - return NULL; - } - - cmd = megasas_get_cmd(instance); - - if (!cmd) { - scp->result = DID_IMM_RETRY << 16; - return NULL; - } - - *frame_count = megasas_build_dcdb(instance, scp, cmd); - - if (!(*frame_count)) { - megasas_return_cmd(instance, cmd); - return NULL; - } - - return cmd; - } - } else { - cmd = megasas_get_cmd(instance); - - if (!cmd) { - scp->result = DID_IMM_RETRY << 16; - return NULL; - } - - *frame_count = megasas_build_dcdb(instance, scp, cmd); - - if (!(*frame_count)) { - megasas_return_cmd(instance, cmd); - return NULL; - } - - return cmd; + if (!MEGASAS_IS_LOGICAL(cmd)) + return 0; + switch (cmd->cmnd[0]) { + case READ_10: + case WRITE_10: + case READ_12: + case WRITE_12: + case READ_6: + case WRITE_6: + case READ_16: + case WRITE_16: + return 1; + default: + return 0; } - - return NULL; } /** @@ -684,13 +664,27 @@ megasas_queue_command(struct scsi_cmnd *scmd, void (*done) (struct scsi_cmnd *)) scmd->scsi_done = done; scmd->result = 0; - cmd = megasas_build_cmd(instance, scmd, &frame_count); - - if (!cmd) { - done(scmd); - return 0; + if (MEGASAS_IS_LOGICAL(scmd) && + (scmd->device->id >= MEGASAS_MAX_LD || scmd->device->lun)) { + scmd->result = DID_BAD_TARGET << 16; + goto out_done; } + cmd = megasas_get_cmd(instance); + if (!cmd) + return SCSI_MLQUEUE_HOST_BUSY; + + /* + * Logical drive command + */ + if (megasas_is_ldio(scmd)) + frame_count = megasas_build_ldio(instance, scmd, cmd); + else + frame_count = megasas_build_dcdb(instance, scmd, cmd); + + if (!frame_count) + goto out_return_cmd; + cmd->scmd = scmd; scmd->SCp.ptr = (char *)cmd; scmd->SCp.sent_command = jiffies; @@ -702,10 +696,15 @@ megasas_queue_command(struct scsi_cmnd *scmd, void (*done) (struct scsi_cmnd *)) instance->fw_outstanding++; spin_unlock_irqrestore(&instance->instance_lock, flags); - writel(((cmd->frame_phys_addr >> 3) | (cmd->frame_count - 1)), - &instance->reg_set->inbound_queue_port); + instance->instancet->fire_cmd(cmd->frame_phys_addr ,cmd->frame_count-1,instance->reg_set); return 0; + + out_return_cmd: + megasas_return_cmd(instance, cmd); + out_done: + done(scmd); + return 0; } /** @@ -1108,7 +1107,6 @@ megasas_complete_cmd(struct megasas_instance *instance, struct megasas_cmd *cmd, static int megasas_deplete_reply_queue(struct megasas_instance *instance, u8 alt_status) { - u32 status; u32 producer; u32 consumer; u32 context; @@ -1116,17 +1114,10 @@ megasas_deplete_reply_queue(struct megasas_instance *instance, u8 alt_status) /* * Check if it is our interrupt + * Clear the interrupt */ - status = readl(&instance->reg_set->outbound_intr_status); - - if (!(status & MFI_OB_INTR_STATUS_MASK)) { + if(instance->instancet->clear_intr(instance->reg_set)) return IRQ_NONE; - } - - /* - * Clear the interrupt by writing back the same value - */ - writel(status, &instance->reg_set->outbound_intr_status); producer = *instance->producer; consumer = *instance->consumer; @@ -1160,7 +1151,7 @@ static irqreturn_t megasas_isr(int irq, void *devp, struct pt_regs *regs) /** * megasas_transition_to_ready - Move the FW to READY state - * @reg_set: MFI register set + * @instance: Adapter soft state * * During the initialization, FW passes can potentially be in any one of * several possible states. If the FW in operational, waiting-for-handshake @@ -1168,14 +1159,14 @@ static irqreturn_t megasas_isr(int irq, void *devp, struct pt_regs *regs) * has to wait for the ready state. */ static int -megasas_transition_to_ready(struct megasas_register_set __iomem * reg_set) +megasas_transition_to_ready(struct megasas_instance* instance) { int i; u8 max_wait; u32 fw_state; u32 cur_state; - fw_state = readl(®_set->outbound_msg_0) & MFI_STATE_MASK; + fw_state = instance->instancet->read_fw_status_reg(instance->reg_set) & MFI_STATE_MASK; while (fw_state != MFI_STATE_READY) { @@ -1193,7 +1184,7 @@ megasas_transition_to_ready(struct megasas_register_set __iomem * reg_set) * Set the CLR bit in inbound doorbell */ writel(MFI_INIT_CLEAR_HANDSHAKE, - ®_set->inbound_doorbell); + &instance->reg_set->inbound_doorbell); max_wait = 2; cur_state = MFI_STATE_WAIT_HANDSHAKE; @@ -1203,8 +1194,8 @@ megasas_transition_to_ready(struct megasas_register_set __iomem * reg_set) /* * Bring it to READY state; assuming max wait 2 secs */ - megasas_disable_intr(reg_set); - writel(MFI_INIT_READY, ®_set->inbound_doorbell); + megasas_disable_intr(instance->reg_set); + writel(MFI_INIT_READY, &instance->reg_set->inbound_doorbell); max_wait = 10; cur_state = MFI_STATE_OPERATIONAL; @@ -1253,8 +1244,8 @@ megasas_transition_to_ready(struct megasas_register_set __iomem * reg_set) * The cur_state should not last for more than max_wait secs */ for (i = 0; i < (max_wait * 1000); i++) { - fw_state = MFI_STATE_MASK & - readl(®_set->outbound_msg_0); + fw_state = instance->instancet->read_fw_status_reg(instance->reg_set) & + MFI_STATE_MASK ; if (fw_state == cur_state) { msleep(1); @@ -1616,18 +1607,20 @@ static int megasas_init_mfi(struct megasas_instance *instance) reg_set = instance->reg_set; + instance->instancet = &megasas_instance_template_xscale; + /* * We expect the FW state to be READY */ - if (megasas_transition_to_ready(instance->reg_set)) + if (megasas_transition_to_ready(instance)) goto fail_ready_state; /* * Get various operational parameters from status register */ - instance->max_fw_cmds = readl(®_set->outbound_msg_0) & 0x00FFFF; - instance->max_num_sge = (readl(®_set->outbound_msg_0) & 0xFF0000) >> - 0x10; + instance->max_fw_cmds = instance->instancet->read_fw_status_reg(reg_set) & 0x00FFFF; + instance->max_num_sge = (instance->instancet->read_fw_status_reg(reg_set) & 0xFF0000) >> + 0x10; /* * Create a pool of commands */ @@ -1936,8 +1929,7 @@ megasas_register_aen(struct megasas_instance *instance, u32 seq_num, /* * Issue the aen registration frame */ - writel(cmd->frame_phys_addr >> 3, - &instance->reg_set->inbound_queue_port); + instance->instancet->fire_cmd(cmd->frame_phys_addr ,0,instance->reg_set); return 0; } @@ -2126,7 +2118,7 @@ megasas_probe_one(struct pci_dev *pdev, const struct pci_device_id *id) goto fail_irq; } - megasas_enable_intr(instance->reg_set); + instance->instancet->enable_intr(instance->reg_set); /* * Store instance in PCI softstate @@ -2681,9 +2673,8 @@ megasas_mgmt_compat_ioctl(struct file *file, unsigned int cmd, unsigned long arg) { switch (cmd) { - case MEGASAS_IOC_FIRMWARE:{ - return megasas_mgmt_compat_ioctl_fw(file, arg); - } + case MEGASAS_IOC_FIRMWARE32: + return megasas_mgmt_compat_ioctl_fw(file, arg); case MEGASAS_IOC_GET_AEN: return megasas_mgmt_ioctl_aen(file, arg); } diff --git a/drivers/scsi/megaraid/megaraid_sas.h b/drivers/scsi/megaraid/megaraid_sas.h index eaec9d53142..d6d166c0663 100644 --- a/drivers/scsi/megaraid/megaraid_sas.h +++ b/drivers/scsi/megaraid/megaraid_sas.h @@ -18,10 +18,9 @@ /** * MegaRAID SAS Driver meta data */ -#define MEGASAS_VERSION "00.00.02.00-rc4" -#define MEGASAS_RELDATE "Sep 16, 2005" -#define MEGASAS_EXT_VERSION "Fri Sep 16 12:37:08 EDT 2005" - +#define MEGASAS_VERSION "00.00.02.02" +#define MEGASAS_RELDATE "Jan 23, 2006" +#define MEGASAS_EXT_VERSION "Mon Jan 23 14:09:01 PST 2006" /* * ===================================== * MegaRAID SAS MFI firmware definitions @@ -1013,6 +1012,16 @@ struct megasas_evt_detail { } __attribute__ ((packed)); + struct megasas_instance_template { + void (*fire_cmd)(dma_addr_t ,u32 ,struct megasas_register_set __iomem *); + + void (*enable_intr)(struct megasas_register_set __iomem *) ; + + int (*clear_intr)(struct megasas_register_set __iomem *); + + u32 (*read_fw_status_reg)(struct megasas_register_set __iomem *); + }; + struct megasas_instance { u32 *producer; @@ -1056,6 +1065,8 @@ struct megasas_instance { u32 fw_outstanding; u32 hw_crit_error; spinlock_t instance_lock; + + struct megasas_instance_template *instancet; }; #define MEGASAS_IS_LOGICAL(scp) \ @@ -1125,11 +1136,10 @@ struct compat_megasas_iocpacket { struct compat_iovec sgl[MAX_IOCTL_SGE]; } __attribute__ ((packed)); -#define MEGASAS_IOC_FIRMWARE _IOWR('M', 1, struct compat_megasas_iocpacket) -#else -#define MEGASAS_IOC_FIRMWARE _IOWR('M', 1, struct megasas_iocpacket) #endif +#define MEGASAS_IOC_FIRMWARE _IOWR('M', 1, struct megasas_iocpacket) +#define MEGASAS_IOC_FIRMWARE32 _IOWR('M', 1, struct compat_megasas_iocpacket) #define MEGASAS_IOC_GET_AEN _IOW('M', 3, struct megasas_aen) struct megasas_mgmt_info { diff --git a/drivers/scsi/qla1280.c b/drivers/scsi/qla1280.c index 0878f95b544..e0230249fa0 100644 --- a/drivers/scsi/qla1280.c +++ b/drivers/scsi/qla1280.c @@ -17,9 +17,11 @@ * General Public License for more details. * ******************************************************************************/ -#define QLA1280_VERSION "3.25" +#define QLA1280_VERSION "3.26" /***************************************************************************** Revision History: + Rev 3.26, January 16, 2006 Jes Sorensen + - Ditch all < 2.6 support Rev 3.25.1, February 10, 2005 Christoph Hellwig - use pci_map_single to map non-S/G requests - remove qla1280_proc_info @@ -356,25 +358,18 @@ #include <asm/types.h> #include <asm/system.h> -#if LINUX_VERSION_CODE >= 0x020545 #include <scsi/scsi.h> #include <scsi/scsi_cmnd.h> #include <scsi/scsi_device.h> #include <scsi/scsi_host.h> #include <scsi/scsi_tcq.h> -#else -#include <linux/blk.h> -#include "scsi.h" -#include <scsi/scsi_host.h> -#include "sd.h" -#endif #if defined(CONFIG_IA64_GENERIC) || defined(CONFIG_IA64_SGI_SN2) #include <asm/sn/io.h> #endif -#if LINUX_VERSION_CODE < 0x020407 -#error "Kernels older than 2.4.7 are no longer supported" +#if LINUX_VERSION_CODE < 0x020600 +#error "Kernels older than 2.6.0 are no longer supported" #endif @@ -441,52 +436,6 @@ #define NVRAM_DELAY() udelay(500) /* 2 microseconds */ -#if LINUX_VERSION_CODE < 0x020500 -#define HOST_LOCK &io_request_lock -#define irqreturn_t void -#define IRQ_RETVAL(foo) -#define MSG_ORDERED_TAG 1 - -#define DMA_BIDIRECTIONAL SCSI_DATA_UNKNOWN -#define DMA_TO_DEVICE SCSI_DATA_WRITE -#define DMA_FROM_DEVICE SCSI_DATA_READ -#define DMA_NONE SCSI_DATA_NONE - -#ifndef HAVE_SECTOR_T -typedef unsigned int sector_t; -#endif - -static inline void -scsi_adjust_queue_depth(struct scsi_device *device, int tag, int depth) -{ - if (tag) { - device->tagged_queue = tag; - device->current_tag = 0; - } - device->queue_depth = depth; -} -static inline struct Scsi_Host *scsi_host_alloc(struct scsi_host_template *t, size_t s) -{ - return scsi_register(t, s); -} -static inline void scsi_host_put(struct Scsi_Host *h) -{ - scsi_unregister(h); -} -#else -#define HOST_LOCK ha->host->host_lock -#endif -#if LINUX_VERSION_CODE < 0x020600 -#define DEV_SIMPLE_TAGS(device) device->tagged_queue -/* - * Hack around that qla1280_remove_one is called from - * qla1280_release in 2.4 - */ -#undef __devexit -#define __devexit -#else -#define DEV_SIMPLE_TAGS(device) device->simple_tags -#endif #if defined(__ia64__) && !defined(ia64_platform_is) #define ia64_platform_is(foo) (!strcmp(x, platform_name)) #endif @@ -506,9 +455,6 @@ static void qla1280_remove_one(struct pci_dev *); * QLogic Driver Support Function Prototypes. */ static void qla1280_done(struct scsi_qla_host *); -#if LINUX_VERSION_CODE < 0x020545 -static void qla1280_get_target_options(struct scsi_cmnd *, struct scsi_qla_host *); -#endif static int qla1280_get_token(char *); static int qla1280_setup(char *s) __init; @@ -610,11 +556,7 @@ __setup("qla1280=", qla1280_setup); #define CMD_SNSLEN(Cmnd) sizeof(Cmnd->sense_buffer) #define CMD_RESULT(Cmnd) Cmnd->result #define CMD_HANDLE(Cmnd) Cmnd->host_scribble -#if LINUX_VERSION_CODE < 0x020545 -#define CMD_REQUEST(Cmnd) Cmnd->request.cmd -#else #define CMD_REQUEST(Cmnd) Cmnd->request->cmd -#endif #define CMD_HOST(Cmnd) Cmnd->device->host #define SCSI_BUS_32(Cmnd) Cmnd->device->channel @@ -1064,10 +1006,10 @@ qla1280_error_action(struct scsi_cmnd *cmd, enum action action) add_timer(&timer); /* wait for the action to complete (or the timer to expire) */ - spin_unlock_irq(HOST_LOCK); + spin_unlock_irq(ha->host->host_lock); wait_for_completion(&wait); del_timer_sync(&timer); - spin_lock_irq(HOST_LOCK); + spin_lock_irq(ha->host->host_lock); sp->wait = NULL; /* the only action we might get a fail for is abort */ @@ -1173,96 +1115,6 @@ qla1280_biosparam(struct scsi_device *sdev, struct block_device *bdev, return 0; } -#if LINUX_VERSION_CODE < 0x020600 -static int -qla1280_detect(struct scsi_host_template *template) -{ - struct pci_device_id *id = &qla1280_pci_tbl[0]; - struct pci_dev *pdev = NULL; - int num_hosts = 0; - - if (sizeof(struct srb) > sizeof(Scsi_Pointer)) { - printk(KERN_WARNING - "qla1280: struct srb too big, aborting\n"); - return 0; - } - - if ((DMA_BIDIRECTIONAL != PCI_DMA_BIDIRECTIONAL) || - (DMA_TO_DEVICE != PCI_DMA_TODEVICE) || - (DMA_FROM_DEVICE != PCI_DMA_FROMDEVICE) || - (DMA_NONE != PCI_DMA_NONE)) { - printk(KERN_WARNING - "qla1280: dma direction bits don't match\n"); - return 0; - } - -#ifdef MODULE - /* - * If we are called as a module, the qla1280 pointer may not be null - * and it would point to our bootup string, just like on the lilo - * command line. IF not NULL, then process this config string with - * qla1280_setup - * - * Boot time Options - * To add options at boot time add a line to your lilo.conf file like: - * append="qla1280=verbose,max_tags:{{255,255,255,255},{255,255,255,255}}" - * which will result in the first four devices on the first two - * controllers being set to a tagged queue depth of 32. - */ - if (qla1280) - qla1280_setup(qla1280); -#endif - - /* First Initialize QLA12160 on PCI Bus 1 Dev 2 */ - while ((pdev = pci_find_device(id->vendor, id->device, pdev))) { - if (pdev->bus->number == 1 && PCI_SLOT(pdev->devfn) == 2) { - if (!qla1280_probe_one(pdev, id)) - num_hosts++; - } - } - - pdev = NULL; - /* Try and find each different type of adapter we support */ - for (id = &qla1280_pci_tbl[0]; id->device; id++) { - while ((pdev = pci_find_device(id->vendor, id->device, pdev))) { - /* - * skip QLA12160 already initialized on - * PCI Bus 1 Dev 2 since we already initialized - * and presented it - */ - if (id->device == PCI_DEVICE_ID_QLOGIC_ISP12160 && - pdev->bus->number == 1 && - PCI_SLOT(pdev->devfn) == 2) - continue; - - if (!qla1280_probe_one(pdev, id)) - num_hosts++; - } - } - - return num_hosts; -} - -/* - * This looks a bit ugly as we could just pass down host to - * qla1280_remove_one, but I want to keep qla1280_release purely a wrapper - * around pci_driver::remove as used from 2.6 onwards. - */ -static int -qla1280_release(struct Scsi_Host *host) -{ - struct scsi_qla_host *ha = (struct scsi_qla_host *)host->hostdata; - - qla1280_remove_one(ha->pdev); - return 0; -} - -static int -qla1280_biosparam_old(Disk * disk, kdev_t dev, int geom[]) -{ - return qla1280_biosparam(disk->device, NULL, disk->capacity, geom); -} -#endif /* disable risc and host interrupts */ static inline void @@ -1295,7 +1147,7 @@ qla1280_intr_handler(int irq, void *dev_id, struct pt_regs *regs) ENTER_INTR ("qla1280_intr_handler"); ha = (struct scsi_qla_host *)dev_id; - spin_lock(HOST_LOCK); + spin_lock(ha->host->host_lock); ha->isr_count++; reg = ha->iobase; @@ -1311,7 +1163,7 @@ qla1280_intr_handler(int irq, void *dev_id, struct pt_regs *regs) if (!list_empty(&ha->done_q)) qla1280_done(ha); - spin_unlock(HOST_LOCK); + spin_unlock(ha->host->host_lock); qla1280_enable_intrs(ha); @@ -1411,11 +1263,9 @@ qla1280_slave_configure(struct scsi_device *device) scsi_adjust_queue_depth(device, 0, default_depth); } -#if LINUX_VERSION_CODE > 0x020500 nv->bus[bus].target[target].parameter.enable_sync = device->sdtr; nv->bus[bus].target[target].parameter.enable_wide = device->wdtr; nv->bus[bus].target[target].ppr_1x160.flags.enable_ppr = device->ppr; -#endif if (driver_setup.no_sync || (driver_setup.sync_mask && @@ -1432,38 +1282,14 @@ qla1280_slave_configure(struct scsi_device *device) nv->bus[bus].target[target].ppr_1x160.flags.enable_ppr = 0; } - spin_lock_irqsave(HOST_LOCK, flags); + spin_lock_irqsave(ha->host->host_lock, flags); if (nv->bus[bus].target[target].parameter.enable_sync) status = qla1280_set_target_parameters(ha, bus, target); qla1280_get_target_parameters(ha, device); - spin_unlock_irqrestore(HOST_LOCK, flags); + spin_unlock_irqrestore(ha->host->host_lock, flags); return status; } -#if LINUX_VERSION_CODE < 0x020545 -/************************************************************************** - * qla1280_select_queue_depth - * - * Sets the queue depth for each SCSI device hanging off the input - * host adapter. We use a queue depth of 2 for devices that do not - * support tagged queueing. - **************************************************************************/ -static void -qla1280_select_queue_depth(struct Scsi_Host *host, struct scsi_device *sdev_q) -{ - struct scsi_qla_host *ha = (struct scsi_qla_host *)host->hostdata; - struct scsi_device *sdev; - - ENTER("qla1280_select_queue_depth"); - for (sdev = sdev_q; sdev; sdev = sdev->next) - if (sdev->host == host) - qla1280_slave_configure(sdev); - - if (sdev_q) - qla1280_check_for_dead_scsi_bus(ha, sdev_q->channel); - LEAVE("qla1280_select_queue_depth"); -} -#endif /* * qla1280_done @@ -1523,10 +1349,6 @@ qla1280_done(struct scsi_qla_host *ha) CMD_HANDLE(sp->cmd) = (unsigned char *)INVALID_HANDLE; ha->actthreads--; -#if LINUX_VERSION_CODE < 0x020500 - if (cmd->cmnd[0] == INQUIRY) - qla1280_get_target_options(cmd, ha); -#endif (*(cmd)->scsi_done)(cmd); if(sp->wait != NULL) @@ -1655,9 +1477,7 @@ qla1280_initialize_adapter(struct scsi_qla_host *ha) struct device_reg __iomem *reg; int status; int bus; -#if LINUX_VERSION_CODE > 0x020500 unsigned long flags; -#endif ENTER("qla1280_initialize_adapter"); @@ -1695,15 +1515,12 @@ qla1280_initialize_adapter(struct scsi_qla_host *ha) "NVRAM\n"); } -#if LINUX_VERSION_CODE >= 0x020500 /* * It's necessary to grab the spin here as qla1280_mailbox_command * needs to be able to drop the lock unconditionally to wait * for completion. - * In 2.4 ->detect is called with the io_request_lock held. */ - spin_lock_irqsave(HOST_LOCK, flags); -#endif + spin_lock_irqsave(ha->host->host_lock, flags); status = qla1280_load_firmware(ha); if (status) { @@ -1735,9 +1552,8 @@ qla1280_initialize_adapter(struct scsi_qla_host *ha) ha->flags.online = 1; out: -#if LINUX_VERSION_CODE >= 0x020500 - spin_unlock_irqrestore(HOST_LOCK, flags); -#endif + spin_unlock_irqrestore(ha->host->host_lock, flags); + if (status) dprintk(2, "qla1280_initialize_adapter: **** FAILED ****\n"); @@ -2650,14 +2466,14 @@ qla1280_mailbox_command(struct scsi_qla_host *ha, uint8_t mr, uint16_t *mb) timer.function = qla1280_mailbox_timeout; add_timer(&timer); - spin_unlock_irq(HOST_LOCK); + spin_unlock_irq(ha->host->host_lock); WRT_REG_WORD(®->host_cmd, HC_SET_HOST_INT); data = qla1280_debounce_register(®->istatus); wait_for_completion(&wait); del_timer_sync(&timer); - spin_lock_irq(HOST_LOCK); + spin_lock_irq(ha->host->host_lock); ha->mailbox_wait = NULL; @@ -2770,9 +2586,9 @@ qla1280_bus_reset(struct scsi_qla_host *ha, int bus) ha->bus_settings[bus].scsi_bus_dead = 1; ha->bus_settings[bus].failed_reset_count++; } else { - spin_unlock_irq(HOST_LOCK); + spin_unlock_irq(ha->host->host_lock); ssleep(reset_delay); - spin_lock_irq(HOST_LOCK); + spin_lock_irq(ha->host->host_lock); ha->bus_settings[bus].scsi_bus_dead = 0; ha->bus_settings[bus].failed_reset_count = 0; @@ -3078,7 +2894,7 @@ qla1280_64bit_start_scsi(struct scsi_qla_host *ha, struct srb * sp) (SCSI_TCN_32(cmd) | BIT_7) : SCSI_TCN_32(cmd); /* Enable simple tag queuing if device supports it. */ - if (DEV_SIMPLE_TAGS(cmd->device)) + if (cmd->device->simple_tags) pkt->control_flags |= cpu_to_le16(BIT_3); /* Load SCSI command packet. */ @@ -3377,7 +3193,7 @@ qla1280_32bit_start_scsi(struct scsi_qla_host *ha, struct srb * sp) (SCSI_TCN_32(cmd) | BIT_7) : SCSI_TCN_32(cmd); /* Enable simple tag queuing if device supports it. */ - if (DEV_SIMPLE_TAGS(cmd->device)) + if (cmd->device->simple_tags) pkt->control_flags |= cpu_to_le16(BIT_3); /* Load SCSI command packet. */ @@ -3889,50 +3705,6 @@ qla1280_rst_aen(struct scsi_qla_host *ha) } -#if LINUX_VERSION_CODE < 0x020500 -/* - * - */ -static void -qla1280_get_target_options(struct scsi_cmnd *cmd, struct scsi_qla_host *ha) -{ - unsigned char *result; - struct nvram *n; - int bus, target, lun; - - bus = SCSI_BUS_32(cmd); - target = SCSI_TCN_32(cmd); - lun = SCSI_LUN_32(cmd); - - /* - * Make sure to not touch anything if someone is using the - * sg interface. - */ - if (cmd->use_sg || (CMD_RESULT(cmd) >> 16) != DID_OK || lun) - return; - - result = cmd->request_buffer; - n = &ha->nvram; - - n->bus[bus].target[target].parameter.enable_wide = 0; - n->bus[bus].target[target].parameter.enable_sync = 0; - n->bus[bus].target[target].ppr_1x160.flags.enable_ppr = 0; - - if (result[7] & 0x60) - n->bus[bus].target[target].parameter.enable_wide = 1; - if (result[7] & 0x10) - n->bus[bus].target[target].parameter.enable_sync = 1; - if ((result[2] >= 3) && (result[4] + 5 > 56) && - (result[56] & 0x4)) - n->bus[bus].target[target].ppr_1x160.flags.enable_ppr = 1; - - dprintk(2, "get_target_options(): wide %i, sync %i, ppr %i\n", - n->bus[bus].target[target].parameter.enable_wide, - n->bus[bus].target[target].parameter.enable_sync, - n->bus[bus].target[target].ppr_1x160.flags.enable_ppr); -} -#endif - /* * qla1280_status_entry * Processes received ISP status entry. @@ -4271,7 +4043,7 @@ qla1280_get_target_parameters(struct scsi_qla_host *ha, } else printk(" Async"); - if (DEV_SIMPLE_TAGS(device)) + if (device->simple_tags) printk(", Tagged queuing: depth %d", device->queue_depth); printk("\n"); } @@ -4485,7 +4257,7 @@ qla1280_get_token(char *str) return ret; } -#if LINUX_VERSION_CODE >= 0x020600 + static struct scsi_host_template qla1280_driver_template = { .module = THIS_MODULE, .proc_name = "qla1280", @@ -4504,27 +4276,7 @@ static struct scsi_host_template qla1280_driver_template = { .cmd_per_lun = 1, .use_clustering = ENABLE_CLUSTERING, }; -#else -static struct scsi_host_template qla1280_driver_template = { - .proc_name = "qla1280", - .name = "Qlogic ISP 1280/12160", - .detect = qla1280_detect, - .release = qla1280_release, - .info = qla1280_info, - .queuecommand = qla1280_queuecommand, - .eh_abort_handler = qla1280_eh_abort, - .eh_device_reset_handler= qla1280_eh_device_reset, - .eh_bus_reset_handler = qla1280_eh_bus_reset, - .eh_host_reset_handler = qla1280_eh_adapter_reset, - .bios_param = qla1280_biosparam_old, - .can_queue = 0xfffff, - .this_id = -1, - .sg_tablesize = SG_ALL, - .cmd_per_lun = 1, - .use_clustering = ENABLE_CLUSTERING, - .use_new_eh_code = 1, -}; -#endif + static int __devinit qla1280_probe_one(struct pci_dev *pdev, const struct pci_device_id *id) @@ -4615,10 +4367,6 @@ qla1280_probe_one(struct pci_dev *pdev, const struct pci_device_id *id) host->max_sectors = 1024; host->unique_id = host->host_no; -#if LINUX_VERSION_CODE < 0x020545 - host->select_queue_depths = qla1280_select_queue_depth; -#endif - error = -ENODEV; #if MEMORY_MAPPED_IO @@ -4666,21 +4414,15 @@ qla1280_probe_one(struct pci_dev *pdev, const struct pci_device_id *id) pci_set_drvdata(pdev, host); -#if LINUX_VERSION_CODE >= 0x020600 error = scsi_add_host(host, &pdev->dev); if (error) goto error_disable_adapter; scsi_scan_host(host); -#else - scsi_set_pci_device(host, pdev); -#endif return 0; -#if LINUX_VERSION_CODE >= 0x020600 error_disable_adapter: qla1280_disable_intrs(ha); -#endif error_free_irq: free_irq(pdev->irq, ha); error_release_region: @@ -4712,9 +4454,7 @@ qla1280_remove_one(struct pci_dev *pdev) struct Scsi_Host *host = pci_get_drvdata(pdev); struct scsi_qla_host *ha = (struct scsi_qla_host *)host->hostdata; -#if LINUX_VERSION_CODE >= 0x020600 scsi_remove_host(host); -#endif qla1280_disable_intrs(ha); @@ -4738,7 +4478,6 @@ qla1280_remove_one(struct pci_dev *pdev) scsi_host_put(host); } -#if LINUX_VERSION_CODE >= 0x020600 static struct pci_driver qla1280_pci_driver = { .name = "qla1280", .id_table = qla1280_pci_tbl, @@ -4784,10 +4523,6 @@ qla1280_exit(void) module_init(qla1280_init); module_exit(qla1280_exit); -#else -# define driver_template qla1280_driver_template -# include "scsi_module.c" -#endif MODULE_AUTHOR("Qlogic & Jes Sorensen"); MODULE_DESCRIPTION("Qlogic ISP SCSI (qla1x80/qla1x160) driver"); diff --git a/drivers/scsi/qla2xxx/qla_def.h b/drivers/scsi/qla2xxx/qla_def.h index 79d8a914f9d..bad066e5772 100644 --- a/drivers/scsi/qla2xxx/qla_def.h +++ b/drivers/scsi/qla2xxx/qla_def.h @@ -1680,7 +1680,8 @@ typedef struct fc_port { uint8_t mp_byte; /* multi-path byte (not used) */ uint8_t cur_path; /* current path id */ - struct fc_rport *rport; + spinlock_t rport_lock; + struct fc_rport *rport, *drport; u32 supported_classes; struct work_struct rport_add_work; struct work_struct rport_del_work; @@ -2270,6 +2271,7 @@ typedef struct scsi_qla_host { #define LOOP_RESET_NEEDED 24 #define BEACON_BLINK_NEEDED 25 #define REGISTER_FDMI_NEEDED 26 +#define FCPORT_UPDATE_NEEDED 27 uint32_t device_flags; #define DFLG_LOCAL_DEVICES BIT_0 diff --git a/drivers/scsi/qla2xxx/qla_gbl.h b/drivers/scsi/qla2xxx/qla_gbl.h index 32be4c14ccc..35266bd5d53 100644 --- a/drivers/scsi/qla2xxx/qla_gbl.h +++ b/drivers/scsi/qla2xxx/qla_gbl.h @@ -47,9 +47,11 @@ extern int qla2x00_local_device_login(scsi_qla_host_t *, uint16_t); extern void qla2x00_restart_queues(scsi_qla_host_t *, uint8_t); extern void qla2x00_rescan_fcports(scsi_qla_host_t *); +extern void qla2x00_update_fcports(scsi_qla_host_t *); extern int qla2x00_abort_isp(scsi_qla_host_t *); +extern void qla2x00_update_fcport(scsi_qla_host_t *, fc_port_t *); extern void qla2x00_reg_remote_port(scsi_qla_host_t *, fc_port_t *); /* @@ -70,8 +72,8 @@ extern char *qla2x00_get_fw_version_str(struct scsi_qla_host *, char *); extern void qla2x00_cmd_timeout(srb_t *); -extern void qla2x00_mark_device_lost(scsi_qla_host_t *, fc_port_t *, int); -extern void qla2x00_mark_all_devices_lost(scsi_qla_host_t *); +extern void qla2x00_mark_device_lost(scsi_qla_host_t *, fc_port_t *, int, int); +extern void qla2x00_mark_all_devices_lost(scsi_qla_host_t *, int); extern void qla2x00_blink_led(scsi_qla_host_t *); diff --git a/drivers/scsi/qla2xxx/qla_init.c b/drivers/scsi/qla2xxx/qla_init.c index a91fea69ad6..e67bb099781 100644 --- a/drivers/scsi/qla2xxx/qla_init.c +++ b/drivers/scsi/qla2xxx/qla_init.c @@ -32,7 +32,6 @@ static int qla2x00_fw_ready(scsi_qla_host_t *); static int qla2x00_configure_hba(scsi_qla_host_t *); static int qla2x00_configure_loop(scsi_qla_host_t *); static int qla2x00_configure_local_loop(scsi_qla_host_t *); -static void qla2x00_update_fcport(scsi_qla_host_t *, fc_port_t *); static int qla2x00_configure_fabric(scsi_qla_host_t *); static int qla2x00_find_all_fabric_devs(scsi_qla_host_t *, struct list_head *); static int qla2x00_device_resync(scsi_qla_host_t *); @@ -1688,10 +1687,16 @@ static void qla2x00_rport_del(void *data) { fc_port_t *fcport = data; + struct fc_rport *rport; + unsigned long flags; + + spin_lock_irqsave(&fcport->rport_lock, flags); + rport = fcport->drport; + fcport->drport = NULL; + spin_unlock_irqrestore(&fcport->rport_lock, flags); + if (rport) + fc_remote_port_delete(rport); - if (fcport->rport) - fc_remote_port_delete(fcport->rport); - fcport->rport = NULL; } /** @@ -1719,6 +1724,7 @@ qla2x00_alloc_fcport(scsi_qla_host_t *ha, gfp_t flags) atomic_set(&fcport->state, FCS_UNCONFIGURED); fcport->flags = FCF_RLC_SUPPORT; fcport->supported_classes = FC_COS_UNSPECIFIED; + spin_lock_init(&fcport->rport_lock); INIT_WORK(&fcport->rport_add_work, qla2x00_rport_add, fcport); INIT_WORK(&fcport->rport_del_work, qla2x00_rport_del, fcport); @@ -2008,7 +2014,7 @@ qla2x00_probe_for_all_luns(scsi_qla_host_t *ha) { fc_port_t *fcport; - qla2x00_mark_all_devices_lost(ha); + qla2x00_mark_all_devices_lost(ha, 0); list_for_each_entry(fcport, &ha->fcports, list) { if (fcport->port_type != FCT_TARGET) continue; @@ -2032,13 +2038,9 @@ qla2x00_probe_for_all_luns(scsi_qla_host_t *ha) * Context: * Kernel context. */ -static void +void qla2x00_update_fcport(scsi_qla_host_t *ha, fc_port_t *fcport) { - uint16_t index; - unsigned long flags; - srb_t *sp; - fcport->ha = ha; fcport->login_retry = 0; fcport->port_login_retry_count = ha->port_down_retry_count * @@ -2047,28 +2049,6 @@ qla2x00_update_fcport(scsi_qla_host_t *ha, fc_port_t *fcport) PORT_RETRY_TIME); fcport->flags &= ~FCF_LOGIN_NEEDED; - /* - * Check for outstanding cmd on tape Bypass LUN discovery if active - * command on tape. - */ - if (fcport->flags & FCF_TAPE_PRESENT) { - spin_lock_irqsave(&ha->hardware_lock, flags); - for (index = 1; index < MAX_OUTSTANDING_COMMANDS; index++) { - fc_port_t *sfcp; - - if ((sp = ha->outstanding_cmds[index]) != 0) { - sfcp = sp->fcport; - if (sfcp == fcport) { - atomic_set(&fcport->state, FCS_ONLINE); - spin_unlock_irqrestore( - &ha->hardware_lock, flags); - return; - } - } - } - spin_unlock_irqrestore(&ha->hardware_lock, flags); - } - if (fcport->port_type == FCT_INITIATOR || fcport->port_type == FCT_BROADCAST) fcport->device_type = TYPE_PROCESSOR; @@ -2084,24 +2064,29 @@ qla2x00_reg_remote_port(scsi_qla_host_t *ha, fc_port_t *fcport) { struct fc_rport_identifiers rport_ids; struct fc_rport *rport; + unsigned long flags; - if (fcport->rport) { - fc_remote_port_delete(fcport->rport); - fcport->rport = NULL; - } + if (fcport->drport) + qla2x00_rport_del(fcport); + if (fcport->rport) + return; rport_ids.node_name = wwn_to_u64(fcport->node_name); rport_ids.port_name = wwn_to_u64(fcport->port_name); rport_ids.port_id = fcport->d_id.b.domain << 16 | fcport->d_id.b.area << 8 | fcport->d_id.b.al_pa; rport_ids.roles = FC_RPORT_ROLE_UNKNOWN; - fcport->rport = rport = fc_remote_port_add(ha->host, 0, &rport_ids); + rport = fc_remote_port_add(ha->host, 0, &rport_ids); if (!rport) { qla_printk(KERN_WARNING, ha, "Unable to allocate fc remote port!\n"); return; } + spin_lock_irqsave(&fcport->rport_lock, flags); + fcport->rport = rport; *((fc_port_t **)rport->dd_data) = fcport; + spin_unlock_irqrestore(&fcport->rport_lock, flags); + rport->supported_classes = fcport->supported_classes; rport_ids.roles = FC_RPORT_ROLE_UNKNOWN; @@ -2217,12 +2202,11 @@ qla2x00_configure_fabric(scsi_qla_host_t *ha) if (atomic_read(&fcport->state) == FCS_DEVICE_LOST) { qla2x00_mark_device_lost(ha, fcport, - ql2xplogiabsentdevice); + ql2xplogiabsentdevice, 0); if (fcport->loop_id != FC_NO_LOOP_ID && (fcport->flags & FCF_TAPE_PRESENT) == 0 && fcport->port_type != FCT_INITIATOR && fcport->port_type != FCT_BROADCAST) { - ha->isp_ops.fabric_logout(ha, fcport->loop_id, fcport->d_id.b.domain, @@ -2694,7 +2678,8 @@ qla2x00_device_resync(scsi_qla_host_t *ha) if (atomic_read(&fcport->state) == FCS_ONLINE) { if (format != 3 || fcport->port_type != FCT_INITIATOR) { - qla2x00_mark_device_lost(ha, fcport, 0); + qla2x00_mark_device_lost(ha, fcport, + 0, 0); } } fcport->flags &= ~FCF_FARP_DONE; @@ -2741,8 +2726,7 @@ qla2x00_fabric_dev_login(scsi_qla_host_t *ha, fc_port_t *fcport, ha->isp_ops.fabric_logout(ha, fcport->loop_id, fcport->d_id.b.domain, fcport->d_id.b.area, fcport->d_id.b.al_pa); - qla2x00_mark_device_lost(ha, fcport, 1); - + qla2x00_mark_device_lost(ha, fcport, 1, 0); } else { qla2x00_update_fcport(ha, fcport); } @@ -2855,7 +2839,7 @@ qla2x00_fabric_login(scsi_qla_host_t *ha, fc_port_t *fcport, ha->isp_ops.fabric_logout(ha, fcport->loop_id, fcport->d_id.b.domain, fcport->d_id.b.area, fcport->d_id.b.al_pa); - qla2x00_mark_device_lost(ha, fcport, 1); + qla2x00_mark_device_lost(ha, fcport, 1, 0); rval = 1; break; @@ -2990,6 +2974,17 @@ qla2x00_rescan_fcports(scsi_qla_host_t *ha) qla2x00_probe_for_all_luns(ha); } +void +qla2x00_update_fcports(scsi_qla_host_t *ha) +{ + fc_port_t *fcport; + + /* Go with deferred removal of rport references. */ + list_for_each_entry(fcport, &ha->fcports, list) + if (fcport->drport) + qla2x00_rport_del(fcport); +} + /* * qla2x00_abort_isp * Resets ISP and aborts all outstanding commands. @@ -3019,7 +3014,7 @@ qla2x00_abort_isp(scsi_qla_host_t *ha) atomic_set(&ha->loop_down_timer, LOOP_DOWN_TIME); if (atomic_read(&ha->loop_state) != LOOP_DOWN) { atomic_set(&ha->loop_state, LOOP_DOWN); - qla2x00_mark_all_devices_lost(ha); + qla2x00_mark_all_devices_lost(ha, 0); } else { if (!atomic_read(&ha->loop_down_timer)) atomic_set(&ha->loop_down_timer, diff --git a/drivers/scsi/qla2xxx/qla_isr.c b/drivers/scsi/qla2xxx/qla_isr.c index f63af081d4f..71a46fcee8c 100644 --- a/drivers/scsi/qla2xxx/qla_isr.c +++ b/drivers/scsi/qla2xxx/qla_isr.c @@ -389,7 +389,7 @@ qla2x00_async_event(scsi_qla_host_t *ha, uint16_t *mb) if (atomic_read(&ha->loop_state) != LOOP_DOWN) { atomic_set(&ha->loop_state, LOOP_DOWN); atomic_set(&ha->loop_down_timer, LOOP_DOWN_TIME); - qla2x00_mark_all_devices_lost(ha); + qla2x00_mark_all_devices_lost(ha, 1); } set_bit(REGISTER_FC4_NEEDED, &ha->dpc_flags); @@ -432,7 +432,7 @@ qla2x00_async_event(scsi_qla_host_t *ha, uint16_t *mb) atomic_set(&ha->loop_state, LOOP_DOWN); atomic_set(&ha->loop_down_timer, LOOP_DOWN_TIME); ha->device_flags |= DFLG_NO_CABLE; - qla2x00_mark_all_devices_lost(ha); + qla2x00_mark_all_devices_lost(ha, 1); } ha->flags.management_server_logged_in = 0; @@ -453,7 +453,7 @@ qla2x00_async_event(scsi_qla_host_t *ha, uint16_t *mb) if (atomic_read(&ha->loop_state) != LOOP_DOWN) { atomic_set(&ha->loop_state, LOOP_DOWN); atomic_set(&ha->loop_down_timer, LOOP_DOWN_TIME); - qla2x00_mark_all_devices_lost(ha); + qla2x00_mark_all_devices_lost(ha, 1); } set_bit(RESET_MARKER_NEEDED, &ha->dpc_flags); @@ -482,7 +482,7 @@ qla2x00_async_event(scsi_qla_host_t *ha, uint16_t *mb) if (!atomic_read(&ha->loop_down_timer)) atomic_set(&ha->loop_down_timer, LOOP_DOWN_TIME); - qla2x00_mark_all_devices_lost(ha); + qla2x00_mark_all_devices_lost(ha, 1); } if (!(test_bit(ABORT_ISP_ACTIVE, &ha->dpc_flags))) { @@ -506,7 +506,7 @@ qla2x00_async_event(scsi_qla_host_t *ha, uint16_t *mb) if (!atomic_read(&ha->loop_down_timer)) atomic_set(&ha->loop_down_timer, LOOP_DOWN_TIME); - qla2x00_mark_all_devices_lost(ha); + qla2x00_mark_all_devices_lost(ha, 1); } set_bit(LOOP_RESYNC_NEEDED, &ha->dpc_flags); @@ -580,7 +580,7 @@ qla2x00_async_event(scsi_qla_host_t *ha, uint16_t *mb) */ atomic_set(&ha->loop_state, LOOP_UP); - qla2x00_mark_all_devices_lost(ha); + qla2x00_mark_all_devices_lost(ha, 1); ha->flags.rscn_queue_overflow = 1; @@ -1091,7 +1091,7 @@ qla2x00_status_entry(scsi_qla_host_t *ha, void *pkt) cp->result = DID_BUS_BUSY << 16; if (atomic_read(&fcport->state) == FCS_ONLINE) { - qla2x00_mark_device_lost(ha, fcport, 1); + qla2x00_mark_device_lost(ha, fcport, 1, 1); } break; @@ -1135,7 +1135,7 @@ qla2x00_status_entry(scsi_qla_host_t *ha, void *pkt) /* Check to see if logout occurred. */ if ((le16_to_cpu(sts->status_flags) & SF_LOGOUT_SENT)) - qla2x00_mark_device_lost(ha, fcport, 1); + qla2x00_mark_device_lost(ha, fcport, 1, 1); break; case CS_QUEUE_FULL: diff --git a/drivers/scsi/qla2xxx/qla_os.c b/drivers/scsi/qla2xxx/qla_os.c index 4916847d84e..5866a7c706a 100644 --- a/drivers/scsi/qla2xxx/qla_os.c +++ b/drivers/scsi/qla2xxx/qla_os.c @@ -756,7 +756,7 @@ qla2xxx_eh_device_reset(struct scsi_cmnd *cmd) if (ret == SUCCESS) { if (fcport->flags & FC_FABRIC_DEVICE) { ha->isp_ops.fabric_logout(ha, fcport->loop_id); - qla2x00_mark_device_lost(ha, fcport); + qla2x00_mark_device_lost(ha, fcport, 0, 0); } } #endif @@ -1642,6 +1642,31 @@ qla2x00_free_device(scsi_qla_host_t *ha) pci_disable_device(ha->pdev); } +static inline void +qla2x00_schedule_rport_del(struct scsi_qla_host *ha, fc_port_t *fcport, + int defer) +{ + unsigned long flags; + struct fc_rport *rport; + + if (!fcport->rport) + return; + + rport = fcport->rport; + if (defer) { + spin_lock_irqsave(&fcport->rport_lock, flags); + fcport->drport = rport; + fcport->rport = NULL; + spin_unlock_irqrestore(&fcport->rport_lock, flags); + set_bit(FCPORT_UPDATE_NEEDED, &ha->dpc_flags); + } else { + spin_lock_irqsave(&fcport->rport_lock, flags); + fcport->rport = NULL; + spin_unlock_irqrestore(&fcport->rport_lock, flags); + fc_remote_port_delete(rport); + } +} + /* * qla2x00_mark_device_lost Updates fcport state when device goes offline. * @@ -1652,10 +1677,10 @@ qla2x00_free_device(scsi_qla_host_t *ha) * Context: */ void qla2x00_mark_device_lost(scsi_qla_host_t *ha, fc_port_t *fcport, - int do_login) + int do_login, int defer) { - if (atomic_read(&fcport->state) == FCS_ONLINE && fcport->rport) - schedule_work(&fcport->rport_del_work); + if (atomic_read(&fcport->state) == FCS_ONLINE) + qla2x00_schedule_rport_del(ha, fcport, defer); /* * We may need to retry the login, so don't change the state of the @@ -1702,7 +1727,7 @@ void qla2x00_mark_device_lost(scsi_qla_host_t *ha, fc_port_t *fcport, * Context: */ void -qla2x00_mark_all_devices_lost(scsi_qla_host_t *ha) +qla2x00_mark_all_devices_lost(scsi_qla_host_t *ha, int defer) { fc_port_t *fcport; @@ -1716,10 +1741,13 @@ qla2x00_mark_all_devices_lost(scsi_qla_host_t *ha) */ if (atomic_read(&fcport->state) == FCS_DEVICE_DEAD) continue; - if (atomic_read(&fcport->state) == FCS_ONLINE && fcport->rport) - schedule_work(&fcport->rport_del_work); + if (atomic_read(&fcport->state) == FCS_ONLINE) + qla2x00_schedule_rport_del(ha, fcport, defer); atomic_set(&fcport->state, FCS_DEVICE_LOST); } + + if (defer && ha->dpc_wait && !ha->dpc_active) + up(ha->dpc_wait); } /* @@ -2161,6 +2189,9 @@ qla2x00_do_dpc(void *data) ha->host_no)); } + if (test_and_clear_bit(FCPORT_UPDATE_NEEDED, &ha->dpc_flags)) + qla2x00_update_fcports(ha); + if (test_and_clear_bit(LOOP_RESET_NEEDED, &ha->dpc_flags)) { DEBUG(printk("scsi(%ld): dpc: sched loop_reset()\n", ha->host_no)); @@ -2219,13 +2250,8 @@ qla2x00_do_dpc(void *data) DEBUG(printk("scsi(%ld): port login OK: logged in ID 0x%x\n", ha->host_no, fcport->loop_id)); - fcport->port_login_retry_count = - ha->port_down_retry_count * PORT_RETRY_TIME; - atomic_set(&fcport->state, FCS_ONLINE); - atomic_set(&fcport->port_down_timer, - ha->port_down_retry_count * PORT_RETRY_TIME); - - fcport->login_retry = 0; + qla2x00_update_fcport(ha, + fcport); } else if (status == 1) { set_bit(RELOGIN_NEEDED, &ha->dpc_flags); /* retry the login again */ @@ -2469,6 +2495,7 @@ qla2x00_timer(scsi_qla_host_t *ha) if ((test_bit(ISP_ABORT_NEEDED, &ha->dpc_flags) || test_bit(LOOP_RESYNC_NEEDED, &ha->dpc_flags) || test_bit(LOOP_RESET_NEEDED, &ha->dpc_flags) || + test_bit(FCPORT_UPDATE_NEEDED, &ha->dpc_flags) || start_dpc || test_bit(LOGIN_RETRY_NEEDED, &ha->dpc_flags) || test_bit(RESET_MARKER_NEEDED, &ha->dpc_flags) || diff --git a/drivers/scsi/scsi_error.c b/drivers/scsi/scsi_error.c index a2333d2c7af..5cc97b72166 100644 --- a/drivers/scsi/scsi_error.c +++ b/drivers/scsi/scsi_error.c @@ -1350,7 +1350,7 @@ static void scsi_eh_lock_door(struct scsi_device *sdev) cmnd[4] = SCSI_REMOVAL_PREVENT; cmnd[5] = 0; - scsi_execute_async(sdev, cmnd, DMA_NONE, NULL, 0, 0, 10 * HZ, + scsi_execute_async(sdev, cmnd, 6, DMA_NONE, NULL, 0, 0, 10 * HZ, 5, NULL, NULL, GFP_KERNEL); } diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c index 3574ba935af..4a602853a98 100644 --- a/drivers/scsi/scsi_lib.c +++ b/drivers/scsi/scsi_lib.c @@ -436,6 +436,7 @@ free_bios: * scsi_execute_async - insert request * @sdev: scsi device * @cmd: scsi command + * @cmd_len: length of scsi cdb * @data_direction: data direction * @buffer: data buffer (this can be a kernel buffer or scatterlist) * @bufflen: len of buffer @@ -445,7 +446,7 @@ free_bios: * @flags: or into request flags **/ int scsi_execute_async(struct scsi_device *sdev, const unsigned char *cmd, - int data_direction, void *buffer, unsigned bufflen, + int cmd_len, int data_direction, void *buffer, unsigned bufflen, int use_sg, int timeout, int retries, void *privdata, void (*done)(void *, char *, int, int), gfp_t gfp) { @@ -472,7 +473,7 @@ int scsi_execute_async(struct scsi_device *sdev, const unsigned char *cmd, if (err) goto free_req; - req->cmd_len = COMMAND_SIZE(cmd[0]); + req->cmd_len = cmd_len; memcpy(req->cmd, cmd, req->cmd_len); req->sense = sioc->sense; req->sense_len = 0; diff --git a/drivers/scsi/scsi_transport_sas.c b/drivers/scsi/scsi_transport_sas.c index a3e0b7bc2d7..210dab5879f 100644 --- a/drivers/scsi/scsi_transport_sas.c +++ b/drivers/scsi/scsi_transport_sas.c @@ -377,7 +377,7 @@ static void sas_phy_release(struct device *dev) /** * sas_phy_alloc -- allocates and initialize a SAS PHY structure * @parent: Parent device - * @number: Port number + * @number: Phy index * * Allocates an SAS PHY structure. It will be added in the device tree * below the device specified by @parent, which has to be either a Scsi_Host @@ -595,8 +595,8 @@ struct sas_rphy *sas_rphy_alloc(struct sas_phy *parent) device_initialize(&rphy->dev); rphy->dev.parent = get_device(&parent->dev); rphy->dev.release = sas_rphy_release; - sprintf(rphy->dev.bus_id, "rphy-%d:%d", - shost->host_no, parent->number); + sprintf(rphy->dev.bus_id, "rphy-%d:%d-%d", + shost->host_no, parent->port_identifier, parent->number); transport_setup_device(&rphy->dev); return rphy; diff --git a/drivers/scsi/sg.c b/drivers/scsi/sg.c index 78aad9582bc..7d0700091f3 100644 --- a/drivers/scsi/sg.c +++ b/drivers/scsi/sg.c @@ -741,7 +741,7 @@ sg_common_write(Sg_fd * sfp, Sg_request * srp, hp->duration = jiffies_to_msecs(jiffies); /* Now send everything of to mid-level. The next time we hear about this packet is when sg_cmd_done() is called (i.e. a callback). */ - if (scsi_execute_async(sdp->device, cmnd, data_dir, srp->data.buffer, + if (scsi_execute_async(sdp->device, cmnd, hp->cmd_len, data_dir, srp->data.buffer, hp->dxfer_len, srp->data.k_use_sg, timeout, SG_DEFAULT_RETRIES, srp, sg_cmd_done, GFP_ATOMIC)) { diff --git a/drivers/scsi/st.c b/drivers/scsi/st.c index 13b1d3aac26..7f96f33c1bb 100644 --- a/drivers/scsi/st.c +++ b/drivers/scsi/st.c @@ -508,7 +508,7 @@ st_do_scsi(struct st_request * SRpnt, struct scsi_tape * STp, unsigned char *cmd STp->buffer->cmdstat.have_sense = 0; STp->buffer->syscall_result = 0; - if (scsi_execute_async(STp->device, cmd, direction, + if (scsi_execute_async(STp->device, cmd, COMMAND_SIZE(cmd[0]), direction, &((STp->buffer)->sg[0]), bytes, (STp->buffer)->sg_segs, timeout, retries, SRpnt, st_sleep_done, GFP_KERNEL)) { /* could not allocate the buffer or request was too large */ diff --git a/drivers/serial/21285.c b/drivers/serial/21285.c index 221999bcf8f..7aef7518b0d 100644 --- a/drivers/serial/21285.c +++ b/drivers/serial/21285.c @@ -366,7 +366,7 @@ static struct uart_port serial21285_port = { .irq = NO_IRQ, .fifosize = 16, .ops = &serial21285_ops, - .flags = ASYNC_BOOT_AUTOCONF, + .flags = UPF_BOOT_AUTOCONF, }; static void serial21285_setup_ports(void) diff --git a/drivers/serial/8250.c b/drivers/serial/8250.c index bc36edff205..179c1f065e6 100644 --- a/drivers/serial/8250.c +++ b/drivers/serial/8250.c @@ -31,7 +31,6 @@ #include <linux/init.h> #include <linux/console.h> #include <linux/sysrq.h> -#include <linux/mca.h> #include <linux/delay.h> #include <linux/platform_device.h> #include <linux/tty.h> @@ -2027,12 +2026,6 @@ static void serial8250_config_port(struct uart_port *port, int flags) int ret; /* - * Don't probe for MCA ports on non-MCA machines. - */ - if (up->port.flags & UPF_BOOT_ONLYMCA && !MCA_bus) - return; - - /* * Find the region that we can probe for. This in turn * tells us whether we can probe for the type of port. */ @@ -2164,7 +2157,7 @@ serial8250_register_ports(struct uart_driver *drv, struct device *dev) /* * Wait for transmitter & holding register to empty */ -static inline void wait_for_xmitr(struct uart_8250_port *up) +static inline void wait_for_xmitr(struct uart_8250_port *up, int bits) { unsigned int status, tmout = 10000; @@ -2178,7 +2171,7 @@ static inline void wait_for_xmitr(struct uart_8250_port *up) if (--tmout == 0) break; udelay(1); - } while ((status & BOTH_EMPTY) != BOTH_EMPTY); + } while ((status & bits) != bits); /* Wait up to 1s for flow control if necessary */ if (up->port.flags & UPF_CONS_FLOW) { @@ -2218,7 +2211,7 @@ serial8250_console_write(struct console *co, const char *s, unsigned int count) * Now, do each character */ for (i = 0; i < count; i++, s++) { - wait_for_xmitr(up); + wait_for_xmitr(up, UART_LSR_THRE); /* * Send the character out. @@ -2226,7 +2219,7 @@ serial8250_console_write(struct console *co, const char *s, unsigned int count) */ serial_out(up, UART_TX, *s); if (*s == 10) { - wait_for_xmitr(up); + wait_for_xmitr(up, UART_LSR_THRE); serial_out(up, UART_TX, 13); } } @@ -2235,8 +2228,8 @@ serial8250_console_write(struct console *co, const char *s, unsigned int count) * Finally, wait for transmitter to become empty * and restore the IER */ - wait_for_xmitr(up); - serial_out(up, UART_IER, ier); + wait_for_xmitr(up, BOTH_EMPTY); + serial_out(up, UART_IER, ier | UART_IER_THRI); } static int serial8250_console_setup(struct console *co, char *options) diff --git a/drivers/serial/Kconfig b/drivers/serial/Kconfig index 9fd1925de36..0d38f0f2ae2 100644 --- a/drivers/serial/Kconfig +++ b/drivers/serial/Kconfig @@ -23,7 +23,7 @@ config SERIAL_8250 work.) To compile this driver as a module, choose M here: the - module will be called serial. + module will be called 8250. [WARNING: Do not compile this driver as a module if you are using non-standard serial ports, since the configuration information will be lost when the driver is unloaded. This limitation may be lifted diff --git a/drivers/serial/amba-pl010.c b/drivers/serial/amba-pl010.c index 3490022e9fd..429de2723a1 100644 --- a/drivers/serial/amba-pl010.c +++ b/drivers/serial/amba-pl010.c @@ -566,7 +566,7 @@ static struct uart_amba_port amba_ports[UART_NR] = { .uartclk = 14745600, .fifosize = 16, .ops = &amba_pl010_pops, - .flags = ASYNC_BOOT_AUTOCONF, + .flags = UPF_BOOT_AUTOCONF, .line = 0, }, .dtr_mask = 1 << 5, @@ -581,7 +581,7 @@ static struct uart_amba_port amba_ports[UART_NR] = { .uartclk = 14745600, .fifosize = 16, .ops = &amba_pl010_pops, - .flags = ASYNC_BOOT_AUTOCONF, + .flags = UPF_BOOT_AUTOCONF, .line = 1, }, .dtr_mask = 1 << 7, diff --git a/drivers/serial/clps711x.c b/drivers/serial/clps711x.c index 8ef999481f9..ce7b2e4ecd1 100644 --- a/drivers/serial/clps711x.c +++ b/drivers/serial/clps711x.c @@ -410,7 +410,7 @@ static struct uart_port clps711x_ports[UART_NR] = { .fifosize = 16, .ops = &clps711x_pops, .line = 0, - .flags = ASYNC_BOOT_AUTOCONF, + .flags = UPF_BOOT_AUTOCONF, }, { .iobase = SYSCON2, @@ -419,7 +419,7 @@ static struct uart_port clps711x_ports[UART_NR] = { .fifosize = 16, .ops = &clps711x_pops, .line = 1, - .flags = ASYNC_BOOT_AUTOCONF, + .flags = UPF_BOOT_AUTOCONF, } }; diff --git a/drivers/serial/imx.c b/drivers/serial/imx.c index 587cc6a9511..858048efe1e 100644 --- a/drivers/serial/imx.c +++ b/drivers/serial/imx.c @@ -402,10 +402,10 @@ static int imx_startup(struct uart_port *port) DRIVER_NAME, sport); if (retval) goto error_out2; - retval = request_irq(sport->rtsirq, imx_rtsint, 0, + retval = request_irq(sport->rtsirq, imx_rtsint, + SA_TRIGGER_FALLING | SA_TRIGGER_RISING, DRIVER_NAME, sport); if (retval) goto error_out3; - set_irq_type(sport->rtsirq, IRQT_BOTHEDGE); /* * Finally, clear and enable interrupts @@ -674,7 +674,7 @@ static struct imx_port imx_ports[] = { .irq = UART1_MINT_RX, .uartclk = 16000000, .fifosize = 8, - .flags = ASYNC_BOOT_AUTOCONF, + .flags = UPF_BOOT_AUTOCONF, .ops = &imx_pops, .line = 0, }, @@ -690,7 +690,7 @@ static struct imx_port imx_ports[] = { .irq = UART2_MINT_RX, .uartclk = 16000000, .fifosize = 8, - .flags = ASYNC_BOOT_AUTOCONF, + .flags = UPF_BOOT_AUTOCONF, .ops = &imx_pops, .line = 1, }, diff --git a/drivers/serial/s3c2410.c b/drivers/serial/s3c2410.c index eb4883efb7c..0a2dd6c5b95 100644 --- a/drivers/serial/s3c2410.c +++ b/drivers/serial/s3c2410.c @@ -1060,7 +1060,7 @@ static int s3c24xx_serial_init_port(struct s3c24xx_uart_port *ourport, dbg("resource %p (%lx..%lx)\n", res, res->start, res->end); port->mapbase = res->start; - port->membase = S3C24XX_VA_UART + (res->start - S3C2410_PA_UART); + port->membase = S3C24XX_VA_UART + (res->start - S3C24XX_PA_UART); port->irq = platform_get_irq(platdev, 0); ourport->clk = clk_get(&platdev->dev, "uart"); diff --git a/drivers/serial/sa1100.c b/drivers/serial/sa1100.c index 1bd93168f50..ff7b60b4de3 100644 --- a/drivers/serial/sa1100.c +++ b/drivers/serial/sa1100.c @@ -665,21 +665,21 @@ void __init sa1100_register_uart(int idx, int port) sa1100_ports[idx].port.membase = (void __iomem *)&Ser1UTCR0; sa1100_ports[idx].port.mapbase = _Ser1UTCR0; sa1100_ports[idx].port.irq = IRQ_Ser1UART; - sa1100_ports[idx].port.flags = ASYNC_BOOT_AUTOCONF; + sa1100_ports[idx].port.flags = UPF_BOOT_AUTOCONF; break; case 2: sa1100_ports[idx].port.membase = (void __iomem *)&Ser2UTCR0; sa1100_ports[idx].port.mapbase = _Ser2UTCR0; sa1100_ports[idx].port.irq = IRQ_Ser2ICP; - sa1100_ports[idx].port.flags = ASYNC_BOOT_AUTOCONF; + sa1100_ports[idx].port.flags = UPF_BOOT_AUTOCONF; break; case 3: sa1100_ports[idx].port.membase = (void __iomem *)&Ser3UTCR0; sa1100_ports[idx].port.mapbase = _Ser3UTCR0; sa1100_ports[idx].port.irq = IRQ_Ser3UART; - sa1100_ports[idx].port.flags = ASYNC_BOOT_AUTOCONF; + sa1100_ports[idx].port.flags = UPF_BOOT_AUTOCONF; break; default: diff --git a/drivers/serial/serial_core.c b/drivers/serial/serial_core.c index 943770470b9..0717abfdae0 100644 --- a/drivers/serial/serial_core.c +++ b/drivers/serial/serial_core.c @@ -332,7 +332,7 @@ uart_get_baud_rate(struct uart_port *port, struct termios *termios, struct termios *old, unsigned int min, unsigned int max) { unsigned int try, baud, altbaud = 38400; - unsigned int flags = port->flags & UPF_SPD_MASK; + upf_t flags = port->flags & UPF_SPD_MASK; if (flags == UPF_SPD_HI) altbaud = 57600; @@ -615,8 +615,9 @@ static int uart_set_info(struct uart_state *state, struct serial_struct new_serial; struct uart_port *port = state->port; unsigned long new_port; - unsigned int change_irq, change_port, old_flags, closing_wait; + unsigned int change_irq, change_port, closing_wait; unsigned int old_custom_divisor, close_delay; + upf_t old_flags, new_flags; int retval = 0; if (copy_from_user(&new_serial, newinfo, sizeof(new_serial))) @@ -655,6 +656,7 @@ static int uart_set_info(struct uart_state *state, new_serial.type != port->type; old_flags = port->flags; + new_flags = new_serial.flags; old_custom_divisor = port->custom_divisor; if (!capable(CAP_SYS_ADMIN)) { @@ -664,10 +666,10 @@ static int uart_set_info(struct uart_state *state, (close_delay != state->close_delay) || (closing_wait != state->closing_wait) || (new_serial.xmit_fifo_size != port->fifosize) || - (((new_serial.flags ^ old_flags) & ~UPF_USR_MASK) != 0)) + (((new_flags ^ old_flags) & ~UPF_USR_MASK) != 0)) goto exit; port->flags = ((port->flags & ~UPF_USR_MASK) | - (new_serial.flags & UPF_USR_MASK)); + (new_flags & UPF_USR_MASK)); port->custom_divisor = new_serial.custom_divisor; goto check_and_exit; } @@ -764,7 +766,7 @@ static int uart_set_info(struct uart_state *state, port->irq = new_serial.irq; port->uartclk = new_serial.baud_base * 16; port->flags = (port->flags & ~UPF_CHANGE_MASK) | - (new_serial.flags & UPF_CHANGE_MASK); + (new_flags & UPF_CHANGE_MASK); port->custom_divisor = new_serial.custom_divisor; state->close_delay = close_delay; state->closing_wait = closing_wait; @@ -1870,7 +1872,7 @@ int uart_suspend_port(struct uart_driver *drv, struct uart_port *port) mutex_lock(&state->mutex); if (state->info && state->info->flags & UIF_INITIALIZED) { - struct uart_ops *ops = port->ops; + const struct uart_ops *ops = port->ops; spin_lock_irq(&port->lock); ops->stop_tx(port); @@ -1932,7 +1934,7 @@ int uart_resume_port(struct uart_driver *drv, struct uart_port *port) } if (state->info && state->info->flags & UIF_INITIALIZED) { - struct uart_ops *ops = port->ops; + const struct uart_ops *ops = port->ops; int ret; ops->set_mctrl(port, 0); diff --git a/drivers/serial/serial_lh7a40x.c b/drivers/serial/serial_lh7a40x.c index d4a1f0e798c..d0490f67f59 100644 --- a/drivers/serial/serial_lh7a40x.c +++ b/drivers/serial/serial_lh7a40x.c @@ -506,7 +506,7 @@ static struct uart_port_lh7a40x lh7a40x_ports[DEV_NR] = { .uartclk = 14745600/2, .fifosize = 16, .ops = &lh7a40x_uart_ops, - .flags = ASYNC_BOOT_AUTOCONF, + .flags = UPF_BOOT_AUTOCONF, .line = 0, }, }, @@ -519,7 +519,7 @@ static struct uart_port_lh7a40x lh7a40x_ports[DEV_NR] = { .uartclk = 14745600/2, .fifosize = 16, .ops = &lh7a40x_uart_ops, - .flags = ASYNC_BOOT_AUTOCONF, + .flags = UPF_BOOT_AUTOCONF, .line = 1, }, }, @@ -532,7 +532,7 @@ static struct uart_port_lh7a40x lh7a40x_ports[DEV_NR] = { .uartclk = 14745600/2, .fifosize = 16, .ops = &lh7a40x_uart_ops, - .flags = ASYNC_BOOT_AUTOCONF, + .flags = UPF_BOOT_AUTOCONF, .line = 2, }, }, diff --git a/drivers/serial/sh-sci.c b/drivers/serial/sh-sci.c index a9e07075962..0111206327c 100644 --- a/drivers/serial/sh-sci.c +++ b/drivers/serial/sh-sci.c @@ -1113,10 +1113,10 @@ static struct sci_port sci_ports[SCI_NPORTS] = { .port = { .membase = (void *)0xfffffe80, .mapbase = 0xfffffe80, - .iotype = SERIAL_IO_MEM, + .iotype = UPIO_MEM, .irq = 25, .ops = &sci_uart_ops, - .flags = ASYNC_BOOT_AUTOCONF, + .flags = UPF_BOOT_AUTOCONF, .line = 0, }, .type = PORT_SCI, @@ -1128,10 +1128,10 @@ static struct sci_port sci_ports[SCI_NPORTS] = { .port = { .membase = (void *)SCIF0, .mapbase = SCIF0, - .iotype = SERIAL_IO_MEM, + .iotype = UPIO_MEM, .irq = 55, .ops = &sci_uart_ops, - .flags = ASYNC_BOOT_AUTOCONF, + .flags = UPF_BOOT_AUTOCONF, .line = 0, }, .type = PORT_SCIF, @@ -1142,10 +1142,10 @@ static struct sci_port sci_ports[SCI_NPORTS] = { .port = { .membase = (void *)SCIF2, .mapbase = SCIF2, - .iotype = SERIAL_IO_MEM, + .iotype = UPIO_MEM, .irq = 59, .ops = &sci_uart_ops, - .flags = ASYNC_BOOT_AUTOCONF, + .flags = UPF_BOOT_AUTOCONF, .line = 1, }, .type = PORT_SCIF, @@ -1157,10 +1157,10 @@ static struct sci_port sci_ports[SCI_NPORTS] = { .port = { .membase = (void *)0xfffffe80, .mapbase = 0xfffffe80, - .iotype = SERIAL_IO_MEM, + .iotype = UPIO_MEM, .irq = 25, .ops = &sci_uart_ops, - .flags = ASYNC_BOOT_AUTOCONF, + .flags = UPF_BOOT_AUTOCONF, .line = 0, }, .type = PORT_SCI, @@ -1171,10 +1171,10 @@ static struct sci_port sci_ports[SCI_NPORTS] = { .port = { .membase = (void *)0xa4000150, .mapbase = 0xa4000150, - .iotype = SERIAL_IO_MEM, + .iotype = UPIO_MEM, .irq = 59, .ops = &sci_uart_ops, - .flags = ASYNC_BOOT_AUTOCONF, + .flags = UPF_BOOT_AUTOCONF, .line = 1, }, .type = PORT_SCIF, @@ -1185,10 +1185,10 @@ static struct sci_port sci_ports[SCI_NPORTS] = { .port = { .membase = (void *)0xa4000140, .mapbase = 0xa4000140, - .iotype = SERIAL_IO_MEM, + .iotype = UPIO_MEM, .irq = 55, .ops = &sci_uart_ops, - .flags = ASYNC_BOOT_AUTOCONF, + .flags = UPF_BOOT_AUTOCONF, .line = 2, }, .type = PORT_IRDA, @@ -1200,10 +1200,10 @@ static struct sci_port sci_ports[SCI_NPORTS] = { .port = { .membase = (void *)0xA4430000, .mapbase = 0xA4430000, - .iotype = SERIAL_IO_MEM, + .iotype = UPIO_MEM, .irq = 25, .ops = &sci_uart_ops, - .flags = ASYNC_BOOT_AUTOCONF, + .flags = UPF_BOOT_AUTOCONF, .line = 0, }, .type = PORT_SCIF, @@ -1215,10 +1215,10 @@ static struct sci_port sci_ports[SCI_NPORTS] = { .port = { .membase = (void *)0xffe00000, .mapbase = 0xffe00000, - .iotype = SERIAL_IO_MEM, + .iotype = UPIO_MEM, .irq = 25, .ops = &sci_uart_ops, - .flags = ASYNC_BOOT_AUTOCONF, + .flags = UPF_BOOT_AUTOCONF, .line = 0, }, .type = PORT_SCIF, @@ -1230,10 +1230,10 @@ static struct sci_port sci_ports[SCI_NPORTS] = { .port = { .membase = (void *)0xffe80000, .mapbase = 0xffe80000, - .iotype = SERIAL_IO_MEM, + .iotype = UPIO_MEM, .irq = 43, .ops = &sci_uart_ops, - .flags = ASYNC_BOOT_AUTOCONF, + .flags = UPF_BOOT_AUTOCONF, .line = 0, }, .type = PORT_SCIF, @@ -1245,10 +1245,10 @@ static struct sci_port sci_ports[SCI_NPORTS] = { .port = { .membase = (void *)0xffe00000, .mapbase = 0xffe00000, - .iotype = SERIAL_IO_MEM, + .iotype = UPIO_MEM, .irq = 25, .ops = &sci_uart_ops, - .flags = ASYNC_BOOT_AUTOCONF, + .flags = UPF_BOOT_AUTOCONF, .line = 0, }, .type = PORT_SCI, @@ -1259,10 +1259,10 @@ static struct sci_port sci_ports[SCI_NPORTS] = { .port = { .membase = (void *)0xffe80000, .mapbase = 0xffe80000, - .iotype = SERIAL_IO_MEM, + .iotype = UPIO_MEM, .irq = 43, .ops = &sci_uart_ops, - .flags = ASYNC_BOOT_AUTOCONF, + .flags = UPF_BOOT_AUTOCONF, .line = 1, }, .type = PORT_SCIF, @@ -1274,10 +1274,10 @@ static struct sci_port sci_ports[SCI_NPORTS] = { .port = { .membase = (void *)0xfe600000, .mapbase = 0xfe600000, - .iotype = SERIAL_IO_MEM, + .iotype = UPIO_MEM, .irq = 55, .ops = &sci_uart_ops, - .flags = ASYNC_BOOT_AUTOCONF, + .flags = UPF_BOOT_AUTOCONF, .line = 0, }, .type = PORT_SCIF, @@ -1288,10 +1288,10 @@ static struct sci_port sci_ports[SCI_NPORTS] = { .port = { .membase = (void *)0xfe610000, .mapbase = 0xfe610000, - .iotype = SERIAL_IO_MEM, + .iotype = UPIO_MEM, .irq = 75, .ops = &sci_uart_ops, - .flags = ASYNC_BOOT_AUTOCONF, + .flags = UPF_BOOT_AUTOCONF, .line = 1, }, .type = PORT_SCIF, @@ -1302,10 +1302,10 @@ static struct sci_port sci_ports[SCI_NPORTS] = { .port = { .membase = (void *)0xfe620000, .mapbase = 0xfe620000, - .iotype = SERIAL_IO_MEM, + .iotype = UPIO_MEM, .irq = 79, .ops = &sci_uart_ops, - .flags = ASYNC_BOOT_AUTOCONF, + .flags = UPF_BOOT_AUTOCONF, .line = 2, }, .type = PORT_SCIF, @@ -1317,10 +1317,10 @@ static struct sci_port sci_ports[SCI_NPORTS] = { .port = { .membase = (void *)0xffe80000, .mapbase = 0xffe80000, - .iotype = SERIAL_IO_MEM, + .iotype = UPIO_MEM, .irq = 43, .ops = &sci_uart_ops, - .flags = ASYNC_BOOT_AUTOCONF, + .flags = UPF_BOOT_AUTOCONF, .line = 0, }, .type = PORT_SCIF, @@ -1332,10 +1332,10 @@ static struct sci_port sci_ports[SCI_NPORTS] = { .port = { .membase = (void *)0xffe00000, .mapbase = 0xffe00000, - .iotype = SERIAL_IO_MEM, + .iotype = UPIO_MEM, .irq = 26, .ops = &sci_uart_ops, - .flags = ASYNC_BOOT_AUTOCONF, + .flags = UPF_BOOT_AUTOCONF, .line = 0, }, .type = PORT_SCIF, @@ -1346,10 +1346,10 @@ static struct sci_port sci_ports[SCI_NPORTS] = { .port = { .membase = (void *)0xffe80000, .mapbase = 0xffe80000, - .iotype = SERIAL_IO_MEM, + .iotype = UPIO_MEM, .irq = 43, .ops = &sci_uart_ops, - .flags = ASYNC_BOOT_AUTOCONF, + .flags = UPF_BOOT_AUTOCONF, .line = 1, }, .type = PORT_SCIF, @@ -1359,10 +1359,10 @@ static struct sci_port sci_ports[SCI_NPORTS] = { #elif defined(CONFIG_CPU_SUBTYPE_SH5_101) || defined(CONFIG_CPU_SUBTYPE_SH5_103) { .port = { - .iotype = SERIAL_IO_MEM, + .iotype = UPIO_MEM, .irq = 42, .ops = &sci_uart_ops, - .flags = ASYNC_BOOT_AUTOCONF, + .flags = UPF_BOOT_AUTOCONF, .line = 0, }, .type = PORT_SCIF, @@ -1374,10 +1374,10 @@ static struct sci_port sci_ports[SCI_NPORTS] = { .port = { .membase = (void *)0x00ffffb0, .mapbase = 0x00ffffb0, - .iotype = SERIAL_IO_MEM, + .iotype = UPIO_MEM, .irq = 54, .ops = &sci_uart_ops, - .flags = ASYNC_BOOT_AUTOCONF, + .flags = UPF_BOOT_AUTOCONF, .line = 0, }, .type = PORT_SCI, @@ -1388,10 +1388,10 @@ static struct sci_port sci_ports[SCI_NPORTS] = { .port = { .membase = (void *)0x00ffffb8, .mapbase = 0x00ffffb8, - .iotype = SERIAL_IO_MEM, + .iotype = UPIO_MEM, .irq = 58, .ops = &sci_uart_ops, - .flags = ASYNC_BOOT_AUTOCONF, + .flags = UPF_BOOT_AUTOCONF, .line = 1, }, .type = PORT_SCI, @@ -1402,10 +1402,10 @@ static struct sci_port sci_ports[SCI_NPORTS] = { .port = { .membase = (void *)0x00ffffc0, .mapbase = 0x00ffffc0, - .iotype = SERIAL_IO_MEM, + .iotype = UPIO_MEM, .irq = 62, .ops = &sci_uart_ops, - .flags = ASYNC_BOOT_AUTOCONF, + .flags = UPF_BOOT_AUTOCONF, .line = 2, }, .type = PORT_SCI, @@ -1417,10 +1417,10 @@ static struct sci_port sci_ports[SCI_NPORTS] = { .port = { .membase = (void *)0x00ffff78, .mapbase = 0x00ffff78, - .iotype = SERIAL_IO_MEM, + .iotype = UPIO_MEM, .irq = 90, .ops = &sci_uart_ops, - .flags = ASYNC_BOOT_AUTOCONF, + .flags = UPF_BOOT_AUTOCONF, .line = 0, }, .type = PORT_SCI, @@ -1431,10 +1431,10 @@ static struct sci_port sci_ports[SCI_NPORTS] = { .port = { .membase = (void *)0x00ffff80, .mapbase = 0x00ffff80, - .iotype = SERIAL_IO_MEM, + .iotype = UPIO_MEM, .irq = 94, .ops = &sci_uart_ops, - .flags = ASYNC_BOOT_AUTOCONF, + .flags = UPF_BOOT_AUTOCONF, .line = 1, }, .type = PORT_SCI, @@ -1445,10 +1445,10 @@ static struct sci_port sci_ports[SCI_NPORTS] = { .port = { .membase = (void *)0x00ffff88, .mapbase = 0x00ffff88, - .iotype = SERIAL_IO_MEM, + .iotype = UPIO_MEM, .irq = 98, .ops = &sci_uart_ops, - .flags = ASYNC_BOOT_AUTOCONF, + .flags = UPF_BOOT_AUTOCONF, .line = 2, }, .type = PORT_SCI, diff --git a/drivers/serial/sunsu.c b/drivers/serial/sunsu.c index 9a3665b34d9..bc67442c6b4 100644 --- a/drivers/serial/sunsu.c +++ b/drivers/serial/sunsu.c @@ -669,7 +669,7 @@ static int sunsu_startup(struct uart_port *port) * if it is, then bail out, because there's likely no UART * here. */ - if (!(up->port.flags & ASYNC_BUGGY_UART) && + if (!(up->port.flags & UPF_BUGGY_UART) && (serial_inp(up, UART_LSR) == 0xff)) { printk("ttyS%d: LSR safety check engaged!\n", up->port.line); return -ENODEV; @@ -707,7 +707,7 @@ static int sunsu_startup(struct uart_port *port) up->ier = UART_IER_RLSI | UART_IER_RDI; serial_outp(up, UART_IER, up->ier); - if (up->port.flags & ASYNC_FOURPORT) { + if (up->port.flags & UPF_FOURPORT) { unsigned int icp; /* * Enable interrupts on the AST Fourport board @@ -740,7 +740,7 @@ static void sunsu_shutdown(struct uart_port *port) serial_outp(up, UART_IER, 0); spin_lock_irqsave(&up->port.lock, flags); - if (up->port.flags & ASYNC_FOURPORT) { + if (up->port.flags & UPF_FOURPORT) { /* reset interrupts on the AST Fourport board */ inb((up->port.iobase & 0xfe0) | 0x1f); up->port.mctrl |= TIOCM_OUT1; @@ -1132,7 +1132,7 @@ ebus_done: spin_lock_irqsave(&up->port.lock, flags); - if (!(up->port.flags & ASYNC_BUGGY_UART)) { + if (!(up->port.flags & UPF_BUGGY_UART)) { /* * Do a simple existence test first; if we fail this, there's * no point trying anything else. @@ -1170,7 +1170,7 @@ ebus_done: * manufacturer would be stupid enough to design a board * that conflicts with COM 1-4 --- we hope! */ - if (!(up->port.flags & ASYNC_SKIP_TEST)) { + if (!(up->port.flags & UPF_SKIP_TEST)) { serial_outp(up, UART_MCR, UART_MCR_LOOP | 0x0A); status1 = serial_inp(up, UART_MSR) & 0xF0; serial_outp(up, UART_MCR, save_mcr); @@ -1371,7 +1371,7 @@ static __inline__ void wait_for_xmitr(struct uart_sunsu_port *up) } while ((status & BOTH_EMPTY) != BOTH_EMPTY); /* Wait up to 1s for flow control if necessary */ - if (up->port.flags & ASYNC_CONS_FLOW) { + if (up->port.flags & UPF_CONS_FLOW) { tmout = 1000000; while (--tmout && ((serial_in(up, UART_MSR) & UART_MSR_CTS) == 0)) @@ -1513,7 +1513,7 @@ static int __init sunsu_serial_init(void) up->su_type == SU_PORT_KBD) continue; - up->port.flags |= ASYNC_BOOT_AUTOCONF; + up->port.flags |= UPF_BOOT_AUTOCONF; up->port.type = PORT_UNKNOWN; up->port.uartclk = (SU_BASE_BAUD * 16); diff --git a/drivers/video/amba-clcd.c b/drivers/video/amba-clcd.c index b2187175d03..6761b68c35e 100644 --- a/drivers/video/amba-clcd.c +++ b/drivers/video/amba-clcd.c @@ -116,9 +116,10 @@ clcdfb_set_bitfields(struct clcd_fb *fb, struct fb_var_screeninfo *var) int ret = 0; memset(&var->transp, 0, sizeof(var->transp)); - memset(&var->red, 0, sizeof(var->red)); - memset(&var->green, 0, sizeof(var->green)); - memset(&var->blue, 0, sizeof(var->blue)); + + var->red.msb_right = 0; + var->green.msb_right = 0; + var->blue.msb_right = 0; switch (var->bits_per_pixel) { case 1: @@ -133,34 +134,20 @@ clcdfb_set_bitfields(struct clcd_fb *fb, struct fb_var_screeninfo *var) var->blue.offset = 0; break; case 16: - var->red.length = 5; - var->green.length = 6; - var->blue.length = 5; - if (fb->panel->cntl & CNTL_BGR) { - var->red.offset = 11; - var->green.offset = 5; - var->blue.offset = 0; - } else { - var->red.offset = 0; - var->green.offset = 5; - var->blue.offset = 11; - } + var->red.length = 5; + var->blue.length = 5; + /* + * Green length can be 5 or 6 depending whether + * we're operating in RGB555 or RGB565 mode. + */ + if (var->green.length != 5 && var->green.length != 6) + var->green.length = 6; break; case 32: if (fb->panel->cntl & CNTL_LCDTFT) { var->red.length = 8; var->green.length = 8; var->blue.length = 8; - - if (fb->panel->cntl & CNTL_BGR) { - var->red.offset = 16; - var->green.offset = 8; - var->blue.offset = 0; - } else { - var->red.offset = 0; - var->green.offset = 8; - var->blue.offset = 16; - } break; } default: @@ -168,6 +155,23 @@ clcdfb_set_bitfields(struct clcd_fb *fb, struct fb_var_screeninfo *var) break; } + /* + * >= 16bpp displays have separate colour component bitfields + * encoded in the pixel data. Calculate their position from + * the bitfield length defined above. + */ + if (ret == 0 && var->bits_per_pixel >= 16) { + if (fb->panel->cntl & CNTL_BGR) { + var->blue.offset = 0; + var->green.offset = var->blue.offset + var->blue.length; + var->red.offset = var->green.offset + var->green.length; + } else { + var->red.offset = 0; + var->green.offset = var->red.offset + var->red.length; + var->blue.offset = var->green.offset + var->green.length; + } + } + return ret; } @@ -411,6 +411,7 @@ static int __bio_add_page(request_queue_t *q, struct bio *bio, struct page /** * bio_add_pc_page - attempt to add page to bio + * @q: the target queue * @bio: destination bio * @page: page to add * @len: vec entry length diff --git a/include/asm-arm/arch-s3c2410/debug-macro.S b/include/asm-arm/arch-s3c2410/debug-macro.S index abfbe45cd17..5f8223e700d 100644 --- a/include/asm-arm/arch-s3c2410/debug-macro.S +++ b/include/asm-arm/arch-s3c2410/debug-macro.S @@ -25,7 +25,7 @@ .macro addruart, rx mrc p15, 0, \rx, c1, c0 tst \rx, #1 - ldreq \rx, = S3C2410_PA_UART + ldreq \rx, = S3C24XX_PA_UART ldrne \rx, = S3C24XX_VA_UART #if CONFIG_DEBUG_S3C2410_UART != 0 add \rx, \rx, #(S3C2410_UART1_OFF * CONFIG_DEBUG_S3C2410_UART) @@ -44,7 +44,7 @@ 1003: mrc p15, 0, \rd, c1, c0 tst \rd, #1 - addeq \rd, \rx, #(S3C2410_PA_GPIO - S3C2410_PA_UART) + addeq \rd, \rx, #(S3C24XX_PA_GPIO - S3C24XX_PA_UART) addne \rd, \rx, #(S3C24XX_VA_GPIO - S3C24XX_VA_UART) bic \rd, \rd, #0xff000 ldr \rd, [ \rd, # S3C2410_GSTATUS1 - S3C2410_GPIOREG(0) ] @@ -75,7 +75,7 @@ 1003: mrc p15, 0, \rd, c1, c0 tst \rd, #1 - addeq \rd, \rx, #(S3C2410_PA_GPIO - S3C2410_PA_UART) + addeq \rd, \rx, #(S3C24XX_PA_GPIO - S3C24XX_PA_UART) addne \rd, \rx, #(S3C24XX_VA_GPIO - S3C24XX_VA_UART) bic \rd, \rd, #0xff000 ldr \rd, [ \rd, # S3C2410_GSTATUS1 - S3C2410_GPIOREG(0) ] diff --git a/include/asm-arm/arch-s3c2410/map.h b/include/asm-arm/arch-s3c2410/map.h index 1833ea5c422..c380d264a84 100644 --- a/include/asm-arm/arch-s3c2410/map.h +++ b/include/asm-arm/arch-s3c2410/map.h @@ -14,6 +14,7 @@ * 06-Jan-2003 BJD Linux 2.6.0 version, moved bast specifics out * 10-Feb-2005 BJD Added CAMIF definition from guillaume.gourat@nexvision.tv * 10-Mar-2005 LCVR Added support to S3C2400, changed {VA,SZ} names + * 15-Jan-2006 LCVR Added S3C24XX_PA macros for common S3C24XX resources */ #ifndef __ASM_ARCH_MAP_H @@ -188,5 +189,42 @@ #define S3C2400_SDRAM_PA (S3C2400_CS6) +/* Use a single interface for common resources between S3C24XX cpus */ + +#ifdef CONFIG_CPU_S3C2400 +#define S3C24XX_PA_IRQ S3C2400_PA_IRQ +#define S3C24XX_PA_MEMCTRL S3C2400_PA_MEMCTRL +#define S3C24XX_PA_USBHOST S3C2400_PA_USBHOST +#define S3C24XX_PA_DMA S3C2400_PA_DMA +#define S3C24XX_PA_CLKPWR S3C2400_PA_CLKPWR +#define S3C24XX_PA_LCD S3C2400_PA_LCD +#define S3C24XX_PA_UART S3C2400_PA_UART +#define S3C24XX_PA_TIMER S3C2400_PA_TIMER +#define S3C24XX_PA_USBDEV S3C2400_PA_USBDEV +#define S3C24XX_PA_WATCHDOG S3C2400_PA_WATCHDOG +#define S3C24XX_PA_IIC S3C2400_PA_IIC +#define S3C24XX_PA_IIS S3C2400_PA_IIS +#define S3C24XX_PA_GPIO S3C2400_PA_GPIO +#define S3C24XX_PA_RTC S3C2400_PA_RTC +#define S3C24XX_PA_ADC S3C2400_PA_ADC +#define S3C24XX_PA_SPI S3C2400_PA_SPI +#else +#define S3C24XX_PA_IRQ S3C2410_PA_IRQ +#define S3C24XX_PA_MEMCTRL S3C2410_PA_MEMCTRL +#define S3C24XX_PA_USBHOST S3C2410_PA_USBHOST +#define S3C24XX_PA_DMA S3C2410_PA_DMA +#define S3C24XX_PA_CLKPWR S3C2410_PA_CLKPWR +#define S3C24XX_PA_LCD S3C2410_PA_LCD +#define S3C24XX_PA_UART S3C2410_PA_UART +#define S3C24XX_PA_TIMER S3C2410_PA_TIMER +#define S3C24XX_PA_USBDEV S3C2410_PA_USBDEV +#define S3C24XX_PA_WATCHDOG S3C2410_PA_WATCHDOG +#define S3C24XX_PA_IIC S3C2410_PA_IIC +#define S3C24XX_PA_IIS S3C2410_PA_IIS +#define S3C24XX_PA_GPIO S3C2410_PA_GPIO +#define S3C24XX_PA_RTC S3C2410_PA_RTC +#define S3C24XX_PA_ADC S3C2410_PA_ADC +#define S3C24XX_PA_SPI S3C2410_PA_SPI +#endif #endif /* __ASM_ARCH_MAP_H */ diff --git a/include/asm-arm/arch-s3c2410/regs-serial.h b/include/asm-arm/arch-s3c2410/regs-serial.h index ce1bbbaad6d..83b01254c4a 100644 --- a/include/asm-arm/arch-s3c2410/regs-serial.h +++ b/include/asm-arm/arch-s3c2410/regs-serial.h @@ -39,9 +39,9 @@ #define S3C24XX_VA_UART1 (S3C24XX_VA_UART + 0x4000 ) #define S3C24XX_VA_UART2 (S3C24XX_VA_UART + 0x8000 ) -#define S3C2410_PA_UART0 (S3C2410_PA_UART) -#define S3C2410_PA_UART1 (S3C2410_PA_UART + 0x4000 ) -#define S3C2410_PA_UART2 (S3C2410_PA_UART + 0x8000 ) +#define S3C2410_PA_UART0 (S3C24XX_PA_UART) +#define S3C2410_PA_UART1 (S3C24XX_PA_UART + 0x4000 ) +#define S3C2410_PA_UART2 (S3C24XX_PA_UART + 0x8000 ) #define S3C2410_URXH (0x24) #define S3C2410_UTXH (0x20) diff --git a/include/asm-arm/arch-s3c2410/uncompress.h b/include/asm-arm/arch-s3c2410/uncompress.h index ddd1578a7ee..4367ec054b5 100644 --- a/include/asm-arm/arch-s3c2410/uncompress.h +++ b/include/asm-arm/arch-s3c2410/uncompress.h @@ -35,13 +35,13 @@ #undef S3C2410_GPIOREG #undef S3C2410_WDOGREG -#define S3C2410_GPIOREG(x) ((S3C2410_PA_GPIO + (x))) -#define S3C2410_WDOGREG(x) ((S3C2410_PA_WATCHDOG + (x))) +#define S3C2410_GPIOREG(x) ((S3C24XX_PA_GPIO + (x))) +#define S3C2410_WDOGREG(x) ((S3C24XX_PA_WATCHDOG + (x))) /* how many bytes we allow into the FIFO at a time in FIFO mode */ #define FIFO_MAX (14) -#define uart_base S3C2410_PA_UART + (0x4000*CONFIG_S3C2410_LOWLEVEL_UART_PORT) +#define uart_base S3C24XX_PA_UART + (0x4000*CONFIG_S3C2410_LOWLEVEL_UART_PORT) static __inline__ void uart_wr(unsigned int reg, unsigned int val) diff --git a/include/asm-arm/mach/map.h b/include/asm-arm/mach/map.h index 3351b77fab3..e8ea67c97c7 100644 --- a/include/asm-arm/mach/map.h +++ b/include/asm-arm/mach/map.h @@ -26,6 +26,7 @@ struct meminfo; #define MT_MEMORY 5 #define MT_ROM 6 #define MT_IXP2000_DEVICE 7 +#define MT_NONSHARED_DEVICE 8 extern void create_memmap_holes(struct meminfo *); extern void memtable_init(struct meminfo *); diff --git a/include/asm-arm/pgtable.h b/include/asm-arm/pgtable.h index 5a0d19b466b..70e00d08345 100644 --- a/include/asm-arm/pgtable.h +++ b/include/asm-arm/pgtable.h @@ -168,6 +168,7 @@ extern void __pgd_error(const char *file, int line, unsigned long val); #define PMD_SECT_WB (PMD_SECT_CACHEABLE | PMD_SECT_BUFFERABLE) #define PMD_SECT_MINICACHE (PMD_SECT_TEX(1) | PMD_SECT_CACHEABLE) #define PMD_SECT_WBWA (PMD_SECT_TEX(1) | PMD_SECT_CACHEABLE | PMD_SECT_BUFFERABLE) +#define PMD_SECT_NONSHARED_DEV (PMD_SECT_TEX(2)) /* * - coarse table (not used) diff --git a/include/asm-sparc64/spinlock.h b/include/asm-sparc64/spinlock.h index ec85d12d73b..508c416e9d6 100644 --- a/include/asm-sparc64/spinlock.h +++ b/include/asm-sparc64/spinlock.h @@ -131,6 +131,28 @@ static void inline __read_lock(raw_rwlock_t *lock) : "memory"); } +static int inline __read_trylock(raw_rwlock_t *lock) +{ + int tmp1, tmp2; + + __asm__ __volatile__ ( +"1: ldsw [%2], %0\n" +" brlz,a,pn %0, 2f\n" +" mov 0, %0\n" +" add %0, 1, %1\n" +" cas [%2], %0, %1\n" +" cmp %0, %1\n" +" membar #StoreLoad | #StoreStore\n" +" bne,pn %%icc, 1b\n" +" mov 1, %0\n" +"2:" + : "=&r" (tmp1), "=&r" (tmp2) + : "r" (lock) + : "memory"); + + return tmp1; +} + static void inline __read_unlock(raw_rwlock_t *lock) { unsigned long tmp1, tmp2; @@ -211,12 +233,12 @@ static int inline __write_trylock(raw_rwlock_t *lock) } #define __raw_read_lock(p) __read_lock(p) +#define __raw_read_trylock(p) __read_trylock(p) #define __raw_read_unlock(p) __read_unlock(p) #define __raw_write_lock(p) __write_lock(p) #define __raw_write_unlock(p) __write_unlock(p) #define __raw_write_trylock(p) __write_trylock(p) -#define __raw_read_trylock(lock) generic__raw_read_trylock(lock) #define __raw_read_can_lock(rw) (!((rw)->lock & 0x80000000UL)) #define __raw_write_can_lock(rw) (!(rw)->lock) diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h index 02a585faa62..860e7a485a5 100644 --- a/include/linux/blkdev.h +++ b/include/linux/blkdev.h @@ -392,8 +392,8 @@ struct request_queue unsigned int nr_congestion_off; unsigned int nr_batching; - unsigned short max_sectors; - unsigned short max_hw_sectors; + unsigned int max_sectors; + unsigned int max_hw_sectors; unsigned short max_phys_segments; unsigned short max_hw_segments; unsigned short hardsect_size; @@ -697,7 +697,7 @@ extern request_queue_t *blk_init_queue(request_fn_proc *, spinlock_t *); extern void blk_cleanup_queue(request_queue_t *); extern void blk_queue_make_request(request_queue_t *, make_request_fn *); extern void blk_queue_bounce_limit(request_queue_t *, u64); -extern void blk_queue_max_sectors(request_queue_t *, unsigned short); +extern void blk_queue_max_sectors(request_queue_t *, unsigned int); extern void blk_queue_max_phys_segments(request_queue_t *, unsigned short); extern void blk_queue_max_hw_segments(request_queue_t *, unsigned short); extern void blk_queue_max_segment_size(request_queue_t *, unsigned int); diff --git a/include/linux/netfilter/x_tables.h b/include/linux/netfilter/x_tables.h index 59ff6c430cf..6500d4e59d4 100644 --- a/include/linux/netfilter/x_tables.h +++ b/include/linux/netfilter/x_tables.h @@ -19,7 +19,21 @@ struct xt_get_revision /* For standard target */ #define XT_RETURN (-NF_REPEAT - 1) -#define XT_ALIGN(s) (((s) + (__alignof__(u_int64_t)-1)) & ~(__alignof__(u_int64_t)-1)) +/* this is a dummy structure to find out the alignment requirement for a struct + * containing all the fundamental data types that are used in ipt_entry, + * ip6t_entry and arpt_entry. This sucks, and it is a hack. It will be my + * personal pleasure to remove it -HW + */ +struct _xt_align +{ + u_int8_t u8; + u_int16_t u16; + u_int32_t u32; + u_int64_t u64; +}; + +#define XT_ALIGN(s) (((s) + (__alignof__(struct _xt_align)-1)) \ + & ~(__alignof__(struct _xt_align)-1)) /* Standard return verdict, or do jump. */ #define XT_STANDARD_TARGET "" diff --git a/include/linux/serial_8250.h b/include/linux/serial_8250.h index cee302aefdb..73b464f0926 100644 --- a/include/linux/serial_8250.h +++ b/include/linux/serial_8250.h @@ -26,7 +26,7 @@ struct plat_serial8250_port { unsigned char regshift; /* register shift */ unsigned char iotype; /* UPIO_* */ unsigned char hub6; - unsigned int flags; /* UPF_* flags */ + upf_t flags; /* UPF_* flags */ }; /* diff --git a/include/linux/serial_core.h b/include/linux/serial_core.h index ec351005bf9..4041122dabf 100644 --- a/include/linux/serial_core.h +++ b/include/linux/serial_core.h @@ -203,6 +203,8 @@ struct uart_icount { __u32 buf_overrun; }; +typedef unsigned int __bitwise__ upf_t; + struct uart_port { spinlock_t lock; /* port lock */ unsigned int iobase; /* in/out[bwl] */ @@ -230,36 +232,34 @@ struct uart_port { unsigned long sysrq; /* sysrq timeout */ #endif - unsigned int flags; - -#define UPF_FOURPORT (1 << 1) -#define UPF_SAK (1 << 2) -#define UPF_SPD_MASK (0x1030) -#define UPF_SPD_HI (0x0010) -#define UPF_SPD_VHI (0x0020) -#define UPF_SPD_CUST (0x0030) -#define UPF_SPD_SHI (0x1000) -#define UPF_SPD_WARP (0x1010) -#define UPF_SKIP_TEST (1 << 6) -#define UPF_AUTO_IRQ (1 << 7) -#define UPF_HARDPPS_CD (1 << 11) -#define UPF_LOW_LATENCY (1 << 13) -#define UPF_BUGGY_UART (1 << 14) -#define UPF_AUTOPROBE (1 << 15) -#define UPF_MAGIC_MULTIPLIER (1 << 16) -#define UPF_BOOT_ONLYMCA (1 << 22) -#define UPF_CONS_FLOW (1 << 23) -#define UPF_SHARE_IRQ (1 << 24) -#define UPF_BOOT_AUTOCONF (1 << 28) -#define UPF_IOREMAP (1 << 31) - -#define UPF_CHANGE_MASK (0x17fff) -#define UPF_USR_MASK (UPF_SPD_MASK|UPF_LOW_LATENCY) + upf_t flags; + +#define UPF_FOURPORT ((__force upf_t) (1 << 1)) +#define UPF_SAK ((__force upf_t) (1 << 2)) +#define UPF_SPD_MASK ((__force upf_t) (0x1030)) +#define UPF_SPD_HI ((__force upf_t) (0x0010)) +#define UPF_SPD_VHI ((__force upf_t) (0x0020)) +#define UPF_SPD_CUST ((__force upf_t) (0x0030)) +#define UPF_SPD_SHI ((__force upf_t) (0x1000)) +#define UPF_SPD_WARP ((__force upf_t) (0x1010)) +#define UPF_SKIP_TEST ((__force upf_t) (1 << 6)) +#define UPF_AUTO_IRQ ((__force upf_t) (1 << 7)) +#define UPF_HARDPPS_CD ((__force upf_t) (1 << 11)) +#define UPF_LOW_LATENCY ((__force upf_t) (1 << 13)) +#define UPF_BUGGY_UART ((__force upf_t) (1 << 14)) +#define UPF_MAGIC_MULTIPLIER ((__force upf_t) (1 << 16)) +#define UPF_CONS_FLOW ((__force upf_t) (1 << 23)) +#define UPF_SHARE_IRQ ((__force upf_t) (1 << 24)) +#define UPF_BOOT_AUTOCONF ((__force upf_t) (1 << 28)) +#define UPF_IOREMAP ((__force upf_t) (1 << 31)) + +#define UPF_CHANGE_MASK ((__force upf_t) (0x17fff)) +#define UPF_USR_MASK ((__force upf_t) (UPF_SPD_MASK|UPF_LOW_LATENCY)) unsigned int mctrl; /* current modem ctrl settings */ unsigned int timeout; /* character-based timeout */ unsigned int type; /* port type */ - struct uart_ops *ops; + const struct uart_ops *ops; unsigned int custom_divisor; unsigned int line; /* port index */ unsigned long mapbase; /* for ioremap */ @@ -289,6 +289,9 @@ struct uart_state { }; #define UART_XMIT_SIZE PAGE_SIZE + +typedef unsigned int __bitwise__ uif_t; + /* * This is the state information which is only valid when the port * is open; it may be freed by the core driver once the device has @@ -298,17 +301,16 @@ struct uart_state { struct uart_info { struct tty_struct *tty; struct circ_buf xmit; - unsigned int flags; + uif_t flags; /* - * These are the flags that specific to info->flags, and reflect our - * internal state. They can not be accessed via port->flags. Low - * level drivers must not change these, but may query them instead. + * Definitions for info->flags. These are _private_ to serial_core, and + * are specific to this structure. They may be queried by low level drivers. */ -#define UIF_CHECK_CD (1 << 25) -#define UIF_CTS_FLOW (1 << 26) -#define UIF_NORMAL_ACTIVE (1 << 29) -#define UIF_INITIALIZED (1 << 31) +#define UIF_CHECK_CD ((__force uif_t) (1 << 25)) +#define UIF_CTS_FLOW ((__force uif_t) (1 << 26)) +#define UIF_NORMAL_ACTIVE ((__force uif_t) (1 << 29)) +#define UIF_INITIALIZED ((__force uif_t) (1 << 31)) int blocked_open; @@ -430,7 +432,7 @@ static inline int uart_handle_break(struct uart_port *port) port->sysrq = 0; } #endif - if (info->flags & UPF_SAK) + if (port->flags & UPF_SAK) do_SAK(info->tty); return 0; } diff --git a/include/net/ieee80211.h b/include/net/ieee80211.h index df05f468fa5..9a92aef8b0b 100644 --- a/include/net/ieee80211.h +++ b/include/net/ieee80211.h @@ -803,9 +803,9 @@ enum ieee80211_state { #define IEEE80211_24GHZ_MAX_CHANNEL 14 #define IEEE80211_24GHZ_CHANNELS 14 -#define IEEE80211_52GHZ_MIN_CHANNEL 36 +#define IEEE80211_52GHZ_MIN_CHANNEL 34 #define IEEE80211_52GHZ_MAX_CHANNEL 165 -#define IEEE80211_52GHZ_CHANNELS 32 +#define IEEE80211_52GHZ_CHANNELS 131 enum { IEEE80211_CH_PASSIVE_ONLY = (1 << 0), diff --git a/include/scsi/scsi_device.h b/include/scsi/scsi_device.h index e94ca4d3603..290e3b4d2ae 100644 --- a/include/scsi/scsi_device.h +++ b/include/scsi/scsi_device.h @@ -275,7 +275,7 @@ extern int scsi_execute_req(struct scsi_device *sdev, const unsigned char *cmd, int data_direction, void *buffer, unsigned bufflen, struct scsi_sense_hdr *, int timeout, int retries); extern int scsi_execute_async(struct scsi_device *sdev, - const unsigned char *cmd, int data_direction, + const unsigned char *cmd, int cmd_len, int data_direction, void *buffer, unsigned bufflen, int use_sg, int timeout, int retries, void *privdata, void (*done)(void *, char *, int, int), diff --git a/include/scsi/scsi_host.h b/include/scsi/scsi_host.h index 467274a764d..827992949c4 100644 --- a/include/scsi/scsi_host.h +++ b/include/scsi/scsi_host.h @@ -554,7 +554,6 @@ struct Scsi_Host { /* * ordered write support */ - unsigned ordered_flush:1; unsigned ordered_tag:1; /* diff --git a/kernel/rcutorture.c b/kernel/rcutorture.c index 773219907dd..7712912dbc8 100644 --- a/kernel/rcutorture.c +++ b/kernel/rcutorture.c @@ -114,16 +114,16 @@ rcu_torture_alloc(void) { struct list_head *p; - spin_lock(&rcu_torture_lock); + spin_lock_bh(&rcu_torture_lock); if (list_empty(&rcu_torture_freelist)) { atomic_inc(&n_rcu_torture_alloc_fail); - spin_unlock(&rcu_torture_lock); + spin_unlock_bh(&rcu_torture_lock); return NULL; } atomic_inc(&n_rcu_torture_alloc); p = rcu_torture_freelist.next; list_del_init(p); - spin_unlock(&rcu_torture_lock); + spin_unlock_bh(&rcu_torture_lock); return container_of(p, struct rcu_torture, rtort_free); } @@ -134,9 +134,9 @@ static void rcu_torture_free(struct rcu_torture *p) { atomic_inc(&n_rcu_torture_free); - spin_lock(&rcu_torture_lock); + spin_lock_bh(&rcu_torture_lock); list_add_tail(&p->rtort_free, &rcu_torture_freelist); - spin_unlock(&rcu_torture_lock); + spin_unlock_bh(&rcu_torture_lock); } static void diff --git a/kernel/sched.c b/kernel/sched.c index 3ee2ae45125..ec7fd9cee30 100644 --- a/kernel/sched.c +++ b/kernel/sched.c @@ -5141,7 +5141,7 @@ static void init_sched_build_groups(struct sched_group groups[], cpumask_t span, #define SEARCH_SCOPE 2 #define MIN_CACHE_SIZE (64*1024U) #define DEFAULT_CACHE_SIZE (5*1024*1024U) -#define ITERATIONS 2 +#define ITERATIONS 1 #define SIZE_THRESH 130 #define COST_THRESH 130 @@ -5480,9 +5480,9 @@ static unsigned long long measure_migration_cost(int cpu1, int cpu2) break; } /* - * Increase the cachesize in 5% steps: + * Increase the cachesize in 10% steps: */ - size = size * 20 / 19; + size = size * 10 / 9; } if (migration_debug) diff --git a/kernel/time.c b/kernel/time.c index 7477b1d2079..1f23e683d6a 100644 --- a/kernel/time.c +++ b/kernel/time.c @@ -155,7 +155,7 @@ int do_sys_settimeofday(struct timespec *tv, struct timezone *tz) static int firsttime = 1; int error = 0; - if (!timespec_valid(tv)) + if (tv && !timespec_valid(tv)) return -EINVAL; error = security_settime(tv, tz); diff --git a/kernel/user.c b/kernel/user.c index 89e562feb1b..d1ae2349347 100644 --- a/kernel/user.c +++ b/kernel/user.c @@ -13,6 +13,7 @@ #include <linux/slab.h> #include <linux/bitops.h> #include <linux/key.h> +#include <linux/interrupt.h> /* * UID task count cache, to get fast user lookup in "alloc_uid" @@ -27,6 +28,12 @@ static kmem_cache_t *uid_cachep; static struct list_head uidhash_table[UIDHASH_SZ]; + +/* + * The uidhash_lock is mostly taken from process context, but it is + * occasionally also taken from softirq/tasklet context, when + * task-structs get RCU-freed. Hence all locking must be softirq-safe. + */ static DEFINE_SPINLOCK(uidhash_lock); struct user_struct root_user = { @@ -83,14 +90,15 @@ struct user_struct *find_user(uid_t uid) { struct user_struct *ret; - spin_lock(&uidhash_lock); + spin_lock_bh(&uidhash_lock); ret = uid_hash_find(uid, uidhashentry(uid)); - spin_unlock(&uidhash_lock); + spin_unlock_bh(&uidhash_lock); return ret; } void free_uid(struct user_struct *up) { + local_bh_disable(); if (up && atomic_dec_and_lock(&up->__count, &uidhash_lock)) { uid_hash_remove(up); key_put(up->uid_keyring); @@ -98,6 +106,7 @@ void free_uid(struct user_struct *up) kmem_cache_free(uid_cachep, up); spin_unlock(&uidhash_lock); } + local_bh_enable(); } struct user_struct * alloc_uid(uid_t uid) @@ -105,9 +114,9 @@ struct user_struct * alloc_uid(uid_t uid) struct list_head *hashent = uidhashentry(uid); struct user_struct *up; - spin_lock(&uidhash_lock); + spin_lock_bh(&uidhash_lock); up = uid_hash_find(uid, hashent); - spin_unlock(&uidhash_lock); + spin_unlock_bh(&uidhash_lock); if (!up) { struct user_struct *new; @@ -137,7 +146,7 @@ struct user_struct * alloc_uid(uid_t uid) * Before adding this, check whether we raced * on adding the same user already.. */ - spin_lock(&uidhash_lock); + spin_lock_bh(&uidhash_lock); up = uid_hash_find(uid, hashent); if (up) { key_put(new->uid_keyring); @@ -147,7 +156,7 @@ struct user_struct * alloc_uid(uid_t uid) uid_hash_insert(new, hashent); up = new; } - spin_unlock(&uidhash_lock); + spin_unlock_bh(&uidhash_lock); } return up; @@ -183,9 +192,9 @@ static int __init uid_cache_init(void) INIT_LIST_HEAD(uidhash_table + n); /* Insert the root user immediately (init already runs as root) */ - spin_lock(&uidhash_lock); + spin_lock_bh(&uidhash_lock); uid_hash_insert(&root_user, uidhashentry(0)); - spin_unlock(&uidhash_lock); + spin_unlock_bh(&uidhash_lock); return 0; } diff --git a/net/core/dev.c b/net/core/dev.c index fd070a098f2..ffb82073056 100644 --- a/net/core/dev.c +++ b/net/core/dev.c @@ -2543,13 +2543,14 @@ int dev_ioctl(unsigned int cmd, void __user *arg) case SIOCBONDENSLAVE: case SIOCBONDRELEASE: case SIOCBONDSETHWADDR: - case SIOCBONDSLAVEINFOQUERY: - case SIOCBONDINFOQUERY: case SIOCBONDCHANGEACTIVE: case SIOCBRADDIF: case SIOCBRDELIF: if (!capable(CAP_NET_ADMIN)) return -EPERM; + /* fall through */ + case SIOCBONDSLAVEINFOQUERY: + case SIOCBONDINFOQUERY: dev_load(ifr.ifr_name); rtnl_lock(); ret = dev_ifsioc(&ifr, cmd); diff --git a/net/core/filter.c b/net/core/filter.c index 9540946a48f..93fbd01d225 100644 --- a/net/core/filter.c +++ b/net/core/filter.c @@ -64,7 +64,7 @@ static inline void *load_pointer(struct sk_buff *skb, int k, } /** - * sk_run_filter - run a filter on a socket + * sk_run_filter - run a filter on a socket * @skb: buffer to run the filter on * @filter: filter to apply * @flen: length of filter @@ -78,8 +78,8 @@ unsigned int sk_run_filter(struct sk_buff *skb, struct sock_filter *filter, int { struct sock_filter *fentry; /* We walk down these */ void *ptr; - u32 A = 0; /* Accumulator */ - u32 X = 0; /* Index Register */ + u32 A = 0; /* Accumulator */ + u32 X = 0; /* Index Register */ u32 mem[BPF_MEMWORDS]; /* Scratch Memory Store */ u32 tmp; int k; diff --git a/net/core/skbuff.c b/net/core/skbuff.c index d0732e9c856..6766f118f07 100644 --- a/net/core/skbuff.c +++ b/net/core/skbuff.c @@ -135,13 +135,15 @@ void skb_under_panic(struct sk_buff *skb, int sz, void *here) struct sk_buff *__alloc_skb(unsigned int size, gfp_t gfp_mask, int fclone) { + kmem_cache_t *cache; struct skb_shared_info *shinfo; struct sk_buff *skb; u8 *data; + cache = fclone ? skbuff_fclone_cache : skbuff_head_cache; + /* Get the HEAD */ - skb = kmem_cache_alloc(fclone ? skbuff_fclone_cache : skbuff_head_cache, - gfp_mask & ~__GFP_DMA); + skb = kmem_cache_alloc(cache, gfp_mask & ~__GFP_DMA); if (!skb) goto out; @@ -180,7 +182,7 @@ struct sk_buff *__alloc_skb(unsigned int size, gfp_t gfp_mask, out: return skb; nodata: - kmem_cache_free(skbuff_head_cache, skb); + kmem_cache_free(cache, skb); skb = NULL; goto out; } diff --git a/net/ieee80211/ieee80211_rx.c b/net/ieee80211/ieee80211_rx.c index 7a121802faa..960aa78cdb9 100644 --- a/net/ieee80211/ieee80211_rx.c +++ b/net/ieee80211/ieee80211_rx.c @@ -350,6 +350,7 @@ int ieee80211_rx(struct ieee80211_device *ieee, struct sk_buff *skb, u8 src[ETH_ALEN]; struct ieee80211_crypt_data *crypt = NULL; int keyidx = 0; + int can_be_decrypted = 0; hdr = (struct ieee80211_hdr_4addr *)skb->data; stats = &ieee->stats; @@ -410,12 +411,23 @@ int ieee80211_rx(struct ieee80211_device *ieee, struct sk_buff *skb, return 1; } - if (is_multicast_ether_addr(hdr->addr1) - ? ieee->host_mc_decrypt : ieee->host_decrypt) { + can_be_decrypted = (is_multicast_ether_addr(hdr->addr1) || + is_broadcast_ether_addr(hdr->addr2)) ? + ieee->host_mc_decrypt : ieee->host_decrypt; + + if (can_be_decrypted) { int idx = 0; - if (skb->len >= hdrlen + 3) + if (skb->len >= hdrlen + 3) { + /* Top two-bits of byte 3 are the key index */ idx = skb->data[hdrlen + 3] >> 6; + } + + /* ieee->crypt[] is WEP_KEY (4) in length. Given that idx + * is only allowed 2-bits of storage, no value of idx can + * be provided via above code that would result in idx + * being out of range */ crypt = ieee->crypt[idx]; + #ifdef NOT_YET sta = NULL; @@ -553,7 +565,7 @@ int ieee80211_rx(struct ieee80211_device *ieee, struct sk_buff *skb, /* skb: hdr + (possibly fragmented, possibly encrypted) payload */ - if (ieee->host_decrypt && (fc & IEEE80211_FCTL_PROTECTED) && + if ((fc & IEEE80211_FCTL_PROTECTED) && can_be_decrypted && (keyidx = ieee80211_rx_frame_decrypt(ieee, skb, crypt)) < 0) goto rx_dropped; @@ -617,7 +629,7 @@ int ieee80211_rx(struct ieee80211_device *ieee, struct sk_buff *skb, /* skb: hdr + (possible reassembled) full MSDU payload; possibly still * encrypted/authenticated */ - if (ieee->host_decrypt && (fc & IEEE80211_FCTL_PROTECTED) && + if ((fc & IEEE80211_FCTL_PROTECTED) && can_be_decrypted && ieee80211_rx_frame_decrypt_msdu(ieee, skb, keyidx, crypt)) goto rx_dropped; @@ -1439,7 +1451,7 @@ void ieee80211_rx_mgt(struct ieee80211_device *ieee, break; case IEEE80211_STYPE_PROBE_REQ: - IEEE80211_DEBUG_MGMT("recieved auth (%d)\n", + IEEE80211_DEBUG_MGMT("received auth (%d)\n", WLAN_FC_GET_STYPE(le16_to_cpu (header->frame_ctl))); @@ -1473,7 +1485,7 @@ void ieee80211_rx_mgt(struct ieee80211_device *ieee, break; case IEEE80211_STYPE_AUTH: - IEEE80211_DEBUG_MGMT("recieved auth (%d)\n", + IEEE80211_DEBUG_MGMT("received auth (%d)\n", WLAN_FC_GET_STYPE(le16_to_cpu (header->frame_ctl))); diff --git a/net/ieee80211/ieee80211_wx.c b/net/ieee80211/ieee80211_wx.c index 23e1630f50b..f87c6b89f84 100644 --- a/net/ieee80211/ieee80211_wx.c +++ b/net/ieee80211/ieee80211_wx.c @@ -232,15 +232,18 @@ static char *ipw2100_translate_scan(struct ieee80211_device *ieee, return start; } +#define SCAN_ITEM_SIZE 128 + int ieee80211_wx_get_scan(struct ieee80211_device *ieee, struct iw_request_info *info, union iwreq_data *wrqu, char *extra) { struct ieee80211_network *network; unsigned long flags; + int err = 0; char *ev = extra; - char *stop = ev + IW_SCAN_MAX_DATA; + char *stop = ev + wrqu->data.length; int i = 0; IEEE80211_DEBUG_WX("Getting scan\n"); @@ -249,6 +252,11 @@ int ieee80211_wx_get_scan(struct ieee80211_device *ieee, list_for_each_entry(network, &ieee->network_list, list) { i++; + if (stop - ev < SCAN_ITEM_SIZE) { + err = -E2BIG; + break; + } + if (ieee->scan_age == 0 || time_after(network->last_scanned + ieee->scan_age, jiffies)) ev = ipw2100_translate_scan(ieee, ev, stop, network); @@ -270,7 +278,7 @@ int ieee80211_wx_get_scan(struct ieee80211_device *ieee, IEEE80211_DEBUG_WX("exit: %d networks returned.\n", i); - return 0; + return err; } int ieee80211_wx_set_encode(struct ieee80211_device *ieee, diff --git a/net/ipv4/igmp.c b/net/ipv4/igmp.c index d8ce7133cd8..0b4e95f93da 100644 --- a/net/ipv4/igmp.c +++ b/net/ipv4/igmp.c @@ -970,7 +970,7 @@ int igmp_rcv(struct sk_buff *skb) case IGMP_MTRACE_RESP: break; default: - NETDEBUG(KERN_DEBUG "New IGMP type=%d, why we do not know about it?\n", ih->type); + break; } drop: diff --git a/net/ipv4/tcp_htcp.c b/net/ipv4/tcp_htcp.c index 3284cfb993e..128de4d7c0b 100644 --- a/net/ipv4/tcp_htcp.c +++ b/net/ipv4/tcp_htcp.c @@ -230,7 +230,6 @@ static void htcp_cong_avoid(struct sock *sk, u32 ack, u32 rtt, if (tp->snd_cwnd < tp->snd_cwnd_clamp) tp->snd_cwnd++; tp->snd_cwnd_cnt = 0; - ca->ccount++; } } } diff --git a/net/ipv6/mcast.c b/net/ipv6/mcast.c index 6c05c7978be..4420948a1bf 100644 --- a/net/ipv6/mcast.c +++ b/net/ipv6/mcast.c @@ -1252,8 +1252,7 @@ int igmp6_event_query(struct sk_buff *skb) } } else { for (ma = idev->mc_list; ma; ma=ma->next) { - if (group_type != IPV6_ADDR_ANY && - !ipv6_addr_equal(group, &ma->mca_addr)) + if (!ipv6_addr_equal(group, &ma->mca_addr)) continue; spin_lock_bh(&ma->mca_lock); if (ma->mca_flags & MAF_TIMER_RUNNING) { @@ -1268,11 +1267,10 @@ int igmp6_event_query(struct sk_buff *skb) ma->mca_flags &= ~MAF_GSQUERY; } if (!(ma->mca_flags & MAF_GSQUERY) || - mld_marksources(ma, ntohs(mlh2->nsrcs), mlh2->srcs)) + mld_marksources(ma, ntohs(mlh2->nsrcs), mlh2->srcs)) igmp6_group_queried(ma, max_delay); spin_unlock_bh(&ma->mca_lock); - if (group_type != IPV6_ADDR_ANY) - break; + break; } } read_unlock_bh(&idev->lock); @@ -1351,7 +1349,7 @@ static int is_in(struct ifmcaddr6 *pmc, struct ip6_sf_list *psf, int type, * in all filters */ if (psf->sf_count[MCAST_INCLUDE]) - return 0; + return type == MLD2_MODE_IS_INCLUDE; return pmc->mca_sfcount[MCAST_EXCLUDE] == psf->sf_count[MCAST_EXCLUDE]; } @@ -1966,7 +1964,7 @@ static void sf_markstate(struct ifmcaddr6 *pmc) static int sf_setstate(struct ifmcaddr6 *pmc) { - struct ip6_sf_list *psf; + struct ip6_sf_list *psf, *dpsf; int mca_xcount = pmc->mca_sfcount[MCAST_EXCLUDE]; int qrv = pmc->idev->mc_qrv; int new_in, rv; @@ -1978,8 +1976,48 @@ static int sf_setstate(struct ifmcaddr6 *pmc) !psf->sf_count[MCAST_INCLUDE]; } else new_in = psf->sf_count[MCAST_INCLUDE] != 0; - if (new_in != psf->sf_oldin) { - psf->sf_crcount = qrv; + if (new_in) { + if (!psf->sf_oldin) { + struct ip6_sf_list *prev = 0; + + for (dpsf=pmc->mca_tomb; dpsf; + dpsf=dpsf->sf_next) { + if (ipv6_addr_equal(&dpsf->sf_addr, + &psf->sf_addr)) + break; + prev = dpsf; + } + if (dpsf) { + if (prev) + prev->sf_next = dpsf->sf_next; + else + pmc->mca_tomb = dpsf->sf_next; + kfree(dpsf); + } + psf->sf_crcount = qrv; + rv++; + } + } else if (psf->sf_oldin) { + psf->sf_crcount = 0; + /* + * add or update "delete" records if an active filter + * is now inactive + */ + for (dpsf=pmc->mca_tomb; dpsf; dpsf=dpsf->sf_next) + if (ipv6_addr_equal(&dpsf->sf_addr, + &psf->sf_addr)) + break; + if (!dpsf) { + dpsf = (struct ip6_sf_list *) + kmalloc(sizeof(*dpsf), GFP_ATOMIC); + if (!dpsf) + continue; + *dpsf = *psf; + /* pmc->mca_lock held by callers */ + dpsf->sf_next = pmc->mca_tomb; + pmc->mca_tomb = dpsf; + } + dpsf->sf_crcount = qrv; rv++; } } diff --git a/net/key/af_key.c b/net/key/af_key.c index 43f1ce74187..ae86d237a45 100644 --- a/net/key/af_key.c +++ b/net/key/af_key.c @@ -1620,6 +1620,7 @@ static int key_notify_sa_flush(struct km_event *c) return -ENOBUFS; hdr = (struct sadb_msg *) skb_put(skb, sizeof(struct sadb_msg)); hdr->sadb_msg_satype = pfkey_proto2satype(c->data.proto); + hdr->sadb_msg_type = SADB_FLUSH; hdr->sadb_msg_seq = c->seq; hdr->sadb_msg_pid = c->pid; hdr->sadb_msg_version = PF_KEY_V2; @@ -2385,6 +2386,7 @@ static int key_notify_policy_flush(struct km_event *c) if (!skb_out) return -ENOBUFS; hdr = (struct sadb_msg *) skb_put(skb_out, sizeof(struct sadb_msg)); + hdr->sadb_msg_type = SADB_X_SPDFLUSH; hdr->sadb_msg_seq = c->seq; hdr->sadb_msg_pid = c->pid; hdr->sadb_msg_version = PF_KEY_V2; diff --git a/net/packet/af_packet.c b/net/packet/af_packet.c index ee93abc71cb..9db7dbdb16e 100644 --- a/net/packet/af_packet.c +++ b/net/packet/af_packet.c @@ -365,7 +365,7 @@ static int packet_sendmsg_spkt(struct kiocb *iocb, struct socket *sock, */ err = -EMSGSIZE; - if(len>dev->mtu+dev->hard_header_len) + if (len > dev->mtu + dev->hard_header_len) goto out_unlock; err = -ENOBUFS; @@ -935,7 +935,7 @@ static int packet_bind_spkt(struct socket *sock, struct sockaddr *uaddr, int add * Check legality */ - if(addr_len!=sizeof(struct sockaddr)) + if (addr_len != sizeof(struct sockaddr)) return -EINVAL; strlcpy(name,uaddr->sa_data,sizeof(name)); @@ -1092,7 +1092,7 @@ static int packet_recvmsg(struct kiocb *iocb, struct socket *sock, * retries. */ - if(skb==NULL) + if (skb == NULL) goto out; /* @@ -1392,8 +1392,8 @@ static int packet_getsockopt(struct socket *sock, int level, int optname, if (level != SOL_PACKET) return -ENOPROTOOPT; - if (get_user(len,optlen)) - return -EFAULT; + if (get_user(len, optlen)) + return -EFAULT; if (len < 0) return -EINVAL; @@ -1419,9 +1419,9 @@ static int packet_getsockopt(struct socket *sock, int level, int optname, return -ENOPROTOOPT; } - if (put_user(len, optlen)) - return -EFAULT; - return 0; + if (put_user(len, optlen)) + return -EFAULT; + return 0; } diff --git a/net/sctp/sm_statefuns.c b/net/sctp/sm_statefuns.c index 71c9a961c32..2b9a832b29a 100644 --- a/net/sctp/sm_statefuns.c +++ b/net/sctp/sm_statefuns.c @@ -884,7 +884,7 @@ sctp_disposition_t sctp_sf_sendbeat_8_3(const struct sctp_endpoint *ep, { struct sctp_transport *transport = (struct sctp_transport *) arg; - if (asoc->overall_error_count > asoc->max_retrans) { + if (asoc->overall_error_count >= asoc->max_retrans) { /* CMD_ASSOC_FAILED calls CMD_DELETE_TCB. */ sctp_add_cmd_sf(commands, SCTP_CMD_ASSOC_FAILED, SCTP_U32(SCTP_ERROR_NO_ERROR)); @@ -2122,7 +2122,7 @@ static sctp_disposition_t sctp_sf_do_5_2_6_stale(const struct sctp_endpoint *ep, struct sctp_bind_addr *bp; int attempts = asoc->init_err_counter + 1; - if (attempts >= asoc->max_init_attempts) { + if (attempts > asoc->max_init_attempts) { sctp_add_cmd_sf(commands, SCTP_CMD_INIT_FAILED, SCTP_U32(SCTP_ERROR_STALE_COOKIE)); return SCTP_DISPOSITION_DELETE_TCB; @@ -4640,7 +4640,7 @@ sctp_disposition_t sctp_sf_t1_init_timer_expire(const struct sctp_endpoint *ep, SCTP_DEBUG_PRINTK("Timer T1 expired (INIT).\n"); - if (attempts < asoc->max_init_attempts) { + if (attempts <= asoc->max_init_attempts) { bp = (struct sctp_bind_addr *) &asoc->base.bind_addr; repl = sctp_make_init(asoc, bp, GFP_ATOMIC, 0); if (!repl) @@ -4697,7 +4697,7 @@ sctp_disposition_t sctp_sf_t1_cookie_timer_expire(const struct sctp_endpoint *ep SCTP_DEBUG_PRINTK("Timer T1 expired (COOKIE-ECHO).\n"); - if (attempts < asoc->max_init_attempts) { + if (attempts <= asoc->max_init_attempts) { repl = sctp_make_cookie_echo(asoc, NULL); if (!repl) return SCTP_DISPOSITION_NOMEM; diff --git a/net/sctp/socket.c b/net/sctp/socket.c index fb1821d9f33..0ea947eb681 100644 --- a/net/sctp/socket.c +++ b/net/sctp/socket.c @@ -5426,7 +5426,7 @@ out: return err; do_error: - if (asoc->init_err_counter + 1 >= asoc->max_init_attempts) + if (asoc->init_err_counter + 1 > asoc->max_init_attempts) err = -ETIMEDOUT; else err = -ECONNREFUSED; diff --git a/security/seclvl.c b/security/seclvl.c index 1caac016464..8529ea6f7aa 100644 --- a/security/seclvl.c +++ b/security/seclvl.c @@ -368,8 +368,8 @@ static int seclvl_capable(struct task_struct *tsk, int cap) */ static int seclvl_settime(struct timespec *tv, struct timezone *tz) { - struct timespec now; - if (seclvl > 1) { + if (tv && seclvl > 1) { + struct timespec now; now = current_kernel_time(); if (tv->tv_sec < now.tv_sec || (tv->tv_sec == now.tv_sec && tv->tv_nsec < now.tv_nsec)) { |