···100100 <year>2008</year>101101 <year>2009</year>102102 <year>2010</year>103103+ <year>2011</year>103104 <holder>Bill Dirks, Michael H. Schimek, Hans Verkuil, Martin104105Rubli, Andy Walls, Muralidharan Karicheri, Mauro Carvalho Chehab</holder>105106 </copyright>···382381</partinfo>383382384383<title>Video for Linux Two API Specification</title>385385- <subtitle>Revision 2.6.33</subtitle>384384+ <subtitle>Revision 2.6.38</subtitle>386385387386 <chapter id="common">388387 &sub-common;
-8
Documentation/feature-removal-schedule.txt
···357357358358-----------------------------359359360360-What: __do_IRQ all in one fits nothing interrupt handler361361-When: 2.6.32362362-Why: __do_IRQ was kept for easy migration to the type flow handlers.363363- More than two years of migration time is enough.364364-Who: Thomas Gleixner <tglx@linutronix.de>365365-366366------------------------------367367-368360What: fakephp and associated sysfs files in /sys/bus/pci/slots/369361When: 2011370362Why: In 2.6.27, the semantics of /sys/bus/pci/slots was redefined to
+65-8
Documentation/lguest/lguest.c
···3939#include <limits.h>4040#include <stddef.h>4141#include <signal.h>4242+#include <pwd.h>4343+#include <grp.h>4444+4245#include <linux/virtio_config.h>4346#include <linux/virtio_net.h>4447#include <linux/virtio_blk.h>···301298302299 /*303300 * We use a private mapping (ie. if we write to the page, it will be304304- * copied).301301+ * copied). We allocate an extra two pages PROT_NONE to act as guard302302+ * pages against read/write attempts that exceed allocated space.305303 */306306- addr = mmap(NULL, getpagesize() * num,307307- PROT_READ|PROT_WRITE|PROT_EXEC, MAP_PRIVATE, fd, 0);304304+ addr = mmap(NULL, getpagesize() * (num+2),305305+ PROT_NONE, MAP_PRIVATE, fd, 0);306306+308307 if (addr == MAP_FAILED)309308 err(1, "Mmapping %u pages of /dev/zero", num);309309+310310+ if (mprotect(addr + getpagesize(), getpagesize() * num,311311+ PROT_READ|PROT_WRITE) == -1)312312+ err(1, "mprotect rw %u pages failed", num);310313311314 /*312315 * One neat mmap feature is that you can close the fd, and it···320311 */321312 close(fd);322313323323- return addr;314314+ /* Return address after PROT_NONE page */315315+ return addr + getpagesize();324316}325317326318/* Get some more pages for a device. */···353343 * done to it. This allows us to share untouched memory between354344 * Guests.355345 */356356- if (mmap(addr, len, PROT_READ|PROT_WRITE|PROT_EXEC,346346+ if (mmap(addr, len, PROT_READ|PROT_WRITE,357347 MAP_FIXED|MAP_PRIVATE, fd, offset) != MAP_FAILED)358348 return;359349···583573 unsigned int line)584574{585575 /*586586- * We have to separately check addr and addr+size, because size could587587- * be huge and addr + size might wrap around.576576+ * Check if the requested address and size exceeds the allocated memory,577577+ * or addr + size wraps around.588578 */589589- if (addr >= guest_limit || addr + size >= guest_limit)579579+ if ((addr + size) > guest_limit || (addr + size) < addr)590580 errx(1, "%s:%i: Invalid address %#lx", __FILE__, line, addr);591581 /*592582 * We return a pointer for the caller's convenience, now we know it's···18821872 { "block", 1, NULL, 'b' },18831873 { "rng", 0, NULL, 'r' },18841874 { "initrd", 1, NULL, 'i' },18751875+ { "username", 1, NULL, 'u' },18761876+ { "chroot", 1, NULL, 'c' },18851877 { NULL },18861878};18871879static void usage(void)···19051893 struct boot_params *boot;19061894 /* If they specify an initrd file to load. */19071895 const char *initrd_name = NULL;18961896+18971897+ /* Password structure for initgroups/setres[gu]id */18981898+ struct passwd *user_details = NULL;18991899+19001900+ /* Directory to chroot to */19011901+ char *chroot_path = NULL;1908190219091903 /* Save the args: we "reboot" by execing ourselves again. */19101904 main_args = argv;···19671949 break;19681950 case 'i':19691951 initrd_name = optarg;19521952+ break;19531953+ case 'u':19541954+ user_details = getpwnam(optarg);19551955+ if (!user_details)19561956+ err(1, "getpwnam failed, incorrect username?");19571957+ break;19581958+ case 'c':19591959+ chroot_path = optarg;19701960 break;19711961 default:19721962 warnx("Unknown argument %s", argv[optind]);···2046202020472021 /* If we exit via err(), this kills all the threads, restores tty. */20482022 atexit(cleanup_devices);20232023+20242024+ /* If requested, chroot to a directory */20252025+ if (chroot_path) {20262026+ if (chroot(chroot_path) != 0)20272027+ err(1, "chroot(\"%s\") failed", chroot_path);20282028+20292029+ if (chdir("/") != 0)20302030+ err(1, "chdir(\"/\") failed");20312031+20322032+ verbose("chroot done\n");20332033+ }20342034+20352035+ /* If requested, drop privileges */20362036+ if (user_details) {20372037+ uid_t u;20382038+ gid_t g;20392039+20402040+ u = user_details->pw_uid;20412041+ g = user_details->pw_gid;20422042+20432043+ if (initgroups(user_details->pw_name, g) != 0)20442044+ err(1, "initgroups failed");20452045+20462046+ if (setresgid(g, g, g) != 0)20472047+ err(1, "setresgid failed");20482048+20492049+ if (setresuid(u, u, u) != 0)20502050+ err(1, "setresuid failed");20512051+20522052+ verbose("Dropping privileges completed\n");20532053+ }2049205420502055 /* Finally, run the Guest. This doesn't return. */20512056 run_guest();
+5
Documentation/lguest/lguest.txt
···117117118118 for general information on how to get bridging to work.119119120120+- Random number generation. Using the --rng option will provide a121121+ /dev/hwrng in the guest that will read from the host's /dev/random.122122+ Use this option in conjunction with rng-tools (see ../hw_random.txt)123123+ to provide entropy to the guest kernel's /dev/random.124124+120125There is a helpful mailing list at http://ozlabs.org/mailman/listinfo/lguest121126122127Good luck!
+12
Documentation/video4linux/v4l2-controls.txt
···285285The 'new value' union is not used in g_volatile_ctrl. In general controls286286that need to implement g_volatile_ctrl are read-only controls.287287288288+Note that if one or more controls in a control cluster are marked as volatile,289289+then all the controls in the cluster are seen as volatile.290290+288291To mark a control as volatile you have to set the is_volatile flag:289292290293 ctrl = v4l2_ctrl_new_std(&sd->ctrl_handler, ...);···464461465462Obviously, all controls in the cluster array must be initialized to either466463a valid control or to NULL.464464+465465+In rare cases you might want to know which controls of a cluster actually466466+were set explicitly by the user. For this you can check the 'is_new' flag of467467+each control. For example, in the case of a volume/mute cluster the 'is_new'468468+flag of the mute control would be set if the user called VIDIOC_S_CTRL for469469+mute only. If the user would call VIDIOC_S_EXT_CTRLS for both mute and volume470470+controls, then the 'is_new' flag would be 1 for both controls.471471+472472+The 'is_new' flag is always 1 when called from v4l2_ctrl_handler_setup().467473468474469475VIDIOC_LOG_STATUS Support
+32-28
MAINTAINERS
···162162W: http://serial.sourceforge.net163163S: Maintained164164T: git git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty-2.6.git165165-F: drivers/serial/8250*165165+F: drivers/tty/serial/8250*166166F: include/linux/serial_8250.h1671671681688390 NETWORK DRIVERS [WD80x3/SMC-ELITE, SMC-ULTRA, NE2000, 3C503, etc.]···624624L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)625625S: Maintained626626627627-ARM/ATMEL AT91RM9200 ARM ARCHITECTURE627627+ARM/ATMEL AT91RM9200 AND AT91SAM ARM ARCHITECTURES628628M: Andrew Victor <linux@maxim.org.za>629629+M: Nicolas Ferre <nicolas.ferre@atmel.com>630630+M: Jean-Christophe Plagniol-Villard <plagnioj@jcrosoft.com>629631L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)630632W: http://maxim.org.za/at91_26.html631631-S: Maintained633633+W: http://www.linux4sam.org634634+S: Supported635635+F: arch/arm/mach-at91/632636633637ARM/BCMRING ARM ARCHITECTURE634638M: Jiandong Zheng <jdzheng@broadcom.com>···892888F: drivers/video/msm/893889F: drivers/mmc/host/msm_sdcc.c894890F: drivers/mmc/host/msm_sdcc.h895895-F: drivers/serial/msm_serial.h896896-F: drivers/serial/msm_serial.c891891+F: drivers/tty/serial/msm_serial.h892892+F: drivers/tty/serial/msm_serial.c897893T: git git://codeaurora.org/quic/kernel/davidb/linux-msm.git898894S: Maintained899895···12601256ATMEL AT91 / AT32 SERIAL DRIVER12611257M: Nicolas Ferre <nicolas.ferre@atmel.com>12621258S: Supported12631263-F: drivers/serial/atmel_serial.c12591259+F: drivers/tty/serial/atmel_serial.c1264126012651261ATMEL LCDFB DRIVER12661262M: Nicolas Ferre <nicolas.ferre@atmel.com>···14161412L: uclinux-dist-devel@blackfin.uclinux.org14171413W: http://blackfin.uclinux.org14181414S: Supported14191419-F: drivers/serial/bfin_5xx.c14151415+F: drivers/tty/serial/bfin_5xx.c1420141614211417BLACKFIN WATCHDOG DRIVER14221418M: Mike Frysinger <vapier.adi@gmail.com>···18811877W: http://developer.axis.com18821878S: Maintained18831879F: arch/cris/18841884-F: drivers/serial/crisv10.*18801880+F: drivers/tty/serial/crisv10.*1885188118861882CRYPTO API18871883M: Herbert Xu <herbert@gondor.apana.org.au>···22202216DZ DECSTATION DZ11 SERIAL DRIVER22212217M: "Maciej W. Rozycki" <macro@linux-mips.org>22222218S: Maintained22232223-F: drivers/serial/dz.*22192219+F: drivers/tty/serial/dz.*2224222022252221EATA-DMA SCSI DRIVER22262222M: Michael Neuffer <mike@i-Connect.Net>···26472643M: Timur Tabi <timur@freescale.com>26482644L: linuxppc-dev@lists.ozlabs.org26492645S: Supported26502650-F: drivers/serial/ucc_uart.c26462646+F: drivers/tty/serial/ucc_uart.c2651264726522648FREESCALE SOC SOUND DRIVERS26532649M: Timur Tabi <timur@freescale.com>···31503146F: drivers/video/imsttfb.c3151314731523148INFINIBAND SUBSYSTEM31533153-M: Roland Dreier <rolandd@cisco.com>31493149+M: Roland Dreier <roland@kernel.org>31543150M: Sean Hefty <sean.hefty@intel.com>31553151M: Hal Rosenstock <hal.rosenstock@gmail.com>31563152L: linux-rdma@vger.kernel.org···33543350M: Pat Gefre <pfg@sgi.com>33553351L: linux-serial@vger.kernel.org33563352S: Maintained33573357-F: drivers/serial/ioc3_serial.c33533353+F: drivers/tty/serial/ioc3_serial.c3358335433593355IP MASQUERADING33603356M: Juanjo Ciarlante <jjciarla@raiz.uncu.edu.ar>···35313527M: Breno Leitao <leitao@linux.vnet.ibm.com>35323528L: linux-serial@vger.kernel.org35333529S: Maintained35343534-F: drivers/serial/jsm/35303530+F: drivers/tty/serial/jsm/3535353135363532K10TEMP HARDWARE MONITORING DRIVER35373533M: Clemens Ladisch <clemens@ladisch.de>···36813677S: Maintained36823678F: Documentation/DocBook/kgdb.tmpl36833679F: drivers/misc/kgdbts.c36843684-F: drivers/serial/kgdboc.c36803680+F: drivers/tty/serial/kgdboc.c36853681F: include/linux/kdb.h36863682F: include/linux/kgdb.h36873683F: kernel/debug/···55495545L: linux-ia64@vger.kernel.org55505546S: Supported55515547F: Documentation/ia64/serial.txt55525552-F: drivers/serial/ioc?_serial.c55485548+F: drivers/tty/serial/ioc?_serial.c55535549F: include/linux/ioc?.h5554555055555551SGI VISUAL WORKSTATION 320 AND 540···55715567S: Maintained55725568F: Documentation/arm/Sharp-LH/ADC-LH7-Touchscreen55735569F: arch/arm/mach-lh7a40x/55745574-F: drivers/serial/serial_lh7a40x.c55705570+F: drivers/tty/serial/serial_lh7a40x.c55755571F: drivers/usb/gadget/lh7a40*55765572F: drivers/usb/host/ohci-lh7a40*55775573···57915787T: git git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc-2.6.git57925788T: git git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc-next-2.6.git57935789S: Maintained57945794-F: drivers/serial/suncore.c57955795-F: drivers/serial/suncore.h57965796-F: drivers/serial/sunhv.c57975797-F: drivers/serial/sunsab.c57985798-F: drivers/serial/sunsab.h57995799-F: drivers/serial/sunsu.c58005800-F: drivers/serial/sunzilog.c58015801-F: drivers/serial/sunzilog.h57905790+F: drivers/tty/serial/suncore.c57915791+F: drivers/tty/serial/suncore.h57925792+F: drivers/tty/serial/sunhv.c57935793+F: drivers/tty/serial/sunsab.c57945794+F: drivers/tty/serial/sunsab.h57955795+F: drivers/tty/serial/sunsu.c57965796+F: drivers/tty/serial/sunzilog.c57975797+F: drivers/tty/serial/sunzilog.h5802579858035799SPEAR PLATFORM SUPPORT58045800M: Viresh Kumar <viresh.kumar@st.com>···61286124M: Greg Kroah-Hartman <gregkh@suse.de>61296125S: Maintained61306126T: git git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty-2.6.git61316131-F: drivers/char/tty_*61326132-F: drivers/serial/serial_core.c61276127+F: drivers/tty/*61286128+F: drivers/tty/serial/serial_core.c61336129F: include/linux/serial_core.h61346130F: include/linux/serial.h61356131F: include/linux/tty.h···68746870M: Peter Korsgaard <jacmet@sunsite.dk>68756871L: linux-serial@vger.kernel.org68766872S: Maintained68776877-F: drivers/serial/uartlite.c68736873+F: drivers/tty/serial/uartlite.c6878687468796875YAM DRIVER FOR AX.2568806876M: Jean-Paul Roubelat <jpr@f6fbb.org>···69206916ZS DECSTATION Z85C30 SERIAL DRIVER69216917M: "Maciej W. Rozycki" <macro@linux-mips.org>69226918S: Maintained69236923-F: drivers/serial/zs.*69196919+F: drivers/tty/serial/zs.*6924692069256921GRE DEMULTIPLEXER DRIVER69266922M: Dmitry Kozlov <xeb@mail.ru>
···88 select HAVE_IRQ_WORK99 select HAVE_PERF_EVENTS1010 select HAVE_DMA_ATTRS1111+ select HAVE_GENERIC_HARDIRQS1212+ select GENERIC_IRQ_PROBE1313+ select AUTO_IRQ_AFFINITY if SMP1114 help1215 The Alpha is a 64-bit general-purpose processor designed and1316 marketed by the Digital Equipment Corporation of blessed memory,···7067config GENERIC_IOMAP7168 bool7269 default n7373-7474-config GENERIC_HARDIRQS_NO__DO_IRQ7575- def_bool y7676-7777-config GENERIC_HARDIRQS7878- bool7979- default y8080-8181-config GENERIC_IRQ_PROBE8282- bool8383- default y8484-8585-config AUTO_IRQ_AFFINITY8686- bool8787- depends on SMP8888- default y89709071source "init/Kconfig"9172source "kernel/Kconfig.freezer"
+1-1
arch/arm/configs/ag5evm_defconfig
···1010# CONFIG_PID_NS is not set1111CONFIG_BLK_DEV_INITRD=y1212CONFIG_INITRAMFS_SOURCE=""1313-CONFIG_EMBEDDED=y1313+CONFIG_EXPERT=y1414CONFIG_SLAB=y1515# CONFIG_BLK_DEV_BSG is not set1616# CONFIG_IOSCHED_DEADLINE is not set
+1-1
arch/arm/configs/am200epdkit_defconfig
···33# CONFIG_SWAP is not set44CONFIG_SYSVIPC=y55CONFIG_SYSFS_DEPRECATED_V2=y66-CONFIG_EMBEDDED=y66+CONFIG_EXPERT=y77# CONFIG_SYSCTL_SYSCALL is not set88# CONFIG_EPOLL is not set99# CONFIG_SHMEM is not set
+1-1
arch/arm/configs/at572d940hfek_defconfig
···1717CONFIG_RELAY=y1818CONFIG_BLK_DEV_INITRD=y1919# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set2020-CONFIG_EMBEDDED=y2020+CONFIG_EXPERT=y2121CONFIG_SLAB=y2222CONFIG_PROFILING=y2323CONFIG_OPROFILE=m
···22# CONFIG_LOCALVERSION_AUTO is not set33# CONFIG_SWAP is not set44CONFIG_SYSVIPC=y55-CONFIG_EMBEDDED=y55+CONFIG_EXPERT=y66CONFIG_KALLSYMS_EXTRA_PASS=y77# CONFIG_HOTPLUG is not set88# CONFIG_ELF_CORE is not set
+1-1
arch/arm/configs/cm_x2xx_defconfig
···66CONFIG_LOG_BUF_SHIFT=1477CONFIG_SYSFS_DEPRECATED_V2=y88CONFIG_BLK_DEV_INITRD=y99-CONFIG_EMBEDDED=y99+CONFIG_EXPERT=y1010# CONFIG_VM_EVENT_COUNTERS is not set1111# CONFIG_SLUB_DEBUG is not set1212# CONFIG_COMPAT_BRK is not set
···44CONFIG_LOG_BUF_SHIFT=1455CONFIG_BLK_DEV_INITRD=y66# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set77-CONFIG_EMBEDDED=y77+CONFIG_EXPERT=y88# CONFIG_BASE_FULL is not set99# CONFIG_EPOLL is not set1010CONFIG_SLOB=y
+1-1
arch/arm/configs/corgi_defconfig
···44CONFIG_LOG_BUF_SHIFT=1455CONFIG_SYSFS_DEPRECATED_V2=y66# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set77-CONFIG_EMBEDDED=y77+CONFIG_EXPERT=y88CONFIG_PROFILING=y99CONFIG_OPROFILE=m1010CONFIG_MODULES=y
···22CONFIG_SYSVIPC=y33CONFIG_LOG_BUF_SHIFT=1444CONFIG_BLK_DEV_INITRD=y55-CONFIG_EMBEDDED=y55+CONFIG_EXPERT=y66# CONFIG_HOTPLUG is not set77CONFIG_ARCH_CLPS711X=y88CONFIG_ARCH_EDB7211=y
+1-1
arch/arm/configs/em_x270_defconfig
···66CONFIG_LOG_BUF_SHIFT=1477CONFIG_SYSFS_DEPRECATED_V2=y88CONFIG_BLK_DEV_INITRD=y99-CONFIG_EMBEDDED=y99+CONFIG_EXPERT=y1010# CONFIG_VM_EVENT_COUNTERS is not set1111# CONFIG_SLUB_DEBUG is not set1212# CONFIG_COMPAT_BRK is not set
···22CONFIG_SYSVIPC=y33CONFIG_LOG_BUF_SHIFT=1444# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set55-CONFIG_EMBEDDED=y55+CONFIG_EXPERT=y66# CONFIG_KALLSYMS is not set77# CONFIG_COMPAT_BRK is not set88CONFIG_SLAB=y
+1-1
arch/arm/configs/ezx_defconfig
···77CONFIG_BLK_DEV_INITRD=y88CONFIG_RD_BZIP2=y99CONFIG_RD_LZMA=y1010-CONFIG_EMBEDDED=y1010+CONFIG_EXPERT=y1111# CONFIG_COMPAT_BRK is not set1212CONFIG_SLAB=y1313CONFIG_MODULES=y
+1-1
arch/arm/configs/footbridge_defconfig
···33CONFIG_BSD_PROCESS_ACCT=y44CONFIG_LOG_BUF_SHIFT=1455CONFIG_BLK_DEV_INITRD=y66-CONFIG_EMBEDDED=y66+CONFIG_EXPERT=y77# CONFIG_HOTPLUG is not set88CONFIG_MODULES=y99CONFIG_ARCH_FOOTBRIDGE=y
+1-1
arch/arm/configs/fortunet_defconfig
···22CONFIG_SYSVIPC=y33CONFIG_LOG_BUF_SHIFT=1444CONFIG_BLK_DEV_INITRD=y55-CONFIG_EMBEDDED=y55+CONFIG_EXPERT=y66# CONFIG_HOTPLUG is not set77CONFIG_ARCH_CLPS711X=y88CONFIG_ARCH_FORTUNET=y
+1-1
arch/arm/configs/h5000_defconfig
···44CONFIG_IKCONFIG_PROC=y55CONFIG_LOG_BUF_SHIFT=1666# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set77-CONFIG_EMBEDDED=y77+CONFIG_EXPERT=y88# CONFIG_UID16 is not set99CONFIG_SLAB=y1010CONFIG_MODULES=y
+1-1
arch/arm/configs/imote2_defconfig
···66CONFIG_BLK_DEV_INITRD=y77CONFIG_RD_BZIP2=y88CONFIG_RD_LZMA=y99-CONFIG_EMBEDDED=y99+CONFIG_EXPERT=y1010# CONFIG_COMPAT_BRK is not set1111CONFIG_SLAB=y1212CONFIG_MODULES=y
+1-1
arch/arm/configs/ixp2000_defconfig
···33CONFIG_BSD_PROCESS_ACCT=y44CONFIG_LOG_BUF_SHIFT=1455CONFIG_BLK_DEV_INITRD=y66-CONFIG_EMBEDDED=y66+CONFIG_EXPERT=y77# CONFIG_HOTPLUG is not set88CONFIG_SLAB=y99CONFIG_MODULES=y
···33CONFIG_BSD_PROCESS_ACCT=y44CONFIG_LOG_BUF_SHIFT=1455CONFIG_BLK_DEV_INITRD=y66-CONFIG_EMBEDDED=y66+CONFIG_EXPERT=y77CONFIG_MODULES=y88CONFIG_MODVERSIONS=y99# CONFIG_BLK_DEV_BSG is not set
···33CONFIG_SYSVIPC=y44CONFIG_IKCONFIG=y55CONFIG_LOG_BUF_SHIFT=1466-CONFIG_EMBEDDED=y66+CONFIG_EXPERT=y77# CONFIG_HOTPLUG is not set88# CONFIG_EPOLL is not set99# CONFIG_IOSCHED_DEADLINE is not set
+1-1
arch/arm/configs/lpd7a404_defconfig
···33CONFIG_SYSVIPC=y44CONFIG_IKCONFIG=y55CONFIG_LOG_BUF_SHIFT=1666-CONFIG_EMBEDDED=y66+CONFIG_EXPERT=y77# CONFIG_HOTPLUG is not set88# CONFIG_EPOLL is not set99CONFIG_SLAB=y
+1-1
arch/arm/configs/magician_defconfig
···44CONFIG_IKCONFIG_PROC=y55CONFIG_LOG_BUF_SHIFT=1666CONFIG_BLK_DEV_INITRD=y77-CONFIG_EMBEDDED=y77+CONFIG_EXPERT=y88# CONFIG_UID16 is not set99CONFIG_SLAB=y1010CONFIG_MODULES=y
+1-1
arch/arm/configs/mv78xx0_defconfig
···22CONFIG_SYSVIPC=y33CONFIG_LOG_BUF_SHIFT=1444CONFIG_SYSFS_DEPRECATED_V2=y55-CONFIG_EMBEDDED=y55+CONFIG_EXPERT=y66CONFIG_KALLSYMS_ALL=y77# CONFIG_SLUB_DEBUG is not set88CONFIG_PROFILING=y
···44CONFIG_LOG_BUF_SHIFT=1455CONFIG_SYSFS_DEPRECATED_V2=y66# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set77-CONFIG_EMBEDDED=y77+CONFIG_EXPERT=y88CONFIG_KALLSYMS_EXTRA_PASS=y99CONFIG_SLAB=y1010CONFIG_MODULES=y
+1-1
arch/arm/configs/mx27_defconfig
···44CONFIG_POSIX_MQUEUE=y55CONFIG_LOG_BUF_SHIFT=1466# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set77-CONFIG_EMBEDDED=y77+CONFIG_EXPERT=y88CONFIG_KALLSYMS_EXTRA_PASS=y99# CONFIG_COMPAT_BRK is not set1010CONFIG_SLAB=y
···33CONFIG_SYSVIPC=y44CONFIG_LOG_BUF_SHIFT=1855CONFIG_RELAY=y66-CONFIG_EMBEDDED=y66+CONFIG_EXPERT=y77# CONFIG_SLUB_DEBUG is not set88# CONFIG_COMPAT_BRK is not set99CONFIG_MODULES=y
···66CONFIG_IKCONFIG=y77CONFIG_LOG_BUF_SHIFT=1488CONFIG_BLK_DEV_INITRD=y99-CONFIG_EMBEDDED=y99+CONFIG_EXPERT=y1010# CONFIG_KALLSYMS is not set1111# CONFIG_ELF_CORE is not set1212# CONFIG_BASE_FULL is not set
+1-1
arch/arm/configs/omap2plus_defconfig
···66CONFIG_IKCONFIG_PROC=y77CONFIG_LOG_BUF_SHIFT=1688CONFIG_BLK_DEV_INITRD=y99-CONFIG_EMBEDDED=y99+CONFIG_EXPERT=y1010# CONFIG_SYSCTL_SYSCALL is not set1111CONFIG_KALLSYMS_EXTRA_PASS=y1212CONFIG_SLAB=y
+1-1
arch/arm/configs/orion5x_defconfig
···22CONFIG_SYSVIPC=y33CONFIG_LOG_BUF_SHIFT=1444CONFIG_SYSFS_DEPRECATED_V2=y55-CONFIG_EMBEDDED=y55+CONFIG_EXPERT=y66# CONFIG_SLUB_DEBUG is not set77CONFIG_PROFILING=y88CONFIG_OPROFILE=y
+1-1
arch/arm/configs/pcm027_defconfig
···77CONFIG_IKCONFIG_PROC=y88CONFIG_LOG_BUF_SHIFT=1499# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set1010-CONFIG_EMBEDDED=y1010+CONFIG_EXPERT=y1111# CONFIG_KALLSYMS is not set1212CONFIG_SLAB=y1313CONFIG_MODULES=y
+1-1
arch/arm/configs/pcontrol_g20_defconfig
···1010CONFIG_LOG_BUF_SHIFT=141111CONFIG_NAMESPACES=y1212CONFIG_BLK_DEV_INITRD=y1313-CONFIG_EMBEDDED=y1313+CONFIG_EXPERT=y1414# CONFIG_SYSCTL_SYSCALL is not set1515# CONFIG_KALLSYMS is not set1616# CONFIG_VM_EVENT_COUNTERS is not set
+1-1
arch/arm/configs/pleb_defconfig
···33CONFIG_SYSVIPC=y44CONFIG_LOG_BUF_SHIFT=1455CONFIG_BLK_DEV_INITRD=y66-CONFIG_EMBEDDED=y66+CONFIG_EXPERT=y77# CONFIG_HOTPLUG is not set88# CONFIG_SHMEM is not set99CONFIG_MODULES=y
···44CONFIG_LOG_BUF_SHIFT=1455CONFIG_SYSFS_DEPRECATED_V2=y66# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set77-CONFIG_EMBEDDED=y77+CONFIG_EXPERT=y88CONFIG_PROFILING=y99CONFIG_OPROFILE=m1010CONFIG_MODULES=y
···55CONFIG_LOG_BUF_SHIFT=1466CONFIG_SYSFS_DEPRECATED_V2=y77CONFIG_BLK_DEV_INITRD=y88-CONFIG_EMBEDDED=y88+CONFIG_EXPERT=y99# CONFIG_KALLSYMS is not set1010# CONFIG_BUG is not set1111# CONFIG_ELF_CORE is not set
···33# CONFIG_SWAP is not set44CONFIG_SYSVIPC=y55CONFIG_LOG_BUF_SHIFT=1466-CONFIG_EMBEDDED=y66+CONFIG_EXPERT=y77# CONFIG_AIO is not set88# CONFIG_VM_EVENT_COUNTERS is not set99CONFIG_MODULES=y
+1-1
arch/arm/configs/viper_defconfig
···33CONFIG_SYSVIPC=y44CONFIG_LOG_BUF_SHIFT=1355CONFIG_SYSFS_DEPRECATED_V2=y66-CONFIG_EMBEDDED=y66+CONFIG_EXPERT=y77# CONFIG_ELF_CORE is not set88# CONFIG_SHMEM is not set99CONFIG_SLAB=y
+1-1
arch/arm/configs/xcep_defconfig
···88CONFIG_LOG_BUF_SHIFT=1699CONFIG_SYSFS_DEPRECATED_V2=y1010CONFIG_BLK_DEV_INITRD=y1111-CONFIG_EMBEDDED=y1111+CONFIG_EXPERT=y1212# CONFIG_UID16 is not set1313# CONFIG_SHMEM is not set1414# CONFIG_VM_EVENT_COUNTERS is not set
+2-2
arch/arm/mach-msm/board-qsd8x50.c
···4343 * at run-time: they vary from board to board, and the true4444 * configuration won't be known until boot.4545 */4646-static struct resource smc91x_resources[] __initdata = {4646+static struct resource smc91x_resources[] = {4747 [0] = {4848 .flags = IORESOURCE_MEM,4949 },···5252 },5353};54545555-static struct platform_device smc91x_device __initdata = {5555+static struct platform_device smc91x_device = {5656 .name = "smc91x",5757 .id = 0,5858 .num_resources = ARRAY_SIZE(smc91x_resources),
+2-2
arch/avr32/Kconfig
···11config AVR3222 def_bool y33- # With EMBEDDED=n, we get lots of stuff automatically selected33+ # With EXPERT=n, we get lots of stuff automatically selected44 # that we usually don't need on AVR32.55- select EMBEDDED55+ select EXPERT66 select HAVE_CLK77 select HAVE_OPROFILE88 select HAVE_KPROBES
···55CONFIG_LOG_BUF_SHIFT=1466CONFIG_BLK_DEV_INITRD=y77# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set88-CONFIG_EMBEDDED=y88+CONFIG_EXPERT=y99# CONFIG_SYSCTL_SYSCALL is not set1010# CONFIG_ELF_CORE is not set1111# CONFIG_FUTEX is not set
+1-1
arch/blackfin/configs/BF526-EZBRD_defconfig
···55CONFIG_LOG_BUF_SHIFT=1466CONFIG_BLK_DEV_INITRD=y77# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set88-CONFIG_EMBEDDED=y88+CONFIG_EXPERT=y99# CONFIG_SYSCTL_SYSCALL is not set1010# CONFIG_ELF_CORE is not set1111# CONFIG_FUTEX is not set
+1-1
arch/blackfin/configs/BF527-AD7160-EVAL_defconfig
···55CONFIG_LOG_BUF_SHIFT=1466CONFIG_BLK_DEV_INITRD=y77# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set88-CONFIG_EMBEDDED=y88+CONFIG_EXPERT=y99# CONFIG_ELF_CORE is not set1010# CONFIG_AIO is not set1111CONFIG_SLAB=y
+1-1
arch/blackfin/configs/BF527-EZKIT-V2_defconfig
···55CONFIG_LOG_BUF_SHIFT=1466CONFIG_BLK_DEV_INITRD=y77# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set88-CONFIG_EMBEDDED=y88+CONFIG_EXPERT=y99# CONFIG_SYSCTL_SYSCALL is not set1010# CONFIG_ELF_CORE is not set1111# CONFIG_FUTEX is not set
+1-1
arch/blackfin/configs/BF527-EZKIT_defconfig
···55CONFIG_LOG_BUF_SHIFT=1466CONFIG_BLK_DEV_INITRD=y77# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set88-CONFIG_EMBEDDED=y88+CONFIG_EXPERT=y99# CONFIG_SYSCTL_SYSCALL is not set1010# CONFIG_ELF_CORE is not set1111# CONFIG_FUTEX is not set
+1-1
arch/blackfin/configs/BF527-TLL6527M_defconfig
···66CONFIG_LOG_BUF_SHIFT=1477CONFIG_BLK_DEV_INITRD=y88# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set99-CONFIG_EMBEDDED=y99+CONFIG_EXPERT=y1010# CONFIG_SYSCTL_SYSCALL is not set1111# CONFIG_ELF_CORE is not set1212# CONFIG_FUTEX is not set
+1-1
arch/blackfin/configs/BF533-EZKIT_defconfig
···55CONFIG_LOG_BUF_SHIFT=1466CONFIG_BLK_DEV_INITRD=y77# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set88-CONFIG_EMBEDDED=y88+CONFIG_EXPERT=y99# CONFIG_SYSCTL_SYSCALL is not set1010# CONFIG_ELF_CORE is not set1111# CONFIG_FUTEX is not set
+1-1
arch/blackfin/configs/BF533-STAMP_defconfig
···55CONFIG_LOG_BUF_SHIFT=1466CONFIG_BLK_DEV_INITRD=y77# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set88-CONFIG_EMBEDDED=y88+CONFIG_EXPERT=y99# CONFIG_SYSCTL_SYSCALL is not set1010# CONFIG_ELF_CORE is not set1111# CONFIG_FUTEX is not set
+1-1
arch/blackfin/configs/BF537-STAMP_defconfig
···55CONFIG_LOG_BUF_SHIFT=1466CONFIG_BLK_DEV_INITRD=y77# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set88-CONFIG_EMBEDDED=y88+CONFIG_EXPERT=y99# CONFIG_SYSCTL_SYSCALL is not set1010# CONFIG_ELF_CORE is not set1111# CONFIG_FUTEX is not set
+1-1
arch/blackfin/configs/BF538-EZKIT_defconfig
···55CONFIG_LOG_BUF_SHIFT=1466CONFIG_BLK_DEV_INITRD=y77# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set88-CONFIG_EMBEDDED=y88+CONFIG_EXPERT=y99# CONFIG_SYSCTL_SYSCALL is not set1010# CONFIG_ELF_CORE is not set1111# CONFIG_FUTEX is not set
+1-1
arch/blackfin/configs/BF548-EZKIT_defconfig
···55CONFIG_LOG_BUF_SHIFT=1466CONFIG_BLK_DEV_INITRD=y77# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set88-CONFIG_EMBEDDED=y88+CONFIG_EXPERT=y99# CONFIG_SYSCTL_SYSCALL is not set1010# CONFIG_ELF_CORE is not set1111# CONFIG_FUTEX is not set
+1-1
arch/blackfin/configs/BF561-ACVILON_defconfig
···55CONFIG_LOG_BUF_SHIFT=1466CONFIG_SYSFS_DEPRECATED_V2=y77# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set88-CONFIG_EMBEDDED=y88+CONFIG_EXPERT=y99# CONFIG_SYSCTL_SYSCALL is not set1010# CONFIG_ELF_CORE is not set1111# CONFIG_FUTEX is not set
+1-1
arch/blackfin/configs/BF561-EZKIT-SMP_defconfig
···55CONFIG_LOG_BUF_SHIFT=1466CONFIG_BLK_DEV_INITRD=y77# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set88-CONFIG_EMBEDDED=y88+CONFIG_EXPERT=y99# CONFIG_SYSCTL_SYSCALL is not set1010# CONFIG_ELF_CORE is not set1111# CONFIG_FUTEX is not set
+1-1
arch/blackfin/configs/BF561-EZKIT_defconfig
···55CONFIG_LOG_BUF_SHIFT=1466CONFIG_BLK_DEV_INITRD=y77# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set88-CONFIG_EMBEDDED=y88+CONFIG_EXPERT=y99# CONFIG_SYSCTL_SYSCALL is not set1010# CONFIG_ELF_CORE is not set1111# CONFIG_FUTEX is not set
+1-1
arch/blackfin/configs/BlackStamp_defconfig
···66CONFIG_SYSFS_DEPRECATED_V2=y77CONFIG_BLK_DEV_INITRD=y88# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set99-CONFIG_EMBEDDED=y99+CONFIG_EXPERT=y1010# CONFIG_SYSCTL_SYSCALL is not set1111# CONFIG_ELF_CORE is not set1212# CONFIG_FUTEX is not set
+1-1
arch/blackfin/configs/CM-BF527_defconfig
···88# CONFIG_RD_GZIP is not set99CONFIG_RD_LZMA=y1010# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set1111-CONFIG_EMBEDDED=y1111+CONFIG_EXPERT=y1212# CONFIG_SYSCTL_SYSCALL is not set1313# CONFIG_ELF_CORE is not set1414# CONFIG_FUTEX is not set
+1-1
arch/blackfin/configs/CM-BF533_defconfig
···77CONFIG_BLK_DEV_INITRD=y88# CONFIG_RD_GZIP is not set99CONFIG_RD_LZMA=y1010-CONFIG_EMBEDDED=y1010+CONFIG_EXPERT=y1111# CONFIG_UID16 is not set1212# CONFIG_SYSCTL_SYSCALL is not set1313# CONFIG_ELF_CORE is not set
+1-1
arch/blackfin/configs/CM-BF537E_defconfig
···88# CONFIG_RD_GZIP is not set99CONFIG_RD_LZMA=y1010# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set1111-CONFIG_EMBEDDED=y1111+CONFIG_EXPERT=y1212# CONFIG_UID16 is not set1313# CONFIG_SYSCTL_SYSCALL is not set1414# CONFIG_ELF_CORE is not set
+1-1
arch/blackfin/configs/CM-BF537U_defconfig
···88# CONFIG_RD_GZIP is not set99CONFIG_RD_LZMA=y1010# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set1111-CONFIG_EMBEDDED=y1111+CONFIG_EXPERT=y1212# CONFIG_UID16 is not set1313# CONFIG_SYSCTL_SYSCALL is not set1414# CONFIG_ELF_CORE is not set
+1-1
arch/blackfin/configs/CM-BF548_defconfig
···88# CONFIG_RD_GZIP is not set99CONFIG_RD_LZMA=y1010# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set1111-CONFIG_EMBEDDED=y1111+CONFIG_EXPERT=y1212# CONFIG_UID16 is not set1313# CONFIG_SYSCTL_SYSCALL is not set1414# CONFIG_ELF_CORE is not set
+1-1
arch/blackfin/configs/CM-BF561_defconfig
···88# CONFIG_RD_GZIP is not set99CONFIG_RD_LZMA=y1010# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set1111-CONFIG_EMBEDDED=y1111+CONFIG_EXPERT=y1212# CONFIG_UID16 is not set1313# CONFIG_SYSCTL_SYSCALL is not set1414# CONFIG_ELF_CORE is not set
+1-1
arch/blackfin/configs/DNP5370_defconfig
···55CONFIG_IKCONFIG_PROC=y66CONFIG_LOG_BUF_SHIFT=1477CONFIG_BLK_DEV_INITRD=y88-CONFIG_EMBEDDED=y88+CONFIG_EXPERT=y99CONFIG_SLOB=y1010# CONFIG_BLK_DEV_BSG is not set1111# CONFIG_IOSCHED_CFQ is not set
+1-1
arch/blackfin/configs/H8606_defconfig
···22CONFIG_SYSVIPC=y33CONFIG_LOG_BUF_SHIFT=1444# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set55-CONFIG_EMBEDDED=y55+CONFIG_EXPERT=y66# CONFIG_SYSCTL_SYSCALL is not set77# CONFIG_ELF_CORE is not set88# CONFIG_FUTEX is not set
+1-1
arch/blackfin/configs/IP0X_defconfig
···33CONFIG_LOG_BUF_SHIFT=1444CONFIG_BLK_DEV_INITRD=y55# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set66-CONFIG_EMBEDDED=y66+CONFIG_EXPERT=y77# CONFIG_SYSCTL_SYSCALL is not set88# CONFIG_HOTPLUG is not set99# CONFIG_ELF_CORE is not set
+1-1
arch/blackfin/configs/PNAV-10_defconfig
···22CONFIG_SYSVIPC=y33CONFIG_LOG_BUF_SHIFT=1444# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set55-CONFIG_EMBEDDED=y55+CONFIG_EXPERT=y66# CONFIG_SYSCTL_SYSCALL is not set77# CONFIG_ELF_CORE is not set88# CONFIG_FUTEX is not set
+1-1
arch/blackfin/configs/SRV1_defconfig
···33CONFIG_LOG_BUF_SHIFT=1444CONFIG_BLK_DEV_INITRD=y55# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set66-CONFIG_EMBEDDED=y66+CONFIG_EXPERT=y77# CONFIG_SYSCTL_SYSCALL is not set88CONFIG_KALLSYMS_ALL=y99# CONFIG_ELF_CORE is not set
+1-1
arch/blackfin/configs/TCM-BF518_defconfig
···77CONFIG_BLK_DEV_INITRD=y88# CONFIG_RD_GZIP is not set99CONFIG_RD_LZMA=y1010-CONFIG_EMBEDDED=y1010+CONFIG_EXPERT=y1111# CONFIG_SYSCTL_SYSCALL is not set1212# CONFIG_ELF_CORE is not set1313# CONFIG_FUTEX is not set
+1-1
arch/blackfin/configs/TCM-BF537_defconfig
···88# CONFIG_RD_GZIP is not set99CONFIG_RD_LZMA=y1010# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set1111-CONFIG_EMBEDDED=y1111+CONFIG_EXPERT=y1212# CONFIG_UID16 is not set1313# CONFIG_SYSCTL_SYSCALL is not set1414# CONFIG_ELF_CORE is not set
···291291}292292293293294294-static unsigned int startup_crisv32_irq(unsigned int irq)294294+static void enable_crisv32_irq(struct irq_data *data)295295{296296- crisv32_unmask_irq(irq);297297- return 0;296296+ crisv32_unmask_irq(data->irq);298297}299298300300-static void shutdown_crisv32_irq(unsigned int irq)299299+static void disable_crisv32_irq(struct irq_data *data)301300{302302- crisv32_mask_irq(irq);301301+ crisv32_mask_irq(data->irq);303302}304303305305-static void enable_crisv32_irq(unsigned int irq)306306-{307307- crisv32_unmask_irq(irq);308308-}309309-310310-static void disable_crisv32_irq(unsigned int irq)311311-{312312- crisv32_mask_irq(irq);313313-}314314-315315-static void ack_crisv32_irq(unsigned int irq)316316-{317317-}318318-319319-static void end_crisv32_irq(unsigned int irq)320320-{321321-}322322-323323-int set_affinity_crisv32_irq(unsigned int irq, const struct cpumask *dest)304304+static int set_affinity_crisv32_irq(struct irq_data *data,305305+ const struct cpumask *dest, bool force)324306{325307 unsigned long flags;326326- spin_lock_irqsave(&irq_lock, flags);327327- irq_allocations[irq - FIRST_IRQ].mask = *dest;328328- spin_unlock_irqrestore(&irq_lock, flags);329308309309+ spin_lock_irqsave(&irq_lock, flags);310310+ irq_allocations[data->irq - FIRST_IRQ].mask = *dest;311311+ spin_unlock_irqrestore(&irq_lock, flags);330312 return 0;331313}332314333315static struct irq_chip crisv32_irq_type = {334334- .name = "CRISv32",335335- .startup = startup_crisv32_irq,336336- .shutdown = shutdown_crisv32_irq,337337- .enable = enable_crisv32_irq,338338- .disable = disable_crisv32_irq,339339- .ack = ack_crisv32_irq,340340- .end = end_crisv32_irq,341341- .set_affinity = set_affinity_crisv32_irq316316+ .name = "CRISv32",317317+ .irq_shutdown = disable_crisv32_irq,318318+ .irq_enable = enable_crisv32_irq,319319+ .irq_disable = disable_crisv32_irq,320320+ .irq_set_affinity = set_affinity_crisv32_irq,342321};343322344323void···451472452473 /* Point all IRQ's to bad handlers. */453474 for (i = FIRST_IRQ, j = 0; j < NR_IRQS; i++, j++) {454454- irq_desc[j].chip = &crisv32_irq_type;475475+ set_irq_chip_and_handler(j, &crisv32_irq_type,476476+ handle_simple_irq);455477 set_exception_vector(i, interrupt[j]);456478 }457479
+1-1
arch/cris/configs/artpec_3_defconfig
···22# CONFIG_SWAP is not set33CONFIG_LOG_BUF_SHIFT=1444# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set55-CONFIG_EMBEDDED=y55+CONFIG_EXPERT=y66# CONFIG_KALLSYMS is not set77# CONFIG_HOTPLUG is not set88# CONFIG_BLK_DEV_BSG is not set
+1-1
arch/cris/configs/etrax-100lx_v2_defconfig
···22# CONFIG_SWAP is not set33CONFIG_LOG_BUF_SHIFT=1444# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set55-CONFIG_EMBEDDED=y55+CONFIG_EXPERT=y66# CONFIG_KALLSYMS is not set77# CONFIG_HOTPLUG is not set88# CONFIG_BLK_DEV_BSG is not set
+1-1
arch/cris/configs/etraxfs_defconfig
···22# CONFIG_SWAP is not set33CONFIG_LOG_BUF_SHIFT=1444# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set55-CONFIG_EMBEDDED=y55+CONFIG_EXPERT=y66# CONFIG_KALLSYMS is not set77# CONFIG_HOTPLUG is not set88# CONFIG_BLK_DEV_BSG is not set
···33CONFIG_POSIX_MQUEUE=y44CONFIG_LOG_BUF_SHIFT=1455# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set66-CONFIG_EMBEDDED=y66+CONFIG_EXPERT=y77# CONFIG_HOTPLUG is not set88CONFIG_MMU=y99CONFIG_FRV_OUTOFLINE_ATOMIC_OPS=y
···11CONFIG_EXPERIMENTAL=y22# CONFIG_LOCALVERSION_AUTO is not set33CONFIG_LOG_BUF_SHIFT=1444-CONFIG_EMBEDDED=y44+CONFIG_EXPERT=y55# CONFIG_UID16 is not set66# CONFIG_SYSCTL_SYSCALL is not set77# CONFIG_KALLSYMS is not set
···55CONFIG_IKCONFIG_PROC=y66CONFIG_LOG_BUF_SHIFT=1577# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set88-CONFIG_EMBEDDED=y88+CONFIG_EXPERT=y99# CONFIG_KALLSYMS is not set1010# CONFIG_FUTEX is not set1111# CONFIG_EPOLL is not set
+1-1
arch/m32r/configs/m32700ut.up_defconfig
···55CONFIG_IKCONFIG_PROC=y66CONFIG_LOG_BUF_SHIFT=1477# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set88-CONFIG_EMBEDDED=y88+CONFIG_EXPERT=y99# CONFIG_KALLSYMS is not set1010# CONFIG_FUTEX is not set1111# CONFIG_EPOLL is not set
+1-1
arch/m32r/configs/mappi.nommu_defconfig
···33CONFIG_IKCONFIG=y44CONFIG_LOG_BUF_SHIFT=1455# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set66-CONFIG_EMBEDDED=y66+CONFIG_EXPERT=y77# CONFIG_KALLSYMS is not set88# CONFIG_FUTEX is not set99# CONFIG_EPOLL is not set
+1-1
arch/m32r/configs/mappi.smp_defconfig
···55CONFIG_LOG_BUF_SHIFT=1566CONFIG_BLK_DEV_INITRD=y77# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set88-CONFIG_EMBEDDED=y88+CONFIG_EXPERT=y99# CONFIG_KALLSYMS is not set1010# CONFIG_FUTEX is not set1111# CONFIG_EPOLL is not set
+1-1
arch/m32r/configs/mappi.up_defconfig
···55CONFIG_LOG_BUF_SHIFT=1466CONFIG_BLK_DEV_INITRD=y77# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set88-CONFIG_EMBEDDED=y88+CONFIG_EXPERT=y99# CONFIG_KALLSYMS is not set1010# CONFIG_FUTEX is not set1111# CONFIG_EPOLL is not set
+1-1
arch/m32r/configs/mappi2.opsp_defconfig
···44CONFIG_IKCONFIG=y55CONFIG_LOG_BUF_SHIFT=1466# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set77-CONFIG_EMBEDDED=y77+CONFIG_EXPERT=y88# CONFIG_KALLSYMS is not set99# CONFIG_FUTEX is not set1010# CONFIG_EPOLL is not set
+1-1
arch/m32r/configs/mappi2.vdec2_defconfig
···44CONFIG_IKCONFIG=y55CONFIG_LOG_BUF_SHIFT=1466# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set77-CONFIG_EMBEDDED=y77+CONFIG_EXPERT=y88# CONFIG_KALLSYMS is not set99# CONFIG_FUTEX is not set1010# CONFIG_EPOLL is not set
+1-1
arch/m32r/configs/mappi3.smp_defconfig
···55CONFIG_LOG_BUF_SHIFT=1566CONFIG_BLK_DEV_INITRD=y77# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set88-CONFIG_EMBEDDED=y88+CONFIG_EXPERT=y99# CONFIG_KALLSYMS is not set1010# CONFIG_FUTEX is not set1111# CONFIG_EPOLL is not set
+1-1
arch/m32r/configs/oaks32r_defconfig
···22CONFIG_BSD_PROCESS_ACCT=y33CONFIG_LOG_BUF_SHIFT=1444# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set55-CONFIG_EMBEDDED=y55+CONFIG_EXPERT=y66# CONFIG_KALLSYMS is not set77# CONFIG_FUTEX is not set88# CONFIG_EPOLL is not set
+1-1
arch/m32r/configs/opsput_defconfig
···44CONFIG_IKCONFIG=y55CONFIG_LOG_BUF_SHIFT=1466# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set77-CONFIG_EMBEDDED=y77+CONFIG_EXPERT=y88# CONFIG_KALLSYMS is not set99# CONFIG_FUTEX is not set1010# CONFIG_EPOLL is not set
+1-1
arch/m32r/configs/usrv_defconfig
···55CONFIG_LOG_BUF_SHIFT=1566CONFIG_BLK_DEV_INITRD=y77# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set88-CONFIG_EMBEDDED=y88+CONFIG_EXPERT=y99CONFIG_KALLSYMS_EXTRA_PASS=y1010CONFIG_SLAB=y1111CONFIG_MODULES=y
···11CONFIG_EXPERIMENTAL=y22CONFIG_LOG_BUF_SHIFT=1433# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set44-CONFIG_EMBEDDED=y44+CONFIG_EXPERT=y55# CONFIG_KALLSYMS is not set66# CONFIG_HOTPLUG is not set77# CONFIG_FUTEX is not set
+1-1
arch/m68knommu/configs/m5249evb_defconfig
···11CONFIG_EXPERIMENTAL=y22CONFIG_LOG_BUF_SHIFT=1433# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set44-CONFIG_EMBEDDED=y44+CONFIG_EXPERT=y55# CONFIG_KALLSYMS is not set66# CONFIG_HOTPLUG is not set77# CONFIG_FUTEX is not set
+1-1
arch/m68knommu/configs/m5272c3_defconfig
···11CONFIG_EXPERIMENTAL=y22CONFIG_LOG_BUF_SHIFT=1433# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set44-CONFIG_EMBEDDED=y44+CONFIG_EXPERT=y55# CONFIG_KALLSYMS is not set66# CONFIG_HOTPLUG is not set77# CONFIG_FUTEX is not set
+1-1
arch/m68knommu/configs/m5275evb_defconfig
···11CONFIG_EXPERIMENTAL=y22CONFIG_LOG_BUF_SHIFT=1433# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set44-CONFIG_EMBEDDED=y44+CONFIG_EXPERT=y55# CONFIG_KALLSYMS is not set66# CONFIG_HOTPLUG is not set77# CONFIG_FUTEX is not set
+1-1
arch/m68knommu/configs/m5307c3_defconfig
···11CONFIG_EXPERIMENTAL=y22CONFIG_LOG_BUF_SHIFT=1433# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set44-CONFIG_EMBEDDED=y44+CONFIG_EXPERT=y55# CONFIG_KALLSYMS is not set66# CONFIG_HOTPLUG is not set77# CONFIG_FUTEX is not set
+1-1
arch/m68knommu/configs/m5407c3_defconfig
···11CONFIG_EXPERIMENTAL=y22CONFIG_LOG_BUF_SHIFT=1433# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set44-CONFIG_EMBEDDED=y44+CONFIG_EXPERT=y55# CONFIG_KALLSYMS is not set66# CONFIG_HOTPLUG is not set77# CONFIG_FUTEX is not set
+1-1
arch/m68knommu/defconfig
···11CONFIG_EXPERIMENTAL=y22CONFIG_LOG_BUF_SHIFT=1433# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set44-CONFIG_EMBEDDED=y44+CONFIG_EXPERT=y55# CONFIG_KALLSYMS is not set66# CONFIG_HOTPLUG is not set77# CONFIG_FUTEX is not set
···77CONFIG_INITRAMFS_SOURCE="rootfs.cpio"88CONFIG_INITRAMFS_COMPRESSION_GZIP=y99# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set1010-CONFIG_EMBEDDED=y1010+CONFIG_EXPERT=y1111CONFIG_KALLSYMS_ALL=y1212CONFIG_KALLSYMS_EXTRA_PASS=y1313# CONFIG_HOTPLUG is not set
+1-1
arch/microblaze/configs/nommu_defconfig
···66CONFIG_IKCONFIG=y77CONFIG_IKCONFIG_PROC=y88CONFIG_SYSFS_DEPRECATED_V2=y99-CONFIG_EMBEDDED=y99+CONFIG_EXPERT=y1010CONFIG_KALLSYMS_ALL=y1111CONFIG_KALLSYMS_EXTRA_PASS=y1212# CONFIG_HOTPLUG is not set
-3
arch/mips/Kconfig
···793793 bool794794 default y795795796796-config GENERIC_HARDIRQS_NO__DO_IRQ797797- def_bool y798798-799796#800797# Select some configuration options automatically based on user selections.801798#
+1-1
arch/mips/Kconfig.debug
···77source "lib/Kconfig.debug"8899config EARLY_PRINTK1010- bool "Early printk" if EMBEDDED1010+ bool "Early printk" if EXPERT1111 depends on SYS_HAS_EARLY_PRINTK1212 default y1313 help
+1-1
arch/mips/configs/ar7_defconfig
···1414CONFIG_RELAY=y1515CONFIG_BLK_DEV_INITRD=y1616CONFIG_RD_LZMA=y1717-CONFIG_EMBEDDED=y1717+CONFIG_EXPERT=y1818# CONFIG_KALLSYMS is not set1919# CONFIG_ELF_CORE is not set2020# CONFIG_PCSPKR_PLATFORM is not set
···1010# CONFIG_SWAP is not set1111CONFIG_TINY_RCU=y1212CONFIG_SYSFS_DEPRECATED_V2=y1313-CONFIG_EMBEDDED=y1313+CONFIG_EXPERT=y1414# CONFIG_PCSPKR_PLATFORM is not set1515# CONFIG_FUTEX is not set1616# CONFIG_EPOLL is not set
+1-1
arch/mips/configs/bigsur_defconfig
···2626CONFIG_NET_NS=y2727CONFIG_BLK_DEV_INITRD=y2828# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set2929-CONFIG_EMBEDDED=y2929+CONFIG_EXPERT=y3030# CONFIG_SYSCTL_SYSCALL is not set3131# CONFIG_PCSPKR_PLATFORM is not set3232CONFIG_SLAB=y
+1-1
arch/mips/configs/capcella_defconfig
···44CONFIG_SYSVIPC=y55CONFIG_LOG_BUF_SHIFT=1466# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set77-CONFIG_EMBEDDED=y77+CONFIG_EXPERT=y88CONFIG_SLAB=y99CONFIG_MODULES=y1010CONFIG_MODULE_UNLOAD=y
+1-1
arch/mips/configs/cavium-octeon_defconfig
···1515CONFIG_RELAY=y1616CONFIG_BLK_DEV_INITRD=y1717# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set1818-CONFIG_EMBEDDED=y1818+CONFIG_EXPERT=y1919# CONFIG_PCSPKR_PLATFORM is not set2020CONFIG_SLAB=y2121CONFIG_MODULES=y
+1-1
arch/mips/configs/cobalt_defconfig
···44CONFIG_LOG_BUF_SHIFT=1455CONFIG_RELAY=y66# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set77-CONFIG_EMBEDDED=y77+CONFIG_EXPERT=y88CONFIG_MODULES=y99CONFIG_MODULE_UNLOAD=y1010# CONFIG_BLK_DEV_BSG is not set
+1-1
arch/mips/configs/db1000_defconfig
···1111CONFIG_TINY_RCU=y1212CONFIG_LOG_BUF_SHIFT=141313# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set1414-CONFIG_EMBEDDED=y1414+CONFIG_EXPERT=y1515# CONFIG_KALLSYMS is not set1616# CONFIG_PCSPKR_PLATFORM is not set1717# CONFIG_VM_EVENT_COUNTERS is not set
+1-1
arch/mips/configs/db1100_defconfig
···1111CONFIG_POSIX_MQUEUE=y1212CONFIG_TINY_RCU=y1313CONFIG_LOG_BUF_SHIFT=141414-CONFIG_EMBEDDED=y1414+CONFIG_EXPERT=y1515# CONFIG_SYSCTL_SYSCALL is not set1616# CONFIG_KALLSYMS is not set1717# CONFIG_PCSPKR_PLATFORM is not set
+1-1
arch/mips/configs/db1200_defconfig
···1212CONFIG_POSIX_MQUEUE=y1313CONFIG_TINY_RCU=y1414CONFIG_LOG_BUF_SHIFT=141515-CONFIG_EMBEDDED=y1515+CONFIG_EXPERT=y1616# CONFIG_SYSCTL_SYSCALL is not set1717# CONFIG_KALLSYMS is not set1818# CONFIG_PCSPKR_PLATFORM is not set
+1-1
arch/mips/configs/db1500_defconfig
···1010CONFIG_KERNEL_LZMA=y1111CONFIG_SYSVIPC=y1212CONFIG_LOG_BUF_SHIFT=141313-CONFIG_EMBEDDED=y1313+CONFIG_EXPERT=y1414# CONFIG_KALLSYMS is not set1515# CONFIG_PCSPKR_PLATFORM is not set1616# CONFIG_VM_EVENT_COUNTERS is not set
+1-1
arch/mips/configs/db1550_defconfig
···1111CONFIG_POSIX_MQUEUE=y1212CONFIG_TINY_RCU=y1313CONFIG_LOG_BUF_SHIFT=141414-CONFIG_EMBEDDED=y1414+CONFIG_EXPERT=y1515# CONFIG_SYSCTL_SYSCALL is not set1616# CONFIG_KALLSYMS is not set1717# CONFIG_PCSPKR_PLATFORM is not set
+1-1
arch/mips/configs/decstation_defconfig
···44CONFIG_SYSVIPC=y55CONFIG_LOG_BUF_SHIFT=1466# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set77-CONFIG_EMBEDDED=y77+CONFIG_EXPERT=y88# CONFIG_SYSCTL_SYSCALL is not set99# CONFIG_HOTPLUG is not set1010CONFIG_SLAB=y
+1-1
arch/mips/configs/e55_defconfig
···44CONFIG_SYSVIPC=y55CONFIG_LOG_BUF_SHIFT=1466# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set77-CONFIG_EMBEDDED=y77+CONFIG_EXPERT=y88# CONFIG_HOTPLUG is not set99CONFIG_SLAB=y1010CONFIG_MODULES=y
+1-1
arch/mips/configs/fuloong2e_defconfig
···1717CONFIG_USER_NS=y1818CONFIG_PID_NS=y1919# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set2020-CONFIG_EMBEDDED=y2020+CONFIG_EXPERT=y2121# CONFIG_PCSPKR_PLATFORM is not set2222# CONFIG_COMPAT_BRK is not set2323CONFIG_SLAB=y
+1-1
arch/mips/configs/gpr_defconfig
···1111CONFIG_RELAY=y1212CONFIG_BLK_DEV_INITRD=y1313# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set1414-CONFIG_EMBEDDED=y1414+CONFIG_EXPERT=y1515CONFIG_SLAB=y1616CONFIG_PROFILING=y1717CONFIG_MODULES=y
+1-1
arch/mips/configs/ip22_defconfig
···1717CONFIG_USER_NS=y1818CONFIG_PID_NS=y1919# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set2020-CONFIG_EMBEDDED=y2020+CONFIG_EXPERT=y2121# CONFIG_HOTPLUG is not set2222# CONFIG_PCSPKR_PLATFORM is not set2323# CONFIG_COMPAT_BRK is not set
+1-1
arch/mips/configs/ip27_defconfig
···1515CONFIG_CPUSETS=y1616CONFIG_RELAY=y1717# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set1818-CONFIG_EMBEDDED=y1818+CONFIG_EXPERT=y1919# CONFIG_PCSPKR_PLATFORM is not set2020CONFIG_SLAB=y2121CONFIG_MODULES=y
+1-1
arch/mips/configs/ip28_defconfig
···88CONFIG_LOG_BUF_SHIFT=1499CONFIG_RELAY=y1010# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set1111-CONFIG_EMBEDDED=y1111+CONFIG_EXPERT=y1212# CONFIG_HOTPLUG is not set1313CONFIG_SLAB=y1414CONFIG_MODULES=y
···1010CONFIG_LOG_BUF_SHIFT=141111CONFIG_RELAY=y1212# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set1313-CONFIG_EMBEDDED=y1313+CONFIG_EXPERT=y1414# CONFIG_SYSCTL_SYSCALL is not set1515CONFIG_SLAB=y1616CONFIG_MODULES=y
+1-1
arch/mips/configs/jmr3927_defconfig
···44CONFIG_SYSVIPC=y55CONFIG_LOG_BUF_SHIFT=1466CONFIG_SYSFS_DEPRECATED_V2=y77-CONFIG_EMBEDDED=y77+CONFIG_EXPERT=y88# CONFIG_HOTPLUG is not set99# CONFIG_PCSPKR_PLATFORM is not set1010CONFIG_SLAB=y
+1-1
arch/mips/configs/lasat_defconfig
···88CONFIG_EXPERIMENTAL=y99CONFIG_SYSVIPC=y1010CONFIG_LOG_BUF_SHIFT=141111-CONFIG_EMBEDDED=y1111+CONFIG_EXPERT=y1212# CONFIG_SYSCTL_SYSCALL is not set1313# CONFIG_KALLSYMS is not set1414# CONFIG_HOTPLUG is not set
+1-1
arch/mips/configs/lemote2f_defconfig
···2121CONFIG_RD_BZIP2=y2222CONFIG_RD_LZMA=y2323# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set2424-CONFIG_EMBEDDED=y2424+CONFIG_EXPERT=y2525CONFIG_PROFILING=y2626CONFIG_OPROFILE=m2727CONFIG_MODULES=y
+1-1
arch/mips/configs/malta_defconfig
···1515CONFIG_IPC_NS=y1616CONFIG_PID_NS=y1717# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set1818-CONFIG_EMBEDDED=y1818+CONFIG_EXPERT=y1919# CONFIG_SYSCTL_SYSCALL is not set2020# CONFIG_COMPAT_BRK is not set2121CONFIG_SLAB=y
+1-1
arch/mips/configs/markeins_defconfig
···99CONFIG_IKCONFIG_PROC=y1010CONFIG_LOG_BUF_SHIFT=141111# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set1212-CONFIG_EMBEDDED=y1212+CONFIG_EXPERT=y1313CONFIG_SLAB=y1414CONFIG_MODULES=y1515CONFIG_MODULE_UNLOAD=y
+1-1
arch/mips/configs/mipssim_defconfig
···77CONFIG_SYSVIPC=y88CONFIG_LOG_BUF_SHIFT=1499# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set1010-CONFIG_EMBEDDED=y1010+CONFIG_EXPERT=y1111CONFIG_SLAB=y1212CONFIG_MODULES=y1313CONFIG_MODULE_UNLOAD=y
+1-1
arch/mips/configs/mpc30x_defconfig
···55CONFIG_LOG_BUF_SHIFT=1466CONFIG_RELAY=y77# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set88-CONFIG_EMBEDDED=y88+CONFIG_EXPERT=y99CONFIG_SLAB=y1010CONFIG_MODULES=y1111CONFIG_MODULE_UNLOAD=y
+1-1
arch/mips/configs/msp71xx_defconfig
···88CONFIG_SYSVIPC=y99CONFIG_LOG_BUF_SHIFT=141010# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set1111-CONFIG_EMBEDDED=y1111+CONFIG_EXPERT=y1212# CONFIG_SHMEM is not set1313CONFIG_SLAB=y1414CONFIG_MODULES=y
+1-1
arch/mips/configs/mtx1_defconfig
···1111CONFIG_RELAY=y1212CONFIG_BLK_DEV_INITRD=y1313# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set1414-CONFIG_EMBEDDED=y1414+CONFIG_EXPERT=y1515CONFIG_SLAB=y1616CONFIG_PROFILING=y1717CONFIG_OPROFILE=m
+1-1
arch/mips/configs/pb1100_defconfig
···1111CONFIG_POSIX_MQUEUE=y1212CONFIG_TINY_RCU=y1313CONFIG_LOG_BUF_SHIFT=141414-CONFIG_EMBEDDED=y1414+CONFIG_EXPERT=y1515# CONFIG_SYSCTL_SYSCALL is not set1616# CONFIG_KALLSYMS is not set1717# CONFIG_PCSPKR_PLATFORM is not set
+1-1
arch/mips/configs/pb1200_defconfig
···1212CONFIG_POSIX_MQUEUE=y1313CONFIG_TINY_RCU=y1414CONFIG_LOG_BUF_SHIFT=141515-CONFIG_EMBEDDED=y1515+CONFIG_EXPERT=y1616# CONFIG_SYSCTL_SYSCALL is not set1717# CONFIG_KALLSYMS is not set1818# CONFIG_PCSPKR_PLATFORM is not set
+1-1
arch/mips/configs/pb1500_defconfig
···1111CONFIG_POSIX_MQUEUE=y1212CONFIG_TINY_RCU=y1313CONFIG_LOG_BUF_SHIFT=141414-CONFIG_EMBEDDED=y1414+CONFIG_EXPERT=y1515# CONFIG_SYSCTL_SYSCALL is not set1616# CONFIG_KALLSYMS is not set1717# CONFIG_PCSPKR_PLATFORM is not set
+1-1
arch/mips/configs/pb1550_defconfig
···1111CONFIG_POSIX_MQUEUE=y1212CONFIG_TINY_RCU=y1313CONFIG_LOG_BUF_SHIFT=141414-CONFIG_EMBEDDED=y1414+CONFIG_EXPERT=y1515# CONFIG_SYSCTL_SYSCALL is not set1616# CONFIG_KALLSYMS is not set1717# CONFIG_PCSPKR_PLATFORM is not set
···66CONFIG_LOG_BUF_SHIFT=1477CONFIG_BLK_DEV_INITRD=y88# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set99-CONFIG_EMBEDDED=y99+CONFIG_EXPERT=y1010# CONFIG_SYSCTL_SYSCALL is not set1111CONFIG_SLAB=y1212CONFIG_MODULES=y
+1-1
arch/mips/configs/pnx8550-stb810_defconfig
···66CONFIG_LOG_BUF_SHIFT=1477CONFIG_BLK_DEV_INITRD=y88# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set99-CONFIG_EMBEDDED=y99+CONFIG_EXPERT=y1010# CONFIG_SYSCTL_SYSCALL is not set1111# CONFIG_HOTPLUG is not set1212CONFIG_SLAB=y
+1-1
arch/mips/configs/powertv_defconfig
···1414CONFIG_BLK_DEV_INITRD=y1515# CONFIG_RD_GZIP is not set1616# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set1717-CONFIG_EMBEDDED=y1717+CONFIG_EXPERT=y1818# CONFIG_SYSCTL_SYSCALL is not set1919CONFIG_KALLSYMS_ALL=y2020# CONFIG_PCSPKR_PLATFORM is not set
+1-1
arch/mips/configs/rb532_defconfig
···1313CONFIG_LOG_BUF_SHIFT=141414CONFIG_SYSFS_DEPRECATED_V2=y1515CONFIG_BLK_DEV_INITRD=y1616-CONFIG_EMBEDDED=y1616+CONFIG_EXPERT=y1717# CONFIG_KALLSYMS is not set1818# CONFIG_ELF_CORE is not set1919# CONFIG_VM_EVENT_COUNTERS is not set
+1-1
arch/mips/configs/rbtx49xx_defconfig
···1212CONFIG_LOG_BUF_SHIFT=141313CONFIG_SYSFS_DEPRECATED_V2=y1414CONFIG_BLK_DEV_INITRD=y1515-CONFIG_EMBEDDED=y1515+CONFIG_EXPERT=y1616# CONFIG_HOTPLUG is not set1717# CONFIG_PCSPKR_PLATFORM is not set1818# CONFIG_EPOLL is not set
+1-1
arch/mips/configs/rm200_defconfig
···1212CONFIG_LOG_BUF_SHIFT=141313CONFIG_RELAY=y1414# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set1515-CONFIG_EMBEDDED=y1515+CONFIG_EXPERT=y1616CONFIG_SLAB=y1717CONFIG_MODULES=y1818CONFIG_MODULE_UNLOAD=y
+1-1
arch/mips/configs/sb1250-swarm_defconfig
···1515CONFIG_NAMESPACES=y1616CONFIG_BLK_DEV_INITRD=y1717# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set1818-CONFIG_EMBEDDED=y1818+CONFIG_EXPERT=y1919# CONFIG_COMPAT_BRK is not set2020CONFIG_SLAB=y2121CONFIG_MODULES=y
+1-1
arch/mips/configs/tb0219_defconfig
···55CONFIG_LOG_BUF_SHIFT=1466CONFIG_SYSFS_DEPRECATED_V2=y77# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set88-CONFIG_EMBEDDED=y88+CONFIG_EXPERT=y99# CONFIG_PCSPKR_PLATFORM is not set1010CONFIG_SLAB=y1111CONFIG_MODULES=y
+1-1
arch/mips/configs/tb0226_defconfig
···55CONFIG_LOG_BUF_SHIFT=1466CONFIG_SYSFS_DEPRECATED_V2=y77# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set88-CONFIG_EMBEDDED=y88+CONFIG_EXPERT=y99# CONFIG_PCSPKR_PLATFORM is not set1010CONFIG_SLAB=y1111CONFIG_MODULES=y
+1-1
arch/mips/configs/tb0287_defconfig
···44CONFIG_LOG_BUF_SHIFT=1455CONFIG_SYSFS_DEPRECATED_V2=y66# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set77-CONFIG_EMBEDDED=y77+CONFIG_EXPERT=y88# CONFIG_SYSCTL_SYSCALL is not set99# CONFIG_PCSPKR_PLATFORM is not set1010CONFIG_SLAB=y
+1-1
arch/mips/configs/workpad_defconfig
···44CONFIG_SYSVIPC=y55CONFIG_LOG_BUF_SHIFT=1466# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set77-CONFIG_EMBEDDED=y77+CONFIG_EXPERT=y88CONFIG_SLAB=y99CONFIG_MODULES=y1010CONFIG_MODULE_UNLOAD=y
+1-1
arch/mips/configs/wrppmc_defconfig
···77CONFIG_LOG_BUF_SHIFT=1488CONFIG_BLK_DEV_INITRD=y99# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set1010-CONFIG_EMBEDDED=y1010+CONFIG_EXPERT=y1111CONFIG_KALLSYMS_EXTRA_PASS=y1212# CONFIG_EPOLL is not set1313CONFIG_SLAB=y
···44CONFIG_TINY_RCU=y55CONFIG_LOG_BUF_SHIFT=1466# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set77-CONFIG_EMBEDDED=y77+CONFIG_EXPERT=y88# CONFIG_KALLSYMS is not set99# CONFIG_HOTPLUG is not set1010# CONFIG_VM_EVENT_COUNTERS is not set
+1-1
arch/mn10300/configs/asb2364_defconfig
···1515CONFIG_RESOURCE_COUNTERS=y1616CONFIG_RELAY=y1717# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set1818-CONFIG_EMBEDDED=y1818+CONFIG_EXPERT=y1919# CONFIG_KALLSYMS is not set2020# CONFIG_VM_EVENT_COUNTERS is not set2121CONFIG_SLAB=y
+4-14
arch/parisc/Kconfig
···1212 select HAVE_IRQ_WORK1313 select HAVE_PERF_EVENTS1414 select GENERIC_ATOMIC64 if !64BIT1515- select GENERIC_HARDIRQS_NO__DO_IRQ1515+ select HAVE_GENERIC_HARDIRQS1616+ select GENERIC_IRQ_PROBE1717+ select IRQ_PER_CPU1818+1619 help1720 The PA-RISC microprocessor is designed by Hewlett-Packard and used1821 in many of their workstations & servers (HP9000 700 and 800 series,···6966 depends on SMP7067 default y71687272-config GENERIC_HARDIRQS7373- def_bool y7474-7575-config GENERIC_IRQ_PROBE7676- def_bool y7777-7869config HAVE_LATENCYTOP_SUPPORT7970 def_bool y8080-8181-config IRQ_PER_CPU8282- bool8383- default y8484-8585-config GENERIC_HARDIRQS_NO__DO_IRQ8686- def_bool y87718872# unless you want to implement ACPI on PA-RISC ... ;-)8973config PM
+1-1
arch/parisc/configs/a500_defconfig
···88CONFIG_SYSFS_DEPRECATED_V2=y99CONFIG_BLK_DEV_INITRD=y1010# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set1111-CONFIG_EMBEDDED=y1111+CONFIG_EXPERT=y1212CONFIG_KALLSYMS_ALL=y1313CONFIG_SLAB=y1414CONFIG_PROFILING=y
+1-1
arch/parisc/configs/c3000_defconfig
···66CONFIG_LOG_BUF_SHIFT=1677CONFIG_SYSFS_DEPRECATED_V2=y88# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set99-CONFIG_EMBEDDED=y99+CONFIG_EXPERT=y1010CONFIG_KALLSYMS_ALL=y1111CONFIG_SLAB=y1212CONFIG_PROFILING=y
+3-25
arch/powerpc/Kconfig
···3636config GENERIC_CLOCKEVENTS3737 def_bool y38383939-config GENERIC_HARDIRQS4040- bool4141- default y4242-4343-config GENERIC_HARDIRQS_NO__DO_IRQ4444- bool4545- default y4646-4739config HAVE_SETUP_PER_CPU_AREA4840 def_bool PPC6449415042config NEED_PER_CPU_EMBED_FIRST_CHUNK5143 def_bool PPC645252-5353-config IRQ_PER_CPU5454- bool5555- default y56445745config NR_IRQS5846 int "Number of virtual interrupt numbers"···131143 select HAVE_PERF_EVENTS132144 select HAVE_REGS_AND_STACK_ACCESS_API133145 select HAVE_HW_BREAKPOINT if PERF_EVENTS && PPC_BOOK3S_64146146+ select HAVE_GENERIC_HARDIRQS147147+ select HAVE_SPARSE_IRQ148148+ select IRQ_PER_CPU134149135150config EARLY_PRINTK136151 bool···382391 multiple CPUs. Saying N here will route all IRQs to the first383392 CPU. Generally saying Y is safe, although some problems have been384393 reported with SMP Power Macintoshes with this option enabled.385385-386386-config SPARSE_IRQ387387- bool "Support sparse irq numbering"388388- default n389389- help390390- This enables support for sparse irqs. This is useful for distro391391- kernels that want to define a high CONFIG_NR_CPUS value but still392392- want to have low kernel memory footprint on smaller machines.393393-394394- ( Sparse IRQs can also be beneficial on NUMA boxes, as they spread395395- out the irq_desc[] array in a more NUMA-friendly way. )396396-397397- If you don't know what to do here, say N.398394399395config NUMA400396 bool "NUMA support"
···55CONFIG_LOG_BUF_SHIFT=1466CONFIG_BLK_DEV_INITRD=y77# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set88-CONFIG_EMBEDDED=y88+CONFIG_EXPERT=y99CONFIG_KALLSYMS_ALL=y1010CONFIG_KALLSYMS_EXTRA_PASS=y1111CONFIG_MODULES=y
+1-1
arch/powerpc/configs/40x/ep405_defconfig
···55CONFIG_LOG_BUF_SHIFT=1466CONFIG_BLK_DEV_INITRD=y77# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set88-CONFIG_EMBEDDED=y88+CONFIG_EXPERT=y99CONFIG_KALLSYMS_ALL=y1010CONFIG_KALLSYMS_EXTRA_PASS=y1111CONFIG_MODULES=y
+1-1
arch/powerpc/configs/40x/hcu4_defconfig
···55CONFIG_LOG_BUF_SHIFT=1466CONFIG_BLK_DEV_INITRD=y77# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set88-CONFIG_EMBEDDED=y88+CONFIG_EXPERT=y99CONFIG_KALLSYMS_ALL=y1010CONFIG_KALLSYMS_EXTRA_PASS=y1111CONFIG_MODULES=y
+1-1
arch/powerpc/configs/40x/kilauea_defconfig
···55CONFIG_LOG_BUF_SHIFT=1466CONFIG_BLK_DEV_INITRD=y77# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set88-CONFIG_EMBEDDED=y88+CONFIG_EXPERT=y99CONFIG_KALLSYMS_ALL=y1010CONFIG_KALLSYMS_EXTRA_PASS=y1111CONFIG_MODULES=y
+1-1
arch/powerpc/configs/40x/makalu_defconfig
···55CONFIG_LOG_BUF_SHIFT=1466CONFIG_BLK_DEV_INITRD=y77# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set88-CONFIG_EMBEDDED=y88+CONFIG_EXPERT=y99CONFIG_KALLSYMS_ALL=y1010CONFIG_KALLSYMS_EXTRA_PASS=y1111CONFIG_MODULES=y
+1-1
arch/powerpc/configs/40x/walnut_defconfig
···55CONFIG_LOG_BUF_SHIFT=1466CONFIG_BLK_DEV_INITRD=y77# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set88-CONFIG_EMBEDDED=y88+CONFIG_EXPERT=y99CONFIG_KALLSYMS_ALL=y1010CONFIG_KALLSYMS_EXTRA_PASS=y1111CONFIG_MODULES=y
+1-1
arch/powerpc/configs/44x/arches_defconfig
···55CONFIG_LOG_BUF_SHIFT=1466CONFIG_BLK_DEV_INITRD=y77# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set88-CONFIG_EMBEDDED=y88+CONFIG_EXPERT=y99CONFIG_MODULES=y1010CONFIG_MODULE_UNLOAD=y1111# CONFIG_BLK_DEV_BSG is not set
+1-1
arch/powerpc/configs/44x/bamboo_defconfig
···55CONFIG_LOG_BUF_SHIFT=1466CONFIG_BLK_DEV_INITRD=y77# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set88-CONFIG_EMBEDDED=y88+CONFIG_EXPERT=y99CONFIG_MODULES=y1010CONFIG_MODULE_UNLOAD=y1111# CONFIG_BLK_DEV_BSG is not set
+1-1
arch/powerpc/configs/44x/bluestone_defconfig
···44CONFIG_POSIX_MQUEUE=y55CONFIG_LOG_BUF_SHIFT=1466CONFIG_BLK_DEV_INITRD=y77-CONFIG_EMBEDDED=y77+CONFIG_EXPERT=y88# CONFIG_VM_EVENT_COUNTERS is not set99# CONFIG_PCI_QUIRKS is not set1010# CONFIG_COMPAT_BRK is not set
+1-1
arch/powerpc/configs/44x/canyonlands_defconfig
···55CONFIG_LOG_BUF_SHIFT=1466CONFIG_BLK_DEV_INITRD=y77# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set88-CONFIG_EMBEDDED=y88+CONFIG_EXPERT=y99CONFIG_MODULES=y1010CONFIG_MODULE_UNLOAD=y1111# CONFIG_BLK_DEV_BSG is not set
+1-1
arch/powerpc/configs/44x/ebony_defconfig
···55CONFIG_LOG_BUF_SHIFT=1466CONFIG_BLK_DEV_INITRD=y77# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set88-CONFIG_EMBEDDED=y88+CONFIG_EXPERT=y99CONFIG_KALLSYMS_ALL=y1010CONFIG_KALLSYMS_EXTRA_PASS=y1111CONFIG_MODULES=y
+1-1
arch/powerpc/configs/44x/eiger_defconfig
···55CONFIG_LOG_BUF_SHIFT=1466CONFIG_BLK_DEV_INITRD=y77# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set88-CONFIG_EMBEDDED=y88+CONFIG_EXPERT=y99CONFIG_MODULES=y1010CONFIG_MODULE_UNLOAD=y1111# CONFIG_BLK_DEV_BSG is not set
+1-1
arch/powerpc/configs/44x/icon_defconfig
···66CONFIG_SYSFS_DEPRECATED_V2=y77CONFIG_BLK_DEV_INITRD=y88# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set99-CONFIG_EMBEDDED=y99+CONFIG_EXPERT=y1010CONFIG_MODULES=y1111CONFIG_MODULE_UNLOAD=y1212# CONFIG_BLK_DEV_BSG is not set
+1-1
arch/powerpc/configs/44x/iss476-smp_defconfig
···77CONFIG_SYSFS_DEPRECATED_V2=y88CONFIG_BLK_DEV_INITRD=y99# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set1010-CONFIG_EMBEDDED=y1010+CONFIG_EXPERT=y1111CONFIG_KALLSYMS_ALL=y1212CONFIG_KALLSYMS_EXTRA_PASS=y1313CONFIG_PROFILING=y
+1-1
arch/powerpc/configs/44x/katmai_defconfig
···55CONFIG_LOG_BUF_SHIFT=1466CONFIG_BLK_DEV_INITRD=y77# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set88-CONFIG_EMBEDDED=y88+CONFIG_EXPERT=y99CONFIG_MODULES=y1010CONFIG_MODULE_UNLOAD=y1111# CONFIG_BLK_DEV_BSG is not set
+1-1
arch/powerpc/configs/44x/rainier_defconfig
···55CONFIG_LOG_BUF_SHIFT=1466CONFIG_BLK_DEV_INITRD=y77# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set88-CONFIG_EMBEDDED=y88+CONFIG_EXPERT=y99CONFIG_MODULES=y1010CONFIG_MODULE_UNLOAD=y1111# CONFIG_BLK_DEV_BSG is not set
+1-1
arch/powerpc/configs/44x/redwood_defconfig
···55CONFIG_LOG_BUF_SHIFT=1466CONFIG_BLK_DEV_INITRD=y77# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set88-CONFIG_EMBEDDED=y88+CONFIG_EXPERT=y99CONFIG_MODULES=y1010CONFIG_MODULE_UNLOAD=y1111# CONFIG_BLK_DEV_BSG is not set
+1-1
arch/powerpc/configs/44x/sam440ep_defconfig
···66CONFIG_LOG_BUF_SHIFT=1477CONFIG_BLK_DEV_INITRD=y88# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set99-CONFIG_EMBEDDED=y99+CONFIG_EXPERT=y1010CONFIG_MODULES=y1111CONFIG_MODULE_UNLOAD=y1212# CONFIG_BLK_DEV_BSG is not set
+1-1
arch/powerpc/configs/44x/sequoia_defconfig
···55CONFIG_LOG_BUF_SHIFT=1466CONFIG_BLK_DEV_INITRD=y77# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set88-CONFIG_EMBEDDED=y88+CONFIG_EXPERT=y99CONFIG_MODULES=y1010CONFIG_MODULE_UNLOAD=y1111# CONFIG_BLK_DEV_BSG is not set
+1-1
arch/powerpc/configs/44x/taishan_defconfig
···55CONFIG_LOG_BUF_SHIFT=1466CONFIG_BLK_DEV_INITRD=y77# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set88-CONFIG_EMBEDDED=y88+CONFIG_EXPERT=y99CONFIG_MODULES=y1010CONFIG_MODULE_UNLOAD=y1111# CONFIG_BLK_DEV_BSG is not set
+1-1
arch/powerpc/configs/44x/warp_defconfig
···88CONFIG_LOG_BUF_SHIFT=1499CONFIG_BLK_DEV_INITRD=y1010# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set1111-CONFIG_EMBEDDED=y1111+CONFIG_EXPERT=y1212CONFIG_MODULES=y1313CONFIG_MODULE_UNLOAD=y1414# CONFIG_BLK_DEV_BSG is not set
+1-1
arch/powerpc/configs/52xx/cm5200_defconfig
···33CONFIG_LOG_BUF_SHIFT=1444CONFIG_BLK_DEV_INITRD=y55# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set66-CONFIG_EMBEDDED=y66+CONFIG_EXPERT=y77# CONFIG_SYSCTL_SYSCALL is not set88# CONFIG_KALLSYMS is not set99# CONFIG_EPOLL is not set
+1-1
arch/powerpc/configs/52xx/lite5200b_defconfig
···33CONFIG_LOG_BUF_SHIFT=1444CONFIG_BLK_DEV_INITRD=y55# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set66-CONFIG_EMBEDDED=y66+CONFIG_EXPERT=y77# CONFIG_SYSCTL_SYSCALL is not set88# CONFIG_KALLSYMS is not set99# CONFIG_EPOLL is not set
+1-1
arch/powerpc/configs/52xx/motionpro_defconfig
···33CONFIG_LOG_BUF_SHIFT=1444CONFIG_BLK_DEV_INITRD=y55# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set66-CONFIG_EMBEDDED=y66+CONFIG_EXPERT=y77# CONFIG_SYSCTL_SYSCALL is not set88# CONFIG_KALLSYMS is not set99# CONFIG_EPOLL is not set
+1-1
arch/powerpc/configs/52xx/pcm030_defconfig
···88CONFIG_IKCONFIG_PROC=y99CONFIG_LOG_BUF_SHIFT=141010# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set1111-CONFIG_EMBEDDED=y1111+CONFIG_EXPERT=y1212# CONFIG_SYSCTL_SYSCALL is not set1313# CONFIG_VM_EVENT_COUNTERS is not set1414CONFIG_SLAB=y
+1-1
arch/powerpc/configs/52xx/tqm5200_defconfig
···33CONFIG_LOG_BUF_SHIFT=1444CONFIG_BLK_DEV_INITRD=y55# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set66-CONFIG_EMBEDDED=y66+CONFIG_EXPERT=y77# CONFIG_SYSCTL_SYSCALL is not set88# CONFIG_KALLSYMS is not set99# CONFIG_EPOLL is not set
+1-1
arch/powerpc/configs/83xx/asp8347_defconfig
···44CONFIG_LOG_BUF_SHIFT=1455CONFIG_BLK_DEV_INITRD=y66# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set77-CONFIG_EMBEDDED=y77+CONFIG_EXPERT=y88# CONFIG_KALLSYMS is not set99CONFIG_MODULES=y1010CONFIG_MODULE_UNLOAD=y
+1-1
arch/powerpc/configs/83xx/kmeter1_defconfig
···33CONFIG_SYSVIPC=y44CONFIG_POSIX_MQUEUE=y55CONFIG_LOG_BUF_SHIFT=1466-CONFIG_EMBEDDED=y66+CONFIG_EXPERT=y77# CONFIG_HOTPLUG is not set88CONFIG_SLAB=y99CONFIG_MODULES=y
+1-1
arch/powerpc/configs/83xx/mpc8313_rdb_defconfig
···33CONFIG_LOG_BUF_SHIFT=1444CONFIG_BLK_DEV_INITRD=y55# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set66-CONFIG_EMBEDDED=y66+CONFIG_EXPERT=y77# CONFIG_KALLSYMS is not set88CONFIG_MODULES=y99CONFIG_MODULE_UNLOAD=y
+1-1
arch/powerpc/configs/83xx/mpc8315_rdb_defconfig
···33CONFIG_LOG_BUF_SHIFT=1444CONFIG_BLK_DEV_INITRD=y55# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set66-CONFIG_EMBEDDED=y66+CONFIG_EXPERT=y77# CONFIG_KALLSYMS is not set88CONFIG_MODULES=y99CONFIG_MODULE_UNLOAD=y
+1-1
arch/powerpc/configs/83xx/mpc832x_mds_defconfig
···33CONFIG_LOG_BUF_SHIFT=1444CONFIG_BLK_DEV_INITRD=y55# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set66-CONFIG_EMBEDDED=y66+CONFIG_EXPERT=y77# CONFIG_KALLSYMS is not set88CONFIG_MODULES=y99CONFIG_MODULE_UNLOAD=y
+1-1
arch/powerpc/configs/83xx/mpc832x_rdb_defconfig
···33CONFIG_LOG_BUF_SHIFT=1444CONFIG_BLK_DEV_INITRD=y55# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set66-CONFIG_EMBEDDED=y66+CONFIG_EXPERT=y77# CONFIG_KALLSYMS is not set88CONFIG_MODULES=y99CONFIG_MODULE_UNLOAD=y
+1-1
arch/powerpc/configs/83xx/mpc834x_itx_defconfig
···33CONFIG_LOG_BUF_SHIFT=1444CONFIG_BLK_DEV_INITRD=y55# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set66-CONFIG_EMBEDDED=y66+CONFIG_EXPERT=y77# CONFIG_KALLSYMS is not set88CONFIG_MODULES=y99CONFIG_MODULE_UNLOAD=y
+1-1
arch/powerpc/configs/83xx/mpc834x_itxgp_defconfig
···33CONFIG_LOG_BUF_SHIFT=1444CONFIG_BLK_DEV_INITRD=y55# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set66-CONFIG_EMBEDDED=y66+CONFIG_EXPERT=y77# CONFIG_KALLSYMS is not set88CONFIG_MODULES=y99CONFIG_MODULE_UNLOAD=y
+1-1
arch/powerpc/configs/83xx/mpc834x_mds_defconfig
···33CONFIG_LOG_BUF_SHIFT=1444CONFIG_BLK_DEV_INITRD=y55# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set66-CONFIG_EMBEDDED=y66+CONFIG_EXPERT=y77# CONFIG_KALLSYMS is not set88CONFIG_MODULES=y99CONFIG_MODULE_UNLOAD=y
+1-1
arch/powerpc/configs/83xx/mpc836x_mds_defconfig
···33CONFIG_LOG_BUF_SHIFT=1444CONFIG_BLK_DEV_INITRD=y55# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set66-CONFIG_EMBEDDED=y66+CONFIG_EXPERT=y77# CONFIG_KALLSYMS is not set88CONFIG_MODULES=y99CONFIG_MODULE_UNLOAD=y
+1-1
arch/powerpc/configs/83xx/mpc836x_rdk_defconfig
···33CONFIG_LOG_BUF_SHIFT=1444CONFIG_BLK_DEV_INITRD=y55# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set66-CONFIG_EMBEDDED=y66+CONFIG_EXPERT=y77# CONFIG_KALLSYMS is not set88CONFIG_MODULES=y99CONFIG_MODULE_UNLOAD=y
+1-1
arch/powerpc/configs/83xx/mpc837x_mds_defconfig
···33CONFIG_LOG_BUF_SHIFT=1444CONFIG_BLK_DEV_INITRD=y55# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set66-CONFIG_EMBEDDED=y66+CONFIG_EXPERT=y77CONFIG_SLAB=y88CONFIG_MODULES=y99CONFIG_MODULE_UNLOAD=y
+1-1
arch/powerpc/configs/83xx/mpc837x_rdb_defconfig
···33CONFIG_LOG_BUF_SHIFT=1444CONFIG_BLK_DEV_INITRD=y55# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set66-CONFIG_EMBEDDED=y66+CONFIG_EXPERT=y77CONFIG_SLAB=y88CONFIG_MODULES=y99CONFIG_MODULE_UNLOAD=y
+1-1
arch/powerpc/configs/83xx/sbc834x_defconfig
···33CONFIG_LOG_BUF_SHIFT=1444CONFIG_BLK_DEV_INITRD=y55# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set66-CONFIG_EMBEDDED=y66+CONFIG_EXPERT=y77# CONFIG_KALLSYMS is not set88CONFIG_SLAB=y99CONFIG_MODULES=y
+1-1
arch/powerpc/configs/85xx/ksi8560_defconfig
···44CONFIG_LOG_BUF_SHIFT=1455CONFIG_BLK_DEV_INITRD=y66# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set77-CONFIG_EMBEDDED=y77+CONFIG_EXPERT=y88# CONFIG_BLK_DEV_BSG is not set99CONFIG_KSI8560=y1010CONFIG_CPM2=y
+1-1
arch/powerpc/configs/85xx/mpc8540_ads_defconfig
···44CONFIG_LOG_BUF_SHIFT=1455CONFIG_BLK_DEV_INITRD=y66# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set77-CONFIG_EMBEDDED=y77+CONFIG_EXPERT=y88# CONFIG_BLK_DEV_BSG is not set99CONFIG_MPC8540_ADS=y1010CONFIG_NO_HZ=y
+1-1
arch/powerpc/configs/85xx/mpc8560_ads_defconfig
···44CONFIG_LOG_BUF_SHIFT=1455CONFIG_BLK_DEV_INITRD=y66# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set77-CONFIG_EMBEDDED=y77+CONFIG_EXPERT=y88# CONFIG_BLK_DEV_BSG is not set99CONFIG_MPC8560_ADS=y1010CONFIG_BINFMT_MISC=y
+1-1
arch/powerpc/configs/85xx/mpc85xx_cds_defconfig
···44CONFIG_LOG_BUF_SHIFT=1455CONFIG_BLK_DEV_INITRD=y66# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set77-CONFIG_EMBEDDED=y77+CONFIG_EXPERT=y88# CONFIG_BLK_DEV_BSG is not set99CONFIG_MPC85xx_CDS=y1010CONFIG_NO_HZ=y
+1-1
arch/powerpc/configs/85xx/sbc8548_defconfig
···44CONFIG_LOG_BUF_SHIFT=1455CONFIG_BLK_DEV_INITRD=y66# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set77-CONFIG_EMBEDDED=y77+CONFIG_EXPERT=y88CONFIG_SLAB=y99# CONFIG_BLK_DEV_BSG is not set1010CONFIG_SBC8548=y
+1-1
arch/powerpc/configs/85xx/sbc8560_defconfig
···44CONFIG_LOG_BUF_SHIFT=1455CONFIG_BLK_DEV_INITRD=y66# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set77-CONFIG_EMBEDDED=y77+CONFIG_EXPERT=y88CONFIG_SLAB=y99# CONFIG_BLK_DEV_BSG is not set1010CONFIG_SBC8560=y
+1-1
arch/powerpc/configs/85xx/socrates_defconfig
···44CONFIG_LOG_BUF_SHIFT=1655CONFIG_BLK_DEV_INITRD=y66# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set77-CONFIG_EMBEDDED=y77+CONFIG_EXPERT=y88# CONFIG_KALLSYMS is not set99# CONFIG_HOTPLUG is not set1010# CONFIG_EPOLL is not set
+1-1
arch/powerpc/configs/85xx/stx_gp3_defconfig
···44CONFIG_LOG_BUF_SHIFT=1455CONFIG_BLK_DEV_INITRD=y66# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set77-CONFIG_EMBEDDED=y77+CONFIG_EXPERT=y88CONFIG_MODULES=y99CONFIG_MODVERSIONS=y1010# CONFIG_BLK_DEV_BSG is not set
+1-1
arch/powerpc/configs/85xx/tqm8540_defconfig
···44CONFIG_LOG_BUF_SHIFT=1455CONFIG_BLK_DEV_INITRD=y66# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set77-CONFIG_EMBEDDED=y77+CONFIG_EXPERT=y88# CONFIG_KALLSYMS is not set99# CONFIG_HOTPLUG is not set1010# CONFIG_EPOLL is not set
+1-1
arch/powerpc/configs/85xx/tqm8541_defconfig
···44CONFIG_LOG_BUF_SHIFT=1455CONFIG_BLK_DEV_INITRD=y66# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set77-CONFIG_EMBEDDED=y77+CONFIG_EXPERT=y88# CONFIG_KALLSYMS is not set99# CONFIG_HOTPLUG is not set1010# CONFIG_EPOLL is not set
+1-1
arch/powerpc/configs/85xx/tqm8548_defconfig
···44CONFIG_LOG_BUF_SHIFT=1455CONFIG_BLK_DEV_INITRD=y66# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set77-CONFIG_EMBEDDED=y77+CONFIG_EXPERT=y88CONFIG_MODULES=y99CONFIG_MODULE_UNLOAD=y1010# CONFIG_BLK_DEV_BSG is not set
+1-1
arch/powerpc/configs/85xx/tqm8555_defconfig
···44CONFIG_LOG_BUF_SHIFT=1455CONFIG_BLK_DEV_INITRD=y66# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set77-CONFIG_EMBEDDED=y77+CONFIG_EXPERT=y88# CONFIG_KALLSYMS is not set99# CONFIG_HOTPLUG is not set1010# CONFIG_EPOLL is not set
+1-1
arch/powerpc/configs/85xx/tqm8560_defconfig
···44CONFIG_LOG_BUF_SHIFT=1455CONFIG_BLK_DEV_INITRD=y66# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set77-CONFIG_EMBEDDED=y77+CONFIG_EXPERT=y88# CONFIG_KALLSYMS is not set99# CONFIG_HOTPLUG is not set1010# CONFIG_EPOLL is not set
+1-1
arch/powerpc/configs/85xx/xes_mpc85xx_defconfig
···1111CONFIG_LOG_BUF_SHIFT=141212CONFIG_BLK_DEV_INITRD=y1313# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set1414-CONFIG_EMBEDDED=y1414+CONFIG_EXPERT=y1515CONFIG_KALLSYMS_ALL=y1616CONFIG_KALLSYMS_EXTRA_PASS=y1717CONFIG_MODULES=y
+1-1
arch/powerpc/configs/86xx/gef_ppc9a_defconfig
···1111CONFIG_RELAY=y1212CONFIG_BLK_DEV_INITRD=y1313# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set1414-CONFIG_EMBEDDED=y1414+CONFIG_EXPERT=y1515CONFIG_SLAB=y1616CONFIG_MODULES=y1717CONFIG_MODULE_UNLOAD=y
+1-1
arch/powerpc/configs/86xx/gef_sbc310_defconfig
···1111CONFIG_RELAY=y1212CONFIG_BLK_DEV_INITRD=y1313# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set1414-CONFIG_EMBEDDED=y1414+CONFIG_EXPERT=y1515CONFIG_SLAB=y1616CONFIG_MODULES=y1717CONFIG_MODULE_UNLOAD=y
+1-1
arch/powerpc/configs/86xx/gef_sbc610_defconfig
···1111CONFIG_RELAY=y1212CONFIG_BLK_DEV_INITRD=y1313# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set1414-CONFIG_EMBEDDED=y1414+CONFIG_EXPERT=y1515CONFIG_SLAB=y1616CONFIG_MODULES=y1717CONFIG_MODULE_UNLOAD=y
+1-1
arch/powerpc/configs/86xx/mpc8610_hpcd_defconfig
···66CONFIG_LOG_BUF_SHIFT=1477CONFIG_BLK_DEV_INITRD=y88# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set99-CONFIG_EMBEDDED=y99+CONFIG_EXPERT=y1010CONFIG_KALLSYMS_EXTRA_PASS=y1111# CONFIG_ELF_CORE is not set1212CONFIG_MODULES=y
+1-1
arch/powerpc/configs/86xx/mpc8641_hpcn_defconfig
···1010CONFIG_LOG_BUF_SHIFT=141111CONFIG_BLK_DEV_INITRD=y1212# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set1313-CONFIG_EMBEDDED=y1313+CONFIG_EXPERT=y1414CONFIG_KALLSYMS_ALL=y1515CONFIG_KALLSYMS_EXTRA_PASS=y1616CONFIG_MODULES=y
+1-1
arch/powerpc/configs/86xx/sbc8641d_defconfig
···1111CONFIG_RELAY=y1212CONFIG_BLK_DEV_INITRD=y1313# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set1414-CONFIG_EMBEDDED=y1414+CONFIG_EXPERT=y1515CONFIG_SLAB=y1616CONFIG_MODULES=y1717CONFIG_MODULE_UNLOAD=y
+1-1
arch/powerpc/configs/adder875_defconfig
···44CONFIG_SYSVIPC=y55CONFIG_LOG_BUF_SHIFT=1466# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set77-CONFIG_EMBEDDED=y77+CONFIG_EXPERT=y88# CONFIG_SYSCTL_SYSCALL is not set99# CONFIG_ELF_CORE is not set1010# CONFIG_BASE_FULL is not set
+1-1
arch/powerpc/configs/e55xx_smp_defconfig
···1212CONFIG_SYSFS_DEPRECATED_V2=y1313CONFIG_BLK_DEV_INITRD=y1414# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set1515-CONFIG_EMBEDDED=y1515+CONFIG_EXPERT=y1616CONFIG_KALLSYMS_ALL=y1717CONFIG_KALLSYMS_EXTRA_PASS=y1818CONFIG_MODULES=y
+1-1
arch/powerpc/configs/ep8248e_defconfig
···22CONFIG_IKCONFIG=y33CONFIG_IKCONFIG_PROC=y44CONFIG_LOG_BUF_SHIFT=1455-CONFIG_EMBEDDED=y55+CONFIG_EXPERT=y66CONFIG_KALLSYMS_ALL=y77CONFIG_SLAB=y88# CONFIG_IOSCHED_CFQ is not set
+1-1
arch/powerpc/configs/ep88xc_defconfig
···44CONFIG_SYSVIPC=y55CONFIG_LOG_BUF_SHIFT=1466# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set77-CONFIG_EMBEDDED=y77+CONFIG_EXPERT=y88# CONFIG_SYSCTL_SYSCALL is not set99# CONFIG_ELF_CORE is not set1010# CONFIG_BASE_FULL is not set
+1-1
arch/powerpc/configs/gamecube_defconfig
···66CONFIG_LOG_BUF_SHIFT=1477CONFIG_BLK_DEV_INITRD=y88# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set99-CONFIG_EMBEDDED=y99+CONFIG_EXPERT=y1010# CONFIG_ELF_CORE is not set1111CONFIG_PERF_COUNTERS=y1212# CONFIG_VM_EVENT_COUNTERS is not set
+1-1
arch/powerpc/configs/holly_defconfig
···33CONFIG_LOG_BUF_SHIFT=1444CONFIG_BLK_DEV_INITRD=y55# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set66-CONFIG_EMBEDDED=y66+CONFIG_EXPERT=y77CONFIG_MODULES=y88# CONFIG_BLK_DEV_BSG is not set99# CONFIG_PPC_CHRP is not set
+1-1
arch/powerpc/configs/mgcoge_defconfig
···33CONFIG_IKCONFIG_PROC=y44CONFIG_LOG_BUF_SHIFT=1455CONFIG_BLK_DEV_INITRD=y66-CONFIG_EMBEDDED=y66+CONFIG_EXPERT=y77CONFIG_KALLSYMS_ALL=y88CONFIG_SLAB=y99# CONFIG_IOSCHED_CFQ is not set
+1-1
arch/powerpc/configs/mgsuvd_defconfig
···44CONFIG_SYSVIPC=y55CONFIG_BLK_DEV_INITRD=y66# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set77-CONFIG_EMBEDDED=y77+CONFIG_EXPERT=y88# CONFIG_SYSCTL_SYSCALL is not set99# CONFIG_HOTPLUG is not set1010# CONFIG_BUG is not set
+1-1
arch/powerpc/configs/mpc7448_hpc2_defconfig
···44CONFIG_LOG_BUF_SHIFT=1455CONFIG_BLK_DEV_INITRD=y66# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set77-CONFIG_EMBEDDED=y77+CONFIG_EXPERT=y88# CONFIG_BLK_DEV_BSG is not set99# CONFIG_PPC_CHRP is not set1010# CONFIG_PPC_PMAC is not set
+1-1
arch/powerpc/configs/mpc8272_ads_defconfig
···22CONFIG_IKCONFIG=y33CONFIG_IKCONFIG_PROC=y44CONFIG_LOG_BUF_SHIFT=1455-CONFIG_EMBEDDED=y55+CONFIG_EXPERT=y66CONFIG_KALLSYMS_ALL=y77# CONFIG_PPC_CHRP is not set88# CONFIG_PPC_PMAC is not set
+1-1
arch/powerpc/configs/mpc83xx_defconfig
···33CONFIG_LOG_BUF_SHIFT=1444CONFIG_BLK_DEV_INITRD=y55# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set66-CONFIG_EMBEDDED=y66+CONFIG_EXPERT=y77CONFIG_SLAB=y88CONFIG_MODULES=y99CONFIG_MODULE_UNLOAD=y
+1-1
arch/powerpc/configs/mpc85xx_defconfig
···1010CONFIG_LOG_BUF_SHIFT=141111CONFIG_BLK_DEV_INITRD=y1212# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set1313-CONFIG_EMBEDDED=y1313+CONFIG_EXPERT=y1414CONFIG_KALLSYMS_ALL=y1515CONFIG_KALLSYMS_EXTRA_PASS=y1616CONFIG_MODULES=y
+1-1
arch/powerpc/configs/mpc85xx_smp_defconfig
···1212CONFIG_LOG_BUF_SHIFT=141313CONFIG_BLK_DEV_INITRD=y1414# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set1515-CONFIG_EMBEDDED=y1515+CONFIG_EXPERT=y1616CONFIG_KALLSYMS_ALL=y1717CONFIG_KALLSYMS_EXTRA_PASS=y1818CONFIG_MODULES=y
+1-1
arch/powerpc/configs/mpc866_ads_defconfig
···44CONFIG_SYSVIPC=y55CONFIG_LOG_BUF_SHIFT=1466# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set77-CONFIG_EMBEDDED=y77+CONFIG_EXPERT=y88# CONFIG_SYSCTL_SYSCALL is not set99# CONFIG_HOTPLUG is not set1010# CONFIG_BUG is not set
+1-1
arch/powerpc/configs/mpc86xx_defconfig
···1010CONFIG_LOG_BUF_SHIFT=141111CONFIG_BLK_DEV_INITRD=y1212# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set1313-CONFIG_EMBEDDED=y1313+CONFIG_EXPERT=y1414CONFIG_KALLSYMS_ALL=y1515CONFIG_KALLSYMS_EXTRA_PASS=y1616CONFIG_MODULES=y
+1-1
arch/powerpc/configs/mpc885_ads_defconfig
···44CONFIG_SYSVIPC=y55CONFIG_LOG_BUF_SHIFT=1466# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set77-CONFIG_EMBEDDED=y77+CONFIG_EXPERT=y88# CONFIG_SYSCTL_SYSCALL is not set99# CONFIG_ELF_CORE is not set1010# CONFIG_BASE_FULL is not set
+1-1
arch/powerpc/configs/ppc40x_defconfig
···55CONFIG_LOG_BUF_SHIFT=1466CONFIG_BLK_DEV_INITRD=y77# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set88-CONFIG_EMBEDDED=y88+CONFIG_EXPERT=y99CONFIG_KALLSYMS_ALL=y1010CONFIG_KALLSYMS_EXTRA_PASS=y1111CONFIG_MODULES=y
+1-1
arch/powerpc/configs/ppc44x_defconfig
···55CONFIG_LOG_BUF_SHIFT=1466CONFIG_BLK_DEV_INITRD=y77# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set88-CONFIG_EMBEDDED=y88+CONFIG_EXPERT=y99CONFIG_KALLSYMS_ALL=y1010CONFIG_KALLSYMS_EXTRA_PASS=y1111CONFIG_MODULES=y
+1-1
arch/powerpc/configs/pq2fads_defconfig
···33CONFIG_IKCONFIG_PROC=y44CONFIG_LOG_BUF_SHIFT=1455CONFIG_BLK_DEV_INITRD=y66-CONFIG_EMBEDDED=y66+CONFIG_EXPERT=y77CONFIG_KALLSYMS_ALL=y88# CONFIG_PPC_CHRP is not set99# CONFIG_PPC_PMAC is not set
+1-1
arch/powerpc/configs/ps3_defconfig
···88CONFIG_POSIX_MQUEUE=y99CONFIG_NAMESPACES=y1010CONFIG_BLK_DEV_INITRD=y1111-CONFIG_EMBEDDED=y1111+CONFIG_EXPERT=y1212CONFIG_KALLSYMS_EXTRA_PASS=y1313# CONFIG_PERF_EVENTS is not set1414# CONFIG_COMPAT_BRK is not set
+4-3
arch/powerpc/configs/pseries_defconfig
···22CONFIG_ALTIVEC=y33CONFIG_VSX=y44CONFIG_SMP=y55-CONFIG_NR_CPUS=12855+CONFIG_NR_CPUS=102466CONFIG_EXPERIMENTAL=y77CONFIG_SYSVIPC=y88CONFIG_POSIX_MQUEUE=y···4545CONFIG_IRQ_ALL_CPUS=y4646CONFIG_MEMORY_HOTPLUG=y4747CONFIG_MEMORY_HOTREMOVE=y4848+CONFIG_PPC_64K_PAGES=y4949+CONFIG_PPC_SUBPAGE_PROT=y4850CONFIG_SCHED_SMT=y4951CONFIG_HOTPLUG_PCI=m5052CONFIG_HOTPLUG_PCI_RPA=m···186184CONFIG_E1000=y187185CONFIG_E1000E=y188186CONFIG_TIGON3=y187187+CONFIG_BNX2=m189188CONFIG_CHELSIO_T1=m190189CONFIG_CHELSIO_T3=m191190CONFIG_EHEA=y···314311# CONFIG_RCU_CPU_STALL_DETECTOR is not set315312CONFIG_LATENCYTOP=y316313CONFIG_SYSCTL_SYSCALL_CHECK=y317317-CONFIG_IRQSOFF_TRACER=y318314CONFIG_SCHED_TRACER=y319319-CONFIG_STACK_TRACER=y320315CONFIG_BLK_DEV_IO_TRACE=y321316CONFIG_DEBUG_STACKOVERFLOW=y322317CONFIG_DEBUG_STACK_USAGE=y
+1-1
arch/powerpc/configs/storcenter_defconfig
···11CONFIG_EXPERIMENTAL=y22CONFIG_SYSVIPC=y33CONFIG_LOG_BUF_SHIFT=1444-CONFIG_EMBEDDED=y44+CONFIG_EXPERT=y55# CONFIG_KALLSYMS is not set66CONFIG_MODULES=y77CONFIG_MODULE_UNLOAD=y
+1-1
arch/powerpc/configs/tqm8xx_defconfig
···55CONFIG_LOG_BUF_SHIFT=1466CONFIG_SYSFS_DEPRECATED_V2=y77# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set88-CONFIG_EMBEDDED=y88+CONFIG_EXPERT=y99# CONFIG_SYSCTL_SYSCALL is not set1010# CONFIG_ELF_CORE is not set1111# CONFIG_BASE_FULL is not set
+1-1
arch/powerpc/configs/wii_defconfig
···77CONFIG_LOG_BUF_SHIFT=1488CONFIG_BLK_DEV_INITRD=y99# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set1010-CONFIG_EMBEDDED=y1010+CONFIG_EXPERT=y1111# CONFIG_ELF_CORE is not set1212CONFIG_PERF_COUNTERS=y1313# CONFIG_VM_EVENT_COUNTERS is not set
···467467extern struct qe_immap __iomem *qe_immr;468468extern phys_addr_t get_qe_base(void);469469470470-static inline unsigned long immrbar_virt_to_phys(void *address)470470+/*471471+ * Returns the offset within the QE address space of the given pointer.472472+ *473473+ * Note that the QE does not support 36-bit physical addresses, so if474474+ * get_qe_base() returns a number above 4GB, the caller will probably fail.475475+ */476476+static inline phys_addr_t immrbar_virt_to_phys(void *address)471477{472472- if ( ((u32)address >= (u32)qe_immr) &&473473- ((u32)address < ((u32)qe_immr + QE_IMMAP_SIZE)) )474474- return (unsigned long)(address - (u32)qe_immr +475475- (u32)get_qe_base());476476- return (unsigned long)virt_to_phys(address);478478+ void *q = (void *)qe_immr;479479+480480+ /* Is it a MURAM address? */481481+ if ((address >= q) && (address < (q + QE_IMMAP_SIZE)))482482+ return get_qe_base() + (address - q);483483+484484+ /* It's an address returned by kmalloc */485485+ return virt_to_phys(address);477486}478487479488#endif /* __KERNEL__ */
+30-10
arch/powerpc/include/asm/irqflags.h
···12121313#else1414#ifdef CONFIG_TRACE_IRQFLAGS1515+#ifdef CONFIG_IRQSOFF_TRACER1616+/*1717+ * Since the ftrace irqsoff latency trace checks CALLER_ADDR1,1818+ * which is the stack frame here, we need to force a stack frame1919+ * in case we came from user space.2020+ */2121+#define TRACE_WITH_FRAME_BUFFER(func) \2222+ mflr r0; \2323+ stdu r1, -32(r1); \2424+ std r0, 16(r1); \2525+ stdu r1, -32(r1); \2626+ bl func; \2727+ ld r1, 0(r1); \2828+ ld r1, 0(r1);2929+#else3030+#define TRACE_WITH_FRAME_BUFFER(func) \3131+ bl func;3232+#endif3333+1534/*1635 * Most of the CPU's IRQ-state tracing is done from assembly code; we1736 * have to call a C function so call a wrapper that saves all the1837 * C-clobbered registers.1938 */2020-#define TRACE_ENABLE_INTS bl .trace_hardirqs_on2121-#define TRACE_DISABLE_INTS bl .trace_hardirqs_off2222-#define TRACE_AND_RESTORE_IRQ_PARTIAL(en,skip) \2323- cmpdi en,0; \2424- bne 95f; \2525- stb en,PACASOFTIRQEN(r13); \2626- bl .trace_hardirqs_off; \2727- b skip; \2828-95: bl .trace_hardirqs_on; \3939+#define TRACE_ENABLE_INTS TRACE_WITH_FRAME_BUFFER(.trace_hardirqs_on)4040+#define TRACE_DISABLE_INTS TRACE_WITH_FRAME_BUFFER(.trace_hardirqs_off)4141+4242+#define TRACE_AND_RESTORE_IRQ_PARTIAL(en,skip) \4343+ cmpdi en,0; \4444+ bne 95f; \4545+ stb en,PACASOFTIRQEN(r13); \4646+ TRACE_WITH_FRAME_BUFFER(.trace_hardirqs_off) \4747+ b skip; \4848+95: TRACE_WITH_FRAME_BUFFER(.trace_hardirqs_on) \2949 li en,1;3050#define TRACE_AND_RESTORE_IRQ(en) \3151 TRACE_AND_RESTORE_IRQ_PARTIAL(en,96f); \3232- stb en,PACASOFTIRQEN(r13); \5252+ stb en,PACASOFTIRQEN(r13); \335396:3454#else3555#define TRACE_ENABLE_INTS
+1-17
arch/powerpc/include/asm/machdep.h
···116116 * If for some reason there is no irq, but the interrupt117117 * shouldn't be counted as spurious, return NO_IRQ_IGNORE. */118118 unsigned int (*get_irq)(void);119119-#ifdef CONFIG_KEXEC120120- void (*kexec_cpu_down)(int crash_shutdown, int secondary);121121-#endif122119123120 /* PCI stuff */124121 /* Called after scanning the bus, before allocating resources */···232235 void (*machine_shutdown)(void);233236234237#ifdef CONFIG_KEXEC235235- /* Called to do the minimal shutdown needed to run a kexec'd kernel236236- * to run successfully.237237- * XXX Should we move this one out of kexec scope?238238- */239239- void (*machine_crash_shutdown)(struct pt_regs *regs);238238+ void (*kexec_cpu_down)(int crash_shutdown, int secondary);240239241240 /* Called to do what every setup is needed on image and the242241 * reboot code buffer. Returns 0 on success.···240247 * claims to support kexec.241248 */242249 int (*machine_kexec_prepare)(struct kimage *image);243243-244244- /* Called to handle any machine specific cleanup on image */245245- void (*machine_kexec_cleanup)(struct kimage *image);246246-247247- /* Called to perform the _real_ kexec.248248- * Do NOT allocate memory or fail here. We are past the point of249249- * no return.250250- */251251- void (*machine_kexec)(struct kimage *image);252250#endif /* CONFIG_KEXEC */253251254252#ifdef CONFIG_SUSPEND
···246246 store or cache line push */247247#endif248248249249+/* Bit definitions for the HID1 */250250+#ifdef CONFIG_E500251251+/* e500v1/v2 */252252+#define HID1_PLL_CFG_MASK 0xfc000000 /* PLL_CFG input pins */253253+#define HID1_RFXE 0x00020000 /* Read fault exception enable */254254+#define HID1_R1DPE 0x00008000 /* R1 data bus parity enable */255255+#define HID1_R2DPE 0x00004000 /* R2 data bus parity enable */256256+#define HID1_ASTME 0x00002000 /* Address bus streaming mode enable */257257+#define HID1_ABE 0x00001000 /* Address broadcast enable */258258+#define HID1_MPXTT 0x00000400 /* MPX re-map transfer type */259259+#define HID1_ATS 0x00000080 /* Atomic status */260260+#define HID1_MID_MASK 0x0000000f /* MID input pins */261261+#endif262262+249263/* Bit definitions for the DBSR. */250264/*251265 * DBSR bits which have conflicting definitions on true Book E versus IBM 40x.
···4848static cpumask_t cpus_in_crash = CPU_MASK_NONE;4949cpumask_t cpus_in_sr = CPU_MASK_NONE;50505151-#define CRASH_HANDLER_MAX 25151+#define CRASH_HANDLER_MAX 35252/* NULL terminated list of shutdown handles */5353static crash_shutdown_t crash_shutdown_handles[CRASH_HANDLER_MAX+1];5454static DEFINE_SPINLOCK(crash_handlers_lock);···125125 smp_wmb();126126127127 /*128128- * FIXME: Until we will have the way to stop other CPUSs reliabally,128128+ * FIXME: Until we will have the way to stop other CPUs reliably,129129 * the crash CPU will send an IPI and wait for other CPUs to130130 * respond.131131 * Delay of at least 10 seconds.···254254 cpus_in_sr = CPU_MASK_NONE;255255}256256#endif257257-#ifdef CONFIG_SPU_BASE258258-259259-#include <asm/spu.h>260260-#include <asm/spu_priv1.h>261261-262262-struct crash_spu_info {263263- struct spu *spu;264264- u32 saved_spu_runcntl_RW;265265- u32 saved_spu_status_R;266266- u32 saved_spu_npc_RW;267267- u64 saved_mfc_sr1_RW;268268- u64 saved_mfc_dar;269269- u64 saved_mfc_dsisr;270270-};271271-272272-#define CRASH_NUM_SPUS 16 /* Enough for current hardware */273273-static struct crash_spu_info crash_spu_info[CRASH_NUM_SPUS];274274-275275-static void crash_kexec_stop_spus(void)276276-{277277- struct spu *spu;278278- int i;279279- u64 tmp;280280-281281- for (i = 0; i < CRASH_NUM_SPUS; i++) {282282- if (!crash_spu_info[i].spu)283283- continue;284284-285285- spu = crash_spu_info[i].spu;286286-287287- crash_spu_info[i].saved_spu_runcntl_RW =288288- in_be32(&spu->problem->spu_runcntl_RW);289289- crash_spu_info[i].saved_spu_status_R =290290- in_be32(&spu->problem->spu_status_R);291291- crash_spu_info[i].saved_spu_npc_RW =292292- in_be32(&spu->problem->spu_npc_RW);293293-294294- crash_spu_info[i].saved_mfc_dar = spu_mfc_dar_get(spu);295295- crash_spu_info[i].saved_mfc_dsisr = spu_mfc_dsisr_get(spu);296296- tmp = spu_mfc_sr1_get(spu);297297- crash_spu_info[i].saved_mfc_sr1_RW = tmp;298298-299299- tmp &= ~MFC_STATE1_MASTER_RUN_CONTROL_MASK;300300- spu_mfc_sr1_set(spu, tmp);301301-302302- __delay(200);303303- }304304-}305305-306306-void crash_register_spus(struct list_head *list)307307-{308308- struct spu *spu;309309-310310- list_for_each_entry(spu, list, full_list) {311311- if (WARN_ON(spu->number >= CRASH_NUM_SPUS))312312- continue;313313-314314- crash_spu_info[spu->number].spu = spu;315315- }316316-}317317-318318-#else319319-static inline void crash_kexec_stop_spus(void)320320-{321321-}322322-#endif /* CONFIG_SPU_BASE */323257324258/*325259 * Register a function to be called on shutdown. Only use this if you···372438 }373439 crash_shutdown_cpu = -1;374440 __debugger_fault_handler = old_handler;375375-376376- crash_kexec_stop_spus();377441378442 if (ppc_md.kexec_cpu_down)379443 ppc_md.kexec_cpu_down(1, 0);
+11
arch/powerpc/kernel/entry_32.S
···880880 */881881 andi. r10,r9,MSR_EE882882 beq 1f883883+ /*884884+ * Since the ftrace irqsoff latency trace checks CALLER_ADDR1,885885+ * which is the stack frame here, we need to force a stack frame886886+ * in case we came from user space.887887+ */888888+ stwu r1,-32(r1)889889+ mflr r0890890+ stw r0,4(r1)891891+ stwu r1,-32(r1)883892 bl trace_hardirqs_on893893+ lwz r1,0(r1)894894+ lwz r1,0(r1)884895 lwz r9,_MSR(r1)8858961:886897#endif /* CONFIG_TRACE_IRQFLAGS */
+9-10
arch/powerpc/kernel/machine_kexec.c
···1515#include <linux/memblock.h>1616#include <linux/of.h>1717#include <linux/irq.h>1818+#include <linux/ftrace.h>18191920#include <asm/machdep.h>2021#include <asm/prom.h>···45444645void machine_crash_shutdown(struct pt_regs *regs)4746{4848- if (ppc_md.machine_crash_shutdown)4949- ppc_md.machine_crash_shutdown(regs);5050- else5151- default_machine_crash_shutdown(regs);4747+ default_machine_crash_shutdown(regs);5248}53495450/*···63656466void machine_kexec_cleanup(struct kimage *image)6567{6666- if (ppc_md.machine_kexec_cleanup)6767- ppc_md.machine_kexec_cleanup(image);6868}69697070void arch_crash_save_vmcoreinfo(void)···8387 */8488void machine_kexec(struct kimage *image)8589{8686- if (ppc_md.machine_kexec)8787- ppc_md.machine_kexec(image);8888- else8989- default_machine_kexec(image);9090+ int save_ftrace_enabled;9191+9292+ save_ftrace_enabled = __ftrace_enabled_save();9393+9494+ default_machine_kexec(image);9595+9696+ __ftrace_enabled_restore(save_ftrace_enabled);90979198 /* Fall back to normal restart if we're still alive. */9299 machine_restart(NULL);
···256256 struct proc_dir_entry *dp = PDE(file->f_path.dentry->d_inode);257257 struct rtas_update_flash_t *uf;258258 char msg[RTAS_MSG_MAXLEN];259259- int msglen;260259261261- uf = (struct rtas_update_flash_t *) dp->data;260260+ uf = dp->data;262261263262 if (!strcmp(dp->name, FIRMWARE_FLASH_NAME)) {264263 get_flash_status_msg(uf->status, msg);265264 } else { /* FIRMWARE_UPDATE_NAME */266265 sprintf(msg, "%d\n", uf->status);267266 }268268- msglen = strlen(msg);269269- if (msglen > count)270270- msglen = count;271267272272- if (ppos && *ppos != 0)273273- return 0; /* be cheap */274274-275275- if (!access_ok(VERIFY_WRITE, buf, msglen))276276- return -EINVAL;277277-278278- if (copy_to_user(buf, msg, msglen))279279- return -EFAULT;280280-281281- if (ppos)282282- *ppos = msglen;283283- return msglen;268268+ return simple_read_from_buffer(buf, count, ppos, msg, strlen(msg));284269}285270286271/* constructor for flash_block_cache */···379394 char msg[RTAS_MSG_MAXLEN];380395 int msglen;381396382382- args_buf = (struct rtas_manage_flash_t *) dp->data;397397+ args_buf = dp->data;383398 if (args_buf == NULL)384399 return 0;385400386401 msglen = sprintf(msg, "%d\n", args_buf->status);387387- if (msglen > count)388388- msglen = count;389402390390- if (ppos && *ppos != 0)391391- return 0; /* be cheap */392392-393393- if (!access_ok(VERIFY_WRITE, buf, msglen))394394- return -EINVAL;395395-396396- if (copy_to_user(buf, msg, msglen))397397- return -EFAULT;398398-399399- if (ppos)400400- *ppos = msglen;401401- return msglen;403403+ return simple_read_from_buffer(buf, count, ppos, msg, msglen);402404}403405404406static ssize_t manage_flash_write(struct file *file, const char __user *buf,···467495 char msg[RTAS_MSG_MAXLEN];468496 int msglen;469497470470- args_buf = (struct rtas_validate_flash_t *) dp->data;498498+ args_buf = dp->data;471499472472- if (ppos && *ppos != 0)473473- return 0; /* be cheap */474474-475500 msglen = get_validate_flash_msg(args_buf, msg);476476- if (msglen > count)477477- msglen = count;478501479479- if (!access_ok(VERIFY_WRITE, buf, msglen))480480- return -EINVAL;481481-482482- if (copy_to_user(buf, msg, msglen))483483- return -EFAULT;484484-485485- if (ppos)486486- *ppos = msglen;487487- return msglen;502502+ return simple_read_from_buffer(buf, count, ppos, msg, msglen);488503}489504490505static ssize_t validate_flash_write(struct file *file, const char __user *buf,
+1-1
arch/powerpc/kernel/rtasd.c
···160160 /* rtas fixed header */161161 len = 8;162162 err = (struct rtas_error_log *)buf;163163- if (err->extended_log_length) {163163+ if (err->extended && err->extended_log_length) {164164165165 /* extended header */166166 len += err->extended_log_length;
+20-5
arch/powerpc/kernel/time.c
···265265{266266 u64 sst, ust;267267268268- sst = scan_dispatch_log(get_paca()->starttime_user);269269- ust = scan_dispatch_log(get_paca()->starttime);270270- get_paca()->system_time -= sst;271271- get_paca()->user_time -= ust;272272- get_paca()->stolen_time += ust + sst;268268+ u8 save_soft_enabled = local_paca->soft_enabled;269269+ u8 save_hard_enabled = local_paca->hard_enabled;270270+271271+ /* We are called early in the exception entry, before272272+ * soft/hard_enabled are sync'ed to the expected state273273+ * for the exception. We are hard disabled but the PACA274274+ * needs to reflect that so various debug stuff doesn't275275+ * complain276276+ */277277+ local_paca->soft_enabled = 0;278278+ local_paca->hard_enabled = 0;279279+280280+ sst = scan_dispatch_log(local_paca->starttime_user);281281+ ust = scan_dispatch_log(local_paca->starttime);282282+ local_paca->system_time -= sst;283283+ local_paca->user_time -= ust;284284+ local_paca->stolen_time += ust + sst;285285+286286+ local_paca->soft_enabled = save_soft_enabled;287287+ local_paca->hard_enabled = save_hard_enabled;273288}274289275290static inline u64 calculate_stolen_time(u64 stop_tb)
+1-11
arch/powerpc/kernel/traps.c
···626626 if (recover > 0)627627 return;628628629629- if (user_mode(regs)) {630630- regs->msr |= MSR_RI;631631- _exception(SIGBUS, regs, BUS_ADRERR, regs->nip);632632- return;633633- }634634-635629#if defined(CONFIG_8xx) && defined(CONFIG_PCI)636630 /* the qspan pci read routines can cause machine checks -- Cort637631 *···637643 return;638644#endif639645640640- if (debugger_fault_handler(regs)) {641641- regs->msr |= MSR_RI;646646+ if (debugger_fault_handler(regs))642647 return;643643- }644648645649 if (check_io_access(regs))646650 return;647651648648- if (debugger_fault_handler(regs))649649- return;650652 die("Machine check", regs, SIGBUS);651653652654 /* Must die if the interrupt is not recoverable */
+19
arch/powerpc/lib/feature-fixups-test.S
···1721723: or 3,3,3173173174174175175+#if 0176176+/* Test that if we have a larger else case the assembler spots it and177177+ * reports an error. #if 0'ed so as not to break the build normally.178178+ */179179+ftr_fixup_test7:180180+ or 1,1,1181181+BEGIN_FTR_SECTION182182+ or 2,2,2183183+ or 2,2,2184184+ or 2,2,2185185+FTR_SECTION_ELSE186186+ or 3,3,3187187+ or 3,3,3188188+ or 3,3,3189189+ or 3,3,3190190+ALT_FTR_SECTION_END(0, 1)191191+ or 1,1,1192192+#endif193193+175194#define MAKE_MACRO_TEST(TYPE) \176195globl(ftr_fixup_test_ ##TYPE##_macros) \177196 or 1,1,1; \
+2-2
arch/powerpc/platforms/83xx/mpc830x_rdb.c
···5757 ipic_set_default_priority();5858}59596060-struct const char *board[] __initdata = {6060+static const char *board[] __initdata = {6161 "MPC8308RDB",6262 "fsl,mpc8308rdb",6363 "denx,mpc8308_p1m",6464 NULL6565-}6565+};66666767/*6868 * Called very early, MMU is off, device-tree isn't unflattened
+2-2
arch/powerpc/platforms/83xx/mpc831x_rdb.c
···6060 ipic_set_default_priority();6161}62626363-struct const char *board[] __initdata = {6363+static const char *board[] __initdata = {6464 "MPC8313ERDB",6565 "fsl,mpc8315erdb",6666 NULL6767-}6767+};68686969/*7070 * Called very early, MMU is off, device-tree isn't unflattened
+2
arch/powerpc/platforms/83xx/mpc83xx.h
···35353636/* system i/o configuration register high */3737#define MPC83XX_SICRH_OFFS 0x1183838+#define MPC8308_SICRH_USB_MASK 0x000c00003939+#define MPC8308_SICRH_USB_ULPI 0x000400003840#define MPC834X_SICRH_USB_UTMI 0x000200003941#define MPC831X_SICRH_USB_MASK 0x000000e04042#define MPC831X_SICRH_USB_ULPI 0x000000a0
+16-5
arch/powerpc/platforms/83xx/usb.c
···127127128128 /* Configure clock */129129 immr_node = of_get_parent(np);130130- if (immr_node && of_device_is_compatible(immr_node, "fsl,mpc8315-immr"))130130+ if (immr_node && (of_device_is_compatible(immr_node, "fsl,mpc8315-immr") ||131131+ of_device_is_compatible(immr_node, "fsl,mpc8308-immr")))131132 clrsetbits_be32(immap + MPC83XX_SCCR_OFFS,132133 MPC8315_SCCR_USB_MASK,133134 MPC8315_SCCR_USB_DRCM_01);···139138140139 /* Configure pin mux for ULPI. There is no pin mux for UTMI */141140 if (prop && !strcmp(prop, "ulpi")) {142142- if (of_device_is_compatible(immr_node, "fsl,mpc8315-immr")) {141141+ if (of_device_is_compatible(immr_node, "fsl,mpc8308-immr")) {142142+ clrsetbits_be32(immap + MPC83XX_SICRH_OFFS,143143+ MPC8308_SICRH_USB_MASK,144144+ MPC8308_SICRH_USB_ULPI);145145+ } else if (of_device_is_compatible(immr_node, "fsl,mpc8315-immr")) {143146 clrsetbits_be32(immap + MPC83XX_SICRL_OFFS,144147 MPC8315_SICRL_USB_MASK,145148 MPC8315_SICRL_USB_ULPI);···178173 !strcmp(prop, "utmi"))) {179174 u32 refsel;180175176176+ if (of_device_is_compatible(immr_node, "fsl,mpc8308-immr"))177177+ goto out;178178+181179 if (of_device_is_compatible(immr_node, "fsl,mpc8315-immr"))182180 refsel = CONTROL_REFSEL_24MHZ;183181 else···194186 temp = CONTROL_PHY_CLK_SEL_ULPI;195187#ifdef CONFIG_USB_OTG196188 /* Set OTG_PORT */197197- dr_mode = of_get_property(np, "dr_mode", NULL);198198- if (dr_mode && !strcmp(dr_mode, "otg"))199199- temp |= CONTROL_OTG_PORT;189189+ if (!of_device_is_compatible(immr_node, "fsl,mpc8308-immr")) {190190+ dr_mode = of_get_property(np, "dr_mode", NULL);191191+ if (dr_mode && !strcmp(dr_mode, "otg"))192192+ temp |= CONTROL_OTG_PORT;193193+ }200194#endif /* CONFIG_USB_OTG */201195 out_be32(usb_regs + FSL_USB2_CONTROL_OFFS, temp);202196 } else {···206196 ret = -EINVAL;207197 }208198199199+out:209200 iounmap(usb_regs);210201 of_node_put(np);211202 return ret;
+3-17
arch/powerpc/platforms/cell/cpufreq_spudemand.c
···3939};4040static DEFINE_PER_CPU(struct spu_gov_info_struct, spu_gov_info);41414242-static struct workqueue_struct *kspugov_wq;4343-4442static int calc_freq(struct spu_gov_info_struct *info)4543{4644 int cpu;···6971 __cpufreq_driver_target(info->policy, target_freq, CPUFREQ_RELATION_H);70727173 delay = usecs_to_jiffies(info->poll_int);7272- queue_delayed_work_on(info->policy->cpu, kspugov_wq, &info->work, delay);7474+ schedule_delayed_work_on(info->policy->cpu, &info->work, delay);7375}74767577static void spu_gov_init_work(struct spu_gov_info_struct *info)7678{7779 int delay = usecs_to_jiffies(info->poll_int);7880 INIT_DELAYED_WORK_DEFERRABLE(&info->work, spu_gov_work);7979- queue_delayed_work_on(info->policy->cpu, kspugov_wq, &info->work, delay);8181+ schedule_delayed_work_on(info->policy->cpu, &info->work, delay);8082}81838284static void spu_gov_cancel_work(struct spu_gov_info_struct *info)···150152{151153 int ret;152154153153- kspugov_wq = create_workqueue("kspugov");154154- if (!kspugov_wq) {155155- printk(KERN_ERR "creation of kspugov failed\n");156156- ret = -EFAULT;157157- goto out;158158- }159159-160155 ret = cpufreq_register_governor(&spu_governor);161161- if (ret) {156156+ if (ret)162157 printk(KERN_ERR "registration of governor failed\n");163163- destroy_workqueue(kspugov_wq);164164- goto out;165165- }166166-out:167158 return ret;168159}169160170161static void __exit spu_gov_exit(void)171162{172163 cpufreq_unregister_governor(&spu_governor);173173- destroy_workqueue(kspugov_wq);174164}175165176166
···22 bool "IBM Legacy iSeries"33 depends on PPC64 && PPC_BOOK3S44 select PPC_INDIRECT_IO55- select PPC_PCI_CHOICE if EMBEDDED55+ select PPC_PCI_CHOICE if EXPERT6677menu "iSeries device drivers"88 depends on PPC_ISERIES
+3-3
arch/powerpc/platforms/pseries/Kconfig
···1010 select RTAS_ERROR_LOGGING1111 select PPC_UDBG_165501212 select PPC_NATIVE1313- select PPC_PCI_CHOICE if EMBEDDED1313+ select PPC_PCI_CHOICE if EXPERT1414 default y15151616config PPC_SPLPAR···2424 two or more partitions.25252626config EEH2727- bool "PCI Extended Error Handling (EEH)" if EMBEDDED2727+ bool "PCI Extended Error Handling (EEH)" if EXPERT2828 depends on PPC_PSERIES && PCI2929- default y if !EMBEDDED2929+ default y if !EXPERT30303131config PSERIES_MSI3232 bool
···5454static unsigned char ras_log_buf[RTAS_ERROR_LOG_MAX];5555static DEFINE_SPINLOCK(ras_log_buf_lock);56565757-static char mce_data_buf[RTAS_ERROR_LOG_MAX];5757+static char global_mce_data_buf[RTAS_ERROR_LOG_MAX];5858+static DEFINE_PER_CPU(__u64, mce_data_buf);58595960static int ras_get_sensor_state_token;6061static int ras_check_exception_token;···197196 return IRQ_HANDLED;198197}199198200200-/* Get the error information for errors coming through the199199+/*200200+ * Some versions of FWNMI place the buffer inside the 4kB page starting at201201+ * 0x7000. Other versions place it inside the rtas buffer. We check both.202202+ */203203+#define VALID_FWNMI_BUFFER(A) \204204+ ((((A) >= 0x7000) && ((A) < 0x7ff0)) || \205205+ (((A) >= rtas.base) && ((A) < (rtas.base + rtas.size - 16))))206206+207207+/*208208+ * Get the error information for errors coming through the201209 * FWNMI vectors. The pt_regs' r3 will be updated to reflect202210 * the actual r3 if possible, and a ptr to the error log entry203211 * will be returned if found.204212 *205205- * The mce_data_buf does not have any locks or protection around it,213213+ * If the RTAS error is not of the extended type, then we put it in a per214214+ * cpu 64bit buffer. If it is the extended type we use global_mce_data_buf.215215+ *216216+ * The global_mce_data_buf does not have any locks or protection around it,206217 * if a second machine check comes in, or a system reset is done207218 * before we have logged the error, then we will get corruption in the208219 * error log. This is preferable over holding off on calling···223210 */224211static struct rtas_error_log *fwnmi_get_errinfo(struct pt_regs *regs)225212{226226- unsigned long errdata = regs->gpr[3];227227- struct rtas_error_log *errhdr = NULL;228213 unsigned long *savep;214214+ struct rtas_error_log *h, *errhdr = NULL;229215230230- if ((errdata >= 0x7000 && errdata < 0x7fff0) ||231231- (errdata >= rtas.base && errdata < rtas.base + rtas.size - 16)) {232232- savep = __va(errdata);233233- regs->gpr[3] = savep[0]; /* restore original r3 */234234- memset(mce_data_buf, 0, RTAS_ERROR_LOG_MAX);235235- memcpy(mce_data_buf, (char *)(savep + 1), RTAS_ERROR_LOG_MAX);236236- errhdr = (struct rtas_error_log *)mce_data_buf;237237- } else {238238- printk("FWNMI: corrupt r3\n");216216+ if (!VALID_FWNMI_BUFFER(regs->gpr[3])) {217217+ printk(KERN_ERR "FWNMI: corrupt r3\n");218218+ return NULL;239219 }220220+221221+ savep = __va(regs->gpr[3]);222222+ regs->gpr[3] = savep[0]; /* restore original r3 */223223+224224+ /* If it isn't an extended log we can use the per cpu 64bit buffer */225225+ h = (struct rtas_error_log *)&savep[1];226226+ if (!h->extended) {227227+ memcpy(&__get_cpu_var(mce_data_buf), h, sizeof(__u64));228228+ errhdr = (struct rtas_error_log *)&__get_cpu_var(mce_data_buf);229229+ } else {230230+ int len;231231+232232+ len = max_t(int, 8+h->extended_log_length, RTAS_ERROR_LOG_MAX);233233+ memset(global_mce_data_buf, 0, RTAS_ERROR_LOG_MAX);234234+ memcpy(global_mce_data_buf, h, len);235235+ errhdr = (struct rtas_error_log *)global_mce_data_buf;236236+ }237237+240238 return errhdr;241239}242240···259235{260236 int ret = rtas_call(rtas_token("ibm,nmi-interlock"), 0, 1, NULL);261237 if (ret != 0)262262- printk("FWNMI: nmi-interlock failed: %d\n", ret);238238+ printk(KERN_ERR "FWNMI: nmi-interlock failed: %d\n", ret);263239}264240265241int pSeries_system_reset_exception(struct pt_regs *regs)···283259 * Return 1 if corrected (or delivered a signal).284260 * Return 0 if there is nothing we can do.285261 */286286-static int recover_mce(struct pt_regs *regs, struct rtas_error_log * err)262262+static int recover_mce(struct pt_regs *regs, struct rtas_error_log *err)287263{288288- int nonfatal = 0;264264+ int recovered = 0;289265290290- if (err->disposition == RTAS_DISP_FULLY_RECOVERED) {266266+ if (!(regs->msr & MSR_RI)) {267267+ /* If MSR_RI isn't set, we cannot recover */268268+ recovered = 0;269269+270270+ } else if (err->disposition == RTAS_DISP_FULLY_RECOVERED) {291271 /* Platform corrected itself */292292- nonfatal = 1;293293- } else if ((regs->msr & MSR_RI) &&294294- user_mode(regs) &&295295- err->severity == RTAS_SEVERITY_ERROR_SYNC &&296296- err->disposition == RTAS_DISP_NOT_RECOVERED &&297297- err->target == RTAS_TARGET_MEMORY &&298298- err->type == RTAS_TYPE_ECC_UNCORR &&299299- !(current->pid == 0 || is_global_init(current))) {300300- /* Kill off a user process with an ECC error */301301- printk(KERN_ERR "MCE: uncorrectable ecc error for pid %d\n",302302- current->pid);303303- /* XXX something better for ECC error? */304304- _exception(SIGBUS, regs, BUS_ADRERR, regs->nip);305305- nonfatal = 1;272272+ recovered = 1;273273+274274+ } else if (err->disposition == RTAS_DISP_LIMITED_RECOVERY) {275275+ /* Platform corrected itself but could be degraded */276276+ printk(KERN_ERR "MCE: limited recovery, system may "277277+ "be degraded\n");278278+ recovered = 1;279279+280280+ } else if (user_mode(regs) && !is_global_init(current) &&281281+ err->severity == RTAS_SEVERITY_ERROR_SYNC) {282282+283283+ /*284284+ * If we received a synchronous error when in userspace285285+ * kill the task. Firmware may report details of the fail286286+ * asynchronously, so we can't rely on the target and type287287+ * fields being valid here.288288+ */289289+ printk(KERN_ERR "MCE: uncorrectable error, killing task "290290+ "%s:%d\n", current->comm, current->pid);291291+292292+ _exception(SIGBUS, regs, BUS_MCEERR_AR, regs->nip);293293+ recovered = 1;306294 }307295308308- log_error((char *)err, ERR_TYPE_RTAS_LOG, !nonfatal);296296+ log_error((char *)err, ERR_TYPE_RTAS_LOG, 0);309297310310- return nonfatal;298298+ return recovered;311299}312300313301/*
-2
arch/powerpc/sysdev/fsl_rio.c
···15551555 saved_mcheck_exception = ppc_md.machine_check_exception;15561556 ppc_md.machine_check_exception = fsl_rio_mcheck_exception;15571557#endif15581558- /* Ensure that RFXE is set */15591559- mtspr(SPRN_HID1, (mfspr(SPRN_HID1) | 0x20000));1560155815611559 return 0;15621560err:
+4-2
arch/powerpc/sysdev/mpic.c
···674674 /* make sure mask gets to controller before we return to user */675675 do {676676 if (!loops--) {677677- printk(KERN_ERR "mpic_enable_irq timeout\n");677677+ printk(KERN_ERR "%s: timeout on hwirq %u\n",678678+ __func__, src);678679 break;679680 }680681 } while(mpic_irq_read(src, MPIC_INFO(IRQ_VECTOR_PRI)) & MPIC_VECPRI_MASK);···696695 /* make sure mask gets to controller before we return to user */697696 do {698697 if (!loops--) {699699- printk(KERN_ERR "mpic_enable_irq timeout\n");698698+ printk(KERN_ERR "%s: timeout on hwirq %u\n",699699+ __func__, src);700700 break;701701 }702702 } while(!(mpic_irq_read(src, MPIC_INFO(IRQ_VECTOR_PRI)) & MPIC_VECPRI_MASK));
···99CONFIG_SYSFS_DEPRECATED_V2=y1010CONFIG_BLK_DEV_INITRD=y1111# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set1212-CONFIG_EMBEDDED=y1212+CONFIG_EXPERT=y1313# CONFIG_KALLSYMS is not set1414# CONFIG_HOTPLUG is not set1515CONFIG_SLAB=y
···5050 select RTC_DRV_STARFIRE5151 select HAVE_PERF_EVENTS5252 select PERF_USE_VMALLOC5353+ select HAVE_GENERIC_HARDIRQS53545455config ARCH_DEFCONFIG5556 string···106105 def_bool y if SPARC64107106108107config NEED_PER_CPU_PAGE_FIRST_CHUNK109109- def_bool y if SPARC64110110-111111-config GENERIC_HARDIRQS_NO__DO_IRQ112112- bool113108 def_bool y if SPARC64114109115110config MMU···272275 Say Y here to experiment with turning CPUs off and on. CPUs273276 can be controlled through /sys/devices/system/cpu/cpu#.274277 Say N if you want to disable CPU hotplug.275275-276276-config GENERIC_HARDIRQS277277- bool278278- default y if SPARC64279278280279source "kernel/time/Kconfig"281280
+23-34
arch/tile/Kconfig
···11# For a description of the syntax of this configuration file,22# see Documentation/kbuild/config-language.txt.3344+config TILE55+ def_bool y66+ select HAVE_KVM if !TILEGX77+ select GENERIC_FIND_FIRST_BIT88+ select GENERIC_FIND_NEXT_BIT99+ select USE_GENERIC_SMP_HELPERS1010+ select CC_OPTIMIZE_FOR_SIZE1111+ select HAVE_GENERIC_HARDIRQS1212+ select GENERIC_IRQ_PROBE1313+ select GENERIC_PENDING_IRQ if SMP1414+1515+# FIXME: investigate whether we need/want these options.1616+# select HAVE_IOREMAP_PROT1717+# select HAVE_OPTPROBES1818+# select HAVE_REGS_AND_STACK_ACCESS_API1919+# select HAVE_HW_BREAKPOINT2020+# select PERF_EVENTS2121+# select HAVE_USER_RETURN_NOTIFIER2222+# config NO_BOOTMEM2323+# config ARCH_SUPPORTS_DEBUG_PAGEALLOC2424+# config HUGETLB_PAGE_SIZE_VARIABLE2525+426config MMU527 def_bool y628729config GENERIC_CSUM830 def_bool y99-1010-config GENERIC_HARDIRQS1111- def_bool y1212-1313-config GENERIC_HARDIRQS_NO__DO_IRQ1414- def_bool y1515-1616-config GENERIC_IRQ_PROBE1717- def_bool y1818-1919-config GENERIC_PENDING_IRQ2020- def_bool y2121- depends on GENERIC_HARDIRQS && SMP22312332config SEMAPHORE_SLEEPERS2433 def_bool y···10596config HVC_TILE10697 select HVC_DRIVER10798 def_bool y108108-109109-config TILE110110- def_bool y111111- select HAVE_KVM if !TILEGX112112- select GENERIC_FIND_FIRST_BIT113113- select GENERIC_FIND_NEXT_BIT114114- select USE_GENERIC_SMP_HELPERS115115- select CC_OPTIMIZE_FOR_SIZE116116-117117-# FIXME: investigate whether we need/want these options.118118-# select HAVE_IOREMAP_PROT119119-# select HAVE_OPTPROBES120120-# select HAVE_REGS_AND_STACK_ACCESS_API121121-# select HAVE_HW_BREAKPOINT122122-# select PERF_EVENTS123123-# select HAVE_USER_RETURN_NOTIFIER124124-# config NO_BOOTMEM125125-# config ARCH_SUPPORTS_DEBUG_PAGEALLOC126126-# config HUGETLB_PAGE_SIZE_VARIABLE127127-12899129100# Please note: TILE-Gx support is not yet finalized; this is130101# the preliminary support. TILE-Gx drivers are only provided···209220210221choice211222 depends on !TILEGX212212- prompt "Memory split" if EMBEDDED223223+ prompt "Memory split" if EXPERT213224 default VMSPLIT_3G214225 ---help---215226 Select the desired split between kernel and user memory.
+1-1
arch/tile/Kconfig.debug
···33source "lib/Kconfig.debug"4455config EARLY_PRINTK66- bool "Early printk" if EMBEDDED && DEBUG_KERNEL66+ bool "Early printk" if EXPERT && DEBUG_KERNEL77 default y88 help99 Write kernel log output directly via the hypervisor console.
+1-1
arch/tile/configs/tile_defconfig
···33CONFIG_SYSVIPC=y44CONFIG_BLK_DEV_INITRD=y55CONFIG_INITRAMFS_SOURCE="usr/contents.txt"66-CONFIG_EMBEDDED=y66+CONFIG_EXPERT=y77# CONFIG_COMPAT_BRK is not set88CONFIG_PROFILING=y99CONFIG_MODULES=y
···120120121121 If you don't know what to do, say N.122122123123-config GENERIC_HARDIRQS_NO__DO_IRQ124124- def_bool y125125-126123config NR_CPUS127124 int "Maximum number of CPUs (2-32)"128125 range 2 32
+1-1
arch/um/defconfig
···133133# CONFIG_BLK_DEV_INITRD is not set134134CONFIG_CC_OPTIMIZE_FOR_SIZE=y135135CONFIG_SYSCTL=y136136-# CONFIG_EMBEDDED is not set136136+# CONFIG_EXPERT is not set137137CONFIG_UID16=y138138CONFIG_SYSCTL_SYSCALL=y139139CONFIG_KALLSYMS=y
+10-10
arch/x86/Kconfig
···627627 as it is off-chip. APB timers are always running regardless of CPU628628 C states, they are used as per CPU clockevent device when possible.629629630630-# Mark as embedded because too many people got it wrong.630630+# Mark as expert because too many people got it wrong.631631# The code disables itself when not needed.632632config DMI633633 default y634634- bool "Enable DMI scanning" if EMBEDDED634634+ bool "Enable DMI scanning" if EXPERT635635 ---help---636636 Enabled scanning of DMI to identify machine quirks. Say Y637637 here unless you have verified that your setup is not···639639 BIOS code.640640641641config GART_IOMMU642642- bool "GART IOMMU support" if EMBEDDED642642+ bool "GART IOMMU support" if EXPERT643643 default y644644 select SWIOTLB645645 depends on X86_64 && PCI && AMD_NB···889889 depends on X86_MCE_INTEL890890891891config VM86892892- bool "Enable VM86 support" if EMBEDDED892892+ bool "Enable VM86 support" if EXPERT893893 default y894894 depends on X86_32895895 ---help---···1073107310741074choice10751075 depends on EXPERIMENTAL10761076- prompt "Memory split" if EMBEDDED10761076+ prompt "Memory split" if EXPERT10771077 default VMSPLIT_3G10781078 depends on X86_3210791079 ---help---···11351135 def_bool X86_64 || HIGHMEM64G1136113611371137config DIRECT_GBPAGES11381138- bool "Enable 1GB pages for kernel pagetables" if EMBEDDED11381138+ bool "Enable 1GB pages for kernel pagetables" if EXPERT11391139 default y11401140 depends on X86_6411411141 ---help---···1369136913701370config MTRR13711371 def_bool y13721372- prompt "MTRR (Memory Type Range Register) support" if EMBEDDED13721372+ prompt "MTRR (Memory Type Range Register) support" if EXPERT13731373 ---help---13741374 On Intel P6 family processors (Pentium Pro, Pentium II and later)13751375 the Memory Type Range Registers (MTRRs) may be used to control···1435143514361436config X86_PAT14371437 def_bool y14381438- prompt "x86 PAT support" if EMBEDDED14381438+ prompt "x86 PAT support" if EXPERT14391439 depends on MTRR14401440 ---help---14411441 Use PAT attributes to setup page level cache control.···15391539 code in physical address mode via KEXEC1540154015411541config PHYSICAL_START15421542- hex "Physical address where the kernel is loaded" if (EMBEDDED || CRASH_DUMP)15421542+ hex "Physical address where the kernel is loaded" if (EXPERT || CRASH_DUMP)15431543 default "0x1000000"15441544 ---help---15451545 This gives the physical address where the kernel is loaded.···19341934 depends on X86_64 && PCI && ACPI1935193519361936config PCI_CNB20LE_QUIRK19371937- bool "Read CNB20LE Host Bridge Windows" if EMBEDDED19371937+ bool "Read CNB20LE Host Bridge Windows" if EXPERT19381938 default n19391939 depends on PCI && EXPERIMENTAL19401940 help
+1-1
arch/x86/Kconfig.cpu
···424424 depends on !(MK6 || MWINCHIPC6 || MWINCHIP3D || MCYRIXIII || M586MMX || M586TSC || M586 || M486 || M386) && !UML425425426426menuconfig PROCESSOR_SELECT427427- bool "Supported processor vendors" if EMBEDDED427427+ bool "Supported processor vendors" if EXPERT428428 ---help---429429 This lets you choose what x86 vendor support code your kernel430430 will include.
+2-2
arch/x86/Kconfig.debug
···3131 see errors. Disable this if you want silent bootup.32323333config EARLY_PRINTK3434- bool "Early printk" if EMBEDDED3434+ bool "Early printk" if EXPERT3535 default y3636 ---help---3737 Write kernel log output directly into the VGA buffer or to a serial···138138139139config DOUBLEFAULT140140 default y141141- bool "Enable doublefault exception handler" if EMBEDDED141141+ bool "Enable doublefault exception handler" if EXPERT142142 depends on X86_32143143 ---help---144144 This option allows trapping of rare doublefault exceptions that
+2
arch/x86/include/asm/numa_32.h
···11#ifndef _ASM_X86_NUMA_32_H22#define _ASM_X86_NUMA_32_H3344+extern int numa_off;55+46extern int pxm_to_nid(int pxm);57extern void numa_remove_cpu(int cpu);68
···3434#ifdef CONFIG_X86_323535OUTPUT_ARCH(i386)3636ENTRY(phys_startup_32)3737+jiffies = jiffies_64;3738#else3839OUTPUT_ARCH(i386:x86-64)3940ENTRY(phys_startup_64)4141+jiffies_64 = jiffies;4042#endif41434244#if defined(CONFIG_X86_64) && defined(CONFIG_DEBUG_RODATA)···142140 CACHELINE_ALIGNED_DATA(L1_CACHE_BYTES)143141144142 DATA_DATA145145- /*146146- * Workaround a binutils (2.20.51.0.12 to 2.21.51.0.3) bug.147147- * This makes jiffies relocatable in such binutils148148- */149149-#ifdef CONFIG_X86_32150150- jiffies = jiffies_64;151151-#else152152- jiffies_64 = jiffies;153153-#endif154143 CONSTRUCTORS155144156145 /* rarely changed data like cpu maps */
···824824825825 for (i = FIRST_EXTERNAL_VECTOR; i < NR_VECTORS; i++) {826826 /* Some systems map "vectors" to interrupts weirdly. Not us! */827827- __get_cpu_var(vector_irq)[i] = i - FIRST_EXTERNAL_VECTOR;827827+ __this_cpu_write(vector_irq[i], i - FIRST_EXTERNAL_VECTOR);828828 if (i != SYSCALL_VECTOR)829829 set_intr_gate(i, interrupt[i - FIRST_EXTERNAL_VECTOR]);830830 }
+22
arch/x86/mm/numa.c
···22#include <linux/topology.h>33#include <linux/module.h>44#include <linux/bootmem.h>55+#include <asm/numa.h>66+#include <asm/acpi.h>77+88+int __initdata numa_off;99+1010+static __init int numa_setup(char *opt)1111+{1212+ if (!opt)1313+ return -EINVAL;1414+ if (!strncmp(opt, "off", 3))1515+ numa_off = 1;1616+#ifdef CONFIG_NUMA_EMU1717+ if (!strncmp(opt, "fake=", 5))1818+ numa_emu_cmdline(opt + 5);1919+#endif2020+#ifdef CONFIG_ACPI_NUMA2121+ if (!strncmp(opt, "noacpi", 6))2222+ acpi_numa = -1;2323+#endif2424+ return 0;2525+}2626+early_param("numa", numa_setup);527628/*729 * Which logical CPUs are on which nodes
+5-19
arch/x86/mm/numa_64.c
···3030 [0 ... MAX_LOCAL_APIC-1] = NUMA_NO_NODE3131};32323333-int numa_off __initdata;3433static unsigned long __initdata nodemap_addr;3534static unsigned long __initdata nodemap_size;3635···261262static struct bootnode nodes[MAX_NUMNODES] __initdata;262263static struct bootnode physnodes[MAX_NUMNODES] __cpuinitdata;263264static char *cmdline __initdata;265265+266266+void __init numa_emu_cmdline(char *str)267267+{268268+ cmdline = str;269269+}264270265271static int __init setup_physnodes(unsigned long start, unsigned long end,266272 int acpi, int amd)···673669674670 return pages;675671}676676-677677-static __init int numa_setup(char *opt)678678-{679679- if (!opt)680680- return -EINVAL;681681- if (!strncmp(opt, "off", 3))682682- numa_off = 1;683683-#ifdef CONFIG_NUMA_EMU684684- if (!strncmp(opt, "fake=", 5))685685- cmdline = opt + 5;686686-#endif687687-#ifdef CONFIG_ACPI_NUMA688688- if (!strncmp(opt, "noacpi", 6))689689- acpi_numa = -1;690690-#endif691691- return 0;692692-}693693-early_param("numa", numa_setup);694672695673#ifdef CONFIG_NUMA696674
-1
arch/x86/mm/srat_32.c
···5959static int __initdata num_memory_chunks; /* total number of memory chunks */6060static u8 __initdata apicid_to_pxm[MAX_APICID];61616262-int numa_off __initdata;6362int acpi_numa __initdata;64636564static __init void bad_srat(void)
···237237 p2m_top[topidx] = mid;238238 }239239240240- p2m_top[topidx][mididx] = &mfn_list[pfn];240240+ /*241241+ * As long as the mfn_list has enough entries to completely242242+ * fill a p2m page, pointing into the array is ok. But if243243+ * not the entries beyond the last pfn will be undefined.244244+ * And guessing that the 'what-ever-there-is' does not take it245245+ * too kindly when changing it to invalid markers, a new page246246+ * is allocated, initialized and filled with the valid part.247247+ */248248+ if (unlikely(pfn + P2M_PER_PAGE > max_pfn)) {249249+ unsigned long p2midx;250250+ unsigned long *p2m = extend_brk(PAGE_SIZE, PAGE_SIZE);251251+ p2m_init(p2m);252252+253253+ for (p2midx = 0; pfn + p2midx < max_pfn; p2midx++) {254254+ p2m[p2midx] = mfn_list[pfn + p2midx];255255+ }256256+ p2m_top[topidx][mididx] = p2m;257257+ } else258258+ p2m_top[topidx][mididx] = &mfn_list[pfn];241259 }242260243261 m2p_override_init();
+1-1
arch/xtensa/configs/common_defconfig
···3232# CONFIG_HOTPLUG is not set3333CONFIG_KOBJECT_UEVENT=y3434# CONFIG_IKCONFIG is not set3535-# CONFIG_EMBEDDED is not set3535+# CONFIG_EXPERT is not set3636CONFIG_KALLSYMS=y3737# CONFIG_KALLSYMS_ALL is not set3838# CONFIG_KALLSYMS_EXTRA_PASS is not set
+1-1
arch/xtensa/configs/iss_defconfig
···5555# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set5656CONFIG_SYSCTL=y5757CONFIG_ANON_INODES=y5858-CONFIG_EMBEDDED=y5858+CONFIG_EXPERT=y5959CONFIG_SYSCTL_SYSCALL=y6060CONFIG_KALLSYMS=y6161# CONFIG_KALLSYMS_ALL is not set
+1-1
arch/xtensa/configs/s6105_defconfig
···5555CONFIG_INITRAMFS_SOURCE=""5656CONFIG_CC_OPTIMIZE_FOR_SIZE=y5757CONFIG_SYSCTL=y5858-CONFIG_EMBEDDED=y5858+CONFIG_EXPERT=y5959CONFIG_SYSCTL_SYSCALL=y6060CONFIG_KALLSYMS=y6161# CONFIG_KALLSYMS_ALL is not set
+1-1
block/Kconfig
···22# Block layer core configuration33#44menuconfig BLOCK55- bool "Enable the block layer" if EMBEDDED55+ bool "Enable the block layer" if EXPERT66 default y77 help88 Provide block layer support for the kernel.
+1-2
drivers/Makefile
···2424# regulators early, since some subsystems rely on them to initialize2525obj-$(CONFIG_REGULATOR) += regulator/26262727-# char/ comes before serial/ etc so that the VT console is the boot-time2727+# tty/ comes before char/ so that the VT console is the boot-time2828# default.2929obj-y += tty/3030obj-y += char/···3838obj-$(CONFIG_FB_I810) += video/i810/3939obj-$(CONFIG_FB_INTEL) += video/intelfb/40404141-obj-y += serial/4241obj-$(CONFIG_PARPORT) += parport/4342obj-y += base/ block/ misc/ mfd/ nfc/4443obj-$(CONFIG_NUBUS) += nubus/
+1-1
drivers/acpi/Kconfig
···318318 the module will be called pci_slot.319319320320config X86_PM_TIMER321321- bool "Power Management Timer Support" if EMBEDDED321321+ bool "Power Management Timer Support" if EXPERT322322 depends on X86323323 default y324324 help
+1-1
drivers/acpi/acpica/accommon.h
···55 *****************************************************************************/6677/*88- * Copyright (C) 2000 - 2010, Intel Corp.88+ * Copyright (C) 2000 - 2011, Intel Corp.99 * All rights reserved.1010 *1111 * Redistribution and use in source and binary forms, with or without
+1-1
drivers/acpi/acpica/acconfig.h
···55 *****************************************************************************/6677/*88- * Copyright (C) 2000 - 2010, Intel Corp.88+ * Copyright (C) 2000 - 2011, Intel Corp.99 * All rights reserved.1010 *1111 * Redistribution and use in source and binary forms, with or without
+1-1
drivers/acpi/acpica/acdebug.h
···55 *****************************************************************************/6677/*88- * Copyright (C) 2000 - 2010, Intel Corp.88+ * Copyright (C) 2000 - 2011, Intel Corp.99 * All rights reserved.1010 *1111 * Redistribution and use in source and binary forms, with or without
+1-1
drivers/acpi/acpica/acdispat.h
···55 *****************************************************************************/6677/*88- * Copyright (C) 2000 - 2010, Intel Corp.88+ * Copyright (C) 2000 - 2011, Intel Corp.99 * All rights reserved.1010 *1111 * Redistribution and use in source and binary forms, with or without
+1-1
drivers/acpi/acpica/acevents.h
···55 *****************************************************************************/6677/*88- * Copyright (C) 2000 - 2010, Intel Corp.88+ * Copyright (C) 2000 - 2011, Intel Corp.99 * All rights reserved.1010 *1111 * Redistribution and use in source and binary forms, with or without
+1-1
drivers/acpi/acpica/acglobal.h
···55 *****************************************************************************/6677/*88- * Copyright (C) 2000 - 2010, Intel Corp.88+ * Copyright (C) 2000 - 2011, Intel Corp.99 * All rights reserved.1010 *1111 * Redistribution and use in source and binary forms, with or without
+1-1
drivers/acpi/acpica/achware.h
···55 *****************************************************************************/6677/*88- * Copyright (C) 2000 - 2010, Intel Corp.88+ * Copyright (C) 2000 - 2011, Intel Corp.99 * All rights reserved.1010 *1111 * Redistribution and use in source and binary forms, with or without
+1-1
drivers/acpi/acpica/acinterp.h
···55 *****************************************************************************/6677/*88- * Copyright (C) 2000 - 2010, Intel Corp.88+ * Copyright (C) 2000 - 2011, Intel Corp.99 * All rights reserved.1010 *1111 * Redistribution and use in source and binary forms, with or without
+1-1
drivers/acpi/acpica/aclocal.h
···55 *****************************************************************************/6677/*88- * Copyright (C) 2000 - 2010, Intel Corp.88+ * Copyright (C) 2000 - 2011, Intel Corp.99 * All rights reserved.1010 *1111 * Redistribution and use in source and binary forms, with or without
+1-1
drivers/acpi/acpica/acmacros.h
···55 *****************************************************************************/6677/*88- * Copyright (C) 2000 - 2010, Intel Corp.88+ * Copyright (C) 2000 - 2011, Intel Corp.99 * All rights reserved.1010 *1111 * Redistribution and use in source and binary forms, with or without
+1-1
drivers/acpi/acpica/acnamesp.h
···55 *****************************************************************************/6677/*88- * Copyright (C) 2000 - 2010, Intel Corp.88+ * Copyright (C) 2000 - 2011, Intel Corp.99 * All rights reserved.1010 *1111 * Redistribution and use in source and binary forms, with or without
+11-5
drivers/acpi/acpica/acobject.h
···66 *****************************************************************************/7788/*99- * Copyright (C) 2000 - 2010, Intel Corp.99+ * Copyright (C) 2000 - 2011, Intel Corp.1010 * All rights reserved.1111 *1212 * Redistribution and use in source and binary forms, with or without···9797#define AOPOBJ_OBJECT_INITIALIZED 0x08 /* Region is initialized, _REG was run */9898#define AOPOBJ_SETUP_COMPLETE 0x10 /* Region setup is complete */9999#define AOPOBJ_INVALID 0x20 /* Host OS won't allow a Region address */100100-#define AOPOBJ_MODULE_LEVEL 0x40 /* Method is actually module-level code */101101-#define AOPOBJ_MODIFIED_NAMESPACE 0x80 /* Method modified the namespace */102100103101/******************************************************************************104102 *···173175};174176175177struct acpi_object_method {176176- ACPI_OBJECT_COMMON_HEADER u8 method_flags;178178+ ACPI_OBJECT_COMMON_HEADER u8 info_flags;177179 u8 param_count;178180 u8 sync_level;179181 union acpi_operand_object *mutex;···181183 union {182184 ACPI_INTERNAL_METHOD implementation;183185 union acpi_operand_object *handler;184184- } extra;186186+ } dispatch;185187186188 u32 aml_length;187189 u8 thread_count;188190 acpi_owner_id owner_id;189191};192192+193193+/* Flags for info_flags field above */194194+195195+#define ACPI_METHOD_MODULE_LEVEL 0x01 /* Method is actually module-level code */196196+#define ACPI_METHOD_INTERNAL_ONLY 0x02 /* Method is implemented internally (_OSI) */197197+#define ACPI_METHOD_SERIALIZED 0x04 /* Method is serialized */198198+#define ACPI_METHOD_SERIALIZED_PENDING 0x08 /* Method is to be marked serialized */199199+#define ACPI_METHOD_MODIFIED_NAMESPACE 0x10 /* Method modified the namespace */190200191201/******************************************************************************192202 *
+1-1
drivers/acpi/acpica/acopcode.h
···55 *****************************************************************************/6677/*88- * Copyright (C) 2000 - 2010, Intel Corp.88+ * Copyright (C) 2000 - 2011, Intel Corp.99 * All rights reserved.1010 *1111 * Redistribution and use in source and binary forms, with or without
+1-1
drivers/acpi/acpica/acparser.h
···55 *****************************************************************************/6677/*88- * Copyright (C) 2000 - 2010, Intel Corp.88+ * Copyright (C) 2000 - 2011, Intel Corp.99 * All rights reserved.1010 *1111 * Redistribution and use in source and binary forms, with or without
+1-1
drivers/acpi/acpica/acpredef.h
···66 *****************************************************************************/7788/*99- * Copyright (C) 2000 - 2010, Intel Corp.99+ * Copyright (C) 2000 - 2011, Intel Corp.1010 * All rights reserved.1111 *1212 * Redistribution and use in source and binary forms, with or without
+1-1
drivers/acpi/acpica/acresrc.h
···55 *****************************************************************************/6677/*88- * Copyright (C) 2000 - 2010, Intel Corp.88+ * Copyright (C) 2000 - 2011, Intel Corp.99 * All rights reserved.1010 *1111 * Redistribution and use in source and binary forms, with or without
+1-1
drivers/acpi/acpica/acstruct.h
···55 *****************************************************************************/6677/*88- * Copyright (C) 2000 - 2010, Intel Corp.88+ * Copyright (C) 2000 - 2011, Intel Corp.99 * All rights reserved.1010 *1111 * Redistribution and use in source and binary forms, with or without
+1-1
drivers/acpi/acpica/actables.h
···55 *****************************************************************************/6677/*88- * Copyright (C) 2000 - 2010, Intel Corp.88+ * Copyright (C) 2000 - 2011, Intel Corp.99 * All rights reserved.1010 *1111 * Redistribution and use in source and binary forms, with or without
+1-1
drivers/acpi/acpica/acutils.h
···55 *****************************************************************************/6677/*88- * Copyright (C) 2000 - 2010, Intel Corp.88+ * Copyright (C) 2000 - 2011, Intel Corp.99 * All rights reserved.1010 *1111 * Redistribution and use in source and binary forms, with or without
+2-8
drivers/acpi/acpica/amlcode.h
···77 *****************************************************************************/8899/*1010- * Copyright (C) 2000 - 2010, Intel Corp.1010+ * Copyright (C) 2000 - 2011, Intel Corp.1111 * All rights reserved.1212 *1313 * Redistribution and use in source and binary forms, with or without···480480 AML_FIELD_ATTRIB_SMB_BLOCK_CALL = 0x0D481481} AML_ACCESS_ATTRIBUTE;482482483483-/* Bit fields in method_flags byte */483483+/* Bit fields in the AML method_flags byte */484484485485#define AML_METHOD_ARG_COUNT 0x07486486#define AML_METHOD_SERIALIZED 0x08487487#define AML_METHOD_SYNC_LEVEL 0xF0488488-489489-/* METHOD_FLAGS_ARG_COUNT is not used internally, define additional flags */490490-491491-#define AML_METHOD_INTERNAL_ONLY 0x01492492-#define AML_METHOD_RESERVED1 0x02493493-#define AML_METHOD_RESERVED2 0x04494488495489#endif /* __AMLCODE_H__ */
+1-1
drivers/acpi/acpica/amlresrc.h
···66 *****************************************************************************/7788/*99- * Copyright (C) 2000 - 2010, Intel Corp.99+ * Copyright (C) 2000 - 2011, Intel Corp.1010 * All rights reserved.1111 *1212 * Redistribution and use in source and binary forms, with or without
+1-1
drivers/acpi/acpica/dsfield.c
···55 *****************************************************************************/6677/*88- * Copyright (C) 2000 - 2010, Intel Corp.88+ * Copyright (C) 2000 - 2011, Intel Corp.99 * All rights reserved.1010 *1111 * Redistribution and use in source and binary forms, with or without
+1-1
drivers/acpi/acpica/dsinit.c
···55 *****************************************************************************/6677/*88- * Copyright (C) 2000 - 2010, Intel Corp.88+ * Copyright (C) 2000 - 2011, Intel Corp.99 * All rights reserved.1010 *1111 * Redistribution and use in source and binary forms, with or without
+48-16
drivers/acpi/acpica/dsmethod.c
···55 *****************************************************************************/6677/*88- * Copyright (C) 2000 - 2010, Intel Corp.88+ * Copyright (C) 2000 - 2011, Intel Corp.99 * All rights reserved.1010 *1111 * Redistribution and use in source and binary forms, with or without···43434444#include <acpi/acpi.h>4545#include "accommon.h"4646-#include "amlcode.h"4746#include "acdispat.h"4847#include "acinterp.h"4948#include "acnamesp.h"···200201 /*201202 * If this method is serialized, we need to acquire the method mutex.202203 */203203- if (obj_desc->method.method_flags & AML_METHOD_SERIALIZED) {204204+ if (obj_desc->method.info_flags & ACPI_METHOD_SERIALIZED) {204205 /*205206 * Create a mutex for the method if it is defined to be Serialized206207 * and a mutex has not already been created. We defer the mutex creation···412413413414 /* Invoke an internal method if necessary */414415415415- if (obj_desc->method.method_flags & AML_METHOD_INTERNAL_ONLY) {416416- status = obj_desc->method.extra.implementation(next_walk_state);416416+ if (obj_desc->method.info_flags & ACPI_METHOD_INTERNAL_ONLY) {417417+ status =418418+ obj_desc->method.dispatch.implementation(next_walk_state);417419 if (status == AE_OK) {418420 status = AE_CTRL_TERMINATE;419421 }···579579580580 /*581581 * Delete any namespace objects created anywhere within the582582- * namespace by the execution of this method. Unless this method583583- * is a module-level executable code method, in which case we584584- * want make the objects permanent.582582+ * namespace by the execution of this method. Unless:583583+ * 1) This method is a module-level executable code method, in which584584+ * case we want make the objects permanent.585585+ * 2) There are other threads executing the method, in which case we586586+ * will wait until the last thread has completed.585587 */586586- if (!(method_desc->method.flags & AOPOBJ_MODULE_LEVEL)) {588588+ if (!(method_desc->method.info_flags & ACPI_METHOD_MODULE_LEVEL)589589+ && (method_desc->method.thread_count == 1)) {587590588591 /* Delete any direct children of (created by) this method */589592···596593 /*597594 * Delete any objects that were created by this method598595 * elsewhere in the namespace (if any were created).596596+ * Use of the ACPI_METHOD_MODIFIED_NAMESPACE optimizes the597597+ * deletion such that we don't have to perform an entire598598+ * namespace walk for every control method execution.599599 */600600 if (method_desc->method.601601- flags & AOPOBJ_MODIFIED_NAMESPACE) {601601+ info_flags & ACPI_METHOD_MODIFIED_NAMESPACE) {602602 acpi_ns_delete_namespace_by_owner(method_desc->603603 method.604604 owner_id);605605+ method_desc->method.info_flags &=606606+ ~ACPI_METHOD_MODIFIED_NAMESPACE;605607 }606608 }607609 }···637629 * Serialized if it appears that the method is incorrectly written and638630 * does not support multiple thread execution. The best example of this639631 * is if such a method creates namespace objects and blocks. A second640640- * thread will fail with an AE_ALREADY_EXISTS exception632632+ * thread will fail with an AE_ALREADY_EXISTS exception.641633 *642634 * This code is here because we must wait until the last thread exits643643- * before creating the synchronization semaphore.635635+ * before marking the method as serialized.644636 */645645- if ((method_desc->method.method_flags & AML_METHOD_SERIALIZED)646646- && (!method_desc->method.mutex)) {647647- (void)acpi_ds_create_method_mutex(method_desc);637637+ if (method_desc->method.638638+ info_flags & ACPI_METHOD_SERIALIZED_PENDING) {639639+ if (walk_state) {640640+ ACPI_INFO((AE_INFO,641641+ "Marking method %4.4s as Serialized because of AE_ALREADY_EXISTS error",642642+ walk_state->method_node->name.643643+ ascii));644644+ }645645+646646+ /*647647+ * Method tried to create an object twice and was marked as648648+ * "pending serialized". The probable cause is that the method649649+ * cannot handle reentrancy.650650+ *651651+ * The method was created as not_serialized, but it tried to create652652+ * a named object and then blocked, causing the second thread653653+ * entrance to begin and then fail. Workaround this problem by654654+ * marking the method permanently as Serialized when the last655655+ * thread exits here.656656+ */657657+ method_desc->method.info_flags &=658658+ ~ACPI_METHOD_SERIALIZED_PENDING;659659+ method_desc->method.info_flags |=660660+ ACPI_METHOD_SERIALIZED;661661+ method_desc->method.sync_level = 0;648662 }649663650664 /* No more threads, we can free the owner_id */651665652652- if (!(method_desc->method.flags & AOPOBJ_MODULE_LEVEL)) {666666+ if (!667667+ (method_desc->method.668668+ info_flags & ACPI_METHOD_MODULE_LEVEL)) {653669 acpi_ut_release_owner_id(&method_desc->method.owner_id);654670 }655671 }
+1-1
drivers/acpi/acpica/dsmthdat.c
···55 ******************************************************************************/6677/*88- * Copyright (C) 2000 - 2010, Intel Corp.88+ * Copyright (C) 2000 - 2011, Intel Corp.99 * All rights reserved.1010 *1111 * Redistribution and use in source and binary forms, with or without
+1-1
drivers/acpi/acpica/dsobject.c
···55 *****************************************************************************/6677/*88- * Copyright (C) 2000 - 2010, Intel Corp.88+ * Copyright (C) 2000 - 2011, Intel Corp.99 * All rights reserved.1010 *1111 * Redistribution and use in source and binary forms, with or without
+1-1
drivers/acpi/acpica/dsopcode.c
···66 *****************************************************************************/7788/*99- * Copyright (C) 2000 - 2010, Intel Corp.99+ * Copyright (C) 2000 - 2011, Intel Corp.1010 * All rights reserved.1111 *1212 * Redistribution and use in source and binary forms, with or without
+1-1
drivers/acpi/acpica/dsutils.c
···55 ******************************************************************************/6677/*88- * Copyright (C) 2000 - 2010, Intel Corp.88+ * Copyright (C) 2000 - 2011, Intel Corp.99 * All rights reserved.1010 *1111 * Redistribution and use in source and binary forms, with or without
+1-1
drivers/acpi/acpica/dswexec.c
···66 *****************************************************************************/7788/*99- * Copyright (C) 2000 - 2010, Intel Corp.99+ * Copyright (C) 2000 - 2011, Intel Corp.1010 * All rights reserved.1111 *1212 * Redistribution and use in source and binary forms, with or without
+1-1
drivers/acpi/acpica/dswload.c
···55 *****************************************************************************/6677/*88- * Copyright (C) 2000 - 2010, Intel Corp.88+ * Copyright (C) 2000 - 2011, Intel Corp.99 * All rights reserved.1010 *1111 * Redistribution and use in source and binary forms, with or without
+1-1
drivers/acpi/acpica/dswscope.c
···55 *****************************************************************************/6677/*88- * Copyright (C) 2000 - 2010, Intel Corp.88+ * Copyright (C) 2000 - 2011, Intel Corp.99 * All rights reserved.1010 *1111 * Redistribution and use in source and binary forms, with or without
+1-1
drivers/acpi/acpica/dswstate.c
···55 *****************************************************************************/6677/*88- * Copyright (C) 2000 - 2010, Intel Corp.88+ * Copyright (C) 2000 - 2011, Intel Corp.99 * All rights reserved.1010 *1111 * Redistribution and use in source and binary forms, with or without
+1-1
drivers/acpi/acpica/evevent.c
···55 *****************************************************************************/6677/*88- * Copyright (C) 2000 - 2010, Intel Corp.88+ * Copyright (C) 2000 - 2011, Intel Corp.99 * All rights reserved.1010 *1111 * Redistribution and use in source and binary forms, with or without
+3-1
drivers/acpi/acpica/evgpe.c
···55 *****************************************************************************/6677/*88- * Copyright (C) 2000 - 2010, Intel Corp.88+ * Copyright (C) 2000 - 2011, Intel Corp.99 * All rights reserved.1010 *1111 * Redistribution and use in source and binary forms, with or without···471471472472 status = acpi_ut_acquire_mutex(ACPI_MTX_EVENTS);473473 if (ACPI_FAILURE(status)) {474474+ ACPI_FREE(local_gpe_event_info);474475 return_VOID;475476 }476477···479478480479 if (!acpi_ev_valid_gpe_event(gpe_event_info)) {481480 status = acpi_ut_release_mutex(ACPI_MTX_EVENTS);481481+ ACPI_FREE(local_gpe_event_info);482482 return_VOID;483483 }484484
+1-1
drivers/acpi/acpica/evgpeblk.c
···55 *****************************************************************************/6677/*88- * Copyright (C) 2000 - 2010, Intel Corp.88+ * Copyright (C) 2000 - 2011, Intel Corp.99 * All rights reserved.1010 *1111 * Redistribution and use in source and binary forms, with or without
+1-1
drivers/acpi/acpica/evgpeinit.c
···55 *****************************************************************************/6677/*88- * Copyright (C) 2000 - 2010, Intel Corp.88+ * Copyright (C) 2000 - 2011, Intel Corp.99 * All rights reserved.1010 *1111 * Redistribution and use in source and binary forms, with or without
+1-1
drivers/acpi/acpica/evgpeutil.c
···55 *****************************************************************************/6677/*88- * Copyright (C) 2000 - 2010, Intel Corp.88+ * Copyright (C) 2000 - 2011, Intel Corp.99 * All rights reserved.1010 *1111 * Redistribution and use in source and binary forms, with or without
+1-1
drivers/acpi/acpica/evmisc.c
···55 *****************************************************************************/6677/*88- * Copyright (C) 2000 - 2010, Intel Corp.88+ * Copyright (C) 2000 - 2011, Intel Corp.99 * All rights reserved.1010 *1111 * Redistribution and use in source and binary forms, with or without
+1-1
drivers/acpi/acpica/evregion.c
···55 *****************************************************************************/6677/*88- * Copyright (C) 2000 - 2010, Intel Corp.88+ * Copyright (C) 2000 - 2011, Intel Corp.99 * All rights reserved.1010 *1111 * Redistribution and use in source and binary forms, with or without
+3-3
drivers/acpi/acpica/evrgnini.c
···55 *****************************************************************************/6677/*88- * Copyright (C) 2000 - 2010, Intel Corp.88+ * Copyright (C) 2000 - 2011, Intel Corp.99 * All rights reserved.1010 *1111 * Redistribution and use in source and binary forms, with or without···590590 * See acpi_ns_exec_module_code591591 */592592 if (obj_desc->method.593593- flags & AOPOBJ_MODULE_LEVEL) {593593+ info_flags & ACPI_METHOD_MODULE_LEVEL) {594594 handler_obj =595595- obj_desc->method.extra.handler;595595+ obj_desc->method.dispatch.handler;596596 }597597 break;598598
+1-1
drivers/acpi/acpica/evsci.c
···66 ******************************************************************************/7788/*99- * Copyright (C) 2000 - 2010, Intel Corp.99+ * Copyright (C) 2000 - 2011, Intel Corp.1010 * All rights reserved.1111 *1212 * Redistribution and use in source and binary forms, with or without
+1-1
drivers/acpi/acpica/evxface.c
···55 *****************************************************************************/6677/*88- * Copyright (C) 2000 - 2010, Intel Corp.88+ * Copyright (C) 2000 - 2011, Intel Corp.99 * All rights reserved.1010 *1111 * Redistribution and use in source and binary forms, with or without
+1-1
drivers/acpi/acpica/evxfevnt.c
···55 *****************************************************************************/6677/*88- * Copyright (C) 2000 - 2010, Intel Corp.88+ * Copyright (C) 2000 - 2011, Intel Corp.99 * All rights reserved.1010 *1111 * Redistribution and use in source and binary forms, with or without
+1-1
drivers/acpi/acpica/evxfgpe.c
···55 *****************************************************************************/6677/*88- * Copyright (C) 2000 - 2010, Intel Corp.88+ * Copyright (C) 2000 - 2011, Intel Corp.99 * All rights reserved.1010 *1111 * Redistribution and use in source and binary forms, with or without
+1-1
drivers/acpi/acpica/evxfregn.c
···66 *****************************************************************************/7788/*99- * Copyright (C) 2000 - 2010, Intel Corp.99+ * Copyright (C) 2000 - 2011, Intel Corp.1010 * All rights reserved.1111 *1212 * Redistribution and use in source and binary forms, with or without
+1-1
drivers/acpi/acpica/exconfig.c
···55 *****************************************************************************/6677/*88- * Copyright (C) 2000 - 2010, Intel Corp.88+ * Copyright (C) 2000 - 2011, Intel Corp.99 * All rights reserved.1010 *1111 * Redistribution and use in source and binary forms, with or without
+1-1
drivers/acpi/acpica/exconvrt.c
···55 *****************************************************************************/6677/*88- * Copyright (C) 2000 - 2010, Intel Corp.88+ * Copyright (C) 2000 - 2011, Intel Corp.99 * All rights reserved.1010 *1111 * Redistribution and use in source and binary forms, with or without
+5-5
drivers/acpi/acpica/excreate.c
···55 *****************************************************************************/6677/*88- * Copyright (C) 2000 - 2010, Intel Corp.88+ * Copyright (C) 2000 - 2011, Intel Corp.99 * All rights reserved.1010 *1111 * Redistribution and use in source and binary forms, with or without···482482 obj_desc->method.aml_length = aml_length;483483484484 /*485485- * Disassemble the method flags. Split off the Arg Count486486- * for efficiency485485+ * Disassemble the method flags. Split off the arg_count, Serialized486486+ * flag, and sync_level for efficiency.487487 */488488 method_flags = (u8) operand[1]->integer.value;489489490490- obj_desc->method.method_flags =491491- (u8) (method_flags & ~AML_METHOD_ARG_COUNT);492490 obj_desc->method.param_count =493491 (u8) (method_flags & AML_METHOD_ARG_COUNT);494492···495497 * created for this method when it is parsed.496498 */497499 if (method_flags & AML_METHOD_SERIALIZED) {500500+ obj_desc->method.info_flags = ACPI_METHOD_SERIALIZED;501501+498502 /*499503 * ACPI 1.0: sync_level = 0500504 * ACPI 2.0: sync_level = sync_level in method declaration
+1-1
drivers/acpi/acpica/exdebug.c
···55 *****************************************************************************/6677/*88- * Copyright (C) 2000 - 2010, Intel Corp.88+ * Copyright (C) 2000 - 2011, Intel Corp.99 * All rights reserved.1010 *1111 * Redistribution and use in source and binary forms, with or without
+2-2
drivers/acpi/acpica/exdump.c
···55 *****************************************************************************/6677/*88- * Copyright (C) 2000 - 2010, Intel Corp.88+ * Copyright (C) 2000 - 2011, Intel Corp.99 * All rights reserved.1010 *1111 * Redistribution and use in source and binary forms, with or without···122122123123static struct acpi_exdump_info acpi_ex_dump_method[9] = {124124 {ACPI_EXD_INIT, ACPI_EXD_TABLE_SIZE(acpi_ex_dump_method), NULL},125125- {ACPI_EXD_UINT8, ACPI_EXD_OFFSET(method.method_flags), "Method Flags"},125125+ {ACPI_EXD_UINT8, ACPI_EXD_OFFSET(method.info_flags), "Info Flags"},126126 {ACPI_EXD_UINT8, ACPI_EXD_OFFSET(method.param_count),127127 "Parameter Count"},128128 {ACPI_EXD_UINT8, ACPI_EXD_OFFSET(method.sync_level), "Sync Level"},
+1-1
drivers/acpi/acpica/exfield.c
···55 *****************************************************************************/6677/*88- * Copyright (C) 2000 - 2010, Intel Corp.88+ * Copyright (C) 2000 - 2011, Intel Corp.99 * All rights reserved.1010 *1111 * Redistribution and use in source and binary forms, with or without
+1-1
drivers/acpi/acpica/exfldio.c
···55 *****************************************************************************/6677/*88- * Copyright (C) 2000 - 2010, Intel Corp.88+ * Copyright (C) 2000 - 2011, Intel Corp.99 * All rights reserved.1010 *1111 * Redistribution and use in source and binary forms, with or without
+1-1
drivers/acpi/acpica/exmisc.c
···66 *****************************************************************************/7788/*99- * Copyright (C) 2000 - 2010, Intel Corp.99+ * Copyright (C) 2000 - 2011, Intel Corp.1010 * All rights reserved.1111 *1212 * Redistribution and use in source and binary forms, with or without
+1-1
drivers/acpi/acpica/exmutex.c
···66 *****************************************************************************/7788/*99- * Copyright (C) 2000 - 2010, Intel Corp.99+ * Copyright (C) 2000 - 2011, Intel Corp.1010 * All rights reserved.1111 *1212 * Redistribution and use in source and binary forms, with or without
+1-1
drivers/acpi/acpica/exnames.c
···66 *****************************************************************************/7788/*99- * Copyright (C) 2000 - 2010, Intel Corp.99+ * Copyright (C) 2000 - 2011, Intel Corp.1010 * All rights reserved.1111 *1212 * Redistribution and use in source and binary forms, with or without
+1-1
drivers/acpi/acpica/exoparg1.c
···66 *****************************************************************************/7788/*99- * Copyright (C) 2000 - 2010, Intel Corp.99+ * Copyright (C) 2000 - 2011, Intel Corp.1010 * All rights reserved.1111 *1212 * Redistribution and use in source and binary forms, with or without
+1-1
drivers/acpi/acpica/exoparg2.c
···55 *****************************************************************************/6677/*88- * Copyright (C) 2000 - 2010, Intel Corp.88+ * Copyright (C) 2000 - 2011, Intel Corp.99 * All rights reserved.1010 *1111 * Redistribution and use in source and binary forms, with or without
+1-1
drivers/acpi/acpica/exoparg3.c
···66 *****************************************************************************/7788/*99- * Copyright (C) 2000 - 2010, Intel Corp.99+ * Copyright (C) 2000 - 2011, Intel Corp.1010 * All rights reserved.1111 *1212 * Redistribution and use in source and binary forms, with or without
+1-1
drivers/acpi/acpica/exoparg6.c
···66 *****************************************************************************/7788/*99- * Copyright (C) 2000 - 2010, Intel Corp.99+ * Copyright (C) 2000 - 2011, Intel Corp.1010 * All rights reserved.1111 *1212 * Redistribution and use in source and binary forms, with or without
+1-1
drivers/acpi/acpica/exprep.c
···66 *****************************************************************************/7788/*99- * Copyright (C) 2000 - 2010, Intel Corp.99+ * Copyright (C) 2000 - 2011, Intel Corp.1010 * All rights reserved.1111 *1212 * Redistribution and use in source and binary forms, with or without
+1-1
drivers/acpi/acpica/exregion.c
···66 *****************************************************************************/7788/*99- * Copyright (C) 2000 - 2010, Intel Corp.99+ * Copyright (C) 2000 - 2011, Intel Corp.1010 * All rights reserved.1111 *1212 * Redistribution and use in source and binary forms, with or without
+1-1
drivers/acpi/acpica/exresnte.c
···66 *****************************************************************************/7788/*99- * Copyright (C) 2000 - 2010, Intel Corp.99+ * Copyright (C) 2000 - 2011, Intel Corp.1010 * All rights reserved.1111 *1212 * Redistribution and use in source and binary forms, with or without
+1-1
drivers/acpi/acpica/exresolv.c
···66 *****************************************************************************/7788/*99- * Copyright (C) 2000 - 2010, Intel Corp.99+ * Copyright (C) 2000 - 2011, Intel Corp.1010 * All rights reserved.1111 *1212 * Redistribution and use in source and binary forms, with or without
+1-1
drivers/acpi/acpica/exresop.c
···66 *****************************************************************************/7788/*99- * Copyright (C) 2000 - 2010, Intel Corp.99+ * Copyright (C) 2000 - 2011, Intel Corp.1010 * All rights reserved.1111 *1212 * Redistribution and use in source and binary forms, with or without
+1-1
drivers/acpi/acpica/exstore.c
···55 *****************************************************************************/6677/*88- * Copyright (C) 2000 - 2010, Intel Corp.88+ * Copyright (C) 2000 - 2011, Intel Corp.99 * All rights reserved.1010 *1111 * Redistribution and use in source and binary forms, with or without
+1-1
drivers/acpi/acpica/exstoren.c
···77 *****************************************************************************/8899/*1010- * Copyright (C) 2000 - 2010, Intel Corp.1010+ * Copyright (C) 2000 - 2011, Intel Corp.1111 * All rights reserved.1212 *1313 * Redistribution and use in source and binary forms, with or without
+1-1
drivers/acpi/acpica/exstorob.c
···66 *****************************************************************************/7788/*99- * Copyright (C) 2000 - 2010, Intel Corp.99+ * Copyright (C) 2000 - 2011, Intel Corp.1010 * All rights reserved.1111 *1212 * Redistribution and use in source and binary forms, with or without
+1-1
drivers/acpi/acpica/exsystem.c
···66 *****************************************************************************/7788/*99- * Copyright (C) 2000 - 2010, Intel Corp.99+ * Copyright (C) 2000 - 2011, Intel Corp.1010 * All rights reserved.1111 *1212 * Redistribution and use in source and binary forms, with or without
+1-1
drivers/acpi/acpica/exutils.c
···66 *****************************************************************************/7788/*99- * Copyright (C) 2000 - 2010, Intel Corp.99+ * Copyright (C) 2000 - 2011, Intel Corp.1010 * All rights reserved.1111 *1212 * Redistribution and use in source and binary forms, with or without
+1-1
drivers/acpi/acpica/hwacpi.c
···66 *****************************************************************************/7788/*99- * Copyright (C) 2000 - 2010, Intel Corp.99+ * Copyright (C) 2000 - 2011, Intel Corp.1010 * All rights reserved.1111 *1212 * Redistribution and use in source and binary forms, with or without
+1-1
drivers/acpi/acpica/hwgpe.c
···66 *****************************************************************************/7788/*99- * Copyright (C) 2000 - 2010, Intel Corp.99+ * Copyright (C) 2000 - 2011, Intel Corp.1010 * All rights reserved.1111 *1212 * Redistribution and use in source and binary forms, with or without
+1-1
drivers/acpi/acpica/hwpci.c
···55 ******************************************************************************/6677/*88- * Copyright (C) 2000 - 2010, Intel Corp.88+ * Copyright (C) 2000 - 2011, Intel Corp.99 * All rights reserved.1010 *1111 * Redistribution and use in source and binary forms, with or without
+1-1
drivers/acpi/acpica/hwregs.c
···77 ******************************************************************************/8899/*1010- * Copyright (C) 2000 - 2010, Intel Corp.1010+ * Copyright (C) 2000 - 2011, Intel Corp.1111 * All rights reserved.1212 *1313 * Redistribution and use in source and binary forms, with or without
+1-1
drivers/acpi/acpica/hwsleep.c
···66 *****************************************************************************/7788/*99- * Copyright (C) 2000 - 2010, Intel Corp.99+ * Copyright (C) 2000 - 2011, Intel Corp.1010 * All rights reserved.1111 *1212 * Redistribution and use in source and binary forms, with or without
+1-1
drivers/acpi/acpica/hwtimer.c
···66 *****************************************************************************/7788/*99- * Copyright (C) 2000 - 2010, Intel Corp.99+ * Copyright (C) 2000 - 2011, Intel Corp.1010 * All rights reserved.1111 *1212 * Redistribution and use in source and binary forms, with or without
+1-1
drivers/acpi/acpica/hwvalid.c
···66 *****************************************************************************/7788/*99- * Copyright (C) 2000 - 2010, Intel Corp.99+ * Copyright (C) 2000 - 2011, Intel Corp.1010 * All rights reserved.1111 *1212 * Redistribution and use in source and binary forms, with or without
+1-1
drivers/acpi/acpica/hwxface.c
···66 *****************************************************************************/7788/*99- * Copyright (C) 2000 - 2010, Intel Corp.99+ * Copyright (C) 2000 - 2011, Intel Corp.1010 * All rights reserved.1111 *1212 * Redistribution and use in source and binary forms, with or without
+4-4
drivers/acpi/acpica/nsaccess.c
···55 ******************************************************************************/6677/*88- * Copyright (C) 2000 - 2010, Intel Corp.88+ * Copyright (C) 2000 - 2011, Intel Corp.99 * All rights reserved.1010 *1111 * Redistribution and use in source and binary forms, with or without···163163#else164164 /* Mark this as a very SPECIAL method */165165166166- obj_desc->method.method_flags =167167- AML_METHOD_INTERNAL_ONLY;168168- obj_desc->method.extra.implementation =166166+ obj_desc->method.info_flags =167167+ ACPI_METHOD_INTERNAL_ONLY;168168+ obj_desc->method.dispatch.implementation =169169 acpi_ut_osi_implementation;170170#endif171171 break;
+12-3
drivers/acpi/acpica/nsalloc.c
···55 ******************************************************************************/6677/*88- * Copyright (C) 2000 - 2010, Intel Corp.88+ * Copyright (C) 2000 - 2011, Intel Corp.99 * All rights reserved.1010 *1111 * Redistribution and use in source and binary forms, with or without···234234 * modified the namespace. This is used for cleanup when the235235 * method exits.236236 */237237- walk_state->method_desc->method.flags |=238238- AOPOBJ_MODIFIED_NAMESPACE;237237+ walk_state->method_desc->method.info_flags |=238238+ ACPI_METHOD_MODIFIED_NAMESPACE;239239 }240240 }241241···341341{342342 struct acpi_namespace_node *child_node = NULL;343343 u32 level = 1;344344+ acpi_status status;344345345346 ACPI_FUNCTION_TRACE(ns_delete_namespace_subtree);346347347348 if (!parent_node) {349349+ return_VOID;350350+ }351351+352352+ /* Lock namespace for possible update */353353+354354+ status = acpi_ut_acquire_mutex(ACPI_MTX_NAMESPACE);355355+ if (ACPI_FAILURE(status)) {348356 return_VOID;349357 }350358···405397 }406398 }407399400400+ (void)acpi_ut_release_mutex(ACPI_MTX_NAMESPACE);408401 return_VOID;409402}410403
+16-1
drivers/acpi/acpica/nsdump.c
···55 *****************************************************************************/6677/*88- * Copyright (C) 2000 - 2010, Intel Corp.88+ * Copyright (C) 2000 - 2011, Intel Corp.99 * All rights reserved.1010 *1111 * Redistribution and use in source and binary forms, with or without···624624 acpi_owner_id owner_id, acpi_handle start_handle)625625{626626 struct acpi_walk_info info;627627+ acpi_status status;627628628629 ACPI_FUNCTION_ENTRY();630630+631631+ /*632632+ * Just lock the entire namespace for the duration of the dump.633633+ * We don't want any changes to the namespace during this time,634634+ * especially the temporary nodes since we are going to display635635+ * them also.636636+ */637637+ status = acpi_ut_acquire_mutex(ACPI_MTX_NAMESPACE);638638+ if (ACPI_FAILURE(status)) {639639+ acpi_os_printf("Could not acquire namespace mutex\n");640640+ return;641641+ }629642630643 info.debug_level = ACPI_LV_TABLES;631644 info.owner_id = owner_id;···649636 ACPI_NS_WALK_TEMP_NODES,650637 acpi_ns_dump_one_object, NULL,651638 (void *)&info, NULL);639639+640640+ (void)acpi_ut_release_mutex(ACPI_MTX_NAMESPACE);652641}653642#endif /* ACPI_FUTURE_USAGE */654643
+1-1
drivers/acpi/acpica/nsdumpdv.c
···55 *****************************************************************************/6677/*88- * Copyright (C) 2000 - 2010, Intel Corp.88+ * Copyright (C) 2000 - 2011, Intel Corp.99 * All rights reserved.1010 *1111 * Redistribution and use in source and binary forms, with or without
+2-2
drivers/acpi/acpica/nseval.c
···55 ******************************************************************************/6677/*88- * Copyright (C) 2000 - 2010, Intel Corp.88+ * Copyright (C) 2000 - 2011, Intel Corp.99 * All rights reserved.1010 *1111 * Redistribution and use in source and binary forms, with or without···389389 * acpi_gbl_root_node->Object is NULL at PASS1.390390 */391391 if ((type == ACPI_TYPE_DEVICE) && parent_node->object) {392392- method_obj->method.extra.handler =392392+ method_obj->method.dispatch.handler =393393 parent_node->object->device.handler;394394 }395395
+1-1
drivers/acpi/acpica/nsinit.c
···55 *****************************************************************************/6677/*88- * Copyright (C) 2000 - 2010, Intel Corp.88+ * Copyright (C) 2000 - 2011, Intel Corp.99 * All rights reserved.1010 *1111 * Redistribution and use in source and binary forms, with or without
+1-1
drivers/acpi/acpica/nsload.c
···55 *****************************************************************************/6677/*88- * Copyright (C) 2000 - 2010, Intel Corp.88+ * Copyright (C) 2000 - 2011, Intel Corp.99 * All rights reserved.1010 *1111 * Redistribution and use in source and binary forms, with or without
+1-1
drivers/acpi/acpica/nsnames.c
···55 ******************************************************************************/6677/*88- * Copyright (C) 2000 - 2010, Intel Corp.88+ * Copyright (C) 2000 - 2011, Intel Corp.99 * All rights reserved.1010 *1111 * Redistribution and use in source and binary forms, with or without
+1-1
drivers/acpi/acpica/nsobject.c
···66 ******************************************************************************/7788/*99- * Copyright (C) 2000 - 2010, Intel Corp.99+ * Copyright (C) 2000 - 2011, Intel Corp.1010 * All rights reserved.1111 *1212 * Redistribution and use in source and binary forms, with or without
+1-1
drivers/acpi/acpica/nsparse.c
···55 *****************************************************************************/6677/*88- * Copyright (C) 2000 - 2010, Intel Corp.88+ * Copyright (C) 2000 - 2011, Intel Corp.99 * All rights reserved.1010 *1111 * Redistribution and use in source and binary forms, with or without
+1-1
drivers/acpi/acpica/nspredef.c
···66 *****************************************************************************/7788/*99- * Copyright (C) 2000 - 2010, Intel Corp.99+ * Copyright (C) 2000 - 2011, Intel Corp.1010 * All rights reserved.1111 *1212 * Redistribution and use in source and binary forms, with or without
+1-1
drivers/acpi/acpica/nsrepair.c
···55 *****************************************************************************/6677/*88- * Copyright (C) 2000 - 2010, Intel Corp.88+ * Copyright (C) 2000 - 2011, Intel Corp.99 * All rights reserved.1010 *1111 * Redistribution and use in source and binary forms, with or without
+1-1
drivers/acpi/acpica/nsrepair2.c
···66 *****************************************************************************/7788/*99- * Copyright (C) 2000 - 2010, Intel Corp.99+ * Copyright (C) 2000 - 2011, Intel Corp.1010 * All rights reserved.1111 *1212 * Redistribution and use in source and binary forms, with or without
+1-1
drivers/acpi/acpica/nssearch.c
···55 ******************************************************************************/6677/*88- * Copyright (C) 2000 - 2010, Intel Corp.88+ * Copyright (C) 2000 - 2011, Intel Corp.99 * All rights reserved.1010 *1111 * Redistribution and use in source and binary forms, with or without
+1-1
drivers/acpi/acpica/nsutils.c
···66 *****************************************************************************/7788/*99- * Copyright (C) 2000 - 2010, Intel Corp.99+ * Copyright (C) 2000 - 2011, Intel Corp.1010 * All rights reserved.1111 *1212 * Redistribution and use in source and binary forms, with or without
+1-1
drivers/acpi/acpica/nswalk.c
···55 *****************************************************************************/6677/*88- * Copyright (C) 2000 - 2010, Intel Corp.88+ * Copyright (C) 2000 - 2011, Intel Corp.99 * All rights reserved.1010 *1111 * Redistribution and use in source and binary forms, with or without
+1-1
drivers/acpi/acpica/nsxfeval.c
···66 ******************************************************************************/7788/*99- * Copyright (C) 2000 - 2010, Intel Corp.99+ * Copyright (C) 2000 - 2011, Intel Corp.1010 * All rights reserved.1111 *1212 * Redistribution and use in source and binary forms, with or without
+3-4
drivers/acpi/acpica/nsxfname.c
···66 *****************************************************************************/7788/*99- * Copyright (C) 2000 - 2010, Intel Corp.99+ * Copyright (C) 2000 - 2011, Intel Corp.1010 * All rights reserved.1111 *1212 * Redistribution and use in source and binary forms, with or without···603603 method_obj->method.param_count = (u8)604604 (method_flags & AML_METHOD_ARG_COUNT);605605606606- method_obj->method.method_flags = (u8)607607- (method_flags & ~AML_METHOD_ARG_COUNT);608608-609606 if (method_flags & AML_METHOD_SERIALIZED) {607607+ method_obj->method.info_flags = ACPI_METHOD_SERIALIZED;608608+610609 method_obj->method.sync_level = (u8)611610 ((method_flags & AML_METHOD_SYNC_LEVEL) >> 4);612611 }
+1-1
drivers/acpi/acpica/nsxfobj.c
···66 ******************************************************************************/7788/*99- * Copyright (C) 2000 - 2010, Intel Corp.99+ * Copyright (C) 2000 - 2011, Intel Corp.1010 * All rights reserved.1111 *1212 * Redistribution and use in source and binary forms, with or without
+1-1
drivers/acpi/acpica/psargs.c
···55 *****************************************************************************/6677/*88- * Copyright (C) 2000 - 2010, Intel Corp.88+ * Copyright (C) 2000 - 2011, Intel Corp.99 * All rights reserved.1010 *1111 * Redistribution and use in source and binary forms, with or without
+2-2
drivers/acpi/acpica/psloop.c
···55 *****************************************************************************/6677/*88- * Copyright (C) 2000 - 2010, Intel Corp.88+ * Copyright (C) 2000 - 2011, Intel Corp.99 * All rights reserved.1010 *1111 * Redistribution and use in source and binary forms, with or without···655655 method_obj->method.aml_start = aml_start;656656 method_obj->method.aml_length = aml_length;657657 method_obj->method.owner_id = owner_id;658658- method_obj->method.flags |= AOPOBJ_MODULE_LEVEL;658658+ method_obj->method.info_flags |= ACPI_METHOD_MODULE_LEVEL;659659660660 /*661661 * Save the parent node in next_object. This is cheating, but we
+1-1
drivers/acpi/acpica/psopcode.c
···55 *****************************************************************************/6677/*88- * Copyright (C) 2000 - 2010, Intel Corp.88+ * Copyright (C) 2000 - 2011, Intel Corp.99 * All rights reserved.1010 *1111 * Redistribution and use in source and binary forms, with or without
+9-18
drivers/acpi/acpica/psparse.c
···55 *****************************************************************************/6677/*88- * Copyright (C) 2000 - 2010, Intel Corp.88+ * Copyright (C) 2000 - 2011, Intel Corp.99 * All rights reserved.1010 *1111 * Redistribution and use in source and binary forms, with or without···5555#include "acparser.h"5656#include "acdispat.h"5757#include "amlcode.h"5858-#include "acnamesp.h"5958#include "acinterp.h"60596160#define _COMPONENT ACPI_PARSER···538539 /* Check for possible multi-thread reentrancy problem */539540540541 if ((status == AE_ALREADY_EXISTS) &&541541- (!walk_state->method_desc->method.mutex)) {542542- ACPI_INFO((AE_INFO,543543- "Marking method %4.4s as Serialized because of AE_ALREADY_EXISTS error",544544- walk_state->method_node->name.545545- ascii));546546-542542+ (!(walk_state->method_desc->method.543543+ info_flags & ACPI_METHOD_SERIALIZED))) {547544 /*548548- * Method tried to create an object twice. The probable cause is549549- * that the method cannot handle reentrancy.550550- *551551- * The method is marked not_serialized, but it tried to create552552- * a named object, causing the second thread entrance to fail.553553- * Workaround this problem by marking the method permanently554554- * as Serialized.545545+ * Method is not serialized and tried to create an object546546+ * twice. The probable cause is that the method cannot547547+ * handle reentrancy. Mark as "pending serialized" now, and548548+ * then mark "serialized" when the last thread exits.555549 */556556- walk_state->method_desc->method.method_flags |=557557- AML_METHOD_SERIALIZED;558558- walk_state->method_desc->method.sync_level = 0;550550+ walk_state->method_desc->method.info_flags |=551551+ ACPI_METHOD_SERIALIZED_PENDING;559552 }560553 }561554
+1-1
drivers/acpi/acpica/psscope.c
···55 *****************************************************************************/6677/*88- * Copyright (C) 2000 - 2010, Intel Corp.88+ * Copyright (C) 2000 - 2011, Intel Corp.99 * All rights reserved.1010 *1111 * Redistribution and use in source and binary forms, with or without
+1-1
drivers/acpi/acpica/pstree.c
···55 *****************************************************************************/6677/*88- * Copyright (C) 2000 - 2010, Intel Corp.88+ * Copyright (C) 2000 - 2011, Intel Corp.99 * All rights reserved.1010 *1111 * Redistribution and use in source and binary forms, with or without
+1-1
drivers/acpi/acpica/psutils.c
···55 *****************************************************************************/6677/*88- * Copyright (C) 2000 - 2010, Intel Corp.88+ * Copyright (C) 2000 - 2011, Intel Corp.99 * All rights reserved.1010 *1111 * Redistribution and use in source and binary forms, with or without
+1-1
drivers/acpi/acpica/pswalk.c
···55 *****************************************************************************/6677/*88- * Copyright (C) 2000 - 2010, Intel Corp.88+ * Copyright (C) 2000 - 2011, Intel Corp.99 * All rights reserved.1010 *1111 * Redistribution and use in source and binary forms, with or without
+4-5
drivers/acpi/acpica/psxface.c
···55 *****************************************************************************/6677/*88- * Copyright (C) 2000 - 2010, Intel Corp.88+ * Copyright (C) 2000 - 2011, Intel Corp.99 * All rights reserved.1010 *1111 * Redistribution and use in source and binary forms, with or without···4747#include "acdispat.h"4848#include "acinterp.h"4949#include "actables.h"5050-#include "amlcode.h"51505251#define _COMPONENT ACPI_PARSER5352ACPI_MODULE_NAME("psxface")···284285 goto cleanup;285286 }286287287287- if (info->obj_desc->method.flags & AOPOBJ_MODULE_LEVEL) {288288+ if (info->obj_desc->method.info_flags & ACPI_METHOD_MODULE_LEVEL) {288289 walk_state->parse_flags |= ACPI_PARSE_MODULE_LEVEL;289290 }290291291292 /* Invoke an internal method if necessary */292293293293- if (info->obj_desc->method.method_flags & AML_METHOD_INTERNAL_ONLY) {294294+ if (info->obj_desc->method.info_flags & ACPI_METHOD_INTERNAL_ONLY) {294295 status =295295- info->obj_desc->method.extra.implementation(walk_state);296296+ info->obj_desc->method.dispatch.implementation(walk_state);296297 info->return_object = walk_state->return_desc;297298298299 /* Cleanup states */
+1-1
drivers/acpi/acpica/rsaddr.c
···55 ******************************************************************************/6677/*88- * Copyright (C) 2000 - 2010, Intel Corp.88+ * Copyright (C) 2000 - 2011, Intel Corp.99 * All rights reserved.1010 *1111 * Redistribution and use in source and binary forms, with or without
+1-1
drivers/acpi/acpica/rscalc.c
···55 ******************************************************************************/6677/*88- * Copyright (C) 2000 - 2010, Intel Corp.88+ * Copyright (C) 2000 - 2011, Intel Corp.99 * All rights reserved.1010 *1111 * Redistribution and use in source and binary forms, with or without
+1-1
drivers/acpi/acpica/rscreate.c
···55 ******************************************************************************/6677/*88- * Copyright (C) 2000 - 2010, Intel Corp.88+ * Copyright (C) 2000 - 2011, Intel Corp.99 * All rights reserved.1010 *1111 * Redistribution and use in source and binary forms, with or without
+1-1
drivers/acpi/acpica/rsdump.c
···55 ******************************************************************************/6677/*88- * Copyright (C) 2000 - 2010, Intel Corp.88+ * Copyright (C) 2000 - 2011, Intel Corp.99 * All rights reserved.1010 *1111 * Redistribution and use in source and binary forms, with or without
+1-1
drivers/acpi/acpica/rsinfo.c
···55 ******************************************************************************/6677/*88- * Copyright (C) 2000 - 2010, Intel Corp.88+ * Copyright (C) 2000 - 2011, Intel Corp.99 * All rights reserved.1010 *1111 * Redistribution and use in source and binary forms, with or without
+1-1
drivers/acpi/acpica/rsio.c
···55 ******************************************************************************/6677/*88- * Copyright (C) 2000 - 2010, Intel Corp.88+ * Copyright (C) 2000 - 2011, Intel Corp.99 * All rights reserved.1010 *1111 * Redistribution and use in source and binary forms, with or without
+1-1
drivers/acpi/acpica/rsirq.c
···55 ******************************************************************************/6677/*88- * Copyright (C) 2000 - 2010, Intel Corp.88+ * Copyright (C) 2000 - 2011, Intel Corp.99 * All rights reserved.1010 *1111 * Redistribution and use in source and binary forms, with or without
+1-1
drivers/acpi/acpica/rslist.c
···55 ******************************************************************************/6677/*88- * Copyright (C) 2000 - 2010, Intel Corp.88+ * Copyright (C) 2000 - 2011, Intel Corp.99 * All rights reserved.1010 *1111 * Redistribution and use in source and binary forms, with or without
+1-1
drivers/acpi/acpica/rsmemory.c
···55 ******************************************************************************/6677/*88- * Copyright (C) 2000 - 2010, Intel Corp.88+ * Copyright (C) 2000 - 2011, Intel Corp.99 * All rights reserved.1010 *1111 * Redistribution and use in source and binary forms, with or without
+1-1
drivers/acpi/acpica/rsmisc.c
···55 ******************************************************************************/6677/*88- * Copyright (C) 2000 - 2010, Intel Corp.88+ * Copyright (C) 2000 - 2011, Intel Corp.99 * All rights reserved.1010 *1111 * Redistribution and use in source and binary forms, with or without
+1-1
drivers/acpi/acpica/rsutils.c
···55 ******************************************************************************/6677/*88- * Copyright (C) 2000 - 2010, Intel Corp.88+ * Copyright (C) 2000 - 2011, Intel Corp.99 * All rights reserved.1010 *1111 * Redistribution and use in source and binary forms, with or without
+1-1
drivers/acpi/acpica/rsxface.c
···55 ******************************************************************************/6677/*88- * Copyright (C) 2000 - 2010, Intel Corp.88+ * Copyright (C) 2000 - 2011, Intel Corp.99 * All rights reserved.1010 *1111 * Redistribution and use in source and binary forms, with or without
+1-1
drivers/acpi/acpica/tbfadt.c
···55 *****************************************************************************/6677/*88- * Copyright (C) 2000 - 2010, Intel Corp.88+ * Copyright (C) 2000 - 2011, Intel Corp.99 * All rights reserved.1010 *1111 * Redistribution and use in source and binary forms, with or without
+1-1
drivers/acpi/acpica/tbfind.c
···55 *****************************************************************************/6677/*88- * Copyright (C) 2000 - 2010, Intel Corp.88+ * Copyright (C) 2000 - 2011, Intel Corp.99 * All rights reserved.1010 *1111 * Redistribution and use in source and binary forms, with or without
+1-1
drivers/acpi/acpica/tbinstal.c
···55 *****************************************************************************/6677/*88- * Copyright (C) 2000 - 2010, Intel Corp.88+ * Copyright (C) 2000 - 2011, Intel Corp.99 * All rights reserved.1010 *1111 * Redistribution and use in source and binary forms, with or without
+1-1
drivers/acpi/acpica/tbutils.c
···55 *****************************************************************************/6677/*88- * Copyright (C) 2000 - 2010, Intel Corp.88+ * Copyright (C) 2000 - 2011, Intel Corp.99 * All rights reserved.1010 *1111 * Redistribution and use in source and binary forms, with or without
+1-1
drivers/acpi/acpica/tbxface.c
···66 *****************************************************************************/7788/*99- * Copyright (C) 2000 - 2010, Intel Corp.99+ * Copyright (C) 2000 - 2011, Intel Corp.1010 * All rights reserved.1111 *1212 * Redistribution and use in source and binary forms, with or without
+1-1
drivers/acpi/acpica/tbxfroot.c
···55 *****************************************************************************/6677/*88- * Copyright (C) 2000 - 2010, Intel Corp.88+ * Copyright (C) 2000 - 2011, Intel Corp.99 * All rights reserved.1010 *1111 * Redistribution and use in source and binary forms, with or without
+1-1
drivers/acpi/acpica/utalloc.c
···55 *****************************************************************************/6677/*88- * Copyright (C) 2000 - 2010, Intel Corp.88+ * Copyright (C) 2000 - 2011, Intel Corp.99 * All rights reserved.1010 *1111 * Redistribution and use in source and binary forms, with or without
+1-1
drivers/acpi/acpica/utcopy.c
···55 *****************************************************************************/6677/*88- * Copyright (C) 2000 - 2010, Intel Corp.88+ * Copyright (C) 2000 - 2011, Intel Corp.99 * All rights reserved.1010 *1111 * Redistribution and use in source and binary forms, with or without
+1-1
drivers/acpi/acpica/utdebug.c
···55 *****************************************************************************/6677/*88- * Copyright (C) 2000 - 2010, Intel Corp.88+ * Copyright (C) 2000 - 2011, Intel Corp.99 * All rights reserved.1010 *1111 * Redistribution and use in source and binary forms, with or without
+1-1
drivers/acpi/acpica/utdelete.c
···55 ******************************************************************************/6677/*88- * Copyright (C) 2000 - 2010, Intel Corp.88+ * Copyright (C) 2000 - 2011, Intel Corp.99 * All rights reserved.1010 *1111 * Redistribution and use in source and binary forms, with or without
+1-1
drivers/acpi/acpica/uteval.c
···55 *****************************************************************************/6677/*88- * Copyright (C) 2000 - 2010, Intel Corp.88+ * Copyright (C) 2000 - 2011, Intel Corp.99 * All rights reserved.1010 *1111 * Redistribution and use in source and binary forms, with or without
+1-1
drivers/acpi/acpica/utglobal.c
···55 *****************************************************************************/6677/*88- * Copyright (C) 2000 - 2010, Intel Corp.88+ * Copyright (C) 2000 - 2011, Intel Corp.99 * All rights reserved.1010 *1111 * Redistribution and use in source and binary forms, with or without
+1-1
drivers/acpi/acpica/utids.c
···55 *****************************************************************************/6677/*88- * Copyright (C) 2000 - 2010, Intel Corp.88+ * Copyright (C) 2000 - 2011, Intel Corp.99 * All rights reserved.1010 *1111 * Redistribution and use in source and binary forms, with or without
+1-1
drivers/acpi/acpica/utinit.c
···55 *****************************************************************************/6677/*88- * Copyright (C) 2000 - 2010, Intel Corp.88+ * Copyright (C) 2000 - 2011, Intel Corp.99 * All rights reserved.1010 *1111 * Redistribution and use in source and binary forms, with or without
+1-1
drivers/acpi/acpica/utlock.c
···55 *****************************************************************************/6677/*88- * Copyright (C) 2000 - 2010, Intel Corp.88+ * Copyright (C) 2000 - 2011, Intel Corp.99 * All rights reserved.1010 *1111 * Redistribution and use in source and binary forms, with or without
+1-1
drivers/acpi/acpica/utmath.c
···55 ******************************************************************************/6677/*88- * Copyright (C) 2000 - 2010, Intel Corp.88+ * Copyright (C) 2000 - 2011, Intel Corp.99 * All rights reserved.1010 *1111 * Redistribution and use in source and binary forms, with or without
+1-1
drivers/acpi/acpica/utmisc.c
···55 ******************************************************************************/6677/*88- * Copyright (C) 2000 - 2010, Intel Corp.88+ * Copyright (C) 2000 - 2011, Intel Corp.99 * All rights reserved.1010 *1111 * Redistribution and use in source and binary forms, with or without
+1-1
drivers/acpi/acpica/utmutex.c
···55 ******************************************************************************/6677/*88- * Copyright (C) 2000 - 2010, Intel Corp.88+ * Copyright (C) 2000 - 2011, Intel Corp.99 * All rights reserved.1010 *1111 * Redistribution and use in source and binary forms, with or without
+1-1
drivers/acpi/acpica/utobject.c
···55 *****************************************************************************/6677/*88- * Copyright (C) 2000 - 2010, Intel Corp.88+ * Copyright (C) 2000 - 2011, Intel Corp.99 * All rights reserved.1010 *1111 * Redistribution and use in source and binary forms, with or without
+1-1
drivers/acpi/acpica/utosi.c
···55 *****************************************************************************/6677/*88- * Copyright (C) 2000 - 2010, Intel Corp.88+ * Copyright (C) 2000 - 2011, Intel Corp.99 * All rights reserved.1010 *1111 * Redistribution and use in source and binary forms, with or without
+1-1
drivers/acpi/acpica/utresrc.c
···55 ******************************************************************************/6677/*88- * Copyright (C) 2000 - 2010, Intel Corp.88+ * Copyright (C) 2000 - 2011, Intel Corp.99 * All rights reserved.1010 *1111 * Redistribution and use in source and binary forms, with or without
+1-1
drivers/acpi/acpica/utstate.c
···55 ******************************************************************************/6677/*88- * Copyright (C) 2000 - 2010, Intel Corp.88+ * Copyright (C) 2000 - 2011, Intel Corp.99 * All rights reserved.1010 *1111 * Redistribution and use in source and binary forms, with or without
+1-1
drivers/acpi/acpica/utxface.c
···55 *****************************************************************************/6677/*88- * Copyright (C) 2000 - 2010, Intel Corp.88+ * Copyright (C) 2000 - 2011, Intel Corp.99 * All rights reserved.1010 *1111 * Redistribution and use in source and binary forms, with or without
+1-1
drivers/acpi/acpica/utxferror.c
···55 ******************************************************************************/6677/*88- * Copyright (C) 2000 - 2010, Intel Corp.88+ * Copyright (C) 2000 - 2011, Intel Corp.99 * All rights reserved.1010 *1111 * Redistribution and use in source and binary forms, with or without
···166166 u32 acpi_state = acpi_target_sleep_state;167167168168 acpi_ec_unblock_transactions();169169+ suspend_nvs_free();169170170171 if (acpi_state == ACPI_STATE_S0)171172 return;···187186 */188187static void acpi_pm_end(void)189188{190190- suspend_nvs_free();191189 /*192190 * This is necessary in case acpi_pm_finish() is not called during a193191 * failing transition to a sleep state.
+1-1
drivers/ata/Kconfig
···783783784784config PATA_PLATFORM785785 tristate "Generic platform device PATA support"786786- depends on EMBEDDED || PPC || HAVE_PATA_PLATFORM786786+ depends on EXPERT || PPC || HAVE_PATA_PLATFORM787787 help788788 This option enables support for generic directly connected ATA789789 devices commonly found on embedded systems.
+1-1
drivers/base/Kconfig
···7070 If unsure say Y here.71717272config FW_LOADER7373- tristate "Userspace firmware loading support" if EMBEDDED7373+ tristate "Userspace firmware loading support" if EXPERT7474 default y7575 ---help---7676 This option is provided for the case where no in-kernel-tree modules
+6-6
drivers/char/Kconfig
···55menu "Character devices"6677config VT88- bool "Virtual terminal" if EMBEDDED88+ bool "Virtual terminal" if EXPERT99 depends on !S3901010 select INPUT1111 default y···3939config CONSOLE_TRANSLATIONS4040 depends on VT4141 default y4242- bool "Enable character translations in console" if EMBEDDED4242+ bool "Enable character translations in console" if EXPERT4343 ---help---4444 This enables support for font mapping and Unicode translation4545 on virtual consoles.46464747config VT_CONSOLE4848- bool "Support for console on virtual terminal" if EMBEDDED4848+ bool "Support for console on virtual terminal" if EXPERT4949 depends on VT5050 default y5151 ---help---···426426 If you have an SGI Altix with an attached SABrick427427 say Y or M here, otherwise say N.428428429429-source "drivers/serial/Kconfig"429429+source "drivers/tty/serial/Kconfig"430430431431config UNIX98_PTYS432432- bool "Unix98 PTY support" if EMBEDDED432432+ bool "Unix98 PTY support" if EXPERT433433 default y434434 ---help---435435 A pseudo terminal (PTY) is a software device consisting of two···495495496496config TTY_PRINTK497497 bool "TTY driver to output user messages via printk"498498- depends on EMBEDDED498498+ depends on EXPERT499499 default n500500 ---help---501501 If you say Y here, the support for writing user messages (i.e.
···71717272config CPU_FREQ_DEFAULT_GOV_POWERSAVE7373 bool "powersave"7474- depends on EMBEDDED7474+ depends on EXPERT7575 select CPU_FREQ_GOV_POWERSAVE7676 help7777 Use the CPUFreq governor 'powersave' as default. This sets
+2-4
drivers/firewire/Kconfig
···4949 configuration section.50505151config FIREWIRE_NET5252- tristate "IP networking over 1394 (EXPERIMENTAL)"5353- depends on FIREWIRE && INET && EXPERIMENTAL5252+ tristate "IP networking over 1394"5353+ depends on FIREWIRE && INET5454 help5555 This enables IPv4 over IEEE 1394, providing IP connectivity with5656 other implementations of RFC 2734 as found on several operating5757 systems. Multicast support is currently limited.5858-5959- NOTE, this driver is not stable yet!60586159 To compile this driver as a module, say M here: The module will be6260 called firewire-net.
+9-2
drivers/firewire/core-card.c
···7575#define BIB_IRMC ((1) << 31)7676#define NODE_CAPABILITIES 0x0c0083c0 /* per IEEE 1394 clause 8.3.2.6.5.2 */77777878+#define CANON_OUI 0x0000857979+7880static void generate_config_rom(struct fw_card *card, __be32 *config_rom)7981{8082 struct fw_descriptor *desc;···286284 bool root_device_is_running;287285 bool root_device_is_cmc;288286 bool irm_is_1394_1995_only;287287+ bool keep_this_irm;289288290289 spin_lock_irq(&card->lock);291290···307304 irm_device = card->irm_node->data;308305 irm_is_1394_1995_only = irm_device && irm_device->config_rom &&309306 (irm_device->config_rom[2] & 0x000000f0) == 0;307307+308308+ /* Canon MV5i works unreliably if it is not root node. */309309+ keep_this_irm = irm_device && irm_device->config_rom &&310310+ irm_device->config_rom[3] >> 8 == CANON_OUI;310311311312 root_id = root_node->node_id;312313 irm_id = card->irm_node->node_id;···340333 goto pick_me;341334 }342335343343- if (irm_is_1394_1995_only) {336336+ if (irm_is_1394_1995_only && !keep_this_irm) {344337 new_root_id = local_id;345338 fw_notify("%s, making local node (%02x) root.\n",346339 "IRM is not 1394a compliant", new_root_id);···389382390383 spin_lock_irq(&card->lock);391384392392- if (rcode != RCODE_COMPLETE) {385385+ if (rcode != RCODE_COMPLETE && !keep_this_irm) {393386 /*394387 * The lock request failed, maybe the IRM395388 * isn't really IRM capable after all. Let's
···2727 using the kernel parameter 'edd={on|skipmbr|off}'.28282929config FIRMWARE_MEMMAP3030- bool "Add firmware-provided memory map to sysfs" if EMBEDDED3030+ bool "Add firmware-provided memory map to sysfs" if EXPERT3131 default X863232 help3333 Add the firmware-provided (unmodified) memory map to /sys/firmware/memmap.
+1-1
drivers/gpu/drm/Kconfig
···2323 tristate2424 depends on DRM2525 select FB2626- select FRAMEBUFFER_CONSOLE if !EMBEDDED2626+ select FRAMEBUFFER_CONSOLE if !EXPERT2727 help2828 FB and CRTC helpers for KMS drivers.2929
+2-2
drivers/gpu/drm/drm_fb_helper.c
···15331533}15341534EXPORT_SYMBOL(drm_fb_helper_hotplug_event);1535153515361536-/* The Kconfig DRM_KMS_HELPER selects FRAMEBUFFER_CONSOLE (if !EMBEDDED)15361536+/* The Kconfig DRM_KMS_HELPER selects FRAMEBUFFER_CONSOLE (if !EXPERT)15371537 * but the module doesn't depend on any fb console symbols. At least15381538 * attempt to load fbcon to avoid leaving the system without a usable console.15391539 */15401540-#if defined(CONFIG_FRAMEBUFFER_CONSOLE_MODULE) && !defined(CONFIG_EMBEDDED)15401540+#if defined(CONFIG_FRAMEBUFFER_CONSOLE_MODULE) && !defined(CONFIG_EXPERT)15411541static int __init drm_fb_helper_modinit(void)15421542{15431543 const char *name = "fbcon";
+3-2
drivers/gpu/drm/i915/intel_ringbuffer.c
···928928929929int intel_wait_ring_buffer(struct intel_ring_buffer *ring, int n)930930{931931+ int reread = 0;931932 struct drm_device *dev = ring->dev;932933 struct drm_i915_private *dev_priv = dev->dev_private;933934 unsigned long end;···941940 * fallback to the slow and accurate path.942941 */943942 head = intel_read_status_page(ring, 4);944944- if (head < ring->actual_head)943943+ if (reread)945944 head = I915_READ_HEAD(ring);946946- ring->actual_head = head;947945 ring->head = head & HEAD_ADDR;948946 ring->space = ring->head - (ring->tail + 8);949947 if (ring->space < 0)···961961 msleep(1);962962 if (atomic_read(&dev_priv->mm.wedged))963963 return -EAGAIN;964964+ reread = 1;964965 } while (!time_after(jiffies, end));965966 trace_i915_ring_wait_end (dev);966967 return -EBUSY;
···88 select FB_CFB_COPYAREA99 select FB_CFB_IMAGEBLIT1010 select FB1111- select FRAMEBUFFER_CONSOLE if !EMBEDDED1111+ select FRAMEBUFFER_CONSOLE if !EXPERT1212 select FB_BACKLIGHT if DRM_NOUVEAU_BACKLIGHT1313 select ACPI_VIDEO if ACPI && X86 && BACKLIGHT_CLASS_DEVICE && VIDEO_OUTPUT_CONTROL && INPUT1414 help
+1-1
drivers/gpu/vga/Kconfig
···11config VGA_ARB22- bool "VGA Arbitration" if EMBEDDED22+ bool "VGA Arbitration" if EXPERT33 default y44 depends on PCI55 help
+32-32
drivers/hid/Kconfig
···6262 Support for 3M PCT touch screens.63636464config HID_A4TECH6565- tristate "A4 tech mice" if EMBEDDED6565+ tristate "A4 tech mice" if EXPERT6666 depends on USB_HID6767- default !EMBEDDED6767+ default !EXPERT6868 ---help---6969 Support for A4 tech X5 and WOP-35 / Trust 450L mice.7070···7777 game controllers.78787979config HID_APPLE8080- tristate "Apple {i,Power,Mac}Books" if EMBEDDED8080+ tristate "Apple {i,Power,Mac}Books" if EXPERT8181 depends on (USB_HID || BT_HIDP)8282- default !EMBEDDED8282+ default !EXPERT8383 ---help---8484 Support for some Apple devices which less or more break8585 HID specification.···8888 MacBooks, MacBook Pros and Apple Aluminum.89899090config HID_BELKIN9191- tristate "Belkin Flip KVM and Wireless keyboard" if EMBEDDED9191+ tristate "Belkin Flip KVM and Wireless keyboard" if EXPERT9292 depends on USB_HID9393- default !EMBEDDED9393+ default !EXPERT9494 ---help---9595 Support for Belkin Flip KVM and Wireless keyboard.9696···101101 Support for Cando dual touch panel.102102103103config HID_CHERRY104104- tristate "Cherry Cymotion keyboard" if EMBEDDED104104+ tristate "Cherry Cymotion keyboard" if EXPERT105105 depends on USB_HID106106- default !EMBEDDED106106+ default !EXPERT107107 ---help---108108 Support for Cherry Cymotion keyboard.109109110110config HID_CHICONY111111- tristate "Chicony Tactical pad" if EMBEDDED111111+ tristate "Chicony Tactical pad" if EXPERT112112 depends on USB_HID113113- default !EMBEDDED113113+ default !EXPERT114114 ---help---115115 Support for Chicony Tactical pad.116116···130130 and some additional multimedia keys.131131132132config HID_CYPRESS133133- tristate "Cypress mouse and barcode readers" if EMBEDDED133133+ tristate "Cypress mouse and barcode readers" if EXPERT134134 depends on USB_HID135135- default !EMBEDDED135135+ default !EXPERT136136 ---help---137137 Support for cypress mouse and barcode readers.138138···174174 Support for the ELECOM BM084 (bluetooth mouse).175175176176config HID_EZKEY177177- tristate "Ezkey BTC 8193 keyboard" if EMBEDDED177177+ tristate "Ezkey BTC 8193 keyboard" if EXPERT178178 depends on USB_HID179179- default !EMBEDDED179179+ default !EXPERT180180 ---help---181181 Support for Ezkey BTC 8193 keyboard.182182183183config HID_KYE184184- tristate "Kye/Genius Ergo Mouse" if EMBEDDED184184+ tristate "Kye/Genius Ergo Mouse" if EXPERT185185 depends on USB_HID186186- default !EMBEDDED186186+ default !EXPERT187187 ---help---188188 Support for Kye/Genius Ergo Mouse.189189···212212 Support for Twinhan IR remote control.213213214214config HID_KENSINGTON215215- tristate "Kensington Slimblade Trackball" if EMBEDDED215215+ tristate "Kensington Slimblade Trackball" if EXPERT216216 depends on USB_HID217217- default !EMBEDDED217217+ default !EXPERT218218 ---help---219219 Support for Kensington Slimblade Trackball.220220221221config HID_LOGITECH222222- tristate "Logitech devices" if EMBEDDED222222+ tristate "Logitech devices" if EXPERT223223 depends on USB_HID224224- default !EMBEDDED224224+ default !EXPERT225225 ---help---226226 Support for Logitech devices that are not fully compliant with HID standard.227227···276276 Apple Wireless "Magic" Mouse.277277278278config HID_MICROSOFT279279- tristate "Microsoft non-fully HID-compliant devices" if EMBEDDED279279+ tristate "Microsoft non-fully HID-compliant devices" if EXPERT280280 depends on USB_HID281281- default !EMBEDDED281281+ default !EXPERT282282 ---help---283283 Support for Microsoft devices that are not fully compliant with HID standard.284284···289289 Support for MosArt dual-touch panels.290290291291config HID_MONTEREY292292- tristate "Monterey Genius KB29E keyboard" if EMBEDDED292292+ tristate "Monterey Genius KB29E keyboard" if EXPERT293293 depends on USB_HID294294- default !EMBEDDED294294+ default !EXPERT295295 ---help---296296 Support for Monterey Genius KB29E.297297···365365 - IR366366367367config HID_PICOLCD_FB368368- bool "Framebuffer support" if EMBEDDED369369- default !EMBEDDED368368+ bool "Framebuffer support" if EXPERT369369+ default !EXPERT370370 depends on HID_PICOLCD371371 depends on HID_PICOLCD=FB || FB=y372372 select FB_DEFERRED_IO···379379 frambuffer device.380380381381config HID_PICOLCD_BACKLIGHT382382- bool "Backlight control" if EMBEDDED383383- default !EMBEDDED382382+ bool "Backlight control" if EXPERT383383+ default !EXPERT384384 depends on HID_PICOLCD385385 depends on HID_PICOLCD=BACKLIGHT_CLASS_DEVICE || BACKLIGHT_CLASS_DEVICE=y386386 ---help---···388388 class.389389390390config HID_PICOLCD_LCD391391- bool "Contrast control" if EMBEDDED392392- default !EMBEDDED391391+ bool "Contrast control" if EXPERT392392+ default !EXPERT393393 depends on HID_PICOLCD394394 depends on HID_PICOLCD=LCD_CLASS_DEVICE || LCD_CLASS_DEVICE=y395395 ---help---396396 Provide access to PicoLCD's LCD contrast via lcd class.397397398398config HID_PICOLCD_LEDS399399- bool "GPO via leds class" if EMBEDDED400400- default !EMBEDDED399399+ bool "GPO via leds class" if EXPERT400400+ default !EXPERT401401 depends on HID_PICOLCD402402 depends on HID_PICOLCD=LEDS_CLASS || LEDS_CLASS=y403403 ---help---
+1-1
drivers/hid/usbhid/Kconfig
···4545 If unsure, say Y.46464747menu "USB HID Boot Protocol drivers"4848- depends on USB!=n && USB_HID!=y && EMBEDDED4848+ depends on USB!=n && USB_HID!=y && EXPERT49495050config USB_KBD5151 tristate "USB HIDBP Keyboard (simple Boot) support"
+1-1
drivers/ide/Kconfig
···134134 module will be called ide-cd.135135136136config BLK_DEV_IDECD_VERBOSE_ERRORS137137- bool "Verbose error logging for IDE/ATAPI CDROM driver" if EMBEDDED137137+ bool "Verbose error logging for IDE/ATAPI CDROM driver" if EXPERT138138 depends on BLK_DEV_IDECD139139 default y140140 help
+1-1
drivers/infiniband/hw/mthca/Kconfig
···77 ("Tavor") and the MT25208 PCI Express HCA ("Arbel").8899config INFINIBAND_MTHCA_DEBUG1010- bool "Verbose debugging output" if EMBEDDED1010+ bool "Verbose debugging output" if EXPERT1111 depends on INFINIBAND_MTHCA1212 default y1313 ---help---
+1-1
drivers/infiniband/ulp/ipoib/Kconfig
···2424 unless you limit mtu for these destinations to 2044.25252626config INFINIBAND_IPOIB_DEBUG2727- bool "IP-over-InfiniBand debugging" if EMBEDDED2727+ bool "IP-over-InfiniBand debugging" if EXPERT2828 depends on INFINIBAND_IPOIB2929 default y3030 ---help---
+3-3
drivers/input/Kconfig
···66 depends on !S3907788config INPUT99- tristate "Generic input layer (needed for keyboard, mouse, ...)" if EMBEDDED99+ tristate "Generic input layer (needed for keyboard, mouse, ...)" if EXPERT1010 default y1111 help1212 Say Y here if you have any input device (mouse, keyboard, tablet,···6767comment "Userland interfaces"68686969config INPUT_MOUSEDEV7070- tristate "Mouse interface" if EMBEDDED7070+ tristate "Mouse interface" if EXPERT7171 default y7272 help7373 Say Y here if you want your mouse to be accessible as char devices···150150 module will be called evbug.151151152152config INPUT_APMPOWER153153- tristate "Input Power Event -> APM Bridge" if EMBEDDED153153+ tristate "Input Power Event -> APM Bridge" if EXPERT154154 depends on INPUT && APM_EMULATION155155 help156156 Say Y here if you want suspend key events to trigger a user
+2-2
drivers/input/keyboard/Kconfig
···22# Input core configuration33#44menuconfig INPUT_KEYBOARD55- bool "Keyboards" if EMBEDDED || !X8655+ bool "Keyboards" if EXPERT || !X8666 default y77 help88 Say Y here, and a list of supported keyboards will be displayed.···5757 module will be called atakbd.58585959config KEYBOARD_ATKBD6060- tristate "AT keyboard" if EMBEDDED || !X866060+ tristate "AT keyboard" if EXPERT || !X866161 default y6262 select SERIO6363 select SERIO_LIBPS2
+5-5
drivers/input/mouse/Kconfig
···3939 module will be called psmouse.40404141config MOUSE_PS2_ALPS4242- bool "ALPS PS/2 mouse protocol extension" if EMBEDDED4242+ bool "ALPS PS/2 mouse protocol extension" if EXPERT4343 default y4444 depends on MOUSE_PS24545 help···4949 If unsure, say Y.50505151config MOUSE_PS2_LOGIPS2PP5252- bool "Logitech PS/2++ mouse protocol extension" if EMBEDDED5252+ bool "Logitech PS/2++ mouse protocol extension" if EXPERT5353 default y5454 depends on MOUSE_PS25555 help···5959 If unsure, say Y.60606161config MOUSE_PS2_SYNAPTICS6262- bool "Synaptics PS/2 mouse protocol extension" if EMBEDDED6262+ bool "Synaptics PS/2 mouse protocol extension" if EXPERT6363 default y6464 depends on MOUSE_PS26565 help···6969 If unsure, say Y.70707171config MOUSE_PS2_LIFEBOOK7272- bool "Fujitsu Lifebook PS/2 mouse protocol extension" if EMBEDDED7272+ bool "Fujitsu Lifebook PS/2 mouse protocol extension" if EXPERT7373 default y7474 depends on MOUSE_PS2 && X86 && DMI7575 help···7979 If unsure, say Y.80808181config MOUSE_PS2_TRACKPOINT8282- bool "IBM Trackpoint PS/2 mouse protocol extension" if EMBEDDED8282+ bool "IBM Trackpoint PS/2 mouse protocol extension" if EXPERT8383 default y8484 depends on MOUSE_PS28585 help
+3-3
drivers/input/serio/Kconfig
···22# Input core configuration33#44config SERIO55- tristate "Serial I/O support" if EMBEDDED || !X8655+ tristate "Serial I/O support" if EXPERT || !X8666 default y77 help88 Say Yes here if you have any input device that uses serial I/O to···1919if SERIO20202121config SERIO_I80422222- tristate "i8042 PC Keyboard controller" if EMBEDDED || !X862222+ tristate "i8042 PC Keyboard controller" if EXPERT || !X862323 default y2424 depends on !PARISC && (!ARM || ARCH_SHARK || FOOTBRIDGE_HOST) && \2525 (!SUPERH || SH_CAYMAN) && !M68K && !BLACKFIN···168168 module will be called maceps2.169169170170config SERIO_LIBPS2171171- tristate "PS/2 driver library" if EMBEDDED171171+ tristate "PS/2 driver library" if EXPERT172172 depends on SERIO_I8042 || SERIO_I8042=n173173 help174174 Say Y here if you are using a driver for device connected
+15-15
drivers/input/touchscreen/Kconfig
···540540541541config TOUCHSCREEN_USB_EGALAX542542 default y543543- bool "eGalax, eTurboTouch CT-410/510/700 device support" if EMBEDDED543543+ bool "eGalax, eTurboTouch CT-410/510/700 device support" if EXPERT544544 depends on TOUCHSCREEN_USB_COMPOSITE545545546546config TOUCHSCREEN_USB_PANJIT547547 default y548548- bool "PanJit device support" if EMBEDDED548548+ bool "PanJit device support" if EXPERT549549 depends on TOUCHSCREEN_USB_COMPOSITE550550551551config TOUCHSCREEN_USB_3M552552 default y553553- bool "3M/Microtouch EX II series device support" if EMBEDDED553553+ bool "3M/Microtouch EX II series device support" if EXPERT554554 depends on TOUCHSCREEN_USB_COMPOSITE555555556556config TOUCHSCREEN_USB_ITM557557 default y558558- bool "ITM device support" if EMBEDDED558558+ bool "ITM device support" if EXPERT559559 depends on TOUCHSCREEN_USB_COMPOSITE560560561561config TOUCHSCREEN_USB_ETURBO562562 default y563563- bool "eTurboTouch (non-eGalax compatible) device support" if EMBEDDED563563+ bool "eTurboTouch (non-eGalax compatible) device support" if EXPERT564564 depends on TOUCHSCREEN_USB_COMPOSITE565565566566config TOUCHSCREEN_USB_GUNZE567567 default y568568- bool "Gunze AHL61 device support" if EMBEDDED568568+ bool "Gunze AHL61 device support" if EXPERT569569 depends on TOUCHSCREEN_USB_COMPOSITE570570571571config TOUCHSCREEN_USB_DMC_TSC10572572 default y573573- bool "DMC TSC-10/25 device support" if EMBEDDED573573+ bool "DMC TSC-10/25 device support" if EXPERT574574 depends on TOUCHSCREEN_USB_COMPOSITE575575576576config TOUCHSCREEN_USB_IRTOUCH577577 default y578578- bool "IRTOUCHSYSTEMS/UNITOP device support" if EMBEDDED578578+ bool "IRTOUCHSYSTEMS/UNITOP device support" if EXPERT579579 depends on TOUCHSCREEN_USB_COMPOSITE580580581581config TOUCHSCREEN_USB_IDEALTEK582582 default y583583- bool "IdealTEK URTC1000 device support" if EMBEDDED583583+ bool "IdealTEK URTC1000 device support" if EXPERT584584 depends on TOUCHSCREEN_USB_COMPOSITE585585586586config TOUCHSCREEN_USB_GENERAL_TOUCH587587 default y588588- bool "GeneralTouch Touchscreen device support" if EMBEDDED588588+ bool "GeneralTouch Touchscreen device support" if EXPERT589589 depends on TOUCHSCREEN_USB_COMPOSITE590590591591config TOUCHSCREEN_USB_GOTOP592592 default y593593- bool "GoTop Super_Q2/GogoPen/PenPower tablet device support" if EMBEDDED593593+ bool "GoTop Super_Q2/GogoPen/PenPower tablet device support" if EXPERT594594 depends on TOUCHSCREEN_USB_COMPOSITE595595596596config TOUCHSCREEN_USB_JASTEC597597 default y598598- bool "JASTEC/DigiTech DTR-02U USB touch controller device support" if EMBEDDED598598+ bool "JASTEC/DigiTech DTR-02U USB touch controller device support" if EXPERT599599 depends on TOUCHSCREEN_USB_COMPOSITE600600601601config TOUCHSCREEN_USB_E2I···605605606606config TOUCHSCREEN_USB_ZYTRONIC607607 default y608608- bool "Zytronic controller" if EMBEDDED608608+ bool "Zytronic controller" if EXPERT609609 depends on TOUCHSCREEN_USB_COMPOSITE610610611611config TOUCHSCREEN_USB_ETT_TC45USB612612 default y613613- bool "ET&T USB series TC4UM/TC5UH touchscreen controller support" if EMBEDDED613613+ bool "ET&T USB series TC4UM/TC5UH touchscreen controller support" if EXPERT614614 depends on TOUCHSCREEN_USB_COMPOSITE615615616616config TOUCHSCREEN_USB_NEXIO617617 default y618618- bool "NEXIO/iNexio device support" if EMBEDDED618618+ bool "NEXIO/iNexio device support" if EXPERT619619 depends on TOUCHSCREEN_USB_COMPOSITE620620621621config TOUCHSCREEN_TOUCHIT213
+9-8
drivers/leds/ledtrig-gpio.c
···9999 struct led_classdev *led = dev_get_drvdata(dev);100100 struct gpio_trig_data *gpio_data = led->trigger_data;101101102102- return sprintf(buf, "%s\n", gpio_data->inverted ? "yes" : "no");102102+ return sprintf(buf, "%u\n", gpio_data->inverted);103103}104104105105static ssize_t gpio_trig_inverted_store(struct device *dev,···107107{108108 struct led_classdev *led = dev_get_drvdata(dev);109109 struct gpio_trig_data *gpio_data = led->trigger_data;110110- unsigned inverted;110110+ unsigned long inverted;111111 int ret;112112113113- ret = sscanf(buf, "%u", &inverted);114114- if (ret < 1) {115115- dev_err(dev, "invalid value\n");116116- return -EINVAL;117117- }113113+ ret = strict_strtoul(buf, 10, &inverted);114114+ if (ret < 0)115115+ return ret;118116119119- gpio_data->inverted = !!inverted;117117+ if (inverted > 1)118118+ return -EINVAL;119119+120120+ gpio_data->inverted = inverted;120121121122 /* After inverting, we need to update the LED. */122123 schedule_work(&gpio_data->work);
···9090 * meanwhile). If that's not the case, we pretend everything in the9191 * Guest has changed.9292 */9393- if (__get_cpu_var(lg_last_cpu) != cpu || cpu->last_pages != pages) {9494- __get_cpu_var(lg_last_cpu) = cpu;9393+ if (__this_cpu_read(lg_last_cpu) != cpu || cpu->last_pages != pages) {9494+ __this_cpu_write(lg_last_cpu, cpu);9595 cpu->last_pages = pages;9696 cpu->changed = CHANGED_ALL;9797 }
···1515 }16161717 /* is it free? */1818- mutex_lock(&dev->lock);1918 if (vv->resources & bit) {2019 DEB_D(("locked! vv->resources:0x%02x, we want:0x%02x\n",vv->resources,bit));2120 /* no, someone else uses it */2222- mutex_unlock(&dev->lock);2321 return 0;2422 }2523 /* it's free, grab it */2624 fh->resources |= bit;2725 vv->resources |= bit;2826 DEB_D(("res: get 0x%02x, cur:0x%02x\n",bit,vv->resources));2929- mutex_unlock(&dev->lock);3027 return 1;3128}3229···34373538 BUG_ON((fh->resources & bits) != bits);36393737- mutex_lock(&dev->lock);3840 fh->resources &= ~bits;3941 vv->resources &= ~bits;4042 DEB_D(("res: put 0x%02x, cur:0x%02x\n",bits,vv->resources));4141- mutex_unlock(&dev->lock);4243}43444445···391396 .write = fops_write,392397 .poll = fops_poll,393398 .mmap = fops_mmap,394394- .ioctl = video_ioctl2,399399+ .unlocked_ioctl = video_ioctl2,395400};396401397402static void vv_callback(struct saa7146_dev *dev, unsigned long status)···500505 vfd->fops = &video_fops;501506 vfd->ioctl_ops = &dev->ext_vv_data->ops;502507 vfd->release = video_device_release;508508+ vfd->lock = &dev->v4l2_lock;503509 vfd->tvnorms = 0;504510 for (i = 0; i < dev->ext_vv_data->num_stds; i++)505511 vfd->tvnorms |= dev->ext_vv_data->stds[i].id;
+1-1
drivers/media/common/saa7146_vbi.c
···412412 V4L2_BUF_TYPE_VBI_CAPTURE,413413 V4L2_FIELD_SEQ_TB, // FIXME: does this really work?414414 sizeof(struct saa7146_buf),415415- file, NULL);415415+ file, &dev->v4l2_lock);416416417417 init_timer(&fh->vbi_read_timeout);418418 fh->vbi_read_timeout.function = vbi_read_timeout;
+1-19
drivers/media/common/saa7146_video.c
···553553 }554554 }555555556556- mutex_lock(&dev->lock);557557-558556 /* ok, accept it */559557 vv->ov_fb = *fb;560558 vv->ov_fmt = fmt;···561563 vv->ov_fb.fmt.bytesperline = vv->ov_fb.fmt.width * fmt->depth / 8;562564 DEB_D(("setting bytesperline to %d\n", vv->ov_fb.fmt.bytesperline));563565 }564564-565565- mutex_unlock(&dev->lock);566566 return 0;567567}568568···645649 return -EINVAL;646650 }647651648648- mutex_lock(&dev->lock);649649-650652 switch (ctrl->type) {651653 case V4L2_CTRL_TYPE_BOOLEAN:652654 case V4L2_CTRL_TYPE_MENU:···687693 /* fixme: we can support changing VFLIP and HFLIP here... */688694 if (IS_CAPTURE_ACTIVE(fh) != 0) {689695 DEB_D(("V4L2_CID_HFLIP while active capture.\n"));690690- mutex_unlock(&dev->lock);691696 return -EBUSY;692697 }693698 vv->hflip = c->value;···694701 case V4L2_CID_VFLIP:695702 if (IS_CAPTURE_ACTIVE(fh) != 0) {696703 DEB_D(("V4L2_CID_VFLIP while active capture.\n"));697697- mutex_unlock(&dev->lock);698704 return -EBUSY;699705 }700706 vv->vflip = c->value;701707 break;702708 default:703703- mutex_unlock(&dev->lock);704709 return -EINVAL;705710 }706706- mutex_unlock(&dev->lock);707711708712 if (IS_OVERLAY_ACTIVE(fh) != 0) {709713 saa7146_stop_preview(fh);···892902 err = vidioc_try_fmt_vid_overlay(file, fh, f);893903 if (0 != err)894904 return err;895895- mutex_lock(&dev->lock);896905 fh->ov.win = f->fmt.win;897906 fh->ov.nclips = f->fmt.win.clipcount;898907 if (fh->ov.nclips > 16)899908 fh->ov.nclips = 16;900909 if (copy_from_user(fh->ov.clips, f->fmt.win.clips,901910 sizeof(struct v4l2_clip) * fh->ov.nclips)) {902902- mutex_unlock(&dev->lock);903911 return -EFAULT;904912 }905913906914 /* fh->ov.fh is used to indicate that we have valid overlay informations, too */907915 fh->ov.fh = fh;908908-909909- mutex_unlock(&dev->lock);910916911917 /* check if our current overlay is active */912918 if (IS_OVERLAY_ACTIVE(fh) != 0) {···962976 }963977 }964978965965- mutex_lock(&dev->lock);966966-967979 for (i = 0; i < dev->ext_vv_data->num_stds; i++)968980 if (*id & dev->ext_vv_data->stds[i].id)969981 break;···971987 dev->ext_vv_data->std_callback(dev, vv->standard);972988 found = 1;973989 }974974-975975- mutex_unlock(&dev->lock);976990977991 if (vv->ov_suspend != NULL) {978992 saa7146_start_preview(vv->ov_suspend);···13361354 V4L2_BUF_TYPE_VIDEO_CAPTURE,13371355 V4L2_FIELD_INTERLACED,13381356 sizeof(struct saa7146_buf),13391339- file, NULL);13571357+ file, &dev->v4l2_lock);1340135813411359 return 0;13421360}
+1-1
drivers/media/common/tuners/Kconfig
···3434config MEDIA_TUNER_CUSTOMISE3535 bool "Customize analog and hybrid tuner modules to build"3636 depends on MEDIA_TUNER3737- default y if EMBEDDED3737+ default y if EXPERT3838 help3939 This allows the user to deselect tuner drivers unnecessary4040 for their hardware from the build. Use this option with care
···11config DVB_FE_CUSTOMISE22 bool "Customise the frontend modules to build"33 depends on DVB_CORE44- default y if EMBEDDED44+ default y if EXPERT55 help66 This allows the user to select/deselect frontend drivers for their77 hardware from the build.
···151151 following ports will be probed: 0x20c, 0x30c, 0x24c, 0x34c, 0x248 and152152 0x28c.153153154154-config RADIO_GEMTEK_PCI155155- tristate "GemTek PCI Radio Card support"156156- depends on VIDEO_V4L2 && PCI157157- ---help---158158- Choose Y here if you have this PCI FM radio card.159159-160160- In order to control your radio card, you will need to use programs161161- that are compatible with the Video for Linux API. Information on162162- this API and pointers to "v4l" programs may be found at163163- <file:Documentation/video4linux/API.html>.164164-165165- To compile this driver as a module, choose M here: the166166- module will be called radio-gemtek-pci.167167-168154config RADIO_MAXIRADIO169155 tristate "Guillemot MAXI Radio FM 2000 radio"170156 depends on VIDEO_V4L2 && PCI
···357357 goto done;358358359359 /* sysconfig 1 */360360- radio->registers[SYSCONFIG1] = SYSCONFIG1_DE;360360+ radio->registers[SYSCONFIG1] =361361+ (de << 11) & SYSCONFIG1_DE; /* DE*/361362 retval = si470x_set_register(radio, SYSCONFIG1);362363 if (retval < 0)363364 goto done;···688687 /* driver constants */689688 strcpy(tuner->name, "FM");690689 tuner->type = V4L2_TUNER_RADIO;691691-#if defined(CONFIG_USB_SI470X) || defined(CONFIG_USB_SI470X_MODULE)692690 tuner->capability = V4L2_TUNER_CAP_LOW | V4L2_TUNER_CAP_STEREO |693691 V4L2_TUNER_CAP_RDS | V4L2_TUNER_CAP_RDS_BLOCK_IO;694694-#else695695- tuner->capability = V4L2_TUNER_CAP_LOW | V4L2_TUNER_CAP_STEREO;696696-#endif697692698693 /* range limits */699694 switch ((radio->registers[SYSCONFIG2] & SYSCONFIG2_BAND) >> 6) {···715718 tuner->rxsubchans = V4L2_TUNER_SUB_MONO;716719 else717720 tuner->rxsubchans = V4L2_TUNER_SUB_MONO | V4L2_TUNER_SUB_STEREO;718718-#if defined(CONFIG_USB_SI470X) || defined(CONFIG_USB_SI470X_MODULE)719721 /* If there is a reliable method of detecting an RDS channel,720722 then this code should check for that before setting this721723 RDS subchannel. */722724 tuner->rxsubchans |= V4L2_TUNER_SUB_RDS;723723-#endif724725725726 /* mono/stereo selector */726727 if ((radio->registers[POWERCFG] & POWERCFG_MONO) == 0)
+14-9
drivers/media/rc/ene_ir.c
···446446447447select_timeout:448448 if (dev->rx_fan_input_inuse) {449449- dev->rdev->rx_resolution = MS_TO_NS(ENE_FW_SAMPLE_PERIOD_FAN);449449+ dev->rdev->rx_resolution = US_TO_NS(ENE_FW_SAMPLE_PERIOD_FAN);450450451451 /* Fan input doesn't support timeouts, it just ends the452452 input with a maximum sample */453453 dev->rdev->min_timeout = dev->rdev->max_timeout =454454- MS_TO_NS(ENE_FW_SMPL_BUF_FAN_MSK *454454+ US_TO_NS(ENE_FW_SMPL_BUF_FAN_MSK *455455 ENE_FW_SAMPLE_PERIOD_FAN);456456 } else {457457- dev->rdev->rx_resolution = MS_TO_NS(sample_period);457457+ dev->rdev->rx_resolution = US_TO_NS(sample_period);458458459459 /* Theoreticly timeout is unlimited, but we cap it460460 * because it was seen that on one device, it461461 * would stop sending spaces after around 250 msec.462462 * Besides, this is close to 2^32 anyway and timeout is u32.463463 */464464- dev->rdev->min_timeout = MS_TO_NS(127 * sample_period);465465- dev->rdev->max_timeout = MS_TO_NS(200000);464464+ dev->rdev->min_timeout = US_TO_NS(127 * sample_period);465465+ dev->rdev->max_timeout = US_TO_NS(200000);466466 }467467468468 if (dev->hw_learning_and_tx_capable)469469- dev->rdev->tx_resolution = MS_TO_NS(sample_period);469469+ dev->rdev->tx_resolution = US_TO_NS(sample_period);470470471471 if (dev->rdev->timeout > dev->rdev->max_timeout)472472 dev->rdev->timeout = dev->rdev->max_timeout;···801801802802 dbg("RX: %d (%s)", hw_sample, pulse ? "pulse" : "space");803803804804- ev.duration = MS_TO_NS(hw_sample);804804+ ev.duration = US_TO_NS(hw_sample);805805 ev.pulse = pulse;806806 ir_raw_event_store_with_filter(dev->rdev, &ev);807807 }···821821 dev->learning_mode_enabled = learning_mode_force;822822823823 /* Set reasonable default timeout */824824- dev->rdev->timeout = MS_TO_NS(150000);824824+ dev->rdev->timeout = US_TO_NS(150000);825825}826826827827/* Upload all hardware settings at once. Used at load and resume time */···10041004 /* validate resources */10051005 error = -ENODEV;1006100610071007+ /* init these to -1, as 0 is valid for both */10081008+ dev->hw_io = -1;10091009+ dev->irq = -1;10101010+10071011 if (!pnp_port_valid(pnp_dev, 0) ||10081012 pnp_port_len(pnp_dev, 0) < ENE_IO_SIZE)10091013 goto error;···10761072 rdev->input_name = "ENE eHome Infrared Remote Transceiver";10771073 }1078107410751075+ dev->rdev = rdev;10761076+10791077 ene_rx_setup_hw_buffer(dev);10801078 ene_setup_default_settings(dev);10811079 ene_setup_hw_settings(dev);···10891083 if (error < 0)10901084 goto error;1091108510921092- dev->rdev = rdev;10931086 ene_notice("driver has been succesfully loaded");10941087 return 0;10951088error:
···233233234234/* used internally by the sysfs interface */235235u64236236-ir_raw_get_allowed_protocols()236236+ir_raw_get_allowed_protocols(void)237237{238238 u64 protocols;239239 mutex_lock(&ir_raw_handler_lock);
···4848#define USB_BUFLEN 32 /* USB reception buffer length */4949#define USB_CTRL_MSG_SZ 2 /* Size of usb ctrl msg on gen1 hw */5050#define MCE_G1_INIT_MSGS 40 /* Init messages on gen1 hw to throw out */5151-#define MS_TO_NS(msec) ((msec) * 1000)52515352/* MCE constants */5453#define MCE_CMDBUF_SIZE 384 /* MCE Command buffer length */···857858 ir->rem--;858859 rawir.pulse = ((ir->buf_in[i] & MCE_PULSE_BIT) != 0);859860 rawir.duration = (ir->buf_in[i] & MCE_PULSE_MASK)860860- * MS_TO_NS(MCE_TIME_UNIT);861861+ * MS_TO_US(MCE_TIME_UNIT);861862862863 dev_dbg(ir->dev, "Storing %s with duration %d\n",863864 rawir.pulse ? "pulse" : "space",
+1-10
drivers/media/video/Kconfig
···78787979config VIDEO_HELPER_CHIPS_AUTO8080 bool "Autoselect pertinent encoders/decoders and other helper chips"8181- default y if !EMBEDDED8181+ default y if !EXPERT8282 ---help---8383 Most video cards may require additional modules to encode or8484 decode audio/video standards. This option will autoselect···140140141141 To compile this driver as a module, choose M here: the142142 module will be called tda9840.143143-144144-config VIDEO_TDA9875145145- tristate "Philips TDA9875 audio processor"146146- depends on VIDEO_V4L2 && I2C147147- ---help---148148- Support for tda9875 audio decoder chip found on some bt8xx boards.149149-150150- To compile this driver as a module, choose M here: the151151- module will be called tda9875.152143153144config VIDEO_TEA6415C154145 tristate "Philips TEA6415C audio processor"
···234234235235 /* i2c audio flags */236236 unsigned int no_msp34xx:1;237237- unsigned int no_tda9875:1;238237 unsigned int no_tda7432:1;239238 unsigned int needs_tvaudio:1;240239 unsigned int msp34xx_alt:1;
+8-3
drivers/media/video/cafe_ccic.c
···20012001 .min_width = 320,20022002 .min_height = 240,20032003 };20042004+ struct i2c_board_info ov7670_info = {20052005+ .type = "ov7670",20062006+ .addr = 0x42,20072007+ .platform_data = &sensor_cfg,20082008+ };2004200920052010 /*20062011 * Start putting together one of our big camera structures.···20672062 if (dmi_check_system(olpc_xo1_dmi))20682063 sensor_cfg.clock_speed = 45;2069206420702070- cam->sensor_addr = 0x42;20712071- cam->sensor = v4l2_i2c_new_subdev_cfg(&cam->v4l2_dev, &cam->i2c_adapter,20722072- "ov7670", 0, &sensor_cfg, cam->sensor_addr, NULL);20652065+ cam->sensor_addr = ov7670_info.addr;20662066+ cam->sensor = v4l2_i2c_new_subdev_board(&cam->v4l2_dev, &cam->i2c_adapter,20672067+ &ov7670_info, NULL);20732068 if (cam->sensor == NULL) {20742069 ret = -ENODEV;20752070 goto out_smbus;
+1-1
drivers/media/video/cpia2/cpia2.h
···378378379379struct camera_data {380380 /* locks */381381- struct mutex busy_lock; /* guard against SMP multithreading */381381+ struct mutex v4l2_lock; /* serialize file operations */382382 struct v4l2_prio_state prio;383383384384 /* camera status */
+15-50
drivers/media/video/cpia2/cpia2_core.c
···224722472248224822492249 cam->present = 1;22502250- mutex_init(&cam->busy_lock);22502250+ mutex_init(&cam->v4l2_lock);22512251 init_waitqueue_head(&cam->wq_stream);2252225222532253 return cam;···23652365 char __user *buf, unsigned long count, int noblock)23662366{23672367 struct framebuf *frame;23682368- if (!count) {23682368+23692369+ if (!count)23692370 return 0;23702370- }2371237123722372 if (!buf) {23732373 ERR("%s: buffer NULL\n",__func__);···23792379 return -EINVAL;23802380 }2381238123822382- /* make this _really_ smp and multithread-safe */23832383- if (mutex_lock_interruptible(&cam->busy_lock))23842384- return -ERESTARTSYS;23852385-23862382 if (!cam->present) {23872383 LOG("%s: camera removed\n",__func__);23882388- mutex_unlock(&cam->busy_lock);23892384 return 0; /* EOF */23902385 }2391238623922392- if(!cam->streaming) {23872387+ if (!cam->streaming) {23932388 /* Start streaming */23942389 cpia2_usb_stream_start(cam,23952390 cam->params.camera_state.stream_mode);···23932398 /* Copy cam->curbuff in case it changes while we're processing */23942399 frame = cam->curbuff;23952400 if (noblock && frame->status != FRAME_READY) {23962396- mutex_unlock(&cam->busy_lock);23972401 return -EAGAIN;23982402 }2399240324002400- if(frame->status != FRAME_READY) {24012401- mutex_unlock(&cam->busy_lock);24042404+ if (frame->status != FRAME_READY) {24052405+ mutex_unlock(&cam->v4l2_lock);24022406 wait_event_interruptible(cam->wq_stream,24032407 !cam->present ||24042408 (frame = cam->curbuff)->status == FRAME_READY);24092409+ mutex_lock(&cam->v4l2_lock);24052410 if (signal_pending(current))24062411 return -ERESTARTSYS;24072407- /* make this _really_ smp and multithread-safe */24082408- if (mutex_lock_interruptible(&cam->busy_lock)) {24092409- return -ERESTARTSYS;24102410- }24112411- if(!cam->present) {24122412- mutex_unlock(&cam->busy_lock);24122412+ if (!cam->present)24132413 return 0;24142414- }24152414 }2416241524172416 /* copy data to user space */24182418- if (frame->length > count) {24192419- mutex_unlock(&cam->busy_lock);24172417+ if (frame->length > count)24202418 return -EFAULT;24212421- }24222422- if (copy_to_user(buf, frame->data, frame->length)) {24232423- mutex_unlock(&cam->busy_lock);24192419+ if (copy_to_user(buf, frame->data, frame->length))24242420 return -EFAULT;24252425- }2426242124272422 count = frame->length;2428242324292424 frame->status = FRAME_EMPTY;2430242524312431- mutex_unlock(&cam->busy_lock);24322426 return count;24332427}24342428···24312447{24322448 unsigned int status=0;2433244924342434- if(!cam) {24502450+ if (!cam) {24352451 ERR("%s: Internal error, camera_data not found!\n",__func__);24362452 return POLLERR;24372453 }2438245424392439- mutex_lock(&cam->busy_lock);24402440-24412441- if(!cam->present) {24422442- mutex_unlock(&cam->busy_lock);24552455+ if (!cam->present)24432456 return POLLHUP;24442444- }2445245724462458 if(!cam->streaming) {24472459 /* Start streaming */···24452465 cam->params.camera_state.stream_mode);24462466 }2447246724482448- mutex_unlock(&cam->busy_lock);24492468 poll_wait(filp, &cam->wq_stream, wait);24502450- mutex_lock(&cam->busy_lock);2451246924522470 if(!cam->present)24532471 status = POLLHUP;24542472 else if(cam->curbuff->status == FRAME_READY)24552473 status = POLLIN | POLLRDNORM;2456247424572457- mutex_unlock(&cam->busy_lock);24582475 return status;24592476}24602477···2473249624742497 DBG("mmap offset:%ld size:%ld\n", start_offset, size);2475249824762476- /* make this _really_ smp-safe */24772477- if (mutex_lock_interruptible(&cam->busy_lock))24782478- return -ERESTARTSYS;24792479-24802480- if (!cam->present) {24812481- mutex_unlock(&cam->busy_lock);24992499+ if (!cam->present)24822500 return -ENODEV;24832483- }2484250124852502 if (size > cam->frame_size*cam->num_frames ||24862503 (start_offset % cam->frame_size) != 0 ||24872487- (start_offset+size > cam->frame_size*cam->num_frames)) {24882488- mutex_unlock(&cam->busy_lock);25042504+ (start_offset+size > cam->frame_size*cam->num_frames))24892505 return -EINVAL;24902490- }2491250624922507 pos = ((unsigned long) (cam->frame_buffer)) + start_offset;24932508 while (size > 0) {24942509 page = kvirt_to_pa(pos);24952495- if (remap_pfn_range(vma, start, page >> PAGE_SHIFT, PAGE_SIZE, PAGE_SHARED)) {24962496- mutex_unlock(&cam->busy_lock);25102510+ if (remap_pfn_range(vma, start, page >> PAGE_SHIFT, PAGE_SIZE, PAGE_SHARED))24972511 return -EAGAIN;24982498- }24992512 start += PAGE_SIZE;25002513 pos += PAGE_SIZE;25012514 if (size > PAGE_SIZE)···24952528 }2496252924972530 cam->mmapped = true;24982498- mutex_unlock(&cam->busy_lock);24992531 return 0;25002532}25012501-
+36-72
drivers/media/video/cpia2/cpia2_v4l.c
···238238static int cpia2_open(struct file *file)239239{240240 struct camera_data *cam = video_drvdata(file);241241- int retval = 0;241241+ struct cpia2_fh *fh;242242243243 if (!cam) {244244 ERR("Internal error, camera_data not found!\n");245245 return -ENODEV;246246 }247247248248- if(mutex_lock_interruptible(&cam->busy_lock))249249- return -ERESTARTSYS;248248+ if (!cam->present)249249+ return -ENODEV;250250251251- if(!cam->present) {252252- retval = -ENODEV;253253- goto err_return;251251+ if (cam->open_count == 0) {252252+ if (cpia2_allocate_buffers(cam))253253+ return -ENOMEM;254254+255255+ /* reset the camera */256256+ if (cpia2_reset_camera(cam) < 0)257257+ return -EIO;258258+259259+ cam->APP_len = 0;260260+ cam->COM_len = 0;254261 }255262256256- if (cam->open_count > 0) {257257- goto skip_init;258258- }259259-260260- if (cpia2_allocate_buffers(cam)) {261261- retval = -ENOMEM;262262- goto err_return;263263- }264264-265265- /* reset the camera */266266- if (cpia2_reset_camera(cam) < 0) {267267- retval = -EIO;268268- goto err_return;269269- }270270-271271- cam->APP_len = 0;272272- cam->COM_len = 0;273273-274274-skip_init:275275- {276276- struct cpia2_fh *fh = kmalloc(sizeof(*fh),GFP_KERNEL);277277- if(!fh) {278278- retval = -ENOMEM;279279- goto err_return;280280- }281281- file->private_data = fh;282282- fh->prio = V4L2_PRIORITY_UNSET;283283- v4l2_prio_open(&cam->prio, &fh->prio);284284- fh->mmapped = 0;285285- }263263+ fh = kmalloc(sizeof(*fh), GFP_KERNEL);264264+ if (!fh)265265+ return -ENOMEM;266266+ file->private_data = fh;267267+ fh->prio = V4L2_PRIORITY_UNSET;268268+ v4l2_prio_open(&cam->prio, &fh->prio);269269+ fh->mmapped = 0;286270287271 ++cam->open_count;288272289273 cpia2_dbg_dump_registers(cam);290290-291291-err_return:292292- mutex_unlock(&cam->busy_lock);293293- return retval;274274+ return 0;294275}295276296277/******************************************************************************···285304 struct camera_data *cam = video_get_drvdata(dev);286305 struct cpia2_fh *fh = file->private_data;287306288288- mutex_lock(&cam->busy_lock);289289-290307 if (cam->present &&291291- (cam->open_count == 1292292- || fh->prio == V4L2_PRIORITY_RECORD293293- )) {308308+ (cam->open_count == 1 || fh->prio == V4L2_PRIORITY_RECORD)) {294309 cpia2_usb_stream_stop(cam);295310296296- if(cam->open_count == 1) {311311+ if (cam->open_count == 1) {297312 /* save camera state for later open */298313 cpia2_save_camera_state(cam);299314···298321 }299322 }300323301301- {302302- if(fh->mmapped)303303- cam->mmapped = 0;304304- v4l2_prio_close(&cam->prio, fh->prio);305305- file->private_data = NULL;306306- kfree(fh);307307- }324324+ if (fh->mmapped)325325+ cam->mmapped = 0;326326+ v4l2_prio_close(&cam->prio, fh->prio);327327+ file->private_data = NULL;328328+ kfree(fh);308329309330 if (--cam->open_count == 0) {310331 cpia2_free_buffers(cam);311332 if (!cam->present) {312333 video_unregister_device(dev);313313- mutex_unlock(&cam->busy_lock);314334 kfree(cam);315335 return 0;316336 }317337 }318318-319319- mutex_unlock(&cam->busy_lock);320338321339 return 0;322340}···377405 return 0;378406 }379407380380- mutex_unlock(&cam->busy_lock);408408+ mutex_unlock(&cam->v4l2_lock);381409 wait_event_interruptible(cam->wq_stream,382410 !cam->streaming ||383411 frame->status == FRAME_READY);384384- mutex_lock(&cam->busy_lock);412412+ mutex_lock(&cam->v4l2_lock);385413 if (signal_pending(current))386414 return -ERESTARTSYS;387415 if(!cam->present)···12651293 if(frame < 0) {12661294 /* Wait for a frame to become available */12671295 struct framebuf *cb=cam->curbuff;12681268- mutex_unlock(&cam->busy_lock);12961296+ mutex_unlock(&cam->v4l2_lock);12691297 wait_event_interruptible(cam->wq_stream,12701298 !cam->present ||12711299 (cb=cam->curbuff)->status == FRAME_READY);12721272- mutex_lock(&cam->busy_lock);13001300+ mutex_lock(&cam->v4l2_lock);12731301 if (signal_pending(current))12741302 return -ERESTARTSYS;12751303 if(!cam->present)···13091337 if (!cam)13101338 return -ENOTTY;1311133913121312- /* make this _really_ smp-safe */13131313- if (mutex_lock_interruptible(&cam->busy_lock))13141314- return -ERESTARTSYS;13151315-13161316- if (!cam->present) {13171317- mutex_unlock(&cam->busy_lock);13401340+ if (!cam->present)13181341 return -ENODEV;13191319- }1320134213211343 /* Priority check */13221344 switch (cmd) {···13181352 {13191353 struct cpia2_fh *fh = file->private_data;13201354 retval = v4l2_prio_check(&cam->prio, fh->prio);13211321- if(retval) {13221322- mutex_unlock(&cam->busy_lock);13551355+ if (retval)13231356 return retval;13241324- }13251357 break;13261358 }13271359 default:···14931529 break;14941530 }1495153114961496- mutex_unlock(&cam->busy_lock);14971532 return retval;14981533}14991534···15591596 .release = cpia2_close,15601597 .read = cpia2_v4l_read,15611598 .poll = cpia2_v4l_poll,15621562- .ioctl = cpia2_ioctl,15991599+ .unlocked_ioctl = cpia2_ioctl,15631600 .mmap = cpia2_mmap,15641601};15651602···1583162015841621 memcpy(cam->vdev, &cpia2_template, sizeof(cpia2_template));15851622 video_set_drvdata(cam->vdev, cam);16231623+ cam->vdev->lock = &cam->v4l2_lock;1586162415871625 reset_camera_struct_v4l(cam);15881626
+2-22
drivers/media/video/cx18/cx18-driver.c
···664664{665665 snprintf(cx->in_workq_name, sizeof(cx->in_workq_name), "%s-in",666666 cx->v4l2_dev.name);667667- cx->in_work_queue = create_singlethread_workqueue(cx->in_workq_name);667667+ cx->in_work_queue = alloc_ordered_workqueue(cx->in_workq_name, 0);668668 if (cx->in_work_queue == NULL) {669669 CX18_ERR("Unable to create incoming mailbox handler thread\n");670670- return -ENOMEM;671671- }672672- return 0;673673-}674674-675675-static int __devinit cx18_create_out_workq(struct cx18 *cx)676676-{677677- snprintf(cx->out_workq_name, sizeof(cx->out_workq_name), "%s-out",678678- cx->v4l2_dev.name);679679- cx->out_work_queue = create_workqueue(cx->out_workq_name);680680- if (cx->out_work_queue == NULL) {681681- CX18_ERR("Unable to create outgoing mailbox handler threads\n");682670 return -ENOMEM;683671 }684672 return 0;···698710 mutex_init(&cx->epu2apu_mb_lock);699711 mutex_init(&cx->epu2cpu_mb_lock);700712701701- ret = cx18_create_out_workq(cx);713713+ ret = cx18_create_in_workq(cx);702714 if (ret)703715 return ret;704704-705705- ret = cx18_create_in_workq(cx);706706- if (ret) {707707- destroy_workqueue(cx->out_work_queue);708708- return ret;709709- }710716711717 cx18_init_in_work_orders(cx);712718···10891107 release_mem_region(cx->base_addr, CX18_MEM_SIZE);10901108free_workqueues:10911109 destroy_workqueue(cx->in_work_queue);10921092- destroy_workqueue(cx->out_work_queue);10931110err:10941111 if (retval == 0)10951112 retval = -ENODEV;···12401259 cx18_halt_firmware(cx);1241126012421261 destroy_workqueue(cx->in_work_queue);12431243- destroy_workqueue(cx->out_work_queue);1244126212451263 cx18_streams_cleanup(cx, 1);12461264
···4242/* Related to submission of mdls to firmware */4343static inline void cx18_stream_load_fw_queue(struct cx18_stream *s)4444{4545- struct cx18 *cx = s->cx;4646- queue_work(cx->out_work_queue, &s->out_work_order);4545+ schedule_work(&s->out_work_order);4746}48474948static inline void cx18_stream_put_mdl_fw(struct cx18_stream *s,
+2-3
drivers/media/video/cx231xx/cx231xx-dvb.c
···2828#include <media/videobuf-vmalloc.h>29293030#include "xc5000.h"3131-#include "dvb_dummy_fe.h"3231#include "s5h1432.h"3332#include "tda18271.h"3433#include "s5h1411.h"···618619619620 if (dev->dvb->frontend == NULL) {620621 printk(DRIVER_NAME621621- ": Failed to attach dummy front end\n");622622+ ": Failed to attach s5h1411 front end\n");622623 result = -EINVAL;623624 goto out_free;624625 }···664665665666 if (dev->dvb->frontend == NULL) {666667 printk(DRIVER_NAME667667- ": Failed to attach dummy front end\n");668668+ ": Failed to attach s5h1411 front end\n");668669 result = -EINVAL;669670 goto out_free;670671 }
···577577 char name[VPIF_MAX_NAME]; /* Name of the mode */578578 u16 width; /* Indicates width of the image */579579 u16 height; /* Indicates height of the image */580580- u8 fps;581581- u8 frm_fmt; /* Indicates whether this is interlaced582582- * or progressive format */583583- u8 ycmux_mode; /* Indicates whether this mode requires584584- * single or two channels */585585- u16 eav2sav; /* length of sav 2 eav */580580+ u8 frm_fmt; /* Interlaced (0) or progressive (1) */581581+ u8 ycmux_mode; /* This mode requires one (0) or two (1)582582+ channels */583583+ u16 eav2sav; /* length of eav 2 sav */586584 u16 sav2eav; /* length of sav 2 eav */587585 u16 l1, l3, l5, l7, l9, l11; /* Other parameter configurations */588586 u16 vsize; /* Vertical size of the image */···588590 * is in BT or in CCD/CMOS */589591 u8 vbi_supported; /* Indicates whether this mode590592 * supports capturing vbi or not */591591- u8 hd_sd;592592- v4l2_std_id stdid;593593+ u8 hd_sd; /* HDTV (1) or SDTV (0) format */594594+ v4l2_std_id stdid; /* SDTV format */595595+ u32 dv_preset; /* HDTV format */593596};597597+598598+extern const unsigned int vpif_ch_params_count;599599+extern const struct vpif_channel_config_params ch_params[];594600595601struct vpif_video_params;596602struct vpif_params;
+349-102
drivers/media/video/davinci/vpif_capture.c
···3737#include <linux/slab.h>3838#include <media/v4l2-device.h>3939#include <media/v4l2-ioctl.h>4040+#include <media/v4l2-chip-ident.h>40414142#include "vpif_capture.h"4243#include "vpif.h"···8079/* global variables */8180static struct vpif_device vpif_obj = { {NULL} };8281static struct device *vpif_dev;8383-8484-/**8585- * ch_params: video standard configuration parameters for vpif8686- */8787-static const struct vpif_channel_config_params ch_params[] = {8888- {8989- "NTSC_M", 720, 480, 30, 0, 1, 268, 1440, 1, 23, 263, 266,9090- 286, 525, 525, 0, 1, 0, V4L2_STD_525_60,9191- },9292- {9393- "PAL_BDGHIK", 720, 576, 25, 0, 1, 280, 1440, 1, 23, 311, 313,9494- 336, 624, 625, 0, 1, 0, V4L2_STD_625_50,9595- },9696-};97829883/**9984 * vpif_uservirt_to_phys : translate user/virtual address to phy address···329342 * @dev_id: dev_id ptr330343 *331344 * It changes status of the captured buffer, takes next buffer from the queue332332- * and sets its address in VPIF registers345345+ * and sets its address in VPIF registers333346 */334347static irqreturn_t vpif_channel_isr(int irq, void *dev_id)335348{···422435 struct common_obj *common = &ch->common[VPIF_VIDEO_INDEX];423436 struct vpif_params *vpifparams = &ch->vpifparams;424437 const struct vpif_channel_config_params *config;425425- struct vpif_channel_config_params *std_info;438438+ struct vpif_channel_config_params *std_info = &vpifparams->std_info;426439 struct video_obj *vid_ch = &ch->video;427440 int index;428441429442 vpif_dbg(2, debug, "vpif_update_std_info\n");430443431431- std_info = &vpifparams->std_info;432432-433433- for (index = 0; index < ARRAY_SIZE(ch_params); index++) {444444+ for (index = 0; index < vpif_ch_params_count; index++) {434445 config = &ch_params[index];435435- if (config->stdid & vid_ch->stdid) {436436- memcpy(std_info, config, sizeof(*config));437437- break;446446+ if (config->hd_sd == 0) {447447+ vpif_dbg(2, debug, "SD format\n");448448+ if (config->stdid & vid_ch->stdid) {449449+ memcpy(std_info, config, sizeof(*config));450450+ break;451451+ }452452+ } else {453453+ vpif_dbg(2, debug, "HD format\n");454454+ if (config->dv_preset == vid_ch->dv_preset) {455455+ memcpy(std_info, config, sizeof(*config));456456+ break;457457+ }438458 }439459 }440460441461 /* standard not found */442442- if (index == ARRAY_SIZE(ch_params))462462+ if (index == vpif_ch_params_count)443463 return -EINVAL;444464445465 common->fmt.fmt.pix.width = std_info->width;···456462 common->fmt.fmt.pix.bytesperline = std_info->width;457463 vpifparams->video_params.hpitch = std_info->width;458464 vpifparams->video_params.storage_mode = std_info->frm_fmt;465465+459466 return 0;460467}461468···752757 struct video_obj *vid_ch;753758 struct channel_obj *ch;754759 struct vpif_fh *fh;755755- int i, ret = 0;760760+ int i;756761757762 vpif_dbg(2, debug, "vpif_open\n");758763···760765761766 vid_ch = &ch->video;762767 common = &ch->common[VPIF_VIDEO_INDEX];763763-764764- if (mutex_lock_interruptible(&common->lock))765765- return -ERESTARTSYS;766768767769 if (NULL == ch->curr_subdev_info) {768770 /**···777785 }778786 if (i == config->subdev_count) {779787 vpif_err("No sub device registered\n");780780- ret = -ENOENT;781781- goto exit;788788+ return -ENOENT;782789 }783790 }784791···785794 fh = kzalloc(sizeof(struct vpif_fh), GFP_KERNEL);786795 if (NULL == fh) {787796 vpif_err("unable to allocate memory for file handle object\n");788788- ret = -ENOMEM;789789- goto exit;797797+ return -ENOMEM;790798 }791799792800 /* store pointer to fh in private_data member of filep */···805815 /* Initialize priority of this instance to default priority */806816 fh->prio = V4L2_PRIORITY_UNSET;807817 v4l2_prio_open(&ch->prio, &fh->prio);808808-exit:809809- mutex_unlock(&common->lock);810810- return ret;818818+ return 0;811819}812820813821/**···824836 vpif_dbg(2, debug, "vpif_release\n");825837826838 common = &ch->common[VPIF_VIDEO_INDEX];827827-828828- if (mutex_lock_interruptible(&common->lock))829829- return -ERESTARTSYS;830839831840 /* if this instance is doing IO */832841 if (fh->io_allowed[VPIF_VIDEO_INDEX]) {···847862848863 /* Decrement channel usrs counter */849864 ch->usrs--;850850-851851- /* unlock mutex on channel object */852852- mutex_unlock(&common->lock);853865854866 /* Close the priority */855867 v4l2_prio_close(&ch->prio, fh->prio);···872890 struct channel_obj *ch = fh->channel;873891 struct common_obj *common;874892 u8 index = 0;875875- int ret = 0;876893877894 vpif_dbg(2, debug, "vpif_reqbufs\n");878895···894913895914 common = &ch->common[index];896915897897- if (mutex_lock_interruptible(&common->lock))898898- return -ERESTARTSYS;899899-900900- if (0 != common->io_usrs) {901901- ret = -EBUSY;902902- goto reqbuf_exit;903903- }916916+ if (0 != common->io_usrs)917917+ return -EBUSY;904918905919 /* Initialize videobuf queue as per the buffer type */906920 videobuf_queue_dma_contig_init(&common->buffer_queue,···904928 reqbuf->type,905929 common->fmt.fmt.pix.field,906930 sizeof(struct videobuf_buffer), fh,907907- NULL);931931+ &common->lock);908932909933 /* Set io allowed member of file handle to TRUE */910934 fh->io_allowed[index] = 1;···915939 INIT_LIST_HEAD(&common->dma_queue);916940917941 /* Allocate buffers */918918- ret = videobuf_reqbufs(&common->buffer_queue, reqbuf);919919-920920-reqbuf_exit:921921- mutex_unlock(&common->lock);922922- return ret;942942+ return videobuf_reqbufs(&common->buffer_queue, reqbuf);923943}924944925945/**···11291157 return ret;11301158 }1131115911321132- if (mutex_lock_interruptible(&common->lock)) {11331133- ret = -ERESTARTSYS;11341134- goto streamoff_exit;11351135- }11361136-11371160 /* If buffer queue is empty, return error */11381161 if (list_empty(&common->dma_queue)) {11391162 vpif_dbg(1, debug, "buffer queue is empty\n");···12071240 enable_channel1(1);12081241 }12091242 channel_first_int[VPIF_VIDEO_INDEX][ch->channel_id] = 1;12101210- mutex_unlock(&common->lock);12111243 return ret;1212124412131245exit:12141214- mutex_unlock(&common->lock);12151215-streamoff_exit:12161216- ret = videobuf_streamoff(&common->buffer_queue);12461246+ videobuf_streamoff(&common->buffer_queue);12171247 return ret;12181248}12191249···12481284 return -EINVAL;12491285 }1250128612511251- if (mutex_lock_interruptible(&common->lock))12521252- return -ERESTARTSYS;12531253-12541287 /* disable channel */12551288 if (VPIF_CHANNEL0_VIDEO == ch->channel_id) {12561289 enable_channel0(0);···1264130312651304 if (ret && (ret != -ENOIOCTLCMD))12661305 vpif_dbg(1, debug, "stream off failed in subdev\n");12671267-12681268- mutex_unlock(&common->lock);1269130612701307 return videobuf_streamoff(&common->buffer_queue);12711308}···13401381{13411382 struct vpif_fh *fh = priv;13421383 struct channel_obj *ch = fh->channel;13431343- struct common_obj *common = &ch->common[VPIF_VIDEO_INDEX];13441384 int ret = 0;1345138513461386 vpif_dbg(2, debug, "vpif_querystd\n");13471347-13481348- if (mutex_lock_interruptible(&common->lock))13491349- return -ERESTARTSYS;1350138713511388 /* Call querystd function of decoder device */13521389 ret = v4l2_subdev_call(vpif_obj.sd[ch->curr_sd_index], video,···13501395 if (ret < 0)13511396 vpif_dbg(1, debug, "Failed to set standard for sub devices\n");1352139713531353- mutex_unlock(&common->lock);13541398 return ret;13551399}13561400···14051451 fh->initialized = 1;1406145214071453 /* Call encoder subdevice function to set the standard */14081408- if (mutex_lock_interruptible(&common->lock))14091409- return -ERESTARTSYS;14101410-14111454 ch->video.stdid = *std_id;14551455+ ch->video.dv_preset = V4L2_DV_INVALID;14561456+ memset(&ch->video.bt_timings, 0, sizeof(ch->video.bt_timings));1412145714131458 /* Get the information about the standard */14141459 if (vpif_update_std_info(ch)) {14151415- ret = -EINVAL;14161460 vpif_err("Error getting the standard info\n");14171417- goto s_std_exit;14611461+ return -EINVAL;14181462 }1419146314201464 /* Configure the default format information */···14231471 s_std, *std_id);14241472 if (ret < 0)14251473 vpif_dbg(1, debug, "Failed to set standard for sub devices\n");14261426-14271427-s_std_exit:14281428- mutex_unlock(&common->lock);14291474 return ret;14301475}14311476···15161567 return -EINVAL;15171568 }1518156915191519- if (mutex_lock_interruptible(&common->lock))15201520- return -ERESTARTSYS;15211521-15221570 /* first setup input path from sub device to vpif */15231571 if (config->setup_input_path) {15241572 ret = config->setup_input_path(ch->channel_id,···15241578 vpif_dbg(1, debug, "couldn't setup input path for the"15251579 " sub device %s, for input index %d\n",15261580 subdev_info->name, index);15271527- goto exit;15811581+ return ret;15281582 }15291583 }15301584···15351589 input, output, 0);15361590 if (ret < 0) {15371591 vpif_dbg(1, debug, "Failed to set input\n");15381538- goto exit;15921592+ return ret;15391593 }15401594 }15411595 vid_ch->input_idx = index;···1546160015471601 /* update tvnorms from the sub device input info */15481602 ch->video_dev->tvnorms = chan_cfg->inputs[index].input.std;15491549-15501550-exit:15511551- mutex_unlock(&common->lock);15521603 return ret;15531604}15541605···16141671 return -EINVAL;1615167216161673 /* Fill in the information about format */16171617- if (mutex_lock_interruptible(&common->lock))16181618- return -ERESTARTSYS;16191619-16201674 *fmt = common->fmt;16211621- mutex_unlock(&common->lock);16221675 return 0;16231676}16241677···16331694 struct v4l2_pix_format *pixfmt;16341695 int ret = 0;1635169616361636- vpif_dbg(2, debug, "VIDIOC_S_FMT\n");16971697+ vpif_dbg(2, debug, "%s\n", __func__);1637169816381699 /* If streaming is started, return error */16391700 if (common->started) {···16621723 if (ret)16631724 return ret;16641725 /* store the format in the channel object */16651665- if (mutex_lock_interruptible(&common->lock))16661666- return -ERESTARTSYS;16671667-16681726 common->fmt = *fmt;16691669- mutex_unlock(&common->lock);16701670-16711727 return 0;16721728}16731729···17411807 return 0;17421808}1743180918101810+/**18111811+ * vpif_enum_dv_presets() - ENUM_DV_PRESETS handler18121812+ * @file: file ptr18131813+ * @priv: file handle18141814+ * @preset: input preset18151815+ */18161816+static int vpif_enum_dv_presets(struct file *file, void *priv,18171817+ struct v4l2_dv_enum_preset *preset)18181818+{18191819+ struct vpif_fh *fh = priv;18201820+ struct channel_obj *ch = fh->channel;18211821+18221822+ return v4l2_subdev_call(vpif_obj.sd[ch->curr_sd_index],18231823+ video, enum_dv_presets, preset);18241824+}18251825+18261826+/**18271827+ * vpif_query_dv_presets() - QUERY_DV_PRESET handler18281828+ * @file: file ptr18291829+ * @priv: file handle18301830+ * @preset: input preset18311831+ */18321832+static int vpif_query_dv_preset(struct file *file, void *priv,18331833+ struct v4l2_dv_preset *preset)18341834+{18351835+ struct vpif_fh *fh = priv;18361836+ struct channel_obj *ch = fh->channel;18371837+18381838+ return v4l2_subdev_call(vpif_obj.sd[ch->curr_sd_index],18391839+ video, query_dv_preset, preset);18401840+}18411841+/**18421842+ * vpif_s_dv_presets() - S_DV_PRESETS handler18431843+ * @file: file ptr18441844+ * @priv: file handle18451845+ * @preset: input preset18461846+ */18471847+static int vpif_s_dv_preset(struct file *file, void *priv,18481848+ struct v4l2_dv_preset *preset)18491849+{18501850+ struct vpif_fh *fh = priv;18511851+ struct channel_obj *ch = fh->channel;18521852+ struct common_obj *common = &ch->common[VPIF_VIDEO_INDEX];18531853+ int ret = 0;18541854+18551855+ if (common->started) {18561856+ vpif_dbg(1, debug, "streaming in progress\n");18571857+ return -EBUSY;18581858+ }18591859+18601860+ if ((VPIF_CHANNEL0_VIDEO == ch->channel_id) ||18611861+ (VPIF_CHANNEL1_VIDEO == ch->channel_id)) {18621862+ if (!fh->initialized) {18631863+ vpif_dbg(1, debug, "Channel Busy\n");18641864+ return -EBUSY;18651865+ }18661866+ }18671867+18681868+ ret = v4l2_prio_check(&ch->prio, fh->prio);18691869+ if (ret)18701870+ return ret;18711871+18721872+ fh->initialized = 1;18731873+18741874+ /* Call encoder subdevice function to set the standard */18751875+ if (mutex_lock_interruptible(&common->lock))18761876+ return -ERESTARTSYS;18771877+18781878+ ch->video.dv_preset = preset->preset;18791879+ ch->video.stdid = V4L2_STD_UNKNOWN;18801880+ memset(&ch->video.bt_timings, 0, sizeof(ch->video.bt_timings));18811881+18821882+ /* Get the information about the standard */18831883+ if (vpif_update_std_info(ch)) {18841884+ vpif_dbg(1, debug, "Error getting the standard info\n");18851885+ ret = -EINVAL;18861886+ } else {18871887+ /* Configure the default format information */18881888+ vpif_config_format(ch);18891889+18901890+ ret = v4l2_subdev_call(vpif_obj.sd[ch->curr_sd_index],18911891+ video, s_dv_preset, preset);18921892+ }18931893+18941894+ mutex_unlock(&common->lock);18951895+18961896+ return ret;18971897+}18981898+/**18991899+ * vpif_g_dv_presets() - G_DV_PRESETS handler19001900+ * @file: file ptr19011901+ * @priv: file handle19021902+ * @preset: input preset19031903+ */19041904+static int vpif_g_dv_preset(struct file *file, void *priv,19051905+ struct v4l2_dv_preset *preset)19061906+{19071907+ struct vpif_fh *fh = priv;19081908+ struct channel_obj *ch = fh->channel;19091909+19101910+ preset->preset = ch->video.dv_preset;19111911+19121912+ return 0;19131913+}19141914+19151915+/**19161916+ * vpif_s_dv_timings() - S_DV_TIMINGS handler19171917+ * @file: file ptr19181918+ * @priv: file handle19191919+ * @timings: digital video timings19201920+ */19211921+static int vpif_s_dv_timings(struct file *file, void *priv,19221922+ struct v4l2_dv_timings *timings)19231923+{19241924+ struct vpif_fh *fh = priv;19251925+ struct channel_obj *ch = fh->channel;19261926+ struct vpif_params *vpifparams = &ch->vpifparams;19271927+ struct vpif_channel_config_params *std_info = &vpifparams->std_info;19281928+ struct video_obj *vid_ch = &ch->video;19291929+ struct v4l2_bt_timings *bt = &vid_ch->bt_timings;19301930+ int ret;19311931+19321932+ if (timings->type != V4L2_DV_BT_656_1120) {19331933+ vpif_dbg(2, debug, "Timing type not defined\n");19341934+ return -EINVAL;19351935+ }19361936+19371937+ /* Configure subdevice timings, if any */19381938+ ret = v4l2_subdev_call(vpif_obj.sd[ch->curr_sd_index],19391939+ video, s_dv_timings, timings);19401940+ if (ret == -ENOIOCTLCMD) {19411941+ vpif_dbg(2, debug, "Custom DV timings not supported by "19421942+ "subdevice\n");19431943+ return -EINVAL;19441944+ }19451945+ if (ret < 0) {19461946+ vpif_dbg(2, debug, "Error setting custom DV timings\n");19471947+ return ret;19481948+ }19491949+19501950+ if (!(timings->bt.width && timings->bt.height &&19511951+ (timings->bt.hbackporch ||19521952+ timings->bt.hfrontporch ||19531953+ timings->bt.hsync) &&19541954+ timings->bt.vfrontporch &&19551955+ (timings->bt.vbackporch ||19561956+ timings->bt.vsync))) {19571957+ vpif_dbg(2, debug, "Timings for width, height, "19581958+ "horizontal back porch, horizontal sync, "19591959+ "horizontal front porch, vertical back porch, "19601960+ "vertical sync and vertical back porch "19611961+ "must be defined\n");19621962+ return -EINVAL;19631963+ }19641964+19651965+ *bt = timings->bt;19661966+19671967+ /* Configure video port timings */19681968+19691969+ std_info->eav2sav = bt->hbackporch + bt->hfrontporch +19701970+ bt->hsync - 8;19711971+ std_info->sav2eav = bt->width;19721972+19731973+ std_info->l1 = 1;19741974+ std_info->l3 = bt->vsync + bt->vbackporch + 1;19751975+19761976+ if (bt->interlaced) {19771977+ if (bt->il_vbackporch || bt->il_vfrontporch || bt->il_vsync) {19781978+ std_info->vsize = bt->height * 2 +19791979+ bt->vfrontporch + bt->vsync + bt->vbackporch +19801980+ bt->il_vfrontporch + bt->il_vsync +19811981+ bt->il_vbackporch;19821982+ std_info->l5 = std_info->vsize/2 -19831983+ (bt->vfrontporch - 1);19841984+ std_info->l7 = std_info->vsize/2 + 1;19851985+ std_info->l9 = std_info->l7 + bt->il_vsync +19861986+ bt->il_vbackporch + 1;19871987+ std_info->l11 = std_info->vsize -19881988+ (bt->il_vfrontporch - 1);19891989+ } else {19901990+ vpif_dbg(2, debug, "Required timing values for "19911991+ "interlaced BT format missing\n");19921992+ return -EINVAL;19931993+ }19941994+ } else {19951995+ std_info->vsize = bt->height + bt->vfrontporch +19961996+ bt->vsync + bt->vbackporch;19971997+ std_info->l5 = std_info->vsize - (bt->vfrontporch - 1);19981998+ }19991999+ strncpy(std_info->name, "Custom timings BT656/1120", VPIF_MAX_NAME);20002000+ std_info->width = bt->width;20012001+ std_info->height = bt->height;20022002+ std_info->frm_fmt = bt->interlaced ? 0 : 1;20032003+ std_info->ycmux_mode = 0;20042004+ std_info->capture_format = 0;20052005+ std_info->vbi_supported = 0;20062006+ std_info->hd_sd = 1;20072007+ std_info->stdid = 0;20082008+ std_info->dv_preset = V4L2_DV_INVALID;20092009+20102010+ vid_ch->stdid = 0;20112011+ vid_ch->dv_preset = V4L2_DV_INVALID;20122012+ return 0;20132013+}20142014+20152015+/**20162016+ * vpif_g_dv_timings() - G_DV_TIMINGS handler20172017+ * @file: file ptr20182018+ * @priv: file handle20192019+ * @timings: digital video timings20202020+ */20212021+static int vpif_g_dv_timings(struct file *file, void *priv,20222022+ struct v4l2_dv_timings *timings)20232023+{20242024+ struct vpif_fh *fh = priv;20252025+ struct channel_obj *ch = fh->channel;20262026+ struct video_obj *vid_ch = &ch->video;20272027+ struct v4l2_bt_timings *bt = &vid_ch->bt_timings;20282028+20292029+ timings->bt = *bt;20302030+20312031+ return 0;20322032+}20332033+20342034+/*20352035+ * vpif_g_chip_ident() - Identify the chip20362036+ * @file: file ptr20372037+ * @priv: file handle20382038+ * @chip: chip identity20392039+ *20402040+ * Returns zero or -EINVAL if read operations fails.20412041+ */20422042+static int vpif_g_chip_ident(struct file *file, void *priv,20432043+ struct v4l2_dbg_chip_ident *chip)20442044+{20452045+ chip->ident = V4L2_IDENT_NONE;20462046+ chip->revision = 0;20472047+ if (chip->match.type != V4L2_CHIP_MATCH_I2C_DRIVER &&20482048+ chip->match.type != V4L2_CHIP_MATCH_I2C_ADDR) {20492049+ vpif_dbg(2, debug, "match_type is invalid.\n");20502050+ return -EINVAL;20512051+ }20522052+20532053+ return v4l2_device_call_until_err(&vpif_obj.v4l2_dev, 0, core,20542054+ g_chip_ident, chip);20552055+}20562056+20572057+#ifdef CONFIG_VIDEO_ADV_DEBUG20582058+/*20592059+ * vpif_dbg_g_register() - Read register20602060+ * @file: file ptr20612061+ * @priv: file handle20622062+ * @reg: register to be read20632063+ *20642064+ * Debugging only20652065+ * Returns zero or -EINVAL if read operations fails.20662066+ */20672067+static int vpif_dbg_g_register(struct file *file, void *priv,20682068+ struct v4l2_dbg_register *reg){20692069+ struct vpif_fh *fh = priv;20702070+ struct channel_obj *ch = fh->channel;20712071+20722072+ return v4l2_subdev_call(vpif_obj.sd[ch->curr_sd_index], core,20732073+ g_register, reg);20742074+}20752075+20762076+/*20772077+ * vpif_dbg_s_register() - Write to register20782078+ * @file: file ptr20792079+ * @priv: file handle20802080+ * @reg: register to be modified20812081+ *20822082+ * Debugging only20832083+ * Returns zero or -EINVAL if write operations fails.20842084+ */20852085+static int vpif_dbg_s_register(struct file *file, void *priv,20862086+ struct v4l2_dbg_register *reg){20872087+ struct vpif_fh *fh = priv;20882088+ struct channel_obj *ch = fh->channel;20892089+20902090+ return v4l2_subdev_call(vpif_obj.sd[ch->curr_sd_index], core,20912091+ s_register, reg);20922092+}20932093+#endif20942094+20952095+/*20962096+ * vpif_log_status() - Status information20972097+ * @file: file ptr20982098+ * @priv: file handle20992099+ *21002100+ * Returns zero.21012101+ */21022102+static int vpif_log_status(struct file *filep, void *priv)21032103+{21042104+ /* status for sub devices */21052105+ v4l2_device_call_all(&vpif_obj.v4l2_dev, 0, core, log_status);21062106+21072107+ return 0;21082108+}21092109+17442110/* vpif capture ioctl operations */17452111static const struct v4l2_ioctl_ops vpif_ioctl_ops = {17462112 .vidioc_querycap = vpif_querycap,···20631829 .vidioc_streamon = vpif_streamon,20641830 .vidioc_streamoff = vpif_streamoff,20651831 .vidioc_cropcap = vpif_cropcap,18321832+ .vidioc_enum_dv_presets = vpif_enum_dv_presets,18331833+ .vidioc_s_dv_preset = vpif_s_dv_preset,18341834+ .vidioc_g_dv_preset = vpif_g_dv_preset,18351835+ .vidioc_query_dv_preset = vpif_query_dv_preset,18361836+ .vidioc_s_dv_timings = vpif_s_dv_timings,18371837+ .vidioc_g_dv_timings = vpif_g_dv_timings,18381838+ .vidioc_g_chip_ident = vpif_g_chip_ident,18391839+#ifdef CONFIG_VIDEO_ADV_DEBUG18401840+ .vidioc_g_register = vpif_dbg_g_register,18411841+ .vidioc_s_register = vpif_dbg_s_register,18421842+#endif18431843+ .vidioc_log_status = vpif_log_status,20661844};2067184520681846/* vpif file operations */···20821836 .owner = THIS_MODULE,20831837 .open = vpif_open,20841838 .release = vpif_release,20852085- .ioctl = video_ioctl2,18391839+ .unlocked_ioctl = video_ioctl2,20861840 .mmap = vpif_mmap,20871841 .poll = vpif_poll20881842};···22251979 common = &(ch->common[VPIF_VIDEO_INDEX]);22261980 spin_lock_init(&common->irqlock);22271981 mutex_init(&common->lock);19821982+ ch->video_dev->lock = &common->lock;22281983 /* Initialize prio member of channel object */22291984 v4l2_prio_init(&ch->prio);22301985 err = video_register_device(ch->video_dev,···22732026 if (vpif_obj.sd[i])22742027 vpif_obj.sd[i]->grp_id = 1 << i;22752028 }22762276- v4l2_info(&vpif_obj.v4l2_dev, "DM646x VPIF Capture driver"22772277- " initialized\n");2278202920302030+ v4l2_info(&vpif_obj.v4l2_dev,20312031+ "DM646x VPIF capture driver initialized\n");22792032 return 0;2280203322812034probe_subdev_out:
+2
drivers/media/video/davinci/vpif_capture.h
···5959 enum v4l2_field buf_field;6060 /* Currently selected or default standard */6161 v4l2_std_id stdid;6262+ u32 dv_preset;6363+ struct v4l2_bt_timings bt_timings;6264 /* This is to track the last input that is passed to application */6365 u32 input_idx;6466};
+367-107
drivers/media/video/davinci/vpif_display.c
···3838#include <media/adv7343.h>3939#include <media/v4l2-device.h>4040#include <media/v4l2-ioctl.h>4141+#include <media/v4l2-chip-ident.h>41424243#include <mach/dm646x.h>4344···84838584static struct vpif_device vpif_obj = { {NULL} };8685static struct device *vpif_dev;8787-8888-static const struct vpif_channel_config_params ch_params[] = {8989- {9090- "NTSC", 720, 480, 30, 0, 1, 268, 1440, 1, 23, 263, 266,9191- 286, 525, 525, 0, 1, 0, V4L2_STD_525_60,9292- },9393- {9494- "PAL", 720, 576, 25, 0, 1, 280, 1440, 1, 23, 311, 313,9595- 336, 624, 625, 0, 1, 0, V4L2_STD_625_50,9696- },9797-};98869987/*10088 * vpif_uservirt_to_phys: This function is used to convert user···363373 return IRQ_HANDLED;364374}365375366366-static int vpif_get_std_info(struct channel_obj *ch)376376+static int vpif_update_std_info(struct channel_obj *ch)367377{368368- struct common_obj *common = &ch->common[VPIF_VIDEO_INDEX];369378 struct video_obj *vid_ch = &ch->video;370379 struct vpif_params *vpifparams = &ch->vpifparams;371380 struct vpif_channel_config_params *std_info = &vpifparams->std_info;372381 const struct vpif_channel_config_params *config;373382374374- int index;383383+ int i;375384376376- std_info->stdid = vid_ch->stdid;377377- if (!std_info->stdid)378378- return -1;379379-380380- for (index = 0; index < ARRAY_SIZE(ch_params); index++) {381381- config = &ch_params[index];382382- if (config->stdid & std_info->stdid) {383383- memcpy(std_info, config, sizeof(*config));384384- break;385385+ for (i = 0; i < vpif_ch_params_count; i++) {386386+ config = &ch_params[i];387387+ if (config->hd_sd == 0) {388388+ vpif_dbg(2, debug, "SD format\n");389389+ if (config->stdid & vid_ch->stdid) {390390+ memcpy(std_info, config, sizeof(*config));391391+ break;392392+ }393393+ } else {394394+ vpif_dbg(2, debug, "HD format\n");395395+ if (config->dv_preset == vid_ch->dv_preset) {396396+ memcpy(std_info, config, sizeof(*config));397397+ break;398398+ }385399 }386400 }387401388388- if (index == ARRAY_SIZE(ch_params))389389- return -1;402402+ if (i == vpif_ch_params_count) {403403+ vpif_dbg(1, debug, "Format not found\n");404404+ return -EINVAL;405405+ }406406+407407+ return 0;408408+}409409+410410+static int vpif_update_resolution(struct channel_obj *ch)411411+{412412+ struct common_obj *common = &ch->common[VPIF_VIDEO_INDEX];413413+ struct video_obj *vid_ch = &ch->video;414414+ struct vpif_params *vpifparams = &ch->vpifparams;415415+ struct vpif_channel_config_params *std_info = &vpifparams->std_info;416416+417417+ if (!vid_ch->stdid && !vid_ch->dv_preset && !vid_ch->bt_timings.height)418418+ return -EINVAL;419419+420420+ if (vid_ch->stdid || vid_ch->dv_preset) {421421+ if (vpif_update_std_info(ch))422422+ return -EINVAL;423423+ }390424391425 common->fmt.fmt.pix.width = std_info->width;392426 common->fmt.fmt.pix.height = std_info->height;···418404 common->fmt.fmt.pix.width, common->fmt.fmt.pix.height);419405420406 /* Set height and width paramateres */421421- ch->common[VPIF_VIDEO_INDEX].height = std_info->height;422422- ch->common[VPIF_VIDEO_INDEX].width = std_info->width;407407+ common->height = std_info->height;408408+ common->width = std_info->width;423409424410 return 0;425411}···530516 else531517 sizeimage = config_params.channel_bufsize[ch->channel_id];532518533533- if (vpif_get_std_info(ch)) {534534- vpif_err("Error getting the standard info\n");519519+ if (vpif_update_resolution(ch))535520 return -EINVAL;536536- }537521538522 hpitch = pixfmt->bytesperline;539523 vpitch = sizeimage / (hpitch * 2);···580568static int vpif_mmap(struct file *filep, struct vm_area_struct *vma)581569{582570 struct vpif_fh *fh = filep->private_data;583583- struct common_obj *common = &fh->channel->common[VPIF_VIDEO_INDEX];571571+ struct channel_obj *ch = fh->channel;572572+ struct common_obj *common = &(ch->common[VPIF_VIDEO_INDEX]);573573+574574+ vpif_dbg(2, debug, "vpif_mmap\n");584575585576 return videobuf_mmap_mapper(&common->buffer_queue, vma);586577}···652637 struct channel_obj *ch = fh->channel;653638 struct common_obj *common = &ch->common[VPIF_VIDEO_INDEX];654639655655- if (mutex_lock_interruptible(&common->lock))656656- return -ERESTARTSYS;657657-658640 /* if this instance is doing IO */659641 if (fh->io_allowed[VPIF_VIDEO_INDEX]) {660642 /* Reset io_usrs member of channel object */···674662 config_params.numbuffers[ch->channel_id];675663 }676664677677- mutex_unlock(&common->lock);678678-679665 /* Decrement channel usrs counter */680666 atomic_dec(&ch->usrs);681667 /* If this file handle has initialize encoder device, reset it */···690680}691681692682/* functions implementing ioctls */693693-683683+/**684684+ * vpif_querycap() - QUERYCAP handler685685+ * @file: file ptr686686+ * @priv: file handle687687+ * @cap: ptr to v4l2_capability structure688688+ */694689static int vpif_querycap(struct file *file, void *priv,695690 struct v4l2_capability *cap)696691{···737722 if (common->fmt.type != fmt->type)738723 return -EINVAL;739724740740- /* Fill in the information about format */741741- if (mutex_lock_interruptible(&common->lock))742742- return -ERESTARTSYS;743743-744744- if (vpif_get_std_info(ch)) {745745- vpif_err("Error getting the standard info\n");725725+ if (vpif_update_resolution(ch))746726 return -EINVAL;747747- }748748-749727 *fmt = common->fmt;750750- mutex_unlock(&common->lock);751728 return 0;752729}753730···780773 /* store the pix format in the channel object */781774 common->fmt.fmt.pix = *pixfmt;782775 /* store the format in the channel object */783783- if (mutex_lock_interruptible(&common->lock))784784- return -ERESTARTSYS;785785-786776 common->fmt = *fmt;787787- mutex_unlock(&common->lock);788788-789777 return 0;790778}791779···810808 struct common_obj *common;811809 enum v4l2_field field;812810 u8 index = 0;813813- int ret = 0;814811815812 /* This file handle has not initialized the channel,816813 It is not allowed to do settings */···827826 index = VPIF_VIDEO_INDEX;828827829828 common = &ch->common[index];830830- if (mutex_lock_interruptible(&common->lock))831831- return -ERESTARTSYS;832829833833- if (common->fmt.type != reqbuf->type) {834834- ret = -EINVAL;835835- goto reqbuf_exit;836836- }830830+ if (common->fmt.type != reqbuf->type)831831+ return -EINVAL;837832838838- if (0 != common->io_usrs) {839839- ret = -EBUSY;840840- goto reqbuf_exit;841841- }833833+ if (0 != common->io_usrs)834834+ return -EBUSY;842835843836 if (reqbuf->type == V4L2_BUF_TYPE_VIDEO_OUTPUT) {844837 if (common->fmt.fmt.pix.field == V4L2_FIELD_ANY)···849854 &common->irqlock,850855 reqbuf->type, field,851856 sizeof(struct videobuf_buffer), fh,852852- NULL);857857+ &common->lock);853858854859 /* Set io allowed member of file handle to TRUE */855860 fh->io_allowed[index] = 1;···860865 INIT_LIST_HEAD(&common->dma_queue);861866862867 /* Allocate buffers */863863- ret = videobuf_reqbufs(&common->buffer_queue, reqbuf);864864-865865-reqbuf_exit:866866- mutex_unlock(&common->lock);867867- return ret;868868+ return videobuf_reqbufs(&common->buffer_queue, reqbuf);868869}869870870871static int vpif_querybuf(struct file *file, void *priv,···981990 }982991983992 /* Call encoder subdevice function to set the standard */984984- if (mutex_lock_interruptible(&common->lock))985985- return -ERESTARTSYS;986986-987993 ch->video.stdid = *std_id;994994+ ch->video.dv_preset = V4L2_DV_INVALID;995995+ memset(&ch->video.bt_timings, 0, sizeof(ch->video.bt_timings));996996+988997 /* Get the information about the standard */989989- if (vpif_get_std_info(ch)) {990990- vpif_err("Error getting the standard info\n");998998+ if (vpif_update_resolution(ch))991999 return -EINVAL;992992- }99310009941001 if ((ch->vpifparams.std_info.width *9951002 ch->vpifparams.std_info.height * 2) >9961003 config_params.channel_bufsize[ch->channel_id]) {9971004 vpif_err("invalid std for this size\n");998998- ret = -EINVAL;999999- goto s_std_exit;10051005+ return -EINVAL;10001006 }1001100710021008 common->fmt.fmt.pix.bytesperline = common->fmt.fmt.pix.width;···10041016 s_std_output, *std_id);10051017 if (ret < 0) {10061018 vpif_err("Failed to set output standard\n");10071007- goto s_std_exit;10191019+ return ret;10081020 }1009102110101022 ret = v4l2_device_call_until_err(&vpif_obj.v4l2_dev, 1, core,10111023 s_std, *std_id);10121024 if (ret < 0)10131025 vpif_err("Failed to set standard for sub devices\n");10141014-10151015-s_std_exit:10161016- mutex_unlock(&common->lock);10171026 return ret;10181027}10191028···10751090 if (ret < 0)10761091 return ret;1077109210781078- /* Call videobuf_streamon to start streaming in videobuf */10931093+ /* Call videobuf_streamon to start streaming in videobuf */10791094 ret = videobuf_streamon(&common->buffer_queue);10801095 if (ret < 0) {10811096 vpif_err("videobuf_streamon\n");10821097 return ret;10831098 }1084109910851085- if (mutex_lock_interruptible(&common->lock))10861086- return -ERESTARTSYS;10871087-10881100 /* If buffer queue is empty, return error */10891101 if (list_empty(&common->dma_queue)) {10901102 vpif_err("buffer queue is empty\n");10911091- ret = -EIO;10921092- goto streamon_exit;11031103+ return -EIO;10931104 }1094110510951106 /* Get the next frame from the buffer queue */···11111130 || (!ch->vpifparams.std_info.frm_fmt11121131 && (common->fmt.fmt.pix.field == V4L2_FIELD_NONE))) {11131132 vpif_err("conflict in field format and std format\n");11141114- ret = -EINVAL;11151115- goto streamon_exit;11331133+ return -EINVAL;11161134 }1117113511181136 /* clock settings */···11201140 ch->vpifparams.std_info.hd_sd);11211141 if (ret < 0) {11221142 vpif_err("can't set clock\n");11231123- goto streamon_exit;11431143+ return ret;11241144 }1125114511261146 /* set the parameters and addresses */11271147 ret = vpif_set_video_params(vpif, ch->channel_id + 2);11281148 if (ret < 0)11291129- goto streamon_exit;11491149+ return ret;1130115011311151 common->started = ret;11321152 vpif_config_addr(ch, ret);···11511171 }11521172 channel_first_int[VPIF_VIDEO_INDEX][ch->channel_id] = 1;11531173 }11541154-11551155-streamon_exit:11561156- mutex_unlock(&common->lock);11571174 return ret;11581175}11591176···11761199 return -EINVAL;11771200 }1178120111791179- if (mutex_lock_interruptible(&common->lock))11801180- return -ERESTARTSYS;11811181-11821202 if (buftype == V4L2_BUF_TYPE_VIDEO_OUTPUT) {11831203 /* disable channel */11841204 if (VPIF_CHANNEL2_VIDEO == ch->channel_id) {···11901216 }1191121711921218 common->started = 0;11931193- mutex_unlock(&common->lock);11941194-11951219 return videobuf_streamoff(&common->buffer_queue);11961220}11971221···12361264 struct common_obj *common = &ch->common[VPIF_VIDEO_INDEX];12371265 int ret = 0;1238126612391239- if (mutex_lock_interruptible(&common->lock))12401240- return -ERESTARTSYS;12411241-12421267 if (common->started) {12431268 vpif_err("Streaming in progress\n");12441244- ret = -EBUSY;12451245- goto s_output_exit;12691269+ return -EBUSY;12461270 }1247127112481272 ret = v4l2_device_call_until_err(&vpif_obj.v4l2_dev, 1, video,···12481280 vpif_err("Failed to set output standard\n");1249128112501282 vid_ch->output_id = i;12511251-12521252-s_output_exit:12531253- mutex_unlock(&common->lock);12541283 return ret;12551284}12561285···12801315 return v4l2_prio_change(&ch->prio, &fh->prio, p);12811316}1282131713181318+/**13191319+ * vpif_enum_dv_presets() - ENUM_DV_PRESETS handler13201320+ * @file: file ptr13211321+ * @priv: file handle13221322+ * @preset: input preset13231323+ */13241324+static int vpif_enum_dv_presets(struct file *file, void *priv,13251325+ struct v4l2_dv_enum_preset *preset)13261326+{13271327+ struct vpif_fh *fh = priv;13281328+ struct channel_obj *ch = fh->channel;13291329+ struct video_obj *vid_ch = &ch->video;13301330+13311331+ return v4l2_subdev_call(vpif_obj.sd[vid_ch->output_id],13321332+ video, enum_dv_presets, preset);13331333+}13341334+13351335+/**13361336+ * vpif_s_dv_presets() - S_DV_PRESETS handler13371337+ * @file: file ptr13381338+ * @priv: file handle13391339+ * @preset: input preset13401340+ */13411341+static int vpif_s_dv_preset(struct file *file, void *priv,13421342+ struct v4l2_dv_preset *preset)13431343+{13441344+ struct vpif_fh *fh = priv;13451345+ struct channel_obj *ch = fh->channel;13461346+ struct common_obj *common = &ch->common[VPIF_VIDEO_INDEX];13471347+ struct video_obj *vid_ch = &ch->video;13481348+ int ret = 0;13491349+13501350+ if (common->started) {13511351+ vpif_dbg(1, debug, "streaming in progress\n");13521352+ return -EBUSY;13531353+ }13541354+13551355+ ret = v4l2_prio_check(&ch->prio, fh->prio);13561356+ if (ret != 0)13571357+ return ret;13581358+13591359+ fh->initialized = 1;13601360+13611361+ /* Call encoder subdevice function to set the standard */13621362+ if (mutex_lock_interruptible(&common->lock))13631363+ return -ERESTARTSYS;13641364+13651365+ ch->video.dv_preset = preset->preset;13661366+ ch->video.stdid = V4L2_STD_UNKNOWN;13671367+ memset(&ch->video.bt_timings, 0, sizeof(ch->video.bt_timings));13681368+13691369+ /* Get the information about the standard */13701370+ if (vpif_update_resolution(ch)) {13711371+ ret = -EINVAL;13721372+ } else {13731373+ /* Configure the default format information */13741374+ vpif_config_format(ch);13751375+13761376+ ret = v4l2_subdev_call(vpif_obj.sd[vid_ch->output_id],13771377+ video, s_dv_preset, preset);13781378+ }13791379+13801380+ mutex_unlock(&common->lock);13811381+13821382+ return ret;13831383+}13841384+/**13851385+ * vpif_g_dv_presets() - G_DV_PRESETS handler13861386+ * @file: file ptr13871387+ * @priv: file handle13881388+ * @preset: input preset13891389+ */13901390+static int vpif_g_dv_preset(struct file *file, void *priv,13911391+ struct v4l2_dv_preset *preset)13921392+{13931393+ struct vpif_fh *fh = priv;13941394+ struct channel_obj *ch = fh->channel;13951395+13961396+ preset->preset = ch->video.dv_preset;13971397+13981398+ return 0;13991399+}14001400+/**14011401+ * vpif_s_dv_timings() - S_DV_TIMINGS handler14021402+ * @file: file ptr14031403+ * @priv: file handle14041404+ * @timings: digital video timings14051405+ */14061406+static int vpif_s_dv_timings(struct file *file, void *priv,14071407+ struct v4l2_dv_timings *timings)14081408+{14091409+ struct vpif_fh *fh = priv;14101410+ struct channel_obj *ch = fh->channel;14111411+ struct vpif_params *vpifparams = &ch->vpifparams;14121412+ struct vpif_channel_config_params *std_info = &vpifparams->std_info;14131413+ struct video_obj *vid_ch = &ch->video;14141414+ struct v4l2_bt_timings *bt = &vid_ch->bt_timings;14151415+ int ret;14161416+14171417+ if (timings->type != V4L2_DV_BT_656_1120) {14181418+ vpif_dbg(2, debug, "Timing type not defined\n");14191419+ return -EINVAL;14201420+ }14211421+14221422+ /* Configure subdevice timings, if any */14231423+ ret = v4l2_subdev_call(vpif_obj.sd[vid_ch->output_id],14241424+ video, s_dv_timings, timings);14251425+ if (ret == -ENOIOCTLCMD) {14261426+ vpif_dbg(2, debug, "Custom DV timings not supported by "14271427+ "subdevice\n");14281428+ return -EINVAL;14291429+ }14301430+ if (ret < 0) {14311431+ vpif_dbg(2, debug, "Error setting custom DV timings\n");14321432+ return ret;14331433+ }14341434+14351435+ if (!(timings->bt.width && timings->bt.height &&14361436+ (timings->bt.hbackporch ||14371437+ timings->bt.hfrontporch ||14381438+ timings->bt.hsync) &&14391439+ timings->bt.vfrontporch &&14401440+ (timings->bt.vbackporch ||14411441+ timings->bt.vsync))) {14421442+ vpif_dbg(2, debug, "Timings for width, height, "14431443+ "horizontal back porch, horizontal sync, "14441444+ "horizontal front porch, vertical back porch, "14451445+ "vertical sync and vertical back porch "14461446+ "must be defined\n");14471447+ return -EINVAL;14481448+ }14491449+14501450+ *bt = timings->bt;14511451+14521452+ /* Configure video port timings */14531453+14541454+ std_info->eav2sav = bt->hbackporch + bt->hfrontporch +14551455+ bt->hsync - 8;14561456+ std_info->sav2eav = bt->width;14571457+14581458+ std_info->l1 = 1;14591459+ std_info->l3 = bt->vsync + bt->vbackporch + 1;14601460+14611461+ if (bt->interlaced) {14621462+ if (bt->il_vbackporch || bt->il_vfrontporch || bt->il_vsync) {14631463+ std_info->vsize = bt->height * 2 +14641464+ bt->vfrontporch + bt->vsync + bt->vbackporch +14651465+ bt->il_vfrontporch + bt->il_vsync +14661466+ bt->il_vbackporch;14671467+ std_info->l5 = std_info->vsize/2 -14681468+ (bt->vfrontporch - 1);14691469+ std_info->l7 = std_info->vsize/2 + 1;14701470+ std_info->l9 = std_info->l7 + bt->il_vsync +14711471+ bt->il_vbackporch + 1;14721472+ std_info->l11 = std_info->vsize -14731473+ (bt->il_vfrontporch - 1);14741474+ } else {14751475+ vpif_dbg(2, debug, "Required timing values for "14761476+ "interlaced BT format missing\n");14771477+ return -EINVAL;14781478+ }14791479+ } else {14801480+ std_info->vsize = bt->height + bt->vfrontporch +14811481+ bt->vsync + bt->vbackporch;14821482+ std_info->l5 = std_info->vsize - (bt->vfrontporch - 1);14831483+ }14841484+ strncpy(std_info->name, "Custom timings BT656/1120",14851485+ VPIF_MAX_NAME);14861486+ std_info->width = bt->width;14871487+ std_info->height = bt->height;14881488+ std_info->frm_fmt = bt->interlaced ? 0 : 1;14891489+ std_info->ycmux_mode = 0;14901490+ std_info->capture_format = 0;14911491+ std_info->vbi_supported = 0;14921492+ std_info->hd_sd = 1;14931493+ std_info->stdid = 0;14941494+ std_info->dv_preset = V4L2_DV_INVALID;14951495+14961496+ vid_ch->stdid = 0;14971497+ vid_ch->dv_preset = V4L2_DV_INVALID;14981498+14991499+ return 0;15001500+}15011501+15021502+/**15031503+ * vpif_g_dv_timings() - G_DV_TIMINGS handler15041504+ * @file: file ptr15051505+ * @priv: file handle15061506+ * @timings: digital video timings15071507+ */15081508+static int vpif_g_dv_timings(struct file *file, void *priv,15091509+ struct v4l2_dv_timings *timings)15101510+{15111511+ struct vpif_fh *fh = priv;15121512+ struct channel_obj *ch = fh->channel;15131513+ struct video_obj *vid_ch = &ch->video;15141514+ struct v4l2_bt_timings *bt = &vid_ch->bt_timings;15151515+15161516+ timings->bt = *bt;15171517+15181518+ return 0;15191519+}15201520+15211521+/*15221522+ * vpif_g_chip_ident() - Identify the chip15231523+ * @file: file ptr15241524+ * @priv: file handle15251525+ * @chip: chip identity15261526+ *15271527+ * Returns zero or -EINVAL if read operations fails.15281528+ */15291529+static int vpif_g_chip_ident(struct file *file, void *priv,15301530+ struct v4l2_dbg_chip_ident *chip)15311531+{15321532+ chip->ident = V4L2_IDENT_NONE;15331533+ chip->revision = 0;15341534+ if (chip->match.type != V4L2_CHIP_MATCH_I2C_DRIVER &&15351535+ chip->match.type != V4L2_CHIP_MATCH_I2C_ADDR) {15361536+ vpif_dbg(2, debug, "match_type is invalid.\n");15371537+ return -EINVAL;15381538+ }15391539+15401540+ return v4l2_device_call_until_err(&vpif_obj.v4l2_dev, 0, core,15411541+ g_chip_ident, chip);15421542+}15431543+15441544+#ifdef CONFIG_VIDEO_ADV_DEBUG15451545+/*15461546+ * vpif_dbg_g_register() - Read register15471547+ * @file: file ptr15481548+ * @priv: file handle15491549+ * @reg: register to be read15501550+ *15511551+ * Debugging only15521552+ * Returns zero or -EINVAL if read operations fails.15531553+ */15541554+static int vpif_dbg_g_register(struct file *file, void *priv,15551555+ struct v4l2_dbg_register *reg){15561556+ struct vpif_fh *fh = priv;15571557+ struct channel_obj *ch = fh->channel;15581558+ struct video_obj *vid_ch = &ch->video;15591559+15601560+ return v4l2_subdev_call(vpif_obj.sd[vid_ch->output_id], core,15611561+ g_register, reg);15621562+}15631563+15641564+/*15651565+ * vpif_dbg_s_register() - Write to register15661566+ * @file: file ptr15671567+ * @priv: file handle15681568+ * @reg: register to be modified15691569+ *15701570+ * Debugging only15711571+ * Returns zero or -EINVAL if write operations fails.15721572+ */15731573+static int vpif_dbg_s_register(struct file *file, void *priv,15741574+ struct v4l2_dbg_register *reg){15751575+ struct vpif_fh *fh = priv;15761576+ struct channel_obj *ch = fh->channel;15771577+ struct video_obj *vid_ch = &ch->video;15781578+15791579+ return v4l2_subdev_call(vpif_obj.sd[vid_ch->output_id], core,15801580+ s_register, reg);15811581+}15821582+#endif15831583+15841584+/*15851585+ * vpif_log_status() - Status information15861586+ * @file: file ptr15871587+ * @priv: file handle15881588+ *15891589+ * Returns zero.15901590+ */15911591+static int vpif_log_status(struct file *filep, void *priv)15921592+{15931593+ /* status for sub devices */15941594+ v4l2_device_call_all(&vpif_obj.v4l2_dev, 0, core, log_status);15951595+15961596+ return 0;15971597+}15981598+12831599/* vpif display ioctl operations */12841600static const struct v4l2_ioctl_ops vpif_ioctl_ops = {12851601 .vidioc_querycap = vpif_querycap,···15821336 .vidioc_s_output = vpif_s_output,15831337 .vidioc_g_output = vpif_g_output,15841338 .vidioc_cropcap = vpif_cropcap,13391339+ .vidioc_enum_dv_presets = vpif_enum_dv_presets,13401340+ .vidioc_s_dv_preset = vpif_s_dv_preset,13411341+ .vidioc_g_dv_preset = vpif_g_dv_preset,13421342+ .vidioc_s_dv_timings = vpif_s_dv_timings,13431343+ .vidioc_g_dv_timings = vpif_g_dv_timings,13441344+ .vidioc_g_chip_ident = vpif_g_chip_ident,13451345+#ifdef CONFIG_VIDEO_ADV_DEBUG13461346+ .vidioc_g_register = vpif_dbg_g_register,13471347+ .vidioc_s_register = vpif_dbg_s_register,13481348+#endif13491349+ .vidioc_log_status = vpif_log_status,15851350};1586135115871352static const struct v4l2_file_operations vpif_fops = {15881353 .owner = THIS_MODULE,15891354 .open = vpif_open,15901355 .release = vpif_release,15911591- .ioctl = video_ioctl2,13561356+ .unlocked_ioctl = video_ioctl2,15921357 .mmap = vpif_mmap,15931358 .poll = vpif_poll15941359};···17831526 v4l2_prio_init(&ch->prio);17841527 ch->common[VPIF_VIDEO_INDEX].fmt.type =17851528 V4L2_BUF_TYPE_VIDEO_OUTPUT;15291529+ ch->video_dev->lock = &common->lock;1786153017871531 /* register video device */17881532 vpif_dbg(1, debug, "channel=%x,channel->video_dev=%x\n",···18231565 vpif_obj.sd[i]->grp_id = 1 << i;18241566 }1825156715681568+ v4l2_info(&vpif_obj.v4l2_dev,15691569+ "DM646x VPIF display driver initialized\n");18261570 return 0;1827157118281572probe_subdev_out:
+2
drivers/media/video/davinci/vpif_display.h
···6767 * most recent displayed frame only */6868 v4l2_std_id stdid; /* Currently selected or default6969 * standard */7070+ u32 dv_preset;7171+ struct v4l2_bt_timings bt_timings;7072 u32 output_id; /* Current output id */7173};7274
···378378 goto error;379379 }380380381381-#ifdef CONFIG_I2C382382- /* until i2c is working properly */383383- retval = 0; /* hdpvr_register_i2c_adapter(dev); */381381+#if defined(CONFIG_I2C) || defined(CONFIG_I2C_MODULE)382382+ retval = hdpvr_register_i2c_adapter(dev);384383 if (retval < 0) {385384 v4l2_err(&dev->v4l2_dev, "registering i2c adapter failed\n");386385 goto error;387386 }388387389389- /* until i2c is working properly */390390- retval = 0; /* hdpvr_register_i2c_ir(dev); */388388+ retval = hdpvr_register_i2c_ir(dev);391389 if (retval < 0)392390 v4l2_err(&dev->v4l2_dev, "registering i2c IR devices failed\n");393393-#endif /* CONFIG_I2C */391391+#endif394392395393 /* let the user know what node this device is now attached to */396394 v4l2_info(&dev->v4l2_dev, "device now attached to %s\n",
+70-79
drivers/media/video/hdpvr/hdpvr-i2c.c
···1313 *1414 */15151616+#if defined(CONFIG_I2C) || defined(CONFIG_I2C_MODULE)1717+1618#include <linux/i2c.h>1719#include <linux/slab.h>1820···3028#define Z8F0811_IR_TX_I2C_ADDR 0x703129#define Z8F0811_IR_RX_I2C_ADDR 0x7132303333-static const u8 ir_i2c_addrs[] = {3434- Z8F0811_IR_TX_I2C_ADDR,3535- Z8F0811_IR_RX_I2C_ADDR,3131+3232+static struct i2c_board_info hdpvr_i2c_board_info = {3333+ I2C_BOARD_INFO("ir_tx_z8f0811_hdpvr", Z8F0811_IR_TX_I2C_ADDR),3434+ I2C_BOARD_INFO("ir_rx_z8f0811_hdpvr", Z8F0811_IR_RX_I2C_ADDR),3635};3737-3838-static const char * const ir_devicenames[] = {3939- "ir_tx_z8f0811_hdpvr",4040- "ir_rx_z8f0811_hdpvr",4141-};4242-4343-static int hdpvr_new_i2c_ir(struct hdpvr_device *dev, struct i2c_adapter *adap,4444- const char *type, u8 addr)4545-{4646- struct i2c_board_info info;4747- struct IR_i2c_init_data *init_data = &dev->ir_i2c_init_data;4848- unsigned short addr_list[2] = { addr, I2C_CLIENT_END };4949-5050- memset(&info, 0, sizeof(struct i2c_board_info));5151- strlcpy(info.type, type, I2C_NAME_SIZE);5252-5353- /* Our default information for ir-kbd-i2c.c to use */5454- switch (addr) {5555- case Z8F0811_IR_RX_I2C_ADDR:5656- init_data->ir_codes = RC_MAP_HAUPPAUGE_NEW;5757- init_data->internal_get_key_func = IR_KBD_GET_KEY_HAUP_XVR;5858- init_data->type = RC_TYPE_RC5;5959- init_data->name = "HD PVR";6060- info.platform_data = init_data;6161- break;6262- }6363-6464- return i2c_new_probed_device(adap, &info, addr_list, NULL) == NULL ?6565- -1 : 0;6666-}67366837int hdpvr_register_i2c_ir(struct hdpvr_device *dev)6938{7070- int i;7171- int ret = 0;3939+ struct i2c_client *c;4040+ struct IR_i2c_init_data *init_data = &dev->ir_i2c_init_data;72417373- for (i = 0; i < ARRAY_SIZE(ir_i2c_addrs); i++)7474- ret += hdpvr_new_i2c_ir(dev, dev->i2c_adapter,7575- ir_devicenames[i], ir_i2c_addrs[i]);4242+ /* Our default information for ir-kbd-i2c.c to use */4343+ init_data->ir_codes = RC_MAP_HAUPPAUGE_NEW;4444+ init_data->internal_get_key_func = IR_KBD_GET_KEY_HAUP_XVR;4545+ init_data->type = RC_TYPE_RC5;4646+ init_data->name = "HD PVR";4747+ hdpvr_i2c_board_info.platform_data = init_data;76487777- return ret;4949+ c = i2c_new_device(&dev->i2c_adapter, &hdpvr_i2c_board_info);5050+5151+ return (c == NULL) ? -ENODEV : 0;7852}79538080-static int hdpvr_i2c_read(struct hdpvr_device *dev, unsigned char addr,8181- char *data, int len)5454+static int hdpvr_i2c_read(struct hdpvr_device *dev, int bus,5555+ unsigned char addr, char *data, int len)8256{8357 int ret;8484- char *buf = kmalloc(len, GFP_KERNEL);8585- if (!buf)8686- return -ENOMEM;5858+5959+ if (len > sizeof(dev->i2c_buf))6060+ return -EINVAL;87618862 ret = usb_control_msg(dev->udev,8963 usb_rcvctrlpipe(dev->udev, 0),9064 REQTYPE_I2C_READ, CTRL_READ_REQUEST,9191- 0x100|addr, 0, buf, len, 1000);6565+ (bus << 8) | addr, 0, &dev->i2c_buf, len, 1000);92669367 if (ret == len) {9494- memcpy(data, buf, len);6868+ memcpy(data, &dev->i2c_buf, len);9569 ret = 0;9670 } else if (ret >= 0)9771 ret = -EIO;98729999- kfree(buf);100100-10173 return ret;10274}10375104104-static int hdpvr_i2c_write(struct hdpvr_device *dev, unsigned char addr,105105- char *data, int len)7676+static int hdpvr_i2c_write(struct hdpvr_device *dev, int bus,7777+ unsigned char addr, char *data, int len)10678{10779 int ret;108108- char *buf = kmalloc(len, GFP_KERNEL);109109- if (!buf)110110- return -ENOMEM;11180112112- memcpy(buf, data, len);8181+ if (len > sizeof(dev->i2c_buf))8282+ return -EINVAL;8383+8484+ memcpy(&dev->i2c_buf, data, len);11385 ret = usb_control_msg(dev->udev,11486 usb_sndctrlpipe(dev->udev, 0),11587 REQTYPE_I2C_WRITE, CTRL_WRITE_REQUEST,116116- 0x100|addr, 0, buf, len, 1000);8888+ (bus << 8) | addr, 0, &dev->i2c_buf, len, 1000);1178911890 if (ret < 0)119119- goto error;9191+ return ret;1209212193 ret = usb_control_msg(dev->udev,12294 usb_rcvctrlpipe(dev->udev, 0),12395 REQTYPE_I2C_WRITE_STATT, CTRL_READ_REQUEST,124124- 0, 0, buf, 2, 1000);9696+ 0, 0, &dev->i2c_buf, 2, 1000);12597126126- if (ret == 2)9898+ if ((ret == 2) && (dev->i2c_buf[1] == (len - 1)))12799 ret = 0;128100 else if (ret >= 0)129101 ret = -EIO;130102131131-error:132132- kfree(buf);133103 return ret;134104}135105···120146 addr = msgs[i].addr << 1;121147122148 if (msgs[i].flags & I2C_M_RD)123123- retval = hdpvr_i2c_read(dev, addr, msgs[i].buf,149149+ retval = hdpvr_i2c_read(dev, 1, addr, msgs[i].buf,124150 msgs[i].len);125151 else126126- retval = hdpvr_i2c_write(dev, addr, msgs[i].buf,152152+ retval = hdpvr_i2c_write(dev, 1, addr, msgs[i].buf,127153 msgs[i].len);128154 }129155···142168 .functionality = hdpvr_functionality,143169};144170171171+static struct i2c_adapter hdpvr_i2c_adapter_template = {172172+ .name = "Hauppage HD PVR I2C",173173+ .owner = THIS_MODULE,174174+ .algo = &hdpvr_algo,175175+};176176+177177+static int hdpvr_activate_ir(struct hdpvr_device *dev)178178+{179179+ char buffer[8];180180+181181+ mutex_lock(&dev->i2c_mutex);182182+183183+ hdpvr_i2c_read(dev, 0, 0x54, buffer, 1);184184+185185+ buffer[0] = 0;186186+ buffer[1] = 0x8;187187+ hdpvr_i2c_write(dev, 1, 0x54, buffer, 2);188188+189189+ buffer[1] = 0x18;190190+ hdpvr_i2c_write(dev, 1, 0x54, buffer, 2);191191+192192+ mutex_unlock(&dev->i2c_mutex);193193+194194+ return 0;195195+}196196+145197int hdpvr_register_i2c_adapter(struct hdpvr_device *dev)146198{147147- struct i2c_adapter *i2c_adap;148199 int retval = -ENOMEM;149200150150- i2c_adap = kzalloc(sizeof(struct i2c_adapter), GFP_KERNEL);151151- if (i2c_adap == NULL)152152- goto error;201201+ hdpvr_activate_ir(dev);153202154154- strlcpy(i2c_adap->name, "Hauppauge HD PVR I2C",155155- sizeof(i2c_adap->name));156156- i2c_adap->algo = &hdpvr_algo;157157- i2c_adap->owner = THIS_MODULE;158158- i2c_adap->dev.parent = &dev->udev->dev;203203+ memcpy(&dev->i2c_adapter, &hdpvr_i2c_adapter_template,204204+ sizeof(struct i2c_adapter));205205+ dev->i2c_adapter.dev.parent = &dev->udev->dev;159206160160- i2c_set_adapdata(i2c_adap, dev);207207+ i2c_set_adapdata(&dev->i2c_adapter, dev);161208162162- retval = i2c_add_adapter(i2c_adap);209209+ retval = i2c_add_adapter(&dev->i2c_adapter);163210164164- if (!retval)165165- dev->i2c_adapter = i2c_adap;166166- else167167- kfree(i2c_adap);168168-169169-error:170211 return retval;171212}213213+214214+#endif
···4040#include "pvrusb2-io.h"4141#include <media/v4l2-device.h>4242#include <media/cx2341x.h>4343+#include <media/ir-kbd-i2c.h>4344#include "pvrusb2-devattr.h"44454546/* Legal values for PVR2_CID_HSM */···203202204203 /* IR related */205204 unsigned int ir_scheme_active; /* IR scheme as seen from the outside */205205+ struct IR_i2c_init_data ir_init_data; /* params passed to IR modules */206206207207 /* Frequency table */208208 unsigned int freqTable[FREQTABLE_SIZE];
+43-19
drivers/media/video/pvrusb2/pvrusb2-i2c-core.c
···1919 */20202121#include <linux/i2c.h>2222+#include <media/ir-kbd-i2c.h>2223#include "pvrusb2-i2c-core.h"2324#include "pvrusb2-hdw-internal.h"2425#include "pvrusb2-debug.h"···4847 int, S_IRUGO|S_IWUSR);4948MODULE_PARM_DESC(disable_autoload_ir_video,5049 "1=do not try to autoload ir_video IR receiver");5151-5252-/* Mapping of IR schemes to known I2C addresses - if any */5353-static const unsigned char ir_video_addresses[] = {5454- [PVR2_IR_SCHEME_ZILOG] = 0x71,5555- [PVR2_IR_SCHEME_29XXX] = 0x18,5656- [PVR2_IR_SCHEME_24XXX] = 0x18,5757-};58505951static int pvr2_i2c_write(struct pvr2_hdw *hdw, /* Context */6052 u8 i2c_addr, /* I2C address we're talking to */···568574static void pvr2_i2c_register_ir(struct pvr2_hdw *hdw)569575{570576 struct i2c_board_info info;571571- unsigned char addr = 0;577577+ struct IR_i2c_init_data *init_data = &hdw->ir_init_data;572578 if (pvr2_disable_ir_video) {573579 pvr2_trace(PVR2_TRACE_INFO,574580 "Automatic binding of ir_video has been disabled.");575581 return;576582 }577577- if (hdw->ir_scheme_active < ARRAY_SIZE(ir_video_addresses)) {578578- addr = ir_video_addresses[hdw->ir_scheme_active];579579- }580580- if (!addr) {583583+ memset(&info, 0, sizeof(struct i2c_board_info));584584+ switch (hdw->ir_scheme_active) {585585+ case PVR2_IR_SCHEME_24XXX: /* FX2-controlled IR */586586+ case PVR2_IR_SCHEME_29XXX: /* Original 29xxx device */587587+ init_data->ir_codes = RC_MAP_HAUPPAUGE_NEW;588588+ init_data->internal_get_key_func = IR_KBD_GET_KEY_HAUP;589589+ init_data->type = RC_TYPE_RC5;590590+ init_data->name = hdw->hdw_desc->description;591591+ init_data->polling_interval = 100; /* ms From ir-kbd-i2c */592592+ /* IR Receiver */593593+ info.addr = 0x18;594594+ info.platform_data = init_data;595595+ strlcpy(info.type, "ir_video", I2C_NAME_SIZE);596596+ pvr2_trace(PVR2_TRACE_INFO, "Binding %s to i2c address 0x%02x.",597597+ info.type, info.addr);598598+ i2c_new_device(&hdw->i2c_adap, &info);599599+ break;600600+ case PVR2_IR_SCHEME_ZILOG: /* HVR-1950 style */601601+ case PVR2_IR_SCHEME_24XXX_MCE: /* 24xxx MCE device */602602+ init_data->ir_codes = RC_MAP_HAUPPAUGE_NEW;603603+ init_data->internal_get_key_func = IR_KBD_GET_KEY_HAUP_XVR;604604+ init_data->type = RC_TYPE_RC5;605605+ init_data->name = hdw->hdw_desc->description;606606+ init_data->polling_interval = 260; /* ms From lirc_zilog */607607+ /* IR Receiver */608608+ info.addr = 0x71;609609+ info.platform_data = init_data;610610+ strlcpy(info.type, "ir_rx_z8f0811_haup", I2C_NAME_SIZE);611611+ pvr2_trace(PVR2_TRACE_INFO, "Binding %s to i2c address 0x%02x.",612612+ info.type, info.addr);613613+ i2c_new_device(&hdw->i2c_adap, &info);614614+ /* IR Trasmitter */615615+ info.addr = 0x70;616616+ info.platform_data = init_data;617617+ strlcpy(info.type, "ir_tx_z8f0811_haup", I2C_NAME_SIZE);618618+ pvr2_trace(PVR2_TRACE_INFO, "Binding %s to i2c address 0x%02x.",619619+ info.type, info.addr);620620+ i2c_new_device(&hdw->i2c_adap, &info);621621+ break;622622+ default:581623 /* The device either doesn't support I2C-based IR or we582624 don't know (yet) how to operate IR on the device. */583583- return;625625+ break;584626 }585585- pvr2_trace(PVR2_TRACE_INFO,586586- "Binding ir_video to i2c address 0x%02x.", addr);587587- memset(&info, 0, sizeof(struct i2c_board_info));588588- strlcpy(info.type, "ir_video", I2C_NAME_SIZE);589589- info.addr = addr;590590- i2c_new_device(&hdw->i2c_adap, &info);591627}592628593629void pvr2_i2c_core_init(struct pvr2_hdw *hdw)
+12-39
drivers/media/video/saa7134/saa7134-cards.c
···51795179 [SAA7134_BOARD_KWORLD_PCI_SBTVD_FULLSEG] = {51805180 .name = "Kworld PCI SBTVD/ISDB-T Full-Seg Hybrid",51815181 .audio_clock = 0x00187de7,51825182-#if 051835183- /*51845184- * FIXME: Analog mode doesn't work, if digital is enabled. The proper51855185- * fix is to use tda8290 driver, but Kworld seems to use an51865186- * unsupported version of tda8295.51875187- */51885188- .tuner_type = TUNER_NXP_TDA18271, /* TUNER_PHILIPS_TDA8290 */51895189- .tuner_addr = 0x60,51905190-#else51915191- .tuner_type = UNSET,51825182+ .tuner_type = TUNER_PHILIPS_TDA8290,51925183 .tuner_addr = ADDR_UNSET,51935193-#endif51945184 .radio_type = UNSET,51955185 .radio_addr = ADDR_UNSET,51965186 .gpiomask = 0x8e054000,···69226932 /* toggle AGC switch through GPIO 27 */69236933 switch (mode) {69246934 case TDA18271_ANALOG:69256925- saa7134_set_gpio(dev, 27, 0);69356935+ saa_writel(SAA7134_GPIO_GPMODE0 >> 2, 0x4000);69366936+ saa_writel(SAA7134_GPIO_GPSTATUS0 >> 2, 0x4000);69376937+ msleep(20);69266938 break;69276939 case TDA18271_DIGITAL:69286928- saa7134_set_gpio(dev, 27, 1);69406940+ saa_writel(SAA7134_GPIO_GPMODE0 >> 2, 0x14000);69416941+ saa_writel(SAA7134_GPIO_GPSTATUS0 >> 2, 0x14000);69426942+ msleep(20);69436943+ saa_writel(SAA7134_GPIO_GPMODE0 >> 2, 0x54000);69446944+ saa_writel(SAA7134_GPIO_GPSTATUS0 >> 2, 0x54000);69456945+ msleep(30);69296946 break;69306947 default:69316948 return -EINVAL;···69906993int saa7134_tuner_callback(void *priv, int component, int command, int arg)69916994{69926995 struct saa7134_dev *dev = priv;69966996+69936997 if (dev != NULL) {69946998 switch (dev->tuner_type) {69956999 case TUNER_PHILIPS_TDA8290:···76577659 break;76587660 }76597661 case SAA7134_BOARD_KWORLD_PCI_SBTVD_FULLSEG:76607660- {76617661- struct i2c_msg msg = { .addr = 0x4b, .flags = 0 };76627662- int i;76637663- static u8 buffer[][2] = {76647664- {0x30, 0x31},76657665- {0xff, 0x00},76667666- {0x41, 0x03},76677667- {0x41, 0x1a},76687668- {0xff, 0x02},76697669- {0x34, 0x00},76707670- {0x45, 0x97},76717671- {0x45, 0xc1},76727672- };76737662 saa_writel(SAA7134_GPIO_GPMODE0 >> 2, 0x4000);76747663 saa_writel(SAA7134_GPIO_GPSTATUS0 >> 2, 0x4000);7675766476767676- /*76777677- * FIXME: identify what device is at addr 0x4b and what means76787678- * this initialization76797679- */76807680- for (i = 0; i < ARRAY_SIZE(buffer); i++) {76817681- msg.buf = &buffer[i][0];76827682- msg.len = ARRAY_SIZE(buffer[0]);76837683- if (i2c_transfer(&dev->i2c_adap, &msg, 1) != 1)76847684- printk(KERN_WARNING76857685- "%s: Unable to enable tuner(%i).\n",76867686- dev->name, i);76877687- }76657665+ saa7134_set_gpio(dev, 27, 0);76887666 break;76897689- }76907667 } /* switch() */7691766876927669 /* initialize tuner */
+36-44
drivers/media/video/saa7134/saa7134-dvb.c
···237237static struct tda18271_config kworld_tda18271_config = {238238 .std_map = &mb86a20s_tda18271_std_map,239239 .gate = TDA18271_GATE_DIGITAL,240240+ .config = 3, /* Use tuner callback for AGC */241241+240242};241243242244static const struct mb86a20s_config kworld_mb86a20s_config = {243245 .demod_address = 0x10,244246};247247+248248+static int kworld_sbtvd_gate_ctrl(struct dvb_frontend* fe, int enable)249249+{250250+ struct saa7134_dev *dev = fe->dvb->priv;251251+252252+ unsigned char initmsg[] = {0x45, 0x97};253253+ unsigned char msg_enable[] = {0x45, 0xc1};254254+ unsigned char msg_disable[] = {0x45, 0x81};255255+ struct i2c_msg msg = {.addr = 0x4b, .flags = 0, .buf = initmsg, .len = 2};256256+257257+ if (i2c_transfer(&dev->i2c_adap, &msg, 1) != 1) {258258+ wprintk("could not access the I2C gate\n");259259+ return -EIO;260260+ }261261+ if (enable)262262+ msg.buf = msg_enable;263263+ else264264+ msg.buf = msg_disable;265265+ if (i2c_transfer(&dev->i2c_adap, &msg, 1) != 1) {266266+ wprintk("could not access the I2C gate\n");267267+ return -EIO;268268+ }269269+ msleep(20);270270+ return 0;271271+}245272246273/* ==================================================================247274 * tda1004x based DVB-T cards, helper functions···647620 .config = 2,648621 .switch_addr = 0x42649622};650650-651651-/* ------------------------------------------------------------------ */652652-653653-static int __kworld_sbtvd_i2c_gate_ctrl(struct saa7134_dev *dev, int enable)654654-{655655- unsigned char initmsg[] = {0x45, 0x97};656656- unsigned char msg_enable[] = {0x45, 0xc1};657657- unsigned char msg_disable[] = {0x45, 0x81};658658- struct i2c_msg msg = {.addr = 0x4b, .flags = 0, .buf = initmsg, .len = 2};659659-660660- if (i2c_transfer(&dev->i2c_adap, &msg, 1) != 1) {661661- wprintk("could not access the I2C gate\n");662662- return -EIO;663663- }664664- if (enable)665665- msg.buf = msg_enable;666666- else667667- msg.buf = msg_disable;668668- if (i2c_transfer(&dev->i2c_adap, &msg, 1) != 1) {669669- wprintk("could not access the I2C gate\n");670670- return -EIO;671671- }672672- msleep(20);673673- return 0;674674-}675675-static int kworld_sbtvd_i2c_gate_ctrl(struct dvb_frontend *fe, int enable)676676-{677677- struct saa7134_dev *dev = fe->dvb->priv;678678-679679- return __kworld_sbtvd_i2c_gate_ctrl(dev, enable);680680-}681623682624/* ------------------------------------------------------------------ */683625···16561660 }16571661 break;16581662 case SAA7134_BOARD_KWORLD_PCI_SBTVD_FULLSEG:16591659- __kworld_sbtvd_i2c_gate_ctrl(dev, 0);16601660- saa_writel(SAA7134_GPIO_GPMODE0 >> 2, 0x14000);16611661- saa_writel(SAA7134_GPIO_GPSTATUS0 >> 2, 0x14000);16621662- msleep(20);16631663- saa_writel(SAA7134_GPIO_GPMODE0 >> 2, 0x54000);16641664- saa_writel(SAA7134_GPIO_GPSTATUS0 >> 2, 0x54000);16651665- msleep(20);16631663+ /* Switch to digital mode */16641664+ saa7134_tuner_callback(dev, 0,16651665+ TDA18271_CALLBACK_CMD_AGC_ENABLE, 1);16661666 fe0->dvb.frontend = dvb_attach(mb86a20s_attach,16671667 &kworld_mb86a20s_config,16681668 &dev->i2c_adap);16691669- __kworld_sbtvd_i2c_gate_ctrl(dev, 1);16701669 if (fe0->dvb.frontend != NULL) {16701670+ dvb_attach(tda829x_attach, fe0->dvb.frontend,16711671+ &dev->i2c_adap, 0x4b,16721672+ &tda829x_no_probe);16711673 dvb_attach(tda18271_attach, fe0->dvb.frontend,16721674 0x60, &dev->i2c_adap,16731675 &kworld_tda18271_config);16741674- /*16751675- * Only after success, it can initialize the gate, otherwise16761676- * an OOPS will hit, due to kfree(fe0->dvb.frontend)16771677- */16781678- fe0->dvb.frontend->ops.i2c_gate_ctrl = kworld_sbtvd_i2c_gate_ctrl;16761676+ fe0->dvb.frontend->ops.i2c_gate_ctrl = kworld_sbtvd_gate_ctrl;16791677 }16781678+16791679+ /* mb86a20s need to use the I2C gateway */16801680 break;16811681 default:16821682 wprintk("Huh? unknown DVB card?\n");
···11-/*22- * For the TDA9875 chip33- * (The TDA9875 is used on the Diamond DTV2000 french version44- * Other cards probably use these chips as well.)55- * This driver will not complain if used with any66- * other i2c device with the same address.77- *88- * Copyright (c) 2000 Guillaume Delvit based on Gerd Knorr source and99- * Eric Sandeen1010- * Copyright (c) 2006 Mauro Carvalho Chehab <mchehab@infradead.org>1111- * This code is placed under the terms of the GNU General Public License1212- * Based on tda9855.c by Steve VanDeBogart (vandebo@uclink.berkeley.edu)1313- * Which was based on tda8425.c by Greg Alexander (c) 19981414- *1515- * OPTIONS:1616- * debug - set to 1 if you'd like to see debug messages1717- *1818- * Revision: 0.1 - original version1919- */2020-2121-#include <linux/module.h>2222-#include <linux/kernel.h>2323-#include <linux/string.h>2424-#include <linux/timer.h>2525-#include <linux/delay.h>2626-#include <linux/errno.h>2727-#include <linux/slab.h>2828-#include <linux/i2c.h>2929-#include <linux/videodev2.h>3030-#include <media/v4l2-device.h>3131-#include <media/i2c-addr.h>3232-3333-static int debug; /* insmod parameter */3434-module_param(debug, int, S_IRUGO | S_IWUSR);3535-MODULE_LICENSE("GPL");3636-3737-3838-/* This is a superset of the TDA9875 */3939-struct tda9875 {4040- struct v4l2_subdev sd;4141- int rvol, lvol;4242- int bass, treble;4343-};4444-4545-static inline struct tda9875 *to_state(struct v4l2_subdev *sd)4646-{4747- return container_of(sd, struct tda9875, sd);4848-}4949-5050-#define dprintk if (debug) printk5151-5252-/* The TDA9875 is made by Philips Semiconductor5353- * http://www.semiconductors.philips.com5454- * TDA9875: I2C-bus controlled DSP audio processor, FM demodulator5555- *5656- */5757-5858- /* subaddresses for TDA9875 */5959-#define TDA9875_MUT 0x12 /*General mute (value --> 0b11001100*/6060-#define TDA9875_CFG 0x01 /* Config register (value --> 0b00000000 */6161-#define TDA9875_DACOS 0x13 /*DAC i/o select (ADC) 0b0000100*/6262-#define TDA9875_LOSR 0x16 /*Line output select regirter 0b0100 0001*/6363-6464-#define TDA9875_CH1V 0x0c /*Channel 1 volume (mute)*/6565-#define TDA9875_CH2V 0x0d /*Channel 2 volume (mute)*/6666-#define TDA9875_SC1 0x14 /*SCART 1 in (mono)*/6767-#define TDA9875_SC2 0x15 /*SCART 2 in (mono)*/6868-6969-#define TDA9875_ADCIS 0x17 /*ADC input select (mono) 0b0110 000*/7070-#define TDA9875_AER 0x19 /*Audio effect (AVL+Pseudo) 0b0000 0110*/7171-#define TDA9875_MCS 0x18 /*Main channel select (DAC) 0b0000100*/7272-#define TDA9875_MVL 0x1a /* Main volume gauche */7373-#define TDA9875_MVR 0x1b /* Main volume droite */7474-#define TDA9875_MBA 0x1d /* Main Basse */7575-#define TDA9875_MTR 0x1e /* Main treble */7676-#define TDA9875_ACS 0x1f /* Auxilary channel select (FM) 0b0000000*/7777-#define TDA9875_AVL 0x20 /* Auxilary volume gauche */7878-#define TDA9875_AVR 0x21 /* Auxilary volume droite */7979-#define TDA9875_ABA 0x22 /* Auxilary Basse */8080-#define TDA9875_ATR 0x23 /* Auxilary treble */8181-8282-#define TDA9875_MSR 0x02 /* Monitor select register */8383-#define TDA9875_C1MSB 0x03 /* Carrier 1 (FM) frequency register MSB */8484-#define TDA9875_C1MIB 0x04 /* Carrier 1 (FM) frequency register (16-8]b */8585-#define TDA9875_C1LSB 0x05 /* Carrier 1 (FM) frequency register LSB */8686-#define TDA9875_C2MSB 0x06 /* Carrier 2 (nicam) frequency register MSB */8787-#define TDA9875_C2MIB 0x07 /* Carrier 2 (nicam) frequency register (16-8]b */8888-#define TDA9875_C2LSB 0x08 /* Carrier 2 (nicam) frequency register LSB */8989-#define TDA9875_DCR 0x09 /* Demodulateur configuration regirter*/9090-#define TDA9875_DEEM 0x0a /* FM de-emphasis regirter*/9191-#define TDA9875_FMAT 0x0b /* FM Matrix regirter*/9292-9393-/* values */9494-#define TDA9875_MUTE_ON 0xff /* general mute */9595-#define TDA9875_MUTE_OFF 0xcc /* general no mute */9696-9797-9898-9999-/* Begin code */100100-101101-static int tda9875_write(struct v4l2_subdev *sd, int subaddr, unsigned char val)102102-{103103- struct i2c_client *client = v4l2_get_subdevdata(sd);104104- unsigned char buffer[2];105105-106106- v4l2_dbg(1, debug, sd, "Writing %d 0x%x\n", subaddr, val);107107- buffer[0] = subaddr;108108- buffer[1] = val;109109- if (2 != i2c_master_send(client, buffer, 2)) {110110- v4l2_warn(sd, "I/O error, trying (write %d 0x%x)\n",111111- subaddr, val);112112- return -1;113113- }114114- return 0;115115-}116116-117117-118118-static int i2c_read_register(struct i2c_client *client, int addr, int reg)119119-{120120- unsigned char write[1];121121- unsigned char read[1];122122- struct i2c_msg msgs[2] = {123123- { addr, 0, 1, write },124124- { addr, I2C_M_RD, 1, read }125125- };126126-127127- write[0] = reg;128128-129129- if (2 != i2c_transfer(client->adapter, msgs, 2)) {130130- v4l_warn(client, "I/O error (read2)\n");131131- return -1;132132- }133133- v4l_dbg(1, debug, client, "chip_read2: reg%d=0x%x\n", reg, read[0]);134134- return read[0];135135-}136136-137137-static void tda9875_set(struct v4l2_subdev *sd)138138-{139139- struct tda9875 *tda = to_state(sd);140140- unsigned char a;141141-142142- v4l2_dbg(1, debug, sd, "tda9875_set(%04x,%04x,%04x,%04x)\n",143143- tda->lvol, tda->rvol, tda->bass, tda->treble);144144-145145- a = tda->lvol & 0xff;146146- tda9875_write(sd, TDA9875_MVL, a);147147- a =tda->rvol & 0xff;148148- tda9875_write(sd, TDA9875_MVR, a);149149- a =tda->bass & 0xff;150150- tda9875_write(sd, TDA9875_MBA, a);151151- a =tda->treble & 0xff;152152- tda9875_write(sd, TDA9875_MTR, a);153153-}154154-155155-static void do_tda9875_init(struct v4l2_subdev *sd)156156-{157157- struct tda9875 *t = to_state(sd);158158-159159- v4l2_dbg(1, debug, sd, "In tda9875_init\n");160160- tda9875_write(sd, TDA9875_CFG, 0xd0); /*reg de config 0 (reset)*/161161- tda9875_write(sd, TDA9875_MSR, 0x03); /* Monitor 0b00000XXX*/162162- tda9875_write(sd, TDA9875_C1MSB, 0x00); /*Car1(FM) MSB XMHz*/163163- tda9875_write(sd, TDA9875_C1MIB, 0x00); /*Car1(FM) MIB XMHz*/164164- tda9875_write(sd, TDA9875_C1LSB, 0x00); /*Car1(FM) LSB XMHz*/165165- tda9875_write(sd, TDA9875_C2MSB, 0x00); /*Car2(NICAM) MSB XMHz*/166166- tda9875_write(sd, TDA9875_C2MIB, 0x00); /*Car2(NICAM) MIB XMHz*/167167- tda9875_write(sd, TDA9875_C2LSB, 0x00); /*Car2(NICAM) LSB XMHz*/168168- tda9875_write(sd, TDA9875_DCR, 0x00); /*Demod config 0x00*/169169- tda9875_write(sd, TDA9875_DEEM, 0x44); /*DE-Emph 0b0100 0100*/170170- tda9875_write(sd, TDA9875_FMAT, 0x00); /*FM Matrix reg 0x00*/171171- tda9875_write(sd, TDA9875_SC1, 0x00); /* SCART 1 (SC1)*/172172- tda9875_write(sd, TDA9875_SC2, 0x01); /* SCART 2 (sc2)*/173173-174174- tda9875_write(sd, TDA9875_CH1V, 0x10); /* Channel volume 1 mute*/175175- tda9875_write(sd, TDA9875_CH2V, 0x10); /* Channel volume 2 mute */176176- tda9875_write(sd, TDA9875_DACOS, 0x02); /* sig DAC i/o(in:nicam)*/177177- tda9875_write(sd, TDA9875_ADCIS, 0x6f); /* sig ADC input(in:mono)*/178178- tda9875_write(sd, TDA9875_LOSR, 0x00); /* line out (in:mono)*/179179- tda9875_write(sd, TDA9875_AER, 0x00); /*06 Effect (AVL+PSEUDO) */180180- tda9875_write(sd, TDA9875_MCS, 0x44); /* Main ch select (DAC) */181181- tda9875_write(sd, TDA9875_MVL, 0x03); /* Vol Main left 10dB */182182- tda9875_write(sd, TDA9875_MVR, 0x03); /* Vol Main right 10dB*/183183- tda9875_write(sd, TDA9875_MBA, 0x00); /* Main Bass Main 0dB*/184184- tda9875_write(sd, TDA9875_MTR, 0x00); /* Main Treble Main 0dB*/185185- tda9875_write(sd, TDA9875_ACS, 0x44); /* Aux chan select (dac)*/186186- tda9875_write(sd, TDA9875_AVL, 0x00); /* Vol Aux left 0dB*/187187- tda9875_write(sd, TDA9875_AVR, 0x00); /* Vol Aux right 0dB*/188188- tda9875_write(sd, TDA9875_ABA, 0x00); /* Aux Bass Main 0dB*/189189- tda9875_write(sd, TDA9875_ATR, 0x00); /* Aux Aigus Main 0dB*/190190-191191- tda9875_write(sd, TDA9875_MUT, 0xcc); /* General mute */192192-193193- t->lvol = t->rvol = 0; /* 0dB */194194- t->bass = 0; /* 0dB */195195- t->treble = 0; /* 0dB */196196- tda9875_set(sd);197197-}198198-199199-200200-static int tda9875_g_ctrl(struct v4l2_subdev *sd, struct v4l2_control *ctrl)201201-{202202- struct tda9875 *t = to_state(sd);203203-204204- switch (ctrl->id) {205205- case V4L2_CID_AUDIO_VOLUME:206206- {207207- int left = (t->lvol+84)*606;208208- int right = (t->rvol+84)*606;209209-210210- ctrl->value=max(left,right);211211- return 0;212212- }213213- case V4L2_CID_AUDIO_BALANCE:214214- {215215- int left = (t->lvol+84)*606;216216- int right = (t->rvol+84)*606;217217- int volume = max(left,right);218218- int balance = (32768*min(left,right))/219219- (volume ? volume : 1);220220- ctrl->value=(left<right)?221221- (65535-balance) : balance;222222- return 0;223223- }224224- case V4L2_CID_AUDIO_BASS:225225- ctrl->value = (t->bass+12)*2427; /* min -12 max +15 */226226- return 0;227227- case V4L2_CID_AUDIO_TREBLE:228228- ctrl->value = (t->treble+12)*2730;/* min -12 max +12 */229229- return 0;230230- }231231- return -EINVAL;232232-}233233-234234-static int tda9875_s_ctrl(struct v4l2_subdev *sd, struct v4l2_control *ctrl)235235-{236236- struct tda9875 *t = to_state(sd);237237- int chvol = 0, volume = 0, balance = 0, left, right;238238-239239- switch (ctrl->id) {240240- case V4L2_CID_AUDIO_VOLUME:241241- left = (t->lvol+84)*606;242242- right = (t->rvol+84)*606;243243-244244- volume = max(left,right);245245- balance = (32768*min(left,right))/246246- (volume ? volume : 1);247247- balance =(left<right)?248248- (65535-balance) : balance;249249-250250- volume = ctrl->value;251251-252252- chvol=1;253253- break;254254- case V4L2_CID_AUDIO_BALANCE:255255- left = (t->lvol+84)*606;256256- right = (t->rvol+84)*606;257257-258258- volume=max(left,right);259259-260260- balance = ctrl->value;261261-262262- chvol=1;263263- break;264264- case V4L2_CID_AUDIO_BASS:265265- t->bass = ((ctrl->value/2400)-12) & 0xff;266266- if (t->bass > 15)267267- t->bass = 15;268268- if (t->bass < -12)269269- t->bass = -12 & 0xff;270270- break;271271- case V4L2_CID_AUDIO_TREBLE:272272- t->treble = ((ctrl->value/2700)-12) & 0xff;273273- if (t->treble > 12)274274- t->treble = 12;275275- if (t->treble < -12)276276- t->treble = -12 & 0xff;277277- break;278278- default:279279- return -EINVAL;280280- }281281-282282- if (chvol) {283283- left = (min(65536 - balance,32768) *284284- volume) / 32768;285285- right = (min(balance,32768) *286286- volume) / 32768;287287- t->lvol = ((left/606)-84) & 0xff;288288- if (t->lvol > 24)289289- t->lvol = 24;290290- if (t->lvol < -84)291291- t->lvol = -84 & 0xff;292292-293293- t->rvol = ((right/606)-84) & 0xff;294294- if (t->rvol > 24)295295- t->rvol = 24;296296- if (t->rvol < -84)297297- t->rvol = -84 & 0xff;298298- }299299-300300- tda9875_set(sd);301301- return 0;302302-}303303-304304-static int tda9875_queryctrl(struct v4l2_subdev *sd, struct v4l2_queryctrl *qc)305305-{306306- switch (qc->id) {307307- case V4L2_CID_AUDIO_VOLUME:308308- return v4l2_ctrl_query_fill(qc, 0, 65535, 65535 / 100, 58880);309309- case V4L2_CID_AUDIO_BASS:310310- case V4L2_CID_AUDIO_TREBLE:311311- return v4l2_ctrl_query_fill(qc, 0, 65535, 65535 / 100, 32768);312312- }313313- return -EINVAL;314314-}315315-316316-/* ----------------------------------------------------------------------- */317317-318318-static const struct v4l2_subdev_core_ops tda9875_core_ops = {319319- .queryctrl = tda9875_queryctrl,320320- .g_ctrl = tda9875_g_ctrl,321321- .s_ctrl = tda9875_s_ctrl,322322-};323323-324324-static const struct v4l2_subdev_ops tda9875_ops = {325325- .core = &tda9875_core_ops,326326-};327327-328328-/* ----------------------------------------------------------------------- */329329-330330-331331-/* *********************** *332332- * i2c interface functions *333333- * *********************** */334334-335335-static int tda9875_checkit(struct i2c_client *client, int addr)336336-{337337- int dic, rev;338338-339339- dic = i2c_read_register(client, addr, 254);340340- rev = i2c_read_register(client, addr, 255);341341-342342- if (dic == 0 || dic == 2) { /* tda9875 and tda9875A */343343- v4l_info(client, "tda9875%s rev. %d detected at 0x%02x\n",344344- dic == 0 ? "" : "A", rev, addr << 1);345345- return 1;346346- }347347- v4l_info(client, "no such chip at 0x%02x (dic=0x%x rev=0x%x)\n",348348- addr << 1, dic, rev);349349- return 0;350350-}351351-352352-static int tda9875_probe(struct i2c_client *client,353353- const struct i2c_device_id *id)354354-{355355- struct tda9875 *t;356356- struct v4l2_subdev *sd;357357-358358- v4l_info(client, "chip found @ 0x%02x (%s)\n",359359- client->addr << 1, client->adapter->name);360360-361361- if (!tda9875_checkit(client, client->addr))362362- return -ENODEV;363363-364364- t = kzalloc(sizeof(*t), GFP_KERNEL);365365- if (!t)366366- return -ENOMEM;367367- sd = &t->sd;368368- v4l2_i2c_subdev_init(sd, client, &tda9875_ops);369369-370370- do_tda9875_init(sd);371371- return 0;372372-}373373-374374-static int tda9875_remove(struct i2c_client *client)375375-{376376- struct v4l2_subdev *sd = i2c_get_clientdata(client);377377-378378- do_tda9875_init(sd);379379- v4l2_device_unregister_subdev(sd);380380- kfree(to_state(sd));381381- return 0;382382-}383383-384384-static const struct i2c_device_id tda9875_id[] = {385385- { "tda9875", 0 },386386- { }387387-};388388-MODULE_DEVICE_TABLE(i2c, tda9875_id);389389-390390-static struct i2c_driver tda9875_driver = {391391- .driver = {392392- .owner = THIS_MODULE,393393- .name = "tda9875",394394- },395395- .probe = tda9875_probe,396396- .remove = tda9875_remove,397397- .id_table = tda9875_id,398398-};399399-400400-static __init int init_tda9875(void)401401-{402402- return i2c_add_driver(&tda9875_driver);403403-}404404-405405-static __exit void exit_tda9875(void)406406-{407407- i2c_del_driver(&tda9875_driver);408408-}409409-410410-module_init(init_tda9875);411411-module_exit(exit_tda9875);
+7-6
drivers/media/video/tlg2300/pd-video.c
···512512 int buf_size, gfp_t gfp_flags,513513 usb_complete_t complete_fn, void *context)514514{515515- struct urb *urb;516516- void *mem;517517- int i;515515+ int i = 0;518516519519- for (i = 0; i < num; i++) {520520- urb = usb_alloc_urb(0, gfp_flags);517517+ for (; i < num; i++) {518518+ void *mem;519519+ struct urb *urb = usb_alloc_urb(0, gfp_flags);521520 if (urb == NULL)522521 return i;523522524523 mem = usb_alloc_coherent(udev, buf_size, gfp_flags,525524 &urb->transfer_dma);526526- if (mem == NULL)525525+ if (mem == NULL) {526526+ usb_free_urb(urb);527527 return i;528528+ }528529529530 usb_fill_bulk_urb(urb, udev, usb_rcvbulkpipe(udev, ep_addr),530531 mem, buf_size, complete_fn, context);
+2-17
drivers/media/video/v4l2-common.c
···407407 /* Decrease the module use count to match the first try_module_get. */408408 module_put(client->driver->driver.owner);409409410410- if (sd) {411411- /* We return errors from v4l2_subdev_call only if we have the412412- callback as the .s_config is not mandatory */413413- int err = v4l2_subdev_call(sd, core, s_config,414414- info->irq, info->platform_data);415415-416416- if (err && err != -ENOIOCTLCMD) {417417- v4l2_device_unregister_subdev(sd);418418- sd = NULL;419419- }420420- }421421-422410error:423411 /* If we have a client but no subdev, then something went wrong and424412 we must unregister the client. */···416428}417429EXPORT_SYMBOL_GPL(v4l2_i2c_new_subdev_board);418430419419-struct v4l2_subdev *v4l2_i2c_new_subdev_cfg(struct v4l2_device *v4l2_dev,431431+struct v4l2_subdev *v4l2_i2c_new_subdev(struct v4l2_device *v4l2_dev,420432 struct i2c_adapter *adapter, const char *client_type,421421- int irq, void *platform_data,422433 u8 addr, const unsigned short *probe_addrs)423434{424435 struct i2c_board_info info;···427440 memset(&info, 0, sizeof(info));428441 strlcpy(info.type, client_type, sizeof(info.type));429442 info.addr = addr;430430- info.irq = irq;431431- info.platform_data = platform_data;432443433444 return v4l2_i2c_new_subdev_board(v4l2_dev, adapter, &info, probe_addrs);434445}435435-EXPORT_SYMBOL_GPL(v4l2_i2c_new_subdev_cfg);446446+EXPORT_SYMBOL_GPL(v4l2_i2c_new_subdev);436447437448/* Return i2c client address of v4l2_subdev. */438449unsigned short v4l2_i2c_subdev_addr(struct v4l2_subdev *sd)
+22-12
drivers/media/video/v4l2-ctrls.c
···569569 int ret;570570 u32 size;571571572572- ctrl->has_new = 1;572572+ ctrl->is_new = 1;573573 switch (ctrl->type) {574574 case V4L2_CTRL_TYPE_INTEGER64:575575 ctrl->val64 = c->value64;···12801280 if (ctrl->done)12811281 continue;1282128212831283- for (i = 0; i < master->ncontrols; i++)12841284- cur_to_new(master->cluster[i]);12831283+ for (i = 0; i < master->ncontrols; i++) {12841284+ if (master->cluster[i]) {12851285+ cur_to_new(master->cluster[i]);12861286+ master->cluster[i]->is_new = 1;12871287+ }12881288+ }1285128912861290 /* Skip button controls and read-only controls. */12871291 if (ctrl->type == V4L2_CTRL_TYPE_BUTTON ||···1344134013451341 ctrl = ref->ctrl;13461342 memset(qc, 0, sizeof(*qc));13471347- qc->id = ctrl->id;13431343+ if (id >= V4L2_CID_PRIVATE_BASE)13441344+ qc->id = id;13451345+ else13461346+ qc->id = ctrl->id;13481347 strlcpy(qc->name, ctrl->name, sizeof(qc->name));13491348 qc->minimum = ctrl->minimum;13501349 qc->maximum = ctrl->maximum;13511350 qc->default_value = ctrl->default_value;13521352- if (qc->type == V4L2_CTRL_TYPE_MENU)13511351+ if (ctrl->type == V4L2_CTRL_TYPE_MENU)13531352 qc->step = 1;13541353 else13551354 qc->step = ctrl->step;···16521645 if (ctrl == NULL)16531646 continue;1654164716551655- if (ctrl->has_new) {16481648+ if (ctrl->is_new) {16561649 /* Double check this: it may have changed since the16571650 last check in try_or_set_ext_ctrls(). */16581651 if (set && (ctrl->flags & V4L2_CTRL_FLAG_GRABBED))···1726171917271720 v4l2_ctrl_lock(ctrl);1728172117291729- /* Reset the 'has_new' flags of the cluster */17221722+ /* Reset the 'is_new' flags of the cluster */17301723 for (j = 0; j < master->ncontrols; j++)17311724 if (master->cluster[j])17321732- master->cluster[j]->has_new = 0;17251725+ master->cluster[j]->is_new = 0;1733172617341727 /* Copy the new caller-supplied control values.17351735- user_to_new() sets 'has_new' to 1. */17281728+ user_to_new() sets 'is_new' to 1. */17361729 ret = cluster_walk(i, cs, helpers, user_to_new);1737173017381731 if (!ret)···18271820 int ret;18281821 int i;1829182218231823+ if (ctrl->flags & V4L2_CTRL_FLAG_READ_ONLY)18241824+ return -EACCES;18251825+18301826 v4l2_ctrl_lock(ctrl);1831182718321832- /* Reset the 'has_new' flags of the cluster */18281828+ /* Reset the 'is_new' flags of the cluster */18331829 for (i = 0; i < master->ncontrols; i++)18341830 if (master->cluster[i])18351835- master->cluster[i]->has_new = 0;18311831+ master->cluster[i]->is_new = 0;1836183218371833 ctrl->val = *val;18381838- ctrl->has_new = 1;18341834+ ctrl->is_new = 1;18391835 ret = try_or_set_control_cluster(master, false);18401836 if (!ret)18411837 ret = try_or_set_control_cluster(master, true);
+4-5
drivers/media/video/v4l2-dev.c
···419419 * The registration code assigns minor numbers and device node numbers420420 * based on the requested type and registers the new device node with421421 * the kernel.422422+ *423423+ * This function assumes that struct video_device was zeroed when it424424+ * was allocated and does not contain any stale date.425425+ *422426 * An error is returned if no free minor or device node number could be423427 * found, or if the registration of the device node failed.424428 *···444440 int minor_offset = 0;445441 int minor_cnt = VIDEO_NUM_DEVICES;446442 const char *name_base;447447- void *priv = vdev->dev.p;448443449444 /* A minor value of -1 marks this video device as never450445 having been registered */···562559 }563560564561 /* Part 4: register the device with sysfs */565565- memset(&vdev->dev, 0, sizeof(vdev->dev));566566- /* The memset above cleared the device's device_private, so567567- put back the copy we made earlier. */568568- vdev->dev.p = priv;569562 vdev->dev.class = &video_class;570563 vdev->dev.devt = MKDEV(VIDEO_MAJOR, vdev->minor);571564 if (vdev->parent)
+14-2
drivers/media/video/v4l2-device.c
···100100 is a platform bus, then it is never deleted. */101101 if (client)102102 i2c_unregister_device(client);103103+ continue;103104 }104105#endif105106#if defined(CONFIG_SPI)···109108110109 if (spi)111110 spi_unregister_device(spi);111111+ continue;112112 }113113#endif114114 }···128126 WARN_ON(sd->v4l2_dev != NULL);129127 if (!try_module_get(sd->owner))130128 return -ENODEV;129129+ sd->v4l2_dev = v4l2_dev;130130+ if (sd->internal_ops && sd->internal_ops->registered) {131131+ err = sd->internal_ops->registered(sd);132132+ if (err)133133+ return err;134134+ }131135 /* This just returns 0 if either of the two args is NULL */132136 err = v4l2_ctrl_add_handler(v4l2_dev->ctrl_handler, sd->ctrl_handler);133133- if (err)137137+ if (err) {138138+ if (sd->internal_ops && sd->internal_ops->unregistered)139139+ sd->internal_ops->unregistered(sd);134140 return err;135135- sd->v4l2_dev = v4l2_dev;141141+ }136142 spin_lock(&v4l2_dev->lock);137143 list_add_tail(&sd->list, &v4l2_dev->subdevs);138144 spin_unlock(&v4l2_dev->lock);···156146 spin_lock(&sd->v4l2_dev->lock);157147 list_del(&sd->list);158148 spin_unlock(&sd->v4l2_dev->lock);149149+ if (sd->internal_ops && sd->internal_ops->unregistered)150150+ sd->internal_ops->unregistered(sd);159151 sd->v4l2_dev = NULL;160152 module_put(sd->owner);161153}
+12-8
drivers/media/video/v4l2-ioctl.c
···16591659 {16601660 struct v4l2_dbg_register *p = arg;1661166116621662- if (!capable(CAP_SYS_ADMIN))16631663- ret = -EPERM;16641664- else if (ops->vidioc_g_register)16651665- ret = ops->vidioc_g_register(file, fh, p);16621662+ if (ops->vidioc_g_register) {16631663+ if (!capable(CAP_SYS_ADMIN))16641664+ ret = -EPERM;16651665+ else16661666+ ret = ops->vidioc_g_register(file, fh, p);16671667+ }16661668 break;16671669 }16681670 case VIDIOC_DBG_S_REGISTER:16691671 {16701672 struct v4l2_dbg_register *p = arg;1671167316721672- if (!capable(CAP_SYS_ADMIN))16731673- ret = -EPERM;16741674- else if (ops->vidioc_s_register)16751675- ret = ops->vidioc_s_register(file, fh, p);16741674+ if (ops->vidioc_s_register) {16751675+ if (!capable(CAP_SYS_ADMIN))16761676+ ret = -EPERM;16771677+ else16781678+ ret = ops->vidioc_s_register(file, fh, p);16791679+ }16761680 break;16771681 }16781682#endif
···6868/*6969 * Version numbers7070 */7171-#define VMXNET3_DRIVER_VERSION_STRING "1.0.16.0-k"7171+#define VMXNET3_DRIVER_VERSION_STRING "1.0.25.0-k"72727373/* a 32-bit int, each byte encode a verion number in VMXNET3_DRIVER_VERSION */7474-#define VMXNET3_DRIVER_VERSION_NUM 0x010010007474+#define VMXNET3_DRIVER_VERSION_NUM 0x0100190075757676#if defined(CONFIG_PCI_MSI)7777 /* RSS only makes sense if MSI-X is supported. */···289289290290#define VMXNET3_LINUX_MAX_MSIX_VECT (VMXNET3_DEVICE_MAX_TX_QUEUES + \291291 VMXNET3_DEVICE_MAX_RX_QUEUES + 1)292292-#define VMXNET3_LINUX_MIN_MSIX_VECT 3 /* 1 for each : tx, rx and event */292292+#define VMXNET3_LINUX_MIN_MSIX_VECT 2 /* 1 for tx-rx pair and 1 for event */293293294294295295struct vmxnet3_intr {···317317 struct vmxnet3_rx_queue rx_queue[VMXNET3_DEVICE_MAX_RX_QUEUES];318318 struct vlan_group *vlan_grp;319319 struct vmxnet3_intr intr;320320+ spinlock_t cmd_lock;320321 struct Vmxnet3_DriverShared *shared;321322 struct Vmxnet3_PMConf *pm_conf;322323 struct Vmxnet3_TxQueueDesc *tqd_start; /* all tx queue desc */
+4
drivers/net/wireless/ath/ath5k/base.c
···22942294 int i;22952295 bool needreset = false;2296229622972297+ mutex_lock(&sc->lock);22982298+22972299 for (i = 0; i < ARRAY_SIZE(sc->txqs); i++) {22982300 if (sc->txqs[i].setup) {22992301 txq = &sc->txqs[i];···23222320 "TX queues stuck, resetting\n");23232321 ath5k_reset(sc, NULL, true);23242322 }23232323+23242324+ mutex_unlock(&sc->lock);2325232523262326 ieee80211_queue_delayed_work(sc->hw, &sc->tx_complete_work,23272327 msecs_to_jiffies(ATH5K_TX_COMPLETE_POLL_INT));
+5-5
drivers/net/wireless/ath/ath9k/ar9002_calib.c
···679679680680 /* Do NF cal only at longer intervals */681681 if (longcal || nfcal_pending) {682682- /* Do periodic PAOffset Cal */683683- ar9002_hw_pa_cal(ah, false);684684- ar9002_hw_olc_temp_compensation(ah);685685-686682 /*687683 * Get the value from the previous NF cal and update688684 * history buffer.···693697 ath9k_hw_loadnf(ah, ah->curchan);694698 }695699696696- if (longcal)700700+ if (longcal) {697701 ath9k_hw_start_nfcal(ah, false);702702+ /* Do periodic PAOffset Cal */703703+ ar9002_hw_pa_cal(ah, false);704704+ ar9002_hw_olc_temp_compensation(ah);705705+ }698706 }699707700708 return iscaldone;
···126126 ndev = alloc_netdev_mq(0, "wlan%d", ether_setup, IWM_TX_QUEUES);127127 if (!ndev) {128128 dev_err(dev, "no memory for network device instance\n");129129+ ret = -ENOMEM;129130 goto out_priv;130131 }131132···139138 GFP_KERNEL);140139 if (!iwm->umac_profile) {141140 dev_err(dev, "Couldn't alloc memory for profile\n");141141+ ret = -ENOMEM;142142 goto out_profile;143143 }144144
+1
drivers/net/wireless/rt2x00/rt2x00firmware.c
···58585959 if (!fw || !fw->size || !fw->data) {6060 ERROR(rt2x00dev, "Failed to read Firmware.\n");6161+ release_firmware(fw);6162 return -ENOENT;6263 }6364
+1-1
drivers/pci/pcie/Kconfig
···3131# PCI Express ASPM3232#3333config PCIEASPM3434- bool "PCI Express ASPM control" if EMBEDDED3434+ bool "PCI Express ASPM control" if EXPERT3535 depends on PCI && PCIEPORTBUS3636 default y3737 help
+6-6
drivers/pcmcia/Kconfig
···6969config YENTA7070 tristate "CardBus yenta-compatible bridge support"7171 depends on PCI7272- select CARDBUS if !EMBEDDED7272+ select CARDBUS if !EXPERT7373 select PCCARD_NONSTATIC if PCMCIA != n7474 ---help---7575 This option enables support for CardBus host bridges. Virtually···84848585config YENTA_O28686 default y8787- bool "Special initialization for O2Micro bridges" if EMBEDDED8787+ bool "Special initialization for O2Micro bridges" if EXPERT8888 depends on YENTA89899090config YENTA_RICOH9191 default y9292- bool "Special initialization for Ricoh bridges" if EMBEDDED9292+ bool "Special initialization for Ricoh bridges" if EXPERT9393 depends on YENTA94949595config YENTA_TI9696 default y9797- bool "Special initialization for TI and EnE bridges" if EMBEDDED9797+ bool "Special initialization for TI and EnE bridges" if EXPERT9898 depends on YENTA9999100100config YENTA_ENE_TUNE101101 default y102102- bool "Auto-tune EnE bridges for CB cards" if EMBEDDED102102+ bool "Auto-tune EnE bridges for CB cards" if EXPERT103103 depends on YENTA_TI && CARDBUS104104105105config YENTA_TOSHIBA106106 default y107107- bool "Special initialization for Toshiba ToPIC bridges" if EMBEDDED107107+ bool "Special initialization for Toshiba ToPIC bridges" if EXPERT108108 depends on YENTA109109110110config PD6729
+16-2
drivers/s390/net/qeth_l2_main.c
···831831 return NETDEV_TX_OK;832832}833833834834-static int qeth_l2_open(struct net_device *dev)834834+static int __qeth_l2_open(struct net_device *dev)835835{836836 struct qeth_card *card = dev->ml_priv;837837 int rc = 0;838838839839 QETH_CARD_TEXT(card, 4, "qethopen");840840+ if (card->state == CARD_STATE_UP)841841+ return rc;840842 if (card->state != CARD_STATE_SOFTSETUP)841843 return -ENODEV;842844···857855 } else858856 rc = -EIO;859857 return rc;858858+}859859+860860+static int qeth_l2_open(struct net_device *dev)861861+{862862+ struct qeth_card *card = dev->ml_priv;863863+864864+ QETH_CARD_TEXT(card, 5, "qethope_");865865+ if (qeth_wait_for_threads(card, QETH_RECOVER_THREAD)) {866866+ QETH_CARD_TEXT(card, 3, "openREC");867867+ return -ERESTARTSYS;868868+ }869869+ return __qeth_l2_open(dev);860870}861871862872static int qeth_l2_stop(struct net_device *dev)···10601046 if (recover_flag == CARD_STATE_RECOVER) {10611047 if (recovery_mode &&10621048 card->info.type != QETH_CARD_TYPE_OSN) {10631063- qeth_l2_open(card->dev);10491049+ __qeth_l2_open(card->dev);10641050 } else {10651051 rtnl_lock();10661052 dev_open(card->dev);
+19-3
drivers/s390/net/qeth_l3_main.c
···29982998 */29992999 if (iph->protocol == IPPROTO_UDP)30003000 hdr->hdr.l3.ext_flags |= QETH_HDR_EXT_UDP;30013001- hdr->hdr.l3.ext_flags |= QETH_HDR_EXT_CSUM_TRANSP_REQ;30013001+ hdr->hdr.l3.ext_flags |= QETH_HDR_EXT_CSUM_TRANSP_REQ |30023002+ QETH_HDR_EXT_CSUM_HDR_REQ;30033003+ iph->check = 0;30023004 if (card->options.performance_stats)30033005 card->perf_stats.tx_csum++;30043006}···32423240 return NETDEV_TX_OK;32433241}3244324232453245-static int qeth_l3_open(struct net_device *dev)32433243+static int __qeth_l3_open(struct net_device *dev)32463244{32473245 struct qeth_card *card = dev->ml_priv;32483246 int rc = 0;3249324732503248 QETH_CARD_TEXT(card, 4, "qethopen");32493249+ if (card->state == CARD_STATE_UP)32503250+ return rc;32513251 if (card->state != CARD_STATE_SOFTSETUP)32523252 return -ENODEV;32533253 card->data.state = CH_STATE_UP;···32623258 } else32633259 rc = -EIO;32643260 return rc;32613261+}32623262+32633263+static int qeth_l3_open(struct net_device *dev)32643264+{32653265+ struct qeth_card *card = dev->ml_priv;32663266+32673267+ QETH_CARD_TEXT(card, 5, "qethope_");32683268+ if (qeth_wait_for_threads(card, QETH_RECOVER_THREAD)) {32693269+ QETH_CARD_TEXT(card, 3, "openREC");32703270+ return -ERESTARTSYS;32713271+ }32723272+ return __qeth_l3_open(dev);32653273}3266327432673275static int qeth_l3_stop(struct net_device *dev)···35803564 netif_carrier_off(card->dev);35813565 if (recover_flag == CARD_STATE_RECOVER) {35823566 if (recovery_mode)35833583- qeth_l3_open(card->dev);35673567+ __qeth_l3_open(card->dev);35843568 else {35853569 rtnl_lock();35863570 dev_open(card->dev);
···82828383config SSB_SILENT8484 bool "No SSB kernel messages"8585- depends on SSB && EMBEDDED8585+ depends on SSB && EXPERT8686 help8787 This option turns off all Sonics Silicon Backplane printks.8888 Note that you won't be able to identify problems, once
+30-6
drivers/staging/lirc/TODO.lirc_zilog
···11-The binding between hdpvr and lirc_zilog is currently disabled,11+1. Both ir-kbd-i2c and lirc_zilog provide support for RX events.22+The 'tx_only' lirc_zilog module parameter will allow ir-kbd-i2c33+and lirc_zilog to coexist in the kernel, if the user requires such a set-up.44+However the IR unit will not work well without coordination between the55+two modules. A shared mutex, for transceiver access locking, needs to be66+supplied by bridge drivers, in struct IR_i2_init_data, to both ir-kbd-i2c77+and lirc_zilog, before they will coexist usefully. This should be fixed88+before moving out of staging.99+1010+2. References and locking need careful examination. For cx18 and ivtv PCI1111+cards, which are not easily "hot unplugged", the imperfect state of reference1212+counting and locking is acceptable if not correct. For USB connected units1313+like HD PVR, PVR USB2, HVR-1900, and HVR1950, the likelyhood of an Ooops on1414+unplug is probably great. Proper reference counting and locking needs to be1515+implemented before this module is moved out of staging.1616+1717+3. The binding between hdpvr and lirc_zilog is currently disabled,218due to an OOPS reported a few years ago when both the hdpvr and cx18319drivers were loaded in his system. More details can be seen at:420 http://www.mail-archive.com/linux-media@vger.kernel.org/msg09163.html521More tests need to be done, in order to fix the reported issue.62277-There's a conflict between ir-kbd-i2c: Both provide support for RX events.88-Such conflict needs to be fixed, before moving it out of staging.2323+4. In addition to providing a shared mutex for transceiver access2424+locking, bridge drivers, if able, should provide a chip reset() callback2525+to lirc_zilog via struct IR_i2c_init_data. cx18 and ivtv already have routines2626+to perform Z8 chip resets via GPIO manipulations. This will allow lirc_zilog2727+to bring the chip back to normal when it hangs, in the same places the2828+original lirc_pvr150 driver code does. This is not strictly needed, so it2929+is not required to move lirc_zilog out of staging.9301010-The way I2C probe works, it will try to register the driver twice, one1111-for RX and another for TX. The logic needs to be fixed to avoid such1212-issue.3131+5. Both lirc_zilog and ir-kbd-i2c support the Zilog Z8 for IR, as programmed3232+and installed on Hauppauge products. When working on either module, developers3333+must consider at least the following bridge drivers which mention an IR Rx unit3434+at address 0x71 (indicative of a Z8):3535+3636+ ivtv cx18 hdpvr pvrusb2 bt8xx cx88 saa71341337
···2020 *2121 * parts are cut&pasted from the lirc_i2c.c driver2222 *2323+ * Numerous changes updating lirc_zilog.c in kernel 2.6.38 and later are2424+ * Copyright (C) 2011 Andy Walls <awalls@md.metrocast.net>2525+ *2326 * This program is free software; you can redistribute it and/or modify2427 * it under the terms of the GNU General Public License as published by2528 * the Free Software Foundation; either version 2 of the License, or···6360#include <media/lirc_dev.h>6461#include <media/lirc.h>65626666-struct IR {6767- struct lirc_driver l;6868-6969- /* Device info */7070- struct mutex ir_lock;7171- int open;7272- bool is_hdpvr;7373-6363+struct IR_rx {7464 /* RX device */7575- struct i2c_client c_rx;7676- int have_rx;6565+ struct i2c_client *c;77667867 /* RX device buffer & lock */7968 struct lirc_buffer buf;8069 struct mutex buf_lock;81708271 /* RX polling thread data */8383- struct completion *t_notify;8484- struct completion *t_notify2;8585- int shutdown;8672 struct task_struct *task;87738874 /* RX read data */8975 unsigned char b[3];7676+ bool hdpvr_data_fmt;7777+};90787979+struct IR_tx {9180 /* TX device */9292- struct i2c_client c_tx;8181+ struct i2c_client *c;8282+8383+ /* TX additional actions needed */9384 int need_boot;9494- int have_tx;8585+ bool post_tx_ready_poll;8686+};8787+8888+struct IR {8989+ struct lirc_driver l;9090+9191+ struct mutex ir_lock;9292+ int open;9393+9494+ struct i2c_adapter *adapter;9595+ struct IR_rx *rx;9696+ struct IR_tx *tx;9597};96989799/* Minor -> data mapping */100100+static struct mutex ir_devices_lock;98101static struct IR *ir_devices[MAX_IRCTL_DEVICES];99102100103/* Block size for IR transmitter */···133124#define zilog_notify(s, args...) printk(KERN_NOTICE KBUILD_MODNAME ": " s, \134125 ## args)135126#define zilog_error(s, args...) printk(KERN_ERR KBUILD_MODNAME ": " s, ## args)136136-137137-#define ZILOG_HAUPPAUGE_IR_RX_NAME "Zilog/Hauppauge IR RX"138138-#define ZILOG_HAUPPAUGE_IR_TX_NAME "Zilog/Hauppauge IR TX"127127+#define zilog_info(s, args...) printk(KERN_INFO KBUILD_MODNAME ": " s, ## args)139128140129/* module parameters */141130static int debug; /* debug output */142142-static int disable_rx; /* disable RX device */143143-static int disable_tx; /* disable TX device */131131+static int tx_only; /* only handle the IR Tx function */144132static int minor = -1; /* minor number */145133146134#define dprintk(fmt, args...) \···156150 int ret;157151 int failures = 0;158152 unsigned char sendbuf[1] = { 0 };153153+ struct IR_rx *rx = ir->rx;159154160160- if (lirc_buffer_full(&ir->buf)) {155155+ if (rx == NULL)156156+ return -ENXIO;157157+158158+ if (lirc_buffer_full(&rx->buf)) {161159 dprintk("buffer overflow\n");162160 return -EOVERFLOW;163161 }···171161 * data and we have space172162 */173163 do {164164+ if (kthread_should_stop())165165+ return -ENODATA;166166+174167 /*175168 * Lock i2c bus for the duration. RX/TX chips interfere so176169 * this is worth it177170 */178171 mutex_lock(&ir->ir_lock);179172173173+ if (kthread_should_stop()) {174174+ mutex_unlock(&ir->ir_lock);175175+ return -ENODATA;176176+ }177177+180178 /*181179 * Send random "poll command" (?) Windows driver does this182180 * and it is a good point to detect chip failure.183181 */184184- ret = i2c_master_send(&ir->c_rx, sendbuf, 1);182182+ ret = i2c_master_send(rx->c, sendbuf, 1);185183 if (ret != 1) {186184 zilog_error("i2c_master_send failed with %d\n", ret);187185 if (failures >= 3) {···204186 "trying reset\n");205187206188 set_current_state(TASK_UNINTERRUPTIBLE);189189+ if (kthread_should_stop()) {190190+ mutex_unlock(&ir->ir_lock);191191+ return -ENODATA;192192+ }207193 schedule_timeout((100 * HZ + 999) / 1000);208208- ir->need_boot = 1;194194+ ir->tx->need_boot = 1;209195210196 ++failures;211197 mutex_unlock(&ir->ir_lock);212198 continue;213199 }214200215215- ret = i2c_master_recv(&ir->c_rx, keybuf, sizeof(keybuf));201201+ if (kthread_should_stop()) {202202+ mutex_unlock(&ir->ir_lock);203203+ return -ENODATA;204204+ }205205+ ret = i2c_master_recv(rx->c, keybuf, sizeof(keybuf));216206 mutex_unlock(&ir->ir_lock);217207 if (ret != sizeof(keybuf)) {218208 zilog_error("i2c_master_recv failed with %d -- "219209 "keeping last read buffer\n", ret);220210 } else {221221- ir->b[0] = keybuf[3];222222- ir->b[1] = keybuf[4];223223- ir->b[2] = keybuf[5];224224- dprintk("key (0x%02x/0x%02x)\n", ir->b[0], ir->b[1]);211211+ rx->b[0] = keybuf[3];212212+ rx->b[1] = keybuf[4];213213+ rx->b[2] = keybuf[5];214214+ dprintk("key (0x%02x/0x%02x)\n", rx->b[0], rx->b[1]);225215 }226216227217 /* key pressed ? */228228- if (ir->is_hdpvr) {218218+ if (rx->hdpvr_data_fmt) {229219 if (got_data && (keybuf[0] == 0x80))230220 return 0;231221 else if (got_data && (keybuf[0] == 0x00))232222 return -ENODATA;233233- } else if ((ir->b[0] & 0x80) == 0)223223+ } else if ((rx->b[0] & 0x80) == 0)234224 return got_data ? 0 : -ENODATA;235225236226 /* look what we have */237237- code = (((__u16)ir->b[0] & 0x7f) << 6) | (ir->b[1] >> 2);227227+ code = (((__u16)rx->b[0] & 0x7f) << 6) | (rx->b[1] >> 2);238228239229 codes[0] = (code >> 8) & 0xff;240230 codes[1] = code & 0xff;241231242232 /* return it */243243- lirc_buffer_write(&ir->buf, codes);233233+ lirc_buffer_write(&rx->buf, codes);244234 ++got_data;245245- } while (!lirc_buffer_full(&ir->buf));235235+ } while (!lirc_buffer_full(&rx->buf));246236247237 return 0;248238}···268242static int lirc_thread(void *arg)269243{270244 struct IR *ir = arg;271271-272272- if (ir->t_notify != NULL)273273- complete(ir->t_notify);245245+ struct IR_rx *rx = ir->rx;274246275247 dprintk("poll thread started\n");276248277277- do {278278- if (ir->open) {279279- set_current_state(TASK_INTERRUPTIBLE);249249+ while (!kthread_should_stop()) {250250+ set_current_state(TASK_INTERRUPTIBLE);280251281281- /*282282- * This is ~113*2 + 24 + jitter (2*repeat gap +283283- * code length). We use this interval as the chip284284- * resets every time you poll it (bad!). This is285285- * therefore just sufficient to catch all of the286286- * button presses. It makes the remote much more287287- * responsive. You can see the difference by288288- * running irw and holding down a button. With289289- * 100ms, the old polling interval, you'll notice290290- * breaks in the repeat sequence corresponding to291291- * lost keypresses.292292- */293293- schedule_timeout((260 * HZ) / 1000);294294- if (ir->shutdown)295295- break;296296- if (!add_to_buf(ir))297297- wake_up_interruptible(&ir->buf.wait_poll);298298- } else {299299- /* if device not opened so we can sleep half a second */300300- set_current_state(TASK_INTERRUPTIBLE);252252+ /* if device not opened, we can sleep half a second */253253+ if (!ir->open) {301254 schedule_timeout(HZ/2);255255+ continue;302256 }303303- } while (!ir->shutdown);304257305305- if (ir->t_notify2 != NULL)306306- wait_for_completion(ir->t_notify2);307307-308308- ir->task = NULL;309309- if (ir->t_notify != NULL)310310- complete(ir->t_notify);258258+ /*259259+ * This is ~113*2 + 24 + jitter (2*repeat gap + code length).260260+ * We use this interval as the chip resets every time you poll261261+ * it (bad!). This is therefore just sufficient to catch all262262+ * of the button presses. It makes the remote much more263263+ * responsive. You can see the difference by running irw and264264+ * holding down a button. With 100ms, the old polling265265+ * interval, you'll notice breaks in the repeat sequence266266+ * corresponding to lost keypresses.267267+ */268268+ schedule_timeout((260 * HZ) / 1000);269269+ if (kthread_should_stop())270270+ break;271271+ if (!add_to_buf(ir))272272+ wake_up_interruptible(&rx->buf.wait_poll);273273+ }311274312275 dprintk("poll thread ended\n");313276 return 0;···314299 * this is completely broken code. lirc_unregister_driver()315300 * must be possible even when the device is open316301 */317317- if (ir->c_rx.addr)318318- i2c_use_client(&ir->c_rx);319319- if (ir->c_tx.addr)320320- i2c_use_client(&ir->c_tx);302302+ if (ir->rx != NULL)303303+ i2c_use_client(ir->rx->c);304304+ if (ir->tx != NULL)305305+ i2c_use_client(ir->tx->c);321306322307 return 0;323308}···326311{327312 struct IR *ir = data;328313329329- if (ir->c_rx.addr)330330- i2c_release_client(&ir->c_rx);331331- if (ir->c_tx.addr)332332- i2c_release_client(&ir->c_tx);314314+ if (ir->rx)315315+ i2c_release_client(ir->rx->c);316316+ if (ir->tx)317317+ i2c_release_client(ir->tx->c);333318 if (ir->l.owner != NULL)334319 module_put(ir->l.owner);335320}···468453}469454470455/* send a block of data to the IR TX device */471471-static int send_data_block(struct IR *ir, unsigned char *data_block)456456+static int send_data_block(struct IR_tx *tx, unsigned char *data_block)472457{473458 int i, j, ret;474459 unsigned char buf[5];···482467 buf[1 + j] = data_block[i + j];483468 dprintk("%02x %02x %02x %02x %02x",484469 buf[0], buf[1], buf[2], buf[3], buf[4]);485485- ret = i2c_master_send(&ir->c_tx, buf, tosend + 1);470470+ ret = i2c_master_send(tx->c, buf, tosend + 1);486471 if (ret != tosend + 1) {487472 zilog_error("i2c_master_send failed with %d\n", ret);488473 return ret < 0 ? ret : -EFAULT;···493478}494479495480/* send boot data to the IR TX device */496496-static int send_boot_data(struct IR *ir)481481+static int send_boot_data(struct IR_tx *tx)497482{498483 int ret;499484 unsigned char buf[4];500485501486 /* send the boot block */502502- ret = send_data_block(ir, tx_data->boot_data);487487+ ret = send_data_block(tx, tx_data->boot_data);503488 if (ret != 0)504489 return ret;505490506491 /* kick it off? */507492 buf[0] = 0x00;508493 buf[1] = 0x20;509509- ret = i2c_master_send(&ir->c_tx, buf, 2);494494+ ret = i2c_master_send(tx->c, buf, 2);510495 if (ret != 2) {511496 zilog_error("i2c_master_send failed with %d\n", ret);512497 return ret < 0 ? ret : -EFAULT;513498 }514514- ret = i2c_master_send(&ir->c_tx, buf, 1);499499+ ret = i2c_master_send(tx->c, buf, 1);515500 if (ret != 1) {516501 zilog_error("i2c_master_send failed with %d\n", ret);517502 return ret < 0 ? ret : -EFAULT;518503 }519504520505 /* Here comes the firmware version... (hopefully) */521521- ret = i2c_master_recv(&ir->c_tx, buf, 4);506506+ ret = i2c_master_recv(tx->c, buf, 4);522507 if (ret != 4) {523508 zilog_error("i2c_master_recv failed with %d\n", ret);524509 return 0;···558543}559544560545/* load "firmware" for the IR TX device */561561-static int fw_load(struct IR *ir)546546+static int fw_load(struct IR_tx *tx)562547{563548 int ret;564549 unsigned int i;···573558 }574559575560 /* Request codeset data file */576576- ret = request_firmware(&fw_entry, "haup-ir-blaster.bin", &ir->c_tx.dev);561561+ ret = request_firmware(&fw_entry, "haup-ir-blaster.bin", &tx->c->dev);577562 if (ret != 0) {578563 zilog_error("firmware haup-ir-blaster.bin not available "579564 "(%d)\n", ret);···700685}701686702687/* initialise the IR TX device */703703-static int tx_init(struct IR *ir)688688+static int tx_init(struct IR_tx *tx)704689{705690 int ret;706691707692 /* Load 'firmware' */708708- ret = fw_load(ir);693693+ ret = fw_load(tx);709694 if (ret != 0)710695 return ret;711696712697 /* Send boot block */713713- ret = send_boot_data(ir);698698+ ret = send_boot_data(tx);714699 if (ret != 0)715700 return ret;716716- ir->need_boot = 0;701701+ tx->need_boot = 0;717702718703 /* Looks good */719704 return 0;···729714static ssize_t read(struct file *filep, char *outbuf, size_t n, loff_t *ppos)730715{731716 struct IR *ir = filep->private_data;732732- unsigned char buf[ir->buf.chunk_size];717717+ struct IR_rx *rx = ir->rx;733718 int ret = 0, written = 0;734719 DECLARE_WAITQUEUE(wait, current);735720736721 dprintk("read called\n");737737- if (ir->c_rx.addr == 0)722722+ if (rx == NULL)738723 return -ENODEV;739724740740- if (mutex_lock_interruptible(&ir->buf_lock))725725+ if (mutex_lock_interruptible(&rx->buf_lock))741726 return -ERESTARTSYS;742727743743- if (n % ir->buf.chunk_size) {728728+ if (n % rx->buf.chunk_size) {744729 dprintk("read result = -EINVAL\n");745745- mutex_unlock(&ir->buf_lock);730730+ mutex_unlock(&rx->buf_lock);746731 return -EINVAL;747732 }748733···751736 * to avoid losing scan code (in case when queue is awaken somewhere752737 * between while condition checking and scheduling)753738 */754754- add_wait_queue(&ir->buf.wait_poll, &wait);739739+ add_wait_queue(&rx->buf.wait_poll, &wait);755740 set_current_state(TASK_INTERRUPTIBLE);756741757742 /*···759744 * mode and 'copy_to_user' is happy, wait for data.760745 */761746 while (written < n && ret == 0) {762762- if (lirc_buffer_empty(&ir->buf)) {747747+ if (lirc_buffer_empty(&rx->buf)) {763748 /*764749 * According to the read(2) man page, 'written' can be765750 * returned as less than 'n', instead of blocking···779764 schedule();780765 set_current_state(TASK_INTERRUPTIBLE);781766 } else {782782- lirc_buffer_read(&ir->buf, buf);767767+ unsigned char buf[rx->buf.chunk_size];768768+ lirc_buffer_read(&rx->buf, buf);783769 ret = copy_to_user((void *)outbuf+written, buf,784784- ir->buf.chunk_size);785785- written += ir->buf.chunk_size;770770+ rx->buf.chunk_size);771771+ written += rx->buf.chunk_size;786772 }787773 }788774789789- remove_wait_queue(&ir->buf.wait_poll, &wait);775775+ remove_wait_queue(&rx->buf.wait_poll, &wait);790776 set_current_state(TASK_RUNNING);791791- mutex_unlock(&ir->buf_lock);777777+ mutex_unlock(&rx->buf_lock);792778793779 dprintk("read result = %s (%d)\n",794780 ret ? "-EFAULT" : "OK", ret);···798782}799783800784/* send a keypress to the IR TX device */801801-static int send_code(struct IR *ir, unsigned int code, unsigned int key)785785+static int send_code(struct IR_tx *tx, unsigned int code, unsigned int key)802786{803787 unsigned char data_block[TX_BLOCK_SIZE];804788 unsigned char buf[2];···815799 return ret;816800817801 /* Send the data block */818818- ret = send_data_block(ir, data_block);802802+ ret = send_data_block(tx, data_block);819803 if (ret != 0)820804 return ret;821805822806 /* Send data block length? */823807 buf[0] = 0x00;824808 buf[1] = 0x40;825825- ret = i2c_master_send(&ir->c_tx, buf, 2);809809+ ret = i2c_master_send(tx->c, buf, 2);826810 if (ret != 2) {827811 zilog_error("i2c_master_send failed with %d\n", ret);828812 return ret < 0 ? ret : -EFAULT;829813 }830830- ret = i2c_master_send(&ir->c_tx, buf, 1);814814+ ret = i2c_master_send(tx->c, buf, 1);831815 if (ret != 1) {832816 zilog_error("i2c_master_send failed with %d\n", ret);833817 return ret < 0 ? ret : -EFAULT;834818 }835819836820 /* Send finished download? */837837- ret = i2c_master_recv(&ir->c_tx, buf, 1);821821+ ret = i2c_master_recv(tx->c, buf, 1);838822 if (ret != 1) {839823 zilog_error("i2c_master_recv failed with %d\n", ret);840824 return ret < 0 ? ret : -EFAULT;···848832 /* Send prepare command? */849833 buf[0] = 0x00;850834 buf[1] = 0x80;851851- ret = i2c_master_send(&ir->c_tx, buf, 2);835835+ ret = i2c_master_send(tx->c, buf, 2);852836 if (ret != 2) {853837 zilog_error("i2c_master_send failed with %d\n", ret);854838 return ret < 0 ? ret : -EFAULT;···859843 * last i2c_master_recv always fails with a -5, so for now, we're860844 * going to skip this whole mess and say we're done on the HD PVR861845 */862862- if (ir->is_hdpvr) {846846+ if (!tx->post_tx_ready_poll) {863847 dprintk("sent code %u, key %u\n", code, key);864848 return 0;865849 }···873857 for (i = 0; i < 20; ++i) {874858 set_current_state(TASK_UNINTERRUPTIBLE);875859 schedule_timeout((50 * HZ + 999) / 1000);876876- ret = i2c_master_send(&ir->c_tx, buf, 1);860860+ ret = i2c_master_send(tx->c, buf, 1);877861 if (ret == 1)878862 break;879863 dprintk("NAK expected: i2c_master_send "···886870 }887871888872 /* Seems to be an 'ok' response */889889- i = i2c_master_recv(&ir->c_tx, buf, 1);873873+ i = i2c_master_recv(tx->c, buf, 1);890874 if (i != 1) {891875 zilog_error("i2c_master_recv failed with %d\n", ret);892876 return -EFAULT;···911895 loff_t *ppos)912896{913897 struct IR *ir = filep->private_data;898898+ struct IR_tx *tx = ir->tx;914899 size_t i;915900 int failures = 0;916901917917- if (ir->c_tx.addr == 0)902902+ if (tx == NULL)918903 return -ENODEV;919904920905 /* Validate user parameters */···936919 }937920938921 /* Send boot data first if required */939939- if (ir->need_boot == 1) {940940- ret = send_boot_data(ir);922922+ if (tx->need_boot == 1) {923923+ ret = send_boot_data(tx);941924 if (ret == 0)942942- ir->need_boot = 0;925925+ tx->need_boot = 0;943926 }944927945928 /* Send the code */946929 if (ret == 0) {947947- ret = send_code(ir, (unsigned)command >> 16,930930+ ret = send_code(tx, (unsigned)command >> 16,948931 (unsigned)command & 0xFFFF);949932 if (ret == -EPROTO) {950933 mutex_unlock(&ir->ir_lock);···969952 }970953 set_current_state(TASK_UNINTERRUPTIBLE);971954 schedule_timeout((100 * HZ + 999) / 1000);972972- ir->need_boot = 1;955955+ tx->need_boot = 1;973956 ++failures;974957 } else975958 i += sizeof(int);···986969static unsigned int poll(struct file *filep, poll_table *wait)987970{988971 struct IR *ir = filep->private_data;972972+ struct IR_rx *rx = ir->rx;989973 unsigned int ret;990974991975 dprintk("poll called\n");992992- if (ir->c_rx.addr == 0)976976+ if (rx == NULL)993977 return -ENODEV;994978995995- mutex_lock(&ir->buf_lock);979979+ mutex_lock(&rx->buf_lock);996980997997- poll_wait(filep, &ir->buf.wait_poll, wait);981981+ poll_wait(filep, &rx->buf.wait_poll, wait);998982999983 dprintk("poll result = %s\n",10001000- lirc_buffer_empty(&ir->buf) ? "0" : "POLLIN|POLLRDNORM");984984+ lirc_buffer_empty(&rx->buf) ? "0" : "POLLIN|POLLRDNORM");100198510021002- ret = lirc_buffer_empty(&ir->buf) ? 0 : (POLLIN|POLLRDNORM);986986+ ret = lirc_buffer_empty(&rx->buf) ? 0 : (POLLIN|POLLRDNORM);100398710041004- mutex_unlock(&ir->buf_lock);988988+ mutex_unlock(&rx->buf_lock);1005989 return ret;1006990}1007991···1012994 int result;1013995 unsigned long mode, features = 0;101499610151015- if (ir->c_rx.addr != 0)997997+ features |= LIRC_CAN_SEND_PULSE;998998+ if (ir->rx != NULL)1016999 features |= LIRC_CAN_REC_LIRCCODE;10171017- if (ir->c_tx.addr != 0)10181018- features |= LIRC_CAN_SEND_PULSE;1019100010201001 switch (cmd) {10211002 case LIRC_GET_LENGTH:···10411024 result = -EINVAL;10421025 break;10431026 case LIRC_GET_SEND_MODE:10441044- if (!(features&LIRC_CAN_SEND_MASK))10451045- return -ENOSYS;10461046-10471027 result = put_user(LIRC_MODE_PULSE, (unsigned long *) arg);10481028 break;10491029 case LIRC_SET_SEND_MODE:10501050- if (!(features&LIRC_CAN_SEND_MASK))10511051- return -ENOSYS;10521052-10531030 result = get_user(mode, (unsigned long *) arg);10541031 if (!result && mode != LIRC_MODE_PULSE)10551032 return -EINVAL;···10541043 return result;10551044}1056104510461046+/* ir_devices_lock must be held */10471047+static struct IR *find_ir_device_by_minor(unsigned int minor)10481048+{10491049+ if (minor >= MAX_IRCTL_DEVICES)10501050+ return NULL;10511051+10521052+ return ir_devices[minor];10531053+}10541054+10571055/*10581056 * Open the IR device. Get hold of our IR structure and10591057 * stash it in private_data for the file···10711051{10721052 struct IR *ir;10731053 int ret;10541054+ unsigned int minor = MINOR(node->i_rdev);1074105510751056 /* find our IR struct */10761076- unsigned minor = MINOR(node->i_rdev);10771077- if (minor >= MAX_IRCTL_DEVICES) {10781078- dprintk("minor %d: open result = -ENODEV\n",10791079- minor);10571057+ mutex_lock(&ir_devices_lock);10581058+ ir = find_ir_device_by_minor(minor);10591059+ mutex_unlock(&ir_devices_lock);10601060+10611061+ if (ir == NULL)10801062 return -ENODEV;10811081- }10821082- ir = ir_devices[minor];1083106310841064 /* increment in use count */10851065 mutex_lock(&ir->ir_lock);···1126110611271107static int ir_remove(struct i2c_client *client);11281108static int ir_probe(struct i2c_client *client, const struct i2c_device_id *id);11291129-static int ir_command(struct i2c_client *client, unsigned int cmd, void *arg);1130110911311110#define ID_FLAG_TX 0x0111321111#define ID_FLAG_HDPVR 0x02···11451126 },11461127 .probe = ir_probe,11471128 .remove = ir_remove,11481148- .command = ir_command,11491129 .id_table = ir_transceiver_id,11501130};11511131···11621144 .release = close11631145};1164114611471147+static void destroy_rx_kthread(struct IR_rx *rx)11481148+{11491149+ /* end up polling thread */11501150+ if (rx != NULL && !IS_ERR_OR_NULL(rx->task)) {11511151+ kthread_stop(rx->task);11521152+ rx->task = NULL;11531153+ }11541154+}11551155+11561156+/* ir_devices_lock must be held */11571157+static int add_ir_device(struct IR *ir)11581158+{11591159+ int i;11601160+11611161+ for (i = 0; i < MAX_IRCTL_DEVICES; i++)11621162+ if (ir_devices[i] == NULL) {11631163+ ir_devices[i] = ir;11641164+ break;11651165+ }11661166+11671167+ return i == MAX_IRCTL_DEVICES ? -ENOMEM : i;11681168+}11691169+11701170+/* ir_devices_lock must be held */11711171+static void del_ir_device(struct IR *ir)11721172+{11731173+ int i;11741174+11751175+ for (i = 0; i < MAX_IRCTL_DEVICES; i++)11761176+ if (ir_devices[i] == ir) {11771177+ ir_devices[i] = NULL;11781178+ break;11791179+ }11801180+}11811181+11651182static int ir_remove(struct i2c_client *client)11661183{11671184 struct IR *ir = i2c_get_clientdata(client);1168118511691169- mutex_lock(&ir->ir_lock);11861186+ mutex_lock(&ir_devices_lock);1170118711711171- if (ir->have_rx || ir->have_tx) {11721172- DECLARE_COMPLETION(tn);11731173- DECLARE_COMPLETION(tn2);11741174-11751175- /* end up polling thread */11761176- if (ir->task && !IS_ERR(ir->task)) {11771177- ir->t_notify = &tn;11781178- ir->t_notify2 = &tn2;11791179- ir->shutdown = 1;11801180- wake_up_process(ir->task);11811181- complete(&tn2);11821182- wait_for_completion(&tn);11831183- ir->t_notify = NULL;11841184- ir->t_notify2 = NULL;11851185- }11861186-11871187- } else {11881188- mutex_unlock(&ir->ir_lock);11891189- zilog_error("%s: detached from something we didn't "11901190- "attach to\n", __func__);11911191- return -ENODEV;11881188+ if (ir == NULL) {11891189+ /* We destroyed everything when the first client came through */11901190+ mutex_unlock(&ir_devices_lock);11911191+ return 0;11921192 }1193119311941194- /* unregister lirc driver */11951195- if (ir->l.minor >= 0 && ir->l.minor < MAX_IRCTL_DEVICES) {11961196- lirc_unregister_driver(ir->l.minor);11971197- ir_devices[ir->l.minor] = NULL;11941194+ /* Good-bye LIRC */11951195+ lirc_unregister_driver(ir->l.minor);11961196+11971197+ /* Good-bye Rx */11981198+ destroy_rx_kthread(ir->rx);11991199+ if (ir->rx != NULL) {12001200+ if (ir->rx->buf.fifo_initialized)12011201+ lirc_buffer_free(&ir->rx->buf);12021202+ i2c_set_clientdata(ir->rx->c, NULL);12031203+ kfree(ir->rx);11981204 }1199120512001200- /* free memory */12011201- lirc_buffer_free(&ir->buf);12021202- mutex_unlock(&ir->ir_lock);12061206+ /* Good-bye Tx */12071207+ i2c_set_clientdata(ir->tx->c, NULL);12081208+ kfree(ir->tx);12091209+12101210+ /* Good-bye IR */12111211+ del_ir_device(ir);12031212 kfree(ir);1204121312141214+ mutex_unlock(&ir_devices_lock);12051215 return 0;12161216+}12171217+12181218+12191219+/* ir_devices_lock must be held */12201220+static struct IR *find_ir_device_by_adapter(struct i2c_adapter *adapter)12211221+{12221222+ int i;12231223+ struct IR *ir = NULL;12241224+12251225+ for (i = 0; i < MAX_IRCTL_DEVICES; i++)12261226+ if (ir_devices[i] != NULL &&12271227+ ir_devices[i]->adapter == adapter) {12281228+ ir = ir_devices[i];12291229+ break;12301230+ }12311231+12321232+ return ir;12061233}1207123412081235static int ir_probe(struct i2c_client *client, const struct i2c_device_id *id)12091236{12101210- struct IR *ir = NULL;12371237+ struct IR *ir;12111238 struct i2c_adapter *adap = client->adapter;12121212- char buf;12131239 int ret;12141214- int have_rx = 0, have_tx = 0;12401240+ bool tx_probe = false;1215124112161216- dprintk("%s: adapter name (%s) nr %d, i2c_device_id name (%s), "12171217- "client addr=0x%02x\n",12181218- __func__, adap->name, adap->nr, id->name, client->addr);12421242+ dprintk("%s: %s on i2c-%d (%s), client addr=0x%02x\n",12431243+ __func__, id->name, adap->nr, adap->name, client->addr);1219124412201245 /*12211221- * FIXME - This probe function probes both the Tx and Rx12221222- * addresses of the IR microcontroller.12231223- *12241224- * However, the I2C subsystem is passing along one I2C client at a12251225- * time, based on matches to the ir_transceiver_id[] table above.12261226- * The expectation is that each i2c_client address will be probed12271227- * individually by drivers so the I2C subsystem can mark all client12281228- * addresses as claimed or not.12291229- *12301230- * This probe routine causes only one of the client addresses, TX or RX,12311231- * to be claimed. This will cause a problem if the I2C subsystem is12321232- * subsequently triggered to probe unclaimed clients again.12461246+ * The IR receiver is at i2c address 0x71.12471247+ * The IR transmitter is at i2c address 0x70.12331248 */12341234- /*12351235- * The external IR receiver is at i2c address 0x71.12361236- * The IR transmitter is at 0x70.12371237- */12381238- client->addr = 0x70;1239124912401240- if (!disable_tx) {12411241- if (i2c_master_recv(client, &buf, 1) == 1)12421242- have_tx = 1;12431243- dprintk("probe 0x70 @ %s: %s\n",12441244- adap->name, have_tx ? "success" : "failed");12501250+ if (id->driver_data & ID_FLAG_TX)12511251+ tx_probe = true;12521252+ else if (tx_only) /* module option */12531253+ return -ENXIO;12541254+12551255+ zilog_info("probing IR %s on %s (i2c-%d)\n",12561256+ tx_probe ? "Tx" : "Rx", adap->name, adap->nr);12571257+12581258+ mutex_lock(&ir_devices_lock);12591259+12601260+ /* Use a single struct IR instance for both the Rx and Tx functions */12611261+ ir = find_ir_device_by_adapter(adap);12621262+ if (ir == NULL) {12631263+ ir = kzalloc(sizeof(struct IR), GFP_KERNEL);12641264+ if (ir == NULL) {12651265+ ret = -ENOMEM;12661266+ goto out_no_ir;12671267+ }12681268+ /* store for use in ir_probe() again, and open() later on */12691269+ ret = add_ir_device(ir);12701270+ if (ret)12711271+ goto out_free_ir;12721272+12731273+ ir->adapter = adap;12741274+ mutex_init(&ir->ir_lock);12751275+12761276+ /* set lirc_dev stuff */12771277+ memcpy(&ir->l, &lirc_template, sizeof(struct lirc_driver));12781278+ ir->l.minor = minor; /* module option */12791279+ ir->l.code_length = 13;12801280+ ir->l.rbuf = NULL;12811281+ ir->l.fops = &lirc_fops;12821282+ ir->l.data = ir;12831283+ ir->l.dev = &adap->dev;12841284+ ir->l.sample_rate = 0;12451285 }1246128612471247- if (!disable_rx) {12481248- client->addr = 0x71;12491249- if (i2c_master_recv(client, &buf, 1) == 1)12501250- have_rx = 1;12511251- dprintk("probe 0x71 @ %s: %s\n",12521252- adap->name, have_rx ? "success" : "failed");12871287+ if (tx_probe) {12881288+ /* Set up a struct IR_tx instance */12891289+ ir->tx = kzalloc(sizeof(struct IR_tx), GFP_KERNEL);12901290+ if (ir->tx == NULL) {12911291+ ret = -ENOMEM;12921292+ goto out_free_xx;12931293+ }12941294+12951295+ ir->tx->c = client;12961296+ ir->tx->need_boot = 1;12971297+ ir->tx->post_tx_ready_poll =12981298+ (id->driver_data & ID_FLAG_HDPVR) ? false : true;12991299+ } else {13001300+ /* Set up a struct IR_rx instance */13011301+ ir->rx = kzalloc(sizeof(struct IR_rx), GFP_KERNEL);13021302+ if (ir->rx == NULL) {13031303+ ret = -ENOMEM;13041304+ goto out_free_xx;13051305+ }13061306+13071307+ ret = lirc_buffer_init(&ir->rx->buf, 2, BUFLEN / 2);13081308+ if (ret)13091309+ goto out_free_xx;13101310+13111311+ mutex_init(&ir->rx->buf_lock);13121312+ ir->rx->c = client;13131313+ ir->rx->hdpvr_data_fmt =13141314+ (id->driver_data & ID_FLAG_HDPVR) ? true : false;13151315+13161316+ /* set lirc_dev stuff */13171317+ ir->l.rbuf = &ir->rx->buf;12531318 }1254131912551255- if (!(have_rx || have_tx)) {12561256- zilog_error("%s: no devices found\n", adap->name);12571257- goto out_nodev;12581258- }12591259-12601260- printk(KERN_INFO "lirc_zilog: chip found with %s\n",12611261- have_rx && have_tx ? "RX and TX" :12621262- have_rx ? "RX only" : "TX only");12631263-12641264- ir = kzalloc(sizeof(struct IR), GFP_KERNEL);12651265-12661266- if (!ir)12671267- goto out_nomem;12681268-12691269- ret = lirc_buffer_init(&ir->buf, 2, BUFLEN / 2);12701270- if (ret)12711271- goto out_nomem;12721272-12731273- mutex_init(&ir->ir_lock);12741274- mutex_init(&ir->buf_lock);12751275- ir->need_boot = 1;12761276- ir->is_hdpvr = (id->driver_data & ID_FLAG_HDPVR) ? true : false;12771277-12781278- memcpy(&ir->l, &lirc_template, sizeof(struct lirc_driver));12791279- ir->l.minor = -1;12801280-12811281- /* I2C attach to device */12821320 i2c_set_clientdata(client, ir);1283132113221322+ /* Proceed only if we have the required Tx and Rx clients ready to go */13231323+ if (ir->tx == NULL ||13241324+ (ir->rx == NULL && !tx_only)) {13251325+ zilog_info("probe of IR %s on %s (i2c-%d) done. Waiting on "13261326+ "IR %s.\n", tx_probe ? "Tx" : "Rx", adap->name,13271327+ adap->nr, tx_probe ? "Rx" : "Tx");13281328+ goto out_ok;13291329+ }13301330+12841331 /* initialise RX device */12851285- if (have_rx) {12861286- DECLARE_COMPLETION(tn);12871287- memcpy(&ir->c_rx, client, sizeof(struct i2c_client));12881288-12891289- ir->c_rx.addr = 0x71;12901290- strlcpy(ir->c_rx.name, ZILOG_HAUPPAUGE_IR_RX_NAME,12911291- I2C_NAME_SIZE);12921292-13321332+ if (ir->rx != NULL) {12931333 /* try to fire up polling thread */12941294- ir->t_notify = &tn;12951295- ir->task = kthread_run(lirc_thread, ir, "lirc_zilog");12961296- if (IS_ERR(ir->task)) {12971297- ret = PTR_ERR(ir->task);12981298- zilog_error("lirc_register_driver: cannot run "12991299- "poll thread %d\n", ret);13001300- goto err;13341334+ ir->rx->task = kthread_run(lirc_thread, ir,13351335+ "zilog-rx-i2c-%d", adap->nr);13361336+ if (IS_ERR(ir->rx->task)) {13371337+ ret = PTR_ERR(ir->rx->task);13381338+ zilog_error("%s: could not start IR Rx polling thread"13391339+ "\n", __func__);13401340+ goto out_free_xx;13011341 }13021302- wait_for_completion(&tn);13031303- ir->t_notify = NULL;13041304- ir->have_rx = 1;13051342 }13061306-13071307- /* initialise TX device */13081308- if (have_tx) {13091309- memcpy(&ir->c_tx, client, sizeof(struct i2c_client));13101310- ir->c_tx.addr = 0x70;13111311- strlcpy(ir->c_tx.name, ZILOG_HAUPPAUGE_IR_TX_NAME,13121312- I2C_NAME_SIZE);13131313- ir->have_tx = 1;13141314- }13151315-13161316- /* set lirc_dev stuff */13171317- ir->l.code_length = 13;13181318- ir->l.rbuf = &ir->buf;13191319- ir->l.fops = &lirc_fops;13201320- ir->l.data = ir;13211321- ir->l.minor = minor;13221322- ir->l.dev = &adap->dev;13231323- ir->l.sample_rate = 0;1324134313251344 /* register with lirc */13261345 ir->l.minor = lirc_register_driver(&ir->l);13271346 if (ir->l.minor < 0 || ir->l.minor >= MAX_IRCTL_DEVICES) {13281328- zilog_error("ir_attach: \"minor\" must be between 0 and %d "13291329- "(%d)!\n", MAX_IRCTL_DEVICES-1, ir->l.minor);13471347+ zilog_error("%s: \"minor\" must be between 0 and %d (%d)!\n",13481348+ __func__, MAX_IRCTL_DEVICES-1, ir->l.minor);13301349 ret = -EBADRQC;13311331- goto err;13501350+ goto out_free_thread;13321351 }13331333-13341334- /* store this for getting back in open() later on */13351335- ir_devices[ir->l.minor] = ir;1336135213371353 /*13381354 * if we have the tx device, load the 'firmware'. We do this13391355 * after registering with lirc as otherwise hotplug seems to take13401356 * 10s to create the lirc device.13411357 */13421342- if (have_tx) {13431343- /* Special TX init */13441344- ret = tx_init(ir);13451345- if (ret != 0)13461346- goto err;13581358+ ret = tx_init(ir->tx);13591359+ if (ret != 0)13601360+ goto out_unregister;13611361+13621362+ zilog_info("probe of IR %s on %s (i2c-%d) done. IR unit ready.\n",13631363+ tx_probe ? "Tx" : "Rx", adap->name, adap->nr);13641364+out_ok:13651365+ mutex_unlock(&ir_devices_lock);13661366+ return 0;13671367+13681368+out_unregister:13691369+ lirc_unregister_driver(ir->l.minor);13701370+out_free_thread:13711371+ destroy_rx_kthread(ir->rx);13721372+out_free_xx:13731373+ if (ir->rx != NULL) {13741374+ if (ir->rx->buf.fifo_initialized)13751375+ lirc_buffer_free(&ir->rx->buf);13761376+ if (ir->rx->c != NULL)13771377+ i2c_set_clientdata(ir->rx->c, NULL);13781378+ kfree(ir->rx);13471379 }13481348-13491349- return 0;13501350-13511351-err:13521352- /* undo everything, hopefully... */13531353- if (ir->c_rx.addr)13541354- ir_remove(&ir->c_rx);13551355- if (ir->c_tx.addr)13561356- ir_remove(&ir->c_tx);13571357- return ret;13581358-13591359-out_nodev:13601360- zilog_error("no device found\n");13611361- return -ENODEV;13621362-13631363-out_nomem:13641364- zilog_error("memory allocation failure\n");13801380+ if (ir->tx != NULL) {13811381+ if (ir->tx->c != NULL)13821382+ i2c_set_clientdata(ir->tx->c, NULL);13831383+ kfree(ir->tx);13841384+ }13851385+out_free_ir:13861386+ del_ir_device(ir);13651387 kfree(ir);13661366- return -ENOMEM;13671367-}13681368-13691369-static int ir_command(struct i2c_client *client, unsigned int cmd, void *arg)13701370-{13711371- /* nothing */13721372- return 0;13881388+out_no_ir:13891389+ zilog_error("%s: probing IR %s on %s (i2c-%d) failed with %d\n",13901390+ __func__, tx_probe ? "Tx" : "Rx", adap->name, adap->nr,13911391+ ret);13921392+ mutex_unlock(&ir_devices_lock);13931393+ return ret;13731394}1374139513751396static int __init zilog_init(void)···14181361 zilog_notify("Zilog/Hauppauge IR driver initializing\n");1419136214201363 mutex_init(&tx_data_lock);13641364+ mutex_init(&ir_devices_lock);1421136514221366 request_module("firmware_class");14231367···1444138614451387MODULE_DESCRIPTION("Zilog/Hauppauge infrared transmitter driver (i2c stack)");14461388MODULE_AUTHOR("Gerd Knorr, Michal Kochanowicz, Christoph Bartelmus, "14471447- "Ulrich Mueller, Stefan Jahn, Jerome Brock, Mark Weaver");13891389+ "Ulrich Mueller, Stefan Jahn, Jerome Brock, Mark Weaver, "13901390+ "Andy Walls");14481391MODULE_LICENSE("GPL");14491392/* for compat with old name, which isn't all that accurate anymore */14501393MODULE_ALIAS("lirc_pvr150");···14561397module_param(debug, bool, 0644);14571398MODULE_PARM_DESC(debug, "Enable debugging messages");1458139914591459-module_param(disable_rx, bool, 0644);14601460-MODULE_PARM_DESC(disable_rx, "Disable the IR receiver device");14611461-14621462-module_param(disable_tx, bool, 0644);14631463-MODULE_PARM_DESC(disable_tx, "Disable the IR transmitter device");14001400+module_param(tx_only, bool, 0644);14011401+MODULE_PARM_DESC(tx_only, "Only handle the IR transmit function");
···123123124124config USB_OTG_WHITELIST125125 bool "Rely on OTG Targeted Peripherals List"126126- depends on USB_OTG || EMBEDDED126126+ depends on USB_OTG || EXPERT127127 default y if USB_OTG128128- default n if EMBEDDED128128+ default n if EXPERT129129 help130130 If you say Y here, the "otg_whitelist.h" file will be used as a131131 product whitelist, so USB peripherals not listed there will be···141141142142config USB_OTG_BLACKLIST_HUB143143 bool "Disable external hubs"144144- depends on USB_OTG || EMBEDDED144144+ depends on USB_OTG || EXPERT145145 help146146 If you say Y here, then Linux will refuse to enumerate147147 external hubs. OTG hosts are allowed to reduce hardware
+1-1
drivers/video/Kconfig
···1227122712281228config FB_INTEL12291229 tristate "Intel 830M/845G/852GM/855GM/865G/915G/945G/945GM/965G/965GM support (EXPERIMENTAL)"12301230- depends on EXPERIMENTAL && FB && PCI && X86 && AGP_INTEL && EMBEDDED12301230+ depends on EXPERIMENTAL && FB && PCI && X86 && AGP_INTEL && EXPERT12311231 select FB_MODE_HELPERS12321232 select FB_CFB_FILLRECT12331233 select FB_CFB_COPYAREA
···55menu "Console display driver support"6677config VGA_CONSOLE88- bool "VGA text console" if EMBEDDED || !X8688+ bool "VGA text console" if EXPERT || !X8699 depends on !4xx && !8xx && !SPARC && !M68K && !PARISC && !FRV && !SUPERH && !BLACKFIN && !AVR32 && !MN10300 && (!ARM || ARCH_FOOTBRIDGE || ARCH_INTEGRATOR || ARCH_NETWINDER)1010 default y1111 help
+2-18
drivers/virtio/virtio_pci.c
···96969797MODULE_DEVICE_TABLE(pci, virtio_pci_id_table);98989999-/* A PCI device has it's own struct device and so does a virtio device so100100- * we create a place for the virtio devices to show up in sysfs. I think it101101- * would make more sense for virtio to not insist on having it's own device. */102102-static struct device *virtio_pci_root;103103-10499/* Convert a generic virtio device to our structure */105100static struct virtio_pci_device *to_vp_device(struct virtio_device *vdev)106101{···624629 if (vp_dev == NULL)625630 return -ENOMEM;626631627627- vp_dev->vdev.dev.parent = virtio_pci_root;632632+ vp_dev->vdev.dev.parent = &pci_dev->dev;628633 vp_dev->vdev.dev.release = virtio_pci_release_dev;629634 vp_dev->vdev.config = &virtio_pci_config_ops;630635 vp_dev->pci_dev = pci_dev;···712717713718static int __init virtio_pci_init(void)714719{715715- int err;716716-717717- virtio_pci_root = root_device_register("virtio-pci");718718- if (IS_ERR(virtio_pci_root))719719- return PTR_ERR(virtio_pci_root);720720-721721- err = pci_register_driver(&virtio_pci_driver);722722- if (err)723723- root_device_unregister(virtio_pci_root);724724-725725- return err;720720+ return pci_register_driver(&virtio_pci_driver);726721}727722728723module_init(virtio_pci_init);···720735static void __exit virtio_pci_exit(void)721736{722737 pci_unregister_driver(&virtio_pci_driver);723723- root_device_unregister(virtio_pci_root);724738}725739726740module_exit(virtio_pci_exit);
+13-18
drivers/xen/xenfs/xenbus.c
···122122 int ret;123123124124 mutex_lock(&u->reply_mutex);125125+again:125126 while (list_empty(&u->read_buffers)) {126127 mutex_unlock(&u->reply_mutex);127128 if (filp->f_flags & O_NONBLOCK)···145144 i += sz - ret;146145 rb->cons += sz - ret;147146148148- if (ret != sz) {147147+ if (ret != 0) {149148 if (i == 0)150149 i = -EFAULT;151150 goto out;···161160 struct read_buffer, list);162161 }163162 }163163+ if (i == 0)164164+ goto again;164165165166out:166167 mutex_unlock(&u->reply_mutex);···410407411408 mutex_lock(&u->reply_mutex);412409 rc = queue_reply(&u->read_buffers, &reply, sizeof(reply));410410+ wake_up(&u->read_waitq);413411 mutex_unlock(&u->reply_mutex);414412 }415413···459455460456 ret = copy_from_user(u->u.buffer + u->len, ubuf, len);461457462462- if (ret == len) {458458+ if (ret != 0) {463459 rc = -EFAULT;464460 goto out;465461 }···492488 msg_type = u->u.msg.type;493489494490 switch (msg_type) {495495- case XS_TRANSACTION_START:496496- case XS_TRANSACTION_END:497497- case XS_DIRECTORY:498498- case XS_READ:499499- case XS_GET_PERMS:500500- case XS_RELEASE:501501- case XS_GET_DOMAIN_PATH:502502- case XS_WRITE:503503- case XS_MKDIR:504504- case XS_RM:505505- case XS_SET_PERMS:506506- /* Send out a transaction */507507- ret = xenbus_write_transaction(msg_type, u);508508- break;509509-510491 case XS_WATCH:511492 case XS_UNWATCH:512493 /* (Un)Ask for some path to be watched for changes */···499510 break;500511501512 default:502502- ret = -EINVAL;513513+ /* Send out a transaction */514514+ ret = xenbus_write_transaction(msg_type, u);503515 break;504516 }505517 if (ret != 0)···545555 struct xenbus_file_priv *u = filp->private_data;546556 struct xenbus_transaction_holder *trans, *tmp;547557 struct watch_adapter *watch, *tmp_watch;558558+ struct read_buffer *rb, *tmp_rb;548559549560 /*550561 * No need for locking here because there are no other users,···564573 free_watch_adapter(watch);565574 }566575576576+ list_for_each_entry_safe(rb, tmp_rb, &u->read_buffers, list) {577577+ list_del(&rb->list);578578+ kfree(rb);579579+ }567580 kfree(u);568581569582 return 0;
+1-1
fs/Kconfig
···5050 tristate51515252config FILE_LOCKING5353- bool "Enable POSIX file locking API" if EMBEDDED5353+ bool "Enable POSIX file locking API" if EXPERT5454 default y5555 help5656 This option enables standard file locking support, required
···4444 int charlen, outlen = 0;4545 int maxwords = maxbytes / 2;4646 char tmp[NLS_MAX_CHARSET_SIZE];4747+ __u16 ftmp;47484848- for (i = 0; i < maxwords && from[i]; i++) {4949- charlen = codepage->uni2char(le16_to_cpu(from[i]), tmp,5050- NLS_MAX_CHARSET_SIZE);4949+ for (i = 0; i < maxwords; i++) {5050+ ftmp = get_unaligned_le16(&from[i]);5151+ if (ftmp == 0)5252+ break;5353+5454+ charlen = codepage->uni2char(ftmp, tmp, NLS_MAX_CHARSET_SIZE);5155 if (charlen > 0)5256 outlen += charlen;5357 else···6258}63596460/*6565- * cifs_mapchar - convert a little-endian char to proper char in codepage6161+ * cifs_mapchar - convert a host-endian char to proper char in codepage6662 * @target - where converted character should be copied6767- * @src_char - 2 byte little-endian source character6363+ * @src_char - 2 byte host-endian source character6864 * @cp - codepage to which character should be converted6965 * @mapchar - should character be mapped according to mapchars mount option?7066 *···7369 * enough to hold the result of the conversion (at least NLS_MAX_CHARSET_SIZE).7470 */7571static int7676-cifs_mapchar(char *target, const __le16 src_char, const struct nls_table *cp,7272+cifs_mapchar(char *target, const __u16 src_char, const struct nls_table *cp,7773 bool mapchar)7874{7975 int len = 1;···8682 * build_path_from_dentry are modified, as they use slash as8783 * separator.8884 */8989- switch (le16_to_cpu(src_char)) {8585+ switch (src_char) {9086 case UNI_COLON:9187 *target = ':';9288 break;···113109 return len;114110115111cp_convert:116116- len = cp->uni2char(le16_to_cpu(src_char), target,117117- NLS_MAX_CHARSET_SIZE);112112+ len = cp->uni2char(src_char, target, NLS_MAX_CHARSET_SIZE);118113 if (len <= 0) {119114 *target = '?';120115 len = 1;···152149 int nullsize = nls_nullsize(codepage);153150 int fromwords = fromlen / 2;154151 char tmp[NLS_MAX_CHARSET_SIZE];152152+ __u16 ftmp;155153156154 /*157155 * because the chars can be of varying widths, we need to take care···162158 */163159 safelen = tolen - (NLS_MAX_CHARSET_SIZE + nullsize);164160165165- for (i = 0; i < fromwords && from[i]; i++) {161161+ for (i = 0; i < fromwords; i++) {162162+ ftmp = get_unaligned_le16(&from[i]);163163+ if (ftmp == 0)164164+ break;165165+166166 /*167167 * check to see if converting this character might make the168168 * conversion bleed into the null terminator169169 */170170 if (outlen >= safelen) {171171- charlen = cifs_mapchar(tmp, from[i], codepage, mapchar);171171+ charlen = cifs_mapchar(tmp, ftmp, codepage, mapchar);172172 if ((outlen + charlen) > (tolen - nullsize))173173 break;174174 }175175176176 /* put converted char into 'to' buffer */177177- charlen = cifs_mapchar(&to[outlen], from[i], codepage, mapchar);177177+ charlen = cifs_mapchar(&to[outlen], ftmp, codepage, mapchar);178178 outlen += charlen;179179 }180180···201193{202194 int charlen;203195 int i;204204- wchar_t *wchar_to = (wchar_t *)to; /* needed to quiet sparse */196196+ wchar_t wchar_to; /* needed to quiet sparse */205197206198 for (i = 0; len && *from; i++, from += charlen, len -= charlen) {207207-208208- /* works for 2.4.0 kernel or later */209209- charlen = codepage->char2uni(from, len, &wchar_to[i]);199199+ charlen = codepage->char2uni(from, len, &wchar_to);210200 if (charlen < 1) {211211- cERROR(1, "strtoUCS: char2uni of %d returned %d",212212- (int)*from, charlen);201201+ cERROR(1, "strtoUCS: char2uni of 0x%x returned %d",202202+ *from, charlen);213203 /* A question mark */214214- to[i] = cpu_to_le16(0x003f);204204+ wchar_to = 0x003f;215205 charlen = 1;216216- } else217217- to[i] = cpu_to_le16(wchar_to[i]);218218-206206+ }207207+ put_unaligned_le16(wchar_to, &to[i]);219208 }220209221221- to[i] = 0;210210+ put_unaligned_le16(0, &to[i]);222211 return i;223212}224213···255250 }256251257252 return dst;253253+}254254+255255+/*256256+ * Convert 16 bit Unicode pathname to wire format from string in current code257257+ * page. Conversion may involve remapping up the six characters that are258258+ * only legal in POSIX-like OS (if they are present in the string). Path259259+ * names are little endian 16 bit Unicode on the wire260260+ */261261+int262262+cifsConvertToUCS(__le16 *target, const char *source, int maxlen,263263+ const struct nls_table *cp, int mapChars)264264+{265265+ int i, j, charlen;266266+ int len_remaining = maxlen;267267+ char src_char;268268+ __u16 temp;269269+270270+ if (!mapChars)271271+ return cifs_strtoUCS(target, source, PATH_MAX, cp);272272+273273+ for (i = 0, j = 0; i < maxlen; j++) {274274+ src_char = source[i];275275+ switch (src_char) {276276+ case 0:277277+ put_unaligned_le16(0, &target[j]);278278+ goto ctoUCS_out;279279+ case ':':280280+ temp = UNI_COLON;281281+ break;282282+ case '*':283283+ temp = UNI_ASTERIK;284284+ break;285285+ case '?':286286+ temp = UNI_QUESTION;287287+ break;288288+ case '<':289289+ temp = UNI_LESSTHAN;290290+ break;291291+ case '>':292292+ temp = UNI_GRTRTHAN;293293+ break;294294+ case '|':295295+ temp = UNI_PIPE;296296+ break;297297+ /*298298+ * FIXME: We can not handle remapping backslash (UNI_SLASH)299299+ * until all the calls to build_path_from_dentry are modified,300300+ * as they use backslash as separator.301301+ */302302+ default:303303+ charlen = cp->char2uni(source+i, len_remaining,304304+ &temp);305305+ /*306306+ * if no match, use question mark, which at least in307307+ * some cases serves as wild card308308+ */309309+ if (charlen < 1) {310310+ temp = 0x003f;311311+ charlen = 1;312312+ }313313+ len_remaining -= charlen;314314+ /*315315+ * character may take more than one byte in the source316316+ * string, but will take exactly two bytes in the317317+ * target string318318+ */319319+ i += charlen;320320+ continue;321321+ }322322+ put_unaligned_le16(temp, &target[j]);323323+ i++; /* move to next char in source string */324324+ len_remaining--;325325+ }326326+327327+ctoUCS_out:328328+ return i;258329}259330
+11-2
fs/cifs/cifsacl.c
···4141;424243434444-/* security id for everyone */4444+/* security id for everyone/world system group */4545static const struct cifs_sid sid_everyone = {4646 1, 1, {0, 0, 0, 0, 0, 1}, {0} };4747+/* security id for Authenticated Users system group */4848+static const struct cifs_sid sid_authusers = {4949+ 1, 1, {0, 0, 0, 0, 0, 5}, {11} };4750/* group users */4851static const struct cifs_sid sid_user = {1, 2 , {0, 0, 0, 0, 0, 5}, {} };4952···368365 if (num_aces > 0) {369366 umode_t user_mask = S_IRWXU;370367 umode_t group_mask = S_IRWXG;371371- umode_t other_mask = S_IRWXO;368368+ umode_t other_mask = S_IRWXU | S_IRWXG | S_IRWXO;372369373370 ppace = kmalloc(num_aces * sizeof(struct cifs_ace *),374371 GFP_KERNEL);···393390 ppace[i]->type,394391 &fattr->cf_mode,395392 &other_mask);393393+ if (compare_sids(&(ppace[i]->sid), &sid_authusers))394394+ access_flags_to_mode(ppace[i]->access_req,395395+ ppace[i]->type,396396+ &fattr->cf_mode,397397+ &other_mask);398398+396399397400/* memcpy((void *)(&(cifscred->aces[i])),398401 (void *)ppace[i],
···6161 struct dentry *);6262extern int cifs_revalidate_file(struct file *filp);6363extern int cifs_revalidate_dentry(struct dentry *);6464+extern void cifs_invalidate_mapping(struct inode *inode);6465extern int cifs_getattr(struct vfsmount *, struct dentry *, struct kstat *);6566extern int cifs_setattr(struct dentry *, struct iattr *);6667···7372/* Functions related to files and directories */7473extern const struct file_operations cifs_file_ops;7574extern const struct file_operations cifs_file_direct_ops; /* if directio mnt */7676-extern const struct file_operations cifs_file_nobrl_ops;7777-extern const struct file_operations cifs_file_direct_nobrl_ops; /* no brlocks */7575+extern const struct file_operations cifs_file_strict_ops; /* if strictio mnt */7676+extern const struct file_operations cifs_file_nobrl_ops; /* no brlocks */7777+extern const struct file_operations cifs_file_direct_nobrl_ops;7878+extern const struct file_operations cifs_file_strict_nobrl_ops;7879extern int cifs_open(struct inode *inode, struct file *file);7980extern int cifs_close(struct inode *inode, struct file *file);8081extern int cifs_closedir(struct inode *inode, struct file *file);8182extern ssize_t cifs_user_read(struct file *file, char __user *read_data,8282- size_t read_size, loff_t *poffset);8383+ size_t read_size, loff_t *poffset);8484+extern ssize_t cifs_strict_readv(struct kiocb *iocb, const struct iovec *iov,8585+ unsigned long nr_segs, loff_t pos);8386extern ssize_t cifs_user_write(struct file *file, const char __user *write_data,8487 size_t write_size, loff_t *poffset);8588extern int cifs_lock(struct file *, int, struct file_lock *);8689extern int cifs_fsync(struct file *, int);9090+extern int cifs_strict_fsync(struct file *, int);8791extern int cifs_flush(struct file *, fl_owner_t id);8892extern int cifs_file_mmap(struct file * , struct vm_area_struct *);9393+extern int cifs_file_strict_mmap(struct file * , struct vm_area_struct *);8994extern const struct file_operations cifs_dir_ops;9095extern int cifs_dir_open(struct inode *inode, struct file *file);9196extern int cifs_readdir(struct file *file, void *direntry, filldir_t filldir);···125118extern const struct export_operations cifs_export_ops;126119#endif /* EXPERIMENTAL */127120128128-#define CIFS_VERSION "1.68"121121+#define CIFS_VERSION "1.69"129122#endif /* _CIFSFS_H */
+35-29
fs/cifs/cifsglob.h
···161161 int srv_count; /* reference counter */162162 /* 15 character server name + 0x20 16th byte indicating type = srv */163163 char server_RFC1001_name[RFC1001_NAME_LEN_WITH_NULL];164164+ enum statusEnum tcpStatus; /* what we think the status is */164165 char *hostname; /* hostname portion of UNC string */165166 struct socket *ssocket;166167 struct sockaddr_storage dstaddr;···169168 wait_queue_head_t response_q;170169 wait_queue_head_t request_q; /* if more than maxmpx to srvr must block*/171170 struct list_head pending_mid_q;172172- void *Server_NlsInfo; /* BB - placeholder for future NLS info */173173- unsigned short server_codepage; /* codepage for the server */174174- enum protocolEnum protocolType;175175- char versionMajor;176176- char versionMinor;177177- bool svlocal:1; /* local server or remote */178171 bool noblocksnd; /* use blocking sendmsg */179172 bool noautotune; /* do not autotune send buf sizes */180173 bool tcp_nodelay;181174 atomic_t inFlight; /* number of requests on the wire to server */182182-#ifdef CONFIG_CIFS_STATS2183183- atomic_t inSend; /* requests trying to send */184184- atomic_t num_waiters; /* blocked waiting to get in sendrecv */185185-#endif186186- enum statusEnum tcpStatus; /* what we think the status is */187175 struct mutex srv_mutex;188176 struct task_struct *tsk;189177 char server_GUID[16];190178 char secMode;179179+ bool session_estab; /* mark when very first sess is established */180180+ u16 dialect; /* dialect index that server chose */191181 enum securityEnum secType;192182 unsigned int maxReq; /* Clients should submit no more */193183 /* than maxReq distinct unanswered SMBs to the server when using */···191199 unsigned int max_vcs; /* maximum number of smb sessions, at least192200 those that can be specified uniquely with193201 vcnumbers */194194- char sessid[4]; /* unique token id for this session */195195- /* (returned on Negotiate */196202 int capabilities; /* allow selective disabling of caps by smb sess */197203 int timeAdj; /* Adjust for difference in server time zone in sec */198204 __u16 CurrentMid; /* multiplex id - rotating counter */···200210 __u32 sequence_number; /* for signing, protected by srv_mutex */201211 struct session_key session_key;202212 unsigned long lstrp; /* when we got last response from this server */203203- u16 dialect; /* dialect index that server chose */204213 struct cifs_secmech secmech; /* crypto sec mech functs, descriptors */205214 /* extended security flavors that server supports */215215+ bool sec_ntlmssp; /* supports NTLMSSP */216216+ bool sec_kerberosu2u; /* supports U2U Kerberos */206217 bool sec_kerberos; /* supports plain Kerberos */207218 bool sec_mskerberos; /* supports legacy MS Kerberos */208208- bool sec_kerberosu2u; /* supports U2U Kerberos */209209- bool sec_ntlmssp; /* supports NTLMSSP */210210- bool session_estab; /* mark when very first sess is established */219219+ struct delayed_work echo; /* echo ping workqueue job */211220#ifdef CONFIG_CIFS_FSCACHE212221 struct fscache_cookie *fscache; /* client index cache cookie */222222+#endif223223+#ifdef CONFIG_CIFS_STATS2224224+ atomic_t inSend; /* requests trying to send */225225+ atomic_t num_waiters; /* blocked waiting to get in sendrecv */213226#endif214227};215228···439446 /* BB add in lists for dirty pages i.e. write caching info for oplock */440447 struct list_head openFileList;441448 __u32 cifsAttrs; /* e.g. DOS archive bit, sparse, compressed, system */442442- unsigned long time; /* jiffies of last update/check of inode */443443- bool clientCanCacheRead:1; /* read oplock */444444- bool clientCanCacheAll:1; /* read and writebehind oplock */445445- bool delete_pending:1; /* DELETE_ON_CLOSE is set */446446- bool invalid_mapping:1; /* pagecache is invalid */449449+ bool clientCanCacheRead; /* read oplock */450450+ bool clientCanCacheAll; /* read and writebehind oplock */451451+ bool delete_pending; /* DELETE_ON_CLOSE is set */452452+ bool invalid_mapping; /* pagecache is invalid */453453+ unsigned long time; /* jiffies of last update of inode */447454 u64 server_eof; /* current file size on server */448455 u64 uniqueid; /* server inode number */449456 u64 createtime; /* creation time on server */···501508502509#endif503510511511+struct mid_q_entry;512512+513513+/*514514+ * This is the prototype for the mid callback function. When creating one,515515+ * take special care to avoid deadlocks. Things to bear in mind:516516+ *517517+ * - it will be called by cifsd518518+ * - the GlobalMid_Lock will be held519519+ * - the mid will be removed from the pending_mid_q list520520+ */521521+typedef void (mid_callback_t)(struct mid_q_entry *mid);522522+504523/* one of these for every pending CIFS request to the server */505524struct mid_q_entry {506525 struct list_head qhead; /* mids waiting on reply from this server */···524519 unsigned long when_sent; /* time when smb send finished */525520 unsigned long when_received; /* when demux complete (taken off wire) */526521#endif527527- struct task_struct *tsk; /* task waiting for response */522522+ mid_callback_t *callback; /* call completion callback */523523+ void *callback_data; /* general purpose pointer for callback */528524 struct smb_hdr *resp_buf; /* response buffer */529525 int midState; /* wish this were enum but can not pass to wait_event */530526 __u8 command; /* smb command code */···628622#define CIFS_IOVEC 4 /* array of response buffers */629623630624/* Type of Request to SendReceive2 */631631-#define CIFS_STD_OP 0 /* normal request timeout */632632-#define CIFS_LONG_OP 1 /* long op (up to 45 sec, oplock time) */633633-#define CIFS_VLONG_OP 2 /* sloow op - can take up to 180 seconds */634634-#define CIFS_BLOCKING_OP 4 /* operation can block */635635-#define CIFS_ASYNC_OP 8 /* do not wait for response */636636-#define CIFS_TIMEOUT_MASK 0x00F /* only one of 5 above set in req */625625+#define CIFS_BLOCKING_OP 1 /* operation can block */626626+#define CIFS_ASYNC_OP 2 /* do not wait for response */627627+#define CIFS_TIMEOUT_MASK 0x003 /* only one of above set in req */637628#define CIFS_LOG_ERROR 0x010 /* log NT STATUS if non-zero */638629#define CIFS_LARGE_BUF_OP 0x020 /* large request buffer */639630#define CIFS_NO_RESP 0x040 /* no response buffer required */···792789GLOBAL_EXTERN unsigned int cifs_min_rcv; /* min size of big ntwrk buf pool */793790GLOBAL_EXTERN unsigned int cifs_min_small; /* min size of small buf pool */794791GLOBAL_EXTERN unsigned int cifs_max_pending; /* MAX requests at once to server*/792792+793793+/* reconnect after this many failed echo attempts */794794+GLOBAL_EXTERN unsigned short echo_retries;795795796796void cifs_oplock_break(struct work_struct *work);797797void cifs_oplock_break_get(struct cifsFileInfo *cfile);
+58-4
fs/cifs/cifspdu.h
···2323#define _CIFSPDU_H24242525#include <net/sock.h>2626+#include <asm/unaligned.h>2627#include "smbfsctl.h"27282829#ifdef CONFIG_CIFS_WEAK_PW_HASH···5150#define SMB_COM_SETATTR 0x09 /* trivial response */5251#define SMB_COM_LOCKING_ANDX 0x24 /* trivial response */5352#define SMB_COM_COPY 0x29 /* trivial rsp, fail filename ignrd*/5353+#define SMB_COM_ECHO 0x2B /* echo request */5454#define SMB_COM_OPEN_ANDX 0x2D /* Legacy open for old servers */5555#define SMB_COM_READ_ANDX 0x2E5656#define SMB_COM_WRITE_ANDX 0x2F···427425 __u16 Mid;428426 __u8 WordCount;429427} __attribute__((packed));430430-/* given a pointer to an smb_hdr retrieve the value of byte count */431431-#define BCC(smb_var) (*(__u16 *)((char *)(smb_var) + sizeof(struct smb_hdr) + (2 * (smb_var)->WordCount)))432432-#define BCC_LE(smb_var) (*(__le16 *)((char *)(smb_var) + sizeof(struct smb_hdr) + (2 * (smb_var)->WordCount)))428428+429429+/* given a pointer to an smb_hdr retrieve a char pointer to the byte count */430430+#define BCC(smb_var) ((unsigned char *)(smb_var) + sizeof(struct smb_hdr) + \431431+ (2 * (smb_var)->WordCount))432432+433433/* given a pointer to an smb_hdr retrieve the pointer to the byte area */434434-#define pByteArea(smb_var) ((unsigned char *)(smb_var) + sizeof(struct smb_hdr) + (2 * (smb_var)->WordCount) + 2)434434+#define pByteArea(smb_var) (BCC(smb_var) + 2)435435+436436+/* get the converted ByteCount for a SMB packet and return it */437437+static inline __u16438438+get_bcc(struct smb_hdr *hdr)439439+{440440+ __u16 *bc_ptr = (__u16 *)BCC(hdr);441441+442442+ return get_unaligned(bc_ptr);443443+}444444+445445+/* get the unconverted ByteCount for a SMB packet and return it */446446+static inline __u16447447+get_bcc_le(struct smb_hdr *hdr)448448+{449449+ __le16 *bc_ptr = (__le16 *)BCC(hdr);450450+451451+ return get_unaligned_le16(bc_ptr);452452+}453453+454454+/* set the ByteCount for a SMB packet in host-byte order */455455+static inline void456456+put_bcc(__u16 count, struct smb_hdr *hdr)457457+{458458+ __u16 *bc_ptr = (__u16 *)BCC(hdr);459459+460460+ put_unaligned(count, bc_ptr);461461+}462462+463463+/* set the ByteCount for a SMB packet in little-endian */464464+static inline void465465+put_bcc_le(__u16 count, struct smb_hdr *hdr)466466+{467467+ __le16 *bc_ptr = (__le16 *)BCC(hdr);468468+469469+ put_unaligned_le16(count, bc_ptr);470470+}435471436472/*437473 * Computer Name Length (since Netbios name was length 16 with last byte 0x20)···799759 * ????? ie any type800760 *801761 */762762+763763+typedef struct smb_com_echo_req {764764+ struct smb_hdr hdr;765765+ __le16 EchoCount;766766+ __le16 ByteCount;767767+ char Data[1];768768+} __attribute__((packed)) ECHO_REQ;769769+770770+typedef struct smb_com_echo_rsp {771771+ struct smb_hdr hdr;772772+ __le16 SequenceNumber;773773+ __le16 ByteCount;774774+ char Data[1];775775+} __attribute__((packed)) ECHO_RSP;802776803777typedef struct smb_com_logoff_andx_req {804778 struct smb_hdr hdr; /* wct = 2 */
···331331332332static int validate_t2(struct smb_t2_rsp *pSMB)333333{334334- int rc = -EINVAL;335335- int total_size;336336- char *pBCC;334334+ unsigned int total_size;337335338338- /* check for plausible wct, bcc and t2 data and parm sizes */336336+ /* check for plausible wct */337337+ if (pSMB->hdr.WordCount < 10)338338+ goto vt2_err;339339+339340 /* check for parm and data offset going beyond end of smb */340340- if (pSMB->hdr.WordCount >= 10) {341341- if ((le16_to_cpu(pSMB->t2_rsp.ParameterOffset) <= 1024) &&342342- (le16_to_cpu(pSMB->t2_rsp.DataOffset) <= 1024)) {343343- /* check that bcc is at least as big as parms + data */344344- /* check that bcc is less than negotiated smb buffer */345345- total_size = le16_to_cpu(pSMB->t2_rsp.ParameterCount);346346- if (total_size < 512) {347347- total_size +=348348- le16_to_cpu(pSMB->t2_rsp.DataCount);349349- /* BCC le converted in SendReceive */350350- pBCC = (pSMB->hdr.WordCount * 2) +351351- sizeof(struct smb_hdr) +352352- (char *)pSMB;353353- if ((total_size <= (*(u16 *)pBCC)) &&354354- (total_size <355355- CIFSMaxBufSize+MAX_CIFS_HDR_SIZE)) {356356- return 0;357357- }358358- }359359- }360360- }341341+ if (get_unaligned_le16(&pSMB->t2_rsp.ParameterOffset) > 1024 ||342342+ get_unaligned_le16(&pSMB->t2_rsp.DataOffset) > 1024)343343+ goto vt2_err;344344+345345+ /* check that bcc is at least as big as parms + data */346346+ /* check that bcc is less than negotiated smb buffer */347347+ total_size = get_unaligned_le16(&pSMB->t2_rsp.ParameterCount);348348+ if (total_size >= 512)349349+ goto vt2_err;350350+351351+ total_size += get_unaligned_le16(&pSMB->t2_rsp.DataCount);352352+ if (total_size > get_bcc(&pSMB->hdr) ||353353+ total_size >= CIFSMaxBufSize + MAX_CIFS_HDR_SIZE)354354+ goto vt2_err;355355+356356+ return 0;357357+vt2_err:361358 cifs_dump_mem("Invalid transact2 SMB: ", (char *)pSMB,362359 sizeof(struct smb_t2_rsp) + 16);363363- return rc;360360+ return -EINVAL;364361}362362+365363int366364CIFSSMBNegotiate(unsigned int xid, struct cifsSesInfo *ses)367365{···450452 server->maxBuf = min((__u32)le16_to_cpu(rsp->MaxBufSize),451453 (__u32)CIFSMaxBufSize + MAX_CIFS_HDR_SIZE);452454 server->max_vcs = le16_to_cpu(rsp->MaxNumberVcs);453453- GETU32(server->sessid) = le32_to_cpu(rsp->SessionKey);454455 /* even though we do not use raw we might as well set this455456 accurately, in case we ever find a need for it */456457 if ((le16_to_cpu(rsp->RawMode) & RAW_ENABLE) == RAW_ENABLE) {···563566 (__u32) CIFSMaxBufSize + MAX_CIFS_HDR_SIZE);564567 server->max_rw = le32_to_cpu(pSMBr->MaxRawSize);565568 cFYI(DBG2, "Max buf = %d", ses->server->maxBuf);566566- GETU32(ses->server->sessid) = le32_to_cpu(pSMBr->SessionKey);567569 server->capabilities = le32_to_cpu(pSMBr->Capabilities);568570 server->timeAdj = (int)(__s16)le16_to_cpu(pSMBr->ServerTimeZone);569571 server->timeAdj *= 60;···698702 closed on server already e.g. due to tcp session crashing */699703 if (rc == -EAGAIN)700704 rc = 0;705705+706706+ return rc;707707+}708708+709709+/*710710+ * This is a no-op for now. We're not really interested in the reply, but711711+ * rather in the fact that the server sent one and that server->lstrp712712+ * gets updated.713713+ *714714+ * FIXME: maybe we should consider checking that the reply matches request?715715+ */716716+static void717717+cifs_echo_callback(struct mid_q_entry *mid)718718+{719719+ struct TCP_Server_Info *server = mid->callback_data;720720+721721+ DeleteMidQEntry(mid);722722+ atomic_dec(&server->inFlight);723723+ wake_up(&server->request_q);724724+}725725+726726+int727727+CIFSSMBEcho(struct TCP_Server_Info *server)728728+{729729+ ECHO_REQ *smb;730730+ int rc = 0;731731+732732+ cFYI(1, "In echo request");733733+734734+ rc = small_smb_init(SMB_COM_ECHO, 0, NULL, (void **)&smb);735735+ if (rc)736736+ return rc;737737+738738+ /* set up echo request */739739+ smb->hdr.Tid = cpu_to_le16(0xffff);740740+ smb->hdr.WordCount = 1;741741+ put_unaligned_le16(1, &smb->EchoCount);742742+ put_bcc_le(1, &smb->hdr);743743+ smb->Data[0] = 'a';744744+ smb->hdr.smb_buf_length += 3;745745+746746+ rc = cifs_call_async(server, (struct smb_hdr *)smb,747747+ cifs_echo_callback, server);748748+ if (rc)749749+ cFYI(1, "Echo request failed: %d", rc);750750+751751+ cifs_small_buf_release(smb);701752702753 return rc;703754}···12361193 pSMB->ByteCount = cpu_to_le16(count);12371194 /* long_op set to 1 to allow for oplock break timeouts */12381195 rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB,12391239- (struct smb_hdr *)pSMBr, &bytes_returned, CIFS_LONG_OP);11961196+ (struct smb_hdr *)pSMBr, &bytes_returned, 0);12401197 cifs_stats_inc(&tcon->num_opens);12411198 if (rc) {12421199 cFYI(1, "Error in Open = %d", rc);···13491306 pSMB->ByteCount = cpu_to_le16(count);13501307 /* long_op set to 1 to allow for oplock break timeouts */13511308 rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB,13521352- (struct smb_hdr *)pSMBr, &bytes_returned, CIFS_LONG_OP);13091309+ (struct smb_hdr *)pSMBr, &bytes_returned, 0);13531310 cifs_stats_inc(&tcon->num_opens);13541311 if (rc) {13551312 cFYI(1, "Error in Open = %d", rc);···14311388 iov[0].iov_base = (char *)pSMB;14321389 iov[0].iov_len = pSMB->hdr.smb_buf_length + 4;14331390 rc = SendReceive2(xid, tcon->ses, iov, 1 /* num iovecs */,14341434- &resp_buf_type, CIFS_STD_OP | CIFS_LOG_ERROR);13911391+ &resp_buf_type, CIFS_LOG_ERROR);14351392 cifs_stats_inc(&tcon->num_reads);14361393 pSMBr = (READ_RSP *)iov[0].iov_base;14371394 if (rc) {···17061663CIFSSMBLock(const int xid, struct cifsTconInfo *tcon,17071664 const __u16 smb_file_id, const __u64 len,17081665 const __u64 offset, const __u32 numUnlock,17091709- const __u32 numLock, const __u8 lockType, const bool waitFlag)16661666+ const __u32 numLock, const __u8 lockType,16671667+ const bool waitFlag, const __u8 oplock_level)17101668{17111669 int rc = 0;17121670 LOCK_REQ *pSMB = NULL;···17351691 pSMB->NumberOfLocks = cpu_to_le16(numLock);17361692 pSMB->NumberOfUnlocks = cpu_to_le16(numUnlock);17371693 pSMB->LockType = lockType;16941694+ pSMB->OplockLevel = oplock_level;17381695 pSMB->AndXCommand = 0xFF; /* none */17391696 pSMB->Fid = smb_file_id; /* netfid stays le */17401697···31323087 iov[0].iov_len = pSMB->hdr.smb_buf_length + 4;3133308831343089 rc = SendReceive2(xid, tcon->ses, iov, 1 /* num iovec */, &buf_type,31353135- CIFS_STD_OP);30903090+ 0);31363091 cifs_stats_inc(&tcon->num_acl_get);31373092 if (rc) {31383093 cFYI(1, "Send error in QuerySecDesc = %d", rc);···56075562 }5608556356095564 /* make sure list_len doesn't go past end of SMB */56105610- end_of_smb = (char *)pByteArea(&pSMBr->hdr) + BCC(&pSMBr->hdr);55655565+ end_of_smb = (char *)pByteArea(&pSMBr->hdr) + get_bcc(&pSMBr->hdr);56115566 if ((char *)ea_response_data + list_len > end_of_smb) {56125567 cFYI(1, "EA list appears to go beyond SMB");56135568 rc = -EIO;
+93-97
fs/cifs/connect.c
···5252#define CIFS_PORT 4455353#define RFC1001_PORT 13954545555+/* SMB echo "timeout" -- FIXME: tunable? */5656+#define SMB_ECHO_INTERVAL (60 * HZ)5757+5558extern void SMBNTencrypt(unsigned char *passwd, unsigned char *c8,5659 unsigned char *p24);5760···155152156153 /* before reconnecting the tcp session, mark the smb session (uid)157154 and the tid bad so they are not used until reconnected */155155+ cFYI(1, "%s: marking sessions and tcons for reconnect", __func__);158156 spin_lock(&cifs_tcp_ses_lock);159157 list_for_each(tmp, &server->smb_ses_list) {160158 ses = list_entry(tmp, struct cifsSesInfo, smb_ses_list);···167163 }168164 }169165 spin_unlock(&cifs_tcp_ses_lock);166166+170167 /* do not want to be sending data on a socket we are freeing */168168+ cFYI(1, "%s: tearing down socket", __func__);171169 mutex_lock(&server->srv_mutex);172170 if (server->ssocket) {173171 cFYI(1, "State: 0x%x Flags: 0x%lx", server->ssocket->state,···186180 kfree(server->session_key.response);187181 server->session_key.response = NULL;188182 server->session_key.len = 0;183183+ server->lstrp = jiffies;184184+ mutex_unlock(&server->srv_mutex);189185186186+ /* mark submitted MIDs for retry and issue callback */187187+ cFYI(1, "%s: issuing mid callbacks", __func__);190188 spin_lock(&GlobalMid_Lock);191191- list_for_each(tmp, &server->pending_mid_q) {192192- mid_entry = list_entry(tmp, struct193193- mid_q_entry,194194- qhead);195195- if (mid_entry->midState == MID_REQUEST_SUBMITTED) {196196- /* Mark other intransit requests as needing197197- retry so we do not immediately mark the198198- session bad again (ie after we reconnect199199- below) as they timeout too */189189+ list_for_each_safe(tmp, tmp2, &server->pending_mid_q) {190190+ mid_entry = list_entry(tmp, struct mid_q_entry, qhead);191191+ if (mid_entry->midState == MID_REQUEST_SUBMITTED)200192 mid_entry->midState = MID_RETRY_NEEDED;201201- }193193+ list_del_init(&mid_entry->qhead);194194+ mid_entry->callback(mid_entry);202195 }203196 spin_unlock(&GlobalMid_Lock);204204- mutex_unlock(&server->srv_mutex);205197206198 while ((server->tcpStatus != CifsExiting) &&207199 (server->tcpStatus != CifsGood)) {···216212 if (server->tcpStatus != CifsExiting)217213 server->tcpStatus = CifsGood;218214 spin_unlock(&GlobalMid_Lock);219219- /* atomic_set(&server->inFlight,0);*/220220- wake_up(&server->response_q);221215 }222216 }217217+223218 return rc;224219}225220···232229static int check2ndT2(struct smb_hdr *pSMB, unsigned int maxBufSize)233230{234231 struct smb_t2_rsp *pSMBt;235235- int total_data_size;236236- int data_in_this_rsp;237232 int remaining;233233+ __u16 total_data_size, data_in_this_rsp;238234239235 if (pSMB->Command != SMB_COM_TRANSACTION2)240236 return 0;···247245248246 pSMBt = (struct smb_t2_rsp *)pSMB;249247250250- total_data_size = le16_to_cpu(pSMBt->t2_rsp.TotalDataCount);251251- data_in_this_rsp = le16_to_cpu(pSMBt->t2_rsp.DataCount);248248+ total_data_size = get_unaligned_le16(&pSMBt->t2_rsp.TotalDataCount);249249+ data_in_this_rsp = get_unaligned_le16(&pSMBt->t2_rsp.DataCount);252250253251 remaining = total_data_size - data_in_this_rsp;254252···274272{275273 struct smb_t2_rsp *pSMB2 = (struct smb_t2_rsp *)psecond;276274 struct smb_t2_rsp *pSMBt = (struct smb_t2_rsp *)pTargetSMB;277277- int total_data_size;278278- int total_in_buf;279279- int remaining;280280- int total_in_buf2;281275 char *data_area_of_target;282276 char *data_area_of_buf2;283283- __u16 byte_count;277277+ int remaining;278278+ __u16 byte_count, total_data_size, total_in_buf, total_in_buf2;284279285285- total_data_size = le16_to_cpu(pSMBt->t2_rsp.TotalDataCount);280280+ total_data_size = get_unaligned_le16(&pSMBt->t2_rsp.TotalDataCount);286281287287- if (total_data_size != le16_to_cpu(pSMB2->t2_rsp.TotalDataCount)) {282282+ if (total_data_size !=283283+ get_unaligned_le16(&pSMB2->t2_rsp.TotalDataCount))288284 cFYI(1, "total data size of primary and secondary t2 differ");289289- }290285291291- total_in_buf = le16_to_cpu(pSMBt->t2_rsp.DataCount);286286+ total_in_buf = get_unaligned_le16(&pSMBt->t2_rsp.DataCount);292287293288 remaining = total_data_size - total_in_buf;294289···295296 if (remaining == 0) /* nothing to do, ignore */296297 return 0;297298298298- total_in_buf2 = le16_to_cpu(pSMB2->t2_rsp.DataCount);299299+ total_in_buf2 = get_unaligned_le16(&pSMB2->t2_rsp.DataCount);299300 if (remaining < total_in_buf2) {300301 cFYI(1, "transact2 2nd response contains too much data");301302 }302303303304 /* find end of first SMB data area */304305 data_area_of_target = (char *)&pSMBt->hdr.Protocol +305305- le16_to_cpu(pSMBt->t2_rsp.DataOffset);306306+ get_unaligned_le16(&pSMBt->t2_rsp.DataOffset);306307 /* validate target area */307308308308- data_area_of_buf2 = (char *) &pSMB2->hdr.Protocol +309309- le16_to_cpu(pSMB2->t2_rsp.DataOffset);309309+ data_area_of_buf2 = (char *)&pSMB2->hdr.Protocol +310310+ get_unaligned_le16(&pSMB2->t2_rsp.DataOffset);310311311312 data_area_of_target += total_in_buf;312313313314 /* copy second buffer into end of first buffer */314315 memcpy(data_area_of_target, data_area_of_buf2, total_in_buf2);315316 total_in_buf += total_in_buf2;316316- pSMBt->t2_rsp.DataCount = cpu_to_le16(total_in_buf);317317- byte_count = le16_to_cpu(BCC_LE(pTargetSMB));317317+ put_unaligned_le16(total_in_buf, &pSMBt->t2_rsp.DataCount);318318+ byte_count = get_bcc_le(pTargetSMB);318319 byte_count += total_in_buf2;319319- BCC_LE(pTargetSMB) = cpu_to_le16(byte_count);320320+ put_bcc_le(byte_count, pTargetSMB);320321321322 byte_count = pTargetSMB->smb_buf_length;322323 byte_count += total_in_buf2;···330331 return 0; /* we are done */331332 } else /* more responses to go */332333 return 1;334334+}333335336336+static void337337+cifs_echo_request(struct work_struct *work)338338+{339339+ int rc;340340+ struct TCP_Server_Info *server = container_of(work,341341+ struct TCP_Server_Info, echo.work);342342+343343+ /* no need to ping if we got a response recently */344344+ if (time_before(jiffies, server->lstrp + SMB_ECHO_INTERVAL - HZ))345345+ goto requeue_echo;346346+347347+ rc = CIFSSMBEcho(server);348348+ if (rc)349349+ cFYI(1, "Unable to send echo request to server: %s",350350+ server->hostname);351351+352352+requeue_echo:353353+ queue_delayed_work(system_nrt_wq, &server->echo, SMB_ECHO_INTERVAL);334354}335355336356static int···363345 struct msghdr smb_msg;364346 struct kvec iov;365347 struct socket *csocket = server->ssocket;366366- struct list_head *tmp;367367- struct cifsSesInfo *ses;348348+ struct list_head *tmp, *tmp2;368349 struct task_struct *task_to_wake = NULL;369350 struct mid_q_entry *mid_entry;370351 char temp;···416399 smb_msg.msg_control = NULL;417400 smb_msg.msg_controllen = 0;418401 pdu_length = 4; /* enough to get RFC1001 header */402402+419403incomplete_rcv:404404+ if (echo_retries > 0 &&405405+ time_after(jiffies, server->lstrp +406406+ (echo_retries * SMB_ECHO_INTERVAL))) {407407+ cERROR(1, "Server %s has not responded in %d seconds. "408408+ "Reconnecting...", server->hostname,409409+ (echo_retries * SMB_ECHO_INTERVAL / HZ));410410+ cifs_reconnect(server);411411+ csocket = server->ssocket;412412+ wake_up(&server->response_q);413413+ continue;414414+ }415415+420416 length =421417 kernel_recvmsg(csocket, &smb_msg,422418 &iov, 1, pdu_length, 0 /* BB other flags? */);···589559 continue;590560 }591561562562+ mid_entry = NULL;563563+ server->lstrp = jiffies;592564593593- task_to_wake = NULL;594565 spin_lock(&GlobalMid_Lock);595595- list_for_each(tmp, &server->pending_mid_q) {566566+ list_for_each_safe(tmp, tmp2, &server->pending_mid_q) {596567 mid_entry = list_entry(tmp, struct mid_q_entry, qhead);597568598569 if ((mid_entry->mid == smb_buffer->Mid) &&···634603 mid_entry->resp_buf = smb_buffer;635604 mid_entry->largeBuf = isLargeBuf;636605multi_t2_fnd:637637- task_to_wake = mid_entry->tsk;638606 mid_entry->midState = MID_RESPONSE_RECEIVED;607607+ list_del_init(&mid_entry->qhead);608608+ mid_entry->callback(mid_entry);639609#ifdef CONFIG_CIFS_STATS2640610 mid_entry->when_received = jiffies;641611#endif642642- /* so we do not time out requests to server643643- which is still responding (since server could644644- be busy but not dead) */645645- server->lstrp = jiffies;646612 break;647613 }614614+ mid_entry = NULL;648615 }649616 spin_unlock(&GlobalMid_Lock);650650- if (task_to_wake) {617617+618618+ if (mid_entry != NULL) {651619 /* Was previous buf put in mpx struct for multi-rsp? */652620 if (!isMultiRsp) {653621 /* smb buffer will be freed by user thread */···655625 else656626 smallbuf = NULL;657627 }658658- wake_up_process(task_to_wake);659628 } else if (!is_valid_oplock_break(smb_buffer, server) &&660629 !isMultiRsp) {661630 cERROR(1, "No task to wake, unknown frame received! "662662- "NumMids %d", midCount.counter);631631+ "NumMids %d", atomic_read(&midCount));663632 cifs_dump_mem("Received Data is: ", (char *)smb_buffer,664633 sizeof(struct smb_hdr));665634#ifdef CONFIG_CIFS_DEBUG2···706677 if (smallbuf) /* no sense logging a debug message if NULL */707678 cifs_small_buf_release(smallbuf);708679709709- /*710710- * BB: we shouldn't have to do any of this. It shouldn't be711711- * possible to exit from the thread with active SMB sessions712712- */713713- spin_lock(&cifs_tcp_ses_lock);714714- if (list_empty(&server->pending_mid_q)) {715715- /* loop through server session structures attached to this and716716- mark them dead */717717- list_for_each(tmp, &server->smb_ses_list) {718718- ses = list_entry(tmp, struct cifsSesInfo,719719- smb_ses_list);720720- ses->status = CifsExiting;721721- ses->server = NULL;722722- }723723- spin_unlock(&cifs_tcp_ses_lock);724724- } else {725725- /* although we can not zero the server struct pointer yet,726726- since there are active requests which may depnd on them,727727- mark the corresponding SMB sessions as exiting too */728728- list_for_each(tmp, &server->smb_ses_list) {729729- ses = list_entry(tmp, struct cifsSesInfo,730730- smb_ses_list);731731- ses->status = CifsExiting;732732- }733733-680680+ if (!list_empty(&server->pending_mid_q)) {734681 spin_lock(&GlobalMid_Lock);735735- list_for_each(tmp, &server->pending_mid_q) {736736- mid_entry = list_entry(tmp, struct mid_q_entry, qhead);737737- if (mid_entry->midState == MID_REQUEST_SUBMITTED) {738738- cFYI(1, "Clearing Mid 0x%x - waking up ",682682+ list_for_each_safe(tmp, tmp2, &server->pending_mid_q) {683683+ mid_entry = list_entry(tmp, struct mid_q_entry, qhead);684684+ cFYI(1, "Clearing Mid 0x%x - issuing callback",739685 mid_entry->mid);740740- task_to_wake = mid_entry->tsk;741741- if (task_to_wake)742742- wake_up_process(task_to_wake);743743- }686686+ list_del_init(&mid_entry->qhead);687687+ mid_entry->callback(mid_entry);744688 }745689 spin_unlock(&GlobalMid_Lock);746746- spin_unlock(&cifs_tcp_ses_lock);747690 /* 1/8th of sec is more than enough time for them to exit */748691 msleep(125);749692 }···732731 /* if threads still have not exited they are probably never733732 coming home not much else we can do but free the memory */734733 }735735-736736- /* last chance to mark ses pointers invalid737737- if there are any pointing to this (e.g738738- if a crazy root user tried to kill cifsd739739- kernel thread explicitly this might happen) */740740- /* BB: This shouldn't be necessary, see above */741741- spin_lock(&cifs_tcp_ses_lock);742742- list_for_each(tmp, &server->smb_ses_list) {743743- ses = list_entry(tmp, struct cifsSesInfo, smb_ses_list);744744- ses->server = NULL;745745- }746746- spin_unlock(&cifs_tcp_ses_lock);747734748735 kfree(server->hostname);749736 task_to_wake = xchg(&server->tsk, NULL);···16011612 list_del_init(&server->tcp_ses_list);16021613 spin_unlock(&cifs_tcp_ses_lock);1603161416151615+ cancel_delayed_work_sync(&server->echo);16161616+16041617 spin_lock(&GlobalMid_Lock);16051618 server->tcpStatus = CifsExiting;16061619 spin_unlock(&GlobalMid_Lock);···16921701 volume_info->target_rfc1001_name, RFC1001_NAME_LEN_WITH_NULL);16931702 tcp_ses->session_estab = false;16941703 tcp_ses->sequence_number = 0;17041704+ tcp_ses->lstrp = jiffies;16951705 INIT_LIST_HEAD(&tcp_ses->tcp_ses_list);16961706 INIT_LIST_HEAD(&tcp_ses->smb_ses_list);17071707+ INIT_DELAYED_WORK(&tcp_ses->echo, cifs_echo_request);1697170816981709 /*16991710 * at this point we are the only ones with the pointer···17431750 spin_unlock(&cifs_tcp_ses_lock);1744175117451752 cifs_fscache_get_client_cookie(tcp_ses);17531753+17541754+ /* queue echo request delayed work */17551755+ queue_delayed_work(system_nrt_wq, &tcp_ses->echo, SMB_ECHO_INTERVAL);1746175617471757 return tcp_ses;17481758···29322936 TCONX_RSP *pSMBr;29332937 unsigned char *bcc_ptr;29342938 int rc = 0;29352935- int length, bytes_left;29362936- __u16 count;29392939+ int length;29402940+ __u16 bytes_left, count;2937294129382942 if (ses == NULL)29392943 return -EIO;···29612965 bcc_ptr++; /* skip password */29622966 /* already aligned so no need to do it below */29632967 } else {29642964- pSMB->PasswordLength = cpu_to_le16(CIFS_SESS_KEY_SIZE);29682968+ pSMB->PasswordLength = cpu_to_le16(CIFS_AUTH_RESP_SIZE);29652969 /* BB FIXME add code to fail this if NTLMv2 or Kerberos29662970 specified as required (when that support is added to29672971 the vfs in the future) as only NTLM or the much···29792983#endif /* CIFS_WEAK_PW_HASH */29802984 SMBNTencrypt(tcon->password, ses->server->cryptkey, bcc_ptr);2981298529822982- bcc_ptr += CIFS_SESS_KEY_SIZE;29862986+ bcc_ptr += CIFS_AUTH_RESP_SIZE;29832987 if (ses->capabilities & CAP_UNICODE) {29842988 /* must align unicode strings */29852989 *bcc_ptr = 0; /* null byte password */···30173021 pSMB->ByteCount = cpu_to_le16(count);3018302230193023 rc = SendReceive(xid, ses, smb_buffer, smb_buffer_response, &length,30203020- CIFS_STD_OP);30243024+ 0);3021302530223026 /* above now done in SendReceive */30233027 if ((rc == 0) && (tcon != NULL)) {···30273031 tcon->need_reconnect = false;30283032 tcon->tid = smb_buffer_response->Tid;30293033 bcc_ptr = pByteArea(smb_buffer_response);30303030- bytes_left = BCC(smb_buffer_response);30343034+ bytes_left = get_bcc(smb_buffer_response);30313035 length = strnlen(bcc_ptr, bytes_left - 2);30323036 if (smb_buffer->Flags2 & SMBFLG2_UNICODE)30333037 is_unicode = true;
+185-104
fs/cifs/file.c
···287287 struct inode *inode = cifs_file->dentry->d_inode;288288 struct cifsTconInfo *tcon = tlink_tcon(cifs_file->tlink);289289 struct cifsInodeInfo *cifsi = CIFS_I(inode);290290+ struct cifs_sb_info *cifs_sb = CIFS_SB(inode->i_sb);290291 struct cifsLockInfo *li, *tmp;291292292293 spin_lock(&cifs_file_list_lock);···303302 if (list_empty(&cifsi->openFileList)) {304303 cFYI(1, "closing last open instance for inode %p",305304 cifs_file->dentry->d_inode);305305+306306+ /* in strict cache mode we need invalidate mapping on the last307307+ close because it may cause a error when we open this file308308+ again and get at least level II oplock */309309+ if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_STRICT_IO)310310+ CIFS_I(inode)->invalid_mapping = true;311311+306312 cifs_set_oplock_level(cifsi, 0);307313 }308314 spin_unlock(&cifs_file_list_lock);···734726735727 /* BB we could chain these into one lock request BB */736728 rc = CIFSSMBLock(xid, tcon, netfid, length, pfLock->fl_start,737737- 0, 1, lockType, 0 /* wait flag */ );729729+ 0, 1, lockType, 0 /* wait flag */, 0);738730 if (rc == 0) {739731 rc = CIFSSMBLock(xid, tcon, netfid, length,740732 pfLock->fl_start, 1 /* numUnlock */ ,741733 0 /* numLock */ , lockType,742742- 0 /* wait flag */ );734734+ 0 /* wait flag */, 0);743735 pfLock->fl_type = F_UNLCK;744736 if (rc != 0)745737 cERROR(1, "Error unlocking previously locked "···756748 rc = CIFSSMBLock(xid, tcon, netfid, length,757749 pfLock->fl_start, 0, 1,758750 lockType | LOCKING_ANDX_SHARED_LOCK,759759- 0 /* wait flag */);751751+ 0 /* wait flag */, 0);760752 if (rc == 0) {761753 rc = CIFSSMBLock(xid, tcon, netfid,762754 length, pfLock->fl_start, 1, 0,763755 lockType |764756 LOCKING_ANDX_SHARED_LOCK,765765- 0 /* wait flag */);757757+ 0 /* wait flag */, 0);766758 pfLock->fl_type = F_RDLCK;767759 if (rc != 0)768760 cERROR(1, "Error unlocking "···805797806798 if (numLock) {807799 rc = CIFSSMBLock(xid, tcon, netfid, length,808808- pfLock->fl_start,809809- 0, numLock, lockType, wait_flag);800800+ pfLock->fl_start, 0, numLock, lockType,801801+ wait_flag, 0);810802811803 if (rc == 0) {812804 /* For Windows locks we must store them. */···826818 (pfLock->fl_start + length) >=827819 (li->offset + li->length)) {828820 stored_rc = CIFSSMBLock(xid, tcon,829829- netfid,830830- li->length, li->offset,831831- 1, 0, li->type, false);821821+ netfid, li->length,822822+ li->offset, 1, 0,823823+ li->type, false, 0);832824 if (stored_rc)833825 rc = stored_rc;834826 else {···845837 posix_lock_file_wait(file, pfLock);846838 FreeXid(xid);847839 return rc;848848-}849849-850850-/*851851- * Set the timeout on write requests past EOF. For some servers (Windows)852852- * these calls can be very long.853853- *854854- * If we're writing >10M past the EOF we give a 180s timeout. Anything less855855- * than that gets a 45s timeout. Writes not past EOF get 15s timeouts.856856- * The 10M cutoff is totally arbitrary. A better scheme for this would be857857- * welcome if someone wants to suggest one.858858- *859859- * We may be able to do a better job with this if there were some way to860860- * declare that a file should be sparse.861861- */862862-static int863863-cifs_write_timeout(struct cifsInodeInfo *cifsi, loff_t offset)864864-{865865- if (offset <= cifsi->server_eof)866866- return CIFS_STD_OP;867867- else if (offset > (cifsi->server_eof + (10 * 1024 * 1024)))868868- return CIFS_VLONG_OP;869869- else870870- return CIFS_LONG_OP;871840}872841873842/* update the file size (if needed) after a write */···867882 unsigned int total_written;868883 struct cifs_sb_info *cifs_sb;869884 struct cifsTconInfo *pTcon;870870- int xid, long_op;885885+ int xid;871886 struct cifsFileInfo *open_file;872887 struct cifsInodeInfo *cifsi = CIFS_I(inode);873888···888903889904 xid = GetXid();890905891891- long_op = cifs_write_timeout(cifsi, *poffset);892906 for (total_written = 0; write_size > total_written;893907 total_written += bytes_written) {894908 rc = -EAGAIN;···915931 min_t(const int, cifs_sb->wsize,916932 write_size - total_written),917933 *poffset, &bytes_written,918918- NULL, write_data + total_written, long_op);934934+ NULL, write_data + total_written, 0);919935 }920936 if (rc || (bytes_written == 0)) {921937 if (total_written)···928944 cifs_update_eof(cifsi, *poffset, bytes_written);929945 *poffset += bytes_written;930946 }931931- long_op = CIFS_STD_OP; /* subsequent writes fast -932932- 15 seconds is plenty */933947 }934948935949 cifs_stats_bytes_written(pTcon, total_written);···956974 unsigned int total_written;957975 struct cifs_sb_info *cifs_sb;958976 struct cifsTconInfo *pTcon;959959- int xid, long_op;977977+ int xid;960978 struct dentry *dentry = open_file->dentry;961979 struct cifsInodeInfo *cifsi = CIFS_I(dentry->d_inode);962980···969987970988 xid = GetXid();971989972972- long_op = cifs_write_timeout(cifsi, *poffset);973990 for (total_written = 0; write_size > total_written;974991 total_written += bytes_written) {975992 rc = -EAGAIN;···9981017 rc = CIFSSMBWrite2(xid, pTcon,9991018 open_file->netfid, len,10001019 *poffset, &bytes_written,10011001- iov, 1, long_op);10201020+ iov, 1, 0);10021021 } else10031022 rc = CIFSSMBWrite(xid, pTcon,10041023 open_file->netfid,···10061025 write_size - total_written),10071026 *poffset, &bytes_written,10081027 write_data + total_written,10091009- NULL, long_op);10281028+ NULL, 0);10101029 }10111030 if (rc || (bytes_written == 0)) {10121031 if (total_written)···10191038 cifs_update_eof(cifsi, *poffset, bytes_written);10201039 *poffset += bytes_written;10211040 }10221022- long_op = CIFS_STD_OP; /* subsequent writes fast -10231023- 15 seconds is plenty */10241041 }1025104210261043 cifs_stats_bytes_written(pTcon, total_written);···12181239 struct pagevec pvec;12191240 int rc = 0;12201241 int scanned = 0;12211221- int xid, long_op;12421242+ int xid;1222124312231244 cifs_sb = CIFS_SB(mapping->host->i_sb);12241245···13561377 break;13571378 }13581379 if (n_iov) {13801380+retry_write:13591381 open_file = find_writable_file(CIFS_I(mapping->host),13601382 false);13611383 if (!open_file) {13621384 cERROR(1, "No writable handles for inode");13631385 rc = -EBADF;13641386 } else {13651365- long_op = cifs_write_timeout(cifsi, offset);13661387 rc = CIFSSMBWrite2(xid, tcon, open_file->netfid,13671388 bytes_to_write, offset,13681389 &bytes_written, iov, n_iov,13691369- long_op);13901390+ 0);13701391 cifsFileInfo_put(open_file);13711371- cifs_update_eof(cifsi, offset, bytes_written);13721392 }1373139313741374- if (rc || bytes_written < bytes_to_write) {13751375- cERROR(1, "Write2 ret %d, wrote %d",13761376- rc, bytes_written);13771377- mapping_set_error(mapping, rc);13781378- } else {13941394+ cFYI(1, "Write2 rc=%d, wrote=%u", rc, bytes_written);13951395+13961396+ /*13971397+ * For now, treat a short write as if nothing got13981398+ * written. A zero length write however indicates13991399+ * ENOSPC or EFBIG. We have no way to know which14001400+ * though, so call it ENOSPC for now. EFBIG would14011401+ * get translated to AS_EIO anyway.14021402+ *14031403+ * FIXME: make it take into account the data that did14041404+ * get written14051405+ */14061406+ if (rc == 0) {14071407+ if (bytes_written == 0)14081408+ rc = -ENOSPC;14091409+ else if (bytes_written < bytes_to_write)14101410+ rc = -EAGAIN;14111411+ }14121412+14131413+ /* retry on data-integrity flush */14141414+ if (wbc->sync_mode == WB_SYNC_ALL && rc == -EAGAIN)14151415+ goto retry_write;14161416+14171417+ /* fix the stats and EOF */14181418+ if (bytes_written > 0) {13791419 cifs_stats_bytes_written(tcon, bytes_written);14201420+ cifs_update_eof(cifsi, offset, bytes_written);13801421 }1381142213821423 for (i = 0; i < n_iov; i++) {13831424 page = pvec.pages[first + i];13841384- /* Should we also set page error on13851385- success rc but too little data written? */13861386- /* BB investigate retry logic on temporary13871387- server crash cases and how recovery works13881388- when page marked as error */13891389- if (rc)14251425+ /* on retryable write error, redirty page */14261426+ if (rc == -EAGAIN)14271427+ redirty_page_for_writepage(wbc, page);14281428+ else if (rc != 0)13901429 SetPageError(page);13911430 kunmap(page);13921431 unlock_page(page);13931432 end_page_writeback(page);13941433 page_cache_release(page);13951434 }14351435+14361436+ if (rc != -EAGAIN)14371437+ mapping_set_error(mapping, rc);14381438+ else14391439+ rc = 0;14401440+13961441 if ((wbc->nr_to_write -= n_iov) <= 0)13971442 done = 1;13981443 index = next;···15281525 return rc;15291526}1530152715311531-int cifs_fsync(struct file *file, int datasync)15281528+int cifs_strict_fsync(struct file *file, int datasync)15321529{15331530 int xid;15341531 int rc = 0;15351532 struct cifsTconInfo *tcon;15361533 struct cifsFileInfo *smbfile = file->private_data;15371534 struct inode *inode = file->f_path.dentry->d_inode;15351535+ struct cifs_sb_info *cifs_sb = CIFS_SB(inode->i_sb);1538153615391537 xid = GetXid();1540153815411539 cFYI(1, "Sync file - name: %s datasync: 0x%x",15421540 file->f_path.dentry->d_name.name, datasync);1543154115441544- rc = filemap_write_and_wait(inode->i_mapping);15451545- if (rc == 0) {15461546- struct cifs_sb_info *cifs_sb = CIFS_SB(inode->i_sb);15421542+ if (!CIFS_I(inode)->clientCanCacheRead)15431543+ cifs_invalidate_mapping(inode);1547154415481548- tcon = tlink_tcon(smbfile->tlink);15491549- if (!(cifs_sb->mnt_cifs_flags & CIFS_MOUNT_NOSSYNC))15501550- rc = CIFSSMBFlush(xid, tcon, smbfile->netfid);15511551- }15451545+ tcon = tlink_tcon(smbfile->tlink);15461546+ if (!(cifs_sb->mnt_cifs_flags & CIFS_MOUNT_NOSSYNC))15471547+ rc = CIFSSMBFlush(xid, tcon, smbfile->netfid);15481548+15491549+ FreeXid(xid);15501550+ return rc;15511551+}15521552+15531553+int cifs_fsync(struct file *file, int datasync)15541554+{15551555+ int xid;15561556+ int rc = 0;15571557+ struct cifsTconInfo *tcon;15581558+ struct cifsFileInfo *smbfile = file->private_data;15591559+ struct cifs_sb_info *cifs_sb = CIFS_SB(file->f_path.dentry->d_sb);15601560+15611561+ xid = GetXid();15621562+15631563+ cFYI(1, "Sync file - name: %s datasync: 0x%x",15641564+ file->f_path.dentry->d_name.name, datasync);15651565+15661566+ tcon = tlink_tcon(smbfile->tlink);15671567+ if (!(cifs_sb->mnt_cifs_flags & CIFS_MOUNT_NOSSYNC))15681568+ rc = CIFSSMBFlush(xid, tcon, smbfile->netfid);1552156915531570 FreeXid(xid);15541571 return rc;···16191596 return rc;16201597}1621159816221622-ssize_t cifs_user_read(struct file *file, char __user *read_data,16231623- size_t read_size, loff_t *poffset)15991599+static ssize_t16001600+cifs_iovec_read(struct file *file, const struct iovec *iov,16011601+ unsigned long nr_segs, loff_t *poffset)16241602{16251625- int rc = -EACCES;16261626- unsigned int bytes_read = 0;16271627- unsigned int total_read = 0;16281628- unsigned int current_read_size;16031603+ int rc;16041604+ int xid;16051605+ unsigned int total_read, bytes_read = 0;16061606+ size_t len, cur_len;16071607+ int iov_offset = 0;16291608 struct cifs_sb_info *cifs_sb;16301609 struct cifsTconInfo *pTcon;16311631- int xid;16321610 struct cifsFileInfo *open_file;16331633- char *smb_read_data;16341634- char __user *current_offset;16351611 struct smb_com_read_rsp *pSMBr;16121612+ char *read_data;16131613+16141614+ if (!nr_segs)16151615+ return 0;16161616+16171617+ len = iov_length(iov, nr_segs);16181618+ if (!len)16191619+ return 0;1636162016371621 xid = GetXid();16381622 cifs_sb = CIFS_SB(file->f_path.dentry->d_sb);1639162316401640- if (file->private_data == NULL) {16411641- rc = -EBADF;16421642- FreeXid(xid);16431643- return rc;16441644- }16451624 open_file = file->private_data;16461625 pTcon = tlink_tcon(open_file->tlink);1647162616481627 if ((file->f_flags & O_ACCMODE) == O_WRONLY)16491628 cFYI(1, "attempting read on write only file instance");1650162916511651- for (total_read = 0, current_offset = read_data;16521652- read_size > total_read;16531653- total_read += bytes_read, current_offset += bytes_read) {16541654- current_read_size = min_t(const int, read_size - total_read,16551655- cifs_sb->rsize);16301630+ for (total_read = 0; total_read < len; total_read += bytes_read) {16311631+ cur_len = min_t(const size_t, len - total_read, cifs_sb->rsize);16561632 rc = -EAGAIN;16571657- smb_read_data = NULL;16331633+ read_data = NULL;16341634+16581635 while (rc == -EAGAIN) {16591636 int buf_type = CIFS_NO_BUFFER;16601637 if (open_file->invalidHandle) {···16621639 if (rc != 0)16631640 break;16641641 }16651665- rc = CIFSSMBRead(xid, pTcon,16661666- open_file->netfid,16671667- current_read_size, *poffset,16681668- &bytes_read, &smb_read_data,16691669- &buf_type);16701670- pSMBr = (struct smb_com_read_rsp *)smb_read_data;16711671- if (smb_read_data) {16721672- if (copy_to_user(current_offset,16731673- smb_read_data +16741674- 4 /* RFC1001 length field */ +16751675- le16_to_cpu(pSMBr->DataOffset),16761676- bytes_read))16421642+ rc = CIFSSMBRead(xid, pTcon, open_file->netfid,16431643+ cur_len, *poffset, &bytes_read,16441644+ &read_data, &buf_type);16451645+ pSMBr = (struct smb_com_read_rsp *)read_data;16461646+ if (read_data) {16471647+ char *data_offset = read_data + 4 +16481648+ le16_to_cpu(pSMBr->DataOffset);16491649+ if (memcpy_toiovecend(iov, data_offset,16501650+ iov_offset, bytes_read))16771651 rc = -EFAULT;16781678-16791652 if (buf_type == CIFS_SMALL_BUFFER)16801680- cifs_small_buf_release(smb_read_data);16531653+ cifs_small_buf_release(read_data);16811654 else if (buf_type == CIFS_LARGE_BUFFER)16821682- cifs_buf_release(smb_read_data);16831683- smb_read_data = NULL;16551655+ cifs_buf_release(read_data);16561656+ read_data = NULL;16571657+ iov_offset += bytes_read;16841658 }16851659 }16601660+16861661 if (rc || (bytes_read == 0)) {16871662 if (total_read) {16881663 break;···16931672 *poffset += bytes_read;16941673 }16951674 }16751675+16961676 FreeXid(xid);16971677 return total_read;16981678}1699167916801680+ssize_t cifs_user_read(struct file *file, char __user *read_data,16811681+ size_t read_size, loff_t *poffset)16821682+{16831683+ struct iovec iov;16841684+ iov.iov_base = read_data;16851685+ iov.iov_len = read_size;16861686+16871687+ return cifs_iovec_read(file, &iov, 1, poffset);16881688+}16891689+16901690+static ssize_t cifs_user_readv(struct kiocb *iocb, const struct iovec *iov,16911691+ unsigned long nr_segs, loff_t pos)16921692+{16931693+ ssize_t read;16941694+16951695+ read = cifs_iovec_read(iocb->ki_filp, iov, nr_segs, &pos);16961696+ if (read > 0)16971697+ iocb->ki_pos = pos;16981698+16991699+ return read;17001700+}17011701+17021702+ssize_t cifs_strict_readv(struct kiocb *iocb, const struct iovec *iov,17031703+ unsigned long nr_segs, loff_t pos)17041704+{17051705+ struct inode *inode;17061706+17071707+ inode = iocb->ki_filp->f_path.dentry->d_inode;17081708+17091709+ if (CIFS_I(inode)->clientCanCacheRead)17101710+ return generic_file_aio_read(iocb, iov, nr_segs, pos);17111711+17121712+ /*17131713+ * In strict cache mode we need to read from the server all the time17141714+ * if we don't have level II oplock because the server can delay mtime17151715+ * change - so we can't make a decision about inode invalidating.17161716+ * And we can also fail with pagereading if there are mandatory locks17171717+ * on pages affected by this read but not on the region from pos to17181718+ * pos+len-1.17191719+ */17201720+17211721+ return cifs_user_readv(iocb, iov, nr_segs, pos);17221722+}1700172317011724static ssize_t cifs_read(struct file *file, char *read_data, size_t read_size,17021702- loff_t *poffset)17251725+ loff_t *poffset)17031726{17041727 int rc = -EACCES;17051728 unsigned int bytes_read = 0;···18091744 }18101745 FreeXid(xid);18111746 return total_read;17471747+}17481748+17491749+int cifs_file_strict_mmap(struct file *file, struct vm_area_struct *vma)17501750+{17511751+ int rc, xid;17521752+ struct inode *inode = file->f_path.dentry->d_inode;17531753+17541754+ xid = GetXid();17551755+17561756+ if (!CIFS_I(inode)->clientCanCacheRead)17571757+ cifs_invalidate_mapping(inode);17581758+17591759+ rc = generic_file_mmap(file, vma);17601760+ FreeXid(xid);17611761+ return rc;18121762}1813176318141764int cifs_file_mmap(struct file *file, struct vm_area_struct *vma)···22722192 */22732193 if (!cfile->oplock_break_cancelled) {22742194 rc = CIFSSMBLock(0, tlink_tcon(cfile->tlink), cfile->netfid, 0,22752275- 0, 0, 0, LOCKING_ANDX_OPLOCK_RELEASE, false);21952195+ 0, 0, 0, LOCKING_ANDX_OPLOCK_RELEASE, false,21962196+ cinode->clientCanCacheRead ? 1 : 0);22762197 cFYI(1, "Oplock release rc = %d", rc);22772198 }22782199
+6-2
fs/cifs/inode.c
···4444 inode->i_fop = &cifs_file_direct_nobrl_ops;4545 else4646 inode->i_fop = &cifs_file_direct_ops;4747+ } else if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_STRICT_IO) {4848+ if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_NO_BRL)4949+ inode->i_fop = &cifs_file_strict_nobrl_ops;5050+ else5151+ inode->i_fop = &cifs_file_strict_ops;4752 } else if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_NO_BRL)4853 inode->i_fop = &cifs_file_nobrl_ops;4954 else { /* not direct, send byte range locks */5055 inode->i_fop = &cifs_file_ops;5156 }5252-53575458 /* check if server can support readpages */5559 if (cifs_sb_master_tcon(cifs_sb)->ses->server->maxBuf <···16831679/*16841680 * Zap the cache. Called when invalid_mapping flag is set.16851681 */16861686-static void16821682+void16871683cifs_invalidate_mapping(struct inode *inode)16881684{16891685 int rc;
+1-72
fs/cifs/misc.c
···571571 pCifsInode = CIFS_I(netfile->dentry->d_inode);572572573573 cifs_set_oplock_level(pCifsInode,574574- pSMB->OplockLevel);574574+ pSMB->OplockLevel ? OPLOCK_READ : 0);575575 /*576576 * cifs_oplock_break_put() can't be called577577 * from here. Get reference after queueing···635635 }636636 printk(" | %s\n", debug_line);637637 return;638638-}639639-640640-/* Convert 16 bit Unicode pathname to wire format from string in current code641641- page. Conversion may involve remapping up the seven characters that are642642- only legal in POSIX-like OS (if they are present in the string). Path643643- names are little endian 16 bit Unicode on the wire */644644-int645645-cifsConvertToUCS(__le16 *target, const char *source, int maxlen,646646- const struct nls_table *cp, int mapChars)647647-{648648- int i, j, charlen;649649- int len_remaining = maxlen;650650- char src_char;651651- __u16 temp;652652-653653- if (!mapChars)654654- return cifs_strtoUCS(target, source, PATH_MAX, cp);655655-656656- for (i = 0, j = 0; i < maxlen; j++) {657657- src_char = source[i];658658- switch (src_char) {659659- case 0:660660- target[j] = 0;661661- goto ctoUCS_out;662662- case ':':663663- target[j] = cpu_to_le16(UNI_COLON);664664- break;665665- case '*':666666- target[j] = cpu_to_le16(UNI_ASTERIK);667667- break;668668- case '?':669669- target[j] = cpu_to_le16(UNI_QUESTION);670670- break;671671- case '<':672672- target[j] = cpu_to_le16(UNI_LESSTHAN);673673- break;674674- case '>':675675- target[j] = cpu_to_le16(UNI_GRTRTHAN);676676- break;677677- case '|':678678- target[j] = cpu_to_le16(UNI_PIPE);679679- break;680680- /* BB We can not handle remapping slash until681681- all the calls to build_path_from_dentry682682- are modified, as they use slash as separator BB */683683- /* case '\\':684684- target[j] = cpu_to_le16(UNI_SLASH);685685- break;*/686686- default:687687- charlen = cp->char2uni(source+i,688688- len_remaining, &temp);689689- /* if no match, use question mark, which690690- at least in some cases servers as wild card */691691- if (charlen < 1) {692692- target[j] = cpu_to_le16(0x003f);693693- charlen = 1;694694- } else695695- target[j] = cpu_to_le16(temp);696696- len_remaining -= charlen;697697- /* character may take more than one byte in the698698- the source string, but will take exactly two699699- bytes in the target string */700700- i += charlen;701701- continue;702702- }703703- i++; /* move to next char in source string */704704- len_remaining--;705705- }706706-707707-ctoUCS_out:708708- return i;709638}710639711640void
+2-2
fs/cifs/netmisc.c
···916916smbCalcSize(struct smb_hdr *ptr)917917{918918 return (sizeof(struct smb_hdr) + (2 * ptr->WordCount) +919919- 2 /* size of the bcc field */ + BCC(ptr));919919+ 2 /* size of the bcc field */ + get_bcc(ptr));920920}921921922922unsigned int923923smbCalcSize_LE(struct smb_hdr *ptr)924924{925925 return (sizeof(struct smb_hdr) + (2 * ptr->WordCount) +926926- 2 /* size of the bcc field */ + le16_to_cpu(BCC_LE(ptr)));926926+ 2 /* size of the bcc field */ + get_bcc_le(ptr));927927}928928929929/* The following are taken from fs/ntfs/util.c */
+7-8
fs/cifs/sess.c
···277277}278278279279static void280280-decode_unicode_ssetup(char **pbcc_area, int bleft, struct cifsSesInfo *ses,280280+decode_unicode_ssetup(char **pbcc_area, __u16 bleft, struct cifsSesInfo *ses,281281 const struct nls_table *nls_cp)282282{283283 int len;···323323 return;324324}325325326326-static int decode_ascii_ssetup(char **pbcc_area, int bleft,326326+static int decode_ascii_ssetup(char **pbcc_area, __u16 bleft,327327 struct cifsSesInfo *ses,328328 const struct nls_table *nls_cp)329329{···575575 char *str_area;576576 SESSION_SETUP_ANDX *pSMB;577577 __u32 capabilities;578578- int count;578578+ __u16 count;579579 int resp_buf_type;580580 struct kvec iov[3];581581 enum securityEnum type;582582- __u16 action;583583- int bytes_remaining;582582+ __u16 action, bytes_remaining;584583 struct key *spnego_key = NULL;585584 __le32 phase = NtLmNegotiate; /* NTLMSSP, if needed, is multistage */586585 u16 blob_len;···875876 count = iov[1].iov_len + iov[2].iov_len;876877 smb_buf->smb_buf_length += count;877878878878- BCC_LE(smb_buf) = cpu_to_le16(count);879879+ put_bcc_le(count, smb_buf);879880880881 rc = SendReceive2(xid, ses, iov, 3 /* num_iovecs */, &resp_buf_type,881881- CIFS_STD_OP /* not long */ | CIFS_LOG_ERROR);882882+ CIFS_LOG_ERROR);882883 /* SMB request buf freed in SendReceive2 */883884884885 pSMB = (SESSION_SETUP_ANDX *)iov[0].iov_base;···909910 cFYI(1, "UID = %d ", ses->Suid);910911 /* response can have either 3 or 4 word count - Samba sends 3 */911912 /* and lanman response is 3 */912912- bytes_remaining = BCC(smb_buf);913913+ bytes_remaining = get_bcc(smb_buf);913914 bcc_ptr = pByteArea(smb_buf);914915915916 if (smb_buf->WordCount == 4) {
+209-231
fs/cifs/transport.c
···36363737extern mempool_t *cifs_mid_poolp;38383939-static struct mid_q_entry *3939+static void4040+wake_up_task(struct mid_q_entry *mid)4141+{4242+ wake_up_process(mid->callback_data);4343+}4444+4545+struct mid_q_entry *4046AllocMidQEntry(const struct smb_hdr *smb_buffer, struct TCP_Server_Info *server)4147{4248 struct mid_q_entry *temp;···6458 /* do_gettimeofday(&temp->when_sent);*/ /* easier to use jiffies */6559 /* when mid allocated can be before when sent */6660 temp->when_alloc = jiffies;6767- temp->tsk = current;6161+6262+ /*6363+ * The default is for the mid to be synchronous, so the6464+ * default callback just wakes up the current task.6565+ */6666+ temp->callback = wake_up_task;6767+ temp->callback_data = current;6868 }69697070- spin_lock(&GlobalMid_Lock);7171- list_add_tail(&temp->qhead, &server->pending_mid_q);7270 atomic_inc(&midCount);7371 temp->midState = MID_REQUEST_ALLOCATED;7474- spin_unlock(&GlobalMid_Lock);7572 return temp;7673}77747878-static void7575+void7976DeleteMidQEntry(struct mid_q_entry *midEntry)8077{8178#ifdef CONFIG_CIFS_STATS28279 unsigned long now;8380#endif8484- spin_lock(&GlobalMid_Lock);8581 midEntry->midState = MID_FREE;8686- list_del(&midEntry->qhead);8782 atomic_dec(&midCount);8888- spin_unlock(&GlobalMid_Lock);8983 if (midEntry->largeBuf)9084 cifs_buf_release(midEntry->resp_buf);9185 else···107101 }108102#endif109103 mempool_free(midEntry, cifs_mid_poolp);104104+}105105+106106+static void107107+delete_mid(struct mid_q_entry *mid)108108+{109109+ spin_lock(&GlobalMid_Lock);110110+ list_del(&mid->qhead);111111+ spin_unlock(&GlobalMid_Lock);112112+113113+ DeleteMidQEntry(mid);110114}111115112116static int···260244 return smb_sendv(server, &iov, 1);261245}262246263263-static int wait_for_free_request(struct cifsSesInfo *ses, const int long_op)247247+static int wait_for_free_request(struct TCP_Server_Info *server,248248+ const int long_op)264249{265250 if (long_op == CIFS_ASYNC_OP) {266251 /* oplock breaks must not be held up */267267- atomic_inc(&ses->server->inFlight);252252+ atomic_inc(&server->inFlight);268253 return 0;269254 }270255271256 spin_lock(&GlobalMid_Lock);272257 while (1) {273273- if (atomic_read(&ses->server->inFlight) >=274274- cifs_max_pending){258258+ if (atomic_read(&server->inFlight) >= cifs_max_pending) {275259 spin_unlock(&GlobalMid_Lock);276260#ifdef CONFIG_CIFS_STATS2277277- atomic_inc(&ses->server->num_waiters);261261+ atomic_inc(&server->num_waiters);278262#endif279279- wait_event(ses->server->request_q,280280- atomic_read(&ses->server->inFlight)263263+ wait_event(server->request_q,264264+ atomic_read(&server->inFlight)281265 < cifs_max_pending);282266#ifdef CONFIG_CIFS_STATS2283283- atomic_dec(&ses->server->num_waiters);267267+ atomic_dec(&server->num_waiters);284268#endif285269 spin_lock(&GlobalMid_Lock);286270 } else {287287- if (ses->server->tcpStatus == CifsExiting) {271271+ if (server->tcpStatus == CifsExiting) {288272 spin_unlock(&GlobalMid_Lock);289273 return -ENOENT;290274 }···294278295279 /* update # of requests on the wire to server */296280 if (long_op != CIFS_BLOCKING_OP)297297- atomic_inc(&ses->server->inFlight);281281+ atomic_inc(&server->inFlight);298282 spin_unlock(&GlobalMid_Lock);299283 break;300284 }···324308 *ppmidQ = AllocMidQEntry(in_buf, ses->server);325309 if (*ppmidQ == NULL)326310 return -ENOMEM;311311+ spin_lock(&GlobalMid_Lock);312312+ list_add_tail(&(*ppmidQ)->qhead, &ses->server->pending_mid_q);313313+ spin_unlock(&GlobalMid_Lock);327314 return 0;328315}329316330330-static int wait_for_response(struct cifsSesInfo *ses,331331- struct mid_q_entry *midQ,332332- unsigned long timeout,333333- unsigned long time_to_wait)317317+static int318318+wait_for_response(struct TCP_Server_Info *server, struct mid_q_entry *midQ)334319{335335- unsigned long curr_timeout;320320+ int error;336321337337- for (;;) {338338- curr_timeout = timeout + jiffies;339339- wait_event_timeout(ses->server->response_q,340340- midQ->midState != MID_REQUEST_SUBMITTED, timeout);322322+ error = wait_event_killable(server->response_q,323323+ midQ->midState != MID_REQUEST_SUBMITTED);324324+ if (error < 0)325325+ return -ERESTARTSYS;341326342342- if (time_after(jiffies, curr_timeout) &&343343- (midQ->midState == MID_REQUEST_SUBMITTED) &&344344- ((ses->server->tcpStatus == CifsGood) ||345345- (ses->server->tcpStatus == CifsNew))) {346346-347347- unsigned long lrt;348348-349349- /* We timed out. Is the server still350350- sending replies ? */351351- spin_lock(&GlobalMid_Lock);352352- lrt = ses->server->lstrp;353353- spin_unlock(&GlobalMid_Lock);354354-355355- /* Calculate time_to_wait past last receive time.356356- Although we prefer not to time out if the357357- server is still responding - we will time358358- out if the server takes more than 15 (or 45359359- or 180) seconds to respond to this request360360- and has not responded to any request from361361- other threads on the client within 10 seconds */362362- lrt += time_to_wait;363363- if (time_after(jiffies, lrt)) {364364- /* No replies for time_to_wait. */365365- cERROR(1, "server not responding");366366- return -1;367367- }368368- } else {369369- return 0;370370- }371371- }327327+ return 0;372328}373329330330+331331+/*332332+ * Send a SMB request and set the callback function in the mid to handle333333+ * the result. Caller is responsible for dealing with timeouts.334334+ */335335+int336336+cifs_call_async(struct TCP_Server_Info *server, struct smb_hdr *in_buf,337337+ mid_callback_t *callback, void *cbdata)338338+{339339+ int rc;340340+ struct mid_q_entry *mid;341341+342342+ rc = wait_for_free_request(server, CIFS_ASYNC_OP);343343+ if (rc)344344+ return rc;345345+346346+ mutex_lock(&server->srv_mutex);347347+ mid = AllocMidQEntry(in_buf, server);348348+ if (mid == NULL) {349349+ mutex_unlock(&server->srv_mutex);350350+ return -ENOMEM;351351+ }352352+353353+ /* put it on the pending_mid_q */354354+ spin_lock(&GlobalMid_Lock);355355+ list_add_tail(&mid->qhead, &server->pending_mid_q);356356+ spin_unlock(&GlobalMid_Lock);357357+358358+ rc = cifs_sign_smb(in_buf, server, &mid->sequence_number);359359+ if (rc) {360360+ mutex_unlock(&server->srv_mutex);361361+ goto out_err;362362+ }363363+364364+ mid->callback = callback;365365+ mid->callback_data = cbdata;366366+ mid->midState = MID_REQUEST_SUBMITTED;367367+#ifdef CONFIG_CIFS_STATS2368368+ atomic_inc(&server->inSend);369369+#endif370370+ rc = smb_send(server, in_buf, in_buf->smb_buf_length);371371+#ifdef CONFIG_CIFS_STATS2372372+ atomic_dec(&server->inSend);373373+ mid->when_sent = jiffies;374374+#endif375375+ mutex_unlock(&server->srv_mutex);376376+ if (rc)377377+ goto out_err;378378+379379+ return rc;380380+out_err:381381+ delete_mid(mid);382382+ atomic_dec(&server->inFlight);383383+ wake_up(&server->request_q);384384+ return rc;385385+}374386375387/*376388 *···426382 return rc;427383}428384385385+static int386386+sync_mid_result(struct mid_q_entry *mid, struct TCP_Server_Info *server)387387+{388388+ int rc = 0;389389+390390+ cFYI(1, "%s: cmd=%d mid=%d state=%d", __func__, mid->command,391391+ mid->mid, mid->midState);392392+393393+ spin_lock(&GlobalMid_Lock);394394+ /* ensure that it's no longer on the pending_mid_q */395395+ list_del_init(&mid->qhead);396396+397397+ switch (mid->midState) {398398+ case MID_RESPONSE_RECEIVED:399399+ spin_unlock(&GlobalMid_Lock);400400+ return rc;401401+ case MID_REQUEST_SUBMITTED:402402+ /* socket is going down, reject all calls */403403+ if (server->tcpStatus == CifsExiting) {404404+ cERROR(1, "%s: canceling mid=%d cmd=0x%x state=%d",405405+ __func__, mid->mid, mid->command, mid->midState);406406+ rc = -EHOSTDOWN;407407+ break;408408+ }409409+ case MID_RETRY_NEEDED:410410+ rc = -EAGAIN;411411+ break;412412+ default:413413+ cERROR(1, "%s: invalid mid state mid=%d state=%d", __func__,414414+ mid->mid, mid->midState);415415+ rc = -EIO;416416+ }417417+ spin_unlock(&GlobalMid_Lock);418418+419419+ DeleteMidQEntry(mid);420420+ return rc;421421+}422422+423423+/*424424+ * An NT cancel request header looks just like the original request except:425425+ *426426+ * The Command is SMB_COM_NT_CANCEL427427+ * The WordCount is zeroed out428428+ * The ByteCount is zeroed out429429+ *430430+ * This function mangles an existing request buffer into a431431+ * SMB_COM_NT_CANCEL request and then sends it.432432+ */433433+static int434434+send_nt_cancel(struct TCP_Server_Info *server, struct smb_hdr *in_buf,435435+ struct mid_q_entry *mid)436436+{437437+ int rc = 0;438438+439439+ /* -4 for RFC1001 length and +2 for BCC field */440440+ in_buf->smb_buf_length = sizeof(struct smb_hdr) - 4 + 2;441441+ in_buf->Command = SMB_COM_NT_CANCEL;442442+ in_buf->WordCount = 0;443443+ put_bcc_le(0, in_buf);444444+445445+ mutex_lock(&server->srv_mutex);446446+ rc = cifs_sign_smb(in_buf, server, &mid->sequence_number);447447+ if (rc) {448448+ mutex_unlock(&server->srv_mutex);449449+ return rc;450450+ }451451+ rc = smb_send(server, in_buf, in_buf->smb_buf_length);452452+ mutex_unlock(&server->srv_mutex);453453+454454+ cFYI(1, "issued NT_CANCEL for mid %u, rc = %d",455455+ in_buf->Mid, rc);456456+457457+ return rc;458458+}459459+429460int430461SendReceive2(const unsigned int xid, struct cifsSesInfo *ses,431462 struct kvec *iov, int n_vec, int *pRespBufType /* ret */,···509390 int rc = 0;510391 int long_op;511392 unsigned int receive_len;512512- unsigned long timeout;513393 struct mid_q_entry *midQ;514394 struct smb_hdr *in_buf = iov[0].iov_base;515395···531413 to the same server. We may make this configurable later or532414 use ses->maxReq */533415534534- rc = wait_for_free_request(ses, long_op);416416+ rc = wait_for_free_request(ses->server, long_op);535417 if (rc) {536418 cifs_small_buf_release(in_buf);537419 return rc;···575457 if (rc < 0)576458 goto out;577459578578- if (long_op == CIFS_STD_OP)579579- timeout = 15 * HZ;580580- else if (long_op == CIFS_VLONG_OP) /* e.g. slow writes past EOF */581581- timeout = 180 * HZ;582582- else if (long_op == CIFS_LONG_OP)583583- timeout = 45 * HZ; /* should be greater than584584- servers oplock break timeout (about 43 seconds) */585585- else if (long_op == CIFS_ASYNC_OP)460460+ if (long_op == CIFS_ASYNC_OP)586461 goto out;587587- else if (long_op == CIFS_BLOCKING_OP)588588- timeout = 0x7FFFFFFF; /* large, but not so large as to wrap */589589- else {590590- cERROR(1, "unknown timeout flag %d", long_op);591591- rc = -EIO;462462+463463+ rc = wait_for_response(ses->server, midQ);464464+ if (rc != 0)592465 goto out;593593- }594466595595- /* wait for 15 seconds or until woken up due to response arriving or596596- due to last connection to this server being unmounted */597597- if (signal_pending(current)) {598598- /* if signal pending do not hold up user for full smb timeout599599- but we still give response a chance to complete */600600- timeout = 2 * HZ;601601- }602602-603603- /* No user interrupts in wait - wreaks havoc with performance */604604- wait_for_response(ses, midQ, timeout, 10 * HZ);605605-606606- spin_lock(&GlobalMid_Lock);607607-608608- if (midQ->resp_buf == NULL) {609609- cERROR(1, "No response to cmd %d mid %d",610610- midQ->command, midQ->mid);611611- if (midQ->midState == MID_REQUEST_SUBMITTED) {612612- if (ses->server->tcpStatus == CifsExiting)613613- rc = -EHOSTDOWN;614614- else {615615- ses->server->tcpStatus = CifsNeedReconnect;616616- midQ->midState = MID_RETRY_NEEDED;617617- }618618- }619619-620620- if (rc != -EHOSTDOWN) {621621- if (midQ->midState == MID_RETRY_NEEDED) {622622- rc = -EAGAIN;623623- cFYI(1, "marking request for retry");624624- } else {625625- rc = -EIO;626626- }627627- }628628- spin_unlock(&GlobalMid_Lock);629629- DeleteMidQEntry(midQ);630630- /* Update # of requests on wire to server */467467+ rc = sync_mid_result(midQ, ses->server);468468+ if (rc != 0) {631469 atomic_dec(&ses->server->inFlight);632470 wake_up(&ses->server->request_q);633471 return rc;634472 }635473636636- spin_unlock(&GlobalMid_Lock);637474 receive_len = midQ->resp_buf->smb_buf_length;638475639476 if (receive_len > CIFSMaxBufSize + MAX_CIFS_HDR_SIZE) {···632559 if (receive_len >= sizeof(struct smb_hdr) - 4633560 /* do not count RFC1001 header */ +634561 (2 * midQ->resp_buf->WordCount) + 2 /* bcc */ )635635- BCC(midQ->resp_buf) =636636- le16_to_cpu(BCC_LE(midQ->resp_buf));562562+ put_bcc(get_bcc_le(midQ->resp_buf), midQ->resp_buf);637563 if ((flags & CIFS_NO_RESP) == 0)638564 midQ->resp_buf = NULL; /* mark it so buf will639565 not be freed by640640- DeleteMidQEntry */566566+ delete_mid */641567 } else {642568 rc = -EIO;643569 cFYI(1, "Bad MID state?");644570 }645571646572out:647647- DeleteMidQEntry(midQ);573573+ delete_mid(midQ);648574 atomic_dec(&ses->server->inFlight);649575 wake_up(&ses->server->request_q);650576···657585{658586 int rc = 0;659587 unsigned int receive_len;660660- unsigned long timeout;661588 struct mid_q_entry *midQ;662589663590 if (ses == NULL) {···681610 return -EIO;682611 }683612684684- rc = wait_for_free_request(ses, long_op);613613+ rc = wait_for_free_request(ses->server, long_op);685614 if (rc)686615 return rc;687616···720649 if (rc < 0)721650 goto out;722651723723- if (long_op == CIFS_STD_OP)724724- timeout = 15 * HZ;725725- /* wait for 15 seconds or until woken up due to response arriving or726726- due to last connection to this server being unmounted */727727- else if (long_op == CIFS_ASYNC_OP)652652+ if (long_op == CIFS_ASYNC_OP)728653 goto out;729729- else if (long_op == CIFS_VLONG_OP) /* writes past EOF can be slow */730730- timeout = 180 * HZ;731731- else if (long_op == CIFS_LONG_OP)732732- timeout = 45 * HZ; /* should be greater than733733- servers oplock break timeout (about 43 seconds) */734734- else if (long_op == CIFS_BLOCKING_OP)735735- timeout = 0x7FFFFFFF; /* large but no so large as to wrap */736736- else {737737- cERROR(1, "unknown timeout flag %d", long_op);738738- rc = -EIO;654654+655655+ rc = wait_for_response(ses->server, midQ);656656+ if (rc != 0)739657 goto out;740740- }741658742742- if (signal_pending(current)) {743743- /* if signal pending do not hold up user for full smb timeout744744- but we still give response a chance to complete */745745- timeout = 2 * HZ;746746- }747747-748748- /* No user interrupts in wait - wreaks havoc with performance */749749- wait_for_response(ses, midQ, timeout, 10 * HZ);750750-751751- spin_lock(&GlobalMid_Lock);752752- if (midQ->resp_buf == NULL) {753753- cERROR(1, "No response for cmd %d mid %d",754754- midQ->command, midQ->mid);755755- if (midQ->midState == MID_REQUEST_SUBMITTED) {756756- if (ses->server->tcpStatus == CifsExiting)757757- rc = -EHOSTDOWN;758758- else {759759- ses->server->tcpStatus = CifsNeedReconnect;760760- midQ->midState = MID_RETRY_NEEDED;761761- }762762- }763763-764764- if (rc != -EHOSTDOWN) {765765- if (midQ->midState == MID_RETRY_NEEDED) {766766- rc = -EAGAIN;767767- cFYI(1, "marking request for retry");768768- } else {769769- rc = -EIO;770770- }771771- }772772- spin_unlock(&GlobalMid_Lock);773773- DeleteMidQEntry(midQ);774774- /* Update # of requests on wire to server */659659+ rc = sync_mid_result(midQ, ses->server);660660+ if (rc != 0) {775661 atomic_dec(&ses->server->inFlight);776662 wake_up(&ses->server->request_q);777663 return rc;778664 }779665780780- spin_unlock(&GlobalMid_Lock);781666 receive_len = midQ->resp_buf->smb_buf_length;782667783668 if (receive_len > CIFSMaxBufSize + MAX_CIFS_HDR_SIZE) {···775748 if (receive_len >= sizeof(struct smb_hdr) - 4776749 /* do not count RFC1001 header */ +777750 (2 * out_buf->WordCount) + 2 /* bcc */ )778778- BCC(out_buf) = le16_to_cpu(BCC_LE(out_buf));751751+ put_bcc(get_bcc_le(midQ->resp_buf), midQ->resp_buf);779752 } else {780753 rc = -EIO;781754 cERROR(1, "Bad MID state?");782755 }783756784757out:785785- DeleteMidQEntry(midQ);758758+ delete_mid(midQ);786759 atomic_dec(&ses->server->inFlight);787760 wake_up(&ses->server->request_q);788761789789- return rc;790790-}791791-792792-/* Send an NT_CANCEL SMB to cause the POSIX blocking lock to return. */793793-794794-static int795795-send_nt_cancel(struct cifsTconInfo *tcon, struct smb_hdr *in_buf,796796- struct mid_q_entry *midQ)797797-{798798- int rc = 0;799799- struct cifsSesInfo *ses = tcon->ses;800800- __u16 mid = in_buf->Mid;801801-802802- header_assemble(in_buf, SMB_COM_NT_CANCEL, tcon, 0);803803- in_buf->Mid = mid;804804- mutex_lock(&ses->server->srv_mutex);805805- rc = cifs_sign_smb(in_buf, ses->server, &midQ->sequence_number);806806- if (rc) {807807- mutex_unlock(&ses->server->srv_mutex);808808- return rc;809809- }810810- rc = smb_send(ses->server, in_buf, in_buf->smb_buf_length);811811- mutex_unlock(&ses->server->srv_mutex);812762 return rc;813763}814764···811807 pSMB->hdr.Mid = GetNextMid(ses->server);812808813809 return SendReceive(xid, ses, in_buf, out_buf,814814- &bytes_returned, CIFS_STD_OP);810810+ &bytes_returned, 0);815811}816812817813int···849845 return -EIO;850846 }851847852852- rc = wait_for_free_request(ses, CIFS_BLOCKING_OP);848848+ rc = wait_for_free_request(ses->server, CIFS_BLOCKING_OP);853849 if (rc)854850 return rc;855851···867863868864 rc = cifs_sign_smb(in_buf, ses->server, &midQ->sequence_number);869865 if (rc) {870870- DeleteMidQEntry(midQ);866866+ delete_mid(midQ);871867 mutex_unlock(&ses->server->srv_mutex);872868 return rc;873869 }···884880 mutex_unlock(&ses->server->srv_mutex);885881886882 if (rc < 0) {887887- DeleteMidQEntry(midQ);883883+ delete_mid(midQ);888884 return rc;889885 }890886···903899 if (in_buf->Command == SMB_COM_TRANSACTION2) {904900 /* POSIX lock. We send a NT_CANCEL SMB to cause the905901 blocking lock to return. */906906-907907- rc = send_nt_cancel(tcon, in_buf, midQ);902902+ rc = send_nt_cancel(ses->server, in_buf, midQ);908903 if (rc) {909909- DeleteMidQEntry(midQ);904904+ delete_mid(midQ);910905 return rc;911906 }912907 } else {···917914 /* If we get -ENOLCK back the lock may have918915 already been removed. Don't exit in this case. */919916 if (rc && rc != -ENOLCK) {920920- DeleteMidQEntry(midQ);917917+ delete_mid(midQ);921918 return rc;922919 }923920 }924921925925- /* Wait 5 seconds for the response. */926926- if (wait_for_response(ses, midQ, 5 * HZ, 5 * HZ) == 0) {922922+ if (wait_for_response(ses->server, midQ) == 0) {927923 /* We got the response - restart system call. */928924 rstart = 1;929925 }930926 }931927932932- spin_lock(&GlobalMid_Lock);933933- if (midQ->resp_buf) {934934- spin_unlock(&GlobalMid_Lock);935935- receive_len = midQ->resp_buf->smb_buf_length;936936- } else {937937- cERROR(1, "No response for cmd %d mid %d",938938- midQ->command, midQ->mid);939939- if (midQ->midState == MID_REQUEST_SUBMITTED) {940940- if (ses->server->tcpStatus == CifsExiting)941941- rc = -EHOSTDOWN;942942- else {943943- ses->server->tcpStatus = CifsNeedReconnect;944944- midQ->midState = MID_RETRY_NEEDED;945945- }946946- }947947-948948- if (rc != -EHOSTDOWN) {949949- if (midQ->midState == MID_RETRY_NEEDED) {950950- rc = -EAGAIN;951951- cFYI(1, "marking request for retry");952952- } else {953953- rc = -EIO;954954- }955955- }956956- spin_unlock(&GlobalMid_Lock);957957- DeleteMidQEntry(midQ);928928+ rc = sync_mid_result(midQ, ses->server);929929+ if (rc != 0)958930 return rc;959959- }960931932932+ receive_len = midQ->resp_buf->smb_buf_length;961933 if (receive_len > CIFSMaxBufSize + MAX_CIFS_HDR_SIZE) {962934 cERROR(1, "Frame too large received. Length: %d Xid: %d",963935 receive_len, xid);···976998 if (receive_len >= sizeof(struct smb_hdr) - 4977999 /* do not count RFC1001 header */ +9781000 (2 * out_buf->WordCount) + 2 /* bcc */ )979979- BCC(out_buf) = le16_to_cpu(BCC_LE(out_buf));10011001+ put_bcc(get_bcc_le(out_buf), out_buf);98010029811003out:982982- DeleteMidQEntry(midQ);10041004+ delete_mid(midQ);9831005 if (rstart && rc == -EACCES)9841006 return -ERESTARTSYS;9851007 return rc;
+7-3
fs/direct-io.c
···325325}326326EXPORT_SYMBOL_GPL(dio_end_io);327327328328-static int328328+static void329329dio_bio_alloc(struct dio *dio, struct block_device *bdev,330330 sector_t first_sector, int nr_vecs)331331{332332 struct bio *bio;333333334334+ /*335335+ * bio_alloc() is guaranteed to return a bio when called with336336+ * __GFP_WAIT and we request a valid number of vectors.337337+ */334338 bio = bio_alloc(GFP_KERNEL, nr_vecs);335339336340 bio->bi_bdev = bdev;···346342347343 dio->bio = bio;348344 dio->logical_offset_in_bio = dio->cur_page_fs_offset;349349- return 0;350345}351346352347/*···586583 goto out;587584 sector = start_sector << (dio->blkbits - 9);588585 nr_pages = min(dio->pages_in_io, bio_get_nr_vecs(dio->map_bh.b_bdev));586586+ nr_pages = min(nr_pages, BIO_MAX_PAGES);589587 BUG_ON(nr_pages <= 0);590590- ret = dio_bio_alloc(dio, dio->map_bh.b_bdev, sector, nr_pages);588588+ dio_bio_alloc(dio, dio->map_bh.b_bdev, sector, nr_pages);591589 dio->boundary = 0;592590out:593591 return ret;
+7-18
fs/ext3/super.c
···754754static int ext3_mark_dquot_dirty(struct dquot *dquot);755755static int ext3_write_info(struct super_block *sb, int type);756756static int ext3_quota_on(struct super_block *sb, int type, int format_id,757757- char *path);757757+ struct path *path);758758static int ext3_quota_on_mount(struct super_block *sb, int type);759759static ssize_t ext3_quota_read(struct super_block *sb, int type, char *data,760760 size_t len, loff_t off);···28772877 * Standard function to be called on quota_on28782878 */28792879static int ext3_quota_on(struct super_block *sb, int type, int format_id,28802880- char *name)28802880+ struct path *path)28812881{28822882 int err;28832883- struct path path;2884288328852884 if (!test_opt(sb, QUOTA))28862885 return -EINVAL;2887288628882888- err = kern_path(name, LOOKUP_FOLLOW, &path);28892889- if (err)28902890- return err;28912891-28922887 /* Quotafile not on the same filesystem? */28932893- if (path.mnt->mnt_sb != sb) {28942894- path_put(&path);28882888+ if (path->mnt->mnt_sb != sb)28952889 return -EXDEV;28962896- }28972890 /* Journaling quota? */28982891 if (EXT3_SB(sb)->s_qf_names[type]) {28992892 /* Quotafile not of fs root? */29002900- if (path.dentry->d_parent != sb->s_root)28932893+ if (path->dentry->d_parent != sb->s_root)29012894 ext3_msg(sb, KERN_WARNING,29022895 "warning: Quota file not on filesystem root. "29032896 "Journaled quota will not work.");···29002907 * When we journal data on quota file, we have to flush journal to see29012908 * all updates to the file when we bypass pagecache...29022909 */29032903- if (ext3_should_journal_data(path.dentry->d_inode)) {29102910+ if (ext3_should_journal_data(path->dentry->d_inode)) {29042911 /*29052912 * We don't need to lock updates but journal_flush() could29062913 * otherwise be livelocked...···29082915 journal_lock_updates(EXT3_SB(sb)->s_journal);29092916 err = journal_flush(EXT3_SB(sb)->s_journal);29102917 journal_unlock_updates(EXT3_SB(sb)->s_journal);29112911- if (err) {29122912- path_put(&path);29182918+ if (err)29132919 return err;29142914- }29152920 }2916292129172917- err = dquot_quota_on_path(sb, type, format_id, &path);29182918- path_put(&path);29192919- return err;29222922+ return dquot_quota_on(sb, type, format_id, path);29202923}2921292429222925/* Read data from quotafile - avoid pagecache and such because we cannot afford
+7-18
fs/ext4/super.c
···11611161static int ext4_mark_dquot_dirty(struct dquot *dquot);11621162static int ext4_write_info(struct super_block *sb, int type);11631163static int ext4_quota_on(struct super_block *sb, int type, int format_id,11641164- char *path);11641164+ struct path *path);11651165static int ext4_quota_off(struct super_block *sb, int type);11661166static int ext4_quota_on_mount(struct super_block *sb, int type);11671167static ssize_t ext4_quota_read(struct super_block *sb, int type, char *data,···45584558 * Standard function to be called on quota_on45594559 */45604560static int ext4_quota_on(struct super_block *sb, int type, int format_id,45614561- char *name)45614561+ struct path *path)45624562{45634563 int err;45644564- struct path path;4565456445664565 if (!test_opt(sb, QUOTA))45674566 return -EINVAL;4568456745694569- err = kern_path(name, LOOKUP_FOLLOW, &path);45704570- if (err)45714571- return err;45724572-45734568 /* Quotafile not on the same filesystem? */45744574- if (path.mnt->mnt_sb != sb) {45754575- path_put(&path);45694569+ if (path->mnt->mnt_sb != sb)45764570 return -EXDEV;45774577- }45784571 /* Journaling quota? */45794572 if (EXT4_SB(sb)->s_qf_names[type]) {45804573 /* Quotafile not in fs root? */45814581- if (path.dentry->d_parent != sb->s_root)45744574+ if (path->dentry->d_parent != sb->s_root)45824575 ext4_msg(sb, KERN_WARNING,45834576 "Quota file not on filesystem root. "45844577 "Journaled quota will not work");···45824589 * all updates to the file when we bypass pagecache...45834590 */45844591 if (EXT4_SB(sb)->s_journal &&45854585- ext4_should_journal_data(path.dentry->d_inode)) {45924592+ ext4_should_journal_data(path->dentry->d_inode)) {45864593 /*45874594 * We don't need to lock updates but journal_flush() could45884595 * otherwise be livelocked...···45904597 jbd2_journal_lock_updates(EXT4_SB(sb)->s_journal);45914598 err = jbd2_journal_flush(EXT4_SB(sb)->s_journal);45924599 jbd2_journal_unlock_updates(EXT4_SB(sb)->s_journal);45934593- if (err) {45944594- path_put(&path);46004600+ if (err)45954601 return err;45964596- }45974602 }4598460345994599- err = dquot_quota_on_path(sb, type, format_id, &path);46004600- path_put(&path);46014601- return err;46044604+ return dquot_quota_on(sb, type, format_id, path);46024605}4603460646044607static int ext4_quota_off(struct super_block *sb, int type)
+22-50
fs/gfs2/inode.c
···7474}75757676/**7777- * GFS2 lookup code fills in vfs inode contents based on info obtained7878- * from directory entry inside gfs2_inode_lookup(). This has caused issues7979- * with NFS code path since its get_dentry routine doesn't have the relevant8080- * directory entry when gfs2_inode_lookup() is invoked. Part of the code8181- * segment inside gfs2_inode_lookup code needs to get moved around.7777+ * gfs2_set_iop - Sets inode operations7878+ * @inode: The inode with correct i_mode filled in8279 *8383- * Clears I_NEW as well.8484- **/8080+ * GFS2 lookup code fills in vfs inode contents based on info obtained8181+ * from directory entry inside gfs2_inode_lookup().8282+ */85838686-void gfs2_set_iop(struct inode *inode)8484+static void gfs2_set_iop(struct inode *inode)8785{8886 struct gfs2_sbd *sdp = GFS2_SB(inode);8987 umode_t mode = inode->i_mode;···104106 inode->i_op = &gfs2_file_iops;105107 init_special_inode(inode, inode->i_mode, inode->i_rdev);106108 }107107-108108- unlock_new_inode(inode);109109}110110111111/**···115119 * Returns: A VFS inode, or an error116120 */117121118118-struct inode *gfs2_inode_lookup(struct super_block *sb,119119- unsigned int type,120120- u64 no_addr,121121- u64 no_formal_ino)122122+struct inode *gfs2_inode_lookup(struct super_block *sb, unsigned int type,123123+ u64 no_addr, u64 no_formal_ino)122124{123125 struct inode *inode;124126 struct gfs2_inode *ip;···146152 error = gfs2_glock_nq_init(io_gl, LM_ST_SHARED, GL_EXACT, &ip->i_iopen_gh);147153 if (unlikely(error))148154 goto fail_iopen;149149- ip->i_iopen_gh.gh_gl->gl_object = ip;150155156156+ ip->i_iopen_gh.gh_gl->gl_object = ip;151157 gfs2_glock_put(io_gl);152158 io_gl = NULL;153159154154- if ((type == DT_UNKNOWN) && (no_formal_ino == 0))155155- goto gfs2_nfsbypass;156156-157157- inode->i_mode = DT2IF(type);158158-159159- /*160160- * We must read the inode in order to work out its type in161161- * this case. Note that this doesn't happen often as we normally162162- * know the type beforehand. This code path only occurs during163163- * unlinked inode recovery (where it is safe to do this glock,164164- * which is not true in the general case).165165- */166160 if (type == DT_UNKNOWN) {167167- struct gfs2_holder gh;168168- error = gfs2_glock_nq_init(ip->i_gl, LM_ST_EXCLUSIVE, 0, &gh);169169- if (unlikely(error))170170- goto fail_glock;171171- /* Inode is now uptodate */172172- gfs2_glock_dq_uninit(&gh);161161+ /* Inode glock must be locked already */162162+ error = gfs2_inode_refresh(GFS2_I(inode));163163+ if (error)164164+ goto fail_refresh;165165+ } else {166166+ inode->i_mode = DT2IF(type);173167 }174168175169 gfs2_set_iop(inode);170170+ unlock_new_inode(inode);176171 }177172178178-gfs2_nfsbypass:179173 return inode;180180-fail_glock:181181- gfs2_glock_dq(&ip->i_iopen_gh);174174+175175+fail_refresh:176176+ ip->i_iopen_gh.gh_gl->gl_object = NULL;177177+ gfs2_glock_dq_uninit(&ip->i_iopen_gh);182178fail_iopen:183179 if (io_gl)184180 gfs2_glock_put(io_gl);185181fail_put:186186- if (inode->i_state & I_NEW)187187- ip->i_gl->gl_object = NULL;182182+ ip->i_gl->gl_object = NULL;188183 gfs2_glock_put(ip->i_gl);189184fail:190190- if (inode->i_state & I_NEW)191191- iget_failed(inode);192192- else193193- iput(inode);185185+ iget_failed(inode);194186 return ERR_PTR(error);195187}196188···200220 inode = gfs2_inode_lookup(sb, DT_UNKNOWN, no_addr, 0);201221 if (IS_ERR(inode))202222 goto fail;203203-204204- error = gfs2_inode_refresh(GFS2_I(inode));205205- if (error)206206- goto fail_iput;207207-208208- /* Pick up the works we bypass in gfs2_inode_lookup */209209- if (inode->i_state & I_NEW) 210210- gfs2_set_iop(inode);211223212224 /* Two extra checks for NFS only */213225 if (no_formal_ino) {
···993993}994994995995/* Handle quota on quotactl */996996-static int ocfs2_quota_on(struct super_block *sb, int type, int format_id,997997- char *path)996996+static int ocfs2_quota_on(struct super_block *sb, int type, int format_id)998997{999998 unsigned int feature[MAXQUOTAS] = { OCFS2_FEATURE_RO_COMPAT_USRQUOTA,1000999 OCFS2_FEATURE_RO_COMPAT_GRPQUOTA};···10121013}1013101410141015static const struct quotactl_ops ocfs2_quotactl_ops = {10151015- .quota_on = ocfs2_quota_on,10161016+ .quota_on_meta = ocfs2_quota_on,10161017 .quota_off = ocfs2_quota_off,10171018 .quota_sync = dquot_quota_sync,10181019 .get_info = dquot_get_dqinfo,
+5-5
fs/pipe.c
···441441 break;442442 }443443 if (do_wakeup) {444444- wake_up_interruptible_sync_poll(&pipe->wait, POLLOUT);444444+ wake_up_interruptible_sync_poll(&pipe->wait, POLLOUT | POLLWRNORM);445445 kill_fasync(&pipe->fasync_writers, SIGIO, POLL_OUT);446446 }447447 pipe_wait(pipe);···450450451451 /* Signal writers asynchronously that there is more room. */452452 if (do_wakeup) {453453- wake_up_interruptible_sync_poll(&pipe->wait, POLLOUT);453453+ wake_up_interruptible_sync_poll(&pipe->wait, POLLOUT | POLLWRNORM);454454 kill_fasync(&pipe->fasync_writers, SIGIO, POLL_OUT);455455 }456456 if (ret > 0)···612612 break;613613 }614614 if (do_wakeup) {615615- wake_up_interruptible_sync_poll(&pipe->wait, POLLIN);615615+ wake_up_interruptible_sync_poll(&pipe->wait, POLLIN | POLLRDNORM);616616 kill_fasync(&pipe->fasync_readers, SIGIO, POLL_IN);617617 do_wakeup = 0;618618 }···623623out:624624 mutex_unlock(&inode->i_mutex);625625 if (do_wakeup) {626626- wake_up_interruptible_sync_poll(&pipe->wait, POLLIN);626626+ wake_up_interruptible_sync_poll(&pipe->wait, POLLIN | POLLRDNORM);627627 kill_fasync(&pipe->fasync_readers, SIGIO, POLL_IN);628628 }629629 if (ret > 0)···715715 if (!pipe->readers && !pipe->writers) {716716 free_pipe_info(inode);717717 } else {718718- wake_up_interruptible_sync_poll(&pipe->wait, POLLIN | POLLOUT);718718+ wake_up_interruptible_sync_poll(&pipe->wait, POLLIN | POLLOUT | POLLRDNORM | POLLWRNORM | POLLERR | POLLHUP);719719 kill_fasync(&pipe->fasync_readers, SIGIO, POLL_IN);720720 kill_fasync(&pipe->fasync_writers, SIGIO, POLL_OUT);721721 }
+3-3
fs/proc/Kconfig
···11config PROC_FS22- bool "/proc file system support" if EMBEDDED22+ bool "/proc file system support" if EXPERT33 default y44 help55 This is a virtual file system providing information about the status···4040 Exports the dump image of crashed kernel in ELF format.41414242config PROC_SYSCTL4343- bool "Sysctl support (/proc/sys)" if EMBEDDED4343+ bool "Sysctl support (/proc/sys)" if EXPERT4444 depends on PROC_FS4545 select SYSCTL4646 default y···6161config PROC_PAGE_MONITOR6262 default y6363 depends on PROC_FS && MMU6464- bool "Enable /proc page monitoring" if EMBEDDED6464+ bool "Enable /proc page monitoring" if EXPERT6565 help6666 Various /proc files exist to monitor process memory utilization:6767 /proc/pid/smaps, /proc/pid/clear_refs, /proc/pid/pagemap,
+2-16
fs/quota/dquot.c
···21892189}21902190EXPORT_SYMBOL(dquot_resume);2191219121922192-int dquot_quota_on_path(struct super_block *sb, int type, int format_id,21932193- struct path *path)21922192+int dquot_quota_on(struct super_block *sb, int type, int format_id,21932193+ struct path *path)21942194{21952195 int error = security_quota_on(path->dentry);21962196 if (error)···22022202 error = vfs_load_quota_inode(path->dentry->d_inode, type,22032203 format_id, DQUOT_USAGE_ENABLED |22042204 DQUOT_LIMITS_ENABLED);22052205- return error;22062206-}22072207-EXPORT_SYMBOL(dquot_quota_on_path);22082208-22092209-int dquot_quota_on(struct super_block *sb, int type, int format_id, char *name)22102210-{22112211- struct path path;22122212- int error;22132213-22142214- error = kern_path(name, LOOKUP_FOLLOW, &path);22152215- if (!error) {22162216- error = dquot_quota_on_path(sb, type, format_id, &path);22172217- path_put(&path);22182218- }22192205 return error;22202206}22212207EXPORT_SYMBOL(dquot_quota_on);
+27-14
fs/quota/quota.c
···6464}65656666static int quota_quotaon(struct super_block *sb, int type, int cmd, qid_t id,6767- void __user *addr)6767+ struct path *path)6868{6969- char *pathname;7070- int ret = -ENOSYS;7171-7272- pathname = getname(addr);7373- if (IS_ERR(pathname))7474- return PTR_ERR(pathname);7575- if (sb->s_qcop->quota_on)7676- ret = sb->s_qcop->quota_on(sb, type, id, pathname);7777- putname(pathname);7878- return ret;6969+ if (!sb->s_qcop->quota_on && !sb->s_qcop->quota_on_meta)7070+ return -ENOSYS;7171+ if (sb->s_qcop->quota_on_meta)7272+ return sb->s_qcop->quota_on_meta(sb, type, id);7373+ if (IS_ERR(path))7474+ return PTR_ERR(path);7575+ return sb->s_qcop->quota_on(sb, type, id, path);7976}80778178static int quota_getfmt(struct super_block *sb, int type, void __user *addr)···238241239242/* Copy parameters and call proper function */240243static int do_quotactl(struct super_block *sb, int type, int cmd, qid_t id,241241- void __user *addr)244244+ void __user *addr, struct path *path)242245{243246 int ret;244247···253256254257 switch (cmd) {255258 case Q_QUOTAON:256256- return quota_quotaon(sb, type, cmd, id, addr);259259+ return quota_quotaon(sb, type, cmd, id, path);257260 case Q_QUOTAOFF:258261 if (!sb->s_qcop->quota_off)259262 return -ENOSYS;···332335{333336 uint cmds, type;334337 struct super_block *sb = NULL;338338+ struct path path, *pathp = NULL;335339 int ret;336340337341 cmds = cmd >> SUBCMDSHIFT;···349351 return -ENODEV;350352 }351353354354+ /*355355+ * Path for quotaon has to be resolved before grabbing superblock356356+ * because that gets s_umount sem which is also possibly needed by path357357+ * resolution (think about autofs) and thus deadlocks could arise.358358+ */359359+ if (cmds == Q_QUOTAON) {360360+ ret = user_path_at(AT_FDCWD, addr, LOOKUP_FOLLOW, &path);361361+ if (ret)362362+ pathp = ERR_PTR(ret);363363+ else364364+ pathp = &path;365365+ }366366+352367 sb = quotactl_block(special);353368 if (IS_ERR(sb))354369 return PTR_ERR(sb);355370356356- ret = do_quotactl(sb, type, cmds, id, addr);371371+ ret = do_quotactl(sb, type, cmds, id, addr, pathp);357372358373 drop_super(sb);374374+ if (pathp && !IS_ERR(pathp))375375+ path_put(pathp);359376 return ret;360377}
+6-11
fs/reiserfs/super.c
···632632static int reiserfs_release_dquot(struct dquot *);633633static int reiserfs_mark_dquot_dirty(struct dquot *);634634static int reiserfs_write_info(struct super_block *, int);635635-static int reiserfs_quota_on(struct super_block *, int, int, char *);635635+static int reiserfs_quota_on(struct super_block *, int, int, struct path *);636636637637static const struct dquot_operations reiserfs_quota_operations = {638638 .write_dquot = reiserfs_write_dquot,···20482048 * Standard function to be called on quota_on20492049 */20502050static int reiserfs_quota_on(struct super_block *sb, int type, int format_id,20512051- char *name)20512051+ struct path *path)20522052{20532053 int err;20542054- struct path path;20552054 struct inode *inode;20562055 struct reiserfs_transaction_handle th;2057205620582057 if (!(REISERFS_SB(sb)->s_mount_opt & (1 << REISERFS_QUOTA)))20592058 return -EINVAL;2060205920612061- err = kern_path(name, LOOKUP_FOLLOW, &path);20622062- if (err)20632063- return err;20642060 /* Quotafile not on the same filesystem? */20652065- if (path.mnt->mnt_sb != sb) {20612061+ if (path->mnt->mnt_sb != sb) {20662062 err = -EXDEV;20672063 goto out;20682064 }20692069- inode = path.dentry->d_inode;20652065+ inode = path->dentry->d_inode;20702066 /* We must not pack tails for quota files on reiserfs for quota IO to work */20712067 if (!(REISERFS_I(inode)->i_flags & i_nopack_mask)) {20722068 err = reiserfs_unpack(inode, NULL);···20782082 /* Journaling quota? */20792083 if (REISERFS_SB(sb)->s_qf_names[type]) {20802084 /* Quotafile not of fs root? */20812081- if (path.dentry->d_parent != sb->s_root)20852085+ if (path->dentry->d_parent != sb->s_root)20822086 reiserfs_warning(sb, "super-6521",20832087 "Quota file not on filesystem root. "20842088 "Journalled quota will not work.");···20972101 if (err)20982102 goto out;20992103 }21002100- err = dquot_quota_on_path(sb, type, format_id, &path);21042104+ err = dquot_quota_on(sb, type, format_id, path);21012105out:21022102- path_put(&path);21032106 return err;21042107}21052108
+1-1
fs/sysfs/Kconfig
···11config SYSFS22- bool "sysfs file system support" if EMBEDDED22+ bool "sysfs file system support" if EXPERT33 default y44 help55 The sysfs filesystem is a virtual filesystem that the kernel uses to
+1-1
include/acpi/acexcep.h
···55 *****************************************************************************/6677/*88- * Copyright (C) 2000 - 2010, Intel Corp.88+ * Copyright (C) 2000 - 2011, Intel Corp.99 * All rights reserved.1010 *1111 * Redistribution and use in source and binary forms, with or without
+1-1
include/acpi/acnames.h
···55 *****************************************************************************/6677/*88- * Copyright (C) 2000 - 2010, Intel Corp.88+ * Copyright (C) 2000 - 2011, Intel Corp.99 * All rights reserved.1010 *1111 * Redistribution and use in source and binary forms, with or without
+1-1
include/acpi/acoutput.h
···55 *****************************************************************************/6677/*88- * Copyright (C) 2000 - 2010, Intel Corp.88+ * Copyright (C) 2000 - 2011, Intel Corp.99 * All rights reserved.1010 *1111 * Redistribution and use in source and binary forms, with or without
+1-1
include/acpi/acpi.h
···55 *****************************************************************************/6677/*88- * Copyright (C) 2000 - 2010, Intel Corp.88+ * Copyright (C) 2000 - 2011, Intel Corp.99 * All rights reserved.1010 *1111 * Redistribution and use in source and binary forms, with or without
+1-1
include/acpi/acpiosxf.h
···88 *****************************************************************************/991010/*1111- * Copyright (C) 2000 - 2010, Intel Corp.1111+ * Copyright (C) 2000 - 2011, Intel Corp.1212 * All rights reserved.1313 *1414 * Redistribution and use in source and binary forms, with or without
+2-2
include/acpi/acpixf.h
···66 *****************************************************************************/7788/*99- * Copyright (C) 2000 - 2010, Intel Corp.99+ * Copyright (C) 2000 - 2011, Intel Corp.1010 * All rights reserved.1111 *1212 * Redistribution and use in source and binary forms, with or without···47474848/* Current ACPICA subsystem version in YYYYMMDD format */49495050-#define ACPI_CA_VERSION 0x201012095050+#define ACPI_CA_VERSION 0x2011011251515252#include "actypes.h"5353#include "actbl.h"
+1-1
include/acpi/acrestyp.h
···55 *****************************************************************************/6677/*88- * Copyright (C) 2000 - 2010, Intel Corp.88+ * Copyright (C) 2000 - 2011, Intel Corp.99 * All rights reserved.1010 *1111 * Redistribution and use in source and binary forms, with or without
+1-1
include/acpi/actbl.h
···55 *****************************************************************************/6677/*88- * Copyright (C) 2000 - 2010, Intel Corp.88+ * Copyright (C) 2000 - 2011, Intel Corp.99 * All rights reserved.1010 *1111 * Redistribution and use in source and binary forms, with or without
+1-1
include/acpi/actbl1.h
···55 *****************************************************************************/6677/*88- * Copyright (C) 2000 - 2010, Intel Corp.88+ * Copyright (C) 2000 - 2011, Intel Corp.99 * All rights reserved.1010 *1111 * Redistribution and use in source and binary forms, with or without
+1-1
include/acpi/actbl2.h
···55 *****************************************************************************/6677/*88- * Copyright (C) 2000 - 2010, Intel Corp.88+ * Copyright (C) 2000 - 2011, Intel Corp.99 * All rights reserved.1010 *1111 * Redistribution and use in source and binary forms, with or without
+1-1
include/acpi/actypes.h
···55 *****************************************************************************/6677/*88- * Copyright (C) 2000 - 2010, Intel Corp.88+ * Copyright (C) 2000 - 2011, Intel Corp.99 * All rights reserved.1010 *1111 * Redistribution and use in source and binary forms, with or without
+1-1
include/acpi/platform/acenv.h
···55 *****************************************************************************/6677/*88- * Copyright (C) 2000 - 2010, Intel Corp.88+ * Copyright (C) 2000 - 2011, Intel Corp.99 * All rights reserved.1010 *1111 * Redistribution and use in source and binary forms, with or without
+1-1
include/acpi/platform/acgcc.h
···55 *****************************************************************************/6677/*88- * Copyright (C) 2000 - 2010, Intel Corp.88+ * Copyright (C) 2000 - 2011, Intel Corp.99 * All rights reserved.1010 *1111 * Redistribution and use in source and binary forms, with or without
+1-1
include/acpi/platform/aclinux.h
···55 *****************************************************************************/6677/*88- * Copyright (C) 2000 - 2010, Intel Corp.88+ * Copyright (C) 2000 - 2011, Intel Corp.99 * All rights reserved.1010 *1111 * Redistribution and use in source and binary forms, with or without
···101101#define get_irq_desc_msi(desc) ((desc)->irq_data.msi_desc)102102103103/*104104- * Monolithic do_IRQ implementation.105105- */106106-#ifndef CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ107107-extern unsigned int __do_IRQ(unsigned int irq);108108-#endif109109-110110-/*111104 * Architectures call this to let the generic IRQ layer112105 * handle an interrupt. If the descriptor is attached to an113106 * irqchip-style controller then we call the ->handle_irq() handler,···108115 */109116static inline void generic_handle_irq_desc(unsigned int irq, struct irq_desc *desc)110117{111111-#ifdef CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ112118 desc->handle_irq(irq, desc);113113-#else114114- if (likely(desc->handle_irq))115115- desc->handle_irq(irq, desc);116116- else117117- __do_IRQ(irq);118118-#endif119119}120120121121static inline void generic_handle_irq(unsigned int irq)
+2
include/linux/kernel.h
···243243extern unsigned long get_taint(void);244244extern int root_mountflags;245245246246+extern bool early_boot_irqs_disabled;247247+246248/* Values used for system_state */247249extern enum system_states {248250 SYSTEM_BOOTING,
···470470 page[1].lru.prev = (void *)order;471471}472472473473+#ifdef CONFIG_MMU473474/*474475 * Do pte_mkwrite, but only if the vma says VM_WRITE. We do this when475476 * servicing faults for write access. In the normal case, do always want···483482 pte = pte_mkwrite(pte);484483 return pte;485484}485485+#endif486486487487/*488488 * Multiple processes may "see" the same page. E.g. for untouched
+4-1
include/linux/quota.h
···322322 qsize_t *(*get_reserved_space) (struct inode *);323323};324324325325+struct path;326326+325327/* Operations handling requests from userspace */326328struct quotactl_ops {327327- int (*quota_on)(struct super_block *, int, int, char *);329329+ int (*quota_on)(struct super_block *, int, int, struct path *);330330+ int (*quota_on_meta)(struct super_block *, int, int);328331 int (*quota_off)(struct super_block *, int);329332 int (*quota_sync)(struct super_block *, int, int);330333 int (*get_info)(struct super_block *, int, struct if_dqinfo *);
+1-3
include/linux/quotaops.h
···76767777int dquot_file_open(struct inode *inode, struct file *file);78787979-int dquot_quota_on(struct super_block *sb, int type, int format_id,8080- char *path);8179int dquot_enable(struct inode *inode, int type, int format_id,8280 unsigned int flags);8383-int dquot_quota_on_path(struct super_block *sb, int type, int format_id,8181+int dquot_quota_on(struct super_block *sb, int type, int format_id,8482 struct path *path);8583int dquot_quota_on_mount(struct super_block *sb, char *qf_name,8684 int format_id, int type);
+17
include/media/mt9v011.h
···11+/* mt9v011 sensor22+ *33+ * Copyright (C) 2011 Hans Verkuil <hverkuil@xs4all.nl>44+ *55+ * This program is free software; you can redistribute it and/or modify66+ * it under the terms of the GNU General Public License version 2 as77+ * published by the Free Software Foundation.88+ */99+1010+#ifndef __MT9V011_H__1111+#define __MT9V011_H__1212+1313+struct mt9v011_platform_data {1414+ unsigned xtal; /* Hz */1515+};1616+1717+#endif
+3
include/media/rc-core.h
···183183}184184185185#define IR_MAX_DURATION 0xFFFFFFFF /* a bit more than 4 seconds */186186+#define US_TO_NS(usec) ((usec) * 1000)187187+#define MS_TO_US(msec) ((msec) * 1000)188188+#define MS_TO_NS(msec) ((msec) * 1000 * 1000)186189187190void ir_raw_event_handle(struct rc_dev *dev);188191int ir_raw_event_store(struct rc_dev *dev, struct ir_raw_event *ev);
···138138139139/* Load an i2c module and return an initialized v4l2_subdev struct.140140 The client_type argument is the name of the chip that's on the adapter. */141141-struct v4l2_subdev *v4l2_i2c_new_subdev_cfg(struct v4l2_device *v4l2_dev,141141+struct v4l2_subdev *v4l2_i2c_new_subdev(struct v4l2_device *v4l2_dev,142142 struct i2c_adapter *adapter, const char *client_type,143143- int irq, void *platform_data,144143 u8 addr, const unsigned short *probe_addrs);145145-146146-/* Load an i2c module and return an initialized v4l2_subdev struct.147147- The client_type argument is the name of the chip that's on the adapter. */148148-static inline struct v4l2_subdev *v4l2_i2c_new_subdev(struct v4l2_device *v4l2_dev,149149- struct i2c_adapter *adapter, const char *client_type,150150- u8 addr, const unsigned short *probe_addrs)151151-{152152- return v4l2_i2c_new_subdev_cfg(v4l2_dev, adapter, client_type, 0, NULL,153153- addr, probe_addrs);154154-}155144156145struct i2c_board_info;157146
+5-2
include/media/v4l2-ctrls.h
···23232424#include <linux/list.h>2525#include <linux/device.h>2626+#include <linux/videodev2.h>26272728/* forward references */2829struct v4l2_ctrl_handler;···5453 * @handler: The handler that owns the control.5554 * @cluster: Point to start of cluster array.5655 * @ncontrols: Number of controls in cluster array.5757- * @has_new: Internal flag: set when there is a valid new value.5856 * @done: Internal flag: set for each processed control.5757+ * @is_new: Set when the user specified a new value for this control. It5858+ * is also set when called from v4l2_ctrl_handler_setup. Drivers5959+ * should never set this flag.5960 * @is_private: If set, then this control is private to its handler and it6061 * will not be added to any other handlers. Drivers can set6162 * this flag.···10097 struct v4l2_ctrl_handler *handler;10198 struct v4l2_ctrl **cluster;10299 unsigned ncontrols;103103- unsigned int has_new:1;104100 unsigned int done:1;105101102102+ unsigned int is_new:1;106103 unsigned int is_private:1;107104 unsigned int is_volatile:1;108105
+18-5
include/media/v4l2-subdev.h
···106106 u8 strength; /* Pin drive strength */107107};108108109109-/* s_config: if set, then it is always called by the v4l2_i2c_new_subdev*110110- functions after the v4l2_subdev was registered. It is used to pass111111- platform data to the subdev which can be used during initialization.112112-109109+/*113110 s_io_pin_config: configure one or more chip I/O pins for chips that114111 multiplex different internal signal pads out to IO pins. This function115112 takes a pointer to an array of 'n' pin configuration entries, one for···138141struct v4l2_subdev_core_ops {139142 int (*g_chip_ident)(struct v4l2_subdev *sd, struct v4l2_dbg_chip_ident *chip);140143 int (*log_status)(struct v4l2_subdev *sd);141141- int (*s_config)(struct v4l2_subdev *sd, int irq, void *platform_data);142144 int (*s_io_pin_config)(struct v4l2_subdev *sd, size_t n,143145 struct v4l2_subdev_io_pin_config *pincfg);144146 int (*init)(struct v4l2_subdev *sd, u32 val);···411415 const struct v4l2_subdev_sensor_ops *sensor;412416};413417418418+/*419419+ * Internal ops. Never call this from drivers, only the v4l2 framework can call420420+ * these ops.421421+ *422422+ * registered: called when this subdev is registered. When called the v4l2_dev423423+ * field is set to the correct v4l2_device.424424+ *425425+ * unregistered: called when this subdev is unregistered. When called the426426+ * v4l2_dev field is still set to the correct v4l2_device.427427+ */428428+struct v4l2_subdev_internal_ops {429429+ int (*registered)(struct v4l2_subdev *sd);430430+ void (*unregistered)(struct v4l2_subdev *sd);431431+};432432+414433#define V4L2_SUBDEV_NAME_SIZE 32415434416435/* Set this flag if this subdev is a i2c device. */···442431 u32 flags;443432 struct v4l2_device *v4l2_dev;444433 const struct v4l2_subdev_ops *ops;434434+ /* Never call these internal ops from within a driver! */435435+ const struct v4l2_subdev_internal_ops *internal_ops;445436 /* The control handler of this subdev. May be NULL. */446437 struct v4l2_ctrl_handler *ctrl_handler;447438 /* name must be unique */
···745745endif # CGROUPS746746747747menuconfig NAMESPACES748748- bool "Namespaces support" if EMBEDDED749749- default !EMBEDDED748748+ bool "Namespaces support" if EXPERT749749+ default !EXPERT750750 help751751 Provides the way to make tasks work with different objects using752752 the same id. For example same IPC id may refer to different objects···899899config ANON_INODES900900 bool901901902902-menuconfig EMBEDDED903903- bool "Configure standard kernel features (for small systems)"902902+menuconfig EXPERT903903+ bool "Configure standard kernel features (expert users)"904904 help905905 This option allows certain base kernel options and settings906906 to be disabled or tweaked. This is for specialized907907 environments which can tolerate a "non-standard" kernel.908908 Only use this if you really know what you are doing.909909910910+config EMBEDDED911911+ bool "Embedded system"912912+ select EXPERT913913+ help914914+ This option should be enabled if compiling the kernel for915915+ an embedded system so certain expert options are available916916+ for configuration.917917+910918config UID16911911- bool "Enable 16-bit UID system calls" if EMBEDDED919919+ bool "Enable 16-bit UID system calls" if EXPERT912920 depends on ARM || BLACKFIN || CRIS || FRV || H8300 || X86_32 || M68K || (S390 && !64BIT) || SUPERH || SPARC32 || (SPARC64 && COMPAT) || UML || (X86_64 && IA32_EMULATION)913921 default y914922 help915923 This enables the legacy 16-bit UID syscall wrappers.916924917925config SYSCTL_SYSCALL918918- bool "Sysctl syscall support" if EMBEDDED926926+ bool "Sysctl syscall support" if EXPERT919927 depends on PROC_SYSCTL920928 default y921929 select SYSCTL···940932 If unsure say Y here.941933942934config KALLSYMS943943- bool "Load all symbols for debugging/ksymoops" if EMBEDDED935935+ bool "Load all symbols for debugging/ksymoops" if EXPERT944936 default y945937 help946938 Say Y here to let the kernel print out symbolic crash information and···971963972964973965config HOTPLUG974974- bool "Support for hot-pluggable devices" if EMBEDDED966966+ bool "Support for hot-pluggable devices" if EXPERT975967 default y976968 help977969 This option is provided for the case where no hotplug or uevent···981973982974config PRINTK983975 default y984984- bool "Enable support for printk" if EMBEDDED976976+ bool "Enable support for printk" if EXPERT985977 help986978 This option enables normal printk support. Removing it987979 eliminates most of the message strings from the kernel image···990982 strongly discouraged.991983992984config BUG993993- bool "BUG() support" if EMBEDDED985985+ bool "BUG() support" if EXPERT994986 default y995987 help996988 Disabling this option eliminates support for BUG and WARN, reducing···10019931002994config ELF_CORE1003995 default y10041004- bool "Enable ELF core dumps" if EMBEDDED996996+ bool "Enable ELF core dumps" if EXPERT1005997 help1006998 Enable support for generating core dumps. Disabling saves about 4k.100799910081000config PCSPKR_PLATFORM10091009- bool "Enable PC-Speaker support" if EMBEDDED10011001+ bool "Enable PC-Speaker support" if EXPERT10101002 depends on ALPHA || X86 || MIPS || PPC_PREP || PPC_CHRP || PPC_PSERIES10111003 default y10121004 help···1015100710161008config BASE_FULL10171009 default y10181018- bool "Enable full-sized data structures for core" if EMBEDDED10101010+ bool "Enable full-sized data structures for core" if EXPERT10191011 help10201012 Disabling this option reduces the size of miscellaneous core10211013 kernel data structures. This saves memory on small machines,10221014 but may reduce performance.1023101510241016config FUTEX10251025- bool "Enable futex support" if EMBEDDED10171017+ bool "Enable futex support" if EXPERT10261018 default y10271019 select RT_MUTEXES10281020 help···10311023 run glibc-based applications correctly.1032102410331025config EPOLL10341034- bool "Enable eventpoll support" if EMBEDDED10261026+ bool "Enable eventpoll support" if EXPERT10351027 default y10361028 select ANON_INODES10371029 help···10391031 support for epoll family of system calls.1040103210411033config SIGNALFD10421042- bool "Enable signalfd() system call" if EMBEDDED10341034+ bool "Enable signalfd() system call" if EXPERT10431035 select ANON_INODES10441036 default y10451037 help···10491041 If unsure, say Y.1050104210511043config TIMERFD10521052- bool "Enable timerfd() system call" if EMBEDDED10441044+ bool "Enable timerfd() system call" if EXPERT10531045 select ANON_INODES10541046 default y10551047 help···10591051 If unsure, say Y.1060105210611053config EVENTFD10621062- bool "Enable eventfd() system call" if EMBEDDED10541054+ bool "Enable eventfd() system call" if EXPERT10631055 select ANON_INODES10641056 default y10651057 help···10691061 If unsure, say Y.1070106210711063config SHMEM10721072- bool "Use full shmem filesystem" if EMBEDDED10641064+ bool "Use full shmem filesystem" if EXPERT10731065 default y10741066 depends on MMU10751067 help···10801072 which may be appropriate on small systems without swap.1081107310821074config AIO10831083- bool "Enable AIO support" if EMBEDDED10751075+ bool "Enable AIO support" if EXPERT10841076 default y10851077 help10861078 This option enables POSIX asynchronous I/O which may by used···1157114911581150config VM_EVENT_COUNTERS11591151 default y11601160- bool "Enable VM event counters for /proc/vmstat" if EMBEDDED11521152+ bool "Enable VM event counters for /proc/vmstat" if EXPERT11611153 help11621154 VM event counters are needed for event counts to be shown.11631155 This option allows the disabling of the VM event counters11641164- on EMBEDDED systems. /proc/vmstat will only show page counts11561156+ on EXPERT systems. /proc/vmstat will only show page counts11651157 if VM event counters are disabled.1166115811671159config PCI_QUIRKS11681160 default y11691169- bool "Enable PCI quirk workarounds" if EMBEDDED11611161+ bool "Enable PCI quirk workarounds" if EXPERT11701162 depends on PCI11711163 help11721164 This enables workarounds for various PCI chipset···1175116711761168config SLUB_DEBUG11771169 default y11781178- bool "Enable SLUB debugging support" if EMBEDDED11701170+ bool "Enable SLUB debugging support" if EXPERT11791171 depends on SLUB && SYSFS11801172 help11811173 SLUB has extensive debug support features. Disabling these can···12191211 a slab allocator.1220121212211213config SLOB12221222- depends on EMBEDDED12141214+ depends on EXPERT12231215 bool "SLOB (Simple Allocator)"12241216 help12251217 SLOB replaces the stock allocator with a drastically simpler···1230122212311223config MMAP_ALLOW_UNINITIALIZED12321224 bool "Allow mmapped anonymous memory to be uninitialized"12331233- depends on EMBEDDED && !MMU12251225+ depends on EXPERT && !MMU12341226 default n12351227 help12361228 Normally, and according to the Linux spec, anonymous memory obtained
+11-2
init/main.c
···9696extern void tc_init(void);9797#endif98989999+/*100100+ * Debug helper: via this flag we know that we are in 'early bootup code'101101+ * where only the boot processor is running with IRQ disabled. This means102102+ * two things - IRQ must not be enabled before the flag is cleared and some103103+ * operations which are not allowed with IRQ disabled are allowed while the104104+ * flag is set.105105+ */106106+bool early_boot_irqs_disabled __read_mostly;107107+99108enum system_states system_state __read_mostly;100109EXPORT_SYMBOL(system_state);101110···563554 cgroup_init_early();564555565556 local_irq_disable();566566- early_boot_irqs_off();557557+ early_boot_irqs_disabled = true;567558568559/*569560 * Interrupts are still disabled. Do necessary setups, then···630621 if (!irqs_disabled())631622 printk(KERN_CRIT "start_kernel(): bug: interrupts were "632623 "enabled early\n");633633- early_boot_irqs_on();624624+ early_boot_irqs_disabled = false;634625 local_irq_enable();635626636627 /* Interrupts are enabled now so all GFP allocations are safe. */
-3
kernel/irq/Kconfig
···99config GENERIC_HARDIRQS1010 def_bool y11111212-config GENERIC_HARDIRQS_NO__DO_IRQ1313- def_bool y1414-1512# Select this to disable the deprecated stuff1613config GENERIC_HARDIRQS_NO_DEPRECATED1714 def_bool n
-111
kernel/irq/handle.c
···118118119119 return retval;120120}121121-122122-#ifndef CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ123123-124124-#ifdef CONFIG_ENABLE_WARN_DEPRECATED125125-# warning __do_IRQ is deprecated. Please convert to proper flow handlers126126-#endif127127-128128-/**129129- * __do_IRQ - original all in one highlevel IRQ handler130130- * @irq: the interrupt number131131- *132132- * __do_IRQ handles all normal device IRQ's (the special133133- * SMP cross-CPU interrupts have their own specific134134- * handlers).135135- *136136- * This is the original x86 implementation which is used for every137137- * interrupt type.138138- */139139-unsigned int __do_IRQ(unsigned int irq)140140-{141141- struct irq_desc *desc = irq_to_desc(irq);142142- struct irqaction *action;143143- unsigned int status;144144-145145- kstat_incr_irqs_this_cpu(irq, desc);146146-147147- if (CHECK_IRQ_PER_CPU(desc->status)) {148148- irqreturn_t action_ret;149149-150150- /*151151- * No locking required for CPU-local interrupts:152152- */153153- if (desc->irq_data.chip->ack)154154- desc->irq_data.chip->ack(irq);155155- if (likely(!(desc->status & IRQ_DISABLED))) {156156- action_ret = handle_IRQ_event(irq, desc->action);157157- if (!noirqdebug)158158- note_interrupt(irq, desc, action_ret);159159- }160160- desc->irq_data.chip->end(irq);161161- return 1;162162- }163163-164164- raw_spin_lock(&desc->lock);165165- if (desc->irq_data.chip->ack)166166- desc->irq_data.chip->ack(irq);167167- /*168168- * REPLAY is when Linux resends an IRQ that was dropped earlier169169- * WAITING is used by probe to mark irqs that are being tested170170- */171171- status = desc->status & ~(IRQ_REPLAY | IRQ_WAITING);172172- status |= IRQ_PENDING; /* we _want_ to handle it */173173-174174- /*175175- * If the IRQ is disabled for whatever reason, we cannot176176- * use the action we have.177177- */178178- action = NULL;179179- if (likely(!(status & (IRQ_DISABLED | IRQ_INPROGRESS)))) {180180- action = desc->action;181181- status &= ~IRQ_PENDING; /* we commit to handling */182182- status |= IRQ_INPROGRESS; /* we are handling it */183183- }184184- desc->status = status;185185-186186- /*187187- * If there is no IRQ handler or it was disabled, exit early.188188- * Since we set PENDING, if another processor is handling189189- * a different instance of this same irq, the other processor190190- * will take care of it.191191- */192192- if (unlikely(!action))193193- goto out;194194-195195- /*196196- * Edge triggered interrupts need to remember197197- * pending events.198198- * This applies to any hw interrupts that allow a second199199- * instance of the same irq to arrive while we are in do_IRQ200200- * or in the handler. But the code here only handles the _second_201201- * instance of the irq, not the third or fourth. So it is mostly202202- * useful for irq hardware that does not mask cleanly in an203203- * SMP environment.204204- */205205- for (;;) {206206- irqreturn_t action_ret;207207-208208- raw_spin_unlock(&desc->lock);209209-210210- action_ret = handle_IRQ_event(irq, action);211211- if (!noirqdebug)212212- note_interrupt(irq, desc, action_ret);213213-214214- raw_spin_lock(&desc->lock);215215- if (likely(!(desc->status & IRQ_PENDING)))216216- break;217217- desc->status &= ~IRQ_PENDING;218218- }219219- desc->status &= ~IRQ_INPROGRESS;220220-221221-out:222222- /*223223- * The ->end() handler has to deal with interrupts which got224224- * disabled while the handler was running.225225- */226226- desc->irq_data.chip->end(irq);227227- raw_spin_unlock(&desc->lock);228228-229229- return 1;230230-}231231-#endif
+1-17
kernel/lockdep.c
···22922292}2293229322942294/*22952295- * Debugging helper: via this flag we know that we are in22962296- * 'early bootup code', and will warn about any invalid irqs-on event:22972297- */22982298-static int early_boot_irqs_enabled;22992299-23002300-void early_boot_irqs_off(void)23012301-{23022302- early_boot_irqs_enabled = 0;23032303-}23042304-23052305-void early_boot_irqs_on(void)23062306-{23072307- early_boot_irqs_enabled = 1;23082308-}23092309-23102310-/*23112295 * Hardirqs will be enabled:23122296 */23132297void trace_hardirqs_on_caller(unsigned long ip)···23032319 if (unlikely(!debug_locks || current->lockdep_recursion))23042320 return;2305232123062306- if (DEBUG_LOCKS_WARN_ON(unlikely(!early_boot_irqs_enabled)))23222322+ if (DEBUG_LOCKS_WARN_ON(unlikely(early_boot_irqs_disabled)))23072323 return;2308232423092325 if (unlikely(curr->hardirqs_enabled)) {
+21-5
kernel/sched.c
···553553 /* try_to_wake_up() stats */554554 unsigned int ttwu_count;555555 unsigned int ttwu_local;556556-557557- /* BKL stats */558558- unsigned int bkl_count;559556#endif560557};561558···605608{606609 struct task_group *tg;607610 struct cgroup_subsys_state *css;611611+612612+ if (p->flags & PF_EXITING)613613+ return &root_task_group;608614609615 css = task_subsys_state_check(p, cpu_cgroup_subsys_id,610616 lockdep_is_held(&task_rq(p)->lock));···38873887 schedstat_inc(this_rq(), sched_count);38883888#ifdef CONFIG_SCHEDSTATS38893889 if (unlikely(prev->lock_depth >= 0)) {38903890- schedstat_inc(this_rq(), bkl_count);38903890+ schedstat_inc(this_rq(), rq_sched_info.bkl_count);38913891 schedstat_inc(prev, sched_info.bkl_count);38923892 }38933893#endif···48714871 * assigned.48724872 */48734873 if (rt_bandwidth_enabled() && rt_policy(policy) &&48744874- task_group(p)->rt_bandwidth.rt_runtime == 0) {48744874+ task_group(p)->rt_bandwidth.rt_runtime == 0 &&48754875+ !task_group_is_autogroup(task_group(p))) {48754876 __task_rq_unlock(rq);48764877 raw_spin_unlock_irqrestore(&p->pi_lock, flags);48774878 return -EPERM;···88838882 }88848883}8885888488858885+static void88868886+cpu_cgroup_exit(struct cgroup_subsys *ss, struct task_struct *task)88878887+{88888888+ /*88898889+ * cgroup_exit() is called in the copy_process() failure path.88908890+ * Ignore this case since the task hasn't ran yet, this avoids88918891+ * trying to poke a half freed task state from generic code.88928892+ */88938893+ if (!(task->flags & PF_EXITING))88948894+ return;88958895+88968896+ sched_move_task(task);88978897+}88988898+88868899#ifdef CONFIG_FAIR_GROUP_SCHED88878900static int cpu_shares_write_u64(struct cgroup *cgrp, struct cftype *cftype,88888901 u64 shareval)···89698954 .destroy = cpu_cgroup_destroy,89708955 .can_attach = cpu_cgroup_can_attach,89718956 .attach = cpu_cgroup_attach,89578957+ .exit = cpu_cgroup_exit,89728958 .populate = cpu_cgroup_populate,89738959 .subsys_id = cpu_cgroup_subsys_id,89748960 .early_init = 1,
+32
kernel/sched_autogroup.c
···2727{2828 struct autogroup *ag = container_of(kref, struct autogroup, kref);29293030+#ifdef CONFIG_RT_GROUP_SCHED3131+ /* We've redirected RT tasks to the root task group... */3232+ ag->tg->rt_se = NULL;3333+ ag->tg->rt_rq = NULL;3434+#endif3035 sched_destroy_group(ag->tg);3136}3237···6055 return ag;6156}62575858+#ifdef CONFIG_RT_GROUP_SCHED5959+static void free_rt_sched_group(struct task_group *tg);6060+#endif6161+6362static inline struct autogroup *autogroup_create(void)6463{6564 struct autogroup *ag = kzalloc(sizeof(*ag), GFP_KERNEL);···8172 init_rwsem(&ag->lock);8273 ag->id = atomic_inc_return(&autogroup_seq_nr);8374 ag->tg = tg;7575+#ifdef CONFIG_RT_GROUP_SCHED7676+ /*7777+ * Autogroup RT tasks are redirected to the root task group7878+ * so we don't have to move tasks around upon policy change,7979+ * or flail around trying to allocate bandwidth on the fly.8080+ * A bandwidth exception in __sched_setscheduler() allows8181+ * the policy change to proceed. Thereafter, task_group()8282+ * returns &root_task_group, so zero bandwidth is required.8383+ */8484+ free_rt_sched_group(tg);8585+ tg->rt_se = root_task_group.rt_se;8686+ tg->rt_rq = root_task_group.rt_rq;8787+#endif8488 tg->autogroup = ag;85898690 return ag;···126104 return false;127105128106 return true;107107+}108108+109109+static inline bool task_group_is_autogroup(struct task_group *tg)110110+{111111+ return tg != &root_task_group && tg->autogroup;129112}130113131114static inline struct task_group *···258231#ifdef CONFIG_SCHED_DEBUG259232static inline int autogroup_path(struct task_group *tg, char *buf, int buflen)260233{234234+ int enabled = ACCESS_ONCE(sysctl_sched_autogroup_enabled);235235+236236+ if (!enabled || !tg->autogroup)237237+ return 0;238238+261239 return snprintf(buf, buflen, "%s-%ld", "/autogroup", tg->autogroup->id);262240}263241#endif /* CONFIG_SCHED_DEBUG */
···10621062 struct sched_entity *se = __pick_next_entity(cfs_rq);10631063 s64 delta = curr->vruntime - se->vruntime;1064106410651065+ if (delta < 0)10661066+ return;10671067+10651068 if (delta > ideal_runtime)10661069 resched_task(rq_of(cfs_rq)->curr);10671070 }···13651362 return wl;1366136313671364 for_each_sched_entity(se) {13681368- long S, rw, s, a, b;13651365+ long lw, w;1369136613701370- S = se->my_q->tg->shares;13711371- s = se->load.weight;13721372- rw = se->my_q->load.weight;13671367+ tg = se->my_q->tg;13681368+ w = se->my_q->load.weight;1373136913741374- a = S*(rw + wl);13751375- b = S*rw + s*wg;13701370+ /* use this cpu's instantaneous contribution */13711371+ lw = atomic_read(&tg->load_weight);13721372+ lw -= se->my_q->load_contribution;13731373+ lw += w + wg;1376137413771377- wl = s*(a-b);13751375+ wl += w;1378137613791379- if (likely(b))13801380- wl /= b;13771377+ if (lw > 0 && wl < lw)13781378+ wl = (wl * tg->shares) / lw;13791379+ else13801380+ wl = tg->shares;1381138113821382- /*13831383- * Assume the group is already running and will13841384- * thus already be accounted for in the weight.13851385- *13861386- * That is, moving shares between CPUs, does not13871387- * alter the group weight.13881388- */13821382+ /* zero point is MIN_SHARES */13831383+ if (wl < MIN_SHARES)13841384+ wl = MIN_SHARES;13851385+ wl -= se->load.weight;13891386 wg = 0;13901387 }13911388
+52-10
kernel/smp.c
···194194 */195195 list_for_each_entry_rcu(data, &call_function.queue, csd.list) {196196 int refs;197197+ void (*func) (void *info);197198198198- if (!cpumask_test_and_clear_cpu(cpu, data->cpumask))199199+ /*200200+ * Since we walk the list without any locks, we might201201+ * see an entry that was completed, removed from the202202+ * list and is in the process of being reused.203203+ *204204+ * We must check that the cpu is in the cpumask before205205+ * checking the refs, and both must be set before206206+ * executing the callback on this cpu.207207+ */208208+209209+ if (!cpumask_test_cpu(cpu, data->cpumask))199210 continue;200211212212+ smp_rmb();213213+214214+ if (atomic_read(&data->refs) == 0)215215+ continue;216216+217217+ func = data->csd.func; /* for later warn */201218 data->csd.func(data->csd.info);219219+220220+ /*221221+ * If the cpu mask is not still set then it enabled interrupts,222222+ * we took another smp interrupt, and executed the function223223+ * twice on this cpu. In theory that copy decremented refs.224224+ */225225+ if (!cpumask_test_and_clear_cpu(cpu, data->cpumask)) {226226+ WARN(1, "%pS enabled interrupts and double executed\n",227227+ func);228228+ continue;229229+ }202230203231 refs = atomic_dec_return(&data->refs);204232 WARN_ON(refs < 0);205205- if (!refs) {206206- raw_spin_lock(&call_function.lock);207207- list_del_rcu(&data->csd.list);208208- raw_spin_unlock(&call_function.lock);209209- }210233211234 if (refs)212235 continue;236236+237237+ WARN_ON(!cpumask_empty(data->cpumask));238238+239239+ raw_spin_lock(&call_function.lock);240240+ list_del_rcu(&data->csd.list);241241+ raw_spin_unlock(&call_function.lock);213242214243 csd_unlock(&data->csd);215244 }···459430 * can't happen.460431 */461432 WARN_ON_ONCE(cpu_online(this_cpu) && irqs_disabled()462462- && !oops_in_progress);433433+ && !oops_in_progress && !early_boot_irqs_disabled);463434464435 /* So, what's a CPU they want? Ignoring this one. */465436 cpu = cpumask_first_and(mask, cpu_online_mask);···483454484455 data = &__get_cpu_var(cfd_data);485456 csd_lock(&data->csd);457457+ BUG_ON(atomic_read(&data->refs) || !cpumask_empty(data->cpumask));486458487459 data->csd.func = func;488460 data->csd.info = info;489461 cpumask_and(data->cpumask, mask, cpu_online_mask);490462 cpumask_clear_cpu(this_cpu, data->cpumask);463463+464464+ /*465465+ * To ensure the interrupt handler gets an complete view466466+ * we order the cpumask and refs writes and order the read467467+ * of them in the interrupt handler. In addition we may468468+ * only clear our own cpu bit from the mask.469469+ */470470+ smp_wmb();471471+491472 atomic_set(&data->refs, cpumask_weight(data->cpumask));492473493474 raw_spin_lock_irqsave(&call_function.lock, flags);···572533#endif /* USE_GENERIC_SMP_HELPERS */573534574535/*575575- * Call a function on all processors536536+ * Call a function on all processors. May be used during early boot while537537+ * early_boot_irqs_disabled is set. Use local_irq_save/restore() instead538538+ * of local_irq_disable/enable().576539 */577540int on_each_cpu(void (*func) (void *info), void *info, int wait)578541{542542+ unsigned long flags;579543 int ret = 0;580544581545 preempt_disable();582546 ret = smp_call_function(func, info, wait);583583- local_irq_disable();547547+ local_irq_save(flags);584548 func(info);585585- local_irq_enable();549549+ local_irq_restore(flags);586550 preempt_enable();587551 return ret;588552}
···768768769769 worker->flags &= ~flags;770770771771- /* if transitioning out of NOT_RUNNING, increment nr_running */771771+ /*772772+ * If transitioning out of NOT_RUNNING, increment nr_running. Note773773+ * that the nested NOT_RUNNING is not a noop. NOT_RUNNING is mask774774+ * of multiple flags, not a single flag.775775+ */772776 if ((flags & WORKER_NOT_RUNNING) && (oflags & WORKER_NOT_RUNNING))773777 if (!(worker->flags & WORKER_NOT_RUNNING))774778 atomic_inc(get_gcwq_nr_running(gcwq->cpu));···18441840 spin_unlock_irq(&gcwq->lock);1845184118461842 work_clear_pending(work);18471847- lock_map_acquire(&cwq->wq->lockdep_map);18431843+ lock_map_acquire_read(&cwq->wq->lockdep_map);18481844 lock_map_acquire(&lockdep_map);18491845 trace_workqueue_execute_start(work);18501846 f(work);···23882384 insert_wq_barrier(cwq, barr, work, worker);23892385 spin_unlock_irq(&gcwq->lock);2390238623912391- lock_map_acquire(&cwq->wq->lockdep_map);23872387+ /*23882388+ * If @max_active is 1 or rescuer is in use, flushing another work23892389+ * item on the same workqueue may lead to deadlock. Make sure the23902390+ * flusher is not running on the same workqueue by verifying write23912391+ * access.23922392+ */23932393+ if (cwq->wq->saved_max_active == 1 || cwq->wq->flags & WQ_RESCUER)23942394+ lock_map_acquire(&cwq->wq->lockdep_map);23952395+ else23962396+ lock_map_acquire_read(&cwq->wq->lockdep_map);23922397 lock_map_release(&cwq->wq->lockdep_map);23982398+23932399 return true;23942400already_gone:23952401 spin_unlock_irq(&gcwq->lock);
+3-3
lib/Kconfig.debug
···657657 Disable for production systems.658658659659config DEBUG_BUGVERBOSE660660- bool "Verbose BUG() reporting (adds 70K)" if DEBUG_KERNEL && EMBEDDED660660+ bool "Verbose BUG() reporting (adds 70K)" if DEBUG_KERNEL && EXPERT661661 depends on BUG662662 depends on ARM || AVR32 || M32R || M68K || SPARC32 || SPARC64 || \663663 FRV || SUPERH || GENERIC_BUG || BLACKFIN || MN10300···729729 If unsure, say N.730730731731config DEBUG_MEMORY_INIT732732- bool "Debug memory initialisation" if EMBEDDED733733- default !EMBEDDED732732+ bool "Debug memory initialisation" if EXPERT733733+ default !EXPERT734734 help735735 Enable this for additional checks during memory initialisation.736736 The sanity checks verify aspects of the VM such as the memory model
+6-6
lib/xz/Kconfig
···77 CRC32 is supported. See Documentation/xz.txt for more information.8899config XZ_DEC_X861010- bool "x86 BCJ filter decoder" if EMBEDDED1010+ bool "x86 BCJ filter decoder" if EXPERT1111 default y1212 depends on XZ_DEC1313 select XZ_DEC_BCJ14141515config XZ_DEC_POWERPC1616- bool "PowerPC BCJ filter decoder" if EMBEDDED1616+ bool "PowerPC BCJ filter decoder" if EXPERT1717 default y1818 depends on XZ_DEC1919 select XZ_DEC_BCJ20202121config XZ_DEC_IA642222- bool "IA-64 BCJ filter decoder" if EMBEDDED2222+ bool "IA-64 BCJ filter decoder" if EXPERT2323 default y2424 depends on XZ_DEC2525 select XZ_DEC_BCJ26262727config XZ_DEC_ARM2828- bool "ARM BCJ filter decoder" if EMBEDDED2828+ bool "ARM BCJ filter decoder" if EXPERT2929 default y3030 depends on XZ_DEC3131 select XZ_DEC_BCJ32323333config XZ_DEC_ARMTHUMB3434- bool "ARM-Thumb BCJ filter decoder" if EMBEDDED3434+ bool "ARM-Thumb BCJ filter decoder" if EXPERT3535 default y3636 depends on XZ_DEC3737 select XZ_DEC_BCJ38383939config XZ_DEC_SPARC4040- bool "SPARC BCJ filter decoder" if EMBEDDED4040+ bool "SPARC BCJ filter decoder" if EXPERT4141 default y4242 depends on XZ_DEC4343 select XZ_DEC_BCJ
+11
mm/compaction.c
···406406 if (!zone_watermark_ok(zone, cc->order, watermark, 0, 0))407407 return COMPACT_CONTINUE;408408409409+ /*410410+ * order == -1 is expected when compacting via411411+ * /proc/sys/vm/compact_memory412412+ */409413 if (cc->order == -1)410414 return COMPACT_CONTINUE;411415···456452 watermark = low_wmark_pages(zone) + (2UL << order);457453 if (!zone_watermark_ok(zone, 0, watermark, 0, 0))458454 return COMPACT_SKIPPED;455455+456456+ /*457457+ * order == -1 is expected when compacting via458458+ * /proc/sys/vm/compact_memory459459+ */460460+ if (order == -1)461461+ return COMPACT_CONTINUE;459462460463 /*461464 * fragmentation index determines if allocation failures are due to
···600600}601601602602static void mem_cgroup_charge_statistics(struct mem_cgroup *mem,603603- struct page_cgroup *pc,604604- bool charge)603603+ bool file, int nr_pages)605604{606606- int val = (charge) ? 1 : -1;607607-608605 preempt_disable();609606610610- if (PageCgroupCache(pc))611611- __this_cpu_add(mem->stat->count[MEM_CGROUP_STAT_CACHE], val);607607+ if (file)608608+ __this_cpu_add(mem->stat->count[MEM_CGROUP_STAT_CACHE], nr_pages);612609 else613613- __this_cpu_add(mem->stat->count[MEM_CGROUP_STAT_RSS], val);610610+ __this_cpu_add(mem->stat->count[MEM_CGROUP_STAT_RSS], nr_pages);614611615615- if (charge)612612+ /* pagein of a big page is an event. So, ignore page size */613613+ if (nr_pages > 0)616614 __this_cpu_inc(mem->stat->count[MEM_CGROUP_STAT_PGPGIN_COUNT]);617615 else618616 __this_cpu_inc(mem->stat->count[MEM_CGROUP_STAT_PGPGOUT_COUNT]);619619- __this_cpu_inc(mem->stat->count[MEM_CGROUP_EVENTS]);617617+618618+ __this_cpu_add(mem->stat->count[MEM_CGROUP_EVENTS], nr_pages);620619621620 preempt_enable();622621}···814815 * removed from global LRU.815816 */816817 mz = page_cgroup_zoneinfo(pc);817817- MEM_CGROUP_ZSTAT(mz, lru) -= 1;818818+ /* huge page split is done under lru_lock. so, we have no races. */819819+ MEM_CGROUP_ZSTAT(mz, lru) -= 1 << compound_order(page);818820 if (mem_cgroup_is_root(pc->mem_cgroup))819821 return;820822 VM_BUG_ON(list_empty(&pc->lru));···836836 return;837837838838 pc = lookup_page_cgroup(page);839839- /*840840- * Used bit is set without atomic ops but after smp_wmb().841841- * For making pc->mem_cgroup visible, insert smp_rmb() here.842842- */843843- smp_rmb();844839 /* unused or root page is not rotated. */845845- if (!PageCgroupUsed(pc) || mem_cgroup_is_root(pc->mem_cgroup))840840+ if (!PageCgroupUsed(pc))841841+ return;842842+ /* Ensure pc->mem_cgroup is visible after reading PCG_USED. */843843+ smp_rmb();844844+ if (mem_cgroup_is_root(pc->mem_cgroup))846845 return;847846 mz = page_cgroup_zoneinfo(pc);848847 list_move(&pc->lru, &mz->lists[lru]);···856857 return;857858 pc = lookup_page_cgroup(page);858859 VM_BUG_ON(PageCgroupAcctLRU(pc));859859- /*860860- * Used bit is set without atomic ops but after smp_wmb().861861- * For making pc->mem_cgroup visible, insert smp_rmb() here.862862- */863863- smp_rmb();864860 if (!PageCgroupUsed(pc))865861 return;866866-862862+ /* Ensure pc->mem_cgroup is visible after reading PCG_USED. */863863+ smp_rmb();867864 mz = page_cgroup_zoneinfo(pc);868868- MEM_CGROUP_ZSTAT(mz, lru) += 1;865865+ /* huge page split is done under lru_lock. so, we have no races. */866866+ MEM_CGROUP_ZSTAT(mz, lru) += 1 << compound_order(page);869867 SetPageCgroupAcctLRU(pc);870868 if (mem_cgroup_is_root(pc->mem_cgroup))871869 return;···10261030 return NULL;1027103110281032 pc = lookup_page_cgroup(page);10291029- /*10301030- * Used bit is set without atomic ops but after smp_wmb().10311031- * For making pc->mem_cgroup visible, insert smp_rmb() here.10321032- */10331033- smp_rmb();10341033 if (!PageCgroupUsed(pc))10351034 return NULL;10361036-10351035+ /* Ensure pc->mem_cgroup is visible after reading PCG_USED. */10361036+ smp_rmb();10371037 mz = page_cgroup_zoneinfo(pc);10381038 if (!mz)10391039 return NULL;···16071615 if (unlikely(!mem || !PageCgroupUsed(pc)))16081616 goto out;16091617 /* pc->mem_cgroup is unstable ? */16101610- if (unlikely(mem_cgroup_stealed(mem))) {16181618+ if (unlikely(mem_cgroup_stealed(mem)) || PageTransHuge(page)) {16111619 /* take a lock against to access pc->mem_cgroup */16121620 move_lock_page_cgroup(pc, &flags);16131621 need_unlock = true;···20762084 return mem;20772085}2078208620792079-/*20802080- * commit a charge got by __mem_cgroup_try_charge() and makes page_cgroup to be20812081- * USED state. If already USED, uncharge and return.20822082- */20832083-static void ____mem_cgroup_commit_charge(struct mem_cgroup *mem,20842084- struct page_cgroup *pc,20852085- enum charge_type ctype)20872087+static void __mem_cgroup_commit_charge(struct mem_cgroup *mem,20882088+ struct page_cgroup *pc,20892089+ enum charge_type ctype,20902090+ int page_size)20862091{20922092+ int nr_pages = page_size >> PAGE_SHIFT;20932093+20942094+ /* try_charge() can return NULL to *memcg, taking care of it. */20952095+ if (!mem)20962096+ return;20972097+20982098+ lock_page_cgroup(pc);20992099+ if (unlikely(PageCgroupUsed(pc))) {21002100+ unlock_page_cgroup(pc);21012101+ mem_cgroup_cancel_charge(mem, page_size);21022102+ return;21032103+ }21042104+ /*21052105+ * we don't need page_cgroup_lock about tail pages, becase they are not21062106+ * accessed by any other context at this point.21072107+ */20872108 pc->mem_cgroup = mem;20882109 /*20892110 * We access a page_cgroup asynchronously without lock_page_cgroup().···21202115 break;21212116 }2122211721232123- mem_cgroup_charge_statistics(mem, pc, true);21242124-}21252125-21262126-static void __mem_cgroup_commit_charge(struct mem_cgroup *mem,21272127- struct page_cgroup *pc,21282128- enum charge_type ctype,21292129- int page_size)21302130-{21312131- int i;21322132- int count = page_size >> PAGE_SHIFT;21332133-21342134- /* try_charge() can return NULL to *memcg, taking care of it. */21352135- if (!mem)21362136- return;21372137-21382138- lock_page_cgroup(pc);21392139- if (unlikely(PageCgroupUsed(pc))) {21402140- unlock_page_cgroup(pc);21412141- mem_cgroup_cancel_charge(mem, page_size);21422142- return;21432143- }21442144-21452145- /*21462146- * we don't need page_cgroup_lock about tail pages, becase they are not21472147- * accessed by any other context at this point.21482148- */21492149- for (i = 0; i < count; i++)21502150- ____mem_cgroup_commit_charge(mem, pc + i, ctype);21512151-21182118+ mem_cgroup_charge_statistics(mem, PageCgroupCache(pc), nr_pages);21522119 unlock_page_cgroup(pc);21532120 /*21542121 * "charge_statistics" updated event counter. Then, check it.···21292152 */21302153 memcg_check_events(mem, pc->page);21312154}21552155+21562156+#ifdef CONFIG_TRANSPARENT_HUGEPAGE21572157+21582158+#define PCGF_NOCOPY_AT_SPLIT ((1 << PCG_LOCK) | (1 << PCG_MOVE_LOCK) |\21592159+ (1 << PCG_ACCT_LRU) | (1 << PCG_MIGRATION))21602160+/*21612161+ * Because tail pages are not marked as "used", set it. We're under21622162+ * zone->lru_lock, 'splitting on pmd' and compund_lock.21632163+ */21642164+void mem_cgroup_split_huge_fixup(struct page *head, struct page *tail)21652165+{21662166+ struct page_cgroup *head_pc = lookup_page_cgroup(head);21672167+ struct page_cgroup *tail_pc = lookup_page_cgroup(tail);21682168+ unsigned long flags;21692169+21702170+ /*21712171+ * We have no races with charge/uncharge but will have races with21722172+ * page state accounting.21732173+ */21742174+ move_lock_page_cgroup(head_pc, &flags);21752175+21762176+ tail_pc->mem_cgroup = head_pc->mem_cgroup;21772177+ smp_wmb(); /* see __commit_charge() */21782178+ if (PageCgroupAcctLRU(head_pc)) {21792179+ enum lru_list lru;21802180+ struct mem_cgroup_per_zone *mz;21812181+21822182+ /*21832183+ * LRU flags cannot be copied because we need to add tail21842184+ *.page to LRU by generic call and our hook will be called.21852185+ * We hold lru_lock, then, reduce counter directly.21862186+ */21872187+ lru = page_lru(head);21882188+ mz = page_cgroup_zoneinfo(head_pc);21892189+ MEM_CGROUP_ZSTAT(mz, lru) -= 1;21902190+ }21912191+ tail_pc->flags = head_pc->flags & ~PCGF_NOCOPY_AT_SPLIT;21922192+ move_unlock_page_cgroup(head_pc, &flags);21932193+}21942194+#endif2132219521332196/**21342197 * __mem_cgroup_move_account - move account of the page···21882171 */2189217221902173static void __mem_cgroup_move_account(struct page_cgroup *pc,21912191- struct mem_cgroup *from, struct mem_cgroup *to, bool uncharge)21742174+ struct mem_cgroup *from, struct mem_cgroup *to, bool uncharge,21752175+ int charge_size)21922176{21772177+ int nr_pages = charge_size >> PAGE_SHIFT;21782178+21932179 VM_BUG_ON(from == to);21942180 VM_BUG_ON(PageLRU(pc->page));21952181 VM_BUG_ON(!page_is_cgroup_locked(pc));···22062186 __this_cpu_inc(to->stat->count[MEM_CGROUP_STAT_FILE_MAPPED]);22072187 preempt_enable();22082188 }22092209- mem_cgroup_charge_statistics(from, pc, false);21892189+ mem_cgroup_charge_statistics(from, PageCgroupCache(pc), -nr_pages);22102190 if (uncharge)22112191 /* This is not "cancel", but cancel_charge does all we need. */22122212- mem_cgroup_cancel_charge(from, PAGE_SIZE);21922192+ mem_cgroup_cancel_charge(from, charge_size);2213219322142194 /* caller should have done css_get */22152195 pc->mem_cgroup = to;22162216- mem_cgroup_charge_statistics(to, pc, true);21962196+ mem_cgroup_charge_statistics(to, PageCgroupCache(pc), nr_pages);22172197 /*22182198 * We charges against "to" which may not have any tasks. Then, "to"22192199 * can be under rmdir(). But in current implementation, caller of···22282208 * __mem_cgroup_move_account()22292209 */22302210static int mem_cgroup_move_account(struct page_cgroup *pc,22312231- struct mem_cgroup *from, struct mem_cgroup *to, bool uncharge)22112211+ struct mem_cgroup *from, struct mem_cgroup *to,22122212+ bool uncharge, int charge_size)22322213{22332214 int ret = -EINVAL;22342215 unsigned long flags;2235221622172217+ if ((charge_size > PAGE_SIZE) && !PageTransHuge(pc->page))22182218+ return -EBUSY;22192219+22362220 lock_page_cgroup(pc);22372221 if (PageCgroupUsed(pc) && pc->mem_cgroup == from) {22382222 move_lock_page_cgroup(pc, &flags);22392239- __mem_cgroup_move_account(pc, from, to, uncharge);22232223+ __mem_cgroup_move_account(pc, from, to, uncharge, charge_size);22402224 move_unlock_page_cgroup(pc, &flags);22412225 ret = 0;22422226 }···22652241 struct cgroup *cg = child->css.cgroup;22662242 struct cgroup *pcg = cg->parent;22672243 struct mem_cgroup *parent;22442244+ int charge = PAGE_SIZE;22452245+ unsigned long flags;22682246 int ret;2269224722702248 /* Is ROOT ? */···22782252 goto out;22792253 if (isolate_lru_page(page))22802254 goto put;22552255+ /* The page is isolated from LRU and we have no race with splitting */22562256+ charge = PAGE_SIZE << compound_order(page);2281225722822258 parent = mem_cgroup_from_cont(pcg);22832283- ret = __mem_cgroup_try_charge(NULL, gfp_mask, &parent, false,22842284- PAGE_SIZE);22592259+ ret = __mem_cgroup_try_charge(NULL, gfp_mask, &parent, false, charge);22852260 if (ret || !parent)22862261 goto put_back;2287226222882288- ret = mem_cgroup_move_account(pc, child, parent, true);22632263+ if (charge > PAGE_SIZE)22642264+ flags = compound_lock_irqsave(page);22652265+22662266+ ret = mem_cgroup_move_account(pc, child, parent, true, charge);22892267 if (ret)22902290- mem_cgroup_cancel_charge(parent, PAGE_SIZE);22682268+ mem_cgroup_cancel_charge(parent, charge);22912269put_back:22702270+ if (charge > PAGE_SIZE)22712271+ compound_unlock_irqrestore(page, flags);22922272 putback_lru_page(page);22932273put:22942274 put_page(page);···25782546static struct mem_cgroup *25792547__mem_cgroup_uncharge_common(struct page *page, enum charge_type ctype)25802548{25812581- int i;25822549 int count;25832550 struct page_cgroup *pc;25842551 struct mem_cgroup *mem = NULL;···26272596 break;26282597 }2629259826302630- for (i = 0; i < count; i++)26312631- mem_cgroup_charge_statistics(mem, pc + i, false);25992599+ mem_cgroup_charge_statistics(mem, PageCgroupCache(pc), -count);2632260026332601 ClearPageCgroupUsed(pc);26342602 /*···48744844 goto put;48754845 pc = lookup_page_cgroup(page);48764846 if (!mem_cgroup_move_account(pc,48774877- mc.from, mc.to, false)) {48474847+ mc.from, mc.to, false, PAGE_SIZE)) {48784848 mc.precharge--;48794849 /* we uncharge from mc.from later. */48804850 mc.moved_charge++;
+5-6
mm/truncate.c
···549549 * @inode: inode550550 * @newsize: new file size551551 *552552- * truncate_setsize updastes i_size update and performs pagecache553553- * truncation (if necessary) for a file size updates. It will be554554- * typically be called from the filesystem's setattr function when555555- * ATTR_SIZE is passed in.552552+ * truncate_setsize updates i_size and performs pagecache truncation (if553553+ * necessary) to @newsize. It will be typically be called from the filesystem's554554+ * setattr function when ATTR_SIZE is passed in.556555 *557557- * Must be called with inode_mutex held and after all filesystem558558- * specific block truncation has been performed.556556+ * Must be called with inode_mutex held and before all filesystem specific557557+ * block truncation has been performed.559558 */560559void truncate_setsize(struct inode *inode, loff_t newsize)561560{
···2020 def_bool n21212222config MAC80211_RC_PID2323- bool "PID controller based rate control algorithm" if EMBEDDED2323+ bool "PID controller based rate control algorithm" if EXPERT2424 select MAC80211_HAS_RC2525 ---help---2626 This option enables a TX rate control algorithm for···2828 rate.29293030config MAC80211_RC_MINSTREL3131- bool "Minstrel" if EMBEDDED3131+ bool "Minstrel" if EXPERT3232 select MAC80211_HAS_RC3333 default y3434 ---help---3535 This option enables the 'minstrel' TX rate control algorithm36363737config MAC80211_RC_MINSTREL_HT3838- bool "Minstrel 802.11n support" if EMBEDDED3838+ bool "Minstrel 802.11n support" if EXPERT3939 depends on MAC80211_RC_MINSTREL4040 default y4141 ---help---
···3939MODULE_PARM_DESC(ieee80211_disable_40mhz_24ghz,4040 "Disable 40MHz support in the 2.4GHz band");41414242+static struct lock_class_key ieee80211_rx_skb_queue_class;4343+4244void ieee80211_configure_filter(struct ieee80211_local *local)4345{4446 u64 mc;···571569 spin_lock_init(&local->filter_lock);572570 spin_lock_init(&local->queue_stop_reason_lock);573571574574- skb_queue_head_init(&local->rx_skb_queue);572572+ /*573573+ * The rx_skb_queue is only accessed from tasklets,574574+ * but other SKB queues are used from within IRQ575575+ * context. Therefore, this one needs a different576576+ * locking class so our direct, non-irq-safe use of577577+ * the queue's lock doesn't throw lockdep warnings.578578+ */579579+ skb_queue_head_init_class(&local->rx_skb_queue,580580+ &ieee80211_rx_skb_queue_class);575581576582 INIT_DELAYED_WORK(&local->scan_work, ieee80211_scan_work);577583
+2-2
net/netfilter/nf_conntrack_netlink.c
···924924 u16 zone;925925 int err;926926927927- if ((nlh->nlmsg_flags & NLM_F_DUMP) == NLM_F_DUMP)927927+ if (nlh->nlmsg_flags & NLM_F_DUMP)928928 return netlink_dump_start(ctnl, skb, nlh, ctnetlink_dump_table,929929 ctnetlink_done);930930···17871787 u16 zone;17881788 int err;1789178917901790- if ((nlh->nlmsg_flags & NLM_F_DUMP) == NLM_F_DUMP) {17901790+ if (nlh->nlmsg_flags & NLM_F_DUMP) {17911791 return netlink_dump_start(ctnl, skb, nlh,17921792 ctnetlink_exp_dump_table,17931793 ctnetlink_exp_done);
+1-1
net/netlink/genetlink.c
···519519 security_netlink_recv(skb, CAP_NET_ADMIN))520520 return -EPERM;521521522522- if ((nlh->nlmsg_flags & NLM_F_DUMP) == NLM_F_DUMP) {522522+ if (nlh->nlmsg_flags & NLM_F_DUMP) {523523 if (ops->dumpit == NULL)524524 return -EOPNOTSUPP;525525
+2-2
net/rfkill/Kconfig
···1818 default y19192020config RFKILL_INPUT2121- bool "RF switch input support" if EMBEDDED2121+ bool "RF switch input support" if EXPERT2222 depends on RFKILL2323 depends on INPUT = y || RFKILL = INPUT2424- default y if !EMBEDDED2424+ default y if !EXPERT
+2-2
net/sctp/socket.c
···34283428 retval = sctp_setsockopt_peer_addr_params(sk, optval, optlen);34293429 break;3430343034313431- case SCTP_DELAYED_ACK:34313431+ case SCTP_DELAYED_SACK:34323432 retval = sctp_setsockopt_delayed_ack(sk, optval, optlen);34333433 break;34343434 case SCTP_PARTIAL_DELIVERY_POINT:···53335333 retval = sctp_getsockopt_peer_addr_params(sk, len, optval,53345334 optlen);53355335 break;53365336- case SCTP_DELAYED_ACK:53365336+ case SCTP_DELAYED_SACK:53375337 retval = sctp_getsockopt_delayed_ack(sk, len, optval,53385338 optlen);53395339 break;
+1-1
net/wireless/Kconfig
···9595 If unsure, say N.96969797config CFG80211_INTERNAL_REGDB9898- bool "use statically compiled regulatory rules database" if EMBEDDED9898+ bool "use statically compiled regulatory rules database" if EXPERT9999 default n100100 depends on CFG80211101101 ---help---
+1-1
net/xfrm/xfrm_user.c
···2189218921902190 if ((type == (XFRM_MSG_GETSA - XFRM_MSG_BASE) ||21912191 type == (XFRM_MSG_GETPOLICY - XFRM_MSG_BASE)) &&21922192- (nlh->nlmsg_flags & NLM_F_DUMP) == NLM_F_DUMP) {21922192+ (nlh->nlmsg_flags & NLM_F_DUMP)) {21932193 if (link->dump == NULL)21942194 return -EINVAL;21952195
+8-9
security/keys/compat.c
···11-/* compat.c: 32-bit compatibility syscall for 64-bit systems11+/* 32-bit compatibility syscall for 64-bit systems22 *33 * Copyright (C) 2004-5 Red Hat, Inc. All Rights Reserved.44 * Written by David Howells (dhowells@redhat.com)···1414#include <linux/compat.h>1515#include "internal.h"16161717-/*****************************************************************************/1817/*1919- * the key control system call, 32-bit compatibility version for 64-bit archs2020- * - this should only be called if the 64-bit arch uses weird pointers in2121- * 32-bit mode or doesn't guarantee that the top 32-bits of the argument2222- * registers on taking a 32-bit syscall are zero2323- * - if you can, you should call sys_keyctl directly1818+ * The key control system call, 32-bit compatibility version for 64-bit archs1919+ *2020+ * This should only be called if the 64-bit arch uses weird pointers in 32-bit2121+ * mode or doesn't guarantee that the top 32-bits of the argument registers on2222+ * taking a 32-bit syscall are zero. If you can, you should call sys_keyctl()2323+ * directly.2424 */2525asmlinkage long compat_sys_keyctl(u32 option,2626 u32 arg2, u32 arg3, u32 arg4, u32 arg5)···8888 default:8989 return -EOPNOTSUPP;9090 }9191-9292-} /* end compat_sys_keyctl() */9191+}
···3232static time_t key_gc_new_timer;33333434/*3535- * Schedule a garbage collection run3636- * - precision isn't particularly important3535+ * Schedule a garbage collection run.3636+ * - time precision isn't particularly important3737 */3838void key_schedule_gc(time_t gc_at)3939{···6161}62626363/*6464- * Garbage collect pointers from a keyring6565- * - return true if we altered the keyring6464+ * Garbage collect pointers from a keyring.6565+ *6666+ * Return true if we altered the keyring.6667 */6768static bool key_gc_keyring(struct key *keyring, time_t limit)6869 __releases(key_serial_lock)···108107}109108110109/*111111- * Garbage collector for keys112112- * - this involves scanning the keyrings for dead, expired and revoked keys113113- * that have overstayed their welcome110110+ * Garbage collector for keys. This involves scanning the keyrings for dead,111111+ * expired and revoked keys that have overstayed their welcome114112 */115113static void key_garbage_collector(struct work_struct *work)116114{
+14-12
security/keys/internal.h
···11-/* internal.h: authentication token and access key management internal defs11+/* Authentication token and access key management internal defs22 *33 * Copyright (C) 2003-5, 2007 Red Hat, Inc. All Rights Reserved.44 * Written by David Howells (dhowells@redhat.com)···35353636/*****************************************************************************/3737/*3838- * keep track of keys for a user3939- * - this needs to be separate to user_struct to avoid a refcount-loop4040- * (user_struct pins some keyrings which pin this struct)4141- * - this also keeps track of keys under request from userspace for this UID3838+ * Keep track of keys for a user.3939+ *4040+ * This needs to be separate to user_struct to avoid a refcount-loop4141+ * (user_struct pins some keyrings which pin this struct).4242+ *4343+ * We also keep track of keys under request from userspace for this UID here.4244 */4345struct key_user {4446 struct rb_node node;···6462extern void key_user_put(struct key_user *user);65636664/*6767- * key quota limits6565+ * Key quota limits.6866 * - root has its own separate limits to everyone else6967 */7068extern unsigned key_quota_root_maxkeys;···148146extern void keyring_gc(struct key *keyring, time_t limit);149147extern void key_schedule_gc(time_t expiry_at);150148151151-/*152152- * check to see whether permission is granted to use a key in the desired way153153- */154149extern int key_task_permission(const key_ref_t key_ref,155150 const struct cred *cred,156151 key_perm_t perm);157152153153+/*154154+ * Check to see whether permission is granted to use a key in the desired way.155155+ */158156static inline int key_permission(const key_ref_t key_ref, key_perm_t perm)159157{160158 return key_task_permission(key_ref, current_cred(), perm);···170168#define KEY_ALL 0x3f /* all the above permissions */171169172170/*173173- * request_key authorisation171171+ * Authorisation record for request_key().174172 */175173struct request_key_auth {176174 struct key *target_key;···190188extern struct key *key_get_instantiation_authkey(key_serial_t target_id);191189192190/*193193- * keyctl functions191191+ * keyctl() functions194192 */195193extern long keyctl_get_keyring_ID(key_serial_t, int);196194extern long keyctl_join_session_keyring(const char __user *);···216214extern long keyctl_session_to_parent(void);217215218216/*219219- * debugging key validation217217+ * Debugging key validation220218 */221219#ifdef KEY_DEBUGGING222220extern void __key_check(const struct key *);
+193-127
security/keys/key.c
···3939static void key_cleanup(struct work_struct *work);4040static DECLARE_WORK(key_cleanup_task, key_cleanup);41414242-/* we serialise key instantiation and link */4242+/* We serialise key instantiation and link */4343DEFINE_MUTEX(key_construction_mutex);44444545-/* any key who's type gets unegistered will be re-typed to this */4545+/* Any key who's type gets unegistered will be re-typed to this */4646static struct key_type key_type_dead = {4747 .name = "dead",4848};···5656}5757#endif58585959-/*****************************************************************************/6059/*6161- * get the key quota record for a user, allocating a new record if one doesn't6262- * already exist6060+ * Get the key quota record for a user, allocating a new record if one doesn't6161+ * already exist.6362 */6463struct key_user *key_user_lookup(uid_t uid, struct user_namespace *user_ns)6564{···6667 struct rb_node *parent = NULL;6768 struct rb_node **p;68696969- try_again:7070+try_again:7071 p = &key_user_tree.rb_node;7172 spin_lock(&key_user_lock);7273···123124 goto out;124125125126 /* okay - we found a user record for this UID */126126- found:127127+found:127128 atomic_inc(&user->usage);128129 spin_unlock(&key_user_lock);129130 kfree(candidate);130130- out:131131+out:131132 return user;133133+}132134133133-} /* end key_user_lookup() */134134-135135-/*****************************************************************************/136135/*137137- * dispose of a user structure136136+ * Dispose of a user structure138137 */139138void key_user_put(struct key_user *user)140139{···143146144147 kfree(user);145148 }149149+}146150147147-} /* end key_user_put() */148148-149149-/*****************************************************************************/150151/*151151- * assign a key the next unique serial number152152- * - these are assigned randomly to avoid security issues through covert153153- * channel problems152152+ * Allocate a serial number for a key. These are assigned randomly to avoid153153+ * security issues through covert channel problems.154154 */155155static inline void key_alloc_serial(struct key *key)156156{···205211 if (key->serial < xkey->serial)206212 goto attempt_insertion;207213 }214214+}208215209209-} /* end key_alloc_serial() */210210-211211-/*****************************************************************************/212212-/*213213- * allocate a key of the specified type214214- * - update the user's quota to reflect the existence of the key215215- * - called from a key-type operation with key_types_sem read-locked by216216- * key_create_or_update()217217- * - this prevents unregistration of the key type218218- * - upon return the key is as yet uninstantiated; the caller needs to either219219- * instantiate the key or discard it before returning216216+/**217217+ * key_alloc - Allocate a key of the specified type.218218+ * @type: The type of key to allocate.219219+ * @desc: The key description to allow the key to be searched out.220220+ * @uid: The owner of the new key.221221+ * @gid: The group ID for the new key's group permissions.222222+ * @cred: The credentials specifying UID namespace.223223+ * @perm: The permissions mask of the new key.224224+ * @flags: Flags specifying quota properties.225225+ *226226+ * Allocate a key of the specified type with the attributes given. The key is227227+ * returned in an uninstantiated state and the caller needs to instantiate the228228+ * key before returning.229229+ *230230+ * The user's key count quota is updated to reflect the creation of the key and231231+ * the user's key data quota has the default for the key type reserved. The232232+ * instantiation function should amend this as necessary. If insufficient233233+ * quota is available, -EDQUOT will be returned.234234+ *235235+ * The LSM security modules can prevent a key being created, in which case236236+ * -EACCES will be returned.237237+ *238238+ * Returns a pointer to the new key if successful and an error code otherwise.239239+ *240240+ * Note that the caller needs to ensure the key type isn't uninstantiated.241241+ * Internally this can be done by locking key_types_sem. Externally, this can242242+ * be done by either never unregistering the key type, or making sure243243+ * key_alloc() calls don't race with module unloading.220244 */221245struct key *key_alloc(struct key_type *type, const char *desc,222246 uid_t uid, gid_t gid, const struct cred *cred,···356344 key_user_put(user);357345 key = ERR_PTR(-EDQUOT);358346 goto error;359359-360360-} /* end key_alloc() */361361-347347+}362348EXPORT_SYMBOL(key_alloc);363349364364-/*****************************************************************************/365365-/*366366- * reserve an amount of quota for the key's payload350350+/**351351+ * key_payload_reserve - Adjust data quota reservation for the key's payload352352+ * @key: The key to make the reservation for.353353+ * @datalen: The amount of data payload the caller now wants.354354+ *355355+ * Adjust the amount of the owning user's key data quota that a key reserves.356356+ * If the amount is increased, then -EDQUOT may be returned if there isn't357357+ * enough free quota available.358358+ *359359+ * If successful, 0 is returned.367360 */368361int key_payload_reserve(struct key *key, size_t datalen)369362{···401384 key->datalen = datalen;402385403386 return ret;404404-405405-} /* end key_payload_reserve() */406406-387387+}407388EXPORT_SYMBOL(key_payload_reserve);408389409409-/*****************************************************************************/410390/*411411- * instantiate a key and link it into the target keyring atomically412412- * - called with the target keyring's semaphore writelocked391391+ * Instantiate a key and link it into the target keyring atomically. Must be392392+ * called with the target keyring's semaphore writelocked. The target key's393393+ * semaphore need not be locked as instantiation is serialised by394394+ * key_construction_mutex.413395 */414396static int __key_instantiate_and_link(struct key *key,415397 const void *data,···457441 wake_up_bit(&key->flags, KEY_FLAG_USER_CONSTRUCT);458442459443 return ret;444444+}460445461461-} /* end __key_instantiate_and_link() */462462-463463-/*****************************************************************************/464464-/*465465- * instantiate a key and link it into the target keyring atomically446446+/**447447+ * key_instantiate_and_link - Instantiate a key and link it into the keyring.448448+ * @key: The key to instantiate.449449+ * @data: The data to use to instantiate the keyring.450450+ * @datalen: The length of @data.451451+ * @keyring: Keyring to create a link in on success (or NULL).452452+ * @authkey: The authorisation token permitting instantiation.453453+ *454454+ * Instantiate a key that's in the uninstantiated state using the provided data455455+ * and, if successful, link it in to the destination keyring if one is456456+ * supplied.457457+ *458458+ * If successful, 0 is returned, the authorisation token is revoked and anyone459459+ * waiting for the key is woken up. If the key was already instantiated,460460+ * -EBUSY will be returned.466461 */467462int key_instantiate_and_link(struct key *key,468463 const void *data,···498471 __key_link_end(keyring, key->type, prealloc);499472500473 return ret;501501-502502-} /* end key_instantiate_and_link() */474474+}503475504476EXPORT_SYMBOL(key_instantiate_and_link);505477506506-/*****************************************************************************/507507-/*508508- * negatively instantiate a key and link it into the target keyring atomically478478+/**479479+ * key_negate_and_link - Negatively instantiate a key and link it into the keyring.480480+ * @key: The key to instantiate.481481+ * @timeout: The timeout on the negative key.482482+ * @keyring: Keyring to create a link in on success (or NULL).483483+ * @authkey: The authorisation token permitting instantiation.484484+ *485485+ * Negatively instantiate a key that's in the uninstantiated state and, if486486+ * successful, set its timeout and link it in to the destination keyring if one487487+ * is supplied. The key and any links to the key will be automatically garbage488488+ * collected after the timeout expires.489489+ *490490+ * Negative keys are used to rate limit repeated request_key() calls by causing491491+ * them to return -ENOKEY until the negative key expires.492492+ *493493+ * If successful, 0 is returned, the authorisation token is revoked and anyone494494+ * waiting for the key is woken up. If the key was already instantiated,495495+ * -EBUSY will be returned.509496 */510497int key_negate_and_link(struct key *key,511498 unsigned timeout,···576535 wake_up_bit(&key->flags, KEY_FLAG_USER_CONSTRUCT);577536578537 return ret == 0 ? link_ret : ret;579579-580580-} /* end key_negate_and_link() */538538+}581539582540EXPORT_SYMBOL(key_negate_and_link);583541584584-/*****************************************************************************/585542/*586586- * do cleaning up in process context so that we don't have to disable587587- * interrupts all over the place543543+ * Garbage collect keys in process context so that we don't have to disable544544+ * interrupts all over the place.545545+ *546546+ * key_put() schedules this rather than trying to do the cleanup itself, which547547+ * means key_put() doesn't have to sleep.588548 */589549static void key_cleanup(struct work_struct *work)590550{591551 struct rb_node *_n;592552 struct key *key;593553594594- go_again:554554+go_again:595555 /* look for a dead key in the tree */596556 spin_lock(&key_serial_lock);597557···606564 spin_unlock(&key_serial_lock);607565 return;608566609609- found_dead_key:567567+found_dead_key:610568 /* we found a dead key - once we've removed it from the tree, we can611569 * drop the lock */612570 rb_erase(&key->serial_node, &key_serial_tree);···643601644602 /* there may, of course, be more than one key to destroy */645603 goto go_again;604604+}646605647647-} /* end key_cleanup() */648648-649649-/*****************************************************************************/650650-/*651651- * dispose of a reference to a key652652- * - when all the references are gone, we schedule the cleanup task to come and653653- * pull it out of the tree in definite process context606606+/**607607+ * key_put - Discard a reference to a key.608608+ * @key: The key to discard a reference from.609609+ *610610+ * Discard a reference to a key, and when all the references are gone, we611611+ * schedule the cleanup task to come and pull it out of the tree in process612612+ * context at some later time.654613 */655614void key_put(struct key *key)656615{···661618 if (atomic_dec_and_test(&key->usage))662619 schedule_work(&key_cleanup_task);663620 }664664-665665-} /* end key_put() */666666-621621+}667622EXPORT_SYMBOL(key_put);668623669669-/*****************************************************************************/670624/*671671- * find a key by its serial number625625+ * Find a key by its serial number.672626 */673627struct key *key_lookup(key_serial_t id)674628{···687647 goto found;688648 }689649690690- not_found:650650+not_found:691651 key = ERR_PTR(-ENOKEY);692652 goto error;693653694694- found:654654+found:695655 /* pretend it doesn't exist if it is awaiting deletion */696656 if (atomic_read(&key->usage) == 0)697657 goto not_found;···701661 */702662 atomic_inc(&key->usage);703663704704- error:664664+error:705665 spin_unlock(&key_serial_lock);706666 return key;667667+}707668708708-} /* end key_lookup() */709709-710710-/*****************************************************************************/711669/*712712- * find and lock the specified key type against removal713713- * - we return with the sem readlocked670670+ * Find and lock the specified key type against removal.671671+ *672672+ * We return with the sem read-locked if successful. If the type wasn't673673+ * available -ENOKEY is returned instead.714674 */715675struct key_type *key_type_lookup(const char *type)716676{···728688 up_read(&key_types_sem);729689 ktype = ERR_PTR(-ENOKEY);730690731731- found_kernel_type:691691+found_kernel_type:732692 return ktype;693693+}733694734734-} /* end key_type_lookup() */735735-736736-/*****************************************************************************/737695/*738738- * unlock a key type696696+ * Unlock a key type locked by key_type_lookup().739697 */740698void key_type_put(struct key_type *ktype)741699{742700 up_read(&key_types_sem);701701+}743702744744-} /* end key_type_put() */745745-746746-/*****************************************************************************/747703/*748748- * attempt to update an existing key749749- * - the key has an incremented refcount750750- * - we need to put the key if we get an error704704+ * Attempt to update an existing key.705705+ *706706+ * The key is given to us with an incremented refcount that we need to discard707707+ * if we get an error.751708 */752709static inline key_ref_t __key_update(key_ref_t key_ref,753710 const void *payload, size_t plen)···779742 key_put(key);780743 key_ref = ERR_PTR(ret);781744 goto out;745745+}782746783783-} /* end __key_update() */784784-785785-/*****************************************************************************/786786-/*787787- * search the specified keyring for a key of the same description; if one is788788- * found, update it, otherwise add a new one747747+/**748748+ * key_create_or_update - Update or create and instantiate a key.749749+ * @keyring_ref: A pointer to the destination keyring with possession flag.750750+ * @type: The type of key.751751+ * @description: The searchable description for the key.752752+ * @payload: The data to use to instantiate or update the key.753753+ * @plen: The length of @payload.754754+ * @perm: The permissions mask for a new key.755755+ * @flags: The quota flags for a new key.756756+ *757757+ * Search the destination keyring for a key of the same description and if one758758+ * is found, update it, otherwise create and instantiate a new one and create a759759+ * link to it from that keyring.760760+ *761761+ * If perm is KEY_PERM_UNDEF then an appropriate key permissions mask will be762762+ * concocted.763763+ *764764+ * Returns a pointer to the new key if successful, -ENODEV if the key type765765+ * wasn't available, -ENOTDIR if the keyring wasn't a keyring, -EACCES if the766766+ * caller isn't permitted to modify the keyring or the LSM did not permit767767+ * creation of the key.768768+ *769769+ * On success, the possession flag from the keyring ref will be tacked on to770770+ * the key ref before it is returned.789771 */790772key_ref_t key_create_or_update(key_ref_t keyring_ref,791773 const char *type,···911855912856 key_ref = __key_update(key_ref, payload, plen);913857 goto error;914914-915915-} /* end key_create_or_update() */916916-858858+}917859EXPORT_SYMBOL(key_create_or_update);918860919919-/*****************************************************************************/920920-/*921921- * update a key861861+/**862862+ * key_update - Update a key's contents.863863+ * @key_ref: The pointer (plus possession flag) to the key.864864+ * @payload: The data to be used to update the key.865865+ * @plen: The length of @payload.866866+ *867867+ * Attempt to update the contents of a key with the given payload data. The868868+ * caller must be granted Write permission on the key. Negative keys can be869869+ * instantiated by this method.870870+ *871871+ * Returns 0 on success, -EACCES if not permitted and -EOPNOTSUPP if the key872872+ * type does not support updating. The key type may return other errors.922873 */923874int key_update(key_ref_t key_ref, const void *payload, size_t plen)924875{···954891955892 error:956893 return ret;957957-958958-} /* end key_update() */959959-894894+}960895EXPORT_SYMBOL(key_update);961896962962-/*****************************************************************************/963963-/*964964- * revoke a key897897+/**898898+ * key_revoke - Revoke a key.899899+ * @key: The key to be revoked.900900+ *901901+ * Mark a key as being revoked and ask the type to free up its resources. The902902+ * revocation timeout is set and the key and all its links will be903903+ * automatically garbage collected after key_gc_delay amount of time if they904904+ * are not manually dealt with first.965905 */966906void key_revoke(struct key *key)967907{···992926 }993927994928 up_write(&key->sem);995995-996996-} /* end key_revoke() */997997-929929+}998930EXPORT_SYMBOL(key_revoke);99993110001000-/*****************************************************************************/10011001-/*10021002- * register a type of key932932+/**933933+ * register_key_type - Register a type of key.934934+ * @ktype: The new key type.935935+ *936936+ * Register a new key type.937937+ *938938+ * Returns 0 on success or -EEXIST if a type of this name already exists.1003939 */1004940int register_key_type(struct key_type *ktype)1005941{···1021953 list_add(&ktype->link, &key_types_list);1022954 ret = 0;102395510241024- out:956956+out:1025957 up_write(&key_types_sem);1026958 return ret;10271027-10281028-} /* end register_key_type() */10291029-959959+}1030960EXPORT_SYMBOL(register_key_type);103196110321032-/*****************************************************************************/10331033-/*10341034- * unregister a type of key962962+/**963963+ * unregister_key_type - Unregister a type of key.964964+ * @ktype: The key type.965965+ *966966+ * Unregister a key type and mark all the extant keys of this type as dead.967967+ * Those keys of this type are then destroyed to get rid of their payloads and968968+ * they and their links will be garbage collected as soon as possible.1035969 */1036970void unregister_key_type(struct key_type *ktype)1037971{···10801010 up_write(&key_types_sem);1081101110821012 key_schedule_gc(0);10831083-10841084-} /* end unregister_key_type() */10851085-10131013+}10861014EXPORT_SYMBOL(unregister_key_type);1087101510881088-/*****************************************************************************/10891016/*10901090- * initialise the key management stuff10171017+ * Initialise the key management state.10911018 */10921019void __init key_init(void)10931020{···1104103711051038 rb_insert_color(&root_key_user.node,11061039 &key_user_tree);11071107-11081108-} /* end key_init() */10401040+}
+205-150
security/keys/keyctl.c
···11-/* keyctl.c: userspace keyctl operations11+/* Userspace key control operations22 *33 * Copyright (C) 2004-5 Red Hat, Inc. All Rights Reserved.44 * Written by David Howells (dhowells@redhat.com)···3131 int ret;32323333 ret = strncpy_from_user(type, _type, len);3434-3534 if (ret < 0)3635 return ret;3737-3836 if (ret == 0 || ret >= len)3937 return -EINVAL;4040-4138 if (type[0] == '.')4239 return -EPERM;4343-4440 type[len - 1] = '\0';4545-4641 return 0;4742}48434949-/*****************************************************************************/5044/*5151- * extract the description of a new key from userspace and either add it as a5252- * new key to the specified keyring or update a matching key in that keyring5353- * - the keyring must be writable5454- * - returns the new key's serial number5555- * - implements add_key()4545+ * Extract the description of a new key from userspace and either add it as a4646+ * new key to the specified keyring or update a matching key in that keyring.4747+ *4848+ * The keyring must be writable so that we can attach the key to it.4949+ *5050+ * If successful, the new key's serial number is returned, otherwise an error5151+ * code is returned.5652 */5753SYSCALL_DEFINE5(add_key, const char __user *, _type,5854 const char __user *, _description,···128132 kfree(description);129133 error:130134 return ret;135135+}131136132132-} /* end sys_add_key() */133133-134134-/*****************************************************************************/135137/*136136- * search the process keyrings for a matching key137137- * - nested keyrings may also be searched if they have Search permission138138- * - if a key is found, it will be attached to the destination keyring if139139- * there's one specified140140- * - /sbin/request-key will be invoked if _callout_info is non-NULL141141- * - the _callout_info string will be passed to /sbin/request-key142142- * - if the _callout_info string is empty, it will be rendered as "-"143143- * - implements request_key()138138+ * Search the process keyrings and keyring trees linked from those for a139139+ * matching key. Keyrings must have appropriate Search permission to be140140+ * searched.141141+ *142142+ * If a key is found, it will be attached to the destination keyring if there's143143+ * one specified and the serial number of the key will be returned.144144+ *145145+ * If no key is found, /sbin/request-key will be invoked if _callout_info is146146+ * non-NULL in an attempt to create a key. The _callout_info string will be147147+ * passed to /sbin/request-key to aid with completing the request. If the148148+ * _callout_info string is "" then it will be changed to "-".144149 */145150SYSCALL_DEFINE4(request_key, const char __user *, _type,146151 const char __user *, _description,···219222 kfree(description);220223error:221224 return ret;225225+}222226223223-} /* end sys_request_key() */224224-225225-/*****************************************************************************/226227/*227227- * get the ID of the specified process keyring228228- * - the keyring must have search permission to be found229229- * - implements keyctl(KEYCTL_GET_KEYRING_ID)228228+ * Get the ID of the specified process keyring.229229+ *230230+ * The requested keyring must have search permission to be found.231231+ *232232+ * If successful, the ID of the requested keyring will be returned.230233 */231234long keyctl_get_keyring_ID(key_serial_t id, int create)232235{···245248 key_ref_put(key_ref);246249error:247250 return ret;251251+}248252249249-} /* end keyctl_get_keyring_ID() */250250-251251-/*****************************************************************************/252253/*253253- * join the session keyring254254- * - implements keyctl(KEYCTL_JOIN_SESSION_KEYRING)254254+ * Join a (named) session keyring.255255+ *256256+ * Create and join an anonymous session keyring or join a named session257257+ * keyring, creating it if necessary. A named session keyring must have Search258258+ * permission for it to be joined. Session keyrings without this permit will259259+ * be skipped over.260260+ *261261+ * If successful, the ID of the joined session keyring will be returned.255262 */256263long keyctl_join_session_keyring(const char __user *_name)257264{···278277279278error:280279 return ret;280280+}281281282282-} /* end keyctl_join_session_keyring() */283283-284284-/*****************************************************************************/285282/*286286- * update a key's data payload287287- * - the key must be writable288288- * - implements keyctl(KEYCTL_UPDATE)283283+ * Update a key's data payload from the given data.284284+ *285285+ * The key must grant the caller Write permission and the key type must support286286+ * updating for this to work. A negative key can be positively instantiated287287+ * with this call.288288+ *289289+ * If successful, 0 will be returned. If the key type does not support290290+ * updating, then -EOPNOTSUPP will be returned.289291 */290292long keyctl_update_key(key_serial_t id,291293 const void __user *_payload,···330326 kfree(payload);331327error:332328 return ret;329329+}333330334334-} /* end keyctl_update_key() */335335-336336-/*****************************************************************************/337331/*338338- * revoke a key339339- * - the key must be writable340340- * - implements keyctl(KEYCTL_REVOKE)332332+ * Revoke a key.333333+ *334334+ * The key must be grant the caller Write or Setattr permission for this to335335+ * work. The key type should give up its quota claim when revoked. The key336336+ * and any links to the key will be automatically garbage collected after a337337+ * certain amount of time (/proc/sys/kernel/keys/gc_delay).338338+ *339339+ * If successful, 0 is returned.341340 */342341long keyctl_revoke_key(key_serial_t id)343342{···365358 key_ref_put(key_ref);366359error:367360 return ret;361361+}368362369369-} /* end keyctl_revoke_key() */370370-371371-/*****************************************************************************/372363/*373373- * clear the specified process keyring374374- * - the keyring must be writable375375- * - implements keyctl(KEYCTL_CLEAR)364364+ * Clear the specified keyring, creating an empty process keyring if one of the365365+ * special keyring IDs is used.366366+ *367367+ * The keyring must grant the caller Write permission for this to work. If368368+ * successful, 0 will be returned.376369 */377370long keyctl_keyring_clear(key_serial_t ringid)378371{···390383 key_ref_put(keyring_ref);391384error:392385 return ret;386386+}393387394394-} /* end keyctl_keyring_clear() */395395-396396-/*****************************************************************************/397388/*398398- * link a key into a keyring399399- * - the keyring must be writable400400- * - the key must be linkable401401- * - implements keyctl(KEYCTL_LINK)389389+ * Create a link from a keyring to a key if there's no matching key in the390390+ * keyring, otherwise replace the link to the matching key with a link to the391391+ * new key.392392+ *393393+ * The key must grant the caller Link permission and the the keyring must grant394394+ * the caller Write permission. Furthermore, if an additional link is created,395395+ * the keyring's quota will be extended.396396+ *397397+ * If successful, 0 will be returned.402398 */403399long keyctl_keyring_link(key_serial_t id, key_serial_t ringid)404400{···427417 key_ref_put(keyring_ref);428418error:429419 return ret;420420+}430421431431-} /* end keyctl_keyring_link() */432432-433433-/*****************************************************************************/434422/*435435- * unlink the first attachment of a key from a keyring436436- * - the keyring must be writable437437- * - we don't need any permissions on the key438438- * - implements keyctl(KEYCTL_UNLINK)423423+ * Unlink a key from a keyring.424424+ *425425+ * The keyring must grant the caller Write permission for this to work; the key426426+ * itself need not grant the caller anything. If the last link to a key is427427+ * removed then that key will be scheduled for destruction.428428+ *429429+ * If successful, 0 will be returned.439430 */440431long keyctl_keyring_unlink(key_serial_t id, key_serial_t ringid)441432{···462451 key_ref_put(keyring_ref);463452error:464453 return ret;454454+}465455466466-} /* end keyctl_keyring_unlink() */467467-468468-/*****************************************************************************/469456/*470470- * describe a user key471471- * - the key must have view permission472472- * - if there's a buffer, we place up to buflen bytes of data into it473473- * - unless there's an error, we return the amount of description available,474474- * irrespective of how much we may have copied475475- * - the description is formatted thus:457457+ * Return a description of a key to userspace.458458+ *459459+ * The key must grant the caller View permission for this to work.460460+ *461461+ * If there's a buffer, we place up to buflen bytes of data into it formatted462462+ * in the following way:463463+ *476464 * type;uid;gid;perm;description<NUL>477477- * - implements keyctl(KEYCTL_DESCRIBE)465465+ *466466+ * If successful, we return the amount of description available, irrespective467467+ * of how much we may have copied into the buffer.478468 */479469long keyctl_describe_key(key_serial_t keyid,480470 char __user *buffer,···543531 key_ref_put(key_ref);544532error:545533 return ret;534534+}546535547547-} /* end keyctl_describe_key() */548548-549549-/*****************************************************************************/550536/*551551- * search the specified keyring for a matching key552552- * - the start keyring must be searchable553553- * - nested keyrings may also be searched if they are searchable554554- * - only keys with search permission may be found555555- * - if a key is found, it will be attached to the destination keyring if556556- * there's one specified557557- * - implements keyctl(KEYCTL_SEARCH)537537+ * Search the specified keyring and any keyrings it links to for a matching538538+ * key. Only keyrings that grant the caller Search permission will be searched539539+ * (this includes the starting keyring). Only keys with Search permission can540540+ * be found.541541+ *542542+ * If successful, the found key will be linked to the destination keyring if543543+ * supplied and the key has Link permission, and the found key ID will be544544+ * returned.558545 */559546long keyctl_keyring_search(key_serial_t ringid,560547 const char __user *_type,···637626 kfree(description);638627error:639628 return ret;629629+}640630641641-} /* end keyctl_keyring_search() */642642-643643-/*****************************************************************************/644631/*645645- * read a user key's payload646646- * - the keyring must be readable or the key must be searchable from the647647- * process's keyrings648648- * - if there's a buffer, we place up to buflen bytes of data into it649649- * - unless there's an error, we return the amount of data in the key,650650- * irrespective of how much we may have copied651651- * - implements keyctl(KEYCTL_READ)632632+ * Read a key's payload.633633+ *634634+ * The key must either grant the caller Read permission, or it must grant the635635+ * caller Search permission when searched for from the process keyrings.636636+ *637637+ * If successful, we place up to buflen bytes of data into the buffer, if one638638+ * is provided, and return the amount of data that is available in the key,639639+ * irrespective of how much we copied into the buffer.652640 */653641long keyctl_read_key(key_serial_t keyid, char __user *buffer, size_t buflen)654642{···698688 key_put(key);699689error:700690 return ret;691691+}701692702702-} /* end keyctl_read_key() */703703-704704-/*****************************************************************************/705693/*706706- * change the ownership of a key707707- * - the keyring owned by the changer708708- * - if the uid or gid is -1, then that parameter is not changed709709- * - implements keyctl(KEYCTL_CHOWN)694694+ * Change the ownership of a key695695+ *696696+ * The key must grant the caller Setattr permission for this to work, though697697+ * the key need not be fully instantiated yet. For the UID to be changed, or698698+ * for the GID to be changed to a group the caller is not a member of, the699699+ * caller must have sysadmin capability. If either uid or gid is -1 then that700700+ * attribute is not changed.701701+ *702702+ * If the UID is to be changed, the new user must have sufficient quota to703703+ * accept the key. The quota deduction will be removed from the old user to704704+ * the new user should the attribute be changed.705705+ *706706+ * If successful, 0 will be returned.710707 */711708long keyctl_chown_key(key_serial_t id, uid_t uid, gid_t gid)712709{···813796 zapowner = newowner;814797 ret = -EDQUOT;815798 goto error_put;799799+}816800817817-} /* end keyctl_chown_key() */818818-819819-/*****************************************************************************/820801/*821821- * change the permission mask on a key822822- * - the keyring owned by the changer823823- * - implements keyctl(KEYCTL_SETPERM)802802+ * Change the permission mask on a key.803803+ *804804+ * The key must grant the caller Setattr permission for this to work, though805805+ * the key need not be fully instantiated yet. If the caller does not have806806+ * sysadmin capability, it may only change the permission on keys that it owns.824807 */825808long keyctl_setperm_key(key_serial_t id, key_perm_t perm)826809{···855838 key_put(key);856839error:857840 return ret;858858-859859-} /* end keyctl_setperm_key() */841841+}860842861843/*862862- * get the destination keyring for instantiation844844+ * Get the destination keyring for instantiation and check that the caller has845845+ * Write permission on it.863846 */864847static long get_instantiation_keyring(key_serial_t ringid,865848 struct request_key_auth *rka,···896879}897880898881/*899899- * change the request_key authorisation key on the current process882882+ * Change the request_key authorisation key on the current process.900883 */901884static int keyctl_change_reqkey_auth(struct key *key)902885{···912895 return commit_creds(new);913896}914897915915-/*****************************************************************************/916898/*917917- * instantiate the key with the specified payload, and, if one is given, link918918- * the key into the keyring899899+ * Instantiate a key with the specified payload and link the key into the900900+ * destination keyring if one is given.901901+ *902902+ * The caller must have the appropriate instantiation permit set for this to903903+ * work (see keyctl_assume_authority). No other permissions are required.904904+ *905905+ * If successful, 0 will be returned.919906 */920907long keyctl_instantiate_key(key_serial_t id,921908 const void __user *_payload,···994973 vfree(payload);995974error:996975 return ret;976976+}997977998998-} /* end keyctl_instantiate_key() */999999-10001000-/*****************************************************************************/1001978/*10021002- * negatively instantiate the key with the given timeout (in seconds), and, if10031003- * one is given, link the key into the keyring979979+ * Negatively instantiate the key with the given timeout (in seconds) and link980980+ * the key into the destination keyring if one is given.981981+ *982982+ * The caller must have the appropriate instantiation permit set for this to983983+ * work (see keyctl_assume_authority). No other permissions are required.984984+ *985985+ * The key and any links to the key will be automatically garbage collected986986+ * after the timeout expires.987987+ *988988+ * Negative keys are used to rate limit repeated request_key() calls by causing989989+ * them to return -ENOKEY until the negative key expires.990990+ *991991+ * If successful, 0 will be returned.1004992 */1005993long keyctl_negate_key(key_serial_t id, unsigned timeout, key_serial_t ringid)1006994{···1050102010511021error:10521022 return ret;10231023+}1053102410541054-} /* end keyctl_negate_key() */10551055-10561056-/*****************************************************************************/10571025/*10581058- * set the default keyring in which request_key() will cache keys10591059- * - return the old setting10261026+ * Read or set the default keyring in which request_key() will cache keys and10271027+ * return the old setting.10281028+ *10291029+ * If a process keyring is specified then this will be created if it doesn't10301030+ * yet exist. The old setting will be returned if successful.10601031 */10611032long keyctl_set_reqkey_keyring(int reqkey_defl)10621033{···11101079error:11111080 abort_creds(new);11121081 return ret;10821082+}1113108311141114-} /* end keyctl_set_reqkey_keyring() */11151115-11161116-/*****************************************************************************/11171084/*11181118- * set or clear the timeout for a key10851085+ * Set or clear the timeout on a key.10861086+ *10871087+ * Either the key must grant the caller Setattr permission or else the caller10881088+ * must hold an instantiation authorisation token for the key.10891089+ *10901090+ * The timeout is either 0 to clear the timeout, or a number of seconds from10911091+ * the current time. The key and any links to the key will be automatically10921092+ * garbage collected after the timeout expires.10931093+ *10941094+ * If successful, 0 is returned.11191095 */11201096long keyctl_set_timeout(key_serial_t id, unsigned timeout)11211097{···11741136 ret = 0;11751137error:11761138 return ret;11391139+}1177114011781178-} /* end keyctl_set_timeout() */11791179-11801180-/*****************************************************************************/11811141/*11821182- * assume the authority to instantiate the specified key11421142+ * Assume (or clear) the authority to instantiate the specified key.11431143+ *11441144+ * This sets the authoritative token currently in force for key instantiation.11451145+ * This must be done for a key to be instantiated. It has the effect of making11461146+ * available all the keys from the caller of the request_key() that created a11471147+ * key to request_key() calls made by the caller of this function.11481148+ *11491149+ * The caller must have the instantiation key in their process keyrings with a11501150+ * Search permission grant available to the caller.11511151+ *11521152+ * If the ID given is 0, then the setting will be cleared and 0 returned.11531153+ *11541154+ * If the ID given has a matching an authorisation key, then that key will be11551155+ * set and its ID will be returned. The authorisation key can be read to get11561156+ * the callout information passed to request_key().11831157 */11841158long keyctl_assume_authority(key_serial_t id)11851159{···12281178 ret = authkey->serial;12291179error:12301180 return ret;12311231-12321232-} /* end keyctl_assume_authority() */11811181+}1233118212341183/*12351235- * get the security label of a key12361236- * - the key must grant us view permission12371237- * - if there's a buffer, we place up to buflen bytes of data into it12381238- * - unless there's an error, we return the amount of information available,12391239- * irrespective of how much we may have copied (including the terminal NUL)12401240- * - implements keyctl(KEYCTL_GET_SECURITY)11841184+ * Get a key's the LSM security label.11851185+ *11861186+ * The key must grant the caller View permission for this to work.11871187+ *11881188+ * If there's a buffer, then up to buflen bytes of data will be placed into it.11891189+ *11901190+ * If successful, the amount of information available will be returned,11911191+ * irrespective of how much was copied (including the terminal NUL).12411192 */12421193long keyctl_get_security(key_serial_t keyid,12431194 char __user *buffer,···12931242}1294124312951244/*12961296- * attempt to install the calling process's session keyring on the process's12971297- * parent process12981298- * - the keyring must exist and must grant us LINK permission12991299- * - implements keyctl(KEYCTL_SESSION_TO_PARENT)12451245+ * Attempt to install the calling process's session keyring on the process's12461246+ * parent process.12471247+ *12481248+ * The keyring must exist and must grant the caller LINK permission, and the12491249+ * parent process must be single-threaded and must have the same effective12501250+ * ownership as this process and mustn't be SUID/SGID.12511251+ *12521252+ * The keyring will be emplaced on the parent when it next resumes userspace.12531253+ *12541254+ * If successful, 0 will be returned.13001255 */13011256long keyctl_session_to_parent(void)13021257{···14051348#endif /* !TIF_NOTIFY_RESUME */14061349}1407135014081408-/*****************************************************************************/14091351/*14101410- * the key control system call13521352+ * The key control system call14111353 */14121354SYSCALL_DEFINE5(keyctl, int, option, unsigned long, arg2, unsigned long, arg3,14131355 unsigned long, arg4, unsigned long, arg5)···14951439 default:14961440 return -EOPNOTSUPP;14971441 }14981498-14991499-} /* end sys_keyctl() */14421442+}
+175-120
security/keys/keyring.c
···2626 rwsem_is_locked((struct rw_semaphore *)&(keyring)->sem)))27272828/*2929- * when plumbing the depths of the key tree, this sets a hard limit set on how3030- * deep we're willing to go2929+ * When plumbing the depths of the key tree, this sets a hard limit3030+ * set on how deep we're willing to go.3131 */3232#define KEYRING_SEARCH_MAX_DEPTH 633333434/*3535- * we keep all named keyrings in a hash to speed looking them up3535+ * We keep all named keyrings in a hash to speed looking them up.3636 */3737#define KEYRING_NAME_HASH_SIZE (1 << 5)3838···5050}51515252/*5353- * the keyring type definition5353+ * The keyring key type definition. Keyrings are simply keys of this type and5454+ * can be treated as ordinary keys in addition to having their own special5555+ * operations.5456 */5557static int keyring_instantiate(struct key *keyring,5658 const void *data, size_t datalen);···7371 .describe = keyring_describe,7472 .read = keyring_read,7573};7676-7774EXPORT_SYMBOL(key_type_keyring);78757976/*8080- * semaphore to serialise link/link calls to prevent two link calls in parallel8181- * introducing a cycle7777+ * Semaphore to serialise link/link calls to prevent two link calls in parallel7878+ * introducing a cycle.8279 */8380static DECLARE_RWSEM(keyring_serialise_link_sem);84818585-/*****************************************************************************/8682/*8787- * publish the name of a keyring so that it can be found by name (if it has8888- * one)8383+ * Publish the name of a keyring so that it can be found by name (if it has8484+ * one).8985 */9086static void keyring_publish_name(struct key *keyring)9187{···102102103103 write_unlock(&keyring_name_lock);104104 }105105+}105106106106-} /* end keyring_publish_name() */107107-108108-/*****************************************************************************/109107/*110110- * initialise a keyring111111- * - we object if we were given any data108108+ * Initialise a keyring.109109+ *110110+ * Returns 0 on success, -EINVAL if given any data.112111 */113112static int keyring_instantiate(struct key *keyring,114113 const void *data, size_t datalen)···122123 }123124124125 return ret;126126+}125127126126-} /* end keyring_instantiate() */127127-128128-/*****************************************************************************/129128/*130130- * match keyrings on their name129129+ * Match keyrings on their name131130 */132131static int keyring_match(const struct key *keyring, const void *description)133132{134133 return keyring->description &&135134 strcmp(keyring->description, description) == 0;135135+}136136137137-} /* end keyring_match() */138138-139139-/*****************************************************************************/140137/*141141- * dispose of the data dangling from the corpse of a keyring138138+ * Clean up a keyring when it is destroyed. Unpublish its name if it had one139139+ * and dispose of its data.142140 */143141static void keyring_destroy(struct key *keyring)144142{···160164 key_put(klist->keys[loop]);161165 kfree(klist);162166 }167167+}163168164164-} /* end keyring_destroy() */165165-166166-/*****************************************************************************/167169/*168168- * describe the keyring170170+ * Describe a keyring for /proc.169171 */170172static void keyring_describe(const struct key *keyring, struct seq_file *m)171173{···181187 else182188 seq_puts(m, ": empty");183189 rcu_read_unlock();190190+}184191185185-} /* end keyring_describe() */186186-187187-/*****************************************************************************/188192/*189189- * read a list of key IDs from the keyring's contents190190- * - the keyring's semaphore is read-locked193193+ * Read a list of key IDs from the keyring's contents in binary form194194+ *195195+ * The keyring's semaphore is read-locked by the caller.191196 */192197static long keyring_read(const struct key *keyring,193198 char __user *buffer, size_t buflen)···234241235242error:236243 return ret;244244+}237245238238-} /* end keyring_read() */239239-240240-/*****************************************************************************/241246/*242242- * allocate a keyring and link into the destination keyring247247+ * Allocate a keyring and link into the destination keyring.243248 */244249struct key *keyring_alloc(const char *description, uid_t uid, gid_t gid,245250 const struct cred *cred, unsigned long flags,···260269 }261270262271 return keyring;272272+}263273264264-} /* end keyring_alloc() */265265-266266-/*****************************************************************************/267267-/*268268- * search the supplied keyring tree for a key that matches the criterion269269- * - perform a breadth-then-depth search up to the prescribed limit270270- * - we only find keys on which we have search permission271271- * - we use the supplied match function to see if the description (or other272272- * feature of interest) matches273273- * - we rely on RCU to prevent the keyring lists from disappearing on us274274- * - we return -EAGAIN if we didn't find any matching key275275- * - we return -ENOKEY if we only found negative matching keys276276- * - we propagate the possession attribute from the keyring ref to the key ref274274+/**275275+ * keyring_search_aux - Search a keyring tree for a key matching some criteria276276+ * @keyring_ref: A pointer to the keyring with possession indicator.277277+ * @cred: The credentials to use for permissions checks.278278+ * @type: The type of key to search for.279279+ * @description: Parameter for @match.280280+ * @match: Function to rule on whether or not a key is the one required.281281+ *282282+ * Search the supplied keyring tree for a key that matches the criteria given.283283+ * The root keyring and any linked keyrings must grant Search permission to the284284+ * caller to be searchable and keys can only be found if they too grant Search285285+ * to the caller. The possession flag on the root keyring pointer controls use286286+ * of the possessor bits in permissions checking of the entire tree. In287287+ * addition, the LSM gets to forbid keyring searches and key matches.288288+ *289289+ * The search is performed as a breadth-then-depth search up to the prescribed290290+ * limit (KEYRING_SEARCH_MAX_DEPTH).291291+ *292292+ * Keys are matched to the type provided and are then filtered by the match293293+ * function, which is given the description to use in any way it sees fit. The294294+ * match function may use any attributes of a key that it wishes to to295295+ * determine the match. Normally the match function from the key type would be296296+ * used.297297+ *298298+ * RCU is used to prevent the keyring key lists from disappearing without the299299+ * need to take lots of locks.300300+ *301301+ * Returns a pointer to the found key and increments the key usage count if302302+ * successful; -EAGAIN if no matching keys were found, or if expired or revoked303303+ * keys were found; -ENOKEY if only negative keys were found; -ENOTDIR if the304304+ * specified keyring wasn't a keyring.305305+ *306306+ * In the case of a successful return, the possession attribute from307307+ * @keyring_ref is propagated to the returned key reference.277308 */278309key_ref_t keyring_search_aux(key_ref_t keyring_ref,279310 const struct cred *cred,···457444 rcu_read_unlock();458445error:459446 return key_ref;447447+}460448461461-} /* end keyring_search_aux() */462462-463463-/*****************************************************************************/464464-/*465465- * search the supplied keyring tree for a key that matches the criterion466466- * - perform a breadth-then-depth search up to the prescribed limit467467- * - we only find keys on which we have search permission468468- * - we readlock the keyrings as we search down the tree469469- * - we return -EAGAIN if we didn't find any matching key470470- * - we return -ENOKEY if we only found negative matching keys449449+/**450450+ * keyring_search - Search the supplied keyring tree for a matching key451451+ * @keyring: The root of the keyring tree to be searched.452452+ * @type: The type of keyring we want to find.453453+ * @description: The name of the keyring we want to find.454454+ *455455+ * As keyring_search_aux() above, but using the current task's credentials and456456+ * type's default matching function.471457 */472458key_ref_t keyring_search(key_ref_t keyring,473459 struct key_type *type,···477465478466 return keyring_search_aux(keyring, current->cred,479467 type, description, type->match);480480-481481-} /* end keyring_search() */482482-468468+}483469EXPORT_SYMBOL(keyring_search);484470485485-/*****************************************************************************/486471/*487487- * search the given keyring only (no recursion)488488- * - keyring must be locked by caller489489- * - caller must guarantee that the keyring is a keyring472472+ * Search the given keyring only (no recursion).473473+ *474474+ * The caller must guarantee that the keyring is a keyring and that the475475+ * permission is granted to search the keyring as no check is made here.476476+ *477477+ * RCU is used to make it unnecessary to lock the keyring key list here.478478+ *479479+ * Returns a pointer to the found key with usage count incremented if480480+ * successful and returns -ENOKEY if not found. Revoked keys and keys not481481+ * providing the requested permission are skipped over.482482+ *483483+ * If successful, the possession indicator is propagated from the keyring ref484484+ * to the returned key reference.490485 */491486key_ref_t __keyring_search_one(key_ref_t keyring_ref,492487 const struct key_type *ktype,···533514 atomic_inc(&key->usage);534515 rcu_read_unlock();535516 return make_key_ref(key, possessed);517517+}536518537537-} /* end __keyring_search_one() */538538-539539-/*****************************************************************************/540519/*541541- * find a keyring with the specified name542542- * - all named keyrings are searched543543- * - normally only finds keyrings with search permission for the current process520520+ * Find a keyring with the specified name.521521+ *522522+ * All named keyrings in the current user namespace are searched, provided they523523+ * grant Search permission directly to the caller (unless this check is524524+ * skipped). Keyrings whose usage points have reached zero or who have been525525+ * revoked are skipped.526526+ *527527+ * Returns a pointer to the keyring with the keyring's refcount having being528528+ * incremented on success. -ENOKEY is returned if a key could not be found.544529 */545530struct key *find_keyring_by_name(const char *name, bool skip_perm_check)546531{···592569out:593570 read_unlock(&keyring_name_lock);594571 return keyring;572572+}595573596596-} /* end find_keyring_by_name() */597597-598598-/*****************************************************************************/599574/*600600- * see if a cycle will will be created by inserting acyclic tree B in acyclic601601- * tree A at the topmost level (ie: as a direct child of A)602602- * - since we are adding B to A at the top level, checking for cycles should603603- * just be a matter of seeing if node A is somewhere in tree B575575+ * See if a cycle will will be created by inserting acyclic tree B in acyclic576576+ * tree A at the topmost level (ie: as a direct child of A).577577+ *578578+ * Since we are adding B to A at the top level, checking for cycles should just579579+ * be a matter of seeing if node A is somewhere in tree B.604580 */605581static int keyring_detect_cycle(struct key *A, struct key *B)606582{···679657cycle_detected:680658 ret = -EDEADLK;681659 goto error;682682-683683-} /* end keyring_detect_cycle() */660660+}684661685662/*686686- * dispose of a keyring list after the RCU grace period, freeing the unlinked663663+ * Dispose of a keyring list after the RCU grace period, freeing the unlinked687664 * key688665 */689666static void keyring_unlink_rcu_disposal(struct rcu_head *rcu)···696675}697676698677/*699699- * preallocate memory so that a key can be linked into to a keyring678678+ * Preallocate memory so that a key can be linked into to a keyring.700679 */701680int __key_link_begin(struct key *keyring, const struct key_type *type,702681 const char *description,···813792}814793815794/*816816- * check already instantiated keys aren't going to be a problem817817- * - the caller must have called __key_link_begin()818818- * - don't need to call this for keys that were created since __key_link_begin()819819- * was called795795+ * Check already instantiated keys aren't going to be a problem.796796+ *797797+ * The caller must have called __key_link_begin(). Don't need to call this for798798+ * keys that were created since __key_link_begin() was called.820799 */821800int __key_link_check_live_key(struct key *keyring, struct key *key)822801{···828807}829808830809/*831831- * link a key into to a keyring832832- * - must be called with __key_link_begin() having being called833833- * - discard already extant link to matching key if there is one810810+ * Link a key into to a keyring.811811+ *812812+ * Must be called with __key_link_begin() having being called. Discards any813813+ * already extant link to matching key if there is one, so that each keyring814814+ * holds at most one link to any given key of a particular type+description815815+ * combination.834816 */835817void __key_link(struct key *keyring, struct key *key,836818 struct keyring_list **_prealloc)···876852}877853878854/*879879- * finish linking a key into to a keyring880880- * - must be called with __key_link_begin() having being called855855+ * Finish linking a key into to a keyring.856856+ *857857+ * Must be called with __key_link_begin() having being called.881858 */882859void __key_link_end(struct key *keyring, struct key_type *type,883860 struct keyring_list *prealloc)···899874 up_write(&keyring->sem);900875}901876902902-/*903903- * link a key to a keyring877877+/**878878+ * key_link - Link a key to a keyring879879+ * @keyring: The keyring to make the link in.880880+ * @key: The key to link to.881881+ *882882+ * Make a link in a keyring to a key, such that the keyring holds a reference883883+ * on that key and the key can potentially be found by searching that keyring.884884+ *885885+ * This function will write-lock the keyring's semaphore and will consume some886886+ * of the user's key data quota to hold the link.887887+ *888888+ * Returns 0 if successful, -ENOTDIR if the keyring isn't a keyring,889889+ * -EKEYREVOKED if the keyring has been revoked, -ENFILE if the keyring is890890+ * full, -EDQUOT if there is insufficient key data quota remaining to add891891+ * another link or -ENOMEM if there's insufficient memory.892892+ *893893+ * It is assumed that the caller has checked that it is permitted for a link to894894+ * be made (the keyring should have Write permission and the key Link895895+ * permission).904896 */905897int key_link(struct key *keyring, struct key *key)906898{···937895938896 return ret;939897}940940-941898EXPORT_SYMBOL(key_link);942899943943-/*****************************************************************************/944944-/*945945- * unlink the first link to a key from a keyring900900+/**901901+ * key_unlink - Unlink the first link to a key from a keyring.902902+ * @keyring: The keyring to remove the link from.903903+ * @key: The key the link is to.904904+ *905905+ * Remove a link from a keyring to a key.906906+ *907907+ * This function will write-lock the keyring's semaphore.908908+ *909909+ * Returns 0 if successful, -ENOTDIR if the keyring isn't a keyring, -ENOENT if910910+ * the key isn't linked to by the keyring or -ENOMEM if there's insufficient911911+ * memory.912912+ *913913+ * It is assumed that the caller has checked that it is permitted for a link to914914+ * be removed (the keyring should have Write permission; no permissions are915915+ * required on the key).946916 */947917int key_unlink(struct key *keyring, struct key *key)948918{···1022968 ret = -ENOMEM;1023969 up_write(&keyring->sem);1024970 goto error;10251025-10261026-} /* end key_unlink() */10271027-971971+}1028972EXPORT_SYMBOL(key_unlink);102997310301030-/*****************************************************************************/1031974/*10321032- * dispose of a keyring list after the RCU grace period, releasing the keys it10331033- * links to975975+ * Dispose of a keyring list after the RCU grace period, releasing the keys it976976+ * links to.1034977 */1035978static void keyring_clear_rcu_disposal(struct rcu_head *rcu)1036979{···1040989 key_put(klist->keys[loop]);10419901042991 kfree(klist);992992+}104399310441044-} /* end keyring_clear_rcu_disposal() */10451045-10461046-/*****************************************************************************/10471047-/*10481048- * clear the specified process keyring10491049- * - implements keyctl(KEYCTL_CLEAR)994994+/**995995+ * keyring_clear - Clear a keyring996996+ * @keyring: The keyring to clear.997997+ *998998+ * Clear the contents of the specified keyring.999999+ *10001000+ * Returns 0 if successful or -ENOTDIR if the keyring isn't a keyring.10501001 */10511002int keyring_clear(struct key *keyring)10521003{···10801027 }1081102810821029 return ret;10831083-10841084-} /* end keyring_clear() */10851085-10301030+}10861031EXPORT_SYMBOL(keyring_clear);1087103210881088-/*****************************************************************************/10891033/*10901090- * dispose of the links from a revoked keyring10911091- * - called with the key sem write-locked10341034+ * Dispose of the links from a revoked keyring.10351035+ *10361036+ * This is called with the key sem write-locked.10921037 */10931038static void keyring_revoke(struct key *keyring)10941039{···11011050 rcu_assign_pointer(keyring->payload.subscriptions, NULL);11021051 call_rcu(&klist->rcu, keyring_clear_rcu_disposal);11031052 }11041104-11051105-} /* end keyring_revoke() */10531053+}1106105411071055/*11081108- * Determine whether a key is dead10561056+ * Determine whether a key is dead.11091057 */11101058static bool key_is_dead(struct key *key, time_t limit)11111059{···11131063}1114106411151065/*11161116- * Collect garbage from the contents of a keyring10661066+ * Collect garbage from the contents of a keyring, replacing the old list with10671067+ * a new one with the pointers all shuffled down.10681068+ *10691069+ * Dead keys are classed as oned that are flagged as being dead or are revoked,10701070+ * expired or negative keys that were revoked or expired before the specified10711071+ * limit.11171072 */11181073void keyring_gc(struct key *keyring, time_t limit)11191074{
+17-16
security/keys/permission.c
···11-/* permission.c: key permission determination11+/* Key permission checking22 *33 * Copyright (C) 2005 Red Hat, Inc. All Rights Reserved.44 * Written by David Howells (dhowells@redhat.com)···1313#include <linux/security.h>1414#include "internal.h"15151616-/*****************************************************************************/1716/**1817 * key_task_permission - Check a key can be used1919- * @key_ref: The key to check2020- * @cred: The credentials to use2121- * @perm: The permissions to check for1818+ * @key_ref: The key to check.1919+ * @cred: The credentials to use.2020+ * @perm: The permissions to check for.2221 *2322 * Check to see whether permission is granted to use a key in the desired way,2423 * but permit the security modules to override.2524 *2626- * The caller must hold either a ref on cred or must hold the RCU readlock or a2727- * spinlock.2525+ * The caller must hold either a ref on cred or must hold the RCU readlock.2626+ *2727+ * Returns 0 if successful, -EACCES if access is denied based on the2828+ * permissions bits or the LSM check.2829 */2930int key_task_permission(const key_ref_t key_ref, const struct cred *cred,3031 key_perm_t perm)···80798180 /* let LSM be the final arbiter */8281 return security_key_permission(key_ref, cred, perm);8383-8484-} /* end key_task_permission() */8585-8282+}8683EXPORT_SYMBOL(key_task_permission);87848888-/*****************************************************************************/8989-/*9090- * validate a key8585+/**8686+ * key_validate - Validate a key.8787+ * @key: The key to be validated.8888+ *8989+ * Check that a key is valid, returning 0 if the key is okay, -EKEYREVOKED if9090+ * the key's type has been removed or if the key has been revoked or9191+ * -EKEYEXPIRED if the key has expired.9192 */9293int key_validate(struct key *key)9394{···114111115112error:116113 return ret;117117-118118-} /* end key_validate() */119119-114114+}120115EXPORT_SYMBOL(key_validate);
+7-10
security/keys/proc.c
···11-/* proc.c: proc files for key database enumeration11+/* procfs files for key database enumeration22 *33 * Copyright (C) 2004 Red Hat, Inc. All Rights Reserved.44 * Written by David Howells (dhowells@redhat.com)···6060 .release = seq_release,6161};62626363-/*****************************************************************************/6463/*6565- * declare the /proc files6464+ * Declare the /proc files.6665 */6766static int __init key_proc_init(void)6867{···7879 panic("Cannot create /proc/key-users\n");79808081 return 0;8181-8282-} /* end key_proc_init() */8282+}83838484__initcall(key_proc_init);85858686-/*****************************************************************************/8786/*8888- * implement "/proc/keys" to provides a list of the keys on the system8787+ * Implement "/proc/keys" to provide a list of the keys on the system that8888+ * grant View permission to the caller.8989 */9090#ifdef CONFIG_KEYS_DEBUG_PROC_KEYS9191···291293 return __key_user_next(n);292294}293295294294-/*****************************************************************************/295296/*296296- * implement "/proc/key-users" to provides a list of the key users297297+ * Implement "/proc/key-users" to provides a list of the key users and their298298+ * quotas.297299 */298300static int proc_key_users_open(struct inode *inode, struct file *file)299301{···349351 maxbytes);350352351353 return 0;352352-353354}
+80-55
security/keys/process_keys.c
···11-/* Management of a process's keyrings11+/* Manage a process's keyrings22 *33 * Copyright (C) 2004-2005, 2008 Red Hat, Inc. All Rights Reserved.44 * Written by David Howells (dhowells@redhat.com)···2121#include <asm/uaccess.h>2222#include "internal.h"23232424-/* session keyring create vs join semaphore */2424+/* Session keyring create vs join semaphore */2525static DEFINE_MUTEX(key_session_mutex);26262727-/* user keyring creation semaphore */2727+/* User keyring creation semaphore */2828static DEFINE_MUTEX(key_user_keyring_mutex);29293030-/* the root user's tracking struct */3030+/* The root user's tracking struct */3131struct key_user root_key_user = {3232 .usage = ATOMIC_INIT(3),3333 .cons_lock = __MUTEX_INITIALIZER(root_key_user.cons_lock),···3838 .user_ns = &init_user_ns,3939};40404141-/*****************************************************************************/4241/*4343- * install user and user session keyrings for a particular UID4242+ * Install the user and user session keyrings for the current process's UID.4443 */4544int install_user_keyrings(void)4645{···121122}122123123124/*124124- * install a fresh thread keyring directly to new credentials125125+ * Install a fresh thread keyring directly to new credentials. This keyring is126126+ * allowed to overrun the quota.125127 */126128int install_thread_keyring_to_cred(struct cred *new)127129{···138138}139139140140/*141141- * install a fresh thread keyring, discarding the old one141141+ * Install a fresh thread keyring, discarding the old one.142142 */143143static int install_thread_keyring(void)144144{···161161}162162163163/*164164- * install a process keyring directly to a credentials struct165165- * - returns -EEXIST if there was already a process keyring, 0 if one installed,166166- * and other -ve on any other error164164+ * Install a process keyring directly to a credentials struct.165165+ *166166+ * Returns -EEXIST if there was already a process keyring, 0 if one installed,167167+ * and other value on any other error167168 */168169int install_process_keyring_to_cred(struct cred *new)169170{···193192}194193195194/*196196- * make sure a process keyring is installed197197- * - we195195+ * Make sure a process keyring is installed for the current process. The196196+ * existing process keyring is not replaced.197197+ *198198+ * Returns 0 if there is a process keyring by the end of this function, some199199+ * error otherwise.198200 */199201static int install_process_keyring(void)200202{···218214}219215220216/*221221- * install a session keyring directly to a credentials struct217217+ * Install a session keyring directly to a credentials struct.222218 */223219int install_session_keyring_to_cred(struct cred *cred, struct key *keyring)224220{···258254}259255260256/*261261- * install a session keyring, discarding the old one262262- * - if a keyring is not supplied, an empty one is invented257257+ * Install a session keyring, discarding the old one. If a keyring is not258258+ * supplied, an empty one is invented.263259 */264260static int install_session_keyring(struct key *keyring)265261{···279275 return commit_creds(new);280276}281277282282-/*****************************************************************************/283278/*284284- * the filesystem user ID changed279279+ * Handle the fsuid changing.285280 */286281void key_fsuid_changed(struct task_struct *tsk)287282{···291288 tsk->cred->thread_keyring->uid = tsk->cred->fsuid;292289 up_write(&tsk->cred->thread_keyring->sem);293290 }291291+}294292295295-} /* end key_fsuid_changed() */296296-297297-/*****************************************************************************/298293/*299299- * the filesystem group ID changed294294+ * Handle the fsgid changing.300295 */301296void key_fsgid_changed(struct task_struct *tsk)302297{···305304 tsk->cred->thread_keyring->gid = tsk->cred->fsgid;306305 up_write(&tsk->cred->thread_keyring->sem);307306 }307307+}308308309309-} /* end key_fsgid_changed() */310310-311311-/*****************************************************************************/312309/*313313- * search only my process keyrings for the first matching key314314- * - we use the supplied match function to see if the description (or other315315- * feature of interest) matches316316- * - we return -EAGAIN if we didn't find any matching key317317- * - we return -ENOKEY if we found only negative matching keys310310+ * Search the process keyrings attached to the supplied cred for the first311311+ * matching key.312312+ *313313+ * The search criteria are the type and the match function. The description is314314+ * given to the match function as a parameter, but doesn't otherwise influence315315+ * the search. Typically the match function will compare the description316316+ * parameter to the key's description.317317+ *318318+ * This can only search keyrings that grant Search permission to the supplied319319+ * credentials. Keyrings linked to searched keyrings will also be searched if320320+ * they grant Search permission too. Keys can only be found if they grant321321+ * Search permission to the credentials.322322+ *323323+ * Returns a pointer to the key with the key usage count incremented if324324+ * successful, -EAGAIN if we didn't find any matching key or -ENOKEY if we only325325+ * matched negative keys.326326+ *327327+ * In the case of a successful return, the possession attribute is set on the328328+ * returned key reference.318329 */319330key_ref_t search_my_process_keyrings(struct key_type *type,320331 const void *description,···441428 return key_ref;442429}443430444444-/*****************************************************************************/445431/*446446- * search the process keyrings for the first matching key447447- * - we use the supplied match function to see if the description (or other448448- * feature of interest) matches449449- * - we return -EAGAIN if we didn't find any matching key450450- * - we return -ENOKEY if we found only negative matching keys432432+ * Search the process keyrings attached to the supplied cred for the first433433+ * matching key in the manner of search_my_process_keyrings(), but also search434434+ * the keys attached to the assumed authorisation key using its credentials if435435+ * one is available.436436+ *437437+ * Return same as search_my_process_keyrings().451438 */452439key_ref_t search_process_keyrings(struct key_type *type,453440 const void *description,···502489503490found:504491 return key_ref;492492+}505493506506-} /* end search_process_keyrings() */507507-508508-/*****************************************************************************/509494/*510510- * see if the key we're looking at is the target key495495+ * See if the key we're looking at is the target key.511496 */512497int lookup_user_key_possessed(const struct key *key, const void *target)513498{514499 return key == target;500500+}515501516516-} /* end lookup_user_key_possessed() */517517-518518-/*****************************************************************************/519502/*520520- * lookup a key given a key ID from userspace with a given permissions mask521521- * - don't create special keyrings unless so requested522522- * - partially constructed keys aren't found unless requested503503+ * Look up a key ID given us by userspace with a given permissions mask to get504504+ * the key it refers to.505505+ *506506+ * Flags can be passed to request that special keyrings be created if referred507507+ * to directly, to permit partially constructed keys to be found and to skip508508+ * validity and permission checks on the found key.509509+ *510510+ * Returns a pointer to the key with an incremented usage count if successful;511511+ * -EINVAL if the key ID is invalid; -ENOKEY if the key ID does not correspond512512+ * to a key or the best found key was a negative key; -EKEYREVOKED or513513+ * -EKEYEXPIRED if the best found key was revoked or expired; -EACCES if the514514+ * found key doesn't grant the requested permit or the LSM denied access to it;515515+ * or -ENOMEM if a special keyring couldn't be created.516516+ *517517+ * In the case of a successful return, the possession attribute is set on the518518+ * returned key reference.523519 */524520key_ref_t lookup_user_key(key_serial_t id, unsigned long lflags,525521 key_perm_t perm)···733711reget_creds:734712 put_cred(cred);735713 goto try_again;714714+}736715737737-} /* end lookup_user_key() */738738-739739-/*****************************************************************************/740716/*741741- * join the named keyring as the session keyring if possible, or attempt to742742- * create a new one of that name if not743743- * - if the name is NULL, an empty anonymous keyring is installed instead744744- * - named session keyring joining is done with a semaphore held717717+ * Join the named keyring as the session keyring if possible else attempt to718718+ * create a new one of that name and join that.719719+ *720720+ * If the name is NULL, an empty anonymous keyring will be installed as the721721+ * session keyring.722722+ *723723+ * Named session keyrings are joined with a semaphore held to prevent the724724+ * keyrings from going away whilst the attempt is made to going them and also725725+ * to prevent a race in creating compatible session keyrings.745726 */746727long join_session_keyring(const char *name)747728{···816791}817792818793/*819819- * Replace a process's session keyring when that process resumes userspace on820820- * behalf of one of its children794794+ * Replace a process's session keyring on behalf of one of its children when795795+ * the target process is about to resume userspace execution.821796 */822797void key_replace_session_keyring(void)823798{
+121-43
security/keys/request_key.c
···3939 return signal_pending(current) ? -ERESTARTSYS : 0;4040}41414242-/*4343- * call to complete the construction of a key4242+/**4343+ * complete_request_key - Complete the construction of a key.4444+ * @cons: The key construction record.4545+ * @error: The success or failute of the construction.4646+ *4747+ * Complete the attempt to construct a key. The key will be negated4848+ * if an error is indicated. The authorisation key will be revoked4949+ * unconditionally.4450 */4551void complete_request_key(struct key_construction *cons, int error)4652{···6458}6559EXPORT_SYMBOL(complete_request_key);66606161+/*6262+ * Initialise a usermode helper that is going to have a specific session6363+ * keyring.6464+ *6565+ * This is called in context of freshly forked kthread before kernel_execve(),6666+ * so we can simply install the desired session_keyring at this point.6767+ */6768static int umh_keys_init(struct subprocess_info *info)6869{6970 struct cred *cred = (struct cred*)current_cred();7071 struct key *keyring = info->data;7171- /*7272- * This is called in context of freshly forked kthread before7373- * kernel_execve(), we can just change our ->session_keyring.7474- */7272+7573 return install_session_keyring_to_cred(cred, keyring);7674}77757676+/*7777+ * Clean up a usermode helper with session keyring.7878+ */7879static void umh_keys_cleanup(struct subprocess_info *info)7980{8081 struct key *keyring = info->data;8182 key_put(keyring);8283}83848585+/*8686+ * Call a usermode helper with a specific session keyring.8787+ */8488static int call_usermodehelper_keys(char *path, char **argv, char **envp,8589 struct key *session_keyring, enum umh_wait wait)8690{···10791}1089210993/*110110- * request userspace finish the construction of a key9494+ * Request userspace finish the construction of a key11195 * - execute "/sbin/request-key <op> <key> <uid> <gid> <keyring> <keyring> <keyring>"11296 */11397static int call_sbin_request_key(struct key_construction *cons,···214198}215199216200/*217217- * call out to userspace for key construction218218- * - we ignore program failure and go on key status instead201201+ * Call out to userspace for key construction.202202+ *203203+ * Program failure is ignored in favour of key status.219204 */220205static int construct_key(struct key *key, const void *callout_info,221206 size_t callout_len, void *aux,···263246}264247265248/*266266- * get the appropriate destination keyring for the request267267- * - we return whatever keyring we select with an extra reference upon it which268268- * the caller must release249249+ * Get the appropriate destination keyring for the request.250250+ *251251+ * The keyring selected is returned with an extra reference upon it which the252252+ * caller must release.269253 */270254static void construct_get_dest_keyring(struct key **_dest_keyring)271255{···339321}340322341323/*342342- * allocate a new key in under-construction state and attempt to link it in to343343- * the requested place344344- * - may return a key that's already under construction instead324324+ * Allocate a new key in under-construction state and attempt to link it in to325325+ * the requested keyring.326326+ *327327+ * May return a key that's already under construction instead if there was a328328+ * race between two thread calling request_key().345329 */346330static int construct_alloc_key(struct key_type *type,347331 const char *description,···434414}435415436416/*437437- * commence key construction417417+ * Commence key construction.438418 */439419static struct key *construct_key_and_link(struct key_type *type,440420 const char *description,···485465 return ERR_PTR(ret);486466}487467488488-/*489489- * request a key490490- * - search the process's keyrings491491- * - check the list of keys being created or updated492492- * - call out to userspace for a key if supplementary info was provided493493- * - cache the key in an appropriate keyring468468+/**469469+ * request_key_and_link - Request a key and cache it in a keyring.470470+ * @type: The type of key we want.471471+ * @description: The searchable description of the key.472472+ * @callout_info: The data to pass to the instantiation upcall (or NULL).473473+ * @callout_len: The length of callout_info.474474+ * @aux: Auxiliary data for the upcall.475475+ * @dest_keyring: Where to cache the key.476476+ * @flags: Flags to key_alloc().477477+ *478478+ * A key matching the specified criteria is searched for in the process's479479+ * keyrings and returned with its usage count incremented if found. Otherwise,480480+ * if callout_info is not NULL, a key will be allocated and some service481481+ * (probably in userspace) will be asked to instantiate it.482482+ *483483+ * If successfully found or created, the key will be linked to the destination484484+ * keyring if one is provided.485485+ *486486+ * Returns a pointer to the key if successful; -EACCES, -ENOKEY, -EKEYREVOKED487487+ * or -EKEYEXPIRED if an inaccessible, negative, revoked or expired key was488488+ * found; -ENOKEY if no key was found and no @callout_info was given; -EDQUOT489489+ * if insufficient key quota was available to create a new key; or -ENOMEM if490490+ * insufficient memory was available.491491+ *492492+ * If the returned key was created, then it may still be under construction,493493+ * and wait_for_key_construction() should be used to wait for that to complete.494494 */495495struct key *request_key_and_link(struct key_type *type,496496 const char *description,···564524 return key;565525}566526567567-/*568568- * wait for construction of a key to complete527527+/**528528+ * wait_for_key_construction - Wait for construction of a key to complete529529+ * @key: The key being waited for.530530+ * @intr: Whether to wait interruptibly.531531+ *532532+ * Wait for a key to finish being constructed.533533+ *534534+ * Returns 0 if successful; -ERESTARTSYS if the wait was interrupted; -ENOKEY535535+ * if the key was negated; or -EKEYREVOKED or -EKEYEXPIRED if the key was536536+ * revoked or expired.569537 */570538int wait_for_key_construction(struct key *key, bool intr)571539{···590542}591543EXPORT_SYMBOL(wait_for_key_construction);592544593593-/*594594- * request a key595595- * - search the process's keyrings596596- * - check the list of keys being created or updated597597- * - call out to userspace for a key if supplementary info was provided598598- * - waits uninterruptible for creation to complete545545+/**546546+ * request_key - Request a key and wait for construction547547+ * @type: Type of key.548548+ * @description: The searchable description of the key.549549+ * @callout_info: The data to pass to the instantiation upcall (or NULL).550550+ *551551+ * As for request_key_and_link() except that it does not add the returned key552552+ * to a keyring if found, new keys are always allocated in the user's quota,553553+ * the callout_info must be a NUL-terminated string and no auxiliary data can554554+ * be passed.555555+ *556556+ * Furthermore, it then works as wait_for_key_construction() to wait for the557557+ * completion of keys undergoing construction with a non-interruptible wait.599558 */600559struct key *request_key(struct key_type *type,601560 const char *description,···627572}628573EXPORT_SYMBOL(request_key);629574630630-/*631631- * request a key with auxiliary data for the upcaller632632- * - search the process's keyrings633633- * - check the list of keys being created or updated634634- * - call out to userspace for a key if supplementary info was provided635635- * - waits uninterruptible for creation to complete575575+/**576576+ * request_key_with_auxdata - Request a key with auxiliary data for the upcaller577577+ * @type: The type of key we want.578578+ * @description: The searchable description of the key.579579+ * @callout_info: The data to pass to the instantiation upcall (or NULL).580580+ * @callout_len: The length of callout_info.581581+ * @aux: Auxiliary data for the upcall.582582+ *583583+ * As for request_key_and_link() except that it does not add the returned key584584+ * to a keyring if found and new keys are always allocated in the user's quota.585585+ *586586+ * Furthermore, it then works as wait_for_key_construction() to wait for the587587+ * completion of keys undergoing construction with a non-interruptible wait.636588 */637589struct key *request_key_with_auxdata(struct key_type *type,638590 const char *description,···664602EXPORT_SYMBOL(request_key_with_auxdata);665603666604/*667667- * request a key (allow async construction)668668- * - search the process's keyrings669669- * - check the list of keys being created or updated670670- * - call out to userspace for a key if supplementary info was provided605605+ * request_key_async - Request a key (allow async construction)606606+ * @type: Type of key.607607+ * @description: The searchable description of the key.608608+ * @callout_info: The data to pass to the instantiation upcall (or NULL).609609+ * @callout_len: The length of callout_info.610610+ *611611+ * As for request_key_and_link() except that it does not add the returned key612612+ * to a keyring if found, new keys are always allocated in the user's quota and613613+ * no auxiliary data can be passed.614614+ *615615+ * The caller should call wait_for_key_construction() to wait for the616616+ * completion of the returned key if it is still undergoing construction.671617 */672618struct key *request_key_async(struct key_type *type,673619 const char *description,···690620691621/*692622 * request a key with auxiliary data for the upcaller (allow async construction)693693- * - search the process's keyrings694694- * - check the list of keys being created or updated695695- * - call out to userspace for a key if supplementary info was provided623623+ * @type: Type of key.624624+ * @description: The searchable description of the key.625625+ * @callout_info: The data to pass to the instantiation upcall (or NULL).626626+ * @callout_len: The length of callout_info.627627+ * @aux: Auxiliary data for the upcall.628628+ *629629+ * As for request_key_and_link() except that it does not add the returned key630630+ * to a keyring if found and new keys are always allocated in the user's quota.631631+ *632632+ * The caller should call wait_for_key_construction() to wait for the633633+ * completion of the returned key if it is still undergoing construction.696634 */697635struct key *request_key_async_with_auxdata(struct key_type *type,698636 const char *description,
+22-40
security/keys/request_key_auth.c
···11-/* request_key_auth.c: request key authorisation controlling key def11+/* Request key authorisation token key definition.22 *33 * Copyright (C) 2005 Red Hat, Inc. All Rights Reserved.44 * Written by David Howells (dhowells@redhat.com)···2626static long request_key_auth_read(const struct key *, char __user *, size_t);27272828/*2929- * the request-key authorisation key type definition2929+ * The request-key authorisation key type definition.3030 */3131struct key_type key_type_request_key_auth = {3232 .name = ".request_key_auth",···3838 .read = request_key_auth_read,3939};40404141-/*****************************************************************************/4241/*4343- * instantiate a request-key authorisation key4242+ * Instantiate a request-key authorisation key.4443 */4544static int request_key_auth_instantiate(struct key *key,4645 const void *data,···4748{4849 key->payload.data = (struct request_key_auth *) data;4950 return 0;5151+}50525151-} /* end request_key_auth_instantiate() */5252-5353-/*****************************************************************************/5453/*5555- * reading a request-key authorisation key retrieves the callout information5454+ * Describe an authorisation token.5655 */5756static void request_key_auth_describe(const struct key *key,5857 struct seq_file *m)···6063 seq_puts(m, "key:");6164 seq_puts(m, key->description);6265 seq_printf(m, " pid:%d ci:%zu", rka->pid, rka->callout_len);6666+}63676464-} /* end request_key_auth_describe() */6565-6666-/*****************************************************************************/6768/*6868- * read the callout_info data6969+ * Read the callout_info data (retrieves the callout information).6970 * - the key's semaphore is read-locked7071 */7172static long request_key_auth_read(const struct key *key,···8691 }87928893 return ret;9494+}89959090-} /* end request_key_auth_read() */9191-9292-/*****************************************************************************/9396/*9494- * handle revocation of an authorisation token key9595- * - called with the key sem write-locked9797+ * Handle revocation of an authorisation token key.9898+ *9999+ * Called with the key sem write-locked.96100 */97101static void request_key_auth_revoke(struct key *key)98102{···103109 put_cred(rka->cred);104110 rka->cred = NULL;105111 }112112+}106113107107-} /* end request_key_auth_revoke() */108108-109109-/*****************************************************************************/110114/*111111- * destroy an instantiation authorisation token key115115+ * Destroy an instantiation authorisation token key.112116 */113117static void request_key_auth_destroy(struct key *key)114118{···123131 key_put(rka->dest_keyring);124132 kfree(rka->callout_info);125133 kfree(rka);134134+}126135127127-} /* end request_key_auth_destroy() */128128-129129-/*****************************************************************************/130136/*131131- * create an authorisation token for /sbin/request-key or whoever to gain132132- * access to the caller's security data137137+ * Create an authorisation token for /sbin/request-key or whoever to gain138138+ * access to the caller's security data.133139 */134140struct key *request_key_auth_new(struct key *target, const void *callout_info,135141 size_t callout_len, struct key *dest_keyring)···218228 kfree(rka);219229 kleave("= %d", ret);220230 return ERR_PTR(ret);231231+}221232222222-} /* end request_key_auth_new() */223223-224224-/*****************************************************************************/225233/*226226- * see if an authorisation key is associated with a particular key234234+ * See if an authorisation key is associated with a particular key.227235 */228236static int key_get_instantiation_authkey_match(const struct key *key,229237 const void *_id)···230242 key_serial_t id = (key_serial_t)(unsigned long) _id;231243232244 return rka->target_key->serial == id;245245+}233246234234-} /* end key_get_instantiation_authkey_match() */235235-236236-/*****************************************************************************/237247/*238238- * get the authorisation key for instantiation of a specific key if attached to239239- * the current process's keyrings240240- * - this key is inserted into a keyring and that is set as /sbin/request-key's241241- * session keyring242242- * - a target_id of zero specifies any valid token248248+ * Search the current process's keyrings for the authorisation key for249249+ * instantiation of a key.243250 */244251struct key *key_get_instantiation_authkey(key_serial_t target_id)245252{···261278262279error:263280 return authkey;264264-265265-} /* end key_get_instantiation_authkey() */281281+}
+28-23
security/keys/trusted_defined.c
···101101 if (dlen == 0)102102 break;103103 data = va_arg(argp, unsigned char *);104104- if (data == NULL)105105- return -EINVAL;104104+ if (data == NULL) {105105+ ret = -EINVAL;106106+ break;107107+ }106108 ret = crypto_shash_update(&sdesc->shash, data, dlen);107109 if (ret < 0)108108- goto out;110110+ break;109111 }110112 va_end(argp);111113 if (!ret)···148146 if (dlen == 0)149147 break;150148 data = va_arg(argp, unsigned char *);151151- ret = crypto_shash_update(&sdesc->shash, data, dlen);152152- if (ret < 0) {153153- va_end(argp);154154- goto out;149149+ if (!data) {150150+ ret = -EINVAL;151151+ break;155152 }153153+ ret = crypto_shash_update(&sdesc->shash, data, dlen);154154+ if (ret < 0)155155+ break;156156 }157157 va_end(argp);158158- ret = crypto_shash_final(&sdesc->shash, paramdigest);158158+ if (!ret)159159+ ret = crypto_shash_final(&sdesc->shash, paramdigest);159160 if (!ret)160161 ret = TSS_rawhmac(digest, key, keylen, SHA1_DIGEST_SIZE,161162 paramdigest, TPM_NONCE_SIZE, h1,···227222 break;228223 dpos = va_arg(argp, unsigned int);229224 ret = crypto_shash_update(&sdesc->shash, buffer + dpos, dlen);230230- if (ret < 0) {231231- va_end(argp);232232- goto out;233233- }225225+ if (ret < 0)226226+ break;234227 }235228 va_end(argp);236236- ret = crypto_shash_final(&sdesc->shash, paramdigest);229229+ if (!ret)230230+ ret = crypto_shash_final(&sdesc->shash, paramdigest);237231 if (ret < 0)238232 goto out;239233···320316 break;321317 dpos = va_arg(argp, unsigned int);322318 ret = crypto_shash_update(&sdesc->shash, buffer + dpos, dlen);323323- if (ret < 0) {324324- va_end(argp);325325- goto out;326326- }319319+ if (ret < 0)320320+ break;327321 }328322 va_end(argp);329329- ret = crypto_shash_final(&sdesc->shash, paramdigest);323323+ if (!ret)324324+ ret = crypto_shash_final(&sdesc->shash, paramdigest);330325 if (ret < 0)331326 goto out;332327···514511 /* get session for sealing key */515512 ret = osap(tb, &sess, keyauth, keytype, keyhandle);516513 if (ret < 0)517517- return ret;514514+ goto out;518515 dump_sess(&sess);519516520517 /* calculate encrypted authorization value */···522519 memcpy(td->xorwork + SHA1_DIGEST_SIZE, sess.enonce, SHA1_DIGEST_SIZE);523520 ret = TSS_sha1(td->xorwork, SHA1_DIGEST_SIZE * 2, td->xorhash);524521 if (ret < 0)525525- return ret;522522+ goto out;526523527524 ret = tpm_get_random(tb, td->nonceodd, TPM_NONCE_SIZE);528525 if (ret < 0)529529- return ret;526526+ goto out;530527 ordinal = htonl(TPM_ORD_SEAL);531528 datsize = htonl(datalen);532529 pcrsize = htonl(pcrinfosize);···555552 &datsize, datalen, data, 0, 0);556553 }557554 if (ret < 0)558558- return ret;555555+ goto out;559556560557 /* build and send the TPM request packet */561558 INIT_BUF(tb);···575572576573 ret = trusted_tpm_send(TPM_ANY_NUM, tb->data, MAX_BUF_SIZE);577574 if (ret < 0)578578- return ret;575575+ goto out;579576580577 /* calculate the size of the returned Blob */581578 sealinfosize = LOAD32(tb->data, TPM_DATA_OFFSET + sizeof(uint32_t));···594591 memcpy(blob, tb->data + TPM_DATA_OFFSET, storedsize);595592 *bloblen = storedsize;596593 }594594+out:595595+ kfree(td);597596 return ret;598597}599598
+8-24
security/keys/user_defined.c
···35353636EXPORT_SYMBOL_GPL(key_type_user);37373838-/*****************************************************************************/3938/*4039 * instantiate a user defined key4140 */···64656566error:6667 return ret;6767-6868-} /* end user_instantiate() */6868+}69697070EXPORT_SYMBOL_GPL(user_instantiate);71717272-/*****************************************************************************/7372/*7473 * dispose of the old data from an updated user defined key7574 */···7881 upayload = container_of(rcu, struct user_key_payload, rcu);79828083 kfree(upayload);8484+}81858282-} /* end user_update_rcu_disposal() */8383-8484-/*****************************************************************************/8586/*8687 * update a user defined key8788 * - the key's semaphore is write-locked···118123119124error:120125 return ret;121121-122122-} /* end user_update() */126126+}123127124128EXPORT_SYMBOL_GPL(user_update);125129126126-/*****************************************************************************/127130/*128131 * match users on their name129132 */130133int user_match(const struct key *key, const void *description)131134{132135 return strcmp(key->description, description) == 0;133133-134134-} /* end user_match() */136136+}135137136138EXPORT_SYMBOL_GPL(user_match);137139138138-/*****************************************************************************/139140/*140141 * dispose of the links from a revoked keyring141142 * - called with the key sem write-locked···147156 rcu_assign_pointer(key->payload.data, NULL);148157 call_rcu(&upayload->rcu, user_update_rcu_disposal);149158 }150150-151151-} /* end user_revoke() */159159+}152160153161EXPORT_SYMBOL(user_revoke);154162155155-/*****************************************************************************/156163/*157164 * dispose of the data dangling from the corpse of a user key158165 */···159170 struct user_key_payload *upayload = key->payload.data;160171161172 kfree(upayload);162162-163163-} /* end user_destroy() */173173+}164174165175EXPORT_SYMBOL_GPL(user_destroy);166176167167-/*****************************************************************************/168177/*169178 * describe the user key170179 */···171184 seq_puts(m, key->description);172185173186 seq_printf(m, ": %u", key->datalen);174174-175175-} /* end user_describe() */187187+}176188177189EXPORT_SYMBOL_GPL(user_describe);178190179179-/*****************************************************************************/180191/*181192 * read the key data182193 * - the key's semaphore is read-locked···198213 }199214200215 return ret;201201-202202-} /* end user_read() */216216+}203217204218EXPORT_SYMBOL_GPL(user_read);
+9-9
usr/Kconfig
···4646 If you are not sure, leave it set to "0".47474848config RD_GZIP4949- bool "Support initial ramdisks compressed using gzip" if EMBEDDED4949+ bool "Support initial ramdisks compressed using gzip" if EXPERT5050 default y5151 depends on BLK_DEV_INITRD5252 select DECOMPRESS_GZIP···5555 If unsure, say Y.56565757config RD_BZIP25858- bool "Support initial ramdisks compressed using bzip2" if EMBEDDED5959- default !EMBEDDED5858+ bool "Support initial ramdisks compressed using bzip2" if EXPERT5959+ default !EXPERT6060 depends on BLK_DEV_INITRD6161 select DECOMPRESS_BZIP26262 help···6464 If unsure, say N.65656666config RD_LZMA6767- bool "Support initial ramdisks compressed using LZMA" if EMBEDDED6868- default !EMBEDDED6767+ bool "Support initial ramdisks compressed using LZMA" if EXPERT6868+ default !EXPERT6969 depends on BLK_DEV_INITRD7070 select DECOMPRESS_LZMA7171 help···7373 If unsure, say N.74747575config RD_XZ7676- bool "Support initial ramdisks compressed using XZ" if EMBEDDED7777- default !EMBEDDED7676+ bool "Support initial ramdisks compressed using XZ" if EXPERT7777+ default !EXPERT7878 depends on BLK_DEV_INITRD7979 select DECOMPRESS_XZ8080 help···8282 If unsure, say N.83838484config RD_LZO8585- bool "Support initial ramdisks compressed using LZO" if EMBEDDED8686- default !EMBEDDED8585+ bool "Support initial ramdisks compressed using LZO" if EXPERT8686+ default !EXPERT8787 depends on BLK_DEV_INITRD8888 select DECOMPRESS_LZO8989 help