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

Merge commit 'v2.6.38-rc2' into topic/misc

+6877 -6702
+1 -1
Documentation/DocBook/dvb/dvbapi.xml
··· 28 28 <holder>Convergence GmbH</holder> 29 29 </copyright> 30 30 <copyright> 31 - <year>2009-2010</year> 31 + <year>2009-2011</year> 32 32 <holder>Mauro Carvalho Chehab</holder> 33 33 </copyright> 34 34
+2 -2
Documentation/DocBook/media.tmpl
··· 28 28 <title>LINUX MEDIA INFRASTRUCTURE API</title> 29 29 30 30 <copyright> 31 - <year>2009-2010</year> 31 + <year>2009-2011</year> 32 32 <holder>LinuxTV Developers</holder> 33 33 </copyright> 34 34 ··· 86 86 </author> 87 87 </authorgroup> 88 88 <copyright> 89 - <year>2009-2010</year> 89 + <year>2009-2011</year> 90 90 <holder>Mauro Carvalho Chehab</holder> 91 91 </copyright> 92 92
+4 -2
Documentation/DocBook/v4l/dev-rds.xml
··· 75 75 </section> 76 76 77 77 <section> 78 + <title>RDS datastructures</title> 78 79 <table frame="none" pgwide="1" id="v4l2-rds-data"> 79 80 <title>struct 80 81 <structname>v4l2_rds_data</structname></title> ··· 130 129 131 130 <table frame="none" pgwide="1" id="v4l2-rds-block-codes"> 132 131 <title>Block defines</title> 133 - <tgroup cols="3"> 132 + <tgroup cols="4"> 134 133 <colspec colname="c1" colwidth="1*" /> 135 134 <colspec colname="c2" colwidth="1*" /> 136 - <colspec colname="c3" colwidth="5*" /> 135 + <colspec colname="c3" colwidth="1*" /> 136 + <colspec colname="c4" colwidth="5*" /> 137 137 <tbody valign="top"> 138 138 <row> 139 139 <entry>V4L2_RDS_BLOCK_MSK</entry>
+2 -1
Documentation/DocBook/v4l/v4l2.xml
··· 100 100 <year>2008</year> 101 101 <year>2009</year> 102 102 <year>2010</year> 103 + <year>2011</year> 103 104 <holder>Bill Dirks, Michael H. Schimek, Hans Verkuil, Martin 104 105 Rubli, Andy Walls, Muralidharan Karicheri, Mauro Carvalho Chehab</holder> 105 106 </copyright> ··· 382 381 </partinfo> 383 382 384 383 <title>Video for Linux Two API Specification</title> 385 - <subtitle>Revision 2.6.33</subtitle> 384 + <subtitle>Revision 2.6.38</subtitle> 386 385 387 386 <chapter id="common"> 388 387 &sub-common;
-8
Documentation/feature-removal-schedule.txt
··· 357 357 358 358 ----------------------------- 359 359 360 - What: __do_IRQ all in one fits nothing interrupt handler 361 - When: 2.6.32 362 - Why: __do_IRQ was kept for easy migration to the type flow handlers. 363 - More than two years of migration time is enough. 364 - Who: Thomas Gleixner <tglx@linutronix.de> 365 - 366 - ----------------------------- 367 - 368 360 What: fakephp and associated sysfs files in /sys/bus/pci/slots/ 369 361 When: 2011 370 362 Why: In 2.6.27, the semantics of /sys/bus/pci/slots was redefined to
+65 -8
Documentation/lguest/lguest.c
··· 39 39 #include <limits.h> 40 40 #include <stddef.h> 41 41 #include <signal.h> 42 + #include <pwd.h> 43 + #include <grp.h> 44 + 42 45 #include <linux/virtio_config.h> 43 46 #include <linux/virtio_net.h> 44 47 #include <linux/virtio_blk.h> ··· 301 298 302 299 /* 303 300 * We use a private mapping (ie. if we write to the page, it will be 304 - * copied). 301 + * copied). We allocate an extra two pages PROT_NONE to act as guard 302 + * pages against read/write attempts that exceed allocated space. 305 303 */ 306 - addr = mmap(NULL, getpagesize() * num, 307 - PROT_READ|PROT_WRITE|PROT_EXEC, MAP_PRIVATE, fd, 0); 304 + addr = mmap(NULL, getpagesize() * (num+2), 305 + PROT_NONE, MAP_PRIVATE, fd, 0); 306 + 308 307 if (addr == MAP_FAILED) 309 308 err(1, "Mmapping %u pages of /dev/zero", num); 309 + 310 + if (mprotect(addr + getpagesize(), getpagesize() * num, 311 + PROT_READ|PROT_WRITE) == -1) 312 + err(1, "mprotect rw %u pages failed", num); 310 313 311 314 /* 312 315 * One neat mmap feature is that you can close the fd, and it ··· 320 311 */ 321 312 close(fd); 322 313 323 - return addr; 314 + /* Return address after PROT_NONE page */ 315 + return addr + getpagesize(); 324 316 } 325 317 326 318 /* Get some more pages for a device. */ ··· 353 343 * done to it. This allows us to share untouched memory between 354 344 * Guests. 355 345 */ 356 - if (mmap(addr, len, PROT_READ|PROT_WRITE|PROT_EXEC, 346 + if (mmap(addr, len, PROT_READ|PROT_WRITE, 357 347 MAP_FIXED|MAP_PRIVATE, fd, offset) != MAP_FAILED) 358 348 return; 359 349 ··· 583 573 unsigned int line) 584 574 { 585 575 /* 586 - * We have to separately check addr and addr+size, because size could 587 - * be huge and addr + size might wrap around. 576 + * Check if the requested address and size exceeds the allocated memory, 577 + * or addr + size wraps around. 588 578 */ 589 - if (addr >= guest_limit || addr + size >= guest_limit) 579 + if ((addr + size) > guest_limit || (addr + size) < addr) 590 580 errx(1, "%s:%i: Invalid address %#lx", __FILE__, line, addr); 591 581 /* 592 582 * We return a pointer for the caller's convenience, now we know it's ··· 1882 1872 { "block", 1, NULL, 'b' }, 1883 1873 { "rng", 0, NULL, 'r' }, 1884 1874 { "initrd", 1, NULL, 'i' }, 1875 + { "username", 1, NULL, 'u' }, 1876 + { "chroot", 1, NULL, 'c' }, 1885 1877 { NULL }, 1886 1878 }; 1887 1879 static void usage(void) ··· 1905 1893 struct boot_params *boot; 1906 1894 /* If they specify an initrd file to load. */ 1907 1895 const char *initrd_name = NULL; 1896 + 1897 + /* Password structure for initgroups/setres[gu]id */ 1898 + struct passwd *user_details = NULL; 1899 + 1900 + /* Directory to chroot to */ 1901 + char *chroot_path = NULL; 1908 1902 1909 1903 /* Save the args: we "reboot" by execing ourselves again. */ 1910 1904 main_args = argv; ··· 1967 1949 break; 1968 1950 case 'i': 1969 1951 initrd_name = optarg; 1952 + break; 1953 + case 'u': 1954 + user_details = getpwnam(optarg); 1955 + if (!user_details) 1956 + err(1, "getpwnam failed, incorrect username?"); 1957 + break; 1958 + case 'c': 1959 + chroot_path = optarg; 1970 1960 break; 1971 1961 default: 1972 1962 warnx("Unknown argument %s", argv[optind]); ··· 2046 2020 2047 2021 /* If we exit via err(), this kills all the threads, restores tty. */ 2048 2022 atexit(cleanup_devices); 2023 + 2024 + /* If requested, chroot to a directory */ 2025 + if (chroot_path) { 2026 + if (chroot(chroot_path) != 0) 2027 + err(1, "chroot(\"%s\") failed", chroot_path); 2028 + 2029 + if (chdir("/") != 0) 2030 + err(1, "chdir(\"/\") failed"); 2031 + 2032 + verbose("chroot done\n"); 2033 + } 2034 + 2035 + /* If requested, drop privileges */ 2036 + if (user_details) { 2037 + uid_t u; 2038 + gid_t g; 2039 + 2040 + u = user_details->pw_uid; 2041 + g = user_details->pw_gid; 2042 + 2043 + if (initgroups(user_details->pw_name, g) != 0) 2044 + err(1, "initgroups failed"); 2045 + 2046 + if (setresgid(g, g, g) != 0) 2047 + err(1, "setresgid failed"); 2048 + 2049 + if (setresuid(u, u, u) != 0) 2050 + err(1, "setresuid failed"); 2051 + 2052 + verbose("Dropping privileges completed\n"); 2053 + } 2049 2054 2050 2055 /* Finally, run the Guest. This doesn't return. */ 2051 2056 run_guest();
+5
Documentation/lguest/lguest.txt
··· 117 117 118 118 for general information on how to get bridging to work. 119 119 120 + - Random number generation. Using the --rng option will provide a 121 + /dev/hwrng in the guest that will read from the host's /dev/random. 122 + Use this option in conjunction with rng-tools (see ../hw_random.txt) 123 + to provide entropy to the guest kernel's /dev/random. 124 + 120 125 There is a helpful mailing list at http://ozlabs.org/mailman/listinfo/lguest 121 126 122 127 Good luck!
+12
Documentation/video4linux/v4l2-controls.txt
··· 285 285 The 'new value' union is not used in g_volatile_ctrl. In general controls 286 286 that need to implement g_volatile_ctrl are read-only controls. 287 287 288 + Note that if one or more controls in a control cluster are marked as volatile, 289 + then all the controls in the cluster are seen as volatile. 290 + 288 291 To mark a control as volatile you have to set the is_volatile flag: 289 292 290 293 ctrl = v4l2_ctrl_new_std(&sd->ctrl_handler, ...); ··· 464 461 465 462 Obviously, all controls in the cluster array must be initialized to either 466 463 a valid control or to NULL. 464 + 465 + In rare cases you might want to know which controls of a cluster actually 466 + were set explicitly by the user. For this you can check the 'is_new' flag of 467 + each control. For example, in the case of a volume/mute cluster the 'is_new' 468 + flag of the mute control would be set if the user called VIDIOC_S_CTRL for 469 + mute only. If the user would call VIDIOC_S_EXT_CTRLS for both mute and volume 470 + controls, then the 'is_new' flag would be 1 for both controls. 471 + 472 + The 'is_new' flag is always 1 when called from v4l2_ctrl_handler_setup(). 467 473 468 474 469 475 VIDIOC_LOG_STATUS Support
+32 -28
MAINTAINERS
··· 162 162 W: http://serial.sourceforge.net 163 163 S: Maintained 164 164 T: git git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty-2.6.git 165 - F: drivers/serial/8250* 165 + F: drivers/tty/serial/8250* 166 166 F: include/linux/serial_8250.h 167 167 168 168 8390 NETWORK DRIVERS [WD80x3/SMC-ELITE, SMC-ULTRA, NE2000, 3C503, etc.] ··· 624 624 L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers) 625 625 S: Maintained 626 626 627 - ARM/ATMEL AT91RM9200 ARM ARCHITECTURE 627 + ARM/ATMEL AT91RM9200 AND AT91SAM ARM ARCHITECTURES 628 628 M: Andrew Victor <linux@maxim.org.za> 629 + M: Nicolas Ferre <nicolas.ferre@atmel.com> 630 + M: Jean-Christophe Plagniol-Villard <plagnioj@jcrosoft.com> 629 631 L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers) 630 632 W: http://maxim.org.za/at91_26.html 631 - S: Maintained 633 + W: http://www.linux4sam.org 634 + S: Supported 635 + F: arch/arm/mach-at91/ 632 636 633 637 ARM/BCMRING ARM ARCHITECTURE 634 638 M: Jiandong Zheng <jdzheng@broadcom.com> ··· 892 888 F: drivers/video/msm/ 893 889 F: drivers/mmc/host/msm_sdcc.c 894 890 F: drivers/mmc/host/msm_sdcc.h 895 - F: drivers/serial/msm_serial.h 896 - F: drivers/serial/msm_serial.c 891 + F: drivers/tty/serial/msm_serial.h 892 + F: drivers/tty/serial/msm_serial.c 897 893 T: git git://codeaurora.org/quic/kernel/davidb/linux-msm.git 898 894 S: Maintained 899 895 ··· 1260 1256 ATMEL AT91 / AT32 SERIAL DRIVER 1261 1257 M: Nicolas Ferre <nicolas.ferre@atmel.com> 1262 1258 S: Supported 1263 - F: drivers/serial/atmel_serial.c 1259 + F: drivers/tty/serial/atmel_serial.c 1264 1260 1265 1261 ATMEL LCDFB DRIVER 1266 1262 M: Nicolas Ferre <nicolas.ferre@atmel.com> ··· 1416 1412 L: uclinux-dist-devel@blackfin.uclinux.org 1417 1413 W: http://blackfin.uclinux.org 1418 1414 S: Supported 1419 - F: drivers/serial/bfin_5xx.c 1415 + F: drivers/tty/serial/bfin_5xx.c 1420 1416 1421 1417 BLACKFIN WATCHDOG DRIVER 1422 1418 M: Mike Frysinger <vapier.adi@gmail.com> ··· 1881 1877 W: http://developer.axis.com 1882 1878 S: Maintained 1883 1879 F: arch/cris/ 1884 - F: drivers/serial/crisv10.* 1880 + F: drivers/tty/serial/crisv10.* 1885 1881 1886 1882 CRYPTO API 1887 1883 M: Herbert Xu <herbert@gondor.apana.org.au> ··· 2220 2216 DZ DECSTATION DZ11 SERIAL DRIVER 2221 2217 M: "Maciej W. Rozycki" <macro@linux-mips.org> 2222 2218 S: Maintained 2223 - F: drivers/serial/dz.* 2219 + F: drivers/tty/serial/dz.* 2224 2220 2225 2221 EATA-DMA SCSI DRIVER 2226 2222 M: Michael Neuffer <mike@i-Connect.Net> ··· 2647 2643 M: Timur Tabi <timur@freescale.com> 2648 2644 L: linuxppc-dev@lists.ozlabs.org 2649 2645 S: Supported 2650 - F: drivers/serial/ucc_uart.c 2646 + F: drivers/tty/serial/ucc_uart.c 2651 2647 2652 2648 FREESCALE SOC SOUND DRIVERS 2653 2649 M: Timur Tabi <timur@freescale.com> ··· 3150 3146 F: drivers/video/imsttfb.c 3151 3147 3152 3148 INFINIBAND SUBSYSTEM 3153 - M: Roland Dreier <rolandd@cisco.com> 3149 + M: Roland Dreier <roland@kernel.org> 3154 3150 M: Sean Hefty <sean.hefty@intel.com> 3155 3151 M: Hal Rosenstock <hal.rosenstock@gmail.com> 3156 3152 L: linux-rdma@vger.kernel.org ··· 3354 3350 M: Pat Gefre <pfg@sgi.com> 3355 3351 L: linux-serial@vger.kernel.org 3356 3352 S: Maintained 3357 - F: drivers/serial/ioc3_serial.c 3353 + F: drivers/tty/serial/ioc3_serial.c 3358 3354 3359 3355 IP MASQUERADING 3360 3356 M: Juanjo Ciarlante <jjciarla@raiz.uncu.edu.ar> ··· 3531 3527 M: Breno Leitao <leitao@linux.vnet.ibm.com> 3532 3528 L: linux-serial@vger.kernel.org 3533 3529 S: Maintained 3534 - F: drivers/serial/jsm/ 3530 + F: drivers/tty/serial/jsm/ 3535 3531 3536 3532 K10TEMP HARDWARE MONITORING DRIVER 3537 3533 M: Clemens Ladisch <clemens@ladisch.de> ··· 3681 3677 S: Maintained 3682 3678 F: Documentation/DocBook/kgdb.tmpl 3683 3679 F: drivers/misc/kgdbts.c 3684 - F: drivers/serial/kgdboc.c 3680 + F: drivers/tty/serial/kgdboc.c 3685 3681 F: include/linux/kdb.h 3686 3682 F: include/linux/kgdb.h 3687 3683 F: kernel/debug/ ··· 5549 5545 L: linux-ia64@vger.kernel.org 5550 5546 S: Supported 5551 5547 F: Documentation/ia64/serial.txt 5552 - F: drivers/serial/ioc?_serial.c 5548 + F: drivers/tty/serial/ioc?_serial.c 5553 5549 F: include/linux/ioc?.h 5554 5550 5555 5551 SGI VISUAL WORKSTATION 320 AND 540 ··· 5571 5567 S: Maintained 5572 5568 F: Documentation/arm/Sharp-LH/ADC-LH7-Touchscreen 5573 5569 F: arch/arm/mach-lh7a40x/ 5574 - F: drivers/serial/serial_lh7a40x.c 5570 + F: drivers/tty/serial/serial_lh7a40x.c 5575 5571 F: drivers/usb/gadget/lh7a40* 5576 5572 F: drivers/usb/host/ohci-lh7a40* 5577 5573 ··· 5791 5787 T: git git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc-2.6.git 5792 5788 T: git git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc-next-2.6.git 5793 5789 S: Maintained 5794 - F: drivers/serial/suncore.c 5795 - F: drivers/serial/suncore.h 5796 - F: drivers/serial/sunhv.c 5797 - F: drivers/serial/sunsab.c 5798 - F: drivers/serial/sunsab.h 5799 - F: drivers/serial/sunsu.c 5800 - F: drivers/serial/sunzilog.c 5801 - F: drivers/serial/sunzilog.h 5790 + F: drivers/tty/serial/suncore.c 5791 + F: drivers/tty/serial/suncore.h 5792 + F: drivers/tty/serial/sunhv.c 5793 + F: drivers/tty/serial/sunsab.c 5794 + F: drivers/tty/serial/sunsab.h 5795 + F: drivers/tty/serial/sunsu.c 5796 + F: drivers/tty/serial/sunzilog.c 5797 + F: drivers/tty/serial/sunzilog.h 5802 5798 5803 5799 SPEAR PLATFORM SUPPORT 5804 5800 M: Viresh Kumar <viresh.kumar@st.com> ··· 6128 6124 M: Greg Kroah-Hartman <gregkh@suse.de> 6129 6125 S: Maintained 6130 6126 T: git git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty-2.6.git 6131 - F: drivers/char/tty_* 6132 - F: drivers/serial/serial_core.c 6127 + F: drivers/tty/* 6128 + F: drivers/tty/serial/serial_core.c 6133 6129 F: include/linux/serial_core.h 6134 6130 F: include/linux/serial.h 6135 6131 F: include/linux/tty.h ··· 6874 6870 M: Peter Korsgaard <jacmet@sunsite.dk> 6875 6871 L: linux-serial@vger.kernel.org 6876 6872 S: Maintained 6877 - F: drivers/serial/uartlite.c 6873 + F: drivers/tty/serial/uartlite.c 6878 6874 6879 6875 YAM DRIVER FOR AX.25 6880 6876 M: Jean-Paul Roubelat <jpr@f6fbb.org> ··· 6920 6916 ZS DECSTATION Z85C30 SERIAL DRIVER 6921 6917 M: "Maciej W. Rozycki" <macro@linux-mips.org> 6922 6918 S: Maintained 6923 - F: drivers/serial/zs.* 6919 + F: drivers/tty/serial/zs.* 6924 6920 6925 6921 GRE DEMULTIPLEXER DRIVER 6926 6922 M: Dmitry Kozlov <xeb@mail.ru>
+1 -1
Makefile
··· 1 1 VERSION = 2 2 2 PATCHLEVEL = 6 3 3 SUBLEVEL = 38 4 - EXTRAVERSION = -rc1 4 + EXTRAVERSION = -rc2 5 5 NAME = Flesh-Eating Bats with Fangs 6 6 7 7 # *DOCUMENTATION*
+3 -16
arch/alpha/Kconfig
··· 8 8 select HAVE_IRQ_WORK 9 9 select HAVE_PERF_EVENTS 10 10 select HAVE_DMA_ATTRS 11 + select HAVE_GENERIC_HARDIRQS 12 + select GENERIC_IRQ_PROBE 13 + select AUTO_IRQ_AFFINITY if SMP 11 14 help 12 15 The Alpha is a 64-bit general-purpose processor designed and 13 16 marketed by the Digital Equipment Corporation of blessed memory, ··· 70 67 config GENERIC_IOMAP 71 68 bool 72 69 default n 73 - 74 - config GENERIC_HARDIRQS_NO__DO_IRQ 75 - def_bool y 76 - 77 - config GENERIC_HARDIRQS 78 - bool 79 - default y 80 - 81 - config GENERIC_IRQ_PROBE 82 - bool 83 - default y 84 - 85 - config AUTO_IRQ_AFFINITY 86 - bool 87 - depends on SMP 88 - default y 89 70 90 71 source "init/Kconfig" 91 72 source "kernel/Kconfig.freezer"
+1 -1
arch/arm/configs/ag5evm_defconfig
··· 10 10 # CONFIG_PID_NS is not set 11 11 CONFIG_BLK_DEV_INITRD=y 12 12 CONFIG_INITRAMFS_SOURCE="" 13 - CONFIG_EMBEDDED=y 13 + CONFIG_EXPERT=y 14 14 CONFIG_SLAB=y 15 15 # CONFIG_BLK_DEV_BSG is not set 16 16 # CONFIG_IOSCHED_DEADLINE is not set
+1 -1
arch/arm/configs/am200epdkit_defconfig
··· 3 3 # CONFIG_SWAP is not set 4 4 CONFIG_SYSVIPC=y 5 5 CONFIG_SYSFS_DEPRECATED_V2=y 6 - CONFIG_EMBEDDED=y 6 + CONFIG_EXPERT=y 7 7 # CONFIG_SYSCTL_SYSCALL is not set 8 8 # CONFIG_EPOLL is not set 9 9 # CONFIG_SHMEM is not set
+1 -1
arch/arm/configs/at572d940hfek_defconfig
··· 17 17 CONFIG_RELAY=y 18 18 CONFIG_BLK_DEV_INITRD=y 19 19 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 20 - CONFIG_EMBEDDED=y 20 + CONFIG_EXPERT=y 21 21 CONFIG_SLAB=y 22 22 CONFIG_PROFILING=y 23 23 CONFIG_OPROFILE=m
+1 -1
arch/arm/configs/badge4_defconfig
··· 1 1 CONFIG_EXPERIMENTAL=y 2 2 CONFIG_LOG_BUF_SHIFT=14 3 - CONFIG_EMBEDDED=y 3 + CONFIG_EXPERT=y 4 4 CONFIG_MODULES=y 5 5 CONFIG_MODVERSIONS=y 6 6 CONFIG_ARCH_SA1100=y
+1 -1
arch/arm/configs/bcmring_defconfig
··· 2 2 # CONFIG_LOCALVERSION_AUTO is not set 3 3 # CONFIG_SWAP is not set 4 4 CONFIG_SYSVIPC=y 5 - CONFIG_EMBEDDED=y 5 + CONFIG_EXPERT=y 6 6 CONFIG_KALLSYMS_EXTRA_PASS=y 7 7 # CONFIG_HOTPLUG is not set 8 8 # CONFIG_ELF_CORE is not set
+1 -1
arch/arm/configs/cm_x2xx_defconfig
··· 6 6 CONFIG_LOG_BUF_SHIFT=14 7 7 CONFIG_SYSFS_DEPRECATED_V2=y 8 8 CONFIG_BLK_DEV_INITRD=y 9 - CONFIG_EMBEDDED=y 9 + CONFIG_EXPERT=y 10 10 # CONFIG_VM_EVENT_COUNTERS is not set 11 11 # CONFIG_SLUB_DEBUG is not set 12 12 # CONFIG_COMPAT_BRK is not set
+1 -1
arch/arm/configs/colibri_pxa270_defconfig
··· 8 8 CONFIG_LOG_BUF_SHIFT=14 9 9 CONFIG_SYSFS_DEPRECATED_V2=y 10 10 CONFIG_BLK_DEV_INITRD=y 11 - CONFIG_EMBEDDED=y 11 + CONFIG_EXPERT=y 12 12 CONFIG_KALLSYMS_EXTRA_PASS=y 13 13 CONFIG_SLAB=y 14 14 CONFIG_MODULES=y
+1 -1
arch/arm/configs/collie_defconfig
··· 4 4 CONFIG_LOG_BUF_SHIFT=14 5 5 CONFIG_BLK_DEV_INITRD=y 6 6 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 7 - CONFIG_EMBEDDED=y 7 + CONFIG_EXPERT=y 8 8 # CONFIG_BASE_FULL is not set 9 9 # CONFIG_EPOLL is not set 10 10 CONFIG_SLOB=y
+1 -1
arch/arm/configs/corgi_defconfig
··· 4 4 CONFIG_LOG_BUF_SHIFT=14 5 5 CONFIG_SYSFS_DEPRECATED_V2=y 6 6 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 7 - CONFIG_EMBEDDED=y 7 + CONFIG_EXPERT=y 8 8 CONFIG_PROFILING=y 9 9 CONFIG_OPROFILE=m 10 10 CONFIG_MODULES=y
+1 -1
arch/arm/configs/da8xx_omapl_defconfig
··· 6 6 CONFIG_IKCONFIG_PROC=y 7 7 CONFIG_LOG_BUF_SHIFT=14 8 8 CONFIG_BLK_DEV_INITRD=y 9 - CONFIG_EMBEDDED=y 9 + CONFIG_EXPERT=y 10 10 CONFIG_MODULES=y 11 11 CONFIG_MODULE_UNLOAD=y 12 12 CONFIG_MODULE_FORCE_UNLOAD=y
+1 -1
arch/arm/configs/davinci_all_defconfig
··· 6 6 CONFIG_IKCONFIG_PROC=y 7 7 CONFIG_LOG_BUF_SHIFT=14 8 8 CONFIG_BLK_DEV_INITRD=y 9 - CONFIG_EMBEDDED=y 9 + CONFIG_EXPERT=y 10 10 CONFIG_MODULES=y 11 11 CONFIG_MODULE_UNLOAD=y 12 12 CONFIG_MODULE_FORCE_UNLOAD=y
+1 -1
arch/arm/configs/dove_defconfig
··· 1 1 CONFIG_EXPERIMENTAL=y 2 2 CONFIG_SYSVIPC=y 3 3 CONFIG_LOG_BUF_SHIFT=14 4 - CONFIG_EMBEDDED=y 4 + CONFIG_EXPERT=y 5 5 CONFIG_SLAB=y 6 6 CONFIG_MODULES=y 7 7 CONFIG_MODULE_UNLOAD=y
+1 -1
arch/arm/configs/ebsa110_defconfig
··· 2 2 CONFIG_SYSVIPC=y 3 3 CONFIG_BSD_PROCESS_ACCT=y 4 4 CONFIG_LOG_BUF_SHIFT=14 5 - CONFIG_EMBEDDED=y 5 + CONFIG_EXPERT=y 6 6 CONFIG_MODULES=y 7 7 CONFIG_ARCH_EBSA110=y 8 8 CONFIG_PCCARD=m
+1 -1
arch/arm/configs/edb7211_defconfig
··· 2 2 CONFIG_SYSVIPC=y 3 3 CONFIG_LOG_BUF_SHIFT=14 4 4 CONFIG_BLK_DEV_INITRD=y 5 - CONFIG_EMBEDDED=y 5 + CONFIG_EXPERT=y 6 6 # CONFIG_HOTPLUG is not set 7 7 CONFIG_ARCH_CLPS711X=y 8 8 CONFIG_ARCH_EDB7211=y
+1 -1
arch/arm/configs/em_x270_defconfig
··· 6 6 CONFIG_LOG_BUF_SHIFT=14 7 7 CONFIG_SYSFS_DEPRECATED_V2=y 8 8 CONFIG_BLK_DEV_INITRD=y 9 - CONFIG_EMBEDDED=y 9 + CONFIG_EXPERT=y 10 10 # CONFIG_VM_EVENT_COUNTERS is not set 11 11 # CONFIG_SLUB_DEBUG is not set 12 12 # CONFIG_COMPAT_BRK is not set
+1 -1
arch/arm/configs/ep93xx_defconfig
··· 4 4 CONFIG_IKCONFIG_PROC=y 5 5 CONFIG_LOG_BUF_SHIFT=14 6 6 CONFIG_SYSFS_DEPRECATED_V2=y 7 - CONFIG_EMBEDDED=y 7 + CONFIG_EXPERT=y 8 8 CONFIG_SLAB=y 9 9 CONFIG_MODULES=y 10 10 CONFIG_MODULE_UNLOAD=y
+1 -1
arch/arm/configs/eseries_pxa_defconfig
··· 2 2 CONFIG_SYSVIPC=y 3 3 CONFIG_LOG_BUF_SHIFT=14 4 4 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 5 - CONFIG_EMBEDDED=y 5 + CONFIG_EXPERT=y 6 6 # CONFIG_KALLSYMS is not set 7 7 # CONFIG_COMPAT_BRK is not set 8 8 CONFIG_SLAB=y
+1 -1
arch/arm/configs/ezx_defconfig
··· 7 7 CONFIG_BLK_DEV_INITRD=y 8 8 CONFIG_RD_BZIP2=y 9 9 CONFIG_RD_LZMA=y 10 - CONFIG_EMBEDDED=y 10 + CONFIG_EXPERT=y 11 11 # CONFIG_COMPAT_BRK is not set 12 12 CONFIG_SLAB=y 13 13 CONFIG_MODULES=y
+1 -1
arch/arm/configs/footbridge_defconfig
··· 3 3 CONFIG_BSD_PROCESS_ACCT=y 4 4 CONFIG_LOG_BUF_SHIFT=14 5 5 CONFIG_BLK_DEV_INITRD=y 6 - CONFIG_EMBEDDED=y 6 + CONFIG_EXPERT=y 7 7 # CONFIG_HOTPLUG is not set 8 8 CONFIG_MODULES=y 9 9 CONFIG_ARCH_FOOTBRIDGE=y
+1 -1
arch/arm/configs/fortunet_defconfig
··· 2 2 CONFIG_SYSVIPC=y 3 3 CONFIG_LOG_BUF_SHIFT=14 4 4 CONFIG_BLK_DEV_INITRD=y 5 - CONFIG_EMBEDDED=y 5 + CONFIG_EXPERT=y 6 6 # CONFIG_HOTPLUG is not set 7 7 CONFIG_ARCH_CLPS711X=y 8 8 CONFIG_ARCH_FORTUNET=y
+1 -1
arch/arm/configs/h5000_defconfig
··· 4 4 CONFIG_IKCONFIG_PROC=y 5 5 CONFIG_LOG_BUF_SHIFT=16 6 6 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 7 - CONFIG_EMBEDDED=y 7 + CONFIG_EXPERT=y 8 8 # CONFIG_UID16 is not set 9 9 CONFIG_SLAB=y 10 10 CONFIG_MODULES=y
+1 -1
arch/arm/configs/imote2_defconfig
··· 6 6 CONFIG_BLK_DEV_INITRD=y 7 7 CONFIG_RD_BZIP2=y 8 8 CONFIG_RD_LZMA=y 9 - CONFIG_EMBEDDED=y 9 + CONFIG_EXPERT=y 10 10 # CONFIG_COMPAT_BRK is not set 11 11 CONFIG_SLAB=y 12 12 CONFIG_MODULES=y
+1 -1
arch/arm/configs/ixp2000_defconfig
··· 3 3 CONFIG_BSD_PROCESS_ACCT=y 4 4 CONFIG_LOG_BUF_SHIFT=14 5 5 CONFIG_BLK_DEV_INITRD=y 6 - CONFIG_EMBEDDED=y 6 + CONFIG_EXPERT=y 7 7 # CONFIG_HOTPLUG is not set 8 8 CONFIG_SLAB=y 9 9 CONFIG_MODULES=y
+1 -1
arch/arm/configs/ixp23xx_defconfig
··· 3 3 CONFIG_BSD_PROCESS_ACCT=y 4 4 CONFIG_LOG_BUF_SHIFT=14 5 5 CONFIG_BLK_DEV_INITRD=y 6 - CONFIG_EMBEDDED=y 6 + CONFIG_EXPERT=y 7 7 CONFIG_SLAB=y 8 8 CONFIG_MODULES=y 9 9 CONFIG_MODULE_UNLOAD=y
+1 -1
arch/arm/configs/ixp4xx_defconfig
··· 3 3 CONFIG_BSD_PROCESS_ACCT=y 4 4 CONFIG_LOG_BUF_SHIFT=14 5 5 CONFIG_BLK_DEV_INITRD=y 6 - CONFIG_EMBEDDED=y 6 + CONFIG_EXPERT=y 7 7 CONFIG_MODULES=y 8 8 CONFIG_MODVERSIONS=y 9 9 # CONFIG_BLK_DEV_BSG is not set
+1 -1
arch/arm/configs/loki_defconfig
··· 1 1 CONFIG_EXPERIMENTAL=y 2 2 CONFIG_SYSVIPC=y 3 3 CONFIG_LOG_BUF_SHIFT=14 4 - CONFIG_EMBEDDED=y 4 + CONFIG_EXPERT=y 5 5 CONFIG_SLAB=y 6 6 CONFIG_MODULES=y 7 7 CONFIG_MODULE_UNLOAD=y
+1 -1
arch/arm/configs/lpd7a400_defconfig
··· 3 3 CONFIG_SYSVIPC=y 4 4 CONFIG_IKCONFIG=y 5 5 CONFIG_LOG_BUF_SHIFT=14 6 - CONFIG_EMBEDDED=y 6 + CONFIG_EXPERT=y 7 7 # CONFIG_HOTPLUG is not set 8 8 # CONFIG_EPOLL is not set 9 9 # CONFIG_IOSCHED_DEADLINE is not set
+1 -1
arch/arm/configs/lpd7a404_defconfig
··· 3 3 CONFIG_SYSVIPC=y 4 4 CONFIG_IKCONFIG=y 5 5 CONFIG_LOG_BUF_SHIFT=16 6 - CONFIG_EMBEDDED=y 6 + CONFIG_EXPERT=y 7 7 # CONFIG_HOTPLUG is not set 8 8 # CONFIG_EPOLL is not set 9 9 CONFIG_SLAB=y
+1 -1
arch/arm/configs/magician_defconfig
··· 4 4 CONFIG_IKCONFIG_PROC=y 5 5 CONFIG_LOG_BUF_SHIFT=16 6 6 CONFIG_BLK_DEV_INITRD=y 7 - CONFIG_EMBEDDED=y 7 + CONFIG_EXPERT=y 8 8 # CONFIG_UID16 is not set 9 9 CONFIG_SLAB=y 10 10 CONFIG_MODULES=y
+1 -1
arch/arm/configs/mv78xx0_defconfig
··· 2 2 CONFIG_SYSVIPC=y 3 3 CONFIG_LOG_BUF_SHIFT=14 4 4 CONFIG_SYSFS_DEPRECATED_V2=y 5 - CONFIG_EMBEDDED=y 5 + CONFIG_EXPERT=y 6 6 CONFIG_KALLSYMS_ALL=y 7 7 # CONFIG_SLUB_DEBUG is not set 8 8 CONFIG_PROFILING=y
+1 -1
arch/arm/configs/mx1_defconfig
··· 4 4 CONFIG_IKCONFIG_PROC=y 5 5 CONFIG_LOG_BUF_SHIFT=14 6 6 CONFIG_SYSFS_DEPRECATED_V2=y 7 - CONFIG_EMBEDDED=y 7 + CONFIG_EXPERT=y 8 8 CONFIG_SLAB=y 9 9 CONFIG_MODULES=y 10 10 CONFIG_MODULE_UNLOAD=y
+1 -1
arch/arm/configs/mx21_defconfig
··· 4 4 CONFIG_LOG_BUF_SHIFT=14 5 5 CONFIG_SYSFS_DEPRECATED_V2=y 6 6 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 7 - CONFIG_EMBEDDED=y 7 + CONFIG_EXPERT=y 8 8 CONFIG_KALLSYMS_EXTRA_PASS=y 9 9 CONFIG_SLAB=y 10 10 CONFIG_MODULES=y
+1 -1
arch/arm/configs/mx27_defconfig
··· 4 4 CONFIG_POSIX_MQUEUE=y 5 5 CONFIG_LOG_BUF_SHIFT=14 6 6 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 7 - CONFIG_EMBEDDED=y 7 + CONFIG_EXPERT=y 8 8 CONFIG_KALLSYMS_EXTRA_PASS=y 9 9 # CONFIG_COMPAT_BRK is not set 10 10 CONFIG_SLAB=y
+1 -1
arch/arm/configs/mx3_defconfig
··· 4 4 CONFIG_IKCONFIG_PROC=y 5 5 CONFIG_LOG_BUF_SHIFT=14 6 6 CONFIG_SYSFS_DEPRECATED_V2=y 7 - CONFIG_EMBEDDED=y 7 + CONFIG_EXPERT=y 8 8 CONFIG_SLAB=y 9 9 CONFIG_MODULES=y 10 10 CONFIG_MODULE_UNLOAD=y
+1 -1
arch/arm/configs/mx51_defconfig
··· 3 3 CONFIG_SYSVIPC=y 4 4 CONFIG_LOG_BUF_SHIFT=18 5 5 CONFIG_RELAY=y 6 - CONFIG_EMBEDDED=y 6 + CONFIG_EXPERT=y 7 7 # CONFIG_SLUB_DEBUG is not set 8 8 # CONFIG_COMPAT_BRK is not set 9 9 CONFIG_MODULES=y
+1 -1
arch/arm/configs/nhk8815_defconfig
··· 7 7 CONFIG_LOG_BUF_SHIFT=14 8 8 CONFIG_SYSFS_DEPRECATED_V2=y 9 9 CONFIG_BLK_DEV_INITRD=y 10 - CONFIG_EMBEDDED=y 10 + CONFIG_EXPERT=y 11 11 CONFIG_KALLSYMS_ALL=y 12 12 CONFIG_SLAB=y 13 13 CONFIG_MODULES=y
+1 -1
arch/arm/configs/omap1_defconfig
··· 6 6 CONFIG_IKCONFIG=y 7 7 CONFIG_LOG_BUF_SHIFT=14 8 8 CONFIG_BLK_DEV_INITRD=y 9 - CONFIG_EMBEDDED=y 9 + CONFIG_EXPERT=y 10 10 # CONFIG_KALLSYMS is not set 11 11 # CONFIG_ELF_CORE is not set 12 12 # CONFIG_BASE_FULL is not set
+1 -1
arch/arm/configs/omap2plus_defconfig
··· 6 6 CONFIG_IKCONFIG_PROC=y 7 7 CONFIG_LOG_BUF_SHIFT=16 8 8 CONFIG_BLK_DEV_INITRD=y 9 - CONFIG_EMBEDDED=y 9 + CONFIG_EXPERT=y 10 10 # CONFIG_SYSCTL_SYSCALL is not set 11 11 CONFIG_KALLSYMS_EXTRA_PASS=y 12 12 CONFIG_SLAB=y
+1 -1
arch/arm/configs/orion5x_defconfig
··· 2 2 CONFIG_SYSVIPC=y 3 3 CONFIG_LOG_BUF_SHIFT=14 4 4 CONFIG_SYSFS_DEPRECATED_V2=y 5 - CONFIG_EMBEDDED=y 5 + CONFIG_EXPERT=y 6 6 # CONFIG_SLUB_DEBUG is not set 7 7 CONFIG_PROFILING=y 8 8 CONFIG_OPROFILE=y
+1 -1
arch/arm/configs/pcm027_defconfig
··· 7 7 CONFIG_IKCONFIG_PROC=y 8 8 CONFIG_LOG_BUF_SHIFT=14 9 9 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 10 - CONFIG_EMBEDDED=y 10 + CONFIG_EXPERT=y 11 11 # CONFIG_KALLSYMS is not set 12 12 CONFIG_SLAB=y 13 13 CONFIG_MODULES=y
+1 -1
arch/arm/configs/pcontrol_g20_defconfig
··· 10 10 CONFIG_LOG_BUF_SHIFT=14 11 11 CONFIG_NAMESPACES=y 12 12 CONFIG_BLK_DEV_INITRD=y 13 - CONFIG_EMBEDDED=y 13 + CONFIG_EXPERT=y 14 14 # CONFIG_SYSCTL_SYSCALL is not set 15 15 # CONFIG_KALLSYMS is not set 16 16 # CONFIG_VM_EVENT_COUNTERS is not set
+1 -1
arch/arm/configs/pleb_defconfig
··· 3 3 CONFIG_SYSVIPC=y 4 4 CONFIG_LOG_BUF_SHIFT=14 5 5 CONFIG_BLK_DEV_INITRD=y 6 - CONFIG_EMBEDDED=y 6 + CONFIG_EXPERT=y 7 7 # CONFIG_HOTPLUG is not set 8 8 # CONFIG_SHMEM is not set 9 9 CONFIG_MODULES=y
+1 -1
arch/arm/configs/pnx4008_defconfig
··· 5 5 CONFIG_AUDIT=y 6 6 CONFIG_LOG_BUF_SHIFT=14 7 7 CONFIG_BLK_DEV_INITRD=y 8 - CONFIG_EMBEDDED=y 8 + CONFIG_EXPERT=y 9 9 CONFIG_SLAB=y 10 10 CONFIG_MODULES=y 11 11 CONFIG_MODULE_UNLOAD=y
+1 -1
arch/arm/configs/simpad_defconfig
··· 2 2 CONFIG_LOCALVERSION="oe1" 3 3 CONFIG_SYSVIPC=y 4 4 CONFIG_LOG_BUF_SHIFT=14 5 - CONFIG_EMBEDDED=y 5 + CONFIG_EXPERT=y 6 6 CONFIG_KALLSYMS_ALL=y 7 7 CONFIG_KALLSYMS_EXTRA_PASS=y 8 8 CONFIG_MODULES=y
+1 -1
arch/arm/configs/spitz_defconfig
··· 4 4 CONFIG_LOG_BUF_SHIFT=14 5 5 CONFIG_SYSFS_DEPRECATED_V2=y 6 6 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 7 - CONFIG_EMBEDDED=y 7 + CONFIG_EXPERT=y 8 8 CONFIG_PROFILING=y 9 9 CONFIG_OPROFILE=m 10 10 CONFIG_MODULES=y
+1 -1
arch/arm/configs/stmp378x_defconfig
··· 5 5 CONFIG_BSD_PROCESS_ACCT=y 6 6 CONFIG_SYSFS_DEPRECATED_V2=y 7 7 CONFIG_BLK_DEV_INITRD=y 8 - CONFIG_EMBEDDED=y 8 + CONFIG_EXPERT=y 9 9 CONFIG_SLAB=y 10 10 CONFIG_MODULES=y 11 11 CONFIG_MODULE_UNLOAD=y
+1 -1
arch/arm/configs/stmp37xx_defconfig
··· 5 5 CONFIG_BSD_PROCESS_ACCT=y 6 6 CONFIG_SYSFS_DEPRECATED_V2=y 7 7 CONFIG_BLK_DEV_INITRD=y 8 - CONFIG_EMBEDDED=y 8 + CONFIG_EXPERT=y 9 9 CONFIG_SLAB=y 10 10 CONFIG_MODULES=y 11 11 CONFIG_MODULE_UNLOAD=y
+1 -1
arch/arm/configs/tct_hammer_defconfig
··· 5 5 CONFIG_LOG_BUF_SHIFT=14 6 6 CONFIG_SYSFS_DEPRECATED_V2=y 7 7 CONFIG_BLK_DEV_INITRD=y 8 - CONFIG_EMBEDDED=y 8 + CONFIG_EXPERT=y 9 9 # CONFIG_KALLSYMS is not set 10 10 # CONFIG_BUG is not set 11 11 # CONFIG_ELF_CORE is not set
+1 -1
arch/arm/configs/trizeps4_defconfig
··· 7 7 CONFIG_IKCONFIG_PROC=y 8 8 CONFIG_LOG_BUF_SHIFT=14 9 9 CONFIG_BLK_DEV_INITRD=y 10 - CONFIG_EMBEDDED=y 10 + CONFIG_EXPERT=y 11 11 CONFIG_KALLSYMS_EXTRA_PASS=y 12 12 CONFIG_SLAB=y 13 13 CONFIG_MODULES=y
+1 -1
arch/arm/configs/u300_defconfig
··· 3 3 # CONFIG_SWAP is not set 4 4 CONFIG_SYSVIPC=y 5 5 CONFIG_LOG_BUF_SHIFT=14 6 - CONFIG_EMBEDDED=y 6 + CONFIG_EXPERT=y 7 7 # CONFIG_AIO is not set 8 8 # CONFIG_VM_EVENT_COUNTERS is not set 9 9 CONFIG_MODULES=y
+1 -1
arch/arm/configs/viper_defconfig
··· 3 3 CONFIG_SYSVIPC=y 4 4 CONFIG_LOG_BUF_SHIFT=13 5 5 CONFIG_SYSFS_DEPRECATED_V2=y 6 - CONFIG_EMBEDDED=y 6 + CONFIG_EXPERT=y 7 7 # CONFIG_ELF_CORE is not set 8 8 # CONFIG_SHMEM is not set 9 9 CONFIG_SLAB=y
+1 -1
arch/arm/configs/xcep_defconfig
··· 8 8 CONFIG_LOG_BUF_SHIFT=16 9 9 CONFIG_SYSFS_DEPRECATED_V2=y 10 10 CONFIG_BLK_DEV_INITRD=y 11 - CONFIG_EMBEDDED=y 11 + CONFIG_EXPERT=y 12 12 # CONFIG_UID16 is not set 13 13 # CONFIG_SHMEM is not set 14 14 # CONFIG_VM_EVENT_COUNTERS is not set
+2 -2
arch/arm/mach-msm/board-qsd8x50.c
··· 43 43 * at run-time: they vary from board to board, and the true 44 44 * configuration won't be known until boot. 45 45 */ 46 - static struct resource smc91x_resources[] __initdata = { 46 + static struct resource smc91x_resources[] = { 47 47 [0] = { 48 48 .flags = IORESOURCE_MEM, 49 49 }, ··· 52 52 }, 53 53 }; 54 54 55 - static struct platform_device smc91x_device __initdata = { 55 + static struct platform_device smc91x_device = { 56 56 .name = "smc91x", 57 57 .id = 0, 58 58 .num_resources = ARRAY_SIZE(smc91x_resources),
+2 -2
arch/avr32/Kconfig
··· 1 1 config AVR32 2 2 def_bool y 3 - # With EMBEDDED=n, we get lots of stuff automatically selected 3 + # With EXPERT=n, we get lots of stuff automatically selected 4 4 # that we usually don't need on AVR32. 5 - select EMBEDDED 5 + select EXPERT 6 6 select HAVE_CLK 7 7 select HAVE_OPROFILE 8 8 select HAVE_KPROBES
+3 -14
arch/blackfin/Kconfig
··· 30 30 select HAVE_KERNEL_LZO if RAMKERNEL 31 31 select HAVE_OPROFILE 32 32 select ARCH_WANT_OPTIONAL_GPIOLIB 33 + select HAVE_GENERIC_HARDIRQS 34 + select GENERIC_IRQ_PROBE 35 + select IRQ_PER_CPU if SMP 33 36 34 37 config GENERIC_CSUM 35 38 def_bool y ··· 45 42 def_bool y 46 43 47 44 config GENERIC_FIND_NEXT_BIT 48 - def_bool y 49 - 50 - config GENERIC_HARDIRQS 51 - def_bool y 52 - 53 - config GENERIC_IRQ_PROBE 54 - def_bool y 55 - 56 - config GENERIC_HARDIRQS_NO__DO_IRQ 57 45 def_bool y 58 46 59 47 config GENERIC_GPIO ··· 246 252 config HOTPLUG_CPU 247 253 bool "Support for hot-pluggable CPUs" 248 254 depends on SMP && HOTPLUG 249 - default y 250 - 251 - config IRQ_PER_CPU 252 - bool 253 - depends on SMP 254 255 default y 255 256 256 257 config HAVE_LEGACY_PER_CPU_AREA
+1 -1
arch/blackfin/configs/BF518F-EZBRD_defconfig
··· 5 5 CONFIG_LOG_BUF_SHIFT=14 6 6 CONFIG_BLK_DEV_INITRD=y 7 7 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 8 - CONFIG_EMBEDDED=y 8 + CONFIG_EXPERT=y 9 9 # CONFIG_SYSCTL_SYSCALL is not set 10 10 # CONFIG_ELF_CORE is not set 11 11 # CONFIG_FUTEX is not set
+1 -1
arch/blackfin/configs/BF526-EZBRD_defconfig
··· 5 5 CONFIG_LOG_BUF_SHIFT=14 6 6 CONFIG_BLK_DEV_INITRD=y 7 7 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 8 - CONFIG_EMBEDDED=y 8 + CONFIG_EXPERT=y 9 9 # CONFIG_SYSCTL_SYSCALL is not set 10 10 # CONFIG_ELF_CORE is not set 11 11 # CONFIG_FUTEX is not set
+1 -1
arch/blackfin/configs/BF527-AD7160-EVAL_defconfig
··· 5 5 CONFIG_LOG_BUF_SHIFT=14 6 6 CONFIG_BLK_DEV_INITRD=y 7 7 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 8 - CONFIG_EMBEDDED=y 8 + CONFIG_EXPERT=y 9 9 # CONFIG_ELF_CORE is not set 10 10 # CONFIG_AIO is not set 11 11 CONFIG_SLAB=y
+1 -1
arch/blackfin/configs/BF527-EZKIT-V2_defconfig
··· 5 5 CONFIG_LOG_BUF_SHIFT=14 6 6 CONFIG_BLK_DEV_INITRD=y 7 7 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 8 - CONFIG_EMBEDDED=y 8 + CONFIG_EXPERT=y 9 9 # CONFIG_SYSCTL_SYSCALL is not set 10 10 # CONFIG_ELF_CORE is not set 11 11 # CONFIG_FUTEX is not set
+1 -1
arch/blackfin/configs/BF527-EZKIT_defconfig
··· 5 5 CONFIG_LOG_BUF_SHIFT=14 6 6 CONFIG_BLK_DEV_INITRD=y 7 7 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 8 - CONFIG_EMBEDDED=y 8 + CONFIG_EXPERT=y 9 9 # CONFIG_SYSCTL_SYSCALL is not set 10 10 # CONFIG_ELF_CORE is not set 11 11 # CONFIG_FUTEX is not set
+1 -1
arch/blackfin/configs/BF527-TLL6527M_defconfig
··· 6 6 CONFIG_LOG_BUF_SHIFT=14 7 7 CONFIG_BLK_DEV_INITRD=y 8 8 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 9 - CONFIG_EMBEDDED=y 9 + CONFIG_EXPERT=y 10 10 # CONFIG_SYSCTL_SYSCALL is not set 11 11 # CONFIG_ELF_CORE is not set 12 12 # CONFIG_FUTEX is not set
+1 -1
arch/blackfin/configs/BF533-EZKIT_defconfig
··· 5 5 CONFIG_LOG_BUF_SHIFT=14 6 6 CONFIG_BLK_DEV_INITRD=y 7 7 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 8 - CONFIG_EMBEDDED=y 8 + CONFIG_EXPERT=y 9 9 # CONFIG_SYSCTL_SYSCALL is not set 10 10 # CONFIG_ELF_CORE is not set 11 11 # CONFIG_FUTEX is not set
+1 -1
arch/blackfin/configs/BF533-STAMP_defconfig
··· 5 5 CONFIG_LOG_BUF_SHIFT=14 6 6 CONFIG_BLK_DEV_INITRD=y 7 7 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 8 - CONFIG_EMBEDDED=y 8 + CONFIG_EXPERT=y 9 9 # CONFIG_SYSCTL_SYSCALL is not set 10 10 # CONFIG_ELF_CORE is not set 11 11 # CONFIG_FUTEX is not set
+1 -1
arch/blackfin/configs/BF537-STAMP_defconfig
··· 5 5 CONFIG_LOG_BUF_SHIFT=14 6 6 CONFIG_BLK_DEV_INITRD=y 7 7 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 8 - CONFIG_EMBEDDED=y 8 + CONFIG_EXPERT=y 9 9 # CONFIG_SYSCTL_SYSCALL is not set 10 10 # CONFIG_ELF_CORE is not set 11 11 # CONFIG_FUTEX is not set
+1 -1
arch/blackfin/configs/BF538-EZKIT_defconfig
··· 5 5 CONFIG_LOG_BUF_SHIFT=14 6 6 CONFIG_BLK_DEV_INITRD=y 7 7 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 8 - CONFIG_EMBEDDED=y 8 + CONFIG_EXPERT=y 9 9 # CONFIG_SYSCTL_SYSCALL is not set 10 10 # CONFIG_ELF_CORE is not set 11 11 # CONFIG_FUTEX is not set
+1 -1
arch/blackfin/configs/BF548-EZKIT_defconfig
··· 5 5 CONFIG_LOG_BUF_SHIFT=14 6 6 CONFIG_BLK_DEV_INITRD=y 7 7 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 8 - CONFIG_EMBEDDED=y 8 + CONFIG_EXPERT=y 9 9 # CONFIG_SYSCTL_SYSCALL is not set 10 10 # CONFIG_ELF_CORE is not set 11 11 # CONFIG_FUTEX is not set
+1 -1
arch/blackfin/configs/BF561-ACVILON_defconfig
··· 5 5 CONFIG_LOG_BUF_SHIFT=14 6 6 CONFIG_SYSFS_DEPRECATED_V2=y 7 7 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 8 - CONFIG_EMBEDDED=y 8 + CONFIG_EXPERT=y 9 9 # CONFIG_SYSCTL_SYSCALL is not set 10 10 # CONFIG_ELF_CORE is not set 11 11 # CONFIG_FUTEX is not set
+1 -1
arch/blackfin/configs/BF561-EZKIT-SMP_defconfig
··· 5 5 CONFIG_LOG_BUF_SHIFT=14 6 6 CONFIG_BLK_DEV_INITRD=y 7 7 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 8 - CONFIG_EMBEDDED=y 8 + CONFIG_EXPERT=y 9 9 # CONFIG_SYSCTL_SYSCALL is not set 10 10 # CONFIG_ELF_CORE is not set 11 11 # CONFIG_FUTEX is not set
+1 -1
arch/blackfin/configs/BF561-EZKIT_defconfig
··· 5 5 CONFIG_LOG_BUF_SHIFT=14 6 6 CONFIG_BLK_DEV_INITRD=y 7 7 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 8 - CONFIG_EMBEDDED=y 8 + CONFIG_EXPERT=y 9 9 # CONFIG_SYSCTL_SYSCALL is not set 10 10 # CONFIG_ELF_CORE is not set 11 11 # CONFIG_FUTEX is not set
+1 -1
arch/blackfin/configs/BlackStamp_defconfig
··· 6 6 CONFIG_SYSFS_DEPRECATED_V2=y 7 7 CONFIG_BLK_DEV_INITRD=y 8 8 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 9 - CONFIG_EMBEDDED=y 9 + CONFIG_EXPERT=y 10 10 # CONFIG_SYSCTL_SYSCALL is not set 11 11 # CONFIG_ELF_CORE is not set 12 12 # CONFIG_FUTEX is not set
+1 -1
arch/blackfin/configs/CM-BF527_defconfig
··· 8 8 # CONFIG_RD_GZIP is not set 9 9 CONFIG_RD_LZMA=y 10 10 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 11 - CONFIG_EMBEDDED=y 11 + CONFIG_EXPERT=y 12 12 # CONFIG_SYSCTL_SYSCALL is not set 13 13 # CONFIG_ELF_CORE is not set 14 14 # CONFIG_FUTEX is not set
+1 -1
arch/blackfin/configs/CM-BF533_defconfig
··· 7 7 CONFIG_BLK_DEV_INITRD=y 8 8 # CONFIG_RD_GZIP is not set 9 9 CONFIG_RD_LZMA=y 10 - CONFIG_EMBEDDED=y 10 + CONFIG_EXPERT=y 11 11 # CONFIG_UID16 is not set 12 12 # CONFIG_SYSCTL_SYSCALL is not set 13 13 # CONFIG_ELF_CORE is not set
+1 -1
arch/blackfin/configs/CM-BF537E_defconfig
··· 8 8 # CONFIG_RD_GZIP is not set 9 9 CONFIG_RD_LZMA=y 10 10 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 11 - CONFIG_EMBEDDED=y 11 + CONFIG_EXPERT=y 12 12 # CONFIG_UID16 is not set 13 13 # CONFIG_SYSCTL_SYSCALL is not set 14 14 # CONFIG_ELF_CORE is not set
+1 -1
arch/blackfin/configs/CM-BF537U_defconfig
··· 8 8 # CONFIG_RD_GZIP is not set 9 9 CONFIG_RD_LZMA=y 10 10 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 11 - CONFIG_EMBEDDED=y 11 + CONFIG_EXPERT=y 12 12 # CONFIG_UID16 is not set 13 13 # CONFIG_SYSCTL_SYSCALL is not set 14 14 # CONFIG_ELF_CORE is not set
+1 -1
arch/blackfin/configs/CM-BF548_defconfig
··· 8 8 # CONFIG_RD_GZIP is not set 9 9 CONFIG_RD_LZMA=y 10 10 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 11 - CONFIG_EMBEDDED=y 11 + CONFIG_EXPERT=y 12 12 # CONFIG_UID16 is not set 13 13 # CONFIG_SYSCTL_SYSCALL is not set 14 14 # CONFIG_ELF_CORE is not set
+1 -1
arch/blackfin/configs/CM-BF561_defconfig
··· 8 8 # CONFIG_RD_GZIP is not set 9 9 CONFIG_RD_LZMA=y 10 10 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 11 - CONFIG_EMBEDDED=y 11 + CONFIG_EXPERT=y 12 12 # CONFIG_UID16 is not set 13 13 # CONFIG_SYSCTL_SYSCALL is not set 14 14 # CONFIG_ELF_CORE is not set
+1 -1
arch/blackfin/configs/DNP5370_defconfig
··· 5 5 CONFIG_IKCONFIG_PROC=y 6 6 CONFIG_LOG_BUF_SHIFT=14 7 7 CONFIG_BLK_DEV_INITRD=y 8 - CONFIG_EMBEDDED=y 8 + CONFIG_EXPERT=y 9 9 CONFIG_SLOB=y 10 10 # CONFIG_BLK_DEV_BSG is not set 11 11 # CONFIG_IOSCHED_CFQ is not set
+1 -1
arch/blackfin/configs/H8606_defconfig
··· 2 2 CONFIG_SYSVIPC=y 3 3 CONFIG_LOG_BUF_SHIFT=14 4 4 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 5 - CONFIG_EMBEDDED=y 5 + CONFIG_EXPERT=y 6 6 # CONFIG_SYSCTL_SYSCALL is not set 7 7 # CONFIG_ELF_CORE is not set 8 8 # CONFIG_FUTEX is not set
+1 -1
arch/blackfin/configs/IP0X_defconfig
··· 3 3 CONFIG_LOG_BUF_SHIFT=14 4 4 CONFIG_BLK_DEV_INITRD=y 5 5 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 6 - CONFIG_EMBEDDED=y 6 + CONFIG_EXPERT=y 7 7 # CONFIG_SYSCTL_SYSCALL is not set 8 8 # CONFIG_HOTPLUG is not set 9 9 # CONFIG_ELF_CORE is not set
+1 -1
arch/blackfin/configs/PNAV-10_defconfig
··· 2 2 CONFIG_SYSVIPC=y 3 3 CONFIG_LOG_BUF_SHIFT=14 4 4 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 5 - CONFIG_EMBEDDED=y 5 + CONFIG_EXPERT=y 6 6 # CONFIG_SYSCTL_SYSCALL is not set 7 7 # CONFIG_ELF_CORE is not set 8 8 # CONFIG_FUTEX is not set
+1 -1
arch/blackfin/configs/SRV1_defconfig
··· 3 3 CONFIG_LOG_BUF_SHIFT=14 4 4 CONFIG_BLK_DEV_INITRD=y 5 5 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 6 - CONFIG_EMBEDDED=y 6 + CONFIG_EXPERT=y 7 7 # CONFIG_SYSCTL_SYSCALL is not set 8 8 CONFIG_KALLSYMS_ALL=y 9 9 # CONFIG_ELF_CORE is not set
+1 -1
arch/blackfin/configs/TCM-BF518_defconfig
··· 7 7 CONFIG_BLK_DEV_INITRD=y 8 8 # CONFIG_RD_GZIP is not set 9 9 CONFIG_RD_LZMA=y 10 - CONFIG_EMBEDDED=y 10 + CONFIG_EXPERT=y 11 11 # CONFIG_SYSCTL_SYSCALL is not set 12 12 # CONFIG_ELF_CORE is not set 13 13 # CONFIG_FUTEX is not set
+1 -1
arch/blackfin/configs/TCM-BF537_defconfig
··· 8 8 # CONFIG_RD_GZIP is not set 9 9 CONFIG_RD_LZMA=y 10 10 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 11 - CONFIG_EMBEDDED=y 11 + CONFIG_EXPERT=y 12 12 # CONFIG_UID16 is not set 13 13 # CONFIG_SYSCTL_SYSCALL is not set 14 14 # CONFIG_ELF_CORE is not set
+2 -4
arch/cris/Kconfig
··· 54 54 bool 55 55 default y 56 56 select HAVE_IDE 57 + select HAVE_GENERIC_HARDIRQS 58 + select GENERIC_HARDIRQS_NO_DEPRECATED 57 59 58 60 config HZ 59 61 int ··· 68 66 menu "General setup" 69 67 70 68 source "fs/Kconfig.binfmt" 71 - 72 - config GENERIC_HARDIRQS 73 - bool 74 - default y 75 69 76 70 config ETRAX_CMDLINE 77 71 string "Kernel command line"
+10 -31
arch/cris/arch-v10/kernel/irq.c
··· 104 104 IRQ31_interrupt 105 105 }; 106 106 107 - static void enable_crisv10_irq(unsigned int irq); 108 - 109 - static unsigned int startup_crisv10_irq(unsigned int irq) 107 + static void enable_crisv10_irq(struct irq_data *data) 110 108 { 111 - enable_crisv10_irq(irq); 112 - return 0; 109 + crisv10_unmask_irq(data->irq); 113 110 } 114 111 115 - #define shutdown_crisv10_irq disable_crisv10_irq 116 - 117 - static void enable_crisv10_irq(unsigned int irq) 112 + static void disable_crisv10_irq(struct irq_data *data) 118 113 { 119 - crisv10_unmask_irq(irq); 120 - } 121 - 122 - static void disable_crisv10_irq(unsigned int irq) 123 - { 124 - crisv10_mask_irq(irq); 125 - } 126 - 127 - static void ack_crisv10_irq(unsigned int irq) 128 - { 129 - } 130 - 131 - static void end_crisv10_irq(unsigned int irq) 132 - { 114 + crisv10_mask_irq(data->irq); 133 115 } 134 116 135 117 static struct irq_chip crisv10_irq_type = { 136 - .name = "CRISv10", 137 - .startup = startup_crisv10_irq, 138 - .shutdown = shutdown_crisv10_irq, 139 - .enable = enable_crisv10_irq, 140 - .disable = disable_crisv10_irq, 141 - .ack = ack_crisv10_irq, 142 - .end = end_crisv10_irq, 143 - .set_affinity = NULL 118 + .name = "CRISv10", 119 + .irq_shutdown = disable_crisv10_irq, 120 + .irq_enable = enable_crisv10_irq, 121 + .irq_disable = disable_crisv10_irq, 144 122 }; 145 123 146 124 void weird_irq(void); ··· 199 221 200 222 /* Initialize IRQ handler descriptors. */ 201 223 for(i = 2; i < NR_IRQS; i++) { 202 - irq_desc[i].chip = &crisv10_irq_type; 224 + set_irq_desc_and_handler(i, &crisv10_irq_type, 225 + handle_simple_irq); 203 226 set_int_vector(i, interrupt[i]); 204 227 } 205 228
+16 -36
arch/cris/arch-v32/kernel/irq.c
··· 291 291 } 292 292 293 293 294 - static unsigned int startup_crisv32_irq(unsigned int irq) 294 + static void enable_crisv32_irq(struct irq_data *data) 295 295 { 296 - crisv32_unmask_irq(irq); 297 - return 0; 296 + crisv32_unmask_irq(data->irq); 298 297 } 299 298 300 - static void shutdown_crisv32_irq(unsigned int irq) 299 + static void disable_crisv32_irq(struct irq_data *data) 301 300 { 302 - crisv32_mask_irq(irq); 301 + crisv32_mask_irq(data->irq); 303 302 } 304 303 305 - static void enable_crisv32_irq(unsigned int irq) 306 - { 307 - crisv32_unmask_irq(irq); 308 - } 309 - 310 - static void disable_crisv32_irq(unsigned int irq) 311 - { 312 - crisv32_mask_irq(irq); 313 - } 314 - 315 - static void ack_crisv32_irq(unsigned int irq) 316 - { 317 - } 318 - 319 - static void end_crisv32_irq(unsigned int irq) 320 - { 321 - } 322 - 323 - int set_affinity_crisv32_irq(unsigned int irq, const struct cpumask *dest) 304 + static int set_affinity_crisv32_irq(struct irq_data *data, 305 + const struct cpumask *dest, bool force) 324 306 { 325 307 unsigned long flags; 326 - spin_lock_irqsave(&irq_lock, flags); 327 - irq_allocations[irq - FIRST_IRQ].mask = *dest; 328 - spin_unlock_irqrestore(&irq_lock, flags); 329 308 309 + spin_lock_irqsave(&irq_lock, flags); 310 + irq_allocations[data->irq - FIRST_IRQ].mask = *dest; 311 + spin_unlock_irqrestore(&irq_lock, flags); 330 312 return 0; 331 313 } 332 314 333 315 static struct irq_chip crisv32_irq_type = { 334 - .name = "CRISv32", 335 - .startup = startup_crisv32_irq, 336 - .shutdown = shutdown_crisv32_irq, 337 - .enable = enable_crisv32_irq, 338 - .disable = disable_crisv32_irq, 339 - .ack = ack_crisv32_irq, 340 - .end = end_crisv32_irq, 341 - .set_affinity = set_affinity_crisv32_irq 316 + .name = "CRISv32", 317 + .irq_shutdown = disable_crisv32_irq, 318 + .irq_enable = enable_crisv32_irq, 319 + .irq_disable = disable_crisv32_irq, 320 + .irq_set_affinity = set_affinity_crisv32_irq, 342 321 }; 343 322 344 323 void ··· 451 472 452 473 /* Point all IRQ's to bad handlers. */ 453 474 for (i = FIRST_IRQ, j = 0; j < NR_IRQS; i++, j++) { 454 - irq_desc[j].chip = &crisv32_irq_type; 475 + set_irq_chip_and_handler(j, &crisv32_irq_type, 476 + handle_simple_irq); 455 477 set_exception_vector(i, interrupt[j]); 456 478 } 457 479
+1 -1
arch/cris/configs/artpec_3_defconfig
··· 2 2 # CONFIG_SWAP is not set 3 3 CONFIG_LOG_BUF_SHIFT=14 4 4 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 5 - CONFIG_EMBEDDED=y 5 + CONFIG_EXPERT=y 6 6 # CONFIG_KALLSYMS is not set 7 7 # CONFIG_HOTPLUG is not set 8 8 # CONFIG_BLK_DEV_BSG is not set
+1 -1
arch/cris/configs/etrax-100lx_v2_defconfig
··· 2 2 # CONFIG_SWAP is not set 3 3 CONFIG_LOG_BUF_SHIFT=14 4 4 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 5 - CONFIG_EMBEDDED=y 5 + CONFIG_EXPERT=y 6 6 # CONFIG_KALLSYMS is not set 7 7 # CONFIG_HOTPLUG is not set 8 8 # CONFIG_BLK_DEV_BSG is not set
+1 -1
arch/cris/configs/etraxfs_defconfig
··· 2 2 # CONFIG_SWAP is not set 3 3 CONFIG_LOG_BUF_SHIFT=14 4 4 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 5 - CONFIG_EMBEDDED=y 5 + CONFIG_EXPERT=y 6 6 # CONFIG_KALLSYMS is not set 7 7 # CONFIG_HOTPLUG is not set 8 8 # CONFIG_BLK_DEV_BSG is not set
+3 -3
arch/cris/kernel/irq.c
··· 62 62 for_each_online_cpu(j) 63 63 seq_printf(p, "%10u ", kstat_irqs_cpu(i, j)); 64 64 #endif 65 - seq_printf(p, " %14s", irq_desc[i].chip->name); 65 + seq_printf(p, " %14s", irq_desc[i].irq_data.chip->name); 66 66 seq_printf(p, " %s", action->name); 67 67 68 68 for (action=action->next; action; action = action->next) ··· 93 93 printk("do_IRQ: stack overflow: %lX\n", sp); 94 94 show_stack(NULL, (unsigned long *)sp); 95 95 } 96 - __do_IRQ(irq); 97 - irq_exit(); 96 + generic_handle_irq(irq); 97 + irq_exit(); 98 98 set_irq_regs(old_regs); 99 99 } 100 100
+1 -8
arch/frv/Kconfig
··· 5 5 select HAVE_ARCH_TRACEHOOK 6 6 select HAVE_IRQ_WORK 7 7 select HAVE_PERF_EVENTS 8 + select HAVE_GENERIC_HARDIRQS 8 9 9 10 config ZONE_DMA 10 11 bool ··· 29 28 config GENERIC_CALIBRATE_DELAY 30 29 bool 31 30 default n 32 - 33 - config GENERIC_HARDIRQS 34 - bool 35 - default y 36 - 37 - config GENERIC_HARDIRQS_NO__DO_IRQ 38 - bool 39 - default y 40 31 41 32 config TIME_LOW_RES 42 33 bool
+1 -1
arch/frv/defconfig
··· 3 3 CONFIG_POSIX_MQUEUE=y 4 4 CONFIG_LOG_BUF_SHIFT=14 5 5 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 6 - CONFIG_EMBEDDED=y 6 + CONFIG_EXPERT=y 7 7 # CONFIG_HOTPLUG is not set 8 8 CONFIG_MMU=y 9 9 CONFIG_FRV_OUTOFLINE_ATOMIC_OPS=y
+2 -4
arch/h8300/Kconfig
··· 2 2 bool 3 3 default y 4 4 select HAVE_IDE 5 + select HAVE_GENERIC_HARDIRQS 6 + select GENERIC_HARDIRQS_NO_DEPRECATED 5 7 6 8 config SYMBOL_PREFIX 7 9 string ··· 46 44 default y 47 45 48 46 config GENERIC_HWEIGHT 49 - bool 50 - default y 51 - 52 - config GENERIC_HARDIRQS 53 47 bool 54 48 default y 55 49
+1 -1
arch/h8300/defconfig
··· 1 1 CONFIG_EXPERIMENTAL=y 2 2 # CONFIG_LOCALVERSION_AUTO is not set 3 3 CONFIG_LOG_BUF_SHIFT=14 4 - CONFIG_EMBEDDED=y 4 + CONFIG_EXPERT=y 5 5 # CONFIG_UID16 is not set 6 6 # CONFIG_SYSCTL_SYSCALL is not set 7 7 # CONFIG_KALLSYMS is not set
+20 -30
arch/h8300/kernel/irq.c
··· 38 38 return (irq >= EXT_IRQ0 && irq <= (EXT_IRQ0 + EXT_IRQS)); 39 39 } 40 40 41 - static void h8300_enable_irq(unsigned int irq) 41 + static void h8300_enable_irq(struct irq_data *data) 42 42 { 43 - if (is_ext_irq(irq)) 44 - IER_REGS |= 1 << (irq - EXT_IRQ0); 43 + if (is_ext_irq(data->irq)) 44 + IER_REGS |= 1 << (data->irq - EXT_IRQ0); 45 45 } 46 46 47 - static void h8300_disable_irq(unsigned int irq) 47 + static void h8300_disable_irq(struct irq_data *data) 48 48 { 49 - if (is_ext_irq(irq)) 50 - IER_REGS &= ~(1 << (irq - EXT_IRQ0)); 49 + if (is_ext_irq(data->irq)) 50 + IER_REGS &= ~(1 << (data->irq - EXT_IRQ0)); 51 51 } 52 52 53 - static void h8300_end_irq(unsigned int irq) 53 + static unsigned int h8300_startup_irq(struct irq_data *data) 54 54 { 55 - } 56 - 57 - static unsigned int h8300_startup_irq(unsigned int irq) 58 - { 59 - if (is_ext_irq(irq)) 60 - return h8300_enable_irq_pin(irq); 55 + if (is_ext_irq(data->irq)) 56 + return h8300_enable_irq_pin(data->irq); 61 57 else 62 58 return 0; 63 59 } 64 60 65 - static void h8300_shutdown_irq(unsigned int irq) 61 + static void h8300_shutdown_irq(struct irq_data *data) 66 62 { 67 - if (is_ext_irq(irq)) 68 - h8300_disable_irq_pin(irq); 63 + if (is_ext_irq(data->irq)) 64 + h8300_disable_irq_pin(data->irq); 69 65 } 70 66 71 67 /* ··· 69 73 */ 70 74 struct irq_chip h8300irq_chip = { 71 75 .name = "H8300-INTC", 72 - .startup = h8300_startup_irq, 73 - .shutdown = h8300_shutdown_irq, 74 - .enable = h8300_enable_irq, 75 - .disable = h8300_disable_irq, 76 - .ack = NULL, 77 - .end = h8300_end_irq, 76 + .irq_startup = h8300_startup_irq, 77 + .irq_shutdown = h8300_shutdown_irq, 78 + .irq_enable = h8300_enable_irq, 79 + .irq_disable = h8300_disable_irq, 78 80 }; 79 81 80 82 #if defined(CONFIG_RAMKERNEL) ··· 154 160 155 161 setup_vector(); 156 162 157 - for (c = 0; c < NR_IRQS; c++) { 158 - irq_desc[c].status = IRQ_DISABLED; 159 - irq_desc[c].action = NULL; 160 - irq_desc[c].depth = 1; 161 - irq_desc[c].chip = &h8300irq_chip; 162 - } 163 + for (c = 0; c < NR_IRQS; c++) 164 + set_irq_chip_and_handler(c, &h8300irq_chip, handle_simple_irq); 163 165 } 164 166 165 167 asmlinkage void do_IRQ(int irq) 166 168 { 167 169 irq_enter(); 168 - __do_IRQ(irq); 170 + generic_handle_irq(irq); 169 171 irq_exit(); 170 172 } 171 173 ··· 182 192 goto unlock; 183 193 seq_printf(p, "%3d: ",i); 184 194 seq_printf(p, "%10u ", kstat_irqs(i)); 185 - seq_printf(p, " %14s", irq_desc[i].chip->name); 195 + seq_printf(p, " %14s", irq_desc[i].irq_data.chip->name); 186 196 seq_printf(p, "-%-8s", irq_desc[i].name); 187 197 seq_printf(p, " %s", action->name); 188 198
+4 -22
arch/ia64/Kconfig
··· 22 22 select HAVE_KVM 23 23 select HAVE_ARCH_TRACEHOOK 24 24 select HAVE_DMA_API_DEBUG 25 + select HAVE_GENERIC_HARDIRQS 26 + select GENERIC_IRQ_PROBE 27 + select GENERIC_PENDING_IRQ if SMP 28 + select IRQ_PER_CPU 25 29 default y 26 30 help 27 31 The Itanium Processor Family is Intel's 64-bit successor to ··· 681 677 source "arch/ia64/kvm/Kconfig" 682 678 683 679 source "lib/Kconfig" 684 - 685 - # 686 - # Use the generic interrupt handling code in kernel/irq/: 687 - # 688 - config GENERIC_HARDIRQS 689 - def_bool y 690 - 691 - config GENERIC_HARDIRQS_NO__DO_IRQ 692 - def_bool y 693 - 694 - config GENERIC_IRQ_PROBE 695 - bool 696 - default y 697 - 698 - config GENERIC_PENDING_IRQ 699 - bool 700 - depends on GENERIC_HARDIRQS && SMP 701 - default y 702 - 703 - config IRQ_PER_CPU 704 - bool 705 - default y 706 680 707 681 config IOMMU_HELPER 708 682 def_bool (IA64_HP_ZX1 || IA64_HP_ZX1_SWIOTLB || IA64_GENERIC || SWIOTLB)
+3 -8
arch/m32r/Kconfig
··· 7 7 select HAVE_KERNEL_GZIP 8 8 select HAVE_KERNEL_BZIP2 9 9 select HAVE_KERNEL_LZMA 10 + select HAVE_GENERIC_HARDIRQS 11 + select GENERIC_HARDIRQS_NO_DEPRECATED 12 + select GENERIC_IRQ_PROBE 10 13 11 14 config SBUS 12 15 bool ··· 19 16 default y 20 17 21 18 config ZONE_DMA 22 - bool 23 - default y 24 - 25 - config GENERIC_HARDIRQS 26 - bool 27 - default y 28 - 29 - config GENERIC_IRQ_PROBE 30 19 bool 31 20 default y 32 21
+1 -1
arch/m32r/configs/m32700ut.smp_defconfig
··· 5 5 CONFIG_IKCONFIG_PROC=y 6 6 CONFIG_LOG_BUF_SHIFT=15 7 7 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 8 - CONFIG_EMBEDDED=y 8 + CONFIG_EXPERT=y 9 9 # CONFIG_KALLSYMS is not set 10 10 # CONFIG_FUTEX is not set 11 11 # CONFIG_EPOLL is not set
+1 -1
arch/m32r/configs/m32700ut.up_defconfig
··· 5 5 CONFIG_IKCONFIG_PROC=y 6 6 CONFIG_LOG_BUF_SHIFT=14 7 7 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 8 - CONFIG_EMBEDDED=y 8 + CONFIG_EXPERT=y 9 9 # CONFIG_KALLSYMS is not set 10 10 # CONFIG_FUTEX is not set 11 11 # CONFIG_EPOLL is not set
+1 -1
arch/m32r/configs/mappi.nommu_defconfig
··· 3 3 CONFIG_IKCONFIG=y 4 4 CONFIG_LOG_BUF_SHIFT=14 5 5 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 6 - CONFIG_EMBEDDED=y 6 + CONFIG_EXPERT=y 7 7 # CONFIG_KALLSYMS is not set 8 8 # CONFIG_FUTEX is not set 9 9 # CONFIG_EPOLL is not set
+1 -1
arch/m32r/configs/mappi.smp_defconfig
··· 5 5 CONFIG_LOG_BUF_SHIFT=15 6 6 CONFIG_BLK_DEV_INITRD=y 7 7 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 8 - CONFIG_EMBEDDED=y 8 + CONFIG_EXPERT=y 9 9 # CONFIG_KALLSYMS is not set 10 10 # CONFIG_FUTEX is not set 11 11 # CONFIG_EPOLL is not set
+1 -1
arch/m32r/configs/mappi.up_defconfig
··· 5 5 CONFIG_LOG_BUF_SHIFT=14 6 6 CONFIG_BLK_DEV_INITRD=y 7 7 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 8 - CONFIG_EMBEDDED=y 8 + CONFIG_EXPERT=y 9 9 # CONFIG_KALLSYMS is not set 10 10 # CONFIG_FUTEX is not set 11 11 # CONFIG_EPOLL is not set
+1 -1
arch/m32r/configs/mappi2.opsp_defconfig
··· 4 4 CONFIG_IKCONFIG=y 5 5 CONFIG_LOG_BUF_SHIFT=14 6 6 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 7 - CONFIG_EMBEDDED=y 7 + CONFIG_EXPERT=y 8 8 # CONFIG_KALLSYMS is not set 9 9 # CONFIG_FUTEX is not set 10 10 # CONFIG_EPOLL is not set
+1 -1
arch/m32r/configs/mappi2.vdec2_defconfig
··· 4 4 CONFIG_IKCONFIG=y 5 5 CONFIG_LOG_BUF_SHIFT=14 6 6 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 7 - CONFIG_EMBEDDED=y 7 + CONFIG_EXPERT=y 8 8 # CONFIG_KALLSYMS is not set 9 9 # CONFIG_FUTEX is not set 10 10 # CONFIG_EPOLL is not set
+1 -1
arch/m32r/configs/mappi3.smp_defconfig
··· 5 5 CONFIG_LOG_BUF_SHIFT=15 6 6 CONFIG_BLK_DEV_INITRD=y 7 7 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 8 - CONFIG_EMBEDDED=y 8 + CONFIG_EXPERT=y 9 9 # CONFIG_KALLSYMS is not set 10 10 # CONFIG_FUTEX is not set 11 11 # CONFIG_EPOLL is not set
+1 -1
arch/m32r/configs/oaks32r_defconfig
··· 2 2 CONFIG_BSD_PROCESS_ACCT=y 3 3 CONFIG_LOG_BUF_SHIFT=14 4 4 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 5 - CONFIG_EMBEDDED=y 5 + CONFIG_EXPERT=y 6 6 # CONFIG_KALLSYMS is not set 7 7 # CONFIG_FUTEX is not set 8 8 # CONFIG_EPOLL is not set
+1 -1
arch/m32r/configs/opsput_defconfig
··· 4 4 CONFIG_IKCONFIG=y 5 5 CONFIG_LOG_BUF_SHIFT=14 6 6 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 7 - CONFIG_EMBEDDED=y 7 + CONFIG_EXPERT=y 8 8 # CONFIG_KALLSYMS is not set 9 9 # CONFIG_FUTEX is not set 10 10 # CONFIG_EPOLL is not set
+1 -1
arch/m32r/configs/usrv_defconfig
··· 5 5 CONFIG_LOG_BUF_SHIFT=15 6 6 CONFIG_BLK_DEV_INITRD=y 7 7 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 8 - CONFIG_EMBEDDED=y 8 + CONFIG_EXPERT=y 9 9 CONFIG_KALLSYMS_EXTRA_PASS=y 10 10 CONFIG_SLAB=y 11 11 CONFIG_MODULES=y
+6 -4
arch/m32r/kernel/irq.c
··· 40 40 } 41 41 42 42 if (i < NR_IRQS) { 43 - raw_spin_lock_irqsave(&irq_desc[i].lock, flags); 44 - action = irq_desc[i].action; 43 + struct irq_desc *desc = irq_to_desc(i); 44 + 45 + raw_spin_lock_irqsave(&desc->lock, flags); 46 + action = desc->action; 45 47 if (!action) 46 48 goto skip; 47 49 seq_printf(p, "%3d: ",i); ··· 53 51 for_each_online_cpu(j) 54 52 seq_printf(p, "%10u ", kstat_irqs_cpu(i, j)); 55 53 #endif 56 - seq_printf(p, " %14s", irq_desc[i].chip->name); 54 + seq_printf(p, " %14s", desc->irq_data.chip->name); 57 55 seq_printf(p, " %s", action->name); 58 56 59 57 for (action=action->next; action; action = action->next) ··· 61 59 62 60 seq_putc(p, '\n'); 63 61 skip: 64 - raw_spin_unlock_irqrestore(&irq_desc[i].lock, flags); 62 + raw_spin_unlock_irqrestore(&desc->lock, flags); 65 63 } 66 64 return 0; 67 65 }
+21 -37
arch/m32r/platforms/m32104ut/setup.c
··· 39 39 outl(data, port); 40 40 } 41 41 42 - static void mask_and_ack_m32104ut(unsigned int irq) 42 + static void mask_m32104ut_irq(struct irq_data *data) 43 43 { 44 - disable_m32104ut_irq(irq); 44 + disable_m32104ut_irq(data->irq); 45 45 } 46 46 47 - static void end_m32104ut_irq(unsigned int irq) 47 + static void unmask_m32104ut_irq(struct irq_data *data) 48 48 { 49 - enable_m32104ut_irq(irq); 49 + enable_m32104ut_irq(data->irq); 50 50 } 51 51 52 - static unsigned int startup_m32104ut_irq(unsigned int irq) 52 + static void shutdown_m32104ut_irq(struct irq_data *data) 53 53 { 54 - enable_m32104ut_irq(irq); 55 - return (0); 56 - } 54 + unsigned int irq = data->irq; 55 + unsigned long port = irq2port(irq); 57 56 58 - static void shutdown_m32104ut_irq(unsigned int irq) 59 - { 60 - unsigned long port; 61 - 62 - port = irq2port(irq); 63 57 outl(M32R_ICUCR_ILEVEL7, port); 64 58 } 65 59 66 60 static struct irq_chip m32104ut_irq_type = 67 61 { 68 - .name = "M32104UT-IRQ", 69 - .startup = startup_m32104ut_irq, 70 - .shutdown = shutdown_m32104ut_irq, 71 - .enable = enable_m32104ut_irq, 72 - .disable = disable_m32104ut_irq, 73 - .ack = mask_and_ack_m32104ut, 74 - .end = end_m32104ut_irq 62 + .name = "M32104UT-IRQ", 63 + .irq_shutdown = shutdown_m32104ut_irq, 64 + .irq_unmask = unmask_m32104ut_irq, 65 + .irq_mask = mask_m32104ut_irq, 75 66 }; 76 67 77 68 void __init init_IRQ(void) ··· 76 85 77 86 #if defined(CONFIG_SMC91X) 78 87 /* INT#0: LAN controller on M32104UT-LAN (SMC91C111)*/ 79 - irq_desc[M32R_IRQ_INT0].status = IRQ_DISABLED; 80 - irq_desc[M32R_IRQ_INT0].chip = &m32104ut_irq_type; 81 - irq_desc[M32R_IRQ_INT0].action = 0; 82 - irq_desc[M32R_IRQ_INT0].depth = 1; 83 - icu_data[M32R_IRQ_INT0].icucr = M32R_ICUCR_IEN | M32R_ICUCR_ISMOD11; /* "H" level sense */ 88 + set_irq_chip_and_handler(M32R_IRQ_INT0, &m32104ut_irq_type, 89 + handle_level_irq); 90 + /* "H" level sense */ 91 + cu_data[M32R_IRQ_INT0].icucr = M32R_ICUCR_IEN | M32R_ICUCR_ISMOD11; 84 92 disable_m32104ut_irq(M32R_IRQ_INT0); 85 93 #endif /* CONFIG_SMC91X */ 86 94 87 95 /* MFT2 : system timer */ 88 - irq_desc[M32R_IRQ_MFT2].status = IRQ_DISABLED; 89 - irq_desc[M32R_IRQ_MFT2].chip = &m32104ut_irq_type; 90 - irq_desc[M32R_IRQ_MFT2].action = 0; 91 - irq_desc[M32R_IRQ_MFT2].depth = 1; 96 + set_irq_chip_and_handler(M32R_IRQ_MFT2, &m32104ut_irq_type, 97 + handle_level_irq); 92 98 icu_data[M32R_IRQ_MFT2].icucr = M32R_ICUCR_IEN; 93 99 disable_m32104ut_irq(M32R_IRQ_MFT2); 94 100 95 101 #ifdef CONFIG_SERIAL_M32R_SIO 96 102 /* SIO0_R : uart receive data */ 97 - irq_desc[M32R_IRQ_SIO0_R].status = IRQ_DISABLED; 98 - irq_desc[M32R_IRQ_SIO0_R].chip = &m32104ut_irq_type; 99 - irq_desc[M32R_IRQ_SIO0_R].action = 0; 100 - irq_desc[M32R_IRQ_SIO0_R].depth = 1; 103 + set_irq_chip_and_handler(M32R_IRQ_SIO0_R, &m32104ut_irq_type, 104 + handle_level_irq); 101 105 icu_data[M32R_IRQ_SIO0_R].icucr = M32R_ICUCR_IEN; 102 106 disable_m32104ut_irq(M32R_IRQ_SIO0_R); 103 107 104 108 /* SIO0_S : uart send data */ 105 - irq_desc[M32R_IRQ_SIO0_S].status = IRQ_DISABLED; 106 - irq_desc[M32R_IRQ_SIO0_S].chip = &m32104ut_irq_type; 107 - irq_desc[M32R_IRQ_SIO0_S].action = 0; 108 - irq_desc[M32R_IRQ_SIO0_S].depth = 1; 109 + set_irq_chip_and_handler(M32R_IRQ_SIO0_S, &m32104ut_irq_type, 110 + handle_level_irq); 109 111 icu_data[M32R_IRQ_SIO0_S].icucr = M32R_ICUCR_IEN; 110 112 disable_m32104ut_irq(M32R_IRQ_SIO0_S); 111 113 #endif /* CONFIG_SERIAL_M32R_SIO */
+73 -141
arch/m32r/platforms/m32700ut/setup.c
··· 45 45 outl(data, port); 46 46 } 47 47 48 - static void mask_and_ack_m32700ut(unsigned int irq) 48 + static void mask_m32700ut(struct irq_data *data) 49 49 { 50 - disable_m32700ut_irq(irq); 50 + disable_m32700ut_irq(data->irq); 51 51 } 52 52 53 - static void end_m32700ut_irq(unsigned int irq) 53 + static void unmask_m32700ut(struct irq_data *data) 54 54 { 55 - enable_m32700ut_irq(irq); 55 + enable_m32700ut_irq(data->irq); 56 56 } 57 57 58 - static unsigned int startup_m32700ut_irq(unsigned int irq) 59 - { 60 - enable_m32700ut_irq(irq); 61 - return (0); 62 - } 63 - 64 - static void shutdown_m32700ut_irq(unsigned int irq) 58 + static void shutdown_m32700ut(struct irq_data *data) 65 59 { 66 60 unsigned long port; 67 61 68 - port = irq2port(irq); 62 + port = irq2port(data->irq); 69 63 outl(M32R_ICUCR_ILEVEL7, port); 70 64 } 71 65 72 66 static struct irq_chip m32700ut_irq_type = 73 67 { 74 - .name = "M32700UT-IRQ", 75 - .startup = startup_m32700ut_irq, 76 - .shutdown = shutdown_m32700ut_irq, 77 - .enable = enable_m32700ut_irq, 78 - .disable = disable_m32700ut_irq, 79 - .ack = mask_and_ack_m32700ut, 80 - .end = end_m32700ut_irq 68 + .name = "M32700UT-IRQ", 69 + .irq_shutdown = shutdown_m32700ut, 70 + .irq_mask = mask_m32700ut, 71 + .irq_unmask = unmask_m32700ut 81 72 }; 82 73 83 74 /* ··· 90 99 unsigned int pldirq; 91 100 92 101 pldirq = irq2pldirq(irq); 93 - // disable_m32700ut_irq(M32R_IRQ_INT1); 94 102 port = pldirq2port(pldirq); 95 103 data = pld_icu_data[pldirq].icucr|PLD_ICUCR_ILEVEL7; 96 104 outw(data, port); ··· 101 111 unsigned int pldirq; 102 112 103 113 pldirq = irq2pldirq(irq); 104 - // enable_m32700ut_irq(M32R_IRQ_INT1); 105 114 port = pldirq2port(pldirq); 106 115 data = pld_icu_data[pldirq].icucr|PLD_ICUCR_IEN|PLD_ICUCR_ILEVEL6; 107 116 outw(data, port); 108 117 } 109 118 110 - static void mask_and_ack_m32700ut_pld(unsigned int irq) 119 + static void mask_m32700ut_pld(struct irq_data *data) 111 120 { 112 - disable_m32700ut_pld_irq(irq); 113 - // mask_and_ack_m32700ut(M32R_IRQ_INT1); 121 + disable_m32700ut_pld_irq(data->irq); 114 122 } 115 123 116 - static void end_m32700ut_pld_irq(unsigned int irq) 124 + static void unmask_m32700ut_pld(struct irq_data *data) 117 125 { 118 - enable_m32700ut_pld_irq(irq); 119 - end_m32700ut_irq(M32R_IRQ_INT1); 126 + enable_m32700ut_pld_irq(data->irq); 127 + enable_m32700ut_irq(M32R_IRQ_INT1); 120 128 } 121 129 122 - static unsigned int startup_m32700ut_pld_irq(unsigned int irq) 123 - { 124 - enable_m32700ut_pld_irq(irq); 125 - return (0); 126 - } 127 - 128 - static void shutdown_m32700ut_pld_irq(unsigned int irq) 130 + static void shutdown_m32700ut_pld_irq(struct irq_data *data) 129 131 { 130 132 unsigned long port; 131 133 unsigned int pldirq; 132 134 133 - pldirq = irq2pldirq(irq); 134 - // shutdown_m32700ut_irq(M32R_IRQ_INT1); 135 + pldirq = irq2pldirq(data->irq); 135 136 port = pldirq2port(pldirq); 136 137 outw(PLD_ICUCR_ILEVEL7, port); 137 138 } 138 139 139 140 static struct irq_chip m32700ut_pld_irq_type = 140 141 { 141 - .name = "M32700UT-PLD-IRQ", 142 - .startup = startup_m32700ut_pld_irq, 143 - .shutdown = shutdown_m32700ut_pld_irq, 144 - .enable = enable_m32700ut_pld_irq, 145 - .disable = disable_m32700ut_pld_irq, 146 - .ack = mask_and_ack_m32700ut_pld, 147 - .end = end_m32700ut_pld_irq 142 + .name = "M32700UT-PLD-IRQ", 143 + .irq_shutdown = shutdown_m32700ut_pld_irq, 144 + .irq_mask = mask_m32700ut_pld, 145 + .irq_unmask = unmask_m32700ut_pld, 148 146 }; 149 147 150 148 /* ··· 166 188 outw(data, port); 167 189 } 168 190 169 - static void mask_and_ack_m32700ut_lanpld(unsigned int irq) 191 + static void mask_m32700ut_lanpld(struct irq_data *data) 170 192 { 171 - disable_m32700ut_lanpld_irq(irq); 193 + disable_m32700ut_lanpld_irq(data->irq); 172 194 } 173 195 174 - static void end_m32700ut_lanpld_irq(unsigned int irq) 196 + static void unmask_m32700ut_lanpld(struct irq_data *data) 175 197 { 176 - enable_m32700ut_lanpld_irq(irq); 177 - end_m32700ut_irq(M32R_IRQ_INT0); 198 + enable_m32700ut_lanpld_irq(data->irq); 199 + enable_m32700ut_irq(M32R_IRQ_INT0); 178 200 } 179 201 180 - static unsigned int startup_m32700ut_lanpld_irq(unsigned int irq) 181 - { 182 - enable_m32700ut_lanpld_irq(irq); 183 - return (0); 184 - } 185 - 186 - static void shutdown_m32700ut_lanpld_irq(unsigned int irq) 202 + static void shutdown_m32700ut_lanpld(struct irq_data *data) 187 203 { 188 204 unsigned long port; 189 205 unsigned int pldirq; 190 206 191 - pldirq = irq2lanpldirq(irq); 207 + pldirq = irq2lanpldirq(data->irq); 192 208 port = lanpldirq2port(pldirq); 193 209 outw(PLD_ICUCR_ILEVEL7, port); 194 210 } 195 211 196 212 static struct irq_chip m32700ut_lanpld_irq_type = 197 213 { 198 - .name = "M32700UT-PLD-LAN-IRQ", 199 - .startup = startup_m32700ut_lanpld_irq, 200 - .shutdown = shutdown_m32700ut_lanpld_irq, 201 - .enable = enable_m32700ut_lanpld_irq, 202 - .disable = disable_m32700ut_lanpld_irq, 203 - .ack = mask_and_ack_m32700ut_lanpld, 204 - .end = end_m32700ut_lanpld_irq 214 + .name = "M32700UT-PLD-LAN-IRQ", 215 + .irq_shutdown = shutdown_m32700ut_lanpld, 216 + .irq_mask = mask_m32700ut_lanpld, 217 + .irq_unmask = unmask_m32700ut_lanpld, 205 218 }; 206 219 207 220 /* ··· 226 257 outw(data, port); 227 258 } 228 259 229 - static void mask_and_ack_m32700ut_lcdpld(unsigned int irq) 260 + static void mask_m32700ut_lcdpld(struct irq_data *data) 230 261 { 231 - disable_m32700ut_lcdpld_irq(irq); 262 + disable_m32700ut_lcdpld_irq(data->irq); 232 263 } 233 264 234 - static void end_m32700ut_lcdpld_irq(unsigned int irq) 265 + static void unmask_m32700ut_lcdpld(struct irq_data *data) 235 266 { 236 - enable_m32700ut_lcdpld_irq(irq); 237 - end_m32700ut_irq(M32R_IRQ_INT2); 267 + enable_m32700ut_lcdpld_irq(data->irq); 268 + enable_m32700ut_irq(M32R_IRQ_INT2); 238 269 } 239 270 240 - static unsigned int startup_m32700ut_lcdpld_irq(unsigned int irq) 241 - { 242 - enable_m32700ut_lcdpld_irq(irq); 243 - return (0); 244 - } 245 - 246 - static void shutdown_m32700ut_lcdpld_irq(unsigned int irq) 271 + static void shutdown_m32700ut_lcdpld(struct irq_data *data) 247 272 { 248 273 unsigned long port; 249 274 unsigned int pldirq; 250 275 251 - pldirq = irq2lcdpldirq(irq); 276 + pldirq = irq2lcdpldirq(data->irq); 252 277 port = lcdpldirq2port(pldirq); 253 278 outw(PLD_ICUCR_ILEVEL7, port); 254 279 } 255 280 256 281 static struct irq_chip m32700ut_lcdpld_irq_type = 257 282 { 258 - .name = "M32700UT-PLD-LCD-IRQ", 259 - .startup = startup_m32700ut_lcdpld_irq, 260 - .shutdown = shutdown_m32700ut_lcdpld_irq, 261 - .enable = enable_m32700ut_lcdpld_irq, 262 - .disable = disable_m32700ut_lcdpld_irq, 263 - .ack = mask_and_ack_m32700ut_lcdpld, 264 - .end = end_m32700ut_lcdpld_irq 283 + .name = "M32700UT-PLD-LCD-IRQ", 284 + .irq_shutdown = shutdown_m32700ut_lcdpld, 285 + .irq_mask = mask_m32700ut_lcdpld, 286 + .irq_unmask = unmask_m32700ut_lcdpld, 265 287 }; 266 288 267 289 void __init init_IRQ(void) 268 290 { 269 291 #if defined(CONFIG_SMC91X) 270 292 /* INT#0: LAN controller on M32700UT-LAN (SMC91C111)*/ 271 - irq_desc[M32700UT_LAN_IRQ_LAN].status = IRQ_DISABLED; 272 - irq_desc[M32700UT_LAN_IRQ_LAN].chip = &m32700ut_lanpld_irq_type; 273 - irq_desc[M32700UT_LAN_IRQ_LAN].action = 0; 274 - irq_desc[M32700UT_LAN_IRQ_LAN].depth = 1; /* disable nested irq */ 293 + set_irq_chip_and_handler(M32700UT_LAN_IRQ_LAN, 294 + &m32700ut_lanpld_irq_type, handle_level_irq); 275 295 lanpld_icu_data[irq2lanpldirq(M32700UT_LAN_IRQ_LAN)].icucr = PLD_ICUCR_IEN|PLD_ICUCR_ISMOD02; /* "H" edge sense */ 276 296 disable_m32700ut_lanpld_irq(M32700UT_LAN_IRQ_LAN); 277 297 #endif /* CONFIG_SMC91X */ 278 298 279 299 /* MFT2 : system timer */ 280 - irq_desc[M32R_IRQ_MFT2].status = IRQ_DISABLED; 281 - irq_desc[M32R_IRQ_MFT2].chip = &m32700ut_irq_type; 282 - irq_desc[M32R_IRQ_MFT2].action = 0; 283 - irq_desc[M32R_IRQ_MFT2].depth = 1; 300 + set_irq_chip_and_handler(M32R_IRQ_MFT2, &m32700ut_irq_type, 301 + handle_level_irq); 284 302 icu_data[M32R_IRQ_MFT2].icucr = M32R_ICUCR_IEN; 285 303 disable_m32700ut_irq(M32R_IRQ_MFT2); 286 304 287 305 /* SIO0 : receive */ 288 - irq_desc[M32R_IRQ_SIO0_R].status = IRQ_DISABLED; 289 - irq_desc[M32R_IRQ_SIO0_R].chip = &m32700ut_irq_type; 290 - irq_desc[M32R_IRQ_SIO0_R].action = 0; 291 - irq_desc[M32R_IRQ_SIO0_R].depth = 1; 306 + set_irq_chip_and_handler(M32R_IRQ_SIO0_R, &m32700ut_irq_type, 307 + handle_level_irq); 292 308 icu_data[M32R_IRQ_SIO0_R].icucr = 0; 293 309 disable_m32700ut_irq(M32R_IRQ_SIO0_R); 294 310 295 311 /* SIO0 : send */ 296 - irq_desc[M32R_IRQ_SIO0_S].status = IRQ_DISABLED; 297 - irq_desc[M32R_IRQ_SIO0_S].chip = &m32700ut_irq_type; 298 - irq_desc[M32R_IRQ_SIO0_S].action = 0; 299 - irq_desc[M32R_IRQ_SIO0_S].depth = 1; 312 + set_irq_chip_and_handler(M32R_IRQ_SIO0_S, &m32700ut_irq_type, 313 + handle_level_irq); 300 314 icu_data[M32R_IRQ_SIO0_S].icucr = 0; 301 315 disable_m32700ut_irq(M32R_IRQ_SIO0_S); 302 316 303 317 /* SIO1 : receive */ 304 - irq_desc[M32R_IRQ_SIO1_R].status = IRQ_DISABLED; 305 - irq_desc[M32R_IRQ_SIO1_R].chip = &m32700ut_irq_type; 306 - irq_desc[M32R_IRQ_SIO1_R].action = 0; 307 - irq_desc[M32R_IRQ_SIO1_R].depth = 1; 318 + set_irq_chip_and_handler(M32R_IRQ_SIO1_R, &m32700ut_irq_type, 319 + handle_level_irq); 308 320 icu_data[M32R_IRQ_SIO1_R].icucr = 0; 309 321 disable_m32700ut_irq(M32R_IRQ_SIO1_R); 310 322 311 323 /* SIO1 : send */ 312 - irq_desc[M32R_IRQ_SIO1_S].status = IRQ_DISABLED; 313 - irq_desc[M32R_IRQ_SIO1_S].chip = &m32700ut_irq_type; 314 - irq_desc[M32R_IRQ_SIO1_S].action = 0; 315 - irq_desc[M32R_IRQ_SIO1_S].depth = 1; 324 + set_irq_chip_and_handler(M32R_IRQ_SIO1_S, &m32700ut_irq_type, 325 + handle_level_irq); 316 326 icu_data[M32R_IRQ_SIO1_S].icucr = 0; 317 327 disable_m32700ut_irq(M32R_IRQ_SIO1_S); 318 328 319 329 /* DMA1 : */ 320 - irq_desc[M32R_IRQ_DMA1].status = IRQ_DISABLED; 321 - irq_desc[M32R_IRQ_DMA1].chip = &m32700ut_irq_type; 322 - irq_desc[M32R_IRQ_DMA1].action = 0; 323 - irq_desc[M32R_IRQ_DMA1].depth = 1; 330 + set_irq_chip_and_handler(M32R_IRQ_DMA1, &m32700ut_irq_type, 331 + handle_level_irq); 324 332 icu_data[M32R_IRQ_DMA1].icucr = 0; 325 333 disable_m32700ut_irq(M32R_IRQ_DMA1); 326 334 327 335 #ifdef CONFIG_SERIAL_M32R_PLDSIO 328 336 /* INT#1: SIO0 Receive on PLD */ 329 - irq_desc[PLD_IRQ_SIO0_RCV].status = IRQ_DISABLED; 330 - irq_desc[PLD_IRQ_SIO0_RCV].chip = &m32700ut_pld_irq_type; 331 - irq_desc[PLD_IRQ_SIO0_RCV].action = 0; 332 - irq_desc[PLD_IRQ_SIO0_RCV].depth = 1; /* disable nested irq */ 337 + set_irq_chip_and_handler(PLD_IRQ_SIO0_RCV, &m32700ut_pld_irq_type, 338 + handle_level_irq); 333 339 pld_icu_data[irq2pldirq(PLD_IRQ_SIO0_RCV)].icucr = PLD_ICUCR_IEN|PLD_ICUCR_ISMOD03; 334 340 disable_m32700ut_pld_irq(PLD_IRQ_SIO0_RCV); 335 341 336 342 /* INT#1: SIO0 Send on PLD */ 337 - irq_desc[PLD_IRQ_SIO0_SND].status = IRQ_DISABLED; 338 - irq_desc[PLD_IRQ_SIO0_SND].chip = &m32700ut_pld_irq_type; 339 - irq_desc[PLD_IRQ_SIO0_SND].action = 0; 340 - irq_desc[PLD_IRQ_SIO0_SND].depth = 1; /* disable nested irq */ 343 + set_irq_chip_and_handler(PLD_IRQ_SIO0_SND, &m32700ut_pld_irq_type, 344 + handle_level_irq); 341 345 pld_icu_data[irq2pldirq(PLD_IRQ_SIO0_SND)].icucr = PLD_ICUCR_IEN|PLD_ICUCR_ISMOD03; 342 346 disable_m32700ut_pld_irq(PLD_IRQ_SIO0_SND); 343 347 #endif /* CONFIG_SERIAL_M32R_PLDSIO */ 344 348 345 349 /* INT#1: CFC IREQ on PLD */ 346 - irq_desc[PLD_IRQ_CFIREQ].status = IRQ_DISABLED; 347 - irq_desc[PLD_IRQ_CFIREQ].chip = &m32700ut_pld_irq_type; 348 - irq_desc[PLD_IRQ_CFIREQ].action = 0; 349 - irq_desc[PLD_IRQ_CFIREQ].depth = 1; /* disable nested irq */ 350 + set_irq_chip_and_handler(PLD_IRQ_CFIREQ, &m32700ut_pld_irq_type, 351 + handle_level_irq); 350 352 pld_icu_data[irq2pldirq(PLD_IRQ_CFIREQ)].icucr = PLD_ICUCR_IEN|PLD_ICUCR_ISMOD01; /* 'L' level sense */ 351 353 disable_m32700ut_pld_irq(PLD_IRQ_CFIREQ); 352 354 353 355 /* INT#1: CFC Insert on PLD */ 354 - irq_desc[PLD_IRQ_CFC_INSERT].status = IRQ_DISABLED; 355 - irq_desc[PLD_IRQ_CFC_INSERT].chip = &m32700ut_pld_irq_type; 356 - irq_desc[PLD_IRQ_CFC_INSERT].action = 0; 357 - irq_desc[PLD_IRQ_CFC_INSERT].depth = 1; /* disable nested irq */ 356 + set_irq_chip_and_handler(PLD_IRQ_CFC_INSERT, &m32700ut_pld_irq_type, 357 + handle_level_irq); 358 358 pld_icu_data[irq2pldirq(PLD_IRQ_CFC_INSERT)].icucr = PLD_ICUCR_IEN|PLD_ICUCR_ISMOD00; /* 'L' edge sense */ 359 359 disable_m32700ut_pld_irq(PLD_IRQ_CFC_INSERT); 360 360 361 361 /* INT#1: CFC Eject on PLD */ 362 - irq_desc[PLD_IRQ_CFC_EJECT].status = IRQ_DISABLED; 363 - irq_desc[PLD_IRQ_CFC_EJECT].chip = &m32700ut_pld_irq_type; 364 - irq_desc[PLD_IRQ_CFC_EJECT].action = 0; 365 - irq_desc[PLD_IRQ_CFC_EJECT].depth = 1; /* disable nested irq */ 362 + set_irq_chip_and_handler(PLD_IRQ_CFC_EJECT, &m32700ut_pld_irq_type, 363 + handle_level_irq); 366 364 pld_icu_data[irq2pldirq(PLD_IRQ_CFC_EJECT)].icucr = PLD_ICUCR_IEN|PLD_ICUCR_ISMOD02; /* 'H' edge sense */ 367 365 disable_m32700ut_pld_irq(PLD_IRQ_CFC_EJECT); 368 366 ··· 349 413 350 414 #if defined(CONFIG_USB) 351 415 outw(USBCR_OTGS, USBCR); /* USBCR: non-OTG */ 416 + set_irq_chip_and_handler(M32700UT_LCD_IRQ_USB_INT1, 417 + &m32700ut_lcdpld_irq_type, handle_level_irq); 352 418 353 - irq_desc[M32700UT_LCD_IRQ_USB_INT1].status = IRQ_DISABLED; 354 - irq_desc[M32700UT_LCD_IRQ_USB_INT1].chip = &m32700ut_lcdpld_irq_type; 355 - irq_desc[M32700UT_LCD_IRQ_USB_INT1].action = 0; 356 - irq_desc[M32700UT_LCD_IRQ_USB_INT1].depth = 1; 357 - lcdpld_icu_data[irq2lcdpldirq(M32700UT_LCD_IRQ_USB_INT1)].icucr = PLD_ICUCR_IEN|PLD_ICUCR_ISMOD01; /* "L" level sense */ 358 - disable_m32700ut_lcdpld_irq(M32700UT_LCD_IRQ_USB_INT1); 419 + lcdpld_icu_data[irq2lcdpldirq(M32700UT_LCD_IRQ_USB_INT1)].icucr = PLD_ICUCR_IEN|PLD_ICUCR_ISMOD01; /* "L" level sense */ 420 + disable_m32700ut_lcdpld_irq(M32700UT_LCD_IRQ_USB_INT1); 359 421 #endif 360 422 /* 361 423 * INT2# is used for BAT, USB, AUDIO ··· 366 432 /* 367 433 * INT3# is used for AR 368 434 */ 369 - irq_desc[M32R_IRQ_INT3].status = IRQ_DISABLED; 370 - irq_desc[M32R_IRQ_INT3].chip = &m32700ut_irq_type; 371 - irq_desc[M32R_IRQ_INT3].action = 0; 372 - irq_desc[M32R_IRQ_INT3].depth = 1; 435 + set_irq_chip_and_handler(M32R_IRQ_INT3, &m32700ut_irq_type, 436 + handle_level_irq); 373 437 icu_data[M32R_IRQ_INT3].icucr = M32R_ICUCR_IEN|M32R_ICUCR_ISMOD10; 374 438 disable_m32700ut_irq(M32R_IRQ_INT3); 375 439 #endif /* CONFIG_VIDEO_M32R_AR */
+26 -52
arch/m32r/platforms/mappi/setup.c
··· 38 38 outl(data, port); 39 39 } 40 40 41 - static void mask_and_ack_mappi(unsigned int irq) 41 + static void mask_mappi(struct irq_data *data) 42 42 { 43 - disable_mappi_irq(irq); 43 + disable_mappi_irq(data->irq); 44 44 } 45 45 46 - static void end_mappi_irq(unsigned int irq) 46 + static void unmask_mappi(struct irq_data *data) 47 47 { 48 - if (!(irq_desc[irq].status & (IRQ_DISABLED | IRQ_INPROGRESS))) 49 - enable_mappi_irq(irq); 48 + enable_mappi_irq(data->irq); 50 49 } 51 50 52 - static unsigned int startup_mappi_irq(unsigned int irq) 53 - { 54 - enable_mappi_irq(irq); 55 - return (0); 56 - } 57 - 58 - static void shutdown_mappi_irq(unsigned int irq) 51 + static void shutdown_mappi(struct irq_data *data) 59 52 { 60 53 unsigned long port; 61 54 62 - port = irq2port(irq); 55 + port = irq2port(data->irq); 63 56 outl(M32R_ICUCR_ILEVEL7, port); 64 57 } 65 58 66 59 static struct irq_chip mappi_irq_type = 67 60 { 68 - .name = "MAPPI-IRQ", 69 - .startup = startup_mappi_irq, 70 - .shutdown = shutdown_mappi_irq, 71 - .enable = enable_mappi_irq, 72 - .disable = disable_mappi_irq, 73 - .ack = mask_and_ack_mappi, 74 - .end = end_mappi_irq 61 + .name = "MAPPI-IRQ", 62 + .irq_shutdown = shutdown_mappi, 63 + .irq_mask = mask_mappi, 64 + .irq_unmask = unmask_mappi, 75 65 }; 76 66 77 67 void __init init_IRQ(void) ··· 75 85 76 86 #ifdef CONFIG_NE2000 77 87 /* INT0 : LAN controller (RTL8019AS) */ 78 - irq_desc[M32R_IRQ_INT0].status = IRQ_DISABLED; 79 - irq_desc[M32R_IRQ_INT0].chip = &mappi_irq_type; 80 - irq_desc[M32R_IRQ_INT0].action = NULL; 81 - irq_desc[M32R_IRQ_INT0].depth = 1; 88 + set_irq_chip_and_handler(M32R_IRQ_INT0, &mappi_irq_type, 89 + handle_level_irq); 82 90 icu_data[M32R_IRQ_INT0].icucr = M32R_ICUCR_IEN|M32R_ICUCR_ISMOD11; 83 91 disable_mappi_irq(M32R_IRQ_INT0); 84 92 #endif /* CONFIG_M32R_NE2000 */ 85 93 86 94 /* MFT2 : system timer */ 87 - irq_desc[M32R_IRQ_MFT2].status = IRQ_DISABLED; 88 - irq_desc[M32R_IRQ_MFT2].chip = &mappi_irq_type; 89 - irq_desc[M32R_IRQ_MFT2].action = NULL; 90 - irq_desc[M32R_IRQ_MFT2].depth = 1; 95 + set_irq_chip_and_handler(M32R_IRQ_MFT2, &mappi_irq_type, 96 + handle_level_irq); 91 97 icu_data[M32R_IRQ_MFT2].icucr = M32R_ICUCR_IEN; 92 98 disable_mappi_irq(M32R_IRQ_MFT2); 93 99 94 100 #ifdef CONFIG_SERIAL_M32R_SIO 95 101 /* SIO0_R : uart receive data */ 96 - irq_desc[M32R_IRQ_SIO0_R].status = IRQ_DISABLED; 97 - irq_desc[M32R_IRQ_SIO0_R].chip = &mappi_irq_type; 98 - irq_desc[M32R_IRQ_SIO0_R].action = NULL; 99 - irq_desc[M32R_IRQ_SIO0_R].depth = 1; 102 + set_irq_chip_and_handler(M32R_IRQ_SIO0_R, &mappi_irq_type, 103 + handle_level_irq); 100 104 icu_data[M32R_IRQ_SIO0_R].icucr = 0; 101 105 disable_mappi_irq(M32R_IRQ_SIO0_R); 102 106 103 107 /* SIO0_S : uart send data */ 104 - irq_desc[M32R_IRQ_SIO0_S].status = IRQ_DISABLED; 105 - irq_desc[M32R_IRQ_SIO0_S].chip = &mappi_irq_type; 106 - irq_desc[M32R_IRQ_SIO0_S].action = NULL; 107 - irq_desc[M32R_IRQ_SIO0_S].depth = 1; 108 + set_irq_chip_and_handler(M32R_IRQ_SIO0_S, &mappi_irq_type, 109 + handle_level_irq); 108 110 icu_data[M32R_IRQ_SIO0_S].icucr = 0; 109 111 disable_mappi_irq(M32R_IRQ_SIO0_S); 110 112 111 113 /* SIO1_R : uart receive data */ 112 - irq_desc[M32R_IRQ_SIO1_R].status = IRQ_DISABLED; 113 - irq_desc[M32R_IRQ_SIO1_R].chip = &mappi_irq_type; 114 - irq_desc[M32R_IRQ_SIO1_R].action = NULL; 115 - irq_desc[M32R_IRQ_SIO1_R].depth = 1; 114 + set_irq_chip_and_handler(M32R_IRQ_SIO1_R, &mappi_irq_type, 115 + handle_level_irq); 116 116 icu_data[M32R_IRQ_SIO1_R].icucr = 0; 117 117 disable_mappi_irq(M32R_IRQ_SIO1_R); 118 118 119 119 /* SIO1_S : uart send data */ 120 - irq_desc[M32R_IRQ_SIO1_S].status = IRQ_DISABLED; 121 - irq_desc[M32R_IRQ_SIO1_S].chip = &mappi_irq_type; 122 - irq_desc[M32R_IRQ_SIO1_S].action = NULL; 123 - irq_desc[M32R_IRQ_SIO1_S].depth = 1; 120 + set_irq_chip_and_handler(M32R_IRQ_SIO1_S, &mappi_irq_type, 121 + handle_level_irq); 124 122 icu_data[M32R_IRQ_SIO1_S].icucr = 0; 125 123 disable_mappi_irq(M32R_IRQ_SIO1_S); 126 124 #endif /* CONFIG_SERIAL_M32R_SIO */ 127 125 128 126 #if defined(CONFIG_M32R_PCC) 129 127 /* INT1 : pccard0 interrupt */ 130 - irq_desc[M32R_IRQ_INT1].status = IRQ_DISABLED; 131 - irq_desc[M32R_IRQ_INT1].chip = &mappi_irq_type; 132 - irq_desc[M32R_IRQ_INT1].action = NULL; 133 - irq_desc[M32R_IRQ_INT1].depth = 1; 128 + set_irq_chip_and_handler(M32R_IRQ_INT1, &mappi_irq_type, 129 + handle_level_irq); 134 130 icu_data[M32R_IRQ_INT1].icucr = M32R_ICUCR_IEN | M32R_ICUCR_ISMOD00; 135 131 disable_mappi_irq(M32R_IRQ_INT1); 136 132 137 133 /* INT2 : pccard1 interrupt */ 138 - irq_desc[M32R_IRQ_INT2].status = IRQ_DISABLED; 139 - irq_desc[M32R_IRQ_INT2].chip = &mappi_irq_type; 140 - irq_desc[M32R_IRQ_INT2].action = NULL; 141 - irq_desc[M32R_IRQ_INT2].depth = 1; 134 + set_irq_chip_and_handler(M32R_IRQ_INT2, &mappi_irq_type, 135 + handle_level_irq); 142 136 icu_data[M32R_IRQ_INT2].icucr = M32R_ICUCR_IEN | M32R_ICUCR_ISMOD00; 143 137 disable_mappi_irq(M32R_IRQ_INT2); 144 138 #endif /* CONFIG_M32RPCC */
+30 -59
arch/m32r/platforms/mappi2/setup.c
··· 46 46 outl(data, port); 47 47 } 48 48 49 - static void mask_and_ack_mappi2(unsigned int irq) 49 + static void mask_mappi2(struct irq_data *data) 50 50 { 51 - disable_mappi2_irq(irq); 51 + disable_mappi2_irq(data->irq); 52 52 } 53 53 54 - static void end_mappi2_irq(unsigned int irq) 54 + static void unmask_mappi2(struct irq_data *data) 55 55 { 56 - enable_mappi2_irq(irq); 56 + enable_mappi2_irq(data->irq); 57 57 } 58 58 59 - static unsigned int startup_mappi2_irq(unsigned int irq) 60 - { 61 - enable_mappi2_irq(irq); 62 - return (0); 63 - } 64 - 65 - static void shutdown_mappi2_irq(unsigned int irq) 59 + static void shutdown_mappi2(struct irq_data *data) 66 60 { 67 61 unsigned long port; 68 62 69 - port = irq2port(irq); 63 + port = irq2port(data->irq); 70 64 outl(M32R_ICUCR_ILEVEL7, port); 71 65 } 72 66 73 67 static struct irq_chip mappi2_irq_type = 74 68 { 75 - .name = "MAPPI2-IRQ", 76 - .startup = startup_mappi2_irq, 77 - .shutdown = shutdown_mappi2_irq, 78 - .enable = enable_mappi2_irq, 79 - .disable = disable_mappi2_irq, 80 - .ack = mask_and_ack_mappi2, 81 - .end = end_mappi2_irq 69 + .name = "MAPPI2-IRQ", 70 + .irq_shutdown = shutdown_mappi2, 71 + .irq_mask = mask_mappi2, 72 + .irq_unmask = unmask_mappi2, 82 73 }; 83 74 84 75 void __init init_IRQ(void) 85 76 { 86 77 #if defined(CONFIG_SMC91X) 87 78 /* INT0 : LAN controller (SMC91111) */ 88 - irq_desc[M32R_IRQ_INT0].status = IRQ_DISABLED; 89 - irq_desc[M32R_IRQ_INT0].chip = &mappi2_irq_type; 90 - irq_desc[M32R_IRQ_INT0].action = 0; 91 - irq_desc[M32R_IRQ_INT0].depth = 1; 79 + set_irq_chip_and_handler(M32R_IRQ_INT0, &mappi2_irq_type, 80 + handle_level_irq); 92 81 icu_data[M32R_IRQ_INT0].icucr = M32R_ICUCR_IEN|M32R_ICUCR_ISMOD10; 93 82 disable_mappi2_irq(M32R_IRQ_INT0); 94 83 #endif /* CONFIG_SMC91X */ 95 84 96 85 /* MFT2 : system timer */ 97 - irq_desc[M32R_IRQ_MFT2].status = IRQ_DISABLED; 98 - irq_desc[M32R_IRQ_MFT2].chip = &mappi2_irq_type; 99 - irq_desc[M32R_IRQ_MFT2].action = 0; 100 - irq_desc[M32R_IRQ_MFT2].depth = 1; 86 + set_irq_chip_and_handler(M32R_IRQ_MFT2, &mappi2_irq_type, 87 + handle_level_irq); 101 88 icu_data[M32R_IRQ_MFT2].icucr = M32R_ICUCR_IEN; 102 89 disable_mappi2_irq(M32R_IRQ_MFT2); 103 90 104 91 #ifdef CONFIG_SERIAL_M32R_SIO 105 92 /* SIO0_R : uart receive data */ 106 - irq_desc[M32R_IRQ_SIO0_R].status = IRQ_DISABLED; 107 - irq_desc[M32R_IRQ_SIO0_R].chip = &mappi2_irq_type; 108 - irq_desc[M32R_IRQ_SIO0_R].action = 0; 109 - irq_desc[M32R_IRQ_SIO0_R].depth = 1; 93 + set_irq_chip_and_handler(M32R_IRQ_SIO0_R, &mappi2_irq_type, 94 + handle_level_irq); 110 95 icu_data[M32R_IRQ_SIO0_R].icucr = 0; 111 96 disable_mappi2_irq(M32R_IRQ_SIO0_R); 112 97 113 98 /* SIO0_S : uart send data */ 114 - irq_desc[M32R_IRQ_SIO0_S].status = IRQ_DISABLED; 115 - irq_desc[M32R_IRQ_SIO0_S].chip = &mappi2_irq_type; 116 - irq_desc[M32R_IRQ_SIO0_S].action = 0; 117 - irq_desc[M32R_IRQ_SIO0_S].depth = 1; 99 + set_irq_chip_and_handler(M32R_IRQ_SIO0_S, &mappi2_irq_type, 100 + handle_level_irq); 118 101 icu_data[M32R_IRQ_SIO0_S].icucr = 0; 119 102 disable_mappi2_irq(M32R_IRQ_SIO0_S); 120 103 /* SIO1_R : uart receive data */ 121 - irq_desc[M32R_IRQ_SIO1_R].status = IRQ_DISABLED; 122 - irq_desc[M32R_IRQ_SIO1_R].chip = &mappi2_irq_type; 123 - irq_desc[M32R_IRQ_SIO1_R].action = 0; 124 - irq_desc[M32R_IRQ_SIO1_R].depth = 1; 104 + set_irq_chip_and_handler(M32R_IRQ_SIO1_R, &mappi2_irq_type, 105 + handle_level_irq); 125 106 icu_data[M32R_IRQ_SIO1_R].icucr = 0; 126 107 disable_mappi2_irq(M32R_IRQ_SIO1_R); 127 108 128 109 /* SIO1_S : uart send data */ 129 - irq_desc[M32R_IRQ_SIO1_S].status = IRQ_DISABLED; 130 - irq_desc[M32R_IRQ_SIO1_S].chip = &mappi2_irq_type; 131 - irq_desc[M32R_IRQ_SIO1_S].action = 0; 132 - irq_desc[M32R_IRQ_SIO1_S].depth = 1; 110 + set_irq_chip_and_handler(M32R_IRQ_SIO1_S, &mappi2_irq_type, 111 + handle_level_irq); 133 112 icu_data[M32R_IRQ_SIO1_S].icucr = 0; 134 113 disable_mappi2_irq(M32R_IRQ_SIO1_S); 135 114 #endif /* CONFIG_M32R_USE_DBG_CONSOLE */ 136 115 137 116 #if defined(CONFIG_USB) 138 117 /* INT1 : USB Host controller interrupt */ 139 - irq_desc[M32R_IRQ_INT1].status = IRQ_DISABLED; 140 - irq_desc[M32R_IRQ_INT1].chip = &mappi2_irq_type; 141 - irq_desc[M32R_IRQ_INT1].action = 0; 142 - irq_desc[M32R_IRQ_INT1].depth = 1; 118 + set_irq_chip_and_handler(M32R_IRQ_INT1, &mappi2_irq_type, 119 + handle_level_irq); 143 120 icu_data[M32R_IRQ_INT1].icucr = M32R_ICUCR_ISMOD01; 144 121 disable_mappi2_irq(M32R_IRQ_INT1); 145 122 #endif /* CONFIG_USB */ 146 123 147 124 /* ICUCR40: CFC IREQ */ 148 - irq_desc[PLD_IRQ_CFIREQ].status = IRQ_DISABLED; 149 - irq_desc[PLD_IRQ_CFIREQ].chip = &mappi2_irq_type; 150 - irq_desc[PLD_IRQ_CFIREQ].action = 0; 151 - irq_desc[PLD_IRQ_CFIREQ].depth = 1; /* disable nested irq */ 125 + set_irq_chip_and_handler(PLD_IRQ_CFIREQ, &mappi2_irq_type, 126 + handle_level_irq); 152 127 icu_data[PLD_IRQ_CFIREQ].icucr = M32R_ICUCR_IEN|M32R_ICUCR_ISMOD01; 153 128 disable_mappi2_irq(PLD_IRQ_CFIREQ); 154 129 155 130 #if defined(CONFIG_M32R_CFC) 156 131 /* ICUCR41: CFC Insert */ 157 - irq_desc[PLD_IRQ_CFC_INSERT].status = IRQ_DISABLED; 158 - irq_desc[PLD_IRQ_CFC_INSERT].chip = &mappi2_irq_type; 159 - irq_desc[PLD_IRQ_CFC_INSERT].action = 0; 160 - irq_desc[PLD_IRQ_CFC_INSERT].depth = 1; /* disable nested irq */ 132 + set_irq_chip_and_handler(PLD_IRQ_CFC_INSERT, &mappi2_irq_type, 133 + handle_level_irq); 161 134 icu_data[PLD_IRQ_CFC_INSERT].icucr = M32R_ICUCR_IEN|M32R_ICUCR_ISMOD00; 162 135 disable_mappi2_irq(PLD_IRQ_CFC_INSERT); 163 136 164 137 /* ICUCR42: CFC Eject */ 165 - irq_desc[PLD_IRQ_CFC_EJECT].status = IRQ_DISABLED; 166 - irq_desc[PLD_IRQ_CFC_EJECT].chip = &mappi2_irq_type; 167 - irq_desc[PLD_IRQ_CFC_EJECT].action = 0; 168 - irq_desc[PLD_IRQ_CFC_EJECT].depth = 1; /* disable nested irq */ 138 + set_irq_chip_and_handler(PLD_IRQ_CFC_EJECT, &mappi2_irq_type, 139 + handle_level_irq); 169 140 icu_data[PLD_IRQ_CFC_EJECT].icucr = M32R_ICUCR_IEN|M32R_ICUCR_ISMOD10; 170 141 disable_mappi2_irq(PLD_IRQ_CFC_EJECT); 171 142 #endif /* CONFIG_MAPPI2_CFC */
+31 -61
arch/m32r/platforms/mappi3/setup.c
··· 46 46 outl(data, port); 47 47 } 48 48 49 - static void mask_and_ack_mappi3(unsigned int irq) 49 + static void mask_mappi3(struct irq_data *data) 50 50 { 51 - disable_mappi3_irq(irq); 51 + disable_mappi3_irq(data->irq); 52 52 } 53 53 54 - static void end_mappi3_irq(unsigned int irq) 54 + static void unmask_mappi3(struct irq_data *data) 55 55 { 56 - enable_mappi3_irq(irq); 56 + enable_mappi3_irq(data->irq); 57 57 } 58 58 59 - static unsigned int startup_mappi3_irq(unsigned int irq) 60 - { 61 - enable_mappi3_irq(irq); 62 - return (0); 63 - } 64 - 65 - static void shutdown_mappi3_irq(unsigned int irq) 59 + static void shutdown_mappi3(struct irq_data *data) 66 60 { 67 61 unsigned long port; 68 62 69 - port = irq2port(irq); 63 + port = irq2port(data->irq); 70 64 outl(M32R_ICUCR_ILEVEL7, port); 71 65 } 72 66 73 - static struct irq_chip mappi3_irq_type = 74 - { 75 - .name = "MAPPI3-IRQ", 76 - .startup = startup_mappi3_irq, 77 - .shutdown = shutdown_mappi3_irq, 78 - .enable = enable_mappi3_irq, 79 - .disable = disable_mappi3_irq, 80 - .ack = mask_and_ack_mappi3, 81 - .end = end_mappi3_irq 67 + static struct irq_chip mappi3_irq_type = { 68 + .name = "MAPPI3-IRQ", 69 + .irq_shutdown = shutdown_mappi3, 70 + .irq_mask = mask_mappi3, 71 + .irq_unmask = unmask_mappi3, 82 72 }; 83 73 84 74 void __init init_IRQ(void) 85 75 { 86 76 #if defined(CONFIG_SMC91X) 87 77 /* INT0 : LAN controller (SMC91111) */ 88 - irq_desc[M32R_IRQ_INT0].status = IRQ_DISABLED; 89 - irq_desc[M32R_IRQ_INT0].chip = &mappi3_irq_type; 90 - irq_desc[M32R_IRQ_INT0].action = 0; 91 - irq_desc[M32R_IRQ_INT0].depth = 1; 78 + set_irq_chip_and_handler(M32R_IRQ_INT0, &mappi3_irq_type, 79 + handle_level_irq); 92 80 icu_data[M32R_IRQ_INT0].icucr = M32R_ICUCR_IEN|M32R_ICUCR_ISMOD10; 93 81 disable_mappi3_irq(M32R_IRQ_INT0); 94 82 #endif /* CONFIG_SMC91X */ 95 83 96 84 /* MFT2 : system timer */ 97 - irq_desc[M32R_IRQ_MFT2].status = IRQ_DISABLED; 98 - irq_desc[M32R_IRQ_MFT2].chip = &mappi3_irq_type; 99 - irq_desc[M32R_IRQ_MFT2].action = 0; 100 - irq_desc[M32R_IRQ_MFT2].depth = 1; 85 + set_irq_chip_and_handler(M32R_IRQ_MFT2, &mappi3_irq_type, 86 + handle_level_irq); 101 87 icu_data[M32R_IRQ_MFT2].icucr = M32R_ICUCR_IEN; 102 88 disable_mappi3_irq(M32R_IRQ_MFT2); 103 89 104 90 #ifdef CONFIG_SERIAL_M32R_SIO 105 91 /* SIO0_R : uart receive data */ 106 - irq_desc[M32R_IRQ_SIO0_R].status = IRQ_DISABLED; 107 - irq_desc[M32R_IRQ_SIO0_R].chip = &mappi3_irq_type; 108 - irq_desc[M32R_IRQ_SIO0_R].action = 0; 109 - irq_desc[M32R_IRQ_SIO0_R].depth = 1; 92 + set_irq_chip_and_handler(M32R_IRQ_SIO0_R, &mappi3_irq_type, 93 + handle_level_irq); 110 94 icu_data[M32R_IRQ_SIO0_R].icucr = 0; 111 95 disable_mappi3_irq(M32R_IRQ_SIO0_R); 112 96 113 97 /* SIO0_S : uart send data */ 114 - irq_desc[M32R_IRQ_SIO0_S].status = IRQ_DISABLED; 115 - irq_desc[M32R_IRQ_SIO0_S].chip = &mappi3_irq_type; 116 - irq_desc[M32R_IRQ_SIO0_S].action = 0; 117 - irq_desc[M32R_IRQ_SIO0_S].depth = 1; 98 + set_irq_chip_and_handler(M32R_IRQ_SIO0_S, &mappi3_irq_type, 99 + handle_level_irq); 118 100 icu_data[M32R_IRQ_SIO0_S].icucr = 0; 119 101 disable_mappi3_irq(M32R_IRQ_SIO0_S); 120 102 /* SIO1_R : uart receive data */ 121 - irq_desc[M32R_IRQ_SIO1_R].status = IRQ_DISABLED; 122 - irq_desc[M32R_IRQ_SIO1_R].chip = &mappi3_irq_type; 123 - irq_desc[M32R_IRQ_SIO1_R].action = 0; 124 - irq_desc[M32R_IRQ_SIO1_R].depth = 1; 103 + set_irq_chip_and_handler(M32R_IRQ_SIO1_R, &mappi3_irq_type, 104 + handle_level_irq); 125 105 icu_data[M32R_IRQ_SIO1_R].icucr = 0; 126 106 disable_mappi3_irq(M32R_IRQ_SIO1_R); 127 107 128 108 /* SIO1_S : uart send data */ 129 - irq_desc[M32R_IRQ_SIO1_S].status = IRQ_DISABLED; 130 - irq_desc[M32R_IRQ_SIO1_S].chip = &mappi3_irq_type; 131 - irq_desc[M32R_IRQ_SIO1_S].action = 0; 132 - irq_desc[M32R_IRQ_SIO1_S].depth = 1; 109 + set_irq_chip_and_handler(M32R_IRQ_SIO1_S, &mappi3_irq_type, 110 + handle_level_irq); 133 111 icu_data[M32R_IRQ_SIO1_S].icucr = 0; 134 112 disable_mappi3_irq(M32R_IRQ_SIO1_S); 135 113 #endif /* CONFIG_M32R_USE_DBG_CONSOLE */ 136 114 137 115 #if defined(CONFIG_USB) 138 116 /* INT1 : USB Host controller interrupt */ 139 - irq_desc[M32R_IRQ_INT1].status = IRQ_DISABLED; 140 - irq_desc[M32R_IRQ_INT1].chip = &mappi3_irq_type; 141 - irq_desc[M32R_IRQ_INT1].action = 0; 142 - irq_desc[M32R_IRQ_INT1].depth = 1; 117 + set_irq_chip_and_handler(M32R_IRQ_INT1, &mappi3_irq_type, 118 + handle_level_irq); 143 119 icu_data[M32R_IRQ_INT1].icucr = M32R_ICUCR_ISMOD01; 144 120 disable_mappi3_irq(M32R_IRQ_INT1); 145 121 #endif /* CONFIG_USB */ 146 122 147 123 /* CFC IREQ */ 148 - irq_desc[PLD_IRQ_CFIREQ].status = IRQ_DISABLED; 149 - irq_desc[PLD_IRQ_CFIREQ].chip = &mappi3_irq_type; 150 - irq_desc[PLD_IRQ_CFIREQ].action = 0; 151 - irq_desc[PLD_IRQ_CFIREQ].depth = 1; /* disable nested irq */ 124 + set_irq_chip_and_handler(PLD_IRQ_CFIREQ, &mappi3_irq_type, 125 + handle_level_irq); 152 126 icu_data[PLD_IRQ_CFIREQ].icucr = M32R_ICUCR_IEN|M32R_ICUCR_ISMOD01; 153 127 disable_mappi3_irq(PLD_IRQ_CFIREQ); 154 128 155 129 #if defined(CONFIG_M32R_CFC) 156 130 /* ICUCR41: CFC Insert & eject */ 157 - irq_desc[PLD_IRQ_CFC_INSERT].status = IRQ_DISABLED; 158 - irq_desc[PLD_IRQ_CFC_INSERT].chip = &mappi3_irq_type; 159 - irq_desc[PLD_IRQ_CFC_INSERT].action = 0; 160 - irq_desc[PLD_IRQ_CFC_INSERT].depth = 1; /* disable nested irq */ 131 + set_irq_chip_and_handler(PLD_IRQ_CFC_INSERT, &mappi3_irq_type, 132 + handle_level_irq); 161 133 icu_data[PLD_IRQ_CFC_INSERT].icucr = M32R_ICUCR_IEN|M32R_ICUCR_ISMOD00; 162 134 disable_mappi3_irq(PLD_IRQ_CFC_INSERT); 163 135 164 136 #endif /* CONFIG_M32R_CFC */ 165 137 166 138 /* IDE IREQ */ 167 - irq_desc[PLD_IRQ_IDEIREQ].status = IRQ_DISABLED; 168 - irq_desc[PLD_IRQ_IDEIREQ].chip = &mappi3_irq_type; 169 - irq_desc[PLD_IRQ_IDEIREQ].action = 0; 170 - irq_desc[PLD_IRQ_IDEIREQ].depth = 1; /* disable nested irq */ 139 + set_irq_chip_and_handler(PLD_IRQ_IDEIREQ, &mappi3_irq_type, 140 + handle_level_irq); 171 141 icu_data[PLD_IRQ_IDEIREQ].icucr = M32R_ICUCR_IEN|M32R_ICUCR_ISMOD10; 172 142 disable_mappi3_irq(PLD_IRQ_IDEIREQ); 173 143
+22 -43
arch/m32r/platforms/oaks32r/setup.c
··· 37 37 outl(data, port); 38 38 } 39 39 40 - static void mask_and_ack_mappi(unsigned int irq) 40 + static void mask_oaks32r(struct irq_data *data) 41 41 { 42 - disable_oaks32r_irq(irq); 42 + disable_oaks32r_irq(data->irq); 43 43 } 44 44 45 - static void end_oaks32r_irq(unsigned int irq) 45 + static void unmask_oaks32r(struct irq_data *data) 46 46 { 47 - enable_oaks32r_irq(irq); 47 + enable_oaks32r_irq(data->irq); 48 48 } 49 49 50 - static unsigned int startup_oaks32r_irq(unsigned int irq) 51 - { 52 - enable_oaks32r_irq(irq); 53 - return (0); 54 - } 55 - 56 - static void shutdown_oaks32r_irq(unsigned int irq) 50 + static void shutdown_oaks32r(struct irq_data *data) 57 51 { 58 52 unsigned long port; 59 53 60 - port = irq2port(irq); 54 + port = irq2port(data->irq); 61 55 outl(M32R_ICUCR_ILEVEL7, port); 62 56 } 63 57 64 58 static struct irq_chip oaks32r_irq_type = 65 59 { 66 - .name = "OAKS32R-IRQ", 67 - .startup = startup_oaks32r_irq, 68 - .shutdown = shutdown_oaks32r_irq, 69 - .enable = enable_oaks32r_irq, 70 - .disable = disable_oaks32r_irq, 71 - .ack = mask_and_ack_mappi, 72 - .end = end_oaks32r_irq 60 + .name = "OAKS32R-IRQ", 61 + .irq_shutdown = shutdown_oaks32r, 62 + .irq_mask = mask_oaks32r, 63 + .irq_unmask = unmask_oaks32r, 73 64 }; 74 65 75 66 void __init init_IRQ(void) ··· 74 83 75 84 #ifdef CONFIG_NE2000 76 85 /* INT3 : LAN controller (RTL8019AS) */ 77 - irq_desc[M32R_IRQ_INT3].status = IRQ_DISABLED; 78 - irq_desc[M32R_IRQ_INT3].chip = &oaks32r_irq_type; 79 - irq_desc[M32R_IRQ_INT3].action = 0; 80 - irq_desc[M32R_IRQ_INT3].depth = 1; 86 + set_irq_chip_and_handler(M32R_IRQ_INT3, &oaks32r_irq_type, 87 + handle_level_irq); 81 88 icu_data[M32R_IRQ_INT3].icucr = M32R_ICUCR_IEN|M32R_ICUCR_ISMOD10; 82 89 disable_oaks32r_irq(M32R_IRQ_INT3); 83 90 #endif /* CONFIG_M32R_NE2000 */ 84 91 85 92 /* MFT2 : system timer */ 86 - irq_desc[M32R_IRQ_MFT2].status = IRQ_DISABLED; 87 - irq_desc[M32R_IRQ_MFT2].chip = &oaks32r_irq_type; 88 - irq_desc[M32R_IRQ_MFT2].action = 0; 89 - irq_desc[M32R_IRQ_MFT2].depth = 1; 93 + set_irq_chip_and_handler(M32R_IRQ_MFT2, &oaks32r_irq_type, 94 + handle_level_irq); 90 95 icu_data[M32R_IRQ_MFT2].icucr = M32R_ICUCR_IEN; 91 96 disable_oaks32r_irq(M32R_IRQ_MFT2); 92 97 93 98 #ifdef CONFIG_SERIAL_M32R_SIO 94 99 /* SIO0_R : uart receive data */ 95 - irq_desc[M32R_IRQ_SIO0_R].status = IRQ_DISABLED; 96 - irq_desc[M32R_IRQ_SIO0_R].chip = &oaks32r_irq_type; 97 - irq_desc[M32R_IRQ_SIO0_R].action = 0; 98 - irq_desc[M32R_IRQ_SIO0_R].depth = 1; 100 + set_irq_chip_and_handler(M32R_IRQ_SIO0_R, &oaks32r_irq_type, 101 + handle_level_irq); 99 102 icu_data[M32R_IRQ_SIO0_R].icucr = 0; 100 103 disable_oaks32r_irq(M32R_IRQ_SIO0_R); 101 104 102 105 /* SIO0_S : uart send data */ 103 - irq_desc[M32R_IRQ_SIO0_S].status = IRQ_DISABLED; 104 - irq_desc[M32R_IRQ_SIO0_S].chip = &oaks32r_irq_type; 105 - irq_desc[M32R_IRQ_SIO0_S].action = 0; 106 - irq_desc[M32R_IRQ_SIO0_S].depth = 1; 106 + set_irq_chip_and_handler(M32R_IRQ_SIO0_S, &oaks32r_irq_type, 107 + handle_level_irq); 107 108 icu_data[M32R_IRQ_SIO0_S].icucr = 0; 108 109 disable_oaks32r_irq(M32R_IRQ_SIO0_S); 109 110 110 111 /* SIO1_R : uart receive data */ 111 - irq_desc[M32R_IRQ_SIO1_R].status = IRQ_DISABLED; 112 - irq_desc[M32R_IRQ_SIO1_R].chip = &oaks32r_irq_type; 113 - irq_desc[M32R_IRQ_SIO1_R].action = 0; 114 - irq_desc[M32R_IRQ_SIO1_R].depth = 1; 112 + set_irq_chip_and_handler(M32R_IRQ_SIO1_R, &oaks32r_irq_type, 113 + handle_level_irq); 115 114 icu_data[M32R_IRQ_SIO1_R].icucr = 0; 116 115 disable_oaks32r_irq(M32R_IRQ_SIO1_R); 117 116 118 117 /* SIO1_S : uart send data */ 119 - irq_desc[M32R_IRQ_SIO1_S].status = IRQ_DISABLED; 120 - irq_desc[M32R_IRQ_SIO1_S].chip = &oaks32r_irq_type; 121 - irq_desc[M32R_IRQ_SIO1_S].action = 0; 122 - irq_desc[M32R_IRQ_SIO1_S].depth = 1; 118 + set_irq_chip_and_handler(M32R_IRQ_SIO1_S, &oaks32r_irq_type, 119 + handle_level_irq); 123 120 icu_data[M32R_IRQ_SIO1_S].icucr = 0; 124 121 disable_oaks32r_irq(M32R_IRQ_SIO1_S); 125 122 #endif /* CONFIG_SERIAL_M32R_SIO */
+75 -145
arch/m32r/platforms/opsput/setup.c
··· 46 46 outl(data, port); 47 47 } 48 48 49 - static void mask_and_ack_opsput(unsigned int irq) 49 + static void mask_opsput(struct irq_data *data) 50 50 { 51 - disable_opsput_irq(irq); 51 + disable_opsput_irq(data->irq); 52 52 } 53 53 54 - static void end_opsput_irq(unsigned int irq) 54 + static void unmask_opsput(struct irq_data *data) 55 55 { 56 - enable_opsput_irq(irq); 56 + enable_opsput_irq(data->irq); 57 57 } 58 58 59 - static unsigned int startup_opsput_irq(unsigned int irq) 60 - { 61 - enable_opsput_irq(irq); 62 - return (0); 63 - } 64 - 65 - static void shutdown_opsput_irq(unsigned int irq) 59 + static void shutdown_opsput(struct irq_data *data) 66 60 { 67 61 unsigned long port; 68 62 69 - port = irq2port(irq); 63 + port = irq2port(data->irq); 70 64 outl(M32R_ICUCR_ILEVEL7, port); 71 65 } 72 66 73 67 static struct irq_chip opsput_irq_type = 74 68 { 75 - .name = "OPSPUT-IRQ", 76 - .startup = startup_opsput_irq, 77 - .shutdown = shutdown_opsput_irq, 78 - .enable = enable_opsput_irq, 79 - .disable = disable_opsput_irq, 80 - .ack = mask_and_ack_opsput, 81 - .end = end_opsput_irq 69 + .name = "OPSPUT-IRQ", 70 + .irq_shutdown = shutdown_opsput, 71 + .irq_mask = mask_opsput, 72 + .irq_unmask = unmask_opsput, 82 73 }; 83 74 84 75 /* ··· 91 100 unsigned int pldirq; 92 101 93 102 pldirq = irq2pldirq(irq); 94 - // disable_opsput_irq(M32R_IRQ_INT1); 95 103 port = pldirq2port(pldirq); 96 104 data = pld_icu_data[pldirq].icucr|PLD_ICUCR_ILEVEL7; 97 105 outw(data, port); ··· 102 112 unsigned int pldirq; 103 113 104 114 pldirq = irq2pldirq(irq); 105 - // enable_opsput_irq(M32R_IRQ_INT1); 106 115 port = pldirq2port(pldirq); 107 116 data = pld_icu_data[pldirq].icucr|PLD_ICUCR_IEN|PLD_ICUCR_ILEVEL6; 108 117 outw(data, port); 109 118 } 110 119 111 - static void mask_and_ack_opsput_pld(unsigned int irq) 120 + static void mask_opsput_pld(struct irq_data *data) 112 121 { 113 - disable_opsput_pld_irq(irq); 114 - // mask_and_ack_opsput(M32R_IRQ_INT1); 122 + disable_opsput_pld_irq(data->irq); 115 123 } 116 124 117 - static void end_opsput_pld_irq(unsigned int irq) 125 + static void unmask_opsput_pld(struct irq_data *data) 118 126 { 119 - enable_opsput_pld_irq(irq); 120 - end_opsput_irq(M32R_IRQ_INT1); 127 + enable_opsput_pld_irq(data->irq); 128 + enable_opsput_irq(M32R_IRQ_INT1); 121 129 } 122 130 123 - static unsigned int startup_opsput_pld_irq(unsigned int irq) 124 - { 125 - enable_opsput_pld_irq(irq); 126 - return (0); 127 - } 128 - 129 - static void shutdown_opsput_pld_irq(unsigned int irq) 131 + static void shutdown_opsput_pld(struct irq_data *data) 130 132 { 131 133 unsigned long port; 132 134 unsigned int pldirq; 133 135 134 - pldirq = irq2pldirq(irq); 135 - // shutdown_opsput_irq(M32R_IRQ_INT1); 136 + pldirq = irq2pldirq(data->irq); 136 137 port = pldirq2port(pldirq); 137 138 outw(PLD_ICUCR_ILEVEL7, port); 138 139 } 139 140 140 141 static struct irq_chip opsput_pld_irq_type = 141 142 { 142 - .name = "OPSPUT-PLD-IRQ", 143 - .startup = startup_opsput_pld_irq, 144 - .shutdown = shutdown_opsput_pld_irq, 145 - .enable = enable_opsput_pld_irq, 146 - .disable = disable_opsput_pld_irq, 147 - .ack = mask_and_ack_opsput_pld, 148 - .end = end_opsput_pld_irq 143 + .name = "OPSPUT-PLD-IRQ", 144 + .irq_shutdown = shutdown_opsput_pld, 145 + .irq_mask = mask_opsput_pld, 146 + .irq_unmask = unmask_opsput_pld, 149 147 }; 150 148 151 149 /* ··· 167 189 outw(data, port); 168 190 } 169 191 170 - static void mask_and_ack_opsput_lanpld(unsigned int irq) 192 + static void mask_opsput_lanpld(struct irq_data *data) 171 193 { 172 - disable_opsput_lanpld_irq(irq); 194 + disable_opsput_lanpld_irq(data->irq); 173 195 } 174 196 175 - static void end_opsput_lanpld_irq(unsigned int irq) 197 + static void unmask_opsput_lanpld(struct irq_data *data) 176 198 { 177 - enable_opsput_lanpld_irq(irq); 178 - end_opsput_irq(M32R_IRQ_INT0); 199 + enable_opsput_lanpld_irq(data->irq); 200 + enable_opsput_irq(M32R_IRQ_INT0); 179 201 } 180 202 181 - static unsigned int startup_opsput_lanpld_irq(unsigned int irq) 182 - { 183 - enable_opsput_lanpld_irq(irq); 184 - return (0); 185 - } 186 - 187 - static void shutdown_opsput_lanpld_irq(unsigned int irq) 203 + static void shutdown_opsput_lanpld(struct irq_data *data) 188 204 { 189 205 unsigned long port; 190 206 unsigned int pldirq; 191 207 192 - pldirq = irq2lanpldirq(irq); 208 + pldirq = irq2lanpldirq(data->irq); 193 209 port = lanpldirq2port(pldirq); 194 210 outw(PLD_ICUCR_ILEVEL7, port); 195 211 } 196 212 197 213 static struct irq_chip opsput_lanpld_irq_type = 198 214 { 199 - .name = "OPSPUT-PLD-LAN-IRQ", 200 - .startup = startup_opsput_lanpld_irq, 201 - .shutdown = shutdown_opsput_lanpld_irq, 202 - .enable = enable_opsput_lanpld_irq, 203 - .disable = disable_opsput_lanpld_irq, 204 - .ack = mask_and_ack_opsput_lanpld, 205 - .end = end_opsput_lanpld_irq 215 + .name = "OPSPUT-PLD-LAN-IRQ", 216 + .irq_shutdown = shutdown_opsput_lanpld, 217 + .irq_mask = mask_opsput_lanpld, 218 + .irq_unmask = unmask_opsput_lanpld, 206 219 }; 207 220 208 221 /* ··· 227 258 outw(data, port); 228 259 } 229 260 230 - static void mask_and_ack_opsput_lcdpld(unsigned int irq) 261 + static void mask_opsput_lcdpld(struct irq_data *data) 231 262 { 232 - disable_opsput_lcdpld_irq(irq); 263 + disable_opsput_lcdpld_irq(data->irq); 233 264 } 234 265 235 - static void end_opsput_lcdpld_irq(unsigned int irq) 266 + static void unmask_opsput_lcdpld(struct irq_data *data) 236 267 { 237 - enable_opsput_lcdpld_irq(irq); 238 - end_opsput_irq(M32R_IRQ_INT2); 268 + enable_opsput_lcdpld_irq(data->irq); 269 + enable_opsput_irq(M32R_IRQ_INT2); 239 270 } 240 271 241 - static unsigned int startup_opsput_lcdpld_irq(unsigned int irq) 242 - { 243 - enable_opsput_lcdpld_irq(irq); 244 - return (0); 245 - } 246 - 247 - static void shutdown_opsput_lcdpld_irq(unsigned int irq) 272 + static void shutdown_opsput_lcdpld(struct irq_data *data) 248 273 { 249 274 unsigned long port; 250 275 unsigned int pldirq; 251 276 252 - pldirq = irq2lcdpldirq(irq); 277 + pldirq = irq2lcdpldirq(data->irq); 253 278 port = lcdpldirq2port(pldirq); 254 279 outw(PLD_ICUCR_ILEVEL7, port); 255 280 } 256 281 257 - static struct irq_chip opsput_lcdpld_irq_type = 258 - { 259 - "OPSPUT-PLD-LCD-IRQ", 260 - startup_opsput_lcdpld_irq, 261 - shutdown_opsput_lcdpld_irq, 262 - enable_opsput_lcdpld_irq, 263 - disable_opsput_lcdpld_irq, 264 - mask_and_ack_opsput_lcdpld, 265 - end_opsput_lcdpld_irq 282 + static struct irq_chip opsput_lcdpld_irq_type = { 283 + .name = "OPSPUT-PLD-LCD-IRQ", 284 + .irq_shutdown = shutdown_opsput_lcdpld, 285 + .irq_mask = mask_opsput_lcdpld, 286 + .irq_unmask = unmask_opsput_lcdpld, 266 287 }; 267 288 268 289 void __init init_IRQ(void) 269 290 { 270 291 #if defined(CONFIG_SMC91X) 271 292 /* INT#0: LAN controller on OPSPUT-LAN (SMC91C111)*/ 272 - irq_desc[OPSPUT_LAN_IRQ_LAN].status = IRQ_DISABLED; 273 - irq_desc[OPSPUT_LAN_IRQ_LAN].chip = &opsput_lanpld_irq_type; 274 - irq_desc[OPSPUT_LAN_IRQ_LAN].action = 0; 275 - irq_desc[OPSPUT_LAN_IRQ_LAN].depth = 1; /* disable nested irq */ 293 + set_irq_chip_and_handler(OPSPUT_LAN_IRQ_LAN, &opsput_lanpld_irq_type, 294 + handle_level_irq); 276 295 lanpld_icu_data[irq2lanpldirq(OPSPUT_LAN_IRQ_LAN)].icucr = PLD_ICUCR_IEN|PLD_ICUCR_ISMOD02; /* "H" edge sense */ 277 296 disable_opsput_lanpld_irq(OPSPUT_LAN_IRQ_LAN); 278 297 #endif /* CONFIG_SMC91X */ 279 298 280 299 /* MFT2 : system timer */ 281 - irq_desc[M32R_IRQ_MFT2].status = IRQ_DISABLED; 282 - irq_desc[M32R_IRQ_MFT2].chip = &opsput_irq_type; 283 - irq_desc[M32R_IRQ_MFT2].action = 0; 284 - irq_desc[M32R_IRQ_MFT2].depth = 1; 300 + set_irq_chip_and_handler(M32R_IRQ_MFT2, &opsput_irq_type, 301 + handle_level_irq); 285 302 icu_data[M32R_IRQ_MFT2].icucr = M32R_ICUCR_IEN; 286 303 disable_opsput_irq(M32R_IRQ_MFT2); 287 304 288 305 /* SIO0 : receive */ 289 - irq_desc[M32R_IRQ_SIO0_R].status = IRQ_DISABLED; 290 - irq_desc[M32R_IRQ_SIO0_R].chip = &opsput_irq_type; 291 - irq_desc[M32R_IRQ_SIO0_R].action = 0; 292 - irq_desc[M32R_IRQ_SIO0_R].depth = 1; 306 + set_irq_chip_and_handler(M32R_IRQ_SIO0_R, &opsput_irq_type, 307 + handle_level_irq); 293 308 icu_data[M32R_IRQ_SIO0_R].icucr = 0; 294 309 disable_opsput_irq(M32R_IRQ_SIO0_R); 295 310 296 311 /* SIO0 : send */ 297 - irq_desc[M32R_IRQ_SIO0_S].status = IRQ_DISABLED; 298 - irq_desc[M32R_IRQ_SIO0_S].chip = &opsput_irq_type; 299 - irq_desc[M32R_IRQ_SIO0_S].action = 0; 300 - irq_desc[M32R_IRQ_SIO0_S].depth = 1; 312 + set_irq_chip_and_handler(M32R_IRQ_SIO0_S, &opsput_irq_type, 313 + handle_level_irq); 301 314 icu_data[M32R_IRQ_SIO0_S].icucr = 0; 302 315 disable_opsput_irq(M32R_IRQ_SIO0_S); 303 316 304 317 /* SIO1 : receive */ 305 - irq_desc[M32R_IRQ_SIO1_R].status = IRQ_DISABLED; 306 - irq_desc[M32R_IRQ_SIO1_R].chip = &opsput_irq_type; 307 - irq_desc[M32R_IRQ_SIO1_R].action = 0; 308 - irq_desc[M32R_IRQ_SIO1_R].depth = 1; 318 + set_irq_chip_and_handler(M32R_IRQ_SIO1_R, &opsput_irq_type, 319 + handle_level_irq); 309 320 icu_data[M32R_IRQ_SIO1_R].icucr = 0; 310 321 disable_opsput_irq(M32R_IRQ_SIO1_R); 311 322 312 323 /* SIO1 : send */ 313 - irq_desc[M32R_IRQ_SIO1_S].status = IRQ_DISABLED; 314 - irq_desc[M32R_IRQ_SIO1_S].chip = &opsput_irq_type; 315 - irq_desc[M32R_IRQ_SIO1_S].action = 0; 316 - irq_desc[M32R_IRQ_SIO1_S].depth = 1; 324 + set_irq_chip_and_handler(M32R_IRQ_SIO1_S, &opsput_irq_type, 325 + handle_level_irq); 317 326 icu_data[M32R_IRQ_SIO1_S].icucr = 0; 318 327 disable_opsput_irq(M32R_IRQ_SIO1_S); 319 328 320 329 /* DMA1 : */ 321 - irq_desc[M32R_IRQ_DMA1].status = IRQ_DISABLED; 322 - irq_desc[M32R_IRQ_DMA1].chip = &opsput_irq_type; 323 - irq_desc[M32R_IRQ_DMA1].action = 0; 324 - irq_desc[M32R_IRQ_DMA1].depth = 1; 330 + set_irq_chip_and_handler(M32R_IRQ_DMA1, &opsput_irq_type, 331 + handle_level_irq); 325 332 icu_data[M32R_IRQ_DMA1].icucr = 0; 326 333 disable_opsput_irq(M32R_IRQ_DMA1); 327 334 328 335 #ifdef CONFIG_SERIAL_M32R_PLDSIO 329 336 /* INT#1: SIO0 Receive on PLD */ 330 - irq_desc[PLD_IRQ_SIO0_RCV].status = IRQ_DISABLED; 331 - irq_desc[PLD_IRQ_SIO0_RCV].chip = &opsput_pld_irq_type; 332 - irq_desc[PLD_IRQ_SIO0_RCV].action = 0; 333 - irq_desc[PLD_IRQ_SIO0_RCV].depth = 1; /* disable nested irq */ 337 + set_irq_chip_and_handler(PLD_IRQ_SIO0_RCV, &opsput_pld_irq_type, 338 + handle_level_irq); 334 339 pld_icu_data[irq2pldirq(PLD_IRQ_SIO0_RCV)].icucr = PLD_ICUCR_IEN|PLD_ICUCR_ISMOD03; 335 340 disable_opsput_pld_irq(PLD_IRQ_SIO0_RCV); 336 341 337 342 /* INT#1: SIO0 Send on PLD */ 338 - irq_desc[PLD_IRQ_SIO0_SND].status = IRQ_DISABLED; 339 - irq_desc[PLD_IRQ_SIO0_SND].chip = &opsput_pld_irq_type; 340 - irq_desc[PLD_IRQ_SIO0_SND].action = 0; 341 - irq_desc[PLD_IRQ_SIO0_SND].depth = 1; /* disable nested irq */ 343 + set_irq_chip_and_handler(PLD_IRQ_SIO0_SND, &opsput_pld_irq_type, 344 + handle_level_irq); 342 345 pld_icu_data[irq2pldirq(PLD_IRQ_SIO0_SND)].icucr = PLD_ICUCR_IEN|PLD_ICUCR_ISMOD03; 343 346 disable_opsput_pld_irq(PLD_IRQ_SIO0_SND); 344 347 #endif /* CONFIG_SERIAL_M32R_PLDSIO */ 345 348 346 349 /* INT#1: CFC IREQ on PLD */ 347 - irq_desc[PLD_IRQ_CFIREQ].status = IRQ_DISABLED; 348 - irq_desc[PLD_IRQ_CFIREQ].chip = &opsput_pld_irq_type; 349 - irq_desc[PLD_IRQ_CFIREQ].action = 0; 350 - irq_desc[PLD_IRQ_CFIREQ].depth = 1; /* disable nested irq */ 350 + set_irq_chip_and_handler(PLD_IRQ_CFIREQ, &opsput_pld_irq_type, 351 + handle_level_irq); 351 352 pld_icu_data[irq2pldirq(PLD_IRQ_CFIREQ)].icucr = PLD_ICUCR_IEN|PLD_ICUCR_ISMOD01; /* 'L' level sense */ 352 353 disable_opsput_pld_irq(PLD_IRQ_CFIREQ); 353 354 354 355 /* INT#1: CFC Insert on PLD */ 355 - irq_desc[PLD_IRQ_CFC_INSERT].status = IRQ_DISABLED; 356 - irq_desc[PLD_IRQ_CFC_INSERT].chip = &opsput_pld_irq_type; 357 - irq_desc[PLD_IRQ_CFC_INSERT].action = 0; 358 - irq_desc[PLD_IRQ_CFC_INSERT].depth = 1; /* disable nested irq */ 356 + set_irq_chip_and_handler(PLD_IRQ_CFC_INSERT, &opsput_pld_irq_type, 357 + handle_level_irq); 359 358 pld_icu_data[irq2pldirq(PLD_IRQ_CFC_INSERT)].icucr = PLD_ICUCR_IEN|PLD_ICUCR_ISMOD00; /* 'L' edge sense */ 360 359 disable_opsput_pld_irq(PLD_IRQ_CFC_INSERT); 361 360 362 361 /* INT#1: CFC Eject on PLD */ 363 - irq_desc[PLD_IRQ_CFC_EJECT].status = IRQ_DISABLED; 364 - irq_desc[PLD_IRQ_CFC_EJECT].chip = &opsput_pld_irq_type; 365 - irq_desc[PLD_IRQ_CFC_EJECT].action = 0; 366 - irq_desc[PLD_IRQ_CFC_EJECT].depth = 1; /* disable nested irq */ 362 + set_irq_chip_and_handler(PLD_IRQ_CFC_EJECT, &opsput_pld_irq_type, 363 + handle_level_irq); 367 364 pld_icu_data[irq2pldirq(PLD_IRQ_CFC_EJECT)].icucr = PLD_ICUCR_IEN|PLD_ICUCR_ISMOD02; /* 'H' edge sense */ 368 365 disable_opsput_pld_irq(PLD_IRQ_CFC_EJECT); 369 366 ··· 348 413 enable_opsput_irq(M32R_IRQ_INT1); 349 414 350 415 #if defined(CONFIG_USB) 351 - outw(USBCR_OTGS, USBCR); /* USBCR: non-OTG */ 352 - 353 - irq_desc[OPSPUT_LCD_IRQ_USB_INT1].status = IRQ_DISABLED; 354 - irq_desc[OPSPUT_LCD_IRQ_USB_INT1].chip = &opsput_lcdpld_irq_type; 355 - irq_desc[OPSPUT_LCD_IRQ_USB_INT1].action = 0; 356 - irq_desc[OPSPUT_LCD_IRQ_USB_INT1].depth = 1; 357 - lcdpld_icu_data[irq2lcdpldirq(OPSPUT_LCD_IRQ_USB_INT1)].icucr = PLD_ICUCR_IEN|PLD_ICUCR_ISMOD01; /* "L" level sense */ 358 - disable_opsput_lcdpld_irq(OPSPUT_LCD_IRQ_USB_INT1); 416 + outw(USBCR_OTGS, USBCR); /* USBCR: non-OTG */ 417 + set_irq_chip_and_handler(OPSPUT_LCD_IRQ_USB_INT1, 418 + &opsput_lcdpld_irq_type, handle_level_irq); 419 + lcdpld_icu_data[irq2lcdpldirq(OPSPUT_LCD_IRQ_USB_INT1)].icucr = PLD_ICUCR_IEN|PLD_ICUCR_ISMOD01; /* "L" level sense */ 420 + disable_opsput_lcdpld_irq(OPSPUT_LCD_IRQ_USB_INT1); 359 421 #endif 360 422 /* 361 423 * INT2# is used for BAT, USB, AUDIO ··· 365 433 /* 366 434 * INT3# is used for AR 367 435 */ 368 - irq_desc[M32R_IRQ_INT3].status = IRQ_DISABLED; 369 - irq_desc[M32R_IRQ_INT3].chip = &opsput_irq_type; 370 - irq_desc[M32R_IRQ_INT3].action = 0; 371 - irq_desc[M32R_IRQ_INT3].depth = 1; 436 + set_irq_chip_and_handler(M32R_IRQ_INT3, &opsput_irq_type, 437 + handle_level_irq); 372 438 icu_data[M32R_IRQ_INT3].icucr = M32R_ICUCR_IEN|M32R_ICUCR_ISMOD10; 373 439 disable_opsput_irq(M32R_IRQ_INT3); 374 440 #endif /* CONFIG_VIDEO_M32R_AR */
+40 -75
arch/m32r/platforms/usrv/setup.c
··· 37 37 outl(data, port); 38 38 } 39 39 40 - static void mask_and_ack_mappi(unsigned int irq) 40 + static void mask_mappi(struct irq_data *data) 41 41 { 42 - disable_mappi_irq(irq); 42 + disable_mappi_irq(data->irq); 43 43 } 44 44 45 - static void end_mappi_irq(unsigned int irq) 45 + static void unmask_mappi(struct irq_data *data) 46 46 { 47 - enable_mappi_irq(irq); 47 + enable_mappi_irq(data->irq); 48 48 } 49 49 50 - static unsigned int startup_mappi_irq(unsigned int irq) 51 - { 52 - enable_mappi_irq(irq); 53 - return 0; 54 - } 55 - 56 - static void shutdown_mappi_irq(unsigned int irq) 50 + static void shutdown_mappi(struct irq_data *data) 57 51 { 58 52 unsigned long port; 59 53 60 - port = irq2port(irq); 54 + port = irq2port(data->irq); 61 55 outl(M32R_ICUCR_ILEVEL7, port); 62 56 } 63 57 64 58 static struct irq_chip mappi_irq_type = 65 59 { 66 - .name = "M32700-IRQ", 67 - .startup = startup_mappi_irq, 68 - .shutdown = shutdown_mappi_irq, 69 - .enable = enable_mappi_irq, 70 - .disable = disable_mappi_irq, 71 - .ack = mask_and_ack_mappi, 72 - .end = end_mappi_irq 60 + .name = "M32700-IRQ", 61 + .irq_shutdown = shutdown_mappi, 62 + .irq_mask = mask_mappi, 63 + .irq_unmask = unmask_mappi, 73 64 }; 74 65 75 66 /* ··· 98 107 outw(data, port); 99 108 } 100 109 101 - static void mask_and_ack_m32700ut_pld(unsigned int irq) 110 + static void mask_m32700ut_pld(struct irq_data *data) 102 111 { 103 - disable_m32700ut_pld_irq(irq); 112 + disable_m32700ut_pld_irq(data->irq); 104 113 } 105 114 106 - static void end_m32700ut_pld_irq(unsigned int irq) 115 + static void unmask_m32700ut_pld(struct irq_data *data) 107 116 { 108 - enable_m32700ut_pld_irq(irq); 109 - end_mappi_irq(M32R_IRQ_INT1); 117 + enable_m32700ut_pld_irq(data->irq); 118 + enable_mappi_irq(M32R_IRQ_INT1); 110 119 } 111 120 112 - static unsigned int startup_m32700ut_pld_irq(unsigned int irq) 113 - { 114 - enable_m32700ut_pld_irq(irq); 115 - return 0; 116 - } 117 - 118 - static void shutdown_m32700ut_pld_irq(unsigned int irq) 121 + static void shutdown_m32700ut_pld(struct irq_data *data) 119 122 { 120 123 unsigned long port; 121 124 unsigned int pldirq; 122 125 123 - pldirq = irq2pldirq(irq); 126 + pldirq = irq2pldirq(data->irq); 124 127 port = pldirq2port(pldirq); 125 128 outw(PLD_ICUCR_ILEVEL7, port); 126 129 } 127 130 128 131 static struct irq_chip m32700ut_pld_irq_type = 129 132 { 130 - .name = "USRV-PLD-IRQ", 131 - .startup = startup_m32700ut_pld_irq, 132 - .shutdown = shutdown_m32700ut_pld_irq, 133 - .enable = enable_m32700ut_pld_irq, 134 - .disable = disable_m32700ut_pld_irq, 135 - .ack = mask_and_ack_m32700ut_pld, 136 - .end = end_m32700ut_pld_irq 133 + .name = "USRV-PLD-IRQ", 134 + .irq_shutdown = shutdown_m32700ut_pld, 135 + .irq_mask = mask_m32700ut_pld, 136 + .irq_unmask = unmask_m32700ut_pld, 137 137 }; 138 138 139 139 void __init init_IRQ(void) ··· 138 156 once++; 139 157 140 158 /* MFT2 : system timer */ 141 - irq_desc[M32R_IRQ_MFT2].status = IRQ_DISABLED; 142 - irq_desc[M32R_IRQ_MFT2].chip = &mappi_irq_type; 143 - irq_desc[M32R_IRQ_MFT2].action = 0; 144 - irq_desc[M32R_IRQ_MFT2].depth = 1; 159 + set_irq_chip_and_handler(M32R_IRQ_MFT2, &mappi_irq_type, 160 + handle_level_irq); 145 161 icu_data[M32R_IRQ_MFT2].icucr = M32R_ICUCR_IEN; 146 162 disable_mappi_irq(M32R_IRQ_MFT2); 147 163 148 164 #if defined(CONFIG_SERIAL_M32R_SIO) 149 165 /* SIO0_R : uart receive data */ 150 - irq_desc[M32R_IRQ_SIO0_R].status = IRQ_DISABLED; 151 - irq_desc[M32R_IRQ_SIO0_R].chip = &mappi_irq_type; 152 - irq_desc[M32R_IRQ_SIO0_R].action = 0; 153 - irq_desc[M32R_IRQ_SIO0_R].depth = 1; 166 + set_irq_chip_and_handler(M32R_IRQ_SIO0_R, &mappi_irq_type, 167 + handle_level_irq); 154 168 icu_data[M32R_IRQ_SIO0_R].icucr = 0; 155 169 disable_mappi_irq(M32R_IRQ_SIO0_R); 156 170 157 171 /* SIO0_S : uart send data */ 158 - irq_desc[M32R_IRQ_SIO0_S].status = IRQ_DISABLED; 159 - irq_desc[M32R_IRQ_SIO0_S].chip = &mappi_irq_type; 160 - irq_desc[M32R_IRQ_SIO0_S].action = 0; 161 - irq_desc[M32R_IRQ_SIO0_S].depth = 1; 172 + set_irq_chip_and_handler(M32R_IRQ_SIO0_S, &mappi_irq_type, 173 + handle_level_irq); 162 174 icu_data[M32R_IRQ_SIO0_S].icucr = 0; 163 175 disable_mappi_irq(M32R_IRQ_SIO0_S); 164 176 165 177 /* SIO1_R : uart receive data */ 166 - irq_desc[M32R_IRQ_SIO1_R].status = IRQ_DISABLED; 167 - irq_desc[M32R_IRQ_SIO1_R].chip = &mappi_irq_type; 168 - irq_desc[M32R_IRQ_SIO1_R].action = 0; 169 - irq_desc[M32R_IRQ_SIO1_R].depth = 1; 178 + set_irq_chip_and_handler(M32R_IRQ_SIO1_R, &mappi_irq_type, 179 + handle_level_irq); 170 180 icu_data[M32R_IRQ_SIO1_R].icucr = 0; 171 181 disable_mappi_irq(M32R_IRQ_SIO1_R); 172 182 173 183 /* SIO1_S : uart send data */ 174 - irq_desc[M32R_IRQ_SIO1_S].status = IRQ_DISABLED; 175 - irq_desc[M32R_IRQ_SIO1_S].chip = &mappi_irq_type; 176 - irq_desc[M32R_IRQ_SIO1_S].action = 0; 177 - irq_desc[M32R_IRQ_SIO1_S].depth = 1; 184 + set_irq_chip_and_handler(M32R_IRQ_SIO1_S, &mappi_irq_type, 185 + handle_level_irq); 178 186 icu_data[M32R_IRQ_SIO1_S].icucr = 0; 179 187 disable_mappi_irq(M32R_IRQ_SIO1_S); 180 188 #endif /* CONFIG_SERIAL_M32R_SIO */ 181 189 182 190 /* INT#67-#71: CFC#0 IREQ on PLD */ 183 191 for (i = 0 ; i < CONFIG_M32R_CFC_NUM ; i++ ) { 184 - irq_desc[PLD_IRQ_CF0 + i].status = IRQ_DISABLED; 185 - irq_desc[PLD_IRQ_CF0 + i].chip = &m32700ut_pld_irq_type; 186 - irq_desc[PLD_IRQ_CF0 + i].action = 0; 187 - irq_desc[PLD_IRQ_CF0 + i].depth = 1; /* disable nested irq */ 192 + set_irq_chip_and_handler(PLD_IRQ_CF0 + i, 193 + &m32700ut_pld_irq_type, 194 + handle_level_irq); 188 195 pld_icu_data[irq2pldirq(PLD_IRQ_CF0 + i)].icucr 189 196 = PLD_ICUCR_ISMOD01; /* 'L' level sense */ 190 197 disable_m32700ut_pld_irq(PLD_IRQ_CF0 + i); ··· 181 210 182 211 #if defined(CONFIG_SERIAL_8250) || defined(CONFIG_SERIAL_8250_MODULE) 183 212 /* INT#76: 16552D#0 IREQ on PLD */ 184 - irq_desc[PLD_IRQ_UART0].status = IRQ_DISABLED; 185 - irq_desc[PLD_IRQ_UART0].chip = &m32700ut_pld_irq_type; 186 - irq_desc[PLD_IRQ_UART0].action = 0; 187 - irq_desc[PLD_IRQ_UART0].depth = 1; /* disable nested irq */ 213 + set_irq_chip_and_handler(PLD_IRQ_UART0, &m32700ut_pld_irq_type, 214 + handle_level_irq); 188 215 pld_icu_data[irq2pldirq(PLD_IRQ_UART0)].icucr 189 216 = PLD_ICUCR_ISMOD03; /* 'H' level sense */ 190 217 disable_m32700ut_pld_irq(PLD_IRQ_UART0); 191 218 192 219 /* INT#77: 16552D#1 IREQ on PLD */ 193 - irq_desc[PLD_IRQ_UART1].status = IRQ_DISABLED; 194 - irq_desc[PLD_IRQ_UART1].chip = &m32700ut_pld_irq_type; 195 - irq_desc[PLD_IRQ_UART1].action = 0; 196 - irq_desc[PLD_IRQ_UART1].depth = 1; /* disable nested irq */ 220 + set_irq_chip_and_handler(PLD_IRQ_UART1, &m32700ut_pld_irq_type, 221 + handle_level_irq); 197 222 pld_icu_data[irq2pldirq(PLD_IRQ_UART1)].icucr 198 223 = PLD_ICUCR_ISMOD03; /* 'H' level sense */ 199 224 disable_m32700ut_pld_irq(PLD_IRQ_UART1); ··· 197 230 198 231 #if defined(CONFIG_IDC_AK4524) || defined(CONFIG_IDC_AK4524_MODULE) 199 232 /* INT#80: AK4524 IREQ on PLD */ 200 - irq_desc[PLD_IRQ_SNDINT].status = IRQ_DISABLED; 201 - irq_desc[PLD_IRQ_SNDINT].chip = &m32700ut_pld_irq_type; 202 - irq_desc[PLD_IRQ_SNDINT].action = 0; 203 - irq_desc[PLD_IRQ_SNDINT].depth = 1; /* disable nested irq */ 233 + set_irq_chip_and_handler(PLD_IRQ_SNDINT, &m32700ut_pld_irq_type, 234 + handle_level_irq); 204 235 pld_icu_data[irq2pldirq(PLD_IRQ_SNDINT)].icucr 205 236 = PLD_ICUCR_ISMOD01; /* 'L' level sense */ 206 237 disable_m32700ut_pld_irq(PLD_IRQ_SNDINT);
+1 -8
arch/m68knommu/Kconfig
··· 2 2 bool 3 3 default y 4 4 select HAVE_IDE 5 + select HAVE_GENERIC_HARDIRQS 5 6 6 7 config MMU 7 8 bool ··· 46 45 default n 47 46 48 47 config GENERIC_HWEIGHT 49 - bool 50 - default y 51 - 52 - config GENERIC_HARDIRQS 53 - bool 54 - default y 55 - 56 - config GENERIC_HARDIRQS_NO__DO_IRQ 57 48 bool 58 49 default y 59 50
+1 -1
arch/m68knommu/configs/m5208evb_defconfig
··· 1 1 CONFIG_EXPERIMENTAL=y 2 2 CONFIG_LOG_BUF_SHIFT=14 3 3 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 4 - CONFIG_EMBEDDED=y 4 + CONFIG_EXPERT=y 5 5 # CONFIG_KALLSYMS is not set 6 6 # CONFIG_HOTPLUG is not set 7 7 # CONFIG_FUTEX is not set
+1 -1
arch/m68knommu/configs/m5249evb_defconfig
··· 1 1 CONFIG_EXPERIMENTAL=y 2 2 CONFIG_LOG_BUF_SHIFT=14 3 3 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 4 - CONFIG_EMBEDDED=y 4 + CONFIG_EXPERT=y 5 5 # CONFIG_KALLSYMS is not set 6 6 # CONFIG_HOTPLUG is not set 7 7 # CONFIG_FUTEX is not set
+1 -1
arch/m68knommu/configs/m5272c3_defconfig
··· 1 1 CONFIG_EXPERIMENTAL=y 2 2 CONFIG_LOG_BUF_SHIFT=14 3 3 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 4 - CONFIG_EMBEDDED=y 4 + CONFIG_EXPERT=y 5 5 # CONFIG_KALLSYMS is not set 6 6 # CONFIG_HOTPLUG is not set 7 7 # CONFIG_FUTEX is not set
+1 -1
arch/m68knommu/configs/m5275evb_defconfig
··· 1 1 CONFIG_EXPERIMENTAL=y 2 2 CONFIG_LOG_BUF_SHIFT=14 3 3 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 4 - CONFIG_EMBEDDED=y 4 + CONFIG_EXPERT=y 5 5 # CONFIG_KALLSYMS is not set 6 6 # CONFIG_HOTPLUG is not set 7 7 # CONFIG_FUTEX is not set
+1 -1
arch/m68knommu/configs/m5307c3_defconfig
··· 1 1 CONFIG_EXPERIMENTAL=y 2 2 CONFIG_LOG_BUF_SHIFT=14 3 3 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 4 - CONFIG_EMBEDDED=y 4 + CONFIG_EXPERT=y 5 5 # CONFIG_KALLSYMS is not set 6 6 # CONFIG_HOTPLUG is not set 7 7 # CONFIG_FUTEX is not set
+1 -1
arch/m68knommu/configs/m5407c3_defconfig
··· 1 1 CONFIG_EXPERIMENTAL=y 2 2 CONFIG_LOG_BUF_SHIFT=14 3 3 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 4 - CONFIG_EMBEDDED=y 4 + CONFIG_EXPERT=y 5 5 # CONFIG_KALLSYMS is not set 6 6 # CONFIG_HOTPLUG is not set 7 7 # CONFIG_FUTEX is not set
+1 -1
arch/m68knommu/defconfig
··· 1 1 CONFIG_EXPERIMENTAL=y 2 2 CONFIG_LOG_BUF_SHIFT=14 3 3 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 4 - CONFIG_EMBEDDED=y 4 + CONFIG_EXPERT=y 5 5 # CONFIG_KALLSYMS is not set 6 6 # CONFIG_HOTPLUG is not set 7 7 # CONFIG_FUTEX is not set
+2 -9
arch/microblaze/Kconfig
··· 15 15 select TRACING_SUPPORT 16 16 select OF 17 17 select OF_EARLY_FLATTREE 18 + select HAVE_GENERIC_HARDIRQS 19 + select GENERIC_IRQ_PROBE 18 20 19 21 config SWAP 20 22 def_bool n ··· 39 37 config GENERIC_HWEIGHT 40 38 def_bool y 41 39 42 - config GENERIC_HARDIRQS 43 - def_bool y 44 - 45 - config GENERIC_IRQ_PROBE 46 - def_bool y 47 - 48 40 config GENERIC_CALIBRATE_DELAY 49 41 def_bool y 50 42 ··· 46 50 def_bool n 47 51 48 52 config GENERIC_CLOCKEVENTS 49 - def_bool y 50 - 51 - config GENERIC_HARDIRQS_NO__DO_IRQ 52 53 def_bool y 53 54 54 55 config GENERIC_GPIO
+1 -1
arch/microblaze/configs/mmu_defconfig
··· 7 7 CONFIG_INITRAMFS_SOURCE="rootfs.cpio" 8 8 CONFIG_INITRAMFS_COMPRESSION_GZIP=y 9 9 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 10 - CONFIG_EMBEDDED=y 10 + CONFIG_EXPERT=y 11 11 CONFIG_KALLSYMS_ALL=y 12 12 CONFIG_KALLSYMS_EXTRA_PASS=y 13 13 # CONFIG_HOTPLUG is not set
+1 -1
arch/microblaze/configs/nommu_defconfig
··· 6 6 CONFIG_IKCONFIG=y 7 7 CONFIG_IKCONFIG_PROC=y 8 8 CONFIG_SYSFS_DEPRECATED_V2=y 9 - CONFIG_EMBEDDED=y 9 + CONFIG_EXPERT=y 10 10 CONFIG_KALLSYMS_ALL=y 11 11 CONFIG_KALLSYMS_EXTRA_PASS=y 12 12 # CONFIG_HOTPLUG is not set
-3
arch/mips/Kconfig
··· 793 793 bool 794 794 default y 795 795 796 - config GENERIC_HARDIRQS_NO__DO_IRQ 797 - def_bool y 798 - 799 796 # 800 797 # Select some configuration options automatically based on user selections. 801 798 #
+1 -1
arch/mips/Kconfig.debug
··· 7 7 source "lib/Kconfig.debug" 8 8 9 9 config EARLY_PRINTK 10 - bool "Early printk" if EMBEDDED 10 + bool "Early printk" if EXPERT 11 11 depends on SYS_HAS_EARLY_PRINTK 12 12 default y 13 13 help
+1 -1
arch/mips/configs/ar7_defconfig
··· 14 14 CONFIG_RELAY=y 15 15 CONFIG_BLK_DEV_INITRD=y 16 16 CONFIG_RD_LZMA=y 17 - CONFIG_EMBEDDED=y 17 + CONFIG_EXPERT=y 18 18 # CONFIG_KALLSYMS is not set 19 19 # CONFIG_ELF_CORE is not set 20 20 # CONFIG_PCSPKR_PLATFORM is not set
+1 -1
arch/mips/configs/bcm47xx_defconfig
··· 21 21 CONFIG_RELAY=y 22 22 CONFIG_BLK_DEV_INITRD=y 23 23 CONFIG_RD_LZMA=y 24 - CONFIG_EMBEDDED=y 24 + CONFIG_EXPERT=y 25 25 CONFIG_SLAB=y 26 26 CONFIG_MODULES=y 27 27 CONFIG_MODULE_UNLOAD=y
+1 -1
arch/mips/configs/bcm63xx_defconfig
··· 10 10 # CONFIG_SWAP is not set 11 11 CONFIG_TINY_RCU=y 12 12 CONFIG_SYSFS_DEPRECATED_V2=y 13 - CONFIG_EMBEDDED=y 13 + CONFIG_EXPERT=y 14 14 # CONFIG_PCSPKR_PLATFORM is not set 15 15 # CONFIG_FUTEX is not set 16 16 # CONFIG_EPOLL is not set
+1 -1
arch/mips/configs/bigsur_defconfig
··· 26 26 CONFIG_NET_NS=y 27 27 CONFIG_BLK_DEV_INITRD=y 28 28 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 29 - CONFIG_EMBEDDED=y 29 + CONFIG_EXPERT=y 30 30 # CONFIG_SYSCTL_SYSCALL is not set 31 31 # CONFIG_PCSPKR_PLATFORM is not set 32 32 CONFIG_SLAB=y
+1 -1
arch/mips/configs/capcella_defconfig
··· 4 4 CONFIG_SYSVIPC=y 5 5 CONFIG_LOG_BUF_SHIFT=14 6 6 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 7 - CONFIG_EMBEDDED=y 7 + CONFIG_EXPERT=y 8 8 CONFIG_SLAB=y 9 9 CONFIG_MODULES=y 10 10 CONFIG_MODULE_UNLOAD=y
+1 -1
arch/mips/configs/cavium-octeon_defconfig
··· 15 15 CONFIG_RELAY=y 16 16 CONFIG_BLK_DEV_INITRD=y 17 17 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 18 - CONFIG_EMBEDDED=y 18 + CONFIG_EXPERT=y 19 19 # CONFIG_PCSPKR_PLATFORM is not set 20 20 CONFIG_SLAB=y 21 21 CONFIG_MODULES=y
+1 -1
arch/mips/configs/cobalt_defconfig
··· 4 4 CONFIG_LOG_BUF_SHIFT=14 5 5 CONFIG_RELAY=y 6 6 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 7 - CONFIG_EMBEDDED=y 7 + CONFIG_EXPERT=y 8 8 CONFIG_MODULES=y 9 9 CONFIG_MODULE_UNLOAD=y 10 10 # CONFIG_BLK_DEV_BSG is not set
+1 -1
arch/mips/configs/db1000_defconfig
··· 11 11 CONFIG_TINY_RCU=y 12 12 CONFIG_LOG_BUF_SHIFT=14 13 13 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 14 - CONFIG_EMBEDDED=y 14 + CONFIG_EXPERT=y 15 15 # CONFIG_KALLSYMS is not set 16 16 # CONFIG_PCSPKR_PLATFORM is not set 17 17 # CONFIG_VM_EVENT_COUNTERS is not set
+1 -1
arch/mips/configs/db1100_defconfig
··· 11 11 CONFIG_POSIX_MQUEUE=y 12 12 CONFIG_TINY_RCU=y 13 13 CONFIG_LOG_BUF_SHIFT=14 14 - CONFIG_EMBEDDED=y 14 + CONFIG_EXPERT=y 15 15 # CONFIG_SYSCTL_SYSCALL is not set 16 16 # CONFIG_KALLSYMS is not set 17 17 # CONFIG_PCSPKR_PLATFORM is not set
+1 -1
arch/mips/configs/db1200_defconfig
··· 12 12 CONFIG_POSIX_MQUEUE=y 13 13 CONFIG_TINY_RCU=y 14 14 CONFIG_LOG_BUF_SHIFT=14 15 - CONFIG_EMBEDDED=y 15 + CONFIG_EXPERT=y 16 16 # CONFIG_SYSCTL_SYSCALL is not set 17 17 # CONFIG_KALLSYMS is not set 18 18 # CONFIG_PCSPKR_PLATFORM is not set
+1 -1
arch/mips/configs/db1500_defconfig
··· 10 10 CONFIG_KERNEL_LZMA=y 11 11 CONFIG_SYSVIPC=y 12 12 CONFIG_LOG_BUF_SHIFT=14 13 - CONFIG_EMBEDDED=y 13 + CONFIG_EXPERT=y 14 14 # CONFIG_KALLSYMS is not set 15 15 # CONFIG_PCSPKR_PLATFORM is not set 16 16 # CONFIG_VM_EVENT_COUNTERS is not set
+1 -1
arch/mips/configs/db1550_defconfig
··· 11 11 CONFIG_POSIX_MQUEUE=y 12 12 CONFIG_TINY_RCU=y 13 13 CONFIG_LOG_BUF_SHIFT=14 14 - CONFIG_EMBEDDED=y 14 + CONFIG_EXPERT=y 15 15 # CONFIG_SYSCTL_SYSCALL is not set 16 16 # CONFIG_KALLSYMS is not set 17 17 # CONFIG_PCSPKR_PLATFORM is not set
+1 -1
arch/mips/configs/decstation_defconfig
··· 4 4 CONFIG_SYSVIPC=y 5 5 CONFIG_LOG_BUF_SHIFT=14 6 6 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 7 - CONFIG_EMBEDDED=y 7 + CONFIG_EXPERT=y 8 8 # CONFIG_SYSCTL_SYSCALL is not set 9 9 # CONFIG_HOTPLUG is not set 10 10 CONFIG_SLAB=y
+1 -1
arch/mips/configs/e55_defconfig
··· 4 4 CONFIG_SYSVIPC=y 5 5 CONFIG_LOG_BUF_SHIFT=14 6 6 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 7 - CONFIG_EMBEDDED=y 7 + CONFIG_EXPERT=y 8 8 # CONFIG_HOTPLUG is not set 9 9 CONFIG_SLAB=y 10 10 CONFIG_MODULES=y
+1 -1
arch/mips/configs/fuloong2e_defconfig
··· 17 17 CONFIG_USER_NS=y 18 18 CONFIG_PID_NS=y 19 19 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 20 - CONFIG_EMBEDDED=y 20 + CONFIG_EXPERT=y 21 21 # CONFIG_PCSPKR_PLATFORM is not set 22 22 # CONFIG_COMPAT_BRK is not set 23 23 CONFIG_SLAB=y
+1 -1
arch/mips/configs/gpr_defconfig
··· 11 11 CONFIG_RELAY=y 12 12 CONFIG_BLK_DEV_INITRD=y 13 13 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 14 - CONFIG_EMBEDDED=y 14 + CONFIG_EXPERT=y 15 15 CONFIG_SLAB=y 16 16 CONFIG_PROFILING=y 17 17 CONFIG_MODULES=y
+1 -1
arch/mips/configs/ip22_defconfig
··· 17 17 CONFIG_USER_NS=y 18 18 CONFIG_PID_NS=y 19 19 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 20 - CONFIG_EMBEDDED=y 20 + CONFIG_EXPERT=y 21 21 # CONFIG_HOTPLUG is not set 22 22 # CONFIG_PCSPKR_PLATFORM is not set 23 23 # CONFIG_COMPAT_BRK is not set
+1 -1
arch/mips/configs/ip27_defconfig
··· 15 15 CONFIG_CPUSETS=y 16 16 CONFIG_RELAY=y 17 17 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 18 - CONFIG_EMBEDDED=y 18 + CONFIG_EXPERT=y 19 19 # CONFIG_PCSPKR_PLATFORM is not set 20 20 CONFIG_SLAB=y 21 21 CONFIG_MODULES=y
+1 -1
arch/mips/configs/ip28_defconfig
··· 8 8 CONFIG_LOG_BUF_SHIFT=14 9 9 CONFIG_RELAY=y 10 10 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 11 - CONFIG_EMBEDDED=y 11 + CONFIG_EXPERT=y 12 12 # CONFIG_HOTPLUG is not set 13 13 CONFIG_SLAB=y 14 14 CONFIG_MODULES=y
+1 -1
arch/mips/configs/ip32_defconfig
··· 10 10 CONFIG_LOG_BUF_SHIFT=14 11 11 CONFIG_SYSFS_DEPRECATED_V2=y 12 12 CONFIG_RELAY=y 13 - CONFIG_EMBEDDED=y 13 + CONFIG_EXPERT=y 14 14 CONFIG_SLAB=y 15 15 CONFIG_PROFILING=y 16 16 CONFIG_OPROFILE=m
+1 -1
arch/mips/configs/jazz_defconfig
··· 10 10 CONFIG_LOG_BUF_SHIFT=14 11 11 CONFIG_RELAY=y 12 12 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 13 - CONFIG_EMBEDDED=y 13 + CONFIG_EXPERT=y 14 14 # CONFIG_SYSCTL_SYSCALL is not set 15 15 CONFIG_SLAB=y 16 16 CONFIG_MODULES=y
+1 -1
arch/mips/configs/jmr3927_defconfig
··· 4 4 CONFIG_SYSVIPC=y 5 5 CONFIG_LOG_BUF_SHIFT=14 6 6 CONFIG_SYSFS_DEPRECATED_V2=y 7 - CONFIG_EMBEDDED=y 7 + CONFIG_EXPERT=y 8 8 # CONFIG_HOTPLUG is not set 9 9 # CONFIG_PCSPKR_PLATFORM is not set 10 10 CONFIG_SLAB=y
+1 -1
arch/mips/configs/lasat_defconfig
··· 8 8 CONFIG_EXPERIMENTAL=y 9 9 CONFIG_SYSVIPC=y 10 10 CONFIG_LOG_BUF_SHIFT=14 11 - CONFIG_EMBEDDED=y 11 + CONFIG_EXPERT=y 12 12 # CONFIG_SYSCTL_SYSCALL is not set 13 13 # CONFIG_KALLSYMS is not set 14 14 # CONFIG_HOTPLUG is not set
+1 -1
arch/mips/configs/lemote2f_defconfig
··· 21 21 CONFIG_RD_BZIP2=y 22 22 CONFIG_RD_LZMA=y 23 23 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 24 - CONFIG_EMBEDDED=y 24 + CONFIG_EXPERT=y 25 25 CONFIG_PROFILING=y 26 26 CONFIG_OPROFILE=m 27 27 CONFIG_MODULES=y
+1 -1
arch/mips/configs/malta_defconfig
··· 15 15 CONFIG_IPC_NS=y 16 16 CONFIG_PID_NS=y 17 17 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 18 - CONFIG_EMBEDDED=y 18 + CONFIG_EXPERT=y 19 19 # CONFIG_SYSCTL_SYSCALL is not set 20 20 # CONFIG_COMPAT_BRK is not set 21 21 CONFIG_SLAB=y
+1 -1
arch/mips/configs/markeins_defconfig
··· 9 9 CONFIG_IKCONFIG_PROC=y 10 10 CONFIG_LOG_BUF_SHIFT=14 11 11 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 12 - CONFIG_EMBEDDED=y 12 + CONFIG_EXPERT=y 13 13 CONFIG_SLAB=y 14 14 CONFIG_MODULES=y 15 15 CONFIG_MODULE_UNLOAD=y
+1 -1
arch/mips/configs/mipssim_defconfig
··· 7 7 CONFIG_SYSVIPC=y 8 8 CONFIG_LOG_BUF_SHIFT=14 9 9 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 10 - CONFIG_EMBEDDED=y 10 + CONFIG_EXPERT=y 11 11 CONFIG_SLAB=y 12 12 CONFIG_MODULES=y 13 13 CONFIG_MODULE_UNLOAD=y
+1 -1
arch/mips/configs/mpc30x_defconfig
··· 5 5 CONFIG_LOG_BUF_SHIFT=14 6 6 CONFIG_RELAY=y 7 7 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 8 - CONFIG_EMBEDDED=y 8 + CONFIG_EXPERT=y 9 9 CONFIG_SLAB=y 10 10 CONFIG_MODULES=y 11 11 CONFIG_MODULE_UNLOAD=y
+1 -1
arch/mips/configs/msp71xx_defconfig
··· 8 8 CONFIG_SYSVIPC=y 9 9 CONFIG_LOG_BUF_SHIFT=14 10 10 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 11 - CONFIG_EMBEDDED=y 11 + CONFIG_EXPERT=y 12 12 # CONFIG_SHMEM is not set 13 13 CONFIG_SLAB=y 14 14 CONFIG_MODULES=y
+1 -1
arch/mips/configs/mtx1_defconfig
··· 11 11 CONFIG_RELAY=y 12 12 CONFIG_BLK_DEV_INITRD=y 13 13 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 14 - CONFIG_EMBEDDED=y 14 + CONFIG_EXPERT=y 15 15 CONFIG_SLAB=y 16 16 CONFIG_PROFILING=y 17 17 CONFIG_OPROFILE=m
+1 -1
arch/mips/configs/pb1100_defconfig
··· 11 11 CONFIG_POSIX_MQUEUE=y 12 12 CONFIG_TINY_RCU=y 13 13 CONFIG_LOG_BUF_SHIFT=14 14 - CONFIG_EMBEDDED=y 14 + CONFIG_EXPERT=y 15 15 # CONFIG_SYSCTL_SYSCALL is not set 16 16 # CONFIG_KALLSYMS is not set 17 17 # CONFIG_PCSPKR_PLATFORM is not set
+1 -1
arch/mips/configs/pb1200_defconfig
··· 12 12 CONFIG_POSIX_MQUEUE=y 13 13 CONFIG_TINY_RCU=y 14 14 CONFIG_LOG_BUF_SHIFT=14 15 - CONFIG_EMBEDDED=y 15 + CONFIG_EXPERT=y 16 16 # CONFIG_SYSCTL_SYSCALL is not set 17 17 # CONFIG_KALLSYMS is not set 18 18 # CONFIG_PCSPKR_PLATFORM is not set
+1 -1
arch/mips/configs/pb1500_defconfig
··· 11 11 CONFIG_POSIX_MQUEUE=y 12 12 CONFIG_TINY_RCU=y 13 13 CONFIG_LOG_BUF_SHIFT=14 14 - CONFIG_EMBEDDED=y 14 + CONFIG_EXPERT=y 15 15 # CONFIG_SYSCTL_SYSCALL is not set 16 16 # CONFIG_KALLSYMS is not set 17 17 # CONFIG_PCSPKR_PLATFORM is not set
+1 -1
arch/mips/configs/pb1550_defconfig
··· 11 11 CONFIG_POSIX_MQUEUE=y 12 12 CONFIG_TINY_RCU=y 13 13 CONFIG_LOG_BUF_SHIFT=14 14 - CONFIG_EMBEDDED=y 14 + CONFIG_EXPERT=y 15 15 # CONFIG_SYSCTL_SYSCALL is not set 16 16 # CONFIG_KALLSYMS is not set 17 17 # CONFIG_PCSPKR_PLATFORM is not set
+1 -1
arch/mips/configs/pnx8335-stb225_defconfig
··· 11 11 CONFIG_SYSVIPC=y 12 12 CONFIG_LOG_BUF_SHIFT=14 13 13 CONFIG_SYSFS_DEPRECATED_V2=y 14 - CONFIG_EMBEDDED=y 14 + CONFIG_EXPERT=y 15 15 CONFIG_SLAB=y 16 16 CONFIG_MODULES=y 17 17 CONFIG_MODULE_UNLOAD=y
+1 -1
arch/mips/configs/pnx8550-jbs_defconfig
··· 6 6 CONFIG_LOG_BUF_SHIFT=14 7 7 CONFIG_BLK_DEV_INITRD=y 8 8 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 9 - CONFIG_EMBEDDED=y 9 + CONFIG_EXPERT=y 10 10 # CONFIG_SYSCTL_SYSCALL is not set 11 11 CONFIG_SLAB=y 12 12 CONFIG_MODULES=y
+1 -1
arch/mips/configs/pnx8550-stb810_defconfig
··· 6 6 CONFIG_LOG_BUF_SHIFT=14 7 7 CONFIG_BLK_DEV_INITRD=y 8 8 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 9 - CONFIG_EMBEDDED=y 9 + CONFIG_EXPERT=y 10 10 # CONFIG_SYSCTL_SYSCALL is not set 11 11 # CONFIG_HOTPLUG is not set 12 12 CONFIG_SLAB=y
+1 -1
arch/mips/configs/powertv_defconfig
··· 14 14 CONFIG_BLK_DEV_INITRD=y 15 15 # CONFIG_RD_GZIP is not set 16 16 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 17 - CONFIG_EMBEDDED=y 17 + CONFIG_EXPERT=y 18 18 # CONFIG_SYSCTL_SYSCALL is not set 19 19 CONFIG_KALLSYMS_ALL=y 20 20 # CONFIG_PCSPKR_PLATFORM is not set
+1 -1
arch/mips/configs/rb532_defconfig
··· 13 13 CONFIG_LOG_BUF_SHIFT=14 14 14 CONFIG_SYSFS_DEPRECATED_V2=y 15 15 CONFIG_BLK_DEV_INITRD=y 16 - CONFIG_EMBEDDED=y 16 + CONFIG_EXPERT=y 17 17 # CONFIG_KALLSYMS is not set 18 18 # CONFIG_ELF_CORE is not set 19 19 # CONFIG_VM_EVENT_COUNTERS is not set
+1 -1
arch/mips/configs/rbtx49xx_defconfig
··· 12 12 CONFIG_LOG_BUF_SHIFT=14 13 13 CONFIG_SYSFS_DEPRECATED_V2=y 14 14 CONFIG_BLK_DEV_INITRD=y 15 - CONFIG_EMBEDDED=y 15 + CONFIG_EXPERT=y 16 16 # CONFIG_HOTPLUG is not set 17 17 # CONFIG_PCSPKR_PLATFORM is not set 18 18 # CONFIG_EPOLL is not set
+1 -1
arch/mips/configs/rm200_defconfig
··· 12 12 CONFIG_LOG_BUF_SHIFT=14 13 13 CONFIG_RELAY=y 14 14 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 15 - CONFIG_EMBEDDED=y 15 + CONFIG_EXPERT=y 16 16 CONFIG_SLAB=y 17 17 CONFIG_MODULES=y 18 18 CONFIG_MODULE_UNLOAD=y
+1 -1
arch/mips/configs/sb1250-swarm_defconfig
··· 15 15 CONFIG_NAMESPACES=y 16 16 CONFIG_BLK_DEV_INITRD=y 17 17 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 18 - CONFIG_EMBEDDED=y 18 + CONFIG_EXPERT=y 19 19 # CONFIG_COMPAT_BRK is not set 20 20 CONFIG_SLAB=y 21 21 CONFIG_MODULES=y
+1 -1
arch/mips/configs/tb0219_defconfig
··· 5 5 CONFIG_LOG_BUF_SHIFT=14 6 6 CONFIG_SYSFS_DEPRECATED_V2=y 7 7 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 8 - CONFIG_EMBEDDED=y 8 + CONFIG_EXPERT=y 9 9 # CONFIG_PCSPKR_PLATFORM is not set 10 10 CONFIG_SLAB=y 11 11 CONFIG_MODULES=y
+1 -1
arch/mips/configs/tb0226_defconfig
··· 5 5 CONFIG_LOG_BUF_SHIFT=14 6 6 CONFIG_SYSFS_DEPRECATED_V2=y 7 7 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 8 - CONFIG_EMBEDDED=y 8 + CONFIG_EXPERT=y 9 9 # CONFIG_PCSPKR_PLATFORM is not set 10 10 CONFIG_SLAB=y 11 11 CONFIG_MODULES=y
+1 -1
arch/mips/configs/tb0287_defconfig
··· 4 4 CONFIG_LOG_BUF_SHIFT=14 5 5 CONFIG_SYSFS_DEPRECATED_V2=y 6 6 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 7 - CONFIG_EMBEDDED=y 7 + CONFIG_EXPERT=y 8 8 # CONFIG_SYSCTL_SYSCALL is not set 9 9 # CONFIG_PCSPKR_PLATFORM is not set 10 10 CONFIG_SLAB=y
+1 -1
arch/mips/configs/workpad_defconfig
··· 4 4 CONFIG_SYSVIPC=y 5 5 CONFIG_LOG_BUF_SHIFT=14 6 6 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 7 - CONFIG_EMBEDDED=y 7 + CONFIG_EXPERT=y 8 8 CONFIG_SLAB=y 9 9 CONFIG_MODULES=y 10 10 CONFIG_MODULE_UNLOAD=y
+1 -1
arch/mips/configs/wrppmc_defconfig
··· 7 7 CONFIG_LOG_BUF_SHIFT=14 8 8 CONFIG_BLK_DEV_INITRD=y 9 9 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 10 - CONFIG_EMBEDDED=y 10 + CONFIG_EXPERT=y 11 11 CONFIG_KALLSYMS_EXTRA_PASS=y 12 12 # CONFIG_EPOLL is not set 13 13 CONFIG_SLAB=y
+1 -1
arch/mips/configs/yosemite_defconfig
··· 8 8 CONFIG_IKCONFIG_PROC=y 9 9 CONFIG_LOG_BUF_SHIFT=14 10 10 CONFIG_RELAY=y 11 - CONFIG_EMBEDDED=y 11 + CONFIG_EXPERT=y 12 12 CONFIG_SLAB=y 13 13 CONFIG_MODULES=y 14 14 CONFIG_MODULE_UNLOAD=y
+1 -7
arch/mn10300/Kconfig
··· 1 1 config MN10300 2 2 def_bool y 3 3 select HAVE_OPROFILE 4 + select GENERIC_HARDIRQS 4 5 5 6 config AM33_2 6 7 def_bool n ··· 34 33 35 34 config RWSEM_XCHGADD_ALGORITHM 36 35 bool 37 - 38 - config GENERIC_HARDIRQS_NO__DO_IRQ 39 - def_bool y 40 36 41 37 config GENERIC_CALIBRATE_DELAY 42 38 def_bool y ··· 75 77 def_bool y 76 78 77 79 config ARCH_HAS_ILOG2_U32 78 - def_bool y 79 - 80 - # Use the generic interrupt handling code in kernel/irq/ 81 - config GENERIC_HARDIRQS 82 80 def_bool y 83 81 84 82 config HOTPLUG_CPU
+1 -1
arch/mn10300/configs/asb2303_defconfig
··· 4 4 CONFIG_TINY_RCU=y 5 5 CONFIG_LOG_BUF_SHIFT=14 6 6 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 7 - CONFIG_EMBEDDED=y 7 + CONFIG_EXPERT=y 8 8 # CONFIG_KALLSYMS is not set 9 9 # CONFIG_HOTPLUG is not set 10 10 # CONFIG_VM_EVENT_COUNTERS is not set
+1 -1
arch/mn10300/configs/asb2364_defconfig
··· 15 15 CONFIG_RESOURCE_COUNTERS=y 16 16 CONFIG_RELAY=y 17 17 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 18 - CONFIG_EMBEDDED=y 18 + CONFIG_EXPERT=y 19 19 # CONFIG_KALLSYMS is not set 20 20 # CONFIG_VM_EVENT_COUNTERS is not set 21 21 CONFIG_SLAB=y
+4 -14
arch/parisc/Kconfig
··· 12 12 select HAVE_IRQ_WORK 13 13 select HAVE_PERF_EVENTS 14 14 select GENERIC_ATOMIC64 if !64BIT 15 - select GENERIC_HARDIRQS_NO__DO_IRQ 15 + select HAVE_GENERIC_HARDIRQS 16 + select GENERIC_IRQ_PROBE 17 + select IRQ_PER_CPU 18 + 16 19 help 17 20 The PA-RISC microprocessor is designed by Hewlett-Packard and used 18 21 in many of their workstations & servers (HP9000 700 and 800 series, ··· 69 66 depends on SMP 70 67 default y 71 68 72 - config GENERIC_HARDIRQS 73 - def_bool y 74 - 75 - config GENERIC_IRQ_PROBE 76 - def_bool y 77 - 78 69 config HAVE_LATENCYTOP_SUPPORT 79 70 def_bool y 80 - 81 - config IRQ_PER_CPU 82 - bool 83 - default y 84 - 85 - config GENERIC_HARDIRQS_NO__DO_IRQ 86 - def_bool y 87 71 88 72 # unless you want to implement ACPI on PA-RISC ... ;-) 89 73 config PM
+1 -1
arch/parisc/configs/a500_defconfig
··· 8 8 CONFIG_SYSFS_DEPRECATED_V2=y 9 9 CONFIG_BLK_DEV_INITRD=y 10 10 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 11 - CONFIG_EMBEDDED=y 11 + CONFIG_EXPERT=y 12 12 CONFIG_KALLSYMS_ALL=y 13 13 CONFIG_SLAB=y 14 14 CONFIG_PROFILING=y
+1 -1
arch/parisc/configs/c3000_defconfig
··· 6 6 CONFIG_LOG_BUF_SHIFT=16 7 7 CONFIG_SYSFS_DEPRECATED_V2=y 8 8 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 9 - CONFIG_EMBEDDED=y 9 + CONFIG_EXPERT=y 10 10 CONFIG_KALLSYMS_ALL=y 11 11 CONFIG_SLAB=y 12 12 CONFIG_PROFILING=y
+3 -25
arch/powerpc/Kconfig
··· 36 36 config GENERIC_CLOCKEVENTS 37 37 def_bool y 38 38 39 - config GENERIC_HARDIRQS 40 - bool 41 - default y 42 - 43 - config GENERIC_HARDIRQS_NO__DO_IRQ 44 - bool 45 - default y 46 - 47 39 config HAVE_SETUP_PER_CPU_AREA 48 40 def_bool PPC64 49 41 50 42 config NEED_PER_CPU_EMBED_FIRST_CHUNK 51 43 def_bool PPC64 52 - 53 - config IRQ_PER_CPU 54 - bool 55 - default y 56 44 57 45 config NR_IRQS 58 46 int "Number of virtual interrupt numbers" ··· 131 143 select HAVE_PERF_EVENTS 132 144 select HAVE_REGS_AND_STACK_ACCESS_API 133 145 select HAVE_HW_BREAKPOINT if PERF_EVENTS && PPC_BOOK3S_64 146 + select HAVE_GENERIC_HARDIRQS 147 + select HAVE_SPARSE_IRQ 148 + select IRQ_PER_CPU 134 149 135 150 config EARLY_PRINTK 136 151 bool ··· 382 391 multiple CPUs. Saying N here will route all IRQs to the first 383 392 CPU. Generally saying Y is safe, although some problems have been 384 393 reported with SMP Power Macintoshes with this option enabled. 385 - 386 - config SPARSE_IRQ 387 - bool "Support sparse irq numbering" 388 - default n 389 - help 390 - This enables support for sparse irqs. This is useful for distro 391 - kernels that want to define a high CONFIG_NR_CPUS value but still 392 - want to have low kernel memory footprint on smaller machines. 393 - 394 - ( Sparse IRQs can also be beneficial on NUMA boxes, as they spread 395 - out the irq_desc[] array in a more NUMA-friendly way. ) 396 - 397 - If you don't know what to do here, say N. 398 394 399 395 config NUMA 400 396 bool "NUMA support"
+1 -1
arch/powerpc/boot/Makefile
··· 368 368 extra-installed := $(patsubst $(obj)/%, $(DESTDIR)$(WRAPPER_OBJDIR)/%, $(extra-y)) 369 369 hostprogs-installed := $(patsubst %, $(DESTDIR)$(WRAPPER_BINDIR)/%, $(hostprogs-y)) 370 370 wrapper-installed := $(DESTDIR)$(WRAPPER_BINDIR)/wrapper 371 - dts-installed := $(patsubst $(obj)/dts/%, $(DESTDIR)$(WRAPPER_DTSDIR)/%, $(wildcard $(obj)/dts/*.dts)) 371 + dts-installed := $(patsubst $(dtstree)/%, $(DESTDIR)$(WRAPPER_DTSDIR)/%, $(wildcard $(dtstree)/*.dts)) 372 372 373 373 all-installed := $(extra-installed) $(hostprogs-installed) $(wrapper-installed) $(dts-installed) 374 374
+1 -1
arch/powerpc/boot/dts/mpc8308rdb.dts
··· 109 109 #address-cells = <1>; 110 110 #size-cells = <1>; 111 111 device_type = "soc"; 112 - compatible = "fsl,mpc8315-immr", "simple-bus"; 112 + compatible = "fsl,mpc8308-immr", "simple-bus"; 113 113 ranges = <0 0xe0000000 0x00100000>; 114 114 reg = <0xe0000000 0x00000200>; 115 115 bus-frequency = <0>;
+2 -2
arch/powerpc/boot/dts/p1022ds.dts
··· 291 291 ranges = <0x0 0xc100 0x200>; 292 292 cell-index = <1>; 293 293 dma00: dma-channel@0 { 294 - compatible = "fsl,eloplus-dma-channel"; 294 + compatible = "fsl,ssi-dma-channel"; 295 295 reg = <0x0 0x80>; 296 296 cell-index = <0>; 297 297 interrupts = <76 2>; 298 298 }; 299 299 dma01: dma-channel@80 { 300 - compatible = "fsl,eloplus-dma-channel"; 300 + compatible = "fsl,ssi-dma-channel"; 301 301 reg = <0x80 0x80>; 302 302 cell-index = <1>; 303 303 interrupts = <77 2>;
+1 -1
arch/powerpc/configs/40x/acadia_defconfig
··· 5 5 CONFIG_LOG_BUF_SHIFT=14 6 6 CONFIG_BLK_DEV_INITRD=y 7 7 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 8 - CONFIG_EMBEDDED=y 8 + CONFIG_EXPERT=y 9 9 CONFIG_KALLSYMS_ALL=y 10 10 CONFIG_KALLSYMS_EXTRA_PASS=y 11 11 CONFIG_MODULES=y
+1 -1
arch/powerpc/configs/40x/ep405_defconfig
··· 5 5 CONFIG_LOG_BUF_SHIFT=14 6 6 CONFIG_BLK_DEV_INITRD=y 7 7 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 8 - CONFIG_EMBEDDED=y 8 + CONFIG_EXPERT=y 9 9 CONFIG_KALLSYMS_ALL=y 10 10 CONFIG_KALLSYMS_EXTRA_PASS=y 11 11 CONFIG_MODULES=y
+1 -1
arch/powerpc/configs/40x/hcu4_defconfig
··· 5 5 CONFIG_LOG_BUF_SHIFT=14 6 6 CONFIG_BLK_DEV_INITRD=y 7 7 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 8 - CONFIG_EMBEDDED=y 8 + CONFIG_EXPERT=y 9 9 CONFIG_KALLSYMS_ALL=y 10 10 CONFIG_KALLSYMS_EXTRA_PASS=y 11 11 CONFIG_MODULES=y
+1 -1
arch/powerpc/configs/40x/kilauea_defconfig
··· 5 5 CONFIG_LOG_BUF_SHIFT=14 6 6 CONFIG_BLK_DEV_INITRD=y 7 7 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 8 - CONFIG_EMBEDDED=y 8 + CONFIG_EXPERT=y 9 9 CONFIG_KALLSYMS_ALL=y 10 10 CONFIG_KALLSYMS_EXTRA_PASS=y 11 11 CONFIG_MODULES=y
+1 -1
arch/powerpc/configs/40x/makalu_defconfig
··· 5 5 CONFIG_LOG_BUF_SHIFT=14 6 6 CONFIG_BLK_DEV_INITRD=y 7 7 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 8 - CONFIG_EMBEDDED=y 8 + CONFIG_EXPERT=y 9 9 CONFIG_KALLSYMS_ALL=y 10 10 CONFIG_KALLSYMS_EXTRA_PASS=y 11 11 CONFIG_MODULES=y
+1 -1
arch/powerpc/configs/40x/walnut_defconfig
··· 5 5 CONFIG_LOG_BUF_SHIFT=14 6 6 CONFIG_BLK_DEV_INITRD=y 7 7 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 8 - CONFIG_EMBEDDED=y 8 + CONFIG_EXPERT=y 9 9 CONFIG_KALLSYMS_ALL=y 10 10 CONFIG_KALLSYMS_EXTRA_PASS=y 11 11 CONFIG_MODULES=y
+1 -1
arch/powerpc/configs/44x/arches_defconfig
··· 5 5 CONFIG_LOG_BUF_SHIFT=14 6 6 CONFIG_BLK_DEV_INITRD=y 7 7 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 8 - CONFIG_EMBEDDED=y 8 + CONFIG_EXPERT=y 9 9 CONFIG_MODULES=y 10 10 CONFIG_MODULE_UNLOAD=y 11 11 # CONFIG_BLK_DEV_BSG is not set
+1 -1
arch/powerpc/configs/44x/bamboo_defconfig
··· 5 5 CONFIG_LOG_BUF_SHIFT=14 6 6 CONFIG_BLK_DEV_INITRD=y 7 7 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 8 - CONFIG_EMBEDDED=y 8 + CONFIG_EXPERT=y 9 9 CONFIG_MODULES=y 10 10 CONFIG_MODULE_UNLOAD=y 11 11 # CONFIG_BLK_DEV_BSG is not set
+1 -1
arch/powerpc/configs/44x/bluestone_defconfig
··· 4 4 CONFIG_POSIX_MQUEUE=y 5 5 CONFIG_LOG_BUF_SHIFT=14 6 6 CONFIG_BLK_DEV_INITRD=y 7 - CONFIG_EMBEDDED=y 7 + CONFIG_EXPERT=y 8 8 # CONFIG_VM_EVENT_COUNTERS is not set 9 9 # CONFIG_PCI_QUIRKS is not set 10 10 # CONFIG_COMPAT_BRK is not set
+1 -1
arch/powerpc/configs/44x/canyonlands_defconfig
··· 5 5 CONFIG_LOG_BUF_SHIFT=14 6 6 CONFIG_BLK_DEV_INITRD=y 7 7 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 8 - CONFIG_EMBEDDED=y 8 + CONFIG_EXPERT=y 9 9 CONFIG_MODULES=y 10 10 CONFIG_MODULE_UNLOAD=y 11 11 # CONFIG_BLK_DEV_BSG is not set
+1 -1
arch/powerpc/configs/44x/ebony_defconfig
··· 5 5 CONFIG_LOG_BUF_SHIFT=14 6 6 CONFIG_BLK_DEV_INITRD=y 7 7 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 8 - CONFIG_EMBEDDED=y 8 + CONFIG_EXPERT=y 9 9 CONFIG_KALLSYMS_ALL=y 10 10 CONFIG_KALLSYMS_EXTRA_PASS=y 11 11 CONFIG_MODULES=y
+1 -1
arch/powerpc/configs/44x/eiger_defconfig
··· 5 5 CONFIG_LOG_BUF_SHIFT=14 6 6 CONFIG_BLK_DEV_INITRD=y 7 7 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 8 - CONFIG_EMBEDDED=y 8 + CONFIG_EXPERT=y 9 9 CONFIG_MODULES=y 10 10 CONFIG_MODULE_UNLOAD=y 11 11 # CONFIG_BLK_DEV_BSG is not set
+1 -1
arch/powerpc/configs/44x/icon_defconfig
··· 6 6 CONFIG_SYSFS_DEPRECATED_V2=y 7 7 CONFIG_BLK_DEV_INITRD=y 8 8 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 9 - CONFIG_EMBEDDED=y 9 + CONFIG_EXPERT=y 10 10 CONFIG_MODULES=y 11 11 CONFIG_MODULE_UNLOAD=y 12 12 # CONFIG_BLK_DEV_BSG is not set
+1 -1
arch/powerpc/configs/44x/iss476-smp_defconfig
··· 7 7 CONFIG_SYSFS_DEPRECATED_V2=y 8 8 CONFIG_BLK_DEV_INITRD=y 9 9 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 10 - CONFIG_EMBEDDED=y 10 + CONFIG_EXPERT=y 11 11 CONFIG_KALLSYMS_ALL=y 12 12 CONFIG_KALLSYMS_EXTRA_PASS=y 13 13 CONFIG_PROFILING=y
+1 -1
arch/powerpc/configs/44x/katmai_defconfig
··· 5 5 CONFIG_LOG_BUF_SHIFT=14 6 6 CONFIG_BLK_DEV_INITRD=y 7 7 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 8 - CONFIG_EMBEDDED=y 8 + CONFIG_EXPERT=y 9 9 CONFIG_MODULES=y 10 10 CONFIG_MODULE_UNLOAD=y 11 11 # CONFIG_BLK_DEV_BSG is not set
+1 -1
arch/powerpc/configs/44x/rainier_defconfig
··· 5 5 CONFIG_LOG_BUF_SHIFT=14 6 6 CONFIG_BLK_DEV_INITRD=y 7 7 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 8 - CONFIG_EMBEDDED=y 8 + CONFIG_EXPERT=y 9 9 CONFIG_MODULES=y 10 10 CONFIG_MODULE_UNLOAD=y 11 11 # CONFIG_BLK_DEV_BSG is not set
+1 -1
arch/powerpc/configs/44x/redwood_defconfig
··· 5 5 CONFIG_LOG_BUF_SHIFT=14 6 6 CONFIG_BLK_DEV_INITRD=y 7 7 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 8 - CONFIG_EMBEDDED=y 8 + CONFIG_EXPERT=y 9 9 CONFIG_MODULES=y 10 10 CONFIG_MODULE_UNLOAD=y 11 11 # CONFIG_BLK_DEV_BSG is not set
+1 -1
arch/powerpc/configs/44x/sam440ep_defconfig
··· 6 6 CONFIG_LOG_BUF_SHIFT=14 7 7 CONFIG_BLK_DEV_INITRD=y 8 8 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 9 - CONFIG_EMBEDDED=y 9 + CONFIG_EXPERT=y 10 10 CONFIG_MODULES=y 11 11 CONFIG_MODULE_UNLOAD=y 12 12 # CONFIG_BLK_DEV_BSG is not set
+1 -1
arch/powerpc/configs/44x/sequoia_defconfig
··· 5 5 CONFIG_LOG_BUF_SHIFT=14 6 6 CONFIG_BLK_DEV_INITRD=y 7 7 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 8 - CONFIG_EMBEDDED=y 8 + CONFIG_EXPERT=y 9 9 CONFIG_MODULES=y 10 10 CONFIG_MODULE_UNLOAD=y 11 11 # CONFIG_BLK_DEV_BSG is not set
+1 -1
arch/powerpc/configs/44x/taishan_defconfig
··· 5 5 CONFIG_LOG_BUF_SHIFT=14 6 6 CONFIG_BLK_DEV_INITRD=y 7 7 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 8 - CONFIG_EMBEDDED=y 8 + CONFIG_EXPERT=y 9 9 CONFIG_MODULES=y 10 10 CONFIG_MODULE_UNLOAD=y 11 11 # CONFIG_BLK_DEV_BSG is not set
+1 -1
arch/powerpc/configs/44x/warp_defconfig
··· 8 8 CONFIG_LOG_BUF_SHIFT=14 9 9 CONFIG_BLK_DEV_INITRD=y 10 10 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 11 - CONFIG_EMBEDDED=y 11 + CONFIG_EXPERT=y 12 12 CONFIG_MODULES=y 13 13 CONFIG_MODULE_UNLOAD=y 14 14 # CONFIG_BLK_DEV_BSG is not set
+1 -1
arch/powerpc/configs/52xx/cm5200_defconfig
··· 3 3 CONFIG_LOG_BUF_SHIFT=14 4 4 CONFIG_BLK_DEV_INITRD=y 5 5 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 6 - CONFIG_EMBEDDED=y 6 + CONFIG_EXPERT=y 7 7 # CONFIG_SYSCTL_SYSCALL is not set 8 8 # CONFIG_KALLSYMS is not set 9 9 # CONFIG_EPOLL is not set
+1 -1
arch/powerpc/configs/52xx/lite5200b_defconfig
··· 3 3 CONFIG_LOG_BUF_SHIFT=14 4 4 CONFIG_BLK_DEV_INITRD=y 5 5 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 6 - CONFIG_EMBEDDED=y 6 + CONFIG_EXPERT=y 7 7 # CONFIG_SYSCTL_SYSCALL is not set 8 8 # CONFIG_KALLSYMS is not set 9 9 # CONFIG_EPOLL is not set
+1 -1
arch/powerpc/configs/52xx/motionpro_defconfig
··· 3 3 CONFIG_LOG_BUF_SHIFT=14 4 4 CONFIG_BLK_DEV_INITRD=y 5 5 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 6 - CONFIG_EMBEDDED=y 6 + CONFIG_EXPERT=y 7 7 # CONFIG_SYSCTL_SYSCALL is not set 8 8 # CONFIG_KALLSYMS is not set 9 9 # CONFIG_EPOLL is not set
+1 -1
arch/powerpc/configs/52xx/pcm030_defconfig
··· 8 8 CONFIG_IKCONFIG_PROC=y 9 9 CONFIG_LOG_BUF_SHIFT=14 10 10 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 11 - CONFIG_EMBEDDED=y 11 + CONFIG_EXPERT=y 12 12 # CONFIG_SYSCTL_SYSCALL is not set 13 13 # CONFIG_VM_EVENT_COUNTERS is not set 14 14 CONFIG_SLAB=y
+1 -1
arch/powerpc/configs/52xx/tqm5200_defconfig
··· 3 3 CONFIG_LOG_BUF_SHIFT=14 4 4 CONFIG_BLK_DEV_INITRD=y 5 5 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 6 - CONFIG_EMBEDDED=y 6 + CONFIG_EXPERT=y 7 7 # CONFIG_SYSCTL_SYSCALL is not set 8 8 # CONFIG_KALLSYMS is not set 9 9 # CONFIG_EPOLL is not set
+1 -1
arch/powerpc/configs/83xx/asp8347_defconfig
··· 4 4 CONFIG_LOG_BUF_SHIFT=14 5 5 CONFIG_BLK_DEV_INITRD=y 6 6 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 7 - CONFIG_EMBEDDED=y 7 + CONFIG_EXPERT=y 8 8 # CONFIG_KALLSYMS is not set 9 9 CONFIG_MODULES=y 10 10 CONFIG_MODULE_UNLOAD=y
+1 -1
arch/powerpc/configs/83xx/kmeter1_defconfig
··· 3 3 CONFIG_SYSVIPC=y 4 4 CONFIG_POSIX_MQUEUE=y 5 5 CONFIG_LOG_BUF_SHIFT=14 6 - CONFIG_EMBEDDED=y 6 + CONFIG_EXPERT=y 7 7 # CONFIG_HOTPLUG is not set 8 8 CONFIG_SLAB=y 9 9 CONFIG_MODULES=y
+1 -1
arch/powerpc/configs/83xx/mpc8313_rdb_defconfig
··· 3 3 CONFIG_LOG_BUF_SHIFT=14 4 4 CONFIG_BLK_DEV_INITRD=y 5 5 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 6 - CONFIG_EMBEDDED=y 6 + CONFIG_EXPERT=y 7 7 # CONFIG_KALLSYMS is not set 8 8 CONFIG_MODULES=y 9 9 CONFIG_MODULE_UNLOAD=y
+1 -1
arch/powerpc/configs/83xx/mpc8315_rdb_defconfig
··· 3 3 CONFIG_LOG_BUF_SHIFT=14 4 4 CONFIG_BLK_DEV_INITRD=y 5 5 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 6 - CONFIG_EMBEDDED=y 6 + CONFIG_EXPERT=y 7 7 # CONFIG_KALLSYMS is not set 8 8 CONFIG_MODULES=y 9 9 CONFIG_MODULE_UNLOAD=y
+1 -1
arch/powerpc/configs/83xx/mpc832x_mds_defconfig
··· 3 3 CONFIG_LOG_BUF_SHIFT=14 4 4 CONFIG_BLK_DEV_INITRD=y 5 5 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 6 - CONFIG_EMBEDDED=y 6 + CONFIG_EXPERT=y 7 7 # CONFIG_KALLSYMS is not set 8 8 CONFIG_MODULES=y 9 9 CONFIG_MODULE_UNLOAD=y
+1 -1
arch/powerpc/configs/83xx/mpc832x_rdb_defconfig
··· 3 3 CONFIG_LOG_BUF_SHIFT=14 4 4 CONFIG_BLK_DEV_INITRD=y 5 5 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 6 - CONFIG_EMBEDDED=y 6 + CONFIG_EXPERT=y 7 7 # CONFIG_KALLSYMS is not set 8 8 CONFIG_MODULES=y 9 9 CONFIG_MODULE_UNLOAD=y
+1 -1
arch/powerpc/configs/83xx/mpc834x_itx_defconfig
··· 3 3 CONFIG_LOG_BUF_SHIFT=14 4 4 CONFIG_BLK_DEV_INITRD=y 5 5 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 6 - CONFIG_EMBEDDED=y 6 + CONFIG_EXPERT=y 7 7 # CONFIG_KALLSYMS is not set 8 8 CONFIG_MODULES=y 9 9 CONFIG_MODULE_UNLOAD=y
+1 -1
arch/powerpc/configs/83xx/mpc834x_itxgp_defconfig
··· 3 3 CONFIG_LOG_BUF_SHIFT=14 4 4 CONFIG_BLK_DEV_INITRD=y 5 5 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 6 - CONFIG_EMBEDDED=y 6 + CONFIG_EXPERT=y 7 7 # CONFIG_KALLSYMS is not set 8 8 CONFIG_MODULES=y 9 9 CONFIG_MODULE_UNLOAD=y
+1 -1
arch/powerpc/configs/83xx/mpc834x_mds_defconfig
··· 3 3 CONFIG_LOG_BUF_SHIFT=14 4 4 CONFIG_BLK_DEV_INITRD=y 5 5 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 6 - CONFIG_EMBEDDED=y 6 + CONFIG_EXPERT=y 7 7 # CONFIG_KALLSYMS is not set 8 8 CONFIG_MODULES=y 9 9 CONFIG_MODULE_UNLOAD=y
+1 -1
arch/powerpc/configs/83xx/mpc836x_mds_defconfig
··· 3 3 CONFIG_LOG_BUF_SHIFT=14 4 4 CONFIG_BLK_DEV_INITRD=y 5 5 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 6 - CONFIG_EMBEDDED=y 6 + CONFIG_EXPERT=y 7 7 # CONFIG_KALLSYMS is not set 8 8 CONFIG_MODULES=y 9 9 CONFIG_MODULE_UNLOAD=y
+1 -1
arch/powerpc/configs/83xx/mpc836x_rdk_defconfig
··· 3 3 CONFIG_LOG_BUF_SHIFT=14 4 4 CONFIG_BLK_DEV_INITRD=y 5 5 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 6 - CONFIG_EMBEDDED=y 6 + CONFIG_EXPERT=y 7 7 # CONFIG_KALLSYMS is not set 8 8 CONFIG_MODULES=y 9 9 CONFIG_MODULE_UNLOAD=y
+1 -1
arch/powerpc/configs/83xx/mpc837x_mds_defconfig
··· 3 3 CONFIG_LOG_BUF_SHIFT=14 4 4 CONFIG_BLK_DEV_INITRD=y 5 5 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 6 - CONFIG_EMBEDDED=y 6 + CONFIG_EXPERT=y 7 7 CONFIG_SLAB=y 8 8 CONFIG_MODULES=y 9 9 CONFIG_MODULE_UNLOAD=y
+1 -1
arch/powerpc/configs/83xx/mpc837x_rdb_defconfig
··· 3 3 CONFIG_LOG_BUF_SHIFT=14 4 4 CONFIG_BLK_DEV_INITRD=y 5 5 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 6 - CONFIG_EMBEDDED=y 6 + CONFIG_EXPERT=y 7 7 CONFIG_SLAB=y 8 8 CONFIG_MODULES=y 9 9 CONFIG_MODULE_UNLOAD=y
+1 -1
arch/powerpc/configs/83xx/sbc834x_defconfig
··· 3 3 CONFIG_LOG_BUF_SHIFT=14 4 4 CONFIG_BLK_DEV_INITRD=y 5 5 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 6 - CONFIG_EMBEDDED=y 6 + CONFIG_EXPERT=y 7 7 # CONFIG_KALLSYMS is not set 8 8 CONFIG_SLAB=y 9 9 CONFIG_MODULES=y
+1 -1
arch/powerpc/configs/85xx/ksi8560_defconfig
··· 4 4 CONFIG_LOG_BUF_SHIFT=14 5 5 CONFIG_BLK_DEV_INITRD=y 6 6 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 7 - CONFIG_EMBEDDED=y 7 + CONFIG_EXPERT=y 8 8 # CONFIG_BLK_DEV_BSG is not set 9 9 CONFIG_KSI8560=y 10 10 CONFIG_CPM2=y
+1 -1
arch/powerpc/configs/85xx/mpc8540_ads_defconfig
··· 4 4 CONFIG_LOG_BUF_SHIFT=14 5 5 CONFIG_BLK_DEV_INITRD=y 6 6 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 7 - CONFIG_EMBEDDED=y 7 + CONFIG_EXPERT=y 8 8 # CONFIG_BLK_DEV_BSG is not set 9 9 CONFIG_MPC8540_ADS=y 10 10 CONFIG_NO_HZ=y
+1 -1
arch/powerpc/configs/85xx/mpc8560_ads_defconfig
··· 4 4 CONFIG_LOG_BUF_SHIFT=14 5 5 CONFIG_BLK_DEV_INITRD=y 6 6 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 7 - CONFIG_EMBEDDED=y 7 + CONFIG_EXPERT=y 8 8 # CONFIG_BLK_DEV_BSG is not set 9 9 CONFIG_MPC8560_ADS=y 10 10 CONFIG_BINFMT_MISC=y
+1 -1
arch/powerpc/configs/85xx/mpc85xx_cds_defconfig
··· 4 4 CONFIG_LOG_BUF_SHIFT=14 5 5 CONFIG_BLK_DEV_INITRD=y 6 6 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 7 - CONFIG_EMBEDDED=y 7 + CONFIG_EXPERT=y 8 8 # CONFIG_BLK_DEV_BSG is not set 9 9 CONFIG_MPC85xx_CDS=y 10 10 CONFIG_NO_HZ=y
+1 -1
arch/powerpc/configs/85xx/sbc8548_defconfig
··· 4 4 CONFIG_LOG_BUF_SHIFT=14 5 5 CONFIG_BLK_DEV_INITRD=y 6 6 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 7 - CONFIG_EMBEDDED=y 7 + CONFIG_EXPERT=y 8 8 CONFIG_SLAB=y 9 9 # CONFIG_BLK_DEV_BSG is not set 10 10 CONFIG_SBC8548=y
+1 -1
arch/powerpc/configs/85xx/sbc8560_defconfig
··· 4 4 CONFIG_LOG_BUF_SHIFT=14 5 5 CONFIG_BLK_DEV_INITRD=y 6 6 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 7 - CONFIG_EMBEDDED=y 7 + CONFIG_EXPERT=y 8 8 CONFIG_SLAB=y 9 9 # CONFIG_BLK_DEV_BSG is not set 10 10 CONFIG_SBC8560=y
+1 -1
arch/powerpc/configs/85xx/socrates_defconfig
··· 4 4 CONFIG_LOG_BUF_SHIFT=16 5 5 CONFIG_BLK_DEV_INITRD=y 6 6 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 7 - CONFIG_EMBEDDED=y 7 + CONFIG_EXPERT=y 8 8 # CONFIG_KALLSYMS is not set 9 9 # CONFIG_HOTPLUG is not set 10 10 # CONFIG_EPOLL is not set
+1 -1
arch/powerpc/configs/85xx/stx_gp3_defconfig
··· 4 4 CONFIG_LOG_BUF_SHIFT=14 5 5 CONFIG_BLK_DEV_INITRD=y 6 6 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 7 - CONFIG_EMBEDDED=y 7 + CONFIG_EXPERT=y 8 8 CONFIG_MODULES=y 9 9 CONFIG_MODVERSIONS=y 10 10 # CONFIG_BLK_DEV_BSG is not set
+1 -1
arch/powerpc/configs/85xx/tqm8540_defconfig
··· 4 4 CONFIG_LOG_BUF_SHIFT=14 5 5 CONFIG_BLK_DEV_INITRD=y 6 6 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 7 - CONFIG_EMBEDDED=y 7 + CONFIG_EXPERT=y 8 8 # CONFIG_KALLSYMS is not set 9 9 # CONFIG_HOTPLUG is not set 10 10 # CONFIG_EPOLL is not set
+1 -1
arch/powerpc/configs/85xx/tqm8541_defconfig
··· 4 4 CONFIG_LOG_BUF_SHIFT=14 5 5 CONFIG_BLK_DEV_INITRD=y 6 6 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 7 - CONFIG_EMBEDDED=y 7 + CONFIG_EXPERT=y 8 8 # CONFIG_KALLSYMS is not set 9 9 # CONFIG_HOTPLUG is not set 10 10 # CONFIG_EPOLL is not set
+1 -1
arch/powerpc/configs/85xx/tqm8548_defconfig
··· 4 4 CONFIG_LOG_BUF_SHIFT=14 5 5 CONFIG_BLK_DEV_INITRD=y 6 6 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 7 - CONFIG_EMBEDDED=y 7 + CONFIG_EXPERT=y 8 8 CONFIG_MODULES=y 9 9 CONFIG_MODULE_UNLOAD=y 10 10 # CONFIG_BLK_DEV_BSG is not set
+1 -1
arch/powerpc/configs/85xx/tqm8555_defconfig
··· 4 4 CONFIG_LOG_BUF_SHIFT=14 5 5 CONFIG_BLK_DEV_INITRD=y 6 6 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 7 - CONFIG_EMBEDDED=y 7 + CONFIG_EXPERT=y 8 8 # CONFIG_KALLSYMS is not set 9 9 # CONFIG_HOTPLUG is not set 10 10 # CONFIG_EPOLL is not set
+1 -1
arch/powerpc/configs/85xx/tqm8560_defconfig
··· 4 4 CONFIG_LOG_BUF_SHIFT=14 5 5 CONFIG_BLK_DEV_INITRD=y 6 6 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 7 - CONFIG_EMBEDDED=y 7 + CONFIG_EXPERT=y 8 8 # CONFIG_KALLSYMS is not set 9 9 # CONFIG_HOTPLUG is not set 10 10 # CONFIG_EPOLL is not set
+1 -1
arch/powerpc/configs/85xx/xes_mpc85xx_defconfig
··· 11 11 CONFIG_LOG_BUF_SHIFT=14 12 12 CONFIG_BLK_DEV_INITRD=y 13 13 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 14 - CONFIG_EMBEDDED=y 14 + CONFIG_EXPERT=y 15 15 CONFIG_KALLSYMS_ALL=y 16 16 CONFIG_KALLSYMS_EXTRA_PASS=y 17 17 CONFIG_MODULES=y
+1 -1
arch/powerpc/configs/86xx/gef_ppc9a_defconfig
··· 11 11 CONFIG_RELAY=y 12 12 CONFIG_BLK_DEV_INITRD=y 13 13 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 14 - CONFIG_EMBEDDED=y 14 + CONFIG_EXPERT=y 15 15 CONFIG_SLAB=y 16 16 CONFIG_MODULES=y 17 17 CONFIG_MODULE_UNLOAD=y
+1 -1
arch/powerpc/configs/86xx/gef_sbc310_defconfig
··· 11 11 CONFIG_RELAY=y 12 12 CONFIG_BLK_DEV_INITRD=y 13 13 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 14 - CONFIG_EMBEDDED=y 14 + CONFIG_EXPERT=y 15 15 CONFIG_SLAB=y 16 16 CONFIG_MODULES=y 17 17 CONFIG_MODULE_UNLOAD=y
+1 -1
arch/powerpc/configs/86xx/gef_sbc610_defconfig
··· 11 11 CONFIG_RELAY=y 12 12 CONFIG_BLK_DEV_INITRD=y 13 13 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 14 - CONFIG_EMBEDDED=y 14 + CONFIG_EXPERT=y 15 15 CONFIG_SLAB=y 16 16 CONFIG_MODULES=y 17 17 CONFIG_MODULE_UNLOAD=y
+1 -1
arch/powerpc/configs/86xx/mpc8610_hpcd_defconfig
··· 6 6 CONFIG_LOG_BUF_SHIFT=14 7 7 CONFIG_BLK_DEV_INITRD=y 8 8 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 9 - CONFIG_EMBEDDED=y 9 + CONFIG_EXPERT=y 10 10 CONFIG_KALLSYMS_EXTRA_PASS=y 11 11 # CONFIG_ELF_CORE is not set 12 12 CONFIG_MODULES=y
+1 -1
arch/powerpc/configs/86xx/mpc8641_hpcn_defconfig
··· 10 10 CONFIG_LOG_BUF_SHIFT=14 11 11 CONFIG_BLK_DEV_INITRD=y 12 12 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 13 - CONFIG_EMBEDDED=y 13 + CONFIG_EXPERT=y 14 14 CONFIG_KALLSYMS_ALL=y 15 15 CONFIG_KALLSYMS_EXTRA_PASS=y 16 16 CONFIG_MODULES=y
+1 -1
arch/powerpc/configs/86xx/sbc8641d_defconfig
··· 11 11 CONFIG_RELAY=y 12 12 CONFIG_BLK_DEV_INITRD=y 13 13 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 14 - CONFIG_EMBEDDED=y 14 + CONFIG_EXPERT=y 15 15 CONFIG_SLAB=y 16 16 CONFIG_MODULES=y 17 17 CONFIG_MODULE_UNLOAD=y
+1 -1
arch/powerpc/configs/adder875_defconfig
··· 4 4 CONFIG_SYSVIPC=y 5 5 CONFIG_LOG_BUF_SHIFT=14 6 6 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 7 - CONFIG_EMBEDDED=y 7 + CONFIG_EXPERT=y 8 8 # CONFIG_SYSCTL_SYSCALL is not set 9 9 # CONFIG_ELF_CORE is not set 10 10 # CONFIG_BASE_FULL is not set
+1 -1
arch/powerpc/configs/e55xx_smp_defconfig
··· 12 12 CONFIG_SYSFS_DEPRECATED_V2=y 13 13 CONFIG_BLK_DEV_INITRD=y 14 14 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 15 - CONFIG_EMBEDDED=y 15 + CONFIG_EXPERT=y 16 16 CONFIG_KALLSYMS_ALL=y 17 17 CONFIG_KALLSYMS_EXTRA_PASS=y 18 18 CONFIG_MODULES=y
+1 -1
arch/powerpc/configs/ep8248e_defconfig
··· 2 2 CONFIG_IKCONFIG=y 3 3 CONFIG_IKCONFIG_PROC=y 4 4 CONFIG_LOG_BUF_SHIFT=14 5 - CONFIG_EMBEDDED=y 5 + CONFIG_EXPERT=y 6 6 CONFIG_KALLSYMS_ALL=y 7 7 CONFIG_SLAB=y 8 8 # CONFIG_IOSCHED_CFQ is not set
+1 -1
arch/powerpc/configs/ep88xc_defconfig
··· 4 4 CONFIG_SYSVIPC=y 5 5 CONFIG_LOG_BUF_SHIFT=14 6 6 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 7 - CONFIG_EMBEDDED=y 7 + CONFIG_EXPERT=y 8 8 # CONFIG_SYSCTL_SYSCALL is not set 9 9 # CONFIG_ELF_CORE is not set 10 10 # CONFIG_BASE_FULL is not set
+1 -1
arch/powerpc/configs/gamecube_defconfig
··· 6 6 CONFIG_LOG_BUF_SHIFT=14 7 7 CONFIG_BLK_DEV_INITRD=y 8 8 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 9 - CONFIG_EMBEDDED=y 9 + CONFIG_EXPERT=y 10 10 # CONFIG_ELF_CORE is not set 11 11 CONFIG_PERF_COUNTERS=y 12 12 # CONFIG_VM_EVENT_COUNTERS is not set
+1 -1
arch/powerpc/configs/holly_defconfig
··· 3 3 CONFIG_LOG_BUF_SHIFT=14 4 4 CONFIG_BLK_DEV_INITRD=y 5 5 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 6 - CONFIG_EMBEDDED=y 6 + CONFIG_EXPERT=y 7 7 CONFIG_MODULES=y 8 8 # CONFIG_BLK_DEV_BSG is not set 9 9 # CONFIG_PPC_CHRP is not set
+1 -1
arch/powerpc/configs/mgcoge_defconfig
··· 3 3 CONFIG_IKCONFIG_PROC=y 4 4 CONFIG_LOG_BUF_SHIFT=14 5 5 CONFIG_BLK_DEV_INITRD=y 6 - CONFIG_EMBEDDED=y 6 + CONFIG_EXPERT=y 7 7 CONFIG_KALLSYMS_ALL=y 8 8 CONFIG_SLAB=y 9 9 # CONFIG_IOSCHED_CFQ is not set
+1 -1
arch/powerpc/configs/mgsuvd_defconfig
··· 4 4 CONFIG_SYSVIPC=y 5 5 CONFIG_BLK_DEV_INITRD=y 6 6 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 7 - CONFIG_EMBEDDED=y 7 + CONFIG_EXPERT=y 8 8 # CONFIG_SYSCTL_SYSCALL is not set 9 9 # CONFIG_HOTPLUG is not set 10 10 # CONFIG_BUG is not set
+1 -1
arch/powerpc/configs/mpc7448_hpc2_defconfig
··· 4 4 CONFIG_LOG_BUF_SHIFT=14 5 5 CONFIG_BLK_DEV_INITRD=y 6 6 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 7 - CONFIG_EMBEDDED=y 7 + CONFIG_EXPERT=y 8 8 # CONFIG_BLK_DEV_BSG is not set 9 9 # CONFIG_PPC_CHRP is not set 10 10 # CONFIG_PPC_PMAC is not set
+1 -1
arch/powerpc/configs/mpc8272_ads_defconfig
··· 2 2 CONFIG_IKCONFIG=y 3 3 CONFIG_IKCONFIG_PROC=y 4 4 CONFIG_LOG_BUF_SHIFT=14 5 - CONFIG_EMBEDDED=y 5 + CONFIG_EXPERT=y 6 6 CONFIG_KALLSYMS_ALL=y 7 7 # CONFIG_PPC_CHRP is not set 8 8 # CONFIG_PPC_PMAC is not set
+1 -1
arch/powerpc/configs/mpc83xx_defconfig
··· 3 3 CONFIG_LOG_BUF_SHIFT=14 4 4 CONFIG_BLK_DEV_INITRD=y 5 5 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 6 - CONFIG_EMBEDDED=y 6 + CONFIG_EXPERT=y 7 7 CONFIG_SLAB=y 8 8 CONFIG_MODULES=y 9 9 CONFIG_MODULE_UNLOAD=y
+1 -1
arch/powerpc/configs/mpc85xx_defconfig
··· 10 10 CONFIG_LOG_BUF_SHIFT=14 11 11 CONFIG_BLK_DEV_INITRD=y 12 12 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 13 - CONFIG_EMBEDDED=y 13 + CONFIG_EXPERT=y 14 14 CONFIG_KALLSYMS_ALL=y 15 15 CONFIG_KALLSYMS_EXTRA_PASS=y 16 16 CONFIG_MODULES=y
+1 -1
arch/powerpc/configs/mpc85xx_smp_defconfig
··· 12 12 CONFIG_LOG_BUF_SHIFT=14 13 13 CONFIG_BLK_DEV_INITRD=y 14 14 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 15 - CONFIG_EMBEDDED=y 15 + CONFIG_EXPERT=y 16 16 CONFIG_KALLSYMS_ALL=y 17 17 CONFIG_KALLSYMS_EXTRA_PASS=y 18 18 CONFIG_MODULES=y
+1 -1
arch/powerpc/configs/mpc866_ads_defconfig
··· 4 4 CONFIG_SYSVIPC=y 5 5 CONFIG_LOG_BUF_SHIFT=14 6 6 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 7 - CONFIG_EMBEDDED=y 7 + CONFIG_EXPERT=y 8 8 # CONFIG_SYSCTL_SYSCALL is not set 9 9 # CONFIG_HOTPLUG is not set 10 10 # CONFIG_BUG is not set
+1 -1
arch/powerpc/configs/mpc86xx_defconfig
··· 10 10 CONFIG_LOG_BUF_SHIFT=14 11 11 CONFIG_BLK_DEV_INITRD=y 12 12 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 13 - CONFIG_EMBEDDED=y 13 + CONFIG_EXPERT=y 14 14 CONFIG_KALLSYMS_ALL=y 15 15 CONFIG_KALLSYMS_EXTRA_PASS=y 16 16 CONFIG_MODULES=y
+1 -1
arch/powerpc/configs/mpc885_ads_defconfig
··· 4 4 CONFIG_SYSVIPC=y 5 5 CONFIG_LOG_BUF_SHIFT=14 6 6 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 7 - CONFIG_EMBEDDED=y 7 + CONFIG_EXPERT=y 8 8 # CONFIG_SYSCTL_SYSCALL is not set 9 9 # CONFIG_ELF_CORE is not set 10 10 # CONFIG_BASE_FULL is not set
+1 -1
arch/powerpc/configs/ppc40x_defconfig
··· 5 5 CONFIG_LOG_BUF_SHIFT=14 6 6 CONFIG_BLK_DEV_INITRD=y 7 7 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 8 - CONFIG_EMBEDDED=y 8 + CONFIG_EXPERT=y 9 9 CONFIG_KALLSYMS_ALL=y 10 10 CONFIG_KALLSYMS_EXTRA_PASS=y 11 11 CONFIG_MODULES=y
+1 -1
arch/powerpc/configs/ppc44x_defconfig
··· 5 5 CONFIG_LOG_BUF_SHIFT=14 6 6 CONFIG_BLK_DEV_INITRD=y 7 7 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 8 - CONFIG_EMBEDDED=y 8 + CONFIG_EXPERT=y 9 9 CONFIG_KALLSYMS_ALL=y 10 10 CONFIG_KALLSYMS_EXTRA_PASS=y 11 11 CONFIG_MODULES=y
+1 -1
arch/powerpc/configs/pq2fads_defconfig
··· 3 3 CONFIG_IKCONFIG_PROC=y 4 4 CONFIG_LOG_BUF_SHIFT=14 5 5 CONFIG_BLK_DEV_INITRD=y 6 - CONFIG_EMBEDDED=y 6 + CONFIG_EXPERT=y 7 7 CONFIG_KALLSYMS_ALL=y 8 8 # CONFIG_PPC_CHRP is not set 9 9 # CONFIG_PPC_PMAC is not set
+1 -1
arch/powerpc/configs/ps3_defconfig
··· 8 8 CONFIG_POSIX_MQUEUE=y 9 9 CONFIG_NAMESPACES=y 10 10 CONFIG_BLK_DEV_INITRD=y 11 - CONFIG_EMBEDDED=y 11 + CONFIG_EXPERT=y 12 12 CONFIG_KALLSYMS_EXTRA_PASS=y 13 13 # CONFIG_PERF_EVENTS is not set 14 14 # CONFIG_COMPAT_BRK is not set
+4 -3
arch/powerpc/configs/pseries_defconfig
··· 2 2 CONFIG_ALTIVEC=y 3 3 CONFIG_VSX=y 4 4 CONFIG_SMP=y 5 - CONFIG_NR_CPUS=128 5 + CONFIG_NR_CPUS=1024 6 6 CONFIG_EXPERIMENTAL=y 7 7 CONFIG_SYSVIPC=y 8 8 CONFIG_POSIX_MQUEUE=y ··· 45 45 CONFIG_IRQ_ALL_CPUS=y 46 46 CONFIG_MEMORY_HOTPLUG=y 47 47 CONFIG_MEMORY_HOTREMOVE=y 48 + CONFIG_PPC_64K_PAGES=y 49 + CONFIG_PPC_SUBPAGE_PROT=y 48 50 CONFIG_SCHED_SMT=y 49 51 CONFIG_HOTPLUG_PCI=m 50 52 CONFIG_HOTPLUG_PCI_RPA=m ··· 186 184 CONFIG_E1000=y 187 185 CONFIG_E1000E=y 188 186 CONFIG_TIGON3=y 187 + CONFIG_BNX2=m 189 188 CONFIG_CHELSIO_T1=m 190 189 CONFIG_CHELSIO_T3=m 191 190 CONFIG_EHEA=y ··· 314 311 # CONFIG_RCU_CPU_STALL_DETECTOR is not set 315 312 CONFIG_LATENCYTOP=y 316 313 CONFIG_SYSCTL_SYSCALL_CHECK=y 317 - CONFIG_IRQSOFF_TRACER=y 318 314 CONFIG_SCHED_TRACER=y 319 - CONFIG_STACK_TRACER=y 320 315 CONFIG_BLK_DEV_IO_TRACE=y 321 316 CONFIG_DEBUG_STACKOVERFLOW=y 322 317 CONFIG_DEBUG_STACK_USAGE=y
+1 -1
arch/powerpc/configs/storcenter_defconfig
··· 1 1 CONFIG_EXPERIMENTAL=y 2 2 CONFIG_SYSVIPC=y 3 3 CONFIG_LOG_BUF_SHIFT=14 4 - CONFIG_EMBEDDED=y 4 + CONFIG_EXPERT=y 5 5 # CONFIG_KALLSYMS is not set 6 6 CONFIG_MODULES=y 7 7 CONFIG_MODULE_UNLOAD=y
+1 -1
arch/powerpc/configs/tqm8xx_defconfig
··· 5 5 CONFIG_LOG_BUF_SHIFT=14 6 6 CONFIG_SYSFS_DEPRECATED_V2=y 7 7 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 8 - CONFIG_EMBEDDED=y 8 + CONFIG_EXPERT=y 9 9 # CONFIG_SYSCTL_SYSCALL is not set 10 10 # CONFIG_ELF_CORE is not set 11 11 # CONFIG_BASE_FULL is not set
+1 -1
arch/powerpc/configs/wii_defconfig
··· 7 7 CONFIG_LOG_BUF_SHIFT=14 8 8 CONFIG_BLK_DEV_INITRD=y 9 9 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 10 - CONFIG_EMBEDDED=y 10 + CONFIG_EXPERT=y 11 11 # CONFIG_ELF_CORE is not set 12 12 CONFIG_PERF_COUNTERS=y 13 13 # CONFIG_VM_EVENT_COUNTERS is not set
+15 -12
arch/powerpc/include/asm/feature-fixups.h
··· 37 37 .align 2; \ 38 38 label##3: 39 39 40 - #define MAKE_FTR_SECTION_ENTRY(msk, val, label, sect) \ 41 - label##4: \ 42 - .popsection; \ 43 - .pushsection sect,"a"; \ 44 - .align 3; \ 45 - label##5: \ 46 - FTR_ENTRY_LONG msk; \ 47 - FTR_ENTRY_LONG val; \ 48 - FTR_ENTRY_OFFSET label##1b-label##5b; \ 49 - FTR_ENTRY_OFFSET label##2b-label##5b; \ 50 - FTR_ENTRY_OFFSET label##3b-label##5b; \ 51 - FTR_ENTRY_OFFSET label##4b-label##5b; \ 40 + #define MAKE_FTR_SECTION_ENTRY(msk, val, label, sect) \ 41 + label##4: \ 42 + .popsection; \ 43 + .pushsection sect,"a"; \ 44 + .align 3; \ 45 + label##5: \ 46 + FTR_ENTRY_LONG msk; \ 47 + FTR_ENTRY_LONG val; \ 48 + FTR_ENTRY_OFFSET label##1b-label##5b; \ 49 + FTR_ENTRY_OFFSET label##2b-label##5b; \ 50 + FTR_ENTRY_OFFSET label##3b-label##5b; \ 51 + FTR_ENTRY_OFFSET label##4b-label##5b; \ 52 + .ifgt (label##4b-label##3b)-(label##2b-label##1b); \ 53 + .error "Feature section else case larger than body"; \ 54 + .endif; \ 52 55 .popsection; 53 56 54 57
+15 -6
arch/powerpc/include/asm/immap_qe.h
··· 467 467 extern struct qe_immap __iomem *qe_immr; 468 468 extern phys_addr_t get_qe_base(void); 469 469 470 - static inline unsigned long immrbar_virt_to_phys(void *address) 470 + /* 471 + * Returns the offset within the QE address space of the given pointer. 472 + * 473 + * Note that the QE does not support 36-bit physical addresses, so if 474 + * get_qe_base() returns a number above 4GB, the caller will probably fail. 475 + */ 476 + static inline phys_addr_t immrbar_virt_to_phys(void *address) 471 477 { 472 - if ( ((u32)address >= (u32)qe_immr) && 473 - ((u32)address < ((u32)qe_immr + QE_IMMAP_SIZE)) ) 474 - return (unsigned long)(address - (u32)qe_immr + 475 - (u32)get_qe_base()); 476 - return (unsigned long)virt_to_phys(address); 478 + void *q = (void *)qe_immr; 479 + 480 + /* Is it a MURAM address? */ 481 + if ((address >= q) && (address < (q + QE_IMMAP_SIZE))) 482 + return get_qe_base() + (address - q); 483 + 484 + /* It's an address returned by kmalloc */ 485 + return virt_to_phys(address); 477 486 } 478 487 479 488 #endif /* __KERNEL__ */
+30 -10
arch/powerpc/include/asm/irqflags.h
··· 12 12 13 13 #else 14 14 #ifdef CONFIG_TRACE_IRQFLAGS 15 + #ifdef CONFIG_IRQSOFF_TRACER 16 + /* 17 + * Since the ftrace irqsoff latency trace checks CALLER_ADDR1, 18 + * which is the stack frame here, we need to force a stack frame 19 + * in case we came from user space. 20 + */ 21 + #define TRACE_WITH_FRAME_BUFFER(func) \ 22 + mflr r0; \ 23 + stdu r1, -32(r1); \ 24 + std r0, 16(r1); \ 25 + stdu r1, -32(r1); \ 26 + bl func; \ 27 + ld r1, 0(r1); \ 28 + ld r1, 0(r1); 29 + #else 30 + #define TRACE_WITH_FRAME_BUFFER(func) \ 31 + bl func; 32 + #endif 33 + 15 34 /* 16 35 * Most of the CPU's IRQ-state tracing is done from assembly code; we 17 36 * have to call a C function so call a wrapper that saves all the 18 37 * C-clobbered registers. 19 38 */ 20 - #define TRACE_ENABLE_INTS bl .trace_hardirqs_on 21 - #define TRACE_DISABLE_INTS bl .trace_hardirqs_off 22 - #define TRACE_AND_RESTORE_IRQ_PARTIAL(en,skip) \ 23 - cmpdi en,0; \ 24 - bne 95f; \ 25 - stb en,PACASOFTIRQEN(r13); \ 26 - bl .trace_hardirqs_off; \ 27 - b skip; \ 28 - 95: bl .trace_hardirqs_on; \ 39 + #define TRACE_ENABLE_INTS TRACE_WITH_FRAME_BUFFER(.trace_hardirqs_on) 40 + #define TRACE_DISABLE_INTS TRACE_WITH_FRAME_BUFFER(.trace_hardirqs_off) 41 + 42 + #define TRACE_AND_RESTORE_IRQ_PARTIAL(en,skip) \ 43 + cmpdi en,0; \ 44 + bne 95f; \ 45 + stb en,PACASOFTIRQEN(r13); \ 46 + TRACE_WITH_FRAME_BUFFER(.trace_hardirqs_off) \ 47 + b skip; \ 48 + 95: TRACE_WITH_FRAME_BUFFER(.trace_hardirqs_on) \ 29 49 li en,1; 30 50 #define TRACE_AND_RESTORE_IRQ(en) \ 31 51 TRACE_AND_RESTORE_IRQ_PARTIAL(en,96f); \ 32 - stb en,PACASOFTIRQEN(r13); \ 52 + stb en,PACASOFTIRQEN(r13); \ 33 53 96: 34 54 #else 35 55 #define TRACE_ENABLE_INTS
+1 -17
arch/powerpc/include/asm/machdep.h
··· 116 116 * If for some reason there is no irq, but the interrupt 117 117 * shouldn't be counted as spurious, return NO_IRQ_IGNORE. */ 118 118 unsigned int (*get_irq)(void); 119 - #ifdef CONFIG_KEXEC 120 - void (*kexec_cpu_down)(int crash_shutdown, int secondary); 121 - #endif 122 119 123 120 /* PCI stuff */ 124 121 /* Called after scanning the bus, before allocating resources */ ··· 232 235 void (*machine_shutdown)(void); 233 236 234 237 #ifdef CONFIG_KEXEC 235 - /* Called to do the minimal shutdown needed to run a kexec'd kernel 236 - * to run successfully. 237 - * XXX Should we move this one out of kexec scope? 238 - */ 239 - void (*machine_crash_shutdown)(struct pt_regs *regs); 238 + void (*kexec_cpu_down)(int crash_shutdown, int secondary); 240 239 241 240 /* Called to do what every setup is needed on image and the 242 241 * reboot code buffer. Returns 0 on success. ··· 240 247 * claims to support kexec. 241 248 */ 242 249 int (*machine_kexec_prepare)(struct kimage *image); 243 - 244 - /* Called to handle any machine specific cleanup on image */ 245 - void (*machine_kexec_cleanup)(struct kimage *image); 246 - 247 - /* Called to perform the _real_ kexec. 248 - * Do NOT allocate memory or fail here. We are past the point of 249 - * no return. 250 - */ 251 - void (*machine_kexec)(struct kimage *image); 252 250 #endif /* CONFIG_KEXEC */ 253 251 254 252 #ifdef CONFIG_SUSPEND
+2
arch/powerpc/include/asm/reg.h
··· 283 283 #define HID0_NOPTI (1<<0) /* No-op dcbt and dcbst instr. */ 284 284 285 285 #define SPRN_HID1 0x3F1 /* Hardware Implementation Register 1 */ 286 + #ifdef CONFIG_6xx 286 287 #define HID1_EMCP (1<<31) /* 7450 Machine Check Pin Enable */ 287 288 #define HID1_DFS (1<<22) /* 7447A Dynamic Frequency Scaling */ 288 289 #define HID1_PC0 (1<<16) /* 7450 PLL_CFG[0] */ ··· 293 292 #define HID1_SYNCBE (1<<11) /* 7450 ABE for sync, eieio */ 294 293 #define HID1_ABE (1<<10) /* 7450 Address Broadcast Enable */ 295 294 #define HID1_PS (1<<16) /* 750FX PLL selection */ 295 + #endif 296 296 #define SPRN_HID2 0x3F8 /* Hardware Implementation Register 2 */ 297 297 #define SPRN_HID2_GEKKO 0x398 /* Gekko HID2 Register */ 298 298 #define SPRN_IABR 0x3F2 /* Instruction Address Breakpoint Register */
+14
arch/powerpc/include/asm/reg_booke.h
··· 246 246 store or cache line push */ 247 247 #endif 248 248 249 + /* Bit definitions for the HID1 */ 250 + #ifdef CONFIG_E500 251 + /* e500v1/v2 */ 252 + #define HID1_PLL_CFG_MASK 0xfc000000 /* PLL_CFG input pins */ 253 + #define HID1_RFXE 0x00020000 /* Read fault exception enable */ 254 + #define HID1_R1DPE 0x00008000 /* R1 data bus parity enable */ 255 + #define HID1_R2DPE 0x00004000 /* R2 data bus parity enable */ 256 + #define HID1_ASTME 0x00002000 /* Address bus streaming mode enable */ 257 + #define HID1_ABE 0x00001000 /* Address broadcast enable */ 258 + #define HID1_MPXTT 0x00000400 /* MPX re-map transfer type */ 259 + #define HID1_ATS 0x00000080 /* Atomic status */ 260 + #define HID1_MID_MASK 0x0000000f /* MID input pins */ 261 + #endif 262 + 249 263 /* Bit definitions for the DBSR. */ 250 264 /* 251 265 * DBSR bits which have conflicting definitions on true Book E versus IBM 40x.
-8
arch/powerpc/include/asm/spu.h
··· 203 203 void spu_setup_kernel_slbs(struct spu *spu, struct spu_lscsa *lscsa, 204 204 void *code, int code_size); 205 205 206 - #ifdef CONFIG_KEXEC 207 - void crash_register_spus(struct list_head *list); 208 - #else 209 - static inline void crash_register_spus(struct list_head *list) 210 - { 211 - } 212 - #endif 213 - 214 206 extern void spu_invalidate_slbs(struct spu *spu); 215 207 extern void spu_associate_mm(struct spu *spu, struct mm_struct *mm); 216 208 int spu_64k_pages_available(void);
+6
arch/powerpc/kernel/cpu_setup_fsl_booke.S
··· 64 64 bl __e500_icache_setup 65 65 bl __e500_dcache_setup 66 66 bl __setup_e500_ivors 67 + #ifdef CONFIG_RAPIDIO 68 + /* Ensure that RFXE is set */ 69 + mfspr r3,SPRN_HID1 70 + oris r3,r3,HID1_RFXE@h 71 + mtspr SPRN_HID1,r3 72 + #endif 67 73 mtlr r4 68 74 blr 69 75 _GLOBAL(__setup_cpu_e500mc)
-23
arch/powerpc/kernel/cputable.c
··· 116 116 .pmc_type = PPC_PMC_IBM, 117 117 .oprofile_cpu_type = "ppc64/power3", 118 118 .oprofile_type = PPC_OPROFILE_RS64, 119 - .machine_check = machine_check_generic, 120 119 .platform = "power3", 121 120 }, 122 121 { /* Power3+ */ ··· 131 132 .pmc_type = PPC_PMC_IBM, 132 133 .oprofile_cpu_type = "ppc64/power3", 133 134 .oprofile_type = PPC_OPROFILE_RS64, 134 - .machine_check = machine_check_generic, 135 135 .platform = "power3", 136 136 }, 137 137 { /* Northstar */ ··· 146 148 .pmc_type = PPC_PMC_IBM, 147 149 .oprofile_cpu_type = "ppc64/rs64", 148 150 .oprofile_type = PPC_OPROFILE_RS64, 149 - .machine_check = machine_check_generic, 150 151 .platform = "rs64", 151 152 }, 152 153 { /* Pulsar */ ··· 161 164 .pmc_type = PPC_PMC_IBM, 162 165 .oprofile_cpu_type = "ppc64/rs64", 163 166 .oprofile_type = PPC_OPROFILE_RS64, 164 - .machine_check = machine_check_generic, 165 167 .platform = "rs64", 166 168 }, 167 169 { /* I-star */ ··· 176 180 .pmc_type = PPC_PMC_IBM, 177 181 .oprofile_cpu_type = "ppc64/rs64", 178 182 .oprofile_type = PPC_OPROFILE_RS64, 179 - .machine_check = machine_check_generic, 180 183 .platform = "rs64", 181 184 }, 182 185 { /* S-star */ ··· 191 196 .pmc_type = PPC_PMC_IBM, 192 197 .oprofile_cpu_type = "ppc64/rs64", 193 198 .oprofile_type = PPC_OPROFILE_RS64, 194 - .machine_check = machine_check_generic, 195 199 .platform = "rs64", 196 200 }, 197 201 { /* Power4 */ ··· 206 212 .pmc_type = PPC_PMC_IBM, 207 213 .oprofile_cpu_type = "ppc64/power4", 208 214 .oprofile_type = PPC_OPROFILE_POWER4, 209 - .machine_check = machine_check_generic, 210 215 .platform = "power4", 211 216 }, 212 217 { /* Power4+ */ ··· 221 228 .pmc_type = PPC_PMC_IBM, 222 229 .oprofile_cpu_type = "ppc64/power4", 223 230 .oprofile_type = PPC_OPROFILE_POWER4, 224 - .machine_check = machine_check_generic, 225 231 .platform = "power4", 226 232 }, 227 233 { /* PPC970 */ ··· 239 247 .cpu_restore = __restore_cpu_ppc970, 240 248 .oprofile_cpu_type = "ppc64/970", 241 249 .oprofile_type = PPC_OPROFILE_POWER4, 242 - .machine_check = machine_check_generic, 243 250 .platform = "ppc970", 244 251 }, 245 252 { /* PPC970FX */ ··· 257 266 .cpu_restore = __restore_cpu_ppc970, 258 267 .oprofile_cpu_type = "ppc64/970", 259 268 .oprofile_type = PPC_OPROFILE_POWER4, 260 - .machine_check = machine_check_generic, 261 269 .platform = "ppc970", 262 270 }, 263 271 { /* PPC970MP DD1.0 - no DEEPNAP, use regular 970 init */ ··· 275 285 .cpu_restore = __restore_cpu_ppc970, 276 286 .oprofile_cpu_type = "ppc64/970MP", 277 287 .oprofile_type = PPC_OPROFILE_POWER4, 278 - .machine_check = machine_check_generic, 279 288 .platform = "ppc970", 280 289 }, 281 290 { /* PPC970MP */ ··· 293 304 .cpu_restore = __restore_cpu_ppc970, 294 305 .oprofile_cpu_type = "ppc64/970MP", 295 306 .oprofile_type = PPC_OPROFILE_POWER4, 296 - .machine_check = machine_check_generic, 297 307 .platform = "ppc970", 298 308 }, 299 309 { /* PPC970GX */ ··· 310 322 .cpu_setup = __setup_cpu_ppc970, 311 323 .oprofile_cpu_type = "ppc64/970", 312 324 .oprofile_type = PPC_OPROFILE_POWER4, 313 - .machine_check = machine_check_generic, 314 325 .platform = "ppc970", 315 326 }, 316 327 { /* Power5 GR */ ··· 330 343 */ 331 344 .oprofile_mmcra_sihv = MMCRA_SIHV, 332 345 .oprofile_mmcra_sipr = MMCRA_SIPR, 333 - .machine_check = machine_check_generic, 334 346 .platform = "power5", 335 347 }, 336 348 { /* Power5++ */ ··· 346 360 .oprofile_type = PPC_OPROFILE_POWER4, 347 361 .oprofile_mmcra_sihv = MMCRA_SIHV, 348 362 .oprofile_mmcra_sipr = MMCRA_SIPR, 349 - .machine_check = machine_check_generic, 350 363 .platform = "power5+", 351 364 }, 352 365 { /* Power5 GS */ ··· 363 378 .oprofile_type = PPC_OPROFILE_POWER4, 364 379 .oprofile_mmcra_sihv = MMCRA_SIHV, 365 380 .oprofile_mmcra_sipr = MMCRA_SIPR, 366 - .machine_check = machine_check_generic, 367 381 .platform = "power5+", 368 382 }, 369 383 { /* POWER6 in P5+ mode; 2.04-compliant processor */ ··· 374 390 .mmu_features = MMU_FTR_HPTE_TABLE, 375 391 .icache_bsize = 128, 376 392 .dcache_bsize = 128, 377 - .machine_check = machine_check_generic, 378 393 .oprofile_cpu_type = "ppc64/ibm-compat-v1", 379 394 .oprofile_type = PPC_OPROFILE_POWER4, 380 395 .platform = "power5+", ··· 396 413 .oprofile_mmcra_sipr = POWER6_MMCRA_SIPR, 397 414 .oprofile_mmcra_clear = POWER6_MMCRA_THRM | 398 415 POWER6_MMCRA_OTHER, 399 - .machine_check = machine_check_generic, 400 416 .platform = "power6x", 401 417 }, 402 418 { /* 2.05-compliant processor, i.e. Power6 "architected" mode */ ··· 407 425 .mmu_features = MMU_FTR_HPTE_TABLE, 408 426 .icache_bsize = 128, 409 427 .dcache_bsize = 128, 410 - .machine_check = machine_check_generic, 411 428 .oprofile_cpu_type = "ppc64/ibm-compat-v1", 412 429 .oprofile_type = PPC_OPROFILE_POWER4, 413 430 .platform = "power6", ··· 421 440 MMU_FTR_TLBIE_206, 422 441 .icache_bsize = 128, 423 442 .dcache_bsize = 128, 424 - .machine_check = machine_check_generic, 425 443 .oprofile_type = PPC_OPROFILE_POWER4, 426 444 .oprofile_cpu_type = "ppc64/ibm-compat-v1", 427 445 .platform = "power7", ··· 472 492 .pmc_type = PPC_PMC_IBM, 473 493 .oprofile_cpu_type = "ppc64/cell-be", 474 494 .oprofile_type = PPC_OPROFILE_CELL, 475 - .machine_check = machine_check_generic, 476 495 .platform = "ppc-cell-be", 477 496 }, 478 497 { /* PA Semi PA6T */ ··· 489 510 .cpu_restore = __restore_cpu_pa6t, 490 511 .oprofile_cpu_type = "ppc64/pa6t", 491 512 .oprofile_type = PPC_OPROFILE_PA6T, 492 - .machine_check = machine_check_generic, 493 513 .platform = "pa6t", 494 514 }, 495 515 { /* default match */ ··· 502 524 .dcache_bsize = 128, 503 525 .num_pmcs = 6, 504 526 .pmc_type = PPC_PMC_IBM, 505 - .machine_check = machine_check_generic, 506 527 .platform = "power4", 507 528 } 508 529 #endif /* CONFIG_PPC_BOOK3S_64 */
+2 -70
arch/powerpc/kernel/crash.c
··· 48 48 static cpumask_t cpus_in_crash = CPU_MASK_NONE; 49 49 cpumask_t cpus_in_sr = CPU_MASK_NONE; 50 50 51 - #define CRASH_HANDLER_MAX 2 51 + #define CRASH_HANDLER_MAX 3 52 52 /* NULL terminated list of shutdown handles */ 53 53 static crash_shutdown_t crash_shutdown_handles[CRASH_HANDLER_MAX+1]; 54 54 static DEFINE_SPINLOCK(crash_handlers_lock); ··· 125 125 smp_wmb(); 126 126 127 127 /* 128 - * FIXME: Until we will have the way to stop other CPUSs reliabally, 128 + * FIXME: Until we will have the way to stop other CPUs reliably, 129 129 * the crash CPU will send an IPI and wait for other CPUs to 130 130 * respond. 131 131 * Delay of at least 10 seconds. ··· 254 254 cpus_in_sr = CPU_MASK_NONE; 255 255 } 256 256 #endif 257 - #ifdef CONFIG_SPU_BASE 258 - 259 - #include <asm/spu.h> 260 - #include <asm/spu_priv1.h> 261 - 262 - struct crash_spu_info { 263 - struct spu *spu; 264 - u32 saved_spu_runcntl_RW; 265 - u32 saved_spu_status_R; 266 - u32 saved_spu_npc_RW; 267 - u64 saved_mfc_sr1_RW; 268 - u64 saved_mfc_dar; 269 - u64 saved_mfc_dsisr; 270 - }; 271 - 272 - #define CRASH_NUM_SPUS 16 /* Enough for current hardware */ 273 - static struct crash_spu_info crash_spu_info[CRASH_NUM_SPUS]; 274 - 275 - static void crash_kexec_stop_spus(void) 276 - { 277 - struct spu *spu; 278 - int i; 279 - u64 tmp; 280 - 281 - for (i = 0; i < CRASH_NUM_SPUS; i++) { 282 - if (!crash_spu_info[i].spu) 283 - continue; 284 - 285 - spu = crash_spu_info[i].spu; 286 - 287 - crash_spu_info[i].saved_spu_runcntl_RW = 288 - in_be32(&spu->problem->spu_runcntl_RW); 289 - crash_spu_info[i].saved_spu_status_R = 290 - in_be32(&spu->problem->spu_status_R); 291 - crash_spu_info[i].saved_spu_npc_RW = 292 - in_be32(&spu->problem->spu_npc_RW); 293 - 294 - crash_spu_info[i].saved_mfc_dar = spu_mfc_dar_get(spu); 295 - crash_spu_info[i].saved_mfc_dsisr = spu_mfc_dsisr_get(spu); 296 - tmp = spu_mfc_sr1_get(spu); 297 - crash_spu_info[i].saved_mfc_sr1_RW = tmp; 298 - 299 - tmp &= ~MFC_STATE1_MASTER_RUN_CONTROL_MASK; 300 - spu_mfc_sr1_set(spu, tmp); 301 - 302 - __delay(200); 303 - } 304 - } 305 - 306 - void crash_register_spus(struct list_head *list) 307 - { 308 - struct spu *spu; 309 - 310 - list_for_each_entry(spu, list, full_list) { 311 - if (WARN_ON(spu->number >= CRASH_NUM_SPUS)) 312 - continue; 313 - 314 - crash_spu_info[spu->number].spu = spu; 315 - } 316 - } 317 - 318 - #else 319 - static inline void crash_kexec_stop_spus(void) 320 - { 321 - } 322 - #endif /* CONFIG_SPU_BASE */ 323 257 324 258 /* 325 259 * Register a function to be called on shutdown. Only use this if you ··· 372 438 } 373 439 crash_shutdown_cpu = -1; 374 440 __debugger_fault_handler = old_handler; 375 - 376 - crash_kexec_stop_spus(); 377 441 378 442 if (ppc_md.kexec_cpu_down) 379 443 ppc_md.kexec_cpu_down(1, 0);
+11
arch/powerpc/kernel/entry_32.S
··· 880 880 */ 881 881 andi. r10,r9,MSR_EE 882 882 beq 1f 883 + /* 884 + * Since the ftrace irqsoff latency trace checks CALLER_ADDR1, 885 + * which is the stack frame here, we need to force a stack frame 886 + * in case we came from user space. 887 + */ 888 + stwu r1,-32(r1) 889 + mflr r0 890 + stw r0,4(r1) 891 + stwu r1,-32(r1) 883 892 bl trace_hardirqs_on 893 + lwz r1,0(r1) 894 + lwz r1,0(r1) 884 895 lwz r9,_MSR(r1) 885 896 1: 886 897 #endif /* CONFIG_TRACE_IRQFLAGS */
+9 -10
arch/powerpc/kernel/machine_kexec.c
··· 15 15 #include <linux/memblock.h> 16 16 #include <linux/of.h> 17 17 #include <linux/irq.h> 18 + #include <linux/ftrace.h> 18 19 19 20 #include <asm/machdep.h> 20 21 #include <asm/prom.h> ··· 45 44 46 45 void machine_crash_shutdown(struct pt_regs *regs) 47 46 { 48 - if (ppc_md.machine_crash_shutdown) 49 - ppc_md.machine_crash_shutdown(regs); 50 - else 51 - default_machine_crash_shutdown(regs); 47 + default_machine_crash_shutdown(regs); 52 48 } 53 49 54 50 /* ··· 63 65 64 66 void machine_kexec_cleanup(struct kimage *image) 65 67 { 66 - if (ppc_md.machine_kexec_cleanup) 67 - ppc_md.machine_kexec_cleanup(image); 68 68 } 69 69 70 70 void arch_crash_save_vmcoreinfo(void) ··· 83 87 */ 84 88 void machine_kexec(struct kimage *image) 85 89 { 86 - if (ppc_md.machine_kexec) 87 - ppc_md.machine_kexec(image); 88 - else 89 - default_machine_kexec(image); 90 + int save_ftrace_enabled; 91 + 92 + save_ftrace_enabled = __ftrace_enabled_save(); 93 + 94 + default_machine_kexec(image); 95 + 96 + __ftrace_enabled_restore(save_ftrace_enabled); 90 97 91 98 /* Fall back to normal restart if we're still alive. */ 92 99 machine_restart(NULL);
+1 -1
arch/powerpc/kernel/process.c
··· 631 631 #ifdef CONFIG_PPC_ADV_DEBUG_REGS 632 632 printk("DEAR: "REG", ESR: "REG"\n", regs->dar, regs->dsisr); 633 633 #else 634 - printk("DAR: "REG", DSISR: "REG"\n", regs->dar, regs->dsisr); 634 + printk("DAR: "REG", DSISR: %08lx\n", regs->dar, regs->dsisr); 635 635 #endif 636 636 printk("TASK = %p[%d] '%s' THREAD: %p", 637 637 current, task_pid_nr(current), current->comm, task_thread_info(current));
+6 -47
arch/powerpc/kernel/rtas_flash.c
··· 256 256 struct proc_dir_entry *dp = PDE(file->f_path.dentry->d_inode); 257 257 struct rtas_update_flash_t *uf; 258 258 char msg[RTAS_MSG_MAXLEN]; 259 - int msglen; 260 259 261 - uf = (struct rtas_update_flash_t *) dp->data; 260 + uf = dp->data; 262 261 263 262 if (!strcmp(dp->name, FIRMWARE_FLASH_NAME)) { 264 263 get_flash_status_msg(uf->status, msg); 265 264 } else { /* FIRMWARE_UPDATE_NAME */ 266 265 sprintf(msg, "%d\n", uf->status); 267 266 } 268 - msglen = strlen(msg); 269 - if (msglen > count) 270 - msglen = count; 271 267 272 - if (ppos && *ppos != 0) 273 - return 0; /* be cheap */ 274 - 275 - if (!access_ok(VERIFY_WRITE, buf, msglen)) 276 - return -EINVAL; 277 - 278 - if (copy_to_user(buf, msg, msglen)) 279 - return -EFAULT; 280 - 281 - if (ppos) 282 - *ppos = msglen; 283 - return msglen; 268 + return simple_read_from_buffer(buf, count, ppos, msg, strlen(msg)); 284 269 } 285 270 286 271 /* constructor for flash_block_cache */ ··· 379 394 char msg[RTAS_MSG_MAXLEN]; 380 395 int msglen; 381 396 382 - args_buf = (struct rtas_manage_flash_t *) dp->data; 397 + args_buf = dp->data; 383 398 if (args_buf == NULL) 384 399 return 0; 385 400 386 401 msglen = sprintf(msg, "%d\n", args_buf->status); 387 - if (msglen > count) 388 - msglen = count; 389 402 390 - if (ppos && *ppos != 0) 391 - return 0; /* be cheap */ 392 - 393 - if (!access_ok(VERIFY_WRITE, buf, msglen)) 394 - return -EINVAL; 395 - 396 - if (copy_to_user(buf, msg, msglen)) 397 - return -EFAULT; 398 - 399 - if (ppos) 400 - *ppos = msglen; 401 - return msglen; 403 + return simple_read_from_buffer(buf, count, ppos, msg, msglen); 402 404 } 403 405 404 406 static ssize_t manage_flash_write(struct file *file, const char __user *buf, ··· 467 495 char msg[RTAS_MSG_MAXLEN]; 468 496 int msglen; 469 497 470 - args_buf = (struct rtas_validate_flash_t *) dp->data; 498 + args_buf = dp->data; 471 499 472 - if (ppos && *ppos != 0) 473 - return 0; /* be cheap */ 474 - 475 500 msglen = get_validate_flash_msg(args_buf, msg); 476 - if (msglen > count) 477 - msglen = count; 478 501 479 - if (!access_ok(VERIFY_WRITE, buf, msglen)) 480 - return -EINVAL; 481 - 482 - if (copy_to_user(buf, msg, msglen)) 483 - return -EFAULT; 484 - 485 - if (ppos) 486 - *ppos = msglen; 487 - return msglen; 502 + return simple_read_from_buffer(buf, count, ppos, msg, msglen); 488 503 } 489 504 490 505 static ssize_t validate_flash_write(struct file *file, const char __user *buf,
+1 -1
arch/powerpc/kernel/rtasd.c
··· 160 160 /* rtas fixed header */ 161 161 len = 8; 162 162 err = (struct rtas_error_log *)buf; 163 - if (err->extended_log_length) { 163 + if (err->extended && err->extended_log_length) { 164 164 165 165 /* extended header */ 166 166 len += err->extended_log_length;
+20 -5
arch/powerpc/kernel/time.c
··· 265 265 { 266 266 u64 sst, ust; 267 267 268 - sst = scan_dispatch_log(get_paca()->starttime_user); 269 - ust = scan_dispatch_log(get_paca()->starttime); 270 - get_paca()->system_time -= sst; 271 - get_paca()->user_time -= ust; 272 - get_paca()->stolen_time += ust + sst; 268 + u8 save_soft_enabled = local_paca->soft_enabled; 269 + u8 save_hard_enabled = local_paca->hard_enabled; 270 + 271 + /* We are called early in the exception entry, before 272 + * soft/hard_enabled are sync'ed to the expected state 273 + * for the exception. We are hard disabled but the PACA 274 + * needs to reflect that so various debug stuff doesn't 275 + * complain 276 + */ 277 + local_paca->soft_enabled = 0; 278 + local_paca->hard_enabled = 0; 279 + 280 + sst = scan_dispatch_log(local_paca->starttime_user); 281 + ust = scan_dispatch_log(local_paca->starttime); 282 + local_paca->system_time -= sst; 283 + local_paca->user_time -= ust; 284 + local_paca->stolen_time += ust + sst; 285 + 286 + local_paca->soft_enabled = save_soft_enabled; 287 + local_paca->hard_enabled = save_hard_enabled; 273 288 } 274 289 275 290 static inline u64 calculate_stolen_time(u64 stop_tb)
+1 -11
arch/powerpc/kernel/traps.c
··· 626 626 if (recover > 0) 627 627 return; 628 628 629 - if (user_mode(regs)) { 630 - regs->msr |= MSR_RI; 631 - _exception(SIGBUS, regs, BUS_ADRERR, regs->nip); 632 - return; 633 - } 634 - 635 629 #if defined(CONFIG_8xx) && defined(CONFIG_PCI) 636 630 /* the qspan pci read routines can cause machine checks -- Cort 637 631 * ··· 637 643 return; 638 644 #endif 639 645 640 - if (debugger_fault_handler(regs)) { 641 - regs->msr |= MSR_RI; 646 + if (debugger_fault_handler(regs)) 642 647 return; 643 - } 644 648 645 649 if (check_io_access(regs)) 646 650 return; 647 651 648 - if (debugger_fault_handler(regs)) 649 - return; 650 652 die("Machine check", regs, SIGBUS); 651 653 652 654 /* Must die if the interrupt is not recoverable */
+19
arch/powerpc/lib/feature-fixups-test.S
··· 172 172 3: or 3,3,3 173 173 174 174 175 + #if 0 176 + /* Test that if we have a larger else case the assembler spots it and 177 + * reports an error. #if 0'ed so as not to break the build normally. 178 + */ 179 + ftr_fixup_test7: 180 + or 1,1,1 181 + BEGIN_FTR_SECTION 182 + or 2,2,2 183 + or 2,2,2 184 + or 2,2,2 185 + FTR_SECTION_ELSE 186 + or 3,3,3 187 + or 3,3,3 188 + or 3,3,3 189 + or 3,3,3 190 + ALT_FTR_SECTION_END(0, 1) 191 + or 1,1,1 192 + #endif 193 + 175 194 #define MAKE_MACRO_TEST(TYPE) \ 176 195 globl(ftr_fixup_test_ ##TYPE##_macros) \ 177 196 or 1,1,1; \
+2 -2
arch/powerpc/platforms/83xx/mpc830x_rdb.c
··· 57 57 ipic_set_default_priority(); 58 58 } 59 59 60 - struct const char *board[] __initdata = { 60 + static const char *board[] __initdata = { 61 61 "MPC8308RDB", 62 62 "fsl,mpc8308rdb", 63 63 "denx,mpc8308_p1m", 64 64 NULL 65 - } 65 + }; 66 66 67 67 /* 68 68 * Called very early, MMU is off, device-tree isn't unflattened
+2 -2
arch/powerpc/platforms/83xx/mpc831x_rdb.c
··· 60 60 ipic_set_default_priority(); 61 61 } 62 62 63 - struct const char *board[] __initdata = { 63 + static const char *board[] __initdata = { 64 64 "MPC8313ERDB", 65 65 "fsl,mpc8315erdb", 66 66 NULL 67 - } 67 + }; 68 68 69 69 /* 70 70 * Called very early, MMU is off, device-tree isn't unflattened
+2
arch/powerpc/platforms/83xx/mpc83xx.h
··· 35 35 36 36 /* system i/o configuration register high */ 37 37 #define MPC83XX_SICRH_OFFS 0x118 38 + #define MPC8308_SICRH_USB_MASK 0x000c0000 39 + #define MPC8308_SICRH_USB_ULPI 0x00040000 38 40 #define MPC834X_SICRH_USB_UTMI 0x00020000 39 41 #define MPC831X_SICRH_USB_MASK 0x000000e0 40 42 #define MPC831X_SICRH_USB_ULPI 0x000000a0
+16 -5
arch/powerpc/platforms/83xx/usb.c
··· 127 127 128 128 /* Configure clock */ 129 129 immr_node = of_get_parent(np); 130 - if (immr_node && of_device_is_compatible(immr_node, "fsl,mpc8315-immr")) 130 + if (immr_node && (of_device_is_compatible(immr_node, "fsl,mpc8315-immr") || 131 + of_device_is_compatible(immr_node, "fsl,mpc8308-immr"))) 131 132 clrsetbits_be32(immap + MPC83XX_SCCR_OFFS, 132 133 MPC8315_SCCR_USB_MASK, 133 134 MPC8315_SCCR_USB_DRCM_01); ··· 139 138 140 139 /* Configure pin mux for ULPI. There is no pin mux for UTMI */ 141 140 if (prop && !strcmp(prop, "ulpi")) { 142 - if (of_device_is_compatible(immr_node, "fsl,mpc8315-immr")) { 141 + if (of_device_is_compatible(immr_node, "fsl,mpc8308-immr")) { 142 + clrsetbits_be32(immap + MPC83XX_SICRH_OFFS, 143 + MPC8308_SICRH_USB_MASK, 144 + MPC8308_SICRH_USB_ULPI); 145 + } else if (of_device_is_compatible(immr_node, "fsl,mpc8315-immr")) { 143 146 clrsetbits_be32(immap + MPC83XX_SICRL_OFFS, 144 147 MPC8315_SICRL_USB_MASK, 145 148 MPC8315_SICRL_USB_ULPI); ··· 178 173 !strcmp(prop, "utmi"))) { 179 174 u32 refsel; 180 175 176 + if (of_device_is_compatible(immr_node, "fsl,mpc8308-immr")) 177 + goto out; 178 + 181 179 if (of_device_is_compatible(immr_node, "fsl,mpc8315-immr")) 182 180 refsel = CONTROL_REFSEL_24MHZ; 183 181 else ··· 194 186 temp = CONTROL_PHY_CLK_SEL_ULPI; 195 187 #ifdef CONFIG_USB_OTG 196 188 /* Set OTG_PORT */ 197 - dr_mode = of_get_property(np, "dr_mode", NULL); 198 - if (dr_mode && !strcmp(dr_mode, "otg")) 199 - temp |= CONTROL_OTG_PORT; 189 + if (!of_device_is_compatible(immr_node, "fsl,mpc8308-immr")) { 190 + dr_mode = of_get_property(np, "dr_mode", NULL); 191 + if (dr_mode && !strcmp(dr_mode, "otg")) 192 + temp |= CONTROL_OTG_PORT; 193 + } 200 194 #endif /* CONFIG_USB_OTG */ 201 195 out_be32(usb_regs + FSL_USB2_CONTROL_OFFS, temp); 202 196 } else { ··· 206 196 ret = -EINVAL; 207 197 } 208 198 199 + out: 209 200 iounmap(usb_regs); 210 201 of_node_put(np); 211 202 return ret;
+3 -17
arch/powerpc/platforms/cell/cpufreq_spudemand.c
··· 39 39 }; 40 40 static DEFINE_PER_CPU(struct spu_gov_info_struct, spu_gov_info); 41 41 42 - static struct workqueue_struct *kspugov_wq; 43 - 44 42 static int calc_freq(struct spu_gov_info_struct *info) 45 43 { 46 44 int cpu; ··· 69 71 __cpufreq_driver_target(info->policy, target_freq, CPUFREQ_RELATION_H); 70 72 71 73 delay = usecs_to_jiffies(info->poll_int); 72 - queue_delayed_work_on(info->policy->cpu, kspugov_wq, &info->work, delay); 74 + schedule_delayed_work_on(info->policy->cpu, &info->work, delay); 73 75 } 74 76 75 77 static void spu_gov_init_work(struct spu_gov_info_struct *info) 76 78 { 77 79 int delay = usecs_to_jiffies(info->poll_int); 78 80 INIT_DELAYED_WORK_DEFERRABLE(&info->work, spu_gov_work); 79 - queue_delayed_work_on(info->policy->cpu, kspugov_wq, &info->work, delay); 81 + schedule_delayed_work_on(info->policy->cpu, &info->work, delay); 80 82 } 81 83 82 84 static void spu_gov_cancel_work(struct spu_gov_info_struct *info) ··· 150 152 { 151 153 int ret; 152 154 153 - kspugov_wq = create_workqueue("kspugov"); 154 - if (!kspugov_wq) { 155 - printk(KERN_ERR "creation of kspugov failed\n"); 156 - ret = -EFAULT; 157 - goto out; 158 - } 159 - 160 155 ret = cpufreq_register_governor(&spu_governor); 161 - if (ret) { 156 + if (ret) 162 157 printk(KERN_ERR "registration of governor failed\n"); 163 - destroy_workqueue(kspugov_wq); 164 - goto out; 165 - } 166 - out: 167 158 return ret; 168 159 } 169 160 170 161 static void __exit spu_gov_exit(void) 171 162 { 172 163 cpufreq_unregister_governor(&spu_governor); 173 - destroy_workqueue(kspugov_wq); 174 164 } 175 165 176 166
-5
arch/powerpc/platforms/cell/qpace_setup.c
··· 145 145 .calibrate_decr = generic_calibrate_decr, 146 146 .progress = qpace_progress, 147 147 .init_IRQ = iic_init_IRQ, 148 - #ifdef CONFIG_KEXEC 149 - .machine_kexec = default_machine_kexec, 150 - .machine_kexec_prepare = default_machine_kexec_prepare, 151 - .machine_crash_shutdown = default_machine_crash_shutdown, 152 - #endif 153 148 };
+70
arch/powerpc/platforms/cell/spu_base.c
··· 37 37 #include <asm/spu_csa.h> 38 38 #include <asm/xmon.h> 39 39 #include <asm/prom.h> 40 + #include <asm/kexec.h> 40 41 41 42 const struct spu_management_ops *spu_management_ops; 42 43 EXPORT_SYMBOL_GPL(spu_management_ops); ··· 727 726 } 728 727 729 728 static SYSDEV_ATTR(stat, 0644, spu_stat_show, NULL); 729 + 730 + #ifdef CONFIG_KEXEC 731 + 732 + struct crash_spu_info { 733 + struct spu *spu; 734 + u32 saved_spu_runcntl_RW; 735 + u32 saved_spu_status_R; 736 + u32 saved_spu_npc_RW; 737 + u64 saved_mfc_sr1_RW; 738 + u64 saved_mfc_dar; 739 + u64 saved_mfc_dsisr; 740 + }; 741 + 742 + #define CRASH_NUM_SPUS 16 /* Enough for current hardware */ 743 + static struct crash_spu_info crash_spu_info[CRASH_NUM_SPUS]; 744 + 745 + static void crash_kexec_stop_spus(void) 746 + { 747 + struct spu *spu; 748 + int i; 749 + u64 tmp; 750 + 751 + for (i = 0; i < CRASH_NUM_SPUS; i++) { 752 + if (!crash_spu_info[i].spu) 753 + continue; 754 + 755 + spu = crash_spu_info[i].spu; 756 + 757 + crash_spu_info[i].saved_spu_runcntl_RW = 758 + in_be32(&spu->problem->spu_runcntl_RW); 759 + crash_spu_info[i].saved_spu_status_R = 760 + in_be32(&spu->problem->spu_status_R); 761 + crash_spu_info[i].saved_spu_npc_RW = 762 + in_be32(&spu->problem->spu_npc_RW); 763 + 764 + crash_spu_info[i].saved_mfc_dar = spu_mfc_dar_get(spu); 765 + crash_spu_info[i].saved_mfc_dsisr = spu_mfc_dsisr_get(spu); 766 + tmp = spu_mfc_sr1_get(spu); 767 + crash_spu_info[i].saved_mfc_sr1_RW = tmp; 768 + 769 + tmp &= ~MFC_STATE1_MASTER_RUN_CONTROL_MASK; 770 + spu_mfc_sr1_set(spu, tmp); 771 + 772 + __delay(200); 773 + } 774 + } 775 + 776 + static void crash_register_spus(struct list_head *list) 777 + { 778 + struct spu *spu; 779 + int ret; 780 + 781 + list_for_each_entry(spu, list, full_list) { 782 + if (WARN_ON(spu->number >= CRASH_NUM_SPUS)) 783 + continue; 784 + 785 + crash_spu_info[spu->number].spu = spu; 786 + } 787 + 788 + ret = crash_shutdown_register(&crash_kexec_stop_spus); 789 + if (ret) 790 + printk(KERN_ERR "Could not register SPU crash handler"); 791 + } 792 + 793 + #else 794 + static inline void crash_register_spus(struct list_head *list) 795 + { 796 + } 797 + #endif 730 798 731 799 static int __init init_spu_base(void) 732 800 {
+7 -20
arch/powerpc/platforms/cell/spufs/file.c
··· 219 219 loff_t pos = *ppos; 220 220 int ret; 221 221 222 - if (pos < 0) 223 - return -EINVAL; 224 222 if (pos > LS_SIZE) 225 223 return -EFBIG; 226 - if (size > LS_SIZE - pos) 227 - size = LS_SIZE - pos; 228 224 229 225 ret = spu_acquire(ctx); 230 226 if (ret) 231 227 return ret; 232 228 233 229 local_store = ctx->ops->get_ls(ctx); 234 - ret = copy_from_user(local_store + pos, buffer, size); 230 + size = simple_write_to_buffer(local_store, LS_SIZE, ppos, buffer, size); 235 231 spu_release(ctx); 236 232 237 - if (ret) 238 - return -EFAULT; 239 - *ppos = pos + size; 240 233 return size; 241 234 } 242 235 ··· 567 574 if (*pos >= sizeof(lscsa->gprs)) 568 575 return -EFBIG; 569 576 570 - size = min_t(ssize_t, sizeof(lscsa->gprs) - *pos, size); 571 - *pos += size; 572 - 573 577 ret = spu_acquire_saved(ctx); 574 578 if (ret) 575 579 return ret; 576 580 577 - ret = copy_from_user((char *)lscsa->gprs + *pos - size, 578 - buffer, size) ? -EFAULT : size; 581 + size = simple_write_to_buffer(lscsa->gprs, sizeof(lscsa->gprs), pos, 582 + buffer, size); 579 583 580 584 spu_release_saved(ctx); 581 - return ret; 585 + return size; 582 586 } 583 587 584 588 static const struct file_operations spufs_regs_fops = { ··· 620 630 if (*pos >= sizeof(lscsa->fpcr)) 621 631 return -EFBIG; 622 632 623 - size = min_t(ssize_t, sizeof(lscsa->fpcr) - *pos, size); 624 - 625 633 ret = spu_acquire_saved(ctx); 626 634 if (ret) 627 635 return ret; 628 636 629 - *pos += size; 630 - ret = copy_from_user((char *)&lscsa->fpcr + *pos - size, 631 - buffer, size) ? -EFAULT : size; 637 + size = simple_write_to_buffer(&lscsa->fpcr, sizeof(lscsa->fpcr), pos, 638 + buffer, size); 632 639 633 640 spu_release_saved(ctx); 634 - return ret; 641 + return size; 635 642 } 636 643 637 644 static const struct file_operations spufs_fpcr_fops = {
-11
arch/powerpc/platforms/embedded6xx/gamecube.c
··· 75 75 flipper_quiesce(); 76 76 } 77 77 78 - #ifdef CONFIG_KEXEC 79 - static int gamecube_kexec_prepare(struct kimage *image) 80 - { 81 - return 0; 82 - } 83 - #endif /* CONFIG_KEXEC */ 84 - 85 - 86 78 define_machine(gamecube) { 87 79 .name = "gamecube", 88 80 .probe = gamecube_probe, ··· 87 95 .calibrate_decr = generic_calibrate_decr, 88 96 .progress = udbg_progress, 89 97 .machine_shutdown = gamecube_shutdown, 90 - #ifdef CONFIG_KEXEC 91 - .machine_kexec_prepare = gamecube_kexec_prepare, 92 - #endif 93 98 }; 94 99 95 100
-11
arch/powerpc/platforms/embedded6xx/wii.c
··· 18 18 #include <linux/init.h> 19 19 #include <linux/irq.h> 20 20 #include <linux/seq_file.h> 21 - #include <linux/kexec.h> 22 21 #include <linux/of_platform.h> 23 22 #include <linux/memblock.h> 24 23 #include <mm/mmu_decl.h> ··· 225 226 flipper_quiesce(); 226 227 } 227 228 228 - #ifdef CONFIG_KEXEC 229 - static int wii_machine_kexec_prepare(struct kimage *image) 230 - { 231 - return 0; 232 - } 233 - #endif /* CONFIG_KEXEC */ 234 - 235 229 define_machine(wii) { 236 230 .name = "wii", 237 231 .probe = wii_probe, ··· 238 246 .calibrate_decr = generic_calibrate_decr, 239 247 .progress = udbg_progress, 240 248 .machine_shutdown = wii_shutdown, 241 - #ifdef CONFIG_KEXEC 242 - .machine_kexec_prepare = wii_machine_kexec_prepare, 243 - #endif 244 249 }; 245 250 246 251 static struct of_device_id wii_of_bus[] = {
+1 -1
arch/powerpc/platforms/iseries/Kconfig
··· 2 2 bool "IBM Legacy iSeries" 3 3 depends on PPC64 && PPC_BOOK3S 4 4 select PPC_INDIRECT_IO 5 - select PPC_PCI_CHOICE if EMBEDDED 5 + select PPC_PCI_CHOICE if EXPERT 6 6 7 7 menu "iSeries device drivers" 8 8 depends on PPC_ISERIES
+3 -3
arch/powerpc/platforms/pseries/Kconfig
··· 10 10 select RTAS_ERROR_LOGGING 11 11 select PPC_UDBG_16550 12 12 select PPC_NATIVE 13 - select PPC_PCI_CHOICE if EMBEDDED 13 + select PPC_PCI_CHOICE if EXPERT 14 14 default y 15 15 16 16 config PPC_SPLPAR ··· 24 24 two or more partitions. 25 25 26 26 config EEH 27 - bool "PCI Extended Error Handling (EEH)" if EMBEDDED 27 + bool "PCI Extended Error Handling (EEH)" if EXPERT 28 28 depends on PPC_PSERIES && PCI 29 - default y if !EMBEDDED 29 + default y if !EXPERT 30 30 31 31 config PSERIES_MSI 32 32 bool
-10
arch/powerpc/platforms/pseries/kexec.c
··· 61 61 { 62 62 ppc_md.kexec_cpu_down = pseries_kexec_cpu_down_xics; 63 63 } 64 - 65 - static int __init pseries_kexec_setup(void) 66 - { 67 - ppc_md.machine_kexec = default_machine_kexec; 68 - ppc_md.machine_kexec_prepare = default_machine_kexec_prepare; 69 - ppc_md.machine_crash_shutdown = default_machine_crash_shutdown; 70 - 71 - return 0; 72 - } 73 - machine_device_initcall(pseries, pseries_kexec_setup);
+70 -34
arch/powerpc/platforms/pseries/ras.c
··· 54 54 static unsigned char ras_log_buf[RTAS_ERROR_LOG_MAX]; 55 55 static DEFINE_SPINLOCK(ras_log_buf_lock); 56 56 57 - static char mce_data_buf[RTAS_ERROR_LOG_MAX]; 57 + static char global_mce_data_buf[RTAS_ERROR_LOG_MAX]; 58 + static DEFINE_PER_CPU(__u64, mce_data_buf); 58 59 59 60 static int ras_get_sensor_state_token; 60 61 static int ras_check_exception_token; ··· 197 196 return IRQ_HANDLED; 198 197 } 199 198 200 - /* Get the error information for errors coming through the 199 + /* 200 + * Some versions of FWNMI place the buffer inside the 4kB page starting at 201 + * 0x7000. Other versions place it inside the rtas buffer. We check both. 202 + */ 203 + #define VALID_FWNMI_BUFFER(A) \ 204 + ((((A) >= 0x7000) && ((A) < 0x7ff0)) || \ 205 + (((A) >= rtas.base) && ((A) < (rtas.base + rtas.size - 16)))) 206 + 207 + /* 208 + * Get the error information for errors coming through the 201 209 * FWNMI vectors. The pt_regs' r3 will be updated to reflect 202 210 * the actual r3 if possible, and a ptr to the error log entry 203 211 * will be returned if found. 204 212 * 205 - * The mce_data_buf does not have any locks or protection around it, 213 + * If the RTAS error is not of the extended type, then we put it in a per 214 + * cpu 64bit buffer. If it is the extended type we use global_mce_data_buf. 215 + * 216 + * The global_mce_data_buf does not have any locks or protection around it, 206 217 * if a second machine check comes in, or a system reset is done 207 218 * before we have logged the error, then we will get corruption in the 208 219 * error log. This is preferable over holding off on calling ··· 223 210 */ 224 211 static struct rtas_error_log *fwnmi_get_errinfo(struct pt_regs *regs) 225 212 { 226 - unsigned long errdata = regs->gpr[3]; 227 - struct rtas_error_log *errhdr = NULL; 228 213 unsigned long *savep; 214 + struct rtas_error_log *h, *errhdr = NULL; 229 215 230 - if ((errdata >= 0x7000 && errdata < 0x7fff0) || 231 - (errdata >= rtas.base && errdata < rtas.base + rtas.size - 16)) { 232 - savep = __va(errdata); 233 - regs->gpr[3] = savep[0]; /* restore original r3 */ 234 - memset(mce_data_buf, 0, RTAS_ERROR_LOG_MAX); 235 - memcpy(mce_data_buf, (char *)(savep + 1), RTAS_ERROR_LOG_MAX); 236 - errhdr = (struct rtas_error_log *)mce_data_buf; 237 - } else { 238 - printk("FWNMI: corrupt r3\n"); 216 + if (!VALID_FWNMI_BUFFER(regs->gpr[3])) { 217 + printk(KERN_ERR "FWNMI: corrupt r3\n"); 218 + return NULL; 239 219 } 220 + 221 + savep = __va(regs->gpr[3]); 222 + regs->gpr[3] = savep[0]; /* restore original r3 */ 223 + 224 + /* If it isn't an extended log we can use the per cpu 64bit buffer */ 225 + h = (struct rtas_error_log *)&savep[1]; 226 + if (!h->extended) { 227 + memcpy(&__get_cpu_var(mce_data_buf), h, sizeof(__u64)); 228 + errhdr = (struct rtas_error_log *)&__get_cpu_var(mce_data_buf); 229 + } else { 230 + int len; 231 + 232 + len = max_t(int, 8+h->extended_log_length, RTAS_ERROR_LOG_MAX); 233 + memset(global_mce_data_buf, 0, RTAS_ERROR_LOG_MAX); 234 + memcpy(global_mce_data_buf, h, len); 235 + errhdr = (struct rtas_error_log *)global_mce_data_buf; 236 + } 237 + 240 238 return errhdr; 241 239 } 242 240 ··· 259 235 { 260 236 int ret = rtas_call(rtas_token("ibm,nmi-interlock"), 0, 1, NULL); 261 237 if (ret != 0) 262 - printk("FWNMI: nmi-interlock failed: %d\n", ret); 238 + printk(KERN_ERR "FWNMI: nmi-interlock failed: %d\n", ret); 263 239 } 264 240 265 241 int pSeries_system_reset_exception(struct pt_regs *regs) ··· 283 259 * Return 1 if corrected (or delivered a signal). 284 260 * Return 0 if there is nothing we can do. 285 261 */ 286 - static int recover_mce(struct pt_regs *regs, struct rtas_error_log * err) 262 + static int recover_mce(struct pt_regs *regs, struct rtas_error_log *err) 287 263 { 288 - int nonfatal = 0; 264 + int recovered = 0; 289 265 290 - if (err->disposition == RTAS_DISP_FULLY_RECOVERED) { 266 + if (!(regs->msr & MSR_RI)) { 267 + /* If MSR_RI isn't set, we cannot recover */ 268 + recovered = 0; 269 + 270 + } else if (err->disposition == RTAS_DISP_FULLY_RECOVERED) { 291 271 /* Platform corrected itself */ 292 - nonfatal = 1; 293 - } else if ((regs->msr & MSR_RI) && 294 - user_mode(regs) && 295 - err->severity == RTAS_SEVERITY_ERROR_SYNC && 296 - err->disposition == RTAS_DISP_NOT_RECOVERED && 297 - err->target == RTAS_TARGET_MEMORY && 298 - err->type == RTAS_TYPE_ECC_UNCORR && 299 - !(current->pid == 0 || is_global_init(current))) { 300 - /* Kill off a user process with an ECC error */ 301 - printk(KERN_ERR "MCE: uncorrectable ecc error for pid %d\n", 302 - current->pid); 303 - /* XXX something better for ECC error? */ 304 - _exception(SIGBUS, regs, BUS_ADRERR, regs->nip); 305 - nonfatal = 1; 272 + recovered = 1; 273 + 274 + } else if (err->disposition == RTAS_DISP_LIMITED_RECOVERY) { 275 + /* Platform corrected itself but could be degraded */ 276 + printk(KERN_ERR "MCE: limited recovery, system may " 277 + "be degraded\n"); 278 + recovered = 1; 279 + 280 + } else if (user_mode(regs) && !is_global_init(current) && 281 + err->severity == RTAS_SEVERITY_ERROR_SYNC) { 282 + 283 + /* 284 + * If we received a synchronous error when in userspace 285 + * kill the task. Firmware may report details of the fail 286 + * asynchronously, so we can't rely on the target and type 287 + * fields being valid here. 288 + */ 289 + printk(KERN_ERR "MCE: uncorrectable error, killing task " 290 + "%s:%d\n", current->comm, current->pid); 291 + 292 + _exception(SIGBUS, regs, BUS_MCEERR_AR, regs->nip); 293 + recovered = 1; 306 294 } 307 295 308 - log_error((char *)err, ERR_TYPE_RTAS_LOG, !nonfatal); 296 + log_error((char *)err, ERR_TYPE_RTAS_LOG, 0); 309 297 310 - return nonfatal; 298 + return recovered; 311 299 } 312 300 313 301 /*
-2
arch/powerpc/sysdev/fsl_rio.c
··· 1555 1555 saved_mcheck_exception = ppc_md.machine_check_exception; 1556 1556 ppc_md.machine_check_exception = fsl_rio_mcheck_exception; 1557 1557 #endif 1558 - /* Ensure that RFXE is set */ 1559 - mtspr(SPRN_HID1, (mfspr(SPRN_HID1) | 0x20000)); 1560 1558 1561 1559 return 0; 1562 1560 err:
+4 -2
arch/powerpc/sysdev/mpic.c
··· 674 674 /* make sure mask gets to controller before we return to user */ 675 675 do { 676 676 if (!loops--) { 677 - printk(KERN_ERR "mpic_enable_irq timeout\n"); 677 + printk(KERN_ERR "%s: timeout on hwirq %u\n", 678 + __func__, src); 678 679 break; 679 680 } 680 681 } while(mpic_irq_read(src, MPIC_INFO(IRQ_VECTOR_PRI)) & MPIC_VECPRI_MASK); ··· 696 695 /* make sure mask gets to controller before we return to user */ 697 696 do { 698 697 if (!loops--) { 699 - printk(KERN_ERR "mpic_enable_irq timeout\n"); 698 + printk(KERN_ERR "%s: timeout on hwirq %u\n", 699 + __func__, src); 700 700 break; 701 701 } 702 702 } while(!(mpic_irq_read(src, MPIC_INFO(IRQ_VECTOR_PRI)) & MPIC_VECPRI_MASK));
+4 -6
arch/score/Kconfig
··· 1 1 menu "Machine selection" 2 2 3 + config SCORE 4 + def_bool y 5 + select HAVE_GENERIC_HARDIRQS 6 + 3 7 choice 4 8 prompt "System type" 5 9 default MACH_SPCT6600 ··· 57 53 config SCHED_NO_NO_OMIT_FRAME_POINTER 58 54 def_bool y 59 55 60 - config GENERIC_HARDIRQS_NO__DO_IRQ 61 - def_bool y 62 - 63 56 config GENERIC_SYSCALL_TABLE 64 57 def_bool y 65 58 ··· 67 66 menu "Kernel type" 68 67 69 68 config 32BIT 70 - def_bool y 71 - 72 - config GENERIC_HARDIRQS 73 69 def_bool y 74 70 75 71 config ARCH_FLATMEM_ENABLE
+1 -1
arch/score/configs/spct6600_defconfig
··· 9 9 CONFIG_SYSFS_DEPRECATED_V2=y 10 10 CONFIG_BLK_DEV_INITRD=y 11 11 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 12 - CONFIG_EMBEDDED=y 12 + CONFIG_EXPERT=y 13 13 # CONFIG_KALLSYMS is not set 14 14 # CONFIG_HOTPLUG is not set 15 15 CONFIG_SLAB=y
+1 -1
arch/sh/Kconfig
··· 1 1 config SUPERH 2 2 def_bool y 3 - select EMBEDDED 3 + select EXPERT 4 4 select CLKDEV_LOOKUP 5 5 select HAVE_IDE if HAS_IOPORT 6 6 select HAVE_MEMBLOCK
+1 -8
arch/sparc/Kconfig
··· 50 50 select RTC_DRV_STARFIRE 51 51 select HAVE_PERF_EVENTS 52 52 select PERF_USE_VMALLOC 53 + select HAVE_GENERIC_HARDIRQS 53 54 54 55 config ARCH_DEFCONFIG 55 56 string ··· 106 105 def_bool y if SPARC64 107 106 108 107 config NEED_PER_CPU_PAGE_FIRST_CHUNK 109 - def_bool y if SPARC64 110 - 111 - config GENERIC_HARDIRQS_NO__DO_IRQ 112 - bool 113 108 def_bool y if SPARC64 114 109 115 110 config MMU ··· 272 275 Say Y here to experiment with turning CPUs off and on. CPUs 273 276 can be controlled through /sys/devices/system/cpu/cpu#. 274 277 Say N if you want to disable CPU hotplug. 275 - 276 - config GENERIC_HARDIRQS 277 - bool 278 - default y if SPARC64 279 278 280 279 source "kernel/time/Kconfig" 281 280
+23 -34
arch/tile/Kconfig
··· 1 1 # For a description of the syntax of this configuration file, 2 2 # see Documentation/kbuild/config-language.txt. 3 3 4 + config TILE 5 + def_bool y 6 + select HAVE_KVM if !TILEGX 7 + select GENERIC_FIND_FIRST_BIT 8 + select GENERIC_FIND_NEXT_BIT 9 + select USE_GENERIC_SMP_HELPERS 10 + select CC_OPTIMIZE_FOR_SIZE 11 + select HAVE_GENERIC_HARDIRQS 12 + select GENERIC_IRQ_PROBE 13 + select GENERIC_PENDING_IRQ if SMP 14 + 15 + # FIXME: investigate whether we need/want these options. 16 + # select HAVE_IOREMAP_PROT 17 + # select HAVE_OPTPROBES 18 + # select HAVE_REGS_AND_STACK_ACCESS_API 19 + # select HAVE_HW_BREAKPOINT 20 + # select PERF_EVENTS 21 + # select HAVE_USER_RETURN_NOTIFIER 22 + # config NO_BOOTMEM 23 + # config ARCH_SUPPORTS_DEBUG_PAGEALLOC 24 + # config HUGETLB_PAGE_SIZE_VARIABLE 25 + 4 26 config MMU 5 27 def_bool y 6 28 7 29 config GENERIC_CSUM 8 30 def_bool y 9 - 10 - config GENERIC_HARDIRQS 11 - def_bool y 12 - 13 - config GENERIC_HARDIRQS_NO__DO_IRQ 14 - def_bool y 15 - 16 - config GENERIC_IRQ_PROBE 17 - def_bool y 18 - 19 - config GENERIC_PENDING_IRQ 20 - def_bool y 21 - depends on GENERIC_HARDIRQS && SMP 22 31 23 32 config SEMAPHORE_SLEEPERS 24 33 def_bool y ··· 105 96 config HVC_TILE 106 97 select HVC_DRIVER 107 98 def_bool y 108 - 109 - config TILE 110 - def_bool y 111 - select HAVE_KVM if !TILEGX 112 - select GENERIC_FIND_FIRST_BIT 113 - select GENERIC_FIND_NEXT_BIT 114 - select USE_GENERIC_SMP_HELPERS 115 - select CC_OPTIMIZE_FOR_SIZE 116 - 117 - # FIXME: investigate whether we need/want these options. 118 - # select HAVE_IOREMAP_PROT 119 - # select HAVE_OPTPROBES 120 - # select HAVE_REGS_AND_STACK_ACCESS_API 121 - # select HAVE_HW_BREAKPOINT 122 - # select PERF_EVENTS 123 - # select HAVE_USER_RETURN_NOTIFIER 124 - # config NO_BOOTMEM 125 - # config ARCH_SUPPORTS_DEBUG_PAGEALLOC 126 - # config HUGETLB_PAGE_SIZE_VARIABLE 127 - 128 99 129 100 # Please note: TILE-Gx support is not yet finalized; this is 130 101 # the preliminary support. TILE-Gx drivers are only provided ··· 209 220 210 221 choice 211 222 depends on !TILEGX 212 - prompt "Memory split" if EMBEDDED 223 + prompt "Memory split" if EXPERT 213 224 default VMSPLIT_3G 214 225 ---help--- 215 226 Select the desired split between kernel and user memory.
+1 -1
arch/tile/Kconfig.debug
··· 3 3 source "lib/Kconfig.debug" 4 4 5 5 config EARLY_PRINTK 6 - bool "Early printk" if EMBEDDED && DEBUG_KERNEL 6 + bool "Early printk" if EXPERT && DEBUG_KERNEL 7 7 default y 8 8 help 9 9 Write kernel log output directly via the hypervisor console.
+1 -1
arch/tile/configs/tile_defconfig
··· 3 3 CONFIG_SYSVIPC=y 4 4 CONFIG_BLK_DEV_INITRD=y 5 5 CONFIG_INITRAMFS_SOURCE="usr/contents.txt" 6 - CONFIG_EMBEDDED=y 6 + CONFIG_EXPERT=y 7 7 # CONFIG_COMPAT_BRK is not set 8 8 CONFIG_PROFILING=y 9 9 CONFIG_MODULES=y
+1 -5
arch/um/Kconfig.common
··· 3 3 option defconfig_list 4 4 default "arch/$ARCH/defconfig" 5 5 6 - # UML uses the generic IRQ subsystem 7 - config GENERIC_HARDIRQS 8 - bool 9 - default y 10 - 11 6 config UML 12 7 bool 13 8 default y 9 + select HAVE_GENERIC_HARDIRQS 14 10 15 11 config MMU 16 12 bool
-3
arch/um/Kconfig.um
··· 120 120 121 121 If you don't know what to do, say N. 122 122 123 - config GENERIC_HARDIRQS_NO__DO_IRQ 124 - def_bool y 125 - 126 123 config NR_CPUS 127 124 int "Maximum number of CPUs (2-32)" 128 125 range 2 32
+1 -1
arch/um/defconfig
··· 133 133 # CONFIG_BLK_DEV_INITRD is not set 134 134 CONFIG_CC_OPTIMIZE_FOR_SIZE=y 135 135 CONFIG_SYSCTL=y 136 - # CONFIG_EMBEDDED is not set 136 + # CONFIG_EXPERT is not set 137 137 CONFIG_UID16=y 138 138 CONFIG_SYSCTL_SYSCALL=y 139 139 CONFIG_KALLSYMS=y
+10 -10
arch/x86/Kconfig
··· 627 627 as it is off-chip. APB timers are always running regardless of CPU 628 628 C states, they are used as per CPU clockevent device when possible. 629 629 630 - # Mark as embedded because too many people got it wrong. 630 + # Mark as expert because too many people got it wrong. 631 631 # The code disables itself when not needed. 632 632 config DMI 633 633 default y 634 - bool "Enable DMI scanning" if EMBEDDED 634 + bool "Enable DMI scanning" if EXPERT 635 635 ---help--- 636 636 Enabled scanning of DMI to identify machine quirks. Say Y 637 637 here unless you have verified that your setup is not ··· 639 639 BIOS code. 640 640 641 641 config GART_IOMMU 642 - bool "GART IOMMU support" if EMBEDDED 642 + bool "GART IOMMU support" if EXPERT 643 643 default y 644 644 select SWIOTLB 645 645 depends on X86_64 && PCI && AMD_NB ··· 889 889 depends on X86_MCE_INTEL 890 890 891 891 config VM86 892 - bool "Enable VM86 support" if EMBEDDED 892 + bool "Enable VM86 support" if EXPERT 893 893 default y 894 894 depends on X86_32 895 895 ---help--- ··· 1073 1073 1074 1074 choice 1075 1075 depends on EXPERIMENTAL 1076 - prompt "Memory split" if EMBEDDED 1076 + prompt "Memory split" if EXPERT 1077 1077 default VMSPLIT_3G 1078 1078 depends on X86_32 1079 1079 ---help--- ··· 1135 1135 def_bool X86_64 || HIGHMEM64G 1136 1136 1137 1137 config DIRECT_GBPAGES 1138 - bool "Enable 1GB pages for kernel pagetables" if EMBEDDED 1138 + bool "Enable 1GB pages for kernel pagetables" if EXPERT 1139 1139 default y 1140 1140 depends on X86_64 1141 1141 ---help--- ··· 1369 1369 1370 1370 config MTRR 1371 1371 def_bool y 1372 - prompt "MTRR (Memory Type Range Register) support" if EMBEDDED 1372 + prompt "MTRR (Memory Type Range Register) support" if EXPERT 1373 1373 ---help--- 1374 1374 On Intel P6 family processors (Pentium Pro, Pentium II and later) 1375 1375 the Memory Type Range Registers (MTRRs) may be used to control ··· 1435 1435 1436 1436 config X86_PAT 1437 1437 def_bool y 1438 - prompt "x86 PAT support" if EMBEDDED 1438 + prompt "x86 PAT support" if EXPERT 1439 1439 depends on MTRR 1440 1440 ---help--- 1441 1441 Use PAT attributes to setup page level cache control. ··· 1539 1539 code in physical address mode via KEXEC 1540 1540 1541 1541 config PHYSICAL_START 1542 - hex "Physical address where the kernel is loaded" if (EMBEDDED || CRASH_DUMP) 1542 + hex "Physical address where the kernel is loaded" if (EXPERT || CRASH_DUMP) 1543 1543 default "0x1000000" 1544 1544 ---help--- 1545 1545 This gives the physical address where the kernel is loaded. ··· 1934 1934 depends on X86_64 && PCI && ACPI 1935 1935 1936 1936 config PCI_CNB20LE_QUIRK 1937 - bool "Read CNB20LE Host Bridge Windows" if EMBEDDED 1937 + bool "Read CNB20LE Host Bridge Windows" if EXPERT 1938 1938 default n 1939 1939 depends on PCI && EXPERIMENTAL 1940 1940 help
+1 -1
arch/x86/Kconfig.cpu
··· 424 424 depends on !(MK6 || MWINCHIPC6 || MWINCHIP3D || MCYRIXIII || M586MMX || M586TSC || M586 || M486 || M386) && !UML 425 425 426 426 menuconfig PROCESSOR_SELECT 427 - bool "Supported processor vendors" if EMBEDDED 427 + bool "Supported processor vendors" if EXPERT 428 428 ---help--- 429 429 This lets you choose what x86 vendor support code your kernel 430 430 will include.
+2 -2
arch/x86/Kconfig.debug
··· 31 31 see errors. Disable this if you want silent bootup. 32 32 33 33 config EARLY_PRINTK 34 - bool "Early printk" if EMBEDDED 34 + bool "Early printk" if EXPERT 35 35 default y 36 36 ---help--- 37 37 Write kernel log output directly into the VGA buffer or to a serial ··· 138 138 139 139 config DOUBLEFAULT 140 140 default y 141 - bool "Enable doublefault exception handler" if EMBEDDED 141 + bool "Enable doublefault exception handler" if EXPERT 142 142 depends on X86_32 143 143 ---help--- 144 144 This option allows trapping of rare doublefault exceptions that
+2
arch/x86/include/asm/numa_32.h
··· 1 1 #ifndef _ASM_X86_NUMA_32_H 2 2 #define _ASM_X86_NUMA_32_H 3 3 4 + extern int numa_off; 5 + 4 6 extern int pxm_to_nid(int pxm); 5 7 extern void numa_remove_cpu(int cpu); 6 8
+1
arch/x86/include/asm/numa_64.h
··· 40 40 #ifdef CONFIG_NUMA_EMU 41 41 #define FAKE_NODE_MIN_SIZE ((u64)32 << 20) 42 42 #define FAKE_NODE_MIN_HASH_MASK (~(FAKE_NODE_MIN_SIZE - 1UL)) 43 + void numa_emu_cmdline(char *); 43 44 #endif /* CONFIG_NUMA_EMU */ 44 45 #else 45 46 static inline void init_cpu_to_node(void) { }
+4 -4
arch/x86/include/asm/percpu.h
··· 414 414 #define this_cpu_xchg_1(pcp, nval) percpu_xchg_op(pcp, nval) 415 415 #define this_cpu_xchg_2(pcp, nval) percpu_xchg_op(pcp, nval) 416 416 #define this_cpu_xchg_4(pcp, nval) percpu_xchg_op(pcp, nval) 417 - #define this_cpu_xchg_8(pcp, nval) percpu_xchg_op(pcp, nval) 418 - #define this_cpu_cmpxchg_8(pcp, oval, nval) percpu_cmpxchg_op(pcp, oval, nval) 419 417 420 418 #define irqsafe_cpu_add_1(pcp, val) percpu_add_op((pcp), val) 421 419 #define irqsafe_cpu_add_2(pcp, val) percpu_add_op((pcp), val) ··· 430 432 #define irqsafe_cpu_xchg_1(pcp, nval) percpu_xchg_op(pcp, nval) 431 433 #define irqsafe_cpu_xchg_2(pcp, nval) percpu_xchg_op(pcp, nval) 432 434 #define irqsafe_cpu_xchg_4(pcp, nval) percpu_xchg_op(pcp, nval) 433 - #define irqsafe_cpu_xchg_8(pcp, nval) percpu_xchg_op(pcp, nval) 434 - #define irqsafe_cpu_cmpxchg_8(pcp, oval, nval) percpu_cmpxchg_op(pcp, oval, nval) 435 435 436 436 #ifndef CONFIG_M386 437 437 #define __this_cpu_add_return_1(pcp, val) percpu_add_return_op(pcp, val) ··· 471 475 #define this_cpu_or_8(pcp, val) percpu_to_op("or", (pcp), val) 472 476 #define this_cpu_xor_8(pcp, val) percpu_to_op("xor", (pcp), val) 473 477 #define this_cpu_add_return_8(pcp, val) percpu_add_return_op(pcp, val) 478 + #define this_cpu_xchg_8(pcp, nval) percpu_xchg_op(pcp, nval) 479 + #define this_cpu_cmpxchg_8(pcp, oval, nval) percpu_cmpxchg_op(pcp, oval, nval) 474 480 475 481 #define irqsafe_cpu_add_8(pcp, val) percpu_add_op((pcp), val) 476 482 #define irqsafe_cpu_and_8(pcp, val) percpu_to_op("and", (pcp), val) 477 483 #define irqsafe_cpu_or_8(pcp, val) percpu_to_op("or", (pcp), val) 478 484 #define irqsafe_cpu_xor_8(pcp, val) percpu_to_op("xor", (pcp), val) 485 + #define irqsafe_cpu_xchg_8(pcp, nval) percpu_xchg_op(pcp, nval) 486 + #define irqsafe_cpu_cmpxchg_8(pcp, oval, nval) percpu_cmpxchg_op(pcp, oval, nval) 479 487 #endif 480 488 481 489 /* This is not atomic against other CPUs -- CPU preemption needs to be off */
+2 -9
arch/x86/kernel/vmlinux.lds.S
··· 34 34 #ifdef CONFIG_X86_32 35 35 OUTPUT_ARCH(i386) 36 36 ENTRY(phys_startup_32) 37 + jiffies = jiffies_64; 37 38 #else 38 39 OUTPUT_ARCH(i386:x86-64) 39 40 ENTRY(phys_startup_64) 41 + jiffies_64 = jiffies; 40 42 #endif 41 43 42 44 #if defined(CONFIG_X86_64) && defined(CONFIG_DEBUG_RODATA) ··· 142 140 CACHELINE_ALIGNED_DATA(L1_CACHE_BYTES) 143 141 144 142 DATA_DATA 145 - /* 146 - * Workaround a binutils (2.20.51.0.12 to 2.21.51.0.3) bug. 147 - * This makes jiffies relocatable in such binutils 148 - */ 149 - #ifdef CONFIG_X86_32 150 - jiffies = jiffies_64; 151 - #else 152 - jiffies_64 = jiffies; 153 - #endif 154 143 CONSTRUCTORS 155 144 156 145 /* rarely changed data like cpu maps */
+1
arch/x86/lguest/Kconfig
··· 2 2 bool "Lguest guest support" 3 3 select PARAVIRT 4 4 depends on X86_32 5 + select VIRTUALIZATION 5 6 select VIRTIO 6 7 select VIRTIO_RING 7 8 select VIRTIO_CONSOLE
+1 -1
arch/x86/lguest/boot.c
··· 824 824 825 825 for (i = FIRST_EXTERNAL_VECTOR; i < NR_VECTORS; i++) { 826 826 /* Some systems map "vectors" to interrupts weirdly. Not us! */ 827 - __get_cpu_var(vector_irq)[i] = i - FIRST_EXTERNAL_VECTOR; 827 + __this_cpu_write(vector_irq[i], i - FIRST_EXTERNAL_VECTOR); 828 828 if (i != SYSCALL_VECTOR) 829 829 set_intr_gate(i, interrupt[i - FIRST_EXTERNAL_VECTOR]); 830 830 }
+22
arch/x86/mm/numa.c
··· 2 2 #include <linux/topology.h> 3 3 #include <linux/module.h> 4 4 #include <linux/bootmem.h> 5 + #include <asm/numa.h> 6 + #include <asm/acpi.h> 7 + 8 + int __initdata numa_off; 9 + 10 + static __init int numa_setup(char *opt) 11 + { 12 + if (!opt) 13 + return -EINVAL; 14 + if (!strncmp(opt, "off", 3)) 15 + numa_off = 1; 16 + #ifdef CONFIG_NUMA_EMU 17 + if (!strncmp(opt, "fake=", 5)) 18 + numa_emu_cmdline(opt + 5); 19 + #endif 20 + #ifdef CONFIG_ACPI_NUMA 21 + if (!strncmp(opt, "noacpi", 6)) 22 + acpi_numa = -1; 23 + #endif 24 + return 0; 25 + } 26 + early_param("numa", numa_setup); 5 27 6 28 /* 7 29 * Which logical CPUs are on which nodes
+5 -19
arch/x86/mm/numa_64.c
··· 30 30 [0 ... MAX_LOCAL_APIC-1] = NUMA_NO_NODE 31 31 }; 32 32 33 - int numa_off __initdata; 34 33 static unsigned long __initdata nodemap_addr; 35 34 static unsigned long __initdata nodemap_size; 36 35 ··· 261 262 static struct bootnode nodes[MAX_NUMNODES] __initdata; 262 263 static struct bootnode physnodes[MAX_NUMNODES] __cpuinitdata; 263 264 static char *cmdline __initdata; 265 + 266 + void __init numa_emu_cmdline(char *str) 267 + { 268 + cmdline = str; 269 + } 264 270 265 271 static int __init setup_physnodes(unsigned long start, unsigned long end, 266 272 int acpi, int amd) ··· 673 669 674 670 return pages; 675 671 } 676 - 677 - static __init int numa_setup(char *opt) 678 - { 679 - if (!opt) 680 - return -EINVAL; 681 - if (!strncmp(opt, "off", 3)) 682 - numa_off = 1; 683 - #ifdef CONFIG_NUMA_EMU 684 - if (!strncmp(opt, "fake=", 5)) 685 - cmdline = opt + 5; 686 - #endif 687 - #ifdef CONFIG_ACPI_NUMA 688 - if (!strncmp(opt, "noacpi", 6)) 689 - acpi_numa = -1; 690 - #endif 691 - return 0; 692 - } 693 - early_param("numa", numa_setup); 694 672 695 673 #ifdef CONFIG_NUMA 696 674
-1
arch/x86/mm/srat_32.c
··· 59 59 static int __initdata num_memory_chunks; /* total number of memory chunks */ 60 60 static u8 __initdata apicid_to_pxm[MAX_APICID]; 61 61 62 - int numa_off __initdata; 63 62 int acpi_numa __initdata; 64 63 65 64 static __init void bad_srat(void)
+1 -1
arch/x86/xen/enlighten.c
··· 1194 1194 per_cpu(xen_vcpu, 0) = &HYPERVISOR_shared_info->vcpu_info[0]; 1195 1195 1196 1196 local_irq_disable(); 1197 - early_boot_irqs_off(); 1197 + early_boot_irqs_disabled = true; 1198 1198 1199 1199 memblock_init(); 1200 1200
+1 -1
arch/x86/xen/irq.c
··· 126 126 #endif 127 127 }; 128 128 129 - void __init xen_init_irq_ops() 129 + void __init xen_init_irq_ops(void) 130 130 { 131 131 pv_irq_ops = xen_irq_ops; 132 132 x86_init.irqs.intr_init = xen_init_IRQ;
+19 -1
arch/x86/xen/p2m.c
··· 237 237 p2m_top[topidx] = mid; 238 238 } 239 239 240 - p2m_top[topidx][mididx] = &mfn_list[pfn]; 240 + /* 241 + * As long as the mfn_list has enough entries to completely 242 + * fill a p2m page, pointing into the array is ok. But if 243 + * not the entries beyond the last pfn will be undefined. 244 + * And guessing that the 'what-ever-there-is' does not take it 245 + * too kindly when changing it to invalid markers, a new page 246 + * is allocated, initialized and filled with the valid part. 247 + */ 248 + if (unlikely(pfn + P2M_PER_PAGE > max_pfn)) { 249 + unsigned long p2midx; 250 + unsigned long *p2m = extend_brk(PAGE_SIZE, PAGE_SIZE); 251 + p2m_init(p2m); 252 + 253 + for (p2midx = 0; pfn + p2midx < max_pfn; p2midx++) { 254 + p2m[p2midx] = mfn_list[pfn + p2midx]; 255 + } 256 + p2m_top[topidx][mididx] = p2m; 257 + } else 258 + p2m_top[topidx][mididx] = &mfn_list[pfn]; 241 259 } 242 260 243 261 m2p_override_init();
+1 -1
arch/xtensa/configs/common_defconfig
··· 32 32 # CONFIG_HOTPLUG is not set 33 33 CONFIG_KOBJECT_UEVENT=y 34 34 # CONFIG_IKCONFIG is not set 35 - # CONFIG_EMBEDDED is not set 35 + # CONFIG_EXPERT is not set 36 36 CONFIG_KALLSYMS=y 37 37 # CONFIG_KALLSYMS_ALL is not set 38 38 # CONFIG_KALLSYMS_EXTRA_PASS is not set
+1 -1
arch/xtensa/configs/iss_defconfig
··· 55 55 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 56 56 CONFIG_SYSCTL=y 57 57 CONFIG_ANON_INODES=y 58 - CONFIG_EMBEDDED=y 58 + CONFIG_EXPERT=y 59 59 CONFIG_SYSCTL_SYSCALL=y 60 60 CONFIG_KALLSYMS=y 61 61 # CONFIG_KALLSYMS_ALL is not set
+1 -1
arch/xtensa/configs/s6105_defconfig
··· 55 55 CONFIG_INITRAMFS_SOURCE="" 56 56 CONFIG_CC_OPTIMIZE_FOR_SIZE=y 57 57 CONFIG_SYSCTL=y 58 - CONFIG_EMBEDDED=y 58 + CONFIG_EXPERT=y 59 59 CONFIG_SYSCTL_SYSCALL=y 60 60 CONFIG_KALLSYMS=y 61 61 # CONFIG_KALLSYMS_ALL is not set
+1 -1
block/Kconfig
··· 2 2 # Block layer core configuration 3 3 # 4 4 menuconfig BLOCK 5 - bool "Enable the block layer" if EMBEDDED 5 + bool "Enable the block layer" if EXPERT 6 6 default y 7 7 help 8 8 Provide block layer support for the kernel.
+1 -2
drivers/Makefile
··· 24 24 # regulators early, since some subsystems rely on them to initialize 25 25 obj-$(CONFIG_REGULATOR) += regulator/ 26 26 27 - # char/ comes before serial/ etc so that the VT console is the boot-time 27 + # tty/ comes before char/ so that the VT console is the boot-time 28 28 # default. 29 29 obj-y += tty/ 30 30 obj-y += char/ ··· 38 38 obj-$(CONFIG_FB_I810) += video/i810/ 39 39 obj-$(CONFIG_FB_INTEL) += video/intelfb/ 40 40 41 - obj-y += serial/ 42 41 obj-$(CONFIG_PARPORT) += parport/ 43 42 obj-y += base/ block/ misc/ mfd/ nfc/ 44 43 obj-$(CONFIG_NUBUS) += nubus/
+1 -1
drivers/acpi/Kconfig
··· 318 318 the module will be called pci_slot. 319 319 320 320 config X86_PM_TIMER 321 - bool "Power Management Timer Support" if EMBEDDED 321 + bool "Power Management Timer Support" if EXPERT 322 322 depends on X86 323 323 default y 324 324 help
+1 -1
drivers/acpi/acpica/accommon.h
··· 5 5 *****************************************************************************/ 6 6 7 7 /* 8 - * Copyright (C) 2000 - 2010, Intel Corp. 8 + * Copyright (C) 2000 - 2011, Intel Corp. 9 9 * All rights reserved. 10 10 * 11 11 * Redistribution and use in source and binary forms, with or without
+1 -1
drivers/acpi/acpica/acconfig.h
··· 5 5 *****************************************************************************/ 6 6 7 7 /* 8 - * Copyright (C) 2000 - 2010, Intel Corp. 8 + * Copyright (C) 2000 - 2011, Intel Corp. 9 9 * All rights reserved. 10 10 * 11 11 * Redistribution and use in source and binary forms, with or without
+1 -1
drivers/acpi/acpica/acdebug.h
··· 5 5 *****************************************************************************/ 6 6 7 7 /* 8 - * Copyright (C) 2000 - 2010, Intel Corp. 8 + * Copyright (C) 2000 - 2011, Intel Corp. 9 9 * All rights reserved. 10 10 * 11 11 * Redistribution and use in source and binary forms, with or without
+1 -1
drivers/acpi/acpica/acdispat.h
··· 5 5 *****************************************************************************/ 6 6 7 7 /* 8 - * Copyright (C) 2000 - 2010, Intel Corp. 8 + * Copyright (C) 2000 - 2011, Intel Corp. 9 9 * All rights reserved. 10 10 * 11 11 * Redistribution and use in source and binary forms, with or without
+1 -1
drivers/acpi/acpica/acevents.h
··· 5 5 *****************************************************************************/ 6 6 7 7 /* 8 - * Copyright (C) 2000 - 2010, Intel Corp. 8 + * Copyright (C) 2000 - 2011, Intel Corp. 9 9 * All rights reserved. 10 10 * 11 11 * Redistribution and use in source and binary forms, with or without
+1 -1
drivers/acpi/acpica/acglobal.h
··· 5 5 *****************************************************************************/ 6 6 7 7 /* 8 - * Copyright (C) 2000 - 2010, Intel Corp. 8 + * Copyright (C) 2000 - 2011, Intel Corp. 9 9 * All rights reserved. 10 10 * 11 11 * Redistribution and use in source and binary forms, with or without
+1 -1
drivers/acpi/acpica/achware.h
··· 5 5 *****************************************************************************/ 6 6 7 7 /* 8 - * Copyright (C) 2000 - 2010, Intel Corp. 8 + * Copyright (C) 2000 - 2011, Intel Corp. 9 9 * All rights reserved. 10 10 * 11 11 * Redistribution and use in source and binary forms, with or without
+1 -1
drivers/acpi/acpica/acinterp.h
··· 5 5 *****************************************************************************/ 6 6 7 7 /* 8 - * Copyright (C) 2000 - 2010, Intel Corp. 8 + * Copyright (C) 2000 - 2011, Intel Corp. 9 9 * All rights reserved. 10 10 * 11 11 * Redistribution and use in source and binary forms, with or without
+1 -1
drivers/acpi/acpica/aclocal.h
··· 5 5 *****************************************************************************/ 6 6 7 7 /* 8 - * Copyright (C) 2000 - 2010, Intel Corp. 8 + * Copyright (C) 2000 - 2011, Intel Corp. 9 9 * All rights reserved. 10 10 * 11 11 * Redistribution and use in source and binary forms, with or without
+1 -1
drivers/acpi/acpica/acmacros.h
··· 5 5 *****************************************************************************/ 6 6 7 7 /* 8 - * Copyright (C) 2000 - 2010, Intel Corp. 8 + * Copyright (C) 2000 - 2011, Intel Corp. 9 9 * All rights reserved. 10 10 * 11 11 * Redistribution and use in source and binary forms, with or without
+1 -1
drivers/acpi/acpica/acnamesp.h
··· 5 5 *****************************************************************************/ 6 6 7 7 /* 8 - * Copyright (C) 2000 - 2010, Intel Corp. 8 + * Copyright (C) 2000 - 2011, Intel Corp. 9 9 * All rights reserved. 10 10 * 11 11 * Redistribution and use in source and binary forms, with or without
+11 -5
drivers/acpi/acpica/acobject.h
··· 6 6 *****************************************************************************/ 7 7 8 8 /* 9 - * Copyright (C) 2000 - 2010, Intel Corp. 9 + * Copyright (C) 2000 - 2011, Intel Corp. 10 10 * All rights reserved. 11 11 * 12 12 * Redistribution and use in source and binary forms, with or without ··· 97 97 #define AOPOBJ_OBJECT_INITIALIZED 0x08 /* Region is initialized, _REG was run */ 98 98 #define AOPOBJ_SETUP_COMPLETE 0x10 /* Region setup is complete */ 99 99 #define AOPOBJ_INVALID 0x20 /* Host OS won't allow a Region address */ 100 - #define AOPOBJ_MODULE_LEVEL 0x40 /* Method is actually module-level code */ 101 - #define AOPOBJ_MODIFIED_NAMESPACE 0x80 /* Method modified the namespace */ 102 100 103 101 /****************************************************************************** 104 102 * ··· 173 175 }; 174 176 175 177 struct acpi_object_method { 176 - ACPI_OBJECT_COMMON_HEADER u8 method_flags; 178 + ACPI_OBJECT_COMMON_HEADER u8 info_flags; 177 179 u8 param_count; 178 180 u8 sync_level; 179 181 union acpi_operand_object *mutex; ··· 181 183 union { 182 184 ACPI_INTERNAL_METHOD implementation; 183 185 union acpi_operand_object *handler; 184 - } extra; 186 + } dispatch; 185 187 186 188 u32 aml_length; 187 189 u8 thread_count; 188 190 acpi_owner_id owner_id; 189 191 }; 192 + 193 + /* Flags for info_flags field above */ 194 + 195 + #define ACPI_METHOD_MODULE_LEVEL 0x01 /* Method is actually module-level code */ 196 + #define ACPI_METHOD_INTERNAL_ONLY 0x02 /* Method is implemented internally (_OSI) */ 197 + #define ACPI_METHOD_SERIALIZED 0x04 /* Method is serialized */ 198 + #define ACPI_METHOD_SERIALIZED_PENDING 0x08 /* Method is to be marked serialized */ 199 + #define ACPI_METHOD_MODIFIED_NAMESPACE 0x10 /* Method modified the namespace */ 190 200 191 201 /****************************************************************************** 192 202 *
+1 -1
drivers/acpi/acpica/acopcode.h
··· 5 5 *****************************************************************************/ 6 6 7 7 /* 8 - * Copyright (C) 2000 - 2010, Intel Corp. 8 + * Copyright (C) 2000 - 2011, Intel Corp. 9 9 * All rights reserved. 10 10 * 11 11 * Redistribution and use in source and binary forms, with or without
+1 -1
drivers/acpi/acpica/acparser.h
··· 5 5 *****************************************************************************/ 6 6 7 7 /* 8 - * Copyright (C) 2000 - 2010, Intel Corp. 8 + * Copyright (C) 2000 - 2011, Intel Corp. 9 9 * All rights reserved. 10 10 * 11 11 * Redistribution and use in source and binary forms, with or without
+1 -1
drivers/acpi/acpica/acpredef.h
··· 6 6 *****************************************************************************/ 7 7 8 8 /* 9 - * Copyright (C) 2000 - 2010, Intel Corp. 9 + * Copyright (C) 2000 - 2011, Intel Corp. 10 10 * All rights reserved. 11 11 * 12 12 * Redistribution and use in source and binary forms, with or without
+1 -1
drivers/acpi/acpica/acresrc.h
··· 5 5 *****************************************************************************/ 6 6 7 7 /* 8 - * Copyright (C) 2000 - 2010, Intel Corp. 8 + * Copyright (C) 2000 - 2011, Intel Corp. 9 9 * All rights reserved. 10 10 * 11 11 * Redistribution and use in source and binary forms, with or without
+1 -1
drivers/acpi/acpica/acstruct.h
··· 5 5 *****************************************************************************/ 6 6 7 7 /* 8 - * Copyright (C) 2000 - 2010, Intel Corp. 8 + * Copyright (C) 2000 - 2011, Intel Corp. 9 9 * All rights reserved. 10 10 * 11 11 * Redistribution and use in source and binary forms, with or without
+1 -1
drivers/acpi/acpica/actables.h
··· 5 5 *****************************************************************************/ 6 6 7 7 /* 8 - * Copyright (C) 2000 - 2010, Intel Corp. 8 + * Copyright (C) 2000 - 2011, Intel Corp. 9 9 * All rights reserved. 10 10 * 11 11 * Redistribution and use in source and binary forms, with or without
+1 -1
drivers/acpi/acpica/acutils.h
··· 5 5 *****************************************************************************/ 6 6 7 7 /* 8 - * Copyright (C) 2000 - 2010, Intel Corp. 8 + * Copyright (C) 2000 - 2011, Intel Corp. 9 9 * All rights reserved. 10 10 * 11 11 * Redistribution and use in source and binary forms, with or without
+2 -8
drivers/acpi/acpica/amlcode.h
··· 7 7 *****************************************************************************/ 8 8 9 9 /* 10 - * Copyright (C) 2000 - 2010, Intel Corp. 10 + * Copyright (C) 2000 - 2011, Intel Corp. 11 11 * All rights reserved. 12 12 * 13 13 * Redistribution and use in source and binary forms, with or without ··· 480 480 AML_FIELD_ATTRIB_SMB_BLOCK_CALL = 0x0D 481 481 } AML_ACCESS_ATTRIBUTE; 482 482 483 - /* Bit fields in method_flags byte */ 483 + /* Bit fields in the AML method_flags byte */ 484 484 485 485 #define AML_METHOD_ARG_COUNT 0x07 486 486 #define AML_METHOD_SERIALIZED 0x08 487 487 #define AML_METHOD_SYNC_LEVEL 0xF0 488 - 489 - /* METHOD_FLAGS_ARG_COUNT is not used internally, define additional flags */ 490 - 491 - #define AML_METHOD_INTERNAL_ONLY 0x01 492 - #define AML_METHOD_RESERVED1 0x02 493 - #define AML_METHOD_RESERVED2 0x04 494 488 495 489 #endif /* __AMLCODE_H__ */
+1 -1
drivers/acpi/acpica/amlresrc.h
··· 6 6 *****************************************************************************/ 7 7 8 8 /* 9 - * Copyright (C) 2000 - 2010, Intel Corp. 9 + * Copyright (C) 2000 - 2011, Intel Corp. 10 10 * All rights reserved. 11 11 * 12 12 * Redistribution and use in source and binary forms, with or without
+1 -1
drivers/acpi/acpica/dsfield.c
··· 5 5 *****************************************************************************/ 6 6 7 7 /* 8 - * Copyright (C) 2000 - 2010, Intel Corp. 8 + * Copyright (C) 2000 - 2011, Intel Corp. 9 9 * All rights reserved. 10 10 * 11 11 * Redistribution and use in source and binary forms, with or without
+1 -1
drivers/acpi/acpica/dsinit.c
··· 5 5 *****************************************************************************/ 6 6 7 7 /* 8 - * Copyright (C) 2000 - 2010, Intel Corp. 8 + * Copyright (C) 2000 - 2011, Intel Corp. 9 9 * All rights reserved. 10 10 * 11 11 * Redistribution and use in source and binary forms, with or without
+48 -16
drivers/acpi/acpica/dsmethod.c
··· 5 5 *****************************************************************************/ 6 6 7 7 /* 8 - * Copyright (C) 2000 - 2010, Intel Corp. 8 + * Copyright (C) 2000 - 2011, Intel Corp. 9 9 * All rights reserved. 10 10 * 11 11 * Redistribution and use in source and binary forms, with or without ··· 43 43 44 44 #include <acpi/acpi.h> 45 45 #include "accommon.h" 46 - #include "amlcode.h" 47 46 #include "acdispat.h" 48 47 #include "acinterp.h" 49 48 #include "acnamesp.h" ··· 200 201 /* 201 202 * If this method is serialized, we need to acquire the method mutex. 202 203 */ 203 - if (obj_desc->method.method_flags & AML_METHOD_SERIALIZED) { 204 + if (obj_desc->method.info_flags & ACPI_METHOD_SERIALIZED) { 204 205 /* 205 206 * Create a mutex for the method if it is defined to be Serialized 206 207 * and a mutex has not already been created. We defer the mutex creation ··· 412 413 413 414 /* Invoke an internal method if necessary */ 414 415 415 - if (obj_desc->method.method_flags & AML_METHOD_INTERNAL_ONLY) { 416 - status = obj_desc->method.extra.implementation(next_walk_state); 416 + if (obj_desc->method.info_flags & ACPI_METHOD_INTERNAL_ONLY) { 417 + status = 418 + obj_desc->method.dispatch.implementation(next_walk_state); 417 419 if (status == AE_OK) { 418 420 status = AE_CTRL_TERMINATE; 419 421 } ··· 579 579 580 580 /* 581 581 * Delete any namespace objects created anywhere within the 582 - * namespace by the execution of this method. Unless this method 583 - * is a module-level executable code method, in which case we 584 - * want make the objects permanent. 582 + * namespace by the execution of this method. Unless: 583 + * 1) This method is a module-level executable code method, in which 584 + * case we want make the objects permanent. 585 + * 2) There are other threads executing the method, in which case we 586 + * will wait until the last thread has completed. 585 587 */ 586 - if (!(method_desc->method.flags & AOPOBJ_MODULE_LEVEL)) { 588 + if (!(method_desc->method.info_flags & ACPI_METHOD_MODULE_LEVEL) 589 + && (method_desc->method.thread_count == 1)) { 587 590 588 591 /* Delete any direct children of (created by) this method */ 589 592 ··· 596 593 /* 597 594 * Delete any objects that were created by this method 598 595 * elsewhere in the namespace (if any were created). 596 + * Use of the ACPI_METHOD_MODIFIED_NAMESPACE optimizes the 597 + * deletion such that we don't have to perform an entire 598 + * namespace walk for every control method execution. 599 599 */ 600 600 if (method_desc->method. 601 - flags & AOPOBJ_MODIFIED_NAMESPACE) { 601 + info_flags & ACPI_METHOD_MODIFIED_NAMESPACE) { 602 602 acpi_ns_delete_namespace_by_owner(method_desc-> 603 603 method. 604 604 owner_id); 605 + method_desc->method.info_flags &= 606 + ~ACPI_METHOD_MODIFIED_NAMESPACE; 605 607 } 606 608 } 607 609 } ··· 637 629 * Serialized if it appears that the method is incorrectly written and 638 630 * does not support multiple thread execution. The best example of this 639 631 * is if such a method creates namespace objects and blocks. A second 640 - * thread will fail with an AE_ALREADY_EXISTS exception 632 + * thread will fail with an AE_ALREADY_EXISTS exception. 641 633 * 642 634 * This code is here because we must wait until the last thread exits 643 - * before creating the synchronization semaphore. 635 + * before marking the method as serialized. 644 636 */ 645 - if ((method_desc->method.method_flags & AML_METHOD_SERIALIZED) 646 - && (!method_desc->method.mutex)) { 647 - (void)acpi_ds_create_method_mutex(method_desc); 637 + if (method_desc->method. 638 + info_flags & ACPI_METHOD_SERIALIZED_PENDING) { 639 + if (walk_state) { 640 + ACPI_INFO((AE_INFO, 641 + "Marking method %4.4s as Serialized because of AE_ALREADY_EXISTS error", 642 + walk_state->method_node->name. 643 + ascii)); 644 + } 645 + 646 + /* 647 + * Method tried to create an object twice and was marked as 648 + * "pending serialized". The probable cause is that the method 649 + * cannot handle reentrancy. 650 + * 651 + * The method was created as not_serialized, but it tried to create 652 + * a named object and then blocked, causing the second thread 653 + * entrance to begin and then fail. Workaround this problem by 654 + * marking the method permanently as Serialized when the last 655 + * thread exits here. 656 + */ 657 + method_desc->method.info_flags &= 658 + ~ACPI_METHOD_SERIALIZED_PENDING; 659 + method_desc->method.info_flags |= 660 + ACPI_METHOD_SERIALIZED; 661 + method_desc->method.sync_level = 0; 648 662 } 649 663 650 664 /* No more threads, we can free the owner_id */ 651 665 652 - if (!(method_desc->method.flags & AOPOBJ_MODULE_LEVEL)) { 666 + if (! 667 + (method_desc->method. 668 + info_flags & ACPI_METHOD_MODULE_LEVEL)) { 653 669 acpi_ut_release_owner_id(&method_desc->method.owner_id); 654 670 } 655 671 }
+1 -1
drivers/acpi/acpica/dsmthdat.c
··· 5 5 ******************************************************************************/ 6 6 7 7 /* 8 - * Copyright (C) 2000 - 2010, Intel Corp. 8 + * Copyright (C) 2000 - 2011, Intel Corp. 9 9 * All rights reserved. 10 10 * 11 11 * Redistribution and use in source and binary forms, with or without
+1 -1
drivers/acpi/acpica/dsobject.c
··· 5 5 *****************************************************************************/ 6 6 7 7 /* 8 - * Copyright (C) 2000 - 2010, Intel Corp. 8 + * Copyright (C) 2000 - 2011, Intel Corp. 9 9 * All rights reserved. 10 10 * 11 11 * Redistribution and use in source and binary forms, with or without
+1 -1
drivers/acpi/acpica/dsopcode.c
··· 6 6 *****************************************************************************/ 7 7 8 8 /* 9 - * Copyright (C) 2000 - 2010, Intel Corp. 9 + * Copyright (C) 2000 - 2011, Intel Corp. 10 10 * All rights reserved. 11 11 * 12 12 * Redistribution and use in source and binary forms, with or without
+1 -1
drivers/acpi/acpica/dsutils.c
··· 5 5 ******************************************************************************/ 6 6 7 7 /* 8 - * Copyright (C) 2000 - 2010, Intel Corp. 8 + * Copyright (C) 2000 - 2011, Intel Corp. 9 9 * All rights reserved. 10 10 * 11 11 * Redistribution and use in source and binary forms, with or without
+1 -1
drivers/acpi/acpica/dswexec.c
··· 6 6 *****************************************************************************/ 7 7 8 8 /* 9 - * Copyright (C) 2000 - 2010, Intel Corp. 9 + * Copyright (C) 2000 - 2011, Intel Corp. 10 10 * All rights reserved. 11 11 * 12 12 * Redistribution and use in source and binary forms, with or without
+1 -1
drivers/acpi/acpica/dswload.c
··· 5 5 *****************************************************************************/ 6 6 7 7 /* 8 - * Copyright (C) 2000 - 2010, Intel Corp. 8 + * Copyright (C) 2000 - 2011, Intel Corp. 9 9 * All rights reserved. 10 10 * 11 11 * Redistribution and use in source and binary forms, with or without
+1 -1
drivers/acpi/acpica/dswscope.c
··· 5 5 *****************************************************************************/ 6 6 7 7 /* 8 - * Copyright (C) 2000 - 2010, Intel Corp. 8 + * Copyright (C) 2000 - 2011, Intel Corp. 9 9 * All rights reserved. 10 10 * 11 11 * Redistribution and use in source and binary forms, with or without
+1 -1
drivers/acpi/acpica/dswstate.c
··· 5 5 *****************************************************************************/ 6 6 7 7 /* 8 - * Copyright (C) 2000 - 2010, Intel Corp. 8 + * Copyright (C) 2000 - 2011, Intel Corp. 9 9 * All rights reserved. 10 10 * 11 11 * Redistribution and use in source and binary forms, with or without
+1 -1
drivers/acpi/acpica/evevent.c
··· 5 5 *****************************************************************************/ 6 6 7 7 /* 8 - * Copyright (C) 2000 - 2010, Intel Corp. 8 + * Copyright (C) 2000 - 2011, Intel Corp. 9 9 * All rights reserved. 10 10 * 11 11 * Redistribution and use in source and binary forms, with or without
+3 -1
drivers/acpi/acpica/evgpe.c
··· 5 5 *****************************************************************************/ 6 6 7 7 /* 8 - * Copyright (C) 2000 - 2010, Intel Corp. 8 + * Copyright (C) 2000 - 2011, Intel Corp. 9 9 * All rights reserved. 10 10 * 11 11 * Redistribution and use in source and binary forms, with or without ··· 471 471 472 472 status = acpi_ut_acquire_mutex(ACPI_MTX_EVENTS); 473 473 if (ACPI_FAILURE(status)) { 474 + ACPI_FREE(local_gpe_event_info); 474 475 return_VOID; 475 476 } 476 477 ··· 479 478 480 479 if (!acpi_ev_valid_gpe_event(gpe_event_info)) { 481 480 status = acpi_ut_release_mutex(ACPI_MTX_EVENTS); 481 + ACPI_FREE(local_gpe_event_info); 482 482 return_VOID; 483 483 } 484 484
+1 -1
drivers/acpi/acpica/evgpeblk.c
··· 5 5 *****************************************************************************/ 6 6 7 7 /* 8 - * Copyright (C) 2000 - 2010, Intel Corp. 8 + * Copyright (C) 2000 - 2011, Intel Corp. 9 9 * All rights reserved. 10 10 * 11 11 * Redistribution and use in source and binary forms, with or without
+1 -1
drivers/acpi/acpica/evgpeinit.c
··· 5 5 *****************************************************************************/ 6 6 7 7 /* 8 - * Copyright (C) 2000 - 2010, Intel Corp. 8 + * Copyright (C) 2000 - 2011, Intel Corp. 9 9 * All rights reserved. 10 10 * 11 11 * Redistribution and use in source and binary forms, with or without
+1 -1
drivers/acpi/acpica/evgpeutil.c
··· 5 5 *****************************************************************************/ 6 6 7 7 /* 8 - * Copyright (C) 2000 - 2010, Intel Corp. 8 + * Copyright (C) 2000 - 2011, Intel Corp. 9 9 * All rights reserved. 10 10 * 11 11 * Redistribution and use in source and binary forms, with or without
+1 -1
drivers/acpi/acpica/evmisc.c
··· 5 5 *****************************************************************************/ 6 6 7 7 /* 8 - * Copyright (C) 2000 - 2010, Intel Corp. 8 + * Copyright (C) 2000 - 2011, Intel Corp. 9 9 * All rights reserved. 10 10 * 11 11 * Redistribution and use in source and binary forms, with or without
+1 -1
drivers/acpi/acpica/evregion.c
··· 5 5 *****************************************************************************/ 6 6 7 7 /* 8 - * Copyright (C) 2000 - 2010, Intel Corp. 8 + * Copyright (C) 2000 - 2011, Intel Corp. 9 9 * All rights reserved. 10 10 * 11 11 * Redistribution and use in source and binary forms, with or without
+3 -3
drivers/acpi/acpica/evrgnini.c
··· 5 5 *****************************************************************************/ 6 6 7 7 /* 8 - * Copyright (C) 2000 - 2010, Intel Corp. 8 + * Copyright (C) 2000 - 2011, Intel Corp. 9 9 * All rights reserved. 10 10 * 11 11 * Redistribution and use in source and binary forms, with or without ··· 590 590 * See acpi_ns_exec_module_code 591 591 */ 592 592 if (obj_desc->method. 593 - flags & AOPOBJ_MODULE_LEVEL) { 593 + info_flags & ACPI_METHOD_MODULE_LEVEL) { 594 594 handler_obj = 595 - obj_desc->method.extra.handler; 595 + obj_desc->method.dispatch.handler; 596 596 } 597 597 break; 598 598
+1 -1
drivers/acpi/acpica/evsci.c
··· 6 6 ******************************************************************************/ 7 7 8 8 /* 9 - * Copyright (C) 2000 - 2010, Intel Corp. 9 + * Copyright (C) 2000 - 2011, Intel Corp. 10 10 * All rights reserved. 11 11 * 12 12 * Redistribution and use in source and binary forms, with or without
+1 -1
drivers/acpi/acpica/evxface.c
··· 5 5 *****************************************************************************/ 6 6 7 7 /* 8 - * Copyright (C) 2000 - 2010, Intel Corp. 8 + * Copyright (C) 2000 - 2011, Intel Corp. 9 9 * All rights reserved. 10 10 * 11 11 * Redistribution and use in source and binary forms, with or without
+1 -1
drivers/acpi/acpica/evxfevnt.c
··· 5 5 *****************************************************************************/ 6 6 7 7 /* 8 - * Copyright (C) 2000 - 2010, Intel Corp. 8 + * Copyright (C) 2000 - 2011, Intel Corp. 9 9 * All rights reserved. 10 10 * 11 11 * Redistribution and use in source and binary forms, with or without
+1 -1
drivers/acpi/acpica/evxfgpe.c
··· 5 5 *****************************************************************************/ 6 6 7 7 /* 8 - * Copyright (C) 2000 - 2010, Intel Corp. 8 + * Copyright (C) 2000 - 2011, Intel Corp. 9 9 * All rights reserved. 10 10 * 11 11 * Redistribution and use in source and binary forms, with or without
+1 -1
drivers/acpi/acpica/evxfregn.c
··· 6 6 *****************************************************************************/ 7 7 8 8 /* 9 - * Copyright (C) 2000 - 2010, Intel Corp. 9 + * Copyright (C) 2000 - 2011, Intel Corp. 10 10 * All rights reserved. 11 11 * 12 12 * Redistribution and use in source and binary forms, with or without
+1 -1
drivers/acpi/acpica/exconfig.c
··· 5 5 *****************************************************************************/ 6 6 7 7 /* 8 - * Copyright (C) 2000 - 2010, Intel Corp. 8 + * Copyright (C) 2000 - 2011, Intel Corp. 9 9 * All rights reserved. 10 10 * 11 11 * Redistribution and use in source and binary forms, with or without
+1 -1
drivers/acpi/acpica/exconvrt.c
··· 5 5 *****************************************************************************/ 6 6 7 7 /* 8 - * Copyright (C) 2000 - 2010, Intel Corp. 8 + * Copyright (C) 2000 - 2011, Intel Corp. 9 9 * All rights reserved. 10 10 * 11 11 * Redistribution and use in source and binary forms, with or without
+5 -5
drivers/acpi/acpica/excreate.c
··· 5 5 *****************************************************************************/ 6 6 7 7 /* 8 - * Copyright (C) 2000 - 2010, Intel Corp. 8 + * Copyright (C) 2000 - 2011, Intel Corp. 9 9 * All rights reserved. 10 10 * 11 11 * Redistribution and use in source and binary forms, with or without ··· 482 482 obj_desc->method.aml_length = aml_length; 483 483 484 484 /* 485 - * Disassemble the method flags. Split off the Arg Count 486 - * for efficiency 485 + * Disassemble the method flags. Split off the arg_count, Serialized 486 + * flag, and sync_level for efficiency. 487 487 */ 488 488 method_flags = (u8) operand[1]->integer.value; 489 489 490 - obj_desc->method.method_flags = 491 - (u8) (method_flags & ~AML_METHOD_ARG_COUNT); 492 490 obj_desc->method.param_count = 493 491 (u8) (method_flags & AML_METHOD_ARG_COUNT); 494 492 ··· 495 497 * created for this method when it is parsed. 496 498 */ 497 499 if (method_flags & AML_METHOD_SERIALIZED) { 500 + obj_desc->method.info_flags = ACPI_METHOD_SERIALIZED; 501 + 498 502 /* 499 503 * ACPI 1.0: sync_level = 0 500 504 * ACPI 2.0: sync_level = sync_level in method declaration
+1 -1
drivers/acpi/acpica/exdebug.c
··· 5 5 *****************************************************************************/ 6 6 7 7 /* 8 - * Copyright (C) 2000 - 2010, Intel Corp. 8 + * Copyright (C) 2000 - 2011, Intel Corp. 9 9 * All rights reserved. 10 10 * 11 11 * Redistribution and use in source and binary forms, with or without
+2 -2
drivers/acpi/acpica/exdump.c
··· 5 5 *****************************************************************************/ 6 6 7 7 /* 8 - * Copyright (C) 2000 - 2010, Intel Corp. 8 + * Copyright (C) 2000 - 2011, Intel Corp. 9 9 * All rights reserved. 10 10 * 11 11 * Redistribution and use in source and binary forms, with or without ··· 122 122 123 123 static struct acpi_exdump_info acpi_ex_dump_method[9] = { 124 124 {ACPI_EXD_INIT, ACPI_EXD_TABLE_SIZE(acpi_ex_dump_method), NULL}, 125 - {ACPI_EXD_UINT8, ACPI_EXD_OFFSET(method.method_flags), "Method Flags"}, 125 + {ACPI_EXD_UINT8, ACPI_EXD_OFFSET(method.info_flags), "Info Flags"}, 126 126 {ACPI_EXD_UINT8, ACPI_EXD_OFFSET(method.param_count), 127 127 "Parameter Count"}, 128 128 {ACPI_EXD_UINT8, ACPI_EXD_OFFSET(method.sync_level), "Sync Level"},
+1 -1
drivers/acpi/acpica/exfield.c
··· 5 5 *****************************************************************************/ 6 6 7 7 /* 8 - * Copyright (C) 2000 - 2010, Intel Corp. 8 + * Copyright (C) 2000 - 2011, Intel Corp. 9 9 * All rights reserved. 10 10 * 11 11 * Redistribution and use in source and binary forms, with or without
+1 -1
drivers/acpi/acpica/exfldio.c
··· 5 5 *****************************************************************************/ 6 6 7 7 /* 8 - * Copyright (C) 2000 - 2010, Intel Corp. 8 + * Copyright (C) 2000 - 2011, Intel Corp. 9 9 * All rights reserved. 10 10 * 11 11 * Redistribution and use in source and binary forms, with or without
+1 -1
drivers/acpi/acpica/exmisc.c
··· 6 6 *****************************************************************************/ 7 7 8 8 /* 9 - * Copyright (C) 2000 - 2010, Intel Corp. 9 + * Copyright (C) 2000 - 2011, Intel Corp. 10 10 * All rights reserved. 11 11 * 12 12 * Redistribution and use in source and binary forms, with or without
+1 -1
drivers/acpi/acpica/exmutex.c
··· 6 6 *****************************************************************************/ 7 7 8 8 /* 9 - * Copyright (C) 2000 - 2010, Intel Corp. 9 + * Copyright (C) 2000 - 2011, Intel Corp. 10 10 * All rights reserved. 11 11 * 12 12 * Redistribution and use in source and binary forms, with or without
+1 -1
drivers/acpi/acpica/exnames.c
··· 6 6 *****************************************************************************/ 7 7 8 8 /* 9 - * Copyright (C) 2000 - 2010, Intel Corp. 9 + * Copyright (C) 2000 - 2011, Intel Corp. 10 10 * All rights reserved. 11 11 * 12 12 * Redistribution and use in source and binary forms, with or without
+1 -1
drivers/acpi/acpica/exoparg1.c
··· 6 6 *****************************************************************************/ 7 7 8 8 /* 9 - * Copyright (C) 2000 - 2010, Intel Corp. 9 + * Copyright (C) 2000 - 2011, Intel Corp. 10 10 * All rights reserved. 11 11 * 12 12 * Redistribution and use in source and binary forms, with or without
+1 -1
drivers/acpi/acpica/exoparg2.c
··· 5 5 *****************************************************************************/ 6 6 7 7 /* 8 - * Copyright (C) 2000 - 2010, Intel Corp. 8 + * Copyright (C) 2000 - 2011, Intel Corp. 9 9 * All rights reserved. 10 10 * 11 11 * Redistribution and use in source and binary forms, with or without
+1 -1
drivers/acpi/acpica/exoparg3.c
··· 6 6 *****************************************************************************/ 7 7 8 8 /* 9 - * Copyright (C) 2000 - 2010, Intel Corp. 9 + * Copyright (C) 2000 - 2011, Intel Corp. 10 10 * All rights reserved. 11 11 * 12 12 * Redistribution and use in source and binary forms, with or without
+1 -1
drivers/acpi/acpica/exoparg6.c
··· 6 6 *****************************************************************************/ 7 7 8 8 /* 9 - * Copyright (C) 2000 - 2010, Intel Corp. 9 + * Copyright (C) 2000 - 2011, Intel Corp. 10 10 * All rights reserved. 11 11 * 12 12 * Redistribution and use in source and binary forms, with or without
+1 -1
drivers/acpi/acpica/exprep.c
··· 6 6 *****************************************************************************/ 7 7 8 8 /* 9 - * Copyright (C) 2000 - 2010, Intel Corp. 9 + * Copyright (C) 2000 - 2011, Intel Corp. 10 10 * All rights reserved. 11 11 * 12 12 * Redistribution and use in source and binary forms, with or without
+1 -1
drivers/acpi/acpica/exregion.c
··· 6 6 *****************************************************************************/ 7 7 8 8 /* 9 - * Copyright (C) 2000 - 2010, Intel Corp. 9 + * Copyright (C) 2000 - 2011, Intel Corp. 10 10 * All rights reserved. 11 11 * 12 12 * Redistribution and use in source and binary forms, with or without
+1 -1
drivers/acpi/acpica/exresnte.c
··· 6 6 *****************************************************************************/ 7 7 8 8 /* 9 - * Copyright (C) 2000 - 2010, Intel Corp. 9 + * Copyright (C) 2000 - 2011, Intel Corp. 10 10 * All rights reserved. 11 11 * 12 12 * Redistribution and use in source and binary forms, with or without
+1 -1
drivers/acpi/acpica/exresolv.c
··· 6 6 *****************************************************************************/ 7 7 8 8 /* 9 - * Copyright (C) 2000 - 2010, Intel Corp. 9 + * Copyright (C) 2000 - 2011, Intel Corp. 10 10 * All rights reserved. 11 11 * 12 12 * Redistribution and use in source and binary forms, with or without
+1 -1
drivers/acpi/acpica/exresop.c
··· 6 6 *****************************************************************************/ 7 7 8 8 /* 9 - * Copyright (C) 2000 - 2010, Intel Corp. 9 + * Copyright (C) 2000 - 2011, Intel Corp. 10 10 * All rights reserved. 11 11 * 12 12 * Redistribution and use in source and binary forms, with or without
+1 -1
drivers/acpi/acpica/exstore.c
··· 5 5 *****************************************************************************/ 6 6 7 7 /* 8 - * Copyright (C) 2000 - 2010, Intel Corp. 8 + * Copyright (C) 2000 - 2011, Intel Corp. 9 9 * All rights reserved. 10 10 * 11 11 * Redistribution and use in source and binary forms, with or without
+1 -1
drivers/acpi/acpica/exstoren.c
··· 7 7 *****************************************************************************/ 8 8 9 9 /* 10 - * Copyright (C) 2000 - 2010, Intel Corp. 10 + * Copyright (C) 2000 - 2011, Intel Corp. 11 11 * All rights reserved. 12 12 * 13 13 * Redistribution and use in source and binary forms, with or without
+1 -1
drivers/acpi/acpica/exstorob.c
··· 6 6 *****************************************************************************/ 7 7 8 8 /* 9 - * Copyright (C) 2000 - 2010, Intel Corp. 9 + * Copyright (C) 2000 - 2011, Intel Corp. 10 10 * All rights reserved. 11 11 * 12 12 * Redistribution and use in source and binary forms, with or without
+1 -1
drivers/acpi/acpica/exsystem.c
··· 6 6 *****************************************************************************/ 7 7 8 8 /* 9 - * Copyright (C) 2000 - 2010, Intel Corp. 9 + * Copyright (C) 2000 - 2011, Intel Corp. 10 10 * All rights reserved. 11 11 * 12 12 * Redistribution and use in source and binary forms, with or without
+1 -1
drivers/acpi/acpica/exutils.c
··· 6 6 *****************************************************************************/ 7 7 8 8 /* 9 - * Copyright (C) 2000 - 2010, Intel Corp. 9 + * Copyright (C) 2000 - 2011, Intel Corp. 10 10 * All rights reserved. 11 11 * 12 12 * Redistribution and use in source and binary forms, with or without
+1 -1
drivers/acpi/acpica/hwacpi.c
··· 6 6 *****************************************************************************/ 7 7 8 8 /* 9 - * Copyright (C) 2000 - 2010, Intel Corp. 9 + * Copyright (C) 2000 - 2011, Intel Corp. 10 10 * All rights reserved. 11 11 * 12 12 * Redistribution and use in source and binary forms, with or without
+1 -1
drivers/acpi/acpica/hwgpe.c
··· 6 6 *****************************************************************************/ 7 7 8 8 /* 9 - * Copyright (C) 2000 - 2010, Intel Corp. 9 + * Copyright (C) 2000 - 2011, Intel Corp. 10 10 * All rights reserved. 11 11 * 12 12 * Redistribution and use in source and binary forms, with or without
+1 -1
drivers/acpi/acpica/hwpci.c
··· 5 5 ******************************************************************************/ 6 6 7 7 /* 8 - * Copyright (C) 2000 - 2010, Intel Corp. 8 + * Copyright (C) 2000 - 2011, Intel Corp. 9 9 * All rights reserved. 10 10 * 11 11 * Redistribution and use in source and binary forms, with or without
+1 -1
drivers/acpi/acpica/hwregs.c
··· 7 7 ******************************************************************************/ 8 8 9 9 /* 10 - * Copyright (C) 2000 - 2010, Intel Corp. 10 + * Copyright (C) 2000 - 2011, Intel Corp. 11 11 * All rights reserved. 12 12 * 13 13 * Redistribution and use in source and binary forms, with or without
+1 -1
drivers/acpi/acpica/hwsleep.c
··· 6 6 *****************************************************************************/ 7 7 8 8 /* 9 - * Copyright (C) 2000 - 2010, Intel Corp. 9 + * Copyright (C) 2000 - 2011, Intel Corp. 10 10 * All rights reserved. 11 11 * 12 12 * Redistribution and use in source and binary forms, with or without
+1 -1
drivers/acpi/acpica/hwtimer.c
··· 6 6 *****************************************************************************/ 7 7 8 8 /* 9 - * Copyright (C) 2000 - 2010, Intel Corp. 9 + * Copyright (C) 2000 - 2011, Intel Corp. 10 10 * All rights reserved. 11 11 * 12 12 * Redistribution and use in source and binary forms, with or without
+1 -1
drivers/acpi/acpica/hwvalid.c
··· 6 6 *****************************************************************************/ 7 7 8 8 /* 9 - * Copyright (C) 2000 - 2010, Intel Corp. 9 + * Copyright (C) 2000 - 2011, Intel Corp. 10 10 * All rights reserved. 11 11 * 12 12 * Redistribution and use in source and binary forms, with or without
+1 -1
drivers/acpi/acpica/hwxface.c
··· 6 6 *****************************************************************************/ 7 7 8 8 /* 9 - * Copyright (C) 2000 - 2010, Intel Corp. 9 + * Copyright (C) 2000 - 2011, Intel Corp. 10 10 * All rights reserved. 11 11 * 12 12 * Redistribution and use in source and binary forms, with or without
+4 -4
drivers/acpi/acpica/nsaccess.c
··· 5 5 ******************************************************************************/ 6 6 7 7 /* 8 - * Copyright (C) 2000 - 2010, Intel Corp. 8 + * Copyright (C) 2000 - 2011, Intel Corp. 9 9 * All rights reserved. 10 10 * 11 11 * Redistribution and use in source and binary forms, with or without ··· 163 163 #else 164 164 /* Mark this as a very SPECIAL method */ 165 165 166 - obj_desc->method.method_flags = 167 - AML_METHOD_INTERNAL_ONLY; 168 - obj_desc->method.extra.implementation = 166 + obj_desc->method.info_flags = 167 + ACPI_METHOD_INTERNAL_ONLY; 168 + obj_desc->method.dispatch.implementation = 169 169 acpi_ut_osi_implementation; 170 170 #endif 171 171 break;
+12 -3
drivers/acpi/acpica/nsalloc.c
··· 5 5 ******************************************************************************/ 6 6 7 7 /* 8 - * Copyright (C) 2000 - 2010, Intel Corp. 8 + * Copyright (C) 2000 - 2011, Intel Corp. 9 9 * All rights reserved. 10 10 * 11 11 * Redistribution and use in source and binary forms, with or without ··· 234 234 * modified the namespace. This is used for cleanup when the 235 235 * method exits. 236 236 */ 237 - walk_state->method_desc->method.flags |= 238 - AOPOBJ_MODIFIED_NAMESPACE; 237 + walk_state->method_desc->method.info_flags |= 238 + ACPI_METHOD_MODIFIED_NAMESPACE; 239 239 } 240 240 } 241 241 ··· 341 341 { 342 342 struct acpi_namespace_node *child_node = NULL; 343 343 u32 level = 1; 344 + acpi_status status; 344 345 345 346 ACPI_FUNCTION_TRACE(ns_delete_namespace_subtree); 346 347 347 348 if (!parent_node) { 349 + return_VOID; 350 + } 351 + 352 + /* Lock namespace for possible update */ 353 + 354 + status = acpi_ut_acquire_mutex(ACPI_MTX_NAMESPACE); 355 + if (ACPI_FAILURE(status)) { 348 356 return_VOID; 349 357 } 350 358 ··· 405 397 } 406 398 } 407 399 400 + (void)acpi_ut_release_mutex(ACPI_MTX_NAMESPACE); 408 401 return_VOID; 409 402 } 410 403
+16 -1
drivers/acpi/acpica/nsdump.c
··· 5 5 *****************************************************************************/ 6 6 7 7 /* 8 - * Copyright (C) 2000 - 2010, Intel Corp. 8 + * Copyright (C) 2000 - 2011, Intel Corp. 9 9 * All rights reserved. 10 10 * 11 11 * Redistribution and use in source and binary forms, with or without ··· 624 624 acpi_owner_id owner_id, acpi_handle start_handle) 625 625 { 626 626 struct acpi_walk_info info; 627 + acpi_status status; 627 628 628 629 ACPI_FUNCTION_ENTRY(); 630 + 631 + /* 632 + * Just lock the entire namespace for the duration of the dump. 633 + * We don't want any changes to the namespace during this time, 634 + * especially the temporary nodes since we are going to display 635 + * them also. 636 + */ 637 + status = acpi_ut_acquire_mutex(ACPI_MTX_NAMESPACE); 638 + if (ACPI_FAILURE(status)) { 639 + acpi_os_printf("Could not acquire namespace mutex\n"); 640 + return; 641 + } 629 642 630 643 info.debug_level = ACPI_LV_TABLES; 631 644 info.owner_id = owner_id; ··· 649 636 ACPI_NS_WALK_TEMP_NODES, 650 637 acpi_ns_dump_one_object, NULL, 651 638 (void *)&info, NULL); 639 + 640 + (void)acpi_ut_release_mutex(ACPI_MTX_NAMESPACE); 652 641 } 653 642 #endif /* ACPI_FUTURE_USAGE */ 654 643
+1 -1
drivers/acpi/acpica/nsdumpdv.c
··· 5 5 *****************************************************************************/ 6 6 7 7 /* 8 - * Copyright (C) 2000 - 2010, Intel Corp. 8 + * Copyright (C) 2000 - 2011, Intel Corp. 9 9 * All rights reserved. 10 10 * 11 11 * Redistribution and use in source and binary forms, with or without
+2 -2
drivers/acpi/acpica/nseval.c
··· 5 5 ******************************************************************************/ 6 6 7 7 /* 8 - * Copyright (C) 2000 - 2010, Intel Corp. 8 + * Copyright (C) 2000 - 2011, Intel Corp. 9 9 * All rights reserved. 10 10 * 11 11 * Redistribution and use in source and binary forms, with or without ··· 389 389 * acpi_gbl_root_node->Object is NULL at PASS1. 390 390 */ 391 391 if ((type == ACPI_TYPE_DEVICE) && parent_node->object) { 392 - method_obj->method.extra.handler = 392 + method_obj->method.dispatch.handler = 393 393 parent_node->object->device.handler; 394 394 } 395 395
+1 -1
drivers/acpi/acpica/nsinit.c
··· 5 5 *****************************************************************************/ 6 6 7 7 /* 8 - * Copyright (C) 2000 - 2010, Intel Corp. 8 + * Copyright (C) 2000 - 2011, Intel Corp. 9 9 * All rights reserved. 10 10 * 11 11 * Redistribution and use in source and binary forms, with or without
+1 -1
drivers/acpi/acpica/nsload.c
··· 5 5 *****************************************************************************/ 6 6 7 7 /* 8 - * Copyright (C) 2000 - 2010, Intel Corp. 8 + * Copyright (C) 2000 - 2011, Intel Corp. 9 9 * All rights reserved. 10 10 * 11 11 * Redistribution and use in source and binary forms, with or without
+1 -1
drivers/acpi/acpica/nsnames.c
··· 5 5 ******************************************************************************/ 6 6 7 7 /* 8 - * Copyright (C) 2000 - 2010, Intel Corp. 8 + * Copyright (C) 2000 - 2011, Intel Corp. 9 9 * All rights reserved. 10 10 * 11 11 * Redistribution and use in source and binary forms, with or without
+1 -1
drivers/acpi/acpica/nsobject.c
··· 6 6 ******************************************************************************/ 7 7 8 8 /* 9 - * Copyright (C) 2000 - 2010, Intel Corp. 9 + * Copyright (C) 2000 - 2011, Intel Corp. 10 10 * All rights reserved. 11 11 * 12 12 * Redistribution and use in source and binary forms, with or without
+1 -1
drivers/acpi/acpica/nsparse.c
··· 5 5 *****************************************************************************/ 6 6 7 7 /* 8 - * Copyright (C) 2000 - 2010, Intel Corp. 8 + * Copyright (C) 2000 - 2011, Intel Corp. 9 9 * All rights reserved. 10 10 * 11 11 * Redistribution and use in source and binary forms, with or without
+1 -1
drivers/acpi/acpica/nspredef.c
··· 6 6 *****************************************************************************/ 7 7 8 8 /* 9 - * Copyright (C) 2000 - 2010, Intel Corp. 9 + * Copyright (C) 2000 - 2011, Intel Corp. 10 10 * All rights reserved. 11 11 * 12 12 * Redistribution and use in source and binary forms, with or without
+1 -1
drivers/acpi/acpica/nsrepair.c
··· 5 5 *****************************************************************************/ 6 6 7 7 /* 8 - * Copyright (C) 2000 - 2010, Intel Corp. 8 + * Copyright (C) 2000 - 2011, Intel Corp. 9 9 * All rights reserved. 10 10 * 11 11 * Redistribution and use in source and binary forms, with or without
+1 -1
drivers/acpi/acpica/nsrepair2.c
··· 6 6 *****************************************************************************/ 7 7 8 8 /* 9 - * Copyright (C) 2000 - 2010, Intel Corp. 9 + * Copyright (C) 2000 - 2011, Intel Corp. 10 10 * All rights reserved. 11 11 * 12 12 * Redistribution and use in source and binary forms, with or without
+1 -1
drivers/acpi/acpica/nssearch.c
··· 5 5 ******************************************************************************/ 6 6 7 7 /* 8 - * Copyright (C) 2000 - 2010, Intel Corp. 8 + * Copyright (C) 2000 - 2011, Intel Corp. 9 9 * All rights reserved. 10 10 * 11 11 * Redistribution and use in source and binary forms, with or without
+1 -1
drivers/acpi/acpica/nsutils.c
··· 6 6 *****************************************************************************/ 7 7 8 8 /* 9 - * Copyright (C) 2000 - 2010, Intel Corp. 9 + * Copyright (C) 2000 - 2011, Intel Corp. 10 10 * All rights reserved. 11 11 * 12 12 * Redistribution and use in source and binary forms, with or without
+1 -1
drivers/acpi/acpica/nswalk.c
··· 5 5 *****************************************************************************/ 6 6 7 7 /* 8 - * Copyright (C) 2000 - 2010, Intel Corp. 8 + * Copyright (C) 2000 - 2011, Intel Corp. 9 9 * All rights reserved. 10 10 * 11 11 * Redistribution and use in source and binary forms, with or without
+1 -1
drivers/acpi/acpica/nsxfeval.c
··· 6 6 ******************************************************************************/ 7 7 8 8 /* 9 - * Copyright (C) 2000 - 2010, Intel Corp. 9 + * Copyright (C) 2000 - 2011, Intel Corp. 10 10 * All rights reserved. 11 11 * 12 12 * Redistribution and use in source and binary forms, with or without
+3 -4
drivers/acpi/acpica/nsxfname.c
··· 6 6 *****************************************************************************/ 7 7 8 8 /* 9 - * Copyright (C) 2000 - 2010, Intel Corp. 9 + * Copyright (C) 2000 - 2011, Intel Corp. 10 10 * All rights reserved. 11 11 * 12 12 * Redistribution and use in source and binary forms, with or without ··· 603 603 method_obj->method.param_count = (u8) 604 604 (method_flags & AML_METHOD_ARG_COUNT); 605 605 606 - method_obj->method.method_flags = (u8) 607 - (method_flags & ~AML_METHOD_ARG_COUNT); 608 - 609 606 if (method_flags & AML_METHOD_SERIALIZED) { 607 + method_obj->method.info_flags = ACPI_METHOD_SERIALIZED; 608 + 610 609 method_obj->method.sync_level = (u8) 611 610 ((method_flags & AML_METHOD_SYNC_LEVEL) >> 4); 612 611 }
+1 -1
drivers/acpi/acpica/nsxfobj.c
··· 6 6 ******************************************************************************/ 7 7 8 8 /* 9 - * Copyright (C) 2000 - 2010, Intel Corp. 9 + * Copyright (C) 2000 - 2011, Intel Corp. 10 10 * All rights reserved. 11 11 * 12 12 * Redistribution and use in source and binary forms, with or without
+1 -1
drivers/acpi/acpica/psargs.c
··· 5 5 *****************************************************************************/ 6 6 7 7 /* 8 - * Copyright (C) 2000 - 2010, Intel Corp. 8 + * Copyright (C) 2000 - 2011, Intel Corp. 9 9 * All rights reserved. 10 10 * 11 11 * Redistribution and use in source and binary forms, with or without
+2 -2
drivers/acpi/acpica/psloop.c
··· 5 5 *****************************************************************************/ 6 6 7 7 /* 8 - * Copyright (C) 2000 - 2010, Intel Corp. 8 + * Copyright (C) 2000 - 2011, Intel Corp. 9 9 * All rights reserved. 10 10 * 11 11 * Redistribution and use in source and binary forms, with or without ··· 655 655 method_obj->method.aml_start = aml_start; 656 656 method_obj->method.aml_length = aml_length; 657 657 method_obj->method.owner_id = owner_id; 658 - method_obj->method.flags |= AOPOBJ_MODULE_LEVEL; 658 + method_obj->method.info_flags |= ACPI_METHOD_MODULE_LEVEL; 659 659 660 660 /* 661 661 * Save the parent node in next_object. This is cheating, but we
+1 -1
drivers/acpi/acpica/psopcode.c
··· 5 5 *****************************************************************************/ 6 6 7 7 /* 8 - * Copyright (C) 2000 - 2010, Intel Corp. 8 + * Copyright (C) 2000 - 2011, Intel Corp. 9 9 * All rights reserved. 10 10 * 11 11 * Redistribution and use in source and binary forms, with or without
+9 -18
drivers/acpi/acpica/psparse.c
··· 5 5 *****************************************************************************/ 6 6 7 7 /* 8 - * Copyright (C) 2000 - 2010, Intel Corp. 8 + * Copyright (C) 2000 - 2011, Intel Corp. 9 9 * All rights reserved. 10 10 * 11 11 * Redistribution and use in source and binary forms, with or without ··· 55 55 #include "acparser.h" 56 56 #include "acdispat.h" 57 57 #include "amlcode.h" 58 - #include "acnamesp.h" 59 58 #include "acinterp.h" 60 59 61 60 #define _COMPONENT ACPI_PARSER ··· 538 539 /* Check for possible multi-thread reentrancy problem */ 539 540 540 541 if ((status == AE_ALREADY_EXISTS) && 541 - (!walk_state->method_desc->method.mutex)) { 542 - ACPI_INFO((AE_INFO, 543 - "Marking method %4.4s as Serialized because of AE_ALREADY_EXISTS error", 544 - walk_state->method_node->name. 545 - ascii)); 546 - 542 + (!(walk_state->method_desc->method. 543 + info_flags & ACPI_METHOD_SERIALIZED))) { 547 544 /* 548 - * Method tried to create an object twice. The probable cause is 549 - * that the method cannot handle reentrancy. 550 - * 551 - * The method is marked not_serialized, but it tried to create 552 - * a named object, causing the second thread entrance to fail. 553 - * Workaround this problem by marking the method permanently 554 - * as Serialized. 545 + * Method is not serialized and tried to create an object 546 + * twice. The probable cause is that the method cannot 547 + * handle reentrancy. Mark as "pending serialized" now, and 548 + * then mark "serialized" when the last thread exits. 555 549 */ 556 - walk_state->method_desc->method.method_flags |= 557 - AML_METHOD_SERIALIZED; 558 - walk_state->method_desc->method.sync_level = 0; 550 + walk_state->method_desc->method.info_flags |= 551 + ACPI_METHOD_SERIALIZED_PENDING; 559 552 } 560 553 } 561 554
+1 -1
drivers/acpi/acpica/psscope.c
··· 5 5 *****************************************************************************/ 6 6 7 7 /* 8 - * Copyright (C) 2000 - 2010, Intel Corp. 8 + * Copyright (C) 2000 - 2011, Intel Corp. 9 9 * All rights reserved. 10 10 * 11 11 * Redistribution and use in source and binary forms, with or without
+1 -1
drivers/acpi/acpica/pstree.c
··· 5 5 *****************************************************************************/ 6 6 7 7 /* 8 - * Copyright (C) 2000 - 2010, Intel Corp. 8 + * Copyright (C) 2000 - 2011, Intel Corp. 9 9 * All rights reserved. 10 10 * 11 11 * Redistribution and use in source and binary forms, with or without
+1 -1
drivers/acpi/acpica/psutils.c
··· 5 5 *****************************************************************************/ 6 6 7 7 /* 8 - * Copyright (C) 2000 - 2010, Intel Corp. 8 + * Copyright (C) 2000 - 2011, Intel Corp. 9 9 * All rights reserved. 10 10 * 11 11 * Redistribution and use in source and binary forms, with or without
+1 -1
drivers/acpi/acpica/pswalk.c
··· 5 5 *****************************************************************************/ 6 6 7 7 /* 8 - * Copyright (C) 2000 - 2010, Intel Corp. 8 + * Copyright (C) 2000 - 2011, Intel Corp. 9 9 * All rights reserved. 10 10 * 11 11 * Redistribution and use in source and binary forms, with or without
+4 -5
drivers/acpi/acpica/psxface.c
··· 5 5 *****************************************************************************/ 6 6 7 7 /* 8 - * Copyright (C) 2000 - 2010, Intel Corp. 8 + * Copyright (C) 2000 - 2011, Intel Corp. 9 9 * All rights reserved. 10 10 * 11 11 * Redistribution and use in source and binary forms, with or without ··· 47 47 #include "acdispat.h" 48 48 #include "acinterp.h" 49 49 #include "actables.h" 50 - #include "amlcode.h" 51 50 52 51 #define _COMPONENT ACPI_PARSER 53 52 ACPI_MODULE_NAME("psxface") ··· 284 285 goto cleanup; 285 286 } 286 287 287 - if (info->obj_desc->method.flags & AOPOBJ_MODULE_LEVEL) { 288 + if (info->obj_desc->method.info_flags & ACPI_METHOD_MODULE_LEVEL) { 288 289 walk_state->parse_flags |= ACPI_PARSE_MODULE_LEVEL; 289 290 } 290 291 291 292 /* Invoke an internal method if necessary */ 292 293 293 - if (info->obj_desc->method.method_flags & AML_METHOD_INTERNAL_ONLY) { 294 + if (info->obj_desc->method.info_flags & ACPI_METHOD_INTERNAL_ONLY) { 294 295 status = 295 - info->obj_desc->method.extra.implementation(walk_state); 296 + info->obj_desc->method.dispatch.implementation(walk_state); 296 297 info->return_object = walk_state->return_desc; 297 298 298 299 /* Cleanup states */
+1 -1
drivers/acpi/acpica/rsaddr.c
··· 5 5 ******************************************************************************/ 6 6 7 7 /* 8 - * Copyright (C) 2000 - 2010, Intel Corp. 8 + * Copyright (C) 2000 - 2011, Intel Corp. 9 9 * All rights reserved. 10 10 * 11 11 * Redistribution and use in source and binary forms, with or without
+1 -1
drivers/acpi/acpica/rscalc.c
··· 5 5 ******************************************************************************/ 6 6 7 7 /* 8 - * Copyright (C) 2000 - 2010, Intel Corp. 8 + * Copyright (C) 2000 - 2011, Intel Corp. 9 9 * All rights reserved. 10 10 * 11 11 * Redistribution and use in source and binary forms, with or without
+1 -1
drivers/acpi/acpica/rscreate.c
··· 5 5 ******************************************************************************/ 6 6 7 7 /* 8 - * Copyright (C) 2000 - 2010, Intel Corp. 8 + * Copyright (C) 2000 - 2011, Intel Corp. 9 9 * All rights reserved. 10 10 * 11 11 * Redistribution and use in source and binary forms, with or without
+1 -1
drivers/acpi/acpica/rsdump.c
··· 5 5 ******************************************************************************/ 6 6 7 7 /* 8 - * Copyright (C) 2000 - 2010, Intel Corp. 8 + * Copyright (C) 2000 - 2011, Intel Corp. 9 9 * All rights reserved. 10 10 * 11 11 * Redistribution and use in source and binary forms, with or without
+1 -1
drivers/acpi/acpica/rsinfo.c
··· 5 5 ******************************************************************************/ 6 6 7 7 /* 8 - * Copyright (C) 2000 - 2010, Intel Corp. 8 + * Copyright (C) 2000 - 2011, Intel Corp. 9 9 * All rights reserved. 10 10 * 11 11 * Redistribution and use in source and binary forms, with or without
+1 -1
drivers/acpi/acpica/rsio.c
··· 5 5 ******************************************************************************/ 6 6 7 7 /* 8 - * Copyright (C) 2000 - 2010, Intel Corp. 8 + * Copyright (C) 2000 - 2011, Intel Corp. 9 9 * All rights reserved. 10 10 * 11 11 * Redistribution and use in source and binary forms, with or without
+1 -1
drivers/acpi/acpica/rsirq.c
··· 5 5 ******************************************************************************/ 6 6 7 7 /* 8 - * Copyright (C) 2000 - 2010, Intel Corp. 8 + * Copyright (C) 2000 - 2011, Intel Corp. 9 9 * All rights reserved. 10 10 * 11 11 * Redistribution and use in source and binary forms, with or without
+1 -1
drivers/acpi/acpica/rslist.c
··· 5 5 ******************************************************************************/ 6 6 7 7 /* 8 - * Copyright (C) 2000 - 2010, Intel Corp. 8 + * Copyright (C) 2000 - 2011, Intel Corp. 9 9 * All rights reserved. 10 10 * 11 11 * Redistribution and use in source and binary forms, with or without
+1 -1
drivers/acpi/acpica/rsmemory.c
··· 5 5 ******************************************************************************/ 6 6 7 7 /* 8 - * Copyright (C) 2000 - 2010, Intel Corp. 8 + * Copyright (C) 2000 - 2011, Intel Corp. 9 9 * All rights reserved. 10 10 * 11 11 * Redistribution and use in source and binary forms, with or without
+1 -1
drivers/acpi/acpica/rsmisc.c
··· 5 5 ******************************************************************************/ 6 6 7 7 /* 8 - * Copyright (C) 2000 - 2010, Intel Corp. 8 + * Copyright (C) 2000 - 2011, Intel Corp. 9 9 * All rights reserved. 10 10 * 11 11 * Redistribution and use in source and binary forms, with or without
+1 -1
drivers/acpi/acpica/rsutils.c
··· 5 5 ******************************************************************************/ 6 6 7 7 /* 8 - * Copyright (C) 2000 - 2010, Intel Corp. 8 + * Copyright (C) 2000 - 2011, Intel Corp. 9 9 * All rights reserved. 10 10 * 11 11 * Redistribution and use in source and binary forms, with or without
+1 -1
drivers/acpi/acpica/rsxface.c
··· 5 5 ******************************************************************************/ 6 6 7 7 /* 8 - * Copyright (C) 2000 - 2010, Intel Corp. 8 + * Copyright (C) 2000 - 2011, Intel Corp. 9 9 * All rights reserved. 10 10 * 11 11 * Redistribution and use in source and binary forms, with or without
+1 -1
drivers/acpi/acpica/tbfadt.c
··· 5 5 *****************************************************************************/ 6 6 7 7 /* 8 - * Copyright (C) 2000 - 2010, Intel Corp. 8 + * Copyright (C) 2000 - 2011, Intel Corp. 9 9 * All rights reserved. 10 10 * 11 11 * Redistribution and use in source and binary forms, with or without
+1 -1
drivers/acpi/acpica/tbfind.c
··· 5 5 *****************************************************************************/ 6 6 7 7 /* 8 - * Copyright (C) 2000 - 2010, Intel Corp. 8 + * Copyright (C) 2000 - 2011, Intel Corp. 9 9 * All rights reserved. 10 10 * 11 11 * Redistribution and use in source and binary forms, with or without
+1 -1
drivers/acpi/acpica/tbinstal.c
··· 5 5 *****************************************************************************/ 6 6 7 7 /* 8 - * Copyright (C) 2000 - 2010, Intel Corp. 8 + * Copyright (C) 2000 - 2011, Intel Corp. 9 9 * All rights reserved. 10 10 * 11 11 * Redistribution and use in source and binary forms, with or without
+1 -1
drivers/acpi/acpica/tbutils.c
··· 5 5 *****************************************************************************/ 6 6 7 7 /* 8 - * Copyright (C) 2000 - 2010, Intel Corp. 8 + * Copyright (C) 2000 - 2011, Intel Corp. 9 9 * All rights reserved. 10 10 * 11 11 * Redistribution and use in source and binary forms, with or without
+1 -1
drivers/acpi/acpica/tbxface.c
··· 6 6 *****************************************************************************/ 7 7 8 8 /* 9 - * Copyright (C) 2000 - 2010, Intel Corp. 9 + * Copyright (C) 2000 - 2011, Intel Corp. 10 10 * All rights reserved. 11 11 * 12 12 * Redistribution and use in source and binary forms, with or without
+1 -1
drivers/acpi/acpica/tbxfroot.c
··· 5 5 *****************************************************************************/ 6 6 7 7 /* 8 - * Copyright (C) 2000 - 2010, Intel Corp. 8 + * Copyright (C) 2000 - 2011, Intel Corp. 9 9 * All rights reserved. 10 10 * 11 11 * Redistribution and use in source and binary forms, with or without
+1 -1
drivers/acpi/acpica/utalloc.c
··· 5 5 *****************************************************************************/ 6 6 7 7 /* 8 - * Copyright (C) 2000 - 2010, Intel Corp. 8 + * Copyright (C) 2000 - 2011, Intel Corp. 9 9 * All rights reserved. 10 10 * 11 11 * Redistribution and use in source and binary forms, with or without
+1 -1
drivers/acpi/acpica/utcopy.c
··· 5 5 *****************************************************************************/ 6 6 7 7 /* 8 - * Copyright (C) 2000 - 2010, Intel Corp. 8 + * Copyright (C) 2000 - 2011, Intel Corp. 9 9 * All rights reserved. 10 10 * 11 11 * Redistribution and use in source and binary forms, with or without
+1 -1
drivers/acpi/acpica/utdebug.c
··· 5 5 *****************************************************************************/ 6 6 7 7 /* 8 - * Copyright (C) 2000 - 2010, Intel Corp. 8 + * Copyright (C) 2000 - 2011, Intel Corp. 9 9 * All rights reserved. 10 10 * 11 11 * Redistribution and use in source and binary forms, with or without
+1 -1
drivers/acpi/acpica/utdelete.c
··· 5 5 ******************************************************************************/ 6 6 7 7 /* 8 - * Copyright (C) 2000 - 2010, Intel Corp. 8 + * Copyright (C) 2000 - 2011, Intel Corp. 9 9 * All rights reserved. 10 10 * 11 11 * Redistribution and use in source and binary forms, with or without
+1 -1
drivers/acpi/acpica/uteval.c
··· 5 5 *****************************************************************************/ 6 6 7 7 /* 8 - * Copyright (C) 2000 - 2010, Intel Corp. 8 + * Copyright (C) 2000 - 2011, Intel Corp. 9 9 * All rights reserved. 10 10 * 11 11 * Redistribution and use in source and binary forms, with or without
+1 -1
drivers/acpi/acpica/utglobal.c
··· 5 5 *****************************************************************************/ 6 6 7 7 /* 8 - * Copyright (C) 2000 - 2010, Intel Corp. 8 + * Copyright (C) 2000 - 2011, Intel Corp. 9 9 * All rights reserved. 10 10 * 11 11 * Redistribution and use in source and binary forms, with or without
+1 -1
drivers/acpi/acpica/utids.c
··· 5 5 *****************************************************************************/ 6 6 7 7 /* 8 - * Copyright (C) 2000 - 2010, Intel Corp. 8 + * Copyright (C) 2000 - 2011, Intel Corp. 9 9 * All rights reserved. 10 10 * 11 11 * Redistribution and use in source and binary forms, with or without
+1 -1
drivers/acpi/acpica/utinit.c
··· 5 5 *****************************************************************************/ 6 6 7 7 /* 8 - * Copyright (C) 2000 - 2010, Intel Corp. 8 + * Copyright (C) 2000 - 2011, Intel Corp. 9 9 * All rights reserved. 10 10 * 11 11 * Redistribution and use in source and binary forms, with or without
+1 -1
drivers/acpi/acpica/utlock.c
··· 5 5 *****************************************************************************/ 6 6 7 7 /* 8 - * Copyright (C) 2000 - 2010, Intel Corp. 8 + * Copyright (C) 2000 - 2011, Intel Corp. 9 9 * All rights reserved. 10 10 * 11 11 * Redistribution and use in source and binary forms, with or without
+1 -1
drivers/acpi/acpica/utmath.c
··· 5 5 ******************************************************************************/ 6 6 7 7 /* 8 - * Copyright (C) 2000 - 2010, Intel Corp. 8 + * Copyright (C) 2000 - 2011, Intel Corp. 9 9 * All rights reserved. 10 10 * 11 11 * Redistribution and use in source and binary forms, with or without
+1 -1
drivers/acpi/acpica/utmisc.c
··· 5 5 ******************************************************************************/ 6 6 7 7 /* 8 - * Copyright (C) 2000 - 2010, Intel Corp. 8 + * Copyright (C) 2000 - 2011, Intel Corp. 9 9 * All rights reserved. 10 10 * 11 11 * Redistribution and use in source and binary forms, with or without
+1 -1
drivers/acpi/acpica/utmutex.c
··· 5 5 ******************************************************************************/ 6 6 7 7 /* 8 - * Copyright (C) 2000 - 2010, Intel Corp. 8 + * Copyright (C) 2000 - 2011, Intel Corp. 9 9 * All rights reserved. 10 10 * 11 11 * Redistribution and use in source and binary forms, with or without
+1 -1
drivers/acpi/acpica/utobject.c
··· 5 5 *****************************************************************************/ 6 6 7 7 /* 8 - * Copyright (C) 2000 - 2010, Intel Corp. 8 + * Copyright (C) 2000 - 2011, Intel Corp. 9 9 * All rights reserved. 10 10 * 11 11 * Redistribution and use in source and binary forms, with or without
+1 -1
drivers/acpi/acpica/utosi.c
··· 5 5 *****************************************************************************/ 6 6 7 7 /* 8 - * Copyright (C) 2000 - 2010, Intel Corp. 8 + * Copyright (C) 2000 - 2011, Intel Corp. 9 9 * All rights reserved. 10 10 * 11 11 * Redistribution and use in source and binary forms, with or without
+1 -1
drivers/acpi/acpica/utresrc.c
··· 5 5 ******************************************************************************/ 6 6 7 7 /* 8 - * Copyright (C) 2000 - 2010, Intel Corp. 8 + * Copyright (C) 2000 - 2011, Intel Corp. 9 9 * All rights reserved. 10 10 * 11 11 * Redistribution and use in source and binary forms, with or without
+1 -1
drivers/acpi/acpica/utstate.c
··· 5 5 ******************************************************************************/ 6 6 7 7 /* 8 - * Copyright (C) 2000 - 2010, Intel Corp. 8 + * Copyright (C) 2000 - 2011, Intel Corp. 9 9 * All rights reserved. 10 10 * 11 11 * Redistribution and use in source and binary forms, with or without
+1 -1
drivers/acpi/acpica/utxface.c
··· 5 5 *****************************************************************************/ 6 6 7 7 /* 8 - * Copyright (C) 2000 - 2010, Intel Corp. 8 + * Copyright (C) 2000 - 2011, Intel Corp. 9 9 * All rights reserved. 10 10 * 11 11 * Redistribution and use in source and binary forms, with or without
+1 -1
drivers/acpi/acpica/utxferror.c
··· 5 5 ******************************************************************************/ 6 6 7 7 /* 8 - * Copyright (C) 2000 - 2010, Intel Corp. 8 + * Copyright (C) 2000 - 2011, Intel Corp. 9 9 * All rights reserved. 10 10 * 11 11 * Redistribution and use in source and binary forms, with or without
-1
drivers/acpi/battery.c
··· 998 998 if (!device) 999 999 return -EINVAL; 1000 1000 battery = acpi_driver_data(device); 1001 - acpi_battery_refresh(battery); 1002 1001 battery->update_time = 0; 1003 1002 acpi_battery_update(battery); 1004 1003 return 0;
+4 -3
drivers/acpi/nvs.c
··· 12 12 #include <linux/mm.h> 13 13 #include <linux/slab.h> 14 14 #include <linux/acpi.h> 15 + #include <linux/acpi_io.h> 15 16 #include <acpi/acpiosxf.h> 16 17 17 18 /* ··· 81 80 free_page((unsigned long)entry->data); 82 81 entry->data = NULL; 83 82 if (entry->kaddr) { 84 - acpi_os_unmap_memory(entry->kaddr, entry->size); 83 + iounmap(entry->kaddr); 85 84 entry->kaddr = NULL; 86 85 } 87 86 } ··· 115 114 116 115 list_for_each_entry(entry, &nvs_list, node) 117 116 if (entry->data) { 118 - entry->kaddr = acpi_os_map_memory(entry->phys_start, 119 - entry->size); 117 + entry->kaddr = acpi_os_ioremap(entry->phys_start, 118 + entry->size); 120 119 if (!entry->kaddr) { 121 120 suspend_nvs_free(); 122 121 return -ENOMEM;
+7 -5
drivers/acpi/osl.c
··· 38 38 #include <linux/workqueue.h> 39 39 #include <linux/nmi.h> 40 40 #include <linux/acpi.h> 41 + #include <linux/acpi_io.h> 41 42 #include <linux/efi.h> 42 43 #include <linux/ioport.h> 43 44 #include <linux/list.h> ··· 303 302 acpi_os_map_memory(acpi_physical_address phys, acpi_size size) 304 303 { 305 304 struct acpi_ioremap *map, *tmp_map; 306 - unsigned long flags, pg_sz; 305 + unsigned long flags; 307 306 void __iomem *virt; 308 - phys_addr_t pg_off; 307 + acpi_physical_address pg_off; 308 + acpi_size pg_sz; 309 309 310 310 if (phys > ULONG_MAX) { 311 311 printk(KERN_ERR PREFIX "Cannot map memory that high\n"); ··· 322 320 323 321 pg_off = round_down(phys, PAGE_SIZE); 324 322 pg_sz = round_up(phys + size, PAGE_SIZE) - pg_off; 325 - virt = ioremap_cache(pg_off, pg_sz); 323 + virt = acpi_os_ioremap(pg_off, pg_sz); 326 324 if (!virt) { 327 325 kfree(map); 328 326 return NULL; ··· 644 642 virt_addr = acpi_map_vaddr_lookup(phys_addr, size); 645 643 rcu_read_unlock(); 646 644 if (!virt_addr) { 647 - virt_addr = ioremap_cache(phys_addr, size); 645 + virt_addr = acpi_os_ioremap(phys_addr, size); 648 646 unmap = 1; 649 647 } 650 648 if (!value) ··· 680 678 virt_addr = acpi_map_vaddr_lookup(phys_addr, size); 681 679 rcu_read_unlock(); 682 680 if (!virt_addr) { 683 - virt_addr = ioremap_cache(phys_addr, size); 681 + virt_addr = acpi_os_ioremap(phys_addr, size); 684 682 unmap = 1; 685 683 } 686 684
+1 -1
drivers/acpi/sleep.c
··· 166 166 u32 acpi_state = acpi_target_sleep_state; 167 167 168 168 acpi_ec_unblock_transactions(); 169 + suspend_nvs_free(); 169 170 170 171 if (acpi_state == ACPI_STATE_S0) 171 172 return; ··· 187 186 */ 188 187 static void acpi_pm_end(void) 189 188 { 190 - suspend_nvs_free(); 191 189 /* 192 190 * This is necessary in case acpi_pm_finish() is not called during a 193 191 * failing transition to a sleep state.
+1 -1
drivers/ata/Kconfig
··· 783 783 784 784 config PATA_PLATFORM 785 785 tristate "Generic platform device PATA support" 786 - depends on EMBEDDED || PPC || HAVE_PATA_PLATFORM 786 + depends on EXPERT || PPC || HAVE_PATA_PLATFORM 787 787 help 788 788 This option enables support for generic directly connected ATA 789 789 devices commonly found on embedded systems.
+1 -1
drivers/base/Kconfig
··· 70 70 If unsure say Y here. 71 71 72 72 config FW_LOADER 73 - tristate "Userspace firmware loading support" if EMBEDDED 73 + tristate "Userspace firmware loading support" if EXPERT 74 74 default y 75 75 ---help--- 76 76 This option is provided for the case where no in-kernel-tree modules
+6 -6
drivers/char/Kconfig
··· 5 5 menu "Character devices" 6 6 7 7 config VT 8 - bool "Virtual terminal" if EMBEDDED 8 + bool "Virtual terminal" if EXPERT 9 9 depends on !S390 10 10 select INPUT 11 11 default y ··· 39 39 config CONSOLE_TRANSLATIONS 40 40 depends on VT 41 41 default y 42 - bool "Enable character translations in console" if EMBEDDED 42 + bool "Enable character translations in console" if EXPERT 43 43 ---help--- 44 44 This enables support for font mapping and Unicode translation 45 45 on virtual consoles. 46 46 47 47 config VT_CONSOLE 48 - bool "Support for console on virtual terminal" if EMBEDDED 48 + bool "Support for console on virtual terminal" if EXPERT 49 49 depends on VT 50 50 default y 51 51 ---help--- ··· 426 426 If you have an SGI Altix with an attached SABrick 427 427 say Y or M here, otherwise say N. 428 428 429 - source "drivers/serial/Kconfig" 429 + source "drivers/tty/serial/Kconfig" 430 430 431 431 config UNIX98_PTYS 432 - bool "Unix98 PTY support" if EMBEDDED 432 + bool "Unix98 PTY support" if EXPERT 433 433 default y 434 434 ---help--- 435 435 A pseudo terminal (PTY) is a software device consisting of two ··· 495 495 496 496 config TTY_PRINTK 497 497 bool "TTY driver to output user messages via printk" 498 - depends on EMBEDDED 498 + depends on EXPERT 499 499 default n 500 500 ---help--- 501 501 If you say Y here, the support for writing user messages (i.e.
-13
drivers/char/Makefile
··· 30 30 obj-$(CONFIG_AMIGA_BUILTIN_SERIAL) += amiserial.o 31 31 obj-$(CONFIG_SX) += sx.o generic_serial.o 32 32 obj-$(CONFIG_RIO) += rio/ generic_serial.o 33 - obj-$(CONFIG_HVC_CONSOLE) += hvc_vio.o hvsi.o 34 - obj-$(CONFIG_HVC_ISERIES) += hvc_iseries.o 35 - obj-$(CONFIG_HVC_RTAS) += hvc_rtas.o 36 - obj-$(CONFIG_HVC_TILE) += hvc_tile.o 37 - obj-$(CONFIG_HVC_DCC) += hvc_dcc.o 38 - obj-$(CONFIG_HVC_BEAT) += hvc_beat.o 39 - obj-$(CONFIG_HVC_DRIVER) += hvc_console.o 40 - obj-$(CONFIG_HVC_IRQ) += hvc_irq.o 41 - obj-$(CONFIG_HVC_XEN) += hvc_xen.o 42 - obj-$(CONFIG_HVC_IUCV) += hvc_iucv.o 43 - obj-$(CONFIG_HVC_UDBG) += hvc_udbg.o 44 - obj-$(CONFIG_VIRTIO_CONSOLE) += virtio_console.o 45 33 obj-$(CONFIG_RAW_DRIVER) += raw.o 46 34 obj-$(CONFIG_SGI_SNSC) += snsc.o snsc_event.o 47 35 obj-$(CONFIG_MSPEC) += mspec.o 48 36 obj-$(CONFIG_MMTIMER) += mmtimer.o 49 37 obj-$(CONFIG_UV_MMTIMER) += uv_mmtimer.o 50 38 obj-$(CONFIG_VIOTAPE) += viotape.o 51 - obj-$(CONFIG_HVCS) += hvcs.o 52 39 obj-$(CONFIG_IBM_BSR) += bsr.o 53 40 obj-$(CONFIG_SGI_MBCS) += mbcs.o 54 41 obj-$(CONFIG_BRIQ_PANEL) += briq_panel.o
drivers/char/hvc_beat.c drivers/tty/hvc/hvc_beat.c
drivers/char/hvc_console.c drivers/tty/hvc/hvc_console.c
drivers/char/hvc_console.h drivers/tty/hvc/hvc_console.h
drivers/char/hvc_dcc.c drivers/tty/hvc/hvc_dcc.c
drivers/char/hvc_irq.c drivers/tty/hvc/hvc_irq.c
drivers/char/hvc_iseries.c drivers/tty/hvc/hvc_iseries.c
drivers/char/hvc_iucv.c drivers/tty/hvc/hvc_iucv.c
drivers/char/hvc_rtas.c drivers/tty/hvc/hvc_rtas.c
drivers/char/hvc_tile.c drivers/tty/hvc/hvc_tile.c
drivers/char/hvc_udbg.c drivers/tty/hvc/hvc_udbg.c
drivers/char/hvc_vio.c drivers/tty/hvc/hvc_vio.c
drivers/char/hvc_xen.c drivers/tty/hvc/hvc_xen.c
drivers/char/hvcs.c drivers/tty/hvc/hvcs.c
drivers/char/hvsi.c drivers/tty/hvc/hvsi.c
drivers/char/virtio_console.c drivers/tty/hvc/virtio_console.c
+1 -1
drivers/cpufreq/Kconfig
··· 71 71 72 72 config CPU_FREQ_DEFAULT_GOV_POWERSAVE 73 73 bool "powersave" 74 - depends on EMBEDDED 74 + depends on EXPERT 75 75 select CPU_FREQ_GOV_POWERSAVE 76 76 help 77 77 Use the CPUFreq governor 'powersave' as default. This sets
+2 -4
drivers/firewire/Kconfig
··· 49 49 configuration section. 50 50 51 51 config FIREWIRE_NET 52 - tristate "IP networking over 1394 (EXPERIMENTAL)" 53 - depends on FIREWIRE && INET && EXPERIMENTAL 52 + tristate "IP networking over 1394" 53 + depends on FIREWIRE && INET 54 54 help 55 55 This enables IPv4 over IEEE 1394, providing IP connectivity with 56 56 other implementations of RFC 2734 as found on several operating 57 57 systems. Multicast support is currently limited. 58 - 59 - NOTE, this driver is not stable yet! 60 58 61 59 To compile this driver as a module, say M here: The module will be 62 60 called firewire-net.
+9 -2
drivers/firewire/core-card.c
··· 75 75 #define BIB_IRMC ((1) << 31) 76 76 #define NODE_CAPABILITIES 0x0c0083c0 /* per IEEE 1394 clause 8.3.2.6.5.2 */ 77 77 78 + #define CANON_OUI 0x000085 79 + 78 80 static void generate_config_rom(struct fw_card *card, __be32 *config_rom) 79 81 { 80 82 struct fw_descriptor *desc; ··· 286 284 bool root_device_is_running; 287 285 bool root_device_is_cmc; 288 286 bool irm_is_1394_1995_only; 287 + bool keep_this_irm; 289 288 290 289 spin_lock_irq(&card->lock); 291 290 ··· 307 304 irm_device = card->irm_node->data; 308 305 irm_is_1394_1995_only = irm_device && irm_device->config_rom && 309 306 (irm_device->config_rom[2] & 0x000000f0) == 0; 307 + 308 + /* Canon MV5i works unreliably if it is not root node. */ 309 + keep_this_irm = irm_device && irm_device->config_rom && 310 + irm_device->config_rom[3] >> 8 == CANON_OUI; 310 311 311 312 root_id = root_node->node_id; 312 313 irm_id = card->irm_node->node_id; ··· 340 333 goto pick_me; 341 334 } 342 335 343 - if (irm_is_1394_1995_only) { 336 + if (irm_is_1394_1995_only && !keep_this_irm) { 344 337 new_root_id = local_id; 345 338 fw_notify("%s, making local node (%02x) root.\n", 346 339 "IRM is not 1394a compliant", new_root_id); ··· 389 382 390 383 spin_lock_irq(&card->lock); 391 384 392 - if (rcode != RCODE_COMPLETE) { 385 + if (rcode != RCODE_COMPLETE && !keep_this_irm) { 393 386 /* 394 387 * The lock request failed, maybe the IRM 395 388 * isn't really IRM capable after all. Let's
+8 -1
drivers/firewire/net.c
··· 191 191 struct fwnet_device *dev; 192 192 u64 guid; 193 193 u64 fifo; 194 + __be32 ip; 194 195 195 196 /* guarded by dev->lock */ 196 197 struct list_head pd_list; /* received partial datagrams */ ··· 571 570 peer->speed = sspd; 572 571 if (peer->max_payload > max_payload) 573 572 peer->max_payload = max_payload; 573 + 574 + peer->ip = arp1394->sip; 574 575 } 575 576 spin_unlock_irqrestore(&dev->lock, flags); 576 577 ··· 1473 1470 peer->dev = dev; 1474 1471 peer->guid = (u64)device->config_rom[3] << 32 | device->config_rom[4]; 1475 1472 peer->fifo = FWNET_NO_FIFO_ADDR; 1473 + peer->ip = 0; 1476 1474 INIT_LIST_HEAD(&peer->pd_list); 1477 1475 peer->pdg_size = 0; 1478 1476 peer->datagram_label = 0; ··· 1593 1589 1594 1590 mutex_lock(&fwnet_device_mutex); 1595 1591 1592 + net = dev->netdev; 1593 + if (net && peer->ip) 1594 + arp_invalidate(net, peer->ip); 1595 + 1596 1596 fwnet_remove_peer(peer, dev); 1597 1597 1598 1598 if (list_empty(&dev->peer_list)) { 1599 - net = dev->netdev; 1600 1599 unregister_netdev(net); 1601 1600 1602 1601 if (dev->local_fifo != FWNET_NO_FIFO_ADDR)
+1 -1
drivers/firmware/Kconfig
··· 27 27 using the kernel parameter 'edd={on|skipmbr|off}'. 28 28 29 29 config FIRMWARE_MEMMAP 30 - bool "Add firmware-provided memory map to sysfs" if EMBEDDED 30 + bool "Add firmware-provided memory map to sysfs" if EXPERT 31 31 default X86 32 32 help 33 33 Add the firmware-provided (unmodified) memory map to /sys/firmware/memmap.
+1 -1
drivers/gpu/drm/Kconfig
··· 23 23 tristate 24 24 depends on DRM 25 25 select FB 26 - select FRAMEBUFFER_CONSOLE if !EMBEDDED 26 + select FRAMEBUFFER_CONSOLE if !EXPERT 27 27 help 28 28 FB and CRTC helpers for KMS drivers. 29 29
+2 -2
drivers/gpu/drm/drm_fb_helper.c
··· 1533 1533 } 1534 1534 EXPORT_SYMBOL(drm_fb_helper_hotplug_event); 1535 1535 1536 - /* The Kconfig DRM_KMS_HELPER selects FRAMEBUFFER_CONSOLE (if !EMBEDDED) 1536 + /* The Kconfig DRM_KMS_HELPER selects FRAMEBUFFER_CONSOLE (if !EXPERT) 1537 1537 * but the module doesn't depend on any fb console symbols. At least 1538 1538 * attempt to load fbcon to avoid leaving the system without a usable console. 1539 1539 */ 1540 - #if defined(CONFIG_FRAMEBUFFER_CONSOLE_MODULE) && !defined(CONFIG_EMBEDDED) 1540 + #if defined(CONFIG_FRAMEBUFFER_CONSOLE_MODULE) && !defined(CONFIG_EXPERT) 1541 1541 static int __init drm_fb_helper_modinit(void) 1542 1542 { 1543 1543 const char *name = "fbcon";
+3 -2
drivers/gpu/drm/i915/intel_ringbuffer.c
··· 928 928 929 929 int intel_wait_ring_buffer(struct intel_ring_buffer *ring, int n) 930 930 { 931 + int reread = 0; 931 932 struct drm_device *dev = ring->dev; 932 933 struct drm_i915_private *dev_priv = dev->dev_private; 933 934 unsigned long end; ··· 941 940 * fallback to the slow and accurate path. 942 941 */ 943 942 head = intel_read_status_page(ring, 4); 944 - if (head < ring->actual_head) 943 + if (reread) 945 944 head = I915_READ_HEAD(ring); 946 - ring->actual_head = head; 947 945 ring->head = head & HEAD_ADDR; 948 946 ring->space = ring->head - (ring->tail + 8); 949 947 if (ring->space < 0) ··· 961 961 msleep(1); 962 962 if (atomic_read(&dev_priv->mm.wedged)) 963 963 return -EAGAIN; 964 + reread = 1; 964 965 } while (!time_after(jiffies, end)); 965 966 trace_i915_ring_wait_end (dev); 966 967 return -EBUSY;
-1
drivers/gpu/drm/i915/intel_ringbuffer.h
··· 47 47 struct drm_device *dev; 48 48 struct drm_i915_gem_object *obj; 49 49 50 - u32 actual_head; 51 50 u32 head; 52 51 u32 tail; 53 52 int space;
+1 -1
drivers/gpu/drm/nouveau/Kconfig
··· 8 8 select FB_CFB_COPYAREA 9 9 select FB_CFB_IMAGEBLIT 10 10 select FB 11 - select FRAMEBUFFER_CONSOLE if !EMBEDDED 11 + select FRAMEBUFFER_CONSOLE if !EXPERT 12 12 select FB_BACKLIGHT if DRM_NOUVEAU_BACKLIGHT 13 13 select ACPI_VIDEO if ACPI && X86 && BACKLIGHT_CLASS_DEVICE && VIDEO_OUTPUT_CONTROL && INPUT 14 14 help
+1 -1
drivers/gpu/vga/Kconfig
··· 1 1 config VGA_ARB 2 - bool "VGA Arbitration" if EMBEDDED 2 + bool "VGA Arbitration" if EXPERT 3 3 default y 4 4 depends on PCI 5 5 help
+32 -32
drivers/hid/Kconfig
··· 62 62 Support for 3M PCT touch screens. 63 63 64 64 config HID_A4TECH 65 - tristate "A4 tech mice" if EMBEDDED 65 + tristate "A4 tech mice" if EXPERT 66 66 depends on USB_HID 67 - default !EMBEDDED 67 + default !EXPERT 68 68 ---help--- 69 69 Support for A4 tech X5 and WOP-35 / Trust 450L mice. 70 70 ··· 77 77 game controllers. 78 78 79 79 config HID_APPLE 80 - tristate "Apple {i,Power,Mac}Books" if EMBEDDED 80 + tristate "Apple {i,Power,Mac}Books" if EXPERT 81 81 depends on (USB_HID || BT_HIDP) 82 - default !EMBEDDED 82 + default !EXPERT 83 83 ---help--- 84 84 Support for some Apple devices which less or more break 85 85 HID specification. ··· 88 88 MacBooks, MacBook Pros and Apple Aluminum. 89 89 90 90 config HID_BELKIN 91 - tristate "Belkin Flip KVM and Wireless keyboard" if EMBEDDED 91 + tristate "Belkin Flip KVM and Wireless keyboard" if EXPERT 92 92 depends on USB_HID 93 - default !EMBEDDED 93 + default !EXPERT 94 94 ---help--- 95 95 Support for Belkin Flip KVM and Wireless keyboard. 96 96 ··· 101 101 Support for Cando dual touch panel. 102 102 103 103 config HID_CHERRY 104 - tristate "Cherry Cymotion keyboard" if EMBEDDED 104 + tristate "Cherry Cymotion keyboard" if EXPERT 105 105 depends on USB_HID 106 - default !EMBEDDED 106 + default !EXPERT 107 107 ---help--- 108 108 Support for Cherry Cymotion keyboard. 109 109 110 110 config HID_CHICONY 111 - tristate "Chicony Tactical pad" if EMBEDDED 111 + tristate "Chicony Tactical pad" if EXPERT 112 112 depends on USB_HID 113 - default !EMBEDDED 113 + default !EXPERT 114 114 ---help--- 115 115 Support for Chicony Tactical pad. 116 116 ··· 130 130 and some additional multimedia keys. 131 131 132 132 config HID_CYPRESS 133 - tristate "Cypress mouse and barcode readers" if EMBEDDED 133 + tristate "Cypress mouse and barcode readers" if EXPERT 134 134 depends on USB_HID 135 - default !EMBEDDED 135 + default !EXPERT 136 136 ---help--- 137 137 Support for cypress mouse and barcode readers. 138 138 ··· 174 174 Support for the ELECOM BM084 (bluetooth mouse). 175 175 176 176 config HID_EZKEY 177 - tristate "Ezkey BTC 8193 keyboard" if EMBEDDED 177 + tristate "Ezkey BTC 8193 keyboard" if EXPERT 178 178 depends on USB_HID 179 - default !EMBEDDED 179 + default !EXPERT 180 180 ---help--- 181 181 Support for Ezkey BTC 8193 keyboard. 182 182 183 183 config HID_KYE 184 - tristate "Kye/Genius Ergo Mouse" if EMBEDDED 184 + tristate "Kye/Genius Ergo Mouse" if EXPERT 185 185 depends on USB_HID 186 - default !EMBEDDED 186 + default !EXPERT 187 187 ---help--- 188 188 Support for Kye/Genius Ergo Mouse. 189 189 ··· 212 212 Support for Twinhan IR remote control. 213 213 214 214 config HID_KENSINGTON 215 - tristate "Kensington Slimblade Trackball" if EMBEDDED 215 + tristate "Kensington Slimblade Trackball" if EXPERT 216 216 depends on USB_HID 217 - default !EMBEDDED 217 + default !EXPERT 218 218 ---help--- 219 219 Support for Kensington Slimblade Trackball. 220 220 221 221 config HID_LOGITECH 222 - tristate "Logitech devices" if EMBEDDED 222 + tristate "Logitech devices" if EXPERT 223 223 depends on USB_HID 224 - default !EMBEDDED 224 + default !EXPERT 225 225 ---help--- 226 226 Support for Logitech devices that are not fully compliant with HID standard. 227 227 ··· 276 276 Apple Wireless "Magic" Mouse. 277 277 278 278 config HID_MICROSOFT 279 - tristate "Microsoft non-fully HID-compliant devices" if EMBEDDED 279 + tristate "Microsoft non-fully HID-compliant devices" if EXPERT 280 280 depends on USB_HID 281 - default !EMBEDDED 281 + default !EXPERT 282 282 ---help--- 283 283 Support for Microsoft devices that are not fully compliant with HID standard. 284 284 ··· 289 289 Support for MosArt dual-touch panels. 290 290 291 291 config HID_MONTEREY 292 - tristate "Monterey Genius KB29E keyboard" if EMBEDDED 292 + tristate "Monterey Genius KB29E keyboard" if EXPERT 293 293 depends on USB_HID 294 - default !EMBEDDED 294 + default !EXPERT 295 295 ---help--- 296 296 Support for Monterey Genius KB29E. 297 297 ··· 365 365 - IR 366 366 367 367 config HID_PICOLCD_FB 368 - bool "Framebuffer support" if EMBEDDED 369 - default !EMBEDDED 368 + bool "Framebuffer support" if EXPERT 369 + default !EXPERT 370 370 depends on HID_PICOLCD 371 371 depends on HID_PICOLCD=FB || FB=y 372 372 select FB_DEFERRED_IO ··· 379 379 frambuffer device. 380 380 381 381 config HID_PICOLCD_BACKLIGHT 382 - bool "Backlight control" if EMBEDDED 383 - default !EMBEDDED 382 + bool "Backlight control" if EXPERT 383 + default !EXPERT 384 384 depends on HID_PICOLCD 385 385 depends on HID_PICOLCD=BACKLIGHT_CLASS_DEVICE || BACKLIGHT_CLASS_DEVICE=y 386 386 ---help--- ··· 388 388 class. 389 389 390 390 config HID_PICOLCD_LCD 391 - bool "Contrast control" if EMBEDDED 392 - default !EMBEDDED 391 + bool "Contrast control" if EXPERT 392 + default !EXPERT 393 393 depends on HID_PICOLCD 394 394 depends on HID_PICOLCD=LCD_CLASS_DEVICE || LCD_CLASS_DEVICE=y 395 395 ---help--- 396 396 Provide access to PicoLCD's LCD contrast via lcd class. 397 397 398 398 config HID_PICOLCD_LEDS 399 - bool "GPO via leds class" if EMBEDDED 400 - default !EMBEDDED 399 + bool "GPO via leds class" if EXPERT 400 + default !EXPERT 401 401 depends on HID_PICOLCD 402 402 depends on HID_PICOLCD=LEDS_CLASS || LEDS_CLASS=y 403 403 ---help---
+1 -1
drivers/hid/usbhid/Kconfig
··· 45 45 If unsure, say Y. 46 46 47 47 menu "USB HID Boot Protocol drivers" 48 - depends on USB!=n && USB_HID!=y && EMBEDDED 48 + depends on USB!=n && USB_HID!=y && EXPERT 49 49 50 50 config USB_KBD 51 51 tristate "USB HIDBP Keyboard (simple Boot) support"
+1 -1
drivers/ide/Kconfig
··· 134 134 module will be called ide-cd. 135 135 136 136 config BLK_DEV_IDECD_VERBOSE_ERRORS 137 - bool "Verbose error logging for IDE/ATAPI CDROM driver" if EMBEDDED 137 + bool "Verbose error logging for IDE/ATAPI CDROM driver" if EXPERT 138 138 depends on BLK_DEV_IDECD 139 139 default y 140 140 help
+1 -1
drivers/infiniband/hw/mthca/Kconfig
··· 7 7 ("Tavor") and the MT25208 PCI Express HCA ("Arbel"). 8 8 9 9 config INFINIBAND_MTHCA_DEBUG 10 - bool "Verbose debugging output" if EMBEDDED 10 + bool "Verbose debugging output" if EXPERT 11 11 depends on INFINIBAND_MTHCA 12 12 default y 13 13 ---help---
+1 -1
drivers/infiniband/ulp/ipoib/Kconfig
··· 24 24 unless you limit mtu for these destinations to 2044. 25 25 26 26 config INFINIBAND_IPOIB_DEBUG 27 - bool "IP-over-InfiniBand debugging" if EMBEDDED 27 + bool "IP-over-InfiniBand debugging" if EXPERT 28 28 depends on INFINIBAND_IPOIB 29 29 default y 30 30 ---help---
+3 -3
drivers/input/Kconfig
··· 6 6 depends on !S390 7 7 8 8 config INPUT 9 - tristate "Generic input layer (needed for keyboard, mouse, ...)" if EMBEDDED 9 + tristate "Generic input layer (needed for keyboard, mouse, ...)" if EXPERT 10 10 default y 11 11 help 12 12 Say Y here if you have any input device (mouse, keyboard, tablet, ··· 67 67 comment "Userland interfaces" 68 68 69 69 config INPUT_MOUSEDEV 70 - tristate "Mouse interface" if EMBEDDED 70 + tristate "Mouse interface" if EXPERT 71 71 default y 72 72 help 73 73 Say Y here if you want your mouse to be accessible as char devices ··· 150 150 module will be called evbug. 151 151 152 152 config INPUT_APMPOWER 153 - tristate "Input Power Event -> APM Bridge" if EMBEDDED 153 + tristate "Input Power Event -> APM Bridge" if EXPERT 154 154 depends on INPUT && APM_EMULATION 155 155 help 156 156 Say Y here if you want suspend key events to trigger a user
+2 -2
drivers/input/keyboard/Kconfig
··· 2 2 # Input core configuration 3 3 # 4 4 menuconfig INPUT_KEYBOARD 5 - bool "Keyboards" if EMBEDDED || !X86 5 + bool "Keyboards" if EXPERT || !X86 6 6 default y 7 7 help 8 8 Say Y here, and a list of supported keyboards will be displayed. ··· 57 57 module will be called atakbd. 58 58 59 59 config KEYBOARD_ATKBD 60 - tristate "AT keyboard" if EMBEDDED || !X86 60 + tristate "AT keyboard" if EXPERT || !X86 61 61 default y 62 62 select SERIO 63 63 select SERIO_LIBPS2
+5 -5
drivers/input/mouse/Kconfig
··· 39 39 module will be called psmouse. 40 40 41 41 config MOUSE_PS2_ALPS 42 - bool "ALPS PS/2 mouse protocol extension" if EMBEDDED 42 + bool "ALPS PS/2 mouse protocol extension" if EXPERT 43 43 default y 44 44 depends on MOUSE_PS2 45 45 help ··· 49 49 If unsure, say Y. 50 50 51 51 config MOUSE_PS2_LOGIPS2PP 52 - bool "Logitech PS/2++ mouse protocol extension" if EMBEDDED 52 + bool "Logitech PS/2++ mouse protocol extension" if EXPERT 53 53 default y 54 54 depends on MOUSE_PS2 55 55 help ··· 59 59 If unsure, say Y. 60 60 61 61 config MOUSE_PS2_SYNAPTICS 62 - bool "Synaptics PS/2 mouse protocol extension" if EMBEDDED 62 + bool "Synaptics PS/2 mouse protocol extension" if EXPERT 63 63 default y 64 64 depends on MOUSE_PS2 65 65 help ··· 69 69 If unsure, say Y. 70 70 71 71 config MOUSE_PS2_LIFEBOOK 72 - bool "Fujitsu Lifebook PS/2 mouse protocol extension" if EMBEDDED 72 + bool "Fujitsu Lifebook PS/2 mouse protocol extension" if EXPERT 73 73 default y 74 74 depends on MOUSE_PS2 && X86 && DMI 75 75 help ··· 79 79 If unsure, say Y. 80 80 81 81 config MOUSE_PS2_TRACKPOINT 82 - bool "IBM Trackpoint PS/2 mouse protocol extension" if EMBEDDED 82 + bool "IBM Trackpoint PS/2 mouse protocol extension" if EXPERT 83 83 default y 84 84 depends on MOUSE_PS2 85 85 help
+3 -3
drivers/input/serio/Kconfig
··· 2 2 # Input core configuration 3 3 # 4 4 config SERIO 5 - tristate "Serial I/O support" if EMBEDDED || !X86 5 + tristate "Serial I/O support" if EXPERT || !X86 6 6 default y 7 7 help 8 8 Say Yes here if you have any input device that uses serial I/O to ··· 19 19 if SERIO 20 20 21 21 config SERIO_I8042 22 - tristate "i8042 PC Keyboard controller" if EMBEDDED || !X86 22 + tristate "i8042 PC Keyboard controller" if EXPERT || !X86 23 23 default y 24 24 depends on !PARISC && (!ARM || ARCH_SHARK || FOOTBRIDGE_HOST) && \ 25 25 (!SUPERH || SH_CAYMAN) && !M68K && !BLACKFIN ··· 168 168 module will be called maceps2. 169 169 170 170 config SERIO_LIBPS2 171 - tristate "PS/2 driver library" if EMBEDDED 171 + tristate "PS/2 driver library" if EXPERT 172 172 depends on SERIO_I8042 || SERIO_I8042=n 173 173 help 174 174 Say Y here if you are using a driver for device connected
+15 -15
drivers/input/touchscreen/Kconfig
··· 540 540 541 541 config TOUCHSCREEN_USB_EGALAX 542 542 default y 543 - bool "eGalax, eTurboTouch CT-410/510/700 device support" if EMBEDDED 543 + bool "eGalax, eTurboTouch CT-410/510/700 device support" if EXPERT 544 544 depends on TOUCHSCREEN_USB_COMPOSITE 545 545 546 546 config TOUCHSCREEN_USB_PANJIT 547 547 default y 548 - bool "PanJit device support" if EMBEDDED 548 + bool "PanJit device support" if EXPERT 549 549 depends on TOUCHSCREEN_USB_COMPOSITE 550 550 551 551 config TOUCHSCREEN_USB_3M 552 552 default y 553 - bool "3M/Microtouch EX II series device support" if EMBEDDED 553 + bool "3M/Microtouch EX II series device support" if EXPERT 554 554 depends on TOUCHSCREEN_USB_COMPOSITE 555 555 556 556 config TOUCHSCREEN_USB_ITM 557 557 default y 558 - bool "ITM device support" if EMBEDDED 558 + bool "ITM device support" if EXPERT 559 559 depends on TOUCHSCREEN_USB_COMPOSITE 560 560 561 561 config TOUCHSCREEN_USB_ETURBO 562 562 default y 563 - bool "eTurboTouch (non-eGalax compatible) device support" if EMBEDDED 563 + bool "eTurboTouch (non-eGalax compatible) device support" if EXPERT 564 564 depends on TOUCHSCREEN_USB_COMPOSITE 565 565 566 566 config TOUCHSCREEN_USB_GUNZE 567 567 default y 568 - bool "Gunze AHL61 device support" if EMBEDDED 568 + bool "Gunze AHL61 device support" if EXPERT 569 569 depends on TOUCHSCREEN_USB_COMPOSITE 570 570 571 571 config TOUCHSCREEN_USB_DMC_TSC10 572 572 default y 573 - bool "DMC TSC-10/25 device support" if EMBEDDED 573 + bool "DMC TSC-10/25 device support" if EXPERT 574 574 depends on TOUCHSCREEN_USB_COMPOSITE 575 575 576 576 config TOUCHSCREEN_USB_IRTOUCH 577 577 default y 578 - bool "IRTOUCHSYSTEMS/UNITOP device support" if EMBEDDED 578 + bool "IRTOUCHSYSTEMS/UNITOP device support" if EXPERT 579 579 depends on TOUCHSCREEN_USB_COMPOSITE 580 580 581 581 config TOUCHSCREEN_USB_IDEALTEK 582 582 default y 583 - bool "IdealTEK URTC1000 device support" if EMBEDDED 583 + bool "IdealTEK URTC1000 device support" if EXPERT 584 584 depends on TOUCHSCREEN_USB_COMPOSITE 585 585 586 586 config TOUCHSCREEN_USB_GENERAL_TOUCH 587 587 default y 588 - bool "GeneralTouch Touchscreen device support" if EMBEDDED 588 + bool "GeneralTouch Touchscreen device support" if EXPERT 589 589 depends on TOUCHSCREEN_USB_COMPOSITE 590 590 591 591 config TOUCHSCREEN_USB_GOTOP 592 592 default y 593 - bool "GoTop Super_Q2/GogoPen/PenPower tablet device support" if EMBEDDED 593 + bool "GoTop Super_Q2/GogoPen/PenPower tablet device support" if EXPERT 594 594 depends on TOUCHSCREEN_USB_COMPOSITE 595 595 596 596 config TOUCHSCREEN_USB_JASTEC 597 597 default y 598 - bool "JASTEC/DigiTech DTR-02U USB touch controller device support" if EMBEDDED 598 + bool "JASTEC/DigiTech DTR-02U USB touch controller device support" if EXPERT 599 599 depends on TOUCHSCREEN_USB_COMPOSITE 600 600 601 601 config TOUCHSCREEN_USB_E2I ··· 605 605 606 606 config TOUCHSCREEN_USB_ZYTRONIC 607 607 default y 608 - bool "Zytronic controller" if EMBEDDED 608 + bool "Zytronic controller" if EXPERT 609 609 depends on TOUCHSCREEN_USB_COMPOSITE 610 610 611 611 config TOUCHSCREEN_USB_ETT_TC45USB 612 612 default y 613 - bool "ET&T USB series TC4UM/TC5UH touchscreen controller support" if EMBEDDED 613 + bool "ET&T USB series TC4UM/TC5UH touchscreen controller support" if EXPERT 614 614 depends on TOUCHSCREEN_USB_COMPOSITE 615 615 616 616 config TOUCHSCREEN_USB_NEXIO 617 617 default y 618 - bool "NEXIO/iNexio device support" if EMBEDDED 618 + bool "NEXIO/iNexio device support" if EXPERT 619 619 depends on TOUCHSCREEN_USB_COMPOSITE 620 620 621 621 config TOUCHSCREEN_TOUCHIT213
+9 -8
drivers/leds/ledtrig-gpio.c
··· 99 99 struct led_classdev *led = dev_get_drvdata(dev); 100 100 struct gpio_trig_data *gpio_data = led->trigger_data; 101 101 102 - return sprintf(buf, "%s\n", gpio_data->inverted ? "yes" : "no"); 102 + return sprintf(buf, "%u\n", gpio_data->inverted); 103 103 } 104 104 105 105 static ssize_t gpio_trig_inverted_store(struct device *dev, ··· 107 107 { 108 108 struct led_classdev *led = dev_get_drvdata(dev); 109 109 struct gpio_trig_data *gpio_data = led->trigger_data; 110 - unsigned inverted; 110 + unsigned long inverted; 111 111 int ret; 112 112 113 - ret = sscanf(buf, "%u", &inverted); 114 - if (ret < 1) { 115 - dev_err(dev, "invalid value\n"); 116 - return -EINVAL; 117 - } 113 + ret = strict_strtoul(buf, 10, &inverted); 114 + if (ret < 0) 115 + return ret; 118 116 119 - gpio_data->inverted = !!inverted; 117 + if (inverted > 1) 118 + return -EINVAL; 119 + 120 + gpio_data->inverted = inverted; 120 121 121 122 /* After inverting, we need to update the LED. */ 122 123 schedule_work(&gpio_data->work);
+1 -1
drivers/lguest/page_tables.c
··· 1137 1137 */ 1138 1138 void map_switcher_in_guest(struct lg_cpu *cpu, struct lguest_pages *pages) 1139 1139 { 1140 - pte_t *switcher_pte_page = __get_cpu_var(switcher_pte_pages); 1140 + pte_t *switcher_pte_page = __this_cpu_read(switcher_pte_pages); 1141 1141 pte_t regs_pte; 1142 1142 1143 1143 #ifdef CONFIG_X86_PAE
+2 -2
drivers/lguest/x86/core.c
··· 90 90 * meanwhile). If that's not the case, we pretend everything in the 91 91 * Guest has changed. 92 92 */ 93 - if (__get_cpu_var(lg_last_cpu) != cpu || cpu->last_pages != pages) { 94 - __get_cpu_var(lg_last_cpu) = cpu; 93 + if (__this_cpu_read(lg_last_cpu) != cpu || cpu->last_pages != pages) { 94 + __this_cpu_write(lg_last_cpu, cpu); 95 95 cpu->last_pages = pages; 96 96 cpu->changed = CHANGED_ALL; 97 97 }
+2 -2
drivers/macintosh/therm_pm72.c
··· 443 443 tries = 0; 444 444 for (;;) { 445 445 nr = i2c_master_recv(fcu, buf, nb); 446 - if (nr > 0 || (nr < 0 && nr != ENODEV) || tries >= 100) 446 + if (nr > 0 || (nr < 0 && nr != -ENODEV) || tries >= 100) 447 447 break; 448 448 msleep(10); 449 449 ++tries; ··· 464 464 tries = 0; 465 465 for (;;) { 466 466 nw = i2c_master_send(fcu, buf, nb); 467 - if (nw > 0 || (nw < 0 && nw != EIO) || tries >= 100) 467 + if (nw > 0 || (nw < 0 && nw != -EIO) || tries >= 100) 468 468 break; 469 469 msleep(10); 470 470 ++tries;
+1 -1
drivers/media/common/saa7146_core.c
··· 452 452 INFO(("found saa7146 @ mem %p (revision %d, irq %d) (0x%04x,0x%04x).\n", dev->mem, dev->revision, pci->irq, pci->subsystem_vendor, pci->subsystem_device)); 453 453 dev->ext = ext; 454 454 455 - mutex_init(&dev->lock); 455 + mutex_init(&dev->v4l2_lock); 456 456 spin_lock_init(&dev->int_slock); 457 457 spin_lock_init(&dev->slock); 458 458
+2 -6
drivers/media/common/saa7146_fops.c
··· 15 15 } 16 16 17 17 /* is it free? */ 18 - mutex_lock(&dev->lock); 19 18 if (vv->resources & bit) { 20 19 DEB_D(("locked! vv->resources:0x%02x, we want:0x%02x\n",vv->resources,bit)); 21 20 /* no, someone else uses it */ 22 - mutex_unlock(&dev->lock); 23 21 return 0; 24 22 } 25 23 /* it's free, grab it */ 26 24 fh->resources |= bit; 27 25 vv->resources |= bit; 28 26 DEB_D(("res: get 0x%02x, cur:0x%02x\n",bit,vv->resources)); 29 - mutex_unlock(&dev->lock); 30 27 return 1; 31 28 } 32 29 ··· 34 37 35 38 BUG_ON((fh->resources & bits) != bits); 36 39 37 - mutex_lock(&dev->lock); 38 40 fh->resources &= ~bits; 39 41 vv->resources &= ~bits; 40 42 DEB_D(("res: put 0x%02x, cur:0x%02x\n",bits,vv->resources)); 41 - mutex_unlock(&dev->lock); 42 43 } 43 44 44 45 ··· 391 396 .write = fops_write, 392 397 .poll = fops_poll, 393 398 .mmap = fops_mmap, 394 - .ioctl = video_ioctl2, 399 + .unlocked_ioctl = video_ioctl2, 395 400 }; 396 401 397 402 static void vv_callback(struct saa7146_dev *dev, unsigned long status) ··· 500 505 vfd->fops = &video_fops; 501 506 vfd->ioctl_ops = &dev->ext_vv_data->ops; 502 507 vfd->release = video_device_release; 508 + vfd->lock = &dev->v4l2_lock; 503 509 vfd->tvnorms = 0; 504 510 for (i = 0; i < dev->ext_vv_data->num_stds; i++) 505 511 vfd->tvnorms |= dev->ext_vv_data->stds[i].id;
+1 -1
drivers/media/common/saa7146_vbi.c
··· 412 412 V4L2_BUF_TYPE_VBI_CAPTURE, 413 413 V4L2_FIELD_SEQ_TB, // FIXME: does this really work? 414 414 sizeof(struct saa7146_buf), 415 - file, NULL); 415 + file, &dev->v4l2_lock); 416 416 417 417 init_timer(&fh->vbi_read_timeout); 418 418 fh->vbi_read_timeout.function = vbi_read_timeout;
+1 -19
drivers/media/common/saa7146_video.c
··· 553 553 } 554 554 } 555 555 556 - mutex_lock(&dev->lock); 557 - 558 556 /* ok, accept it */ 559 557 vv->ov_fb = *fb; 560 558 vv->ov_fmt = fmt; ··· 561 563 vv->ov_fb.fmt.bytesperline = vv->ov_fb.fmt.width * fmt->depth / 8; 562 564 DEB_D(("setting bytesperline to %d\n", vv->ov_fb.fmt.bytesperline)); 563 565 } 564 - 565 - mutex_unlock(&dev->lock); 566 566 return 0; 567 567 } 568 568 ··· 645 649 return -EINVAL; 646 650 } 647 651 648 - mutex_lock(&dev->lock); 649 - 650 652 switch (ctrl->type) { 651 653 case V4L2_CTRL_TYPE_BOOLEAN: 652 654 case V4L2_CTRL_TYPE_MENU: ··· 687 693 /* fixme: we can support changing VFLIP and HFLIP here... */ 688 694 if (IS_CAPTURE_ACTIVE(fh) != 0) { 689 695 DEB_D(("V4L2_CID_HFLIP while active capture.\n")); 690 - mutex_unlock(&dev->lock); 691 696 return -EBUSY; 692 697 } 693 698 vv->hflip = c->value; ··· 694 701 case V4L2_CID_VFLIP: 695 702 if (IS_CAPTURE_ACTIVE(fh) != 0) { 696 703 DEB_D(("V4L2_CID_VFLIP while active capture.\n")); 697 - mutex_unlock(&dev->lock); 698 704 return -EBUSY; 699 705 } 700 706 vv->vflip = c->value; 701 707 break; 702 708 default: 703 - mutex_unlock(&dev->lock); 704 709 return -EINVAL; 705 710 } 706 - mutex_unlock(&dev->lock); 707 711 708 712 if (IS_OVERLAY_ACTIVE(fh) != 0) { 709 713 saa7146_stop_preview(fh); ··· 892 902 err = vidioc_try_fmt_vid_overlay(file, fh, f); 893 903 if (0 != err) 894 904 return err; 895 - mutex_lock(&dev->lock); 896 905 fh->ov.win = f->fmt.win; 897 906 fh->ov.nclips = f->fmt.win.clipcount; 898 907 if (fh->ov.nclips > 16) 899 908 fh->ov.nclips = 16; 900 909 if (copy_from_user(fh->ov.clips, f->fmt.win.clips, 901 910 sizeof(struct v4l2_clip) * fh->ov.nclips)) { 902 - mutex_unlock(&dev->lock); 903 911 return -EFAULT; 904 912 } 905 913 906 914 /* fh->ov.fh is used to indicate that we have valid overlay informations, too */ 907 915 fh->ov.fh = fh; 908 - 909 - mutex_unlock(&dev->lock); 910 916 911 917 /* check if our current overlay is active */ 912 918 if (IS_OVERLAY_ACTIVE(fh) != 0) { ··· 962 976 } 963 977 } 964 978 965 - mutex_lock(&dev->lock); 966 - 967 979 for (i = 0; i < dev->ext_vv_data->num_stds; i++) 968 980 if (*id & dev->ext_vv_data->stds[i].id) 969 981 break; ··· 971 987 dev->ext_vv_data->std_callback(dev, vv->standard); 972 988 found = 1; 973 989 } 974 - 975 - mutex_unlock(&dev->lock); 976 990 977 991 if (vv->ov_suspend != NULL) { 978 992 saa7146_start_preview(vv->ov_suspend); ··· 1336 1354 V4L2_BUF_TYPE_VIDEO_CAPTURE, 1337 1355 V4L2_FIELD_INTERLACED, 1338 1356 sizeof(struct saa7146_buf), 1339 - file, NULL); 1357 + file, &dev->v4l2_lock); 1340 1358 1341 1359 return 0; 1342 1360 }
+1 -1
drivers/media/common/tuners/Kconfig
··· 34 34 config MEDIA_TUNER_CUSTOMISE 35 35 bool "Customize analog and hybrid tuner modules to build" 36 36 depends on MEDIA_TUNER 37 - default y if EMBEDDED 37 + default y if EXPERT 38 38 help 39 39 This allows the user to deselect tuner drivers unnecessary 40 40 for their hardware from the build. Use this option with care
+74 -56
drivers/media/common/tuners/tda8290.c
··· 95 95 msleep(20); 96 96 } else { 97 97 msg = disable; 98 - tuner_i2c_xfer_send(&priv->i2c_props, msg, 1); 99 - tuner_i2c_xfer_recv(&priv->i2c_props, &msg[1], 1); 98 + tuner_i2c_xfer_send_recv(&priv->i2c_props, msg, 1, &msg[1], 1); 100 99 101 100 buf[2] = msg[1]; 102 101 buf[2] &= ~0x04; ··· 232 233 tuner_i2c_xfer_send(&priv->i2c_props, pll_bw_nom, 2); 233 234 } 234 235 236 + 235 237 tda8290_i2c_bridge(fe, 1); 236 238 237 239 if (fe->ops.tuner_ops.set_analog_params) 238 240 fe->ops.tuner_ops.set_analog_params(fe, params); 239 241 240 242 for (i = 0; i < 3; i++) { 241 - tuner_i2c_xfer_send(&priv->i2c_props, &addr_pll_stat, 1); 242 - tuner_i2c_xfer_recv(&priv->i2c_props, &pll_stat, 1); 243 + tuner_i2c_xfer_send_recv(&priv->i2c_props, 244 + &addr_pll_stat, 1, &pll_stat, 1); 243 245 if (pll_stat & 0x80) { 244 - tuner_i2c_xfer_send(&priv->i2c_props, &addr_adc_sat, 1); 245 - tuner_i2c_xfer_recv(&priv->i2c_props, &adc_sat, 1); 246 - tuner_i2c_xfer_send(&priv->i2c_props, &addr_agc_stat, 1); 247 - tuner_i2c_xfer_recv(&priv->i2c_props, &agc_stat, 1); 246 + tuner_i2c_xfer_send_recv(&priv->i2c_props, 247 + &addr_adc_sat, 1, 248 + &adc_sat, 1); 249 + tuner_i2c_xfer_send_recv(&priv->i2c_props, 250 + &addr_agc_stat, 1, 251 + &agc_stat, 1); 248 252 tuner_dbg("tda8290 is locked, AGC: %d\n", agc_stat); 249 253 break; 250 254 } else { ··· 261 259 agc_stat, adc_sat, pll_stat & 0x80); 262 260 tuner_i2c_xfer_send(&priv->i2c_props, gainset_2, 2); 263 261 msleep(100); 264 - tuner_i2c_xfer_send(&priv->i2c_props, &addr_agc_stat, 1); 265 - tuner_i2c_xfer_recv(&priv->i2c_props, &agc_stat, 1); 266 - tuner_i2c_xfer_send(&priv->i2c_props, &addr_pll_stat, 1); 267 - tuner_i2c_xfer_recv(&priv->i2c_props, &pll_stat, 1); 262 + tuner_i2c_xfer_send_recv(&priv->i2c_props, 263 + &addr_agc_stat, 1, &agc_stat, 1); 264 + tuner_i2c_xfer_send_recv(&priv->i2c_props, 265 + &addr_pll_stat, 1, &pll_stat, 1); 268 266 if ((agc_stat > 115) || !(pll_stat & 0x80)) { 269 267 tuner_dbg("adjust gain, step 2. Agc: %d, lock: %d\n", 270 268 agc_stat, pll_stat & 0x80); 271 269 if (priv->cfg.agcf) 272 270 priv->cfg.agcf(fe); 273 271 msleep(100); 274 - tuner_i2c_xfer_send(&priv->i2c_props, &addr_agc_stat, 1); 275 - tuner_i2c_xfer_recv(&priv->i2c_props, &agc_stat, 1); 276 - tuner_i2c_xfer_send(&priv->i2c_props, &addr_pll_stat, 1); 277 - tuner_i2c_xfer_recv(&priv->i2c_props, &pll_stat, 1); 272 + tuner_i2c_xfer_send_recv(&priv->i2c_props, 273 + &addr_agc_stat, 1, 274 + &agc_stat, 1); 275 + tuner_i2c_xfer_send_recv(&priv->i2c_props, 276 + &addr_pll_stat, 1, 277 + &pll_stat, 1); 278 278 if((agc_stat > 115) || !(pll_stat & 0x80)) { 279 279 tuner_dbg("adjust gain, step 3. Agc: %d\n", agc_stat); 280 280 tuner_i2c_xfer_send(&priv->i2c_props, adc_head_12, 2); ··· 288 284 289 285 /* l/ l' deadlock? */ 290 286 if(priv->tda8290_easy_mode & 0x60) { 291 - tuner_i2c_xfer_send(&priv->i2c_props, &addr_adc_sat, 1); 292 - tuner_i2c_xfer_recv(&priv->i2c_props, &adc_sat, 1); 293 - tuner_i2c_xfer_send(&priv->i2c_props, &addr_pll_stat, 1); 294 - tuner_i2c_xfer_recv(&priv->i2c_props, &pll_stat, 1); 287 + tuner_i2c_xfer_send_recv(&priv->i2c_props, 288 + &addr_adc_sat, 1, 289 + &adc_sat, 1); 290 + tuner_i2c_xfer_send_recv(&priv->i2c_props, 291 + &addr_pll_stat, 1, 292 + &pll_stat, 1); 295 293 if ((adc_sat > 20) || !(pll_stat & 0x80)) { 296 294 tuner_dbg("trying to resolve SECAM L deadlock\n"); 297 295 tuner_i2c_xfer_send(&priv->i2c_props, agc_rst_on, 2); ··· 313 307 struct tda8290_priv *priv = fe->analog_demod_priv; 314 308 unsigned char buf[] = { 0x30, 0x00 }; /* clb_stdbt */ 315 309 316 - tuner_i2c_xfer_send(&priv->i2c_props, &buf[0], 1); 317 - tuner_i2c_xfer_recv(&priv->i2c_props, &buf[1], 1); 310 + tuner_i2c_xfer_send_recv(&priv->i2c_props, &buf[0], 1, &buf[1], 1); 318 311 319 312 if (enable) 320 313 buf[1] = 0x01; ··· 328 323 struct tda8290_priv *priv = fe->analog_demod_priv; 329 324 unsigned char buf[] = { 0x01, 0x00 }; 330 325 331 - tuner_i2c_xfer_send(&priv->i2c_props, &buf[0], 1); 332 - tuner_i2c_xfer_recv(&priv->i2c_props, &buf[1], 1); 326 + tuner_i2c_xfer_send_recv(&priv->i2c_props, &buf[0], 1, &buf[1], 1); 333 327 334 328 if (enable) 335 329 buf[1] = 0x01; /* rising edge sets regs 0x02 - 0x23 */ ··· 357 353 struct tda8290_priv *priv = fe->analog_demod_priv; 358 354 unsigned char buf[] = { 0x02, 0x00 }; /* DIV_FUNC */ 359 355 360 - tuner_i2c_xfer_send(&priv->i2c_props, &buf[0], 1); 361 - tuner_i2c_xfer_recv(&priv->i2c_props, &buf[1], 1); 356 + tuner_i2c_xfer_send_recv(&priv->i2c_props, &buf[0], 1, &buf[1], 1); 362 357 363 358 if (enable) 364 359 buf[1] &= ~0x40; ··· 373 370 unsigned char set_gpio_cf[] = { 0x44, 0x00 }; 374 371 unsigned char set_gpio_val[] = { 0x46, 0x00 }; 375 372 376 - tuner_i2c_xfer_send(&priv->i2c_props, &set_gpio_cf[0], 1); 377 - tuner_i2c_xfer_recv(&priv->i2c_props, &set_gpio_cf[1], 1); 378 - tuner_i2c_xfer_send(&priv->i2c_props, &set_gpio_val[0], 1); 379 - tuner_i2c_xfer_recv(&priv->i2c_props, &set_gpio_val[1], 1); 373 + tuner_i2c_xfer_send_recv(&priv->i2c_props, 374 + &set_gpio_cf[0], 1, &set_gpio_cf[1], 1); 375 + tuner_i2c_xfer_send_recv(&priv->i2c_props, 376 + &set_gpio_val[0], 1, &set_gpio_val[1], 1); 380 377 381 378 set_gpio_cf[1] &= 0xf0; /* clear GPIO_0 bits 3-0 */ 382 379 ··· 395 392 unsigned char hvpll_stat = 0x26; 396 393 unsigned char ret; 397 394 398 - tuner_i2c_xfer_send(&priv->i2c_props, &hvpll_stat, 1); 399 - tuner_i2c_xfer_recv(&priv->i2c_props, &ret, 1); 395 + tuner_i2c_xfer_send_recv(&priv->i2c_props, &hvpll_stat, 1, &ret, 1); 400 396 return (ret & 0x01) ? 65535 : 0; 401 397 } 402 398 ··· 415 413 tda8295_power(fe, 1); 416 414 tda8295_agc1_out(fe, 1); 417 415 418 - tuner_i2c_xfer_send(&priv->i2c_props, &blanking_mode[0], 1); 419 - tuner_i2c_xfer_recv(&priv->i2c_props, &blanking_mode[1], 1); 416 + tuner_i2c_xfer_send_recv(&priv->i2c_props, 417 + &blanking_mode[0], 1, &blanking_mode[1], 1); 420 418 421 419 tda8295_set_video_std(fe); 422 420 ··· 449 447 unsigned char i2c_get_afc[1] = { 0x1B }; 450 448 unsigned char afc = 0; 451 449 452 - tuner_i2c_xfer_send(&priv->i2c_props, i2c_get_afc, ARRAY_SIZE(i2c_get_afc)); 453 - tuner_i2c_xfer_recv(&priv->i2c_props, &afc, 1); 450 + tuner_i2c_xfer_send_recv(&priv->i2c_props, 451 + i2c_get_afc, ARRAY_SIZE(i2c_get_afc), &afc, 1); 454 452 return (afc & 0x80)? 65535:0; 455 453 } 456 454 ··· 656 654 static int tda8290_probe(struct tuner_i2c_props *i2c_props) 657 655 { 658 656 #define TDA8290_ID 0x89 659 - unsigned char tda8290_id[] = { 0x1f, 0x00 }; 657 + u8 reg = 0x1f, id; 658 + struct i2c_msg msg_read[] = { 659 + { .addr = 0x4b, .flags = 0, .len = 1, .buf = &reg }, 660 + { .addr = 0x4b, .flags = I2C_M_RD, .len = 1, .buf = &id }, 661 + }; 660 662 661 663 /* detect tda8290 */ 662 - tuner_i2c_xfer_send(i2c_props, &tda8290_id[0], 1); 663 - tuner_i2c_xfer_recv(i2c_props, &tda8290_id[1], 1); 664 + if (i2c_transfer(i2c_props->adap, msg_read, 2) != 2) { 665 + printk(KERN_WARNING "%s: tda8290 couldn't read register 0x%02x\n", 666 + __func__, reg); 667 + return -ENODEV; 668 + } 664 669 665 - if (tda8290_id[1] == TDA8290_ID) { 670 + if (id == TDA8290_ID) { 666 671 if (debug) 667 672 printk(KERN_DEBUG "%s: tda8290 detected @ %d-%04x\n", 668 673 __func__, i2c_adapter_id(i2c_props->adap), 669 674 i2c_props->addr); 670 675 return 0; 671 676 } 672 - 673 677 return -ENODEV; 674 678 } 675 679 ··· 683 675 { 684 676 #define TDA8295_ID 0x8a 685 677 #define TDA8295C2_ID 0x8b 686 - unsigned char tda8295_id[] = { 0x2f, 0x00 }; 678 + u8 reg = 0x2f, id; 679 + struct i2c_msg msg_read[] = { 680 + { .addr = 0x4b, .flags = 0, .len = 1, .buf = &reg }, 681 + { .addr = 0x4b, .flags = I2C_M_RD, .len = 1, .buf = &id }, 682 + }; 687 683 688 - /* detect tda8295 */ 689 - tuner_i2c_xfer_send(i2c_props, &tda8295_id[0], 1); 690 - tuner_i2c_xfer_recv(i2c_props, &tda8295_id[1], 1); 684 + /* detect tda8290 */ 685 + if (i2c_transfer(i2c_props->adap, msg_read, 2) != 2) { 686 + printk(KERN_WARNING "%s: tda8290 couldn't read register 0x%02x\n", 687 + __func__, reg); 688 + return -ENODEV; 689 + } 691 690 692 - if ((tda8295_id[1] & 0xfe) == TDA8295_ID) { 691 + if ((id & 0xfe) == TDA8295_ID) { 693 692 if (debug) 694 693 printk(KERN_DEBUG "%s: %s detected @ %d-%04x\n", 695 - __func__, (tda8295_id[1] == TDA8295_ID) ? 694 + __func__, (id == TDA8295_ID) ? 696 695 "tda8295c1" : "tda8295c2", 697 696 i2c_adapter_id(i2c_props->adap), 698 697 i2c_props->addr); ··· 755 740 sizeof(struct analog_demod_ops)); 756 741 } 757 742 758 - if ((!(cfg) || (TDA829X_PROBE_TUNER == cfg->probe_tuner)) && 759 - (tda829x_find_tuner(fe) < 0)) 760 - goto fail; 743 + if (!(cfg) || (TDA829X_PROBE_TUNER == cfg->probe_tuner)) { 744 + tda8295_power(fe, 1); 745 + if (tda829x_find_tuner(fe) < 0) 746 + goto fail; 747 + } 761 748 762 749 switch (priv->ver) { 763 750 case TDA8290: ··· 803 786 return fe; 804 787 805 788 fail: 789 + memset(&fe->ops.analog_ops, 0, sizeof(struct analog_demod_ops)); 790 + 806 791 tda829x_release(fe); 807 792 return NULL; 808 793 } ··· 828 809 int i; 829 810 830 811 /* rule out tda9887, which would return the same byte repeatedly */ 831 - tuner_i2c_xfer_send(&i2c_props, soft_reset, 1); 832 - tuner_i2c_xfer_recv(&i2c_props, buf, PROBE_BUFFER_SIZE); 812 + tuner_i2c_xfer_send_recv(&i2c_props, 813 + soft_reset, 1, buf, PROBE_BUFFER_SIZE); 833 814 for (i = 1; i < PROBE_BUFFER_SIZE; i++) { 834 815 if (buf[i] != buf[0]) 835 816 break; ··· 846 827 /* fall back to old probing method */ 847 828 tuner_i2c_xfer_send(&i2c_props, easy_mode_b, 2); 848 829 tuner_i2c_xfer_send(&i2c_props, soft_reset, 2); 849 - tuner_i2c_xfer_send(&i2c_props, &addr_dto_lsb, 1); 850 - tuner_i2c_xfer_recv(&i2c_props, &data, 1); 830 + tuner_i2c_xfer_send_recv(&i2c_props, &addr_dto_lsb, 1, &data, 1); 851 831 if (data == 0) { 852 832 tuner_i2c_xfer_send(&i2c_props, easy_mode_g, 2); 853 833 tuner_i2c_xfer_send(&i2c_props, soft_reset, 2); 854 - tuner_i2c_xfer_send(&i2c_props, &addr_dto_lsb, 1); 855 - tuner_i2c_xfer_recv(&i2c_props, &data, 1); 834 + tuner_i2c_xfer_send_recv(&i2c_props, 835 + &addr_dto_lsb, 1, &data, 1); 856 836 if (data == 0x7b) { 857 837 return 0; 858 838 }
+3 -3
drivers/media/dvb/dvb-usb/dib0700_core.c
··· 514 514 union { 515 515 u16 system16; 516 516 struct { 517 - u8 system; 518 517 u8 not_system; 518 + u8 system; 519 519 }; 520 520 }; 521 521 u8 data; ··· 575 575 if ((poll_reply->system ^ poll_reply->not_system) != 0xff) { 576 576 deb_data("NEC extended protocol\n"); 577 577 /* NEC extended code - 24 bits */ 578 - keycode = poll_reply->system16 << 8 | poll_reply->data; 578 + keycode = be16_to_cpu(poll_reply->system16) << 8 | poll_reply->data; 579 579 } else { 580 580 deb_data("NEC normal protocol\n"); 581 581 /* normal NEC code - 16 bits */ ··· 587 587 deb_data("RC5 protocol\n"); 588 588 /* RC5 Protocol */ 589 589 toggle = poll_reply->report_id; 590 - keycode = poll_reply->system16 << 8 | poll_reply->data; 590 + keycode = poll_reply->system << 8 | poll_reply->data; 591 591 592 592 break; 593 593 }
+6 -3
drivers/media/dvb/firewire/firedtv-rc.c
··· 172 172 173 173 void fdtv_handle_rc(struct firedtv *fdtv, unsigned int code) 174 174 { 175 - u16 *keycode = fdtv->remote_ctrl_dev->keycode; 175 + struct input_dev *idev = fdtv->remote_ctrl_dev; 176 + u16 *keycode = idev->keycode; 176 177 177 178 if (code >= 0x0300 && code <= 0x031f) 178 179 code = keycode[code - 0x0300]; ··· 189 188 return; 190 189 } 191 190 192 - input_report_key(fdtv->remote_ctrl_dev, code, 1); 193 - input_report_key(fdtv->remote_ctrl_dev, code, 0); 191 + input_report_key(idev, code, 1); 192 + input_sync(idev); 193 + input_report_key(idev, code, 0); 194 + input_sync(idev); 194 195 }
+1 -1
drivers/media/dvb/frontends/Kconfig
··· 1 1 config DVB_FE_CUSTOMISE 2 2 bool "Customise the frontend modules to build" 3 3 depends on DVB_CORE 4 - default y if EMBEDDED 4 + default y if EXPERT 5 5 help 6 6 This allows the user to select/deselect frontend drivers for their 7 7 hardware from the build.
+2 -2
drivers/media/dvb/frontends/af9013.c
··· 334 334 if_sample_freq = 3300000; /* 3.3 MHz */ 335 335 break; 336 336 case BANDWIDTH_7_MHZ: 337 - if_sample_freq = 3800000; /* 3.8 MHz */ 337 + if_sample_freq = 3500000; /* 3.5 MHz */ 338 338 break; 339 339 case BANDWIDTH_8_MHZ: 340 340 default: 341 - if_sample_freq = 4300000; /* 4.3 MHz */ 341 + if_sample_freq = 4000000; /* 4.0 MHz */ 342 342 break; 343 343 } 344 344 } else if (state->config.tuner == AF9013_TUNER_TDA18218) {
+1 -1
drivers/media/dvb/frontends/ix2505v.c
··· 311 311 return fe; 312 312 313 313 error: 314 - ix2505v_release(fe); 314 + kfree(state); 315 315 return NULL; 316 316 } 317 317 EXPORT_SYMBOL(ix2505v_attach);
+30 -6
drivers/media/dvb/frontends/mb86a20s.c
··· 43 43 const struct mb86a20s_config *config; 44 44 45 45 struct dvb_frontend frontend; 46 + 47 + bool need_init; 46 48 }; 47 49 48 50 struct regdata { ··· 320 318 321 319 rc = i2c_transfer(state->i2c, &msg, 1); 322 320 if (rc != 1) { 323 - printk("%s: writereg rcor(rc == %i, reg == 0x%02x," 321 + printk("%s: writereg error (rc == %i, reg == 0x%02x," 324 322 " data == 0x%02x)\n", __func__, rc, reg, data); 325 323 return rc; 326 324 } ··· 355 353 rc = i2c_transfer(state->i2c, msg, 2); 356 354 357 355 if (rc != 2) { 358 - rc("%s: reg=0x%x (rcor=%d)\n", __func__, reg, rc); 356 + rc("%s: reg=0x%x (error=%d)\n", __func__, reg, rc); 359 357 return rc; 360 358 } 361 359 ··· 384 382 /* Initialize the frontend */ 385 383 rc = mb86a20s_writeregdata(state, mb86a20s_init); 386 384 if (rc < 0) 387 - return rc; 385 + goto err; 388 386 389 387 if (!state->config->is_serial) { 390 388 regD5 &= ~1; 391 389 392 390 rc = mb86a20s_writereg(state, 0x50, 0xd5); 393 391 if (rc < 0) 394 - return rc; 392 + goto err; 395 393 rc = mb86a20s_writereg(state, 0x51, regD5); 396 394 if (rc < 0) 397 - return rc; 395 + goto err; 398 396 } 399 397 400 398 if (fe->ops.i2c_gate_ctrl) 401 399 fe->ops.i2c_gate_ctrl(fe, 1); 402 400 403 - return 0; 401 + err: 402 + if (rc < 0) { 403 + state->need_init = true; 404 + printk(KERN_INFO "mb86a20s: Init failed. Will try again later\n"); 405 + } else { 406 + state->need_init = false; 407 + dprintk("Initialization succeded.\n"); 408 + } 409 + return rc; 404 410 } 405 411 406 412 static int mb86a20s_read_signal_strength(struct dvb_frontend *fe, u16 *strength) ··· 495 485 496 486 if (fe->ops.i2c_gate_ctrl) 497 487 fe->ops.i2c_gate_ctrl(fe, 1); 488 + dprintk("Calling tuner set parameters\n"); 498 489 fe->ops.tuner_ops.set_params(fe, p); 490 + 491 + /* 492 + * Make it more reliable: if, for some reason, the initial 493 + * device initialization doesn't happen, initialize it when 494 + * a SBTVD parameters are adjusted. 495 + * 496 + * Unfortunately, due to a hard to track bug at tda829x/tda18271, 497 + * the agc callback logic is not called during DVB attach time, 498 + * causing mb86a20s to not be initialized with Kworld SBTVD. 499 + * So, this hack is needed, in order to make Kworld SBTVD to work. 500 + */ 501 + if (state->need_init) 502 + mb86a20s_initfe(fe); 499 503 500 504 if (fe->ops.i2c_gate_ctrl) 501 505 fe->ops.i2c_gate_ctrl(fe, 0);
+1 -1
drivers/media/dvb/ttpci/av7110_ca.c
··· 277 277 { 278 278 ca_slot_info_t *info=(ca_slot_info_t *)parg; 279 279 280 - if (info->num > 1) 280 + if (info->num < 0 || info->num > 1) 281 281 return -EINVAL; 282 282 av7110->ci_slot[info->num].num = info->num; 283 283 av7110->ci_slot[info->num].type = FW_CI_LL_SUPPORT(av7110->arm_app) ?
-14
drivers/media/radio/Kconfig
··· 151 151 following ports will be probed: 0x20c, 0x30c, 0x24c, 0x34c, 0x248 and 152 152 0x28c. 153 153 154 - config RADIO_GEMTEK_PCI 155 - tristate "GemTek PCI Radio Card support" 156 - depends on VIDEO_V4L2 && PCI 157 - ---help--- 158 - Choose Y here if you have this PCI FM radio card. 159 - 160 - In order to control your radio card, you will need to use programs 161 - that are compatible with the Video for Linux API. Information on 162 - this API and pointers to "v4l" programs may be found at 163 - <file:Documentation/video4linux/API.html>. 164 - 165 - To compile this driver as a module, choose M here: the 166 - module will be called radio-gemtek-pci. 167 - 168 154 config RADIO_MAXIRADIO 169 155 tristate "Guillemot MAXI Radio FM 2000 radio" 170 156 depends on VIDEO_V4L2 && PCI
-1
drivers/media/radio/Makefile
··· 13 13 obj-$(CONFIG_RADIO_RTRACK) += radio-aimslab.o 14 14 obj-$(CONFIG_RADIO_ZOLTRIX) += radio-zoltrix.o 15 15 obj-$(CONFIG_RADIO_GEMTEK) += radio-gemtek.o 16 - obj-$(CONFIG_RADIO_GEMTEK_PCI) += radio-gemtek-pci.o 17 16 obj-$(CONFIG_RADIO_TRUST) += radio-trust.o 18 17 obj-$(CONFIG_I2C_SI4713) += si4713-i2c.o 19 18 obj-$(CONFIG_RADIO_SI4713) += radio-si4713.o
+1
drivers/media/radio/radio-aimslab.c
··· 31 31 #include <linux/module.h> /* Modules */ 32 32 #include <linux/init.h> /* Initdata */ 33 33 #include <linux/ioport.h> /* request_region */ 34 + #include <linux/delay.h> /* msleep */ 34 35 #include <linux/videodev2.h> /* kernel radio structs */ 35 36 #include <linux/version.h> /* for KERNEL_VERSION MACRO */ 36 37 #include <linux/io.h> /* outb, outb_p */
-478
drivers/media/radio/radio-gemtek-pci.c
··· 1 - /* 2 - *************************************************************************** 3 - * 4 - * radio-gemtek-pci.c - Gemtek PCI Radio driver 5 - * (C) 2001 Vladimir Shebordaev <vshebordaev@mail.ru> 6 - * 7 - *************************************************************************** 8 - * 9 - * This program is free software; you can redistribute it and/or 10 - * modify it under the terms of the GNU General Public License as 11 - * published by the Free Software Foundation; either version 2 of 12 - * the License, or (at your option) any later version. 13 - * 14 - * This program is distributed in the hope that it will be useful, 15 - * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 - * GNU General Public License for more details. 18 - * 19 - * You should have received a copy of the GNU General Public 20 - * License along with this program; if not, write to the Free 21 - * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, 22 - * USA. 23 - * 24 - *************************************************************************** 25 - * 26 - * Gemtek Corp still silently refuses to release any specifications 27 - * of their multimedia devices, so the protocol still has to be 28 - * reverse engineered. 29 - * 30 - * The v4l code was inspired by Jonas Munsin's Gemtek serial line 31 - * radio device driver. 32 - * 33 - * Please, let me know if this piece of code was useful :) 34 - * 35 - * TODO: multiple device support and portability were not tested 36 - * 37 - * Converted to V4L2 API by Mauro Carvalho Chehab <mchehab@infradead.org> 38 - * 39 - *************************************************************************** 40 - */ 41 - 42 - #include <linux/types.h> 43 - #include <linux/list.h> 44 - #include <linux/module.h> 45 - #include <linux/init.h> 46 - #include <linux/pci.h> 47 - #include <linux/videodev2.h> 48 - #include <linux/errno.h> 49 - #include <linux/version.h> /* for KERNEL_VERSION MACRO */ 50 - #include <linux/io.h> 51 - #include <linux/slab.h> 52 - #include <media/v4l2-device.h> 53 - #include <media/v4l2-ioctl.h> 54 - 55 - MODULE_AUTHOR("Vladimir Shebordaev <vshebordaev@mail.ru>"); 56 - MODULE_DESCRIPTION("The video4linux driver for the Gemtek PCI Radio Card"); 57 - MODULE_LICENSE("GPL"); 58 - 59 - static int nr_radio = -1; 60 - static int mx = 1; 61 - 62 - module_param(mx, bool, 0); 63 - MODULE_PARM_DESC(mx, "single digit: 1 - turn off the turner upon module exit (default), 0 - do not"); 64 - module_param(nr_radio, int, 0); 65 - MODULE_PARM_DESC(nr_radio, "video4linux device number to use"); 66 - 67 - #define RADIO_VERSION KERNEL_VERSION(0, 0, 2) 68 - 69 - #ifndef PCI_VENDOR_ID_GEMTEK 70 - #define PCI_VENDOR_ID_GEMTEK 0x5046 71 - #endif 72 - 73 - #ifndef PCI_DEVICE_ID_GEMTEK_PR103 74 - #define PCI_DEVICE_ID_GEMTEK_PR103 0x1001 75 - #endif 76 - 77 - #ifndef GEMTEK_PCI_RANGE_LOW 78 - #define GEMTEK_PCI_RANGE_LOW (87*16000) 79 - #endif 80 - 81 - #ifndef GEMTEK_PCI_RANGE_HIGH 82 - #define GEMTEK_PCI_RANGE_HIGH (108*16000) 83 - #endif 84 - 85 - struct gemtek_pci { 86 - struct v4l2_device v4l2_dev; 87 - struct video_device vdev; 88 - struct mutex lock; 89 - struct pci_dev *pdev; 90 - 91 - u32 iobase; 92 - u32 length; 93 - 94 - u32 current_frequency; 95 - u8 mute; 96 - }; 97 - 98 - static inline struct gemtek_pci *to_gemtek_pci(struct v4l2_device *v4l2_dev) 99 - { 100 - return container_of(v4l2_dev, struct gemtek_pci, v4l2_dev); 101 - } 102 - 103 - static inline u8 gemtek_pci_out(u16 value, u32 port) 104 - { 105 - outw(value, port); 106 - 107 - return (u8)value; 108 - } 109 - 110 - #define _b0(v) (*((u8 *)&v)) 111 - 112 - static void __gemtek_pci_cmd(u16 value, u32 port, u8 *last_byte, int keep) 113 - { 114 - u8 byte = *last_byte; 115 - 116 - if (!value) { 117 - if (!keep) 118 - value = (u16)port; 119 - byte &= 0xfd; 120 - } else 121 - byte |= 2; 122 - 123 - _b0(value) = byte; 124 - outw(value, port); 125 - byte |= 1; 126 - _b0(value) = byte; 127 - outw(value, port); 128 - byte &= 0xfe; 129 - _b0(value) = byte; 130 - outw(value, port); 131 - 132 - *last_byte = byte; 133 - } 134 - 135 - static inline void gemtek_pci_nil(u32 port, u8 *last_byte) 136 - { 137 - __gemtek_pci_cmd(0x00, port, last_byte, false); 138 - } 139 - 140 - static inline void gemtek_pci_cmd(u16 cmd, u32 port, u8 *last_byte) 141 - { 142 - __gemtek_pci_cmd(cmd, port, last_byte, true); 143 - } 144 - 145 - static void gemtek_pci_setfrequency(struct gemtek_pci *card, unsigned long frequency) 146 - { 147 - int i; 148 - u32 value = frequency / 200 + 856; 149 - u16 mask = 0x8000; 150 - u8 last_byte; 151 - u32 port = card->iobase; 152 - 153 - mutex_lock(&card->lock); 154 - card->current_frequency = frequency; 155 - last_byte = gemtek_pci_out(0x06, port); 156 - 157 - i = 0; 158 - do { 159 - gemtek_pci_nil(port, &last_byte); 160 - i++; 161 - } while (i < 9); 162 - 163 - i = 0; 164 - do { 165 - gemtek_pci_cmd(value & mask, port, &last_byte); 166 - mask >>= 1; 167 - i++; 168 - } while (i < 16); 169 - 170 - outw(0x10, port); 171 - mutex_unlock(&card->lock); 172 - } 173 - 174 - 175 - static void gemtek_pci_mute(struct gemtek_pci *card) 176 - { 177 - mutex_lock(&card->lock); 178 - outb(0x1f, card->iobase); 179 - card->mute = true; 180 - mutex_unlock(&card->lock); 181 - } 182 - 183 - static void gemtek_pci_unmute(struct gemtek_pci *card) 184 - { 185 - if (card->mute) { 186 - gemtek_pci_setfrequency(card, card->current_frequency); 187 - card->mute = false; 188 - } 189 - } 190 - 191 - static int gemtek_pci_getsignal(struct gemtek_pci *card) 192 - { 193 - int sig; 194 - 195 - mutex_lock(&card->lock); 196 - sig = (inb(card->iobase) & 0x08) ? 0 : 1; 197 - mutex_unlock(&card->lock); 198 - return sig; 199 - } 200 - 201 - static int vidioc_querycap(struct file *file, void *priv, 202 - struct v4l2_capability *v) 203 - { 204 - struct gemtek_pci *card = video_drvdata(file); 205 - 206 - strlcpy(v->driver, "radio-gemtek-pci", sizeof(v->driver)); 207 - strlcpy(v->card, "GemTek PCI Radio", sizeof(v->card)); 208 - snprintf(v->bus_info, sizeof(v->bus_info), "PCI:%s", pci_name(card->pdev)); 209 - v->version = RADIO_VERSION; 210 - v->capabilities = V4L2_CAP_TUNER | V4L2_CAP_RADIO; 211 - return 0; 212 - } 213 - 214 - static int vidioc_g_tuner(struct file *file, void *priv, 215 - struct v4l2_tuner *v) 216 - { 217 - struct gemtek_pci *card = video_drvdata(file); 218 - 219 - if (v->index > 0) 220 - return -EINVAL; 221 - 222 - strlcpy(v->name, "FM", sizeof(v->name)); 223 - v->type = V4L2_TUNER_RADIO; 224 - v->rangelow = GEMTEK_PCI_RANGE_LOW; 225 - v->rangehigh = GEMTEK_PCI_RANGE_HIGH; 226 - v->rxsubchans = V4L2_TUNER_SUB_MONO; 227 - v->capability = V4L2_TUNER_CAP_LOW; 228 - v->audmode = V4L2_TUNER_MODE_MONO; 229 - v->signal = 0xffff * gemtek_pci_getsignal(card); 230 - return 0; 231 - } 232 - 233 - static int vidioc_s_tuner(struct file *file, void *priv, 234 - struct v4l2_tuner *v) 235 - { 236 - return v->index ? -EINVAL : 0; 237 - } 238 - 239 - static int vidioc_s_frequency(struct file *file, void *priv, 240 - struct v4l2_frequency *f) 241 - { 242 - struct gemtek_pci *card = video_drvdata(file); 243 - 244 - if (f->tuner != 0 || f->type != V4L2_TUNER_RADIO) 245 - return -EINVAL; 246 - if (f->frequency < GEMTEK_PCI_RANGE_LOW || 247 - f->frequency > GEMTEK_PCI_RANGE_HIGH) 248 - return -EINVAL; 249 - gemtek_pci_setfrequency(card, f->frequency); 250 - card->mute = false; 251 - return 0; 252 - } 253 - 254 - static int vidioc_g_frequency(struct file *file, void *priv, 255 - struct v4l2_frequency *f) 256 - { 257 - struct gemtek_pci *card = video_drvdata(file); 258 - 259 - if (f->tuner != 0) 260 - return -EINVAL; 261 - f->type = V4L2_TUNER_RADIO; 262 - f->frequency = card->current_frequency; 263 - return 0; 264 - } 265 - 266 - static int vidioc_queryctrl(struct file *file, void *priv, 267 - struct v4l2_queryctrl *qc) 268 - { 269 - switch (qc->id) { 270 - case V4L2_CID_AUDIO_MUTE: 271 - return v4l2_ctrl_query_fill(qc, 0, 1, 1, 1); 272 - case V4L2_CID_AUDIO_VOLUME: 273 - return v4l2_ctrl_query_fill(qc, 0, 65535, 65535, 65535); 274 - } 275 - return -EINVAL; 276 - } 277 - 278 - static int vidioc_g_ctrl(struct file *file, void *priv, 279 - struct v4l2_control *ctrl) 280 - { 281 - struct gemtek_pci *card = video_drvdata(file); 282 - 283 - switch (ctrl->id) { 284 - case V4L2_CID_AUDIO_MUTE: 285 - ctrl->value = card->mute; 286 - return 0; 287 - case V4L2_CID_AUDIO_VOLUME: 288 - if (card->mute) 289 - ctrl->value = 0; 290 - else 291 - ctrl->value = 65535; 292 - return 0; 293 - } 294 - return -EINVAL; 295 - } 296 - 297 - static int vidioc_s_ctrl(struct file *file, void *priv, 298 - struct v4l2_control *ctrl) 299 - { 300 - struct gemtek_pci *card = video_drvdata(file); 301 - 302 - switch (ctrl->id) { 303 - case V4L2_CID_AUDIO_MUTE: 304 - if (ctrl->value) 305 - gemtek_pci_mute(card); 306 - else 307 - gemtek_pci_unmute(card); 308 - return 0; 309 - case V4L2_CID_AUDIO_VOLUME: 310 - if (ctrl->value) 311 - gemtek_pci_unmute(card); 312 - else 313 - gemtek_pci_mute(card); 314 - return 0; 315 - } 316 - return -EINVAL; 317 - } 318 - 319 - static int vidioc_g_input(struct file *filp, void *priv, unsigned int *i) 320 - { 321 - *i = 0; 322 - return 0; 323 - } 324 - 325 - static int vidioc_s_input(struct file *filp, void *priv, unsigned int i) 326 - { 327 - return i ? -EINVAL : 0; 328 - } 329 - 330 - static int vidioc_g_audio(struct file *file, void *priv, 331 - struct v4l2_audio *a) 332 - { 333 - a->index = 0; 334 - strlcpy(a->name, "Radio", sizeof(a->name)); 335 - a->capability = V4L2_AUDCAP_STEREO; 336 - return 0; 337 - } 338 - 339 - static int vidioc_s_audio(struct file *file, void *priv, 340 - struct v4l2_audio *a) 341 - { 342 - return a->index ? -EINVAL : 0; 343 - } 344 - 345 - enum { 346 - GEMTEK_PR103 347 - }; 348 - 349 - static char *card_names[] __devinitdata = { 350 - "GEMTEK_PR103" 351 - }; 352 - 353 - static struct pci_device_id gemtek_pci_id[] = 354 - { 355 - { PCI_VENDOR_ID_GEMTEK, PCI_DEVICE_ID_GEMTEK_PR103, 356 - PCI_ANY_ID, PCI_ANY_ID, 0, 0, GEMTEK_PR103 }, 357 - { 0 } 358 - }; 359 - 360 - MODULE_DEVICE_TABLE(pci, gemtek_pci_id); 361 - 362 - static const struct v4l2_file_operations gemtek_pci_fops = { 363 - .owner = THIS_MODULE, 364 - .unlocked_ioctl = video_ioctl2, 365 - }; 366 - 367 - static const struct v4l2_ioctl_ops gemtek_pci_ioctl_ops = { 368 - .vidioc_querycap = vidioc_querycap, 369 - .vidioc_g_tuner = vidioc_g_tuner, 370 - .vidioc_s_tuner = vidioc_s_tuner, 371 - .vidioc_g_audio = vidioc_g_audio, 372 - .vidioc_s_audio = vidioc_s_audio, 373 - .vidioc_g_input = vidioc_g_input, 374 - .vidioc_s_input = vidioc_s_input, 375 - .vidioc_g_frequency = vidioc_g_frequency, 376 - .vidioc_s_frequency = vidioc_s_frequency, 377 - .vidioc_queryctrl = vidioc_queryctrl, 378 - .vidioc_g_ctrl = vidioc_g_ctrl, 379 - .vidioc_s_ctrl = vidioc_s_ctrl, 380 - }; 381 - 382 - static int __devinit gemtek_pci_probe(struct pci_dev *pdev, const struct pci_device_id *pci_id) 383 - { 384 - struct gemtek_pci *card; 385 - struct v4l2_device *v4l2_dev; 386 - int res; 387 - 388 - card = kzalloc(sizeof(struct gemtek_pci), GFP_KERNEL); 389 - if (card == NULL) { 390 - dev_err(&pdev->dev, "out of memory\n"); 391 - return -ENOMEM; 392 - } 393 - 394 - v4l2_dev = &card->v4l2_dev; 395 - mutex_init(&card->lock); 396 - card->pdev = pdev; 397 - 398 - strlcpy(v4l2_dev->name, "gemtek_pci", sizeof(v4l2_dev->name)); 399 - 400 - res = v4l2_device_register(&pdev->dev, v4l2_dev); 401 - if (res < 0) { 402 - v4l2_err(v4l2_dev, "Could not register v4l2_device\n"); 403 - kfree(card); 404 - return res; 405 - } 406 - 407 - if (pci_enable_device(pdev)) 408 - goto err_pci; 409 - 410 - card->iobase = pci_resource_start(pdev, 0); 411 - card->length = pci_resource_len(pdev, 0); 412 - 413 - if (request_region(card->iobase, card->length, card_names[pci_id->driver_data]) == NULL) { 414 - v4l2_err(v4l2_dev, "i/o port already in use\n"); 415 - goto err_pci; 416 - } 417 - 418 - strlcpy(card->vdev.name, v4l2_dev->name, sizeof(card->vdev.name)); 419 - card->vdev.v4l2_dev = v4l2_dev; 420 - card->vdev.fops = &gemtek_pci_fops; 421 - card->vdev.ioctl_ops = &gemtek_pci_ioctl_ops; 422 - card->vdev.release = video_device_release_empty; 423 - video_set_drvdata(&card->vdev, card); 424 - 425 - gemtek_pci_mute(card); 426 - 427 - if (video_register_device(&card->vdev, VFL_TYPE_RADIO, nr_radio) < 0) 428 - goto err_video; 429 - 430 - v4l2_info(v4l2_dev, "Gemtek PCI Radio (rev. %d) found at 0x%04x-0x%04x.\n", 431 - pdev->revision, card->iobase, card->iobase + card->length - 1); 432 - 433 - return 0; 434 - 435 - err_video: 436 - release_region(card->iobase, card->length); 437 - 438 - err_pci: 439 - v4l2_device_unregister(v4l2_dev); 440 - kfree(card); 441 - return -ENODEV; 442 - } 443 - 444 - static void __devexit gemtek_pci_remove(struct pci_dev *pdev) 445 - { 446 - struct v4l2_device *v4l2_dev = dev_get_drvdata(&pdev->dev); 447 - struct gemtek_pci *card = to_gemtek_pci(v4l2_dev); 448 - 449 - video_unregister_device(&card->vdev); 450 - v4l2_device_unregister(v4l2_dev); 451 - 452 - release_region(card->iobase, card->length); 453 - 454 - if (mx) 455 - gemtek_pci_mute(card); 456 - 457 - kfree(card); 458 - } 459 - 460 - static struct pci_driver gemtek_pci_driver = { 461 - .name = "gemtek_pci", 462 - .id_table = gemtek_pci_id, 463 - .probe = gemtek_pci_probe, 464 - .remove = __devexit_p(gemtek_pci_remove), 465 - }; 466 - 467 - static int __init gemtek_pci_init(void) 468 - { 469 - return pci_register_driver(&gemtek_pci_driver); 470 - } 471 - 472 - static void __exit gemtek_pci_exit(void) 473 - { 474 - pci_unregister_driver(&gemtek_pci_driver); 475 - } 476 - 477 - module_init(gemtek_pci_init); 478 - module_exit(gemtek_pci_exit);
+2 -2
drivers/media/radio/radio-maxiradio.c
··· 77 77 /* TEA5757 pin mappings */ 78 78 static const int clk = 1, data = 2, wren = 4, mo_st = 8, power = 16; 79 79 80 - #define FREQ_LO (50 * 16000) 81 - #define FREQ_HI (150 * 16000) 80 + #define FREQ_LO (87 * 16000) 81 + #define FREQ_HI (108 * 16000) 82 82 83 83 #define FREQ_IF 171200 /* 10.7*16000 */ 84 84 #define FREQ_STEP 200 /* 12.5*16 */
+1 -1
drivers/media/radio/radio-wl1273.c
··· 1407 1407 .read = wl1273_fm_fops_read, 1408 1408 .write = wl1273_fm_fops_write, 1409 1409 .poll = wl1273_fm_fops_poll, 1410 - .ioctl = video_ioctl2, 1410 + .unlocked_ioctl = video_ioctl2, 1411 1411 .open = wl1273_fm_fops_open, 1412 1412 .release = wl1273_fm_fops_release, 1413 1413 };
+2 -7
drivers/media/radio/si470x/radio-si470x-common.c
··· 357 357 goto done; 358 358 359 359 /* sysconfig 1 */ 360 - radio->registers[SYSCONFIG1] = SYSCONFIG1_DE; 360 + radio->registers[SYSCONFIG1] = 361 + (de << 11) & SYSCONFIG1_DE; /* DE*/ 361 362 retval = si470x_set_register(radio, SYSCONFIG1); 362 363 if (retval < 0) 363 364 goto done; ··· 688 687 /* driver constants */ 689 688 strcpy(tuner->name, "FM"); 690 689 tuner->type = V4L2_TUNER_RADIO; 691 - #if defined(CONFIG_USB_SI470X) || defined(CONFIG_USB_SI470X_MODULE) 692 690 tuner->capability = V4L2_TUNER_CAP_LOW | V4L2_TUNER_CAP_STEREO | 693 691 V4L2_TUNER_CAP_RDS | V4L2_TUNER_CAP_RDS_BLOCK_IO; 694 - #else 695 - tuner->capability = V4L2_TUNER_CAP_LOW | V4L2_TUNER_CAP_STEREO; 696 - #endif 697 692 698 693 /* range limits */ 699 694 switch ((radio->registers[SYSCONFIG2] & SYSCONFIG2_BAND) >> 6) { ··· 715 718 tuner->rxsubchans = V4L2_TUNER_SUB_MONO; 716 719 else 717 720 tuner->rxsubchans = V4L2_TUNER_SUB_MONO | V4L2_TUNER_SUB_STEREO; 718 - #if defined(CONFIG_USB_SI470X) || defined(CONFIG_USB_SI470X_MODULE) 719 721 /* If there is a reliable method of detecting an RDS channel, 720 722 then this code should check for that before setting this 721 723 RDS subchannel. */ 722 724 tuner->rxsubchans |= V4L2_TUNER_SUB_RDS; 723 - #endif 724 725 725 726 /* mono/stereo selector */ 726 727 if ((radio->registers[POWERCFG] & POWERCFG_MONO) == 0)
+14 -9
drivers/media/rc/ene_ir.c
··· 446 446 447 447 select_timeout: 448 448 if (dev->rx_fan_input_inuse) { 449 - dev->rdev->rx_resolution = MS_TO_NS(ENE_FW_SAMPLE_PERIOD_FAN); 449 + dev->rdev->rx_resolution = US_TO_NS(ENE_FW_SAMPLE_PERIOD_FAN); 450 450 451 451 /* Fan input doesn't support timeouts, it just ends the 452 452 input with a maximum sample */ 453 453 dev->rdev->min_timeout = dev->rdev->max_timeout = 454 - MS_TO_NS(ENE_FW_SMPL_BUF_FAN_MSK * 454 + US_TO_NS(ENE_FW_SMPL_BUF_FAN_MSK * 455 455 ENE_FW_SAMPLE_PERIOD_FAN); 456 456 } else { 457 - dev->rdev->rx_resolution = MS_TO_NS(sample_period); 457 + dev->rdev->rx_resolution = US_TO_NS(sample_period); 458 458 459 459 /* Theoreticly timeout is unlimited, but we cap it 460 460 * because it was seen that on one device, it 461 461 * would stop sending spaces after around 250 msec. 462 462 * Besides, this is close to 2^32 anyway and timeout is u32. 463 463 */ 464 - dev->rdev->min_timeout = MS_TO_NS(127 * sample_period); 465 - dev->rdev->max_timeout = MS_TO_NS(200000); 464 + dev->rdev->min_timeout = US_TO_NS(127 * sample_period); 465 + dev->rdev->max_timeout = US_TO_NS(200000); 466 466 } 467 467 468 468 if (dev->hw_learning_and_tx_capable) 469 - dev->rdev->tx_resolution = MS_TO_NS(sample_period); 469 + dev->rdev->tx_resolution = US_TO_NS(sample_period); 470 470 471 471 if (dev->rdev->timeout > dev->rdev->max_timeout) 472 472 dev->rdev->timeout = dev->rdev->max_timeout; ··· 801 801 802 802 dbg("RX: %d (%s)", hw_sample, pulse ? "pulse" : "space"); 803 803 804 - ev.duration = MS_TO_NS(hw_sample); 804 + ev.duration = US_TO_NS(hw_sample); 805 805 ev.pulse = pulse; 806 806 ir_raw_event_store_with_filter(dev->rdev, &ev); 807 807 } ··· 821 821 dev->learning_mode_enabled = learning_mode_force; 822 822 823 823 /* Set reasonable default timeout */ 824 - dev->rdev->timeout = MS_TO_NS(150000); 824 + dev->rdev->timeout = US_TO_NS(150000); 825 825 } 826 826 827 827 /* Upload all hardware settings at once. Used at load and resume time */ ··· 1004 1004 /* validate resources */ 1005 1005 error = -ENODEV; 1006 1006 1007 + /* init these to -1, as 0 is valid for both */ 1008 + dev->hw_io = -1; 1009 + dev->irq = -1; 1010 + 1007 1011 if (!pnp_port_valid(pnp_dev, 0) || 1008 1012 pnp_port_len(pnp_dev, 0) < ENE_IO_SIZE) 1009 1013 goto error; ··· 1076 1072 rdev->input_name = "ENE eHome Infrared Remote Transceiver"; 1077 1073 } 1078 1074 1075 + dev->rdev = rdev; 1076 + 1079 1077 ene_rx_setup_hw_buffer(dev); 1080 1078 ene_setup_default_settings(dev); 1081 1079 ene_setup_hw_settings(dev); ··· 1089 1083 if (error < 0) 1090 1084 goto error; 1091 1085 1092 - dev->rdev = rdev; 1093 1086 ene_notice("driver has been succesfully loaded"); 1094 1087 return 0; 1095 1088 error:
-2
drivers/media/rc/ene_ir.h
··· 201 201 #define dbg_verbose(format, ...) __dbg(2, format, ## __VA_ARGS__) 202 202 #define dbg_regs(format, ...) __dbg(3, format, ## __VA_ARGS__) 203 203 204 - #define MS_TO_NS(msec) ((msec) * 1000) 205 - 206 204 struct ene_device { 207 205 struct pnp_dev *pnp_dev; 208 206 struct rc_dev *rdev;
+26 -34
drivers/media/rc/imon.c
··· 988 988 int retval; 989 989 struct imon_context *ictx = rc->priv; 990 990 struct device *dev = ictx->dev; 991 - bool pad_mouse; 992 991 unsigned char ir_proto_packet[] = { 993 992 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x86 }; 994 993 ··· 999 1000 case RC_TYPE_RC6: 1000 1001 dev_dbg(dev, "Configuring IR receiver for MCE protocol\n"); 1001 1002 ir_proto_packet[0] = 0x01; 1002 - pad_mouse = false; 1003 1003 break; 1004 1004 case RC_TYPE_UNKNOWN: 1005 1005 case RC_TYPE_OTHER: 1006 1006 dev_dbg(dev, "Configuring IR receiver for iMON protocol\n"); 1007 - if (pad_stabilize && !nomouse) 1008 - pad_mouse = true; 1009 - else { 1007 + if (!pad_stabilize) 1010 1008 dev_dbg(dev, "PAD stabilize functionality disabled\n"); 1011 - pad_mouse = false; 1012 - } 1013 1009 /* ir_proto_packet[0] = 0x00; // already the default */ 1014 1010 rc_type = RC_TYPE_OTHER; 1015 1011 break; 1016 1012 default: 1017 1013 dev_warn(dev, "Unsupported IR protocol specified, overriding " 1018 1014 "to iMON IR protocol\n"); 1019 - if (pad_stabilize && !nomouse) 1020 - pad_mouse = true; 1021 - else { 1015 + if (!pad_stabilize) 1022 1016 dev_dbg(dev, "PAD stabilize functionality disabled\n"); 1023 - pad_mouse = false; 1024 - } 1025 1017 /* ir_proto_packet[0] = 0x00; // already the default */ 1026 1018 rc_type = RC_TYPE_OTHER; 1027 1019 break; ··· 1025 1035 goto out; 1026 1036 1027 1037 ictx->rc_type = rc_type; 1028 - ictx->pad_mouse = pad_mouse; 1038 + ictx->pad_mouse = false; 1029 1039 1030 1040 out: 1031 1041 return retval; ··· 1507 1517 spin_unlock_irqrestore(&ictx->kc_lock, flags); 1508 1518 return; 1509 1519 } else { 1510 - ictx->pad_mouse = 0; 1520 + ictx->pad_mouse = false; 1511 1521 dev_dbg(dev, "mouse mode disabled, passing key value\n"); 1512 1522 } 1513 1523 } ··· 1746 1756 printk(KERN_CONT " (id 0x%02x)\n", ffdc_cfg_byte); 1747 1757 1748 1758 ictx->display_type = detected_display_type; 1749 - ictx->rdev->allowed_protos = allowed_protos; 1750 1759 ictx->rc_type = allowed_protos; 1751 1760 } 1752 1761 ··· 1828 1839 rdev->allowed_protos = RC_TYPE_OTHER | RC_TYPE_RC6; /* iMON PAD or MCE */ 1829 1840 rdev->change_protocol = imon_ir_change_protocol; 1830 1841 rdev->driver_name = MOD_NAME; 1831 - if (ictx->rc_type == RC_TYPE_RC6) 1832 - rdev->map_name = RC_MAP_IMON_MCE; 1833 - else 1834 - rdev->map_name = RC_MAP_IMON_PAD; 1835 1842 1836 1843 /* Enable front-panel buttons and/or knobs */ 1837 1844 memcpy(ictx->usb_tx_buf, &fp_packet, sizeof(fp_packet)); ··· 1836 1851 if (ret) 1837 1852 dev_info(ictx->dev, "panel buttons/knobs setup failed\n"); 1838 1853 1839 - if (ictx->product == 0xffdc) 1854 + if (ictx->product == 0xffdc) { 1840 1855 imon_get_ffdc_type(ictx); 1856 + rdev->allowed_protos = ictx->rc_type; 1857 + } 1841 1858 1842 1859 imon_set_display_type(ictx); 1860 + 1861 + if (ictx->rc_type == RC_TYPE_RC6) 1862 + rdev->map_name = RC_MAP_IMON_MCE; 1863 + else 1864 + rdev->map_name = RC_MAP_IMON_PAD; 1843 1865 1844 1866 ret = rc_register_device(rdev); 1845 1867 if (ret < 0) { ··· 2100 2108 goto find_endpoint_failed; 2101 2109 } 2102 2110 2103 - ictx->idev = imon_init_idev(ictx); 2104 - if (!ictx->idev) { 2105 - dev_err(dev, "%s: input device setup failed\n", __func__); 2106 - goto idev_setup_failed; 2107 - } 2108 - 2109 - ictx->rdev = imon_init_rdev(ictx); 2110 - if (!ictx->rdev) { 2111 - dev_err(dev, "%s: rc device setup failed\n", __func__); 2112 - goto rdev_setup_failed; 2113 - } 2114 - 2115 2111 usb_fill_int_urb(ictx->rx_urb_intf0, ictx->usbdev_intf0, 2116 2112 usb_rcvintpipe(ictx->usbdev_intf0, 2117 2113 ictx->rx_endpoint_intf0->bEndpointAddress), ··· 2113 2133 goto urb_submit_failed; 2114 2134 } 2115 2135 2136 + ictx->idev = imon_init_idev(ictx); 2137 + if (!ictx->idev) { 2138 + dev_err(dev, "%s: input device setup failed\n", __func__); 2139 + goto idev_setup_failed; 2140 + } 2141 + 2142 + ictx->rdev = imon_init_rdev(ictx); 2143 + if (!ictx->rdev) { 2144 + dev_err(dev, "%s: rc device setup failed\n", __func__); 2145 + goto rdev_setup_failed; 2146 + } 2147 + 2116 2148 return ictx; 2117 2149 2118 - urb_submit_failed: 2119 - rc_unregister_device(ictx->rdev); 2120 2150 rdev_setup_failed: 2121 2151 input_unregister_device(ictx->idev); 2122 2152 idev_setup_failed: 2153 + usb_kill_urb(ictx->rx_urb_intf0); 2154 + urb_submit_failed: 2123 2155 find_endpoint_failed: 2124 2156 mutex_unlock(&ictx->lock); 2125 2157 usb_free_urb(tx_urb);
+1 -1
drivers/media/rc/ir-raw.c
··· 233 233 234 234 /* used internally by the sysfs interface */ 235 235 u64 236 - ir_raw_get_allowed_protocols() 236 + ir_raw_get_allowed_protocols(void) 237 237 { 238 238 u64 protocols; 239 239 mutex_lock(&ir_raw_handler_lock);
+26 -26
drivers/media/rc/keymaps/rc-dib0700-nec.c
··· 19 19 20 20 static struct rc_map_table dib0700_nec_table[] = { 21 21 /* Key codes for the Pixelview SBTVD remote */ 22 - { 0x8613, KEY_MUTE }, 23 - { 0x8612, KEY_POWER }, 24 - { 0x8601, KEY_1 }, 25 - { 0x8602, KEY_2 }, 26 - { 0x8603, KEY_3 }, 27 - { 0x8604, KEY_4 }, 28 - { 0x8605, KEY_5 }, 29 - { 0x8606, KEY_6 }, 30 - { 0x8607, KEY_7 }, 31 - { 0x8608, KEY_8 }, 32 - { 0x8609, KEY_9 }, 33 - { 0x8600, KEY_0 }, 34 - { 0x860d, KEY_CHANNELUP }, 35 - { 0x8619, KEY_CHANNELDOWN }, 36 - { 0x8610, KEY_VOLUMEUP }, 37 - { 0x860c, KEY_VOLUMEDOWN }, 22 + { 0x866b13, KEY_MUTE }, 23 + { 0x866b12, KEY_POWER }, 24 + { 0x866b01, KEY_1 }, 25 + { 0x866b02, KEY_2 }, 26 + { 0x866b03, KEY_3 }, 27 + { 0x866b04, KEY_4 }, 28 + { 0x866b05, KEY_5 }, 29 + { 0x866b06, KEY_6 }, 30 + { 0x866b07, KEY_7 }, 31 + { 0x866b08, KEY_8 }, 32 + { 0x866b09, KEY_9 }, 33 + { 0x866b00, KEY_0 }, 34 + { 0x866b0d, KEY_CHANNELUP }, 35 + { 0x866b19, KEY_CHANNELDOWN }, 36 + { 0x866b10, KEY_VOLUMEUP }, 37 + { 0x866b0c, KEY_VOLUMEDOWN }, 38 38 39 - { 0x860a, KEY_CAMERA }, 40 - { 0x860b, KEY_ZOOM }, 41 - { 0x861b, KEY_BACKSPACE }, 42 - { 0x8615, KEY_ENTER }, 39 + { 0x866b0a, KEY_CAMERA }, 40 + { 0x866b0b, KEY_ZOOM }, 41 + { 0x866b1b, KEY_BACKSPACE }, 42 + { 0x866b15, KEY_ENTER }, 43 43 44 - { 0x861d, KEY_UP }, 45 - { 0x861e, KEY_DOWN }, 46 - { 0x860e, KEY_LEFT }, 47 - { 0x860f, KEY_RIGHT }, 44 + { 0x866b1d, KEY_UP }, 45 + { 0x866b1e, KEY_DOWN }, 46 + { 0x866b0e, KEY_LEFT }, 47 + { 0x866b0f, KEY_RIGHT }, 48 48 49 - { 0x8618, KEY_RECORD }, 50 - { 0x861a, KEY_STOP }, 49 + { 0x866b18, KEY_RECORD }, 50 + { 0x866b1a, KEY_STOP }, 51 51 52 52 /* Key codes for the EvolutePC TVWay+ remote */ 53 53 { 0x7a00, KEY_MENU },
+1 -2
drivers/media/rc/mceusb.c
··· 48 48 #define USB_BUFLEN 32 /* USB reception buffer length */ 49 49 #define USB_CTRL_MSG_SZ 2 /* Size of usb ctrl msg on gen1 hw */ 50 50 #define MCE_G1_INIT_MSGS 40 /* Init messages on gen1 hw to throw out */ 51 - #define MS_TO_NS(msec) ((msec) * 1000) 52 51 53 52 /* MCE constants */ 54 53 #define MCE_CMDBUF_SIZE 384 /* MCE Command buffer length */ ··· 857 858 ir->rem--; 858 859 rawir.pulse = ((ir->buf_in[i] & MCE_PULSE_BIT) != 0); 859 860 rawir.duration = (ir->buf_in[i] & MCE_PULSE_MASK) 860 - * MS_TO_NS(MCE_TIME_UNIT); 861 + * MS_TO_US(MCE_TIME_UNIT); 861 862 862 863 dev_dbg(ir->dev, "Storing %s with duration %d\n", 863 864 rawir.pulse ? "pulse" : "space",
+1 -10
drivers/media/video/Kconfig
··· 78 78 79 79 config VIDEO_HELPER_CHIPS_AUTO 80 80 bool "Autoselect pertinent encoders/decoders and other helper chips" 81 - default y if !EMBEDDED 81 + default y if !EXPERT 82 82 ---help--- 83 83 Most video cards may require additional modules to encode or 84 84 decode audio/video standards. This option will autoselect ··· 140 140 141 141 To compile this driver as a module, choose M here: the 142 142 module will be called tda9840. 143 - 144 - config VIDEO_TDA9875 145 - tristate "Philips TDA9875 audio processor" 146 - depends on VIDEO_V4L2 && I2C 147 - ---help--- 148 - Support for tda9875 audio decoder chip found on some bt8xx boards. 149 - 150 - To compile this driver as a module, choose M here: the 151 - module will be called tda9875. 152 143 153 144 config VIDEO_TEA6415C 154 145 tristate "Philips TEA6415C audio processor"
-1
drivers/media/video/Makefile
··· 27 27 obj-$(CONFIG_VIDEO_TUNER) += tuner.o 28 28 obj-$(CONFIG_VIDEO_TVAUDIO) += tvaudio.o 29 29 obj-$(CONFIG_VIDEO_TDA7432) += tda7432.o 30 - obj-$(CONFIG_VIDEO_TDA9875) += tda9875.o 31 30 obj-$(CONFIG_VIDEO_SAA6588) += saa6588.o 32 31 obj-$(CONFIG_VIDEO_TDA9840) += tda9840.o 33 32 obj-$(CONFIG_VIDEO_TEA6415C) += tea6415c.o
+11
drivers/media/video/adv7175.c
··· 303 303 return v4l2_chip_ident_i2c_client(client, chip, V4L2_IDENT_ADV7175, 0); 304 304 } 305 305 306 + static int adv7175_s_power(struct v4l2_subdev *sd, int on) 307 + { 308 + if (on) 309 + adv7175_write(sd, 0x01, 0x00); 310 + else 311 + adv7175_write(sd, 0x01, 0x78); 312 + 313 + return 0; 314 + } 315 + 306 316 /* ----------------------------------------------------------------------- */ 307 317 308 318 static const struct v4l2_subdev_core_ops adv7175_core_ops = { 309 319 .g_chip_ident = adv7175_g_chip_ident, 310 320 .init = adv7175_init, 321 + .s_power = adv7175_s_power, 311 322 }; 312 323 313 324 static const struct v4l2_subdev_video_ops adv7175_video_ops = {
-39
drivers/media/video/bt8xx/bttv-cards.c
··· 1373 1373 .gpiomute = 0x1800, 1374 1374 .audio_mode_gpio= fv2000s_audio, 1375 1375 .no_msp34xx = 1, 1376 - .no_tda9875 = 1, 1377 1376 .needs_tvaudio = 1, 1378 1377 .pll = PLL_28, 1379 1378 .tuner_type = TUNER_PHILIPS_PAL, ··· 1510 1511 .gpiomute = 0x09, 1511 1512 .needs_tvaudio = 1, 1512 1513 .no_msp34xx = 1, 1513 - .no_tda9875 = 1, 1514 1514 .pll = PLL_28, 1515 1515 .tuner_type = TUNER_PHILIPS_PAL, 1516 1516 .tuner_addr = ADDR_UNSET, ··· 1548 1550 .gpiomask2 = 0x07ff, 1549 1551 .muxsel = MUXSEL(3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3), 1550 1552 .no_msp34xx = 1, 1551 - .no_tda9875 = 1, 1552 1553 .tuner_type = TUNER_ABSENT, 1553 1554 .tuner_addr = ADDR_UNSET, 1554 1555 .muxsel_hook = rv605_muxsel, ··· 1683 1686 .tuner_type = TUNER_ABSENT, 1684 1687 .tuner_addr = ADDR_UNSET, 1685 1688 .no_msp34xx = 1, 1686 - .no_tda9875 = 1, 1687 1689 .no_tda7432 = 1, 1688 1690 }, 1689 1691 [BTTV_BOARD_OSPREY1x0_848] = { ··· 1695 1699 .tuner_type = TUNER_ABSENT, 1696 1700 .tuner_addr = ADDR_UNSET, 1697 1701 .no_msp34xx = 1, 1698 - .no_tda9875 = 1, 1699 1702 .no_tda7432 = 1, 1700 1703 }, 1701 1704 ··· 1709 1714 .tuner_type = TUNER_ABSENT, 1710 1715 .tuner_addr = ADDR_UNSET, 1711 1716 .no_msp34xx = 1, 1712 - .no_tda9875 = 1, 1713 1717 .no_tda7432 = 1, 1714 1718 }, 1715 1719 [BTTV_BOARD_OSPREY1x1] = { ··· 1721 1727 .tuner_type = TUNER_ABSENT, 1722 1728 .tuner_addr = ADDR_UNSET, 1723 1729 .no_msp34xx = 1, 1724 - .no_tda9875 = 1, 1725 1730 .no_tda7432 = 1, 1726 1731 }, 1727 1732 [BTTV_BOARD_OSPREY1x1_SVID] = { ··· 1733 1740 .tuner_type = TUNER_ABSENT, 1734 1741 .tuner_addr = ADDR_UNSET, 1735 1742 .no_msp34xx = 1, 1736 - .no_tda9875 = 1, 1737 1743 .no_tda7432 = 1, 1738 1744 }, 1739 1745 [BTTV_BOARD_OSPREY2xx] = { ··· 1745 1753 .tuner_type = TUNER_ABSENT, 1746 1754 .tuner_addr = ADDR_UNSET, 1747 1755 .no_msp34xx = 1, 1748 - .no_tda9875 = 1, 1749 1756 .no_tda7432 = 1, 1750 1757 }, 1751 1758 ··· 1759 1768 .tuner_type = TUNER_ABSENT, 1760 1769 .tuner_addr = ADDR_UNSET, 1761 1770 .no_msp34xx = 1, 1762 - .no_tda9875 = 1, 1763 1771 .no_tda7432 = 1, 1764 1772 }, 1765 1773 [BTTV_BOARD_OSPREY2x0] = { ··· 1771 1781 .tuner_type = TUNER_ABSENT, 1772 1782 .tuner_addr = ADDR_UNSET, 1773 1783 .no_msp34xx = 1, 1774 - .no_tda9875 = 1, 1775 1784 .no_tda7432 = 1, 1776 1785 }, 1777 1786 [BTTV_BOARD_OSPREY500] = { ··· 1783 1794 .tuner_type = TUNER_ABSENT, 1784 1795 .tuner_addr = ADDR_UNSET, 1785 1796 .no_msp34xx = 1, 1786 - .no_tda9875 = 1, 1787 1797 .no_tda7432 = 1, 1788 1798 }, 1789 1799 [BTTV_BOARD_OSPREY540] = { ··· 1793 1805 .tuner_type = TUNER_ABSENT, 1794 1806 .tuner_addr = ADDR_UNSET, 1795 1807 .no_msp34xx = 1, 1796 - .no_tda9875 = 1, 1797 1808 .no_tda7432 = 1, 1798 1809 }, 1799 1810 ··· 1807 1820 .tuner_type = TUNER_ABSENT, 1808 1821 .tuner_addr = ADDR_UNSET, 1809 1822 .no_msp34xx = 1, 1810 - .no_tda9875 = 1, 1811 1823 .no_tda7432 = 1, /* must avoid, conflicts with the bt860 */ 1812 1824 }, 1813 1825 [BTTV_BOARD_IDS_EAGLE] = { ··· 1821 1835 .muxsel = MUXSEL(2, 2, 2, 2), 1822 1836 .muxsel_hook = eagle_muxsel, 1823 1837 .no_msp34xx = 1, 1824 - .no_tda9875 = 1, 1825 1838 .pll = PLL_28, 1826 1839 }, 1827 1840 [BTTV_BOARD_PINNACLESAT] = { ··· 1831 1846 .tuner_type = TUNER_ABSENT, 1832 1847 .tuner_addr = ADDR_UNSET, 1833 1848 .no_msp34xx = 1, 1834 - .no_tda9875 = 1, 1835 1849 .no_tda7432 = 1, 1836 1850 .muxsel = MUXSEL(3, 1), 1837 1851 .pll = PLL_28, ··· 1881 1897 .svhs = 2, 1882 1898 .gpiomask = 0, 1883 1899 .no_msp34xx = 1, 1884 - .no_tda9875 = 1, 1885 1900 .no_tda7432 = 1, 1886 1901 .muxsel = MUXSEL(2, 0, 1), 1887 1902 .pll = PLL_28, ··· 1953 1970 /* Tuner, CVid, SVid, CVid over SVid connector */ 1954 1971 .muxsel = MUXSEL(2, 3, 1, 1), 1955 1972 .gpiomask = 0, 1956 - .no_tda9875 = 1, 1957 1973 .no_tda7432 = 1, 1958 1974 .tuner_type = TUNER_PHILIPS_PAL_I, 1959 1975 .tuner_addr = ADDR_UNSET, ··· 1999 2017 .muxsel = MUXSEL(2,2,2,2, 3,3,3,3, 1,1,1,1, 0,0,0,0), 2000 2018 .muxsel_hook = xguard_muxsel, 2001 2019 .no_msp34xx = 1, 2002 - .no_tda9875 = 1, 2003 2020 .no_tda7432 = 1, 2004 2021 .pll = PLL_28, 2005 2022 }, ··· 2010 2029 .svhs = NO_SVHS, 2011 2030 .muxsel = MUXSEL(2, 3, 1, 0), 2012 2031 .no_msp34xx = 1, 2013 - .no_tda9875 = 1, 2014 2032 .no_tda7432 = 1, 2015 2033 .pll = PLL_28, 2016 2034 .tuner_type = TUNER_ABSENT, ··· 2114 2134 .svhs = NO_SVHS, /* card has no svhs */ 2115 2135 .needs_tvaudio = 0, 2116 2136 .no_msp34xx = 1, 2117 - .no_tda9875 = 1, 2118 2137 .no_tda7432 = 1, 2119 2138 .gpiomask = 0x00, 2120 2139 .muxsel = MUXSEL(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0), ··· 2135 2156 [BTTV_BOARD_TWINHAN_DST] = { 2136 2157 .name = "Twinhan DST + clones", 2137 2158 .no_msp34xx = 1, 2138 - .no_tda9875 = 1, 2139 2159 .no_tda7432 = 1, 2140 2160 .tuner_type = TUNER_ABSENT, 2141 2161 .tuner_addr = ADDR_UNSET, ··· 2149 2171 /* Vid In, SVid In, Vid over SVid in connector */ 2150 2172 .muxsel = MUXSEL(3, 1, 1, 3), 2151 2173 .no_msp34xx = 1, 2152 - .no_tda9875 = 1, 2153 2174 .no_tda7432 = 1, 2154 2175 .tuner_type = TUNER_ABSENT, 2155 2176 .tuner_addr = ADDR_UNSET, ··· 2203 2226 .svhs = NO_SVHS, 2204 2227 .muxsel = MUXSEL(2, 3, 1, 0), 2205 2228 .no_msp34xx = 1, 2206 - .no_tda9875 = 1, 2207 2229 .no_tda7432 = 1, 2208 2230 .needs_tvaudio = 0, 2209 2231 .tuner_type = TUNER_ABSENT, ··· 2254 2278 .gpiomask = 0, 2255 2279 .gpiomask2 = 0x3C<<16,/*Set the GPIO[18]->GPIO[21] as output pin.==> drive the video inputs through analog multiplexers*/ 2256 2280 .no_msp34xx = 1, 2257 - .no_tda9875 = 1, 2258 2281 .no_tda7432 = 1, 2259 2282 /*878A input is always MUX0, see above.*/ 2260 2283 .muxsel = MUXSEL(2, 2, 2, 2), ··· 2277 2302 .tuner_type = TUNER_TEMIC_PAL, 2278 2303 .tuner_addr = ADDR_UNSET, 2279 2304 .no_msp34xx = 1, 2280 - .no_tda9875 = 1, 2281 2305 }, 2282 2306 [BTTV_BOARD_AVDVBT_771] = { 2283 2307 /* Wolfram Joost <wojo@frokaschwei.de> */ ··· 2287 2313 .tuner_addr = ADDR_UNSET, 2288 2314 .muxsel = MUXSEL(3, 3), 2289 2315 .no_msp34xx = 1, 2290 - .no_tda9875 = 1, 2291 2316 .no_tda7432 = 1, 2292 2317 .pll = PLL_28, 2293 2318 .has_dvb = 1, ··· 2302 2329 .svhs = 1, 2303 2330 .muxsel = MUXSEL(3, 1, 2, 0), /* Comp0, S-Video, ?, ? */ 2304 2331 .no_msp34xx = 1, 2305 - .no_tda9875 = 1, 2306 2332 .no_tda7432 = 1, 2307 2333 .pll = PLL_28, 2308 2334 .tuner_type = TUNER_ABSENT, ··· 2365 2393 /* Chris Pascoe <c.pascoe@itee.uq.edu.au> */ 2366 2394 .name = "DViCO FusionHDTV DVB-T Lite", 2367 2395 .no_msp34xx = 1, 2368 - .no_tda9875 = 1, 2369 2396 .no_tda7432 = 1, 2370 2397 .pll = PLL_28, 2371 2398 .no_video = 1, ··· 2411 2440 .muxsel = MUXSEL(2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2), 2412 2441 .pll = PLL_28, 2413 2442 .no_msp34xx = 1, 2414 - .no_tda9875 = 1, 2415 2443 .no_tda7432 = 1, 2416 2444 .tuner_type = TUNER_ABSENT, 2417 2445 .tuner_addr = ADDR_UNSET, ··· 2448 2478 .pll = PLL_28, 2449 2479 .no_msp34xx = 1, 2450 2480 .no_tda7432 = 1, 2451 - .no_tda9875 = 1, 2452 2481 .muxsel_hook = kodicom4400r_muxsel, 2453 2482 }, 2454 2483 [BTTV_BOARD_KODICOM_4400R_SL] = { ··· 2469 2500 .pll = PLL_28, 2470 2501 .no_msp34xx = 1, 2471 2502 .no_tda7432 = 1, 2472 - .no_tda9875 = 1, 2473 2503 .muxsel_hook = kodicom4400r_muxsel, 2474 2504 }, 2475 2505 /* ---- card 0x86---------------------------------- */ ··· 2498 2530 .gpiomux = { 0x00400005, 0, 0x00000001, 0 }, 2499 2531 .gpiomute = 0x00c00007, 2500 2532 .no_msp34xx = 1, 2501 - .no_tda9875 = 1, 2502 2533 .no_tda7432 = 1, 2503 2534 .has_dvb = 1, 2504 2535 }, ··· 2597 2630 .tuner_type = TUNER_ABSENT, 2598 2631 .tuner_addr = ADDR_UNSET, 2599 2632 .no_msp34xx = 1, 2600 - .no_tda9875 = 1, 2601 2633 .no_tda7432 = 1, 2602 2634 }, 2603 2635 /* ---- card 0x8d ---------------------------------- */ ··· 2624 2658 .muxsel = MUXSEL(2, 3, 1, 1), 2625 2659 .gpiomux = { 100000, 100002, 100002, 100000 }, 2626 2660 .no_msp34xx = 1, 2627 - .no_tda9875 = 1, 2628 2661 .no_tda7432 = 1, 2629 2662 .pll = PLL_28, 2630 2663 .tuner_type = TUNER_TNF_5335MF, ··· 2639 2674 .gpiomask = 0x0f, /* old: 7 */ 2640 2675 .muxsel = MUXSEL(0, 1, 3, 2), /* Composite 0-3 */ 2641 2676 .no_msp34xx = 1, 2642 - .no_tda9875 = 1, 2643 2677 .no_tda7432 = 1, 2644 2678 .tuner_type = TUNER_ABSENT, 2645 2679 .tuner_addr = ADDR_UNSET, ··· 2696 2732 .gpiomux = { 0x00400005, 0, 0x00000001, 0 }, 2697 2733 .gpiomute = 0x00c00007, 2698 2734 .no_msp34xx = 1, 2699 - .no_tda9875 = 1, 2700 2735 .no_tda7432 = 1, 2701 2736 }, 2702 2737 /* ---- card 0x95---------------------------------- */ ··· 2837 2874 .pll = PLL_28, 2838 2875 .no_msp34xx = 1, 2839 2876 .no_tda7432 = 1, 2840 - .no_tda9875 = 1, 2841 2877 .muxsel_hook = gv800s_muxsel, 2842 2878 }, 2843 2879 [BTTV_BOARD_GEOVISION_GV800S_SL] = { ··· 2861 2899 .pll = PLL_28, 2862 2900 .no_msp34xx = 1, 2863 2901 .no_tda7432 = 1, 2864 - .no_tda9875 = 1, 2865 2902 .muxsel_hook = gv800s_muxsel, 2866 2903 }, 2867 2904 [BTTV_BOARD_PV183] = {
-1
drivers/media/video/bt8xx/bttv.h
··· 234 234 235 235 /* i2c audio flags */ 236 236 unsigned int no_msp34xx:1; 237 - unsigned int no_tda9875:1; 238 237 unsigned int no_tda7432:1; 239 238 unsigned int needs_tvaudio:1; 240 239 unsigned int msp34xx_alt:1;
+8 -3
drivers/media/video/cafe_ccic.c
··· 2001 2001 .min_width = 320, 2002 2002 .min_height = 240, 2003 2003 }; 2004 + struct i2c_board_info ov7670_info = { 2005 + .type = "ov7670", 2006 + .addr = 0x42, 2007 + .platform_data = &sensor_cfg, 2008 + }; 2004 2009 2005 2010 /* 2006 2011 * Start putting together one of our big camera structures. ··· 2067 2062 if (dmi_check_system(olpc_xo1_dmi)) 2068 2063 sensor_cfg.clock_speed = 45; 2069 2064 2070 - cam->sensor_addr = 0x42; 2071 - cam->sensor = v4l2_i2c_new_subdev_cfg(&cam->v4l2_dev, &cam->i2c_adapter, 2072 - "ov7670", 0, &sensor_cfg, cam->sensor_addr, NULL); 2065 + cam->sensor_addr = ov7670_info.addr; 2066 + cam->sensor = v4l2_i2c_new_subdev_board(&cam->v4l2_dev, &cam->i2c_adapter, 2067 + &ov7670_info, NULL); 2073 2068 if (cam->sensor == NULL) { 2074 2069 ret = -ENODEV; 2075 2070 goto out_smbus;
+1 -1
drivers/media/video/cpia2/cpia2.h
··· 378 378 379 379 struct camera_data { 380 380 /* locks */ 381 - struct mutex busy_lock; /* guard against SMP multithreading */ 381 + struct mutex v4l2_lock; /* serialize file operations */ 382 382 struct v4l2_prio_state prio; 383 383 384 384 /* camera status */
+15 -50
drivers/media/video/cpia2/cpia2_core.c
··· 2247 2247 2248 2248 2249 2249 cam->present = 1; 2250 - mutex_init(&cam->busy_lock); 2250 + mutex_init(&cam->v4l2_lock); 2251 2251 init_waitqueue_head(&cam->wq_stream); 2252 2252 2253 2253 return cam; ··· 2365 2365 char __user *buf, unsigned long count, int noblock) 2366 2366 { 2367 2367 struct framebuf *frame; 2368 - if (!count) { 2368 + 2369 + if (!count) 2369 2370 return 0; 2370 - } 2371 2371 2372 2372 if (!buf) { 2373 2373 ERR("%s: buffer NULL\n",__func__); ··· 2379 2379 return -EINVAL; 2380 2380 } 2381 2381 2382 - /* make this _really_ smp and multithread-safe */ 2383 - if (mutex_lock_interruptible(&cam->busy_lock)) 2384 - return -ERESTARTSYS; 2385 - 2386 2382 if (!cam->present) { 2387 2383 LOG("%s: camera removed\n",__func__); 2388 - mutex_unlock(&cam->busy_lock); 2389 2384 return 0; /* EOF */ 2390 2385 } 2391 2386 2392 - if(!cam->streaming) { 2387 + if (!cam->streaming) { 2393 2388 /* Start streaming */ 2394 2389 cpia2_usb_stream_start(cam, 2395 2390 cam->params.camera_state.stream_mode); ··· 2393 2398 /* Copy cam->curbuff in case it changes while we're processing */ 2394 2399 frame = cam->curbuff; 2395 2400 if (noblock && frame->status != FRAME_READY) { 2396 - mutex_unlock(&cam->busy_lock); 2397 2401 return -EAGAIN; 2398 2402 } 2399 2403 2400 - if(frame->status != FRAME_READY) { 2401 - mutex_unlock(&cam->busy_lock); 2404 + if (frame->status != FRAME_READY) { 2405 + mutex_unlock(&cam->v4l2_lock); 2402 2406 wait_event_interruptible(cam->wq_stream, 2403 2407 !cam->present || 2404 2408 (frame = cam->curbuff)->status == FRAME_READY); 2409 + mutex_lock(&cam->v4l2_lock); 2405 2410 if (signal_pending(current)) 2406 2411 return -ERESTARTSYS; 2407 - /* make this _really_ smp and multithread-safe */ 2408 - if (mutex_lock_interruptible(&cam->busy_lock)) { 2409 - return -ERESTARTSYS; 2410 - } 2411 - if(!cam->present) { 2412 - mutex_unlock(&cam->busy_lock); 2412 + if (!cam->present) 2413 2413 return 0; 2414 - } 2415 2414 } 2416 2415 2417 2416 /* copy data to user space */ 2418 - if (frame->length > count) { 2419 - mutex_unlock(&cam->busy_lock); 2417 + if (frame->length > count) 2420 2418 return -EFAULT; 2421 - } 2422 - if (copy_to_user(buf, frame->data, frame->length)) { 2423 - mutex_unlock(&cam->busy_lock); 2419 + if (copy_to_user(buf, frame->data, frame->length)) 2424 2420 return -EFAULT; 2425 - } 2426 2421 2427 2422 count = frame->length; 2428 2423 2429 2424 frame->status = FRAME_EMPTY; 2430 2425 2431 - mutex_unlock(&cam->busy_lock); 2432 2426 return count; 2433 2427 } 2434 2428 ··· 2431 2447 { 2432 2448 unsigned int status=0; 2433 2449 2434 - if(!cam) { 2450 + if (!cam) { 2435 2451 ERR("%s: Internal error, camera_data not found!\n",__func__); 2436 2452 return POLLERR; 2437 2453 } 2438 2454 2439 - mutex_lock(&cam->busy_lock); 2440 - 2441 - if(!cam->present) { 2442 - mutex_unlock(&cam->busy_lock); 2455 + if (!cam->present) 2443 2456 return POLLHUP; 2444 - } 2445 2457 2446 2458 if(!cam->streaming) { 2447 2459 /* Start streaming */ ··· 2445 2465 cam->params.camera_state.stream_mode); 2446 2466 } 2447 2467 2448 - mutex_unlock(&cam->busy_lock); 2449 2468 poll_wait(filp, &cam->wq_stream, wait); 2450 - mutex_lock(&cam->busy_lock); 2451 2469 2452 2470 if(!cam->present) 2453 2471 status = POLLHUP; 2454 2472 else if(cam->curbuff->status == FRAME_READY) 2455 2473 status = POLLIN | POLLRDNORM; 2456 2474 2457 - mutex_unlock(&cam->busy_lock); 2458 2475 return status; 2459 2476 } 2460 2477 ··· 2473 2496 2474 2497 DBG("mmap offset:%ld size:%ld\n", start_offset, size); 2475 2498 2476 - /* make this _really_ smp-safe */ 2477 - if (mutex_lock_interruptible(&cam->busy_lock)) 2478 - return -ERESTARTSYS; 2479 - 2480 - if (!cam->present) { 2481 - mutex_unlock(&cam->busy_lock); 2499 + if (!cam->present) 2482 2500 return -ENODEV; 2483 - } 2484 2501 2485 2502 if (size > cam->frame_size*cam->num_frames || 2486 2503 (start_offset % cam->frame_size) != 0 || 2487 - (start_offset+size > cam->frame_size*cam->num_frames)) { 2488 - mutex_unlock(&cam->busy_lock); 2504 + (start_offset+size > cam->frame_size*cam->num_frames)) 2489 2505 return -EINVAL; 2490 - } 2491 2506 2492 2507 pos = ((unsigned long) (cam->frame_buffer)) + start_offset; 2493 2508 while (size > 0) { 2494 2509 page = kvirt_to_pa(pos); 2495 - if (remap_pfn_range(vma, start, page >> PAGE_SHIFT, PAGE_SIZE, PAGE_SHARED)) { 2496 - mutex_unlock(&cam->busy_lock); 2510 + if (remap_pfn_range(vma, start, page >> PAGE_SHIFT, PAGE_SIZE, PAGE_SHARED)) 2497 2511 return -EAGAIN; 2498 - } 2499 2512 start += PAGE_SIZE; 2500 2513 pos += PAGE_SIZE; 2501 2514 if (size > PAGE_SIZE) ··· 2495 2528 } 2496 2529 2497 2530 cam->mmapped = true; 2498 - mutex_unlock(&cam->busy_lock); 2499 2531 return 0; 2500 2532 } 2501 -
+36 -72
drivers/media/video/cpia2/cpia2_v4l.c
··· 238 238 static int cpia2_open(struct file *file) 239 239 { 240 240 struct camera_data *cam = video_drvdata(file); 241 - int retval = 0; 241 + struct cpia2_fh *fh; 242 242 243 243 if (!cam) { 244 244 ERR("Internal error, camera_data not found!\n"); 245 245 return -ENODEV; 246 246 } 247 247 248 - if(mutex_lock_interruptible(&cam->busy_lock)) 249 - return -ERESTARTSYS; 248 + if (!cam->present) 249 + return -ENODEV; 250 250 251 - if(!cam->present) { 252 - retval = -ENODEV; 253 - goto err_return; 251 + if (cam->open_count == 0) { 252 + if (cpia2_allocate_buffers(cam)) 253 + return -ENOMEM; 254 + 255 + /* reset the camera */ 256 + if (cpia2_reset_camera(cam) < 0) 257 + return -EIO; 258 + 259 + cam->APP_len = 0; 260 + cam->COM_len = 0; 254 261 } 255 262 256 - if (cam->open_count > 0) { 257 - goto skip_init; 258 - } 259 - 260 - if (cpia2_allocate_buffers(cam)) { 261 - retval = -ENOMEM; 262 - goto err_return; 263 - } 264 - 265 - /* reset the camera */ 266 - if (cpia2_reset_camera(cam) < 0) { 267 - retval = -EIO; 268 - goto err_return; 269 - } 270 - 271 - cam->APP_len = 0; 272 - cam->COM_len = 0; 273 - 274 - skip_init: 275 - { 276 - struct cpia2_fh *fh = kmalloc(sizeof(*fh),GFP_KERNEL); 277 - if(!fh) { 278 - retval = -ENOMEM; 279 - goto err_return; 280 - } 281 - file->private_data = fh; 282 - fh->prio = V4L2_PRIORITY_UNSET; 283 - v4l2_prio_open(&cam->prio, &fh->prio); 284 - fh->mmapped = 0; 285 - } 263 + fh = kmalloc(sizeof(*fh), GFP_KERNEL); 264 + if (!fh) 265 + return -ENOMEM; 266 + file->private_data = fh; 267 + fh->prio = V4L2_PRIORITY_UNSET; 268 + v4l2_prio_open(&cam->prio, &fh->prio); 269 + fh->mmapped = 0; 286 270 287 271 ++cam->open_count; 288 272 289 273 cpia2_dbg_dump_registers(cam); 290 - 291 - err_return: 292 - mutex_unlock(&cam->busy_lock); 293 - return retval; 274 + return 0; 294 275 } 295 276 296 277 /****************************************************************************** ··· 285 304 struct camera_data *cam = video_get_drvdata(dev); 286 305 struct cpia2_fh *fh = file->private_data; 287 306 288 - mutex_lock(&cam->busy_lock); 289 - 290 307 if (cam->present && 291 - (cam->open_count == 1 292 - || fh->prio == V4L2_PRIORITY_RECORD 293 - )) { 308 + (cam->open_count == 1 || fh->prio == V4L2_PRIORITY_RECORD)) { 294 309 cpia2_usb_stream_stop(cam); 295 310 296 - if(cam->open_count == 1) { 311 + if (cam->open_count == 1) { 297 312 /* save camera state for later open */ 298 313 cpia2_save_camera_state(cam); 299 314 ··· 298 321 } 299 322 } 300 323 301 - { 302 - if(fh->mmapped) 303 - cam->mmapped = 0; 304 - v4l2_prio_close(&cam->prio, fh->prio); 305 - file->private_data = NULL; 306 - kfree(fh); 307 - } 324 + if (fh->mmapped) 325 + cam->mmapped = 0; 326 + v4l2_prio_close(&cam->prio, fh->prio); 327 + file->private_data = NULL; 328 + kfree(fh); 308 329 309 330 if (--cam->open_count == 0) { 310 331 cpia2_free_buffers(cam); 311 332 if (!cam->present) { 312 333 video_unregister_device(dev); 313 - mutex_unlock(&cam->busy_lock); 314 334 kfree(cam); 315 335 return 0; 316 336 } 317 337 } 318 - 319 - mutex_unlock(&cam->busy_lock); 320 338 321 339 return 0; 322 340 } ··· 377 405 return 0; 378 406 } 379 407 380 - mutex_unlock(&cam->busy_lock); 408 + mutex_unlock(&cam->v4l2_lock); 381 409 wait_event_interruptible(cam->wq_stream, 382 410 !cam->streaming || 383 411 frame->status == FRAME_READY); 384 - mutex_lock(&cam->busy_lock); 412 + mutex_lock(&cam->v4l2_lock); 385 413 if (signal_pending(current)) 386 414 return -ERESTARTSYS; 387 415 if(!cam->present) ··· 1265 1293 if(frame < 0) { 1266 1294 /* Wait for a frame to become available */ 1267 1295 struct framebuf *cb=cam->curbuff; 1268 - mutex_unlock(&cam->busy_lock); 1296 + mutex_unlock(&cam->v4l2_lock); 1269 1297 wait_event_interruptible(cam->wq_stream, 1270 1298 !cam->present || 1271 1299 (cb=cam->curbuff)->status == FRAME_READY); 1272 - mutex_lock(&cam->busy_lock); 1300 + mutex_lock(&cam->v4l2_lock); 1273 1301 if (signal_pending(current)) 1274 1302 return -ERESTARTSYS; 1275 1303 if(!cam->present) ··· 1309 1337 if (!cam) 1310 1338 return -ENOTTY; 1311 1339 1312 - /* make this _really_ smp-safe */ 1313 - if (mutex_lock_interruptible(&cam->busy_lock)) 1314 - return -ERESTARTSYS; 1315 - 1316 - if (!cam->present) { 1317 - mutex_unlock(&cam->busy_lock); 1340 + if (!cam->present) 1318 1341 return -ENODEV; 1319 - } 1320 1342 1321 1343 /* Priority check */ 1322 1344 switch (cmd) { ··· 1318 1352 { 1319 1353 struct cpia2_fh *fh = file->private_data; 1320 1354 retval = v4l2_prio_check(&cam->prio, fh->prio); 1321 - if(retval) { 1322 - mutex_unlock(&cam->busy_lock); 1355 + if (retval) 1323 1356 return retval; 1324 - } 1325 1357 break; 1326 1358 } 1327 1359 default: ··· 1493 1529 break; 1494 1530 } 1495 1531 1496 - mutex_unlock(&cam->busy_lock); 1497 1532 return retval; 1498 1533 } 1499 1534 ··· 1559 1596 .release = cpia2_close, 1560 1597 .read = cpia2_v4l_read, 1561 1598 .poll = cpia2_v4l_poll, 1562 - .ioctl = cpia2_ioctl, 1599 + .unlocked_ioctl = cpia2_ioctl, 1563 1600 .mmap = cpia2_mmap, 1564 1601 }; 1565 1602 ··· 1583 1620 1584 1621 memcpy(cam->vdev, &cpia2_template, sizeof(cpia2_template)); 1585 1622 video_set_drvdata(cam->vdev, cam); 1623 + cam->vdev->lock = &cam->v4l2_lock; 1586 1624 1587 1625 reset_camera_struct_v4l(cam); 1588 1626
+2 -22
drivers/media/video/cx18/cx18-driver.c
··· 664 664 { 665 665 snprintf(cx->in_workq_name, sizeof(cx->in_workq_name), "%s-in", 666 666 cx->v4l2_dev.name); 667 - cx->in_work_queue = create_singlethread_workqueue(cx->in_workq_name); 667 + cx->in_work_queue = alloc_ordered_workqueue(cx->in_workq_name, 0); 668 668 if (cx->in_work_queue == NULL) { 669 669 CX18_ERR("Unable to create incoming mailbox handler thread\n"); 670 - return -ENOMEM; 671 - } 672 - return 0; 673 - } 674 - 675 - static int __devinit cx18_create_out_workq(struct cx18 *cx) 676 - { 677 - snprintf(cx->out_workq_name, sizeof(cx->out_workq_name), "%s-out", 678 - cx->v4l2_dev.name); 679 - cx->out_work_queue = create_workqueue(cx->out_workq_name); 680 - if (cx->out_work_queue == NULL) { 681 - CX18_ERR("Unable to create outgoing mailbox handler threads\n"); 682 670 return -ENOMEM; 683 671 } 684 672 return 0; ··· 698 710 mutex_init(&cx->epu2apu_mb_lock); 699 711 mutex_init(&cx->epu2cpu_mb_lock); 700 712 701 - ret = cx18_create_out_workq(cx); 713 + ret = cx18_create_in_workq(cx); 702 714 if (ret) 703 715 return ret; 704 - 705 - ret = cx18_create_in_workq(cx); 706 - if (ret) { 707 - destroy_workqueue(cx->out_work_queue); 708 - return ret; 709 - } 710 716 711 717 cx18_init_in_work_orders(cx); 712 718 ··· 1089 1107 release_mem_region(cx->base_addr, CX18_MEM_SIZE); 1090 1108 free_workqueues: 1091 1109 destroy_workqueue(cx->in_work_queue); 1092 - destroy_workqueue(cx->out_work_queue); 1093 1110 err: 1094 1111 if (retval == 0) 1095 1112 retval = -ENODEV; ··· 1240 1259 cx18_halt_firmware(cx); 1241 1260 1242 1261 destroy_workqueue(cx->in_work_queue); 1243 - destroy_workqueue(cx->out_work_queue); 1244 1262 1245 1263 cx18_streams_cleanup(cx, 1); 1246 1264
-3
drivers/media/video/cx18/cx18-driver.h
··· 617 617 struct cx18_in_work_order in_work_order[CX18_MAX_IN_WORK_ORDERS]; 618 618 char epu_debug_str[256]; /* CX18_EPU_DEBUG is rare: use shared space */ 619 619 620 - struct workqueue_struct *out_work_queue; 621 - char out_workq_name[12]; /* "cx18-NN-out" */ 622 - 623 620 /* i2c */ 624 621 struct i2c_adapter i2c_adap[2]; 625 622 struct i2c_algo_bit_data i2c_algo[2];
+1 -2
drivers/media/video/cx18/cx18-streams.h
··· 42 42 /* Related to submission of mdls to firmware */ 43 43 static inline void cx18_stream_load_fw_queue(struct cx18_stream *s) 44 44 { 45 - struct cx18 *cx = s->cx; 46 - queue_work(cx->out_work_queue, &s->out_work_order); 45 + schedule_work(&s->out_work_order); 47 46 } 48 47 49 48 static inline void cx18_stream_put_mdl_fw(struct cx18_stream *s,
+2 -3
drivers/media/video/cx231xx/cx231xx-dvb.c
··· 28 28 #include <media/videobuf-vmalloc.h> 29 29 30 30 #include "xc5000.h" 31 - #include "dvb_dummy_fe.h" 32 31 #include "s5h1432.h" 33 32 #include "tda18271.h" 34 33 #include "s5h1411.h" ··· 618 619 619 620 if (dev->dvb->frontend == NULL) { 620 621 printk(DRIVER_NAME 621 - ": Failed to attach dummy front end\n"); 622 + ": Failed to attach s5h1411 front end\n"); 622 623 result = -EINVAL; 623 624 goto out_free; 624 625 } ··· 664 665 665 666 if (dev->dvb->frontend == NULL) { 666 667 printk(DRIVER_NAME 667 - ": Failed to attach dummy front end\n"); 668 + ": Failed to attach s5h1411 front end\n"); 668 669 result = -EINVAL; 669 670 goto out_free; 670 671 }
+6 -16
drivers/media/video/cx25840/cx25840-core.c
··· 1682 1682 return 0; 1683 1683 } 1684 1684 1685 - static int cx25840_s_config(struct v4l2_subdev *sd, int irq, void *platform_data) 1686 - { 1687 - struct cx25840_state *state = to_state(sd); 1688 - struct i2c_client *client = v4l2_get_subdevdata(sd); 1689 - 1690 - if (platform_data) { 1691 - struct cx25840_platform_data *pdata = platform_data; 1692 - 1693 - state->pvr150_workaround = pdata->pvr150_workaround; 1694 - set_input(client, state->vid_input, state->aud_input); 1695 - } 1696 - return 0; 1697 - } 1698 - 1699 1685 static int cx23885_irq_handler(struct v4l2_subdev *sd, u32 status, 1700 1686 bool *handled) 1701 1687 { ··· 1773 1787 1774 1788 static const struct v4l2_subdev_core_ops cx25840_core_ops = { 1775 1789 .log_status = cx25840_log_status, 1776 - .s_config = cx25840_s_config, 1777 1790 .g_chip_ident = cx25840_g_chip_ident, 1778 1791 .g_ctrl = v4l2_subdev_g_ctrl, 1779 1792 .s_ctrl = v4l2_subdev_s_ctrl, ··· 1959 1974 state->vid_input = CX25840_COMPOSITE7; 1960 1975 state->aud_input = CX25840_AUDIO8; 1961 1976 state->audclk_freq = 48000; 1962 - state->pvr150_workaround = 0; 1963 1977 state->audmode = V4L2_TUNER_MODE_LANG1; 1964 1978 state->vbi_line_offset = 8; 1965 1979 state->id = id; ··· 2017 2033 } 2018 2034 v4l2_ctrl_cluster(2, &state->volume); 2019 2035 v4l2_ctrl_handler_setup(&state->hdl); 2036 + 2037 + if (client->dev.platform_data) { 2038 + struct cx25840_platform_data *pdata = client->dev.platform_data; 2039 + 2040 + state->pvr150_workaround = pdata->pvr150_workaround; 2041 + } 2020 2042 2021 2043 cx25840_ir_probe(sd); 2022 2044 return 0;
+177
drivers/media/video/davinci/vpif.c
··· 41 41 42 42 void __iomem *vpif_base; 43 43 44 + /** 45 + * ch_params: video standard configuration parameters for vpif 46 + * The table must include all presets from supported subdevices. 47 + */ 48 + const struct vpif_channel_config_params ch_params[] = { 49 + /* HDTV formats */ 50 + { 51 + .name = "480p59_94", 52 + .width = 720, 53 + .height = 480, 54 + .frm_fmt = 1, 55 + .ycmux_mode = 0, 56 + .eav2sav = 138-8, 57 + .sav2eav = 720, 58 + .l1 = 1, 59 + .l3 = 43, 60 + .l5 = 523, 61 + .vsize = 525, 62 + .capture_format = 0, 63 + .vbi_supported = 0, 64 + .hd_sd = 1, 65 + .dv_preset = V4L2_DV_480P59_94, 66 + }, 67 + { 68 + .name = "576p50", 69 + .width = 720, 70 + .height = 576, 71 + .frm_fmt = 1, 72 + .ycmux_mode = 0, 73 + .eav2sav = 144-8, 74 + .sav2eav = 720, 75 + .l1 = 1, 76 + .l3 = 45, 77 + .l5 = 621, 78 + .vsize = 625, 79 + .capture_format = 0, 80 + .vbi_supported = 0, 81 + .hd_sd = 1, 82 + .dv_preset = V4L2_DV_576P50, 83 + }, 84 + { 85 + .name = "720p50", 86 + .width = 1280, 87 + .height = 720, 88 + .frm_fmt = 1, 89 + .ycmux_mode = 0, 90 + .eav2sav = 700-8, 91 + .sav2eav = 1280, 92 + .l1 = 1, 93 + .l3 = 26, 94 + .l5 = 746, 95 + .vsize = 750, 96 + .capture_format = 0, 97 + .vbi_supported = 0, 98 + .hd_sd = 1, 99 + .dv_preset = V4L2_DV_720P50, 100 + }, 101 + { 102 + .name = "720p60", 103 + .width = 1280, 104 + .height = 720, 105 + .frm_fmt = 1, 106 + .ycmux_mode = 0, 107 + .eav2sav = 370 - 8, 108 + .sav2eav = 1280, 109 + .l1 = 1, 110 + .l3 = 26, 111 + .l5 = 746, 112 + .vsize = 750, 113 + .capture_format = 0, 114 + .vbi_supported = 0, 115 + .hd_sd = 1, 116 + .dv_preset = V4L2_DV_720P60, 117 + }, 118 + { 119 + .name = "1080I50", 120 + .width = 1920, 121 + .height = 1080, 122 + .frm_fmt = 0, 123 + .ycmux_mode = 0, 124 + .eav2sav = 720 - 8, 125 + .sav2eav = 1920, 126 + .l1 = 1, 127 + .l3 = 21, 128 + .l5 = 561, 129 + .l7 = 563, 130 + .l9 = 584, 131 + .l11 = 1124, 132 + .vsize = 1125, 133 + .capture_format = 0, 134 + .vbi_supported = 0, 135 + .hd_sd = 1, 136 + .dv_preset = V4L2_DV_1080I50, 137 + }, 138 + { 139 + .name = "1080I60", 140 + .width = 1920, 141 + .height = 1080, 142 + .frm_fmt = 0, 143 + .ycmux_mode = 0, 144 + .eav2sav = 280 - 8, 145 + .sav2eav = 1920, 146 + .l1 = 1, 147 + .l3 = 21, 148 + .l5 = 561, 149 + .l7 = 563, 150 + .l9 = 584, 151 + .l11 = 1124, 152 + .vsize = 1125, 153 + .capture_format = 0, 154 + .vbi_supported = 0, 155 + .hd_sd = 1, 156 + .dv_preset = V4L2_DV_1080I60, 157 + }, 158 + { 159 + .name = "1080p60", 160 + .width = 1920, 161 + .height = 1080, 162 + .frm_fmt = 1, 163 + .ycmux_mode = 0, 164 + .eav2sav = 280 - 8, 165 + .sav2eav = 1920, 166 + .l1 = 1, 167 + .l3 = 42, 168 + .l5 = 1122, 169 + .vsize = 1125, 170 + .capture_format = 0, 171 + .vbi_supported = 0, 172 + .hd_sd = 1, 173 + .dv_preset = V4L2_DV_1080P60, 174 + }, 175 + 176 + /* SDTV formats */ 177 + { 178 + .name = "NTSC_M", 179 + .width = 720, 180 + .height = 480, 181 + .frm_fmt = 0, 182 + .ycmux_mode = 1, 183 + .eav2sav = 268, 184 + .sav2eav = 1440, 185 + .l1 = 1, 186 + .l3 = 23, 187 + .l5 = 263, 188 + .l7 = 266, 189 + .l9 = 286, 190 + .l11 = 525, 191 + .vsize = 525, 192 + .capture_format = 0, 193 + .vbi_supported = 1, 194 + .hd_sd = 0, 195 + .stdid = V4L2_STD_525_60, 196 + }, 197 + { 198 + .name = "PAL_BDGHIK", 199 + .width = 720, 200 + .height = 576, 201 + .frm_fmt = 0, 202 + .ycmux_mode = 1, 203 + .eav2sav = 280, 204 + .sav2eav = 1440, 205 + .l1 = 1, 206 + .l3 = 23, 207 + .l5 = 311, 208 + .l7 = 313, 209 + .l9 = 336, 210 + .l11 = 624, 211 + .vsize = 625, 212 + .capture_format = 0, 213 + .vbi_supported = 1, 214 + .hd_sd = 0, 215 + .stdid = V4L2_STD_625_50, 216 + }, 217 + }; 218 + 219 + const unsigned int vpif_ch_params_count = ARRAY_SIZE(ch_params); 220 + 44 221 static inline void vpif_wr_bit(u32 reg, u32 bit, u32 val) 45 222 { 46 223 if (val)
+10 -8
drivers/media/video/davinci/vpif.h
··· 577 577 char name[VPIF_MAX_NAME]; /* Name of the mode */ 578 578 u16 width; /* Indicates width of the image */ 579 579 u16 height; /* Indicates height of the image */ 580 - u8 fps; 581 - u8 frm_fmt; /* Indicates whether this is interlaced 582 - * or progressive format */ 583 - u8 ycmux_mode; /* Indicates whether this mode requires 584 - * single or two channels */ 585 - u16 eav2sav; /* length of sav 2 eav */ 580 + u8 frm_fmt; /* Interlaced (0) or progressive (1) */ 581 + u8 ycmux_mode; /* This mode requires one (0) or two (1) 582 + channels */ 583 + u16 eav2sav; /* length of eav 2 sav */ 586 584 u16 sav2eav; /* length of sav 2 eav */ 587 585 u16 l1, l3, l5, l7, l9, l11; /* Other parameter configurations */ 588 586 u16 vsize; /* Vertical size of the image */ ··· 588 590 * is in BT or in CCD/CMOS */ 589 591 u8 vbi_supported; /* Indicates whether this mode 590 592 * supports capturing vbi or not */ 591 - u8 hd_sd; 592 - v4l2_std_id stdid; 593 + u8 hd_sd; /* HDTV (1) or SDTV (0) format */ 594 + v4l2_std_id stdid; /* SDTV format */ 595 + u32 dv_preset; /* HDTV format */ 593 596 }; 597 + 598 + extern const unsigned int vpif_ch_params_count; 599 + extern const struct vpif_channel_config_params ch_params[]; 594 600 595 601 struct vpif_video_params; 596 602 struct vpif_params;
+349 -102
drivers/media/video/davinci/vpif_capture.c
··· 37 37 #include <linux/slab.h> 38 38 #include <media/v4l2-device.h> 39 39 #include <media/v4l2-ioctl.h> 40 + #include <media/v4l2-chip-ident.h> 40 41 41 42 #include "vpif_capture.h" 42 43 #include "vpif.h" ··· 80 79 /* global variables */ 81 80 static struct vpif_device vpif_obj = { {NULL} }; 82 81 static struct device *vpif_dev; 83 - 84 - /** 85 - * ch_params: video standard configuration parameters for vpif 86 - */ 87 - static const struct vpif_channel_config_params ch_params[] = { 88 - { 89 - "NTSC_M", 720, 480, 30, 0, 1, 268, 1440, 1, 23, 263, 266, 90 - 286, 525, 525, 0, 1, 0, V4L2_STD_525_60, 91 - }, 92 - { 93 - "PAL_BDGHIK", 720, 576, 25, 0, 1, 280, 1440, 1, 23, 311, 313, 94 - 336, 624, 625, 0, 1, 0, V4L2_STD_625_50, 95 - }, 96 - }; 97 82 98 83 /** 99 84 * vpif_uservirt_to_phys : translate user/virtual address to phy address ··· 329 342 * @dev_id: dev_id ptr 330 343 * 331 344 * It changes status of the captured buffer, takes next buffer from the queue 332 - * and sets its address in VPIF registers 345 + * and sets its address in VPIF registers 333 346 */ 334 347 static irqreturn_t vpif_channel_isr(int irq, void *dev_id) 335 348 { ··· 422 435 struct common_obj *common = &ch->common[VPIF_VIDEO_INDEX]; 423 436 struct vpif_params *vpifparams = &ch->vpifparams; 424 437 const struct vpif_channel_config_params *config; 425 - struct vpif_channel_config_params *std_info; 438 + struct vpif_channel_config_params *std_info = &vpifparams->std_info; 426 439 struct video_obj *vid_ch = &ch->video; 427 440 int index; 428 441 429 442 vpif_dbg(2, debug, "vpif_update_std_info\n"); 430 443 431 - std_info = &vpifparams->std_info; 432 - 433 - for (index = 0; index < ARRAY_SIZE(ch_params); index++) { 444 + for (index = 0; index < vpif_ch_params_count; index++) { 434 445 config = &ch_params[index]; 435 - if (config->stdid & vid_ch->stdid) { 436 - memcpy(std_info, config, sizeof(*config)); 437 - break; 446 + if (config->hd_sd == 0) { 447 + vpif_dbg(2, debug, "SD format\n"); 448 + if (config->stdid & vid_ch->stdid) { 449 + memcpy(std_info, config, sizeof(*config)); 450 + break; 451 + } 452 + } else { 453 + vpif_dbg(2, debug, "HD format\n"); 454 + if (config->dv_preset == vid_ch->dv_preset) { 455 + memcpy(std_info, config, sizeof(*config)); 456 + break; 457 + } 438 458 } 439 459 } 440 460 441 461 /* standard not found */ 442 - if (index == ARRAY_SIZE(ch_params)) 462 + if (index == vpif_ch_params_count) 443 463 return -EINVAL; 444 464 445 465 common->fmt.fmt.pix.width = std_info->width; ··· 456 462 common->fmt.fmt.pix.bytesperline = std_info->width; 457 463 vpifparams->video_params.hpitch = std_info->width; 458 464 vpifparams->video_params.storage_mode = std_info->frm_fmt; 465 + 459 466 return 0; 460 467 } 461 468 ··· 752 757 struct video_obj *vid_ch; 753 758 struct channel_obj *ch; 754 759 struct vpif_fh *fh; 755 - int i, ret = 0; 760 + int i; 756 761 757 762 vpif_dbg(2, debug, "vpif_open\n"); 758 763 ··· 760 765 761 766 vid_ch = &ch->video; 762 767 common = &ch->common[VPIF_VIDEO_INDEX]; 763 - 764 - if (mutex_lock_interruptible(&common->lock)) 765 - return -ERESTARTSYS; 766 768 767 769 if (NULL == ch->curr_subdev_info) { 768 770 /** ··· 777 785 } 778 786 if (i == config->subdev_count) { 779 787 vpif_err("No sub device registered\n"); 780 - ret = -ENOENT; 781 - goto exit; 788 + return -ENOENT; 782 789 } 783 790 } 784 791 ··· 785 794 fh = kzalloc(sizeof(struct vpif_fh), GFP_KERNEL); 786 795 if (NULL == fh) { 787 796 vpif_err("unable to allocate memory for file handle object\n"); 788 - ret = -ENOMEM; 789 - goto exit; 797 + return -ENOMEM; 790 798 } 791 799 792 800 /* store pointer to fh in private_data member of filep */ ··· 805 815 /* Initialize priority of this instance to default priority */ 806 816 fh->prio = V4L2_PRIORITY_UNSET; 807 817 v4l2_prio_open(&ch->prio, &fh->prio); 808 - exit: 809 - mutex_unlock(&common->lock); 810 - return ret; 818 + return 0; 811 819 } 812 820 813 821 /** ··· 824 836 vpif_dbg(2, debug, "vpif_release\n"); 825 837 826 838 common = &ch->common[VPIF_VIDEO_INDEX]; 827 - 828 - if (mutex_lock_interruptible(&common->lock)) 829 - return -ERESTARTSYS; 830 839 831 840 /* if this instance is doing IO */ 832 841 if (fh->io_allowed[VPIF_VIDEO_INDEX]) { ··· 847 862 848 863 /* Decrement channel usrs counter */ 849 864 ch->usrs--; 850 - 851 - /* unlock mutex on channel object */ 852 - mutex_unlock(&common->lock); 853 865 854 866 /* Close the priority */ 855 867 v4l2_prio_close(&ch->prio, fh->prio); ··· 872 890 struct channel_obj *ch = fh->channel; 873 891 struct common_obj *common; 874 892 u8 index = 0; 875 - int ret = 0; 876 893 877 894 vpif_dbg(2, debug, "vpif_reqbufs\n"); 878 895 ··· 894 913 895 914 common = &ch->common[index]; 896 915 897 - if (mutex_lock_interruptible(&common->lock)) 898 - return -ERESTARTSYS; 899 - 900 - if (0 != common->io_usrs) { 901 - ret = -EBUSY; 902 - goto reqbuf_exit; 903 - } 916 + if (0 != common->io_usrs) 917 + return -EBUSY; 904 918 905 919 /* Initialize videobuf queue as per the buffer type */ 906 920 videobuf_queue_dma_contig_init(&common->buffer_queue, ··· 904 928 reqbuf->type, 905 929 common->fmt.fmt.pix.field, 906 930 sizeof(struct videobuf_buffer), fh, 907 - NULL); 931 + &common->lock); 908 932 909 933 /* Set io allowed member of file handle to TRUE */ 910 934 fh->io_allowed[index] = 1; ··· 915 939 INIT_LIST_HEAD(&common->dma_queue); 916 940 917 941 /* Allocate buffers */ 918 - ret = videobuf_reqbufs(&common->buffer_queue, reqbuf); 919 - 920 - reqbuf_exit: 921 - mutex_unlock(&common->lock); 922 - return ret; 942 + return videobuf_reqbufs(&common->buffer_queue, reqbuf); 923 943 } 924 944 925 945 /** ··· 1129 1157 return ret; 1130 1158 } 1131 1159 1132 - if (mutex_lock_interruptible(&common->lock)) { 1133 - ret = -ERESTARTSYS; 1134 - goto streamoff_exit; 1135 - } 1136 - 1137 1160 /* If buffer queue is empty, return error */ 1138 1161 if (list_empty(&common->dma_queue)) { 1139 1162 vpif_dbg(1, debug, "buffer queue is empty\n"); ··· 1207 1240 enable_channel1(1); 1208 1241 } 1209 1242 channel_first_int[VPIF_VIDEO_INDEX][ch->channel_id] = 1; 1210 - mutex_unlock(&common->lock); 1211 1243 return ret; 1212 1244 1213 1245 exit: 1214 - mutex_unlock(&common->lock); 1215 - streamoff_exit: 1216 - ret = videobuf_streamoff(&common->buffer_queue); 1246 + videobuf_streamoff(&common->buffer_queue); 1217 1247 return ret; 1218 1248 } 1219 1249 ··· 1248 1284 return -EINVAL; 1249 1285 } 1250 1286 1251 - if (mutex_lock_interruptible(&common->lock)) 1252 - return -ERESTARTSYS; 1253 - 1254 1287 /* disable channel */ 1255 1288 if (VPIF_CHANNEL0_VIDEO == ch->channel_id) { 1256 1289 enable_channel0(0); ··· 1264 1303 1265 1304 if (ret && (ret != -ENOIOCTLCMD)) 1266 1305 vpif_dbg(1, debug, "stream off failed in subdev\n"); 1267 - 1268 - mutex_unlock(&common->lock); 1269 1306 1270 1307 return videobuf_streamoff(&common->buffer_queue); 1271 1308 } ··· 1340 1381 { 1341 1382 struct vpif_fh *fh = priv; 1342 1383 struct channel_obj *ch = fh->channel; 1343 - struct common_obj *common = &ch->common[VPIF_VIDEO_INDEX]; 1344 1384 int ret = 0; 1345 1385 1346 1386 vpif_dbg(2, debug, "vpif_querystd\n"); 1347 - 1348 - if (mutex_lock_interruptible(&common->lock)) 1349 - return -ERESTARTSYS; 1350 1387 1351 1388 /* Call querystd function of decoder device */ 1352 1389 ret = v4l2_subdev_call(vpif_obj.sd[ch->curr_sd_index], video, ··· 1350 1395 if (ret < 0) 1351 1396 vpif_dbg(1, debug, "Failed to set standard for sub devices\n"); 1352 1397 1353 - mutex_unlock(&common->lock); 1354 1398 return ret; 1355 1399 } 1356 1400 ··· 1405 1451 fh->initialized = 1; 1406 1452 1407 1453 /* Call encoder subdevice function to set the standard */ 1408 - if (mutex_lock_interruptible(&common->lock)) 1409 - return -ERESTARTSYS; 1410 - 1411 1454 ch->video.stdid = *std_id; 1455 + ch->video.dv_preset = V4L2_DV_INVALID; 1456 + memset(&ch->video.bt_timings, 0, sizeof(ch->video.bt_timings)); 1412 1457 1413 1458 /* Get the information about the standard */ 1414 1459 if (vpif_update_std_info(ch)) { 1415 - ret = -EINVAL; 1416 1460 vpif_err("Error getting the standard info\n"); 1417 - goto s_std_exit; 1461 + return -EINVAL; 1418 1462 } 1419 1463 1420 1464 /* Configure the default format information */ ··· 1423 1471 s_std, *std_id); 1424 1472 if (ret < 0) 1425 1473 vpif_dbg(1, debug, "Failed to set standard for sub devices\n"); 1426 - 1427 - s_std_exit: 1428 - mutex_unlock(&common->lock); 1429 1474 return ret; 1430 1475 } 1431 1476 ··· 1516 1567 return -EINVAL; 1517 1568 } 1518 1569 1519 - if (mutex_lock_interruptible(&common->lock)) 1520 - return -ERESTARTSYS; 1521 - 1522 1570 /* first setup input path from sub device to vpif */ 1523 1571 if (config->setup_input_path) { 1524 1572 ret = config->setup_input_path(ch->channel_id, ··· 1524 1578 vpif_dbg(1, debug, "couldn't setup input path for the" 1525 1579 " sub device %s, for input index %d\n", 1526 1580 subdev_info->name, index); 1527 - goto exit; 1581 + return ret; 1528 1582 } 1529 1583 } 1530 1584 ··· 1535 1589 input, output, 0); 1536 1590 if (ret < 0) { 1537 1591 vpif_dbg(1, debug, "Failed to set input\n"); 1538 - goto exit; 1592 + return ret; 1539 1593 } 1540 1594 } 1541 1595 vid_ch->input_idx = index; ··· 1546 1600 1547 1601 /* update tvnorms from the sub device input info */ 1548 1602 ch->video_dev->tvnorms = chan_cfg->inputs[index].input.std; 1549 - 1550 - exit: 1551 - mutex_unlock(&common->lock); 1552 1603 return ret; 1553 1604 } 1554 1605 ··· 1614 1671 return -EINVAL; 1615 1672 1616 1673 /* Fill in the information about format */ 1617 - if (mutex_lock_interruptible(&common->lock)) 1618 - return -ERESTARTSYS; 1619 - 1620 1674 *fmt = common->fmt; 1621 - mutex_unlock(&common->lock); 1622 1675 return 0; 1623 1676 } 1624 1677 ··· 1633 1694 struct v4l2_pix_format *pixfmt; 1634 1695 int ret = 0; 1635 1696 1636 - vpif_dbg(2, debug, "VIDIOC_S_FMT\n"); 1697 + vpif_dbg(2, debug, "%s\n", __func__); 1637 1698 1638 1699 /* If streaming is started, return error */ 1639 1700 if (common->started) { ··· 1662 1723 if (ret) 1663 1724 return ret; 1664 1725 /* store the format in the channel object */ 1665 - if (mutex_lock_interruptible(&common->lock)) 1666 - return -ERESTARTSYS; 1667 - 1668 1726 common->fmt = *fmt; 1669 - mutex_unlock(&common->lock); 1670 - 1671 1727 return 0; 1672 1728 } 1673 1729 ··· 1741 1807 return 0; 1742 1808 } 1743 1809 1810 + /** 1811 + * vpif_enum_dv_presets() - ENUM_DV_PRESETS handler 1812 + * @file: file ptr 1813 + * @priv: file handle 1814 + * @preset: input preset 1815 + */ 1816 + static int vpif_enum_dv_presets(struct file *file, void *priv, 1817 + struct v4l2_dv_enum_preset *preset) 1818 + { 1819 + struct vpif_fh *fh = priv; 1820 + struct channel_obj *ch = fh->channel; 1821 + 1822 + return v4l2_subdev_call(vpif_obj.sd[ch->curr_sd_index], 1823 + video, enum_dv_presets, preset); 1824 + } 1825 + 1826 + /** 1827 + * vpif_query_dv_presets() - QUERY_DV_PRESET handler 1828 + * @file: file ptr 1829 + * @priv: file handle 1830 + * @preset: input preset 1831 + */ 1832 + static int vpif_query_dv_preset(struct file *file, void *priv, 1833 + struct v4l2_dv_preset *preset) 1834 + { 1835 + struct vpif_fh *fh = priv; 1836 + struct channel_obj *ch = fh->channel; 1837 + 1838 + return v4l2_subdev_call(vpif_obj.sd[ch->curr_sd_index], 1839 + video, query_dv_preset, preset); 1840 + } 1841 + /** 1842 + * vpif_s_dv_presets() - S_DV_PRESETS handler 1843 + * @file: file ptr 1844 + * @priv: file handle 1845 + * @preset: input preset 1846 + */ 1847 + static int vpif_s_dv_preset(struct file *file, void *priv, 1848 + struct v4l2_dv_preset *preset) 1849 + { 1850 + struct vpif_fh *fh = priv; 1851 + struct channel_obj *ch = fh->channel; 1852 + struct common_obj *common = &ch->common[VPIF_VIDEO_INDEX]; 1853 + int ret = 0; 1854 + 1855 + if (common->started) { 1856 + vpif_dbg(1, debug, "streaming in progress\n"); 1857 + return -EBUSY; 1858 + } 1859 + 1860 + if ((VPIF_CHANNEL0_VIDEO == ch->channel_id) || 1861 + (VPIF_CHANNEL1_VIDEO == ch->channel_id)) { 1862 + if (!fh->initialized) { 1863 + vpif_dbg(1, debug, "Channel Busy\n"); 1864 + return -EBUSY; 1865 + } 1866 + } 1867 + 1868 + ret = v4l2_prio_check(&ch->prio, fh->prio); 1869 + if (ret) 1870 + return ret; 1871 + 1872 + fh->initialized = 1; 1873 + 1874 + /* Call encoder subdevice function to set the standard */ 1875 + if (mutex_lock_interruptible(&common->lock)) 1876 + return -ERESTARTSYS; 1877 + 1878 + ch->video.dv_preset = preset->preset; 1879 + ch->video.stdid = V4L2_STD_UNKNOWN; 1880 + memset(&ch->video.bt_timings, 0, sizeof(ch->video.bt_timings)); 1881 + 1882 + /* Get the information about the standard */ 1883 + if (vpif_update_std_info(ch)) { 1884 + vpif_dbg(1, debug, "Error getting the standard info\n"); 1885 + ret = -EINVAL; 1886 + } else { 1887 + /* Configure the default format information */ 1888 + vpif_config_format(ch); 1889 + 1890 + ret = v4l2_subdev_call(vpif_obj.sd[ch->curr_sd_index], 1891 + video, s_dv_preset, preset); 1892 + } 1893 + 1894 + mutex_unlock(&common->lock); 1895 + 1896 + return ret; 1897 + } 1898 + /** 1899 + * vpif_g_dv_presets() - G_DV_PRESETS handler 1900 + * @file: file ptr 1901 + * @priv: file handle 1902 + * @preset: input preset 1903 + */ 1904 + static int vpif_g_dv_preset(struct file *file, void *priv, 1905 + struct v4l2_dv_preset *preset) 1906 + { 1907 + struct vpif_fh *fh = priv; 1908 + struct channel_obj *ch = fh->channel; 1909 + 1910 + preset->preset = ch->video.dv_preset; 1911 + 1912 + return 0; 1913 + } 1914 + 1915 + /** 1916 + * vpif_s_dv_timings() - S_DV_TIMINGS handler 1917 + * @file: file ptr 1918 + * @priv: file handle 1919 + * @timings: digital video timings 1920 + */ 1921 + static int vpif_s_dv_timings(struct file *file, void *priv, 1922 + struct v4l2_dv_timings *timings) 1923 + { 1924 + struct vpif_fh *fh = priv; 1925 + struct channel_obj *ch = fh->channel; 1926 + struct vpif_params *vpifparams = &ch->vpifparams; 1927 + struct vpif_channel_config_params *std_info = &vpifparams->std_info; 1928 + struct video_obj *vid_ch = &ch->video; 1929 + struct v4l2_bt_timings *bt = &vid_ch->bt_timings; 1930 + int ret; 1931 + 1932 + if (timings->type != V4L2_DV_BT_656_1120) { 1933 + vpif_dbg(2, debug, "Timing type not defined\n"); 1934 + return -EINVAL; 1935 + } 1936 + 1937 + /* Configure subdevice timings, if any */ 1938 + ret = v4l2_subdev_call(vpif_obj.sd[ch->curr_sd_index], 1939 + video, s_dv_timings, timings); 1940 + if (ret == -ENOIOCTLCMD) { 1941 + vpif_dbg(2, debug, "Custom DV timings not supported by " 1942 + "subdevice\n"); 1943 + return -EINVAL; 1944 + } 1945 + if (ret < 0) { 1946 + vpif_dbg(2, debug, "Error setting custom DV timings\n"); 1947 + return ret; 1948 + } 1949 + 1950 + if (!(timings->bt.width && timings->bt.height && 1951 + (timings->bt.hbackporch || 1952 + timings->bt.hfrontporch || 1953 + timings->bt.hsync) && 1954 + timings->bt.vfrontporch && 1955 + (timings->bt.vbackporch || 1956 + timings->bt.vsync))) { 1957 + vpif_dbg(2, debug, "Timings for width, height, " 1958 + "horizontal back porch, horizontal sync, " 1959 + "horizontal front porch, vertical back porch, " 1960 + "vertical sync and vertical back porch " 1961 + "must be defined\n"); 1962 + return -EINVAL; 1963 + } 1964 + 1965 + *bt = timings->bt; 1966 + 1967 + /* Configure video port timings */ 1968 + 1969 + std_info->eav2sav = bt->hbackporch + bt->hfrontporch + 1970 + bt->hsync - 8; 1971 + std_info->sav2eav = bt->width; 1972 + 1973 + std_info->l1 = 1; 1974 + std_info->l3 = bt->vsync + bt->vbackporch + 1; 1975 + 1976 + if (bt->interlaced) { 1977 + if (bt->il_vbackporch || bt->il_vfrontporch || bt->il_vsync) { 1978 + std_info->vsize = bt->height * 2 + 1979 + bt->vfrontporch + bt->vsync + bt->vbackporch + 1980 + bt->il_vfrontporch + bt->il_vsync + 1981 + bt->il_vbackporch; 1982 + std_info->l5 = std_info->vsize/2 - 1983 + (bt->vfrontporch - 1); 1984 + std_info->l7 = std_info->vsize/2 + 1; 1985 + std_info->l9 = std_info->l7 + bt->il_vsync + 1986 + bt->il_vbackporch + 1; 1987 + std_info->l11 = std_info->vsize - 1988 + (bt->il_vfrontporch - 1); 1989 + } else { 1990 + vpif_dbg(2, debug, "Required timing values for " 1991 + "interlaced BT format missing\n"); 1992 + return -EINVAL; 1993 + } 1994 + } else { 1995 + std_info->vsize = bt->height + bt->vfrontporch + 1996 + bt->vsync + bt->vbackporch; 1997 + std_info->l5 = std_info->vsize - (bt->vfrontporch - 1); 1998 + } 1999 + strncpy(std_info->name, "Custom timings BT656/1120", VPIF_MAX_NAME); 2000 + std_info->width = bt->width; 2001 + std_info->height = bt->height; 2002 + std_info->frm_fmt = bt->interlaced ? 0 : 1; 2003 + std_info->ycmux_mode = 0; 2004 + std_info->capture_format = 0; 2005 + std_info->vbi_supported = 0; 2006 + std_info->hd_sd = 1; 2007 + std_info->stdid = 0; 2008 + std_info->dv_preset = V4L2_DV_INVALID; 2009 + 2010 + vid_ch->stdid = 0; 2011 + vid_ch->dv_preset = V4L2_DV_INVALID; 2012 + return 0; 2013 + } 2014 + 2015 + /** 2016 + * vpif_g_dv_timings() - G_DV_TIMINGS handler 2017 + * @file: file ptr 2018 + * @priv: file handle 2019 + * @timings: digital video timings 2020 + */ 2021 + static int vpif_g_dv_timings(struct file *file, void *priv, 2022 + struct v4l2_dv_timings *timings) 2023 + { 2024 + struct vpif_fh *fh = priv; 2025 + struct channel_obj *ch = fh->channel; 2026 + struct video_obj *vid_ch = &ch->video; 2027 + struct v4l2_bt_timings *bt = &vid_ch->bt_timings; 2028 + 2029 + timings->bt = *bt; 2030 + 2031 + return 0; 2032 + } 2033 + 2034 + /* 2035 + * vpif_g_chip_ident() - Identify the chip 2036 + * @file: file ptr 2037 + * @priv: file handle 2038 + * @chip: chip identity 2039 + * 2040 + * Returns zero or -EINVAL if read operations fails. 2041 + */ 2042 + static int vpif_g_chip_ident(struct file *file, void *priv, 2043 + struct v4l2_dbg_chip_ident *chip) 2044 + { 2045 + chip->ident = V4L2_IDENT_NONE; 2046 + chip->revision = 0; 2047 + if (chip->match.type != V4L2_CHIP_MATCH_I2C_DRIVER && 2048 + chip->match.type != V4L2_CHIP_MATCH_I2C_ADDR) { 2049 + vpif_dbg(2, debug, "match_type is invalid.\n"); 2050 + return -EINVAL; 2051 + } 2052 + 2053 + return v4l2_device_call_until_err(&vpif_obj.v4l2_dev, 0, core, 2054 + g_chip_ident, chip); 2055 + } 2056 + 2057 + #ifdef CONFIG_VIDEO_ADV_DEBUG 2058 + /* 2059 + * vpif_dbg_g_register() - Read register 2060 + * @file: file ptr 2061 + * @priv: file handle 2062 + * @reg: register to be read 2063 + * 2064 + * Debugging only 2065 + * Returns zero or -EINVAL if read operations fails. 2066 + */ 2067 + static int vpif_dbg_g_register(struct file *file, void *priv, 2068 + struct v4l2_dbg_register *reg){ 2069 + struct vpif_fh *fh = priv; 2070 + struct channel_obj *ch = fh->channel; 2071 + 2072 + return v4l2_subdev_call(vpif_obj.sd[ch->curr_sd_index], core, 2073 + g_register, reg); 2074 + } 2075 + 2076 + /* 2077 + * vpif_dbg_s_register() - Write to register 2078 + * @file: file ptr 2079 + * @priv: file handle 2080 + * @reg: register to be modified 2081 + * 2082 + * Debugging only 2083 + * Returns zero or -EINVAL if write operations fails. 2084 + */ 2085 + static int vpif_dbg_s_register(struct file *file, void *priv, 2086 + struct v4l2_dbg_register *reg){ 2087 + struct vpif_fh *fh = priv; 2088 + struct channel_obj *ch = fh->channel; 2089 + 2090 + return v4l2_subdev_call(vpif_obj.sd[ch->curr_sd_index], core, 2091 + s_register, reg); 2092 + } 2093 + #endif 2094 + 2095 + /* 2096 + * vpif_log_status() - Status information 2097 + * @file: file ptr 2098 + * @priv: file handle 2099 + * 2100 + * Returns zero. 2101 + */ 2102 + static int vpif_log_status(struct file *filep, void *priv) 2103 + { 2104 + /* status for sub devices */ 2105 + v4l2_device_call_all(&vpif_obj.v4l2_dev, 0, core, log_status); 2106 + 2107 + return 0; 2108 + } 2109 + 1744 2110 /* vpif capture ioctl operations */ 1745 2111 static const struct v4l2_ioctl_ops vpif_ioctl_ops = { 1746 2112 .vidioc_querycap = vpif_querycap, ··· 2063 1829 .vidioc_streamon = vpif_streamon, 2064 1830 .vidioc_streamoff = vpif_streamoff, 2065 1831 .vidioc_cropcap = vpif_cropcap, 1832 + .vidioc_enum_dv_presets = vpif_enum_dv_presets, 1833 + .vidioc_s_dv_preset = vpif_s_dv_preset, 1834 + .vidioc_g_dv_preset = vpif_g_dv_preset, 1835 + .vidioc_query_dv_preset = vpif_query_dv_preset, 1836 + .vidioc_s_dv_timings = vpif_s_dv_timings, 1837 + .vidioc_g_dv_timings = vpif_g_dv_timings, 1838 + .vidioc_g_chip_ident = vpif_g_chip_ident, 1839 + #ifdef CONFIG_VIDEO_ADV_DEBUG 1840 + .vidioc_g_register = vpif_dbg_g_register, 1841 + .vidioc_s_register = vpif_dbg_s_register, 1842 + #endif 1843 + .vidioc_log_status = vpif_log_status, 2066 1844 }; 2067 1845 2068 1846 /* vpif file operations */ ··· 2082 1836 .owner = THIS_MODULE, 2083 1837 .open = vpif_open, 2084 1838 .release = vpif_release, 2085 - .ioctl = video_ioctl2, 1839 + .unlocked_ioctl = video_ioctl2, 2086 1840 .mmap = vpif_mmap, 2087 1841 .poll = vpif_poll 2088 1842 }; ··· 2225 1979 common = &(ch->common[VPIF_VIDEO_INDEX]); 2226 1980 spin_lock_init(&common->irqlock); 2227 1981 mutex_init(&common->lock); 1982 + ch->video_dev->lock = &common->lock; 2228 1983 /* Initialize prio member of channel object */ 2229 1984 v4l2_prio_init(&ch->prio); 2230 1985 err = video_register_device(ch->video_dev, ··· 2273 2026 if (vpif_obj.sd[i]) 2274 2027 vpif_obj.sd[i]->grp_id = 1 << i; 2275 2028 } 2276 - v4l2_info(&vpif_obj.v4l2_dev, "DM646x VPIF Capture driver" 2277 - " initialized\n"); 2278 2029 2030 + v4l2_info(&vpif_obj.v4l2_dev, 2031 + "DM646x VPIF capture driver initialized\n"); 2279 2032 return 0; 2280 2033 2281 2034 probe_subdev_out:
+2
drivers/media/video/davinci/vpif_capture.h
··· 59 59 enum v4l2_field buf_field; 60 60 /* Currently selected or default standard */ 61 61 v4l2_std_id stdid; 62 + u32 dv_preset; 63 + struct v4l2_bt_timings bt_timings; 62 64 /* This is to track the last input that is passed to application */ 63 65 u32 input_idx; 64 66 };
+367 -107
drivers/media/video/davinci/vpif_display.c
··· 38 38 #include <media/adv7343.h> 39 39 #include <media/v4l2-device.h> 40 40 #include <media/v4l2-ioctl.h> 41 + #include <media/v4l2-chip-ident.h> 41 42 42 43 #include <mach/dm646x.h> 43 44 ··· 84 83 85 84 static struct vpif_device vpif_obj = { {NULL} }; 86 85 static struct device *vpif_dev; 87 - 88 - static const struct vpif_channel_config_params ch_params[] = { 89 - { 90 - "NTSC", 720, 480, 30, 0, 1, 268, 1440, 1, 23, 263, 266, 91 - 286, 525, 525, 0, 1, 0, V4L2_STD_525_60, 92 - }, 93 - { 94 - "PAL", 720, 576, 25, 0, 1, 280, 1440, 1, 23, 311, 313, 95 - 336, 624, 625, 0, 1, 0, V4L2_STD_625_50, 96 - }, 97 - }; 98 86 99 87 /* 100 88 * vpif_uservirt_to_phys: This function is used to convert user ··· 363 373 return IRQ_HANDLED; 364 374 } 365 375 366 - static int vpif_get_std_info(struct channel_obj *ch) 376 + static int vpif_update_std_info(struct channel_obj *ch) 367 377 { 368 - struct common_obj *common = &ch->common[VPIF_VIDEO_INDEX]; 369 378 struct video_obj *vid_ch = &ch->video; 370 379 struct vpif_params *vpifparams = &ch->vpifparams; 371 380 struct vpif_channel_config_params *std_info = &vpifparams->std_info; 372 381 const struct vpif_channel_config_params *config; 373 382 374 - int index; 383 + int i; 375 384 376 - std_info->stdid = vid_ch->stdid; 377 - if (!std_info->stdid) 378 - return -1; 379 - 380 - for (index = 0; index < ARRAY_SIZE(ch_params); index++) { 381 - config = &ch_params[index]; 382 - if (config->stdid & std_info->stdid) { 383 - memcpy(std_info, config, sizeof(*config)); 384 - break; 385 + for (i = 0; i < vpif_ch_params_count; i++) { 386 + config = &ch_params[i]; 387 + if (config->hd_sd == 0) { 388 + vpif_dbg(2, debug, "SD format\n"); 389 + if (config->stdid & vid_ch->stdid) { 390 + memcpy(std_info, config, sizeof(*config)); 391 + break; 392 + } 393 + } else { 394 + vpif_dbg(2, debug, "HD format\n"); 395 + if (config->dv_preset == vid_ch->dv_preset) { 396 + memcpy(std_info, config, sizeof(*config)); 397 + break; 398 + } 385 399 } 386 400 } 387 401 388 - if (index == ARRAY_SIZE(ch_params)) 389 - return -1; 402 + if (i == vpif_ch_params_count) { 403 + vpif_dbg(1, debug, "Format not found\n"); 404 + return -EINVAL; 405 + } 406 + 407 + return 0; 408 + } 409 + 410 + static int vpif_update_resolution(struct channel_obj *ch) 411 + { 412 + struct common_obj *common = &ch->common[VPIF_VIDEO_INDEX]; 413 + struct video_obj *vid_ch = &ch->video; 414 + struct vpif_params *vpifparams = &ch->vpifparams; 415 + struct vpif_channel_config_params *std_info = &vpifparams->std_info; 416 + 417 + if (!vid_ch->stdid && !vid_ch->dv_preset && !vid_ch->bt_timings.height) 418 + return -EINVAL; 419 + 420 + if (vid_ch->stdid || vid_ch->dv_preset) { 421 + if (vpif_update_std_info(ch)) 422 + return -EINVAL; 423 + } 390 424 391 425 common->fmt.fmt.pix.width = std_info->width; 392 426 common->fmt.fmt.pix.height = std_info->height; ··· 418 404 common->fmt.fmt.pix.width, common->fmt.fmt.pix.height); 419 405 420 406 /* Set height and width paramateres */ 421 - ch->common[VPIF_VIDEO_INDEX].height = std_info->height; 422 - ch->common[VPIF_VIDEO_INDEX].width = std_info->width; 407 + common->height = std_info->height; 408 + common->width = std_info->width; 423 409 424 410 return 0; 425 411 } ··· 530 516 else 531 517 sizeimage = config_params.channel_bufsize[ch->channel_id]; 532 518 533 - if (vpif_get_std_info(ch)) { 534 - vpif_err("Error getting the standard info\n"); 519 + if (vpif_update_resolution(ch)) 535 520 return -EINVAL; 536 - } 537 521 538 522 hpitch = pixfmt->bytesperline; 539 523 vpitch = sizeimage / (hpitch * 2); ··· 580 568 static int vpif_mmap(struct file *filep, struct vm_area_struct *vma) 581 569 { 582 570 struct vpif_fh *fh = filep->private_data; 583 - struct common_obj *common = &fh->channel->common[VPIF_VIDEO_INDEX]; 571 + struct channel_obj *ch = fh->channel; 572 + struct common_obj *common = &(ch->common[VPIF_VIDEO_INDEX]); 573 + 574 + vpif_dbg(2, debug, "vpif_mmap\n"); 584 575 585 576 return videobuf_mmap_mapper(&common->buffer_queue, vma); 586 577 } ··· 652 637 struct channel_obj *ch = fh->channel; 653 638 struct common_obj *common = &ch->common[VPIF_VIDEO_INDEX]; 654 639 655 - if (mutex_lock_interruptible(&common->lock)) 656 - return -ERESTARTSYS; 657 - 658 640 /* if this instance is doing IO */ 659 641 if (fh->io_allowed[VPIF_VIDEO_INDEX]) { 660 642 /* Reset io_usrs member of channel object */ ··· 674 662 config_params.numbuffers[ch->channel_id]; 675 663 } 676 664 677 - mutex_unlock(&common->lock); 678 - 679 665 /* Decrement channel usrs counter */ 680 666 atomic_dec(&ch->usrs); 681 667 /* If this file handle has initialize encoder device, reset it */ ··· 690 680 } 691 681 692 682 /* functions implementing ioctls */ 693 - 683 + /** 684 + * vpif_querycap() - QUERYCAP handler 685 + * @file: file ptr 686 + * @priv: file handle 687 + * @cap: ptr to v4l2_capability structure 688 + */ 694 689 static int vpif_querycap(struct file *file, void *priv, 695 690 struct v4l2_capability *cap) 696 691 { ··· 737 722 if (common->fmt.type != fmt->type) 738 723 return -EINVAL; 739 724 740 - /* Fill in the information about format */ 741 - if (mutex_lock_interruptible(&common->lock)) 742 - return -ERESTARTSYS; 743 - 744 - if (vpif_get_std_info(ch)) { 745 - vpif_err("Error getting the standard info\n"); 725 + if (vpif_update_resolution(ch)) 746 726 return -EINVAL; 747 - } 748 - 749 727 *fmt = common->fmt; 750 - mutex_unlock(&common->lock); 751 728 return 0; 752 729 } 753 730 ··· 780 773 /* store the pix format in the channel object */ 781 774 common->fmt.fmt.pix = *pixfmt; 782 775 /* store the format in the channel object */ 783 - if (mutex_lock_interruptible(&common->lock)) 784 - return -ERESTARTSYS; 785 - 786 776 common->fmt = *fmt; 787 - mutex_unlock(&common->lock); 788 - 789 777 return 0; 790 778 } 791 779 ··· 810 808 struct common_obj *common; 811 809 enum v4l2_field field; 812 810 u8 index = 0; 813 - int ret = 0; 814 811 815 812 /* This file handle has not initialized the channel, 816 813 It is not allowed to do settings */ ··· 827 826 index = VPIF_VIDEO_INDEX; 828 827 829 828 common = &ch->common[index]; 830 - if (mutex_lock_interruptible(&common->lock)) 831 - return -ERESTARTSYS; 832 829 833 - if (common->fmt.type != reqbuf->type) { 834 - ret = -EINVAL; 835 - goto reqbuf_exit; 836 - } 830 + if (common->fmt.type != reqbuf->type) 831 + return -EINVAL; 837 832 838 - if (0 != common->io_usrs) { 839 - ret = -EBUSY; 840 - goto reqbuf_exit; 841 - } 833 + if (0 != common->io_usrs) 834 + return -EBUSY; 842 835 843 836 if (reqbuf->type == V4L2_BUF_TYPE_VIDEO_OUTPUT) { 844 837 if (common->fmt.fmt.pix.field == V4L2_FIELD_ANY) ··· 849 854 &common->irqlock, 850 855 reqbuf->type, field, 851 856 sizeof(struct videobuf_buffer), fh, 852 - NULL); 857 + &common->lock); 853 858 854 859 /* Set io allowed member of file handle to TRUE */ 855 860 fh->io_allowed[index] = 1; ··· 860 865 INIT_LIST_HEAD(&common->dma_queue); 861 866 862 867 /* Allocate buffers */ 863 - ret = videobuf_reqbufs(&common->buffer_queue, reqbuf); 864 - 865 - reqbuf_exit: 866 - mutex_unlock(&common->lock); 867 - return ret; 868 + return videobuf_reqbufs(&common->buffer_queue, reqbuf); 868 869 } 869 870 870 871 static int vpif_querybuf(struct file *file, void *priv, ··· 981 990 } 982 991 983 992 /* Call encoder subdevice function to set the standard */ 984 - if (mutex_lock_interruptible(&common->lock)) 985 - return -ERESTARTSYS; 986 - 987 993 ch->video.stdid = *std_id; 994 + ch->video.dv_preset = V4L2_DV_INVALID; 995 + memset(&ch->video.bt_timings, 0, sizeof(ch->video.bt_timings)); 996 + 988 997 /* Get the information about the standard */ 989 - if (vpif_get_std_info(ch)) { 990 - vpif_err("Error getting the standard info\n"); 998 + if (vpif_update_resolution(ch)) 991 999 return -EINVAL; 992 - } 993 1000 994 1001 if ((ch->vpifparams.std_info.width * 995 1002 ch->vpifparams.std_info.height * 2) > 996 1003 config_params.channel_bufsize[ch->channel_id]) { 997 1004 vpif_err("invalid std for this size\n"); 998 - ret = -EINVAL; 999 - goto s_std_exit; 1005 + return -EINVAL; 1000 1006 } 1001 1007 1002 1008 common->fmt.fmt.pix.bytesperline = common->fmt.fmt.pix.width; ··· 1004 1016 s_std_output, *std_id); 1005 1017 if (ret < 0) { 1006 1018 vpif_err("Failed to set output standard\n"); 1007 - goto s_std_exit; 1019 + return ret; 1008 1020 } 1009 1021 1010 1022 ret = v4l2_device_call_until_err(&vpif_obj.v4l2_dev, 1, core, 1011 1023 s_std, *std_id); 1012 1024 if (ret < 0) 1013 1025 vpif_err("Failed to set standard for sub devices\n"); 1014 - 1015 - s_std_exit: 1016 - mutex_unlock(&common->lock); 1017 1026 return ret; 1018 1027 } 1019 1028 ··· 1075 1090 if (ret < 0) 1076 1091 return ret; 1077 1092 1078 - /* Call videobuf_streamon to start streaming in videobuf */ 1093 + /* Call videobuf_streamon to start streaming in videobuf */ 1079 1094 ret = videobuf_streamon(&common->buffer_queue); 1080 1095 if (ret < 0) { 1081 1096 vpif_err("videobuf_streamon\n"); 1082 1097 return ret; 1083 1098 } 1084 1099 1085 - if (mutex_lock_interruptible(&common->lock)) 1086 - return -ERESTARTSYS; 1087 - 1088 1100 /* If buffer queue is empty, return error */ 1089 1101 if (list_empty(&common->dma_queue)) { 1090 1102 vpif_err("buffer queue is empty\n"); 1091 - ret = -EIO; 1092 - goto streamon_exit; 1103 + return -EIO; 1093 1104 } 1094 1105 1095 1106 /* Get the next frame from the buffer queue */ ··· 1111 1130 || (!ch->vpifparams.std_info.frm_fmt 1112 1131 && (common->fmt.fmt.pix.field == V4L2_FIELD_NONE))) { 1113 1132 vpif_err("conflict in field format and std format\n"); 1114 - ret = -EINVAL; 1115 - goto streamon_exit; 1133 + return -EINVAL; 1116 1134 } 1117 1135 1118 1136 /* clock settings */ ··· 1120 1140 ch->vpifparams.std_info.hd_sd); 1121 1141 if (ret < 0) { 1122 1142 vpif_err("can't set clock\n"); 1123 - goto streamon_exit; 1143 + return ret; 1124 1144 } 1125 1145 1126 1146 /* set the parameters and addresses */ 1127 1147 ret = vpif_set_video_params(vpif, ch->channel_id + 2); 1128 1148 if (ret < 0) 1129 - goto streamon_exit; 1149 + return ret; 1130 1150 1131 1151 common->started = ret; 1132 1152 vpif_config_addr(ch, ret); ··· 1151 1171 } 1152 1172 channel_first_int[VPIF_VIDEO_INDEX][ch->channel_id] = 1; 1153 1173 } 1154 - 1155 - streamon_exit: 1156 - mutex_unlock(&common->lock); 1157 1174 return ret; 1158 1175 } 1159 1176 ··· 1176 1199 return -EINVAL; 1177 1200 } 1178 1201 1179 - if (mutex_lock_interruptible(&common->lock)) 1180 - return -ERESTARTSYS; 1181 - 1182 1202 if (buftype == V4L2_BUF_TYPE_VIDEO_OUTPUT) { 1183 1203 /* disable channel */ 1184 1204 if (VPIF_CHANNEL2_VIDEO == ch->channel_id) { ··· 1190 1216 } 1191 1217 1192 1218 common->started = 0; 1193 - mutex_unlock(&common->lock); 1194 - 1195 1219 return videobuf_streamoff(&common->buffer_queue); 1196 1220 } 1197 1221 ··· 1236 1264 struct common_obj *common = &ch->common[VPIF_VIDEO_INDEX]; 1237 1265 int ret = 0; 1238 1266 1239 - if (mutex_lock_interruptible(&common->lock)) 1240 - return -ERESTARTSYS; 1241 - 1242 1267 if (common->started) { 1243 1268 vpif_err("Streaming in progress\n"); 1244 - ret = -EBUSY; 1245 - goto s_output_exit; 1269 + return -EBUSY; 1246 1270 } 1247 1271 1248 1272 ret = v4l2_device_call_until_err(&vpif_obj.v4l2_dev, 1, video, ··· 1248 1280 vpif_err("Failed to set output standard\n"); 1249 1281 1250 1282 vid_ch->output_id = i; 1251 - 1252 - s_output_exit: 1253 - mutex_unlock(&common->lock); 1254 1283 return ret; 1255 1284 } 1256 1285 ··· 1280 1315 return v4l2_prio_change(&ch->prio, &fh->prio, p); 1281 1316 } 1282 1317 1318 + /** 1319 + * vpif_enum_dv_presets() - ENUM_DV_PRESETS handler 1320 + * @file: file ptr 1321 + * @priv: file handle 1322 + * @preset: input preset 1323 + */ 1324 + static int vpif_enum_dv_presets(struct file *file, void *priv, 1325 + struct v4l2_dv_enum_preset *preset) 1326 + { 1327 + struct vpif_fh *fh = priv; 1328 + struct channel_obj *ch = fh->channel; 1329 + struct video_obj *vid_ch = &ch->video; 1330 + 1331 + return v4l2_subdev_call(vpif_obj.sd[vid_ch->output_id], 1332 + video, enum_dv_presets, preset); 1333 + } 1334 + 1335 + /** 1336 + * vpif_s_dv_presets() - S_DV_PRESETS handler 1337 + * @file: file ptr 1338 + * @priv: file handle 1339 + * @preset: input preset 1340 + */ 1341 + static int vpif_s_dv_preset(struct file *file, void *priv, 1342 + struct v4l2_dv_preset *preset) 1343 + { 1344 + struct vpif_fh *fh = priv; 1345 + struct channel_obj *ch = fh->channel; 1346 + struct common_obj *common = &ch->common[VPIF_VIDEO_INDEX]; 1347 + struct video_obj *vid_ch = &ch->video; 1348 + int ret = 0; 1349 + 1350 + if (common->started) { 1351 + vpif_dbg(1, debug, "streaming in progress\n"); 1352 + return -EBUSY; 1353 + } 1354 + 1355 + ret = v4l2_prio_check(&ch->prio, fh->prio); 1356 + if (ret != 0) 1357 + return ret; 1358 + 1359 + fh->initialized = 1; 1360 + 1361 + /* Call encoder subdevice function to set the standard */ 1362 + if (mutex_lock_interruptible(&common->lock)) 1363 + return -ERESTARTSYS; 1364 + 1365 + ch->video.dv_preset = preset->preset; 1366 + ch->video.stdid = V4L2_STD_UNKNOWN; 1367 + memset(&ch->video.bt_timings, 0, sizeof(ch->video.bt_timings)); 1368 + 1369 + /* Get the information about the standard */ 1370 + if (vpif_update_resolution(ch)) { 1371 + ret = -EINVAL; 1372 + } else { 1373 + /* Configure the default format information */ 1374 + vpif_config_format(ch); 1375 + 1376 + ret = v4l2_subdev_call(vpif_obj.sd[vid_ch->output_id], 1377 + video, s_dv_preset, preset); 1378 + } 1379 + 1380 + mutex_unlock(&common->lock); 1381 + 1382 + return ret; 1383 + } 1384 + /** 1385 + * vpif_g_dv_presets() - G_DV_PRESETS handler 1386 + * @file: file ptr 1387 + * @priv: file handle 1388 + * @preset: input preset 1389 + */ 1390 + static int vpif_g_dv_preset(struct file *file, void *priv, 1391 + struct v4l2_dv_preset *preset) 1392 + { 1393 + struct vpif_fh *fh = priv; 1394 + struct channel_obj *ch = fh->channel; 1395 + 1396 + preset->preset = ch->video.dv_preset; 1397 + 1398 + return 0; 1399 + } 1400 + /** 1401 + * vpif_s_dv_timings() - S_DV_TIMINGS handler 1402 + * @file: file ptr 1403 + * @priv: file handle 1404 + * @timings: digital video timings 1405 + */ 1406 + static int vpif_s_dv_timings(struct file *file, void *priv, 1407 + struct v4l2_dv_timings *timings) 1408 + { 1409 + struct vpif_fh *fh = priv; 1410 + struct channel_obj *ch = fh->channel; 1411 + struct vpif_params *vpifparams = &ch->vpifparams; 1412 + struct vpif_channel_config_params *std_info = &vpifparams->std_info; 1413 + struct video_obj *vid_ch = &ch->video; 1414 + struct v4l2_bt_timings *bt = &vid_ch->bt_timings; 1415 + int ret; 1416 + 1417 + if (timings->type != V4L2_DV_BT_656_1120) { 1418 + vpif_dbg(2, debug, "Timing type not defined\n"); 1419 + return -EINVAL; 1420 + } 1421 + 1422 + /* Configure subdevice timings, if any */ 1423 + ret = v4l2_subdev_call(vpif_obj.sd[vid_ch->output_id], 1424 + video, s_dv_timings, timings); 1425 + if (ret == -ENOIOCTLCMD) { 1426 + vpif_dbg(2, debug, "Custom DV timings not supported by " 1427 + "subdevice\n"); 1428 + return -EINVAL; 1429 + } 1430 + if (ret < 0) { 1431 + vpif_dbg(2, debug, "Error setting custom DV timings\n"); 1432 + return ret; 1433 + } 1434 + 1435 + if (!(timings->bt.width && timings->bt.height && 1436 + (timings->bt.hbackporch || 1437 + timings->bt.hfrontporch || 1438 + timings->bt.hsync) && 1439 + timings->bt.vfrontporch && 1440 + (timings->bt.vbackporch || 1441 + timings->bt.vsync))) { 1442 + vpif_dbg(2, debug, "Timings for width, height, " 1443 + "horizontal back porch, horizontal sync, " 1444 + "horizontal front porch, vertical back porch, " 1445 + "vertical sync and vertical back porch " 1446 + "must be defined\n"); 1447 + return -EINVAL; 1448 + } 1449 + 1450 + *bt = timings->bt; 1451 + 1452 + /* Configure video port timings */ 1453 + 1454 + std_info->eav2sav = bt->hbackporch + bt->hfrontporch + 1455 + bt->hsync - 8; 1456 + std_info->sav2eav = bt->width; 1457 + 1458 + std_info->l1 = 1; 1459 + std_info->l3 = bt->vsync + bt->vbackporch + 1; 1460 + 1461 + if (bt->interlaced) { 1462 + if (bt->il_vbackporch || bt->il_vfrontporch || bt->il_vsync) { 1463 + std_info->vsize = bt->height * 2 + 1464 + bt->vfrontporch + bt->vsync + bt->vbackporch + 1465 + bt->il_vfrontporch + bt->il_vsync + 1466 + bt->il_vbackporch; 1467 + std_info->l5 = std_info->vsize/2 - 1468 + (bt->vfrontporch - 1); 1469 + std_info->l7 = std_info->vsize/2 + 1; 1470 + std_info->l9 = std_info->l7 + bt->il_vsync + 1471 + bt->il_vbackporch + 1; 1472 + std_info->l11 = std_info->vsize - 1473 + (bt->il_vfrontporch - 1); 1474 + } else { 1475 + vpif_dbg(2, debug, "Required timing values for " 1476 + "interlaced BT format missing\n"); 1477 + return -EINVAL; 1478 + } 1479 + } else { 1480 + std_info->vsize = bt->height + bt->vfrontporch + 1481 + bt->vsync + bt->vbackporch; 1482 + std_info->l5 = std_info->vsize - (bt->vfrontporch - 1); 1483 + } 1484 + strncpy(std_info->name, "Custom timings BT656/1120", 1485 + VPIF_MAX_NAME); 1486 + std_info->width = bt->width; 1487 + std_info->height = bt->height; 1488 + std_info->frm_fmt = bt->interlaced ? 0 : 1; 1489 + std_info->ycmux_mode = 0; 1490 + std_info->capture_format = 0; 1491 + std_info->vbi_supported = 0; 1492 + std_info->hd_sd = 1; 1493 + std_info->stdid = 0; 1494 + std_info->dv_preset = V4L2_DV_INVALID; 1495 + 1496 + vid_ch->stdid = 0; 1497 + vid_ch->dv_preset = V4L2_DV_INVALID; 1498 + 1499 + return 0; 1500 + } 1501 + 1502 + /** 1503 + * vpif_g_dv_timings() - G_DV_TIMINGS handler 1504 + * @file: file ptr 1505 + * @priv: file handle 1506 + * @timings: digital video timings 1507 + */ 1508 + static int vpif_g_dv_timings(struct file *file, void *priv, 1509 + struct v4l2_dv_timings *timings) 1510 + { 1511 + struct vpif_fh *fh = priv; 1512 + struct channel_obj *ch = fh->channel; 1513 + struct video_obj *vid_ch = &ch->video; 1514 + struct v4l2_bt_timings *bt = &vid_ch->bt_timings; 1515 + 1516 + timings->bt = *bt; 1517 + 1518 + return 0; 1519 + } 1520 + 1521 + /* 1522 + * vpif_g_chip_ident() - Identify the chip 1523 + * @file: file ptr 1524 + * @priv: file handle 1525 + * @chip: chip identity 1526 + * 1527 + * Returns zero or -EINVAL if read operations fails. 1528 + */ 1529 + static int vpif_g_chip_ident(struct file *file, void *priv, 1530 + struct v4l2_dbg_chip_ident *chip) 1531 + { 1532 + chip->ident = V4L2_IDENT_NONE; 1533 + chip->revision = 0; 1534 + if (chip->match.type != V4L2_CHIP_MATCH_I2C_DRIVER && 1535 + chip->match.type != V4L2_CHIP_MATCH_I2C_ADDR) { 1536 + vpif_dbg(2, debug, "match_type is invalid.\n"); 1537 + return -EINVAL; 1538 + } 1539 + 1540 + return v4l2_device_call_until_err(&vpif_obj.v4l2_dev, 0, core, 1541 + g_chip_ident, chip); 1542 + } 1543 + 1544 + #ifdef CONFIG_VIDEO_ADV_DEBUG 1545 + /* 1546 + * vpif_dbg_g_register() - Read register 1547 + * @file: file ptr 1548 + * @priv: file handle 1549 + * @reg: register to be read 1550 + * 1551 + * Debugging only 1552 + * Returns zero or -EINVAL if read operations fails. 1553 + */ 1554 + static int vpif_dbg_g_register(struct file *file, void *priv, 1555 + struct v4l2_dbg_register *reg){ 1556 + struct vpif_fh *fh = priv; 1557 + struct channel_obj *ch = fh->channel; 1558 + struct video_obj *vid_ch = &ch->video; 1559 + 1560 + return v4l2_subdev_call(vpif_obj.sd[vid_ch->output_id], core, 1561 + g_register, reg); 1562 + } 1563 + 1564 + /* 1565 + * vpif_dbg_s_register() - Write to register 1566 + * @file: file ptr 1567 + * @priv: file handle 1568 + * @reg: register to be modified 1569 + * 1570 + * Debugging only 1571 + * Returns zero or -EINVAL if write operations fails. 1572 + */ 1573 + static int vpif_dbg_s_register(struct file *file, void *priv, 1574 + struct v4l2_dbg_register *reg){ 1575 + struct vpif_fh *fh = priv; 1576 + struct channel_obj *ch = fh->channel; 1577 + struct video_obj *vid_ch = &ch->video; 1578 + 1579 + return v4l2_subdev_call(vpif_obj.sd[vid_ch->output_id], core, 1580 + s_register, reg); 1581 + } 1582 + #endif 1583 + 1584 + /* 1585 + * vpif_log_status() - Status information 1586 + * @file: file ptr 1587 + * @priv: file handle 1588 + * 1589 + * Returns zero. 1590 + */ 1591 + static int vpif_log_status(struct file *filep, void *priv) 1592 + { 1593 + /* status for sub devices */ 1594 + v4l2_device_call_all(&vpif_obj.v4l2_dev, 0, core, log_status); 1595 + 1596 + return 0; 1597 + } 1598 + 1283 1599 /* vpif display ioctl operations */ 1284 1600 static const struct v4l2_ioctl_ops vpif_ioctl_ops = { 1285 1601 .vidioc_querycap = vpif_querycap, ··· 1582 1336 .vidioc_s_output = vpif_s_output, 1583 1337 .vidioc_g_output = vpif_g_output, 1584 1338 .vidioc_cropcap = vpif_cropcap, 1339 + .vidioc_enum_dv_presets = vpif_enum_dv_presets, 1340 + .vidioc_s_dv_preset = vpif_s_dv_preset, 1341 + .vidioc_g_dv_preset = vpif_g_dv_preset, 1342 + .vidioc_s_dv_timings = vpif_s_dv_timings, 1343 + .vidioc_g_dv_timings = vpif_g_dv_timings, 1344 + .vidioc_g_chip_ident = vpif_g_chip_ident, 1345 + #ifdef CONFIG_VIDEO_ADV_DEBUG 1346 + .vidioc_g_register = vpif_dbg_g_register, 1347 + .vidioc_s_register = vpif_dbg_s_register, 1348 + #endif 1349 + .vidioc_log_status = vpif_log_status, 1585 1350 }; 1586 1351 1587 1352 static const struct v4l2_file_operations vpif_fops = { 1588 1353 .owner = THIS_MODULE, 1589 1354 .open = vpif_open, 1590 1355 .release = vpif_release, 1591 - .ioctl = video_ioctl2, 1356 + .unlocked_ioctl = video_ioctl2, 1592 1357 .mmap = vpif_mmap, 1593 1358 .poll = vpif_poll 1594 1359 }; ··· 1783 1526 v4l2_prio_init(&ch->prio); 1784 1527 ch->common[VPIF_VIDEO_INDEX].fmt.type = 1785 1528 V4L2_BUF_TYPE_VIDEO_OUTPUT; 1529 + ch->video_dev->lock = &common->lock; 1786 1530 1787 1531 /* register video device */ 1788 1532 vpif_dbg(1, debug, "channel=%x,channel->video_dev=%x\n", ··· 1823 1565 vpif_obj.sd[i]->grp_id = 1 << i; 1824 1566 } 1825 1567 1568 + v4l2_info(&vpif_obj.v4l2_dev, 1569 + "DM646x VPIF display driver initialized\n"); 1826 1570 return 0; 1827 1571 1828 1572 probe_subdev_out:
+2
drivers/media/video/davinci/vpif_display.h
··· 67 67 * most recent displayed frame only */ 68 68 v4l2_std_id stdid; /* Currently selected or default 69 69 * standard */ 70 + u32 dv_preset; 71 + struct v4l2_bt_timings bt_timings; 70 72 u32 output_id; /* Current output id */ 71 73 }; 72 74
+11 -8
drivers/media/video/em28xx/em28xx-cards.c
··· 33 33 #include <media/saa7115.h> 34 34 #include <media/tvp5150.h> 35 35 #include <media/tvaudio.h> 36 + #include <media/mt9v011.h> 36 37 #include <media/i2c-addr.h> 37 38 #include <media/tveeprom.h> 38 39 #include <media/v4l2-common.h> ··· 1918 1917 I2C_CLIENT_END 1919 1918 }; 1920 1919 1921 - static unsigned short mt9v011_addrs[] = { 1922 - 0xba >> 1, 1923 - I2C_CLIENT_END 1924 - }; 1925 - 1926 1920 static unsigned short msp3400_addrs[] = { 1927 1921 0x80 >> 1, 1928 1922 0x88 >> 1, ··· 2433 2437 dev->init_data.ir_codes = RC_MAP_RC5_HAUPPAUGE_NEW; 2434 2438 dev->init_data.get_key = em28xx_get_key_em_haup; 2435 2439 dev->init_data.name = "i2c IR (EM2840 Hauppauge)"; 2440 + break; 2436 2441 case EM2820_BOARD_LEADTEK_WINFAST_USBII_DELUXE: 2437 2442 dev->init_data.ir_codes = RC_MAP_WINFAST_USBII_DELUXE; 2438 2443 dev->init_data.get_key = em28xx_get_key_winfast_usbii_deluxe; ··· 2620 2623 "tvp5150", 0, tvp5150_addrs); 2621 2624 2622 2625 if (dev->em28xx_sensor == EM28XX_MT9V011) { 2626 + struct mt9v011_platform_data pdata; 2627 + struct i2c_board_info mt9v011_info = { 2628 + .type = "mt9v011", 2629 + .addr = 0xba >> 1, 2630 + .platform_data = &pdata, 2631 + }; 2623 2632 struct v4l2_subdev *sd; 2624 2633 2625 - sd = v4l2_i2c_new_subdev(&dev->v4l2_dev, 2626 - &dev->i2c_adap, "mt9v011", 0, mt9v011_addrs); 2627 - v4l2_subdev_call(sd, core, s_config, 0, &dev->sensor_xtal); 2634 + pdata.xtal = dev->sensor_xtal; 2635 + sd = v4l2_i2c_new_subdev_board(&dev->v4l2_dev, &dev->i2c_adap, 2636 + &mt9v011_info, NULL); 2628 2637 } 2629 2638 2630 2639
-24
drivers/media/video/et61x251/et61x251.h
··· 59 59 /*****************************************************************************/ 60 60 61 61 static const struct usb_device_id et61x251_id_table[] = { 62 - { USB_DEVICE(0x102c, 0x6151), }, 63 62 { USB_DEVICE(0x102c, 0x6251), }, 64 - { USB_DEVICE(0x102c, 0x6253), }, 65 - { USB_DEVICE(0x102c, 0x6254), }, 66 - { USB_DEVICE(0x102c, 0x6255), }, 67 - { USB_DEVICE(0x102c, 0x6256), }, 68 - { USB_DEVICE(0x102c, 0x6257), }, 69 - { USB_DEVICE(0x102c, 0x6258), }, 70 - { USB_DEVICE(0x102c, 0x6259), }, 71 - { USB_DEVICE(0x102c, 0x625a), }, 72 - { USB_DEVICE(0x102c, 0x625b), }, 73 - { USB_DEVICE(0x102c, 0x625c), }, 74 - { USB_DEVICE(0x102c, 0x625d), }, 75 - { USB_DEVICE(0x102c, 0x625e), }, 76 - { USB_DEVICE(0x102c, 0x625f), }, 77 - { USB_DEVICE(0x102c, 0x6260), }, 78 - { USB_DEVICE(0x102c, 0x6261), }, 79 - { USB_DEVICE(0x102c, 0x6262), }, 80 - { USB_DEVICE(0x102c, 0x6263), }, 81 - { USB_DEVICE(0x102c, 0x6264), }, 82 - { USB_DEVICE(0x102c, 0x6265), }, 83 - { USB_DEVICE(0x102c, 0x6266), }, 84 - { USB_DEVICE(0x102c, 0x6267), }, 85 - { USB_DEVICE(0x102c, 0x6268), }, 86 - { USB_DEVICE(0x102c, 0x6269), }, 87 63 { } 88 64 }; 89 65
+1 -1
drivers/media/video/gspca/benq.c
··· 276 276 }; 277 277 278 278 /* -- module initialisation -- */ 279 - static const __devinitdata struct usb_device_id device_table[] = { 279 + static const struct usb_device_id device_table[] = { 280 280 {USB_DEVICE(0x04a5, 0x3035)}, 281 281 {} 282 282 };
+2 -2
drivers/media/video/gspca/conex.c
··· 1040 1040 }; 1041 1041 1042 1042 /* -- module initialisation -- */ 1043 - static const struct usb_device_id device_table[] __devinitconst = { 1043 + static const struct usb_device_id device_table[] = { 1044 1044 {USB_DEVICE(0x0572, 0x0041)}, 1045 1045 {} 1046 1046 }; 1047 1047 MODULE_DEVICE_TABLE(usb, device_table); 1048 1048 1049 1049 /* -- device connect -- */ 1050 - static int __devinit sd_probe(struct usb_interface *intf, 1050 + static int sd_probe(struct usb_interface *intf, 1051 1051 const struct usb_device_id *id) 1052 1052 { 1053 1053 return gspca_dev_probe(intf, id, &sd_desc, sizeof(struct sd),
+1 -1
drivers/media/video/gspca/cpia1.c
··· 2088 2088 }; 2089 2089 2090 2090 /* -- module initialisation -- */ 2091 - static const __devinitdata struct usb_device_id device_table[] = { 2091 + static const struct usb_device_id device_table[] = { 2092 2092 {USB_DEVICE(0x0553, 0x0002)}, 2093 2093 {USB_DEVICE(0x0813, 0x0001)}, 2094 2094 {}
+2 -2
drivers/media/video/gspca/etoms.c
··· 864 864 }; 865 865 866 866 /* -- module initialisation -- */ 867 - static const struct usb_device_id device_table[] __devinitconst = { 867 + static const struct usb_device_id device_table[] = { 868 868 {USB_DEVICE(0x102c, 0x6151), .driver_info = SENSOR_PAS106}, 869 869 #if !defined CONFIG_USB_ET61X251 && !defined CONFIG_USB_ET61X251_MODULE 870 870 {USB_DEVICE(0x102c, 0x6251), .driver_info = SENSOR_TAS5130CXX}, ··· 875 875 MODULE_DEVICE_TABLE(usb, device_table); 876 876 877 877 /* -- device connect -- */ 878 - static int __devinit sd_probe(struct usb_interface *intf, 878 + static int sd_probe(struct usb_interface *intf, 879 879 const struct usb_device_id *id) 880 880 { 881 881 return gspca_dev_probe(intf, id, &sd_desc, sizeof(struct sd),
+1 -1
drivers/media/video/gspca/finepix.c
··· 229 229 } 230 230 231 231 /* Table of supported USB devices */ 232 - static const __devinitdata struct usb_device_id device_table[] = { 232 + static const struct usb_device_id device_table[] = { 233 233 {USB_DEVICE(0x04cb, 0x0104)}, 234 234 {USB_DEVICE(0x04cb, 0x0109)}, 235 235 {USB_DEVICE(0x04cb, 0x010b)},
+1 -1
drivers/media/video/gspca/gl860/gl860.c
··· 488 488 489 489 /*=================== USB driver structure initialisation ==================*/ 490 490 491 - static const __devinitdata struct usb_device_id device_table[] = { 491 + static const struct usb_device_id device_table[] = { 492 492 {USB_DEVICE(0x05e3, 0x0503)}, 493 493 {USB_DEVICE(0x05e3, 0xf191)}, 494 494 {}
+100 -120
drivers/media/video/gspca/gspca.c
··· 55 55 MODULE_DESCRIPTION("GSPCA USB Camera Driver"); 56 56 MODULE_LICENSE("GPL"); 57 57 58 - #define DRIVER_VERSION_NUMBER KERNEL_VERSION(2, 11, 0) 58 + #define DRIVER_VERSION_NUMBER KERNEL_VERSION(2, 12, 0) 59 59 60 60 #ifdef GSPCA_DEBUG 61 61 int gspca_debug = D_ERR | D_PROBE; ··· 508 508 return 0; 509 509 } 510 510 511 - static int frame_alloc(struct gspca_dev *gspca_dev, 512 - unsigned int count) 511 + static int frame_alloc(struct gspca_dev *gspca_dev, struct file *file, 512 + enum v4l2_memory memory, unsigned int count) 513 513 { 514 514 struct gspca_frame *frame; 515 515 unsigned int frsz; ··· 519 519 frsz = gspca_dev->cam.cam_mode[i].sizeimage; 520 520 PDEBUG(D_STREAM, "frame alloc frsz: %d", frsz); 521 521 frsz = PAGE_ALIGN(frsz); 522 - gspca_dev->frsz = frsz; 523 522 if (count >= GSPCA_MAX_FRAMES) 524 523 count = GSPCA_MAX_FRAMES - 1; 525 524 gspca_dev->frbuf = vmalloc_32(frsz * count); ··· 526 527 err("frame alloc failed"); 527 528 return -ENOMEM; 528 529 } 530 + gspca_dev->capt_file = file; 531 + gspca_dev->memory = memory; 532 + gspca_dev->frsz = frsz; 529 533 gspca_dev->nframes = count; 530 534 for (i = 0; i < count; i++) { 531 535 frame = &gspca_dev->frame[i]; ··· 537 535 frame->v4l2_buf.flags = 0; 538 536 frame->v4l2_buf.field = V4L2_FIELD_NONE; 539 537 frame->v4l2_buf.length = frsz; 540 - frame->v4l2_buf.memory = gspca_dev->memory; 538 + frame->v4l2_buf.memory = memory; 541 539 frame->v4l2_buf.sequence = 0; 542 540 frame->data = gspca_dev->frbuf + i * frsz; 543 541 frame->v4l2_buf.m.offset = i * frsz; ··· 560 558 gspca_dev->frame[i].data = NULL; 561 559 } 562 560 gspca_dev->nframes = 0; 561 + gspca_dev->frsz = 0; 562 + gspca_dev->capt_file = NULL; 563 + gspca_dev->memory = GSPCA_MEMORY_NO; 563 564 } 564 565 565 566 static void destroy_urbs(struct gspca_dev *gspca_dev) ··· 1215 1210 static int dev_open(struct file *file) 1216 1211 { 1217 1212 struct gspca_dev *gspca_dev; 1218 - int ret; 1219 1213 1220 1214 PDEBUG(D_STREAM, "[%s] open", current->comm); 1221 1215 gspca_dev = (struct gspca_dev *) video_devdata(file); 1222 - if (mutex_lock_interruptible(&gspca_dev->queue_lock)) 1223 - return -ERESTARTSYS; 1224 - if (!gspca_dev->present) { 1225 - ret = -ENODEV; 1226 - goto out; 1227 - } 1228 - 1229 - if (gspca_dev->users > 4) { /* (arbitrary value) */ 1230 - ret = -EBUSY; 1231 - goto out; 1232 - } 1216 + if (!gspca_dev->present) 1217 + return -ENODEV; 1233 1218 1234 1219 /* protect the subdriver against rmmod */ 1235 - if (!try_module_get(gspca_dev->module)) { 1236 - ret = -ENODEV; 1237 - goto out; 1238 - } 1239 - 1240 - gspca_dev->users++; 1220 + if (!try_module_get(gspca_dev->module)) 1221 + return -ENODEV; 1241 1222 1242 1223 file->private_data = gspca_dev; 1243 1224 #ifdef GSPCA_DEBUG ··· 1235 1244 gspca_dev->vdev.debug &= ~(V4L2_DEBUG_IOCTL 1236 1245 | V4L2_DEBUG_IOCTL_ARG); 1237 1246 #endif 1238 - ret = 0; 1239 - out: 1240 - mutex_unlock(&gspca_dev->queue_lock); 1241 - if (ret != 0) 1242 - PDEBUG(D_ERR|D_STREAM, "open failed err %d", ret); 1243 - else 1244 - PDEBUG(D_STREAM, "open done"); 1245 - return ret; 1247 + return 0; 1246 1248 } 1247 1249 1248 1250 static int dev_close(struct file *file) ··· 1245 1261 PDEBUG(D_STREAM, "[%s] close", current->comm); 1246 1262 if (mutex_lock_interruptible(&gspca_dev->queue_lock)) 1247 1263 return -ERESTARTSYS; 1248 - gspca_dev->users--; 1249 1264 1250 1265 /* if the file did the capture, free the streaming resources */ 1251 1266 if (gspca_dev->capt_file == file) { ··· 1255 1272 mutex_unlock(&gspca_dev->usb_lock); 1256 1273 } 1257 1274 frame_free(gspca_dev); 1258 - gspca_dev->capt_file = NULL; 1259 - gspca_dev->memory = GSPCA_MEMORY_NO; 1260 1275 } 1261 1276 file->private_data = NULL; 1262 1277 module_put(gspca_dev->module); ··· 1497 1516 return -ERESTARTSYS; 1498 1517 1499 1518 if (gspca_dev->memory != GSPCA_MEMORY_NO 1519 + && gspca_dev->memory != GSPCA_MEMORY_READ 1500 1520 && gspca_dev->memory != rb->memory) { 1501 1521 ret = -EBUSY; 1502 1522 goto out; ··· 1526 1544 gspca_stream_off(gspca_dev); 1527 1545 mutex_unlock(&gspca_dev->usb_lock); 1528 1546 } 1547 + /* Don't restart the stream when switching from read to mmap mode */ 1548 + if (gspca_dev->memory == GSPCA_MEMORY_READ) 1549 + streaming = 0; 1529 1550 1530 1551 /* free the previous allocated buffers, if any */ 1531 - if (gspca_dev->nframes != 0) { 1552 + if (gspca_dev->nframes != 0) 1532 1553 frame_free(gspca_dev); 1533 - gspca_dev->capt_file = NULL; 1534 - } 1535 1554 if (rb->count == 0) /* unrequest */ 1536 1555 goto out; 1537 - gspca_dev->memory = rb->memory; 1538 - ret = frame_alloc(gspca_dev, rb->count); 1556 + ret = frame_alloc(gspca_dev, file, rb->memory, rb->count); 1539 1557 if (ret == 0) { 1540 1558 rb->count = gspca_dev->nframes; 1541 - gspca_dev->capt_file = file; 1542 1559 if (streaming) 1543 1560 ret = gspca_init_transfer(gspca_dev); 1544 1561 } ··· 1611 1630 1612 1631 if (buf_type != V4L2_BUF_TYPE_VIDEO_CAPTURE) 1613 1632 return -EINVAL; 1614 - if (!gspca_dev->streaming) 1615 - return 0; 1633 + 1616 1634 if (mutex_lock_interruptible(&gspca_dev->queue_lock)) 1617 1635 return -ERESTARTSYS; 1636 + 1637 + if (!gspca_dev->streaming) { 1638 + ret = 0; 1639 + goto out; 1640 + } 1618 1641 1619 1642 /* check the capture file */ 1620 1643 if (gspca_dev->capt_file != file) { ··· 1634 1649 gspca_dev->usb_err = 0; 1635 1650 gspca_stream_off(gspca_dev); 1636 1651 mutex_unlock(&gspca_dev->usb_lock); 1652 + /* In case another thread is waiting in dqbuf */ 1653 + wake_up_interruptible(&gspca_dev->wq); 1637 1654 1638 1655 /* empty the transfer queues */ 1639 1656 atomic_set(&gspca_dev->fr_q, 0); ··· 1814 1827 return ret; 1815 1828 } 1816 1829 1817 - /* 1818 - * wait for a video frame 1819 - * 1820 - * If a frame is ready, its index is returned. 1821 - */ 1822 - static int frame_wait(struct gspca_dev *gspca_dev, 1823 - int nonblock_ing) 1830 + static int frame_ready_nolock(struct gspca_dev *gspca_dev, struct file *file, 1831 + enum v4l2_memory memory) 1824 1832 { 1825 - int i, ret; 1833 + if (!gspca_dev->present) 1834 + return -ENODEV; 1835 + if (gspca_dev->capt_file != file || gspca_dev->memory != memory || 1836 + !gspca_dev->streaming) 1837 + return -EINVAL; 1826 1838 1827 1839 /* check if a frame is ready */ 1828 - i = gspca_dev->fr_o; 1829 - if (i == atomic_read(&gspca_dev->fr_i)) { 1830 - if (nonblock_ing) 1831 - return -EAGAIN; 1840 + return gspca_dev->fr_o != atomic_read(&gspca_dev->fr_i); 1841 + } 1832 1842 1833 - /* wait till a frame is ready */ 1834 - ret = wait_event_interruptible_timeout(gspca_dev->wq, 1835 - i != atomic_read(&gspca_dev->fr_i) || 1836 - !gspca_dev->streaming || !gspca_dev->present, 1837 - msecs_to_jiffies(3000)); 1838 - if (ret < 0) 1839 - return ret; 1840 - if (ret == 0 || !gspca_dev->streaming || !gspca_dev->present) 1841 - return -EIO; 1842 - } 1843 + static int frame_ready(struct gspca_dev *gspca_dev, struct file *file, 1844 + enum v4l2_memory memory) 1845 + { 1846 + int ret; 1843 1847 1844 - gspca_dev->fr_o = (i + 1) % GSPCA_MAX_FRAMES; 1845 - 1846 - if (gspca_dev->sd_desc->dq_callback) { 1847 - mutex_lock(&gspca_dev->usb_lock); 1848 - gspca_dev->usb_err = 0; 1849 - if (gspca_dev->present) 1850 - gspca_dev->sd_desc->dq_callback(gspca_dev); 1851 - mutex_unlock(&gspca_dev->usb_lock); 1852 - } 1853 - return gspca_dev->fr_queue[i]; 1848 + if (mutex_lock_interruptible(&gspca_dev->queue_lock)) 1849 + return -ERESTARTSYS; 1850 + ret = frame_ready_nolock(gspca_dev, file, memory); 1851 + mutex_unlock(&gspca_dev->queue_lock); 1852 + return ret; 1854 1853 } 1855 1854 1856 1855 /* ··· 1849 1876 { 1850 1877 struct gspca_dev *gspca_dev = priv; 1851 1878 struct gspca_frame *frame; 1852 - int i, ret; 1879 + int i, j, ret; 1853 1880 1854 1881 PDEBUG(D_FRAM, "dqbuf"); 1855 - if (v4l2_buf->memory != gspca_dev->memory) 1856 - return -EINVAL; 1857 1882 1858 - if (!gspca_dev->present) 1859 - return -ENODEV; 1860 - 1861 - /* if not streaming, be sure the application will not loop forever */ 1862 - if (!(file->f_flags & O_NONBLOCK) 1863 - && !gspca_dev->streaming && gspca_dev->users == 1) 1864 - return -EINVAL; 1865 - 1866 - /* only the capturing file may dequeue */ 1867 - if (gspca_dev->capt_file != file) 1868 - return -EINVAL; 1869 - 1870 - /* only one dequeue / read at a time */ 1871 - if (mutex_lock_interruptible(&gspca_dev->read_lock)) 1883 + if (mutex_lock_interruptible(&gspca_dev->queue_lock)) 1872 1884 return -ERESTARTSYS; 1873 1885 1874 - ret = frame_wait(gspca_dev, file->f_flags & O_NONBLOCK); 1875 - if (ret < 0) 1876 - goto out; 1877 - i = ret; /* frame index */ 1878 - frame = &gspca_dev->frame[i]; 1886 + for (;;) { 1887 + ret = frame_ready_nolock(gspca_dev, file, v4l2_buf->memory); 1888 + if (ret < 0) 1889 + goto out; 1890 + if (ret > 0) 1891 + break; 1892 + 1893 + mutex_unlock(&gspca_dev->queue_lock); 1894 + 1895 + if (file->f_flags & O_NONBLOCK) 1896 + return -EAGAIN; 1897 + 1898 + /* wait till a frame is ready */ 1899 + ret = wait_event_interruptible_timeout(gspca_dev->wq, 1900 + frame_ready(gspca_dev, file, v4l2_buf->memory), 1901 + msecs_to_jiffies(3000)); 1902 + if (ret < 0) 1903 + return ret; 1904 + if (ret == 0) 1905 + return -EIO; 1906 + 1907 + if (mutex_lock_interruptible(&gspca_dev->queue_lock)) 1908 + return -ERESTARTSYS; 1909 + } 1910 + 1911 + i = gspca_dev->fr_o; 1912 + j = gspca_dev->fr_queue[i]; 1913 + frame = &gspca_dev->frame[j]; 1914 + 1915 + gspca_dev->fr_o = (i + 1) % GSPCA_MAX_FRAMES; 1916 + 1917 + if (gspca_dev->sd_desc->dq_callback) { 1918 + mutex_lock(&gspca_dev->usb_lock); 1919 + gspca_dev->usb_err = 0; 1920 + if (gspca_dev->present) 1921 + gspca_dev->sd_desc->dq_callback(gspca_dev); 1922 + mutex_unlock(&gspca_dev->usb_lock); 1923 + } 1924 + 1925 + frame->v4l2_buf.flags &= ~V4L2_BUF_FLAG_DONE; 1926 + memcpy(v4l2_buf, &frame->v4l2_buf, sizeof *v4l2_buf); 1927 + PDEBUG(D_FRAM, "dqbuf %d", j); 1928 + ret = 0; 1929 + 1879 1930 if (gspca_dev->memory == V4L2_MEMORY_USERPTR) { 1880 1931 if (copy_to_user((__u8 __user *) frame->v4l2_buf.m.userptr, 1881 1932 frame->data, ··· 1907 1910 PDEBUG(D_ERR|D_STREAM, 1908 1911 "dqbuf cp to user failed"); 1909 1912 ret = -EFAULT; 1910 - goto out; 1911 1913 } 1912 1914 } 1913 - frame->v4l2_buf.flags &= ~V4L2_BUF_FLAG_DONE; 1914 - memcpy(v4l2_buf, &frame->v4l2_buf, sizeof *v4l2_buf); 1915 - PDEBUG(D_FRAM, "dqbuf %d", i); 1916 - ret = 0; 1917 1915 out: 1918 - mutex_unlock(&gspca_dev->read_lock); 1916 + mutex_unlock(&gspca_dev->queue_lock); 1919 1917 return ret; 1920 1918 } 1921 1919 ··· 2025 2033 poll_wait(file, &gspca_dev->wq, wait); 2026 2034 2027 2035 /* if reqbufs is not done, the user would use read() */ 2028 - if (gspca_dev->nframes == 0) { 2029 - if (gspca_dev->memory != GSPCA_MEMORY_NO) 2030 - return POLLERR; /* not the 1st time */ 2036 + if (gspca_dev->memory == GSPCA_MEMORY_NO) { 2031 2037 ret = read_alloc(gspca_dev, file); 2032 2038 if (ret != 0) 2033 2039 return POLLERR; ··· 2057 2067 PDEBUG(D_FRAM, "read (%zd)", count); 2058 2068 if (!gspca_dev->present) 2059 2069 return -ENODEV; 2060 - switch (gspca_dev->memory) { 2061 - case GSPCA_MEMORY_NO: /* first time */ 2070 + if (gspca_dev->memory == GSPCA_MEMORY_NO) { /* first time ? */ 2062 2071 ret = read_alloc(gspca_dev, file); 2063 2072 if (ret != 0) 2064 2073 return ret; 2065 - break; 2066 - case GSPCA_MEMORY_READ: 2067 - if (gspca_dev->capt_file == file) 2068 - break; 2069 - /* fall thru */ 2070 - default: 2071 - return -EINVAL; 2072 2074 } 2073 2075 2074 2076 /* get a frame */ ··· 2248 2266 goto out; 2249 2267 2250 2268 mutex_init(&gspca_dev->usb_lock); 2251 - mutex_init(&gspca_dev->read_lock); 2252 2269 mutex_init(&gspca_dev->queue_lock); 2253 2270 init_waitqueue_head(&gspca_dev->wq); 2254 2271 ··· 2322 2341 PDEBUG(D_PROBE, "%s disconnect", 2323 2342 video_device_node_name(&gspca_dev->vdev)); 2324 2343 mutex_lock(&gspca_dev->usb_lock); 2325 - gspca_dev->present = 0; 2326 2344 2327 - if (gspca_dev->streaming) { 2328 - destroy_urbs(gspca_dev); 2329 - wake_up_interruptible(&gspca_dev->wq); 2330 - } 2345 + gspca_dev->present = 0; 2346 + wake_up_interruptible(&gspca_dev->wq); 2347 + 2348 + destroy_urbs(gspca_dev); 2331 2349 2332 2350 #if defined(CONFIG_INPUT) || defined(CONFIG_INPUT_MODULE) 2333 2351 gspca_input_destroy_urb(gspca_dev);
-2
drivers/media/video/gspca/gspca.h
··· 205 205 206 206 wait_queue_head_t wq; /* wait queue */ 207 207 struct mutex usb_lock; /* usb exchange protection */ 208 - struct mutex read_lock; /* read protection */ 209 208 struct mutex queue_lock; /* ISOC queue protection */ 210 209 int usb_err; /* USB error - protected by usb_lock */ 211 210 u16 pkt_size; /* ISOC packet size */ 212 211 #ifdef CONFIG_PM 213 212 char frozen; /* suspend - resume */ 214 213 #endif 215 - char users; /* number of opens */ 216 214 char present; /* device connected */ 217 215 char nbufread; /* number of buffers for read() */ 218 216 char memory; /* memory type (V4L2_MEMORY_xxx) */
+1 -1
drivers/media/video/gspca/jeilinj.c
··· 314 314 } 315 315 316 316 /* Table of supported USB devices */ 317 - static const __devinitdata struct usb_device_id device_table[] = { 317 + static const struct usb_device_id device_table[] = { 318 318 {USB_DEVICE(0x0979, 0x0280)}, 319 319 {} 320 320 };
+2 -2
drivers/media/video/gspca/jpeg.h
··· 141 141 memcpy(jpeg_hdr, jpeg_head, sizeof jpeg_head); 142 142 #ifndef CONEX_CAM 143 143 jpeg_hdr[JPEG_HEIGHT_OFFSET + 0] = height >> 8; 144 - jpeg_hdr[JPEG_HEIGHT_OFFSET + 1] = height & 0xff; 144 + jpeg_hdr[JPEG_HEIGHT_OFFSET + 1] = height; 145 145 jpeg_hdr[JPEG_HEIGHT_OFFSET + 2] = width >> 8; 146 - jpeg_hdr[JPEG_HEIGHT_OFFSET + 3] = width & 0xff; 146 + jpeg_hdr[JPEG_HEIGHT_OFFSET + 3] = width; 147 147 jpeg_hdr[JPEG_HEIGHT_OFFSET + 6] = samplesY; 148 148 #endif 149 149 }
+1 -1
drivers/media/video/gspca/konica.c
··· 607 607 }; 608 608 609 609 /* -- module initialisation -- */ 610 - static const __devinitdata struct usb_device_id device_table[] = { 610 + static const struct usb_device_id device_table[] = { 611 611 {USB_DEVICE(0x04c8, 0x0720)}, /* Intel YC 76 */ 612 612 {} 613 613 };
+1 -1
drivers/media/video/gspca/m5602/m5602_core.c
··· 28 28 static int dump_bridge; 29 29 int dump_sensor; 30 30 31 - static const __devinitdata struct usb_device_id m5602_table[] = { 31 + static const struct usb_device_id m5602_table[] = { 32 32 {USB_DEVICE(0x0402, 0x5602)}, 33 33 {} 34 34 };
+1 -1
drivers/media/video/gspca/mars.c
··· 490 490 }; 491 491 492 492 /* -- module initialisation -- */ 493 - static const __devinitdata struct usb_device_id device_table[] = { 493 + static const struct usb_device_id device_table[] = { 494 494 {USB_DEVICE(0x093a, 0x050f)}, 495 495 {} 496 496 };
+1 -1
drivers/media/video/gspca/mr97310a.c
··· 1229 1229 }; 1230 1230 1231 1231 /* -- module initialisation -- */ 1232 - static const __devinitdata struct usb_device_id device_table[] = { 1232 + static const struct usb_device_id device_table[] = { 1233 1233 {USB_DEVICE(0x08ca, 0x0110)}, /* Trust Spyc@m 100 */ 1234 1234 {USB_DEVICE(0x08ca, 0x0111)}, /* Aiptek Pencam VGA+ */ 1235 1235 {USB_DEVICE(0x093a, 0x010f)}, /* All other known MR97310A VGA cams */
+3 -5
drivers/media/video/gspca/ov519.c
··· 488 488 #define R511_SNAP_PXDIV 0x1c 489 489 #define R511_SNAP_LNDIV 0x1d 490 490 #define R511_SNAP_UV_EN 0x1e 491 - #define R511_SNAP_UV_EN 0x1e 492 491 #define R511_SNAP_OPTS 0x1f 493 492 494 493 #define R511_DRAM_FLOW_CTL 0x20 ··· 1846 1847 { 0x6c, 0x0a }, 1847 1848 { 0x6d, 0x55 }, 1848 1849 { 0x6e, 0x11 }, 1849 - { 0x6f, 0x9f }, 1850 - /* "9e for advance AWB" */ 1850 + { 0x6f, 0x9f }, /* "9e for advance AWB" */ 1851 1851 { 0x6a, 0x40 }, 1852 1852 { OV7670_R01_BLUE, 0x40 }, 1853 1853 { OV7670_R02_RED, 0x60 }, ··· 3052 3054 { 3053 3055 static const struct ov_regvals init_519[] = { 3054 3056 { 0x5a, 0x6d }, /* EnableSystem */ 3055 - { 0x53, 0x9b }, 3057 + { 0x53, 0x9b }, /* don't enable the microcontroller */ 3056 3058 { OV519_R54_EN_CLK1, 0xff }, /* set bit2 to enable jpeg */ 3057 3059 { 0x5d, 0x03 }, 3058 3060 { 0x49, 0x01 }, ··· 4745 4747 }; 4746 4748 4747 4749 /* -- module initialisation -- */ 4748 - static const __devinitdata struct usb_device_id device_table[] = { 4750 + static const struct usb_device_id device_table[] = { 4749 4751 {USB_DEVICE(0x041e, 0x4003), .driver_info = BRIDGE_W9968CF }, 4750 4752 {USB_DEVICE(0x041e, 0x4052), .driver_info = BRIDGE_OV519 }, 4751 4753 {USB_DEVICE(0x041e, 0x405f), .driver_info = BRIDGE_OV519 },
+20 -9
drivers/media/video/gspca/ov534.c
··· 479 479 struct usb_device *udev = gspca_dev->dev; 480 480 int ret; 481 481 482 - PDEBUG(D_USBO, "reg=0x%04x, val=0%02x", reg, val); 482 + if (gspca_dev->usb_err < 0) 483 + return; 484 + 485 + PDEBUG(D_USBO, "SET 01 0000 %04x %02x", reg, val); 483 486 gspca_dev->usb_buf[0] = val; 484 487 ret = usb_control_msg(udev, 485 488 usb_sndctrlpipe(udev, 0), 486 489 0x01, 487 490 USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_DEVICE, 488 491 0x00, reg, gspca_dev->usb_buf, 1, CTRL_TIMEOUT); 489 - if (ret < 0) 492 + if (ret < 0) { 490 493 err("write failed %d", ret); 494 + gspca_dev->usb_err = ret; 495 + } 491 496 } 492 497 493 498 static u8 ov534_reg_read(struct gspca_dev *gspca_dev, u16 reg) ··· 500 495 struct usb_device *udev = gspca_dev->dev; 501 496 int ret; 502 497 498 + if (gspca_dev->usb_err < 0) 499 + return 0; 503 500 ret = usb_control_msg(udev, 504 501 usb_rcvctrlpipe(udev, 0), 505 502 0x01, 506 503 USB_DIR_IN | USB_TYPE_VENDOR | USB_RECIP_DEVICE, 507 504 0x00, reg, gspca_dev->usb_buf, 1, CTRL_TIMEOUT); 508 - PDEBUG(D_USBI, "reg=0x%04x, data=0x%02x", reg, gspca_dev->usb_buf[0]); 509 - if (ret < 0) 505 + PDEBUG(D_USBI, "GET 01 0000 %04x %02x", reg, gspca_dev->usb_buf[0]); 506 + if (ret < 0) { 510 507 err("read failed %d", ret); 508 + gspca_dev->usb_err = ret; 509 + } 511 510 return gspca_dev->usb_buf[0]; 512 511 } 513 512 ··· 567 558 568 559 static void sccb_reg_write(struct gspca_dev *gspca_dev, u8 reg, u8 val) 569 560 { 570 - PDEBUG(D_USBO, "reg: 0x%02x, val: 0x%02x", reg, val); 561 + PDEBUG(D_USBO, "sccb write: %02x %02x", reg, val); 571 562 ov534_reg_write(gspca_dev, OV534_REG_SUBADDR, reg); 572 563 ov534_reg_write(gspca_dev, OV534_REG_WRITE, val); 573 564 ov534_reg_write(gspca_dev, OV534_REG_OPERATION, OV534_OP_WRITE_3); 574 565 575 - if (!sccb_check_status(gspca_dev)) 566 + if (!sccb_check_status(gspca_dev)) { 576 567 err("sccb_reg_write failed"); 568 + gspca_dev->usb_err = -EIO; 569 + } 577 570 } 578 571 579 572 static u8 sccb_reg_read(struct gspca_dev *gspca_dev, u16 reg) ··· 896 885 ov534_set_led(gspca_dev, 0); 897 886 set_frame_rate(gspca_dev); 898 887 899 - return 0; 888 + return gspca_dev->usb_err; 900 889 } 901 890 902 891 static int sd_start(struct gspca_dev *gspca_dev) ··· 931 920 932 921 ov534_set_led(gspca_dev, 1); 933 922 ov534_reg_write(gspca_dev, 0xe0, 0x00); 934 - return 0; 923 + return gspca_dev->usb_err; 935 924 } 936 925 937 926 static void sd_stopN(struct gspca_dev *gspca_dev) ··· 1300 1289 }; 1301 1290 1302 1291 /* -- module initialisation -- */ 1303 - static const __devinitdata struct usb_device_id device_table[] = { 1292 + static const struct usb_device_id device_table[] = { 1304 1293 {USB_DEVICE(0x1415, 0x2000)}, 1305 1294 {} 1306 1295 };
+1 -1
drivers/media/video/gspca/ov534_9.c
··· 1429 1429 }; 1430 1430 1431 1431 /* -- module initialisation -- */ 1432 - static const __devinitdata struct usb_device_id device_table[] = { 1432 + static const struct usb_device_id device_table[] = { 1433 1433 {USB_DEVICE(0x06f8, 0x3003)}, 1434 1434 {} 1435 1435 };
+1 -1
drivers/media/video/gspca/pac207.c
··· 530 530 }; 531 531 532 532 /* -- module initialisation -- */ 533 - static const __devinitdata struct usb_device_id device_table[] = { 533 + static const struct usb_device_id device_table[] = { 534 534 {USB_DEVICE(0x041e, 0x4028)}, 535 535 {USB_DEVICE(0x093a, 0x2460)}, 536 536 {USB_DEVICE(0x093a, 0x2461)},
+2 -2
drivers/media/video/gspca/pac7302.c
··· 1184 1184 }; 1185 1185 1186 1186 /* -- module initialisation -- */ 1187 - static const struct usb_device_id device_table[] __devinitconst = { 1187 + static const struct usb_device_id device_table[] = { 1188 1188 {USB_DEVICE(0x06f8, 0x3009)}, 1189 1189 {USB_DEVICE(0x093a, 0x2620)}, 1190 1190 {USB_DEVICE(0x093a, 0x2621)}, ··· 1201 1201 MODULE_DEVICE_TABLE(usb, device_table); 1202 1202 1203 1203 /* -- device connect -- */ 1204 - static int __devinit sd_probe(struct usb_interface *intf, 1204 + static int sd_probe(struct usb_interface *intf, 1205 1205 const struct usb_device_id *id) 1206 1206 { 1207 1207 return gspca_dev_probe(intf, id, &sd_desc, sizeof(struct sd),
+2 -2
drivers/media/video/gspca/pac7311.c
··· 837 837 }; 838 838 839 839 /* -- module initialisation -- */ 840 - static const struct usb_device_id device_table[] __devinitconst = { 840 + static const struct usb_device_id device_table[] = { 841 841 {USB_DEVICE(0x093a, 0x2600)}, 842 842 {USB_DEVICE(0x093a, 0x2601)}, 843 843 {USB_DEVICE(0x093a, 0x2603)}, ··· 849 849 MODULE_DEVICE_TABLE(usb, device_table); 850 850 851 851 /* -- device connect -- */ 852 - static int __devinit sd_probe(struct usb_interface *intf, 852 + static int sd_probe(struct usb_interface *intf, 853 853 const struct usb_device_id *id) 854 854 { 855 855 return gspca_dev_probe(intf, id, &sd_desc, sizeof(struct sd),
+1 -1
drivers/media/video/gspca/sn9c2028.c
··· 703 703 }; 704 704 705 705 /* -- module initialisation -- */ 706 - static const __devinitdata struct usb_device_id device_table[] = { 706 + static const struct usb_device_id device_table[] = { 707 707 {USB_DEVICE(0x0458, 0x7005)}, /* Genius Smart 300, version 2 */ 708 708 /* The Genius Smart is untested. I can't find an owner ! */ 709 709 /* {USB_DEVICE(0x0c45, 0x8000)}, DC31VC, Don't know this camera */
+1 -1
drivers/media/video/gspca/sn9c20x.c
··· 2470 2470 | (SENSOR_ ## sensor << 8) \ 2471 2471 | (i2c_addr) 2472 2472 2473 - static const __devinitdata struct usb_device_id device_table[] = { 2473 + static const struct usb_device_id device_table[] = { 2474 2474 {USB_DEVICE(0x0c45, 0x6240), SN9C20X(MT9M001, 0x5d, 0)}, 2475 2475 {USB_DEVICE(0x0c45, 0x6242), SN9C20X(MT9M111, 0x5d, 0)}, 2476 2476 {USB_DEVICE(0x0c45, 0x6248), SN9C20X(OV9655, 0x30, 0)},
+157 -113
drivers/media/video/gspca/sonixb.c
··· 23 23 /* Some documentation on known sonixb registers: 24 24 25 25 Reg Use 26 + sn9c101 / sn9c102: 26 27 0x10 high nibble red gain low nibble blue gain 27 28 0x11 low nibble green gain 29 + sn9c103: 30 + 0x05 red gain 0-127 31 + 0x06 blue gain 0-127 32 + 0x07 green gain 0-127 33 + all: 34 + 0x08-0x0f i2c / 3wire registers 28 35 0x12 hstart 29 36 0x13 vstart 30 37 0x15 hsize (hsize = register-value * 16) ··· 95 88 typedef const __u8 sensor_init_t[8]; 96 89 97 90 struct sensor_data { 98 - const __u8 *bridge_init[2]; 99 - int bridge_init_size[2]; 91 + const __u8 *bridge_init; 100 92 sensor_init_t *sensor_init; 101 93 int sensor_init_size; 102 - sensor_init_t *sensor_bridge_init[2]; 103 - int sensor_bridge_init_size[2]; 104 94 int flags; 105 95 unsigned ctrl_dis; 106 96 __u8 sensor_addr; ··· 118 114 #define NO_FREQ (1 << FREQ_IDX) 119 115 #define NO_BRIGHTNESS (1 << BRIGHTNESS_IDX) 120 116 121 - #define COMP2 0x8f 122 117 #define COMP 0xc7 /* 0x87 //0x07 */ 123 118 #define COMP1 0xc9 /* 0x89 //0x09 */ 124 119 ··· 126 123 127 124 #define SYS_CLK 0x04 128 125 129 - #define SENS(bridge_1, bridge_3, sensor, sensor_1, \ 130 - sensor_3, _flags, _ctrl_dis, _sensor_addr) \ 126 + #define SENS(bridge, sensor, _flags, _ctrl_dis, _sensor_addr) \ 131 127 { \ 132 - .bridge_init = { bridge_1, bridge_3 }, \ 133 - .bridge_init_size = { sizeof(bridge_1), sizeof(bridge_3) }, \ 128 + .bridge_init = bridge, \ 134 129 .sensor_init = sensor, \ 135 130 .sensor_init_size = sizeof(sensor), \ 136 - .sensor_bridge_init = { sensor_1, sensor_3,}, \ 137 - .sensor_bridge_init_size = { sizeof(sensor_1), sizeof(sensor_3)}, \ 138 131 .flags = _flags, .ctrl_dis = _ctrl_dis, .sensor_addr = _sensor_addr \ 139 132 } 140 133 ··· 310 311 0x00, 0x00, 311 312 0x00, 0x00, 0x00, 0x02, 0x02, 0x00, 312 313 0x28, 0x1e, 0x60, 0x8e, 0x42, 313 - 0x1d, 0x10, 0x02, 0x03, 0x0f, 0x0c 314 314 }; 315 315 static const __u8 hv7131d_sensor_init[][8] = { 316 316 {0xa0, 0x11, 0x01, 0x04, 0x00, 0x00, 0x00, 0x17}, ··· 324 326 0x00, 0x00, 325 327 0x00, 0x00, 0x00, 0x02, 0x01, 0x00, 326 328 0x28, 0x1e, 0x60, 0x8a, 0x20, 327 - 0x1d, 0x10, 0x02, 0x03, 0x0f, 0x0c 328 329 }; 329 330 static const __u8 hv7131r_sensor_init[][8] = { 330 331 {0xc0, 0x11, 0x31, 0x38, 0x2a, 0x2e, 0x00, 0x10}, ··· 336 339 0x44, 0x44, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 337 340 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 338 341 0x00, 0x01, 0x01, 0x0a, 0x16, 0x12, 0x68, 0x8b, 339 - 0x10, 0x1d, 0x10, 0x02, 0x02, 0x09, 0x07 342 + 0x10, 340 343 }; 341 344 static const __u8 ov6650_sensor_init[][8] = { 342 345 /* Bright, contrast, etc are set through SCBB interface. ··· 375 378 0x21, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* r09 .. r10 */ 376 379 0x00, 0x01, 0x01, 0x0a, /* r11 .. r14 */ 377 380 0x28, 0x1e, /* H & V sizes r15 .. r16 */ 378 - 0x68, COMP2, MCK_INIT1, /* r17 .. r19 */ 379 - 0x1d, 0x10, 0x02, 0x03, 0x0f, 0x0c /* r1a .. r1f */ 380 - }; 381 - static const __u8 initOv7630_3[] = { 382 - 0x44, 0x44, 0x00, 0x1a, 0x20, 0x20, 0x20, 0x80, /* r01 .. r08 */ 383 - 0x21, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* r09 .. r10 */ 384 - 0x00, 0x02, 0x01, 0x0a, /* r11 .. r14 */ 385 - 0x28, 0x1e, /* H & V sizes r15 .. r16 */ 386 381 0x68, 0x8f, MCK_INIT1, /* r17 .. r19 */ 387 - 0x1d, 0x10, 0x02, 0x03, 0x0f, 0x0c, 0x00, /* r1a .. r20 */ 388 - 0x10, 0x20, 0x30, 0x40, 0x50, 0x60, 0x70, 0x80, /* r21 .. r28 */ 389 - 0x90, 0xa0, 0xb0, 0xc0, 0xd0, 0xe0, 0xf0, 0xff /* r29 .. r30 */ 390 382 }; 391 383 static const __u8 ov7630_sensor_init[][8] = { 392 384 {0xa0, 0x21, 0x12, 0x80, 0x00, 0x00, 0x00, 0x10}, 393 385 {0xb0, 0x21, 0x01, 0x77, 0x3a, 0x00, 0x00, 0x10}, 394 386 /* {0xd0, 0x21, 0x12, 0x7c, 0x01, 0x80, 0x34, 0x10}, jfm */ 395 - {0xd0, 0x21, 0x12, 0x1c, 0x00, 0x80, 0x34, 0x10}, /* jfm */ 387 + {0xd0, 0x21, 0x12, 0x5c, 0x00, 0x80, 0x34, 0x10}, /* jfm */ 396 388 {0xa0, 0x21, 0x1b, 0x04, 0x00, 0x80, 0x34, 0x10}, 397 389 {0xa0, 0x21, 0x20, 0x44, 0x00, 0x80, 0x34, 0x10}, 398 390 {0xa0, 0x21, 0x23, 0xee, 0x00, 0x80, 0x34, 0x10}, ··· 399 413 {0xd0, 0x21, 0x17, 0x1c, 0xbd, 0x06, 0xf6, 0x10}, 400 414 }; 401 415 402 - static const __u8 ov7630_sensor_init_3[][8] = { 403 - {0xa0, 0x21, 0x13, 0x80, 0x00, 0x00, 0x00, 0x10}, 404 - }; 405 - 406 416 static const __u8 initPas106[] = { 407 417 0x04, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x81, 0x40, 0x00, 0x00, 0x00, 408 418 0x00, 0x00, 409 419 0x00, 0x00, 0x00, 0x04, 0x01, 0x00, 410 420 0x16, 0x12, 0x24, COMP1, MCK_INIT1, 411 - 0x18, 0x10, 0x02, 0x02, 0x09, 0x07 412 421 }; 413 422 /* compression 0x86 mckinit1 0x2b */ 414 423 ··· 477 496 0x00, 0x00, 478 497 0x00, 0x00, 0x00, 0x06, 0x03, 0x0a, 479 498 0x28, 0x1e, 0x20, 0x89, 0x20, 480 - 0x00, 0x00, 0x02, 0x03, 0x0f, 0x0c 481 499 }; 482 500 483 501 /* "Known" PAS202BCB registers: ··· 517 537 0x00, 0x00, 518 538 0x00, 0x00, 0x00, 0x45, 0x09, 0x0a, 519 539 0x16, 0x12, 0x60, 0x86, 0x2b, 520 - 0x14, 0x0a, 0x02, 0x02, 0x09, 0x07 521 540 }; 522 541 /* Same as above, except a different hstart */ 523 542 static const __u8 initTas5110d[] = { ··· 524 545 0x00, 0x00, 525 546 0x00, 0x00, 0x00, 0x41, 0x09, 0x0a, 526 547 0x16, 0x12, 0x60, 0x86, 0x2b, 527 - 0x14, 0x0a, 0x02, 0x02, 0x09, 0x07 528 548 }; 529 - static const __u8 tas5110_sensor_init[][8] = { 549 + /* tas5110c is 3 wire, tas5110d is 2 wire (regular i2c) */ 550 + static const __u8 tas5110c_sensor_init[][8] = { 530 551 {0x30, 0x11, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x10}, 531 552 {0x30, 0x11, 0x02, 0x20, 0xa9, 0x00, 0x00, 0x10}, 532 - {0xa0, 0x61, 0x9a, 0xca, 0x00, 0x00, 0x00, 0x17}, 553 + }; 554 + /* Known TAS5110D registers 555 + * reg02: gain, bit order reversed!! 0 == max gain, 255 == min gain 556 + * reg03: bit3: vflip, bit4: ~hflip, bit7: ~gainboost (~ == inverted) 557 + * Note: writing reg03 seems to only work when written together with 02 558 + */ 559 + static const __u8 tas5110d_sensor_init[][8] = { 560 + {0xa0, 0x61, 0x9a, 0xca, 0x00, 0x00, 0x00, 0x17}, /* reset */ 533 561 }; 534 562 535 563 static const __u8 initTas5130[] = { ··· 544 558 0x00, 0x00, 545 559 0x00, 0x00, 0x00, 0x68, 0x0c, 0x0a, 546 560 0x28, 0x1e, 0x60, COMP, MCK_INIT, 547 - 0x18, 0x10, 0x04, 0x03, 0x11, 0x0c 548 561 }; 549 562 static const __u8 tas5130_sensor_init[][8] = { 550 563 /* {0x30, 0x11, 0x00, 0x40, 0x47, 0x00, 0x00, 0x10}, ··· 554 569 }; 555 570 556 571 static struct sensor_data sensor_data[] = { 557 - SENS(initHv7131d, NULL, hv7131d_sensor_init, NULL, NULL, F_GAIN, NO_BRIGHTNESS|NO_FREQ, 0), 558 - SENS(initHv7131r, NULL, hv7131r_sensor_init, NULL, NULL, 0, NO_BRIGHTNESS|NO_EXPO|NO_FREQ, 0), 559 - SENS(initOv6650, NULL, ov6650_sensor_init, NULL, NULL, F_GAIN|F_SIF, 0, 0x60), 560 - SENS(initOv7630, initOv7630_3, ov7630_sensor_init, NULL, ov7630_sensor_init_3, 561 - F_GAIN, 0, 0x21), 562 - SENS(initPas106, NULL, pas106_sensor_init, NULL, NULL, F_GAIN|F_SIF, NO_FREQ, 563 - 0), 564 - SENS(initPas202, initPas202, pas202_sensor_init, NULL, NULL, F_GAIN, 565 - NO_FREQ, 0), 566 - SENS(initTas5110c, NULL, tas5110_sensor_init, NULL, NULL, 567 - F_GAIN|F_SIF|F_COARSE_EXPO, NO_BRIGHTNESS|NO_FREQ, 0), 568 - SENS(initTas5110d, NULL, tas5110_sensor_init, NULL, NULL, 569 - F_GAIN|F_SIF|F_COARSE_EXPO, NO_BRIGHTNESS|NO_FREQ, 0), 570 - SENS(initTas5130, NULL, tas5130_sensor_init, NULL, NULL, 0, NO_EXPO|NO_FREQ, 571 - 0), 572 + SENS(initHv7131d, hv7131d_sensor_init, F_GAIN, NO_BRIGHTNESS|NO_FREQ, 0), 573 + SENS(initHv7131r, hv7131r_sensor_init, 0, NO_BRIGHTNESS|NO_EXPO|NO_FREQ, 0), 574 + SENS(initOv6650, ov6650_sensor_init, F_GAIN|F_SIF, 0, 0x60), 575 + SENS(initOv7630, ov7630_sensor_init, F_GAIN, 0, 0x21), 576 + SENS(initPas106, pas106_sensor_init, F_GAIN|F_SIF, NO_FREQ, 0), 577 + SENS(initPas202, pas202_sensor_init, F_GAIN, NO_FREQ, 0), 578 + SENS(initTas5110c, tas5110c_sensor_init, F_GAIN|F_SIF|F_COARSE_EXPO, 579 + NO_BRIGHTNESS|NO_FREQ, 0), 580 + SENS(initTas5110d, tas5110d_sensor_init, F_GAIN|F_SIF|F_COARSE_EXPO, 581 + NO_BRIGHTNESS|NO_FREQ, 0), 582 + SENS(initTas5130, tas5130_sensor_init, F_GAIN, 583 + NO_BRIGHTNESS|NO_EXPO|NO_FREQ, 0), 572 584 }; 573 585 574 586 /* get one byte in gspca_dev->usb_buf */ ··· 637 655 static void setbrightness(struct gspca_dev *gspca_dev) 638 656 { 639 657 struct sd *sd = (struct sd *) gspca_dev; 640 - __u8 value; 641 658 642 659 switch (sd->sensor) { 643 660 case SENSOR_OV6650: ··· 678 697 goto err; 679 698 break; 680 699 } 681 - case SENSOR_TAS5130CXX: { 682 - __u8 i2c[] = 683 - {0x30, 0x11, 0x02, 0x20, 0x70, 0x00, 0x00, 0x10}; 684 - 685 - value = 0xff - sd->brightness; 686 - i2c[4] = value; 687 - PDEBUG(D_CONF, "brightness %d : %d", value, i2c[4]); 688 - if (i2c_w(gspca_dev, i2c) < 0) 689 - goto err; 690 - break; 691 - } 692 700 } 693 701 return; 694 702 err: ··· 703 733 break; 704 734 } 705 735 case SENSOR_TAS5110C: 706 - case SENSOR_TAS5110D: { 736 + case SENSOR_TAS5130CXX: { 707 737 __u8 i2c[] = 708 738 {0x30, 0x11, 0x02, 0x20, 0x70, 0x00, 0x00, 0x10}; 709 739 710 740 i2c[4] = 255 - gain; 741 + if (i2c_w(gspca_dev, i2c) < 0) 742 + goto err; 743 + break; 744 + } 745 + case SENSOR_TAS5110D: { 746 + __u8 i2c[] = { 747 + 0xb0, 0x61, 0x02, 0x00, 0x10, 0x00, 0x00, 0x17 }; 748 + gain = 255 - gain; 749 + /* The bits in the register are the wrong way around!! */ 750 + i2c[3] |= (gain & 0x80) >> 7; 751 + i2c[3] |= (gain & 0x40) >> 5; 752 + i2c[3] |= (gain & 0x20) >> 3; 753 + i2c[3] |= (gain & 0x10) >> 1; 754 + i2c[3] |= (gain & 0x08) << 1; 755 + i2c[3] |= (gain & 0x04) << 3; 756 + i2c[3] |= (gain & 0x02) << 5; 757 + i2c[3] |= (gain & 0x01) << 7; 711 758 if (i2c_w(gspca_dev, i2c) < 0) 712 759 goto err; 713 760 break; ··· 783 796 { 784 797 struct sd *sd = (struct sd *) gspca_dev; 785 798 __u8 gain; 786 - __u8 buf[2] = { 0, 0 }; 799 + __u8 buf[3] = { 0, 0, 0 }; 787 800 788 801 if (sensor_data[sd->sensor].flags & F_GAIN) { 789 802 /* Use the sensor gain to do the actual gain */ ··· 791 804 return; 792 805 } 793 806 794 - gain = sd->gain >> 4; 795 - 796 - /* red and blue gain */ 797 - buf[0] = gain << 4 | gain; 798 - /* green gain */ 799 - buf[1] = gain; 800 - reg_w(gspca_dev, 0x10, buf, 2); 807 + if (sd->bridge == BRIDGE_103) { 808 + gain = sd->gain >> 1; 809 + buf[0] = gain; /* Red */ 810 + buf[1] = gain; /* Green */ 811 + buf[2] = gain; /* Blue */ 812 + reg_w(gspca_dev, 0x05, buf, 3); 813 + } else { 814 + gain = sd->gain >> 4; 815 + buf[0] = gain << 4 | gain; /* Red and blue */ 816 + buf[1] = gain; /* Green */ 817 + reg_w(gspca_dev, 0x10, buf, 2); 818 + } 801 819 } 802 820 803 821 static void setexposure(struct gspca_dev *gspca_dev) ··· 1041 1049 desired_avg_lum = 5000; 1042 1050 } else { 1043 1051 deadzone = 1500; 1044 - desired_avg_lum = 18000; 1052 + desired_avg_lum = 13000; 1045 1053 } 1046 1054 1047 1055 if (sensor_data[sd->sensor].flags & F_COARSE_EXPO) ··· 1119 1127 { 1120 1128 struct sd *sd = (struct sd *) gspca_dev; 1121 1129 struct cam *cam = &gspca_dev->cam; 1122 - int mode, l; 1123 - const __u8 *sn9c10x; 1124 - __u8 reg12_19[8]; 1130 + int i, mode; 1131 + __u8 regs[0x31]; 1125 1132 1126 1133 mode = cam->cam_mode[gspca_dev->curr_mode].priv & 0x07; 1127 - sn9c10x = sensor_data[sd->sensor].bridge_init[sd->bridge]; 1128 - l = sensor_data[sd->sensor].bridge_init_size[sd->bridge]; 1129 - memcpy(reg12_19, &sn9c10x[0x12 - 1], 8); 1130 - reg12_19[6] = sn9c10x[0x18 - 1] | (mode << 4); 1131 - /* Special cases where reg 17 and or 19 value depends on mode */ 1134 + /* Copy registers 0x01 - 0x19 from the template */ 1135 + memcpy(&regs[0x01], sensor_data[sd->sensor].bridge_init, 0x19); 1136 + /* Set the mode */ 1137 + regs[0x18] |= mode << 4; 1138 + 1139 + /* Set bridge gain to 1.0 */ 1140 + if (sd->bridge == BRIDGE_103) { 1141 + regs[0x05] = 0x20; /* Red */ 1142 + regs[0x06] = 0x20; /* Green */ 1143 + regs[0x07] = 0x20; /* Blue */ 1144 + } else { 1145 + regs[0x10] = 0x00; /* Red and blue */ 1146 + regs[0x11] = 0x00; /* Green */ 1147 + } 1148 + 1149 + /* Setup pixel numbers and auto exposure window */ 1150 + if (sensor_data[sd->sensor].flags & F_SIF) { 1151 + regs[0x1a] = 0x14; /* HO_SIZE 640, makes no sense */ 1152 + regs[0x1b] = 0x0a; /* VO_SIZE 320, makes no sense */ 1153 + regs[0x1c] = 0x02; /* AE H-start 64 */ 1154 + regs[0x1d] = 0x02; /* AE V-start 64 */ 1155 + regs[0x1e] = 0x09; /* AE H-end 288 */ 1156 + regs[0x1f] = 0x07; /* AE V-end 224 */ 1157 + } else { 1158 + regs[0x1a] = 0x1d; /* HO_SIZE 960, makes no sense */ 1159 + regs[0x1b] = 0x10; /* VO_SIZE 512, makes no sense */ 1160 + regs[0x1c] = 0x05; /* AE H-start 160 */ 1161 + regs[0x1d] = 0x03; /* AE V-start 96 */ 1162 + regs[0x1e] = 0x0f; /* AE H-end 480 */ 1163 + regs[0x1f] = 0x0c; /* AE V-end 384 */ 1164 + } 1165 + 1166 + /* Setup the gamma table (only used with the sn9c103 bridge) */ 1167 + for (i = 0; i < 16; i++) 1168 + regs[0x20 + i] = i * 16; 1169 + regs[0x20 + i] = 255; 1170 + 1171 + /* Special cases where some regs depend on mode or bridge */ 1132 1172 switch (sd->sensor) { 1133 1173 case SENSOR_TAS5130CXX: 1134 - /* probably not mode specific at all most likely the upper 1174 + /* FIXME / TESTME 1175 + probably not mode specific at all most likely the upper 1135 1176 nibble of 0x19 is exposure (clock divider) just as with 1136 1177 the tas5110, we need someone to test this. */ 1137 - reg12_19[7] = mode ? 0x23 : 0x43; 1178 + regs[0x19] = mode ? 0x23 : 0x43; 1138 1179 break; 1180 + case SENSOR_OV7630: 1181 + /* FIXME / TESTME for some reason with the 101/102 bridge the 1182 + clock is set to 12 Mhz (reg1 == 0x04), rather then 24. 1183 + Also the hstart needs to go from 1 to 2 when using a 103, 1184 + which is likely related. This does not seem right. */ 1185 + if (sd->bridge == BRIDGE_103) { 1186 + regs[0x01] = 0x44; /* Select 24 Mhz clock */ 1187 + regs[0x12] = 0x02; /* Set hstart to 2 */ 1188 + } 1139 1189 } 1140 1190 /* Disable compression when the raw bayer format has been selected */ 1141 1191 if (cam->cam_mode[gspca_dev->curr_mode].priv & MODE_RAW) 1142 - reg12_19[6] &= ~0x80; 1192 + regs[0x18] &= ~0x80; 1143 1193 1144 1194 /* Vga mode emulation on SIF sensor? */ 1145 1195 if (cam->cam_mode[gspca_dev->curr_mode].priv & MODE_REDUCED_SIF) { 1146 - reg12_19[0] += 16; /* 0x12: hstart adjust */ 1147 - reg12_19[1] += 24; /* 0x13: vstart adjust */ 1148 - reg12_19[3] = 320 / 16; /* 0x15: hsize */ 1149 - reg12_19[4] = 240 / 16; /* 0x16: vsize */ 1196 + regs[0x12] += 16; /* hstart adjust */ 1197 + regs[0x13] += 24; /* vstart adjust */ 1198 + regs[0x15] = 320 / 16; /* hsize */ 1199 + regs[0x16] = 240 / 16; /* vsize */ 1150 1200 } 1151 1201 1152 1202 /* reg 0x01 bit 2 video transfert on */ 1153 - reg_w(gspca_dev, 0x01, &sn9c10x[0x01 - 1], 1); 1203 + reg_w(gspca_dev, 0x01, &regs[0x01], 1); 1154 1204 /* reg 0x17 SensorClk enable inv Clk 0x60 */ 1155 - reg_w(gspca_dev, 0x17, &sn9c10x[0x17 - 1], 1); 1205 + reg_w(gspca_dev, 0x17, &regs[0x17], 1); 1156 1206 /* Set the registers from the template */ 1157 - reg_w(gspca_dev, 0x01, sn9c10x, l); 1207 + reg_w(gspca_dev, 0x01, &regs[0x01], 1208 + (sd->bridge == BRIDGE_103) ? 0x30 : 0x1f); 1158 1209 1159 1210 /* Init the sensor */ 1160 1211 i2c_w_vector(gspca_dev, sensor_data[sd->sensor].sensor_init, 1161 1212 sensor_data[sd->sensor].sensor_init_size); 1162 - if (sensor_data[sd->sensor].sensor_bridge_init[sd->bridge]) 1163 - i2c_w_vector(gspca_dev, 1164 - sensor_data[sd->sensor].sensor_bridge_init[sd->bridge], 1165 - sensor_data[sd->sensor].sensor_bridge_init_size[ 1166 - sd->bridge]); 1167 1213 1168 - /* Mode specific sensor setup */ 1214 + /* Mode / bridge specific sensor setup */ 1169 1215 switch (sd->sensor) { 1170 1216 case SENSOR_PAS202: { 1171 1217 const __u8 i2cpclockdiv[] = ··· 1211 1181 /* clockdiv from 4 to 3 (7.5 -> 10 fps) when in low res mode */ 1212 1182 if (mode) 1213 1183 i2c_w(gspca_dev, i2cpclockdiv); 1184 + break; 1214 1185 } 1186 + case SENSOR_OV7630: 1187 + /* FIXME / TESTME We should be able to handle this identical 1188 + for the 101/102 and the 103 case */ 1189 + if (sd->bridge == BRIDGE_103) { 1190 + const __u8 i2c[] = { 0xa0, 0x21, 0x13, 1191 + 0x80, 0x00, 0x00, 0x00, 0x10 }; 1192 + i2c_w(gspca_dev, i2c); 1193 + } 1194 + break; 1215 1195 } 1216 1196 /* H_size V_size 0x28, 0x1e -> 640x480. 0x16, 0x12 -> 352x288 */ 1217 - reg_w(gspca_dev, 0x15, &reg12_19[3], 2); 1197 + reg_w(gspca_dev, 0x15, &regs[0x15], 2); 1218 1198 /* compression register */ 1219 - reg_w(gspca_dev, 0x18, &reg12_19[6], 1); 1199 + reg_w(gspca_dev, 0x18, &regs[0x18], 1); 1220 1200 /* H_start */ 1221 - reg_w(gspca_dev, 0x12, &reg12_19[0], 1); 1201 + reg_w(gspca_dev, 0x12, &regs[0x12], 1); 1222 1202 /* V_START */ 1223 - reg_w(gspca_dev, 0x13, &reg12_19[1], 1); 1203 + reg_w(gspca_dev, 0x13, &regs[0x13], 1); 1224 1204 /* reset 0x17 SensorClk enable inv Clk 0x60 */ 1225 1205 /*fixme: ov7630 [17]=68 8f (+20 if 102)*/ 1226 - reg_w(gspca_dev, 0x17, &reg12_19[5], 1); 1206 + reg_w(gspca_dev, 0x17, &regs[0x17], 1); 1227 1207 /*MCKSIZE ->3 */ /*fixme: not ov7630*/ 1228 - reg_w(gspca_dev, 0x19, &reg12_19[7], 1); 1208 + reg_w(gspca_dev, 0x19, &regs[0x19], 1); 1229 1209 /* AE_STRX AE_STRY AE_ENDX AE_ENDY */ 1230 - reg_w(gspca_dev, 0x1c, &sn9c10x[0x1c - 1], 4); 1210 + reg_w(gspca_dev, 0x1c, &regs[0x1c], 4); 1231 1211 /* Enable video transfert */ 1232 - reg_w(gspca_dev, 0x01, &sn9c10x[0], 1); 1212 + reg_w(gspca_dev, 0x01, &regs[0x01], 1); 1233 1213 /* Compression */ 1234 - reg_w(gspca_dev, 0x18, &reg12_19[6], 2); 1214 + reg_w(gspca_dev, 0x18, &regs[0x18], 2); 1235 1215 msleep(20); 1236 1216 1237 1217 sd->reg11 = -1; ··· 1565 1525 .driver_info = (SENSOR_ ## sensor << 8) | BRIDGE_ ## bridge 1566 1526 1567 1527 1568 - static const struct usb_device_id device_table[] __devinitconst = { 1528 + static const struct usb_device_id device_table[] = { 1569 1529 {USB_DEVICE(0x0c45, 0x6001), SB(TAS5110C, 102)}, /* TAS5110C1B */ 1570 1530 {USB_DEVICE(0x0c45, 0x6005), SB(TAS5110C, 101)}, /* TAS5110C1B */ 1571 1531 {USB_DEVICE(0x0c45, 0x6007), SB(TAS5110D, 101)}, /* TAS5110D */ 1572 1532 {USB_DEVICE(0x0c45, 0x6009), SB(PAS106, 101)}, 1573 1533 {USB_DEVICE(0x0c45, 0x600d), SB(PAS106, 101)}, 1574 1534 {USB_DEVICE(0x0c45, 0x6011), SB(OV6650, 101)}, 1575 - #if !defined CONFIG_USB_SN9C102 && !defined CONFIG_USB_SN9C102_MODULE 1576 1535 {USB_DEVICE(0x0c45, 0x6019), SB(OV7630, 101)}, 1536 + #if !defined CONFIG_USB_SN9C102 && !defined CONFIG_USB_SN9C102_MODULE 1577 1537 {USB_DEVICE(0x0c45, 0x6024), SB(TAS5130CXX, 102)}, 1578 1538 {USB_DEVICE(0x0c45, 0x6025), SB(TAS5130CXX, 102)}, 1579 1539 #endif ··· 1584 1544 {USB_DEVICE(0x0c45, 0x602c), SB(OV7630, 102)}, 1585 1545 {USB_DEVICE(0x0c45, 0x602d), SB(HV7131R, 102)}, 1586 1546 {USB_DEVICE(0x0c45, 0x602e), SB(OV7630, 102)}, 1587 - /* {USB_DEVICE(0x0c45, 0x602b), SB(MI03XX, 102)}, */ /* MI0343 MI0360 MI0330 */ 1547 + /* {USB_DEVICE(0x0c45, 0x6030), SB(MI03XX, 102)}, */ /* MI0343 MI0360 MI0330 */ 1548 + /* {USB_DEVICE(0x0c45, 0x6082), SB(MI03XX, 103)}, */ /* MI0343 MI0360 */ 1549 + {USB_DEVICE(0x0c45, 0x6083), SB(HV7131D, 103)}, 1550 + {USB_DEVICE(0x0c45, 0x608c), SB(HV7131R, 103)}, 1551 + /* {USB_DEVICE(0x0c45, 0x608e), SB(CISVF10, 103)}, */ 1588 1552 {USB_DEVICE(0x0c45, 0x608f), SB(OV7630, 103)}, 1589 - #if !defined CONFIG_USB_SN9C102 && !defined CONFIG_USB_SN9C102_MODULE 1553 + {USB_DEVICE(0x0c45, 0x60a8), SB(PAS106, 103)}, 1554 + {USB_DEVICE(0x0c45, 0x60aa), SB(TAS5130CXX, 103)}, 1590 1555 {USB_DEVICE(0x0c45, 0x60af), SB(PAS202, 103)}, 1591 - #endif 1592 1556 {USB_DEVICE(0x0c45, 0x60b0), SB(OV7630, 103)}, 1593 1557 {} 1594 1558 }; 1595 1559 MODULE_DEVICE_TABLE(usb, device_table); 1596 1560 1597 1561 /* -- device connect -- */ 1598 - static int __devinit sd_probe(struct usb_interface *intf, 1562 + static int sd_probe(struct usb_interface *intf, 1599 1563 const struct usb_device_id *id) 1600 1564 { 1601 1565 return gspca_dev_probe(intf, id, &sd_desc, sizeof(struct sd),
+79 -78
drivers/media/video/gspca/sonixj.c
··· 25 25 #include "gspca.h" 26 26 #include "jpeg.h" 27 27 28 - #define V4L2_CID_INFRARED (V4L2_CID_PRIVATE_BASE + 0) 29 - 30 28 MODULE_AUTHOR("Jean-François Moine <http://moinejf.free.fr>"); 31 29 MODULE_DESCRIPTION("GSPCA/SONIX JPEG USB Camera Driver"); 32 30 MODULE_LICENSE("GPL"); 31 + 32 + static int starcam; 33 33 34 34 /* controls */ 35 35 enum e_ctrl { ··· 43 43 HFLIP, 44 44 VFLIP, 45 45 SHARPNESS, 46 - INFRARED, 46 + ILLUM, 47 47 FREQ, 48 48 NCTRLS /* number of controls */ 49 49 }; ··· 100 100 }; 101 101 102 102 /* device flags */ 103 - #define PDN_INV 1 /* inverse pin S_PWR_DN / sn_xxx tables */ 103 + #define F_PDN_INV 0x01 /* inverse pin S_PWR_DN / sn_xxx tables */ 104 + #define F_ILLUM 0x02 /* presence of illuminator */ 104 105 105 106 /* sn9c1xx definitions */ 106 107 /* register 0x01 */ ··· 125 124 static void setautogain(struct gspca_dev *gspca_dev); 126 125 static void sethvflip(struct gspca_dev *gspca_dev); 127 126 static void setsharpness(struct gspca_dev *gspca_dev); 128 - static void setinfrared(struct gspca_dev *gspca_dev); 127 + static void setillum(struct gspca_dev *gspca_dev); 129 128 static void setfreq(struct gspca_dev *gspca_dev); 130 129 131 130 static const struct ctrl sd_ctrls[NCTRLS] = { ··· 252 251 }, 253 252 .set_control = setsharpness 254 253 }, 255 - /* mt9v111 only */ 256 - [INFRARED] = { 254 + [ILLUM] = { 257 255 { 258 - .id = V4L2_CID_INFRARED, 256 + .id = V4L2_CID_ILLUMINATORS_1, 259 257 .type = V4L2_CTRL_TYPE_BOOLEAN, 260 - .name = "Infrared", 258 + .name = "Illuminator / infrared", 261 259 .minimum = 0, 262 260 .maximum = 1, 263 261 .step = 1, 264 262 .default_value = 0, 265 263 }, 266 - .set_control = setinfrared 264 + .set_control = setillum 267 265 }, 268 266 /* ov7630/ov7648/ov7660 only */ 269 267 [FREQ] = { ··· 282 282 /* table of the disabled controls */ 283 283 static const __u32 ctrl_dis[] = { 284 284 [SENSOR_ADCM1700] = (1 << AUTOGAIN) | 285 - (1 << INFRARED) | 286 285 (1 << HFLIP) | 287 286 (1 << VFLIP) | 288 287 (1 << FREQ), 289 288 290 - [SENSOR_GC0307] = (1 << INFRARED) | 291 - (1 << HFLIP) | 289 + [SENSOR_GC0307] = (1 << HFLIP) | 292 290 (1 << VFLIP) | 293 291 (1 << FREQ), 294 292 295 - [SENSOR_HV7131R] = (1 << INFRARED) | 296 - (1 << HFLIP) | 293 + [SENSOR_HV7131R] = (1 << HFLIP) | 297 294 (1 << FREQ), 298 295 299 - [SENSOR_MI0360] = (1 << INFRARED) | 300 - (1 << HFLIP) | 296 + [SENSOR_MI0360] = (1 << HFLIP) | 301 297 (1 << VFLIP) | 302 298 (1 << FREQ), 303 299 304 - [SENSOR_MI0360B] = (1 << INFRARED) | 305 - (1 << HFLIP) | 300 + [SENSOR_MI0360B] = (1 << HFLIP) | 306 301 (1 << VFLIP) | 307 302 (1 << FREQ), 308 303 309 - [SENSOR_MO4000] = (1 << INFRARED) | 310 - (1 << HFLIP) | 304 + [SENSOR_MO4000] = (1 << HFLIP) | 311 305 (1 << VFLIP) | 312 306 (1 << FREQ), 313 307 ··· 309 315 (1 << VFLIP) | 310 316 (1 << FREQ), 311 317 312 - [SENSOR_OM6802] = (1 << INFRARED) | 313 - (1 << HFLIP) | 318 + [SENSOR_OM6802] = (1 << HFLIP) | 314 319 (1 << VFLIP) | 315 320 (1 << FREQ), 316 321 317 - [SENSOR_OV7630] = (1 << INFRARED) | 318 - (1 << HFLIP), 322 + [SENSOR_OV7630] = (1 << HFLIP), 319 323 320 - [SENSOR_OV7648] = (1 << INFRARED) | 321 - (1 << HFLIP), 324 + [SENSOR_OV7648] = (1 << HFLIP), 322 325 323 326 [SENSOR_OV7660] = (1 << AUTOGAIN) | 324 - (1 << INFRARED) | 325 327 (1 << HFLIP) | 326 328 (1 << VFLIP), 327 329 328 330 [SENSOR_PO1030] = (1 << AUTOGAIN) | 329 - (1 << INFRARED) | 330 331 (1 << HFLIP) | 331 332 (1 << VFLIP) | 332 333 (1 << FREQ), 333 334 334 335 [SENSOR_PO2030N] = (1 << AUTOGAIN) | 335 - (1 << INFRARED) | 336 336 (1 << FREQ), 337 337 338 338 [SENSOR_SOI768] = (1 << AUTOGAIN) | 339 - (1 << INFRARED) | 340 339 (1 << HFLIP) | 341 340 (1 << VFLIP) | 342 341 (1 << FREQ), 343 342 344 343 [SENSOR_SP80708] = (1 << AUTOGAIN) | 345 - (1 << INFRARED) | 346 344 (1 << HFLIP) | 347 345 (1 << VFLIP) | 348 346 (1 << FREQ), ··· 1808 1822 PDEBUG(D_PROBE, "Sonix chip id: %02x", regF1); 1809 1823 switch (sd->bridge) { 1810 1824 case BRIDGE_SN9C102P: 1811 - if (regF1 != 0x11) 1812 - return -ENODEV; 1813 - reg_w1(gspca_dev, 0x02, regGpio[1]); 1814 - break; 1815 1825 case BRIDGE_SN9C105: 1816 1826 if (regF1 != 0x11) 1817 1827 return -ENODEV; 1818 - if (sd->sensor == SENSOR_MI0360) 1819 - mi0360_probe(gspca_dev); 1820 - reg_w(gspca_dev, 0x01, regGpio, 2); 1821 - break; 1822 - case BRIDGE_SN9C120: 1823 - if (regF1 != 0x12) 1824 - return -ENODEV; 1825 - switch (sd->sensor) { 1826 - case SENSOR_MI0360: 1827 - mi0360_probe(gspca_dev); 1828 - break; 1829 - case SENSOR_OV7630: 1830 - ov7630_probe(gspca_dev); 1831 - break; 1832 - case SENSOR_OV7648: 1833 - ov7648_probe(gspca_dev); 1834 - break; 1835 - case SENSOR_PO2030N: 1836 - po2030n_probe(gspca_dev); 1837 - break; 1838 - } 1839 - regGpio[1] = 0x70; /* no audio */ 1840 - reg_w(gspca_dev, 0x01, regGpio, 2); 1841 1828 break; 1842 1829 default: 1843 1830 /* case BRIDGE_SN9C110: */ 1844 - /* case BRIDGE_SN9C325: */ 1831 + /* case BRIDGE_SN9C120: */ 1845 1832 if (regF1 != 0x12) 1846 1833 return -ENODEV; 1834 + } 1835 + 1836 + switch (sd->sensor) { 1837 + case SENSOR_MI0360: 1838 + mi0360_probe(gspca_dev); 1839 + break; 1840 + case SENSOR_OV7630: 1841 + ov7630_probe(gspca_dev); 1842 + break; 1843 + case SENSOR_OV7648: 1844 + ov7648_probe(gspca_dev); 1845 + break; 1846 + case SENSOR_PO2030N: 1847 + po2030n_probe(gspca_dev); 1848 + break; 1849 + } 1850 + 1851 + switch (sd->bridge) { 1852 + case BRIDGE_SN9C102P: 1853 + reg_w1(gspca_dev, 0x02, regGpio[1]); 1854 + break; 1855 + case BRIDGE_SN9C105: 1856 + reg_w(gspca_dev, 0x01, regGpio, 2); 1857 + break; 1858 + case BRIDGE_SN9C110: 1847 1859 reg_w1(gspca_dev, 0x02, 0x62); 1860 + break; 1861 + case BRIDGE_SN9C120: 1862 + regGpio[1] = 0x70; /* no audio */ 1863 + reg_w(gspca_dev, 0x01, regGpio, 2); 1848 1864 break; 1849 1865 } 1850 1866 ··· 1862 1874 sd->i2c_addr = sn9c1xx[9]; 1863 1875 1864 1876 gspca_dev->ctrl_dis = ctrl_dis[sd->sensor]; 1877 + if (!(sd->flags & F_ILLUM)) 1878 + gspca_dev->ctrl_dis |= (1 << ILLUM); 1865 1879 1866 1880 return gspca_dev->usb_err; 1867 1881 } ··· 2187 2197 reg_w1(gspca_dev, 0x99, sd->ctrls[SHARPNESS].val); 2188 2198 } 2189 2199 2190 - static void setinfrared(struct gspca_dev *gspca_dev) 2200 + static void setillum(struct gspca_dev *gspca_dev) 2191 2201 { 2192 2202 struct sd *sd = (struct sd *) gspca_dev; 2193 2203 2194 - if (gspca_dev->ctrl_dis & (1 << INFRARED)) 2204 + if (gspca_dev->ctrl_dis & (1 << ILLUM)) 2195 2205 return; 2196 - /*fixme: different sequence for StarCam Clip and StarCam 370i */ 2197 - /* Clip */ 2198 - i2c_w1(gspca_dev, 0x02, /* gpio */ 2199 - sd->ctrls[INFRARED].val ? 0x66 : 0x64); 2206 + switch (sd->sensor) { 2207 + case SENSOR_ADCM1700: 2208 + reg_w1(gspca_dev, 0x02, /* gpio */ 2209 + sd->ctrls[ILLUM].val ? 0x64 : 0x60); 2210 + break; 2211 + case SENSOR_MT9V111: 2212 + if (starcam) 2213 + reg_w1(gspca_dev, 0x02, 2214 + sd->ctrls[ILLUM].val ? 2215 + 0x55 : 0x54); /* 370i */ 2216 + else 2217 + reg_w1(gspca_dev, 0x02, 2218 + sd->ctrls[ILLUM].val ? 2219 + 0x66 : 0x64); /* Clip */ 2220 + break; 2221 + } 2200 2222 } 2201 2223 2202 2224 static void setfreq(struct gspca_dev *gspca_dev) ··· 2346 2344 /* sensor clock already enabled in sd_init */ 2347 2345 /* reg_w1(gspca_dev, 0xf1, 0x00); */ 2348 2346 reg01 = sn9c1xx[1]; 2349 - if (sd->flags & PDN_INV) 2347 + if (sd->flags & F_PDN_INV) 2350 2348 reg01 ^= S_PDN_INV; /* power down inverted */ 2351 2349 reg_w1(gspca_dev, 0x01, reg01); 2352 2350 ··· 2909 2907 .driver_info = (BRIDGE_ ## bridge << 16) \ 2910 2908 | (SENSOR_ ## sensor << 8) \ 2911 2909 | (flags) 2912 - static const __devinitdata struct usb_device_id device_table[] = { 2913 - #if !defined CONFIG_USB_SN9C102 && !defined CONFIG_USB_SN9C102_MODULE 2910 + static const struct usb_device_id device_table[] = { 2914 2911 {USB_DEVICE(0x0458, 0x7025), BS(SN9C120, MI0360)}, 2915 2912 {USB_DEVICE(0x0458, 0x702e), BS(SN9C120, OV7660)}, 2916 - #endif 2917 - {USB_DEVICE(0x045e, 0x00f5), BSF(SN9C105, OV7660, PDN_INV)}, 2918 - {USB_DEVICE(0x045e, 0x00f7), BSF(SN9C105, OV7660, PDN_INV)}, 2913 + {USB_DEVICE(0x045e, 0x00f5), BSF(SN9C105, OV7660, F_PDN_INV)}, 2914 + {USB_DEVICE(0x045e, 0x00f7), BSF(SN9C105, OV7660, F_PDN_INV)}, 2919 2915 {USB_DEVICE(0x0471, 0x0327), BS(SN9C105, MI0360)}, 2920 2916 {USB_DEVICE(0x0471, 0x0328), BS(SN9C105, MI0360)}, 2921 2917 {USB_DEVICE(0x0471, 0x0330), BS(SN9C105, MI0360)}, ··· 2925 2925 /* {USB_DEVICE(0x0c45, 0x607b), BS(SN9C102P, OV7660)}, */ 2926 2926 {USB_DEVICE(0x0c45, 0x607c), BS(SN9C102P, HV7131R)}, 2927 2927 /* {USB_DEVICE(0x0c45, 0x607e), BS(SN9C102P, OV7630)}, */ 2928 - {USB_DEVICE(0x0c45, 0x60c0), BS(SN9C105, MI0360)}, 2928 + {USB_DEVICE(0x0c45, 0x60c0), BSF(SN9C105, MI0360, F_ILLUM)}, 2929 2929 /* or MT9V111 */ 2930 2930 /* {USB_DEVICE(0x0c45, 0x60c2), BS(SN9C105, P1030xC)}, */ 2931 2931 /* {USB_DEVICE(0x0c45, 0x60c8), BS(SN9C105, OM6802)}, */ ··· 2936 2936 /* {USB_DEVICE(0x0c45, 0x60fa), BS(SN9C105, OV7648)}, */ 2937 2937 /* {USB_DEVICE(0x0c45, 0x60f2), BS(SN9C105, OV7660)}, */ 2938 2938 {USB_DEVICE(0x0c45, 0x60fb), BS(SN9C105, OV7660)}, 2939 - #if !defined CONFIG_USB_SN9C102 && !defined CONFIG_USB_SN9C102_MODULE 2940 2939 {USB_DEVICE(0x0c45, 0x60fc), BS(SN9C105, HV7131R)}, 2941 2940 {USB_DEVICE(0x0c45, 0x60fe), BS(SN9C105, OV7630)}, 2942 - #endif 2943 2941 {USB_DEVICE(0x0c45, 0x6100), BS(SN9C120, MI0360)}, /*sn9c128*/ 2944 2942 {USB_DEVICE(0x0c45, 0x6102), BS(SN9C120, PO2030N)}, /* /GC0305*/ 2945 2943 /* {USB_DEVICE(0x0c45, 0x6108), BS(SN9C120, OM6802)}, */ ··· 2960 2962 /* {USB_DEVICE(0x0c45, 0x6132), BS(SN9C120, OV7670)}, */ 2961 2963 {USB_DEVICE(0x0c45, 0x6138), BS(SN9C120, MO4000)}, 2962 2964 {USB_DEVICE(0x0c45, 0x613a), BS(SN9C120, OV7648)}, 2963 - #if !defined CONFIG_USB_SN9C102 && !defined CONFIG_USB_SN9C102_MODULE 2964 2965 {USB_DEVICE(0x0c45, 0x613b), BS(SN9C120, OV7660)}, 2965 - #endif 2966 2966 {USB_DEVICE(0x0c45, 0x613c), BS(SN9C120, HV7131R)}, 2967 2967 {USB_DEVICE(0x0c45, 0x613e), BS(SN9C120, OV7630)}, 2968 2968 {USB_DEVICE(0x0c45, 0x6142), BS(SN9C120, PO2030N)}, /*sn9c120b*/ 2969 2969 /* or GC0305 / GC0307 */ 2970 2970 {USB_DEVICE(0x0c45, 0x6143), BS(SN9C120, SP80708)}, /*sn9c120b*/ 2971 2971 {USB_DEVICE(0x0c45, 0x6148), BS(SN9C120, OM6802)}, /*sn9c120b*/ 2972 - {USB_DEVICE(0x0c45, 0x614a), BS(SN9C120, ADCM1700)}, /*sn9c120b*/ 2972 + {USB_DEVICE(0x0c45, 0x614a), BSF(SN9C120, ADCM1700, F_ILLUM)}, 2973 + /* {USB_DEVICE(0x0c45, 0x614c), BS(SN9C120, GC0306)}, */ /*sn9c120b*/ 2973 2974 {} 2974 2975 }; 2975 2976 MODULE_DEVICE_TABLE(usb, device_table); ··· 3004 3007 3005 3008 module_init(sd_mod_init); 3006 3009 module_exit(sd_mod_exit); 3010 + 3011 + module_param(starcam, int, 0644); 3012 + MODULE_PARM_DESC(starcam, 3013 + "StarCam model. 0: Clip, 1: 370i");
+1 -1
drivers/media/video/gspca/spca1528.c
··· 555 555 }; 556 556 557 557 /* -- module initialisation -- */ 558 - static const __devinitdata struct usb_device_id device_table[] = { 558 + static const struct usb_device_id device_table[] = { 559 559 {USB_DEVICE(0x04fc, 0x1528)}, 560 560 {} 561 561 };
+1 -1
drivers/media/video/gspca/spca500.c
··· 1051 1051 }; 1052 1052 1053 1053 /* -- module initialisation -- */ 1054 - static const __devinitdata struct usb_device_id device_table[] = { 1054 + static const struct usb_device_id device_table[] = { 1055 1055 {USB_DEVICE(0x040a, 0x0300), .driver_info = KodakEZ200}, 1056 1056 {USB_DEVICE(0x041e, 0x400a), .driver_info = CreativePCCam300}, 1057 1057 {USB_DEVICE(0x046d, 0x0890), .driver_info = LogitechTraveler},
+1 -1
drivers/media/video/gspca/spca501.c
··· 2155 2155 }; 2156 2156 2157 2157 /* -- module initialisation -- */ 2158 - static const __devinitdata struct usb_device_id device_table[] = { 2158 + static const struct usb_device_id device_table[] = { 2159 2159 {USB_DEVICE(0x040a, 0x0002), .driver_info = KodakDVC325}, 2160 2160 {USB_DEVICE(0x0497, 0xc001), .driver_info = SmileIntlCamera}, 2161 2161 {USB_DEVICE(0x0506, 0x00df), .driver_info = ThreeComHomeConnectLite},
+1 -1
drivers/media/video/gspca/spca505.c
··· 786 786 }; 787 787 788 788 /* -- module initialisation -- */ 789 - static const __devinitdata struct usb_device_id device_table[] = { 789 + static const struct usb_device_id device_table[] = { 790 790 {USB_DEVICE(0x041e, 0x401d), .driver_info = Nxultra}, 791 791 {USB_DEVICE(0x0733, 0x0430), .driver_info = IntelPCCameraPro}, 792 792 /*fixme: may be UsbGrabberPV321 BRIDGE_SPCA506 SENSOR_SAA7113 */
+1 -1
drivers/media/video/gspca/spca508.c
··· 1509 1509 }; 1510 1510 1511 1511 /* -- module initialisation -- */ 1512 - static const __devinitdata struct usb_device_id device_table[] = { 1512 + static const struct usb_device_id device_table[] = { 1513 1513 {USB_DEVICE(0x0130, 0x0130), .driver_info = HamaUSBSightcam}, 1514 1514 {USB_DEVICE(0x041e, 0x4018), .driver_info = CreativeVista}, 1515 1515 {USB_DEVICE(0x0733, 0x0110), .driver_info = ViewQuestVQ110},
+1 -1
drivers/media/video/gspca/spca561.c
··· 1061 1061 }; 1062 1062 1063 1063 /* -- module initialisation -- */ 1064 - static const __devinitdata struct usb_device_id device_table[] = { 1064 + static const struct usb_device_id device_table[] = { 1065 1065 {USB_DEVICE(0x041e, 0x401a), .driver_info = Rev072A}, 1066 1066 {USB_DEVICE(0x041e, 0x403b), .driver_info = Rev012A}, 1067 1067 {USB_DEVICE(0x0458, 0x7004), .driver_info = Rev072A},
+1 -1
drivers/media/video/gspca/sq905.c
··· 396 396 } 397 397 398 398 /* Table of supported USB devices */ 399 - static const __devinitdata struct usb_device_id device_table[] = { 399 + static const struct usb_device_id device_table[] = { 400 400 {USB_DEVICE(0x2770, 0x9120)}, 401 401 {} 402 402 };
+1 -1
drivers/media/video/gspca/sq905c.c
··· 298 298 } 299 299 300 300 /* Table of supported USB devices */ 301 - static const __devinitdata struct usb_device_id device_table[] = { 301 + static const struct usb_device_id device_table[] = { 302 302 {USB_DEVICE(0x2770, 0x905c)}, 303 303 {USB_DEVICE(0x2770, 0x9050)}, 304 304 {USB_DEVICE(0x2770, 0x9051)},
+1 -1
drivers/media/video/gspca/sq930x.c
··· 1163 1163 #define ST(sensor, type) \ 1164 1164 .driver_info = (SENSOR_ ## sensor << 8) \ 1165 1165 | (type) 1166 - static const __devinitdata struct usb_device_id device_table[] = { 1166 + static const struct usb_device_id device_table[] = { 1167 1167 {USB_DEVICE(0x041e, 0x4038), ST(MI0360, 0)}, 1168 1168 {USB_DEVICE(0x041e, 0x403c), ST(LZ24BP, 0)}, 1169 1169 {USB_DEVICE(0x041e, 0x403d), ST(LZ24BP, 0)},
+1 -1
drivers/media/video/gspca/stk014.c
··· 495 495 }; 496 496 497 497 /* -- module initialisation -- */ 498 - static const __devinitdata struct usb_device_id device_table[] = { 498 + static const struct usb_device_id device_table[] = { 499 499 {USB_DEVICE(0x05e1, 0x0893)}, 500 500 {} 501 501 };
+1 -1
drivers/media/video/gspca/stv0680.c
··· 327 327 }; 328 328 329 329 /* -- module initialisation -- */ 330 - static const __devinitdata struct usb_device_id device_table[] = { 330 + static const struct usb_device_id device_table[] = { 331 331 {USB_DEVICE(0x0553, 0x0202)}, 332 332 {USB_DEVICE(0x041e, 0x4007)}, 333 333 {}
+1 -1
drivers/media/video/gspca/stv06xx/stv06xx.c
··· 564 564 565 565 566 566 /* -- module initialisation -- */ 567 - static const __devinitdata struct usb_device_id device_table[] = { 567 + static const struct usb_device_id device_table[] = { 568 568 /* QuickCam Express */ 569 569 {USB_DEVICE(0x046d, 0x0840), .driver_info = BRIDGE_STV600 }, 570 570 /* LEGO cam / QuickCam Web */
+1 -1
drivers/media/video/gspca/sunplus.c
··· 1162 1162 #define BS(bridge, subtype) \ 1163 1163 .driver_info = (BRIDGE_ ## bridge << 8) \ 1164 1164 | (subtype) 1165 - static const __devinitdata struct usb_device_id device_table[] = { 1165 + static const struct usb_device_id device_table[] = { 1166 1166 {USB_DEVICE(0x041e, 0x400b), BS(SPCA504C, 0)}, 1167 1167 {USB_DEVICE(0x041e, 0x4012), BS(SPCA504C, 0)}, 1168 1168 {USB_DEVICE(0x041e, 0x4013), BS(SPCA504C, 0)},
+1 -1
drivers/media/video/gspca/t613.c
··· 1416 1416 }; 1417 1417 1418 1418 /* -- module initialisation -- */ 1419 - static const __devinitdata struct usb_device_id device_table[] = { 1419 + static const struct usb_device_id device_table[] = { 1420 1420 {USB_DEVICE(0x17a1, 0x0128)}, 1421 1421 {} 1422 1422 };
+1 -1
drivers/media/video/gspca/tv8532.c
··· 388 388 }; 389 389 390 390 /* -- module initialisation -- */ 391 - static const __devinitdata struct usb_device_id device_table[] = { 391 + static const struct usb_device_id device_table[] = { 392 392 {USB_DEVICE(0x046d, 0x0920)}, 393 393 {USB_DEVICE(0x046d, 0x0921)}, 394 394 {USB_DEVICE(0x0545, 0x808b)},
+1 -1
drivers/media/video/gspca/vc032x.c
··· 4192 4192 #define BF(bridge, flags) \ 4193 4193 .driver_info = (BRIDGE_ ## bridge << 8) \ 4194 4194 | (flags) 4195 - static const __devinitdata struct usb_device_id device_table[] = { 4195 + static const struct usb_device_id device_table[] = { 4196 4196 {USB_DEVICE(0x041e, 0x405b), BF(VC0323, FL_VFLIP)}, 4197 4197 {USB_DEVICE(0x046d, 0x0892), BF(VC0321, 0)}, 4198 4198 {USB_DEVICE(0x046d, 0x0896), BF(VC0321, 0)},
+1 -1
drivers/media/video/gspca/zc3xx.c
··· 6909 6909 #endif 6910 6910 }; 6911 6911 6912 - static const __devinitdata struct usb_device_id device_table[] = { 6912 + static const struct usb_device_id device_table[] = { 6913 6913 {USB_DEVICE(0x041e, 0x041e)}, 6914 6914 {USB_DEVICE(0x041e, 0x4017)}, 6915 6915 {USB_DEVICE(0x041e, 0x401c), .driver_info = SENSOR_PAS106},
+1 -3
drivers/media/video/hdpvr/Makefile
··· 1 - hdpvr-objs := hdpvr-control.o hdpvr-core.o hdpvr-video.o 2 - 3 - hdpvr-$(CONFIG_I2C) += hdpvr-i2c.o 1 + hdpvr-objs := hdpvr-control.o hdpvr-core.o hdpvr-video.o hdpvr-i2c.o 4 2 5 3 obj-$(CONFIG_VIDEO_HDPVR) += hdpvr.o 6 4
+4 -6
drivers/media/video/hdpvr/hdpvr-core.c
··· 378 378 goto error; 379 379 } 380 380 381 - #ifdef CONFIG_I2C 382 - /* until i2c is working properly */ 383 - retval = 0; /* hdpvr_register_i2c_adapter(dev); */ 381 + #if defined(CONFIG_I2C) || defined(CONFIG_I2C_MODULE) 382 + retval = hdpvr_register_i2c_adapter(dev); 384 383 if (retval < 0) { 385 384 v4l2_err(&dev->v4l2_dev, "registering i2c adapter failed\n"); 386 385 goto error; 387 386 } 388 387 389 - /* until i2c is working properly */ 390 - retval = 0; /* hdpvr_register_i2c_ir(dev); */ 388 + retval = hdpvr_register_i2c_ir(dev); 391 389 if (retval < 0) 392 390 v4l2_err(&dev->v4l2_dev, "registering i2c IR devices failed\n"); 393 - #endif /* CONFIG_I2C */ 391 + #endif 394 392 395 393 /* let the user know what node this device is now attached to */ 396 394 v4l2_info(&dev->v4l2_dev, "device now attached to %s\n",
+70 -79
drivers/media/video/hdpvr/hdpvr-i2c.c
··· 13 13 * 14 14 */ 15 15 16 + #if defined(CONFIG_I2C) || defined(CONFIG_I2C_MODULE) 17 + 16 18 #include <linux/i2c.h> 17 19 #include <linux/slab.h> 18 20 ··· 30 28 #define Z8F0811_IR_TX_I2C_ADDR 0x70 31 29 #define Z8F0811_IR_RX_I2C_ADDR 0x71 32 30 33 - static const u8 ir_i2c_addrs[] = { 34 - Z8F0811_IR_TX_I2C_ADDR, 35 - Z8F0811_IR_RX_I2C_ADDR, 31 + 32 + static struct i2c_board_info hdpvr_i2c_board_info = { 33 + I2C_BOARD_INFO("ir_tx_z8f0811_hdpvr", Z8F0811_IR_TX_I2C_ADDR), 34 + I2C_BOARD_INFO("ir_rx_z8f0811_hdpvr", Z8F0811_IR_RX_I2C_ADDR), 36 35 }; 37 - 38 - static const char * const ir_devicenames[] = { 39 - "ir_tx_z8f0811_hdpvr", 40 - "ir_rx_z8f0811_hdpvr", 41 - }; 42 - 43 - static int hdpvr_new_i2c_ir(struct hdpvr_device *dev, struct i2c_adapter *adap, 44 - const char *type, u8 addr) 45 - { 46 - struct i2c_board_info info; 47 - struct IR_i2c_init_data *init_data = &dev->ir_i2c_init_data; 48 - unsigned short addr_list[2] = { addr, I2C_CLIENT_END }; 49 - 50 - memset(&info, 0, sizeof(struct i2c_board_info)); 51 - strlcpy(info.type, type, I2C_NAME_SIZE); 52 - 53 - /* Our default information for ir-kbd-i2c.c to use */ 54 - switch (addr) { 55 - case Z8F0811_IR_RX_I2C_ADDR: 56 - init_data->ir_codes = RC_MAP_HAUPPAUGE_NEW; 57 - init_data->internal_get_key_func = IR_KBD_GET_KEY_HAUP_XVR; 58 - init_data->type = RC_TYPE_RC5; 59 - init_data->name = "HD PVR"; 60 - info.platform_data = init_data; 61 - break; 62 - } 63 - 64 - return i2c_new_probed_device(adap, &info, addr_list, NULL) == NULL ? 65 - -1 : 0; 66 - } 67 36 68 37 int hdpvr_register_i2c_ir(struct hdpvr_device *dev) 69 38 { 70 - int i; 71 - int ret = 0; 39 + struct i2c_client *c; 40 + struct IR_i2c_init_data *init_data = &dev->ir_i2c_init_data; 72 41 73 - for (i = 0; i < ARRAY_SIZE(ir_i2c_addrs); i++) 74 - ret += hdpvr_new_i2c_ir(dev, dev->i2c_adapter, 75 - ir_devicenames[i], ir_i2c_addrs[i]); 42 + /* Our default information for ir-kbd-i2c.c to use */ 43 + init_data->ir_codes = RC_MAP_HAUPPAUGE_NEW; 44 + init_data->internal_get_key_func = IR_KBD_GET_KEY_HAUP_XVR; 45 + init_data->type = RC_TYPE_RC5; 46 + init_data->name = "HD PVR"; 47 + hdpvr_i2c_board_info.platform_data = init_data; 76 48 77 - return ret; 49 + c = i2c_new_device(&dev->i2c_adapter, &hdpvr_i2c_board_info); 50 + 51 + return (c == NULL) ? -ENODEV : 0; 78 52 } 79 53 80 - static int hdpvr_i2c_read(struct hdpvr_device *dev, unsigned char addr, 81 - char *data, int len) 54 + static int hdpvr_i2c_read(struct hdpvr_device *dev, int bus, 55 + unsigned char addr, char *data, int len) 82 56 { 83 57 int ret; 84 - char *buf = kmalloc(len, GFP_KERNEL); 85 - if (!buf) 86 - return -ENOMEM; 58 + 59 + if (len > sizeof(dev->i2c_buf)) 60 + return -EINVAL; 87 61 88 62 ret = usb_control_msg(dev->udev, 89 63 usb_rcvctrlpipe(dev->udev, 0), 90 64 REQTYPE_I2C_READ, CTRL_READ_REQUEST, 91 - 0x100|addr, 0, buf, len, 1000); 65 + (bus << 8) | addr, 0, &dev->i2c_buf, len, 1000); 92 66 93 67 if (ret == len) { 94 - memcpy(data, buf, len); 68 + memcpy(data, &dev->i2c_buf, len); 95 69 ret = 0; 96 70 } else if (ret >= 0) 97 71 ret = -EIO; 98 72 99 - kfree(buf); 100 - 101 73 return ret; 102 74 } 103 75 104 - static int hdpvr_i2c_write(struct hdpvr_device *dev, unsigned char addr, 105 - char *data, int len) 76 + static int hdpvr_i2c_write(struct hdpvr_device *dev, int bus, 77 + unsigned char addr, char *data, int len) 106 78 { 107 79 int ret; 108 - char *buf = kmalloc(len, GFP_KERNEL); 109 - if (!buf) 110 - return -ENOMEM; 111 80 112 - memcpy(buf, data, len); 81 + if (len > sizeof(dev->i2c_buf)) 82 + return -EINVAL; 83 + 84 + memcpy(&dev->i2c_buf, data, len); 113 85 ret = usb_control_msg(dev->udev, 114 86 usb_sndctrlpipe(dev->udev, 0), 115 87 REQTYPE_I2C_WRITE, CTRL_WRITE_REQUEST, 116 - 0x100|addr, 0, buf, len, 1000); 88 + (bus << 8) | addr, 0, &dev->i2c_buf, len, 1000); 117 89 118 90 if (ret < 0) 119 - goto error; 91 + return ret; 120 92 121 93 ret = usb_control_msg(dev->udev, 122 94 usb_rcvctrlpipe(dev->udev, 0), 123 95 REQTYPE_I2C_WRITE_STATT, CTRL_READ_REQUEST, 124 - 0, 0, buf, 2, 1000); 96 + 0, 0, &dev->i2c_buf, 2, 1000); 125 97 126 - if (ret == 2) 98 + if ((ret == 2) && (dev->i2c_buf[1] == (len - 1))) 127 99 ret = 0; 128 100 else if (ret >= 0) 129 101 ret = -EIO; 130 102 131 - error: 132 - kfree(buf); 133 103 return ret; 134 104 } 135 105 ··· 120 146 addr = msgs[i].addr << 1; 121 147 122 148 if (msgs[i].flags & I2C_M_RD) 123 - retval = hdpvr_i2c_read(dev, addr, msgs[i].buf, 149 + retval = hdpvr_i2c_read(dev, 1, addr, msgs[i].buf, 124 150 msgs[i].len); 125 151 else 126 - retval = hdpvr_i2c_write(dev, addr, msgs[i].buf, 152 + retval = hdpvr_i2c_write(dev, 1, addr, msgs[i].buf, 127 153 msgs[i].len); 128 154 } 129 155 ··· 142 168 .functionality = hdpvr_functionality, 143 169 }; 144 170 171 + static struct i2c_adapter hdpvr_i2c_adapter_template = { 172 + .name = "Hauppage HD PVR I2C", 173 + .owner = THIS_MODULE, 174 + .algo = &hdpvr_algo, 175 + }; 176 + 177 + static int hdpvr_activate_ir(struct hdpvr_device *dev) 178 + { 179 + char buffer[8]; 180 + 181 + mutex_lock(&dev->i2c_mutex); 182 + 183 + hdpvr_i2c_read(dev, 0, 0x54, buffer, 1); 184 + 185 + buffer[0] = 0; 186 + buffer[1] = 0x8; 187 + hdpvr_i2c_write(dev, 1, 0x54, buffer, 2); 188 + 189 + buffer[1] = 0x18; 190 + hdpvr_i2c_write(dev, 1, 0x54, buffer, 2); 191 + 192 + mutex_unlock(&dev->i2c_mutex); 193 + 194 + return 0; 195 + } 196 + 145 197 int hdpvr_register_i2c_adapter(struct hdpvr_device *dev) 146 198 { 147 - struct i2c_adapter *i2c_adap; 148 199 int retval = -ENOMEM; 149 200 150 - i2c_adap = kzalloc(sizeof(struct i2c_adapter), GFP_KERNEL); 151 - if (i2c_adap == NULL) 152 - goto error; 201 + hdpvr_activate_ir(dev); 153 202 154 - strlcpy(i2c_adap->name, "Hauppauge HD PVR I2C", 155 - sizeof(i2c_adap->name)); 156 - i2c_adap->algo = &hdpvr_algo; 157 - i2c_adap->owner = THIS_MODULE; 158 - i2c_adap->dev.parent = &dev->udev->dev; 203 + memcpy(&dev->i2c_adapter, &hdpvr_i2c_adapter_template, 204 + sizeof(struct i2c_adapter)); 205 + dev->i2c_adapter.dev.parent = &dev->udev->dev; 159 206 160 - i2c_set_adapdata(i2c_adap, dev); 207 + i2c_set_adapdata(&dev->i2c_adapter, dev); 161 208 162 - retval = i2c_add_adapter(i2c_adap); 209 + retval = i2c_add_adapter(&dev->i2c_adapter); 163 210 164 - if (!retval) 165 - dev->i2c_adapter = i2c_adap; 166 - else 167 - kfree(i2c_adap); 168 - 169 - error: 170 211 return retval; 171 212 } 213 + 214 + #endif
+2 -5
drivers/media/video/hdpvr/hdpvr-video.c
··· 1220 1220 v4l2_device_unregister(&dev->v4l2_dev); 1221 1221 1222 1222 /* deregister I2C adapter */ 1223 - #ifdef CONFIG_I2C 1223 + #if defined(CONFIG_I2C) || (CONFIG_I2C_MODULE) 1224 1224 mutex_lock(&dev->i2c_mutex); 1225 - if (dev->i2c_adapter) 1226 - i2c_del_adapter(dev->i2c_adapter); 1227 - kfree(dev->i2c_adapter); 1228 - dev->i2c_adapter = NULL; 1225 + i2c_del_adapter(&dev->i2c_adapter); 1229 1226 mutex_unlock(&dev->i2c_mutex); 1230 1227 #endif /* CONFIG_I2C */ 1231 1228
+4 -1
drivers/media/video/hdpvr/hdpvr.h
··· 25 25 KERNEL_VERSION(HDPVR_MAJOR_VERSION, HDPVR_MINOR_VERSION, HDPVR_RELEASE) 26 26 27 27 #define HDPVR_MAX 8 28 + #define HDPVR_I2C_MAX_SIZE 128 28 29 29 30 /* Define these values to match your devices */ 30 31 #define HD_PVR_VENDOR_ID 0x2040 ··· 107 106 struct work_struct worker; 108 107 109 108 /* I2C adapter */ 110 - struct i2c_adapter *i2c_adapter; 109 + struct i2c_adapter i2c_adapter; 111 110 /* I2C lock */ 112 111 struct mutex i2c_mutex; 112 + /* I2C message buffer space */ 113 + char i2c_buf[HDPVR_I2C_MAX_SIZE]; 113 114 114 115 /* For passing data to ir-kbd-i2c */ 115 116 struct IR_i2c_init_data ir_i2c_init_data;
+10 -2
drivers/media/video/ir-kbd-i2c.c
··· 244 244 static u32 ir_key, ir_raw; 245 245 int rc; 246 246 247 - dprintk(2,"ir_poll_key\n"); 247 + dprintk(3, "%s\n", __func__); 248 248 rc = ir->get_key(ir, &ir_key, &ir_raw); 249 249 if (rc < 0) { 250 250 dprintk(2,"error\n"); 251 251 return; 252 252 } 253 253 254 - if (rc) 254 + if (rc) { 255 + dprintk(1, "%s: keycode = 0x%04x\n", __func__, ir_key); 255 256 rc_keydown(ir->rc, ir_key, 0); 257 + } 256 258 } 257 259 258 260 static void ir_work(struct work_struct *work) ··· 322 320 ir->get_key = get_key_avermedia_cardbus; 323 321 rc_type = RC_TYPE_OTHER; 324 322 ir_codes = RC_MAP_AVERMEDIA_CARDBUS; 323 + break; 324 + case 0x71: 325 + name = "Hauppauge/Zilog Z8"; 326 + ir->get_key = get_key_haup_xvr; 327 + rc_type = RC_TYPE_RC5; 328 + ir_codes = hauppauge ? RC_MAP_HAUPPAUGE_NEW : RC_MAP_RC5_TV; 325 329 break; 326 330 } 327 331
+7 -2
drivers/media/video/ivtv/ivtv-i2c.c
··· 300 300 adap, type, 0, I2C_ADDRS(hw_addrs[idx])); 301 301 } else if (hw == IVTV_HW_CX25840) { 302 302 struct cx25840_platform_data pdata; 303 + struct i2c_board_info cx25840_info = { 304 + .type = "cx25840", 305 + .addr = hw_addrs[idx], 306 + .platform_data = &pdata, 307 + }; 303 308 304 309 pdata.pvr150_workaround = itv->pvr150_workaround; 305 - sd = v4l2_i2c_new_subdev_cfg(&itv->v4l2_dev, 306 - adap, type, 0, &pdata, hw_addrs[idx], NULL); 310 + sd = v4l2_i2c_new_subdev_board(&itv->v4l2_dev, adap, 311 + &cx25840_info, NULL); 307 312 } else { 308 313 sd = v4l2_i2c_new_subdev(&itv->v4l2_dev, 309 314 adap, type, hw_addrs[idx], NULL);
+34 -20
drivers/media/video/mt9v011.c
··· 12 12 #include <asm/div64.h> 13 13 #include <media/v4l2-device.h> 14 14 #include <media/v4l2-chip-ident.h> 15 - #include "mt9v011.h" 15 + #include <media/mt9v011.h> 16 16 17 17 MODULE_DESCRIPTION("Micron mt9v011 sensor driver"); 18 18 MODULE_AUTHOR("Mauro Carvalho Chehab <mchehab@redhat.com>"); 19 19 MODULE_LICENSE("GPL"); 20 20 21 - 22 21 static int debug; 23 22 module_param(debug, int, 0); 24 23 MODULE_PARM_DESC(debug, "Debug level (0-2)"); 24 + 25 + #define R00_MT9V011_CHIP_VERSION 0x00 26 + #define R01_MT9V011_ROWSTART 0x01 27 + #define R02_MT9V011_COLSTART 0x02 28 + #define R03_MT9V011_HEIGHT 0x03 29 + #define R04_MT9V011_WIDTH 0x04 30 + #define R05_MT9V011_HBLANK 0x05 31 + #define R06_MT9V011_VBLANK 0x06 32 + #define R07_MT9V011_OUT_CTRL 0x07 33 + #define R09_MT9V011_SHUTTER_WIDTH 0x09 34 + #define R0A_MT9V011_CLK_SPEED 0x0a 35 + #define R0B_MT9V011_RESTART 0x0b 36 + #define R0C_MT9V011_SHUTTER_DELAY 0x0c 37 + #define R0D_MT9V011_RESET 0x0d 38 + #define R1E_MT9V011_DIGITAL_ZOOM 0x1e 39 + #define R20_MT9V011_READ_MODE 0x20 40 + #define R2B_MT9V011_GREEN_1_GAIN 0x2b 41 + #define R2C_MT9V011_BLUE_GAIN 0x2c 42 + #define R2D_MT9V011_RED_GAIN 0x2d 43 + #define R2E_MT9V011_GREEN_2_GAIN 0x2e 44 + #define R35_MT9V011_GLOBAL_GAIN 0x35 45 + #define RF1_MT9V011_CHIP_ENABLE 0xf1 46 + 47 + #define MT9V011_VERSION 0x8232 48 + #define MT9V011_REV_B_VERSION 0x8243 25 49 26 50 /* supported controls */ 27 51 static struct v4l2_queryctrl mt9v011_qctrl[] = { ··· 493 469 return 0; 494 470 } 495 471 496 - static int mt9v011_s_config(struct v4l2_subdev *sd, int dumb, void *data) 497 - { 498 - struct mt9v011 *core = to_mt9v011(sd); 499 - unsigned *xtal = data; 500 - 501 - v4l2_dbg(1, debug, sd, "s_config called\n"); 502 - 503 - if (xtal) { 504 - core->xtal = *xtal; 505 - v4l2_dbg(1, debug, sd, "xtal set to %d.%03d MHz\n", 506 - *xtal / 1000000, (*xtal / 1000) % 1000); 507 - } 508 - 509 - return 0; 510 - } 511 - 512 - 513 472 #ifdef CONFIG_VIDEO_ADV_DEBUG 514 473 static int mt9v011_g_register(struct v4l2_subdev *sd, 515 474 struct v4l2_dbg_register *reg) ··· 543 536 .g_ctrl = mt9v011_g_ctrl, 544 537 .s_ctrl = mt9v011_s_ctrl, 545 538 .reset = mt9v011_reset, 546 - .s_config = mt9v011_s_config, 547 539 .g_chip_ident = mt9v011_g_chip_ident, 548 540 #ifdef CONFIG_VIDEO_ADV_DEBUG 549 541 .g_register = mt9v011_g_register, ··· 601 595 core->width = 640; 602 596 core->height = 480; 603 597 core->xtal = 27000000; /* Hz */ 598 + 599 + if (c->dev.platform_data) { 600 + struct mt9v011_platform_data *pdata = c->dev.platform_data; 601 + 602 + core->xtal = pdata->xtal; 603 + v4l2_dbg(1, debug, sd, "xtal set to %d.%03d MHz\n", 604 + core->xtal / 1000000, (core->xtal / 1000) % 1000); 605 + } 604 606 605 607 v4l_info(c, "chip found @ 0x%02x (%s - chip version 0x%04x)\n", 606 608 c->addr << 1, c->adapter->name, version);
-36
drivers/media/video/mt9v011.h
··· 1 - /* 2 - * mt9v011 -Micron 1/4-Inch VGA Digital Image Sensor 3 - * 4 - * Copyright (c) 2009 Mauro Carvalho Chehab (mchehab@redhat.com) 5 - * This code is placed under the terms of the GNU General Public License v2 6 - */ 7 - 8 - #ifndef MT9V011_H_ 9 - #define MT9V011_H_ 10 - 11 - #define R00_MT9V011_CHIP_VERSION 0x00 12 - #define R01_MT9V011_ROWSTART 0x01 13 - #define R02_MT9V011_COLSTART 0x02 14 - #define R03_MT9V011_HEIGHT 0x03 15 - #define R04_MT9V011_WIDTH 0x04 16 - #define R05_MT9V011_HBLANK 0x05 17 - #define R06_MT9V011_VBLANK 0x06 18 - #define R07_MT9V011_OUT_CTRL 0x07 19 - #define R09_MT9V011_SHUTTER_WIDTH 0x09 20 - #define R0A_MT9V011_CLK_SPEED 0x0a 21 - #define R0B_MT9V011_RESTART 0x0b 22 - #define R0C_MT9V011_SHUTTER_DELAY 0x0c 23 - #define R0D_MT9V011_RESET 0x0d 24 - #define R1E_MT9V011_DIGITAL_ZOOM 0x1e 25 - #define R20_MT9V011_READ_MODE 0x20 26 - #define R2B_MT9V011_GREEN_1_GAIN 0x2b 27 - #define R2C_MT9V011_BLUE_GAIN 0x2c 28 - #define R2D_MT9V011_RED_GAIN 0x2d 29 - #define R2E_MT9V011_GREEN_2_GAIN 0x2e 30 - #define R35_MT9V011_GLOBAL_GAIN 0x35 31 - #define RF1_MT9V011_CHIP_ENABLE 0xf1 32 - 33 - #define MT9V011_VERSION 0x8232 34 - #define MT9V011_REV_B_VERSION 0x8243 35 - 36 - #endif
+32 -42
drivers/media/video/ov7670.c
··· 1449 1449 return v4l2_chip_ident_i2c_client(client, chip, V4L2_IDENT_OV7670, 0); 1450 1450 } 1451 1451 1452 - static int ov7670_s_config(struct v4l2_subdev *sd, int dumb, void *data) 1453 - { 1454 - struct i2c_client *client = v4l2_get_subdevdata(sd); 1455 - struct ov7670_config *config = data; 1456 - struct ov7670_info *info = to_state(sd); 1457 - int ret; 1458 - 1459 - info->clock_speed = 30; /* default: a guess */ 1460 - 1461 - /* 1462 - * Must apply configuration before initializing device, because it 1463 - * selects I/O method. 1464 - */ 1465 - if (config) { 1466 - info->min_width = config->min_width; 1467 - info->min_height = config->min_height; 1468 - info->use_smbus = config->use_smbus; 1469 - 1470 - if (config->clock_speed) 1471 - info->clock_speed = config->clock_speed; 1472 - } 1473 - 1474 - /* Make sure it's an ov7670 */ 1475 - ret = ov7670_detect(sd); 1476 - if (ret) { 1477 - v4l_dbg(1, debug, client, 1478 - "chip found @ 0x%x (%s) is not an ov7670 chip.\n", 1479 - client->addr << 1, client->adapter->name); 1480 - kfree(info); 1481 - return ret; 1482 - } 1483 - v4l_info(client, "chip found @ 0x%02x (%s)\n", 1484 - client->addr << 1, client->adapter->name); 1485 - 1486 - info->fmt = &ov7670_formats[0]; 1487 - info->sat = 128; /* Review this */ 1488 - info->clkrc = info->clock_speed / 30; 1489 - 1490 - return 0; 1491 - } 1492 - 1493 1452 #ifdef CONFIG_VIDEO_ADV_DEBUG 1494 1453 static int ov7670_g_register(struct v4l2_subdev *sd, struct v4l2_dbg_register *reg) 1495 1454 { ··· 1487 1528 .s_ctrl = ov7670_s_ctrl, 1488 1529 .queryctrl = ov7670_queryctrl, 1489 1530 .reset = ov7670_reset, 1490 - .s_config = ov7670_s_config, 1491 1531 .init = ov7670_init, 1492 1532 #ifdef CONFIG_VIDEO_ADV_DEBUG 1493 1533 .g_register = ov7670_g_register, ··· 1516 1558 { 1517 1559 struct v4l2_subdev *sd; 1518 1560 struct ov7670_info *info; 1561 + int ret; 1519 1562 1520 1563 info = kzalloc(sizeof(struct ov7670_info), GFP_KERNEL); 1521 1564 if (info == NULL) ··· 1524 1565 sd = &info->sd; 1525 1566 v4l2_i2c_subdev_init(sd, client, &ov7670_ops); 1526 1567 1568 + info->clock_speed = 30; /* default: a guess */ 1569 + if (client->dev.platform_data) { 1570 + struct ov7670_config *config = client->dev.platform_data; 1571 + 1572 + /* 1573 + * Must apply configuration before initializing device, because it 1574 + * selects I/O method. 1575 + */ 1576 + info->min_width = config->min_width; 1577 + info->min_height = config->min_height; 1578 + info->use_smbus = config->use_smbus; 1579 + 1580 + if (config->clock_speed) 1581 + info->clock_speed = config->clock_speed; 1582 + } 1583 + 1584 + /* Make sure it's an ov7670 */ 1585 + ret = ov7670_detect(sd); 1586 + if (ret) { 1587 + v4l_dbg(1, debug, client, 1588 + "chip found @ 0x%x (%s) is not an ov7670 chip.\n", 1589 + client->addr << 1, client->adapter->name); 1590 + kfree(info); 1591 + return ret; 1592 + } 1593 + v4l_info(client, "chip found @ 0x%02x (%s)\n", 1594 + client->addr << 1, client->adapter->name); 1595 + 1596 + info->fmt = &ov7670_formats[0]; 1597 + info->sat = 128; /* Review this */ 1598 + info->clkrc = info->clock_speed / 30; 1527 1599 return 0; 1528 1600 } 1529 1601
+2
drivers/media/video/pvrusb2/pvrusb2-hdw-internal.h
··· 40 40 #include "pvrusb2-io.h" 41 41 #include <media/v4l2-device.h> 42 42 #include <media/cx2341x.h> 43 + #include <media/ir-kbd-i2c.h> 43 44 #include "pvrusb2-devattr.h" 44 45 45 46 /* Legal values for PVR2_CID_HSM */ ··· 203 202 204 203 /* IR related */ 205 204 unsigned int ir_scheme_active; /* IR scheme as seen from the outside */ 205 + struct IR_i2c_init_data ir_init_data; /* params passed to IR modules */ 206 206 207 207 /* Frequency table */ 208 208 unsigned int freqTable[FREQTABLE_SIZE];
+43 -19
drivers/media/video/pvrusb2/pvrusb2-i2c-core.c
··· 19 19 */ 20 20 21 21 #include <linux/i2c.h> 22 + #include <media/ir-kbd-i2c.h> 22 23 #include "pvrusb2-i2c-core.h" 23 24 #include "pvrusb2-hdw-internal.h" 24 25 #include "pvrusb2-debug.h" ··· 48 47 int, S_IRUGO|S_IWUSR); 49 48 MODULE_PARM_DESC(disable_autoload_ir_video, 50 49 "1=do not try to autoload ir_video IR receiver"); 51 - 52 - /* Mapping of IR schemes to known I2C addresses - if any */ 53 - static const unsigned char ir_video_addresses[] = { 54 - [PVR2_IR_SCHEME_ZILOG] = 0x71, 55 - [PVR2_IR_SCHEME_29XXX] = 0x18, 56 - [PVR2_IR_SCHEME_24XXX] = 0x18, 57 - }; 58 50 59 51 static int pvr2_i2c_write(struct pvr2_hdw *hdw, /* Context */ 60 52 u8 i2c_addr, /* I2C address we're talking to */ ··· 568 574 static void pvr2_i2c_register_ir(struct pvr2_hdw *hdw) 569 575 { 570 576 struct i2c_board_info info; 571 - unsigned char addr = 0; 577 + struct IR_i2c_init_data *init_data = &hdw->ir_init_data; 572 578 if (pvr2_disable_ir_video) { 573 579 pvr2_trace(PVR2_TRACE_INFO, 574 580 "Automatic binding of ir_video has been disabled."); 575 581 return; 576 582 } 577 - if (hdw->ir_scheme_active < ARRAY_SIZE(ir_video_addresses)) { 578 - addr = ir_video_addresses[hdw->ir_scheme_active]; 579 - } 580 - if (!addr) { 583 + memset(&info, 0, sizeof(struct i2c_board_info)); 584 + switch (hdw->ir_scheme_active) { 585 + case PVR2_IR_SCHEME_24XXX: /* FX2-controlled IR */ 586 + case PVR2_IR_SCHEME_29XXX: /* Original 29xxx device */ 587 + init_data->ir_codes = RC_MAP_HAUPPAUGE_NEW; 588 + init_data->internal_get_key_func = IR_KBD_GET_KEY_HAUP; 589 + init_data->type = RC_TYPE_RC5; 590 + init_data->name = hdw->hdw_desc->description; 591 + init_data->polling_interval = 100; /* ms From ir-kbd-i2c */ 592 + /* IR Receiver */ 593 + info.addr = 0x18; 594 + info.platform_data = init_data; 595 + strlcpy(info.type, "ir_video", I2C_NAME_SIZE); 596 + pvr2_trace(PVR2_TRACE_INFO, "Binding %s to i2c address 0x%02x.", 597 + info.type, info.addr); 598 + i2c_new_device(&hdw->i2c_adap, &info); 599 + break; 600 + case PVR2_IR_SCHEME_ZILOG: /* HVR-1950 style */ 601 + case PVR2_IR_SCHEME_24XXX_MCE: /* 24xxx MCE device */ 602 + init_data->ir_codes = RC_MAP_HAUPPAUGE_NEW; 603 + init_data->internal_get_key_func = IR_KBD_GET_KEY_HAUP_XVR; 604 + init_data->type = RC_TYPE_RC5; 605 + init_data->name = hdw->hdw_desc->description; 606 + init_data->polling_interval = 260; /* ms From lirc_zilog */ 607 + /* IR Receiver */ 608 + info.addr = 0x71; 609 + info.platform_data = init_data; 610 + strlcpy(info.type, "ir_rx_z8f0811_haup", I2C_NAME_SIZE); 611 + pvr2_trace(PVR2_TRACE_INFO, "Binding %s to i2c address 0x%02x.", 612 + info.type, info.addr); 613 + i2c_new_device(&hdw->i2c_adap, &info); 614 + /* IR Trasmitter */ 615 + info.addr = 0x70; 616 + info.platform_data = init_data; 617 + strlcpy(info.type, "ir_tx_z8f0811_haup", I2C_NAME_SIZE); 618 + pvr2_trace(PVR2_TRACE_INFO, "Binding %s to i2c address 0x%02x.", 619 + info.type, info.addr); 620 + i2c_new_device(&hdw->i2c_adap, &info); 621 + break; 622 + default: 581 623 /* The device either doesn't support I2C-based IR or we 582 624 don't know (yet) how to operate IR on the device. */ 583 - return; 625 + break; 584 626 } 585 - pvr2_trace(PVR2_TRACE_INFO, 586 - "Binding ir_video to i2c address 0x%02x.", addr); 587 - memset(&info, 0, sizeof(struct i2c_board_info)); 588 - strlcpy(info.type, "ir_video", I2C_NAME_SIZE); 589 - info.addr = addr; 590 - i2c_new_device(&hdw->i2c_adap, &info); 591 627 } 592 628 593 629 void pvr2_i2c_core_init(struct pvr2_hdw *hdw)
+12 -39
drivers/media/video/saa7134/saa7134-cards.c
··· 5179 5179 [SAA7134_BOARD_KWORLD_PCI_SBTVD_FULLSEG] = { 5180 5180 .name = "Kworld PCI SBTVD/ISDB-T Full-Seg Hybrid", 5181 5181 .audio_clock = 0x00187de7, 5182 - #if 0 5183 - /* 5184 - * FIXME: Analog mode doesn't work, if digital is enabled. The proper 5185 - * fix is to use tda8290 driver, but Kworld seems to use an 5186 - * unsupported version of tda8295. 5187 - */ 5188 - .tuner_type = TUNER_NXP_TDA18271, /* TUNER_PHILIPS_TDA8290 */ 5189 - .tuner_addr = 0x60, 5190 - #else 5191 - .tuner_type = UNSET, 5182 + .tuner_type = TUNER_PHILIPS_TDA8290, 5192 5183 .tuner_addr = ADDR_UNSET, 5193 - #endif 5194 5184 .radio_type = UNSET, 5195 5185 .radio_addr = ADDR_UNSET, 5196 5186 .gpiomask = 0x8e054000, ··· 6922 6932 /* toggle AGC switch through GPIO 27 */ 6923 6933 switch (mode) { 6924 6934 case TDA18271_ANALOG: 6925 - saa7134_set_gpio(dev, 27, 0); 6935 + saa_writel(SAA7134_GPIO_GPMODE0 >> 2, 0x4000); 6936 + saa_writel(SAA7134_GPIO_GPSTATUS0 >> 2, 0x4000); 6937 + msleep(20); 6926 6938 break; 6927 6939 case TDA18271_DIGITAL: 6928 - saa7134_set_gpio(dev, 27, 1); 6940 + saa_writel(SAA7134_GPIO_GPMODE0 >> 2, 0x14000); 6941 + saa_writel(SAA7134_GPIO_GPSTATUS0 >> 2, 0x14000); 6942 + msleep(20); 6943 + saa_writel(SAA7134_GPIO_GPMODE0 >> 2, 0x54000); 6944 + saa_writel(SAA7134_GPIO_GPSTATUS0 >> 2, 0x54000); 6945 + msleep(30); 6929 6946 break; 6930 6947 default: 6931 6948 return -EINVAL; ··· 6990 6993 int saa7134_tuner_callback(void *priv, int component, int command, int arg) 6991 6994 { 6992 6995 struct saa7134_dev *dev = priv; 6996 + 6993 6997 if (dev != NULL) { 6994 6998 switch (dev->tuner_type) { 6995 6999 case TUNER_PHILIPS_TDA8290: ··· 7657 7659 break; 7658 7660 } 7659 7661 case SAA7134_BOARD_KWORLD_PCI_SBTVD_FULLSEG: 7660 - { 7661 - struct i2c_msg msg = { .addr = 0x4b, .flags = 0 }; 7662 - int i; 7663 - static u8 buffer[][2] = { 7664 - {0x30, 0x31}, 7665 - {0xff, 0x00}, 7666 - {0x41, 0x03}, 7667 - {0x41, 0x1a}, 7668 - {0xff, 0x02}, 7669 - {0x34, 0x00}, 7670 - {0x45, 0x97}, 7671 - {0x45, 0xc1}, 7672 - }; 7673 7662 saa_writel(SAA7134_GPIO_GPMODE0 >> 2, 0x4000); 7674 7663 saa_writel(SAA7134_GPIO_GPSTATUS0 >> 2, 0x4000); 7675 7664 7676 - /* 7677 - * FIXME: identify what device is at addr 0x4b and what means 7678 - * this initialization 7679 - */ 7680 - for (i = 0; i < ARRAY_SIZE(buffer); i++) { 7681 - msg.buf = &buffer[i][0]; 7682 - msg.len = ARRAY_SIZE(buffer[0]); 7683 - if (i2c_transfer(&dev->i2c_adap, &msg, 1) != 1) 7684 - printk(KERN_WARNING 7685 - "%s: Unable to enable tuner(%i).\n", 7686 - dev->name, i); 7687 - } 7665 + saa7134_set_gpio(dev, 27, 0); 7688 7666 break; 7689 - } 7690 7667 } /* switch() */ 7691 7668 7692 7669 /* initialize tuner */
+36 -44
drivers/media/video/saa7134/saa7134-dvb.c
··· 237 237 static struct tda18271_config kworld_tda18271_config = { 238 238 .std_map = &mb86a20s_tda18271_std_map, 239 239 .gate = TDA18271_GATE_DIGITAL, 240 + .config = 3, /* Use tuner callback for AGC */ 241 + 240 242 }; 241 243 242 244 static const struct mb86a20s_config kworld_mb86a20s_config = { 243 245 .demod_address = 0x10, 244 246 }; 247 + 248 + static int kworld_sbtvd_gate_ctrl(struct dvb_frontend* fe, int enable) 249 + { 250 + struct saa7134_dev *dev = fe->dvb->priv; 251 + 252 + unsigned char initmsg[] = {0x45, 0x97}; 253 + unsigned char msg_enable[] = {0x45, 0xc1}; 254 + unsigned char msg_disable[] = {0x45, 0x81}; 255 + struct i2c_msg msg = {.addr = 0x4b, .flags = 0, .buf = initmsg, .len = 2}; 256 + 257 + if (i2c_transfer(&dev->i2c_adap, &msg, 1) != 1) { 258 + wprintk("could not access the I2C gate\n"); 259 + return -EIO; 260 + } 261 + if (enable) 262 + msg.buf = msg_enable; 263 + else 264 + msg.buf = msg_disable; 265 + if (i2c_transfer(&dev->i2c_adap, &msg, 1) != 1) { 266 + wprintk("could not access the I2C gate\n"); 267 + return -EIO; 268 + } 269 + msleep(20); 270 + return 0; 271 + } 245 272 246 273 /* ================================================================== 247 274 * tda1004x based DVB-T cards, helper functions ··· 647 620 .config = 2, 648 621 .switch_addr = 0x42 649 622 }; 650 - 651 - /* ------------------------------------------------------------------ */ 652 - 653 - static int __kworld_sbtvd_i2c_gate_ctrl(struct saa7134_dev *dev, int enable) 654 - { 655 - unsigned char initmsg[] = {0x45, 0x97}; 656 - unsigned char msg_enable[] = {0x45, 0xc1}; 657 - unsigned char msg_disable[] = {0x45, 0x81}; 658 - struct i2c_msg msg = {.addr = 0x4b, .flags = 0, .buf = initmsg, .len = 2}; 659 - 660 - if (i2c_transfer(&dev->i2c_adap, &msg, 1) != 1) { 661 - wprintk("could not access the I2C gate\n"); 662 - return -EIO; 663 - } 664 - if (enable) 665 - msg.buf = msg_enable; 666 - else 667 - msg.buf = msg_disable; 668 - if (i2c_transfer(&dev->i2c_adap, &msg, 1) != 1) { 669 - wprintk("could not access the I2C gate\n"); 670 - return -EIO; 671 - } 672 - msleep(20); 673 - return 0; 674 - } 675 - static int kworld_sbtvd_i2c_gate_ctrl(struct dvb_frontend *fe, int enable) 676 - { 677 - struct saa7134_dev *dev = fe->dvb->priv; 678 - 679 - return __kworld_sbtvd_i2c_gate_ctrl(dev, enable); 680 - } 681 623 682 624 /* ------------------------------------------------------------------ */ 683 625 ··· 1656 1660 } 1657 1661 break; 1658 1662 case SAA7134_BOARD_KWORLD_PCI_SBTVD_FULLSEG: 1659 - __kworld_sbtvd_i2c_gate_ctrl(dev, 0); 1660 - saa_writel(SAA7134_GPIO_GPMODE0 >> 2, 0x14000); 1661 - saa_writel(SAA7134_GPIO_GPSTATUS0 >> 2, 0x14000); 1662 - msleep(20); 1663 - saa_writel(SAA7134_GPIO_GPMODE0 >> 2, 0x54000); 1664 - saa_writel(SAA7134_GPIO_GPSTATUS0 >> 2, 0x54000); 1665 - msleep(20); 1663 + /* Switch to digital mode */ 1664 + saa7134_tuner_callback(dev, 0, 1665 + TDA18271_CALLBACK_CMD_AGC_ENABLE, 1); 1666 1666 fe0->dvb.frontend = dvb_attach(mb86a20s_attach, 1667 1667 &kworld_mb86a20s_config, 1668 1668 &dev->i2c_adap); 1669 - __kworld_sbtvd_i2c_gate_ctrl(dev, 1); 1670 1669 if (fe0->dvb.frontend != NULL) { 1670 + dvb_attach(tda829x_attach, fe0->dvb.frontend, 1671 + &dev->i2c_adap, 0x4b, 1672 + &tda829x_no_probe); 1671 1673 dvb_attach(tda18271_attach, fe0->dvb.frontend, 1672 1674 0x60, &dev->i2c_adap, 1673 1675 &kworld_tda18271_config); 1674 - /* 1675 - * Only after success, it can initialize the gate, otherwise 1676 - * an OOPS will hit, due to kfree(fe0->dvb.frontend) 1677 - */ 1678 - fe0->dvb.frontend->ops.i2c_gate_ctrl = kworld_sbtvd_i2c_gate_ctrl; 1676 + fe0->dvb.frontend->ops.i2c_gate_ctrl = kworld_sbtvd_gate_ctrl; 1679 1677 } 1678 + 1679 + /* mb86a20s need to use the I2C gateway */ 1680 1680 break; 1681 1681 default: 1682 1682 wprintk("Huh? unknown DVB card?\n");
+32 -42
drivers/media/video/sn9c102/sn9c102_devtable.h
··· 47 47 { SN9C102_USB_DEVICE(0x0c45, 0x6009, BRIDGE_SN9C102), }, 48 48 { SN9C102_USB_DEVICE(0x0c45, 0x600d, BRIDGE_SN9C102), }, 49 49 /* { SN9C102_USB_DEVICE(0x0c45, 0x6011, BRIDGE_SN9C102), }, OV6650 */ 50 - #endif 51 50 { SN9C102_USB_DEVICE(0x0c45, 0x6019, BRIDGE_SN9C102), }, 51 + #endif 52 52 { SN9C102_USB_DEVICE(0x0c45, 0x6024, BRIDGE_SN9C102), }, 53 53 { SN9C102_USB_DEVICE(0x0c45, 0x6025, BRIDGE_SN9C102), }, 54 54 #if !defined CONFIG_USB_GSPCA_SONIXB && !defined CONFIG_USB_GSPCA_SONIXB_MODULE ··· 56 56 { SN9C102_USB_DEVICE(0x0c45, 0x6029, BRIDGE_SN9C102), }, 57 57 { SN9C102_USB_DEVICE(0x0c45, 0x602a, BRIDGE_SN9C102), }, 58 58 #endif 59 - { SN9C102_USB_DEVICE(0x0c45, 0x602b, BRIDGE_SN9C102), }, 59 + { SN9C102_USB_DEVICE(0x0c45, 0x602b, BRIDGE_SN9C102), }, /* not in sonixb */ 60 60 #if !defined CONFIG_USB_GSPCA_SONIXB && !defined CONFIG_USB_GSPCA_SONIXB_MODULE 61 61 { SN9C102_USB_DEVICE(0x0c45, 0x602c, BRIDGE_SN9C102), }, 62 62 /* { SN9C102_USB_DEVICE(0x0c45, 0x602d, BRIDGE_SN9C102), }, HV7131R */ 63 63 { SN9C102_USB_DEVICE(0x0c45, 0x602e, BRIDGE_SN9C102), }, 64 64 #endif 65 - { SN9C102_USB_DEVICE(0x0c45, 0x6030, BRIDGE_SN9C102), }, 65 + { SN9C102_USB_DEVICE(0x0c45, 0x6030, BRIDGE_SN9C102), }, /* not in sonixb */ 66 66 /* SN9C103 */ 67 - { SN9C102_USB_DEVICE(0x0c45, 0x6080, BRIDGE_SN9C103), }, 68 - { SN9C102_USB_DEVICE(0x0c45, 0x6082, BRIDGE_SN9C103), }, 67 + /* { SN9C102_USB_DEVICE(0x0c45, 0x6080, BRIDGE_SN9C103), }, non existent ? */ 68 + { SN9C102_USB_DEVICE(0x0c45, 0x6082, BRIDGE_SN9C103), }, /* not in sonixb */ 69 + #if !defined CONFIG_USB_GSPCA_SONIXB && !defined CONFIG_USB_GSPCA_SONIXB_MODULE 69 70 /* { SN9C102_USB_DEVICE(0x0c45, 0x6083, BRIDGE_SN9C103), }, HY7131D/E */ 70 - { SN9C102_USB_DEVICE(0x0c45, 0x6088, BRIDGE_SN9C103), }, 71 - { SN9C102_USB_DEVICE(0x0c45, 0x608a, BRIDGE_SN9C103), }, 72 - { SN9C102_USB_DEVICE(0x0c45, 0x608b, BRIDGE_SN9C103), }, 71 + /* { SN9C102_USB_DEVICE(0x0c45, 0x6088, BRIDGE_SN9C103), }, non existent ? */ 72 + /* { SN9C102_USB_DEVICE(0x0c45, 0x608a, BRIDGE_SN9C103), }, non existent ? */ 73 + /* { SN9C102_USB_DEVICE(0x0c45, 0x608b, BRIDGE_SN9C103), }, non existent ? */ 73 74 { SN9C102_USB_DEVICE(0x0c45, 0x608c, BRIDGE_SN9C103), }, 74 75 /* { SN9C102_USB_DEVICE(0x0c45, 0x608e, BRIDGE_SN9C103), }, CISVF10 */ 75 - #if !defined CONFIG_USB_GSPCA_SONIXB && !defined CONFIG_USB_GSPCA_SONIXB_MODULE 76 76 { SN9C102_USB_DEVICE(0x0c45, 0x608f, BRIDGE_SN9C103), }, 77 - #endif 78 - { SN9C102_USB_DEVICE(0x0c45, 0x60a0, BRIDGE_SN9C103), }, 79 - { SN9C102_USB_DEVICE(0x0c45, 0x60a2, BRIDGE_SN9C103), }, 80 - { SN9C102_USB_DEVICE(0x0c45, 0x60a3, BRIDGE_SN9C103), }, 77 + /* { SN9C102_USB_DEVICE(0x0c45, 0x60a0, BRIDGE_SN9C103), }, non existent ? */ 78 + /* { SN9C102_USB_DEVICE(0x0c45, 0x60a2, BRIDGE_SN9C103), }, non existent ? */ 79 + /* { SN9C102_USB_DEVICE(0x0c45, 0x60a3, BRIDGE_SN9C103), }, non existent ? */ 81 80 /* { SN9C102_USB_DEVICE(0x0c45, 0x60a8, BRIDGE_SN9C103), }, PAS106 */ 82 81 /* { SN9C102_USB_DEVICE(0x0c45, 0x60aa, BRIDGE_SN9C103), }, TAS5130 */ 83 - /* { SN9C102_USB_DEVICE(0x0c45, 0x60ab, BRIDGE_SN9C103), }, TAS5130 */ 84 - { SN9C102_USB_DEVICE(0x0c45, 0x60ac, BRIDGE_SN9C103), }, 85 - { SN9C102_USB_DEVICE(0x0c45, 0x60ae, BRIDGE_SN9C103), }, 82 + /* { SN9C102_USB_DEVICE(0x0c45, 0x60ab, BRIDGE_SN9C103), }, TAS5110, non existent */ 83 + /* { SN9C102_USB_DEVICE(0x0c45, 0x60ac, BRIDGE_SN9C103), }, non existent ? */ 84 + /* { SN9C102_USB_DEVICE(0x0c45, 0x60ae, BRIDGE_SN9C103), }, non existent ? */ 86 85 { SN9C102_USB_DEVICE(0x0c45, 0x60af, BRIDGE_SN9C103), }, 87 - #if !defined CONFIG_USB_GSPCA_SONIXB && !defined CONFIG_USB_GSPCA_SONIXB_MODULE 88 86 { SN9C102_USB_DEVICE(0x0c45, 0x60b0, BRIDGE_SN9C103), }, 87 + /* { SN9C102_USB_DEVICE(0x0c45, 0x60b2, BRIDGE_SN9C103), }, non existent ? */ 88 + /* { SN9C102_USB_DEVICE(0x0c45, 0x60b3, BRIDGE_SN9C103), }, non existent ? */ 89 + /* { SN9C102_USB_DEVICE(0x0c45, 0x60b8, BRIDGE_SN9C103), }, non existent ? */ 90 + /* { SN9C102_USB_DEVICE(0x0c45, 0x60ba, BRIDGE_SN9C103), }, non existent ? */ 91 + /* { SN9C102_USB_DEVICE(0x0c45, 0x60bb, BRIDGE_SN9C103), }, non existent ? */ 92 + /* { SN9C102_USB_DEVICE(0x0c45, 0x60bc, BRIDGE_SN9C103), }, non existent ? */ 93 + /* { SN9C102_USB_DEVICE(0x0c45, 0x60be, BRIDGE_SN9C103), }, non existent ? */ 89 94 #endif 90 - { SN9C102_USB_DEVICE(0x0c45, 0x60b2, BRIDGE_SN9C103), }, 91 - { SN9C102_USB_DEVICE(0x0c45, 0x60b3, BRIDGE_SN9C103), }, 92 - { SN9C102_USB_DEVICE(0x0c45, 0x60b8, BRIDGE_SN9C103), }, 93 - { SN9C102_USB_DEVICE(0x0c45, 0x60ba, BRIDGE_SN9C103), }, 94 - { SN9C102_USB_DEVICE(0x0c45, 0x60bb, BRIDGE_SN9C103), }, 95 - { SN9C102_USB_DEVICE(0x0c45, 0x60bc, BRIDGE_SN9C103), }, 96 - { SN9C102_USB_DEVICE(0x0c45, 0x60be, BRIDGE_SN9C103), }, 97 95 /* SN9C105 */ 98 96 #if !defined CONFIG_USB_GSPCA_SONIXJ && !defined CONFIG_USB_GSPCA_SONIXJ_MODULE 99 97 { SN9C102_USB_DEVICE(0x045e, 0x00f5, BRIDGE_SN9C105), }, 100 98 { SN9C102_USB_DEVICE(0x045e, 0x00f7, BRIDGE_SN9C105), }, 101 99 { SN9C102_USB_DEVICE(0x0471, 0x0327, BRIDGE_SN9C105), }, 102 100 { SN9C102_USB_DEVICE(0x0471, 0x0328, BRIDGE_SN9C105), }, 103 - #endif 104 101 { SN9C102_USB_DEVICE(0x0c45, 0x60c0, BRIDGE_SN9C105), }, 105 - { SN9C102_USB_DEVICE(0x0c45, 0x60c2, BRIDGE_SN9C105), }, 106 - { SN9C102_USB_DEVICE(0x0c45, 0x60c8, BRIDGE_SN9C105), }, 107 - { SN9C102_USB_DEVICE(0x0c45, 0x60cc, BRIDGE_SN9C105), }, 108 - { SN9C102_USB_DEVICE(0x0c45, 0x60ea, BRIDGE_SN9C105), }, 109 - { SN9C102_USB_DEVICE(0x0c45, 0x60ec, BRIDGE_SN9C105), }, 110 - { SN9C102_USB_DEVICE(0x0c45, 0x60ef, BRIDGE_SN9C105), }, 111 - { SN9C102_USB_DEVICE(0x0c45, 0x60fa, BRIDGE_SN9C105), }, 102 + /* { SN9C102_USB_DEVICE(0x0c45, 0x60c2, BRIDGE_SN9C105), }, PO1030 */ 103 + /* { SN9C102_USB_DEVICE(0x0c45, 0x60c8, BRIDGE_SN9C105), }, OM6801 */ 104 + /* { SN9C102_USB_DEVICE(0x0c45, 0x60cc, BRIDGE_SN9C105), }, HV7131GP */ 105 + /* { SN9C102_USB_DEVICE(0x0c45, 0x60ea, BRIDGE_SN9C105), }, non existent ? */ 106 + /* { SN9C102_USB_DEVICE(0x0c45, 0x60ec, BRIDGE_SN9C105), }, MO4000 */ 107 + /* { SN9C102_USB_DEVICE(0x0c45, 0x60ef, BRIDGE_SN9C105), }, ICM105C */ 108 + /* { SN9C102_USB_DEVICE(0x0c45, 0x60fa, BRIDGE_SN9C105), }, OV7648 */ 112 109 { SN9C102_USB_DEVICE(0x0c45, 0x60fb, BRIDGE_SN9C105), }, 113 110 { SN9C102_USB_DEVICE(0x0c45, 0x60fc, BRIDGE_SN9C105), }, 114 111 { SN9C102_USB_DEVICE(0x0c45, 0x60fe, BRIDGE_SN9C105), }, 115 112 /* SN9C120 */ 116 113 { SN9C102_USB_DEVICE(0x0458, 0x7025, BRIDGE_SN9C120), }, 117 - #if !defined CONFIG_USB_GSPCA_SONIXJ && !defined CONFIG_USB_GSPCA_SONIXJ_MODULE 118 - { SN9C102_USB_DEVICE(0x0c45, 0x6102, BRIDGE_SN9C120), }, 119 - #endif 120 - { SN9C102_USB_DEVICE(0x0c45, 0x6108, BRIDGE_SN9C120), }, 121 - { SN9C102_USB_DEVICE(0x0c45, 0x610f, BRIDGE_SN9C120), }, 122 - #if !defined CONFIG_USB_GSPCA_SONIXJ && !defined CONFIG_USB_GSPCA_SONIXJ_MODULE 114 + /* { SN9C102_USB_DEVICE(0x0c45, 0x6102, BRIDGE_SN9C120), }, po2030 */ 115 + /* { SN9C102_USB_DEVICE(0x0c45, 0x6108, BRIDGE_SN9C120), }, om6801 */ 116 + /* { SN9C102_USB_DEVICE(0x0c45, 0x610f, BRIDGE_SN9C120), }, S5K53BEB */ 123 117 { SN9C102_USB_DEVICE(0x0c45, 0x6130, BRIDGE_SN9C120), }, 124 - #endif 125 118 /* { SN9C102_USB_DEVICE(0x0c45, 0x6138, BRIDGE_SN9C120), }, MO8000 */ 126 - #if !defined CONFIG_USB_GSPCA_SONIXJ && !defined CONFIG_USB_GSPCA_SONIXJ_MODULE 127 119 { SN9C102_USB_DEVICE(0x0c45, 0x613a, BRIDGE_SN9C120), }, 128 - #endif 129 120 { SN9C102_USB_DEVICE(0x0c45, 0x613b, BRIDGE_SN9C120), }, 130 - #if !defined CONFIG_USB_GSPCA_SONIXJ && !defined CONFIG_USB_GSPCA_SONIXJ_MODULE 131 121 { SN9C102_USB_DEVICE(0x0c45, 0x613c, BRIDGE_SN9C120), }, 132 122 { SN9C102_USB_DEVICE(0x0c45, 0x613e, BRIDGE_SN9C120), }, 133 123 #endif
-10
drivers/media/video/sr030pc30.c
··· 714 714 return ret; 715 715 } 716 716 717 - static int sr030pc30_s_config(struct v4l2_subdev *sd, 718 - int irq, void *platform_data) 719 - { 720 - struct sr030pc30_info *info = to_sr030pc30(sd); 721 - 722 - info->pdata = platform_data; 723 - return 0; 724 - } 725 - 726 717 static int sr030pc30_s_stream(struct v4l2_subdev *sd, int enable) 727 718 { 728 719 return 0; ··· 754 763 } 755 764 756 765 static const struct v4l2_subdev_core_ops sr030pc30_core_ops = { 757 - .s_config = sr030pc30_s_config, 758 766 .s_power = sr030pc30_s_power, 759 767 .queryctrl = sr030pc30_queryctrl, 760 768 .s_ctrl = sr030pc30_s_ctrl,
-411
drivers/media/video/tda9875.c
··· 1 - /* 2 - * For the TDA9875 chip 3 - * (The TDA9875 is used on the Diamond DTV2000 french version 4 - * Other cards probably use these chips as well.) 5 - * This driver will not complain if used with any 6 - * other i2c device with the same address. 7 - * 8 - * Copyright (c) 2000 Guillaume Delvit based on Gerd Knorr source and 9 - * Eric Sandeen 10 - * Copyright (c) 2006 Mauro Carvalho Chehab <mchehab@infradead.org> 11 - * This code is placed under the terms of the GNU General Public License 12 - * Based on tda9855.c by Steve VanDeBogart (vandebo@uclink.berkeley.edu) 13 - * Which was based on tda8425.c by Greg Alexander (c) 1998 14 - * 15 - * OPTIONS: 16 - * debug - set to 1 if you'd like to see debug messages 17 - * 18 - * Revision: 0.1 - original version 19 - */ 20 - 21 - #include <linux/module.h> 22 - #include <linux/kernel.h> 23 - #include <linux/string.h> 24 - #include <linux/timer.h> 25 - #include <linux/delay.h> 26 - #include <linux/errno.h> 27 - #include <linux/slab.h> 28 - #include <linux/i2c.h> 29 - #include <linux/videodev2.h> 30 - #include <media/v4l2-device.h> 31 - #include <media/i2c-addr.h> 32 - 33 - static int debug; /* insmod parameter */ 34 - module_param(debug, int, S_IRUGO | S_IWUSR); 35 - MODULE_LICENSE("GPL"); 36 - 37 - 38 - /* This is a superset of the TDA9875 */ 39 - struct tda9875 { 40 - struct v4l2_subdev sd; 41 - int rvol, lvol; 42 - int bass, treble; 43 - }; 44 - 45 - static inline struct tda9875 *to_state(struct v4l2_subdev *sd) 46 - { 47 - return container_of(sd, struct tda9875, sd); 48 - } 49 - 50 - #define dprintk if (debug) printk 51 - 52 - /* The TDA9875 is made by Philips Semiconductor 53 - * http://www.semiconductors.philips.com 54 - * TDA9875: I2C-bus controlled DSP audio processor, FM demodulator 55 - * 56 - */ 57 - 58 - /* subaddresses for TDA9875 */ 59 - #define TDA9875_MUT 0x12 /*General mute (value --> 0b11001100*/ 60 - #define TDA9875_CFG 0x01 /* Config register (value --> 0b00000000 */ 61 - #define TDA9875_DACOS 0x13 /*DAC i/o select (ADC) 0b0000100*/ 62 - #define TDA9875_LOSR 0x16 /*Line output select regirter 0b0100 0001*/ 63 - 64 - #define TDA9875_CH1V 0x0c /*Channel 1 volume (mute)*/ 65 - #define TDA9875_CH2V 0x0d /*Channel 2 volume (mute)*/ 66 - #define TDA9875_SC1 0x14 /*SCART 1 in (mono)*/ 67 - #define TDA9875_SC2 0x15 /*SCART 2 in (mono)*/ 68 - 69 - #define TDA9875_ADCIS 0x17 /*ADC input select (mono) 0b0110 000*/ 70 - #define TDA9875_AER 0x19 /*Audio effect (AVL+Pseudo) 0b0000 0110*/ 71 - #define TDA9875_MCS 0x18 /*Main channel select (DAC) 0b0000100*/ 72 - #define TDA9875_MVL 0x1a /* Main volume gauche */ 73 - #define TDA9875_MVR 0x1b /* Main volume droite */ 74 - #define TDA9875_MBA 0x1d /* Main Basse */ 75 - #define TDA9875_MTR 0x1e /* Main treble */ 76 - #define TDA9875_ACS 0x1f /* Auxilary channel select (FM) 0b0000000*/ 77 - #define TDA9875_AVL 0x20 /* Auxilary volume gauche */ 78 - #define TDA9875_AVR 0x21 /* Auxilary volume droite */ 79 - #define TDA9875_ABA 0x22 /* Auxilary Basse */ 80 - #define TDA9875_ATR 0x23 /* Auxilary treble */ 81 - 82 - #define TDA9875_MSR 0x02 /* Monitor select register */ 83 - #define TDA9875_C1MSB 0x03 /* Carrier 1 (FM) frequency register MSB */ 84 - #define TDA9875_C1MIB 0x04 /* Carrier 1 (FM) frequency register (16-8]b */ 85 - #define TDA9875_C1LSB 0x05 /* Carrier 1 (FM) frequency register LSB */ 86 - #define TDA9875_C2MSB 0x06 /* Carrier 2 (nicam) frequency register MSB */ 87 - #define TDA9875_C2MIB 0x07 /* Carrier 2 (nicam) frequency register (16-8]b */ 88 - #define TDA9875_C2LSB 0x08 /* Carrier 2 (nicam) frequency register LSB */ 89 - #define TDA9875_DCR 0x09 /* Demodulateur configuration regirter*/ 90 - #define TDA9875_DEEM 0x0a /* FM de-emphasis regirter*/ 91 - #define TDA9875_FMAT 0x0b /* FM Matrix regirter*/ 92 - 93 - /* values */ 94 - #define TDA9875_MUTE_ON 0xff /* general mute */ 95 - #define TDA9875_MUTE_OFF 0xcc /* general no mute */ 96 - 97 - 98 - 99 - /* Begin code */ 100 - 101 - static int tda9875_write(struct v4l2_subdev *sd, int subaddr, unsigned char val) 102 - { 103 - struct i2c_client *client = v4l2_get_subdevdata(sd); 104 - unsigned char buffer[2]; 105 - 106 - v4l2_dbg(1, debug, sd, "Writing %d 0x%x\n", subaddr, val); 107 - buffer[0] = subaddr; 108 - buffer[1] = val; 109 - if (2 != i2c_master_send(client, buffer, 2)) { 110 - v4l2_warn(sd, "I/O error, trying (write %d 0x%x)\n", 111 - subaddr, val); 112 - return -1; 113 - } 114 - return 0; 115 - } 116 - 117 - 118 - static int i2c_read_register(struct i2c_client *client, int addr, int reg) 119 - { 120 - unsigned char write[1]; 121 - unsigned char read[1]; 122 - struct i2c_msg msgs[2] = { 123 - { addr, 0, 1, write }, 124 - { addr, I2C_M_RD, 1, read } 125 - }; 126 - 127 - write[0] = reg; 128 - 129 - if (2 != i2c_transfer(client->adapter, msgs, 2)) { 130 - v4l_warn(client, "I/O error (read2)\n"); 131 - return -1; 132 - } 133 - v4l_dbg(1, debug, client, "chip_read2: reg%d=0x%x\n", reg, read[0]); 134 - return read[0]; 135 - } 136 - 137 - static void tda9875_set(struct v4l2_subdev *sd) 138 - { 139 - struct tda9875 *tda = to_state(sd); 140 - unsigned char a; 141 - 142 - v4l2_dbg(1, debug, sd, "tda9875_set(%04x,%04x,%04x,%04x)\n", 143 - tda->lvol, tda->rvol, tda->bass, tda->treble); 144 - 145 - a = tda->lvol & 0xff; 146 - tda9875_write(sd, TDA9875_MVL, a); 147 - a =tda->rvol & 0xff; 148 - tda9875_write(sd, TDA9875_MVR, a); 149 - a =tda->bass & 0xff; 150 - tda9875_write(sd, TDA9875_MBA, a); 151 - a =tda->treble & 0xff; 152 - tda9875_write(sd, TDA9875_MTR, a); 153 - } 154 - 155 - static void do_tda9875_init(struct v4l2_subdev *sd) 156 - { 157 - struct tda9875 *t = to_state(sd); 158 - 159 - v4l2_dbg(1, debug, sd, "In tda9875_init\n"); 160 - tda9875_write(sd, TDA9875_CFG, 0xd0); /*reg de config 0 (reset)*/ 161 - tda9875_write(sd, TDA9875_MSR, 0x03); /* Monitor 0b00000XXX*/ 162 - tda9875_write(sd, TDA9875_C1MSB, 0x00); /*Car1(FM) MSB XMHz*/ 163 - tda9875_write(sd, TDA9875_C1MIB, 0x00); /*Car1(FM) MIB XMHz*/ 164 - tda9875_write(sd, TDA9875_C1LSB, 0x00); /*Car1(FM) LSB XMHz*/ 165 - tda9875_write(sd, TDA9875_C2MSB, 0x00); /*Car2(NICAM) MSB XMHz*/ 166 - tda9875_write(sd, TDA9875_C2MIB, 0x00); /*Car2(NICAM) MIB XMHz*/ 167 - tda9875_write(sd, TDA9875_C2LSB, 0x00); /*Car2(NICAM) LSB XMHz*/ 168 - tda9875_write(sd, TDA9875_DCR, 0x00); /*Demod config 0x00*/ 169 - tda9875_write(sd, TDA9875_DEEM, 0x44); /*DE-Emph 0b0100 0100*/ 170 - tda9875_write(sd, TDA9875_FMAT, 0x00); /*FM Matrix reg 0x00*/ 171 - tda9875_write(sd, TDA9875_SC1, 0x00); /* SCART 1 (SC1)*/ 172 - tda9875_write(sd, TDA9875_SC2, 0x01); /* SCART 2 (sc2)*/ 173 - 174 - tda9875_write(sd, TDA9875_CH1V, 0x10); /* Channel volume 1 mute*/ 175 - tda9875_write(sd, TDA9875_CH2V, 0x10); /* Channel volume 2 mute */ 176 - tda9875_write(sd, TDA9875_DACOS, 0x02); /* sig DAC i/o(in:nicam)*/ 177 - tda9875_write(sd, TDA9875_ADCIS, 0x6f); /* sig ADC input(in:mono)*/ 178 - tda9875_write(sd, TDA9875_LOSR, 0x00); /* line out (in:mono)*/ 179 - tda9875_write(sd, TDA9875_AER, 0x00); /*06 Effect (AVL+PSEUDO) */ 180 - tda9875_write(sd, TDA9875_MCS, 0x44); /* Main ch select (DAC) */ 181 - tda9875_write(sd, TDA9875_MVL, 0x03); /* Vol Main left 10dB */ 182 - tda9875_write(sd, TDA9875_MVR, 0x03); /* Vol Main right 10dB*/ 183 - tda9875_write(sd, TDA9875_MBA, 0x00); /* Main Bass Main 0dB*/ 184 - tda9875_write(sd, TDA9875_MTR, 0x00); /* Main Treble Main 0dB*/ 185 - tda9875_write(sd, TDA9875_ACS, 0x44); /* Aux chan select (dac)*/ 186 - tda9875_write(sd, TDA9875_AVL, 0x00); /* Vol Aux left 0dB*/ 187 - tda9875_write(sd, TDA9875_AVR, 0x00); /* Vol Aux right 0dB*/ 188 - tda9875_write(sd, TDA9875_ABA, 0x00); /* Aux Bass Main 0dB*/ 189 - tda9875_write(sd, TDA9875_ATR, 0x00); /* Aux Aigus Main 0dB*/ 190 - 191 - tda9875_write(sd, TDA9875_MUT, 0xcc); /* General mute */ 192 - 193 - t->lvol = t->rvol = 0; /* 0dB */ 194 - t->bass = 0; /* 0dB */ 195 - t->treble = 0; /* 0dB */ 196 - tda9875_set(sd); 197 - } 198 - 199 - 200 - static int tda9875_g_ctrl(struct v4l2_subdev *sd, struct v4l2_control *ctrl) 201 - { 202 - struct tda9875 *t = to_state(sd); 203 - 204 - switch (ctrl->id) { 205 - case V4L2_CID_AUDIO_VOLUME: 206 - { 207 - int left = (t->lvol+84)*606; 208 - int right = (t->rvol+84)*606; 209 - 210 - ctrl->value=max(left,right); 211 - return 0; 212 - } 213 - case V4L2_CID_AUDIO_BALANCE: 214 - { 215 - int left = (t->lvol+84)*606; 216 - int right = (t->rvol+84)*606; 217 - int volume = max(left,right); 218 - int balance = (32768*min(left,right))/ 219 - (volume ? volume : 1); 220 - ctrl->value=(left<right)? 221 - (65535-balance) : balance; 222 - return 0; 223 - } 224 - case V4L2_CID_AUDIO_BASS: 225 - ctrl->value = (t->bass+12)*2427; /* min -12 max +15 */ 226 - return 0; 227 - case V4L2_CID_AUDIO_TREBLE: 228 - ctrl->value = (t->treble+12)*2730;/* min -12 max +12 */ 229 - return 0; 230 - } 231 - return -EINVAL; 232 - } 233 - 234 - static int tda9875_s_ctrl(struct v4l2_subdev *sd, struct v4l2_control *ctrl) 235 - { 236 - struct tda9875 *t = to_state(sd); 237 - int chvol = 0, volume = 0, balance = 0, left, right; 238 - 239 - switch (ctrl->id) { 240 - case V4L2_CID_AUDIO_VOLUME: 241 - left = (t->lvol+84)*606; 242 - right = (t->rvol+84)*606; 243 - 244 - volume = max(left,right); 245 - balance = (32768*min(left,right))/ 246 - (volume ? volume : 1); 247 - balance =(left<right)? 248 - (65535-balance) : balance; 249 - 250 - volume = ctrl->value; 251 - 252 - chvol=1; 253 - break; 254 - case V4L2_CID_AUDIO_BALANCE: 255 - left = (t->lvol+84)*606; 256 - right = (t->rvol+84)*606; 257 - 258 - volume=max(left,right); 259 - 260 - balance = ctrl->value; 261 - 262 - chvol=1; 263 - break; 264 - case V4L2_CID_AUDIO_BASS: 265 - t->bass = ((ctrl->value/2400)-12) & 0xff; 266 - if (t->bass > 15) 267 - t->bass = 15; 268 - if (t->bass < -12) 269 - t->bass = -12 & 0xff; 270 - break; 271 - case V4L2_CID_AUDIO_TREBLE: 272 - t->treble = ((ctrl->value/2700)-12) & 0xff; 273 - if (t->treble > 12) 274 - t->treble = 12; 275 - if (t->treble < -12) 276 - t->treble = -12 & 0xff; 277 - break; 278 - default: 279 - return -EINVAL; 280 - } 281 - 282 - if (chvol) { 283 - left = (min(65536 - balance,32768) * 284 - volume) / 32768; 285 - right = (min(balance,32768) * 286 - volume) / 32768; 287 - t->lvol = ((left/606)-84) & 0xff; 288 - if (t->lvol > 24) 289 - t->lvol = 24; 290 - if (t->lvol < -84) 291 - t->lvol = -84 & 0xff; 292 - 293 - t->rvol = ((right/606)-84) & 0xff; 294 - if (t->rvol > 24) 295 - t->rvol = 24; 296 - if (t->rvol < -84) 297 - t->rvol = -84 & 0xff; 298 - } 299 - 300 - tda9875_set(sd); 301 - return 0; 302 - } 303 - 304 - static int tda9875_queryctrl(struct v4l2_subdev *sd, struct v4l2_queryctrl *qc) 305 - { 306 - switch (qc->id) { 307 - case V4L2_CID_AUDIO_VOLUME: 308 - return v4l2_ctrl_query_fill(qc, 0, 65535, 65535 / 100, 58880); 309 - case V4L2_CID_AUDIO_BASS: 310 - case V4L2_CID_AUDIO_TREBLE: 311 - return v4l2_ctrl_query_fill(qc, 0, 65535, 65535 / 100, 32768); 312 - } 313 - return -EINVAL; 314 - } 315 - 316 - /* ----------------------------------------------------------------------- */ 317 - 318 - static const struct v4l2_subdev_core_ops tda9875_core_ops = { 319 - .queryctrl = tda9875_queryctrl, 320 - .g_ctrl = tda9875_g_ctrl, 321 - .s_ctrl = tda9875_s_ctrl, 322 - }; 323 - 324 - static const struct v4l2_subdev_ops tda9875_ops = { 325 - .core = &tda9875_core_ops, 326 - }; 327 - 328 - /* ----------------------------------------------------------------------- */ 329 - 330 - 331 - /* *********************** * 332 - * i2c interface functions * 333 - * *********************** */ 334 - 335 - static int tda9875_checkit(struct i2c_client *client, int addr) 336 - { 337 - int dic, rev; 338 - 339 - dic = i2c_read_register(client, addr, 254); 340 - rev = i2c_read_register(client, addr, 255); 341 - 342 - if (dic == 0 || dic == 2) { /* tda9875 and tda9875A */ 343 - v4l_info(client, "tda9875%s rev. %d detected at 0x%02x\n", 344 - dic == 0 ? "" : "A", rev, addr << 1); 345 - return 1; 346 - } 347 - v4l_info(client, "no such chip at 0x%02x (dic=0x%x rev=0x%x)\n", 348 - addr << 1, dic, rev); 349 - return 0; 350 - } 351 - 352 - static int tda9875_probe(struct i2c_client *client, 353 - const struct i2c_device_id *id) 354 - { 355 - struct tda9875 *t; 356 - struct v4l2_subdev *sd; 357 - 358 - v4l_info(client, "chip found @ 0x%02x (%s)\n", 359 - client->addr << 1, client->adapter->name); 360 - 361 - if (!tda9875_checkit(client, client->addr)) 362 - return -ENODEV; 363 - 364 - t = kzalloc(sizeof(*t), GFP_KERNEL); 365 - if (!t) 366 - return -ENOMEM; 367 - sd = &t->sd; 368 - v4l2_i2c_subdev_init(sd, client, &tda9875_ops); 369 - 370 - do_tda9875_init(sd); 371 - return 0; 372 - } 373 - 374 - static int tda9875_remove(struct i2c_client *client) 375 - { 376 - struct v4l2_subdev *sd = i2c_get_clientdata(client); 377 - 378 - do_tda9875_init(sd); 379 - v4l2_device_unregister_subdev(sd); 380 - kfree(to_state(sd)); 381 - return 0; 382 - } 383 - 384 - static const struct i2c_device_id tda9875_id[] = { 385 - { "tda9875", 0 }, 386 - { } 387 - }; 388 - MODULE_DEVICE_TABLE(i2c, tda9875_id); 389 - 390 - static struct i2c_driver tda9875_driver = { 391 - .driver = { 392 - .owner = THIS_MODULE, 393 - .name = "tda9875", 394 - }, 395 - .probe = tda9875_probe, 396 - .remove = tda9875_remove, 397 - .id_table = tda9875_id, 398 - }; 399 - 400 - static __init int init_tda9875(void) 401 - { 402 - return i2c_add_driver(&tda9875_driver); 403 - } 404 - 405 - static __exit void exit_tda9875(void) 406 - { 407 - i2c_del_driver(&tda9875_driver); 408 - } 409 - 410 - module_init(init_tda9875); 411 - module_exit(exit_tda9875);
+7 -6
drivers/media/video/tlg2300/pd-video.c
··· 512 512 int buf_size, gfp_t gfp_flags, 513 513 usb_complete_t complete_fn, void *context) 514 514 { 515 - struct urb *urb; 516 - void *mem; 517 - int i; 515 + int i = 0; 518 516 519 - for (i = 0; i < num; i++) { 520 - urb = usb_alloc_urb(0, gfp_flags); 517 + for (; i < num; i++) { 518 + void *mem; 519 + struct urb *urb = usb_alloc_urb(0, gfp_flags); 521 520 if (urb == NULL) 522 521 return i; 523 522 524 523 mem = usb_alloc_coherent(udev, buf_size, gfp_flags, 525 524 &urb->transfer_dma); 526 - if (mem == NULL) 525 + if (mem == NULL) { 526 + usb_free_urb(urb); 527 527 return i; 528 + } 528 529 529 530 usb_fill_bulk_urb(urb, udev, usb_rcvbulkpipe(udev, ep_addr), 530 531 mem, buf_size, complete_fn, context);
+2 -17
drivers/media/video/v4l2-common.c
··· 407 407 /* Decrease the module use count to match the first try_module_get. */ 408 408 module_put(client->driver->driver.owner); 409 409 410 - if (sd) { 411 - /* We return errors from v4l2_subdev_call only if we have the 412 - callback as the .s_config is not mandatory */ 413 - int err = v4l2_subdev_call(sd, core, s_config, 414 - info->irq, info->platform_data); 415 - 416 - if (err && err != -ENOIOCTLCMD) { 417 - v4l2_device_unregister_subdev(sd); 418 - sd = NULL; 419 - } 420 - } 421 - 422 410 error: 423 411 /* If we have a client but no subdev, then something went wrong and 424 412 we must unregister the client. */ ··· 416 428 } 417 429 EXPORT_SYMBOL_GPL(v4l2_i2c_new_subdev_board); 418 430 419 - struct v4l2_subdev *v4l2_i2c_new_subdev_cfg(struct v4l2_device *v4l2_dev, 431 + struct v4l2_subdev *v4l2_i2c_new_subdev(struct v4l2_device *v4l2_dev, 420 432 struct i2c_adapter *adapter, const char *client_type, 421 - int irq, void *platform_data, 422 433 u8 addr, const unsigned short *probe_addrs) 423 434 { 424 435 struct i2c_board_info info; ··· 427 440 memset(&info, 0, sizeof(info)); 428 441 strlcpy(info.type, client_type, sizeof(info.type)); 429 442 info.addr = addr; 430 - info.irq = irq; 431 - info.platform_data = platform_data; 432 443 433 444 return v4l2_i2c_new_subdev_board(v4l2_dev, adapter, &info, probe_addrs); 434 445 } 435 - EXPORT_SYMBOL_GPL(v4l2_i2c_new_subdev_cfg); 446 + EXPORT_SYMBOL_GPL(v4l2_i2c_new_subdev); 436 447 437 448 /* Return i2c client address of v4l2_subdev. */ 438 449 unsigned short v4l2_i2c_subdev_addr(struct v4l2_subdev *sd)
+22 -12
drivers/media/video/v4l2-ctrls.c
··· 569 569 int ret; 570 570 u32 size; 571 571 572 - ctrl->has_new = 1; 572 + ctrl->is_new = 1; 573 573 switch (ctrl->type) { 574 574 case V4L2_CTRL_TYPE_INTEGER64: 575 575 ctrl->val64 = c->value64; ··· 1280 1280 if (ctrl->done) 1281 1281 continue; 1282 1282 1283 - for (i = 0; i < master->ncontrols; i++) 1284 - cur_to_new(master->cluster[i]); 1283 + for (i = 0; i < master->ncontrols; i++) { 1284 + if (master->cluster[i]) { 1285 + cur_to_new(master->cluster[i]); 1286 + master->cluster[i]->is_new = 1; 1287 + } 1288 + } 1285 1289 1286 1290 /* Skip button controls and read-only controls. */ 1287 1291 if (ctrl->type == V4L2_CTRL_TYPE_BUTTON || ··· 1344 1340 1345 1341 ctrl = ref->ctrl; 1346 1342 memset(qc, 0, sizeof(*qc)); 1347 - qc->id = ctrl->id; 1343 + if (id >= V4L2_CID_PRIVATE_BASE) 1344 + qc->id = id; 1345 + else 1346 + qc->id = ctrl->id; 1348 1347 strlcpy(qc->name, ctrl->name, sizeof(qc->name)); 1349 1348 qc->minimum = ctrl->minimum; 1350 1349 qc->maximum = ctrl->maximum; 1351 1350 qc->default_value = ctrl->default_value; 1352 - if (qc->type == V4L2_CTRL_TYPE_MENU) 1351 + if (ctrl->type == V4L2_CTRL_TYPE_MENU) 1353 1352 qc->step = 1; 1354 1353 else 1355 1354 qc->step = ctrl->step; ··· 1652 1645 if (ctrl == NULL) 1653 1646 continue; 1654 1647 1655 - if (ctrl->has_new) { 1648 + if (ctrl->is_new) { 1656 1649 /* Double check this: it may have changed since the 1657 1650 last check in try_or_set_ext_ctrls(). */ 1658 1651 if (set && (ctrl->flags & V4L2_CTRL_FLAG_GRABBED)) ··· 1726 1719 1727 1720 v4l2_ctrl_lock(ctrl); 1728 1721 1729 - /* Reset the 'has_new' flags of the cluster */ 1722 + /* Reset the 'is_new' flags of the cluster */ 1730 1723 for (j = 0; j < master->ncontrols; j++) 1731 1724 if (master->cluster[j]) 1732 - master->cluster[j]->has_new = 0; 1725 + master->cluster[j]->is_new = 0; 1733 1726 1734 1727 /* Copy the new caller-supplied control values. 1735 - user_to_new() sets 'has_new' to 1. */ 1728 + user_to_new() sets 'is_new' to 1. */ 1736 1729 ret = cluster_walk(i, cs, helpers, user_to_new); 1737 1730 1738 1731 if (!ret) ··· 1827 1820 int ret; 1828 1821 int i; 1829 1822 1823 + if (ctrl->flags & V4L2_CTRL_FLAG_READ_ONLY) 1824 + return -EACCES; 1825 + 1830 1826 v4l2_ctrl_lock(ctrl); 1831 1827 1832 - /* Reset the 'has_new' flags of the cluster */ 1828 + /* Reset the 'is_new' flags of the cluster */ 1833 1829 for (i = 0; i < master->ncontrols; i++) 1834 1830 if (master->cluster[i]) 1835 - master->cluster[i]->has_new = 0; 1831 + master->cluster[i]->is_new = 0; 1836 1832 1837 1833 ctrl->val = *val; 1838 - ctrl->has_new = 1; 1834 + ctrl->is_new = 1; 1839 1835 ret = try_or_set_control_cluster(master, false); 1840 1836 if (!ret) 1841 1837 ret = try_or_set_control_cluster(master, true);
+4 -5
drivers/media/video/v4l2-dev.c
··· 419 419 * The registration code assigns minor numbers and device node numbers 420 420 * based on the requested type and registers the new device node with 421 421 * the kernel. 422 + * 423 + * This function assumes that struct video_device was zeroed when it 424 + * was allocated and does not contain any stale date. 425 + * 422 426 * An error is returned if no free minor or device node number could be 423 427 * found, or if the registration of the device node failed. 424 428 * ··· 444 440 int minor_offset = 0; 445 441 int minor_cnt = VIDEO_NUM_DEVICES; 446 442 const char *name_base; 447 - void *priv = vdev->dev.p; 448 443 449 444 /* A minor value of -1 marks this video device as never 450 445 having been registered */ ··· 562 559 } 563 560 564 561 /* Part 4: register the device with sysfs */ 565 - memset(&vdev->dev, 0, sizeof(vdev->dev)); 566 - /* The memset above cleared the device's device_private, so 567 - put back the copy we made earlier. */ 568 - vdev->dev.p = priv; 569 562 vdev->dev.class = &video_class; 570 563 vdev->dev.devt = MKDEV(VIDEO_MAJOR, vdev->minor); 571 564 if (vdev->parent)
+14 -2
drivers/media/video/v4l2-device.c
··· 100 100 is a platform bus, then it is never deleted. */ 101 101 if (client) 102 102 i2c_unregister_device(client); 103 + continue; 103 104 } 104 105 #endif 105 106 #if defined(CONFIG_SPI) ··· 109 108 110 109 if (spi) 111 110 spi_unregister_device(spi); 111 + continue; 112 112 } 113 113 #endif 114 114 } ··· 128 126 WARN_ON(sd->v4l2_dev != NULL); 129 127 if (!try_module_get(sd->owner)) 130 128 return -ENODEV; 129 + sd->v4l2_dev = v4l2_dev; 130 + if (sd->internal_ops && sd->internal_ops->registered) { 131 + err = sd->internal_ops->registered(sd); 132 + if (err) 133 + return err; 134 + } 131 135 /* This just returns 0 if either of the two args is NULL */ 132 136 err = v4l2_ctrl_add_handler(v4l2_dev->ctrl_handler, sd->ctrl_handler); 133 - if (err) 137 + if (err) { 138 + if (sd->internal_ops && sd->internal_ops->unregistered) 139 + sd->internal_ops->unregistered(sd); 134 140 return err; 135 - sd->v4l2_dev = v4l2_dev; 141 + } 136 142 spin_lock(&v4l2_dev->lock); 137 143 list_add_tail(&sd->list, &v4l2_dev->subdevs); 138 144 spin_unlock(&v4l2_dev->lock); ··· 156 146 spin_lock(&sd->v4l2_dev->lock); 157 147 list_del(&sd->list); 158 148 spin_unlock(&sd->v4l2_dev->lock); 149 + if (sd->internal_ops && sd->internal_ops->unregistered) 150 + sd->internal_ops->unregistered(sd); 159 151 sd->v4l2_dev = NULL; 160 152 module_put(sd->owner); 161 153 }
+12 -8
drivers/media/video/v4l2-ioctl.c
··· 1659 1659 { 1660 1660 struct v4l2_dbg_register *p = arg; 1661 1661 1662 - if (!capable(CAP_SYS_ADMIN)) 1663 - ret = -EPERM; 1664 - else if (ops->vidioc_g_register) 1665 - ret = ops->vidioc_g_register(file, fh, p); 1662 + if (ops->vidioc_g_register) { 1663 + if (!capable(CAP_SYS_ADMIN)) 1664 + ret = -EPERM; 1665 + else 1666 + ret = ops->vidioc_g_register(file, fh, p); 1667 + } 1666 1668 break; 1667 1669 } 1668 1670 case VIDIOC_DBG_S_REGISTER: 1669 1671 { 1670 1672 struct v4l2_dbg_register *p = arg; 1671 1673 1672 - if (!capable(CAP_SYS_ADMIN)) 1673 - ret = -EPERM; 1674 - else if (ops->vidioc_s_register) 1675 - ret = ops->vidioc_s_register(file, fh, p); 1674 + if (ops->vidioc_s_register) { 1675 + if (!capable(CAP_SYS_ADMIN)) 1676 + ret = -EPERM; 1677 + else 1678 + ret = ops->vidioc_s_register(file, fh, p); 1679 + } 1676 1680 break; 1677 1681 } 1678 1682 #endif
+1
drivers/media/video/w9966.c
··· 937 937 parport_unregister_device(cam->pdev); 938 938 w9966_set_state(cam, W9966_STATE_PDEV, 0); 939 939 } 940 + memset(cam, 0, sizeof(*cam)); 940 941 } 941 942 942 943
+1 -1
drivers/media/video/zoran/zoran_card.c
··· 1041 1041 /* allocate memory *before* doing anything to the hardware 1042 1042 * in case allocation fails */ 1043 1043 zr->stat_com = kzalloc(BUZ_NUM_STAT_COM * 4, GFP_KERNEL); 1044 - zr->video_dev = kmalloc(sizeof(struct video_device), GFP_KERNEL); 1044 + zr->video_dev = video_device_alloc(); 1045 1045 if (!zr->stat_com || !zr->video_dev) { 1046 1046 dprintk(1, 1047 1047 KERN_ERR
+1 -1
drivers/net/Kconfig
··· 2864 2864 default n 2865 2865 2866 2866 config MLX4_DEBUG 2867 - bool "Verbose debugging output" if (MLX4_CORE && EMBEDDED) 2867 + bool "Verbose debugging output" if (MLX4_CORE && EXPERT) 2868 2868 depends on MLX4_CORE 2869 2869 default y 2870 2870 ---help---
+2 -2
drivers/net/bnx2x/bnx2x.h
··· 22 22 * (you will need to reboot afterwards) */ 23 23 /* #define BNX2X_STOP_ON_ERROR */ 24 24 25 - #define DRV_MODULE_VERSION "1.62.00-3" 26 - #define DRV_MODULE_RELDATE "2010/12/21" 25 + #define DRV_MODULE_VERSION "1.62.00-4" 26 + #define DRV_MODULE_RELDATE "2011/01/18" 27 27 #define BNX2X_BC_VER 0x040200 28 28 29 29 #define BNX2X_MULTI_QUEUE
+4
drivers/net/bnx2x/bnx2x_hsi.h
··· 352 352 #define PORT_HW_CFG_LANE_SWAP_CFG_31203120 0x0000d8d8 353 353 /* forced only */ 354 354 #define PORT_HW_CFG_LANE_SWAP_CFG_32103210 0x0000e4e4 355 + /* Indicate whether to swap the external phy polarity */ 356 + #define PORT_HW_CFG_SWAP_PHY_POLARITY_MASK 0x00010000 357 + #define PORT_HW_CFG_SWAP_PHY_POLARITY_DISABLED 0x00000000 358 + #define PORT_HW_CFG_SWAP_PHY_POLARITY_ENABLED 0x00010000 355 359 356 360 u32 external_phy_config; 357 361 #define PORT_HW_CFG_SERDES_EXT_PHY_TYPE_MASK 0xff000000
+139 -34
drivers/net/bnx2x/bnx2x_link.c
··· 1573 1573 1574 1574 offset = phy->addr + ser_lane; 1575 1575 if (CHIP_IS_E2(bp)) 1576 - aer_val = 0x2800 + offset - 1; 1576 + aer_val = 0x3800 + offset - 1; 1577 1577 else 1578 1578 aer_val = 0x3800 + offset; 1579 1579 CL45_WR_OVER_CL22(bp, phy, ··· 3166 3166 if (!vars->link_up) 3167 3167 break; 3168 3168 case LED_MODE_ON: 3169 - if (SINGLE_MEDIA_DIRECT(params)) { 3169 + if (params->phy[EXT_PHY1].type == 3170 + PORT_HW_CFG_XGXS_EXT_PHY_TYPE_BCM8727 && 3171 + CHIP_IS_E2(bp) && params->num_phys == 2) { 3172 + /** 3173 + * This is a work-around for E2+8727 Configurations 3174 + */ 3175 + if (mode == LED_MODE_ON || 3176 + speed == SPEED_10000){ 3177 + REG_WR(bp, NIG_REG_LED_MODE_P0 + port*4, 0); 3178 + REG_WR(bp, NIG_REG_LED_10G_P0 + port*4, 1); 3179 + 3180 + tmp = EMAC_RD(bp, EMAC_REG_EMAC_LED); 3181 + EMAC_WR(bp, EMAC_REG_EMAC_LED, 3182 + (tmp | EMAC_LED_OVERRIDE)); 3183 + return rc; 3184 + } 3185 + } else if (SINGLE_MEDIA_DIRECT(params)) { 3170 3186 /** 3171 3187 * This is a work-around for HW issue found when link 3172 3188 * is up in CL73 ··· 3870 3854 pause_result); 3871 3855 } 3872 3856 } 3873 - 3874 - static void bnx2x_8073_8727_external_rom_boot(struct bnx2x *bp, 3857 + static u8 bnx2x_8073_8727_external_rom_boot(struct bnx2x *bp, 3875 3858 struct bnx2x_phy *phy, 3876 3859 u8 port) 3877 3860 { 3861 + u32 count = 0; 3862 + u16 fw_ver1, fw_msgout; 3863 + u8 rc = 0; 3864 + 3878 3865 /* Boot port from external ROM */ 3879 3866 /* EDC grst */ 3880 3867 bnx2x_cl45_write(bp, phy, ··· 3907 3888 MDIO_PMA_REG_GEN_CTRL, 3908 3889 MDIO_PMA_REG_GEN_CTRL_ROM_RESET_INTERNAL_MP); 3909 3890 3910 - /* wait for 120ms for code download via SPI port */ 3911 - msleep(120); 3891 + /* Delay 100ms per the PHY specifications */ 3892 + msleep(100); 3893 + 3894 + /* 8073 sometimes taking longer to download */ 3895 + do { 3896 + count++; 3897 + if (count > 300) { 3898 + DP(NETIF_MSG_LINK, 3899 + "bnx2x_8073_8727_external_rom_boot port %x:" 3900 + "Download failed. fw version = 0x%x\n", 3901 + port, fw_ver1); 3902 + rc = -EINVAL; 3903 + break; 3904 + } 3905 + 3906 + bnx2x_cl45_read(bp, phy, 3907 + MDIO_PMA_DEVAD, 3908 + MDIO_PMA_REG_ROM_VER1, &fw_ver1); 3909 + bnx2x_cl45_read(bp, phy, 3910 + MDIO_PMA_DEVAD, 3911 + MDIO_PMA_REG_M8051_MSGOUT_REG, &fw_msgout); 3912 + 3913 + msleep(1); 3914 + } while (fw_ver1 == 0 || fw_ver1 == 0x4321 || 3915 + ((fw_msgout & 0xff) != 0x03 && (phy->type == 3916 + PORT_HW_CFG_XGXS_EXT_PHY_TYPE_BCM8073))); 3912 3917 3913 3918 /* Clear ser_boot_ctl bit */ 3914 3919 bnx2x_cl45_write(bp, phy, 3915 3920 MDIO_PMA_DEVAD, 3916 3921 MDIO_PMA_REG_MISC_CTRL1, 0x0000); 3917 3922 bnx2x_save_bcm_spirom_ver(bp, phy, port); 3923 + 3924 + DP(NETIF_MSG_LINK, 3925 + "bnx2x_8073_8727_external_rom_boot port %x:" 3926 + "Download complete. fw version = 0x%x\n", 3927 + port, fw_ver1); 3928 + 3929 + return rc; 3918 3930 } 3919 3931 3920 3932 static void bnx2x_8073_set_xaui_low_power_mode(struct bnx2x *bp, ··· 4158 4108 4159 4109 DP(NETIF_MSG_LINK, "Before rom RX_ALARM(port1): 0x%x\n", tmp1); 4160 4110 4111 + /** 4112 + * If this is forced speed, set to KR or KX (all other are not 4113 + * supported) 4114 + */ 4115 + /* Swap polarity if required - Must be done only in non-1G mode */ 4116 + if (params->lane_config & PORT_HW_CFG_SWAP_PHY_POLARITY_ENABLED) { 4117 + /* Configure the 8073 to swap _P and _N of the KR lines */ 4118 + DP(NETIF_MSG_LINK, "Swapping polarity for the 8073\n"); 4119 + /* 10G Rx/Tx and 1G Tx signal polarity swap */ 4120 + bnx2x_cl45_read(bp, phy, 4121 + MDIO_PMA_DEVAD, 4122 + MDIO_PMA_REG_8073_OPT_DIGITAL_CTRL, &val); 4123 + bnx2x_cl45_write(bp, phy, 4124 + MDIO_PMA_DEVAD, 4125 + MDIO_PMA_REG_8073_OPT_DIGITAL_CTRL, 4126 + (val | (3<<9))); 4127 + } 4128 + 4129 + 4161 4130 /* Enable CL37 BAM */ 4162 4131 if (REG_RD(bp, params->shmem_base + 4163 4132 offsetof(struct shmem_region, dev_info. ··· 4383 4314 } 4384 4315 4385 4316 if (link_up) { 4317 + /* Swap polarity if required */ 4318 + if (params->lane_config & 4319 + PORT_HW_CFG_SWAP_PHY_POLARITY_ENABLED) { 4320 + /* Configure the 8073 to swap P and N of the KR lines */ 4321 + bnx2x_cl45_read(bp, phy, 4322 + MDIO_XS_DEVAD, 4323 + MDIO_XS_REG_8073_RX_CTRL_PCIE, &val1); 4324 + /** 4325 + * Set bit 3 to invert Rx in 1G mode and clear this bit 4326 + * when it`s in 10G mode. 4327 + */ 4328 + if (vars->line_speed == SPEED_1000) { 4329 + DP(NETIF_MSG_LINK, "Swapping 1G polarity for" 4330 + "the 8073\n"); 4331 + val1 |= (1<<3); 4332 + } else 4333 + val1 &= ~(1<<3); 4334 + 4335 + bnx2x_cl45_write(bp, phy, 4336 + MDIO_XS_DEVAD, 4337 + MDIO_XS_REG_8073_RX_CTRL_PCIE, 4338 + val1); 4339 + } 4386 4340 bnx2x_ext_phy_10G_an_resolve(bp, phy, vars); 4387 4341 bnx2x_8073_resolve_fc(phy, params, vars); 4342 + vars->duplex = DUPLEX_FULL; 4388 4343 } 4389 4344 return link_up; 4390 4345 } ··· 5155 5062 else 5156 5063 vars->line_speed = SPEED_10000; 5157 5064 bnx2x_ext_phy_resolve_fc(phy, params, vars); 5065 + vars->duplex = DUPLEX_FULL; 5158 5066 } 5159 5067 return link_up; 5160 5068 } ··· 5852 5758 DP(NETIF_MSG_LINK, "port %x: External link is down\n", 5853 5759 params->port); 5854 5760 } 5855 - if (link_up) 5761 + if (link_up) { 5856 5762 bnx2x_ext_phy_resolve_fc(phy, params, vars); 5763 + vars->duplex = DUPLEX_FULL; 5764 + DP(NETIF_MSG_LINK, "duplex = 0x%x\n", vars->duplex); 5765 + } 5857 5766 5858 5767 if ((DUAL_MEDIA(params)) && 5859 5768 (phy->req_line_speed == SPEED_1000)) { ··· 5972 5875 MDIO_PMA_REG_8481_LED2_MASK, 5973 5876 0x18); 5974 5877 5878 + /* Select activity source by Tx and Rx, as suggested by PHY AE */ 5975 5879 bnx2x_cl45_write(bp, phy, 5976 5880 MDIO_PMA_DEVAD, 5977 5881 MDIO_PMA_REG_8481_LED3_MASK, 5978 - 0x0040); 5882 + 0x0006); 5883 + 5884 + /* Select the closest activity blink rate to that in 10/100/1000 */ 5885 + bnx2x_cl45_write(bp, phy, 5886 + MDIO_PMA_DEVAD, 5887 + MDIO_PMA_REG_8481_LED3_BLINK, 5888 + 0); 5889 + 5890 + bnx2x_cl45_read(bp, phy, 5891 + MDIO_PMA_DEVAD, 5892 + MDIO_PMA_REG_84823_CTL_LED_CTL_1, &val); 5893 + val |= MDIO_PMA_REG_84823_LED3_STRETCH_EN; /* stretch_en for LED3*/ 5894 + 5895 + bnx2x_cl45_write(bp, phy, 5896 + MDIO_PMA_DEVAD, 5897 + MDIO_PMA_REG_84823_CTL_LED_CTL_1, val); 5979 5898 5980 5899 /* 'Interrupt Mask' */ 5981 5900 bnx2x_cl45_write(bp, phy, ··· 6239 6126 /* Check link 10G */ 6240 6127 if (val2 & (1<<11)) { 6241 6128 vars->line_speed = SPEED_10000; 6129 + vars->duplex = DUPLEX_FULL; 6242 6130 link_up = 1; 6243 6131 bnx2x_ext_phy_10G_an_resolve(bp, phy, vars); 6244 6132 } else { /* Check Legacy speed link */ ··· 6603 6489 MDIO_AN_DEVAD, MDIO_AN_REG_MASTER_STATUS, 6604 6490 &val2); 6605 6491 vars->line_speed = SPEED_10000; 6492 + vars->duplex = DUPLEX_FULL; 6606 6493 DP(NETIF_MSG_LINK, "SFX7101 AN status 0x%x->Master=%x\n", 6607 6494 val2, (val2 & (1<<14))); 6608 6495 bnx2x_ext_phy_10G_an_resolve(bp, phy, vars); ··· 7778 7663 7779 7664 /* PART2 - Download firmware to both phys */ 7780 7665 for (port = PORT_MAX - 1; port >= PORT_0; port--) { 7781 - u16 fw_ver1; 7782 7666 if (CHIP_IS_E2(bp)) 7783 7667 port_of_path = 0; 7784 7668 else ··· 7785 7671 7786 7672 DP(NETIF_MSG_LINK, "Loading spirom for phy address 0x%x\n", 7787 7673 phy_blk[port]->addr); 7788 - bnx2x_8073_8727_external_rom_boot(bp, phy_blk[port], 7789 - port_of_path); 7790 - 7791 - bnx2x_cl45_read(bp, phy_blk[port], 7792 - MDIO_PMA_DEVAD, 7793 - MDIO_PMA_REG_ROM_VER1, &fw_ver1); 7794 - if (fw_ver1 == 0 || fw_ver1 == 0x4321) { 7795 - DP(NETIF_MSG_LINK, 7796 - "bnx2x_8073_common_init_phy port %x:" 7797 - "Download failed. fw version = 0x%x\n", 7798 - port, fw_ver1); 7674 + if (bnx2x_8073_8727_external_rom_boot(bp, phy_blk[port], 7675 + port_of_path)) 7799 7676 return -EINVAL; 7800 - } 7801 7677 7802 7678 /* Only set bit 10 = 1 (Tx power down) */ 7803 7679 bnx2x_cl45_read(bp, phy_blk[port], ··· 7952 7848 } 7953 7849 /* PART2 - Download firmware to both phys */ 7954 7850 for (port = PORT_MAX - 1; port >= PORT_0; port--) { 7955 - u16 fw_ver1; 7956 7851 if (CHIP_IS_E2(bp)) 7957 7852 port_of_path = 0; 7958 7853 else 7959 7854 port_of_path = port; 7960 7855 DP(NETIF_MSG_LINK, "Loading spirom for phy address 0x%x\n", 7961 7856 phy_blk[port]->addr); 7962 - bnx2x_8073_8727_external_rom_boot(bp, phy_blk[port], 7963 - port_of_path); 7964 - bnx2x_cl45_read(bp, phy_blk[port], 7965 - MDIO_PMA_DEVAD, 7966 - MDIO_PMA_REG_ROM_VER1, &fw_ver1); 7967 - if (fw_ver1 == 0 || fw_ver1 == 0x4321) { 7968 - DP(NETIF_MSG_LINK, 7969 - "bnx2x_8727_common_init_phy port %x:" 7970 - "Download failed. fw version = 0x%x\n", 7971 - port, fw_ver1); 7857 + if (bnx2x_8073_8727_external_rom_boot(bp, phy_blk[port], 7858 + port_of_path)) 7972 7859 return -EINVAL; 7973 - } 7974 - } 7975 7860 7861 + } 7976 7862 return 0; 7977 7863 } 7978 7864 ··· 8010 7916 u32 shmem2_base_path[], u32 chip_id) 8011 7917 { 8012 7918 u8 rc = 0; 7919 + u32 phy_ver; 8013 7920 u8 phy_index; 8014 7921 u32 ext_phy_type, ext_phy_config; 8015 7922 DP(NETIF_MSG_LINK, "Begin common phy init\n"); 8016 7923 8017 7924 if (CHIP_REV_IS_EMUL(bp)) 8018 7925 return 0; 7926 + 7927 + /* Check if common init was already done */ 7928 + phy_ver = REG_RD(bp, shmem_base_path[0] + 7929 + offsetof(struct shmem_region, 7930 + port_mb[PORT_0].ext_phy_fw_version)); 7931 + if (phy_ver) { 7932 + DP(NETIF_MSG_LINK, "Not doing common init; phy ver is 0x%x\n", 7933 + phy_ver); 7934 + return 0; 7935 + } 8019 7936 8020 7937 /* Read the ext_phy_type for arbitrary port(0) */ 8021 7938 for (phy_index = EXT_PHY1; phy_index < MAX_PHYS;
+4
drivers/net/bnx2x/bnx2x_reg.h
··· 6194 6194 #define MDIO_CTL_REG_84823_MEDIA_PRIORITY_COPPER 0x0000 6195 6195 #define MDIO_CTL_REG_84823_MEDIA_PRIORITY_FIBER 0x0100 6196 6196 #define MDIO_CTL_REG_84823_MEDIA_FIBER_1G 0x1000 6197 + #define MDIO_CTL_REG_84823_USER_CTRL_REG 0x4005 6198 + #define MDIO_CTL_REG_84823_USER_CTRL_CMS 0x0080 6197 6199 6200 + #define MDIO_PMA_REG_84823_CTL_LED_CTL_1 0xa8e3 6201 + #define MDIO_PMA_REG_84823_LED3_STRETCH_EN 0x0080 6198 6202 6199 6203 #define IGU_FUNC_BASE 0x0400 6200 6204
+1 -1
drivers/net/gianfar.c
··· 1920 1920 if (err) { 1921 1921 for (j = 0; j < i; j++) 1922 1922 free_grp_irqs(&priv->gfargrp[j]); 1923 - goto irq_fail; 1923 + goto irq_fail; 1924 1924 } 1925 1925 } 1926 1926
+12 -2
drivers/net/irda/sh_irda.c
··· 635 635 636 636 ret = sh_irda_set_baudrate(self, speed); 637 637 if (ret < 0) 638 - return ret; 638 + goto sh_irda_hard_xmit_end; 639 639 640 640 self->tx_buff.len = 0; 641 641 if (skb->len) { ··· 652 652 653 653 sh_irda_write(self, IRTFLR, self->tx_buff.len); 654 654 sh_irda_write(self, IRTCTR, ARMOD | TE); 655 - } 655 + } else 656 + goto sh_irda_hard_xmit_end; 656 657 657 658 dev_kfree_skb(skb); 658 659 659 660 return 0; 661 + 662 + sh_irda_hard_xmit_end: 663 + sh_irda_set_baudrate(self, 9600); 664 + netif_wake_queue(self->ndev); 665 + sh_irda_rcv_ctrl(self, 1); 666 + dev_kfree_skb(skb); 667 + 668 + return ret; 669 + 660 670 } 661 671 662 672 static int sh_irda_ioctl(struct net_device *ndev, struct ifreq *ifreq, int cmd)
+2 -3
drivers/net/ns83820.c
··· 1988 1988 } 1989 1989 1990 1990 ndev = alloc_etherdev(sizeof(struct ns83820)); 1991 - dev = PRIV(ndev); 1992 - 1993 1991 err = -ENOMEM; 1994 - if (!dev) 1992 + if (!ndev) 1995 1993 goto out; 1996 1994 1995 + dev = PRIV(ndev); 1997 1996 dev->ndev = ndev; 1998 1997 1999 1998 spin_lock_init(&dev->rx_info.lock);
+12 -7
drivers/net/usb/cdc_ncm.c
··· 54 54 #include <linux/usb/usbnet.h> 55 55 #include <linux/usb/cdc.h> 56 56 57 - #define DRIVER_VERSION "30-Nov-2010" 57 + #define DRIVER_VERSION "17-Jan-2011" 58 58 59 59 /* CDC NCM subclass 3.2.1 */ 60 60 #define USB_CDC_NCM_NDP16_LENGTH_MIN 0x10 ··· 868 868 if (ctx->tx_timer_pending != 0) { 869 869 ctx->tx_timer_pending--; 870 870 restart = 1; 871 - } else 871 + } else { 872 872 restart = 0; 873 + } 873 874 874 875 spin_unlock(&ctx->mtx); 875 876 876 - if (restart) 877 + if (restart) { 878 + spin_lock(&ctx->mtx); 877 879 cdc_ncm_tx_timeout_start(ctx); 878 - else if (ctx->netdev != NULL) 880 + spin_unlock(&ctx->mtx); 881 + } else if (ctx->netdev != NULL) { 879 882 usbnet_start_xmit(NULL, ctx->netdev); 883 + } 880 884 } 881 885 882 886 static struct sk_buff * ··· 904 900 skb_out = cdc_ncm_fill_tx_frame(ctx, skb); 905 901 if (ctx->tx_curr_skb != NULL) 906 902 need_timer = 1; 907 - spin_unlock(&ctx->mtx); 908 903 909 904 /* Start timer, if there is a remaining skb */ 910 905 if (need_timer) ··· 911 908 912 909 if (skb_out) 913 910 dev->net->stats.tx_packets += ctx->tx_curr_frame_num; 911 + 912 + spin_unlock(&ctx->mtx); 914 913 return skb_out; 915 914 916 915 error: ··· 1025 1020 if (((offset + temp) > actlen) || 1026 1021 (temp > CDC_NCM_MAX_DATAGRAM_SIZE) || (temp < ETH_HLEN)) { 1027 1022 pr_debug("invalid frame detected (ignored)" 1028 - "offset[%u]=%u, length=%u, skb=%p\n", 1029 - x, offset, temp, skb_in); 1023 + "offset[%u]=%u, length=%u, skb=%p\n", 1024 + x, offset, temp, skb_in); 1030 1025 if (!x) 1031 1026 goto error; 1032 1027 break;
+62 -31
drivers/net/vmxnet3/vmxnet3_drv.c
··· 48 48 static int enable_mq = 1; 49 49 static int irq_share_mode; 50 50 51 + static void 52 + vmxnet3_write_mac_addr(struct vmxnet3_adapter *adapter, u8 *mac); 53 + 51 54 /* 52 55 * Enable/Disable the given intr 53 56 */ ··· 142 139 { 143 140 u32 ret; 144 141 int i; 142 + unsigned long flags; 145 143 144 + spin_lock_irqsave(&adapter->cmd_lock, flags); 146 145 VMXNET3_WRITE_BAR1_REG(adapter, VMXNET3_REG_CMD, VMXNET3_CMD_GET_LINK); 147 146 ret = VMXNET3_READ_BAR1_REG(adapter, VMXNET3_REG_CMD); 147 + spin_unlock_irqrestore(&adapter->cmd_lock, flags); 148 + 148 149 adapter->link_speed = ret >> 16; 149 150 if (ret & 1) { /* Link is up. */ 150 151 printk(KERN_INFO "%s: NIC Link is Up %d Mbps\n", ··· 190 183 191 184 /* Check if there is an error on xmit/recv queues */ 192 185 if (events & (VMXNET3_ECR_TQERR | VMXNET3_ECR_RQERR)) { 186 + spin_lock(&adapter->cmd_lock); 193 187 VMXNET3_WRITE_BAR1_REG(adapter, VMXNET3_REG_CMD, 194 188 VMXNET3_CMD_GET_QUEUE_STATUS); 189 + spin_unlock(&adapter->cmd_lock); 195 190 196 191 for (i = 0; i < adapter->num_tx_queues; i++) 197 192 if (adapter->tqd_start[i].status.stopped) ··· 813 804 skb_transport_header(skb))->doff * 4; 814 805 ctx->copy_size = ctx->eth_ip_hdr_size + ctx->l4_hdr_size; 815 806 } else { 816 - unsigned int pull_size; 817 - 818 807 if (skb->ip_summed == CHECKSUM_PARTIAL) { 819 808 ctx->eth_ip_hdr_size = skb_checksum_start_offset(skb); 820 809 821 810 if (ctx->ipv4) { 822 811 struct iphdr *iph = (struct iphdr *) 823 812 skb_network_header(skb); 824 - if (iph->protocol == IPPROTO_TCP) { 825 - pull_size = ctx->eth_ip_hdr_size + 826 - sizeof(struct tcphdr); 827 - 828 - if (unlikely(!pskb_may_pull(skb, 829 - pull_size))) { 830 - goto err; 831 - } 813 + if (iph->protocol == IPPROTO_TCP) 832 814 ctx->l4_hdr_size = ((struct tcphdr *) 833 815 skb_transport_header(skb))->doff * 4; 834 - } else if (iph->protocol == IPPROTO_UDP) { 816 + else if (iph->protocol == IPPROTO_UDP) 817 + /* 818 + * Use tcp header size so that bytes to 819 + * be copied are more than required by 820 + * the device. 821 + */ 835 822 ctx->l4_hdr_size = 836 - sizeof(struct udphdr); 837 - } else { 823 + sizeof(struct tcphdr); 824 + else 838 825 ctx->l4_hdr_size = 0; 839 - } 840 826 } else { 841 827 /* for simplicity, don't copy L4 headers */ 842 828 ctx->l4_hdr_size = 0; ··· 1863 1859 struct vmxnet3_adapter *adapter = netdev_priv(netdev); 1864 1860 struct Vmxnet3_DriverShared *shared = adapter->shared; 1865 1861 u32 *vfTable = adapter->shared->devRead.rxFilterConf.vfTable; 1862 + unsigned long flags; 1866 1863 1867 1864 if (grp) { 1868 1865 /* add vlan rx stripping. */ 1869 1866 if (adapter->netdev->features & NETIF_F_HW_VLAN_RX) { 1870 1867 int i; 1871 - struct Vmxnet3_DSDevRead *devRead = &shared->devRead; 1872 1868 adapter->vlan_grp = grp; 1873 1869 1874 - /* update FEATURES to device */ 1875 - devRead->misc.uptFeatures |= UPT1_F_RXVLAN; 1876 - VMXNET3_WRITE_BAR1_REG(adapter, VMXNET3_REG_CMD, 1877 - VMXNET3_CMD_UPDATE_FEATURE); 1878 1870 /* 1879 1871 * Clear entire vfTable; then enable untagged pkts. 1880 1872 * Note: setting one entry in vfTable to non-zero turns ··· 1880 1880 vfTable[i] = 0; 1881 1881 1882 1882 VMXNET3_SET_VFTABLE_ENTRY(vfTable, 0); 1883 + spin_lock_irqsave(&adapter->cmd_lock, flags); 1883 1884 VMXNET3_WRITE_BAR1_REG(adapter, VMXNET3_REG_CMD, 1884 1885 VMXNET3_CMD_UPDATE_VLAN_FILTERS); 1886 + spin_unlock_irqrestore(&adapter->cmd_lock, flags); 1885 1887 } else { 1886 1888 printk(KERN_ERR "%s: vlan_rx_register when device has " 1887 1889 "no NETIF_F_HW_VLAN_RX\n", netdev->name); ··· 1902 1900 */ 1903 1901 vfTable[i] = 0; 1904 1902 } 1903 + spin_lock_irqsave(&adapter->cmd_lock, flags); 1905 1904 VMXNET3_WRITE_BAR1_REG(adapter, VMXNET3_REG_CMD, 1906 1905 VMXNET3_CMD_UPDATE_VLAN_FILTERS); 1907 - 1908 - /* update FEATURES to device */ 1909 - devRead->misc.uptFeatures &= ~UPT1_F_RXVLAN; 1910 - VMXNET3_WRITE_BAR1_REG(adapter, VMXNET3_REG_CMD, 1911 - VMXNET3_CMD_UPDATE_FEATURE); 1906 + spin_unlock_irqrestore(&adapter->cmd_lock, flags); 1912 1907 } 1913 1908 } 1914 1909 } ··· 1938 1939 { 1939 1940 struct vmxnet3_adapter *adapter = netdev_priv(netdev); 1940 1941 u32 *vfTable = adapter->shared->devRead.rxFilterConf.vfTable; 1942 + unsigned long flags; 1941 1943 1942 1944 VMXNET3_SET_VFTABLE_ENTRY(vfTable, vid); 1945 + spin_lock_irqsave(&adapter->cmd_lock, flags); 1943 1946 VMXNET3_WRITE_BAR1_REG(adapter, VMXNET3_REG_CMD, 1944 1947 VMXNET3_CMD_UPDATE_VLAN_FILTERS); 1948 + spin_unlock_irqrestore(&adapter->cmd_lock, flags); 1945 1949 } 1946 1950 1947 1951 ··· 1953 1951 { 1954 1952 struct vmxnet3_adapter *adapter = netdev_priv(netdev); 1955 1953 u32 *vfTable = adapter->shared->devRead.rxFilterConf.vfTable; 1954 + unsigned long flags; 1956 1955 1957 1956 VMXNET3_CLEAR_VFTABLE_ENTRY(vfTable, vid); 1957 + spin_lock_irqsave(&adapter->cmd_lock, flags); 1958 1958 VMXNET3_WRITE_BAR1_REG(adapter, VMXNET3_REG_CMD, 1959 1959 VMXNET3_CMD_UPDATE_VLAN_FILTERS); 1960 + spin_unlock_irqrestore(&adapter->cmd_lock, flags); 1960 1961 } 1961 1962 1962 1963 ··· 1990 1985 vmxnet3_set_mc(struct net_device *netdev) 1991 1986 { 1992 1987 struct vmxnet3_adapter *adapter = netdev_priv(netdev); 1988 + unsigned long flags; 1993 1989 struct Vmxnet3_RxFilterConf *rxConf = 1994 1990 &adapter->shared->devRead.rxFilterConf; 1995 1991 u8 *new_table = NULL; ··· 2026 2020 rxConf->mfTablePA = 0; 2027 2021 } 2028 2022 2023 + spin_lock_irqsave(&adapter->cmd_lock, flags); 2029 2024 if (new_mode != rxConf->rxMode) { 2030 2025 rxConf->rxMode = cpu_to_le32(new_mode); 2031 2026 VMXNET3_WRITE_BAR1_REG(adapter, VMXNET3_REG_CMD, ··· 2035 2028 2036 2029 VMXNET3_WRITE_BAR1_REG(adapter, VMXNET3_REG_CMD, 2037 2030 VMXNET3_CMD_UPDATE_MAC_FILTERS); 2031 + spin_unlock_irqrestore(&adapter->cmd_lock, flags); 2038 2032 2039 2033 kfree(new_table); 2040 2034 } ··· 2088 2080 devRead->misc.uptFeatures |= UPT1_F_LRO; 2089 2081 devRead->misc.maxNumRxSG = cpu_to_le16(1 + MAX_SKB_FRAGS); 2090 2082 } 2091 - if ((adapter->netdev->features & NETIF_F_HW_VLAN_RX) && 2092 - adapter->vlan_grp) { 2083 + if (adapter->netdev->features & NETIF_F_HW_VLAN_RX) 2093 2084 devRead->misc.uptFeatures |= UPT1_F_RXVLAN; 2094 - } 2095 2085 2096 2086 devRead->misc.mtu = cpu_to_le32(adapter->netdev->mtu); 2097 2087 devRead->misc.queueDescPA = cpu_to_le64(adapter->queue_desc_pa); ··· 2174 2168 /* rx filter settings */ 2175 2169 devRead->rxFilterConf.rxMode = 0; 2176 2170 vmxnet3_restore_vlan(adapter); 2171 + vmxnet3_write_mac_addr(adapter, adapter->netdev->dev_addr); 2172 + 2177 2173 /* the rest are already zeroed */ 2178 2174 } 2179 2175 ··· 2185 2177 { 2186 2178 int err, i; 2187 2179 u32 ret; 2180 + unsigned long flags; 2188 2181 2189 2182 dev_dbg(&adapter->netdev->dev, "%s: skb_buf_size %d, rx_buf_per_pkt %d," 2190 2183 " ring sizes %u %u %u\n", adapter->netdev->name, ··· 2215 2206 adapter->shared_pa)); 2216 2207 VMXNET3_WRITE_BAR1_REG(adapter, VMXNET3_REG_DSAH, VMXNET3_GET_ADDR_HI( 2217 2208 adapter->shared_pa)); 2209 + spin_lock_irqsave(&adapter->cmd_lock, flags); 2218 2210 VMXNET3_WRITE_BAR1_REG(adapter, VMXNET3_REG_CMD, 2219 2211 VMXNET3_CMD_ACTIVATE_DEV); 2220 2212 ret = VMXNET3_READ_BAR1_REG(adapter, VMXNET3_REG_CMD); 2213 + spin_unlock_irqrestore(&adapter->cmd_lock, flags); 2221 2214 2222 2215 if (ret != 0) { 2223 2216 printk(KERN_ERR "Failed to activate dev %s: error %u\n", ··· 2266 2255 void 2267 2256 vmxnet3_reset_dev(struct vmxnet3_adapter *adapter) 2268 2257 { 2258 + unsigned long flags; 2259 + spin_lock_irqsave(&adapter->cmd_lock, flags); 2269 2260 VMXNET3_WRITE_BAR1_REG(adapter, VMXNET3_REG_CMD, VMXNET3_CMD_RESET_DEV); 2261 + spin_unlock_irqrestore(&adapter->cmd_lock, flags); 2270 2262 } 2271 2263 2272 2264 ··· 2277 2263 vmxnet3_quiesce_dev(struct vmxnet3_adapter *adapter) 2278 2264 { 2279 2265 int i; 2266 + unsigned long flags; 2280 2267 if (test_and_set_bit(VMXNET3_STATE_BIT_QUIESCED, &adapter->state)) 2281 2268 return 0; 2282 2269 2283 2270 2271 + spin_lock_irqsave(&adapter->cmd_lock, flags); 2284 2272 VMXNET3_WRITE_BAR1_REG(adapter, VMXNET3_REG_CMD, 2285 2273 VMXNET3_CMD_QUIESCE_DEV); 2274 + spin_unlock_irqrestore(&adapter->cmd_lock, flags); 2286 2275 vmxnet3_disable_all_intrs(adapter); 2287 2276 2288 2277 for (i = 0; i < adapter->num_rx_queues; i++) ··· 2443 2426 sz = adapter->rx_buf_per_pkt * VMXNET3_RING_SIZE_ALIGN; 2444 2427 ring0_size = adapter->rx_queue[0].rx_ring[0].size; 2445 2428 ring0_size = (ring0_size + sz - 1) / sz * sz; 2446 - ring0_size = min_t(u32, rq->rx_ring[0].size, VMXNET3_RX_RING_MAX_SIZE / 2429 + ring0_size = min_t(u32, ring0_size, VMXNET3_RX_RING_MAX_SIZE / 2447 2430 sz * sz); 2448 2431 ring1_size = adapter->rx_queue[0].rx_ring[1].size; 2449 2432 comp_size = ring0_size + ring1_size; ··· 2712 2695 break; 2713 2696 } else { 2714 2697 /* If fails to enable required number of MSI-x vectors 2715 - * try enabling 3 of them. One each for rx, tx and event 2698 + * try enabling minimum number of vectors required. 2716 2699 */ 2717 2700 vectors = vector_threshold; 2718 2701 printk(KERN_ERR "Failed to enable %d MSI-X for %s, try" ··· 2735 2718 u32 cfg; 2736 2719 2737 2720 /* intr settings */ 2721 + spin_lock(&adapter->cmd_lock); 2738 2722 VMXNET3_WRITE_BAR1_REG(adapter, VMXNET3_REG_CMD, 2739 2723 VMXNET3_CMD_GET_CONF_INTR); 2740 2724 cfg = VMXNET3_READ_BAR1_REG(adapter, VMXNET3_REG_CMD); 2725 + spin_unlock(&adapter->cmd_lock); 2741 2726 adapter->intr.type = cfg & 0x3; 2742 2727 adapter->intr.mask_mode = (cfg >> 2) & 0x3; 2743 2728 ··· 2774 2755 */ 2775 2756 if (err == VMXNET3_LINUX_MIN_MSIX_VECT) { 2776 2757 if (adapter->share_intr != VMXNET3_INTR_BUDDYSHARE 2777 - || adapter->num_rx_queues != 2) { 2758 + || adapter->num_rx_queues != 1) { 2778 2759 adapter->share_intr = VMXNET3_INTR_TXSHARE; 2779 2760 printk(KERN_ERR "Number of rx queues : 1\n"); 2780 2761 adapter->num_rx_queues = 1; ··· 2924 2905 adapter->netdev = netdev; 2925 2906 adapter->pdev = pdev; 2926 2907 2908 + spin_lock_init(&adapter->cmd_lock); 2927 2909 adapter->shared = pci_alloc_consistent(adapter->pdev, 2928 2910 sizeof(struct Vmxnet3_DriverShared), 2929 2911 &adapter->shared_pa); ··· 3128 3108 u8 *arpreq; 3129 3109 struct in_device *in_dev; 3130 3110 struct in_ifaddr *ifa; 3111 + unsigned long flags; 3131 3112 int i = 0; 3132 3113 3133 3114 if (!netif_running(netdev)) 3134 3115 return 0; 3116 + 3117 + for (i = 0; i < adapter->num_rx_queues; i++) 3118 + napi_disable(&adapter->rx_queue[i].napi); 3135 3119 3136 3120 vmxnet3_disable_all_intrs(adapter); 3137 3121 vmxnet3_free_irqs(adapter); ··· 3212 3188 adapter->shared->devRead.pmConfDesc.confPA = cpu_to_le64(virt_to_phys( 3213 3189 pmConf)); 3214 3190 3191 + spin_lock_irqsave(&adapter->cmd_lock, flags); 3215 3192 VMXNET3_WRITE_BAR1_REG(adapter, VMXNET3_REG_CMD, 3216 3193 VMXNET3_CMD_UPDATE_PMCFG); 3194 + spin_unlock_irqrestore(&adapter->cmd_lock, flags); 3217 3195 3218 3196 pci_save_state(pdev); 3219 3197 pci_enable_wake(pdev, pci_choose_state(pdev, PMSG_SUSPEND), ··· 3230 3204 static int 3231 3205 vmxnet3_resume(struct device *device) 3232 3206 { 3233 - int err; 3207 + int err, i = 0; 3208 + unsigned long flags; 3234 3209 struct pci_dev *pdev = to_pci_dev(device); 3235 3210 struct net_device *netdev = pci_get_drvdata(pdev); 3236 3211 struct vmxnet3_adapter *adapter = netdev_priv(netdev); ··· 3259 3232 3260 3233 pci_enable_wake(pdev, PCI_D0, 0); 3261 3234 3235 + spin_lock_irqsave(&adapter->cmd_lock, flags); 3262 3236 VMXNET3_WRITE_BAR1_REG(adapter, VMXNET3_REG_CMD, 3263 3237 VMXNET3_CMD_UPDATE_PMCFG); 3238 + spin_unlock_irqrestore(&adapter->cmd_lock, flags); 3264 3239 vmxnet3_alloc_intr_resources(adapter); 3265 3240 vmxnet3_request_irqs(adapter); 3241 + for (i = 0; i < adapter->num_rx_queues; i++) 3242 + napi_enable(&adapter->rx_queue[i].napi); 3266 3243 vmxnet3_enable_all_intrs(adapter); 3267 3244 3268 3245 return 0;
+154 -108
drivers/net/vmxnet3/vmxnet3_ethtool.c
··· 45 45 vmxnet3_set_rx_csum(struct net_device *netdev, u32 val) 46 46 { 47 47 struct vmxnet3_adapter *adapter = netdev_priv(netdev); 48 + unsigned long flags; 48 49 49 50 if (adapter->rxcsum != val) { 50 51 adapter->rxcsum = val; ··· 57 56 adapter->shared->devRead.misc.uptFeatures &= 58 57 ~UPT1_F_RXCSUM; 59 58 59 + spin_lock_irqsave(&adapter->cmd_lock, flags); 60 60 VMXNET3_WRITE_BAR1_REG(adapter, VMXNET3_REG_CMD, 61 61 VMXNET3_CMD_UPDATE_FEATURE); 62 + spin_unlock_irqrestore(&adapter->cmd_lock, flags); 62 63 } 63 64 } 64 65 return 0; ··· 71 68 static const struct vmxnet3_stat_desc 72 69 vmxnet3_tq_dev_stats[] = { 73 70 /* description, offset */ 74 - { "TSO pkts tx", offsetof(struct UPT1_TxStats, TSOPktsTxOK) }, 75 - { "TSO bytes tx", offsetof(struct UPT1_TxStats, TSOBytesTxOK) }, 76 - { "ucast pkts tx", offsetof(struct UPT1_TxStats, ucastPktsTxOK) }, 77 - { "ucast bytes tx", offsetof(struct UPT1_TxStats, ucastBytesTxOK) }, 78 - { "mcast pkts tx", offsetof(struct UPT1_TxStats, mcastPktsTxOK) }, 79 - { "mcast bytes tx", offsetof(struct UPT1_TxStats, mcastBytesTxOK) }, 80 - { "bcast pkts tx", offsetof(struct UPT1_TxStats, bcastPktsTxOK) }, 81 - { "bcast bytes tx", offsetof(struct UPT1_TxStats, bcastBytesTxOK) }, 82 - { "pkts tx err", offsetof(struct UPT1_TxStats, pktsTxError) }, 83 - { "pkts tx discard", offsetof(struct UPT1_TxStats, pktsTxDiscard) }, 71 + { "Tx Queue#", 0 }, 72 + { " TSO pkts tx", offsetof(struct UPT1_TxStats, TSOPktsTxOK) }, 73 + { " TSO bytes tx", offsetof(struct UPT1_TxStats, TSOBytesTxOK) }, 74 + { " ucast pkts tx", offsetof(struct UPT1_TxStats, ucastPktsTxOK) }, 75 + { " ucast bytes tx", offsetof(struct UPT1_TxStats, ucastBytesTxOK) }, 76 + { " mcast pkts tx", offsetof(struct UPT1_TxStats, mcastPktsTxOK) }, 77 + { " mcast bytes tx", offsetof(struct UPT1_TxStats, mcastBytesTxOK) }, 78 + { " bcast pkts tx", offsetof(struct UPT1_TxStats, bcastPktsTxOK) }, 79 + { " bcast bytes tx", offsetof(struct UPT1_TxStats, bcastBytesTxOK) }, 80 + { " pkts tx err", offsetof(struct UPT1_TxStats, pktsTxError) }, 81 + { " pkts tx discard", offsetof(struct UPT1_TxStats, pktsTxDiscard) }, 84 82 }; 85 83 86 84 /* per tq stats maintained by the driver */ 87 85 static const struct vmxnet3_stat_desc 88 86 vmxnet3_tq_driver_stats[] = { 89 87 /* description, offset */ 90 - {"drv dropped tx total", offsetof(struct vmxnet3_tq_driver_stats, 91 - drop_total) }, 92 - { " too many frags", offsetof(struct vmxnet3_tq_driver_stats, 93 - drop_too_many_frags) }, 94 - { " giant hdr", offsetof(struct vmxnet3_tq_driver_stats, 95 - drop_oversized_hdr) }, 96 - { " hdr err", offsetof(struct vmxnet3_tq_driver_stats, 97 - drop_hdr_inspect_err) }, 98 - { " tso", offsetof(struct vmxnet3_tq_driver_stats, 99 - drop_tso) }, 100 - { "ring full", offsetof(struct vmxnet3_tq_driver_stats, 101 - tx_ring_full) }, 102 - { "pkts linearized", offsetof(struct vmxnet3_tq_driver_stats, 103 - linearized) }, 104 - { "hdr cloned", offsetof(struct vmxnet3_tq_driver_stats, 105 - copy_skb_header) }, 106 - { "giant hdr", offsetof(struct vmxnet3_tq_driver_stats, 107 - oversized_hdr) }, 88 + {" drv dropped tx total", offsetof(struct vmxnet3_tq_driver_stats, 89 + drop_total) }, 90 + { " too many frags", offsetof(struct vmxnet3_tq_driver_stats, 91 + drop_too_many_frags) }, 92 + { " giant hdr", offsetof(struct vmxnet3_tq_driver_stats, 93 + drop_oversized_hdr) }, 94 + { " hdr err", offsetof(struct vmxnet3_tq_driver_stats, 95 + drop_hdr_inspect_err) }, 96 + { " tso", offsetof(struct vmxnet3_tq_driver_stats, 97 + drop_tso) }, 98 + { " ring full", offsetof(struct vmxnet3_tq_driver_stats, 99 + tx_ring_full) }, 100 + { " pkts linearized", offsetof(struct vmxnet3_tq_driver_stats, 101 + linearized) }, 102 + { " hdr cloned", offsetof(struct vmxnet3_tq_driver_stats, 103 + copy_skb_header) }, 104 + { " giant hdr", offsetof(struct vmxnet3_tq_driver_stats, 105 + oversized_hdr) }, 108 106 }; 109 107 110 108 /* per rq stats maintained by the device */ 111 109 static const struct vmxnet3_stat_desc 112 110 vmxnet3_rq_dev_stats[] = { 113 - { "LRO pkts rx", offsetof(struct UPT1_RxStats, LROPktsRxOK) }, 114 - { "LRO byte rx", offsetof(struct UPT1_RxStats, LROBytesRxOK) }, 115 - { "ucast pkts rx", offsetof(struct UPT1_RxStats, ucastPktsRxOK) }, 116 - { "ucast bytes rx", offsetof(struct UPT1_RxStats, ucastBytesRxOK) }, 117 - { "mcast pkts rx", offsetof(struct UPT1_RxStats, mcastPktsRxOK) }, 118 - { "mcast bytes rx", offsetof(struct UPT1_RxStats, mcastBytesRxOK) }, 119 - { "bcast pkts rx", offsetof(struct UPT1_RxStats, bcastPktsRxOK) }, 120 - { "bcast bytes rx", offsetof(struct UPT1_RxStats, bcastBytesRxOK) }, 121 - { "pkts rx out of buf", offsetof(struct UPT1_RxStats, pktsRxOutOfBuf) }, 122 - { "pkts rx err", offsetof(struct UPT1_RxStats, pktsRxError) }, 111 + { "Rx Queue#", 0 }, 112 + { " LRO pkts rx", offsetof(struct UPT1_RxStats, LROPktsRxOK) }, 113 + { " LRO byte rx", offsetof(struct UPT1_RxStats, LROBytesRxOK) }, 114 + { " ucast pkts rx", offsetof(struct UPT1_RxStats, ucastPktsRxOK) }, 115 + { " ucast bytes rx", offsetof(struct UPT1_RxStats, ucastBytesRxOK) }, 116 + { " mcast pkts rx", offsetof(struct UPT1_RxStats, mcastPktsRxOK) }, 117 + { " mcast bytes rx", offsetof(struct UPT1_RxStats, mcastBytesRxOK) }, 118 + { " bcast pkts rx", offsetof(struct UPT1_RxStats, bcastPktsRxOK) }, 119 + { " bcast bytes rx", offsetof(struct UPT1_RxStats, bcastBytesRxOK) }, 120 + { " pkts rx OOB", offsetof(struct UPT1_RxStats, pktsRxOutOfBuf) }, 121 + { " pkts rx err", offsetof(struct UPT1_RxStats, pktsRxError) }, 123 122 }; 124 123 125 124 /* per rq stats maintained by the driver */ 126 125 static const struct vmxnet3_stat_desc 127 126 vmxnet3_rq_driver_stats[] = { 128 127 /* description, offset */ 129 - { "drv dropped rx total", offsetof(struct vmxnet3_rq_driver_stats, 130 - drop_total) }, 131 - { " err", offsetof(struct vmxnet3_rq_driver_stats, 132 - drop_err) }, 133 - { " fcs", offsetof(struct vmxnet3_rq_driver_stats, 134 - drop_fcs) }, 135 - { "rx buf alloc fail", offsetof(struct vmxnet3_rq_driver_stats, 136 - rx_buf_alloc_failure) }, 128 + { " drv dropped rx total", offsetof(struct vmxnet3_rq_driver_stats, 129 + drop_total) }, 130 + { " err", offsetof(struct vmxnet3_rq_driver_stats, 131 + drop_err) }, 132 + { " fcs", offsetof(struct vmxnet3_rq_driver_stats, 133 + drop_fcs) }, 134 + { " rx buf alloc fail", offsetof(struct vmxnet3_rq_driver_stats, 135 + rx_buf_alloc_failure) }, 137 136 }; 138 137 139 138 /* gloabl stats maintained by the driver */ 140 139 static const struct vmxnet3_stat_desc 141 140 vmxnet3_global_stats[] = { 142 141 /* description, offset */ 143 - { "tx timeout count", offsetof(struct vmxnet3_adapter, 142 + { "tx timeout count", offsetof(struct vmxnet3_adapter, 144 143 tx_timeout_count) } 145 144 }; 146 145 ··· 156 151 struct UPT1_TxStats *devTxStats; 157 152 struct UPT1_RxStats *devRxStats; 158 153 struct net_device_stats *net_stats = &netdev->stats; 154 + unsigned long flags; 159 155 int i; 160 156 161 157 adapter = netdev_priv(netdev); 162 158 163 159 /* Collect the dev stats into the shared area */ 160 + spin_lock_irqsave(&adapter->cmd_lock, flags); 164 161 VMXNET3_WRITE_BAR1_REG(adapter, VMXNET3_REG_CMD, VMXNET3_CMD_GET_STATS); 162 + spin_unlock_irqrestore(&adapter->cmd_lock, flags); 165 163 166 164 memset(net_stats, 0, sizeof(*net_stats)); 167 165 for (i = 0; i < adapter->num_tx_queues; i++) { ··· 201 193 static int 202 194 vmxnet3_get_sset_count(struct net_device *netdev, int sset) 203 195 { 196 + struct vmxnet3_adapter *adapter = netdev_priv(netdev); 204 197 switch (sset) { 205 198 case ETH_SS_STATS: 206 - return ARRAY_SIZE(vmxnet3_tq_dev_stats) + 207 - ARRAY_SIZE(vmxnet3_tq_driver_stats) + 208 - ARRAY_SIZE(vmxnet3_rq_dev_stats) + 209 - ARRAY_SIZE(vmxnet3_rq_driver_stats) + 199 + return (ARRAY_SIZE(vmxnet3_tq_dev_stats) + 200 + ARRAY_SIZE(vmxnet3_tq_driver_stats)) * 201 + adapter->num_tx_queues + 202 + (ARRAY_SIZE(vmxnet3_rq_dev_stats) + 203 + ARRAY_SIZE(vmxnet3_rq_driver_stats)) * 204 + adapter->num_rx_queues + 210 205 ARRAY_SIZE(vmxnet3_global_stats); 211 206 default: 212 207 return -EOPNOTSUPP; ··· 217 206 } 218 207 219 208 209 + /* Should be multiple of 4 */ 210 + #define NUM_TX_REGS 8 211 + #define NUM_RX_REGS 12 212 + 220 213 static int 221 214 vmxnet3_get_regs_len(struct net_device *netdev) 222 215 { 223 - return 20 * sizeof(u32); 216 + struct vmxnet3_adapter *adapter = netdev_priv(netdev); 217 + return (adapter->num_tx_queues * NUM_TX_REGS * sizeof(u32) + 218 + adapter->num_rx_queues * NUM_RX_REGS * sizeof(u32)); 224 219 } 225 220 226 221 ··· 257 240 static void 258 241 vmxnet3_get_strings(struct net_device *netdev, u32 stringset, u8 *buf) 259 242 { 243 + struct vmxnet3_adapter *adapter = netdev_priv(netdev); 260 244 if (stringset == ETH_SS_STATS) { 261 - int i; 245 + int i, j; 246 + for (j = 0; j < adapter->num_tx_queues; j++) { 247 + for (i = 0; i < ARRAY_SIZE(vmxnet3_tq_dev_stats); i++) { 248 + memcpy(buf, vmxnet3_tq_dev_stats[i].desc, 249 + ETH_GSTRING_LEN); 250 + buf += ETH_GSTRING_LEN; 251 + } 252 + for (i = 0; i < ARRAY_SIZE(vmxnet3_tq_driver_stats); 253 + i++) { 254 + memcpy(buf, vmxnet3_tq_driver_stats[i].desc, 255 + ETH_GSTRING_LEN); 256 + buf += ETH_GSTRING_LEN; 257 + } 258 + } 262 259 263 - for (i = 0; i < ARRAY_SIZE(vmxnet3_tq_dev_stats); i++) { 264 - memcpy(buf, vmxnet3_tq_dev_stats[i].desc, 265 - ETH_GSTRING_LEN); 266 - buf += ETH_GSTRING_LEN; 260 + for (j = 0; j < adapter->num_rx_queues; j++) { 261 + for (i = 0; i < ARRAY_SIZE(vmxnet3_rq_dev_stats); i++) { 262 + memcpy(buf, vmxnet3_rq_dev_stats[i].desc, 263 + ETH_GSTRING_LEN); 264 + buf += ETH_GSTRING_LEN; 265 + } 266 + for (i = 0; i < ARRAY_SIZE(vmxnet3_rq_driver_stats); 267 + i++) { 268 + memcpy(buf, vmxnet3_rq_driver_stats[i].desc, 269 + ETH_GSTRING_LEN); 270 + buf += ETH_GSTRING_LEN; 271 + } 267 272 } 268 - for (i = 0; i < ARRAY_SIZE(vmxnet3_tq_driver_stats); i++) { 269 - memcpy(buf, vmxnet3_tq_driver_stats[i].desc, 270 - ETH_GSTRING_LEN); 271 - buf += ETH_GSTRING_LEN; 272 - } 273 - for (i = 0; i < ARRAY_SIZE(vmxnet3_rq_dev_stats); i++) { 274 - memcpy(buf, vmxnet3_rq_dev_stats[i].desc, 275 - ETH_GSTRING_LEN); 276 - buf += ETH_GSTRING_LEN; 277 - } 278 - for (i = 0; i < ARRAY_SIZE(vmxnet3_rq_driver_stats); i++) { 279 - memcpy(buf, vmxnet3_rq_driver_stats[i].desc, 280 - ETH_GSTRING_LEN); 281 - buf += ETH_GSTRING_LEN; 282 - } 273 + 283 274 for (i = 0; i < ARRAY_SIZE(vmxnet3_global_stats); i++) { 284 275 memcpy(buf, vmxnet3_global_stats[i].desc, 285 276 ETH_GSTRING_LEN); ··· 302 277 struct vmxnet3_adapter *adapter = netdev_priv(netdev); 303 278 u8 lro_requested = (data & ETH_FLAG_LRO) == 0 ? 0 : 1; 304 279 u8 lro_present = (netdev->features & NETIF_F_LRO) == 0 ? 0 : 1; 280 + unsigned long flags; 305 281 306 282 if (data & ~ETH_FLAG_LRO) 307 283 return -EOPNOTSUPP; ··· 318 292 else 319 293 adapter->shared->devRead.misc.uptFeatures &= 320 294 ~UPT1_F_LRO; 295 + spin_lock_irqsave(&adapter->cmd_lock, flags); 321 296 VMXNET3_WRITE_BAR1_REG(adapter, VMXNET3_REG_CMD, 322 297 VMXNET3_CMD_UPDATE_FEATURE); 298 + spin_unlock_irqrestore(&adapter->cmd_lock, flags); 323 299 } 324 300 return 0; 325 301 } ··· 331 303 struct ethtool_stats *stats, u64 *buf) 332 304 { 333 305 struct vmxnet3_adapter *adapter = netdev_priv(netdev); 306 + unsigned long flags; 334 307 u8 *base; 335 308 int i; 336 309 int j = 0; 337 310 311 + spin_lock_irqsave(&adapter->cmd_lock, flags); 338 312 VMXNET3_WRITE_BAR1_REG(adapter, VMXNET3_REG_CMD, VMXNET3_CMD_GET_STATS); 313 + spin_unlock_irqrestore(&adapter->cmd_lock, flags); 339 314 340 315 /* this does assume each counter is 64-bit wide */ 341 - /* TODO change this for multiple queues */ 316 + for (j = 0; j < adapter->num_tx_queues; j++) { 317 + base = (u8 *)&adapter->tqd_start[j].stats; 318 + *buf++ = (u64)j; 319 + for (i = 1; i < ARRAY_SIZE(vmxnet3_tq_dev_stats); i++) 320 + *buf++ = *(u64 *)(base + 321 + vmxnet3_tq_dev_stats[i].offset); 342 322 343 - base = (u8 *)&adapter->tqd_start[j].stats; 344 - for (i = 0; i < ARRAY_SIZE(vmxnet3_tq_dev_stats); i++) 345 - *buf++ = *(u64 *)(base + vmxnet3_tq_dev_stats[i].offset); 323 + base = (u8 *)&adapter->tx_queue[j].stats; 324 + for (i = 0; i < ARRAY_SIZE(vmxnet3_tq_driver_stats); i++) 325 + *buf++ = *(u64 *)(base + 326 + vmxnet3_tq_driver_stats[i].offset); 327 + } 346 328 347 - base = (u8 *)&adapter->tx_queue[j].stats; 348 - for (i = 0; i < ARRAY_SIZE(vmxnet3_tq_driver_stats); i++) 349 - *buf++ = *(u64 *)(base + vmxnet3_tq_driver_stats[i].offset); 329 + for (j = 0; j < adapter->num_tx_queues; j++) { 330 + base = (u8 *)&adapter->rqd_start[j].stats; 331 + *buf++ = (u64) j; 332 + for (i = 1; i < ARRAY_SIZE(vmxnet3_rq_dev_stats); i++) 333 + *buf++ = *(u64 *)(base + 334 + vmxnet3_rq_dev_stats[i].offset); 350 335 351 - base = (u8 *)&adapter->rqd_start[j].stats; 352 - for (i = 0; i < ARRAY_SIZE(vmxnet3_rq_dev_stats); i++) 353 - *buf++ = *(u64 *)(base + vmxnet3_rq_dev_stats[i].offset); 354 - 355 - base = (u8 *)&adapter->rx_queue[j].stats; 356 - for (i = 0; i < ARRAY_SIZE(vmxnet3_rq_driver_stats); i++) 357 - *buf++ = *(u64 *)(base + vmxnet3_rq_driver_stats[i].offset); 336 + base = (u8 *)&adapter->rx_queue[j].stats; 337 + for (i = 0; i < ARRAY_SIZE(vmxnet3_rq_driver_stats); i++) 338 + *buf++ = *(u64 *)(base + 339 + vmxnet3_rq_driver_stats[i].offset); 340 + } 358 341 359 342 base = (u8 *)adapter; 360 343 for (i = 0; i < ARRAY_SIZE(vmxnet3_global_stats); i++) ··· 378 339 { 379 340 struct vmxnet3_adapter *adapter = netdev_priv(netdev); 380 341 u32 *buf = p; 381 - int i = 0; 342 + int i = 0, j = 0; 382 343 383 344 memset(p, 0, vmxnet3_get_regs_len(netdev)); 384 345 ··· 387 348 /* Update vmxnet3_get_regs_len if we want to dump more registers */ 388 349 389 350 /* make each ring use multiple of 16 bytes */ 390 - /* TODO change this for multiple queues */ 391 - buf[0] = adapter->tx_queue[i].tx_ring.next2fill; 392 - buf[1] = adapter->tx_queue[i].tx_ring.next2comp; 393 - buf[2] = adapter->tx_queue[i].tx_ring.gen; 394 - buf[3] = 0; 351 + for (i = 0; i < adapter->num_tx_queues; i++) { 352 + buf[j++] = adapter->tx_queue[i].tx_ring.next2fill; 353 + buf[j++] = adapter->tx_queue[i].tx_ring.next2comp; 354 + buf[j++] = adapter->tx_queue[i].tx_ring.gen; 355 + buf[j++] = 0; 395 356 396 - buf[4] = adapter->tx_queue[i].comp_ring.next2proc; 397 - buf[5] = adapter->tx_queue[i].comp_ring.gen; 398 - buf[6] = adapter->tx_queue[i].stopped; 399 - buf[7] = 0; 357 + buf[j++] = adapter->tx_queue[i].comp_ring.next2proc; 358 + buf[j++] = adapter->tx_queue[i].comp_ring.gen; 359 + buf[j++] = adapter->tx_queue[i].stopped; 360 + buf[j++] = 0; 361 + } 400 362 401 - buf[8] = adapter->rx_queue[i].rx_ring[0].next2fill; 402 - buf[9] = adapter->rx_queue[i].rx_ring[0].next2comp; 403 - buf[10] = adapter->rx_queue[i].rx_ring[0].gen; 404 - buf[11] = 0; 363 + for (i = 0; i < adapter->num_rx_queues; i++) { 364 + buf[j++] = adapter->rx_queue[i].rx_ring[0].next2fill; 365 + buf[j++] = adapter->rx_queue[i].rx_ring[0].next2comp; 366 + buf[j++] = adapter->rx_queue[i].rx_ring[0].gen; 367 + buf[j++] = 0; 405 368 406 - buf[12] = adapter->rx_queue[i].rx_ring[1].next2fill; 407 - buf[13] = adapter->rx_queue[i].rx_ring[1].next2comp; 408 - buf[14] = adapter->rx_queue[i].rx_ring[1].gen; 409 - buf[15] = 0; 369 + buf[j++] = adapter->rx_queue[i].rx_ring[1].next2fill; 370 + buf[j++] = adapter->rx_queue[i].rx_ring[1].next2comp; 371 + buf[j++] = adapter->rx_queue[i].rx_ring[1].gen; 372 + buf[j++] = 0; 410 373 411 - buf[16] = adapter->rx_queue[i].comp_ring.next2proc; 412 - buf[17] = adapter->rx_queue[i].comp_ring.gen; 413 - buf[18] = 0; 414 - buf[19] = 0; 374 + buf[j++] = adapter->rx_queue[i].comp_ring.next2proc; 375 + buf[j++] = adapter->rx_queue[i].comp_ring.gen; 376 + buf[j++] = 0; 377 + buf[j++] = 0; 378 + } 379 + 415 380 } 416 381 417 382 ··· 617 574 const struct ethtool_rxfh_indir *p) 618 575 { 619 576 unsigned int i; 577 + unsigned long flags; 620 578 struct vmxnet3_adapter *adapter = netdev_priv(netdev); 621 579 struct UPT1_RSSConf *rssConf = adapter->rss_conf; 622 580 ··· 636 592 for (i = 0; i < rssConf->indTableSize; i++) 637 593 rssConf->indTable[i] = p->ring_index[i]; 638 594 595 + spin_lock_irqsave(&adapter->cmd_lock, flags); 639 596 VMXNET3_WRITE_BAR1_REG(adapter, VMXNET3_REG_CMD, 640 597 VMXNET3_CMD_UPDATE_RSSIDT); 598 + spin_unlock_irqrestore(&adapter->cmd_lock, flags); 641 599 642 600 return 0; 643 601
+4 -3
drivers/net/vmxnet3/vmxnet3_int.h
··· 68 68 /* 69 69 * Version numbers 70 70 */ 71 - #define VMXNET3_DRIVER_VERSION_STRING "1.0.16.0-k" 71 + #define VMXNET3_DRIVER_VERSION_STRING "1.0.25.0-k" 72 72 73 73 /* a 32-bit int, each byte encode a verion number in VMXNET3_DRIVER_VERSION */ 74 - #define VMXNET3_DRIVER_VERSION_NUM 0x01001000 74 + #define VMXNET3_DRIVER_VERSION_NUM 0x01001900 75 75 76 76 #if defined(CONFIG_PCI_MSI) 77 77 /* RSS only makes sense if MSI-X is supported. */ ··· 289 289 290 290 #define VMXNET3_LINUX_MAX_MSIX_VECT (VMXNET3_DEVICE_MAX_TX_QUEUES + \ 291 291 VMXNET3_DEVICE_MAX_RX_QUEUES + 1) 292 - #define VMXNET3_LINUX_MIN_MSIX_VECT 3 /* 1 for each : tx, rx and event */ 292 + #define VMXNET3_LINUX_MIN_MSIX_VECT 2 /* 1 for tx-rx pair and 1 for event */ 293 293 294 294 295 295 struct vmxnet3_intr { ··· 317 317 struct vmxnet3_rx_queue rx_queue[VMXNET3_DEVICE_MAX_RX_QUEUES]; 318 318 struct vlan_group *vlan_grp; 319 319 struct vmxnet3_intr intr; 320 + spinlock_t cmd_lock; 320 321 struct Vmxnet3_DriverShared *shared; 321 322 struct Vmxnet3_PMConf *pm_conf; 322 323 struct Vmxnet3_TxQueueDesc *tqd_start; /* all tx queue desc */
+4
drivers/net/wireless/ath/ath5k/base.c
··· 2294 2294 int i; 2295 2295 bool needreset = false; 2296 2296 2297 + mutex_lock(&sc->lock); 2298 + 2297 2299 for (i = 0; i < ARRAY_SIZE(sc->txqs); i++) { 2298 2300 if (sc->txqs[i].setup) { 2299 2301 txq = &sc->txqs[i]; ··· 2322 2320 "TX queues stuck, resetting\n"); 2323 2321 ath5k_reset(sc, NULL, true); 2324 2322 } 2323 + 2324 + mutex_unlock(&sc->lock); 2325 2325 2326 2326 ieee80211_queue_delayed_work(sc->hw, &sc->tx_complete_work, 2327 2327 msecs_to_jiffies(ATH5K_TX_COMPLETE_POLL_INT));
+5 -5
drivers/net/wireless/ath/ath9k/ar9002_calib.c
··· 679 679 680 680 /* Do NF cal only at longer intervals */ 681 681 if (longcal || nfcal_pending) { 682 - /* Do periodic PAOffset Cal */ 683 - ar9002_hw_pa_cal(ah, false); 684 - ar9002_hw_olc_temp_compensation(ah); 685 - 686 682 /* 687 683 * Get the value from the previous NF cal and update 688 684 * history buffer. ··· 693 697 ath9k_hw_loadnf(ah, ah->curchan); 694 698 } 695 699 696 - if (longcal) 700 + if (longcal) { 697 701 ath9k_hw_start_nfcal(ah, false); 702 + /* Do periodic PAOffset Cal */ 703 + ar9002_hw_pa_cal(ah, false); 704 + ar9002_hw_olc_temp_compensation(ah); 705 + } 698 706 } 699 707 700 708 return iscaldone;
+1 -1
drivers/net/wireless/ath/ath9k/ar9003_2p2_initvals.h
··· 1842 1842 1843 1843 static const u32 ar9300PciePhy_pll_on_clkreq_disable_L1_2p2[][2] = { 1844 1844 /* Addr allmodes */ 1845 - {0x00004040, 0x08212e5e}, 1845 + {0x00004040, 0x0821265e}, 1846 1846 {0x00004040, 0x0008003b}, 1847 1847 {0x00004044, 0x00000000}, 1848 1848 };
+2 -2
drivers/net/wireless/ath/ath9k/ar9003_hw.c
··· 146 146 /* Sleep Setting */ 147 147 148 148 INIT_INI_ARRAY(&ah->iniPcieSerdesLowPower, 149 - ar9300PciePhy_clkreq_enable_L1_2p2, 150 - ARRAY_SIZE(ar9300PciePhy_clkreq_enable_L1_2p2), 149 + ar9300PciePhy_pll_on_clkreq_disable_L1_2p2, 150 + ARRAY_SIZE(ar9300PciePhy_pll_on_clkreq_disable_L1_2p2), 151 151 2); 152 152 153 153 /* Fast clock modal settings */
+1 -1
drivers/net/wireless/ath/ath9k/htc.h
··· 78 78 u8 node_idx; 79 79 u8 vif_idx; 80 80 u8 tidno; 81 - u32 flags; /* ATH9K_HTC_TX_* */ 81 + __be32 flags; /* ATH9K_HTC_TX_* */ 82 82 u8 key_type; 83 83 u8 keyix; 84 84 u8 reserved[26];
+5 -3
drivers/net/wireless/ath/ath9k/htc_drv_txrx.c
··· 113 113 114 114 if (ieee80211_is_data(fc)) { 115 115 struct tx_frame_hdr tx_hdr; 116 + u32 flags = 0; 116 117 u8 *qc; 117 118 118 119 memset(&tx_hdr, 0, sizeof(struct tx_frame_hdr)); ··· 137 136 /* Check for RTS protection */ 138 137 if (priv->hw->wiphy->rts_threshold != (u32) -1) 139 138 if (skb->len > priv->hw->wiphy->rts_threshold) 140 - tx_hdr.flags |= ATH9K_HTC_TX_RTSCTS; 139 + flags |= ATH9K_HTC_TX_RTSCTS; 141 140 142 141 /* CTS-to-self */ 143 - if (!(tx_hdr.flags & ATH9K_HTC_TX_RTSCTS) && 142 + if (!(flags & ATH9K_HTC_TX_RTSCTS) && 144 143 (priv->op_flags & OP_PROTECT_ENABLE)) 145 - tx_hdr.flags |= ATH9K_HTC_TX_CTSONLY; 144 + flags |= ATH9K_HTC_TX_CTSONLY; 146 145 146 + tx_hdr.flags = cpu_to_be32(flags); 147 147 tx_hdr.key_type = ath9k_cmn_get_hw_crypto_keytype(skb); 148 148 if (tx_hdr.key_type == ATH9K_KEY_TYPE_CLEAR) 149 149 tx_hdr.keyix = (u8) ATH9K_TXKEYIX_INVALID;
+1 -1
drivers/net/wireless/iwlwifi/iwl-agn-eeprom.c
··· 168 168 /* not using .cfg overwrite */ 169 169 radio_cfg = iwl_eeprom_query16(priv, EEPROM_RADIO_CONFIG); 170 170 priv->cfg->valid_tx_ant = EEPROM_RF_CFG_TX_ANT_MSK(radio_cfg); 171 - priv->cfg->valid_rx_ant = EEPROM_RF_CFG_TX_ANT_MSK(radio_cfg); 171 + priv->cfg->valid_rx_ant = EEPROM_RF_CFG_RX_ANT_MSK(radio_cfg); 172 172 if (!priv->cfg->valid_tx_ant || !priv->cfg->valid_rx_ant) { 173 173 IWL_ERR(priv, "Invalid chain (0X%x, 0X%x)\n", 174 174 priv->cfg->valid_tx_ant,
+2
drivers/net/wireless/iwmc3200wifi/netdev.c
··· 126 126 ndev = alloc_netdev_mq(0, "wlan%d", ether_setup, IWM_TX_QUEUES); 127 127 if (!ndev) { 128 128 dev_err(dev, "no memory for network device instance\n"); 129 + ret = -ENOMEM; 129 130 goto out_priv; 130 131 } 131 132 ··· 139 138 GFP_KERNEL); 140 139 if (!iwm->umac_profile) { 141 140 dev_err(dev, "Couldn't alloc memory for profile\n"); 141 + ret = -ENOMEM; 142 142 goto out_profile; 143 143 } 144 144
+1
drivers/net/wireless/rt2x00/rt2x00firmware.c
··· 58 58 59 59 if (!fw || !fw->size || !fw->data) { 60 60 ERROR(rt2x00dev, "Failed to read Firmware.\n"); 61 + release_firmware(fw); 61 62 return -ENOENT; 62 63 } 63 64
+1 -1
drivers/pci/pcie/Kconfig
··· 31 31 # PCI Express ASPM 32 32 # 33 33 config PCIEASPM 34 - bool "PCI Express ASPM control" if EMBEDDED 34 + bool "PCI Express ASPM control" if EXPERT 35 35 depends on PCI && PCIEPORTBUS 36 36 default y 37 37 help
+6 -6
drivers/pcmcia/Kconfig
··· 69 69 config YENTA 70 70 tristate "CardBus yenta-compatible bridge support" 71 71 depends on PCI 72 - select CARDBUS if !EMBEDDED 72 + select CARDBUS if !EXPERT 73 73 select PCCARD_NONSTATIC if PCMCIA != n 74 74 ---help--- 75 75 This option enables support for CardBus host bridges. Virtually ··· 84 84 85 85 config YENTA_O2 86 86 default y 87 - bool "Special initialization for O2Micro bridges" if EMBEDDED 87 + bool "Special initialization for O2Micro bridges" if EXPERT 88 88 depends on YENTA 89 89 90 90 config YENTA_RICOH 91 91 default y 92 - bool "Special initialization for Ricoh bridges" if EMBEDDED 92 + bool "Special initialization for Ricoh bridges" if EXPERT 93 93 depends on YENTA 94 94 95 95 config YENTA_TI 96 96 default y 97 - bool "Special initialization for TI and EnE bridges" if EMBEDDED 97 + bool "Special initialization for TI and EnE bridges" if EXPERT 98 98 depends on YENTA 99 99 100 100 config YENTA_ENE_TUNE 101 101 default y 102 - bool "Auto-tune EnE bridges for CB cards" if EMBEDDED 102 + bool "Auto-tune EnE bridges for CB cards" if EXPERT 103 103 depends on YENTA_TI && CARDBUS 104 104 105 105 config YENTA_TOSHIBA 106 106 default y 107 - bool "Special initialization for Toshiba ToPIC bridges" if EMBEDDED 107 + bool "Special initialization for Toshiba ToPIC bridges" if EXPERT 108 108 depends on YENTA 109 109 110 110 config PD6729
+16 -2
drivers/s390/net/qeth_l2_main.c
··· 831 831 return NETDEV_TX_OK; 832 832 } 833 833 834 - static int qeth_l2_open(struct net_device *dev) 834 + static int __qeth_l2_open(struct net_device *dev) 835 835 { 836 836 struct qeth_card *card = dev->ml_priv; 837 837 int rc = 0; 838 838 839 839 QETH_CARD_TEXT(card, 4, "qethopen"); 840 + if (card->state == CARD_STATE_UP) 841 + return rc; 840 842 if (card->state != CARD_STATE_SOFTSETUP) 841 843 return -ENODEV; 842 844 ··· 857 855 } else 858 856 rc = -EIO; 859 857 return rc; 858 + } 859 + 860 + static int qeth_l2_open(struct net_device *dev) 861 + { 862 + struct qeth_card *card = dev->ml_priv; 863 + 864 + QETH_CARD_TEXT(card, 5, "qethope_"); 865 + if (qeth_wait_for_threads(card, QETH_RECOVER_THREAD)) { 866 + QETH_CARD_TEXT(card, 3, "openREC"); 867 + return -ERESTARTSYS; 868 + } 869 + return __qeth_l2_open(dev); 860 870 } 861 871 862 872 static int qeth_l2_stop(struct net_device *dev) ··· 1060 1046 if (recover_flag == CARD_STATE_RECOVER) { 1061 1047 if (recovery_mode && 1062 1048 card->info.type != QETH_CARD_TYPE_OSN) { 1063 - qeth_l2_open(card->dev); 1049 + __qeth_l2_open(card->dev); 1064 1050 } else { 1065 1051 rtnl_lock(); 1066 1052 dev_open(card->dev);
+19 -3
drivers/s390/net/qeth_l3_main.c
··· 2998 2998 */ 2999 2999 if (iph->protocol == IPPROTO_UDP) 3000 3000 hdr->hdr.l3.ext_flags |= QETH_HDR_EXT_UDP; 3001 - hdr->hdr.l3.ext_flags |= QETH_HDR_EXT_CSUM_TRANSP_REQ; 3001 + hdr->hdr.l3.ext_flags |= QETH_HDR_EXT_CSUM_TRANSP_REQ | 3002 + QETH_HDR_EXT_CSUM_HDR_REQ; 3003 + iph->check = 0; 3002 3004 if (card->options.performance_stats) 3003 3005 card->perf_stats.tx_csum++; 3004 3006 } ··· 3242 3240 return NETDEV_TX_OK; 3243 3241 } 3244 3242 3245 - static int qeth_l3_open(struct net_device *dev) 3243 + static int __qeth_l3_open(struct net_device *dev) 3246 3244 { 3247 3245 struct qeth_card *card = dev->ml_priv; 3248 3246 int rc = 0; 3249 3247 3250 3248 QETH_CARD_TEXT(card, 4, "qethopen"); 3249 + if (card->state == CARD_STATE_UP) 3250 + return rc; 3251 3251 if (card->state != CARD_STATE_SOFTSETUP) 3252 3252 return -ENODEV; 3253 3253 card->data.state = CH_STATE_UP; ··· 3262 3258 } else 3263 3259 rc = -EIO; 3264 3260 return rc; 3261 + } 3262 + 3263 + static int qeth_l3_open(struct net_device *dev) 3264 + { 3265 + struct qeth_card *card = dev->ml_priv; 3266 + 3267 + QETH_CARD_TEXT(card, 5, "qethope_"); 3268 + if (qeth_wait_for_threads(card, QETH_RECOVER_THREAD)) { 3269 + QETH_CARD_TEXT(card, 3, "openREC"); 3270 + return -ERESTARTSYS; 3271 + } 3272 + return __qeth_l3_open(dev); 3265 3273 } 3266 3274 3267 3275 static int qeth_l3_stop(struct net_device *dev) ··· 3580 3564 netif_carrier_off(card->dev); 3581 3565 if (recover_flag == CARD_STATE_RECOVER) { 3582 3566 if (recovery_mode) 3583 - qeth_l3_open(card->dev); 3567 + __qeth_l3_open(card->dev); 3584 3568 else { 3585 3569 rtnl_lock(); 3586 3570 dev_open(card->dev);
drivers/serial/21285.c drivers/tty/serial/21285.c
drivers/serial/68328serial.c drivers/tty/serial/68328serial.c
drivers/serial/68328serial.h drivers/tty/serial/68328serial.h
drivers/serial/68360serial.c drivers/tty/serial/68360serial.c
drivers/serial/8250.c drivers/tty/serial/8250.c
drivers/serial/8250.h drivers/tty/serial/8250.h
drivers/serial/8250_accent.c drivers/tty/serial/8250_accent.c
drivers/serial/8250_acorn.c drivers/tty/serial/8250_acorn.c
drivers/serial/8250_boca.c drivers/tty/serial/8250_boca.c
drivers/serial/8250_early.c drivers/tty/serial/8250_early.c
drivers/serial/8250_exar_st16c554.c drivers/tty/serial/8250_exar_st16c554.c
drivers/serial/8250_fourport.c drivers/tty/serial/8250_fourport.c
drivers/serial/8250_gsc.c drivers/tty/serial/8250_gsc.c
drivers/serial/8250_hp300.c drivers/tty/serial/8250_hp300.c
drivers/serial/8250_hub6.c drivers/tty/serial/8250_hub6.c
drivers/serial/8250_mca.c drivers/tty/serial/8250_mca.c
drivers/serial/8250_pci.c drivers/tty/serial/8250_pci.c
drivers/serial/8250_pnp.c drivers/tty/serial/8250_pnp.c
+2 -2
drivers/serial/Kconfig drivers/tty/serial/Kconfig
··· 81 81 default SERIAL_8250 82 82 83 83 config SERIAL_8250_PCI 84 - tristate "8250/16550 PCI device support" if EMBEDDED 84 + tristate "8250/16550 PCI device support" if EXPERT 85 85 depends on SERIAL_8250 && PCI 86 86 default SERIAL_8250 87 87 help ··· 90 90 Saves about 9K. 91 91 92 92 config SERIAL_8250_PNP 93 - tristate "8250/16550 PNP device support" if EMBEDDED 93 + tristate "8250/16550 PNP device support" if EXPERT 94 94 depends on SERIAL_8250 && PNP 95 95 default SERIAL_8250 96 96 help
drivers/serial/Makefile drivers/tty/serial/Makefile
drivers/serial/altera_jtaguart.c drivers/tty/serial/altera_jtaguart.c
drivers/serial/altera_uart.c drivers/tty/serial/altera_uart.c
drivers/serial/amba-pl010.c drivers/tty/serial/amba-pl010.c
drivers/serial/amba-pl011.c drivers/tty/serial/amba-pl011.c
drivers/serial/apbuart.c drivers/tty/serial/apbuart.c
drivers/serial/apbuart.h drivers/tty/serial/apbuart.h
drivers/serial/atmel_serial.c drivers/tty/serial/atmel_serial.c
drivers/serial/bcm63xx_uart.c drivers/tty/serial/bcm63xx_uart.c
drivers/serial/bfin_5xx.c drivers/tty/serial/bfin_5xx.c
drivers/serial/bfin_sport_uart.c drivers/tty/serial/bfin_sport_uart.c
drivers/serial/bfin_sport_uart.h drivers/tty/serial/bfin_sport_uart.h
drivers/serial/clps711x.c drivers/tty/serial/clps711x.c
drivers/serial/cpm_uart/Makefile drivers/tty/serial/cpm_uart/Makefile
drivers/serial/cpm_uart/cpm_uart.h drivers/tty/serial/cpm_uart/cpm_uart.h
drivers/serial/cpm_uart/cpm_uart_core.c drivers/tty/serial/cpm_uart/cpm_uart_core.c
drivers/serial/cpm_uart/cpm_uart_cpm1.c drivers/tty/serial/cpm_uart/cpm_uart_cpm1.c
drivers/serial/cpm_uart/cpm_uart_cpm1.h drivers/tty/serial/cpm_uart/cpm_uart_cpm1.h
drivers/serial/cpm_uart/cpm_uart_cpm2.c drivers/tty/serial/cpm_uart/cpm_uart_cpm2.c
drivers/serial/cpm_uart/cpm_uart_cpm2.h drivers/tty/serial/cpm_uart/cpm_uart_cpm2.h
drivers/serial/crisv10.c drivers/tty/serial/crisv10.c
drivers/serial/crisv10.h drivers/tty/serial/crisv10.h
drivers/serial/dz.c drivers/tty/serial/dz.c
drivers/serial/dz.h drivers/tty/serial/dz.h
drivers/serial/icom.c drivers/tty/serial/icom.c
drivers/serial/icom.h drivers/tty/serial/icom.h
drivers/serial/ifx6x60.c drivers/tty/serial/ifx6x60.c
drivers/serial/ifx6x60.h drivers/tty/serial/ifx6x60.h
drivers/serial/imx.c drivers/tty/serial/imx.c
drivers/serial/ioc3_serial.c drivers/tty/serial/ioc3_serial.c
drivers/serial/ioc4_serial.c drivers/tty/serial/ioc4_serial.c
drivers/serial/ip22zilog.c drivers/tty/serial/ip22zilog.c
drivers/serial/ip22zilog.h drivers/tty/serial/ip22zilog.h
drivers/serial/jsm/Makefile drivers/tty/serial/jsm/Makefile
drivers/serial/jsm/jsm.h drivers/tty/serial/jsm/jsm.h
drivers/serial/jsm/jsm_driver.c drivers/tty/serial/jsm/jsm_driver.c
drivers/serial/jsm/jsm_neo.c drivers/tty/serial/jsm/jsm_neo.c
drivers/serial/jsm/jsm_tty.c drivers/tty/serial/jsm/jsm_tty.c
drivers/serial/kgdboc.c drivers/tty/serial/kgdboc.c
drivers/serial/m32r_sio.c drivers/tty/serial/m32r_sio.c
drivers/serial/m32r_sio.h drivers/tty/serial/m32r_sio.h
drivers/serial/m32r_sio_reg.h drivers/tty/serial/m32r_sio_reg.h
drivers/serial/max3100.c drivers/tty/serial/max3100.c
drivers/serial/max3107-aava.c drivers/tty/serial/max3107-aava.c
drivers/serial/max3107.c drivers/tty/serial/max3107.c
drivers/serial/max3107.h drivers/tty/serial/max3107.h
drivers/serial/mcf.c drivers/tty/serial/mcf.c
drivers/serial/mfd.c drivers/tty/serial/mfd.c
drivers/serial/mpc52xx_uart.c drivers/tty/serial/mpc52xx_uart.c
drivers/serial/mpsc.c drivers/tty/serial/mpsc.c
drivers/serial/mrst_max3110.c drivers/tty/serial/mrst_max3110.c
drivers/serial/mrst_max3110.h drivers/tty/serial/mrst_max3110.h
drivers/serial/msm_serial.c drivers/tty/serial/msm_serial.c
drivers/serial/msm_serial.h drivers/tty/serial/msm_serial.h
drivers/serial/mux.c drivers/tty/serial/mux.c
drivers/serial/netx-serial.c drivers/tty/serial/netx-serial.c
drivers/serial/nwpserial.c drivers/tty/serial/nwpserial.c
drivers/serial/of_serial.c drivers/tty/serial/of_serial.c
drivers/serial/omap-serial.c drivers/tty/serial/omap-serial.c
drivers/serial/pch_uart.c drivers/tty/serial/pch_uart.c
drivers/serial/pmac_zilog.c drivers/tty/serial/pmac_zilog.c
drivers/serial/pmac_zilog.h drivers/tty/serial/pmac_zilog.h
drivers/serial/pnx8xxx_uart.c drivers/tty/serial/pnx8xxx_uart.c
drivers/serial/pxa.c drivers/tty/serial/pxa.c
drivers/serial/s3c2400.c drivers/tty/serial/s3c2400.c
drivers/serial/s3c2410.c drivers/tty/serial/s3c2410.c
drivers/serial/s3c2412.c drivers/tty/serial/s3c2412.c
drivers/serial/s3c2440.c drivers/tty/serial/s3c2440.c
drivers/serial/s3c24a0.c drivers/tty/serial/s3c24a0.c
drivers/serial/s3c6400.c drivers/tty/serial/s3c6400.c
drivers/serial/s5pv210.c drivers/tty/serial/s5pv210.c
drivers/serial/sa1100.c drivers/tty/serial/sa1100.c
drivers/serial/samsung.c drivers/tty/serial/samsung.c
drivers/serial/samsung.h drivers/tty/serial/samsung.h
drivers/serial/sb1250-duart.c drivers/tty/serial/sb1250-duart.c
drivers/serial/sc26xx.c drivers/tty/serial/sc26xx.c
drivers/serial/serial_core.c drivers/tty/serial/serial_core.c
drivers/serial/serial_cs.c drivers/tty/serial/serial_cs.c
drivers/serial/serial_ks8695.c drivers/tty/serial/serial_ks8695.c
drivers/serial/serial_lh7a40x.c drivers/tty/serial/serial_lh7a40x.c
drivers/serial/serial_txx9.c drivers/tty/serial/serial_txx9.c
drivers/serial/sh-sci.c drivers/tty/serial/sh-sci.c
drivers/serial/sh-sci.h drivers/tty/serial/sh-sci.h
drivers/serial/sn_console.c drivers/tty/serial/sn_console.c
drivers/serial/suncore.c drivers/tty/serial/suncore.c
drivers/serial/suncore.h drivers/tty/serial/suncore.h
drivers/serial/sunhv.c drivers/tty/serial/sunhv.c
drivers/serial/sunsab.c drivers/tty/serial/sunsab.c
drivers/serial/sunsab.h drivers/tty/serial/sunsab.h
drivers/serial/sunsu.c drivers/tty/serial/sunsu.c
drivers/serial/sunzilog.c drivers/tty/serial/sunzilog.c
drivers/serial/sunzilog.h drivers/tty/serial/sunzilog.h
drivers/serial/timbuart.c drivers/tty/serial/timbuart.c
drivers/serial/timbuart.h drivers/tty/serial/timbuart.h
drivers/serial/uartlite.c drivers/tty/serial/uartlite.c
drivers/serial/ucc_uart.c drivers/tty/serial/ucc_uart.c
drivers/serial/vr41xx_siu.c drivers/tty/serial/vr41xx_siu.c
drivers/serial/vt8500_serial.c drivers/tty/serial/vt8500_serial.c
drivers/serial/zs.c drivers/tty/serial/zs.c
drivers/serial/zs.h drivers/tty/serial/zs.h
+1 -1
drivers/ssb/Kconfig
··· 82 82 83 83 config SSB_SILENT 84 84 bool "No SSB kernel messages" 85 - depends on SSB && EMBEDDED 85 + depends on SSB && EXPERT 86 86 help 87 87 This option turns off all Sonics Silicon Backplane printks. 88 88 Note that you won't be able to identify problems, once
+30 -6
drivers/staging/lirc/TODO.lirc_zilog
··· 1 - The binding between hdpvr and lirc_zilog is currently disabled, 1 + 1. Both ir-kbd-i2c and lirc_zilog provide support for RX events. 2 + The 'tx_only' lirc_zilog module parameter will allow ir-kbd-i2c 3 + and lirc_zilog to coexist in the kernel, if the user requires such a set-up. 4 + However the IR unit will not work well without coordination between the 5 + two modules. A shared mutex, for transceiver access locking, needs to be 6 + supplied by bridge drivers, in struct IR_i2_init_data, to both ir-kbd-i2c 7 + and lirc_zilog, before they will coexist usefully. This should be fixed 8 + before moving out of staging. 9 + 10 + 2. References and locking need careful examination. For cx18 and ivtv PCI 11 + cards, which are not easily "hot unplugged", the imperfect state of reference 12 + counting and locking is acceptable if not correct. For USB connected units 13 + like HD PVR, PVR USB2, HVR-1900, and HVR1950, the likelyhood of an Ooops on 14 + unplug is probably great. Proper reference counting and locking needs to be 15 + implemented before this module is moved out of staging. 16 + 17 + 3. The binding between hdpvr and lirc_zilog is currently disabled, 2 18 due to an OOPS reported a few years ago when both the hdpvr and cx18 3 19 drivers were loaded in his system. More details can be seen at: 4 20 http://www.mail-archive.com/linux-media@vger.kernel.org/msg09163.html 5 21 More tests need to be done, in order to fix the reported issue. 6 22 7 - There's a conflict between ir-kbd-i2c: Both provide support for RX events. 8 - Such conflict needs to be fixed, before moving it out of staging. 23 + 4. In addition to providing a shared mutex for transceiver access 24 + locking, bridge drivers, if able, should provide a chip reset() callback 25 + to lirc_zilog via struct IR_i2c_init_data. cx18 and ivtv already have routines 26 + to perform Z8 chip resets via GPIO manipulations. This will allow lirc_zilog 27 + to bring the chip back to normal when it hangs, in the same places the 28 + original lirc_pvr150 driver code does. This is not strictly needed, so it 29 + is not required to move lirc_zilog out of staging. 9 30 10 - The way I2C probe works, it will try to register the driver twice, one 11 - for RX and another for TX. The logic needs to be fixed to avoid such 12 - issue. 31 + 5. Both lirc_zilog and ir-kbd-i2c support the Zilog Z8 for IR, as programmed 32 + and installed on Hauppauge products. When working on either module, developers 33 + must consider at least the following bridge drivers which mention an IR Rx unit 34 + at address 0x71 (indicative of a Z8): 35 + 36 + ivtv cx18 hdpvr pvrusb2 bt8xx cx88 saa7134 13 37
+1
drivers/staging/lirc/lirc_imon.c
··· 447 447 448 448 exit: 449 449 mutex_unlock(&context->ctx_lock); 450 + kfree(data_buf); 450 451 451 452 return (!retval) ? n_bytes : retval; 452 453 }
+1
drivers/staging/lirc/lirc_it87.c
··· 232 232 i++; 233 233 } 234 234 terminate_send(tx_buf[i - 1]); 235 + kfree(tx_buf); 235 236 return n; 236 237 } 237 238
+14 -5
drivers/staging/lirc/lirc_parallel.c
··· 376 376 unsigned long flags; 377 377 int counttimer; 378 378 int *wbuf; 379 + ssize_t ret; 379 380 380 381 if (!is_claimed) 381 382 return -EBUSY; ··· 394 393 if (timer == 0) { 395 394 /* try again if device is ready */ 396 395 timer = init_lirc_timer(); 397 - if (timer == 0) 398 - return -EIO; 396 + if (timer == 0) { 397 + ret = -EIO; 398 + goto out; 399 + } 399 400 } 400 401 401 402 /* adjust values from usecs */ ··· 423 420 if (check_pselecd && (in(1) & LP_PSELECD)) { 424 421 lirc_off(); 425 422 local_irq_restore(flags); 426 - return -EIO; 423 + ret = -EIO; 424 + goto out; 427 425 } 428 426 } while (counttimer < wbuf[i]); 429 427 i++; ··· 440 436 level = newlevel; 441 437 if (check_pselecd && (in(1) & LP_PSELECD)) { 442 438 local_irq_restore(flags); 443 - return -EIO; 439 + ret = -EIO; 440 + goto out; 444 441 } 445 442 } while (counttimer < wbuf[i]); 446 443 i++; ··· 450 445 #else 451 446 /* place code that handles write without external timer here */ 452 447 #endif 453 - return n; 448 + ret = n; 449 + out: 450 + kfree(wbuf); 451 + 452 + return ret; 454 453 } 455 454 456 455 static unsigned int lirc_poll(struct file *file, poll_table *wait)
+1
drivers/staging/lirc/lirc_sasem.c
··· 448 448 exit: 449 449 450 450 mutex_unlock(&context->ctx_lock); 451 + kfree(data_buf); 451 452 452 453 return (!retval) ? n_bytes : retval; 453 454 }
+2 -1
drivers/staging/lirc/lirc_serial.c
··· 966 966 if (n % sizeof(int) || count % 2 == 0) 967 967 return -EINVAL; 968 968 wbuf = memdup_user(buf, n); 969 - if (PTR_ERR(wbuf)) 969 + if (IS_ERR(wbuf)) 970 970 return PTR_ERR(wbuf); 971 971 spin_lock_irqsave(&hardware[type].lock, flags); 972 972 if (type == LIRC_IRDEO) { ··· 981 981 } 982 982 off(); 983 983 spin_unlock_irqrestore(&hardware[type].lock, flags); 984 + kfree(wbuf); 984 985 return n; 985 986 } 986 987
+1
drivers/staging/lirc/lirc_sir.c
··· 330 330 /* enable receiver */ 331 331 Ser2UTCR3 = UTCR3_RXE|UTCR3_RIE; 332 332 #endif 333 + kfree(tx_buf); 333 334 return count; 334 335 } 335 336
+360 -304
drivers/staging/lirc/lirc_zilog.c
··· 20 20 * 21 21 * parts are cut&pasted from the lirc_i2c.c driver 22 22 * 23 + * Numerous changes updating lirc_zilog.c in kernel 2.6.38 and later are 24 + * Copyright (C) 2011 Andy Walls <awalls@md.metrocast.net> 25 + * 23 26 * This program is free software; you can redistribute it and/or modify 24 27 * it under the terms of the GNU General Public License as published by 25 28 * the Free Software Foundation; either version 2 of the License, or ··· 63 60 #include <media/lirc_dev.h> 64 61 #include <media/lirc.h> 65 62 66 - struct IR { 67 - struct lirc_driver l; 68 - 69 - /* Device info */ 70 - struct mutex ir_lock; 71 - int open; 72 - bool is_hdpvr; 73 - 63 + struct IR_rx { 74 64 /* RX device */ 75 - struct i2c_client c_rx; 76 - int have_rx; 65 + struct i2c_client *c; 77 66 78 67 /* RX device buffer & lock */ 79 68 struct lirc_buffer buf; 80 69 struct mutex buf_lock; 81 70 82 71 /* RX polling thread data */ 83 - struct completion *t_notify; 84 - struct completion *t_notify2; 85 - int shutdown; 86 72 struct task_struct *task; 87 73 88 74 /* RX read data */ 89 75 unsigned char b[3]; 76 + bool hdpvr_data_fmt; 77 + }; 90 78 79 + struct IR_tx { 91 80 /* TX device */ 92 - struct i2c_client c_tx; 81 + struct i2c_client *c; 82 + 83 + /* TX additional actions needed */ 93 84 int need_boot; 94 - int have_tx; 85 + bool post_tx_ready_poll; 86 + }; 87 + 88 + struct IR { 89 + struct lirc_driver l; 90 + 91 + struct mutex ir_lock; 92 + int open; 93 + 94 + struct i2c_adapter *adapter; 95 + struct IR_rx *rx; 96 + struct IR_tx *tx; 95 97 }; 96 98 97 99 /* Minor -> data mapping */ 100 + static struct mutex ir_devices_lock; 98 101 static struct IR *ir_devices[MAX_IRCTL_DEVICES]; 99 102 100 103 /* Block size for IR transmitter */ ··· 133 124 #define zilog_notify(s, args...) printk(KERN_NOTICE KBUILD_MODNAME ": " s, \ 134 125 ## args) 135 126 #define zilog_error(s, args...) printk(KERN_ERR KBUILD_MODNAME ": " s, ## args) 136 - 137 - #define ZILOG_HAUPPAUGE_IR_RX_NAME "Zilog/Hauppauge IR RX" 138 - #define ZILOG_HAUPPAUGE_IR_TX_NAME "Zilog/Hauppauge IR TX" 127 + #define zilog_info(s, args...) printk(KERN_INFO KBUILD_MODNAME ": " s, ## args) 139 128 140 129 /* module parameters */ 141 130 static int debug; /* debug output */ 142 - static int disable_rx; /* disable RX device */ 143 - static int disable_tx; /* disable TX device */ 131 + static int tx_only; /* only handle the IR Tx function */ 144 132 static int minor = -1; /* minor number */ 145 133 146 134 #define dprintk(fmt, args...) \ ··· 156 150 int ret; 157 151 int failures = 0; 158 152 unsigned char sendbuf[1] = { 0 }; 153 + struct IR_rx *rx = ir->rx; 159 154 160 - if (lirc_buffer_full(&ir->buf)) { 155 + if (rx == NULL) 156 + return -ENXIO; 157 + 158 + if (lirc_buffer_full(&rx->buf)) { 161 159 dprintk("buffer overflow\n"); 162 160 return -EOVERFLOW; 163 161 } ··· 171 161 * data and we have space 172 162 */ 173 163 do { 164 + if (kthread_should_stop()) 165 + return -ENODATA; 166 + 174 167 /* 175 168 * Lock i2c bus for the duration. RX/TX chips interfere so 176 169 * this is worth it 177 170 */ 178 171 mutex_lock(&ir->ir_lock); 179 172 173 + if (kthread_should_stop()) { 174 + mutex_unlock(&ir->ir_lock); 175 + return -ENODATA; 176 + } 177 + 180 178 /* 181 179 * Send random "poll command" (?) Windows driver does this 182 180 * and it is a good point to detect chip failure. 183 181 */ 184 - ret = i2c_master_send(&ir->c_rx, sendbuf, 1); 182 + ret = i2c_master_send(rx->c, sendbuf, 1); 185 183 if (ret != 1) { 186 184 zilog_error("i2c_master_send failed with %d\n", ret); 187 185 if (failures >= 3) { ··· 204 186 "trying reset\n"); 205 187 206 188 set_current_state(TASK_UNINTERRUPTIBLE); 189 + if (kthread_should_stop()) { 190 + mutex_unlock(&ir->ir_lock); 191 + return -ENODATA; 192 + } 207 193 schedule_timeout((100 * HZ + 999) / 1000); 208 - ir->need_boot = 1; 194 + ir->tx->need_boot = 1; 209 195 210 196 ++failures; 211 197 mutex_unlock(&ir->ir_lock); 212 198 continue; 213 199 } 214 200 215 - ret = i2c_master_recv(&ir->c_rx, keybuf, sizeof(keybuf)); 201 + if (kthread_should_stop()) { 202 + mutex_unlock(&ir->ir_lock); 203 + return -ENODATA; 204 + } 205 + ret = i2c_master_recv(rx->c, keybuf, sizeof(keybuf)); 216 206 mutex_unlock(&ir->ir_lock); 217 207 if (ret != sizeof(keybuf)) { 218 208 zilog_error("i2c_master_recv failed with %d -- " 219 209 "keeping last read buffer\n", ret); 220 210 } else { 221 - ir->b[0] = keybuf[3]; 222 - ir->b[1] = keybuf[4]; 223 - ir->b[2] = keybuf[5]; 224 - dprintk("key (0x%02x/0x%02x)\n", ir->b[0], ir->b[1]); 211 + rx->b[0] = keybuf[3]; 212 + rx->b[1] = keybuf[4]; 213 + rx->b[2] = keybuf[5]; 214 + dprintk("key (0x%02x/0x%02x)\n", rx->b[0], rx->b[1]); 225 215 } 226 216 227 217 /* key pressed ? */ 228 - if (ir->is_hdpvr) { 218 + if (rx->hdpvr_data_fmt) { 229 219 if (got_data && (keybuf[0] == 0x80)) 230 220 return 0; 231 221 else if (got_data && (keybuf[0] == 0x00)) 232 222 return -ENODATA; 233 - } else if ((ir->b[0] & 0x80) == 0) 223 + } else if ((rx->b[0] & 0x80) == 0) 234 224 return got_data ? 0 : -ENODATA; 235 225 236 226 /* look what we have */ 237 - code = (((__u16)ir->b[0] & 0x7f) << 6) | (ir->b[1] >> 2); 227 + code = (((__u16)rx->b[0] & 0x7f) << 6) | (rx->b[1] >> 2); 238 228 239 229 codes[0] = (code >> 8) & 0xff; 240 230 codes[1] = code & 0xff; 241 231 242 232 /* return it */ 243 - lirc_buffer_write(&ir->buf, codes); 233 + lirc_buffer_write(&rx->buf, codes); 244 234 ++got_data; 245 - } while (!lirc_buffer_full(&ir->buf)); 235 + } while (!lirc_buffer_full(&rx->buf)); 246 236 247 237 return 0; 248 238 } ··· 268 242 static int lirc_thread(void *arg) 269 243 { 270 244 struct IR *ir = arg; 271 - 272 - if (ir->t_notify != NULL) 273 - complete(ir->t_notify); 245 + struct IR_rx *rx = ir->rx; 274 246 275 247 dprintk("poll thread started\n"); 276 248 277 - do { 278 - if (ir->open) { 279 - set_current_state(TASK_INTERRUPTIBLE); 249 + while (!kthread_should_stop()) { 250 + set_current_state(TASK_INTERRUPTIBLE); 280 251 281 - /* 282 - * This is ~113*2 + 24 + jitter (2*repeat gap + 283 - * code length). We use this interval as the chip 284 - * resets every time you poll it (bad!). This is 285 - * therefore just sufficient to catch all of the 286 - * button presses. It makes the remote much more 287 - * responsive. You can see the difference by 288 - * running irw and holding down a button. With 289 - * 100ms, the old polling interval, you'll notice 290 - * breaks in the repeat sequence corresponding to 291 - * lost keypresses. 292 - */ 293 - schedule_timeout((260 * HZ) / 1000); 294 - if (ir->shutdown) 295 - break; 296 - if (!add_to_buf(ir)) 297 - wake_up_interruptible(&ir->buf.wait_poll); 298 - } else { 299 - /* if device not opened so we can sleep half a second */ 300 - set_current_state(TASK_INTERRUPTIBLE); 252 + /* if device not opened, we can sleep half a second */ 253 + if (!ir->open) { 301 254 schedule_timeout(HZ/2); 255 + continue; 302 256 } 303 - } while (!ir->shutdown); 304 257 305 - if (ir->t_notify2 != NULL) 306 - wait_for_completion(ir->t_notify2); 307 - 308 - ir->task = NULL; 309 - if (ir->t_notify != NULL) 310 - complete(ir->t_notify); 258 + /* 259 + * This is ~113*2 + 24 + jitter (2*repeat gap + code length). 260 + * We use this interval as the chip resets every time you poll 261 + * it (bad!). This is therefore just sufficient to catch all 262 + * of the button presses. It makes the remote much more 263 + * responsive. You can see the difference by running irw and 264 + * holding down a button. With 100ms, the old polling 265 + * interval, you'll notice breaks in the repeat sequence 266 + * corresponding to lost keypresses. 267 + */ 268 + schedule_timeout((260 * HZ) / 1000); 269 + if (kthread_should_stop()) 270 + break; 271 + if (!add_to_buf(ir)) 272 + wake_up_interruptible(&rx->buf.wait_poll); 273 + } 311 274 312 275 dprintk("poll thread ended\n"); 313 276 return 0; ··· 314 299 * this is completely broken code. lirc_unregister_driver() 315 300 * must be possible even when the device is open 316 301 */ 317 - if (ir->c_rx.addr) 318 - i2c_use_client(&ir->c_rx); 319 - if (ir->c_tx.addr) 320 - i2c_use_client(&ir->c_tx); 302 + if (ir->rx != NULL) 303 + i2c_use_client(ir->rx->c); 304 + if (ir->tx != NULL) 305 + i2c_use_client(ir->tx->c); 321 306 322 307 return 0; 323 308 } ··· 326 311 { 327 312 struct IR *ir = data; 328 313 329 - if (ir->c_rx.addr) 330 - i2c_release_client(&ir->c_rx); 331 - if (ir->c_tx.addr) 332 - i2c_release_client(&ir->c_tx); 314 + if (ir->rx) 315 + i2c_release_client(ir->rx->c); 316 + if (ir->tx) 317 + i2c_release_client(ir->tx->c); 333 318 if (ir->l.owner != NULL) 334 319 module_put(ir->l.owner); 335 320 } ··· 468 453 } 469 454 470 455 /* send a block of data to the IR TX device */ 471 - static int send_data_block(struct IR *ir, unsigned char *data_block) 456 + static int send_data_block(struct IR_tx *tx, unsigned char *data_block) 472 457 { 473 458 int i, j, ret; 474 459 unsigned char buf[5]; ··· 482 467 buf[1 + j] = data_block[i + j]; 483 468 dprintk("%02x %02x %02x %02x %02x", 484 469 buf[0], buf[1], buf[2], buf[3], buf[4]); 485 - ret = i2c_master_send(&ir->c_tx, buf, tosend + 1); 470 + ret = i2c_master_send(tx->c, buf, tosend + 1); 486 471 if (ret != tosend + 1) { 487 472 zilog_error("i2c_master_send failed with %d\n", ret); 488 473 return ret < 0 ? ret : -EFAULT; ··· 493 478 } 494 479 495 480 /* send boot data to the IR TX device */ 496 - static int send_boot_data(struct IR *ir) 481 + static int send_boot_data(struct IR_tx *tx) 497 482 { 498 483 int ret; 499 484 unsigned char buf[4]; 500 485 501 486 /* send the boot block */ 502 - ret = send_data_block(ir, tx_data->boot_data); 487 + ret = send_data_block(tx, tx_data->boot_data); 503 488 if (ret != 0) 504 489 return ret; 505 490 506 491 /* kick it off? */ 507 492 buf[0] = 0x00; 508 493 buf[1] = 0x20; 509 - ret = i2c_master_send(&ir->c_tx, buf, 2); 494 + ret = i2c_master_send(tx->c, buf, 2); 510 495 if (ret != 2) { 511 496 zilog_error("i2c_master_send failed with %d\n", ret); 512 497 return ret < 0 ? ret : -EFAULT; 513 498 } 514 - ret = i2c_master_send(&ir->c_tx, buf, 1); 499 + ret = i2c_master_send(tx->c, buf, 1); 515 500 if (ret != 1) { 516 501 zilog_error("i2c_master_send failed with %d\n", ret); 517 502 return ret < 0 ? ret : -EFAULT; 518 503 } 519 504 520 505 /* Here comes the firmware version... (hopefully) */ 521 - ret = i2c_master_recv(&ir->c_tx, buf, 4); 506 + ret = i2c_master_recv(tx->c, buf, 4); 522 507 if (ret != 4) { 523 508 zilog_error("i2c_master_recv failed with %d\n", ret); 524 509 return 0; ··· 558 543 } 559 544 560 545 /* load "firmware" for the IR TX device */ 561 - static int fw_load(struct IR *ir) 546 + static int fw_load(struct IR_tx *tx) 562 547 { 563 548 int ret; 564 549 unsigned int i; ··· 573 558 } 574 559 575 560 /* Request codeset data file */ 576 - ret = request_firmware(&fw_entry, "haup-ir-blaster.bin", &ir->c_tx.dev); 561 + ret = request_firmware(&fw_entry, "haup-ir-blaster.bin", &tx->c->dev); 577 562 if (ret != 0) { 578 563 zilog_error("firmware haup-ir-blaster.bin not available " 579 564 "(%d)\n", ret); ··· 700 685 } 701 686 702 687 /* initialise the IR TX device */ 703 - static int tx_init(struct IR *ir) 688 + static int tx_init(struct IR_tx *tx) 704 689 { 705 690 int ret; 706 691 707 692 /* Load 'firmware' */ 708 - ret = fw_load(ir); 693 + ret = fw_load(tx); 709 694 if (ret != 0) 710 695 return ret; 711 696 712 697 /* Send boot block */ 713 - ret = send_boot_data(ir); 698 + ret = send_boot_data(tx); 714 699 if (ret != 0) 715 700 return ret; 716 - ir->need_boot = 0; 701 + tx->need_boot = 0; 717 702 718 703 /* Looks good */ 719 704 return 0; ··· 729 714 static ssize_t read(struct file *filep, char *outbuf, size_t n, loff_t *ppos) 730 715 { 731 716 struct IR *ir = filep->private_data; 732 - unsigned char buf[ir->buf.chunk_size]; 717 + struct IR_rx *rx = ir->rx; 733 718 int ret = 0, written = 0; 734 719 DECLARE_WAITQUEUE(wait, current); 735 720 736 721 dprintk("read called\n"); 737 - if (ir->c_rx.addr == 0) 722 + if (rx == NULL) 738 723 return -ENODEV; 739 724 740 - if (mutex_lock_interruptible(&ir->buf_lock)) 725 + if (mutex_lock_interruptible(&rx->buf_lock)) 741 726 return -ERESTARTSYS; 742 727 743 - if (n % ir->buf.chunk_size) { 728 + if (n % rx->buf.chunk_size) { 744 729 dprintk("read result = -EINVAL\n"); 745 - mutex_unlock(&ir->buf_lock); 730 + mutex_unlock(&rx->buf_lock); 746 731 return -EINVAL; 747 732 } 748 733 ··· 751 736 * to avoid losing scan code (in case when queue is awaken somewhere 752 737 * between while condition checking and scheduling) 753 738 */ 754 - add_wait_queue(&ir->buf.wait_poll, &wait); 739 + add_wait_queue(&rx->buf.wait_poll, &wait); 755 740 set_current_state(TASK_INTERRUPTIBLE); 756 741 757 742 /* ··· 759 744 * mode and 'copy_to_user' is happy, wait for data. 760 745 */ 761 746 while (written < n && ret == 0) { 762 - if (lirc_buffer_empty(&ir->buf)) { 747 + if (lirc_buffer_empty(&rx->buf)) { 763 748 /* 764 749 * According to the read(2) man page, 'written' can be 765 750 * returned as less than 'n', instead of blocking ··· 779 764 schedule(); 780 765 set_current_state(TASK_INTERRUPTIBLE); 781 766 } else { 782 - lirc_buffer_read(&ir->buf, buf); 767 + unsigned char buf[rx->buf.chunk_size]; 768 + lirc_buffer_read(&rx->buf, buf); 783 769 ret = copy_to_user((void *)outbuf+written, buf, 784 - ir->buf.chunk_size); 785 - written += ir->buf.chunk_size; 770 + rx->buf.chunk_size); 771 + written += rx->buf.chunk_size; 786 772 } 787 773 } 788 774 789 - remove_wait_queue(&ir->buf.wait_poll, &wait); 775 + remove_wait_queue(&rx->buf.wait_poll, &wait); 790 776 set_current_state(TASK_RUNNING); 791 - mutex_unlock(&ir->buf_lock); 777 + mutex_unlock(&rx->buf_lock); 792 778 793 779 dprintk("read result = %s (%d)\n", 794 780 ret ? "-EFAULT" : "OK", ret); ··· 798 782 } 799 783 800 784 /* send a keypress to the IR TX device */ 801 - static int send_code(struct IR *ir, unsigned int code, unsigned int key) 785 + static int send_code(struct IR_tx *tx, unsigned int code, unsigned int key) 802 786 { 803 787 unsigned char data_block[TX_BLOCK_SIZE]; 804 788 unsigned char buf[2]; ··· 815 799 return ret; 816 800 817 801 /* Send the data block */ 818 - ret = send_data_block(ir, data_block); 802 + ret = send_data_block(tx, data_block); 819 803 if (ret != 0) 820 804 return ret; 821 805 822 806 /* Send data block length? */ 823 807 buf[0] = 0x00; 824 808 buf[1] = 0x40; 825 - ret = i2c_master_send(&ir->c_tx, buf, 2); 809 + ret = i2c_master_send(tx->c, buf, 2); 826 810 if (ret != 2) { 827 811 zilog_error("i2c_master_send failed with %d\n", ret); 828 812 return ret < 0 ? ret : -EFAULT; 829 813 } 830 - ret = i2c_master_send(&ir->c_tx, buf, 1); 814 + ret = i2c_master_send(tx->c, buf, 1); 831 815 if (ret != 1) { 832 816 zilog_error("i2c_master_send failed with %d\n", ret); 833 817 return ret < 0 ? ret : -EFAULT; 834 818 } 835 819 836 820 /* Send finished download? */ 837 - ret = i2c_master_recv(&ir->c_tx, buf, 1); 821 + ret = i2c_master_recv(tx->c, buf, 1); 838 822 if (ret != 1) { 839 823 zilog_error("i2c_master_recv failed with %d\n", ret); 840 824 return ret < 0 ? ret : -EFAULT; ··· 848 832 /* Send prepare command? */ 849 833 buf[0] = 0x00; 850 834 buf[1] = 0x80; 851 - ret = i2c_master_send(&ir->c_tx, buf, 2); 835 + ret = i2c_master_send(tx->c, buf, 2); 852 836 if (ret != 2) { 853 837 zilog_error("i2c_master_send failed with %d\n", ret); 854 838 return ret < 0 ? ret : -EFAULT; ··· 859 843 * last i2c_master_recv always fails with a -5, so for now, we're 860 844 * going to skip this whole mess and say we're done on the HD PVR 861 845 */ 862 - if (ir->is_hdpvr) { 846 + if (!tx->post_tx_ready_poll) { 863 847 dprintk("sent code %u, key %u\n", code, key); 864 848 return 0; 865 849 } ··· 873 857 for (i = 0; i < 20; ++i) { 874 858 set_current_state(TASK_UNINTERRUPTIBLE); 875 859 schedule_timeout((50 * HZ + 999) / 1000); 876 - ret = i2c_master_send(&ir->c_tx, buf, 1); 860 + ret = i2c_master_send(tx->c, buf, 1); 877 861 if (ret == 1) 878 862 break; 879 863 dprintk("NAK expected: i2c_master_send " ··· 886 870 } 887 871 888 872 /* Seems to be an 'ok' response */ 889 - i = i2c_master_recv(&ir->c_tx, buf, 1); 873 + i = i2c_master_recv(tx->c, buf, 1); 890 874 if (i != 1) { 891 875 zilog_error("i2c_master_recv failed with %d\n", ret); 892 876 return -EFAULT; ··· 911 895 loff_t *ppos) 912 896 { 913 897 struct IR *ir = filep->private_data; 898 + struct IR_tx *tx = ir->tx; 914 899 size_t i; 915 900 int failures = 0; 916 901 917 - if (ir->c_tx.addr == 0) 902 + if (tx == NULL) 918 903 return -ENODEV; 919 904 920 905 /* Validate user parameters */ ··· 936 919 } 937 920 938 921 /* Send boot data first if required */ 939 - if (ir->need_boot == 1) { 940 - ret = send_boot_data(ir); 922 + if (tx->need_boot == 1) { 923 + ret = send_boot_data(tx); 941 924 if (ret == 0) 942 - ir->need_boot = 0; 925 + tx->need_boot = 0; 943 926 } 944 927 945 928 /* Send the code */ 946 929 if (ret == 0) { 947 - ret = send_code(ir, (unsigned)command >> 16, 930 + ret = send_code(tx, (unsigned)command >> 16, 948 931 (unsigned)command & 0xFFFF); 949 932 if (ret == -EPROTO) { 950 933 mutex_unlock(&ir->ir_lock); ··· 969 952 } 970 953 set_current_state(TASK_UNINTERRUPTIBLE); 971 954 schedule_timeout((100 * HZ + 999) / 1000); 972 - ir->need_boot = 1; 955 + tx->need_boot = 1; 973 956 ++failures; 974 957 } else 975 958 i += sizeof(int); ··· 986 969 static unsigned int poll(struct file *filep, poll_table *wait) 987 970 { 988 971 struct IR *ir = filep->private_data; 972 + struct IR_rx *rx = ir->rx; 989 973 unsigned int ret; 990 974 991 975 dprintk("poll called\n"); 992 - if (ir->c_rx.addr == 0) 976 + if (rx == NULL) 993 977 return -ENODEV; 994 978 995 - mutex_lock(&ir->buf_lock); 979 + mutex_lock(&rx->buf_lock); 996 980 997 - poll_wait(filep, &ir->buf.wait_poll, wait); 981 + poll_wait(filep, &rx->buf.wait_poll, wait); 998 982 999 983 dprintk("poll result = %s\n", 1000 - lirc_buffer_empty(&ir->buf) ? "0" : "POLLIN|POLLRDNORM"); 984 + lirc_buffer_empty(&rx->buf) ? "0" : "POLLIN|POLLRDNORM"); 1001 985 1002 - ret = lirc_buffer_empty(&ir->buf) ? 0 : (POLLIN|POLLRDNORM); 986 + ret = lirc_buffer_empty(&rx->buf) ? 0 : (POLLIN|POLLRDNORM); 1003 987 1004 - mutex_unlock(&ir->buf_lock); 988 + mutex_unlock(&rx->buf_lock); 1005 989 return ret; 1006 990 } 1007 991 ··· 1012 994 int result; 1013 995 unsigned long mode, features = 0; 1014 996 1015 - if (ir->c_rx.addr != 0) 997 + features |= LIRC_CAN_SEND_PULSE; 998 + if (ir->rx != NULL) 1016 999 features |= LIRC_CAN_REC_LIRCCODE; 1017 - if (ir->c_tx.addr != 0) 1018 - features |= LIRC_CAN_SEND_PULSE; 1019 1000 1020 1001 switch (cmd) { 1021 1002 case LIRC_GET_LENGTH: ··· 1041 1024 result = -EINVAL; 1042 1025 break; 1043 1026 case LIRC_GET_SEND_MODE: 1044 - if (!(features&LIRC_CAN_SEND_MASK)) 1045 - return -ENOSYS; 1046 - 1047 1027 result = put_user(LIRC_MODE_PULSE, (unsigned long *) arg); 1048 1028 break; 1049 1029 case LIRC_SET_SEND_MODE: 1050 - if (!(features&LIRC_CAN_SEND_MASK)) 1051 - return -ENOSYS; 1052 - 1053 1030 result = get_user(mode, (unsigned long *) arg); 1054 1031 if (!result && mode != LIRC_MODE_PULSE) 1055 1032 return -EINVAL; ··· 1054 1043 return result; 1055 1044 } 1056 1045 1046 + /* ir_devices_lock must be held */ 1047 + static struct IR *find_ir_device_by_minor(unsigned int minor) 1048 + { 1049 + if (minor >= MAX_IRCTL_DEVICES) 1050 + return NULL; 1051 + 1052 + return ir_devices[minor]; 1053 + } 1054 + 1057 1055 /* 1058 1056 * Open the IR device. Get hold of our IR structure and 1059 1057 * stash it in private_data for the file ··· 1071 1051 { 1072 1052 struct IR *ir; 1073 1053 int ret; 1054 + unsigned int minor = MINOR(node->i_rdev); 1074 1055 1075 1056 /* find our IR struct */ 1076 - unsigned minor = MINOR(node->i_rdev); 1077 - if (minor >= MAX_IRCTL_DEVICES) { 1078 - dprintk("minor %d: open result = -ENODEV\n", 1079 - minor); 1057 + mutex_lock(&ir_devices_lock); 1058 + ir = find_ir_device_by_minor(minor); 1059 + mutex_unlock(&ir_devices_lock); 1060 + 1061 + if (ir == NULL) 1080 1062 return -ENODEV; 1081 - } 1082 - ir = ir_devices[minor]; 1083 1063 1084 1064 /* increment in use count */ 1085 1065 mutex_lock(&ir->ir_lock); ··· 1126 1106 1127 1107 static int ir_remove(struct i2c_client *client); 1128 1108 static int ir_probe(struct i2c_client *client, const struct i2c_device_id *id); 1129 - static int ir_command(struct i2c_client *client, unsigned int cmd, void *arg); 1130 1109 1131 1110 #define ID_FLAG_TX 0x01 1132 1111 #define ID_FLAG_HDPVR 0x02 ··· 1145 1126 }, 1146 1127 .probe = ir_probe, 1147 1128 .remove = ir_remove, 1148 - .command = ir_command, 1149 1129 .id_table = ir_transceiver_id, 1150 1130 }; 1151 1131 ··· 1162 1144 .release = close 1163 1145 }; 1164 1146 1147 + static void destroy_rx_kthread(struct IR_rx *rx) 1148 + { 1149 + /* end up polling thread */ 1150 + if (rx != NULL && !IS_ERR_OR_NULL(rx->task)) { 1151 + kthread_stop(rx->task); 1152 + rx->task = NULL; 1153 + } 1154 + } 1155 + 1156 + /* ir_devices_lock must be held */ 1157 + static int add_ir_device(struct IR *ir) 1158 + { 1159 + int i; 1160 + 1161 + for (i = 0; i < MAX_IRCTL_DEVICES; i++) 1162 + if (ir_devices[i] == NULL) { 1163 + ir_devices[i] = ir; 1164 + break; 1165 + } 1166 + 1167 + return i == MAX_IRCTL_DEVICES ? -ENOMEM : i; 1168 + } 1169 + 1170 + /* ir_devices_lock must be held */ 1171 + static void del_ir_device(struct IR *ir) 1172 + { 1173 + int i; 1174 + 1175 + for (i = 0; i < MAX_IRCTL_DEVICES; i++) 1176 + if (ir_devices[i] == ir) { 1177 + ir_devices[i] = NULL; 1178 + break; 1179 + } 1180 + } 1181 + 1165 1182 static int ir_remove(struct i2c_client *client) 1166 1183 { 1167 1184 struct IR *ir = i2c_get_clientdata(client); 1168 1185 1169 - mutex_lock(&ir->ir_lock); 1186 + mutex_lock(&ir_devices_lock); 1170 1187 1171 - if (ir->have_rx || ir->have_tx) { 1172 - DECLARE_COMPLETION(tn); 1173 - DECLARE_COMPLETION(tn2); 1174 - 1175 - /* end up polling thread */ 1176 - if (ir->task && !IS_ERR(ir->task)) { 1177 - ir->t_notify = &tn; 1178 - ir->t_notify2 = &tn2; 1179 - ir->shutdown = 1; 1180 - wake_up_process(ir->task); 1181 - complete(&tn2); 1182 - wait_for_completion(&tn); 1183 - ir->t_notify = NULL; 1184 - ir->t_notify2 = NULL; 1185 - } 1186 - 1187 - } else { 1188 - mutex_unlock(&ir->ir_lock); 1189 - zilog_error("%s: detached from something we didn't " 1190 - "attach to\n", __func__); 1191 - return -ENODEV; 1188 + if (ir == NULL) { 1189 + /* We destroyed everything when the first client came through */ 1190 + mutex_unlock(&ir_devices_lock); 1191 + return 0; 1192 1192 } 1193 1193 1194 - /* unregister lirc driver */ 1195 - if (ir->l.minor >= 0 && ir->l.minor < MAX_IRCTL_DEVICES) { 1196 - lirc_unregister_driver(ir->l.minor); 1197 - ir_devices[ir->l.minor] = NULL; 1194 + /* Good-bye LIRC */ 1195 + lirc_unregister_driver(ir->l.minor); 1196 + 1197 + /* Good-bye Rx */ 1198 + destroy_rx_kthread(ir->rx); 1199 + if (ir->rx != NULL) { 1200 + if (ir->rx->buf.fifo_initialized) 1201 + lirc_buffer_free(&ir->rx->buf); 1202 + i2c_set_clientdata(ir->rx->c, NULL); 1203 + kfree(ir->rx); 1198 1204 } 1199 1205 1200 - /* free memory */ 1201 - lirc_buffer_free(&ir->buf); 1202 - mutex_unlock(&ir->ir_lock); 1206 + /* Good-bye Tx */ 1207 + i2c_set_clientdata(ir->tx->c, NULL); 1208 + kfree(ir->tx); 1209 + 1210 + /* Good-bye IR */ 1211 + del_ir_device(ir); 1203 1212 kfree(ir); 1204 1213 1214 + mutex_unlock(&ir_devices_lock); 1205 1215 return 0; 1216 + } 1217 + 1218 + 1219 + /* ir_devices_lock must be held */ 1220 + static struct IR *find_ir_device_by_adapter(struct i2c_adapter *adapter) 1221 + { 1222 + int i; 1223 + struct IR *ir = NULL; 1224 + 1225 + for (i = 0; i < MAX_IRCTL_DEVICES; i++) 1226 + if (ir_devices[i] != NULL && 1227 + ir_devices[i]->adapter == adapter) { 1228 + ir = ir_devices[i]; 1229 + break; 1230 + } 1231 + 1232 + return ir; 1206 1233 } 1207 1234 1208 1235 static int ir_probe(struct i2c_client *client, const struct i2c_device_id *id) 1209 1236 { 1210 - struct IR *ir = NULL; 1237 + struct IR *ir; 1211 1238 struct i2c_adapter *adap = client->adapter; 1212 - char buf; 1213 1239 int ret; 1214 - int have_rx = 0, have_tx = 0; 1240 + bool tx_probe = false; 1215 1241 1216 - dprintk("%s: adapter name (%s) nr %d, i2c_device_id name (%s), " 1217 - "client addr=0x%02x\n", 1218 - __func__, adap->name, adap->nr, id->name, client->addr); 1242 + dprintk("%s: %s on i2c-%d (%s), client addr=0x%02x\n", 1243 + __func__, id->name, adap->nr, adap->name, client->addr); 1219 1244 1220 1245 /* 1221 - * FIXME - This probe function probes both the Tx and Rx 1222 - * addresses of the IR microcontroller. 1223 - * 1224 - * However, the I2C subsystem is passing along one I2C client at a 1225 - * time, based on matches to the ir_transceiver_id[] table above. 1226 - * The expectation is that each i2c_client address will be probed 1227 - * individually by drivers so the I2C subsystem can mark all client 1228 - * addresses as claimed or not. 1229 - * 1230 - * This probe routine causes only one of the client addresses, TX or RX, 1231 - * to be claimed. This will cause a problem if the I2C subsystem is 1232 - * subsequently triggered to probe unclaimed clients again. 1246 + * The IR receiver is at i2c address 0x71. 1247 + * The IR transmitter is at i2c address 0x70. 1233 1248 */ 1234 - /* 1235 - * The external IR receiver is at i2c address 0x71. 1236 - * The IR transmitter is at 0x70. 1237 - */ 1238 - client->addr = 0x70; 1239 1249 1240 - if (!disable_tx) { 1241 - if (i2c_master_recv(client, &buf, 1) == 1) 1242 - have_tx = 1; 1243 - dprintk("probe 0x70 @ %s: %s\n", 1244 - adap->name, have_tx ? "success" : "failed"); 1250 + if (id->driver_data & ID_FLAG_TX) 1251 + tx_probe = true; 1252 + else if (tx_only) /* module option */ 1253 + return -ENXIO; 1254 + 1255 + zilog_info("probing IR %s on %s (i2c-%d)\n", 1256 + tx_probe ? "Tx" : "Rx", adap->name, adap->nr); 1257 + 1258 + mutex_lock(&ir_devices_lock); 1259 + 1260 + /* Use a single struct IR instance for both the Rx and Tx functions */ 1261 + ir = find_ir_device_by_adapter(adap); 1262 + if (ir == NULL) { 1263 + ir = kzalloc(sizeof(struct IR), GFP_KERNEL); 1264 + if (ir == NULL) { 1265 + ret = -ENOMEM; 1266 + goto out_no_ir; 1267 + } 1268 + /* store for use in ir_probe() again, and open() later on */ 1269 + ret = add_ir_device(ir); 1270 + if (ret) 1271 + goto out_free_ir; 1272 + 1273 + ir->adapter = adap; 1274 + mutex_init(&ir->ir_lock); 1275 + 1276 + /* set lirc_dev stuff */ 1277 + memcpy(&ir->l, &lirc_template, sizeof(struct lirc_driver)); 1278 + ir->l.minor = minor; /* module option */ 1279 + ir->l.code_length = 13; 1280 + ir->l.rbuf = NULL; 1281 + ir->l.fops = &lirc_fops; 1282 + ir->l.data = ir; 1283 + ir->l.dev = &adap->dev; 1284 + ir->l.sample_rate = 0; 1245 1285 } 1246 1286 1247 - if (!disable_rx) { 1248 - client->addr = 0x71; 1249 - if (i2c_master_recv(client, &buf, 1) == 1) 1250 - have_rx = 1; 1251 - dprintk("probe 0x71 @ %s: %s\n", 1252 - adap->name, have_rx ? "success" : "failed"); 1287 + if (tx_probe) { 1288 + /* Set up a struct IR_tx instance */ 1289 + ir->tx = kzalloc(sizeof(struct IR_tx), GFP_KERNEL); 1290 + if (ir->tx == NULL) { 1291 + ret = -ENOMEM; 1292 + goto out_free_xx; 1293 + } 1294 + 1295 + ir->tx->c = client; 1296 + ir->tx->need_boot = 1; 1297 + ir->tx->post_tx_ready_poll = 1298 + (id->driver_data & ID_FLAG_HDPVR) ? false : true; 1299 + } else { 1300 + /* Set up a struct IR_rx instance */ 1301 + ir->rx = kzalloc(sizeof(struct IR_rx), GFP_KERNEL); 1302 + if (ir->rx == NULL) { 1303 + ret = -ENOMEM; 1304 + goto out_free_xx; 1305 + } 1306 + 1307 + ret = lirc_buffer_init(&ir->rx->buf, 2, BUFLEN / 2); 1308 + if (ret) 1309 + goto out_free_xx; 1310 + 1311 + mutex_init(&ir->rx->buf_lock); 1312 + ir->rx->c = client; 1313 + ir->rx->hdpvr_data_fmt = 1314 + (id->driver_data & ID_FLAG_HDPVR) ? true : false; 1315 + 1316 + /* set lirc_dev stuff */ 1317 + ir->l.rbuf = &ir->rx->buf; 1253 1318 } 1254 1319 1255 - if (!(have_rx || have_tx)) { 1256 - zilog_error("%s: no devices found\n", adap->name); 1257 - goto out_nodev; 1258 - } 1259 - 1260 - printk(KERN_INFO "lirc_zilog: chip found with %s\n", 1261 - have_rx && have_tx ? "RX and TX" : 1262 - have_rx ? "RX only" : "TX only"); 1263 - 1264 - ir = kzalloc(sizeof(struct IR), GFP_KERNEL); 1265 - 1266 - if (!ir) 1267 - goto out_nomem; 1268 - 1269 - ret = lirc_buffer_init(&ir->buf, 2, BUFLEN / 2); 1270 - if (ret) 1271 - goto out_nomem; 1272 - 1273 - mutex_init(&ir->ir_lock); 1274 - mutex_init(&ir->buf_lock); 1275 - ir->need_boot = 1; 1276 - ir->is_hdpvr = (id->driver_data & ID_FLAG_HDPVR) ? true : false; 1277 - 1278 - memcpy(&ir->l, &lirc_template, sizeof(struct lirc_driver)); 1279 - ir->l.minor = -1; 1280 - 1281 - /* I2C attach to device */ 1282 1320 i2c_set_clientdata(client, ir); 1283 1321 1322 + /* Proceed only if we have the required Tx and Rx clients ready to go */ 1323 + if (ir->tx == NULL || 1324 + (ir->rx == NULL && !tx_only)) { 1325 + zilog_info("probe of IR %s on %s (i2c-%d) done. Waiting on " 1326 + "IR %s.\n", tx_probe ? "Tx" : "Rx", adap->name, 1327 + adap->nr, tx_probe ? "Rx" : "Tx"); 1328 + goto out_ok; 1329 + } 1330 + 1284 1331 /* initialise RX device */ 1285 - if (have_rx) { 1286 - DECLARE_COMPLETION(tn); 1287 - memcpy(&ir->c_rx, client, sizeof(struct i2c_client)); 1288 - 1289 - ir->c_rx.addr = 0x71; 1290 - strlcpy(ir->c_rx.name, ZILOG_HAUPPAUGE_IR_RX_NAME, 1291 - I2C_NAME_SIZE); 1292 - 1332 + if (ir->rx != NULL) { 1293 1333 /* try to fire up polling thread */ 1294 - ir->t_notify = &tn; 1295 - ir->task = kthread_run(lirc_thread, ir, "lirc_zilog"); 1296 - if (IS_ERR(ir->task)) { 1297 - ret = PTR_ERR(ir->task); 1298 - zilog_error("lirc_register_driver: cannot run " 1299 - "poll thread %d\n", ret); 1300 - goto err; 1334 + ir->rx->task = kthread_run(lirc_thread, ir, 1335 + "zilog-rx-i2c-%d", adap->nr); 1336 + if (IS_ERR(ir->rx->task)) { 1337 + ret = PTR_ERR(ir->rx->task); 1338 + zilog_error("%s: could not start IR Rx polling thread" 1339 + "\n", __func__); 1340 + goto out_free_xx; 1301 1341 } 1302 - wait_for_completion(&tn); 1303 - ir->t_notify = NULL; 1304 - ir->have_rx = 1; 1305 1342 } 1306 - 1307 - /* initialise TX device */ 1308 - if (have_tx) { 1309 - memcpy(&ir->c_tx, client, sizeof(struct i2c_client)); 1310 - ir->c_tx.addr = 0x70; 1311 - strlcpy(ir->c_tx.name, ZILOG_HAUPPAUGE_IR_TX_NAME, 1312 - I2C_NAME_SIZE); 1313 - ir->have_tx = 1; 1314 - } 1315 - 1316 - /* set lirc_dev stuff */ 1317 - ir->l.code_length = 13; 1318 - ir->l.rbuf = &ir->buf; 1319 - ir->l.fops = &lirc_fops; 1320 - ir->l.data = ir; 1321 - ir->l.minor = minor; 1322 - ir->l.dev = &adap->dev; 1323 - ir->l.sample_rate = 0; 1324 1343 1325 1344 /* register with lirc */ 1326 1345 ir->l.minor = lirc_register_driver(&ir->l); 1327 1346 if (ir->l.minor < 0 || ir->l.minor >= MAX_IRCTL_DEVICES) { 1328 - zilog_error("ir_attach: \"minor\" must be between 0 and %d " 1329 - "(%d)!\n", MAX_IRCTL_DEVICES-1, ir->l.minor); 1347 + zilog_error("%s: \"minor\" must be between 0 and %d (%d)!\n", 1348 + __func__, MAX_IRCTL_DEVICES-1, ir->l.minor); 1330 1349 ret = -EBADRQC; 1331 - goto err; 1350 + goto out_free_thread; 1332 1351 } 1333 - 1334 - /* store this for getting back in open() later on */ 1335 - ir_devices[ir->l.minor] = ir; 1336 1352 1337 1353 /* 1338 1354 * if we have the tx device, load the 'firmware'. We do this 1339 1355 * after registering with lirc as otherwise hotplug seems to take 1340 1356 * 10s to create the lirc device. 1341 1357 */ 1342 - if (have_tx) { 1343 - /* Special TX init */ 1344 - ret = tx_init(ir); 1345 - if (ret != 0) 1346 - goto err; 1358 + ret = tx_init(ir->tx); 1359 + if (ret != 0) 1360 + goto out_unregister; 1361 + 1362 + zilog_info("probe of IR %s on %s (i2c-%d) done. IR unit ready.\n", 1363 + tx_probe ? "Tx" : "Rx", adap->name, adap->nr); 1364 + out_ok: 1365 + mutex_unlock(&ir_devices_lock); 1366 + return 0; 1367 + 1368 + out_unregister: 1369 + lirc_unregister_driver(ir->l.minor); 1370 + out_free_thread: 1371 + destroy_rx_kthread(ir->rx); 1372 + out_free_xx: 1373 + if (ir->rx != NULL) { 1374 + if (ir->rx->buf.fifo_initialized) 1375 + lirc_buffer_free(&ir->rx->buf); 1376 + if (ir->rx->c != NULL) 1377 + i2c_set_clientdata(ir->rx->c, NULL); 1378 + kfree(ir->rx); 1347 1379 } 1348 - 1349 - return 0; 1350 - 1351 - err: 1352 - /* undo everything, hopefully... */ 1353 - if (ir->c_rx.addr) 1354 - ir_remove(&ir->c_rx); 1355 - if (ir->c_tx.addr) 1356 - ir_remove(&ir->c_tx); 1357 - return ret; 1358 - 1359 - out_nodev: 1360 - zilog_error("no device found\n"); 1361 - return -ENODEV; 1362 - 1363 - out_nomem: 1364 - zilog_error("memory allocation failure\n"); 1380 + if (ir->tx != NULL) { 1381 + if (ir->tx->c != NULL) 1382 + i2c_set_clientdata(ir->tx->c, NULL); 1383 + kfree(ir->tx); 1384 + } 1385 + out_free_ir: 1386 + del_ir_device(ir); 1365 1387 kfree(ir); 1366 - return -ENOMEM; 1367 - } 1368 - 1369 - static int ir_command(struct i2c_client *client, unsigned int cmd, void *arg) 1370 - { 1371 - /* nothing */ 1372 - return 0; 1388 + out_no_ir: 1389 + zilog_error("%s: probing IR %s on %s (i2c-%d) failed with %d\n", 1390 + __func__, tx_probe ? "Tx" : "Rx", adap->name, adap->nr, 1391 + ret); 1392 + mutex_unlock(&ir_devices_lock); 1393 + return ret; 1373 1394 } 1374 1395 1375 1396 static int __init zilog_init(void) ··· 1418 1361 zilog_notify("Zilog/Hauppauge IR driver initializing\n"); 1419 1362 1420 1363 mutex_init(&tx_data_lock); 1364 + mutex_init(&ir_devices_lock); 1421 1365 1422 1366 request_module("firmware_class"); 1423 1367 ··· 1444 1386 1445 1387 MODULE_DESCRIPTION("Zilog/Hauppauge infrared transmitter driver (i2c stack)"); 1446 1388 MODULE_AUTHOR("Gerd Knorr, Michal Kochanowicz, Christoph Bartelmus, " 1447 - "Ulrich Mueller, Stefan Jahn, Jerome Brock, Mark Weaver"); 1389 + "Ulrich Mueller, Stefan Jahn, Jerome Brock, Mark Weaver, " 1390 + "Andy Walls"); 1448 1391 MODULE_LICENSE("GPL"); 1449 1392 /* for compat with old name, which isn't all that accurate anymore */ 1450 1393 MODULE_ALIAS("lirc_pvr150"); ··· 1456 1397 module_param(debug, bool, 0644); 1457 1398 MODULE_PARM_DESC(debug, "Enable debugging messages"); 1458 1399 1459 - module_param(disable_rx, bool, 0644); 1460 - MODULE_PARM_DESC(disable_rx, "Disable the IR receiver device"); 1461 - 1462 - module_param(disable_tx, bool, 0644); 1463 - MODULE_PARM_DESC(disable_tx, "Disable the IR transmitter device"); 1400 + module_param(tx_only, bool, 0644); 1401 + MODULE_PARM_DESC(tx_only, "Only handle the IR transmit function");
+37 -11
drivers/staging/tm6000/tm6000-video.c
··· 1450 1450 * ------------------------------------------------------------------ 1451 1451 */ 1452 1452 1453 - int tm6000_v4l2_register(struct tm6000_core *dev) 1453 + static struct video_device *vdev_init(struct tm6000_core *dev, 1454 + const struct video_device 1455 + *template, const char *type_name) 1454 1456 { 1455 - int ret = -1; 1456 1457 struct video_device *vfd; 1457 1458 1458 1459 vfd = video_device_alloc(); 1459 - if(!vfd) { 1460 + if (NULL == vfd) 1461 + return NULL; 1462 + 1463 + *vfd = *template; 1464 + vfd->v4l2_dev = &dev->v4l2_dev; 1465 + vfd->release = video_device_release; 1466 + vfd->debug = tm6000_debug; 1467 + vfd->lock = &dev->lock; 1468 + 1469 + snprintf(vfd->name, sizeof(vfd->name), "%s %s", dev->name, type_name); 1470 + 1471 + video_set_drvdata(vfd, dev); 1472 + return vfd; 1473 + } 1474 + 1475 + int tm6000_v4l2_register(struct tm6000_core *dev) 1476 + { 1477 + int ret = -1; 1478 + 1479 + dev->vfd = vdev_init(dev, &tm6000_template, "video"); 1480 + 1481 + if (!dev->vfd) { 1482 + printk(KERN_INFO "%s: can't register video device\n", 1483 + dev->name); 1460 1484 return -ENOMEM; 1461 1485 } 1462 - dev->vfd = vfd; 1463 1486 1464 1487 /* init video dma queues */ 1465 1488 INIT_LIST_HEAD(&dev->vidq.active); 1466 1489 INIT_LIST_HEAD(&dev->vidq.queued); 1467 1490 1468 - memcpy(dev->vfd, &tm6000_template, sizeof(*(dev->vfd))); 1469 - dev->vfd->debug = tm6000_debug; 1470 - dev->vfd->lock = &dev->lock; 1471 - 1472 - vfd->v4l2_dev = &dev->v4l2_dev; 1473 - video_set_drvdata(vfd, dev); 1474 - 1475 1491 ret = video_register_device(dev->vfd, VFL_TYPE_GRABBER, video_nr); 1492 + 1493 + if (ret < 0) { 1494 + printk(KERN_INFO "%s: can't register video device\n", 1495 + dev->name); 1496 + return ret; 1497 + } 1498 + 1499 + printk(KERN_INFO "%s: registered device %s\n", 1500 + dev->name, video_device_node_name(dev->vfd)); 1501 + 1476 1502 printk(KERN_INFO "Trident TVMaster TM5600/TM6000/TM6010 USB2 board (Load status: %d)\n", ret); 1477 1503 return ret; 1478 1504 }
+2
drivers/tty/Makefile
··· 9 9 obj-$(CONFIG_R3964) += n_r3964.o 10 10 11 11 obj-y += vt/ 12 + obj-$(CONFIG_HVC_DRIVER) += hvc/ 13 + obj-y += serial/
+13
drivers/tty/hvc/Makefile
··· 1 + obj-$(CONFIG_HVC_CONSOLE) += hvc_vio.o hvsi.o 2 + obj-$(CONFIG_HVC_ISERIES) += hvc_iseries.o 3 + obj-$(CONFIG_HVC_RTAS) += hvc_rtas.o 4 + obj-$(CONFIG_HVC_TILE) += hvc_tile.o 5 + obj-$(CONFIG_HVC_DCC) += hvc_dcc.o 6 + obj-$(CONFIG_HVC_BEAT) += hvc_beat.o 7 + obj-$(CONFIG_HVC_DRIVER) += hvc_console.o 8 + obj-$(CONFIG_HVC_IRQ) += hvc_irq.o 9 + obj-$(CONFIG_HVC_XEN) += hvc_xen.o 10 + obj-$(CONFIG_HVC_IUCV) += hvc_iucv.o 11 + obj-$(CONFIG_HVC_UDBG) += hvc_udbg.o 12 + obj-$(CONFIG_HVCS) += hvcs.o 13 + obj-$(CONFIG_VIRTIO_CONSOLE) += virtio_console.o
+3 -3
drivers/usb/core/Kconfig
··· 123 123 124 124 config USB_OTG_WHITELIST 125 125 bool "Rely on OTG Targeted Peripherals List" 126 - depends on USB_OTG || EMBEDDED 126 + depends on USB_OTG || EXPERT 127 127 default y if USB_OTG 128 - default n if EMBEDDED 128 + default n if EXPERT 129 129 help 130 130 If you say Y here, the "otg_whitelist.h" file will be used as a 131 131 product whitelist, so USB peripherals not listed there will be ··· 141 141 142 142 config USB_OTG_BLACKLIST_HUB 143 143 bool "Disable external hubs" 144 - depends on USB_OTG || EMBEDDED 144 + depends on USB_OTG || EXPERT 145 145 help 146 146 If you say Y here, then Linux will refuse to enumerate 147 147 external hubs. OTG hosts are allowed to reduce hardware
+1 -1
drivers/video/Kconfig
··· 1227 1227 1228 1228 config FB_INTEL 1229 1229 tristate "Intel 830M/845G/852GM/855GM/865G/915G/945G/945GM/965G/965GM support (EXPERIMENTAL)" 1230 - depends on EXPERIMENTAL && FB && PCI && X86 && AGP_INTEL && EMBEDDED 1230 + depends on EXPERIMENTAL && FB && PCI && X86 && AGP_INTEL && EXPERT 1231 1231 select FB_MODE_HELPERS 1232 1232 select FB_CFB_FILLRECT 1233 1233 select FB_CFB_COPYAREA
+2 -2
drivers/video/backlight/88pm860x_bl.c
··· 21 21 #define MAX_BRIGHTNESS (0xFF) 22 22 #define MIN_BRIGHTNESS (0) 23 23 24 - #define CURRENT_MASK (0x1F << 1) 24 + #define CURRENT_BITMASK (0x1F << 1) 25 25 26 26 struct pm860x_backlight_data { 27 27 struct pm860x_chip *chip; ··· 85 85 if ((data->current_brightness == 0) && brightness) { 86 86 if (data->iset) { 87 87 ret = pm860x_set_bits(data->i2c, wled_idc(data->port), 88 - CURRENT_MASK, data->iset); 88 + CURRENT_BITMASK, data->iset); 89 89 if (ret < 0) 90 90 goto out; 91 91 }
+1 -1
drivers/video/console/Kconfig
··· 5 5 menu "Console display driver support" 6 6 7 7 config VGA_CONSOLE 8 - bool "VGA text console" if EMBEDDED || !X86 8 + bool "VGA text console" if EXPERT || !X86 9 9 depends on !4xx && !8xx && !SPARC && !M68K && !PARISC && !FRV && !SUPERH && !BLACKFIN && !AVR32 && !MN10300 && (!ARM || ARCH_FOOTBRIDGE || ARCH_INTEGRATOR || ARCH_NETWINDER) 10 10 default y 11 11 help
+2 -18
drivers/virtio/virtio_pci.c
··· 96 96 97 97 MODULE_DEVICE_TABLE(pci, virtio_pci_id_table); 98 98 99 - /* A PCI device has it's own struct device and so does a virtio device so 100 - * we create a place for the virtio devices to show up in sysfs. I think it 101 - * would make more sense for virtio to not insist on having it's own device. */ 102 - static struct device *virtio_pci_root; 103 - 104 99 /* Convert a generic virtio device to our structure */ 105 100 static struct virtio_pci_device *to_vp_device(struct virtio_device *vdev) 106 101 { ··· 624 629 if (vp_dev == NULL) 625 630 return -ENOMEM; 626 631 627 - vp_dev->vdev.dev.parent = virtio_pci_root; 632 + vp_dev->vdev.dev.parent = &pci_dev->dev; 628 633 vp_dev->vdev.dev.release = virtio_pci_release_dev; 629 634 vp_dev->vdev.config = &virtio_pci_config_ops; 630 635 vp_dev->pci_dev = pci_dev; ··· 712 717 713 718 static int __init virtio_pci_init(void) 714 719 { 715 - int err; 716 - 717 - virtio_pci_root = root_device_register("virtio-pci"); 718 - if (IS_ERR(virtio_pci_root)) 719 - return PTR_ERR(virtio_pci_root); 720 - 721 - err = pci_register_driver(&virtio_pci_driver); 722 - if (err) 723 - root_device_unregister(virtio_pci_root); 724 - 725 - return err; 720 + return pci_register_driver(&virtio_pci_driver); 726 721 } 727 722 728 723 module_init(virtio_pci_init); ··· 720 735 static void __exit virtio_pci_exit(void) 721 736 { 722 737 pci_unregister_driver(&virtio_pci_driver); 723 - root_device_unregister(virtio_pci_root); 724 738 } 725 739 726 740 module_exit(virtio_pci_exit);
+13 -18
drivers/xen/xenfs/xenbus.c
··· 122 122 int ret; 123 123 124 124 mutex_lock(&u->reply_mutex); 125 + again: 125 126 while (list_empty(&u->read_buffers)) { 126 127 mutex_unlock(&u->reply_mutex); 127 128 if (filp->f_flags & O_NONBLOCK) ··· 145 144 i += sz - ret; 146 145 rb->cons += sz - ret; 147 146 148 - if (ret != sz) { 147 + if (ret != 0) { 149 148 if (i == 0) 150 149 i = -EFAULT; 151 150 goto out; ··· 161 160 struct read_buffer, list); 162 161 } 163 162 } 163 + if (i == 0) 164 + goto again; 164 165 165 166 out: 166 167 mutex_unlock(&u->reply_mutex); ··· 410 407 411 408 mutex_lock(&u->reply_mutex); 412 409 rc = queue_reply(&u->read_buffers, &reply, sizeof(reply)); 410 + wake_up(&u->read_waitq); 413 411 mutex_unlock(&u->reply_mutex); 414 412 } 415 413 ··· 459 455 460 456 ret = copy_from_user(u->u.buffer + u->len, ubuf, len); 461 457 462 - if (ret == len) { 458 + if (ret != 0) { 463 459 rc = -EFAULT; 464 460 goto out; 465 461 } ··· 492 488 msg_type = u->u.msg.type; 493 489 494 490 switch (msg_type) { 495 - case XS_TRANSACTION_START: 496 - case XS_TRANSACTION_END: 497 - case XS_DIRECTORY: 498 - case XS_READ: 499 - case XS_GET_PERMS: 500 - case XS_RELEASE: 501 - case XS_GET_DOMAIN_PATH: 502 - case XS_WRITE: 503 - case XS_MKDIR: 504 - case XS_RM: 505 - case XS_SET_PERMS: 506 - /* Send out a transaction */ 507 - ret = xenbus_write_transaction(msg_type, u); 508 - break; 509 - 510 491 case XS_WATCH: 511 492 case XS_UNWATCH: 512 493 /* (Un)Ask for some path to be watched for changes */ ··· 499 510 break; 500 511 501 512 default: 502 - ret = -EINVAL; 513 + /* Send out a transaction */ 514 + ret = xenbus_write_transaction(msg_type, u); 503 515 break; 504 516 } 505 517 if (ret != 0) ··· 545 555 struct xenbus_file_priv *u = filp->private_data; 546 556 struct xenbus_transaction_holder *trans, *tmp; 547 557 struct watch_adapter *watch, *tmp_watch; 558 + struct read_buffer *rb, *tmp_rb; 548 559 549 560 /* 550 561 * No need for locking here because there are no other users, ··· 564 573 free_watch_adapter(watch); 565 574 } 566 575 576 + list_for_each_entry_safe(rb, tmp_rb, &u->read_buffers, list) { 577 + list_del(&rb->list); 578 + kfree(rb); 579 + } 567 580 kfree(u); 568 581 569 582 return 0;
+1 -1
fs/Kconfig
··· 50 50 tristate 51 51 52 52 config FILE_LOCKING 53 - bool "Enable POSIX file locking API" if EMBEDDED 53 + bool "Enable POSIX file locking API" if EXPERT 54 54 default y 55 55 help 56 56 This option enables standard file locking support, required
+5 -5
fs/cifs/cifs_debug.c
··· 79 79 spin_lock(&GlobalMid_Lock); 80 80 list_for_each(tmp, &server->pending_mid_q) { 81 81 mid_entry = list_entry(tmp, struct mid_q_entry, qhead); 82 - cERROR(1, "State: %d Cmd: %d Pid: %d Tsk: %p Mid %d", 82 + cERROR(1, "State: %d Cmd: %d Pid: %d Cbdata: %p Mid %d", 83 83 mid_entry->midState, 84 84 (int)mid_entry->command, 85 85 mid_entry->pid, 86 - mid_entry->tsk, 86 + mid_entry->callback_data, 87 87 mid_entry->mid); 88 88 #ifdef CONFIG_CIFS_STATS2 89 89 cERROR(1, "IsLarge: %d buf: %p time rcv: %ld now: %ld", ··· 218 218 mid_entry = list_entry(tmp3, struct mid_q_entry, 219 219 qhead); 220 220 seq_printf(m, "\tState: %d com: %d pid:" 221 - " %d tsk: %p mid %d\n", 221 + " %d cbdata: %p mid %d\n", 222 222 mid_entry->midState, 223 223 (int)mid_entry->command, 224 224 mid_entry->pid, 225 - mid_entry->tsk, 225 + mid_entry->callback_data, 226 226 mid_entry->mid); 227 227 } 228 228 spin_unlock(&GlobalMid_Lock); ··· 331 331 atomic_read(&totSmBufAllocCount)); 332 332 #endif /* CONFIG_CIFS_STATS2 */ 333 333 334 - seq_printf(m, "Operations (MIDs): %d\n", midCount.counter); 334 + seq_printf(m, "Operations (MIDs): %d\n", atomic_read(&midCount)); 335 335 seq_printf(m, 336 336 "\n%d session %d share reconnects\n", 337 337 tcpSesReconnectCount.counter, tconInfoReconnectCount.counter);
+1
fs/cifs/cifs_fs_sb.h
··· 40 40 #define CIFS_MOUNT_FSCACHE 0x8000 /* local caching enabled */ 41 41 #define CIFS_MOUNT_MF_SYMLINKS 0x10000 /* Minshall+French Symlinks enabled */ 42 42 #define CIFS_MOUNT_MULTIUSER 0x20000 /* multiuser mount */ 43 + #define CIFS_MOUNT_STRICT_IO 0x40000 /* strict cache mode */ 43 44 44 45 struct cifs_sb_info { 45 46 struct rb_root tlink_tree;
+104 -23
fs/cifs/cifs_unicode.c
··· 44 44 int charlen, outlen = 0; 45 45 int maxwords = maxbytes / 2; 46 46 char tmp[NLS_MAX_CHARSET_SIZE]; 47 + __u16 ftmp; 47 48 48 - for (i = 0; i < maxwords && from[i]; i++) { 49 - charlen = codepage->uni2char(le16_to_cpu(from[i]), tmp, 50 - NLS_MAX_CHARSET_SIZE); 49 + for (i = 0; i < maxwords; i++) { 50 + ftmp = get_unaligned_le16(&from[i]); 51 + if (ftmp == 0) 52 + break; 53 + 54 + charlen = codepage->uni2char(ftmp, tmp, NLS_MAX_CHARSET_SIZE); 51 55 if (charlen > 0) 52 56 outlen += charlen; 53 57 else ··· 62 58 } 63 59 64 60 /* 65 - * cifs_mapchar - convert a little-endian char to proper char in codepage 61 + * cifs_mapchar - convert a host-endian char to proper char in codepage 66 62 * @target - where converted character should be copied 67 - * @src_char - 2 byte little-endian source character 63 + * @src_char - 2 byte host-endian source character 68 64 * @cp - codepage to which character should be converted 69 65 * @mapchar - should character be mapped according to mapchars mount option? 70 66 * ··· 73 69 * enough to hold the result of the conversion (at least NLS_MAX_CHARSET_SIZE). 74 70 */ 75 71 static int 76 - cifs_mapchar(char *target, const __le16 src_char, const struct nls_table *cp, 72 + cifs_mapchar(char *target, const __u16 src_char, const struct nls_table *cp, 77 73 bool mapchar) 78 74 { 79 75 int len = 1; ··· 86 82 * build_path_from_dentry are modified, as they use slash as 87 83 * separator. 88 84 */ 89 - switch (le16_to_cpu(src_char)) { 85 + switch (src_char) { 90 86 case UNI_COLON: 91 87 *target = ':'; 92 88 break; ··· 113 109 return len; 114 110 115 111 cp_convert: 116 - len = cp->uni2char(le16_to_cpu(src_char), target, 117 - NLS_MAX_CHARSET_SIZE); 112 + len = cp->uni2char(src_char, target, NLS_MAX_CHARSET_SIZE); 118 113 if (len <= 0) { 119 114 *target = '?'; 120 115 len = 1; ··· 152 149 int nullsize = nls_nullsize(codepage); 153 150 int fromwords = fromlen / 2; 154 151 char tmp[NLS_MAX_CHARSET_SIZE]; 152 + __u16 ftmp; 155 153 156 154 /* 157 155 * because the chars can be of varying widths, we need to take care ··· 162 158 */ 163 159 safelen = tolen - (NLS_MAX_CHARSET_SIZE + nullsize); 164 160 165 - for (i = 0; i < fromwords && from[i]; i++) { 161 + for (i = 0; i < fromwords; i++) { 162 + ftmp = get_unaligned_le16(&from[i]); 163 + if (ftmp == 0) 164 + break; 165 + 166 166 /* 167 167 * check to see if converting this character might make the 168 168 * conversion bleed into the null terminator 169 169 */ 170 170 if (outlen >= safelen) { 171 - charlen = cifs_mapchar(tmp, from[i], codepage, mapchar); 171 + charlen = cifs_mapchar(tmp, ftmp, codepage, mapchar); 172 172 if ((outlen + charlen) > (tolen - nullsize)) 173 173 break; 174 174 } 175 175 176 176 /* put converted char into 'to' buffer */ 177 - charlen = cifs_mapchar(&to[outlen], from[i], codepage, mapchar); 177 + charlen = cifs_mapchar(&to[outlen], ftmp, codepage, mapchar); 178 178 outlen += charlen; 179 179 } 180 180 ··· 201 193 { 202 194 int charlen; 203 195 int i; 204 - wchar_t *wchar_to = (wchar_t *)to; /* needed to quiet sparse */ 196 + wchar_t wchar_to; /* needed to quiet sparse */ 205 197 206 198 for (i = 0; len && *from; i++, from += charlen, len -= charlen) { 207 - 208 - /* works for 2.4.0 kernel or later */ 209 - charlen = codepage->char2uni(from, len, &wchar_to[i]); 199 + charlen = codepage->char2uni(from, len, &wchar_to); 210 200 if (charlen < 1) { 211 - cERROR(1, "strtoUCS: char2uni of %d returned %d", 212 - (int)*from, charlen); 201 + cERROR(1, "strtoUCS: char2uni of 0x%x returned %d", 202 + *from, charlen); 213 203 /* A question mark */ 214 - to[i] = cpu_to_le16(0x003f); 204 + wchar_to = 0x003f; 215 205 charlen = 1; 216 - } else 217 - to[i] = cpu_to_le16(wchar_to[i]); 218 - 206 + } 207 + put_unaligned_le16(wchar_to, &to[i]); 219 208 } 220 209 221 - to[i] = 0; 210 + put_unaligned_le16(0, &to[i]); 222 211 return i; 223 212 } 224 213 ··· 255 250 } 256 251 257 252 return dst; 253 + } 254 + 255 + /* 256 + * Convert 16 bit Unicode pathname to wire format from string in current code 257 + * page. Conversion may involve remapping up the six characters that are 258 + * only legal in POSIX-like OS (if they are present in the string). Path 259 + * names are little endian 16 bit Unicode on the wire 260 + */ 261 + int 262 + cifsConvertToUCS(__le16 *target, const char *source, int maxlen, 263 + const struct nls_table *cp, int mapChars) 264 + { 265 + int i, j, charlen; 266 + int len_remaining = maxlen; 267 + char src_char; 268 + __u16 temp; 269 + 270 + if (!mapChars) 271 + return cifs_strtoUCS(target, source, PATH_MAX, cp); 272 + 273 + for (i = 0, j = 0; i < maxlen; j++) { 274 + src_char = source[i]; 275 + switch (src_char) { 276 + case 0: 277 + put_unaligned_le16(0, &target[j]); 278 + goto ctoUCS_out; 279 + case ':': 280 + temp = UNI_COLON; 281 + break; 282 + case '*': 283 + temp = UNI_ASTERIK; 284 + break; 285 + case '?': 286 + temp = UNI_QUESTION; 287 + break; 288 + case '<': 289 + temp = UNI_LESSTHAN; 290 + break; 291 + case '>': 292 + temp = UNI_GRTRTHAN; 293 + break; 294 + case '|': 295 + temp = UNI_PIPE; 296 + break; 297 + /* 298 + * FIXME: We can not handle remapping backslash (UNI_SLASH) 299 + * until all the calls to build_path_from_dentry are modified, 300 + * as they use backslash as separator. 301 + */ 302 + default: 303 + charlen = cp->char2uni(source+i, len_remaining, 304 + &temp); 305 + /* 306 + * if no match, use question mark, which at least in 307 + * some cases serves as wild card 308 + */ 309 + if (charlen < 1) { 310 + temp = 0x003f; 311 + charlen = 1; 312 + } 313 + len_remaining -= charlen; 314 + /* 315 + * character may take more than one byte in the source 316 + * string, but will take exactly two bytes in the 317 + * target string 318 + */ 319 + i += charlen; 320 + continue; 321 + } 322 + put_unaligned_le16(temp, &target[j]); 323 + i++; /* move to next char in source string */ 324 + len_remaining--; 325 + } 326 + 327 + ctoUCS_out: 328 + return i; 258 329 } 259 330
+11 -2
fs/cifs/cifsacl.c
··· 41 41 ; 42 42 43 43 44 - /* security id for everyone */ 44 + /* security id for everyone/world system group */ 45 45 static const struct cifs_sid sid_everyone = { 46 46 1, 1, {0, 0, 0, 0, 0, 1}, {0} }; 47 + /* security id for Authenticated Users system group */ 48 + static const struct cifs_sid sid_authusers = { 49 + 1, 1, {0, 0, 0, 0, 0, 5}, {11} }; 47 50 /* group users */ 48 51 static const struct cifs_sid sid_user = {1, 2 , {0, 0, 0, 0, 0, 5}, {} }; 49 52 ··· 368 365 if (num_aces > 0) { 369 366 umode_t user_mask = S_IRWXU; 370 367 umode_t group_mask = S_IRWXG; 371 - umode_t other_mask = S_IRWXO; 368 + umode_t other_mask = S_IRWXU | S_IRWXG | S_IRWXO; 372 369 373 370 ppace = kmalloc(num_aces * sizeof(struct cifs_ace *), 374 371 GFP_KERNEL); ··· 393 390 ppace[i]->type, 394 391 &fattr->cf_mode, 395 392 &other_mask); 393 + if (compare_sids(&(ppace[i]->sid), &sid_authusers)) 394 + access_flags_to_mode(ppace[i]->access_req, 395 + ppace[i]->type, 396 + &fattr->cf_mode, 397 + &other_mask); 398 + 396 399 397 400 /* memcpy((void *)(&(cifscred->aces[i])), 398 401 (void *)ppace[i],
+43 -1
fs/cifs/cifsfs.c
··· 77 77 module_param(cifs_max_pending, int, 0); 78 78 MODULE_PARM_DESC(cifs_max_pending, "Simultaneous requests to server. " 79 79 "Default: 50 Range: 2 to 256"); 80 - 80 + unsigned short echo_retries = 5; 81 + module_param(echo_retries, ushort, 0644); 82 + MODULE_PARM_DESC(echo_retries, "Number of echo attempts before giving up and " 83 + "reconnecting server. Default: 5. 0 means " 84 + "never reconnect."); 81 85 extern mempool_t *cifs_sm_req_poolp; 82 86 extern mempool_t *cifs_req_poolp; 83 87 extern mempool_t *cifs_mid_poolp; ··· 733 729 .setlease = cifs_setlease, 734 730 }; 735 731 732 + const struct file_operations cifs_file_strict_ops = { 733 + .read = do_sync_read, 734 + .write = do_sync_write, 735 + .aio_read = cifs_strict_readv, 736 + .aio_write = cifs_file_aio_write, 737 + .open = cifs_open, 738 + .release = cifs_close, 739 + .lock = cifs_lock, 740 + .fsync = cifs_strict_fsync, 741 + .flush = cifs_flush, 742 + .mmap = cifs_file_strict_mmap, 743 + .splice_read = generic_file_splice_read, 744 + .llseek = cifs_llseek, 745 + #ifdef CONFIG_CIFS_POSIX 746 + .unlocked_ioctl = cifs_ioctl, 747 + #endif /* CONFIG_CIFS_POSIX */ 748 + .setlease = cifs_setlease, 749 + }; 750 + 736 751 const struct file_operations cifs_file_direct_ops = { 737 752 /* no aio, no readv - 738 753 BB reevaluate whether they can be done with directio, no cache */ ··· 770 747 .llseek = cifs_llseek, 771 748 .setlease = cifs_setlease, 772 749 }; 750 + 773 751 const struct file_operations cifs_file_nobrl_ops = { 774 752 .read = do_sync_read, 775 753 .write = do_sync_write, ··· 781 757 .fsync = cifs_fsync, 782 758 .flush = cifs_flush, 783 759 .mmap = cifs_file_mmap, 760 + .splice_read = generic_file_splice_read, 761 + .llseek = cifs_llseek, 762 + #ifdef CONFIG_CIFS_POSIX 763 + .unlocked_ioctl = cifs_ioctl, 764 + #endif /* CONFIG_CIFS_POSIX */ 765 + .setlease = cifs_setlease, 766 + }; 767 + 768 + const struct file_operations cifs_file_strict_nobrl_ops = { 769 + .read = do_sync_read, 770 + .write = do_sync_write, 771 + .aio_read = cifs_strict_readv, 772 + .aio_write = cifs_file_aio_write, 773 + .open = cifs_open, 774 + .release = cifs_close, 775 + .fsync = cifs_strict_fsync, 776 + .flush = cifs_flush, 777 + .mmap = cifs_file_strict_mmap, 784 778 .splice_read = generic_file_splice_read, 785 779 .llseek = cifs_llseek, 786 780 #ifdef CONFIG_CIFS_POSIX
+11 -4
fs/cifs/cifsfs.h
··· 61 61 struct dentry *); 62 62 extern int cifs_revalidate_file(struct file *filp); 63 63 extern int cifs_revalidate_dentry(struct dentry *); 64 + extern void cifs_invalidate_mapping(struct inode *inode); 64 65 extern int cifs_getattr(struct vfsmount *, struct dentry *, struct kstat *); 65 66 extern int cifs_setattr(struct dentry *, struct iattr *); 66 67 ··· 73 72 /* Functions related to files and directories */ 74 73 extern const struct file_operations cifs_file_ops; 75 74 extern const struct file_operations cifs_file_direct_ops; /* if directio mnt */ 76 - extern const struct file_operations cifs_file_nobrl_ops; 77 - extern const struct file_operations cifs_file_direct_nobrl_ops; /* no brlocks */ 75 + extern const struct file_operations cifs_file_strict_ops; /* if strictio mnt */ 76 + extern const struct file_operations cifs_file_nobrl_ops; /* no brlocks */ 77 + extern const struct file_operations cifs_file_direct_nobrl_ops; 78 + extern const struct file_operations cifs_file_strict_nobrl_ops; 78 79 extern int cifs_open(struct inode *inode, struct file *file); 79 80 extern int cifs_close(struct inode *inode, struct file *file); 80 81 extern int cifs_closedir(struct inode *inode, struct file *file); 81 82 extern ssize_t cifs_user_read(struct file *file, char __user *read_data, 82 - size_t read_size, loff_t *poffset); 83 + size_t read_size, loff_t *poffset); 84 + extern ssize_t cifs_strict_readv(struct kiocb *iocb, const struct iovec *iov, 85 + unsigned long nr_segs, loff_t pos); 83 86 extern ssize_t cifs_user_write(struct file *file, const char __user *write_data, 84 87 size_t write_size, loff_t *poffset); 85 88 extern int cifs_lock(struct file *, int, struct file_lock *); 86 89 extern int cifs_fsync(struct file *, int); 90 + extern int cifs_strict_fsync(struct file *, int); 87 91 extern int cifs_flush(struct file *, fl_owner_t id); 88 92 extern int cifs_file_mmap(struct file * , struct vm_area_struct *); 93 + extern int cifs_file_strict_mmap(struct file * , struct vm_area_struct *); 89 94 extern const struct file_operations cifs_dir_ops; 90 95 extern int cifs_dir_open(struct inode *inode, struct file *file); 91 96 extern int cifs_readdir(struct file *file, void *direntry, filldir_t filldir); ··· 125 118 extern const struct export_operations cifs_export_ops; 126 119 #endif /* EXPERIMENTAL */ 127 120 128 - #define CIFS_VERSION "1.68" 121 + #define CIFS_VERSION "1.69" 129 122 #endif /* _CIFSFS_H */
+35 -29
fs/cifs/cifsglob.h
··· 161 161 int srv_count; /* reference counter */ 162 162 /* 15 character server name + 0x20 16th byte indicating type = srv */ 163 163 char server_RFC1001_name[RFC1001_NAME_LEN_WITH_NULL]; 164 + enum statusEnum tcpStatus; /* what we think the status is */ 164 165 char *hostname; /* hostname portion of UNC string */ 165 166 struct socket *ssocket; 166 167 struct sockaddr_storage dstaddr; ··· 169 168 wait_queue_head_t response_q; 170 169 wait_queue_head_t request_q; /* if more than maxmpx to srvr must block*/ 171 170 struct list_head pending_mid_q; 172 - void *Server_NlsInfo; /* BB - placeholder for future NLS info */ 173 - unsigned short server_codepage; /* codepage for the server */ 174 - enum protocolEnum protocolType; 175 - char versionMajor; 176 - char versionMinor; 177 - bool svlocal:1; /* local server or remote */ 178 171 bool noblocksnd; /* use blocking sendmsg */ 179 172 bool noautotune; /* do not autotune send buf sizes */ 180 173 bool tcp_nodelay; 181 174 atomic_t inFlight; /* number of requests on the wire to server */ 182 - #ifdef CONFIG_CIFS_STATS2 183 - atomic_t inSend; /* requests trying to send */ 184 - atomic_t num_waiters; /* blocked waiting to get in sendrecv */ 185 - #endif 186 - enum statusEnum tcpStatus; /* what we think the status is */ 187 175 struct mutex srv_mutex; 188 176 struct task_struct *tsk; 189 177 char server_GUID[16]; 190 178 char secMode; 179 + bool session_estab; /* mark when very first sess is established */ 180 + u16 dialect; /* dialect index that server chose */ 191 181 enum securityEnum secType; 192 182 unsigned int maxReq; /* Clients should submit no more */ 193 183 /* than maxReq distinct unanswered SMBs to the server when using */ ··· 191 199 unsigned int max_vcs; /* maximum number of smb sessions, at least 192 200 those that can be specified uniquely with 193 201 vcnumbers */ 194 - char sessid[4]; /* unique token id for this session */ 195 - /* (returned on Negotiate */ 196 202 int capabilities; /* allow selective disabling of caps by smb sess */ 197 203 int timeAdj; /* Adjust for difference in server time zone in sec */ 198 204 __u16 CurrentMid; /* multiplex id - rotating counter */ ··· 200 210 __u32 sequence_number; /* for signing, protected by srv_mutex */ 201 211 struct session_key session_key; 202 212 unsigned long lstrp; /* when we got last response from this server */ 203 - u16 dialect; /* dialect index that server chose */ 204 213 struct cifs_secmech secmech; /* crypto sec mech functs, descriptors */ 205 214 /* extended security flavors that server supports */ 215 + bool sec_ntlmssp; /* supports NTLMSSP */ 216 + bool sec_kerberosu2u; /* supports U2U Kerberos */ 206 217 bool sec_kerberos; /* supports plain Kerberos */ 207 218 bool sec_mskerberos; /* supports legacy MS Kerberos */ 208 - bool sec_kerberosu2u; /* supports U2U Kerberos */ 209 - bool sec_ntlmssp; /* supports NTLMSSP */ 210 - bool session_estab; /* mark when very first sess is established */ 219 + struct delayed_work echo; /* echo ping workqueue job */ 211 220 #ifdef CONFIG_CIFS_FSCACHE 212 221 struct fscache_cookie *fscache; /* client index cache cookie */ 222 + #endif 223 + #ifdef CONFIG_CIFS_STATS2 224 + atomic_t inSend; /* requests trying to send */ 225 + atomic_t num_waiters; /* blocked waiting to get in sendrecv */ 213 226 #endif 214 227 }; 215 228 ··· 439 446 /* BB add in lists for dirty pages i.e. write caching info for oplock */ 440 447 struct list_head openFileList; 441 448 __u32 cifsAttrs; /* e.g. DOS archive bit, sparse, compressed, system */ 442 - unsigned long time; /* jiffies of last update/check of inode */ 443 - bool clientCanCacheRead:1; /* read oplock */ 444 - bool clientCanCacheAll:1; /* read and writebehind oplock */ 445 - bool delete_pending:1; /* DELETE_ON_CLOSE is set */ 446 - bool invalid_mapping:1; /* pagecache is invalid */ 449 + bool clientCanCacheRead; /* read oplock */ 450 + bool clientCanCacheAll; /* read and writebehind oplock */ 451 + bool delete_pending; /* DELETE_ON_CLOSE is set */ 452 + bool invalid_mapping; /* pagecache is invalid */ 453 + unsigned long time; /* jiffies of last update of inode */ 447 454 u64 server_eof; /* current file size on server */ 448 455 u64 uniqueid; /* server inode number */ 449 456 u64 createtime; /* creation time on server */ ··· 501 508 502 509 #endif 503 510 511 + struct mid_q_entry; 512 + 513 + /* 514 + * This is the prototype for the mid callback function. When creating one, 515 + * take special care to avoid deadlocks. Things to bear in mind: 516 + * 517 + * - it will be called by cifsd 518 + * - the GlobalMid_Lock will be held 519 + * - the mid will be removed from the pending_mid_q list 520 + */ 521 + typedef void (mid_callback_t)(struct mid_q_entry *mid); 522 + 504 523 /* one of these for every pending CIFS request to the server */ 505 524 struct mid_q_entry { 506 525 struct list_head qhead; /* mids waiting on reply from this server */ ··· 524 519 unsigned long when_sent; /* time when smb send finished */ 525 520 unsigned long when_received; /* when demux complete (taken off wire) */ 526 521 #endif 527 - struct task_struct *tsk; /* task waiting for response */ 522 + mid_callback_t *callback; /* call completion callback */ 523 + void *callback_data; /* general purpose pointer for callback */ 528 524 struct smb_hdr *resp_buf; /* response buffer */ 529 525 int midState; /* wish this were enum but can not pass to wait_event */ 530 526 __u8 command; /* smb command code */ ··· 628 622 #define CIFS_IOVEC 4 /* array of response buffers */ 629 623 630 624 /* Type of Request to SendReceive2 */ 631 - #define CIFS_STD_OP 0 /* normal request timeout */ 632 - #define CIFS_LONG_OP 1 /* long op (up to 45 sec, oplock time) */ 633 - #define CIFS_VLONG_OP 2 /* sloow op - can take up to 180 seconds */ 634 - #define CIFS_BLOCKING_OP 4 /* operation can block */ 635 - #define CIFS_ASYNC_OP 8 /* do not wait for response */ 636 - #define CIFS_TIMEOUT_MASK 0x00F /* only one of 5 above set in req */ 625 + #define CIFS_BLOCKING_OP 1 /* operation can block */ 626 + #define CIFS_ASYNC_OP 2 /* do not wait for response */ 627 + #define CIFS_TIMEOUT_MASK 0x003 /* only one of above set in req */ 637 628 #define CIFS_LOG_ERROR 0x010 /* log NT STATUS if non-zero */ 638 629 #define CIFS_LARGE_BUF_OP 0x020 /* large request buffer */ 639 630 #define CIFS_NO_RESP 0x040 /* no response buffer required */ ··· 792 789 GLOBAL_EXTERN unsigned int cifs_min_rcv; /* min size of big ntwrk buf pool */ 793 790 GLOBAL_EXTERN unsigned int cifs_min_small; /* min size of small buf pool */ 794 791 GLOBAL_EXTERN unsigned int cifs_max_pending; /* MAX requests at once to server*/ 792 + 793 + /* reconnect after this many failed echo attempts */ 794 + GLOBAL_EXTERN unsigned short echo_retries; 795 795 796 796 void cifs_oplock_break(struct work_struct *work); 797 797 void cifs_oplock_break_get(struct cifsFileInfo *cfile);
+58 -4
fs/cifs/cifspdu.h
··· 23 23 #define _CIFSPDU_H 24 24 25 25 #include <net/sock.h> 26 + #include <asm/unaligned.h> 26 27 #include "smbfsctl.h" 27 28 28 29 #ifdef CONFIG_CIFS_WEAK_PW_HASH ··· 51 50 #define SMB_COM_SETATTR 0x09 /* trivial response */ 52 51 #define SMB_COM_LOCKING_ANDX 0x24 /* trivial response */ 53 52 #define SMB_COM_COPY 0x29 /* trivial rsp, fail filename ignrd*/ 53 + #define SMB_COM_ECHO 0x2B /* echo request */ 54 54 #define SMB_COM_OPEN_ANDX 0x2D /* Legacy open for old servers */ 55 55 #define SMB_COM_READ_ANDX 0x2E 56 56 #define SMB_COM_WRITE_ANDX 0x2F ··· 427 425 __u16 Mid; 428 426 __u8 WordCount; 429 427 } __attribute__((packed)); 430 - /* given a pointer to an smb_hdr retrieve the value of byte count */ 431 - #define BCC(smb_var) (*(__u16 *)((char *)(smb_var) + sizeof(struct smb_hdr) + (2 * (smb_var)->WordCount))) 432 - #define BCC_LE(smb_var) (*(__le16 *)((char *)(smb_var) + sizeof(struct smb_hdr) + (2 * (smb_var)->WordCount))) 428 + 429 + /* given a pointer to an smb_hdr retrieve a char pointer to the byte count */ 430 + #define BCC(smb_var) ((unsigned char *)(smb_var) + sizeof(struct smb_hdr) + \ 431 + (2 * (smb_var)->WordCount)) 432 + 433 433 /* given a pointer to an smb_hdr retrieve the pointer to the byte area */ 434 - #define pByteArea(smb_var) ((unsigned char *)(smb_var) + sizeof(struct smb_hdr) + (2 * (smb_var)->WordCount) + 2) 434 + #define pByteArea(smb_var) (BCC(smb_var) + 2) 435 + 436 + /* get the converted ByteCount for a SMB packet and return it */ 437 + static inline __u16 438 + get_bcc(struct smb_hdr *hdr) 439 + { 440 + __u16 *bc_ptr = (__u16 *)BCC(hdr); 441 + 442 + return get_unaligned(bc_ptr); 443 + } 444 + 445 + /* get the unconverted ByteCount for a SMB packet and return it */ 446 + static inline __u16 447 + get_bcc_le(struct smb_hdr *hdr) 448 + { 449 + __le16 *bc_ptr = (__le16 *)BCC(hdr); 450 + 451 + return get_unaligned_le16(bc_ptr); 452 + } 453 + 454 + /* set the ByteCount for a SMB packet in host-byte order */ 455 + static inline void 456 + put_bcc(__u16 count, struct smb_hdr *hdr) 457 + { 458 + __u16 *bc_ptr = (__u16 *)BCC(hdr); 459 + 460 + put_unaligned(count, bc_ptr); 461 + } 462 + 463 + /* set the ByteCount for a SMB packet in little-endian */ 464 + static inline void 465 + put_bcc_le(__u16 count, struct smb_hdr *hdr) 466 + { 467 + __le16 *bc_ptr = (__le16 *)BCC(hdr); 468 + 469 + put_unaligned_le16(count, bc_ptr); 470 + } 435 471 436 472 /* 437 473 * Computer Name Length (since Netbios name was length 16 with last byte 0x20) ··· 799 759 * ????? ie any type 800 760 * 801 761 */ 762 + 763 + typedef struct smb_com_echo_req { 764 + struct smb_hdr hdr; 765 + __le16 EchoCount; 766 + __le16 ByteCount; 767 + char Data[1]; 768 + } __attribute__((packed)) ECHO_REQ; 769 + 770 + typedef struct smb_com_echo_rsp { 771 + struct smb_hdr hdr; 772 + __le16 SequenceNumber; 773 + __le16 ByteCount; 774 + char Data[1]; 775 + } __attribute__((packed)) ECHO_RSP; 802 776 803 777 typedef struct smb_com_logoff_andx_req { 804 778 struct smb_hdr hdr; /* wct = 2 */
+8 -1
fs/cifs/cifsproto.h
··· 61 61 const char *fullpath, const struct dfs_info3_param *ref, 62 62 char **devname); 63 63 /* extern void renew_parental_timestamps(struct dentry *direntry);*/ 64 + extern struct mid_q_entry *AllocMidQEntry(const struct smb_hdr *smb_buffer, 65 + struct TCP_Server_Info *server); 66 + extern void DeleteMidQEntry(struct mid_q_entry *midEntry); 67 + extern int cifs_call_async(struct TCP_Server_Info *server, 68 + struct smb_hdr *in_buf, mid_callback_t *callback, 69 + void *cbdata); 64 70 extern int SendReceive(const unsigned int /* xid */ , struct cifsSesInfo *, 65 71 struct smb_hdr * /* input */ , 66 72 struct smb_hdr * /* out */ , ··· 353 347 const __u16 netfid, const __u64 len, 354 348 const __u64 offset, const __u32 numUnlock, 355 349 const __u32 numLock, const __u8 lockType, 356 - const bool waitFlag); 350 + const bool waitFlag, const __u8 oplock_level); 357 351 extern int CIFSSMBPosixLock(const int xid, struct cifsTconInfo *tcon, 358 352 const __u16 smb_file_id, const int get_flag, 359 353 const __u64 len, struct file_lock *, 360 354 const __u16 lock_type, const bool waitFlag); 361 355 extern int CIFSSMBTDis(const int xid, struct cifsTconInfo *tcon); 356 + extern int CIFSSMBEcho(struct TCP_Server_Info *server); 362 357 extern int CIFSSMBLogoff(const int xid, struct cifsSesInfo *ses); 363 358 364 359 extern struct cifsSesInfo *sesInfoAlloc(void);
+79 -34
fs/cifs/cifssmb.c
··· 331 331 332 332 static int validate_t2(struct smb_t2_rsp *pSMB) 333 333 { 334 - int rc = -EINVAL; 335 - int total_size; 336 - char *pBCC; 334 + unsigned int total_size; 337 335 338 - /* check for plausible wct, bcc and t2 data and parm sizes */ 336 + /* check for plausible wct */ 337 + if (pSMB->hdr.WordCount < 10) 338 + goto vt2_err; 339 + 339 340 /* check for parm and data offset going beyond end of smb */ 340 - if (pSMB->hdr.WordCount >= 10) { 341 - if ((le16_to_cpu(pSMB->t2_rsp.ParameterOffset) <= 1024) && 342 - (le16_to_cpu(pSMB->t2_rsp.DataOffset) <= 1024)) { 343 - /* check that bcc is at least as big as parms + data */ 344 - /* check that bcc is less than negotiated smb buffer */ 345 - total_size = le16_to_cpu(pSMB->t2_rsp.ParameterCount); 346 - if (total_size < 512) { 347 - total_size += 348 - le16_to_cpu(pSMB->t2_rsp.DataCount); 349 - /* BCC le converted in SendReceive */ 350 - pBCC = (pSMB->hdr.WordCount * 2) + 351 - sizeof(struct smb_hdr) + 352 - (char *)pSMB; 353 - if ((total_size <= (*(u16 *)pBCC)) && 354 - (total_size < 355 - CIFSMaxBufSize+MAX_CIFS_HDR_SIZE)) { 356 - return 0; 357 - } 358 - } 359 - } 360 - } 341 + if (get_unaligned_le16(&pSMB->t2_rsp.ParameterOffset) > 1024 || 342 + get_unaligned_le16(&pSMB->t2_rsp.DataOffset) > 1024) 343 + goto vt2_err; 344 + 345 + /* check that bcc is at least as big as parms + data */ 346 + /* check that bcc is less than negotiated smb buffer */ 347 + total_size = get_unaligned_le16(&pSMB->t2_rsp.ParameterCount); 348 + if (total_size >= 512) 349 + goto vt2_err; 350 + 351 + total_size += get_unaligned_le16(&pSMB->t2_rsp.DataCount); 352 + if (total_size > get_bcc(&pSMB->hdr) || 353 + total_size >= CIFSMaxBufSize + MAX_CIFS_HDR_SIZE) 354 + goto vt2_err; 355 + 356 + return 0; 357 + vt2_err: 361 358 cifs_dump_mem("Invalid transact2 SMB: ", (char *)pSMB, 362 359 sizeof(struct smb_t2_rsp) + 16); 363 - return rc; 360 + return -EINVAL; 364 361 } 362 + 365 363 int 366 364 CIFSSMBNegotiate(unsigned int xid, struct cifsSesInfo *ses) 367 365 { ··· 450 452 server->maxBuf = min((__u32)le16_to_cpu(rsp->MaxBufSize), 451 453 (__u32)CIFSMaxBufSize + MAX_CIFS_HDR_SIZE); 452 454 server->max_vcs = le16_to_cpu(rsp->MaxNumberVcs); 453 - GETU32(server->sessid) = le32_to_cpu(rsp->SessionKey); 454 455 /* even though we do not use raw we might as well set this 455 456 accurately, in case we ever find a need for it */ 456 457 if ((le16_to_cpu(rsp->RawMode) & RAW_ENABLE) == RAW_ENABLE) { ··· 563 566 (__u32) CIFSMaxBufSize + MAX_CIFS_HDR_SIZE); 564 567 server->max_rw = le32_to_cpu(pSMBr->MaxRawSize); 565 568 cFYI(DBG2, "Max buf = %d", ses->server->maxBuf); 566 - GETU32(ses->server->sessid) = le32_to_cpu(pSMBr->SessionKey); 567 569 server->capabilities = le32_to_cpu(pSMBr->Capabilities); 568 570 server->timeAdj = (int)(__s16)le16_to_cpu(pSMBr->ServerTimeZone); 569 571 server->timeAdj *= 60; ··· 698 702 closed on server already e.g. due to tcp session crashing */ 699 703 if (rc == -EAGAIN) 700 704 rc = 0; 705 + 706 + return rc; 707 + } 708 + 709 + /* 710 + * This is a no-op for now. We're not really interested in the reply, but 711 + * rather in the fact that the server sent one and that server->lstrp 712 + * gets updated. 713 + * 714 + * FIXME: maybe we should consider checking that the reply matches request? 715 + */ 716 + static void 717 + cifs_echo_callback(struct mid_q_entry *mid) 718 + { 719 + struct TCP_Server_Info *server = mid->callback_data; 720 + 721 + DeleteMidQEntry(mid); 722 + atomic_dec(&server->inFlight); 723 + wake_up(&server->request_q); 724 + } 725 + 726 + int 727 + CIFSSMBEcho(struct TCP_Server_Info *server) 728 + { 729 + ECHO_REQ *smb; 730 + int rc = 0; 731 + 732 + cFYI(1, "In echo request"); 733 + 734 + rc = small_smb_init(SMB_COM_ECHO, 0, NULL, (void **)&smb); 735 + if (rc) 736 + return rc; 737 + 738 + /* set up echo request */ 739 + smb->hdr.Tid = cpu_to_le16(0xffff); 740 + smb->hdr.WordCount = 1; 741 + put_unaligned_le16(1, &smb->EchoCount); 742 + put_bcc_le(1, &smb->hdr); 743 + smb->Data[0] = 'a'; 744 + smb->hdr.smb_buf_length += 3; 745 + 746 + rc = cifs_call_async(server, (struct smb_hdr *)smb, 747 + cifs_echo_callback, server); 748 + if (rc) 749 + cFYI(1, "Echo request failed: %d", rc); 750 + 751 + cifs_small_buf_release(smb); 701 752 702 753 return rc; 703 754 } ··· 1236 1193 pSMB->ByteCount = cpu_to_le16(count); 1237 1194 /* long_op set to 1 to allow for oplock break timeouts */ 1238 1195 rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB, 1239 - (struct smb_hdr *)pSMBr, &bytes_returned, CIFS_LONG_OP); 1196 + (struct smb_hdr *)pSMBr, &bytes_returned, 0); 1240 1197 cifs_stats_inc(&tcon->num_opens); 1241 1198 if (rc) { 1242 1199 cFYI(1, "Error in Open = %d", rc); ··· 1349 1306 pSMB->ByteCount = cpu_to_le16(count); 1350 1307 /* long_op set to 1 to allow for oplock break timeouts */ 1351 1308 rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB, 1352 - (struct smb_hdr *)pSMBr, &bytes_returned, CIFS_LONG_OP); 1309 + (struct smb_hdr *)pSMBr, &bytes_returned, 0); 1353 1310 cifs_stats_inc(&tcon->num_opens); 1354 1311 if (rc) { 1355 1312 cFYI(1, "Error in Open = %d", rc); ··· 1431 1388 iov[0].iov_base = (char *)pSMB; 1432 1389 iov[0].iov_len = pSMB->hdr.smb_buf_length + 4; 1433 1390 rc = SendReceive2(xid, tcon->ses, iov, 1 /* num iovecs */, 1434 - &resp_buf_type, CIFS_STD_OP | CIFS_LOG_ERROR); 1391 + &resp_buf_type, CIFS_LOG_ERROR); 1435 1392 cifs_stats_inc(&tcon->num_reads); 1436 1393 pSMBr = (READ_RSP *)iov[0].iov_base; 1437 1394 if (rc) { ··· 1706 1663 CIFSSMBLock(const int xid, struct cifsTconInfo *tcon, 1707 1664 const __u16 smb_file_id, const __u64 len, 1708 1665 const __u64 offset, const __u32 numUnlock, 1709 - const __u32 numLock, const __u8 lockType, const bool waitFlag) 1666 + const __u32 numLock, const __u8 lockType, 1667 + const bool waitFlag, const __u8 oplock_level) 1710 1668 { 1711 1669 int rc = 0; 1712 1670 LOCK_REQ *pSMB = NULL; ··· 1735 1691 pSMB->NumberOfLocks = cpu_to_le16(numLock); 1736 1692 pSMB->NumberOfUnlocks = cpu_to_le16(numUnlock); 1737 1693 pSMB->LockType = lockType; 1694 + pSMB->OplockLevel = oplock_level; 1738 1695 pSMB->AndXCommand = 0xFF; /* none */ 1739 1696 pSMB->Fid = smb_file_id; /* netfid stays le */ 1740 1697 ··· 3132 3087 iov[0].iov_len = pSMB->hdr.smb_buf_length + 4; 3133 3088 3134 3089 rc = SendReceive2(xid, tcon->ses, iov, 1 /* num iovec */, &buf_type, 3135 - CIFS_STD_OP); 3090 + 0); 3136 3091 cifs_stats_inc(&tcon->num_acl_get); 3137 3092 if (rc) { 3138 3093 cFYI(1, "Send error in QuerySecDesc = %d", rc); ··· 5607 5562 } 5608 5563 5609 5564 /* make sure list_len doesn't go past end of SMB */ 5610 - end_of_smb = (char *)pByteArea(&pSMBr->hdr) + BCC(&pSMBr->hdr); 5565 + end_of_smb = (char *)pByteArea(&pSMBr->hdr) + get_bcc(&pSMBr->hdr); 5611 5566 if ((char *)ea_response_data + list_len > end_of_smb) { 5612 5567 cFYI(1, "EA list appears to go beyond SMB"); 5613 5568 rc = -EIO;
+93 -97
fs/cifs/connect.c
··· 52 52 #define CIFS_PORT 445 53 53 #define RFC1001_PORT 139 54 54 55 + /* SMB echo "timeout" -- FIXME: tunable? */ 56 + #define SMB_ECHO_INTERVAL (60 * HZ) 57 + 55 58 extern void SMBNTencrypt(unsigned char *passwd, unsigned char *c8, 56 59 unsigned char *p24); 57 60 ··· 155 152 156 153 /* before reconnecting the tcp session, mark the smb session (uid) 157 154 and the tid bad so they are not used until reconnected */ 155 + cFYI(1, "%s: marking sessions and tcons for reconnect", __func__); 158 156 spin_lock(&cifs_tcp_ses_lock); 159 157 list_for_each(tmp, &server->smb_ses_list) { 160 158 ses = list_entry(tmp, struct cifsSesInfo, smb_ses_list); ··· 167 163 } 168 164 } 169 165 spin_unlock(&cifs_tcp_ses_lock); 166 + 170 167 /* do not want to be sending data on a socket we are freeing */ 168 + cFYI(1, "%s: tearing down socket", __func__); 171 169 mutex_lock(&server->srv_mutex); 172 170 if (server->ssocket) { 173 171 cFYI(1, "State: 0x%x Flags: 0x%lx", server->ssocket->state, ··· 186 180 kfree(server->session_key.response); 187 181 server->session_key.response = NULL; 188 182 server->session_key.len = 0; 183 + server->lstrp = jiffies; 184 + mutex_unlock(&server->srv_mutex); 189 185 186 + /* mark submitted MIDs for retry and issue callback */ 187 + cFYI(1, "%s: issuing mid callbacks", __func__); 190 188 spin_lock(&GlobalMid_Lock); 191 - list_for_each(tmp, &server->pending_mid_q) { 192 - mid_entry = list_entry(tmp, struct 193 - mid_q_entry, 194 - qhead); 195 - if (mid_entry->midState == MID_REQUEST_SUBMITTED) { 196 - /* Mark other intransit requests as needing 197 - retry so we do not immediately mark the 198 - session bad again (ie after we reconnect 199 - below) as they timeout too */ 189 + list_for_each_safe(tmp, tmp2, &server->pending_mid_q) { 190 + mid_entry = list_entry(tmp, struct mid_q_entry, qhead); 191 + if (mid_entry->midState == MID_REQUEST_SUBMITTED) 200 192 mid_entry->midState = MID_RETRY_NEEDED; 201 - } 193 + list_del_init(&mid_entry->qhead); 194 + mid_entry->callback(mid_entry); 202 195 } 203 196 spin_unlock(&GlobalMid_Lock); 204 - mutex_unlock(&server->srv_mutex); 205 197 206 198 while ((server->tcpStatus != CifsExiting) && 207 199 (server->tcpStatus != CifsGood)) { ··· 216 212 if (server->tcpStatus != CifsExiting) 217 213 server->tcpStatus = CifsGood; 218 214 spin_unlock(&GlobalMid_Lock); 219 - /* atomic_set(&server->inFlight,0);*/ 220 - wake_up(&server->response_q); 221 215 } 222 216 } 217 + 223 218 return rc; 224 219 } 225 220 ··· 232 229 static int check2ndT2(struct smb_hdr *pSMB, unsigned int maxBufSize) 233 230 { 234 231 struct smb_t2_rsp *pSMBt; 235 - int total_data_size; 236 - int data_in_this_rsp; 237 232 int remaining; 233 + __u16 total_data_size, data_in_this_rsp; 238 234 239 235 if (pSMB->Command != SMB_COM_TRANSACTION2) 240 236 return 0; ··· 247 245 248 246 pSMBt = (struct smb_t2_rsp *)pSMB; 249 247 250 - total_data_size = le16_to_cpu(pSMBt->t2_rsp.TotalDataCount); 251 - data_in_this_rsp = le16_to_cpu(pSMBt->t2_rsp.DataCount); 248 + total_data_size = get_unaligned_le16(&pSMBt->t2_rsp.TotalDataCount); 249 + data_in_this_rsp = get_unaligned_le16(&pSMBt->t2_rsp.DataCount); 252 250 253 251 remaining = total_data_size - data_in_this_rsp; 254 252 ··· 274 272 { 275 273 struct smb_t2_rsp *pSMB2 = (struct smb_t2_rsp *)psecond; 276 274 struct smb_t2_rsp *pSMBt = (struct smb_t2_rsp *)pTargetSMB; 277 - int total_data_size; 278 - int total_in_buf; 279 - int remaining; 280 - int total_in_buf2; 281 275 char *data_area_of_target; 282 276 char *data_area_of_buf2; 283 - __u16 byte_count; 277 + int remaining; 278 + __u16 byte_count, total_data_size, total_in_buf, total_in_buf2; 284 279 285 - total_data_size = le16_to_cpu(pSMBt->t2_rsp.TotalDataCount); 280 + total_data_size = get_unaligned_le16(&pSMBt->t2_rsp.TotalDataCount); 286 281 287 - if (total_data_size != le16_to_cpu(pSMB2->t2_rsp.TotalDataCount)) { 282 + if (total_data_size != 283 + get_unaligned_le16(&pSMB2->t2_rsp.TotalDataCount)) 288 284 cFYI(1, "total data size of primary and secondary t2 differ"); 289 - } 290 285 291 - total_in_buf = le16_to_cpu(pSMBt->t2_rsp.DataCount); 286 + total_in_buf = get_unaligned_le16(&pSMBt->t2_rsp.DataCount); 292 287 293 288 remaining = total_data_size - total_in_buf; 294 289 ··· 295 296 if (remaining == 0) /* nothing to do, ignore */ 296 297 return 0; 297 298 298 - total_in_buf2 = le16_to_cpu(pSMB2->t2_rsp.DataCount); 299 + total_in_buf2 = get_unaligned_le16(&pSMB2->t2_rsp.DataCount); 299 300 if (remaining < total_in_buf2) { 300 301 cFYI(1, "transact2 2nd response contains too much data"); 301 302 } 302 303 303 304 /* find end of first SMB data area */ 304 305 data_area_of_target = (char *)&pSMBt->hdr.Protocol + 305 - le16_to_cpu(pSMBt->t2_rsp.DataOffset); 306 + get_unaligned_le16(&pSMBt->t2_rsp.DataOffset); 306 307 /* validate target area */ 307 308 308 - data_area_of_buf2 = (char *) &pSMB2->hdr.Protocol + 309 - le16_to_cpu(pSMB2->t2_rsp.DataOffset); 309 + data_area_of_buf2 = (char *)&pSMB2->hdr.Protocol + 310 + get_unaligned_le16(&pSMB2->t2_rsp.DataOffset); 310 311 311 312 data_area_of_target += total_in_buf; 312 313 313 314 /* copy second buffer into end of first buffer */ 314 315 memcpy(data_area_of_target, data_area_of_buf2, total_in_buf2); 315 316 total_in_buf += total_in_buf2; 316 - pSMBt->t2_rsp.DataCount = cpu_to_le16(total_in_buf); 317 - byte_count = le16_to_cpu(BCC_LE(pTargetSMB)); 317 + put_unaligned_le16(total_in_buf, &pSMBt->t2_rsp.DataCount); 318 + byte_count = get_bcc_le(pTargetSMB); 318 319 byte_count += total_in_buf2; 319 - BCC_LE(pTargetSMB) = cpu_to_le16(byte_count); 320 + put_bcc_le(byte_count, pTargetSMB); 320 321 321 322 byte_count = pTargetSMB->smb_buf_length; 322 323 byte_count += total_in_buf2; ··· 330 331 return 0; /* we are done */ 331 332 } else /* more responses to go */ 332 333 return 1; 334 + } 333 335 336 + static void 337 + cifs_echo_request(struct work_struct *work) 338 + { 339 + int rc; 340 + struct TCP_Server_Info *server = container_of(work, 341 + struct TCP_Server_Info, echo.work); 342 + 343 + /* no need to ping if we got a response recently */ 344 + if (time_before(jiffies, server->lstrp + SMB_ECHO_INTERVAL - HZ)) 345 + goto requeue_echo; 346 + 347 + rc = CIFSSMBEcho(server); 348 + if (rc) 349 + cFYI(1, "Unable to send echo request to server: %s", 350 + server->hostname); 351 + 352 + requeue_echo: 353 + queue_delayed_work(system_nrt_wq, &server->echo, SMB_ECHO_INTERVAL); 334 354 } 335 355 336 356 static int ··· 363 345 struct msghdr smb_msg; 364 346 struct kvec iov; 365 347 struct socket *csocket = server->ssocket; 366 - struct list_head *tmp; 367 - struct cifsSesInfo *ses; 348 + struct list_head *tmp, *tmp2; 368 349 struct task_struct *task_to_wake = NULL; 369 350 struct mid_q_entry *mid_entry; 370 351 char temp; ··· 416 399 smb_msg.msg_control = NULL; 417 400 smb_msg.msg_controllen = 0; 418 401 pdu_length = 4; /* enough to get RFC1001 header */ 402 + 419 403 incomplete_rcv: 404 + if (echo_retries > 0 && 405 + time_after(jiffies, server->lstrp + 406 + (echo_retries * SMB_ECHO_INTERVAL))) { 407 + cERROR(1, "Server %s has not responded in %d seconds. " 408 + "Reconnecting...", server->hostname, 409 + (echo_retries * SMB_ECHO_INTERVAL / HZ)); 410 + cifs_reconnect(server); 411 + csocket = server->ssocket; 412 + wake_up(&server->response_q); 413 + continue; 414 + } 415 + 420 416 length = 421 417 kernel_recvmsg(csocket, &smb_msg, 422 418 &iov, 1, pdu_length, 0 /* BB other flags? */); ··· 589 559 continue; 590 560 } 591 561 562 + mid_entry = NULL; 563 + server->lstrp = jiffies; 592 564 593 - task_to_wake = NULL; 594 565 spin_lock(&GlobalMid_Lock); 595 - list_for_each(tmp, &server->pending_mid_q) { 566 + list_for_each_safe(tmp, tmp2, &server->pending_mid_q) { 596 567 mid_entry = list_entry(tmp, struct mid_q_entry, qhead); 597 568 598 569 if ((mid_entry->mid == smb_buffer->Mid) && ··· 634 603 mid_entry->resp_buf = smb_buffer; 635 604 mid_entry->largeBuf = isLargeBuf; 636 605 multi_t2_fnd: 637 - task_to_wake = mid_entry->tsk; 638 606 mid_entry->midState = MID_RESPONSE_RECEIVED; 607 + list_del_init(&mid_entry->qhead); 608 + mid_entry->callback(mid_entry); 639 609 #ifdef CONFIG_CIFS_STATS2 640 610 mid_entry->when_received = jiffies; 641 611 #endif 642 - /* so we do not time out requests to server 643 - which is still responding (since server could 644 - be busy but not dead) */ 645 - server->lstrp = jiffies; 646 612 break; 647 613 } 614 + mid_entry = NULL; 648 615 } 649 616 spin_unlock(&GlobalMid_Lock); 650 - if (task_to_wake) { 617 + 618 + if (mid_entry != NULL) { 651 619 /* Was previous buf put in mpx struct for multi-rsp? */ 652 620 if (!isMultiRsp) { 653 621 /* smb buffer will be freed by user thread */ ··· 655 625 else 656 626 smallbuf = NULL; 657 627 } 658 - wake_up_process(task_to_wake); 659 628 } else if (!is_valid_oplock_break(smb_buffer, server) && 660 629 !isMultiRsp) { 661 630 cERROR(1, "No task to wake, unknown frame received! " 662 - "NumMids %d", midCount.counter); 631 + "NumMids %d", atomic_read(&midCount)); 663 632 cifs_dump_mem("Received Data is: ", (char *)smb_buffer, 664 633 sizeof(struct smb_hdr)); 665 634 #ifdef CONFIG_CIFS_DEBUG2 ··· 706 677 if (smallbuf) /* no sense logging a debug message if NULL */ 707 678 cifs_small_buf_release(smallbuf); 708 679 709 - /* 710 - * BB: we shouldn't have to do any of this. It shouldn't be 711 - * possible to exit from the thread with active SMB sessions 712 - */ 713 - spin_lock(&cifs_tcp_ses_lock); 714 - if (list_empty(&server->pending_mid_q)) { 715 - /* loop through server session structures attached to this and 716 - mark them dead */ 717 - list_for_each(tmp, &server->smb_ses_list) { 718 - ses = list_entry(tmp, struct cifsSesInfo, 719 - smb_ses_list); 720 - ses->status = CifsExiting; 721 - ses->server = NULL; 722 - } 723 - spin_unlock(&cifs_tcp_ses_lock); 724 - } else { 725 - /* although we can not zero the server struct pointer yet, 726 - since there are active requests which may depnd on them, 727 - mark the corresponding SMB sessions as exiting too */ 728 - list_for_each(tmp, &server->smb_ses_list) { 729 - ses = list_entry(tmp, struct cifsSesInfo, 730 - smb_ses_list); 731 - ses->status = CifsExiting; 732 - } 733 - 680 + if (!list_empty(&server->pending_mid_q)) { 734 681 spin_lock(&GlobalMid_Lock); 735 - list_for_each(tmp, &server->pending_mid_q) { 736 - mid_entry = list_entry(tmp, struct mid_q_entry, qhead); 737 - if (mid_entry->midState == MID_REQUEST_SUBMITTED) { 738 - cFYI(1, "Clearing Mid 0x%x - waking up ", 682 + list_for_each_safe(tmp, tmp2, &server->pending_mid_q) { 683 + mid_entry = list_entry(tmp, struct mid_q_entry, qhead); 684 + cFYI(1, "Clearing Mid 0x%x - issuing callback", 739 685 mid_entry->mid); 740 - task_to_wake = mid_entry->tsk; 741 - if (task_to_wake) 742 - wake_up_process(task_to_wake); 743 - } 686 + list_del_init(&mid_entry->qhead); 687 + mid_entry->callback(mid_entry); 744 688 } 745 689 spin_unlock(&GlobalMid_Lock); 746 - spin_unlock(&cifs_tcp_ses_lock); 747 690 /* 1/8th of sec is more than enough time for them to exit */ 748 691 msleep(125); 749 692 } ··· 732 731 /* if threads still have not exited they are probably never 733 732 coming home not much else we can do but free the memory */ 734 733 } 735 - 736 - /* last chance to mark ses pointers invalid 737 - if there are any pointing to this (e.g 738 - if a crazy root user tried to kill cifsd 739 - kernel thread explicitly this might happen) */ 740 - /* BB: This shouldn't be necessary, see above */ 741 - spin_lock(&cifs_tcp_ses_lock); 742 - list_for_each(tmp, &server->smb_ses_list) { 743 - ses = list_entry(tmp, struct cifsSesInfo, smb_ses_list); 744 - ses->server = NULL; 745 - } 746 - spin_unlock(&cifs_tcp_ses_lock); 747 734 748 735 kfree(server->hostname); 749 736 task_to_wake = xchg(&server->tsk, NULL); ··· 1601 1612 list_del_init(&server->tcp_ses_list); 1602 1613 spin_unlock(&cifs_tcp_ses_lock); 1603 1614 1615 + cancel_delayed_work_sync(&server->echo); 1616 + 1604 1617 spin_lock(&GlobalMid_Lock); 1605 1618 server->tcpStatus = CifsExiting; 1606 1619 spin_unlock(&GlobalMid_Lock); ··· 1692 1701 volume_info->target_rfc1001_name, RFC1001_NAME_LEN_WITH_NULL); 1693 1702 tcp_ses->session_estab = false; 1694 1703 tcp_ses->sequence_number = 0; 1704 + tcp_ses->lstrp = jiffies; 1695 1705 INIT_LIST_HEAD(&tcp_ses->tcp_ses_list); 1696 1706 INIT_LIST_HEAD(&tcp_ses->smb_ses_list); 1707 + INIT_DELAYED_WORK(&tcp_ses->echo, cifs_echo_request); 1697 1708 1698 1709 /* 1699 1710 * at this point we are the only ones with the pointer ··· 1743 1750 spin_unlock(&cifs_tcp_ses_lock); 1744 1751 1745 1752 cifs_fscache_get_client_cookie(tcp_ses); 1753 + 1754 + /* queue echo request delayed work */ 1755 + queue_delayed_work(system_nrt_wq, &tcp_ses->echo, SMB_ECHO_INTERVAL); 1746 1756 1747 1757 return tcp_ses; 1748 1758 ··· 2932 2936 TCONX_RSP *pSMBr; 2933 2937 unsigned char *bcc_ptr; 2934 2938 int rc = 0; 2935 - int length, bytes_left; 2936 - __u16 count; 2939 + int length; 2940 + __u16 bytes_left, count; 2937 2941 2938 2942 if (ses == NULL) 2939 2943 return -EIO; ··· 2961 2965 bcc_ptr++; /* skip password */ 2962 2966 /* already aligned so no need to do it below */ 2963 2967 } else { 2964 - pSMB->PasswordLength = cpu_to_le16(CIFS_SESS_KEY_SIZE); 2968 + pSMB->PasswordLength = cpu_to_le16(CIFS_AUTH_RESP_SIZE); 2965 2969 /* BB FIXME add code to fail this if NTLMv2 or Kerberos 2966 2970 specified as required (when that support is added to 2967 2971 the vfs in the future) as only NTLM or the much ··· 2979 2983 #endif /* CIFS_WEAK_PW_HASH */ 2980 2984 SMBNTencrypt(tcon->password, ses->server->cryptkey, bcc_ptr); 2981 2985 2982 - bcc_ptr += CIFS_SESS_KEY_SIZE; 2986 + bcc_ptr += CIFS_AUTH_RESP_SIZE; 2983 2987 if (ses->capabilities & CAP_UNICODE) { 2984 2988 /* must align unicode strings */ 2985 2989 *bcc_ptr = 0; /* null byte password */ ··· 3017 3021 pSMB->ByteCount = cpu_to_le16(count); 3018 3022 3019 3023 rc = SendReceive(xid, ses, smb_buffer, smb_buffer_response, &length, 3020 - CIFS_STD_OP); 3024 + 0); 3021 3025 3022 3026 /* above now done in SendReceive */ 3023 3027 if ((rc == 0) && (tcon != NULL)) { ··· 3027 3031 tcon->need_reconnect = false; 3028 3032 tcon->tid = smb_buffer_response->Tid; 3029 3033 bcc_ptr = pByteArea(smb_buffer_response); 3030 - bytes_left = BCC(smb_buffer_response); 3034 + bytes_left = get_bcc(smb_buffer_response); 3031 3035 length = strnlen(bcc_ptr, bytes_left - 2); 3032 3036 if (smb_buffer->Flags2 & SMBFLG2_UNICODE) 3033 3037 is_unicode = true;
+185 -104
fs/cifs/file.c
··· 287 287 struct inode *inode = cifs_file->dentry->d_inode; 288 288 struct cifsTconInfo *tcon = tlink_tcon(cifs_file->tlink); 289 289 struct cifsInodeInfo *cifsi = CIFS_I(inode); 290 + struct cifs_sb_info *cifs_sb = CIFS_SB(inode->i_sb); 290 291 struct cifsLockInfo *li, *tmp; 291 292 292 293 spin_lock(&cifs_file_list_lock); ··· 303 302 if (list_empty(&cifsi->openFileList)) { 304 303 cFYI(1, "closing last open instance for inode %p", 305 304 cifs_file->dentry->d_inode); 305 + 306 + /* in strict cache mode we need invalidate mapping on the last 307 + close because it may cause a error when we open this file 308 + again and get at least level II oplock */ 309 + if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_STRICT_IO) 310 + CIFS_I(inode)->invalid_mapping = true; 311 + 306 312 cifs_set_oplock_level(cifsi, 0); 307 313 } 308 314 spin_unlock(&cifs_file_list_lock); ··· 734 726 735 727 /* BB we could chain these into one lock request BB */ 736 728 rc = CIFSSMBLock(xid, tcon, netfid, length, pfLock->fl_start, 737 - 0, 1, lockType, 0 /* wait flag */ ); 729 + 0, 1, lockType, 0 /* wait flag */, 0); 738 730 if (rc == 0) { 739 731 rc = CIFSSMBLock(xid, tcon, netfid, length, 740 732 pfLock->fl_start, 1 /* numUnlock */ , 741 733 0 /* numLock */ , lockType, 742 - 0 /* wait flag */ ); 734 + 0 /* wait flag */, 0); 743 735 pfLock->fl_type = F_UNLCK; 744 736 if (rc != 0) 745 737 cERROR(1, "Error unlocking previously locked " ··· 756 748 rc = CIFSSMBLock(xid, tcon, netfid, length, 757 749 pfLock->fl_start, 0, 1, 758 750 lockType | LOCKING_ANDX_SHARED_LOCK, 759 - 0 /* wait flag */); 751 + 0 /* wait flag */, 0); 760 752 if (rc == 0) { 761 753 rc = CIFSSMBLock(xid, tcon, netfid, 762 754 length, pfLock->fl_start, 1, 0, 763 755 lockType | 764 756 LOCKING_ANDX_SHARED_LOCK, 765 - 0 /* wait flag */); 757 + 0 /* wait flag */, 0); 766 758 pfLock->fl_type = F_RDLCK; 767 759 if (rc != 0) 768 760 cERROR(1, "Error unlocking " ··· 805 797 806 798 if (numLock) { 807 799 rc = CIFSSMBLock(xid, tcon, netfid, length, 808 - pfLock->fl_start, 809 - 0, numLock, lockType, wait_flag); 800 + pfLock->fl_start, 0, numLock, lockType, 801 + wait_flag, 0); 810 802 811 803 if (rc == 0) { 812 804 /* For Windows locks we must store them. */ ··· 826 818 (pfLock->fl_start + length) >= 827 819 (li->offset + li->length)) { 828 820 stored_rc = CIFSSMBLock(xid, tcon, 829 - netfid, 830 - li->length, li->offset, 831 - 1, 0, li->type, false); 821 + netfid, li->length, 822 + li->offset, 1, 0, 823 + li->type, false, 0); 832 824 if (stored_rc) 833 825 rc = stored_rc; 834 826 else { ··· 845 837 posix_lock_file_wait(file, pfLock); 846 838 FreeXid(xid); 847 839 return rc; 848 - } 849 - 850 - /* 851 - * Set the timeout on write requests past EOF. For some servers (Windows) 852 - * these calls can be very long. 853 - * 854 - * If we're writing >10M past the EOF we give a 180s timeout. Anything less 855 - * than that gets a 45s timeout. Writes not past EOF get 15s timeouts. 856 - * The 10M cutoff is totally arbitrary. A better scheme for this would be 857 - * welcome if someone wants to suggest one. 858 - * 859 - * We may be able to do a better job with this if there were some way to 860 - * declare that a file should be sparse. 861 - */ 862 - static int 863 - cifs_write_timeout(struct cifsInodeInfo *cifsi, loff_t offset) 864 - { 865 - if (offset <= cifsi->server_eof) 866 - return CIFS_STD_OP; 867 - else if (offset > (cifsi->server_eof + (10 * 1024 * 1024))) 868 - return CIFS_VLONG_OP; 869 - else 870 - return CIFS_LONG_OP; 871 840 } 872 841 873 842 /* update the file size (if needed) after a write */ ··· 867 882 unsigned int total_written; 868 883 struct cifs_sb_info *cifs_sb; 869 884 struct cifsTconInfo *pTcon; 870 - int xid, long_op; 885 + int xid; 871 886 struct cifsFileInfo *open_file; 872 887 struct cifsInodeInfo *cifsi = CIFS_I(inode); 873 888 ··· 888 903 889 904 xid = GetXid(); 890 905 891 - long_op = cifs_write_timeout(cifsi, *poffset); 892 906 for (total_written = 0; write_size > total_written; 893 907 total_written += bytes_written) { 894 908 rc = -EAGAIN; ··· 915 931 min_t(const int, cifs_sb->wsize, 916 932 write_size - total_written), 917 933 *poffset, &bytes_written, 918 - NULL, write_data + total_written, long_op); 934 + NULL, write_data + total_written, 0); 919 935 } 920 936 if (rc || (bytes_written == 0)) { 921 937 if (total_written) ··· 928 944 cifs_update_eof(cifsi, *poffset, bytes_written); 929 945 *poffset += bytes_written; 930 946 } 931 - long_op = CIFS_STD_OP; /* subsequent writes fast - 932 - 15 seconds is plenty */ 933 947 } 934 948 935 949 cifs_stats_bytes_written(pTcon, total_written); ··· 956 974 unsigned int total_written; 957 975 struct cifs_sb_info *cifs_sb; 958 976 struct cifsTconInfo *pTcon; 959 - int xid, long_op; 977 + int xid; 960 978 struct dentry *dentry = open_file->dentry; 961 979 struct cifsInodeInfo *cifsi = CIFS_I(dentry->d_inode); 962 980 ··· 969 987 970 988 xid = GetXid(); 971 989 972 - long_op = cifs_write_timeout(cifsi, *poffset); 973 990 for (total_written = 0; write_size > total_written; 974 991 total_written += bytes_written) { 975 992 rc = -EAGAIN; ··· 998 1017 rc = CIFSSMBWrite2(xid, pTcon, 999 1018 open_file->netfid, len, 1000 1019 *poffset, &bytes_written, 1001 - iov, 1, long_op); 1020 + iov, 1, 0); 1002 1021 } else 1003 1022 rc = CIFSSMBWrite(xid, pTcon, 1004 1023 open_file->netfid, ··· 1006 1025 write_size - total_written), 1007 1026 *poffset, &bytes_written, 1008 1027 write_data + total_written, 1009 - NULL, long_op); 1028 + NULL, 0); 1010 1029 } 1011 1030 if (rc || (bytes_written == 0)) { 1012 1031 if (total_written) ··· 1019 1038 cifs_update_eof(cifsi, *poffset, bytes_written); 1020 1039 *poffset += bytes_written; 1021 1040 } 1022 - long_op = CIFS_STD_OP; /* subsequent writes fast - 1023 - 15 seconds is plenty */ 1024 1041 } 1025 1042 1026 1043 cifs_stats_bytes_written(pTcon, total_written); ··· 1218 1239 struct pagevec pvec; 1219 1240 int rc = 0; 1220 1241 int scanned = 0; 1221 - int xid, long_op; 1242 + int xid; 1222 1243 1223 1244 cifs_sb = CIFS_SB(mapping->host->i_sb); 1224 1245 ··· 1356 1377 break; 1357 1378 } 1358 1379 if (n_iov) { 1380 + retry_write: 1359 1381 open_file = find_writable_file(CIFS_I(mapping->host), 1360 1382 false); 1361 1383 if (!open_file) { 1362 1384 cERROR(1, "No writable handles for inode"); 1363 1385 rc = -EBADF; 1364 1386 } else { 1365 - long_op = cifs_write_timeout(cifsi, offset); 1366 1387 rc = CIFSSMBWrite2(xid, tcon, open_file->netfid, 1367 1388 bytes_to_write, offset, 1368 1389 &bytes_written, iov, n_iov, 1369 - long_op); 1390 + 0); 1370 1391 cifsFileInfo_put(open_file); 1371 - cifs_update_eof(cifsi, offset, bytes_written); 1372 1392 } 1373 1393 1374 - if (rc || bytes_written < bytes_to_write) { 1375 - cERROR(1, "Write2 ret %d, wrote %d", 1376 - rc, bytes_written); 1377 - mapping_set_error(mapping, rc); 1378 - } else { 1394 + cFYI(1, "Write2 rc=%d, wrote=%u", rc, bytes_written); 1395 + 1396 + /* 1397 + * For now, treat a short write as if nothing got 1398 + * written. A zero length write however indicates 1399 + * ENOSPC or EFBIG. We have no way to know which 1400 + * though, so call it ENOSPC for now. EFBIG would 1401 + * get translated to AS_EIO anyway. 1402 + * 1403 + * FIXME: make it take into account the data that did 1404 + * get written 1405 + */ 1406 + if (rc == 0) { 1407 + if (bytes_written == 0) 1408 + rc = -ENOSPC; 1409 + else if (bytes_written < bytes_to_write) 1410 + rc = -EAGAIN; 1411 + } 1412 + 1413 + /* retry on data-integrity flush */ 1414 + if (wbc->sync_mode == WB_SYNC_ALL && rc == -EAGAIN) 1415 + goto retry_write; 1416 + 1417 + /* fix the stats and EOF */ 1418 + if (bytes_written > 0) { 1379 1419 cifs_stats_bytes_written(tcon, bytes_written); 1420 + cifs_update_eof(cifsi, offset, bytes_written); 1380 1421 } 1381 1422 1382 1423 for (i = 0; i < n_iov; i++) { 1383 1424 page = pvec.pages[first + i]; 1384 - /* Should we also set page error on 1385 - success rc but too little data written? */ 1386 - /* BB investigate retry logic on temporary 1387 - server crash cases and how recovery works 1388 - when page marked as error */ 1389 - if (rc) 1425 + /* on retryable write error, redirty page */ 1426 + if (rc == -EAGAIN) 1427 + redirty_page_for_writepage(wbc, page); 1428 + else if (rc != 0) 1390 1429 SetPageError(page); 1391 1430 kunmap(page); 1392 1431 unlock_page(page); 1393 1432 end_page_writeback(page); 1394 1433 page_cache_release(page); 1395 1434 } 1435 + 1436 + if (rc != -EAGAIN) 1437 + mapping_set_error(mapping, rc); 1438 + else 1439 + rc = 0; 1440 + 1396 1441 if ((wbc->nr_to_write -= n_iov) <= 0) 1397 1442 done = 1; 1398 1443 index = next; ··· 1528 1525 return rc; 1529 1526 } 1530 1527 1531 - int cifs_fsync(struct file *file, int datasync) 1528 + int cifs_strict_fsync(struct file *file, int datasync) 1532 1529 { 1533 1530 int xid; 1534 1531 int rc = 0; 1535 1532 struct cifsTconInfo *tcon; 1536 1533 struct cifsFileInfo *smbfile = file->private_data; 1537 1534 struct inode *inode = file->f_path.dentry->d_inode; 1535 + struct cifs_sb_info *cifs_sb = CIFS_SB(inode->i_sb); 1538 1536 1539 1537 xid = GetXid(); 1540 1538 1541 1539 cFYI(1, "Sync file - name: %s datasync: 0x%x", 1542 1540 file->f_path.dentry->d_name.name, datasync); 1543 1541 1544 - rc = filemap_write_and_wait(inode->i_mapping); 1545 - if (rc == 0) { 1546 - struct cifs_sb_info *cifs_sb = CIFS_SB(inode->i_sb); 1542 + if (!CIFS_I(inode)->clientCanCacheRead) 1543 + cifs_invalidate_mapping(inode); 1547 1544 1548 - tcon = tlink_tcon(smbfile->tlink); 1549 - if (!(cifs_sb->mnt_cifs_flags & CIFS_MOUNT_NOSSYNC)) 1550 - rc = CIFSSMBFlush(xid, tcon, smbfile->netfid); 1551 - } 1545 + tcon = tlink_tcon(smbfile->tlink); 1546 + if (!(cifs_sb->mnt_cifs_flags & CIFS_MOUNT_NOSSYNC)) 1547 + rc = CIFSSMBFlush(xid, tcon, smbfile->netfid); 1548 + 1549 + FreeXid(xid); 1550 + return rc; 1551 + } 1552 + 1553 + int cifs_fsync(struct file *file, int datasync) 1554 + { 1555 + int xid; 1556 + int rc = 0; 1557 + struct cifsTconInfo *tcon; 1558 + struct cifsFileInfo *smbfile = file->private_data; 1559 + struct cifs_sb_info *cifs_sb = CIFS_SB(file->f_path.dentry->d_sb); 1560 + 1561 + xid = GetXid(); 1562 + 1563 + cFYI(1, "Sync file - name: %s datasync: 0x%x", 1564 + file->f_path.dentry->d_name.name, datasync); 1565 + 1566 + tcon = tlink_tcon(smbfile->tlink); 1567 + if (!(cifs_sb->mnt_cifs_flags & CIFS_MOUNT_NOSSYNC)) 1568 + rc = CIFSSMBFlush(xid, tcon, smbfile->netfid); 1552 1569 1553 1570 FreeXid(xid); 1554 1571 return rc; ··· 1619 1596 return rc; 1620 1597 } 1621 1598 1622 - ssize_t cifs_user_read(struct file *file, char __user *read_data, 1623 - size_t read_size, loff_t *poffset) 1599 + static ssize_t 1600 + cifs_iovec_read(struct file *file, const struct iovec *iov, 1601 + unsigned long nr_segs, loff_t *poffset) 1624 1602 { 1625 - int rc = -EACCES; 1626 - unsigned int bytes_read = 0; 1627 - unsigned int total_read = 0; 1628 - unsigned int current_read_size; 1603 + int rc; 1604 + int xid; 1605 + unsigned int total_read, bytes_read = 0; 1606 + size_t len, cur_len; 1607 + int iov_offset = 0; 1629 1608 struct cifs_sb_info *cifs_sb; 1630 1609 struct cifsTconInfo *pTcon; 1631 - int xid; 1632 1610 struct cifsFileInfo *open_file; 1633 - char *smb_read_data; 1634 - char __user *current_offset; 1635 1611 struct smb_com_read_rsp *pSMBr; 1612 + char *read_data; 1613 + 1614 + if (!nr_segs) 1615 + return 0; 1616 + 1617 + len = iov_length(iov, nr_segs); 1618 + if (!len) 1619 + return 0; 1636 1620 1637 1621 xid = GetXid(); 1638 1622 cifs_sb = CIFS_SB(file->f_path.dentry->d_sb); 1639 1623 1640 - if (file->private_data == NULL) { 1641 - rc = -EBADF; 1642 - FreeXid(xid); 1643 - return rc; 1644 - } 1645 1624 open_file = file->private_data; 1646 1625 pTcon = tlink_tcon(open_file->tlink); 1647 1626 1648 1627 if ((file->f_flags & O_ACCMODE) == O_WRONLY) 1649 1628 cFYI(1, "attempting read on write only file instance"); 1650 1629 1651 - for (total_read = 0, current_offset = read_data; 1652 - read_size > total_read; 1653 - total_read += bytes_read, current_offset += bytes_read) { 1654 - current_read_size = min_t(const int, read_size - total_read, 1655 - cifs_sb->rsize); 1630 + for (total_read = 0; total_read < len; total_read += bytes_read) { 1631 + cur_len = min_t(const size_t, len - total_read, cifs_sb->rsize); 1656 1632 rc = -EAGAIN; 1657 - smb_read_data = NULL; 1633 + read_data = NULL; 1634 + 1658 1635 while (rc == -EAGAIN) { 1659 1636 int buf_type = CIFS_NO_BUFFER; 1660 1637 if (open_file->invalidHandle) { ··· 1662 1639 if (rc != 0) 1663 1640 break; 1664 1641 } 1665 - rc = CIFSSMBRead(xid, pTcon, 1666 - open_file->netfid, 1667 - current_read_size, *poffset, 1668 - &bytes_read, &smb_read_data, 1669 - &buf_type); 1670 - pSMBr = (struct smb_com_read_rsp *)smb_read_data; 1671 - if (smb_read_data) { 1672 - if (copy_to_user(current_offset, 1673 - smb_read_data + 1674 - 4 /* RFC1001 length field */ + 1675 - le16_to_cpu(pSMBr->DataOffset), 1676 - bytes_read)) 1642 + rc = CIFSSMBRead(xid, pTcon, open_file->netfid, 1643 + cur_len, *poffset, &bytes_read, 1644 + &read_data, &buf_type); 1645 + pSMBr = (struct smb_com_read_rsp *)read_data; 1646 + if (read_data) { 1647 + char *data_offset = read_data + 4 + 1648 + le16_to_cpu(pSMBr->DataOffset); 1649 + if (memcpy_toiovecend(iov, data_offset, 1650 + iov_offset, bytes_read)) 1677 1651 rc = -EFAULT; 1678 - 1679 1652 if (buf_type == CIFS_SMALL_BUFFER) 1680 - cifs_small_buf_release(smb_read_data); 1653 + cifs_small_buf_release(read_data); 1681 1654 else if (buf_type == CIFS_LARGE_BUFFER) 1682 - cifs_buf_release(smb_read_data); 1683 - smb_read_data = NULL; 1655 + cifs_buf_release(read_data); 1656 + read_data = NULL; 1657 + iov_offset += bytes_read; 1684 1658 } 1685 1659 } 1660 + 1686 1661 if (rc || (bytes_read == 0)) { 1687 1662 if (total_read) { 1688 1663 break; ··· 1693 1672 *poffset += bytes_read; 1694 1673 } 1695 1674 } 1675 + 1696 1676 FreeXid(xid); 1697 1677 return total_read; 1698 1678 } 1699 1679 1680 + ssize_t cifs_user_read(struct file *file, char __user *read_data, 1681 + size_t read_size, loff_t *poffset) 1682 + { 1683 + struct iovec iov; 1684 + iov.iov_base = read_data; 1685 + iov.iov_len = read_size; 1686 + 1687 + return cifs_iovec_read(file, &iov, 1, poffset); 1688 + } 1689 + 1690 + static ssize_t cifs_user_readv(struct kiocb *iocb, const struct iovec *iov, 1691 + unsigned long nr_segs, loff_t pos) 1692 + { 1693 + ssize_t read; 1694 + 1695 + read = cifs_iovec_read(iocb->ki_filp, iov, nr_segs, &pos); 1696 + if (read > 0) 1697 + iocb->ki_pos = pos; 1698 + 1699 + return read; 1700 + } 1701 + 1702 + ssize_t cifs_strict_readv(struct kiocb *iocb, const struct iovec *iov, 1703 + unsigned long nr_segs, loff_t pos) 1704 + { 1705 + struct inode *inode; 1706 + 1707 + inode = iocb->ki_filp->f_path.dentry->d_inode; 1708 + 1709 + if (CIFS_I(inode)->clientCanCacheRead) 1710 + return generic_file_aio_read(iocb, iov, nr_segs, pos); 1711 + 1712 + /* 1713 + * In strict cache mode we need to read from the server all the time 1714 + * if we don't have level II oplock because the server can delay mtime 1715 + * change - so we can't make a decision about inode invalidating. 1716 + * And we can also fail with pagereading if there are mandatory locks 1717 + * on pages affected by this read but not on the region from pos to 1718 + * pos+len-1. 1719 + */ 1720 + 1721 + return cifs_user_readv(iocb, iov, nr_segs, pos); 1722 + } 1700 1723 1701 1724 static ssize_t cifs_read(struct file *file, char *read_data, size_t read_size, 1702 - loff_t *poffset) 1725 + loff_t *poffset) 1703 1726 { 1704 1727 int rc = -EACCES; 1705 1728 unsigned int bytes_read = 0; ··· 1809 1744 } 1810 1745 FreeXid(xid); 1811 1746 return total_read; 1747 + } 1748 + 1749 + int cifs_file_strict_mmap(struct file *file, struct vm_area_struct *vma) 1750 + { 1751 + int rc, xid; 1752 + struct inode *inode = file->f_path.dentry->d_inode; 1753 + 1754 + xid = GetXid(); 1755 + 1756 + if (!CIFS_I(inode)->clientCanCacheRead) 1757 + cifs_invalidate_mapping(inode); 1758 + 1759 + rc = generic_file_mmap(file, vma); 1760 + FreeXid(xid); 1761 + return rc; 1812 1762 } 1813 1763 1814 1764 int cifs_file_mmap(struct file *file, struct vm_area_struct *vma) ··· 2272 2192 */ 2273 2193 if (!cfile->oplock_break_cancelled) { 2274 2194 rc = CIFSSMBLock(0, tlink_tcon(cfile->tlink), cfile->netfid, 0, 2275 - 0, 0, 0, LOCKING_ANDX_OPLOCK_RELEASE, false); 2195 + 0, 0, 0, LOCKING_ANDX_OPLOCK_RELEASE, false, 2196 + cinode->clientCanCacheRead ? 1 : 0); 2276 2197 cFYI(1, "Oplock release rc = %d", rc); 2277 2198 } 2278 2199
+6 -2
fs/cifs/inode.c
··· 44 44 inode->i_fop = &cifs_file_direct_nobrl_ops; 45 45 else 46 46 inode->i_fop = &cifs_file_direct_ops; 47 + } else if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_STRICT_IO) { 48 + if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_NO_BRL) 49 + inode->i_fop = &cifs_file_strict_nobrl_ops; 50 + else 51 + inode->i_fop = &cifs_file_strict_ops; 47 52 } else if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_NO_BRL) 48 53 inode->i_fop = &cifs_file_nobrl_ops; 49 54 else { /* not direct, send byte range locks */ 50 55 inode->i_fop = &cifs_file_ops; 51 56 } 52 - 53 57 54 58 /* check if server can support readpages */ 55 59 if (cifs_sb_master_tcon(cifs_sb)->ses->server->maxBuf < ··· 1683 1679 /* 1684 1680 * Zap the cache. Called when invalid_mapping flag is set. 1685 1681 */ 1686 - static void 1682 + void 1687 1683 cifs_invalidate_mapping(struct inode *inode) 1688 1684 { 1689 1685 int rc;
+1 -72
fs/cifs/misc.c
··· 571 571 pCifsInode = CIFS_I(netfile->dentry->d_inode); 572 572 573 573 cifs_set_oplock_level(pCifsInode, 574 - pSMB->OplockLevel); 574 + pSMB->OplockLevel ? OPLOCK_READ : 0); 575 575 /* 576 576 * cifs_oplock_break_put() can't be called 577 577 * from here. Get reference after queueing ··· 635 635 } 636 636 printk(" | %s\n", debug_line); 637 637 return; 638 - } 639 - 640 - /* Convert 16 bit Unicode pathname to wire format from string in current code 641 - page. Conversion may involve remapping up the seven characters that are 642 - only legal in POSIX-like OS (if they are present in the string). Path 643 - names are little endian 16 bit Unicode on the wire */ 644 - int 645 - cifsConvertToUCS(__le16 *target, const char *source, int maxlen, 646 - const struct nls_table *cp, int mapChars) 647 - { 648 - int i, j, charlen; 649 - int len_remaining = maxlen; 650 - char src_char; 651 - __u16 temp; 652 - 653 - if (!mapChars) 654 - return cifs_strtoUCS(target, source, PATH_MAX, cp); 655 - 656 - for (i = 0, j = 0; i < maxlen; j++) { 657 - src_char = source[i]; 658 - switch (src_char) { 659 - case 0: 660 - target[j] = 0; 661 - goto ctoUCS_out; 662 - case ':': 663 - target[j] = cpu_to_le16(UNI_COLON); 664 - break; 665 - case '*': 666 - target[j] = cpu_to_le16(UNI_ASTERIK); 667 - break; 668 - case '?': 669 - target[j] = cpu_to_le16(UNI_QUESTION); 670 - break; 671 - case '<': 672 - target[j] = cpu_to_le16(UNI_LESSTHAN); 673 - break; 674 - case '>': 675 - target[j] = cpu_to_le16(UNI_GRTRTHAN); 676 - break; 677 - case '|': 678 - target[j] = cpu_to_le16(UNI_PIPE); 679 - break; 680 - /* BB We can not handle remapping slash until 681 - all the calls to build_path_from_dentry 682 - are modified, as they use slash as separator BB */ 683 - /* case '\\': 684 - target[j] = cpu_to_le16(UNI_SLASH); 685 - break;*/ 686 - default: 687 - charlen = cp->char2uni(source+i, 688 - len_remaining, &temp); 689 - /* if no match, use question mark, which 690 - at least in some cases servers as wild card */ 691 - if (charlen < 1) { 692 - target[j] = cpu_to_le16(0x003f); 693 - charlen = 1; 694 - } else 695 - target[j] = cpu_to_le16(temp); 696 - len_remaining -= charlen; 697 - /* character may take more than one byte in the 698 - the source string, but will take exactly two 699 - bytes in the target string */ 700 - i += charlen; 701 - continue; 702 - } 703 - i++; /* move to next char in source string */ 704 - len_remaining--; 705 - } 706 - 707 - ctoUCS_out: 708 - return i; 709 638 } 710 639 711 640 void
+2 -2
fs/cifs/netmisc.c
··· 916 916 smbCalcSize(struct smb_hdr *ptr) 917 917 { 918 918 return (sizeof(struct smb_hdr) + (2 * ptr->WordCount) + 919 - 2 /* size of the bcc field */ + BCC(ptr)); 919 + 2 /* size of the bcc field */ + get_bcc(ptr)); 920 920 } 921 921 922 922 unsigned int 923 923 smbCalcSize_LE(struct smb_hdr *ptr) 924 924 { 925 925 return (sizeof(struct smb_hdr) + (2 * ptr->WordCount) + 926 - 2 /* size of the bcc field */ + le16_to_cpu(BCC_LE(ptr))); 926 + 2 /* size of the bcc field */ + get_bcc_le(ptr)); 927 927 } 928 928 929 929 /* The following are taken from fs/ntfs/util.c */
+7 -8
fs/cifs/sess.c
··· 277 277 } 278 278 279 279 static void 280 - decode_unicode_ssetup(char **pbcc_area, int bleft, struct cifsSesInfo *ses, 280 + decode_unicode_ssetup(char **pbcc_area, __u16 bleft, struct cifsSesInfo *ses, 281 281 const struct nls_table *nls_cp) 282 282 { 283 283 int len; ··· 323 323 return; 324 324 } 325 325 326 - static int decode_ascii_ssetup(char **pbcc_area, int bleft, 326 + static int decode_ascii_ssetup(char **pbcc_area, __u16 bleft, 327 327 struct cifsSesInfo *ses, 328 328 const struct nls_table *nls_cp) 329 329 { ··· 575 575 char *str_area; 576 576 SESSION_SETUP_ANDX *pSMB; 577 577 __u32 capabilities; 578 - int count; 578 + __u16 count; 579 579 int resp_buf_type; 580 580 struct kvec iov[3]; 581 581 enum securityEnum type; 582 - __u16 action; 583 - int bytes_remaining; 582 + __u16 action, bytes_remaining; 584 583 struct key *spnego_key = NULL; 585 584 __le32 phase = NtLmNegotiate; /* NTLMSSP, if needed, is multistage */ 586 585 u16 blob_len; ··· 875 876 count = iov[1].iov_len + iov[2].iov_len; 876 877 smb_buf->smb_buf_length += count; 877 878 878 - BCC_LE(smb_buf) = cpu_to_le16(count); 879 + put_bcc_le(count, smb_buf); 879 880 880 881 rc = SendReceive2(xid, ses, iov, 3 /* num_iovecs */, &resp_buf_type, 881 - CIFS_STD_OP /* not long */ | CIFS_LOG_ERROR); 882 + CIFS_LOG_ERROR); 882 883 /* SMB request buf freed in SendReceive2 */ 883 884 884 885 pSMB = (SESSION_SETUP_ANDX *)iov[0].iov_base; ··· 909 910 cFYI(1, "UID = %d ", ses->Suid); 910 911 /* response can have either 3 or 4 word count - Samba sends 3 */ 911 912 /* and lanman response is 3 */ 912 - bytes_remaining = BCC(smb_buf); 913 + bytes_remaining = get_bcc(smb_buf); 913 914 bcc_ptr = pByteArea(smb_buf); 914 915 915 916 if (smb_buf->WordCount == 4) {
+209 -231
fs/cifs/transport.c
··· 36 36 37 37 extern mempool_t *cifs_mid_poolp; 38 38 39 - static struct mid_q_entry * 39 + static void 40 + wake_up_task(struct mid_q_entry *mid) 41 + { 42 + wake_up_process(mid->callback_data); 43 + } 44 + 45 + struct mid_q_entry * 40 46 AllocMidQEntry(const struct smb_hdr *smb_buffer, struct TCP_Server_Info *server) 41 47 { 42 48 struct mid_q_entry *temp; ··· 64 58 /* do_gettimeofday(&temp->when_sent);*/ /* easier to use jiffies */ 65 59 /* when mid allocated can be before when sent */ 66 60 temp->when_alloc = jiffies; 67 - temp->tsk = current; 61 + 62 + /* 63 + * The default is for the mid to be synchronous, so the 64 + * default callback just wakes up the current task. 65 + */ 66 + temp->callback = wake_up_task; 67 + temp->callback_data = current; 68 68 } 69 69 70 - spin_lock(&GlobalMid_Lock); 71 - list_add_tail(&temp->qhead, &server->pending_mid_q); 72 70 atomic_inc(&midCount); 73 71 temp->midState = MID_REQUEST_ALLOCATED; 74 - spin_unlock(&GlobalMid_Lock); 75 72 return temp; 76 73 } 77 74 78 - static void 75 + void 79 76 DeleteMidQEntry(struct mid_q_entry *midEntry) 80 77 { 81 78 #ifdef CONFIG_CIFS_STATS2 82 79 unsigned long now; 83 80 #endif 84 - spin_lock(&GlobalMid_Lock); 85 81 midEntry->midState = MID_FREE; 86 - list_del(&midEntry->qhead); 87 82 atomic_dec(&midCount); 88 - spin_unlock(&GlobalMid_Lock); 89 83 if (midEntry->largeBuf) 90 84 cifs_buf_release(midEntry->resp_buf); 91 85 else ··· 107 101 } 108 102 #endif 109 103 mempool_free(midEntry, cifs_mid_poolp); 104 + } 105 + 106 + static void 107 + delete_mid(struct mid_q_entry *mid) 108 + { 109 + spin_lock(&GlobalMid_Lock); 110 + list_del(&mid->qhead); 111 + spin_unlock(&GlobalMid_Lock); 112 + 113 + DeleteMidQEntry(mid); 110 114 } 111 115 112 116 static int ··· 260 244 return smb_sendv(server, &iov, 1); 261 245 } 262 246 263 - static int wait_for_free_request(struct cifsSesInfo *ses, const int long_op) 247 + static int wait_for_free_request(struct TCP_Server_Info *server, 248 + const int long_op) 264 249 { 265 250 if (long_op == CIFS_ASYNC_OP) { 266 251 /* oplock breaks must not be held up */ 267 - atomic_inc(&ses->server->inFlight); 252 + atomic_inc(&server->inFlight); 268 253 return 0; 269 254 } 270 255 271 256 spin_lock(&GlobalMid_Lock); 272 257 while (1) { 273 - if (atomic_read(&ses->server->inFlight) >= 274 - cifs_max_pending){ 258 + if (atomic_read(&server->inFlight) >= cifs_max_pending) { 275 259 spin_unlock(&GlobalMid_Lock); 276 260 #ifdef CONFIG_CIFS_STATS2 277 - atomic_inc(&ses->server->num_waiters); 261 + atomic_inc(&server->num_waiters); 278 262 #endif 279 - wait_event(ses->server->request_q, 280 - atomic_read(&ses->server->inFlight) 263 + wait_event(server->request_q, 264 + atomic_read(&server->inFlight) 281 265 < cifs_max_pending); 282 266 #ifdef CONFIG_CIFS_STATS2 283 - atomic_dec(&ses->server->num_waiters); 267 + atomic_dec(&server->num_waiters); 284 268 #endif 285 269 spin_lock(&GlobalMid_Lock); 286 270 } else { 287 - if (ses->server->tcpStatus == CifsExiting) { 271 + if (server->tcpStatus == CifsExiting) { 288 272 spin_unlock(&GlobalMid_Lock); 289 273 return -ENOENT; 290 274 } ··· 294 278 295 279 /* update # of requests on the wire to server */ 296 280 if (long_op != CIFS_BLOCKING_OP) 297 - atomic_inc(&ses->server->inFlight); 281 + atomic_inc(&server->inFlight); 298 282 spin_unlock(&GlobalMid_Lock); 299 283 break; 300 284 } ··· 324 308 *ppmidQ = AllocMidQEntry(in_buf, ses->server); 325 309 if (*ppmidQ == NULL) 326 310 return -ENOMEM; 311 + spin_lock(&GlobalMid_Lock); 312 + list_add_tail(&(*ppmidQ)->qhead, &ses->server->pending_mid_q); 313 + spin_unlock(&GlobalMid_Lock); 327 314 return 0; 328 315 } 329 316 330 - static int wait_for_response(struct cifsSesInfo *ses, 331 - struct mid_q_entry *midQ, 332 - unsigned long timeout, 333 - unsigned long time_to_wait) 317 + static int 318 + wait_for_response(struct TCP_Server_Info *server, struct mid_q_entry *midQ) 334 319 { 335 - unsigned long curr_timeout; 320 + int error; 336 321 337 - for (;;) { 338 - curr_timeout = timeout + jiffies; 339 - wait_event_timeout(ses->server->response_q, 340 - midQ->midState != MID_REQUEST_SUBMITTED, timeout); 322 + error = wait_event_killable(server->response_q, 323 + midQ->midState != MID_REQUEST_SUBMITTED); 324 + if (error < 0) 325 + return -ERESTARTSYS; 341 326 342 - if (time_after(jiffies, curr_timeout) && 343 - (midQ->midState == MID_REQUEST_SUBMITTED) && 344 - ((ses->server->tcpStatus == CifsGood) || 345 - (ses->server->tcpStatus == CifsNew))) { 346 - 347 - unsigned long lrt; 348 - 349 - /* We timed out. Is the server still 350 - sending replies ? */ 351 - spin_lock(&GlobalMid_Lock); 352 - lrt = ses->server->lstrp; 353 - spin_unlock(&GlobalMid_Lock); 354 - 355 - /* Calculate time_to_wait past last receive time. 356 - Although we prefer not to time out if the 357 - server is still responding - we will time 358 - out if the server takes more than 15 (or 45 359 - or 180) seconds to respond to this request 360 - and has not responded to any request from 361 - other threads on the client within 10 seconds */ 362 - lrt += time_to_wait; 363 - if (time_after(jiffies, lrt)) { 364 - /* No replies for time_to_wait. */ 365 - cERROR(1, "server not responding"); 366 - return -1; 367 - } 368 - } else { 369 - return 0; 370 - } 371 - } 327 + return 0; 372 328 } 373 329 330 + 331 + /* 332 + * Send a SMB request and set the callback function in the mid to handle 333 + * the result. Caller is responsible for dealing with timeouts. 334 + */ 335 + int 336 + cifs_call_async(struct TCP_Server_Info *server, struct smb_hdr *in_buf, 337 + mid_callback_t *callback, void *cbdata) 338 + { 339 + int rc; 340 + struct mid_q_entry *mid; 341 + 342 + rc = wait_for_free_request(server, CIFS_ASYNC_OP); 343 + if (rc) 344 + return rc; 345 + 346 + mutex_lock(&server->srv_mutex); 347 + mid = AllocMidQEntry(in_buf, server); 348 + if (mid == NULL) { 349 + mutex_unlock(&server->srv_mutex); 350 + return -ENOMEM; 351 + } 352 + 353 + /* put it on the pending_mid_q */ 354 + spin_lock(&GlobalMid_Lock); 355 + list_add_tail(&mid->qhead, &server->pending_mid_q); 356 + spin_unlock(&GlobalMid_Lock); 357 + 358 + rc = cifs_sign_smb(in_buf, server, &mid->sequence_number); 359 + if (rc) { 360 + mutex_unlock(&server->srv_mutex); 361 + goto out_err; 362 + } 363 + 364 + mid->callback = callback; 365 + mid->callback_data = cbdata; 366 + mid->midState = MID_REQUEST_SUBMITTED; 367 + #ifdef CONFIG_CIFS_STATS2 368 + atomic_inc(&server->inSend); 369 + #endif 370 + rc = smb_send(server, in_buf, in_buf->smb_buf_length); 371 + #ifdef CONFIG_CIFS_STATS2 372 + atomic_dec(&server->inSend); 373 + mid->when_sent = jiffies; 374 + #endif 375 + mutex_unlock(&server->srv_mutex); 376 + if (rc) 377 + goto out_err; 378 + 379 + return rc; 380 + out_err: 381 + delete_mid(mid); 382 + atomic_dec(&server->inFlight); 383 + wake_up(&server->request_q); 384 + return rc; 385 + } 374 386 375 387 /* 376 388 * ··· 426 382 return rc; 427 383 } 428 384 385 + static int 386 + sync_mid_result(struct mid_q_entry *mid, struct TCP_Server_Info *server) 387 + { 388 + int rc = 0; 389 + 390 + cFYI(1, "%s: cmd=%d mid=%d state=%d", __func__, mid->command, 391 + mid->mid, mid->midState); 392 + 393 + spin_lock(&GlobalMid_Lock); 394 + /* ensure that it's no longer on the pending_mid_q */ 395 + list_del_init(&mid->qhead); 396 + 397 + switch (mid->midState) { 398 + case MID_RESPONSE_RECEIVED: 399 + spin_unlock(&GlobalMid_Lock); 400 + return rc; 401 + case MID_REQUEST_SUBMITTED: 402 + /* socket is going down, reject all calls */ 403 + if (server->tcpStatus == CifsExiting) { 404 + cERROR(1, "%s: canceling mid=%d cmd=0x%x state=%d", 405 + __func__, mid->mid, mid->command, mid->midState); 406 + rc = -EHOSTDOWN; 407 + break; 408 + } 409 + case MID_RETRY_NEEDED: 410 + rc = -EAGAIN; 411 + break; 412 + default: 413 + cERROR(1, "%s: invalid mid state mid=%d state=%d", __func__, 414 + mid->mid, mid->midState); 415 + rc = -EIO; 416 + } 417 + spin_unlock(&GlobalMid_Lock); 418 + 419 + DeleteMidQEntry(mid); 420 + return rc; 421 + } 422 + 423 + /* 424 + * An NT cancel request header looks just like the original request except: 425 + * 426 + * The Command is SMB_COM_NT_CANCEL 427 + * The WordCount is zeroed out 428 + * The ByteCount is zeroed out 429 + * 430 + * This function mangles an existing request buffer into a 431 + * SMB_COM_NT_CANCEL request and then sends it. 432 + */ 433 + static int 434 + send_nt_cancel(struct TCP_Server_Info *server, struct smb_hdr *in_buf, 435 + struct mid_q_entry *mid) 436 + { 437 + int rc = 0; 438 + 439 + /* -4 for RFC1001 length and +2 for BCC field */ 440 + in_buf->smb_buf_length = sizeof(struct smb_hdr) - 4 + 2; 441 + in_buf->Command = SMB_COM_NT_CANCEL; 442 + in_buf->WordCount = 0; 443 + put_bcc_le(0, in_buf); 444 + 445 + mutex_lock(&server->srv_mutex); 446 + rc = cifs_sign_smb(in_buf, server, &mid->sequence_number); 447 + if (rc) { 448 + mutex_unlock(&server->srv_mutex); 449 + return rc; 450 + } 451 + rc = smb_send(server, in_buf, in_buf->smb_buf_length); 452 + mutex_unlock(&server->srv_mutex); 453 + 454 + cFYI(1, "issued NT_CANCEL for mid %u, rc = %d", 455 + in_buf->Mid, rc); 456 + 457 + return rc; 458 + } 459 + 429 460 int 430 461 SendReceive2(const unsigned int xid, struct cifsSesInfo *ses, 431 462 struct kvec *iov, int n_vec, int *pRespBufType /* ret */, ··· 509 390 int rc = 0; 510 391 int long_op; 511 392 unsigned int receive_len; 512 - unsigned long timeout; 513 393 struct mid_q_entry *midQ; 514 394 struct smb_hdr *in_buf = iov[0].iov_base; 515 395 ··· 531 413 to the same server. We may make this configurable later or 532 414 use ses->maxReq */ 533 415 534 - rc = wait_for_free_request(ses, long_op); 416 + rc = wait_for_free_request(ses->server, long_op); 535 417 if (rc) { 536 418 cifs_small_buf_release(in_buf); 537 419 return rc; ··· 575 457 if (rc < 0) 576 458 goto out; 577 459 578 - if (long_op == CIFS_STD_OP) 579 - timeout = 15 * HZ; 580 - else if (long_op == CIFS_VLONG_OP) /* e.g. slow writes past EOF */ 581 - timeout = 180 * HZ; 582 - else if (long_op == CIFS_LONG_OP) 583 - timeout = 45 * HZ; /* should be greater than 584 - servers oplock break timeout (about 43 seconds) */ 585 - else if (long_op == CIFS_ASYNC_OP) 460 + if (long_op == CIFS_ASYNC_OP) 586 461 goto out; 587 - else if (long_op == CIFS_BLOCKING_OP) 588 - timeout = 0x7FFFFFFF; /* large, but not so large as to wrap */ 589 - else { 590 - cERROR(1, "unknown timeout flag %d", long_op); 591 - rc = -EIO; 462 + 463 + rc = wait_for_response(ses->server, midQ); 464 + if (rc != 0) 592 465 goto out; 593 - } 594 466 595 - /* wait for 15 seconds or until woken up due to response arriving or 596 - due to last connection to this server being unmounted */ 597 - if (signal_pending(current)) { 598 - /* if signal pending do not hold up user for full smb timeout 599 - but we still give response a chance to complete */ 600 - timeout = 2 * HZ; 601 - } 602 - 603 - /* No user interrupts in wait - wreaks havoc with performance */ 604 - wait_for_response(ses, midQ, timeout, 10 * HZ); 605 - 606 - spin_lock(&GlobalMid_Lock); 607 - 608 - if (midQ->resp_buf == NULL) { 609 - cERROR(1, "No response to cmd %d mid %d", 610 - midQ->command, midQ->mid); 611 - if (midQ->midState == MID_REQUEST_SUBMITTED) { 612 - if (ses->server->tcpStatus == CifsExiting) 613 - rc = -EHOSTDOWN; 614 - else { 615 - ses->server->tcpStatus = CifsNeedReconnect; 616 - midQ->midState = MID_RETRY_NEEDED; 617 - } 618 - } 619 - 620 - if (rc != -EHOSTDOWN) { 621 - if (midQ->midState == MID_RETRY_NEEDED) { 622 - rc = -EAGAIN; 623 - cFYI(1, "marking request for retry"); 624 - } else { 625 - rc = -EIO; 626 - } 627 - } 628 - spin_unlock(&GlobalMid_Lock); 629 - DeleteMidQEntry(midQ); 630 - /* Update # of requests on wire to server */ 467 + rc = sync_mid_result(midQ, ses->server); 468 + if (rc != 0) { 631 469 atomic_dec(&ses->server->inFlight); 632 470 wake_up(&ses->server->request_q); 633 471 return rc; 634 472 } 635 473 636 - spin_unlock(&GlobalMid_Lock); 637 474 receive_len = midQ->resp_buf->smb_buf_length; 638 475 639 476 if (receive_len > CIFSMaxBufSize + MAX_CIFS_HDR_SIZE) { ··· 632 559 if (receive_len >= sizeof(struct smb_hdr) - 4 633 560 /* do not count RFC1001 header */ + 634 561 (2 * midQ->resp_buf->WordCount) + 2 /* bcc */ ) 635 - BCC(midQ->resp_buf) = 636 - le16_to_cpu(BCC_LE(midQ->resp_buf)); 562 + put_bcc(get_bcc_le(midQ->resp_buf), midQ->resp_buf); 637 563 if ((flags & CIFS_NO_RESP) == 0) 638 564 midQ->resp_buf = NULL; /* mark it so buf will 639 565 not be freed by 640 - DeleteMidQEntry */ 566 + delete_mid */ 641 567 } else { 642 568 rc = -EIO; 643 569 cFYI(1, "Bad MID state?"); 644 570 } 645 571 646 572 out: 647 - DeleteMidQEntry(midQ); 573 + delete_mid(midQ); 648 574 atomic_dec(&ses->server->inFlight); 649 575 wake_up(&ses->server->request_q); 650 576 ··· 657 585 { 658 586 int rc = 0; 659 587 unsigned int receive_len; 660 - unsigned long timeout; 661 588 struct mid_q_entry *midQ; 662 589 663 590 if (ses == NULL) { ··· 681 610 return -EIO; 682 611 } 683 612 684 - rc = wait_for_free_request(ses, long_op); 613 + rc = wait_for_free_request(ses->server, long_op); 685 614 if (rc) 686 615 return rc; 687 616 ··· 720 649 if (rc < 0) 721 650 goto out; 722 651 723 - if (long_op == CIFS_STD_OP) 724 - timeout = 15 * HZ; 725 - /* wait for 15 seconds or until woken up due to response arriving or 726 - due to last connection to this server being unmounted */ 727 - else if (long_op == CIFS_ASYNC_OP) 652 + if (long_op == CIFS_ASYNC_OP) 728 653 goto out; 729 - else if (long_op == CIFS_VLONG_OP) /* writes past EOF can be slow */ 730 - timeout = 180 * HZ; 731 - else if (long_op == CIFS_LONG_OP) 732 - timeout = 45 * HZ; /* should be greater than 733 - servers oplock break timeout (about 43 seconds) */ 734 - else if (long_op == CIFS_BLOCKING_OP) 735 - timeout = 0x7FFFFFFF; /* large but no so large as to wrap */ 736 - else { 737 - cERROR(1, "unknown timeout flag %d", long_op); 738 - rc = -EIO; 654 + 655 + rc = wait_for_response(ses->server, midQ); 656 + if (rc != 0) 739 657 goto out; 740 - } 741 658 742 - if (signal_pending(current)) { 743 - /* if signal pending do not hold up user for full smb timeout 744 - but we still give response a chance to complete */ 745 - timeout = 2 * HZ; 746 - } 747 - 748 - /* No user interrupts in wait - wreaks havoc with performance */ 749 - wait_for_response(ses, midQ, timeout, 10 * HZ); 750 - 751 - spin_lock(&GlobalMid_Lock); 752 - if (midQ->resp_buf == NULL) { 753 - cERROR(1, "No response for cmd %d mid %d", 754 - midQ->command, midQ->mid); 755 - if (midQ->midState == MID_REQUEST_SUBMITTED) { 756 - if (ses->server->tcpStatus == CifsExiting) 757 - rc = -EHOSTDOWN; 758 - else { 759 - ses->server->tcpStatus = CifsNeedReconnect; 760 - midQ->midState = MID_RETRY_NEEDED; 761 - } 762 - } 763 - 764 - if (rc != -EHOSTDOWN) { 765 - if (midQ->midState == MID_RETRY_NEEDED) { 766 - rc = -EAGAIN; 767 - cFYI(1, "marking request for retry"); 768 - } else { 769 - rc = -EIO; 770 - } 771 - } 772 - spin_unlock(&GlobalMid_Lock); 773 - DeleteMidQEntry(midQ); 774 - /* Update # of requests on wire to server */ 659 + rc = sync_mid_result(midQ, ses->server); 660 + if (rc != 0) { 775 661 atomic_dec(&ses->server->inFlight); 776 662 wake_up(&ses->server->request_q); 777 663 return rc; 778 664 } 779 665 780 - spin_unlock(&GlobalMid_Lock); 781 666 receive_len = midQ->resp_buf->smb_buf_length; 782 667 783 668 if (receive_len > CIFSMaxBufSize + MAX_CIFS_HDR_SIZE) { ··· 775 748 if (receive_len >= sizeof(struct smb_hdr) - 4 776 749 /* do not count RFC1001 header */ + 777 750 (2 * out_buf->WordCount) + 2 /* bcc */ ) 778 - BCC(out_buf) = le16_to_cpu(BCC_LE(out_buf)); 751 + put_bcc(get_bcc_le(midQ->resp_buf), midQ->resp_buf); 779 752 } else { 780 753 rc = -EIO; 781 754 cERROR(1, "Bad MID state?"); 782 755 } 783 756 784 757 out: 785 - DeleteMidQEntry(midQ); 758 + delete_mid(midQ); 786 759 atomic_dec(&ses->server->inFlight); 787 760 wake_up(&ses->server->request_q); 788 761 789 - return rc; 790 - } 791 - 792 - /* Send an NT_CANCEL SMB to cause the POSIX blocking lock to return. */ 793 - 794 - static int 795 - send_nt_cancel(struct cifsTconInfo *tcon, struct smb_hdr *in_buf, 796 - struct mid_q_entry *midQ) 797 - { 798 - int rc = 0; 799 - struct cifsSesInfo *ses = tcon->ses; 800 - __u16 mid = in_buf->Mid; 801 - 802 - header_assemble(in_buf, SMB_COM_NT_CANCEL, tcon, 0); 803 - in_buf->Mid = mid; 804 - mutex_lock(&ses->server->srv_mutex); 805 - rc = cifs_sign_smb(in_buf, ses->server, &midQ->sequence_number); 806 - if (rc) { 807 - mutex_unlock(&ses->server->srv_mutex); 808 - return rc; 809 - } 810 - rc = smb_send(ses->server, in_buf, in_buf->smb_buf_length); 811 - mutex_unlock(&ses->server->srv_mutex); 812 762 return rc; 813 763 } 814 764 ··· 811 807 pSMB->hdr.Mid = GetNextMid(ses->server); 812 808 813 809 return SendReceive(xid, ses, in_buf, out_buf, 814 - &bytes_returned, CIFS_STD_OP); 810 + &bytes_returned, 0); 815 811 } 816 812 817 813 int ··· 849 845 return -EIO; 850 846 } 851 847 852 - rc = wait_for_free_request(ses, CIFS_BLOCKING_OP); 848 + rc = wait_for_free_request(ses->server, CIFS_BLOCKING_OP); 853 849 if (rc) 854 850 return rc; 855 851 ··· 867 863 868 864 rc = cifs_sign_smb(in_buf, ses->server, &midQ->sequence_number); 869 865 if (rc) { 870 - DeleteMidQEntry(midQ); 866 + delete_mid(midQ); 871 867 mutex_unlock(&ses->server->srv_mutex); 872 868 return rc; 873 869 } ··· 884 880 mutex_unlock(&ses->server->srv_mutex); 885 881 886 882 if (rc < 0) { 887 - DeleteMidQEntry(midQ); 883 + delete_mid(midQ); 888 884 return rc; 889 885 } 890 886 ··· 903 899 if (in_buf->Command == SMB_COM_TRANSACTION2) { 904 900 /* POSIX lock. We send a NT_CANCEL SMB to cause the 905 901 blocking lock to return. */ 906 - 907 - rc = send_nt_cancel(tcon, in_buf, midQ); 902 + rc = send_nt_cancel(ses->server, in_buf, midQ); 908 903 if (rc) { 909 - DeleteMidQEntry(midQ); 904 + delete_mid(midQ); 910 905 return rc; 911 906 } 912 907 } else { ··· 917 914 /* If we get -ENOLCK back the lock may have 918 915 already been removed. Don't exit in this case. */ 919 916 if (rc && rc != -ENOLCK) { 920 - DeleteMidQEntry(midQ); 917 + delete_mid(midQ); 921 918 return rc; 922 919 } 923 920 } 924 921 925 - /* Wait 5 seconds for the response. */ 926 - if (wait_for_response(ses, midQ, 5 * HZ, 5 * HZ) == 0) { 922 + if (wait_for_response(ses->server, midQ) == 0) { 927 923 /* We got the response - restart system call. */ 928 924 rstart = 1; 929 925 } 930 926 } 931 927 932 - spin_lock(&GlobalMid_Lock); 933 - if (midQ->resp_buf) { 934 - spin_unlock(&GlobalMid_Lock); 935 - receive_len = midQ->resp_buf->smb_buf_length; 936 - } else { 937 - cERROR(1, "No response for cmd %d mid %d", 938 - midQ->command, midQ->mid); 939 - if (midQ->midState == MID_REQUEST_SUBMITTED) { 940 - if (ses->server->tcpStatus == CifsExiting) 941 - rc = -EHOSTDOWN; 942 - else { 943 - ses->server->tcpStatus = CifsNeedReconnect; 944 - midQ->midState = MID_RETRY_NEEDED; 945 - } 946 - } 947 - 948 - if (rc != -EHOSTDOWN) { 949 - if (midQ->midState == MID_RETRY_NEEDED) { 950 - rc = -EAGAIN; 951 - cFYI(1, "marking request for retry"); 952 - } else { 953 - rc = -EIO; 954 - } 955 - } 956 - spin_unlock(&GlobalMid_Lock); 957 - DeleteMidQEntry(midQ); 928 + rc = sync_mid_result(midQ, ses->server); 929 + if (rc != 0) 958 930 return rc; 959 - } 960 931 932 + receive_len = midQ->resp_buf->smb_buf_length; 961 933 if (receive_len > CIFSMaxBufSize + MAX_CIFS_HDR_SIZE) { 962 934 cERROR(1, "Frame too large received. Length: %d Xid: %d", 963 935 receive_len, xid); ··· 976 998 if (receive_len >= sizeof(struct smb_hdr) - 4 977 999 /* do not count RFC1001 header */ + 978 1000 (2 * out_buf->WordCount) + 2 /* bcc */ ) 979 - BCC(out_buf) = le16_to_cpu(BCC_LE(out_buf)); 1001 + put_bcc(get_bcc_le(out_buf), out_buf); 980 1002 981 1003 out: 982 - DeleteMidQEntry(midQ); 1004 + delete_mid(midQ); 983 1005 if (rstart && rc == -EACCES) 984 1006 return -ERESTARTSYS; 985 1007 return rc;
+7 -3
fs/direct-io.c
··· 325 325 } 326 326 EXPORT_SYMBOL_GPL(dio_end_io); 327 327 328 - static int 328 + static void 329 329 dio_bio_alloc(struct dio *dio, struct block_device *bdev, 330 330 sector_t first_sector, int nr_vecs) 331 331 { 332 332 struct bio *bio; 333 333 334 + /* 335 + * bio_alloc() is guaranteed to return a bio when called with 336 + * __GFP_WAIT and we request a valid number of vectors. 337 + */ 334 338 bio = bio_alloc(GFP_KERNEL, nr_vecs); 335 339 336 340 bio->bi_bdev = bdev; ··· 346 342 347 343 dio->bio = bio; 348 344 dio->logical_offset_in_bio = dio->cur_page_fs_offset; 349 - return 0; 350 345 } 351 346 352 347 /* ··· 586 583 goto out; 587 584 sector = start_sector << (dio->blkbits - 9); 588 585 nr_pages = min(dio->pages_in_io, bio_get_nr_vecs(dio->map_bh.b_bdev)); 586 + nr_pages = min(nr_pages, BIO_MAX_PAGES); 589 587 BUG_ON(nr_pages <= 0); 590 - ret = dio_bio_alloc(dio, dio->map_bh.b_bdev, sector, nr_pages); 588 + dio_bio_alloc(dio, dio->map_bh.b_bdev, sector, nr_pages); 591 589 dio->boundary = 0; 592 590 out: 593 591 return ret;
+7 -18
fs/ext3/super.c
··· 754 754 static int ext3_mark_dquot_dirty(struct dquot *dquot); 755 755 static int ext3_write_info(struct super_block *sb, int type); 756 756 static int ext3_quota_on(struct super_block *sb, int type, int format_id, 757 - char *path); 757 + struct path *path); 758 758 static int ext3_quota_on_mount(struct super_block *sb, int type); 759 759 static ssize_t ext3_quota_read(struct super_block *sb, int type, char *data, 760 760 size_t len, loff_t off); ··· 2877 2877 * Standard function to be called on quota_on 2878 2878 */ 2879 2879 static int ext3_quota_on(struct super_block *sb, int type, int format_id, 2880 - char *name) 2880 + struct path *path) 2881 2881 { 2882 2882 int err; 2883 - struct path path; 2884 2883 2885 2884 if (!test_opt(sb, QUOTA)) 2886 2885 return -EINVAL; 2887 2886 2888 - err = kern_path(name, LOOKUP_FOLLOW, &path); 2889 - if (err) 2890 - return err; 2891 - 2892 2887 /* Quotafile not on the same filesystem? */ 2893 - if (path.mnt->mnt_sb != sb) { 2894 - path_put(&path); 2888 + if (path->mnt->mnt_sb != sb) 2895 2889 return -EXDEV; 2896 - } 2897 2890 /* Journaling quota? */ 2898 2891 if (EXT3_SB(sb)->s_qf_names[type]) { 2899 2892 /* Quotafile not of fs root? */ 2900 - if (path.dentry->d_parent != sb->s_root) 2893 + if (path->dentry->d_parent != sb->s_root) 2901 2894 ext3_msg(sb, KERN_WARNING, 2902 2895 "warning: Quota file not on filesystem root. " 2903 2896 "Journaled quota will not work."); ··· 2900 2907 * When we journal data on quota file, we have to flush journal to see 2901 2908 * all updates to the file when we bypass pagecache... 2902 2909 */ 2903 - if (ext3_should_journal_data(path.dentry->d_inode)) { 2910 + if (ext3_should_journal_data(path->dentry->d_inode)) { 2904 2911 /* 2905 2912 * We don't need to lock updates but journal_flush() could 2906 2913 * otherwise be livelocked... ··· 2908 2915 journal_lock_updates(EXT3_SB(sb)->s_journal); 2909 2916 err = journal_flush(EXT3_SB(sb)->s_journal); 2910 2917 journal_unlock_updates(EXT3_SB(sb)->s_journal); 2911 - if (err) { 2912 - path_put(&path); 2918 + if (err) 2913 2919 return err; 2914 - } 2915 2920 } 2916 2921 2917 - err = dquot_quota_on_path(sb, type, format_id, &path); 2918 - path_put(&path); 2919 - return err; 2922 + return dquot_quota_on(sb, type, format_id, path); 2920 2923 } 2921 2924 2922 2925 /* Read data from quotafile - avoid pagecache and such because we cannot afford
+7 -18
fs/ext4/super.c
··· 1161 1161 static int ext4_mark_dquot_dirty(struct dquot *dquot); 1162 1162 static int ext4_write_info(struct super_block *sb, int type); 1163 1163 static int ext4_quota_on(struct super_block *sb, int type, int format_id, 1164 - char *path); 1164 + struct path *path); 1165 1165 static int ext4_quota_off(struct super_block *sb, int type); 1166 1166 static int ext4_quota_on_mount(struct super_block *sb, int type); 1167 1167 static ssize_t ext4_quota_read(struct super_block *sb, int type, char *data, ··· 4558 4558 * Standard function to be called on quota_on 4559 4559 */ 4560 4560 static int ext4_quota_on(struct super_block *sb, int type, int format_id, 4561 - char *name) 4561 + struct path *path) 4562 4562 { 4563 4563 int err; 4564 - struct path path; 4565 4564 4566 4565 if (!test_opt(sb, QUOTA)) 4567 4566 return -EINVAL; 4568 4567 4569 - err = kern_path(name, LOOKUP_FOLLOW, &path); 4570 - if (err) 4571 - return err; 4572 - 4573 4568 /* Quotafile not on the same filesystem? */ 4574 - if (path.mnt->mnt_sb != sb) { 4575 - path_put(&path); 4569 + if (path->mnt->mnt_sb != sb) 4576 4570 return -EXDEV; 4577 - } 4578 4571 /* Journaling quota? */ 4579 4572 if (EXT4_SB(sb)->s_qf_names[type]) { 4580 4573 /* Quotafile not in fs root? */ 4581 - if (path.dentry->d_parent != sb->s_root) 4574 + if (path->dentry->d_parent != sb->s_root) 4582 4575 ext4_msg(sb, KERN_WARNING, 4583 4576 "Quota file not on filesystem root. " 4584 4577 "Journaled quota will not work"); ··· 4582 4589 * all updates to the file when we bypass pagecache... 4583 4590 */ 4584 4591 if (EXT4_SB(sb)->s_journal && 4585 - ext4_should_journal_data(path.dentry->d_inode)) { 4592 + ext4_should_journal_data(path->dentry->d_inode)) { 4586 4593 /* 4587 4594 * We don't need to lock updates but journal_flush() could 4588 4595 * otherwise be livelocked... ··· 4590 4597 jbd2_journal_lock_updates(EXT4_SB(sb)->s_journal); 4591 4598 err = jbd2_journal_flush(EXT4_SB(sb)->s_journal); 4592 4599 jbd2_journal_unlock_updates(EXT4_SB(sb)->s_journal); 4593 - if (err) { 4594 - path_put(&path); 4600 + if (err) 4595 4601 return err; 4596 - } 4597 4602 } 4598 4603 4599 - err = dquot_quota_on_path(sb, type, format_id, &path); 4600 - path_put(&path); 4601 - return err; 4604 + return dquot_quota_on(sb, type, format_id, path); 4602 4605 } 4603 4606 4604 4607 static int ext4_quota_off(struct super_block *sb, int type)
+22 -50
fs/gfs2/inode.c
··· 74 74 } 75 75 76 76 /** 77 - * GFS2 lookup code fills in vfs inode contents based on info obtained 78 - * from directory entry inside gfs2_inode_lookup(). This has caused issues 79 - * with NFS code path since its get_dentry routine doesn't have the relevant 80 - * directory entry when gfs2_inode_lookup() is invoked. Part of the code 81 - * segment inside gfs2_inode_lookup code needs to get moved around. 77 + * gfs2_set_iop - Sets inode operations 78 + * @inode: The inode with correct i_mode filled in 82 79 * 83 - * Clears I_NEW as well. 84 - **/ 80 + * GFS2 lookup code fills in vfs inode contents based on info obtained 81 + * from directory entry inside gfs2_inode_lookup(). 82 + */ 85 83 86 - void gfs2_set_iop(struct inode *inode) 84 + static void gfs2_set_iop(struct inode *inode) 87 85 { 88 86 struct gfs2_sbd *sdp = GFS2_SB(inode); 89 87 umode_t mode = inode->i_mode; ··· 104 106 inode->i_op = &gfs2_file_iops; 105 107 init_special_inode(inode, inode->i_mode, inode->i_rdev); 106 108 } 107 - 108 - unlock_new_inode(inode); 109 109 } 110 110 111 111 /** ··· 115 119 * Returns: A VFS inode, or an error 116 120 */ 117 121 118 - struct inode *gfs2_inode_lookup(struct super_block *sb, 119 - unsigned int type, 120 - u64 no_addr, 121 - u64 no_formal_ino) 122 + struct inode *gfs2_inode_lookup(struct super_block *sb, unsigned int type, 123 + u64 no_addr, u64 no_formal_ino) 122 124 { 123 125 struct inode *inode; 124 126 struct gfs2_inode *ip; ··· 146 152 error = gfs2_glock_nq_init(io_gl, LM_ST_SHARED, GL_EXACT, &ip->i_iopen_gh); 147 153 if (unlikely(error)) 148 154 goto fail_iopen; 149 - ip->i_iopen_gh.gh_gl->gl_object = ip; 150 155 156 + ip->i_iopen_gh.gh_gl->gl_object = ip; 151 157 gfs2_glock_put(io_gl); 152 158 io_gl = NULL; 153 159 154 - if ((type == DT_UNKNOWN) && (no_formal_ino == 0)) 155 - goto gfs2_nfsbypass; 156 - 157 - inode->i_mode = DT2IF(type); 158 - 159 - /* 160 - * We must read the inode in order to work out its type in 161 - * this case. Note that this doesn't happen often as we normally 162 - * know the type beforehand. This code path only occurs during 163 - * unlinked inode recovery (where it is safe to do this glock, 164 - * which is not true in the general case). 165 - */ 166 160 if (type == DT_UNKNOWN) { 167 - struct gfs2_holder gh; 168 - error = gfs2_glock_nq_init(ip->i_gl, LM_ST_EXCLUSIVE, 0, &gh); 169 - if (unlikely(error)) 170 - goto fail_glock; 171 - /* Inode is now uptodate */ 172 - gfs2_glock_dq_uninit(&gh); 161 + /* Inode glock must be locked already */ 162 + error = gfs2_inode_refresh(GFS2_I(inode)); 163 + if (error) 164 + goto fail_refresh; 165 + } else { 166 + inode->i_mode = DT2IF(type); 173 167 } 174 168 175 169 gfs2_set_iop(inode); 170 + unlock_new_inode(inode); 176 171 } 177 172 178 - gfs2_nfsbypass: 179 173 return inode; 180 - fail_glock: 181 - gfs2_glock_dq(&ip->i_iopen_gh); 174 + 175 + fail_refresh: 176 + ip->i_iopen_gh.gh_gl->gl_object = NULL; 177 + gfs2_glock_dq_uninit(&ip->i_iopen_gh); 182 178 fail_iopen: 183 179 if (io_gl) 184 180 gfs2_glock_put(io_gl); 185 181 fail_put: 186 - if (inode->i_state & I_NEW) 187 - ip->i_gl->gl_object = NULL; 182 + ip->i_gl->gl_object = NULL; 188 183 gfs2_glock_put(ip->i_gl); 189 184 fail: 190 - if (inode->i_state & I_NEW) 191 - iget_failed(inode); 192 - else 193 - iput(inode); 185 + iget_failed(inode); 194 186 return ERR_PTR(error); 195 187 } 196 188 ··· 200 220 inode = gfs2_inode_lookup(sb, DT_UNKNOWN, no_addr, 0); 201 221 if (IS_ERR(inode)) 202 222 goto fail; 203 - 204 - error = gfs2_inode_refresh(GFS2_I(inode)); 205 - if (error) 206 - goto fail_iput; 207 - 208 - /* Pick up the works we bypass in gfs2_inode_lookup */ 209 - if (inode->i_state & I_NEW) 210 - gfs2_set_iop(inode); 211 223 212 224 /* Two extra checks for NFS only */ 213 225 if (no_formal_ino) {
-1
fs/gfs2/inode.h
··· 96 96 return -EIO; 97 97 } 98 98 99 - extern void gfs2_set_iop(struct inode *inode); 100 99 extern struct inode *gfs2_inode_lookup(struct super_block *sb, unsigned type, 101 100 u64 no_addr, u64 no_formal_ino); 102 101 extern struct inode *gfs2_lookup_by_inum(struct gfs2_sbd *sdp, u64 no_addr,
+1
fs/gfs2/super.c
··· 1336 1336 if (error) 1337 1337 goto out_truncate; 1338 1338 1339 + ip->i_iopen_gh.gh_flags |= GL_NOCACHE; 1339 1340 gfs2_glock_dq_wait(&ip->i_iopen_gh); 1340 1341 gfs2_holder_reinit(LM_ST_EXCLUSIVE, LM_FLAG_TRY_1CB | GL_NOCACHE, &ip->i_iopen_gh); 1341 1342 error = gfs2_glock_nq(&ip->i_iopen_gh);
+2 -3
fs/ocfs2/super.c
··· 993 993 } 994 994 995 995 /* Handle quota on quotactl */ 996 - static int ocfs2_quota_on(struct super_block *sb, int type, int format_id, 997 - char *path) 996 + static int ocfs2_quota_on(struct super_block *sb, int type, int format_id) 998 997 { 999 998 unsigned int feature[MAXQUOTAS] = { OCFS2_FEATURE_RO_COMPAT_USRQUOTA, 1000 999 OCFS2_FEATURE_RO_COMPAT_GRPQUOTA}; ··· 1012 1013 } 1013 1014 1014 1015 static const struct quotactl_ops ocfs2_quotactl_ops = { 1015 - .quota_on = ocfs2_quota_on, 1016 + .quota_on_meta = ocfs2_quota_on, 1016 1017 .quota_off = ocfs2_quota_off, 1017 1018 .quota_sync = dquot_quota_sync, 1018 1019 .get_info = dquot_get_dqinfo,
+5 -5
fs/pipe.c
··· 441 441 break; 442 442 } 443 443 if (do_wakeup) { 444 - wake_up_interruptible_sync_poll(&pipe->wait, POLLOUT); 444 + wake_up_interruptible_sync_poll(&pipe->wait, POLLOUT | POLLWRNORM); 445 445 kill_fasync(&pipe->fasync_writers, SIGIO, POLL_OUT); 446 446 } 447 447 pipe_wait(pipe); ··· 450 450 451 451 /* Signal writers asynchronously that there is more room. */ 452 452 if (do_wakeup) { 453 - wake_up_interruptible_sync_poll(&pipe->wait, POLLOUT); 453 + wake_up_interruptible_sync_poll(&pipe->wait, POLLOUT | POLLWRNORM); 454 454 kill_fasync(&pipe->fasync_writers, SIGIO, POLL_OUT); 455 455 } 456 456 if (ret > 0) ··· 612 612 break; 613 613 } 614 614 if (do_wakeup) { 615 - wake_up_interruptible_sync_poll(&pipe->wait, POLLIN); 615 + wake_up_interruptible_sync_poll(&pipe->wait, POLLIN | POLLRDNORM); 616 616 kill_fasync(&pipe->fasync_readers, SIGIO, POLL_IN); 617 617 do_wakeup = 0; 618 618 } ··· 623 623 out: 624 624 mutex_unlock(&inode->i_mutex); 625 625 if (do_wakeup) { 626 - wake_up_interruptible_sync_poll(&pipe->wait, POLLIN); 626 + wake_up_interruptible_sync_poll(&pipe->wait, POLLIN | POLLRDNORM); 627 627 kill_fasync(&pipe->fasync_readers, SIGIO, POLL_IN); 628 628 } 629 629 if (ret > 0) ··· 715 715 if (!pipe->readers && !pipe->writers) { 716 716 free_pipe_info(inode); 717 717 } else { 718 - wake_up_interruptible_sync_poll(&pipe->wait, POLLIN | POLLOUT); 718 + wake_up_interruptible_sync_poll(&pipe->wait, POLLIN | POLLOUT | POLLRDNORM | POLLWRNORM | POLLERR | POLLHUP); 719 719 kill_fasync(&pipe->fasync_readers, SIGIO, POLL_IN); 720 720 kill_fasync(&pipe->fasync_writers, SIGIO, POLL_OUT); 721 721 }
+3 -3
fs/proc/Kconfig
··· 1 1 config PROC_FS 2 - bool "/proc file system support" if EMBEDDED 2 + bool "/proc file system support" if EXPERT 3 3 default y 4 4 help 5 5 This is a virtual file system providing information about the status ··· 40 40 Exports the dump image of crashed kernel in ELF format. 41 41 42 42 config PROC_SYSCTL 43 - bool "Sysctl support (/proc/sys)" if EMBEDDED 43 + bool "Sysctl support (/proc/sys)" if EXPERT 44 44 depends on PROC_FS 45 45 select SYSCTL 46 46 default y ··· 61 61 config PROC_PAGE_MONITOR 62 62 default y 63 63 depends on PROC_FS && MMU 64 - bool "Enable /proc page monitoring" if EMBEDDED 64 + bool "Enable /proc page monitoring" if EXPERT 65 65 help 66 66 Various /proc files exist to monitor process memory utilization: 67 67 /proc/pid/smaps, /proc/pid/clear_refs, /proc/pid/pagemap,
+2 -16
fs/quota/dquot.c
··· 2189 2189 } 2190 2190 EXPORT_SYMBOL(dquot_resume); 2191 2191 2192 - int dquot_quota_on_path(struct super_block *sb, int type, int format_id, 2193 - struct path *path) 2192 + int dquot_quota_on(struct super_block *sb, int type, int format_id, 2193 + struct path *path) 2194 2194 { 2195 2195 int error = security_quota_on(path->dentry); 2196 2196 if (error) ··· 2202 2202 error = vfs_load_quota_inode(path->dentry->d_inode, type, 2203 2203 format_id, DQUOT_USAGE_ENABLED | 2204 2204 DQUOT_LIMITS_ENABLED); 2205 - return error; 2206 - } 2207 - EXPORT_SYMBOL(dquot_quota_on_path); 2208 - 2209 - int dquot_quota_on(struct super_block *sb, int type, int format_id, char *name) 2210 - { 2211 - struct path path; 2212 - int error; 2213 - 2214 - error = kern_path(name, LOOKUP_FOLLOW, &path); 2215 - if (!error) { 2216 - error = dquot_quota_on_path(sb, type, format_id, &path); 2217 - path_put(&path); 2218 - } 2219 2205 return error; 2220 2206 } 2221 2207 EXPORT_SYMBOL(dquot_quota_on);
+27 -14
fs/quota/quota.c
··· 64 64 } 65 65 66 66 static int quota_quotaon(struct super_block *sb, int type, int cmd, qid_t id, 67 - void __user *addr) 67 + struct path *path) 68 68 { 69 - char *pathname; 70 - int ret = -ENOSYS; 71 - 72 - pathname = getname(addr); 73 - if (IS_ERR(pathname)) 74 - return PTR_ERR(pathname); 75 - if (sb->s_qcop->quota_on) 76 - ret = sb->s_qcop->quota_on(sb, type, id, pathname); 77 - putname(pathname); 78 - return ret; 69 + if (!sb->s_qcop->quota_on && !sb->s_qcop->quota_on_meta) 70 + return -ENOSYS; 71 + if (sb->s_qcop->quota_on_meta) 72 + return sb->s_qcop->quota_on_meta(sb, type, id); 73 + if (IS_ERR(path)) 74 + return PTR_ERR(path); 75 + return sb->s_qcop->quota_on(sb, type, id, path); 79 76 } 80 77 81 78 static int quota_getfmt(struct super_block *sb, int type, void __user *addr) ··· 238 241 239 242 /* Copy parameters and call proper function */ 240 243 static int do_quotactl(struct super_block *sb, int type, int cmd, qid_t id, 241 - void __user *addr) 244 + void __user *addr, struct path *path) 242 245 { 243 246 int ret; 244 247 ··· 253 256 254 257 switch (cmd) { 255 258 case Q_QUOTAON: 256 - return quota_quotaon(sb, type, cmd, id, addr); 259 + return quota_quotaon(sb, type, cmd, id, path); 257 260 case Q_QUOTAOFF: 258 261 if (!sb->s_qcop->quota_off) 259 262 return -ENOSYS; ··· 332 335 { 333 336 uint cmds, type; 334 337 struct super_block *sb = NULL; 338 + struct path path, *pathp = NULL; 335 339 int ret; 336 340 337 341 cmds = cmd >> SUBCMDSHIFT; ··· 349 351 return -ENODEV; 350 352 } 351 353 354 + /* 355 + * Path for quotaon has to be resolved before grabbing superblock 356 + * because that gets s_umount sem which is also possibly needed by path 357 + * resolution (think about autofs) and thus deadlocks could arise. 358 + */ 359 + if (cmds == Q_QUOTAON) { 360 + ret = user_path_at(AT_FDCWD, addr, LOOKUP_FOLLOW, &path); 361 + if (ret) 362 + pathp = ERR_PTR(ret); 363 + else 364 + pathp = &path; 365 + } 366 + 352 367 sb = quotactl_block(special); 353 368 if (IS_ERR(sb)) 354 369 return PTR_ERR(sb); 355 370 356 - ret = do_quotactl(sb, type, cmds, id, addr); 371 + ret = do_quotactl(sb, type, cmds, id, addr, pathp); 357 372 358 373 drop_super(sb); 374 + if (pathp && !IS_ERR(pathp)) 375 + path_put(pathp); 359 376 return ret; 360 377 }
+6 -11
fs/reiserfs/super.c
··· 632 632 static int reiserfs_release_dquot(struct dquot *); 633 633 static int reiserfs_mark_dquot_dirty(struct dquot *); 634 634 static int reiserfs_write_info(struct super_block *, int); 635 - static int reiserfs_quota_on(struct super_block *, int, int, char *); 635 + static int reiserfs_quota_on(struct super_block *, int, int, struct path *); 636 636 637 637 static const struct dquot_operations reiserfs_quota_operations = { 638 638 .write_dquot = reiserfs_write_dquot, ··· 2048 2048 * Standard function to be called on quota_on 2049 2049 */ 2050 2050 static int reiserfs_quota_on(struct super_block *sb, int type, int format_id, 2051 - char *name) 2051 + struct path *path) 2052 2052 { 2053 2053 int err; 2054 - struct path path; 2055 2054 struct inode *inode; 2056 2055 struct reiserfs_transaction_handle th; 2057 2056 2058 2057 if (!(REISERFS_SB(sb)->s_mount_opt & (1 << REISERFS_QUOTA))) 2059 2058 return -EINVAL; 2060 2059 2061 - err = kern_path(name, LOOKUP_FOLLOW, &path); 2062 - if (err) 2063 - return err; 2064 2060 /* Quotafile not on the same filesystem? */ 2065 - if (path.mnt->mnt_sb != sb) { 2061 + if (path->mnt->mnt_sb != sb) { 2066 2062 err = -EXDEV; 2067 2063 goto out; 2068 2064 } 2069 - inode = path.dentry->d_inode; 2065 + inode = path->dentry->d_inode; 2070 2066 /* We must not pack tails for quota files on reiserfs for quota IO to work */ 2071 2067 if (!(REISERFS_I(inode)->i_flags & i_nopack_mask)) { 2072 2068 err = reiserfs_unpack(inode, NULL); ··· 2078 2082 /* Journaling quota? */ 2079 2083 if (REISERFS_SB(sb)->s_qf_names[type]) { 2080 2084 /* Quotafile not of fs root? */ 2081 - if (path.dentry->d_parent != sb->s_root) 2085 + if (path->dentry->d_parent != sb->s_root) 2082 2086 reiserfs_warning(sb, "super-6521", 2083 2087 "Quota file not on filesystem root. " 2084 2088 "Journalled quota will not work."); ··· 2097 2101 if (err) 2098 2102 goto out; 2099 2103 } 2100 - err = dquot_quota_on_path(sb, type, format_id, &path); 2104 + err = dquot_quota_on(sb, type, format_id, path); 2101 2105 out: 2102 - path_put(&path); 2103 2106 return err; 2104 2107 } 2105 2108
+1 -1
fs/sysfs/Kconfig
··· 1 1 config SYSFS 2 - bool "sysfs file system support" if EMBEDDED 2 + bool "sysfs file system support" if EXPERT 3 3 default y 4 4 help 5 5 The sysfs filesystem is a virtual filesystem that the kernel uses to
+1 -1
include/acpi/acexcep.h
··· 5 5 *****************************************************************************/ 6 6 7 7 /* 8 - * Copyright (C) 2000 - 2010, Intel Corp. 8 + * Copyright (C) 2000 - 2011, Intel Corp. 9 9 * All rights reserved. 10 10 * 11 11 * Redistribution and use in source and binary forms, with or without
+1 -1
include/acpi/acnames.h
··· 5 5 *****************************************************************************/ 6 6 7 7 /* 8 - * Copyright (C) 2000 - 2010, Intel Corp. 8 + * Copyright (C) 2000 - 2011, Intel Corp. 9 9 * All rights reserved. 10 10 * 11 11 * Redistribution and use in source and binary forms, with or without
+1 -1
include/acpi/acoutput.h
··· 5 5 *****************************************************************************/ 6 6 7 7 /* 8 - * Copyright (C) 2000 - 2010, Intel Corp. 8 + * Copyright (C) 2000 - 2011, Intel Corp. 9 9 * All rights reserved. 10 10 * 11 11 * Redistribution and use in source and binary forms, with or without
+1 -1
include/acpi/acpi.h
··· 5 5 *****************************************************************************/ 6 6 7 7 /* 8 - * Copyright (C) 2000 - 2010, Intel Corp. 8 + * Copyright (C) 2000 - 2011, Intel Corp. 9 9 * All rights reserved. 10 10 * 11 11 * Redistribution and use in source and binary forms, with or without
+1 -1
include/acpi/acpiosxf.h
··· 8 8 *****************************************************************************/ 9 9 10 10 /* 11 - * Copyright (C) 2000 - 2010, Intel Corp. 11 + * Copyright (C) 2000 - 2011, Intel Corp. 12 12 * All rights reserved. 13 13 * 14 14 * Redistribution and use in source and binary forms, with or without
+2 -2
include/acpi/acpixf.h
··· 6 6 *****************************************************************************/ 7 7 8 8 /* 9 - * Copyright (C) 2000 - 2010, Intel Corp. 9 + * Copyright (C) 2000 - 2011, Intel Corp. 10 10 * All rights reserved. 11 11 * 12 12 * Redistribution and use in source and binary forms, with or without ··· 47 47 48 48 /* Current ACPICA subsystem version in YYYYMMDD format */ 49 49 50 - #define ACPI_CA_VERSION 0x20101209 50 + #define ACPI_CA_VERSION 0x20110112 51 51 52 52 #include "actypes.h" 53 53 #include "actbl.h"
+1 -1
include/acpi/acrestyp.h
··· 5 5 *****************************************************************************/ 6 6 7 7 /* 8 - * Copyright (C) 2000 - 2010, Intel Corp. 8 + * Copyright (C) 2000 - 2011, Intel Corp. 9 9 * All rights reserved. 10 10 * 11 11 * Redistribution and use in source and binary forms, with or without
+1 -1
include/acpi/actbl.h
··· 5 5 *****************************************************************************/ 6 6 7 7 /* 8 - * Copyright (C) 2000 - 2010, Intel Corp. 8 + * Copyright (C) 2000 - 2011, Intel Corp. 9 9 * All rights reserved. 10 10 * 11 11 * Redistribution and use in source and binary forms, with or without
+1 -1
include/acpi/actbl1.h
··· 5 5 *****************************************************************************/ 6 6 7 7 /* 8 - * Copyright (C) 2000 - 2010, Intel Corp. 8 + * Copyright (C) 2000 - 2011, Intel Corp. 9 9 * All rights reserved. 10 10 * 11 11 * Redistribution and use in source and binary forms, with or without
+1 -1
include/acpi/actbl2.h
··· 5 5 *****************************************************************************/ 6 6 7 7 /* 8 - * Copyright (C) 2000 - 2010, Intel Corp. 8 + * Copyright (C) 2000 - 2011, Intel Corp. 9 9 * All rights reserved. 10 10 * 11 11 * Redistribution and use in source and binary forms, with or without
+1 -1
include/acpi/actypes.h
··· 5 5 *****************************************************************************/ 6 6 7 7 /* 8 - * Copyright (C) 2000 - 2010, Intel Corp. 8 + * Copyright (C) 2000 - 2011, Intel Corp. 9 9 * All rights reserved. 10 10 * 11 11 * Redistribution and use in source and binary forms, with or without
+1 -1
include/acpi/platform/acenv.h
··· 5 5 *****************************************************************************/ 6 6 7 7 /* 8 - * Copyright (C) 2000 - 2010, Intel Corp. 8 + * Copyright (C) 2000 - 2011, Intel Corp. 9 9 * All rights reserved. 10 10 * 11 11 * Redistribution and use in source and binary forms, with or without
+1 -1
include/acpi/platform/acgcc.h
··· 5 5 *****************************************************************************/ 6 6 7 7 /* 8 - * Copyright (C) 2000 - 2010, Intel Corp. 8 + * Copyright (C) 2000 - 2011, Intel Corp. 9 9 * All rights reserved. 10 10 * 11 11 * Redistribution and use in source and binary forms, with or without
+1 -1
include/acpi/platform/aclinux.h
··· 5 5 *****************************************************************************/ 6 6 7 7 /* 8 - * Copyright (C) 2000 - 2010, Intel Corp. 8 + * Copyright (C) 2000 - 2011, Intel Corp. 9 9 * All rights reserved. 10 10 * 11 11 * Redistribution and use in source and binary forms, with or without
-3
include/linux/acpi.h
··· 306 306 u32 *mask, u32 req); 307 307 extern void acpi_early_init(void); 308 308 309 - int acpi_os_map_generic_address(struct acpi_generic_address *addr); 310 - void acpi_os_unmap_generic_address(struct acpi_generic_address *addr); 311 - 312 309 #else /* !CONFIG_ACPI */ 313 310 314 311 #define acpi_disabled 1
+16
include/linux/acpi_io.h
··· 1 + #ifndef _ACPI_IO_H_ 2 + #define _ACPI_IO_H_ 3 + 4 + #include <linux/io.h> 5 + #include <acpi/acpi.h> 6 + 7 + static inline void __iomem *acpi_os_ioremap(acpi_physical_address phys, 8 + acpi_size size) 9 + { 10 + return ioremap_cache(phys, size); 11 + } 12 + 13 + int acpi_os_map_generic_address(struct acpi_generic_address *addr); 14 + void acpi_os_unmap_generic_address(struct acpi_generic_address *addr); 15 + 16 + #endif
+1 -1
include/linux/ieee80211.h
··· 959 959 /* block-ack parameters */ 960 960 #define IEEE80211_ADDBA_PARAM_POLICY_MASK 0x0002 961 961 #define IEEE80211_ADDBA_PARAM_TID_MASK 0x003C 962 - #define IEEE80211_ADDBA_PARAM_BUF_SIZE_MASK 0xFFA0 962 + #define IEEE80211_ADDBA_PARAM_BUF_SIZE_MASK 0xFFC0 963 963 #define IEEE80211_DELBA_PARAM_TID_MASK 0xF000 964 964 #define IEEE80211_DELBA_PARAM_INITIATOR_MASK 0x0800 965 965
-14
include/linux/irqdesc.h
··· 101 101 #define get_irq_desc_msi(desc) ((desc)->irq_data.msi_desc) 102 102 103 103 /* 104 - * Monolithic do_IRQ implementation. 105 - */ 106 - #ifndef CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ 107 - extern unsigned int __do_IRQ(unsigned int irq); 108 - #endif 109 - 110 - /* 111 104 * Architectures call this to let the generic IRQ layer 112 105 * handle an interrupt. If the descriptor is attached to an 113 106 * irqchip-style controller then we call the ->handle_irq() handler, ··· 108 115 */ 109 116 static inline void generic_handle_irq_desc(unsigned int irq, struct irq_desc *desc) 110 117 { 111 - #ifdef CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ 112 118 desc->handle_irq(irq, desc); 113 - #else 114 - if (likely(desc->handle_irq)) 115 - desc->handle_irq(irq, desc); 116 - else 117 - __do_IRQ(irq); 118 - #endif 119 119 } 120 120 121 121 static inline void generic_handle_irq(unsigned int irq)
+2
include/linux/kernel.h
··· 243 243 extern unsigned long get_taint(void); 244 244 extern int root_mountflags; 245 245 246 + extern bool early_boot_irqs_disabled; 247 + 246 248 /* Values used for system_state */ 247 249 extern enum system_states { 248 250 SYSTEM_BOOTING,
+3 -8
include/linux/lockdep.h
··· 436 436 #endif /* CONFIG_LOCKDEP */ 437 437 438 438 #ifdef CONFIG_TRACE_IRQFLAGS 439 - extern void early_boot_irqs_off(void); 440 - extern void early_boot_irqs_on(void); 441 439 extern void print_irqtrace_events(struct task_struct *curr); 442 440 #else 443 - static inline void early_boot_irqs_off(void) 444 - { 445 - } 446 - static inline void early_boot_irqs_on(void) 447 - { 448 - } 449 441 static inline void print_irqtrace_events(struct task_struct *curr) 450 442 { 451 443 } ··· 514 522 #ifdef CONFIG_DEBUG_LOCK_ALLOC 515 523 # ifdef CONFIG_PROVE_LOCKING 516 524 # define lock_map_acquire(l) lock_acquire(l, 0, 0, 0, 2, NULL, _THIS_IP_) 525 + # define lock_map_acquire_read(l) lock_acquire(l, 0, 0, 2, 2, NULL, _THIS_IP_) 517 526 # else 518 527 # define lock_map_acquire(l) lock_acquire(l, 0, 0, 0, 1, NULL, _THIS_IP_) 528 + # define lock_map_acquire_read(l) lock_acquire(l, 0, 0, 2, 1, NULL, _THIS_IP_) 519 529 # endif 520 530 # define lock_map_release(l) lock_release(l, 1, _THIS_IP_) 521 531 #else 522 532 # define lock_map_acquire(l) do { } while (0) 533 + # define lock_map_acquire_read(l) do { } while (0) 523 534 # define lock_map_release(l) do { } while (0) 524 535 #endif 525 536
+9
include/linux/memcontrol.h
··· 146 146 gfp_t gfp_mask); 147 147 u64 mem_cgroup_get_limit(struct mem_cgroup *mem); 148 148 149 + #ifdef CONFIG_TRANSPARENT_HUGEPAGE 150 + void mem_cgroup_split_huge_fixup(struct page *head, struct page *tail); 151 + #endif 152 + 149 153 #else /* CONFIG_CGROUP_MEM_RES_CTLR */ 150 154 struct mem_cgroup; 151 155 ··· 337 333 u64 mem_cgroup_get_limit(struct mem_cgroup *mem) 338 334 { 339 335 return 0; 336 + } 337 + 338 + static inline void mem_cgroup_split_huge_fixup(struct page *head, 339 + struct page *tail) 340 + { 340 341 } 341 342 342 343 #endif /* CONFIG_CGROUP_MEM_CONT */
+2
include/linux/mm.h
··· 470 470 page[1].lru.prev = (void *)order; 471 471 } 472 472 473 + #ifdef CONFIG_MMU 473 474 /* 474 475 * Do pte_mkwrite, but only if the vma says VM_WRITE. We do this when 475 476 * servicing faults for write access. In the normal case, do always want ··· 483 482 pte = pte_mkwrite(pte); 484 483 return pte; 485 484 } 485 + #endif 486 486 487 487 /* 488 488 * Multiple processes may "see" the same page. E.g. for untouched
+4 -1
include/linux/quota.h
··· 322 322 qsize_t *(*get_reserved_space) (struct inode *); 323 323 }; 324 324 325 + struct path; 326 + 325 327 /* Operations handling requests from userspace */ 326 328 struct quotactl_ops { 327 - int (*quota_on)(struct super_block *, int, int, char *); 329 + int (*quota_on)(struct super_block *, int, int, struct path *); 330 + int (*quota_on_meta)(struct super_block *, int, int); 328 331 int (*quota_off)(struct super_block *, int); 329 332 int (*quota_sync)(struct super_block *, int, int); 330 333 int (*get_info)(struct super_block *, int, struct if_dqinfo *);
+1 -3
include/linux/quotaops.h
··· 76 76 77 77 int dquot_file_open(struct inode *inode, struct file *file); 78 78 79 - int dquot_quota_on(struct super_block *sb, int type, int format_id, 80 - char *path); 81 79 int dquot_enable(struct inode *inode, int type, int format_id, 82 80 unsigned int flags); 83 - int dquot_quota_on_path(struct super_block *sb, int type, int format_id, 81 + int dquot_quota_on(struct super_block *sb, int type, int format_id, 84 82 struct path *path); 85 83 int dquot_quota_on_mount(struct super_block *sb, char *qf_name, 86 84 int format_id, int type);
+17
include/media/mt9v011.h
··· 1 + /* mt9v011 sensor 2 + * 3 + * Copyright (C) 2011 Hans Verkuil <hverkuil@xs4all.nl> 4 + * 5 + * This program is free software; you can redistribute it and/or modify 6 + * it under the terms of the GNU General Public License version 2 as 7 + * published by the Free Software Foundation. 8 + */ 9 + 10 + #ifndef __MT9V011_H__ 11 + #define __MT9V011_H__ 12 + 13 + struct mt9v011_platform_data { 14 + unsigned xtal; /* Hz */ 15 + }; 16 + 17 + #endif
+3
include/media/rc-core.h
··· 183 183 } 184 184 185 185 #define IR_MAX_DURATION 0xFFFFFFFF /* a bit more than 4 seconds */ 186 + #define US_TO_NS(usec) ((usec) * 1000) 187 + #define MS_TO_US(msec) ((msec) * 1000) 188 + #define MS_TO_NS(msec) ((msec) * 1000 * 1000) 186 189 187 190 void ir_raw_event_handle(struct rc_dev *dev); 188 191 int ir_raw_event_store(struct rc_dev *dev, struct ir_raw_event *ev);
+1 -1
include/media/saa7146.h
··· 115 115 116 116 /* different device locks */ 117 117 spinlock_t slock; 118 - struct mutex lock; 118 + struct mutex v4l2_lock; 119 119 120 120 unsigned char __iomem *mem; /* pointer to mapped IO memory */ 121 121 u32 revision; /* chip revision; needed for bug-workarounds*/
+1 -12
include/media/v4l2-common.h
··· 138 138 139 139 /* Load an i2c module and return an initialized v4l2_subdev struct. 140 140 The client_type argument is the name of the chip that's on the adapter. */ 141 - struct v4l2_subdev *v4l2_i2c_new_subdev_cfg(struct v4l2_device *v4l2_dev, 141 + struct v4l2_subdev *v4l2_i2c_new_subdev(struct v4l2_device *v4l2_dev, 142 142 struct i2c_adapter *adapter, const char *client_type, 143 - int irq, void *platform_data, 144 143 u8 addr, const unsigned short *probe_addrs); 145 - 146 - /* Load an i2c module and return an initialized v4l2_subdev struct. 147 - The client_type argument is the name of the chip that's on the adapter. */ 148 - static inline struct v4l2_subdev *v4l2_i2c_new_subdev(struct v4l2_device *v4l2_dev, 149 - struct i2c_adapter *adapter, const char *client_type, 150 - u8 addr, const unsigned short *probe_addrs) 151 - { 152 - return v4l2_i2c_new_subdev_cfg(v4l2_dev, adapter, client_type, 0, NULL, 153 - addr, probe_addrs); 154 - } 155 144 156 145 struct i2c_board_info; 157 146
+5 -2
include/media/v4l2-ctrls.h
··· 23 23 24 24 #include <linux/list.h> 25 25 #include <linux/device.h> 26 + #include <linux/videodev2.h> 26 27 27 28 /* forward references */ 28 29 struct v4l2_ctrl_handler; ··· 54 53 * @handler: The handler that owns the control. 55 54 * @cluster: Point to start of cluster array. 56 55 * @ncontrols: Number of controls in cluster array. 57 - * @has_new: Internal flag: set when there is a valid new value. 58 56 * @done: Internal flag: set for each processed control. 57 + * @is_new: Set when the user specified a new value for this control. It 58 + * is also set when called from v4l2_ctrl_handler_setup. Drivers 59 + * should never set this flag. 59 60 * @is_private: If set, then this control is private to its handler and it 60 61 * will not be added to any other handlers. Drivers can set 61 62 * this flag. ··· 100 97 struct v4l2_ctrl_handler *handler; 101 98 struct v4l2_ctrl **cluster; 102 99 unsigned ncontrols; 103 - unsigned int has_new:1; 104 100 unsigned int done:1; 105 101 102 + unsigned int is_new:1; 106 103 unsigned int is_private:1; 107 104 unsigned int is_volatile:1; 108 105
+18 -5
include/media/v4l2-subdev.h
··· 106 106 u8 strength; /* Pin drive strength */ 107 107 }; 108 108 109 - /* s_config: if set, then it is always called by the v4l2_i2c_new_subdev* 110 - functions after the v4l2_subdev was registered. It is used to pass 111 - platform data to the subdev which can be used during initialization. 112 - 109 + /* 113 110 s_io_pin_config: configure one or more chip I/O pins for chips that 114 111 multiplex different internal signal pads out to IO pins. This function 115 112 takes a pointer to an array of 'n' pin configuration entries, one for ··· 138 141 struct v4l2_subdev_core_ops { 139 142 int (*g_chip_ident)(struct v4l2_subdev *sd, struct v4l2_dbg_chip_ident *chip); 140 143 int (*log_status)(struct v4l2_subdev *sd); 141 - int (*s_config)(struct v4l2_subdev *sd, int irq, void *platform_data); 142 144 int (*s_io_pin_config)(struct v4l2_subdev *sd, size_t n, 143 145 struct v4l2_subdev_io_pin_config *pincfg); 144 146 int (*init)(struct v4l2_subdev *sd, u32 val); ··· 411 415 const struct v4l2_subdev_sensor_ops *sensor; 412 416 }; 413 417 418 + /* 419 + * Internal ops. Never call this from drivers, only the v4l2 framework can call 420 + * these ops. 421 + * 422 + * registered: called when this subdev is registered. When called the v4l2_dev 423 + * field is set to the correct v4l2_device. 424 + * 425 + * unregistered: called when this subdev is unregistered. When called the 426 + * v4l2_dev field is still set to the correct v4l2_device. 427 + */ 428 + struct v4l2_subdev_internal_ops { 429 + int (*registered)(struct v4l2_subdev *sd); 430 + void (*unregistered)(struct v4l2_subdev *sd); 431 + }; 432 + 414 433 #define V4L2_SUBDEV_NAME_SIZE 32 415 434 416 435 /* Set this flag if this subdev is a i2c device. */ ··· 442 431 u32 flags; 443 432 struct v4l2_device *v4l2_dev; 444 433 const struct v4l2_subdev_ops *ops; 434 + /* Never call these internal ops from within a driver! */ 435 + const struct v4l2_subdev_internal_ops *internal_ops; 445 436 /* The control handler of this subdev. May be NULL. */ 446 437 struct v4l2_ctrl_handler *ctrl_handler; 447 438 /* name must be unique */
+1
include/net/sctp/user.h
··· 78 78 #define SCTP_GET_PEER_ADDR_INFO 15 79 79 #define SCTP_DELAYED_ACK_TIME 16 80 80 #define SCTP_DELAYED_ACK SCTP_DELAYED_ACK_TIME 81 + #define SCTP_DELAYED_SACK SCTP_DELAYED_ACK_TIME 81 82 #define SCTP_CONTEXT 17 82 83 #define SCTP_FRAGMENT_INTERLEAVE 18 83 84 #define SCTP_PARTIAL_DELIVERY_POINT 19 /* Set/Get partial delivery point */
+34 -26
init/Kconfig
··· 745 745 endif # CGROUPS 746 746 747 747 menuconfig NAMESPACES 748 - bool "Namespaces support" if EMBEDDED 749 - default !EMBEDDED 748 + bool "Namespaces support" if EXPERT 749 + default !EXPERT 750 750 help 751 751 Provides the way to make tasks work with different objects using 752 752 the same id. For example same IPC id may refer to different objects ··· 899 899 config ANON_INODES 900 900 bool 901 901 902 - menuconfig EMBEDDED 903 - bool "Configure standard kernel features (for small systems)" 902 + menuconfig EXPERT 903 + bool "Configure standard kernel features (expert users)" 904 904 help 905 905 This option allows certain base kernel options and settings 906 906 to be disabled or tweaked. This is for specialized 907 907 environments which can tolerate a "non-standard" kernel. 908 908 Only use this if you really know what you are doing. 909 909 910 + config EMBEDDED 911 + bool "Embedded system" 912 + select EXPERT 913 + help 914 + This option should be enabled if compiling the kernel for 915 + an embedded system so certain expert options are available 916 + for configuration. 917 + 910 918 config UID16 911 - bool "Enable 16-bit UID system calls" if EMBEDDED 919 + bool "Enable 16-bit UID system calls" if EXPERT 912 920 depends on ARM || BLACKFIN || CRIS || FRV || H8300 || X86_32 || M68K || (S390 && !64BIT) || SUPERH || SPARC32 || (SPARC64 && COMPAT) || UML || (X86_64 && IA32_EMULATION) 913 921 default y 914 922 help 915 923 This enables the legacy 16-bit UID syscall wrappers. 916 924 917 925 config SYSCTL_SYSCALL 918 - bool "Sysctl syscall support" if EMBEDDED 926 + bool "Sysctl syscall support" if EXPERT 919 927 depends on PROC_SYSCTL 920 928 default y 921 929 select SYSCTL ··· 940 932 If unsure say Y here. 941 933 942 934 config KALLSYMS 943 - bool "Load all symbols for debugging/ksymoops" if EMBEDDED 935 + bool "Load all symbols for debugging/ksymoops" if EXPERT 944 936 default y 945 937 help 946 938 Say Y here to let the kernel print out symbolic crash information and ··· 971 963 972 964 973 965 config HOTPLUG 974 - bool "Support for hot-pluggable devices" if EMBEDDED 966 + bool "Support for hot-pluggable devices" if EXPERT 975 967 default y 976 968 help 977 969 This option is provided for the case where no hotplug or uevent ··· 981 973 982 974 config PRINTK 983 975 default y 984 - bool "Enable support for printk" if EMBEDDED 976 + bool "Enable support for printk" if EXPERT 985 977 help 986 978 This option enables normal printk support. Removing it 987 979 eliminates most of the message strings from the kernel image ··· 990 982 strongly discouraged. 991 983 992 984 config BUG 993 - bool "BUG() support" if EMBEDDED 985 + bool "BUG() support" if EXPERT 994 986 default y 995 987 help 996 988 Disabling this option eliminates support for BUG and WARN, reducing ··· 1001 993 1002 994 config ELF_CORE 1003 995 default y 1004 - bool "Enable ELF core dumps" if EMBEDDED 996 + bool "Enable ELF core dumps" if EXPERT 1005 997 help 1006 998 Enable support for generating core dumps. Disabling saves about 4k. 1007 999 1008 1000 config PCSPKR_PLATFORM 1009 - bool "Enable PC-Speaker support" if EMBEDDED 1001 + bool "Enable PC-Speaker support" if EXPERT 1010 1002 depends on ALPHA || X86 || MIPS || PPC_PREP || PPC_CHRP || PPC_PSERIES 1011 1003 default y 1012 1004 help ··· 1015 1007 1016 1008 config BASE_FULL 1017 1009 default y 1018 - bool "Enable full-sized data structures for core" if EMBEDDED 1010 + bool "Enable full-sized data structures for core" if EXPERT 1019 1011 help 1020 1012 Disabling this option reduces the size of miscellaneous core 1021 1013 kernel data structures. This saves memory on small machines, 1022 1014 but may reduce performance. 1023 1015 1024 1016 config FUTEX 1025 - bool "Enable futex support" if EMBEDDED 1017 + bool "Enable futex support" if EXPERT 1026 1018 default y 1027 1019 select RT_MUTEXES 1028 1020 help ··· 1031 1023 run glibc-based applications correctly. 1032 1024 1033 1025 config EPOLL 1034 - bool "Enable eventpoll support" if EMBEDDED 1026 + bool "Enable eventpoll support" if EXPERT 1035 1027 default y 1036 1028 select ANON_INODES 1037 1029 help ··· 1039 1031 support for epoll family of system calls. 1040 1032 1041 1033 config SIGNALFD 1042 - bool "Enable signalfd() system call" if EMBEDDED 1034 + bool "Enable signalfd() system call" if EXPERT 1043 1035 select ANON_INODES 1044 1036 default y 1045 1037 help ··· 1049 1041 If unsure, say Y. 1050 1042 1051 1043 config TIMERFD 1052 - bool "Enable timerfd() system call" if EMBEDDED 1044 + bool "Enable timerfd() system call" if EXPERT 1053 1045 select ANON_INODES 1054 1046 default y 1055 1047 help ··· 1059 1051 If unsure, say Y. 1060 1052 1061 1053 config EVENTFD 1062 - bool "Enable eventfd() system call" if EMBEDDED 1054 + bool "Enable eventfd() system call" if EXPERT 1063 1055 select ANON_INODES 1064 1056 default y 1065 1057 help ··· 1069 1061 If unsure, say Y. 1070 1062 1071 1063 config SHMEM 1072 - bool "Use full shmem filesystem" if EMBEDDED 1064 + bool "Use full shmem filesystem" if EXPERT 1073 1065 default y 1074 1066 depends on MMU 1075 1067 help ··· 1080 1072 which may be appropriate on small systems without swap. 1081 1073 1082 1074 config AIO 1083 - bool "Enable AIO support" if EMBEDDED 1075 + bool "Enable AIO support" if EXPERT 1084 1076 default y 1085 1077 help 1086 1078 This option enables POSIX asynchronous I/O which may by used ··· 1157 1149 1158 1150 config VM_EVENT_COUNTERS 1159 1151 default y 1160 - bool "Enable VM event counters for /proc/vmstat" if EMBEDDED 1152 + bool "Enable VM event counters for /proc/vmstat" if EXPERT 1161 1153 help 1162 1154 VM event counters are needed for event counts to be shown. 1163 1155 This option allows the disabling of the VM event counters 1164 - on EMBEDDED systems. /proc/vmstat will only show page counts 1156 + on EXPERT systems. /proc/vmstat will only show page counts 1165 1157 if VM event counters are disabled. 1166 1158 1167 1159 config PCI_QUIRKS 1168 1160 default y 1169 - bool "Enable PCI quirk workarounds" if EMBEDDED 1161 + bool "Enable PCI quirk workarounds" if EXPERT 1170 1162 depends on PCI 1171 1163 help 1172 1164 This enables workarounds for various PCI chipset ··· 1175 1167 1176 1168 config SLUB_DEBUG 1177 1169 default y 1178 - bool "Enable SLUB debugging support" if EMBEDDED 1170 + bool "Enable SLUB debugging support" if EXPERT 1179 1171 depends on SLUB && SYSFS 1180 1172 help 1181 1173 SLUB has extensive debug support features. Disabling these can ··· 1219 1211 a slab allocator. 1220 1212 1221 1213 config SLOB 1222 - depends on EMBEDDED 1214 + depends on EXPERT 1223 1215 bool "SLOB (Simple Allocator)" 1224 1216 help 1225 1217 SLOB replaces the stock allocator with a drastically simpler ··· 1230 1222 1231 1223 config MMAP_ALLOW_UNINITIALIZED 1232 1224 bool "Allow mmapped anonymous memory to be uninitialized" 1233 - depends on EMBEDDED && !MMU 1225 + depends on EXPERT && !MMU 1234 1226 default n 1235 1227 help 1236 1228 Normally, and according to the Linux spec, anonymous memory obtained
+11 -2
init/main.c
··· 96 96 extern void tc_init(void); 97 97 #endif 98 98 99 + /* 100 + * Debug helper: via this flag we know that we are in 'early bootup code' 101 + * where only the boot processor is running with IRQ disabled. This means 102 + * two things - IRQ must not be enabled before the flag is cleared and some 103 + * operations which are not allowed with IRQ disabled are allowed while the 104 + * flag is set. 105 + */ 106 + bool early_boot_irqs_disabled __read_mostly; 107 + 99 108 enum system_states system_state __read_mostly; 100 109 EXPORT_SYMBOL(system_state); 101 110 ··· 563 554 cgroup_init_early(); 564 555 565 556 local_irq_disable(); 566 - early_boot_irqs_off(); 557 + early_boot_irqs_disabled = true; 567 558 568 559 /* 569 560 * Interrupts are still disabled. Do necessary setups, then ··· 630 621 if (!irqs_disabled()) 631 622 printk(KERN_CRIT "start_kernel(): bug: interrupts were " 632 623 "enabled early\n"); 633 - early_boot_irqs_on(); 624 + early_boot_irqs_disabled = false; 634 625 local_irq_enable(); 635 626 636 627 /* Interrupts are enabled now so all GFP allocations are safe. */
-3
kernel/irq/Kconfig
··· 9 9 config GENERIC_HARDIRQS 10 10 def_bool y 11 11 12 - config GENERIC_HARDIRQS_NO__DO_IRQ 13 - def_bool y 14 - 15 12 # Select this to disable the deprecated stuff 16 13 config GENERIC_HARDIRQS_NO_DEPRECATED 17 14 def_bool n
-111
kernel/irq/handle.c
··· 118 118 119 119 return retval; 120 120 } 121 - 122 - #ifndef CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ 123 - 124 - #ifdef CONFIG_ENABLE_WARN_DEPRECATED 125 - # warning __do_IRQ is deprecated. Please convert to proper flow handlers 126 - #endif 127 - 128 - /** 129 - * __do_IRQ - original all in one highlevel IRQ handler 130 - * @irq: the interrupt number 131 - * 132 - * __do_IRQ handles all normal device IRQ's (the special 133 - * SMP cross-CPU interrupts have their own specific 134 - * handlers). 135 - * 136 - * This is the original x86 implementation which is used for every 137 - * interrupt type. 138 - */ 139 - unsigned int __do_IRQ(unsigned int irq) 140 - { 141 - struct irq_desc *desc = irq_to_desc(irq); 142 - struct irqaction *action; 143 - unsigned int status; 144 - 145 - kstat_incr_irqs_this_cpu(irq, desc); 146 - 147 - if (CHECK_IRQ_PER_CPU(desc->status)) { 148 - irqreturn_t action_ret; 149 - 150 - /* 151 - * No locking required for CPU-local interrupts: 152 - */ 153 - if (desc->irq_data.chip->ack) 154 - desc->irq_data.chip->ack(irq); 155 - if (likely(!(desc->status & IRQ_DISABLED))) { 156 - action_ret = handle_IRQ_event(irq, desc->action); 157 - if (!noirqdebug) 158 - note_interrupt(irq, desc, action_ret); 159 - } 160 - desc->irq_data.chip->end(irq); 161 - return 1; 162 - } 163 - 164 - raw_spin_lock(&desc->lock); 165 - if (desc->irq_data.chip->ack) 166 - desc->irq_data.chip->ack(irq); 167 - /* 168 - * REPLAY is when Linux resends an IRQ that was dropped earlier 169 - * WAITING is used by probe to mark irqs that are being tested 170 - */ 171 - status = desc->status & ~(IRQ_REPLAY | IRQ_WAITING); 172 - status |= IRQ_PENDING; /* we _want_ to handle it */ 173 - 174 - /* 175 - * If the IRQ is disabled for whatever reason, we cannot 176 - * use the action we have. 177 - */ 178 - action = NULL; 179 - if (likely(!(status & (IRQ_DISABLED | IRQ_INPROGRESS)))) { 180 - action = desc->action; 181 - status &= ~IRQ_PENDING; /* we commit to handling */ 182 - status |= IRQ_INPROGRESS; /* we are handling it */ 183 - } 184 - desc->status = status; 185 - 186 - /* 187 - * If there is no IRQ handler or it was disabled, exit early. 188 - * Since we set PENDING, if another processor is handling 189 - * a different instance of this same irq, the other processor 190 - * will take care of it. 191 - */ 192 - if (unlikely(!action)) 193 - goto out; 194 - 195 - /* 196 - * Edge triggered interrupts need to remember 197 - * pending events. 198 - * This applies to any hw interrupts that allow a second 199 - * instance of the same irq to arrive while we are in do_IRQ 200 - * or in the handler. But the code here only handles the _second_ 201 - * instance of the irq, not the third or fourth. So it is mostly 202 - * useful for irq hardware that does not mask cleanly in an 203 - * SMP environment. 204 - */ 205 - for (;;) { 206 - irqreturn_t action_ret; 207 - 208 - raw_spin_unlock(&desc->lock); 209 - 210 - action_ret = handle_IRQ_event(irq, action); 211 - if (!noirqdebug) 212 - note_interrupt(irq, desc, action_ret); 213 - 214 - raw_spin_lock(&desc->lock); 215 - if (likely(!(desc->status & IRQ_PENDING))) 216 - break; 217 - desc->status &= ~IRQ_PENDING; 218 - } 219 - desc->status &= ~IRQ_INPROGRESS; 220 - 221 - out: 222 - /* 223 - * The ->end() handler has to deal with interrupts which got 224 - * disabled while the handler was running. 225 - */ 226 - desc->irq_data.chip->end(irq); 227 - raw_spin_unlock(&desc->lock); 228 - 229 - return 1; 230 - } 231 - #endif
+1 -17
kernel/lockdep.c
··· 2292 2292 } 2293 2293 2294 2294 /* 2295 - * Debugging helper: via this flag we know that we are in 2296 - * 'early bootup code', and will warn about any invalid irqs-on event: 2297 - */ 2298 - static int early_boot_irqs_enabled; 2299 - 2300 - void early_boot_irqs_off(void) 2301 - { 2302 - early_boot_irqs_enabled = 0; 2303 - } 2304 - 2305 - void early_boot_irqs_on(void) 2306 - { 2307 - early_boot_irqs_enabled = 1; 2308 - } 2309 - 2310 - /* 2311 2295 * Hardirqs will be enabled: 2312 2296 */ 2313 2297 void trace_hardirqs_on_caller(unsigned long ip) ··· 2303 2319 if (unlikely(!debug_locks || current->lockdep_recursion)) 2304 2320 return; 2305 2321 2306 - if (DEBUG_LOCKS_WARN_ON(unlikely(!early_boot_irqs_enabled))) 2322 + if (DEBUG_LOCKS_WARN_ON(unlikely(early_boot_irqs_disabled))) 2307 2323 return; 2308 2324 2309 2325 if (unlikely(curr->hardirqs_enabled)) {
+21 -5
kernel/sched.c
··· 553 553 /* try_to_wake_up() stats */ 554 554 unsigned int ttwu_count; 555 555 unsigned int ttwu_local; 556 - 557 - /* BKL stats */ 558 - unsigned int bkl_count; 559 556 #endif 560 557 }; 561 558 ··· 605 608 { 606 609 struct task_group *tg; 607 610 struct cgroup_subsys_state *css; 611 + 612 + if (p->flags & PF_EXITING) 613 + return &root_task_group; 608 614 609 615 css = task_subsys_state_check(p, cpu_cgroup_subsys_id, 610 616 lockdep_is_held(&task_rq(p)->lock)); ··· 3887 3887 schedstat_inc(this_rq(), sched_count); 3888 3888 #ifdef CONFIG_SCHEDSTATS 3889 3889 if (unlikely(prev->lock_depth >= 0)) { 3890 - schedstat_inc(this_rq(), bkl_count); 3890 + schedstat_inc(this_rq(), rq_sched_info.bkl_count); 3891 3891 schedstat_inc(prev, sched_info.bkl_count); 3892 3892 } 3893 3893 #endif ··· 4871 4871 * assigned. 4872 4872 */ 4873 4873 if (rt_bandwidth_enabled() && rt_policy(policy) && 4874 - task_group(p)->rt_bandwidth.rt_runtime == 0) { 4874 + task_group(p)->rt_bandwidth.rt_runtime == 0 && 4875 + !task_group_is_autogroup(task_group(p))) { 4875 4876 __task_rq_unlock(rq); 4876 4877 raw_spin_unlock_irqrestore(&p->pi_lock, flags); 4877 4878 return -EPERM; ··· 8883 8882 } 8884 8883 } 8885 8884 8885 + static void 8886 + cpu_cgroup_exit(struct cgroup_subsys *ss, struct task_struct *task) 8887 + { 8888 + /* 8889 + * cgroup_exit() is called in the copy_process() failure path. 8890 + * Ignore this case since the task hasn't ran yet, this avoids 8891 + * trying to poke a half freed task state from generic code. 8892 + */ 8893 + if (!(task->flags & PF_EXITING)) 8894 + return; 8895 + 8896 + sched_move_task(task); 8897 + } 8898 + 8886 8899 #ifdef CONFIG_FAIR_GROUP_SCHED 8887 8900 static int cpu_shares_write_u64(struct cgroup *cgrp, struct cftype *cftype, 8888 8901 u64 shareval) ··· 8969 8954 .destroy = cpu_cgroup_destroy, 8970 8955 .can_attach = cpu_cgroup_can_attach, 8971 8956 .attach = cpu_cgroup_attach, 8957 + .exit = cpu_cgroup_exit, 8972 8958 .populate = cpu_cgroup_populate, 8973 8959 .subsys_id = cpu_cgroup_subsys_id, 8974 8960 .early_init = 1,
+32
kernel/sched_autogroup.c
··· 27 27 { 28 28 struct autogroup *ag = container_of(kref, struct autogroup, kref); 29 29 30 + #ifdef CONFIG_RT_GROUP_SCHED 31 + /* We've redirected RT tasks to the root task group... */ 32 + ag->tg->rt_se = NULL; 33 + ag->tg->rt_rq = NULL; 34 + #endif 30 35 sched_destroy_group(ag->tg); 31 36 } 32 37 ··· 60 55 return ag; 61 56 } 62 57 58 + #ifdef CONFIG_RT_GROUP_SCHED 59 + static void free_rt_sched_group(struct task_group *tg); 60 + #endif 61 + 63 62 static inline struct autogroup *autogroup_create(void) 64 63 { 65 64 struct autogroup *ag = kzalloc(sizeof(*ag), GFP_KERNEL); ··· 81 72 init_rwsem(&ag->lock); 82 73 ag->id = atomic_inc_return(&autogroup_seq_nr); 83 74 ag->tg = tg; 75 + #ifdef CONFIG_RT_GROUP_SCHED 76 + /* 77 + * Autogroup RT tasks are redirected to the root task group 78 + * so we don't have to move tasks around upon policy change, 79 + * or flail around trying to allocate bandwidth on the fly. 80 + * A bandwidth exception in __sched_setscheduler() allows 81 + * the policy change to proceed. Thereafter, task_group() 82 + * returns &root_task_group, so zero bandwidth is required. 83 + */ 84 + free_rt_sched_group(tg); 85 + tg->rt_se = root_task_group.rt_se; 86 + tg->rt_rq = root_task_group.rt_rq; 87 + #endif 84 88 tg->autogroup = ag; 85 89 86 90 return ag; ··· 126 104 return false; 127 105 128 106 return true; 107 + } 108 + 109 + static inline bool task_group_is_autogroup(struct task_group *tg) 110 + { 111 + return tg != &root_task_group && tg->autogroup; 129 112 } 130 113 131 114 static inline struct task_group * ··· 258 231 #ifdef CONFIG_SCHED_DEBUG 259 232 static inline int autogroup_path(struct task_group *tg, char *buf, int buflen) 260 233 { 234 + int enabled = ACCESS_ONCE(sysctl_sched_autogroup_enabled); 235 + 236 + if (!enabled || !tg->autogroup) 237 + return 0; 238 + 261 239 return snprintf(buf, buflen, "%s-%ld", "/autogroup", tg->autogroup->id); 262 240 } 263 241 #endif /* CONFIG_SCHED_DEBUG */
+4
kernel/sched_autogroup.h
··· 15 15 16 16 static inline void autogroup_init(struct task_struct *init_task) { } 17 17 static inline void autogroup_free(struct task_group *tg) { } 18 + static inline bool task_group_is_autogroup(struct task_group *tg) 19 + { 20 + return 0; 21 + } 18 22 19 23 static inline struct task_group * 20 24 autogroup_task_group(struct task_struct *p, struct task_group *tg)
+41 -1
kernel/sched_debug.c
··· 16 16 #include <linux/kallsyms.h> 17 17 #include <linux/utsname.h> 18 18 19 + static DEFINE_SPINLOCK(sched_debug_lock); 20 + 19 21 /* 20 22 * This allows printing both to /proc/sched_debug and 21 23 * to the console ··· 88 86 } 89 87 #endif 90 88 89 + #ifdef CONFIG_CGROUP_SCHED 90 + static char group_path[PATH_MAX]; 91 + 92 + static char *task_group_path(struct task_group *tg) 93 + { 94 + if (autogroup_path(tg, group_path, PATH_MAX)) 95 + return group_path; 96 + 97 + /* 98 + * May be NULL if the underlying cgroup isn't fully-created yet 99 + */ 100 + if (!tg->css.cgroup) { 101 + group_path[0] = '\0'; 102 + return group_path; 103 + } 104 + cgroup_path(tg->css.cgroup, group_path, PATH_MAX); 105 + return group_path; 106 + } 107 + #endif 108 + 91 109 static void 92 110 print_task(struct seq_file *m, struct rq *rq, struct task_struct *p) 93 111 { ··· 129 107 #else 130 108 SEQ_printf(m, "%15Ld %15Ld %15Ld.%06ld %15Ld.%06ld %15Ld.%06ld", 131 109 0LL, 0LL, 0LL, 0L, 0LL, 0L, 0LL, 0L); 110 + #endif 111 + #ifdef CONFIG_CGROUP_SCHED 112 + SEQ_printf(m, " %s", task_group_path(task_group(p))); 132 113 #endif 133 114 134 115 SEQ_printf(m, "\n"); ··· 169 144 struct sched_entity *last; 170 145 unsigned long flags; 171 146 147 + #ifdef CONFIG_FAIR_GROUP_SCHED 148 + SEQ_printf(m, "\ncfs_rq[%d]:%s\n", cpu, task_group_path(cfs_rq->tg)); 149 + #else 172 150 SEQ_printf(m, "\ncfs_rq[%d]:\n", cpu); 151 + #endif 173 152 SEQ_printf(m, " .%-30s: %Ld.%06ld\n", "exec_clock", 174 153 SPLIT_NS(cfs_rq->exec_clock)); 175 154 ··· 220 191 221 192 void print_rt_rq(struct seq_file *m, int cpu, struct rt_rq *rt_rq) 222 193 { 194 + #ifdef CONFIG_RT_GROUP_SCHED 195 + SEQ_printf(m, "\nrt_rq[%d]:%s\n", cpu, task_group_path(rt_rq->tg)); 196 + #else 223 197 SEQ_printf(m, "\nrt_rq[%d]:\n", cpu); 198 + #endif 224 199 225 200 #define P(x) \ 226 201 SEQ_printf(m, " .%-30s: %Ld\n", #x, (long long)(rt_rq->x)) ··· 245 212 static void print_cpu(struct seq_file *m, int cpu) 246 213 { 247 214 struct rq *rq = cpu_rq(cpu); 215 + unsigned long flags; 248 216 249 217 #ifdef CONFIG_X86 250 218 { ··· 296 262 P(ttwu_count); 297 263 P(ttwu_local); 298 264 299 - P(bkl_count); 265 + SEQ_printf(m, " .%-30s: %d\n", "bkl_count", 266 + rq->rq_sched_info.bkl_count); 300 267 301 268 #undef P 269 + #undef P64 302 270 #endif 271 + spin_lock_irqsave(&sched_debug_lock, flags); 303 272 print_cfs_stats(m, cpu); 304 273 print_rt_stats(m, cpu); 305 274 275 + rcu_read_lock(); 306 276 print_rq(m, rq, cpu); 277 + rcu_read_unlock(); 278 + spin_unlock_irqrestore(&sched_debug_lock, flags); 307 279 } 308 280 309 281 static const char *sched_tunable_scaling_names[] = {
+19 -16
kernel/sched_fair.c
··· 1062 1062 struct sched_entity *se = __pick_next_entity(cfs_rq); 1063 1063 s64 delta = curr->vruntime - se->vruntime; 1064 1064 1065 + if (delta < 0) 1066 + return; 1067 + 1065 1068 if (delta > ideal_runtime) 1066 1069 resched_task(rq_of(cfs_rq)->curr); 1067 1070 } ··· 1365 1362 return wl; 1366 1363 1367 1364 for_each_sched_entity(se) { 1368 - long S, rw, s, a, b; 1365 + long lw, w; 1369 1366 1370 - S = se->my_q->tg->shares; 1371 - s = se->load.weight; 1372 - rw = se->my_q->load.weight; 1367 + tg = se->my_q->tg; 1368 + w = se->my_q->load.weight; 1373 1369 1374 - a = S*(rw + wl); 1375 - b = S*rw + s*wg; 1370 + /* use this cpu's instantaneous contribution */ 1371 + lw = atomic_read(&tg->load_weight); 1372 + lw -= se->my_q->load_contribution; 1373 + lw += w + wg; 1376 1374 1377 - wl = s*(a-b); 1375 + wl += w; 1378 1376 1379 - if (likely(b)) 1380 - wl /= b; 1377 + if (lw > 0 && wl < lw) 1378 + wl = (wl * tg->shares) / lw; 1379 + else 1380 + wl = tg->shares; 1381 1381 1382 - /* 1383 - * Assume the group is already running and will 1384 - * thus already be accounted for in the weight. 1385 - * 1386 - * That is, moving shares between CPUs, does not 1387 - * alter the group weight. 1388 - */ 1382 + /* zero point is MIN_SHARES */ 1383 + if (wl < MIN_SHARES) 1384 + wl = MIN_SHARES; 1385 + wl -= se->load.weight; 1389 1386 wg = 0; 1390 1387 } 1391 1388
+52 -10
kernel/smp.c
··· 194 194 */ 195 195 list_for_each_entry_rcu(data, &call_function.queue, csd.list) { 196 196 int refs; 197 + void (*func) (void *info); 197 198 198 - if (!cpumask_test_and_clear_cpu(cpu, data->cpumask)) 199 + /* 200 + * Since we walk the list without any locks, we might 201 + * see an entry that was completed, removed from the 202 + * list and is in the process of being reused. 203 + * 204 + * We must check that the cpu is in the cpumask before 205 + * checking the refs, and both must be set before 206 + * executing the callback on this cpu. 207 + */ 208 + 209 + if (!cpumask_test_cpu(cpu, data->cpumask)) 199 210 continue; 200 211 212 + smp_rmb(); 213 + 214 + if (atomic_read(&data->refs) == 0) 215 + continue; 216 + 217 + func = data->csd.func; /* for later warn */ 201 218 data->csd.func(data->csd.info); 219 + 220 + /* 221 + * If the cpu mask is not still set then it enabled interrupts, 222 + * we took another smp interrupt, and executed the function 223 + * twice on this cpu. In theory that copy decremented refs. 224 + */ 225 + if (!cpumask_test_and_clear_cpu(cpu, data->cpumask)) { 226 + WARN(1, "%pS enabled interrupts and double executed\n", 227 + func); 228 + continue; 229 + } 202 230 203 231 refs = atomic_dec_return(&data->refs); 204 232 WARN_ON(refs < 0); 205 - if (!refs) { 206 - raw_spin_lock(&call_function.lock); 207 - list_del_rcu(&data->csd.list); 208 - raw_spin_unlock(&call_function.lock); 209 - } 210 233 211 234 if (refs) 212 235 continue; 236 + 237 + WARN_ON(!cpumask_empty(data->cpumask)); 238 + 239 + raw_spin_lock(&call_function.lock); 240 + list_del_rcu(&data->csd.list); 241 + raw_spin_unlock(&call_function.lock); 213 242 214 243 csd_unlock(&data->csd); 215 244 } ··· 459 430 * can't happen. 460 431 */ 461 432 WARN_ON_ONCE(cpu_online(this_cpu) && irqs_disabled() 462 - && !oops_in_progress); 433 + && !oops_in_progress && !early_boot_irqs_disabled); 463 434 464 435 /* So, what's a CPU they want? Ignoring this one. */ 465 436 cpu = cpumask_first_and(mask, cpu_online_mask); ··· 483 454 484 455 data = &__get_cpu_var(cfd_data); 485 456 csd_lock(&data->csd); 457 + BUG_ON(atomic_read(&data->refs) || !cpumask_empty(data->cpumask)); 486 458 487 459 data->csd.func = func; 488 460 data->csd.info = info; 489 461 cpumask_and(data->cpumask, mask, cpu_online_mask); 490 462 cpumask_clear_cpu(this_cpu, data->cpumask); 463 + 464 + /* 465 + * To ensure the interrupt handler gets an complete view 466 + * we order the cpumask and refs writes and order the read 467 + * of them in the interrupt handler. In addition we may 468 + * only clear our own cpu bit from the mask. 469 + */ 470 + smp_wmb(); 471 + 491 472 atomic_set(&data->refs, cpumask_weight(data->cpumask)); 492 473 493 474 raw_spin_lock_irqsave(&call_function.lock, flags); ··· 572 533 #endif /* USE_GENERIC_SMP_HELPERS */ 573 534 574 535 /* 575 - * Call a function on all processors 536 + * Call a function on all processors. May be used during early boot while 537 + * early_boot_irqs_disabled is set. Use local_irq_save/restore() instead 538 + * of local_irq_disable/enable(). 576 539 */ 577 540 int on_each_cpu(void (*func) (void *info), void *info, int wait) 578 541 { 542 + unsigned long flags; 579 543 int ret = 0; 580 544 581 545 preempt_disable(); 582 546 ret = smp_call_function(func, info, wait); 583 - local_irq_disable(); 547 + local_irq_save(flags); 584 548 func(info); 585 - local_irq_enable(); 549 + local_irq_restore(flags); 586 550 preempt_enable(); 587 551 return ret; 588 552 }
-8
kernel/trace/trace_irqsoff.c
··· 453 453 * Stubs: 454 454 */ 455 455 456 - void early_boot_irqs_off(void) 457 - { 458 - } 459 - 460 - void early_boot_irqs_on(void) 461 - { 462 - } 463 - 464 456 void trace_softirqs_on(unsigned long ip) 465 457 { 466 458 }
+17 -3
kernel/workqueue.c
··· 768 768 769 769 worker->flags &= ~flags; 770 770 771 - /* if transitioning out of NOT_RUNNING, increment nr_running */ 771 + /* 772 + * If transitioning out of NOT_RUNNING, increment nr_running. Note 773 + * that the nested NOT_RUNNING is not a noop. NOT_RUNNING is mask 774 + * of multiple flags, not a single flag. 775 + */ 772 776 if ((flags & WORKER_NOT_RUNNING) && (oflags & WORKER_NOT_RUNNING)) 773 777 if (!(worker->flags & WORKER_NOT_RUNNING)) 774 778 atomic_inc(get_gcwq_nr_running(gcwq->cpu)); ··· 1844 1840 spin_unlock_irq(&gcwq->lock); 1845 1841 1846 1842 work_clear_pending(work); 1847 - lock_map_acquire(&cwq->wq->lockdep_map); 1843 + lock_map_acquire_read(&cwq->wq->lockdep_map); 1848 1844 lock_map_acquire(&lockdep_map); 1849 1845 trace_workqueue_execute_start(work); 1850 1846 f(work); ··· 2388 2384 insert_wq_barrier(cwq, barr, work, worker); 2389 2385 spin_unlock_irq(&gcwq->lock); 2390 2386 2391 - lock_map_acquire(&cwq->wq->lockdep_map); 2387 + /* 2388 + * If @max_active is 1 or rescuer is in use, flushing another work 2389 + * item on the same workqueue may lead to deadlock. Make sure the 2390 + * flusher is not running on the same workqueue by verifying write 2391 + * access. 2392 + */ 2393 + if (cwq->wq->saved_max_active == 1 || cwq->wq->flags & WQ_RESCUER) 2394 + lock_map_acquire(&cwq->wq->lockdep_map); 2395 + else 2396 + lock_map_acquire_read(&cwq->wq->lockdep_map); 2392 2397 lock_map_release(&cwq->wq->lockdep_map); 2398 + 2393 2399 return true; 2394 2400 already_gone: 2395 2401 spin_unlock_irq(&gcwq->lock);
+3 -3
lib/Kconfig.debug
··· 657 657 Disable for production systems. 658 658 659 659 config DEBUG_BUGVERBOSE 660 - bool "Verbose BUG() reporting (adds 70K)" if DEBUG_KERNEL && EMBEDDED 660 + bool "Verbose BUG() reporting (adds 70K)" if DEBUG_KERNEL && EXPERT 661 661 depends on BUG 662 662 depends on ARM || AVR32 || M32R || M68K || SPARC32 || SPARC64 || \ 663 663 FRV || SUPERH || GENERIC_BUG || BLACKFIN || MN10300 ··· 729 729 If unsure, say N. 730 730 731 731 config DEBUG_MEMORY_INIT 732 - bool "Debug memory initialisation" if EMBEDDED 733 - default !EMBEDDED 732 + bool "Debug memory initialisation" if EXPERT 733 + default !EXPERT 734 734 help 735 735 Enable this for additional checks during memory initialisation. 736 736 The sanity checks verify aspects of the VM such as the memory model
+6 -6
lib/xz/Kconfig
··· 7 7 CRC32 is supported. See Documentation/xz.txt for more information. 8 8 9 9 config XZ_DEC_X86 10 - bool "x86 BCJ filter decoder" if EMBEDDED 10 + bool "x86 BCJ filter decoder" if EXPERT 11 11 default y 12 12 depends on XZ_DEC 13 13 select XZ_DEC_BCJ 14 14 15 15 config XZ_DEC_POWERPC 16 - bool "PowerPC BCJ filter decoder" if EMBEDDED 16 + bool "PowerPC BCJ filter decoder" if EXPERT 17 17 default y 18 18 depends on XZ_DEC 19 19 select XZ_DEC_BCJ 20 20 21 21 config XZ_DEC_IA64 22 - bool "IA-64 BCJ filter decoder" if EMBEDDED 22 + bool "IA-64 BCJ filter decoder" if EXPERT 23 23 default y 24 24 depends on XZ_DEC 25 25 select XZ_DEC_BCJ 26 26 27 27 config XZ_DEC_ARM 28 - bool "ARM BCJ filter decoder" if EMBEDDED 28 + bool "ARM BCJ filter decoder" if EXPERT 29 29 default y 30 30 depends on XZ_DEC 31 31 select XZ_DEC_BCJ 32 32 33 33 config XZ_DEC_ARMTHUMB 34 - bool "ARM-Thumb BCJ filter decoder" if EMBEDDED 34 + bool "ARM-Thumb BCJ filter decoder" if EXPERT 35 35 default y 36 36 depends on XZ_DEC 37 37 select XZ_DEC_BCJ 38 38 39 39 config XZ_DEC_SPARC 40 - bool "SPARC BCJ filter decoder" if EMBEDDED 40 + bool "SPARC BCJ filter decoder" if EXPERT 41 41 default y 42 42 depends on XZ_DEC 43 43 select XZ_DEC_BCJ
+11
mm/compaction.c
··· 406 406 if (!zone_watermark_ok(zone, cc->order, watermark, 0, 0)) 407 407 return COMPACT_CONTINUE; 408 408 409 + /* 410 + * order == -1 is expected when compacting via 411 + * /proc/sys/vm/compact_memory 412 + */ 409 413 if (cc->order == -1) 410 414 return COMPACT_CONTINUE; 411 415 ··· 456 452 watermark = low_wmark_pages(zone) + (2UL << order); 457 453 if (!zone_watermark_ok(zone, 0, watermark, 0, 0)) 458 454 return COMPACT_SKIPPED; 455 + 456 + /* 457 + * order == -1 is expected when compacting via 458 + * /proc/sys/vm/compact_memory 459 + */ 460 + if (order == -1) 461 + return COMPACT_CONTINUE; 459 462 460 463 /* 461 464 * fragmentation index determines if allocation failures are due to
+4 -1
mm/huge_memory.c
··· 1203 1203 BUG_ON(!PageDirty(page_tail)); 1204 1204 BUG_ON(!PageSwapBacked(page_tail)); 1205 1205 1206 + mem_cgroup_split_huge_fixup(page, page_tail); 1207 + 1206 1208 lru_add_page_tail(zone, page, page_tail); 1207 1209 } 1208 1210 ··· 1839 1837 spin_lock(ptl); 1840 1838 isolated = __collapse_huge_page_isolate(vma, address, pte); 1841 1839 spin_unlock(ptl); 1842 - pte_unmap(pte); 1843 1840 1844 1841 if (unlikely(!isolated)) { 1842 + pte_unmap(pte); 1845 1843 spin_lock(&mm->page_table_lock); 1846 1844 BUG_ON(!pmd_none(*pmd)); 1847 1845 set_pmd_at(mm, address, pmd, _pmd); ··· 1858 1856 anon_vma_unlock(vma->anon_vma); 1859 1857 1860 1858 __collapse_huge_page_copy(pte, new_page, vma, address, ptl); 1859 + pte_unmap(pte); 1861 1860 __SetPageUptodate(new_page); 1862 1861 pgtable = pmd_pgtable(_pmd); 1863 1862 VM_BUG_ON(page_count(pgtable) != 1);
+4 -4
mm/memblock.c
··· 683 683 684 684 int __init_memblock memblock_is_region_memory(phys_addr_t base, phys_addr_t size) 685 685 { 686 - int idx = memblock_search(&memblock.reserved, base); 686 + int idx = memblock_search(&memblock.memory, base); 687 687 688 688 if (idx == -1) 689 689 return 0; 690 - return memblock.reserved.regions[idx].base <= base && 691 - (memblock.reserved.regions[idx].base + 692 - memblock.reserved.regions[idx].size) >= (base + size); 690 + return memblock.memory.regions[idx].base <= base && 691 + (memblock.memory.regions[idx].base + 692 + memblock.memory.regions[idx].size) >= (base + size); 693 693 } 694 694 695 695 int __init_memblock memblock_is_region_reserved(phys_addr_t base, phys_addr_t size)
+110 -80
mm/memcontrol.c
··· 600 600 } 601 601 602 602 static void mem_cgroup_charge_statistics(struct mem_cgroup *mem, 603 - struct page_cgroup *pc, 604 - bool charge) 603 + bool file, int nr_pages) 605 604 { 606 - int val = (charge) ? 1 : -1; 607 - 608 605 preempt_disable(); 609 606 610 - if (PageCgroupCache(pc)) 611 - __this_cpu_add(mem->stat->count[MEM_CGROUP_STAT_CACHE], val); 607 + if (file) 608 + __this_cpu_add(mem->stat->count[MEM_CGROUP_STAT_CACHE], nr_pages); 612 609 else 613 - __this_cpu_add(mem->stat->count[MEM_CGROUP_STAT_RSS], val); 610 + __this_cpu_add(mem->stat->count[MEM_CGROUP_STAT_RSS], nr_pages); 614 611 615 - if (charge) 612 + /* pagein of a big page is an event. So, ignore page size */ 613 + if (nr_pages > 0) 616 614 __this_cpu_inc(mem->stat->count[MEM_CGROUP_STAT_PGPGIN_COUNT]); 617 615 else 618 616 __this_cpu_inc(mem->stat->count[MEM_CGROUP_STAT_PGPGOUT_COUNT]); 619 - __this_cpu_inc(mem->stat->count[MEM_CGROUP_EVENTS]); 617 + 618 + __this_cpu_add(mem->stat->count[MEM_CGROUP_EVENTS], nr_pages); 620 619 621 620 preempt_enable(); 622 621 } ··· 814 815 * removed from global LRU. 815 816 */ 816 817 mz = page_cgroup_zoneinfo(pc); 817 - MEM_CGROUP_ZSTAT(mz, lru) -= 1; 818 + /* huge page split is done under lru_lock. so, we have no races. */ 819 + MEM_CGROUP_ZSTAT(mz, lru) -= 1 << compound_order(page); 818 820 if (mem_cgroup_is_root(pc->mem_cgroup)) 819 821 return; 820 822 VM_BUG_ON(list_empty(&pc->lru)); ··· 836 836 return; 837 837 838 838 pc = lookup_page_cgroup(page); 839 - /* 840 - * Used bit is set without atomic ops but after smp_wmb(). 841 - * For making pc->mem_cgroup visible, insert smp_rmb() here. 842 - */ 843 - smp_rmb(); 844 839 /* unused or root page is not rotated. */ 845 - if (!PageCgroupUsed(pc) || mem_cgroup_is_root(pc->mem_cgroup)) 840 + if (!PageCgroupUsed(pc)) 841 + return; 842 + /* Ensure pc->mem_cgroup is visible after reading PCG_USED. */ 843 + smp_rmb(); 844 + if (mem_cgroup_is_root(pc->mem_cgroup)) 846 845 return; 847 846 mz = page_cgroup_zoneinfo(pc); 848 847 list_move(&pc->lru, &mz->lists[lru]); ··· 856 857 return; 857 858 pc = lookup_page_cgroup(page); 858 859 VM_BUG_ON(PageCgroupAcctLRU(pc)); 859 - /* 860 - * Used bit is set without atomic ops but after smp_wmb(). 861 - * For making pc->mem_cgroup visible, insert smp_rmb() here. 862 - */ 863 - smp_rmb(); 864 860 if (!PageCgroupUsed(pc)) 865 861 return; 866 - 862 + /* Ensure pc->mem_cgroup is visible after reading PCG_USED. */ 863 + smp_rmb(); 867 864 mz = page_cgroup_zoneinfo(pc); 868 - MEM_CGROUP_ZSTAT(mz, lru) += 1; 865 + /* huge page split is done under lru_lock. so, we have no races. */ 866 + MEM_CGROUP_ZSTAT(mz, lru) += 1 << compound_order(page); 869 867 SetPageCgroupAcctLRU(pc); 870 868 if (mem_cgroup_is_root(pc->mem_cgroup)) 871 869 return; ··· 1026 1030 return NULL; 1027 1031 1028 1032 pc = lookup_page_cgroup(page); 1029 - /* 1030 - * Used bit is set without atomic ops but after smp_wmb(). 1031 - * For making pc->mem_cgroup visible, insert smp_rmb() here. 1032 - */ 1033 - smp_rmb(); 1034 1033 if (!PageCgroupUsed(pc)) 1035 1034 return NULL; 1036 - 1035 + /* Ensure pc->mem_cgroup is visible after reading PCG_USED. */ 1036 + smp_rmb(); 1037 1037 mz = page_cgroup_zoneinfo(pc); 1038 1038 if (!mz) 1039 1039 return NULL; ··· 1607 1615 if (unlikely(!mem || !PageCgroupUsed(pc))) 1608 1616 goto out; 1609 1617 /* pc->mem_cgroup is unstable ? */ 1610 - if (unlikely(mem_cgroup_stealed(mem))) { 1618 + if (unlikely(mem_cgroup_stealed(mem)) || PageTransHuge(page)) { 1611 1619 /* take a lock against to access pc->mem_cgroup */ 1612 1620 move_lock_page_cgroup(pc, &flags); 1613 1621 need_unlock = true; ··· 2076 2084 return mem; 2077 2085 } 2078 2086 2079 - /* 2080 - * commit a charge got by __mem_cgroup_try_charge() and makes page_cgroup to be 2081 - * USED state. If already USED, uncharge and return. 2082 - */ 2083 - static void ____mem_cgroup_commit_charge(struct mem_cgroup *mem, 2084 - struct page_cgroup *pc, 2085 - enum charge_type ctype) 2087 + static void __mem_cgroup_commit_charge(struct mem_cgroup *mem, 2088 + struct page_cgroup *pc, 2089 + enum charge_type ctype, 2090 + int page_size) 2086 2091 { 2092 + int nr_pages = page_size >> PAGE_SHIFT; 2093 + 2094 + /* try_charge() can return NULL to *memcg, taking care of it. */ 2095 + if (!mem) 2096 + return; 2097 + 2098 + lock_page_cgroup(pc); 2099 + if (unlikely(PageCgroupUsed(pc))) { 2100 + unlock_page_cgroup(pc); 2101 + mem_cgroup_cancel_charge(mem, page_size); 2102 + return; 2103 + } 2104 + /* 2105 + * we don't need page_cgroup_lock about tail pages, becase they are not 2106 + * accessed by any other context at this point. 2107 + */ 2087 2108 pc->mem_cgroup = mem; 2088 2109 /* 2089 2110 * We access a page_cgroup asynchronously without lock_page_cgroup(). ··· 2120 2115 break; 2121 2116 } 2122 2117 2123 - mem_cgroup_charge_statistics(mem, pc, true); 2124 - } 2125 - 2126 - static void __mem_cgroup_commit_charge(struct mem_cgroup *mem, 2127 - struct page_cgroup *pc, 2128 - enum charge_type ctype, 2129 - int page_size) 2130 - { 2131 - int i; 2132 - int count = page_size >> PAGE_SHIFT; 2133 - 2134 - /* try_charge() can return NULL to *memcg, taking care of it. */ 2135 - if (!mem) 2136 - return; 2137 - 2138 - lock_page_cgroup(pc); 2139 - if (unlikely(PageCgroupUsed(pc))) { 2140 - unlock_page_cgroup(pc); 2141 - mem_cgroup_cancel_charge(mem, page_size); 2142 - return; 2143 - } 2144 - 2145 - /* 2146 - * we don't need page_cgroup_lock about tail pages, becase they are not 2147 - * accessed by any other context at this point. 2148 - */ 2149 - for (i = 0; i < count; i++) 2150 - ____mem_cgroup_commit_charge(mem, pc + i, ctype); 2151 - 2118 + mem_cgroup_charge_statistics(mem, PageCgroupCache(pc), nr_pages); 2152 2119 unlock_page_cgroup(pc); 2153 2120 /* 2154 2121 * "charge_statistics" updated event counter. Then, check it. ··· 2129 2152 */ 2130 2153 memcg_check_events(mem, pc->page); 2131 2154 } 2155 + 2156 + #ifdef CONFIG_TRANSPARENT_HUGEPAGE 2157 + 2158 + #define PCGF_NOCOPY_AT_SPLIT ((1 << PCG_LOCK) | (1 << PCG_MOVE_LOCK) |\ 2159 + (1 << PCG_ACCT_LRU) | (1 << PCG_MIGRATION)) 2160 + /* 2161 + * Because tail pages are not marked as "used", set it. We're under 2162 + * zone->lru_lock, 'splitting on pmd' and compund_lock. 2163 + */ 2164 + void mem_cgroup_split_huge_fixup(struct page *head, struct page *tail) 2165 + { 2166 + struct page_cgroup *head_pc = lookup_page_cgroup(head); 2167 + struct page_cgroup *tail_pc = lookup_page_cgroup(tail); 2168 + unsigned long flags; 2169 + 2170 + /* 2171 + * We have no races with charge/uncharge but will have races with 2172 + * page state accounting. 2173 + */ 2174 + move_lock_page_cgroup(head_pc, &flags); 2175 + 2176 + tail_pc->mem_cgroup = head_pc->mem_cgroup; 2177 + smp_wmb(); /* see __commit_charge() */ 2178 + if (PageCgroupAcctLRU(head_pc)) { 2179 + enum lru_list lru; 2180 + struct mem_cgroup_per_zone *mz; 2181 + 2182 + /* 2183 + * LRU flags cannot be copied because we need to add tail 2184 + *.page to LRU by generic call and our hook will be called. 2185 + * We hold lru_lock, then, reduce counter directly. 2186 + */ 2187 + lru = page_lru(head); 2188 + mz = page_cgroup_zoneinfo(head_pc); 2189 + MEM_CGROUP_ZSTAT(mz, lru) -= 1; 2190 + } 2191 + tail_pc->flags = head_pc->flags & ~PCGF_NOCOPY_AT_SPLIT; 2192 + move_unlock_page_cgroup(head_pc, &flags); 2193 + } 2194 + #endif 2132 2195 2133 2196 /** 2134 2197 * __mem_cgroup_move_account - move account of the page ··· 2188 2171 */ 2189 2172 2190 2173 static void __mem_cgroup_move_account(struct page_cgroup *pc, 2191 - struct mem_cgroup *from, struct mem_cgroup *to, bool uncharge) 2174 + struct mem_cgroup *from, struct mem_cgroup *to, bool uncharge, 2175 + int charge_size) 2192 2176 { 2177 + int nr_pages = charge_size >> PAGE_SHIFT; 2178 + 2193 2179 VM_BUG_ON(from == to); 2194 2180 VM_BUG_ON(PageLRU(pc->page)); 2195 2181 VM_BUG_ON(!page_is_cgroup_locked(pc)); ··· 2206 2186 __this_cpu_inc(to->stat->count[MEM_CGROUP_STAT_FILE_MAPPED]); 2207 2187 preempt_enable(); 2208 2188 } 2209 - mem_cgroup_charge_statistics(from, pc, false); 2189 + mem_cgroup_charge_statistics(from, PageCgroupCache(pc), -nr_pages); 2210 2190 if (uncharge) 2211 2191 /* This is not "cancel", but cancel_charge does all we need. */ 2212 - mem_cgroup_cancel_charge(from, PAGE_SIZE); 2192 + mem_cgroup_cancel_charge(from, charge_size); 2213 2193 2214 2194 /* caller should have done css_get */ 2215 2195 pc->mem_cgroup = to; 2216 - mem_cgroup_charge_statistics(to, pc, true); 2196 + mem_cgroup_charge_statistics(to, PageCgroupCache(pc), nr_pages); 2217 2197 /* 2218 2198 * We charges against "to" which may not have any tasks. Then, "to" 2219 2199 * can be under rmdir(). But in current implementation, caller of ··· 2228 2208 * __mem_cgroup_move_account() 2229 2209 */ 2230 2210 static int mem_cgroup_move_account(struct page_cgroup *pc, 2231 - struct mem_cgroup *from, struct mem_cgroup *to, bool uncharge) 2211 + struct mem_cgroup *from, struct mem_cgroup *to, 2212 + bool uncharge, int charge_size) 2232 2213 { 2233 2214 int ret = -EINVAL; 2234 2215 unsigned long flags; 2235 2216 2217 + if ((charge_size > PAGE_SIZE) && !PageTransHuge(pc->page)) 2218 + return -EBUSY; 2219 + 2236 2220 lock_page_cgroup(pc); 2237 2221 if (PageCgroupUsed(pc) && pc->mem_cgroup == from) { 2238 2222 move_lock_page_cgroup(pc, &flags); 2239 - __mem_cgroup_move_account(pc, from, to, uncharge); 2223 + __mem_cgroup_move_account(pc, from, to, uncharge, charge_size); 2240 2224 move_unlock_page_cgroup(pc, &flags); 2241 2225 ret = 0; 2242 2226 } ··· 2265 2241 struct cgroup *cg = child->css.cgroup; 2266 2242 struct cgroup *pcg = cg->parent; 2267 2243 struct mem_cgroup *parent; 2244 + int charge = PAGE_SIZE; 2245 + unsigned long flags; 2268 2246 int ret; 2269 2247 2270 2248 /* Is ROOT ? */ ··· 2278 2252 goto out; 2279 2253 if (isolate_lru_page(page)) 2280 2254 goto put; 2255 + /* The page is isolated from LRU and we have no race with splitting */ 2256 + charge = PAGE_SIZE << compound_order(page); 2281 2257 2282 2258 parent = mem_cgroup_from_cont(pcg); 2283 - ret = __mem_cgroup_try_charge(NULL, gfp_mask, &parent, false, 2284 - PAGE_SIZE); 2259 + ret = __mem_cgroup_try_charge(NULL, gfp_mask, &parent, false, charge); 2285 2260 if (ret || !parent) 2286 2261 goto put_back; 2287 2262 2288 - ret = mem_cgroup_move_account(pc, child, parent, true); 2263 + if (charge > PAGE_SIZE) 2264 + flags = compound_lock_irqsave(page); 2265 + 2266 + ret = mem_cgroup_move_account(pc, child, parent, true, charge); 2289 2267 if (ret) 2290 - mem_cgroup_cancel_charge(parent, PAGE_SIZE); 2268 + mem_cgroup_cancel_charge(parent, charge); 2291 2269 put_back: 2270 + if (charge > PAGE_SIZE) 2271 + compound_unlock_irqrestore(page, flags); 2292 2272 putback_lru_page(page); 2293 2273 put: 2294 2274 put_page(page); ··· 2578 2546 static struct mem_cgroup * 2579 2547 __mem_cgroup_uncharge_common(struct page *page, enum charge_type ctype) 2580 2548 { 2581 - int i; 2582 2549 int count; 2583 2550 struct page_cgroup *pc; 2584 2551 struct mem_cgroup *mem = NULL; ··· 2627 2596 break; 2628 2597 } 2629 2598 2630 - for (i = 0; i < count; i++) 2631 - mem_cgroup_charge_statistics(mem, pc + i, false); 2599 + mem_cgroup_charge_statistics(mem, PageCgroupCache(pc), -count); 2632 2600 2633 2601 ClearPageCgroupUsed(pc); 2634 2602 /* ··· 4874 4844 goto put; 4875 4845 pc = lookup_page_cgroup(page); 4876 4846 if (!mem_cgroup_move_account(pc, 4877 - mc.from, mc.to, false)) { 4847 + mc.from, mc.to, false, PAGE_SIZE)) { 4878 4848 mc.precharge--; 4879 4849 /* we uncharge from mc.from later. */ 4880 4850 mc.moved_charge++;
+5 -6
mm/truncate.c
··· 549 549 * @inode: inode 550 550 * @newsize: new file size 551 551 * 552 - * truncate_setsize updastes i_size update and performs pagecache 553 - * truncation (if necessary) for a file size updates. It will be 554 - * typically be called from the filesystem's setattr function when 555 - * ATTR_SIZE is passed in. 552 + * truncate_setsize updates i_size and performs pagecache truncation (if 553 + * necessary) to @newsize. It will be typically be called from the filesystem's 554 + * setattr function when ATTR_SIZE is passed in. 556 555 * 557 - * Must be called with inode_mutex held and after all filesystem 558 - * specific block truncation has been performed. 556 + * Must be called with inode_mutex held and before all filesystem specific 557 + * block truncation has been performed. 559 558 */ 560 559 void truncate_setsize(struct inode *inode, loff_t newsize) 561 560 {
-1
mm/vmscan.c
··· 41 41 #include <linux/memcontrol.h> 42 42 #include <linux/delayacct.h> 43 43 #include <linux/sysctl.h> 44 - #include <linux/compaction.h> 45 44 46 45 #include <asm/tlbflush.h> 47 46 #include <asm/div64.h>
+3 -3
net/batman-adv/main.h
··· 151 151 } \ 152 152 while (0) 153 153 #else /* !CONFIG_BATMAN_ADV_DEBUG */ 154 - static inline void bat_dbg(char type __attribute__((unused)), 155 - struct bat_priv *bat_priv __attribute__((unused)), 156 - char *fmt __attribute__((unused)), ...) 154 + static inline void bat_dbg(char type __always_unused, 155 + struct bat_priv *bat_priv __always_unused, 156 + char *fmt __always_unused, ...) 157 157 { 158 158 } 159 159 #endif
+7 -7
net/batman-adv/packet.h
··· 63 63 uint8_t num_hna; 64 64 uint8_t gw_flags; /* flags related to gateway class */ 65 65 uint8_t align; 66 - } __attribute__((packed)); 66 + } __packed; 67 67 68 68 #define BAT_PACKET_LEN sizeof(struct batman_packet) 69 69 ··· 76 76 uint8_t orig[6]; 77 77 uint16_t seqno; 78 78 uint8_t uid; 79 - } __attribute__((packed)); 79 + } __packed; 80 80 81 81 #define BAT_RR_LEN 16 82 82 ··· 93 93 uint8_t uid; 94 94 uint8_t rr_cur; 95 95 uint8_t rr[BAT_RR_LEN][ETH_ALEN]; 96 - } __attribute__((packed)); 96 + } __packed; 97 97 98 98 struct unicast_packet { 99 99 uint8_t packet_type; 100 100 uint8_t version; /* batman version field */ 101 101 uint8_t dest[6]; 102 102 uint8_t ttl; 103 - } __attribute__((packed)); 103 + } __packed; 104 104 105 105 struct unicast_frag_packet { 106 106 uint8_t packet_type; ··· 110 110 uint8_t flags; 111 111 uint8_t orig[6]; 112 112 uint16_t seqno; 113 - } __attribute__((packed)); 113 + } __packed; 114 114 115 115 struct bcast_packet { 116 116 uint8_t packet_type; ··· 118 118 uint8_t orig[6]; 119 119 uint8_t ttl; 120 120 uint32_t seqno; 121 - } __attribute__((packed)); 121 + } __packed; 122 122 123 123 struct vis_packet { 124 124 uint8_t packet_type; ··· 131 131 * neighbors */ 132 132 uint8_t target_orig[6]; /* who should receive this packet */ 133 133 uint8_t sender_orig[6]; /* who sent or rebroadcasted this packet */ 134 - } __attribute__((packed)); 134 + } __packed; 135 135 136 136 #endif /* _NET_BATMAN_ADV_PACKET_H_ */
+2 -2
net/batman-adv/types.h
··· 246 246 /* this packet might be part of the vis send queue. */ 247 247 struct sk_buff *skb_packet; 248 248 /* vis_info may follow here*/ 249 - } __attribute__((packed)); 249 + } __packed; 250 250 251 251 struct vis_info_entry { 252 252 uint8_t src[ETH_ALEN]; 253 253 uint8_t dest[ETH_ALEN]; 254 254 uint8_t quality; /* quality = 0 means HNA */ 255 - } __attribute__((packed)); 255 + } __packed; 256 256 257 257 struct recvlist_node { 258 258 struct list_head list;
+5 -3
net/batman-adv/unicast.c
··· 229 229 if (!bat_priv->primary_if) 230 230 goto dropped; 231 231 232 - unicast_packet = (struct unicast_packet *) skb->data; 233 - 234 - memcpy(&tmp_uc, unicast_packet, uc_hdr_len); 235 232 frag_skb = dev_alloc_skb(data_len - (data_len / 2) + ucf_hdr_len); 233 + if (!frag_skb) 234 + goto dropped; 235 + 236 + unicast_packet = (struct unicast_packet *) skb->data; 237 + memcpy(&tmp_uc, unicast_packet, uc_hdr_len); 236 238 skb_split(skb, frag_skb, data_len / 2); 237 239 238 240 if (my_skb_head_push(skb, ucf_hdr_len - uc_hdr_len) < 0 ||
+5 -4
net/caif/cfcnfg.c
··· 191 191 struct cflayer *servl = NULL; 192 192 struct cfcnfg_phyinfo *phyinfo = NULL; 193 193 u8 phyid = 0; 194 + 194 195 caif_assert(adap_layer != NULL); 195 196 channel_id = adap_layer->id; 196 197 if (adap_layer->dn == NULL || channel_id == 0) { ··· 200 199 goto end; 201 200 } 202 201 servl = cfmuxl_remove_uplayer(cnfg->mux, channel_id); 203 - if (servl == NULL) 204 - goto end; 205 - layer_set_up(servl, NULL); 206 - ret = cfctrl_linkdown_req(cnfg->ctrl, channel_id, adap_layer); 207 202 if (servl == NULL) { 208 203 pr_err("PROTOCOL ERROR - Error removing service_layer Channel_Id(%d)", 209 204 channel_id); 210 205 ret = -EINVAL; 211 206 goto end; 212 207 } 208 + layer_set_up(servl, NULL); 209 + ret = cfctrl_linkdown_req(cnfg->ctrl, channel_id, adap_layer); 210 + if (ret) 211 + goto end; 213 212 caif_assert(channel_id == servl->id); 214 213 if (adap_layer->dn != NULL) { 215 214 phyid = cfsrvl_getphyid(adap_layer->dn);
+3
net/can/bcm.c
··· 1256 1256 struct sockaddr_can *addr = 1257 1257 (struct sockaddr_can *)msg->msg_name; 1258 1258 1259 + if (msg->msg_namelen < sizeof(*addr)) 1260 + return -EINVAL; 1261 + 1259 1262 if (addr->can_family != AF_CAN) 1260 1263 return -EINVAL; 1261 1264
+3
net/can/raw.c
··· 649 649 struct sockaddr_can *addr = 650 650 (struct sockaddr_can *)msg->msg_name; 651 651 652 + if (msg->msg_namelen < sizeof(*addr)) 653 + return -EINVAL; 654 + 652 655 if (addr->can_family != AF_CAN) 653 656 return -EINVAL; 654 657
+3 -3
net/core/dev.c
··· 2001 2001 2002 2002 static int harmonize_features(struct sk_buff *skb, __be16 protocol, int features) 2003 2003 { 2004 - if (!can_checksum_protocol(protocol, features)) { 2004 + if (!can_checksum_protocol(features, protocol)) { 2005 2005 features &= ~NETIF_F_ALL_CSUM; 2006 2006 features &= ~NETIF_F_SG; 2007 2007 } else if (illegal_highdma(skb->dev, skb)) { ··· 2023 2023 return harmonize_features(skb, protocol, features); 2024 2024 } 2025 2025 2026 - features &= skb->dev->vlan_features; 2026 + features &= (skb->dev->vlan_features | NETIF_F_HW_VLAN_TX); 2027 2027 2028 2028 if (protocol != htons(ETH_P_8021Q)) { 2029 2029 return harmonize_features(skb, protocol, features); 2030 2030 } else { 2031 2031 features &= NETIF_F_SG | NETIF_F_HIGHDMA | NETIF_F_FRAGLIST | 2032 - NETIF_F_GEN_CSUM; 2032 + NETIF_F_GEN_CSUM | NETIF_F_HW_VLAN_TX; 2033 2033 return harmonize_features(skb, protocol, features); 2034 2034 } 2035 2035 }
+1 -1
net/core/rtnetlink.c
··· 1820 1820 if (kind != 2 && security_netlink_recv(skb, CAP_NET_ADMIN)) 1821 1821 return -EPERM; 1822 1822 1823 - if (kind == 2 && (nlh->nlmsg_flags & NLM_F_DUMP) == NLM_F_DUMP) { 1823 + if (kind == 2 && nlh->nlmsg_flags&NLM_F_DUMP) { 1824 1824 struct sock *rtnl; 1825 1825 rtnl_dumpit_func dumpit; 1826 1826
+1 -1
net/ipv4/inet_diag.c
··· 858 858 nlmsg_len(nlh) < hdrlen) 859 859 return -EINVAL; 860 860 861 - if ((nlh->nlmsg_flags & NLM_F_DUMP) == NLM_F_DUMP) { 861 + if (nlh->nlmsg_flags & NLM_F_DUMP) { 862 862 if (nlmsg_attrlen(nlh, hdrlen)) { 863 863 struct nlattr *attr; 864 864
-3
net/ipv6/addrconf.c
··· 420 420 dev->type == ARPHRD_TUNNEL6 || 421 421 dev->type == ARPHRD_SIT || 422 422 dev->type == ARPHRD_NONE) { 423 - printk(KERN_INFO 424 - "%s: Disabled Privacy Extensions\n", 425 - dev->name); 426 423 ndev->cnf.use_tempaddr = -1; 427 424 } else { 428 425 in6_dev_hold(ndev);
+3 -3
net/mac80211/Kconfig
··· 20 20 def_bool n 21 21 22 22 config MAC80211_RC_PID 23 - bool "PID controller based rate control algorithm" if EMBEDDED 23 + bool "PID controller based rate control algorithm" if EXPERT 24 24 select MAC80211_HAS_RC 25 25 ---help--- 26 26 This option enables a TX rate control algorithm for ··· 28 28 rate. 29 29 30 30 config MAC80211_RC_MINSTREL 31 - bool "Minstrel" if EMBEDDED 31 + bool "Minstrel" if EXPERT 32 32 select MAC80211_HAS_RC 33 33 default y 34 34 ---help--- 35 35 This option enables the 'minstrel' TX rate control algorithm 36 36 37 37 config MAC80211_RC_MINSTREL_HT 38 - bool "Minstrel 802.11n support" if EMBEDDED 38 + bool "Minstrel 802.11n support" if EXPERT 39 39 depends on MAC80211_RC_MINSTREL 40 40 default y 41 41 ---help---
+2 -9
net/mac80211/agg-rx.c
··· 185 185 struct ieee80211_mgmt *mgmt, 186 186 size_t len) 187 187 { 188 - struct ieee80211_hw *hw = &local->hw; 189 - struct ieee80211_conf *conf = &hw->conf; 190 188 struct tid_ampdu_rx *tid_agg_rx; 191 189 u16 capab, tid, timeout, ba_policy, buf_size, start_seq_num, status; 192 190 u8 dialog_token; ··· 229 231 goto end_no_lock; 230 232 } 231 233 /* determine default buffer size */ 232 - if (buf_size == 0) { 233 - struct ieee80211_supported_band *sband; 234 - 235 - sband = local->hw.wiphy->bands[conf->channel->band]; 236 - buf_size = IEEE80211_MIN_AMPDU_BUF; 237 - buf_size = buf_size << sband->ht_cap.ampdu_factor; 238 - } 234 + if (buf_size == 0) 235 + buf_size = IEEE80211_MAX_AMPDU_BUF; 239 236 240 237 241 238 /* examine state machine */
+11 -1
net/mac80211/main.c
··· 39 39 MODULE_PARM_DESC(ieee80211_disable_40mhz_24ghz, 40 40 "Disable 40MHz support in the 2.4GHz band"); 41 41 42 + static struct lock_class_key ieee80211_rx_skb_queue_class; 43 + 42 44 void ieee80211_configure_filter(struct ieee80211_local *local) 43 45 { 44 46 u64 mc; ··· 571 569 spin_lock_init(&local->filter_lock); 572 570 spin_lock_init(&local->queue_stop_reason_lock); 573 571 574 - skb_queue_head_init(&local->rx_skb_queue); 572 + /* 573 + * The rx_skb_queue is only accessed from tasklets, 574 + * but other SKB queues are used from within IRQ 575 + * context. Therefore, this one needs a different 576 + * locking class so our direct, non-irq-safe use of 577 + * the queue's lock doesn't throw lockdep warnings. 578 + */ 579 + skb_queue_head_init_class(&local->rx_skb_queue, 580 + &ieee80211_rx_skb_queue_class); 575 581 576 582 INIT_DELAYED_WORK(&local->scan_work, ieee80211_scan_work); 577 583
+2 -2
net/netfilter/nf_conntrack_netlink.c
··· 924 924 u16 zone; 925 925 int err; 926 926 927 - if ((nlh->nlmsg_flags & NLM_F_DUMP) == NLM_F_DUMP) 927 + if (nlh->nlmsg_flags & NLM_F_DUMP) 928 928 return netlink_dump_start(ctnl, skb, nlh, ctnetlink_dump_table, 929 929 ctnetlink_done); 930 930 ··· 1787 1787 u16 zone; 1788 1788 int err; 1789 1789 1790 - if ((nlh->nlmsg_flags & NLM_F_DUMP) == NLM_F_DUMP) { 1790 + if (nlh->nlmsg_flags & NLM_F_DUMP) { 1791 1791 return netlink_dump_start(ctnl, skb, nlh, 1792 1792 ctnetlink_exp_dump_table, 1793 1793 ctnetlink_exp_done);
+1 -1
net/netlink/genetlink.c
··· 519 519 security_netlink_recv(skb, CAP_NET_ADMIN)) 520 520 return -EPERM; 521 521 522 - if ((nlh->nlmsg_flags & NLM_F_DUMP) == NLM_F_DUMP) { 522 + if (nlh->nlmsg_flags & NLM_F_DUMP) { 523 523 if (ops->dumpit == NULL) 524 524 return -EOPNOTSUPP; 525 525
+2 -2
net/rfkill/Kconfig
··· 18 18 default y 19 19 20 20 config RFKILL_INPUT 21 - bool "RF switch input support" if EMBEDDED 21 + bool "RF switch input support" if EXPERT 22 22 depends on RFKILL 23 23 depends on INPUT = y || RFKILL = INPUT 24 - default y if !EMBEDDED 24 + default y if !EXPERT
+2 -2
net/sctp/socket.c
··· 3428 3428 retval = sctp_setsockopt_peer_addr_params(sk, optval, optlen); 3429 3429 break; 3430 3430 3431 - case SCTP_DELAYED_ACK: 3431 + case SCTP_DELAYED_SACK: 3432 3432 retval = sctp_setsockopt_delayed_ack(sk, optval, optlen); 3433 3433 break; 3434 3434 case SCTP_PARTIAL_DELIVERY_POINT: ··· 5333 5333 retval = sctp_getsockopt_peer_addr_params(sk, len, optval, 5334 5334 optlen); 5335 5335 break; 5336 - case SCTP_DELAYED_ACK: 5336 + case SCTP_DELAYED_SACK: 5337 5337 retval = sctp_getsockopt_delayed_ack(sk, len, optval, 5338 5338 optlen); 5339 5339 break;
+1 -1
net/wireless/Kconfig
··· 95 95 If unsure, say N. 96 96 97 97 config CFG80211_INTERNAL_REGDB 98 - bool "use statically compiled regulatory rules database" if EMBEDDED 98 + bool "use statically compiled regulatory rules database" if EXPERT 99 99 default n 100 100 depends on CFG80211 101 101 ---help---
+1 -1
net/xfrm/xfrm_user.c
··· 2189 2189 2190 2190 if ((type == (XFRM_MSG_GETSA - XFRM_MSG_BASE) || 2191 2191 type == (XFRM_MSG_GETPOLICY - XFRM_MSG_BASE)) && 2192 - (nlh->nlmsg_flags & NLM_F_DUMP) == NLM_F_DUMP) { 2192 + (nlh->nlmsg_flags & NLM_F_DUMP)) { 2193 2193 if (link->dump == NULL) 2194 2194 return -EINVAL; 2195 2195
+8 -9
security/keys/compat.c
··· 1 - /* compat.c: 32-bit compatibility syscall for 64-bit systems 1 + /* 32-bit compatibility syscall for 64-bit systems 2 2 * 3 3 * Copyright (C) 2004-5 Red Hat, Inc. All Rights Reserved. 4 4 * Written by David Howells (dhowells@redhat.com) ··· 14 14 #include <linux/compat.h> 15 15 #include "internal.h" 16 16 17 - /*****************************************************************************/ 18 17 /* 19 - * the key control system call, 32-bit compatibility version for 64-bit archs 20 - * - this should only be called if the 64-bit arch uses weird pointers in 21 - * 32-bit mode or doesn't guarantee that the top 32-bits of the argument 22 - * registers on taking a 32-bit syscall are zero 23 - * - if you can, you should call sys_keyctl directly 18 + * The key control system call, 32-bit compatibility version for 64-bit archs 19 + * 20 + * This should only be called if the 64-bit arch uses weird pointers in 32-bit 21 + * mode or doesn't guarantee that the top 32-bits of the argument registers on 22 + * taking a 32-bit syscall are zero. If you can, you should call sys_keyctl() 23 + * directly. 24 24 */ 25 25 asmlinkage long compat_sys_keyctl(u32 option, 26 26 u32 arg2, u32 arg3, u32 arg4, u32 arg5) ··· 88 88 default: 89 89 return -EOPNOTSUPP; 90 90 } 91 - 92 - } /* end compat_sys_keyctl() */ 91 + }
-1
security/keys/encrypted_defined.c
··· 888 888 out: 889 889 encrypted_shash_release(); 890 890 return ret; 891 - 892 891 } 893 892 894 893 static void __exit cleanup_encrypted(void)
+7 -7
security/keys/gc.c
··· 32 32 static time_t key_gc_new_timer; 33 33 34 34 /* 35 - * Schedule a garbage collection run 36 - * - precision isn't particularly important 35 + * Schedule a garbage collection run. 36 + * - time precision isn't particularly important 37 37 */ 38 38 void key_schedule_gc(time_t gc_at) 39 39 { ··· 61 61 } 62 62 63 63 /* 64 - * Garbage collect pointers from a keyring 65 - * - return true if we altered the keyring 64 + * Garbage collect pointers from a keyring. 65 + * 66 + * Return true if we altered the keyring. 66 67 */ 67 68 static bool key_gc_keyring(struct key *keyring, time_t limit) 68 69 __releases(key_serial_lock) ··· 108 107 } 109 108 110 109 /* 111 - * Garbage collector for keys 112 - * - this involves scanning the keyrings for dead, expired and revoked keys 113 - * that have overstayed their welcome 110 + * Garbage collector for keys. This involves scanning the keyrings for dead, 111 + * expired and revoked keys that have overstayed their welcome 114 112 */ 115 113 static void key_garbage_collector(struct work_struct *work) 116 114 {
+14 -12
security/keys/internal.h
··· 1 - /* internal.h: authentication token and access key management internal defs 1 + /* Authentication token and access key management internal defs 2 2 * 3 3 * Copyright (C) 2003-5, 2007 Red Hat, Inc. All Rights Reserved. 4 4 * Written by David Howells (dhowells@redhat.com) ··· 35 35 36 36 /*****************************************************************************/ 37 37 /* 38 - * keep track of keys for a user 39 - * - this needs to be separate to user_struct to avoid a refcount-loop 40 - * (user_struct pins some keyrings which pin this struct) 41 - * - this also keeps track of keys under request from userspace for this UID 38 + * Keep track of keys for a user. 39 + * 40 + * This needs to be separate to user_struct to avoid a refcount-loop 41 + * (user_struct pins some keyrings which pin this struct). 42 + * 43 + * We also keep track of keys under request from userspace for this UID here. 42 44 */ 43 45 struct key_user { 44 46 struct rb_node node; ··· 64 62 extern void key_user_put(struct key_user *user); 65 63 66 64 /* 67 - * key quota limits 65 + * Key quota limits. 68 66 * - root has its own separate limits to everyone else 69 67 */ 70 68 extern unsigned key_quota_root_maxkeys; ··· 148 146 extern void keyring_gc(struct key *keyring, time_t limit); 149 147 extern void key_schedule_gc(time_t expiry_at); 150 148 151 - /* 152 - * check to see whether permission is granted to use a key in the desired way 153 - */ 154 149 extern int key_task_permission(const key_ref_t key_ref, 155 150 const struct cred *cred, 156 151 key_perm_t perm); 157 152 153 + /* 154 + * Check to see whether permission is granted to use a key in the desired way. 155 + */ 158 156 static inline int key_permission(const key_ref_t key_ref, key_perm_t perm) 159 157 { 160 158 return key_task_permission(key_ref, current_cred(), perm); ··· 170 168 #define KEY_ALL 0x3f /* all the above permissions */ 171 169 172 170 /* 173 - * request_key authorisation 171 + * Authorisation record for request_key(). 174 172 */ 175 173 struct request_key_auth { 176 174 struct key *target_key; ··· 190 188 extern struct key *key_get_instantiation_authkey(key_serial_t target_id); 191 189 192 190 /* 193 - * keyctl functions 191 + * keyctl() functions 194 192 */ 195 193 extern long keyctl_get_keyring_ID(key_serial_t, int); 196 194 extern long keyctl_join_session_keyring(const char __user *); ··· 216 214 extern long keyctl_session_to_parent(void); 217 215 218 216 /* 219 - * debugging key validation 217 + * Debugging key validation 220 218 */ 221 219 #ifdef KEY_DEBUGGING 222 220 extern void __key_check(const struct key *);
+193 -127
security/keys/key.c
··· 39 39 static void key_cleanup(struct work_struct *work); 40 40 static DECLARE_WORK(key_cleanup_task, key_cleanup); 41 41 42 - /* we serialise key instantiation and link */ 42 + /* We serialise key instantiation and link */ 43 43 DEFINE_MUTEX(key_construction_mutex); 44 44 45 - /* any key who's type gets unegistered will be re-typed to this */ 45 + /* Any key who's type gets unegistered will be re-typed to this */ 46 46 static struct key_type key_type_dead = { 47 47 .name = "dead", 48 48 }; ··· 56 56 } 57 57 #endif 58 58 59 - /*****************************************************************************/ 60 59 /* 61 - * get the key quota record for a user, allocating a new record if one doesn't 62 - * already exist 60 + * Get the key quota record for a user, allocating a new record if one doesn't 61 + * already exist. 63 62 */ 64 63 struct key_user *key_user_lookup(uid_t uid, struct user_namespace *user_ns) 65 64 { ··· 66 67 struct rb_node *parent = NULL; 67 68 struct rb_node **p; 68 69 69 - try_again: 70 + try_again: 70 71 p = &key_user_tree.rb_node; 71 72 spin_lock(&key_user_lock); 72 73 ··· 123 124 goto out; 124 125 125 126 /* okay - we found a user record for this UID */ 126 - found: 127 + found: 127 128 atomic_inc(&user->usage); 128 129 spin_unlock(&key_user_lock); 129 130 kfree(candidate); 130 - out: 131 + out: 131 132 return user; 133 + } 132 134 133 - } /* end key_user_lookup() */ 134 - 135 - /*****************************************************************************/ 136 135 /* 137 - * dispose of a user structure 136 + * Dispose of a user structure 138 137 */ 139 138 void key_user_put(struct key_user *user) 140 139 { ··· 143 146 144 147 kfree(user); 145 148 } 149 + } 146 150 147 - } /* end key_user_put() */ 148 - 149 - /*****************************************************************************/ 150 151 /* 151 - * assign a key the next unique serial number 152 - * - these are assigned randomly to avoid security issues through covert 153 - * channel problems 152 + * Allocate a serial number for a key. These are assigned randomly to avoid 153 + * security issues through covert channel problems. 154 154 */ 155 155 static inline void key_alloc_serial(struct key *key) 156 156 { ··· 205 211 if (key->serial < xkey->serial) 206 212 goto attempt_insertion; 207 213 } 214 + } 208 215 209 - } /* end key_alloc_serial() */ 210 - 211 - /*****************************************************************************/ 212 - /* 213 - * allocate a key of the specified type 214 - * - update the user's quota to reflect the existence of the key 215 - * - called from a key-type operation with key_types_sem read-locked by 216 - * key_create_or_update() 217 - * - this prevents unregistration of the key type 218 - * - upon return the key is as yet uninstantiated; the caller needs to either 219 - * instantiate the key or discard it before returning 216 + /** 217 + * key_alloc - Allocate a key of the specified type. 218 + * @type: The type of key to allocate. 219 + * @desc: The key description to allow the key to be searched out. 220 + * @uid: The owner of the new key. 221 + * @gid: The group ID for the new key's group permissions. 222 + * @cred: The credentials specifying UID namespace. 223 + * @perm: The permissions mask of the new key. 224 + * @flags: Flags specifying quota properties. 225 + * 226 + * Allocate a key of the specified type with the attributes given. The key is 227 + * returned in an uninstantiated state and the caller needs to instantiate the 228 + * key before returning. 229 + * 230 + * The user's key count quota is updated to reflect the creation of the key and 231 + * the user's key data quota has the default for the key type reserved. The 232 + * instantiation function should amend this as necessary. If insufficient 233 + * quota is available, -EDQUOT will be returned. 234 + * 235 + * The LSM security modules can prevent a key being created, in which case 236 + * -EACCES will be returned. 237 + * 238 + * Returns a pointer to the new key if successful and an error code otherwise. 239 + * 240 + * Note that the caller needs to ensure the key type isn't uninstantiated. 241 + * Internally this can be done by locking key_types_sem. Externally, this can 242 + * be done by either never unregistering the key type, or making sure 243 + * key_alloc() calls don't race with module unloading. 220 244 */ 221 245 struct key *key_alloc(struct key_type *type, const char *desc, 222 246 uid_t uid, gid_t gid, const struct cred *cred, ··· 356 344 key_user_put(user); 357 345 key = ERR_PTR(-EDQUOT); 358 346 goto error; 359 - 360 - } /* end key_alloc() */ 361 - 347 + } 362 348 EXPORT_SYMBOL(key_alloc); 363 349 364 - /*****************************************************************************/ 365 - /* 366 - * reserve an amount of quota for the key's payload 350 + /** 351 + * key_payload_reserve - Adjust data quota reservation for the key's payload 352 + * @key: The key to make the reservation for. 353 + * @datalen: The amount of data payload the caller now wants. 354 + * 355 + * Adjust the amount of the owning user's key data quota that a key reserves. 356 + * If the amount is increased, then -EDQUOT may be returned if there isn't 357 + * enough free quota available. 358 + * 359 + * If successful, 0 is returned. 367 360 */ 368 361 int key_payload_reserve(struct key *key, size_t datalen) 369 362 { ··· 401 384 key->datalen = datalen; 402 385 403 386 return ret; 404 - 405 - } /* end key_payload_reserve() */ 406 - 387 + } 407 388 EXPORT_SYMBOL(key_payload_reserve); 408 389 409 - /*****************************************************************************/ 410 390 /* 411 - * instantiate a key and link it into the target keyring atomically 412 - * - called with the target keyring's semaphore writelocked 391 + * Instantiate a key and link it into the target keyring atomically. Must be 392 + * called with the target keyring's semaphore writelocked. The target key's 393 + * semaphore need not be locked as instantiation is serialised by 394 + * key_construction_mutex. 413 395 */ 414 396 static int __key_instantiate_and_link(struct key *key, 415 397 const void *data, ··· 457 441 wake_up_bit(&key->flags, KEY_FLAG_USER_CONSTRUCT); 458 442 459 443 return ret; 444 + } 460 445 461 - } /* end __key_instantiate_and_link() */ 462 - 463 - /*****************************************************************************/ 464 - /* 465 - * instantiate a key and link it into the target keyring atomically 446 + /** 447 + * key_instantiate_and_link - Instantiate a key and link it into the keyring. 448 + * @key: The key to instantiate. 449 + * @data: The data to use to instantiate the keyring. 450 + * @datalen: The length of @data. 451 + * @keyring: Keyring to create a link in on success (or NULL). 452 + * @authkey: The authorisation token permitting instantiation. 453 + * 454 + * Instantiate a key that's in the uninstantiated state using the provided data 455 + * and, if successful, link it in to the destination keyring if one is 456 + * supplied. 457 + * 458 + * If successful, 0 is returned, the authorisation token is revoked and anyone 459 + * waiting for the key is woken up. If the key was already instantiated, 460 + * -EBUSY will be returned. 466 461 */ 467 462 int key_instantiate_and_link(struct key *key, 468 463 const void *data, ··· 498 471 __key_link_end(keyring, key->type, prealloc); 499 472 500 473 return ret; 501 - 502 - } /* end key_instantiate_and_link() */ 474 + } 503 475 504 476 EXPORT_SYMBOL(key_instantiate_and_link); 505 477 506 - /*****************************************************************************/ 507 - /* 508 - * negatively instantiate a key and link it into the target keyring atomically 478 + /** 479 + * key_negate_and_link - Negatively instantiate a key and link it into the keyring. 480 + * @key: The key to instantiate. 481 + * @timeout: The timeout on the negative key. 482 + * @keyring: Keyring to create a link in on success (or NULL). 483 + * @authkey: The authorisation token permitting instantiation. 484 + * 485 + * Negatively instantiate a key that's in the uninstantiated state and, if 486 + * successful, set its timeout and link it in to the destination keyring if one 487 + * is supplied. The key and any links to the key will be automatically garbage 488 + * collected after the timeout expires. 489 + * 490 + * Negative keys are used to rate limit repeated request_key() calls by causing 491 + * them to return -ENOKEY until the negative key expires. 492 + * 493 + * If successful, 0 is returned, the authorisation token is revoked and anyone 494 + * waiting for the key is woken up. If the key was already instantiated, 495 + * -EBUSY will be returned. 509 496 */ 510 497 int key_negate_and_link(struct key *key, 511 498 unsigned timeout, ··· 576 535 wake_up_bit(&key->flags, KEY_FLAG_USER_CONSTRUCT); 577 536 578 537 return ret == 0 ? link_ret : ret; 579 - 580 - } /* end key_negate_and_link() */ 538 + } 581 539 582 540 EXPORT_SYMBOL(key_negate_and_link); 583 541 584 - /*****************************************************************************/ 585 542 /* 586 - * do cleaning up in process context so that we don't have to disable 587 - * interrupts all over the place 543 + * Garbage collect keys in process context so that we don't have to disable 544 + * interrupts all over the place. 545 + * 546 + * key_put() schedules this rather than trying to do the cleanup itself, which 547 + * means key_put() doesn't have to sleep. 588 548 */ 589 549 static void key_cleanup(struct work_struct *work) 590 550 { 591 551 struct rb_node *_n; 592 552 struct key *key; 593 553 594 - go_again: 554 + go_again: 595 555 /* look for a dead key in the tree */ 596 556 spin_lock(&key_serial_lock); 597 557 ··· 606 564 spin_unlock(&key_serial_lock); 607 565 return; 608 566 609 - found_dead_key: 567 + found_dead_key: 610 568 /* we found a dead key - once we've removed it from the tree, we can 611 569 * drop the lock */ 612 570 rb_erase(&key->serial_node, &key_serial_tree); ··· 643 601 644 602 /* there may, of course, be more than one key to destroy */ 645 603 goto go_again; 604 + } 646 605 647 - } /* end key_cleanup() */ 648 - 649 - /*****************************************************************************/ 650 - /* 651 - * dispose of a reference to a key 652 - * - when all the references are gone, we schedule the cleanup task to come and 653 - * pull it out of the tree in definite process context 606 + /** 607 + * key_put - Discard a reference to a key. 608 + * @key: The key to discard a reference from. 609 + * 610 + * Discard a reference to a key, and when all the references are gone, we 611 + * schedule the cleanup task to come and pull it out of the tree in process 612 + * context at some later time. 654 613 */ 655 614 void key_put(struct key *key) 656 615 { ··· 661 618 if (atomic_dec_and_test(&key->usage)) 662 619 schedule_work(&key_cleanup_task); 663 620 } 664 - 665 - } /* end key_put() */ 666 - 621 + } 667 622 EXPORT_SYMBOL(key_put); 668 623 669 - /*****************************************************************************/ 670 624 /* 671 - * find a key by its serial number 625 + * Find a key by its serial number. 672 626 */ 673 627 struct key *key_lookup(key_serial_t id) 674 628 { ··· 687 647 goto found; 688 648 } 689 649 690 - not_found: 650 + not_found: 691 651 key = ERR_PTR(-ENOKEY); 692 652 goto error; 693 653 694 - found: 654 + found: 695 655 /* pretend it doesn't exist if it is awaiting deletion */ 696 656 if (atomic_read(&key->usage) == 0) 697 657 goto not_found; ··· 701 661 */ 702 662 atomic_inc(&key->usage); 703 663 704 - error: 664 + error: 705 665 spin_unlock(&key_serial_lock); 706 666 return key; 667 + } 707 668 708 - } /* end key_lookup() */ 709 - 710 - /*****************************************************************************/ 711 669 /* 712 - * find and lock the specified key type against removal 713 - * - we return with the sem readlocked 670 + * Find and lock the specified key type against removal. 671 + * 672 + * We return with the sem read-locked if successful. If the type wasn't 673 + * available -ENOKEY is returned instead. 714 674 */ 715 675 struct key_type *key_type_lookup(const char *type) 716 676 { ··· 728 688 up_read(&key_types_sem); 729 689 ktype = ERR_PTR(-ENOKEY); 730 690 731 - found_kernel_type: 691 + found_kernel_type: 732 692 return ktype; 693 + } 733 694 734 - } /* end key_type_lookup() */ 735 - 736 - /*****************************************************************************/ 737 695 /* 738 - * unlock a key type 696 + * Unlock a key type locked by key_type_lookup(). 739 697 */ 740 698 void key_type_put(struct key_type *ktype) 741 699 { 742 700 up_read(&key_types_sem); 701 + } 743 702 744 - } /* end key_type_put() */ 745 - 746 - /*****************************************************************************/ 747 703 /* 748 - * attempt to update an existing key 749 - * - the key has an incremented refcount 750 - * - we need to put the key if we get an error 704 + * Attempt to update an existing key. 705 + * 706 + * The key is given to us with an incremented refcount that we need to discard 707 + * if we get an error. 751 708 */ 752 709 static inline key_ref_t __key_update(key_ref_t key_ref, 753 710 const void *payload, size_t plen) ··· 779 742 key_put(key); 780 743 key_ref = ERR_PTR(ret); 781 744 goto out; 745 + } 782 746 783 - } /* end __key_update() */ 784 - 785 - /*****************************************************************************/ 786 - /* 787 - * search the specified keyring for a key of the same description; if one is 788 - * found, update it, otherwise add a new one 747 + /** 748 + * key_create_or_update - Update or create and instantiate a key. 749 + * @keyring_ref: A pointer to the destination keyring with possession flag. 750 + * @type: The type of key. 751 + * @description: The searchable description for the key. 752 + * @payload: The data to use to instantiate or update the key. 753 + * @plen: The length of @payload. 754 + * @perm: The permissions mask for a new key. 755 + * @flags: The quota flags for a new key. 756 + * 757 + * Search the destination keyring for a key of the same description and if one 758 + * is found, update it, otherwise create and instantiate a new one and create a 759 + * link to it from that keyring. 760 + * 761 + * If perm is KEY_PERM_UNDEF then an appropriate key permissions mask will be 762 + * concocted. 763 + * 764 + * Returns a pointer to the new key if successful, -ENODEV if the key type 765 + * wasn't available, -ENOTDIR if the keyring wasn't a keyring, -EACCES if the 766 + * caller isn't permitted to modify the keyring or the LSM did not permit 767 + * creation of the key. 768 + * 769 + * On success, the possession flag from the keyring ref will be tacked on to 770 + * the key ref before it is returned. 789 771 */ 790 772 key_ref_t key_create_or_update(key_ref_t keyring_ref, 791 773 const char *type, ··· 911 855 912 856 key_ref = __key_update(key_ref, payload, plen); 913 857 goto error; 914 - 915 - } /* end key_create_or_update() */ 916 - 858 + } 917 859 EXPORT_SYMBOL(key_create_or_update); 918 860 919 - /*****************************************************************************/ 920 - /* 921 - * update a key 861 + /** 862 + * key_update - Update a key's contents. 863 + * @key_ref: The pointer (plus possession flag) to the key. 864 + * @payload: The data to be used to update the key. 865 + * @plen: The length of @payload. 866 + * 867 + * Attempt to update the contents of a key with the given payload data. The 868 + * caller must be granted Write permission on the key. Negative keys can be 869 + * instantiated by this method. 870 + * 871 + * Returns 0 on success, -EACCES if not permitted and -EOPNOTSUPP if the key 872 + * type does not support updating. The key type may return other errors. 922 873 */ 923 874 int key_update(key_ref_t key_ref, const void *payload, size_t plen) 924 875 { ··· 954 891 955 892 error: 956 893 return ret; 957 - 958 - } /* end key_update() */ 959 - 894 + } 960 895 EXPORT_SYMBOL(key_update); 961 896 962 - /*****************************************************************************/ 963 - /* 964 - * revoke a key 897 + /** 898 + * key_revoke - Revoke a key. 899 + * @key: The key to be revoked. 900 + * 901 + * Mark a key as being revoked and ask the type to free up its resources. The 902 + * revocation timeout is set and the key and all its links will be 903 + * automatically garbage collected after key_gc_delay amount of time if they 904 + * are not manually dealt with first. 965 905 */ 966 906 void key_revoke(struct key *key) 967 907 { ··· 992 926 } 993 927 994 928 up_write(&key->sem); 995 - 996 - } /* end key_revoke() */ 997 - 929 + } 998 930 EXPORT_SYMBOL(key_revoke); 999 931 1000 - /*****************************************************************************/ 1001 - /* 1002 - * register a type of key 932 + /** 933 + * register_key_type - Register a type of key. 934 + * @ktype: The new key type. 935 + * 936 + * Register a new key type. 937 + * 938 + * Returns 0 on success or -EEXIST if a type of this name already exists. 1003 939 */ 1004 940 int register_key_type(struct key_type *ktype) 1005 941 { ··· 1021 953 list_add(&ktype->link, &key_types_list); 1022 954 ret = 0; 1023 955 1024 - out: 956 + out: 1025 957 up_write(&key_types_sem); 1026 958 return ret; 1027 - 1028 - } /* end register_key_type() */ 1029 - 959 + } 1030 960 EXPORT_SYMBOL(register_key_type); 1031 961 1032 - /*****************************************************************************/ 1033 - /* 1034 - * unregister a type of key 962 + /** 963 + * unregister_key_type - Unregister a type of key. 964 + * @ktype: The key type. 965 + * 966 + * Unregister a key type and mark all the extant keys of this type as dead. 967 + * Those keys of this type are then destroyed to get rid of their payloads and 968 + * they and their links will be garbage collected as soon as possible. 1035 969 */ 1036 970 void unregister_key_type(struct key_type *ktype) 1037 971 { ··· 1080 1010 up_write(&key_types_sem); 1081 1011 1082 1012 key_schedule_gc(0); 1083 - 1084 - } /* end unregister_key_type() */ 1085 - 1013 + } 1086 1014 EXPORT_SYMBOL(unregister_key_type); 1087 1015 1088 - /*****************************************************************************/ 1089 1016 /* 1090 - * initialise the key management stuff 1017 + * Initialise the key management state. 1091 1018 */ 1092 1019 void __init key_init(void) 1093 1020 { ··· 1104 1037 1105 1038 rb_insert_color(&root_key_user.node, 1106 1039 &key_user_tree); 1107 - 1108 - } /* end key_init() */ 1040 + }
+205 -150
security/keys/keyctl.c
··· 1 - /* keyctl.c: userspace keyctl operations 1 + /* Userspace key control operations 2 2 * 3 3 * Copyright (C) 2004-5 Red Hat, Inc. All Rights Reserved. 4 4 * Written by David Howells (dhowells@redhat.com) ··· 31 31 int ret; 32 32 33 33 ret = strncpy_from_user(type, _type, len); 34 - 35 34 if (ret < 0) 36 35 return ret; 37 - 38 36 if (ret == 0 || ret >= len) 39 37 return -EINVAL; 40 - 41 38 if (type[0] == '.') 42 39 return -EPERM; 43 - 44 40 type[len - 1] = '\0'; 45 - 46 41 return 0; 47 42 } 48 43 49 - /*****************************************************************************/ 50 44 /* 51 - * extract the description of a new key from userspace and either add it as a 52 - * new key to the specified keyring or update a matching key in that keyring 53 - * - the keyring must be writable 54 - * - returns the new key's serial number 55 - * - implements add_key() 45 + * Extract the description of a new key from userspace and either add it as a 46 + * new key to the specified keyring or update a matching key in that keyring. 47 + * 48 + * The keyring must be writable so that we can attach the key to it. 49 + * 50 + * If successful, the new key's serial number is returned, otherwise an error 51 + * code is returned. 56 52 */ 57 53 SYSCALL_DEFINE5(add_key, const char __user *, _type, 58 54 const char __user *, _description, ··· 128 132 kfree(description); 129 133 error: 130 134 return ret; 135 + } 131 136 132 - } /* end sys_add_key() */ 133 - 134 - /*****************************************************************************/ 135 137 /* 136 - * search the process keyrings for a matching key 137 - * - nested keyrings may also be searched if they have Search permission 138 - * - if a key is found, it will be attached to the destination keyring if 139 - * there's one specified 140 - * - /sbin/request-key will be invoked if _callout_info is non-NULL 141 - * - the _callout_info string will be passed to /sbin/request-key 142 - * - if the _callout_info string is empty, it will be rendered as "-" 143 - * - implements request_key() 138 + * Search the process keyrings and keyring trees linked from those for a 139 + * matching key. Keyrings must have appropriate Search permission to be 140 + * searched. 141 + * 142 + * If a key is found, it will be attached to the destination keyring if there's 143 + * one specified and the serial number of the key will be returned. 144 + * 145 + * If no key is found, /sbin/request-key will be invoked if _callout_info is 146 + * non-NULL in an attempt to create a key. The _callout_info string will be 147 + * passed to /sbin/request-key to aid with completing the request. If the 148 + * _callout_info string is "" then it will be changed to "-". 144 149 */ 145 150 SYSCALL_DEFINE4(request_key, const char __user *, _type, 146 151 const char __user *, _description, ··· 219 222 kfree(description); 220 223 error: 221 224 return ret; 225 + } 222 226 223 - } /* end sys_request_key() */ 224 - 225 - /*****************************************************************************/ 226 227 /* 227 - * get the ID of the specified process keyring 228 - * - the keyring must have search permission to be found 229 - * - implements keyctl(KEYCTL_GET_KEYRING_ID) 228 + * Get the ID of the specified process keyring. 229 + * 230 + * The requested keyring must have search permission to be found. 231 + * 232 + * If successful, the ID of the requested keyring will be returned. 230 233 */ 231 234 long keyctl_get_keyring_ID(key_serial_t id, int create) 232 235 { ··· 245 248 key_ref_put(key_ref); 246 249 error: 247 250 return ret; 251 + } 248 252 249 - } /* end keyctl_get_keyring_ID() */ 250 - 251 - /*****************************************************************************/ 252 253 /* 253 - * join the session keyring 254 - * - implements keyctl(KEYCTL_JOIN_SESSION_KEYRING) 254 + * Join a (named) session keyring. 255 + * 256 + * Create and join an anonymous session keyring or join a named session 257 + * keyring, creating it if necessary. A named session keyring must have Search 258 + * permission for it to be joined. Session keyrings without this permit will 259 + * be skipped over. 260 + * 261 + * If successful, the ID of the joined session keyring will be returned. 255 262 */ 256 263 long keyctl_join_session_keyring(const char __user *_name) 257 264 { ··· 278 277 279 278 error: 280 279 return ret; 280 + } 281 281 282 - } /* end keyctl_join_session_keyring() */ 283 - 284 - /*****************************************************************************/ 285 282 /* 286 - * update a key's data payload 287 - * - the key must be writable 288 - * - implements keyctl(KEYCTL_UPDATE) 283 + * Update a key's data payload from the given data. 284 + * 285 + * The key must grant the caller Write permission and the key type must support 286 + * updating for this to work. A negative key can be positively instantiated 287 + * with this call. 288 + * 289 + * If successful, 0 will be returned. If the key type does not support 290 + * updating, then -EOPNOTSUPP will be returned. 289 291 */ 290 292 long keyctl_update_key(key_serial_t id, 291 293 const void __user *_payload, ··· 330 326 kfree(payload); 331 327 error: 332 328 return ret; 329 + } 333 330 334 - } /* end keyctl_update_key() */ 335 - 336 - /*****************************************************************************/ 337 331 /* 338 - * revoke a key 339 - * - the key must be writable 340 - * - implements keyctl(KEYCTL_REVOKE) 332 + * Revoke a key. 333 + * 334 + * The key must be grant the caller Write or Setattr permission for this to 335 + * work. The key type should give up its quota claim when revoked. The key 336 + * and any links to the key will be automatically garbage collected after a 337 + * certain amount of time (/proc/sys/kernel/keys/gc_delay). 338 + * 339 + * If successful, 0 is returned. 341 340 */ 342 341 long keyctl_revoke_key(key_serial_t id) 343 342 { ··· 365 358 key_ref_put(key_ref); 366 359 error: 367 360 return ret; 361 + } 368 362 369 - } /* end keyctl_revoke_key() */ 370 - 371 - /*****************************************************************************/ 372 363 /* 373 - * clear the specified process keyring 374 - * - the keyring must be writable 375 - * - implements keyctl(KEYCTL_CLEAR) 364 + * Clear the specified keyring, creating an empty process keyring if one of the 365 + * special keyring IDs is used. 366 + * 367 + * The keyring must grant the caller Write permission for this to work. If 368 + * successful, 0 will be returned. 376 369 */ 377 370 long keyctl_keyring_clear(key_serial_t ringid) 378 371 { ··· 390 383 key_ref_put(keyring_ref); 391 384 error: 392 385 return ret; 386 + } 393 387 394 - } /* end keyctl_keyring_clear() */ 395 - 396 - /*****************************************************************************/ 397 388 /* 398 - * link a key into a keyring 399 - * - the keyring must be writable 400 - * - the key must be linkable 401 - * - implements keyctl(KEYCTL_LINK) 389 + * Create a link from a keyring to a key if there's no matching key in the 390 + * keyring, otherwise replace the link to the matching key with a link to the 391 + * new key. 392 + * 393 + * The key must grant the caller Link permission and the the keyring must grant 394 + * the caller Write permission. Furthermore, if an additional link is created, 395 + * the keyring's quota will be extended. 396 + * 397 + * If successful, 0 will be returned. 402 398 */ 403 399 long keyctl_keyring_link(key_serial_t id, key_serial_t ringid) 404 400 { ··· 427 417 key_ref_put(keyring_ref); 428 418 error: 429 419 return ret; 420 + } 430 421 431 - } /* end keyctl_keyring_link() */ 432 - 433 - /*****************************************************************************/ 434 422 /* 435 - * unlink the first attachment of a key from a keyring 436 - * - the keyring must be writable 437 - * - we don't need any permissions on the key 438 - * - implements keyctl(KEYCTL_UNLINK) 423 + * Unlink a key from a keyring. 424 + * 425 + * The keyring must grant the caller Write permission for this to work; the key 426 + * itself need not grant the caller anything. If the last link to a key is 427 + * removed then that key will be scheduled for destruction. 428 + * 429 + * If successful, 0 will be returned. 439 430 */ 440 431 long keyctl_keyring_unlink(key_serial_t id, key_serial_t ringid) 441 432 { ··· 462 451 key_ref_put(keyring_ref); 463 452 error: 464 453 return ret; 454 + } 465 455 466 - } /* end keyctl_keyring_unlink() */ 467 - 468 - /*****************************************************************************/ 469 456 /* 470 - * describe a user key 471 - * - the key must have view permission 472 - * - if there's a buffer, we place up to buflen bytes of data into it 473 - * - unless there's an error, we return the amount of description available, 474 - * irrespective of how much we may have copied 475 - * - the description is formatted thus: 457 + * Return a description of a key to userspace. 458 + * 459 + * The key must grant the caller View permission for this to work. 460 + * 461 + * If there's a buffer, we place up to buflen bytes of data into it formatted 462 + * in the following way: 463 + * 476 464 * type;uid;gid;perm;description<NUL> 477 - * - implements keyctl(KEYCTL_DESCRIBE) 465 + * 466 + * If successful, we return the amount of description available, irrespective 467 + * of how much we may have copied into the buffer. 478 468 */ 479 469 long keyctl_describe_key(key_serial_t keyid, 480 470 char __user *buffer, ··· 543 531 key_ref_put(key_ref); 544 532 error: 545 533 return ret; 534 + } 546 535 547 - } /* end keyctl_describe_key() */ 548 - 549 - /*****************************************************************************/ 550 536 /* 551 - * search the specified keyring for a matching key 552 - * - the start keyring must be searchable 553 - * - nested keyrings may also be searched if they are searchable 554 - * - only keys with search permission may be found 555 - * - if a key is found, it will be attached to the destination keyring if 556 - * there's one specified 557 - * - implements keyctl(KEYCTL_SEARCH) 537 + * Search the specified keyring and any keyrings it links to for a matching 538 + * key. Only keyrings that grant the caller Search permission will be searched 539 + * (this includes the starting keyring). Only keys with Search permission can 540 + * be found. 541 + * 542 + * If successful, the found key will be linked to the destination keyring if 543 + * supplied and the key has Link permission, and the found key ID will be 544 + * returned. 558 545 */ 559 546 long keyctl_keyring_search(key_serial_t ringid, 560 547 const char __user *_type, ··· 637 626 kfree(description); 638 627 error: 639 628 return ret; 629 + } 640 630 641 - } /* end keyctl_keyring_search() */ 642 - 643 - /*****************************************************************************/ 644 631 /* 645 - * read a user key's payload 646 - * - the keyring must be readable or the key must be searchable from the 647 - * process's keyrings 648 - * - if there's a buffer, we place up to buflen bytes of data into it 649 - * - unless there's an error, we return the amount of data in the key, 650 - * irrespective of how much we may have copied 651 - * - implements keyctl(KEYCTL_READ) 632 + * Read a key's payload. 633 + * 634 + * The key must either grant the caller Read permission, or it must grant the 635 + * caller Search permission when searched for from the process keyrings. 636 + * 637 + * If successful, we place up to buflen bytes of data into the buffer, if one 638 + * is provided, and return the amount of data that is available in the key, 639 + * irrespective of how much we copied into the buffer. 652 640 */ 653 641 long keyctl_read_key(key_serial_t keyid, char __user *buffer, size_t buflen) 654 642 { ··· 698 688 key_put(key); 699 689 error: 700 690 return ret; 691 + } 701 692 702 - } /* end keyctl_read_key() */ 703 - 704 - /*****************************************************************************/ 705 693 /* 706 - * change the ownership of a key 707 - * - the keyring owned by the changer 708 - * - if the uid or gid is -1, then that parameter is not changed 709 - * - implements keyctl(KEYCTL_CHOWN) 694 + * Change the ownership of a key 695 + * 696 + * The key must grant the caller Setattr permission for this to work, though 697 + * the key need not be fully instantiated yet. For the UID to be changed, or 698 + * for the GID to be changed to a group the caller is not a member of, the 699 + * caller must have sysadmin capability. If either uid or gid is -1 then that 700 + * attribute is not changed. 701 + * 702 + * If the UID is to be changed, the new user must have sufficient quota to 703 + * accept the key. The quota deduction will be removed from the old user to 704 + * the new user should the attribute be changed. 705 + * 706 + * If successful, 0 will be returned. 710 707 */ 711 708 long keyctl_chown_key(key_serial_t id, uid_t uid, gid_t gid) 712 709 { ··· 813 796 zapowner = newowner; 814 797 ret = -EDQUOT; 815 798 goto error_put; 799 + } 816 800 817 - } /* end keyctl_chown_key() */ 818 - 819 - /*****************************************************************************/ 820 801 /* 821 - * change the permission mask on a key 822 - * - the keyring owned by the changer 823 - * - implements keyctl(KEYCTL_SETPERM) 802 + * Change the permission mask on a key. 803 + * 804 + * The key must grant the caller Setattr permission for this to work, though 805 + * the key need not be fully instantiated yet. If the caller does not have 806 + * sysadmin capability, it may only change the permission on keys that it owns. 824 807 */ 825 808 long keyctl_setperm_key(key_serial_t id, key_perm_t perm) 826 809 { ··· 855 838 key_put(key); 856 839 error: 857 840 return ret; 858 - 859 - } /* end keyctl_setperm_key() */ 841 + } 860 842 861 843 /* 862 - * get the destination keyring for instantiation 844 + * Get the destination keyring for instantiation and check that the caller has 845 + * Write permission on it. 863 846 */ 864 847 static long get_instantiation_keyring(key_serial_t ringid, 865 848 struct request_key_auth *rka, ··· 896 879 } 897 880 898 881 /* 899 - * change the request_key authorisation key on the current process 882 + * Change the request_key authorisation key on the current process. 900 883 */ 901 884 static int keyctl_change_reqkey_auth(struct key *key) 902 885 { ··· 912 895 return commit_creds(new); 913 896 } 914 897 915 - /*****************************************************************************/ 916 898 /* 917 - * instantiate the key with the specified payload, and, if one is given, link 918 - * the key into the keyring 899 + * Instantiate a key with the specified payload and link the key into the 900 + * destination keyring if one is given. 901 + * 902 + * The caller must have the appropriate instantiation permit set for this to 903 + * work (see keyctl_assume_authority). No other permissions are required. 904 + * 905 + * If successful, 0 will be returned. 919 906 */ 920 907 long keyctl_instantiate_key(key_serial_t id, 921 908 const void __user *_payload, ··· 994 973 vfree(payload); 995 974 error: 996 975 return ret; 976 + } 997 977 998 - } /* end keyctl_instantiate_key() */ 999 - 1000 - /*****************************************************************************/ 1001 978 /* 1002 - * negatively instantiate the key with the given timeout (in seconds), and, if 1003 - * one is given, link the key into the keyring 979 + * Negatively instantiate the key with the given timeout (in seconds) and link 980 + * the key into the destination keyring if one is given. 981 + * 982 + * The caller must have the appropriate instantiation permit set for this to 983 + * work (see keyctl_assume_authority). No other permissions are required. 984 + * 985 + * The key and any links to the key will be automatically garbage collected 986 + * after the timeout expires. 987 + * 988 + * Negative keys are used to rate limit repeated request_key() calls by causing 989 + * them to return -ENOKEY until the negative key expires. 990 + * 991 + * If successful, 0 will be returned. 1004 992 */ 1005 993 long keyctl_negate_key(key_serial_t id, unsigned timeout, key_serial_t ringid) 1006 994 { ··· 1050 1020 1051 1021 error: 1052 1022 return ret; 1023 + } 1053 1024 1054 - } /* end keyctl_negate_key() */ 1055 - 1056 - /*****************************************************************************/ 1057 1025 /* 1058 - * set the default keyring in which request_key() will cache keys 1059 - * - return the old setting 1026 + * Read or set the default keyring in which request_key() will cache keys and 1027 + * return the old setting. 1028 + * 1029 + * If a process keyring is specified then this will be created if it doesn't 1030 + * yet exist. The old setting will be returned if successful. 1060 1031 */ 1061 1032 long keyctl_set_reqkey_keyring(int reqkey_defl) 1062 1033 { ··· 1110 1079 error: 1111 1080 abort_creds(new); 1112 1081 return ret; 1082 + } 1113 1083 1114 - } /* end keyctl_set_reqkey_keyring() */ 1115 - 1116 - /*****************************************************************************/ 1117 1084 /* 1118 - * set or clear the timeout for a key 1085 + * Set or clear the timeout on a key. 1086 + * 1087 + * Either the key must grant the caller Setattr permission or else the caller 1088 + * must hold an instantiation authorisation token for the key. 1089 + * 1090 + * The timeout is either 0 to clear the timeout, or a number of seconds from 1091 + * the current time. The key and any links to the key will be automatically 1092 + * garbage collected after the timeout expires. 1093 + * 1094 + * If successful, 0 is returned. 1119 1095 */ 1120 1096 long keyctl_set_timeout(key_serial_t id, unsigned timeout) 1121 1097 { ··· 1174 1136 ret = 0; 1175 1137 error: 1176 1138 return ret; 1139 + } 1177 1140 1178 - } /* end keyctl_set_timeout() */ 1179 - 1180 - /*****************************************************************************/ 1181 1141 /* 1182 - * assume the authority to instantiate the specified key 1142 + * Assume (or clear) the authority to instantiate the specified key. 1143 + * 1144 + * This sets the authoritative token currently in force for key instantiation. 1145 + * This must be done for a key to be instantiated. It has the effect of making 1146 + * available all the keys from the caller of the request_key() that created a 1147 + * key to request_key() calls made by the caller of this function. 1148 + * 1149 + * The caller must have the instantiation key in their process keyrings with a 1150 + * Search permission grant available to the caller. 1151 + * 1152 + * If the ID given is 0, then the setting will be cleared and 0 returned. 1153 + * 1154 + * If the ID given has a matching an authorisation key, then that key will be 1155 + * set and its ID will be returned. The authorisation key can be read to get 1156 + * the callout information passed to request_key(). 1183 1157 */ 1184 1158 long keyctl_assume_authority(key_serial_t id) 1185 1159 { ··· 1228 1178 ret = authkey->serial; 1229 1179 error: 1230 1180 return ret; 1231 - 1232 - } /* end keyctl_assume_authority() */ 1181 + } 1233 1182 1234 1183 /* 1235 - * get the security label of a key 1236 - * - the key must grant us view permission 1237 - * - if there's a buffer, we place up to buflen bytes of data into it 1238 - * - unless there's an error, we return the amount of information available, 1239 - * irrespective of how much we may have copied (including the terminal NUL) 1240 - * - implements keyctl(KEYCTL_GET_SECURITY) 1184 + * Get a key's the LSM security label. 1185 + * 1186 + * The key must grant the caller View permission for this to work. 1187 + * 1188 + * If there's a buffer, then up to buflen bytes of data will be placed into it. 1189 + * 1190 + * If successful, the amount of information available will be returned, 1191 + * irrespective of how much was copied (including the terminal NUL). 1241 1192 */ 1242 1193 long keyctl_get_security(key_serial_t keyid, 1243 1194 char __user *buffer, ··· 1293 1242 } 1294 1243 1295 1244 /* 1296 - * attempt to install the calling process's session keyring on the process's 1297 - * parent process 1298 - * - the keyring must exist and must grant us LINK permission 1299 - * - implements keyctl(KEYCTL_SESSION_TO_PARENT) 1245 + * Attempt to install the calling process's session keyring on the process's 1246 + * parent process. 1247 + * 1248 + * The keyring must exist and must grant the caller LINK permission, and the 1249 + * parent process must be single-threaded and must have the same effective 1250 + * ownership as this process and mustn't be SUID/SGID. 1251 + * 1252 + * The keyring will be emplaced on the parent when it next resumes userspace. 1253 + * 1254 + * If successful, 0 will be returned. 1300 1255 */ 1301 1256 long keyctl_session_to_parent(void) 1302 1257 { ··· 1405 1348 #endif /* !TIF_NOTIFY_RESUME */ 1406 1349 } 1407 1350 1408 - /*****************************************************************************/ 1409 1351 /* 1410 - * the key control system call 1352 + * The key control system call 1411 1353 */ 1412 1354 SYSCALL_DEFINE5(keyctl, int, option, unsigned long, arg2, unsigned long, arg3, 1413 1355 unsigned long, arg4, unsigned long, arg5) ··· 1495 1439 default: 1496 1440 return -EOPNOTSUPP; 1497 1441 } 1498 - 1499 - } /* end sys_keyctl() */ 1442 + }
+175 -120
security/keys/keyring.c
··· 26 26 rwsem_is_locked((struct rw_semaphore *)&(keyring)->sem))) 27 27 28 28 /* 29 - * when plumbing the depths of the key tree, this sets a hard limit set on how 30 - * deep we're willing to go 29 + * When plumbing the depths of the key tree, this sets a hard limit 30 + * set on how deep we're willing to go. 31 31 */ 32 32 #define KEYRING_SEARCH_MAX_DEPTH 6 33 33 34 34 /* 35 - * we keep all named keyrings in a hash to speed looking them up 35 + * We keep all named keyrings in a hash to speed looking them up. 36 36 */ 37 37 #define KEYRING_NAME_HASH_SIZE (1 << 5) 38 38 ··· 50 50 } 51 51 52 52 /* 53 - * the keyring type definition 53 + * The keyring key type definition. Keyrings are simply keys of this type and 54 + * can be treated as ordinary keys in addition to having their own special 55 + * operations. 54 56 */ 55 57 static int keyring_instantiate(struct key *keyring, 56 58 const void *data, size_t datalen); ··· 73 71 .describe = keyring_describe, 74 72 .read = keyring_read, 75 73 }; 76 - 77 74 EXPORT_SYMBOL(key_type_keyring); 78 75 79 76 /* 80 - * semaphore to serialise link/link calls to prevent two link calls in parallel 81 - * introducing a cycle 77 + * Semaphore to serialise link/link calls to prevent two link calls in parallel 78 + * introducing a cycle. 82 79 */ 83 80 static DECLARE_RWSEM(keyring_serialise_link_sem); 84 81 85 - /*****************************************************************************/ 86 82 /* 87 - * publish the name of a keyring so that it can be found by name (if it has 88 - * one) 83 + * Publish the name of a keyring so that it can be found by name (if it has 84 + * one). 89 85 */ 90 86 static void keyring_publish_name(struct key *keyring) 91 87 { ··· 102 102 103 103 write_unlock(&keyring_name_lock); 104 104 } 105 + } 105 106 106 - } /* end keyring_publish_name() */ 107 - 108 - /*****************************************************************************/ 109 107 /* 110 - * initialise a keyring 111 - * - we object if we were given any data 108 + * Initialise a keyring. 109 + * 110 + * Returns 0 on success, -EINVAL if given any data. 112 111 */ 113 112 static int keyring_instantiate(struct key *keyring, 114 113 const void *data, size_t datalen) ··· 122 123 } 123 124 124 125 return ret; 126 + } 125 127 126 - } /* end keyring_instantiate() */ 127 - 128 - /*****************************************************************************/ 129 128 /* 130 - * match keyrings on their name 129 + * Match keyrings on their name 131 130 */ 132 131 static int keyring_match(const struct key *keyring, const void *description) 133 132 { 134 133 return keyring->description && 135 134 strcmp(keyring->description, description) == 0; 135 + } 136 136 137 - } /* end keyring_match() */ 138 - 139 - /*****************************************************************************/ 140 137 /* 141 - * dispose of the data dangling from the corpse of a keyring 138 + * Clean up a keyring when it is destroyed. Unpublish its name if it had one 139 + * and dispose of its data. 142 140 */ 143 141 static void keyring_destroy(struct key *keyring) 144 142 { ··· 160 164 key_put(klist->keys[loop]); 161 165 kfree(klist); 162 166 } 167 + } 163 168 164 - } /* end keyring_destroy() */ 165 - 166 - /*****************************************************************************/ 167 169 /* 168 - * describe the keyring 170 + * Describe a keyring for /proc. 169 171 */ 170 172 static void keyring_describe(const struct key *keyring, struct seq_file *m) 171 173 { ··· 181 187 else 182 188 seq_puts(m, ": empty"); 183 189 rcu_read_unlock(); 190 + } 184 191 185 - } /* end keyring_describe() */ 186 - 187 - /*****************************************************************************/ 188 192 /* 189 - * read a list of key IDs from the keyring's contents 190 - * - the keyring's semaphore is read-locked 193 + * Read a list of key IDs from the keyring's contents in binary form 194 + * 195 + * The keyring's semaphore is read-locked by the caller. 191 196 */ 192 197 static long keyring_read(const struct key *keyring, 193 198 char __user *buffer, size_t buflen) ··· 234 241 235 242 error: 236 243 return ret; 244 + } 237 245 238 - } /* end keyring_read() */ 239 - 240 - /*****************************************************************************/ 241 246 /* 242 - * allocate a keyring and link into the destination keyring 247 + * Allocate a keyring and link into the destination keyring. 243 248 */ 244 249 struct key *keyring_alloc(const char *description, uid_t uid, gid_t gid, 245 250 const struct cred *cred, unsigned long flags, ··· 260 269 } 261 270 262 271 return keyring; 272 + } 263 273 264 - } /* end keyring_alloc() */ 265 - 266 - /*****************************************************************************/ 267 - /* 268 - * search the supplied keyring tree for a key that matches the criterion 269 - * - perform a breadth-then-depth search up to the prescribed limit 270 - * - we only find keys on which we have search permission 271 - * - we use the supplied match function to see if the description (or other 272 - * feature of interest) matches 273 - * - we rely on RCU to prevent the keyring lists from disappearing on us 274 - * - we return -EAGAIN if we didn't find any matching key 275 - * - we return -ENOKEY if we only found negative matching keys 276 - * - we propagate the possession attribute from the keyring ref to the key ref 274 + /** 275 + * keyring_search_aux - Search a keyring tree for a key matching some criteria 276 + * @keyring_ref: A pointer to the keyring with possession indicator. 277 + * @cred: The credentials to use for permissions checks. 278 + * @type: The type of key to search for. 279 + * @description: Parameter for @match. 280 + * @match: Function to rule on whether or not a key is the one required. 281 + * 282 + * Search the supplied keyring tree for a key that matches the criteria given. 283 + * The root keyring and any linked keyrings must grant Search permission to the 284 + * caller to be searchable and keys can only be found if they too grant Search 285 + * to the caller. The possession flag on the root keyring pointer controls use 286 + * of the possessor bits in permissions checking of the entire tree. In 287 + * addition, the LSM gets to forbid keyring searches and key matches. 288 + * 289 + * The search is performed as a breadth-then-depth search up to the prescribed 290 + * limit (KEYRING_SEARCH_MAX_DEPTH). 291 + * 292 + * Keys are matched to the type provided and are then filtered by the match 293 + * function, which is given the description to use in any way it sees fit. The 294 + * match function may use any attributes of a key that it wishes to to 295 + * determine the match. Normally the match function from the key type would be 296 + * used. 297 + * 298 + * RCU is used to prevent the keyring key lists from disappearing without the 299 + * need to take lots of locks. 300 + * 301 + * Returns a pointer to the found key and increments the key usage count if 302 + * successful; -EAGAIN if no matching keys were found, or if expired or revoked 303 + * keys were found; -ENOKEY if only negative keys were found; -ENOTDIR if the 304 + * specified keyring wasn't a keyring. 305 + * 306 + * In the case of a successful return, the possession attribute from 307 + * @keyring_ref is propagated to the returned key reference. 277 308 */ 278 309 key_ref_t keyring_search_aux(key_ref_t keyring_ref, 279 310 const struct cred *cred, ··· 457 444 rcu_read_unlock(); 458 445 error: 459 446 return key_ref; 447 + } 460 448 461 - } /* end keyring_search_aux() */ 462 - 463 - /*****************************************************************************/ 464 - /* 465 - * search the supplied keyring tree for a key that matches the criterion 466 - * - perform a breadth-then-depth search up to the prescribed limit 467 - * - we only find keys on which we have search permission 468 - * - we readlock the keyrings as we search down the tree 469 - * - we return -EAGAIN if we didn't find any matching key 470 - * - we return -ENOKEY if we only found negative matching keys 449 + /** 450 + * keyring_search - Search the supplied keyring tree for a matching key 451 + * @keyring: The root of the keyring tree to be searched. 452 + * @type: The type of keyring we want to find. 453 + * @description: The name of the keyring we want to find. 454 + * 455 + * As keyring_search_aux() above, but using the current task's credentials and 456 + * type's default matching function. 471 457 */ 472 458 key_ref_t keyring_search(key_ref_t keyring, 473 459 struct key_type *type, ··· 477 465 478 466 return keyring_search_aux(keyring, current->cred, 479 467 type, description, type->match); 480 - 481 - } /* end keyring_search() */ 482 - 468 + } 483 469 EXPORT_SYMBOL(keyring_search); 484 470 485 - /*****************************************************************************/ 486 471 /* 487 - * search the given keyring only (no recursion) 488 - * - keyring must be locked by caller 489 - * - caller must guarantee that the keyring is a keyring 472 + * Search the given keyring only (no recursion). 473 + * 474 + * The caller must guarantee that the keyring is a keyring and that the 475 + * permission is granted to search the keyring as no check is made here. 476 + * 477 + * RCU is used to make it unnecessary to lock the keyring key list here. 478 + * 479 + * Returns a pointer to the found key with usage count incremented if 480 + * successful and returns -ENOKEY if not found. Revoked keys and keys not 481 + * providing the requested permission are skipped over. 482 + * 483 + * If successful, the possession indicator is propagated from the keyring ref 484 + * to the returned key reference. 490 485 */ 491 486 key_ref_t __keyring_search_one(key_ref_t keyring_ref, 492 487 const struct key_type *ktype, ··· 533 514 atomic_inc(&key->usage); 534 515 rcu_read_unlock(); 535 516 return make_key_ref(key, possessed); 517 + } 536 518 537 - } /* end __keyring_search_one() */ 538 - 539 - /*****************************************************************************/ 540 519 /* 541 - * find a keyring with the specified name 542 - * - all named keyrings are searched 543 - * - normally only finds keyrings with search permission for the current process 520 + * Find a keyring with the specified name. 521 + * 522 + * All named keyrings in the current user namespace are searched, provided they 523 + * grant Search permission directly to the caller (unless this check is 524 + * skipped). Keyrings whose usage points have reached zero or who have been 525 + * revoked are skipped. 526 + * 527 + * Returns a pointer to the keyring with the keyring's refcount having being 528 + * incremented on success. -ENOKEY is returned if a key could not be found. 544 529 */ 545 530 struct key *find_keyring_by_name(const char *name, bool skip_perm_check) 546 531 { ··· 592 569 out: 593 570 read_unlock(&keyring_name_lock); 594 571 return keyring; 572 + } 595 573 596 - } /* end find_keyring_by_name() */ 597 - 598 - /*****************************************************************************/ 599 574 /* 600 - * see if a cycle will will be created by inserting acyclic tree B in acyclic 601 - * tree A at the topmost level (ie: as a direct child of A) 602 - * - since we are adding B to A at the top level, checking for cycles should 603 - * just be a matter of seeing if node A is somewhere in tree B 575 + * See if a cycle will will be created by inserting acyclic tree B in acyclic 576 + * tree A at the topmost level (ie: as a direct child of A). 577 + * 578 + * Since we are adding B to A at the top level, checking for cycles should just 579 + * be a matter of seeing if node A is somewhere in tree B. 604 580 */ 605 581 static int keyring_detect_cycle(struct key *A, struct key *B) 606 582 { ··· 679 657 cycle_detected: 680 658 ret = -EDEADLK; 681 659 goto error; 682 - 683 - } /* end keyring_detect_cycle() */ 660 + } 684 661 685 662 /* 686 - * dispose of a keyring list after the RCU grace period, freeing the unlinked 663 + * Dispose of a keyring list after the RCU grace period, freeing the unlinked 687 664 * key 688 665 */ 689 666 static void keyring_unlink_rcu_disposal(struct rcu_head *rcu) ··· 696 675 } 697 676 698 677 /* 699 - * preallocate memory so that a key can be linked into to a keyring 678 + * Preallocate memory so that a key can be linked into to a keyring. 700 679 */ 701 680 int __key_link_begin(struct key *keyring, const struct key_type *type, 702 681 const char *description, ··· 813 792 } 814 793 815 794 /* 816 - * check already instantiated keys aren't going to be a problem 817 - * - the caller must have called __key_link_begin() 818 - * - don't need to call this for keys that were created since __key_link_begin() 819 - * was called 795 + * Check already instantiated keys aren't going to be a problem. 796 + * 797 + * The caller must have called __key_link_begin(). Don't need to call this for 798 + * keys that were created since __key_link_begin() was called. 820 799 */ 821 800 int __key_link_check_live_key(struct key *keyring, struct key *key) 822 801 { ··· 828 807 } 829 808 830 809 /* 831 - * link a key into to a keyring 832 - * - must be called with __key_link_begin() having being called 833 - * - discard already extant link to matching key if there is one 810 + * Link a key into to a keyring. 811 + * 812 + * Must be called with __key_link_begin() having being called. Discards any 813 + * already extant link to matching key if there is one, so that each keyring 814 + * holds at most one link to any given key of a particular type+description 815 + * combination. 834 816 */ 835 817 void __key_link(struct key *keyring, struct key *key, 836 818 struct keyring_list **_prealloc) ··· 876 852 } 877 853 878 854 /* 879 - * finish linking a key into to a keyring 880 - * - must be called with __key_link_begin() having being called 855 + * Finish linking a key into to a keyring. 856 + * 857 + * Must be called with __key_link_begin() having being called. 881 858 */ 882 859 void __key_link_end(struct key *keyring, struct key_type *type, 883 860 struct keyring_list *prealloc) ··· 899 874 up_write(&keyring->sem); 900 875 } 901 876 902 - /* 903 - * link a key to a keyring 877 + /** 878 + * key_link - Link a key to a keyring 879 + * @keyring: The keyring to make the link in. 880 + * @key: The key to link to. 881 + * 882 + * Make a link in a keyring to a key, such that the keyring holds a reference 883 + * on that key and the key can potentially be found by searching that keyring. 884 + * 885 + * This function will write-lock the keyring's semaphore and will consume some 886 + * of the user's key data quota to hold the link. 887 + * 888 + * Returns 0 if successful, -ENOTDIR if the keyring isn't a keyring, 889 + * -EKEYREVOKED if the keyring has been revoked, -ENFILE if the keyring is 890 + * full, -EDQUOT if there is insufficient key data quota remaining to add 891 + * another link or -ENOMEM if there's insufficient memory. 892 + * 893 + * It is assumed that the caller has checked that it is permitted for a link to 894 + * be made (the keyring should have Write permission and the key Link 895 + * permission). 904 896 */ 905 897 int key_link(struct key *keyring, struct key *key) 906 898 { ··· 937 895 938 896 return ret; 939 897 } 940 - 941 898 EXPORT_SYMBOL(key_link); 942 899 943 - /*****************************************************************************/ 944 - /* 945 - * unlink the first link to a key from a keyring 900 + /** 901 + * key_unlink - Unlink the first link to a key from a keyring. 902 + * @keyring: The keyring to remove the link from. 903 + * @key: The key the link is to. 904 + * 905 + * Remove a link from a keyring to a key. 906 + * 907 + * This function will write-lock the keyring's semaphore. 908 + * 909 + * Returns 0 if successful, -ENOTDIR if the keyring isn't a keyring, -ENOENT if 910 + * the key isn't linked to by the keyring or -ENOMEM if there's insufficient 911 + * memory. 912 + * 913 + * It is assumed that the caller has checked that it is permitted for a link to 914 + * be removed (the keyring should have Write permission; no permissions are 915 + * required on the key). 946 916 */ 947 917 int key_unlink(struct key *keyring, struct key *key) 948 918 { ··· 1022 968 ret = -ENOMEM; 1023 969 up_write(&keyring->sem); 1024 970 goto error; 1025 - 1026 - } /* end key_unlink() */ 1027 - 971 + } 1028 972 EXPORT_SYMBOL(key_unlink); 1029 973 1030 - /*****************************************************************************/ 1031 974 /* 1032 - * dispose of a keyring list after the RCU grace period, releasing the keys it 1033 - * links to 975 + * Dispose of a keyring list after the RCU grace period, releasing the keys it 976 + * links to. 1034 977 */ 1035 978 static void keyring_clear_rcu_disposal(struct rcu_head *rcu) 1036 979 { ··· 1040 989 key_put(klist->keys[loop]); 1041 990 1042 991 kfree(klist); 992 + } 1043 993 1044 - } /* end keyring_clear_rcu_disposal() */ 1045 - 1046 - /*****************************************************************************/ 1047 - /* 1048 - * clear the specified process keyring 1049 - * - implements keyctl(KEYCTL_CLEAR) 994 + /** 995 + * keyring_clear - Clear a keyring 996 + * @keyring: The keyring to clear. 997 + * 998 + * Clear the contents of the specified keyring. 999 + * 1000 + * Returns 0 if successful or -ENOTDIR if the keyring isn't a keyring. 1050 1001 */ 1051 1002 int keyring_clear(struct key *keyring) 1052 1003 { ··· 1080 1027 } 1081 1028 1082 1029 return ret; 1083 - 1084 - } /* end keyring_clear() */ 1085 - 1030 + } 1086 1031 EXPORT_SYMBOL(keyring_clear); 1087 1032 1088 - /*****************************************************************************/ 1089 1033 /* 1090 - * dispose of the links from a revoked keyring 1091 - * - called with the key sem write-locked 1034 + * Dispose of the links from a revoked keyring. 1035 + * 1036 + * This is called with the key sem write-locked. 1092 1037 */ 1093 1038 static void keyring_revoke(struct key *keyring) 1094 1039 { ··· 1101 1050 rcu_assign_pointer(keyring->payload.subscriptions, NULL); 1102 1051 call_rcu(&klist->rcu, keyring_clear_rcu_disposal); 1103 1052 } 1104 - 1105 - } /* end keyring_revoke() */ 1053 + } 1106 1054 1107 1055 /* 1108 - * Determine whether a key is dead 1056 + * Determine whether a key is dead. 1109 1057 */ 1110 1058 static bool key_is_dead(struct key *key, time_t limit) 1111 1059 { ··· 1113 1063 } 1114 1064 1115 1065 /* 1116 - * Collect garbage from the contents of a keyring 1066 + * Collect garbage from the contents of a keyring, replacing the old list with 1067 + * a new one with the pointers all shuffled down. 1068 + * 1069 + * Dead keys are classed as oned that are flagged as being dead or are revoked, 1070 + * expired or negative keys that were revoked or expired before the specified 1071 + * limit. 1117 1072 */ 1118 1073 void keyring_gc(struct key *keyring, time_t limit) 1119 1074 {
+17 -16
security/keys/permission.c
··· 1 - /* permission.c: key permission determination 1 + /* Key permission checking 2 2 * 3 3 * Copyright (C) 2005 Red Hat, Inc. All Rights Reserved. 4 4 * Written by David Howells (dhowells@redhat.com) ··· 13 13 #include <linux/security.h> 14 14 #include "internal.h" 15 15 16 - /*****************************************************************************/ 17 16 /** 18 17 * key_task_permission - Check a key can be used 19 - * @key_ref: The key to check 20 - * @cred: The credentials to use 21 - * @perm: The permissions to check for 18 + * @key_ref: The key to check. 19 + * @cred: The credentials to use. 20 + * @perm: The permissions to check for. 22 21 * 23 22 * Check to see whether permission is granted to use a key in the desired way, 24 23 * but permit the security modules to override. 25 24 * 26 - * The caller must hold either a ref on cred or must hold the RCU readlock or a 27 - * spinlock. 25 + * The caller must hold either a ref on cred or must hold the RCU readlock. 26 + * 27 + * Returns 0 if successful, -EACCES if access is denied based on the 28 + * permissions bits or the LSM check. 28 29 */ 29 30 int key_task_permission(const key_ref_t key_ref, const struct cred *cred, 30 31 key_perm_t perm) ··· 80 79 81 80 /* let LSM be the final arbiter */ 82 81 return security_key_permission(key_ref, cred, perm); 83 - 84 - } /* end key_task_permission() */ 85 - 82 + } 86 83 EXPORT_SYMBOL(key_task_permission); 87 84 88 - /*****************************************************************************/ 89 - /* 90 - * validate a key 85 + /** 86 + * key_validate - Validate a key. 87 + * @key: The key to be validated. 88 + * 89 + * Check that a key is valid, returning 0 if the key is okay, -EKEYREVOKED if 90 + * the key's type has been removed or if the key has been revoked or 91 + * -EKEYEXPIRED if the key has expired. 91 92 */ 92 93 int key_validate(struct key *key) 93 94 { ··· 114 111 115 112 error: 116 113 return ret; 117 - 118 - } /* end key_validate() */ 119 - 114 + } 120 115 EXPORT_SYMBOL(key_validate);
+7 -10
security/keys/proc.c
··· 1 - /* proc.c: proc files for key database enumeration 1 + /* procfs files for key database enumeration 2 2 * 3 3 * Copyright (C) 2004 Red Hat, Inc. All Rights Reserved. 4 4 * Written by David Howells (dhowells@redhat.com) ··· 60 60 .release = seq_release, 61 61 }; 62 62 63 - /*****************************************************************************/ 64 63 /* 65 - * declare the /proc files 64 + * Declare the /proc files. 66 65 */ 67 66 static int __init key_proc_init(void) 68 67 { ··· 78 79 panic("Cannot create /proc/key-users\n"); 79 80 80 81 return 0; 81 - 82 - } /* end key_proc_init() */ 82 + } 83 83 84 84 __initcall(key_proc_init); 85 85 86 - /*****************************************************************************/ 87 86 /* 88 - * implement "/proc/keys" to provides a list of the keys on the system 87 + * Implement "/proc/keys" to provide a list of the keys on the system that 88 + * grant View permission to the caller. 89 89 */ 90 90 #ifdef CONFIG_KEYS_DEBUG_PROC_KEYS 91 91 ··· 291 293 return __key_user_next(n); 292 294 } 293 295 294 - /*****************************************************************************/ 295 296 /* 296 - * implement "/proc/key-users" to provides a list of the key users 297 + * Implement "/proc/key-users" to provides a list of the key users and their 298 + * quotas. 297 299 */ 298 300 static int proc_key_users_open(struct inode *inode, struct file *file) 299 301 { ··· 349 351 maxbytes); 350 352 351 353 return 0; 352 - 353 354 }
+80 -55
security/keys/process_keys.c
··· 1 - /* Management of a process's keyrings 1 + /* Manage a process's keyrings 2 2 * 3 3 * Copyright (C) 2004-2005, 2008 Red Hat, Inc. All Rights Reserved. 4 4 * Written by David Howells (dhowells@redhat.com) ··· 21 21 #include <asm/uaccess.h> 22 22 #include "internal.h" 23 23 24 - /* session keyring create vs join semaphore */ 24 + /* Session keyring create vs join semaphore */ 25 25 static DEFINE_MUTEX(key_session_mutex); 26 26 27 - /* user keyring creation semaphore */ 27 + /* User keyring creation semaphore */ 28 28 static DEFINE_MUTEX(key_user_keyring_mutex); 29 29 30 - /* the root user's tracking struct */ 30 + /* The root user's tracking struct */ 31 31 struct key_user root_key_user = { 32 32 .usage = ATOMIC_INIT(3), 33 33 .cons_lock = __MUTEX_INITIALIZER(root_key_user.cons_lock), ··· 38 38 .user_ns = &init_user_ns, 39 39 }; 40 40 41 - /*****************************************************************************/ 42 41 /* 43 - * install user and user session keyrings for a particular UID 42 + * Install the user and user session keyrings for the current process's UID. 44 43 */ 45 44 int install_user_keyrings(void) 46 45 { ··· 121 122 } 122 123 123 124 /* 124 - * install a fresh thread keyring directly to new credentials 125 + * Install a fresh thread keyring directly to new credentials. This keyring is 126 + * allowed to overrun the quota. 125 127 */ 126 128 int install_thread_keyring_to_cred(struct cred *new) 127 129 { ··· 138 138 } 139 139 140 140 /* 141 - * install a fresh thread keyring, discarding the old one 141 + * Install a fresh thread keyring, discarding the old one. 142 142 */ 143 143 static int install_thread_keyring(void) 144 144 { ··· 161 161 } 162 162 163 163 /* 164 - * install a process keyring directly to a credentials struct 165 - * - returns -EEXIST if there was already a process keyring, 0 if one installed, 166 - * and other -ve on any other error 164 + * Install a process keyring directly to a credentials struct. 165 + * 166 + * Returns -EEXIST if there was already a process keyring, 0 if one installed, 167 + * and other value on any other error 167 168 */ 168 169 int install_process_keyring_to_cred(struct cred *new) 169 170 { ··· 193 192 } 194 193 195 194 /* 196 - * make sure a process keyring is installed 197 - * - we 195 + * Make sure a process keyring is installed for the current process. The 196 + * existing process keyring is not replaced. 197 + * 198 + * Returns 0 if there is a process keyring by the end of this function, some 199 + * error otherwise. 198 200 */ 199 201 static int install_process_keyring(void) 200 202 { ··· 218 214 } 219 215 220 216 /* 221 - * install a session keyring directly to a credentials struct 217 + * Install a session keyring directly to a credentials struct. 222 218 */ 223 219 int install_session_keyring_to_cred(struct cred *cred, struct key *keyring) 224 220 { ··· 258 254 } 259 255 260 256 /* 261 - * install a session keyring, discarding the old one 262 - * - if a keyring is not supplied, an empty one is invented 257 + * Install a session keyring, discarding the old one. If a keyring is not 258 + * supplied, an empty one is invented. 263 259 */ 264 260 static int install_session_keyring(struct key *keyring) 265 261 { ··· 279 275 return commit_creds(new); 280 276 } 281 277 282 - /*****************************************************************************/ 283 278 /* 284 - * the filesystem user ID changed 279 + * Handle the fsuid changing. 285 280 */ 286 281 void key_fsuid_changed(struct task_struct *tsk) 287 282 { ··· 291 288 tsk->cred->thread_keyring->uid = tsk->cred->fsuid; 292 289 up_write(&tsk->cred->thread_keyring->sem); 293 290 } 291 + } 294 292 295 - } /* end key_fsuid_changed() */ 296 - 297 - /*****************************************************************************/ 298 293 /* 299 - * the filesystem group ID changed 294 + * Handle the fsgid changing. 300 295 */ 301 296 void key_fsgid_changed(struct task_struct *tsk) 302 297 { ··· 305 304 tsk->cred->thread_keyring->gid = tsk->cred->fsgid; 306 305 up_write(&tsk->cred->thread_keyring->sem); 307 306 } 307 + } 308 308 309 - } /* end key_fsgid_changed() */ 310 - 311 - /*****************************************************************************/ 312 309 /* 313 - * search only my process keyrings for the first matching key 314 - * - we use the supplied match function to see if the description (or other 315 - * feature of interest) matches 316 - * - we return -EAGAIN if we didn't find any matching key 317 - * - we return -ENOKEY if we found only negative matching keys 310 + * Search the process keyrings attached to the supplied cred for the first 311 + * matching key. 312 + * 313 + * The search criteria are the type and the match function. The description is 314 + * given to the match function as a parameter, but doesn't otherwise influence 315 + * the search. Typically the match function will compare the description 316 + * parameter to the key's description. 317 + * 318 + * This can only search keyrings that grant Search permission to the supplied 319 + * credentials. Keyrings linked to searched keyrings will also be searched if 320 + * they grant Search permission too. Keys can only be found if they grant 321 + * Search permission to the credentials. 322 + * 323 + * Returns a pointer to the key with the key usage count incremented if 324 + * successful, -EAGAIN if we didn't find any matching key or -ENOKEY if we only 325 + * matched negative keys. 326 + * 327 + * In the case of a successful return, the possession attribute is set on the 328 + * returned key reference. 318 329 */ 319 330 key_ref_t search_my_process_keyrings(struct key_type *type, 320 331 const void *description, ··· 441 428 return key_ref; 442 429 } 443 430 444 - /*****************************************************************************/ 445 431 /* 446 - * search the process keyrings for the first matching key 447 - * - we use the supplied match function to see if the description (or other 448 - * feature of interest) matches 449 - * - we return -EAGAIN if we didn't find any matching key 450 - * - we return -ENOKEY if we found only negative matching keys 432 + * Search the process keyrings attached to the supplied cred for the first 433 + * matching key in the manner of search_my_process_keyrings(), but also search 434 + * the keys attached to the assumed authorisation key using its credentials if 435 + * one is available. 436 + * 437 + * Return same as search_my_process_keyrings(). 451 438 */ 452 439 key_ref_t search_process_keyrings(struct key_type *type, 453 440 const void *description, ··· 502 489 503 490 found: 504 491 return key_ref; 492 + } 505 493 506 - } /* end search_process_keyrings() */ 507 - 508 - /*****************************************************************************/ 509 494 /* 510 - * see if the key we're looking at is the target key 495 + * See if the key we're looking at is the target key. 511 496 */ 512 497 int lookup_user_key_possessed(const struct key *key, const void *target) 513 498 { 514 499 return key == target; 500 + } 515 501 516 - } /* end lookup_user_key_possessed() */ 517 - 518 - /*****************************************************************************/ 519 502 /* 520 - * lookup a key given a key ID from userspace with a given permissions mask 521 - * - don't create special keyrings unless so requested 522 - * - partially constructed keys aren't found unless requested 503 + * Look up a key ID given us by userspace with a given permissions mask to get 504 + * the key it refers to. 505 + * 506 + * Flags can be passed to request that special keyrings be created if referred 507 + * to directly, to permit partially constructed keys to be found and to skip 508 + * validity and permission checks on the found key. 509 + * 510 + * Returns a pointer to the key with an incremented usage count if successful; 511 + * -EINVAL if the key ID is invalid; -ENOKEY if the key ID does not correspond 512 + * to a key or the best found key was a negative key; -EKEYREVOKED or 513 + * -EKEYEXPIRED if the best found key was revoked or expired; -EACCES if the 514 + * found key doesn't grant the requested permit or the LSM denied access to it; 515 + * or -ENOMEM if a special keyring couldn't be created. 516 + * 517 + * In the case of a successful return, the possession attribute is set on the 518 + * returned key reference. 523 519 */ 524 520 key_ref_t lookup_user_key(key_serial_t id, unsigned long lflags, 525 521 key_perm_t perm) ··· 733 711 reget_creds: 734 712 put_cred(cred); 735 713 goto try_again; 714 + } 736 715 737 - } /* end lookup_user_key() */ 738 - 739 - /*****************************************************************************/ 740 716 /* 741 - * join the named keyring as the session keyring if possible, or attempt to 742 - * create a new one of that name if not 743 - * - if the name is NULL, an empty anonymous keyring is installed instead 744 - * - named session keyring joining is done with a semaphore held 717 + * Join the named keyring as the session keyring if possible else attempt to 718 + * create a new one of that name and join that. 719 + * 720 + * If the name is NULL, an empty anonymous keyring will be installed as the 721 + * session keyring. 722 + * 723 + * Named session keyrings are joined with a semaphore held to prevent the 724 + * keyrings from going away whilst the attempt is made to going them and also 725 + * to prevent a race in creating compatible session keyrings. 745 726 */ 746 727 long join_session_keyring(const char *name) 747 728 { ··· 816 791 } 817 792 818 793 /* 819 - * Replace a process's session keyring when that process resumes userspace on 820 - * behalf of one of its children 794 + * Replace a process's session keyring on behalf of one of its children when 795 + * the target process is about to resume userspace execution. 821 796 */ 822 797 void key_replace_session_keyring(void) 823 798 {
+121 -43
security/keys/request_key.c
··· 39 39 return signal_pending(current) ? -ERESTARTSYS : 0; 40 40 } 41 41 42 - /* 43 - * call to complete the construction of a key 42 + /** 43 + * complete_request_key - Complete the construction of a key. 44 + * @cons: The key construction record. 45 + * @error: The success or failute of the construction. 46 + * 47 + * Complete the attempt to construct a key. The key will be negated 48 + * if an error is indicated. The authorisation key will be revoked 49 + * unconditionally. 44 50 */ 45 51 void complete_request_key(struct key_construction *cons, int error) 46 52 { ··· 64 58 } 65 59 EXPORT_SYMBOL(complete_request_key); 66 60 61 + /* 62 + * Initialise a usermode helper that is going to have a specific session 63 + * keyring. 64 + * 65 + * This is called in context of freshly forked kthread before kernel_execve(), 66 + * so we can simply install the desired session_keyring at this point. 67 + */ 67 68 static int umh_keys_init(struct subprocess_info *info) 68 69 { 69 70 struct cred *cred = (struct cred*)current_cred(); 70 71 struct key *keyring = info->data; 71 - /* 72 - * This is called in context of freshly forked kthread before 73 - * kernel_execve(), we can just change our ->session_keyring. 74 - */ 72 + 75 73 return install_session_keyring_to_cred(cred, keyring); 76 74 } 77 75 76 + /* 77 + * Clean up a usermode helper with session keyring. 78 + */ 78 79 static void umh_keys_cleanup(struct subprocess_info *info) 79 80 { 80 81 struct key *keyring = info->data; 81 82 key_put(keyring); 82 83 } 83 84 85 + /* 86 + * Call a usermode helper with a specific session keyring. 87 + */ 84 88 static int call_usermodehelper_keys(char *path, char **argv, char **envp, 85 89 struct key *session_keyring, enum umh_wait wait) 86 90 { ··· 107 91 } 108 92 109 93 /* 110 - * request userspace finish the construction of a key 94 + * Request userspace finish the construction of a key 111 95 * - execute "/sbin/request-key <op> <key> <uid> <gid> <keyring> <keyring> <keyring>" 112 96 */ 113 97 static int call_sbin_request_key(struct key_construction *cons, ··· 214 198 } 215 199 216 200 /* 217 - * call out to userspace for key construction 218 - * - we ignore program failure and go on key status instead 201 + * Call out to userspace for key construction. 202 + * 203 + * Program failure is ignored in favour of key status. 219 204 */ 220 205 static int construct_key(struct key *key, const void *callout_info, 221 206 size_t callout_len, void *aux, ··· 263 246 } 264 247 265 248 /* 266 - * get the appropriate destination keyring for the request 267 - * - we return whatever keyring we select with an extra reference upon it which 268 - * the caller must release 249 + * Get the appropriate destination keyring for the request. 250 + * 251 + * The keyring selected is returned with an extra reference upon it which the 252 + * caller must release. 269 253 */ 270 254 static void construct_get_dest_keyring(struct key **_dest_keyring) 271 255 { ··· 339 321 } 340 322 341 323 /* 342 - * allocate a new key in under-construction state and attempt to link it in to 343 - * the requested place 344 - * - may return a key that's already under construction instead 324 + * Allocate a new key in under-construction state and attempt to link it in to 325 + * the requested keyring. 326 + * 327 + * May return a key that's already under construction instead if there was a 328 + * race between two thread calling request_key(). 345 329 */ 346 330 static int construct_alloc_key(struct key_type *type, 347 331 const char *description, ··· 434 414 } 435 415 436 416 /* 437 - * commence key construction 417 + * Commence key construction. 438 418 */ 439 419 static struct key *construct_key_and_link(struct key_type *type, 440 420 const char *description, ··· 485 465 return ERR_PTR(ret); 486 466 } 487 467 488 - /* 489 - * request a key 490 - * - search the process's keyrings 491 - * - check the list of keys being created or updated 492 - * - call out to userspace for a key if supplementary info was provided 493 - * - cache the key in an appropriate keyring 468 + /** 469 + * request_key_and_link - Request a key and cache it in a keyring. 470 + * @type: The type of key we want. 471 + * @description: The searchable description of the key. 472 + * @callout_info: The data to pass to the instantiation upcall (or NULL). 473 + * @callout_len: The length of callout_info. 474 + * @aux: Auxiliary data for the upcall. 475 + * @dest_keyring: Where to cache the key. 476 + * @flags: Flags to key_alloc(). 477 + * 478 + * A key matching the specified criteria is searched for in the process's 479 + * keyrings and returned with its usage count incremented if found. Otherwise, 480 + * if callout_info is not NULL, a key will be allocated and some service 481 + * (probably in userspace) will be asked to instantiate it. 482 + * 483 + * If successfully found or created, the key will be linked to the destination 484 + * keyring if one is provided. 485 + * 486 + * Returns a pointer to the key if successful; -EACCES, -ENOKEY, -EKEYREVOKED 487 + * or -EKEYEXPIRED if an inaccessible, negative, revoked or expired key was 488 + * found; -ENOKEY if no key was found and no @callout_info was given; -EDQUOT 489 + * if insufficient key quota was available to create a new key; or -ENOMEM if 490 + * insufficient memory was available. 491 + * 492 + * If the returned key was created, then it may still be under construction, 493 + * and wait_for_key_construction() should be used to wait for that to complete. 494 494 */ 495 495 struct key *request_key_and_link(struct key_type *type, 496 496 const char *description, ··· 564 524 return key; 565 525 } 566 526 567 - /* 568 - * wait for construction of a key to complete 527 + /** 528 + * wait_for_key_construction - Wait for construction of a key to complete 529 + * @key: The key being waited for. 530 + * @intr: Whether to wait interruptibly. 531 + * 532 + * Wait for a key to finish being constructed. 533 + * 534 + * Returns 0 if successful; -ERESTARTSYS if the wait was interrupted; -ENOKEY 535 + * if the key was negated; or -EKEYREVOKED or -EKEYEXPIRED if the key was 536 + * revoked or expired. 569 537 */ 570 538 int wait_for_key_construction(struct key *key, bool intr) 571 539 { ··· 590 542 } 591 543 EXPORT_SYMBOL(wait_for_key_construction); 592 544 593 - /* 594 - * request a key 595 - * - search the process's keyrings 596 - * - check the list of keys being created or updated 597 - * - call out to userspace for a key if supplementary info was provided 598 - * - waits uninterruptible for creation to complete 545 + /** 546 + * request_key - Request a key and wait for construction 547 + * @type: Type of key. 548 + * @description: The searchable description of the key. 549 + * @callout_info: The data to pass to the instantiation upcall (or NULL). 550 + * 551 + * As for request_key_and_link() except that it does not add the returned key 552 + * to a keyring if found, new keys are always allocated in the user's quota, 553 + * the callout_info must be a NUL-terminated string and no auxiliary data can 554 + * be passed. 555 + * 556 + * Furthermore, it then works as wait_for_key_construction() to wait for the 557 + * completion of keys undergoing construction with a non-interruptible wait. 599 558 */ 600 559 struct key *request_key(struct key_type *type, 601 560 const char *description, ··· 627 572 } 628 573 EXPORT_SYMBOL(request_key); 629 574 630 - /* 631 - * request a key with auxiliary data for the upcaller 632 - * - search the process's keyrings 633 - * - check the list of keys being created or updated 634 - * - call out to userspace for a key if supplementary info was provided 635 - * - waits uninterruptible for creation to complete 575 + /** 576 + * request_key_with_auxdata - Request a key with auxiliary data for the upcaller 577 + * @type: The type of key we want. 578 + * @description: The searchable description of the key. 579 + * @callout_info: The data to pass to the instantiation upcall (or NULL). 580 + * @callout_len: The length of callout_info. 581 + * @aux: Auxiliary data for the upcall. 582 + * 583 + * As for request_key_and_link() except that it does not add the returned key 584 + * to a keyring if found and new keys are always allocated in the user's quota. 585 + * 586 + * Furthermore, it then works as wait_for_key_construction() to wait for the 587 + * completion of keys undergoing construction with a non-interruptible wait. 636 588 */ 637 589 struct key *request_key_with_auxdata(struct key_type *type, 638 590 const char *description, ··· 664 602 EXPORT_SYMBOL(request_key_with_auxdata); 665 603 666 604 /* 667 - * request a key (allow async construction) 668 - * - search the process's keyrings 669 - * - check the list of keys being created or updated 670 - * - call out to userspace for a key if supplementary info was provided 605 + * request_key_async - Request a key (allow async construction) 606 + * @type: Type of key. 607 + * @description: The searchable description of the key. 608 + * @callout_info: The data to pass to the instantiation upcall (or NULL). 609 + * @callout_len: The length of callout_info. 610 + * 611 + * As for request_key_and_link() except that it does not add the returned key 612 + * to a keyring if found, new keys are always allocated in the user's quota and 613 + * no auxiliary data can be passed. 614 + * 615 + * The caller should call wait_for_key_construction() to wait for the 616 + * completion of the returned key if it is still undergoing construction. 671 617 */ 672 618 struct key *request_key_async(struct key_type *type, 673 619 const char *description, ··· 690 620 691 621 /* 692 622 * request a key with auxiliary data for the upcaller (allow async construction) 693 - * - search the process's keyrings 694 - * - check the list of keys being created or updated 695 - * - call out to userspace for a key if supplementary info was provided 623 + * @type: Type of key. 624 + * @description: The searchable description of the key. 625 + * @callout_info: The data to pass to the instantiation upcall (or NULL). 626 + * @callout_len: The length of callout_info. 627 + * @aux: Auxiliary data for the upcall. 628 + * 629 + * As for request_key_and_link() except that it does not add the returned key 630 + * to a keyring if found and new keys are always allocated in the user's quota. 631 + * 632 + * The caller should call wait_for_key_construction() to wait for the 633 + * completion of the returned key if it is still undergoing construction. 696 634 */ 697 635 struct key *request_key_async_with_auxdata(struct key_type *type, 698 636 const char *description,
+22 -40
security/keys/request_key_auth.c
··· 1 - /* request_key_auth.c: request key authorisation controlling key def 1 + /* Request key authorisation token key definition. 2 2 * 3 3 * Copyright (C) 2005 Red Hat, Inc. All Rights Reserved. 4 4 * Written by David Howells (dhowells@redhat.com) ··· 26 26 static long request_key_auth_read(const struct key *, char __user *, size_t); 27 27 28 28 /* 29 - * the request-key authorisation key type definition 29 + * The request-key authorisation key type definition. 30 30 */ 31 31 struct key_type key_type_request_key_auth = { 32 32 .name = ".request_key_auth", ··· 38 38 .read = request_key_auth_read, 39 39 }; 40 40 41 - /*****************************************************************************/ 42 41 /* 43 - * instantiate a request-key authorisation key 42 + * Instantiate a request-key authorisation key. 44 43 */ 45 44 static int request_key_auth_instantiate(struct key *key, 46 45 const void *data, ··· 47 48 { 48 49 key->payload.data = (struct request_key_auth *) data; 49 50 return 0; 51 + } 50 52 51 - } /* end request_key_auth_instantiate() */ 52 - 53 - /*****************************************************************************/ 54 53 /* 55 - * reading a request-key authorisation key retrieves the callout information 54 + * Describe an authorisation token. 56 55 */ 57 56 static void request_key_auth_describe(const struct key *key, 58 57 struct seq_file *m) ··· 60 63 seq_puts(m, "key:"); 61 64 seq_puts(m, key->description); 62 65 seq_printf(m, " pid:%d ci:%zu", rka->pid, rka->callout_len); 66 + } 63 67 64 - } /* end request_key_auth_describe() */ 65 - 66 - /*****************************************************************************/ 67 68 /* 68 - * read the callout_info data 69 + * Read the callout_info data (retrieves the callout information). 69 70 * - the key's semaphore is read-locked 70 71 */ 71 72 static long request_key_auth_read(const struct key *key, ··· 86 91 } 87 92 88 93 return ret; 94 + } 89 95 90 - } /* end request_key_auth_read() */ 91 - 92 - /*****************************************************************************/ 93 96 /* 94 - * handle revocation of an authorisation token key 95 - * - called with the key sem write-locked 97 + * Handle revocation of an authorisation token key. 98 + * 99 + * Called with the key sem write-locked. 96 100 */ 97 101 static void request_key_auth_revoke(struct key *key) 98 102 { ··· 103 109 put_cred(rka->cred); 104 110 rka->cred = NULL; 105 111 } 112 + } 106 113 107 - } /* end request_key_auth_revoke() */ 108 - 109 - /*****************************************************************************/ 110 114 /* 111 - * destroy an instantiation authorisation token key 115 + * Destroy an instantiation authorisation token key. 112 116 */ 113 117 static void request_key_auth_destroy(struct key *key) 114 118 { ··· 123 131 key_put(rka->dest_keyring); 124 132 kfree(rka->callout_info); 125 133 kfree(rka); 134 + } 126 135 127 - } /* end request_key_auth_destroy() */ 128 - 129 - /*****************************************************************************/ 130 136 /* 131 - * create an authorisation token for /sbin/request-key or whoever to gain 132 - * access to the caller's security data 137 + * Create an authorisation token for /sbin/request-key or whoever to gain 138 + * access to the caller's security data. 133 139 */ 134 140 struct key *request_key_auth_new(struct key *target, const void *callout_info, 135 141 size_t callout_len, struct key *dest_keyring) ··· 218 228 kfree(rka); 219 229 kleave("= %d", ret); 220 230 return ERR_PTR(ret); 231 + } 221 232 222 - } /* end request_key_auth_new() */ 223 - 224 - /*****************************************************************************/ 225 233 /* 226 - * see if an authorisation key is associated with a particular key 234 + * See if an authorisation key is associated with a particular key. 227 235 */ 228 236 static int key_get_instantiation_authkey_match(const struct key *key, 229 237 const void *_id) ··· 230 242 key_serial_t id = (key_serial_t)(unsigned long) _id; 231 243 232 244 return rka->target_key->serial == id; 245 + } 233 246 234 - } /* end key_get_instantiation_authkey_match() */ 235 - 236 - /*****************************************************************************/ 237 247 /* 238 - * get the authorisation key for instantiation of a specific key if attached to 239 - * the current process's keyrings 240 - * - this key is inserted into a keyring and that is set as /sbin/request-key's 241 - * session keyring 242 - * - a target_id of zero specifies any valid token 248 + * Search the current process's keyrings for the authorisation key for 249 + * instantiation of a key. 243 250 */ 244 251 struct key *key_get_instantiation_authkey(key_serial_t target_id) 245 252 { ··· 261 278 262 279 error: 263 280 return authkey; 264 - 265 - } /* end key_get_instantiation_authkey() */ 281 + }
+28 -23
security/keys/trusted_defined.c
··· 101 101 if (dlen == 0) 102 102 break; 103 103 data = va_arg(argp, unsigned char *); 104 - if (data == NULL) 105 - return -EINVAL; 104 + if (data == NULL) { 105 + ret = -EINVAL; 106 + break; 107 + } 106 108 ret = crypto_shash_update(&sdesc->shash, data, dlen); 107 109 if (ret < 0) 108 - goto out; 110 + break; 109 111 } 110 112 va_end(argp); 111 113 if (!ret) ··· 148 146 if (dlen == 0) 149 147 break; 150 148 data = va_arg(argp, unsigned char *); 151 - ret = crypto_shash_update(&sdesc->shash, data, dlen); 152 - if (ret < 0) { 153 - va_end(argp); 154 - goto out; 149 + if (!data) { 150 + ret = -EINVAL; 151 + break; 155 152 } 153 + ret = crypto_shash_update(&sdesc->shash, data, dlen); 154 + if (ret < 0) 155 + break; 156 156 } 157 157 va_end(argp); 158 - ret = crypto_shash_final(&sdesc->shash, paramdigest); 158 + if (!ret) 159 + ret = crypto_shash_final(&sdesc->shash, paramdigest); 159 160 if (!ret) 160 161 ret = TSS_rawhmac(digest, key, keylen, SHA1_DIGEST_SIZE, 161 162 paramdigest, TPM_NONCE_SIZE, h1, ··· 227 222 break; 228 223 dpos = va_arg(argp, unsigned int); 229 224 ret = crypto_shash_update(&sdesc->shash, buffer + dpos, dlen); 230 - if (ret < 0) { 231 - va_end(argp); 232 - goto out; 233 - } 225 + if (ret < 0) 226 + break; 234 227 } 235 228 va_end(argp); 236 - ret = crypto_shash_final(&sdesc->shash, paramdigest); 229 + if (!ret) 230 + ret = crypto_shash_final(&sdesc->shash, paramdigest); 237 231 if (ret < 0) 238 232 goto out; 239 233 ··· 320 316 break; 321 317 dpos = va_arg(argp, unsigned int); 322 318 ret = crypto_shash_update(&sdesc->shash, buffer + dpos, dlen); 323 - if (ret < 0) { 324 - va_end(argp); 325 - goto out; 326 - } 319 + if (ret < 0) 320 + break; 327 321 } 328 322 va_end(argp); 329 - ret = crypto_shash_final(&sdesc->shash, paramdigest); 323 + if (!ret) 324 + ret = crypto_shash_final(&sdesc->shash, paramdigest); 330 325 if (ret < 0) 331 326 goto out; 332 327 ··· 514 511 /* get session for sealing key */ 515 512 ret = osap(tb, &sess, keyauth, keytype, keyhandle); 516 513 if (ret < 0) 517 - return ret; 514 + goto out; 518 515 dump_sess(&sess); 519 516 520 517 /* calculate encrypted authorization value */ ··· 522 519 memcpy(td->xorwork + SHA1_DIGEST_SIZE, sess.enonce, SHA1_DIGEST_SIZE); 523 520 ret = TSS_sha1(td->xorwork, SHA1_DIGEST_SIZE * 2, td->xorhash); 524 521 if (ret < 0) 525 - return ret; 522 + goto out; 526 523 527 524 ret = tpm_get_random(tb, td->nonceodd, TPM_NONCE_SIZE); 528 525 if (ret < 0) 529 - return ret; 526 + goto out; 530 527 ordinal = htonl(TPM_ORD_SEAL); 531 528 datsize = htonl(datalen); 532 529 pcrsize = htonl(pcrinfosize); ··· 555 552 &datsize, datalen, data, 0, 0); 556 553 } 557 554 if (ret < 0) 558 - return ret; 555 + goto out; 559 556 560 557 /* build and send the TPM request packet */ 561 558 INIT_BUF(tb); ··· 575 572 576 573 ret = trusted_tpm_send(TPM_ANY_NUM, tb->data, MAX_BUF_SIZE); 577 574 if (ret < 0) 578 - return ret; 575 + goto out; 579 576 580 577 /* calculate the size of the returned Blob */ 581 578 sealinfosize = LOAD32(tb->data, TPM_DATA_OFFSET + sizeof(uint32_t)); ··· 594 591 memcpy(blob, tb->data + TPM_DATA_OFFSET, storedsize); 595 592 *bloblen = storedsize; 596 593 } 594 + out: 595 + kfree(td); 597 596 return ret; 598 597 } 599 598
+8 -24
security/keys/user_defined.c
··· 35 35 36 36 EXPORT_SYMBOL_GPL(key_type_user); 37 37 38 - /*****************************************************************************/ 39 38 /* 40 39 * instantiate a user defined key 41 40 */ ··· 64 65 65 66 error: 66 67 return ret; 67 - 68 - } /* end user_instantiate() */ 68 + } 69 69 70 70 EXPORT_SYMBOL_GPL(user_instantiate); 71 71 72 - /*****************************************************************************/ 73 72 /* 74 73 * dispose of the old data from an updated user defined key 75 74 */ ··· 78 81 upayload = container_of(rcu, struct user_key_payload, rcu); 79 82 80 83 kfree(upayload); 84 + } 81 85 82 - } /* end user_update_rcu_disposal() */ 83 - 84 - /*****************************************************************************/ 85 86 /* 86 87 * update a user defined key 87 88 * - the key's semaphore is write-locked ··· 118 123 119 124 error: 120 125 return ret; 121 - 122 - } /* end user_update() */ 126 + } 123 127 124 128 EXPORT_SYMBOL_GPL(user_update); 125 129 126 - /*****************************************************************************/ 127 130 /* 128 131 * match users on their name 129 132 */ 130 133 int user_match(const struct key *key, const void *description) 131 134 { 132 135 return strcmp(key->description, description) == 0; 133 - 134 - } /* end user_match() */ 136 + } 135 137 136 138 EXPORT_SYMBOL_GPL(user_match); 137 139 138 - /*****************************************************************************/ 139 140 /* 140 141 * dispose of the links from a revoked keyring 141 142 * - called with the key sem write-locked ··· 147 156 rcu_assign_pointer(key->payload.data, NULL); 148 157 call_rcu(&upayload->rcu, user_update_rcu_disposal); 149 158 } 150 - 151 - } /* end user_revoke() */ 159 + } 152 160 153 161 EXPORT_SYMBOL(user_revoke); 154 162 155 - /*****************************************************************************/ 156 163 /* 157 164 * dispose of the data dangling from the corpse of a user key 158 165 */ ··· 159 170 struct user_key_payload *upayload = key->payload.data; 160 171 161 172 kfree(upayload); 162 - 163 - } /* end user_destroy() */ 173 + } 164 174 165 175 EXPORT_SYMBOL_GPL(user_destroy); 166 176 167 - /*****************************************************************************/ 168 177 /* 169 178 * describe the user key 170 179 */ ··· 171 184 seq_puts(m, key->description); 172 185 173 186 seq_printf(m, ": %u", key->datalen); 174 - 175 - } /* end user_describe() */ 187 + } 176 188 177 189 EXPORT_SYMBOL_GPL(user_describe); 178 190 179 - /*****************************************************************************/ 180 191 /* 181 192 * read the key data 182 193 * - the key's semaphore is read-locked ··· 198 213 } 199 214 200 215 return ret; 201 - 202 - } /* end user_read() */ 216 + } 203 217 204 218 EXPORT_SYMBOL_GPL(user_read);
+9 -9
usr/Kconfig
··· 46 46 If you are not sure, leave it set to "0". 47 47 48 48 config RD_GZIP 49 - bool "Support initial ramdisks compressed using gzip" if EMBEDDED 49 + bool "Support initial ramdisks compressed using gzip" if EXPERT 50 50 default y 51 51 depends on BLK_DEV_INITRD 52 52 select DECOMPRESS_GZIP ··· 55 55 If unsure, say Y. 56 56 57 57 config RD_BZIP2 58 - bool "Support initial ramdisks compressed using bzip2" if EMBEDDED 59 - default !EMBEDDED 58 + bool "Support initial ramdisks compressed using bzip2" if EXPERT 59 + default !EXPERT 60 60 depends on BLK_DEV_INITRD 61 61 select DECOMPRESS_BZIP2 62 62 help ··· 64 64 If unsure, say N. 65 65 66 66 config RD_LZMA 67 - bool "Support initial ramdisks compressed using LZMA" if EMBEDDED 68 - default !EMBEDDED 67 + bool "Support initial ramdisks compressed using LZMA" if EXPERT 68 + default !EXPERT 69 69 depends on BLK_DEV_INITRD 70 70 select DECOMPRESS_LZMA 71 71 help ··· 73 73 If unsure, say N. 74 74 75 75 config RD_XZ 76 - bool "Support initial ramdisks compressed using XZ" if EMBEDDED 77 - default !EMBEDDED 76 + bool "Support initial ramdisks compressed using XZ" if EXPERT 77 + default !EXPERT 78 78 depends on BLK_DEV_INITRD 79 79 select DECOMPRESS_XZ 80 80 help ··· 82 82 If unsure, say N. 83 83 84 84 config RD_LZO 85 - bool "Support initial ramdisks compressed using LZO" if EMBEDDED 86 - default !EMBEDDED 85 + bool "Support initial ramdisks compressed using LZO" if EXPERT 86 + default !EXPERT 87 87 depends on BLK_DEV_INITRD 88 88 select DECOMPRESS_LZO 89 89 help