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

Configure Feed

Select the types of activity you want to include in your feed.

Merge branch 'akpm' (fixes from Andrew)

Merge emailed fixes from Andrew Morton:
"Bunch of fixes:

- delayed IPC updates. I held back on this because of some possible
outstanding bug reports, but they appear to have been addressed in
later versions

- A bunch of MAINTAINERS updates

- Yet Another RTC driver. I'd held this back while a couple of
little issues were being worked out.

I'm expecting an intrusive-but-simple patchset from Joe Perches which
splits up printk.c into kernel/printk/*. That will be a pig to
maintain for two months so if it passes testing I'd like to get it
upstream after a week or so."

* emailed patches from Andrew Morton <akpm@linux-foundation.org>: (35 commits)
printk: fix incorrect length from print_time() when seconds > 99999
drivers/rtc/rtc-vt8500.c: fix handling of data passed in struct rtc_time
drivers/rtc/rtc-vt8500.c: correct handling of CR_24H bitfield
rtc: add RTC driver for TPS6586x
MAINTAINERS: fix drivers/staging/sm7xx/
MAINTAINERS: remove include/linux/of_pwm.h
MAINTAINERS: remove arch/*/lib/perf_event*.c
MAINTAINERS: remove drivers/mmc/host/imxmmc.*
MAINTAINERS: fix Documentation/mei/
MAINTAINERS: remove arch/x86/platform/mrst/pmu.*
MAINTAINERS: remove firmware/isci/
MAINTAINERS: fix drivers/ieee802154/
MAINTAINERS: fix .../plat-mxc/include/mach/imxfb.h
MAINTAINERS: remove drivers/video/epson1355fb.c
MAINTAINERS: fix drivers/media/usb/dvb-usb/cxusb*
MAINTAINERS: adjust for UAPI
MAINTAINERS: fix drivers/media/platform/atmel-isi.c
MAINTAINERS: fix arch/arm/mach-at91/include/mach/at_hdmac.h
MAINTAINERS: fix drivers/rtc/rtc-vt8500.c
MAINTAINERS: remove arch/arm/plat-s5p/
...

