···4040 - info on using the DECnet networking layer in Linux.4141depca.txt4242 - the Digital DEPCA/EtherWORKS DE1?? and DE2?? LANCE Ethernet driver4343-dgrs.txt4444- - the Digi International RightSwitch SE-X Ethernet driver4543dmfe.txt4644 - info on the Davicom DM9102(A)/DM9132/DM9801 fast ethernet driver.4745e100.txt···4850 - info on Intel's E1000 line of gigabit ethernet boards4951eql.txt5052 - serial IP load balancing5151-ethertap.txt5252- - the Ethertap user space packet reception and transmission driver5353ewrk3.txt5454 - the Digital EtherWORKS 3 DE203/4/5 Ethernet driver5555filter.txt···100104 - TUN/TAP device driver, allowing user space Rx/Tx of packets.101105vortex.txt102106 - info on using 3Com Vortex (3c590, 3c592, 3c595, 3c597) Ethernet cards.103103-wavelan.txt104104- - AT&T GIS (nee NCR) WaveLAN card: An Ethernet-like radio transceiver105107x25.txt106108 - general info on X.25 development.107109x25-iface.txt
+8-1
Documentation/networking/dns_resolver.txt
···6161 create dns_resolver foo:* * /usr/sbin/dns.foo %k626263636464-6564=====6665USAGE6766=====···101102102103 If _expiry is non-NULL, the expiry time (TTL) of the result will be103104 returned also.105105+106106+107107+===============================108108+READING DNS KEYS FROM USERSPACE109109+===============================110110+111111+Keys of dns_resolver type can be read from userspace using keyctl_read() or112112+"keyctl read/print/pipe".104113105114106115=========
+22-4
MAINTAINERS
···10101010S: Maintained10111011F: arch/arm/mach-s5p*/1012101210131013+ARM/SAMSUNG MOBILE MACHINE SUPPORT10141014+M: Kyungmin Park <kyungmin.park@samsung.com>10151015+L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)10161016+S: Maintained10171017+F: arch/arm/mach-s5pv210/mach-aquila.c10181018+F: arch/arm/mach-s5pv210/mach-goni.c10191019+F: arch/arm/mach-exynos4/mach-universal_c210.c10201020+F: arch/arm/mach-exynos4/mach-nuri.c10211021+10131022ARM/SAMSUNG S5P SERIES FIMC SUPPORT10141023M: Kyungmin Park <kyungmin.park@samsung.com>10151024M: Sylwester Nawrocki <s.nawrocki@samsung.com>···1476146714771468BONDING DRIVER14781469M: Jay Vosburgh <fubar@us.ibm.com>14701470+M: Andy Gospodarek <andy@greyhouse.net>14791471L: netdev@vger.kernel.org14801472W: http://sourceforge.net/projects/bonding/14811473S: Supported···17011691M: Andy Whitcroft <apw@canonical.com>17021692S: Supported17031693F: scripts/checkpatch.pl16941694+16951695+CHINESE DOCUMENTATION16961696+M: Harry Wei <harryxiyou@gmail.com>16971697+L: xiyoulinuxkernelgroup@googlegroups.com16981698+L: linux-kernel@zh-kernel.org (moderated for non-subscribers)16991699+S: Maintained17001700+F: Documentation/zh_CN/1704170117051702CISCO VIC ETHERNET NIC DRIVER17061703M: Vasanthy Kolluri <vkolluri@cisco.com>···20432026F: drivers/scsi/dc395x.*2044202720452028DCCP PROTOCOL20462046-M: Arnaldo Carvalho de Melo <acme@ghostprotocols.net>20292029+M: Gerrit Renker <gerrit@erg.abdn.ac.uk>20472030L: dccp@vger.kernel.org20482031W: http://www.linuxfoundation.org/collaborate/workgroups/networking/dccp20492032S: Maintained···35293512F: Documentation/hwmon/jc423530351335313514JFS FILESYSTEM35323532-M: Dave Kleikamp <shaggy@linux.vnet.ibm.com>35153515+M: Dave Kleikamp <shaggy@kernel.org>35333516L: jfs-discussion@lists.sourceforge.net35343517W: http://jfs.sourceforge.net/35353518T: git git://git.kernel.org/pub/scm/linux/kernel/git/shaggy/jfs-2.6.git···5181516451825165RAPIDIO SUBSYSTEM51835166M: Matt Porter <mporter@kernel.crashing.org>51675167+M: Alexandre Bounine <alexandre.bounine@idt.com>51845168S: Maintained51855169F: drivers/rapidio/51865170···52845266F: drivers/net/wireless/rtl818x/rtl8180/5285526752865268RTL8187 WIRELESS DRIVER52875287-M: Herton Ronaldo Krzesinski <herton@mandriva.com.br>52695269+M: Herton Ronaldo Krzesinski <herton@canonical.com>52885270M: Hin-Tak Leung <htl10@users.sourceforge.net>52895271M: Larry Finger <Larry.Finger@lwfinger.net>52905272L: linux-wireless@vger.kernel.org···61226104F: security/tomoyo/6123610561246106TOPSTAR LAPTOP EXTRAS DRIVER61256125-M: Herton Ronaldo Krzesinski <herton@mandriva.com.br>61076107+M: Herton Ronaldo Krzesinski <herton@canonical.com>61266108L: platform-driver-x86@vger.kernel.org61276109S: Maintained61286110F: drivers/platform/x86/topstar-laptop.c
···1111 select HAVE_GENERIC_HARDIRQS1212 select GENERIC_IRQ_PROBE1313 select AUTO_IRQ_AFFINITY if SMP1414+ select GENERIC_HARDIRQS_NO_DEPRECATED1415 help1516 The Alpha is a 64-bit general-purpose processor designed and1617 marketed by the Digital Equipment Corporation of blessed memory,
+9-4
arch/alpha/kernel/irq.c
···44444545int irq_select_affinity(unsigned int irq)4646{4747- struct irq_desc *desc = irq_to_desc[irq];4747+ struct irq_data *data = irq_get_irq_data(irq);4848+ struct irq_chip *chip;4849 static int last_cpu;4950 int cpu = last_cpu + 1;50515151- if (!desc || !get_irq_desc_chip(desc)->set_affinity || irq_user_affinity[irq])5252+ if (!data)5353+ return 1;5454+ chip = irq_data_get_irq_chip(data);5555+5656+ if (!chip->irq_set_affinity || irq_user_affinity[irq])5257 return 1;53585459 while (!cpu_possible(cpu) ||···6156 cpu = (cpu < (NR_CPUS-1) ? cpu + 1 : 0);6257 last_cpu = cpu;63586464- cpumask_copy(desc->affinity, cpumask_of(cpu));6565- get_irq_desc_chip(desc)->set_affinity(irq, cpumask_of(cpu));5959+ cpumask_copy(data->affinity, cpumask_of(cpu));6060+ chip->irq_set_affinity(data, cpumask_of(cpu), false);6661 return 0;6762}6863#endif /* CONFIG_SMP */
···104104}105105106106static void107107-wildfire_enable_irq(unsigned int irq)107107+wildfire_enable_irq(struct irq_data *d)108108{109109+ unsigned int irq = d->irq;110110+109111 if (irq < 16)110110- i8259a_enable_irq(irq);112112+ i8259a_enable_irq(d);111113112114 spin_lock(&wildfire_irq_lock);113115 set_bit(irq, &cached_irq_mask);···118116}119117120118static void121121-wildfire_disable_irq(unsigned int irq)119119+wildfire_disable_irq(struct irq_data *d)122120{121121+ unsigned int irq = d->irq;122122+123123 if (irq < 16)124124- i8259a_disable_irq(irq);124124+ i8259a_disable_irq(d);125125126126 spin_lock(&wildfire_irq_lock);127127 clear_bit(irq, &cached_irq_mask);···132128}133129134130static void135135-wildfire_mask_and_ack_irq(unsigned int irq)131131+wildfire_mask_and_ack_irq(struct irq_data *d)136132{133133+ unsigned int irq = d->irq;134134+137135 if (irq < 16)138138- i8259a_mask_and_ack_irq(irq);136136+ i8259a_mask_and_ack_irq(d);139137140138 spin_lock(&wildfire_irq_lock);141139 clear_bit(irq, &cached_irq_mask);···147141148142static struct irq_chip wildfire_irq_type = {149143 .name = "WILDFIRE",150150- .unmask = wildfire_enable_irq,151151- .mask = wildfire_disable_irq,152152- .mask_ack = wildfire_mask_and_ack_irq,144144+ .irq_unmask = wildfire_enable_irq,145145+ .irq_mask = wildfire_disable_irq,146146+ .irq_mask_ack = wildfire_mask_and_ack_irq,153147};154148155149static void __init···183177 for (i = 0; i < 16; ++i) {184178 if (i == 2)185179 continue;186186- irq_to_desc(i+irq_bias)->status |= IRQ_LEVEL;187180 set_irq_chip_and_handler(i+irq_bias, &wildfire_irq_type,188181 handle_level_irq);182182+ irq_set_status_flags(i + irq_bias, IRQ_LEVEL);189183 }190184191191- irq_to_desc(36+irq_bias)->status |= IRQ_LEVEL;192185 set_irq_chip_and_handler(36+irq_bias, &wildfire_irq_type,193186 handle_level_irq);187187+ irq_set_status_flags(36 + irq_bias, IRQ_LEVEL);194188 for (i = 40; i < 64; ++i) {195195- irq_to_desc(i+irq_bias)->status |= IRQ_LEVEL;196189 set_irq_chip_and_handler(i+irq_bias, &wildfire_irq_type,197190 handle_level_irq);191191+ irq_set_status_flags(i + irq_bias, IRQ_LEVEL);198192 }199193200200- setup_irq(32+irq_bias, &isa_enable); 194194+ setup_irq(32+irq_bias, &isa_enable);201195}202196203197static void __init
+2
arch/arm/common/Kconfig
···6677config ARM_VIC_NR88 int99+ default 4 if ARCH_S5PV2101010+ default 3 if ARCH_S5P6442 || ARCH_S5PC100911 default 21012 depends on ARM_VIC1113 help
-4
arch/arm/include/asm/mach/arch.h
···1515struct sys_timer;16161717struct machine_desc {1818- /*1919- * Note! The first two elements are used2020- * by assembler code in head.S, head-common.S2121- */2218 unsigned int nr; /* architecture number */2319 const char *name; /* architecture name */2420 unsigned long boot_params; /* tagged list */
···7777 dd = clk->dpll_data;78787979 /* DPLL divider must result in a valid jitter correction val */8080- fint = clk->parent->rate / (n + 1);8080+ fint = clk->parent->rate / n;8181 if (fint < DPLL_FINT_BAND1_MIN) {82828383 pr_debug("rejecting n=%d due to Fint failure, "
···9999 select POWER_SUPPLY100100 select MACH_NEO1973101101 select S3C2410_PWM102102+ select S3C_DEV_USB_HOST102103 help103104 Say Y here if you are using the Openmoko GTA02 / Freerunner GSM Phone104105
···1717void samsung_keypad_cfg_gpio(unsigned int rows, unsigned int cols)1818{1919 /* Set all the necessary GPK pins to special-function 3: KP_ROW[x] */2020- s3c_gpio_cfgrange_nopull(S3C64XX_GPK(8), 8 + rows, S3C_GPIO_SFN(3));2020+ s3c_gpio_cfgrange_nopull(S3C64XX_GPK(8), rows, S3C_GPIO_SFN(3));21212222 /* Set all the necessary GPL pins to special-function 3: KP_COL[x] */2323 s3c_gpio_cfgrange_nopull(S3C64XX_GPL(0), cols, S3C_GPIO_SFN(3));
···240240 * claims to support kexec.241241 */242242 int (*machine_kexec_prepare)(struct kimage *image);243243+244244+ /* Called to perform the _real_ kexec.245245+ * Do NOT allocate memory or fail here. We are past the point of246246+ * no return.247247+ */248248+ void (*machine_kexec)(struct kimage *image);243249#endif /* CONFIG_KEXEC */244250245251#ifdef CONFIG_SUSPEND
···3838 * neesd to be flushed. This function will either perform the flush3939 * immediately or will batch it up if the current CPU has an active4040 * batch on it.4141- *4242- * Must be called from within some kind of spinlock/non-preempt region...4341 */4442void hpte_need_flush(struct mm_struct *mm, unsigned long addr,4543 pte_t *ptep, unsigned long pte, int huge)4644{4747- struct ppc64_tlb_batch *batch = &__get_cpu_var(ppc64_tlb_batch);4545+ struct ppc64_tlb_batch *batch = &get_cpu_var(ppc64_tlb_batch);4846 unsigned long vsid, vaddr;4947 unsigned int psize;5048 int ssize;···9799 */98100 if (!batch->active) {99101 flush_hash_page(vaddr, rpte, psize, ssize, 0);102102+ put_cpu_var(ppc64_tlb_batch);100103 return;101104 }102105···126127 batch->index = ++i;127128 if (i >= PPC64_TLB_BATCH_NR)128129 __flush_tlb_pending(batch);130130+ put_cpu_var(ppc64_tlb_batch);129131}130132131133/*
+1-1
arch/sh/include/asm/sections.h
···3344#include <asm-generic/sections.h>5566-extern void __nosave_begin, __nosave_end;66+extern long __nosave_begin, __nosave_end;77extern long __machvec_start, __machvec_end;88extern char __uncached_start, __uncached_end;99extern char _ebss[];
···1010void __delay(unsigned long loops)1111{1212 __asm__ __volatile__(1313+ /*1414+ * ST40-300 appears to have an issue with this code,1515+ * normally taking two cycles each loop, as with all1616+ * other SH variants. If however the branch and the1717+ * delay slot straddle an 8 byte boundary, this increases1818+ * to 3 cycles.1919+ * This align directive ensures this doesn't occur.2020+ */2121+ ".balign 8\n\t"2222+1323 "tst %0, %0\n\t"1424 "1:\t"1525 "bf/s 1b\n\t"
···8888extern int acpi_pci_disabled;8989extern int acpi_skip_timer_override;9090extern int acpi_use_timer_override;9191+extern int acpi_fix_pin2_polarity;91929293extern u8 acpi_sci_flags;9394extern int acpi_sci_override_gsi;
···158158{159159 if (c->x86 == 0x06) {160160 if (cpu_has(c, X86_FEATURE_EST))161161- printk(KERN_WARNING PFX "Warning: EST-capable CPU "162162- "detected. The acpi-cpufreq module offers "163163- "voltage scaling in addition of frequency "161161+ printk_once(KERN_WARNING PFX "Warning: EST-capable "162162+ "CPU detected. The acpi-cpufreq module offers "163163+ "voltage scaling in addition to frequency "164164 "scaling. You should use that instead of "165165 "p4-clockmod, if possible.\n");166166 switch (c->x86_model) {
+10-3
arch/x86/kernel/cpu/cpufreq/powernow-k8.c
···15371537static int __cpuinit powernowk8_init(void)15381538{15391539 unsigned int i, supported_cpus = 0, cpu;15401540+ int rv;1540154115411542 for_each_online_cpu(i) {15421543 int rc;···1556155515571556 cpb_capable = true;1558155715591559- register_cpu_notifier(&cpb_nb);15601560-15611558 msrs = msrs_alloc();15621559 if (!msrs) {15631560 printk(KERN_ERR "%s: Error allocating msrs!\n", __func__);15641561 return -ENOMEM;15651562 }15631563+15641564+ register_cpu_notifier(&cpb_nb);1566156515671566 rdmsr_on_cpus(cpu_online_mask, MSR_K7_HWCR, msrs);15681567···15751574 (cpb_enabled ? "on" : "off"));15761575 }1577157615781578- return cpufreq_register_driver(&cpufreq_amd64_driver);15771577+ rv = cpufreq_register_driver(&cpufreq_amd64_driver);15781578+ if (rv < 0 && boot_cpu_has(X86_FEATURE_CPB)) {15791579+ unregister_cpu_notifier(&cpb_nb);15801580+ msrs_free(msrs);15811581+ msrs = NULL;15821582+ }15831583+ return rv;15791584}1580158515811586/* driver entry point for term */
+8-3
arch/x86/kernel/cpu/perf_event_p4.c
···770770 return 1;771771 }772772773773- /* it might be unflagged overflow */774774- rdmsrl(hwc->event_base + hwc->idx, v);775775- if (!(v & ARCH_P4_CNTRVAL_MASK))773773+ /*774774+ * In some circumstances the overflow might issue an NMI but did775775+ * not set P4_CCCR_OVF bit. Because a counter holds a negative value776776+ * we simply check for high bit being set, if it's cleared it means777777+ * the counter has reached zero value and continued counting before778778+ * real NMI signal was received:779779+ */780780+ if (!(v & ARCH_P4_UNFLAGGED_BIT))776781 return 1;777782778783 return 0;
+7-9
arch/x86/kernel/early-quirks.c
···143143144144static u32 __init ati_sbx00_rev(int num, int slot, int func)145145{146146- u32 old, d;146146+ u32 d;147147148148- d = read_pci_config(num, slot, func, 0x70);149149- old = d;150150- d &= ~(1<<8);151151- write_pci_config(num, slot, func, 0x70, d);152148 d = read_pci_config(num, slot, func, 0x8);153149 d &= 0xff;154154- write_pci_config(num, slot, func, 0x70, old);155150156151 return d;157152}···155160{156161 u32 d, rev;157162158158- if (acpi_use_timer_override)163163+ rev = ati_sbx00_rev(num, slot, func);164164+ if (rev >= 0x40)165165+ acpi_fix_pin2_polarity = 1;166166+167167+ if (rev > 0x13)159168 return;160169161161- rev = ati_sbx00_rev(num, slot, func);162162- if (rev > 0x13)170170+ if (acpi_use_timer_override)163171 return;164172165173 /* check for IRQ0 interrupt swap */
···140140 * wasted bootmem) and hand off chunks of it to callers.141141 */142142 res = alloc_bootmem(chunk_size);143143- if (!res)144144- return NULL;143143+ BUG_ON(!res);145144 prom_early_allocated += chunk_size;146145 memset(res, 0, chunk_size);147146 free_mem = chunk_size;
+6-12
block/blk-core.c
···352352 WARN_ON(!irqs_disabled());353353354354 queue_flag_clear(QUEUE_FLAG_STOPPED, q);355355- __blk_run_queue(q);355355+ __blk_run_queue(q, false);356356}357357EXPORT_SYMBOL(blk_start_queue);358358···403403/**404404 * __blk_run_queue - run a single device queue405405 * @q: The queue to run406406+ * @force_kblockd: Don't run @q->request_fn directly. Use kblockd.406407 *407408 * Description:408409 * See @blk_run_queue. This variant must be called with the queue lock409410 * held and interrupts disabled.410411 *411412 */412412-void __blk_run_queue(struct request_queue *q)413413+void __blk_run_queue(struct request_queue *q, bool force_kblockd)413414{414415 blk_remove_plug(q);415416···424423 * Only recurse once to avoid overrunning the stack, let the unplug425424 * handling reinvoke the handler shortly if we already got there.426425 */427427- if (!queue_flag_test_and_set(QUEUE_FLAG_REENTER, q)) {426426+ if (!force_kblockd && !queue_flag_test_and_set(QUEUE_FLAG_REENTER, q)) {428427 q->request_fn(q);429428 queue_flag_clear(QUEUE_FLAG_REENTER, q);430429 } else {···447446 unsigned long flags;448447449448 spin_lock_irqsave(q->queue_lock, flags);450450- __blk_run_queue(q);449449+ __blk_run_queue(q, false);451450 spin_unlock_irqrestore(q->queue_lock, flags);452451}453452EXPORT_SYMBOL(blk_run_queue);···1054105310551054 drive_stat_acct(rq, 1);10561055 __elv_add_request(q, rq, where, 0);10571057- __blk_run_queue(q);10561056+ __blk_run_queue(q, false);10581057 spin_unlock_irqrestore(q->queue_lock, flags);10591058}10601059EXPORT_SYMBOL(blk_insert_request);···26102609 return queue_work(kblockd_workqueue, work);26112610}26122611EXPORT_SYMBOL(kblockd_schedule_work);26132613-26142614-int kblockd_schedule_delayed_work(struct request_queue *q,26152615- struct delayed_work *dwork, unsigned long delay)26162616-{26172617- return queue_delayed_work(kblockd_workqueue, dwork, delay);26182618-}26192619-EXPORT_SYMBOL(kblockd_schedule_delayed_work);2620261226212613int __init blk_dev_init(void)26222614{
+5-3
block/blk-flush.c
···66666767 /*6868 * Moving a request silently to empty queue_head may stall the6969- * queue. Kick the queue in those cases.6969+ * queue. Kick the queue in those cases. This function is called7070+ * from request completion path and calling directly into7171+ * request_fn may confuse the driver. Always use kblockd.7072 */7173 if (was_empty && next_rq)7272- __blk_run_queue(q);7474+ __blk_run_queue(q, true);7375}74767577static void pre_flush_end_io(struct request *rq, int error)···132130 BUG();133131 }134132135135- elv_insert(q, rq, ELEVATOR_INSERT_FRONT);133133+ elv_insert(q, rq, ELEVATOR_INSERT_REQUEUE);136134 return rq;137135}138136
+1-1
block/blk-lib.c
···132132}133133134134/**135135- * blkdev_issue_zeroout generate number of zero filed write bios135135+ * blkdev_issue_zeroout - generate number of zero filed write bios136136 * @bdev: blockdev to issue137137 * @sector: start sector138138 * @nr_sects: number of sectors to write
+18-11
block/blk-throttle.c
···2020/* Throttling is performed over 100ms slice and after that slice is renewed */2121static unsigned long throtl_slice = HZ/10; /* 100 ms */22222323+/* A workqueue to queue throttle related work */2424+static struct workqueue_struct *kthrotld_workqueue;2525+static void throtl_schedule_delayed_work(struct throtl_data *td,2626+ unsigned long delay);2727+2328struct throtl_rb_root {2429 struct rb_root rb;2530 struct rb_node *left;···350345 update_min_dispatch_time(st);351346352347 if (time_before_eq(st->min_disptime, jiffies))353353- throtl_schedule_delayed_work(td->queue, 0);348348+ throtl_schedule_delayed_work(td, 0);354349 else355355- throtl_schedule_delayed_work(td->queue,356356- (st->min_disptime - jiffies));350350+ throtl_schedule_delayed_work(td, (st->min_disptime - jiffies));357351}358352359353static inline void···819815}820816821817/* Call with queue lock held */822822-void throtl_schedule_delayed_work(struct request_queue *q, unsigned long delay)818818+static void819819+throtl_schedule_delayed_work(struct throtl_data *td, unsigned long delay)823820{824821825825- struct throtl_data *td = q->td;826822 struct delayed_work *dwork = &td->throtl_work;827823828824 if (total_nr_queued(td) > 0) {···831827 * Cancel that and schedule a new one.832828 */833829 __cancel_delayed_work(dwork);834834- kblockd_schedule_delayed_work(q, dwork, delay);830830+ queue_delayed_work(kthrotld_workqueue, dwork, delay);835831 throtl_log(td, "schedule work. delay=%lu jiffies=%lu",836832 delay, jiffies);837833 }838834}839839-EXPORT_SYMBOL(throtl_schedule_delayed_work);840835841836static void842837throtl_destroy_tg(struct throtl_data *td, struct throtl_grp *tg)···923920 smp_mb__after_atomic_inc();924921925922 /* Schedule a work now to process the limit change */926926- throtl_schedule_delayed_work(td->queue, 0);923923+ throtl_schedule_delayed_work(td, 0);927924}928925929926static void throtl_update_blkio_group_write_bps(void *key,···937934 smp_mb__before_atomic_inc();938935 atomic_inc(&td->limits_changed);939936 smp_mb__after_atomic_inc();940940- throtl_schedule_delayed_work(td->queue, 0);937937+ throtl_schedule_delayed_work(td, 0);941938}942939943940static void throtl_update_blkio_group_read_iops(void *key,···951948 smp_mb__before_atomic_inc();952949 atomic_inc(&td->limits_changed);953950 smp_mb__after_atomic_inc();954954- throtl_schedule_delayed_work(td->queue, 0);951951+ throtl_schedule_delayed_work(td, 0);955952}956953957954static void throtl_update_blkio_group_write_iops(void *key,···965962 smp_mb__before_atomic_inc();966963 atomic_inc(&td->limits_changed);967964 smp_mb__after_atomic_inc();968968- throtl_schedule_delayed_work(td->queue, 0);965965+ throtl_schedule_delayed_work(td, 0);969966}970967971968void throtl_shutdown_timer_wq(struct request_queue *q)···1138113511391136static int __init throtl_init(void)11401137{11381138+ kthrotld_workqueue = alloc_workqueue("kthrotld", WQ_MEM_RECLAIM, 0);11391139+ if (!kthrotld_workqueue)11401140+ panic("Failed to create kthrotld\n");11411141+11411142 blkio_policy_register(&blkio_policy_throtl);11421143 return 0;11431144}
+3-3
block/cfq-iosched.c
···33553355 cfqd->busy_queues > 1) {33563356 cfq_del_timer(cfqd, cfqq);33573357 cfq_clear_cfqq_wait_request(cfqq);33583358- __blk_run_queue(cfqd->queue);33583358+ __blk_run_queue(cfqd->queue, false);33593359 } else {33603360 cfq_blkiocg_update_idle_time_stats(33613361 &cfqq->cfqg->blkg);···33703370 * this new queue is RT and the current one is BE33713371 */33723372 cfq_preempt_queue(cfqd, cfqq);33733373- __blk_run_queue(cfqd->queue);33733373+ __blk_run_queue(cfqd->queue, false);33743374 }33753375}33763376···37313731 struct request_queue *q = cfqd->queue;3732373237333733 spin_lock_irq(q->queue_lock);37343734- __blk_run_queue(cfqd->queue);37343734+ __blk_run_queue(cfqd->queue, false);37353735 spin_unlock_irq(q->queue_lock);37363736}37373737
+2-2
block/elevator.c
···602602 */603603 elv_drain_elevator(q);604604 while (q->rq.elvpriv) {605605- __blk_run_queue(q);605605+ __blk_run_queue(q, false);606606 spin_unlock_irq(q->queue_lock);607607 msleep(10);608608 spin_lock_irq(q->queue_lock);···651651 * with anything. There's no point in delaying queue652652 * processing.653653 */654654- __blk_run_queue(q);654654+ __blk_run_queue(q, false);655655 break;656656657657 case ELEVATOR_INSERT_SORT:
+1-1
block/genhd.c
···13551355 struct block_device *bdev = bdget_disk(disk, partno);13561356 if (bdev) {13571357 fsync_bdev(bdev);13581358- res = __invalidate_device(bdev);13581358+ res = __invalidate_device(bdev, true);13591359 bdput(bdev);13601360 }13611361 return res;
+5-3
block/ioctl.c
···294294 return -EINVAL;295295 if (get_user(n, (int __user *) arg))296296 return -EFAULT;297297- if (!(mode & FMODE_EXCL) &&298298- blkdev_get(bdev, mode | FMODE_EXCL, &bdev) < 0)299299- return -EBUSY;297297+ if (!(mode & FMODE_EXCL)) {298298+ bdgrab(bdev);299299+ if (blkdev_get(bdev, mode | FMODE_EXCL, &bdev) < 0)300300+ return -EBUSY;301301+ }300302 ret = set_blocksize(bdev, n);301303 if (!(mode & FMODE_EXCL))302304 blkdev_put(bdev, mode | FMODE_EXCL);
+6-1
drivers/acpi/acpica/aclocal.h
···416416 u8 originally_enabled; /* True if GPE was originally enabled */417417};418418419419+struct acpi_gpe_notify_object {420420+ struct acpi_namespace_node *node;421421+ struct acpi_gpe_notify_object *next;422422+};423423+419424union acpi_gpe_dispatch_info {420425 struct acpi_namespace_node *method_node; /* Method node for this GPE level */421426 struct acpi_gpe_handler_info *handler; /* Installed GPE handler */422422- struct acpi_namespace_node *device_node; /* Parent _PRW device for implicit notify */427427+ struct acpi_gpe_notify_object device; /* List of _PRW devices for implicit notify */423428};424429425430/*
+13-4
drivers/acpi/acpica/evgpe.c
···457457 acpi_status status;458458 struct acpi_gpe_event_info *local_gpe_event_info;459459 struct acpi_evaluate_info *info;460460+ struct acpi_gpe_notify_object *notify_object;460461461462 ACPI_FUNCTION_TRACE(ev_asynch_execute_gpe_method);462463···509508 * from this thread -- because handlers may in turn run other510509 * control methods.511510 */512512- status =513513- acpi_ev_queue_notify_request(local_gpe_event_info->dispatch.514514- device_node,515515- ACPI_NOTIFY_DEVICE_WAKE);511511+ status = acpi_ev_queue_notify_request(512512+ local_gpe_event_info->dispatch.device.node,513513+ ACPI_NOTIFY_DEVICE_WAKE);514514+515515+ notify_object = local_gpe_event_info->dispatch.device.next;516516+ while (ACPI_SUCCESS(status) && notify_object) {517517+ status = acpi_ev_queue_notify_request(518518+ notify_object->node,519519+ ACPI_NOTIFY_DEVICE_WAKE);520520+ notify_object = notify_object->next;521521+ }522522+516523 break;517524518525 case ACPI_GPE_DISPATCH_METHOD:
+37-13
drivers/acpi/acpica/evxfgpe.c
···198198 acpi_status status = AE_BAD_PARAMETER;199199 struct acpi_gpe_event_info *gpe_event_info;200200 struct acpi_namespace_node *device_node;201201+ struct acpi_gpe_notify_object *notify_object;201202 acpi_cpu_flags flags;203203+ u8 gpe_dispatch_mask;202204203205 ACPI_FUNCTION_TRACE(acpi_setup_gpe_for_wake);204206···223221 goto unlock_and_exit;224222 }225223224224+ if (wake_device == ACPI_ROOT_OBJECT) {225225+ goto out;226226+ }227227+226228 /*227229 * If there is no method or handler for this GPE, then the228230 * wake_device will be notified whenever this GPE fires (aka229231 * "implicit notify") Note: The GPE is assumed to be230232 * level-triggered (for windows compatibility).231233 */232232- if (((gpe_event_info->flags & ACPI_GPE_DISPATCH_MASK) ==233233- ACPI_GPE_DISPATCH_NONE) && (wake_device != ACPI_ROOT_OBJECT)) {234234-235235- /* Validate wake_device is of type Device */236236-237237- device_node = ACPI_CAST_PTR(struct acpi_namespace_node,238238- wake_device);239239- if (device_node->type != ACPI_TYPE_DEVICE) {240240- goto unlock_and_exit;241241- }242242- gpe_event_info->flags = (ACPI_GPE_DISPATCH_NOTIFY |243243- ACPI_GPE_LEVEL_TRIGGERED);244244- gpe_event_info->dispatch.device_node = device_node;234234+ gpe_dispatch_mask = gpe_event_info->flags & ACPI_GPE_DISPATCH_MASK;235235+ if (gpe_dispatch_mask != ACPI_GPE_DISPATCH_NONE236236+ && gpe_dispatch_mask != ACPI_GPE_DISPATCH_NOTIFY) {237237+ goto out;245238 }246239240240+ /* Validate wake_device is of type Device */241241+242242+ device_node = ACPI_CAST_PTR(struct acpi_namespace_node, wake_device);243243+ if (device_node->type != ACPI_TYPE_DEVICE) {244244+ goto unlock_and_exit;245245+ }246246+247247+ if (gpe_dispatch_mask == ACPI_GPE_DISPATCH_NONE) {248248+ gpe_event_info->flags = (ACPI_GPE_DISPATCH_NOTIFY |249249+ ACPI_GPE_LEVEL_TRIGGERED);250250+ gpe_event_info->dispatch.device.node = device_node;251251+ gpe_event_info->dispatch.device.next = NULL;252252+ } else {253253+ /* There are multiple devices to notify implicitly. */254254+255255+ notify_object = ACPI_ALLOCATE_ZEROED(sizeof(*notify_object));256256+ if (!notify_object) {257257+ status = AE_NO_MEMORY;258258+ goto unlock_and_exit;259259+ }260260+261261+ notify_object->node = device_node;262262+ notify_object->next = gpe_event_info->dispatch.device.next;263263+ gpe_event_info->dispatch.device.next = notify_object;264264+ }265265+266266+ out:247267 gpe_event_info->flags |= ACPI_GPE_CAN_WAKE;248268 status = AE_OK;249269
···773773#else774774 printk(KERN_INFO PFX "You can boot with agp=try_unsupported\n");775775#endif776776+ pci_unregister_driver(&agp_amd64_pci_driver);776777 return -ENODEV;777778 }778779779780 /* First check that we have at least one AMD64 NB */780780- if (!pci_dev_present(amd_nb_misc_ids))781781+ if (!pci_dev_present(amd_nb_misc_ids)) {782782+ pci_unregister_driver(&agp_amd64_pci_driver);781783 return -ENODEV;784784+ }782785783786 /* Look for any AGP bridge */784787 agp_amd64_pci_driver.id_table = agp_amd64_pci_promisc_table;785788 err = driver_attach(&agp_amd64_pci_driver.driver);786786- if (err == 0 && agp_bridges_found == 0)789789+ if (err == 0 && agp_bridges_found == 0) {790790+ pci_unregister_driver(&agp_amd64_pci_driver);787791 err = -ENODEV;792792+ }788793 }789794 return err;790795}
···2121#include <linux/kernel.h>2222#include <linux/pagemap.h>2323#include <linux/agp_backend.h>2424+#include <linux/delay.h>2425#include <asm/smp.h>2526#include "agp.h"2627#include "intel-agp.h"···7170 u32 __iomem *gtt; /* I915G */7271 bool clear_fake_agp; /* on first access via agp, fill with scratch */7372 int num_dcache_entries;7474- union {7575- void __iomem *i9xx_flush_page;7676- void *i8xx_flush_page;7777- };7373+ void __iomem *i9xx_flush_page;7874 char *i81x_gtt_table;7979- struct page *i8xx_page;8075 struct resource ifp_resource;8176 int resource_valid;8277 struct page *scratch_page;···719722720723static void i830_cleanup(void)721724{722722- if (intel_private.i8xx_flush_page) {723723- kunmap(intel_private.i8xx_flush_page);724724- intel_private.i8xx_flush_page = NULL;725725- }726726-727727- __free_page(intel_private.i8xx_page);728728- intel_private.i8xx_page = NULL;729729-}730730-731731-static void intel_i830_setup_flush(void)732732-{733733- /* return if we've already set the flush mechanism up */734734- if (intel_private.i8xx_page)735735- return;736736-737737- intel_private.i8xx_page = alloc_page(GFP_KERNEL);738738- if (!intel_private.i8xx_page)739739- return;740740-741741- intel_private.i8xx_flush_page = kmap(intel_private.i8xx_page);742742- if (!intel_private.i8xx_flush_page)743743- i830_cleanup();744725}745726746727/* The chipset_flush interface needs to get data that has already been···733758 */734759static void i830_chipset_flush(void)735760{736736- unsigned int *pg = intel_private.i8xx_flush_page;761761+ unsigned long timeout = jiffies + msecs_to_jiffies(1000);737762738738- memset(pg, 0, 1024);763763+ /* Forcibly evict everything from the CPU write buffers.764764+ * clflush appears to be insufficient.765765+ */766766+ wbinvd_on_all_cpus();739767740740- if (cpu_has_clflush)741741- clflush_cache_range(pg, 1024);742742- else if (wbinvd_on_all_cpus() != 0)743743- printk(KERN_ERR "Timed out waiting for cache flush.\n");768768+ /* Now we've only seen documents for this magic bit on 855GM,769769+ * we hope it exists for the other gen2 chipsets...770770+ *771771+ * Also works as advertised on my 845G.772772+ */773773+ writel(readl(intel_private.registers+I830_HIC) | (1<<31),774774+ intel_private.registers+I830_HIC);775775+776776+ while (readl(intel_private.registers+I830_HIC) & (1<<31)) {777777+ if (time_after(jiffies, timeout))778778+ break;779779+780780+ udelay(50);781781+ }744782}745783746784static void i830_write_entry(dma_addr_t addr, unsigned int entry,···836848 return -ENOMEM;837849838850 intel_private.gtt_bus_addr = reg_addr + I810_PTE_BASE;839839-840840- intel_i830_setup_flush();841851842852 return 0;843853}
···7878static int ipwireless_probe(struct pcmcia_device *p_dev, void *priv_data)7979{8080 struct ipw_dev *ipw = priv_data;8181- struct resource *io_resource;8281 int ret;83828483 p_dev->resource[0]->flags &= ~IO_DATA_PATH_WIDTH;···9192 if (ret)9293 return ret;93949494- io_resource = request_region(p_dev->resource[0]->start,9595- resource_size(p_dev->resource[0]),9696- IPWIRELESS_PCCARD_NAME);9595+ if (!request_region(p_dev->resource[0]->start,9696+ resource_size(p_dev->resource[0]),9797+ IPWIRELESS_PCCARD_NAME)) {9898+ ret = -EBUSY;9999+ goto exit;100100+ }9710198102 p_dev->resource[2]->flags |=99103 WIN_DATA_WIDTH_16 | WIN_MEMORY_TYPE_CM | WIN_ENABLE;···107105108106 ret = pcmcia_map_mem_page(p_dev, p_dev->resource[2], p_dev->card_addr);109107 if (ret != 0)110110- goto exit2;108108+ goto exit1;111109112110 ipw->is_v2_card = resource_size(p_dev->resource[2]) == 0x100;113111114114- ipw->attr_memory = ioremap(p_dev->resource[2]->start,112112+ ipw->common_memory = ioremap(p_dev->resource[2]->start,115113 resource_size(p_dev->resource[2]));116116- request_mem_region(p_dev->resource[2]->start,117117- resource_size(p_dev->resource[2]),118118- IPWIRELESS_PCCARD_NAME);114114+ if (!request_mem_region(p_dev->resource[2]->start,115115+ resource_size(p_dev->resource[2]),116116+ IPWIRELESS_PCCARD_NAME)) {117117+ ret = -EBUSY;118118+ goto exit2;119119+ }119120120121 p_dev->resource[3]->flags |= WIN_DATA_WIDTH_16 | WIN_MEMORY_TYPE_AM |121122 WIN_ENABLE;122123 p_dev->resource[3]->end = 0; /* this used to be 0x1000 */123124 ret = pcmcia_request_window(p_dev, p_dev->resource[3], 0);124125 if (ret != 0)125125- goto exit2;126126+ goto exit3;126127127128 ret = pcmcia_map_mem_page(p_dev, p_dev->resource[3], 0);128129 if (ret != 0)···133128134129 ipw->attr_memory = ioremap(p_dev->resource[3]->start,135130 resource_size(p_dev->resource[3]));136136- request_mem_region(p_dev->resource[3]->start,137137- resource_size(p_dev->resource[3]),138138- IPWIRELESS_PCCARD_NAME);131131+ if (!request_mem_region(p_dev->resource[3]->start,132132+ resource_size(p_dev->resource[3]),133133+ IPWIRELESS_PCCARD_NAME)) {134134+ ret = -EBUSY;135135+ goto exit4;136136+ }139137140138 return 0;141139140140+exit4:141141+ iounmap(ipw->attr_memory);142142exit3:143143+ release_mem_region(p_dev->resource[2]->start,144144+ resource_size(p_dev->resource[2]));143145exit2:144144- if (ipw->common_memory) {145145- release_mem_region(p_dev->resource[2]->start,146146- resource_size(p_dev->resource[2]));147147- iounmap(ipw->common_memory);148148- }146146+ iounmap(ipw->common_memory);149147exit1:150150- release_resource(io_resource);148148+ release_region(p_dev->resource[0]->start,149149+ resource_size(p_dev->resource[0]));150150+exit:151151 pcmcia_disable_device(p_dev);152152- return -1;152152+ return ret;153153}154154155155static int config_ipwireless(struct ipw_dev *ipw)···229219230220static void release_ipwireless(struct ipw_dev *ipw)231221{222222+ release_region(ipw->link->resource[0]->start,223223+ resource_size(ipw->link->resource[0]));232224 if (ipw->common_memory) {233225 release_mem_region(ipw->link->resource[2]->start,234226 resource_size(ipw->link->resource[2]));
+4-6
drivers/char/tpm/tpm.c
···364364 tpm_protected_ordinal_duration[ordinal &365365 TPM_PROTECTED_ORDINAL_MASK];366366367367- if (duration_idx != TPM_UNDEFINED) {367367+ if (duration_idx != TPM_UNDEFINED)368368 duration = chip->vendor.duration[duration_idx];369369- /* if duration is 0, it's because chip->vendor.duration wasn't */370370- /* filled yet, so we set the lowest timeout just to give enough */371371- /* time for tpm_get_timeouts() to succeed */372372- return (duration <= 0 ? HZ : duration);373373- } else369369+ if (duration <= 0)374370 return 2 * 60 * HZ;371371+ else372372+ return duration;375373}376374EXPORT_SYMBOL_GPL(tpm_calc_ordinal_duration);377375
+8
drivers/char/virtio_console.c
···388388 unsigned int len;389389 int ret;390390391391+ if (!port->portdev) {392392+ /* Device has been unplugged. vqs are already gone. */393393+ return;394394+ }391395 vq = port->in_vq;392396 if (port->inbuf)393397 buf = port->inbuf;···474470 void *buf;475471 unsigned int len;476472473473+ if (!port->portdev) {474474+ /* Device has been unplugged. vqs are already gone. */475475+ return;476476+ }477477 while ((buf = virtqueue_get_buf(port->out_vq, &len))) {478478 kfree(buf);479479 port->outvq_full = false;
+15-12
drivers/cpufreq/cpufreq.c
···1919191919201920 ret = sysdev_driver_register(&cpu_sysdev_class,19211921 &cpufreq_sysdev_driver);19221922+ if (ret)19231923+ goto err_null_driver;1922192419231923- if ((!ret) && !(cpufreq_driver->flags & CPUFREQ_STICKY)) {19251925+ if (!(cpufreq_driver->flags & CPUFREQ_STICKY)) {19241926 int i;19251927 ret = -ENODEV;19261928···19371935 if (ret) {19381936 dprintk("no CPU initialized for driver %s\n",19391937 driver_data->name);19401940- sysdev_driver_unregister(&cpu_sysdev_class,19411941- &cpufreq_sysdev_driver);19421942-19431943- spin_lock_irqsave(&cpufreq_driver_lock, flags);19441944- cpufreq_driver = NULL;19451945- spin_unlock_irqrestore(&cpufreq_driver_lock, flags);19381938+ goto err_sysdev_unreg;19461939 }19471940 }1948194119491949- if (!ret) {19501950- register_hotcpu_notifier(&cpufreq_cpu_notifier);19511951- dprintk("driver %s up and running\n", driver_data->name);19521952- cpufreq_debug_enable_ratelimit();19531953- }19421942+ register_hotcpu_notifier(&cpufreq_cpu_notifier);19431943+ dprintk("driver %s up and running\n", driver_data->name);19441944+ cpufreq_debug_enable_ratelimit();1954194519461946+ return 0;19471947+err_sysdev_unreg:19481948+ sysdev_driver_unregister(&cpu_sysdev_class,19491949+ &cpufreq_sysdev_driver);19501950+err_null_driver:19511951+ spin_lock_irqsave(&cpufreq_driver_lock, flags);19521952+ cpufreq_driver = NULL;19531953+ spin_unlock_irqrestore(&cpufreq_driver_lock, flags);19551954 return ret;19561955}19571956EXPORT_SYMBOL_GPL(cpufreq_register_driver);
+2-2
drivers/gpu/drm/drm_fb_helper.c
···672672 struct drm_crtc_helper_funcs *crtc_funcs;673673 u16 *red, *green, *blue, *transp;674674 struct drm_crtc *crtc;675675- int i, rc = 0;675675+ int i, j, rc = 0;676676 int start;677677678678 for (i = 0; i < fb_helper->crtc_count; i++) {···685685 transp = cmap->transp;686686 start = cmap->start;687687688688- for (i = 0; i < cmap->len; i++) {688688+ for (j = 0; j < cmap->len; j++) {689689 u16 hred, hgreen, hblue, htransp = 0xffff;690690691691 hred = *red++;
+16-13
drivers/gpu/drm/drm_irq.c
···164164 * available. In that case we can't account for this and just165165 * hope for the best.166166 */167167- if ((vblrc > 0) && (abs(diff_ns) > 1000000))167167+ if ((vblrc > 0) && (abs64(diff_ns) > 1000000)) {168168 atomic_inc(&dev->_vblank_count[crtc]);169169+ smp_mb__after_atomic_inc();170170+ }169171170172 /* Invalidate all timestamps while vblank irq's are off. */171173 clear_vblank_timestamps(dev, crtc);···493491 /* Dot clock in Hz: */494492 dotclock = (u64) crtc->hwmode.clock * 1000;495493494494+ /* Fields of interlaced scanout modes are only halve a frame duration.495495+ * Double the dotclock to get halve the frame-/line-/pixelduration.496496+ */497497+ if (crtc->hwmode.flags & DRM_MODE_FLAG_INTERLACE)498498+ dotclock *= 2;499499+496500 /* Valid dotclock? */497501 if (dotclock > 0) {498502 /* Convert scanline length in pixels and video dot clock to···609601 if (vtotal <= 0 || vdisplay <= 0 || framedur_ns == 0) {610602 DRM_DEBUG("crtc %d: Noop due to uninitialized mode.\n", crtc);611603 return -EAGAIN;612612- }613613-614614- /* Don't know yet how to handle interlaced or615615- * double scan modes. Just no-op for now.616616- */617617- if (mode->flags & (DRM_MODE_FLAG_INTERLACE | DRM_MODE_FLAG_DBLSCAN)) {618618- DRM_DEBUG("crtc %d: Noop due to unsupported mode.\n", crtc);619619- return -ENOTSUPP;620604 }621605622606 /* Get current scanout position with system timestamp.···858858 if (rc) {859859 tslot = atomic_read(&dev->_vblank_count[crtc]) + diff;860860 vblanktimestamp(dev, crtc, tslot) = t_vblank;861861- smp_wmb();862861 }863862863863+ smp_mb__before_atomic_inc();864864 atomic_add(diff, &dev->_vblank_count[crtc]);865865+ smp_mb__after_atomic_inc();865866}866867867868/**···10121011 struct drm_file *file_priv)10131012{10141013 struct drm_modeset_ctl *modeset = data;10151015- int crtc, ret = 0;10141014+ int ret = 0;10151015+ unsigned int crtc;1016101610171017 /* If drm_vblank_init() hasn't been called yet, just no-op */10181018 if (!dev->num_crtcs)···12951293 * e.g., due to spurious vblank interrupts. We need to12961294 * ignore those for accounting.12971295 */12981298- if (abs(diff_ns) > DRM_REDUNDANT_VBLIRQ_THRESH_NS) {12961296+ if (abs64(diff_ns) > DRM_REDUNDANT_VBLIRQ_THRESH_NS) {12991297 /* Store new timestamp in ringbuffer. */13001298 vblanktimestamp(dev, crtc, vblcount + 1) = tvblank;13011301- smp_wmb();1302129913031300 /* Increment cooked vblank count. This also atomically commits13041301 * the timestamp computed above.13051302 */13031303+ smp_mb__before_atomic_inc();13061304 atomic_inc(&dev->_vblank_count[crtc]);13051305+ smp_mb__after_atomic_inc();13071306 } else {13081307 DRM_DEBUG("crtc %d: Redundant vblirq ignored. diff_ns = %d\n",13091308 crtc, (int) diff_ns);
+2-2
drivers/gpu/drm/i915/i915_debugfs.c
···865865 int max_freq;866866867867 /* RPSTAT1 is in the GT power well */868868- __gen6_force_wake_get(dev_priv);868868+ __gen6_gt_force_wake_get(dev_priv);869869870870 seq_printf(m, "GT_PERF_STATUS: 0x%08x\n", gt_perf_status);871871 seq_printf(m, "RPSTAT1: 0x%08x\n", I915_READ(GEN6_RPSTAT1));···888888 seq_printf(m, "Max non-overclocked (RP0) frequency: %dMHz\n",889889 max_freq * 100);890890891891- __gen6_force_wake_put(dev_priv);891891+ __gen6_gt_force_wake_put(dev_priv);892892 } else {893893 seq_printf(m, "no P-state info available\n");894894 }
+11
drivers/gpu/drm/i915/i915_dma.c
···18951895 if (IS_GEN2(dev))18961896 dma_set_coherent_mask(&dev->pdev->dev, DMA_BIT_MASK(30));1897189718981898+ /* 965GM sometimes incorrectly writes to hardware status page (HWS)18991899+ * using 32bit addressing, overwriting memory if HWS is located19001900+ * above 4GB.19011901+ *19021902+ * The documentation also mentions an issue with undefined19031903+ * behaviour if any general state is accessed within a page above 4GB,19041904+ * which also needs to be handled carefully.19051905+ */19061906+ if (IS_BROADWATER(dev) || IS_CRESTLINE(dev))19071907+ dma_set_coherent_mask(&dev->pdev->dev, DMA_BIT_MASK(32));19081908+18981909 mmio_bar = IS_GEN2(dev) ? 1 : 0;18991910 dev_priv->regs = pci_iomap(dev->pdev, mmio_bar, 0);19001911 if (!dev_priv->regs) {
+15-2
drivers/gpu/drm/i915/i915_drv.c
···4646unsigned int i915_powersave = 1;4747module_param_named(powersave, i915_powersave, int, 0600);48484949+unsigned int i915_semaphores = 0;5050+module_param_named(semaphores, i915_semaphores, int, 0600);5151+4952unsigned int i915_enable_rc6 = 0;5053module_param_named(i915_enable_rc6, i915_enable_rc6, int, 0600);5154···257254 }258255}259256260260-void __gen6_force_wake_get(struct drm_i915_private *dev_priv)257257+void __gen6_gt_force_wake_get(struct drm_i915_private *dev_priv)261258{262259 int count;263260···273270 udelay(10);274271}275272276276-void __gen6_force_wake_put(struct drm_i915_private *dev_priv)273273+void __gen6_gt_force_wake_put(struct drm_i915_private *dev_priv)277274{278275 I915_WRITE_NOTRACE(FORCEWAKE, 0);279276 POSTING_READ(FORCEWAKE);277277+}278278+279279+void __gen6_gt_wait_for_fifo(struct drm_i915_private *dev_priv)280280+{281281+ int loop = 500;282282+ u32 fifo = I915_READ_NOTRACE(GT_FIFO_FREE_ENTRIES);283283+ while (fifo < 20 && loop--) {284284+ udelay(10);285285+ fifo = I915_READ_NOTRACE(GT_FIFO_FREE_ENTRIES);286286+ }280287}281288282289static int i915_drm_freeze(struct drm_device *dev)
+19-5
drivers/gpu/drm/i915/i915_drv.h
···956956extern int i915_max_ioctl;957957extern unsigned int i915_fbpercrtc;958958extern unsigned int i915_powersave;959959+extern unsigned int i915_semaphores;959960extern unsigned int i915_lvds_downclock;960961extern unsigned int i915_panel_use_ssc;961962extern unsigned int i915_enable_rc6;···11781177void i915_gem_free_all_phys_object(struct drm_device *dev);11791178void i915_gem_release(struct drm_device *dev, struct drm_file *file);1180117911801180+uint32_t11811181+i915_gem_get_unfenced_gtt_alignment(struct drm_i915_gem_object *obj);11821182+11811183/* i915_gem_gtt.c */11821184void i915_gem_restore_gtt_mappings(struct drm_device *dev);11831185int __must_check i915_gem_gtt_bind_object(struct drm_i915_gem_object *obj);···13571353 * must be set to prevent GT core from power down and stale values being13581354 * returned.13591355 */13601360-void __gen6_force_wake_get(struct drm_i915_private *dev_priv);13611361-void __gen6_force_wake_put (struct drm_i915_private *dev_priv);13621362-static inline u32 i915_safe_read(struct drm_i915_private *dev_priv, u32 reg)13561356+void __gen6_gt_force_wake_get(struct drm_i915_private *dev_priv);13571357+void __gen6_gt_force_wake_put(struct drm_i915_private *dev_priv);13581358+void __gen6_gt_wait_for_fifo(struct drm_i915_private *dev_priv);13591359+13601360+static inline u32 i915_gt_read(struct drm_i915_private *dev_priv, u32 reg)13631361{13641362 u32 val;1365136313661364 if (dev_priv->info->gen >= 6) {13671367- __gen6_force_wake_get(dev_priv);13651365+ __gen6_gt_force_wake_get(dev_priv);13681366 val = I915_READ(reg);13691369- __gen6_force_wake_put(dev_priv);13671367+ __gen6_gt_force_wake_put(dev_priv);13701368 } else13711369 val = I915_READ(reg);1372137013731371 return val;13721372+}13731373+13741374+static inline void i915_gt_write(struct drm_i915_private *dev_priv,13751375+ u32 reg, u32 val)13761376+{13771377+ if (dev_priv->info->gen >= 6)13781378+ __gen6_gt_wait_for_fifo(dev_priv);13791379+ I915_WRITE(reg, val);13741380}1375138113761382static inline void
+1-1
drivers/gpu/drm/i915/i915_gem.c
···13981398 * Return the required GTT alignment for an object, only taking into account13991399 * unfenced tiled surface requirements.14001400 */14011401-static uint32_t14011401+uint32_t14021402i915_gem_get_unfenced_gtt_alignment(struct drm_i915_gem_object *obj)14031403{14041404 struct drm_device *dev = obj->base.dev;
+2-2
drivers/gpu/drm/i915/i915_gem_execbuffer.c
···772772 if (from == NULL || to == from)773773 return 0;774774775775- /* XXX gpu semaphores are currently causing hard hangs on SNB mobile */776776- if (INTEL_INFO(obj->base.dev)->gen < 6 || IS_MOBILE(obj->base.dev))775775+ /* XXX gpu semaphores are implicated in various hard hangs on SNB */776776+ if (INTEL_INFO(obj->base.dev)->gen < 6 || !i915_semaphores)777777 return i915_gem_object_wait_rendering(obj, true);778778779779 idx = intel_ring_sync_index(from, to);
+17-4
drivers/gpu/drm/i915/i915_gem_tiling.c
···349349 (obj->gtt_offset + obj->base.size <= dev_priv->mm.gtt_mappable_end &&350350 i915_gem_object_fence_ok(obj, args->tiling_mode));351351352352- obj->tiling_changed = true;353353- obj->tiling_mode = args->tiling_mode;354354- obj->stride = args->stride;352352+ /* Rebind if we need a change of alignment */353353+ if (!obj->map_and_fenceable) {354354+ u32 unfenced_alignment =355355+ i915_gem_get_unfenced_gtt_alignment(obj);356356+ if (obj->gtt_offset & (unfenced_alignment - 1))357357+ ret = i915_gem_object_unbind(obj);358358+ }359359+360360+ if (ret == 0) {361361+ obj->tiling_changed = true;362362+ obj->tiling_mode = args->tiling_mode;363363+ obj->stride = args->stride;364364+ }355365 }366366+ /* we have to maintain this existing ABI... */367367+ args->stride = obj->stride;368368+ args->tiling_mode = obj->tiling_mode;356369 drm_gem_object_unreference(&obj->base);357370 mutex_unlock(&dev->struct_mutex);358371359359- return 0;372372+ return ret;360373}361374362375/**
···6262 stream interface.6363 If synchronous service was requested, then function6464 does return amount of data written to stream.6565- 'final' does indicate that pice of data to be written is6565+ 'final' does indicate that piece of data to be written is6666 final part of frame (necessary only by structured datatransfer)6767 return 0 if zero lengh packet was written6868 return -1 if stream is full
-1
drivers/md/linear.c
···216216217217 if (md_check_no_bitmap(mddev))218218 return -EINVAL;219219- mddev->queue->queue_lock = &mddev->queue->__queue_lock;220219 conf = linear_conf(mddev, mddev->raid_disks);221220222221 if (!conf)
···274274 atomic_t active; /* general refcount */275275 atomic_t openers; /* number of active opens */276276277277+ int changed; /* True if we might need to278278+ * reread partition info */277279 int degraded; /* whether md should consider278280 * adding a spare279281 */
-1
drivers/md/multipath.c
···435435 * bookkeeping area. [whatever we allocate in multipath_run(),436436 * should be freed in multipath_stop()]437437 */438438- mddev->queue->queue_lock = &mddev->queue->__queue_lock;439438440439 conf = kzalloc(sizeof(multipath_conf_t), GFP_KERNEL);441440 mddev->private = conf;
+1-1
drivers/md/raid0.c
···361361 if (md_check_no_bitmap(mddev))362362 return -EINVAL;363363 blk_queue_max_hw_sectors(mddev->queue, mddev->chunk_sectors);364364- mddev->queue->queue_lock = &mddev->queue->__queue_lock;365364366365 /* if private is not null, we are here after takeover */367366 if (mddev->private == NULL) {···669670 mddev->new_layout = 0;670671 mddev->new_chunk_sectors = 128; /* by default set chunk size to 64k */671672 mddev->delta_disks = 1 - mddev->raid_disks;673673+ mddev->raid_disks = 1;672674 /* make sure it will be not marked as dirty */673675 mddev->recovery_cp = MaxSector;674676
+4-2
drivers/md/raid1.c
···593593 if (conf->pending_bio_list.head) {594594 struct bio *bio;595595 bio = bio_list_get(&conf->pending_bio_list);596596+ /* Only take the spinlock to quiet a warning */597597+ spin_lock(conf->mddev->queue->queue_lock);596598 blk_remove_plug(conf->mddev->queue);599599+ spin_unlock(conf->mddev->queue->queue_lock);597600 spin_unlock_irq(&conf->device_lock);598601 /* flush any pending bitmap writes to599602 * disk before proceeding w/ I/O */···962959 atomic_inc(&r1_bio->remaining);963960 spin_lock_irqsave(&conf->device_lock, flags);964961 bio_list_add(&conf->pending_bio_list, mbio);965965- blk_plug_device(mddev->queue);962962+ blk_plug_device_unlocked(mddev->queue);966963 spin_unlock_irqrestore(&conf->device_lock, flags);967964 }968965 r1_bio_write_done(r1_bio, bio->bi_vcnt, behind_pages, behind_pages != NULL);···20242021 if (IS_ERR(conf))20252022 return PTR_ERR(conf);2026202320272027- mddev->queue->queue_lock = &conf->device_lock;20282024 list_for_each_entry(rdev, &mddev->disks, same_set) {20292025 disk_stack_limits(mddev->gendisk, rdev->bdev,20302026 rdev->data_offset << 9);
+4-3
drivers/md/raid10.c
···662662 if (conf->pending_bio_list.head) {663663 struct bio *bio;664664 bio = bio_list_get(&conf->pending_bio_list);665665+ /* Spinlock only taken to quiet a warning */666666+ spin_lock(conf->mddev->queue->queue_lock);665667 blk_remove_plug(conf->mddev->queue);668668+ spin_unlock(conf->mddev->queue->queue_lock);666669 spin_unlock_irq(&conf->device_lock);667670 /* flush any pending bitmap writes to disk668671 * before proceeding w/ I/O */···974971 atomic_inc(&r10_bio->remaining);975972 spin_lock_irqsave(&conf->device_lock, flags);976973 bio_list_add(&conf->pending_bio_list, mbio);977977- blk_plug_device(mddev->queue);974974+ blk_plug_device_unlocked(mddev->queue);978975 spin_unlock_irqrestore(&conf->device_lock, flags);979976 }980977···23062303 conf = mddev->private;23072304 if (!conf)23082305 goto out;23092309-23102310- mddev->queue->queue_lock = &conf->device_lock;2311230623122307 mddev->thread = conf->thread;23132308 conf->thread = NULL;
···150150static inline int __tps6586x_writes(struct i2c_client *client, int reg,151151 int len, uint8_t *val)152152{153153- int ret;153153+ int ret, i;154154155155- ret = i2c_smbus_write_i2c_block_data(client, reg, len, val);156156- if (ret < 0) {157157- dev_err(&client->dev, "failed writings to 0x%02x\n", reg);158158- return ret;155155+ for (i = 0; i < len; i++) {156156+ ret = __tps6586x_write(client, reg + i, *(val + i));157157+ if (ret < 0)158158+ return ret;159159 }160160161161 return 0;
···246246 struct wm8994 *wm8994 = dev_get_drvdata(dev);247247 int ret;248248249249+ /* Don't actually go through with the suspend if the CODEC is250250+ * still active (eg, for audio passthrough from CP. */251251+ ret = wm8994_reg_read(wm8994, WM8994_POWER_MANAGEMENT_1);252252+ if (ret < 0) {253253+ dev_err(dev, "Failed to read power status: %d\n", ret);254254+ } else if (ret & WM8994_VMID_SEL_MASK) {255255+ dev_dbg(dev, "CODEC still active, ignoring suspend\n");256256+ return 0;257257+ }258258+249259 /* GPIO configuration state is saved here since we may be configuring250260 * the GPIO alternate functions even if we're not using the gpiolib251261 * driver for them.···271261 if (ret < 0)272262 dev_err(dev, "Failed to save LDO registers: %d\n", ret);273263264264+ wm8994->suspended = true;265265+274266 ret = regulator_bulk_disable(wm8994->num_supplies,275267 wm8994->supplies);276268 if (ret != 0) {···287275{288276 struct wm8994 *wm8994 = dev_get_drvdata(dev);289277 int ret;278278+279279+ /* We may have lied to the PM core about suspending */280280+ if (!wm8994->suspended)281281+ return 0;290282291283 ret = regulator_bulk_enable(wm8994->num_supplies,292284 wm8994->supplies);···313297 &wm8994->gpio_regs);314298 if (ret < 0)315299 dev_err(dev, "Failed to restore GPIO registers: %d\n", ret);300300+301301+ wm8994->suspended = false;316302317303 return 0;318304}
···2222 * (you will need to reboot afterwards) */2323/* #define BNX2X_STOP_ON_ERROR */24242525-#define DRV_MODULE_VERSION "1.62.00-5"2525+#define DRV_MODULE_VERSION "1.62.00-6"2626#define DRV_MODULE_RELDATE "2011/01/30"2727#define BNX2X_BC_VER 0x0402002828···16131613#define BNX2X_BTR 416141614#define MAX_SPQ_PENDING 81615161516161616-16171617-/* CMNG constants16181618- derived from lab experiments, and not from system spec calculations !!! */16191619-#define DEF_MIN_RATE 10016161616+/* CMNG constants, as derived from system spec calculations */16171617+/* default MIN rate in case VNIC min rate is configured to zero - 100Mbps */16181618+#define DEF_MIN_RATE 10016201619/* resolution of the rate shaping timer - 100 usec */16211621-#define RS_PERIODIC_TIMEOUT_USEC 10016221622-/* resolution of fairness algorithm in usecs -16231623- coefficient for calculating the actual t fair */16241624-#define T_FAIR_COEF 1000000016201620+#define RS_PERIODIC_TIMEOUT_USEC 10016251621/* number of bytes in single QM arbitration cycle -16261626- coefficient for calculating the fairness timer */16271627-#define QM_ARB_BYTES 4000016281628-#define FAIR_MEM 216221622+ * coefficient for calculating the fairness timer */16231623+#define QM_ARB_BYTES 16000016241624+/* resolution of Min algorithm 1:100 */16251625+#define MIN_RES 10016261626+/* how many bytes above threshold for the minimal credit of Min algorithm*/16271627+#define MIN_ABOVE_THRESH 3276816281628+/* Fairness algorithm integration time coefficient -16291629+ * for calculating the actual Tfair */16301630+#define T_FAIR_COEF ((MIN_ABOVE_THRESH + QM_ARB_BYTES) * 8 * MIN_RES)16311631+/* Memory of fairness algorithm . 2 cycles */16321632+#define FAIR_MEM 2162916331630163416311635#define ATTN_NIG_FOR_FUNC (1L << 8)
+51-14
drivers/net/bnx2x/bnx2x_cmn.c
···259259#endif260260}261261262262+/* Timestamp option length allowed for TPA aggregation:263263+ *264264+ * nop nop kind length echo val265265+ */266266+#define TPA_TSTAMP_OPT_LEN 12267267+/**268268+ * Calculate the approximate value of the MSS for this269269+ * aggregation using the first packet of it.270270+ *271271+ * @param bp272272+ * @param parsing_flags Parsing flags from the START CQE273273+ * @param len_on_bd Total length of the first packet for the274274+ * aggregation.275275+ */276276+static inline u16 bnx2x_set_lro_mss(struct bnx2x *bp, u16 parsing_flags,277277+ u16 len_on_bd)278278+{279279+ /* TPA arrgregation won't have an IP options and TCP options280280+ * other than timestamp.281281+ */282282+ u16 hdrs_len = ETH_HLEN + sizeof(struct iphdr) + sizeof(struct tcphdr);283283+284284+285285+ /* Check if there was a TCP timestamp, if there is it's will286286+ * always be 12 bytes length: nop nop kind length echo val.287287+ *288288+ * Otherwise FW would close the aggregation.289289+ */290290+ if (parsing_flags & PARSING_FLAGS_TIME_STAMP_EXIST_FLAG)291291+ hdrs_len += TPA_TSTAMP_OPT_LEN;292292+293293+ return len_on_bd - hdrs_len;294294+}295295+262296static int bnx2x_fill_frag_skb(struct bnx2x *bp, struct bnx2x_fastpath *fp,263297 struct sk_buff *skb,264298 struct eth_fast_path_rx_cqe *fp_cqe,265265- u16 cqe_idx)299299+ u16 cqe_idx, u16 parsing_flags)266300{267301 struct sw_rx_page *rx_pg, old_rx_pg;268302 u16 len_on_bd = le16_to_cpu(fp_cqe->len_on_bd);···309275310276 /* This is needed in order to enable forwarding support */311277 if (frag_size)312312- skb_shinfo(skb)->gso_size = min((u32)SGE_PAGE_SIZE,313313- max(frag_size, (u32)len_on_bd));278278+ skb_shinfo(skb)->gso_size = bnx2x_set_lro_mss(bp, parsing_flags,279279+ len_on_bd);314280315281#ifdef BNX2X_STOP_ON_ERROR316282 if (pages > min_t(u32, 8, MAX_SKB_FRAGS)*SGE_PAGE_SIZE*PAGES_PER_SGE) {···378344 if (likely(new_skb)) {379345 /* fix ip xsum and give it to the stack */380346 /* (no need to map the new skb) */347347+ u16 parsing_flags =348348+ le16_to_cpu(cqe->fast_path_cqe.pars_flags.flags);381349382350 prefetch(skb);383351 prefetch(((char *)(skb)) + L1_CACHE_BYTES);···409373 }410374411375 if (!bnx2x_fill_frag_skb(bp, fp, skb,412412- &cqe->fast_path_cqe, cqe_idx)) {413413- if ((le16_to_cpu(cqe->fast_path_cqe.414414- pars_flags.flags) & PARSING_FLAGS_VLAN))376376+ &cqe->fast_path_cqe, cqe_idx,377377+ parsing_flags)) {378378+ if (parsing_flags & PARSING_FLAGS_VLAN)415379 __vlan_hwaccel_put_tag(skb,416380 le16_to_cpu(cqe->fast_path_cqe.417381 vlan_tag));···739703{740704 u16 line_speed = bp->link_vars.line_speed;741705 if (IS_MF(bp)) {742742- u16 maxCfg = (bp->mf_config[BP_VN(bp)] &743743- FUNC_MF_CFG_MAX_BW_MASK) >>744744- FUNC_MF_CFG_MAX_BW_SHIFT;745745- /* Calculate the current MAX line speed limit for the DCC746746- * capable devices706706+ u16 maxCfg = bnx2x_extract_max_cfg(bp,707707+ bp->mf_config[BP_VN(bp)]);708708+709709+ /* Calculate the current MAX line speed limit for the MF710710+ * devices747711 */748748- if (IS_MF_SD(bp)) {712712+ if (IS_MF_SI(bp))713713+ line_speed = (line_speed * maxCfg) / 100;714714+ else { /* SD mode */749715 u16 vn_max_rate = maxCfg * 100;750716751717 if (vn_max_rate < line_speed)752718 line_speed = vn_max_rate;753753- } else /* IS_MF_SI(bp)) */754754- line_speed = (line_speed * maxCfg) / 100;719719+ }755720 }756721757722 return line_speed;
···238238 speed |= (cmd->speed_hi << 16);239239240240 if (IS_MF_SI(bp)) {241241- u32 param = 0;241241+ u32 param = 0, part;242242 u32 line_speed = bp->link_vars.line_speed;243243244244 /* use 10G if no link detected */···251251 REQ_BC_VER_4_SET_MF_BW);252252 return -EINVAL;253253 }254254- if (line_speed < speed) {255255- BNX2X_DEV_INFO("New speed should be less or equal "256256- "to actual line speed\n");254254+ part = (speed * 100) / line_speed;255255+ if (line_speed < speed || !part) {256256+ BNX2X_DEV_INFO("Speed setting should be in a range "257257+ "from 1%% to 100%% "258258+ "of actual line speed\n");257259 return -EINVAL;258260 }259261 /* load old values */···265263 param &= FUNC_MF_CFG_MIN_BW_MASK;266264267265 /* set new MAX value */268268- param |= (((speed * 100) / line_speed)269269- << FUNC_MF_CFG_MAX_BW_SHIFT)266266+ param |= (part << FUNC_MF_CFG_MAX_BW_SHIFT)270267 & FUNC_MF_CFG_MAX_BW_MASK;271268272269 bnx2x_fw_command(bp, DRV_MSG_CODE_SET_MF_BW, param);···17821781 { 0x100, 0x350 }, /* manuf_info */17831782 { 0x450, 0xf0 }, /* feature_info */17841783 { 0x640, 0x64 }, /* upgrade_key_info */17851785- { 0x6a4, 0x64 },17861784 { 0x708, 0x70 }, /* manuf_key_info */17871787- { 0x778, 0x70 },17881785 { 0, 0 }17891786 };17901787 __be32 buf[0x350 / 4];···19321933 buf[4] = 1;19331934 etest->flags |= ETH_TEST_FL_FAILED;19341935 }19351935- if (bp->port.pmf)19361936- if (bnx2x_link_test(bp, is_serdes) != 0) {19371937- buf[5] = 1;19381938- etest->flags |= ETH_TEST_FL_FAILED;19391939- }19361936+19371937+ if (bnx2x_link_test(bp, is_serdes) != 0) {19381938+ buf[5] = 1;19391939+ etest->flags |= ETH_TEST_FL_FAILED;19401940+ }1940194119411942#ifdef BNX2X_EXTRA_DEBUG19421943 bnx2x_panic_dump(bp);
+1-1
drivers/net/bnx2x/bnx2x_init.h
···241241 /* Block IGU, MISC, PXP and PXP2 parity errors as long as we don't242242 * want to handle "system kill" flow at the moment.243243 */244244- BLOCK_PRTY_INFO(PXP, 0x3ffffff, 0x3ffffff, 0x3ffffff, 0x3ffffff),244244+ BLOCK_PRTY_INFO(PXP, 0x7ffffff, 0x3ffffff, 0x3ffffff, 0x7ffffff),245245 BLOCK_PRTY_INFO_0(PXP2, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff),246246 BLOCK_PRTY_INFO_1(PXP2, 0x7ff, 0x7f, 0x7f, 0x7ff),247247 BLOCK_PRTY_INFO(HC, 0x7, 0x7, 0x7, 0),
+14-4
drivers/net/bnx2x/bnx2x_main.c
···19741974 vn_max_rate = 0;1975197519761976 } else {19771977+ u32 maxCfg = bnx2x_extract_max_cfg(bp, vn_cfg);19781978+19771979 vn_min_rate = ((vn_cfg & FUNC_MF_CFG_MIN_BW_MASK) >>19781980 FUNC_MF_CFG_MIN_BW_SHIFT) * 100;19791979- /* If min rate is zero - set it to 1 */19811981+ /* If fairness is enabled (not all min rates are zeroes) and19821982+ if current min rate is zero - set it to 1.19831983+ This is a requirement of the algorithm. */19801984 if (bp->vn_weight_sum && (vn_min_rate == 0))19811985 vn_min_rate = DEF_MIN_RATE;19821982- vn_max_rate = ((vn_cfg & FUNC_MF_CFG_MAX_BW_MASK) >>19831983- FUNC_MF_CFG_MAX_BW_SHIFT) * 100;19861986+19871987+ if (IS_MF_SI(bp))19881988+ /* maxCfg in percents of linkspeed */19891989+ vn_max_rate = (bp->link_vars.line_speed * maxCfg) / 100;19901990+ else19911991+ /* maxCfg is absolute in 100Mb units */19921992+ vn_max_rate = maxCfg * 100;19841993 }1985199419861995 DP(NETIF_MSG_IFUP,···20152006 m_fair_vn.vn_credit_delta =20162007 max_t(u32, (vn_min_rate * (T_FAIR_COEF /20172008 (8 * bp->vn_weight_sum))),20182018- (bp->cmng.fair_vars.fair_threshold * 2));20092009+ (bp->cmng.fair_vars.fair_threshold +20102010+ MIN_ABOVE_THRESH));20192011 DP(NETIF_MSG_IFUP, "m_fair_vn.vn_credit_delta %d\n",20202012 m_fair_vn.vn_credit_delta);20212013 }
+2-2
drivers/net/bnx2x/bnx2x_stats.c
···12391239 if (unlikely(bp->panic))12401240 return;1241124112421242+ bnx2x_stats_stm[bp->stats_state][event].action(bp);12431243+12421244 /* Protect a state change flow */12431245 spin_lock_bh(&bp->stats_lock);12441246 state = bp->stats_state;12451247 bp->stats_state = bnx2x_stats_stm[state][event].next_state;12461248 spin_unlock_bh(&bp->stats_lock);12471247-12481248- bnx2x_stats_stm[state][event].action(bp);1249124912501250 if ((event != STATS_EVENT_UPDATE) || netif_msg_timer(bp))12511251 DP(BNX2X_MSG_STATS, "state %d -> event %d -> state %d\n",
···27602760 u32 status_idx = (u16) *cp->kcq1.status_idx_ptr;27612761 int kcqe_cnt;2762276227632763+ /* status block index must be read before reading other fields */27642764+ rmb();27632765 cp->kwq_con_idx = *cp->kwq_con_idx_ptr;2764276627652767 while ((kcqe_cnt = cnic_get_kcqes(dev, &cp->kcq1))) {···27722770 barrier();27732771 if (status_idx != *cp->kcq1.status_idx_ptr) {27742772 status_idx = (u16) *cp->kcq1.status_idx_ptr;27732773+ /* status block index must be read first */27742774+ rmb();27752775 cp->kwq_con_idx = *cp->kwq_con_idx_ptr;27762776 } else27772777 break;···28922888 u32 last_status = *info->status_idx_ptr;28932889 int kcqe_cnt;2894289028912891+ /* status block index must be read before reading the KCQ */28922892+ rmb();28952893 while ((kcqe_cnt = cnic_get_kcqes(dev, info))) {2896289428972895 service_kcqes(dev, kcqe_cnt);···29042898 break;2905289929062900 last_status = *info->status_idx_ptr;29012901+ /* status block index must be read before reading the KCQ */29022902+ rmb();29072903 }29082904 return last_status;29092905}···29142906{29152907 struct cnic_dev *dev = (struct cnic_dev *) data;29162908 struct cnic_local *cp = dev->cnic_priv;29172917- u32 status_idx;29092909+ u32 status_idx, new_status_idx;2918291029192911 if (unlikely(!test_bit(CNIC_F_CNIC_UP, &dev->flags)))29202912 return;2921291329222922- status_idx = cnic_service_bnx2x_kcq(dev, &cp->kcq1);29142914+ while (1) {29152915+ status_idx = cnic_service_bnx2x_kcq(dev, &cp->kcq1);2923291629242924- CNIC_WR16(dev, cp->kcq1.io_addr, cp->kcq1.sw_prod_idx + MAX_KCQ_IDX);29172917+ CNIC_WR16(dev, cp->kcq1.io_addr,29182918+ cp->kcq1.sw_prod_idx + MAX_KCQ_IDX);2925291929262926- if (BNX2X_CHIP_IS_E2(cp->chip_id)) {29272927- status_idx = cnic_service_bnx2x_kcq(dev, &cp->kcq2);29202920+ if (!BNX2X_CHIP_IS_E2(cp->chip_id)) {29212921+ cnic_ack_bnx2x_int(dev, cp->bnx2x_igu_sb_id, USTORM_ID,29222922+ status_idx, IGU_INT_ENABLE, 1);29232923+ break;29242924+ }29252925+29262926+ new_status_idx = cnic_service_bnx2x_kcq(dev, &cp->kcq2);29272927+29282928+ if (new_status_idx != status_idx)29292929+ continue;2928293029292931 CNIC_WR16(dev, cp->kcq2.io_addr, cp->kcq2.sw_prod_idx +29302932 MAX_KCQ_IDX);2931293329322934 cnic_ack_igu_sb(dev, cp->bnx2x_igu_sb_id, IGU_SEG_ACCESS_DEF,29332935 status_idx, IGU_INT_ENABLE, 1);29342934- } else {29352935- cnic_ack_bnx2x_int(dev, cp->bnx2x_igu_sb_id, USTORM_ID,29362936- status_idx, IGU_INT_ENABLE, 1);29362936+29372937+ break;29372938 }29382939}29392940
+1-1
drivers/net/davinci_emac.c
···10081008 int ret;1009100910101010 /* free and bail if we are shutting down */10111011- if (unlikely(!netif_running(ndev))) {10111011+ if (unlikely(!netif_running(ndev) || !netif_carrier_ok(ndev))) {10121012 dev_kfree_skb_any(skb);10131013 return;10141014 }
+5-4
drivers/net/dm9000.c
···802802 /* Checksum mode */803803 dm9000_set_rx_csum_unlocked(dev, db->rx_csum);804804805805- /* GPIO0 on pre-activate PHY */806806- iow(db, DM9000_GPR, 0); /* REG_1F bit0 activate phyxcer */807805 iow(db, DM9000_GPCR, GPCR_GEP_CNTL); /* Let GPIO0 output */808808- iow(db, DM9000_GPR, 0); /* Enable PHY */809806810807 ncr = (db->flags & DM9000_PLATF_EXT_PHY) ? NCR_EXT_PHY : 0;811808···849852 unsigned long flags;850853851854 /* Save previous register address */852852- reg_save = readb(db->io_addr);853855 spin_lock_irqsave(&db->lock, flags);856856+ reg_save = readb(db->io_addr);854857855858 netif_stop_queue(dev);856859 dm9000_reset(db);···1190119311911194 if (request_irq(dev->irq, dm9000_interrupt, irqflags, dev->name, dev))11921195 return -EAGAIN;11961196+11971197+ /* GPIO0 on pre-activate PHY, Reg 1F is not set by reset */11981198+ iow(db, DM9000_GPR, 0); /* REG_1F bit0 activate phyxcer */11991199+ mdelay(1); /* delay needs by DM9000B */1193120011941201 /* Initialize DM9000 board */11951202 dm9000_reset(db);
+1-2
drivers/net/dnet.c
···337337 for (i = 0; i < PHY_MAX_ADDR; i++)338338 bp->mii_bus->irq[i] = PHY_POLL;339339340340- platform_set_drvdata(bp->dev, bp->mii_bus);341341-342340 if (mdiobus_register(bp->mii_bus)) {343341 err = -ENXIO;344342 goto err_out_free_mdio_irq;···861863 bp = netdev_priv(dev);862864 bp->dev = dev;863865866866+ platform_set_drvdata(pdev, dev);864867 SET_NETDEV_DEV(dev, &pdev->dev);865868866869 spin_lock_init(&bp->lock);
···220220 * The parameter rar_count will usually be hw->mac.rar_entry_count221221 * unless there are workarounds that change this.222222 **/223223-void e1000_update_mc_addr_list_vf(struct e1000_hw *hw,223223+static void e1000_update_mc_addr_list_vf(struct e1000_hw *hw,224224 u8 *mc_addr_list, u32 mc_addr_count,225225 u32 rar_used_count, u32 rar_count)226226{
+1-1
drivers/net/macb.c
···260260 for (i = 0; i < PHY_MAX_ADDR; i++)261261 bp->mii_bus->irq[i] = PHY_POLL;262262263263- platform_set_drvdata(bp->dev, bp->mii_bus);263263+ dev_set_drvdata(&bp->dev->dev, bp->mii_bus);264264265265 if (mdiobus_register(bp->mii_bus))266266 goto err_out_free_mdio_irq;
···282282 return 0;283283}284284285285+/*286286+ * Wait for synth to settle287287+ */288288+static void ath5k_hw_wait_for_synth(struct ath5k_hw *ah,289289+ struct ieee80211_channel *channel)290290+{291291+ /*292292+ * On 5211+ read activation -> rx delay293293+ * and use it (100ns steps).294294+ */295295+ if (ah->ah_version != AR5K_AR5210) {296296+ u32 delay;297297+ delay = ath5k_hw_reg_read(ah, AR5K_PHY_RX_DELAY) &298298+ AR5K_PHY_RX_DELAY_M;299299+ delay = (channel->hw_value & CHANNEL_CCK) ?300300+ ((delay << 2) / 22) : (delay / 10);301301+ if (ah->ah_bwmode == AR5K_BWMODE_10MHZ)302302+ delay = delay << 1;303303+ if (ah->ah_bwmode == AR5K_BWMODE_5MHZ)304304+ delay = delay << 2;305305+ /* XXX: /2 on turbo ? Let's be safe306306+ * for now */307307+ udelay(100 + delay);308308+ } else {309309+ mdelay(1);310310+ }311311+}312312+285313286314/**********************\287315* RF Gain optimization *···12811253 case AR5K_RF5111:12821254 ret = ath5k_hw_rf5111_channel(ah, channel);12831255 break;12561256+ case AR5K_RF2317:12841257 case AR5K_RF2425:12851258 ret = ath5k_hw_rf2425_channel(ah, channel);12861259 break;···32663237 /* Failed */32673238 if (i >= 100)32683239 return -EIO;32403240+32413241+ /* Set channel and wait for synth */32423242+ ret = ath5k_hw_channel(ah, channel);32433243+ if (ret)32443244+ return ret;32453245+32463246+ ath5k_hw_wait_for_synth(ah, channel);32693247 }3270324832713249 /*···32873251 if (ret)32883252 return ret;3289325332543254+ /* Write OFDM timings on 5212*/32553255+ if (ah->ah_version == AR5K_AR5212 &&32563256+ channel->hw_value & CHANNEL_OFDM) {32573257+32583258+ ret = ath5k_hw_write_ofdm_timings(ah, channel);32593259+ if (ret)32603260+ return ret;32613261+32623262+ /* Spur info is available only from EEPROM versions32633263+ * greater than 5.3, but the EEPROM routines will use32643264+ * static values for older versions */32653265+ if (ah->ah_mac_srev >= AR5K_SREV_AR5424)32663266+ ath5k_hw_set_spur_mitigation_filter(ah,32673267+ channel);32683268+ }32693269+32703270+ /* If we used fast channel switching32713271+ * we are done, release RF bus and32723272+ * fire up NF calibration.32733273+ *32743274+ * Note: Only NF calibration due to32753275+ * channel change, not AGC calibration32763276+ * since AGC is still running !32773277+ */32783278+ if (fast) {32793279+ /*32803280+ * Release RF Bus grant32813281+ */32823282+ AR5K_REG_DISABLE_BITS(ah, AR5K_PHY_RFBUS_REQ,32833283+ AR5K_PHY_RFBUS_REQ_REQUEST);32843284+32853285+ /*32863286+ * Start NF calibration32873287+ */32883288+ AR5K_REG_ENABLE_BITS(ah, AR5K_PHY_AGCCTL,32893289+ AR5K_PHY_AGCCTL_NF);32903290+32913291+ return ret;32923292+ }32933293+32903294 /*32913295 * For 5210 we do all initialization using32923296 * initvals, so we don't have to modify32933297 * any settings (5210 also only supports32943298 * a/aturbo modes)32953299 */32963296- if ((ah->ah_version != AR5K_AR5210) && !fast) {33003300+ if (ah->ah_version != AR5K_AR5210) {3297330132983302 /*32993303 * Write initial RF gain settings···33513275 ret = ath5k_hw_rfregs_init(ah, channel, mode);33523276 if (ret)33533277 return ret;33543354-33553355- /* Write OFDM timings on 5212*/33563356- if (ah->ah_version == AR5K_AR5212 &&33573357- channel->hw_value & CHANNEL_OFDM) {33583358-33593359- ret = ath5k_hw_write_ofdm_timings(ah, channel);33603360- if (ret)33613361- return ret;33623362-33633363- /* Spur info is available only from EEPROM versions33643364- * greater than 5.3, but the EEPROM routines will use33653365- * static values for older versions */33663366- if (ah->ah_mac_srev >= AR5K_SREV_AR5424)33673367- ath5k_hw_set_spur_mitigation_filter(ah,33683368- channel);33693369- }3370327833713279 /*Enable/disable 802.11b mode on 511133723280 (enable 2111 frequency converter + CCK)*/···33823322 */33833323 ath5k_hw_reg_write(ah, AR5K_PHY_ACT_ENABLE, AR5K_PHY_ACT);3384332433853385- /*33863386- * On 5211+ read activation -> rx delay33873387- * and use it.33883388- */33893389- if (ah->ah_version != AR5K_AR5210) {33903390- u32 delay;33913391- delay = ath5k_hw_reg_read(ah, AR5K_PHY_RX_DELAY) &33923392- AR5K_PHY_RX_DELAY_M;33933393- delay = (channel->hw_value & CHANNEL_CCK) ?33943394- ((delay << 2) / 22) : (delay / 10);33953395- if (ah->ah_bwmode == AR5K_BWMODE_10MHZ)33963396- delay = delay << 1;33973397- if (ah->ah_bwmode == AR5K_BWMODE_5MHZ)33983398- delay = delay << 2;33993399- /* XXX: /2 on turbo ? Let's be safe34003400- * for now */34013401- udelay(100 + delay);34023402- } else {34033403- mdelay(1);34043404- }33253325+ ath5k_hw_wait_for_synth(ah, channel);3405332634063406- if (fast)34073407- /*34083408- * Release RF Bus grant34093409- */34103410- AR5K_REG_DISABLE_BITS(ah, AR5K_PHY_RFBUS_REQ,34113411- AR5K_PHY_RFBUS_REQ_REQUEST);34123412- else {34133413- /*34143414- * Perform ADC test to see if baseband is ready34153415- * Set tx hold and check adc test register34163416- */34173417- phy_tst1 = ath5k_hw_reg_read(ah, AR5K_PHY_TST1);34183418- ath5k_hw_reg_write(ah, AR5K_PHY_TST1_TXHOLD, AR5K_PHY_TST1);34193419- for (i = 0; i <= 20; i++) {34203420- if (!(ath5k_hw_reg_read(ah, AR5K_PHY_ADC_TEST) & 0x10))34213421- break;34223422- udelay(200);34233423- }34243424- ath5k_hw_reg_write(ah, phy_tst1, AR5K_PHY_TST1);33273327+ /*33283328+ * Perform ADC test to see if baseband is ready33293329+ * Set tx hold and check adc test register33303330+ */33313331+ phy_tst1 = ath5k_hw_reg_read(ah, AR5K_PHY_TST1);33323332+ ath5k_hw_reg_write(ah, AR5K_PHY_TST1_TXHOLD, AR5K_PHY_TST1);33333333+ for (i = 0; i <= 20; i++) {33343334+ if (!(ath5k_hw_reg_read(ah, AR5K_PHY_ADC_TEST) & 0x10))33353335+ break;33363336+ udelay(200);34253337 }33383338+ ath5k_hw_reg_write(ah, phy_tst1, AR5K_PHY_TST1);3426333934273340 /*34283341 * Start automatic gain control calibration
···11731173 ath9k_btcoex_timer_resume(sc);11741174 }1175117511761176- /* User has the option to provide pm-qos value as a module11771177- * parameter rather than using the default value of11781178- * 'ATH9K_PM_QOS_DEFAULT_VALUE'.11791179- */11801180- pm_qos_update_request(&sc->pm_qos_req, ath9k_pm_qos_value);11811181-11821176 if (ah->caps.pcie_lcr_extsync_en && common->bus_ops->extn_synch_en)11831177 common->bus_ops->extn_synch_en(common);11841178···13381344 ath_radio_disable(sc, hw);1339134513401346 sc->sc_flags |= SC_OP_INVALID;13411341-13421342- pm_qos_update_request(&sc->pm_qos_req, PM_QOS_DEFAULT_VALUE);1343134713441348 mutex_unlock(&sc->mutex);13451349
···5151#include "iwl-agn-debugfs.h"52525353/* Highest firmware API version supported */5454-#define IWL5000_UCODE_API_MAX 25454+#define IWL5000_UCODE_API_MAX 55555#define IWL5150_UCODE_API_MAX 256565757/* Lowest firmware API version supported */
···652652 */653653 rxdesc->flags |= RX_FLAG_IV_STRIPPED;654654655655+ /*656656+ * The hardware has already checked the Michael Mic and has657657+ * stripped it from the frame. Signal this to mac80211.658658+ */659659+ rxdesc->flags |= RX_FLAG_MMIC_STRIPPED;660660+655661 if (rxdesc->cipher_status == RX_CRYPTO_SUCCESS)656662 rxdesc->flags |= RX_FLAG_DECRYPTED;657663 else if (rxdesc->cipher_status == RX_CRYPTO_FAIL_MIC)···10711065 { PCI_DEVICE(0x1814, 0x3390), PCI_DEVICE_DATA(&rt2800pci_ops) },10721066#endif10731067#ifdef CONFIG_RT2800PCI_RT35XX10681068+ { PCI_DEVICE(0x1432, 0x7711), PCI_DEVICE_DATA(&rt2800pci_ops) },10691069+ { PCI_DEVICE(0x1432, 0x7722), PCI_DEVICE_DATA(&rt2800pci_ops) },10741070 { PCI_DEVICE(0x1814, 0x3060), PCI_DEVICE_DATA(&rt2800pci_ops) },10751071 { PCI_DEVICE(0x1814, 0x3062), PCI_DEVICE_DATA(&rt2800pci_ops) },10761072 { PCI_DEVICE(0x1814, 0x3562), PCI_DEVICE_DATA(&rt2800pci_ops) },
+6
drivers/net/wireless/rt2x00/rt2800usb.c
···486486 */487487 rxdesc->flags |= RX_FLAG_IV_STRIPPED;488488489489+ /*490490+ * The hardware has already checked the Michael Mic and has491491+ * stripped it from the frame. Signal this to mac80211.492492+ */493493+ rxdesc->flags |= RX_FLAG_MMIC_STRIPPED;494494+489495 if (rxdesc->cipher_status == RX_CRYPTO_SUCCESS)490496 rxdesc->flags |= RX_FLAG_DECRYPTED;491497 else if (rxdesc->cipher_status == RX_CRYPTO_FAIL_MIC)
+1-1
drivers/nfc/Kconfig
···33#4455menuconfig NFC_DEVICES66- bool "NFC devices"66+ bool "Near Field Communication (NFC) devices"77 default n88 ---help---99 You'll have to say Y if your computer contains an NFC device that
···6677config PPS_GENERATOR_PARPORT88 tristate "Parallel port PPS signal generator"99- depends on PARPORT99+ depends on PARPORT && BROKEN1010 help1111 If you say yes here you get support for a PPS signal generator which1212 utilizes STROBE pin of a parallel port to send PPS signals. It uses
···11/*22 * RTC client/driver for the Maxim/Dallas DS3232 Real-Time Clock over I2C33 *44- * Copyright (C) 2009-2010 Freescale Semiconductor.44+ * Copyright (C) 2009-2011 Freescale Semiconductor.55 * Author: Jack Lan <jack.lan@freescale.com>66 *77 * This program is free software; you can redistribute it and/or modify it···141141 time->tm_hour = bcd2bin(hour);142142 }143143144144- time->tm_wday = bcd2bin(week);144144+ /* Day of the week in linux range is 0~6 while 1~7 in RTC chip */145145+ time->tm_wday = bcd2bin(week) - 1;145146 time->tm_mday = bcd2bin(day);146146- time->tm_mon = bcd2bin(month & 0x7F);147147+ /* linux tm_mon range:0~11, while month range is 1~12 in RTC chip */148148+ time->tm_mon = bcd2bin(month & 0x7F) - 1;147149 if (century)148150 add_century = 100;149151···164162 buf[0] = bin2bcd(time->tm_sec);165163 buf[1] = bin2bcd(time->tm_min);166164 buf[2] = bin2bcd(time->tm_hour);167167- buf[3] = bin2bcd(time->tm_wday); /* Day of the week */165165+ /* Day of the week in linux range is 0~6 while 1~7 in RTC chip */166166+ buf[3] = bin2bcd(time->tm_wday + 1);168167 buf[4] = bin2bcd(time->tm_mday); /* Date */169169- buf[5] = bin2bcd(time->tm_mon);168168+ /* linux tm_mon range:0~11, while month range is 1~12 in RTC chip */169169+ buf[5] = bin2bcd(time->tm_mon + 1);170170 if (time->tm_year >= 100) {171171 buf[5] |= 0x80;172172 buf[6] = bin2bcd(time->tm_year - 100);
+7-5
drivers/rtc/rtc-s3c.c
···7777}78787979/* Update control registers */8080-static void s3c_rtc_setaie(int to)8080+static int s3c_rtc_setaie(struct device *dev, unsigned int enabled)8181{8282 unsigned int tmp;83838484- pr_debug("%s: aie=%d\n", __func__, to);8484+ pr_debug("%s: aie=%d\n", __func__, enabled);85858686 tmp = readb(s3c_rtc_base + S3C2410_RTCALM) & ~S3C2410_RTCALM_ALMEN;87878888- if (to)8888+ if (enabled)8989 tmp |= S3C2410_RTCALM_ALMEN;90909191 writeb(tmp, s3c_rtc_base + S3C2410_RTCALM);9292+9393+ return 0;9294}93959496static int s3c_rtc_setpie(struct device *dev, int enabled)···310308311309 writeb(alrm_en, base + S3C2410_RTCALM);312310313313- s3c_rtc_setaie(alrm->enabled);311311+ s3c_rtc_setaie(dev, alrm->enabled);314312315313 return 0;316314}···442440 rtc_device_unregister(rtc);443441444442 s3c_rtc_setpie(&dev->dev, 0);445445- s3c_rtc_setaie(0);443443+ s3c_rtc_setaie(&dev->dev, 0);446444447445 clk_disable(rtc_clk);448446 clk_put(rtc_clk);
···460460 unsigned int cmd, unsigned long arg)461461{462462 void __user *argp;463463- int ct, perm;463463+ unsigned int ct;464464+ int perm;464465465466 argp = (void __user *)arg;466467
+8
drivers/s390/char/tape.h
···280280 return rc;281281}282282283283+static inline void284284+tape_do_io_async_free(struct tape_device *device, struct tape_request *request)285285+{286286+ request->callback = (void *) tape_free_request;287287+ request->callback_data = NULL;288288+ tape_do_io_async(device, request);289289+}290290+283291extern int tape_oper_handler(int irq, int status);284292extern void tape_noper_handler(int irq, int status);285293extern int tape_open(struct tape_device *);
+41-18
drivers/s390/char/tape_34xx.c
···5353 * Medium sense for 34xx tapes. There is no 'real' medium sense call.5454 * So we just do a normal sense.5555 */5656-static int5757-tape_34xx_medium_sense(struct tape_device *device)5656+static void __tape_34xx_medium_sense(struct tape_request *request)5857{5959- struct tape_request *request;6060- unsigned char *sense;6161- int rc;5858+ struct tape_device *device = request->device;5959+ unsigned char *sense;62606363- request = tape_alloc_request(1, 32);6464- if (IS_ERR(request)) {6565- DBF_EXCEPTION(6, "MSEN fail\n");6666- return PTR_ERR(request);6767- }6868-6969- request->op = TO_MSEN;7070- tape_ccw_end(request->cpaddr, SENSE, 32, request->cpdata);7171-7272- rc = tape_do_io_interruptible(device, request);7361 if (request->rc == 0) {7462 sense = request->cpdata;7563···7688 device->tape_generic_status |= GMT_WR_PROT(~0);7789 else7890 device->tape_generic_status &= ~GMT_WR_PROT(~0);7979- } else {9191+ } else8092 DBF_EVENT(4, "tape_34xx: medium sense failed with rc=%d\n",8193 request->rc);8282- }8394 tape_free_request(request);9595+}84969797+static int tape_34xx_medium_sense(struct tape_device *device)9898+{9999+ struct tape_request *request;100100+ int rc;101101+102102+ request = tape_alloc_request(1, 32);103103+ if (IS_ERR(request)) {104104+ DBF_EXCEPTION(6, "MSEN fail\n");105105+ return PTR_ERR(request);106106+ }107107+108108+ request->op = TO_MSEN;109109+ tape_ccw_end(request->cpaddr, SENSE, 32, request->cpdata);110110+ rc = tape_do_io_interruptible(device, request);111111+ __tape_34xx_medium_sense(request);85112 return rc;113113+}114114+115115+static void tape_34xx_medium_sense_async(struct tape_device *device)116116+{117117+ struct tape_request *request;118118+119119+ request = tape_alloc_request(1, 32);120120+ if (IS_ERR(request)) {121121+ DBF_EXCEPTION(6, "MSEN fail\n");122122+ return;123123+ }124124+125125+ request->op = TO_MSEN;126126+ tape_ccw_end(request->cpaddr, SENSE, 32, request->cpdata);127127+ request->callback = (void *) __tape_34xx_medium_sense;128128+ request->callback_data = NULL;129129+ tape_do_io_async(device, request);86130}8713188132struct tape_34xx_work {···129109 * is inserted but cannot call tape_do_io* from an interrupt context.130110 * Maybe that's useful for other actions we want to start from the131111 * interrupt handler.112112+ * Note: the work handler is called by the system work queue. The tape113113+ * commands started by the handler need to be asynchrounous, otherwise114114+ * a deadlock can occur e.g. in case of a deferred cc=1 (see __tape_do_irq).132115 */133116static void134117tape_34xx_work_handler(struct work_struct *work)···142119143120 switch(p->op) {144121 case TO_MSEN:145145- tape_34xx_medium_sense(device);122122+ tape_34xx_medium_sense_async(device);146123 break;147124 default:148125 DBF_EVENT(3, "T34XX: internal error: unknown work\n");
+67-16
drivers/s390/char/tape_3590.c
···329329/*330330 * Enable encryption331331 */332332-static int tape_3592_enable_crypt(struct tape_device *device)332332+static struct tape_request *__tape_3592_enable_crypt(struct tape_device *device)333333{334334 struct tape_request *request;335335 char *data;336336337337 DBF_EVENT(6, "tape_3592_enable_crypt\n");338338 if (!crypt_supported(device))339339- return -ENOSYS;339339+ return ERR_PTR(-ENOSYS);340340 request = tape_alloc_request(2, 72);341341 if (IS_ERR(request))342342- return PTR_ERR(request);342342+ return request;343343 data = request->cpdata;344344 memset(data,0,72);345345···354354 request->op = TO_CRYPT_ON;355355 tape_ccw_cc(request->cpaddr, MODE_SET_CB, 36, data);356356 tape_ccw_end(request->cpaddr + 1, MODE_SET_CB, 36, data + 36);357357+ return request;358358+}359359+360360+static int tape_3592_enable_crypt(struct tape_device *device)361361+{362362+ struct tape_request *request;363363+364364+ request = __tape_3592_enable_crypt(device);365365+ if (IS_ERR(request))366366+ return PTR_ERR(request);357367 return tape_do_io_free(device, request);368368+}369369+370370+static void tape_3592_enable_crypt_async(struct tape_device *device)371371+{372372+ struct tape_request *request;373373+374374+ request = __tape_3592_enable_crypt(device);375375+ if (!IS_ERR(request))376376+ tape_do_io_async_free(device, request);358377}359378360379/*361380 * Disable encryption362381 */363363-static int tape_3592_disable_crypt(struct tape_device *device)382382+static struct tape_request *__tape_3592_disable_crypt(struct tape_device *device)364383{365384 struct tape_request *request;366385 char *data;367386368387 DBF_EVENT(6, "tape_3592_disable_crypt\n");369388 if (!crypt_supported(device))370370- return -ENOSYS;389389+ return ERR_PTR(-ENOSYS);371390 request = tape_alloc_request(2, 72);372391 if (IS_ERR(request))373373- return PTR_ERR(request);392392+ return request;374393 data = request->cpdata;375394 memset(data,0,72);376395···402383 tape_ccw_cc(request->cpaddr, MODE_SET_CB, 36, data);403384 tape_ccw_end(request->cpaddr + 1, MODE_SET_CB, 36, data + 36);404385386386+ return request;387387+}388388+389389+static int tape_3592_disable_crypt(struct tape_device *device)390390+{391391+ struct tape_request *request;392392+393393+ request = __tape_3592_disable_crypt(device);394394+ if (IS_ERR(request))395395+ return PTR_ERR(request);405396 return tape_do_io_free(device, request);397397+}398398+399399+static void tape_3592_disable_crypt_async(struct tape_device *device)400400+{401401+ struct tape_request *request;402402+403403+ request = __tape_3592_disable_crypt(device);404404+ if (!IS_ERR(request))405405+ tape_do_io_async_free(device, request);406406}407407408408/*···495457/*496458 * SENSE Medium: Get Sense data about medium state497459 */498498-static int499499-tape_3590_sense_medium(struct tape_device *device)460460+static int tape_3590_sense_medium(struct tape_device *device)500461{501462 struct tape_request *request;502463···505468 request->op = TO_MSEN;506469 tape_ccw_end(request->cpaddr, MEDIUM_SENSE, 128, request->cpdata);507470 return tape_do_io_free(device, request);471471+}472472+473473+static void tape_3590_sense_medium_async(struct tape_device *device)474474+{475475+ struct tape_request *request;476476+477477+ request = tape_alloc_request(1, 128);478478+ if (IS_ERR(request))479479+ return;480480+ request->op = TO_MSEN;481481+ tape_ccw_end(request->cpaddr, MEDIUM_SENSE, 128, request->cpdata);482482+ tape_do_io_async_free(device, request);508483}509484510485/*···595546 * 2. The attention msg is written to the "read subsystem data" buffer.596547 * In this case we probably should print it to the console.597548 */598598-static int599599-tape_3590_read_attmsg(struct tape_device *device)549549+static void tape_3590_read_attmsg_async(struct tape_device *device)600550{601551 struct tape_request *request;602552 char *buf;603553604554 request = tape_alloc_request(3, 4096);605555 if (IS_ERR(request))606606- return PTR_ERR(request);556556+ return;607557 request->op = TO_READ_ATTMSG;608558 buf = request->cpdata;609559 buf[0] = PREP_RD_SS_DATA;···610562 tape_ccw_cc(request->cpaddr, PERFORM_SS_FUNC, 12, buf);611563 tape_ccw_cc(request->cpaddr + 1, READ_SS_DATA, 4096 - 12, buf + 12);612564 tape_ccw_end(request->cpaddr + 2, NOP, 0, NULL);613613- return tape_do_io_free(device, request);565565+ tape_do_io_async_free(device, request);614566}615567616568/*617569 * These functions are used to schedule follow-up actions from within an618570 * interrupt context (like unsolicited interrupts).571571+ * Note: the work handler is called by the system work queue. The tape572572+ * commands started by the handler need to be asynchrounous, otherwise573573+ * a deadlock can occur e.g. in case of a deferred cc=1 (see __tape_do_irq).619574 */620575struct work_handler_data {621576 struct tape_device *device;···634583635584 switch (p->op) {636585 case TO_MSEN:637637- tape_3590_sense_medium(p->device);586586+ tape_3590_sense_medium_async(p->device);638587 break;639588 case TO_READ_ATTMSG:640640- tape_3590_read_attmsg(p->device);589589+ tape_3590_read_attmsg_async(p->device);641590 break;642591 case TO_CRYPT_ON:643643- tape_3592_enable_crypt(p->device);592592+ tape_3592_enable_crypt_async(p->device);644593 break;645594 case TO_CRYPT_OFF:646646- tape_3592_disable_crypt(p->device);595595+ tape_3592_disable_crypt_async(p->device);647596 break;648597 default:649598 DBF_EVENT(3, "T3590: work handler undefined for "
+1-1
drivers/scsi/scsi_lib.c
···443443 &sdev->request_queue->queue_flags);444444 if (flagset)445445 queue_flag_set(QUEUE_FLAG_REENTER, sdev->request_queue);446446- __blk_run_queue(sdev->request_queue);446446+ __blk_run_queue(sdev->request_queue, false);447447 if (flagset)448448 queue_flag_clear(QUEUE_FLAG_REENTER, sdev->request_queue);449449 spin_unlock(sdev->request_queue->queue_lock);
+1-1
drivers/scsi/scsi_transport_fc.c
···38293829 !test_bit(QUEUE_FLAG_REENTER, &rport->rqst_q->queue_flags);38303830 if (flagset)38313831 queue_flag_set(QUEUE_FLAG_REENTER, rport->rqst_q);38323832- __blk_run_queue(rport->rqst_q);38323832+ __blk_run_queue(rport->rqst_q, false);38333833 if (flagset)38343834 queue_flag_clear(QUEUE_FLAG_REENTER, rport->rqst_q);38353835 spin_unlock_irqrestore(rport->rqst_q->queue_lock, flags);
-1
drivers/thermal/Kconfig
···4455menuconfig THERMAL66 tristate "Generic Thermal sysfs driver"77- depends on NET87 help98 Generic Thermal Sysfs driver offers a generic mechanism for109 thermal management. Usually it's made up of one or more thermal
···2681268126822682 mutex_lock(&usb_address0_mutex);2683268326842684- if (!udev->config && oldspeed == USB_SPEED_SUPER) {26852685- /* Don't reset USB 3.0 devices during an initial setup */26862686- usb_set_device_state(udev, USB_STATE_DEFAULT);26872687- } else {26882688- /* Reset the device; full speed may morph to high speed */26892689- /* FIXME a USB 2.0 device may morph into SuperSpeed on reset. */26902690- retval = hub_port_reset(hub, port1, udev, delay);26912691- if (retval < 0) /* error or disconnect */26922692- goto fail;26932693- /* success, speed is known */26942694- }26842684+ /* Reset the device; full speed may morph to high speed */26852685+ /* FIXME a USB 2.0 device may morph into SuperSpeed on reset. */26862686+ retval = hub_port_reset(hub, port1, udev, delay);26872687+ if (retval < 0) /* error or disconnect */26882688+ goto fail;26892689+ /* success, speed is known */26902690+26952691 retval = -ENODEV;2696269226972693 if (oldspeed != USB_SPEED_UNKNOWN && oldspeed != udev->speed) {
···307307308308/***************** Streams structures manipulation *************************/309309310310-void xhci_free_stream_ctx(struct xhci_hcd *xhci,310310+static void xhci_free_stream_ctx(struct xhci_hcd *xhci,311311 unsigned int num_stream_ctxs,312312 struct xhci_stream_ctx *stream_ctx, dma_addr_t dma)313313{···335335 * The stream context array must be a power of 2, and can be as small as336336 * 64 bytes or as large as 1MB.337337 */338338-struct xhci_stream_ctx *xhci_alloc_stream_ctx(struct xhci_hcd *xhci,338338+static struct xhci_stream_ctx *xhci_alloc_stream_ctx(struct xhci_hcd *xhci,339339 unsigned int num_stream_ctxs, dma_addr_t *dma,340340 gfp_t mem_flags)341341{···19001900 val &= DBOFF_MASK;19011901 xhci_dbg(xhci, "// Doorbell array is located at offset 0x%x"19021902 " from cap regs base addr\n", val);19031903- xhci->dba = (void *) xhci->cap_regs + val;19031903+ xhci->dba = (void __iomem *) xhci->cap_regs + val;19041904 xhci_dbg_regs(xhci);19051905 xhci_print_run_regs(xhci);19061906 /* Set ir_set to interrupt register set 0 */19071907- xhci->ir_set = (void *) xhci->run_regs->ir_set;19071907+ xhci->ir_set = &xhci->run_regs->ir_set[0];1908190819091909 /*19101910 * Event ring setup: Allocate a normal ring, but also setup···19611961 /* Set the event ring dequeue address */19621962 xhci_set_hc_event_deq(xhci);19631963 xhci_dbg(xhci, "Wrote ERST address to ir_set 0.\n");19641964- xhci_print_ir_set(xhci, xhci->ir_set, 0);19641964+ xhci_print_ir_set(xhci, 0);1965196519661966 /*19671967 * XXX: Might need to set the Interrupter Moderation Register to
+23-17
drivers/usb/host/xhci-ring.c
···474474 state->new_deq_seg = find_trb_seg(cur_td->start_seg,475475 dev->eps[ep_index].stopped_trb,476476 &state->new_cycle_state);477477- if (!state->new_deq_seg)478478- BUG();477477+ if (!state->new_deq_seg) {478478+ WARN_ON(1);479479+ return;480480+ }481481+479482 /* Dig out the cycle state saved by the xHC during the stop ep cmd */480483 xhci_dbg(xhci, "Finding endpoint context\n");481484 ep_ctx = xhci_get_ep_ctx(xhci, dev->out_ctx, ep_index);···489486 state->new_deq_seg = find_trb_seg(state->new_deq_seg,490487 state->new_deq_ptr,491488 &state->new_cycle_state);492492- if (!state->new_deq_seg)493493- BUG();489489+ if (!state->new_deq_seg) {490490+ WARN_ON(1);491491+ return;492492+ }494493495494 trb = &state->new_deq_ptr->generic;496495 if ((trb->field[3] & TRB_TYPE_BITMASK) == TRB_TYPE(TRB_LINK) &&···2368236323692364 /* Scatter gather list entries may cross 64KB boundaries */23702365 running_total = TRB_MAX_BUFF_SIZE -23712371- (sg_dma_address(sg) & ((1 << TRB_MAX_BUFF_SHIFT) - 1));23662366+ (sg_dma_address(sg) & (TRB_MAX_BUFF_SIZE - 1));23672367+ running_total &= TRB_MAX_BUFF_SIZE - 1;23722368 if (running_total != 0)23732369 num_trbs++;2374237023752371 /* How many more 64KB chunks to transfer, how many more TRBs? */23762376- while (running_total < sg_dma_len(sg)) {23722372+ while (running_total < sg_dma_len(sg) && running_total < temp) {23772373 num_trbs++;23782374 running_total += TRB_MAX_BUFF_SIZE;23792375 }···24002394static void check_trb_math(struct urb *urb, int num_trbs, int running_total)24012395{24022396 if (num_trbs != 0)24032403- dev_dbg(&urb->dev->dev, "%s - ep %#x - Miscalculated number of "23972397+ dev_err(&urb->dev->dev, "%s - ep %#x - Miscalculated number of "24042398 "TRBs, %d left\n", __func__,24052399 urb->ep->desc.bEndpointAddress, num_trbs);24062400 if (running_total != urb->transfer_buffer_length)24072407- dev_dbg(&urb->dev->dev, "%s - ep %#x - Miscalculated tx length, "24012401+ dev_err(&urb->dev->dev, "%s - ep %#x - Miscalculated tx length, "24082402 "queued %#x (%d), asked for %#x (%d)\n",24092403 __func__,24102404 urb->ep->desc.bEndpointAddress,···25392533 sg = urb->sg;25402534 addr = (u64) sg_dma_address(sg);25412535 this_sg_len = sg_dma_len(sg);25422542- trb_buff_len = TRB_MAX_BUFF_SIZE -25432543- (addr & ((1 << TRB_MAX_BUFF_SHIFT) - 1));25362536+ trb_buff_len = TRB_MAX_BUFF_SIZE - (addr & (TRB_MAX_BUFF_SIZE - 1));25442537 trb_buff_len = min_t(int, trb_buff_len, this_sg_len);25452538 if (trb_buff_len > urb->transfer_buffer_length)25462539 trb_buff_len = urb->transfer_buffer_length;···25772572 (unsigned int) (addr + TRB_MAX_BUFF_SIZE) & ~(TRB_MAX_BUFF_SIZE - 1),25782573 (unsigned int) addr + trb_buff_len);25792574 if (TRB_MAX_BUFF_SIZE -25802580- (addr & ((1 << TRB_MAX_BUFF_SHIFT) - 1)) < trb_buff_len) {25752575+ (addr & (TRB_MAX_BUFF_SIZE - 1)) < trb_buff_len) {25812576 xhci_warn(xhci, "WARN: sg dma xfer crosses 64KB boundaries!\n");25822577 xhci_dbg(xhci, "Next boundary at %#x, end dma = %#x\n",25832578 (unsigned int) (addr + TRB_MAX_BUFF_SIZE) & ~(TRB_MAX_BUFF_SIZE - 1),···26212616 }2622261726232618 trb_buff_len = TRB_MAX_BUFF_SIZE -26242624- (addr & ((1 << TRB_MAX_BUFF_SHIFT) - 1));26192619+ (addr & (TRB_MAX_BUFF_SIZE - 1));26252620 trb_buff_len = min_t(int, trb_buff_len, this_sg_len);26262621 if (running_total + trb_buff_len > urb->transfer_buffer_length)26272622 trb_buff_len =···26612656 num_trbs = 0;26622657 /* How much data is (potentially) left before the 64KB boundary? */26632658 running_total = TRB_MAX_BUFF_SIZE -26642664- (urb->transfer_dma & ((1 << TRB_MAX_BUFF_SHIFT) - 1));26592659+ (urb->transfer_dma & (TRB_MAX_BUFF_SIZE - 1));26602660+ running_total &= TRB_MAX_BUFF_SIZE - 1;2665266126662662 /* If there's some data on this 64KB chunk, or we have to send a26672663 * zero-length transfer, we need at least one TRB···27062700 /* How much data is in the first TRB? */27072701 addr = (u64) urb->transfer_dma;27082702 trb_buff_len = TRB_MAX_BUFF_SIZE -27092709- (urb->transfer_dma & ((1 << TRB_MAX_BUFF_SHIFT) - 1));27102710- if (urb->transfer_buffer_length < trb_buff_len)27032703+ (urb->transfer_dma & (TRB_MAX_BUFF_SIZE - 1));27042704+ if (trb_buff_len > urb->transfer_buffer_length)27112705 trb_buff_len = urb->transfer_buffer_length;2712270627132707 first_trb = true;···28852879 addr = (u64) (urb->transfer_dma + urb->iso_frame_desc[i].offset);28862880 td_len = urb->iso_frame_desc[i].length;2887288128882888- running_total = TRB_MAX_BUFF_SIZE -28892889- (addr & ((1 << TRB_MAX_BUFF_SHIFT) - 1));28822882+ running_total = TRB_MAX_BUFF_SIZE - (addr & (TRB_MAX_BUFF_SIZE - 1));28832883+ running_total &= TRB_MAX_BUFF_SIZE - 1;28902884 if (running_total != 0)28912885 num_trbs++;28922886
+7-7
drivers/usb/host/xhci.c
···109109/*110110 * Set the run bit and wait for the host to be running.111111 */112112-int xhci_start(struct xhci_hcd *xhci)112112+static int xhci_start(struct xhci_hcd *xhci)113113{114114 u32 temp;115115 int ret;···329329330330331331#ifdef CONFIG_USB_XHCI_HCD_DEBUGGING332332-void xhci_event_ring_work(unsigned long arg)332332+static void xhci_event_ring_work(unsigned long arg)333333{334334 unsigned long flags;335335 int temp;···473473 xhci->ir_set, (unsigned int) ER_IRQ_ENABLE(temp));474474 xhci_writel(xhci, ER_IRQ_ENABLE(temp),475475 &xhci->ir_set->irq_pending);476476- xhci_print_ir_set(xhci, xhci->ir_set, 0);476476+ xhci_print_ir_set(xhci, 0);477477478478 if (NUM_TEST_NOOPS > 0)479479 doorbell = xhci_setup_one_noop(xhci);···528528 temp = xhci_readl(xhci, &xhci->ir_set->irq_pending);529529 xhci_writel(xhci, ER_IRQ_DISABLE(temp),530530 &xhci->ir_set->irq_pending);531531- xhci_print_ir_set(xhci, xhci->ir_set, 0);531531+ xhci_print_ir_set(xhci, 0);532532533533 xhci_dbg(xhci, "cleaning up memory\n");534534 xhci_mem_cleanup(xhci);···755755 temp = xhci_readl(xhci, &xhci->ir_set->irq_pending);756756 xhci_writel(xhci, ER_IRQ_DISABLE(temp),757757 &xhci->ir_set->irq_pending);758758- xhci_print_ir_set(xhci, xhci->ir_set, 0);758758+ xhci_print_ir_set(xhci, 0);759759760760 xhci_dbg(xhci, "cleaning up memory\n");761761 xhci_mem_cleanup(xhci);···857857/* Returns 1 if the arguments are OK;858858 * returns 0 this is a root hub; returns -EINVAL for NULL pointers.859859 */860860-int xhci_check_args(struct usb_hcd *hcd, struct usb_device *udev,860860+static int xhci_check_args(struct usb_hcd *hcd, struct usb_device *udev,861861 struct usb_host_endpoint *ep, int check_ep, bool check_virt_dev,862862 const char *func) {863863 struct xhci_hcd *xhci;···16931693 xhci_dbg_ctx(xhci, in_ctx, xhci_last_valid_endpoint(add_flags));16941694}1695169516961696-void xhci_setup_input_ctx_for_quirk(struct xhci_hcd *xhci,16961696+static void xhci_setup_input_ctx_for_quirk(struct xhci_hcd *xhci,16971697 unsigned int slot_id, unsigned int ep_index,16981698 struct xhci_dequeue_state *deq_state)16991699{
···488488 unsigned set_address:1;489489 unsigned test_mode:1;490490 unsigned softconnect:1;491491+492492+ u8 address;493493+ u8 test_mode_nr;494494+ u16 ackpend; /* ep0 */495495+ enum musb_g_ep0_state ep0_state;496496+ struct usb_gadget g; /* the gadget */497497+ struct usb_gadget_driver *gadget_driver; /* its driver */498498+#endif499499+491500 /*492501 * FIXME: Remove this flag.493502 *···509500 * buffering until we get it working.510501 */511502 unsigned double_buffer_not_ok:1 __deprecated;512512-513513- u8 address;514514- u8 test_mode_nr;515515- u16 ackpend; /* ep0 */516516- enum musb_g_ep0_state ep0_state;517517- struct usb_gadget g; /* the gadget */518518- struct usb_gadget_driver *gadget_driver; /* its driver */519519-#endif520503521504 struct musb_hdrc_config *config;522505
+1
drivers/usb/musb/omap2430.c
···362362363363static int omap2430_musb_exit(struct musb *musb)364364{365365+ del_timer_sync(&musb_idle_timer);365366366367 omap2430_low_level_exit(musb);367368 otg_put_transceiver(musb->xceiv);
+3
drivers/usb/serial/sierra.c
···301301 { USB_DEVICE(0x1199, 0x68A3), /* Sierra Wireless Direct IP modems */302302 .driver_info = (kernel_ulong_t)&direct_ip_interface_blacklist303303 },304304+ { USB_DEVICE(0x0f3d, 0x68A3), /* Airprime/Sierra Wireless Direct IP modems */305305+ .driver_info = (kernel_ulong_t)&direct_ip_interface_blacklist306306+ },304307 { USB_DEVICE(0x413C, 0x08133) }, /* Dell Computer Corp. Wireless 5720 VZW Mobile Broadband (EVDO Rev-A) Minicard GPS Port */305308306309 { }
+9-6
drivers/usb/serial/usb_wwan.c
···295295 __func__, status, endpoint);296296 } else {297297 tty = tty_port_tty_get(&port->port);298298- if (urb->actual_length) {299299- tty_insert_flip_string(tty, data, urb->actual_length);300300- tty_flip_buffer_push(tty);301301- } else302302- dbg("%s: empty read urb received", __func__);303303- tty_kref_put(tty);298298+ if (tty) {299299+ if (urb->actual_length) {300300+ tty_insert_flip_string(tty, data,301301+ urb->actual_length);302302+ tty_flip_buffer_push(tty);303303+ } else304304+ dbg("%s: empty read urb received", __func__);305305+ tty_kref_put(tty);306306+ }304307305308 /* Resubmit urb so we continue receiving */306309 if (status != -ESHUTDOWN) {
+12
drivers/usb/serial/visor.c
···2727#include <linux/uaccess.h>2828#include <linux/usb.h>2929#include <linux/usb/serial.h>3030+#include <linux/usb/cdc.h>3031#include "visor.h"31323233/*···479478 const struct usb_device_id *id);480479481480 dbg("%s", __func__);481481+482482+ /*483483+ * some Samsung Android phones in modem mode have the same ID484484+ * as SPH-I500, but they are ACM devices, so dont bind to them485485+ */486486+ if (id->idVendor == SAMSUNG_VENDOR_ID &&487487+ id->idProduct == SAMSUNG_SPH_I500_ID &&488488+ serial->dev->descriptor.bDeviceClass == USB_CLASS_COMM &&489489+ serial->dev->descriptor.bDeviceSubClass ==490490+ USB_CDC_SUBCLASS_ACM)491491+ return -ENODEV;482492483493 if (serial->dev->actconfig->desc.bConfigurationValue != 1) {484494 dev_err(&serial->dev->dev, "active config #%d != 1 ??\n",
···239239 call_rcu(&ctx->rcu_head, ctx_rcu_free);240240}241241242242-#define get_ioctx(kioctx) do { \243243- BUG_ON(atomic_read(&(kioctx)->users) <= 0); \244244- atomic_inc(&(kioctx)->users); \245245-} while (0)246246-#define put_ioctx(kioctx) do { \247247- BUG_ON(atomic_read(&(kioctx)->users) <= 0); \248248- if (unlikely(atomic_dec_and_test(&(kioctx)->users))) \249249- __put_ioctx(kioctx); \250250-} while (0)242242+static inline void get_ioctx(struct kioctx *kioctx)243243+{244244+ BUG_ON(atomic_read(&kioctx->users) <= 0);245245+ atomic_inc(&kioctx->users);246246+}247247+248248+static inline int try_get_ioctx(struct kioctx *kioctx)249249+{250250+ return atomic_inc_not_zero(&kioctx->users);251251+}252252+253253+static inline void put_ioctx(struct kioctx *kioctx)254254+{255255+ BUG_ON(atomic_read(&kioctx->users) <= 0);256256+ if (unlikely(atomic_dec_and_test(&kioctx->users)))257257+ __put_ioctx(kioctx);258258+}251259252260/* ioctx_alloc253261 * Allocates and initializes an ioctx. Returns an ERR_PTR if it failed.···609601 rcu_read_lock();610602611603 hlist_for_each_entry_rcu(ctx, n, &mm->ioctx_list, list) {612612- if (ctx->user_id == ctx_id && !ctx->dead) {613613- get_ioctx(ctx);604604+ /*605605+ * RCU protects us against accessing freed memory but606606+ * we have to be careful not to get a reference when the607607+ * reference count already dropped to 0 (ctx->dead test608608+ * is unreliable because of races).609609+ */610610+ if (ctx->user_id == ctx_id && !ctx->dead && try_get_ioctx(ctx)){614611 ret = ctx;615612 break;616613 }···16421629 goto out_put_req;1643163016441631 spin_lock_irq(&ctx->ctx_lock);16321632+ /*16331633+ * We could have raced with io_destroy() and are currently holding a16341634+ * reference to ctx which should be destroyed. We cannot submit IO16351635+ * since ctx gets freed as soon as io_submit() puts its reference. The16361636+ * check here is reliable: io_destroy() sets ctx->dead before waiting16371637+ * for outstanding IO and the barrier between these two is realized by16381638+ * unlock of mm->ioctx_lock and lock of ctx->ctx_lock. Analogously we16391639+ * increment ctx->reqs_active before checking for ctx->dead and the16401640+ * barrier is realized by unlock and lock of ctx->ctx_lock. Thus if we16411641+ * don't see ctx->dead set here, io_destroy() waits for our IO to16421642+ * finish.16431643+ */16441644+ if (ctx->dead) {16451645+ spin_unlock_irq(&ctx->ctx_lock);16461646+ ret = -EINVAL;16471647+ goto out_put_req;16481648+ }16451649 aio_run_iocb(req);16461650 if (!list_empty(&ctx->run_list)) {16471651 /* drain the run list */
+13-6
fs/block_dev.c
···873873 ret = add_symlink(bdev->bd_part->holder_dir, &disk_to_dev(disk)->kobj);874874 if (ret)875875 goto out_del;876876+ /*877877+ * bdev could be deleted beneath us which would implicitly destroy878878+ * the holder directory. Hold on to it.879879+ */880880+ kobject_get(bdev->bd_part->holder_dir);876881877882 list_add(&holder->list, &bdev->bd_holder_disks);878883 goto out_unlock;···914909 del_symlink(disk->slave_dir, &part_to_dev(bdev->bd_part)->kobj);915910 del_symlink(bdev->bd_part->holder_dir,916911 &disk_to_dev(disk)->kobj);912912+ kobject_put(bdev->bd_part->holder_dir);917913 list_del_init(&holder->list);918914 kfree(holder);919915 }···928922 * flush_disk - invalidates all buffer-cache entries on a disk929923 *930924 * @bdev: struct block device to be flushed925925+ * @kill_dirty: flag to guide handling of dirty inodes931926 *932927 * Invalidates all buffer-cache entries on a disk. It should be called933928 * when a disk has been changed -- either by a media change or online934929 * resize.935930 */936936-static void flush_disk(struct block_device *bdev)931931+static void flush_disk(struct block_device *bdev, bool kill_dirty)937932{938938- if (__invalidate_device(bdev)) {933933+ if (__invalidate_device(bdev, kill_dirty)) {939934 char name[BDEVNAME_SIZE] = "";940935941936 if (bdev->bd_disk)···973966 "%s: detected capacity change from %lld to %lld\n",974967 name, bdev_size, disk_size);975968 i_size_write(bdev->bd_inode, disk_size);976976- flush_disk(bdev);969969+ flush_disk(bdev, false);977970 }978971}979972EXPORT_SYMBOL(check_disk_size_change);···10261019 if (!(events & DISK_EVENT_MEDIA_CHANGE))10271020 return 0;1028102110291029- flush_disk(bdev);10221022+ flush_disk(bdev, true);10301023 if (bdops->revalidate_disk)10311024 bdops->revalidate_disk(bdev->bd_disk);10321025 return 1;···16071600}16081601EXPORT_SYMBOL(lookup_bdev);1609160216101610-int __invalidate_device(struct block_device *bdev)16031603+int __invalidate_device(struct block_device *bdev, bool kill_dirty)16111604{16121605 struct super_block *sb = get_super(bdev);16131606 int res = 0;···16201613 * hold).16211614 */16221615 shrink_dcache_sb(sb);16231623- res = invalidate_inodes(sb);16161616+ res = invalidate_inodes(sb, kill_dirty);16241617 drop_super(sb);16251618 }16261619 invalidate_bdev(bdev);
···14331433 */14341434u64 count_range_bits(struct extent_io_tree *tree,14351435 u64 *start, u64 search_end, u64 max_bytes,14361436- unsigned long bits)14361436+ unsigned long bits, int contig)14371437{14381438 struct rb_node *node;14391439 struct extent_state *state;14401440 u64 cur_start = *start;14411441 u64 total_bytes = 0;14421442+ u64 last = 0;14421443 int found = 0;1443144414441445 if (search_end <= cur_start) {···14641463 state = rb_entry(node, struct extent_state, rb_node);14651464 if (state->start > search_end)14661465 break;14671467- if (state->end >= cur_start && (state->state & bits)) {14661466+ if (contig && found && state->start > last + 1)14671467+ break;14681468+ if (state->end >= cur_start && (state->state & bits) == bits) {14681469 total_bytes += min(search_end, state->end) + 1 -14691470 max(cur_start, state->start);14701471 if (total_bytes >= max_bytes)···14751472 *start = state->start;14761473 found = 1;14771474 }14751475+ last = state->end;14761476+ } else if (contig && found) {14771477+ break;14781478 }14791479 node = rb_next(node);14801480 if (!node)···29182912 return sector;29192913}2920291429152915+/*29162916+ * helper function for fiemap, which doesn't want to see any holes.29172917+ * This maps until we find something past 'last'29182918+ */29192919+static struct extent_map *get_extent_skip_holes(struct inode *inode,29202920+ u64 offset,29212921+ u64 last,29222922+ get_extent_t *get_extent)29232923+{29242924+ u64 sectorsize = BTRFS_I(inode)->root->sectorsize;29252925+ struct extent_map *em;29262926+ u64 len;29272927+29282928+ if (offset >= last)29292929+ return NULL;29302930+29312931+ while(1) {29322932+ len = last - offset;29332933+ if (len == 0)29342934+ break;29352935+ len = (len + sectorsize - 1) & ~(sectorsize - 1);29362936+ em = get_extent(inode, NULL, 0, offset, len, 0);29372937+ if (!em || IS_ERR(em))29382938+ return em;29392939+29402940+ /* if this isn't a hole return it */29412941+ if (!test_bit(EXTENT_FLAG_VACANCY, &em->flags) &&29422942+ em->block_start != EXTENT_MAP_HOLE) {29432943+ return em;29442944+ }29452945+29462946+ /* this is a hole, advance to the next extent */29472947+ offset = extent_map_end(em);29482948+ free_extent_map(em);29492949+ if (offset >= last)29502950+ break;29512951+ }29522952+ return NULL;29532953+}29542954+29212955int extent_fiemap(struct inode *inode, struct fiemap_extent_info *fieinfo,29222956 __u64 start, __u64 len, get_extent_t *get_extent)29232957{···29672921 u32 flags = 0;29682922 u32 found_type;29692923 u64 last;29242924+ u64 last_for_get_extent = 0;29702925 u64 disko = 0;29262926+ u64 isize = i_size_read(inode);29712927 struct btrfs_key found_key;29722928 struct extent_map *em = NULL;29732929 struct extent_state *cached_state = NULL;29742930 struct btrfs_path *path;29752931 struct btrfs_file_extent_item *item;29762932 int end = 0;29772977- u64 em_start = 0, em_len = 0;29332933+ u64 em_start = 0;29342934+ u64 em_len = 0;29352935+ u64 em_end = 0;29782936 unsigned long emflags;29792979- int hole = 0;2980293729812938 if (len == 0)29822939 return -EINVAL;···29892940 return -ENOMEM;29902941 path->leave_spinning = 1;2991294229432943+ /*29442944+ * lookup the last file extent. We're not using i_size here29452945+ * because there might be preallocation past i_size29462946+ */29922947 ret = btrfs_lookup_file_extent(NULL, BTRFS_I(inode)->root,29932948 path, inode->i_ino, -1, 0);29942949 if (ret < 0) {···30062953 btrfs_item_key_to_cpu(path->nodes[0], &found_key, path->slots[0]);30072954 found_type = btrfs_key_type(&found_key);3008295530093009- /* No extents, just return */29562956+ /* No extents, but there might be delalloc bits */30102957 if (found_key.objectid != inode->i_ino ||30112958 found_type != BTRFS_EXTENT_DATA_KEY) {30123012- btrfs_free_path(path);30133013- return 0;29592959+ /* have to trust i_size as the end */29602960+ last = (u64)-1;29612961+ last_for_get_extent = isize;29622962+ } else {29632963+ /*29642964+ * remember the start of the last extent. There are a29652965+ * bunch of different factors that go into the length of the29662966+ * extent, so its much less complex to remember where it started29672967+ */29682968+ last = found_key.offset;29692969+ last_for_get_extent = last + 1;30142970 }30153015- last = found_key.offset;30162971 btrfs_free_path(path);29722972+29732973+ /*29742974+ * we might have some extents allocated but more delalloc past those29752975+ * extents. so, we trust isize unless the start of the last extent is29762976+ * beyond isize29772977+ */29782978+ if (last < isize) {29792979+ last = (u64)-1;29802980+ last_for_get_extent = isize;29812981+ }3017298230182983 lock_extent_bits(&BTRFS_I(inode)->io_tree, start, start + len, 0,30192984 &cached_state, GFP_NOFS);30203020- em = get_extent(inode, NULL, 0, off, max - off, 0);29852985+29862986+ em = get_extent_skip_holes(inode, off, last_for_get_extent,29872987+ get_extent);30212988 if (!em)30222989 goto out;30232990 if (IS_ERR(em)) {···30462973 }3047297430482975 while (!end) {30493049- hole = 0;30503050- off = em->start + em->len;29762976+ off = extent_map_end(em);30512977 if (off >= max)30522978 end = 1;3053297930543054- if (em->block_start == EXTENT_MAP_HOLE) {30553055- hole = 1;30563056- goto next;30573057- }30583058-30592980 em_start = em->start;30602981 em_len = em->len;30613061-29822982+ em_end = extent_map_end(em);29832983+ emflags = em->flags;30622984 disko = 0;30632985 flags = 0;30642986···30723004 if (test_bit(EXTENT_FLAG_COMPRESSED, &em->flags))30733005 flags |= FIEMAP_EXTENT_ENCODED;3074300630753075-next:30763076- emflags = em->flags;30773007 free_extent_map(em);30783008 em = NULL;30793079- if (!end) {30803080- em = get_extent(inode, NULL, 0, off, max - off, 0);30813081- if (!em)30823082- goto out;30833083- if (IS_ERR(em)) {30843084- ret = PTR_ERR(em);30853085- goto out;30863086- }30873087- emflags = em->flags;30883088- }30893089-30903090- if (test_bit(EXTENT_FLAG_VACANCY, &emflags)) {30093009+ if ((em_start >= last) || em_len == (u64)-1 ||30103010+ (last == (u64)-1 && isize <= em_end)) {30913011 flags |= FIEMAP_EXTENT_LAST;30923012 end = 1;30933013 }3094301430953095- if (em_start == last) {30153015+ /* now scan forward to see if this is really the last extent. */30163016+ em = get_extent_skip_holes(inode, off, last_for_get_extent,30173017+ get_extent);30183018+ if (IS_ERR(em)) {30193019+ ret = PTR_ERR(em);30203020+ goto out;30213021+ }30223022+ if (!em) {30963023 flags |= FIEMAP_EXTENT_LAST;30973024 end = 1;30983025 }30993099-31003100- if (!hole) {31013101- ret = fiemap_fill_next_extent(fieinfo, em_start, disko,31023102- em_len, flags);31033103- if (ret)31043104- goto out_free;31053105- }30263026+ ret = fiemap_fill_next_extent(fieinfo, em_start, disko,30273027+ em_len, flags);30283028+ if (ret)30293029+ goto out_free;31063030 }31073031out_free:31083032 free_extent_map(em);
+1-1
fs/btrfs/extent_io.h
···191191192192u64 count_range_bits(struct extent_io_tree *tree,193193 u64 *start, u64 search_end,194194- u64 max_bytes, unsigned long bits);194194+ u64 max_bytes, unsigned long bits, int contig);195195196196void free_extent_state(struct extent_state *state);197197int test_range_bit(struct extent_io_tree *tree, u64 start, u64 end,
+124-2
fs/btrfs/inode.c
···1913191319141914 private = 0;19151915 if (count_range_bits(&BTRFS_I(inode)->io_failure_tree, &private,19161916- (u64)-1, 1, EXTENT_DIRTY)) {19161916+ (u64)-1, 1, EXTENT_DIRTY, 0)) {19171917 ret = get_state_private(&BTRFS_I(inode)->io_failure_tree,19181918 start, &private_failure);19191919 if (ret == 0) {···52805280 return em;52815281}5282528252835283+struct extent_map *btrfs_get_extent_fiemap(struct inode *inode, struct page *page,52845284+ size_t pg_offset, u64 start, u64 len,52855285+ int create)52865286+{52875287+ struct extent_map *em;52885288+ struct extent_map *hole_em = NULL;52895289+ u64 range_start = start;52905290+ u64 end;52915291+ u64 found;52925292+ u64 found_end;52935293+ int err = 0;52945294+52955295+ em = btrfs_get_extent(inode, page, pg_offset, start, len, create);52965296+ if (IS_ERR(em))52975297+ return em;52985298+ if (em) {52995299+ /*53005300+ * if our em maps to a hole, there might53015301+ * actually be delalloc bytes behind it53025302+ */53035303+ if (em->block_start != EXTENT_MAP_HOLE)53045304+ return em;53055305+ else53065306+ hole_em = em;53075307+ }53085308+53095309+ /* check to see if we've wrapped (len == -1 or similar) */53105310+ end = start + len;53115311+ if (end < start)53125312+ end = (u64)-1;53135313+ else53145314+ end -= 1;53155315+53165316+ em = NULL;53175317+53185318+ /* ok, we didn't find anything, lets look for delalloc */53195319+ found = count_range_bits(&BTRFS_I(inode)->io_tree, &range_start,53205320+ end, len, EXTENT_DELALLOC, 1);53215321+ found_end = range_start + found;53225322+ if (found_end < range_start)53235323+ found_end = (u64)-1;53245324+53255325+ /*53265326+ * we didn't find anything useful, return53275327+ * the original results from get_extent()53285328+ */53295329+ if (range_start > end || found_end <= start) {53305330+ em = hole_em;53315331+ hole_em = NULL;53325332+ goto out;53335333+ }53345334+53355335+ /* adjust the range_start to make sure it doesn't53365336+ * go backwards from the start they passed in53375337+ */53385338+ range_start = max(start,range_start);53395339+ found = found_end - range_start;53405340+53415341+ if (found > 0) {53425342+ u64 hole_start = start;53435343+ u64 hole_len = len;53445344+53455345+ em = alloc_extent_map(GFP_NOFS);53465346+ if (!em) {53475347+ err = -ENOMEM;53485348+ goto out;53495349+ }53505350+ /*53515351+ * when btrfs_get_extent can't find anything it53525352+ * returns one huge hole53535353+ *53545354+ * make sure what it found really fits our range, and53555355+ * adjust to make sure it is based on the start from53565356+ * the caller53575357+ */53585358+ if (hole_em) {53595359+ u64 calc_end = extent_map_end(hole_em);53605360+53615361+ if (calc_end <= start || (hole_em->start > end)) {53625362+ free_extent_map(hole_em);53635363+ hole_em = NULL;53645364+ } else {53655365+ hole_start = max(hole_em->start, start);53665366+ hole_len = calc_end - hole_start;53675367+ }53685368+ }53695369+ em->bdev = NULL;53705370+ if (hole_em && range_start > hole_start) {53715371+ /* our hole starts before our delalloc, so we53725372+ * have to return just the parts of the hole53735373+ * that go until the delalloc starts53745374+ */53755375+ em->len = min(hole_len,53765376+ range_start - hole_start);53775377+ em->start = hole_start;53785378+ em->orig_start = hole_start;53795379+ /*53805380+ * don't adjust block start at all,53815381+ * it is fixed at EXTENT_MAP_HOLE53825382+ */53835383+ em->block_start = hole_em->block_start;53845384+ em->block_len = hole_len;53855385+ } else {53865386+ em->start = range_start;53875387+ em->len = found;53885388+ em->orig_start = range_start;53895389+ em->block_start = EXTENT_MAP_DELALLOC;53905390+ em->block_len = found;53915391+ }53925392+ } else if (hole_em) {53935393+ return hole_em;53945394+ }53955395+out:53965396+53975397+ free_extent_map(hole_em);53985398+ if (err) {53995399+ free_extent_map(em);54005400+ return ERR_PTR(err);54015401+ }54025402+ return em;54035403+}54045404+52835405static struct extent_map *btrfs_new_extent_direct(struct inode *inode,52845406 u64 start, u64 len)52855407{···62246102static int btrfs_fiemap(struct inode *inode, struct fiemap_extent_info *fieinfo,62256103 __u64 start, __u64 len)62266104{62276227- return extent_fiemap(inode, fieinfo, start, len, btrfs_get_extent);61056105+ return extent_fiemap(inode, fieinfo, start, len, btrfs_get_extent_fiemap);62286106}6229610762306108int btrfs_readpage(struct file *file, struct page *page)
+5-2
fs/btrfs/ioctl.c
···10711071 if (copy_from_user(&flags, arg, sizeof(flags)))10721072 return -EFAULT;1073107310741074- if (flags & ~BTRFS_SUBVOL_CREATE_ASYNC)10741074+ if (flags & BTRFS_SUBVOL_CREATE_ASYNC)10751075 return -EINVAL;1076107610771077 if (flags & ~BTRFS_SUBVOL_RDONLY)10781078 return -EOPNOTSUPP;10791079+10801080+ if (!is_owner_or_cap(inode))10811081+ return -EACCES;1079108210801083 down_write(&root->fs_info->subvol_sem);10811084···11001097 goto out_reset;11011098 }1102109911031103- ret = btrfs_update_root(trans, root,11001100+ ret = btrfs_update_root(trans, root->fs_info->tree_root,11041101 &root->root_key, &root->root_item);1105110211061103 btrfs_commit_transaction(trans, root);
+14-7
fs/btrfs/lzo.c
···280280 unsigned long tot_out;281281 unsigned long tot_len;282282 char *buf;283283+ bool may_late_unmap, need_unmap;283284284285 data_in = kmap(pages_in[0]);285286 tot_len = read_compress_length(data_in);···301300302301 tot_in += in_len;303302 working_bytes = in_len;303303+ may_late_unmap = need_unmap = false;304304305305 /* fast path: avoid using the working buffer */306306 if (in_page_bytes_left >= in_len) {307307 buf = data_in + in_offset;308308 bytes = in_len;309309+ may_late_unmap = true;309310 goto cont;310311 }311312···332329 if (working_bytes == 0 && tot_in >= tot_len)333330 break;334331335335- kunmap(pages_in[page_in_index]);336336- page_in_index++;337337- if (page_in_index >= total_pages_in) {332332+ if (page_in_index + 1 >= total_pages_in) {338333 ret = -1;339339- data_in = NULL;340334 goto done;341335 }342342- data_in = kmap(pages_in[page_in_index]);336336+337337+ if (may_late_unmap)338338+ need_unmap = true;339339+ else340340+ kunmap(pages_in[page_in_index]);341341+342342+ data_in = kmap(pages_in[++page_in_index]);343343344344 in_page_bytes_left = PAGE_CACHE_SIZE;345345 in_offset = 0;···352346 out_len = lzo1x_worst_compress(PAGE_CACHE_SIZE);353347 ret = lzo1x_decompress_safe(buf, in_len, workspace->buf,354348 &out_len);349349+ if (need_unmap)350350+ kunmap(pages_in[page_in_index - 1]);355351 if (ret != LZO_E_OK) {356352 printk(KERN_WARNING "btrfs decompress failed\n");357353 ret = -1;···371363 break;372364 }373365done:374374- if (data_in)375375- kunmap(pages_in[page_in_index]);366366+ kunmap(pages_in[page_in_index]);376367 return ret;377368}378369
···6363 * cleanup path and it is also acquired by eventpoll_release_file()6464 * if a file has been pushed inside an epoll set and it is then6565 * close()d without a previous call toepoll_ctl(EPOLL_CTL_DEL).6666+ * It is also acquired when inserting an epoll fd onto another epoll6767+ * fd. We do this so that we walk the epoll tree and ensure that this6868+ * insertion does not create a cycle of epoll file descriptors, which6969+ * could lead to deadlock. We need a global mutex to prevent two7070+ * simultaneous inserts (A into B and B into A) from racing and7171+ * constructing a cycle without either insert observing that it is7272+ * going to.6673 * It is possible to drop the "ep->mtx" and to use the global6774 * mutex "epmutex" (together with "ep->lock") to have it working,6875 * but having "ep->mtx" will make the interface more scalable.···230223 * This mutex is used to serialize ep_free() and eventpoll_release_file().231224 */232225static DEFINE_MUTEX(epmutex);226226+227227+/* Used to check for epoll file descriptor inclusion loops */228228+static struct nested_calls poll_loop_ncalls;233229234230/* Used for safe wake up implementation */235231static struct nested_calls poll_safewake_ncalls;···12081198 return res;12091199}1210120012011201+/**12021202+ * ep_loop_check_proc - Callback function to be passed to the @ep_call_nested()12031203+ * API, to verify that adding an epoll file inside another12041204+ * epoll structure, does not violate the constraints, in12051205+ * terms of closed loops, or too deep chains (which can12061206+ * result in excessive stack usage).12071207+ *12081208+ * @priv: Pointer to the epoll file to be currently checked.12091209+ * @cookie: Original cookie for this call. This is the top-of-the-chain epoll12101210+ * data structure pointer.12111211+ * @call_nests: Current dept of the @ep_call_nested() call stack.12121212+ *12131213+ * Returns: Returns zero if adding the epoll @file inside current epoll12141214+ * structure @ep does not violate the constraints, or -1 otherwise.12151215+ */12161216+static int ep_loop_check_proc(void *priv, void *cookie, int call_nests)12171217+{12181218+ int error = 0;12191219+ struct file *file = priv;12201220+ struct eventpoll *ep = file->private_data;12211221+ struct rb_node *rbp;12221222+ struct epitem *epi;12231223+12241224+ mutex_lock(&ep->mtx);12251225+ for (rbp = rb_first(&ep->rbr); rbp; rbp = rb_next(rbp)) {12261226+ epi = rb_entry(rbp, struct epitem, rbn);12271227+ if (unlikely(is_file_epoll(epi->ffd.file))) {12281228+ error = ep_call_nested(&poll_loop_ncalls, EP_MAX_NESTS,12291229+ ep_loop_check_proc, epi->ffd.file,12301230+ epi->ffd.file->private_data, current);12311231+ if (error != 0)12321232+ break;12331233+ }12341234+ }12351235+ mutex_unlock(&ep->mtx);12361236+12371237+ return error;12381238+}12391239+12401240+/**12411241+ * ep_loop_check - Performs a check to verify that adding an epoll file (@file)12421242+ * another epoll file (represented by @ep) does not create12431243+ * closed loops or too deep chains.12441244+ *12451245+ * @ep: Pointer to the epoll private data structure.12461246+ * @file: Pointer to the epoll file to be checked.12471247+ *12481248+ * Returns: Returns zero if adding the epoll @file inside current epoll12491249+ * structure @ep does not violate the constraints, or -1 otherwise.12501250+ */12511251+static int ep_loop_check(struct eventpoll *ep, struct file *file)12521252+{12531253+ return ep_call_nested(&poll_loop_ncalls, EP_MAX_NESTS,12541254+ ep_loop_check_proc, file, ep, current);12551255+}12561256+12111257/*12121258 * Open an eventpoll file descriptor.12131259 */···13121246 struct epoll_event __user *, event)13131247{13141248 int error;12491249+ int did_lock_epmutex = 0;13151250 struct file *file, *tfile;13161251 struct eventpoll *ep;13171252 struct epitem *epi;···13541287 */13551288 ep = file->private_data;1356128912901290+ /*12911291+ * When we insert an epoll file descriptor, inside another epoll file12921292+ * descriptor, there is the change of creating closed loops, which are12931293+ * better be handled here, than in more critical paths.12941294+ *12951295+ * We hold epmutex across the loop check and the insert in this case, in12961296+ * order to prevent two separate inserts from racing and each doing the12971297+ * insert "at the same time" such that ep_loop_check passes on both12981298+ * before either one does the insert, thereby creating a cycle.12991299+ */13001300+ if (unlikely(is_file_epoll(tfile) && op == EPOLL_CTL_ADD)) {13011301+ mutex_lock(&epmutex);13021302+ did_lock_epmutex = 1;13031303+ error = -ELOOP;13041304+ if (ep_loop_check(ep, tfile) != 0)13051305+ goto error_tgt_fput;13061306+ }13071307+13081308+13571309 mutex_lock(&ep->mtx);1358131013591311 /*···14081322 mutex_unlock(&ep->mtx);1409132314101324error_tgt_fput:13251325+ if (unlikely(did_lock_epmutex))13261326+ mutex_unlock(&epmutex);13271327+14111328 fput(tfile);14121329error_fput:14131330 fput(file);···15291440 max_user_watches = (((si.totalram - si.totalhigh) / 25) << PAGE_SHIFT) /15301441 EP_ITEM_COST;15311442 BUG_ON(max_user_watches < 0);14431443+14441444+ /*14451445+ * Initialize the structure used to perform epoll file descriptor14461446+ * inclusion loops checks.14471447+ */14481448+ ep_nested_calls_init(&poll_loop_ncalls);1532144915331450 /* Initialize the structure used to perform safe poll wait head wake ups */15341451 ep_nested_calls_init(&poll_safewake_ncalls);
+2-6
fs/exofs/namei.c
···272272 new_de = exofs_find_entry(new_dir, new_dentry, &new_page);273273 if (!new_de)274274 goto out_dir;275275- inode_inc_link_count(old_inode);276275 err = exofs_set_link(new_dir, new_de, new_page, old_inode);277276 new_inode->i_ctime = CURRENT_TIME;278277 if (dir_de)···285286 if (new_dir->i_nlink >= EXOFS_LINK_MAX)286287 goto out_dir;287288 }288288- inode_inc_link_count(old_inode);289289 err = exofs_add_link(new_dentry, old_inode);290290- if (err) {291291- inode_dec_link_count(old_inode);290290+ if (err)292291 goto out_dir;293293- }294292 if (dir_de)295293 inode_inc_link_count(new_dir);296294 }···295299 old_inode->i_ctime = CURRENT_TIME;296300297301 exofs_delete_entry(old_de, old_page);298298- inode_dec_link_count(old_inode);302302+ mark_inode_dirty(old_inode);299303300304 if (dir_de) {301305 err = exofs_set_link(old_inode, dir_de, dir_page, new_dir);
+2-7
fs/ext2/namei.c
···344344 new_de = ext2_find_entry (new_dir, &new_dentry->d_name, &new_page);345345 if (!new_de)346346 goto out_dir;347347- inode_inc_link_count(old_inode);348347 ext2_set_link(new_dir, new_de, new_page, old_inode, 1);349348 new_inode->i_ctime = CURRENT_TIME_SEC;350349 if (dir_de)···355356 if (new_dir->i_nlink >= EXT2_LINK_MAX)356357 goto out_dir;357358 }358358- inode_inc_link_count(old_inode);359359 err = ext2_add_link(new_dentry, old_inode);360360- if (err) {361361- inode_dec_link_count(old_inode);360360+ if (err)362361 goto out_dir;363363- }364362 if (dir_de)365363 inode_inc_link_count(new_dir);366364 }···365369 /*366370 * Like most other Unix systems, set the ctime for inodes on a367371 * rename.368368- * inode_dec_link_count() will mark the inode dirty.369372 */370373 old_inode->i_ctime = CURRENT_TIME_SEC;374374+ mark_inode_dirty(old_inode);371375372376 ext2_delete_entry (old_de, old_page);373373- inode_dec_link_count(old_inode);374377375378 if (dir_de) {376379 if (old_dir != new_dir)
+5-2
fs/fuse/dir.c
···12831283 if (err)12841284 return err;1285128512861286- if ((attr->ia_valid & ATTR_OPEN) && fc->atomic_o_trunc)12871287- return 0;12861286+ if (attr->ia_valid & ATTR_OPEN) {12871287+ if (fc->atomic_o_trunc)12881288+ return 0;12891289+ file = NULL;12901290+ }1288129112891292 if (attr->ia_valid & ATTR_SIZE)12901293 is_truncate = true;
+46-8
fs/fuse/file.c
···8686 return ff;8787}88888989-static void fuse_release_end(struct fuse_conn *fc, struct fuse_req *req)8989+static void fuse_release_async(struct work_struct *work)9090{9191- path_put(&req->misc.release.path);9191+ struct fuse_req *req;9292+ struct fuse_conn *fc;9393+ struct path path;9494+9595+ req = container_of(work, struct fuse_req, misc.release.work);9696+ path = req->misc.release.path;9797+ fc = get_fuse_conn(path.dentry->d_inode);9898+9999+ fuse_put_request(fc, req);100100+ path_put(&path);92101}931029494-static void fuse_file_put(struct fuse_file *ff)103103+static void fuse_release_end(struct fuse_conn *fc, struct fuse_req *req)104104+{105105+ if (fc->destroy_req) {106106+ /*107107+ * If this is a fuseblk mount, then it's possible that108108+ * releasing the path will result in releasing the109109+ * super block and sending the DESTROY request. If110110+ * the server is single threaded, this would hang.111111+ * For this reason do the path_put() in a separate112112+ * thread.113113+ */114114+ atomic_inc(&req->count);115115+ INIT_WORK(&req->misc.release.work, fuse_release_async);116116+ schedule_work(&req->misc.release.work);117117+ } else {118118+ path_put(&req->misc.release.path);119119+ }120120+}121121+122122+static void fuse_file_put(struct fuse_file *ff, bool sync)95123{96124 if (atomic_dec_and_test(&ff->count)) {97125 struct fuse_req *req = ff->reserved_req;981269999- req->end = fuse_release_end;100100- fuse_request_send_background(ff->fc, req);127127+ if (sync) {128128+ fuse_request_send(ff->fc, req);129129+ path_put(&req->misc.release.path);130130+ fuse_put_request(ff->fc, req);131131+ } else {132132+ req->end = fuse_release_end;133133+ fuse_request_send_background(ff->fc, req);134134+ }101135 kfree(ff);102136 }103137}···253219 * Normally this will send the RELEASE request, however if254220 * some asynchronous READ or WRITE requests are outstanding,255221 * the sending will be delayed.222222+ *223223+ * Make the release synchronous if this is a fuseblk mount,224224+ * synchronous RELEASE is allowed (and desirable) in this case225225+ * because the server can be trusted not to screw up.256226 */257257- fuse_file_put(ff);227227+ fuse_file_put(ff, ff->fc->destroy_req != NULL);258228}259229260230static int fuse_open(struct inode *inode, struct file *file)···596558 page_cache_release(page);597559 }598560 if (req->ff)599599- fuse_file_put(req->ff);561561+ fuse_file_put(req->ff, false);600562}601563602564static void fuse_send_readpages(struct fuse_req *req, struct file *file)···11751137static void fuse_writepage_free(struct fuse_conn *fc, struct fuse_req *req)11761138{11771139 __free_page(req->pages[0]);11781178- fuse_file_put(req->ff);11401140+ fuse_file_put(req->ff, false);11791141}1180114211811143static void fuse_writepage_finish(struct fuse_conn *fc, struct fuse_req *req)
+5-1
fs/fuse/fuse_i.h
···2121#include <linux/rwsem.h>2222#include <linux/rbtree.h>2323#include <linux/poll.h>2424+#include <linux/workqueue.h>24252526/** Max number of pages that can be used in a single read request */2627#define FUSE_MAX_PAGES_PER_REQ 32···263262 /** Data for asynchronous requests */264263 union {265264 struct {266266- struct fuse_release_in in;265265+ union {266266+ struct fuse_release_in in;267267+ struct work_struct work;268268+ };267269 struct path path;268270 } release;269271 struct fuse_init_in init_in;
···238238}239239240240/*241241- * hfs_unlink()241241+ * hfs_remove()242242 *243243- * This is the unlink() entry in the inode_operations structure for244244- * regular HFS directories. The purpose is to delete an existing245245- * file, given the inode for the parent directory and the name246246- * (and its length) of the existing file.243243+ * This serves as both unlink() and rmdir() in the inode_operations244244+ * structure for regular HFS directories. The purpose is to delete245245+ * an existing child, given the inode for the parent directory and246246+ * the name (and its length) of the existing directory.247247+ *248248+ * HFS does not have hardlinks, so both rmdir and unlink set the249249+ * link count to 0. The only difference is the emptiness check.247250 */248248-static int hfs_unlink(struct inode *dir, struct dentry *dentry)251251+static int hfs_remove(struct inode *dir, struct dentry *dentry)249252{250250- struct inode *inode;253253+ struct inode *inode = dentry->d_inode;251254 int res;252255253253- inode = dentry->d_inode;254254- res = hfs_cat_delete(inode->i_ino, dir, &dentry->d_name);255255- if (res)256256- return res;257257-258258- drop_nlink(inode);259259- hfs_delete_inode(inode);260260- inode->i_ctime = CURRENT_TIME_SEC;261261- mark_inode_dirty(inode);262262-263263- return res;264264-}265265-266266-/*267267- * hfs_rmdir()268268- *269269- * This is the rmdir() entry in the inode_operations structure for270270- * regular HFS directories. The purpose is to delete an existing271271- * directory, given the inode for the parent directory and the name272272- * (and its length) of the existing directory.273273- */274274-static int hfs_rmdir(struct inode *dir, struct dentry *dentry)275275-{276276- struct inode *inode;277277- int res;278278-279279- inode = dentry->d_inode;280280- if (inode->i_size != 2)256256+ if (S_ISDIR(inode->i_mode) && inode->i_size != 2)281257 return -ENOTEMPTY;282258 res = hfs_cat_delete(inode->i_ino, dir, &dentry->d_name);283259 if (res)···283307284308 /* Unlink destination if it already exists */285309 if (new_dentry->d_inode) {286286- res = hfs_unlink(new_dir, new_dentry);310310+ res = hfs_remove(new_dir, new_dentry);287311 if (res)288312 return res;289313 }···308332const struct inode_operations hfs_dir_inode_operations = {309333 .create = hfs_create,310334 .lookup = hfs_lookup,311311- .unlink = hfs_unlink,335335+ .unlink = hfs_remove,312336 .mkdir = hfs_mkdir,313313- .rmdir = hfs_rmdir,337337+ .rmdir = hfs_remove,314338 .rename = hfs_rename,315339 .setattr = hfs_inode_setattr,316340};
+23-8
fs/inode.c
···295295 call_rcu(&inode->i_rcu, i_callback);296296}297297298298+void address_space_init_once(struct address_space *mapping)299299+{300300+ memset(mapping, 0, sizeof(*mapping));301301+ INIT_RADIX_TREE(&mapping->page_tree, GFP_ATOMIC);302302+ spin_lock_init(&mapping->tree_lock);303303+ spin_lock_init(&mapping->i_mmap_lock);304304+ INIT_LIST_HEAD(&mapping->private_list);305305+ spin_lock_init(&mapping->private_lock);306306+ INIT_RAW_PRIO_TREE_ROOT(&mapping->i_mmap);307307+ INIT_LIST_HEAD(&mapping->i_mmap_nonlinear);308308+ mutex_init(&mapping->unmap_mutex);309309+}310310+EXPORT_SYMBOL(address_space_init_once);311311+298312/*299313 * These are initializations that only need to be done300314 * once, because the fields are idempotent across use···322308 INIT_LIST_HEAD(&inode->i_devices);323309 INIT_LIST_HEAD(&inode->i_wb_list);324310 INIT_LIST_HEAD(&inode->i_lru);325325- INIT_RADIX_TREE(&inode->i_data.page_tree, GFP_ATOMIC);326326- spin_lock_init(&inode->i_data.tree_lock);327327- spin_lock_init(&inode->i_data.i_mmap_lock);328328- INIT_LIST_HEAD(&inode->i_data.private_list);329329- spin_lock_init(&inode->i_data.private_lock);330330- INIT_RAW_PRIO_TREE_ROOT(&inode->i_data.i_mmap);331331- INIT_LIST_HEAD(&inode->i_data.i_mmap_nonlinear);311311+ address_space_init_once(&inode->i_data);332312 i_size_ordered_init(inode);333313#ifdef CONFIG_FSNOTIFY334314 INIT_HLIST_HEAD(&inode->i_fsnotify_marks);···548540/**549541 * invalidate_inodes - attempt to free all inodes on a superblock550542 * @sb: superblock to operate on543543+ * @kill_dirty: flag to guide handling of dirty inodes551544 *552545 * Attempts to free all inodes for a given superblock. If there were any553546 * busy inodes return a non-zero value, else zero.547547+ * If @kill_dirty is set, discard dirty inodes too, otherwise treat548548+ * them as busy.554549 */555555-int invalidate_inodes(struct super_block *sb)550550+int invalidate_inodes(struct super_block *sb, bool kill_dirty)556551{557552 int busy = 0;558553 struct inode *inode, *next;···567556 list_for_each_entry_safe(inode, next, &sb->s_inodes, i_sb_list) {568557 if (inode->i_state & (I_NEW | I_FREEING | I_WILL_FREE))569558 continue;559559+ if (inode->i_state & I_DIRTY && !kill_dirty) {560560+ busy = 1;561561+ continue;562562+ }570563 if (atomic_read(&inode->i_count)) {571564 busy = 1;572565 continue;
+1-1
fs/internal.h
···112112 */113113extern int get_nr_dirty_inodes(void);114114extern void evict_inodes(struct super_block *);115115-extern int invalidate_inodes(struct super_block *);115115+extern int invalidate_inodes(struct super_block *, bool);
+2-6
fs/minix/namei.c
···213213 new_de = minix_find_entry(new_dentry, &new_page);214214 if (!new_de)215215 goto out_dir;216216- inode_inc_link_count(old_inode);217216 minix_set_link(new_de, new_page, old_inode);218217 new_inode->i_ctime = CURRENT_TIME_SEC;219218 if (dir_de)···224225 if (new_dir->i_nlink >= info->s_link_max)225226 goto out_dir;226227 }227227- inode_inc_link_count(old_inode);228228 err = minix_add_link(new_dentry, old_inode);229229- if (err) {230230- inode_dec_link_count(old_inode);229229+ if (err)231230 goto out_dir;232232- }233231 if (dir_de)234232 inode_inc_link_count(new_dir);235233 }236234237235 minix_delete_entry(old_de, old_page);238238- inode_dec_link_count(old_inode);236236+ mark_inode_dirty(old_inode);239237240238 if (dir_de) {241239 minix_set_link(dir_de, dir_page, new_dir);
···405405 ocfs2_quota_trans_credits(sb);406406}407407408408-/* data block for new dir/symlink, 2 for bitmap updates (bitmap fe +409409- * bitmap block for the new bit) dx_root update for free list */410410-#define OCFS2_DIR_LINK_ADDITIONAL_CREDITS (1 + 2 + 1)408408+/* data block for new dir/symlink, allocation of directory block, dx_root409409+ * update for free list */410410+#define OCFS2_DIR_LINK_ADDITIONAL_CREDITS (1 + OCFS2_SUBALLOC_ALLOC + 1)411411412412static inline int ocfs2_add_dir_index_credits(struct super_block *sb)413413{
+5-2
fs/ocfs2/refcounttree.c
···32283228 u32 num_clusters, unsigned int e_flags)32293229{32303230 int ret, delete, index, credits = 0;32313231- u32 new_bit, new_len;32313231+ u32 new_bit, new_len, orig_num_clusters;32323232 unsigned int set_len;32333233 struct ocfs2_super *osb = OCFS2_SB(sb);32343234 handle_t *handle;···32603260 mlog_errno(ret);32613261 goto out;32623262 }32633263+32643264+ orig_num_clusters = num_clusters;3263326532643266 while (num_clusters) {32653267 ret = ocfs2_get_refcount_rec(ref_ci, context->ref_root_bh,···33503348 * in write-back mode.33513349 */33523350 if (context->get_clusters == ocfs2_di_get_clusters) {33533353- ret = ocfs2_cow_sync_writeback(sb, context, cpos, num_clusters);33513351+ ret = ocfs2_cow_sync_writeback(sb, context, cpos,33523352+ orig_num_clusters);33543353 if (ret)33553354 mlog_errno(ret);33563355 }
+20-8
fs/ocfs2/super.c
···13161316 struct mount_options *mopt,13171317 int is_remount)13181318{13191319- int status;13191319+ int status, user_stack = 0;13201320 char *p;13211321 u32 tmp;13221322···14591459 memcpy(mopt->cluster_stack, args[0].from,14601460 OCFS2_STACK_LABEL_LEN);14611461 mopt->cluster_stack[OCFS2_STACK_LABEL_LEN] = '\0';14621462+ /*14631463+ * Open code the memcmp here as we don't have14641464+ * an osb to pass to14651465+ * ocfs2_userspace_stack().14661466+ */14671467+ if (memcmp(mopt->cluster_stack,14681468+ OCFS2_CLASSIC_CLUSTER_STACK,14691469+ OCFS2_STACK_LABEL_LEN))14701470+ user_stack = 1;14621471 break;14631472 case Opt_inode64:14641473 mopt->mount_opt |= OCFS2_MOUNT_INODE64;···15231514 }15241515 }1525151615261526- /* Ensure only one heartbeat mode */15271527- tmp = mopt->mount_opt & (OCFS2_MOUNT_HB_LOCAL | OCFS2_MOUNT_HB_GLOBAL |15281528- OCFS2_MOUNT_HB_NONE);15291529- if (hweight32(tmp) != 1) {15301530- mlog(ML_ERROR, "Invalid heartbeat mount options\n");15311531- status = 0;15321532- goto bail;15171517+ if (user_stack == 0) {15181518+ /* Ensure only one heartbeat mode */15191519+ tmp = mopt->mount_opt & (OCFS2_MOUNT_HB_LOCAL |15201520+ OCFS2_MOUNT_HB_GLOBAL |15211521+ OCFS2_MOUNT_HB_NONE);15221522+ if (hweight32(tmp) != 1) {15231523+ mlog(ML_ERROR, "Invalid heartbeat mount options\n");15241524+ status = 0;15251525+ goto bail;15261526+ }15331527 }1534152815351529 status = 1;
···245245 new_de = sysv_find_entry(new_dentry, &new_page);246246 if (!new_de)247247 goto out_dir;248248- inode_inc_link_count(old_inode);249248 sysv_set_link(new_de, new_page, old_inode);250249 new_inode->i_ctime = CURRENT_TIME_SEC;251250 if (dir_de)···256257 if (new_dir->i_nlink >= SYSV_SB(new_dir->i_sb)->s_link_max)257258 goto out_dir;258259 }259259- inode_inc_link_count(old_inode);260260 err = sysv_add_link(new_dentry, old_inode);261261- if (err) {262262- inode_dec_link_count(old_inode);261261+ if (err)263262 goto out_dir;264264- }265263 if (dir_de)266264 inode_inc_link_count(new_dir);267265 }268266269267 sysv_delete_entry(old_de, old_page);270270- inode_dec_link_count(old_inode);268268+ mark_inode_dirty(old_inode);271269272270 if (dir_de) {273271 sysv_set_link(dir_de, dir_page, new_dir);
+5-6
fs/udf/namei.c
···3232#include <linux/crc-itu-t.h>3333#include <linux/exportfs.h>34343535+enum { UDF_MAX_LINKS = 0xffff };3636+3537static inline int udf_match(int len1, const unsigned char *name1, int len2,3638 const unsigned char *name2)3739{···652650 struct udf_inode_info *iinfo;653651654652 err = -EMLINK;655655- if (dir->i_nlink >= (256 << sizeof(dir->i_nlink)) - 1)653653+ if (dir->i_nlink >= UDF_MAX_LINKS)656654 goto out;657655658656 err = -EIO;···10361034 struct fileIdentDesc cfi, *fi;10371035 int err;1038103610391039- if (inode->i_nlink >= (256 << sizeof(inode->i_nlink)) - 1) {10371037+ if (inode->i_nlink >= UDF_MAX_LINKS)10401038 return -EMLINK;10411041- }1042103910431040 fi = udf_add_entry(dir, dentry, &fibh, &cfi, &err);10441041 if (!fi) {···11321131 goto end_rename;1133113211341133 retval = -EMLINK;11351135- if (!new_inode &&11361136- new_dir->i_nlink >=11371137- (256 << sizeof(new_dir->i_nlink)) - 1)11341134+ if (!new_inode && new_dir->i_nlink >= UDF_MAX_LINKS)11381135 goto end_rename;11391136 }11401137 if (!nfi) {
+2-7
fs/ufs/namei.c
···306306 new_de = ufs_find_entry(new_dir, &new_dentry->d_name, &new_page);307307 if (!new_de)308308 goto out_dir;309309- inode_inc_link_count(old_inode);310309 ufs_set_link(new_dir, new_de, new_page, old_inode);311310 new_inode->i_ctime = CURRENT_TIME_SEC;312311 if (dir_de)···317318 if (new_dir->i_nlink >= UFS_LINK_MAX)318319 goto out_dir;319320 }320320- inode_inc_link_count(old_inode);321321 err = ufs_add_link(new_dentry, old_inode);322322- if (err) {323323- inode_dec_link_count(old_inode);322322+ if (err)324323 goto out_dir;325325- }326324 if (dir_de)327325 inode_inc_link_count(new_dir);328326 }···327331 /*328332 * Like most other Unix systems, set the ctime for inodes on a329333 * rename.330330- * inode_dec_link_count() will mark the inode dirty.331334 */332335 old_inode->i_ctime = CURRENT_TIME_SEC;333336334337 ufs_delete_entry(old_dir, old_de, old_page);335335- inode_dec_link_count(old_inode);338338+ mark_inode_dirty(old_inode);336339337340 if (dir_de) {338341 ufs_set_link(old_inode, dir_de, dir_page, new_dir);
+2
fs/xfs/linux-2.6/xfs_discard.c
···152152153153 if (!capable(CAP_SYS_ADMIN))154154 return -XFS_ERROR(EPERM);155155+ if (!blk_queue_discard(q))156156+ return -XFS_ERROR(EOPNOTSUPP);155157 if (copy_from_user(&range, urange, sizeof(range)))156158 return -XFS_ERROR(EFAULT);157159
+8-3
fs/xfs/linux-2.6/xfs_ioctl.c
···695695 xfs_mount_t *mp,696696 void __user *arg)697697{698698- xfs_fsop_geom_v1_t fsgeo;698698+ xfs_fsop_geom_t fsgeo;699699 int error;700700701701- error = xfs_fs_geometry(mp, (xfs_fsop_geom_t *)&fsgeo, 3);701701+ error = xfs_fs_geometry(mp, &fsgeo, 3);702702 if (error)703703 return -error;704704705705- if (copy_to_user(arg, &fsgeo, sizeof(fsgeo)))705705+ /*706706+ * Caller should have passed an argument of type707707+ * xfs_fsop_geom_v1_t. This is a proper subset of the708708+ * xfs_fsop_geom_t that xfs_fs_geometry() fills in.709709+ */710710+ if (copy_to_user(arg, &fsgeo, sizeof(xfs_fsop_geom_v1_t)))706711 return -XFS_ERROR(EFAULT);707712 return 0;708713}
···44#ifndef __ASSEMBLY__55#ifdef CONFIG_MMU6677+#include <linux/mm_types.h>88+79#ifndef __HAVE_ARCH_PTEP_SET_ACCESS_FLAGS810extern int ptep_set_access_flags(struct vm_area_struct *vma,911 unsigned long address, pte_t *ptep,
+1-1
include/drm/drmP.h
···11011101 struct platform_device *platformdev; /**< Platform device struture */1102110211031103 struct drm_sg_mem *sg; /**< Scatter gather memory */11041104- int num_crtcs; /**< Number of CRTCs on this device */11041104+ unsigned int num_crtcs; /**< Number of CRTCs on this device */11051105 void *dev_private; /**< device private data */11061106 void *mm_private;11071107 struct address_space *dev_mapping;
-1
include/keys/rxrpc-type.h
···9999 * structure of raw payloads passed to add_key() or instantiate key100100 */101101struct rxrpc_key_data_v1 {102102- u32 kif_version; /* 1 */103102 u16 security_index;104103 u16 ticket_length;105104 u32 expiry; /* time_t */
···123123#define SOCK_CLOSED 11 /* socket state changed to closed */124124#define OPENING 13 /* open connection w/ (possibly new) peer */125125#define DEAD 14 /* dead, about to kfree */126126+#define BACKOFF 15126127127128/*128129 * A single connection with another host.···161160 struct list_head out_queue;162161 struct list_head out_sent; /* sending or sent but unacked */163162 u64 out_seq; /* last message queued for send */164164- bool out_keepalive_pending;165163166164 u64 in_seq, in_seq_acked; /* last message received, acked */167165
···102102103103extern long arch_ptrace(struct task_struct *child, long request,104104 unsigned long addr, unsigned long data);105105-extern int ptrace_traceme(void);106105extern int ptrace_readdata(struct task_struct *tsk, unsigned long src, char __user *dst, int len);107106extern int ptrace_writedata(struct task_struct *tsk, char __user *src, unsigned long dst, int len);108108-extern int ptrace_attach(struct task_struct *tsk);109109-extern int ptrace_detach(struct task_struct *, unsigned int);110107extern void ptrace_disable(struct task_struct *);111108extern int ptrace_check_attach(struct task_struct *task, int kill);112109extern int ptrace_request(struct task_struct *child, long request,
+3-1
include/linux/rio_regs.h
···1414#define LINUX_RIO_REGS_H15151616/*1717- * In RapidIO, each device has a 2MB configuration space that is1717+ * In RapidIO, each device has a 16MB configuration space that is1818 * accessed via maintenance transactions. Portions of configuration1919 * space are standardized and/or reserved.2020 */2121+#define RIO_MAINT_SPACE_SZ 0x1000000 /* 16MB of RapidIO mainenance space */2222+2123#define RIO_DEV_ID_CAR 0x00 /* [I] Device Identity CAR */2224#define RIO_DEV_INFO_CAR 0x04 /* [I] Device Information CAR */2325#define RIO_ASM_ID_CAR 0x08 /* [I] Assembly Identity CAR */
···201201}202202#endif203203204204-static inline void205205-nf_tproxy_put_sock(struct sock *sk)206206-{207207- /* TIME_WAIT inet sockets have to be handled differently */208208- if ((sk->sk_protocol == IPPROTO_TCP) && (sk->sk_state == TCP_TIME_WAIT))209209- inet_twsk_put(inet_twsk(sk));210210- else211211- sock_put(sk);212212-}213213-214204/* assign a socket to the skb -- consumes sk */215215-int205205+void216206nf_tproxy_assign_sock(struct sk_buff *skb, struct sock *sk);217207218208#endif
+1-1
include/net/sch_generic.h
···199199200200struct qdisc_skb_cb {201201 unsigned int pkt_len;202202- char data[];202202+ long data[];203203};204204205205static inline int qdisc_qlen(struct Qdisc *q)
+1
include/pcmcia/ds.h
···261261#define CONF_ENABLE_ESR 0x0008262262#define CONF_ENABLE_IOCARD 0x0010 /* auto-enabled if IO resources or IRQ263263 * (CONF_ENABLE_IRQ) in use */264264+#define CONF_ENABLE_ZVCARD 0x0020264265265266/* flags used by pcmcia_loop_config() autoconfiguration */266267#define CONF_AUTO_CHECK_VCC 0x0100 /* check for matching Vcc? */
···9494EXPORT_SYMBOL_GPL(nr_irqs);95959696static DEFINE_MUTEX(sparse_irq_lock);9797-static DECLARE_BITMAP(allocated_irqs, NR_IRQS);9797+static DECLARE_BITMAP(allocated_irqs, IRQ_BITMAP_BITS);98989999#ifdef CONFIG_SPARSE_IRQ100100···216216 /* Let arch update nr_irqs and return the nr of preallocated irqs */217217 initcnt = arch_probe_nr_irqs();218218 printk(KERN_INFO "NR_IRQS:%d nr_irqs:%d %d\n", NR_IRQS, nr_irqs, initcnt);219219+220220+ if (WARN_ON(nr_irqs > IRQ_BITMAP_BITS))221221+ nr_irqs = IRQ_BITMAP_BITS;222222+223223+ if (WARN_ON(initcnt > IRQ_BITMAP_BITS))224224+ initcnt = IRQ_BITMAP_BITS;225225+226226+ if (initcnt > nr_irqs)227227+ nr_irqs = initcnt;219228220229 for (i = 0; i < initcnt; i++) {221230 desc = alloc_desc(i, node);
+1-1
kernel/irq/manage.c
···11001100 if (retval)11011101 kfree(action);1102110211031103-#ifdef CONFIG_DEBUG_SHIRQ11031103+#ifdef CONFIG_DEBUG_SHIRQ_FIXME11041104 if (!retval && (irqflags & IRQF_SHARED)) {11051105 /*11061106 * It's a shared IRQ -- the driver ought to be prepared for it
+1-1
kernel/irq/resend.c
···2323#ifdef CONFIG_HARDIRQS_SW_RESEND24242525/* Bitmap to handle software resend of interrupts: */2626-static DECLARE_BITMAP(irqs_resend, NR_IRQS);2626+static DECLARE_BITMAP(irqs_resend, IRQ_BITMAP_BITS);27272828/*2929 * Run software resends of IRQ's
+15-4
kernel/perf_event.c
···782782 raw_spin_unlock_irq(&ctx->lock);783783}784784785785+#define MAX_INTERRUPTS (~0ULL)786786+787787+static void perf_log_throttle(struct perf_event *event, int enable);788788+785789static int786790event_sched_in(struct perf_event *event,787791 struct perf_cpu_context *cpuctx,···798794799795 event->state = PERF_EVENT_STATE_ACTIVE;800796 event->oncpu = smp_processor_id();797797+798798+ /*799799+ * Unthrottle events, since we scheduled we might have missed several800800+ * ticks already, also for a heavily scheduling task there is little801801+ * guarantee it'll get a tick in a timely manner.802802+ */803803+ if (unlikely(event->hw.interrupts == MAX_INTERRUPTS)) {804804+ perf_log_throttle(event, 1);805805+ event->hw.interrupts = 0;806806+ }807807+801808 /*802809 * The new state must be visible before we turn it on in the hardware:803810 */···16101595 perf_event_context_sched_in(ctx);16111596 }16121597}16131613-16141614-#define MAX_INTERRUPTS (~0ULL)16151615-16161616-static void perf_log_throttle(struct perf_event *event, int enable);1617159816181599static u64 perf_calculate_period(struct perf_event *event, u64 nsec, u64 count)16191600{
+3-3
kernel/ptrace.c
···163163 return !err;164164}165165166166-int ptrace_attach(struct task_struct *task)166166+static int ptrace_attach(struct task_struct *task)167167{168168 int retval;169169···219219 * Performs checks and sets PT_PTRACED.220220 * Should be used by all ptrace implementations for PTRACE_TRACEME.221221 */222222-int ptrace_traceme(void)222222+static int ptrace_traceme(void)223223{224224 int ret = -EPERM;225225···293293 return false;294294}295295296296-int ptrace_detach(struct task_struct *child, unsigned int data)296296+static int ptrace_detach(struct task_struct *child, unsigned int data)297297{298298 bool dead = false;299299
···18271827 rwbs[i] = '\0';18281828}1829182918301830-void blk_fill_rwbs_rq(char *rwbs, struct request *rq)18311831-{18321832- int rw = rq->cmd_flags & 0x03;18331833- int bytes;18341834-18351835- if (rq->cmd_flags & REQ_DISCARD)18361836- rw |= REQ_DISCARD;18371837-18381838- if (rq->cmd_flags & REQ_SECURE)18391839- rw |= REQ_SECURE;18401840-18411841- bytes = blk_rq_bytes(rq);18421842-18431843- blk_fill_rwbs(rwbs, rw, bytes);18441844-}18451845-18461830#endif /* CONFIG_EVENT_TRACING */18471831
+1-1
lib/nlattr.c
···148148{149149 int i, len = 0;150150151151- for (i = 0; i < n; i++) {151151+ for (i = 0; i < n; i++, p++) {152152 if (p->len)153153 len += nla_total_size(p->len);154154 else if (nla_attr_minlen[p->type])
+4-2
lib/swiotlb.c
···686686 /*687687 * Ensure that the address returned is DMA'ble688688 */689689- if (!dma_capable(dev, dev_addr, size))690690- panic("map_single: bounce buffer is not DMA'ble");689689+ if (!dma_capable(dev, dev_addr, size)) {690690+ swiotlb_tbl_unmap_single(dev, map, size, dir);691691+ dev_addr = swiotlb_virt_to_bus(dev, io_tlb_overflow_buffer);692692+ }691693692694 return dev_addr;693695}
+19-9
mm/huge_memory.c
···650650651651static inline struct page *alloc_hugepage_vma(int defrag,652652 struct vm_area_struct *vma,653653- unsigned long haddr)653653+ unsigned long haddr, int nd)654654{655655 return alloc_pages_vma(alloc_hugepage_gfpmask(defrag),656656- HPAGE_PMD_ORDER, vma, haddr);656656+ HPAGE_PMD_ORDER, vma, haddr, nd);657657}658658659659#ifndef CONFIG_NUMA···678678 if (unlikely(khugepaged_enter(vma)))679679 return VM_FAULT_OOM;680680 page = alloc_hugepage_vma(transparent_hugepage_defrag(vma),681681- vma, haddr);681681+ vma, haddr, numa_node_id());682682 if (unlikely(!page))683683 goto out;684684 if (unlikely(mem_cgroup_newpage_charge(page, mm, GFP_KERNEL))) {···799799 }800800801801 for (i = 0; i < HPAGE_PMD_NR; i++) {802802- pages[i] = alloc_page_vma(GFP_HIGHUSER_MOVABLE,803803- vma, address);802802+ pages[i] = alloc_page_vma_node(GFP_HIGHUSER_MOVABLE,803803+ vma, address, page_to_nid(page));804804 if (unlikely(!pages[i] ||805805 mem_cgroup_newpage_charge(pages[i], mm,806806 GFP_KERNEL))) {···902902 if (transparent_hugepage_enabled(vma) &&903903 !transparent_hugepage_debug_cow())904904 new_page = alloc_hugepage_vma(transparent_hugepage_defrag(vma),905905- vma, haddr);905905+ vma, haddr, numa_node_id());906906 else907907 new_page = NULL;908908···17451745static void collapse_huge_page(struct mm_struct *mm,17461746 unsigned long address,17471747 struct page **hpage,17481748- struct vm_area_struct *vma)17481748+ struct vm_area_struct *vma,17491749+ int node)17491750{17501751 pgd_t *pgd;17511752 pud_t *pud;···17741773 * mmap_sem in read mode is good idea also to allow greater17751774 * scalability.17761775 */17771777- new_page = alloc_hugepage_vma(khugepaged_defrag(), vma, address);17761776+ new_page = alloc_hugepage_vma(khugepaged_defrag(), vma, address,17771777+ node);17781778 if (unlikely(!new_page)) {17791779 up_read(&mm->mmap_sem);17801780 *hpage = ERR_PTR(-ENOMEM);···19211919 struct page *page;19221920 unsigned long _address;19231921 spinlock_t *ptl;19221922+ int node = -1;1924192319251924 VM_BUG_ON(address & ~HPAGE_PMD_MASK);19261925···19521949 page = vm_normal_page(vma, _address, pteval);19531950 if (unlikely(!page))19541951 goto out_unmap;19521952+ /*19531953+ * Chose the node of the first page. This could19541954+ * be more sophisticated and look at more pages,19551955+ * but isn't for now.19561956+ */19571957+ if (node == -1)19581958+ node = page_to_nid(page);19551959 VM_BUG_ON(PageCompound(page));19561960 if (!PageLRU(page) || PageLocked(page) || !PageAnon(page))19571961 goto out_unmap;···19751965 pte_unmap_unlock(pte, ptl);19761966 if (ret)19771967 /* collapse_huge_page will return with the mmap_sem released */19781978- collapse_huge_page(mm, address, hpage, vma);19681968+ collapse_huge_page(mm, address, hpage, vma, node);19791969out:19801970 return ret;19811971}
···53765376 for (found = 0, iter = 0; iter < pageblock_nr_pages; iter++) {53775377 unsigned long check = pfn + iter;5378537853795379- if (!pfn_valid_within(check)) {53805380- iter++;53795379+ if (!pfn_valid_within(check))53815380 continue;53825382- }53815381+53835382 page = pfn_to_page(check);53845383 if (!page_count(page)) {53855384 if (PageBuddy(page))
···225225 next = start;226226 while (next <= end &&227227 pagevec_lookup(&pvec, mapping, next, PAGEVEC_SIZE)) {228228+ mem_cgroup_uncharge_start();228229 for (i = 0; i < pagevec_count(&pvec); i++) {229230 struct page *page = pvec.pages[i];230231 pgoff_t page_index = page->index;···248247 unlock_page(page);249248 }250249 pagevec_release(&pvec);250250+ mem_cgroup_uncharge_end();251251 cond_resched();252252 }253253
+22-10
mm/vmscan.c
···18411841 if (!(sc->reclaim_mode & RECLAIM_MODE_COMPACTION))18421842 return false;1843184318441844- /*18451845- * If we failed to reclaim and have scanned the full list, stop.18461846- * NOTE: Checking just nr_reclaimed would exit reclaim/compaction far18471847- * faster but obviously would be less likely to succeed18481848- * allocation. If this is desirable, use GFP_REPEAT to decide18491849- * if both reclaimed and scanned should be checked or just18501850- * reclaimed18511851- */18521852- if (!nr_reclaimed && !nr_scanned)18531853- return false;18441844+ /* Consider stopping depending on scan and reclaim activity */18451845+ if (sc->gfp_mask & __GFP_REPEAT) {18461846+ /*18471847+ * For __GFP_REPEAT allocations, stop reclaiming if the18481848+ * full LRU list has been scanned and we are still failing18491849+ * to reclaim pages. This full LRU scan is potentially18501850+ * expensive but a __GFP_REPEAT caller really wants to succeed18511851+ */18521852+ if (!nr_reclaimed && !nr_scanned)18531853+ return false;18541854+ } else {18551855+ /*18561856+ * For non-__GFP_REPEAT allocations which can presumably18571857+ * fail without consequence, stop if we failed to reclaim18581858+ * any pages from the last SWAP_CLUSTER_MAX number of18591859+ * pages that were scanned. This will return to the18601860+ * caller faster at the risk reclaim/compaction and18611861+ * the resulting allocation attempt fails18621862+ */18631863+ if (!nr_reclaimed)18641864+ return false;18651865+ }1854186618551867 /*18561868 * If we have not reclaimed enough pages for compaction and the
···3737 rcu_dereference_protected(X, lockdep_is_held(&br->multicast_lock))38383939#if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE)4040-static inline int ipv6_is_local_multicast(const struct in6_addr *addr)4040+static inline int ipv6_is_transient_multicast(const struct in6_addr *addr)4141{4242- if (ipv6_addr_is_multicast(addr) &&4343- IPV6_ADDR_MC_SCOPE(addr) <= IPV6_ADDR_SCOPE_LINKLOCAL)4242+ if (ipv6_addr_is_multicast(addr) && IPV6_ADDR_MC_FLAG_TRANSIENT(addr))4443 return 1;4544 return 0;4645}···434435 eth = eth_hdr(skb);435436436437 memcpy(eth->h_source, br->dev->dev_addr, 6);437437- ipv6_eth_mc_map(group, eth->h_dest);438438 eth->h_proto = htons(ETH_P_IPV6);439439 skb_put(skb, sizeof(*eth));440440···445447 ip6h->payload_len = htons(8 + sizeof(*mldq));446448 ip6h->nexthdr = IPPROTO_HOPOPTS;447449 ip6h->hop_limit = 1;448448- ipv6_addr_set(&ip6h->saddr, 0, 0, 0, 0);450450+ ipv6_dev_get_saddr(dev_net(br->dev), br->dev, &ip6h->daddr, 0,451451+ &ip6h->saddr);449452 ipv6_addr_set(&ip6h->daddr, htonl(0xff020000), 0, 0, htonl(1));453453+ ipv6_eth_mc_map(&ip6h->daddr, eth->h_dest);450454451455 hopopt = (u8 *)(ip6h + 1);452456 hopopt[0] = IPPROTO_ICMPV6; /* next hdr */···780780{781781 struct br_ip br_group;782782783783- if (ipv6_is_local_multicast(group))783783+ if (!ipv6_is_transient_multicast(group))784784 return 0;785785786786 ipv6_addr_copy(&br_group.u.ip6, group);787787- br_group.proto = htons(ETH_P_IP);787787+ br_group.proto = htons(ETH_P_IPV6);788788789789 return br_multicast_add_group(br, port, &br_group);790790}···1013101310141014 nsrcs = skb_header_pointer(skb,10151015 len + offsetof(struct mld2_grec,10161016- grec_mca),10161016+ grec_nsrcs),10171017 sizeof(_nsrcs), &_nsrcs);10181018 if (!nsrcs)10191019 return -EINVAL;1020102010211021 if (!pskb_may_pull(skb,10221022 len + sizeof(*grec) +10231023- sizeof(struct in6_addr) * (*nsrcs)))10231023+ sizeof(struct in6_addr) * ntohs(*nsrcs)))10241024 return -EINVAL;1025102510261026 grec = (struct mld2_grec *)(skb->data + len);10271027- len += sizeof(*grec) + sizeof(struct in6_addr) * (*nsrcs);10271027+ len += sizeof(*grec) +10281028+ sizeof(struct in6_addr) * ntohs(*nsrcs);1028102910291030 /* We treat these as MLDv1 reports for now. */10301031 switch (grec->grec_type) {···13411340{13421341 struct br_ip br_group;1343134213441344- if (ipv6_is_local_multicast(group))13431343+ if (!ipv6_is_transient_multicast(group))13451344 return;1346134513471346 ipv6_addr_copy(&br_group.u.ip6, group);
+54-17
net/ceph/messenger.c
···336336 ceph_msg_put(con->out_msg);337337 con->out_msg = NULL;338338 }339339- con->out_keepalive_pending = false;340339 con->in_seq = 0;341340 con->in_seq_acked = 0;342341}···12471248 con->auth_retry);12481249 if (con->auth_retry == 2) {12491250 con->error_msg = "connect authorization failure";12501250- reset_connection(con);12511251- set_bit(CLOSED, &con->state);12521251 return -1;12531252 }12541253 con->auth_retry = 1;···1712171517131716 /* open the socket first? */17141717 if (con->sock == NULL) {17151715- /*17161716- * if we were STANDBY and are reconnecting _this_17171717- * connection, bump connect_seq now. Always bump17181718- * global_seq.17191719- */17201720- if (test_and_clear_bit(STANDBY, &con->state))17211721- con->connect_seq++;17221722-17231718 prepare_write_banner(msgr, con);17241719 prepare_write_connect(msgr, con, 1);17251720 prepare_read_banner(con);···19401951 work.work);1941195219421953 mutex_lock(&con->mutex);19541954+ if (test_and_clear_bit(BACKOFF, &con->state)) {19551955+ dout("con_work %p backing off\n", con);19561956+ if (queue_delayed_work(ceph_msgr_wq, &con->work,19571957+ round_jiffies_relative(con->delay))) {19581958+ dout("con_work %p backoff %lu\n", con, con->delay);19591959+ mutex_unlock(&con->mutex);19601960+ return;19611961+ } else {19621962+ con->ops->put(con);19631963+ dout("con_work %p FAILED to back off %lu\n", con,19641964+ con->delay);19651965+ }19661966+ }1943196719681968+ if (test_bit(STANDBY, &con->state)) {19691969+ dout("con_work %p STANDBY\n", con);19701970+ goto done;19711971+ }19441972 if (test_bit(CLOSED, &con->state)) { /* e.g. if we are replaced */19451973 dout("con_work CLOSED\n");19461974 con_close_socket(con);···20142008 /* Requeue anything that hasn't been acked */20152009 list_splice_init(&con->out_sent, &con->out_queue);2016201020172017- /* If there are no messages in the queue, place the connection20182018- * in a STANDBY state (i.e., don't try to reconnect just yet). */20192019- if (list_empty(&con->out_queue) && !con->out_keepalive_pending) {20202020- dout("fault setting STANDBY\n");20112011+ /* If there are no messages queued or keepalive pending, place20122012+ * the connection in a STANDBY state */20132013+ if (list_empty(&con->out_queue) &&20142014+ !test_bit(KEEPALIVE_PENDING, &con->state)) {20152015+ dout("fault %p setting STANDBY clearing WRITE_PENDING\n", con);20162016+ clear_bit(WRITE_PENDING, &con->state);20212017 set_bit(STANDBY, &con->state);20222018 } else {20232019 /* retry after a delay. */···20272019 con->delay = BASE_DELAY_INTERVAL;20282020 else if (con->delay < MAX_DELAY_INTERVAL)20292021 con->delay *= 2;20302030- dout("fault queueing %p delay %lu\n", con, con->delay);20312022 con->ops->get(con);20322023 if (queue_delayed_work(ceph_msgr_wq, &con->work,20332033- round_jiffies_relative(con->delay)) == 0)20242024+ round_jiffies_relative(con->delay))) {20252025+ dout("fault queued %p delay %lu\n", con, con->delay);20262026+ } else {20342027 con->ops->put(con);20282028+ dout("fault failed to queue %p delay %lu, backoff\n",20292029+ con, con->delay);20302030+ /*20312031+ * In many cases we see a socket state change20322032+ * while con_work is running and end up20332033+ * queuing (non-delayed) work, such that we20342034+ * can't backoff with a delay. Set a flag so20352035+ * that when con_work restarts we schedule the20362036+ * delay then.20372037+ */20382038+ set_bit(BACKOFF, &con->state);20392039+ }20352040 }2036204120372042out_unlock:···21152094}21162095EXPORT_SYMBOL(ceph_messenger_destroy);2117209620972097+static void clear_standby(struct ceph_connection *con)20982098+{20992099+ /* come back from STANDBY? */21002100+ if (test_and_clear_bit(STANDBY, &con->state)) {21012101+ mutex_lock(&con->mutex);21022102+ dout("clear_standby %p and ++connect_seq\n", con);21032103+ con->connect_seq++;21042104+ WARN_ON(test_bit(WRITE_PENDING, &con->state));21052105+ WARN_ON(test_bit(KEEPALIVE_PENDING, &con->state));21062106+ mutex_unlock(&con->mutex);21072107+ }21082108+}21092109+21182110/*21192111 * Queue up an outgoing message on the given connection.21202112 */···2160212621612127 /* if there wasn't anything waiting to send before, queue21622128 * new work */21292129+ clear_standby(con);21632130 if (test_and_set_bit(WRITE_PENDING, &con->state) == 0)21642131 queue_con(con);21652132}···22262191 */22272192void ceph_con_keepalive(struct ceph_connection *con)22282193{21942194+ dout("con_keepalive %p\n", con);21952195+ clear_standby(con);22292196 if (test_and_set_bit(KEEPALIVE_PENDING, &con->state) == 0 &&22302197 test_and_set_bit(WRITE_PENDING, &con->state) == 0)22312198 queue_con(con);
···12221222 }1223122312241224 /* D-SACK for already forgotten data... Do dumb counting. */12251225- if (dup_sack &&12251225+ if (dup_sack && tp->undo_marker && tp->undo_retrans &&12261226 !after(end_seq_0, prior_snd_una) &&12271227 after(end_seq_0, tp->undo_marker))12281228 tp->undo_retrans--;···1299129913001300 /* Account D-SACK for retransmitted packet. */13011301 if (dup_sack && (sacked & TCPCB_RETRANS)) {13021302- if (after(TCP_SKB_CB(skb)->end_seq, tp->undo_marker))13021302+ if (tp->undo_marker && tp->undo_retrans &&13031303+ after(TCP_SKB_CB(skb)->end_seq, tp->undo_marker))13031304 tp->undo_retrans--;13041305 if (sacked & TCPCB_SACKED_ACKED)13051306 state->reord = min(fack_count, state->reord);
+1-1
net/ipv4/tcp_output.c
···21622162 if (!tp->retrans_stamp)21632163 tp->retrans_stamp = TCP_SKB_CB(skb)->when;2164216421652165- tp->undo_retrans++;21652165+ tp->undo_retrans += tcp_skb_pcount(skb);2166216621672167 /* snd_nxt is stored to detect loss of retransmitted segment,21682168 * see tcp_input.c tcp_sacktag_write_queue().
+1-1
net/ipv6/netfilter/ip6t_LOG.c
···410410 if (p != NULL) {411411 sb_add(m, "%02x", *p++);412412 for (i = 1; i < len; i++)413413- sb_add(m, ":%02x", p[i]);413413+ sb_add(m, ":%02x", *p++);414414 }415415 sb_add(m, " ");416416
+10-7
net/ipv6/route.c
···25572557int ipv6_sysctl_rtcache_flush(ctl_table *ctl, int write,25582558 void __user *buffer, size_t *lenp, loff_t *ppos)25592559{25602560- struct net *net = current->nsproxy->net_ns;25612561- int delay = net->ipv6.sysctl.flush_delay;25622562- if (write) {25632563- proc_dointvec(ctl, write, buffer, lenp, ppos);25642564- fib6_run_gc(delay <= 0 ? ~0UL : (unsigned long)delay, net);25652565- return 0;25662566- } else25602560+ struct net *net;25612561+ int delay;25622562+ if (!write)25672563 return -EINVAL;25642564+25652565+ net = (struct net *)ctl->extra1;25662566+ delay = net->ipv6.sysctl.flush_delay;25672567+ proc_dointvec(ctl, write, buffer, lenp, ppos);25682568+ fib6_run_gc(delay <= 0 ? ~0UL : (unsigned long)delay, net);25692569+ return 0;25682570}2569257125702572ctl_table ipv6_route_table_template[] = {···2653265126542652 if (table) {26552653 table[0].data = &net->ipv6.sysctl.flush_delay;26542654+ table[0].extra1 = net;26562655 table[1].data = &net->ipv6.ip6_dst_ops.gc_thresh;26572656 table[2].data = &net->ipv6.sysctl.ip6_rt_max_size;26582657 table[3].data = &net->ipv6.sysctl.ip6_rt_gc_min_interval;
···10331033 if (is_multicast_ether_addr(hdr->addr1))10341034 return;1035103510361036+ /*10371037+ * In case we receive frames after disassociation.10381038+ */10391039+ if (!sdata->u.mgd.associated)10401040+ return;10411041+10361042 ieee80211_sta_reset_conn_monitor(sdata);10371043}10381044
···2828 skb->destructor = NULL;29293030 if (sk)3131- nf_tproxy_put_sock(sk);3131+ sock_put(sk);3232}33333434/* consumes sk */3535-int3535+void3636nf_tproxy_assign_sock(struct sk_buff *skb, struct sock *sk)3737{3838- bool transparent = (sk->sk_state == TCP_TIME_WAIT) ?3939- inet_twsk(sk)->tw_transparent :4040- inet_sk(sk)->transparent;3838+ /* assigning tw sockets complicates things; most3939+ * skb->sk->X checks would have to test sk->sk_state first */4040+ if (sk->sk_state == TCP_TIME_WAIT) {4141+ inet_twsk_put(inet_twsk(sk));4242+ return;4343+ }41444242- if (transparent) {4343- skb_orphan(skb);4444- skb->sk = sk;4545- skb->destructor = nf_tproxy_destructor;4646- return 1;4747- } else4848- nf_tproxy_put_sock(sk);4949-5050- return 0;4545+ skb_orphan(skb);4646+ skb->sk = sk;4747+ skb->destructor = nf_tproxy_destructor;5148}5249EXPORT_SYMBOL_GPL(nf_tproxy_assign_sock);5350
+20-2
net/netfilter/xt_TPROXY.c
···3333#include <net/netfilter/nf_tproxy_core.h>3434#include <linux/netfilter/xt_TPROXY.h>35353636+static bool tproxy_sk_is_transparent(struct sock *sk)3737+{3838+ if (sk->sk_state != TCP_TIME_WAIT) {3939+ if (inet_sk(sk)->transparent)4040+ return true;4141+ sock_put(sk);4242+ } else {4343+ if (inet_twsk(sk)->tw_transparent)4444+ return true;4545+ inet_twsk_put(inet_twsk(sk));4646+ }4747+ return false;4848+}4949+3650static inline __be323751tproxy_laddr4(struct sk_buff *skb, __be32 user_laddr, __be32 daddr)3852{···155141 skb->dev, NFT_LOOKUP_LISTENER);156142157143 /* NOTE: assign_sock consumes our sk reference */158158- if (sk && nf_tproxy_assign_sock(skb, sk)) {144144+ if (sk && tproxy_sk_is_transparent(sk)) {159145 /* This should be in a separate target, but we don't do multiple160146 targets on the same rule yet */161147 skb->mark = (skb->mark & ~mark_mask) ^ mark_value;···163149 pr_debug("redirecting: proto %hhu %pI4:%hu -> %pI4:%hu, mark: %x\n",164150 iph->protocol, &iph->daddr, ntohs(hp->dest),165151 &laddr, ntohs(lport), skb->mark);152152+153153+ nf_tproxy_assign_sock(skb, sk);166154 return NF_ACCEPT;167155 }168156···322306 par->in, NFT_LOOKUP_LISTENER);323307324308 /* NOTE: assign_sock consumes our sk reference */325325- if (sk && nf_tproxy_assign_sock(skb, sk)) {309309+ if (sk && tproxy_sk_is_transparent(sk)) {326310 /* This should be in a separate target, but we don't do multiple327311 targets on the same rule yet */328312 skb->mark = (skb->mark & ~tgi->mark_mask) ^ tgi->mark_value;···330314 pr_debug("redirecting: proto %hhu %pI6:%hu -> %pI6:%hu, mark: %x\n",331315 tproto, &iph->saddr, ntohs(hp->source),332316 laddr, ntohs(lport), skb->mark);317317+318318+ nf_tproxy_assign_sock(skb, sk);333319 return NF_ACCEPT;334320 }335321
+11-2
net/netfilter/xt_socket.c
···3535#include <net/netfilter/nf_conntrack.h>3636#endif37373838+static void3939+xt_socket_put_sk(struct sock *sk)4040+{4141+ if (sk->sk_state == TCP_TIME_WAIT)4242+ inet_twsk_put(inet_twsk(sk));4343+ else4444+ sock_put(sk);4545+}4646+3847static int3948extract_icmp4_fields(const struct sk_buff *skb,4049 u8 *protocol,···173164 (sk->sk_state == TCP_TIME_WAIT &&174165 inet_twsk(sk)->tw_transparent));175166176176- nf_tproxy_put_sock(sk);167167+ xt_socket_put_sk(sk);177168178169 if (wildcard || !transparent)179170 sk = NULL;···307298 (sk->sk_state == TCP_TIME_WAIT &&308299 inet_twsk(sk)->tw_transparent));309300310310- nf_tproxy_put_sock(sk);301301+ xt_socket_put_sk(sk);311302312303 if (wildcard || !transparent)313304 sk = NULL;
+14-4
net/netlink/af_netlink.c
···14071407 int noblock = flags&MSG_DONTWAIT;14081408 size_t copied;14091409 struct sk_buff *skb, *data_skb;14101410- int err;14101410+ int err, ret;1411141114121412 if (flags&MSG_OOB)14131413 return -EOPNOTSUPP;···1470147014711471 skb_free_datagram(sk, skb);1472147214731473- if (nlk->cb && atomic_read(&sk->sk_rmem_alloc) <= sk->sk_rcvbuf / 2)14741474- netlink_dump(sk);14731473+ if (nlk->cb && atomic_read(&sk->sk_rmem_alloc) <= sk->sk_rcvbuf / 2) {14741474+ ret = netlink_dump(sk);14751475+ if (ret) {14761476+ sk->sk_err = ret;14771477+ sk->sk_error_report(sk);14781478+ }14791479+ }1475148014761481 scm_recv(sock, msg, siocb->scm, flags);14771482out:···17411736 struct netlink_callback *cb;17421737 struct sock *sk;17431738 struct netlink_sock *nlk;17391739+ int ret;1744174017451741 cb = kzalloc(sizeof(*cb), GFP_KERNEL);17461742 if (cb == NULL)···17701764 nlk->cb = cb;17711765 mutex_unlock(nlk->cb_mutex);1772176617731773- netlink_dump(sk);17671767+ ret = netlink_dump(sk);17681768+17741769 sock_put(sk);17701770+17711771+ if (ret)17721772+ return ret;1775177317761774 /* We successfully started a dump, by returning -EINTR we17771775 * signal not to send ACK even if it was requested.
+1
net/rxrpc/ar-input.c
···423423 goto protocol_error;424424 }425425426426+ case RXRPC_PACKET_TYPE_ACKALL:426427 case RXRPC_PACKET_TYPE_ACK:427428 /* ACK processing is done in process context */428429 read_lock_bh(&call->state_lock);
···20292029 *errp = sctp_make_op_error_fixed(asoc, chunk);2030203020312031 if (*errp) {20322032- sctp_init_cause_fixed(*errp, SCTP_ERROR_UNKNOWN_PARAM,20332033- WORD_ROUND(ntohs(param.p->length)));20342034- sctp_addto_chunk_fixed(*errp,20352035- WORD_ROUND(ntohs(param.p->length)),20362036- param.v);20322032+ if (!sctp_init_cause_fixed(*errp, SCTP_ERROR_UNKNOWN_PARAM,20332033+ WORD_ROUND(ntohs(param.p->length))))20342034+ sctp_addto_chunk_fixed(*errp,20352035+ WORD_ROUND(ntohs(param.p->length)),20362036+ param.v);20372037 } else {20382038 /* If there is no memory for generating the ERROR20392039 * report as specified, an ABORT will be triggered
···14821482 WM8903_MICDET_EINT | WM8903_MICSHRT_EINT,14831483 irq_mask);1484148414851485- if (det && shrt) {14851485+ if (det || shrt) {14861486 /* Enable mic detection, this may not have been set through14871487 * platform data (eg, if the defaults are OK). */14881488 snd_soc_update_bits(codec, WM8903_WRITE_SEQUENCER_0,
···712712 !path->connected(path->source, path->sink))713713 continue;714714715715- if (path->sink && path->sink->power_check &&715715+ if (!path->sink)716716+ continue;717717+718718+ if (path->sink->force) {719719+ power = 1;720720+ break;721721+ }722722+723723+ if (path->sink->power_check &&716724 path->sink->power_check(path->sink)) {717725 power = 1;718726 break;···16351627int snd_soc_dapm_new_widgets(struct snd_soc_dapm_context *dapm)16361628{16371629 struct snd_soc_dapm_widget *w;16301630+ unsigned int val;1638163116391632 list_for_each_entry(w, &dapm->card->widgets, list)16401633 {···16841675 case snd_soc_dapm_post:16851676 break;16861677 }16781678+16791679+ /* Read the initial power state from the device */16801680+ if (w->reg >= 0) {16811681+ val = snd_soc_read(w->codec, w->reg);16821682+ val &= 1 << w->shift;16831683+ if (w->invert)16841684+ val = !val;16851685+16861686+ if (val)16871687+ w->power = 1;16881688+ }16891689+16871690 w->new = 1;16881691 }16891692
···3636 struct snd_card *card;3737 u32 usb_id;3838 int shutdown;3939+ struct mutex shutdown_mutex;3940 unsigned int txfr_quirk:1; /* Subframe boundaries on transfers */4041 int num_interfaces;4142 int num_suspended_intf;
+3-3
tools/perf/builtin-timechart.c
···264264 c->start_time = start;265265 if (p->start_time == 0 || p->start_time > start)266266 p->start_time = start;267267-268268- if (cpu > numcpus)269269- numcpus = cpu;270267}271268272269#define MAX_CPUS 4096···507510508511 if (!event_str)509512 return 0;513513+514514+ if (sample->cpu > numcpus)515515+ numcpus = sample->cpu;510516511517 if (strcmp(event_str, "power:cpu_idle") == 0) {512518 struct power_processor_entry *ppe = (void *)te;