···4848 sigset_t mask;4949 unsigned long res;50505151- siginitset(&mask, newmask & ~_BLOCKABLE);5151+ siginitset(&mask, newmask & _BLOCKABLE);5252 res = sigprocmask(how, &mask, &oldmask);5353 if (!res) {5454 force_successful_syscall_return();
+5-2
arch/arm/oprofile/common.c
···102102 if (IS_ERR(pevent)) {103103 ret = PTR_ERR(pevent);104104 } else if (pevent->state != PERF_EVENT_STATE_ACTIVE) {105105+ perf_event_release_kernel(pevent);105106 pr_warning("oprofile: failed to enable event %d "106107 "on CPU %d\n", event, cpu);107108 ret = -EBUSY;···366365 ret = init_driverfs();367366 if (ret) {368367 kfree(counter_config);368368+ counter_config = NULL;369369 return ret;370370 }371371···404402 struct perf_event *event;405403406404 if (*perf_events) {407407- exit_driverfs();408405 for_each_possible_cpu(cpu) {409406 for (id = 0; id < perf_num_counters; ++id) {410407 event = perf_events[cpu][id];···414413 }415414 }416415417417- if (counter_config)416416+ if (counter_config) {418417 kfree(counter_config);418418+ exit_driverfs();419419+ }419420}420421#else421422int __init oprofile_arch_init(struct oprofile_operations *ops)
+1-1
arch/arm/plat-omap/Kconfig
···3333config OMAP_DEBUG_LEDS3434 bool3535 depends on OMAP_DEBUG_DEVICES3636- default y if LEDS3636+ default y if LEDS_CLASS37373838config OMAP_RESET_CLOCKS3939 bool "Reset unused clocks during boot"
+1-1
arch/arm/plat-omap/mcbsp.c
···156156 /* Writing zero to RSYNC_ERR clears the IRQ */157157 MCBSP_WRITE(mcbsp_rx, SPCR1, MCBSP_READ_CACHE(mcbsp_rx, SPCR1));158158 } else {159159- complete(&mcbsp_rx->tx_irq_completion);159159+ complete(&mcbsp_rx->rx_irq_completion);160160 }161161162162 return IRQ_HANDLED;
···162162void mac_mksound( unsigned int freq, unsigned int length )163163{164164 __u32 cfreq = ( freq << 5 ) / 468;165165- __u32 flags;165165+ unsigned long flags;166166 int i;167167168168 if ( mac_special_bell == NULL )···224224 */225225static void mac_quadra_start_bell( unsigned int freq, unsigned int length, unsigned int volume )226226{227227- __u32 flags;227227+ unsigned long flags;228228229229 /* if the bell is already ringing, ring longer */230230 if ( mac_bell_duration > 0 )···271271static void mac_quadra_ring_bell( unsigned long ignored )272272{273273 int i, count = mac_asc_samplespersec / HZ;274274- __u32 flags;274274+ unsigned long flags;275275276276 /*277277 * we neither want a sound buffer overflow nor underflow, so we need to match
+19-2
arch/mips/Kconfig
···1313 select HAVE_KPROBES1414 select HAVE_KRETPROBES1515 select RTC_LIB if !MACH_LOONGSON1616+ select GENERIC_ATOMIC64 if !64BIT16171718mainmenu "Linux/MIPS Kernel Configuration"1819···16471646 select SYS_SUPPORTS_SMP16481647 select SMP_UP16491648 help16501650- This is a kernel model which is also known a VSMP or lately16511651- has been marketesed into SMVP.16491649+ This is a kernel model which is known a VSMP but lately has been16501650+ marketesed into SMVP.16511651+ Virtual SMP uses the processor's VPEs to implement virtual16521652+ processors. In currently available configuration of the 34K processor16531653+ this allows for a dual processor. Both processors will share the same16541654+ primary caches; each will obtain the half of the TLB for it's own16551655+ exclusive use. For a layman this model can be described as similar to16561656+ what Intel calls Hyperthreading.16571657+16581658+ For further information see http://www.linux-mips.org/wiki/34K#VSMP1652165916531660config MIPS_MT_SMTC16541661 bool "SMTC: Use all TCs on all VPEs for SMP"···16731664 help16741665 This is a kernel model which is known a SMTC or lately has been16751666 marketesed into SMVP.16671667+ is presenting the available TC's of the core as processors to Linux.16681668+ On currently available 34K processors this means a Linux system will16691669+ see up to 5 processors. The implementation of the SMTC kernel differs16701670+ significantly from VSMP and cannot efficiently coexist in the same16711671+ kernel binary so the choice between VSMP and SMTC is a compile time16721672+ decision.16731673+16741674+ For further information see http://www.linux-mips.org/wiki/34K#SMTC1676167516771676endchoice16781677
···321321 */322322struct gic_intr_map {323323 unsigned int cpunum; /* Directed to this CPU */324324+#define GIC_UNUSED 0xdead /* Dummy data */324325 unsigned int pin; /* Directed to this Pin */325326 unsigned int polarity; /* Polarity : +/- */326327 unsigned int trigtype; /* Trigger : Edge/Levl */
···88888989#define GIC_EXT_INTR(x) x90909191-/* Dummy data */9292-#define X 0xdead9393-9491/* External Interrupts used for IPI */9592#define GIC_IPI_EXT_INTR_RESCHED_VPE0 169693#define GIC_IPI_EXT_INTR_CALLFNC_VPE0 17
+14
arch/mips/include/asm/page.h
···150150 ((unsigned long)(x) - PAGE_OFFSET + PHYS_OFFSET)151151#endif152152#define __va(x) ((void *)((unsigned long)(x) + PAGE_OFFSET - PHYS_OFFSET))153153+154154+/*155155+ * RELOC_HIDE was originally added by 6007b903dfe5f1d13e0c711ac2894bdd4a61b1ad156156+ * (lmo) rsp. 8431fd094d625b94d364fe393076ccef88e6ce18 (kernel.org). The157157+ * discussion can be found in lkml posting158158+ * <a2ebde260608230500o3407b108hc03debb9da6e62c@mail.gmail.com> which is159159+ * archived at http://lists.linuxcoding.com/kernel/2006-q3/msg17360.html160160+ *161161+ * It is unclear if the misscompilations mentioned in162162+ * http://lkml.org/lkml/2010/8/8/138 also affect MIPS so we keep this one163163+ * until GCC 3.x has been retired before we can apply164164+ * https://patchwork.linux-mips.org/patch/1541/165165+ */166166+153167#define __pa_symbol(x) __pa(RELOC_HIDE((unsigned long)(x), 0))154168155169#define pfn_to_kaddr(pfn) __va((pfn) << PAGE_SHIFT)
+2-1
arch/mips/include/asm/thread_info.h
···146146#define _TIF_LOAD_WATCH (1<<TIF_LOAD_WATCH)147147148148/* work to do on interrupt/exception return */149149-#define _TIF_WORK_MASK (0x0000ffef & ~_TIF_SECCOMP)149149+#define _TIF_WORK_MASK (0x0000ffef & \150150+ ~(_TIF_SECCOMP | _TIF_SYSCALL_AUDIT))150151/* work to do on any return to u-space */151152#define _TIF_ALLWORK_MASK (0x8000ffff & ~_TIF_SECCOMP)152153
···3030#define tc_lsize 3231313232extern unsigned long icache_way_size, dcache_way_size;3333-unsigned long tcache_size;3333+static unsigned long tcache_size;34343535#include <asm/r4kcache.h>3636
+3
arch/mips/mti-malta/malta-int.c
···385385 */386386387387#define GIC_CPU_NMI GIC_MAP_TO_NMI_MSK388388+#define X GIC_UNUSED389389+388390static struct gic_intr_map gic_intr_map[GIC_NUM_INTRS] = {389391 { X, X, X, X, 0 },390392 { X, X, X, X, 0 },···406404 { X, X, X, X, 0 },407405 /* The remainder of this table is initialised by fill_ipi_map */408406};407407+#undef X409408410409/*411410 * GCMP needs to be detected before any SMP initialisation
···5454void flush_icache_range(unsigned long start, unsigned long end)5555{5656#ifdef CONFIG_MN10300_CACHE_WBACK5757- unsigned long addr, size, off;5757+ unsigned long addr, size, base, off;5858 struct page *page;5959 pgd_t *pgd;6060 pud_t *pud;6161 pmd_t *pmd;6262 pte_t *ppte, pte;6363+6464+ if (end > 0x80000000UL) {6565+ /* addresses above 0xa0000000 do not go through the cache */6666+ if (end > 0xa0000000UL) {6767+ end = 0xa0000000UL;6868+ if (start >= end)6969+ return;7070+ }7171+7272+ /* kernel addresses between 0x80000000 and 0x9fffffff do not7373+ * require page tables, so we just map such addresses directly */7474+ base = (start >= 0x80000000UL) ? start : 0x80000000UL;7575+ mn10300_dcache_flush_range(base, end);7676+ if (base == start)7777+ goto invalidate;7878+ end = base;7979+ }63806481 for (; start < end; start += size) {6582 /* work out how much of the page to flush */···121104 }122105#endif123106107107+invalidate:124108 mn10300_icache_inv();125109}126110EXPORT_SYMBOL(flush_icache_range);
···149149 int ret = 0;150150151151 ret |= module_dwarf_finalize(hdr, sechdrs, me);152152- ret |= module_bug_finalize(hdr, sechdrs, me);153152154153 return ret;155154}156155157156void module_arch_cleanup(struct module *mod)158157{159159- module_bug_cleanup(mod);160158 module_dwarf_cleanup(mod);161159}
+3-14
arch/um/drivers/net_kern.c
···255255 netif_wake_queue(dev);256256}257257258258-static int uml_net_set_mac(struct net_device *dev, void *addr)259259-{260260- struct uml_net_private *lp = netdev_priv(dev);261261- struct sockaddr *hwaddr = addr;262262-263263- spin_lock_irq(&lp->lock);264264- eth_mac_addr(dev, hwaddr->sa_data);265265- spin_unlock_irq(&lp->lock);266266-267267- return 0;268268-}269269-270258static int uml_net_change_mtu(struct net_device *dev, int new_mtu)271259{272260 dev->mtu = new_mtu;···361373 .ndo_start_xmit = uml_net_start_xmit,362374 .ndo_set_multicast_list = uml_net_set_multicast_list,363375 .ndo_tx_timeout = uml_net_tx_timeout,364364- .ndo_set_mac_address = uml_net_set_mac,376376+ .ndo_set_mac_address = eth_mac_addr,365377 .ndo_change_mtu = uml_net_change_mtu,366378 .ndo_validate_addr = eth_validate_addr,367379};···460472 ((*transport->user->init)(&lp->user, dev) != 0))461473 goto out_unregister;462474463463- eth_mac_addr(dev, device->mac);475475+ /* don't use eth_mac_addr, it will not work here */476476+ memcpy(dev->dev_addr, device->mac, ETH_ALEN);464477 dev->mtu = transport->user->mtu;465478 dev->netdev_ops = ¨_netdev_ops;466479 dev->ethtool_ops = ¨_net_ethtool_ops;
+1-1
arch/x86/kernel/acpi/cstate.c
···6161 unsigned int ecx;6262 } states[ACPI_PROCESSOR_MAX_POWER];6363};6464-static struct cstate_entry *cpu_cstate_entry; /* per CPU ptr */6464+static struct cstate_entry __percpu *cpu_cstate_entry; /* per CPU ptr */65656666static short mwait_supported[ACPI_PROCESSOR_MAX_POWER];6767
···489489__init void xen_hvm_init_time_ops(void)490490{491491 /* vector callback is needed otherwise we cannot receive interrupts492492- * on cpu > 0 */493493- if (!xen_have_vector_callback && num_present_cpus() > 1)492492+ * on cpu > 0 and at this point we don't know how many cpus are493493+ * available */494494+ if (!xen_have_vector_callback)494495 return;495496 if (!xen_feature(XENFEAT_hvm_safe_pvclock)) {496497 printk(KERN_INFO "Xen doesn't support pvclock on HVM,"
+1-1
drivers/acpi/Kconfig
···105105106106 Be aware that using this interface can confuse your Embedded107107 Controller in a way that a normal reboot is not enough. You then108108- have to power of your system, and remove the laptop battery for108108+ have to power off your system, and remove the laptop battery for109109 some seconds.110110 An Embedded Controller typically is available on laptops and reads111111 sensor values like battery state and temperature.
+18-16
drivers/acpi/acpi_pad.c
···382382 device_remove_file(&device->dev, &dev_attr_rrtime);383383}384384385385-/* Query firmware how many CPUs should be idle */386386-static int acpi_pad_pur(acpi_handle handle, int *num_cpus)385385+/*386386+ * Query firmware how many CPUs should be idle387387+ * return -1 on failure388388+ */389389+static int acpi_pad_pur(acpi_handle handle)387390{388391 struct acpi_buffer buffer = {ACPI_ALLOCATE_BUFFER, NULL};389392 union acpi_object *package;390390- int rev, num, ret = -EINVAL;393393+ int num = -1;391394392395 if (ACPI_FAILURE(acpi_evaluate_object(handle, "_PUR", NULL, &buffer)))393393- return -EINVAL;396396+ return num;394397395398 if (!buffer.length || !buffer.pointer)396396- return -EINVAL;399399+ return num;397400398401 package = buffer.pointer;399399- if (package->type != ACPI_TYPE_PACKAGE || package->package.count != 2)400400- goto out;401401- rev = package->package.elements[0].integer.value;402402- num = package->package.elements[1].integer.value;403403- if (rev != 1 || num < 0)404404- goto out;405405- *num_cpus = num;406406- ret = 0;407407-out:402402+403403+ if (package->type == ACPI_TYPE_PACKAGE &&404404+ package->package.count == 2 &&405405+ package->package.elements[0].integer.value == 1) /* rev 1 */406406+407407+ num = package->package.elements[1].integer.value;408408+408409 kfree(buffer.pointer);409409- return ret;410410+ return num;410411}411412412413/* Notify firmware how many CPUs are idle */···434433 uint32_t idle_cpus;435434436435 mutex_lock(&isolated_cpus_lock);437437- if (acpi_pad_pur(handle, &num_cpus)) {436436+ num_cpus = acpi_pad_pur(handle);437437+ if (num_cpus < 0) {438438 mutex_unlock(&isolated_cpus_lock);439439 return;440440 }
···109109 *110110 * DESCRIPTION: Reacquire the interpreter execution region from within the111111 * interpreter code. Failure to enter the interpreter region is a112112- * fatal system error. Used in conjuction with112112+ * fatal system error. Used in conjunction with113113 * relinquish_interpreter114114 *115115 ******************************************************************************/
+1-1
drivers/acpi/acpica/rsutils.c
···149149150150 /*151151 * 16-, 32-, and 64-bit cases must use the move macros that perform152152- * endian conversion and/or accomodate hardware that cannot perform152152+ * endian conversion and/or accommodate hardware that cannot perform153153 * misaligned memory transfers154154 */155155 case ACPI_RSC_MOVE16:
+1-1
drivers/acpi/apei/Kconfig
···3434 depends on ACPI_APEI3535 help3636 ERST is a way provided by APEI to save and retrieve hardware3737- error infomation to and from a persistent store. Enable this3737+ error information to and from a persistent store. Enable this3838 if you want to debugging and testing the ERST kernel support3939 and firmware implementation.
···426426427427static int einj_check_table(struct acpi_table_einj *einj_tab)428428{429429- if (einj_tab->header_length != sizeof(struct acpi_table_einj))429429+ if ((einj_tab->header_length !=430430+ (sizeof(struct acpi_table_einj) - sizeof(einj_tab->header)))431431+ && (einj_tab->header_length != sizeof(struct acpi_table_einj)))430432 return -EINVAL;431433 if (einj_tab->header.length < sizeof(struct acpi_table_einj))432434 return -EINVAL;
+11-7
drivers/acpi/apei/erst-dbg.c
···22 * APEI Error Record Serialization Table debug support33 *44 * ERST is a way provided by APEI to save and retrieve hardware error55- * infomation to and from a persistent store. This file provide the55+ * information to and from a persistent store. This file provide the66 * debugging/testing support for ERST kernel support and firmware77 * implementation.88 *···111111 goto out;112112 }113113 if (len > erst_dbg_buf_len) {114114- kfree(erst_dbg_buf);114114+ void *p;115115 rc = -ENOMEM;116116- erst_dbg_buf = kmalloc(len, GFP_KERNEL);117117- if (!erst_dbg_buf)116116+ p = kmalloc(len, GFP_KERNEL);117117+ if (!p)118118 goto out;119119+ kfree(erst_dbg_buf);120120+ erst_dbg_buf = p;119121 erst_dbg_buf_len = len;120122 goto retry;121123 }···152150 if (mutex_lock_interruptible(&erst_dbg_mutex))153151 return -EINTR;154152 if (usize > erst_dbg_buf_len) {155155- kfree(erst_dbg_buf);153153+ void *p;156154 rc = -ENOMEM;157157- erst_dbg_buf = kmalloc(usize, GFP_KERNEL);158158- if (!erst_dbg_buf)155155+ p = kmalloc(usize, GFP_KERNEL);156156+ if (!p)159157 goto out;158158+ kfree(erst_dbg_buf);159159+ erst_dbg_buf = p;160160 erst_dbg_buf_len = usize;161161 }162162 rc = copy_from_user(erst_dbg_buf, ubuf, usize);
+24-5
drivers/acpi/apei/erst.c
···22 * APEI Error Record Serialization Table support33 *44 * ERST is a way provided by APEI to save and retrieve hardware error55- * infomation to and from a persistent store.55+ * information to and from a persistent store.66 *77 * For more information about ERST, please refer to ACPI Specification88 * version 4.0, section 17.4.···266266{267267 int rc;268268 u64 offset;269269+ void *src, *dst;270270+271271+ /* ioremap does not work in interrupt context */272272+ if (in_interrupt()) {273273+ pr_warning(ERST_PFX274274+ "MOVE_DATA can not be used in interrupt context");275275+ return -EBUSY;276276+ }269277270278 rc = __apei_exec_read_register(entry, &offset);271279 if (rc)272280 return rc;273273- memmove((void *)ctx->dst_base + offset,274274- (void *)ctx->src_base + offset,275275- ctx->var2);281281+282282+ src = ioremap(ctx->src_base + offset, ctx->var2);283283+ if (!src)284284+ return -ENOMEM;285285+ dst = ioremap(ctx->dst_base + offset, ctx->var2);286286+ if (!dst)287287+ return -ENOMEM;288288+289289+ memmove(dst, src, ctx->var2);290290+291291+ iounmap(src);292292+ iounmap(dst);276293277294 return 0;278295}···767750768751static int erst_check_table(struct acpi_table_erst *erst_tab)769752{770770- if (erst_tab->header_length != sizeof(struct acpi_table_erst))753753+ if ((erst_tab->header_length !=754754+ (sizeof(struct acpi_table_erst) - sizeof(erst_tab->header)))755755+ && (erst_tab->header_length != sizeof(struct acpi_table_einj)))771756 return -EINVAL;772757 if (erst_tab->header.length < sizeof(struct acpi_table_erst))773758 return -EINVAL;
···5555static int set_power_nocheck(const struct dmi_system_id *id)5656{5757 printk(KERN_NOTICE PREFIX "%s detected - "5858- "disable power check in power transistion\n", id->ident);5858+ "disable power check in power transition\n", id->ident);5959 acpi_power_nocheck = 1;6060 return 0;6161}···80808181static struct dmi_system_id dsdt_dmi_table[] __initdata = {8282 /*8383- * Insyde BIOS on some TOSHIBA machines corrupt the DSDT.8383+ * Invoke DSDT corruption work-around on all Toshiba Satellite.8484 * https://bugzilla.kernel.org/show_bug.cgi?id=146798585 */8686 {8787 .callback = set_copy_dsdt,8888- .ident = "TOSHIBA Satellite A505",8888+ .ident = "TOSHIBA Satellite",8989 .matches = {9090 DMI_MATCH(DMI_SYS_VENDOR, "TOSHIBA"),9191- DMI_MATCH(DMI_PRODUCT_NAME, "Satellite A505"),9292- },9393- },9494- {9595- .callback = set_copy_dsdt,9696- .ident = "TOSHIBA Satellite L505D",9797- .matches = {9898- DMI_MATCH(DMI_SYS_VENDOR, "TOSHIBA"),9999- DMI_MATCH(DMI_PRODUCT_NAME, "Satellite L505D"),9191+ DMI_MATCH(DMI_PRODUCT_NAME, "Satellite"),10092 },10193 },10294 {}···1019102710201028 /*10211029 * If the laptop falls into the DMI check table, the power state check10221022- * will be disabled in the course of device power transistion.10301030+ * will be disabled in the course of device power transition.10231031 */10241032 dmi_check_system(power_nocheck_dmi_table);10251033
···850850 printk(KERN_DEBUG "ACPI: %s registered with cpuidle\n",851851 acpi_idle_driver.name);852852 } else {853853- printk(KERN_DEBUG "ACPI: acpi_idle yielding to %s",853853+ printk(KERN_DEBUG "ACPI: acpi_idle yielding to %s\n",854854 cpuidle_get_driver()->name);855855 }856856
+2-2
drivers/acpi/processor_perflib.c
···447447 if (!try_module_get(calling_module))448448 return -EINVAL;449449450450- /* is_done is set to negative if an error occured,451451- * and to postitive if _no_ error occured, but SMM450450+ /* is_done is set to negative if an error occurred,451451+ * and to postitive if _no_ error occurred, but SMM452452 * was already notified. This avoids double notification453453 * which might lead to unexpected results...454454 */
···100100 ACPI_DEBUG_INIT(ACPI_LV_EVENTS),101101};102102103103-static int param_get_debug_layer(char *buffer, struct kernel_param *kp)103103+static int param_get_debug_layer(char *buffer, const struct kernel_param *kp)104104{105105 int result = 0;106106 int i;···128128 return result;129129}130130131131-static int param_get_debug_level(char *buffer, struct kernel_param *kp)131131+static int param_get_debug_level(char *buffer, const struct kernel_param *kp)132132{133133 int result = 0;134134 int i;···149149 return result;150150}151151152152-module_param_call(debug_layer, param_set_uint, param_get_debug_layer,153153- &acpi_dbg_layer, 0644);154154-module_param_call(debug_level, param_set_uint, param_get_debug_level,155155- &acpi_dbg_level, 0644);152152+static struct kernel_param_ops param_ops_debug_layer = {153153+ .set = param_set_uint,154154+ .get = param_get_debug_layer,155155+};156156+157157+static struct kernel_param_ops param_ops_debug_level = {158158+ .set = param_set_uint,159159+ .get = param_get_debug_level,160160+};161161+162162+module_param_cb(debug_layer, ¶m_ops_debug_layer, &acpi_dbg_layer, 0644);163163+module_param_cb(debug_level, ¶m_ops_debug_level, &acpi_dbg_level, 0644);156164157165static char trace_method_name[6];158166module_param_string(trace_method_name, trace_method_name, 6, 0644);
+2-2
drivers/acpi/video_detect.c
···5959 "support\n"));6060 *cap |= ACPI_VIDEO_BACKLIGHT;6161 if (ACPI_FAILURE(acpi_get_handle(handle, "_BQC", &h_dummy)))6262- printk(KERN_WARNING FW_BUG PREFIX "ACPI brightness "6363- "control misses _BQC function\n");6262+ printk(KERN_WARNING FW_BUG PREFIX "No _BQC method, "6363+ "cannot determine initial brightness\n");6464 /* We have backlight support, no need to scan further */6565 return AE_CTRL_TERMINATE;6666 }
+1-1
drivers/cpuidle/governors/menu.c
···8080 * Limiting Performance Impact8181 * ---------------------------8282 * C states, especially those with large exit latencies, can have a real8383- * noticable impact on workloads, which is not acceptable for most sysadmins,8383+ * noticeable impact on workloads, which is not acceptable for most sysadmins,8484 * and in addition, less performance has a power price of its own.8585 *8686 * As a general rule of thumb, menu assumes that the following heuristic
+2-1
drivers/dma/shdma.c
···580580581581 sh_chan = to_sh_chan(chan);582582 param = chan->private;583583- slave_addr = param->config->addr;584583585584 /* Someone calling slave DMA on a public channel? */586585 if (!param || !sg_len) {···587588 __func__, param, sg_len, param ? param->slave_id : -1);588589 return NULL;589590 }591591+592592+ slave_addr = param->config->addr;590593591594 /*592595 * if (param != NULL), this is a successfully requested slave channel,
···136136 return -ENOMEM;137137138138 ret = drm_gem_handle_create(file_priv, obj, &handle);139139+ /* drop reference from allocate - handle holds it now */140140+ drm_gem_object_unreference_unlocked(obj);139141 if (ret) {140140- drm_gem_object_unreference_unlocked(obj);141142 return ret;142143 }143143-144144- /* Sink the floating reference from kref_init(handlecount) */145145- drm_gem_object_handle_unreference_unlocked(obj);146144147145 args->handle = handle;148146 return 0;···469471 return -ENOENT;470472 obj_priv = to_intel_bo(obj);471473472472- /* Bounds check source.473473- *474474- * XXX: This could use review for overflow issues...475475- */476476- if (args->offset > obj->size || args->size > obj->size ||477477- args->offset + args->size > obj->size) {478478- drm_gem_object_unreference_unlocked(obj);479479- return -EINVAL;474474+ /* Bounds check source. */475475+ if (args->offset > obj->size || args->size > obj->size - args->offset) {476476+ ret = -EINVAL;477477+ goto err;478478+ }479479+480480+ if (!access_ok(VERIFY_WRITE,481481+ (char __user *)(uintptr_t)args->data_ptr,482482+ args->size)) {483483+ ret = -EFAULT;484484+ goto err;480485 }481486482487 if (i915_gem_object_needs_bit17_swizzle(obj)) {···491490 file_priv);492491 }493492493493+err:494494 drm_gem_object_unreference_unlocked(obj);495495-496495 return ret;497496}498497···581580582581 user_data = (char __user *) (uintptr_t) args->data_ptr;583582 remain = args->size;584584- if (!access_ok(VERIFY_READ, user_data, remain))585585- return -EFAULT;586583587584588585 mutex_lock(&dev->struct_mutex);···933934 return -ENOENT;934935 obj_priv = to_intel_bo(obj);935936936936- /* Bounds check destination.937937- *938938- * XXX: This could use review for overflow issues...939939- */940940- if (args->offset > obj->size || args->size > obj->size ||941941- args->offset + args->size > obj->size) {942942- drm_gem_object_unreference_unlocked(obj);943943- return -EINVAL;937937+ /* Bounds check destination. */938938+ if (args->offset > obj->size || args->size > obj->size - args->offset) {939939+ ret = -EINVAL;940940+ goto err;941941+ }942942+943943+ if (!access_ok(VERIFY_READ,944944+ (char __user *)(uintptr_t)args->data_ptr,945945+ args->size)) {946946+ ret = -EFAULT;947947+ goto err;944948 }945949946950 /* We can only do the GTT pwrite on untiled buffers, as otherwise···977975 DRM_INFO("pwrite failed %d\n", ret);978976#endif979977978978+err:980979 drm_gem_object_unreference_unlocked(obj);981981-982980 return ret;983981}984982···32603258 (int) reloc->offset,32613259 reloc->read_domains,32623260 reloc->write_domain);32613261+ drm_gem_object_unreference(target_obj);32623262+ i915_gem_object_unpin(obj);32633263 return -EINVAL;32643264 }32653265 if (reloc->write_domain & I915_GEM_DOMAIN_CPU ||
+22-27
drivers/gpu/drm/i915/i915_gem_evict.c
···9393{9494 drm_i915_private_t *dev_priv = dev->dev_private;9595 struct list_head eviction_list, unwind_list;9696- struct drm_i915_gem_object *obj_priv, *tmp_obj_priv;9696+ struct drm_i915_gem_object *obj_priv;9797 struct list_head *render_iter, *bsd_iter;9898 int ret = 0;9999···175175 return -ENOSPC;176176177177found:178178+ /* drm_mm doesn't allow any other other operations while179179+ * scanning, therefore store to be evicted objects on a180180+ * temporary list. */178181 INIT_LIST_HEAD(&eviction_list);179179- list_for_each_entry_safe(obj_priv, tmp_obj_priv,180180- &unwind_list, evict_list) {182182+ while (!list_empty(&unwind_list)) {183183+ obj_priv = list_first_entry(&unwind_list,184184+ struct drm_i915_gem_object,185185+ evict_list);181186 if (drm_mm_scan_remove_block(obj_priv->gtt_space)) {182182- /* drm_mm doesn't allow any other other operations while183183- * scanning, therefore store to be evicted objects on a184184- * temporary list. */185187 list_move(&obj_priv->evict_list, &eviction_list);186186- } else187187- drm_gem_object_unreference(&obj_priv->base);188188- }189189-190190- /* Unbinding will emit any required flushes */191191- list_for_each_entry_safe(obj_priv, tmp_obj_priv,192192- &eviction_list, evict_list) {193193-#if WATCH_LRU194194- DRM_INFO("%s: evicting %p\n", __func__, &obj_priv->base);195195-#endif196196- ret = i915_gem_object_unbind(&obj_priv->base);197197- if (ret)198198- return ret;199199-188188+ continue;189189+ }190190+ list_del(&obj_priv->evict_list);200191 drm_gem_object_unreference(&obj_priv->base);201192 }202193203203- /* The just created free hole should be on the top of the free stack204204- * maintained by drm_mm, so this BUG_ON actually executes in O(1).205205- * Furthermore all accessed data has just recently been used, so it206206- * should be really fast, too. */207207- BUG_ON(!drm_mm_search_free(&dev_priv->mm.gtt_space, min_size,208208- alignment, 0));194194+ /* Unbinding will emit any required flushes */195195+ while (!list_empty(&eviction_list)) {196196+ obj_priv = list_first_entry(&eviction_list,197197+ struct drm_i915_gem_object,198198+ evict_list);199199+ if (ret == 0)200200+ ret = i915_gem_object_unbind(&obj_priv->base);201201+ list_del(&obj_priv->evict_list);202202+ drm_gem_object_unreference(&obj_priv->base);203203+ }209204210210- return 0;205205+ return ret;211206}212207213208int
+36-22
drivers/gpu/drm/i915/intel_display.c
···10131013 DRM_DEBUG_KMS("vblank wait timed out\n");10141014}1015101510161016-/**10171017- * intel_wait_for_vblank_off - wait for vblank after disabling a pipe10161016+/*10171017+ * intel_wait_for_pipe_off - wait for pipe to turn off10181018 * @dev: drm device10191019 * @pipe: pipe to wait for10201020 *···10221022 * spinning on the vblank interrupt status bit, since we won't actually10231023 * see an interrupt when the pipe is disabled.10241024 *10251025- * So this function waits for the display line value to settle (it10261026- * usually ends up stopping at the start of the next frame).10251025+ * On Gen4 and above:10261026+ * wait for the pipe register state bit to turn off10271027+ *10281028+ * Otherwise:10291029+ * wait for the display line value to settle (it usually10301030+ * ends up stopping at the start of the next frame).10311031+ * 10271032 */10281028-void intel_wait_for_vblank_off(struct drm_device *dev, int pipe)10331033+static void intel_wait_for_pipe_off(struct drm_device *dev, int pipe)10291034{10301035 struct drm_i915_private *dev_priv = dev->dev_private;10311031- int pipedsl_reg = (pipe == 0 ? PIPEADSL : PIPEBDSL);10321032- unsigned long timeout = jiffies + msecs_to_jiffies(100);10331033- u32 last_line;1034103610351035- /* Wait for the display line to settle */10361036- do {10371037- last_line = I915_READ(pipedsl_reg) & DSL_LINEMASK;10381038- mdelay(5);10391039- } while (((I915_READ(pipedsl_reg) & DSL_LINEMASK) != last_line) &&10401040- time_after(timeout, jiffies));10371037+ if (INTEL_INFO(dev)->gen >= 4) {10381038+ int pipeconf_reg = (pipe == 0 ? PIPEACONF : PIPEBCONF);1041103910421042- if (time_after(jiffies, timeout))10431043- DRM_DEBUG_KMS("vblank wait timed out\n");10401040+ /* Wait for the Pipe State to go off */10411041+ if (wait_for((I915_READ(pipeconf_reg) & I965_PIPECONF_ACTIVE) == 0,10421042+ 100, 0))10431043+ DRM_DEBUG_KMS("pipe_off wait timed out\n");10441044+ } else {10451045+ u32 last_line;10461046+ int pipedsl_reg = (pipe == 0 ? PIPEADSL : PIPEBDSL);10471047+ unsigned long timeout = jiffies + msecs_to_jiffies(100);10481048+10491049+ /* Wait for the display line to settle */10501050+ do {10511051+ last_line = I915_READ(pipedsl_reg) & DSL_LINEMASK;10521052+ mdelay(5);10531053+ } while (((I915_READ(pipedsl_reg) & DSL_LINEMASK) != last_line) &&10541054+ time_after(timeout, jiffies));10551055+ if (time_after(jiffies, timeout))10561056+ DRM_DEBUG_KMS("pipe_off wait timed out\n");10571057+ }10441058}1045105910461060/* Parameters have changed, update FBC info */···23422328 I915_READ(dspbase_reg);23432329 }2344233023452345- /* Wait for vblank for the disable to take effect */23462346- intel_wait_for_vblank_off(dev, pipe);23472347-23482331 /* Don't disable pipe A or pipe A PLLs if needed */23492332 if (pipeconf_reg == PIPEACONF &&23502350- (dev_priv->quirks & QUIRK_PIPEA_FORCE))23332333+ (dev_priv->quirks & QUIRK_PIPEA_FORCE)) {23342334+ /* Wait for vblank for the disable to take effect */23352335+ intel_wait_for_vblank(dev, pipe);23512336 goto skip_pipe_off;23372337+ }2352233823532339 /* Next, disable display pipes */23542340 temp = I915_READ(pipeconf_reg);···23572343 I915_READ(pipeconf_reg);23582344 }2359234523602360- /* Wait for vblank for the disable to take effect. */23612361- intel_wait_for_vblank_off(dev, pipe);23462346+ /* Wait for the pipe to turn off */23472347+ intel_wait_for_pipe_off(dev, pipe);2362234823632349 temp = I915_READ(dpll_reg);23642350 if ((temp & DPLL_VCO_ENABLE) != 0) {
+9-10
drivers/gpu/drm/i915/intel_dp.c
···11381138intel_dp_set_link_train(struct intel_dp *intel_dp,11391139 uint32_t dp_reg_value,11401140 uint8_t dp_train_pat,11411141- uint8_t train_set[4],11421142- bool first)11411141+ uint8_t train_set[4])11431142{11441143 struct drm_device *dev = intel_dp->base.enc.dev;11451144 struct drm_i915_private *dev_priv = dev->dev_private;11461146- struct intel_crtc *intel_crtc = to_intel_crtc(intel_dp->base.enc.crtc);11471145 int ret;1148114611491147 I915_WRITE(intel_dp->output_reg, dp_reg_value);11501148 POSTING_READ(intel_dp->output_reg);11511151- if (first)11521152- intel_wait_for_vblank(dev, intel_crtc->pipe);1153114911541150 intel_dp_aux_native_write_1(intel_dp,11551151 DP_TRAINING_PATTERN_SET,···11701174 uint8_t voltage;11711175 bool clock_recovery = false;11721176 bool channel_eq = false;11731173- bool first = true;11741177 int tries;11751178 u32 reg;11761179 uint32_t DP = intel_dp->DP;11801180+ struct intel_crtc *intel_crtc = to_intel_crtc(intel_dp->base.enc.crtc);11811181+11821182+ /* Enable output, wait for it to become active */11831183+ I915_WRITE(intel_dp->output_reg, intel_dp->DP);11841184+ POSTING_READ(intel_dp->output_reg);11851185+ intel_wait_for_vblank(dev, intel_crtc->pipe);1177118611781187 /* Write the link configuration data */11791188 intel_dp_aux_native_write(intel_dp, DP_LINK_BW_SET,···12111210 reg = DP | DP_LINK_TRAIN_PAT_1;1212121112131212 if (!intel_dp_set_link_train(intel_dp, reg,12141214- DP_TRAINING_PATTERN_1, train_set, first))12131213+ DP_TRAINING_PATTERN_1, train_set))12151214 break;12161216- first = false;12171215 /* Set training pattern 1 */1218121612191217 udelay(100);···1266126612671267 /* channel eq pattern */12681268 if (!intel_dp_set_link_train(intel_dp, reg,12691269- DP_TRAINING_PATTERN_2, train_set,12701270- false))12691269+ DP_TRAINING_PATTERN_2, train_set))12711270 break;1272127112731272 udelay(400);
···167167 goto out;168168169169 ret = drm_gem_handle_create(file_priv, nvbo->gem, &req->info.handle);170170+ /* drop reference from allocate - handle holds it now */171171+ drm_gem_object_unreference_unlocked(nvbo->gem);170172out:171171- drm_gem_object_handle_unreference_unlocked(nvbo->gem);172172-173173- if (ret)174174- drm_gem_object_unreference_unlocked(nvbo->gem);175173 return ret;176174}177175
···111111/* Super-I/O Function prototypes */112112static inline int superio_inb(int base, int reg);113113static inline int superio_inw(int base, int reg);114114-static inline void superio_enter(int base);114114+static inline int superio_enter(int base);115115static inline void superio_select(int base, int ld);116116static inline void superio_exit(int base);117117···861861 return val;862862}863863864864-static inline void superio_enter(int base)864864+static inline int superio_enter(int base)865865{866866+ /* Don't step on other drivers' I/O space by accident */867867+ if (!request_muxed_region(base, 2, DRVNAME)) {868868+ printk(KERN_ERR DRVNAME ": I/O address 0x%04x already in use\n",869869+ base);870870+ return -EBUSY;871871+ }872872+866873 /* according to the datasheet the key must be send twice! */867874 outb(SIO_UNLOCK_KEY, base);868875 outb(SIO_UNLOCK_KEY, base);876876+877877+ return 0;869878}870879871880static inline void superio_select(int base, int ld)···886877static inline void superio_exit(int base)887878{888879 outb(SIO_LOCK_KEY, base);880880+ release_region(base, 2);889881}890882891883static inline int fan_from_reg(u16 reg)···21852175static int __init f71882fg_find(int sioaddr, unsigned short *address,21862176 struct f71882fg_sio_data *sio_data)21872177{21882188- int err = -ENODEV;21892178 u16 devid;21902190-21912191- /* Don't step on other drivers' I/O space by accident */21922192- if (!request_region(sioaddr, 2, DRVNAME)) {21932193- printk(KERN_ERR DRVNAME ": I/O address 0x%04x already in use\n",21942194- (int)sioaddr);21952195- return -EBUSY;21962196- }21972197-21982198- superio_enter(sioaddr);21792179+ int err = superio_enter(sioaddr);21802180+ if (err)21812181+ return err;2199218222002183 devid = superio_inw(sioaddr, SIO_REG_MANID);22012184 if (devid != SIO_FINTEK_ID) {22022185 pr_debug(DRVNAME ": Not a Fintek device\n");21862186+ err = -ENODEV;22032187 goto exit;22042188 }22052189···22172213 default:22182214 printk(KERN_INFO DRVNAME ": Unsupported Fintek device: %04x\n",22192215 (unsigned int)devid);22162216+ err = -ENODEV;22202217 goto exit;22212218 }22222219···2228222322292224 if (!(superio_inb(sioaddr, SIO_REG_ENABLE) & 0x01)) {22302225 printk(KERN_WARNING DRVNAME ": Device not activated\n");22262226+ err = -ENODEV;22312227 goto exit;22322228 }2233222922342230 *address = superio_inw(sioaddr, SIO_REG_ADDR);22352231 if (*address == 0) {22362232 printk(KERN_WARNING DRVNAME ": Base address not set\n");22332233+ err = -ENODEV;22372234 goto exit;22382235 }22392236 *address &= ~(REGION_LENGTH - 1); /* Ignore 3 LSB */···22462239 (int)superio_inb(sioaddr, SIO_REG_DEVREV));22472240exit:22482241 superio_exit(sioaddr);22492249- release_region(sioaddr, 2);22502242 return err;22512243}22522244
+3-3
drivers/i2c/busses/i2c-davinci.c
···357357358358 dev->terminate = 0;359359360360- /* write the data into mode register */361361- davinci_i2c_write_reg(dev, DAVINCI_I2C_MDR_REG, flag);362362-363360 /*364361 * First byte should be set here, not after interrupt,365362 * because transmit-data-ready interrupt can come before···367370 davinci_i2c_write_reg(dev, DAVINCI_I2C_DXR_REG, *dev->buf++);368371 dev->buf_len--;369372 }373373+374374+ /* write the data into mode register; start transmitting */375375+ davinci_i2c_write_reg(dev, DAVINCI_I2C_MDR_REG, flag);370376371377 r = wait_for_completion_interruptible_timeout(&dev->cmd_complete,372378 dev->adapter.timeout);
···755755{756756 int ret = 0;757757758758- blocking_notifier_chain_register(&xenstore_chain, nb);758758+ if (xenstored_ready > 0)759759+ ret = nb->notifier_call(nb, 0, NULL);760760+ else761761+ blocking_notifier_chain_register(&xenstore_chain, nb);759762760763 return ret;761764}···772769773770void xenbus_probe(struct work_struct *unused)774771{775775- BUG_ON((xenstored_ready <= 0));772772+ xenstored_ready = 1;776773777774 /* Enumerate devices in xenstore and watch for changes. */778775 xenbus_probe_devices(&xenbus_frontend);···838835 xen_store_evtchn = xen_start_info->store_evtchn;839836 xen_store_mfn = xen_start_info->store_mfn;840837 xen_store_interface = mfn_to_virt(xen_store_mfn);838838+ xenstored_ready = 1;841839 }842842- xenstored_ready = 1;843840 }844841845842 /* Initialize the interface to xenstore. */
+33-16
fs/cifs/cifssmb.c
···232232small_smb_init(int smb_command, int wct, struct cifsTconInfo *tcon,233233 void **request_buf)234234{235235- int rc = 0;235235+ int rc;236236237237 rc = cifs_reconnect_tcon(tcon, smb_command);238238 if (rc)···250250 if (tcon != NULL)251251 cifs_stats_inc(&tcon->num_smbs_sent);252252253253- return rc;253253+ return 0;254254}255255256256int···281281282282/* If the return code is zero, this function must fill in request_buf pointer */283283static int284284-smb_init(int smb_command, int wct, struct cifsTconInfo *tcon,285285- void **request_buf /* returned */ ,286286- void **response_buf /* returned */ )284284+__smb_init(int smb_command, int wct, struct cifsTconInfo *tcon,285285+ void **request_buf, void **response_buf)287286{288288- int rc = 0;289289-290290- rc = cifs_reconnect_tcon(tcon, smb_command);291291- if (rc)292292- return rc;293293-294287 *request_buf = cifs_buf_get();295288 if (*request_buf == NULL) {296289 /* BB should we add a retry in here if not a writepage? */···302309 if (tcon != NULL)303310 cifs_stats_inc(&tcon->num_smbs_sent);304311305305- return rc;312312+ return 0;313313+}314314+315315+/* If the return code is zero, this function must fill in request_buf pointer */316316+static int317317+smb_init(int smb_command, int wct, struct cifsTconInfo *tcon,318318+ void **request_buf, void **response_buf)319319+{320320+ int rc;321321+322322+ rc = cifs_reconnect_tcon(tcon, smb_command);323323+ if (rc)324324+ return rc;325325+326326+ return __smb_init(smb_command, wct, tcon, request_buf, response_buf);327327+}328328+329329+static int330330+smb_init_no_reconnect(int smb_command, int wct, struct cifsTconInfo *tcon,331331+ void **request_buf, void **response_buf)332332+{333333+ if (tcon->ses->need_reconnect || tcon->need_reconnect)334334+ return -EHOSTDOWN;335335+336336+ return __smb_init(smb_command, wct, tcon, request_buf, response_buf);306337}307338308339static int validate_t2(struct smb_t2_rsp *pSMB)···4551453445524535 cFYI(1, "In QFSUnixInfo");45534536QFSUnixRetry:45544554- rc = smb_init(SMB_COM_TRANSACTION2, 15, tcon, (void **) &pSMB,45554555- (void **) &pSMBr);45374537+ rc = smb_init_no_reconnect(SMB_COM_TRANSACTION2, 15, tcon,45384538+ (void **) &pSMB, (void **) &pSMBr);45564539 if (rc)45574540 return rc;45584541···46214604 cFYI(1, "In SETFSUnixInfo");46224605SETFSUnixRetry:46234606 /* BB switch to small buf init to save memory */46244624- rc = smb_init(SMB_COM_TRANSACTION2, 15, tcon, (void **) &pSMB,46254625- (void **) &pSMBr);46074607+ rc = smb_init_no_reconnect(SMB_COM_TRANSACTION2, 15, tcon,46084608+ (void **) &pSMB, (void **) &pSMBr);46264609 if (rc)46274610 return rc;46284611
···128128 }129129130130 /* Fast symlinks can't be large */131131- len = strlen(target);131131+ len = strnlen(target, ocfs2_fast_symlink_chars(inode->i_sb));132132 link = kzalloc(len + 1, GFP_NOFS);133133 if (!link) {134134 status = -ENOMEM;
···170170int reiserfs_unpack(struct inode *inode, struct file *filp)171171{172172 int retval = 0;173173+ int depth;173174 int index;174175 struct page *page;175176 struct address_space *mapping;···189188 /* we need to make sure nobody is changing the file size beneath190189 ** us191190 */192192- mutex_lock(&inode->i_mutex);193193- reiserfs_write_lock(inode->i_sb);191191+ reiserfs_mutex_lock_safe(&inode->i_mutex, inode->i_sb);192192+ depth = reiserfs_write_lock_once(inode->i_sb);194193195194 write_from = inode->i_size & (blocksize - 1);196195 /* if we are on a block boundary, we are already unpacked. */···225224226225 out:227226 mutex_unlock(&inode->i_mutex);228228- reiserfs_write_unlock(inode->i_sb);227227+ reiserfs_write_unlock_once(inode->i_sb, depth);229228 return retval;230229}
+9-3
fs/xfs/xfs_log_cil.c
···405405 new_ctx = kmem_zalloc(sizeof(*new_ctx), KM_SLEEP|KM_NOFS);406406 new_ctx->ticket = xlog_cil_ticket_alloc(log);407407408408- /* lock out transaction commit, but don't block on background push */408408+ /*409409+ * Lock out transaction commit, but don't block for background pushes410410+ * unless we are well over the CIL space limit. See the definition of411411+ * XLOG_CIL_HARD_SPACE_LIMIT() for the full explanation of the logic412412+ * used here.413413+ */409414 if (!down_write_trylock(&cil->xc_ctx_lock)) {410410- if (!push_seq)415415+ if (!push_seq &&416416+ cil->xc_ctx->space_used < XLOG_CIL_HARD_SPACE_LIMIT(log))411417 goto out_free_ticket;412418 down_write(&cil->xc_ctx_lock);413419 }···428422 goto out_skip;429423430424 /* check for a previously pushed seqeunce */431431- if (push_seq < cil->xc_ctx->sequence)425425+ if (push_seq && push_seq < cil->xc_ctx->sequence)432426 goto out_skip;433427434428 /*
+21-16
fs/xfs/xfs_log_priv.h
···426426};427427428428/*429429- * The amount of log space we should the CIL to aggregate is difficult to size.430430- * Whatever we chose we have to make we can get a reservation for the log space431431- * effectively, that it is large enough to capture sufficient relogging to432432- * reduce log buffer IO significantly, but it is not too large for the log or433433- * induces too much latency when writing out through the iclogs. We track both434434- * space consumed and the number of vectors in the checkpoint context, so we435435- * need to decide which to use for limiting.429429+ * The amount of log space we allow the CIL to aggregate is difficult to size.430430+ * Whatever we choose, we have to make sure we can get a reservation for the431431+ * log space effectively, that it is large enough to capture sufficient432432+ * relogging to reduce log buffer IO significantly, but it is not too large for433433+ * the log or induces too much latency when writing out through the iclogs. We434434+ * track both space consumed and the number of vectors in the checkpoint435435+ * context, so we need to decide which to use for limiting.436436 *437437 * Every log buffer we write out during a push needs a header reserved, which438438 * is at least one sector and more for v2 logs. Hence we need a reservation of···459459 * checkpoint transaction ticket is specific to the checkpoint context, rather460460 * than the CIL itself.461461 *462462- * With dynamic reservations, we can basically make up arbitrary limits for the463463- * checkpoint size so long as they don't violate any other size rules. Hence464464- * the initial maximum size for the checkpoint transaction will be set to a465465- * quarter of the log or 8MB, which ever is smaller. 8MB is an arbitrary limit466466- * right now based on the latency of writing out a large amount of data through467467- * the circular iclog buffers.462462+ * With dynamic reservations, we can effectively make up arbitrary limits for463463+ * the checkpoint size so long as they don't violate any other size rules.464464+ * Recovery imposes a rule that no transaction exceed half the log, so we are465465+ * limited by that. Furthermore, the log transaction reservation subsystem466466+ * tries to keep 25% of the log free, so we need to keep below that limit or we467467+ * risk running out of free log space to start any new transactions.468468+ *469469+ * In order to keep background CIL push efficient, we will set a lower470470+ * threshold at which background pushing is attempted without blocking current471471+ * transaction commits. A separate, higher bound defines when CIL pushes are472472+ * enforced to ensure we stay within our maximum checkpoint size bounds.473473+ * threshold, yet give us plenty of space for aggregation on large logs.468474 */469469-470470-#define XLOG_CIL_SPACE_LIMIT(log) \471471- (min((log->l_logsize >> 2), (8 * 1024 * 1024)))475475+#define XLOG_CIL_SPACE_LIMIT(log) (log->l_logsize >> 3)476476+#define XLOG_CIL_HARD_SPACE_LIMIT(log) (3 * (log->l_logsize >> 4))472477473478/*474479 * The reservation head lsn is not made up of a cycle number and block number.
+1-1
include/acpi/acpixf.h
···5555extern u8 acpi_gbl_permanent_mmap;56565757/*5858- * Globals that are publically available, allowing for5858+ * Globals that are publicly available, allowing for5959 * run time configuration6060 */6161extern u32 acpi_dbg_level;
+20-9
include/drm/drmP.h
···612612 struct kref refcount;613613614614 /** Handle count of this object. Each handle also holds a reference */615615- struct kref handlecount;615615+ atomic_t handle_count; /* number of handles on this object */616616617617 /** Related drm device */618618 struct drm_device *dev;···808808 */809809 int (*gem_init_object) (struct drm_gem_object *obj);810810 void (*gem_free_object) (struct drm_gem_object *obj);811811- void (*gem_free_object_unlocked) (struct drm_gem_object *obj);812811813812 /* vga arb irq handler */814813 void (*vgaarb_irq)(struct drm_device *dev, bool state);···11741175extern int drm_mmap(struct file *filp, struct vm_area_struct *vma);11751176extern int drm_mmap_locked(struct file *filp, struct vm_area_struct *vma);11761177extern void drm_vm_open_locked(struct vm_area_struct *vma);11781178+extern void drm_vm_close_locked(struct vm_area_struct *vma);11771179extern resource_size_t drm_core_get_map_ofs(struct drm_local_map * map);11781180extern resource_size_t drm_core_get_reg_ofs(struct drm_device *dev);11791181extern unsigned int drm_poll(struct file *filp, struct poll_table_struct *wait);···14551455void drm_gem_destroy(struct drm_device *dev);14561456void drm_gem_object_release(struct drm_gem_object *obj);14571457void drm_gem_object_free(struct kref *kref);14581458-void drm_gem_object_free_unlocked(struct kref *kref);14591458struct drm_gem_object *drm_gem_object_alloc(struct drm_device *dev,14601459 size_t size);14611460int drm_gem_object_init(struct drm_device *dev,14621461 struct drm_gem_object *obj, size_t size);14631463-void drm_gem_object_handle_free(struct kref *kref);14621462+void drm_gem_object_handle_free(struct drm_gem_object *obj);14641463void drm_gem_vm_open(struct vm_area_struct *vma);14651464void drm_gem_vm_close(struct vm_area_struct *vma);14661465int drm_gem_mmap(struct file *filp, struct vm_area_struct *vma);···14821483static inline void14831484drm_gem_object_unreference_unlocked(struct drm_gem_object *obj)14841485{14851485- if (obj != NULL)14861486- kref_put(&obj->refcount, drm_gem_object_free_unlocked);14861486+ if (obj != NULL) {14871487+ struct drm_device *dev = obj->dev;14881488+ mutex_lock(&dev->struct_mutex);14891489+ kref_put(&obj->refcount, drm_gem_object_free);14901490+ mutex_unlock(&dev->struct_mutex);14911491+ }14871492}1488149314891494int drm_gem_handle_create(struct drm_file *file_priv,···14981495drm_gem_object_handle_reference(struct drm_gem_object *obj)14991496{15001497 drm_gem_object_reference(obj);15011501- kref_get(&obj->handlecount);14981498+ atomic_inc(&obj->handle_count);15021499}1503150015041501static inline void···15071504 if (obj == NULL)15081505 return;1509150615071507+ if (atomic_read(&obj->handle_count) == 0)15081508+ return;15101509 /*15111510 * Must bump handle count first as this may be the last15121511 * ref, in which case the object would disappear before we15131512 * checked for a name15141513 */15151515- kref_put(&obj->handlecount, drm_gem_object_handle_free);15141514+ if (atomic_dec_and_test(&obj->handle_count))15151515+ drm_gem_object_handle_free(obj);15161516 drm_gem_object_unreference(obj);15171517}15181518···15251519 if (obj == NULL)15261520 return;1527152115221522+ if (atomic_read(&obj->handle_count) == 0)15231523+ return;15241524+15281525 /*15291526 * Must bump handle count first as this may be the last15301527 * ref, in which case the object would disappear before we15311528 * checked for a name15321529 */15331533- kref_put(&obj->handlecount, drm_gem_object_handle_free);15301530+15311531+ if (atomic_dec_and_test(&obj->handle_count))15321532+ drm_gem_object_handle_free(obj);15341533 drm_gem_object_unreference_unlocked(obj);15351534}15361535
···5353#define CPUIDLE_FLAG_BALANCED (0x40) /* medium latency, moderate savings */5454#define CPUIDLE_FLAG_DEEP (0x80) /* high latency, large savings */5555#define CPUIDLE_FLAG_IGNORE (0x100) /* ignore during this idle period */5656+#define CPUIDLE_FLAG_TLB_FLUSHED (0x200) /* tlb will be flushed */56575758#define CPUIDLE_DRIVER_FLAGS_MASK (0xFFFF0000)5859
···365365 n = setup_sgl_buf(sgl, fifo->data + off, nents, l);366366 n += setup_sgl_buf(sgl + n, fifo->data, nents - n, len - l);367367368368- if (n)369369- sg_mark_end(sgl + n - 1);370368 return n;371369}372370
···365365EXPORT_SYMBOL_GPL(smp_call_function_any);366366367367/**368368- * __smp_call_function_single(): Run a function on another CPU368368+ * __smp_call_function_single(): Run a function on a specific CPU369369 * @cpu: The CPU to run on.370370 * @data: Pre-allocated and setup data structure371371+ * @wait: If true, wait until function has completed on specified CPU.371372 *372373 * Like smp_call_function_single(), but allow caller to pass in a373374 * pre-allocated data structure. Useful for embedding @data inside···377376void __smp_call_function_single(int cpu, struct call_single_data *data,378377 int wait)379378{380380- csd_lock(data);379379+ unsigned int this_cpu;380380+ unsigned long flags;381381382382+ this_cpu = get_cpu();382383 /*383384 * Can deadlock when called with interrupts disabled.384385 * We allow cpu's that are not yet online though, as no one else can···390387 WARN_ON_ONCE(cpu_online(smp_processor_id()) && wait && irqs_disabled()391388 && !oops_in_progress);392389393393- generic_exec_single(cpu, data, wait);390390+ if (cpu == this_cpu) {391391+ local_irq_save(flags);392392+ data->func(data->info);393393+ local_irq_restore(flags);394394+ } else {395395+ csd_lock(data);396396+ generic_exec_single(cpu, data, wait);397397+ }398398+ put_cpu();394399}395400396401/**
+2-4
lib/bug.c
···7272 return NULL;7373}74747575-int module_bug_finalize(const Elf_Ehdr *hdr, const Elf_Shdr *sechdrs,7676- struct module *mod)7575+void module_bug_finalize(const Elf_Ehdr *hdr, const Elf_Shdr *sechdrs,7676+ struct module *mod)7777{7878 char *secstrings;7979 unsigned int i;···9797 * could potentially lead to deadlock and thus be counter-productive.9898 */9999 list_add(&mod->bug_list, &module_bug_list);100100-101101- return 0;102100}103101104102void module_bug_cleanup(struct module *mod)
+1-1
lib/list_sort.c
···7070 * element comparison is needed, so the client's cmp()7171 * routine can invoke cond_resched() periodically.7272 */7373- (*cmp)(priv, tail, tail);7373+ (*cmp)(priv, tail->next, tail->next);74747575 tail->next->prev = tail;7676 tail = tail->next;
···381381unsigned long page_address_in_vma(struct page *page, struct vm_area_struct *vma)382382{383383 if (PageAnon(page)) {384384- if (vma->anon_vma->root != page_anon_vma(page)->root)384384+ struct anon_vma *page__anon_vma = page_anon_vma(page);385385+ /*386386+ * Note: swapoff's unuse_vma() is more efficient with this387387+ * check, and needs it to match anon_vma when KSM is active.388388+ */389389+ if (!vma->anon_vma || !page__anon_vma ||390390+ vma->anon_vma->root != page__anon_vma->root)385391 return -EFAULT;386392 } else if (page->mapping && !(vma->vm_flags & VM_NONLINEAR)) {387393 if (!vma->vm_file ||
+10-4
net/8021q/vlan_core.c
···24242525 if (vlan_dev)2626 skb->dev = vlan_dev;2727- else if (vlan_id)2828- goto drop;2727+ else if (vlan_id) {2828+ if (!(skb->dev->flags & IFF_PROMISC))2929+ goto drop;3030+ skb->pkt_type = PACKET_OTHERHOST;3131+ }29323033 return (polling ? netif_receive_skb(skb) : netif_rx(skb));3134···105102106103 if (vlan_dev)107104 skb->dev = vlan_dev;108108- else if (vlan_id)109109- goto drop;105105+ else if (vlan_id) {106106+ if (!(skb->dev->flags & IFF_PROMISC))107107+ goto drop;108108+ skb->pkt_type = PACKET_OTHERHOST;109109+ }110110111111 for (p = napi->gro_list; p; p = p->next) {112112 NAPI_GRO_CB(p)->same_flow =
+1
net/ipv4/Kconfig
···217217218218config NET_IPGRE219219 tristate "IP: GRE tunnels over IP"220220+ depends on IPV6 || IPV6=n220221 help221222 Tunneling means encapsulating data of one protocol type within222223 another protocol and sending it over a channel that understands the
+14-10
net/ipv4/tcp_timer.c
···135135136136/* This function calculates a "timeout" which is equivalent to the timeout of a137137 * TCP connection after "boundary" unsuccessful, exponentially backed-off138138- * retransmissions with an initial RTO of TCP_RTO_MIN.138138+ * retransmissions with an initial RTO of TCP_RTO_MIN or TCP_TIMEOUT_INIT if139139+ * syn_set flag is set.139140 */140141static bool retransmits_timed_out(struct sock *sk,141141- unsigned int boundary)142142+ unsigned int boundary,143143+ bool syn_set)142144{143145 unsigned int timeout, linear_backoff_thresh;144146 unsigned int start_ts;147147+ unsigned int rto_base = syn_set ? TCP_TIMEOUT_INIT : TCP_RTO_MIN;145148146149 if (!inet_csk(sk)->icsk_retransmits)147150 return false;···154151 else155152 start_ts = tcp_sk(sk)->retrans_stamp;156153157157- linear_backoff_thresh = ilog2(TCP_RTO_MAX/TCP_RTO_MIN);154154+ linear_backoff_thresh = ilog2(TCP_RTO_MAX/rto_base);158155159156 if (boundary <= linear_backoff_thresh)160160- timeout = ((2 << boundary) - 1) * TCP_RTO_MIN;157157+ timeout = ((2 << boundary) - 1) * rto_base;161158 else162162- timeout = ((2 << linear_backoff_thresh) - 1) * TCP_RTO_MIN +159159+ timeout = ((2 << linear_backoff_thresh) - 1) * rto_base +163160 (boundary - linear_backoff_thresh) * TCP_RTO_MAX;164161165162 return (tcp_time_stamp - start_ts) >= timeout;···170167{171168 struct inet_connection_sock *icsk = inet_csk(sk);172169 int retry_until;173173- bool do_reset;170170+ bool do_reset, syn_set = 0;174171175172 if ((1 << sk->sk_state) & (TCPF_SYN_SENT | TCPF_SYN_RECV)) {176173 if (icsk->icsk_retransmits)177174 dst_negative_advice(sk);178175 retry_until = icsk->icsk_syn_retries ? : sysctl_tcp_syn_retries;176176+ syn_set = 1;179177 } else {180180- if (retransmits_timed_out(sk, sysctl_tcp_retries1)) {178178+ if (retransmits_timed_out(sk, sysctl_tcp_retries1, 0)) {181179 /* Black hole detection */182180 tcp_mtu_probing(icsk, sk);183181···191187192188 retry_until = tcp_orphan_retries(sk, alive);193189 do_reset = alive ||194194- !retransmits_timed_out(sk, retry_until);190190+ !retransmits_timed_out(sk, retry_until, 0);195191196192 if (tcp_out_of_resources(sk, do_reset))197193 return 1;198194 }199195 }200196201201- if (retransmits_timed_out(sk, retry_until)) {197197+ if (retransmits_timed_out(sk, retry_until, syn_set)) {202198 /* Has it gone just too far? */203199 tcp_write_err(sk);204200 return 1;···440436 icsk->icsk_rto = min(icsk->icsk_rto << 1, TCP_RTO_MAX);441437 }442438 inet_csk_reset_xmit_timer(sk, ICSK_TIME_RETRANS, icsk->icsk_rto, TCP_RTO_MAX);443443- if (retransmits_timed_out(sk, sysctl_tcp_retries1 + 1))439439+ if (retransmits_timed_out(sk, sysctl_tcp_retries1 + 1, 0))444440 __sk_dst_reset(sk);445441446442out:;
···225225static int pipe_rcv_status(struct sock *sk, struct sk_buff *skb)226226{227227 struct pep_sock *pn = pep_sk(sk);228228- struct pnpipehdr *hdr = pnp_hdr(skb);228228+ struct pnpipehdr *hdr;229229 int wake = 0;230230231231 if (!pskb_may_pull(skb, sizeof(*hdr) + 4))232232 return -EINVAL;233233234234+ hdr = pnp_hdr(skb);234235 if (hdr->data[0] != PN_PEP_TYPE_COMMON) {235236 LIMIT_NETDEBUG(KERN_DEBUG"Phonet unknown PEP type: %u\n",236237 (unsigned)hdr->data[0]);
+9-8
samples/kfifo/dma-example.c
···2424{2525 int i;2626 unsigned int ret;2727+ unsigned int nents;2728 struct scatterlist sg[10];28292930 printk(KERN_INFO "DMA fifo test start\n");···6261 * byte at the beginning, after the kfifo_skip().6362 */6463 sg_init_table(sg, ARRAY_SIZE(sg));6565- ret = kfifo_dma_in_prepare(&fifo, sg, ARRAY_SIZE(sg), FIFO_SIZE);6666- printk(KERN_INFO "DMA sgl entries: %d\n", ret);6767- if (!ret) {6464+ nents = kfifo_dma_in_prepare(&fifo, sg, ARRAY_SIZE(sg), FIFO_SIZE);6565+ printk(KERN_INFO "DMA sgl entries: %d\n", nents);6666+ if (!nents) {6867 /* fifo is full and no sgl was created */6968 printk(KERN_WARNING "error kfifo_dma_in_prepare\n");7069 return -EIO;···72717372 /* receive data */7473 printk(KERN_INFO "scatterlist for receive:\n");7575- for (i = 0; i < ARRAY_SIZE(sg); i++) {7474+ for (i = 0; i < nents; i++) {7675 printk(KERN_INFO7776 "sg[%d] -> "7877 "page_link 0x%.8lx offset 0x%.8x length 0x%.8x\n",···9291 kfifo_dma_in_finish(&fifo, ret);93929493 /* Prepare to transmit data, example: 8 bytes */9595- ret = kfifo_dma_out_prepare(&fifo, sg, ARRAY_SIZE(sg), 8);9696- printk(KERN_INFO "DMA sgl entries: %d\n", ret);9797- if (!ret) {9494+ nents = kfifo_dma_out_prepare(&fifo, sg, ARRAY_SIZE(sg), 8);9595+ printk(KERN_INFO "DMA sgl entries: %d\n", nents);9696+ if (!nents) {9897 /* no data was available and no sgl was created */9998 printk(KERN_WARNING "error kfifo_dma_out_prepare\n");10099 return -EIO;101100 }102101103102 printk(KERN_INFO "scatterlist for transmit:\n");104104- for (i = 0; i < ARRAY_SIZE(sg); i++) {103103+ for (i = 0; i < nents; i++) {105104 printk(KERN_INFO106105 "sg[%d] -> "107106 "page_link 0x%.8lx offset 0x%.8x length 0x%.8x\n",
+5
sound/core/control.c
···31313232/* max number of user-defined controls */3333#define MAX_USER_CONTROLS 323434+#define MAX_CONTROL_COUNT 102834353536struct snd_kctl_ioctl {3637 struct list_head list; /* list of all ioctls */···196195197196 if (snd_BUG_ON(!control || !control->count))198197 return NULL;198198+199199+ if (control->count > MAX_CONTROL_COUNT)200200+ return NULL;201201+199202 kctl = kzalloc(sizeof(*kctl) + sizeof(struct snd_kcontrol_volatile) * control->count, GFP_KERNEL);200203 if (kctl == NULL) {201204 snd_printk(KERN_ERR "Cannot allocate control instance\n");
···10171017# we compile into subdirectories. if the target directory is not the source directory, they might not exists. So10181018# we depend the various files onto their directories.10191019DIRECTORY_DEPS = $(LIB_OBJS) $(BUILTIN_OBJS) $(OUTPUT)PERF-VERSION-FILE $(OUTPUT)common-cmds.h10201020-$(DIRECTORY_DEPS): $(sort $(dir $(DIRECTORY_DEPS)))10201020+$(DIRECTORY_DEPS): | $(sort $(dir $(DIRECTORY_DEPS)))10211021# In the second step, we make a rule to actually create these directories10221022$(sort $(dir $(DIRECTORY_DEPS))):10231023 $(QUIET_MKDIR)$(MKDIR) -p $@ 2>/dev/null