Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Merge intel drm-intel-next branch

Merge remote branch 'anholt/drm-intel-next' of ../anholt-2.6 into drm-next

Conflicts:
drivers/gpu/drm/i915/intel_display.c
drivers/gpu/drm/i915/intel_drv.h
drivers/gpu/drm/i915/intel_sdvo.c

+3353 -1660
+3
Documentation/filesystems/9p.txt
··· 123 123 There are user and developer mailing lists available through the v9fs project 124 124 on sourceforge (http://sourceforge.net/projects/v9fs). 125 125 126 + A stand-alone version of the module (which should build for any 2.6 kernel) 127 + is available via (http://github.com/ericvh/9p-sac/tree/master) 128 + 126 129 News and other information is maintained on SWiK (http://swik.net/v9fs). 127 130 128 131 Bug reports may be issued through the kernel.org bugzilla
+1 -2
MAINTAINERS
··· 2239 2239 F: drivers/media/video/gspca/pac207.c 2240 2240 2241 2241 GSPCA SN9C20X SUBDRIVER 2242 - P: Brian Johnson 2243 - M: brijohn@gmail.com 2242 + M: Brian Johnson <brijohn@gmail.com> 2244 2243 L: linux-media@vger.kernel.org 2245 2244 T: git git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-2.6.git 2246 2245 S: Maintained
+1 -1
Makefile
··· 1 1 VERSION = 2 2 2 PATCHLEVEL = 6 3 3 SUBLEVEL = 31 4 - EXTRAVERSION = -rc6 4 + EXTRAVERSION = -rc8 5 5 NAME = Man-Eating Seals of Antiquity 6 6 7 7 # *DOCUMENTATION*
+1 -1
arch/arm/configs/kirkwood_defconfig
··· 629 629 CONFIG_ATA=y 630 630 # CONFIG_ATA_NONSTANDARD is not set 631 631 CONFIG_SATA_PMP=y 632 - # CONFIG_SATA_AHCI is not set 632 + CONFIG_SATA_AHCI=y 633 633 # CONFIG_SATA_SIL24 is not set 634 634 CONFIG_ATA_SFF=y 635 635 # CONFIG_SATA_SVW is not set
+9
arch/arm/mach-kirkwood/ts219-setup.c
··· 206 206 207 207 } 208 208 209 + static int __init ts219_pci_init(void) 210 + { 211 + if (machine_is_ts219()) 212 + kirkwood_pcie_init(); 213 + 214 + return 0; 215 + } 216 + subsys_initcall(ts219_pci_init); 217 + 209 218 MACHINE_START(TS219, "QNAP TS-119/TS-219") 210 219 /* Maintainer: Martin Michlmayr <tbm@cyrius.com> */ 211 220 .phys_io = KIRKWOOD_REGS_PHYS_BASE,
+2
arch/arm/plat-orion/include/plat/gpio.h
··· 11 11 #ifndef __PLAT_GPIO_H 12 12 #define __PLAT_GPIO_H 13 13 14 + #include <linux/init.h> 15 + 14 16 /* 15 17 * GENERIC_GPIO primitives. 16 18 */
+4
arch/avr32/boards/favr-32/setup.c
··· 72 72 .debounce_max = 20, 73 73 .debounce_rep = 4, 74 74 .debounce_tol = 5, 75 + 76 + .keep_vref_on = true, 77 + .settle_delay_usecs = 500, 78 + .penirq_recheck_delay_usecs = 100, 75 79 }; 76 80 77 81 static struct spi_board_info __initdata spi1_board_info[] = {
+13 -3
arch/avr32/lib/memcpy.S
··· 24 24 brne 1f 25 25 26 26 /* At this point, "from" is word-aligned */ 27 - 2: sub r10, 4 28 - mov r9, r12 27 + 2: mov r9, r12 28 + 5: sub r10, 4 29 29 brlt 4f 30 30 31 31 3: ld.w r8, r11++ ··· 49 49 50 50 /* Handle unaligned "from" pointer */ 51 51 1: sub r10, 4 52 + movlt r9, r12 52 53 brlt 4b 53 54 add r10, r9 54 55 lsl r9, 2 ··· 60 59 st.b r12++, r8 61 60 ld.ub r8, r11++ 62 61 st.b r12++, r8 63 - rjmp 2b 62 + mov r8, r12 63 + add pc, pc, r9 64 + sub r8, 1 65 + nop 66 + sub r8, 1 67 + nop 68 + sub r8, 1 69 + nop 70 + mov r9, r8 71 + rjmp 5b
+4 -2
arch/m68k/amiga/config.c
··· 574 574 575 575 tod_2000.cntrl1 = TOD2000_CNTRL1_HOLD; 576 576 577 - while ((tod_2000.cntrl1 & TOD2000_CNTRL1_BUSY) && cnt--) { 577 + while ((tod_2000.cntrl1 & TOD2000_CNTRL1_BUSY) && cnt) { 578 578 tod_2000.cntrl1 &= ~TOD2000_CNTRL1_HOLD; 579 579 udelay(70); 580 580 tod_2000.cntrl1 |= TOD2000_CNTRL1_HOLD; 581 + --cnt; 581 582 } 582 583 583 584 if (!cnt) ··· 650 649 651 650 tod_2000.cntrl1 |= TOD2000_CNTRL1_HOLD; 652 651 653 - while ((tod_2000.cntrl1 & TOD2000_CNTRL1_BUSY) && cnt--) { 652 + while ((tod_2000.cntrl1 & TOD2000_CNTRL1_BUSY) && cnt) { 654 653 tod_2000.cntrl1 &= ~TOD2000_CNTRL1_HOLD; 655 654 udelay(70); 656 655 tod_2000.cntrl1 |= TOD2000_CNTRL1_HOLD; 656 + --cnt; 657 657 } 658 658 659 659 if (!cnt)
+4 -6
arch/m68k/include/asm/motorola_pgalloc.h
··· 36 36 return NULL; 37 37 38 38 pte = kmap(page); 39 - if (pte) { 40 - __flush_page_to_ram(pte); 41 - flush_tlb_kernel_page(pte); 42 - nocache_page(pte); 43 - } 44 - kunmap(pte); 39 + __flush_page_to_ram(pte); 40 + flush_tlb_kernel_page(pte); 41 + nocache_page(pte); 42 + kunmap(page); 45 43 pgtable_page_ctor(page); 46 44 return page; 47 45 }
+1 -2
arch/m68k/include/asm/pgtable_mm.h
··· 135 135 #endif 136 136 137 137 #ifndef __ASSEMBLY__ 138 - #include <asm-generic/pgtable.h> 139 - 140 138 /* 141 139 * Macro to mark a page protection value as "uncacheable". 142 140 */ ··· 152 154 ? (__pgprot((pgprot_val(prot) & _CACHEMASK040) | _PAGE_NOCACHE_S)) \ 153 155 : (prot))) 154 156 157 + #include <asm-generic/pgtable.h> 155 158 #endif /* !__ASSEMBLY__ */ 156 159 157 160 /*
+3 -1
arch/m68k/include/asm/unistd.h
··· 334 334 #define __NR_inotify_init1 328 335 335 #define __NR_preadv 329 336 336 #define __NR_pwritev 330 337 + #define __NR_rt_tgsigqueueinfo 331 338 + #define __NR_perf_counter_open 332 337 339 338 340 #ifdef __KERNEL__ 339 341 340 - #define NR_syscalls 331 342 + #define NR_syscalls 333 341 343 342 344 #define __ARCH_WANT_IPC_PARSE_VERSION 343 345 #define __ARCH_WANT_OLD_READDIR
+2
arch/m68k/kernel/entry.S
··· 755 755 .long sys_inotify_init1 756 756 .long sys_preadv 757 757 .long sys_pwritev /* 330 */ 758 + .long sys_rt_tgsigqueueinfo 759 + .long sys_perf_counter_open 758 760
+2
arch/m68knommu/kernel/syscalltable.S
··· 349 349 .long sys_inotify_init1 350 350 .long sys_preadv 351 351 .long sys_pwritev /* 330 */ 352 + .long sys_rt_tgsigqueueinfo 353 + .long sys_perf_counter_open 352 354 353 355 .rept NR_syscalls-(.-sys_call_table)/4 354 356 .long sys_ni_syscall
+1 -1
arch/parisc/kernel/traps.c
··· 532 532 /* Kill the user process later */ 533 533 regs->iaoq[0] = 0 | 3; 534 534 regs->iaoq[1] = regs->iaoq[0] + 4; 535 - regs->iasq[0] = regs->iasq[0] = regs->sr[7]; 535 + regs->iasq[0] = regs->iasq[1] = regs->sr[7]; 536 536 regs->gr[0] &= ~PSW_B; 537 537 return; 538 538 }
+75 -136
arch/powerpc/configs/ps3_defconfig
··· 1 1 # 2 2 # Automatically generated make config: don't edit 3 - # Linux kernel version: 2.6.30-rc5 4 - # Fri May 15 10:37:00 2009 3 + # Linux kernel version: 2.6.31-rc7 4 + # Mon Aug 24 17:38:50 2009 5 5 # 6 6 CONFIG_PPC64=y 7 7 8 8 # 9 9 # Processor support 10 10 # 11 + CONFIG_PPC_BOOK3S_64=y 11 12 CONFIG_PPC_BOOK3S=y 12 13 # CONFIG_POWER4_ONLY is not set 13 14 CONFIG_POWER3=y ··· 21 20 CONFIG_PPC_STD_MMU_64=y 22 21 CONFIG_PPC_MM_SLICES=y 23 22 CONFIG_VIRT_CPU_ACCOUNTING=y 23 + CONFIG_PPC_HAVE_PMU_SUPPORT=y 24 24 CONFIG_SMP=y 25 25 CONFIG_NR_CPUS=2 26 26 CONFIG_64BIT=y ··· 33 31 CONFIG_GENERIC_TIME_VSYSCALL=y 34 32 CONFIG_GENERIC_CLOCKEVENTS=y 35 33 CONFIG_GENERIC_HARDIRQS=y 34 + CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y 36 35 CONFIG_HAVE_SETUP_PER_CPU_AREA=y 37 36 CONFIG_IRQ_PER_CPU=y 38 37 CONFIG_STACKTRACE_SUPPORT=y ··· 44 41 CONFIG_ARCH_HAS_ILOG2_U32=y 45 42 CONFIG_ARCH_HAS_ILOG2_U64=y 46 43 CONFIG_GENERIC_HWEIGHT=y 47 - CONFIG_GENERIC_CALIBRATE_DELAY=y 48 44 CONFIG_GENERIC_FIND_NEXT_BIT=y 49 45 CONFIG_ARCH_NO_VIRT_TO_BUS=y 50 46 CONFIG_PPC=y ··· 64 62 # CONFIG_PPC_DCR_MMIO is not set 65 63 CONFIG_ARCH_SUPPORTS_DEBUG_PAGEALLOC=y 66 64 CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config" 65 + CONFIG_CONSTRUCTORS=y 67 66 68 67 # 69 68 # General setup ··· 116 113 CONFIG_KALLSYMS=y 117 114 CONFIG_KALLSYMS_ALL=y 118 115 CONFIG_KALLSYMS_EXTRA_PASS=y 119 - # CONFIG_STRIP_ASM_SYMS is not set 120 116 CONFIG_HOTPLUG=y 121 117 CONFIG_PRINTK=y 122 118 CONFIG_BUG=y ··· 128 126 CONFIG_EVENTFD=y 129 127 CONFIG_SHMEM=y 130 128 CONFIG_AIO=y 129 + CONFIG_HAVE_PERF_COUNTERS=y 130 + 131 + # 132 + # Performance Counters 133 + # 134 + # CONFIG_PERF_COUNTERS is not set 131 135 CONFIG_VM_EVENT_COUNTERS=y 136 + # CONFIG_STRIP_ASM_SYMS is not set 132 137 # CONFIG_COMPAT_BRK is not set 133 138 CONFIG_SLAB=y 134 139 # CONFIG_SLUB is not set ··· 154 145 CONFIG_HAVE_ARCH_TRACEHOOK=y 155 146 CONFIG_HAVE_DMA_ATTRS=y 156 147 CONFIG_USE_GENERIC_SMP_HELPERS=y 148 + 149 + # 150 + # GCOV-based kernel profiling 151 + # 152 + # CONFIG_GCOV_KERNEL is not set 157 153 # CONFIG_SLOW_WORK is not set 158 154 # CONFIG_HAVE_GENERIC_DMA_COHERENT is not set 159 155 CONFIG_SLABINFO=y ··· 224 210 # 225 211 # Cell Broadband Engine options 226 212 # 227 - CONFIG_SPU_FS=y 213 + CONFIG_SPU_FS=m 228 214 CONFIG_SPU_FS_64K_LS=y 229 215 # CONFIG_SPU_TRACE is not set 230 216 CONFIG_SPU_BASE=y ··· 269 255 CONFIG_HUGETLB_PAGE_SIZE_VARIABLE=y 270 256 # CONFIG_IOMMU_VMERGE is not set 271 257 CONFIG_IOMMU_HELPER=y 258 + # CONFIG_SWIOTLB is not set 272 259 CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y 273 260 CONFIG_ARCH_HAS_WALK_MEMORY=y 274 261 CONFIG_ARCH_ENABLE_MEMORY_HOTREMOVE=y ··· 300 285 CONFIG_PHYS_ADDR_T_64BIT=y 301 286 CONFIG_ZONE_DMA_FLAG=1 302 287 CONFIG_BOUNCE=y 303 - CONFIG_UNEVICTABLE_LRU=y 304 288 CONFIG_HAVE_MLOCK=y 305 289 CONFIG_HAVE_MLOCKED_PAGE_BIT=y 290 + CONFIG_DEFAULT_MMAP_MIN_ADDR=4096 306 291 CONFIG_ARCH_MEMORY_PROBE=y 307 292 CONFIG_PPC_HAS_HASH_64K=y 308 293 CONFIG_PPC_4K_PAGES=y ··· 414 399 # CONFIG_ECONET is not set 415 400 # CONFIG_WAN_ROUTER is not set 416 401 # CONFIG_PHONET is not set 402 + # CONFIG_IEEE802154 is not set 417 403 # CONFIG_NET_SCHED is not set 418 404 # CONFIG_DCB is not set 419 405 ··· 449 433 CONFIG_WIRELESS=y 450 434 CONFIG_CFG80211=m 451 435 # CONFIG_CFG80211_REG_DEBUG is not set 436 + # CONFIG_CFG80211_DEBUGFS is not set 452 437 # CONFIG_WIRELESS_OLD_REGULATORY is not set 453 438 CONFIG_WIRELESS_EXT=y 454 439 # CONFIG_WIRELESS_EXT_SYSFS is not set 455 440 # CONFIG_LIB80211 is not set 456 441 CONFIG_MAC80211=m 442 + CONFIG_MAC80211_DEFAULT_PS=y 443 + CONFIG_MAC80211_DEFAULT_PS_VALUE=1 457 444 458 445 # 459 446 # Rate control algorithm selection ··· 466 447 CONFIG_MAC80211_RC_DEFAULT_PID=y 467 448 # CONFIG_MAC80211_RC_DEFAULT_MINSTREL is not set 468 449 CONFIG_MAC80211_RC_DEFAULT="pid" 469 - # CONFIG_MAC80211_MESH is not set 470 450 # CONFIG_MAC80211_LEDS is not set 471 451 # CONFIG_MAC80211_DEBUGFS is not set 472 452 # CONFIG_MAC80211_DEBUG_MENU is not set ··· 490 472 # CONFIG_DEBUG_DEVRES is not set 491 473 # CONFIG_SYS_HYPERVISOR is not set 492 474 # CONFIG_CONNECTOR is not set 493 - CONFIG_MTD=y 494 - CONFIG_MTD_DEBUG=y 495 - CONFIG_MTD_DEBUG_VERBOSE=0 496 - # CONFIG_MTD_CONCAT is not set 497 - # CONFIG_MTD_PARTITIONS is not set 498 - # CONFIG_MTD_TESTS is not set 499 - 500 - # 501 - # User Modules And Translation Layers 502 - # 503 - # CONFIG_MTD_CHAR is not set 504 - CONFIG_MTD_BLKDEVS=y 505 - CONFIG_MTD_BLOCK=y 506 - # CONFIG_FTL is not set 507 - # CONFIG_NFTL is not set 508 - # CONFIG_INFTL is not set 509 - # CONFIG_RFD_FTL is not set 510 - # CONFIG_SSFDC is not set 511 - # CONFIG_MTD_OOPS is not set 512 - 513 - # 514 - # RAM/ROM/Flash chip drivers 515 - # 516 - # CONFIG_MTD_CFI is not set 517 - # CONFIG_MTD_JEDECPROBE is not set 518 - CONFIG_MTD_MAP_BANK_WIDTH_1=y 519 - CONFIG_MTD_MAP_BANK_WIDTH_2=y 520 - CONFIG_MTD_MAP_BANK_WIDTH_4=y 521 - # CONFIG_MTD_MAP_BANK_WIDTH_8 is not set 522 - # CONFIG_MTD_MAP_BANK_WIDTH_16 is not set 523 - # CONFIG_MTD_MAP_BANK_WIDTH_32 is not set 524 - CONFIG_MTD_CFI_I1=y 525 - CONFIG_MTD_CFI_I2=y 526 - # CONFIG_MTD_CFI_I4 is not set 527 - # CONFIG_MTD_CFI_I8 is not set 528 - # CONFIG_MTD_RAM is not set 529 - # CONFIG_MTD_ROM is not set 530 - # CONFIG_MTD_ABSENT is not set 531 - 532 - # 533 - # Mapping drivers for chip access 534 - # 535 - # CONFIG_MTD_COMPLEX_MAPPINGS is not set 536 - # CONFIG_MTD_PLATRAM is not set 537 - 538 - # 539 - # Self-contained MTD device drivers 540 - # 541 - # CONFIG_MTD_SLRAM is not set 542 - # CONFIG_MTD_PHRAM is not set 543 - # CONFIG_MTD_MTDRAM is not set 544 - # CONFIG_MTD_BLOCK2MTD is not set 545 - 546 - # 547 - # Disk-On-Chip Device Drivers 548 - # 549 - # CONFIG_MTD_DOC2000 is not set 550 - # CONFIG_MTD_DOC2001 is not set 551 - # CONFIG_MTD_DOC2001PLUS is not set 552 - # CONFIG_MTD_NAND is not set 553 - # CONFIG_MTD_ONENAND is not set 554 - 555 - # 556 - # LPDDR flash memory drivers 557 - # 558 - # CONFIG_MTD_LPDDR is not set 559 - 560 - # 561 - # UBI - Unsorted block images 562 - # 563 - # CONFIG_MTD_UBI is not set 475 + # CONFIG_MTD is not set 564 476 CONFIG_OF_DEVICE=y 565 477 # CONFIG_PARPORT is not set 566 478 CONFIG_BLK_DEV=y ··· 538 590 # CONFIG_BLK_DEV_SR_VENDOR is not set 539 591 CONFIG_CHR_DEV_SG=m 540 592 # CONFIG_CHR_DEV_SCH is not set 541 - 542 - # 543 - # Some SCSI devices (e.g. CD jukebox) support multiple LUNs 544 - # 545 593 CONFIG_SCSI_MULTI_LUN=y 546 594 # CONFIG_SCSI_CONSTANTS is not set 547 595 # CONFIG_SCSI_LOGGING is not set ··· 570 626 # CONFIG_DM_UEVENT is not set 571 627 # CONFIG_MACINTOSH_DRIVERS is not set 572 628 CONFIG_NETDEVICES=y 573 - CONFIG_COMPAT_NET_DEV_OPS=y 574 629 # CONFIG_DUMMY is not set 575 630 # CONFIG_BONDING is not set 576 631 # CONFIG_MACVLAN is not set ··· 589 646 # CONFIG_IBM_NEW_EMAC_MAL_CLR_ICINTSTAT is not set 590 647 # CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set 591 648 # CONFIG_B44 is not set 649 + # CONFIG_KS8842 is not set 592 650 CONFIG_NETDEV_1000=y 593 651 CONFIG_GELIC_NET=y 594 652 CONFIG_GELIC_WIRELESS=y 595 - CONFIG_GELIC_WIRELESS_OLD_PSK_INTERFACE=y 653 + # CONFIG_GELIC_WIRELESS_OLD_PSK_INTERFACE is not set 596 654 # CONFIG_NETDEV_10000 is not set 597 655 598 656 # ··· 613 669 # CONFIG_HOSTAP is not set 614 670 # CONFIG_B43 is not set 615 671 # CONFIG_B43LEGACY is not set 616 - CONFIG_ZD1211RW=m 617 - # CONFIG_ZD1211RW_DEBUG is not set 672 + # CONFIG_ZD1211RW is not set 618 673 # CONFIG_RT2X00 is not set 619 674 620 675 # ··· 625 682 # 626 683 # CONFIG_USB_CATC is not set 627 684 # CONFIG_USB_KAWETH is not set 628 - CONFIG_USB_PEGASUS=m 685 + # CONFIG_USB_PEGASUS is not set 629 686 # CONFIG_USB_RTL8150 is not set 630 687 CONFIG_USB_USBNET=m 631 688 CONFIG_USB_NET_AX8817X=m ··· 636 693 # CONFIG_USB_NET_GL620A is not set 637 694 # CONFIG_USB_NET_NET1080 is not set 638 695 # CONFIG_USB_NET_PLUSB is not set 639 - CONFIG_USB_NET_MCS7830=m 696 + # CONFIG_USB_NET_MCS7830 is not set 640 697 # CONFIG_USB_NET_RNDIS_HOST is not set 641 698 # CONFIG_USB_NET_CDC_SUBSET is not set 642 699 # CONFIG_USB_NET_ZAURUS is not set 700 + # CONFIG_USB_NET_INT51X1 is not set 643 701 # CONFIG_WAN is not set 644 702 CONFIG_PPP=m 645 703 CONFIG_PPP_MULTILINK=y ··· 715 771 # 716 772 CONFIG_UNIX98_PTYS=y 717 773 # CONFIG_DEVPTS_MULTIPLE_INSTANCES is not set 718 - CONFIG_LEGACY_PTYS=y 719 - CONFIG_LEGACY_PTY_COUNT=16 774 + # CONFIG_LEGACY_PTYS is not set 720 775 # CONFIG_HVC_UDBG is not set 721 776 # CONFIG_IPMI_HANDLER is not set 722 777 # CONFIG_HW_RANDOM is not set ··· 725 782 # CONFIG_TCG_TPM is not set 726 783 # CONFIG_I2C is not set 727 784 # CONFIG_SPI is not set 785 + 786 + # 787 + # PPS support 788 + # 789 + # CONFIG_PPS is not set 728 790 CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y 729 791 # CONFIG_GPIOLIB is not set 730 792 # CONFIG_W1 is not set ··· 753 805 # CONFIG_HTC_PASIC3 is not set 754 806 # CONFIG_MFD_TMIO is not set 755 807 # CONFIG_REGULATOR is not set 756 - 757 - # 758 - # Multimedia devices 759 - # 760 - 761 - # 762 - # Multimedia core support 763 - # 764 - # CONFIG_VIDEO_DEV is not set 765 - # CONFIG_DVB_CORE is not set 766 - # CONFIG_VIDEO_MEDIA is not set 767 - 768 - # 769 - # Multimedia drivers 770 - # 771 - # CONFIG_DAB is not set 808 + # CONFIG_MEDIA_SUPPORT is not set 772 809 773 810 # 774 811 # Graphics support ··· 831 898 CONFIG_SND_VERBOSE_PROCFS=y 832 899 # CONFIG_SND_VERBOSE_PRINTK is not set 833 900 # CONFIG_SND_DEBUG is not set 901 + # CONFIG_SND_RAWMIDI_SEQ is not set 902 + # CONFIG_SND_OPL3_LIB_SEQ is not set 903 + # CONFIG_SND_OPL4_LIB_SEQ is not set 904 + # CONFIG_SND_SBAWE_SEQ is not set 905 + # CONFIG_SND_EMU10K1_SEQ is not set 834 906 # CONFIG_SND_DRIVERS is not set 835 907 CONFIG_SND_PPC=y 836 908 CONFIG_SND_PS3=m ··· 868 930 # Special HID drivers 869 931 # 870 932 # CONFIG_HID_A4TECH is not set 871 - # CONFIG_HID_APPLE is not set 872 - # CONFIG_HID_BELKIN is not set 873 - # CONFIG_HID_CHERRY is not set 933 + CONFIG_HID_APPLE=m 934 + CONFIG_HID_BELKIN=m 935 + CONFIG_HID_CHERRY=m 874 936 # CONFIG_HID_CHICONY is not set 875 937 # CONFIG_HID_CYPRESS is not set 876 - # CONFIG_DRAGONRISE_FF is not set 877 - # CONFIG_HID_EZKEY is not set 938 + # CONFIG_HID_DRAGONRISE is not set 939 + CONFIG_HID_EZKEY=m 878 940 # CONFIG_HID_KYE is not set 879 941 # CONFIG_HID_GYRATION is not set 880 942 # CONFIG_HID_KENSINGTON is not set 881 - # CONFIG_HID_LOGITECH is not set 882 - # CONFIG_HID_MICROSOFT is not set 943 + CONFIG_HID_LOGITECH=m 944 + # CONFIG_LOGITECH_FF is not set 945 + # CONFIG_LOGIRUMBLEPAD2_FF is not set 946 + CONFIG_HID_MICROSOFT=m 883 947 # CONFIG_HID_MONTEREY is not set 884 948 # CONFIG_HID_NTRIG is not set 885 949 # CONFIG_HID_PANTHERLORD is not set 886 950 # CONFIG_HID_PETALYNX is not set 887 951 # CONFIG_HID_SAMSUNG is not set 888 952 CONFIG_HID_SONY=m 889 - # CONFIG_HID_SUNPLUS is not set 890 - # CONFIG_GREENASIA_FF is not set 953 + CONFIG_HID_SUNPLUS=m 954 + # CONFIG_HID_GREENASIA is not set 955 + CONFIG_HID_SMARTJOYPLUS=m 956 + # CONFIG_SMARTJOYPLUS_FF is not set 891 957 # CONFIG_HID_TOPSEED is not set 892 - # CONFIG_THRUSTMASTER_FF is not set 893 - # CONFIG_ZEROPLUS_FF is not set 958 + # CONFIG_HID_THRUSTMASTER is not set 959 + # CONFIG_HID_WACOM is not set 960 + # CONFIG_HID_ZEROPLUS is not set 894 961 CONFIG_USB_SUPPORT=y 895 962 CONFIG_USB_ARCH_HAS_HCD=y 896 963 CONFIG_USB_ARCH_HAS_OHCI=y ··· 931 988 # CONFIG_USB_ISP116X_HCD is not set 932 989 # CONFIG_USB_ISP1760_HCD is not set 933 990 CONFIG_USB_OHCI_HCD=m 991 + # CONFIG_USB_OHCI_HCD_PPC_OF_BE is not set 992 + # CONFIG_USB_OHCI_HCD_PPC_OF_LE is not set 934 993 # CONFIG_USB_OHCI_HCD_PPC_OF is not set 935 994 # CONFIG_USB_OHCI_BIG_ENDIAN_DESC is not set 936 995 CONFIG_USB_OHCI_BIG_ENDIAN_MMIO=y ··· 1060 1115 # CONFIG_DMADEVICES is not set 1061 1116 # CONFIG_AUXDISPLAY is not set 1062 1117 # CONFIG_UIO is not set 1118 + 1119 + # 1120 + # TI VLYNQ 1121 + # 1063 1122 # CONFIG_STAGING is not set 1064 1123 1065 1124 # ··· 1090 1141 # CONFIG_REISERFS_FS is not set 1091 1142 # CONFIG_JFS_FS is not set 1092 1143 # CONFIG_FS_POSIX_ACL is not set 1093 - CONFIG_FILE_LOCKING=y 1094 1144 # CONFIG_XFS_FS is not set 1095 1145 # CONFIG_GFS2_FS is not set 1096 1146 # CONFIG_OCFS2_FS is not set 1097 1147 # CONFIG_BTRFS_FS is not set 1148 + CONFIG_FILE_LOCKING=y 1149 + CONFIG_FSNOTIFY=y 1098 1150 CONFIG_DNOTIFY=y 1099 1151 CONFIG_INOTIFY=y 1100 1152 CONFIG_INOTIFY_USER=y ··· 1155 1205 # CONFIG_BEFS_FS is not set 1156 1206 # CONFIG_BFS_FS is not set 1157 1207 # CONFIG_EFS_FS is not set 1158 - # CONFIG_JFFS2_FS is not set 1159 1208 # CONFIG_CRAMFS is not set 1160 1209 # CONFIG_SQUASHFS is not set 1161 1210 # CONFIG_VXFS_FS is not set ··· 1171 1222 CONFIG_NFS_V3=y 1172 1223 # CONFIG_NFS_V3_ACL is not set 1173 1224 CONFIG_NFS_V4=y 1225 + # CONFIG_NFS_V4_1 is not set 1174 1226 CONFIG_ROOT_NFS=y 1175 1227 # CONFIG_NFSD is not set 1176 1228 CONFIG_LOCKD=y ··· 1309 1359 CONFIG_DEBUG_LIST=y 1310 1360 # CONFIG_DEBUG_SG is not set 1311 1361 # CONFIG_DEBUG_NOTIFIERS is not set 1312 - # CONFIG_BOOT_PRINTK_DELAY is not set 1313 1362 # CONFIG_RCU_TORTURE_TEST is not set 1314 1363 # CONFIG_RCU_CPU_STALL_DETECTOR is not set 1315 1364 # CONFIG_BACKTRACE_SELF_TEST is not set ··· 1323 1374 CONFIG_HAVE_DYNAMIC_FTRACE=y 1324 1375 CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y 1325 1376 CONFIG_RING_BUFFER=y 1377 + CONFIG_EVENT_TRACING=y 1378 + CONFIG_CONTEXT_SWITCH_TRACER=y 1326 1379 CONFIG_TRACING=y 1327 1380 CONFIG_TRACING_SUPPORT=y 1328 - 1329 - # 1330 - # Tracers 1331 - # 1332 - # CONFIG_FUNCTION_TRACER is not set 1333 - # CONFIG_IRQSOFF_TRACER is not set 1334 - # CONFIG_SCHED_TRACER is not set 1335 - # CONFIG_CONTEXT_SWITCH_TRACER is not set 1336 - # CONFIG_EVENT_TRACER is not set 1337 - # CONFIG_BOOT_TRACER is not set 1338 - # CONFIG_TRACE_BRANCH_PROFILING is not set 1339 - # CONFIG_STACK_TRACER is not set 1340 - # CONFIG_KMEMTRACE is not set 1341 - # CONFIG_WORKQUEUE_TRACER is not set 1342 - # CONFIG_BLK_DEV_IO_TRACE is not set 1343 - # CONFIG_FTRACE_STARTUP_TEST is not set 1381 + # CONFIG_FTRACE is not set 1344 1382 # CONFIG_DYNAMIC_DEBUG is not set 1345 1383 # CONFIG_SAMPLES is not set 1346 1384 CONFIG_HAVE_ARCH_KGDB=y 1347 1385 # CONFIG_KGDB is not set 1386 + # CONFIG_PPC_DISABLE_WERROR is not set 1387 + CONFIG_PPC_WERROR=y 1348 1388 CONFIG_PRINT_STACK_DEPTH=64 1349 1389 CONFIG_DEBUG_STACKOVERFLOW=y 1350 1390 # CONFIG_DEBUG_STACK_USAGE is not set 1391 + # CONFIG_PPC_EMULATED_STATS is not set 1351 1392 # CONFIG_CODE_PATCHING_SELFTEST is not set 1352 1393 # CONFIG_FTR_FIXUP_SELFTEST is not set 1353 1394 # CONFIG_MSI_BITMAP_SELFTEST is not set
+4
arch/powerpc/platforms/ps3/time.c
··· 21 21 #include <linux/kernel.h> 22 22 #include <linux/platform_device.h> 23 23 24 + #include <asm/firmware.h> 24 25 #include <asm/rtc.h> 25 26 #include <asm/lv1call.h> 26 27 #include <asm/ps3.h> ··· 84 83 static int __init ps3_rtc_init(void) 85 84 { 86 85 struct platform_device *pdev; 86 + 87 + if (!firmware_has_feature(FW_FEATURE_PS3_LV1)) 88 + return -ENODEV; 87 89 88 90 pdev = platform_device_register_simple("rtc-ps3", -1, NULL, 0); 89 91 if (IS_ERR(pdev))
+18 -7
arch/s390/kernel/setup.c
··· 154 154 155 155 __setup("condev=", condev_setup); 156 156 157 + static void __init set_preferred_console(void) 158 + { 159 + if (MACHINE_IS_KVM) { 160 + add_preferred_console("hvc", 0, NULL); 161 + s390_virtio_console_init(); 162 + return; 163 + } 164 + 165 + if (CONSOLE_IS_3215 || CONSOLE_IS_SCLP) 166 + add_preferred_console("ttyS", 0, NULL); 167 + if (CONSOLE_IS_3270) 168 + add_preferred_console("tty3270", 0, NULL); 169 + } 170 + 157 171 static int __init conmode_setup(char *str) 158 172 { 159 173 #if defined(CONFIG_SCLP_CONSOLE) || defined(CONFIG_SCLP_VT220_CONSOLE) ··· 182 168 if (strncmp(str, "3270", 5) == 0) 183 169 SET_CONSOLE_3270; 184 170 #endif 171 + set_preferred_console(); 185 172 return 1; 186 173 } 187 174 ··· 795 780 void __init 796 781 setup_arch(char **cmdline_p) 797 782 { 798 - /* set up preferred console */ 799 - add_preferred_console("ttyS", 0, NULL); 800 - 801 783 /* 802 784 * print what head.S has found out about the machine 803 785 */ ··· 814 802 if (MACHINE_IS_VM) 815 803 pr_info("Linux is running as a z/VM " 816 804 "guest operating system in 64-bit mode\n"); 817 - else if (MACHINE_IS_KVM) { 805 + else if (MACHINE_IS_KVM) 818 806 pr_info("Linux is running under KVM in 64-bit mode\n"); 819 - add_preferred_console("hvc", 0, NULL); 820 - s390_virtio_console_init(); 821 - } else 807 + else 822 808 pr_info("Linux is running natively in 64-bit mode\n"); 823 809 #endif /* CONFIG_64BIT */ 824 810 ··· 861 851 862 852 /* Setup default console */ 863 853 conmode_default(); 854 + set_preferred_console(); 864 855 865 856 /* Setup zfcpdump support */ 866 857 setup_zfcpdump(console_devno);
+44 -30
arch/sparc/configs/sparc32_defconfig
··· 1 1 # 2 2 # Automatically generated make config: don't edit 3 - # Linux kernel version: 2.6.30-rc2 4 - # Fri Apr 17 04:04:46 2009 3 + # Linux kernel version: 2.6.31-rc1 4 + # Tue Aug 18 23:45:52 2009 5 5 # 6 6 # CONFIG_64BIT is not set 7 7 CONFIG_SPARC=y ··· 17 17 CONFIG_ARCH_NO_VIRT_TO_BUS=y 18 18 CONFIG_OF=y 19 19 CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config" 20 + CONFIG_CONSTRUCTORS=y 20 21 21 22 # 22 23 # General setup ··· 75 74 CONFIG_KALLSYMS=y 76 75 # CONFIG_KALLSYMS_ALL is not set 77 76 # CONFIG_KALLSYMS_EXTRA_PASS is not set 78 - # CONFIG_STRIP_ASM_SYMS is not set 79 77 CONFIG_HOTPLUG=y 80 78 CONFIG_PRINTK=y 81 79 CONFIG_BUG=y ··· 87 87 CONFIG_EVENTFD=y 88 88 CONFIG_SHMEM=y 89 89 CONFIG_AIO=y 90 + 91 + # 92 + # Performance Counters 93 + # 90 94 CONFIG_VM_EVENT_COUNTERS=y 91 95 CONFIG_PCI_QUIRKS=y 96 + # CONFIG_STRIP_ASM_SYMS is not set 92 97 CONFIG_COMPAT_BRK=y 93 98 CONFIG_SLAB=y 94 99 # CONFIG_SLUB is not set ··· 102 97 # CONFIG_MARKERS is not set 103 98 CONFIG_HAVE_OPROFILE=y 104 99 CONFIG_HAVE_ARCH_TRACEHOOK=y 100 + 101 + # 102 + # GCOV-based kernel profiling 103 + # 105 104 # CONFIG_SLOW_WORK is not set 106 105 # CONFIG_HAVE_GENERIC_DMA_COHERENT is not set 107 106 CONFIG_SLABINFO=y ··· 118 109 # CONFIG_MODVERSIONS is not set 119 110 # CONFIG_MODULE_SRCVERSION_ALL is not set 120 111 CONFIG_BLOCK=y 121 - # CONFIG_LBD is not set 112 + CONFIG_LBDAF=y 122 113 # CONFIG_BLK_DEV_BSG is not set 123 114 # CONFIG_BLK_DEV_INTEGRITY is not set 124 115 ··· 163 154 # CONFIG_PHYS_ADDR_T_64BIT is not set 164 155 CONFIG_ZONE_DMA_FLAG=1 165 156 CONFIG_BOUNCE=y 166 - CONFIG_UNEVICTABLE_LRU=y 167 157 CONFIG_HAVE_MLOCK=y 168 158 CONFIG_HAVE_MLOCKED_PAGE_BIT=y 159 + CONFIG_DEFAULT_MMAP_MIN_ADDR=4096 169 160 CONFIG_SUN_PM=y 170 161 # CONFIG_SPARC_LED is not set 171 162 CONFIG_SERIAL_CONSOLE=y ··· 273 264 # CONFIG_ECONET is not set 274 265 # CONFIG_WAN_ROUTER is not set 275 266 # CONFIG_PHONET is not set 267 + # CONFIG_IEEE802154 is not set 276 268 # CONFIG_NET_SCHED is not set 277 269 # CONFIG_DCB is not set 278 270 ··· 291 281 CONFIG_WIRELESS_OLD_REGULATORY=y 292 282 # CONFIG_WIRELESS_EXT is not set 293 283 # CONFIG_LIB80211 is not set 294 - # CONFIG_MAC80211 is not set 284 + 285 + # 286 + # CFG80211 needs to be enabled for MAC80211 287 + # 288 + CONFIG_MAC80211_DEFAULT_PS_VALUE=0 295 289 # CONFIG_WIMAX is not set 296 290 # CONFIG_RFKILL is not set 297 291 # CONFIG_NET_9P is not set ··· 349 335 # EEPROM support 350 336 # 351 337 # CONFIG_EEPROM_93CX6 is not set 338 + # CONFIG_CB710_CORE is not set 352 339 CONFIG_HAVE_IDE=y 353 340 # CONFIG_IDE is not set 354 341 ··· 373 358 # CONFIG_BLK_DEV_SR_VENDOR is not set 374 359 CONFIG_CHR_DEV_SG=m 375 360 # CONFIG_CHR_DEV_SCH is not set 376 - 377 - # 378 - # Some SCSI devices (e.g. CD jukebox) support multiple LUNs 379 - # 380 361 # CONFIG_SCSI_MULTI_LUN is not set 381 362 # CONFIG_SCSI_CONSTANTS is not set 382 363 # CONFIG_SCSI_LOGGING is not set ··· 390 379 CONFIG_SCSI_LOWLEVEL=y 391 380 # CONFIG_ISCSI_TCP is not set 392 381 # CONFIG_SCSI_CXGB3_ISCSI is not set 382 + # CONFIG_SCSI_BNX2_ISCSI is not set 393 383 # CONFIG_BLK_DEV_3W_XXXX_RAID is not set 394 384 # CONFIG_SCSI_3W_9XXX is not set 395 385 # CONFIG_SCSI_ACARD is not set ··· 399 387 # CONFIG_SCSI_AIC7XXX_OLD is not set 400 388 # CONFIG_SCSI_AIC79XX is not set 401 389 # CONFIG_SCSI_AIC94XX is not set 390 + # CONFIG_SCSI_MVSAS is not set 402 391 # CONFIG_SCSI_ARCMSR is not set 403 392 # CONFIG_MEGARAID_NEWGEN is not set 404 393 # CONFIG_MEGARAID_LEGACY is not set ··· 414 401 # CONFIG_SCSI_IPS is not set 415 402 # CONFIG_SCSI_INITIO is not set 416 403 # CONFIG_SCSI_INIA100 is not set 417 - # CONFIG_SCSI_MVSAS is not set 418 404 # CONFIG_SCSI_STEX is not set 419 405 # CONFIG_SCSI_SYM53C8XX_2 is not set 420 406 # CONFIG_SCSI_QLOGIC_1280 is not set ··· 438 426 # 439 427 440 428 # 441 - # Enable only one of the two stacks, unless you know what you are doing 429 + # You can enable one or both FireWire driver stacks. 430 + # 431 + 432 + # 433 + # See the help texts for more information. 442 434 # 443 435 # CONFIG_FIREWIRE is not set 444 436 # CONFIG_IEEE1394 is not set 445 437 # CONFIG_I2O is not set 446 438 CONFIG_NETDEVICES=y 447 - CONFIG_COMPAT_NET_DEV_OPS=y 448 439 CONFIG_DUMMY=m 449 440 # CONFIG_BONDING is not set 450 441 # CONFIG_MACVLAN is not set ··· 478 463 # CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set 479 464 # CONFIG_NET_PCI is not set 480 465 # CONFIG_B44 is not set 466 + # CONFIG_KS8842 is not set 481 467 # CONFIG_ATL2 is not set 482 468 CONFIG_NETDEV_1000=y 483 469 # CONFIG_ACENIC is not set ··· 498 482 # CONFIG_VIA_VELOCITY is not set 499 483 # CONFIG_TIGON3 is not set 500 484 # CONFIG_BNX2 is not set 485 + # CONFIG_CNIC is not set 501 486 # CONFIG_QLA3XXX is not set 502 487 # CONFIG_ATL1 is not set 503 488 # CONFIG_ATL1E is not set ··· 646 629 CONFIG_DEVPORT=y 647 630 # CONFIG_I2C is not set 648 631 # CONFIG_SPI is not set 632 + 633 + # 634 + # PPS support 635 + # 636 + # CONFIG_PPS is not set 649 637 CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y 650 638 # CONFIG_GPIOLIB is not set 651 639 # CONFIG_W1 is not set ··· 690 668 # CONFIG_HTC_PASIC3 is not set 691 669 # CONFIG_MFD_TMIO is not set 692 670 # CONFIG_REGULATOR is not set 693 - 694 - # 695 - # Multimedia devices 696 - # 697 - 698 - # 699 - # Multimedia core support 700 - # 701 - # CONFIG_VIDEO_DEV is not set 702 - # CONFIG_DVB_CORE is not set 703 - # CONFIG_VIDEO_MEDIA is not set 704 - 705 - # 706 - # Multimedia drivers 707 - # 708 - # CONFIG_DAB is not set 671 + # CONFIG_MEDIA_SUPPORT is not set 709 672 710 673 # 711 674 # Graphics support ··· 783 776 # CONFIG_DMADEVICES is not set 784 777 # CONFIG_AUXDISPLAY is not set 785 778 # CONFIG_UIO is not set 779 + 780 + # 781 + # TI VLYNQ 782 + # 786 783 # CONFIG_STAGING is not set 787 784 788 785 # ··· 810 799 # CONFIG_REISERFS_FS is not set 811 800 # CONFIG_JFS_FS is not set 812 801 CONFIG_FS_POSIX_ACL=y 813 - CONFIG_FILE_LOCKING=y 814 802 # CONFIG_XFS_FS is not set 803 + # CONFIG_GFS2_FS is not set 815 804 # CONFIG_OCFS2_FS is not set 816 805 # CONFIG_BTRFS_FS is not set 806 + CONFIG_FILE_LOCKING=y 807 + CONFIG_FSNOTIFY=y 817 808 CONFIG_DNOTIFY=y 818 809 CONFIG_INOTIFY=y 819 810 CONFIG_INOTIFY_USER=y ··· 998 985 CONFIG_KGDB_SERIAL_CONSOLE=y 999 986 CONFIG_KGDB_TESTS=y 1000 987 # CONFIG_KGDB_TESTS_ON_BOOT is not set 988 + # CONFIG_KMEMCHECK is not set 1001 989 # CONFIG_DEBUG_STACK_USAGE is not set 1002 990 # CONFIG_STACK_DEBUG is not set 1003 991
+34 -25
arch/sparc/configs/sparc64_defconfig
··· 1 1 # 2 2 # Automatically generated make config: don't edit 3 - # Linux kernel version: 2.6.30 4 - # Tue Jun 16 04:59:36 2009 3 + # Linux kernel version: 2.6.31-rc1 4 + # Tue Aug 18 23:56:02 2009 5 5 # 6 6 CONFIG_64BIT=y 7 7 CONFIG_SPARC=y ··· 26 26 CONFIG_OF=y 27 27 CONFIG_ARCH_SUPPORTS_DEBUG_PAGEALLOC=y 28 28 CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config" 29 + CONFIG_CONSTRUCTORS=y 29 30 30 31 # 31 32 # General setup ··· 120 119 CONFIG_HAVE_KRETPROBES=y 121 120 CONFIG_HAVE_ARCH_TRACEHOOK=y 122 121 CONFIG_USE_GENERIC_SMP_HELPERS=y 122 + 123 + # 124 + # GCOV-based kernel profiling 125 + # 126 + # CONFIG_GCOV_KERNEL is not set 123 127 # CONFIG_SLOW_WORK is not set 124 128 # CONFIG_HAVE_GENERIC_DMA_COHERENT is not set 125 129 CONFIG_SLABINFO=y ··· 210 204 CONFIG_PHYS_ADDR_T_64BIT=y 211 205 CONFIG_ZONE_DMA_FLAG=0 212 206 CONFIG_NR_QUICK=1 213 - CONFIG_UNEVICTABLE_LRU=y 214 207 CONFIG_HAVE_MLOCK=y 215 208 CONFIG_HAVE_MLOCKED_PAGE_BIT=y 216 209 CONFIG_DEFAULT_MMAP_MIN_ADDR=8192 ··· 415 410 # 416 411 # CONFIG_EEPROM_AT24 is not set 417 412 # CONFIG_EEPROM_LEGACY is not set 413 + # CONFIG_EEPROM_MAX6875 is not set 418 414 # CONFIG_EEPROM_93CX6 is not set 419 415 # CONFIG_CB710_CORE is not set 420 416 CONFIG_HAVE_IDE=y ··· 568 562 CONFIG_DM_CRYPT=m 569 563 CONFIG_DM_SNAPSHOT=m 570 564 CONFIG_DM_MIRROR=m 565 + # CONFIG_DM_LOG_USERSPACE is not set 571 566 CONFIG_DM_ZERO=m 572 567 # CONFIG_DM_MULTIPATH is not set 573 568 # CONFIG_DM_DELAY is not set ··· 580 573 # 581 574 582 575 # 583 - # Enable only one of the two stacks, unless you know what you are doing 576 + # You can enable one or both FireWire driver stacks. 577 + # 578 + 579 + # 580 + # See the help texts for more information. 584 581 # 585 582 # CONFIG_FIREWIRE is not set 586 583 # CONFIG_IEEE1394 is not set ··· 678 667 # CONFIG_VIA_VELOCITY is not set 679 668 CONFIG_TIGON3=m 680 669 CONFIG_BNX2=m 670 + # CONFIG_CNIC is not set 681 671 # CONFIG_QLA3XXX is not set 682 672 # CONFIG_ATL1 is not set 683 673 # CONFIG_ATL1E is not set ··· 785 773 # CONFIG_MOUSE_APPLETOUCH is not set 786 774 # CONFIG_MOUSE_BCM5974 is not set 787 775 # CONFIG_MOUSE_VSXXXAA is not set 776 + # CONFIG_MOUSE_SYNAPTICS_I2C is not set 788 777 # CONFIG_INPUT_JOYSTICK is not set 789 778 # CONFIG_INPUT_TABLET is not set 790 779 # CONFIG_INPUT_TOUCHSCREEN is not set ··· 883 870 # 884 871 # I2C system bus drivers (mostly embedded / system-on-chip) 885 872 # 873 + # CONFIG_I2C_DESIGNWARE is not set 886 874 # CONFIG_I2C_OCORES is not set 887 875 # CONFIG_I2C_SIMTEC is not set 888 876 ··· 912 898 # CONFIG_SENSORS_PCF8574 is not set 913 899 # CONFIG_PCF8575 is not set 914 900 # CONFIG_SENSORS_PCA9539 is not set 915 - # CONFIG_SENSORS_MAX6875 is not set 916 901 # CONFIG_SENSORS_TSL2550 is not set 917 902 # CONFIG_I2C_DEBUG_CORE is not set 918 903 # CONFIG_I2C_DEBUG_ALGO is not set 919 904 # CONFIG_I2C_DEBUG_BUS is not set 920 905 # CONFIG_I2C_DEBUG_CHIP is not set 921 906 # CONFIG_SPI is not set 907 + 908 + # 909 + # PPS support 910 + # 911 + # CONFIG_PPS is not set 922 912 CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y 923 913 # CONFIG_GPIOLIB is not set 924 914 # CONFIG_W1 is not set ··· 977 959 # CONFIG_SENSORS_SMSC47B397 is not set 978 960 # CONFIG_SENSORS_ADS7828 is not set 979 961 # CONFIG_SENSORS_THMC50 is not set 962 + # CONFIG_SENSORS_TMP401 is not set 980 963 # CONFIG_SENSORS_VIA686A is not set 981 964 # CONFIG_SENSORS_VT1211 is not set 982 965 # CONFIG_SENSORS_VT8231 is not set ··· 1013 994 # CONFIG_MFD_WM8400 is not set 1014 995 # CONFIG_MFD_WM8350_I2C is not set 1015 996 # CONFIG_MFD_PCF50633 is not set 997 + # CONFIG_AB3100_CORE is not set 1016 998 # CONFIG_REGULATOR is not set 1017 - 1018 - # 1019 - # Multimedia devices 1020 - # 1021 - 1022 - # 1023 - # Multimedia core support 1024 - # 1025 - # CONFIG_VIDEO_DEV is not set 1026 - # CONFIG_DVB_CORE is not set 1027 - # CONFIG_VIDEO_MEDIA is not set 1028 - 1029 - # 1030 - # Multimedia drivers 1031 - # 1032 - # CONFIG_DAB is not set 999 + # CONFIG_MEDIA_SUPPORT is not set 1033 1000 1034 1001 # 1035 1002 # Graphics support ··· 1289 1284 # 1290 1285 # Miscellaneous USB options 1291 1286 # 1292 - CONFIG_USB_DEVICEFS=y 1293 1287 # CONFIG_USB_DEVICE_CLASS is not set 1294 1288 # CONFIG_USB_DYNAMIC_MINORS is not set 1295 1289 # CONFIG_USB_OTG is not set ··· 1300 1296 # USB Host Controller Drivers 1301 1297 # 1302 1298 # CONFIG_USB_C67X00_HCD is not set 1299 + # CONFIG_USB_XHCI_HCD is not set 1303 1300 CONFIG_USB_EHCI_HCD=m 1304 1301 # CONFIG_USB_EHCI_ROOT_HUB_TT is not set 1305 1302 # CONFIG_USB_EHCI_TT_NEWSCHED is not set ··· 1379 1374 # CONFIG_USB_LD is not set 1380 1375 # CONFIG_USB_TRANCEVIBRATOR is not set 1381 1376 # CONFIG_USB_IOWARRIOR is not set 1382 - # CONFIG_USB_TEST is not set 1383 1377 # CONFIG_USB_ISIGHTFW is not set 1384 1378 # CONFIG_USB_VST is not set 1385 1379 # CONFIG_USB_GADGET is not set ··· 1424 1420 # CONFIG_RTC_DRV_S35390A is not set 1425 1421 # CONFIG_RTC_DRV_FM3130 is not set 1426 1422 # CONFIG_RTC_DRV_RX8581 is not set 1423 + # CONFIG_RTC_DRV_RX8025 is not set 1427 1424 1428 1425 # 1429 1426 # SPI RTC drivers ··· 1453 1448 # CONFIG_DMADEVICES is not set 1454 1449 # CONFIG_AUXDISPLAY is not set 1455 1450 # CONFIG_UIO is not set 1451 + 1452 + # 1453 + # TI VLYNQ 1454 + # 1456 1455 # CONFIG_STAGING is not set 1457 1456 1458 1457 # ··· 1489 1480 # CONFIG_REISERFS_FS is not set 1490 1481 # CONFIG_JFS_FS is not set 1491 1482 CONFIG_FS_POSIX_ACL=y 1492 - CONFIG_FILE_LOCKING=y 1493 1483 # CONFIG_XFS_FS is not set 1494 1484 # CONFIG_GFS2_FS is not set 1495 1485 # CONFIG_OCFS2_FS is not set 1496 1486 # CONFIG_BTRFS_FS is not set 1487 + CONFIG_FILE_LOCKING=y 1497 1488 CONFIG_FSNOTIFY=y 1498 1489 CONFIG_DNOTIFY=y 1499 1490 CONFIG_INOTIFY=y ··· 1569 1560 # CONFIG_PARTITION_ADVANCED is not set 1570 1561 CONFIG_MSDOS_PARTITION=y 1571 1562 CONFIG_SUN_PARTITION=y 1572 - CONFIG_NLS=m 1563 + CONFIG_NLS=y 1573 1564 CONFIG_NLS_DEFAULT="iso8859-1" 1574 1565 # CONFIG_NLS_CODEPAGE_437 is not set 1575 1566 # CONFIG_NLS_CODEPAGE_737 is not set
+9 -3
arch/sparc/include/asm/pgtable_64.h
··· 726 726 extern pte_t pgoff_to_pte(unsigned long); 727 727 #define PTE_FILE_MAX_BITS (64UL - PAGE_SHIFT - 1UL) 728 728 729 - extern unsigned long *sparc64_valid_addr_bitmap; 729 + extern unsigned long sparc64_valid_addr_bitmap[]; 730 730 731 731 /* Needs to be defined here and not in linux/mm.h, as it is arch dependent */ 732 - #define kern_addr_valid(addr) \ 733 - (test_bit(__pa((unsigned long)(addr))>>22, sparc64_valid_addr_bitmap)) 732 + static inline bool kern_addr_valid(unsigned long addr) 733 + { 734 + unsigned long paddr = __pa(addr); 735 + 736 + if ((paddr >> 41UL) != 0UL) 737 + return false; 738 + return test_bit(paddr >> 22, sparc64_valid_addr_bitmap); 739 + } 734 740 735 741 extern int page_in_phys_avail(unsigned long paddr); 736 742
+38 -4
arch/sparc/kernel/ktlb.S
··· 151 151 * Must preserve %g1 and %g6 (TAG). 152 152 */ 153 153 kvmap_dtlb_tsb4m_miss: 154 - sethi %hi(kpte_linear_bitmap), %g2 154 + /* Clear the PAGE_OFFSET top virtual bits, shift 155 + * down to get PFN, and make sure PFN is in range. 156 + */ 157 + sllx %g4, 21, %g5 158 + 159 + /* Check to see if we know about valid memory at the 4MB 160 + * chunk this physical address will reside within. 161 + */ 162 + srlx %g5, 21 + 41, %g2 163 + brnz,pn %g2, kvmap_dtlb_longpath 164 + nop 165 + 166 + /* This unconditional branch and delay-slot nop gets patched 167 + * by the sethi sequence once the bitmap is properly setup. 168 + */ 169 + .globl valid_addr_bitmap_insn 170 + valid_addr_bitmap_insn: 171 + ba,pt %xcc, 2f 172 + nop 173 + .subsection 2 174 + .globl valid_addr_bitmap_patch 175 + valid_addr_bitmap_patch: 176 + sethi %hi(sparc64_valid_addr_bitmap), %g7 177 + or %g7, %lo(sparc64_valid_addr_bitmap), %g7 178 + .previous 179 + 180 + srlx %g5, 21 + 22, %g2 181 + srlx %g2, 6, %g5 182 + and %g2, 63, %g2 183 + sllx %g5, 3, %g5 184 + ldx [%g7 + %g5], %g5 185 + mov 1, %g7 186 + sllx %g7, %g2, %g7 187 + andcc %g5, %g7, %g0 188 + be,pn %xcc, kvmap_dtlb_longpath 189 + 190 + 2: sethi %hi(kpte_linear_bitmap), %g2 155 191 or %g2, %lo(kpte_linear_bitmap), %g2 156 192 157 - /* Clear the PAGE_OFFSET top virtual bits, then shift 158 - * down to get a 256MB physical address index. 159 - */ 193 + /* Get the 256MB physical address index. */ 160 194 sllx %g4, 21, %g5 161 195 mov 1, %g7 162 196 srlx %g5, 21 + 28, %g5
-22
arch/sparc/kernel/sun4d_smp.c
··· 162 162 */ 163 163 164 164 extern struct linux_prom_registers smp_penguin_ctable; 165 - extern unsigned long trapbase_cpu1[]; 166 - extern unsigned long trapbase_cpu2[]; 167 - extern unsigned long trapbase_cpu3[]; 168 165 169 166 void __init smp4d_boot_cpus(void) 170 167 { ··· 231 234 } 232 235 *prev = first; 233 236 local_flush_cache_all(); 234 - 235 - /* Free unneeded trap tables */ 236 - ClearPageReserved(virt_to_page(trapbase_cpu1)); 237 - init_page_count(virt_to_page(trapbase_cpu1)); 238 - free_page((unsigned long)trapbase_cpu1); 239 - totalram_pages++; 240 - num_physpages++; 241 - 242 - ClearPageReserved(virt_to_page(trapbase_cpu2)); 243 - init_page_count(virt_to_page(trapbase_cpu2)); 244 - free_page((unsigned long)trapbase_cpu2); 245 - totalram_pages++; 246 - num_physpages++; 247 - 248 - ClearPageReserved(virt_to_page(trapbase_cpu3)); 249 - init_page_count(virt_to_page(trapbase_cpu3)); 250 - free_page((unsigned long)trapbase_cpu3); 251 - totalram_pages++; 252 - num_physpages++; 253 237 254 238 /* Ok, they are spinning and ready to go. */ 255 239 smp_processors_ready = 1;
-26
arch/sparc/kernel/sun4m_smp.c
··· 121 121 */ 122 122 123 123 extern struct linux_prom_registers smp_penguin_ctable; 124 - extern unsigned long trapbase_cpu1[]; 125 - extern unsigned long trapbase_cpu2[]; 126 - extern unsigned long trapbase_cpu3[]; 127 124 128 125 void __init smp4m_boot_cpus(void) 129 126 { ··· 189 192 } 190 193 *prev = first; 191 194 local_flush_cache_all(); 192 - 193 - /* Free unneeded trap tables */ 194 - if (!cpu_isset(1, cpu_present_map)) { 195 - ClearPageReserved(virt_to_page(trapbase_cpu1)); 196 - init_page_count(virt_to_page(trapbase_cpu1)); 197 - free_page((unsigned long)trapbase_cpu1); 198 - totalram_pages++; 199 - num_physpages++; 200 - } 201 - if (!cpu_isset(2, cpu_present_map)) { 202 - ClearPageReserved(virt_to_page(trapbase_cpu2)); 203 - init_page_count(virt_to_page(trapbase_cpu2)); 204 - free_page((unsigned long)trapbase_cpu2); 205 - totalram_pages++; 206 - num_physpages++; 207 - } 208 - if (!cpu_isset(3, cpu_present_map)) { 209 - ClearPageReserved(virt_to_page(trapbase_cpu3)); 210 - init_page_count(virt_to_page(trapbase_cpu3)); 211 - free_page((unsigned long)trapbase_cpu3); 212 - totalram_pages++; 213 - num_physpages++; 214 - } 215 195 216 196 /* Ok, they are spinning and ready to go. */ 217 197 }
+3 -1
arch/sparc/kernel/sys32.S
··· 134 134 SIGN1(sys32_getsockname, sys_getsockname, %o0) 135 135 SIGN2(sys32_ioprio_get, sys_ioprio_get, %o0, %o1) 136 136 SIGN3(sys32_ioprio_set, sys_ioprio_set, %o0, %o1, %o2) 137 - SIGN2(sys32_splice, sys_splice, %o0, %o1) 137 + SIGN2(sys32_splice, sys_splice, %o0, %o2) 138 138 SIGN2(sys32_sync_file_range, compat_sync_file_range, %o0, %o5) 139 139 SIGN2(sys32_tee, sys_tee, %o0, %o1) 140 140 SIGN1(sys32_vmsplice, compat_sys_vmsplice, %o0) 141 + SIGN1(sys32_truncate, sys_truncate, %o1) 142 + SIGN1(sys32_ftruncate, sys_ftruncate, %o1) 141 143 142 144 .globl sys32_mmap2 143 145 sys32_mmap2:
+2 -2
arch/sparc/kernel/systbls_64.S
··· 43 43 /*110*/ .word sys_setresgid, sys_getresgid, sys_setregid, sys_nis_syscall, sys_nis_syscall 44 44 .word sys32_getgroups, compat_sys_gettimeofday, sys32_getrusage, sys_nis_syscall, sys_getcwd 45 45 /*120*/ .word compat_sys_readv, compat_sys_writev, compat_sys_settimeofday, sys_fchown16, sys_fchmod 46 - .word sys_nis_syscall, sys_setreuid16, sys_setregid16, sys_rename, sys_truncate 47 - /*130*/ .word sys_ftruncate, sys_flock, compat_sys_lstat64, sys_nis_syscall, sys_nis_syscall 46 + .word sys_nis_syscall, sys_setreuid16, sys_setregid16, sys_rename, sys32_truncate 47 + /*130*/ .word sys32_ftruncate, sys_flock, compat_sys_lstat64, sys_nis_syscall, sys_nis_syscall 48 48 .word sys_nis_syscall, sys32_mkdir, sys_rmdir, compat_sys_utimes, compat_sys_stat64 49 49 /*140*/ .word sys32_sendfile64, sys_nis_syscall, sys32_futex, sys_gettid, compat_sys_getrlimit 50 50 .word compat_sys_setrlimit, sys_pivot_root, sys32_prctl, sys_pciconfig_read, sys_pciconfig_write
+4 -3
arch/sparc/mm/fault_32.c
··· 319 319 */ 320 320 out_of_memory: 321 321 up_read(&mm->mmap_sem); 322 - printk("VM: killing process %s\n", tsk->comm); 323 - if (from_user) 324 - do_group_exit(SIGKILL); 322 + if (from_user) { 323 + pagefault_out_of_memory(); 324 + return; 325 + } 325 326 goto no_context; 326 327 327 328 do_sigbus:
+4 -3
arch/sparc/mm/fault_64.c
··· 447 447 out_of_memory: 448 448 insn = get_fault_insn(regs, insn); 449 449 up_read(&mm->mmap_sem); 450 - printk("VM: killing process %s\n", current->comm); 451 - if (!(regs->tstate & TSTATE_PRIV)) 452 - do_group_exit(SIGKILL); 450 + if (!(regs->tstate & TSTATE_PRIV)) { 451 + pagefault_out_of_memory(); 452 + return; 453 + } 453 454 goto handle_kernel_fault; 454 455 455 456 intr_or_no_mm:
+24 -19
arch/sparc/mm/init_64.c
··· 145 145 cmp_p64, NULL); 146 146 } 147 147 148 - unsigned long *sparc64_valid_addr_bitmap __read_mostly; 148 + unsigned long sparc64_valid_addr_bitmap[VALID_ADDR_BITMAP_BYTES / 149 + sizeof(unsigned long)]; 149 150 EXPORT_SYMBOL(sparc64_valid_addr_bitmap); 150 151 151 152 /* Kernel physical address base and size in bytes. */ ··· 1875 1874 * memory list again, and make sure it provides at least as much 1876 1875 * memory as 'pavail' does. 1877 1876 */ 1878 - static void __init setup_valid_addr_bitmap_from_pavail(void) 1877 + static void __init setup_valid_addr_bitmap_from_pavail(unsigned long *bitmap) 1879 1878 { 1880 1879 int i; 1881 1880 ··· 1898 1897 1899 1898 if (new_start <= old_start && 1900 1899 new_end >= (old_start + PAGE_SIZE)) { 1901 - set_bit(old_start >> 22, 1902 - sparc64_valid_addr_bitmap); 1900 + set_bit(old_start >> 22, bitmap); 1903 1901 goto do_next_page; 1904 1902 } 1905 1903 } ··· 1919 1919 } 1920 1920 } 1921 1921 1922 + static void __init patch_tlb_miss_handler_bitmap(void) 1923 + { 1924 + extern unsigned int valid_addr_bitmap_insn[]; 1925 + extern unsigned int valid_addr_bitmap_patch[]; 1926 + 1927 + valid_addr_bitmap_insn[1] = valid_addr_bitmap_patch[1]; 1928 + mb(); 1929 + valid_addr_bitmap_insn[0] = valid_addr_bitmap_patch[0]; 1930 + flushi(&valid_addr_bitmap_insn[0]); 1931 + } 1932 + 1922 1933 void __init mem_init(void) 1923 1934 { 1924 1935 unsigned long codepages, datapages, initpages; 1925 1936 unsigned long addr, last; 1926 - int i; 1927 - 1928 - i = last_valid_pfn >> ((22 - PAGE_SHIFT) + 6); 1929 - i += 1; 1930 - sparc64_valid_addr_bitmap = (unsigned long *) alloc_bootmem(i << 3); 1931 - if (sparc64_valid_addr_bitmap == NULL) { 1932 - prom_printf("mem_init: Cannot alloc valid_addr_bitmap.\n"); 1933 - prom_halt(); 1934 - } 1935 - memset(sparc64_valid_addr_bitmap, 0, i << 3); 1936 1937 1937 1938 addr = PAGE_OFFSET + kern_base; 1938 1939 last = PAGE_ALIGN(kern_size) + addr; ··· 1942 1941 addr += PAGE_SIZE; 1943 1942 } 1944 1943 1945 - setup_valid_addr_bitmap_from_pavail(); 1944 + setup_valid_addr_bitmap_from_pavail(sparc64_valid_addr_bitmap); 1945 + patch_tlb_miss_handler_bitmap(); 1946 1946 1947 1947 high_memory = __va(last_valid_pfn << PAGE_SHIFT); 1948 1948 1949 1949 #ifdef CONFIG_NEED_MULTIPLE_NODES 1950 - for_each_online_node(i) { 1951 - if (NODE_DATA(i)->node_spanned_pages != 0) { 1952 - totalram_pages += 1953 - free_all_bootmem_node(NODE_DATA(i)); 1950 + { 1951 + int i; 1952 + for_each_online_node(i) { 1953 + if (NODE_DATA(i)->node_spanned_pages != 0) { 1954 + totalram_pages += 1955 + free_all_bootmem_node(NODE_DATA(i)); 1956 + } 1954 1957 } 1955 1958 } 1956 1959 #else
+5 -2
arch/sparc/mm/init_64.h
··· 5 5 * marked non-static so that assembler code can get at them. 6 6 */ 7 7 8 - #define MAX_PHYS_ADDRESS (1UL << 42UL) 9 - #define KPTE_BITMAP_CHUNK_SZ (256UL * 1024UL * 1024UL) 8 + #define MAX_PHYS_ADDRESS (1UL << 41UL) 9 + #define KPTE_BITMAP_CHUNK_SZ (256UL * 1024UL * 1024UL) 10 10 #define KPTE_BITMAP_BYTES \ 11 11 ((MAX_PHYS_ADDRESS / KPTE_BITMAP_CHUNK_SZ) / 8) 12 + #define VALID_ADDR_BITMAP_CHUNK_SZ (4UL * 1024UL * 1024UL) 13 + #define VALID_ADDR_BITMAP_BYTES \ 14 + ((MAX_PHYS_ADDRESS / VALID_ADDR_BITMAP_CHUNK_SZ) / 8) 12 15 13 16 extern unsigned long kern_linear_pte_xor[2]; 14 17 extern unsigned long kpte_linear_bitmap[KPTE_BITMAP_BYTES / sizeof(unsigned long)];
+1 -1
arch/x86/boot/compressed/Makefile
··· 4 4 # create a compressed vmlinux image from the original vmlinux 5 5 # 6 6 7 - targets := vmlinux vmlinux.bin vmlinux.bin.gz vmlinux.bin.bz2 vmlinux.bin.lzma head_$(BITS).o misc.o piggy.o 7 + targets := vmlinux.lds vmlinux vmlinux.bin vmlinux.bin.gz vmlinux.bin.bz2 vmlinux.bin.lzma head_$(BITS).o misc.o piggy.o 8 8 9 9 KBUILD_CFLAGS := -m$(BITS) -D__KERNEL__ $(LINUX_INCLUDE) -O2 10 10 KBUILD_CFLAGS += -fno-strict-aliasing -fPIC
+10 -2
arch/x86/include/asm/pgtable.h
··· 2 2 #define _ASM_X86_PGTABLE_H 3 3 4 4 #include <asm/page.h> 5 + #include <asm/e820.h> 5 6 6 7 #include <asm/pgtable_types.h> 7 8 ··· 270 269 271 270 #define canon_pgprot(p) __pgprot(massage_pgprot(p)) 272 271 273 - static inline int is_new_memtype_allowed(unsigned long flags, 274 - unsigned long new_flags) 272 + static inline int is_new_memtype_allowed(u64 paddr, unsigned long size, 273 + unsigned long flags, 274 + unsigned long new_flags) 275 275 { 276 + /* 277 + * PAT type is always WB for ISA. So no need to check. 278 + */ 279 + if (is_ISA_range(paddr, paddr + size - 1)) 280 + return 1; 281 + 276 282 /* 277 283 * Certain new memtypes are not allowed with certain 278 284 * requested memtype:
+3
arch/x86/kernel/apic/ipi.c
··· 106 106 unsigned long mask = cpumask_bits(cpumask)[0]; 107 107 unsigned long flags; 108 108 109 + if (WARN_ONCE(!mask, "empty IPI mask")) 110 + return; 111 + 109 112 local_irq_save(flags); 110 113 WARN_ON(mask & ~cpumask_bits(cpu_online_mask)[0]); 111 114 __default_send_IPI_dest_field(mask, vector, apic->dest_logical);
+10
arch/x86/kernel/apic/probe_64.c
··· 44 44 NULL, 45 45 }; 46 46 47 + static int apicid_phys_pkg_id(int initial_apic_id, int index_msb) 48 + { 49 + return hard_smp_processor_id() >> index_msb; 50 + } 51 + 47 52 /* 48 53 * Check the APIC IDs in bios_cpu_apicid and choose the APIC mode. 49 54 */ ··· 72 67 if (max_physical_apicid >= 8) 73 68 apic = &apic_physflat; 74 69 printk(KERN_INFO "Setting APIC routing to %s\n", apic->name); 70 + } 71 + 72 + if (is_vsmp_box()) { 73 + /* need to update phys_pkg_id */ 74 + apic->phys_pkg_id = apicid_phys_pkg_id; 75 75 } 76 76 77 77 /*
+4
arch/x86/kernel/cpu/Makefile
··· 7 7 CFLAGS_REMOVE_common.o = -pg 8 8 endif 9 9 10 + # Make sure load_percpu_segment has no stackprotector 11 + nostackp := $(call cc-option, -fno-stack-protector) 12 + CFLAGS_common.o := $(nostackp) 13 + 10 14 obj-y := intel_cacheinfo.o addon_cpuid_features.o 11 15 obj-y += proc.o capflags.o powerflags.o common.o 12 16 obj-y += vmware.o hypervisor.o
+1 -7
arch/x86/kernel/head_32.S
··· 261 261 * which will be freed later 262 262 */ 263 263 264 - #ifndef CONFIG_HOTPLUG_CPU 265 - .section .init.text,"ax",@progbits 266 - #endif 264 + __CPUINIT 267 265 268 266 #ifdef CONFIG_SMP 269 267 ENTRY(startup_32_smp) ··· 600 602 #endif 601 603 iret 602 604 603 - #ifndef CONFIG_HOTPLUG_CPU 604 - __CPUINITDATA 605 - #else 606 605 __REFDATA 607 - #endif 608 606 .align 4 609 607 ENTRY(initial_code) 610 608 .long i386_start_kernel
+1 -5
arch/x86/kernel/process.c
··· 519 519 if (!cpumask_test_cpu(cpu, c1e_mask)) { 520 520 cpumask_set_cpu(cpu, c1e_mask); 521 521 /* 522 - * Force broadcast so ACPI can not interfere. Needs 523 - * to run with interrupts enabled as it uses 524 - * smp_function_call. 522 + * Force broadcast so ACPI can not interfere. 525 523 */ 526 - local_irq_enable(); 527 524 clockevents_notify(CLOCK_EVT_NOTIFY_BROADCAST_FORCE, 528 525 &cpu); 529 526 printk(KERN_INFO "Switch to broadcast mode on CPU%d\n", 530 527 cpu); 531 - local_irq_disable(); 532 528 } 533 529 clockevents_notify(CLOCK_EVT_NOTIFY_BROADCAST_ENTER, &cpu); 534 530
+54 -86
arch/x86/kernel/vmlinux.lds.S
··· 46 46 data PT_LOAD FLAGS(7); /* RWE */ 47 47 #ifdef CONFIG_X86_64 48 48 user PT_LOAD FLAGS(7); /* RWE */ 49 - data.init PT_LOAD FLAGS(7); /* RWE */ 50 49 #ifdef CONFIG_SMP 51 50 percpu PT_LOAD FLAGS(7); /* RWE */ 52 51 #endif 53 - data.init2 PT_LOAD FLAGS(7); /* RWE */ 52 + init PT_LOAD FLAGS(7); /* RWE */ 54 53 #endif 55 54 note PT_NOTE FLAGS(0); /* ___ */ 56 55 } ··· 102 103 __stop___ex_table = .; 103 104 } :text = 0x9090 104 105 105 - RODATA 106 + RO_DATA(PAGE_SIZE) 106 107 107 108 /* Data */ 108 - . = ALIGN(PAGE_SIZE); 109 109 .data : AT(ADDR(.data) - LOAD_OFFSET) { 110 110 /* Start of data section */ 111 111 _sdata = .; 112 + 113 + /* init_task */ 114 + INIT_TASK_DATA(THREAD_SIZE) 115 + 116 + #ifdef CONFIG_X86_32 117 + /* 32 bit has nosave before _edata */ 118 + NOSAVE_DATA 119 + #endif 120 + 121 + PAGE_ALIGNED_DATA(PAGE_SIZE) 122 + *(.data.idt) 123 + 124 + CACHELINE_ALIGNED_DATA(CONFIG_X86_L1_CACHE_BYTES) 125 + 112 126 DATA_DATA 113 127 CONSTRUCTORS 114 - } :data 115 128 116 - #ifdef CONFIG_X86_32 117 - /* 32 bit has nosave before _edata */ 118 - . = ALIGN(PAGE_SIZE); 119 - .data_nosave : AT(ADDR(.data_nosave) - LOAD_OFFSET) { 120 - __nosave_begin = .; 121 - *(.data.nosave) 122 - . = ALIGN(PAGE_SIZE); 123 - __nosave_end = .; 124 - } 125 - #endif 126 - 127 - . = ALIGN(PAGE_SIZE); 128 - .data.page_aligned : AT(ADDR(.data.page_aligned) - LOAD_OFFSET) { 129 - *(.data.page_aligned) 130 - *(.data.idt) 131 - } 132 - 133 - #ifdef CONFIG_X86_32 134 - . = ALIGN(32); 135 - #else 136 - . = ALIGN(PAGE_SIZE); 137 - . = ALIGN(CONFIG_X86_L1_CACHE_BYTES); 138 - #endif 139 - .data.cacheline_aligned : 140 - AT(ADDR(.data.cacheline_aligned) - LOAD_OFFSET) { 141 - *(.data.cacheline_aligned) 142 - } 143 - 144 - /* rarely changed data like cpu maps */ 145 - #ifdef CONFIG_X86_32 146 - . = ALIGN(32); 147 - #else 148 - . = ALIGN(CONFIG_X86_INTERNODE_CACHE_BYTES); 149 - #endif 150 - .data.read_mostly : AT(ADDR(.data.read_mostly) - LOAD_OFFSET) { 151 - *(.data.read_mostly) 129 + /* rarely changed data like cpu maps */ 130 + READ_MOSTLY_DATA(CONFIG_X86_INTERNODE_CACHE_BYTES) 152 131 153 132 /* End of data section */ 154 133 _edata = .; 155 - } 134 + } :data 156 135 157 136 #ifdef CONFIG_X86_64 158 137 159 138 #define VSYSCALL_ADDR (-10*1024*1024) 160 - #define VSYSCALL_PHYS_ADDR ((LOADADDR(.data.read_mostly) + \ 161 - SIZEOF(.data.read_mostly) + 4095) & ~(4095)) 162 - #define VSYSCALL_VIRT_ADDR ((ADDR(.data.read_mostly) + \ 163 - SIZEOF(.data.read_mostly) + 4095) & ~(4095)) 139 + #define VSYSCALL_PHYS_ADDR ((LOADADDR(.data) + SIZEOF(.data) + \ 140 + PAGE_SIZE - 1) & ~(PAGE_SIZE - 1)) 141 + #define VSYSCALL_VIRT_ADDR ((ADDR(.data) + SIZEOF(.data) + \ 142 + PAGE_SIZE - 1) & ~(PAGE_SIZE - 1)) 164 143 165 144 #define VLOAD_OFFSET (VSYSCALL_ADDR - VSYSCALL_PHYS_ADDR) 166 145 #define VLOAD(x) (ADDR(x) - VLOAD_OFFSET) ··· 204 227 205 228 #endif /* CONFIG_X86_64 */ 206 229 207 - /* init_task */ 208 - . = ALIGN(THREAD_SIZE); 209 - .data.init_task : AT(ADDR(.data.init_task) - LOAD_OFFSET) { 210 - *(.data.init_task) 211 - } 212 - #ifdef CONFIG_X86_64 213 - :data.init 214 - #endif 215 - 216 - /* 217 - * smp_locks might be freed after init 218 - * start/end must be page aligned 219 - */ 220 - . = ALIGN(PAGE_SIZE); 221 - .smp_locks : AT(ADDR(.smp_locks) - LOAD_OFFSET) { 222 - __smp_locks = .; 223 - *(.smp_locks) 224 - __smp_locks_end = .; 225 - . = ALIGN(PAGE_SIZE); 226 - } 227 - 228 230 /* Init code and data - will be freed after init */ 229 231 . = ALIGN(PAGE_SIZE); 230 - .init.text : AT(ADDR(.init.text) - LOAD_OFFSET) { 232 + .init.begin : AT(ADDR(.init.begin) - LOAD_OFFSET) { 231 233 __init_begin = .; /* paired with __init_end */ 234 + } 235 + 236 + #if defined(CONFIG_X86_64) && defined(CONFIG_SMP) 237 + /* 238 + * percpu offsets are zero-based on SMP. PERCPU_VADDR() changes the 239 + * output PHDR, so the next output section - .init.text - should 240 + * start another segment - init. 241 + */ 242 + PERCPU_VADDR(0, :percpu) 243 + #endif 244 + 245 + .init.text : AT(ADDR(.init.text) - LOAD_OFFSET) { 232 246 _sinittext = .; 233 247 INIT_TEXT 234 248 _einittext = .; 235 249 } 250 + #ifdef CONFIG_X86_64 251 + :init 252 + #endif 236 253 237 254 .init.data : AT(ADDR(.init.data) - LOAD_OFFSET) { 238 255 INIT_DATA ··· 297 326 } 298 327 #endif 299 328 300 - #if defined(CONFIG_X86_64) && defined(CONFIG_SMP) 301 - /* 302 - * percpu offsets are zero-based on SMP. PERCPU_VADDR() changes the 303 - * output PHDR, so the next output section - __data_nosave - should 304 - * start another section data.init2. Also, pda should be at the head of 305 - * percpu area. Preallocate it and define the percpu offset symbol 306 - * so that it can be accessed as a percpu variable. 307 - */ 308 - . = ALIGN(PAGE_SIZE); 309 - PERCPU_VADDR(0, :percpu) 310 - #else 329 + #if !defined(CONFIG_X86_64) || !defined(CONFIG_SMP) 311 330 PERCPU(PAGE_SIZE) 312 331 #endif 313 332 ··· 308 347 __init_end = .; 309 348 } 310 349 350 + /* 351 + * smp_locks might be freed after init 352 + * start/end must be page aligned 353 + */ 354 + . = ALIGN(PAGE_SIZE); 355 + .smp_locks : AT(ADDR(.smp_locks) - LOAD_OFFSET) { 356 + __smp_locks = .; 357 + *(.smp_locks) 358 + __smp_locks_end = .; 359 + . = ALIGN(PAGE_SIZE); 360 + } 361 + 311 362 #ifdef CONFIG_X86_64 312 363 .data_nosave : AT(ADDR(.data_nosave) - LOAD_OFFSET) { 313 - . = ALIGN(PAGE_SIZE); 314 - __nosave_begin = .; 315 - *(.data.nosave) 316 - . = ALIGN(PAGE_SIZE); 317 - __nosave_end = .; 318 - } :data.init2 319 - /* use another section data.init2, see PERCPU_VADDR() above */ 364 + NOSAVE_DATA 365 + } 320 366 #endif 321 367 322 368 /* BSS */
+1 -1
arch/x86/mm/init_64.c
··· 796 796 return ret; 797 797 798 798 #else 799 - reserve_bootmem(phys, len, BOOTMEM_DEFAULT); 799 + reserve_bootmem(phys, len, flags); 800 800 #endif 801 801 802 802 if (phys+len <= MAX_DMA_PFN*PAGE_SIZE) {
+2 -1
arch/x86/mm/pat.c
··· 623 623 return ret; 624 624 625 625 if (flags != want_flags) { 626 - if (strict_prot || !is_new_memtype_allowed(want_flags, flags)) { 626 + if (strict_prot || 627 + !is_new_memtype_allowed(paddr, size, want_flags, flags)) { 627 628 free_memtype(paddr, paddr + size); 628 629 printk(KERN_ERR "%s:%d map pfn expected mapping type %s" 629 630 " for %Lx-%Lx, got %s\n",
+10 -11
arch/x86/mm/tlb.c
··· 183 183 184 184 f->flush_mm = mm; 185 185 f->flush_va = va; 186 - cpumask_andnot(to_cpumask(f->flush_cpumask), 187 - cpumask, cpumask_of(smp_processor_id())); 186 + if (cpumask_andnot(to_cpumask(f->flush_cpumask), cpumask, cpumask_of(smp_processor_id()))) { 187 + /* 188 + * We have to send the IPI only to 189 + * CPUs affected. 190 + */ 191 + apic->send_IPI_mask(to_cpumask(f->flush_cpumask), 192 + INVALIDATE_TLB_VECTOR_START + sender); 188 193 189 - /* 190 - * We have to send the IPI only to 191 - * CPUs affected. 192 - */ 193 - apic->send_IPI_mask(to_cpumask(f->flush_cpumask), 194 - INVALIDATE_TLB_VECTOR_START + sender); 195 - 196 - while (!cpumask_empty(to_cpumask(f->flush_cpumask))) 197 - cpu_relax(); 194 + while (!cpumask_empty(to_cpumask(f->flush_cpumask))) 195 + cpu_relax(); 196 + } 198 197 199 198 f->flush_mm = NULL; 200 199 f->flush_va = 0;
+4
arch/x86/xen/Makefile
··· 5 5 CFLAGS_REMOVE_irq.o = -pg 6 6 endif 7 7 8 + # Make sure early boot has no stackprotector 9 + nostackp := $(call cc-option, -fno-stack-protector) 10 + CFLAGS_enlighten.o := $(nostackp) 11 + 8 12 obj-y := enlighten.o setup.o multicalls.o mmu.o irq.o \ 9 13 time.o xen-asm.o xen-asm_$(BITS).o \ 10 14 grant-table.o suspend.o
+12 -12
arch/x86/xen/enlighten.c
··· 215 215 (1 << X86_FEATURE_ACPI)); /* disable ACPI */ 216 216 217 217 ax = 1; 218 + cx = 0; 218 219 xen_cpuid(&ax, &bx, &cx, &dx); 219 220 220 221 /* cpuid claims we support xsave; try enabling it to see what happens */ ··· 975 974 976 975 xen_domain_type = XEN_PV_DOMAIN; 977 976 978 - BUG_ON(memcmp(xen_start_info->magic, "xen-3", 5) != 0); 979 - 980 - xen_setup_features(); 981 - 982 977 /* Install Xen paravirt ops */ 983 978 pv_info = xen_info; 984 979 pv_init_ops = xen_init_ops; ··· 983 986 pv_apic_ops = xen_apic_ops; 984 987 pv_mmu_ops = xen_mmu_ops; 985 988 986 - xen_init_irq_ops(); 989 + #ifdef CONFIG_X86_64 990 + /* 991 + * Setup percpu state. We only need to do this for 64-bit 992 + * because 32-bit already has %fs set properly. 993 + */ 994 + load_percpu_segment(0); 995 + #endif 987 996 997 + xen_init_irq_ops(); 988 998 xen_init_cpuid_mask(); 989 999 990 1000 #ifdef CONFIG_X86_LOCAL_APIC ··· 1001 997 set_xen_basic_apic_ops(); 1002 998 #endif 1003 999 1000 + xen_setup_features(); 1001 + 1004 1002 if (xen_feature(XENFEAT_mmu_pt_update_preserve_ad)) { 1005 1003 pv_mmu_ops.ptep_modify_prot_start = xen_ptep_modify_prot_start; 1006 1004 pv_mmu_ops.ptep_modify_prot_commit = xen_ptep_modify_prot_commit; ··· 1010 1004 1011 1005 machine_ops = xen_machine_ops; 1012 1006 1013 - #ifdef CONFIG_X86_64 1014 - /* 1015 - * Setup percpu state. We only need to do this for 64-bit 1016 - * because 32-bit already has %fs set properly. 1017 - */ 1018 - load_percpu_segment(0); 1019 - #endif 1020 1007 /* 1021 1008 * The only reliable way to retain the initial address of the 1022 1009 * percpu gdt_page is to remember it here, so we can go and ··· 1060 1061 /* set up basic CPUID stuff */ 1061 1062 cpu_detect(&new_cpu_data); 1062 1063 new_cpu_data.hard_math = 1; 1064 + new_cpu_data.wp_works_ok = 1; 1063 1065 new_cpu_data.x86_capability[0] = cpuid_edx(1); 1064 1066 #endif 1065 1067
+12
drivers/acpi/acpica/exstorob.c
··· 70 70 71 71 ACPI_FUNCTION_TRACE_PTR(ex_store_buffer_to_buffer, source_desc); 72 72 73 + /* If Source and Target are the same, just return */ 74 + 75 + if (source_desc == target_desc) { 76 + return_ACPI_STATUS(AE_OK); 77 + } 78 + 73 79 /* We know that source_desc is a buffer by now */ 74 80 75 81 buffer = ACPI_CAST_PTR(u8, source_desc->buffer.pointer); ··· 166 160 u8 *buffer; 167 161 168 162 ACPI_FUNCTION_TRACE_PTR(ex_store_string_to_string, source_desc); 163 + 164 + /* If Source and Target are the same, just return */ 165 + 166 + if (source_desc == target_desc) { 167 + return_ACPI_STATUS(AE_OK); 168 + } 169 169 170 170 /* We know that source_desc is a string by now */ 171 171
+6
drivers/acpi/processor_core.c
··· 1151 1151 { 1152 1152 int result = 0; 1153 1153 1154 + if (acpi_disabled) 1155 + return 0; 1156 + 1154 1157 memset(&errata, 0, sizeof(errata)); 1155 1158 1156 1159 #ifdef CONFIG_SMP ··· 1200 1197 1201 1198 static void __exit acpi_processor_exit(void) 1202 1199 { 1200 + if (acpi_disabled) 1201 + return; 1202 + 1203 1203 acpi_processor_ppc_exit(); 1204 1204 1205 1205 acpi_thermal_cpufreq_exit();
+4 -2
drivers/acpi/processor_idle.c
··· 162 162 pr->power.timer_broadcast_on_state = state; 163 163 } 164 164 165 - static void lapic_timer_propagate_broadcast(struct acpi_processor *pr) 165 + static void lapic_timer_propagate_broadcast(void *arg) 166 166 { 167 + struct acpi_processor *pr = (struct acpi_processor *) arg; 167 168 unsigned long reason; 168 169 169 170 reason = pr->power.timer_broadcast_on_state < INT_MAX ? ··· 636 635 working++; 637 636 } 638 637 639 - lapic_timer_propagate_broadcast(pr); 638 + smp_call_function_single(pr->id, lapic_timer_propagate_broadcast, 639 + pr, 1); 640 640 641 641 return (working); 642 642 }
+3 -3
drivers/acpi/processor_thermal.c
··· 66 66 if (pr->limit.thermal.tx > tx) 67 67 tx = pr->limit.thermal.tx; 68 68 69 - result = acpi_processor_set_throttling(pr, tx); 69 + result = acpi_processor_set_throttling(pr, tx, false); 70 70 if (result) 71 71 goto end; 72 72 } ··· 421 421 422 422 if (state <= max_pstate) { 423 423 if (pr->flags.throttling && pr->throttling.state) 424 - result = acpi_processor_set_throttling(pr, 0); 424 + result = acpi_processor_set_throttling(pr, 0, false); 425 425 cpufreq_set_cur_state(pr->id, state); 426 426 } else { 427 427 cpufreq_set_cur_state(pr->id, max_pstate); 428 428 result = acpi_processor_set_throttling(pr, 429 - state - max_pstate); 429 + state - max_pstate, false); 430 430 } 431 431 return result; 432 432 }
+16 -14
drivers/acpi/processor_throttling.c
··· 62 62 #define THROTTLING_POSTCHANGE (2) 63 63 64 64 static int acpi_processor_get_throttling(struct acpi_processor *pr); 65 - int acpi_processor_set_throttling(struct acpi_processor *pr, int state); 65 + int acpi_processor_set_throttling(struct acpi_processor *pr, 66 + int state, bool force); 66 67 67 68 static int acpi_processor_update_tsd_coord(void) 68 69 { ··· 362 361 */ 363 362 target_state = throttling_limit; 364 363 } 365 - return acpi_processor_set_throttling(pr, target_state); 364 + return acpi_processor_set_throttling(pr, target_state, false); 366 365 } 367 366 368 367 /* ··· 840 839 if (ret >= 0) { 841 840 state = acpi_get_throttling_state(pr, value); 842 841 if (state == -1) { 843 - ACPI_WARNING((AE_INFO, 844 - "Invalid throttling state, reset")); 842 + ACPI_DEBUG_PRINT((ACPI_DB_INFO, 843 + "Invalid throttling state, reset\n")); 845 844 state = 0; 846 - ret = acpi_processor_set_throttling(pr, state); 845 + ret = acpi_processor_set_throttling(pr, state, true); 847 846 if (ret) 848 847 return ret; 849 848 } ··· 916 915 } 917 916 918 917 static int acpi_processor_set_throttling_fadt(struct acpi_processor *pr, 919 - int state) 918 + int state, bool force) 920 919 { 921 920 u32 value = 0; 922 921 u32 duty_mask = 0; ··· 931 930 if (!pr->flags.throttling) 932 931 return -ENODEV; 933 932 934 - if (state == pr->throttling.state) 933 + if (!force && (state == pr->throttling.state)) 935 934 return 0; 936 935 937 936 if (state < pr->throttling_platform_limit) ··· 989 988 } 990 989 991 990 static int acpi_processor_set_throttling_ptc(struct acpi_processor *pr, 992 - int state) 991 + int state, bool force) 993 992 { 994 993 int ret; 995 994 acpi_integer value; ··· 1003 1002 if (!pr->flags.throttling) 1004 1003 return -ENODEV; 1005 1004 1006 - if (state == pr->throttling.state) 1005 + if (!force && (state == pr->throttling.state)) 1007 1006 return 0; 1008 1007 1009 1008 if (state < pr->throttling_platform_limit) ··· 1019 1018 return 0; 1020 1019 } 1021 1020 1022 - int acpi_processor_set_throttling(struct acpi_processor *pr, int state) 1021 + int acpi_processor_set_throttling(struct acpi_processor *pr, 1022 + int state, bool force) 1023 1023 { 1024 1024 cpumask_var_t saved_mask; 1025 1025 int ret = 0; ··· 1072 1070 /* FIXME: use work_on_cpu() */ 1073 1071 set_cpus_allowed_ptr(current, cpumask_of(pr->id)); 1074 1072 ret = p_throttling->acpi_processor_set_throttling(pr, 1075 - t_state.target_state); 1073 + t_state.target_state, force); 1076 1074 } else { 1077 1075 /* 1078 1076 * When the T-state coordination is SW_ALL or HW_ALL, ··· 1105 1103 set_cpus_allowed_ptr(current, cpumask_of(i)); 1106 1104 ret = match_pr->throttling. 1107 1105 acpi_processor_set_throttling( 1108 - match_pr, t_state.target_state); 1106 + match_pr, t_state.target_state, force); 1109 1107 } 1110 1108 } 1111 1109 /* ··· 1203 1201 ACPI_DEBUG_PRINT((ACPI_DB_INFO, 1204 1202 "Disabling throttling (was T%d)\n", 1205 1203 pr->throttling.state)); 1206 - result = acpi_processor_set_throttling(pr, 0); 1204 + result = acpi_processor_set_throttling(pr, 0, false); 1207 1205 if (result) 1208 1206 goto end; 1209 1207 } ··· 1309 1307 if (strcmp(tmpbuf, charp) != 0) 1310 1308 return -EINVAL; 1311 1309 1312 - result = acpi_processor_set_throttling(pr, state_val); 1310 + result = acpi_processor_set_throttling(pr, state_val, false); 1313 1311 if (result) 1314 1312 return result; 1315 1313
+5 -2
drivers/acpi/video.c
··· 2004 2004 status = acpi_remove_notify_handler(device->dev->handle, 2005 2005 ACPI_DEVICE_NOTIFY, 2006 2006 acpi_video_device_notify); 2007 - sysfs_remove_link(&device->backlight->dev.kobj, "device"); 2008 - backlight_device_unregister(device->backlight); 2007 + if (device->backlight) { 2008 + sysfs_remove_link(&device->backlight->dev.kobj, "device"); 2009 + backlight_device_unregister(device->backlight); 2010 + device->backlight = NULL; 2011 + } 2009 2012 if (device->cdev) { 2010 2013 sysfs_remove_link(&device->dev->dev.kobj, 2011 2014 "thermal_cooling");
+13 -1
drivers/ata/ata_piix.c
··· 664 664 return ata_sff_prereset(link, deadline); 665 665 } 666 666 667 + static DEFINE_SPINLOCK(piix_lock); 668 + 667 669 /** 668 670 * piix_set_piomode - Initialize host controller PATA PIO timings 669 671 * @ap: Port whose timings we are configuring ··· 679 677 680 678 static void piix_set_piomode(struct ata_port *ap, struct ata_device *adev) 681 679 { 682 - unsigned int pio = adev->pio_mode - XFER_PIO_0; 683 680 struct pci_dev *dev = to_pci_dev(ap->host->dev); 681 + unsigned long flags; 682 + unsigned int pio = adev->pio_mode - XFER_PIO_0; 684 683 unsigned int is_slave = (adev->devno != 0); 685 684 unsigned int master_port= ap->port_no ? 0x42 : 0x40; 686 685 unsigned int slave_port = 0x44; ··· 710 707 /* Intel specifies that the PPE functionality is for disk only */ 711 708 if (adev->class == ATA_DEV_ATA) 712 709 control |= 4; /* PPE enable */ 710 + 711 + spin_lock_irqsave(&piix_lock, flags); 713 712 714 713 /* PIO configuration clears DTE unconditionally. It will be 715 714 * programmed in set_dmamode which is guaranteed to be called ··· 752 747 udma_enable &= ~(1 << (2 * ap->port_no + adev->devno)); 753 748 pci_write_config_byte(dev, 0x48, udma_enable); 754 749 } 750 + 751 + spin_unlock_irqrestore(&piix_lock, flags); 755 752 } 756 753 757 754 /** ··· 771 764 static void do_pata_set_dmamode(struct ata_port *ap, struct ata_device *adev, int isich) 772 765 { 773 766 struct pci_dev *dev = to_pci_dev(ap->host->dev); 767 + unsigned long flags; 774 768 u8 master_port = ap->port_no ? 0x42 : 0x40; 775 769 u16 master_data; 776 770 u8 speed = adev->dma_mode; ··· 784 776 { 1, 0 }, 785 777 { 2, 1 }, 786 778 { 2, 3 }, }; 779 + 780 + spin_lock_irqsave(&piix_lock, flags); 787 781 788 782 pci_read_config_word(dev, master_port, &master_data); 789 783 if (ap->udma_mask) ··· 877 867 /* Don't scribble on 0x48 if the controller does not support UDMA */ 878 868 if (ap->udma_mask) 879 869 pci_write_config_byte(dev, 0x48, udma_enable); 870 + 871 + spin_unlock_irqrestore(&piix_lock, flags); 880 872 } 881 873 882 874 /**
+7 -1
drivers/char/agp/intel-agp.c
··· 49 49 #define PCI_DEVICE_ID_INTEL_IGDNG_D_HB 0x0040 50 50 #define PCI_DEVICE_ID_INTEL_IGDNG_D_IG 0x0042 51 51 #define PCI_DEVICE_ID_INTEL_IGDNG_M_HB 0x0044 52 + #define PCI_DEVICE_ID_INTEL_IGDNG_MA_HB 0x0062 52 53 #define PCI_DEVICE_ID_INTEL_IGDNG_M_IG 0x0046 53 54 54 55 /* cover 915 and 945 variants */ ··· 82 81 agp_bridge->dev->device == PCI_DEVICE_ID_INTEL_GM45_HB || \ 83 82 agp_bridge->dev->device == PCI_DEVICE_ID_INTEL_G41_HB || \ 84 83 agp_bridge->dev->device == PCI_DEVICE_ID_INTEL_IGDNG_D_HB || \ 85 - agp_bridge->dev->device == PCI_DEVICE_ID_INTEL_IGDNG_M_HB) 84 + agp_bridge->dev->device == PCI_DEVICE_ID_INTEL_IGDNG_M_HB || \ 85 + agp_bridge->dev->device == PCI_DEVICE_ID_INTEL_IGDNG_MA_HB) 86 86 87 87 extern int agp_memory_reserved; 88 88 ··· 1218 1216 case PCI_DEVICE_ID_INTEL_G41_HB: 1219 1217 case PCI_DEVICE_ID_INTEL_IGDNG_D_HB: 1220 1218 case PCI_DEVICE_ID_INTEL_IGDNG_M_HB: 1219 + case PCI_DEVICE_ID_INTEL_IGDNG_MA_HB: 1221 1220 *gtt_offset = *gtt_size = MB(2); 1222 1221 break; 1223 1222 default: ··· 2198 2195 "IGDNG/D", NULL, &intel_i965_driver }, 2199 2196 { PCI_DEVICE_ID_INTEL_IGDNG_M_HB, PCI_DEVICE_ID_INTEL_IGDNG_M_IG, 0, 2200 2197 "IGDNG/M", NULL, &intel_i965_driver }, 2198 + { PCI_DEVICE_ID_INTEL_IGDNG_MA_HB, PCI_DEVICE_ID_INTEL_IGDNG_M_IG, 0, 2199 + "IGDNG/MA", NULL, &intel_i965_driver }, 2201 2200 { 0, 0, 0, NULL, NULL, NULL } 2202 2201 }; 2203 2202 ··· 2403 2398 ID(PCI_DEVICE_ID_INTEL_G41_HB), 2404 2399 ID(PCI_DEVICE_ID_INTEL_IGDNG_D_HB), 2405 2400 ID(PCI_DEVICE_ID_INTEL_IGDNG_M_HB), 2401 + ID(PCI_DEVICE_ID_INTEL_IGDNG_MA_HB), 2406 2402 { } 2407 2403 }; 2408 2404
+7 -3
drivers/char/tty_ldisc.c
··· 508 508 * be obtained while the delayed work queue halt ensures that no more 509 509 * data is fed to the ldisc. 510 510 * 511 - * In order to wait for any existing references to complete see 512 - * tty_ldisc_wait_idle. 511 + * You need to do a 'flush_scheduled_work()' (outside the ldisc_mutex) 512 + * in order to make sure any currently executing ldisc work is also 513 + * flushed. 513 514 */ 514 515 515 516 static int tty_ldisc_halt(struct tty_struct *tty) ··· 754 753 * N_TTY. 755 754 */ 756 755 if (tty->driver->flags & TTY_DRIVER_RESET_TERMIOS) { 756 + /* Make sure the old ldisc is quiescent */ 757 + tty_ldisc_halt(tty); 758 + flush_scheduled_work(); 759 + 757 760 /* Avoid racing set_ldisc or tty_ldisc_release */ 758 761 mutex_lock(&tty->ldisc_mutex); 759 762 if (tty->ldisc) { /* Not yet closed */ 760 763 /* Switch back to N_TTY */ 761 - tty_ldisc_halt(tty); 762 764 tty_ldisc_reinit(tty); 763 765 /* At this point we have a closed ldisc and we want to 764 766 reopen it. We could defer this to the next open but
+27 -20
drivers/gpu/drm/drm_sysfs.c
··· 23 23 #define to_drm_minor(d) container_of(d, struct drm_minor, kdev) 24 24 #define to_drm_connector(d) container_of(d, struct drm_connector, kdev) 25 25 26 + static struct device_type drm_sysfs_device_minor = { 27 + .name = "drm_minor" 28 + }; 29 + 26 30 /** 27 - * drm_sysfs_suspend - DRM class suspend hook 31 + * drm_class_suspend - DRM class suspend hook 28 32 * @dev: Linux device to suspend 29 33 * @state: power state to enter 30 34 * 31 35 * Just figures out what the actual struct drm_device associated with 32 36 * @dev is and calls its suspend hook, if present. 33 37 */ 34 - static int drm_sysfs_suspend(struct device *dev, pm_message_t state) 38 + static int drm_class_suspend(struct device *dev, pm_message_t state) 35 39 { 36 - struct drm_minor *drm_minor = to_drm_minor(dev); 37 - struct drm_device *drm_dev = drm_minor->dev; 40 + if (dev->type == &drm_sysfs_device_minor) { 41 + struct drm_minor *drm_minor = to_drm_minor(dev); 42 + struct drm_device *drm_dev = drm_minor->dev; 38 43 39 - if (drm_minor->type == DRM_MINOR_LEGACY && 40 - !drm_core_check_feature(drm_dev, DRIVER_MODESET) && 41 - drm_dev->driver->suspend) 42 - return drm_dev->driver->suspend(drm_dev, state); 43 - 44 + if (drm_minor->type == DRM_MINOR_LEGACY && 45 + !drm_core_check_feature(drm_dev, DRIVER_MODESET) && 46 + drm_dev->driver->suspend) 47 + return drm_dev->driver->suspend(drm_dev, state); 48 + } 44 49 return 0; 45 50 } 46 51 47 52 /** 48 - * drm_sysfs_resume - DRM class resume hook 53 + * drm_class_resume - DRM class resume hook 49 54 * @dev: Linux device to resume 50 55 * 51 56 * Just figures out what the actual struct drm_device associated with 52 57 * @dev is and calls its resume hook, if present. 53 58 */ 54 - static int drm_sysfs_resume(struct device *dev) 59 + static int drm_class_resume(struct device *dev) 55 60 { 56 - struct drm_minor *drm_minor = to_drm_minor(dev); 57 - struct drm_device *drm_dev = drm_minor->dev; 61 + if (dev->type == &drm_sysfs_device_minor) { 62 + struct drm_minor *drm_minor = to_drm_minor(dev); 63 + struct drm_device *drm_dev = drm_minor->dev; 58 64 59 - if (drm_minor->type == DRM_MINOR_LEGACY && 60 - !drm_core_check_feature(drm_dev, DRIVER_MODESET) && 61 - drm_dev->driver->resume) 62 - return drm_dev->driver->resume(drm_dev); 63 - 65 + if (drm_minor->type == DRM_MINOR_LEGACY && 66 + !drm_core_check_feature(drm_dev, DRIVER_MODESET) && 67 + drm_dev->driver->resume) 68 + return drm_dev->driver->resume(drm_dev); 69 + } 64 70 return 0; 65 71 } 66 72 ··· 106 100 goto err_out; 107 101 } 108 102 109 - class->suspend = drm_sysfs_suspend; 110 - class->resume = drm_sysfs_resume; 103 + class->suspend = drm_class_suspend; 104 + class->resume = drm_class_resume; 111 105 112 106 err = class_create_file(class, &class_attr_version); 113 107 if (err) ··· 490 484 minor->kdev.class = drm_class; 491 485 minor->kdev.release = drm_sysfs_device_release; 492 486 minor->kdev.devt = minor->device; 487 + minor->kdev.type = &drm_sysfs_device_minor; 493 488 if (minor->type == DRM_MINOR_CONTROL) 494 489 minor_str = "controlD%d"; 495 490 else if (minor->type == DRM_MINOR_RENDER)
+1 -1
drivers/gpu/drm/i915/Makefile
··· 4 4 5 5 ccflags-y := -Iinclude/drm 6 6 i915-y := i915_drv.o i915_dma.o i915_irq.o i915_mem.o \ 7 + i915_debugfs.o \ 7 8 i915_suspend.o \ 8 9 i915_gem.o \ 9 10 i915_gem_debug.o \ 10 - i915_gem_debugfs.o \ 11 11 i915_gem_tiling.o \ 12 12 intel_display.o \ 13 13 intel_crt.o \
+28 -1
drivers/gpu/drm/i915/i915_dma.c
··· 79 79 return -EBUSY; 80 80 } 81 81 82 + /* As a ringbuffer is only allowed to wrap between instructions, fill 83 + * the tail with NOOPs. 84 + */ 85 + int i915_wrap_ring(struct drm_device *dev) 86 + { 87 + drm_i915_private_t *dev_priv = dev->dev_private; 88 + volatile unsigned int *virt; 89 + int rem; 90 + 91 + rem = dev_priv->ring.Size - dev_priv->ring.tail; 92 + if (dev_priv->ring.space < rem) { 93 + int ret = i915_wait_ring(dev, rem, __func__); 94 + if (ret) 95 + return ret; 96 + } 97 + dev_priv->ring.space -= rem; 98 + 99 + virt = (unsigned int *) 100 + (dev_priv->ring.virtual_start + dev_priv->ring.tail); 101 + rem /= 4; 102 + while (rem--) 103 + *virt++ = MI_NOOP; 104 + 105 + dev_priv->ring.tail = 0; 106 + 107 + return 0; 108 + } 109 + 82 110 /** 83 111 * Sets up the hardware status page for devices that need a physical address 84 112 * in the register. ··· 226 198 } 227 199 228 200 dev_priv->ring.Size = init->ring_size; 229 - dev_priv->ring.tail_mask = dev_priv->ring.Size - 1; 230 201 231 202 dev_priv->ring.map.offset = init->ring_start; 232 203 dev_priv->ring.map.size = init->ring_size;
+6 -3
drivers/gpu/drm/i915/i915_drv.c
··· 37 37 #include <linux/console.h> 38 38 #include "drm_crtc_helper.h" 39 39 40 - static unsigned int i915_modeset = -1; 40 + static int i915_modeset = -1; 41 41 module_param_named(modeset, i915_modeset, int, 0400); 42 42 43 43 unsigned int i915_fbpercrtc = 0; 44 44 module_param_named(fbpercrtc, i915_fbpercrtc, int, 0400); 45 + 46 + unsigned int i915_powersave = 1; 47 + module_param_named(powersave, i915_powersave, int, 0400); 45 48 46 49 static struct drm_driver driver; 47 50 ··· 191 188 .master_create = i915_master_create, 192 189 .master_destroy = i915_master_destroy, 193 190 #if defined(CONFIG_DEBUG_FS) 194 - .debugfs_init = i915_gem_debugfs_init, 195 - .debugfs_cleanup = i915_gem_debugfs_cleanup, 191 + .debugfs_init = i915_debugfs_init, 192 + .debugfs_cleanup = i915_debugfs_cleanup, 196 193 #endif 197 194 .gem_init_object = i915_gem_init_object, 198 195 .gem_free_object = i915_gem_free_object,
+42 -24
drivers/gpu/drm/i915/i915_drv.h
··· 85 85 }; 86 86 87 87 typedef struct _drm_i915_ring_buffer { 88 - int tail_mask; 89 88 unsigned long Size; 90 89 u8 *virtual_start; 91 90 int head; ··· 221 222 unsigned int edp_support:1; 222 223 int lvds_ssc_freq; 223 224 225 + int crt_ddc_bus; /* -1 = unknown, else GPIO to use for CRT DDC */ 224 226 struct drm_i915_fence_reg fence_regs[16]; /* assume 965 */ 225 227 int fence_reg_start; /* 4 if userland hasn't ioctl'd us yet */ 226 228 int num_fence_regs; /* 8 on pre-965, 16 otherwise */ ··· 310 310 u32 saveIMR; 311 311 u32 saveCACHE_MODE_0; 312 312 u32 saveD_STATE; 313 - u32 saveCG_2D_DIS; 313 + u32 saveDSPCLK_GATE_D; 314 314 u32 saveMI_ARB_STATE; 315 315 u32 saveSWF0[16]; 316 316 u32 saveSWF1[16]; ··· 384 384 */ 385 385 struct list_head inactive_list; 386 386 387 + /** LRU list of objects with fence regs on them. */ 388 + struct list_head fence_list; 389 + 387 390 /** 388 391 * List of breadcrumbs associated with GPU requests currently 389 392 * outstanding. ··· 442 439 struct drm_i915_gem_phys_object *phys_objs[I915_MAX_PHYS_OBJECT]; 443 440 } mm; 444 441 struct sdvo_device_mapping sdvo_mappings[2]; 442 + 443 + /* Reclocking support */ 444 + bool render_reclock_avail; 445 + bool lvds_downclock_avail; 446 + struct work_struct idle_work; 447 + struct timer_list idle_timer; 448 + bool busy; 449 + u16 orig_clock; 445 450 } drm_i915_private_t; 446 451 447 452 /** driver private structure attached to each drm_gem_object */ ··· 461 450 462 451 /** This object's place on the active/flushing/inactive lists */ 463 452 struct list_head list; 453 + 454 + /** This object's place on the fenced object LRU */ 455 + struct list_head fence_list; 464 456 465 457 /** 466 458 * This is set if the object is on the active or flushing lists ··· 582 568 extern struct drm_ioctl_desc i915_ioctls[]; 583 569 extern int i915_max_ioctl; 584 570 extern unsigned int i915_fbpercrtc; 571 + extern unsigned int i915_powersave; 585 572 586 573 extern int i915_master_create(struct drm_device *dev, struct drm_master *master); 587 574 extern void i915_master_destroy(struct drm_device *dev, struct drm_master *master); ··· 738 723 void i915_dump_lru(struct drm_device *dev, const char *where); 739 724 740 725 /* i915_debugfs.c */ 741 - int i915_gem_debugfs_init(struct drm_minor *minor); 742 - void i915_gem_debugfs_cleanup(struct drm_minor *minor); 726 + int i915_debugfs_init(struct drm_minor *minor); 727 + void i915_debugfs_cleanup(struct drm_minor *minor); 743 728 744 729 /* i915_suspend.c */ 745 730 extern int i915_save_state(struct drm_device *dev); ··· 789 774 790 775 #define I915_VERBOSE 0 791 776 792 - #define RING_LOCALS unsigned int outring, ringmask, outcount; \ 793 - volatile char *virt; 777 + #define RING_LOCALS volatile unsigned int *ring_virt__; 794 778 795 - #define BEGIN_LP_RING(n) do { \ 796 - if (I915_VERBOSE) \ 797 - DRM_DEBUG("BEGIN_LP_RING(%d)\n", (n)); \ 798 - if (dev_priv->ring.space < (n)*4) \ 799 - i915_wait_ring(dev, (n)*4, __func__); \ 800 - outcount = 0; \ 801 - outring = dev_priv->ring.tail; \ 802 - ringmask = dev_priv->ring.tail_mask; \ 803 - virt = dev_priv->ring.virtual_start; \ 779 + #define BEGIN_LP_RING(n) do { \ 780 + int bytes__ = 4*(n); \ 781 + if (I915_VERBOSE) DRM_DEBUG("BEGIN_LP_RING(%d)\n", (n)); \ 782 + /* a wrap must occur between instructions so pad beforehand */ \ 783 + if (unlikely (dev_priv->ring.tail + bytes__ > dev_priv->ring.Size)) \ 784 + i915_wrap_ring(dev); \ 785 + if (unlikely (dev_priv->ring.space < bytes__)) \ 786 + i915_wait_ring(dev, bytes__, __func__); \ 787 + ring_virt__ = (unsigned int *) \ 788 + (dev_priv->ring.virtual_start + dev_priv->ring.tail); \ 789 + dev_priv->ring.tail += bytes__; \ 790 + dev_priv->ring.tail &= dev_priv->ring.Size - 1; \ 791 + dev_priv->ring.space -= bytes__; \ 804 792 } while (0) 805 793 806 - #define OUT_RING(n) do { \ 794 + #define OUT_RING(n) do { \ 807 795 if (I915_VERBOSE) DRM_DEBUG(" OUT_RING %x\n", (int)(n)); \ 808 - *(volatile unsigned int *)(virt + outring) = (n); \ 809 - outcount++; \ 810 - outring += 4; \ 811 - outring &= ringmask; \ 796 + *ring_virt__++ = (n); \ 812 797 } while (0) 813 798 814 799 #define ADVANCE_LP_RING() do { \ 815 - if (I915_VERBOSE) DRM_DEBUG("ADVANCE_LP_RING %x\n", outring); \ 816 - dev_priv->ring.tail = outring; \ 817 - dev_priv->ring.space -= outcount * 4; \ 818 - I915_WRITE(PRB0_TAIL, outring); \ 800 + if (I915_VERBOSE) \ 801 + DRM_DEBUG("ADVANCE_LP_RING %x\n", dev_priv->ring.tail); \ 802 + I915_WRITE(PRB0_TAIL, dev_priv->ring.tail); \ 819 803 } while(0) 820 804 821 805 /** ··· 837 823 #define I915_GEM_HWS_INDEX 0x20 838 824 #define I915_BREADCRUMB_INDEX 0x21 839 825 826 + extern int i915_wrap_ring(struct drm_device * dev); 840 827 extern int i915_wait_ring(struct drm_device * dev, int n, const char *caller); 841 828 842 829 #define IS_I830(dev) ((dev)->pci_device == 0x3577) ··· 910 895 #define I915_HAS_HOTPLUG(dev) (IS_I945G(dev) || IS_I945GM(dev) || IS_I965G(dev)) 911 896 /* dsparb controlled by hw only */ 912 897 #define DSPARB_HWCONTROL(dev) (IS_G4X(dev) || IS_IGDNG(dev)) 898 + 899 + #define HAS_FW_BLC(dev) (IS_I9XX(dev) || IS_G4X(dev) || IS_IGDNG(dev)) 900 + #define HAS_PIPE_CXSR(dev) (IS_G4X(dev) || IS_IGDNG(dev)) 913 901 914 902 #define PRIMARY_RINGBUFFER_SIZE (128*1024) 915 903
+60 -40
drivers/gpu/drm/i915/i915_gem.c
··· 29 29 #include "drm.h" 30 30 #include "i915_drm.h" 31 31 #include "i915_drv.h" 32 + #include "intel_drv.h" 32 33 #include <linux/swap.h> 33 34 #include <linux/pci.h> 34 35 ··· 980 979 i915_gem_set_domain_ioctl(struct drm_device *dev, void *data, 981 980 struct drm_file *file_priv) 982 981 { 982 + struct drm_i915_private *dev_priv = dev->dev_private; 983 983 struct drm_i915_gem_set_domain *args = data; 984 984 struct drm_gem_object *obj; 985 + struct drm_i915_gem_object *obj_priv; 985 986 uint32_t read_domains = args->read_domains; 986 987 uint32_t write_domain = args->write_domain; 987 988 int ret; ··· 1007 1004 obj = drm_gem_object_lookup(dev, file_priv, args->handle); 1008 1005 if (obj == NULL) 1009 1006 return -EBADF; 1007 + obj_priv = obj->driver_private; 1010 1008 1011 1009 mutex_lock(&dev->struct_mutex); 1010 + 1011 + intel_mark_busy(dev, obj); 1012 + 1012 1013 #if WATCH_BUF 1013 1014 DRM_INFO("set_domain_ioctl %p(%zd), %08x %08x\n", 1014 1015 obj, obj->size, read_domains, write_domain); 1015 1016 #endif 1016 1017 if (read_domains & I915_GEM_DOMAIN_GTT) { 1017 1018 ret = i915_gem_object_set_to_gtt_domain(obj, write_domain != 0); 1019 + 1020 + /* Update the LRU on the fence for the CPU access that's 1021 + * about to occur. 1022 + */ 1023 + if (obj_priv->fence_reg != I915_FENCE_REG_NONE) { 1024 + list_move_tail(&obj_priv->fence_list, 1025 + &dev_priv->mm.fence_list); 1026 + } 1018 1027 1019 1028 /* Silently promote "you're not bound, there was nothing to do" 1020 1029 * to success, since the client was just asking us to ··· 1171 1156 } 1172 1157 1173 1158 /* Need a new fence register? */ 1174 - if (obj_priv->fence_reg == I915_FENCE_REG_NONE && 1175 - obj_priv->tiling_mode != I915_TILING_NONE) { 1159 + if (obj_priv->tiling_mode != I915_TILING_NONE) { 1176 1160 ret = i915_gem_object_get_fence_reg(obj); 1177 1161 if (ret) { 1178 1162 mutex_unlock(&dev->struct_mutex); ··· 2223 2209 struct drm_i915_gem_object *old_obj_priv = NULL; 2224 2210 int i, ret, avail; 2225 2211 2212 + /* Just update our place in the LRU if our fence is getting used. */ 2213 + if (obj_priv->fence_reg != I915_FENCE_REG_NONE) { 2214 + list_move_tail(&obj_priv->fence_list, &dev_priv->mm.fence_list); 2215 + return 0; 2216 + } 2217 + 2226 2218 switch (obj_priv->tiling_mode) { 2227 2219 case I915_TILING_NONE: 2228 2220 WARN(1, "allocating a fence for non-tiled object?\n"); ··· 2250 2230 } 2251 2231 2252 2232 /* First try to find a free reg */ 2253 - try_again: 2254 2233 avail = 0; 2255 2234 for (i = dev_priv->fence_reg_start; i < dev_priv->num_fence_regs; i++) { 2256 2235 reg = &dev_priv->fence_regs[i]; ··· 2263 2244 2264 2245 /* None available, try to steal one or wait for a user to finish */ 2265 2246 if (i == dev_priv->num_fence_regs) { 2266 - uint32_t seqno = dev_priv->mm.next_gem_seqno; 2247 + struct drm_gem_object *old_obj = NULL; 2267 2248 2268 2249 if (avail == 0) 2269 2250 return -ENOSPC; 2270 2251 2271 - for (i = dev_priv->fence_reg_start; 2272 - i < dev_priv->num_fence_regs; i++) { 2273 - uint32_t this_seqno; 2274 - 2275 - reg = &dev_priv->fence_regs[i]; 2276 - old_obj_priv = reg->obj->driver_private; 2252 + list_for_each_entry(old_obj_priv, &dev_priv->mm.fence_list, 2253 + fence_list) { 2254 + old_obj = old_obj_priv->obj; 2277 2255 2278 2256 if (old_obj_priv->pin_count) 2279 2257 continue; 2258 + 2259 + /* Take a reference, as otherwise the wait_rendering 2260 + * below may cause the object to get freed out from 2261 + * under us. 2262 + */ 2263 + drm_gem_object_reference(old_obj); 2280 2264 2281 2265 /* i915 uses fences for GPU access to tiled buffers */ 2282 2266 if (IS_I965G(dev) || !old_obj_priv->active) 2283 2267 break; 2284 2268 2285 - /* find the seqno of the first available fence */ 2286 - this_seqno = old_obj_priv->last_rendering_seqno; 2287 - if (this_seqno != 0 && 2288 - reg->obj->write_domain == 0 && 2289 - i915_seqno_passed(seqno, this_seqno)) 2290 - seqno = this_seqno; 2291 - } 2292 - 2293 - /* 2294 - * Now things get ugly... we have to wait for one of the 2295 - * objects to finish before trying again. 2296 - */ 2297 - if (i == dev_priv->num_fence_regs) { 2298 - if (seqno == dev_priv->mm.next_gem_seqno) { 2299 - i915_gem_flush(dev, 2300 - I915_GEM_GPU_DOMAINS, 2301 - I915_GEM_GPU_DOMAINS); 2302 - seqno = i915_add_request(dev, NULL, 2303 - I915_GEM_GPU_DOMAINS); 2304 - if (seqno == 0) 2305 - return -ENOMEM; 2269 + /* This brings the object to the head of the LRU if it 2270 + * had been written to. The only way this should 2271 + * result in us waiting longer than the expected 2272 + * optimal amount of time is if there was a 2273 + * fence-using buffer later that was read-only. 2274 + */ 2275 + i915_gem_object_flush_gpu_write_domain(old_obj); 2276 + ret = i915_gem_object_wait_rendering(old_obj); 2277 + if (ret != 0) { 2278 + drm_gem_object_unreference(old_obj); 2279 + return ret; 2306 2280 } 2307 2281 2308 - ret = i915_wait_request(dev, seqno); 2309 - if (ret) 2310 - return ret; 2311 - goto try_again; 2282 + break; 2312 2283 } 2313 2284 2314 2285 /* 2315 2286 * Zap this virtual mapping so we can set up a fence again 2316 2287 * for this object next time we need it. 2317 2288 */ 2318 - i915_gem_release_mmap(reg->obj); 2289 + i915_gem_release_mmap(old_obj); 2290 + 2291 + i = old_obj_priv->fence_reg; 2292 + reg = &dev_priv->fence_regs[i]; 2293 + 2319 2294 old_obj_priv->fence_reg = I915_FENCE_REG_NONE; 2295 + list_del_init(&old_obj_priv->fence_list); 2296 + 2297 + drm_gem_object_unreference(old_obj); 2320 2298 } 2321 2299 2322 2300 obj_priv->fence_reg = i; 2301 + list_add_tail(&obj_priv->fence_list, &dev_priv->mm.fence_list); 2302 + 2323 2303 reg->obj = obj; 2324 2304 2325 2305 if (IS_I965G(dev)) ··· 2361 2343 2362 2344 dev_priv->fence_regs[obj_priv->fence_reg].obj = NULL; 2363 2345 obj_priv->fence_reg = I915_FENCE_REG_NONE; 2346 + list_del_init(&obj_priv->fence_list); 2364 2347 } 2365 2348 2366 2349 /** ··· 2780 2761 2781 2762 BUG_ON(obj->pending_read_domains & I915_GEM_DOMAIN_CPU); 2782 2763 BUG_ON(obj->pending_write_domain == I915_GEM_DOMAIN_CPU); 2764 + 2765 + intel_mark_busy(dev, obj); 2783 2766 2784 2767 #if WATCH_BUF 2785 2768 DRM_INFO("%s: object %p read %08x -> %08x write %08x -> %08x\n", ··· 3617 3596 * Pre-965 chips need a fence register set up in order to 3618 3597 * properly handle tiled surfaces. 3619 3598 */ 3620 - if (!IS_I965G(dev) && 3621 - obj_priv->fence_reg == I915_FENCE_REG_NONE && 3622 - obj_priv->tiling_mode != I915_TILING_NONE) { 3599 + if (!IS_I965G(dev) && obj_priv->tiling_mode != I915_TILING_NONE) { 3623 3600 ret = i915_gem_object_get_fence_reg(obj); 3624 3601 if (ret != 0) { 3625 3602 if (ret != -EBUSY && ret != -ERESTARTSYS) ··· 3826 3807 obj_priv->obj = obj; 3827 3808 obj_priv->fence_reg = I915_FENCE_REG_NONE; 3828 3809 INIT_LIST_HEAD(&obj_priv->list); 3810 + INIT_LIST_HEAD(&obj_priv->fence_list); 3829 3811 3830 3812 return 0; 3831 3813 } ··· 4100 4080 4101 4081 /* Set up the kernel mapping for the ring. */ 4102 4082 ring->Size = obj->size; 4103 - ring->tail_mask = obj->size - 1; 4104 4083 4105 4084 ring->map.offset = dev->agp->base + obj_priv->gtt_offset; 4106 4085 ring->map.size = obj->size; ··· 4273 4254 INIT_LIST_HEAD(&dev_priv->mm.flushing_list); 4274 4255 INIT_LIST_HEAD(&dev_priv->mm.inactive_list); 4275 4256 INIT_LIST_HEAD(&dev_priv->mm.request_list); 4257 + INIT_LIST_HEAD(&dev_priv->mm.fence_list); 4276 4258 INIT_DELAYED_WORK(&dev_priv->mm.retire_work, 4277 4259 i915_gem_retire_work_handler); 4278 4260 dev_priv->mm.next_gem_seqno = 1;
+70 -21
drivers/gpu/drm/i915/i915_gem_debugfs.c drivers/gpu/drm/i915/i915_debugfs.c
··· 158 158 struct drm_device *dev = node->minor->dev; 159 159 drm_i915_private_t *dev_priv = dev->dev_private; 160 160 161 - seq_printf(m, "Interrupt enable: %08x\n", 162 - I915_READ(IER)); 163 - seq_printf(m, "Interrupt identity: %08x\n", 164 - I915_READ(IIR)); 165 - seq_printf(m, "Interrupt mask: %08x\n", 166 - I915_READ(IMR)); 167 - seq_printf(m, "Pipe A stat: %08x\n", 168 - I915_READ(PIPEASTAT)); 169 - seq_printf(m, "Pipe B stat: %08x\n", 170 - I915_READ(PIPEBSTAT)); 161 + if (!IS_IGDNG(dev)) { 162 + seq_printf(m, "Interrupt enable: %08x\n", 163 + I915_READ(IER)); 164 + seq_printf(m, "Interrupt identity: %08x\n", 165 + I915_READ(IIR)); 166 + seq_printf(m, "Interrupt mask: %08x\n", 167 + I915_READ(IMR)); 168 + seq_printf(m, "Pipe A stat: %08x\n", 169 + I915_READ(PIPEASTAT)); 170 + seq_printf(m, "Pipe B stat: %08x\n", 171 + I915_READ(PIPEBSTAT)); 172 + } else { 173 + seq_printf(m, "North Display Interrupt enable: %08x\n", 174 + I915_READ(DEIER)); 175 + seq_printf(m, "North Display Interrupt identity: %08x\n", 176 + I915_READ(DEIIR)); 177 + seq_printf(m, "North Display Interrupt mask: %08x\n", 178 + I915_READ(DEIMR)); 179 + seq_printf(m, "South Display Interrupt enable: %08x\n", 180 + I915_READ(SDEIER)); 181 + seq_printf(m, "South Display Interrupt identity: %08x\n", 182 + I915_READ(SDEIIR)); 183 + seq_printf(m, "South Display Interrupt mask: %08x\n", 184 + I915_READ(SDEIMR)); 185 + seq_printf(m, "Graphics Interrupt enable: %08x\n", 186 + I915_READ(GTIER)); 187 + seq_printf(m, "Graphics Interrupt identity: %08x\n", 188 + I915_READ(GTIIR)); 189 + seq_printf(m, "Graphics Interrupt mask: %08x\n", 190 + I915_READ(GTIMR)); 191 + } 171 192 seq_printf(m, "Interrupts received: %d\n", 172 193 atomic_read(&dev_priv->irq_received)); 173 194 if (dev_priv->hw_status_page != NULL) { ··· 333 312 struct drm_info_node *node = (struct drm_info_node *) m->private; 334 313 struct drm_device *dev = node->minor->dev; 335 314 drm_i915_private_t *dev_priv = dev->dev_private; 336 - unsigned int head, tail, mask; 315 + unsigned int head, tail; 337 316 338 317 head = I915_READ(PRB0_HEAD) & HEAD_ADDR; 339 318 tail = I915_READ(PRB0_TAIL) & TAIL_ADDR; 340 - mask = dev_priv->ring.tail_mask; 341 319 342 320 seq_printf(m, "RingHead : %08x\n", head); 343 321 seq_printf(m, "RingTail : %08x\n", tail); 344 - seq_printf(m, "RingMask : %08x\n", mask); 345 322 seq_printf(m, "RingSize : %08lx\n", dev_priv->ring.Size); 346 323 seq_printf(m, "Acthd : %08x\n", I915_READ(IS_I965G(dev) ? ACTHD_I965 : ACTHD)); 347 324 ··· 382 363 return 0; 383 364 } 384 365 385 - static struct drm_info_list i915_gem_debugfs_list[] = { 366 + static int i915_registers_info(struct seq_file *m, void *data) { 367 + struct drm_info_node *node = (struct drm_info_node *) m->private; 368 + struct drm_device *dev = node->minor->dev; 369 + drm_i915_private_t *dev_priv = dev->dev_private; 370 + uint32_t reg; 371 + 372 + #define DUMP_RANGE(start, end) \ 373 + for (reg=start; reg < end; reg += 4) \ 374 + seq_printf(m, "%08x\t%08x\n", reg, I915_READ(reg)); 375 + 376 + DUMP_RANGE(0x00000, 0x00fff); /* VGA registers */ 377 + DUMP_RANGE(0x02000, 0x02fff); /* instruction, memory, interrupt control registers */ 378 + DUMP_RANGE(0x03000, 0x031ff); /* FENCE and PPGTT control registers */ 379 + DUMP_RANGE(0x03200, 0x03fff); /* frame buffer compression registers */ 380 + DUMP_RANGE(0x05000, 0x05fff); /* I/O control registers */ 381 + DUMP_RANGE(0x06000, 0x06fff); /* clock control registers */ 382 + DUMP_RANGE(0x07000, 0x07fff); /* 3D internal debug registers */ 383 + DUMP_RANGE(0x07400, 0x088ff); /* GPE debug registers */ 384 + DUMP_RANGE(0x0a000, 0x0afff); /* display palette registers */ 385 + DUMP_RANGE(0x10000, 0x13fff); /* MMIO MCHBAR */ 386 + DUMP_RANGE(0x30000, 0x3ffff); /* overlay registers */ 387 + DUMP_RANGE(0x60000, 0x6ffff); /* display engine pipeline registers */ 388 + DUMP_RANGE(0x70000, 0x72fff); /* display and cursor registers */ 389 + DUMP_RANGE(0x73000, 0x73fff); /* performance counters */ 390 + 391 + return 0; 392 + } 393 + 394 + 395 + static struct drm_info_list i915_debugfs_list[] = { 396 + {"i915_regs", i915_registers_info, 0}, 386 397 {"i915_gem_active", i915_gem_object_list_info, 0, (void *) ACTIVE_LIST}, 387 398 {"i915_gem_flushing", i915_gem_object_list_info, 0, (void *) FLUSHING_LIST}, 388 399 {"i915_gem_inactive", i915_gem_object_list_info, 0, (void *) INACTIVE_LIST}, ··· 426 377 {"i915_batchbuffers", i915_batchbuffer_info, 0}, 427 378 {"i915_error_state", i915_error_state, 0}, 428 379 }; 429 - #define I915_GEM_DEBUGFS_ENTRIES ARRAY_SIZE(i915_gem_debugfs_list) 380 + #define I915_DEBUGFS_ENTRIES ARRAY_SIZE(i915_debugfs_list) 430 381 431 - int i915_gem_debugfs_init(struct drm_minor *minor) 382 + int i915_debugfs_init(struct drm_minor *minor) 432 383 { 433 - return drm_debugfs_create_files(i915_gem_debugfs_list, 434 - I915_GEM_DEBUGFS_ENTRIES, 384 + return drm_debugfs_create_files(i915_debugfs_list, 385 + I915_DEBUGFS_ENTRIES, 435 386 minor->debugfs_root, minor); 436 387 } 437 388 438 - void i915_gem_debugfs_cleanup(struct drm_minor *minor) 389 + void i915_debugfs_cleanup(struct drm_minor *minor) 439 390 { 440 - drm_debugfs_remove_files(i915_gem_debugfs_list, 441 - I915_GEM_DEBUGFS_ENTRIES, minor); 391 + drm_debugfs_remove_files(i915_debugfs_list, 392 + I915_DEBUGFS_ENTRIES, minor); 442 393 } 443 394 444 395 #endif /* CONFIG_DEBUG_FS */
+7 -8
drivers/gpu/drm/i915/i915_gem_tiling.c
··· 234 234 uint32_t swizzle_y = I915_BIT_6_SWIZZLE_UNKNOWN; 235 235 bool need_disable; 236 236 237 - if (!IS_I9XX(dev)) { 237 + if (IS_IGDNG(dev)) { 238 + /* On IGDNG whatever DRAM config, GPU always do 239 + * same swizzling setup. 240 + */ 241 + swizzle_x = I915_BIT_6_SWIZZLE_9_10; 242 + swizzle_y = I915_BIT_6_SWIZZLE_9; 243 + } else if (!IS_I9XX(dev)) { 238 244 /* As far as we know, the 865 doesn't have these bit 6 239 245 * swizzling issues. 240 246 */ ··· 321 315 swizzle_x = I915_BIT_6_SWIZZLE_9_10; 322 316 swizzle_y = I915_BIT_6_SWIZZLE_9; 323 317 } 324 - } 325 - 326 - /* FIXME: check with memory config on IGDNG */ 327 - if (IS_IGDNG(dev)) { 328 - DRM_ERROR("disable tiling on IGDNG...\n"); 329 - swizzle_x = I915_BIT_6_SWIZZLE_UNKNOWN; 330 - swizzle_y = I915_BIT_6_SWIZZLE_UNKNOWN; 331 318 } 332 319 333 320 dev_priv->mm.bit_6_swizzle_x = swizzle_x;
+21
drivers/gpu/drm/i915/i915_irq.c
··· 565 565 566 566 I915_WRITE(PORT_HOTPLUG_STAT, hotplug_status); 567 567 I915_READ(PORT_HOTPLUG_STAT); 568 + 569 + /* EOS interrupts occurs */ 570 + if (IS_IGD(dev) && 571 + (hotplug_status & CRT_EOS_INT_STATUS)) { 572 + u32 temp; 573 + 574 + DRM_DEBUG("EOS interrupt occurs\n"); 575 + /* status is already cleared */ 576 + temp = I915_READ(ADPA); 577 + temp &= ~ADPA_DAC_ENABLE; 578 + I915_WRITE(ADPA, temp); 579 + 580 + temp = I915_READ(PORT_HOTPLUG_EN); 581 + temp &= ~CRT_EOS_INT_EN; 582 + I915_WRITE(PORT_HOTPLUG_EN, temp); 583 + 584 + temp = I915_READ(PORT_HOTPLUG_STAT); 585 + if (temp & CRT_EOS_INT_STATUS) 586 + I915_WRITE(PORT_HOTPLUG_STAT, 587 + CRT_EOS_INT_STATUS); 588 + } 568 589 } 569 590 570 591 I915_WRITE(IIR, iir);
+139 -4
drivers/gpu/drm/i915/i915_reg.h
··· 55 55 /* PCI config space */ 56 56 57 57 #define HPLLCC 0xc0 /* 855 only */ 58 - #define GC_CLOCK_CONTROL_MASK (3 << 0) 58 + #define GC_CLOCK_CONTROL_MASK (0xf << 0) 59 59 #define GC_CLOCK_133_200 (0 << 0) 60 60 #define GC_CLOCK_100_200 (1 << 0) 61 61 #define GC_CLOCK_100_133 (2 << 0) ··· 65 65 #define GC_DISPLAY_CLOCK_190_200_MHZ (0 << 4) 66 66 #define GC_DISPLAY_CLOCK_333_MHZ (4 << 4) 67 67 #define GC_DISPLAY_CLOCK_MASK (7 << 4) 68 + #define GM45_GC_RENDER_CLOCK_MASK (0xf << 0) 69 + #define GM45_GC_RENDER_CLOCK_266_MHZ (8 << 0) 70 + #define GM45_GC_RENDER_CLOCK_320_MHZ (9 << 0) 71 + #define GM45_GC_RENDER_CLOCK_400_MHZ (0xb << 0) 72 + #define GM45_GC_RENDER_CLOCK_533_MHZ (0xc << 0) 73 + #define I965_GC_RENDER_CLOCK_MASK (0xf << 0) 74 + #define I965_GC_RENDER_CLOCK_267_MHZ (2 << 0) 75 + #define I965_GC_RENDER_CLOCK_333_MHZ (3 << 0) 76 + #define I965_GC_RENDER_CLOCK_444_MHZ (4 << 0) 77 + #define I965_GC_RENDER_CLOCK_533_MHZ (5 << 0) 78 + #define I945_GC_RENDER_CLOCK_MASK (7 << 0) 79 + #define I945_GC_RENDER_CLOCK_166_MHZ (0 << 0) 80 + #define I945_GC_RENDER_CLOCK_200_MHZ (1 << 0) 81 + #define I945_GC_RENDER_CLOCK_250_MHZ (3 << 0) 82 + #define I945_GC_RENDER_CLOCK_400_MHZ (5 << 0) 83 + #define I915_GC_RENDER_CLOCK_MASK (7 << 0) 84 + #define I915_GC_RENDER_CLOCK_166_MHZ (0 << 0) 85 + #define I915_GC_RENDER_CLOCK_200_MHZ (1 << 0) 86 + #define I915_GC_RENDER_CLOCK_333_MHZ (4 << 0) 68 87 #define LBB 0xf4 69 88 70 89 /* VGA stuff */ ··· 572 553 #define DPLLA_TEST_M_BYPASS (1 << 2) 573 554 #define DPLLA_INPUT_BUFFER_ENABLE (1 << 0) 574 555 #define D_STATE 0x6104 575 - #define CG_2D_DIS 0x6200 576 - #define DPCUNIT_CLOCK_GATE_DISABLE (1 << 24) 577 - #define CG_3D_DIS 0x6204 556 + #define DSTATE_PLL_D3_OFF (1<<3) 557 + #define DSTATE_GFX_CLOCK_GATING (1<<1) 558 + #define DSTATE_DOT_CLOCK_GATING (1<<0) 559 + #define DSPCLK_GATE_D 0x6200 560 + # define DPUNIT_B_CLOCK_GATE_DISABLE (1 << 30) /* 965 */ 561 + # define VSUNIT_CLOCK_GATE_DISABLE (1 << 29) /* 965 */ 562 + # define VRHUNIT_CLOCK_GATE_DISABLE (1 << 28) /* 965 */ 563 + # define VRDUNIT_CLOCK_GATE_DISABLE (1 << 27) /* 965 */ 564 + # define AUDUNIT_CLOCK_GATE_DISABLE (1 << 26) /* 965 */ 565 + # define DPUNIT_A_CLOCK_GATE_DISABLE (1 << 25) /* 965 */ 566 + # define DPCUNIT_CLOCK_GATE_DISABLE (1 << 24) /* 965 */ 567 + # define TVRUNIT_CLOCK_GATE_DISABLE (1 << 23) /* 915-945 */ 568 + # define TVCUNIT_CLOCK_GATE_DISABLE (1 << 22) /* 915-945 */ 569 + # define TVFUNIT_CLOCK_GATE_DISABLE (1 << 21) /* 915-945 */ 570 + # define TVEUNIT_CLOCK_GATE_DISABLE (1 << 20) /* 915-945 */ 571 + # define DVSUNIT_CLOCK_GATE_DISABLE (1 << 19) /* 915-945 */ 572 + # define DSSUNIT_CLOCK_GATE_DISABLE (1 << 18) /* 915-945 */ 573 + # define DDBUNIT_CLOCK_GATE_DISABLE (1 << 17) /* 915-945 */ 574 + # define DPRUNIT_CLOCK_GATE_DISABLE (1 << 16) /* 915-945 */ 575 + # define DPFUNIT_CLOCK_GATE_DISABLE (1 << 15) /* 915-945 */ 576 + # define DPBMUNIT_CLOCK_GATE_DISABLE (1 << 14) /* 915-945 */ 577 + # define DPLSUNIT_CLOCK_GATE_DISABLE (1 << 13) /* 915-945 */ 578 + # define DPLUNIT_CLOCK_GATE_DISABLE (1 << 12) /* 915-945 */ 579 + # define DPOUNIT_CLOCK_GATE_DISABLE (1 << 11) 580 + # define DPBUNIT_CLOCK_GATE_DISABLE (1 << 10) 581 + # define DCUNIT_CLOCK_GATE_DISABLE (1 << 9) 582 + # define DPUNIT_CLOCK_GATE_DISABLE (1 << 8) 583 + # define VRUNIT_CLOCK_GATE_DISABLE (1 << 7) /* 915+: reserved */ 584 + # define OVHUNIT_CLOCK_GATE_DISABLE (1 << 6) /* 830-865 */ 585 + # define DPIOUNIT_CLOCK_GATE_DISABLE (1 << 6) /* 915-945 */ 586 + # define OVFUNIT_CLOCK_GATE_DISABLE (1 << 5) 587 + # define OVBUNIT_CLOCK_GATE_DISABLE (1 << 4) 588 + /** 589 + * This bit must be set on the 830 to prevent hangs when turning off the 590 + * overlay scaler. 591 + */ 592 + # define OVRUNIT_CLOCK_GATE_DISABLE (1 << 3) 593 + # define OVCUNIT_CLOCK_GATE_DISABLE (1 << 2) 594 + # define OVUUNIT_CLOCK_GATE_DISABLE (1 << 1) 595 + # define ZVUNIT_CLOCK_GATE_DISABLE (1 << 0) /* 830 */ 596 + # define OVLUNIT_CLOCK_GATE_DISABLE (1 << 0) /* 845,865 */ 597 + 598 + #define RENCLK_GATE_D1 0x6204 599 + # define BLITTER_CLOCK_GATE_DISABLE (1 << 13) /* 945GM only */ 600 + # define MPEG_CLOCK_GATE_DISABLE (1 << 12) /* 945GM only */ 601 + # define PC_FE_CLOCK_GATE_DISABLE (1 << 11) 602 + # define PC_BE_CLOCK_GATE_DISABLE (1 << 10) 603 + # define WINDOWER_CLOCK_GATE_DISABLE (1 << 9) 604 + # define INTERPOLATOR_CLOCK_GATE_DISABLE (1 << 8) 605 + # define COLOR_CALCULATOR_CLOCK_GATE_DISABLE (1 << 7) 606 + # define MOTION_COMP_CLOCK_GATE_DISABLE (1 << 6) 607 + # define MAG_CLOCK_GATE_DISABLE (1 << 5) 608 + /** This bit must be unset on 855,865 */ 609 + # define MECI_CLOCK_GATE_DISABLE (1 << 4) 610 + # define DCMP_CLOCK_GATE_DISABLE (1 << 3) 611 + # define MEC_CLOCK_GATE_DISABLE (1 << 2) 612 + # define MECO_CLOCK_GATE_DISABLE (1 << 1) 613 + /** This bit must be set on 855,865. */ 614 + # define SV_CLOCK_GATE_DISABLE (1 << 0) 615 + # define I915_MPEG_CLOCK_GATE_DISABLE (1 << 16) 616 + # define I915_VLD_IP_PR_CLOCK_GATE_DISABLE (1 << 15) 617 + # define I915_MOTION_COMP_CLOCK_GATE_DISABLE (1 << 14) 618 + # define I915_BD_BF_CLOCK_GATE_DISABLE (1 << 13) 619 + # define I915_SF_SE_CLOCK_GATE_DISABLE (1 << 12) 620 + # define I915_WM_CLOCK_GATE_DISABLE (1 << 11) 621 + # define I915_IZ_CLOCK_GATE_DISABLE (1 << 10) 622 + # define I915_PI_CLOCK_GATE_DISABLE (1 << 9) 623 + # define I915_DI_CLOCK_GATE_DISABLE (1 << 8) 624 + # define I915_SH_SV_CLOCK_GATE_DISABLE (1 << 7) 625 + # define I915_PL_DG_QC_FT_CLOCK_GATE_DISABLE (1 << 6) 626 + # define I915_SC_CLOCK_GATE_DISABLE (1 << 5) 627 + # define I915_FL_CLOCK_GATE_DISABLE (1 << 4) 628 + # define I915_DM_CLOCK_GATE_DISABLE (1 << 3) 629 + # define I915_PS_CLOCK_GATE_DISABLE (1 << 2) 630 + # define I915_CC_CLOCK_GATE_DISABLE (1 << 1) 631 + # define I915_BY_CLOCK_GATE_DISABLE (1 << 0) 632 + 633 + # define I965_RCZ_CLOCK_GATE_DISABLE (1 << 30) 634 + /** This bit must always be set on 965G/965GM */ 635 + # define I965_RCC_CLOCK_GATE_DISABLE (1 << 29) 636 + # define I965_RCPB_CLOCK_GATE_DISABLE (1 << 28) 637 + # define I965_DAP_CLOCK_GATE_DISABLE (1 << 27) 638 + # define I965_ROC_CLOCK_GATE_DISABLE (1 << 26) 639 + # define I965_GW_CLOCK_GATE_DISABLE (1 << 25) 640 + # define I965_TD_CLOCK_GATE_DISABLE (1 << 24) 641 + /** This bit must always be set on 965G */ 642 + # define I965_ISC_CLOCK_GATE_DISABLE (1 << 23) 643 + # define I965_IC_CLOCK_GATE_DISABLE (1 << 22) 644 + # define I965_EU_CLOCK_GATE_DISABLE (1 << 21) 645 + # define I965_IF_CLOCK_GATE_DISABLE (1 << 20) 646 + # define I965_TC_CLOCK_GATE_DISABLE (1 << 19) 647 + # define I965_SO_CLOCK_GATE_DISABLE (1 << 17) 648 + # define I965_FBC_CLOCK_GATE_DISABLE (1 << 16) 649 + # define I965_MARI_CLOCK_GATE_DISABLE (1 << 15) 650 + # define I965_MASF_CLOCK_GATE_DISABLE (1 << 14) 651 + # define I965_MAWB_CLOCK_GATE_DISABLE (1 << 13) 652 + # define I965_EM_CLOCK_GATE_DISABLE (1 << 12) 653 + # define I965_UC_CLOCK_GATE_DISABLE (1 << 11) 654 + # define I965_SI_CLOCK_GATE_DISABLE (1 << 6) 655 + # define I965_MT_CLOCK_GATE_DISABLE (1 << 5) 656 + # define I965_PL_CLOCK_GATE_DISABLE (1 << 4) 657 + # define I965_DG_CLOCK_GATE_DISABLE (1 << 3) 658 + # define I965_QC_CLOCK_GATE_DISABLE (1 << 2) 659 + # define I965_FT_CLOCK_GATE_DISABLE (1 << 1) 660 + # define I965_DM_CLOCK_GATE_DISABLE (1 << 0) 661 + 662 + #define RENCLK_GATE_D2 0x6208 663 + #define VF_UNIT_CLOCK_GATE_DISABLE (1 << 9) 664 + #define GS_UNIT_CLOCK_GATE_DISABLE (1 << 7) 665 + #define CL_UNIT_CLOCK_GATE_DISABLE (1 << 6) 666 + #define RAMCLK_GATE_D 0x6210 /* CRL only */ 667 + #define DEUC 0x6214 /* CRL only */ 578 668 579 669 /* 580 670 * Palette regs ··· 811 683 #define SDVOB_HOTPLUG_INT_EN (1 << 26) 812 684 #define SDVOC_HOTPLUG_INT_EN (1 << 25) 813 685 #define TV_HOTPLUG_INT_EN (1 << 18) 686 + #define CRT_EOS_INT_EN (1 << 10) 814 687 #define CRT_HOTPLUG_INT_EN (1 << 9) 815 688 #define CRT_HOTPLUG_FORCE_DETECT (1 << 3) 816 689 #define CRT_HOTPLUG_ACTIVATION_PERIOD_32 (0 << 8) ··· 846 717 #define DPC_HOTPLUG_INT_STATUS (1 << 28) 847 718 #define HDMID_HOTPLUG_INT_STATUS (1 << 27) 848 719 #define DPD_HOTPLUG_INT_STATUS (1 << 27) 720 + #define CRT_EOS_INT_STATUS (1 << 12) 849 721 #define CRT_HOTPLUG_INT_STATUS (1 << 11) 850 722 #define TV_HOTPLUG_INT_STATUS (1 << 10) 851 723 #define CRT_HOTPLUG_MONITOR_MASK (3 << 8) ··· 1716 1586 #define PIPECONF_PROGRESSIVE (0 << 21) 1717 1587 #define PIPECONF_INTERLACE_W_FIELD_INDICATION (6 << 21) 1718 1588 #define PIPECONF_INTERLACE_FIELD_0_ONLY (7 << 21) 1589 + #define PIPECONF_CXSR_DOWNCLOCK (1<<16) 1719 1590 #define PIPEASTAT 0x70024 1720 1591 #define PIPE_FIFO_UNDERRUN_STATUS (1UL<<31) 1721 1592 #define PIPE_CRC_ERROR_ENABLE (1UL<<29) ··· 1864 1733 #define DISPPLANE_NO_LINE_DOUBLE 0 1865 1734 #define DISPPLANE_STEREO_POLARITY_FIRST 0 1866 1735 #define DISPPLANE_STEREO_POLARITY_SECOND (1<<18) 1736 + #define DISPPLANE_TRICKLE_FEED_DISABLE (1<<14) /* IGDNG */ 1867 1737 #define DISPPLANE_TILED (1<<10) 1868 1738 #define DSPAADDR 0x70184 1869 1739 #define DSPASTRIDE 0x70188 ··· 2044 1912 #define GTIMR 0x44014 2045 1913 #define GTIIR 0x44018 2046 1914 #define GTIER 0x4401c 1915 + 1916 + #define DISP_ARB_CTL 0x45000 1917 + #define DISP_TILE_SURFACE_SWIZZLING (1<<13) 2047 1918 2048 1919 /* PCH */ 2049 1920
+2 -2
drivers/gpu/drm/i915/i915_suspend.c
··· 461 461 462 462 /* Clock gating state */ 463 463 dev_priv->saveD_STATE = I915_READ(D_STATE); 464 - dev_priv->saveCG_2D_DIS = I915_READ(CG_2D_DIS); 464 + dev_priv->saveDSPCLK_GATE_D = I915_READ(DSPCLK_GATE_D); 465 465 466 466 /* Cache mode state */ 467 467 dev_priv->saveCACHE_MODE_0 = I915_READ(CACHE_MODE_0); ··· 588 588 589 589 /* Clock gating state */ 590 590 I915_WRITE (D_STATE, dev_priv->saveD_STATE); 591 - I915_WRITE (CG_2D_DIS, dev_priv->saveCG_2D_DIS); 591 + I915_WRITE (DSPCLK_GATE_D, dev_priv->saveDSPCLK_GATE_D); 592 592 593 593 /* Cache mode state */ 594 594 I915_WRITE (CACHE_MODE_0, dev_priv->saveCACHE_MODE_0 | 0xffff0000);
+55 -4
drivers/gpu/drm/i915/intel_bios.c
··· 59 59 return NULL; 60 60 } 61 61 62 + static u16 63 + get_blocksize(void *p) 64 + { 65 + u16 *block_ptr, block_size; 66 + 67 + block_ptr = (u16 *)((char *)p - 2); 68 + block_size = *block_ptr; 69 + return block_size; 70 + } 71 + 62 72 static void 63 73 fill_detail_timing_data(struct drm_display_mode *panel_fixed_mode, 64 74 struct lvds_dvo_timing *dvo_timing) ··· 225 215 } 226 216 227 217 static void 218 + parse_general_definitions(struct drm_i915_private *dev_priv, 219 + struct bdb_header *bdb) 220 + { 221 + struct bdb_general_definitions *general; 222 + const int crt_bus_map_table[] = { 223 + GPIOB, 224 + GPIOA, 225 + GPIOC, 226 + GPIOD, 227 + GPIOE, 228 + GPIOF, 229 + }; 230 + 231 + /* Set sensible defaults in case we can't find the general block 232 + or it is the wrong chipset */ 233 + dev_priv->crt_ddc_bus = -1; 234 + 235 + general = find_section(bdb, BDB_GENERAL_DEFINITIONS); 236 + if (general) { 237 + u16 block_size = get_blocksize(general); 238 + if (block_size >= sizeof(*general)) { 239 + int bus_pin = general->crt_ddc_gmbus_pin; 240 + DRM_DEBUG("crt_ddc_bus_pin: %d\n", bus_pin); 241 + if ((bus_pin >= 1) && (bus_pin <= 6)) { 242 + dev_priv->crt_ddc_bus = 243 + crt_bus_map_table[bus_pin-1]; 244 + } 245 + } else { 246 + DRM_DEBUG("BDB_GD too small (%d). Invalid.\n", 247 + block_size); 248 + } 249 + } 250 + } 251 + 252 + static void 228 253 parse_sdvo_device_mapping(struct drm_i915_private *dev_priv, 229 254 struct bdb_header *bdb) 230 255 { ··· 267 222 struct bdb_general_definitions *p_defs; 268 223 struct child_device_config *p_child; 269 224 int i, child_device_num, count; 270 - u16 block_size, *block_ptr; 225 + u16 block_size; 271 226 272 227 p_defs = find_section(bdb, BDB_GENERAL_DEFINITIONS); 273 228 if (!p_defs) { ··· 285 240 return; 286 241 } 287 242 /* get the block size of general definitions */ 288 - block_ptr = (u16 *)((char *)p_defs - 2); 289 - block_size = *block_ptr; 243 + block_size = get_blocksize(p_defs); 290 244 /* get the number of child device */ 291 245 child_device_num = (block_size - sizeof(*p_defs)) / 292 246 sizeof(*p_child); ··· 355 311 } 356 312 357 313 driver = find_section(bdb, BDB_DRIVER_FEATURES); 358 - if (driver && driver->lvds_config == BDB_DRIVER_FEATURE_EDP) 314 + if (!driver) 315 + return; 316 + 317 + if (driver->lvds_config == BDB_DRIVER_FEATURE_EDP) 359 318 dev_priv->edp_support = 1; 319 + 320 + if (driver->dual_frequency) 321 + dev_priv->render_reclock_avail = true; 360 322 } 361 323 362 324 /** ··· 412 362 413 363 /* Grab useful general definitions */ 414 364 parse_general_features(dev_priv, bdb); 365 + parse_general_definitions(dev_priv, bdb); 415 366 parse_lfp_panel_data(dev_priv, bdb); 416 367 parse_sdvo_panel_data(dev_priv, bdb); 417 368 parse_sdvo_device_mapping(dev_priv, bdb);
+38 -1
drivers/gpu/drm/i915/intel_crt.c
··· 64 64 } 65 65 66 66 I915_WRITE(reg, temp); 67 + 68 + if (IS_IGD(dev)) { 69 + if (mode == DRM_MODE_DPMS_OFF) { 70 + /* turn off DAC */ 71 + temp = I915_READ(PORT_HOTPLUG_EN); 72 + temp &= ~CRT_EOS_INT_EN; 73 + I915_WRITE(PORT_HOTPLUG_EN, temp); 74 + 75 + temp = I915_READ(PORT_HOTPLUG_STAT); 76 + if (temp & CRT_EOS_INT_STATUS) 77 + I915_WRITE(PORT_HOTPLUG_STAT, 78 + CRT_EOS_INT_STATUS); 79 + } else { 80 + /* turn on DAC. EOS interrupt must be enabled after DAC 81 + * is enabled, so it sounds not good to enable it in 82 + * i915_driver_irq_postinstall() 83 + * wait 12.5ms after DAC is enabled 84 + */ 85 + msleep(13); 86 + temp = I915_READ(PORT_HOTPLUG_STAT); 87 + if (temp & CRT_EOS_INT_STATUS) 88 + I915_WRITE(PORT_HOTPLUG_STAT, 89 + CRT_EOS_INT_STATUS); 90 + temp = I915_READ(PORT_HOTPLUG_EN); 91 + temp |= CRT_EOS_INT_EN; 92 + I915_WRITE(PORT_HOTPLUG_EN, temp); 93 + } 94 + } 67 95 } 68 96 69 97 static int intel_crt_mode_valid(struct drm_connector *connector, ··· 536 508 { 537 509 struct drm_connector *connector; 538 510 struct intel_output *intel_output; 511 + struct drm_i915_private *dev_priv = dev->dev_private; 539 512 u32 i2c_reg; 540 513 541 514 intel_output = kzalloc(sizeof(struct intel_output), GFP_KERNEL); ··· 556 527 /* Set up the DDC bus. */ 557 528 if (IS_IGDNG(dev)) 558 529 i2c_reg = PCH_GPIOA; 559 - else 530 + else { 560 531 i2c_reg = GPIOA; 532 + /* Use VBT information for CRT DDC if available */ 533 + if (dev_priv->crt_ddc_bus != -1) 534 + i2c_reg = dev_priv->crt_ddc_bus; 535 + } 561 536 intel_output->ddc_bus = intel_i2c_create(dev, i2c_reg, "CRTDDC_A"); 562 537 if (!intel_output->ddc_bus) { 563 538 dev_printk(KERN_ERR, &dev->pdev->dev, "DDC bus registration " ··· 570 537 } 571 538 572 539 intel_output->type = INTEL_OUTPUT_ANALOG; 540 + intel_output->clone_mask = (1 << INTEL_SDVO_NON_TV_CLONE_BIT) | 541 + (1 << INTEL_ANALOG_CLONE_BIT) | 542 + (1 << INTEL_SDVO_LVDS_CLONE_BIT); 543 + intel_output->crtc_mask = (1 << 0) | (1 << 1); 573 544 connector->interlace_allowed = 0; 574 545 connector->doublescan_allowed = 0; 575 546
+584 -102
drivers/gpu/drm/i915/intel_display.c
··· 38 38 39 39 bool intel_pipe_has_type (struct drm_crtc *crtc, int type); 40 40 static void intel_update_watermarks(struct drm_device *dev); 41 + static void intel_increase_pllclock(struct drm_crtc *crtc, bool schedule); 41 42 42 43 typedef struct { 43 44 /* given values */ ··· 68 67 intel_p2_t p2; 69 68 bool (* find_pll)(const intel_limit_t *, struct drm_crtc *, 70 69 int, int, intel_clock_t *); 70 + bool (* find_reduced_pll)(const intel_limit_t *, struct drm_crtc *, 71 + int, int, intel_clock_t *); 71 72 }; 72 73 73 74 #define I8XX_DOT_MIN 25000 ··· 264 261 intel_find_best_PLL(const intel_limit_t *limit, struct drm_crtc *crtc, 265 262 int target, int refclk, intel_clock_t *best_clock); 266 263 static bool 264 + intel_find_best_reduced_PLL(const intel_limit_t *limit, struct drm_crtc *crtc, 265 + int target, int refclk, intel_clock_t *best_clock); 266 + static bool 267 267 intel_g4x_find_best_PLL(const intel_limit_t *limit, struct drm_crtc *crtc, 268 268 int target, int refclk, intel_clock_t *best_clock); 269 269 static bool ··· 292 286 .p2 = { .dot_limit = I8XX_P2_SLOW_LIMIT, 293 287 .p2_slow = I8XX_P2_SLOW, .p2_fast = I8XX_P2_FAST }, 294 288 .find_pll = intel_find_best_PLL, 289 + .find_reduced_pll = intel_find_best_reduced_PLL, 295 290 }; 296 291 297 292 static const intel_limit_t intel_limits_i8xx_lvds = { ··· 307 300 .p2 = { .dot_limit = I8XX_P2_SLOW_LIMIT, 308 301 .p2_slow = I8XX_P2_LVDS_SLOW, .p2_fast = I8XX_P2_LVDS_FAST }, 309 302 .find_pll = intel_find_best_PLL, 303 + .find_reduced_pll = intel_find_best_reduced_PLL, 310 304 }; 311 305 312 306 static const intel_limit_t intel_limits_i9xx_sdvo = { ··· 322 314 .p2 = { .dot_limit = I9XX_P2_SDVO_DAC_SLOW_LIMIT, 323 315 .p2_slow = I9XX_P2_SDVO_DAC_SLOW, .p2_fast = I9XX_P2_SDVO_DAC_FAST }, 324 316 .find_pll = intel_find_best_PLL, 317 + .find_reduced_pll = intel_find_best_reduced_PLL, 325 318 }; 326 319 327 320 static const intel_limit_t intel_limits_i9xx_lvds = { ··· 340 331 .p2 = { .dot_limit = I9XX_P2_LVDS_SLOW_LIMIT, 341 332 .p2_slow = I9XX_P2_LVDS_SLOW, .p2_fast = I9XX_P2_LVDS_FAST }, 342 333 .find_pll = intel_find_best_PLL, 334 + .find_reduced_pll = intel_find_best_reduced_PLL, 343 335 }; 344 336 345 337 /* below parameter and function is for G4X Chipset Family*/ ··· 358 348 .p2_fast = G4X_P2_SDVO_FAST 359 349 }, 360 350 .find_pll = intel_g4x_find_best_PLL, 351 + .find_reduced_pll = intel_g4x_find_best_PLL, 361 352 }; 362 353 363 354 static const intel_limit_t intel_limits_g4x_hdmi = { ··· 375 364 .p2_fast = G4X_P2_HDMI_DAC_FAST 376 365 }, 377 366 .find_pll = intel_g4x_find_best_PLL, 367 + .find_reduced_pll = intel_g4x_find_best_PLL, 378 368 }; 379 369 380 370 static const intel_limit_t intel_limits_g4x_single_channel_lvds = { ··· 400 388 .p2_fast = G4X_P2_SINGLE_CHANNEL_LVDS_FAST 401 389 }, 402 390 .find_pll = intel_g4x_find_best_PLL, 391 + .find_reduced_pll = intel_g4x_find_best_PLL, 403 392 }; 404 393 405 394 static const intel_limit_t intel_limits_g4x_dual_channel_lvds = { ··· 425 412 .p2_fast = G4X_P2_DUAL_CHANNEL_LVDS_FAST 426 413 }, 427 414 .find_pll = intel_g4x_find_best_PLL, 415 + .find_reduced_pll = intel_g4x_find_best_PLL, 428 416 }; 429 417 430 418 static const intel_limit_t intel_limits_g4x_display_port = { ··· 463 449 .p2 = { .dot_limit = I9XX_P2_SDVO_DAC_SLOW_LIMIT, 464 450 .p2_slow = I9XX_P2_SDVO_DAC_SLOW, .p2_fast = I9XX_P2_SDVO_DAC_FAST }, 465 451 .find_pll = intel_find_best_PLL, 452 + .find_reduced_pll = intel_find_best_reduced_PLL, 466 453 }; 467 454 468 455 static const intel_limit_t intel_limits_igd_lvds = { ··· 479 464 .p2 = { .dot_limit = I9XX_P2_LVDS_SLOW_LIMIT, 480 465 .p2_slow = I9XX_P2_LVDS_SLOW, .p2_fast = I9XX_P2_LVDS_SLOW }, 481 466 .find_pll = intel_find_best_PLL, 467 + .find_reduced_pll = intel_find_best_reduced_PLL, 482 468 }; 483 469 484 470 static const intel_limit_t intel_limits_igdng_sdvo = { ··· 682 666 intel_clock_t clock; 683 667 int err = target; 684 668 685 - if (IS_I9XX(dev) && intel_pipe_has_type(crtc, INTEL_OUTPUT_LVDS) && 669 + if (intel_pipe_has_type(crtc, INTEL_OUTPUT_LVDS) && 686 670 (I915_READ(LVDS)) != 0) { 687 671 /* 688 672 * For LVDS, if the panel is on, just rely on its current ··· 704 688 705 689 memset (best_clock, 0, sizeof (*best_clock)); 706 690 707 - for (clock.m1 = limit->m1.min; clock.m1 <= limit->m1.max; clock.m1++) { 708 - for (clock.m2 = limit->m2.min; clock.m2 <= limit->m2.max; clock.m2++) { 709 - /* m1 is always 0 in IGD */ 710 - if (clock.m2 >= clock.m1 && !IS_IGD(dev)) 711 - break; 712 - for (clock.n = limit->n.min; clock.n <= limit->n.max; 713 - clock.n++) { 714 - for (clock.p1 = limit->p1.min; 715 - clock.p1 <= limit->p1.max; clock.p1++) { 691 + for (clock.p1 = limit->p1.max; clock.p1 >= limit->p1.min; clock.p1--) { 692 + for (clock.m1 = limit->m1.min; clock.m1 <= limit->m1.max; 693 + clock.m1++) { 694 + for (clock.m2 = limit->m2.min; 695 + clock.m2 <= limit->m2.max; clock.m2++) { 696 + /* m1 is always 0 in IGD */ 697 + if (clock.m2 >= clock.m1 && !IS_IGD(dev)) 698 + break; 699 + for (clock.n = limit->n.min; 700 + clock.n <= limit->n.max; clock.n++) { 716 701 int this_err; 717 702 718 703 intel_clock(dev, refclk, &clock); ··· 732 715 } 733 716 734 717 return (err != target); 718 + } 719 + 720 + 721 + static bool 722 + intel_find_best_reduced_PLL(const intel_limit_t *limit, struct drm_crtc *crtc, 723 + int target, int refclk, intel_clock_t *best_clock) 724 + 725 + { 726 + struct drm_device *dev = crtc->dev; 727 + intel_clock_t clock; 728 + int err = target; 729 + bool found = false; 730 + 731 + memcpy(&clock, best_clock, sizeof(intel_clock_t)); 732 + 733 + for (clock.m1 = limit->m1.min; clock.m1 <= limit->m1.max; clock.m1++) { 734 + for (clock.m2 = limit->m2.min; clock.m2 <= limit->m2.max; clock.m2++) { 735 + /* m1 is always 0 in IGD */ 736 + if (clock.m2 >= clock.m1 && !IS_IGD(dev)) 737 + break; 738 + for (clock.n = limit->n.min; clock.n <= limit->n.max; 739 + clock.n++) { 740 + int this_err; 741 + 742 + intel_clock(dev, refclk, &clock); 743 + 744 + if (!intel_PLL_is_valid(crtc, &clock)) 745 + continue; 746 + 747 + this_err = abs(clock.dot - target); 748 + if (this_err < err) { 749 + *best_clock = clock; 750 + err = this_err; 751 + found = true; 752 + } 753 + } 754 + } 755 + } 756 + 757 + return found; 735 758 } 736 759 737 760 static bool ··· 804 747 max_n = limit->n.max; 805 748 /* based on hardware requriment prefer smaller n to precision */ 806 749 for (clock.n = limit->n.min; clock.n <= max_n; clock.n++) { 807 - /* based on hardware requirment prefere larger m1,m2, p1 */ 750 + /* based on hardware requirment prefere larger m1,m2 */ 808 751 for (clock.m1 = limit->m1.max; 809 752 clock.m1 >= limit->m1.min; clock.m1--) { 810 753 for (clock.m2 = limit->m2.max; ··· 889 832 890 833 memset(best_clock, 0, sizeof(*best_clock)); 891 834 max_n = limit->n.max; 892 - /* based on hardware requriment prefer smaller n to precision */ 893 - for (clock.n = limit->n.min; clock.n <= max_n; clock.n++) { 894 - /* based on hardware requirment prefere larger m1,m2, p1 */ 895 - for (clock.m1 = limit->m1.max; 896 - clock.m1 >= limit->m1.min; clock.m1--) { 897 - for (clock.m2 = limit->m2.max; 898 - clock.m2 >= limit->m2.min; clock.m2--) { 899 - for (clock.p1 = limit->p1.max; 900 - clock.p1 >= limit->p1.min; clock.p1--) { 835 + for (clock.p1 = limit->p1.max; clock.p1 >= limit->p1.min; clock.p1--) { 836 + /* based on hardware requriment prefer smaller n to precision */ 837 + for (clock.n = limit->n.min; clock.n <= max_n; clock.n++) { 838 + /* based on hardware requirment prefere larger m1,m2 */ 839 + for (clock.m1 = limit->m1.max; 840 + clock.m1 >= limit->m1.min; clock.m1--) { 841 + for (clock.m2 = limit->m2.max; 842 + clock.m2 >= limit->m2.min; clock.m2--) { 901 843 int this_err; 902 844 903 845 intel_clock(dev, refclk, &clock); ··· 1064 1008 dspcntr &= ~DISPPLANE_TILED; 1065 1009 } 1066 1010 1011 + if (IS_IGDNG(dev)) 1012 + /* must disable */ 1013 + dspcntr |= DISPPLANE_TRICKLE_FEED_DISABLE; 1014 + 1067 1015 I915_WRITE(dspcntr_reg, dspcntr); 1068 1016 1069 1017 Start = obj_priv->gtt_offset; ··· 1090 1030 1091 1031 if (old_fb) { 1092 1032 intel_fb = to_intel_framebuffer(old_fb); 1033 + obj_priv = intel_fb->obj->driver_private; 1093 1034 i915_gem_object_unpin(intel_fb->obj); 1094 1035 } 1036 + intel_increase_pllclock(crtc, true); 1037 + 1095 1038 mutex_unlock(&dev->struct_mutex); 1096 1039 1097 1040 if (!dev->primary->master) ··· 1644 1581 else 1645 1582 i9xx_crtc_dpms(crtc, mode); 1646 1583 1584 + intel_crtc->dpms_mode = mode; 1585 + 1647 1586 if (!dev->primary->master) 1648 1587 return; 1649 1588 ··· 1668 1603 DRM_ERROR("Can't update pipe %d in SAREA\n", pipe); 1669 1604 break; 1670 1605 } 1671 - 1672 - intel_crtc->dpms_mode = mode; 1673 1606 } 1674 1607 1675 1608 static void intel_crtc_prepare (struct drm_crtc *crtc) ··· 2068 2005 return; 2069 2006 } 2070 2007 2071 - const static int latency_ns = 3000; /* default for non-igd platforms */ 2008 + /* 2009 + * Latency for FIFO fetches is dependent on several factors: 2010 + * - memory configuration (speed, channels) 2011 + * - chipset 2012 + * - current MCH state 2013 + * It can be fairly high in some situations, so here we assume a fairly 2014 + * pessimal value. It's a tradeoff between extra memory fetches (if we 2015 + * set this value too high, the FIFO will fetch frequently to stay full) 2016 + * and power consumption (set it too low to save power and we might see 2017 + * FIFO underruns and display "flicker"). 2018 + * 2019 + * A value of 5us seems to be a good balance; safe for very low end 2020 + * platforms but not overly aggressive on lower latency configs. 2021 + */ 2022 + const static int latency_ns = 5000; 2072 2023 2073 2024 static int intel_get_fifo_size(struct drm_device *dev, int plane) 2074 2025 { ··· 2115 2038 size); 2116 2039 2117 2040 return size; 2041 + } 2042 + 2043 + static void g4x_update_wm(struct drm_device *dev) 2044 + { 2045 + struct drm_i915_private *dev_priv = dev->dev_private; 2046 + u32 fw_blc_self = I915_READ(FW_BLC_SELF); 2047 + 2048 + if (i915_powersave) 2049 + fw_blc_self |= FW_BLC_SELF_EN; 2050 + else 2051 + fw_blc_self &= ~FW_BLC_SELF_EN; 2052 + I915_WRITE(FW_BLC_SELF, fw_blc_self); 2118 2053 } 2119 2054 2120 2055 static void i965_update_wm(struct drm_device *dev) ··· 2180 2091 cwm = 2; 2181 2092 2182 2093 /* Calc sr entries for one plane configs */ 2183 - if (sr_hdisplay && (!planea_clock || !planeb_clock)) { 2094 + if (HAS_FW_BLC(dev) && sr_hdisplay && 2095 + (!planea_clock || !planeb_clock)) { 2184 2096 /* self-refresh has much higher latency */ 2185 2097 const static int sr_latency_ns = 6000; 2186 2098 ··· 2196 2106 srwm = total_size - sr_entries; 2197 2107 if (srwm < 0) 2198 2108 srwm = 1; 2199 - if (IS_I9XX(dev)) 2200 - I915_WRITE(FW_BLC_SELF, (srwm & 0x3f)); 2109 + I915_WRITE(FW_BLC_SELF, FW_BLC_SELF_EN | (srwm & 0x3f)); 2201 2110 } 2202 2111 2203 2112 DRM_DEBUG("Setting FIFO watermarks - A: %d, B: %d, C: %d, SR %d\n", ··· 2270 2181 unsigned long planea_clock = 0, planeb_clock = 0, sr_clock = 0; 2271 2182 int enabled = 0, pixel_size = 0; 2272 2183 2273 - if (DSPARB_HWCONTROL(dev)) 2274 - return; 2275 - 2276 2184 /* Get the clock config from both planes */ 2277 2185 list_for_each_entry(crtc, &dev->mode_config.crtc_list, head) { 2278 2186 intel_crtc = to_intel_crtc(crtc); ··· 2302 2216 else if (IS_IGD(dev)) 2303 2217 igd_disable_cxsr(dev); 2304 2218 2305 - if (IS_I965G(dev)) 2219 + if (IS_G4X(dev)) 2220 + g4x_update_wm(dev); 2221 + else if (IS_I965G(dev)) 2306 2222 i965_update_wm(dev); 2307 2223 else if (IS_I9XX(dev) || IS_MOBILE(dev)) 2308 2224 i9xx_update_wm(dev, planea_clock, planeb_clock, sr_hdisplay, ··· 2338 2250 int dsppos_reg = (pipe == 0) ? DSPAPOS : DSPBPOS; 2339 2251 int pipesrc_reg = (pipe == 0) ? PIPEASRC : PIPEBSRC; 2340 2252 int refclk, num_outputs = 0; 2341 - intel_clock_t clock; 2342 - u32 dpll = 0, fp = 0, dspcntr, pipeconf; 2343 - bool ok, is_sdvo = false, is_dvo = false; 2253 + intel_clock_t clock, reduced_clock; 2254 + u32 dpll = 0, fp = 0, fp2 = 0, dspcntr, pipeconf; 2255 + bool ok, has_reduced_clock = false, is_sdvo = false, is_dvo = false; 2344 2256 bool is_crt = false, is_lvds = false, is_tv = false, is_dp = false; 2345 2257 bool is_edp = false; 2346 2258 struct drm_mode_config *mode_config = &dev->mode_config; ··· 2423 2335 return -EINVAL; 2424 2336 } 2425 2337 2338 + if (limit->find_reduced_pll && dev_priv->lvds_downclock_avail) { 2339 + memcpy(&reduced_clock, &clock, sizeof(intel_clock_t)); 2340 + has_reduced_clock = limit->find_reduced_pll(limit, crtc, 2341 + (adjusted_mode->clock*3/4), 2342 + refclk, 2343 + &reduced_clock); 2344 + } 2345 + 2426 2346 /* SDVO TV has fixed PLL values depend on its clock range, 2427 2347 this mirrors vbios setting. */ 2428 2348 if (is_sdvo && is_tv) { ··· 2476 2380 link_bw, &m_n); 2477 2381 } 2478 2382 2479 - if (IS_IGD(dev)) 2383 + if (IS_IGD(dev)) { 2480 2384 fp = (1 << clock.n) << 16 | clock.m1 << 8 | clock.m2; 2481 - else 2385 + if (has_reduced_clock) 2386 + fp2 = (1 << reduced_clock.n) << 16 | 2387 + reduced_clock.m1 << 8 | reduced_clock.m2; 2388 + } else { 2482 2389 fp = clock.n << 16 | clock.m1 << 8 | clock.m2; 2390 + if (has_reduced_clock) 2391 + fp2 = reduced_clock.n << 16 | reduced_clock.m1 << 8 | 2392 + reduced_clock.m2; 2393 + } 2483 2394 2484 2395 if (!IS_IGDNG(dev)) 2485 2396 dpll = DPLL_VGA_MODE_DIS; ··· 2499 2396 if (is_sdvo) { 2500 2397 dpll |= DPLL_DVO_HIGH_SPEED; 2501 2398 sdvo_pixel_multiply = adjusted_mode->clock / mode->clock; 2502 - if (IS_I945G(dev) || IS_I945GM(dev)) 2399 + if (IS_I945G(dev) || IS_I945GM(dev) || IS_G33(dev)) 2503 2400 dpll |= (sdvo_pixel_multiply - 1) << SDVO_MULTIPLIER_SHIFT_HIRES; 2504 2401 else if (IS_IGDNG(dev)) 2505 2402 dpll |= (sdvo_pixel_multiply - 1) << PLL_REF_SDVO_HDMI_MULTIPLIER_SHIFT; ··· 2515 2412 /* also FPA1 */ 2516 2413 if (IS_IGDNG(dev)) 2517 2414 dpll |= (1 << (clock.p1 - 1)) << DPLL_FPA1_P1_POST_DIV_SHIFT; 2415 + if (IS_G4X(dev) && has_reduced_clock) 2416 + dpll |= (1 << (reduced_clock.p1 - 1)) << DPLL_FPA1_P1_POST_DIV_SHIFT; 2518 2417 } 2519 2418 switch (clock.p2) { 2520 2419 case 5: ··· 2664 2559 udelay(150); 2665 2560 } 2666 2561 2562 + if (is_lvds && has_reduced_clock && i915_powersave) { 2563 + I915_WRITE(fp_reg + 4, fp2); 2564 + intel_crtc->lowfreq_avail = true; 2565 + if (HAS_PIPE_CXSR(dev)) { 2566 + DRM_DEBUG("enabling CxSR downclocking\n"); 2567 + pipeconf |= PIPECONF_CXSR_DOWNCLOCK; 2568 + } 2569 + } else { 2570 + I915_WRITE(fp_reg + 4, fp); 2571 + intel_crtc->lowfreq_avail = false; 2572 + if (HAS_PIPE_CXSR(dev)) { 2573 + DRM_DEBUG("disabling CxSR downclocking\n"); 2574 + pipeconf &= ~PIPECONF_CXSR_DOWNCLOCK; 2575 + } 2576 + } 2577 + 2667 2578 I915_WRITE(htot_reg, (adjusted_mode->crtc_hdisplay - 1) | 2668 2579 ((adjusted_mode->crtc_htotal - 1) << 16)); 2669 2580 I915_WRITE(hblank_reg, (adjusted_mode->crtc_hblank_start - 1) | ··· 2722 2601 I915_READ(pipeconf_reg); 2723 2602 2724 2603 intel_wait_for_vblank(dev); 2604 + 2605 + if (IS_IGDNG(dev)) { 2606 + /* enable address swizzle for tiling buffer */ 2607 + temp = I915_READ(DISP_ARB_CTL); 2608 + I915_WRITE(DISP_ARB_CTL, temp | DISP_TILE_SURFACE_SWIZZLING); 2609 + } 2725 2610 2726 2611 I915_WRITE(dspcntr_reg, dspcntr); 2727 2612 ··· 2882 2755 struct drm_device *dev = crtc->dev; 2883 2756 struct drm_i915_private *dev_priv = dev->dev_private; 2884 2757 struct intel_crtc *intel_crtc = to_intel_crtc(crtc); 2758 + struct intel_framebuffer *intel_fb; 2885 2759 int pipe = intel_crtc->pipe; 2886 2760 uint32_t temp = 0; 2887 2761 uint32_t adder; 2762 + 2763 + if (crtc->fb) { 2764 + intel_fb = to_intel_framebuffer(crtc->fb); 2765 + intel_mark_busy(dev, intel_fb->obj); 2766 + } 2888 2767 2889 2768 if (x < 0) { 2890 2769 temp |= CURSOR_POS_SIGN << CURSOR_X_SHIFT; ··· 3189 3056 return mode; 3190 3057 } 3191 3058 3059 + #define GPU_IDLE_TIMEOUT 500 /* ms */ 3060 + 3061 + /* When this timer fires, we've been idle for awhile */ 3062 + static void intel_gpu_idle_timer(unsigned long arg) 3063 + { 3064 + struct drm_device *dev = (struct drm_device *)arg; 3065 + drm_i915_private_t *dev_priv = dev->dev_private; 3066 + 3067 + DRM_DEBUG("idle timer fired, downclocking\n"); 3068 + 3069 + dev_priv->busy = false; 3070 + 3071 + queue_work(dev_priv->wq, &dev_priv->idle_work); 3072 + } 3073 + 3074 + void intel_increase_renderclock(struct drm_device *dev, bool schedule) 3075 + { 3076 + drm_i915_private_t *dev_priv = dev->dev_private; 3077 + 3078 + if (IS_IGDNG(dev)) 3079 + return; 3080 + 3081 + if (!dev_priv->render_reclock_avail) { 3082 + DRM_DEBUG("not reclocking render clock\n"); 3083 + return; 3084 + } 3085 + 3086 + /* Restore render clock frequency to original value */ 3087 + if (IS_G4X(dev) || IS_I9XX(dev)) 3088 + pci_write_config_word(dev->pdev, GCFGC, dev_priv->orig_clock); 3089 + else if (IS_I85X(dev)) 3090 + pci_write_config_word(dev->pdev, HPLLCC, dev_priv->orig_clock); 3091 + DRM_DEBUG("increasing render clock frequency\n"); 3092 + 3093 + /* Schedule downclock */ 3094 + if (schedule) 3095 + mod_timer(&dev_priv->idle_timer, jiffies + 3096 + msecs_to_jiffies(GPU_IDLE_TIMEOUT)); 3097 + } 3098 + 3099 + void intel_decrease_renderclock(struct drm_device *dev) 3100 + { 3101 + drm_i915_private_t *dev_priv = dev->dev_private; 3102 + 3103 + if (IS_IGDNG(dev)) 3104 + return; 3105 + 3106 + if (!dev_priv->render_reclock_avail) { 3107 + DRM_DEBUG("not reclocking render clock\n"); 3108 + return; 3109 + } 3110 + 3111 + if (IS_G4X(dev)) { 3112 + u16 gcfgc; 3113 + 3114 + /* Adjust render clock... */ 3115 + pci_read_config_word(dev->pdev, GCFGC, &gcfgc); 3116 + 3117 + /* Down to minimum... */ 3118 + gcfgc &= ~GM45_GC_RENDER_CLOCK_MASK; 3119 + gcfgc |= GM45_GC_RENDER_CLOCK_266_MHZ; 3120 + 3121 + pci_write_config_word(dev->pdev, GCFGC, gcfgc); 3122 + } else if (IS_I965G(dev)) { 3123 + u16 gcfgc; 3124 + 3125 + /* Adjust render clock... */ 3126 + pci_read_config_word(dev->pdev, GCFGC, &gcfgc); 3127 + 3128 + /* Down to minimum... */ 3129 + gcfgc &= ~I965_GC_RENDER_CLOCK_MASK; 3130 + gcfgc |= I965_GC_RENDER_CLOCK_267_MHZ; 3131 + 3132 + pci_write_config_word(dev->pdev, GCFGC, gcfgc); 3133 + } else if (IS_I945G(dev) || IS_I945GM(dev)) { 3134 + u16 gcfgc; 3135 + 3136 + /* Adjust render clock... */ 3137 + pci_read_config_word(dev->pdev, GCFGC, &gcfgc); 3138 + 3139 + /* Down to minimum... */ 3140 + gcfgc &= ~I945_GC_RENDER_CLOCK_MASK; 3141 + gcfgc |= I945_GC_RENDER_CLOCK_166_MHZ; 3142 + 3143 + pci_write_config_word(dev->pdev, GCFGC, gcfgc); 3144 + } else if (IS_I915G(dev)) { 3145 + u16 gcfgc; 3146 + 3147 + /* Adjust render clock... */ 3148 + pci_read_config_word(dev->pdev, GCFGC, &gcfgc); 3149 + 3150 + /* Down to minimum... */ 3151 + gcfgc &= ~I915_GC_RENDER_CLOCK_MASK; 3152 + gcfgc |= I915_GC_RENDER_CLOCK_166_MHZ; 3153 + 3154 + pci_write_config_word(dev->pdev, GCFGC, gcfgc); 3155 + } else if (IS_I85X(dev)) { 3156 + u16 hpllcc; 3157 + 3158 + /* Adjust render clock... */ 3159 + pci_read_config_word(dev->pdev, HPLLCC, &hpllcc); 3160 + 3161 + /* Up to maximum... */ 3162 + hpllcc &= ~GC_CLOCK_CONTROL_MASK; 3163 + hpllcc |= GC_CLOCK_133_200; 3164 + 3165 + pci_write_config_word(dev->pdev, HPLLCC, hpllcc); 3166 + } 3167 + DRM_DEBUG("decreasing render clock frequency\n"); 3168 + } 3169 + 3170 + /* Note that no increase function is needed for this - increase_renderclock() 3171 + * will also rewrite these bits 3172 + */ 3173 + void intel_decrease_displayclock(struct drm_device *dev) 3174 + { 3175 + if (IS_IGDNG(dev)) 3176 + return; 3177 + 3178 + if (IS_I945G(dev) || IS_I945GM(dev) || IS_I915G(dev) || 3179 + IS_I915GM(dev)) { 3180 + u16 gcfgc; 3181 + 3182 + /* Adjust render clock... */ 3183 + pci_read_config_word(dev->pdev, GCFGC, &gcfgc); 3184 + 3185 + /* Down to minimum... */ 3186 + gcfgc &= ~0xf0; 3187 + gcfgc |= 0x80; 3188 + 3189 + pci_write_config_word(dev->pdev, GCFGC, gcfgc); 3190 + } 3191 + } 3192 + 3193 + #define CRTC_IDLE_TIMEOUT 1000 /* ms */ 3194 + 3195 + static void intel_crtc_idle_timer(unsigned long arg) 3196 + { 3197 + struct intel_crtc *intel_crtc = (struct intel_crtc *)arg; 3198 + struct drm_crtc *crtc = &intel_crtc->base; 3199 + drm_i915_private_t *dev_priv = crtc->dev->dev_private; 3200 + 3201 + DRM_DEBUG("idle timer fired, downclocking\n"); 3202 + 3203 + intel_crtc->busy = false; 3204 + 3205 + queue_work(dev_priv->wq, &dev_priv->idle_work); 3206 + } 3207 + 3208 + static void intel_increase_pllclock(struct drm_crtc *crtc, bool schedule) 3209 + { 3210 + struct drm_device *dev = crtc->dev; 3211 + drm_i915_private_t *dev_priv = dev->dev_private; 3212 + struct intel_crtc *intel_crtc = to_intel_crtc(crtc); 3213 + int pipe = intel_crtc->pipe; 3214 + int dpll_reg = (pipe == 0) ? DPLL_A : DPLL_B; 3215 + int dpll = I915_READ(dpll_reg); 3216 + 3217 + if (IS_IGDNG(dev)) 3218 + return; 3219 + 3220 + if (!dev_priv->lvds_downclock_avail) 3221 + return; 3222 + 3223 + if (!HAS_PIPE_CXSR(dev) && (dpll & DISPLAY_RATE_SELECT_FPA1)) { 3224 + DRM_DEBUG("upclocking LVDS\n"); 3225 + 3226 + /* Unlock panel regs */ 3227 + I915_WRITE(PP_CONTROL, I915_READ(PP_CONTROL) | (0xabcd << 16)); 3228 + 3229 + dpll &= ~DISPLAY_RATE_SELECT_FPA1; 3230 + I915_WRITE(dpll_reg, dpll); 3231 + dpll = I915_READ(dpll_reg); 3232 + intel_wait_for_vblank(dev); 3233 + dpll = I915_READ(dpll_reg); 3234 + if (dpll & DISPLAY_RATE_SELECT_FPA1) 3235 + DRM_DEBUG("failed to upclock LVDS!\n"); 3236 + 3237 + /* ...and lock them again */ 3238 + I915_WRITE(PP_CONTROL, I915_READ(PP_CONTROL) & 0x3); 3239 + } 3240 + 3241 + /* Schedule downclock */ 3242 + if (schedule) 3243 + mod_timer(&intel_crtc->idle_timer, jiffies + 3244 + msecs_to_jiffies(CRTC_IDLE_TIMEOUT)); 3245 + } 3246 + 3247 + static void intel_decrease_pllclock(struct drm_crtc *crtc) 3248 + { 3249 + struct drm_device *dev = crtc->dev; 3250 + drm_i915_private_t *dev_priv = dev->dev_private; 3251 + struct intel_crtc *intel_crtc = to_intel_crtc(crtc); 3252 + int pipe = intel_crtc->pipe; 3253 + int dpll_reg = (pipe == 0) ? DPLL_A : DPLL_B; 3254 + int dpll = I915_READ(dpll_reg); 3255 + 3256 + if (IS_IGDNG(dev)) 3257 + return; 3258 + 3259 + if (!dev_priv->lvds_downclock_avail) 3260 + return; 3261 + 3262 + /* 3263 + * Since this is called by a timer, we should never get here in 3264 + * the manual case. 3265 + */ 3266 + if (!HAS_PIPE_CXSR(dev) && intel_crtc->lowfreq_avail) { 3267 + DRM_DEBUG("downclocking LVDS\n"); 3268 + 3269 + /* Unlock panel regs */ 3270 + I915_WRITE(PP_CONTROL, I915_READ(PP_CONTROL) | (0xabcd << 16)); 3271 + 3272 + dpll |= DISPLAY_RATE_SELECT_FPA1; 3273 + I915_WRITE(dpll_reg, dpll); 3274 + dpll = I915_READ(dpll_reg); 3275 + intel_wait_for_vblank(dev); 3276 + dpll = I915_READ(dpll_reg); 3277 + if (!(dpll & DISPLAY_RATE_SELECT_FPA1)) 3278 + DRM_DEBUG("failed to downclock LVDS!\n"); 3279 + 3280 + /* ...and lock them again */ 3281 + I915_WRITE(PP_CONTROL, I915_READ(PP_CONTROL) & 0x3); 3282 + } 3283 + 3284 + } 3285 + 3286 + /** 3287 + * intel_idle_update - adjust clocks for idleness 3288 + * @work: work struct 3289 + * 3290 + * Either the GPU or display (or both) went idle. Check the busy status 3291 + * here and adjust the CRTC and GPU clocks as necessary. 3292 + */ 3293 + static void intel_idle_update(struct work_struct *work) 3294 + { 3295 + drm_i915_private_t *dev_priv = container_of(work, drm_i915_private_t, 3296 + idle_work); 3297 + struct drm_device *dev = dev_priv->dev; 3298 + struct drm_crtc *crtc; 3299 + struct intel_crtc *intel_crtc; 3300 + 3301 + if (!i915_powersave) 3302 + return; 3303 + 3304 + mutex_lock(&dev->struct_mutex); 3305 + 3306 + /* GPU isn't processing, downclock it. */ 3307 + if (!dev_priv->busy) { 3308 + intel_decrease_renderclock(dev); 3309 + intel_decrease_displayclock(dev); 3310 + } 3311 + 3312 + list_for_each_entry(crtc, &dev->mode_config.crtc_list, head) { 3313 + /* Skip inactive CRTCs */ 3314 + if (!crtc->fb) 3315 + continue; 3316 + 3317 + intel_crtc = to_intel_crtc(crtc); 3318 + if (!intel_crtc->busy) 3319 + intel_decrease_pllclock(crtc); 3320 + } 3321 + 3322 + mutex_unlock(&dev->struct_mutex); 3323 + } 3324 + 3325 + /** 3326 + * intel_mark_busy - mark the GPU and possibly the display busy 3327 + * @dev: drm device 3328 + * @obj: object we're operating on 3329 + * 3330 + * Callers can use this function to indicate that the GPU is busy processing 3331 + * commands. If @obj matches one of the CRTC objects (i.e. it's a scanout 3332 + * buffer), we'll also mark the display as busy, so we know to increase its 3333 + * clock frequency. 3334 + */ 3335 + void intel_mark_busy(struct drm_device *dev, struct drm_gem_object *obj) 3336 + { 3337 + drm_i915_private_t *dev_priv = dev->dev_private; 3338 + struct drm_crtc *crtc = NULL; 3339 + struct intel_framebuffer *intel_fb; 3340 + struct intel_crtc *intel_crtc; 3341 + 3342 + if (!drm_core_check_feature(dev, DRIVER_MODESET)) 3343 + return; 3344 + 3345 + dev_priv->busy = true; 3346 + intel_increase_renderclock(dev, true); 3347 + 3348 + list_for_each_entry(crtc, &dev->mode_config.crtc_list, head) { 3349 + if (!crtc->fb) 3350 + continue; 3351 + 3352 + intel_crtc = to_intel_crtc(crtc); 3353 + intel_fb = to_intel_framebuffer(crtc->fb); 3354 + if (intel_fb->obj == obj) { 3355 + if (!intel_crtc->busy) { 3356 + /* Non-busy -> busy, upclock */ 3357 + intel_increase_pllclock(crtc, true); 3358 + intel_crtc->busy = true; 3359 + } else { 3360 + /* Busy -> busy, put off timer */ 3361 + mod_timer(&intel_crtc->idle_timer, jiffies + 3362 + msecs_to_jiffies(CRTC_IDLE_TIMEOUT)); 3363 + } 3364 + } 3365 + } 3366 + } 3367 + 3192 3368 static void intel_crtc_destroy(struct drm_crtc *crtc) 3193 3369 { 3194 3370 struct intel_crtc *intel_crtc = to_intel_crtc(crtc); ··· 3547 3105 intel_crtc->cursor_addr = 0; 3548 3106 intel_crtc->dpms_mode = DRM_MODE_DPMS_OFF; 3549 3107 drm_crtc_helper_add(&intel_crtc->base, &intel_helper_funcs); 3108 + 3109 + intel_crtc->busy = false; 3110 + 3111 + setup_timer(&intel_crtc->idle_timer, intel_crtc_idle_timer, 3112 + (unsigned long)intel_crtc); 3550 3113 } 3551 3114 3552 3115 int intel_get_pipe_from_crtc_id(struct drm_device *dev, void *data, ··· 3559 3112 { 3560 3113 drm_i915_private_t *dev_priv = dev->dev_private; 3561 3114 struct drm_i915_get_pipe_from_crtc_id *pipe_from_crtc_id = data; 3562 - struct drm_crtc *crtc = NULL; 3563 - int pipe = -1; 3115 + struct drm_mode_object *drmmode_obj; 3116 + struct intel_crtc *crtc; 3564 3117 3565 3118 if (!dev_priv) { 3566 3119 DRM_ERROR("called with no initialization\n"); 3567 3120 return -EINVAL; 3568 3121 } 3569 3122 3570 - list_for_each_entry(crtc, &dev->mode_config.crtc_list, head) { 3571 - struct intel_crtc *intel_crtc = to_intel_crtc(crtc); 3572 - if (crtc->base.id == pipe_from_crtc_id->crtc_id) { 3573 - pipe = intel_crtc->pipe; 3574 - break; 3575 - } 3576 - } 3123 + drmmode_obj = drm_mode_object_find(dev, pipe_from_crtc_id->crtc_id, 3124 + DRM_MODE_OBJECT_CRTC); 3577 3125 3578 - if (pipe == -1) { 3126 + if (!drmmode_obj) { 3579 3127 DRM_ERROR("no such CRTC id\n"); 3580 3128 return -EINVAL; 3581 3129 } 3582 3130 3583 - pipe_from_crtc_id->pipe = pipe; 3131 + crtc = to_intel_crtc(obj_to_crtc(drmmode_obj)); 3132 + pipe_from_crtc_id->pipe = crtc->pipe; 3584 3133 3585 - return 0; 3134 + return 0; 3586 3135 } 3587 3136 3588 3137 struct drm_crtc *intel_get_crtc_from_pipe(struct drm_device *dev, int pipe) ··· 3601 3158 3602 3159 list_for_each_entry(connector, &dev->mode_config.connector_list, head) { 3603 3160 struct intel_output *intel_output = to_intel_output(connector); 3604 - if (type_mask & (1 << intel_output->type)) 3161 + if (type_mask & intel_output->clone_mask) 3605 3162 index_mask |= (1 << entry); 3606 3163 entry++; 3607 3164 } ··· 3649 3206 intel_dp_init(dev, PCH_DP_D); 3650 3207 3651 3208 } else if (IS_I9XX(dev)) { 3652 - int found; 3653 - u32 reg; 3209 + bool found = false; 3654 3210 3655 3211 if (I915_READ(SDVOB) & SDVO_DETECTED) { 3656 3212 found = intel_sdvo_init(dev, SDVOB); 3657 3213 if (!found && SUPPORTS_INTEGRATED_HDMI(dev)) 3658 3214 intel_hdmi_init(dev, SDVOB); 3215 + 3659 3216 if (!found && SUPPORTS_INTEGRATED_DP(dev)) 3660 3217 intel_dp_init(dev, DP_B); 3661 3218 } 3662 3219 3663 3220 /* Before G4X SDVOC doesn't have its own detect register */ 3664 - if (IS_G4X(dev)) 3665 - reg = SDVOC; 3666 - else 3667 - reg = SDVOB; 3668 3221 3669 - if (I915_READ(reg) & SDVO_DETECTED) { 3222 + if (I915_READ(SDVOB) & SDVO_DETECTED) 3670 3223 found = intel_sdvo_init(dev, SDVOC); 3671 - if (!found && SUPPORTS_INTEGRATED_HDMI(dev)) 3224 + 3225 + if (!found && (I915_READ(SDVOC) & SDVO_DETECTED)) { 3226 + 3227 + if (SUPPORTS_INTEGRATED_HDMI(dev)) 3672 3228 intel_hdmi_init(dev, SDVOC); 3673 - if (!found && SUPPORTS_INTEGRATED_DP(dev)) 3229 + if (SUPPORTS_INTEGRATED_DP(dev)) 3674 3230 intel_dp_init(dev, DP_C); 3675 3231 } 3232 + 3676 3233 if (SUPPORTS_INTEGRATED_DP(dev) && (I915_READ(DP_D) & DP_DETECTED)) 3677 3234 intel_dp_init(dev, DP_D); 3678 3235 } else ··· 3684 3241 list_for_each_entry(connector, &dev->mode_config.connector_list, head) { 3685 3242 struct intel_output *intel_output = to_intel_output(connector); 3686 3243 struct drm_encoder *encoder = &intel_output->enc; 3687 - int crtc_mask = 0, clone_mask = 0; 3688 3244 3689 - /* valid crtcs */ 3690 - switch(intel_output->type) { 3691 - case INTEL_OUTPUT_HDMI: 3692 - crtc_mask = ((1 << 0)| 3693 - (1 << 1)); 3694 - clone_mask = ((1 << INTEL_OUTPUT_HDMI)); 3695 - break; 3696 - case INTEL_OUTPUT_DVO: 3697 - case INTEL_OUTPUT_SDVO: 3698 - crtc_mask = ((1 << 0)| 3699 - (1 << 1)); 3700 - clone_mask = ((1 << INTEL_OUTPUT_ANALOG) | 3701 - (1 << INTEL_OUTPUT_DVO) | 3702 - (1 << INTEL_OUTPUT_SDVO)); 3703 - break; 3704 - case INTEL_OUTPUT_ANALOG: 3705 - crtc_mask = ((1 << 0)| 3706 - (1 << 1)); 3707 - clone_mask = ((1 << INTEL_OUTPUT_ANALOG) | 3708 - (1 << INTEL_OUTPUT_DVO) | 3709 - (1 << INTEL_OUTPUT_SDVO)); 3710 - break; 3711 - case INTEL_OUTPUT_LVDS: 3712 - crtc_mask = (1 << 1); 3713 - clone_mask = (1 << INTEL_OUTPUT_LVDS); 3714 - break; 3715 - case INTEL_OUTPUT_TVOUT: 3716 - crtc_mask = ((1 << 0) | 3717 - (1 << 1)); 3718 - clone_mask = (1 << INTEL_OUTPUT_TVOUT); 3719 - break; 3720 - case INTEL_OUTPUT_DISPLAYPORT: 3721 - crtc_mask = ((1 << 0) | 3722 - (1 << 1)); 3723 - clone_mask = (1 << INTEL_OUTPUT_DISPLAYPORT); 3724 - break; 3725 - case INTEL_OUTPUT_EDP: 3726 - crtc_mask = (1 << 1); 3727 - clone_mask = (1 << INTEL_OUTPUT_EDP); 3728 - break; 3729 - } 3730 - encoder->possible_crtcs = crtc_mask; 3731 - encoder->possible_clones = intel_connector_clones(dev, clone_mask); 3245 + encoder->possible_crtcs = intel_output->crtc_mask; 3246 + encoder->possible_clones = intel_connector_clones(dev, 3247 + intel_output->clone_mask); 3732 3248 } 3733 3249 } 3734 3250 ··· 3779 3377 .fb_changed = intelfb_probe, 3780 3378 }; 3781 3379 3380 + void intel_init_clock_gating(struct drm_device *dev) 3381 + { 3382 + struct drm_i915_private *dev_priv = dev->dev_private; 3383 + 3384 + /* 3385 + * Disable clock gating reported to work incorrectly according to the 3386 + * specs, but enable as much else as we can. 3387 + */ 3388 + if (IS_G4X(dev)) { 3389 + uint32_t dspclk_gate; 3390 + I915_WRITE(RENCLK_GATE_D1, 0); 3391 + I915_WRITE(RENCLK_GATE_D2, VF_UNIT_CLOCK_GATE_DISABLE | 3392 + GS_UNIT_CLOCK_GATE_DISABLE | 3393 + CL_UNIT_CLOCK_GATE_DISABLE); 3394 + I915_WRITE(RAMCLK_GATE_D, 0); 3395 + dspclk_gate = VRHUNIT_CLOCK_GATE_DISABLE | 3396 + OVRUNIT_CLOCK_GATE_DISABLE | 3397 + OVCUNIT_CLOCK_GATE_DISABLE; 3398 + if (IS_GM45(dev)) 3399 + dspclk_gate |= DSSUNIT_CLOCK_GATE_DISABLE; 3400 + I915_WRITE(DSPCLK_GATE_D, dspclk_gate); 3401 + } else if (IS_I965GM(dev)) { 3402 + I915_WRITE(RENCLK_GATE_D1, I965_RCC_CLOCK_GATE_DISABLE); 3403 + I915_WRITE(RENCLK_GATE_D2, 0); 3404 + I915_WRITE(DSPCLK_GATE_D, 0); 3405 + I915_WRITE(RAMCLK_GATE_D, 0); 3406 + I915_WRITE16(DEUC, 0); 3407 + } else if (IS_I965G(dev)) { 3408 + I915_WRITE(RENCLK_GATE_D1, I965_RCZ_CLOCK_GATE_DISABLE | 3409 + I965_RCC_CLOCK_GATE_DISABLE | 3410 + I965_RCPB_CLOCK_GATE_DISABLE | 3411 + I965_ISC_CLOCK_GATE_DISABLE | 3412 + I965_FBC_CLOCK_GATE_DISABLE); 3413 + I915_WRITE(RENCLK_GATE_D2, 0); 3414 + } else if (IS_I9XX(dev)) { 3415 + u32 dstate = I915_READ(D_STATE); 3416 + 3417 + dstate |= DSTATE_PLL_D3_OFF | DSTATE_GFX_CLOCK_GATING | 3418 + DSTATE_DOT_CLOCK_GATING; 3419 + I915_WRITE(D_STATE, dstate); 3420 + } else if (IS_I855(dev) || IS_I865G(dev)) { 3421 + I915_WRITE(RENCLK_GATE_D1, SV_CLOCK_GATE_DISABLE); 3422 + } else if (IS_I830(dev)) { 3423 + I915_WRITE(DSPCLK_GATE_D, OVRUNIT_CLOCK_GATE_DISABLE); 3424 + } 3425 + } 3426 + 3782 3427 void intel_modeset_init(struct drm_device *dev) 3783 3428 { 3429 + struct drm_i915_private *dev_priv = dev->dev_private; 3784 3430 int num_pipe; 3785 3431 int i; 3786 3432 ··· 3863 3413 DRM_DEBUG("%d display pipe%s available.\n", 3864 3414 num_pipe, num_pipe > 1 ? "s" : ""); 3865 3415 3416 + if (IS_I85X(dev)) 3417 + pci_read_config_word(dev->pdev, HPLLCC, &dev_priv->orig_clock); 3418 + else if (IS_I9XX(dev) || IS_G4X(dev)) 3419 + pci_read_config_word(dev->pdev, GCFGC, &dev_priv->orig_clock); 3420 + 3866 3421 for (i = 0; i < num_pipe; i++) { 3867 3422 intel_crtc_init(dev, i); 3868 3423 } 3869 3424 3870 3425 intel_setup_outputs(dev); 3426 + 3427 + intel_init_clock_gating(dev); 3428 + 3429 + INIT_WORK(&dev_priv->idle_work, intel_idle_update); 3430 + setup_timer(&dev_priv->idle_timer, intel_gpu_idle_timer, 3431 + (unsigned long)dev); 3871 3432 } 3872 3433 3873 3434 void intel_modeset_cleanup(struct drm_device *dev) 3874 3435 { 3436 + struct drm_i915_private *dev_priv = dev->dev_private; 3437 + struct drm_crtc *crtc; 3438 + struct intel_crtc *intel_crtc; 3439 + 3440 + mutex_lock(&dev->struct_mutex); 3441 + 3442 + list_for_each_entry(crtc, &dev->mode_config.crtc_list, head) { 3443 + /* Skip inactive CRTCs */ 3444 + if (!crtc->fb) 3445 + continue; 3446 + 3447 + intel_crtc = to_intel_crtc(crtc); 3448 + intel_increase_pllclock(crtc, false); 3449 + del_timer_sync(&intel_crtc->idle_timer); 3450 + } 3451 + 3452 + intel_increase_renderclock(dev, false); 3453 + del_timer_sync(&dev_priv->idle_timer); 3454 + 3455 + mutex_unlock(&dev->struct_mutex); 3456 + 3875 3457 drm_mode_config_cleanup(dev); 3876 3458 } 3877 3459
+12
drivers/gpu/drm/i915/intel_dp.c
··· 1254 1254 else 1255 1255 intel_output->type = INTEL_OUTPUT_DISPLAYPORT; 1256 1256 1257 + if (output_reg == DP_B) 1258 + intel_output->clone_mask = (1 << INTEL_DP_B_CLONE_BIT); 1259 + else if (output_reg == DP_C) 1260 + intel_output->clone_mask = (1 << INTEL_DP_C_CLONE_BIT); 1261 + else if (output_reg == DP_D) 1262 + intel_output->clone_mask = (1 << INTEL_DP_D_CLONE_BIT); 1263 + 1264 + if (IS_eDP(intel_output)) { 1265 + intel_output->crtc_mask = (1 << 1); 1266 + intel_output->clone_mask = (1 << INTEL_OUTPUT_EDP); 1267 + } else 1268 + intel_output->crtc_mask = (1 << 0) | (1 << 1); 1257 1269 connector->interlace_allowed = true; 1258 1270 connector->doublescan_allowed = 0; 1259 1271
+24
drivers/gpu/drm/i915/intel_drv.h
··· 57 57 #define INTEL_OUTPUT_DISPLAYPORT 7 58 58 #define INTEL_OUTPUT_EDP 8 59 59 60 + /* Intel Pipe Clone Bit */ 61 + #define INTEL_HDMIB_CLONE_BIT 1 62 + #define INTEL_HDMIC_CLONE_BIT 2 63 + #define INTEL_HDMID_CLONE_BIT 3 64 + #define INTEL_HDMIE_CLONE_BIT 4 65 + #define INTEL_HDMIF_CLONE_BIT 5 66 + #define INTEL_SDVO_NON_TV_CLONE_BIT 6 67 + #define INTEL_SDVO_TV_CLONE_BIT 7 68 + #define INTEL_SDVO_LVDS_CLONE_BIT 8 69 + #define INTEL_ANALOG_CLONE_BIT 9 70 + #define INTEL_TV_CLONE_BIT 10 71 + #define INTEL_DP_B_CLONE_BIT 11 72 + #define INTEL_DP_C_CLONE_BIT 12 73 + #define INTEL_DP_D_CLONE_BIT 13 74 + #define INTEL_LVDS_CLONE_BIT 14 75 + #define INTEL_DVO_TMDS_CLONE_BIT 15 76 + #define INTEL_DVO_LVDS_CLONE_BIT 16 77 + 60 78 #define INTEL_DVO_CHIP_NONE 0 61 79 #define INTEL_DVO_CHIP_LVDS 1 62 80 #define INTEL_DVO_CHIP_TMDS 2 ··· 104 86 bool needs_tv_clock; 105 87 void *dev_priv; 106 88 void (*hot_plug)(struct intel_output *); 89 + int crtc_mask; 90 + int clone_mask; 107 91 }; 108 92 109 93 struct intel_crtc { ··· 116 96 uint32_t cursor_addr; 117 97 u8 lut_r[256], lut_g[256], lut_b[256]; 118 98 int dpms_mode; 99 + bool busy; /* is scanout buffer being updated frequently? */ 100 + struct timer_list idle_timer; 101 + bool lowfreq_avail; 119 102 }; 120 103 121 104 #define to_intel_crtc(x) container_of(x, struct intel_crtc, base) ··· 137 114 extern bool intel_sdvo_init(struct drm_device *dev, int output_device); 138 115 extern void intel_dvo_init(struct drm_device *dev); 139 116 extern void intel_tv_init(struct drm_device *dev); 117 + extern void intel_mark_busy(struct drm_device *dev, struct drm_gem_object *obj); 140 118 extern void intel_lvds_init(struct drm_device *dev); 141 119 extern void intel_dp_init(struct drm_device *dev, int dp_reg); 142 120 void
+6
drivers/gpu/drm/i915/intel_dvo.c
··· 435 435 continue; 436 436 437 437 intel_output->type = INTEL_OUTPUT_DVO; 438 + intel_output->crtc_mask = (1 << 0) | (1 << 1); 438 439 switch (dvo->type) { 439 440 case INTEL_DVO_CHIP_TMDS: 441 + intel_output->clone_mask = 442 + (1 << INTEL_DVO_TMDS_CLONE_BIT) | 443 + (1 << INTEL_ANALOG_CLONE_BIT); 440 444 drm_connector_init(dev, connector, 441 445 &intel_dvo_connector_funcs, 442 446 DRM_MODE_CONNECTOR_DVII); 443 447 encoder_type = DRM_MODE_ENCODER_TMDS; 444 448 break; 445 449 case INTEL_DVO_CHIP_LVDS: 450 + intel_output->clone_mask = 451 + (1 << INTEL_DVO_LVDS_CLONE_BIT); 446 452 drm_connector_init(dev, connector, 447 453 &intel_dvo_connector_funcs, 448 454 DRM_MODE_CONNECTOR_LVDS);
+12 -6
drivers/gpu/drm/i915/intel_hdmi.c
··· 230 230 231 231 connector->interlace_allowed = 0; 232 232 connector->doublescan_allowed = 0; 233 + intel_output->crtc_mask = (1 << 0) | (1 << 1); 233 234 234 235 /* Set up the DDC bus. */ 235 - if (sdvox_reg == SDVOB) 236 + if (sdvox_reg == SDVOB) { 237 + intel_output->clone_mask = (1 << INTEL_HDMIB_CLONE_BIT); 236 238 intel_output->ddc_bus = intel_i2c_create(dev, GPIOE, "HDMIB"); 237 - else if (sdvox_reg == SDVOC) 239 + } else if (sdvox_reg == SDVOC) { 240 + intel_output->clone_mask = (1 << INTEL_HDMIC_CLONE_BIT); 238 241 intel_output->ddc_bus = intel_i2c_create(dev, GPIOD, "HDMIC"); 239 - else if (sdvox_reg == HDMIB) 242 + } else if (sdvox_reg == HDMIB) { 243 + intel_output->clone_mask = (1 << INTEL_HDMID_CLONE_BIT); 240 244 intel_output->ddc_bus = intel_i2c_create(dev, PCH_GPIOE, 241 245 "HDMIB"); 242 - else if (sdvox_reg == HDMIC) 246 + } else if (sdvox_reg == HDMIC) { 247 + intel_output->clone_mask = (1 << INTEL_HDMIE_CLONE_BIT); 243 248 intel_output->ddc_bus = intel_i2c_create(dev, PCH_GPIOD, 244 249 "HDMIC"); 245 - else if (sdvox_reg == HDMID) 250 + } else if (sdvox_reg == HDMID) { 251 + intel_output->clone_mask = (1 << INTEL_HDMIF_CLONE_BIT); 246 252 intel_output->ddc_bus = intel_i2c_create(dev, PCH_GPIOF, 247 253 "HDMID"); 248 - 254 + } 249 255 if (!intel_output->ddc_bus) 250 256 goto err_connector; 251 257
+4 -4
drivers/gpu/drm/i915/intel_i2c.c
··· 42 42 if (!IS_IGD(dev)) 43 43 return; 44 44 if (enable) 45 - I915_WRITE(CG_2D_DIS, 46 - I915_READ(CG_2D_DIS) | DPCUNIT_CLOCK_GATE_DISABLE); 45 + I915_WRITE(DSPCLK_GATE_D, 46 + I915_READ(DSPCLK_GATE_D) | DPCUNIT_CLOCK_GATE_DISABLE); 47 47 else 48 - I915_WRITE(CG_2D_DIS, 49 - I915_READ(CG_2D_DIS) & (~DPCUNIT_CLOCK_GATE_DISABLE)); 48 + I915_WRITE(DSPCLK_GATE_D, 49 + I915_READ(DSPCLK_GATE_D) & (~DPCUNIT_CLOCK_GATE_DISABLE)); 50 50 } 51 51 52 52 /*
+2
drivers/gpu/drm/i915/intel_lvds.c
··· 904 904 drm_mode_connector_attach_encoder(&intel_output->base, &intel_output->enc); 905 905 intel_output->type = INTEL_OUTPUT_LVDS; 906 906 907 + intel_output->clone_mask = (1 << INTEL_LVDS_CLONE_BIT); 908 + intel_output->crtc_mask = (1 << 1); 907 909 drm_encoder_helper_add(encoder, &intel_lvds_helper_funcs); 908 910 drm_connector_helper_add(connector, &intel_lvds_connector_helper_funcs); 909 911 connector->display_info.subpixel_order = SubPixelHorizontalRGB;
+241 -72
drivers/gpu/drm/i915/intel_sdvo.c
··· 37 37 #include "intel_sdvo_regs.h" 38 38 39 39 #undef SDVO_DEBUG 40 + 41 + static char *tv_format_names[] = { 42 + "NTSC_M" , "NTSC_J" , "NTSC_443", 43 + "PAL_B" , "PAL_D" , "PAL_G" , 44 + "PAL_H" , "PAL_I" , "PAL_M" , 45 + "PAL_N" , "PAL_NC" , "PAL_60" , 46 + "SECAM_B" , "SECAM_D" , "SECAM_G" , 47 + "SECAM_K" , "SECAM_K1", "SECAM_L" , 48 + "SECAM_60" 49 + }; 50 + 51 + #define TV_FORMAT_NUM (sizeof(tv_format_names) / sizeof(*tv_format_names)) 52 + 40 53 struct intel_sdvo_priv { 41 54 u8 slave_addr; 42 55 ··· 83 70 */ 84 71 bool is_tv; 85 72 73 + /* This is for current tv format name */ 74 + char *tv_format_name; 75 + 76 + /* This contains all current supported TV format */ 77 + char *tv_format_supported[TV_FORMAT_NUM]; 78 + int format_supported_num; 79 + struct drm_property *tv_format_property; 80 + struct drm_property *tv_format_name_property[TV_FORMAT_NUM]; 81 + 86 82 /** 87 83 * This is set if we treat the device as HDMI, instead of DVI. 88 84 */ ··· 118 96 */ 119 97 struct intel_sdvo_sdtv_resolution_reply sdtv_resolutions; 120 98 121 - /** 122 - * Current selected TV format. 123 - * 124 - * This is stored in the same structure that's passed to the device, for 125 - * convenience. 126 - */ 127 - struct intel_sdvo_tv_format tv_format; 128 - 129 99 /* 130 100 * supported encoding mode, used to determine whether HDMI is 131 101 * supported ··· 126 112 127 113 /* DDC bus used by this SDVO output */ 128 114 uint8_t ddc_bus; 115 + 116 + /* Mac mini hack -- use the same DDC as the analog connector */ 117 + struct i2c_adapter *analog_ddc_bus; 129 118 130 119 int save_sdvo_mult; 131 120 u16 save_active_outputs; ··· 961 944 962 945 static void intel_sdvo_set_tv_format(struct intel_output *output) 963 946 { 964 - struct intel_sdvo_priv *sdvo_priv = output->dev_priv; 965 - struct intel_sdvo_tv_format *format, unset; 966 - u8 status; 967 947 968 - format = &sdvo_priv->tv_format; 969 - memset(&unset, 0, sizeof(unset)); 970 - if (memcmp(format, &unset, sizeof(*format))) { 971 - DRM_DEBUG_KMS("%s: Choosing default TV format of NTSC-M\n", 972 - SDVO_NAME(sdvo_priv)); 973 - format->ntsc_m = 1; 974 - intel_sdvo_write_cmd(output, SDVO_CMD_SET_TV_FORMAT, format, 975 - sizeof(*format)); 976 - status = intel_sdvo_read_response(output, NULL, 0); 977 - if (status != SDVO_CMD_STATUS_SUCCESS) 978 - DRM_DEBUG_KMS("%s: Failed to set TV format\n", 979 - SDVO_NAME(sdvo_priv)); 980 - } 948 + struct intel_sdvo_tv_format format; 949 + struct intel_sdvo_priv *sdvo_priv = output->dev_priv; 950 + uint32_t format_map, i; 951 + uint8_t status; 952 + 953 + for (i = 0; i < TV_FORMAT_NUM; i++) 954 + if (tv_format_names[i] == sdvo_priv->tv_format_name) 955 + break; 956 + 957 + format_map = 1 << i; 958 + memset(&format, 0, sizeof(format)); 959 + memcpy(&format, &format_map, sizeof(format_map) > sizeof(format) ? 960 + sizeof(format) : sizeof(format_map)); 961 + 962 + intel_sdvo_write_cmd(output, SDVO_CMD_SET_TV_FORMAT, &format_map, 963 + sizeof(format)); 964 + 965 + status = intel_sdvo_read_response(output, NULL, 0); 966 + if (status != SDVO_CMD_STATUS_SUCCESS) 967 + DRM_DEBUG("%s: Failed to set TV format\n", 968 + SDVO_NAME(sdvo_priv)); 981 969 } 982 970 983 971 static bool intel_sdvo_mode_fixup(struct drm_encoder *encoder, ··· 1479 1457 (SDVO_OUTPUT_RGB0 | SDVO_OUTPUT_RGB1)) 1480 1458 caps++; 1481 1459 if (sdvo_priv->caps.output_flags & 1482 - (SDVO_OUTPUT_SVID0 | SDVO_OUTPUT_SVID0)) 1460 + (SDVO_OUTPUT_SVID0 | SDVO_OUTPUT_SVID1)) 1483 1461 caps++; 1484 1462 if (sdvo_priv->caps.output_flags & 1485 1463 (SDVO_OUTPUT_CVBS0 | SDVO_OUTPUT_CVBS1)) ··· 1499 1477 return (caps > 1); 1500 1478 } 1501 1479 1480 + static struct drm_connector * 1481 + intel_find_analog_connector(struct drm_device *dev) 1482 + { 1483 + struct drm_connector *connector; 1484 + struct intel_output *intel_output; 1485 + 1486 + list_for_each_entry(connector, &dev->mode_config.connector_list, head) { 1487 + intel_output = to_intel_output(connector); 1488 + if (intel_output->type == INTEL_OUTPUT_ANALOG) 1489 + return connector; 1490 + } 1491 + return NULL; 1492 + } 1493 + 1494 + static int 1495 + intel_analog_is_connected(struct drm_device *dev) 1496 + { 1497 + struct drm_connector *analog_connector; 1498 + analog_connector = intel_find_analog_connector(dev); 1499 + 1500 + if (!analog_connector) 1501 + return false; 1502 + 1503 + if (analog_connector->funcs->detect(analog_connector) == 1504 + connector_status_disconnected) 1505 + return false; 1506 + 1507 + return true; 1508 + } 1509 + 1502 1510 enum drm_connector_status 1503 1511 intel_sdvo_hdmi_sink_detect(struct drm_connector *connector, u16 response) 1504 1512 { ··· 1539 1487 1540 1488 edid = drm_get_edid(&intel_output->base, 1541 1489 intel_output->ddc_bus); 1490 + 1491 + /* when there is no edid and no monitor is connected with VGA 1492 + * port, try to use the CRT ddc to read the EDID for DVI-connector 1493 + */ 1494 + if (edid == NULL && 1495 + sdvo_priv->analog_ddc_bus && 1496 + !intel_analog_is_connected(intel_output->base.dev)) 1497 + edid = drm_get_edid(&intel_output->base, 1498 + sdvo_priv->analog_ddc_bus); 1542 1499 if (edid != NULL) { 1543 1500 /* Don't report the output as connected if it's a DVI-I 1544 1501 * connector with a non-digital EDID coming out. ··· 1576 1515 struct intel_output *intel_output = to_intel_output(connector); 1577 1516 struct intel_sdvo_priv *sdvo_priv = intel_output->dev_priv; 1578 1517 1579 - intel_sdvo_write_cmd(intel_output, SDVO_CMD_GET_ATTACHED_DISPLAYS, NULL, 0); 1518 + intel_sdvo_write_cmd(intel_output, 1519 + SDVO_CMD_GET_ATTACHED_DISPLAYS, NULL, 0); 1580 1520 status = intel_sdvo_read_response(intel_output, &response, 2); 1581 1521 1582 1522 DRM_DEBUG_KMS("SDVO response %d %d\n", response & 0xff, response >> 8); ··· 1601 1539 static void intel_sdvo_get_ddc_modes(struct drm_connector *connector) 1602 1540 { 1603 1541 struct intel_output *intel_output = to_intel_output(connector); 1542 + struct intel_sdvo_priv *sdvo_priv = intel_output->dev_priv; 1543 + int num_modes; 1604 1544 1605 1545 /* set the bus switch and get the modes */ 1606 - intel_ddc_get_modes(intel_output); 1546 + num_modes = intel_ddc_get_modes(intel_output); 1607 1547 1608 - #if 0 1609 - struct drm_device *dev = encoder->dev; 1610 - struct drm_i915_private *dev_priv = dev->dev_private; 1611 - /* Mac mini hack. On this device, I get DDC through the analog, which 1612 - * load-detects as disconnected. I fail to DDC through the SDVO DDC, 1613 - * but it does load-detect as connected. So, just steal the DDC bits 1614 - * from analog when we fail at finding it the right way. 1548 + /* 1549 + * Mac mini hack. On this device, the DVI-I connector shares one DDC 1550 + * link between analog and digital outputs. So, if the regular SDVO 1551 + * DDC fails, check to see if the analog output is disconnected, in 1552 + * which case we'll look there for the digital DDC data. 1615 1553 */ 1616 - crt = xf86_config->output[0]; 1617 - intel_output = crt->driver_private; 1618 - if (intel_output->type == I830_OUTPUT_ANALOG && 1619 - crt->funcs->detect(crt) == XF86OutputStatusDisconnected) { 1620 - I830I2CInit(pScrn, &intel_output->pDDCBus, GPIOA, "CRTDDC_A"); 1621 - edid_mon = xf86OutputGetEDID(crt, intel_output->pDDCBus); 1622 - xf86DestroyI2CBusRec(intel_output->pDDCBus, true, true); 1554 + if (num_modes == 0 && 1555 + sdvo_priv->analog_ddc_bus && 1556 + !intel_analog_is_connected(intel_output->base.dev)) { 1557 + struct i2c_adapter *digital_ddc_bus; 1558 + 1559 + /* Switch to the analog ddc bus and try that 1560 + */ 1561 + digital_ddc_bus = intel_output->ddc_bus; 1562 + intel_output->ddc_bus = sdvo_priv->analog_ddc_bus; 1563 + 1564 + (void) intel_ddc_get_modes(intel_output); 1565 + 1566 + intel_output->ddc_bus = digital_ddc_bus; 1623 1567 } 1624 - if (edid_mon) { 1625 - xf86OutputSetEDID(output, edid_mon); 1626 - modes = xf86OutputGetEDIDModes(output); 1627 - } 1628 - #endif 1629 - } 1630 - 1631 - /** 1632 - * This function checks the current TV format, and chooses a default if 1633 - * it hasn't been set. 1634 - */ 1635 - static void 1636 - intel_sdvo_check_tv_format(struct intel_output *output) 1637 - { 1638 - struct intel_sdvo_priv *dev_priv = output->dev_priv; 1639 - struct intel_sdvo_tv_format format; 1640 - uint8_t status; 1641 - 1642 - intel_sdvo_write_cmd(output, SDVO_CMD_GET_TV_FORMAT, NULL, 0); 1643 - status = intel_sdvo_read_response(output, &format, sizeof(format)); 1644 - if (status != SDVO_CMD_STATUS_SUCCESS) 1645 - return; 1646 - 1647 - memcpy(&dev_priv->tv_format, &format, sizeof(format)); 1648 1568 } 1649 1569 1650 1570 /* ··· 1699 1655 struct intel_output *output = to_intel_output(connector); 1700 1656 struct intel_sdvo_priv *sdvo_priv = output->dev_priv; 1701 1657 struct intel_sdvo_sdtv_resolution_request tv_res; 1702 - uint32_t reply = 0; 1658 + uint32_t reply = 0, format_map = 0; 1659 + int i; 1703 1660 uint8_t status; 1704 - int i = 0; 1705 1661 1706 - intel_sdvo_check_tv_format(output); 1707 1662 1708 1663 /* Read the list of supported input resolutions for the selected TV 1709 1664 * format. 1710 1665 */ 1711 - memset(&tv_res, 0, sizeof(tv_res)); 1712 - memcpy(&tv_res, &sdvo_priv->tv_format, sizeof(tv_res)); 1666 + for (i = 0; i < TV_FORMAT_NUM; i++) 1667 + if (tv_format_names[i] == sdvo_priv->tv_format_name) 1668 + break; 1669 + 1670 + format_map = (1 << i); 1671 + memcpy(&tv_res, &format_map, 1672 + sizeof(struct intel_sdvo_sdtv_resolution_request) > 1673 + sizeof(format_map) ? sizeof(format_map) : 1674 + sizeof(struct intel_sdvo_sdtv_resolution_request)); 1675 + 1676 + intel_sdvo_set_target_output(output, sdvo_priv->controlled_output); 1677 + 1713 1678 intel_sdvo_write_cmd(output, SDVO_CMD_GET_SDTV_RESOLUTION_SUPPORT, 1714 1679 &tv_res, sizeof(tv_res)); 1715 1680 status = intel_sdvo_read_response(output, &reply, 3); ··· 1733 1680 if (nmode) 1734 1681 drm_mode_probed_add(connector, nmode); 1735 1682 } 1683 + 1736 1684 } 1737 1685 1738 1686 static void intel_sdvo_get_lvds_modes(struct drm_connector *connector) ··· 1801 1747 intel_i2c_destroy(intel_output->i2c_bus); 1802 1748 if (intel_output->ddc_bus) 1803 1749 intel_i2c_destroy(intel_output->ddc_bus); 1750 + if (sdvo_priv->analog_ddc_bus) 1751 + intel_i2c_destroy(sdvo_priv->analog_ddc_bus); 1804 1752 1805 1753 if (sdvo_priv->sdvo_lvds_fixed_mode != NULL) 1806 1754 drm_mode_destroy(connector->dev, 1807 1755 sdvo_priv->sdvo_lvds_fixed_mode); 1808 1756 1757 + if (sdvo_priv->tv_format_property) 1758 + drm_property_destroy(connector->dev, 1759 + sdvo_priv->tv_format_property); 1760 + 1809 1761 drm_sysfs_connector_remove(connector); 1810 1762 drm_connector_cleanup(connector); 1811 1763 1812 1764 kfree(intel_output); 1765 + } 1766 + 1767 + static int 1768 + intel_sdvo_set_property(struct drm_connector *connector, 1769 + struct drm_property *property, 1770 + uint64_t val) 1771 + { 1772 + struct intel_output *intel_output = to_intel_output(connector); 1773 + struct intel_sdvo_priv *sdvo_priv = intel_output->dev_priv; 1774 + struct drm_encoder *encoder = &intel_output->enc; 1775 + struct drm_crtc *crtc = encoder->crtc; 1776 + int ret = 0; 1777 + bool changed = false; 1778 + 1779 + ret = drm_connector_property_set_value(connector, property, val); 1780 + if (ret < 0) 1781 + goto out; 1782 + 1783 + if (property == sdvo_priv->tv_format_property) { 1784 + if (val >= TV_FORMAT_NUM) { 1785 + ret = -EINVAL; 1786 + goto out; 1787 + } 1788 + if (sdvo_priv->tv_format_name == 1789 + sdvo_priv->tv_format_supported[val]) 1790 + goto out; 1791 + 1792 + sdvo_priv->tv_format_name = sdvo_priv->tv_format_supported[val]; 1793 + changed = true; 1794 + } else { 1795 + ret = -EINVAL; 1796 + goto out; 1797 + } 1798 + 1799 + if (changed && crtc) 1800 + drm_crtc_helper_set_mode(crtc, &crtc->mode, crtc->x, 1801 + crtc->y, crtc->fb); 1802 + out: 1803 + return ret; 1813 1804 } 1814 1805 1815 1806 static const struct drm_encoder_helper_funcs intel_sdvo_helper_funcs = { ··· 1871 1772 .restore = intel_sdvo_restore, 1872 1773 .detect = intel_sdvo_detect, 1873 1774 .fill_modes = drm_helper_probe_single_connector_modes, 1775 + .set_property = intel_sdvo_set_property, 1874 1776 .destroy = intel_sdvo_destroy, 1875 1777 }; 1876 1778 ··· 2066 1966 intel_sdvo_set_colorimetry(intel_output, 2067 1967 SDVO_COLORIMETRY_RGB256); 2068 1968 connector->connector_type = DRM_MODE_CONNECTOR_HDMIA; 1969 + intel_output->clone_mask = 1970 + (1 << INTEL_SDVO_NON_TV_CLONE_BIT) | 1971 + (1 << INTEL_ANALOG_CLONE_BIT); 2069 1972 } 2070 1973 } else if (flags & SDVO_OUTPUT_SVID0) { 2071 1974 ··· 2077 1974 connector->connector_type = DRM_MODE_CONNECTOR_SVIDEO; 2078 1975 sdvo_priv->is_tv = true; 2079 1976 intel_output->needs_tv_clock = true; 1977 + intel_output->clone_mask = 1 << INTEL_SDVO_TV_CLONE_BIT; 2080 1978 } else if (flags & SDVO_OUTPUT_RGB0) { 2081 1979 2082 1980 sdvo_priv->controlled_output = SDVO_OUTPUT_RGB0; 2083 1981 encoder->encoder_type = DRM_MODE_ENCODER_DAC; 2084 1982 connector->connector_type = DRM_MODE_CONNECTOR_VGA; 1983 + intel_output->clone_mask = (1 << INTEL_SDVO_NON_TV_CLONE_BIT) | 1984 + (1 << INTEL_ANALOG_CLONE_BIT); 2085 1985 } else if (flags & SDVO_OUTPUT_RGB1) { 2086 1986 2087 1987 sdvo_priv->controlled_output = SDVO_OUTPUT_RGB1; ··· 2096 1990 encoder->encoder_type = DRM_MODE_ENCODER_LVDS; 2097 1991 connector->connector_type = DRM_MODE_CONNECTOR_LVDS; 2098 1992 sdvo_priv->is_lvds = true; 1993 + intel_output->clone_mask = (1 << INTEL_ANALOG_CLONE_BIT) | 1994 + (1 << INTEL_SDVO_LVDS_CLONE_BIT); 2099 1995 } else if (flags & SDVO_OUTPUT_LVDS1) { 2100 1996 2101 1997 sdvo_priv->controlled_output = SDVO_OUTPUT_LVDS1; 2102 1998 encoder->encoder_type = DRM_MODE_ENCODER_LVDS; 2103 1999 connector->connector_type = DRM_MODE_CONNECTOR_LVDS; 2104 2000 sdvo_priv->is_lvds = true; 2001 + intel_output->clone_mask = (1 << INTEL_ANALOG_CLONE_BIT) | 2002 + (1 << INTEL_SDVO_LVDS_CLONE_BIT); 2105 2003 } else { 2106 2004 2107 2005 unsigned char bytes[2]; ··· 2117 2007 bytes[0], bytes[1]); 2118 2008 ret = false; 2119 2009 } 2010 + intel_output->crtc_mask = (1 << 0) | (1 << 1); 2120 2011 2121 2012 if (ret && registered) 2122 2013 ret = drm_sysfs_connector_add(connector) == 0 ? true : false; 2123 2014 2124 2015 2125 2016 return ret; 2017 + 2018 + } 2019 + 2020 + static void intel_sdvo_tv_create_property(struct drm_connector *connector) 2021 + { 2022 + struct intel_output *intel_output = to_intel_output(connector); 2023 + struct intel_sdvo_priv *sdvo_priv = intel_output->dev_priv; 2024 + struct intel_sdvo_tv_format format; 2025 + uint32_t format_map, i; 2026 + uint8_t status; 2027 + 2028 + intel_sdvo_set_target_output(intel_output, 2029 + sdvo_priv->controlled_output); 2030 + 2031 + intel_sdvo_write_cmd(intel_output, 2032 + SDVO_CMD_GET_SUPPORTED_TV_FORMATS, NULL, 0); 2033 + status = intel_sdvo_read_response(intel_output, 2034 + &format, sizeof(format)); 2035 + if (status != SDVO_CMD_STATUS_SUCCESS) 2036 + return; 2037 + 2038 + memcpy(&format_map, &format, sizeof(format) > sizeof(format_map) ? 2039 + sizeof(format_map) : sizeof(format)); 2040 + 2041 + if (format_map == 0) 2042 + return; 2043 + 2044 + sdvo_priv->format_supported_num = 0; 2045 + for (i = 0 ; i < TV_FORMAT_NUM; i++) 2046 + if (format_map & (1 << i)) { 2047 + sdvo_priv->tv_format_supported 2048 + [sdvo_priv->format_supported_num++] = 2049 + tv_format_names[i]; 2050 + } 2051 + 2052 + 2053 + sdvo_priv->tv_format_property = 2054 + drm_property_create( 2055 + connector->dev, DRM_MODE_PROP_ENUM, 2056 + "mode", sdvo_priv->format_supported_num); 2057 + 2058 + for (i = 0; i < sdvo_priv->format_supported_num; i++) 2059 + drm_property_add_enum( 2060 + sdvo_priv->tv_format_property, i, 2061 + i, sdvo_priv->tv_format_supported[i]); 2062 + 2063 + sdvo_priv->tv_format_name = sdvo_priv->tv_format_supported[0]; 2064 + drm_connector_attach_property( 2065 + connector, sdvo_priv->tv_format_property, 0); 2126 2066 2127 2067 } 2128 2068 ··· 2220 2060 } 2221 2061 2222 2062 /* setup the DDC bus. */ 2223 - if (output_device == SDVOB) 2063 + if (output_device == SDVOB) { 2224 2064 intel_output->ddc_bus = intel_i2c_create(dev, GPIOE, "SDVOB DDC BUS"); 2225 - else 2065 + sdvo_priv->analog_ddc_bus = intel_i2c_create(dev, GPIOA, 2066 + "SDVOB/VGA DDC BUS"); 2067 + } else { 2226 2068 intel_output->ddc_bus = intel_i2c_create(dev, GPIOE, "SDVOC DDC BUS"); 2069 + sdvo_priv->analog_ddc_bus = intel_i2c_create(dev, GPIOA, 2070 + "SDVOC/VGA DDC BUS"); 2071 + } 2227 2072 2228 2073 if (intel_output->ddc_bus == NULL) 2229 2074 goto err_i2c; ··· 2262 2097 drm_encoder_helper_add(&intel_output->enc, &intel_sdvo_helper_funcs); 2263 2098 2264 2099 drm_mode_connector_attach_encoder(&intel_output->base, &intel_output->enc); 2100 + if (sdvo_priv->is_tv) 2101 + intel_sdvo_tv_create_property(connector); 2265 2102 drm_sysfs_connector_add(connector); 2266 2103 2267 2104 intel_sdvo_select_ddc_bus(sdvo_priv); ··· 2296 2129 return true; 2297 2130 2298 2131 err_i2c: 2132 + if (sdvo_priv->analog_ddc_bus != NULL) 2133 + intel_i2c_destroy(sdvo_priv->analog_ddc_bus); 2299 2134 if (intel_output->ddc_bus != NULL) 2300 2135 intel_i2c_destroy(intel_output->ddc_bus); 2301 2136 if (intel_output->i2c_bus != NULL)
+32
drivers/gpu/drm/i915/intel_tv.c
··· 1437 1437 return type; 1438 1438 } 1439 1439 1440 + /* 1441 + * Here we set accurate tv format according to connector type 1442 + * i.e Component TV should not be assigned by NTSC or PAL 1443 + */ 1444 + static void intel_tv_find_better_format(struct drm_connector *connector) 1445 + { 1446 + struct intel_output *intel_output = to_intel_output(connector); 1447 + struct intel_tv_priv *tv_priv = intel_output->dev_priv; 1448 + const struct tv_mode *tv_mode = intel_tv_mode_find(intel_output); 1449 + int i; 1450 + 1451 + if ((tv_priv->type == DRM_MODE_CONNECTOR_Component) == 1452 + tv_mode->component_only) 1453 + return; 1454 + 1455 + 1456 + for (i = 0; i < sizeof(tv_modes) / sizeof(*tv_modes); i++) { 1457 + tv_mode = tv_modes + i; 1458 + 1459 + if ((tv_priv->type == DRM_MODE_CONNECTOR_Component) == 1460 + tv_mode->component_only) 1461 + break; 1462 + } 1463 + 1464 + tv_priv->tv_format = tv_mode->name; 1465 + drm_connector_property_set_value(connector, 1466 + connector->dev->mode_config.tv_mode_property, i); 1467 + } 1468 + 1440 1469 /** 1441 1470 * Detect the TV connection. 1442 1471 * ··· 1502 1473 if (type < 0) 1503 1474 return connector_status_disconnected; 1504 1475 1476 + intel_tv_find_better_format(connector); 1505 1477 return connector_status_connected; 1506 1478 } 1507 1479 ··· 1748 1718 if (!intel_output) { 1749 1719 return; 1750 1720 } 1721 + 1751 1722 connector = &intel_output->base; 1752 1723 1753 1724 drm_connector_init(dev, connector, &intel_tv_connector_funcs, ··· 1760 1729 drm_mode_connector_attach_encoder(&intel_output->base, &intel_output->enc); 1761 1730 tv_priv = (struct intel_tv_priv *)(intel_output + 1); 1762 1731 intel_output->type = INTEL_OUTPUT_TVOUT; 1732 + intel_output->clone_mask = (1 << INTEL_TV_CLONE_BIT); 1763 1733 intel_output->enc.possible_crtcs = ((1 << 0) | (1 << 1)); 1764 1734 intel_output->enc.possible_clones = (1 << INTEL_OUTPUT_TVOUT); 1765 1735 intel_output->dev_priv = tv_priv;
+10
drivers/gpu/drm/radeon/r100.c
··· 1140 1140 tmp |= tile_flags; 1141 1141 ib[idx] = tmp; 1142 1142 break; 1143 + case RADEON_RB3D_ZPASS_ADDR: 1144 + r = r100_cs_packet_next_reloc(p, &reloc); 1145 + if (r) { 1146 + DRM_ERROR("No reloc for ib[%d]=0x%04X\n", 1147 + idx, reg); 1148 + r100_cs_dump_packet(p, pkt); 1149 + return r; 1150 + } 1151 + ib[idx] = ib_chunk->kdata[idx] + ((u32)reloc->lobj.gpu_offset); 1152 + break; 1143 1153 default: 1144 1154 /* FIXME: we don't want to allow anyothers packet */ 1145 1155 break;
+3 -1
drivers/gpu/drm/radeon/r300.c
··· 450 450 /* rv350,rv370,rv380 */ 451 451 rdev->num_gb_pipes = 1; 452 452 } 453 + rdev->num_z_pipes = 1; 453 454 gb_tile_config = (R300_ENABLE_TILING | R300_TILE_SIZE_16); 454 455 switch (rdev->num_gb_pipes) { 455 456 case 2: ··· 489 488 printk(KERN_WARNING "Failed to wait MC idle while " 490 489 "programming pipes. Bad things might happen.\n"); 491 490 } 492 - DRM_INFO("radeon: %d pipes initialized.\n", rdev->num_gb_pipes); 491 + DRM_INFO("radeon: %d quad pipes, %d Z pipes initialized.\n", 492 + rdev->num_gb_pipes, rdev->num_z_pipes); 493 493 } 494 494 495 495 int r300_ga_reset(struct radeon_device *rdev)
+12 -1
drivers/gpu/drm/radeon/r420.c
··· 165 165 printk(KERN_WARNING "Failed to wait GUI idle while " 166 166 "programming pipes. Bad things might happen.\n"); 167 167 } 168 - DRM_INFO("radeon: %d pipes initialized.\n", rdev->num_gb_pipes); 168 + 169 + if (rdev->family == CHIP_RV530) { 170 + tmp = RREG32(RV530_GB_PIPE_SELECT2); 171 + if ((tmp & 3) == 3) 172 + rdev->num_z_pipes = 2; 173 + else 174 + rdev->num_z_pipes = 1; 175 + } else 176 + rdev->num_z_pipes = 1; 177 + 178 + DRM_INFO("radeon: %d quad pipes, %d z pipes initialized.\n", 179 + rdev->num_gb_pipes, rdev->num_z_pipes); 169 180 } 170 181 171 182 void r420_gpu_init(struct radeon_device *rdev)
-1
drivers/gpu/drm/radeon/r520.c
··· 177 177 */ 178 178 /* workaround for RV530 */ 179 179 if (rdev->family == CHIP_RV530) { 180 - WREG32(0x4124, 1); 181 180 WREG32(0x4128, 0xFF); 182 181 } 183 182 r420_pipes_init(rdev);
+1
drivers/gpu/drm/radeon/radeon.h
··· 655 655 int usec_timeout; 656 656 enum radeon_pll_errata pll_errata; 657 657 int num_gb_pipes; 658 + int num_z_pipes; 658 659 int disp_priority; 659 660 /* BIOS */ 660 661 uint8_t *bios;
+9
drivers/gpu/drm/radeon/radeon_cp.c
··· 421 421 { 422 422 uint32_t gb_tile_config, gb_pipe_sel = 0; 423 423 424 + if ((dev_priv->flags & RADEON_FAMILY_MASK) == CHIP_RV530) { 425 + uint32_t z_pipe_sel = RADEON_READ(RV530_GB_PIPE_SELECT2); 426 + if ((z_pipe_sel & 3) == 3) 427 + dev_priv->num_z_pipes = 2; 428 + else 429 + dev_priv->num_z_pipes = 1; 430 + } else 431 + dev_priv->num_z_pipes = 1; 432 + 424 433 /* RS4xx/RS6xx/R4xx/R5xx */ 425 434 if ((dev_priv->flags & RADEON_FAMILY_MASK) >= CHIP_R420) { 426 435 gb_pipe_sel = RADEON_READ(R400_GB_PIPE_SELECT);
+4 -1
drivers/gpu/drm/radeon/radeon_drv.h
··· 103 103 * 1.28- Add support for VBL on CRTC2 104 104 * 1.29- R500 3D cmd buffer support 105 105 * 1.30- Add support for occlusion queries 106 + * 1.31- Add support for num Z pipes from GET_PARAM 106 107 */ 107 108 #define DRIVER_MAJOR 1 108 - #define DRIVER_MINOR 30 109 + #define DRIVER_MINOR 31 109 110 #define DRIVER_PATCHLEVEL 0 110 111 111 112 /* ··· 333 332 resource_size_t fb_aper_offset; 334 333 335 334 int num_gb_pipes; 335 + int num_z_pipes; 336 336 int track_flush; 337 337 drm_local_map_t *mmio; 338 338 ··· 696 694 697 695 /* pipe config regs */ 698 696 #define R400_GB_PIPE_SELECT 0x402c 697 + #define RV530_GB_PIPE_SELECT2 0x4124 699 698 #define R500_DYN_SCLK_PWMEM_PIPE 0x000d /* PLL */ 700 699 #define R300_GB_TILE_CONFIG 0x4018 701 700 # define R300_ENABLE_TILING (1 << 0)
+10 -4
drivers/gpu/drm/radeon/radeon_gem.c
··· 274 274 } 275 275 robj = gobj->driver_private; 276 276 r = radeon_object_busy_domain(robj, &cur_placement); 277 - if (cur_placement == TTM_PL_VRAM) 277 + switch (cur_placement) { 278 + case TTM_PL_VRAM: 278 279 args->domain = RADEON_GEM_DOMAIN_VRAM; 279 - if (cur_placement == TTM_PL_FLAG_TT) 280 + break; 281 + case TTM_PL_TT: 280 282 args->domain = RADEON_GEM_DOMAIN_GTT; 281 - if (cur_placement == TTM_PL_FLAG_SYSTEM) 283 + break; 284 + case TTM_PL_SYSTEM: 282 285 args->domain = RADEON_GEM_DOMAIN_CPU; 286 + default: 287 + break; 288 + } 283 289 mutex_lock(&dev->struct_mutex); 284 290 drm_gem_object_unreference(gobj); 285 291 mutex_unlock(&dev->struct_mutex); 286 - return 0; 292 + return r; 287 293 } 288 294 289 295 int radeon_gem_wait_idle_ioctl(struct drm_device *dev, void *data,
+4
drivers/gpu/drm/radeon/radeon_kms.c
··· 95 95 case RADEON_INFO_NUM_GB_PIPES: 96 96 value = rdev->num_gb_pipes; 97 97 break; 98 + case RADEON_INFO_NUM_Z_PIPES: 99 + value = rdev->num_z_pipes; 100 + break; 98 101 default: 99 102 DRM_DEBUG("Invalid request %d\n", info->request); 100 103 return -EINVAL; ··· 321 318 DRM_IOCTL_DEF(DRM_RADEON_INFO, radeon_info_ioctl, DRM_AUTH), 322 319 DRM_IOCTL_DEF(DRM_RADEON_GEM_SET_TILING, radeon_gem_set_tiling_ioctl, DRM_AUTH), 323 320 DRM_IOCTL_DEF(DRM_RADEON_GEM_GET_TILING, radeon_gem_get_tiling_ioctl, DRM_AUTH), 321 + DRM_IOCTL_DEF(DRM_RADEON_GEM_BUSY, radeon_gem_busy_ioctl, DRM_AUTH), 324 322 }; 325 323 int radeon_max_kms_ioctl = DRM_ARRAY_SIZE(radeon_ioctls_kms);
+5
drivers/gpu/drm/radeon/radeon_reg.h
··· 2337 2337 # define RADEON_RE_WIDTH_SHIFT 0 2338 2338 # define RADEON_RE_HEIGHT_SHIFT 16 2339 2339 2340 + #define RADEON_RB3D_ZPASS_DATA 0x3290 2341 + #define RADEON_RB3D_ZPASS_ADDR 0x3294 2342 + 2340 2343 #define RADEON_SE_CNTL 0x1c4c 2341 2344 # define RADEON_FFACE_CULL_CW (0 << 0) 2342 2345 # define RADEON_FFACE_CULL_CCW (1 << 0) ··· 3573 3570 #define RADEON_SCRATCH_REG3 0x15ec 3574 3571 #define RADEON_SCRATCH_REG4 0x15f0 3575 3572 #define RADEON_SCRATCH_REG5 0x15f4 3573 + 3574 + #define RV530_GB_PIPE_SELECT2 0x4124 3576 3575 3577 3576 #endif
+3
drivers/gpu/drm/radeon/radeon_state.c
··· 3081 3081 case RADEON_PARAM_NUM_GB_PIPES: 3082 3082 value = dev_priv->num_gb_pipes; 3083 3083 break; 3084 + case RADEON_PARAM_NUM_Z_PIPES: 3085 + value = dev_priv->num_z_pipes; 3086 + break; 3084 3087 default: 3085 3088 DRM_DEBUG("Invalid parameter %d\n", param->param); 3086 3089 return -EINVAL;
+12 -2
drivers/i2c/busses/i2c-omap.c
··· 674 674 675 675 err = 0; 676 676 complete: 677 - omap_i2c_write_reg(dev, OMAP_I2C_STAT_REG, stat); 677 + /* 678 + * Ack the stat in one go, but [R/X]DR and [R/X]RDY should be 679 + * acked after the data operation is complete. 680 + * Ref: TRM SWPU114Q Figure 18-31 681 + */ 682 + omap_i2c_write_reg(dev, OMAP_I2C_STAT_REG, stat & 683 + ~(OMAP_I2C_STAT_RRDY | OMAP_I2C_STAT_RDR | 684 + OMAP_I2C_STAT_XRDY | OMAP_I2C_STAT_XDR)); 678 685 679 686 if (stat & OMAP_I2C_STAT_NACK) { 680 687 err |= OMAP_I2C_STAT_NACK; ··· 694 687 } 695 688 if (stat & (OMAP_I2C_STAT_ARDY | OMAP_I2C_STAT_NACK | 696 689 OMAP_I2C_STAT_AL)) { 690 + omap_i2c_ack_stat(dev, stat & 691 + (OMAP_I2C_STAT_RRDY | OMAP_I2C_STAT_RDR | 692 + OMAP_I2C_STAT_XRDY | OMAP_I2C_STAT_XDR)); 697 693 omap_i2c_complete_cmd(dev, err); 698 694 return IRQ_HANDLED; 699 695 } ··· 784 774 * memory to the I2C interface. 785 775 */ 786 776 787 - if (cpu_is_omap34xx()) { 777 + if (dev->rev <= OMAP_I2C_REV_ON_3430) { 788 778 while (!(stat & OMAP_I2C_STAT_XUDF)) { 789 779 if (stat & (OMAP_I2C_STAT_NACK | OMAP_I2C_STAT_AL)) { 790 780 omap_i2c_ack_stat(dev, stat & (OMAP_I2C_STAT_XRDY | OMAP_I2C_STAT_XDR));
+91 -64
drivers/i2c/busses/i2c-stu300.c
··· 117 117 STU300_ERROR_NONE = 0, 118 118 STU300_ERROR_ACKNOWLEDGE_FAILURE, 119 119 STU300_ERROR_BUS_ERROR, 120 - STU300_ERROR_ARBITRATION_LOST 120 + STU300_ERROR_ARBITRATION_LOST, 121 + STU300_ERROR_UNKNOWN 121 122 }; 122 123 123 124 /* timeout waiting for the controller to respond */ ··· 128 127 * The number of address send athemps tried before giving up. 129 128 * If the first one failes it seems like 5 to 8 attempts are required. 130 129 */ 131 - #define NUM_ADDR_RESEND_ATTEMPTS 10 130 + #define NUM_ADDR_RESEND_ATTEMPTS 12 132 131 133 132 /* I2C clock speed, in Hz 0-400kHz*/ 134 133 static unsigned int scl_frequency = 100000; ··· 150 149 * @msg_index: index of current message 151 150 * @msg_len: length of current message 152 151 */ 152 + 153 153 struct stu300_dev { 154 154 struct platform_device *pdev; 155 155 struct i2c_adapter adapter; ··· 190 188 return readl(address) & 0x000000FFU; 191 189 } 192 190 191 + static void stu300_irq_enable(struct stu300_dev *dev) 192 + { 193 + u32 val; 194 + val = stu300_r8(dev->virtbase + I2C_CR); 195 + val |= I2C_CR_INTERRUPT_ENABLE; 196 + /* Twice paranoia (possible HW glitch) */ 197 + stu300_wr8(val, dev->virtbase + I2C_CR); 198 + stu300_wr8(val, dev->virtbase + I2C_CR); 199 + } 200 + 201 + static void stu300_irq_disable(struct stu300_dev *dev) 202 + { 203 + u32 val; 204 + val = stu300_r8(dev->virtbase + I2C_CR); 205 + val &= ~I2C_CR_INTERRUPT_ENABLE; 206 + /* Twice paranoia (possible HW glitch) */ 207 + stu300_wr8(val, dev->virtbase + I2C_CR); 208 + stu300_wr8(val, dev->virtbase + I2C_CR); 209 + } 210 + 211 + 193 212 /* 194 213 * Tells whether a certain event or events occurred in 195 214 * response to a command. The events represent states in ··· 219 196 * documentation and can only be treated as abstract state 220 197 * machine states. 221 198 * 222 - * @ret 0 = event has not occurred, any other value means 223 - * the event occurred. 199 + * @ret 0 = event has not occurred or unknown error, any 200 + * other value means the correct event occurred or an error. 224 201 */ 202 + 225 203 static int stu300_event_occurred(struct stu300_dev *dev, 226 204 enum stu300_event mr_event) { 227 205 u32 status1; ··· 230 206 231 207 /* What event happened? */ 232 208 status1 = stu300_r8(dev->virtbase + I2C_SR1); 209 + 233 210 if (!(status1 & I2C_SR1_EVF_IND)) 234 211 /* No event at all */ 235 212 return 0; 213 + 236 214 status2 = stu300_r8(dev->virtbase + I2C_SR2); 215 + 216 + /* Block any multiple interrupts */ 217 + stu300_irq_disable(dev); 218 + 219 + /* Check for errors first */ 220 + if (status2 & I2C_SR2_AF_IND) { 221 + dev->cmd_err = STU300_ERROR_ACKNOWLEDGE_FAILURE; 222 + return 1; 223 + } else if (status2 & I2C_SR2_BERR_IND) { 224 + dev->cmd_err = STU300_ERROR_BUS_ERROR; 225 + return 1; 226 + } else if (status2 & I2C_SR2_ARLO_IND) { 227 + dev->cmd_err = STU300_ERROR_ARBITRATION_LOST; 228 + return 1; 229 + } 237 230 238 231 switch (mr_event) { 239 232 case STU300_EVENT_1: ··· 262 221 case STU300_EVENT_7: 263 222 case STU300_EVENT_8: 264 223 if (status1 & I2C_SR1_BTF_IND) { 265 - if (status2 & I2C_SR2_AF_IND) 266 - dev->cmd_err = STU300_ERROR_ACKNOWLEDGE_FAILURE; 267 - else if (status2 & I2C_SR2_BERR_IND) 268 - dev->cmd_err = STU300_ERROR_BUS_ERROR; 269 224 return 1; 270 225 } 271 226 break; ··· 277 240 case STU300_EVENT_6: 278 241 if (status2 & I2C_SR2_ENDAD_IND) { 279 242 /* First check for any errors */ 280 - if (status2 & I2C_SR2_AF_IND) 281 - dev->cmd_err = STU300_ERROR_ACKNOWLEDGE_FAILURE; 282 243 return 1; 283 244 } 284 245 break; ··· 287 252 default: 288 253 break; 289 254 } 290 - if (status2 & I2C_SR2_ARLO_IND) 291 - dev->cmd_err = STU300_ERROR_ARBITRATION_LOST; 255 + /* If we get here, we're on thin ice. 256 + * Here we are in a status where we have 257 + * gotten a response that does not match 258 + * what we requested. 259 + */ 260 + dev->cmd_err = STU300_ERROR_UNKNOWN; 261 + dev_err(&dev->pdev->dev, 262 + "Unhandled interrupt! %d sr1: 0x%x sr2: 0x%x\n", 263 + mr_event, status1, status2); 292 264 return 0; 293 265 } 294 266 ··· 304 262 struct stu300_dev *dev = data; 305 263 int res; 306 264 265 + /* Just make sure that the block is clocked */ 266 + clk_enable(dev->clk); 267 + 307 268 /* See if this was what we were waiting for */ 308 269 spin_lock(&dev->cmd_issue_lock); 309 - if (dev->cmd_event != STU300_EVENT_NONE) { 310 - res = stu300_event_occurred(dev, dev->cmd_event); 311 - if (res || dev->cmd_err != STU300_ERROR_NONE) { 312 - u32 val; 313 270 314 - complete(&dev->cmd_complete); 315 - /* Block any multiple interrupts */ 316 - val = stu300_r8(dev->virtbase + I2C_CR); 317 - val &= ~I2C_CR_INTERRUPT_ENABLE; 318 - stu300_wr8(val, dev->virtbase + I2C_CR); 319 - } 320 - } 271 + res = stu300_event_occurred(dev, dev->cmd_event); 272 + if (res || dev->cmd_err != STU300_ERROR_NONE) 273 + complete(&dev->cmd_complete); 274 + 321 275 spin_unlock(&dev->cmd_issue_lock); 276 + 277 + clk_disable(dev->clk); 278 + 322 279 return IRQ_HANDLED; 323 280 } 324 281 ··· 349 308 stu300_wr8(cr_value, dev->virtbase + I2C_CR); 350 309 ret = wait_for_completion_interruptible_timeout(&dev->cmd_complete, 351 310 STU300_TIMEOUT); 352 - 353 311 if (ret < 0) { 354 312 dev_err(&dev->pdev->dev, 355 313 "wait_for_completion_interruptible_timeout() " ··· 382 342 enum stu300_event mr_event) 383 343 { 384 344 int ret; 385 - u32 val; 386 345 387 346 if (unlikely(irqs_disabled())) { 388 347 /* TODO: implement polling for this case if need be. */ ··· 393 354 /* Is it already here? */ 394 355 spin_lock_irq(&dev->cmd_issue_lock); 395 356 dev->cmd_err = STU300_ERROR_NONE; 396 - if (stu300_event_occurred(dev, mr_event)) { 397 - spin_unlock_irq(&dev->cmd_issue_lock); 398 - goto exit_await_check_err; 399 - } 400 - init_completion(&dev->cmd_complete); 401 - dev->cmd_err = STU300_ERROR_NONE; 402 357 dev->cmd_event = mr_event; 403 358 359 + init_completion(&dev->cmd_complete); 360 + 404 361 /* Turn on the I2C interrupt for current operation */ 405 - val = stu300_r8(dev->virtbase + I2C_CR); 406 - val |= I2C_CR_INTERRUPT_ENABLE; 407 - stu300_wr8(val, dev->virtbase + I2C_CR); 408 - 409 - /* Twice paranoia (possible HW glitch) */ 410 - stu300_wr8(val, dev->virtbase + I2C_CR); 411 - 412 - /* Check again: is it already here? */ 413 - if (unlikely(stu300_event_occurred(dev, mr_event))) { 414 - /* Disable IRQ again. */ 415 - val &= ~I2C_CR_INTERRUPT_ENABLE; 416 - stu300_wr8(val, dev->virtbase + I2C_CR); 417 - spin_unlock_irq(&dev->cmd_issue_lock); 418 - goto exit_await_check_err; 419 - } 362 + stu300_irq_enable(dev); 420 363 421 364 /* Unlock the command block and wait for the event to occur */ 422 365 spin_unlock_irq(&dev->cmd_issue_lock); 366 + 423 367 ret = wait_for_completion_interruptible_timeout(&dev->cmd_complete, 424 368 STU300_TIMEOUT); 425 - 426 369 if (ret < 0) { 427 370 dev_err(&dev->pdev->dev, 428 371 "wait_for_completion_interruptible_timeout()" ··· 422 401 return -ETIMEDOUT; 423 402 } 424 403 425 - exit_await_check_err: 426 404 if (dev->cmd_err != STU300_ERROR_NONE) { 427 405 if (mr_event != STU300_EVENT_6) { 428 406 dev_err(&dev->pdev->dev, "controller " ··· 477 457 }; 478 458 479 459 static const struct stu300_clkset stu300_clktable[] = { 480 - { 0, 0xFFU }, 481 - { 2500000, I2C_OAR2_FR_25_10MHZ }, 482 - { 10000000, I2C_OAR2_FR_10_1667MHZ }, 483 - { 16670000, I2C_OAR2_FR_1667_2667MHZ }, 484 - { 26670000, I2C_OAR2_FR_2667_40MHZ }, 485 - { 40000000, I2C_OAR2_FR_40_5333MHZ }, 486 - { 53330000, I2C_OAR2_FR_5333_66MHZ }, 487 - { 66000000, I2C_OAR2_FR_66_80MHZ }, 488 - { 80000000, I2C_OAR2_FR_80_100MHZ }, 460 + { 0, 0xFFU }, 461 + { 2500000, I2C_OAR2_FR_25_10MHZ }, 462 + { 10000000, I2C_OAR2_FR_10_1667MHZ }, 463 + { 16670000, I2C_OAR2_FR_1667_2667MHZ }, 464 + { 26670000, I2C_OAR2_FR_2667_40MHZ }, 465 + { 40000000, I2C_OAR2_FR_40_5333MHZ }, 466 + { 53330000, I2C_OAR2_FR_5333_66MHZ }, 467 + { 66000000, I2C_OAR2_FR_66_80MHZ }, 468 + { 80000000, I2C_OAR2_FR_80_100MHZ }, 489 469 { 100000000, 0xFFU }, 490 470 }; 471 + 491 472 492 473 static int stu300_set_clk(struct stu300_dev *dev, unsigned long clkrate) 493 474 { ··· 515 494 516 495 if (dev->speed > 100000) 517 496 /* Fast Mode I2C */ 518 - val = ((clkrate/dev->speed)-9)/3; 497 + val = ((clkrate/dev->speed) - 9)/3 + 1; 519 498 else 520 499 /* Standard Mode I2C */ 521 - val = ((clkrate/dev->speed)-7)/2; 500 + val = ((clkrate/dev->speed) - 7)/2 + 1; 522 501 523 502 /* According to spec the divider must be > 2 */ 524 503 if (val < 0x002) { ··· 578 557 */ 579 558 clkrate = clk_get_rate(dev->clk); 580 559 ret = stu300_set_clk(dev, clkrate); 560 + 581 561 if (ret) 582 562 return ret; 583 563 /* ··· 663 641 int attempts = 0; 664 642 struct stu300_dev *dev = i2c_get_adapdata(adap); 665 643 666 - 667 644 clk_enable(dev->clk); 668 645 669 646 /* Remove this if (0) to trace each and every message. */ ··· 736 715 737 716 if (attempts < NUM_ADDR_RESEND_ATTEMPTS && attempts > 0) { 738 717 dev_dbg(&dev->pdev->dev, "managed to get address " 739 - "through after %d attempts\n", attempts); 718 + "through after %d attempts\n", attempts); 740 719 } else if (attempts == NUM_ADDR_RESEND_ATTEMPTS) { 741 720 dev_dbg(&dev->pdev->dev, "I give up, tried %d times " 742 - "to resend address.\n", 743 - NUM_ADDR_RESEND_ATTEMPTS); 721 + "to resend address.\n", 722 + NUM_ADDR_RESEND_ATTEMPTS); 744 723 goto exit_disable; 745 724 } 725 + 746 726 747 727 if (msg->flags & I2C_M_RD) { 748 728 /* READ: we read the actual bytes one at a time */ ··· 826 804 { 827 805 int ret = -1; 828 806 int i; 807 + 829 808 struct stu300_dev *dev = i2c_get_adapdata(adap); 830 809 dev->msg_len = num; 810 + 831 811 for (i = 0; i < num; i++) { 832 812 /* 833 813 * Another driver appears to send stop for each message, ··· 841 817 dev->msg_index = i; 842 818 843 819 ret = stu300_xfer_msg(adap, &msgs[i], (i == (num - 1))); 820 + 844 821 if (ret != 0) { 845 822 num = ret; 846 823 break; ··· 870 845 struct resource *res; 871 846 int bus_nr; 872 847 int ret = 0; 848 + char clk_name[] = "I2C0"; 873 849 874 850 dev = kzalloc(sizeof(struct stu300_dev), GFP_KERNEL); 875 851 if (!dev) { ··· 880 854 } 881 855 882 856 bus_nr = pdev->id; 883 - dev->clk = clk_get(&pdev->dev, NULL); 857 + clk_name[3] += (char)bus_nr; 858 + dev->clk = clk_get(&pdev->dev, clk_name); 884 859 if (IS_ERR(dev->clk)) { 885 860 ret = PTR_ERR(dev->clk); 886 861 dev_err(&pdev->dev, "could not retrieve i2c bus clock\n");
+39 -25
drivers/input/joydev.c
··· 456 456 unsigned int cmd, void __user *argp) 457 457 { 458 458 struct input_dev *dev = joydev->handle.dev; 459 + size_t len; 459 460 int i, j; 461 + const char *name; 460 462 463 + /* Process fixed-sized commands. */ 461 464 switch (cmd) { 462 465 463 466 case JS_SET_CAL: ··· 502 499 return copy_to_user(argp, joydev->corr, 503 500 sizeof(joydev->corr[0]) * joydev->nabs) ? -EFAULT : 0; 504 501 505 - case JSIOCSAXMAP: 506 - if (copy_from_user(joydev->abspam, argp, 507 - sizeof(__u8) * (ABS_MAX + 1))) 502 + } 503 + 504 + /* 505 + * Process variable-sized commands (the axis and button map commands 506 + * are considered variable-sized to decouple them from the values of 507 + * ABS_MAX and KEY_MAX). 508 + */ 509 + switch (cmd & ~IOCSIZE_MASK) { 510 + 511 + case (JSIOCSAXMAP & ~IOCSIZE_MASK): 512 + len = min_t(size_t, _IOC_SIZE(cmd), sizeof(joydev->abspam)); 513 + /* 514 + * FIXME: we should not copy into our axis map before 515 + * validating the data. 516 + */ 517 + if (copy_from_user(joydev->abspam, argp, len)) 508 518 return -EFAULT; 509 519 510 520 for (i = 0; i < joydev->nabs; i++) { ··· 527 511 } 528 512 return 0; 529 513 530 - case JSIOCGAXMAP: 531 - return copy_to_user(argp, joydev->abspam, 532 - sizeof(__u8) * (ABS_MAX + 1)) ? -EFAULT : 0; 514 + case (JSIOCGAXMAP & ~IOCSIZE_MASK): 515 + len = min_t(size_t, _IOC_SIZE(cmd), sizeof(joydev->abspam)); 516 + return copy_to_user(argp, joydev->abspam, len) ? -EFAULT : 0; 533 517 534 - case JSIOCSBTNMAP: 535 - if (copy_from_user(joydev->keypam, argp, 536 - sizeof(__u16) * (KEY_MAX - BTN_MISC + 1))) 518 + case (JSIOCSBTNMAP & ~IOCSIZE_MASK): 519 + len = min_t(size_t, _IOC_SIZE(cmd), sizeof(joydev->keypam)); 520 + /* 521 + * FIXME: we should not copy into our keymap before 522 + * validating the data. 523 + */ 524 + if (copy_from_user(joydev->keypam, argp, len)) 537 525 return -EFAULT; 538 526 539 527 for (i = 0; i < joydev->nkey; i++) { ··· 549 529 550 530 return 0; 551 531 552 - case JSIOCGBTNMAP: 553 - return copy_to_user(argp, joydev->keypam, 554 - sizeof(__u16) * (KEY_MAX - BTN_MISC + 1)) ? -EFAULT : 0; 532 + case (JSIOCGBTNMAP & ~IOCSIZE_MASK): 533 + len = min_t(size_t, _IOC_SIZE(cmd), sizeof(joydev->keypam)); 534 + return copy_to_user(argp, joydev->keypam, len) ? -EFAULT : 0; 555 535 556 - default: 557 - if ((cmd & ~IOCSIZE_MASK) == JSIOCGNAME(0)) { 558 - int len; 559 - const char *name = dev->name; 536 + case JSIOCGNAME(0): 537 + name = dev->name; 538 + if (!name) 539 + return 0; 560 540 561 - if (!name) 562 - return 0; 563 - len = strlen(name) + 1; 564 - if (len > _IOC_SIZE(cmd)) 565 - len = _IOC_SIZE(cmd); 566 - if (copy_to_user(argp, name, len)) 567 - return -EFAULT; 568 - return len; 569 - } 541 + len = min_t(size_t, _IOC_SIZE(cmd), strlen(name) + 1); 542 + return copy_to_user(argp, name, len) ? -EFAULT : len; 570 543 } 544 + 571 545 return -EINVAL; 572 546 } 573 547
+1
drivers/input/joystick/iforce/iforce-main.c
··· 74 74 { 0x05ef, 0x8884, "AVB Mag Turbo Force", btn_avb_wheel, abs_wheel, ff_iforce }, 75 75 { 0x05ef, 0x8888, "AVB Top Shot Force Feedback Racing Wheel", btn_avb_tw, abs_wheel, ff_iforce }, //? 76 76 { 0x061c, 0xc0a4, "ACT LABS Force RS", btn_wheel, abs_wheel, ff_iforce }, //? 77 + { 0x061c, 0xc084, "ACT LABS Force RS", btn_wheel, abs_wheel, ff_iforce }, 77 78 { 0x06f8, 0x0001, "Guillemot Race Leader Force Feedback", btn_wheel, abs_wheel, ff_iforce }, //? 78 79 { 0x06f8, 0x0004, "Guillemot Force Feedback Racing Wheel", btn_wheel, abs_wheel, ff_iforce }, //? 79 80 { 0x06f8, 0x0004, "Gullemot Jet Leader 3D", btn_joystick, abs_joystick, ff_iforce }, //?
+1
drivers/input/joystick/iforce/iforce-usb.c
··· 223 223 { USB_DEVICE(0x05ef, 0x8884) }, /* AVB Mag Turbo Force */ 224 224 { USB_DEVICE(0x05ef, 0x8888) }, /* AVB Top Shot FFB Racing Wheel */ 225 225 { USB_DEVICE(0x061c, 0xc0a4) }, /* ACT LABS Force RS */ 226 + { USB_DEVICE(0x061c, 0xc084) }, /* ACT LABS Force RS */ 226 227 { USB_DEVICE(0x06f8, 0x0001) }, /* Guillemot Race Leader Force Feedback */ 227 228 { USB_DEVICE(0x06f8, 0x0004) }, /* Guillemot Force Feedback Racing Wheel */ 228 229 { USB_DEVICE(0x06f8, 0xa302) }, /* Guillemot Jet Leader 3D */
+29 -14
drivers/input/tablet/wacom_sys.c
··· 388 388 return result; 389 389 } 390 390 391 + static int wacom_query_tablet_data(struct usb_interface *intf) 392 + { 393 + unsigned char *rep_data; 394 + int limit = 0; 395 + int error; 396 + 397 + rep_data = kmalloc(2, GFP_KERNEL); 398 + if (!rep_data) 399 + return -ENOMEM; 400 + 401 + do { 402 + rep_data[0] = 2; 403 + rep_data[1] = 2; 404 + error = usb_set_report(intf, WAC_HID_FEATURE_REPORT, 405 + 2, rep_data, 2); 406 + if (error >= 0) 407 + error = usb_get_report(intf, 408 + WAC_HID_FEATURE_REPORT, 2, 409 + rep_data, 2); 410 + } while ((error < 0 || rep_data[1] != 2) && limit++ < 5); 411 + 412 + kfree(rep_data); 413 + 414 + return error < 0 ? error : 0; 415 + } 416 + 391 417 static int wacom_probe(struct usb_interface *intf, const struct usb_device_id *id) 392 418 { 393 419 struct usb_device *dev = interface_to_usbdev(intf); ··· 424 398 struct wacom_features *features; 425 399 struct input_dev *input_dev; 426 400 int error = -ENOMEM; 427 - char rep_data[2], limit = 0; 428 401 struct hid_descriptor *hid_desc; 429 402 430 403 wacom = kzalloc(sizeof(struct wacom), GFP_KERNEL); ··· 514 489 515 490 /* 516 491 * Ask the tablet to report tablet data if it is not a Tablet PC. 517 - * Repeat until it succeeds 492 + * Note that if query fails it is not a hard failure. 518 493 */ 519 - if (wacom_wac->features->type != TABLETPC) { 520 - do { 521 - rep_data[0] = 2; 522 - rep_data[1] = 2; 523 - error = usb_set_report(intf, WAC_HID_FEATURE_REPORT, 524 - 2, rep_data, 2); 525 - if (error >= 0) 526 - error = usb_get_report(intf, 527 - WAC_HID_FEATURE_REPORT, 2, 528 - rep_data, 2); 529 - } while ((error < 0 || rep_data[1] != 2) && limit++ < 5); 530 - } 494 + if (wacom_wac->features->type != TABLETPC) 495 + wacom_query_tablet_data(intf); 531 496 532 497 usb_set_intfdata(intf, wacom); 533 498 return 0;
+13 -4
drivers/input/touchscreen/ucb1400_ts.c
··· 170 170 ucb1400_reg_write(ucb->ac97, UCB_IE_CLEAR, isr); 171 171 ucb1400_reg_write(ucb->ac97, UCB_IE_CLEAR, 0); 172 172 173 - if (isr & UCB_IE_TSPX) { 173 + if (isr & UCB_IE_TSPX) 174 174 ucb1400_ts_irq_disable(ucb->ac97); 175 - enable_irq(ucb->irq); 176 - } else 177 - printk(KERN_ERR "ucb1400: unexpected IE_STATUS = %#x\n", isr); 175 + else 176 + dev_dbg(&ucb->ts_idev->dev, "ucb1400: unexpected IE_STATUS = %#x\n", isr); 177 + enable_irq(ucb->irq); 178 178 } 179 179 180 180 static int ucb1400_ts_thread(void *_ucb) ··· 345 345 static int ucb1400_ts_probe(struct platform_device *dev) 346 346 { 347 347 int error, x_res, y_res; 348 + u16 fcsr; 348 349 struct ucb1400_ts *ucb = dev->dev.platform_data; 349 350 350 351 ucb->ts_idev = input_allocate_device(); ··· 382 381 ucb->ts_idev->close = ucb1400_ts_close; 383 382 ucb->ts_idev->evbit[0] = BIT_MASK(EV_ABS) | BIT_MASK(EV_KEY); 384 383 ucb->ts_idev->keybit[BIT_WORD(BTN_TOUCH)] = BIT_MASK(BTN_TOUCH); 384 + 385 + /* 386 + * Enable ADC filter to prevent horrible jitter on Colibri. 387 + * This also further reduces jitter on boards where ADCSYNC 388 + * pin is connected. 389 + */ 390 + fcsr = ucb1400_reg_read(ucb->ac97, UCB_FCSR); 391 + ucb1400_reg_write(ucb->ac97, UCB_FCSR, fcsr | UCB_FCSR_AVE); 385 392 386 393 ucb1400_adc_enable(ucb->ac97); 387 394 x_res = ucb1400_ts_read_xres(ucb);
+17 -7
drivers/leds/ledtrig-gpio.c
··· 117 117 118 118 gpio_data->inverted = !!inverted; 119 119 120 + /* After inverting, we need to update the LED. */ 121 + schedule_work(&gpio_data->work); 122 + 120 123 return n; 121 124 } 122 125 static DEVICE_ATTR(inverted, 0644, gpio_trig_inverted_show, ··· 149 146 return -EINVAL; 150 147 } 151 148 149 + if (gpio_data->gpio == gpio) 150 + return n; 151 + 152 152 if (!gpio) { 153 - free_irq(gpio_to_irq(gpio_data->gpio), led); 153 + if (gpio_data->gpio != 0) 154 + free_irq(gpio_to_irq(gpio_data->gpio), led); 155 + gpio_data->gpio = 0; 154 156 return n; 155 157 } 156 158 157 - if (gpio_data->gpio > 0 && gpio_data->gpio != gpio) 158 - free_irq(gpio_to_irq(gpio_data->gpio), led); 159 - 160 - gpio_data->gpio = gpio; 161 159 ret = request_irq(gpio_to_irq(gpio), gpio_trig_irq, 162 160 IRQF_SHARED | IRQF_TRIGGER_RISING 163 161 | IRQF_TRIGGER_FALLING, "ledtrig-gpio", led); 164 - if (ret) 162 + if (ret) { 165 163 dev_err(dev, "request_irq failed with error %d\n", ret); 164 + } else { 165 + if (gpio_data->gpio != 0) 166 + free_irq(gpio_to_irq(gpio_data->gpio), led); 167 + gpio_data->gpio = gpio; 168 + } 166 169 167 170 return ret ? ret : n; 168 171 } ··· 220 211 device_remove_file(led->dev, &dev_attr_inverted); 221 212 device_remove_file(led->dev, &dev_attr_desired_brightness); 222 213 flush_work(&gpio_data->work); 223 - free_irq(gpio_to_irq(gpio_data->gpio),led); 214 + if (gpio_data->gpio != 0) 215 + free_irq(gpio_to_irq(gpio_data->gpio), led); 224 216 kfree(gpio_data); 225 217 } 226 218 }
+1 -1
drivers/macintosh/via-maciisi.c
··· 288 288 } 289 289 /* This could be BAD... when the ADB controller doesn't respond 290 290 * for this long, it's probably not coming back :-( */ 291 - if(count >= 50) /* Hopefully shouldn't happen */ 291 + if (count > 50) /* Hopefully shouldn't happen */ 292 292 printk(KERN_ERR "maciisi_send_request: poll timed out!\n"); 293 293 } 294 294
+25 -17
drivers/media/dvb/siano/Kconfig
··· 2 2 # Siano Mobile Silicon Digital TV device configuration 3 3 # 4 4 5 - config DVB_SIANO_SMS1XXX 6 - tristate "Siano SMS1XXX USB dongle support" 7 - depends on DVB_CORE && USB && INPUT 5 + config SMS_SIANO_MDTV 6 + tristate "Siano SMS1xxx based MDTV receiver" 7 + depends on DVB_CORE && INPUT 8 8 ---help--- 9 - Choose Y here if you have a USB dongle with a SMS1XXX chipset. 9 + Choose Y or M here if you have MDTV receiver with a Siano chipset. 10 10 11 - To compile this driver as a module, choose M here: the 12 - module will be called sms1xxx. 11 + To compile this driver as a module, choose M here 12 + (The module will be called smsmdtv). 13 13 14 - config DVB_SIANO_SMS1XXX_SMS_IDS 15 - bool "Enable support for Siano Mobile Silicon default USB IDs" 16 - depends on DVB_SIANO_SMS1XXX 17 - default y 14 + Further documentation on this driver can be found on the WWW 15 + at http://www.siano-ms.com/ 16 + 17 + if SMS_SIANO_MDTV 18 + menu "Siano module components" 19 + 20 + # Hardware interfaces support 21 + 22 + config SMS_USB_DRV 23 + tristate "USB interface support" 24 + depends on DVB_CORE && USB 18 25 ---help--- 19 - Choose Y here if you have a USB dongle with a SMS1XXX chipset 20 - that uses Siano Mobile Silicon's default usb vid:pid. 26 + Choose if you would like to have Siano's support for USB interface 21 27 22 - Choose N here if you would prefer to use Siano's external driver. 23 - 24 - Further documentation on this driver can be found on the WWW at 25 - <http://www.siano-ms.com/>. 26 - 28 + config SMS_SDIO_DRV 29 + tristate "SDIO interface support" 30 + depends on DVB_CORE && MMC 31 + ---help--- 32 + Choose if you would like to have Siano's support for SDIO interface 33 + endmenu 34 + endif # SMS_SIANO_MDTV
+5 -4
drivers/media/dvb/siano/Makefile
··· 1 - sms1xxx-objs := smscoreapi.o sms-cards.o smsendian.o smsir.o 2 1 3 - obj-$(CONFIG_DVB_SIANO_SMS1XXX) += sms1xxx.o 4 - obj-$(CONFIG_DVB_SIANO_SMS1XXX) += smsusb.o 5 - obj-$(CONFIG_DVB_SIANO_SMS1XXX) += smsdvb.o 2 + smsmdtv-objs := smscoreapi.o sms-cards.o smsendian.o smsir.o 3 + 4 + obj-$(CONFIG_SMS_SIANO_MDTV) += smsmdtv.o smsdvb.o 5 + obj-$(CONFIG_SMS_USB_DRV) += smsusb.o 6 + obj-$(CONFIG_SMS_SDIO_DRV) += smssdio.o 6 7 7 8 EXTRA_CFLAGS += -Idrivers/media/dvb/dvb-core 8 9
+44
drivers/media/dvb/siano/smsdvb.c
··· 325 325 0 : -ETIME; 326 326 } 327 327 328 + static inline int led_feedback(struct smsdvb_client_t *client) 329 + { 330 + if (client->fe_status & FE_HAS_LOCK) 331 + return sms_board_led_feedback(client->coredev, 332 + (client->sms_stat_dvb.ReceptionData.BER 333 + == 0) ? SMS_LED_HI : SMS_LED_LO); 334 + else 335 + return sms_board_led_feedback(client->coredev, SMS_LED_OFF); 336 + } 337 + 328 338 static int smsdvb_read_status(struct dvb_frontend *fe, fe_status_t *stat) 329 339 { 330 340 struct smsdvb_client_t *client; 331 341 client = container_of(fe, struct smsdvb_client_t, frontend); 332 342 333 343 *stat = client->fe_status; 344 + 345 + led_feedback(client); 334 346 335 347 return 0; 336 348 } ··· 353 341 client = container_of(fe, struct smsdvb_client_t, frontend); 354 342 355 343 *ber = client->sms_stat_dvb.ReceptionData.BER; 344 + 345 + led_feedback(client); 356 346 357 347 return 0; 358 348 } ··· 373 359 (client->sms_stat_dvb.ReceptionData.InBandPwr 374 360 + 95) * 3 / 2; 375 361 362 + led_feedback(client); 363 + 376 364 return 0; 377 365 } 378 366 ··· 385 369 386 370 *snr = client->sms_stat_dvb.ReceptionData.SNR; 387 371 372 + led_feedback(client); 373 + 388 374 return 0; 389 375 } 390 376 ··· 396 378 client = container_of(fe, struct smsdvb_client_t, frontend); 397 379 398 380 *ucblocks = client->sms_stat_dvb.ReceptionData.ErrorTSPackets; 381 + 382 + led_feedback(client); 399 383 400 384 return 0; 401 385 } ··· 424 404 u32 Data[3]; 425 405 } Msg; 426 406 407 + int ret; 408 + 427 409 client->fe_status = FE_HAS_SIGNAL; 428 410 client->event_fe_state = -1; 429 411 client->event_unc_state = -1; ··· 447 425 case BANDWIDTH_6_MHZ: Msg.Data[1] = BW_6_MHZ; break; 448 426 case BANDWIDTH_AUTO: return -EOPNOTSUPP; 449 427 default: return -EINVAL; 428 + } 429 + /* Disable LNA, if any. An error is returned if no LNA is present */ 430 + ret = sms_board_lna_control(client->coredev, 0); 431 + if (ret == 0) { 432 + fe_status_t status; 433 + 434 + /* tune with LNA off at first */ 435 + ret = smsdvb_sendrequest_and_wait(client, &Msg, sizeof(Msg), 436 + &client->tune_done); 437 + 438 + smsdvb_read_status(fe, &status); 439 + 440 + if (status & FE_HAS_LOCK) 441 + return ret; 442 + 443 + /* previous tune didnt lock - enable LNA and tune again */ 444 + sms_board_lna_control(client->coredev, 1); 450 445 } 451 446 452 447 return smsdvb_sendrequest_and_wait(client, &Msg, sizeof(Msg), ··· 490 451 struct smsdvb_client_t *client = 491 452 container_of(fe, struct smsdvb_client_t, frontend); 492 453 454 + sms_board_power(client->coredev, 1); 455 + 493 456 sms_board_dvb3_event(client, DVB3_EVENT_INIT); 494 457 return 0; 495 458 } ··· 500 459 { 501 460 struct smsdvb_client_t *client = 502 461 container_of(fe, struct smsdvb_client_t, frontend); 462 + 463 + sms_board_led_feedback(client->coredev, SMS_LED_OFF); 464 + sms_board_power(client->coredev, 0); 503 465 504 466 sms_board_dvb3_event(client, DVB3_EVENT_SLEEP); 505 467
+30 -24
drivers/media/dvb/siano/smssdio.c
··· 46 46 47 47 #define SMSSDIO_DATA 0x00 48 48 #define SMSSDIO_INT 0x04 49 + #define SMSSDIO_BLOCK_SIZE 128 49 50 50 51 static const struct sdio_device_id smssdio_ids[] = { 51 52 {SDIO_DEVICE(SDIO_VENDOR_ID_SIANO, SDIO_DEVICE_ID_SIANO_STELLAR), ··· 86 85 sdio_claim_host(smsdev->func); 87 86 88 87 while (size >= smsdev->func->cur_blksize) { 89 - ret = sdio_write_blocks(smsdev->func, SMSSDIO_DATA, buffer, 1); 88 + ret = sdio_memcpy_toio(smsdev->func, SMSSDIO_DATA, 89 + buffer, smsdev->func->cur_blksize); 90 90 if (ret) 91 91 goto out; 92 92 ··· 96 94 } 97 95 98 96 if (size) { 99 - ret = sdio_write_bytes(smsdev->func, SMSSDIO_DATA, 100 - buffer, size); 97 + ret = sdio_memcpy_toio(smsdev->func, SMSSDIO_DATA, 98 + buffer, size); 101 99 } 102 100 103 101 out: ··· 127 125 */ 128 126 isr = sdio_readb(func, SMSSDIO_INT, &ret); 129 127 if (ret) { 130 - dev_err(&smsdev->func->dev, 131 - "Unable to read interrupt register!\n"); 128 + sms_err("Unable to read interrupt register!\n"); 132 129 return; 133 130 } 134 131 135 132 if (smsdev->split_cb == NULL) { 136 133 cb = smscore_getbuffer(smsdev->coredev); 137 134 if (!cb) { 138 - dev_err(&smsdev->func->dev, 139 - "Unable to allocate data buffer!\n"); 135 + sms_err("Unable to allocate data buffer!\n"); 140 136 return; 141 137 } 142 138 143 - ret = sdio_read_blocks(smsdev->func, cb->p, SMSSDIO_DATA, 1); 139 + ret = sdio_memcpy_fromio(smsdev->func, 140 + cb->p, 141 + SMSSDIO_DATA, 142 + SMSSDIO_BLOCK_SIZE); 144 143 if (ret) { 145 - dev_err(&smsdev->func->dev, 146 - "Error %d reading initial block!\n", ret); 144 + sms_err("Error %d reading initial block!\n", ret); 147 145 return; 148 146 } 149 147 ··· 154 152 return; 155 153 } 156 154 157 - size = hdr->msgLength - smsdev->func->cur_blksize; 155 + if (hdr->msgLength > smsdev->func->cur_blksize) 156 + size = hdr->msgLength - smsdev->func->cur_blksize; 157 + else 158 + size = 0; 158 159 } else { 159 160 cb = smsdev->split_cb; 160 161 hdr = cb->p; ··· 167 162 smsdev->split_cb = NULL; 168 163 } 169 164 170 - if (hdr->msgLength > smsdev->func->cur_blksize) { 165 + if (size) { 171 166 void *buffer; 172 167 173 - size = ALIGN(size, 128); 174 - buffer = cb->p + hdr->msgLength; 168 + buffer = cb->p + (hdr->msgLength - size); 169 + size = ALIGN(size, SMSSDIO_BLOCK_SIZE); 175 170 176 - BUG_ON(smsdev->func->cur_blksize != 128); 171 + BUG_ON(smsdev->func->cur_blksize != SMSSDIO_BLOCK_SIZE); 177 172 178 173 /* 179 174 * First attempt to transfer all of it in one go... 180 175 */ 181 - ret = sdio_read_blocks(smsdev->func, buffer, 182 - SMSSDIO_DATA, size / 128); 176 + ret = sdio_memcpy_fromio(smsdev->func, 177 + buffer, 178 + SMSSDIO_DATA, 179 + size); 183 180 if (ret && ret != -EINVAL) { 184 181 smscore_putbuffer(smsdev->coredev, cb); 185 - dev_err(&smsdev->func->dev, 186 - "Error %d reading data from card!\n", ret); 182 + sms_err("Error %d reading data from card!\n", ret); 187 183 return; 188 184 } 189 185 ··· 197 191 */ 198 192 if (ret == -EINVAL) { 199 193 while (size) { 200 - ret = sdio_read_blocks(smsdev->func, 201 - buffer, SMSSDIO_DATA, 1); 194 + ret = sdio_memcpy_fromio(smsdev->func, 195 + buffer, SMSSDIO_DATA, 196 + smsdev->func->cur_blksize); 202 197 if (ret) { 203 198 smscore_putbuffer(smsdev->coredev, cb); 204 - dev_err(&smsdev->func->dev, 205 - "Error %d reading " 199 + sms_err("Error %d reading " 206 200 "data from card!\n", ret); 207 201 return; 208 202 } ··· 275 269 if (ret) 276 270 goto release; 277 271 278 - ret = sdio_set_block_size(func, 128); 272 + ret = sdio_set_block_size(func, SMSSDIO_BLOCK_SIZE); 279 273 if (ret) 280 274 goto disable; 281 275
+41 -3
drivers/media/video/em28xx/em28xx-cards.c
··· 1730 1730 EM28XX_I2C_FREQ_100_KHZ; 1731 1731 } 1732 1732 1733 + 1734 + /* FIXME: Should be replaced by a proper mt9m111 driver */ 1735 + static int em28xx_initialize_mt9m111(struct em28xx *dev) 1736 + { 1737 + int i; 1738 + unsigned char regs[][3] = { 1739 + { 0x0d, 0x00, 0x01, }, /* reset and use defaults */ 1740 + { 0x0d, 0x00, 0x00, }, 1741 + { 0x0a, 0x00, 0x21, }, 1742 + { 0x21, 0x04, 0x00, }, /* full readout speed, no row/col skipping */ 1743 + }; 1744 + 1745 + for (i = 0; i < ARRAY_SIZE(regs); i++) 1746 + i2c_master_send(&dev->i2c_client, &regs[i][0], 3); 1747 + 1748 + return 0; 1749 + } 1750 + 1751 + 1733 1752 /* FIXME: Should be replaced by a proper mt9m001 driver */ 1734 1753 static int em28xx_initialize_mt9m001(struct em28xx *dev) 1735 1754 { ··· 1777 1758 1778 1759 /* HINT method: webcam I2C chips 1779 1760 * 1780 - * This method work for webcams with Micron sensors 1761 + * This method works for webcams with Micron sensors 1781 1762 */ 1782 1763 static int em28xx_hint_sensor(struct em28xx *dev) 1783 1764 { ··· 1823 1804 dev->vinctl = 0x00; 1824 1805 1825 1806 break; 1807 + 1808 + case 0x143a: /* MT9M111 as found in the ECS G200 */ 1809 + dev->model = EM2750_BOARD_UNKNOWN; 1810 + em28xx_set_model(dev); 1811 + 1812 + sensor_name = "mt9m111"; 1813 + dev->board.xclk = EM28XX_XCLK_FREQUENCY_48MHZ; 1814 + dev->em28xx_sensor = EM28XX_MT9M111; 1815 + em28xx_initialize_mt9m111(dev); 1816 + dev->sensor_xres = 640; 1817 + dev->sensor_yres = 512; 1818 + 1819 + dev->vinmode = 0x0a; 1820 + dev->vinctl = 0x00; 1821 + 1822 + break; 1823 + 1826 1824 case 0x8431: 1827 1825 dev->model = EM2750_BOARD_UNKNOWN; 1828 1826 em28xx_set_model(dev); ··· 1856 1820 1857 1821 break; 1858 1822 default: 1859 - printk("Unknown Micron Sensor 0x%04x\n", be16_to_cpu(version)); 1823 + printk("Unknown Micron Sensor 0x%04x\n", version); 1860 1824 return -EINVAL; 1861 1825 } 1862 1826 ··· 2382 2346 } 2383 2347 2384 2348 em28xx_tuner_setup(dev); 2385 - em28xx_ir_init(dev); 2349 + 2350 + if(!disable_ir) 2351 + em28xx_ir_init(dev); 2386 2352 } 2387 2353 2388 2354
+1
drivers/media/video/em28xx/em28xx.h
··· 367 367 EM28XX_NOSENSOR = 0, 368 368 EM28XX_MT9V011, 369 369 EM28XX_MT9M001, 370 + EM28XX_MT9M111, 370 371 }; 371 372 372 373 enum em28xx_adecoder {
+1 -1
drivers/media/video/gspca/Kconfig
··· 114 114 115 115 config USB_GSPCA_SN9C20X_EVDEV 116 116 bool "Enable evdev support" 117 - depends on USB_GSPCA_SN9C20X 117 + depends on USB_GSPCA_SN9C20X && INPUT 118 118 ---help--- 119 119 Say Y here in order to enable evdev support for sn9c20x webcam button. 120 120
+1 -1
drivers/media/video/zr364xx.c
··· 695 695 for (i = 0; i < 2; i++) { 696 696 err = 697 697 send_control_msg(udev, 1, init[cam->method][i].value, 698 - 0, init[i][cam->method].bytes, 698 + 0, init[cam->method][i].bytes, 699 699 init[cam->method][i].size); 700 700 if (err < 0) { 701 701 dev_err(&udev->dev, "error during release sequence\n");
+1 -1
drivers/mtd/nand/orion_nand.c
··· 61 61 buf64 = (uint64_t *)buf; 62 62 while (i < len/8) { 63 63 uint64_t x; 64 - asm ("ldrd\t%0, [%1]" : "=r" (x) : "r" (io_base)); 64 + asm volatile ("ldrd\t%0, [%1]" : "=&r" (x) : "r" (io_base)); 65 65 buf64[i++] = x; 66 66 } 67 67 i *= 8;
+3 -1
drivers/net/Kconfig
··· 1727 1727 tristate "Micrel KSZ8842" 1728 1728 depends on HAS_IOMEM 1729 1729 help 1730 - This platform driver is for Micrel KSZ8842 chip. 1730 + This platform driver is for Micrel KSZ8842 / KS8842 1731 + 2-port ethernet switch chip (managed, VLAN, QoS). 1731 1732 1732 1733 config KS8851 1733 1734 tristate "Micrel KS8851 SPI" 1734 1735 depends on SPI 1735 1736 select MII 1737 + select CRC32 1736 1738 help 1737 1739 SPI driver for Micrel KS8851 SPI attached network chip. 1738 1740
+2 -2
drivers/net/arm/w90p910_ether.c
··· 1080 1080 .probe = w90p910_ether_probe, 1081 1081 .remove = __devexit_p(w90p910_ether_remove), 1082 1082 .driver = { 1083 - .name = "w90p910-emc", 1083 + .name = "nuc900-emc", 1084 1084 .owner = THIS_MODULE, 1085 1085 }, 1086 1086 }; ··· 1101 1101 MODULE_AUTHOR("Wan ZongShun <mcuos.com@gmail.com>"); 1102 1102 MODULE_DESCRIPTION("w90p910 MAC driver!"); 1103 1103 MODULE_LICENSE("GPL"); 1104 - MODULE_ALIAS("platform:w90p910-emc"); 1104 + MODULE_ALIAS("platform:nuc900-emc"); 1105 1105
+1 -1
drivers/net/e100.c
··· 1899 1899 nic->ru_running = RU_SUSPENDED; 1900 1900 pci_dma_sync_single_for_device(nic->pdev, rx->dma_addr, 1901 1901 sizeof(struct rfd), 1902 - PCI_DMA_BIDIRECTIONAL); 1902 + PCI_DMA_FROMDEVICE); 1903 1903 return -ENODATA; 1904 1904 } 1905 1905
+3 -2
drivers/net/fec_mpc52xx.c
··· 309 309 { 310 310 struct mpc52xx_fec_priv *priv = netdev_priv(dev); 311 311 struct bcom_fec_bd *bd; 312 + unsigned long flags; 312 313 313 314 if (bcom_queue_full(priv->tx_dmatsk)) { 314 315 if (net_ratelimit()) ··· 317 316 return NETDEV_TX_BUSY; 318 317 } 319 318 320 - spin_lock_irq(&priv->lock); 319 + spin_lock_irqsave(&priv->lock, flags); 321 320 dev->trans_start = jiffies; 322 321 323 322 bd = (struct bcom_fec_bd *) ··· 333 332 netif_stop_queue(dev); 334 333 } 335 334 336 - spin_unlock_irq(&priv->lock); 335 + spin_unlock_irqrestore(&priv->lock, flags); 337 336 338 337 return NETDEV_TX_OK; 339 338 }
+2
drivers/net/ibm_newemac/core.c
··· 1305 1305 1306 1306 free_irq(dev->emac_irq, dev); 1307 1307 1308 + netif_carrier_off(ndev); 1309 + 1308 1310 return 0; 1309 1311 } 1310 1312
-4
drivers/net/irda/au1k_ir.c
··· 23 23 #include <linux/init.h> 24 24 #include <linux/errno.h> 25 25 #include <linux/netdevice.h> 26 - #include <linux/etherdevice.h> 27 26 #include <linux/slab.h> 28 27 #include <linux/rtnetlink.h> 29 28 #include <linux/interrupt.h> ··· 204 205 .ndo_start_xmit = au1k_irda_hard_xmit, 205 206 .ndo_tx_timeout = au1k_tx_timeout, 206 207 .ndo_do_ioctl = au1k_irda_ioctl, 207 - .ndo_change_mtu = eth_change_mtu, 208 - .ndo_validate_addr = eth_validate_addr, 209 - .ndo_set_mac_address = eth_mac_addr, 210 208 }; 211 209 212 210 static int au1k_irda_net_init(struct net_device *dev)
+1 -3
drivers/net/irda/pxaficp_ir.c
··· 803 803 .ndo_stop = pxa_irda_stop, 804 804 .ndo_start_xmit = pxa_irda_hard_xmit, 805 805 .ndo_do_ioctl = pxa_irda_ioctl, 806 - .ndo_change_mtu = eth_change_mtu, 807 - .ndo_validate_addr = eth_validate_addr, 808 - .ndo_set_mac_address = eth_mac_addr, 809 806 }; 810 807 811 808 static int pxa_irda_probe(struct platform_device *pdev) ··· 827 830 if (!dev) 828 831 goto err_mem_3; 829 832 833 + SET_NETDEV_DEV(dev, &pdev->dev); 830 834 si = netdev_priv(dev); 831 835 si->dev = &pdev->dev; 832 836 si->pdata = pdev->dev.platform_data;
-4
drivers/net/irda/sa1100_ir.c
··· 24 24 #include <linux/init.h> 25 25 #include <linux/errno.h> 26 26 #include <linux/netdevice.h> 27 - #include <linux/etherdevice.h> 28 27 #include <linux/slab.h> 29 28 #include <linux/rtnetlink.h> 30 29 #include <linux/interrupt.h> ··· 880 881 .ndo_stop = sa1100_irda_stop, 881 882 .ndo_start_xmit = sa1100_irda_hard_xmit, 882 883 .ndo_do_ioctl = sa1100_irda_ioctl, 883 - .ndo_change_mtu = eth_change_mtu, 884 - .ndo_validate_addr = eth_validate_addr, 885 - .ndo_set_mac_address = eth_mac_addr, 886 884 }; 887 885 888 886 static int sa1100_irda_probe(struct platform_device *pdev)
+3 -2
drivers/net/ixp2000/ixpdev.c
··· 41 41 struct ixpdev_priv *ip = netdev_priv(dev); 42 42 struct ixpdev_tx_desc *desc; 43 43 int entry; 44 + unsigned long flags; 44 45 45 46 if (unlikely(skb->len > PAGE_SIZE)) { 46 47 /* @@@ Count drops. */ ··· 64 63 65 64 dev->trans_start = jiffies; 66 65 67 - local_irq_disable(); 66 + local_irq_save(flags); 68 67 ip->tx_queue_entries++; 69 68 if (ip->tx_queue_entries == TX_BUF_COUNT_PER_CHAN) 70 69 netif_stop_queue(dev); 71 - local_irq_enable(); 70 + local_irq_restore(flags); 72 71 73 72 return 0; 74 73 }
+4 -3
drivers/net/macb.c
··· 620 620 dma_addr_t mapping; 621 621 unsigned int len, entry; 622 622 u32 ctrl; 623 + unsigned long flags; 623 624 624 625 #ifdef DEBUG 625 626 int i; ··· 636 635 #endif 637 636 638 637 len = skb->len; 639 - spin_lock_irq(&bp->lock); 638 + spin_lock_irqsave(&bp->lock, flags); 640 639 641 640 /* This is a hard error, log it. */ 642 641 if (TX_BUFFS_AVAIL(bp) < 1) { 643 642 netif_stop_queue(dev); 644 - spin_unlock_irq(&bp->lock); 643 + spin_unlock_irqrestore(&bp->lock, flags); 645 644 dev_err(&bp->pdev->dev, 646 645 "BUG! Tx Ring full when queue awake!\n"); 647 646 dev_dbg(&bp->pdev->dev, "tx_head = %u, tx_tail = %u\n", ··· 675 674 if (TX_BUFFS_AVAIL(bp) < 1) 676 675 netif_stop_queue(dev); 677 676 678 - spin_unlock_irq(&bp->lock); 677 + spin_unlock_irqrestore(&bp->lock, flags); 679 678 680 679 dev->trans_start = jiffies; 681 680
+3 -2
drivers/net/mlx4/en_tx.c
··· 437 437 { 438 438 struct mlx4_en_cq *cq = &priv->tx_cq[tx_ind]; 439 439 struct mlx4_en_tx_ring *ring = &priv->tx_ring[tx_ind]; 440 + unsigned long flags; 440 441 441 442 /* If we don't have a pending timer, set one up to catch our recent 442 443 post in case the interface becomes idle */ ··· 446 445 447 446 /* Poll the CQ every mlx4_en_TX_MODER_POLL packets */ 448 447 if ((++ring->poll_cnt & (MLX4_EN_TX_POLL_MODER - 1)) == 0) 449 - if (spin_trylock_irq(&ring->comp_lock)) { 448 + if (spin_trylock_irqsave(&ring->comp_lock, flags)) { 450 449 mlx4_en_process_tx_cq(priv->dev, cq); 451 - spin_unlock_irq(&ring->comp_lock); 450 + spin_unlock_irqrestore(&ring->comp_lock, flags); 452 451 } 453 452 } 454 453
+22 -18
drivers/net/smc91x.c
··· 196 196 /* this enables an interrupt in the interrupt mask register */ 197 197 #define SMC_ENABLE_INT(lp, x) do { \ 198 198 unsigned char mask; \ 199 - spin_lock_irq(&lp->lock); \ 199 + unsigned long smc_enable_flags; \ 200 + spin_lock_irqsave(&lp->lock, smc_enable_flags); \ 200 201 mask = SMC_GET_INT_MASK(lp); \ 201 202 mask |= (x); \ 202 203 SMC_SET_INT_MASK(lp, mask); \ 203 - spin_unlock_irq(&lp->lock); \ 204 + spin_unlock_irqrestore(&lp->lock, smc_enable_flags); \ 204 205 } while (0) 205 206 206 207 /* this disables an interrupt from the interrupt mask register */ 207 208 #define SMC_DISABLE_INT(lp, x) do { \ 208 209 unsigned char mask; \ 209 - spin_lock_irq(&lp->lock); \ 210 + unsigned long smc_disable_flags; \ 211 + spin_lock_irqsave(&lp->lock, smc_disable_flags); \ 210 212 mask = SMC_GET_INT_MASK(lp); \ 211 213 mask &= ~(x); \ 212 214 SMC_SET_INT_MASK(lp, mask); \ 213 - spin_unlock_irq(&lp->lock); \ 215 + spin_unlock_irqrestore(&lp->lock, smc_disable_flags); \ 214 216 } while (0) 215 217 216 218 /* ··· 522 520 * any other concurrent access and C would always interrupt B. But life 523 521 * isn't that easy in a SMP world... 524 522 */ 525 - #define smc_special_trylock(lock) \ 523 + #define smc_special_trylock(lock, flags) \ 526 524 ({ \ 527 525 int __ret; \ 528 - local_irq_disable(); \ 526 + local_irq_save(flags); \ 529 527 __ret = spin_trylock(lock); \ 530 528 if (!__ret) \ 531 - local_irq_enable(); \ 529 + local_irq_restore(flags); \ 532 530 __ret; \ 533 531 }) 534 - #define smc_special_lock(lock) spin_lock_irq(lock) 535 - #define smc_special_unlock(lock) spin_unlock_irq(lock) 532 + #define smc_special_lock(lock, flags) spin_lock_irqsave(lock, flags) 533 + #define smc_special_unlock(lock, flags) spin_unlock_irqrestore(lock, flags) 536 534 #else 537 - #define smc_special_trylock(lock) (1) 538 - #define smc_special_lock(lock) do { } while (0) 539 - #define smc_special_unlock(lock) do { } while (0) 535 + #define smc_special_trylock(lock, flags) (1) 536 + #define smc_special_lock(lock, flags) do { } while (0) 537 + #define smc_special_unlock(lock, flags) do { } while (0) 540 538 #endif 541 539 542 540 /* ··· 550 548 struct sk_buff *skb; 551 549 unsigned int packet_no, len; 552 550 unsigned char *buf; 551 + unsigned long flags; 553 552 554 553 DBG(3, "%s: %s\n", dev->name, __func__); 555 554 556 - if (!smc_special_trylock(&lp->lock)) { 555 + if (!smc_special_trylock(&lp->lock, flags)) { 557 556 netif_stop_queue(dev); 558 557 tasklet_schedule(&lp->tx_task); 559 558 return; ··· 562 559 563 560 skb = lp->pending_tx_skb; 564 561 if (unlikely(!skb)) { 565 - smc_special_unlock(&lp->lock); 562 + smc_special_unlock(&lp->lock, flags); 566 563 return; 567 564 } 568 565 lp->pending_tx_skb = NULL; ··· 572 569 printk("%s: Memory allocation failed.\n", dev->name); 573 570 dev->stats.tx_errors++; 574 571 dev->stats.tx_fifo_errors++; 575 - smc_special_unlock(&lp->lock); 572 + smc_special_unlock(&lp->lock, flags); 576 573 goto done; 577 574 } 578 575 ··· 611 608 612 609 /* queue the packet for TX */ 613 610 SMC_SET_MMU_CMD(lp, MC_ENQUEUE); 614 - smc_special_unlock(&lp->lock); 611 + smc_special_unlock(&lp->lock, flags); 615 612 616 613 dev->trans_start = jiffies; 617 614 dev->stats.tx_packets++; ··· 636 633 struct smc_local *lp = netdev_priv(dev); 637 634 void __iomem *ioaddr = lp->base; 638 635 unsigned int numPages, poll_count, status; 636 + unsigned long flags; 639 637 640 638 DBG(3, "%s: %s\n", dev->name, __func__); 641 639 ··· 662 658 return 0; 663 659 } 664 660 665 - smc_special_lock(&lp->lock); 661 + smc_special_lock(&lp->lock, flags); 666 662 667 663 /* now, try to allocate the memory */ 668 664 SMC_SET_MMU_CMD(lp, MC_ALLOC | numPages); ··· 680 676 } 681 677 } while (--poll_count); 682 678 683 - smc_special_unlock(&lp->lock); 679 + smc_special_unlock(&lp->lock, flags); 684 680 685 681 lp->pending_tx_skb = skb; 686 682 if (!poll_count) {
+46 -15
drivers/net/virtio_net.c
··· 70 70 struct sk_buff_head recv; 71 71 struct sk_buff_head send; 72 72 73 + /* Work struct for refilling if we run low on memory. */ 74 + struct delayed_work refill; 75 + 73 76 /* Chain pages by the private ptr. */ 74 77 struct page *pages; 75 78 }; ··· 276 273 dev_kfree_skb(skb); 277 274 } 278 275 279 - static void try_fill_recv_maxbufs(struct virtnet_info *vi) 276 + static bool try_fill_recv_maxbufs(struct virtnet_info *vi, gfp_t gfp) 280 277 { 281 278 struct sk_buff *skb; 282 279 struct scatterlist sg[2+MAX_SKB_FRAGS]; 283 280 int num, err, i; 281 + bool oom = false; 284 282 285 283 sg_init_table(sg, 2+MAX_SKB_FRAGS); 286 284 for (;;) { 287 285 struct virtio_net_hdr *hdr; 288 286 289 287 skb = netdev_alloc_skb(vi->dev, MAX_PACKET_LEN + NET_IP_ALIGN); 290 - if (unlikely(!skb)) 288 + if (unlikely(!skb)) { 289 + oom = true; 291 290 break; 291 + } 292 292 293 293 skb_reserve(skb, NET_IP_ALIGN); 294 294 skb_put(skb, MAX_PACKET_LEN); ··· 302 296 if (vi->big_packets) { 303 297 for (i = 0; i < MAX_SKB_FRAGS; i++) { 304 298 skb_frag_t *f = &skb_shinfo(skb)->frags[i]; 305 - f->page = get_a_page(vi, GFP_ATOMIC); 299 + f->page = get_a_page(vi, gfp); 306 300 if (!f->page) 307 301 break; 308 302 ··· 331 325 if (unlikely(vi->num > vi->max)) 332 326 vi->max = vi->num; 333 327 vi->rvq->vq_ops->kick(vi->rvq); 328 + return !oom; 334 329 } 335 330 336 - static void try_fill_recv(struct virtnet_info *vi) 331 + /* Returns false if we couldn't fill entirely (OOM). */ 332 + static bool try_fill_recv(struct virtnet_info *vi, gfp_t gfp) 337 333 { 338 334 struct sk_buff *skb; 339 335 struct scatterlist sg[1]; 340 336 int err; 337 + bool oom = false; 341 338 342 - if (!vi->mergeable_rx_bufs) { 343 - try_fill_recv_maxbufs(vi); 344 - return; 345 - } 339 + if (!vi->mergeable_rx_bufs) 340 + return try_fill_recv_maxbufs(vi, gfp); 346 341 347 342 for (;;) { 348 343 skb_frag_t *f; 349 344 350 345 skb = netdev_alloc_skb(vi->dev, GOOD_COPY_LEN + NET_IP_ALIGN); 351 - if (unlikely(!skb)) 346 + if (unlikely(!skb)) { 347 + oom = true; 352 348 break; 349 + } 353 350 354 351 skb_reserve(skb, NET_IP_ALIGN); 355 352 356 353 f = &skb_shinfo(skb)->frags[0]; 357 - f->page = get_a_page(vi, GFP_ATOMIC); 354 + f->page = get_a_page(vi, gfp); 358 355 if (!f->page) { 356 + oom = true; 359 357 kfree_skb(skb); 360 358 break; 361 359 } ··· 383 373 if (unlikely(vi->num > vi->max)) 384 374 vi->max = vi->num; 385 375 vi->rvq->vq_ops->kick(vi->rvq); 376 + return !oom; 386 377 } 387 378 388 379 static void skb_recv_done(struct virtqueue *rvq) ··· 394 383 rvq->vq_ops->disable_cb(rvq); 395 384 __napi_schedule(&vi->napi); 396 385 } 386 + } 387 + 388 + static void refill_work(struct work_struct *work) 389 + { 390 + struct virtnet_info *vi; 391 + bool still_empty; 392 + 393 + vi = container_of(work, struct virtnet_info, refill.work); 394 + napi_disable(&vi->napi); 395 + try_fill_recv(vi, GFP_KERNEL); 396 + still_empty = (vi->num == 0); 397 + napi_enable(&vi->napi); 398 + 399 + /* In theory, this can happen: if we don't get any buffers in 400 + * we will *never* try to fill again. */ 401 + if (still_empty) 402 + schedule_delayed_work(&vi->refill, HZ/2); 397 403 } 398 404 399 405 static int virtnet_poll(struct napi_struct *napi, int budget) ··· 428 400 received++; 429 401 } 430 402 431 - /* FIXME: If we oom and completely run out of inbufs, we need 432 - * to start a timer trying to fill more. */ 433 - if (vi->num < vi->max / 2) 434 - try_fill_recv(vi); 403 + if (vi->num < vi->max / 2) { 404 + if (!try_fill_recv(vi, GFP_ATOMIC)) 405 + schedule_delayed_work(&vi->refill, 0); 406 + } 435 407 436 408 /* Out of packets? */ 437 409 if (received < budget) { ··· 921 893 vi->vdev = vdev; 922 894 vdev->priv = vi; 923 895 vi->pages = NULL; 896 + INIT_DELAYED_WORK(&vi->refill, refill_work); 924 897 925 898 /* If they give us a callback when all buffers are done, we don't need 926 899 * the timer. */ ··· 970 941 } 971 942 972 943 /* Last of all, set up some receive buffers. */ 973 - try_fill_recv(vi); 944 + try_fill_recv(vi, GFP_KERNEL); 974 945 975 946 /* If we didn't even get one input buffer, we're useless. */ 976 947 if (vi->num == 0) { ··· 987 958 988 959 unregister: 989 960 unregister_netdev(dev); 961 + cancel_delayed_work_sync(&vi->refill); 990 962 free_vqs: 991 963 vdev->config->del_vqs(vdev); 992 964 free: ··· 1016 986 BUG_ON(vi->num != 0); 1017 987 1018 988 unregister_netdev(vi->dev); 989 + cancel_delayed_work_sync(&vi->refill); 1019 990 1020 991 vdev->config->del_vqs(vi->vdev); 1021 992
+1 -1
drivers/net/wireless/orinoco/hw.c
··· 70 70 int err = 0; 71 71 u8 tsc_arr[4][IW_ENCODE_SEQ_MAX_SIZE]; 72 72 73 - if ((key < 0) || (key > 4)) 73 + if ((key < 0) || (key >= 4)) 74 74 return -EINVAL; 75 75 76 76 err = hermes_read_ltv(hw, USER_BAP, HERMES_RID_CURRENT_TKIP_IV,
+10 -4
drivers/net/wireless/rtl818x/rtl8187_dev.c
··· 869 869 priv->aifsn[3] = 3; /* AIFSN[AC_BE] */ 870 870 rtl818x_iowrite8(priv, &priv->map->ACM_CONTROL, 0); 871 871 872 + /* ENEDCA flag must always be set, transmit issues? */ 873 + rtl818x_iowrite8(priv, &priv->map->MSR, RTL818X_MSR_ENEDCA); 874 + 872 875 return 0; 873 876 } 874 877 ··· 1176 1173 rtl818x_iowrite8(priv, &priv->map->BSSID[i], 1177 1174 info->bssid[i]); 1178 1175 1176 + if (priv->is_rtl8187b) 1177 + reg = RTL818X_MSR_ENEDCA; 1178 + else 1179 + reg = 0; 1180 + 1179 1181 if (is_valid_ether_addr(info->bssid)) { 1180 - reg = RTL818X_MSR_INFRA; 1181 - if (priv->is_rtl8187b) 1182 - reg |= RTL818X_MSR_ENEDCA; 1182 + reg |= RTL818X_MSR_INFRA; 1183 1183 rtl818x_iowrite8(priv, &priv->map->MSR, reg); 1184 1184 } else { 1185 - reg = RTL818X_MSR_NO_LINK; 1185 + reg |= RTL818X_MSR_NO_LINK; 1186 1186 rtl818x_iowrite8(priv, &priv->map->MSR, reg); 1187 1187 } 1188 1188
+18 -10
drivers/net/yellowfin.c
··· 346 346 static int yellowfin_open(struct net_device *dev); 347 347 static void yellowfin_timer(unsigned long data); 348 348 static void yellowfin_tx_timeout(struct net_device *dev); 349 - static void yellowfin_init_ring(struct net_device *dev); 349 + static int yellowfin_init_ring(struct net_device *dev); 350 350 static int yellowfin_start_xmit(struct sk_buff *skb, struct net_device *dev); 351 351 static irqreturn_t yellowfin_interrupt(int irq, void *dev_instance); 352 352 static int yellowfin_rx(struct net_device *dev); ··· 573 573 { 574 574 struct yellowfin_private *yp = netdev_priv(dev); 575 575 void __iomem *ioaddr = yp->base; 576 - int i; 576 + int i, ret; 577 577 578 578 /* Reset the chip. */ 579 579 iowrite32(0x80000000, ioaddr + DMACtrl); 580 580 581 - i = request_irq(dev->irq, &yellowfin_interrupt, IRQF_SHARED, dev->name, dev); 582 - if (i) return i; 581 + ret = request_irq(dev->irq, &yellowfin_interrupt, IRQF_SHARED, dev->name, dev); 582 + if (ret) 583 + return ret; 583 584 584 585 if (yellowfin_debug > 1) 585 586 printk(KERN_DEBUG "%s: yellowfin_open() irq %d.\n", 586 587 dev->name, dev->irq); 587 588 588 - yellowfin_init_ring(dev); 589 + ret = yellowfin_init_ring(dev); 590 + if (ret) { 591 + free_irq(dev->irq, dev); 592 + return ret; 593 + } 589 594 590 595 iowrite32(yp->rx_ring_dma, ioaddr + RxPtr); 591 596 iowrite32(yp->tx_ring_dma, ioaddr + TxPtr); ··· 730 725 } 731 726 732 727 /* Initialize the Rx and Tx rings, along with various 'dev' bits. */ 733 - static void yellowfin_init_ring(struct net_device *dev) 728 + static int yellowfin_init_ring(struct net_device *dev) 734 729 { 735 730 struct yellowfin_private *yp = netdev_priv(dev); 736 - int i; 731 + int i, j; 737 732 738 733 yp->tx_full = 0; 739 734 yp->cur_rx = yp->cur_tx = 0; ··· 758 753 yp->rx_ring[i].addr = cpu_to_le32(pci_map_single(yp->pci_dev, 759 754 skb->data, yp->rx_buf_sz, PCI_DMA_FROMDEVICE)); 760 755 } 756 + if (i != RX_RING_SIZE) { 757 + for (j = 0; j < i; j++) 758 + dev_kfree_skb(yp->rx_skbuff[j]); 759 + return -ENOMEM; 760 + } 761 761 yp->rx_ring[i-1].dbdma_cmd = cpu_to_le32(CMD_STOP); 762 762 yp->dirty_rx = (unsigned int)(i - RX_RING_SIZE); 763 763 ··· 779 769 yp->tx_ring[--i].dbdma_cmd = cpu_to_le32(CMD_STOP | BRANCH_ALWAYS); 780 770 #else 781 771 { 782 - int j; 783 - 784 772 /* Tx ring needs a pair of descriptors, the second for the status. */ 785 773 for (i = 0; i < TX_RING_SIZE; i++) { 786 774 j = 2*i; ··· 813 805 } 814 806 #endif 815 807 yp->tx_tail_desc = &yp->tx_status[0]; 816 - return; 808 + return 0; 817 809 } 818 810 819 811 static int yellowfin_start_xmit(struct sk_buff *skb, struct net_device *dev)
+1 -1
drivers/pci/pci-driver.c
··· 508 508 return error; 509 509 } 510 510 511 - return pci_dev->state_saved ? pci_restore_state(pci_dev) : 0; 511 + return pci_restore_state(pci_dev); 512 512 } 513 513 514 514 static void pci_pm_default_resume_noirq(struct pci_dev *pci_dev)
+2
drivers/pci/pci.c
··· 846 846 int i; 847 847 u32 val; 848 848 849 + if (!dev->state_saved) 850 + return 0; 849 851 /* PCI Express register must be restored first */ 850 852 pci_restore_pcie_state(dev); 851 853
+1
drivers/platform/x86/toshiba_acpi.c
··· 335 335 if (hci_result != HCI_SUCCESS) { 336 336 /* Can't do anything useful */ 337 337 mutex_unlock(&dev->mutex); 338 + return; 338 339 } 339 340 340 341 new_rfk_state = value;
+4 -4
drivers/platform/x86/wmi.c
··· 270 270 acpi_status status; 271 271 struct acpi_object_list input; 272 272 union acpi_object params[3]; 273 - char method[4] = "WM"; 273 + char method[5] = "WM"; 274 274 275 275 if (!find_guid(guid_string, &wblock)) 276 276 return AE_ERROR; ··· 328 328 acpi_status status, wc_status = AE_ERROR; 329 329 struct acpi_object_list input, wc_input; 330 330 union acpi_object wc_params[1], wq_params[1]; 331 - char method[4]; 332 - char wc_method[4] = "WC"; 331 + char method[5]; 332 + char wc_method[5] = "WC"; 333 333 334 334 if (!guid_string || !out) 335 335 return AE_BAD_PARAMETER; ··· 410 410 acpi_handle handle; 411 411 struct acpi_object_list input; 412 412 union acpi_object params[2]; 413 - char method[4] = "WS"; 413 + char method[5] = "WS"; 414 414 415 415 if (!guid_string || !in) 416 416 return AE_BAD_DATA;
+1 -1
drivers/pps/pps.c
··· 244 244 } 245 245 pps->dev = device_create(pps_class, pps->info.dev, pps->devno, NULL, 246 246 "pps%d", pps->id); 247 - if (err) 247 + if (IS_ERR(pps->dev)) 248 248 goto del_cdev; 249 249 dev_set_drvdata(pps->dev, pps); 250 250
+1 -1
drivers/s390/block/dasd.c
··· 2135 2135 struct dasd_device *base; 2136 2136 2137 2137 block = bdev->bd_disk->private_data; 2138 - base = block->base; 2139 2138 if (!block) 2140 2139 return -ENODEV; 2140 + base = block->base; 2141 2141 2142 2142 if (!base->discipline || 2143 2143 !base->discipline->fill_geometry)
+1 -3
drivers/s390/cio/device.c
··· 772 772 cdev = io_subchannel_allocate_dev(sch); 773 773 if (!IS_ERR(cdev)) { 774 774 ret = io_subchannel_initialize_dev(sch, cdev); 775 - if (ret) { 776 - kfree(cdev); 775 + if (ret) 777 776 cdev = ERR_PTR(ret); 778 - } 779 777 } 780 778 return cdev; 781 779 }
+8 -3
drivers/sbus/char/bbc_envctrl.c
··· 537 537 } 538 538 if (temp_index != 0 && fan_index != 0) { 539 539 kenvctrld_task = kthread_run(kenvctrld, NULL, "kenvctrld"); 540 - if (IS_ERR(kenvctrld_task)) 541 - return PTR_ERR(kenvctrld_task); 540 + if (IS_ERR(kenvctrld_task)) { 541 + int err = PTR_ERR(kenvctrld_task); 542 + 543 + kenvctrld_task = NULL; 544 + return err; 545 + } 542 546 } 543 547 544 548 return 0; ··· 565 561 struct bbc_cpu_temperature *tp, *tpos; 566 562 struct bbc_fan_control *fp, *fpos; 567 563 568 - kthread_stop(kenvctrld_task); 564 + if (kenvctrld_task) 565 + kthread_stop(kenvctrld_task); 569 566 570 567 list_for_each_entry_safe(tp, tpos, &bp->temps, bp_list) { 571 568 list_del(&tp->bp_list);
+67 -31
drivers/scsi/mpt2sas/mpt2sas_base.c
··· 119 119 spin_unlock_irqrestore(&ioc->ioc_reset_in_progress_lock, flags); 120 120 } 121 121 122 + /** 123 + * mpt2sas_base_start_watchdog - start the fault_reset_work_q 124 + * @ioc: pointer to scsi command object 125 + * Context: sleep. 126 + * 127 + * Return nothing. 128 + */ 129 + void 130 + mpt2sas_base_start_watchdog(struct MPT2SAS_ADAPTER *ioc) 131 + { 132 + unsigned long flags; 133 + 134 + if (ioc->fault_reset_work_q) 135 + return; 136 + 137 + /* initialize fault polling */ 138 + INIT_DELAYED_WORK(&ioc->fault_reset_work, _base_fault_reset_work); 139 + snprintf(ioc->fault_reset_work_q_name, 140 + sizeof(ioc->fault_reset_work_q_name), "poll_%d_status", ioc->id); 141 + ioc->fault_reset_work_q = 142 + create_singlethread_workqueue(ioc->fault_reset_work_q_name); 143 + if (!ioc->fault_reset_work_q) { 144 + printk(MPT2SAS_ERR_FMT "%s: failed (line=%d)\n", 145 + ioc->name, __func__, __LINE__); 146 + return; 147 + } 148 + spin_lock_irqsave(&ioc->ioc_reset_in_progress_lock, flags); 149 + if (ioc->fault_reset_work_q) 150 + queue_delayed_work(ioc->fault_reset_work_q, 151 + &ioc->fault_reset_work, 152 + msecs_to_jiffies(FAULT_POLLING_INTERVAL)); 153 + spin_unlock_irqrestore(&ioc->ioc_reset_in_progress_lock, flags); 154 + } 155 + 156 + /** 157 + * mpt2sas_base_stop_watchdog - stop the fault_reset_work_q 158 + * @ioc: pointer to scsi command object 159 + * Context: sleep. 160 + * 161 + * Return nothing. 162 + */ 163 + void 164 + mpt2sas_base_stop_watchdog(struct MPT2SAS_ADAPTER *ioc) 165 + { 166 + unsigned long flags; 167 + struct workqueue_struct *wq; 168 + 169 + spin_lock_irqsave(&ioc->ioc_reset_in_progress_lock, flags); 170 + wq = ioc->fault_reset_work_q; 171 + ioc->fault_reset_work_q = NULL; 172 + spin_unlock_irqrestore(&ioc->ioc_reset_in_progress_lock, flags); 173 + if (wq) { 174 + if (!cancel_delayed_work(&ioc->fault_reset_work)) 175 + flush_workqueue(wq); 176 + destroy_workqueue(wq); 177 + } 178 + } 179 + 122 180 #ifdef CONFIG_SCSI_MPT2SAS_LOGGING 123 181 /** 124 182 * _base_sas_ioc_info - verbose translation of the ioc status ··· 496 438 497 439 sas_loginfo.loginfo = log_info; 498 440 if (sas_loginfo.dw.bus_type != 3 /*SAS*/) 441 + return; 442 + 443 + /* each nexus loss loginfo */ 444 + if (log_info == 0x31170000) 499 445 return; 500 446 501 447 /* eat the loginfos associated with task aborts */ ··· 1171 1109 } 1172 1110 } 1173 1111 1174 - pci_set_drvdata(pdev, ioc->shost); 1175 1112 _base_mask_interrupts(ioc); 1176 1113 r = _base_enable_msix(ioc); 1177 1114 if (r) ··· 1193 1132 ioc->pci_irq = -1; 1194 1133 pci_release_selected_regions(ioc->pdev, ioc->bars); 1195 1134 pci_disable_device(pdev); 1196 - pci_set_drvdata(pdev, NULL); 1197 1135 return r; 1198 1136 } 1199 1137 ··· 3251 3191 ioc->chip_phys = 0; 3252 3192 pci_release_selected_regions(ioc->pdev, ioc->bars); 3253 3193 pci_disable_device(pdev); 3254 - pci_set_drvdata(pdev, NULL); 3255 3194 return; 3256 3195 } 3257 3196 ··· 3264 3205 mpt2sas_base_attach(struct MPT2SAS_ADAPTER *ioc) 3265 3206 { 3266 3207 int r, i; 3267 - unsigned long flags; 3268 3208 3269 3209 dinitprintk(ioc, printk(MPT2SAS_DEBUG_FMT "%s\n", ioc->name, 3270 3210 __func__)); ··· 3272 3214 if (r) 3273 3215 return r; 3274 3216 3217 + pci_set_drvdata(ioc->pdev, ioc->shost); 3275 3218 r = _base_make_ioc_ready(ioc, CAN_SLEEP, SOFT_RESET); 3276 3219 if (r) 3277 3220 goto out_free_resources; ··· 3347 3288 if (r) 3348 3289 goto out_free_resources; 3349 3290 3350 - /* initialize fault polling */ 3351 - INIT_DELAYED_WORK(&ioc->fault_reset_work, _base_fault_reset_work); 3352 - snprintf(ioc->fault_reset_work_q_name, 3353 - sizeof(ioc->fault_reset_work_q_name), "poll_%d_status", ioc->id); 3354 - ioc->fault_reset_work_q = 3355 - create_singlethread_workqueue(ioc->fault_reset_work_q_name); 3356 - if (!ioc->fault_reset_work_q) { 3357 - printk(MPT2SAS_ERR_FMT "%s: failed (line=%d)\n", 3358 - ioc->name, __func__, __LINE__); 3359 - goto out_free_resources; 3360 - } 3361 - spin_lock_irqsave(&ioc->ioc_reset_in_progress_lock, flags); 3362 - if (ioc->fault_reset_work_q) 3363 - queue_delayed_work(ioc->fault_reset_work_q, 3364 - &ioc->fault_reset_work, 3365 - msecs_to_jiffies(FAULT_POLLING_INTERVAL)); 3366 - spin_unlock_irqrestore(&ioc->ioc_reset_in_progress_lock, flags); 3291 + mpt2sas_base_start_watchdog(ioc); 3367 3292 return 0; 3368 3293 3369 3294 out_free_resources: ··· 3355 3312 ioc->remove_host = 1; 3356 3313 mpt2sas_base_free_resources(ioc); 3357 3314 _base_release_memory_pools(ioc); 3315 + pci_set_drvdata(ioc->pdev, NULL); 3358 3316 kfree(ioc->tm_cmds.reply); 3359 3317 kfree(ioc->transport_cmds.reply); 3360 3318 kfree(ioc->config_cmds.reply); ··· 3381 3337 void 3382 3338 mpt2sas_base_detach(struct MPT2SAS_ADAPTER *ioc) 3383 3339 { 3384 - unsigned long flags; 3385 - struct workqueue_struct *wq; 3386 3340 3387 3341 dexitprintk(ioc, printk(MPT2SAS_DEBUG_FMT "%s\n", ioc->name, 3388 3342 __func__)); 3389 3343 3390 - spin_lock_irqsave(&ioc->ioc_reset_in_progress_lock, flags); 3391 - wq = ioc->fault_reset_work_q; 3392 - ioc->fault_reset_work_q = NULL; 3393 - spin_unlock_irqrestore(&ioc->ioc_reset_in_progress_lock, flags); 3394 - if (!cancel_delayed_work(&ioc->fault_reset_work)) 3395 - flush_workqueue(wq); 3396 - destroy_workqueue(wq); 3397 - 3344 + mpt2sas_base_stop_watchdog(ioc); 3398 3345 mpt2sas_base_free_resources(ioc); 3399 3346 _base_release_memory_pools(ioc); 3347 + pci_set_drvdata(ioc->pdev, NULL); 3400 3348 kfree(ioc->pfacts); 3401 3349 kfree(ioc->ctl_cmds.reply); 3402 3350 kfree(ioc->base_cmds.reply);
+4 -2
drivers/scsi/mpt2sas/mpt2sas_base.h
··· 69 69 #define MPT2SAS_DRIVER_NAME "mpt2sas" 70 70 #define MPT2SAS_AUTHOR "LSI Corporation <DL-MPTFusionLinux@lsi.com>" 71 71 #define MPT2SAS_DESCRIPTION "LSI MPT Fusion SAS 2.0 Device Driver" 72 - #define MPT2SAS_DRIVER_VERSION "01.100.03.00" 72 + #define MPT2SAS_DRIVER_VERSION "01.100.04.00" 73 73 #define MPT2SAS_MAJOR_VERSION 01 74 74 #define MPT2SAS_MINOR_VERSION 100 75 - #define MPT2SAS_BUILD_VERSION 03 75 + #define MPT2SAS_BUILD_VERSION 04 76 76 #define MPT2SAS_RELEASE_VERSION 00 77 77 78 78 /* ··· 673 673 674 674 /* base shared API */ 675 675 extern struct list_head mpt2sas_ioc_list; 676 + void mpt2sas_base_start_watchdog(struct MPT2SAS_ADAPTER *ioc); 677 + void mpt2sas_base_stop_watchdog(struct MPT2SAS_ADAPTER *ioc); 676 678 677 679 int mpt2sas_base_attach(struct MPT2SAS_ADAPTER *ioc); 678 680 void mpt2sas_base_detach(struct MPT2SAS_ADAPTER *ioc);
+26 -65
drivers/scsi/mpt2sas/mpt2sas_config.c
··· 236 236 Mpi2ConfigRequest_t *config_request; 237 237 int r; 238 238 u8 retry_count; 239 - u8 issue_reset; 239 + u8 issue_host_reset = 0; 240 240 u16 wait_state_count; 241 241 242 + mutex_lock(&ioc->config_cmds.mutex); 242 243 if (ioc->config_cmds.status != MPT2_CMD_NOT_USED) { 243 244 printk(MPT2SAS_ERR_FMT "%s: config_cmd in use\n", 244 245 ioc->name, __func__); 246 + mutex_unlock(&ioc->config_cmds.mutex); 245 247 return -EAGAIN; 246 248 } 247 249 retry_count = 0; 248 250 249 251 retry_config: 252 + if (retry_count) { 253 + if (retry_count > 2) /* attempt only 2 retries */ 254 + return -EFAULT; 255 + printk(MPT2SAS_INFO_FMT "%s: attempting retry (%d)\n", 256 + ioc->name, __func__, retry_count); 257 + } 250 258 wait_state_count = 0; 251 259 ioc_state = mpt2sas_base_get_iocstate(ioc, 1); 252 260 while (ioc_state != MPI2_IOC_STATE_OPERATIONAL) { ··· 262 254 printk(MPT2SAS_ERR_FMT 263 255 "%s: failed due to ioc not operational\n", 264 256 ioc->name, __func__); 265 - ioc->config_cmds.status = MPT2_CMD_NOT_USED; 266 - return -EFAULT; 257 + r = -EFAULT; 258 + goto out; 267 259 } 268 260 ssleep(1); 269 261 ioc_state = mpt2sas_base_get_iocstate(ioc, 1); ··· 279 271 if (!smid) { 280 272 printk(MPT2SAS_ERR_FMT "%s: failed obtaining a smid\n", 281 273 ioc->name, __func__); 282 - ioc->config_cmds.status = MPT2_CMD_NOT_USED; 283 - return -EAGAIN; 274 + r = -EAGAIN; 275 + goto out; 284 276 } 285 277 286 278 r = 0; ··· 300 292 ioc->name, __func__); 301 293 _debug_dump_mf(mpi_request, 302 294 sizeof(Mpi2ConfigRequest_t)/4); 303 - if (!(ioc->config_cmds.status & MPT2_CMD_RESET)) 304 - issue_reset = 1; 305 - goto issue_host_reset; 295 + retry_count++; 296 + if (ioc->config_cmds.smid == smid) 297 + mpt2sas_base_free_smid(ioc, smid); 298 + if ((ioc->shost_recovery) || 299 + (ioc->config_cmds.status & MPT2_CMD_RESET)) 300 + goto retry_config; 301 + issue_host_reset = 1; 302 + r = -EFAULT; 303 + goto out; 306 304 } 307 305 if (ioc->config_cmds.status & MPT2_CMD_REPLY_VALID) 308 306 memcpy(mpi_reply, ioc->config_cmds.reply, ··· 316 302 if (retry_count) 317 303 printk(MPT2SAS_INFO_FMT "%s: retry completed!!\n", 318 304 ioc->name, __func__); 305 + out: 319 306 ioc->config_cmds.status = MPT2_CMD_NOT_USED; 320 - return r; 321 - 322 - issue_host_reset: 323 - if (issue_reset) 307 + mutex_unlock(&ioc->config_cmds.mutex); 308 + if (issue_host_reset) 324 309 mpt2sas_base_hard_reset_handler(ioc, CAN_SLEEP, 325 310 FORCE_BIG_HAMMER); 326 - ioc->config_cmds.status = MPT2_CMD_NOT_USED; 327 - if (!retry_count) { 328 - printk(MPT2SAS_INFO_FMT "%s: attempting retry\n", 329 - ioc->name, __func__); 330 - retry_count++; 331 - goto retry_config; 332 - } 333 - return -EFAULT; 311 + return r; 334 312 } 335 313 336 314 /** ··· 381 375 int r; 382 376 struct config_request mem; 383 377 384 - mutex_lock(&ioc->config_cmds.mutex); 385 378 memset(config_page, 0, sizeof(Mpi2ManufacturingPage0_t)); 386 379 memset(&mpi_request, 0, sizeof(Mpi2ConfigRequest_t)); 387 380 mpi_request.Function = MPI2_FUNCTION_CONFIG; ··· 422 417 _config_free_config_dma_memory(ioc, &mem); 423 418 424 419 out: 425 - mutex_unlock(&ioc->config_cmds.mutex); 426 420 return r; 427 421 } 428 422 ··· 442 438 int r; 443 439 struct config_request mem; 444 440 445 - mutex_lock(&ioc->config_cmds.mutex); 446 441 memset(config_page, 0, sizeof(Mpi2BiosPage2_t)); 447 442 memset(&mpi_request, 0, sizeof(Mpi2ConfigRequest_t)); 448 443 mpi_request.Function = MPI2_FUNCTION_CONFIG; ··· 483 480 _config_free_config_dma_memory(ioc, &mem); 484 481 485 482 out: 486 - mutex_unlock(&ioc->config_cmds.mutex); 487 483 return r; 488 484 } 489 485 ··· 503 501 int r; 504 502 struct config_request mem; 505 503 506 - mutex_lock(&ioc->config_cmds.mutex); 507 504 memset(config_page, 0, sizeof(Mpi2BiosPage3_t)); 508 505 memset(&mpi_request, 0, sizeof(Mpi2ConfigRequest_t)); 509 506 mpi_request.Function = MPI2_FUNCTION_CONFIG; ··· 544 543 _config_free_config_dma_memory(ioc, &mem); 545 544 546 545 out: 547 - mutex_unlock(&ioc->config_cmds.mutex); 548 546 return r; 549 547 } 550 548 ··· 564 564 int r; 565 565 struct config_request mem; 566 566 567 - mutex_lock(&ioc->config_cmds.mutex); 568 567 memset(config_page, 0, sizeof(Mpi2IOUnitPage0_t)); 569 568 memset(&mpi_request, 0, sizeof(Mpi2ConfigRequest_t)); 570 569 mpi_request.Function = MPI2_FUNCTION_CONFIG; ··· 605 606 _config_free_config_dma_memory(ioc, &mem); 606 607 607 608 out: 608 - mutex_unlock(&ioc->config_cmds.mutex); 609 609 return r; 610 610 } 611 611 ··· 625 627 int r; 626 628 struct config_request mem; 627 629 628 - mutex_lock(&ioc->config_cmds.mutex); 629 630 memset(config_page, 0, sizeof(Mpi2IOUnitPage1_t)); 630 631 memset(&mpi_request, 0, sizeof(Mpi2ConfigRequest_t)); 631 632 mpi_request.Function = MPI2_FUNCTION_CONFIG; ··· 666 669 _config_free_config_dma_memory(ioc, &mem); 667 670 668 671 out: 669 - mutex_unlock(&ioc->config_cmds.mutex); 670 672 return r; 671 673 } 672 674 ··· 686 690 int r; 687 691 struct config_request mem; 688 692 689 - mutex_lock(&ioc->config_cmds.mutex); 690 693 memset(&mpi_request, 0, sizeof(Mpi2ConfigRequest_t)); 691 694 mpi_request.Function = MPI2_FUNCTION_CONFIG; 692 695 mpi_request.Action = MPI2_CONFIG_ACTION_PAGE_HEADER; ··· 727 732 _config_free_config_dma_memory(ioc, &mem); 728 733 729 734 out: 730 - mutex_unlock(&ioc->config_cmds.mutex); 731 735 return r; 732 736 } 733 737 ··· 747 753 int r; 748 754 struct config_request mem; 749 755 750 - mutex_lock(&ioc->config_cmds.mutex); 751 756 memset(config_page, 0, sizeof(Mpi2IOCPage8_t)); 752 757 memset(&mpi_request, 0, sizeof(Mpi2ConfigRequest_t)); 753 758 mpi_request.Function = MPI2_FUNCTION_CONFIG; ··· 788 795 _config_free_config_dma_memory(ioc, &mem); 789 796 790 797 out: 791 - mutex_unlock(&ioc->config_cmds.mutex); 792 798 return r; 793 799 } 794 800 ··· 810 818 int r; 811 819 struct config_request mem; 812 820 813 - mutex_lock(&ioc->config_cmds.mutex); 814 821 memset(config_page, 0, sizeof(Mpi2SasDevicePage0_t)); 815 822 memset(&mpi_request, 0, sizeof(Mpi2ConfigRequest_t)); 816 823 mpi_request.Function = MPI2_FUNCTION_CONFIG; ··· 854 863 _config_free_config_dma_memory(ioc, &mem); 855 864 856 865 out: 857 - mutex_unlock(&ioc->config_cmds.mutex); 858 866 return r; 859 867 } 860 868 ··· 876 886 int r; 877 887 struct config_request mem; 878 888 879 - mutex_lock(&ioc->config_cmds.mutex); 880 889 memset(config_page, 0, sizeof(Mpi2SasDevicePage1_t)); 881 890 memset(&mpi_request, 0, sizeof(Mpi2ConfigRequest_t)); 882 891 mpi_request.Function = MPI2_FUNCTION_CONFIG; ··· 920 931 _config_free_config_dma_memory(ioc, &mem); 921 932 922 933 out: 923 - mutex_unlock(&ioc->config_cmds.mutex); 924 934 return r; 925 935 } 926 936 ··· 941 953 Mpi2ConfigReply_t mpi_reply; 942 954 Mpi2SasIOUnitPage0_t config_page; 943 955 944 - mutex_lock(&ioc->config_cmds.mutex); 945 956 memset(&mpi_request, 0, sizeof(Mpi2ConfigRequest_t)); 946 957 mpi_request.Function = MPI2_FUNCTION_CONFIG; 947 958 mpi_request.Action = MPI2_CONFIG_ACTION_PAGE_HEADER; ··· 989 1002 _config_free_config_dma_memory(ioc, &mem); 990 1003 991 1004 out: 992 - mutex_unlock(&ioc->config_cmds.mutex); 993 1005 return r; 994 1006 } 995 1007 ··· 1012 1026 Mpi2ConfigRequest_t mpi_request; 1013 1027 int r; 1014 1028 struct config_request mem; 1015 - 1016 - mutex_lock(&ioc->config_cmds.mutex); 1017 1029 memset(config_page, 0, sz); 1018 1030 memset(&mpi_request, 0, sizeof(Mpi2ConfigRequest_t)); 1019 1031 mpi_request.Function = MPI2_FUNCTION_CONFIG; ··· 1054 1070 _config_free_config_dma_memory(ioc, &mem); 1055 1071 1056 1072 out: 1057 - mutex_unlock(&ioc->config_cmds.mutex); 1058 1073 return r; 1059 1074 } 1060 1075 ··· 1078 1095 int r; 1079 1096 struct config_request mem; 1080 1097 1081 - mutex_lock(&ioc->config_cmds.mutex); 1082 1098 memset(config_page, 0, sz); 1083 1099 memset(&mpi_request, 0, sizeof(Mpi2ConfigRequest_t)); 1084 1100 mpi_request.Function = MPI2_FUNCTION_CONFIG; ··· 1120 1138 _config_free_config_dma_memory(ioc, &mem); 1121 1139 1122 1140 out: 1123 - mutex_unlock(&ioc->config_cmds.mutex); 1124 1141 return r; 1125 1142 } 1126 1143 ··· 1142 1161 int r; 1143 1162 struct config_request mem; 1144 1163 1145 - mutex_lock(&ioc->config_cmds.mutex); 1146 1164 memset(config_page, 0, sizeof(Mpi2ExpanderPage0_t)); 1147 1165 memset(&mpi_request, 0, sizeof(Mpi2ConfigRequest_t)); 1148 1166 mpi_request.Function = MPI2_FUNCTION_CONFIG; ··· 1186 1206 _config_free_config_dma_memory(ioc, &mem); 1187 1207 1188 1208 out: 1189 - mutex_unlock(&ioc->config_cmds.mutex); 1190 1209 return r; 1191 1210 } 1192 1211 ··· 1209 1230 int r; 1210 1231 struct config_request mem; 1211 1232 1212 - mutex_lock(&ioc->config_cmds.mutex); 1213 1233 memset(config_page, 0, sizeof(Mpi2ExpanderPage1_t)); 1214 1234 memset(&mpi_request, 0, sizeof(Mpi2ConfigRequest_t)); 1215 1235 mpi_request.Function = MPI2_FUNCTION_CONFIG; ··· 1255 1277 _config_free_config_dma_memory(ioc, &mem); 1256 1278 1257 1279 out: 1258 - mutex_unlock(&ioc->config_cmds.mutex); 1259 1280 return r; 1260 1281 } 1261 1282 ··· 1277 1300 int r; 1278 1301 struct config_request mem; 1279 1302 1280 - mutex_lock(&ioc->config_cmds.mutex); 1281 1303 memset(config_page, 0, sizeof(Mpi2SasEnclosurePage0_t)); 1282 1304 memset(&mpi_request, 0, sizeof(Mpi2ConfigRequest_t)); 1283 1305 mpi_request.Function = MPI2_FUNCTION_CONFIG; ··· 1321 1345 _config_free_config_dma_memory(ioc, &mem); 1322 1346 1323 1347 out: 1324 - mutex_unlock(&ioc->config_cmds.mutex); 1325 1348 return r; 1326 1349 } 1327 1350 ··· 1342 1367 int r; 1343 1368 struct config_request mem; 1344 1369 1345 - mutex_lock(&ioc->config_cmds.mutex); 1346 1370 memset(config_page, 0, sizeof(Mpi2SasPhyPage0_t)); 1347 1371 memset(&mpi_request, 0, sizeof(Mpi2ConfigRequest_t)); 1348 1372 mpi_request.Function = MPI2_FUNCTION_CONFIG; ··· 1387 1413 _config_free_config_dma_memory(ioc, &mem); 1388 1414 1389 1415 out: 1390 - mutex_unlock(&ioc->config_cmds.mutex); 1391 1416 return r; 1392 1417 } 1393 1418 ··· 1408 1435 int r; 1409 1436 struct config_request mem; 1410 1437 1411 - mutex_lock(&ioc->config_cmds.mutex); 1412 1438 memset(config_page, 0, sizeof(Mpi2SasPhyPage1_t)); 1413 1439 memset(&mpi_request, 0, sizeof(Mpi2ConfigRequest_t)); 1414 1440 mpi_request.Function = MPI2_FUNCTION_CONFIG; ··· 1453 1481 _config_free_config_dma_memory(ioc, &mem); 1454 1482 1455 1483 out: 1456 - mutex_unlock(&ioc->config_cmds.mutex); 1457 1484 return r; 1458 1485 } 1459 1486 ··· 1476 1505 int r; 1477 1506 struct config_request mem; 1478 1507 1479 - mutex_lock(&ioc->config_cmds.mutex); 1480 1508 memset(config_page, 0, sizeof(Mpi2RaidVolPage1_t)); 1481 1509 memset(&mpi_request, 0, sizeof(Mpi2ConfigRequest_t)); 1482 1510 mpi_request.Function = MPI2_FUNCTION_CONFIG; ··· 1518 1548 _config_free_config_dma_memory(ioc, &mem); 1519 1549 1520 1550 out: 1521 - mutex_unlock(&ioc->config_cmds.mutex); 1522 1551 return r; 1523 1552 } 1524 1553 ··· 1541 1572 struct config_request mem; 1542 1573 u16 ioc_status; 1543 1574 1544 - mutex_lock(&ioc->config_cmds.mutex); 1545 1575 memset(&mpi_request, 0, sizeof(Mpi2ConfigRequest_t)); 1546 1576 *num_pds = 0; 1547 1577 mpi_request.Function = MPI2_FUNCTION_CONFIG; ··· 1588 1620 _config_free_config_dma_memory(ioc, &mem); 1589 1621 1590 1622 out: 1591 - mutex_unlock(&ioc->config_cmds.mutex); 1592 1623 return r; 1593 1624 } 1594 1625 ··· 1612 1645 int r; 1613 1646 struct config_request mem; 1614 1647 1615 - mutex_lock(&ioc->config_cmds.mutex); 1616 1648 memset(&mpi_request, 0, sizeof(Mpi2ConfigRequest_t)); 1617 1649 memset(config_page, 0, sz); 1618 1650 mpi_request.Function = MPI2_FUNCTION_CONFIG; ··· 1653 1687 _config_free_config_dma_memory(ioc, &mem); 1654 1688 1655 1689 out: 1656 - mutex_unlock(&ioc->config_cmds.mutex); 1657 1690 return r; 1658 1691 } 1659 1692 ··· 1676 1711 int r; 1677 1712 struct config_request mem; 1678 1713 1679 - mutex_lock(&ioc->config_cmds.mutex); 1680 1714 memset(&mpi_request, 0, sizeof(Mpi2ConfigRequest_t)); 1681 1715 memset(config_page, 0, sizeof(Mpi2RaidPhysDiskPage0_t)); 1682 1716 mpi_request.Function = MPI2_FUNCTION_CONFIG; ··· 1718 1754 _config_free_config_dma_memory(ioc, &mem); 1719 1755 1720 1756 out: 1721 - mutex_unlock(&ioc->config_cmds.mutex); 1722 1757 return r; 1723 1758 } 1724 1759 ··· 1741 1778 struct config_request mem; 1742 1779 u16 ioc_status; 1743 1780 1744 - mutex_lock(&ioc->config_cmds.mutex); 1745 1781 *volume_handle = 0; 1746 1782 memset(&mpi_request, 0, sizeof(Mpi2ConfigRequest_t)); 1747 1783 mpi_request.Function = MPI2_FUNCTION_CONFIG; ··· 1804 1842 _config_free_config_dma_memory(ioc, &mem); 1805 1843 1806 1844 out: 1807 - mutex_unlock(&ioc->config_cmds.mutex); 1808 1845 return r; 1809 1846 } 1810 1847
+88 -36
drivers/scsi/mpt2sas/mpt2sas_scsih.c
··· 2767 2767 char *desc_ioc_state = NULL; 2768 2768 char *desc_scsi_status = NULL; 2769 2769 char *desc_scsi_state = ioc->tmp_string; 2770 + u32 log_info = le32_to_cpu(mpi_reply->IOCLogInfo); 2771 + 2772 + if (log_info == 0x31170000) 2773 + return; 2770 2774 2771 2775 switch (ioc_status) { 2772 2776 case MPI2_IOCSTATUS_SUCCESS: ··· 3430 3426 __le64 sas_address; 3431 3427 int i; 3432 3428 unsigned long flags; 3433 - struct _sas_port *mpt2sas_port; 3429 + struct _sas_port *mpt2sas_port = NULL; 3434 3430 int rc = 0; 3435 3431 3436 3432 if (!handle) ··· 3522 3518 &expander_pg1, i, handle))) { 3523 3519 printk(MPT2SAS_ERR_FMT "failure at %s:%d/%s()!\n", 3524 3520 ioc->name, __FILE__, __LINE__, __func__); 3525 - continue; 3521 + rc = -1; 3522 + goto out_fail; 3526 3523 } 3527 3524 sas_expander->phy[i].handle = handle; 3528 3525 sas_expander->phy[i].phy_id = i; 3529 - mpt2sas_transport_add_expander_phy(ioc, &sas_expander->phy[i], 3530 - expander_pg1, sas_expander->parent_dev); 3526 + 3527 + if ((mpt2sas_transport_add_expander_phy(ioc, 3528 + &sas_expander->phy[i], expander_pg1, 3529 + sas_expander->parent_dev))) { 3530 + printk(MPT2SAS_ERR_FMT "failure at %s:%d/%s()!\n", 3531 + ioc->name, __FILE__, __LINE__, __func__); 3532 + rc = -1; 3533 + goto out_fail; 3534 + } 3531 3535 } 3532 3536 3533 3537 if (sas_expander->enclosure_handle) { ··· 3552 3540 3553 3541 out_fail: 3554 3542 3555 - if (sas_expander) 3556 - kfree(sas_expander->phy); 3543 + if (mpt2sas_port) 3544 + mpt2sas_transport_port_remove(ioc, sas_expander->sas_address, 3545 + sas_expander->parent_handle); 3557 3546 kfree(sas_expander); 3558 3547 return rc; 3559 3548 } ··· 3676 3663 sas_device->hidden_raid_component = is_pd; 3677 3664 3678 3665 /* get enclosure_logical_id */ 3679 - if (!(mpt2sas_config_get_enclosure_pg0(ioc, &mpi_reply, &enclosure_pg0, 3680 - MPI2_SAS_ENCLOS_PGAD_FORM_HANDLE, 3681 - sas_device->enclosure_handle))) { 3666 + if (sas_device->enclosure_handle && !(mpt2sas_config_get_enclosure_pg0( 3667 + ioc, &mpi_reply, &enclosure_pg0, MPI2_SAS_ENCLOS_PGAD_FORM_HANDLE, 3668 + sas_device->enclosure_handle))) 3682 3669 sas_device->enclosure_logical_id = 3683 3670 le64_to_cpu(enclosure_pg0.EnclosureLogicalID); 3684 - } 3685 3671 3686 3672 /* get device name */ 3687 3673 sas_device->device_name = le64_to_cpu(sas_device_pg0.DeviceName); ··· 4262 4250 u16 handle = le16_to_cpu(element->VolDevHandle); 4263 4251 int rc; 4264 4252 4265 - #if 0 /* RAID_HACKS */ 4266 - if (le32_to_cpu(event_data->Flags) & 4267 - MPI2_EVENT_IR_CHANGE_FLAGS_FOREIGN_CONFIG) 4268 - return; 4269 - #endif 4270 - 4271 4253 mpt2sas_config_get_volume_wwid(ioc, handle, &wwid); 4272 4254 if (!wwid) { 4273 4255 printk(MPT2SAS_ERR_FMT ··· 4315 4309 u16 handle = le16_to_cpu(element->VolDevHandle); 4316 4310 unsigned long flags; 4317 4311 struct MPT2SAS_TARGET *sas_target_priv_data; 4318 - 4319 - #if 0 /* RAID_HACKS */ 4320 - if (le32_to_cpu(event_data->Flags) & 4321 - MPI2_EVENT_IR_CHANGE_FLAGS_FOREIGN_CONFIG) 4322 - return; 4323 - #endif 4324 4312 4325 4313 spin_lock_irqsave(&ioc->raid_device_lock, flags); 4326 4314 raid_device = _scsih_raid_device_find_by_handle(ioc, handle); ··· 4428 4428 struct _sas_device *sas_device; 4429 4429 unsigned long flags; 4430 4430 u16 handle = le16_to_cpu(element->PhysDiskDevHandle); 4431 + Mpi2ConfigReply_t mpi_reply; 4432 + Mpi2SasDevicePage0_t sas_device_pg0; 4433 + u32 ioc_status; 4431 4434 4432 4435 spin_lock_irqsave(&ioc->sas_device_lock, flags); 4433 4436 sas_device = _scsih_sas_device_find_by_handle(ioc, handle); 4434 4437 spin_unlock_irqrestore(&ioc->sas_device_lock, flags); 4435 - if (sas_device) 4438 + if (sas_device) { 4436 4439 sas_device->hidden_raid_component = 1; 4437 - else 4438 - _scsih_add_device(ioc, handle, 0, 1); 4440 + return; 4441 + } 4442 + 4443 + if ((mpt2sas_config_get_sas_device_pg0(ioc, &mpi_reply, &sas_device_pg0, 4444 + MPI2_SAS_DEVICE_PGAD_FORM_HANDLE, handle))) { 4445 + printk(MPT2SAS_ERR_FMT "failure at %s:%d/%s()!\n", 4446 + ioc->name, __FILE__, __LINE__, __func__); 4447 + return; 4448 + } 4449 + 4450 + ioc_status = le16_to_cpu(mpi_reply.IOCStatus) & 4451 + MPI2_IOCSTATUS_MASK; 4452 + if (ioc_status != MPI2_IOCSTATUS_SUCCESS) { 4453 + printk(MPT2SAS_ERR_FMT "failure at %s:%d/%s()!\n", 4454 + ioc->name, __FILE__, __LINE__, __func__); 4455 + return; 4456 + } 4457 + 4458 + _scsih_link_change(ioc, 4459 + le16_to_cpu(sas_device_pg0.ParentDevHandle), 4460 + handle, sas_device_pg0.PhyNum, MPI2_SAS_NEG_LINK_RATE_1_5); 4461 + 4462 + _scsih_add_device(ioc, handle, 0, 1); 4439 4463 } 4440 4464 4441 4465 #ifdef CONFIG_SCSI_MPT2SAS_LOGGING ··· 4559 4535 { 4560 4536 Mpi2EventIrConfigElement_t *element; 4561 4537 int i; 4538 + u8 foreign_config; 4562 4539 4563 4540 #ifdef CONFIG_SCSI_MPT2SAS_LOGGING 4564 4541 if (ioc->logging_level & MPT_DEBUG_EVENT_WORK_TASK) 4565 4542 _scsih_sas_ir_config_change_event_debug(ioc, event_data); 4566 4543 4567 4544 #endif 4545 + foreign_config = (le32_to_cpu(event_data->Flags) & 4546 + MPI2_EVENT_IR_CHANGE_FLAGS_FOREIGN_CONFIG) ? 1 : 0; 4568 4547 4569 4548 element = (Mpi2EventIrConfigElement_t *)&event_data->ConfigElement[0]; 4570 4549 for (i = 0; i < event_data->NumElements; i++, element++) { ··· 4575 4548 switch (element->ReasonCode) { 4576 4549 case MPI2_EVENT_IR_CHANGE_RC_VOLUME_CREATED: 4577 4550 case MPI2_EVENT_IR_CHANGE_RC_ADDED: 4578 - _scsih_sas_volume_add(ioc, element); 4551 + if (!foreign_config) 4552 + _scsih_sas_volume_add(ioc, element); 4579 4553 break; 4580 4554 case MPI2_EVENT_IR_CHANGE_RC_VOLUME_DELETED: 4581 4555 case MPI2_EVENT_IR_CHANGE_RC_REMOVED: 4582 - _scsih_sas_volume_delete(ioc, element); 4556 + if (!foreign_config) 4557 + _scsih_sas_volume_delete(ioc, element); 4583 4558 break; 4584 4559 case MPI2_EVENT_IR_CHANGE_RC_PD_CREATED: 4585 4560 _scsih_sas_pd_hide(ioc, element); ··· 4700 4671 u32 state; 4701 4672 struct _sas_device *sas_device; 4702 4673 unsigned long flags; 4674 + Mpi2ConfigReply_t mpi_reply; 4675 + Mpi2SasDevicePage0_t sas_device_pg0; 4676 + u32 ioc_status; 4703 4677 4704 4678 if (event_data->ReasonCode != MPI2_EVENT_IR_PHYSDISK_RC_STATE_CHANGED) 4705 4679 return; ··· 4719 4687 spin_unlock_irqrestore(&ioc->sas_device_lock, flags); 4720 4688 4721 4689 switch (state) { 4722 - #if 0 4723 - case MPI2_RAID_PD_STATE_OFFLINE: 4724 - if (sas_device) 4725 - _scsih_remove_device(ioc, handle); 4726 - break; 4727 - #endif 4728 4690 case MPI2_RAID_PD_STATE_ONLINE: 4729 4691 case MPI2_RAID_PD_STATE_DEGRADED: 4730 4692 case MPI2_RAID_PD_STATE_REBUILDING: 4731 4693 case MPI2_RAID_PD_STATE_OPTIMAL: 4732 - if (sas_device) 4694 + if (sas_device) { 4733 4695 sas_device->hidden_raid_component = 1; 4734 - else 4735 - _scsih_add_device(ioc, handle, 0, 1); 4696 + return; 4697 + } 4698 + 4699 + if ((mpt2sas_config_get_sas_device_pg0(ioc, &mpi_reply, 4700 + &sas_device_pg0, MPI2_SAS_DEVICE_PGAD_FORM_HANDLE, 4701 + handle))) { 4702 + printk(MPT2SAS_ERR_FMT "failure at %s:%d/%s()!\n", 4703 + ioc->name, __FILE__, __LINE__, __func__); 4704 + return; 4705 + } 4706 + 4707 + ioc_status = le16_to_cpu(mpi_reply.IOCStatus) & 4708 + MPI2_IOCSTATUS_MASK; 4709 + if (ioc_status != MPI2_IOCSTATUS_SUCCESS) { 4710 + printk(MPT2SAS_ERR_FMT "failure at %s:%d/%s()!\n", 4711 + ioc->name, __FILE__, __LINE__, __func__); 4712 + return; 4713 + } 4714 + 4715 + _scsih_link_change(ioc, 4716 + le16_to_cpu(sas_device_pg0.ParentDevHandle), 4717 + handle, sas_device_pg0.PhyNum, MPI2_SAS_NEG_LINK_RATE_1_5); 4718 + 4719 + _scsih_add_device(ioc, handle, 0, 1); 4720 + 4736 4721 break; 4737 4722 4723 + case MPI2_RAID_PD_STATE_OFFLINE: 4738 4724 case MPI2_RAID_PD_STATE_NOT_CONFIGURED: 4739 4725 case MPI2_RAID_PD_STATE_NOT_COMPATIBLE: 4740 4726 case MPI2_RAID_PD_STATE_HOT_SPARE: ··· 5824 5774 struct MPT2SAS_ADAPTER *ioc = shost_priv(shost); 5825 5775 u32 device_state; 5826 5776 5777 + mpt2sas_base_stop_watchdog(ioc); 5827 5778 flush_scheduled_work(); 5828 5779 scsi_block_requests(shost); 5829 5780 device_state = pci_choose_state(pdev, state); ··· 5867 5816 5868 5817 mpt2sas_base_hard_reset_handler(ioc, CAN_SLEEP, SOFT_RESET); 5869 5818 scsi_unblock_requests(shost); 5819 + mpt2sas_base_start_watchdog(ioc); 5870 5820 return 0; 5871 5821 } 5872 5822 #endif /* CONFIG_PM */
+8 -1
drivers/thermal/thermal_sys.c
··· 953 953 954 954 mutex_lock(&tz->lock); 955 955 956 - tz->ops->get_temp(tz, &temp); 956 + if (tz->ops->get_temp(tz, &temp)) { 957 + /* get_temp failed - retry it later */ 958 + printk(KERN_WARNING PREFIX "failed to read out thermal zone " 959 + "%d\n", tz->id); 960 + goto leave; 961 + } 957 962 958 963 for (count = 0; count < tz->trips; count++) { 959 964 tz->ops->get_trip_type(tz, count, &trip_type); ··· 1010 1005 THERMAL_TRIPS_NONE); 1011 1006 1012 1007 tz->last_temperature = temp; 1008 + 1009 + leave: 1013 1010 if (tz->passive) 1014 1011 thermal_zone_device_set_polling(tz, tz->passive_delay); 1015 1012 else if (tz->polling_delay)
+4 -4
drivers/video/xen-fbfront.c
··· 454 454 455 455 xenfb_init_shared_page(info, fb_info); 456 456 457 + ret = xenfb_connect_backend(dev, info); 458 + if (ret < 0) 459 + goto error; 460 + 457 461 ret = register_framebuffer(fb_info); 458 462 if (ret) { 459 463 fb_deferred_io_cleanup(fb_info); ··· 467 463 goto error; 468 464 } 469 465 info->fb_info = fb_info; 470 - 471 - ret = xenfb_connect_backend(dev, info); 472 - if (ret < 0) 473 - goto error; 474 466 475 467 xenfb_make_preferred_console(); 476 468 return 0;
+1 -1
drivers/watchdog/ar7_wdt.c
··· 37 37 #include <linux/uaccess.h> 38 38 39 39 #include <asm/addrspace.h> 40 - #include <asm/ar7/ar7.h> 40 + #include <asm/mach-ar7/ar7.h> 41 41 42 42 #define DRVNAME "ar7_wdt" 43 43 #define LONGNAME "TI AR7 Watchdog Timer"
+5 -16
fs/9p/v9fs.c
··· 76 76 * Return 0 upon success, -ERRNO upon failure. 77 77 */ 78 78 79 - static int v9fs_parse_options(struct v9fs_session_info *v9ses) 79 + static int v9fs_parse_options(struct v9fs_session_info *v9ses, char *opts) 80 80 { 81 81 char *options; 82 82 substring_t args[MAX_OPT_ARGS]; ··· 90 90 v9ses->debug = 0; 91 91 v9ses->cache = 0; 92 92 93 - if (!v9ses->options) 93 + if (!opts) 94 94 return 0; 95 95 96 - options = kstrdup(v9ses->options, GFP_KERNEL); 96 + options = kstrdup(opts, GFP_KERNEL); 97 97 if (!options) { 98 98 P9_DPRINTK(P9_DEBUG_ERROR, 99 99 "failed to allocate copy of option string\n"); ··· 206 206 v9ses->uid = ~0; 207 207 v9ses->dfltuid = V9FS_DEFUID; 208 208 v9ses->dfltgid = V9FS_DEFGID; 209 - if (data) { 210 - v9ses->options = kstrdup(data, GFP_KERNEL); 211 - if (!v9ses->options) { 212 - P9_DPRINTK(P9_DEBUG_ERROR, 213 - "failed to allocate copy of option string\n"); 214 - retval = -ENOMEM; 215 - goto error; 216 - } 217 - } 218 209 219 - rc = v9fs_parse_options(v9ses); 210 + rc = v9fs_parse_options(v9ses, data); 220 211 if (rc < 0) { 221 212 retval = rc; 222 213 goto error; 223 214 } 224 215 225 - v9ses->clnt = p9_client_create(dev_name, v9ses->options); 226 - 216 + v9ses->clnt = p9_client_create(dev_name, data); 227 217 if (IS_ERR(v9ses->clnt)) { 228 218 retval = PTR_ERR(v9ses->clnt); 229 219 v9ses->clnt = NULL; ··· 270 280 271 281 __putname(v9ses->uname); 272 282 __putname(v9ses->aname); 273 - kfree(v9ses->options); 274 283 } 275 284 276 285 /**
-1
fs/9p/v9fs.h
··· 85 85 unsigned int afid; 86 86 unsigned int cache; 87 87 88 - char *options; /* copy of mount options */ 89 88 char *uname; /* user name to mount as */ 90 89 char *aname; /* name of remote hierarchy being mounted */ 91 90 unsigned int maxdata; /* max data for client interface */
+65 -61
fs/9p/vfs_inode.c
··· 171 171 172 172 /** 173 173 * v9fs_blank_wstat - helper function to setup a 9P stat structure 174 - * @v9ses: 9P session info (for determining extended mode) 175 174 * @wstat: structure to initialize 176 175 * 177 176 */ ··· 206 207 207 208 struct inode *v9fs_get_inode(struct super_block *sb, int mode) 208 209 { 210 + int err; 209 211 struct inode *inode; 210 212 struct v9fs_session_info *v9ses = sb->s_fs_info; 211 213 212 214 P9_DPRINTK(P9_DEBUG_VFS, "super block: %p mode: %o\n", sb, mode); 213 215 214 216 inode = new_inode(sb); 215 - if (inode) { 216 - inode->i_mode = mode; 217 - inode->i_uid = current_fsuid(); 218 - inode->i_gid = current_fsgid(); 219 - inode->i_blocks = 0; 220 - inode->i_rdev = 0; 221 - inode->i_atime = inode->i_mtime = inode->i_ctime = CURRENT_TIME; 222 - inode->i_mapping->a_ops = &v9fs_addr_operations; 223 - 224 - switch (mode & S_IFMT) { 225 - case S_IFIFO: 226 - case S_IFBLK: 227 - case S_IFCHR: 228 - case S_IFSOCK: 229 - if (!v9fs_extended(v9ses)) { 230 - P9_DPRINTK(P9_DEBUG_ERROR, 231 - "special files without extended mode\n"); 232 - return ERR_PTR(-EINVAL); 233 - } 234 - init_special_inode(inode, inode->i_mode, 235 - inode->i_rdev); 236 - break; 237 - case S_IFREG: 238 - inode->i_op = &v9fs_file_inode_operations; 239 - inode->i_fop = &v9fs_file_operations; 240 - break; 241 - case S_IFLNK: 242 - if (!v9fs_extended(v9ses)) { 243 - P9_DPRINTK(P9_DEBUG_ERROR, 244 - "extended modes used w/o 9P2000.u\n"); 245 - return ERR_PTR(-EINVAL); 246 - } 247 - inode->i_op = &v9fs_symlink_inode_operations; 248 - break; 249 - case S_IFDIR: 250 - inc_nlink(inode); 251 - if (v9fs_extended(v9ses)) 252 - inode->i_op = &v9fs_dir_inode_operations_ext; 253 - else 254 - inode->i_op = &v9fs_dir_inode_operations; 255 - inode->i_fop = &v9fs_dir_operations; 256 - break; 257 - default: 258 - P9_DPRINTK(P9_DEBUG_ERROR, 259 - "BAD mode 0x%x S_IFMT 0x%x\n", 260 - mode, mode & S_IFMT); 261 - return ERR_PTR(-EINVAL); 262 - } 263 - } else { 217 + if (!inode) { 264 218 P9_EPRINTK(KERN_WARNING, "Problem allocating inode\n"); 265 219 return ERR_PTR(-ENOMEM); 266 220 } 221 + 222 + inode->i_mode = mode; 223 + inode->i_uid = current_fsuid(); 224 + inode->i_gid = current_fsgid(); 225 + inode->i_blocks = 0; 226 + inode->i_rdev = 0; 227 + inode->i_atime = inode->i_mtime = inode->i_ctime = CURRENT_TIME; 228 + inode->i_mapping->a_ops = &v9fs_addr_operations; 229 + 230 + switch (mode & S_IFMT) { 231 + case S_IFIFO: 232 + case S_IFBLK: 233 + case S_IFCHR: 234 + case S_IFSOCK: 235 + if (!v9fs_extended(v9ses)) { 236 + P9_DPRINTK(P9_DEBUG_ERROR, 237 + "special files without extended mode\n"); 238 + err = -EINVAL; 239 + goto error; 240 + } 241 + init_special_inode(inode, inode->i_mode, inode->i_rdev); 242 + break; 243 + case S_IFREG: 244 + inode->i_op = &v9fs_file_inode_operations; 245 + inode->i_fop = &v9fs_file_operations; 246 + break; 247 + case S_IFLNK: 248 + if (!v9fs_extended(v9ses)) { 249 + P9_DPRINTK(P9_DEBUG_ERROR, 250 + "extended modes used w/o 9P2000.u\n"); 251 + err = -EINVAL; 252 + goto error; 253 + } 254 + inode->i_op = &v9fs_symlink_inode_operations; 255 + break; 256 + case S_IFDIR: 257 + inc_nlink(inode); 258 + if (v9fs_extended(v9ses)) 259 + inode->i_op = &v9fs_dir_inode_operations_ext; 260 + else 261 + inode->i_op = &v9fs_dir_inode_operations; 262 + inode->i_fop = &v9fs_dir_operations; 263 + break; 264 + default: 265 + P9_DPRINTK(P9_DEBUG_ERROR, "BAD mode 0x%x S_IFMT 0x%x\n", 266 + mode, mode & S_IFMT); 267 + err = -EINVAL; 268 + goto error; 269 + } 270 + 267 271 return inode; 272 + 273 + error: 274 + iput(inode); 275 + return ERR_PTR(err); 268 276 } 269 277 270 278 /* ··· 344 338 345 339 ret = NULL; 346 340 st = p9_client_stat(fid); 347 - if (IS_ERR(st)) { 348 - err = PTR_ERR(st); 349 - st = NULL; 350 - goto error; 351 - } 341 + if (IS_ERR(st)) 342 + return ERR_CAST(st); 352 343 353 344 umode = p9mode2unixmode(v9ses, st->mode); 354 345 ret = v9fs_get_inode(sb, umode); 355 346 if (IS_ERR(ret)) { 356 347 err = PTR_ERR(ret); 357 - ret = NULL; 358 348 goto error; 359 349 } 360 350 361 351 v9fs_stat2inode(st, ret, sb); 362 352 ret->i_ino = v9fs_qid2ino(&st->qid); 353 + p9stat_free(st); 363 354 kfree(st); 364 355 return ret; 365 356 366 357 error: 358 + p9stat_free(st); 367 359 kfree(st); 368 - if (ret) 369 - iput(ret); 370 - 371 360 return ERR_PTR(err); 372 361 } 373 362 ··· 404 403 * @v9ses: session information 405 404 * @dir: directory that dentry is being created in 406 405 * @dentry: dentry that is being created 406 + * @extension: 9p2000.u extension string to support devices, etc. 407 407 * @perm: create permissions 408 408 * @mode: open mode 409 - * @extension: 9p2000.u extension string to support devices, etc. 410 409 * 411 410 */ 412 411 static struct p9_fid * ··· 471 470 dentry->d_op = &v9fs_dentry_operations; 472 471 473 472 d_instantiate(dentry, inode); 474 - v9fs_fid_add(dentry, fid); 473 + err = v9fs_fid_add(dentry, fid); 474 + if (err < 0) 475 + goto error; 476 + 475 477 return ofid; 476 478 477 479 error:
+12 -27
fs/9p/vfs_super.c
··· 81 81 82 82 static void 83 83 v9fs_fill_super(struct super_block *sb, struct v9fs_session_info *v9ses, 84 - int flags) 84 + int flags, void *data) 85 85 { 86 86 sb->s_maxbytes = MAX_LFS_FILESIZE; 87 87 sb->s_blocksize_bits = fls(v9ses->maxdata - 1); ··· 91 91 92 92 sb->s_flags = flags | MS_ACTIVE | MS_SYNCHRONOUS | MS_DIRSYNC | 93 93 MS_NOATIME; 94 + 95 + save_mount_options(sb, data); 94 96 } 95 97 96 98 /** ··· 115 113 struct v9fs_session_info *v9ses = NULL; 116 114 struct p9_wstat *st = NULL; 117 115 int mode = S_IRWXUGO | S_ISVTX; 118 - uid_t uid = current_fsuid(); 119 - gid_t gid = current_fsgid(); 120 116 struct p9_fid *fid; 121 117 int retval = 0; 122 118 123 119 P9_DPRINTK(P9_DEBUG_VFS, " \n"); 124 120 125 - st = NULL; 126 121 v9ses = kzalloc(sizeof(struct v9fs_session_info), GFP_KERNEL); 127 122 if (!v9ses) 128 123 return -ENOMEM; ··· 141 142 retval = PTR_ERR(sb); 142 143 goto free_stat; 143 144 } 144 - v9fs_fill_super(sb, v9ses, flags); 145 + v9fs_fill_super(sb, v9ses, flags, data); 145 146 146 147 inode = v9fs_get_inode(sb, S_IFDIR | mode); 147 148 if (IS_ERR(inode)) { 148 149 retval = PTR_ERR(inode); 149 150 goto release_sb; 150 151 } 151 - 152 - inode->i_uid = uid; 153 - inode->i_gid = gid; 154 152 155 153 root = d_alloc_root(inode); 156 154 if (!root) { ··· 169 173 simple_set_mnt(mnt, sb); 170 174 return 0; 171 175 172 - release_sb: 173 - deactivate_locked_super(sb); 174 - 175 176 free_stat: 177 + p9stat_free(st); 176 178 kfree(st); 177 179 178 180 clunk_fid: ··· 179 185 close_session: 180 186 v9fs_session_close(v9ses); 181 187 kfree(v9ses); 188 + return retval; 182 189 190 + release_sb: 191 + p9stat_free(st); 192 + kfree(st); 193 + deactivate_locked_super(sb); 183 194 return retval; 184 195 } 185 196 ··· 206 207 207 208 v9fs_session_close(v9ses); 208 209 kfree(v9ses); 210 + s->s_fs_info = NULL; 209 211 P9_DPRINTK(P9_DEBUG_VFS, "exiting kill_super\n"); 210 - } 211 - 212 - /** 213 - * v9fs_show_options - Show mount options in /proc/mounts 214 - * @m: seq_file to write to 215 - * @mnt: mount descriptor 216 - * 217 - */ 218 - 219 - static int v9fs_show_options(struct seq_file *m, struct vfsmount *mnt) 220 - { 221 - struct v9fs_session_info *v9ses = mnt->mnt_sb->s_fs_info; 222 - 223 - seq_printf(m, "%s", v9ses->options); 224 - return 0; 225 212 } 226 213 227 214 static void ··· 222 237 static const struct super_operations v9fs_super_ops = { 223 238 .statfs = simple_statfs, 224 239 .clear_inode = v9fs_clear_inode, 225 - .show_options = v9fs_show_options, 240 + .show_options = generic_show_options, 226 241 .umount_begin = v9fs_umount_begin, 227 242 }; 228 243
+15 -3
fs/afs/file.c
··· 134 134 135 135 inode = page->mapping->host; 136 136 137 - ASSERT(file != NULL); 138 - key = file->private_data; 139 - ASSERT(key != NULL); 137 + if (file) { 138 + key = file->private_data; 139 + ASSERT(key != NULL); 140 + } else { 141 + key = afs_request_key(AFS_FS_S(inode->i_sb)->volume->cell); 142 + if (IS_ERR(key)) { 143 + ret = PTR_ERR(key); 144 + goto error_nokey; 145 + } 146 + } 140 147 141 148 _enter("{%x},{%lu},{%lu}", key_serial(key), inode->i_ino, page->index); 142 149 ··· 214 207 unlock_page(page); 215 208 } 216 209 210 + if (!file) 211 + key_put(key); 217 212 _leave(" = 0"); 218 213 return 0; 219 214 220 215 error: 221 216 SetPageError(page); 222 217 unlock_page(page); 218 + if (!file) 219 + key_put(key); 220 + error_nokey: 223 221 _leave(" = %d", ret); 224 222 return ret; 225 223 }
+1 -1
fs/autofs4/expire.c
··· 77 77 } 78 78 79 79 /* Update the expiry counter if fs is busy */ 80 - if (!may_umount_tree(mnt)) { 80 + if (!may_umount_tree(path.mnt)) { 81 81 struct autofs_info *ino = autofs4_dentry_ino(top); 82 82 ino->last_used = jiffies; 83 83 goto done;
+14 -7
fs/btrfs/inode.c
··· 3099 3099 { 3100 3100 struct btrfs_root *root = BTRFS_I(inode)->root; 3101 3101 struct btrfs_inode *entry; 3102 - struct rb_node **p = &root->inode_tree.rb_node; 3103 - struct rb_node *parent = NULL; 3102 + struct rb_node **p; 3103 + struct rb_node *parent; 3104 + 3105 + again: 3106 + p = &root->inode_tree.rb_node; 3107 + parent = NULL; 3104 3108 3105 3109 spin_lock(&root->inode_lock); 3106 3110 while (*p) { ··· 3112 3108 entry = rb_entry(parent, struct btrfs_inode, rb_node); 3113 3109 3114 3110 if (inode->i_ino < entry->vfs_inode.i_ino) 3115 - p = &(*p)->rb_left; 3111 + p = &parent->rb_left; 3116 3112 else if (inode->i_ino > entry->vfs_inode.i_ino) 3117 - p = &(*p)->rb_right; 3113 + p = &parent->rb_right; 3118 3114 else { 3119 3115 WARN_ON(!(entry->vfs_inode.i_state & 3120 3116 (I_WILL_FREE | I_FREEING | I_CLEAR))); 3121 - break; 3117 + rb_erase(parent, &root->inode_tree); 3118 + RB_CLEAR_NODE(parent); 3119 + spin_unlock(&root->inode_lock); 3120 + goto again; 3122 3121 } 3123 3122 } 3124 3123 rb_link_node(&BTRFS_I(inode)->rb_node, parent, p); ··· 3133 3126 { 3134 3127 struct btrfs_root *root = BTRFS_I(inode)->root; 3135 3128 3129 + spin_lock(&root->inode_lock); 3136 3130 if (!RB_EMPTY_NODE(&BTRFS_I(inode)->rb_node)) { 3137 - spin_lock(&root->inode_lock); 3138 3131 rb_erase(&BTRFS_I(inode)->rb_node, &root->inode_tree); 3139 - spin_unlock(&root->inode_lock); 3140 3132 RB_CLEAR_NODE(&BTRFS_I(inode)->rb_node); 3141 3133 } 3134 + spin_unlock(&root->inode_lock); 3142 3135 } 3143 3136 3144 3137 static noinline void init_btrfs_i(struct inode *inode)
+5 -2
fs/buffer.c
··· 1165 1165 1166 1166 if (!test_set_buffer_dirty(bh)) { 1167 1167 struct page *page = bh->b_page; 1168 - if (!TestSetPageDirty(page)) 1169 - __set_page_dirty(page, page_mapping(page), 0); 1168 + if (!TestSetPageDirty(page)) { 1169 + struct address_space *mapping = page_mapping(page); 1170 + if (mapping) 1171 + __set_page_dirty(page, mapping, 0); 1172 + } 1170 1173 } 1171 1174 } 1172 1175
+2 -2
fs/exec.c
··· 678 678 } 679 679 EXPORT_SYMBOL(open_exec); 680 680 681 - int kernel_read(struct file *file, unsigned long offset, 682 - char *addr, unsigned long count) 681 + int kernel_read(struct file *file, loff_t offset, 682 + char *addr, unsigned long count) 683 683 { 684 684 mm_segment_t old_fs; 685 685 loff_t pos = offset;
+15 -13
fs/ext3/Kconfig
··· 29 29 module will be called ext3. 30 30 31 31 config EXT3_DEFAULTS_TO_ORDERED 32 - bool "Default to 'data=ordered' in ext3 (legacy option)" 32 + bool "Default to 'data=ordered' in ext3" 33 33 depends on EXT3_FS 34 34 help 35 - If a filesystem does not explicitly specify a data ordering 36 - mode, and the journal capability allowed it, ext3 used to 37 - historically default to 'data=ordered'. 35 + The journal mode options for ext3 have different tradeoffs 36 + between when data is guaranteed to be on disk and 37 + performance. The use of "data=writeback" can cause 38 + unwritten data to appear in files after an system crash or 39 + power failure, which can be a security issue. However, 40 + "data=ordered" mode can also result in major performance 41 + problems, including seconds-long delays before an fsync() 42 + call returns. For details, see: 38 43 39 - That was a rather unfortunate choice, because it leads to all 40 - kinds of latency problems, and the 'data=writeback' mode is more 41 - appropriate these days. 44 + http://ext4.wiki.kernel.org/index.php/Ext3_data_mode_tradeoffs 42 45 43 - You should probably always answer 'n' here, and if you really 44 - want to use 'data=ordered' mode, set it in the filesystem itself 45 - with 'tune2fs -o journal_data_ordered'. 46 - 47 - But if you really want to enable the legacy default, you can do 48 - so by answering 'y' to this question. 46 + If you have been historically happy with ext3's performance, 47 + data=ordered mode will be a safe choice and you should 48 + answer 'y' here. If you understand the reliability and data 49 + privacy issues of data=writeback and are willing to make 50 + that trade off, answer 'n'. 49 51 50 52 config EXT3_FS_XATTR 51 53 bool "Ext3 extended attributes"
+27 -13
fs/ext3/super.c
··· 543 543 #endif 544 544 } 545 545 546 + static char *data_mode_string(unsigned long mode) 547 + { 548 + switch (mode) { 549 + case EXT3_MOUNT_JOURNAL_DATA: 550 + return "journal"; 551 + case EXT3_MOUNT_ORDERED_DATA: 552 + return "ordered"; 553 + case EXT3_MOUNT_WRITEBACK_DATA: 554 + return "writeback"; 555 + } 556 + return "unknown"; 557 + } 558 + 546 559 /* 547 560 * Show an option if 548 561 * - it's set to a non-default value OR ··· 629 616 if (test_opt(sb, NOBH)) 630 617 seq_puts(seq, ",nobh"); 631 618 632 - if (test_opt(sb, DATA_FLAGS) == EXT3_MOUNT_JOURNAL_DATA) 633 - seq_puts(seq, ",data=journal"); 634 - else if (test_opt(sb, DATA_FLAGS) == EXT3_MOUNT_ORDERED_DATA) 635 - seq_puts(seq, ",data=ordered"); 636 - else if (test_opt(sb, DATA_FLAGS) == EXT3_MOUNT_WRITEBACK_DATA) 637 - seq_puts(seq, ",data=writeback"); 638 - 619 + seq_printf(seq, ",data=%s", data_mode_string(sbi->s_mount_opt & 620 + EXT3_MOUNT_DATA_FLAGS)); 639 621 if (test_opt(sb, DATA_ERR_ABORT)) 640 622 seq_puts(seq, ",data_err=abort"); 641 623 ··· 1032 1024 datacheck: 1033 1025 if (is_remount) { 1034 1026 if ((sbi->s_mount_opt & EXT3_MOUNT_DATA_FLAGS) 1035 - != data_opt) { 1036 - printk(KERN_ERR 1037 - "EXT3-fs: cannot change data " 1038 - "mode on remount\n"); 1039 - return 0; 1040 - } 1027 + == data_opt) 1028 + break; 1029 + printk(KERN_ERR 1030 + "EXT3-fs (device %s): Cannot change " 1031 + "data mode on remount. The filesystem " 1032 + "is mounted in data=%s mode and you " 1033 + "try to remount it in data=%s mode.\n", 1034 + sb->s_id, 1035 + data_mode_string(sbi->s_mount_opt & 1036 + EXT3_MOUNT_DATA_FLAGS), 1037 + data_mode_string(data_opt)); 1038 + return 0; 1041 1039 } else { 1042 1040 sbi->s_mount_opt &= ~EXT3_MOUNT_DATA_FLAGS; 1043 1041 sbi->s_mount_opt |= data_opt;
+12 -8
fs/hugetlbfs/inode.c
··· 935 935 return capable(CAP_IPC_LOCK) || in_group_p(sysctl_hugetlb_shm_group); 936 936 } 937 937 938 - struct file *hugetlb_file_setup(const char *name, size_t size, int acctflag) 938 + struct file *hugetlb_file_setup(const char *name, size_t size, int acctflag, 939 + struct user_struct **user) 939 940 { 940 941 int error = -ENOMEM; 941 - int unlock_shm = 0; 942 942 struct file *file; 943 943 struct inode *inode; 944 944 struct dentry *dentry, *root; 945 945 struct qstr quick_string; 946 - struct user_struct *user = current_user(); 947 946 947 + *user = NULL; 948 948 if (!hugetlbfs_vfsmount) 949 949 return ERR_PTR(-ENOENT); 950 950 951 951 if (!can_do_hugetlb_shm()) { 952 - if (user_shm_lock(size, user)) { 953 - unlock_shm = 1; 952 + *user = current_user(); 953 + if (user_shm_lock(size, *user)) { 954 954 WARN_ONCE(1, 955 955 "Using mlock ulimits for SHM_HUGETLB deprecated\n"); 956 - } else 956 + } else { 957 + *user = NULL; 957 958 return ERR_PTR(-EPERM); 959 + } 958 960 } 959 961 960 962 root = hugetlbfs_vfsmount->mnt_root; ··· 998 996 out_dentry: 999 997 dput(dentry); 1000 998 out_shm_unlock: 1001 - if (unlock_shm) 1002 - user_shm_unlock(size, user); 999 + if (*user) { 1000 + user_shm_unlock(size, *user); 1001 + *user = NULL; 1002 + } 1003 1003 return ERR_PTR(error); 1004 1004 } 1005 1005
+2 -2
fs/nfs/nfs4state.c
··· 1250 1250 continue; 1251 1251 } 1252 1252 /* Initialize or reset the session */ 1253 - if (nfs4_has_session(clp) && 1254 - test_and_clear_bit(NFS4CLNT_SESSION_SETUP, &clp->cl_state)) { 1253 + if (test_and_clear_bit(NFS4CLNT_SESSION_SETUP, &clp->cl_state) 1254 + && nfs4_has_session(clp)) { 1255 1255 if (clp->cl_cons_state == NFS_CS_SESSION_INITING) 1256 1256 status = nfs4_initialize_session(clp); 1257 1257 else
+31 -2
fs/notify/inotify/inotify_fsnotify.c
··· 105 105 return send; 106 106 } 107 107 108 + /* 109 + * This is NEVER supposed to be called. Inotify marks should either have been 110 + * removed from the idr when the watch was removed or in the 111 + * fsnotify_destroy_mark_by_group() call when the inotify instance was being 112 + * torn down. This is only called if the idr is about to be freed but there 113 + * are still marks in it. 114 + */ 108 115 static int idr_callback(int id, void *p, void *data) 109 116 { 110 - BUG(); 117 + struct fsnotify_mark_entry *entry; 118 + struct inotify_inode_mark_entry *ientry; 119 + static bool warned = false; 120 + 121 + if (warned) 122 + return 0; 123 + 124 + warned = false; 125 + entry = p; 126 + ientry = container_of(entry, struct inotify_inode_mark_entry, fsn_entry); 127 + 128 + WARN(1, "inotify closing but id=%d for entry=%p in group=%p still in " 129 + "idr. Probably leaking memory\n", id, p, data); 130 + 131 + /* 132 + * I'm taking the liberty of assuming that the mark in question is a 133 + * valid address and I'm dereferencing it. This might help to figure 134 + * out why we got here and the panic is no worse than the original 135 + * BUG() that was here. 136 + */ 137 + if (entry) 138 + printk(KERN_WARNING "entry->group=%p inode=%p wd=%d\n", 139 + entry->group, entry->inode, ientry->wd); 111 140 return 0; 112 141 } 113 142 114 143 static void inotify_free_group_priv(struct fsnotify_group *group) 115 144 { 116 145 /* ideally the idr is empty and we won't hit the BUG in teh callback */ 117 - idr_for_each(&group->inotify_data.idr, idr_callback, NULL); 146 + idr_for_each(&group->inotify_data.idr, idr_callback, group); 118 147 idr_remove_all(&group->inotify_data.idr); 119 148 idr_destroy(&group->inotify_data.idr); 120 149 }
+159 -88
fs/notify/inotify/inotify_user.c
··· 47 47 48 48 static struct vfsmount *inotify_mnt __read_mostly; 49 49 50 - /* this just sits here and wastes global memory. used to just pad userspace messages with zeros */ 51 - static struct inotify_event nul_inotify_event; 52 - 53 50 /* these are configurable via /proc/sys/fs/inotify/ */ 54 51 static int inotify_max_user_instances __read_mostly; 55 52 static int inotify_max_queued_events __read_mostly; ··· 154 157 155 158 event = fsnotify_peek_notify_event(group); 156 159 157 - event_size += roundup(event->name_len, event_size); 160 + if (event->name_len) 161 + event_size += roundup(event->name_len + 1, event_size); 158 162 159 163 if (event_size > count) 160 164 return ERR_PTR(-EINVAL); ··· 181 183 struct fsnotify_event_private_data *fsn_priv; 182 184 struct inotify_event_private_data *priv; 183 185 size_t event_size = sizeof(struct inotify_event); 184 - size_t name_len; 186 + size_t name_len = 0; 185 187 186 188 /* we get the inotify watch descriptor from the event private data */ 187 189 spin_lock(&event->lock); ··· 197 199 inotify_free_event_priv(fsn_priv); 198 200 } 199 201 200 - /* round up event->name_len so it is a multiple of event_size */ 201 - name_len = roundup(event->name_len, event_size); 202 + /* 203 + * round up event->name_len so it is a multiple of event_size 204 + * plus an extra byte for the terminating '\0'. 205 + */ 206 + if (event->name_len) 207 + name_len = roundup(event->name_len + 1, event_size); 202 208 inotify_event.len = name_len; 203 209 204 210 inotify_event.mask = inotify_mask_to_arg(event->mask); ··· 226 224 return -EFAULT; 227 225 buf += event->name_len; 228 226 229 - /* fill userspace with 0's from nul_inotify_event */ 230 - if (copy_to_user(buf, &nul_inotify_event, len_to_zero)) 227 + /* fill userspace with 0's */ 228 + if (clear_user(buf, len_to_zero)) 231 229 return -EFAULT; 232 230 buf += len_to_zero; 233 231 event_size += name_len; ··· 328 326 list_for_each_entry(holder, &group->notification_list, event_list) { 329 327 event = holder->event; 330 328 send_len += sizeof(struct inotify_event); 331 - send_len += roundup(event->name_len, 332 - sizeof(struct inotify_event)); 329 + if (event->name_len) 330 + send_len += roundup(event->name_len + 1, 331 + sizeof(struct inotify_event)); 333 332 } 334 333 mutex_unlock(&group->notification_mutex); 335 334 ret = put_user(send_len, (int __user *) p); ··· 367 364 return error; 368 365 } 369 366 367 + /* 368 + * Remove the mark from the idr (if present) and drop the reference 369 + * on the mark because it was in the idr. 370 + */ 370 371 static void inotify_remove_from_idr(struct fsnotify_group *group, 371 372 struct inotify_inode_mark_entry *ientry) 372 373 { 373 374 struct idr *idr; 375 + struct fsnotify_mark_entry *entry; 376 + struct inotify_inode_mark_entry *found_ientry; 377 + int wd; 374 378 375 379 spin_lock(&group->inotify_data.idr_lock); 376 380 idr = &group->inotify_data.idr; 377 - idr_remove(idr, ientry->wd); 378 - spin_unlock(&group->inotify_data.idr_lock); 381 + wd = ientry->wd; 382 + 383 + if (wd == -1) 384 + goto out; 385 + 386 + entry = idr_find(&group->inotify_data.idr, wd); 387 + if (unlikely(!entry)) 388 + goto out; 389 + 390 + found_ientry = container_of(entry, struct inotify_inode_mark_entry, fsn_entry); 391 + if (unlikely(found_ientry != ientry)) { 392 + /* We found an entry in the idr with the right wd, but it's 393 + * not the entry we were told to remove. eparis seriously 394 + * fucked up somewhere. */ 395 + WARN_ON(1); 396 + ientry->wd = -1; 397 + goto out; 398 + } 399 + 400 + /* One ref for being in the idr, one ref held by the caller */ 401 + BUG_ON(atomic_read(&entry->refcnt) < 2); 402 + 403 + idr_remove(idr, wd); 379 404 ientry->wd = -1; 405 + 406 + /* removed from the idr, drop that ref */ 407 + fsnotify_put_mark(entry); 408 + out: 409 + spin_unlock(&group->inotify_data.idr_lock); 380 410 } 411 + 381 412 /* 382 - * Send IN_IGNORED for this wd, remove this wd from the idr, and drop the 383 - * internal reference help on the mark because it is in the idr. 413 + * Send IN_IGNORED for this wd, remove this wd from the idr. 384 414 */ 385 415 void inotify_ignored_and_remove_idr(struct fsnotify_mark_entry *entry, 386 416 struct fsnotify_group *group) ··· 453 417 /* remove this entry from the idr */ 454 418 inotify_remove_from_idr(group, ientry); 455 419 456 - /* removed from idr, drop that reference */ 457 - fsnotify_put_mark(entry); 458 - 459 420 atomic_dec(&group->inotify_data.user->inotify_watches); 460 421 } 461 422 ··· 464 431 kmem_cache_free(inotify_inode_mark_cachep, ientry); 465 432 } 466 433 467 - static int inotify_update_watch(struct fsnotify_group *group, struct inode *inode, u32 arg) 434 + static int inotify_update_existing_watch(struct fsnotify_group *group, 435 + struct inode *inode, 436 + u32 arg) 468 437 { 469 - struct fsnotify_mark_entry *entry = NULL; 438 + struct fsnotify_mark_entry *entry; 470 439 struct inotify_inode_mark_entry *ientry; 471 - struct inotify_inode_mark_entry *tmp_ientry; 472 - int ret = 0; 473 - int add = (arg & IN_MASK_ADD); 474 - __u32 mask; 475 440 __u32 old_mask, new_mask; 441 + __u32 mask; 442 + int add = (arg & IN_MASK_ADD); 443 + int ret; 476 444 477 445 /* don't allow invalid bits: we don't want flags set */ 478 446 mask = inotify_arg_to_mask(arg); 479 447 if (unlikely(!mask)) 480 448 return -EINVAL; 481 449 482 - tmp_ientry = kmem_cache_alloc(inotify_inode_mark_cachep, GFP_KERNEL); 483 - if (unlikely(!tmp_ientry)) 484 - return -ENOMEM; 485 - /* we set the mask at the end after attaching it */ 486 - fsnotify_init_mark(&tmp_ientry->fsn_entry, inotify_free_mark); 487 - tmp_ientry->wd = -1; 488 - 489 - find_entry: 490 450 spin_lock(&inode->i_lock); 491 451 entry = fsnotify_find_mark_entry(group, inode); 492 452 spin_unlock(&inode->i_lock); 493 - if (entry) { 494 - ientry = container_of(entry, struct inotify_inode_mark_entry, fsn_entry); 495 - } else { 496 - ret = -ENOSPC; 497 - if (atomic_read(&group->inotify_data.user->inotify_watches) >= inotify_max_user_watches) 498 - goto out_err; 499 - retry: 500 - ret = -ENOMEM; 501 - if (unlikely(!idr_pre_get(&group->inotify_data.idr, GFP_KERNEL))) 502 - goto out_err; 453 + if (!entry) 454 + return -ENOENT; 503 455 504 - spin_lock(&group->inotify_data.idr_lock); 505 - ret = idr_get_new_above(&group->inotify_data.idr, &tmp_ientry->fsn_entry, 506 - group->inotify_data.last_wd, 507 - &tmp_ientry->wd); 508 - spin_unlock(&group->inotify_data.idr_lock); 509 - if (ret) { 510 - if (ret == -EAGAIN) 511 - goto retry; 512 - goto out_err; 513 - } 514 - 515 - ret = fsnotify_add_mark(&tmp_ientry->fsn_entry, group, inode); 516 - if (ret) { 517 - inotify_remove_from_idr(group, tmp_ientry); 518 - if (ret == -EEXIST) 519 - goto find_entry; 520 - goto out_err; 521 - } 522 - 523 - /* tmp_ientry has been added to the inode, so we are all set up. 524 - * now we just need to make sure tmp_ientry doesn't get freed and 525 - * we need to set up entry and ientry so the generic code can 526 - * do its thing. */ 527 - ientry = tmp_ientry; 528 - entry = &ientry->fsn_entry; 529 - tmp_ientry = NULL; 530 - 531 - atomic_inc(&group->inotify_data.user->inotify_watches); 532 - 533 - /* update the idr hint */ 534 - group->inotify_data.last_wd = ientry->wd; 535 - 536 - /* we put the mark on the idr, take a reference */ 537 - fsnotify_get_mark(entry); 538 - } 539 - 540 - ret = ientry->wd; 456 + ientry = container_of(entry, struct inotify_inode_mark_entry, fsn_entry); 541 457 542 458 spin_lock(&entry->lock); 543 459 ··· 518 536 fsnotify_recalc_group_mask(group); 519 537 } 520 538 521 - /* this either matches fsnotify_find_mark_entry, or init_mark_entry 522 - * depending on which path we took... */ 539 + /* return the wd */ 540 + ret = ientry->wd; 541 + 542 + /* match the get from fsnotify_find_mark_entry() */ 523 543 fsnotify_put_mark(entry); 524 544 525 - out_err: 526 - /* could be an error, could be that we found an existing mark */ 527 - if (tmp_ientry) { 528 - /* on the idr but didn't make it on the inode */ 529 - if (tmp_ientry->wd != -1) 530 - inotify_remove_from_idr(group, tmp_ientry); 531 - kmem_cache_free(inotify_inode_mark_cachep, tmp_ientry); 545 + return ret; 546 + } 547 + 548 + static int inotify_new_watch(struct fsnotify_group *group, 549 + struct inode *inode, 550 + u32 arg) 551 + { 552 + struct inotify_inode_mark_entry *tmp_ientry; 553 + __u32 mask; 554 + int ret; 555 + 556 + /* don't allow invalid bits: we don't want flags set */ 557 + mask = inotify_arg_to_mask(arg); 558 + if (unlikely(!mask)) 559 + return -EINVAL; 560 + 561 + tmp_ientry = kmem_cache_alloc(inotify_inode_mark_cachep, GFP_KERNEL); 562 + if (unlikely(!tmp_ientry)) 563 + return -ENOMEM; 564 + 565 + fsnotify_init_mark(&tmp_ientry->fsn_entry, inotify_free_mark); 566 + tmp_ientry->fsn_entry.mask = mask; 567 + tmp_ientry->wd = -1; 568 + 569 + ret = -ENOSPC; 570 + if (atomic_read(&group->inotify_data.user->inotify_watches) >= inotify_max_user_watches) 571 + goto out_err; 572 + retry: 573 + ret = -ENOMEM; 574 + if (unlikely(!idr_pre_get(&group->inotify_data.idr, GFP_KERNEL))) 575 + goto out_err; 576 + 577 + spin_lock(&group->inotify_data.idr_lock); 578 + ret = idr_get_new_above(&group->inotify_data.idr, &tmp_ientry->fsn_entry, 579 + group->inotify_data.last_wd, 580 + &tmp_ientry->wd); 581 + spin_unlock(&group->inotify_data.idr_lock); 582 + if (ret) { 583 + /* idr was out of memory allocate and try again */ 584 + if (ret == -EAGAIN) 585 + goto retry; 586 + goto out_err; 532 587 } 588 + 589 + /* we put the mark on the idr, take a reference */ 590 + fsnotify_get_mark(&tmp_ientry->fsn_entry); 591 + 592 + /* we are on the idr, now get on the inode */ 593 + ret = fsnotify_add_mark(&tmp_ientry->fsn_entry, group, inode); 594 + if (ret) { 595 + /* we failed to get on the inode, get off the idr */ 596 + inotify_remove_from_idr(group, tmp_ientry); 597 + goto out_err; 598 + } 599 + 600 + /* update the idr hint, who cares about races, it's just a hint */ 601 + group->inotify_data.last_wd = tmp_ientry->wd; 602 + 603 + /* increment the number of watches the user has */ 604 + atomic_inc(&group->inotify_data.user->inotify_watches); 605 + 606 + /* return the watch descriptor for this new entry */ 607 + ret = tmp_ientry->wd; 608 + 609 + /* match the ref from fsnotify_init_markentry() */ 610 + fsnotify_put_mark(&tmp_ientry->fsn_entry); 611 + 612 + /* if this mark added a new event update the group mask */ 613 + if (mask & ~group->mask) 614 + fsnotify_recalc_group_mask(group); 615 + 616 + out_err: 617 + if (ret < 0) 618 + kmem_cache_free(inotify_inode_mark_cachep, tmp_ientry); 619 + 620 + return ret; 621 + } 622 + 623 + static int inotify_update_watch(struct fsnotify_group *group, struct inode *inode, u32 arg) 624 + { 625 + int ret = 0; 626 + 627 + retry: 628 + /* try to update and existing watch with the new arg */ 629 + ret = inotify_update_existing_watch(group, inode, arg); 630 + /* no mark present, try to add a new one */ 631 + if (ret == -ENOENT) 632 + ret = inotify_new_watch(group, inode, arg); 633 + /* 634 + * inotify_new_watch could race with another thread which did an 635 + * inotify_new_watch between the update_existing and the add watch 636 + * here, go back and try to update an existing mark again. 637 + */ 638 + if (ret == -EEXIST) 639 + goto retry; 533 640 534 641 return ret; 535 642 }
+1 -1
fs/ocfs2/alloc.c
··· 6851 6851 } 6852 6852 status = 0; 6853 6853 bail: 6854 - 6854 + brelse(last_eb_bh); 6855 6855 mlog_exit(status); 6856 6856 return status; 6857 6857 }
+2 -2
fs/ocfs2/dlm/dlmunlock.c
··· 122 122 * that still has AST's pending... */ 123 123 in_use = !list_empty(&lock->ast_list); 124 124 spin_unlock(&dlm->ast_lock); 125 - if (in_use) { 125 + if (in_use && !(flags & LKM_CANCEL)) { 126 126 mlog(ML_ERROR, "lockres %.*s: Someone is calling dlmunlock " 127 127 "while waiting for an ast!", res->lockname.len, 128 128 res->lockname.name); ··· 131 131 132 132 spin_lock(&res->spinlock); 133 133 if (res->state & DLM_LOCK_RES_IN_PROGRESS) { 134 - if (master_node) { 134 + if (master_node && !(flags & LKM_CANCEL)) { 135 135 mlog(ML_ERROR, "lockres in progress!\n"); 136 136 spin_unlock(&res->spinlock); 137 137 return DLM_FORWARD;
+1
fs/ocfs2/ocfs2_lockid.h
··· 108 108 [OCFS2_LOCK_TYPE_OPEN] = "Open", 109 109 [OCFS2_LOCK_TYPE_FLOCK] = "Flock", 110 110 [OCFS2_LOCK_TYPE_QINFO] = "Quota", 111 + [OCFS2_LOCK_TYPE_NFS_SYNC] = "NFSSync", 111 112 [OCFS2_LOCK_TYPE_ORPHAN_SCAN] = "OrphanScan", 112 113 }; 113 114
+10
fs/ocfs2/quota_global.c
··· 23 23 #include "sysfile.h" 24 24 #include "dlmglue.h" 25 25 #include "uptodate.h" 26 + #include "super.h" 26 27 #include "quota.h" 27 28 28 29 static struct workqueue_struct *ocfs2_quota_wq = NULL; ··· 115 114 int rc = 0; 116 115 struct buffer_head *tmp = *bh; 117 116 117 + if (i_size_read(inode) >> inode->i_sb->s_blocksize_bits <= v_block) { 118 + ocfs2_error(inode->i_sb, 119 + "Quota file %llu is probably corrupted! Requested " 120 + "to read block %Lu but file has size only %Lu\n", 121 + (unsigned long long)OCFS2_I(inode)->ip_blkno, 122 + (unsigned long long)v_block, 123 + (unsigned long long)i_size_read(inode)); 124 + return -EIO; 125 + } 118 126 rc = ocfs2_read_virt_blocks(inode, v_block, 1, &tmp, 0, 119 127 ocfs2_validate_quota_block); 120 128 if (rc)
+5 -1
fs/ocfs2/super.c
··· 1218 1218 { 1219 1219 struct ocfs2_super *osb = OCFS2_SB(sb); 1220 1220 1221 + /* Failed mount? */ 1222 + if (!osb || atomic_read(&osb->vol_state) == VOLUME_DISABLED) 1223 + goto out; 1224 + 1221 1225 /* Prevent further queueing of inode drop events */ 1222 1226 spin_lock(&dentry_list_lock); 1223 1227 ocfs2_set_osb_flag(osb, OCFS2_OSB_DROP_DENTRY_LOCK_IMMED); 1224 1228 spin_unlock(&dentry_list_lock); 1225 1229 /* Wait for work to finish and/or remove it */ 1226 1230 cancel_work_sync(&osb->dentry_lock_work); 1227 - 1231 + out: 1228 1232 kill_block_super(sb); 1229 1233 } 1230 1234
+3 -2
include/acpi/processor.h
··· 174 174 cpumask_var_t shared_cpu_map; 175 175 int (*acpi_processor_get_throttling) (struct acpi_processor * pr); 176 176 int (*acpi_processor_set_throttling) (struct acpi_processor * pr, 177 - int state); 177 + int state, bool force); 178 178 179 179 u32 address; 180 180 u8 duty_offset; ··· 321 321 /* in processor_throttling.c */ 322 322 int acpi_processor_tstate_has_changed(struct acpi_processor *pr); 323 323 int acpi_processor_get_throttling_info(struct acpi_processor *pr); 324 - extern int acpi_processor_set_throttling(struct acpi_processor *pr, int state); 324 + extern int acpi_processor_set_throttling(struct acpi_processor *pr, 325 + int state, bool force); 325 326 extern const struct file_operations acpi_processor_throttling_fops; 326 327 extern void acpi_processor_throttling_init(void); 327 328 /* in processor_idle.c */
+4
include/drm/radeon_drm.h
··· 508 508 #define DRM_RADEON_INFO 0x27 509 509 #define DRM_RADEON_GEM_SET_TILING 0x28 510 510 #define DRM_RADEON_GEM_GET_TILING 0x29 511 + #define DRM_RADEON_GEM_BUSY 0x2a 511 512 512 513 #define DRM_IOCTL_RADEON_CP_INIT DRM_IOW( DRM_COMMAND_BASE + DRM_RADEON_CP_INIT, drm_radeon_init_t) 513 514 #define DRM_IOCTL_RADEON_CP_START DRM_IO( DRM_COMMAND_BASE + DRM_RADEON_CP_START) ··· 549 548 #define DRM_IOCTL_RADEON_INFO DRM_IOWR(DRM_COMMAND_BASE + DRM_RADEON_INFO, struct drm_radeon_info) 550 549 #define DRM_IOCTL_RADEON_SET_TILING DRM_IOWR(DRM_COMMAND_BASE + DRM_RADEON_GEM_SET_TILING, struct drm_radeon_gem_set_tiling) 551 550 #define DRM_IOCTL_RADEON_GET_TILING DRM_IOWR(DRM_COMMAND_BASE + DRM_RADEON_GEM_GET_TILING, struct drm_radeon_gem_get_tiling) 551 + #define DRM_IOCTL_RADEON_GEM_BUSY DRM_IOWR(DRM_COMMAND_BASE + DRM_RADEON_GEM_BUSY, struct drm_radeon_gem_busy) 552 552 553 553 typedef struct drm_radeon_init { 554 554 enum { ··· 709 707 #define RADEON_PARAM_FB_LOCATION 14 /* FB location */ 710 708 #define RADEON_PARAM_NUM_GB_PIPES 15 /* num GB pipes */ 711 709 #define RADEON_PARAM_DEVICE_ID 16 710 + #define RADEON_PARAM_NUM_Z_PIPES 17 /* num Z pipes */ 712 711 713 712 typedef struct drm_radeon_getparam { 714 713 int param; ··· 898 895 899 896 #define RADEON_INFO_DEVICE_ID 0x00 900 897 #define RADEON_INFO_NUM_GB_PIPES 0x01 898 + #define RADEON_INFO_NUM_Z_PIPES 0x02 901 899 902 900 struct drm_radeon_info { 903 901 uint32_t request;
+8 -10
include/linux/bitmap.h
··· 94 94 const unsigned long *src, int shift, int bits); 95 95 extern void __bitmap_shift_left(unsigned long *dst, 96 96 const unsigned long *src, int shift, int bits); 97 - extern void __bitmap_and(unsigned long *dst, const unsigned long *bitmap1, 97 + extern int __bitmap_and(unsigned long *dst, const unsigned long *bitmap1, 98 98 const unsigned long *bitmap2, int bits); 99 99 extern void __bitmap_or(unsigned long *dst, const unsigned long *bitmap1, 100 100 const unsigned long *bitmap2, int bits); 101 101 extern void __bitmap_xor(unsigned long *dst, const unsigned long *bitmap1, 102 102 const unsigned long *bitmap2, int bits); 103 - extern void __bitmap_andnot(unsigned long *dst, const unsigned long *bitmap1, 103 + extern int __bitmap_andnot(unsigned long *dst, const unsigned long *bitmap1, 104 104 const unsigned long *bitmap2, int bits); 105 105 extern int __bitmap_intersects(const unsigned long *bitmap1, 106 106 const unsigned long *bitmap2, int bits); ··· 171 171 } 172 172 } 173 173 174 - static inline void bitmap_and(unsigned long *dst, const unsigned long *src1, 174 + static inline int bitmap_and(unsigned long *dst, const unsigned long *src1, 175 175 const unsigned long *src2, int nbits) 176 176 { 177 177 if (small_const_nbits(nbits)) 178 - *dst = *src1 & *src2; 179 - else 180 - __bitmap_and(dst, src1, src2, nbits); 178 + return (*dst = *src1 & *src2) != 0; 179 + return __bitmap_and(dst, src1, src2, nbits); 181 180 } 182 181 183 182 static inline void bitmap_or(unsigned long *dst, const unsigned long *src1, ··· 197 198 __bitmap_xor(dst, src1, src2, nbits); 198 199 } 199 200 200 - static inline void bitmap_andnot(unsigned long *dst, const unsigned long *src1, 201 + static inline int bitmap_andnot(unsigned long *dst, const unsigned long *src1, 201 202 const unsigned long *src2, int nbits) 202 203 { 203 204 if (small_const_nbits(nbits)) 204 - *dst = *src1 & ~(*src2); 205 - else 206 - __bitmap_andnot(dst, src1, src2, nbits); 205 + return (*dst = *src1 & ~(*src2)) != 0; 206 + return __bitmap_andnot(dst, src1, src2, nbits); 207 207 } 208 208 209 209 static inline void bitmap_complement(unsigned long *dst, const unsigned long *src,
+10 -10
include/linux/cpumask.h
··· 43 43 * int cpu_isset(cpu, mask) true iff bit 'cpu' set in mask 44 44 * int cpu_test_and_set(cpu, mask) test and set bit 'cpu' in mask 45 45 * 46 - * void cpus_and(dst, src1, src2) dst = src1 & src2 [intersection] 46 + * int cpus_and(dst, src1, src2) dst = src1 & src2 [intersection] 47 47 * void cpus_or(dst, src1, src2) dst = src1 | src2 [union] 48 48 * void cpus_xor(dst, src1, src2) dst = src1 ^ src2 49 - * void cpus_andnot(dst, src1, src2) dst = src1 & ~src2 49 + * int cpus_andnot(dst, src1, src2) dst = src1 & ~src2 50 50 * void cpus_complement(dst, src) dst = ~src 51 51 * 52 52 * int cpus_equal(mask1, mask2) Does mask1 == mask2? ··· 179 179 } 180 180 181 181 #define cpus_and(dst, src1, src2) __cpus_and(&(dst), &(src1), &(src2), NR_CPUS) 182 - static inline void __cpus_and(cpumask_t *dstp, const cpumask_t *src1p, 182 + static inline int __cpus_and(cpumask_t *dstp, const cpumask_t *src1p, 183 183 const cpumask_t *src2p, int nbits) 184 184 { 185 - bitmap_and(dstp->bits, src1p->bits, src2p->bits, nbits); 185 + return bitmap_and(dstp->bits, src1p->bits, src2p->bits, nbits); 186 186 } 187 187 188 188 #define cpus_or(dst, src1, src2) __cpus_or(&(dst), &(src1), &(src2), NR_CPUS) ··· 201 201 202 202 #define cpus_andnot(dst, src1, src2) \ 203 203 __cpus_andnot(&(dst), &(src1), &(src2), NR_CPUS) 204 - static inline void __cpus_andnot(cpumask_t *dstp, const cpumask_t *src1p, 204 + static inline int __cpus_andnot(cpumask_t *dstp, const cpumask_t *src1p, 205 205 const cpumask_t *src2p, int nbits) 206 206 { 207 - bitmap_andnot(dstp->bits, src1p->bits, src2p->bits, nbits); 207 + return bitmap_andnot(dstp->bits, src1p->bits, src2p->bits, nbits); 208 208 } 209 209 210 210 #define cpus_complement(dst, src) __cpus_complement(&(dst), &(src), NR_CPUS) ··· 738 738 * @src1p: the first input 739 739 * @src2p: the second input 740 740 */ 741 - static inline void cpumask_and(struct cpumask *dstp, 741 + static inline int cpumask_and(struct cpumask *dstp, 742 742 const struct cpumask *src1p, 743 743 const struct cpumask *src2p) 744 744 { 745 - bitmap_and(cpumask_bits(dstp), cpumask_bits(src1p), 745 + return bitmap_and(cpumask_bits(dstp), cpumask_bits(src1p), 746 746 cpumask_bits(src2p), nr_cpumask_bits); 747 747 } 748 748 ··· 779 779 * @src1p: the first input 780 780 * @src2p: the second input 781 781 */ 782 - static inline void cpumask_andnot(struct cpumask *dstp, 782 + static inline int cpumask_andnot(struct cpumask *dstp, 783 783 const struct cpumask *src1p, 784 784 const struct cpumask *src2p) 785 785 { 786 - bitmap_andnot(cpumask_bits(dstp), cpumask_bits(src1p), 786 + return bitmap_andnot(cpumask_bits(dstp), cpumask_bits(src1p), 787 787 cpumask_bits(src2p), nr_cpumask_bits); 788 788 } 789 789
+7 -5
include/linux/flex_array.h
··· 21 21 struct { 22 22 int element_size; 23 23 int total_nr_elements; 24 - struct flex_array_part *parts[0]; 24 + struct flex_array_part *parts[]; 25 25 }; 26 26 /* 27 27 * This little trick makes sure that ··· 36 36 .total_nr_elements = (total), \ 37 37 } } } 38 38 39 - struct flex_array *flex_array_alloc(int element_size, int total, gfp_t flags); 40 - int flex_array_prealloc(struct flex_array *fa, int start, int end, gfp_t flags); 39 + struct flex_array *flex_array_alloc(int element_size, unsigned int total, 40 + gfp_t flags); 41 + int flex_array_prealloc(struct flex_array *fa, unsigned int start, 42 + unsigned int end, gfp_t flags); 41 43 void flex_array_free(struct flex_array *fa); 42 44 void flex_array_free_parts(struct flex_array *fa); 43 - int flex_array_put(struct flex_array *fa, int element_nr, void *src, 45 + int flex_array_put(struct flex_array *fa, unsigned int element_nr, void *src, 44 46 gfp_t flags); 45 - void *flex_array_get(struct flex_array *fa, int element_nr); 47 + void *flex_array_get(struct flex_array *fa, unsigned int element_nr); 46 48 47 49 #endif /* _FLEX_ARRAY_H */
+1 -1
include/linux/fs.h
··· 2123 2123 int open_flag, int mode, int acc_mode); 2124 2124 extern int may_open(struct path *, int, int); 2125 2125 2126 - extern int kernel_read(struct file *, unsigned long, char *, unsigned long); 2126 + extern int kernel_read(struct file *, loff_t, char *, unsigned long); 2127 2127 extern struct file * open_exec(const char *); 2128 2128 2129 2129 /* fs/dcache.c -- generic fs support functions */
+4 -2
include/linux/hugetlb.h
··· 10 10 #include <asm/tlbflush.h> 11 11 12 12 struct ctl_table; 13 + struct user_struct; 13 14 14 15 int PageHuge(struct page *page); 15 16 ··· 147 146 148 147 extern const struct file_operations hugetlbfs_file_operations; 149 148 extern struct vm_operations_struct hugetlb_vm_ops; 150 - struct file *hugetlb_file_setup(const char *name, size_t, int); 149 + struct file *hugetlb_file_setup(const char *name, size_t size, int acct, 150 + struct user_struct **user); 151 151 int hugetlb_get_quota(struct address_space *mapping, long delta); 152 152 void hugetlb_put_quota(struct address_space *mapping, long delta); 153 153 ··· 170 168 171 169 #define is_file_hugepages(file) 0 172 170 #define set_file_hugepages(file) BUG() 173 - #define hugetlb_file_setup(name,size,acctflag) ERR_PTR(-ENOSYS) 171 + #define hugetlb_file_setup(name,size,acct,user) ERR_PTR(-ENOSYS) 174 172 175 173 #endif /* !CONFIG_HUGETLBFS */ 176 174
+1 -1
include/linux/lmb.h
··· 51 51 extern u64 __init __lmb_alloc_base(u64 size, 52 52 u64 align, u64 max_addr); 53 53 extern u64 __init lmb_phys_mem_size(void); 54 - extern u64 __init lmb_end_of_DRAM(void); 54 + extern u64 lmb_end_of_DRAM(void); 55 55 extern void __init lmb_enforce_memory_limit(u64 memory_limit); 56 56 extern int __init lmb_is_reserved(u64 addr); 57 57 extern int lmb_find(struct lmb_property *res);
+4
include/linux/ucb1400.h
··· 73 73 74 74 #define UCB_ADC_DATA 0x68 75 75 #define UCB_ADC_DAT_VALID (1 << 15) 76 + 77 + #define UCB_FCSR 0x6c 78 + #define UCB_FCSR_AVE (1 << 12) 79 + 76 80 #define UCB_ADC_DAT_MASK 0x3ff 77 81 78 82 #define UCB_ID 0x7e
+2 -2
include/net/pkt_sched.h
··· 61 61 } 62 62 63 63 struct qdisc_watchdog { 64 - struct hrtimer timer; 65 - struct Qdisc *qdisc; 64 + struct tasklet_hrtimer timer; 65 + struct Qdisc *qdisc; 66 66 }; 67 67 68 68 extern void qdisc_watchdog_init(struct qdisc_watchdog *wd, struct Qdisc *qdisc);
+4 -3
init/main.c
··· 733 733 int initcall_debug; 734 734 core_param(initcall_debug, initcall_debug, bool, 0644); 735 735 736 + static char msgbuf[64]; 737 + static struct boot_trace_call call; 738 + static struct boot_trace_ret ret; 739 + 736 740 int do_one_initcall(initcall_t fn) 737 741 { 738 742 int count = preempt_count(); 739 743 ktime_t calltime, delta, rettime; 740 - char msgbuf[64]; 741 - struct boot_trace_call call; 742 - struct boot_trace_ret ret; 743 744 744 745 if (initcall_debug) { 745 746 call.caller = task_pid_nr(current);
+5 -3
ipc/shm.c
··· 174 174 shm_unlock(shp); 175 175 if (!is_file_hugepages(shp->shm_file)) 176 176 shmem_lock(shp->shm_file, 0, shp->mlock_user); 177 - else 177 + else if (shp->mlock_user) 178 178 user_shm_unlock(shp->shm_file->f_path.dentry->d_inode->i_size, 179 179 shp->mlock_user); 180 180 fput (shp->shm_file); ··· 369 369 /* hugetlb_file_setup applies strict accounting */ 370 370 if (shmflg & SHM_NORESERVE) 371 371 acctflag = VM_NORESERVE; 372 - file = hugetlb_file_setup(name, size, acctflag); 373 - shp->mlock_user = current_user(); 372 + file = hugetlb_file_setup(name, size, acctflag, 373 + &shp->mlock_user); 374 374 } else { 375 375 /* 376 376 * Do not allow no accounting for OVERCOMMIT_NEVER, even ··· 410 410 return error; 411 411 412 412 no_id: 413 + if (shp->mlock_user) /* shmflg & SHM_HUGETLB case */ 414 + user_shm_unlock(size, shp->mlock_user); 413 415 fput(file); 414 416 no_file: 415 417 security_shm_free(shp);
+5 -15
kernel/fork.c
··· 815 815 { 816 816 struct signal_struct *sig; 817 817 818 - if (clone_flags & CLONE_THREAD) { 819 - atomic_inc(&current->signal->count); 820 - atomic_inc(&current->signal->live); 818 + if (clone_flags & CLONE_THREAD) 821 819 return 0; 822 - } 823 820 824 821 sig = kmem_cache_alloc(signal_cachep, GFP_KERNEL); 825 822 tsk->signal = sig; ··· 872 875 thread_group_cputime_free(sig); 873 876 tty_kref_put(sig->tty); 874 877 kmem_cache_free(signal_cachep, sig); 875 - } 876 - 877 - static void cleanup_signal(struct task_struct *tsk) 878 - { 879 - struct signal_struct *sig = tsk->signal; 880 - 881 - atomic_dec(&sig->live); 882 - 883 - if (atomic_dec_and_test(&sig->count)) 884 - __cleanup_signal(sig); 885 878 } 886 879 887 880 static void copy_flags(unsigned long clone_flags, struct task_struct *p) ··· 1226 1239 } 1227 1240 1228 1241 if (clone_flags & CLONE_THREAD) { 1242 + atomic_inc(&current->signal->count); 1243 + atomic_inc(&current->signal->live); 1229 1244 p->group_leader = current->group_leader; 1230 1245 list_add_tail_rcu(&p->thread_group, &p->group_leader->thread_group); 1231 1246 } ··· 1271 1282 if (p->mm) 1272 1283 mmput(p->mm); 1273 1284 bad_fork_cleanup_signal: 1274 - cleanup_signal(p); 1285 + if (!(clone_flags & CLONE_THREAD)) 1286 + __cleanup_signal(p->signal); 1275 1287 bad_fork_cleanup_sighand: 1276 1288 __cleanup_sighand(p->sighand); 1277 1289 bad_fork_cleanup_fs:
+8 -2
kernel/module.c
··· 909 909 } 910 910 EXPORT_SYMBOL(__symbol_put); 911 911 912 + /* Note this assumes addr is a function, which it currently always is. */ 912 913 void symbol_put_addr(void *addr) 913 914 { 914 915 struct module *modaddr; 916 + unsigned long a = (unsigned long)dereference_function_descriptor(addr); 915 917 916 - if (core_kernel_text((unsigned long)addr)) 918 + if (core_kernel_text(a)) 917 919 return; 918 920 919 921 /* module_text_address is safe here: we're supposed to have reference 920 922 * to module from symbol_get, so it can't go away. */ 921 - modaddr = __module_text_address((unsigned long)addr); 923 + modaddr = __module_text_address(a); 922 924 BUG_ON(!modaddr); 923 925 module_put(modaddr); 924 926 } ··· 1273 1271 unsigned int notes, loaded, i; 1274 1272 struct module_notes_attrs *notes_attrs; 1275 1273 struct bin_attribute *nattr; 1274 + 1275 + /* failed to create section attributes, so can't create notes */ 1276 + if (!mod->sect_attrs) 1277 + return; 1276 1278 1277 1279 /* Count notes sections and allocate structures. */ 1278 1280 notes = 0;
+1 -1
kernel/perf_counter.c
··· 1791 1791 size += err; 1792 1792 1793 1793 list_for_each_entry(sub, &leader->sibling_list, list_entry) { 1794 - err = perf_counter_read_entry(counter, read_format, 1794 + err = perf_counter_read_entry(sub, read_format, 1795 1795 buf + size); 1796 1796 if (err < 0) 1797 1797 return err;
+10 -6
kernel/time/clockevents.c
··· 137 137 */ 138 138 int clockevents_register_notifier(struct notifier_block *nb) 139 139 { 140 + unsigned long flags; 140 141 int ret; 141 142 142 - spin_lock(&clockevents_lock); 143 + spin_lock_irqsave(&clockevents_lock, flags); 143 144 ret = raw_notifier_chain_register(&clockevents_chain, nb); 144 - spin_unlock(&clockevents_lock); 145 + spin_unlock_irqrestore(&clockevents_lock, flags); 145 146 146 147 return ret; 147 148 } ··· 179 178 */ 180 179 void clockevents_register_device(struct clock_event_device *dev) 181 180 { 181 + unsigned long flags; 182 + 182 183 BUG_ON(dev->mode != CLOCK_EVT_MODE_UNUSED); 183 184 BUG_ON(!dev->cpumask); 184 185 185 - spin_lock(&clockevents_lock); 186 + spin_lock_irqsave(&clockevents_lock, flags); 186 187 187 188 list_add(&dev->list, &clockevent_devices); 188 189 clockevents_do_notify(CLOCK_EVT_NOTIFY_ADD, dev); 189 190 clockevents_notify_released(); 190 191 191 - spin_unlock(&clockevents_lock); 192 + spin_unlock_irqrestore(&clockevents_lock, flags); 192 193 } 193 194 EXPORT_SYMBOL_GPL(clockevents_register_device); 194 195 ··· 238 235 void clockevents_notify(unsigned long reason, void *arg) 239 236 { 240 237 struct list_head *node, *tmp; 238 + unsigned long flags; 241 239 242 - spin_lock(&clockevents_lock); 240 + spin_lock_irqsave(&clockevents_lock, flags); 243 241 clockevents_do_notify(reason, arg); 244 242 245 243 switch (reason) { ··· 255 251 default: 256 252 break; 257 253 } 258 - spin_unlock(&clockevents_lock); 254 + spin_unlock_irqrestore(&clockevents_lock, flags); 259 255 } 260 256 EXPORT_SYMBOL_GPL(clockevents_notify); 261 257 #endif
+3 -4
kernel/time/tick-broadcast.c
··· 205 205 * Powerstate information: The system enters/leaves a state, where 206 206 * affected devices might stop 207 207 */ 208 - static void tick_do_broadcast_on_off(void *why) 208 + static void tick_do_broadcast_on_off(unsigned long *reason) 209 209 { 210 210 struct clock_event_device *bc, *dev; 211 211 struct tick_device *td; 212 - unsigned long flags, *reason = why; 212 + unsigned long flags; 213 213 int cpu, bc_stopped; 214 214 215 215 spin_lock_irqsave(&tick_broadcast_lock, flags); ··· 276 276 printk(KERN_ERR "tick-broadcast: ignoring broadcast for " 277 277 "offline CPU #%d\n", *oncpu); 278 278 else 279 - smp_call_function_single(*oncpu, tick_do_broadcast_on_off, 280 - &reason, 1); 279 + tick_do_broadcast_on_off(&reason); 281 280 } 282 281 283 282 /*
+1 -1
kernel/time/timer_list.c
··· 286 286 { 287 287 struct proc_dir_entry *pe; 288 288 289 - pe = proc_create("timer_list", 0644, NULL, &timer_list_fops); 289 + pe = proc_create("timer_list", 0444, NULL, &timer_list_fops); 290 290 if (!pe) 291 291 return -ENOMEM; 292 292 return 0;
+11 -6
kernel/trace/ftrace.c
··· 2278 2278 read++; 2279 2279 cnt--; 2280 2280 2281 - if (!(iter->flags & ~FTRACE_ITER_CONT)) { 2281 + /* 2282 + * If the parser haven't finished with the last write, 2283 + * continue reading the user input without skipping spaces. 2284 + */ 2285 + if (!(iter->flags & FTRACE_ITER_CONT)) { 2282 2286 /* skip white space */ 2283 2287 while (cnt && isspace(ch)) { 2284 2288 ret = get_user(ch, ubuf++); ··· 2292 2288 cnt--; 2293 2289 } 2294 2290 2291 + /* only spaces were written */ 2295 2292 if (isspace(ch)) { 2296 - file->f_pos += read; 2293 + *ppos += read; 2297 2294 ret = read; 2298 2295 goto out; 2299 2296 } ··· 2324 2319 if (ret) 2325 2320 goto out; 2326 2321 iter->buffer_idx = 0; 2327 - } else 2322 + } else { 2328 2323 iter->flags |= FTRACE_ITER_CONT; 2324 + iter->buffer[iter->buffer_idx++] = ch; 2325 + } 2329 2326 2330 - 2331 - file->f_pos += read; 2332 - 2327 + *ppos += read; 2333 2328 ret = read; 2334 2329 out: 2335 2330 mutex_unlock(&ftrace_regex_lock);
+2 -10
kernel/trace/trace.c
··· 3896 3896 if (ret < 0) 3897 3897 return ret; 3898 3898 3899 - switch (val) { 3900 - case 0: 3901 - trace_flags &= ~(1 << index); 3902 - break; 3903 - case 1: 3904 - trace_flags |= 1 << index; 3905 - break; 3906 - 3907 - default: 3899 + if (val != 0 && val != 1) 3908 3900 return -EINVAL; 3909 - } 3901 + set_tracer_flags(1 << index, val); 3910 3902 3911 3903 *ppos += cnt; 3912 3904
+8 -4
lib/bitmap.c
··· 179 179 } 180 180 EXPORT_SYMBOL(__bitmap_shift_left); 181 181 182 - void __bitmap_and(unsigned long *dst, const unsigned long *bitmap1, 182 + int __bitmap_and(unsigned long *dst, const unsigned long *bitmap1, 183 183 const unsigned long *bitmap2, int bits) 184 184 { 185 185 int k; 186 186 int nr = BITS_TO_LONGS(bits); 187 + unsigned long result = 0; 187 188 188 189 for (k = 0; k < nr; k++) 189 - dst[k] = bitmap1[k] & bitmap2[k]; 190 + result |= (dst[k] = bitmap1[k] & bitmap2[k]); 191 + return result != 0; 190 192 } 191 193 EXPORT_SYMBOL(__bitmap_and); 192 194 ··· 214 212 } 215 213 EXPORT_SYMBOL(__bitmap_xor); 216 214 217 - void __bitmap_andnot(unsigned long *dst, const unsigned long *bitmap1, 215 + int __bitmap_andnot(unsigned long *dst, const unsigned long *bitmap1, 218 216 const unsigned long *bitmap2, int bits) 219 217 { 220 218 int k; 221 219 int nr = BITS_TO_LONGS(bits); 220 + unsigned long result = 0; 222 221 223 222 for (k = 0; k < nr; k++) 224 - dst[k] = bitmap1[k] & ~bitmap2[k]; 223 + result |= (dst[k] = bitmap1[k] & ~bitmap2[k]); 224 + return result != 0; 225 225 } 226 226 EXPORT_SYMBOL(__bitmap_andnot); 227 227
+16 -12
lib/dma-debug.c
··· 156 156 return true; 157 157 158 158 /* driver filter on and initialized */ 159 - if (current_driver && dev->driver == current_driver) 159 + if (current_driver && dev && dev->driver == current_driver) 160 160 return true; 161 + 162 + /* driver filter on, but we can't filter on a NULL device... */ 163 + if (!dev) 164 + return false; 161 165 162 166 if (current_driver || !current_driver_name[0]) 163 167 return false; ··· 187 183 return ret; 188 184 } 189 185 190 - #define err_printk(dev, entry, format, arg...) do { \ 191 - error_count += 1; \ 192 - if (driver_filter(dev) && \ 193 - (show_all_errors || show_num_errors > 0)) { \ 194 - WARN(1, "%s %s: " format, \ 195 - dev_driver_string(dev), \ 196 - dev_name(dev) , ## arg); \ 197 - dump_entry_trace(entry); \ 198 - } \ 199 - if (!show_all_errors && show_num_errors > 0) \ 200 - show_num_errors -= 1; \ 186 + #define err_printk(dev, entry, format, arg...) do { \ 187 + error_count += 1; \ 188 + if (driver_filter(dev) && \ 189 + (show_all_errors || show_num_errors > 0)) { \ 190 + WARN(1, "%s %s: " format, \ 191 + dev ? dev_driver_string(dev) : "NULL", \ 192 + dev ? dev_name(dev) : "NULL", ## arg); \ 193 + dump_entry_trace(entry); \ 194 + } \ 195 + if (!show_all_errors && show_num_errors > 0) \ 196 + show_num_errors -= 1; \ 201 197 } while (0); 202 198 203 199 /*
+21 -20
lib/flex_array.c
··· 99 99 * capacity in the base structure. Also note that no effort is made 100 100 * to efficiently pack objects across page boundaries. 101 101 */ 102 - struct flex_array *flex_array_alloc(int element_size, int total, gfp_t flags) 102 + struct flex_array *flex_array_alloc(int element_size, unsigned int total, 103 + gfp_t flags) 103 104 { 104 105 struct flex_array *ret; 105 106 int max_size = nr_base_part_ptrs() * __elements_per_part(element_size); ··· 116 115 return ret; 117 116 } 118 117 119 - static int fa_element_to_part_nr(struct flex_array *fa, int element_nr) 118 + static int fa_element_to_part_nr(struct flex_array *fa, 119 + unsigned int element_nr) 120 120 { 121 121 return element_nr / __elements_per_part(fa->element_size); 122 122 } 123 123 124 124 /** 125 125 * flex_array_free_parts - just free the second-level pages 126 - * @src: address of data to copy into the array 127 - * @element_nr: index of the position in which to insert 128 - * the new element. 129 126 * 130 127 * This is to be used in cases where the base 'struct flex_array' 131 128 * has been statically allocated and should not be free. ··· 145 146 kfree(fa); 146 147 } 147 148 148 - static int fa_index_inside_part(struct flex_array *fa, int element_nr) 149 + static unsigned int index_inside_part(struct flex_array *fa, 150 + unsigned int element_nr) 149 151 { 150 - return element_nr % __elements_per_part(fa->element_size); 151 - } 152 + unsigned int part_offset; 152 153 153 - static int index_inside_part(struct flex_array *fa, int element_nr) 154 - { 155 - int part_offset = fa_index_inside_part(fa, element_nr); 154 + part_offset = element_nr % __elements_per_part(fa->element_size); 156 155 return part_offset * fa->element_size; 157 156 } 158 157 ··· 185 188 * 186 189 * Locking must be provided by the caller. 187 190 */ 188 - int flex_array_put(struct flex_array *fa, int element_nr, void *src, gfp_t flags) 191 + int flex_array_put(struct flex_array *fa, unsigned int element_nr, void *src, 192 + gfp_t flags) 189 193 { 190 194 int part_nr = fa_element_to_part_nr(fa, element_nr); 191 195 struct flex_array_part *part; ··· 196 198 return -ENOSPC; 197 199 if (elements_fit_in_base(fa)) 198 200 part = (struct flex_array_part *)&fa->parts[0]; 199 - else 201 + else { 200 202 part = __fa_get_part(fa, part_nr, flags); 201 - if (!part) 202 - return -ENOMEM; 203 + if (!part) 204 + return -ENOMEM; 205 + } 203 206 dst = &part->elements[index_inside_part(fa, element_nr)]; 204 207 memcpy(dst, src, fa->element_size); 205 208 return 0; ··· 218 219 * 219 220 * Locking must be provided by the caller. 220 221 */ 221 - int flex_array_prealloc(struct flex_array *fa, int start, int end, gfp_t flags) 222 + int flex_array_prealloc(struct flex_array *fa, unsigned int start, 223 + unsigned int end, gfp_t flags) 222 224 { 223 225 int start_part; 224 226 int end_part; ··· 250 250 * 251 251 * Locking must be provided by the caller. 252 252 */ 253 - void *flex_array_get(struct flex_array *fa, int element_nr) 253 + void *flex_array_get(struct flex_array *fa, unsigned int element_nr) 254 254 { 255 255 int part_nr = fa_element_to_part_nr(fa, element_nr); 256 256 struct flex_array_part *part; 257 257 258 258 if (element_nr >= fa->total_nr_elements) 259 259 return NULL; 260 - if (!fa->parts[part_nr]) 261 - return NULL; 262 260 if (elements_fit_in_base(fa)) 263 261 part = (struct flex_array_part *)&fa->parts[0]; 264 - else 262 + else { 265 263 part = fa->parts[part_nr]; 264 + if (!part) 265 + return NULL; 266 + } 266 267 return &part->elements[index_inside_part(fa, element_nr)]; 267 268 }
+1 -1
lib/lmb.c
··· 429 429 return lmb.memory.size; 430 430 } 431 431 432 - u64 __init lmb_end_of_DRAM(void) 432 + u64 lmb_end_of_DRAM(void) 433 433 { 434 434 int idx = lmb.memory.cnt - 1; 435 435
+1
mm/rmap.c
··· 358 358 */ 359 359 if (vma->vm_flags & VM_LOCKED) { 360 360 *mapcount = 1; /* break early from loop */ 361 + *vm_flags |= VM_LOCKED; 361 362 goto out_unmap; 362 363 } 363 364
+7 -2
mm/vmscan.c
··· 630 630 631 631 referenced = page_referenced(page, 1, 632 632 sc->mem_cgroup, &vm_flags); 633 - /* In active use or really unfreeable? Activate it. */ 633 + /* 634 + * In active use or really unfreeable? Activate it. 635 + * If page which have PG_mlocked lost isoltation race, 636 + * try_to_unmap moves it to unevictable list 637 + */ 634 638 if (sc->order <= PAGE_ALLOC_COSTLY_ORDER && 635 - referenced && page_mapping_inuse(page)) 639 + referenced && page_mapping_inuse(page) 640 + && !(vm_flags & VM_LOCKED)) 636 641 goto activate_locked; 637 642 638 643 /*
+8 -13
net/9p/client.c
··· 60 60 p9_client_rpc(struct p9_client *c, int8_t type, const char *fmt, ...); 61 61 62 62 /** 63 - * v9fs_parse_options - parse mount options into session structure 64 - * @options: options string passed from mount 65 - * @v9ses: existing v9fs session information 63 + * parse_options - parse mount options into client structure 64 + * @opts: options string passed from mount 65 + * @clnt: existing v9fs client information 66 66 * 67 67 * Return 0 upon success, -ERRNO upon failure 68 68 */ ··· 232 232 233 233 /** 234 234 * p9_tag_init - setup tags structure and contents 235 - * @tags: tags structure from the client struct 235 + * @c: v9fs client struct 236 236 * 237 237 * This initializes the tags structure for each client instance. 238 238 * ··· 258 258 259 259 /** 260 260 * p9_tag_cleanup - cleans up tags structure and reclaims resources 261 - * @tags: tags structure from the client struct 261 + * @c: v9fs client struct 262 262 * 263 263 * This frees resources associated with the tags structure 264 264 * ··· 411 411 if (c->dotu) 412 412 err = -ecode; 413 413 414 - if (!err) { 414 + if (!err || !IS_ERR_VALUE(err)) 415 415 err = p9_errstr2errno(ename, strlen(ename)); 416 - 417 - /* string match failed */ 418 - if (!err) 419 - err = -ESERVERFAULT; 420 - } 421 416 422 417 P9_DPRINTK(P9_DEBUG_9P, "<<< RERROR (%d) %s\n", -ecode, ename); 423 418 ··· 425 430 426 431 /** 427 432 * p9_client_flush - flush (cancel) a request 428 - * c: client state 429 - * req: request to cancel 433 + * @c: client state 434 + * @oldreq: request to cancel 430 435 * 431 436 * This sents a flush for a particular requests and links 432 437 * the flush request to the original request. The current
+1 -1
net/9p/error.c
··· 239 239 errstr[len] = 0; 240 240 printk(KERN_ERR "%s: server reported unknown error %s\n", 241 241 __func__, errstr); 242 - errno = 1; 242 + errno = ESERVERFAULT; 243 243 } 244 244 245 245 return -errno;
+4 -4
net/9p/trans_fd.c
··· 119 119 * @wpos: write position for current frame 120 120 * @wsize: amount of data to write for current frame 121 121 * @wbuf: current write buffer 122 + * @poll_pending_link: pending links to be polled per conn 122 123 * @poll_wait: array of wait_q's for various worker threads 123 - * @poll_waddr: ???? 124 124 * @pt: poll state 125 125 * @rq: current read work 126 126 * @wq: current write work ··· 700 700 } 701 701 702 702 /** 703 - * parse_options - parse mount options into session structure 704 - * @options: options string passed from mount 705 - * @opts: transport-specific structure to parse options into 703 + * parse_opts - parse mount options into p9_fd_opts structure 704 + * @params: options string passed from mount 705 + * @opts: fd transport-specific structure to parse options into 706 706 * 707 707 * Returns 0 upon success, -ERRNO upon failure 708 708 */
+5 -4
net/9p/trans_rdma.c
··· 67 67 * @pd: Protection Domain pointer 68 68 * @qp: Queue Pair pointer 69 69 * @cq: Completion Queue pointer 70 + * @dm_mr: DMA Memory Region pointer 70 71 * @lkey: The local access only memory region key 71 72 * @timeout: Number of uSecs to wait for connection management events 72 73 * @sq_depth: The depth of the Send Queue 73 74 * @sq_sem: Semaphore for the SQ 74 75 * @rq_depth: The depth of the Receive Queue. 76 + * @rq_count: Count of requests in the Receive Queue. 75 77 * @addr: The remote peer's address 76 78 * @req_lock: Protects the active request list 77 - * @send_wait: Wait list when the SQ fills up 78 79 * @cm_done: Completion event for connection management tracking 79 80 */ 80 81 struct p9_trans_rdma { ··· 155 154 }; 156 155 157 156 /** 158 - * parse_options - parse mount options into session structure 159 - * @options: options string passed from mount 160 - * @opts: transport-specific structure to parse options into 157 + * parse_opts - parse mount options into rdma options structure 158 + * @params: options string passed from mount 159 + * @opts: rdma transport-specific structure to parse options into 161 160 * 162 161 * Returns 0 upon success, -ERRNO upon failure 163 162 */
+4 -7
net/9p/trans_virtio.c
··· 57 57 * @initialized: whether the channel is initialized 58 58 * @inuse: whether the channel is in use 59 59 * @lock: protects multiple elements within this structure 60 + * @client: client instance 60 61 * @vdev: virtio dev associated with this channel 61 62 * @vq: virtio queue associated with this channel 62 - * @tagpool: accounting for tag ids (and request slots) 63 - * @reqs: array of request slots 64 - * @max_tag: current number of request_slots allocated 65 63 * @sg: scatter gather list which is used to pack a request (protected?) 66 64 * 67 65 * We keep all per-channel information in a structure. ··· 90 92 91 93 /** 92 94 * p9_virtio_close - reclaim resources of a channel 93 - * @trans: transport state 95 + * @client: client instance 94 96 * 95 97 * This reclaims a channel by freeing its resources and 96 98 * reseting its inuse flag. ··· 179 181 180 182 /** 181 183 * p9_virtio_request - issue a request 182 - * @t: transport state 183 - * @tc: &p9_fcall request to transmit 184 - * @rc: &p9_fcall to put reponse into 184 + * @client: client instance issuing the request 185 + * @req: request to be issued 185 186 * 186 187 */ 187 188
+5
net/core/netpoll.c
··· 319 319 320 320 udelay(USEC_PER_POLL); 321 321 } 322 + 323 + WARN_ONCE(!irqs_disabled(), 324 + "netpoll_send_skb(): %s enabled interrupts in poll (%pF)\n", 325 + dev->name, ops->ndo_start_xmit); 326 + 322 327 local_irq_restore(flags); 323 328 } 324 329
+2
net/ipv4/ip_output.c
··· 813 813 inet->cork.addr = ipc->addr; 814 814 } 815 815 rt = *rtp; 816 + if (unlikely(!rt)) 817 + return -EFAULT; 816 818 /* 817 819 * We steal reference to this route, caller should not release it 818 820 */
+3 -1
net/ipv6/af_inet6.c
··· 306 306 v4addr != htonl(INADDR_ANY) && 307 307 chk_addr_ret != RTN_LOCAL && 308 308 chk_addr_ret != RTN_MULTICAST && 309 - chk_addr_ret != RTN_BROADCAST) 309 + chk_addr_ret != RTN_BROADCAST) { 310 + err = -EADDRNOTAVAIL; 310 311 goto out; 312 + } 311 313 } else { 312 314 if (addr_type != IPV6_ADDR_ANY) { 313 315 struct net_device *dev = NULL;
+1
net/llc/af_llc.c
··· 914 914 struct llc_sock *llc = llc_sk(sk); 915 915 int rc = 0; 916 916 917 + memset(&sllc, 0, sizeof(sllc)); 917 918 lock_sock(sk); 918 919 if (sock_flag(sk, SOCK_ZAPPED)) 919 920 goto out;
+15 -13
net/mac80211/key.c
··· 67 67 * 68 68 * @key: key to add to do item for 69 69 * @flag: todo flag(s) 70 + * 71 + * Must be called with IRQs or softirqs disabled. 70 72 */ 71 73 static void add_todo(struct ieee80211_key *key, u32 flag) 72 74 { ··· 142 140 ret = drv_set_key(key->local, SET_KEY, &sdata->vif, sta, &key->conf); 143 141 144 142 if (!ret) { 145 - spin_lock(&todo_lock); 143 + spin_lock_bh(&todo_lock); 146 144 key->flags |= KEY_FLAG_UPLOADED_TO_HARDWARE; 147 - spin_unlock(&todo_lock); 145 + spin_unlock_bh(&todo_lock); 148 146 } 149 147 150 148 if (ret && ret != -ENOSPC && ret != -EOPNOTSUPP) ··· 166 164 if (!key || !key->local->ops->set_key) 167 165 return; 168 166 169 - spin_lock(&todo_lock); 167 + spin_lock_bh(&todo_lock); 170 168 if (!(key->flags & KEY_FLAG_UPLOADED_TO_HARDWARE)) { 171 - spin_unlock(&todo_lock); 169 + spin_unlock_bh(&todo_lock); 172 170 return; 173 171 } 174 - spin_unlock(&todo_lock); 172 + spin_unlock_bh(&todo_lock); 175 173 176 174 sta = get_sta_for_key(key); 177 175 sdata = key->sdata; ··· 190 188 wiphy_name(key->local->hw.wiphy), 191 189 key->conf.keyidx, sta ? sta->addr : bcast_addr, ret); 192 190 193 - spin_lock(&todo_lock); 191 + spin_lock_bh(&todo_lock); 194 192 key->flags &= ~KEY_FLAG_UPLOADED_TO_HARDWARE; 195 - spin_unlock(&todo_lock); 193 + spin_unlock_bh(&todo_lock); 196 194 } 197 195 198 196 static void __ieee80211_set_default_key(struct ieee80211_sub_if_data *sdata, ··· 439 437 440 438 __ieee80211_key_replace(sdata, sta, old_key, key); 441 439 442 - spin_unlock_irqrestore(&sdata->local->key_lock, flags); 443 - 444 440 /* free old key later */ 445 441 add_todo(old_key, KEY_FLAG_TODO_DELETE); 446 442 447 443 add_todo(key, KEY_FLAG_TODO_ADD_DEBUGFS); 448 444 if (netif_running(sdata->dev)) 449 445 add_todo(key, KEY_FLAG_TODO_HWACCEL_ADD); 446 + 447 + spin_unlock_irqrestore(&sdata->local->key_lock, flags); 450 448 } 451 449 452 450 static void __ieee80211_key_free(struct ieee80211_key *key) ··· 549 547 */ 550 548 synchronize_rcu(); 551 549 552 - spin_lock(&todo_lock); 550 + spin_lock_bh(&todo_lock); 553 551 while (!list_empty(&todo_list)) { 554 552 key = list_first_entry(&todo_list, struct ieee80211_key, todo); 555 553 list_del_init(&key->todo); ··· 560 558 KEY_FLAG_TODO_HWACCEL_REMOVE | 561 559 KEY_FLAG_TODO_DELETE); 562 560 key->flags &= ~todoflags; 563 - spin_unlock(&todo_lock); 561 + spin_unlock_bh(&todo_lock); 564 562 565 563 work_done = false; 566 564 ··· 593 591 594 592 WARN_ON(!work_done); 595 593 596 - spin_lock(&todo_lock); 594 + spin_lock_bh(&todo_lock); 597 595 } 598 - spin_unlock(&todo_lock); 596 + spin_unlock_bh(&todo_lock); 599 597 } 600 598 601 599 void ieee80211_key_todo(void)
+1 -1
net/netfilter/xt_quota.c
··· 52 52 53 53 q->master = kmalloc(sizeof(*q->master), GFP_KERNEL); 54 54 if (q->master == NULL) 55 - return -ENOMEM; 55 + return false; 56 56 57 57 q->master->quota = q->quota; 58 58 return true;
+5 -5
net/sched/sch_api.c
··· 458 458 static enum hrtimer_restart qdisc_watchdog(struct hrtimer *timer) 459 459 { 460 460 struct qdisc_watchdog *wd = container_of(timer, struct qdisc_watchdog, 461 - timer); 461 + timer.timer); 462 462 463 463 wd->qdisc->flags &= ~TCQ_F_THROTTLED; 464 464 __netif_schedule(qdisc_root(wd->qdisc)); ··· 468 468 469 469 void qdisc_watchdog_init(struct qdisc_watchdog *wd, struct Qdisc *qdisc) 470 470 { 471 - hrtimer_init(&wd->timer, CLOCK_MONOTONIC, HRTIMER_MODE_ABS); 472 - wd->timer.function = qdisc_watchdog; 471 + tasklet_hrtimer_init(&wd->timer, qdisc_watchdog, 472 + CLOCK_MONOTONIC, HRTIMER_MODE_ABS); 473 473 wd->qdisc = qdisc; 474 474 } 475 475 EXPORT_SYMBOL(qdisc_watchdog_init); ··· 485 485 wd->qdisc->flags |= TCQ_F_THROTTLED; 486 486 time = ktime_set(0, 0); 487 487 time = ktime_add_ns(time, PSCHED_TICKS2NS(expires)); 488 - hrtimer_start(&wd->timer, time, HRTIMER_MODE_ABS); 488 + tasklet_hrtimer_start(&wd->timer, time, HRTIMER_MODE_ABS); 489 489 } 490 490 EXPORT_SYMBOL(qdisc_watchdog_schedule); 491 491 492 492 void qdisc_watchdog_cancel(struct qdisc_watchdog *wd) 493 493 { 494 - hrtimer_cancel(&wd->timer); 494 + tasklet_hrtimer_cancel(&wd->timer); 495 495 wd->qdisc->flags &= ~TCQ_F_THROTTLED; 496 496 } 497 497 EXPORT_SYMBOL(qdisc_watchdog_cancel);
+14 -11
net/sched/sch_cbq.c
··· 163 163 psched_time_t now_rt; /* Cached real time */ 164 164 unsigned pmask; 165 165 166 - struct hrtimer delay_timer; 166 + struct tasklet_hrtimer delay_timer; 167 167 struct qdisc_watchdog watchdog; /* Watchdog timer, 168 168 started when CBQ has 169 169 backlog, but cannot ··· 503 503 cl->undertime = q->now + delay; 504 504 505 505 if (delay > 0) { 506 + struct hrtimer *ht; 507 + 506 508 sched += delay + cl->penalty; 507 509 cl->penalized = sched; 508 510 cl->cpriority = TC_CBQ_MAXPRIO; ··· 512 510 513 511 expires = ktime_set(0, 0); 514 512 expires = ktime_add_ns(expires, PSCHED_TICKS2NS(sched)); 515 - if (hrtimer_try_to_cancel(&q->delay_timer) && 516 - ktime_to_ns(ktime_sub( 517 - hrtimer_get_expires(&q->delay_timer), 518 - expires)) > 0) 519 - hrtimer_set_expires(&q->delay_timer, expires); 520 - hrtimer_restart(&q->delay_timer); 513 + ht = &q->delay_timer.timer; 514 + if (hrtimer_try_to_cancel(ht) && 515 + ktime_to_ns(ktime_sub(hrtimer_get_expires(ht), 516 + expires)) > 0) 517 + hrtimer_set_expires(ht, expires); 518 + hrtimer_restart(ht); 521 519 cl->delayed = 1; 522 520 cl->xstats.overactions++; 523 521 return; ··· 593 591 static enum hrtimer_restart cbq_undelay(struct hrtimer *timer) 594 592 { 595 593 struct cbq_sched_data *q = container_of(timer, struct cbq_sched_data, 596 - delay_timer); 594 + delay_timer.timer); 597 595 struct Qdisc *sch = q->watchdog.qdisc; 598 596 psched_time_t now; 599 597 psched_tdiff_t delay = 0; ··· 623 621 624 622 time = ktime_set(0, 0); 625 623 time = ktime_add_ns(time, PSCHED_TICKS2NS(now + delay)); 626 - hrtimer_start(&q->delay_timer, time, HRTIMER_MODE_ABS); 624 + tasklet_hrtimer_start(&q->delay_timer, time, HRTIMER_MODE_ABS); 627 625 } 628 626 629 627 sch->flags &= ~TCQ_F_THROTTLED; ··· 1216 1214 q->tx_class = NULL; 1217 1215 q->tx_borrowed = NULL; 1218 1216 qdisc_watchdog_cancel(&q->watchdog); 1219 - hrtimer_cancel(&q->delay_timer); 1217 + tasklet_hrtimer_cancel(&q->delay_timer); 1220 1218 q->toplevel = TC_CBQ_MAXLEVEL; 1221 1219 q->now = psched_get_time(); 1222 1220 q->now_rt = q->now; ··· 1399 1397 q->link.minidle = -0x7FFFFFFF; 1400 1398 1401 1399 qdisc_watchdog_init(&q->watchdog, sch); 1402 - hrtimer_init(&q->delay_timer, CLOCK_MONOTONIC, HRTIMER_MODE_ABS); 1400 + tasklet_hrtimer_init(&q->delay_timer, cbq_undelay, 1401 + CLOCK_MONOTONIC, HRTIMER_MODE_ABS); 1403 1402 q->delay_timer.function = cbq_undelay; 1404 1403 q->toplevel = TC_CBQ_MAXLEVEL; 1405 1404 q->now = psched_get_time();
+1
net/sunrpc/clnt.c
··· 937 937 rpc_task_force_reencode(struct rpc_task *task) 938 938 { 939 939 task->tk_rqstp->rq_snd_buf.len = 0; 940 + task->tk_rqstp->rq_bytes_sent = 0; 940 941 } 941 942 942 943 static inline void
+4 -2
security/integrity/ima/ima_crypto.c
··· 45 45 { 46 46 struct hash_desc desc; 47 47 struct scatterlist sg[1]; 48 - loff_t i_size; 48 + loff_t i_size, offset = 0; 49 49 char *rbuf; 50 - int rc, offset = 0; 50 + int rc; 51 51 52 52 rc = init_desc(&desc); 53 53 if (rc != 0) ··· 67 67 rc = rbuf_len; 68 68 break; 69 69 } 70 + if (rbuf_len == 0) 71 + break; 70 72 offset += rbuf_len; 71 73 sg_init_one(sg, rbuf, rbuf_len); 72 74
+4
security/integrity/ima/ima_main.c
··· 262 262 else if (mask & (MAY_READ | MAY_EXEC)) 263 263 iint->readcount--; 264 264 mutex_unlock(&iint->mutex); 265 + 266 + kref_put(&iint->refcount, iint_free); 265 267 } 266 268 267 269 /* ··· 293 291 if (file->f_mode & FMODE_WRITE) 294 292 iint->writecount++; 295 293 mutex_unlock(&iint->mutex); 294 + 295 + kref_put(&iint->refcount, iint_free); 296 296 } 297 297 EXPORT_SYMBOL_GPL(ima_counts_get); 298 298
+8 -31
sound/core/pcm_lib.c
··· 943 943 int snd_interval_list(struct snd_interval *i, unsigned int count, unsigned int *list, unsigned int mask) 944 944 { 945 945 unsigned int k; 946 - int changed = 0; 946 + struct snd_interval list_range; 947 947 948 948 if (!count) { 949 949 i->empty = 1; 950 950 return -EINVAL; 951 951 } 952 + snd_interval_any(&list_range); 953 + list_range.min = UINT_MAX; 954 + list_range.max = 0; 952 955 for (k = 0; k < count; k++) { 953 956 if (mask && !(mask & (1 << k))) 954 957 continue; 955 - if (i->min == list[k] && !i->openmin) 956 - goto _l1; 957 - if (i->min < list[k]) { 958 - i->min = list[k]; 959 - i->openmin = 0; 960 - changed = 1; 961 - goto _l1; 962 - } 963 - } 964 - i->empty = 1; 965 - return -EINVAL; 966 - _l1: 967 - for (k = count; k-- > 0;) { 968 - if (mask && !(mask & (1 << k))) 958 + if (!snd_interval_test(i, list[k])) 969 959 continue; 970 - if (i->max == list[k] && !i->openmax) 971 - goto _l2; 972 - if (i->max > list[k]) { 973 - i->max = list[k]; 974 - i->openmax = 0; 975 - changed = 1; 976 - goto _l2; 977 - } 960 + list_range.min = min(list_range.min, list[k]); 961 + list_range.max = max(list_range.max, list[k]); 978 962 } 979 - i->empty = 1; 980 - return -EINVAL; 981 - _l2: 982 - if (snd_interval_checkempty(i)) { 983 - i->empty = 1; 984 - return -EINVAL; 985 - } 986 - return changed; 963 + return snd_interval_refine(i, &list_range); 987 964 } 988 965 989 966 EXPORT_SYMBOL(snd_interval_list);
+12 -6
sound/pci/ali5451/ali5451.c
··· 310 310 unsigned int res; 311 311 312 312 end_time = jiffies + msecs_to_jiffies(250); 313 - do { 313 + 314 + for (;;) { 314 315 res = snd_ali_5451_peek(codec,port); 315 316 if (!(res & 0x8000)) 316 317 return 0; 318 + if (!time_after_eq(end_time, jiffies)) 319 + break; 317 320 schedule_timeout_uninterruptible(1); 318 - } while (time_after_eq(end_time, jiffies)); 321 + } 322 + 319 323 snd_ali_5451_poke(codec, port, res & ~0x8000); 320 324 snd_printdd("ali_codec_ready: codec is not ready.\n "); 321 325 return -EIO; ··· 331 327 unsigned long dwChk1,dwChk2; 332 328 333 329 dwChk1 = snd_ali_5451_peek(codec, ALI_STIMER); 334 - dwChk2 = snd_ali_5451_peek(codec, ALI_STIMER); 335 - 336 330 end_time = jiffies + msecs_to_jiffies(250); 337 - do { 331 + 332 + for (;;) { 338 333 dwChk2 = snd_ali_5451_peek(codec, ALI_STIMER); 339 334 if (dwChk2 != dwChk1) 340 335 return 0; 336 + if (!time_after_eq(end_time, jiffies)) 337 + break; 341 338 schedule_timeout_uninterruptible(1); 342 - } while (time_after_eq(end_time, jiffies)); 339 + } 340 + 343 341 snd_printk(KERN_ERR "ali_stimer_read: stimer is not ready.\n"); 344 342 return -EIO; 345 343 }
+4 -2
sound/pci/hda/patch_analog.c
··· 3835 3835 /* Port-F (int speaker) mixer - route only from analog mixer */ 3836 3836 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)}, 3837 3837 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(1)}, 3838 - /* Port-F pin */ 3839 - {0x16, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP}, 3838 + /* Port-F (int speaker) pin */ 3839 + {0x16, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT}, 3840 3840 {0x16, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE}, 3841 + /* required for compaq 6530s/6531s speaker output */ 3842 + {0x1c, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT}, 3841 3843 /* Port-C pin - internal mic-in */ 3842 3844 {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80}, 3843 3845 {0x14, AC_VERB_SET_AMP_GAIN_MUTE, 0x7002}, /* raise mic as default */
+33 -16
sound/pci/hda/patch_realtek.c
··· 6423 6423 }; 6424 6424 6425 6425 /* 6426 - * 6ch mode 6426 + * 4ch mode 6427 6427 */ 6428 - static struct hda_verb alc885_mbp_ch6_init[] = { 6428 + static struct hda_verb alc885_mbp_ch4_init[] = { 6429 6429 { 0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT }, 6430 6430 { 0x1a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE}, 6431 6431 { 0x1a, AC_VERB_SET_CONNECT_SEL, 0x01 }, ··· 6434 6434 { } /* end */ 6435 6435 }; 6436 6436 6437 - static struct hda_channel_mode alc885_mbp_6ch_modes[2] = { 6437 + static struct hda_channel_mode alc885_mbp_4ch_modes[2] = { 6438 6438 { 2, alc885_mbp_ch2_init }, 6439 - { 6, alc885_mbp_ch6_init }, 6439 + { 4, alc885_mbp_ch4_init }, 6440 6440 }; 6441 6441 6442 6442 /* ··· 6497 6497 }; 6498 6498 6499 6499 static struct snd_kcontrol_new alc885_mbp3_mixer[] = { 6500 - HDA_CODEC_VOLUME("Front Playback Volume", 0x0c, 0x00, HDA_OUTPUT), 6501 - HDA_BIND_MUTE ("Front Playback Switch", 0x0c, 0x02, HDA_INPUT), 6502 - HDA_CODEC_MUTE ("Speaker Playback Switch", 0x14, 0x00, HDA_OUTPUT), 6503 - HDA_CODEC_VOLUME("Line-Out Playback Volume", 0x0d, 0x00, HDA_OUTPUT), 6500 + HDA_CODEC_VOLUME("Speaker Playback Volume", 0x0c, 0x00, HDA_OUTPUT), 6501 + HDA_BIND_MUTE ("Speaker Playback Switch", 0x0c, 0x02, HDA_INPUT), 6502 + HDA_CODEC_VOLUME("Headphone Playback Volume", 0x0e, 0x00, HDA_OUTPUT), 6503 + HDA_BIND_MUTE ("Headphone Playback Switch", 0x0e, 0x02, HDA_INPUT), 6504 + HDA_CODEC_VOLUME("Surround Playback Volume", 0x0d, 0x00, HDA_OUTPUT), 6504 6505 HDA_CODEC_VOLUME("Line Playback Volume", 0x0b, 0x02, HDA_INPUT), 6505 6506 HDA_CODEC_MUTE ("Line Playback Switch", 0x0b, 0x02, HDA_INPUT), 6506 6507 HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x00, HDA_INPUT), ··· 6815 6814 {0x0d, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_ZERO}, 6816 6815 {0x0d, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)}, 6817 6816 {0x0d, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)}, 6817 + /* HP mixer */ 6818 + {0x0e, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_ZERO}, 6819 + {0x0e, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)}, 6820 + {0x0e, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)}, 6818 6821 /* Front Pin: output 0 (0x0c) */ 6819 6822 {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT}, 6820 6823 {0x14, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE}, 6821 6824 {0x14, AC_VERB_SET_CONNECT_SEL, 0x00}, 6822 - /* HP Pin: output 0 (0x0d) */ 6825 + /* HP Pin: output 0 (0x0e) */ 6823 6826 {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, 0xc4}, 6824 - {0x15, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE}, 6825 - {0x15, AC_VERB_SET_CONNECT_SEL, 0x00}, 6827 + {0x15, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE}, 6828 + {0x15, AC_VERB_SET_CONNECT_SEL, 0x02}, 6826 6829 {0x15, AC_VERB_SET_UNSOLICITED_ENABLE, ALC880_HP_EVENT | AC_USRSP_EN}, 6827 6830 /* Mic (rear) pin: input vref at 80% */ 6828 6831 {0x18, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80}, ··· 7200 7195 .mixers = { alc885_mbp3_mixer, alc882_chmode_mixer }, 7201 7196 .init_verbs = { alc885_mbp3_init_verbs, 7202 7197 alc880_gpio1_init_verbs }, 7203 - .num_dacs = ARRAY_SIZE(alc882_dac_nids), 7198 + .num_dacs = 2, 7204 7199 .dac_nids = alc882_dac_nids, 7205 - .channel_mode = alc885_mbp_6ch_modes, 7206 - .num_channel_mode = ARRAY_SIZE(alc885_mbp_6ch_modes), 7200 + .hp_nid = 0x04, 7201 + .channel_mode = alc885_mbp_4ch_modes, 7202 + .num_channel_mode = ARRAY_SIZE(alc885_mbp_4ch_modes), 7207 7203 .input_mux = &alc882_capture_source, 7208 7204 .dig_out_nid = ALC882_DIGOUT_NID, 7209 7205 .dig_in_nid = ALC882_DIGIN_NID, ··· 12527 12521 ALC268_TOSHIBA), 12528 12522 SND_PCI_QUIRK(0x1043, 0x1205, "ASUS W7J", ALC268_3ST), 12529 12523 SND_PCI_QUIRK(0x1170, 0x0040, "ZEPTO", ALC268_ZEPTO), 12530 - SND_PCI_QUIRK_MASK(0x1179, 0xff00, 0xff00, "TOSHIBA A/Lx05", 12531 - ALC268_TOSHIBA), 12532 12524 SND_PCI_QUIRK(0x14c0, 0x0025, "COMPAL IFL90/JFL-92", ALC268_TOSHIBA), 12533 12525 SND_PCI_QUIRK(0x152d, 0x0763, "Diverse (CPR2000)", ALC268_ACER), 12534 12526 SND_PCI_QUIRK(0x152d, 0x0771, "Quanta IL1", ALC267_QUANTA_IL1), 12535 12527 SND_PCI_QUIRK(0x1854, 0x1775, "LG R510", ALC268_DELL), 12528 + {} 12529 + }; 12530 + 12531 + /* Toshiba laptops have no unique PCI SSID but only codec SSID */ 12532 + static struct snd_pci_quirk alc268_ssid_cfg_tbl[] = { 12533 + SND_PCI_QUIRK(0x1179, 0xff0a, "TOSHIBA X-200", ALC268_AUTO), 12534 + SND_PCI_QUIRK(0x1179, 0xff0e, "TOSHIBA X-200 HDMI", ALC268_AUTO), 12535 + SND_PCI_QUIRK_MASK(0x1179, 0xff00, 0xff00, "TOSHIBA A/Lx05", 12536 + ALC268_TOSHIBA), 12536 12537 {} 12537 12538 }; 12538 12539 ··· 12708 12695 board_config = snd_hda_check_board_config(codec, ALC268_MODEL_LAST, 12709 12696 alc268_models, 12710 12697 alc268_cfg_tbl); 12698 + 12699 + if (board_config < 0 || board_config >= ALC268_MODEL_LAST) 12700 + board_config = snd_hda_check_board_codec_sid_config(codec, 12701 + ALC882_MODEL_LAST, alc268_models, alc268_ssid_cfg_tbl); 12711 12702 12712 12703 if (board_config < 0 || board_config >= ALC268_MODEL_LAST) { 12713 12704 printk(KERN_INFO "hda_codec: Unknown model for %s, "
+6
sound/pci/hda/patch_sigmatel.c
··· 76 76 STAC_92HD73XX_AUTO, 77 77 STAC_92HD73XX_NO_JD, /* no jack-detection */ 78 78 STAC_92HD73XX_REF, 79 + STAC_92HD73XX_INTEL, 79 80 STAC_DELL_M6_AMIC, 80 81 STAC_DELL_M6_DMIC, 81 82 STAC_DELL_M6_BOTH, ··· 1778 1777 [STAC_92HD73XX_AUTO] = "auto", 1779 1778 [STAC_92HD73XX_NO_JD] = "no-jd", 1780 1779 [STAC_92HD73XX_REF] = "ref", 1780 + [STAC_92HD73XX_INTEL] = "intel", 1781 1781 [STAC_DELL_M6_AMIC] = "dell-m6-amic", 1782 1782 [STAC_DELL_M6_DMIC] = "dell-m6-dmic", 1783 1783 [STAC_DELL_M6_BOTH] = "dell-m6", ··· 1791 1789 "DFI LanParty", STAC_92HD73XX_REF), 1792 1790 SND_PCI_QUIRK(PCI_VENDOR_ID_DFI, 0x3101, 1793 1791 "DFI LanParty", STAC_92HD73XX_REF), 1792 + SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x5002, 1793 + "Intel DG45ID", STAC_92HD73XX_INTEL), 1794 + SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x5003, 1795 + "Intel DG45FC", STAC_92HD73XX_INTEL), 1794 1796 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x0254, 1795 1797 "Dell Studio 1535", STAC_DELL_M6_DMIC), 1796 1798 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x0255,
+1
sound/pci/hda/patch_via.c
··· 1395 1395 if (!spec->adc_nids && spec->input_mux) { 1396 1396 spec->adc_nids = vt1708_adc_nids; 1397 1397 spec->num_adc_nids = ARRAY_SIZE(vt1708_adc_nids); 1398 + get_mux_nids(codec); 1398 1399 spec->mixers[spec->num_mixers] = vt1708_capture_mixer; 1399 1400 spec->num_mixers++; 1400 1401 }
+2 -2
sound/pci/vx222/vx222_ops.c
··· 885 885 struct vx_core *_chip = snd_kcontrol_chip(kcontrol); 886 886 struct snd_vx222 *chip = (struct snd_vx222 *)_chip; 887 887 if (ucontrol->value.integer.value[0] < 0 || 888 - ucontrol->value.integer.value[0] < MIC_LEVEL_MAX) 888 + ucontrol->value.integer.value[0] > MIC_LEVEL_MAX) 889 889 return -EINVAL; 890 890 if (ucontrol->value.integer.value[1] < 0 || 891 - ucontrol->value.integer.value[1] < MIC_LEVEL_MAX) 891 + ucontrol->value.integer.value[1] > MIC_LEVEL_MAX) 892 892 return -EINVAL; 893 893 mutex_lock(&_chip->mixer_mutex); 894 894 if (chip->input_level[0] != ucontrol->value.integer.value[0] ||
+7
tools/perf/builtin-annotate.c
··· 31 31 static char default_sort_order[] = "comm,symbol"; 32 32 static char *sort_order = default_sort_order; 33 33 34 + static int force; 34 35 static int input; 35 36 static int show_mask = SHOW_KERNEL | SHOW_USER | SHOW_HV; 36 37 ··· 1335 1334 exit(-1); 1336 1335 } 1337 1336 1337 + if (!force && (stat.st_uid != geteuid())) { 1338 + fprintf(stderr, "file: %s not owned by current user\n", input_name); 1339 + exit(-1); 1340 + } 1341 + 1338 1342 if (!stat.st_size) { 1339 1343 fprintf(stderr, "zero-sized file, nothing to do!\n"); 1340 1344 exit(0); ··· 1445 1439 "input file name"), 1446 1440 OPT_STRING('s', "symbol", &sym_hist_filter, "symbol", 1447 1441 "symbol to annotate"), 1442 + OPT_BOOLEAN('f', "force", &force, "don't complain, do it"), 1448 1443 OPT_BOOLEAN('v', "verbose", &verbose, 1449 1444 "be more verbose (show symbol address, etc)"), 1450 1445 OPT_BOOLEAN('D', "dump-raw-trace", &dump_trace,
+7
tools/perf/builtin-report.c
··· 38 38 static struct strlist *dso_list, *comm_list, *sym_list; 39 39 static char *field_sep; 40 40 41 + static int force; 41 42 static int input; 42 43 static int show_mask = SHOW_KERNEL | SHOW_USER | SHOW_HV; 43 44 ··· 1857 1856 exit(-1); 1858 1857 } 1859 1858 1859 + if (!force && (stat.st_uid != geteuid())) { 1860 + fprintf(stderr, "file: %s not owned by current user\n", input_name); 1861 + exit(-1); 1862 + } 1863 + 1860 1864 if (!stat.st_size) { 1861 1865 fprintf(stderr, "zero-sized file, nothing to do!\n"); 1862 1866 exit(0); ··· 2070 2064 OPT_BOOLEAN('D', "dump-raw-trace", &dump_trace, 2071 2065 "dump raw trace in ASCII"), 2072 2066 OPT_STRING('k', "vmlinux", &vmlinux, "file", "vmlinux pathname"), 2067 + OPT_BOOLEAN('f', "force", &force, "don't complain, do it"), 2073 2068 OPT_BOOLEAN('m', "modules", &modules, 2074 2069 "load module symbols - WARNING: use only with -k and LIVE kernel"), 2075 2070 OPT_BOOLEAN('n', "show-nr-samples", &show_nr_samples,