Merge branch 'master' of /home/trondmy/kernel/linux-2.6/

+741 -958
+2
arch/arm/kernel/stacktrace.c
··· 1 + #include <linux/module.h> 1 2 #include <linux/sched.h> 2 3 #include <linux/stacktrace.h> 3 4 ··· 31 30 32 31 return 0; 33 32 } 33 + EXPORT_SYMBOL(walk_stackframe); 34 34 35 35 #ifdef CONFIG_STACKTRACE 36 36 struct stack_trace_data {
+3 -6
arch/i386/mm/discontig.c
··· 31 31 #include <linux/module.h> 32 32 #include <linux/kexec.h> 33 33 #include <linux/pfn.h> 34 + #include <linux/swap.h> 34 35 35 36 #include <asm/e820.h> 36 37 #include <asm/setup.h> ··· 98 97 #endif 99 98 100 99 extern unsigned long find_max_low_pfn(void); 101 - extern void find_max_pfn(void); 102 100 extern void add_one_highpage_init(struct page *, int, int); 103 - 104 - extern struct e820map e820; 105 101 extern unsigned long highend_pfn, highstart_pfn; 106 - extern unsigned long max_low_pfn; 107 - extern unsigned long totalram_pages; 108 - extern unsigned long totalhigh_pages; 109 102 110 103 #define LARGE_PAGE_BYTES (PTRS_PER_PTE * PAGE_SIZE) 111 104 ··· 355 360 max_zone_pfns[ZONE_DMA] = 356 361 virt_to_phys((char *)MAX_DMA_ADDRESS) >> PAGE_SHIFT; 357 362 max_zone_pfns[ZONE_NORMAL] = max_low_pfn; 363 + #ifdef CONFIG_HIGHMEM 358 364 max_zone_pfns[ZONE_HIGHMEM] = highend_pfn; 365 + #endif 359 366 360 367 /* If SRAT has not registered memory, register it now */ 361 368 if (find_max_pfn_with_active_regions() == 0) {
+3
arch/sh64/Kconfig
··· 17 17 bool 18 18 default y 19 19 20 + config QUICKLIST 21 + def_bool y 22 + 20 23 config RWSEM_GENERIC_SPINLOCK 21 24 bool 22 25 default y
+123 -80
arch/sh64/configs/cayman_defconfig
··· 1 1 # 2 2 # Automatically generated make config: don't edit 3 - # Linux kernel version: 2.6.18 4 - # Tue Oct 3 13:30:51 2006 3 + # Linux kernel version: 2.6.22-rc1 4 + # Mon May 14 08:43:31 2007 5 5 # 6 6 CONFIG_SUPERH=y 7 7 CONFIG_SUPERH64=y ··· 10 10 CONFIG_GENERIC_FIND_NEXT_BIT=y 11 11 CONFIG_GENERIC_HWEIGHT=y 12 12 CONFIG_GENERIC_CALIBRATE_DELAY=y 13 + # CONFIG_ARCH_HAS_ILOG2_U32 is not set 14 + # CONFIG_ARCH_HAS_ILOG2_U64 is not set 13 15 CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config" 14 16 15 17 # ··· 35 33 # CONFIG_UTS_NS is not set 36 34 # CONFIG_AUDIT is not set 37 35 # CONFIG_IKCONFIG is not set 36 + CONFIG_LOG_BUF_SHIFT=14 37 + CONFIG_SYSFS_DEPRECATED=y 38 38 # CONFIG_RELAY is not set 39 - CONFIG_INITRAMFS_SOURCE="" 39 + # CONFIG_BLK_DEV_INITRD is not set 40 40 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 41 41 CONFIG_SYSCTL=y 42 42 # CONFIG_EMBEDDED is not set 43 43 CONFIG_UID16=y 44 - # CONFIG_SYSCTL_SYSCALL is not set 44 + CONFIG_SYSCTL_SYSCALL=y 45 45 CONFIG_KALLSYMS=y 46 46 # CONFIG_KALLSYMS_ALL is not set 47 47 # CONFIG_KALLSYMS_EXTRA_PASS is not set ··· 53 49 CONFIG_ELF_CORE=y 54 50 CONFIG_BASE_FULL=y 55 51 CONFIG_FUTEX=y 52 + CONFIG_ANON_INODES=y 56 53 CONFIG_EPOLL=y 54 + CONFIG_SIGNALFD=y 55 + CONFIG_TIMERFD=y 56 + CONFIG_EVENTFD=y 57 57 CONFIG_SHMEM=y 58 - CONFIG_SLAB=y 59 58 CONFIG_VM_EVENT_COUNTERS=y 59 + CONFIG_SLAB=y 60 + # CONFIG_SLUB is not set 61 + # CONFIG_SLOB is not set 60 62 CONFIG_RT_MUTEXES=y 61 63 # CONFIG_TINY_SHMEM is not set 62 64 CONFIG_BASE_SMALL=0 63 - # CONFIG_SLOB is not set 64 65 65 66 # 66 67 # Loadable module support ··· 144 135 # 145 136 CONFIG_HEARTBEAT=y 146 137 CONFIG_HDSP253_LED=y 147 - CONFIG_SH_DMA=y 138 + # CONFIG_SH_DMA is not set 148 139 CONFIG_PREEMPT=y 149 140 CONFIG_SELECT_MEMORY_MODEL=y 150 141 CONFIG_FLATMEM_MANUAL=y ··· 155 146 # CONFIG_SPARSEMEM_STATIC is not set 156 147 CONFIG_SPLIT_PTLOCK_CPUS=4 157 148 # CONFIG_RESOURCES_64BIT is not set 149 + CONFIG_ZONE_DMA_FLAG=0 158 150 159 151 # 160 152 # Bus options (PCI, PCMCIA, EISA, MCA, ISA) 161 153 # 162 154 CONFIG_PCI=y 163 155 CONFIG_SH_PCIDMA_NONCOHERENT=y 164 - # CONFIG_PCI_MULTITHREAD_PROBE is not set 156 + # CONFIG_ARCH_SUPPORTS_MSI is not set 165 157 # CONFIG_PCI_DEBUG is not set 166 158 167 159 # 168 160 # PCCARD (PCMCIA/CardBus) support 169 161 # 170 162 # CONFIG_PCCARD is not set 171 - 172 - # 173 - # PCI Hotplug Support 174 - # 175 163 # CONFIG_HOTPLUG_PCI is not set 176 164 177 165 # ··· 186 180 # 187 181 # Networking options 188 182 # 189 - # CONFIG_NETDEBUG is not set 190 183 CONFIG_PACKET=y 191 184 # CONFIG_PACKET_MMAP is not set 192 185 CONFIG_UNIX=y 193 186 CONFIG_XFRM=y 194 187 # CONFIG_XFRM_USER is not set 195 188 # CONFIG_XFRM_SUB_POLICY is not set 189 + # CONFIG_XFRM_MIGRATE is not set 196 190 # CONFIG_NET_KEY is not set 197 191 CONFIG_INET=y 198 192 # CONFIG_IP_MULTICAST is not set ··· 213 207 # CONFIG_INET_TUNNEL is not set 214 208 CONFIG_INET_XFRM_MODE_TRANSPORT=y 215 209 CONFIG_INET_XFRM_MODE_TUNNEL=y 210 + CONFIG_INET_XFRM_MODE_BEET=y 216 211 CONFIG_INET_DIAG=y 217 212 CONFIG_INET_TCP_DIAG=y 218 213 # CONFIG_TCP_CONG_ADVANCED is not set 219 214 CONFIG_TCP_CONG_CUBIC=y 220 215 CONFIG_DEFAULT_TCP_CONG="cubic" 216 + # CONFIG_TCP_MD5SIG is not set 221 217 # CONFIG_IPV6 is not set 222 218 # CONFIG_INET6_XFRM_TUNNEL is not set 223 219 # CONFIG_INET6_TUNNEL is not set ··· 264 256 # CONFIG_HAMRADIO is not set 265 257 # CONFIG_IRDA is not set 266 258 # CONFIG_BT is not set 259 + # CONFIG_AF_RXRPC is not set 260 + 261 + # 262 + # Wireless 263 + # 264 + # CONFIG_CFG80211 is not set 265 + # CONFIG_WIRELESS_EXT is not set 266 + # CONFIG_MAC80211 is not set 267 267 # CONFIG_IEEE80211 is not set 268 + # CONFIG_RFKILL is not set 268 269 269 270 # 270 271 # Device Drivers ··· 286 269 CONFIG_PREVENT_FIRMWARE_BUILD=y 287 270 # CONFIG_FW_LOADER is not set 288 271 # CONFIG_DEBUG_DRIVER is not set 272 + # CONFIG_DEBUG_DEVRES is not set 289 273 # CONFIG_SYS_HYPERVISOR is not set 290 274 291 275 # 292 276 # Connector - unified userspace <-> kernelspace linker 293 277 # 294 278 # CONFIG_CONNECTOR is not set 295 - 296 - # 297 - # Memory Technology Devices (MTD) 298 - # 299 279 # CONFIG_MTD is not set 300 280 301 281 # ··· 303 289 # 304 290 # Plug and Play support 305 291 # 292 + # CONFIG_PNPACPI is not set 306 293 307 294 # 308 295 # Block devices ··· 321 306 CONFIG_BLK_DEV_RAM_COUNT=16 322 307 CONFIG_BLK_DEV_RAM_SIZE=4096 323 308 CONFIG_BLK_DEV_RAM_BLOCKSIZE=1024 324 - # CONFIG_BLK_DEV_INITRD is not set 325 309 # CONFIG_CDROM_PKTCDVD is not set 326 310 # CONFIG_ATA_OVER_ETH is not set 311 + 312 + # 313 + # Misc devices 314 + # 315 + # CONFIG_PHANTOM is not set 316 + # CONFIG_SGI_IOC4 is not set 317 + # CONFIG_TIFM_CORE is not set 318 + # CONFIG_BLINK is not set 327 319 328 320 # 329 321 # ATA/ATAPI/MFM/RLL support ··· 342 320 # 343 321 # CONFIG_RAID_ATTRS is not set 344 322 CONFIG_SCSI=y 323 + # CONFIG_SCSI_TGT is not set 345 324 # CONFIG_SCSI_NETLINK is not set 346 325 CONFIG_SCSI_PROC_FS=y 347 326 ··· 362 339 CONFIG_SCSI_MULTI_LUN=y 363 340 # CONFIG_SCSI_CONSTANTS is not set 364 341 # CONFIG_SCSI_LOGGING is not set 342 + # CONFIG_SCSI_SCAN_ASYNC is not set 365 343 366 344 # 367 345 # SCSI Transports ··· 402 378 CONFIG_SCSI_SYM53C8XX_DEFAULT_TAGS=16 403 379 CONFIG_SCSI_SYM53C8XX_MAX_TAGS=64 404 380 CONFIG_SCSI_SYM53C8XX_MMIO=y 405 - # CONFIG_SCSI_IPR is not set 406 381 # CONFIG_SCSI_QLOGIC_1280 is not set 407 382 # CONFIG_SCSI_QLA_FC is not set 383 + # CONFIG_SCSI_QLA_ISCSI is not set 408 384 # CONFIG_SCSI_LPFC is not set 409 385 # CONFIG_SCSI_DC395x is not set 410 386 # CONFIG_SCSI_DC390T is not set 411 387 # CONFIG_SCSI_NSP32 is not set 412 388 # CONFIG_SCSI_DEBUG is not set 413 - 414 - # 415 - # Serial ATA (prod) and Parallel ATA (experimental) drivers 416 - # 389 + # CONFIG_SCSI_ESP_CORE is not set 390 + # CONFIG_SCSI_SRP is not set 417 391 # CONFIG_ATA is not set 418 392 419 393 # ··· 430 408 # 431 409 # IEEE 1394 (FireWire) support 432 410 # 411 + # CONFIG_FIREWIRE is not set 433 412 # CONFIG_IEEE1394 is not set 434 413 435 414 # ··· 451 428 # ARCnet devices 452 429 # 453 430 # CONFIG_ARCNET is not set 454 - 455 - # 456 - # PHY device support 457 - # 458 431 # CONFIG_PHYLIB is not set 459 432 460 433 # ··· 498 479 # CONFIG_SUNDANCE is not set 499 480 # CONFIG_TLAN is not set 500 481 # CONFIG_VIA_RHINE is not set 501 - 502 - # 503 - # Ethernet (1000 Mbit) 504 - # 482 + # CONFIG_SC92031 is not set 483 + CONFIG_NETDEV_1000=y 505 484 # CONFIG_ACENIC is not set 506 485 # CONFIG_DL2K is not set 507 486 # CONFIG_E1000 is not set ··· 515 498 # CONFIG_TIGON3 is not set 516 499 # CONFIG_BNX2 is not set 517 500 # CONFIG_QLA3XXX is not set 518 - 519 - # 520 - # Ethernet (10000 Mbit) 521 - # 501 + # CONFIG_ATL1 is not set 502 + CONFIG_NETDEV_10000=y 522 503 # CONFIG_CHELSIO_T1 is not set 504 + # CONFIG_CHELSIO_T3 is not set 523 505 # CONFIG_IXGB is not set 524 506 # CONFIG_S2IO is not set 525 507 # CONFIG_MYRI10GE is not set 508 + # CONFIG_NETXEN_NIC is not set 509 + # CONFIG_MLX4_CORE is not set 510 + CONFIG_MLX4_DEBUG=y 526 511 527 512 # 528 513 # Token Ring devices ··· 532 513 # CONFIG_TR is not set 533 514 534 515 # 535 - # Wireless LAN (non-hamradio) 516 + # Wireless LAN 536 517 # 537 - # CONFIG_NET_RADIO is not set 538 - 539 - # 540 - # Wan interfaces 541 - # 518 + # CONFIG_WLAN_PRE80211 is not set 519 + # CONFIG_WLAN_80211 is not set 542 520 # CONFIG_WAN is not set 543 521 # CONFIG_FDDI is not set 544 522 # CONFIG_HIPPI is not set ··· 587 571 # CONFIG_KEYBOARD_STOWAWAY is not set 588 572 CONFIG_INPUT_MOUSE=y 589 573 CONFIG_MOUSE_PS2=y 574 + CONFIG_MOUSE_PS2_ALPS=y 575 + CONFIG_MOUSE_PS2_LOGIPS2PP=y 576 + CONFIG_MOUSE_PS2_SYNAPTICS=y 577 + CONFIG_MOUSE_PS2_LIFEBOOK=y 578 + CONFIG_MOUSE_PS2_TRACKPOINT=y 579 + # CONFIG_MOUSE_PS2_TOUCHKIT is not set 590 580 # CONFIG_MOUSE_SERIAL is not set 581 + # CONFIG_MOUSE_APPLETOUCH is not set 591 582 # CONFIG_MOUSE_VSXXXAA is not set 592 583 # CONFIG_INPUT_JOYSTICK is not set 584 + # CONFIG_INPUT_TABLET is not set 593 585 # CONFIG_INPUT_TOUCHSCREEN is not set 594 586 # CONFIG_INPUT_MISC is not set 595 587 ··· 643 619 # IPMI 644 620 # 645 621 # CONFIG_IPMI_HANDLER is not set 646 - 647 - # 648 - # Watchdog Cards 649 - # 650 622 CONFIG_WATCHDOG=y 651 623 # CONFIG_WATCHDOG_NOWAYOUT is not set 652 624 ··· 659 639 # CONFIG_WDTPCI is not set 660 640 CONFIG_HW_RANDOM=y 661 641 # CONFIG_GEN_RTC is not set 662 - # CONFIG_DTLK is not set 663 642 # CONFIG_R3964 is not set 664 643 # CONFIG_APPLICOM is not set 665 - 666 - # 667 - # Ftape, the floppy tape device driver 668 - # 669 644 # CONFIG_DRM is not set 670 645 # CONFIG_RAW_DRIVER is not set 671 646 ··· 668 653 # TPM devices 669 654 # 670 655 # CONFIG_TCG_TPM is not set 671 - # CONFIG_TELCLOCK is not set 672 - 673 - # 674 - # I2C support 675 - # 656 + CONFIG_DEVPORT=y 676 657 # CONFIG_I2C is not set 677 658 678 659 # ··· 680 669 # 681 670 # Dallas's 1-wire bus 682 671 # 683 - 684 - # 685 - # Hardware Monitoring support 686 - # 672 + # CONFIG_W1 is not set 687 673 CONFIG_HWMON=y 688 674 # CONFIG_HWMON_VID is not set 689 675 # CONFIG_SENSORS_ABITUGURU is not set 690 676 # CONFIG_SENSORS_F71805F is not set 677 + # CONFIG_SENSORS_PC87427 is not set 678 + # CONFIG_SENSORS_SMSC47M1 is not set 679 + # CONFIG_SENSORS_SMSC47B397 is not set 691 680 # CONFIG_SENSORS_VT1211 is not set 681 + # CONFIG_SENSORS_W83627HF is not set 692 682 # CONFIG_HWMON_DEBUG_CHIP is not set 693 683 694 684 # 695 - # Misc devices 685 + # Multifunction device drivers 696 686 # 687 + # CONFIG_MFD_SM501 is not set 697 688 698 689 # 699 690 # Multimedia devices 700 691 # 701 692 # CONFIG_VIDEO_DEV is not set 702 - CONFIG_VIDEO_V4L2=y 703 - 704 - # 705 - # Digital Video Broadcasting Devices 706 - # 707 - # CONFIG_DVB is not set 693 + # CONFIG_DVB_CORE is not set 694 + CONFIG_DAB=y 708 695 709 696 # 710 697 # Graphics support 711 698 # 712 - CONFIG_FIRMWARE_EDID=y 699 + # CONFIG_BACKLIGHT_LCD_SUPPORT is not set 700 + 701 + # 702 + # Display device support 703 + # 704 + # CONFIG_DISPLAY_SUPPORT is not set 705 + # CONFIG_VGASTATE is not set 713 706 CONFIG_FB=y 707 + CONFIG_FIRMWARE_EDID=y 708 + # CONFIG_FB_DDC is not set 714 709 CONFIG_FB_CFB_FILLRECT=y 715 710 CONFIG_FB_CFB_COPYAREA=y 716 711 CONFIG_FB_CFB_IMAGEBLIT=y 712 + # CONFIG_FB_SYS_FILLRECT is not set 713 + # CONFIG_FB_SYS_COPYAREA is not set 714 + # CONFIG_FB_SYS_IMAGEBLIT is not set 715 + # CONFIG_FB_SYS_FOPS is not set 716 + CONFIG_FB_DEFERRED_IO=y 717 + # CONFIG_FB_SVGALIB is not set 717 718 # CONFIG_FB_MACMODES is not set 718 719 # CONFIG_FB_BACKLIGHT is not set 719 720 CONFIG_FB_MODE_HELPERS=y 720 721 # CONFIG_FB_TILEBLITTING is not set 722 + 723 + # 724 + # Frame buffer hardware drivers 725 + # 721 726 # CONFIG_FB_CIRRUS is not set 722 727 # CONFIG_FB_PM2 is not set 723 728 # CONFIG_FB_CYBER2000 is not set ··· 747 720 # CONFIG_FB_RADEON is not set 748 721 # CONFIG_FB_ATY128 is not set 749 722 # CONFIG_FB_ATY is not set 723 + # CONFIG_FB_S3 is not set 750 724 # CONFIG_FB_SAVAGE is not set 751 725 # CONFIG_FB_SIS is not set 752 726 # CONFIG_FB_NEOMAGIC is not set 753 727 CONFIG_FB_KYRO=y 754 728 # CONFIG_FB_3DFX is not set 755 729 # CONFIG_FB_VOODOO1 is not set 730 + # CONFIG_FB_VT8623 is not set 756 731 # CONFIG_FB_TRIDENT is not set 732 + # CONFIG_FB_ARK is not set 733 + # CONFIG_FB_PM3 is not set 757 734 # CONFIG_FB_VIRTUAL is not set 758 735 759 736 # ··· 777 746 # CONFIG_FONT_SUN8x16 is not set 778 747 # CONFIG_FONT_SUN12x22 is not set 779 748 # CONFIG_FONT_10x18 is not set 780 - 781 - # 782 - # Logo configuration 783 - # 784 749 CONFIG_LOGO=y 785 750 # CONFIG_LOGO_LINUX_MONO is not set 786 751 # CONFIG_LOGO_LINUX_VGA16 is not set ··· 784 757 # CONFIG_LOGO_SUPERH_MONO is not set 785 758 # CONFIG_LOGO_SUPERH_VGA16 is not set 786 759 CONFIG_LOGO_SUPERH_CLUT224=y 787 - # CONFIG_BACKLIGHT_LCD_SUPPORT is not set 788 760 789 761 # 790 762 # Sound 791 763 # 792 764 # CONFIG_SOUND is not set 765 + 766 + # 767 + # HID Devices 768 + # 769 + CONFIG_HID=y 770 + # CONFIG_HID_DEBUG is not set 793 771 794 772 # 795 773 # USB support ··· 812 780 # USB Gadget Support 813 781 # 814 782 # CONFIG_USB_GADGET is not set 815 - 816 - # 817 - # MMC/SD Card support 818 - # 819 783 # CONFIG_MMC is not set 820 784 821 785 # ··· 864 836 CONFIG_EXT3_FS_XATTR=y 865 837 # CONFIG_EXT3_FS_POSIX_ACL is not set 866 838 # CONFIG_EXT3_FS_SECURITY is not set 839 + # CONFIG_EXT4DEV_FS is not set 867 840 CONFIG_JBD=y 868 841 # CONFIG_JBD_DEBUG is not set 869 842 CONFIG_FS_MBCACHE=y ··· 872 843 # CONFIG_JFS_FS is not set 873 844 # CONFIG_FS_POSIX_ACL is not set 874 845 # CONFIG_XFS_FS is not set 846 + # CONFIG_GFS2_FS is not set 875 847 # CONFIG_OCFS2_FS is not set 876 848 CONFIG_MINIX_FS=y 877 849 CONFIG_ROMFS_FS=y ··· 942 912 CONFIG_LOCKD_V4=y 943 913 CONFIG_NFS_COMMON=y 944 914 CONFIG_SUNRPC=y 915 + # CONFIG_SUNRPC_BIND34 is not set 945 916 # CONFIG_RPCSEC_GSS_KRB5 is not set 946 917 # CONFIG_RPCSEC_GSS_SPKM3 is not set 947 918 # CONFIG_SMB_FS is not set ··· 972 941 # CONFIG_SUN_PARTITION is not set 973 942 # CONFIG_KARMA_PARTITION is not set 974 943 # CONFIG_EFI_PARTITION is not set 944 + # CONFIG_SYSV68_PARTITION is not set 975 945 976 946 # 977 947 # Native Language Support 978 948 # 979 949 # CONFIG_NLS is not set 950 + 951 + # 952 + # Distributed Lock Manager 953 + # 954 + # CONFIG_DLM is not set 980 955 981 956 # 982 957 # Profiling support ··· 996 959 CONFIG_ENABLE_MUST_CHECK=y 997 960 CONFIG_MAGIC_SYSRQ=y 998 961 # CONFIG_UNUSED_SYMBOLS is not set 962 + CONFIG_DEBUG_FS=y 963 + # CONFIG_HEADERS_CHECK is not set 999 964 CONFIG_DEBUG_KERNEL=y 1000 - CONFIG_LOG_BUF_SHIFT=14 965 + # CONFIG_DEBUG_SHIRQ is not set 1001 966 CONFIG_DETECT_SOFTLOCKUP=y 1002 967 CONFIG_SCHEDSTATS=y 968 + # CONFIG_TIMER_STATS is not set 1003 969 # CONFIG_DEBUG_SLAB is not set 1004 970 # CONFIG_DEBUG_RT_MUTEXES is not set 1005 971 # CONFIG_RT_MUTEX_TESTER is not set 1006 972 # CONFIG_DEBUG_SPINLOCK is not set 1007 973 # CONFIG_DEBUG_MUTEXES is not set 1008 - # CONFIG_DEBUG_RWSEMS is not set 1009 974 # CONFIG_DEBUG_SPINLOCK_SLEEP is not set 1010 975 # CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set 1011 976 # CONFIG_DEBUG_KOBJECT is not set 1012 977 CONFIG_DEBUG_BUGVERBOSE=y 1013 978 # CONFIG_DEBUG_INFO is not set 1014 - CONFIG_DEBUG_FS=y 1015 979 # CONFIG_DEBUG_VM is not set 1016 980 # CONFIG_DEBUG_LIST is not set 1017 981 CONFIG_FRAME_POINTER=y 1018 - # CONFIG_UNWIND_INFO is not set 1019 982 CONFIG_FORCED_INLINING=y 1020 983 # CONFIG_RCU_TORTURE_TEST is not set 984 + # CONFIG_FAULT_INJECTION is not set 1021 985 # CONFIG_EARLY_PRINTK is not set 1022 986 # CONFIG_DEBUG_KERNEL_WITH_GDB_STUB is not set 1023 987 CONFIG_SH64_PROC_TLB=y ··· 1042 1004 # 1043 1005 # Library routines 1044 1006 # 1007 + CONFIG_BITREVERSE=y 1045 1008 # CONFIG_CRC_CCITT is not set 1046 1009 # CONFIG_CRC16 is not set 1010 + # CONFIG_CRC_ITU_T is not set 1047 1011 CONFIG_CRC32=y 1048 1012 # CONFIG_LIBCRC32C is not set 1049 1013 CONFIG_PLIST=y 1014 + CONFIG_HAS_IOMEM=y 1015 + CONFIG_HAS_IOPORT=y 1016 + CONFIG_HAS_DMA=y 1050 1017 CONFIG_GENERIC_HARDIRQS=y 1051 1018 CONFIG_GENERIC_IRQ_PROBE=y
+2 -2
arch/sh64/kernel/entry.S
··· 947 947 ! FIXME:!!! 948 948 ! no handling of TIF_SYSCALL_TRACE yet!! 949 949 950 - movi (1 << TIF_NEED_RESCHED), r8 950 + movi _TIF_NEED_RESCHED, r8 951 951 and r8, r7, r8 952 952 pta work_resched, tr0 953 953 bne r8, ZERO, tr0 954 954 955 955 pta restore_all, tr1 956 956 957 - movi (1 << TIF_SIGPENDING), r8 957 + movi (_TIF_SIGPENDING | _TIF_RESTORE_SIGMASK), r8 958 958 and r8, r7, r8 959 959 pta work_notifysig, tr0 960 960 bne r8, ZERO, tr0
+3 -1
arch/sh64/kernel/irq.c
··· 94 94 */ 95 95 asmlinkage int do_IRQ(unsigned long vector_num, struct pt_regs * regs) 96 96 { 97 + struct pt_regs *old_regs = set_irq_regs(regs); 97 98 int irq; 98 99 99 100 irq_enter(); ··· 102 101 irq = irq_demux(vector_num); 103 102 104 103 if (irq >= 0) { 105 - __do_IRQ(irq, regs); 104 + __do_IRQ(irq); 106 105 } else { 107 106 printk("unexpected IRQ trap at vector %03lx\n", vector_num); 108 107 } 109 108 110 109 irq_exit(); 111 110 111 + set_irq_regs(old_regs); 112 112 return 1; 113 113 } 114 114
+7 -10
arch/sh64/kernel/pci_sh5.c
··· 340 340 return result; 341 341 } 342 342 343 - irqreturn_t pcish5_err_irq(int irq, void *dev_id, struct pt_regs *regs) 343 + static irqreturn_t pcish5_err_irq(int irq, void *dev_id) 344 344 { 345 + struct pt_regs *regs = get_irq_regs(); 345 346 unsigned pci_int, pci_air, pci_cir, pci_aint; 346 347 347 348 pci_int = SH5PCI_READ(INT); ··· 369 368 return IRQ_HANDLED; 370 369 } 371 370 372 - irqreturn_t pcish5_serr_irq(int irq, void *dev_id, struct pt_regs *regs) 371 + static irqreturn_t pcish5_serr_irq(int irq, void *dev_id) 373 372 { 374 373 printk("SERR IRQ\n"); 375 374 376 375 return IRQ_NONE; 377 376 } 378 - 379 - #define ROUND_UP(x, a) (((x) + (a) - 1) & ~((a) - 1)) 380 377 381 378 static void __init 382 379 pcibios_size_bridge(struct pci_bus *bus, struct resource *ior, ··· 432 433 mem_res.end -= mem_res.start; 433 434 434 435 /* Align the sizes up by bridge rules */ 435 - io_res.end = ROUND_UP(io_res.end, 4*1024) - 1; 436 - mem_res.end = ROUND_UP(mem_res.end, 1*1024*1024) - 1; 436 + io_res.end = ALIGN(io_res.end, 4*1024) - 1; 437 + mem_res.end = ALIGN(mem_res.end, 1*1024*1024) - 1; 437 438 438 439 /* Adjust the bridge's allocation requirements */ 439 440 bridge->resource[0].end = bridge->resource[0].start + io_res.end; ··· 446 447 447 448 /* adjust parent's resource requirements */ 448 449 if (ior) { 449 - ior->end = ROUND_UP(ior->end, 4*1024); 450 + ior->end = ALIGN(ior->end, 4*1024); 450 451 ior->end += io_res.end; 451 452 } 452 453 453 454 if (memr) { 454 - memr->end = ROUND_UP(memr->end, 1*1024*1024); 455 + memr->end = ALIGN(memr->end, 1*1024*1024); 455 456 memr->end += mem_res.end; 456 457 } 457 458 } 458 - 459 - #undef ROUND_UP 460 459 461 460 static void __init pcibios_size_bridges(void) 462 461 {
+1 -1
arch/sh64/kernel/pci_sh5.h
··· 4 4 * May be copied or modified under the terms of the GNU General Public 5 5 * License. See linux/COPYING for more information. 6 6 * 7 - * Defintions for the SH5 PCI hardware. 7 + * Definitions for the SH5 PCI hardware. 8 8 */ 9 9 10 10 /* Product ID */
+1 -1
arch/sh64/kernel/process.c
··· 387 387 * NOTE! Only a kernel-only process(ie the swapper or direct descendants 388 388 * who haven't done an "execve()") should use this: it will work within 389 389 * a system call from a "real" process, but the process memory space will 390 - * not be free'd until both the parent and the child have exited. 390 + * not be freed until both the parent and the child have exited. 391 391 */ 392 392 int kernel_thread(int (*fn)(void *), void * arg, unsigned long flags) 393 393 {
+29 -4
arch/sh64/kernel/signal.c
··· 698 698 if (try_to_freeze()) 699 699 goto no_signal; 700 700 701 - if (!oldset) 701 + if (test_thread_flag(TIF_RESTORE_SIGMASK)) 702 + oldset = &current->saved_sigmask; 703 + else if (!oldset) 702 704 oldset = &current->blocked; 703 705 704 706 signr = get_signal_to_deliver(&info, &ka, regs, 0); ··· 708 706 if (signr > 0) { 709 707 /* Whee! Actually deliver the signal. */ 710 708 handle_signal(signr, &info, &ka, oldset, regs); 709 + 710 + /* 711 + * If a signal was successfully delivered, the saved sigmask 712 + * is in its frame, and we can clear the TIF_RESTORE_SIGMASK 713 + * flag. 714 + */ 715 + if (test_thread_flag(TIF_RESTORE_SIGMASK)) 716 + clear_thread_flag(TIF_RESTORE_SIGMASK); 717 + 711 718 return 1; 712 719 } 713 720 ··· 724 713 /* Did we come from a system call? */ 725 714 if (regs->syscall_nr >= 0) { 726 715 /* Restart the system call - no handlers present */ 727 - if (regs->regs[REG_RET] == -ERESTARTNOHAND || 728 - regs->regs[REG_RET] == -ERESTARTSYS || 729 - regs->regs[REG_RET] == -ERESTARTNOINTR) { 716 + switch (regs->regs[REG_RET]) { 717 + case -ERESTARTNOHAND: 718 + case -ERESTARTSYS: 719 + case -ERESTARTNOINTR: 730 720 /* Decode Syscall # */ 731 721 regs->regs[REG_RET] = regs->syscall_nr; 732 722 regs->pc -= 4; 723 + break; 724 + 725 + case -ERESTART_RESTARTBLOCK: 726 + regs->regs[REG_RET] = __NR_restart_syscall; 727 + regs->pc -= 4; 728 + break; 733 729 } 734 730 } 731 + 732 + /* No signal to deliver -- put the saved sigmask back */ 733 + if (test_thread_flag(TIF_RESTORE_SIGMASK)) { 734 + clear_thread_flag(TIF_RESTORE_SIGMASK); 735 + sigprocmask(SIG_SETMASK, &current->saved_sigmask, NULL); 736 + } 737 + 735 738 return 0; 736 739 }
+33 -3
arch/sh64/kernel/syscalls.S
··· 2 2 * arch/sh64/kernel/syscalls.S 3 3 * 4 4 * Copyright (C) 2000, 2001 Paolo Alberelli 5 - * Copyright (C) 2004 Paul Mundt 5 + * Copyright (C) 2004 - 2007 Paul Mundt 6 6 * Copyright (C) 2003, 2004 Richard Curnow 7 7 * 8 8 * This file is subject to the terms and conditions of the GNU General Public ··· 20 20 */ 21 21 .globl sys_call_table 22 22 sys_call_table: 23 - .long sys_ni_syscall /* 0 - old "setup()" system call */ 23 + .long sys_restart_syscall /* 0 - old "setup()" system call */ 24 24 .long sys_exit 25 25 .long sys_fork 26 26 .long sys_read ··· 347 347 .long sys_inotify_init 348 348 .long sys_inotify_add_watch 349 349 .long sys_inotify_rm_watch /* 320 */ 350 - 350 + .long sys_ni_syscall 351 + .long sys_migrate_pages 352 + .long sys_openat 353 + .long sys_mkdirat 354 + .long sys_mknodat /* 325 */ 355 + .long sys_fchownat 356 + .long sys_futimesat 357 + .long sys_fstatat64 358 + .long sys_unlinkat 359 + .long sys_renameat /* 330 */ 360 + .long sys_linkat 361 + .long sys_symlinkat 362 + .long sys_readlinkat 363 + .long sys_fchmodat 364 + .long sys_faccessat /* 335 */ 365 + .long sys_pselect6 366 + .long sys_ppoll 367 + .long sys_unshare 368 + .long sys_set_robust_list 369 + .long sys_get_robust_list /* 340 */ 370 + .long sys_splice 371 + .long sys_sync_file_range 372 + .long sys_tee 373 + .long sys_vmsplice 374 + .long sys_move_pages /* 345 */ 375 + .long sys_getcpu 376 + .long sys_epoll_pwait 377 + .long sys_utimensat 378 + .long sys_signalfd 379 + .long sys_timerfd /* 350 */ 380 + .long sys_eventfd
+10 -8
arch/sh64/kernel/time.c
··· 123 123 static unsigned long long scaled_recip_ctc_ticks_per_jiffy; 124 124 125 125 /* Estimate number of microseconds that have elapsed since the last timer tick, 126 - by scaling the delta that has occured in the CTC register. 126 + by scaling the delta that has occurred in the CTC register. 127 127 128 128 WARNING WARNING WARNING : This algorithm relies on the CTC decrementing at 129 129 the CPU clock rate. If the CPU sleeps, the CTC stops counting. Bear this ··· 282 282 * timer_interrupt() needs to keep up the real-time clock, 283 283 * as well as call the "do_timer()" routine every clocktick 284 284 */ 285 - static inline void do_timer_interrupt(int irq, struct pt_regs *regs) 285 + static inline void do_timer_interrupt(void) 286 286 { 287 287 unsigned long long current_ctc; 288 288 asm ("getcon cr62, %0" : "=r" (current_ctc)); ··· 290 290 291 291 do_timer(1); 292 292 #ifndef CONFIG_SMP 293 - update_process_times(user_mode(regs)); 293 + update_process_times(user_mode(get_irq_regs())); 294 294 #endif 295 - profile_tick(CPU_PROFILING, regs); 295 + if (current->pid) 296 + profile_tick(CPU_PROFILING); 296 297 297 298 #ifdef CONFIG_HEARTBEAT 298 299 { ··· 324 323 * Time Stamp Counter value at the time of the timer interrupt, so that 325 324 * we later on can estimate the time of day more exactly. 326 325 */ 327 - static irqreturn_t timer_interrupt(int irq, void *dev_id, struct pt_regs *regs) 326 + static irqreturn_t timer_interrupt(int irq, void *dev_id) 328 327 { 329 328 unsigned long timer_status; 330 329 ··· 341 340 * locally disabled. -arca 342 341 */ 343 342 write_lock(&xtime_lock); 344 - do_timer_interrupt(irq, regs); 343 + do_timer_interrupt(); 345 344 write_unlock(&xtime_lock); 346 345 347 346 return IRQ_HANDLED; ··· 466 465 #endif 467 466 } 468 467 469 - static irqreturn_t sh64_rtc_interrupt(int irq, void *dev_id, 470 - struct pt_regs *regs) 468 + static irqreturn_t sh64_rtc_interrupt(int irq, void *dev_id) 471 469 { 470 + struct pt_regs *regs = get_irq_regs(); 471 + 472 472 ctrl_outb(0, RCR1); /* Disable Carry Interrupts */ 473 473 regs->regs[3] = 1; /* Using r3 */ 474 474
+1
arch/sh64/lib/.gitignore
··· 1 + syscalltab.h
+2 -2
arch/sh64/mach-cayman/irq.c
··· 29 29 /* Note the SMSC SuperIO chip and SMSC LAN chip interrupts are all muxed onto 30 30 the same SH-5 interrupt */ 31 31 32 - static irqreturn_t cayman_interrupt_smsc(int irq, void *dev_id, struct pt_regs *regs) 32 + static irqreturn_t cayman_interrupt_smsc(int irq, void *dev_id) 33 33 { 34 34 printk(KERN_INFO "CAYMAN: spurious SMSC interrupt\n"); 35 35 return IRQ_NONE; 36 36 } 37 37 38 - static irqreturn_t cayman_interrupt_pci2(int irq, void *dev_id, struct pt_regs *regs) 38 + static irqreturn_t cayman_interrupt_pci2(int irq, void *dev_id) 39 39 { 40 40 printk(KERN_INFO "CAYMAN: spurious PCI interrupt, IRQ %d\n", irq); 41 41 return IRQ_NONE;
+1 -1
arch/sh64/mach-cayman/setup.c
··· 213 213 SMSC_SUPERIO_WRITE_INDEXED(0x00, 0xc7); /* GP47 = nIOWOP */ 214 214 #endif 215 215 216 - /* Exit the configuraton state */ 216 + /* Exit the configuration state */ 217 217 outb(SMSC_EXIT_CONFIG_KEY, SMSC_CONFIG_PORT_ADDR); 218 218 219 219 return 0;
+1 -1
arch/sh64/mm/fault.c
··· 135 135 /* SIM 136 136 * Note this is now called with interrupts still disabled 137 137 * This is to cope with being called for a missing IO port 138 - * address with interupts disabled. This should be fixed as 138 + * address with interrupts disabled. This should be fixed as 139 139 * soon as we have a better 'fast path' miss handler. 140 140 * 141 141 * Plus take care how you try and debug this stuff.
+1 -1
arch/sh64/mm/init.c
··· 84 84 printk("%d reserved pages\n",reserved); 85 85 printk("%d pages shared\n",shared); 86 86 printk("%d pages swap cached\n",cached); 87 - printk("%ld pages in page table cache\n",pgtable_cache_size); 87 + printk("%ld pages in page table cache\n", quicklist_total_size()); 88 88 } 89 89 90 90 /*
+2 -2
arch/sh64/mm/tlbmiss.c
··· 14 14 * IMPORTANT NOTES : 15 15 * The do_fast_page_fault function is called from a context in entry.S where very few registers 16 16 * have been saved. In particular, the code in this file must be compiled not to use ANY 17 - * caller-save regiseters that are not part of the restricted save set. Also, it means that 17 + * caller-save registers that are not part of the restricted save set. Also, it means that 18 18 * code in this file must not make calls to functions elsewhere in the kernel, or else the 19 19 * excepting context will see corruption in its caller-save registers. Plus, the entry.S save 20 20 * area is non-reentrant, so this code has to run with SR.BL==1, i.e. no interrupts taken inside ··· 249 249 /* SIM 250 250 * Note this is now called with interrupts still disabled 251 251 * This is to cope with being called for a missing IO port 252 - * address with interupts disabled. This should be fixed as 252 + * address with interrupts disabled. This should be fixed as 253 253 * soon as we have a better 'fast path' miss handler. 254 254 * 255 255 * Plus take care how you try and debug this stuff.
+9
arch/um/include/sysdep-x86_64/kernel-offsets.h
··· 17 17 #define OFFSET(sym, str, mem) \ 18 18 DEFINE(sym, offsetof(struct str, mem)); 19 19 20 + #define __NO_STUBS 1 21 + #undef __SYSCALL 22 + #undef _ASM_X86_64_UNISTD_H_ 23 + #define __SYSCALL(nr, sym) [nr] = 1, 24 + static char syscalls[] = { 25 + #include <asm/arch/unistd.h> 26 + }; 27 + 20 28 void foo(void) 21 29 { 22 30 #include <common-offsets.h> 31 + DEFINE(UM_NR_syscall_max, sizeof(syscalls) - 1); 23 32 }
+2 -1
arch/um/include/sysdep-x86_64/syscalls.h
··· 9 9 10 10 #include <linux/msg.h> 11 11 #include <linux/shm.h> 12 + #include <kern_constants.h> 12 13 13 14 typedef long syscall_handler_t(void); 14 15 ··· 30 29 extern syscall_handler_t sys_modify_ldt; 31 30 extern syscall_handler_t sys_arch_prctl; 32 31 33 - #define NR_syscalls (__NR_syscall_max + 1) 32 + #define NR_syscalls (UM_NR_syscall_max + 1) 34 33 35 34 #endif
+3 -2
arch/um/sys-x86_64/syscall_table.c
··· 4 4 #include <linux/linkage.h> 5 5 #include <linux/sys.h> 6 6 #include <linux/cache.h> 7 + #include <kern_constants.h> 7 8 8 9 #define __NO_STUBS 9 10 ··· 46 45 47 46 extern void sys_ni_syscall(void); 48 47 49 - sys_call_ptr_t sys_call_table[__NR_syscall_max+1] __cacheline_aligned = { 48 + sys_call_ptr_t sys_call_table[UM_NR_syscall_max+1] __cacheline_aligned = { 50 49 /* Smells like a like a compiler bug -- it doesn't work when the & below is removed. */ 51 - [0 ... __NR_syscall_max] = &sys_ni_syscall, 50 + [0 ... UM_NR_syscall_max] = &sys_ni_syscall, 52 51 #include <asm-x86_64/unistd.h> 53 52 };
+1
drivers/firewire/fw-ohci.c
··· 26 26 #include <linux/delay.h> 27 27 #include <linux/poll.h> 28 28 #include <linux/dma-mapping.h> 29 + #include <linux/mm.h> 29 30 30 31 #include <asm/uaccess.h> 31 32 #include <asm/semaphore.h>
+4 -11
drivers/ide/Kconfig
··· 4 4 # Andre Hedrick <andre@linux-ide.org> 5 5 # 6 6 7 - if BLOCK 8 - 9 - menu "ATA/ATAPI/MFM/RLL support" 10 - depends on HAS_IOMEM 11 - 12 - config IDE 7 + menuconfig IDE 13 8 tristate "ATA/ATAPI/MFM/RLL support" 9 + depends on BLOCK 10 + depends on HAS_IOMEM 14 11 ---help--- 15 12 If you say Y here, your kernel will be able to manage low cost mass 16 13 storage units such as ATA/(E)IDE and ATAPI units. The most common ··· 1096 1099 config BLK_DEV_HD 1097 1100 def_bool BLK_DEV_HD_IDE || BLK_DEV_HD_ONLY 1098 1101 1099 - endif 1100 - 1101 - endmenu 1102 - 1103 - endif 1102 + endif # IDE
+1 -13
drivers/ide/cris/ide-cris.c
··· 1002 1002 return 1; /* let the PIO routines handle this weirdness */ 1003 1003 } 1004 1004 1005 - static int cris_config_drive_for_dma (ide_drive_t *drive) 1006 - { 1007 - u8 speed = ide_max_dma_mode(drive); 1008 - 1009 - if (!speed) 1010 - return 0; 1011 - 1012 - speed_cris_ide(drive, speed); 1013 - 1014 - return ide_dma_enable(drive); 1015 - } 1016 - 1017 1005 /* 1018 1006 * cris_dma_intr() is the handler for disk read/write DMA interrupts 1019 1007 */ ··· 1031 1043 1032 1044 static int cris_dma_check(ide_drive_t *drive) 1033 1045 { 1034 - if (ide_use_dma(drive) && cris_config_drive_for_dma(drive)) 1046 + if (ide_tune_dma(drive)) 1035 1047 return 0; 1036 1048 1037 1049 return -1;
+12 -41
drivers/ide/ide-dma.c
··· 670 670 671 671 EXPORT_SYMBOL(__ide_dma_good_drive); 672 672 673 - int ide_use_dma(ide_drive_t *drive) 674 - { 675 - struct hd_driveid *id = drive->id; 676 - ide_hwif_t *hwif = drive->hwif; 677 - 678 - if ((id->capability & 1) == 0 || drive->autodma == 0) 679 - return 0; 680 - 681 - /* consult the list of known "bad" drives */ 682 - if (__ide_dma_bad_drive(drive)) 683 - return 0; 684 - 685 - /* capable of UltraDMA modes */ 686 - if (id->field_valid & 4) { 687 - if (hwif->ultra_mask & id->dma_ultra) 688 - return 1; 689 - } 690 - 691 - /* capable of regular DMA modes */ 692 - if (id->field_valid & 2) { 693 - if (hwif->mwdma_mask & id->dma_mword) 694 - return 1; 695 - if (hwif->swdma_mask & id->dma_1word) 696 - return 1; 697 - } 698 - 699 - /* consult the list of known "good" drives */ 700 - if (__ide_dma_good_drive(drive) && id->eide_dma_time < 150) 701 - return 1; 702 - 703 - return 0; 704 - } 705 - 706 - EXPORT_SYMBOL_GPL(ide_use_dma); 707 - 708 673 static const u8 xfer_mode_bases[] = { 709 674 XFER_UDMA_0, 710 675 XFER_MW_DMA_0, ··· 696 731 mask &= 0x07; 697 732 break; 698 733 case XFER_MW_DMA_0: 699 - mask = id->dma_mword & hwif->mwdma_mask; 734 + if (id->field_valid & 2) 735 + mask = id->dma_mword & hwif->mwdma_mask; 700 736 break; 701 737 case XFER_SW_DMA_0: 702 - mask = id->dma_1word & hwif->swdma_mask; 738 + if (id->field_valid & 2) 739 + mask = id->dma_1word & hwif->swdma_mask; 703 740 break; 704 741 default: 705 742 BUG(); ··· 750 783 { 751 784 u8 speed; 752 785 753 - /* TODO: use only ide_max_dma_mode() */ 754 - if (!ide_use_dma(drive)) 786 + if ((drive->id->capability & 1) == 0 || drive->autodma == 0) 787 + return 0; 788 + 789 + /* consult the list of known "bad" drives */ 790 + if (__ide_dma_bad_drive(drive)) 755 791 return 0; 756 792 757 793 speed = ide_max_dma_mode(drive); ··· 762 792 if (!speed) 763 793 return 0; 764 794 765 - drive->hwif->speedproc(drive, speed); 795 + if (drive->hwif->speedproc(drive, speed)) 796 + return 0; 766 797 767 - return ide_dma_enable(drive); 798 + return 1; 768 799 } 769 800 770 801 EXPORT_SYMBOL_GPL(ide_tune_dma);
+1
drivers/ide/ide-io.c
··· 223 223 break; 224 224 if (drive->hwif->ide_dma_check == NULL) 225 225 break; 226 + drive->hwif->dma_off_quietly(drive); 226 227 ide_set_dma(drive); 227 228 break; 228 229 }
-12
drivers/ide/ide-lib.c
··· 111 111 112 112 EXPORT_SYMBOL(ide_rate_filter); 113 113 114 - int ide_dma_enable (ide_drive_t *drive) 115 - { 116 - ide_hwif_t *hwif = HWIF(drive); 117 - struct hd_driveid *id = drive->id; 118 - 119 - return ((int) ((((id->dma_ultra >> 8) & hwif->ultra_mask) || 120 - ((id->dma_mword >> 8) & hwif->mwdma_mask) || 121 - ((id->dma_1word >> 8) & hwif->swdma_mask)) ? 1 : 0)); 122 - } 123 - 124 - EXPORT_SYMBOL(ide_dma_enable); 125 - 126 114 int ide_use_fast_pio(ide_drive_t *drive) 127 115 { 128 116 struct hd_driveid *id = drive->id;
+1
drivers/ide/ide.c
··· 910 910 err = 0; 911 911 912 912 if (arg) { 913 + hwif->dma_off_quietly(drive); 913 914 if (ide_set_dma(drive) || hwif->ide_dma_on(drive)) 914 915 err = -EIO; 915 916 } else
+7 -62
drivers/ide/pci/alim15x3.c
··· 455 455 return (ide_config_drive_speed(drive, speed)); 456 456 } 457 457 458 - 459 - /** 460 - * config_chipset_for_dma - set up DMA mode 461 - * @drive: drive to configure for 462 - * 463 - * Place a drive into DMA mode and tune the chipset for 464 - * the selected speed. 465 - * 466 - * Returns true if DMA mode can be used 467 - */ 468 - 469 - static int config_chipset_for_dma (ide_drive_t *drive) 470 - { 471 - u8 speed = ide_max_dma_mode(drive); 472 - 473 - if (!(speed)) 474 - return 0; 475 - 476 - (void) ali15x3_tune_chipset(drive, speed); 477 - return ide_dma_enable(drive); 478 - } 479 - 480 458 /** 481 459 * ali15x3_config_drive_for_dma - configure for DMA 482 460 * @drive: drive to configure ··· 465 487 466 488 static int ali15x3_config_drive_for_dma(ide_drive_t *drive) 467 489 { 468 - ide_hwif_t *hwif = HWIF(drive); 469 - struct hd_driveid *id = drive->id; 470 - 471 - if ((m5229_revision<=0x20) && (drive->media!=ide_disk)) 472 - goto ata_pio; 473 - 474 490 drive->init_speed = 0; 475 491 476 - if ((id != NULL) && ((id->capability & 1) != 0) && drive->autodma) { 477 - /* Consult the list of known "bad" drives */ 478 - if (__ide_dma_bad_drive(drive)) 479 - goto ata_pio; 480 - if ((id->field_valid & 4) && (m5229_revision >= 0xC2)) { 481 - if (id->dma_ultra & hwif->ultra_mask) { 482 - /* Force if Capable UltraDMA */ 483 - int dma = config_chipset_for_dma(drive); 484 - if ((id->field_valid & 2) && !dma) 485 - goto try_dma_modes; 486 - } 487 - } else if (id->field_valid & 2) { 488 - try_dma_modes: 489 - if ((id->dma_mword & hwif->mwdma_mask) || 490 - (id->dma_1word & hwif->swdma_mask)) { 491 - /* Force if Capable regular DMA modes */ 492 - if (!config_chipset_for_dma(drive)) 493 - goto ata_pio; 494 - } 495 - } else if (__ide_dma_good_drive(drive) && 496 - (id->eide_dma_time < 150)) { 497 - /* Consult the list of known "good" drives */ 498 - if (!config_chipset_for_dma(drive)) 499 - goto ata_pio; 500 - } else { 501 - goto ata_pio; 502 - } 503 - } else { 504 - ata_pio: 505 - hwif->tuneproc(drive, 255); 506 - return -1; 507 - } 492 + if (ide_tune_dma(drive)) 493 + return 0; 508 494 509 - return 0; 495 + ali15x3_tune_drive(drive, 255); 496 + 497 + return -1; 510 498 } 511 499 512 500 /** ··· 683 739 return; 684 740 } 685 741 686 - hwif->atapi_dma = 1; 742 + if (m5229_revision > 0x20) 743 + hwif->atapi_dma = 1; 687 744 688 745 if (m5229_revision <= 0x20) 689 746 hwif->ultra_mask = 0x00; /* no udma */
+1 -14
drivers/ide/pci/cmd64x.c
··· 352 352 return ide_config_drive_speed(drive, speed); 353 353 } 354 354 355 - static int config_chipset_for_dma (ide_drive_t *drive) 356 - { 357 - u8 speed = ide_max_dma_mode(drive); 358 - 359 - if (!speed) 360 - return 0; 361 - 362 - if (cmd64x_tune_chipset(drive, speed)) 363 - return 0; 364 - 365 - return ide_dma_enable(drive); 366 - } 367 - 368 355 static int cmd64x_config_drive_for_dma (ide_drive_t *drive) 369 356 { 370 - if (ide_use_dma(drive) && config_chipset_for_dma(drive)) 357 + if (ide_tune_dma(drive)) 371 358 return 0; 372 359 373 360 if (ide_use_fast_pio(drive))
+80 -82
drivers/ide/pci/cs5530.c
··· 1 1 /* 2 - * linux/drivers/ide/pci/cs5530.c Version 0.7 Sept 10, 2002 2 + * linux/drivers/ide/pci/cs5530.c Version 0.73 Mar 10 2007 3 3 * 4 4 * Copyright (C) 2000 Andre Hedrick <andre@linux-ide.org> 5 - * Ditto of GNU General Public License. 6 - * 7 5 * Copyright (C) 2000 Mark Lord <mlord@pobox.com> 6 + * Copyright (C) 2007 Bartlomiej Zolnierkiewicz 7 + * 8 8 * May be copied or modified under the terms of the GNU General Public License 9 9 * 10 10 * Development of this chipset driver was funded ··· 62 62 #define CS5530_BAD_PIO(timings) (((timings)&~0x80000000)==0x0000e132) 63 63 #define CS5530_BASEREG(hwif) (((hwif)->dma_base & ~0xf) + ((hwif)->channel ? 0x30 : 0x20)) 64 64 65 + static void cs5530_tunepio(ide_drive_t *drive, u8 pio) 66 + { 67 + unsigned long basereg = CS5530_BASEREG(drive->hwif); 68 + unsigned int format = (inl(basereg + 4) >> 31) & 1; 69 + 70 + outl(cs5530_pio_timings[format][pio], basereg + ((drive->dn & 1)<<3)); 71 + } 72 + 65 73 /** 66 74 * cs5530_tuneproc - select/set PIO modes 67 75 * ··· 82 74 83 75 static void cs5530_tuneproc (ide_drive_t *drive, u8 pio) /* pio=255 means "autotune" */ 84 76 { 85 - ide_hwif_t *hwif = HWIF(drive); 86 - unsigned int format; 87 - unsigned long basereg = CS5530_BASEREG(hwif); 88 - static u8 modes[5] = { XFER_PIO_0, XFER_PIO_1, XFER_PIO_2, XFER_PIO_3, XFER_PIO_4}; 89 - 90 77 pio = ide_get_best_pio_mode(drive, pio, 4, NULL); 91 - if (!cs5530_set_xfer_mode(drive, modes[pio])) { 92 - format = (inl(basereg + 4) >> 31) & 1; 93 - outl(cs5530_pio_timings[format][pio], 94 - basereg+(drive->select.b.unit<<3)); 95 - } 78 + 79 + if (cs5530_set_xfer_mode(drive, XFER_PIO_0 + pio) == 0) 80 + cs5530_tunepio(drive, pio); 96 81 } 97 82 98 83 /** 99 - * cs5530_config_dma - select/set DMA and UDMA modes 84 + * cs5530_udma_filter - UDMA filter 85 + * @drive: drive 86 + * 87 + * cs5530_udma_filter() does UDMA mask filtering for the given drive 88 + * taking into the consideration capabilities of the mate device. 89 + * 90 + * The CS5530 specifies that two drives sharing a cable cannot mix 91 + * UDMA/MDMA. It has to be one or the other, for the pair, though 92 + * different timings can still be chosen for each drive. We could 93 + * set the appropriate timing bits on the fly, but that might be 94 + * a bit confusing. So, for now we statically handle this requirement 95 + * by looking at our mate drive to see what it is capable of, before 96 + * choosing a mode for our own drive. 97 + * 98 + * Note: This relies on the fact we never fail from UDMA to MWDMA2 99 + * but instead drop to PIO. 100 + */ 101 + 102 + static u8 cs5530_udma_filter(ide_drive_t *drive) 103 + { 104 + ide_hwif_t *hwif = drive->hwif; 105 + ide_drive_t *mate = &hwif->drives[(drive->dn & 1) ^ 1]; 106 + struct hd_driveid *mateid = mate->id; 107 + u8 mask = hwif->ultra_mask; 108 + 109 + if (mate->present == 0) 110 + goto out; 111 + 112 + if ((mateid->capability & 1) && __ide_dma_bad_drive(mate) == 0) { 113 + if ((mateid->field_valid & 4) && (mateid->dma_ultra & 7)) 114 + goto out; 115 + if ((mateid->field_valid & 2) && (mateid->dma_mword & 7)) 116 + mask = 0; 117 + } 118 + out: 119 + return mask; 120 + } 121 + 122 + /** 123 + * cs5530_config_dma - set DMA/UDMA mode 100 124 * @drive: drive to tune 101 125 * 102 - * cs5530_config_dma() handles selection/setting of DMA/UDMA modes 103 - * for both the chipset and drive. The CS5530 has limitations about 104 - * mixing DMA/UDMA on the same cable. 126 + * cs5530_config_dma() handles setting of DMA/UDMA mode 127 + * for both the chipset and drive. 105 128 */ 106 - 107 - static int cs5530_config_dma (ide_drive_t *drive) 129 + 130 + static int cs5530_config_dma(ide_drive_t *drive) 108 131 { 109 - int udma_ok = 1, mode = 0; 110 - ide_hwif_t *hwif = HWIF(drive); 111 - int unit = drive->select.b.unit; 112 - ide_drive_t *mate = &hwif->drives[unit^1]; 113 - struct hd_driveid *id = drive->id; 114 - unsigned int reg, timings = 0; 115 - unsigned long basereg; 132 + if (ide_tune_dma(drive)) 133 + return 0; 116 134 117 - /* 118 - * Default to DMA-off in case we run into trouble here. 119 - */ 120 - hwif->dma_off_quietly(drive); 135 + return 1; 136 + } 121 137 122 - /* 123 - * The CS5530 specifies that two drives sharing a cable cannot 124 - * mix UDMA/MDMA. It has to be one or the other, for the pair, 125 - * though different timings can still be chosen for each drive. 126 - * We could set the appropriate timing bits on the fly, 127 - * but that might be a bit confusing. So, for now we statically 128 - * handle this requirement by looking at our mate drive to see 129 - * what it is capable of, before choosing a mode for our own drive. 130 - * 131 - * Note: This relies on the fact we never fail from UDMA to MWDMA_2 132 - * but instead drop to PIO 133 - */ 134 - if (mate->present) { 135 - struct hd_driveid *mateid = mate->id; 136 - if (mateid && (mateid->capability & 1) && 137 - !__ide_dma_bad_drive(mate)) { 138 - if ((mateid->field_valid & 4) && 139 - (mateid->dma_ultra & 7)) 140 - udma_ok = 1; 141 - else if ((mateid->field_valid & 2) && 142 - (mateid->dma_mword & 7)) 143 - udma_ok = 0; 144 - else 145 - udma_ok = 1; 146 - } 147 - } 138 + static int cs5530_tune_chipset(ide_drive_t *drive, u8 mode) 139 + { 140 + unsigned long basereg; 141 + unsigned int reg, timings = 0; 148 142 149 - /* 150 - * Now see what the current drive is capable of, 151 - * selecting UDMA only if the mate said it was ok. 152 - */ 153 - if (id && (id->capability & 1) && drive->autodma && 154 - !__ide_dma_bad_drive(drive)) { 155 - if (udma_ok && (id->field_valid & 4) && (id->dma_ultra & 7)) { 156 - if (id->dma_ultra & 4) 157 - mode = XFER_UDMA_2; 158 - else if (id->dma_ultra & 2) 159 - mode = XFER_UDMA_1; 160 - else if (id->dma_ultra & 1) 161 - mode = XFER_UDMA_0; 162 - } 163 - if (!mode && (id->field_valid & 2) && (id->dma_mword & 7)) { 164 - if (id->dma_mword & 4) 165 - mode = XFER_MW_DMA_2; 166 - else if (id->dma_mword & 2) 167 - mode = XFER_MW_DMA_1; 168 - else if (id->dma_mword & 1) 169 - mode = XFER_MW_DMA_0; 170 - } 171 - } 143 + mode = ide_rate_filter(drive, mode); 172 144 173 145 /* 174 146 * Tell the drive to switch to the new mode; abort on failure. 175 147 */ 176 - if (!mode || cs5530_set_xfer_mode(drive, mode)) 148 + if (cs5530_set_xfer_mode(drive, mode)) 177 149 return 1; /* failure */ 178 150 179 151 /* ··· 166 178 case XFER_MW_DMA_0: timings = 0x00077771; break; 167 179 case XFER_MW_DMA_1: timings = 0x00012121; break; 168 180 case XFER_MW_DMA_2: timings = 0x00002020; break; 181 + case XFER_PIO_4: 182 + case XFER_PIO_3: 183 + case XFER_PIO_2: 184 + case XFER_PIO_1: 185 + case XFER_PIO_0: 186 + cs5530_tunepio(drive, mode - XFER_PIO_0); 187 + return 0; 169 188 default: 170 189 BUG(); 171 190 break; 172 191 } 173 - basereg = CS5530_BASEREG(hwif); 192 + basereg = CS5530_BASEREG(drive->hwif); 174 193 reg = inl(basereg + 4); /* get drive0 config register */ 175 194 timings |= reg & 0x80000000; /* preserve PIO format bit */ 176 - if (unit == 0) { /* are we configuring drive0? */ 195 + if ((drive-> dn & 1) == 0) { /* are we configuring drive0? */ 177 196 outl(timings, basereg + 4); /* write drive0 config register */ 178 197 } else { 179 198 if (timings & 0x00100000) ··· 306 311 hwif->serialized = hwif->mate->serialized = 1; 307 312 308 313 hwif->tuneproc = &cs5530_tuneproc; 314 + hwif->speedproc = &cs5530_tune_chipset; 315 + 309 316 basereg = CS5530_BASEREG(hwif); 310 317 d0_timings = inl(basereg + 0); 311 318 if (CS5530_BAD_PIO(d0_timings)) { ··· 329 332 hwif->ultra_mask = 0x07; 330 333 hwif->mwdma_mask = 0x07; 331 334 335 + hwif->udma_filter = cs5530_udma_filter; 332 336 hwif->ide_dma_check = &cs5530_config_dma; 333 337 if (!noautodma) 334 338 hwif->autodma = 1;
+1 -20
drivers/ide/pci/it821x.c
··· 464 464 } 465 465 466 466 /** 467 - * config_chipset_for_dma - configure for DMA 468 - * @drive: drive to configure 469 - * 470 - * Called by the IDE layer when it wants the timings set up. 471 - */ 472 - 473 - static int config_chipset_for_dma (ide_drive_t *drive) 474 - { 475 - u8 speed = ide_max_dma_mode(drive); 476 - 477 - if (speed == 0) 478 - return 0; 479 - 480 - it821x_tune_chipset(drive, speed); 481 - 482 - return ide_dma_enable(drive); 483 - } 484 - 485 - /** 486 467 * it821x_configure_drive_for_dma - set up for DMA transfers 487 468 * @drive: drive we are going to set up 488 469 * ··· 475 494 476 495 static int it821x_config_drive_for_dma (ide_drive_t *drive) 477 496 { 478 - if (ide_use_dma(drive) && config_chipset_for_dma(drive)) 497 + if (ide_tune_dma(drive)) 479 498 return 0; 480 499 481 500 it821x_tuneproc(drive, 255);
+1 -28
drivers/ide/pci/pdc202xx_new.c
··· 228 228 return get_indexed_reg(hwif, 0x0b) & 0x04; 229 229 } 230 230 231 - static int config_chipset_for_dma(ide_drive_t *drive) 232 - { 233 - struct hd_driveid *id = drive->id; 234 - ide_hwif_t *hwif = HWIF(drive); 235 - u8 speed; 236 - 237 - if (id->capability & 4) { 238 - /* 239 - * Set IORDY_EN & PREFETCH_EN (this seems to have 240 - * NO real effect since this register is reloaded 241 - * by hardware when the transfer mode is selected) 242 - */ 243 - u8 tmp, adj = (drive->dn & 1) ? 0x08 : 0x00; 244 - 245 - tmp = get_indexed_reg(hwif, 0x13 + adj); 246 - set_indexed_reg(hwif, 0x13 + adj, tmp | 0x03); 247 - } 248 - 249 - speed = ide_max_dma_mode(drive); 250 - 251 - if (!speed) 252 - return 0; 253 - 254 - (void) hwif->speedproc(drive, speed); 255 - return ide_dma_enable(drive); 256 - } 257 - 258 231 static int pdcnew_config_drive_xfer_rate(ide_drive_t *drive) 259 232 { 260 233 drive->init_speed = 0; 261 234 262 - if (ide_use_dma(drive) && config_chipset_for_dma(drive)) 235 + if (ide_tune_dma(drive)) 263 236 return 0; 264 237 265 238 if (ide_use_fast_pio(drive))
+41 -143
drivers/ide/pci/pdc202xx_old.c
··· 1 1 /* 2 - * linux/drivers/ide/pci/pdc202xx_old.c Version 0.36 Sept 11, 2002 2 + * linux/drivers/ide/pci/pdc202xx_old.c Version 0.50 Mar 3, 2007 3 3 * 4 4 * Copyright (C) 1998-2002 Andre Hedrick <andre@linux-ide.org> 5 5 * Copyright (C) 2006-2007 MontaVista Software, Inc. 6 + * Copyright (C) 2007 Bartlomiej Zolnierkiewicz 6 7 * 7 8 * Promise Ultra33 cards with BIOS v1.20 through 1.28 will need this 8 9 * compiled into the kernel if you have more than one card installed. ··· 61 60 NULL 62 61 }; 63 62 64 - /* A Register */ 65 - #define SYNC_ERRDY_EN 0xC0 66 - 67 - #define SYNC_IN 0x80 /* control bit, different for master vs. slave drives */ 68 - #define ERRDY_EN 0x40 /* control bit, different for master vs. slave drives */ 69 - #define IORDY_EN 0x20 /* PIO: IOREADY */ 70 - #define PREFETCH_EN 0x10 /* PIO: PREFETCH */ 71 - 72 - #define PA3 0x08 /* PIO"A" timing */ 73 - #define PA2 0x04 /* PIO"A" timing */ 74 - #define PA1 0x02 /* PIO"A" timing */ 75 - #define PA0 0x01 /* PIO"A" timing */ 76 - 77 - /* B Register */ 78 - 79 - #define MB2 0x80 /* DMA"B" timing */ 80 - #define MB1 0x40 /* DMA"B" timing */ 81 - #define MB0 0x20 /* DMA"B" timing */ 82 - 83 - #define PB4 0x10 /* PIO_FORCE 1:0 */ 84 - 85 - #define PB3 0x08 /* PIO"B" timing */ /* PIO flow Control mode */ 86 - #define PB2 0x04 /* PIO"B" timing */ /* PIO 4 */ 87 - #define PB1 0x02 /* PIO"B" timing */ /* PIO 3 half */ 88 - #define PB0 0x01 /* PIO"B" timing */ /* PIO 3 other half */ 89 - 90 - /* C Register */ 91 - #define IORDYp_NO_SPEED 0x4F 92 - #define SPEED_DIS 0x0F 93 - 94 - #define DMARQp 0x80 95 - #define IORDYp 0x40 96 - #define DMAR_EN 0x20 97 - #define DMAW_EN 0x10 98 - 99 - #define MC3 0x08 /* DMA"C" timing */ 100 - #define MC2 0x04 /* DMA"C" timing */ 101 - #define MC1 0x02 /* DMA"C" timing */ 102 - #define MC0 0x01 /* DMA"C" timing */ 63 + static void pdc_old_disable_66MHz_clock(ide_hwif_t *); 103 64 104 65 static int pdc202xx_tune_chipset (ide_drive_t *drive, u8 xferspeed) 105 66 { ··· 70 107 u8 drive_pci = 0x60 + (drive->dn << 2); 71 108 u8 speed = ide_rate_filter(drive, xferspeed); 72 109 73 - u32 drive_conf; 74 - u8 AP, BP, CP, DP; 110 + u8 AP = 0, BP = 0, CP = 0; 75 111 u8 TA = 0, TB = 0, TC = 0; 76 112 77 - if (drive->media != ide_disk && 78 - drive->media != ide_cdrom && speed < XFER_SW_DMA_0) 79 - return -1; 80 - 113 + #if PDC202XX_DEBUG_DRIVE_INFO 114 + u32 drive_conf = 0; 81 115 pci_read_config_dword(dev, drive_pci, &drive_conf); 82 - pci_read_config_byte(dev, (drive_pci), &AP); 83 - pci_read_config_byte(dev, (drive_pci)|0x01, &BP); 84 - pci_read_config_byte(dev, (drive_pci)|0x02, &CP); 85 - pci_read_config_byte(dev, (drive_pci)|0x03, &DP); 116 + #endif 86 117 87 - if (speed < XFER_SW_DMA_0) { 88 - if ((AP & 0x0F) || (BP & 0x07)) { 89 - /* clear PIO modes of lower 8421 bits of A Register */ 90 - pci_write_config_byte(dev, (drive_pci), AP &~0x0F); 91 - pci_read_config_byte(dev, (drive_pci), &AP); 118 + /* 119 + * TODO: do this once per channel 120 + */ 121 + if (dev->device != PCI_DEVICE_ID_PROMISE_20246) 122 + pdc_old_disable_66MHz_clock(hwif); 92 123 93 - /* clear PIO modes of lower 421 bits of B Register */ 94 - pci_write_config_byte(dev, (drive_pci)|0x01, BP &~0x07); 95 - pci_read_config_byte(dev, (drive_pci)|0x01, &BP); 96 - 97 - pci_read_config_byte(dev, (drive_pci), &AP); 98 - pci_read_config_byte(dev, (drive_pci)|0x01, &BP); 99 - } 100 - } else { 101 - if ((BP & 0xF0) && (CP & 0x0F)) { 102 - /* clear DMA modes of upper 842 bits of B Register */ 103 - /* clear PIO forced mode upper 1 bit of B Register */ 104 - pci_write_config_byte(dev, (drive_pci)|0x01, BP &~0xF0); 105 - pci_read_config_byte(dev, (drive_pci)|0x01, &BP); 106 - 107 - /* clear DMA modes of lower 8421 bits of C Register */ 108 - pci_write_config_byte(dev, (drive_pci)|0x02, CP &~0x0F); 109 - pci_read_config_byte(dev, (drive_pci)|0x02, &CP); 110 - } 111 - } 112 - 113 - pci_read_config_byte(dev, (drive_pci), &AP); 114 - pci_read_config_byte(dev, (drive_pci)|0x01, &BP); 115 - pci_read_config_byte(dev, (drive_pci)|0x02, &CP); 124 + pci_read_config_byte(dev, drive_pci, &AP); 125 + pci_read_config_byte(dev, drive_pci + 1, &BP); 126 + pci_read_config_byte(dev, drive_pci + 2, &CP); 116 127 117 128 switch(speed) { 118 - case XFER_UDMA_6: speed = XFER_UDMA_5; 119 129 case XFER_UDMA_5: 120 130 case XFER_UDMA_4: TB = 0x20; TC = 0x01; break; 121 131 case XFER_UDMA_2: TB = 0x20; TC = 0x01; break; ··· 97 161 case XFER_UDMA_0: 98 162 case XFER_MW_DMA_2: TB = 0x60; TC = 0x03; break; 99 163 case XFER_MW_DMA_1: TB = 0x60; TC = 0x04; break; 100 - case XFER_MW_DMA_0: 164 + case XFER_MW_DMA_0: TB = 0xE0; TC = 0x0F; break; 101 165 case XFER_SW_DMA_2: TB = 0x60; TC = 0x05; break; 102 166 case XFER_SW_DMA_1: TB = 0x80; TC = 0x06; break; 103 167 case XFER_SW_DMA_0: TB = 0xC0; TC = 0x0B; break; ··· 110 174 } 111 175 112 176 if (speed < XFER_SW_DMA_0) { 113 - pci_write_config_byte(dev, (drive_pci), AP|TA); 114 - pci_write_config_byte(dev, (drive_pci)|0x01, BP|TB); 177 + /* 178 + * preserve SYNC_INT / ERDDY_EN bits while clearing 179 + * Prefetch_EN / IORDY_EN / PA[3:0] bits of register A 180 + */ 181 + AP &= ~0x3f; 182 + if (drive->id->capability & 4) 183 + AP |= 0x20; /* set IORDY_EN bit */ 184 + if (drive->media == ide_disk) 185 + AP |= 0x10; /* set Prefetch_EN bit */ 186 + /* clear PB[4:0] bits of register B */ 187 + BP &= ~0x1f; 188 + pci_write_config_byte(dev, drive_pci, AP | TA); 189 + pci_write_config_byte(dev, drive_pci + 1, BP | TB); 115 190 } else { 116 - pci_write_config_byte(dev, (drive_pci)|0x01, BP|TB); 117 - pci_write_config_byte(dev, (drive_pci)|0x02, CP|TC); 191 + /* clear MB[2:0] bits of register B */ 192 + BP &= ~0xe0; 193 + /* clear MC[3:0] bits of register C */ 194 + CP &= ~0x0f; 195 + pci_write_config_byte(dev, drive_pci + 1, BP | TB); 196 + pci_write_config_byte(dev, drive_pci + 2, CP | TC); 118 197 } 119 198 120 199 #if PDC202XX_DEBUG_DRIVE_INFO 121 200 printk(KERN_DEBUG "%s: %s drive%d 0x%08x ", 122 201 drive->name, ide_xfer_verbose(speed), 123 202 drive->dn, drive_conf); 124 - pci_read_config_dword(dev, drive_pci, &drive_conf); 203 + pci_read_config_dword(dev, drive_pci, &drive_conf); 125 204 printk("0x%08x\n", drive_conf); 126 - #endif /* PDC202XX_DEBUG_DRIVE_INFO */ 205 + #endif 127 206 128 - return (ide_config_drive_speed(drive, speed)); 207 + return ide_config_drive_speed(drive, speed); 129 208 } 130 - 131 209 132 210 static void pdc202xx_tune_drive(ide_drive_t *drive, u8 pio) 133 211 { ··· 159 209 /* 160 210 * Set the control register to use the 66MHz system 161 211 * clock for UDMA 3/4/5 mode operation when necessary. 212 + * 213 + * FIXME: this register is shared by both channels, some locking is needed 162 214 * 163 215 * It may also be possible to leave the 66MHz clock on 164 216 * and readjust the timing parameters. ··· 181 229 outb(clock & ~(hwif->channel ? 0x08 : 0x02), clock_reg); 182 230 } 183 231 184 - static int config_chipset_for_dma (ide_drive_t *drive) 185 - { 186 - struct hd_driveid *id = drive->id; 187 - ide_hwif_t *hwif = HWIF(drive); 188 - struct pci_dev *dev = hwif->pci_dev; 189 - u32 drive_conf = 0; 190 - u8 drive_pci = 0x60 + (drive->dn << 2); 191 - u8 test1 = 0, test2 = 0, speed = -1; 192 - u8 AP = 0; 193 - 194 - if (dev->device != PCI_DEVICE_ID_PROMISE_20246) 195 - pdc_old_disable_66MHz_clock(drive->hwif); 196 - 197 - drive_pci = 0x60 + (drive->dn << 2); 198 - pci_read_config_dword(dev, drive_pci, &drive_conf); 199 - if ((drive_conf != 0x004ff304) && (drive_conf != 0x004ff3c4)) 200 - goto chipset_is_set; 201 - 202 - pci_read_config_byte(dev, drive_pci, &test1); 203 - if (!(test1 & SYNC_ERRDY_EN)) { 204 - if (drive->select.b.unit & 0x01) { 205 - pci_read_config_byte(dev, drive_pci - 4, &test2); 206 - if ((test2 & SYNC_ERRDY_EN) && 207 - !(test1 & SYNC_ERRDY_EN)) { 208 - pci_write_config_byte(dev, drive_pci, 209 - test1|SYNC_ERRDY_EN); 210 - } 211 - } else { 212 - pci_write_config_byte(dev, drive_pci, 213 - test1|SYNC_ERRDY_EN); 214 - } 215 - } 216 - 217 - chipset_is_set: 218 - 219 - pci_read_config_byte(dev, (drive_pci), &AP); 220 - if (id->capability & 4) /* IORDY_EN */ 221 - pci_write_config_byte(dev, (drive_pci), AP|IORDY_EN); 222 - pci_read_config_byte(dev, (drive_pci), &AP); 223 - if (drive->media == ide_disk) /* PREFETCH_EN */ 224 - pci_write_config_byte(dev, (drive_pci), AP|PREFETCH_EN); 225 - 226 - speed = ide_max_dma_mode(drive); 227 - 228 - if (!(speed)) { 229 - /* restore original pci-config space */ 230 - pci_write_config_dword(dev, drive_pci, drive_conf); 231 - return 0; 232 - } 233 - 234 - (void) hwif->speedproc(drive, speed); 235 - return ide_dma_enable(drive); 236 - } 237 - 238 232 static int pdc202xx_config_drive_xfer_rate (ide_drive_t *drive) 239 233 { 240 234 drive->init_speed = 0; 241 235 242 - if (ide_use_dma(drive) && config_chipset_for_dma(drive)) 236 + if (ide_tune_dma(drive)) 243 237 return 0; 244 238 245 239 if (ide_use_fast_pio(drive))
+76 -83
drivers/ide/pci/sc1200.c
··· 1 1 /* 2 - * linux/drivers/ide/pci/sc1200.c Version 0.91 28-Jan-2003 2 + * linux/drivers/ide/pci/sc1200.c Version 0.94 Mar 10 2007 3 3 * 4 4 * Copyright (C) 2000-2002 Mark Lord <mlord@pobox.com> 5 + * Copyright (C) 2007 Bartlomiej Zolnierkiewicz 6 + * 5 7 * May be copied or modified under the terms of the GNU General Public License 6 8 * 7 9 * Development of this chipset driver was funded ··· 95 93 */ 96 94 //#define SC1200_BAD_PIO(timings) (((timings)&~0x80000000)==0x00009172) 97 95 98 - static int sc1200_autoselect_dma_mode (ide_drive_t *drive) 96 + static void sc1200_tunepio(ide_drive_t *drive, u8 pio) 99 97 { 100 - int udma_ok = 1, mode = 0; 101 - ide_hwif_t *hwif = HWIF(drive); 102 - int unit = drive->select.b.unit; 103 - ide_drive_t *mate = &hwif->drives[unit^1]; 104 - struct hd_driveid *id = drive->id; 98 + ide_hwif_t *hwif = drive->hwif; 99 + struct pci_dev *pdev = hwif->pci_dev; 100 + unsigned int basereg = hwif->channel ? 0x50 : 0x40, format = 0; 105 101 106 - /* 107 - * The SC1200 specifies that two drives sharing a cable cannot 108 - * mix UDMA/MDMA. It has to be one or the other, for the pair, 109 - * though different timings can still be chosen for each drive. 110 - * We could set the appropriate timing bits on the fly, 111 - * but that might be a bit confusing. So, for now we statically 112 - * handle this requirement by looking at our mate drive to see 113 - * what it is capable of, before choosing a mode for our own drive. 114 - */ 115 - if (mate->present) { 116 - struct hd_driveid *mateid = mate->id; 117 - if (mateid && (mateid->capability & 1) && !__ide_dma_bad_drive(mate)) { 118 - if ((mateid->field_valid & 4) && (mateid->dma_ultra & 7)) 119 - udma_ok = 1; 120 - else if ((mateid->field_valid & 2) && (mateid->dma_mword & 7)) 121 - udma_ok = 0; 122 - else 123 - udma_ok = 1; 124 - } 125 - } 126 - /* 127 - * Now see what the current drive is capable of, 128 - * selecting UDMA only if the mate said it was ok. 129 - */ 130 - if (id && (id->capability & 1) && hwif->autodma && !__ide_dma_bad_drive(drive)) { 131 - if (udma_ok && (id->field_valid & 4) && (id->dma_ultra & 7)) { 132 - if (id->dma_ultra & 4) 133 - mode = XFER_UDMA_2; 134 - else if (id->dma_ultra & 2) 135 - mode = XFER_UDMA_1; 136 - else if (id->dma_ultra & 1) 137 - mode = XFER_UDMA_0; 138 - } 139 - if (!mode && (id->field_valid & 2) && (id->dma_mword & 7)) { 140 - if (id->dma_mword & 4) 141 - mode = XFER_MW_DMA_2; 142 - else if (id->dma_mword & 2) 143 - mode = XFER_MW_DMA_1; 144 - else if (id->dma_mword & 1) 145 - mode = XFER_MW_DMA_0; 146 - } 147 - } 148 - return mode; 102 + pci_read_config_dword(pdev, basereg + 4, &format); 103 + format = (format >> 31) & 1; 104 + if (format) 105 + format += sc1200_get_pci_clock(); 106 + pci_write_config_dword(pdev, basereg + ((drive->dn & 1) << 3), 107 + sc1200_pio_timings[format][pio]); 149 108 } 150 109 151 110 /* 152 - * sc1200_config_dma2() handles selection/setting of DMA/UDMA modes 153 - * for both the chipset and drive. 111 + * The SC1200 specifies that two drives sharing a cable cannot mix 112 + * UDMA/MDMA. It has to be one or the other, for the pair, though 113 + * different timings can still be chosen for each drive. We could 114 + * set the appropriate timing bits on the fly, but that might be 115 + * a bit confusing. So, for now we statically handle this requirement 116 + * by looking at our mate drive to see what it is capable of, before 117 + * choosing a mode for our own drive. 154 118 */ 155 - static int sc1200_config_dma2 (ide_drive_t *drive, int mode) 119 + static u8 sc1200_udma_filter(ide_drive_t *drive) 120 + { 121 + ide_hwif_t *hwif = drive->hwif; 122 + ide_drive_t *mate = &hwif->drives[(drive->dn & 1) ^ 1]; 123 + struct hd_driveid *mateid = mate->id; 124 + u8 mask = hwif->ultra_mask; 125 + 126 + if (mate->present == 0) 127 + goto out; 128 + 129 + if ((mateid->capability & 1) && __ide_dma_bad_drive(mate) == 0) { 130 + if ((mateid->field_valid & 4) && (mateid->dma_ultra & 7)) 131 + goto out; 132 + if ((mateid->field_valid & 2) && (mateid->dma_mword & 7)) 133 + mask = 0; 134 + } 135 + out: 136 + return mask; 137 + } 138 + 139 + static int sc1200_tune_chipset(ide_drive_t *drive, u8 mode) 156 140 { 157 141 ide_hwif_t *hwif = HWIF(drive); 158 142 int unit = drive->select.b.unit; ··· 146 158 unsigned short pci_clock; 147 159 unsigned int basereg = hwif->channel ? 0x50 : 0x40; 148 160 149 - /* 150 - * Default to DMA-off in case we run into trouble here. 151 - */ 152 - hwif->dma_off_quietly(drive); /* turn off DMA while we fiddle */ 153 - outb(inb(hwif->dma_base+2)&~(unit?0x40:0x20), hwif->dma_base+2); /* clear DMA_capable bit */ 161 + mode = ide_rate_filter(drive, mode); 154 162 155 163 /* 156 164 * Tell the drive to switch to the new mode; abort on failure. 157 165 */ 158 - if (!mode || sc1200_set_xfer_mode(drive, mode)) { 166 + if (sc1200_set_xfer_mode(drive, mode)) { 159 167 printk("SC1200: set xfer mode failure\n"); 160 168 return 1; /* failure */ 169 + } 170 + 171 + switch (mode) { 172 + case XFER_PIO_4: 173 + case XFER_PIO_3: 174 + case XFER_PIO_2: 175 + case XFER_PIO_1: 176 + case XFER_PIO_0: 177 + sc1200_tunepio(drive, mode - XFER_PIO_0); 178 + return 0; 161 179 } 162 180 163 181 pci_clock = sc1200_get_pci_clock(); ··· 218 224 case PCI_CLK_66: timings = 0x00015151; break; 219 225 } 220 226 break; 221 - } 222 - 223 - if (timings == 0) { 224 - printk("%s: sc1200_config_dma: huh? mode=%02x clk=%x \n", drive->name, mode, pci_clock); 225 - return 1; /* failure */ 227 + default: 228 + BUG(); 229 + break; 226 230 } 227 231 228 232 if (unit == 0) { /* are we configuring drive0? */ ··· 231 239 pci_write_config_dword(hwif->pci_dev, basereg+12, timings); 232 240 } 233 241 234 - outb(inb(hwif->dma_base+2)|(unit?0x40:0x20), hwif->dma_base+2); /* set DMA_capable bit */ 235 - 236 242 return 0; /* success */ 237 243 } 238 244 ··· 240 250 */ 241 251 static int sc1200_config_dma (ide_drive_t *drive) 242 252 { 243 - return sc1200_config_dma2(drive, sc1200_autoselect_dma_mode(drive)); 253 + if (ide_tune_dma(drive)) 254 + return 0; 255 + 256 + return 1; 244 257 } 245 258 246 259 ··· 283 290 static void sc1200_tuneproc (ide_drive_t *drive, byte pio) /* mode=255 means "autotune" */ 284 291 { 285 292 ide_hwif_t *hwif = HWIF(drive); 286 - unsigned int format; 287 - static byte modes[5] = {XFER_PIO_0, XFER_PIO_1, XFER_PIO_2, XFER_PIO_3, XFER_PIO_4}; 288 293 int mode = -1; 289 294 295 + /* 296 + * bad abuse of ->tuneproc interface 297 + */ 290 298 switch (pio) { 291 299 case 200: mode = XFER_UDMA_0; break; 292 300 case 201: mode = XFER_UDMA_1; break; ··· 298 304 } 299 305 if (mode != -1) { 300 306 printk("SC1200: %s: changing (U)DMA mode\n", drive->name); 301 - (void)sc1200_config_dma2(drive, mode); 307 + hwif->dma_off_quietly(drive); 308 + if (sc1200_tune_chipset(drive, mode) == 0) 309 + hwif->dma_host_on(drive); 302 310 return; 303 311 } 304 312 305 313 pio = ide_get_best_pio_mode(drive, pio, 4, NULL); 306 314 printk("SC1200: %s: setting PIO mode%d\n", drive->name, pio); 307 - if (!sc1200_set_xfer_mode(drive, modes[pio])) { 308 - unsigned int basereg = hwif->channel ? 0x50 : 0x40; 309 - pci_read_config_dword (hwif->pci_dev, basereg+4, &format); 310 - format = (format >> 31) & 1; 311 - if (format) 312 - format += sc1200_get_pci_clock(); 313 - pci_write_config_dword(hwif->pci_dev, basereg + (drive->select.b.unit << 3), sc1200_pio_timings[format][pio]); 314 - } 315 + 316 + if (sc1200_set_xfer_mode(drive, XFER_PIO_0 + pio) == 0) 317 + sc1200_tunepio(drive, pio); 315 318 } 316 319 317 320 #ifdef CONFIG_PM ··· 429 438 for (d = 0; d < MAX_DRIVES; ++d) { 430 439 ide_drive_t *drive = &(hwif->drives[d]); 431 440 if (drive->present && !__ide_dma_bad_drive(drive)) { 432 - int was_using_dma = drive->using_dma; 441 + int enable_dma = drive->using_dma; 433 442 hwif->dma_off_quietly(drive); 434 - sc1200_config_dma(drive); 435 - if (!was_using_dma && drive->using_dma) { 436 - hwif->dma_off_quietly(drive); 437 - } 443 + if (sc1200_config_dma(drive)) 444 + enable_dma = 0; 445 + if (enable_dma) 446 + hwif->dma_host_on(drive); 438 447 } 439 448 } 440 449 } ··· 452 461 hwif->serialized = hwif->mate->serialized = 1; 453 462 hwif->autodma = 0; 454 463 if (hwif->dma_base) { 464 + hwif->udma_filter = sc1200_udma_filter; 455 465 hwif->ide_dma_check = &sc1200_config_dma; 456 466 hwif->ide_dma_end = &sc1200_ide_dma_end; 457 467 if (!noautodma) 458 468 hwif->autodma = 1; 459 469 hwif->tuneproc = &sc1200_tuneproc; 470 + hwif->speedproc = &sc1200_tune_chipset; 460 471 } 461 472 hwif->atapi_dma = 1; 462 473 hwif->ultra_mask = 0x07;
+1 -21
drivers/ide/pci/scc_pata.c
··· 322 322 } 323 323 324 324 /** 325 - * scc_config_chipset_for_dma - configure for DMA 326 - * @drive: drive to configure 327 - * 328 - * Called by scc_config_drive_for_dma(). 329 - */ 330 - 331 - static int scc_config_chipset_for_dma(ide_drive_t *drive) 332 - { 333 - u8 speed = ide_max_dma_mode(drive); 334 - 335 - if (!speed) 336 - return 0; 337 - 338 - if (scc_tune_chipset(drive, speed)) 339 - return 0; 340 - 341 - return ide_dma_enable(drive); 342 - } 343 - 344 - /** 345 325 * scc_configure_drive_for_dma - set up for DMA transfers 346 326 * @drive: drive we are going to set up 347 327 * ··· 334 354 335 355 static int scc_config_drive_for_dma(ide_drive_t *drive) 336 356 { 337 - if (ide_use_dma(drive) && scc_config_chipset_for_dma(drive)) 357 + if (ide_tune_dma(drive)) 338 358 return 0; 339 359 340 360 if (ide_use_fast_pio(drive))
+14 -63
drivers/ide/pci/serverworks.c
··· 1 1 /* 2 - * linux/drivers/ide/pci/serverworks.c Version 0.8 25 Ebr 2003 2 + * linux/drivers/ide/pci/serverworks.c Version 0.9 Mar 4 2007 3 3 * 4 4 * Copyright (C) 1998-2000 Michel Aubry 5 5 * Copyright (C) 1998-2000 Andrzej Krzysztofowicz 6 6 * Copyright (C) 1998-2000 Andre Hedrick <andre@linux-ide.org> 7 + * Copyright (C) 2007 Bartlomiej Zolnierkiewicz 7 8 * Portions copyright (c) 2001 Sun Microsystems 8 9 * 9 10 * ··· 137 136 138 137 ide_hwif_t *hwif = HWIF(drive); 139 138 struct pci_dev *dev = hwif->pci_dev; 140 - u8 speed; 141 - u8 pio = ide_get_best_pio_mode(drive, 255, 5, NULL); 139 + u8 speed = ide_rate_filter(drive, xferspeed); 140 + u8 pio = ide_get_best_pio_mode(drive, 255, 4, NULL); 142 141 u8 unit = (drive->select.b.unit & 0x01); 143 142 u8 csb5 = svwks_csb_check(dev); 144 143 u8 ultra_enable = 0, ultra_timing = 0; 145 144 u8 dma_timing = 0, pio_timing = 0; 146 145 u16 csb5_pio = 0; 147 - 148 - if (xferspeed == 255) /* PIO auto-tuning */ 149 - speed = XFER_PIO_0 + pio; 150 - else 151 - speed = ide_rate_filter(drive, xferspeed); 152 146 153 147 /* If we are about to put a disk into UDMA mode we screwed up. 154 148 Our code assumes we never _ever_ do this on an OSB4 */ ··· 227 231 case XFER_MW_DMA_2: 228 232 case XFER_MW_DMA_1: 229 233 case XFER_MW_DMA_0: 234 + /* 235 + * TODO: always setup PIO mode so this won't be needed 236 + */ 230 237 pio_timing |= pio_modes[pio]; 231 238 csb5_pio |= (pio << (4*drive->dn)); 232 239 dma_timing |= dma_modes[speed - XFER_MW_DMA_0]; ··· 241 242 case XFER_UDMA_2: 242 243 case XFER_UDMA_1: 243 244 case XFER_UDMA_0: 245 + /* 246 + * TODO: always setup PIO mode so this won't be needed 247 + */ 244 248 pio_timing |= pio_modes[pio]; 245 249 csb5_pio |= (pio << (4*drive->dn)); 246 250 dma_timing |= dma_modes[2]; ··· 264 262 return (ide_config_drive_speed(drive, speed)); 265 263 } 266 264 267 - static void config_chipset_for_pio (ide_drive_t *drive) 268 - { 269 - u16 eide_pio_timing[6] = {960, 480, 240, 180, 120, 90}; 270 - u16 xfer_pio = drive->id->eide_pio_modes; 271 - u8 timing, speed, pio; 272 - 273 - pio = ide_get_best_pio_mode(drive, 255, 5, NULL); 274 - 275 - if (xfer_pio > 4) 276 - xfer_pio = 0; 277 - 278 - if (drive->id->eide_pio_iordy > 0) 279 - for (xfer_pio = 5; 280 - xfer_pio>0 && 281 - drive->id->eide_pio_iordy>eide_pio_timing[xfer_pio]; 282 - xfer_pio--); 283 - else 284 - xfer_pio = (drive->id->eide_pio_modes & 4) ? 0x05 : 285 - (drive->id->eide_pio_modes & 2) ? 0x04 : 286 - (drive->id->eide_pio_modes & 1) ? 0x03 : 287 - (drive->id->tPIO & 2) ? 0x02 : 288 - (drive->id->tPIO & 1) ? 0x01 : xfer_pio; 289 - 290 - timing = (xfer_pio >= pio) ? xfer_pio : pio; 291 - 292 - switch(timing) { 293 - case 4: speed = XFER_PIO_4;break; 294 - case 3: speed = XFER_PIO_3;break; 295 - case 2: speed = XFER_PIO_2;break; 296 - case 1: speed = XFER_PIO_1;break; 297 - default: 298 - speed = (!drive->id->tPIO) ? XFER_PIO_0 : XFER_PIO_SLOW; 299 - break; 300 - } 301 - (void) svwks_tune_chipset(drive, speed); 302 - drive->current_speed = speed; 303 - } 304 - 305 265 static void svwks_tune_drive (ide_drive_t *drive, u8 pio) 306 266 { 307 - if(pio == 255) 308 - (void) svwks_tune_chipset(drive, 255); 309 - else 310 - (void) svwks_tune_chipset(drive, (XFER_PIO_0 + pio)); 311 - } 312 - 313 - static int config_chipset_for_dma (ide_drive_t *drive) 314 - { 315 - u8 speed = ide_max_dma_mode(drive); 316 - 317 - if (!(speed)) 318 - speed = XFER_PIO_0 + ide_get_best_pio_mode(drive, 255, 5, NULL); 319 - 320 - (void) svwks_tune_chipset(drive, speed); 321 - return ide_dma_enable(drive); 267 + pio = ide_get_best_pio_mode(drive, pio, 4, NULL); 268 + (void)svwks_tune_chipset(drive, XFER_PIO_0 + pio); 322 269 } 323 270 324 271 static int svwks_config_drive_xfer_rate (ide_drive_t *drive) 325 272 { 326 273 drive->init_speed = 0; 327 274 328 - if (ide_use_dma(drive) && config_chipset_for_dma(drive)) 275 + if (ide_tune_dma(drive)) 329 276 return 0; 330 277 331 278 if (ide_use_fast_pio(drive)) 332 - config_chipset_for_pio(drive); 279 + svwks_tune_drive(drive, 255); 333 280 334 281 return -1; 335 282 }
+1 -23
drivers/ide/pci/siimage.c
··· 375 375 } 376 376 377 377 /** 378 - * config_chipset_for_dma - configure for DMA 379 - * @drive: drive to configure 380 - * 381 - * Called by the IDE layer when it wants the timings set up. 382 - * For the CMD680 we also need to set up the PIO timings and 383 - * enable DMA. 384 - */ 385 - 386 - static int config_chipset_for_dma (ide_drive_t *drive) 387 - { 388 - u8 speed = ide_max_dma_mode(drive); 389 - 390 - if (!speed) 391 - return 0; 392 - 393 - if (siimage_tune_chipset(drive, speed)) 394 - return 0; 395 - 396 - return ide_dma_enable(drive); 397 - } 398 - 399 - /** 400 378 * siimage_configure_drive_for_dma - set up for DMA transfers 401 379 * @drive: drive we are going to set up 402 380 * ··· 386 408 387 409 static int siimage_config_drive_for_dma (ide_drive_t *drive) 388 410 { 389 - if (ide_use_dma(drive) && config_chipset_for_dma(drive)) 411 + if (ide_tune_dma(drive)) 390 412 return 0; 391 413 392 414 if (ide_use_fast_pio(drive))
+36 -49
drivers/ide/pci/sis5513.c
··· 1 1 /* 2 - * linux/drivers/ide/pci/sis5513.c Version 0.16ac+vp Jun 18, 2003 2 + * linux/drivers/ide/pci/sis5513.c Version 0.20 Mar 4, 2007 3 3 * 4 4 * Copyright (C) 1999-2000 Andre Hedrick <andre@linux-ide.org> 5 5 * Copyright (C) 2002 Lionel Bouton <Lionel.Bouton@inet6.fr>, Maintainer 6 6 * Copyright (C) 2003 Vojtech Pavlik <vojtech@suse.cz> 7 + * Copyright (C) 2007 Bartlomiej Zolnierkiewicz 8 + * 7 9 * May be copied or modified under the terms of the GNU General Public License 8 10 * 9 11 * ··· 450 448 pci_write_config_byte(dev, 0x4b, reg4bh|rw_prefetch); 451 449 } 452 450 453 - 454 451 /* Set per-drive active and recovery time */ 455 452 static void config_art_rwp_pio (ide_drive_t *drive, u8 pio) 456 453 { 457 454 ide_hwif_t *hwif = HWIF(drive); 458 455 struct pci_dev *dev = hwif->pci_dev; 459 456 460 - u8 timing, drive_pci, test1, test2; 461 - 462 - u16 eide_pio_timing[6] = {600, 390, 240, 180, 120, 90}; 463 - u16 xfer_pio = drive->id->eide_pio_modes; 457 + u8 drive_pci, test1, test2; 464 458 465 459 config_drive_art_rwp(drive); 466 - pio = ide_get_best_pio_mode(drive, 255, pio, NULL); 467 - 468 - if (xfer_pio> 4) 469 - xfer_pio = 0; 470 - 471 - if (drive->id->eide_pio_iordy > 0) { 472 - for (xfer_pio = 5; 473 - (xfer_pio > 0) && 474 - (drive->id->eide_pio_iordy > eide_pio_timing[xfer_pio]); 475 - xfer_pio--); 476 - } else { 477 - xfer_pio = (drive->id->eide_pio_modes & 4) ? 0x05 : 478 - (drive->id->eide_pio_modes & 2) ? 0x04 : 479 - (drive->id->eide_pio_modes & 1) ? 0x03 : xfer_pio; 480 - } 481 - 482 - timing = (xfer_pio >= pio) ? xfer_pio : pio; 483 460 484 461 /* In pre ATA_133 case, drives sit at 0x40 + 4*drive->dn */ 485 462 drive_pci = 0x40; ··· 481 500 test1 &= ~0x0F; 482 501 test2 &= ~0x07; 483 502 484 - switch(timing) { 503 + switch(pio) { 485 504 case 4: test1 |= 0x01; test2 |= 0x03; break; 486 505 case 3: test1 |= 0x03; test2 |= 0x03; break; 487 506 case 2: test1 |= 0x04; test2 |= 0x04; break; 488 507 case 1: test1 |= 0x07; test2 |= 0x06; break; 508 + case 0: /* PIO0: register setting == X000 */ 489 509 default: break; 490 510 } 491 511 pci_write_config_byte(dev, drive_pci, test1); 492 512 pci_write_config_byte(dev, drive_pci+1, test2); 493 513 } else if (chipset_family < ATA_133) { 494 - switch(timing) { /* active recovery 514 + switch(pio) { /* active recovery 495 515 v v */ 496 516 case 4: test1 = 0x30|0x01; break; 497 517 case 3: test1 = 0x30|0x03; break; ··· 507 525 pci_read_config_dword(dev, drive_pci, &test3); 508 526 test3 &= 0xc0c00fff; 509 527 if (test3 & 0x08) { 510 - test3 |= (unsigned long)ini_time_value[ATA_133][timing] << 12; 511 - test3 |= (unsigned long)act_time_value[ATA_133][timing] << 16; 512 - test3 |= (unsigned long)rco_time_value[ATA_133][timing] << 24; 528 + test3 |= ini_time_value[ATA_133][pio] << 12; 529 + test3 |= act_time_value[ATA_133][pio] << 16; 530 + test3 |= rco_time_value[ATA_133][pio] << 24; 513 531 } else { 514 - test3 |= (unsigned long)ini_time_value[ATA_100][timing] << 12; 515 - test3 |= (unsigned long)act_time_value[ATA_100][timing] << 16; 516 - test3 |= (unsigned long)rco_time_value[ATA_100][timing] << 24; 532 + test3 |= ini_time_value[ATA_100][pio] << 12; 533 + test3 |= act_time_value[ATA_100][pio] << 16; 534 + test3 |= rco_time_value[ATA_100][pio] << 24; 517 535 } 518 536 pci_write_config_dword(dev, drive_pci, test3); 519 537 } 520 538 } 521 539 522 - static int config_chipset_for_pio (ide_drive_t *drive, u8 pio) 540 + static int sis5513_tune_drive(ide_drive_t *drive, u8 pio) 523 541 { 524 - if (pio == 255) 525 - pio = ide_find_best_mode(drive, XFER_PIO | XFER_EPIO) - XFER_PIO_0; 542 + pio = ide_get_best_pio_mode(drive, pio, 4, NULL); 526 543 config_art_rwp_pio(drive, pio); 527 - return ide_config_drive_speed(drive, XFER_PIO_0 + min_t(u8, pio, 4)); 544 + return ide_config_drive_speed(drive, XFER_PIO_0 + pio); 545 + } 546 + 547 + static void sis5513_tuneproc(ide_drive_t *drive, u8 pio) 548 + { 549 + (void)sis5513_tune_drive(drive, pio); 528 550 } 529 551 530 552 static int sis5513_tune_chipset (ide_drive_t *drive, u8 xferspeed) ··· 608 622 case XFER_SW_DMA_1: 609 623 case XFER_SW_DMA_0: 610 624 break; 611 - case XFER_PIO_4: return((int) config_chipset_for_pio(drive, 4)); 612 - case XFER_PIO_3: return((int) config_chipset_for_pio(drive, 3)); 613 - case XFER_PIO_2: return((int) config_chipset_for_pio(drive, 2)); 614 - case XFER_PIO_1: return((int) config_chipset_for_pio(drive, 1)); 625 + case XFER_PIO_4: 626 + case XFER_PIO_3: 627 + case XFER_PIO_2: 628 + case XFER_PIO_1: 615 629 case XFER_PIO_0: 616 - default: return((int) config_chipset_for_pio(drive, 0)); 630 + return sis5513_tune_drive(drive, speed - XFER_PIO_0); 631 + default: 632 + BUG(); 633 + break; 617 634 } 618 635 619 - return ((int) ide_config_drive_speed(drive, speed)); 620 - } 621 - 622 - static void sis5513_tune_drive (ide_drive_t *drive, u8 pio) 623 - { 624 - (void) config_chipset_for_pio(drive, pio); 636 + return ide_config_drive_speed(drive, speed); 625 637 } 626 638 627 639 static int sis5513_config_xfer_rate(ide_drive_t *drive) 628 640 { 629 - config_art_rwp_pio(drive, 5); 641 + /* 642 + * TODO: always set PIO mode and remove this 643 + */ 644 + sis5513_tuneproc(drive, 255); 630 645 631 646 drive->init_speed = 0; 632 647 ··· 635 648 return 0; 636 649 637 650 if (ide_use_fast_pio(drive)) 638 - sis5513_tune_drive(drive, 5); 651 + sis5513_tuneproc(drive, 255); 639 652 640 653 return -1; 641 654 } ··· 823 836 if (!hwif->irq) 824 837 hwif->irq = hwif->channel ? 15 : 14; 825 838 826 - hwif->tuneproc = &sis5513_tune_drive; 839 + hwif->tuneproc = &sis5513_tuneproc; 827 840 hwif->speedproc = &sis5513_tune_chipset; 828 841 829 842 if (!(hwif->dma_base)) {
+62 -14
drivers/ide/pci/sl82c105.c
··· 82 82 83 83 pio = ide_get_best_pio_mode(drive, pio, 5, &p); 84 84 85 - drive->drive_data = drv_ctrl = get_pio_timings(&p); 85 + drv_ctrl = get_pio_timings(&p); 86 + 87 + /* 88 + * Store the PIO timings so that we can restore them 89 + * in case DMA will be turned off... 90 + */ 91 + drive->drive_data &= 0xffff0000; 92 + drive->drive_data |= drv_ctrl; 86 93 87 94 if (!drive->using_dma) { 88 95 /* ··· 107 100 } 108 101 109 102 /* 110 - * Configure the drive for DMA. 111 - * We'll program the chipset only when DMA is actually turned on. 103 + * Configure the drive and chipset for a new transfer speed. 112 104 */ 113 - static int config_for_dma(ide_drive_t *drive) 105 + static int sl82c105_tune_chipset(ide_drive_t *drive, u8 speed) 114 106 { 115 - DBG(("config_for_dma(drive:%s)\n", drive->name)); 107 + static u16 mwdma_timings[] = {0x0707, 0x0201, 0x0200}; 108 + u16 drv_ctrl; 116 109 117 - if (ide_config_drive_speed(drive, XFER_MW_DMA_2) != 0) 118 - return 0; 110 + DBG(("sl82c105_tune_chipset(drive:%s, speed:%s)\n", 111 + drive->name, ide_xfer_verbose(speed))); 119 112 120 - return ide_dma_enable(drive); 113 + speed = ide_rate_filter(drive, speed); 114 + 115 + switch (speed) { 116 + case XFER_MW_DMA_2: 117 + case XFER_MW_DMA_1: 118 + case XFER_MW_DMA_0: 119 + drv_ctrl = mwdma_timings[speed - XFER_MW_DMA_0]; 120 + 121 + /* 122 + * Store the DMA timings so that we can actually program 123 + * them when DMA will be turned on... 124 + */ 125 + drive->drive_data &= 0x0000ffff; 126 + drive->drive_data |= (unsigned long)drv_ctrl << 16; 127 + 128 + /* 129 + * If we are already using DMA, we just reprogram 130 + * the drive control register. 131 + */ 132 + if (drive->using_dma) { 133 + struct pci_dev *dev = HWIF(drive)->pci_dev; 134 + int reg = 0x44 + drive->dn * 4; 135 + 136 + pci_write_config_word(dev, reg, drv_ctrl); 137 + } 138 + break; 139 + case XFER_PIO_5: 140 + case XFER_PIO_4: 141 + case XFER_PIO_3: 142 + case XFER_PIO_2: 143 + case XFER_PIO_1: 144 + case XFER_PIO_0: 145 + (void) sl82c105_tune_pio(drive, speed - XFER_PIO_0); 146 + break; 147 + default: 148 + return -1; 149 + } 150 + 151 + return ide_config_drive_speed(drive, speed); 121 152 } 122 153 123 154 /* ··· 165 120 { 166 121 DBG(("sl82c105_ide_dma_check(drive:%s)\n", drive->name)); 167 122 168 - if (ide_use_dma(drive) && config_for_dma(drive)) 123 + if (ide_tune_dma(drive)) 169 124 return 0; 170 125 171 126 return -1; ··· 264 219 265 220 rc = __ide_dma_on(drive); 266 221 if (rc == 0) { 267 - pci_write_config_word(dev, reg, 0x0200); 222 + pci_write_config_word(dev, reg, drive->drive_data >> 16); 268 223 269 224 printk(KERN_INFO "%s: DMA enabled\n", drive->name); 270 225 } ··· 349 304 /* 350 305 * The bridge should be part of the same device, but function 0. 351 306 */ 352 - bridge = pci_find_slot(dev->bus->number, 307 + bridge = pci_get_bus_and_slot(dev->bus->number, 353 308 PCI_DEVFN(PCI_SLOT(dev->devfn), 0)); 354 309 if (!bridge) 355 310 return -1; ··· 359 314 */ 360 315 if (bridge->vendor != PCI_VENDOR_ID_WINBOND || 361 316 bridge->device != PCI_DEVICE_ID_WINBOND_83C553 || 362 - bridge->class >> 8 != PCI_CLASS_BRIDGE_ISA) 317 + bridge->class >> 8 != PCI_CLASS_BRIDGE_ISA) { 318 + pci_dev_put(bridge); 363 319 return -1; 364 - 320 + } 365 321 /* 366 322 * We need to find function 0's revision, not function 1 367 323 */ 368 324 pci_read_config_byte(bridge, PCI_REVISION_ID, &rev); 325 + pci_dev_put(bridge); 369 326 370 327 return rev; 371 328 } ··· 404 357 DBG(("init_hwif_sl82c105(hwif: ide%d)\n", hwif->index)); 405 358 406 359 hwif->tuneproc = &sl82c105_tune_drive; 360 + hwif->speedproc = &sl82c105_tune_chipset; 407 361 hwif->selectproc = &sl82c105_selectproc; 408 362 hwif->resetproc = &sl82c105_resetproc; 409 363 ··· 436 388 } 437 389 438 390 hwif->atapi_dma = 1; 439 - hwif->mwdma_mask = 0x04; 391 + hwif->mwdma_mask = 0x07; 440 392 441 393 hwif->ide_dma_check = &sl82c105_ide_dma_check; 442 394 hwif->ide_dma_on = &sl82c105_ide_dma_on;
+1
drivers/input/joystick/Kconfig
··· 255 255 256 256 config JOYSTICK_XPAD 257 257 tristate "X-Box gamepad support" 258 + depends on USB_ARCH_HAS_HCD 258 259 select USB 259 260 help 260 261 Say Y here if you want to use the X-Box pad with your computer.
+5
drivers/input/misc/Kconfig
··· 84 84 85 85 config INPUT_ATI_REMOTE 86 86 tristate "ATI / X10 USB RF remote control" 87 + depends on USB_ARCH_HAS_HCD 87 88 select USB 88 89 help 89 90 Say Y here if you want to use an ATI or X10 "Lola" USB remote control. ··· 100 99 101 100 config INPUT_ATI_REMOTE2 102 101 tristate "ATI / Philips USB RF remote control" 102 + depends on USB_ARCH_HAS_HCD 103 103 select USB 104 104 help 105 105 Say Y here if you want to use an ATI or Philips USB RF remote control. ··· 116 114 config INPUT_KEYSPAN_REMOTE 117 115 tristate "Keyspan DMR USB remote control (EXPERIMENTAL)" 118 116 depends on EXPERIMENTAL 117 + depends on USB_ARCH_HAS_HCD 119 118 select USB 120 119 help 121 120 Say Y here if you want to use a Keyspan DMR USB remote control. ··· 131 128 132 129 config INPUT_POWERMATE 133 130 tristate "Griffin PowerMate and Contour Jog support" 131 + depends on USB_ARCH_HAS_HCD 134 132 select USB 135 133 help 136 134 Say Y here if you want to use Griffin PowerMate or Contour Jog devices. ··· 148 144 config INPUT_YEALINK 149 145 tristate "Yealink usb-p1k voip phone" 150 146 depends EXPERIMENTAL 147 + depends on USB_ARCH_HAS_HCD 151 148 select USB 152 149 help 153 150 Say Y here if you want to enable keyboard and LCD functions of the
+1
drivers/input/mouse/Kconfig
··· 111 111 112 112 config MOUSE_APPLETOUCH 113 113 tristate "Apple USB Touchpad support" 114 + depends on USB_ARCH_HAS_HCD 114 115 select USB 115 116 help 116 117 Say Y here if you want to use an Apple USB Touchpad.
+4
drivers/input/tablet/Kconfig
··· 13 13 14 14 config TABLET_USB_ACECAD 15 15 tristate "Acecad Flair tablet support (USB)" 16 + depends on USB_ARCH_HAS_HCD 16 17 select USB 17 18 help 18 19 Say Y here if you want to use the USB version of the Acecad Flair ··· 26 25 27 26 config TABLET_USB_AIPTEK 28 27 tristate "Aiptek 6000U/8000U tablet support (USB)" 28 + depends on USB_ARCH_HAS_HCD 29 29 select USB 30 30 help 31 31 Say Y here if you want to use the USB version of the Aiptek 6000U ··· 51 49 52 50 config TABLET_USB_KBTAB 53 51 tristate "KB Gear JamStudio tablet support (USB)" 52 + depends on USB_ARCH_HAS_HCD 54 53 select USB 55 54 help 56 55 Say Y here if you want to use the USB version of the KB Gear ··· 64 61 65 62 config TABLET_USB_WACOM 66 63 tristate "Wacom Intuos/Graphire tablet support (USB)" 64 + depends on USB_ARCH_HAS_HCD 67 65 select USB 68 66 help 69 67 Say Y here if you want to use the USB version of the Wacom Intuos
+1
drivers/input/touchscreen/Kconfig
··· 166 166 167 167 config TOUCHSCREEN_USB_COMPOSITE 168 168 tristate "USB Touchscreen Driver" 169 + depends on USB_ARCH_HAS_HCD 169 170 select USB 170 171 help 171 172 USB Touchscreen driver for:
+1 -1
drivers/media/video/em28xx/Kconfig
··· 1 1 config VIDEO_EM28XX 2 2 tristate "Empia EM2800/2820/2840 USB video capture support" 3 - depends on VIDEO_V4L1 && I2C 3 + depends on VIDEO_V4L1 && I2C && PCI 4 4 select VIDEO_BUF 5 5 select VIDEO_TUNER 6 6 select VIDEO_TVEEPROM
+1 -1
drivers/media/video/ivtv/Kconfig
··· 1 1 config VIDEO_IVTV 2 2 tristate "Conexant cx23416/cx23415 MPEG encoder/decoder support" 3 - depends on VIDEO_V4L1 && VIDEO_V4L2 && USB && I2C && EXPERIMENTAL 3 + depends on VIDEO_V4L1 && VIDEO_V4L2 && USB && I2C && EXPERIMENTAL && PCI 4 4 select FW_LOADER 5 5 select VIDEO_TUNER 6 6 select VIDEO_TVEEPROM
+1
drivers/net/mlx4/alloc.c
··· 33 33 #include <linux/errno.h> 34 34 #include <linux/slab.h> 35 35 #include <linux/bitmap.h> 36 + #include <linux/dma-mapping.h> 36 37 37 38 #include "mlx4.h" 38 39
+1
drivers/net/mlx4/eq.c
··· 33 33 34 34 #include <linux/init.h> 35 35 #include <linux/interrupt.h> 36 + #include <linux/dma-mapping.h> 36 37 37 38 #include <linux/mlx4/cmd.h> 38 39
+1
drivers/net/mlx4/icm.c
··· 33 33 34 34 #include <linux/init.h> 35 35 #include <linux/errno.h> 36 + #include <linux/mm.h> 36 37 37 38 #include <linux/mlx4/cmd.h> 38 39
+1
drivers/net/mlx4/reset.c
··· 35 35 #include <linux/pci.h> 36 36 #include <linux/delay.h> 37 37 #include <linux/slab.h> 38 + #include <linux/jiffies.h> 38 39 39 40 #include "mlx4.h" 40 41
+28 -17
drivers/net/pasemi_mac.c
··· 85 85 { 86 86 struct pci_dev *pdev = mac->pdev; 87 87 struct device_node *dn = pci_device_to_OF_node(pdev); 88 + int len; 88 89 const u8 *maddr; 89 90 u8 addr[6]; 90 91 ··· 95 94 return -ENOENT; 96 95 } 97 96 98 - maddr = of_get_property(dn, "local-mac-address", NULL); 97 + maddr = of_get_property(dn, "local-mac-address", &len); 99 98 100 - /* Fall back to mac-address for older firmware */ 99 + if (maddr && len == 6) { 100 + memcpy(mac->mac_addr, maddr, 6); 101 + return 0; 102 + } 103 + 104 + /* Some old versions of firmware mistakenly uses mac-address 105 + * (and as a string) instead of a byte array in local-mac-address. 106 + */ 107 + 101 108 if (maddr == NULL) 102 109 maddr = of_get_property(dn, "mac-address", NULL); 103 110 ··· 115 106 return -ENOENT; 116 107 } 117 108 109 + 118 110 if (sscanf(maddr, "%hhx:%hhx:%hhx:%hhx:%hhx:%hhx", &addr[0], 119 111 &addr[1], &addr[2], &addr[3], &addr[4], &addr[5]) != 6) { 120 112 dev_warn(&pdev->dev, ··· 123 113 return -EINVAL; 124 114 } 125 115 126 - memcpy(mac->mac_addr, addr, sizeof(addr)); 116 + memcpy(mac->mac_addr, addr, 6); 117 + 127 118 return 0; 128 119 } 129 120 ··· 395 384 396 385 static void pasemi_mac_restart_rx_intr(struct pasemi_mac *mac) 397 386 { 398 - unsigned int reg, stat; 387 + unsigned int reg, pcnt; 399 388 /* Re-enable packet count interrupts: finally 400 389 * ack the packet count interrupt we got in rx_intr. 401 390 */ 402 391 403 - pci_read_config_dword(mac->iob_pdev, 404 - PAS_IOB_DMA_RXCH_STAT(mac->dma_rxch), 405 - &stat); 392 + pcnt = *mac->rx_status & PAS_STATUS_PCNT_M; 406 393 407 - reg = PAS_IOB_DMA_RXCH_RESET_PCNT(stat & PAS_IOB_DMA_RXCH_STAT_CNTDEL_M) 408 - | PAS_IOB_DMA_RXCH_RESET_PINTC; 394 + reg = PAS_IOB_DMA_RXCH_RESET_PCNT(pcnt) | PAS_IOB_DMA_RXCH_RESET_PINTC; 409 395 410 396 pci_write_config_dword(mac->iob_pdev, 411 397 PAS_IOB_DMA_RXCH_RESET(mac->dma_rxch), ··· 411 403 412 404 static void pasemi_mac_restart_tx_intr(struct pasemi_mac *mac) 413 405 { 414 - unsigned int reg, stat; 406 + unsigned int reg, pcnt; 415 407 416 408 /* Re-enable packet count interrupts */ 417 - pci_read_config_dword(mac->iob_pdev, 418 - PAS_IOB_DMA_TXCH_STAT(mac->dma_txch), &stat); 409 + pcnt = *mac->tx_status & PAS_STATUS_PCNT_M; 419 410 420 - reg = PAS_IOB_DMA_TXCH_RESET_PCNT(stat & PAS_IOB_DMA_TXCH_STAT_CNTDEL_M) 421 - | PAS_IOB_DMA_TXCH_RESET_PINTC; 411 + reg = PAS_IOB_DMA_TXCH_RESET_PCNT(pcnt) | PAS_IOB_DMA_TXCH_RESET_PINTC; 422 412 423 413 pci_write_config_dword(mac->iob_pdev, 424 414 PAS_IOB_DMA_TXCH_RESET(mac->dma_txch), reg); ··· 597 591 { 598 592 struct net_device *dev = data; 599 593 struct pasemi_mac *mac = netdev_priv(dev); 600 - unsigned int reg; 594 + unsigned int reg, pcnt; 601 595 602 596 if (!(*mac->tx_status & PAS_STATUS_CAUSE_M)) 603 597 return IRQ_NONE; 604 598 605 599 pasemi_mac_clean_tx(mac); 606 600 607 - reg = PAS_IOB_DMA_TXCH_RESET_PINTC; 601 + pcnt = *mac->tx_status & PAS_STATUS_PCNT_M; 602 + 603 + reg = PAS_IOB_DMA_TXCH_RESET_PCNT(pcnt) | PAS_IOB_DMA_TXCH_RESET_PINTC; 608 604 609 605 if (*mac->tx_status & PAS_STATUS_SOFT) 610 606 reg |= PAS_IOB_DMA_TXCH_RESET_SINTC; 611 607 if (*mac->tx_status & PAS_STATUS_ERROR) 612 608 reg |= PAS_IOB_DMA_TXCH_RESET_DINTC; 613 609 614 - pci_write_config_dword(mac->iob_pdev, PAS_IOB_DMA_TXCH_RESET(mac->dma_txch), 610 + pci_write_config_dword(mac->iob_pdev, 611 + PAS_IOB_DMA_TXCH_RESET(mac->dma_txch), 615 612 reg); 616 613 617 614 return IRQ_HANDLED; ··· 983 974 if (txring->next_to_clean - txring->next_to_use == TX_RING_SIZE) { 984 975 spin_unlock_irqrestore(&txring->lock, flags); 985 976 pasemi_mac_clean_tx(mac); 977 + pasemi_mac_restart_tx_intr(mac); 986 978 spin_lock_irqsave(&txring->lock, flags); 987 979 988 980 if (txring->next_to_clean - txring->next_to_use == ··· 1220 1210 static struct pci_device_id pasemi_mac_pci_tbl[] = { 1221 1211 { PCI_DEVICE(PCI_VENDOR_ID_PASEMI, 0xa005) }, 1222 1212 { PCI_DEVICE(PCI_VENDOR_ID_PASEMI, 0xa006) }, 1213 + { }, 1223 1214 }; 1224 1215 1225 1216 MODULE_DEVICE_TABLE(pci, pasemi_mac_pci_tbl);
+2 -2
drivers/net/pasemi_mac.h
··· 341 341 PAS_IOB_DMA_TXCH_STAT_CNTDEL_M) 342 342 #define PAS_IOB_DMA_RXCH_RESET(i) (0x1500 + (i)*4) 343 343 #define PAS_IOB_DMA_RXCH_RESET_PCNT_M 0xffff0000 344 - #define PAS_IOB_DMA_RXCH_RESET_PCNT_S 0 344 + #define PAS_IOB_DMA_RXCH_RESET_PCNT_S 16 345 345 #define PAS_IOB_DMA_RXCH_RESET_PCNT(x) (((x) << PAS_IOB_DMA_RXCH_RESET_PCNT_S) & \ 346 346 PAS_IOB_DMA_RXCH_RESET_PCNT_M) 347 347 #define PAS_IOB_DMA_RXCH_RESET_PCNTRST 0x00000020 ··· 352 352 #define PAS_IOB_DMA_RXCH_RESET_PINTC 0x00000001 353 353 #define PAS_IOB_DMA_TXCH_RESET(i) (0x1600 + (i)*4) 354 354 #define PAS_IOB_DMA_TXCH_RESET_PCNT_M 0xffff0000 355 - #define PAS_IOB_DMA_TXCH_RESET_PCNT_S 0 355 + #define PAS_IOB_DMA_TXCH_RESET_PCNT_S 16 356 356 #define PAS_IOB_DMA_TXCH_RESET_PCNT(x) (((x) << PAS_IOB_DMA_TXCH_RESET_PCNT_S) & \ 357 357 PAS_IOB_DMA_TXCH_RESET_PCNT_M) 358 358 #define PAS_IOB_DMA_TXCH_RESET_PCNTRST 0x00000020
+2 -4
drivers/net/smc911x.c
··· 77 77 #include <linux/skbuff.h> 78 78 79 79 #include <asm/io.h> 80 - #include <asm/irq.h> 81 80 82 81 #include "smc911x.h" 83 82 ··· 2083 2084 lp->ctl_rspeed = 100; 2084 2085 2085 2086 /* Grab the IRQ */ 2086 - retval = request_irq(dev->irq, &smc911x_interrupt, IRQF_SHARED, dev->name, dev); 2087 + retval = request_irq(dev->irq, &smc911x_interrupt, 2088 + IRQF_SHARED | IRQF_TRIGGER_FALLING, dev->name, dev); 2087 2089 if (retval) 2088 2090 goto err_out; 2089 - 2090 - set_irq_type(dev->irq, IRQT_FALLING); 2091 2091 2092 2092 #ifdef SMC_USE_DMA 2093 2093 lp->rxdma = SMC_DMA_REQUEST(dev, smc911x_rx_dma_irq);
+16 -24
drivers/net/ucc_geth.c
··· 1 1 /* 2 - * Copyright (C) Freescale Semicondutor, Inc. 2006. All rights reserved. 2 + * Copyright (C) 2006-2007 Freescale Semicondutor, Inc. All rights reserved. 3 3 * 4 4 * Author: Shlomi Gridish <gridish@freescale.com> 5 5 * Li Yang <leoli@freescale.com> ··· 3737 3737 3738 3738 const struct ethtool_ops ucc_geth_ethtool_ops = { }; 3739 3739 3740 - static phy_interface_t to_phy_interface(const char *interface_type) 3740 + static phy_interface_t to_phy_interface(const char *phy_connection_type) 3741 3741 { 3742 - if (strcasecmp(interface_type, "mii") == 0) 3742 + if (strcasecmp(phy_connection_type, "mii") == 0) 3743 3743 return PHY_INTERFACE_MODE_MII; 3744 - if (strcasecmp(interface_type, "gmii") == 0) 3744 + if (strcasecmp(phy_connection_type, "gmii") == 0) 3745 3745 return PHY_INTERFACE_MODE_GMII; 3746 - if (strcasecmp(interface_type, "tbi") == 0) 3746 + if (strcasecmp(phy_connection_type, "tbi") == 0) 3747 3747 return PHY_INTERFACE_MODE_TBI; 3748 - if (strcasecmp(interface_type, "rmii") == 0) 3748 + if (strcasecmp(phy_connection_type, "rmii") == 0) 3749 3749 return PHY_INTERFACE_MODE_RMII; 3750 - if (strcasecmp(interface_type, "rgmii") == 0) 3750 + if (strcasecmp(phy_connection_type, "rgmii") == 0) 3751 3751 return PHY_INTERFACE_MODE_RGMII; 3752 - if (strcasecmp(interface_type, "rgmii-id") == 0) 3752 + if (strcasecmp(phy_connection_type, "rgmii-id") == 0) 3753 3753 return PHY_INTERFACE_MODE_RGMII_ID; 3754 - if (strcasecmp(interface_type, "rtbi") == 0) 3754 + if (strcasecmp(phy_connection_type, "rtbi") == 0) 3755 3755 return PHY_INTERFACE_MODE_RTBI; 3756 3756 3757 3757 return PHY_INTERFACE_MODE_MII; ··· 3819 3819 ug_info->phy_address = *prop; 3820 3820 3821 3821 /* get the phy interface type, or default to MII */ 3822 - prop = of_get_property(np, "interface-type", NULL); 3822 + prop = of_get_property(np, "phy-connection-type", NULL); 3823 3823 if (!prop) { 3824 3824 /* handle interface property present in old trees */ 3825 3825 prop = of_get_property(phy, "interface", NULL); 3826 - if (prop != NULL) 3826 + if (prop != NULL) { 3827 3827 phy_interface = enet_to_phy_interface[*prop]; 3828 - else 3828 + max_speed = enet_to_speed[*prop]; 3829 + } else 3829 3830 phy_interface = PHY_INTERFACE_MODE_MII; 3830 3831 } else { 3831 3832 phy_interface = to_phy_interface((const char *)prop); 3832 3833 } 3833 3834 3834 - /* get speed, or derive from interface */ 3835 - prop = of_get_property(np, "max-speed", NULL); 3836 - if (!prop) { 3837 - /* handle interface property present in old trees */ 3838 - prop = of_get_property(phy, "interface", NULL); 3839 - if (prop != NULL) 3840 - max_speed = enet_to_speed[*prop]; 3841 - } else { 3842 - max_speed = *prop; 3843 - } 3844 - if (!max_speed) { 3835 + /* get speed, or derive from PHY interface */ 3836 + if (max_speed == 0) 3845 3837 switch (phy_interface) { 3846 3838 case PHY_INTERFACE_MODE_GMII: 3847 3839 case PHY_INTERFACE_MODE_RGMII: ··· 3846 3854 max_speed = SPEED_100; 3847 3855 break; 3848 3856 } 3849 - } 3850 3857 3851 3858 if (max_speed == SPEED_1000) { 3859 + /* configure muram FIFOs for gigabit operation */ 3852 3860 ug_info->uf_info.urfs = UCC_GETH_URFS_GIGA_INIT; 3853 3861 ug_info->uf_info.urfet = UCC_GETH_URFET_GIGA_INIT; 3854 3862 ug_info->uf_info.urfset = UCC_GETH_URFSET_GIGA_INIT;
+5 -4
drivers/net/ucc_geth_mii.c
··· 1 1 /* 2 2 * drivers/net/ucc_geth_mii.c 3 3 * 4 - * Gianfar Ethernet Driver -- MIIM bus implementation 5 - * Provides Bus interface for MIIM regs 4 + * QE UCC Gigabit Ethernet Driver -- MII Management Bus Implementation 5 + * Provides Bus interface for MII Management regs in the UCC register space 6 6 * 7 - * Author: Li Yang 7 + * Copyright (C) 2007 Freescale Semiconductor, Inc. 8 8 * 9 - * Copyright (c) 2002-2004 Freescale Semiconductor, Inc. 9 + * Authors: Li Yang <leoli@freescale.com> 10 + * Kim Phillips <kim.phillips@freescale.com> 10 11 * 11 12 * This program is free software; you can redistribute it and/or modify it 12 13 * under the terms of the GNU General Public License as published by the
+5 -5
drivers/net/ucc_geth_mii.h
··· 1 1 /* 2 2 * drivers/net/ucc_geth_mii.h 3 3 * 4 - * Gianfar Ethernet Driver -- MII Management Bus Implementation 5 - * Driver for the MDIO bus controller in the Gianfar register space 4 + * QE UCC Gigabit Ethernet Driver -- MII Management Bus Implementation 5 + * Provides Bus interface for MII Management regs in the UCC register space 6 6 * 7 - * Author: Andy Fleming 8 - * Maintainer: Kumar Gala 7 + * Copyright (C) 2007 Freescale Semiconductor, Inc. 9 8 * 10 - * Copyright (c) 2002-2004 Freescale Semiconductor, Inc. 9 + * Authors: Li Yang <leoli@freescale.com> 10 + * Kim Phillips <kim.phillips@freescale.com> 11 11 * 12 12 * This program is free software; you can redistribute it and/or modify it 13 13 * under the terms of the GNU General Public License as published by the
+3 -2
drivers/pci/hotplug/rpadlpar_sysfs.c
··· 129 129 }; 130 130 131 131 struct kset dlpar_io_kset = { 132 - .subsys = &pci_hotplug_slots_subsys, 133 - .kobj = {.name = DLPAR_KOBJ_NAME, .ktype=&ktype_dlpar_io,}, 132 + .kobj = {.name = DLPAR_KOBJ_NAME, 133 + .ktype = &ktype_dlpar_io, 134 + .parent = &pci_hotplug_slots_subsys.kobj}, 134 135 .ktype = &ktype_dlpar_io, 135 136 }; 136 137
+2 -1
include/asm-m32r/system.h
··· 10 10 * Copyright (C) 2004, 2006 Hirokazu Takata <takata at linux-m32r.org> 11 11 */ 12 12 13 + #include <linux/compiler.h> 13 14 #include <asm/assembler.h> 14 15 15 16 #ifdef __KERNEL__ ··· 155 154 #define DCACHE_CLEAR(reg0, reg1, addr) 156 155 #endif /* CONFIG_CHIP_M32700_TS1 */ 157 156 158 - static inline unsigned long 157 + static __always_inline unsigned long 159 158 __xchg(unsigned long x, volatile void * ptr, int size) 160 159 { 161 160 unsigned long flags;
+9 -5
include/asm-sh64/dma-mapping.h
··· 35 35 consistent_free(NULL, size, vaddr, dma_handle); 36 36 } 37 37 38 + #define dma_alloc_noncoherent(d, s, h, f) dma_alloc_coherent(d, s, h, f) 39 + #define dma_free_noncoherent(d, s, v, h) dma_free_coherent(d, s, v, h) 40 + #define dma_is_consistent(d, h) (1) 41 + 38 42 static inline void dma_cache_sync(struct device *dev, void *vaddr, size_t size, 39 43 enum dma_data_direction dir) 40 44 { ··· 53 49 if (dev->bus == &pci_bus_type) 54 50 return virt_to_bus(ptr); 55 51 #endif 56 - dma_cache_sync(ptr, size, dir); 52 + dma_cache_sync(dev, ptr, size, dir); 57 53 58 54 return virt_to_bus(ptr); 59 55 } ··· 67 63 68 64 for (i = 0; i < nents; i++) { 69 65 #if !defined(CONFIG_PCI) || defined(CONFIG_SH_PCIDMA_NONCOHERENT) 70 - dma_cache_sync(page_address(sg[i].page) + sg[i].offset, 66 + dma_cache_sync(dev, page_address(sg[i].page) + sg[i].offset, 71 67 sg[i].length, dir); 72 68 #endif 73 69 sg[i].dma_address = page_to_phys(sg[i].page) + sg[i].offset; ··· 98 94 if (dev->bus == &pci_bus_type) 99 95 return; 100 96 #endif 101 - dma_cache_sync(bus_to_virt(dma_handle), size, dir); 97 + dma_cache_sync(dev, bus_to_virt(dma_handle), size, dir); 102 98 } 103 99 104 100 static inline void dma_sync_single_range(struct device *dev, ··· 110 106 if (dev->bus == &pci_bus_type) 111 107 return; 112 108 #endif 113 - dma_cache_sync(bus_to_virt(dma_handle) + offset, size, dir); 109 + dma_cache_sync(dev, bus_to_virt(dma_handle) + offset, size, dir); 114 110 } 115 111 116 112 static inline void dma_sync_sg(struct device *dev, struct scatterlist *sg, ··· 120 116 121 117 for (i = 0; i < nelems; i++) { 122 118 #if !defined(CONFIG_PCI) || defined(CONFIG_SH_PCIDMA_NONCOHERENT) 123 - dma_cache_sync(page_address(sg[i].page) + sg[i].offset, 119 + dma_cache_sync(dev, page_address(sg[i].page) + sg[i].offset, 124 120 sg[i].length, dir); 125 121 #endif 126 122 sg[i].dma_address = page_to_phys(sg[i].page) + sg[i].offset;
+1
include/asm-sh64/irq_regs.h
··· 1 + #include <asm-generic/irq_regs.h>
+23 -77
include/asm-sh64/pgalloc.h
··· 14 14 * 15 15 */ 16 16 17 - #include <linux/threads.h> 18 17 #include <linux/mm.h> 19 - 20 - #define pgd_quicklist (current_cpu_data.pgd_quick) 21 - #define pmd_quicklist (current_cpu_data.pmd_quick) 22 - #define pte_quicklist (current_cpu_data.pte_quick) 23 - #define pgtable_cache_size (current_cpu_data.pgtable_cache_sz) 18 + #include <linux/quicklist.h> 19 + #include <asm/page.h> 24 20 25 21 static inline void pgd_init(unsigned long page) 26 22 { ··· 41 45 return ret; 42 46 } 43 47 44 - static inline pgd_t *get_pgd_fast(void) 48 + static inline pgd_t *pgd_alloc(struct mm_struct *mm) 45 49 { 46 - unsigned long *ret; 47 - 48 - if ((ret = pgd_quicklist) != NULL) { 49 - pgd_quicklist = (unsigned long *)(*ret); 50 - ret[0] = 0; 51 - pgtable_cache_size--; 52 - } else 53 - ret = (unsigned long *)get_pgd_slow(); 54 - 55 - if (ret) { 56 - memset(ret, 0, USER_PTRS_PER_PGD * sizeof(pgd_t)); 57 - } 58 - return (pgd_t *)ret; 50 + return quicklist_alloc(0, GFP_KERNEL, NULL); 59 51 } 60 52 61 - static inline void free_pgd_fast(pgd_t *pgd) 53 + static inline void pgd_free(pgd_t *pgd) 62 54 { 63 - *(unsigned long *)pgd = (unsigned long) pgd_quicklist; 64 - pgd_quicklist = (unsigned long *) pgd; 65 - pgtable_cache_size++; 55 + quicklist_free(0, NULL, pgd); 66 56 } 67 57 68 - static inline void free_pgd_slow(pgd_t *pgd) 58 + static inline struct page *pte_alloc_one(struct mm_struct *mm, 59 + unsigned long address) 69 60 { 70 - kfree((void *)pgd); 71 - } 72 - 73 - extern pte_t *get_pte_slow(pmd_t *pmd, unsigned long address_preadjusted); 74 - extern pte_t *get_pte_kernel_slow(pmd_t *pmd, unsigned long address_preadjusted); 75 - 76 - static inline pte_t *get_pte_fast(void) 77 - { 78 - unsigned long *ret; 79 - 80 - if((ret = (unsigned long *)pte_quicklist) != NULL) { 81 - pte_quicklist = (unsigned long *)(*ret); 82 - ret[0] = ret[1]; 83 - pgtable_cache_size--; 84 - } 85 - return (pte_t *)ret; 86 - } 87 - 88 - static inline void free_pte_fast(pte_t *pte) 89 - { 90 - *(unsigned long *)pte = (unsigned long) pte_quicklist; 91 - pte_quicklist = (unsigned long *) pte; 92 - pgtable_cache_size++; 61 + void *pg = quicklist_alloc(0, GFP_KERNEL, NULL); 62 + return pg ? virt_to_page(pg) : NULL; 93 63 } 94 64 95 65 static inline void pte_free_kernel(pte_t *pte) 96 66 { 97 - free_page((unsigned long)pte); 67 + quicklist_free(0, NULL, pte); 98 68 } 99 69 100 70 static inline void pte_free(struct page *pte) 101 71 { 102 - __free_page(pte); 72 + quicklist_free_page(0, NULL, pte); 103 73 } 104 74 105 75 static inline pte_t *pte_alloc_one_kernel(struct mm_struct *mm, 106 76 unsigned long address) 107 77 { 108 - pte_t *pte; 109 - 110 - pte = (pte_t *)__get_free_page(GFP_KERNEL | __GFP_REPEAT|__GFP_ZERO); 111 - 112 - return pte; 113 - } 114 - 115 - static inline struct page *pte_alloc_one(struct mm_struct *mm, unsigned long address) 116 - { 117 - struct page *pte; 118 - 119 - pte = alloc_pages(GFP_KERNEL|__GFP_REPEAT|__GFP_ZERO, 0); 120 - 121 - return pte; 78 + return quicklist_alloc(0, GFP_KERNEL, NULL); 122 79 } 123 80 124 81 #define __pte_free_tlb(tlb,pte) tlb_remove_page((tlb),(pte)) ··· 91 142 92 143 #elif defined(CONFIG_SH64_PGTABLE_3_LEVEL) 93 144 94 - static __inline__ pmd_t *pmd_alloc_one(struct mm_struct *mm, unsigned long address) 145 + static inline pmd_t *pmd_alloc_one(struct mm_struct *mm, unsigned long address) 95 146 { 96 - pmd_t *pmd; 97 - pmd = (pmd_t *) __get_free_page(GFP_KERNEL|__GFP_REPEAT|__GFP_ZERO); 98 - return pmd; 147 + return quicklist_alloc(0, GFP_KERNEL, NULL); 99 148 } 100 149 101 - static __inline__ void pmd_free(pmd_t *pmd) 150 + static inline void pmd_free(pmd_t *pmd) 102 151 { 103 - free_page((unsigned long) pmd); 152 + quicklist_free(0, NULL, pmd); 104 153 } 105 154 106 - #define pgd_populate(mm, pgd, pmd) pgd_set(pgd, pmd) 155 + #define pgd_populate(mm, pgd, pmd) pgd_set(pgd, pmd) 107 156 #define __pmd_free_tlb(tlb,pmd) pmd_free(pmd) 108 157 109 158 #else 110 159 #error "No defined page table size" 111 160 #endif 112 - 113 - #define check_pgt_cache() do { } while (0) 114 - #define pgd_free(pgd) free_pgd_slow(pgd) 115 - #define pgd_alloc(mm) get_pgd_fast() 116 - 117 - extern int do_check_pgt_cache(int, int); 118 161 119 162 #define pmd_populate_kernel(mm, pmd, pte) \ 120 163 set_pmd(pmd, __pmd(_PAGE_TABLE + (unsigned long) (pte))) ··· 115 174 struct page *pte) 116 175 { 117 176 set_pmd(pmd, __pmd(_PAGE_TABLE + (unsigned long) page_address (pte))); 177 + } 178 + 179 + static inline void check_pgt_cache(void) 180 + { 181 + quicklist_trim(0, NULL, 25, 16); 118 182 } 119 183 120 184 #endif /* __ASM_SH64_PGALLOC_H */
+1
include/asm-sh64/sci.h
··· 1 + #include <asm-sh/sci.h>
+6
include/asm-sh64/thread_info.h
··· 78 78 #define TIF_SIGPENDING 2 /* signal pending */ 79 79 #define TIF_NEED_RESCHED 3 /* rescheduling necessary */ 80 80 #define TIF_MEMDIE 4 81 + #define TIF_RESTORE_SIGMASK 5 /* Restore signal mask in do_signal */ 81 82 83 + #define _TIF_SYSCALL_TRACE (1 << TIF_SYSCALL_TRACE) 84 + #define _TIF_SIGPENDING (1 << TIF_SIGPENDING) 85 + #define _TIF_NEED_RESCHED (1 << TIF_NEED_RESCHED) 86 + #define _TIF_MEMDIE (1 << TIF_MEMDIE) 87 + #define _TIF_RESTORE_SIGMASK (1 << TIF_RESTORE_SIGMASK) 82 88 83 89 #endif /* __KERNEL__ */ 84 90
+37 -6
include/asm-sh64/unistd.h
··· 9 9 * include/asm-sh64/unistd.h 10 10 * 11 11 * Copyright (C) 2000, 2001 Paolo Alberelli 12 - * Copyright (C) 2003 Paul Mundt 12 + * Copyright (C) 2003 - 2007 Paul Mundt 13 13 * Copyright (C) 2004 Sean McGoogan 14 14 * 15 15 * This file contains the system call numbers. 16 16 * 17 17 */ 18 18 19 - #define __NR_setup 0 /* used only by init, to get system going */ 19 + #define __NR_restart_syscall 0 20 20 #define __NR_exit 1 21 21 #define __NR_fork 2 22 22 #define __NR_read 3 ··· 196 196 #define __NR_rt_sigtimedwait 177 197 197 #define __NR_rt_sigqueueinfo 178 198 198 #define __NR_rt_sigsuspend 179 199 - #define __NR_pread 180 200 - #define __NR_pwrite 181 199 + #define __NR_pread64 180 200 + #define __NR_pwrite64 181 201 201 #define __NR_chown 182 202 202 #define __NR_getcwd 183 203 203 #define __NR_capget 184 ··· 343 343 #define __NR_inotify_init 318 344 344 #define __NR_inotify_add_watch 319 345 345 #define __NR_inotify_rm_watch 320 346 + /* 321 is unused */ 347 + #define __NR_migrate_pages 322 348 + #define __NR_openat 323 349 + #define __NR_mkdirat 324 350 + #define __NR_mknodat 325 351 + #define __NR_fchownat 326 352 + #define __NR_futimesat 327 353 + #define __NR_fstatat64 328 354 + #define __NR_unlinkat 329 355 + #define __NR_renameat 330 356 + #define __NR_linkat 331 357 + #define __NR_symlinkat 332 358 + #define __NR_readlinkat 333 359 + #define __NR_fchmodat 334 360 + #define __NR_faccessat 335 361 + #define __NR_pselect6 336 362 + #define __NR_ppoll 337 363 + #define __NR_unshare 338 364 + #define __NR_set_robust_list 339 365 + #define __NR_get_robust_list 340 366 + #define __NR_splice 341 367 + #define __NR_sync_file_range 342 368 + #define __NR_tee 343 369 + #define __NR_vmsplice 344 370 + #define __NR_move_pages 345 371 + #define __NR_getcpu 346 372 + #define __NR_epoll_pwait 347 373 + #define __NR_utimensat 348 374 + #define __NR_signalfd 349 375 + #define __NR_timerfd 350 376 + #define __NR_eventfd 351 346 377 347 - #ifdef __KERNEL__ 378 + #ifdef __KERNEL__ 348 379 349 - #define NR_syscalls 321 380 + #define NR_syscalls 352 350 381 351 382 #define __ARCH_WANT_IPC_PARSE_VERSION 352 383 #define __ARCH_WANT_OLD_READDIR
-3
include/linux/ide.h
··· 1281 1281 int ide_in_drive_list(struct hd_driveid *, const struct drive_list_entry *); 1282 1282 int __ide_dma_bad_drive(ide_drive_t *); 1283 1283 int __ide_dma_good_drive(ide_drive_t *); 1284 - int ide_use_dma(ide_drive_t *); 1285 1284 u8 ide_max_dma_mode(ide_drive_t *); 1286 1285 int ide_tune_dma(ide_drive_t *); 1287 1286 void ide_dma_off(ide_drive_t *); ··· 1308 1309 #endif /* CONFIG_BLK_DEV_IDEDMA_PCI */ 1309 1310 1310 1311 #else 1311 - static inline int ide_use_dma(ide_drive_t *drive) { return 0; } 1312 1312 static inline u8 ide_max_dma_mode(ide_drive_t *drive) { return 0; } 1313 1313 static inline int ide_tune_dma(ide_drive_t *drive) { return 0; } 1314 1314 static inline void ide_dma_off(ide_drive_t *drive) { ; } ··· 1355 1357 1356 1358 /* ide-lib.c */ 1357 1359 u8 ide_rate_filter(ide_drive_t *, u8); 1358 - extern int ide_dma_enable(ide_drive_t *drive); 1359 1360 extern char *ide_xfer_verbose(u8 xfer_rate); 1360 1361 extern void ide_toggle_bounce(ide_drive_t *drive, int on); 1361 1362 extern int ide_set_xfer_rate(ide_drive_t *drive, u8 rate);
+2
kernel/auditfilter.c
··· 311 311 return classes[class][AUDIT_WORD(syscall)] & AUDIT_BIT(syscall); 312 312 } 313 313 314 + #ifdef CONFIG_AUDITSYSCALL 314 315 static inline int audit_match_class_bits(int class, u32 *mask) 315 316 { 316 317 int i; ··· 348 347 return 1; 349 348 } 350 349 } 350 + #endif 351 351 352 352 /* Common user-space to kernel rule translation. */ 353 353 static inline struct audit_entry *audit_to_entry_common(struct audit_rule *rule)
+1 -1
mm/Kconfig
··· 166 166 config NR_QUICK 167 167 int 168 168 depends on QUICKLIST 169 - default "2" if SUPERH 169 + default "2" if (SUPERH && !SUPERH64) 170 170 default "1"