+1036 -201
+32
Documentation/sysctl/kernel.txt
··· 38 38 - l2cr [ PPC only ] 39 39 - modprobe ==> Documentation/debugging-modules.txt 40 40 - modules_disabled 41 + - msg_next_id [ sysv ipc ] 41 42 - msgmax 42 43 - msgmnb 43 44 - msgmni ··· 63 62 - rtsig-max 64 63 - rtsig-nr 65 64 - sem 65 + - sem_next_id [ sysv ipc ] 66 66 - sg-big-buff [ generic SCSI device (sg) ] 67 + - shm_next_id [ sysv ipc ] 67 68 - shm_rmid_forced 68 69 - shmall 69 70 - shmmax [ sysv ipc ] ··· 323 320 324 321 ============================================================== 325 322 323 + msg_next_id, sem_next_id, and shm_next_id: 324 + 325 + These three toggles allows to specify desired id for next allocated IPC 326 + object: message, semaphore or shared memory respectively. 327 + 328 + By default they are equal to -1, which means generic allocation logic. 329 + Possible values to set are in range {0..INT_MAX}. 330 + 331 + Notes: 332 + 1) kernel doesn't guarantee, that new object will have desired id. So, 333 + it's up to userspace, how to handle an object with "wrong" id. 334 + 2) Toggle with non-default value will be set back to -1 by kernel after 335 + successful IPC object allocation. 336 + 337 + ============================================================== 338 + 326 339 nmi_watchdog: 327 340 328 341 Enables/Disables the NMI watchdog on x86 systems. When the value is ··· 558 539 There shouldn't be any reason to change this value. If 559 540 you can come up with one, you probably know what you 560 541 are doing anyway :) 542 + 543 + ============================================================== 544 + 545 + shmall: 546 + 547 + This parameter sets the total amount of shared memory pages that 548 + can be used system wide. Hence, SHMALL should always be at least 549 + ceil(shmmax/PAGE_SIZE). 550 + 551 + If you are not sure what the default PAGE_SIZE is on your Linux 552 + system, you can run the following command: 553 + 554 + # getconf PAGE_SIZE 561 555 562 556 ============================================================== 563 557
+124 -75
MAINTAINERS
··· 449 449 S: Maintained 450 450 F: drivers/char/agp/ 451 451 F: include/linux/agp* 452 + F: include/uapi/linux/agp* 452 453 453 454 AHA152X SCSI DRIVER 454 455 M: "Juergen E. Fischer" <fischer@norbit.de> ··· 590 589 S: Odd fixes 591 590 F: arch/x86/kernel/apm_32.c 592 591 F: include/linux/apm_bios.h 592 + F: include/uapi/linux/apm_bios.h 593 593 F: drivers/char/apm-emulation.c 594 594 595 595 APPLE BCM5974 MULTITOUCH DRIVER ··· 1007 1005 F: drivers/mmc/host/msm_sdcc.h 1008 1006 F: drivers/tty/serial/msm_serial.h 1009 1007 F: drivers/tty/serial/msm_serial.c 1010 - F: drivers/platform/msm/ 1011 1008 F: drivers/*/pm8???-* 1012 1009 F: include/linux/mfd/pm8xxx/ 1013 1010 T: git git://git.kernel.org/pub/scm/linux/kernel/git/davidb/linux-msm.git ··· 1070 1069 L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers) 1071 1070 W: http://www.arm.linux.org.uk/ 1072 1071 S: Maintained 1073 - F: arch/arm/common/time-acorn.c 1074 1072 F: arch/arm/include/asm/hardware/entry-macro-iomd.S 1075 1073 F: arch/arm/include/asm/hardware/ioc.h 1076 1074 F: arch/arm/include/asm/hardware/iomd.h ··· 1094 1094 S: Maintained 1095 1095 F: arch/arm/plat-samsung/ 1096 1096 F: arch/arm/plat-s3c24xx/ 1097 - F: arch/arm/plat-s5p/ 1098 1097 F: arch/arm/mach-s3c24*/ 1099 1098 F: arch/arm/mach-s3c64xx/ 1100 1099 F: drivers/*/*s3c2410* ··· 1124 1125 L: linux-arm-kernel@lists.infradead.org 1125 1126 L: linux-media@vger.kernel.org 1126 1127 S: Maintained 1127 - F: arch/arm/plat-s5p/dev-fimc* 1128 1128 F: arch/arm/plat-samsung/include/plat/*fimc* 1129 1129 F: drivers/media/platform/s5p-fimc/ 1130 1130 ··· 1134 1136 L: linux-arm-kernel@lists.infradead.org 1135 1137 L: linux-media@vger.kernel.org 1136 1138 S: Maintained 1137 - F: arch/arm/plat-s5p/dev-mfc.c 1139 + F: arch/arm/plat-samsung/s5p-dev-mfc.c 1138 1140 F: drivers/media/platform/s5p-mfc/ 1139 1141 1140 1142 ARM/SAMSUNG S5P SERIES TV SUBSYSTEM SUPPORT ··· 1252 1254 F: drivers/video/wm8505fb* 1253 1255 F: drivers/video/wmt_ge_rops.* 1254 1256 F: drivers/tty/serial/vt8500_serial.c 1255 - F: drivers/rtc/rtc-vt8500-c 1257 + F: drivers/rtc/rtc-vt8500.c 1256 1258 F: drivers/mmc/host/wmt-sdmmc.c 1257 1259 1258 1260 ARM/ZIPIT Z2 SUPPORT ··· 1386 1388 S: Maintained 1387 1389 F: drivers/atm/ 1388 1390 F: include/linux/atm* 1391 + F: include/uapi/linux/atm* 1389 1392 1390 1393 ATMEL AT91 / AT32 MCI DRIVER 1391 1394 M: Ludovic Desroches <ludovic.desroches@atmel.com> ··· 1405 1406 S: Supported 1406 1407 F: drivers/dma/at_hdmac.c 1407 1408 F: drivers/dma/at_hdmac_regs.h 1408 - F: arch/arm/mach-at91/include/mach/at_hdmac.h 1409 + F: include/linux/platform_data/dma-atmel.h 1409 1410 1410 1411 ATMEL ISI DRIVER 1411 1412 M: Josh Wu <josh.wu@atmel.com> 1412 1413 L: linux-media@vger.kernel.org 1413 1414 S: Supported 1414 - F: drivers/media/platform/atmel-isi.c 1415 + F: drivers/media/platform/soc_camera/atmel-isi.c 1415 1416 F: include/media/atmel-isi.h 1416 1417 1417 1418 ATMEL LCDFB DRIVER ··· 1466 1467 T: git git://git.kernel.org/pub/scm/linux/kernel/git/viro/audit-current.git 1467 1468 S: Maintained 1468 1469 F: include/linux/audit.h 1470 + F: include/uapi/linux/audit.h 1469 1471 F: kernel/audit* 1470 1472 1471 1473 AUXILIARY DISPLAY DRIVERS ··· 1497 1497 L: linux-hams@vger.kernel.org 1498 1498 W: http://www.linux-ax25.org/ 1499 1499 S: Maintained 1500 - F: include/linux/ax25.h 1500 + F: include/uapi/linux/ax25.h 1501 1501 F: include/net/ax25.h 1502 1502 F: net/ax25/ 1503 1503 ··· 1558 1558 S: Maintained 1559 1559 F: Documentation/filesystems/bfs.txt 1560 1560 F: fs/bfs/ 1561 - F: include/linux/bfs_fs.h 1561 + F: include/uapi/linux/bfs_fs.h 1562 1562 1563 1563 BLACKFIN ARCHITECTURE 1564 1564 M: Mike Frysinger <vapier@gentoo.org> ··· 1655 1655 W: http://sourceforge.net/projects/bonding/ 1656 1656 S: Supported 1657 1657 F: drivers/net/bonding/ 1658 - F: include/linux/if_bonding.h 1658 + F: include/uapi/linux/if_bonding.h 1659 1659 1660 1660 BROADCOM B44 10/100 ETHERNET DRIVER 1661 1661 M: Gary Zambrano <zambrano@broadcom.com> ··· 1734 1734 S: Supported 1735 1735 F: block/bsg.c 1736 1736 F: include/linux/bsg.h 1737 + F: include/uapi/linux/bsg.h 1737 1738 1738 1739 BT87X AUDIO DRIVER 1739 1740 M: Clemens Ladisch <clemens@ladisch.de> ··· 1805 1804 S: Supported 1806 1805 F: Documentation/networking/caif/ 1807 1806 F: drivers/net/caif/ 1808 - F: include/linux/caif/ 1807 + F: include/uapi/linux/caif/ 1809 1808 F: include/net/caif/ 1810 1809 F: net/caif/ 1811 1810 ··· 1826 1825 T: git git://gitorious.org/linux-can/linux-can-next.git 1827 1826 S: Maintained 1828 1827 F: net/can/ 1829 - F: include/linux/can.h 1830 1828 F: include/linux/can/core.h 1831 - F: include/linux/can/bcm.h 1832 - F: include/linux/can/raw.h 1833 - F: include/linux/can/gw.h 1829 + F: include/uapi/linux/can.h 1830 + F: include/uapi/linux/can/bcm.h 1831 + F: include/uapi/linux/can/raw.h 1832 + F: include/uapi/linux/can/gw.h 1834 1833 1835 1834 CAN NETWORK DRIVERS 1836 1835 M: Wolfgang Grandegger <wg@grandegger.com> ··· 1841 1840 S: Maintained 1842 1841 F: drivers/net/can/ 1843 1842 F: include/linux/can/dev.h 1844 - F: include/linux/can/error.h 1845 - F: include/linux/can/netlink.h 1846 1843 F: include/linux/can/platform/ 1844 + F: include/uapi/linux/can/error.h 1845 + F: include/uapi/linux/can/netlink.h 1847 1846 1848 1847 CAPABILITIES 1849 1848 M: Serge Hallyn <serge.hallyn@canonical.com> 1850 1849 L: linux-security-module@vger.kernel.org 1851 1850 S: Supported 1852 1851 F: include/linux/capability.h 1852 + F: include/uapi/linux/capability.h 1853 1853 F: security/capability.c 1854 1854 F: security/commoncap.c 1855 1855 F: kernel/capability.c ··· 1863 1861 S: Supported 1864 1862 F: arch/powerpc/include/asm/cell*.h 1865 1863 F: arch/powerpc/include/asm/spu*.h 1864 + F: arch/powerpc/include/uapi/asm/spu*.h 1866 1865 F: arch/powerpc/oprofile/*cell* 1867 1866 F: arch/powerpc/platforms/cell/ 1868 1867 ··· 1912 1909 T: git git://git.kernel.org/pub/scm/linux/kernel/git/jberg/mac80211.git 1913 1910 T: git git://git.kernel.org/pub/scm/linux/kernel/git/jberg/mac80211-next.git 1914 1911 S: Maintained 1915 - F: include/linux/nl80211.h 1912 + F: include/uapi/linux/nl80211.h 1916 1913 F: include/net/cfg80211.h 1917 1914 F: net/wireless/* 1918 1915 X: net/wireless/wext* ··· 2015 2012 F: Documentation/filesystems/coda.txt 2016 2013 F: fs/coda/ 2017 2014 F: include/linux/coda*.h 2015 + F: include/uapi/linux/coda*.h 2018 2016 2019 2017 COMMON CLK FRAMEWORK 2020 2018 M: Mike Turquette <mturquette@linaro.org> ··· 2270 2266 S: Orphan 2271 2267 F: drivers/tty/cyclades.c 2272 2268 F: include/linux/cyclades.h 2269 + F: include/uapi/linux/cyclades.h 2273 2270 2274 2271 CYCLADES PC300 DRIVER 2275 2272 W: http://www.cyclades.com/ ··· 2328 2323 W: http://www.linuxfoundation.org/collaborate/workgroups/networking/dccp 2329 2324 S: Maintained 2330 2325 F: include/linux/dccp.h 2326 + F: include/uapi/linux/dccp.h 2331 2327 F: include/linux/tfrc.h 2332 2328 F: net/dccp/ 2333 2329 ··· 2355 2349 W: http://www.debian.org/~dz/i8k/ 2356 2350 S: Maintained 2357 2351 F: drivers/char/i8k.c 2358 - F: include/linux/i8k.h 2352 + F: include/uapi/linux/i8k.h 2359 2353 2360 2354 DELL SYSTEMS MANAGEMENT BASE DRIVER (dcdbas) 2361 2355 M: Doug Warzecha <Douglas_Warzecha@dell.com> ··· 2428 2422 F: Documentation/filesystems/quota.txt 2429 2423 F: fs/quota/ 2430 2424 F: include/linux/quota*.h 2425 + F: include/uapi/linux/quota*.h 2431 2426 2432 2427 DISPLAYLINK USB 2.0 FRAMEBUFFER DRIVER (UDLFB) 2433 2428 M: Bernie Thompson <bernie@plugable.com> ··· 2535 2528 S: Maintained 2536 2529 F: drivers/gpu/drm/ 2537 2530 F: include/drm/ 2531 + F: include/uapi/drm/ 2538 2532 2539 2533 INTEL DRM DRIVERS (excluding Poulsbo, Moorestown and derivative chipsets) 2540 2534 M: Daniel Vetter <daniel.vetter@ffwll.ch> ··· 2545 2537 S: Supported 2546 2538 F: drivers/gpu/drm/i915 2547 2539 F: include/drm/i915* 2540 + F: include/uapi/drm/i915* 2548 2541 2549 2542 DRM DRIVERS FOR EXYNOS 2550 2543 M: Inki Dae <inki.dae@samsung.com> ··· 2557 2548 S: Supported 2558 2549 F: drivers/gpu/drm/exynos 2559 2550 F: include/drm/exynos* 2551 + F: include/uapi/drm/exynos* 2560 2552 2561 2553 DRM DRIVERS FOR NVIDIA TEGRA 2562 2554 M: Thierry Reding <thierry.reding@avionic-design.de> ··· 2632 2622 Q: http://patchwork.linuxtv.org/project/linux-media/list/ 2633 2623 T: git git://linuxtv.org/media_tree.git 2634 2624 S: Maintained 2635 - F: drivers/media/usb/dvb-usb-v2/cxusb* 2625 + F: drivers/media/usb/dvb-usb/cxusb* 2636 2626 2637 2627 DVB_USB_CYPRESS_FIRMWARE MEDIA DRIVER 2638 2628 M: Antti Palosaari <crope@iki.fi> ··· 2732 2722 W: http://ebtables.sourceforge.net/ 2733 2723 S: Maintained 2734 2724 F: include/linux/netfilter_bridge/ebt_*.h 2725 + F: include/uapi/linux/netfilter_bridge/ebt_*.h 2735 2726 F: net/bridge/netfilter/ebt*.c 2736 2727 2737 2728 EC100 MEDIA DRIVER ··· 2944 2933 S: Maintained 2945 2934 F: drivers/media/rc/ene_ir.* 2946 2935 2947 - EPSON 1355 FRAMEBUFFER DRIVER 2948 - M: Christopher Hoover <ch@murgatroid.com> 2949 - M: Christopher Hoover <ch@hpl.hp.com> 2950 - S: Maintained 2951 - F: drivers/video/epson1355fb.c 2952 - 2953 2936 EPSON S1D13XXX FRAMEBUFFER DRIVER 2954 2937 M: Kristoffer Ericson <kristoffer.ericson@gmail.com> 2955 2938 S: Maintained ··· 3056 3051 S: Maintained 3057 3052 F: fs/notify/fanotify/ 3058 3053 F: include/linux/fanotify.h 3054 + F: include/uapi/linux/fanotify.h 3059 3055 3060 3056 FARSYNC SYNCHRONOUS DRIVER 3061 3057 M: Kevin Curtis <kevin.curtis@farsite.co.uk> ··· 3080 3074 F: include/scsi/fc/ 3081 3075 F: include/scsi/libfc.h 3082 3076 F: include/scsi/libfcoe.h 3077 + F: include/uapi/scsi/fc/ 3083 3078 3084 3079 FILE LOCKING (flock() and fcntl()/lockf()) 3085 3080 M: Matthew Wilcox <matthew@wil.cx> ··· 3088 3081 S: Maintained 3089 3082 F: include/linux/fcntl.h 3090 3083 F: include/linux/fs.h 3084 + F: include/uapi/linux/fcntl.h 3085 + F: include/uapi/linux/fs.h 3091 3086 F: fs/fcntl.c 3092 3087 F: fs/locks.c 3093 3088 ··· 3179 3170 F: drivers/video/ 3180 3171 F: include/video/ 3181 3172 F: include/linux/fb.h 3173 + F: include/uapi/video/ 3174 + F: include/uapi/linux/fb.h 3182 3175 3183 3176 FREESCALE DIU FRAMEBUFFER DRIVER 3184 3177 M: Timur Tabi <timur@freescale.com> ··· 3207 3196 L: linux-fbdev@vger.kernel.org 3208 3197 L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers) 3209 3198 S: Maintained 3210 - F: arch/arm/plat-mxc/include/mach/imxfb.h 3199 + F: include/linux/platform_data/video-imxfb.h 3211 3200 F: drivers/video/imxfb.c 3212 3201 3213 3202 FREESCALE SOC FS_ENET DRIVER ··· 3325 3314 W: http://fuse.sourceforge.net/ 3326 3315 S: Maintained 3327 3316 F: fs/fuse/ 3328 - F: include/linux/fuse.h 3317 + F: include/uapi/linux/fuse.h 3329 3318 3330 3319 FUTURE DOMAIN TMC-16x0 SCSI DRIVER (16-bit) 3331 3320 M: Rik Faith <faith@cs.unc.edu> ··· 3372 3361 T: git git://git.kernel.org/pub/scm/linux/kernel/git/arnd/asm-generic.git 3373 3362 S: Maintained 3374 3363 F: include/asm-generic 3364 + F: include/uapi/asm-generic 3375 3365 3376 3366 GENERIC UIO DRIVER FOR PCI DEVICES 3377 3367 M: "Michael S. Tsirkin" <mst@redhat.com> ··· 3389 3377 S: Supported 3390 3378 F: Documentation/filesystems/gfs2*.txt 3391 3379 F: fs/gfs2/ 3392 - F: include/linux/gfs2_ondisk.h 3380 + F: include/uapi/linux/gfs2_ondisk.h 3393 3381 3394 3382 GIGASET ISDN DRIVERS 3395 3383 M: Hansjoerg Lipp <hjlipp@web.de> ··· 3399 3387 S: Maintained 3400 3388 F: Documentation/isdn/README.gigaset 3401 3389 F: drivers/isdn/gigaset/ 3402 - F: include/linux/gigaset_dev.h 3390 + F: include/uapi/linux/gigaset_dev.h 3403 3391 3404 3392 GPIO SUBSYSTEM 3405 3393 M: Grant Likely <grant.likely@secretlab.ca> ··· 3556 3544 F: Documentation/scsi/hpsa.txt 3557 3545 F: drivers/scsi/hpsa*.[ch] 3558 3546 F: include/linux/cciss*.h 3547 + F: include/uapi/linux/cciss*.h 3559 3548 3560 3549 HEWLETT-PACKARD SMART CISS RAID DRIVER (cciss) 3561 3550 M: Mike Miller <mike.miller@hp.com> ··· 3565 3552 F: Documentation/blockdev/cciss.txt 3566 3553 F: drivers/block/cciss* 3567 3554 F: include/linux/cciss_ioctl.h 3555 + F: include/uapi/linux/cciss_ioctl.h 3568 3556 3569 3557 HFS FILESYSTEM 3570 3558 L: linux-fsdevel@vger.kernel.org ··· 3600 3586 S: Maintained 3601 3587 F: drivers/hid/ 3602 3588 F: include/linux/hid* 3589 + F: include/uapi/linux/hid* 3603 3590 3604 3591 HIGH-RESOLUTION TIMERS, CLOCKEVENTS, DYNTICKS 3605 3592 M: Thomas Gleixner <tglx@linutronix.de> ··· 3632 3617 L: linux-hippi@sunsite.dk 3633 3618 S: Maintained 3634 3619 F: include/linux/hippidevice.h 3635 - F: include/linux/if_hippi.h 3620 + F: include/uapi/linux/if_hippi.h 3636 3621 F: net/802/hippi.c 3637 3622 F: drivers/net/hippi/ 3638 3623 ··· 3660 3645 F: Documentation/timers/hpet.txt 3661 3646 F: drivers/char/hpet.c 3662 3647 F: include/linux/hpet.h 3648 + F: include/uapi/linux/hpet.h 3663 3649 3664 3650 HPET: x86 3665 3651 M: "Venkatesh Pallipadi (Venki)" <venki@google.com> ··· 3761 3745 F: drivers/i2c/ 3762 3746 F: include/linux/i2c.h 3763 3747 F: include/linux/i2c-*.h 3748 + F: include/uapi/linux/i2c.h 3749 + F: include/uapi/linux/i2c-*.h 3764 3750 3765 3751 I2C-TAOS-EVM DRIVER 3766 3752 M: Jean Delvare <khali@linux-fr.org> ··· 3878 3860 S: Maintained 3879 3861 F: net/ieee802154/ 3880 3862 F: net/mac802154/ 3881 - F: drivers/ieee802154/ 3863 + F: drivers/net/ieee802154/ 3882 3864 3883 3865 IGUANAWORKS USB IR TRANSCEIVER 3884 3866 M: Sean Young <sean@mess.org> ··· 3929 3911 S: Supported 3930 3912 F: Documentation/infiniband/ 3931 3913 F: drivers/infiniband/ 3932 - F: include/linux/if_infiniband.h 3914 + F: include/uapi/linux/if_infiniband.h 3933 3915 3934 3916 INOTIFY 3935 3917 M: John McCutchan <john@johnmccutchan.com> ··· 3939 3921 F: Documentation/filesystems/inotify.txt 3940 3922 F: fs/notify/inotify/ 3941 3923 F: include/linux/inotify.h 3924 + F: include/uapi/linux/inotify.h 3942 3925 3943 3926 INPUT (KEYBOARD, MOUSE, JOYSTICK, TOUCHSCREEN) DRIVERS 3944 3927 M: Dmitry Torokhov <dmitry.torokhov@gmail.com> ··· 3950 3931 S: Maintained 3951 3932 F: drivers/input/ 3952 3933 F: include/linux/input.h 3934 + F: include/uapi/linux/input.h 3953 3935 F: include/linux/input/ 3954 3936 3955 3937 INPUT MULTITOUCH (MT) PROTOCOL ··· 3971 3951 T: git git://git.code.sf.net/p/intel-sas/isci 3972 3952 S: Supported 3973 3953 F: drivers/scsi/isci/ 3974 - F: firmware/isci/ 3975 3954 3976 3955 INTEL IDLE DRIVER 3977 3956 M: Len Brown <lenb@kernel.org> ··· 4065 4046 F: Documentation/networking/ixgbevf.txt 4066 4047 F: drivers/net/ethernet/intel/ 4067 4048 4068 - INTEL MRST PMU DRIVER 4069 - M: Len Brown <len.brown@intel.com> 4070 - L: linux-pm@vger.kernel.org 4071 - S: Supported 4072 - F: arch/x86/platform/mrst/pmu.* 4073 - 4074 4049 INTEL PRO/WIRELESS 2100, 2200BG, 2915ABG NETWORK CONNECTION SUPPORT 4075 4050 M: Stanislav Yakovlev <stas.yakovlev@gmail.com> 4076 4051 L: linux-wireless@vger.kernel.org ··· 4093 4080 W: http://linuxwimax.org 4094 4081 F: Documentation/wimax/README.i2400m 4095 4082 F: drivers/net/wimax/i2400m/ 4096 - F: include/linux/wimax/i2400m.h 4083 + F: include/uapi/linux/wimax/i2400m.h 4097 4084 4098 4085 INTEL WIRELESS 3945ABG/BG, 4965AGN (iwlegacy) 4099 4086 M: Stanislaw Gruszka <sgruszka@redhat.com> ··· 4115 4102 M: Tomas Winkler <tomas.winkler@intel.com> 4116 4103 L: linux-kernel@vger.kernel.org 4117 4104 S: Supported 4118 - F: include/linux/mei.h 4105 + F: include/uapi/linux/mei.h 4119 4106 F: drivers/misc/mei/* 4120 - F: Documentation/mei/* 4107 + F: Documentation/misc-devices/mei/* 4121 4108 4122 4109 IOC3 ETHERNET DRIVER 4123 4110 M: Ralf Baechle <ralf@linux-mips.org> ··· 4157 4144 F: Documentation/IPMI.txt 4158 4145 F: drivers/char/ipmi/ 4159 4146 F: include/linux/ipmi* 4147 + F: include/uapi/linux/ipmi* 4160 4148 4161 4149 IPS SCSI RAID DRIVER 4162 4150 M: Adaptec OEM Raid Solutions <aacraid@adaptec.com> ··· 4175 4161 S: Maintained 4176 4162 F: Documentation/networking/ipvs-sysctl.txt 4177 4163 F: include/net/ip_vs.h 4178 - F: include/linux/ip_vs.h 4164 + F: include/uapi/linux/ip_vs.h 4179 4165 F: net/netfilter/ipvs/ 4180 4166 4181 4167 IPWIRELESS DRIVER ··· 4188 4174 M: Arnaldo Carvalho de Melo <acme@ghostprotocols.net> 4189 4175 L: netdev@vger.kernel.org 4190 4176 S: Maintained 4191 - F: include/linux/ipx.h 4192 4177 F: include/net/ipx.h 4178 + F: include/uapi/linux/ipx.h 4193 4179 F: net/ipx/ 4194 4180 4195 4181 IRDA SUBSYSTEM ··· 4252 4238 F: drivers/isdn/ 4253 4239 F: include/linux/isdn.h 4254 4240 F: include/linux/isdn/ 4241 + F: include/uapi/linux/isdn.h 4242 + F: include/uapi/linux/isdn/ 4255 4243 4256 4244 ISDN SUBSYSTEM (Eicon active card driver) 4257 4245 M: Armin Schindler <mac@melware.de> ··· 4294 4278 S: Maintained 4295 4279 F: Documentation/video4linux/*.ivtv 4296 4280 F: drivers/media/pci/ivtv/ 4297 - F: include/linux/ivtv* 4281 + F: include/uapi/linux/ivtv* 4298 4282 4299 4283 IX2505V MEDIA DRIVER 4300 4284 M: Malcolm Priestley <tvboxspy@gmail.com> ··· 4332 4316 W: http://www.linux-mtd.infradead.org/doc/jffs2.html 4333 4317 S: Maintained 4334 4318 F: fs/jffs2/ 4335 - F: include/linux/jffs2.h 4319 + F: include/uapi/linux/jffs2.h 4336 4320 4337 4321 JOURNALLING LAYER FOR BLOCK DEVICES (JBD) 4338 4322 M: Andrew Morton <akpm@linux-foundation.org> ··· 4415 4399 S: Supported 4416 4400 F: fs/nfsd/ 4417 4401 F: include/linux/nfsd/ 4402 + F: include/uapi/linux/nfsd/ 4418 4403 F: fs/lockd/ 4419 4404 F: fs/nfs_common/ 4420 4405 F: net/sunrpc/ 4421 4406 F: include/linux/lockd/ 4422 4407 F: include/linux/sunrpc/ 4408 + F: include/uapi/linux/sunrpc/ 4423 4409 4424 4410 KERNEL VIRTUAL MACHINE (KVM) 4425 4411 M: Marcelo Tosatti <mtosatti@redhat.com> ··· 4433 4415 F: arch/*/kvm/ 4434 4416 F: arch/*/include/asm/kvm* 4435 4417 F: include/linux/kvm* 4418 + F: include/uapi/linux/kvm* 4436 4419 F: virt/kvm/ 4437 4420 4438 4421 KERNEL VIRTUAL MACHINE (KVM) FOR AMD-V ··· 4480 4461 L: kexec@lists.infradead.org 4481 4462 S: Maintained 4482 4463 F: include/linux/kexec.h 4464 + F: include/uapi/linux/kexec.h 4483 4465 F: kernel/kexec.c 4484 4466 4485 4467 KEYS/KEYRINGS: ··· 4722 4702 M: Arnaldo Carvalho de Melo <acme@ghostprotocols.net> 4723 4703 S: Maintained 4724 4704 F: include/linux/llc.h 4705 + F: include/uapi/linux/llc.h 4725 4706 F: include/net/llc* 4726 4707 F: net/llc/ 4727 4708 ··· 4943 4922 L: linux-fbdev@vger.kernel.org 4944 4923 S: Orphan 4945 4924 F: drivers/video/matrox/matroxfb_* 4946 - F: include/linux/matroxfb.h 4925 + F: include/uapi/linux/matroxfb.h 4947 4926 4948 4927 MAX16065 HARDWARE MONITOR DRIVER 4949 4928 M: Guenter Roeck <linux@roeck-us.net> ··· 5025 5004 S: Maintained 5026 5005 F: drivers/mtd/ 5027 5006 F: include/linux/mtd/ 5028 - F: include/mtd/ 5007 + F: include/uapi/mtd/ 5029 5008 5030 5009 MICROBLAZE ARCHITECTURE 5031 5010 M: Michal Simek <monstr@monstr.eu> ··· 5062 5041 F: Documentation/video4linux/meye.txt 5063 5042 F: drivers/media/pci/meye/ 5064 5043 F: include/uapi/linux/meye.h 5065 - 5066 - MOTOROLA IMX MMC/SD HOST CONTROLLER INTERFACE DRIVER 5067 - M: Pavel Pisa <ppisa@pikron.com> 5068 - L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers) 5069 - S: Maintained 5070 - F: drivers/mmc/host/imxmmc.* 5071 5044 5072 5045 MOXA SMARTIO/INDUSTIO/INTELLIO SERIAL CARD 5073 5046 M: Jiri Slaby <jirislaby@gmail.com> ··· 5101 5086 S: Maintained 5102 5087 F: drivers/mmc/ 5103 5088 F: include/linux/mmc/ 5089 + F: include/uapi/linux/mmc/ 5104 5090 5105 5091 MULTIMEDIA CARD (MMC) ETC. OVER SPI 5106 5092 S: Orphan ··· 5202 5186 F: include/linux/netfilter* 5203 5187 F: include/linux/netfilter/ 5204 5188 F: include/net/netfilter/ 5189 + F: include/uapi/linux/netfilter* 5190 + F: include/uapi/linux/netfilter/ 5205 5191 F: net/*/netfilter.c 5206 5192 F: net/*/netfilter/ 5207 5193 F: net/netfilter/ ··· 5222 5204 L: linux-hams@vger.kernel.org 5223 5205 W: http://www.linux-ax25.org/ 5224 5206 S: Maintained 5225 - F: include/linux/netrom.h 5226 5207 F: include/net/netrom.h 5208 + F: include/uapi/linux/netrom.h 5227 5209 F: net/netrom/ 5228 5210 5229 5211 NETWORK BLOCK DEVICE (NBD) ··· 5232 5214 F: Documentation/blockdev/nbd.txt 5233 5215 F: drivers/block/nbd.c 5234 5216 F: include/linux/nbd.h 5217 + F: include/uapi/linux/nbd.h 5235 5218 5236 5219 NETWORK DROP MONITOR 5237 5220 M: Neil Horman <nhorman@tuxdriver.com> ··· 5254 5235 F: include/linux/in.h 5255 5236 F: include/linux/net.h 5256 5237 F: include/linux/netdevice.h 5238 + F: include/uapi/linux/in.h 5239 + F: include/uapi/linux/net.h 5240 + F: include/uapi/linux/netdevice.h 5257 5241 5258 5242 NETWORKING [IPv4/IPv6] 5259 5243 M: "David S. Miller" <davem@davemloft.net> ··· 5302 5280 F: net/wireless/ 5303 5281 F: include/net/ieee80211* 5304 5282 F: include/linux/wireless.h 5283 + F: include/uapi/linux/wireless.h 5305 5284 F: include/net/iw_handler.h 5306 5285 F: drivers/net/wireless/ 5307 5286 ··· 5322 5299 F: include/linux/fddidevice.h 5323 5300 F: include/linux/hippidevice.h 5324 5301 F: include/linux/inetdevice.h 5302 + F: include/uapi/linux/if_* 5303 + F: include/uapi/linux/netdevice.h 5325 5304 5326 5305 NETXEN (1/10) GbE SUPPORT 5327 5306 M: Sony Chacko <sony.chacko@qlogic.com> ··· 5341 5316 L: linux-nfc@lists.01.org (moderated for non-subscribers) 5342 5317 S: Maintained 5343 5318 F: net/nfc/ 5344 - F: include/linux/nfc.h 5345 5319 F: include/net/nfc/ 5320 + F: include/uapi/linux/nfc.h 5346 5321 F: drivers/nfc/ 5347 5322 F: include/linux/platform_data/pn544.h 5348 5323 ··· 5359 5334 F: include/linux/lockd/ 5360 5335 F: include/linux/nfs* 5361 5336 F: include/linux/sunrpc/ 5337 + F: include/uapi/linux/nfs* 5338 + F: include/uapi/linux/sunrpc/ 5362 5339 5363 5340 NI5010 NETWORK DRIVER 5364 5341 M: Jan-Pascal van Best <janpascal@vanbest.org> ··· 5550 5523 S: Maintained 5551 5524 F: drivers/char/pcmcia/cm4000_cs.c 5552 5525 F: include/linux/cm4000_cs.h 5526 + F: include/uapi/linux/cm4000_cs.h 5553 5527 5554 5528 OMNIKEY CARDMAN 4040 DRIVER 5555 5529 M: Harald Welte <laforge@gnumonks.org> ··· 5709 5681 F: drivers/parport/ 5710 5682 F: include/linux/parport*.h 5711 5683 F: drivers/char/ppdev.c 5712 - F: include/linux/ppdev.h 5684 + F: include/uapi/linux/ppdev.h 5713 5685 5714 5686 PARAVIRT_OPS INTERFACE 5715 5687 M: Jeremy Fitzhardinge <jeremy@goop.org> ··· 5850 5822 S: Supported 5851 5823 F: kernel/events/* 5852 5824 F: include/linux/perf_event.h 5825 + F: include/uapi/linux/perf_event.h 5853 5826 F: arch/*/kernel/perf_event*.c 5854 5827 F: arch/*/kernel/*/perf_event*.c 5855 5828 F: arch/*/kernel/*/*/perf_event*.c 5856 5829 F: arch/*/include/asm/perf_event.h 5857 - F: arch/*/lib/perf_event*.c 5858 5830 F: arch/*/kernel/perf_callchain.c 5859 5831 F: tools/perf/ 5860 5832 ··· 5863 5835 L: linux-abi-devel@lists.sourceforge.net 5864 5836 S: Maintained 5865 5837 F: include/linux/personality.h 5838 + F: include/uapi/linux/personality.h 5866 5839 5867 5840 PHONET PROTOCOL 5868 5841 M: Remi Denis-Courmont <courmisch@gmail.com> ··· 5871 5842 F: Documentation/networking/phonet.txt 5872 5843 F: include/linux/phonet.h 5873 5844 F: include/net/phonet/ 5845 + F: include/uapi/linux/phonet.h 5874 5846 F: net/phonet/ 5875 5847 5876 5848 PHRAM MTD DRIVER ··· 5920 5890 S: Maintained 5921 5891 F: drivers/block/pktcdvd.c 5922 5892 F: include/linux/pktcdvd.h 5893 + F: include/uapi/linux/pktcdvd.h 5923 5894 5924 5895 PKUNITY SOC DRIVERS 5925 5896 M: Guan Xuetao <gxt@mprc.pku.edu.cn> ··· 5995 5964 M: Mitchell Blank Jr <mitch@sfgoth.com> 5996 5965 S: Maintained 5997 5966 F: net/atm/pppoatm.c 5998 - F: include/linux/atmppp.h 5967 + F: include/uapi/linux/atmppp.h 5999 5968 6000 5969 PPP OVER ETHERNET 6001 5970 M: Michal Ostrowski <mostrows@earthlink.net> ··· 6008 5977 S: Maintained 6009 5978 F: net/l2tp/l2tp_ppp.c 6010 5979 F: include/linux/if_pppol2tp.h 5980 + F: include/uapi/linux/if_pppol2tp.h 6011 5981 6012 5982 PPS SUPPORT 6013 5983 M: Rodolfo Giometti <giometti@enneenne.com> ··· 6106 6074 F: include/linux/ptrace.h 6107 6075 F: include/linux/regset.h 6108 6076 F: include/linux/tracehook.h 6077 + F: include/uapi/linux/ptrace.h 6109 6078 F: kernel/ptrace.c 6110 6079 6111 6080 PVRUSB2 VIDEO4LINUX DRIVER ··· 6135 6102 F: Documentation/pwm.txt 6136 6103 F: Documentation/devicetree/bindings/pwm/ 6137 6104 F: include/linux/pwm.h 6138 - F: include/linux/of_pwm.h 6139 6105 F: drivers/pwm/ 6140 6106 F: drivers/video/backlight/pwm_bl.c 6141 6107 F: include/linux/pwm_backlight.h ··· 6230 6198 W: http://www.alarsen.net/linux/qnx4fs/ 6231 6199 S: Maintained 6232 6200 F: fs/qnx4/ 6233 - F: include/linux/qnx4_fs.h 6234 - F: include/linux/qnxtypes.h 6201 + F: include/uapi/linux/qnx4_fs.h 6202 + F: include/uapi/linux/qnxtypes.h 6235 6203 6236 6204 QT1010 MEDIA DRIVER 6237 6205 M: Antti Palosaari <crope@iki.fi> ··· 6265 6233 L: linux-fbdev@vger.kernel.org 6266 6234 S: Maintained 6267 6235 F: drivers/video/aty/radeon* 6268 - F: include/linux/radeonfb.h 6236 + F: include/uapi/linux/radeonfb.h 6269 6237 6270 6238 RADIOSHARK RADIO DRIVER 6271 6239 M: Hans de Goede <hdegoede@redhat.com> ··· 6366 6334 F: Documentation/rtc.txt 6367 6335 F: drivers/rtc/ 6368 6336 F: include/linux/rtc.h 6337 + F: include/uapi/linux/rtc.h 6369 6338 6370 6339 REISERFS FILE SYSTEM 6371 6340 L: reiserfs-devel@vger.kernel.org ··· 6421 6388 L: linux-hams@vger.kernel.org 6422 6389 W: http://www.linux-ax25.org/ 6423 6390 S: Maintained 6424 - F: include/linux/rose.h 6425 6391 F: include/net/rose.h 6392 + F: include/uapi/linux/rose.h 6426 6393 F: net/rose/ 6427 6394 6428 6395 RTL2830 MEDIA DRIVER ··· 6599 6566 F: include/linux/clocksource.h 6600 6567 F: include/linux/time.h 6601 6568 F: include/linux/timex.h 6569 + F: include/uapi/linux/time.h 6570 + F: include/uapi/linux/timex.h 6602 6571 F: kernel/time/clocksource.c 6603 6572 F: kernel/time/time*.c 6604 6573 F: kernel/time/ntp.c ··· 6625 6590 S: Maintained 6626 6591 F: kernel/sched/ 6627 6592 F: include/linux/sched.h 6593 + F: include/uapi/linux/sched.h 6628 6594 6629 6595 SCORE ARCHITECTURE 6630 6596 M: Chen Liqin <liqin.chen@sunplusct.com> ··· 6779 6743 M: Jiri Slaby <jirislaby@gmail.com> 6780 6744 S: Maintained 6781 6745 F: drivers/misc/phantom.c 6782 - F: include/linux/phantom.h 6746 + F: include/uapi/linux/phantom.h 6783 6747 6784 6748 SERIAL ATA (SATA) SUBSYSTEM 6785 6749 M: Jeff Garzik <jgarzik@pobox.com> ··· 7037 7001 S: Supported 7038 7002 F: drivers/md/ 7039 7003 F: include/linux/raid/ 7004 + F: include/uapi/linux/raid/ 7040 7005 7041 7006 SONIC NETWORK DRIVER 7042 7007 M: Thomas Bogendoerfer <tsbogend@alpha.franken.de> ··· 7078 7041 S: Maintained 7079 7042 F: Documentation/sound/ 7080 7043 F: include/sound/ 7044 + F: include/uapi/sound/ 7081 7045 F: sound/ 7082 7046 7083 7047 SOUND - SOC LAYER / DYNAMIC AUDIO POWER MANAGEMENT (ASoC) ··· 7179 7141 F: Documentation/spi/ 7180 7142 F: drivers/spi/ 7181 7143 F: include/linux/spi/ 7144 + F: include/uapi/linux/spi/ 7182 7145 7183 7146 SPIDERNET NETWORK DRIVER for CELL 7184 7147 M: Ishizaki Kou <kou.ishizaki@toshiba.co.jp> ··· 7316 7277 STAGING - SILICON MOTION SM7XX FRAME BUFFER DRIVER 7317 7278 M: Teddy Wang <teddy.wang@siliconmotion.com.cn> 7318 7279 S: Odd Fixes 7319 - F: drivers/staging/sm7xx/ 7280 + F: drivers/staging/sm7xxfb/ 7320 7281 7321 7282 STAGING - SOFTLOGIC 6x10 MPEG CODEC 7322 7283 M: Ben Collins <bcollins@bluecherry.net> ··· 7442 7403 M: Jamal Hadi Salim <jhs@mojatatu.com> 7443 7404 L: netdev@vger.kernel.org 7444 7405 S: Maintained 7445 - F: include/linux/pkt_cls.h 7446 7406 F: include/net/pkt_cls.h 7407 + F: include/uapi/linux/pkt_cls.h 7447 7408 F: net/sched/ 7448 7409 7449 7410 TCP LOW PRIORITY MODULE ··· 7535 7496 S: Supported 7536 7497 F: drivers/net/team/ 7537 7498 F: include/linux/if_team.h 7499 + F: include/uapi/linux/if_team.h 7538 7500 7539 7501 TECHNOTREND USB IR RECEIVER 7540 7502 M: Sean Young <sean@mess.org> ··· 7634 7594 L: tipc-discussion@lists.sourceforge.net (user apps, general discussion) 7635 7595 W: http://tipc.sourceforge.net/ 7636 7596 S: Maintained 7637 - F: include/linux/tipc*.h 7597 + F: include/uapi/linux/tipc*.h 7638 7598 F: net/tipc/ 7639 7599 7640 7600 TILE ARCHITECTURE ··· 7684 7644 S: Maintained 7685 7645 F: drivers/char/toshiba.c 7686 7646 F: include/linux/toshiba.h 7647 + F: include/uapi/linux/toshiba.h 7687 7648 7688 7649 TMIO MMC DRIVER 7689 7650 M: Guennadi Liakhovetski <g.liakhovetski@gmx.de> ··· 7752 7711 F: include/linux/serial_core.h 7753 7712 F: include/linux/serial.h 7754 7713 F: include/linux/tty.h 7714 + F: include/uapi/linux/serial_core.h 7715 + F: include/uapi/linux/serial.h 7716 + F: include/uapi/linux/tty.h 7755 7717 7756 7718 TUA9001 MEDIA DRIVER 7757 7719 M: Antti Palosaari <crope@iki.fi> ··· 7834 7790 L: linux-input@vger.kernel.org 7835 7791 S: Maintained 7836 7792 F: drivers/hid/uhid.c 7837 - F: include/linux/uhid.h 7793 + F: include/uapi/linux/uhid.h 7838 7794 7839 7795 ULTRA-WIDEBAND (UWB) SUBSYSTEM: 7840 7796 L: linux-usb@vger.kernel.org ··· 7863 7819 F: Documentation/cdrom/ 7864 7820 F: drivers/cdrom/cdrom.c 7865 7821 F: include/linux/cdrom.h 7822 + F: include/uapi/linux/cdrom.h 7866 7823 7867 7824 UNIVERSAL FLASH STORAGE HOST CONTROLLER DRIVER 7868 7825 M: Vinayak Holikatti <vinholikatti@gmail.com> ··· 7881 7836 S: Maintained 7882 7837 F: drivers/mtd/ubi/ 7883 7838 F: include/linux/mtd/ubi.h 7884 - F: include/mtd/ubi-user.h 7839 + F: include/uapi/mtd/ubi-user.h 7885 7840 7886 7841 UNSORTED BLOCK IMAGES (UBI) Fastmap 7887 7842 M: Richard Weinberger <richard@nod.at> ··· 7915 7870 L: linux-usb@vger.kernel.org 7916 7871 S: Maintained 7917 7872 F: drivers/net/usb/cdc_*.c 7918 - F: include/linux/usb/cdc.h 7873 + F: include/uapi/linux/usb/cdc.h 7919 7874 7920 7875 USB CYPRESS C67X00 DRIVER 7921 7876 M: Peter Korsgaard <jacmet@sunsite.dk> ··· 8236 8191 F: Documentation/vfio.txt 8237 8192 F: drivers/vfio/ 8238 8193 F: include/linux/vfio.h 8194 + F: include/uapi/linux/vfio.h 8239 8195 8240 8196 VIDEOBUF2 FRAMEWORK 8241 8197 M: Pawel Osciak <pawel@osciak.com> ··· 8253 8207 S: Maintained 8254 8208 F: drivers/char/virtio_console.c 8255 8209 F: include/linux/virtio_console.h 8210 + F: include/uapi/linux/virtio_console.h 8256 8211 8257 8212 VIRTIO CORE, NET AND BLOCK DRIVERS 8258 8213 M: Rusty Russell <rusty@rustcorp.com.au> ··· 8272 8225 L: netdev@vger.kernel.org 8273 8226 S: Maintained 8274 8227 F: drivers/vhost/ 8275 - F: include/linux/vhost.h 8228 + F: include/uapi/linux/vhost.h 8276 8229 8277 8230 VIA RHINE NETWORK DRIVER 8278 8231 M: Roger Luethi <rl@hellgate.ch> ··· 8412 8365 F: Documentation/watchdog/ 8413 8366 F: drivers/watchdog/ 8414 8367 F: include/linux/watchdog.h 8368 + F: include/uapi/linux/watchdog.h 8415 8369 8416 8370 WD7000 SCSI DRIVER 8417 8371 M: Miroslav Zagorac <zaga@fly.cc.fer.hr> ··· 8438 8390 S: Supported 8439 8391 W: http://linuxwimax.org 8440 8392 F: Documentation/wimax/README.wimax 8441 - F: include/linux/wimax.h 8442 8393 F: include/linux/wimax/debug.h 8443 8394 F: include/net/wimax.h 8395 + F: include/uapi/linux/wimax.h 8444 8396 F: net/wimax/ 8445 8397 8446 8398 WISTRON LAPTOP BUTTON DRIVER ··· 8558 8510 F: drivers/xen/ 8559 8511 F: arch/x86/include/asm/xen/ 8560 8512 F: include/xen/ 8513 + F: include/uapi/xen/ 8561 8514 8562 8515 XEN HYPERVISOR ARM 8563 8516 M: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
+8
drivers/rtc/Kconfig
··· 352 352 This driver can also be built as a module. If so, the module 353 353 will be called rtc-twl. 354 354 355 + config RTC_DRV_TPS6586X 356 + tristate "TI TPS6586X RTC driver" 357 + depends on MFD_TPS6586X 358 + help 359 + TI Power Managment IC TPS6586X supports RTC functionality 360 + along with alarm. This driver supports the RTC driver for 361 + the TPS6586X RTC module. 362 + 355 363 config RTC_DRV_TPS65910 356 364 tristate "TI TPS65910 RTC driver" 357 365 depends on RTC_CLASS && MFD_TPS65910
+1
drivers/rtc/Makefile
··· 111 111 obj-$(CONFIG_RTC_DRV_TEST) += rtc-test.o 112 112 obj-$(CONFIG_RTC_DRV_TILE) += rtc-tile.o 113 113 obj-$(CONFIG_RTC_DRV_TWL4030) += rtc-twl.o 114 + obj-$(CONFIG_RTC_DRV_TPS6586X) += rtc-tps6586x.o 114 115 obj-$(CONFIG_RTC_DRV_TPS65910) += rtc-tps65910.o 115 116 obj-$(CONFIG_RTC_DRV_TX4939) += rtc-tx4939.o 116 117 obj-$(CONFIG_RTC_DRV_V3020) += rtc-v3020.o
+7
drivers/rtc/rtc-tegra.c
··· 303 303 .alarm_irq_enable = tegra_rtc_alarm_irq_enable, 304 304 }; 305 305 306 + static const struct of_device_id tegra_rtc_dt_match[] = { 307 + { .compatible = "nvidia,tegra20-rtc", }, 308 + {} 309 + }; 310 + MODULE_DEVICE_TABLE(of, tegra_rtc_dt_match); 311 + 306 312 static int tegra_rtc_probe(struct platform_device *pdev) 307 313 { 308 314 struct tegra_rtc_info *info; ··· 446 440 .driver = { 447 441 .name = "tegra_rtc", 448 442 .owner = THIS_MODULE, 443 + .of_match_table = tegra_rtc_dt_match, 449 444 }, 450 445 #ifdef CONFIG_PM 451 446 .suspend = tegra_rtc_suspend,
+356
drivers/rtc/rtc-tps6586x.c
··· 1 + /* 2 + * rtc-tps6586x.c: RTC driver for TI PMIC TPS6586X 3 + * 4 + * Copyright (c) 2012, NVIDIA Corporation. 5 + * 6 + * Author: Laxman Dewangan <ldewangan@nvidia.com> 7 + * 8 + * This program is free software; you can redistribute it and/or 9 + * modify it under the terms of the GNU General Public License as 10 + * published by the Free Software Foundation version 2. 11 + * 12 + * This program is distributed "as is" WITHOUT ANY WARRANTY of any kind, 13 + * whether express or implied; without even the implied warranty of 14 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 + * General Public License for more details. 16 + * 17 + * You should have received a copy of the GNU General Public License 18 + * along with this program; if not, write to the Free Software 19 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 20 + * 02111-1307, USA 21 + */ 22 + 23 + #include <linux/device.h> 24 + #include <linux/err.h> 25 + #include <linux/init.h> 26 + #include <linux/kernel.h> 27 + #include <linux/mfd/tps6586x.h> 28 + #include <linux/module.h> 29 + #include <linux/platform_device.h> 30 + #include <linux/pm_runtime.h> 31 + #include <linux/rtc.h> 32 + #include <linux/slab.h> 33 + 34 + #define RTC_CTRL 0xc0 35 + #define POR_RESET_N BIT(7) 36 + #define OSC_SRC_SEL BIT(6) 37 + #define RTC_ENABLE BIT(5) /* enables alarm */ 38 + #define RTC_BUF_ENABLE BIT(4) /* 32 KHz buffer enable */ 39 + #define PRE_BYPASS BIT(3) /* 0=1KHz or 1=32KHz updates */ 40 + #define CL_SEL_MASK (BIT(2)|BIT(1)) 41 + #define CL_SEL_POS 1 42 + #define RTC_ALARM1_HI 0xc1 43 + #define RTC_COUNT4 0xc6 44 + 45 + /* start a PMU RTC access by reading the register prior to the RTC_COUNT4 */ 46 + #define RTC_COUNT4_DUMMYREAD 0xc5 47 + 48 + /*only 14-bits width in second*/ 49 + #define ALM1_VALID_RANGE_IN_SEC 0x3FFF 50 + 51 + #define TPS6586X_RTC_CL_SEL_1_5PF 0x0 52 + #define TPS6586X_RTC_CL_SEL_6_5PF 0x1 53 + #define TPS6586X_RTC_CL_SEL_7_5PF 0x2 54 + #define TPS6586X_RTC_CL_SEL_12_5PF 0x3 55 + 56 + struct tps6586x_rtc { 57 + struct device *dev; 58 + struct rtc_device *rtc; 59 + int irq; 60 + bool irq_en; 61 + unsigned long long epoch_start; 62 + }; 63 + 64 + static inline struct device *to_tps6586x_dev(struct device *dev) 65 + { 66 + return dev->parent; 67 + } 68 + 69 + static int tps6586x_rtc_read_time(struct device *dev, struct rtc_time *tm) 70 + { 71 + struct tps6586x_rtc *rtc = dev_get_drvdata(dev); 72 + struct device *tps_dev = to_tps6586x_dev(dev); 73 + unsigned long long ticks = 0; 74 + unsigned long seconds; 75 + u8 buff[6]; 76 + int ret; 77 + int i; 78 + 79 + ret = tps6586x_reads(tps_dev, RTC_COUNT4_DUMMYREAD, sizeof(buff), buff); 80 + if (ret < 0) { 81 + dev_err(dev, "read counter failed with err %d\n", ret); 82 + return ret; 83 + } 84 + 85 + for (i = 1; i < sizeof(buff); i++) { 86 + ticks <<= 8; 87 + ticks |= buff[i]; 88 + } 89 + 90 + seconds = ticks >> 10; 91 + seconds += rtc->epoch_start; 92 + rtc_time_to_tm(seconds, tm); 93 + return rtc_valid_tm(tm); 94 + } 95 + 96 + static int tps6586x_rtc_set_time(struct device *dev, struct rtc_time *tm) 97 + { 98 + struct tps6586x_rtc *rtc = dev_get_drvdata(dev); 99 + struct device *tps_dev = to_tps6586x_dev(dev); 100 + unsigned long long ticks; 101 + unsigned long seconds; 102 + u8 buff[5]; 103 + int ret; 104 + 105 + rtc_tm_to_time(tm, &seconds); 106 + if (seconds < rtc->epoch_start) { 107 + dev_err(dev, "requested time unsupported\n"); 108 + return -EINVAL; 109 + } 110 + seconds -= rtc->epoch_start; 111 + 112 + ticks = (unsigned long long)seconds << 10; 113 + buff[0] = (ticks >> 32) & 0xff; 114 + buff[1] = (ticks >> 24) & 0xff; 115 + buff[2] = (ticks >> 16) & 0xff; 116 + buff[3] = (ticks >> 8) & 0xff; 117 + buff[4] = ticks & 0xff; 118 + 119 + /* Disable RTC before changing time */ 120 + ret = tps6586x_clr_bits(tps_dev, RTC_CTRL, RTC_ENABLE); 121 + if (ret < 0) { 122 + dev_err(dev, "failed to clear RTC_ENABLE\n"); 123 + return ret; 124 + } 125 + 126 + ret = tps6586x_writes(tps_dev, RTC_COUNT4, sizeof(buff), buff); 127 + if (ret < 0) { 128 + dev_err(dev, "failed to program new time\n"); 129 + return ret; 130 + } 131 + 132 + /* Enable RTC */ 133 + ret = tps6586x_set_bits(tps_dev, RTC_CTRL, RTC_ENABLE); 134 + if (ret < 0) { 135 + dev_err(dev, "failed to set RTC_ENABLE\n"); 136 + return ret; 137 + } 138 + return 0; 139 + } 140 + 141 + static int tps6586x_rtc_alarm_irq_enable(struct device *dev, 142 + unsigned int enabled) 143 + { 144 + struct tps6586x_rtc *rtc = dev_get_drvdata(dev); 145 + 146 + if (enabled && !rtc->irq_en) { 147 + enable_irq(rtc->irq); 148 + rtc->irq_en = true; 149 + } else if (!enabled && rtc->irq_en) { 150 + disable_irq(rtc->irq); 151 + rtc->irq_en = false; 152 + } 153 + return 0; 154 + } 155 + 156 + static int tps6586x_rtc_set_alarm(struct device *dev, struct rtc_wkalrm *alrm) 157 + { 158 + struct tps6586x_rtc *rtc = dev_get_drvdata(dev); 159 + struct device *tps_dev = to_tps6586x_dev(dev); 160 + unsigned long seconds; 161 + unsigned long ticks; 162 + unsigned long rtc_current_time; 163 + unsigned long long rticks = 0; 164 + u8 buff[3]; 165 + u8 rbuff[6]; 166 + int ret; 167 + int i; 168 + 169 + rtc_tm_to_time(&alrm->time, &seconds); 170 + 171 + if (alrm->enabled && (seconds < rtc->epoch_start)) { 172 + dev_err(dev, "can't set alarm to requested time\n"); 173 + return -EINVAL; 174 + } 175 + 176 + ret = tps6586x_rtc_alarm_irq_enable(dev, alrm->enabled); 177 + if (ret < 0) { 178 + dev_err(dev, "can't set alarm irq, err %d\n", ret); 179 + return ret; 180 + } 181 + 182 + seconds -= rtc->epoch_start; 183 + ret = tps6586x_reads(tps_dev, RTC_COUNT4_DUMMYREAD, 184 + sizeof(rbuff), rbuff); 185 + if (ret < 0) { 186 + dev_err(dev, "read counter failed with err %d\n", ret); 187 + return ret; 188 + } 189 + 190 + for (i = 1; i < sizeof(rbuff); i++) { 191 + rticks <<= 8; 192 + rticks |= rbuff[i]; 193 + } 194 + 195 + rtc_current_time = rticks >> 10; 196 + if ((seconds - rtc_current_time) > ALM1_VALID_RANGE_IN_SEC) 197 + seconds = rtc_current_time - 1; 198 + 199 + ticks = (unsigned long long)seconds << 10; 200 + buff[0] = (ticks >> 16) & 0xff; 201 + buff[1] = (ticks >> 8) & 0xff; 202 + buff[2] = ticks & 0xff; 203 + 204 + ret = tps6586x_writes(tps_dev, RTC_ALARM1_HI, sizeof(buff), buff); 205 + if (ret) 206 + dev_err(dev, "programming alarm failed with err %d\n", ret); 207 + 208 + return ret; 209 + } 210 + 211 + static int tps6586x_rtc_read_alarm(struct device *dev, struct rtc_wkalrm *alrm) 212 + { 213 + struct tps6586x_rtc *rtc = dev_get_drvdata(dev); 214 + struct device *tps_dev = to_tps6586x_dev(dev); 215 + unsigned long ticks; 216 + unsigned long seconds; 217 + u8 buff[3]; 218 + int ret; 219 + 220 + ret = tps6586x_reads(tps_dev, RTC_ALARM1_HI, sizeof(buff), buff); 221 + if (ret) { 222 + dev_err(dev, "read RTC_ALARM1_HI failed with err %d\n", ret); 223 + return ret; 224 + } 225 + 226 + ticks = (buff[0] << 16) | (buff[1] << 8) | buff[2]; 227 + seconds = ticks >> 10; 228 + seconds += rtc->epoch_start; 229 + 230 + rtc_time_to_tm(seconds, &alrm->time); 231 + return 0; 232 + } 233 + 234 + static const struct rtc_class_ops tps6586x_rtc_ops = { 235 + .read_time = tps6586x_rtc_read_time, 236 + .set_time = tps6586x_rtc_set_time, 237 + .set_alarm = tps6586x_rtc_set_alarm, 238 + .read_alarm = tps6586x_rtc_read_alarm, 239 + .alarm_irq_enable = tps6586x_rtc_alarm_irq_enable, 240 + }; 241 + 242 + static irqreturn_t tps6586x_rtc_irq(int irq, void *data) 243 + { 244 + struct tps6586x_rtc *rtc = data; 245 + 246 + rtc_update_irq(rtc->rtc, 1, RTC_IRQF | RTC_AF); 247 + return IRQ_HANDLED; 248 + } 249 + 250 + static int tps6586x_rtc_probe(struct platform_device *pdev) 251 + { 252 + struct device *tps_dev = to_tps6586x_dev(&pdev->dev); 253 + struct tps6586x_rtc *rtc; 254 + int ret; 255 + 256 + rtc = devm_kzalloc(&pdev->dev, sizeof(*rtc), GFP_KERNEL); 257 + if (!rtc) 258 + return -ENOMEM; 259 + 260 + rtc->dev = &pdev->dev; 261 + rtc->irq = platform_get_irq(pdev, 0); 262 + 263 + /* Set epoch start as 00:00:00:01:01:2009 */ 264 + rtc->epoch_start = mktime(2009, 1, 1, 0, 0, 0); 265 + 266 + /* 1 kHz tick mode, enable tick counting */ 267 + ret = tps6586x_update(tps_dev, RTC_CTRL, 268 + RTC_ENABLE | OSC_SRC_SEL | 269 + ((TPS6586X_RTC_CL_SEL_1_5PF << CL_SEL_POS) & CL_SEL_MASK), 270 + RTC_ENABLE | OSC_SRC_SEL | PRE_BYPASS | CL_SEL_MASK); 271 + if (ret < 0) { 272 + dev_err(&pdev->dev, "unable to start counter\n"); 273 + return ret; 274 + } 275 + 276 + platform_set_drvdata(pdev, rtc); 277 + rtc->rtc = rtc_device_register(dev_name(&pdev->dev), &pdev->dev, 278 + &tps6586x_rtc_ops, THIS_MODULE); 279 + if (IS_ERR(rtc->rtc)) { 280 + ret = PTR_ERR(rtc->rtc); 281 + dev_err(&pdev->dev, "RTC device register: ret %d\n", ret); 282 + goto fail_rtc_register; 283 + } 284 + 285 + ret = request_threaded_irq(rtc->irq, NULL, tps6586x_rtc_irq, 286 + IRQF_ONESHOT | IRQF_EARLY_RESUME, 287 + dev_name(&pdev->dev), rtc); 288 + if (ret < 0) { 289 + dev_err(&pdev->dev, "request IRQ(%d) failed with ret %d\n", 290 + rtc->irq, ret); 291 + goto fail_req_irq; 292 + } 293 + disable_irq(rtc->irq); 294 + device_set_wakeup_capable(&pdev->dev, 1); 295 + return 0; 296 + 297 + fail_req_irq: 298 + rtc_device_unregister(rtc->rtc); 299 + 300 + fail_rtc_register: 301 + tps6586x_update(tps_dev, RTC_CTRL, 0, 302 + RTC_ENABLE | OSC_SRC_SEL | PRE_BYPASS | CL_SEL_MASK); 303 + return ret; 304 + }; 305 + 306 + static int tps6586x_rtc_remove(struct platform_device *pdev) 307 + { 308 + struct tps6586x_rtc *rtc = platform_get_drvdata(pdev); 309 + struct device *tps_dev = to_tps6586x_dev(&pdev->dev); 310 + 311 + tps6586x_update(tps_dev, RTC_CTRL, 0, 312 + RTC_ENABLE | OSC_SRC_SEL | PRE_BYPASS | CL_SEL_MASK); 313 + rtc_device_unregister(rtc->rtc); 314 + free_irq(rtc->irq, rtc); 315 + return 0; 316 + } 317 + 318 + #ifdef CONFIG_PM_SLEEP 319 + static int tps6586x_rtc_suspend(struct device *dev) 320 + { 321 + struct tps6586x_rtc *rtc = dev_get_drvdata(dev); 322 + 323 + if (device_may_wakeup(dev)) 324 + enable_irq_wake(rtc->irq); 325 + return 0; 326 + } 327 + 328 + static int tps6586x_rtc_resume(struct device *dev) 329 + { 330 + struct tps6586x_rtc *rtc = dev_get_drvdata(dev); 331 + 332 + if (device_may_wakeup(dev)) 333 + disable_irq_wake(rtc->irq); 334 + return 0; 335 + } 336 + #endif 337 + 338 + static const struct dev_pm_ops tps6586x_pm_ops = { 339 + SET_SYSTEM_SLEEP_PM_OPS(tps6586x_rtc_suspend, tps6586x_rtc_resume) 340 + }; 341 + 342 + static struct platform_driver tps6586x_rtc_driver = { 343 + .driver = { 344 + .name = "tps6586x-rtc", 345 + .owner = THIS_MODULE, 346 + .pm = &tps6586x_pm_ops, 347 + }, 348 + .probe = tps6586x_rtc_probe, 349 + .remove = tps6586x_rtc_remove, 350 + }; 351 + module_platform_driver(tps6586x_rtc_driver); 352 + 353 + MODULE_ALIAS("platform:rtc-tps6586x"); 354 + MODULE_DESCRIPTION("TI TPS6586x RTC driver"); 355 + MODULE_AUTHOR("Laxman dewangan <ldewangan@nvidia.com>"); 356 + MODULE_LICENSE("GPL v2");
+6 -5
drivers/rtc/rtc-vt8500.c
··· 70 70 | ALARM_SEC_BIT) 71 71 72 72 #define VT8500_RTC_CR_ENABLE (1 << 0) /* Enable RTC */ 73 - #define VT8500_RTC_CR_24H (1 << 1) /* 24h time format */ 73 + #define VT8500_RTC_CR_12H (1 << 1) /* 12h time format */ 74 74 #define VT8500_RTC_CR_SM_ENABLE (1 << 2) /* Enable periodic irqs */ 75 75 #define VT8500_RTC_CR_SM_SEC (1 << 3) /* 0: 1Hz/60, 1: 1Hz */ 76 76 #define VT8500_RTC_CR_CALIB (1 << 4) /* Enable calibration */ ··· 119 119 tm->tm_min = bcd2bin((time & TIME_MIN_MASK) >> TIME_MIN_S); 120 120 tm->tm_hour = bcd2bin((time & TIME_HOUR_MASK) >> TIME_HOUR_S); 121 121 tm->tm_mday = bcd2bin(date & DATE_DAY_MASK); 122 - tm->tm_mon = bcd2bin((date & DATE_MONTH_MASK) >> DATE_MONTH_S); 122 + tm->tm_mon = bcd2bin((date & DATE_MONTH_MASK) >> DATE_MONTH_S) - 1; 123 123 tm->tm_year = bcd2bin((date & DATE_YEAR_MASK) >> DATE_YEAR_S) 124 124 + ((date >> DATE_CENTURY_S) & 1 ? 200 : 100); 125 125 tm->tm_wday = (time & TIME_DOW_MASK) >> TIME_DOW_S; ··· 138 138 } 139 139 140 140 writel((bin2bcd(tm->tm_year - 100) << DATE_YEAR_S) 141 - | (bin2bcd(tm->tm_mon) << DATE_MONTH_S) 142 - | (bin2bcd(tm->tm_mday)), 141 + | (bin2bcd(tm->tm_mon + 1) << DATE_MONTH_S) 142 + | (bin2bcd(tm->tm_mday)) 143 + | ((tm->tm_year >= 200) << DATE_CENTURY_S), 143 144 vt8500_rtc->regbase + VT8500_RTC_DS); 144 145 writel((bin2bcd(tm->tm_wday) << TIME_DOW_S) 145 146 | (bin2bcd(tm->tm_hour) << TIME_HOUR_S) ··· 248 247 } 249 248 250 249 /* Enable RTC and set it to 24-hour mode */ 251 - writel(VT8500_RTC_CR_ENABLE | VT8500_RTC_CR_24H, 250 + writel(VT8500_RTC_CR_ENABLE, 252 251 vt8500_rtc->regbase + VT8500_RTC_CR); 253 252 254 253 vt8500_rtc->rtc = rtc_device_register("vt8500-rtc", &pdev->dev,
+9
include/asm-generic/tlb.h
··· 78 78 #define MAX_GATHER_BATCH \ 79 79 ((PAGE_SIZE - sizeof(struct mmu_gather_batch)) / sizeof(void *)) 80 80 81 + /* 82 + * Limit the maximum number of mmu_gather batches to reduce a risk of soft 83 + * lockups for non-preemptible kernels on huge machines when a lot of memory 84 + * is zapped during unmapping. 85 + * 10K pages freed at once should be safe even without a preemption point. 86 + */ 87 + #define MAX_GATHER_BATCH_COUNT (10000UL/MAX_GATHER_BATCH) 88 + 81 89 /* struct mmu_gather is an opaque type used by the mm code for passing around 82 90 * any data needed by arch specific code for tlb_remove_page. 83 91 */ ··· 104 96 struct mmu_gather_batch *active; 105 97 struct mmu_gather_batch local; 106 98 struct page *__pages[MMU_GATHER_BUNDLE]; 99 + unsigned int batch_count; 107 100 }; 108 101 109 102 #define HAVE_GENERIC_MMU_GATHER
+1
include/linux/ipc_namespace.h
··· 24 24 unsigned short seq_max; 25 25 struct rw_semaphore rw_mutex; 26 26 struct idr ipcs_idr; 27 + int next_id; 27 28 }; 28 29 29 30 struct ipc_namespace {
-8
include/linux/mmzone.h
··· 503 503 * rarely used fields: 504 504 */ 505 505 const char *name; 506 - #ifdef CONFIG_MEMORY_ISOLATION 507 - /* 508 - * the number of MIGRATE_ISOLATE *pageblock*. 509 - * We need this for free page counting. Look at zone_watermark_ok_safe. 510 - * It's protected by zone->lock 511 - */ 512 - int nr_pageblock_isolate; 513 - #endif 514 506 } ____cacheline_internodealigned_in_smp; 515 507 516 508 typedef enum {
+4 -2
include/linux/msg.h
··· 34 34 /* Helper routines for sys_msgsnd and sys_msgrcv */ 35 35 extern long do_msgsnd(int msqid, long mtype, void __user *mtext, 36 36 size_t msgsz, int msgflg); 37 - extern long do_msgrcv(int msqid, long *pmtype, void __user *mtext, 38 - size_t msgsz, long msgtyp, int msgflg); 37 + extern long do_msgrcv(int msqid, void __user *buf, size_t bufsz, long msgtyp, 38 + int msgflg, 39 + long (*msg_fill)(void __user *, struct msg_msg *, 40 + size_t)); 39 41 40 42 #endif /* _LINUX_MSG_H */
+1
include/uapi/linux/msg.h
··· 10 10 /* msgrcv options */ 11 11 #define MSG_NOERROR 010000 /* no error if message is too big */ 12 12 #define MSG_EXCEPT 020000 /* recv any msg except of specified type.*/ 13 + #define MSG_COPY 040000 /* copy (not remove) all queue messages */ 13 14 14 15 /* Obsolete, used only for backwards compatibility and libc5 compiles */ 15 16 struct msqid_ds {
+20 -26
ipc/compat.c
··· 306 306 return err; 307 307 } 308 308 309 + long compat_do_msg_fill(void __user *dest, struct msg_msg *msg, size_t bufsz) 310 + { 311 + struct compat_msgbuf __user *msgp = dest; 312 + size_t msgsz; 313 + 314 + if (put_user(msg->m_type, &msgp->mtype)) 315 + return -EFAULT; 316 + 317 + msgsz = (bufsz > msg->m_ts) ? msg->m_ts : bufsz; 318 + if (store_msg(msgp->mtext, msg, msgsz)) 319 + return -EFAULT; 320 + return msgsz; 321 + } 322 + 309 323 #ifdef CONFIG_ARCH_WANT_OLD_COMPAT_IPC 310 324 long compat_sys_semctl(int first, int second, int third, void __user *uptr) 311 325 { ··· 351 337 long compat_sys_msgrcv(int first, int second, int msgtyp, int third, 352 338 int version, void __user *uptr) 353 339 { 354 - struct compat_msgbuf __user *up; 355 - long type; 356 - int err; 357 - 358 340 if (first < 0) 359 341 return -EINVAL; 360 342 if (second < 0) ··· 358 348 359 349 if (!version) { 360 350 struct compat_ipc_kludge ipck; 361 - err = -EINVAL; 362 351 if (!uptr) 363 - goto out; 364 - err = -EFAULT; 352 + return -EINVAL; 365 353 if (copy_from_user (&ipck, uptr, sizeof(ipck))) 366 - goto out; 354 + return -EFAULT; 367 355 uptr = compat_ptr(ipck.msgp); 368 356 msgtyp = ipck.msgtyp; 369 357 } 370 - up = uptr; 371 - err = do_msgrcv(first, &type, up->mtext, second, msgtyp, third); 372 - if (err < 0) 373 - goto out; 374 - if (put_user(type, &up->mtype)) 375 - err = -EFAULT; 376 - out: 377 - return err; 358 + return do_msgrcv(first, uptr, second, msgtyp, third, 359 + compat_do_msg_fill); 378 360 } 379 361 #else 380 362 long compat_sys_semctl(int semid, int semnum, int cmd, int arg) ··· 387 385 long compat_sys_msgrcv(int msqid, struct compat_msgbuf __user *msgp, 388 386 compat_ssize_t msgsz, long msgtyp, int msgflg) 389 387 { 390 - long err, mtype; 391 - 392 - err = do_msgrcv(msqid, &mtype, msgp->mtext, (ssize_t)msgsz, msgtyp, msgflg); 393 - if (err < 0) 394 - goto out; 395 - 396 - if (put_user(mtype, &msgp->mtype)) 397 - err = -EFAULT; 398 - out: 399 - return err; 388 + return do_msgrcv(msqid, msgp, (ssize_t)msgsz, msgtyp, msgflg, 389 + compat_do_msg_fill); 400 390 } 401 391 #endif 402 392
+32
ipc/ipc_sysctl.c
··· 158 158 159 159 static int zero; 160 160 static int one = 1; 161 + #ifdef CONFIG_CHECKPOINT_RESTORE 162 + static int int_max = INT_MAX; 163 + #endif 161 164 162 165 static struct ctl_table ipc_kern_table[] = { 163 166 { ··· 230 227 .extra1 = &zero, 231 228 .extra2 = &one, 232 229 }, 230 + #ifdef CONFIG_CHECKPOINT_RESTORE 231 + { 232 + .procname = "sem_next_id", 233 + .data = &init_ipc_ns.ids[IPC_SEM_IDS].next_id, 234 + .maxlen = sizeof(init_ipc_ns.ids[IPC_SEM_IDS].next_id), 235 + .mode = 0644, 236 + .proc_handler = proc_ipc_dointvec_minmax, 237 + .extra1 = &zero, 238 + .extra2 = &int_max, 239 + }, 240 + { 241 + .procname = "msg_next_id", 242 + .data = &init_ipc_ns.ids[IPC_MSG_IDS].next_id, 243 + .maxlen = sizeof(init_ipc_ns.ids[IPC_MSG_IDS].next_id), 244 + .mode = 0644, 245 + .proc_handler = proc_ipc_dointvec_minmax, 246 + .extra1 = &zero, 247 + .extra2 = &int_max, 248 + }, 249 + { 250 + .procname = "shm_next_id", 251 + .data = &init_ipc_ns.ids[IPC_SHM_IDS].next_id, 252 + .maxlen = sizeof(init_ipc_ns.ids[IPC_SHM_IDS].next_id), 253 + .mode = 0644, 254 + .proc_handler = proc_ipc_dointvec_minmax, 255 + .extra1 = &zero, 256 + .extra2 = &int_max, 257 + }, 258 + #endif 233 259 {} 234 260 }; 235 261
+96 -27
ipc/msg.c
··· 755 755 return SEARCH_EQUAL; 756 756 } 757 757 758 - long do_msgrcv(int msqid, long *pmtype, void __user *mtext, 759 - size_t msgsz, long msgtyp, int msgflg) 758 + static long do_msg_fill(void __user *dest, struct msg_msg *msg, size_t bufsz) 759 + { 760 + struct msgbuf __user *msgp = dest; 761 + size_t msgsz; 762 + 763 + if (put_user(msg->m_type, &msgp->mtype)) 764 + return -EFAULT; 765 + 766 + msgsz = (bufsz > msg->m_ts) ? msg->m_ts : bufsz; 767 + if (store_msg(msgp->mtext, msg, msgsz)) 768 + return -EFAULT; 769 + return msgsz; 770 + } 771 + 772 + #ifdef CONFIG_CHECKPOINT_RESTORE 773 + /* 774 + * This function creates new kernel message structure, large enough to store 775 + * bufsz message bytes. 776 + */ 777 + static inline struct msg_msg *prepare_copy(void __user *buf, size_t bufsz, 778 + int msgflg, long *msgtyp, 779 + unsigned long *copy_number) 780 + { 781 + struct msg_msg *copy; 782 + 783 + *copy_number = *msgtyp; 784 + *msgtyp = 0; 785 + /* 786 + * Create dummy message to copy real message to. 787 + */ 788 + copy = load_msg(buf, bufsz); 789 + if (!IS_ERR(copy)) 790 + copy->m_ts = bufsz; 791 + return copy; 792 + } 793 + 794 + static inline void free_copy(struct msg_msg *copy) 795 + { 796 + if (copy) 797 + free_msg(copy); 798 + } 799 + #else 800 + static inline struct msg_msg *prepare_copy(void __user *buf, size_t bufsz, 801 + int msgflg, long *msgtyp, 802 + unsigned long *copy_number) 803 + { 804 + return ERR_PTR(-ENOSYS); 805 + } 806 + 807 + static inline void free_copy(struct msg_msg *copy) 808 + { 809 + } 810 + #endif 811 + 812 + long do_msgrcv(int msqid, void __user *buf, size_t bufsz, long msgtyp, 813 + int msgflg, 814 + long (*msg_handler)(void __user *, struct msg_msg *, size_t)) 760 815 { 761 816 struct msg_queue *msq; 762 817 struct msg_msg *msg; 763 818 int mode; 764 819 struct ipc_namespace *ns; 820 + struct msg_msg *copy = NULL; 821 + unsigned long copy_number = 0; 765 822 766 - if (msqid < 0 || (long) msgsz < 0) 823 + if (msqid < 0 || (long) bufsz < 0) 767 824 return -EINVAL; 825 + if (msgflg & MSG_COPY) { 826 + copy = prepare_copy(buf, bufsz, msgflg, &msgtyp, &copy_number); 827 + if (IS_ERR(copy)) 828 + return PTR_ERR(copy); 829 + } 768 830 mode = convert_mode(&msgtyp, msgflg); 769 831 ns = current->nsproxy->ipc_ns; 770 832 771 833 msq = msg_lock_check(ns, msqid); 772 - if (IS_ERR(msq)) 834 + if (IS_ERR(msq)) { 835 + free_copy(copy); 773 836 return PTR_ERR(msq); 837 + } 774 838 775 839 for (;;) { 776 840 struct msg_receiver msr_d; 777 841 struct list_head *tmp; 842 + long msg_counter = 0; 778 843 779 844 msg = ERR_PTR(-EACCES); 780 845 if (ipcperms(ns, &msq->q_perm, S_IRUGO)) ··· 858 793 msg = walk_msg; 859 794 if (mode == SEARCH_LESSEQUAL && 860 795 walk_msg->m_type != 1) { 861 - msg = walk_msg; 862 796 msgtyp = walk_msg->m_type - 1; 863 - } else { 864 - msg = walk_msg; 797 + } else if (msgflg & MSG_COPY) { 798 + if (copy_number == msg_counter) { 799 + /* 800 + * Found requested message. 801 + * Copy it. 802 + */ 803 + msg = copy_msg(msg, copy); 804 + if (IS_ERR(msg)) 805 + goto out_unlock; 806 + break; 807 + } 808 + } else 865 809 break; 866 - } 810 + msg_counter++; 867 811 } 868 812 tmp = tmp->next; 869 813 } ··· 881 807 * Found a suitable message. 882 808 * Unlink it from the queue. 883 809 */ 884 - if ((msgsz < msg->m_ts) && !(msgflg & MSG_NOERROR)) { 810 + if ((bufsz < msg->m_ts) && !(msgflg & MSG_NOERROR)) { 885 811 msg = ERR_PTR(-E2BIG); 886 812 goto out_unlock; 887 813 } 814 + /* 815 + * If we are copying, then do not unlink message and do 816 + * not update queue parameters. 817 + */ 818 + if (msgflg & MSG_COPY) 819 + goto out_unlock; 888 820 list_del(&msg->m_list); 889 821 msq->q_qnum--; 890 822 msq->q_rtime = get_seconds(); ··· 914 834 if (msgflg & MSG_NOERROR) 915 835 msr_d.r_maxsize = INT_MAX; 916 836 else 917 - msr_d.r_maxsize = msgsz; 837 + msr_d.r_maxsize = bufsz; 918 838 msr_d.r_msg = ERR_PTR(-EAGAIN); 919 839 current->state = TASK_INTERRUPTIBLE; 920 840 msg_unlock(msq); ··· 974 894 break; 975 895 } 976 896 } 977 - if (IS_ERR(msg)) 897 + if (IS_ERR(msg)) { 898 + free_copy(copy); 978 899 return PTR_ERR(msg); 900 + } 979 901 980 - msgsz = (msgsz > msg->m_ts) ? msg->m_ts : msgsz; 981 - *pmtype = msg->m_type; 982 - if (store_msg(mtext, msg, msgsz)) 983 - msgsz = -EFAULT; 984 - 902 + bufsz = msg_handler(buf, msg, bufsz); 985 903 free_msg(msg); 986 904 987 - return msgsz; 905 + return bufsz; 988 906 } 989 907 990 908 SYSCALL_DEFINE5(msgrcv, int, msqid, struct msgbuf __user *, msgp, size_t, msgsz, 991 909 long, msgtyp, int, msgflg) 992 910 { 993 - long err, mtype; 994 - 995 - err = do_msgrcv(msqid, &mtype, msgp->mtext, msgsz, msgtyp, msgflg); 996 - if (err < 0) 997 - goto out; 998 - 999 - if (put_user(mtype, &msgp->mtype)) 1000 - err = -EFAULT; 1001 - out: 1002 - return err; 911 + return do_msgrcv(msqid, msgp, msgsz, msgtyp, msgflg, do_msg_fill); 1003 912 } 1004 913 1005 914 #ifdef CONFIG_PROC_FS
+43
ipc/msgutil.c
··· 102 102 free_msg(msg); 103 103 return ERR_PTR(err); 104 104 } 105 + #ifdef CONFIG_CHECKPOINT_RESTORE 106 + struct msg_msg *copy_msg(struct msg_msg *src, struct msg_msg *dst) 107 + { 108 + struct msg_msgseg *dst_pseg, *src_pseg; 109 + int len = src->m_ts; 110 + int alen; 105 111 112 + BUG_ON(dst == NULL); 113 + if (src->m_ts > dst->m_ts) 114 + return ERR_PTR(-EINVAL); 115 + 116 + alen = len; 117 + if (alen > DATALEN_MSG) 118 + alen = DATALEN_MSG; 119 + 120 + dst->next = NULL; 121 + dst->security = NULL; 122 + 123 + memcpy(dst + 1, src + 1, alen); 124 + 125 + len -= alen; 126 + dst_pseg = dst->next; 127 + src_pseg = src->next; 128 + while (len > 0) { 129 + alen = len; 130 + if (alen > DATALEN_SEG) 131 + alen = DATALEN_SEG; 132 + memcpy(dst_pseg + 1, src_pseg + 1, alen); 133 + dst_pseg = dst_pseg->next; 134 + len -= alen; 135 + src_pseg = src_pseg->next; 136 + } 137 + 138 + dst->m_type = src->m_type; 139 + dst->m_ts = src->m_ts; 140 + 141 + return dst; 142 + } 143 + #else 144 + struct msg_msg *copy_msg(struct msg_msg *src, struct msg_msg *dst) 145 + { 146 + return ERR_PTR(-ENOSYS); 147 + } 148 + #endif 106 149 int store_msg(void __user *dest, struct msg_msg *msg, int len) 107 150 { 108 151 int alen;
+12 -4
ipc/util.c
··· 122 122 123 123 ids->in_use = 0; 124 124 ids->seq = 0; 125 + ids->next_id = -1; 125 126 { 126 127 int seq_limit = INT_MAX/SEQ_MULTIPLIER; 127 128 if (seq_limit > USHRT_MAX) ··· 253 252 kuid_t euid; 254 253 kgid_t egid; 255 254 int id, err; 255 + int next_id = ids->next_id; 256 256 257 257 if (size > IPCMNI) 258 258 size = IPCMNI; ··· 266 264 rcu_read_lock(); 267 265 spin_lock(&new->lock); 268 266 269 - err = idr_get_new(&ids->ipcs_idr, new, &id); 267 + err = idr_get_new_above(&ids->ipcs_idr, new, 268 + (next_id < 0) ? 0 : ipcid_to_idx(next_id), &id); 270 269 if (err) { 271 270 spin_unlock(&new->lock); 272 271 rcu_read_unlock(); ··· 280 277 new->cuid = new->uid = euid; 281 278 new->gid = new->cgid = egid; 282 279 283 - new->seq = ids->seq++; 284 - if(ids->seq > ids->seq_max) 285 - ids->seq = 0; 280 + if (next_id < 0) { 281 + new->seq = ids->seq++; 282 + if (ids->seq > ids->seq_max) 283 + ids->seq = 0; 284 + } else { 285 + new->seq = ipcid_to_seqx(next_id); 286 + ids->next_id = -1; 287 + } 286 288 287 289 new->id = ipc_buildid(id, new->seq); 288 290 return id;
+2
ipc/util.h
··· 92 92 #define IPC_SHM_IDS 2 93 93 94 94 #define ipcid_to_idx(id) ((id) % SEQ_MULTIPLIER) 95 + #define ipcid_to_seqx(id) ((id) / SEQ_MULTIPLIER) 95 96 96 97 /* must be called with ids->rw_mutex acquired for writing */ 97 98 int ipc_addid(struct ipc_ids *, struct kern_ipc_perm *, int); ··· 140 139 141 140 extern void free_msg(struct msg_msg *msg); 142 141 extern struct msg_msg *load_msg(const void __user *src, int len); 142 + extern struct msg_msg *copy_msg(struct msg_msg *src, struct msg_msg *dst); 143 143 extern int store_msg(void __user *dest, struct msg_msg *msg, int len); 144 144 145 145 extern void recompute_msgmni(struct ipc_namespace *);
+4 -3
kernel/printk.c
··· 870 870 if (!printk_time) 871 871 return 0; 872 872 873 - if (!buf) 874 - return 15; 875 - 876 873 rem_nsec = do_div(ts, 1000000000); 874 + 875 + if (!buf) 876 + return snprintf(NULL, 0, "[%5lu.000000] ", (unsigned long)ts); 877 + 877 878 return sprintf(buf, "[%5lu.%06lu] ", 878 879 (unsigned long)ts, rem_nsec / 1000); 879 880 }
+5
mm/memory.c
··· 184 184 return 1; 185 185 } 186 186 187 + if (tlb->batch_count == MAX_GATHER_BATCH_COUNT) 188 + return 0; 189 + 187 190 batch = (void *)__get_free_pages(GFP_NOWAIT | __GFP_NOWARN, 0); 188 191 if (!batch) 189 192 return 0; 190 193 194 + tlb->batch_count++; 191 195 batch->next = NULL; 192 196 batch->nr = 0; 193 197 batch->max = MAX_GATHER_BATCH; ··· 220 216 tlb->local.nr = 0; 221 217 tlb->local.max = ARRAY_SIZE(tlb->__pages); 222 218 tlb->active = &tlb->local; 219 + tlb->batch_count = 0; 223 220 224 221 #ifdef CONFIG_HAVE_RCU_TABLE_FREE 225 222 tlb->batch = NULL;
-27
mm/page_alloc.c
··· 221 221 222 222 int page_group_by_mobility_disabled __read_mostly; 223 223 224 - /* 225 - * NOTE: 226 - * Don't use set_pageblock_migratetype(page, MIGRATE_ISOLATE) directly. 227 - * Instead, use {un}set_pageblock_isolate. 228 - */ 229 224 void set_pageblock_migratetype(struct page *page, int migratetype) 230 225 { 231 226 ··· 1650 1655 return true; 1651 1656 } 1652 1657 1653 - #ifdef CONFIG_MEMORY_ISOLATION 1654 - static inline unsigned long nr_zone_isolate_freepages(struct zone *zone) 1655 - { 1656 - if (unlikely(zone->nr_pageblock_isolate)) 1657 - return zone->nr_pageblock_isolate * pageblock_nr_pages; 1658 - return 0; 1659 - } 1660 - #else 1661 - static inline unsigned long nr_zone_isolate_freepages(struct zone *zone) 1662 - { 1663 - return 0; 1664 - } 1665 - #endif 1666 - 1667 1658 bool zone_watermark_ok(struct zone *z, int order, unsigned long mark, 1668 1659 int classzone_idx, int alloc_flags) 1669 1660 { ··· 1665 1684 if (z->percpu_drift_mark && free_pages < z->percpu_drift_mark) 1666 1685 free_pages = zone_page_state_snapshot(z, NR_FREE_PAGES); 1667 1686 1668 - /* 1669 - * If the zone has MIGRATE_ISOLATE type free pages, we should consider 1670 - * it. nr_zone_isolate_freepages is never accurate so kswapd might not 1671 - * sleep although it could do so. But this is more desirable for memory 1672 - * hotplug than sleeping which can cause a livelock in the direct 1673 - * reclaim path. 1674 - */ 1675 - free_pages -= nr_zone_isolate_freepages(z); 1676 1687 return __zone_watermark_ok(z, order, mark, classzone_idx, alloc_flags, 1677 1688 free_pages); 1678 1689 }
+2 -24
mm/page_isolation.c
··· 8 8 #include <linux/memory.h> 9 9 #include "internal.h" 10 10 11 - /* called while holding zone->lock */ 12 - static void set_pageblock_isolate(struct page *page) 13 - { 14 - if (get_pageblock_migratetype(page) == MIGRATE_ISOLATE) 15 - return; 16 - 17 - set_pageblock_migratetype(page, MIGRATE_ISOLATE); 18 - page_zone(page)->nr_pageblock_isolate++; 19 - } 20 - 21 - /* called while holding zone->lock */ 22 - static void restore_pageblock_isolate(struct page *page, int migratetype) 23 - { 24 - struct zone *zone = page_zone(page); 25 - if (WARN_ON(get_pageblock_migratetype(page) != MIGRATE_ISOLATE)) 26 - return; 27 - 28 - BUG_ON(zone->nr_pageblock_isolate <= 0); 29 - set_pageblock_migratetype(page, migratetype); 30 - zone->nr_pageblock_isolate--; 31 - } 32 - 33 11 int set_migratetype_isolate(struct page *page, bool skip_hwpoisoned_pages) 34 12 { 35 13 struct zone *zone; ··· 58 80 unsigned long nr_pages; 59 81 int migratetype = get_pageblock_migratetype(page); 60 82 61 - set_pageblock_isolate(page); 83 + set_pageblock_migratetype(page, MIGRATE_ISOLATE); 62 84 nr_pages = move_freepages_block(zone, page, MIGRATE_ISOLATE); 63 85 64 86 __mod_zone_freepage_state(zone, -nr_pages, migratetype); ··· 81 103 goto out; 82 104 nr_pages = move_freepages_block(zone, page, migratetype); 83 105 __mod_zone_freepage_state(zone, nr_pages, migratetype); 84 - restore_pageblock_isolate(page, migratetype); 106 + set_pageblock_migratetype(page, migratetype); 85 107 out: 86 108 spin_unlock_irqrestore(&zone->lock, flags); 87 109 }
+25
tools/testing/selftests/ipc/Makefile
··· 1 + uname_M := $(shell uname -m 2>/dev/null || echo not) 2 + ARCH ?= $(shell echo $(uname_M) | sed -e s/i.86/i386/) 3 + ifeq ($(ARCH),i386) 4 + ARCH := X86 5 + CFLAGS := -DCONFIG_X86_32 -D__i386__ 6 + endif 7 + ifeq ($(ARCH),x86_64) 8 + ARCH := X86 9 + CFLAGS := -DCONFIG_X86_64 -D__x86_64__ 10 + endif 11 + 12 + CFLAGS += -I../../../../usr/include/ 13 + 14 + all: 15 + ifeq ($(ARCH),X86) 16 + gcc $(CFLAGS) msgque.c -o msgque_test 17 + else 18 + echo "Not an x86 target, can't build msgque selftest" 19 + endif 20 + 21 + run_tests: all 22 + ./msgque_test 23 + 24 + clean: 25 + rm -fr ./msgque_test
+246
tools/testing/selftests/ipc/msgque.c
··· 1 + #include <stdlib.h> 2 + #include <stdio.h> 3 + #include <string.h> 4 + #include <errno.h> 5 + #include <linux/msg.h> 6 + #include <fcntl.h> 7 + 8 + #define MAX_MSG_SIZE 32 9 + 10 + struct msg1 { 11 + int msize; 12 + long mtype; 13 + char mtext[MAX_MSG_SIZE]; 14 + }; 15 + 16 + #define TEST_STRING "Test sysv5 msg" 17 + #define MSG_TYPE 1 18 + 19 + #define ANOTHER_TEST_STRING "Yet another test sysv5 msg" 20 + #define ANOTHER_MSG_TYPE 26538 21 + 22 + struct msgque_data { 23 + key_t key; 24 + int msq_id; 25 + int qbytes; 26 + int qnum; 27 + int mode; 28 + struct msg1 *messages; 29 + }; 30 + 31 + int restore_queue(struct msgque_data *msgque) 32 + { 33 + int fd, ret, id, i; 34 + char buf[32]; 35 + 36 + fd = open("/proc/sys/kernel/msg_next_id", O_WRONLY); 37 + if (fd == -1) { 38 + printf("Failed to open /proc/sys/kernel/msg_next_id\n"); 39 + return -errno; 40 + } 41 + sprintf(buf, "%d", msgque->msq_id); 42 + 43 + ret = write(fd, buf, strlen(buf)); 44 + if (ret != strlen(buf)) { 45 + printf("Failed to write to /proc/sys/kernel/msg_next_id\n"); 46 + return -errno; 47 + } 48 + 49 + id = msgget(msgque->key, msgque->mode | IPC_CREAT | IPC_EXCL); 50 + if (id == -1) { 51 + printf("Failed to create queue\n"); 52 + return -errno; 53 + } 54 + 55 + if (id != msgque->msq_id) { 56 + printf("Restored queue has wrong id (%d instead of %d)\n", 57 + id, msgque->msq_id); 58 + ret = -EFAULT; 59 + goto destroy; 60 + } 61 + 62 + for (i = 0; i < msgque->qnum; i++) { 63 + if (msgsnd(msgque->msq_id, &msgque->messages[i].mtype, 64 + msgque->messages[i].msize, IPC_NOWAIT) != 0) { 65 + printf("msgsnd failed (%m)\n"); 66 + ret = -errno; 67 + goto destroy; 68 + }; 69 + } 70 + return 0; 71 + 72 + destroy: 73 + if (msgctl(id, IPC_RMID, 0)) 74 + printf("Failed to destroy queue: %d\n", -errno); 75 + return ret; 76 + } 77 + 78 + int check_and_destroy_queue(struct msgque_data *msgque) 79 + { 80 + struct msg1 message; 81 + int cnt = 0, ret; 82 + 83 + while (1) { 84 + ret = msgrcv(msgque->msq_id, &message.mtype, MAX_MSG_SIZE, 85 + 0, IPC_NOWAIT); 86 + if (ret < 0) { 87 + if (errno == ENOMSG) 88 + break; 89 + printf("Failed to read IPC message: %m\n"); 90 + ret = -errno; 91 + goto err; 92 + } 93 + if (ret != msgque->messages[cnt].msize) { 94 + printf("Wrong message size: %d (expected %d)\n", ret, 95 + msgque->messages[cnt].msize); 96 + ret = -EINVAL; 97 + goto err; 98 + } 99 + if (message.mtype != msgque->messages[cnt].mtype) { 100 + printf("Wrong message type\n"); 101 + ret = -EINVAL; 102 + goto err; 103 + } 104 + if (memcmp(message.mtext, msgque->messages[cnt].mtext, ret)) { 105 + printf("Wrong message content\n"); 106 + ret = -EINVAL; 107 + goto err; 108 + } 109 + cnt++; 110 + } 111 + 112 + if (cnt != msgque->qnum) { 113 + printf("Wrong message number\n"); 114 + ret = -EINVAL; 115 + goto err; 116 + } 117 + 118 + ret = 0; 119 + err: 120 + if (msgctl(msgque->msq_id, IPC_RMID, 0)) { 121 + printf("Failed to destroy queue: %d\n", -errno); 122 + return -errno; 123 + } 124 + return ret; 125 + } 126 + 127 + int dump_queue(struct msgque_data *msgque) 128 + { 129 + struct msqid64_ds ds; 130 + int kern_id; 131 + int i, ret; 132 + 133 + for (kern_id = 0; kern_id < 256; kern_id++) { 134 + ret = msgctl(kern_id, MSG_STAT, &ds); 135 + if (ret < 0) { 136 + if (errno == -EINVAL) 137 + continue; 138 + printf("Failed to get stats for IPC queue with id %d\n", 139 + kern_id); 140 + return -errno; 141 + } 142 + 143 + if (ret == msgque->msq_id) 144 + break; 145 + } 146 + 147 + msgque->messages = malloc(sizeof(struct msg1) * ds.msg_qnum); 148 + if (msgque->messages == NULL) { 149 + printf("Failed to get stats for IPC queue\n"); 150 + return -ENOMEM; 151 + } 152 + 153 + msgque->qnum = ds.msg_qnum; 154 + msgque->mode = ds.msg_perm.mode; 155 + msgque->qbytes = ds.msg_qbytes; 156 + 157 + for (i = 0; i < msgque->qnum; i++) { 158 + ret = msgrcv(msgque->msq_id, &msgque->messages[i].mtype, 159 + MAX_MSG_SIZE, i, IPC_NOWAIT | MSG_COPY); 160 + if (ret < 0) { 161 + printf("Failed to copy IPC message: %m (%d)\n", errno); 162 + return -errno; 163 + } 164 + msgque->messages[i].msize = ret; 165 + } 166 + return 0; 167 + } 168 + 169 + int fill_msgque(struct msgque_data *msgque) 170 + { 171 + struct msg1 msgbuf; 172 + 173 + msgbuf.mtype = MSG_TYPE; 174 + memcpy(msgbuf.mtext, TEST_STRING, sizeof(TEST_STRING)); 175 + if (msgsnd(msgque->msq_id, &msgbuf.mtype, sizeof(TEST_STRING), 176 + IPC_NOWAIT) != 0) { 177 + printf("First message send failed (%m)\n"); 178 + return -errno; 179 + }; 180 + 181 + msgbuf.mtype = ANOTHER_MSG_TYPE; 182 + memcpy(msgbuf.mtext, ANOTHER_TEST_STRING, sizeof(ANOTHER_TEST_STRING)); 183 + if (msgsnd(msgque->msq_id, &msgbuf.mtype, sizeof(ANOTHER_TEST_STRING), 184 + IPC_NOWAIT) != 0) { 185 + printf("Second message send failed (%m)\n"); 186 + return -errno; 187 + }; 188 + return 0; 189 + } 190 + 191 + int main(int argc, char **argv) 192 + { 193 + int msg, pid, err; 194 + struct msgque_data msgque; 195 + 196 + msgque.key = ftok(argv[0], 822155650); 197 + if (msgque.key == -1) { 198 + printf("Can't make key\n"); 199 + return -errno; 200 + } 201 + 202 + msgque.msq_id = msgget(msgque.key, IPC_CREAT | IPC_EXCL | 0666); 203 + if (msgque.msq_id == -1) { 204 + printf("Can't create queue\n"); 205 + goto err_out; 206 + } 207 + 208 + err = fill_msgque(&msgque); 209 + if (err) { 210 + printf("Failed to fill queue\n"); 211 + goto err_destroy; 212 + } 213 + 214 + err = dump_queue(&msgque); 215 + if (err) { 216 + printf("Failed to dump queue\n"); 217 + goto err_destroy; 218 + } 219 + 220 + err = check_and_destroy_queue(&msgque); 221 + if (err) { 222 + printf("Failed to check and destroy queue\n"); 223 + goto err_out; 224 + } 225 + 226 + err = restore_queue(&msgque); 227 + if (err) { 228 + printf("Failed to restore queue\n"); 229 + goto err_destroy; 230 + } 231 + 232 + err = check_and_destroy_queue(&msgque); 233 + if (err) { 234 + printf("Failed to test queue\n"); 235 + goto err_out; 236 + } 237 + return 0; 238 + 239 + err_destroy: 240 + if (msgctl(msgque.msq_id, IPC_RMID, 0)) { 241 + printf("Failed to destroy queue: %d\n", -errno); 242 + return -errno; 243 + } 244 + err_out: 245 + return err; 246 + }