···123123There are user and developer mailing lists available through the v9fs project124124on sourceforge (http://sourceforge.net/projects/v9fs).125125126126+A stand-alone version of the module (which should build for any 2.6 kernel)127127+is available via (http://github.com/ericvh/9p-sac/tree/master)128128+126129News and other information is maintained on SWiK (http://swik.net/v9fs).127130128131Bug reports may be issued through the kernel.org bugzilla
+1-2
MAINTAINERS
···22392239F: drivers/media/video/gspca/pac207.c2240224022412241GSPCA SN9C20X SUBDRIVER22422242-P: Brian Johnson22432243-M: brijohn@gmail.com22422242+M: Brian Johnson <brijohn@gmail.com>22442243L: linux-media@vger.kernel.org22452244T: git git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-2.6.git22462245S: Maintained
···629629CONFIG_ATA=y630630# CONFIG_ATA_NONSTANDARD is not set631631CONFIG_SATA_PMP=y632632-# CONFIG_SATA_AHCI is not set632632+CONFIG_SATA_AHCI=y633633# CONFIG_SATA_SIL24 is not set634634CONFIG_ATA_SFF=y635635# CONFIG_SATA_SVW is not set
+9
arch/arm/mach-kirkwood/ts219-setup.c
···206206207207}208208209209+static int __init ts219_pci_init(void)210210+{211211+ if (machine_is_ts219())212212+ kirkwood_pcie_init();213213+214214+ return 0;215215+}216216+subsys_initcall(ts219_pci_init);217217+209218MACHINE_START(TS219, "QNAP TS-119/TS-219")210219 /* Maintainer: Martin Michlmayr <tbm@cyrius.com> */211220 .phys_io = KIRKWOOD_REGS_PHYS_BASE,
···532532 /* Kill the user process later */533533 regs->iaoq[0] = 0 | 3;534534 regs->iaoq[1] = regs->iaoq[0] + 4;535535- regs->iasq[0] = regs->iasq[0] = regs->sr[7];535535+ regs->iasq[0] = regs->iasq[1] = regs->sr[7];536536 regs->gr[0] &= ~PSW_B;537537 return;538538 }
+75-136
arch/powerpc/configs/ps3_defconfig
···11#22# Automatically generated make config: don't edit33-# Linux kernel version: 2.6.30-rc544-# Fri May 15 10:37:00 200933+# Linux kernel version: 2.6.31-rc744+# Mon Aug 24 17:38:50 200955#66CONFIG_PPC64=y7788#99# Processor support1010#1111+CONFIG_PPC_BOOK3S_64=y1112CONFIG_PPC_BOOK3S=y1213# CONFIG_POWER4_ONLY is not set1314CONFIG_POWER3=y···2120CONFIG_PPC_STD_MMU_64=y2221CONFIG_PPC_MM_SLICES=y2322CONFIG_VIRT_CPU_ACCOUNTING=y2323+CONFIG_PPC_HAVE_PMU_SUPPORT=y2424CONFIG_SMP=y2525CONFIG_NR_CPUS=22626CONFIG_64BIT=y···3331CONFIG_GENERIC_TIME_VSYSCALL=y3432CONFIG_GENERIC_CLOCKEVENTS=y3533CONFIG_GENERIC_HARDIRQS=y3434+CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y3635CONFIG_HAVE_SETUP_PER_CPU_AREA=y3736CONFIG_IRQ_PER_CPU=y3837CONFIG_STACKTRACE_SUPPORT=y···4441CONFIG_ARCH_HAS_ILOG2_U32=y4542CONFIG_ARCH_HAS_ILOG2_U64=y4643CONFIG_GENERIC_HWEIGHT=y4747-CONFIG_GENERIC_CALIBRATE_DELAY=y4844CONFIG_GENERIC_FIND_NEXT_BIT=y4945CONFIG_ARCH_NO_VIRT_TO_BUS=y5046CONFIG_PPC=y···6462# CONFIG_PPC_DCR_MMIO is not set6563CONFIG_ARCH_SUPPORTS_DEBUG_PAGEALLOC=y6664CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"6565+CONFIG_CONSTRUCTORS=y67666867#6968# General setup···116113CONFIG_KALLSYMS=y117114CONFIG_KALLSYMS_ALL=y118115CONFIG_KALLSYMS_EXTRA_PASS=y119119-# CONFIG_STRIP_ASM_SYMS is not set120116CONFIG_HOTPLUG=y121117CONFIG_PRINTK=y122118CONFIG_BUG=y···128126CONFIG_EVENTFD=y129127CONFIG_SHMEM=y130128CONFIG_AIO=y129129+CONFIG_HAVE_PERF_COUNTERS=y130130+131131+#132132+# Performance Counters133133+#134134+# CONFIG_PERF_COUNTERS is not set131135CONFIG_VM_EVENT_COUNTERS=y136136+# CONFIG_STRIP_ASM_SYMS is not set132137# CONFIG_COMPAT_BRK is not set133138CONFIG_SLAB=y134139# CONFIG_SLUB is not set···154145CONFIG_HAVE_ARCH_TRACEHOOK=y155146CONFIG_HAVE_DMA_ATTRS=y156147CONFIG_USE_GENERIC_SMP_HELPERS=y148148+149149+#150150+# GCOV-based kernel profiling151151+#152152+# CONFIG_GCOV_KERNEL is not set157153# CONFIG_SLOW_WORK is not set158154# CONFIG_HAVE_GENERIC_DMA_COHERENT is not set159155CONFIG_SLABINFO=y···224210#225211# Cell Broadband Engine options226212#227227-CONFIG_SPU_FS=y213213+CONFIG_SPU_FS=m228214CONFIG_SPU_FS_64K_LS=y229215# CONFIG_SPU_TRACE is not set230216CONFIG_SPU_BASE=y···269255CONFIG_HUGETLB_PAGE_SIZE_VARIABLE=y270256# CONFIG_IOMMU_VMERGE is not set271257CONFIG_IOMMU_HELPER=y258258+# CONFIG_SWIOTLB is not set272259CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y273260CONFIG_ARCH_HAS_WALK_MEMORY=y274261CONFIG_ARCH_ENABLE_MEMORY_HOTREMOVE=y···300285CONFIG_PHYS_ADDR_T_64BIT=y301286CONFIG_ZONE_DMA_FLAG=1302287CONFIG_BOUNCE=y303303-CONFIG_UNEVICTABLE_LRU=y304288CONFIG_HAVE_MLOCK=y305289CONFIG_HAVE_MLOCKED_PAGE_BIT=y290290+CONFIG_DEFAULT_MMAP_MIN_ADDR=4096306291CONFIG_ARCH_MEMORY_PROBE=y307292CONFIG_PPC_HAS_HASH_64K=y308293CONFIG_PPC_4K_PAGES=y···414399# CONFIG_ECONET is not set415400# CONFIG_WAN_ROUTER is not set416401# CONFIG_PHONET is not set402402+# CONFIG_IEEE802154 is not set417403# CONFIG_NET_SCHED is not set418404# CONFIG_DCB is not set419405···449433CONFIG_WIRELESS=y450434CONFIG_CFG80211=m451435# CONFIG_CFG80211_REG_DEBUG is not set436436+# CONFIG_CFG80211_DEBUGFS is not set452437# CONFIG_WIRELESS_OLD_REGULATORY is not set453438CONFIG_WIRELESS_EXT=y454439# CONFIG_WIRELESS_EXT_SYSFS is not set455440# CONFIG_LIB80211 is not set456441CONFIG_MAC80211=m442442+CONFIG_MAC80211_DEFAULT_PS=y443443+CONFIG_MAC80211_DEFAULT_PS_VALUE=1457444458445#459446# Rate control algorithm selection···466447CONFIG_MAC80211_RC_DEFAULT_PID=y467448# CONFIG_MAC80211_RC_DEFAULT_MINSTREL is not set468449CONFIG_MAC80211_RC_DEFAULT="pid"469469-# CONFIG_MAC80211_MESH is not set470450# CONFIG_MAC80211_LEDS is not set471451# CONFIG_MAC80211_DEBUGFS is not set472452# CONFIG_MAC80211_DEBUG_MENU is not set···490472# CONFIG_DEBUG_DEVRES is not set491473# CONFIG_SYS_HYPERVISOR is not set492474# CONFIG_CONNECTOR is not set493493-CONFIG_MTD=y494494-CONFIG_MTD_DEBUG=y495495-CONFIG_MTD_DEBUG_VERBOSE=0496496-# CONFIG_MTD_CONCAT is not set497497-# CONFIG_MTD_PARTITIONS is not set498498-# CONFIG_MTD_TESTS is not set499499-500500-#501501-# User Modules And Translation Layers502502-#503503-# CONFIG_MTD_CHAR is not set504504-CONFIG_MTD_BLKDEVS=y505505-CONFIG_MTD_BLOCK=y506506-# CONFIG_FTL is not set507507-# CONFIG_NFTL is not set508508-# CONFIG_INFTL is not set509509-# CONFIG_RFD_FTL is not set510510-# CONFIG_SSFDC is not set511511-# CONFIG_MTD_OOPS is not set512512-513513-#514514-# RAM/ROM/Flash chip drivers515515-#516516-# CONFIG_MTD_CFI is not set517517-# CONFIG_MTD_JEDECPROBE is not set518518-CONFIG_MTD_MAP_BANK_WIDTH_1=y519519-CONFIG_MTD_MAP_BANK_WIDTH_2=y520520-CONFIG_MTD_MAP_BANK_WIDTH_4=y521521-# CONFIG_MTD_MAP_BANK_WIDTH_8 is not set522522-# CONFIG_MTD_MAP_BANK_WIDTH_16 is not set523523-# CONFIG_MTD_MAP_BANK_WIDTH_32 is not set524524-CONFIG_MTD_CFI_I1=y525525-CONFIG_MTD_CFI_I2=y526526-# CONFIG_MTD_CFI_I4 is not set527527-# CONFIG_MTD_CFI_I8 is not set528528-# CONFIG_MTD_RAM is not set529529-# CONFIG_MTD_ROM is not set530530-# CONFIG_MTD_ABSENT is not set531531-532532-#533533-# Mapping drivers for chip access534534-#535535-# CONFIG_MTD_COMPLEX_MAPPINGS is not set536536-# CONFIG_MTD_PLATRAM is not set537537-538538-#539539-# Self-contained MTD device drivers540540-#541541-# CONFIG_MTD_SLRAM is not set542542-# CONFIG_MTD_PHRAM is not set543543-# CONFIG_MTD_MTDRAM is not set544544-# CONFIG_MTD_BLOCK2MTD is not set545545-546546-#547547-# Disk-On-Chip Device Drivers548548-#549549-# CONFIG_MTD_DOC2000 is not set550550-# CONFIG_MTD_DOC2001 is not set551551-# CONFIG_MTD_DOC2001PLUS is not set552552-# CONFIG_MTD_NAND is not set553553-# CONFIG_MTD_ONENAND is not set554554-555555-#556556-# LPDDR flash memory drivers557557-#558558-# CONFIG_MTD_LPDDR is not set559559-560560-#561561-# UBI - Unsorted block images562562-#563563-# CONFIG_MTD_UBI is not set475475+# CONFIG_MTD is not set564476CONFIG_OF_DEVICE=y565477# CONFIG_PARPORT is not set566478CONFIG_BLK_DEV=y···538590# CONFIG_BLK_DEV_SR_VENDOR is not set539591CONFIG_CHR_DEV_SG=m540592# CONFIG_CHR_DEV_SCH is not set541541-542542-#543543-# Some SCSI devices (e.g. CD jukebox) support multiple LUNs544544-#545593CONFIG_SCSI_MULTI_LUN=y546594# CONFIG_SCSI_CONSTANTS is not set547595# CONFIG_SCSI_LOGGING is not set···570626# CONFIG_DM_UEVENT is not set571627# CONFIG_MACINTOSH_DRIVERS is not set572628CONFIG_NETDEVICES=y573573-CONFIG_COMPAT_NET_DEV_OPS=y574629# CONFIG_DUMMY is not set575630# CONFIG_BONDING is not set576631# CONFIG_MACVLAN is not set···589646# CONFIG_IBM_NEW_EMAC_MAL_CLR_ICINTSTAT is not set590647# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set591648# CONFIG_B44 is not set649649+# CONFIG_KS8842 is not set592650CONFIG_NETDEV_1000=y593651CONFIG_GELIC_NET=y594652CONFIG_GELIC_WIRELESS=y595595-CONFIG_GELIC_WIRELESS_OLD_PSK_INTERFACE=y653653+# CONFIG_GELIC_WIRELESS_OLD_PSK_INTERFACE is not set596654# CONFIG_NETDEV_10000 is not set597655598656#···613669# CONFIG_HOSTAP is not set614670# CONFIG_B43 is not set615671# CONFIG_B43LEGACY is not set616616-CONFIG_ZD1211RW=m617617-# CONFIG_ZD1211RW_DEBUG is not set672672+# CONFIG_ZD1211RW is not set618673# CONFIG_RT2X00 is not set619674620675#···625682#626683# CONFIG_USB_CATC is not set627684# CONFIG_USB_KAWETH is not set628628-CONFIG_USB_PEGASUS=m685685+# CONFIG_USB_PEGASUS is not set629686# CONFIG_USB_RTL8150 is not set630687CONFIG_USB_USBNET=m631688CONFIG_USB_NET_AX8817X=m···636693# CONFIG_USB_NET_GL620A is not set637694# CONFIG_USB_NET_NET1080 is not set638695# CONFIG_USB_NET_PLUSB is not set639639-CONFIG_USB_NET_MCS7830=m696696+# CONFIG_USB_NET_MCS7830 is not set640697# CONFIG_USB_NET_RNDIS_HOST is not set641698# CONFIG_USB_NET_CDC_SUBSET is not set642699# CONFIG_USB_NET_ZAURUS is not set700700+# CONFIG_USB_NET_INT51X1 is not set643701# CONFIG_WAN is not set644702CONFIG_PPP=m645703CONFIG_PPP_MULTILINK=y···715771#716772CONFIG_UNIX98_PTYS=y717773# CONFIG_DEVPTS_MULTIPLE_INSTANCES is not set718718-CONFIG_LEGACY_PTYS=y719719-CONFIG_LEGACY_PTY_COUNT=16774774+# CONFIG_LEGACY_PTYS is not set720775# CONFIG_HVC_UDBG is not set721776# CONFIG_IPMI_HANDLER is not set722777# CONFIG_HW_RANDOM is not set···725782# CONFIG_TCG_TPM is not set726783# CONFIG_I2C is not set727784# CONFIG_SPI is not set785785+786786+#787787+# PPS support788788+#789789+# CONFIG_PPS is not set728790CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y729791# CONFIG_GPIOLIB is not set730792# CONFIG_W1 is not set···753805# CONFIG_HTC_PASIC3 is not set754806# CONFIG_MFD_TMIO is not set755807# CONFIG_REGULATOR is not set756756-757757-#758758-# Multimedia devices759759-#760760-761761-#762762-# Multimedia core support763763-#764764-# CONFIG_VIDEO_DEV is not set765765-# CONFIG_DVB_CORE is not set766766-# CONFIG_VIDEO_MEDIA is not set767767-768768-#769769-# Multimedia drivers770770-#771771-# CONFIG_DAB is not set808808+# CONFIG_MEDIA_SUPPORT is not set772809773810#774811# Graphics support···831898CONFIG_SND_VERBOSE_PROCFS=y832899# CONFIG_SND_VERBOSE_PRINTK is not set833900# CONFIG_SND_DEBUG is not set901901+# CONFIG_SND_RAWMIDI_SEQ is not set902902+# CONFIG_SND_OPL3_LIB_SEQ is not set903903+# CONFIG_SND_OPL4_LIB_SEQ is not set904904+# CONFIG_SND_SBAWE_SEQ is not set905905+# CONFIG_SND_EMU10K1_SEQ is not set834906# CONFIG_SND_DRIVERS is not set835907CONFIG_SND_PPC=y836908CONFIG_SND_PS3=m···868930# Special HID drivers869931#870932# CONFIG_HID_A4TECH is not set871871-# CONFIG_HID_APPLE is not set872872-# CONFIG_HID_BELKIN is not set873873-# CONFIG_HID_CHERRY is not set933933+CONFIG_HID_APPLE=m934934+CONFIG_HID_BELKIN=m935935+CONFIG_HID_CHERRY=m874936# CONFIG_HID_CHICONY is not set875937# CONFIG_HID_CYPRESS is not set876876-# CONFIG_DRAGONRISE_FF is not set877877-# CONFIG_HID_EZKEY is not set938938+# CONFIG_HID_DRAGONRISE is not set939939+CONFIG_HID_EZKEY=m878940# CONFIG_HID_KYE is not set879941# CONFIG_HID_GYRATION is not set880942# CONFIG_HID_KENSINGTON is not set881881-# CONFIG_HID_LOGITECH is not set882882-# CONFIG_HID_MICROSOFT is not set943943+CONFIG_HID_LOGITECH=m944944+# CONFIG_LOGITECH_FF is not set945945+# CONFIG_LOGIRUMBLEPAD2_FF is not set946946+CONFIG_HID_MICROSOFT=m883947# CONFIG_HID_MONTEREY is not set884948# CONFIG_HID_NTRIG is not set885949# CONFIG_HID_PANTHERLORD is not set886950# CONFIG_HID_PETALYNX is not set887951# CONFIG_HID_SAMSUNG is not set888952CONFIG_HID_SONY=m889889-# CONFIG_HID_SUNPLUS is not set890890-# CONFIG_GREENASIA_FF is not set953953+CONFIG_HID_SUNPLUS=m954954+# CONFIG_HID_GREENASIA is not set955955+CONFIG_HID_SMARTJOYPLUS=m956956+# CONFIG_SMARTJOYPLUS_FF is not set891957# CONFIG_HID_TOPSEED is not set892892-# CONFIG_THRUSTMASTER_FF is not set893893-# CONFIG_ZEROPLUS_FF is not set958958+# CONFIG_HID_THRUSTMASTER is not set959959+# CONFIG_HID_WACOM is not set960960+# CONFIG_HID_ZEROPLUS is not set894961CONFIG_USB_SUPPORT=y895962CONFIG_USB_ARCH_HAS_HCD=y896963CONFIG_USB_ARCH_HAS_OHCI=y···931988# CONFIG_USB_ISP116X_HCD is not set932989# CONFIG_USB_ISP1760_HCD is not set933990CONFIG_USB_OHCI_HCD=m991991+# CONFIG_USB_OHCI_HCD_PPC_OF_BE is not set992992+# CONFIG_USB_OHCI_HCD_PPC_OF_LE is not set934993# CONFIG_USB_OHCI_HCD_PPC_OF is not set935994# CONFIG_USB_OHCI_BIG_ENDIAN_DESC is not set936995CONFIG_USB_OHCI_BIG_ENDIAN_MMIO=y···10601115# CONFIG_DMADEVICES is not set10611116# CONFIG_AUXDISPLAY is not set10621117# CONFIG_UIO is not set11181118+11191119+#11201120+# TI VLYNQ11211121+#10631122# CONFIG_STAGING is not set1064112310651124#···10901141# CONFIG_REISERFS_FS is not set10911142# CONFIG_JFS_FS is not set10921143# CONFIG_FS_POSIX_ACL is not set10931093-CONFIG_FILE_LOCKING=y10941144# CONFIG_XFS_FS is not set10951145# CONFIG_GFS2_FS is not set10961146# CONFIG_OCFS2_FS is not set10971147# CONFIG_BTRFS_FS is not set11481148+CONFIG_FILE_LOCKING=y11491149+CONFIG_FSNOTIFY=y10981150CONFIG_DNOTIFY=y10991151CONFIG_INOTIFY=y11001152CONFIG_INOTIFY_USER=y···11551205# CONFIG_BEFS_FS is not set11561206# CONFIG_BFS_FS is not set11571207# CONFIG_EFS_FS is not set11581158-# CONFIG_JFFS2_FS is not set11591208# CONFIG_CRAMFS is not set11601209# CONFIG_SQUASHFS is not set11611210# CONFIG_VXFS_FS is not set···11711222CONFIG_NFS_V3=y11721223# CONFIG_NFS_V3_ACL is not set11731224CONFIG_NFS_V4=y12251225+# CONFIG_NFS_V4_1 is not set11741226CONFIG_ROOT_NFS=y11751227# CONFIG_NFSD is not set11761228CONFIG_LOCKD=y···13091359CONFIG_DEBUG_LIST=y13101360# CONFIG_DEBUG_SG is not set13111361# CONFIG_DEBUG_NOTIFIERS is not set13121312-# CONFIG_BOOT_PRINTK_DELAY is not set13131362# CONFIG_RCU_TORTURE_TEST is not set13141363# CONFIG_RCU_CPU_STALL_DETECTOR is not set13151364# CONFIG_BACKTRACE_SELF_TEST is not set···13231374CONFIG_HAVE_DYNAMIC_FTRACE=y13241375CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y13251376CONFIG_RING_BUFFER=y13771377+CONFIG_EVENT_TRACING=y13781378+CONFIG_CONTEXT_SWITCH_TRACER=y13261379CONFIG_TRACING=y13271380CONFIG_TRACING_SUPPORT=y13281328-13291329-#13301330-# Tracers13311331-#13321332-# CONFIG_FUNCTION_TRACER is not set13331333-# CONFIG_IRQSOFF_TRACER is not set13341334-# CONFIG_SCHED_TRACER is not set13351335-# CONFIG_CONTEXT_SWITCH_TRACER is not set13361336-# CONFIG_EVENT_TRACER is not set13371337-# CONFIG_BOOT_TRACER is not set13381338-# CONFIG_TRACE_BRANCH_PROFILING is not set13391339-# CONFIG_STACK_TRACER is not set13401340-# CONFIG_KMEMTRACE is not set13411341-# CONFIG_WORKQUEUE_TRACER is not set13421342-# CONFIG_BLK_DEV_IO_TRACE is not set13431343-# CONFIG_FTRACE_STARTUP_TEST is not set13811381+# CONFIG_FTRACE is not set13441382# CONFIG_DYNAMIC_DEBUG is not set13451383# CONFIG_SAMPLES is not set13461384CONFIG_HAVE_ARCH_KGDB=y13471385# CONFIG_KGDB is not set13861386+# CONFIG_PPC_DISABLE_WERROR is not set13871387+CONFIG_PPC_WERROR=y13481388CONFIG_PRINT_STACK_DEPTH=6413491389CONFIG_DEBUG_STACKOVERFLOW=y13501390# CONFIG_DEBUG_STACK_USAGE is not set13911391+# CONFIG_PPC_EMULATED_STATS is not set13511392# CONFIG_CODE_PATCHING_SELFTEST is not set13521393# CONFIG_FTR_FIXUP_SELFTEST is not set13531394# CONFIG_MSI_BITMAP_SELFTEST is not set
+4
arch/powerpc/platforms/ps3/time.c
···2121#include <linux/kernel.h>2222#include <linux/platform_device.h>23232424+#include <asm/firmware.h>2425#include <asm/rtc.h>2526#include <asm/lv1call.h>2627#include <asm/ps3.h>···8483static int __init ps3_rtc_init(void)8584{8685 struct platform_device *pdev;8686+8787+ if (!firmware_has_feature(FW_FEATURE_PS3_LV1))8888+ return -ENODEV;87898890 pdev = platform_device_register_simple("rtc-ps3", -1, NULL, 0);8991 if (IS_ERR(pdev))
+18-7
arch/s390/kernel/setup.c
···154154155155__setup("condev=", condev_setup);156156157157+static void __init set_preferred_console(void)158158+{159159+ if (MACHINE_IS_KVM) {160160+ add_preferred_console("hvc", 0, NULL);161161+ s390_virtio_console_init();162162+ return;163163+ }164164+165165+ if (CONSOLE_IS_3215 || CONSOLE_IS_SCLP)166166+ add_preferred_console("ttyS", 0, NULL);167167+ if (CONSOLE_IS_3270)168168+ add_preferred_console("tty3270", 0, NULL);169169+}170170+157171static int __init conmode_setup(char *str)158172{159173#if defined(CONFIG_SCLP_CONSOLE) || defined(CONFIG_SCLP_VT220_CONSOLE)···182168 if (strncmp(str, "3270", 5) == 0)183169 SET_CONSOLE_3270;184170#endif171171+ set_preferred_console();185172 return 1;186173}187174···795780void __init796781setup_arch(char **cmdline_p)797782{798798- /* set up preferred console */799799- add_preferred_console("ttyS", 0, NULL);800800-801783 /*802784 * print what head.S has found out about the machine803785 */···814802 if (MACHINE_IS_VM)815803 pr_info("Linux is running as a z/VM "816804 "guest operating system in 64-bit mode\n");817817- else if (MACHINE_IS_KVM) {805805+ else if (MACHINE_IS_KVM)818806 pr_info("Linux is running under KVM in 64-bit mode\n");819819- add_preferred_console("hvc", 0, NULL);820820- s390_virtio_console_init();821821- } else807807+ else822808 pr_info("Linux is running natively in 64-bit mode\n");823809#endif /* CONFIG_64BIT */824810···861851862852 /* Setup default console */863853 conmode_default();854854+ set_preferred_console();864855865856 /* Setup zfcpdump support */866857 setup_zfcpdump(console_devno);
+44-30
arch/sparc/configs/sparc32_defconfig
···11#22# Automatically generated make config: don't edit33-# Linux kernel version: 2.6.30-rc244-# Fri Apr 17 04:04:46 200933+# Linux kernel version: 2.6.31-rc144+# Tue Aug 18 23:45:52 200955#66# CONFIG_64BIT is not set77CONFIG_SPARC=y···1717CONFIG_ARCH_NO_VIRT_TO_BUS=y1818CONFIG_OF=y1919CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"2020+CONFIG_CONSTRUCTORS=y20212122#2223# General setup···7574CONFIG_KALLSYMS=y7675# CONFIG_KALLSYMS_ALL is not set7776# CONFIG_KALLSYMS_EXTRA_PASS is not set7878-# CONFIG_STRIP_ASM_SYMS is not set7977CONFIG_HOTPLUG=y8078CONFIG_PRINTK=y8179CONFIG_BUG=y···8787CONFIG_EVENTFD=y8888CONFIG_SHMEM=y8989CONFIG_AIO=y9090+9191+#9292+# Performance Counters9393+#9094CONFIG_VM_EVENT_COUNTERS=y9195CONFIG_PCI_QUIRKS=y9696+# CONFIG_STRIP_ASM_SYMS is not set9297CONFIG_COMPAT_BRK=y9398CONFIG_SLAB=y9499# CONFIG_SLUB is not set···10297# CONFIG_MARKERS is not set10398CONFIG_HAVE_OPROFILE=y10499CONFIG_HAVE_ARCH_TRACEHOOK=y100100+101101+#102102+# GCOV-based kernel profiling103103+#105104# CONFIG_SLOW_WORK is not set106105# CONFIG_HAVE_GENERIC_DMA_COHERENT is not set107106CONFIG_SLABINFO=y···118109# CONFIG_MODVERSIONS is not set119110# CONFIG_MODULE_SRCVERSION_ALL is not set120111CONFIG_BLOCK=y121121-# CONFIG_LBD is not set112112+CONFIG_LBDAF=y122113# CONFIG_BLK_DEV_BSG is not set123114# CONFIG_BLK_DEV_INTEGRITY is not set124115···163154# CONFIG_PHYS_ADDR_T_64BIT is not set164155CONFIG_ZONE_DMA_FLAG=1165156CONFIG_BOUNCE=y166166-CONFIG_UNEVICTABLE_LRU=y167157CONFIG_HAVE_MLOCK=y168158CONFIG_HAVE_MLOCKED_PAGE_BIT=y159159+CONFIG_DEFAULT_MMAP_MIN_ADDR=4096169160CONFIG_SUN_PM=y170161# CONFIG_SPARC_LED is not set171162CONFIG_SERIAL_CONSOLE=y···273264# CONFIG_ECONET is not set274265# CONFIG_WAN_ROUTER is not set275266# CONFIG_PHONET is not set267267+# CONFIG_IEEE802154 is not set276268# CONFIG_NET_SCHED is not set277269# CONFIG_DCB is not set278270···291281CONFIG_WIRELESS_OLD_REGULATORY=y292282# CONFIG_WIRELESS_EXT is not set293283# CONFIG_LIB80211 is not set294294-# CONFIG_MAC80211 is not set284284+285285+#286286+# CFG80211 needs to be enabled for MAC80211287287+#288288+CONFIG_MAC80211_DEFAULT_PS_VALUE=0295289# CONFIG_WIMAX is not set296290# CONFIG_RFKILL is not set297291# CONFIG_NET_9P is not set···349335# EEPROM support350336#351337# CONFIG_EEPROM_93CX6 is not set338338+# CONFIG_CB710_CORE is not set352339CONFIG_HAVE_IDE=y353340# CONFIG_IDE is not set354341···373358# CONFIG_BLK_DEV_SR_VENDOR is not set374359CONFIG_CHR_DEV_SG=m375360# CONFIG_CHR_DEV_SCH is not set376376-377377-#378378-# Some SCSI devices (e.g. CD jukebox) support multiple LUNs379379-#380361# CONFIG_SCSI_MULTI_LUN is not set381362# CONFIG_SCSI_CONSTANTS is not set382363# CONFIG_SCSI_LOGGING is not set···390379CONFIG_SCSI_LOWLEVEL=y391380# CONFIG_ISCSI_TCP is not set392381# CONFIG_SCSI_CXGB3_ISCSI is not set382382+# CONFIG_SCSI_BNX2_ISCSI is not set393383# CONFIG_BLK_DEV_3W_XXXX_RAID is not set394384# CONFIG_SCSI_3W_9XXX is not set395385# CONFIG_SCSI_ACARD is not set···399387# CONFIG_SCSI_AIC7XXX_OLD is not set400388# CONFIG_SCSI_AIC79XX is not set401389# CONFIG_SCSI_AIC94XX is not set390390+# CONFIG_SCSI_MVSAS is not set402391# CONFIG_SCSI_ARCMSR is not set403392# CONFIG_MEGARAID_NEWGEN is not set404393# CONFIG_MEGARAID_LEGACY is not set···414401# CONFIG_SCSI_IPS is not set415402# CONFIG_SCSI_INITIO is not set416403# CONFIG_SCSI_INIA100 is not set417417-# CONFIG_SCSI_MVSAS is not set418404# CONFIG_SCSI_STEX is not set419405# CONFIG_SCSI_SYM53C8XX_2 is not set420406# CONFIG_SCSI_QLOGIC_1280 is not set···438426#439427440428#441441-# Enable only one of the two stacks, unless you know what you are doing429429+# You can enable one or both FireWire driver stacks.430430+#431431+432432+#433433+# See the help texts for more information.442434#443435# CONFIG_FIREWIRE is not set444436# CONFIG_IEEE1394 is not set445437# CONFIG_I2O is not set446438CONFIG_NETDEVICES=y447447-CONFIG_COMPAT_NET_DEV_OPS=y448439CONFIG_DUMMY=m449440# CONFIG_BONDING is not set450441# CONFIG_MACVLAN is not set···478463# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set479464# CONFIG_NET_PCI is not set480465# CONFIG_B44 is not set466466+# CONFIG_KS8842 is not set481467# CONFIG_ATL2 is not set482468CONFIG_NETDEV_1000=y483469# CONFIG_ACENIC is not set···498482# CONFIG_VIA_VELOCITY is not set499483# CONFIG_TIGON3 is not set500484# CONFIG_BNX2 is not set485485+# CONFIG_CNIC is not set501486# CONFIG_QLA3XXX is not set502487# CONFIG_ATL1 is not set503488# CONFIG_ATL1E is not set···646629CONFIG_DEVPORT=y647630# CONFIG_I2C is not set648631# CONFIG_SPI is not set632632+633633+#634634+# PPS support635635+#636636+# CONFIG_PPS is not set649637CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y650638# CONFIG_GPIOLIB is not set651639# CONFIG_W1 is not set···690668# CONFIG_HTC_PASIC3 is not set691669# CONFIG_MFD_TMIO is not set692670# CONFIG_REGULATOR is not set693693-694694-#695695-# Multimedia devices696696-#697697-698698-#699699-# Multimedia core support700700-#701701-# CONFIG_VIDEO_DEV is not set702702-# CONFIG_DVB_CORE is not set703703-# CONFIG_VIDEO_MEDIA is not set704704-705705-#706706-# Multimedia drivers707707-#708708-# CONFIG_DAB is not set671671+# CONFIG_MEDIA_SUPPORT is not set709672710673#711674# Graphics support···783776# CONFIG_DMADEVICES is not set784777# CONFIG_AUXDISPLAY is not set785778# CONFIG_UIO is not set779779+780780+#781781+# TI VLYNQ782782+#786783# CONFIG_STAGING is not set787784788785#···810799# CONFIG_REISERFS_FS is not set811800# CONFIG_JFS_FS is not set812801CONFIG_FS_POSIX_ACL=y813813-CONFIG_FILE_LOCKING=y814802# CONFIG_XFS_FS is not set803803+# CONFIG_GFS2_FS is not set815804# CONFIG_OCFS2_FS is not set816805# CONFIG_BTRFS_FS is not set806806+CONFIG_FILE_LOCKING=y807807+CONFIG_FSNOTIFY=y817808CONFIG_DNOTIFY=y818809CONFIG_INOTIFY=y819810CONFIG_INOTIFY_USER=y···998985CONFIG_KGDB_SERIAL_CONSOLE=y999986CONFIG_KGDB_TESTS=y1000987# CONFIG_KGDB_TESTS_ON_BOOT is not set988988+# CONFIG_KMEMCHECK is not set1001989# CONFIG_DEBUG_STACK_USAGE is not set1002990# CONFIG_STACK_DEBUG is not set1003991
+34-25
arch/sparc/configs/sparc64_defconfig
···11#22# Automatically generated make config: don't edit33-# Linux kernel version: 2.6.3044-# Tue Jun 16 04:59:36 200933+# Linux kernel version: 2.6.31-rc144+# Tue Aug 18 23:56:02 200955#66CONFIG_64BIT=y77CONFIG_SPARC=y···2626CONFIG_OF=y2727CONFIG_ARCH_SUPPORTS_DEBUG_PAGEALLOC=y2828CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"2929+CONFIG_CONSTRUCTORS=y29303031#3132# General setup···120119CONFIG_HAVE_KRETPROBES=y121120CONFIG_HAVE_ARCH_TRACEHOOK=y122121CONFIG_USE_GENERIC_SMP_HELPERS=y122122+123123+#124124+# GCOV-based kernel profiling125125+#126126+# CONFIG_GCOV_KERNEL is not set123127# CONFIG_SLOW_WORK is not set124128# CONFIG_HAVE_GENERIC_DMA_COHERENT is not set125129CONFIG_SLABINFO=y···210204CONFIG_PHYS_ADDR_T_64BIT=y211205CONFIG_ZONE_DMA_FLAG=0212206CONFIG_NR_QUICK=1213213-CONFIG_UNEVICTABLE_LRU=y214207CONFIG_HAVE_MLOCK=y215208CONFIG_HAVE_MLOCKED_PAGE_BIT=y216209CONFIG_DEFAULT_MMAP_MIN_ADDR=8192···415410#416411# CONFIG_EEPROM_AT24 is not set417412# CONFIG_EEPROM_LEGACY is not set413413+# CONFIG_EEPROM_MAX6875 is not set418414# CONFIG_EEPROM_93CX6 is not set419415# CONFIG_CB710_CORE is not set420416CONFIG_HAVE_IDE=y···568562CONFIG_DM_CRYPT=m569563CONFIG_DM_SNAPSHOT=m570564CONFIG_DM_MIRROR=m565565+# CONFIG_DM_LOG_USERSPACE is not set571566CONFIG_DM_ZERO=m572567# CONFIG_DM_MULTIPATH is not set573568# CONFIG_DM_DELAY is not set···580573#581574582575#583583-# Enable only one of the two stacks, unless you know what you are doing576576+# You can enable one or both FireWire driver stacks.577577+#578578+579579+#580580+# See the help texts for more information.584581#585582# CONFIG_FIREWIRE is not set586583# CONFIG_IEEE1394 is not set···678667# CONFIG_VIA_VELOCITY is not set679668CONFIG_TIGON3=m680669CONFIG_BNX2=m670670+# CONFIG_CNIC is not set681671# CONFIG_QLA3XXX is not set682672# CONFIG_ATL1 is not set683673# CONFIG_ATL1E is not set···785773# CONFIG_MOUSE_APPLETOUCH is not set786774# CONFIG_MOUSE_BCM5974 is not set787775# CONFIG_MOUSE_VSXXXAA is not set776776+# CONFIG_MOUSE_SYNAPTICS_I2C is not set788777# CONFIG_INPUT_JOYSTICK is not set789778# CONFIG_INPUT_TABLET is not set790779# CONFIG_INPUT_TOUCHSCREEN is not set···883870#884871# I2C system bus drivers (mostly embedded / system-on-chip)885872#873873+# CONFIG_I2C_DESIGNWARE is not set886874# CONFIG_I2C_OCORES is not set887875# CONFIG_I2C_SIMTEC is not set888876···912898# CONFIG_SENSORS_PCF8574 is not set913899# CONFIG_PCF8575 is not set914900# CONFIG_SENSORS_PCA9539 is not set915915-# CONFIG_SENSORS_MAX6875 is not set916901# CONFIG_SENSORS_TSL2550 is not set917902# CONFIG_I2C_DEBUG_CORE is not set918903# CONFIG_I2C_DEBUG_ALGO is not set919904# CONFIG_I2C_DEBUG_BUS is not set920905# CONFIG_I2C_DEBUG_CHIP is not set921906# CONFIG_SPI is not set907907+908908+#909909+# PPS support910910+#911911+# CONFIG_PPS is not set922912CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y923913# CONFIG_GPIOLIB is not set924914# CONFIG_W1 is not set···977959# CONFIG_SENSORS_SMSC47B397 is not set978960# CONFIG_SENSORS_ADS7828 is not set979961# CONFIG_SENSORS_THMC50 is not set962962+# CONFIG_SENSORS_TMP401 is not set980963# CONFIG_SENSORS_VIA686A is not set981964# CONFIG_SENSORS_VT1211 is not set982965# CONFIG_SENSORS_VT8231 is not set···1013994# CONFIG_MFD_WM8400 is not set1014995# CONFIG_MFD_WM8350_I2C is not set1015996# CONFIG_MFD_PCF50633 is not set997997+# CONFIG_AB3100_CORE is not set1016998# CONFIG_REGULATOR is not set10171017-10181018-#10191019-# Multimedia devices10201020-#10211021-10221022-#10231023-# Multimedia core support10241024-#10251025-# CONFIG_VIDEO_DEV is not set10261026-# CONFIG_DVB_CORE is not set10271027-# CONFIG_VIDEO_MEDIA is not set10281028-10291029-#10301030-# Multimedia drivers10311031-#10321032-# CONFIG_DAB is not set999999+# CONFIG_MEDIA_SUPPORT is not set1033100010341001#10351002# Graphics support···12891284#12901285# Miscellaneous USB options12911286#12921292-CONFIG_USB_DEVICEFS=y12931287# CONFIG_USB_DEVICE_CLASS is not set12941288# CONFIG_USB_DYNAMIC_MINORS is not set12951289# CONFIG_USB_OTG is not set···13001296# USB Host Controller Drivers13011297#13021298# CONFIG_USB_C67X00_HCD is not set12991299+# CONFIG_USB_XHCI_HCD is not set13031300CONFIG_USB_EHCI_HCD=m13041301# CONFIG_USB_EHCI_ROOT_HUB_TT is not set13051302# CONFIG_USB_EHCI_TT_NEWSCHED is not set···13791374# CONFIG_USB_LD is not set13801375# CONFIG_USB_TRANCEVIBRATOR is not set13811376# CONFIG_USB_IOWARRIOR is not set13821382-# CONFIG_USB_TEST is not set13831377# CONFIG_USB_ISIGHTFW is not set13841378# CONFIG_USB_VST is not set13851379# CONFIG_USB_GADGET is not set···14241420# CONFIG_RTC_DRV_S35390A is not set14251421# CONFIG_RTC_DRV_FM3130 is not set14261422# CONFIG_RTC_DRV_RX8581 is not set14231423+# CONFIG_RTC_DRV_RX8025 is not set1427142414281425#14291426# SPI RTC drivers···14531448# CONFIG_DMADEVICES is not set14541449# CONFIG_AUXDISPLAY is not set14551450# CONFIG_UIO is not set14511451+14521452+#14531453+# TI VLYNQ14541454+#14561455# CONFIG_STAGING is not set1457145614581457#···14891480# CONFIG_REISERFS_FS is not set14901481# CONFIG_JFS_FS is not set14911482CONFIG_FS_POSIX_ACL=y14921492-CONFIG_FILE_LOCKING=y14931483# CONFIG_XFS_FS is not set14941484# CONFIG_GFS2_FS is not set14951485# CONFIG_OCFS2_FS is not set14961486# CONFIG_BTRFS_FS is not set14871487+CONFIG_FILE_LOCKING=y14971488CONFIG_FSNOTIFY=y14981489CONFIG_DNOTIFY=y14991490CONFIG_INOTIFY=y···15691560# CONFIG_PARTITION_ADVANCED is not set15701561CONFIG_MSDOS_PARTITION=y15711562CONFIG_SUN_PARTITION=y15721572-CONFIG_NLS=m15631563+CONFIG_NLS=y15731564CONFIG_NLS_DEFAULT="iso8859-1"15741565# CONFIG_NLS_CODEPAGE_437 is not set15751566# CONFIG_NLS_CODEPAGE_737 is not set
+9-3
arch/sparc/include/asm/pgtable_64.h
···726726extern pte_t pgoff_to_pte(unsigned long);727727#define PTE_FILE_MAX_BITS (64UL - PAGE_SHIFT - 1UL)728728729729-extern unsigned long *sparc64_valid_addr_bitmap;729729+extern unsigned long sparc64_valid_addr_bitmap[];730730731731/* Needs to be defined here and not in linux/mm.h, as it is arch dependent */732732-#define kern_addr_valid(addr) \733733- (test_bit(__pa((unsigned long)(addr))>>22, sparc64_valid_addr_bitmap))732732+static inline bool kern_addr_valid(unsigned long addr)733733+{734734+ unsigned long paddr = __pa(addr);735735+736736+ if ((paddr >> 41UL) != 0UL)737737+ return false;738738+ return test_bit(paddr >> 22, sparc64_valid_addr_bitmap);739739+}734740735741extern int page_in_phys_avail(unsigned long paddr);736742
+38-4
arch/sparc/kernel/ktlb.S
···151151 * Must preserve %g1 and %g6 (TAG).152152 */153153kvmap_dtlb_tsb4m_miss:154154- sethi %hi(kpte_linear_bitmap), %g2154154+ /* Clear the PAGE_OFFSET top virtual bits, shift155155+ * down to get PFN, and make sure PFN is in range.156156+ */157157+ sllx %g4, 21, %g5158158+159159+ /* Check to see if we know about valid memory at the 4MB160160+ * chunk this physical address will reside within.161161+ */162162+ srlx %g5, 21 + 41, %g2163163+ brnz,pn %g2, kvmap_dtlb_longpath164164+ nop165165+166166+ /* This unconditional branch and delay-slot nop gets patched167167+ * by the sethi sequence once the bitmap is properly setup.168168+ */169169+ .globl valid_addr_bitmap_insn170170+valid_addr_bitmap_insn:171171+ ba,pt %xcc, 2f172172+ nop173173+ .subsection 2174174+ .globl valid_addr_bitmap_patch175175+valid_addr_bitmap_patch:176176+ sethi %hi(sparc64_valid_addr_bitmap), %g7177177+ or %g7, %lo(sparc64_valid_addr_bitmap), %g7178178+ .previous179179+180180+ srlx %g5, 21 + 22, %g2181181+ srlx %g2, 6, %g5182182+ and %g2, 63, %g2183183+ sllx %g5, 3, %g5184184+ ldx [%g7 + %g5], %g5185185+ mov 1, %g7186186+ sllx %g7, %g2, %g7187187+ andcc %g5, %g7, %g0188188+ be,pn %xcc, kvmap_dtlb_longpath189189+190190+2: sethi %hi(kpte_linear_bitmap), %g2155191 or %g2, %lo(kpte_linear_bitmap), %g2156192157157- /* Clear the PAGE_OFFSET top virtual bits, then shift158158- * down to get a 256MB physical address index.159159- */193193+ /* Get the 256MB physical address index. */160194 sllx %g4, 21, %g5161195 mov 1, %g7162196 srlx %g5, 21 + 28, %g5
-22
arch/sparc/kernel/sun4d_smp.c
···162162 */163163164164extern struct linux_prom_registers smp_penguin_ctable;165165-extern unsigned long trapbase_cpu1[];166166-extern unsigned long trapbase_cpu2[];167167-extern unsigned long trapbase_cpu3[];168165169166void __init smp4d_boot_cpus(void)170167{···231234 }232235 *prev = first;233236 local_flush_cache_all();234234-235235- /* Free unneeded trap tables */236236- ClearPageReserved(virt_to_page(trapbase_cpu1));237237- init_page_count(virt_to_page(trapbase_cpu1));238238- free_page((unsigned long)trapbase_cpu1);239239- totalram_pages++;240240- num_physpages++;241241-242242- ClearPageReserved(virt_to_page(trapbase_cpu2));243243- init_page_count(virt_to_page(trapbase_cpu2));244244- free_page((unsigned long)trapbase_cpu2);245245- totalram_pages++;246246- num_physpages++;247247-248248- ClearPageReserved(virt_to_page(trapbase_cpu3));249249- init_page_count(virt_to_page(trapbase_cpu3));250250- free_page((unsigned long)trapbase_cpu3);251251- totalram_pages++;252252- num_physpages++;253237254238 /* Ok, they are spinning and ready to go. */255239 smp_processors_ready = 1;
-26
arch/sparc/kernel/sun4m_smp.c
···121121 */122122123123extern struct linux_prom_registers smp_penguin_ctable;124124-extern unsigned long trapbase_cpu1[];125125-extern unsigned long trapbase_cpu2[];126126-extern unsigned long trapbase_cpu3[];127124128125void __init smp4m_boot_cpus(void)129126{···189192 }190193 *prev = first;191194 local_flush_cache_all();192192-193193- /* Free unneeded trap tables */194194- if (!cpu_isset(1, cpu_present_map)) {195195- ClearPageReserved(virt_to_page(trapbase_cpu1));196196- init_page_count(virt_to_page(trapbase_cpu1));197197- free_page((unsigned long)trapbase_cpu1);198198- totalram_pages++;199199- num_physpages++;200200- }201201- if (!cpu_isset(2, cpu_present_map)) {202202- ClearPageReserved(virt_to_page(trapbase_cpu2));203203- init_page_count(virt_to_page(trapbase_cpu2));204204- free_page((unsigned long)trapbase_cpu2);205205- totalram_pages++;206206- num_physpages++;207207- }208208- if (!cpu_isset(3, cpu_present_map)) {209209- ClearPageReserved(virt_to_page(trapbase_cpu3));210210- init_page_count(virt_to_page(trapbase_cpu3));211211- free_page((unsigned long)trapbase_cpu3);212212- totalram_pages++;213213- num_physpages++;214214- }215195216196 /* Ok, they are spinning and ready to go. */217197}
···319319 */320320out_of_memory:321321 up_read(&mm->mmap_sem);322322- printk("VM: killing process %s\n", tsk->comm);323323- if (from_user)324324- do_group_exit(SIGKILL);322322+ if (from_user) {323323+ pagefault_out_of_memory();324324+ return;325325+ }325326 goto no_context;326327327328do_sigbus:
+4-3
arch/sparc/mm/fault_64.c
···447447out_of_memory:448448 insn = get_fault_insn(regs, insn);449449 up_read(&mm->mmap_sem);450450- printk("VM: killing process %s\n", current->comm);451451- if (!(regs->tstate & TSTATE_PRIV))452452- do_group_exit(SIGKILL);450450+ if (!(regs->tstate & TSTATE_PRIV)) {451451+ pagefault_out_of_memory();452452+ return;453453+ }453454 goto handle_kernel_fault;454455455456intr_or_no_mm:
+24-19
arch/sparc/mm/init_64.c
···145145 cmp_p64, NULL);146146}147147148148-unsigned long *sparc64_valid_addr_bitmap __read_mostly;148148+unsigned long sparc64_valid_addr_bitmap[VALID_ADDR_BITMAP_BYTES /149149+ sizeof(unsigned long)];149150EXPORT_SYMBOL(sparc64_valid_addr_bitmap);150151151152/* Kernel physical address base and size in bytes. */···18751874 * memory list again, and make sure it provides at least as much18761875 * memory as 'pavail' does.18771876 */18781878-static void __init setup_valid_addr_bitmap_from_pavail(void)18771877+static void __init setup_valid_addr_bitmap_from_pavail(unsigned long *bitmap)18791878{18801879 int i;18811880···1898189718991898 if (new_start <= old_start &&19001899 new_end >= (old_start + PAGE_SIZE)) {19011901- set_bit(old_start >> 22,19021902- sparc64_valid_addr_bitmap);19001900+ set_bit(old_start >> 22, bitmap);19031901 goto do_next_page;19041902 }19051903 }···19191919 }19201920}1921192119221922+static void __init patch_tlb_miss_handler_bitmap(void)19231923+{19241924+ extern unsigned int valid_addr_bitmap_insn[];19251925+ extern unsigned int valid_addr_bitmap_patch[];19261926+19271927+ valid_addr_bitmap_insn[1] = valid_addr_bitmap_patch[1];19281928+ mb();19291929+ valid_addr_bitmap_insn[0] = valid_addr_bitmap_patch[0];19301930+ flushi(&valid_addr_bitmap_insn[0]);19311931+}19321932+19221933void __init mem_init(void)19231934{19241935 unsigned long codepages, datapages, initpages;19251936 unsigned long addr, last;19261926- int i;19271927-19281928- i = last_valid_pfn >> ((22 - PAGE_SHIFT) + 6);19291929- i += 1;19301930- sparc64_valid_addr_bitmap = (unsigned long *) alloc_bootmem(i << 3);19311931- if (sparc64_valid_addr_bitmap == NULL) {19321932- prom_printf("mem_init: Cannot alloc valid_addr_bitmap.\n");19331933- prom_halt();19341934- }19351935- memset(sparc64_valid_addr_bitmap, 0, i << 3);1936193719371938 addr = PAGE_OFFSET + kern_base;19381939 last = PAGE_ALIGN(kern_size) + addr;···19421941 addr += PAGE_SIZE;19431942 }1944194319451945- setup_valid_addr_bitmap_from_pavail();19441944+ setup_valid_addr_bitmap_from_pavail(sparc64_valid_addr_bitmap);19451945+ patch_tlb_miss_handler_bitmap();1946194619471947 high_memory = __va(last_valid_pfn << PAGE_SHIFT);1948194819491949#ifdef CONFIG_NEED_MULTIPLE_NODES19501950- for_each_online_node(i) {19511951- if (NODE_DATA(i)->node_spanned_pages != 0) {19521952- totalram_pages +=19531953- free_all_bootmem_node(NODE_DATA(i));19501950+ {19511951+ int i;19521952+ for_each_online_node(i) {19531953+ if (NODE_DATA(i)->node_spanned_pages != 0) {19541954+ totalram_pages +=19551955+ free_all_bootmem_node(NODE_DATA(i));19561956+ }19541957 }19551958 }19561959#else
+5-2
arch/sparc/mm/init_64.h
···55 * marked non-static so that assembler code can get at them.66 */7788-#define MAX_PHYS_ADDRESS (1UL << 42UL)99-#define KPTE_BITMAP_CHUNK_SZ (256UL * 1024UL * 1024UL)88+#define MAX_PHYS_ADDRESS (1UL << 41UL)99+#define KPTE_BITMAP_CHUNK_SZ (256UL * 1024UL * 1024UL)1010#define KPTE_BITMAP_BYTES \1111 ((MAX_PHYS_ADDRESS / KPTE_BITMAP_CHUNK_SZ) / 8)1212+#define VALID_ADDR_BITMAP_CHUNK_SZ (4UL * 1024UL * 1024UL)1313+#define VALID_ADDR_BITMAP_BYTES \1414+ ((MAX_PHYS_ADDRESS / VALID_ADDR_BITMAP_CHUNK_SZ) / 8)12151316extern unsigned long kern_linear_pte_xor[2];1417extern unsigned long kpte_linear_bitmap[KPTE_BITMAP_BYTES / sizeof(unsigned long)];
+1-1
arch/x86/boot/compressed/Makefile
···44# create a compressed vmlinux image from the original vmlinux55#6677-targets := vmlinux vmlinux.bin vmlinux.bin.gz vmlinux.bin.bz2 vmlinux.bin.lzma head_$(BITS).o misc.o piggy.o77+targets := vmlinux.lds vmlinux vmlinux.bin vmlinux.bin.gz vmlinux.bin.bz2 vmlinux.bin.lzma head_$(BITS).o misc.o piggy.o8899KBUILD_CFLAGS := -m$(BITS) -D__KERNEL__ $(LINUX_INCLUDE) -O21010KBUILD_CFLAGS += -fno-strict-aliasing -fPIC
+10-2
arch/x86/include/asm/pgtable.h
···22#define _ASM_X86_PGTABLE_H3344#include <asm/page.h>55+#include <asm/e820.h>5667#include <asm/pgtable_types.h>78···270269271270#define canon_pgprot(p) __pgprot(massage_pgprot(p))272271273273-static inline int is_new_memtype_allowed(unsigned long flags,274274- unsigned long new_flags)272272+static inline int is_new_memtype_allowed(u64 paddr, unsigned long size,273273+ unsigned long flags,274274+ unsigned long new_flags)275275{276276+ /*277277+ * PAT type is always WB for ISA. So no need to check.278278+ */279279+ if (is_ISA_range(paddr, paddr + size - 1))280280+ return 1;281281+276282 /*277283 * Certain new memtypes are not allowed with certain278284 * requested memtype:
+3
arch/x86/kernel/apic/ipi.c
···106106 unsigned long mask = cpumask_bits(cpumask)[0];107107 unsigned long flags;108108109109+ if (WARN_ONCE(!mask, "empty IPI mask"))110110+ return;111111+109112 local_irq_save(flags);110113 WARN_ON(mask & ~cpumask_bits(cpu_online_mask)[0]);111114 __default_send_IPI_dest_field(mask, vector, apic->dest_logical);
+10
arch/x86/kernel/apic/probe_64.c
···4444 NULL,4545};46464747+static int apicid_phys_pkg_id(int initial_apic_id, int index_msb)4848+{4949+ return hard_smp_processor_id() >> index_msb;5050+}5151+4752/*4853 * Check the APIC IDs in bios_cpu_apicid and choose the APIC mode.4954 */···7267 if (max_physical_apicid >= 8)7368 apic = &apic_physflat;7469 printk(KERN_INFO "Setting APIC routing to %s\n", apic->name);7070+ }7171+7272+ if (is_vsmp_box()) {7373+ /* need to update phys_pkg_id */7474+ apic->phys_pkg_id = apicid_phys_pkg_id;7575 }76767777 /*
+4
arch/x86/kernel/cpu/Makefile
···77CFLAGS_REMOVE_common.o = -pg88endif991010+# Make sure load_percpu_segment has no stackprotector1111+nostackp := $(call cc-option, -fno-stack-protector)1212+CFLAGS_common.o := $(nostackp)1313+1014obj-y := intel_cacheinfo.o addon_cpuid_features.o1115obj-y += proc.o capflags.o powerflags.o common.o1216obj-y += vmware.o hypervisor.o
···519519 if (!cpumask_test_cpu(cpu, c1e_mask)) {520520 cpumask_set_cpu(cpu, c1e_mask);521521 /*522522- * Force broadcast so ACPI can not interfere. Needs523523- * to run with interrupts enabled as it uses524524- * smp_function_call.522522+ * Force broadcast so ACPI can not interfere.525523 */526526- local_irq_enable();527524 clockevents_notify(CLOCK_EVT_NOTIFY_BROADCAST_FORCE,528525 &cpu);529526 printk(KERN_INFO "Switch to broadcast mode on CPU%d\n",530527 cpu);531531- local_irq_disable();532528 }533529 clockevents_notify(CLOCK_EVT_NOTIFY_BROADCAST_ENTER, &cpu);534530
+54-86
arch/x86/kernel/vmlinux.lds.S
···4646 data PT_LOAD FLAGS(7); /* RWE */4747#ifdef CONFIG_X86_644848 user PT_LOAD FLAGS(7); /* RWE */4949- data.init PT_LOAD FLAGS(7); /* RWE */5049#ifdef CONFIG_SMP5150 percpu PT_LOAD FLAGS(7); /* RWE */5251#endif5353- data.init2 PT_LOAD FLAGS(7); /* RWE */5252+ init PT_LOAD FLAGS(7); /* RWE */5453#endif5554 note PT_NOTE FLAGS(0); /* ___ */5655}···102103 __stop___ex_table = .;103104 } :text = 0x9090104105105105- RODATA106106+ RO_DATA(PAGE_SIZE)106107107108 /* Data */108108- . = ALIGN(PAGE_SIZE);109109 .data : AT(ADDR(.data) - LOAD_OFFSET) {110110 /* Start of data section */111111 _sdata = .;112112+113113+ /* init_task */114114+ INIT_TASK_DATA(THREAD_SIZE)115115+116116+#ifdef CONFIG_X86_32117117+ /* 32 bit has nosave before _edata */118118+ NOSAVE_DATA119119+#endif120120+121121+ PAGE_ALIGNED_DATA(PAGE_SIZE)122122+ *(.data.idt)123123+124124+ CACHELINE_ALIGNED_DATA(CONFIG_X86_L1_CACHE_BYTES)125125+112126 DATA_DATA113127 CONSTRUCTORS114114- } :data115128116116-#ifdef CONFIG_X86_32117117- /* 32 bit has nosave before _edata */118118- . = ALIGN(PAGE_SIZE);119119- .data_nosave : AT(ADDR(.data_nosave) - LOAD_OFFSET) {120120- __nosave_begin = .;121121- *(.data.nosave)122122- . = ALIGN(PAGE_SIZE);123123- __nosave_end = .;124124- }125125-#endif126126-127127- . = ALIGN(PAGE_SIZE);128128- .data.page_aligned : AT(ADDR(.data.page_aligned) - LOAD_OFFSET) {129129- *(.data.page_aligned)130130- *(.data.idt)131131- }132132-133133-#ifdef CONFIG_X86_32134134- . = ALIGN(32);135135-#else136136- . = ALIGN(PAGE_SIZE);137137- . = ALIGN(CONFIG_X86_L1_CACHE_BYTES);138138-#endif139139- .data.cacheline_aligned :140140- AT(ADDR(.data.cacheline_aligned) - LOAD_OFFSET) {141141- *(.data.cacheline_aligned)142142- }143143-144144- /* rarely changed data like cpu maps */145145-#ifdef CONFIG_X86_32146146- . = ALIGN(32);147147-#else148148- . = ALIGN(CONFIG_X86_INTERNODE_CACHE_BYTES);149149-#endif150150- .data.read_mostly : AT(ADDR(.data.read_mostly) - LOAD_OFFSET) {151151- *(.data.read_mostly)129129+ /* rarely changed data like cpu maps */130130+ READ_MOSTLY_DATA(CONFIG_X86_INTERNODE_CACHE_BYTES)152131153132 /* End of data section */154133 _edata = .;155155- }134134+ } :data156135157136#ifdef CONFIG_X86_64158137159138#define VSYSCALL_ADDR (-10*1024*1024)160160-#define VSYSCALL_PHYS_ADDR ((LOADADDR(.data.read_mostly) + \161161- SIZEOF(.data.read_mostly) + 4095) & ~(4095))162162-#define VSYSCALL_VIRT_ADDR ((ADDR(.data.read_mostly) + \163163- SIZEOF(.data.read_mostly) + 4095) & ~(4095))139139+#define VSYSCALL_PHYS_ADDR ((LOADADDR(.data) + SIZEOF(.data) + \140140+ PAGE_SIZE - 1) & ~(PAGE_SIZE - 1))141141+#define VSYSCALL_VIRT_ADDR ((ADDR(.data) + SIZEOF(.data) + \142142+ PAGE_SIZE - 1) & ~(PAGE_SIZE - 1))164143165144#define VLOAD_OFFSET (VSYSCALL_ADDR - VSYSCALL_PHYS_ADDR)166145#define VLOAD(x) (ADDR(x) - VLOAD_OFFSET)···204227205228#endif /* CONFIG_X86_64 */206229207207- /* init_task */208208- . = ALIGN(THREAD_SIZE);209209- .data.init_task : AT(ADDR(.data.init_task) - LOAD_OFFSET) {210210- *(.data.init_task)211211- }212212-#ifdef CONFIG_X86_64213213- :data.init214214-#endif215215-216216- /*217217- * smp_locks might be freed after init218218- * start/end must be page aligned219219- */220220- . = ALIGN(PAGE_SIZE);221221- .smp_locks : AT(ADDR(.smp_locks) - LOAD_OFFSET) {222222- __smp_locks = .;223223- *(.smp_locks)224224- __smp_locks_end = .;225225- . = ALIGN(PAGE_SIZE);226226- }227227-228230 /* Init code and data - will be freed after init */229231 . = ALIGN(PAGE_SIZE);230230- .init.text : AT(ADDR(.init.text) - LOAD_OFFSET) {232232+ .init.begin : AT(ADDR(.init.begin) - LOAD_OFFSET) {231233 __init_begin = .; /* paired with __init_end */234234+ }235235+236236+#if defined(CONFIG_X86_64) && defined(CONFIG_SMP)237237+ /*238238+ * percpu offsets are zero-based on SMP. PERCPU_VADDR() changes the239239+ * output PHDR, so the next output section - .init.text - should240240+ * start another segment - init.241241+ */242242+ PERCPU_VADDR(0, :percpu)243243+#endif244244+245245+ .init.text : AT(ADDR(.init.text) - LOAD_OFFSET) {232246 _sinittext = .;233247 INIT_TEXT234248 _einittext = .;235249 }250250+#ifdef CONFIG_X86_64251251+ :init252252+#endif236253237254 .init.data : AT(ADDR(.init.data) - LOAD_OFFSET) {238255 INIT_DATA···297326 }298327#endif299328300300-#if defined(CONFIG_X86_64) && defined(CONFIG_SMP)301301- /*302302- * percpu offsets are zero-based on SMP. PERCPU_VADDR() changes the303303- * output PHDR, so the next output section - __data_nosave - should304304- * start another section data.init2. Also, pda should be at the head of305305- * percpu area. Preallocate it and define the percpu offset symbol306306- * so that it can be accessed as a percpu variable.307307- */308308- . = ALIGN(PAGE_SIZE);309309- PERCPU_VADDR(0, :percpu)310310-#else329329+#if !defined(CONFIG_X86_64) || !defined(CONFIG_SMP)311330 PERCPU(PAGE_SIZE)312331#endif313332···308347 __init_end = .;309348 }310349350350+ /*351351+ * smp_locks might be freed after init352352+ * start/end must be page aligned353353+ */354354+ . = ALIGN(PAGE_SIZE);355355+ .smp_locks : AT(ADDR(.smp_locks) - LOAD_OFFSET) {356356+ __smp_locks = .;357357+ *(.smp_locks)358358+ __smp_locks_end = .;359359+ . = ALIGN(PAGE_SIZE);360360+ }361361+311362#ifdef CONFIG_X86_64312363 .data_nosave : AT(ADDR(.data_nosave) - LOAD_OFFSET) {313313- . = ALIGN(PAGE_SIZE);314314- __nosave_begin = .;315315- *(.data.nosave)316316- . = ALIGN(PAGE_SIZE);317317- __nosave_end = .;318318- } :data.init2319319- /* use another section data.init2, see PERCPU_VADDR() above */364364+ NOSAVE_DATA365365+ }320366#endif321367322368 /* BSS */
···623623 return ret;624624625625 if (flags != want_flags) {626626- if (strict_prot || !is_new_memtype_allowed(want_flags, flags)) {626626+ if (strict_prot ||627627+ !is_new_memtype_allowed(paddr, size, want_flags, flags)) {627628 free_memtype(paddr, paddr + size);628629 printk(KERN_ERR "%s:%d map pfn expected mapping type %s"629630 " for %Lx-%Lx, got %s\n",
+10-11
arch/x86/mm/tlb.c
···183183184184 f->flush_mm = mm;185185 f->flush_va = va;186186- cpumask_andnot(to_cpumask(f->flush_cpumask),187187- cpumask, cpumask_of(smp_processor_id()));186186+ if (cpumask_andnot(to_cpumask(f->flush_cpumask), cpumask, cpumask_of(smp_processor_id()))) {187187+ /*188188+ * We have to send the IPI only to189189+ * CPUs affected.190190+ */191191+ apic->send_IPI_mask(to_cpumask(f->flush_cpumask),192192+ INVALIDATE_TLB_VECTOR_START + sender);188193189189- /*190190- * We have to send the IPI only to191191- * CPUs affected.192192- */193193- apic->send_IPI_mask(to_cpumask(f->flush_cpumask),194194- INVALIDATE_TLB_VECTOR_START + sender);195195-196196- while (!cpumask_empty(to_cpumask(f->flush_cpumask)))197197- cpu_relax();194194+ while (!cpumask_empty(to_cpumask(f->flush_cpumask)))195195+ cpu_relax();196196+ }198197199198 f->flush_mm = NULL;200199 f->flush_va = 0;
+4
arch/x86/xen/Makefile
···55CFLAGS_REMOVE_irq.o = -pg66endif7788+# Make sure early boot has no stackprotector99+nostackp := $(call cc-option, -fno-stack-protector)1010+CFLAGS_enlighten.o := $(nostackp)1111+812obj-y := enlighten.o setup.o multicalls.o mmu.o irq.o \913 time.o xen-asm.o xen-asm_$(BITS).o \1014 grant-table.o suspend.o
+12-12
arch/x86/xen/enlighten.c
···215215 (1 << X86_FEATURE_ACPI)); /* disable ACPI */216216217217 ax = 1;218218+ cx = 0;218219 xen_cpuid(&ax, &bx, &cx, &dx);219220220221 /* cpuid claims we support xsave; try enabling it to see what happens */···975974976975 xen_domain_type = XEN_PV_DOMAIN;977976978978- BUG_ON(memcmp(xen_start_info->magic, "xen-3", 5) != 0);979979-980980- xen_setup_features();981981-982977 /* Install Xen paravirt ops */983978 pv_info = xen_info;984979 pv_init_ops = xen_init_ops;···983986 pv_apic_ops = xen_apic_ops;984987 pv_mmu_ops = xen_mmu_ops;985988986986- xen_init_irq_ops();989989+#ifdef CONFIG_X86_64990990+ /*991991+ * Setup percpu state. We only need to do this for 64-bit992992+ * because 32-bit already has %fs set properly.993993+ */994994+ load_percpu_segment(0);995995+#endif987996997997+ xen_init_irq_ops();988998 xen_init_cpuid_mask();9899999901000#ifdef CONFIG_X86_LOCAL_APIC···1001997 set_xen_basic_apic_ops();1002998#endif100399910001000+ xen_setup_features();10011001+10041002 if (xen_feature(XENFEAT_mmu_pt_update_preserve_ad)) {10051003 pv_mmu_ops.ptep_modify_prot_start = xen_ptep_modify_prot_start;10061004 pv_mmu_ops.ptep_modify_prot_commit = xen_ptep_modify_prot_commit;···1010100410111005 machine_ops = xen_machine_ops;1012100610131013-#ifdef CONFIG_X86_6410141014- /*10151015- * Setup percpu state. We only need to do this for 64-bit10161016- * because 32-bit already has %fs set properly.10171017- */10181018- load_percpu_segment(0);10191019-#endif10201007 /*10211008 * The only reliable way to retain the initial address of the10221009 * percpu gdt_page is to remember it here, so we can go and···10601061 /* set up basic CPUID stuff */10611062 cpu_detect(&new_cpu_data);10621063 new_cpu_data.hard_math = 1;10641064+ new_cpu_data.wp_works_ok = 1;10631065 new_cpu_data.x86_capability[0] = cpuid_edx(1);10641066#endif10651067
+12
drivers/acpi/acpica/exstorob.c
···70707171 ACPI_FUNCTION_TRACE_PTR(ex_store_buffer_to_buffer, source_desc);72727373+ /* If Source and Target are the same, just return */7474+7575+ if (source_desc == target_desc) {7676+ return_ACPI_STATUS(AE_OK);7777+ }7878+7379 /* We know that source_desc is a buffer by now */74807581 buffer = ACPI_CAST_PTR(u8, source_desc->buffer.pointer);···166160 u8 *buffer;167161168162 ACPI_FUNCTION_TRACE_PTR(ex_store_string_to_string, source_desc);163163+164164+ /* If Source and Target are the same, just return */165165+166166+ if (source_desc == target_desc) {167167+ return_ACPI_STATUS(AE_OK);168168+ }169169170170 /* We know that source_desc is a string by now */171171
···508508 * be obtained while the delayed work queue halt ensures that no more509509 * data is fed to the ldisc.510510 *511511- * In order to wait for any existing references to complete see512512- * tty_ldisc_wait_idle.511511+ * You need to do a 'flush_scheduled_work()' (outside the ldisc_mutex)512512+ * in order to make sure any currently executing ldisc work is also513513+ * flushed.513514 */514515515516static int tty_ldisc_halt(struct tty_struct *tty)···754753 * N_TTY.755754 */756755 if (tty->driver->flags & TTY_DRIVER_RESET_TERMIOS) {756756+ /* Make sure the old ldisc is quiescent */757757+ tty_ldisc_halt(tty);758758+ flush_scheduled_work();759759+757760 /* Avoid racing set_ldisc or tty_ldisc_release */758761 mutex_lock(&tty->ldisc_mutex);759762 if (tty->ldisc) { /* Not yet closed */760763 /* Switch back to N_TTY */761761- tty_ldisc_halt(tty);762764 tty_ldisc_reinit(tty);763765 /* At this point we have a closed ldisc and we want to764766 reopen it. We could defer this to the next open but
+27-20
drivers/gpu/drm/drm_sysfs.c
···2323#define to_drm_minor(d) container_of(d, struct drm_minor, kdev)2424#define to_drm_connector(d) container_of(d, struct drm_connector, kdev)25252626+static struct device_type drm_sysfs_device_minor = {2727+ .name = "drm_minor"2828+};2929+2630/**2727- * drm_sysfs_suspend - DRM class suspend hook3131+ * drm_class_suspend - DRM class suspend hook2832 * @dev: Linux device to suspend2933 * @state: power state to enter3034 *3135 * Just figures out what the actual struct drm_device associated with3236 * @dev is and calls its suspend hook, if present.3337 */3434-static int drm_sysfs_suspend(struct device *dev, pm_message_t state)3838+static int drm_class_suspend(struct device *dev, pm_message_t state)3539{3636- struct drm_minor *drm_minor = to_drm_minor(dev);3737- struct drm_device *drm_dev = drm_minor->dev;4040+ if (dev->type == &drm_sysfs_device_minor) {4141+ struct drm_minor *drm_minor = to_drm_minor(dev);4242+ struct drm_device *drm_dev = drm_minor->dev;38433939- if (drm_minor->type == DRM_MINOR_LEGACY &&4040- !drm_core_check_feature(drm_dev, DRIVER_MODESET) &&4141- drm_dev->driver->suspend)4242- return drm_dev->driver->suspend(drm_dev, state);4343-4444+ if (drm_minor->type == DRM_MINOR_LEGACY &&4545+ !drm_core_check_feature(drm_dev, DRIVER_MODESET) &&4646+ drm_dev->driver->suspend)4747+ return drm_dev->driver->suspend(drm_dev, state);4848+ }4449 return 0;4550}46514752/**4848- * drm_sysfs_resume - DRM class resume hook5353+ * drm_class_resume - DRM class resume hook4954 * @dev: Linux device to resume5055 *5156 * Just figures out what the actual struct drm_device associated with5257 * @dev is and calls its resume hook, if present.5358 */5454-static int drm_sysfs_resume(struct device *dev)5959+static int drm_class_resume(struct device *dev)5560{5656- struct drm_minor *drm_minor = to_drm_minor(dev);5757- struct drm_device *drm_dev = drm_minor->dev;6161+ if (dev->type == &drm_sysfs_device_minor) {6262+ struct drm_minor *drm_minor = to_drm_minor(dev);6363+ struct drm_device *drm_dev = drm_minor->dev;58645959- if (drm_minor->type == DRM_MINOR_LEGACY &&6060- !drm_core_check_feature(drm_dev, DRIVER_MODESET) &&6161- drm_dev->driver->resume)6262- return drm_dev->driver->resume(drm_dev);6363-6565+ if (drm_minor->type == DRM_MINOR_LEGACY &&6666+ !drm_core_check_feature(drm_dev, DRIVER_MODESET) &&6767+ drm_dev->driver->resume)6868+ return drm_dev->driver->resume(drm_dev);6969+ }6470 return 0;6571}6672···106100 goto err_out;107101 }108102109109- class->suspend = drm_sysfs_suspend;110110- class->resume = drm_sysfs_resume;103103+ class->suspend = drm_class_suspend;104104+ class->resume = drm_class_resume;111105112106 err = class_create_file(class, &class_attr_version);113107 if (err)···490484 minor->kdev.class = drm_class;491485 minor->kdev.release = drm_sysfs_device_release;492486 minor->kdev.devt = minor->device;487487+ minor->kdev.type = &drm_sysfs_device_minor;493488 if (minor->type == DRM_MINOR_CONTROL)494489 minor_str = "controlD%d";495490 else if (minor->type == DRM_MINOR_RENDER)
···7979 return -EBUSY;8080}81818282+/* As a ringbuffer is only allowed to wrap between instructions, fill8383+ * the tail with NOOPs.8484+ */8585+int i915_wrap_ring(struct drm_device *dev)8686+{8787+ drm_i915_private_t *dev_priv = dev->dev_private;8888+ volatile unsigned int *virt;8989+ int rem;9090+9191+ rem = dev_priv->ring.Size - dev_priv->ring.tail;9292+ if (dev_priv->ring.space < rem) {9393+ int ret = i915_wait_ring(dev, rem, __func__);9494+ if (ret)9595+ return ret;9696+ }9797+ dev_priv->ring.space -= rem;9898+9999+ virt = (unsigned int *)100100+ (dev_priv->ring.virtual_start + dev_priv->ring.tail);101101+ rem /= 4;102102+ while (rem--)103103+ *virt++ = MI_NOOP;104104+105105+ dev_priv->ring.tail = 0;106106+107107+ return 0;108108+}109109+82110/**83111 * Sets up the hardware status page for devices that need a physical address84112 * in the register.···226198 }227199228200 dev_priv->ring.Size = init->ring_size;229229- dev_priv->ring.tail_mask = dev_priv->ring.Size - 1;230201231202 dev_priv->ring.map.offset = init->ring_start;232203 dev_priv->ring.map.size = init->ring_size;
···8585};86868787typedef struct _drm_i915_ring_buffer {8888- int tail_mask;8988 unsigned long Size;9089 u8 *virtual_start;9190 int head;···221222 unsigned int edp_support:1;222223 int lvds_ssc_freq;223224225225+ int crt_ddc_bus; /* -1 = unknown, else GPIO to use for CRT DDC */224226 struct drm_i915_fence_reg fence_regs[16]; /* assume 965 */225227 int fence_reg_start; /* 4 if userland hasn't ioctl'd us yet */226228 int num_fence_regs; /* 8 on pre-965, 16 otherwise */···310310 u32 saveIMR;311311 u32 saveCACHE_MODE_0;312312 u32 saveD_STATE;313313- u32 saveCG_2D_DIS;313313+ u32 saveDSPCLK_GATE_D;314314 u32 saveMI_ARB_STATE;315315 u32 saveSWF0[16];316316 u32 saveSWF1[16];···384384 */385385 struct list_head inactive_list;386386387387+ /** LRU list of objects with fence regs on them. */388388+ struct list_head fence_list;389389+387390 /**388391 * List of breadcrumbs associated with GPU requests currently389392 * outstanding.···442439 struct drm_i915_gem_phys_object *phys_objs[I915_MAX_PHYS_OBJECT];443440 } mm;444441 struct sdvo_device_mapping sdvo_mappings[2];442442+443443+ /* Reclocking support */444444+ bool render_reclock_avail;445445+ bool lvds_downclock_avail;446446+ struct work_struct idle_work;447447+ struct timer_list idle_timer;448448+ bool busy;449449+ u16 orig_clock;445450} drm_i915_private_t;446451447452/** driver private structure attached to each drm_gem_object */···461450462451 /** This object's place on the active/flushing/inactive lists */463452 struct list_head list;453453+454454+ /** This object's place on the fenced object LRU */455455+ struct list_head fence_list;464456465457 /**466458 * This is set if the object is on the active or flushing lists···582568extern struct drm_ioctl_desc i915_ioctls[];583569extern int i915_max_ioctl;584570extern unsigned int i915_fbpercrtc;571571+extern unsigned int i915_powersave;585572586573extern int i915_master_create(struct drm_device *dev, struct drm_master *master);587574extern void i915_master_destroy(struct drm_device *dev, struct drm_master *master);···738723void i915_dump_lru(struct drm_device *dev, const char *where);739724740725/* i915_debugfs.c */741741-int i915_gem_debugfs_init(struct drm_minor *minor);742742-void i915_gem_debugfs_cleanup(struct drm_minor *minor);726726+int i915_debugfs_init(struct drm_minor *minor);727727+void i915_debugfs_cleanup(struct drm_minor *minor);743728744729/* i915_suspend.c */745730extern int i915_save_state(struct drm_device *dev);···789774790775#define I915_VERBOSE 0791776792792-#define RING_LOCALS unsigned int outring, ringmask, outcount; \793793- volatile char *virt;777777+#define RING_LOCALS volatile unsigned int *ring_virt__;794778795795-#define BEGIN_LP_RING(n) do { \796796- if (I915_VERBOSE) \797797- DRM_DEBUG("BEGIN_LP_RING(%d)\n", (n)); \798798- if (dev_priv->ring.space < (n)*4) \799799- i915_wait_ring(dev, (n)*4, __func__); \800800- outcount = 0; \801801- outring = dev_priv->ring.tail; \802802- ringmask = dev_priv->ring.tail_mask; \803803- virt = dev_priv->ring.virtual_start; \779779+#define BEGIN_LP_RING(n) do { \780780+ int bytes__ = 4*(n); \781781+ if (I915_VERBOSE) DRM_DEBUG("BEGIN_LP_RING(%d)\n", (n)); \782782+ /* a wrap must occur between instructions so pad beforehand */ \783783+ if (unlikely (dev_priv->ring.tail + bytes__ > dev_priv->ring.Size)) \784784+ i915_wrap_ring(dev); \785785+ if (unlikely (dev_priv->ring.space < bytes__)) \786786+ i915_wait_ring(dev, bytes__, __func__); \787787+ ring_virt__ = (unsigned int *) \788788+ (dev_priv->ring.virtual_start + dev_priv->ring.tail); \789789+ dev_priv->ring.tail += bytes__; \790790+ dev_priv->ring.tail &= dev_priv->ring.Size - 1; \791791+ dev_priv->ring.space -= bytes__; \804792} while (0)805793806806-#define OUT_RING(n) do { \794794+#define OUT_RING(n) do { \807795 if (I915_VERBOSE) DRM_DEBUG(" OUT_RING %x\n", (int)(n)); \808808- *(volatile unsigned int *)(virt + outring) = (n); \809809- outcount++; \810810- outring += 4; \811811- outring &= ringmask; \796796+ *ring_virt__++ = (n); \812797} while (0)813798814799#define ADVANCE_LP_RING() do { \815815- if (I915_VERBOSE) DRM_DEBUG("ADVANCE_LP_RING %x\n", outring); \816816- dev_priv->ring.tail = outring; \817817- dev_priv->ring.space -= outcount * 4; \818818- I915_WRITE(PRB0_TAIL, outring); \800800+ if (I915_VERBOSE) \801801+ DRM_DEBUG("ADVANCE_LP_RING %x\n", dev_priv->ring.tail); \802802+ I915_WRITE(PRB0_TAIL, dev_priv->ring.tail); \819803} while(0)820804821805/**···837823#define I915_GEM_HWS_INDEX 0x20838824#define I915_BREADCRUMB_INDEX 0x21839825826826+extern int i915_wrap_ring(struct drm_device * dev);840827extern int i915_wait_ring(struct drm_device * dev, int n, const char *caller);841828842829#define IS_I830(dev) ((dev)->pci_device == 0x3577)···910895#define I915_HAS_HOTPLUG(dev) (IS_I945G(dev) || IS_I945GM(dev) || IS_I965G(dev))911896/* dsparb controlled by hw only */912897#define DSPARB_HWCONTROL(dev) (IS_G4X(dev) || IS_IGDNG(dev))898898+899899+#define HAS_FW_BLC(dev) (IS_I9XX(dev) || IS_G4X(dev) || IS_IGDNG(dev))900900+#define HAS_PIPE_CXSR(dev) (IS_G4X(dev) || IS_IGDNG(dev))913901914902#define PRIMARY_RINGBUFFER_SIZE (128*1024)915903
+60-40
drivers/gpu/drm/i915/i915_gem.c
···2929#include "drm.h"3030#include "i915_drm.h"3131#include "i915_drv.h"3232+#include "intel_drv.h"3233#include <linux/swap.h>3334#include <linux/pci.h>3435···980979i915_gem_set_domain_ioctl(struct drm_device *dev, void *data,981980 struct drm_file *file_priv)982981{982982+ struct drm_i915_private *dev_priv = dev->dev_private;983983 struct drm_i915_gem_set_domain *args = data;984984 struct drm_gem_object *obj;985985+ struct drm_i915_gem_object *obj_priv;985986 uint32_t read_domains = args->read_domains;986987 uint32_t write_domain = args->write_domain;987988 int ret;···10071004 obj = drm_gem_object_lookup(dev, file_priv, args->handle);10081005 if (obj == NULL)10091006 return -EBADF;10071007+ obj_priv = obj->driver_private;1010100810111009 mutex_lock(&dev->struct_mutex);10101010+10111011+ intel_mark_busy(dev, obj);10121012+10121013#if WATCH_BUF10131014 DRM_INFO("set_domain_ioctl %p(%zd), %08x %08x\n",10141015 obj, obj->size, read_domains, write_domain);10151016#endif10161017 if (read_domains & I915_GEM_DOMAIN_GTT) {10171018 ret = i915_gem_object_set_to_gtt_domain(obj, write_domain != 0);10191019+10201020+ /* Update the LRU on the fence for the CPU access that's10211021+ * about to occur.10221022+ */10231023+ if (obj_priv->fence_reg != I915_FENCE_REG_NONE) {10241024+ list_move_tail(&obj_priv->fence_list,10251025+ &dev_priv->mm.fence_list);10261026+ }1018102710191028 /* Silently promote "you're not bound, there was nothing to do"10201029 * to success, since the client was just asking us to···11711156 }1172115711731158 /* Need a new fence register? */11741174- if (obj_priv->fence_reg == I915_FENCE_REG_NONE &&11751175- obj_priv->tiling_mode != I915_TILING_NONE) {11591159+ if (obj_priv->tiling_mode != I915_TILING_NONE) {11761160 ret = i915_gem_object_get_fence_reg(obj);11771161 if (ret) {11781162 mutex_unlock(&dev->struct_mutex);···22232209 struct drm_i915_gem_object *old_obj_priv = NULL;22242210 int i, ret, avail;2225221122122212+ /* Just update our place in the LRU if our fence is getting used. */22132213+ if (obj_priv->fence_reg != I915_FENCE_REG_NONE) {22142214+ list_move_tail(&obj_priv->fence_list, &dev_priv->mm.fence_list);22152215+ return 0;22162216+ }22172217+22262218 switch (obj_priv->tiling_mode) {22272219 case I915_TILING_NONE:22282220 WARN(1, "allocating a fence for non-tiled object?\n");···22502230 }2251223122522232 /* First try to find a free reg */22532253-try_again:22542233 avail = 0;22552234 for (i = dev_priv->fence_reg_start; i < dev_priv->num_fence_regs; i++) {22562235 reg = &dev_priv->fence_regs[i];···2263224422642245 /* None available, try to steal one or wait for a user to finish */22652246 if (i == dev_priv->num_fence_regs) {22662266- uint32_t seqno = dev_priv->mm.next_gem_seqno;22472247+ struct drm_gem_object *old_obj = NULL;2267224822682249 if (avail == 0)22692250 return -ENOSPC;2270225122712271- for (i = dev_priv->fence_reg_start;22722272- i < dev_priv->num_fence_regs; i++) {22732273- uint32_t this_seqno;22742274-22752275- reg = &dev_priv->fence_regs[i];22762276- old_obj_priv = reg->obj->driver_private;22522252+ list_for_each_entry(old_obj_priv, &dev_priv->mm.fence_list,22532253+ fence_list) {22542254+ old_obj = old_obj_priv->obj;2277225522782256 if (old_obj_priv->pin_count)22792257 continue;22582258+22592259+ /* Take a reference, as otherwise the wait_rendering22602260+ * below may cause the object to get freed out from22612261+ * under us.22622262+ */22632263+ drm_gem_object_reference(old_obj);2280226422812265 /* i915 uses fences for GPU access to tiled buffers */22822266 if (IS_I965G(dev) || !old_obj_priv->active)22832267 break;2284226822852285- /* find the seqno of the first available fence */22862286- this_seqno = old_obj_priv->last_rendering_seqno;22872287- if (this_seqno != 0 &&22882288- reg->obj->write_domain == 0 &&22892289- i915_seqno_passed(seqno, this_seqno))22902290- seqno = this_seqno;22912291- }22922292-22932293- /*22942294- * Now things get ugly... we have to wait for one of the22952295- * objects to finish before trying again.22962296- */22972297- if (i == dev_priv->num_fence_regs) {22982298- if (seqno == dev_priv->mm.next_gem_seqno) {22992299- i915_gem_flush(dev,23002300- I915_GEM_GPU_DOMAINS,23012301- I915_GEM_GPU_DOMAINS);23022302- seqno = i915_add_request(dev, NULL,23032303- I915_GEM_GPU_DOMAINS);23042304- if (seqno == 0)23052305- return -ENOMEM;22692269+ /* This brings the object to the head of the LRU if it22702270+ * had been written to. The only way this should22712271+ * result in us waiting longer than the expected22722272+ * optimal amount of time is if there was a22732273+ * fence-using buffer later that was read-only.22742274+ */22752275+ i915_gem_object_flush_gpu_write_domain(old_obj);22762276+ ret = i915_gem_object_wait_rendering(old_obj);22772277+ if (ret != 0) {22782278+ drm_gem_object_unreference(old_obj);22792279+ return ret;23062280 }2307228123082308- ret = i915_wait_request(dev, seqno);23092309- if (ret)23102310- return ret;23112311- goto try_again;22822282+ break;23122283 }2313228423142285 /*23152286 * Zap this virtual mapping so we can set up a fence again23162287 * for this object next time we need it.23172288 */23182318- i915_gem_release_mmap(reg->obj);22892289+ i915_gem_release_mmap(old_obj);22902290+22912291+ i = old_obj_priv->fence_reg;22922292+ reg = &dev_priv->fence_regs[i];22932293+23192294 old_obj_priv->fence_reg = I915_FENCE_REG_NONE;22952295+ list_del_init(&old_obj_priv->fence_list);22962296+22972297+ drm_gem_object_unreference(old_obj);23202298 }2321229923222300 obj_priv->fence_reg = i;23012301+ list_add_tail(&obj_priv->fence_list, &dev_priv->mm.fence_list);23022302+23232303 reg->obj = obj;2324230423252305 if (IS_I965G(dev))···2361234323622344 dev_priv->fence_regs[obj_priv->fence_reg].obj = NULL;23632345 obj_priv->fence_reg = I915_FENCE_REG_NONE;23462346+ list_del_init(&obj_priv->fence_list);23642347}2365234823662349/**···2780276127812762 BUG_ON(obj->pending_read_domains & I915_GEM_DOMAIN_CPU);27822763 BUG_ON(obj->pending_write_domain == I915_GEM_DOMAIN_CPU);27642764+27652765+ intel_mark_busy(dev, obj);2783276627842767#if WATCH_BUF27852768 DRM_INFO("%s: object %p read %08x -> %08x write %08x -> %08x\n",···36173596 * Pre-965 chips need a fence register set up in order to36183597 * properly handle tiled surfaces.36193598 */36203620- if (!IS_I965G(dev) &&36213621- obj_priv->fence_reg == I915_FENCE_REG_NONE &&36223622- obj_priv->tiling_mode != I915_TILING_NONE) {35993599+ if (!IS_I965G(dev) && obj_priv->tiling_mode != I915_TILING_NONE) {36233600 ret = i915_gem_object_get_fence_reg(obj);36243601 if (ret != 0) {36253602 if (ret != -EBUSY && ret != -ERESTARTSYS)···38263807 obj_priv->obj = obj;38273808 obj_priv->fence_reg = I915_FENCE_REG_NONE;38283809 INIT_LIST_HEAD(&obj_priv->list);38103810+ INIT_LIST_HEAD(&obj_priv->fence_list);3829381138303812 return 0;38313813}···4100408041014081 /* Set up the kernel mapping for the ring. */41024082 ring->Size = obj->size;41034103- ring->tail_mask = obj->size - 1;4104408341054084 ring->map.offset = dev->agp->base + obj_priv->gtt_offset;41064085 ring->map.size = obj->size;···42734254 INIT_LIST_HEAD(&dev_priv->mm.flushing_list);42744255 INIT_LIST_HEAD(&dev_priv->mm.inactive_list);42754256 INIT_LIST_HEAD(&dev_priv->mm.request_list);42574257+ INIT_LIST_HEAD(&dev_priv->mm.fence_list);42764258 INIT_DELAYED_WORK(&dev_priv->mm.retire_work,42774259 i915_gem_retire_work_handler);42784260 dev_priv->mm.next_gem_seqno = 1;
···234234 uint32_t swizzle_y = I915_BIT_6_SWIZZLE_UNKNOWN;235235 bool need_disable;236236237237- if (!IS_I9XX(dev)) {237237+ if (IS_IGDNG(dev)) {238238+ /* On IGDNG whatever DRAM config, GPU always do239239+ * same swizzling setup.240240+ */241241+ swizzle_x = I915_BIT_6_SWIZZLE_9_10;242242+ swizzle_y = I915_BIT_6_SWIZZLE_9;243243+ } else if (!IS_I9XX(dev)) {238244 /* As far as we know, the 865 doesn't have these bit 6239245 * swizzling issues.240246 */···321315 swizzle_x = I915_BIT_6_SWIZZLE_9_10;322316 swizzle_y = I915_BIT_6_SWIZZLE_9;323317 }324324- }325325-326326- /* FIXME: check with memory config on IGDNG */327327- if (IS_IGDNG(dev)) {328328- DRM_ERROR("disable tiling on IGDNG...\n");329329- swizzle_x = I915_BIT_6_SWIZZLE_UNKNOWN;330330- swizzle_y = I915_BIT_6_SWIZZLE_UNKNOWN;331318 }332319333320 dev_priv->mm.bit_6_swizzle_x = swizzle_x;
···3737#include "intel_sdvo_regs.h"38383939#undef SDVO_DEBUG4040+4141+static char *tv_format_names[] = {4242+ "NTSC_M" , "NTSC_J" , "NTSC_443",4343+ "PAL_B" , "PAL_D" , "PAL_G" ,4444+ "PAL_H" , "PAL_I" , "PAL_M" ,4545+ "PAL_N" , "PAL_NC" , "PAL_60" ,4646+ "SECAM_B" , "SECAM_D" , "SECAM_G" ,4747+ "SECAM_K" , "SECAM_K1", "SECAM_L" ,4848+ "SECAM_60"4949+};5050+5151+#define TV_FORMAT_NUM (sizeof(tv_format_names) / sizeof(*tv_format_names))5252+4053struct intel_sdvo_priv {4154 u8 slave_addr;4255···8370 */8471 bool is_tv;85727373+ /* This is for current tv format name */7474+ char *tv_format_name;7575+7676+ /* This contains all current supported TV format */7777+ char *tv_format_supported[TV_FORMAT_NUM];7878+ int format_supported_num;7979+ struct drm_property *tv_format_property;8080+ struct drm_property *tv_format_name_property[TV_FORMAT_NUM];8181+8682 /**8783 * This is set if we treat the device as HDMI, instead of DVI.8884 */···11896 */11997 struct intel_sdvo_sdtv_resolution_reply sdtv_resolutions;12098121121- /**122122- * Current selected TV format.123123- *124124- * This is stored in the same structure that's passed to the device, for125125- * convenience.126126- */127127- struct intel_sdvo_tv_format tv_format;128128-12999 /*130100 * supported encoding mode, used to determine whether HDMI is131101 * supported···126112127113 /* DDC bus used by this SDVO output */128114 uint8_t ddc_bus;115115+116116+ /* Mac mini hack -- use the same DDC as the analog connector */117117+ struct i2c_adapter *analog_ddc_bus;129118130119 int save_sdvo_mult;131120 u16 save_active_outputs;···961944962945static void intel_sdvo_set_tv_format(struct intel_output *output)963946{964964- struct intel_sdvo_priv *sdvo_priv = output->dev_priv;965965- struct intel_sdvo_tv_format *format, unset;966966- u8 status;967947968968- format = &sdvo_priv->tv_format;969969- memset(&unset, 0, sizeof(unset));970970- if (memcmp(format, &unset, sizeof(*format))) {971971- DRM_DEBUG_KMS("%s: Choosing default TV format of NTSC-M\n",972972- SDVO_NAME(sdvo_priv));973973- format->ntsc_m = 1;974974- intel_sdvo_write_cmd(output, SDVO_CMD_SET_TV_FORMAT, format,975975- sizeof(*format));976976- status = intel_sdvo_read_response(output, NULL, 0);977977- if (status != SDVO_CMD_STATUS_SUCCESS)978978- DRM_DEBUG_KMS("%s: Failed to set TV format\n",979979- SDVO_NAME(sdvo_priv));980980- }948948+ struct intel_sdvo_tv_format format;949949+ struct intel_sdvo_priv *sdvo_priv = output->dev_priv;950950+ uint32_t format_map, i;951951+ uint8_t status;952952+953953+ for (i = 0; i < TV_FORMAT_NUM; i++)954954+ if (tv_format_names[i] == sdvo_priv->tv_format_name)955955+ break;956956+957957+ format_map = 1 << i;958958+ memset(&format, 0, sizeof(format));959959+ memcpy(&format, &format_map, sizeof(format_map) > sizeof(format) ?960960+ sizeof(format) : sizeof(format_map));961961+962962+ intel_sdvo_write_cmd(output, SDVO_CMD_SET_TV_FORMAT, &format_map,963963+ sizeof(format));964964+965965+ status = intel_sdvo_read_response(output, NULL, 0);966966+ if (status != SDVO_CMD_STATUS_SUCCESS)967967+ DRM_DEBUG("%s: Failed to set TV format\n",968968+ SDVO_NAME(sdvo_priv));981969}982970983971static bool intel_sdvo_mode_fixup(struct drm_encoder *encoder,···14791457 (SDVO_OUTPUT_RGB0 | SDVO_OUTPUT_RGB1))14801458 caps++;14811459 if (sdvo_priv->caps.output_flags &14821482- (SDVO_OUTPUT_SVID0 | SDVO_OUTPUT_SVID0))14601460+ (SDVO_OUTPUT_SVID0 | SDVO_OUTPUT_SVID1))14831461 caps++;14841462 if (sdvo_priv->caps.output_flags &14851463 (SDVO_OUTPUT_CVBS0 | SDVO_OUTPUT_CVBS1))···14991477 return (caps > 1);15001478}1501147914801480+static struct drm_connector *14811481+intel_find_analog_connector(struct drm_device *dev)14821482+{14831483+ struct drm_connector *connector;14841484+ struct intel_output *intel_output;14851485+14861486+ list_for_each_entry(connector, &dev->mode_config.connector_list, head) {14871487+ intel_output = to_intel_output(connector);14881488+ if (intel_output->type == INTEL_OUTPUT_ANALOG)14891489+ return connector;14901490+ }14911491+ return NULL;14921492+}14931493+14941494+static int14951495+intel_analog_is_connected(struct drm_device *dev)14961496+{14971497+ struct drm_connector *analog_connector;14981498+ analog_connector = intel_find_analog_connector(dev);14991499+15001500+ if (!analog_connector)15011501+ return false;15021502+15031503+ if (analog_connector->funcs->detect(analog_connector) ==15041504+ connector_status_disconnected)15051505+ return false;15061506+15071507+ return true;15081508+}15091509+15021510enum drm_connector_status15031511intel_sdvo_hdmi_sink_detect(struct drm_connector *connector, u16 response)15041512{···1539148715401488 edid = drm_get_edid(&intel_output->base,15411489 intel_output->ddc_bus);14901490+14911491+ /* when there is no edid and no monitor is connected with VGA14921492+ * port, try to use the CRT ddc to read the EDID for DVI-connector14931493+ */14941494+ if (edid == NULL &&14951495+ sdvo_priv->analog_ddc_bus &&14961496+ !intel_analog_is_connected(intel_output->base.dev))14971497+ edid = drm_get_edid(&intel_output->base,14981498+ sdvo_priv->analog_ddc_bus);15421499 if (edid != NULL) {15431500 /* Don't report the output as connected if it's a DVI-I15441501 * connector with a non-digital EDID coming out.···15761515 struct intel_output *intel_output = to_intel_output(connector);15771516 struct intel_sdvo_priv *sdvo_priv = intel_output->dev_priv;1578151715791579- intel_sdvo_write_cmd(intel_output, SDVO_CMD_GET_ATTACHED_DISPLAYS, NULL, 0);15181518+ intel_sdvo_write_cmd(intel_output,15191519+ SDVO_CMD_GET_ATTACHED_DISPLAYS, NULL, 0);15801520 status = intel_sdvo_read_response(intel_output, &response, 2);1581152115821522 DRM_DEBUG_KMS("SDVO response %d %d\n", response & 0xff, response >> 8);···16011539static void intel_sdvo_get_ddc_modes(struct drm_connector *connector)16021540{16031541 struct intel_output *intel_output = to_intel_output(connector);15421542+ struct intel_sdvo_priv *sdvo_priv = intel_output->dev_priv;15431543+ int num_modes;1604154416051545 /* set the bus switch and get the modes */16061606- intel_ddc_get_modes(intel_output);15461546+ num_modes = intel_ddc_get_modes(intel_output);1607154716081608-#if 016091609- struct drm_device *dev = encoder->dev;16101610- struct drm_i915_private *dev_priv = dev->dev_private;16111611- /* Mac mini hack. On this device, I get DDC through the analog, which16121612- * load-detects as disconnected. I fail to DDC through the SDVO DDC,16131613- * but it does load-detect as connected. So, just steal the DDC bits16141614- * from analog when we fail at finding it the right way.15481548+ /*15491549+ * Mac mini hack. On this device, the DVI-I connector shares one DDC15501550+ * link between analog and digital outputs. So, if the regular SDVO15511551+ * DDC fails, check to see if the analog output is disconnected, in15521552+ * which case we'll look there for the digital DDC data.16151553 */16161616- crt = xf86_config->output[0];16171617- intel_output = crt->driver_private;16181618- if (intel_output->type == I830_OUTPUT_ANALOG &&16191619- crt->funcs->detect(crt) == XF86OutputStatusDisconnected) {16201620- I830I2CInit(pScrn, &intel_output->pDDCBus, GPIOA, "CRTDDC_A");16211621- edid_mon = xf86OutputGetEDID(crt, intel_output->pDDCBus);16221622- xf86DestroyI2CBusRec(intel_output->pDDCBus, true, true);15541554+ if (num_modes == 0 &&15551555+ sdvo_priv->analog_ddc_bus &&15561556+ !intel_analog_is_connected(intel_output->base.dev)) {15571557+ struct i2c_adapter *digital_ddc_bus;15581558+15591559+ /* Switch to the analog ddc bus and try that15601560+ */15611561+ digital_ddc_bus = intel_output->ddc_bus;15621562+ intel_output->ddc_bus = sdvo_priv->analog_ddc_bus;15631563+15641564+ (void) intel_ddc_get_modes(intel_output);15651565+15661566+ intel_output->ddc_bus = digital_ddc_bus;16231567 }16241624- if (edid_mon) {16251625- xf86OutputSetEDID(output, edid_mon);16261626- modes = xf86OutputGetEDIDModes(output);16271627- }16281628-#endif16291629-}16301630-16311631-/**16321632- * This function checks the current TV format, and chooses a default if16331633- * it hasn't been set.16341634- */16351635-static void16361636-intel_sdvo_check_tv_format(struct intel_output *output)16371637-{16381638- struct intel_sdvo_priv *dev_priv = output->dev_priv;16391639- struct intel_sdvo_tv_format format;16401640- uint8_t status;16411641-16421642- intel_sdvo_write_cmd(output, SDVO_CMD_GET_TV_FORMAT, NULL, 0);16431643- status = intel_sdvo_read_response(output, &format, sizeof(format));16441644- if (status != SDVO_CMD_STATUS_SUCCESS)16451645- return;16461646-16471647- memcpy(&dev_priv->tv_format, &format, sizeof(format));16481568}1649156916501570/*···16991655 struct intel_output *output = to_intel_output(connector);17001656 struct intel_sdvo_priv *sdvo_priv = output->dev_priv;17011657 struct intel_sdvo_sdtv_resolution_request tv_res;17021702- uint32_t reply = 0;16581658+ uint32_t reply = 0, format_map = 0;16591659+ int i;17031660 uint8_t status;17041704- int i = 0;1705166117061706- intel_sdvo_check_tv_format(output);1707166217081663 /* Read the list of supported input resolutions for the selected TV17091664 * format.17101665 */17111711- memset(&tv_res, 0, sizeof(tv_res));17121712- memcpy(&tv_res, &sdvo_priv->tv_format, sizeof(tv_res));16661666+ for (i = 0; i < TV_FORMAT_NUM; i++)16671667+ if (tv_format_names[i] == sdvo_priv->tv_format_name)16681668+ break;16691669+16701670+ format_map = (1 << i);16711671+ memcpy(&tv_res, &format_map,16721672+ sizeof(struct intel_sdvo_sdtv_resolution_request) >16731673+ sizeof(format_map) ? sizeof(format_map) :16741674+ sizeof(struct intel_sdvo_sdtv_resolution_request));16751675+16761676+ intel_sdvo_set_target_output(output, sdvo_priv->controlled_output);16771677+17131678 intel_sdvo_write_cmd(output, SDVO_CMD_GET_SDTV_RESOLUTION_SUPPORT,17141679 &tv_res, sizeof(tv_res));17151680 status = intel_sdvo_read_response(output, &reply, 3);···17331680 if (nmode)17341681 drm_mode_probed_add(connector, nmode);17351682 }16831683+17361684}1737168517381686static void intel_sdvo_get_lvds_modes(struct drm_connector *connector)···18011747 intel_i2c_destroy(intel_output->i2c_bus);18021748 if (intel_output->ddc_bus)18031749 intel_i2c_destroy(intel_output->ddc_bus);17501750+ if (sdvo_priv->analog_ddc_bus)17511751+ intel_i2c_destroy(sdvo_priv->analog_ddc_bus);1804175218051753 if (sdvo_priv->sdvo_lvds_fixed_mode != NULL)18061754 drm_mode_destroy(connector->dev,18071755 sdvo_priv->sdvo_lvds_fixed_mode);1808175617571757+ if (sdvo_priv->tv_format_property)17581758+ drm_property_destroy(connector->dev,17591759+ sdvo_priv->tv_format_property);17601760+18091761 drm_sysfs_connector_remove(connector);18101762 drm_connector_cleanup(connector);1811176318121764 kfree(intel_output);17651765+}17661766+17671767+static int17681768+intel_sdvo_set_property(struct drm_connector *connector,17691769+ struct drm_property *property,17701770+ uint64_t val)17711771+{17721772+ struct intel_output *intel_output = to_intel_output(connector);17731773+ struct intel_sdvo_priv *sdvo_priv = intel_output->dev_priv;17741774+ struct drm_encoder *encoder = &intel_output->enc;17751775+ struct drm_crtc *crtc = encoder->crtc;17761776+ int ret = 0;17771777+ bool changed = false;17781778+17791779+ ret = drm_connector_property_set_value(connector, property, val);17801780+ if (ret < 0)17811781+ goto out;17821782+17831783+ if (property == sdvo_priv->tv_format_property) {17841784+ if (val >= TV_FORMAT_NUM) {17851785+ ret = -EINVAL;17861786+ goto out;17871787+ }17881788+ if (sdvo_priv->tv_format_name ==17891789+ sdvo_priv->tv_format_supported[val])17901790+ goto out;17911791+17921792+ sdvo_priv->tv_format_name = sdvo_priv->tv_format_supported[val];17931793+ changed = true;17941794+ } else {17951795+ ret = -EINVAL;17961796+ goto out;17971797+ }17981798+17991799+ if (changed && crtc)18001800+ drm_crtc_helper_set_mode(crtc, &crtc->mode, crtc->x,18011801+ crtc->y, crtc->fb);18021802+out:18031803+ return ret;18131804}1814180518151806static const struct drm_encoder_helper_funcs intel_sdvo_helper_funcs = {···18711772 .restore = intel_sdvo_restore,18721773 .detect = intel_sdvo_detect,18731774 .fill_modes = drm_helper_probe_single_connector_modes,17751775+ .set_property = intel_sdvo_set_property,18741776 .destroy = intel_sdvo_destroy,18751777};18761778···20661966 intel_sdvo_set_colorimetry(intel_output,20671967 SDVO_COLORIMETRY_RGB256);20681968 connector->connector_type = DRM_MODE_CONNECTOR_HDMIA;19691969+ intel_output->clone_mask =19701970+ (1 << INTEL_SDVO_NON_TV_CLONE_BIT) |19711971+ (1 << INTEL_ANALOG_CLONE_BIT);20691972 }20701973 } else if (flags & SDVO_OUTPUT_SVID0) {20711974···20771974 connector->connector_type = DRM_MODE_CONNECTOR_SVIDEO;20781975 sdvo_priv->is_tv = true;20791976 intel_output->needs_tv_clock = true;19771977+ intel_output->clone_mask = 1 << INTEL_SDVO_TV_CLONE_BIT;20801978 } else if (flags & SDVO_OUTPUT_RGB0) {2081197920821980 sdvo_priv->controlled_output = SDVO_OUTPUT_RGB0;20831981 encoder->encoder_type = DRM_MODE_ENCODER_DAC;20841982 connector->connector_type = DRM_MODE_CONNECTOR_VGA;19831983+ intel_output->clone_mask = (1 << INTEL_SDVO_NON_TV_CLONE_BIT) |19841984+ (1 << INTEL_ANALOG_CLONE_BIT);20851985 } else if (flags & SDVO_OUTPUT_RGB1) {2086198620871987 sdvo_priv->controlled_output = SDVO_OUTPUT_RGB1;···20961990 encoder->encoder_type = DRM_MODE_ENCODER_LVDS;20971991 connector->connector_type = DRM_MODE_CONNECTOR_LVDS;20981992 sdvo_priv->is_lvds = true;19931993+ intel_output->clone_mask = (1 << INTEL_ANALOG_CLONE_BIT) |19941994+ (1 << INTEL_SDVO_LVDS_CLONE_BIT);20991995 } else if (flags & SDVO_OUTPUT_LVDS1) {2100199621011997 sdvo_priv->controlled_output = SDVO_OUTPUT_LVDS1;21021998 encoder->encoder_type = DRM_MODE_ENCODER_LVDS;21031999 connector->connector_type = DRM_MODE_CONNECTOR_LVDS;21042000 sdvo_priv->is_lvds = true;20012001+ intel_output->clone_mask = (1 << INTEL_ANALOG_CLONE_BIT) |20022002+ (1 << INTEL_SDVO_LVDS_CLONE_BIT);21052003 } else {2106200421072005 unsigned char bytes[2];···21172007 bytes[0], bytes[1]);21182008 ret = false;21192009 }20102010+ intel_output->crtc_mask = (1 << 0) | (1 << 1);2120201121212012 if (ret && registered)21222013 ret = drm_sysfs_connector_add(connector) == 0 ? true : false;212320142124201521252016 return ret;20172017+20182018+}20192019+20202020+static void intel_sdvo_tv_create_property(struct drm_connector *connector)20212021+{20222022+ struct intel_output *intel_output = to_intel_output(connector);20232023+ struct intel_sdvo_priv *sdvo_priv = intel_output->dev_priv;20242024+ struct intel_sdvo_tv_format format;20252025+ uint32_t format_map, i;20262026+ uint8_t status;20272027+20282028+ intel_sdvo_set_target_output(intel_output,20292029+ sdvo_priv->controlled_output);20302030+20312031+ intel_sdvo_write_cmd(intel_output,20322032+ SDVO_CMD_GET_SUPPORTED_TV_FORMATS, NULL, 0);20332033+ status = intel_sdvo_read_response(intel_output,20342034+ &format, sizeof(format));20352035+ if (status != SDVO_CMD_STATUS_SUCCESS)20362036+ return;20372037+20382038+ memcpy(&format_map, &format, sizeof(format) > sizeof(format_map) ?20392039+ sizeof(format_map) : sizeof(format));20402040+20412041+ if (format_map == 0)20422042+ return;20432043+20442044+ sdvo_priv->format_supported_num = 0;20452045+ for (i = 0 ; i < TV_FORMAT_NUM; i++)20462046+ if (format_map & (1 << i)) {20472047+ sdvo_priv->tv_format_supported20482048+ [sdvo_priv->format_supported_num++] =20492049+ tv_format_names[i];20502050+ }20512051+20522052+20532053+ sdvo_priv->tv_format_property =20542054+ drm_property_create(20552055+ connector->dev, DRM_MODE_PROP_ENUM,20562056+ "mode", sdvo_priv->format_supported_num);20572057+20582058+ for (i = 0; i < sdvo_priv->format_supported_num; i++)20592059+ drm_property_add_enum(20602060+ sdvo_priv->tv_format_property, i,20612061+ i, sdvo_priv->tv_format_supported[i]);20622062+20632063+ sdvo_priv->tv_format_name = sdvo_priv->tv_format_supported[0];20642064+ drm_connector_attach_property(20652065+ connector, sdvo_priv->tv_format_property, 0);2126206621272067}21282068···22202060 }2221206122222062 /* setup the DDC bus. */22232223- if (output_device == SDVOB)20632063+ if (output_device == SDVOB) {22242064 intel_output->ddc_bus = intel_i2c_create(dev, GPIOE, "SDVOB DDC BUS");22252225- else20652065+ sdvo_priv->analog_ddc_bus = intel_i2c_create(dev, GPIOA,20662066+ "SDVOB/VGA DDC BUS");20672067+ } else {22262068 intel_output->ddc_bus = intel_i2c_create(dev, GPIOE, "SDVOC DDC BUS");20692069+ sdvo_priv->analog_ddc_bus = intel_i2c_create(dev, GPIOA,20702070+ "SDVOC/VGA DDC BUS");20712071+ }2227207222282073 if (intel_output->ddc_bus == NULL)22292074 goto err_i2c;···22622097 drm_encoder_helper_add(&intel_output->enc, &intel_sdvo_helper_funcs);2263209822642099 drm_mode_connector_attach_encoder(&intel_output->base, &intel_output->enc);21002100+ if (sdvo_priv->is_tv)21012101+ intel_sdvo_tv_create_property(connector);22652102 drm_sysfs_connector_add(connector);2266210322672104 intel_sdvo_select_ddc_bus(sdvo_priv);···22962129 return true;2297213022982131err_i2c:21322132+ if (sdvo_priv->analog_ddc_bus != NULL)21332133+ intel_i2c_destroy(sdvo_priv->analog_ddc_bus);22992134 if (intel_output->ddc_bus != NULL)23002135 intel_i2c_destroy(intel_output->ddc_bus);23012136 if (intel_output->i2c_bus != NULL)
+32
drivers/gpu/drm/i915/intel_tv.c
···14371437 return type;14381438}1439143914401440+/*14411441+ * Here we set accurate tv format according to connector type14421442+ * i.e Component TV should not be assigned by NTSC or PAL14431443+ */14441444+static void intel_tv_find_better_format(struct drm_connector *connector)14451445+{14461446+ struct intel_output *intel_output = to_intel_output(connector);14471447+ struct intel_tv_priv *tv_priv = intel_output->dev_priv;14481448+ const struct tv_mode *tv_mode = intel_tv_mode_find(intel_output);14491449+ int i;14501450+14511451+ if ((tv_priv->type == DRM_MODE_CONNECTOR_Component) ==14521452+ tv_mode->component_only)14531453+ return;14541454+14551455+14561456+ for (i = 0; i < sizeof(tv_modes) / sizeof(*tv_modes); i++) {14571457+ tv_mode = tv_modes + i;14581458+14591459+ if ((tv_priv->type == DRM_MODE_CONNECTOR_Component) ==14601460+ tv_mode->component_only)14611461+ break;14621462+ }14631463+14641464+ tv_priv->tv_format = tv_mode->name;14651465+ drm_connector_property_set_value(connector,14661466+ connector->dev->mode_config.tv_mode_property, i);14671467+}14681468+14401469/**14411470 * Detect the TV connection.14421471 *···15021473 if (type < 0)15031474 return connector_status_disconnected;1504147514761476+ intel_tv_find_better_format(connector);15051477 return connector_status_connected;15061478}15071479···17481718 if (!intel_output) {17491719 return;17501720 }17211721+17511722 connector = &intel_output->base;1752172317531724 drm_connector_init(dev, connector, &intel_tv_connector_funcs,···17601729 drm_mode_connector_attach_encoder(&intel_output->base, &intel_output->enc);17611730 tv_priv = (struct intel_tv_priv *)(intel_output + 1);17621731 intel_output->type = INTEL_OUTPUT_TVOUT;17321732+ intel_output->clone_mask = (1 << INTEL_TV_CLONE_BIT);17631733 intel_output->enc.possible_crtcs = ((1 << 0) | (1 << 1));17641734 intel_output->enc.possible_clones = (1 << INTEL_OUTPUT_TVOUT);17651735 intel_output->dev_priv = tv_priv;
+10
drivers/gpu/drm/radeon/r100.c
···11401140 tmp |= tile_flags;11411141 ib[idx] = tmp;11421142 break;11431143+ case RADEON_RB3D_ZPASS_ADDR:11441144+ r = r100_cs_packet_next_reloc(p, &reloc);11451145+ if (r) {11461146+ DRM_ERROR("No reloc for ib[%d]=0x%04X\n",11471147+ idx, reg);11481148+ r100_cs_dump_packet(p, pkt);11491149+ return r;11501150+ }11511151+ ib[idx] = ib_chunk->kdata[idx] + ((u32)reloc->lobj.gpu_offset);11521152+ break;11431153 default:11441154 /* FIXME: we don't want to allow anyothers packet */11451155 break;
+3-1
drivers/gpu/drm/radeon/r300.c
···450450 /* rv350,rv370,rv380 */451451 rdev->num_gb_pipes = 1;452452 }453453+ rdev->num_z_pipes = 1;453454 gb_tile_config = (R300_ENABLE_TILING | R300_TILE_SIZE_16);454455 switch (rdev->num_gb_pipes) {455456 case 2:···489488 printk(KERN_WARNING "Failed to wait MC idle while "490489 "programming pipes. Bad things might happen.\n");491490 }492492- DRM_INFO("radeon: %d pipes initialized.\n", rdev->num_gb_pipes);491491+ DRM_INFO("radeon: %d quad pipes, %d Z pipes initialized.\n",492492+ rdev->num_gb_pipes, rdev->num_z_pipes);493493}494494495495int r300_ga_reset(struct radeon_device *rdev)
+12-1
drivers/gpu/drm/radeon/r420.c
···165165 printk(KERN_WARNING "Failed to wait GUI idle while "166166 "programming pipes. Bad things might happen.\n");167167 }168168- DRM_INFO("radeon: %d pipes initialized.\n", rdev->num_gb_pipes);168168+169169+ if (rdev->family == CHIP_RV530) {170170+ tmp = RREG32(RV530_GB_PIPE_SELECT2);171171+ if ((tmp & 3) == 3)172172+ rdev->num_z_pipes = 2;173173+ else174174+ rdev->num_z_pipes = 1;175175+ } else176176+ rdev->num_z_pipes = 1;177177+178178+ DRM_INFO("radeon: %d quad pipes, %d z pipes initialized.\n",179179+ rdev->num_gb_pipes, rdev->num_z_pipes);169180}170181171182void r420_gpu_init(struct radeon_device *rdev)
-1
drivers/gpu/drm/radeon/r520.c
···177177 */178178 /* workaround for RV530 */179179 if (rdev->family == CHIP_RV530) {180180- WREG32(0x4124, 1);181180 WREG32(0x4128, 0xFF);182181 }183182 r420_pipes_init(rdev);
+1
drivers/gpu/drm/radeon/radeon.h
···655655 int usec_timeout;656656 enum radeon_pll_errata pll_errata;657657 int num_gb_pipes;658658+ int num_z_pipes;658659 int disp_priority;659660 /* BIOS */660661 uint8_t *bios;
···30813081 case RADEON_PARAM_NUM_GB_PIPES:30823082 value = dev_priv->num_gb_pipes;30833083 break;30843084+ case RADEON_PARAM_NUM_Z_PIPES:30853085+ value = dev_priv->num_z_pipes;30863086+ break;30843087 default:30853088 DRM_DEBUG("Invalid parameter %d\n", param->param);30863089 return -EINVAL;
+12-2
drivers/i2c/busses/i2c-omap.c
···674674675675 err = 0;676676complete:677677- omap_i2c_write_reg(dev, OMAP_I2C_STAT_REG, stat);677677+ /*678678+ * Ack the stat in one go, but [R/X]DR and [R/X]RDY should be679679+ * acked after the data operation is complete.680680+ * Ref: TRM SWPU114Q Figure 18-31681681+ */682682+ omap_i2c_write_reg(dev, OMAP_I2C_STAT_REG, stat &683683+ ~(OMAP_I2C_STAT_RRDY | OMAP_I2C_STAT_RDR |684684+ OMAP_I2C_STAT_XRDY | OMAP_I2C_STAT_XDR));678685679686 if (stat & OMAP_I2C_STAT_NACK) {680687 err |= OMAP_I2C_STAT_NACK;···694687 }695688 if (stat & (OMAP_I2C_STAT_ARDY | OMAP_I2C_STAT_NACK |696689 OMAP_I2C_STAT_AL)) {690690+ omap_i2c_ack_stat(dev, stat &691691+ (OMAP_I2C_STAT_RRDY | OMAP_I2C_STAT_RDR |692692+ OMAP_I2C_STAT_XRDY | OMAP_I2C_STAT_XDR));697693 omap_i2c_complete_cmd(dev, err);698694 return IRQ_HANDLED;699695 }···784774 * memory to the I2C interface.785775 */786776787787- if (cpu_is_omap34xx()) {777777+ if (dev->rev <= OMAP_I2C_REV_ON_3430) {788778 while (!(stat & OMAP_I2C_STAT_XUDF)) {789779 if (stat & (OMAP_I2C_STAT_NACK | OMAP_I2C_STAT_AL)) {790780 omap_i2c_ack_stat(dev, stat & (OMAP_I2C_STAT_XRDY | OMAP_I2C_STAT_XDR));
+91-64
drivers/i2c/busses/i2c-stu300.c
···117117 STU300_ERROR_NONE = 0,118118 STU300_ERROR_ACKNOWLEDGE_FAILURE,119119 STU300_ERROR_BUS_ERROR,120120- STU300_ERROR_ARBITRATION_LOST120120+ STU300_ERROR_ARBITRATION_LOST,121121+ STU300_ERROR_UNKNOWN121122};122123123124/* timeout waiting for the controller to respond */···128127 * The number of address send athemps tried before giving up.129128 * If the first one failes it seems like 5 to 8 attempts are required.130129 */131131-#define NUM_ADDR_RESEND_ATTEMPTS 10130130+#define NUM_ADDR_RESEND_ATTEMPTS 12132131133132/* I2C clock speed, in Hz 0-400kHz*/134133static unsigned int scl_frequency = 100000;···150149 * @msg_index: index of current message151150 * @msg_len: length of current message152151 */152152+153153struct stu300_dev {154154 struct platform_device *pdev;155155 struct i2c_adapter adapter;···190188 return readl(address) & 0x000000FFU;191189}192190191191+static void stu300_irq_enable(struct stu300_dev *dev)192192+{193193+ u32 val;194194+ val = stu300_r8(dev->virtbase + I2C_CR);195195+ val |= I2C_CR_INTERRUPT_ENABLE;196196+ /* Twice paranoia (possible HW glitch) */197197+ stu300_wr8(val, dev->virtbase + I2C_CR);198198+ stu300_wr8(val, dev->virtbase + I2C_CR);199199+}200200+201201+static void stu300_irq_disable(struct stu300_dev *dev)202202+{203203+ u32 val;204204+ val = stu300_r8(dev->virtbase + I2C_CR);205205+ val &= ~I2C_CR_INTERRUPT_ENABLE;206206+ /* Twice paranoia (possible HW glitch) */207207+ stu300_wr8(val, dev->virtbase + I2C_CR);208208+ stu300_wr8(val, dev->virtbase + I2C_CR);209209+}210210+211211+193212/*194213 * Tells whether a certain event or events occurred in195214 * response to a command. The events represent states in···219196 * documentation and can only be treated as abstract state220197 * machine states.221198 *222222- * @ret 0 = event has not occurred, any other value means223223- * the event occurred.199199+ * @ret 0 = event has not occurred or unknown error, any200200+ * other value means the correct event occurred or an error.224201 */202202+225203static int stu300_event_occurred(struct stu300_dev *dev,226204 enum stu300_event mr_event) {227205 u32 status1;···230206231207 /* What event happened? */232208 status1 = stu300_r8(dev->virtbase + I2C_SR1);209209+233210 if (!(status1 & I2C_SR1_EVF_IND))234211 /* No event at all */235212 return 0;213213+236214 status2 = stu300_r8(dev->virtbase + I2C_SR2);215215+216216+ /* Block any multiple interrupts */217217+ stu300_irq_disable(dev);218218+219219+ /* Check for errors first */220220+ if (status2 & I2C_SR2_AF_IND) {221221+ dev->cmd_err = STU300_ERROR_ACKNOWLEDGE_FAILURE;222222+ return 1;223223+ } else if (status2 & I2C_SR2_BERR_IND) {224224+ dev->cmd_err = STU300_ERROR_BUS_ERROR;225225+ return 1;226226+ } else if (status2 & I2C_SR2_ARLO_IND) {227227+ dev->cmd_err = STU300_ERROR_ARBITRATION_LOST;228228+ return 1;229229+ }237230238231 switch (mr_event) {239232 case STU300_EVENT_1:···262221 case STU300_EVENT_7:263222 case STU300_EVENT_8:264223 if (status1 & I2C_SR1_BTF_IND) {265265- if (status2 & I2C_SR2_AF_IND)266266- dev->cmd_err = STU300_ERROR_ACKNOWLEDGE_FAILURE;267267- else if (status2 & I2C_SR2_BERR_IND)268268- dev->cmd_err = STU300_ERROR_BUS_ERROR;269224 return 1;270225 }271226 break;···277240 case STU300_EVENT_6:278241 if (status2 & I2C_SR2_ENDAD_IND) {279242 /* First check for any errors */280280- if (status2 & I2C_SR2_AF_IND)281281- dev->cmd_err = STU300_ERROR_ACKNOWLEDGE_FAILURE;282243 return 1;283244 }284245 break;···287252 default:288253 break;289254 }290290- if (status2 & I2C_SR2_ARLO_IND)291291- dev->cmd_err = STU300_ERROR_ARBITRATION_LOST;255255+ /* If we get here, we're on thin ice.256256+ * Here we are in a status where we have257257+ * gotten a response that does not match258258+ * what we requested.259259+ */260260+ dev->cmd_err = STU300_ERROR_UNKNOWN;261261+ dev_err(&dev->pdev->dev,262262+ "Unhandled interrupt! %d sr1: 0x%x sr2: 0x%x\n",263263+ mr_event, status1, status2);292264 return 0;293265}294266···304262 struct stu300_dev *dev = data;305263 int res;306264265265+ /* Just make sure that the block is clocked */266266+ clk_enable(dev->clk);267267+307268 /* See if this was what we were waiting for */308269 spin_lock(&dev->cmd_issue_lock);309309- if (dev->cmd_event != STU300_EVENT_NONE) {310310- res = stu300_event_occurred(dev, dev->cmd_event);311311- if (res || dev->cmd_err != STU300_ERROR_NONE) {312312- u32 val;313270314314- complete(&dev->cmd_complete);315315- /* Block any multiple interrupts */316316- val = stu300_r8(dev->virtbase + I2C_CR);317317- val &= ~I2C_CR_INTERRUPT_ENABLE;318318- stu300_wr8(val, dev->virtbase + I2C_CR);319319- }320320- }271271+ res = stu300_event_occurred(dev, dev->cmd_event);272272+ if (res || dev->cmd_err != STU300_ERROR_NONE)273273+ complete(&dev->cmd_complete);274274+321275 spin_unlock(&dev->cmd_issue_lock);276276+277277+ clk_disable(dev->clk);278278+322279 return IRQ_HANDLED;323280}324281···349308 stu300_wr8(cr_value, dev->virtbase + I2C_CR);350309 ret = wait_for_completion_interruptible_timeout(&dev->cmd_complete,351310 STU300_TIMEOUT);352352-353311 if (ret < 0) {354312 dev_err(&dev->pdev->dev,355313 "wait_for_completion_interruptible_timeout() "···382342 enum stu300_event mr_event)383343{384344 int ret;385385- u32 val;386345387346 if (unlikely(irqs_disabled())) {388347 /* TODO: implement polling for this case if need be. */···393354 /* Is it already here? */394355 spin_lock_irq(&dev->cmd_issue_lock);395356 dev->cmd_err = STU300_ERROR_NONE;396396- if (stu300_event_occurred(dev, mr_event)) {397397- spin_unlock_irq(&dev->cmd_issue_lock);398398- goto exit_await_check_err;399399- }400400- init_completion(&dev->cmd_complete);401401- dev->cmd_err = STU300_ERROR_NONE;402357 dev->cmd_event = mr_event;403358359359+ init_completion(&dev->cmd_complete);360360+404361 /* Turn on the I2C interrupt for current operation */405405- val = stu300_r8(dev->virtbase + I2C_CR);406406- val |= I2C_CR_INTERRUPT_ENABLE;407407- stu300_wr8(val, dev->virtbase + I2C_CR);408408-409409- /* Twice paranoia (possible HW glitch) */410410- stu300_wr8(val, dev->virtbase + I2C_CR);411411-412412- /* Check again: is it already here? */413413- if (unlikely(stu300_event_occurred(dev, mr_event))) {414414- /* Disable IRQ again. */415415- val &= ~I2C_CR_INTERRUPT_ENABLE;416416- stu300_wr8(val, dev->virtbase + I2C_CR);417417- spin_unlock_irq(&dev->cmd_issue_lock);418418- goto exit_await_check_err;419419- }362362+ stu300_irq_enable(dev);420363421364 /* Unlock the command block and wait for the event to occur */422365 spin_unlock_irq(&dev->cmd_issue_lock);366366+423367 ret = wait_for_completion_interruptible_timeout(&dev->cmd_complete,424368 STU300_TIMEOUT);425425-426369 if (ret < 0) {427370 dev_err(&dev->pdev->dev,428371 "wait_for_completion_interruptible_timeout()"···422401 return -ETIMEDOUT;423402 }424403425425- exit_await_check_err:426404 if (dev->cmd_err != STU300_ERROR_NONE) {427405 if (mr_event != STU300_EVENT_6) {428406 dev_err(&dev->pdev->dev, "controller "···477457};478458479459static const struct stu300_clkset stu300_clktable[] = {480480- { 0, 0xFFU },481481- { 2500000, I2C_OAR2_FR_25_10MHZ },482482- { 10000000, I2C_OAR2_FR_10_1667MHZ },483483- { 16670000, I2C_OAR2_FR_1667_2667MHZ },484484- { 26670000, I2C_OAR2_FR_2667_40MHZ },485485- { 40000000, I2C_OAR2_FR_40_5333MHZ },486486- { 53330000, I2C_OAR2_FR_5333_66MHZ },487487- { 66000000, I2C_OAR2_FR_66_80MHZ },488488- { 80000000, I2C_OAR2_FR_80_100MHZ },460460+ { 0, 0xFFU },461461+ { 2500000, I2C_OAR2_FR_25_10MHZ },462462+ { 10000000, I2C_OAR2_FR_10_1667MHZ },463463+ { 16670000, I2C_OAR2_FR_1667_2667MHZ },464464+ { 26670000, I2C_OAR2_FR_2667_40MHZ },465465+ { 40000000, I2C_OAR2_FR_40_5333MHZ },466466+ { 53330000, I2C_OAR2_FR_5333_66MHZ },467467+ { 66000000, I2C_OAR2_FR_66_80MHZ },468468+ { 80000000, I2C_OAR2_FR_80_100MHZ },489469 { 100000000, 0xFFU },490470};471471+491472492473static int stu300_set_clk(struct stu300_dev *dev, unsigned long clkrate)493474{···515494516495 if (dev->speed > 100000)517496 /* Fast Mode I2C */518518- val = ((clkrate/dev->speed)-9)/3;497497+ val = ((clkrate/dev->speed) - 9)/3 + 1;519498 else520499 /* Standard Mode I2C */521521- val = ((clkrate/dev->speed)-7)/2;500500+ val = ((clkrate/dev->speed) - 7)/2 + 1;522501523502 /* According to spec the divider must be > 2 */524503 if (val < 0x002) {···578557 */579558 clkrate = clk_get_rate(dev->clk);580559 ret = stu300_set_clk(dev, clkrate);560560+581561 if (ret)582562 return ret;583563 /*···663641 int attempts = 0;664642 struct stu300_dev *dev = i2c_get_adapdata(adap);665643666666-667644 clk_enable(dev->clk);668645669646 /* Remove this if (0) to trace each and every message. */···736715737716 if (attempts < NUM_ADDR_RESEND_ATTEMPTS && attempts > 0) {738717 dev_dbg(&dev->pdev->dev, "managed to get address "739739- "through after %d attempts\n", attempts);718718+ "through after %d attempts\n", attempts);740719 } else if (attempts == NUM_ADDR_RESEND_ATTEMPTS) {741720 dev_dbg(&dev->pdev->dev, "I give up, tried %d times "742742- "to resend address.\n",743743- NUM_ADDR_RESEND_ATTEMPTS);721721+ "to resend address.\n",722722+ NUM_ADDR_RESEND_ATTEMPTS);744723 goto exit_disable;745724 }725725+746726747727 if (msg->flags & I2C_M_RD) {748728 /* READ: we read the actual bytes one at a time */···826804{827805 int ret = -1;828806 int i;807807+829808 struct stu300_dev *dev = i2c_get_adapdata(adap);830809 dev->msg_len = num;810810+831811 for (i = 0; i < num; i++) {832812 /*833813 * Another driver appears to send stop for each message,···841817 dev->msg_index = i;842818843819 ret = stu300_xfer_msg(adap, &msgs[i], (i == (num - 1)));820820+844821 if (ret != 0) {845822 num = ret;846823 break;···870845 struct resource *res;871846 int bus_nr;872847 int ret = 0;848848+ char clk_name[] = "I2C0";873849874850 dev = kzalloc(sizeof(struct stu300_dev), GFP_KERNEL);875851 if (!dev) {···880854 }881855882856 bus_nr = pdev->id;883883- dev->clk = clk_get(&pdev->dev, NULL);857857+ clk_name[3] += (char)bus_nr;858858+ dev->clk = clk_get(&pdev->dev, clk_name);884859 if (IS_ERR(dev->clk)) {885860 ret = PTR_ERR(dev->clk);886861 dev_err(&pdev->dev, "could not retrieve i2c bus clock\n");
+39-25
drivers/input/joydev.c
···456456 unsigned int cmd, void __user *argp)457457{458458 struct input_dev *dev = joydev->handle.dev;459459+ size_t len;459460 int i, j;461461+ const char *name;460462463463+ /* Process fixed-sized commands. */461464 switch (cmd) {462465463466 case JS_SET_CAL:···502499 return copy_to_user(argp, joydev->corr,503500 sizeof(joydev->corr[0]) * joydev->nabs) ? -EFAULT : 0;504501505505- case JSIOCSAXMAP:506506- if (copy_from_user(joydev->abspam, argp,507507- sizeof(__u8) * (ABS_MAX + 1)))502502+ }503503+504504+ /*505505+ * Process variable-sized commands (the axis and button map commands506506+ * are considered variable-sized to decouple them from the values of507507+ * ABS_MAX and KEY_MAX).508508+ */509509+ switch (cmd & ~IOCSIZE_MASK) {510510+511511+ case (JSIOCSAXMAP & ~IOCSIZE_MASK):512512+ len = min_t(size_t, _IOC_SIZE(cmd), sizeof(joydev->abspam));513513+ /*514514+ * FIXME: we should not copy into our axis map before515515+ * validating the data.516516+ */517517+ if (copy_from_user(joydev->abspam, argp, len))508518 return -EFAULT;509519510520 for (i = 0; i < joydev->nabs; i++) {···527511 }528512 return 0;529513530530- case JSIOCGAXMAP:531531- return copy_to_user(argp, joydev->abspam,532532- sizeof(__u8) * (ABS_MAX + 1)) ? -EFAULT : 0;514514+ case (JSIOCGAXMAP & ~IOCSIZE_MASK):515515+ len = min_t(size_t, _IOC_SIZE(cmd), sizeof(joydev->abspam));516516+ return copy_to_user(argp, joydev->abspam, len) ? -EFAULT : 0;533517534534- case JSIOCSBTNMAP:535535- if (copy_from_user(joydev->keypam, argp,536536- sizeof(__u16) * (KEY_MAX - BTN_MISC + 1)))518518+ case (JSIOCSBTNMAP & ~IOCSIZE_MASK):519519+ len = min_t(size_t, _IOC_SIZE(cmd), sizeof(joydev->keypam));520520+ /*521521+ * FIXME: we should not copy into our keymap before522522+ * validating the data.523523+ */524524+ if (copy_from_user(joydev->keypam, argp, len))537525 return -EFAULT;538526539527 for (i = 0; i < joydev->nkey; i++) {···549529550530 return 0;551531552552- case JSIOCGBTNMAP:553553- return copy_to_user(argp, joydev->keypam,554554- sizeof(__u16) * (KEY_MAX - BTN_MISC + 1)) ? -EFAULT : 0;532532+ case (JSIOCGBTNMAP & ~IOCSIZE_MASK):533533+ len = min_t(size_t, _IOC_SIZE(cmd), sizeof(joydev->keypam));534534+ return copy_to_user(argp, joydev->keypam, len) ? -EFAULT : 0;555535556556- default:557557- if ((cmd & ~IOCSIZE_MASK) == JSIOCGNAME(0)) {558558- int len;559559- const char *name = dev->name;536536+ case JSIOCGNAME(0):537537+ name = dev->name;538538+ if (!name)539539+ return 0;560540561561- if (!name)562562- return 0;563563- len = strlen(name) + 1;564564- if (len > _IOC_SIZE(cmd))565565- len = _IOC_SIZE(cmd);566566- if (copy_to_user(argp, name, len))567567- return -EFAULT;568568- return len;569569- }541541+ len = min_t(size_t, _IOC_SIZE(cmd), strlen(name) + 1);542542+ return copy_to_user(argp, name, len) ? -EFAULT : len;570543 }544544+571545 return -EINVAL;572546}573547
···223223 { USB_DEVICE(0x05ef, 0x8884) }, /* AVB Mag Turbo Force */224224 { USB_DEVICE(0x05ef, 0x8888) }, /* AVB Top Shot FFB Racing Wheel */225225 { USB_DEVICE(0x061c, 0xc0a4) }, /* ACT LABS Force RS */226226+ { USB_DEVICE(0x061c, 0xc084) }, /* ACT LABS Force RS */226227 { USB_DEVICE(0x06f8, 0x0001) }, /* Guillemot Race Leader Force Feedback */227228 { USB_DEVICE(0x06f8, 0x0004) }, /* Guillemot Force Feedback Racing Wheel */228229 { USB_DEVICE(0x06f8, 0xa302) }, /* Guillemot Jet Leader 3D */
+29-14
drivers/input/tablet/wacom_sys.c
···388388 return result;389389}390390391391+static int wacom_query_tablet_data(struct usb_interface *intf)392392+{393393+ unsigned char *rep_data;394394+ int limit = 0;395395+ int error;396396+397397+ rep_data = kmalloc(2, GFP_KERNEL);398398+ if (!rep_data)399399+ return -ENOMEM;400400+401401+ do {402402+ rep_data[0] = 2;403403+ rep_data[1] = 2;404404+ error = usb_set_report(intf, WAC_HID_FEATURE_REPORT,405405+ 2, rep_data, 2);406406+ if (error >= 0)407407+ error = usb_get_report(intf,408408+ WAC_HID_FEATURE_REPORT, 2,409409+ rep_data, 2);410410+ } while ((error < 0 || rep_data[1] != 2) && limit++ < 5);411411+412412+ kfree(rep_data);413413+414414+ return error < 0 ? error : 0;415415+}416416+391417static int wacom_probe(struct usb_interface *intf, const struct usb_device_id *id)392418{393419 struct usb_device *dev = interface_to_usbdev(intf);···424398 struct wacom_features *features;425399 struct input_dev *input_dev;426400 int error = -ENOMEM;427427- char rep_data[2], limit = 0;428401 struct hid_descriptor *hid_desc;429402430403 wacom = kzalloc(sizeof(struct wacom), GFP_KERNEL);···514489515490 /*516491 * Ask the tablet to report tablet data if it is not a Tablet PC.517517- * Repeat until it succeeds492492+ * Note that if query fails it is not a hard failure.518493 */519519- if (wacom_wac->features->type != TABLETPC) {520520- do {521521- rep_data[0] = 2;522522- rep_data[1] = 2;523523- error = usb_set_report(intf, WAC_HID_FEATURE_REPORT,524524- 2, rep_data, 2);525525- if (error >= 0)526526- error = usb_get_report(intf,527527- WAC_HID_FEATURE_REPORT, 2,528528- rep_data, 2);529529- } while ((error < 0 || rep_data[1] != 2) && limit++ < 5);530530- }494494+ if (wacom_wac->features->type != TABLETPC)495495+ wacom_query_tablet_data(intf);531496532497 usb_set_intfdata(intf, wacom);533498 return 0;
+13-4
drivers/input/touchscreen/ucb1400_ts.c
···170170 ucb1400_reg_write(ucb->ac97, UCB_IE_CLEAR, isr);171171 ucb1400_reg_write(ucb->ac97, UCB_IE_CLEAR, 0);172172173173- if (isr & UCB_IE_TSPX) {173173+ if (isr & UCB_IE_TSPX)174174 ucb1400_ts_irq_disable(ucb->ac97);175175- enable_irq(ucb->irq);176176- } else177177- printk(KERN_ERR "ucb1400: unexpected IE_STATUS = %#x\n", isr);175175+ else176176+ dev_dbg(&ucb->ts_idev->dev, "ucb1400: unexpected IE_STATUS = %#x\n", isr);177177+ enable_irq(ucb->irq);178178}179179180180static int ucb1400_ts_thread(void *_ucb)···345345static int ucb1400_ts_probe(struct platform_device *dev)346346{347347 int error, x_res, y_res;348348+ u16 fcsr;348349 struct ucb1400_ts *ucb = dev->dev.platform_data;349350350351 ucb->ts_idev = input_allocate_device();···382381 ucb->ts_idev->close = ucb1400_ts_close;383382 ucb->ts_idev->evbit[0] = BIT_MASK(EV_ABS) | BIT_MASK(EV_KEY);384383 ucb->ts_idev->keybit[BIT_WORD(BTN_TOUCH)] = BIT_MASK(BTN_TOUCH);384384+385385+ /*386386+ * Enable ADC filter to prevent horrible jitter on Colibri.387387+ * This also further reduces jitter on boards where ADCSYNC388388+ * pin is connected.389389+ */390390+ fcsr = ucb1400_reg_read(ucb->ac97, UCB_FCSR);391391+ ucb1400_reg_write(ucb->ac97, UCB_FCSR, fcsr | UCB_FCSR_AVE);385392386393 ucb1400_adc_enable(ucb->ac97);387394 x_res = ucb1400_ts_read_xres(ucb);
+17-7
drivers/leds/ledtrig-gpio.c
···117117118118 gpio_data->inverted = !!inverted;119119120120+ /* After inverting, we need to update the LED. */121121+ schedule_work(&gpio_data->work);122122+120123 return n;121124}122125static DEVICE_ATTR(inverted, 0644, gpio_trig_inverted_show,···149146 return -EINVAL;150147 }151148149149+ if (gpio_data->gpio == gpio)150150+ return n;151151+152152 if (!gpio) {153153- free_irq(gpio_to_irq(gpio_data->gpio), led);153153+ if (gpio_data->gpio != 0)154154+ free_irq(gpio_to_irq(gpio_data->gpio), led);155155+ gpio_data->gpio = 0;154156 return n;155157 }156158157157- if (gpio_data->gpio > 0 && gpio_data->gpio != gpio)158158- free_irq(gpio_to_irq(gpio_data->gpio), led);159159-160160- gpio_data->gpio = gpio;161159 ret = request_irq(gpio_to_irq(gpio), gpio_trig_irq,162160 IRQF_SHARED | IRQF_TRIGGER_RISING163161 | IRQF_TRIGGER_FALLING, "ledtrig-gpio", led);164164- if (ret)162162+ if (ret) {165163 dev_err(dev, "request_irq failed with error %d\n", ret);164164+ } else {165165+ if (gpio_data->gpio != 0)166166+ free_irq(gpio_to_irq(gpio_data->gpio), led);167167+ gpio_data->gpio = gpio;168168+ }166169167170 return ret ? ret : n;168171}···220211 device_remove_file(led->dev, &dev_attr_inverted);221212 device_remove_file(led->dev, &dev_attr_desired_brightness);222213 flush_work(&gpio_data->work);223223- free_irq(gpio_to_irq(gpio_data->gpio),led);214214+ if (gpio_data->gpio != 0)215215+ free_irq(gpio_to_irq(gpio_data->gpio), led);224216 kfree(gpio_data);225217 }226218}
+1-1
drivers/macintosh/via-maciisi.c
···288288 }289289 /* This could be BAD... when the ADB controller doesn't respond290290 * for this long, it's probably not coming back :-( */291291- if(count >= 50) /* Hopefully shouldn't happen */291291+ if (count > 50) /* Hopefully shouldn't happen */292292 printk(KERN_ERR "maciisi_send_request: poll timed out!\n");293293}294294
+25-17
drivers/media/dvb/siano/Kconfig
···22# Siano Mobile Silicon Digital TV device configuration33#4455-config DVB_SIANO_SMS1XXX66- tristate "Siano SMS1XXX USB dongle support"77- depends on DVB_CORE && USB && INPUT55+config SMS_SIANO_MDTV66+ tristate "Siano SMS1xxx based MDTV receiver"77+ depends on DVB_CORE && INPUT88 ---help---99- Choose Y here if you have a USB dongle with a SMS1XXX chipset.99+ Choose Y or M here if you have MDTV receiver with a Siano chipset.10101111- To compile this driver as a module, choose M here: the1212- module will be called sms1xxx.1111+ To compile this driver as a module, choose M here1212+ (The module will be called smsmdtv).13131414-config DVB_SIANO_SMS1XXX_SMS_IDS1515- bool "Enable support for Siano Mobile Silicon default USB IDs"1616- depends on DVB_SIANO_SMS1XXX1717- default y1414+ Further documentation on this driver can be found on the WWW1515+ at http://www.siano-ms.com/1616+1717+if SMS_SIANO_MDTV1818+menu "Siano module components"1919+2020+# Hardware interfaces support2121+2222+config SMS_USB_DRV2323+ tristate "USB interface support"2424+ depends on DVB_CORE && USB1825 ---help---1919- Choose Y here if you have a USB dongle with a SMS1XXX chipset2020- that uses Siano Mobile Silicon's default usb vid:pid.2626+ Choose if you would like to have Siano's support for USB interface21272222- Choose N here if you would prefer to use Siano's external driver.2323-2424- Further documentation on this driver can be found on the WWW at2525- <http://www.siano-ms.com/>.2626-2828+config SMS_SDIO_DRV2929+ tristate "SDIO interface support"3030+ depends on DVB_CORE && MMC3131+ ---help---3232+ Choose if you would like to have Siano's support for SDIO interface3333+endmenu3434+endif # SMS_SIANO_MDTV
···114114115115config USB_GSPCA_SN9C20X_EVDEV116116 bool "Enable evdev support"117117- depends on USB_GSPCA_SN9C20X117117+ depends on USB_GSPCA_SN9C20X && INPUT118118 ---help---119119 Say Y here in order to enable evdev support for sn9c20x webcam button.120120
+1-1
drivers/media/video/zr364xx.c
···695695 for (i = 0; i < 2; i++) {696696 err =697697 send_control_msg(udev, 1, init[cam->method][i].value,698698- 0, init[i][cam->method].bytes,698698+ 0, init[cam->method][i].bytes,699699 init[cam->method][i].size);700700 if (err < 0) {701701 dev_err(&udev->dev, "error during release sequence\n");
···4141 struct ixpdev_priv *ip = netdev_priv(dev);4242 struct ixpdev_tx_desc *desc;4343 int entry;4444+ unsigned long flags;44454546 if (unlikely(skb->len > PAGE_SIZE)) {4647 /* @@@ Count drops. */···64636564 dev->trans_start = jiffies;66656767- local_irq_disable();6666+ local_irq_save(flags);6867 ip->tx_queue_entries++;6968 if (ip->tx_queue_entries == TX_BUF_COUNT_PER_CHAN)7069 netif_stop_queue(dev);7171- local_irq_enable();7070+ local_irq_restore(flags);72717372 return 0;7473}
+4-3
drivers/net/macb.c
···620620 dma_addr_t mapping;621621 unsigned int len, entry;622622 u32 ctrl;623623+ unsigned long flags;623624624625#ifdef DEBUG625626 int i;···636635#endif637636638637 len = skb->len;639639- spin_lock_irq(&bp->lock);638638+ spin_lock_irqsave(&bp->lock, flags);640639641640 /* This is a hard error, log it. */642641 if (TX_BUFFS_AVAIL(bp) < 1) {643642 netif_stop_queue(dev);644644- spin_unlock_irq(&bp->lock);643643+ spin_unlock_irqrestore(&bp->lock, flags);645644 dev_err(&bp->pdev->dev,646645 "BUG! Tx Ring full when queue awake!\n");647646 dev_dbg(&bp->pdev->dev, "tx_head = %u, tx_tail = %u\n",···675674 if (TX_BUFFS_AVAIL(bp) < 1)676675 netif_stop_queue(dev);677676678678- spin_unlock_irq(&bp->lock);677677+ spin_unlock_irqrestore(&bp->lock, flags);679678680679 dev->trans_start = jiffies;681680
+3-2
drivers/net/mlx4/en_tx.c
···437437{438438 struct mlx4_en_cq *cq = &priv->tx_cq[tx_ind];439439 struct mlx4_en_tx_ring *ring = &priv->tx_ring[tx_ind];440440+ unsigned long flags;440441441442 /* If we don't have a pending timer, set one up to catch our recent442443 post in case the interface becomes idle */···446445447446 /* Poll the CQ every mlx4_en_TX_MODER_POLL packets */448447 if ((++ring->poll_cnt & (MLX4_EN_TX_POLL_MODER - 1)) == 0)449449- if (spin_trylock_irq(&ring->comp_lock)) {448448+ if (spin_trylock_irqsave(&ring->comp_lock, flags)) {450449 mlx4_en_process_tx_cq(priv->dev, cq);451451- spin_unlock_irq(&ring->comp_lock);450450+ spin_unlock_irqrestore(&ring->comp_lock, flags);452451 }453452}454453
+22-18
drivers/net/smc91x.c
···196196/* this enables an interrupt in the interrupt mask register */197197#define SMC_ENABLE_INT(lp, x) do { \198198 unsigned char mask; \199199- spin_lock_irq(&lp->lock); \199199+ unsigned long smc_enable_flags; \200200+ spin_lock_irqsave(&lp->lock, smc_enable_flags); \200201 mask = SMC_GET_INT_MASK(lp); \201202 mask |= (x); \202203 SMC_SET_INT_MASK(lp, mask); \203203- spin_unlock_irq(&lp->lock); \204204+ spin_unlock_irqrestore(&lp->lock, smc_enable_flags); \204205} while (0)205206206207/* this disables an interrupt from the interrupt mask register */207208#define SMC_DISABLE_INT(lp, x) do { \208209 unsigned char mask; \209209- spin_lock_irq(&lp->lock); \210210+ unsigned long smc_disable_flags; \211211+ spin_lock_irqsave(&lp->lock, smc_disable_flags); \210212 mask = SMC_GET_INT_MASK(lp); \211213 mask &= ~(x); \212214 SMC_SET_INT_MASK(lp, mask); \213213- spin_unlock_irq(&lp->lock); \215215+ spin_unlock_irqrestore(&lp->lock, smc_disable_flags); \214216} while (0)215217216218/*···522520 * any other concurrent access and C would always interrupt B. But life523521 * isn't that easy in a SMP world...524522 */525525-#define smc_special_trylock(lock) \523523+#define smc_special_trylock(lock, flags) \526524({ \527525 int __ret; \528528- local_irq_disable(); \526526+ local_irq_save(flags); \529527 __ret = spin_trylock(lock); \530528 if (!__ret) \531531- local_irq_enable(); \529529+ local_irq_restore(flags); \532530 __ret; \533531})534534-#define smc_special_lock(lock) spin_lock_irq(lock)535535-#define smc_special_unlock(lock) spin_unlock_irq(lock)532532+#define smc_special_lock(lock, flags) spin_lock_irqsave(lock, flags)533533+#define smc_special_unlock(lock, flags) spin_unlock_irqrestore(lock, flags)536534#else537537-#define smc_special_trylock(lock) (1)538538-#define smc_special_lock(lock) do { } while (0)539539-#define smc_special_unlock(lock) do { } while (0)535535+#define smc_special_trylock(lock, flags) (1)536536+#define smc_special_lock(lock, flags) do { } while (0)537537+#define smc_special_unlock(lock, flags) do { } while (0)540538#endif541539542540/*···550548 struct sk_buff *skb;551549 unsigned int packet_no, len;552550 unsigned char *buf;551551+ unsigned long flags;553552554553 DBG(3, "%s: %s\n", dev->name, __func__);555554556556- if (!smc_special_trylock(&lp->lock)) {555555+ if (!smc_special_trylock(&lp->lock, flags)) {557556 netif_stop_queue(dev);558557 tasklet_schedule(&lp->tx_task);559558 return;···562559563560 skb = lp->pending_tx_skb;564561 if (unlikely(!skb)) {565565- smc_special_unlock(&lp->lock);562562+ smc_special_unlock(&lp->lock, flags);566563 return;567564 }568565 lp->pending_tx_skb = NULL;···572569 printk("%s: Memory allocation failed.\n", dev->name);573570 dev->stats.tx_errors++;574571 dev->stats.tx_fifo_errors++;575575- smc_special_unlock(&lp->lock);572572+ smc_special_unlock(&lp->lock, flags);576573 goto done;577574 }578575···611608612609 /* queue the packet for TX */613610 SMC_SET_MMU_CMD(lp, MC_ENQUEUE);614614- smc_special_unlock(&lp->lock);611611+ smc_special_unlock(&lp->lock, flags);615612616613 dev->trans_start = jiffies;617614 dev->stats.tx_packets++;···636633 struct smc_local *lp = netdev_priv(dev);637634 void __iomem *ioaddr = lp->base;638635 unsigned int numPages, poll_count, status;636636+ unsigned long flags;639637640638 DBG(3, "%s: %s\n", dev->name, __func__);641639···662658 return 0;663659 }664660665665- smc_special_lock(&lp->lock);661661+ smc_special_lock(&lp->lock, flags);666662667663 /* now, try to allocate the memory */668664 SMC_SET_MMU_CMD(lp, MC_ALLOC | numPages);···680676 }681677 } while (--poll_count);682678683683- smc_special_unlock(&lp->lock);679679+ smc_special_unlock(&lp->lock, flags);684680685681 lp->pending_tx_skb = skb;686682 if (!poll_count) {
+46-15
drivers/net/virtio_net.c
···7070 struct sk_buff_head recv;7171 struct sk_buff_head send;72727373+ /* Work struct for refilling if we run low on memory. */7474+ struct delayed_work refill;7575+7376 /* Chain pages by the private ptr. */7477 struct page *pages;7578};···276273 dev_kfree_skb(skb);277274}278275279279-static void try_fill_recv_maxbufs(struct virtnet_info *vi)276276+static bool try_fill_recv_maxbufs(struct virtnet_info *vi, gfp_t gfp)280277{281278 struct sk_buff *skb;282279 struct scatterlist sg[2+MAX_SKB_FRAGS];283280 int num, err, i;281281+ bool oom = false;284282285283 sg_init_table(sg, 2+MAX_SKB_FRAGS);286284 for (;;) {287285 struct virtio_net_hdr *hdr;288286289287 skb = netdev_alloc_skb(vi->dev, MAX_PACKET_LEN + NET_IP_ALIGN);290290- if (unlikely(!skb))288288+ if (unlikely(!skb)) {289289+ oom = true;291290 break;291291+ }292292293293 skb_reserve(skb, NET_IP_ALIGN);294294 skb_put(skb, MAX_PACKET_LEN);···302296 if (vi->big_packets) {303297 for (i = 0; i < MAX_SKB_FRAGS; i++) {304298 skb_frag_t *f = &skb_shinfo(skb)->frags[i];305305- f->page = get_a_page(vi, GFP_ATOMIC);299299+ f->page = get_a_page(vi, gfp);306300 if (!f->page)307301 break;308302···331325 if (unlikely(vi->num > vi->max))332326 vi->max = vi->num;333327 vi->rvq->vq_ops->kick(vi->rvq);328328+ return !oom;334329}335330336336-static void try_fill_recv(struct virtnet_info *vi)331331+/* Returns false if we couldn't fill entirely (OOM). */332332+static bool try_fill_recv(struct virtnet_info *vi, gfp_t gfp)337333{338334 struct sk_buff *skb;339335 struct scatterlist sg[1];340336 int err;337337+ bool oom = false;341338342342- if (!vi->mergeable_rx_bufs) {343343- try_fill_recv_maxbufs(vi);344344- return;345345- }339339+ if (!vi->mergeable_rx_bufs)340340+ return try_fill_recv_maxbufs(vi, gfp);346341347342 for (;;) {348343 skb_frag_t *f;349344350345 skb = netdev_alloc_skb(vi->dev, GOOD_COPY_LEN + NET_IP_ALIGN);351351- if (unlikely(!skb))346346+ if (unlikely(!skb)) {347347+ oom = true;352348 break;349349+ }353350354351 skb_reserve(skb, NET_IP_ALIGN);355352356353 f = &skb_shinfo(skb)->frags[0];357357- f->page = get_a_page(vi, GFP_ATOMIC);354354+ f->page = get_a_page(vi, gfp);358355 if (!f->page) {356356+ oom = true;359357 kfree_skb(skb);360358 break;361359 }···383373 if (unlikely(vi->num > vi->max))384374 vi->max = vi->num;385375 vi->rvq->vq_ops->kick(vi->rvq);376376+ return !oom;386377}387378388379static void skb_recv_done(struct virtqueue *rvq)···394383 rvq->vq_ops->disable_cb(rvq);395384 __napi_schedule(&vi->napi);396385 }386386+}387387+388388+static void refill_work(struct work_struct *work)389389+{390390+ struct virtnet_info *vi;391391+ bool still_empty;392392+393393+ vi = container_of(work, struct virtnet_info, refill.work);394394+ napi_disable(&vi->napi);395395+ try_fill_recv(vi, GFP_KERNEL);396396+ still_empty = (vi->num == 0);397397+ napi_enable(&vi->napi);398398+399399+ /* In theory, this can happen: if we don't get any buffers in400400+ * we will *never* try to fill again. */401401+ if (still_empty)402402+ schedule_delayed_work(&vi->refill, HZ/2);397403}398404399405static int virtnet_poll(struct napi_struct *napi, int budget)···428400 received++;429401 }430402431431- /* FIXME: If we oom and completely run out of inbufs, we need432432- * to start a timer trying to fill more. */433433- if (vi->num < vi->max / 2)434434- try_fill_recv(vi);403403+ if (vi->num < vi->max / 2) {404404+ if (!try_fill_recv(vi, GFP_ATOMIC))405405+ schedule_delayed_work(&vi->refill, 0);406406+ }435407436408 /* Out of packets? */437409 if (received < budget) {···921893 vi->vdev = vdev;922894 vdev->priv = vi;923895 vi->pages = NULL;896896+ INIT_DELAYED_WORK(&vi->refill, refill_work);924897925898 /* If they give us a callback when all buffers are done, we don't need926899 * the timer. */···970941 }971942972943 /* Last of all, set up some receive buffers. */973973- try_fill_recv(vi);944944+ try_fill_recv(vi, GFP_KERNEL);974945975946 /* If we didn't even get one input buffer, we're useless. */976947 if (vi->num == 0) {···987958988959unregister:989960 unregister_netdev(dev);961961+ cancel_delayed_work_sync(&vi->refill);990962free_vqs:991963 vdev->config->del_vqs(vdev);992964free:···1016986 BUG_ON(vi->num != 0);10179871018988 unregister_netdev(vi->dev);989989+ cancel_delayed_work_sync(&vi->refill);10199901020991 vdev->config->del_vqs(vi->vdev);1021992
+1-1
drivers/net/wireless/orinoco/hw.c
···7070 int err = 0;7171 u8 tsc_arr[4][IW_ENCODE_SEQ_MAX_SIZE];72727373- if ((key < 0) || (key > 4))7373+ if ((key < 0) || (key >= 4))7474 return -EINVAL;75757676 err = hermes_read_ltv(hw, USER_BAP, HERMES_RID_CURRENT_TKIP_IV,
···846846 int i;847847 u32 val;848848849849+ if (!dev->state_saved)850850+ return 0;849851 /* PCI Express register must be restored first */850852 pci_restore_pcie_state(dev);851853
+1
drivers/platform/x86/toshiba_acpi.c
···335335 if (hci_result != HCI_SUCCESS) {336336 /* Can't do anything useful */337337 mutex_unlock(&dev->mutex);338338+ return;338339 }339340340341 new_rfk_state = value;
···7676 * Return 0 upon success, -ERRNO upon failure.7777 */78787979-static int v9fs_parse_options(struct v9fs_session_info *v9ses)7979+static int v9fs_parse_options(struct v9fs_session_info *v9ses, char *opts)8080{8181 char *options;8282 substring_t args[MAX_OPT_ARGS];···9090 v9ses->debug = 0;9191 v9ses->cache = 0;92929393- if (!v9ses->options)9393+ if (!opts)9494 return 0;95959696- options = kstrdup(v9ses->options, GFP_KERNEL);9696+ options = kstrdup(opts, GFP_KERNEL);9797 if (!options) {9898 P9_DPRINTK(P9_DEBUG_ERROR,9999 "failed to allocate copy of option string\n");···206206 v9ses->uid = ~0;207207 v9ses->dfltuid = V9FS_DEFUID;208208 v9ses->dfltgid = V9FS_DEFGID;209209- if (data) {210210- v9ses->options = kstrdup(data, GFP_KERNEL);211211- if (!v9ses->options) {212212- P9_DPRINTK(P9_DEBUG_ERROR,213213- "failed to allocate copy of option string\n");214214- retval = -ENOMEM;215215- goto error;216216- }217217- }218209219219- rc = v9fs_parse_options(v9ses);210210+ rc = v9fs_parse_options(v9ses, data);220211 if (rc < 0) {221212 retval = rc;222213 goto error;223214 }224215225225- v9ses->clnt = p9_client_create(dev_name, v9ses->options);226226-216216+ v9ses->clnt = p9_client_create(dev_name, data);227217 if (IS_ERR(v9ses->clnt)) {228218 retval = PTR_ERR(v9ses->clnt);229219 v9ses->clnt = NULL;···270280271281 __putname(v9ses->uname);272282 __putname(v9ses->aname);273273- kfree(v9ses->options);274283}275284276285/**
-1
fs/9p/v9fs.h
···8585 unsigned int afid;8686 unsigned int cache;87878888- char *options; /* copy of mount options */8988 char *uname; /* user name to mount as */9089 char *aname; /* name of remote hierarchy being mounted */9190 unsigned int maxdata; /* max data for client interface */
+65-61
fs/9p/vfs_inode.c
···171171172172/**173173 * v9fs_blank_wstat - helper function to setup a 9P stat structure174174- * @v9ses: 9P session info (for determining extended mode)175174 * @wstat: structure to initialize176175 *177176 */···206207207208struct inode *v9fs_get_inode(struct super_block *sb, int mode)208209{210210+ int err;209211 struct inode *inode;210212 struct v9fs_session_info *v9ses = sb->s_fs_info;211213212214 P9_DPRINTK(P9_DEBUG_VFS, "super block: %p mode: %o\n", sb, mode);213215214216 inode = new_inode(sb);215215- if (inode) {216216- inode->i_mode = mode;217217- inode->i_uid = current_fsuid();218218- inode->i_gid = current_fsgid();219219- inode->i_blocks = 0;220220- inode->i_rdev = 0;221221- inode->i_atime = inode->i_mtime = inode->i_ctime = CURRENT_TIME;222222- inode->i_mapping->a_ops = &v9fs_addr_operations;223223-224224- switch (mode & S_IFMT) {225225- case S_IFIFO:226226- case S_IFBLK:227227- case S_IFCHR:228228- case S_IFSOCK:229229- if (!v9fs_extended(v9ses)) {230230- P9_DPRINTK(P9_DEBUG_ERROR,231231- "special files without extended mode\n");232232- return ERR_PTR(-EINVAL);233233- }234234- init_special_inode(inode, inode->i_mode,235235- inode->i_rdev);236236- break;237237- case S_IFREG:238238- inode->i_op = &v9fs_file_inode_operations;239239- inode->i_fop = &v9fs_file_operations;240240- break;241241- case S_IFLNK:242242- if (!v9fs_extended(v9ses)) {243243- P9_DPRINTK(P9_DEBUG_ERROR,244244- "extended modes used w/o 9P2000.u\n");245245- return ERR_PTR(-EINVAL);246246- }247247- inode->i_op = &v9fs_symlink_inode_operations;248248- break;249249- case S_IFDIR:250250- inc_nlink(inode);251251- if (v9fs_extended(v9ses))252252- inode->i_op = &v9fs_dir_inode_operations_ext;253253- else254254- inode->i_op = &v9fs_dir_inode_operations;255255- inode->i_fop = &v9fs_dir_operations;256256- break;257257- default:258258- P9_DPRINTK(P9_DEBUG_ERROR,259259- "BAD mode 0x%x S_IFMT 0x%x\n",260260- mode, mode & S_IFMT);261261- return ERR_PTR(-EINVAL);262262- }263263- } else {217217+ if (!inode) {264218 P9_EPRINTK(KERN_WARNING, "Problem allocating inode\n");265219 return ERR_PTR(-ENOMEM);266220 }221221+222222+ inode->i_mode = mode;223223+ inode->i_uid = current_fsuid();224224+ inode->i_gid = current_fsgid();225225+ inode->i_blocks = 0;226226+ inode->i_rdev = 0;227227+ inode->i_atime = inode->i_mtime = inode->i_ctime = CURRENT_TIME;228228+ inode->i_mapping->a_ops = &v9fs_addr_operations;229229+230230+ switch (mode & S_IFMT) {231231+ case S_IFIFO:232232+ case S_IFBLK:233233+ case S_IFCHR:234234+ case S_IFSOCK:235235+ if (!v9fs_extended(v9ses)) {236236+ P9_DPRINTK(P9_DEBUG_ERROR,237237+ "special files without extended mode\n");238238+ err = -EINVAL;239239+ goto error;240240+ }241241+ init_special_inode(inode, inode->i_mode, inode->i_rdev);242242+ break;243243+ case S_IFREG:244244+ inode->i_op = &v9fs_file_inode_operations;245245+ inode->i_fop = &v9fs_file_operations;246246+ break;247247+ case S_IFLNK:248248+ if (!v9fs_extended(v9ses)) {249249+ P9_DPRINTK(P9_DEBUG_ERROR,250250+ "extended modes used w/o 9P2000.u\n");251251+ err = -EINVAL;252252+ goto error;253253+ }254254+ inode->i_op = &v9fs_symlink_inode_operations;255255+ break;256256+ case S_IFDIR:257257+ inc_nlink(inode);258258+ if (v9fs_extended(v9ses))259259+ inode->i_op = &v9fs_dir_inode_operations_ext;260260+ else261261+ inode->i_op = &v9fs_dir_inode_operations;262262+ inode->i_fop = &v9fs_dir_operations;263263+ break;264264+ default:265265+ P9_DPRINTK(P9_DEBUG_ERROR, "BAD mode 0x%x S_IFMT 0x%x\n",266266+ mode, mode & S_IFMT);267267+ err = -EINVAL;268268+ goto error;269269+ }270270+267271 return inode;272272+273273+error:274274+ iput(inode);275275+ return ERR_PTR(err);268276}269277270278/*···344338345339 ret = NULL;346340 st = p9_client_stat(fid);347347- if (IS_ERR(st)) {348348- err = PTR_ERR(st);349349- st = NULL;350350- goto error;351351- }341341+ if (IS_ERR(st))342342+ return ERR_CAST(st);352343353344 umode = p9mode2unixmode(v9ses, st->mode);354345 ret = v9fs_get_inode(sb, umode);355346 if (IS_ERR(ret)) {356347 err = PTR_ERR(ret);357357- ret = NULL;358348 goto error;359349 }360350361351 v9fs_stat2inode(st, ret, sb);362352 ret->i_ino = v9fs_qid2ino(&st->qid);353353+ p9stat_free(st);363354 kfree(st);364355 return ret;365356366357error:358358+ p9stat_free(st);367359 kfree(st);368368- if (ret)369369- iput(ret);370370-371360 return ERR_PTR(err);372361}373362···404403 * @v9ses: session information405404 * @dir: directory that dentry is being created in406405 * @dentry: dentry that is being created406406+ * @extension: 9p2000.u extension string to support devices, etc.407407 * @perm: create permissions408408 * @mode: open mode409409- * @extension: 9p2000.u extension string to support devices, etc.410409 *411410 */412411static struct p9_fid *···471470 dentry->d_op = &v9fs_dentry_operations;472471473472 d_instantiate(dentry, inode);474474- v9fs_fid_add(dentry, fid);473473+ err = v9fs_fid_add(dentry, fid);474474+ if (err < 0)475475+ goto error;476476+475477 return ofid;476478477479error:
···1165116511661166 if (!test_set_buffer_dirty(bh)) {11671167 struct page *page = bh->b_page;11681168- if (!TestSetPageDirty(page))11691169- __set_page_dirty(page, page_mapping(page), 0);11681168+ if (!TestSetPageDirty(page)) {11691169+ struct address_space *mapping = page_mapping(page);11701170+ if (mapping)11711171+ __set_page_dirty(page, mapping, 0);11721172+ }11701173 }11711174}11721175
+2-2
fs/exec.c
···678678}679679EXPORT_SYMBOL(open_exec);680680681681-int kernel_read(struct file *file, unsigned long offset,682682- char *addr, unsigned long count)681681+int kernel_read(struct file *file, loff_t offset,682682+ char *addr, unsigned long count)683683{684684 mm_segment_t old_fs;685685 loff_t pos = offset;
+15-13
fs/ext3/Kconfig
···2929 module will be called ext3.30303131config EXT3_DEFAULTS_TO_ORDERED3232- bool "Default to 'data=ordered' in ext3 (legacy option)"3232+ bool "Default to 'data=ordered' in ext3"3333 depends on EXT3_FS3434 help3535- If a filesystem does not explicitly specify a data ordering3636- mode, and the journal capability allowed it, ext3 used to3737- historically default to 'data=ordered'.3535+ The journal mode options for ext3 have different tradeoffs3636+ between when data is guaranteed to be on disk and3737+ performance. The use of "data=writeback" can cause3838+ unwritten data to appear in files after an system crash or3939+ power failure, which can be a security issue. However,4040+ "data=ordered" mode can also result in major performance4141+ problems, including seconds-long delays before an fsync()4242+ call returns. For details, see:38433939- That was a rather unfortunate choice, because it leads to all4040- kinds of latency problems, and the 'data=writeback' mode is more4141- appropriate these days.4444+ http://ext4.wiki.kernel.org/index.php/Ext3_data_mode_tradeoffs42454343- You should probably always answer 'n' here, and if you really4444- want to use 'data=ordered' mode, set it in the filesystem itself4545- with 'tune2fs -o journal_data_ordered'.4646-4747- But if you really want to enable the legacy default, you can do4848- so by answering 'y' to this question.4646+ If you have been historically happy with ext3's performance,4747+ data=ordered mode will be a safe choice and you should4848+ answer 'y' here. If you understand the reliability and data4949+ privacy issues of data=writeback and are willing to make5050+ that trade off, answer 'n'.49515052config EXT3_FS_XATTR5153 bool "Ext3 extended attributes"
+27-13
fs/ext3/super.c
···543543#endif544544}545545546546+static char *data_mode_string(unsigned long mode)547547+{548548+ switch (mode) {549549+ case EXT3_MOUNT_JOURNAL_DATA:550550+ return "journal";551551+ case EXT3_MOUNT_ORDERED_DATA:552552+ return "ordered";553553+ case EXT3_MOUNT_WRITEBACK_DATA:554554+ return "writeback";555555+ }556556+ return "unknown";557557+}558558+546559/*547560 * Show an option if548561 * - it's set to a non-default value OR···629616 if (test_opt(sb, NOBH))630617 seq_puts(seq, ",nobh");631618632632- if (test_opt(sb, DATA_FLAGS) == EXT3_MOUNT_JOURNAL_DATA)633633- seq_puts(seq, ",data=journal");634634- else if (test_opt(sb, DATA_FLAGS) == EXT3_MOUNT_ORDERED_DATA)635635- seq_puts(seq, ",data=ordered");636636- else if (test_opt(sb, DATA_FLAGS) == EXT3_MOUNT_WRITEBACK_DATA)637637- seq_puts(seq, ",data=writeback");638638-619619+ seq_printf(seq, ",data=%s", data_mode_string(sbi->s_mount_opt &620620+ EXT3_MOUNT_DATA_FLAGS));639621 if (test_opt(sb, DATA_ERR_ABORT))640622 seq_puts(seq, ",data_err=abort");641623···10321024 datacheck:10331025 if (is_remount) {10341026 if ((sbi->s_mount_opt & EXT3_MOUNT_DATA_FLAGS)10351035- != data_opt) {10361036- printk(KERN_ERR10371037- "EXT3-fs: cannot change data "10381038- "mode on remount\n");10391039- return 0;10401040- }10271027+ == data_opt)10281028+ break;10291029+ printk(KERN_ERR10301030+ "EXT3-fs (device %s): Cannot change "10311031+ "data mode on remount. The filesystem "10321032+ "is mounted in data=%s mode and you "10331033+ "try to remount it in data=%s mode.\n",10341034+ sb->s_id,10351035+ data_mode_string(sbi->s_mount_opt &10361036+ EXT3_MOUNT_DATA_FLAGS),10371037+ data_mode_string(data_opt));10381038+ return 0;10411039 } else {10421040 sbi->s_mount_opt &= ~EXT3_MOUNT_DATA_FLAGS;10431041 sbi->s_mount_opt |= data_opt;
···12501250 continue;12511251 }12521252 /* Initialize or reset the session */12531253- if (nfs4_has_session(clp) &&12541254- test_and_clear_bit(NFS4CLNT_SESSION_SETUP, &clp->cl_state)) {12531253+ if (test_and_clear_bit(NFS4CLNT_SESSION_SETUP, &clp->cl_state)12541254+ && nfs4_has_session(clp)) {12551255 if (clp->cl_cons_state == NFS_CS_SESSION_INITING)12561256 status = nfs4_initialize_session(clp);12571257 else
+31-2
fs/notify/inotify/inotify_fsnotify.c
···105105 return send;106106}107107108108+/*109109+ * This is NEVER supposed to be called. Inotify marks should either have been110110+ * removed from the idr when the watch was removed or in the111111+ * fsnotify_destroy_mark_by_group() call when the inotify instance was being112112+ * torn down. This is only called if the idr is about to be freed but there113113+ * are still marks in it.114114+ */108115static int idr_callback(int id, void *p, void *data)109116{110110- BUG();117117+ struct fsnotify_mark_entry *entry;118118+ struct inotify_inode_mark_entry *ientry;119119+ static bool warned = false;120120+121121+ if (warned)122122+ return 0;123123+124124+ warned = false;125125+ entry = p;126126+ ientry = container_of(entry, struct inotify_inode_mark_entry, fsn_entry);127127+128128+ WARN(1, "inotify closing but id=%d for entry=%p in group=%p still in "129129+ "idr. Probably leaking memory\n", id, p, data);130130+131131+ /*132132+ * I'm taking the liberty of assuming that the mark in question is a133133+ * valid address and I'm dereferencing it. This might help to figure134134+ * out why we got here and the panic is no worse than the original135135+ * BUG() that was here.136136+ */137137+ if (entry)138138+ printk(KERN_WARNING "entry->group=%p inode=%p wd=%d\n",139139+ entry->group, entry->inode, ientry->wd);111140 return 0;112141}113142114143static void inotify_free_group_priv(struct fsnotify_group *group)115144{116145 /* ideally the idr is empty and we won't hit the BUG in teh callback */117117- idr_for_each(&group->inotify_data.idr, idr_callback, NULL);146146+ idr_for_each(&group->inotify_data.idr, idr_callback, group);118147 idr_remove_all(&group->inotify_data.idr);119148 idr_destroy(&group->inotify_data.idr);120149}
+159-88
fs/notify/inotify/inotify_user.c
···47474848static struct vfsmount *inotify_mnt __read_mostly;49495050-/* this just sits here and wastes global memory. used to just pad userspace messages with zeros */5151-static struct inotify_event nul_inotify_event;5252-5350/* these are configurable via /proc/sys/fs/inotify/ */5451static int inotify_max_user_instances __read_mostly;5552static int inotify_max_queued_events __read_mostly;···154157155158 event = fsnotify_peek_notify_event(group);156159157157- event_size += roundup(event->name_len, event_size);160160+ if (event->name_len)161161+ event_size += roundup(event->name_len + 1, event_size);158162159163 if (event_size > count)160164 return ERR_PTR(-EINVAL);···181183 struct fsnotify_event_private_data *fsn_priv;182184 struct inotify_event_private_data *priv;183185 size_t event_size = sizeof(struct inotify_event);184184- size_t name_len;186186+ size_t name_len = 0;185187186188 /* we get the inotify watch descriptor from the event private data */187189 spin_lock(&event->lock);···197199 inotify_free_event_priv(fsn_priv);198200 }199201200200- /* round up event->name_len so it is a multiple of event_size */201201- name_len = roundup(event->name_len, event_size);202202+ /*203203+ * round up event->name_len so it is a multiple of event_size204204+ * plus an extra byte for the terminating '\0'.205205+ */206206+ if (event->name_len)207207+ name_len = roundup(event->name_len + 1, event_size);202208 inotify_event.len = name_len;203209204210 inotify_event.mask = inotify_mask_to_arg(event->mask);···226224 return -EFAULT;227225 buf += event->name_len;228226229229- /* fill userspace with 0's from nul_inotify_event */230230- if (copy_to_user(buf, &nul_inotify_event, len_to_zero))227227+ /* fill userspace with 0's */228228+ if (clear_user(buf, len_to_zero))231229 return -EFAULT;232230 buf += len_to_zero;233231 event_size += name_len;···328326 list_for_each_entry(holder, &group->notification_list, event_list) {329327 event = holder->event;330328 send_len += sizeof(struct inotify_event);331331- send_len += roundup(event->name_len,332332- sizeof(struct inotify_event));329329+ if (event->name_len)330330+ send_len += roundup(event->name_len + 1,331331+ sizeof(struct inotify_event));333332 }334333 mutex_unlock(&group->notification_mutex);335334 ret = put_user(send_len, (int __user *) p);···367364 return error;368365}369366367367+/*368368+ * Remove the mark from the idr (if present) and drop the reference369369+ * on the mark because it was in the idr.370370+ */370371static void inotify_remove_from_idr(struct fsnotify_group *group,371372 struct inotify_inode_mark_entry *ientry)372373{373374 struct idr *idr;375375+ struct fsnotify_mark_entry *entry;376376+ struct inotify_inode_mark_entry *found_ientry;377377+ int wd;374378375379 spin_lock(&group->inotify_data.idr_lock);376380 idr = &group->inotify_data.idr;377377- idr_remove(idr, ientry->wd);378378- spin_unlock(&group->inotify_data.idr_lock);381381+ wd = ientry->wd;382382+383383+ if (wd == -1)384384+ goto out;385385+386386+ entry = idr_find(&group->inotify_data.idr, wd);387387+ if (unlikely(!entry))388388+ goto out;389389+390390+ found_ientry = container_of(entry, struct inotify_inode_mark_entry, fsn_entry);391391+ if (unlikely(found_ientry != ientry)) {392392+ /* We found an entry in the idr with the right wd, but it's393393+ * not the entry we were told to remove. eparis seriously394394+ * fucked up somewhere. */395395+ WARN_ON(1);396396+ ientry->wd = -1;397397+ goto out;398398+ }399399+400400+ /* One ref for being in the idr, one ref held by the caller */401401+ BUG_ON(atomic_read(&entry->refcnt) < 2);402402+403403+ idr_remove(idr, wd);379404 ientry->wd = -1;405405+406406+ /* removed from the idr, drop that ref */407407+ fsnotify_put_mark(entry);408408+out:409409+ spin_unlock(&group->inotify_data.idr_lock);380410}411411+381412/*382382- * Send IN_IGNORED for this wd, remove this wd from the idr, and drop the383383- * internal reference help on the mark because it is in the idr.413413+ * Send IN_IGNORED for this wd, remove this wd from the idr.384414 */385415void inotify_ignored_and_remove_idr(struct fsnotify_mark_entry *entry,386416 struct fsnotify_group *group)···453417 /* remove this entry from the idr */454418 inotify_remove_from_idr(group, ientry);455419456456- /* removed from idr, drop that reference */457457- fsnotify_put_mark(entry);458458-459420 atomic_dec(&group->inotify_data.user->inotify_watches);460421}461422···464431 kmem_cache_free(inotify_inode_mark_cachep, ientry);465432}466433467467-static int inotify_update_watch(struct fsnotify_group *group, struct inode *inode, u32 arg)434434+static int inotify_update_existing_watch(struct fsnotify_group *group,435435+ struct inode *inode,436436+ u32 arg)468437{469469- struct fsnotify_mark_entry *entry = NULL;438438+ struct fsnotify_mark_entry *entry;470439 struct inotify_inode_mark_entry *ientry;471471- struct inotify_inode_mark_entry *tmp_ientry;472472- int ret = 0;473473- int add = (arg & IN_MASK_ADD);474474- __u32 mask;475440 __u32 old_mask, new_mask;441441+ __u32 mask;442442+ int add = (arg & IN_MASK_ADD);443443+ int ret;476444477445 /* don't allow invalid bits: we don't want flags set */478446 mask = inotify_arg_to_mask(arg);479447 if (unlikely(!mask))480448 return -EINVAL;481449482482- tmp_ientry = kmem_cache_alloc(inotify_inode_mark_cachep, GFP_KERNEL);483483- if (unlikely(!tmp_ientry))484484- return -ENOMEM;485485- /* we set the mask at the end after attaching it */486486- fsnotify_init_mark(&tmp_ientry->fsn_entry, inotify_free_mark);487487- tmp_ientry->wd = -1;488488-489489-find_entry:490450 spin_lock(&inode->i_lock);491451 entry = fsnotify_find_mark_entry(group, inode);492452 spin_unlock(&inode->i_lock);493493- if (entry) {494494- ientry = container_of(entry, struct inotify_inode_mark_entry, fsn_entry);495495- } else {496496- ret = -ENOSPC;497497- if (atomic_read(&group->inotify_data.user->inotify_watches) >= inotify_max_user_watches)498498- goto out_err;499499-retry:500500- ret = -ENOMEM;501501- if (unlikely(!idr_pre_get(&group->inotify_data.idr, GFP_KERNEL)))502502- goto out_err;453453+ if (!entry)454454+ return -ENOENT;503455504504- spin_lock(&group->inotify_data.idr_lock);505505- ret = idr_get_new_above(&group->inotify_data.idr, &tmp_ientry->fsn_entry,506506- group->inotify_data.last_wd,507507- &tmp_ientry->wd);508508- spin_unlock(&group->inotify_data.idr_lock);509509- if (ret) {510510- if (ret == -EAGAIN)511511- goto retry;512512- goto out_err;513513- }514514-515515- ret = fsnotify_add_mark(&tmp_ientry->fsn_entry, group, inode);516516- if (ret) {517517- inotify_remove_from_idr(group, tmp_ientry);518518- if (ret == -EEXIST)519519- goto find_entry;520520- goto out_err;521521- }522522-523523- /* tmp_ientry has been added to the inode, so we are all set up.524524- * now we just need to make sure tmp_ientry doesn't get freed and525525- * we need to set up entry and ientry so the generic code can526526- * do its thing. */527527- ientry = tmp_ientry;528528- entry = &ientry->fsn_entry;529529- tmp_ientry = NULL;530530-531531- atomic_inc(&group->inotify_data.user->inotify_watches);532532-533533- /* update the idr hint */534534- group->inotify_data.last_wd = ientry->wd;535535-536536- /* we put the mark on the idr, take a reference */537537- fsnotify_get_mark(entry);538538- }539539-540540- ret = ientry->wd;456456+ ientry = container_of(entry, struct inotify_inode_mark_entry, fsn_entry);541457542458 spin_lock(&entry->lock);543459···518536 fsnotify_recalc_group_mask(group);519537 }520538521521- /* this either matches fsnotify_find_mark_entry, or init_mark_entry522522- * depending on which path we took... */539539+ /* return the wd */540540+ ret = ientry->wd;541541+542542+ /* match the get from fsnotify_find_mark_entry() */523543 fsnotify_put_mark(entry);524544525525-out_err:526526- /* could be an error, could be that we found an existing mark */527527- if (tmp_ientry) {528528- /* on the idr but didn't make it on the inode */529529- if (tmp_ientry->wd != -1)530530- inotify_remove_from_idr(group, tmp_ientry);531531- kmem_cache_free(inotify_inode_mark_cachep, tmp_ientry);545545+ return ret;546546+}547547+548548+static int inotify_new_watch(struct fsnotify_group *group,549549+ struct inode *inode,550550+ u32 arg)551551+{552552+ struct inotify_inode_mark_entry *tmp_ientry;553553+ __u32 mask;554554+ int ret;555555+556556+ /* don't allow invalid bits: we don't want flags set */557557+ mask = inotify_arg_to_mask(arg);558558+ if (unlikely(!mask))559559+ return -EINVAL;560560+561561+ tmp_ientry = kmem_cache_alloc(inotify_inode_mark_cachep, GFP_KERNEL);562562+ if (unlikely(!tmp_ientry))563563+ return -ENOMEM;564564+565565+ fsnotify_init_mark(&tmp_ientry->fsn_entry, inotify_free_mark);566566+ tmp_ientry->fsn_entry.mask = mask;567567+ tmp_ientry->wd = -1;568568+569569+ ret = -ENOSPC;570570+ if (atomic_read(&group->inotify_data.user->inotify_watches) >= inotify_max_user_watches)571571+ goto out_err;572572+retry:573573+ ret = -ENOMEM;574574+ if (unlikely(!idr_pre_get(&group->inotify_data.idr, GFP_KERNEL)))575575+ goto out_err;576576+577577+ spin_lock(&group->inotify_data.idr_lock);578578+ ret = idr_get_new_above(&group->inotify_data.idr, &tmp_ientry->fsn_entry,579579+ group->inotify_data.last_wd,580580+ &tmp_ientry->wd);581581+ spin_unlock(&group->inotify_data.idr_lock);582582+ if (ret) {583583+ /* idr was out of memory allocate and try again */584584+ if (ret == -EAGAIN)585585+ goto retry;586586+ goto out_err;532587 }588588+589589+ /* we put the mark on the idr, take a reference */590590+ fsnotify_get_mark(&tmp_ientry->fsn_entry);591591+592592+ /* we are on the idr, now get on the inode */593593+ ret = fsnotify_add_mark(&tmp_ientry->fsn_entry, group, inode);594594+ if (ret) {595595+ /* we failed to get on the inode, get off the idr */596596+ inotify_remove_from_idr(group, tmp_ientry);597597+ goto out_err;598598+ }599599+600600+ /* update the idr hint, who cares about races, it's just a hint */601601+ group->inotify_data.last_wd = tmp_ientry->wd;602602+603603+ /* increment the number of watches the user has */604604+ atomic_inc(&group->inotify_data.user->inotify_watches);605605+606606+ /* return the watch descriptor for this new entry */607607+ ret = tmp_ientry->wd;608608+609609+ /* match the ref from fsnotify_init_markentry() */610610+ fsnotify_put_mark(&tmp_ientry->fsn_entry);611611+612612+ /* if this mark added a new event update the group mask */613613+ if (mask & ~group->mask)614614+ fsnotify_recalc_group_mask(group);615615+616616+out_err:617617+ if (ret < 0)618618+ kmem_cache_free(inotify_inode_mark_cachep, tmp_ientry);619619+620620+ return ret;621621+}622622+623623+static int inotify_update_watch(struct fsnotify_group *group, struct inode *inode, u32 arg)624624+{625625+ int ret = 0;626626+627627+retry:628628+ /* try to update and existing watch with the new arg */629629+ ret = inotify_update_existing_watch(group, inode, arg);630630+ /* no mark present, try to add a new one */631631+ if (ret == -ENOENT)632632+ ret = inotify_new_watch(group, inode, arg);633633+ /*634634+ * inotify_new_watch could race with another thread which did an635635+ * inotify_new_watch between the update_existing and the add watch636636+ * here, go back and try to update an existing mark again.637637+ */638638+ if (ret == -EEXIST)639639+ goto retry;533640534641 return ret;535642}
···122122 * that still has AST's pending... */123123 in_use = !list_empty(&lock->ast_list);124124 spin_unlock(&dlm->ast_lock);125125- if (in_use) {125125+ if (in_use && !(flags & LKM_CANCEL)) {126126 mlog(ML_ERROR, "lockres %.*s: Someone is calling dlmunlock "127127 "while waiting for an ast!", res->lockname.len,128128 res->lockname.name);···131131132132 spin_lock(&res->spinlock);133133 if (res->state & DLM_LOCK_RES_IN_PROGRESS) {134134- if (master_node) {134134+ if (master_node && !(flags & LKM_CANCEL)) {135135 mlog(ML_ERROR, "lockres in progress!\n");136136 spin_unlock(&res->spinlock);137137 return DLM_FORWARD;
···9494 const unsigned long *src, int shift, int bits);9595extern void __bitmap_shift_left(unsigned long *dst,9696 const unsigned long *src, int shift, int bits);9797-extern void __bitmap_and(unsigned long *dst, const unsigned long *bitmap1,9797+extern int __bitmap_and(unsigned long *dst, const unsigned long *bitmap1,9898 const unsigned long *bitmap2, int bits);9999extern void __bitmap_or(unsigned long *dst, const unsigned long *bitmap1,100100 const unsigned long *bitmap2, int bits);101101extern void __bitmap_xor(unsigned long *dst, const unsigned long *bitmap1,102102 const unsigned long *bitmap2, int bits);103103-extern void __bitmap_andnot(unsigned long *dst, const unsigned long *bitmap1,103103+extern int __bitmap_andnot(unsigned long *dst, const unsigned long *bitmap1,104104 const unsigned long *bitmap2, int bits);105105extern int __bitmap_intersects(const unsigned long *bitmap1,106106 const unsigned long *bitmap2, int bits);···171171 }172172}173173174174-static inline void bitmap_and(unsigned long *dst, const unsigned long *src1,174174+static inline int bitmap_and(unsigned long *dst, const unsigned long *src1,175175 const unsigned long *src2, int nbits)176176{177177 if (small_const_nbits(nbits))178178- *dst = *src1 & *src2;179179- else180180- __bitmap_and(dst, src1, src2, nbits);178178+ return (*dst = *src1 & *src2) != 0;179179+ return __bitmap_and(dst, src1, src2, nbits);181180}182181183182static inline void bitmap_or(unsigned long *dst, const unsigned long *src1,···197198 __bitmap_xor(dst, src1, src2, nbits);198199}199200200200-static inline void bitmap_andnot(unsigned long *dst, const unsigned long *src1,201201+static inline int bitmap_andnot(unsigned long *dst, const unsigned long *src1,201202 const unsigned long *src2, int nbits)202203{203204 if (small_const_nbits(nbits))204204- *dst = *src1 & ~(*src2);205205- else206206- __bitmap_andnot(dst, src1, src2, nbits);205205+ return (*dst = *src1 & ~(*src2)) != 0;206206+ return __bitmap_andnot(dst, src1, src2, nbits);207207}208208209209static inline void bitmap_complement(unsigned long *dst, const unsigned long *src,
+10-10
include/linux/cpumask.h
···4343 * int cpu_isset(cpu, mask) true iff bit 'cpu' set in mask4444 * int cpu_test_and_set(cpu, mask) test and set bit 'cpu' in mask4545 *4646- * void cpus_and(dst, src1, src2) dst = src1 & src2 [intersection]4646+ * int cpus_and(dst, src1, src2) dst = src1 & src2 [intersection]4747 * void cpus_or(dst, src1, src2) dst = src1 | src2 [union]4848 * void cpus_xor(dst, src1, src2) dst = src1 ^ src24949- * void cpus_andnot(dst, src1, src2) dst = src1 & ~src24949+ * int cpus_andnot(dst, src1, src2) dst = src1 & ~src25050 * void cpus_complement(dst, src) dst = ~src5151 *5252 * int cpus_equal(mask1, mask2) Does mask1 == mask2?···179179}180180181181#define cpus_and(dst, src1, src2) __cpus_and(&(dst), &(src1), &(src2), NR_CPUS)182182-static inline void __cpus_and(cpumask_t *dstp, const cpumask_t *src1p,182182+static inline int __cpus_and(cpumask_t *dstp, const cpumask_t *src1p,183183 const cpumask_t *src2p, int nbits)184184{185185- bitmap_and(dstp->bits, src1p->bits, src2p->bits, nbits);185185+ return bitmap_and(dstp->bits, src1p->bits, src2p->bits, nbits);186186}187187188188#define cpus_or(dst, src1, src2) __cpus_or(&(dst), &(src1), &(src2), NR_CPUS)···201201202202#define cpus_andnot(dst, src1, src2) \203203 __cpus_andnot(&(dst), &(src1), &(src2), NR_CPUS)204204-static inline void __cpus_andnot(cpumask_t *dstp, const cpumask_t *src1p,204204+static inline int __cpus_andnot(cpumask_t *dstp, const cpumask_t *src1p,205205 const cpumask_t *src2p, int nbits)206206{207207- bitmap_andnot(dstp->bits, src1p->bits, src2p->bits, nbits);207207+ return bitmap_andnot(dstp->bits, src1p->bits, src2p->bits, nbits);208208}209209210210#define cpus_complement(dst, src) __cpus_complement(&(dst), &(src), NR_CPUS)···738738 * @src1p: the first input739739 * @src2p: the second input740740 */741741-static inline void cpumask_and(struct cpumask *dstp,741741+static inline int cpumask_and(struct cpumask *dstp,742742 const struct cpumask *src1p,743743 const struct cpumask *src2p)744744{745745- bitmap_and(cpumask_bits(dstp), cpumask_bits(src1p),745745+ return bitmap_and(cpumask_bits(dstp), cpumask_bits(src1p),746746 cpumask_bits(src2p), nr_cpumask_bits);747747}748748···779779 * @src1p: the first input780780 * @src2p: the second input781781 */782782-static inline void cpumask_andnot(struct cpumask *dstp,782782+static inline int cpumask_andnot(struct cpumask *dstp,783783 const struct cpumask *src1p,784784 const struct cpumask *src2p)785785{786786- bitmap_andnot(cpumask_bits(dstp), cpumask_bits(src1p),786786+ return bitmap_andnot(cpumask_bits(dstp), cpumask_bits(src1p),787787 cpumask_bits(src2p), nr_cpumask_bits);788788}789789
+7-5
include/linux/flex_array.h
···2121 struct {2222 int element_size;2323 int total_nr_elements;2424- struct flex_array_part *parts[0];2424+ struct flex_array_part *parts[];2525 };2626 /*2727 * This little trick makes sure that···3636 .total_nr_elements = (total), \3737} } }38383939-struct flex_array *flex_array_alloc(int element_size, int total, gfp_t flags);4040-int flex_array_prealloc(struct flex_array *fa, int start, int end, gfp_t flags);3939+struct flex_array *flex_array_alloc(int element_size, unsigned int total,4040+ gfp_t flags);4141+int flex_array_prealloc(struct flex_array *fa, unsigned int start,4242+ unsigned int end, gfp_t flags);4143void flex_array_free(struct flex_array *fa);4244void flex_array_free_parts(struct flex_array *fa);4343-int flex_array_put(struct flex_array *fa, int element_nr, void *src,4545+int flex_array_put(struct flex_array *fa, unsigned int element_nr, void *src,4446 gfp_t flags);4545-void *flex_array_get(struct flex_array *fa, int element_nr);4747+void *flex_array_get(struct flex_array *fa, unsigned int element_nr);46484749#endif /* _FLEX_ARRAY_H */
+1-1
include/linux/fs.h
···21232123 int open_flag, int mode, int acc_mode);21242124extern int may_open(struct path *, int, int);2125212521262126-extern int kernel_read(struct file *, unsigned long, char *, unsigned long);21262126+extern int kernel_read(struct file *, loff_t, char *, unsigned long);21272127extern struct file * open_exec(const char *);2128212821292129/* fs/dcache.c -- generic fs support functions */
···174174 shm_unlock(shp);175175 if (!is_file_hugepages(shp->shm_file))176176 shmem_lock(shp->shm_file, 0, shp->mlock_user);177177- else177177+ else if (shp->mlock_user)178178 user_shm_unlock(shp->shm_file->f_path.dentry->d_inode->i_size,179179 shp->mlock_user);180180 fput (shp->shm_file);···369369 /* hugetlb_file_setup applies strict accounting */370370 if (shmflg & SHM_NORESERVE)371371 acctflag = VM_NORESERVE;372372- file = hugetlb_file_setup(name, size, acctflag);373373- shp->mlock_user = current_user();372372+ file = hugetlb_file_setup(name, size, acctflag,373373+ &shp->mlock_user);374374 } else {375375 /*376376 * Do not allow no accounting for OVERCOMMIT_NEVER, even···410410 return error;411411412412no_id:413413+ if (shp->mlock_user) /* shmflg & SHM_HUGETLB case */414414+ user_shm_unlock(size, shp->mlock_user);413415 fput(file);414416no_file:415417 security_shm_free(shp);
+5-15
kernel/fork.c
···815815{816816 struct signal_struct *sig;817817818818- if (clone_flags & CLONE_THREAD) {819819- atomic_inc(¤t->signal->count);820820- atomic_inc(¤t->signal->live);818818+ if (clone_flags & CLONE_THREAD)821819 return 0;822822- }823820824821 sig = kmem_cache_alloc(signal_cachep, GFP_KERNEL);825822 tsk->signal = sig;···872875 thread_group_cputime_free(sig);873876 tty_kref_put(sig->tty);874877 kmem_cache_free(signal_cachep, sig);875875-}876876-877877-static void cleanup_signal(struct task_struct *tsk)878878-{879879- struct signal_struct *sig = tsk->signal;880880-881881- atomic_dec(&sig->live);882882-883883- if (atomic_dec_and_test(&sig->count))884884- __cleanup_signal(sig);885878}886879887880static void copy_flags(unsigned long clone_flags, struct task_struct *p)···12261239 }1227124012281241 if (clone_flags & CLONE_THREAD) {12421242+ atomic_inc(¤t->signal->count);12431243+ atomic_inc(¤t->signal->live);12291244 p->group_leader = current->group_leader;12301245 list_add_tail_rcu(&p->thread_group, &p->group_leader->thread_group);12311246 }···12711282 if (p->mm)12721283 mmput(p->mm);12731284bad_fork_cleanup_signal:12741274- cleanup_signal(p);12851285+ if (!(clone_flags & CLONE_THREAD))12861286+ __cleanup_signal(p->signal);12751287bad_fork_cleanup_sighand:12761288 __cleanup_sighand(p->sighand);12771289bad_fork_cleanup_fs:
+8-2
kernel/module.c
···909909}910910EXPORT_SYMBOL(__symbol_put);911911912912+/* Note this assumes addr is a function, which it currently always is. */912913void symbol_put_addr(void *addr)913914{914915 struct module *modaddr;916916+ unsigned long a = (unsigned long)dereference_function_descriptor(addr);915917916916- if (core_kernel_text((unsigned long)addr))918918+ if (core_kernel_text(a))917919 return;918920919921 /* module_text_address is safe here: we're supposed to have reference920922 * to module from symbol_get, so it can't go away. */921921- modaddr = __module_text_address((unsigned long)addr);923923+ modaddr = __module_text_address(a);922924 BUG_ON(!modaddr);923925 module_put(modaddr);924926}···12731271 unsigned int notes, loaded, i;12741272 struct module_notes_attrs *notes_attrs;12751273 struct bin_attribute *nattr;12741274+12751275+ /* failed to create section attributes, so can't create notes */12761276+ if (!mod->sect_attrs)12771277+ return;1276127812771279 /* Count notes sections and allocate structures. */12781280 notes = 0;
···205205 * Powerstate information: The system enters/leaves a state, where206206 * affected devices might stop207207 */208208-static void tick_do_broadcast_on_off(void *why)208208+static void tick_do_broadcast_on_off(unsigned long *reason)209209{210210 struct clock_event_device *bc, *dev;211211 struct tick_device *td;212212- unsigned long flags, *reason = why;212212+ unsigned long flags;213213 int cpu, bc_stopped;214214215215 spin_lock_irqsave(&tick_broadcast_lock, flags);···276276 printk(KERN_ERR "tick-broadcast: ignoring broadcast for "277277 "offline CPU #%d\n", *oncpu);278278 else279279- smp_call_function_single(*oncpu, tick_do_broadcast_on_off,280280- &reason, 1);279279+ tick_do_broadcast_on_off(&reason);281280}282281283282/*
+1-1
kernel/time/timer_list.c
···286286{287287 struct proc_dir_entry *pe;288288289289- pe = proc_create("timer_list", 0644, NULL, &timer_list_fops);289289+ pe = proc_create("timer_list", 0444, NULL, &timer_list_fops);290290 if (!pe)291291 return -ENOMEM;292292 return 0;
+11-6
kernel/trace/ftrace.c
···22782278 read++;22792279 cnt--;2280228022812281- if (!(iter->flags & ~FTRACE_ITER_CONT)) {22812281+ /*22822282+ * If the parser haven't finished with the last write,22832283+ * continue reading the user input without skipping spaces.22842284+ */22852285+ if (!(iter->flags & FTRACE_ITER_CONT)) {22822286 /* skip white space */22832287 while (cnt && isspace(ch)) {22842288 ret = get_user(ch, ubuf++);···22922288 cnt--;22932289 }2294229022912291+ /* only spaces were written */22952292 if (isspace(ch)) {22962296- file->f_pos += read;22932293+ *ppos += read;22972294 ret = read;22982295 goto out;22992296 }···23242319 if (ret)23252320 goto out;23262321 iter->buffer_idx = 0;23272327- } else23222322+ } else {23282323 iter->flags |= FTRACE_ITER_CONT;23242324+ iter->buffer[iter->buffer_idx++] = ch;23252325+ }2329232623302330-23312331- file->f_pos += read;23322332-23272327+ *ppos += read;23332328 ret = read;23342329 out:23352330 mutex_unlock(&ftrace_regex_lock);
···179179}180180EXPORT_SYMBOL(__bitmap_shift_left);181181182182-void __bitmap_and(unsigned long *dst, const unsigned long *bitmap1,182182+int __bitmap_and(unsigned long *dst, const unsigned long *bitmap1,183183 const unsigned long *bitmap2, int bits)184184{185185 int k;186186 int nr = BITS_TO_LONGS(bits);187187+ unsigned long result = 0;187188188189 for (k = 0; k < nr; k++)189189- dst[k] = bitmap1[k] & bitmap2[k];190190+ result |= (dst[k] = bitmap1[k] & bitmap2[k]);191191+ return result != 0;190192}191193EXPORT_SYMBOL(__bitmap_and);192194···214212}215213EXPORT_SYMBOL(__bitmap_xor);216214217217-void __bitmap_andnot(unsigned long *dst, const unsigned long *bitmap1,215215+int __bitmap_andnot(unsigned long *dst, const unsigned long *bitmap1,218216 const unsigned long *bitmap2, int bits)219217{220218 int k;221219 int nr = BITS_TO_LONGS(bits);220220+ unsigned long result = 0;222221223222 for (k = 0; k < nr; k++)224224- dst[k] = bitmap1[k] & ~bitmap2[k];223223+ result |= (dst[k] = bitmap1[k] & ~bitmap2[k]);224224+ return result != 0;225225}226226EXPORT_SYMBOL(__bitmap_andnot);227227
+16-12
lib/dma-debug.c
···156156 return true;157157158158 /* driver filter on and initialized */159159- if (current_driver && dev->driver == current_driver)159159+ if (current_driver && dev && dev->driver == current_driver)160160 return true;161161+162162+ /* driver filter on, but we can't filter on a NULL device... */163163+ if (!dev)164164+ return false;161165162166 if (current_driver || !current_driver_name[0])163167 return false;···187183 return ret;188184}189185190190-#define err_printk(dev, entry, format, arg...) do { \191191- error_count += 1; \192192- if (driver_filter(dev) && \193193- (show_all_errors || show_num_errors > 0)) { \194194- WARN(1, "%s %s: " format, \195195- dev_driver_string(dev), \196196- dev_name(dev) , ## arg); \197197- dump_entry_trace(entry); \198198- } \199199- if (!show_all_errors && show_num_errors > 0) \200200- show_num_errors -= 1; \186186+#define err_printk(dev, entry, format, arg...) do { \187187+ error_count += 1; \188188+ if (driver_filter(dev) && \189189+ (show_all_errors || show_num_errors > 0)) { \190190+ WARN(1, "%s %s: " format, \191191+ dev ? dev_driver_string(dev) : "NULL", \192192+ dev ? dev_name(dev) : "NULL", ## arg); \193193+ dump_entry_trace(entry); \194194+ } \195195+ if (!show_all_errors && show_num_errors > 0) \196196+ show_num_errors -= 1; \201197 } while (0);202198203199/*
+21-20
lib/flex_array.c
···9999 * capacity in the base structure. Also note that no effort is made100100 * to efficiently pack objects across page boundaries.101101 */102102-struct flex_array *flex_array_alloc(int element_size, int total, gfp_t flags)102102+struct flex_array *flex_array_alloc(int element_size, unsigned int total,103103+ gfp_t flags)103104{104105 struct flex_array *ret;105106 int max_size = nr_base_part_ptrs() * __elements_per_part(element_size);···116115 return ret;117116}118117119119-static int fa_element_to_part_nr(struct flex_array *fa, int element_nr)118118+static int fa_element_to_part_nr(struct flex_array *fa,119119+ unsigned int element_nr)120120{121121 return element_nr / __elements_per_part(fa->element_size);122122}123123124124/**125125 * flex_array_free_parts - just free the second-level pages126126- * @src: address of data to copy into the array127127- * @element_nr: index of the position in which to insert128128- * the new element.129126 *130127 * This is to be used in cases where the base 'struct flex_array'131128 * has been statically allocated and should not be free.···145146 kfree(fa);146147}147148148148-static int fa_index_inside_part(struct flex_array *fa, int element_nr)149149+static unsigned int index_inside_part(struct flex_array *fa,150150+ unsigned int element_nr)149151{150150- return element_nr % __elements_per_part(fa->element_size);151151-}152152+ unsigned int part_offset;152153153153-static int index_inside_part(struct flex_array *fa, int element_nr)154154-{155155- int part_offset = fa_index_inside_part(fa, element_nr);154154+ part_offset = element_nr % __elements_per_part(fa->element_size);156155 return part_offset * fa->element_size;157156}158157···185188 *186189 * Locking must be provided by the caller.187190 */188188-int flex_array_put(struct flex_array *fa, int element_nr, void *src, gfp_t flags)191191+int flex_array_put(struct flex_array *fa, unsigned int element_nr, void *src,192192+ gfp_t flags)189193{190194 int part_nr = fa_element_to_part_nr(fa, element_nr);191195 struct flex_array_part *part;···196198 return -ENOSPC;197199 if (elements_fit_in_base(fa))198200 part = (struct flex_array_part *)&fa->parts[0];199199- else201201+ else {200202 part = __fa_get_part(fa, part_nr, flags);201201- if (!part)202202- return -ENOMEM;203203+ if (!part)204204+ return -ENOMEM;205205+ }203206 dst = &part->elements[index_inside_part(fa, element_nr)];204207 memcpy(dst, src, fa->element_size);205208 return 0;···218219 *219220 * Locking must be provided by the caller.220221 */221221-int flex_array_prealloc(struct flex_array *fa, int start, int end, gfp_t flags)222222+int flex_array_prealloc(struct flex_array *fa, unsigned int start,223223+ unsigned int end, gfp_t flags)222224{223225 int start_part;224226 int end_part;···250250 *251251 * Locking must be provided by the caller.252252 */253253-void *flex_array_get(struct flex_array *fa, int element_nr)253253+void *flex_array_get(struct flex_array *fa, unsigned int element_nr)254254{255255 int part_nr = fa_element_to_part_nr(fa, element_nr);256256 struct flex_array_part *part;257257258258 if (element_nr >= fa->total_nr_elements)259259 return NULL;260260- if (!fa->parts[part_nr])261261- return NULL;262260 if (elements_fit_in_base(fa))263261 part = (struct flex_array_part *)&fa->parts[0];264264- else262262+ else {265263 part = fa->parts[part_nr];264264+ if (!part)265265+ return NULL;266266+ }266267 return &part->elements[index_inside_part(fa, element_nr)];267268}
···358358 */359359 if (vma->vm_flags & VM_LOCKED) {360360 *mapcount = 1; /* break early from loop */361361+ *vm_flags |= VM_LOCKED;361362 goto out_unmap;362363 }363364
+7-2
mm/vmscan.c
···630630631631 referenced = page_referenced(page, 1,632632 sc->mem_cgroup, &vm_flags);633633- /* In active use or really unfreeable? Activate it. */633633+ /*634634+ * In active use or really unfreeable? Activate it.635635+ * If page which have PG_mlocked lost isoltation race,636636+ * try_to_unmap moves it to unevictable list637637+ */634638 if (sc->order <= PAGE_ALLOC_COSTLY_ORDER &&635635- referenced && page_mapping_inuse(page))639639+ referenced && page_mapping_inuse(page)640640+ && !(vm_flags & VM_LOCKED))636641 goto activate_locked;637642638643 /*
+8-13
net/9p/client.c
···6060p9_client_rpc(struct p9_client *c, int8_t type, const char *fmt, ...);61616262/**6363- * v9fs_parse_options - parse mount options into session structure6464- * @options: options string passed from mount6565- * @v9ses: existing v9fs session information6363+ * parse_options - parse mount options into client structure6464+ * @opts: options string passed from mount6565+ * @clnt: existing v9fs client information6666 *6767 * Return 0 upon success, -ERRNO upon failure6868 */···232232233233/**234234 * p9_tag_init - setup tags structure and contents235235- * @tags: tags structure from the client struct235235+ * @c: v9fs client struct236236 *237237 * This initializes the tags structure for each client instance.238238 *···258258259259/**260260 * p9_tag_cleanup - cleans up tags structure and reclaims resources261261- * @tags: tags structure from the client struct261261+ * @c: v9fs client struct262262 *263263 * This frees resources associated with the tags structure264264 *···411411 if (c->dotu)412412 err = -ecode;413413414414- if (!err) {414414+ if (!err || !IS_ERR_VALUE(err))415415 err = p9_errstr2errno(ename, strlen(ename));416416-417417- /* string match failed */418418- if (!err)419419- err = -ESERVERFAULT;420420- }421416422417 P9_DPRINTK(P9_DEBUG_9P, "<<< RERROR (%d) %s\n", -ecode, ename);423418···425430426431/**427432 * p9_client_flush - flush (cancel) a request428428- * c: client state429429- * req: request to cancel433433+ * @c: client state434434+ * @oldreq: request to cancel430435 *431436 * This sents a flush for a particular requests and links432437 * the flush request to the original request. The current
···119119 * @wpos: write position for current frame120120 * @wsize: amount of data to write for current frame121121 * @wbuf: current write buffer122122+ * @poll_pending_link: pending links to be polled per conn122123 * @poll_wait: array of wait_q's for various worker threads123123- * @poll_waddr: ????124124 * @pt: poll state125125 * @rq: current read work126126 * @wq: current write work···700700}701701702702/**703703- * parse_options - parse mount options into session structure704704- * @options: options string passed from mount705705- * @opts: transport-specific structure to parse options into703703+ * parse_opts - parse mount options into p9_fd_opts structure704704+ * @params: options string passed from mount705705+ * @opts: fd transport-specific structure to parse options into706706 *707707 * Returns 0 upon success, -ERRNO upon failure708708 */
+5-4
net/9p/trans_rdma.c
···6767 * @pd: Protection Domain pointer6868 * @qp: Queue Pair pointer6969 * @cq: Completion Queue pointer7070+ * @dm_mr: DMA Memory Region pointer7071 * @lkey: The local access only memory region key7172 * @timeout: Number of uSecs to wait for connection management events7273 * @sq_depth: The depth of the Send Queue7374 * @sq_sem: Semaphore for the SQ7475 * @rq_depth: The depth of the Receive Queue.7676+ * @rq_count: Count of requests in the Receive Queue.7577 * @addr: The remote peer's address7678 * @req_lock: Protects the active request list7777- * @send_wait: Wait list when the SQ fills up7879 * @cm_done: Completion event for connection management tracking7980 */8081struct p9_trans_rdma {···155154};156155157156/**158158- * parse_options - parse mount options into session structure159159- * @options: options string passed from mount160160- * @opts: transport-specific structure to parse options into157157+ * parse_opts - parse mount options into rdma options structure158158+ * @params: options string passed from mount159159+ * @opts: rdma transport-specific structure to parse options into161160 *162161 * Returns 0 upon success, -ERRNO upon failure163162 */
+4-7
net/9p/trans_virtio.c
···5757 * @initialized: whether the channel is initialized5858 * @inuse: whether the channel is in use5959 * @lock: protects multiple elements within this structure6060+ * @client: client instance6061 * @vdev: virtio dev associated with this channel6162 * @vq: virtio queue associated with this channel6262- * @tagpool: accounting for tag ids (and request slots)6363- * @reqs: array of request slots6464- * @max_tag: current number of request_slots allocated6563 * @sg: scatter gather list which is used to pack a request (protected?)6664 *6765 * We keep all per-channel information in a structure.···90929193/**9294 * p9_virtio_close - reclaim resources of a channel9393- * @trans: transport state9595+ * @client: client instance9496 *9597 * This reclaims a channel by freeing its resources and9698 * reseting its inuse flag.···179181180182/**181183 * p9_virtio_request - issue a request182182- * @t: transport state183183- * @tc: &p9_fcall request to transmit184184- * @rc: &p9_fcall to put reponse into184184+ * @client: client instance issuing the request185185+ * @req: request to be issued185186 *186187 */187188
···813813 inet->cork.addr = ipc->addr;814814 }815815 rt = *rtp;816816+ if (unlikely(!rt))817817+ return -EFAULT;816818 /*817819 * We steal reference to this route, caller should not release it818820 */