···346346 when RTO retransmissions remain unacknowledged.347347 See tcp_retries2 for more details.348348349349- The default value is 7.349349+ The default value is 8.350350 If your machine is a loaded WEB server,351351 you should think about lowering this value, such sockets352352 may consume significant resources. Cf. tcp_max_orphans.
+1-1
Documentation/x86/boot.txt
···674674675675Field name: init_size676676Type: read677677-Offset/size: 0x25c/4677677+Offset/size: 0x260/4678678679679 This field indicates the amount of linear contiguous memory starting680680 at the kernel runtime start address that the kernel needs before it
···254254{255255 struct davinci_gpio_regs __iomem *g;256256 u32 mask = 0xffff;257257+ struct davinci_gpio_controller *d;257258258258- g = (__force struct davinci_gpio_regs __iomem *) irq_desc_get_handler_data(desc);259259+ d = (struct davinci_gpio_controller *)irq_desc_get_handler_data(desc);260260+ g = (struct davinci_gpio_regs __iomem *)d->regs;259261260262 /* we only care about one bank */261263 if (irq & 1)···276274 if (!status)277275 break;278276 __raw_writel(status, &g->intstat);279279- if (irq & 1)280280- status >>= 16;281277282278 /* now demux them to the right lowlevel handler */283283- n = (int)irq_get_handler_data(irq);279279+ n = d->irq_base;280280+ if (irq & 1) {281281+ n += 16;282282+ status >>= 16;283283+ }284284+284285 while (status) {285286 res = ffs(status);286287 n += res;···429424430425 /* set up all irqs in this bank */431426 irq_set_chained_handler(bank_irq, gpio_irq_handler);432432- irq_set_handler_data(bank_irq, (__force void *)g);427427+428428+ /*429429+ * Each chip handles 32 gpios, and each irq bank consists of 16430430+ * gpio irqs. Pass the irq bank's corresponding controller to431431+ * the chained irq handler.432432+ */433433+ irq_set_handler_data(bank_irq, &chips[gpio / 32]);433434434435 for (i = 0; i < 16 && gpio < ngpio; i++, irq++, gpio++) {435436 irq_set_chip(irq, &gpio_irqchip);
···712712 * get control of an dma channel713713*/714714715715-int s3c2410_dma_request(unsigned int channel,715715+int s3c2410_dma_request(enum dma_ch channel,716716 struct s3c2410_dma_client *client,717717 void *dev)718718{···783783 * allowed to go through.784784*/785785786786-int s3c2410_dma_free(unsigned int channel, struct s3c2410_dma_client *client)786786+int s3c2410_dma_free(enum dma_ch channel, struct s3c2410_dma_client *client)787787{788788 struct s3c2410_dma_chan *chan = s3c_dma_lookup_channel(channel);789789 unsigned long flags;···974974}975975976976int977977-s3c2410_dma_ctrl(unsigned int channel, enum s3c2410_chan_op op)977977+s3c2410_dma_ctrl(enum dma_ch channel, enum s3c2410_chan_op op)978978{979979 struct s3c2410_dma_chan *chan = s3c_dma_lookup_channel(channel);980980···10211021 * xfersize: size of unit in bytes (1,2,4)10221022*/1023102310241024-int s3c2410_dma_config(unsigned int channel,10241024+int s3c2410_dma_config(enum dma_ch channel,10251025 int xferunit)10261026{10271027 struct s3c2410_dma_chan *chan = s3c_dma_lookup_channel(channel);···11001100 * devaddr: physical address of the source11011101*/1102110211031103-int s3c2410_dma_devconfig(unsigned int channel,11031103+int s3c2410_dma_devconfig(enum dma_ch channel,11041104 enum s3c2410_dmasrc source,11051105 unsigned long devaddr)11061106{···11731173 * returns the current transfer points for the dma source and destination11741174*/1175117511761176-int s3c2410_dma_getposition(unsigned int channel, dma_addr_t *src, dma_addr_t *dst)11761176+int s3c2410_dma_getposition(enum dma_ch channel, dma_addr_t *src, dma_addr_t *dst)11771177{11781178 struct s3c2410_dma_chan *chan = s3c_dma_lookup_channel(channel);11791179
···4141 * irq?4242*/43434444-int s3c2410_dma_set_opfn(unsigned int channel, s3c2410_dma_opfn_t rtn)4444+int s3c2410_dma_set_opfn(enum dma_ch channel, s3c2410_dma_opfn_t rtn)4545{4646 struct s3c2410_dma_chan *chan = s3c_dma_lookup_channel(channel);4747···5656}5757EXPORT_SYMBOL(s3c2410_dma_set_opfn);58585959-int s3c2410_dma_set_buffdone_fn(unsigned int channel, s3c2410_dma_cbfn_t rtn)5959+int s3c2410_dma_set_buffdone_fn(enum dma_ch channel, s3c2410_dma_cbfn_t rtn)6060{6161 struct s3c2410_dma_chan *chan = s3c_dma_lookup_channel(channel);6262···7171}7272EXPORT_SYMBOL(s3c2410_dma_set_buffdone_fn);73737474-int s3c2410_dma_setflags(unsigned int channel, unsigned int flags)7474+int s3c2410_dma_setflags(enum dma_ch channel, unsigned int flags)7575{7676 struct s3c2410_dma_chan *chan = s3c_dma_lookup_channel(channel);7777
+11-10
arch/arm/plat-samsung/include/plat/dma.h
···4242};43434444struct s3c2410_dma_chan;4545+enum dma_ch;45464647/* s3c2410_dma_cbfn_t4748 *···6362 * request a dma channel exclusivley6463*/65646666-extern int s3c2410_dma_request(unsigned int channel,6565+extern int s3c2410_dma_request(enum dma_ch channel,6766 struct s3c2410_dma_client *, void *dev);68676968···7271 * change the state of the dma channel7372*/74737575-extern int s3c2410_dma_ctrl(unsigned int channel, enum s3c2410_chan_op op);7474+extern int s3c2410_dma_ctrl(enum dma_ch channel, enum s3c2410_chan_op op);76757776/* s3c2410_dma_setflags7877 *7978 * set the channel's flags to a given state8079*/81808282-extern int s3c2410_dma_setflags(unsigned int channel,8181+extern int s3c2410_dma_setflags(enum dma_ch channel,8382 unsigned int flags);84838584/* s3c2410_dma_free···8786 * free the dma channel (will also abort any outstanding operations)8887*/89889090-extern int s3c2410_dma_free(unsigned int channel, struct s3c2410_dma_client *);8989+extern int s3c2410_dma_free(enum dma_ch channel, struct s3c2410_dma_client *);91909291/* s3c2410_dma_enqueue9392 *···9695 * drained before the buffer is given to the DMA system.9796*/98979999-extern int s3c2410_dma_enqueue(unsigned int channel, void *id,9898+extern int s3c2410_dma_enqueue(enum dma_ch channel, void *id,10099 dma_addr_t data, int size);101100102101/* s3c2410_dma_config···104103 * configure the dma channel105104*/106105107107-extern int s3c2410_dma_config(unsigned int channel, int xferunit);106106+extern int s3c2410_dma_config(enum dma_ch channel, int xferunit);108107109108/* s3c2410_dma_devconfig110109 *111110 * configure the device we're talking to112111*/113112114114-extern int s3c2410_dma_devconfig(unsigned int channel,113113+extern int s3c2410_dma_devconfig(enum dma_ch channel,115114 enum s3c2410_dmasrc source, unsigned long devaddr);116115117116/* s3c2410_dma_getposition···119118 * get the position that the dma transfer is currently at120119*/121120122122-extern int s3c2410_dma_getposition(unsigned int channel,121121+extern int s3c2410_dma_getposition(enum dma_ch channel,123122 dma_addr_t *src, dma_addr_t *dest);124123125125-extern int s3c2410_dma_set_opfn(unsigned int, s3c2410_dma_opfn_t rtn);126126-extern int s3c2410_dma_set_buffdone_fn(unsigned int, s3c2410_dma_cbfn_t rtn);124124+extern int s3c2410_dma_set_opfn(enum dma_ch, s3c2410_dma_opfn_t rtn);125125+extern int s3c2410_dma_set_buffdone_fn(enum dma_ch, s3c2410_dma_cbfn_t rtn);127126128127
···1414#include <linux/interrupt.h>1515#include <linux/kernel.h>1616#include <linux/spinlock.h>1717-#include <linux/sysdev.h>1717+#include <linux/syscore_ops.h>1818#include <linux/irq.h>19192020#include <asm/i8259.h>···215215 }216216}217217218218-static int i8259A_resume(struct sys_device *dev)218218+static void i8259A_resume(void)219219{220220 if (i8259A_auto_eoi >= 0)221221 init_8259A(i8259A_auto_eoi);222222- return 0;223222}224223225225-static int i8259A_shutdown(struct sys_device *dev)224224+static void i8259A_shutdown(void)226225{227226 /* Put the i8259A into a quiescent state that228227 * the kernel initialization code can get it···231232 outb(0xff, PIC_MASTER_IMR); /* mask all of 8259A-1 */232233 outb(0xff, PIC_SLAVE_IMR); /* mask all of 8259A-1 */233234 }234234- return 0;235235}236236237237-static struct sysdev_class i8259_sysdev_class = {238238- .name = "i8259",237237+static struct syscore_ops i8259_syscore_ops = {239238 .resume = i8259A_resume,240239 .shutdown = i8259A_shutdown,241240};242241243243-static struct sys_device device_i8259A = {244244- .id = 0,245245- .cls = &i8259_sysdev_class,246246-};247247-248242static int __init i8259A_init_sysfs(void)249243{250250- int error = sysdev_class_register(&i8259_sysdev_class);251251- if (!error)252252- error = sysdev_register(&device_i8259A);253253- return error;244244+ register_syscore_ops(&i8259_syscore_ops);245245+ return 0;254246}255247256248device_initcall(i8259A_init_sysfs);
+19-11
arch/powerpc/platforms/pseries/hotplug-memory.c
···1212#include <linux/of.h>1313#include <linux/memblock.h>1414#include <linux/vmalloc.h>1515+#include <linux/memory.h>1616+1517#include <asm/firmware.h>1618#include <asm/machdep.h>1719#include <asm/pSeries_reconfig.h>···2220static unsigned long get_memblock_size(void)2321{2422 struct device_node *np;2525- unsigned int memblock_size = 0;2323+ unsigned int memblock_size = MIN_MEMORY_BLOCK_SIZE;2424+ struct resource r;26252726 np = of_find_node_by_path("/ibm,dynamic-reconfiguration-memory");2827 if (np) {2929- const unsigned long *size;2828+ const __be64 *size;30293130 size = of_get_property(np, "ibm,lmb-size", NULL);3232- memblock_size = size ? *size : 0;3333-3131+ if (size)3232+ memblock_size = be64_to_cpup(size);3433 of_node_put(np);3535- } else {3434+ } else if (machine_is(pseries)) {3535+ /* This fallback really only applies to pseries */3636 unsigned int memzero_size = 0;3737- const unsigned int *regs;38373938 np = of_find_node_by_path("/memory@0");4039 if (np) {4141- regs = of_get_property(np, "reg", NULL);4242- memzero_size = regs ? regs[3] : 0;4040+ if (!of_address_to_resource(np, 0, &r))4141+ memzero_size = resource_size(&r);4342 of_node_put(np);4443 }4544···5350 sprintf(buf, "/memory@%x", memzero_size);5451 np = of_find_node_by_path(buf);5552 if (np) {5656- regs = of_get_property(np, "reg", NULL);5757- memblock_size = regs ? regs[3] : 0;5353+ if (!of_address_to_resource(np, 0, &r))5454+ memblock_size = resource_size(&r);5855 of_node_put(np);5956 }6057 }6158 }6262-6359 return memblock_size;6460}65616262+/* WARNING: This is going to override the generic definition whenever6363+ * pseries is built-in regardless of what platform is active at boot6464+ * time. This is fine for now as this is the only "option" and it6565+ * should work everywhere. If not, we'll have to turn this into a6666+ * ppc_md. callback6767+ */6668unsigned long memory_block_size_bytes(void)6769{6870 return get_memblock_size();
+4-4
arch/sparc/include/asm/irqflags_32.h
···1818extern unsigned long arch_local_irq_save(void);1919extern void arch_local_irq_enable(void);20202121-static inline unsigned long arch_local_save_flags(void)2121+static inline notrace unsigned long arch_local_save_flags(void)2222{2323 unsigned long flags;2424···2626 return flags;2727}28282929-static inline void arch_local_irq_disable(void)2929+static inline notrace void arch_local_irq_disable(void)3030{3131 arch_local_irq_save();3232}33333434-static inline bool arch_irqs_disabled_flags(unsigned long flags)3434+static inline notrace bool arch_irqs_disabled_flags(unsigned long flags)3535{3636 return (flags & PSR_PIL) != 0;3737}38383939-static inline bool arch_irqs_disabled(void)3939+static inline notrace bool arch_irqs_disabled(void)4040{4141 return arch_irqs_disabled_flags(arch_local_save_flags());4242}
+7-7
arch/sparc/include/asm/irqflags_64.h
···14141515#ifndef __ASSEMBLY__16161717-static inline unsigned long arch_local_save_flags(void)1717+static inline notrace unsigned long arch_local_save_flags(void)1818{1919 unsigned long flags;2020···2626 return flags;2727}28282929-static inline void arch_local_irq_restore(unsigned long flags)2929+static inline notrace void arch_local_irq_restore(unsigned long flags)3030{3131 __asm__ __volatile__(3232 "wrpr %0, %%pil"···3636 );3737}38383939-static inline void arch_local_irq_disable(void)3939+static inline notrace void arch_local_irq_disable(void)4040{4141 __asm__ __volatile__(4242 "wrpr %0, %%pil"···4646 );4747}48484949-static inline void arch_local_irq_enable(void)4949+static inline notrace void arch_local_irq_enable(void)5050{5151 __asm__ __volatile__(5252 "wrpr 0, %%pil"···5656 );5757}58585959-static inline int arch_irqs_disabled_flags(unsigned long flags)5959+static inline notrace int arch_irqs_disabled_flags(unsigned long flags)6060{6161 return (flags > 0);6262}63636464-static inline int arch_irqs_disabled(void)6464+static inline notrace int arch_irqs_disabled(void)6565{6666 return arch_irqs_disabled_flags(arch_local_save_flags());6767}68686969-static inline unsigned long arch_local_irq_save(void)6969+static inline notrace unsigned long arch_local_irq_save(void)7070{7171 unsigned long flags, tmp;7272
···226226 * Leon2 and Leon3 differ in their way of telling cache information227227 *228228 */229229-int leon_flush_needed(void)229229+int __init leon_flush_needed(void)230230{231231 int flush_needed = -1;232232 unsigned int ssize, sets;
+1-1
arch/x86/Kconfig
···11701170config AMD_NUMA11711171 def_bool y11721172 prompt "Old style AMD Opteron NUMA detection"11731173- depends on NUMA && PCI11731173+ depends on X86_64 && NUMA && PCI11741174 ---help---11751175 Enable AMD NUMA node topology detection. You should say Y here if11761176 you have a multi processor AMD system. This uses an old method to
+24
arch/x86/kernel/reboot.c
···419419 DMI_MATCH(DMI_PRODUCT_NAME, "iMac9,1"),420420 },421421 },422422+ { /* Handle problems with rebooting on the Latitude E6320. */423423+ .callback = set_pci_reboot,424424+ .ident = "Dell Latitude E6320",425425+ .matches = {426426+ DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),427427+ DMI_MATCH(DMI_PRODUCT_NAME, "Latitude E6320"),428428+ },429429+ },430430+ { /* Handle problems with rebooting on the Latitude E5420. */431431+ .callback = set_pci_reboot,432432+ .ident = "Dell Latitude E5420",433433+ .matches = {434434+ DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),435435+ DMI_MATCH(DMI_PRODUCT_NAME, "Latitude E5420"),436436+ },437437+ },438438+ { /* Handle problems with rebooting on the Latitude E6420. */439439+ .callback = set_pci_reboot,440440+ .ident = "Dell Latitude E6420",441441+ .matches = {442442+ DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),443443+ DMI_MATCH(DMI_PRODUCT_NAME, "Latitude E6420"),444444+ },445445+ },422446 { }423447};424448
+1-2
arch/x86/mm/init_64.c
···2828#include <linux/poison.h>2929#include <linux/dma-mapping.h>3030#include <linux/module.h>3131+#include <linux/memory.h>3132#include <linux/memory_hotplug.h>3233#include <linux/nmi.h>3334#include <linux/gfp.h>···896895}897896898897#ifdef CONFIG_X86_UV899899-#define MIN_MEMORY_BLOCK_SIZE (1 << SECTION_SIZE_BITS)900900-901898unsigned long memory_block_size_bytes(void)902899{903900 if (is_uv_system()) {
+11-1
drivers/acpi/apei/hest.c
···139139{140140 struct platform_device *ghes_dev;141141 struct ghes_arr *ghes_arr = data;142142- int rc;142142+ int rc, i;143143144144 if (hest_hdr->type != ACPI_HEST_TYPE_GENERIC_ERROR)145145 return 0;146146147147 if (!((struct acpi_hest_generic *)hest_hdr)->enabled)148148 return 0;149149+ for (i = 0; i < ghes_arr->count; i++) {150150+ struct acpi_hest_header *hdr;151151+ ghes_dev = ghes_arr->ghes_devs[i];152152+ hdr = *(struct acpi_hest_header **)ghes_dev->dev.platform_data;153153+ if (hdr->source_id == hest_hdr->source_id) {154154+ pr_warning(FW_WARN HEST_PFX "Duplicated hardware error source ID: %d.\n",155155+ hdr->source_id);156156+ return -EIO;157157+ }158158+ }149159 ghes_dev = platform_device_alloc("GHES", hest_hdr->source_id);150160 if (!ghes_dev)151161 return -ENOMEM;
-17
drivers/acpi/osl.c
···13331333EXPORT_SYMBOL(acpi_resources_are_enforced);1334133413351335/*13361336- * Create and initialize a spinlock.13371337- */13381338-acpi_status13391339-acpi_os_create_lock(acpi_spinlock *out_handle)13401340-{13411341- spinlock_t *lock;13421342-13431343- lock = ACPI_ALLOCATE(sizeof(spinlock_t));13441344- if (!lock)13451345- return AE_NO_MEMORY;13461346- spin_lock_init(lock);13471347- *out_handle = lock;13481348-13491349- return AE_OK;13501350-}13511351-13521352-/*13531336 * Deallocate the memory for a spinlock.13541337 */13551338void acpi_os_delete_lock(acpi_spinlock handle)
-1
drivers/base/memory.c
···3030static DEFINE_MUTEX(mem_sysfs_mutex);31313232#define MEMORY_CLASS_NAME "memory"3333-#define MIN_MEMORY_BLOCK_SIZE (1 << SECTION_SIZE_BITS)34333534static int sections_per_block;3635
···19431943 if (!dev_priv->mm.gtt) {19441944 DRM_ERROR("Failed to initialize GTT\n");19451945 ret = -ENODEV;19461946- goto out_iomapfree;19461946+ goto out_rmmap;19471947 }1948194819491949 agp_size = dev_priv->mm.gtt->gtt_mappable_entries << PAGE_SHIFT;···19871987 if (dev_priv->wq == NULL) {19881988 DRM_ERROR("Failed to create our workqueue.\n");19891989 ret = -ENOMEM;19901990- goto out_iomapfree;19901990+ goto out_mtrrfree;19911991 }1992199219931993 /* enable GEM by default */···20742074 return 0;2075207520762076out_gem_unload:20772077+ if (dev_priv->mm.inactive_shrinker.shrink)20782078+ unregister_shrinker(&dev_priv->mm.inactive_shrinker);20792079+20772080 if (dev->pdev->msi_enabled)20782081 pci_disable_msi(dev->pdev);2079208220802083 intel_teardown_gmbus(dev);20812084 intel_teardown_mchbar(dev);20822085 destroy_workqueue(dev_priv->wq);20832083-out_iomapfree:20862086+out_mtrrfree:20872087+ if (dev_priv->mm.gtt_mtrr >= 0) {20882088+ mtrr_del(dev_priv->mm.gtt_mtrr, dev->agp->base,20892089+ dev->agp->agp_info.aper_size * 1024 * 1024);20902090+ dev_priv->mm.gtt_mtrr = -1;20912091+ }20842092 io_mapping_free(dev_priv->mm.gtt_mapping);20852093out_rmmap:20862094 pci_iounmap(dev->pdev, dev_priv->regs);
+2-1
drivers/gpu/drm/i915/i915_drv.c
···5252unsigned int i915_semaphores = 0;5353module_param_named(semaphores, i915_semaphores, int, 0600);54545555-unsigned int i915_enable_rc6 = 1;5555+unsigned int i915_enable_rc6 = 0;5656module_param_named(i915_enable_rc6, i915_enable_rc6, int, 0600);57575858unsigned int i915_enable_fbc = 0;···577577 if (get_seconds() - dev_priv->last_gpu_reset < 5) {578578 DRM_ERROR("GPU hanging too fast, declaring wedged!\n");579579 } else switch (INTEL_INFO(dev)->gen) {580580+ case 7:580581 case 6:581582 ret = gen6_do_reset(dev, flags);582583 /* If reset with a user forcewake, try to restore */
···13741374}1375137513761376static uint32_t13771377-i915_gem_get_gtt_size(struct drm_i915_gem_object *obj)13771377+i915_gem_get_gtt_size(struct drm_device *dev, uint32_t size, int tiling_mode)13781378{13791379- struct drm_device *dev = obj->base.dev;13801380- uint32_t size;13791379+ uint32_t gtt_size;1381138013821381 if (INTEL_INFO(dev)->gen >= 4 ||13831383- obj->tiling_mode == I915_TILING_NONE)13841384- return obj->base.size;13821382+ tiling_mode == I915_TILING_NONE)13831383+ return size;1385138413861385 /* Previous chips need a power-of-two fence region when tiling */13871386 if (INTEL_INFO(dev)->gen == 3)13881388- size = 1024*1024;13871387+ gtt_size = 1024*1024;13891388 else13901390- size = 512*1024;13891389+ gtt_size = 512*1024;1391139013921392- while (size < obj->base.size)13931393- size <<= 1;13911391+ while (gtt_size < size)13921392+ gtt_size <<= 1;1394139313951395- return size;13941394+ return gtt_size;13961395}1397139613981397/**···14021403 * potential fence register mapping.14031404 */14041405static uint32_t14051405-i915_gem_get_gtt_alignment(struct drm_i915_gem_object *obj)14061406+i915_gem_get_gtt_alignment(struct drm_device *dev,14071407+ uint32_t size,14081408+ int tiling_mode)14061409{14071407- struct drm_device *dev = obj->base.dev;14081408-14091410 /*14101411 * Minimum alignment is 4k (GTT page size), but might be greater14111412 * if a fence register is needed for the object.14121413 */14131414 if (INTEL_INFO(dev)->gen >= 4 ||14141414- obj->tiling_mode == I915_TILING_NONE)14151415+ tiling_mode == I915_TILING_NONE)14151416 return 4096;1416141714171418 /*14181419 * Previous chips need to be aligned to the size of the smallest14191420 * fence register that can contain the object.14201421 */14211421- return i915_gem_get_gtt_size(obj);14221422+ return i915_gem_get_gtt_size(dev, size, tiling_mode);14221423}1423142414241425/**14251426 * i915_gem_get_unfenced_gtt_alignment - return required GTT alignment for an14261427 * unfenced object14271427- * @obj: object to check14281428+ * @dev: the device14291429+ * @size: size of the object14301430+ * @tiling_mode: tiling mode of the object14281431 *14291432 * Return the required GTT alignment for an object, only taking into account14301433 * unfenced tiled surface requirements.14311434 */14321435uint32_t14331433-i915_gem_get_unfenced_gtt_alignment(struct drm_i915_gem_object *obj)14361436+i915_gem_get_unfenced_gtt_alignment(struct drm_device *dev,14371437+ uint32_t size,14381438+ int tiling_mode)14341439{14351435- struct drm_device *dev = obj->base.dev;14361436- int tile_height;14371437-14381440 /*14391441 * Minimum alignment is 4k (GTT page size) for sane hw.14401442 */14411443 if (INTEL_INFO(dev)->gen >= 4 || IS_G33(dev) ||14421442- obj->tiling_mode == I915_TILING_NONE)14441444+ tiling_mode == I915_TILING_NONE)14431445 return 4096;1444144614451445- /*14461446- * Older chips need unfenced tiled buffers to be aligned to the left14471447- * edge of an even tile row (where tile rows are counted as if the bo is14481448- * placed in a fenced gtt region).14471447+ /* Previous hardware however needs to be aligned to a power-of-two14481448+ * tile height. The simplest method for determining this is to reuse14491449+ * the power-of-tile object size.14491450 */14501450- if (IS_GEN2(dev))14511451- tile_height = 16;14521452- else if (obj->tiling_mode == I915_TILING_Y && HAS_128_BYTE_Y_TILING(dev))14531453- tile_height = 32;14541454- else14551455- tile_height = 8;14561456-14571457- return tile_height * obj->stride * 2;14511451+ return i915_gem_get_gtt_size(dev, size, tiling_mode);14581452}1459145314601454int···27362744 return -EINVAL;27372745 }2738274627392739- fence_size = i915_gem_get_gtt_size(obj);27402740- fence_alignment = i915_gem_get_gtt_alignment(obj);27412741- unfenced_alignment = i915_gem_get_unfenced_gtt_alignment(obj);27472747+ fence_size = i915_gem_get_gtt_size(dev,27482748+ obj->base.size,27492749+ obj->tiling_mode);27502750+ fence_alignment = i915_gem_get_gtt_alignment(dev,27512751+ obj->base.size,27522752+ obj->tiling_mode);27532753+ unfenced_alignment =27542754+ i915_gem_get_unfenced_gtt_alignment(dev,27552755+ obj->base.size,27562756+ obj->tiling_mode);2742275727432758 if (alignment == 0)27442759 alignment = map_and_fenceable ? fence_alignment :
+3-1
drivers/gpu/drm/i915/i915_gem_tiling.c
···348348 /* Rebind if we need a change of alignment */349349 if (!obj->map_and_fenceable) {350350 u32 unfenced_alignment =351351- i915_gem_get_unfenced_gtt_alignment(obj);351351+ i915_gem_get_unfenced_gtt_alignment(dev,352352+ obj->base.size,353353+ args->tiling_mode);352354 if (obj->gtt_offset & (unfenced_alignment - 1))353355 ret = i915_gem_object_unbind(obj);354356 }
+14-1
drivers/gpu/drm/i915/intel_display.c
···4305430543064306static inline bool intel_panel_use_ssc(struct drm_i915_private *dev_priv)43074307{43084308- return dev_priv->lvds_use_ssc && i915_panel_use_ssc;43084308+ return dev_priv->lvds_use_ssc && i915_panel_use_ssc43094309+ && !(dev_priv->quirks & QUIRK_LVDS_SSC_DISABLE);43094310}4310431143114312static int i9xx_crtc_mode_set(struct drm_crtc *crtc,···78117810 DRM_DEBUG_DRIVER("applying pipe a force quirk\n");78127811}7813781278137813+/*78147814+ * Some machines (Lenovo U160) do not work with SSC on LVDS for some reason78157815+ */78167816+static void quirk_ssc_force_disable(struct drm_device *dev)78177817+{78187818+ struct drm_i915_private *dev_priv = dev->dev_private;78197819+ dev_priv->quirks |= QUIRK_LVDS_SSC_DISABLE;78207820+}78217821+78147822struct intel_quirk {78157823 int device;78167824 int subsystem_vendor;···78487838 /* 855 & before need to leave pipe A & dpll A up */78497839 { 0x3582, PCI_ANY_ID, PCI_ANY_ID, quirk_pipea_force },78507840 { 0x2562, PCI_ANY_ID, PCI_ANY_ID, quirk_pipea_force },78417841+78427842+ /* Lenovo U160 cannot use SSC on LVDS */78437843+ { 0x0046, 0x17aa, 0x3920, quirk_ssc_force_disable },78517844};7852784578537846static void intel_init_quirks(struct drm_device *dev)
+91-27
drivers/gpu/drm/i915/intel_dp.c
···5050 bool has_audio;5151 int force_audio;5252 uint32_t color_range;5353- int dpms_mode;5453 uint8_t link_bw;5554 uint8_t lane_count;5655 uint8_t dpcd[4];···137138{138139 int max_lane_count = 4;139140140140- if (intel_dp->dpcd[0] >= 0x11) {141141- max_lane_count = intel_dp->dpcd[2] & 0x1f;141141+ if (intel_dp->dpcd[DP_DPCD_REV] >= 0x11) {142142+ max_lane_count = intel_dp->dpcd[DP_MAX_LANE_COUNT] & 0x1f;142143 switch (max_lane_count) {143144 case 1: case 2: case 4:144145 break;···152153static int153154intel_dp_max_link_bw(struct intel_dp *intel_dp)154155{155155- int max_link_bw = intel_dp->dpcd[1];156156+ int max_link_bw = intel_dp->dpcd[DP_MAX_LINK_RATE];156157157158 switch (max_link_bw) {158159 case DP_LINK_BW_1_62:···773774 /*774775 * Check for DPCD version > 1.1 and enhanced framing support775776 */776776- if (intel_dp->dpcd[0] >= 0x11 && (intel_dp->dpcd[2] & DP_ENHANCED_FRAME_CAP)) {777777+ if (intel_dp->dpcd[DP_DPCD_REV] >= 0x11 &&778778+ (intel_dp->dpcd[DP_MAX_LANE_COUNT] & DP_ENHANCED_FRAME_CAP)) {777779 intel_dp->link_configuration[1] |= DP_LANE_COUNT_ENHANCED_FRAME_EN;778780 intel_dp->DP |= DP_ENHANCED_FRAMING;779781 }···942942 udelay(200);943943}944944945945+/* If the sink supports it, try to set the power state appropriately */946946+static void intel_dp_sink_dpms(struct intel_dp *intel_dp, int mode)947947+{948948+ int ret, i;949949+950950+ /* Should have a valid DPCD by this point */951951+ if (intel_dp->dpcd[DP_DPCD_REV] < 0x11)952952+ return;953953+954954+ if (mode != DRM_MODE_DPMS_ON) {955955+ ret = intel_dp_aux_native_write_1(intel_dp, DP_SET_POWER,956956+ DP_SET_POWER_D3);957957+ if (ret != 1)958958+ DRM_DEBUG_DRIVER("failed to write sink power state\n");959959+ } else {960960+ /*961961+ * When turning on, we need to retry for 1ms to give the sink962962+ * time to wake up.963963+ */964964+ for (i = 0; i < 3; i++) {965965+ ret = intel_dp_aux_native_write_1(intel_dp,966966+ DP_SET_POWER,967967+ DP_SET_POWER_D0);968968+ if (ret == 1)969969+ break;970970+ msleep(1);971971+ }972972+ }973973+}974974+945975static void intel_dp_prepare(struct drm_encoder *encoder)946976{947977 struct intel_dp *intel_dp = enc_to_intel_dp(encoder);948978 struct drm_device *dev = encoder->dev;979979+980980+ /* Wake up the sink first */981981+ intel_dp_sink_dpms(intel_dp, DRM_MODE_DPMS_ON);949982950983 if (is_edp(intel_dp)) {951984 ironlake_edp_backlight_off(dev);···1023990 if (mode != DRM_MODE_DPMS_ON) {1024991 if (is_edp(intel_dp))1025992 ironlake_edp_backlight_off(dev);993993+ intel_dp_sink_dpms(intel_dp, mode);1026994 intel_dp_link_down(intel_dp);1027995 if (is_edp(intel_dp))1028996 ironlake_edp_panel_off(dev);···1032998 } else {1033999 if (is_edp(intel_dp))10341000 ironlake_edp_panel_vdd_on(intel_dp);10011001+ intel_dp_sink_dpms(intel_dp, mode);10351002 if (!(dp_reg & DP_PORT_EN)) {10361003 intel_dp_start_link_train(intel_dp);10371004 if (is_edp(intel_dp)) {···10441009 if (is_edp(intel_dp))10451010 ironlake_edp_backlight_on(dev);10461011 }10471047- intel_dp->dpms_mode = mode;10121012+}10131013+10141014+/*10151015+ * Native read with retry for link status and receiver capability reads for10161016+ * cases where the sink may still be asleep.10171017+ */10181018+static bool10191019+intel_dp_aux_native_read_retry(struct intel_dp *intel_dp, uint16_t address,10201020+ uint8_t *recv, int recv_bytes)10211021+{10221022+ int ret, i;10231023+10241024+ /*10251025+ * Sinks are *supposed* to come up within 1ms from an off state,10261026+ * but we're also supposed to retry 3 times per the spec.10271027+ */10281028+ for (i = 0; i < 3; i++) {10291029+ ret = intel_dp_aux_native_read(intel_dp, address, recv,10301030+ recv_bytes);10311031+ if (ret == recv_bytes)10321032+ return true;10331033+ msleep(1);10341034+ }10351035+10361036+ return false;10481037}1049103810501039/*···10781019static bool10791020intel_dp_get_link_status(struct intel_dp *intel_dp)10801021{10811081- int ret;10821082-10831083- ret = intel_dp_aux_native_read(intel_dp,10841084- DP_LANE0_1_STATUS,10851085- intel_dp->link_status, DP_LINK_STATUS_SIZE);10861086- if (ret != DP_LINK_STATUS_SIZE)10871087- return false;10881088- return true;10221022+ return intel_dp_aux_native_read_retry(intel_dp,10231023+ DP_LANE0_1_STATUS,10241024+ intel_dp->link_status,10251025+ DP_LINK_STATUS_SIZE);10891026}1090102710911028static uint8_t···15701515static void15711516intel_dp_check_link_status(struct intel_dp *intel_dp)15721517{15181518+ int ret;15191519+15731520 if (!intel_dp->base.base.crtc)15741521 return;1575152215761523 if (!intel_dp_get_link_status(intel_dp)) {15241524+ intel_dp_link_down(intel_dp);15251525+ return;15261526+ }15271527+15281528+ /* Try to read receiver status if the link appears to be up */15291529+ ret = intel_dp_aux_native_read(intel_dp,15301530+ 0x000, intel_dp->dpcd,15311531+ sizeof (intel_dp->dpcd));15321532+ if (ret != sizeof(intel_dp->dpcd)) {15771533 intel_dp_link_down(intel_dp);15781534 return;15791535 }···15991533ironlake_dp_detect(struct intel_dp *intel_dp)16001534{16011535 enum drm_connector_status status;15361536+ bool ret;1602153716031538 /* Can't disconnect eDP, but you can close the lid... */16041539 if (is_edp(intel_dp)) {···16101543 }1611154416121545 status = connector_status_disconnected;16131613- if (intel_dp_aux_native_read(intel_dp,16141614- 0x000, intel_dp->dpcd,16151615- sizeof (intel_dp->dpcd))16161616- == sizeof(intel_dp->dpcd)) {16171617- if (intel_dp->dpcd[0] != 0)16181618- status = connector_status_connected;16191619- }15461546+ ret = intel_dp_aux_native_read_retry(intel_dp,15471547+ 0x000, intel_dp->dpcd,15481548+ sizeof (intel_dp->dpcd));15491549+ if (ret && intel_dp->dpcd[DP_DPCD_REV] != 0)15501550+ status = connector_status_connected;16201551 DRM_DEBUG_KMS("DPCD: %hx%hx%hx%hx\n", intel_dp->dpcd[0],16211552 intel_dp->dpcd[1], intel_dp->dpcd[2], intel_dp->dpcd[3]);16221553 return status;···16511586 if (intel_dp_aux_native_read(intel_dp, 0x000, intel_dp->dpcd,16521587 sizeof (intel_dp->dpcd)) == sizeof (intel_dp->dpcd))16531588 {16541654- if (intel_dp->dpcd[0] != 0)15891589+ if (intel_dp->dpcd[DP_DPCD_REV] != 0)16551590 status = connector_status_connected;16561591 }16571592···18551790{18561791 struct intel_dp *intel_dp = container_of(intel_encoder, struct intel_dp, base);1857179218581858- if (intel_dp->dpms_mode == DRM_MODE_DPMS_ON)18591859- intel_dp_check_link_status(intel_dp);17931793+ intel_dp_check_link_status(intel_dp);18601794}1861179518621796/* Return which DP Port should be selected for Transcoder DP control */···19231859 return;1924186019251861 intel_dp->output_reg = output_reg;19261926- intel_dp->dpms_mode = -1;1927186219281863 intel_connector = kzalloc(sizeof(struct intel_connector), GFP_KERNEL);19291864 if (!intel_connector) {···20171954 sizeof(intel_dp->dpcd));20181955 ironlake_edp_panel_vdd_off(intel_dp);20191956 if (ret == sizeof(intel_dp->dpcd)) {20202020- if (intel_dp->dpcd[0] >= 0x11)20212021- dev_priv->no_aux_handshake = intel_dp->dpcd[3] &19571957+ if (intel_dp->dpcd[DP_DPCD_REV] >= 0x11)19581958+ dev_priv->no_aux_handshake =19591959+ intel_dp->dpcd[DP_MAX_DOWNSPREAD] &20221960 DP_NO_AUX_HANDSHAKE_LINK_TRAINING;20231961 } else {20241962 /* if this fails, presume the device is a ghost */
+1-1
drivers/gpu/drm/i915/intel_ringbuffer.h
···165165int __must_check intel_wait_ring_buffer(struct intel_ring_buffer *ring, int n);166166static inline int intel_wait_ring_idle(struct intel_ring_buffer *ring)167167{168168- return intel_wait_ring_buffer(ring, ring->space - 8);168168+ return intel_wait_ring_buffer(ring, ring->size - 8);169169}170170171171int __must_check intel_ring_begin(struct intel_ring_buffer *ring, int n);
···15381538};1539153915401540static const struct attribute_group it87_group_label = {15411541- .attrs = it87_attributes_vid,15411541+ .attrs = it87_attributes_label,15421542};1543154315441544/* SuperIO detection - will change isa_address if a chip is found */
+11
drivers/hwmon/max1111.c
···4040 struct spi_transfer xfer[2];4141 uint8_t *tx_buf;4242 uint8_t *rx_buf;4343+ struct mutex drvdata_lock;4444+ /* protect msg, xfer and buffers from multiple access */4345};44464547static int max1111_read(struct device *dev, int channel)···5048 uint8_t v1, v2;5149 int err;52505151+ /* writing to drvdata struct is not thread safe, wait on mutex */5252+ mutex_lock(&data->drvdata_lock);5353+5354 data->tx_buf[0] = (channel << MAX1111_CTRL_SEL_SH) |5455 MAX1111_CTRL_PD0 | MAX1111_CTRL_PD1 |5556 MAX1111_CTRL_SGL | MAX1111_CTRL_UNI | MAX1111_CTRL_STR;···6055 err = spi_sync(data->spi, &data->msg);6156 if (err < 0) {6257 dev_err(dev, "spi_sync failed with %d\n", err);5858+ mutex_unlock(&data->drvdata_lock);6359 return err;6460 }65616662 v1 = data->rx_buf[0];6763 v2 = data->rx_buf[1];6464+6565+ mutex_unlock(&data->drvdata_lock);68666967 if ((v1 & 0xc0) || (v2 & 0x3f))7068 return -EINVAL;···184176 if (err)185177 goto err_free_data;186178179179+ mutex_init(&data->drvdata_lock);180180+187181 data->spi = spi;188182 spi_set_drvdata(spi, data);189183···223213224214 hwmon_device_unregister(data->hwmon_dev);225215 sysfs_remove_group(&spi->dev.kobj, &max1111_attr_group);216216+ mutex_destroy(&data->drvdata_lock);226217 kfree(data->rx_buf);227218 kfree(data->tx_buf);228219 kfree(data);
+10-10
drivers/hwmon/pmbus_core.c
···362362 * Convert linear sensor values to milli- or micro-units363363 * depending on sensor type.364364 */365365-static int pmbus_reg2data_linear(struct pmbus_data *data,366366- struct pmbus_sensor *sensor)365365+static long pmbus_reg2data_linear(struct pmbus_data *data,366366+ struct pmbus_sensor *sensor)367367{368368 s16 exponent;369369 s32 mantissa;···397397 else398398 val >>= -exponent;399399400400- return (int)val;400400+ return val;401401}402402403403/*404404 * Convert direct sensor values to milli- or micro-units405405 * depending on sensor type.406406 */407407-static int pmbus_reg2data_direct(struct pmbus_data *data,408408- struct pmbus_sensor *sensor)407407+static long pmbus_reg2data_direct(struct pmbus_data *data,408408+ struct pmbus_sensor *sensor)409409{410410 long val = (s16) sensor->data;411411 long m, b, R;···440440 R++;441441 }442442443443- return (int)((val - b) / m);443443+ return (val - b) / m;444444}445445446446-static int pmbus_reg2data(struct pmbus_data *data, struct pmbus_sensor *sensor)446446+static long pmbus_reg2data(struct pmbus_data *data, struct pmbus_sensor *sensor)447447{448448- int val;448448+ long val;449449450450 if (data->info->direct[sensor->class])451451 val = pmbus_reg2data_direct(data, sensor);···619619 if (!s1 && !s2)620620 *val = !!regval;621621 else {622622- int v1, v2;622622+ long v1, v2;623623 struct pmbus_sensor *sensor1, *sensor2;624624625625 sensor1 = &data->sensors[s1];···661661 if (sensor->data < 0)662662 return sensor->data;663663664664- return snprintf(buf, PAGE_SIZE, "%d\n", pmbus_reg2data(data, sensor));664664+ return snprintf(buf, PAGE_SIZE, "%ld\n", pmbus_reg2data(data, sensor));665665}666666667667static ssize_t pmbus_set_sensor(struct device *dev,
+8
drivers/media/dvb/dvb-core/dvb_frontend.c
···19881988 if (dvbdev->users == -1 && fe->ops.ts_bus_ctrl) {19891989 if ((ret = fe->ops.ts_bus_ctrl(fe, 1)) < 0)19901990 goto err0;19911991+19921992+ /* If we took control of the bus, we need to force19931993+ reinitialization. This is because many ts_bus_ctrl()19941994+ functions strobe the RESET pin on the demod, and if the19951995+ frontend thread already exists then the dvb_init() routine19961996+ won't get called (which is what usually does initial19971997+ register configuration). */19981998+ fepriv->reinitialise = 1;19911999 }1992200019932001 if ((ret = dvb_generic_open (inode, file)) < 0)
+2-2
drivers/media/radio/Kconfig
···168168169169config RADIO_MIROPCM20170170 tristate "miroSOUND PCM20 radio"171171- depends on ISA && VIDEO_V4L2 && SND171171+ depends on ISA && ISA_DMA_API && VIDEO_V4L2 && SND172172 select SND_ISA173173 select SND_MIRO174174 ---help---···201201202202config RADIO_SF16FMR2203203 tristate "SF16FMR2 Radio"204204- depends on ISA && VIDEO_V4L2204204+ depends on ISA && VIDEO_V4L2 && SND205205 ---help---206206 Choose Y here if you have one of these FM radio cards.207207
+2-2
drivers/media/radio/si4713-i2c.c
···10331033 char ps_name[MAX_RDS_PS_NAME + 1];1034103410351035 len = control->size - 1;10361036- if (len > MAX_RDS_PS_NAME) {10361036+ if (len < 0 || len > MAX_RDS_PS_NAME) {10371037 rval = -ERANGE;10381038 goto exit;10391039 }···10571057 char radio_text[MAX_RDS_RADIO_TEXT + 1];1058105810591059 len = control->size - 1;10601060- if (len > MAX_RDS_RADIO_TEXT) {10601060+ if (len < 0 || len > MAX_RDS_RADIO_TEXT) {10611061 rval = -ERANGE;10621062 goto exit;10631063 }
+5-4
drivers/media/rc/mceusb.c
···558558 inout, data1);559559 break;560560 case MCE_CMD_S_TIMEOUT:561561- /* value is in units of 50us, so x*50/100 or x/2 ms */561561+ /* value is in units of 50us, so x*50/1000 ms */562562 dev_info(dev, "%s receive timeout of %d ms\n",563563- inout, ((data1 << 8) | data2) / 2);563563+ inout,564564+ ((data1 << 8) | data2) * MCE_TIME_UNIT / 1000);564565 break;565566 case MCE_CMD_G_TIMEOUT:566567 dev_info(dev, "Get receive timeout\n");···848847 switch (ir->buf_in[index]) {849848 /* 2-byte return value commands */850849 case MCE_CMD_S_TIMEOUT:851851- ir->rc->timeout = US_TO_NS((hi << 8 | lo) / 2);850850+ ir->rc->timeout = US_TO_NS((hi << 8 | lo) * MCE_TIME_UNIT);852851 break;853852854853 /* 1-byte return value commands */···10791078 rc->priv = ir;10801079 rc->driver_type = RC_DRIVER_IR_RAW;10811080 rc->allowed_protos = RC_TYPE_ALL;10821082- rc->timeout = US_TO_NS(1000);10811081+ rc->timeout = MS_TO_NS(100);10831082 if (!ir->flags.no_tx) {10841083 rc->s_tx_mask = mceusb_set_tx_mask;10851084 rc->s_tx_carrier = mceusb_set_tx_carrier;
+1-1
drivers/media/rc/nuvoton-cir.c
···11101110 rdev->dev.parent = &pdev->dev;11111111 rdev->driver_name = NVT_DRIVER_NAME;11121112 rdev->map_name = RC_MAP_RC6_MCE;11131113- rdev->timeout = US_TO_NS(1000);11131113+ rdev->timeout = MS_TO_NS(100);11141114 /* rx resolution is hardwired to 50us atm, 1, 25, 100 also possible */11151115 rdev->rx_resolution = US_TO_NS(CIR_SAMPLE_PERIOD);11161116#if 0
···714714 * returns 0.715715 * This function is needed for boards that have a separate tuner for716716 * radio (like devices with tea5767).717717+ * NOTE: mt20xx uses V4L2_TUNER_DIGITAL_TV and calls set_tv_freq to718718+ * select a TV frequency. So, t_mode = T_ANALOG_TV could actually719719+ * be used to represent a Digital TV too.717720 */718721static inline int check_mode(struct tuner *t, enum v4l2_tuner_type mode)719722{720720- if ((1 << mode & t->mode_mask) == 0)723723+ int t_mode;724724+ if (mode == V4L2_TUNER_RADIO)725725+ t_mode = T_RADIO;726726+ else727727+ t_mode = T_ANALOG_TV;728728+729729+ if ((t_mode & t->mode_mask) == 0)721730 return -EINVAL;722731723732 return 0;···993984 case V4L2_TUNER_RADIO:994985 p = "radio";995986 break;996996- case V4L2_TUNER_DIGITAL_TV:987987+ case V4L2_TUNER_DIGITAL_TV: /* Used by mt20xx */997988 p = "digital TV";998989 break;999990 case V4L2_TUNER_ANALOG_TV:···11441135 return 0;11451136 if (vt->type == t->mode && analog_ops->get_afc)11461137 vt->afc = analog_ops->get_afc(&t->fe);11471147- if (vt->type == V4L2_TUNER_ANALOG_TV)11381138+ if (t->mode != V4L2_TUNER_RADIO) {11481139 vt->capability |= V4L2_TUNER_CAP_NORM;11491149- if (vt->type != V4L2_TUNER_RADIO) {11501140 vt->rangelow = tv_range[0] * 16;11511141 vt->rangehigh = tv_range[1] * 16;11521142 return 0;
···348348349349 /* Only look at sockets that are using this specific device. */350350 switch (event) {351351+ case NETDEV_CHANGEADDR:351352 case NETDEV_CHANGEMTU:352352- /* A change in mtu is a bad thing, requiring353353+ /* A change in mtu or address is a bad thing, requiring353354 * LCP re-negotiation.354355 */355356
+5-3
drivers/net/r6040.c
···677677 if (status & RX_FIFO_FULL)678678 dev->stats.rx_fifo_errors++;679679680680- /* Mask off RX interrupt */681681- misr &= ~RX_INTS;682682- napi_schedule(&lp->napi);680680+ if (likely(napi_schedule_prep(&lp->napi))) {681681+ /* Mask off RX interrupt */682682+ misr &= ~RX_INTS;683683+ __napi_schedule(&lp->napi);684684+ }683685 }684686685687 /* TX interrupt request */
···671671 * TODO - this could be improved to be dependent on the rate.672672 * The hardware can keep up at lower rates, but not higher rates673673 */674674- if (fi->keyix != ATH9K_TXKEYIX_INVALID)674674+ if ((fi->keyix != ATH9K_TXKEYIX_INVALID) &&675675+ !(sc->sc_ah->caps.hw_caps & ATH9K_HW_CAP_EDMA))675676 ndelim += ATH_AGGR_ENCRYPTDELIM;676677677678 /*
+2
drivers/net/wireless/ath/carl9170/usb.c
···112112 { USB_DEVICE(0x04bb, 0x093f) },113113 /* NEC WL300NU-G */114114 { USB_DEVICE(0x0409, 0x0249) },115115+ /* NEC WL300NU-AG */116116+ { USB_DEVICE(0x0409, 0x02b4) },115117 /* AVM FRITZ!WLAN USB Stick N */116118 { USB_DEVICE(0x057c, 0x8401) },117119 /* AVM FRITZ!WLAN USB Stick N 2.4 */
···599599600600config HP_WATCHDOG601601 tristate "HP ProLiant iLO2+ Hardware Watchdog Timer"602602- depends on X86603603- default m602602+ depends on X86 && PCI604603 help605604 A software monitoring watchdog and NMI sourcing driver. This driver606605 will detect lockups and provide a stack trace. This is a driver that
+16-3
fs/ceph/mds_client.c
···14381438 struct dentry *temp;14391439 char *path;14401440 int len, pos;14411441+ unsigned seq;1441144214421443 if (dentry == NULL)14431444 return ERR_PTR(-EINVAL);1444144514451446retry:14461447 len = 0;14481448+ seq = read_seqbegin(&rename_lock);14491449+ rcu_read_lock();14471450 for (temp = dentry; !IS_ROOT(temp);) {14481451 struct inode *inode = temp->d_inode;14491452 if (inode && ceph_snap(inode) == CEPH_SNAPDIR)···14581455 len += 1 + temp->d_name.len;14591456 temp = temp->d_parent;14601457 if (temp == NULL) {14581458+ rcu_read_unlock();14611459 pr_err("build_path corrupt dentry %p\n", dentry);14621460 return ERR_PTR(-EINVAL);14631461 }14641462 }14631463+ rcu_read_unlock();14651464 if (len)14661465 len--; /* no leading '/' */14671466···14721467 return ERR_PTR(-ENOMEM);14731468 pos = len;14741469 path[pos] = 0; /* trailing null */14701470+ rcu_read_lock();14751471 for (temp = dentry; !IS_ROOT(temp) && pos != 0; ) {14761476- struct inode *inode = temp->d_inode;14721472+ struct inode *inode;1477147314741474+ spin_lock(&temp->d_lock);14751475+ inode = temp->d_inode;14781476 if (inode && ceph_snap(inode) == CEPH_SNAPDIR) {14791477 dout("build_path path+%d: %p SNAPDIR\n",14801478 pos, temp);···14861478 break;14871479 } else {14881480 pos -= temp->d_name.len;14891489- if (pos < 0)14811481+ if (pos < 0) {14821482+ spin_unlock(&temp->d_lock);14901483 break;14841484+ }14911485 strncpy(path + pos, temp->d_name.name,14921486 temp->d_name.len);14931487 }14881488+ spin_unlock(&temp->d_lock);14941489 if (pos)14951490 path[--pos] = '/';14961491 temp = temp->d_parent;14971492 if (temp == NULL) {14931493+ rcu_read_unlock();14981494 pr_err("build_path corrupt dentry\n");14991495 kfree(path);15001496 return ERR_PTR(-EINVAL);15011497 }15021498 }15031503- if (pos != 0) {14991499+ rcu_read_unlock();15001500+ if (pos != 0 || read_seqretry(&rename_lock, seq)) {15041501 pr_err("build_path did not end path lookup where "15051502 "expected, namelen is %d, pos is %d\n", len, pos);15061503 /* presumably this is only possible if racing with a
···3737/* These macros may change in future, to provide better st_ino semantics. */3838#define OFFSET(x) ((x)->i_ino)39394040-static unsigned long cramino(struct cramfs_inode *cino, unsigned int offset)4040+static unsigned long cramino(const struct cramfs_inode *cino, unsigned int offset)4141{4242 if (!cino->offset)4343 return offset + 1;···6161}62626363static struct inode *get_cramfs_inode(struct super_block *sb,6464- struct cramfs_inode *cramfs_inode, unsigned int offset)6464+ const struct cramfs_inode *cramfs_inode, unsigned int offset)6565{6666 struct inode *inode;6767 static struct timespec zerotime;···317317 /* Set it all up.. */318318 sb->s_op = &cramfs_ops;319319 root = get_cramfs_inode(sb, &super.root, 0);320320- if (!root)320320+ if (IS_ERR(root))321321 goto out;322322 sb->s_root = d_alloc_root(root);323323 if (!sb->s_root) {···423423static struct dentry * cramfs_lookup(struct inode *dir, struct dentry *dentry, struct nameidata *nd)424424{425425 unsigned int offset = 0;426426+ struct inode *inode = NULL;426427 int sorted;427428428429 mutex_lock(&read_mutex);···450449451450 for (;;) {452451 if (!namelen) {453453- mutex_unlock(&read_mutex);454454- return ERR_PTR(-EIO);452452+ inode = ERR_PTR(-EIO);453453+ goto out;455454 }456455 if (name[namelen-1])457456 break;···463462 if (retval > 0)464463 continue;465464 if (!retval) {466466- struct cramfs_inode entry = *de;467467- mutex_unlock(&read_mutex);468468- d_add(dentry, get_cramfs_inode(dir->i_sb, &entry, dir_off));469469- return NULL;465465+ inode = get_cramfs_inode(dir->i_sb, de, dir_off);466466+ break;470467 }471468 /* else (retval < 0) */472469 if (sorted)473470 break;474471 }472472+out:475473 mutex_unlock(&read_mutex);476476- d_add(dentry, NULL);474474+ if (IS_ERR(inode))475475+ return ERR_CAST(inode);476476+ d_add(dentry, inode);477477 return NULL;478478}479479
+34-19
fs/dcache.c
···18131813 tname = dentry->d_name.name;18141814 i = dentry->d_inode;18151815 prefetch(tname);18161816- if (i)18171817- prefetch(i);18181816 /*18191817 * This seqcount check is required to ensure name and18201818 * len are loaded atomically, so as not to walk off the···22112213 * The hash value has to match the hash queue that the dentry is on..22122214 */22132215/*22142214- * d_move - move a dentry22162216+ * __d_move - move a dentry22152217 * @dentry: entry to move22162218 * @target: new dentry22172219 *22182220 * Update the dcache to reflect the move of a file name. Negative22192219- * dcache entries should not be moved in this way.22212221+ * dcache entries should not be moved in this way. Caller hold22222222+ * rename_lock.22202223 */22212221-void d_move(struct dentry * dentry, struct dentry * target)22242224+static void __d_move(struct dentry * dentry, struct dentry * target)22222225{22232226 if (!dentry->d_inode)22242227 printk(KERN_WARNING "VFS: moving negative dcache entry\n");2225222822262229 BUG_ON(d_ancestor(dentry, target));22272230 BUG_ON(d_ancestor(target, dentry));22282228-22292229- write_seqlock(&rename_lock);2230223122312232 dentry_lock_for_move(dentry, target);22322233···22722275 spin_unlock(&target->d_lock);22732276 fsnotify_d_move(dentry);22742277 spin_unlock(&dentry->d_lock);22782278+}22792279+22802280+/*22812281+ * d_move - move a dentry22822282+ * @dentry: entry to move22832283+ * @target: new dentry22842284+ *22852285+ * Update the dcache to reflect the move of a file name. Negative22862286+ * dcache entries should not be moved in this way.22872287+ */22882288+void d_move(struct dentry *dentry, struct dentry *target)22892289+{22902290+ write_seqlock(&rename_lock);22912291+ __d_move(dentry, target);22752292 write_sequnlock(&rename_lock);22762293}22772294EXPORT_SYMBOL(d_move);···23132302 * This helper attempts to cope with remotely renamed directories23142303 *23152304 * It assumes that the caller is already holding23162316- * dentry->d_parent->d_inode->i_mutex and the inode->i_lock23052305+ * dentry->d_parent->d_inode->i_mutex, inode->i_lock and rename_lock23172306 *23182307 * Note: If ever the locking in lock_rename() changes, then please23192308 * remember to update this too...···23282317 if (alias->d_parent == dentry->d_parent)23292318 goto out_unalias;2330231923312331- /* Check for loops */23322332- ret = ERR_PTR(-ELOOP);23332333- if (d_ancestor(alias, dentry))23342334- goto out_err;23352335-23362320 /* See lock_rename() */23372321 ret = ERR_PTR(-EBUSY);23382322 if (!mutex_trylock(&dentry->d_sb->s_vfs_rename_mutex))···23372331 goto out_err;23382332 m2 = &alias->d_parent->d_inode->i_mutex;23392333out_unalias:23402340- d_move(alias, dentry);23342334+ __d_move(alias, dentry);23412335 ret = alias;23422336out_err:23432337 spin_unlock(&inode->i_lock);···24222416 alias = __d_find_alias(inode, 0);24232417 if (alias) {24242418 actual = alias;24252425- /* Is this an anonymous mountpoint that we could splice24262426- * into our tree? */24272427- if (IS_ROOT(alias)) {24192419+ write_seqlock(&rename_lock);24202420+24212421+ if (d_ancestor(alias, dentry)) {24222422+ /* Check for loops */24232423+ actual = ERR_PTR(-ELOOP);24242424+ } else if (IS_ROOT(alias)) {24252425+ /* Is this an anonymous mountpoint that we24262426+ * could splice into our tree? */24282427 __d_materialise_dentry(dentry, alias);24282428+ write_sequnlock(&rename_lock);24292429 __d_drop(alias);24302430 goto found;24312431+ } else {24322432+ /* Nope, but we must(!) avoid directory24332433+ * aliasing */24342434+ actual = __d_unalias(inode, dentry, alias);24312435 }24322432- /* Nope, but we must(!) avoid directory aliasing */24332433- actual = __d_unalias(inode, dentry, alias);24362436+ write_sequnlock(&rename_lock);24342437 if (IS_ERR(actual))24352438 dput(alias);24362439 goto out_nolock;
+1-1
fs/exofs/super.c
···913913 unsigned long ino = exofs_parent_ino(child);914914915915 if (!ino)916916- return NULL;916916+ return ERR_PTR(-ESTALE);917917918918 return d_obtain_alias(exofs_iget(child->d_inode->i_sb, ino));919919}
+5-9
fs/fscache/page.c
···976976977977 pagevec_init(&pvec, 0);978978 next = 0;979979- while (next <= (loff_t)-1 &&980980- pagevec_lookup(&pvec, mapping, next, PAGEVEC_SIZE)981981- ) {979979+ do {980980+ if (!pagevec_lookup(&pvec, mapping, next, PAGEVEC_SIZE))981981+ break;982982 for (i = 0; i < pagevec_count(&pvec); i++) {983983 struct page *page = pvec.pages[i];984984- pgoff_t page_index = page->index;985985-986986- ASSERTCMP(page_index, >=, next);987987- next = page_index + 1;988988-984984+ next = page->index;989985 if (PageFsCache(page)) {990986 __fscache_wait_on_page_write(cookie, page);991987 __fscache_uncache_page(cookie, page);···989993 }990994 pagevec_release(&pvec);991995 cond_resched();992992- }996996+ } while (++next);993997994998 _leave("");995999}
···903903 if (gfs2_ail1_empty(sdp))904904 break;905905 }906906+ gfs2_log_flush(sdp, NULL);906907}907908908909static inline int gfs2_jrnl_flush_reqd(struct gfs2_sbd *sdp)
+3
fs/gfs2/ops_fstype.c
···72727373 init_waitqueue_head(&sdp->sd_glock_wait);7474 atomic_set(&sdp->sd_glock_disposal, 0);7575+ init_completion(&sdp->sd_locking_init);7576 spin_lock_init(&sdp->sd_statfs_spin);76777778 spin_lock_init(&sdp->sd_rindex_spin);···10181017 fsname++;10191018 if (lm->lm_mount == NULL) {10201019 fs_info(sdp, "Now mounting FS...\n");10201020+ complete(&sdp->sd_locking_init);10211021 return 0;10221022 }10231023 ret = lm->lm_mount(sdp, fsname);10241024 if (ret == 0)10251025 fs_info(sdp, "Joined cluster. Now mounting FS...\n");10261026+ complete(&sdp->sd_locking_init);10261027 return ret;10271028}10281029
+30-6
fs/gfs2/super.c
···757757 struct timespec atime;758758 struct gfs2_dinode *di;759759 int ret = -EAGAIN;760760+ int unlock_required = 0;760761761762 /* Skip timestamp update, if this is from a memalloc */762763 if (current->flags & PF_MEMALLOC)763764 goto do_flush;764764- ret = gfs2_glock_nq_init(ip->i_gl, LM_ST_EXCLUSIVE, 0, &gh);765765- if (ret)766766- goto do_flush;765765+ if (!gfs2_glock_is_locked_by_me(ip->i_gl)) {766766+ ret = gfs2_glock_nq_init(ip->i_gl, LM_ST_EXCLUSIVE, 0, &gh);767767+ if (ret)768768+ goto do_flush;769769+ unlock_required = 1;770770+ }767771 ret = gfs2_trans_begin(sdp, RES_DINODE, 0);768772 if (ret)769773 goto do_unlock;···784780 }785781 gfs2_trans_end(sdp);786782do_unlock:787787- gfs2_glock_dq_uninit(&gh);783783+ if (unlock_required)784784+ gfs2_glock_dq_uninit(&gh);788785do_flush:789786 if (wbc->sync_mode == WB_SYNC_ALL)790787 gfs2_log_flush(GFS2_SB(inode), ip->i_gl);···14321427 return error;14331428}1434142914351435-/*14301430+/**14311431+ * gfs2_evict_inode - Remove an inode from cache14321432+ * @inode: The inode to evict14331433+ *14341434+ * There are three cases to consider:14351435+ * 1. i_nlink == 0, we are final opener (and must deallocate)14361436+ * 2. i_nlink == 0, we are not the final opener (and cannot deallocate)14371437+ * 3. i_nlink > 014381438+ *14391439+ * If the fs is read only, then we have to treat all cases as per #314401440+ * since we are unable to do any deallocation. The inode will be14411441+ * deallocated by the next read/write node to attempt an allocation14421442+ * in the same resource group14431443+ *14361444 * We have to (at the moment) hold the inodes main lock to cover14371445 * the gap between unlocking the shared lock on the iopen lock and14381446 * taking the exclusive lock. I'd rather do a shared -> exclusive···14881470 if (error)14891471 goto out_truncate;1490147214731473+ /* Case 1 starts here */14741474+14911475 if (S_ISDIR(inode->i_mode) &&14921476 (ip->i_diskflags & GFS2_DIF_EXHASH)) {14931477 error = gfs2_dir_exhash_dealloc(ip);···15131493 goto out_unlock;1514149415151495out_truncate:14961496+ /* Case 2 starts here */15161497 error = gfs2_trans_begin(sdp, 0, sdp->sd_jdesc->jd_blocks);15171498 if (error)15181499 goto out_unlock;15191519- gfs2_final_release_pages(ip);15001500+ /* Needs to be done before glock release & also in a transaction */15011501+ truncate_inode_pages(&inode->i_data, 0);15201502 gfs2_trans_end(sdp);1521150315221504out_unlock:15051505+ /* Error path for case 1 */15231506 if (test_bit(HIF_HOLDER, &ip->i_iopen_gh.gh_iflags))15241507 gfs2_glock_dq(&ip->i_iopen_gh);15251508 gfs2_holder_uninit(&ip->i_iopen_gh);···15301507 if (error && error != GLR_TRYFAILED && error != -EROFS)15311508 fs_warn(sdp, "gfs2_evict_inode: %d\n", error);15321509out:15101510+ /* Case 3 starts here */15331511 truncate_inode_pages(&inode->i_data, 0);15341512 end_writeback(inode);15351513
+6-1
fs/gfs2/sys.c
···338338 rv = sscanf(buf, "%u", &first);339339 if (rv != 1 || first > 1)340340 return -EINVAL;341341+ rv = wait_for_completion_killable(&sdp->sd_locking_init);342342+ if (rv)343343+ return rv;341344 spin_lock(&sdp->sd_jindex_spin);342345 rv = -EBUSY;343346 if (test_bit(SDF_NOJOURNALID, &sdp->sd_flags) == 0)···417414 rv = sscanf(buf, "%d", &jid);418415 if (rv != 1)419416 return -EINVAL;420420-417417+ rv = wait_for_completion_killable(&sdp->sd_locking_init);418418+ if (rv)419419+ return rv;421420 spin_lock(&sdp->sd_jindex_spin);422421 rv = -EINVAL;423422 if (sdp->sd_lockstruct.ls_ops->lm_mount == NULL)
···822822 goto out;823823824824 attr->set_buf[size] = '\0';825825- val = simple_strtol(attr->set_buf, NULL, 0);825825+ val = simple_strtoll(attr->set_buf, NULL, 0);826826 ret = attr->set(attr->data, val);827827 if (ret == 0)828828 ret = len; /* on success, claim we got the whole input */
+8-1
fs/namei.c
···433433 goto err_parent;434434 BUG_ON(nd->inode != parent->d_inode);435435 } else {436436+ if (dentry->d_parent != parent)437437+ goto err_parent;436438 spin_lock_nested(&dentry->d_lock, DENTRY_D_LOCK_NESTED);437439 if (!__d_rcu_to_refcount(dentry, nd->seq))438440 goto err_child;···942940 * Don't forget we might have a non-mountpoint managed dentry943941 * that wants to block transit.944942 */945945- *inode = path->dentry->d_inode;946943 if (unlikely(managed_dentry_might_block(path->dentry)))947944 return false;948945···954953 path->mnt = mounted;955954 path->dentry = mounted->mnt_root;956955 nd->seq = read_seqcount_begin(&path->dentry->d_seq);956956+ /*957957+ * Update the inode too. We don't need to re-check the958958+ * dentry sequence number here after this d_inode read,959959+ * because a mount-point is always pinned.960960+ */961961+ *inode = path->dentry->d_inode;957962 }958963 return true;959964}
-1
fs/nfs/nfs4filelayout.c
···398398 * this offset and save the original offset.399399 */400400 data->args.offset = filelayout_get_dserver_offset(lseg, offset);401401- data->mds_offset = offset;402401403402 /* Perform an asynchronous write */404403 status = nfs_initiate_write(data, ds->ds_clp->cl_rpcclient,
···56565757 lock_ufs(dir->i_sb);5858 ino = ufs_inode_by_name(dir, &dentry->d_name);5959- if (ino) {5959+ if (ino)6060 inode = ufs_iget(dir->i_sb, ino);6161- if (IS_ERR(inode)) {6262- unlock_ufs(dir->i_sb);6363- return ERR_CAST(inode);6464- }6565- }6661 unlock_ufs(dir->i_sb);6767- d_add(dentry, inode);6868- return NULL;6262+ if (IS_ERR(inode))6363+ return ERR_CAST(inode);6464+ return d_splice_alias(inode, dentry);6965}70667167/*
+1-1
include/acpi/acpi_bus.h
···210210struct acpi_device_power {211211 int state; /* Current state */212212 struct acpi_device_power_flags flags;213213- struct acpi_device_power_state states[4]; /* Power states (D0-D3) */213213+ struct acpi_device_power_state states[ACPI_D_STATE_COUNT]; /* Power states (D0-D3Cold) */214214};215215216216/* Performance Management */
···159159 } while (0)160160#endif161161162162+/*163163+ * When lockdep is enabled, the spin_lock_init() macro stringifies it's164164+ * argument and uses that as a name for the lock in debugging.165165+ * By executing spin_lock_init() in a macro the key changes from "lock" for166166+ * all locks to the name of the argument of acpi_os_create_lock(), which167167+ * prevents lockdep from reporting false positives for ACPICA locks.168168+ */169169+#define acpi_os_create_lock(__handle) \170170+({ \171171+ spinlock_t *lock = ACPI_ALLOCATE(sizeof(*lock)); \172172+ \173173+ if (lock) { \174174+ *(__handle) = lock; \175175+ spin_lock_init(*(__handle)); \176176+ } \177177+ lock ? AE_OK : AE_NO_MEMORY; \178178+})179179+162180#endif /* __KERNEL__ */163181164182#endif /* __ACLINUX_H__ */
···10971097#define NETIF_F_ALL_FCOE (NETIF_F_FCOE_CRC | NETIF_F_FCOE_MTU | \10981098 NETIF_F_FSO)1099109911001100-#define NETIF_F_ALL_TX_OFFLOADS (NETIF_F_ALL_CSUM | NETIF_F_SG | \11011101- NETIF_F_FRAGLIST | NETIF_F_ALL_TSO | \11021102- NETIF_F_HIGHDMA | \11031103- NETIF_F_SCTP_CSUM | \11041104- NETIF_F_ALL_FCOE)11051105-11061100 /*11071101 * If one device supports one of these features, then enable them11081102 * for all in netdev_increment_features.
+13-4
include/linux/sched.h
···844844#define SD_SERIALIZE 0x0400 /* Only a single load balancing instance */845845#define SD_ASYM_PACKING 0x0800 /* Place busy groups earlier in the domain */846846#define SD_PREFER_SIBLING 0x1000 /* Prefer to place tasks in a sibling domain */847847+#define SD_OVERLAP 0x2000 /* sched_domains of this level overlap */847848848849enum powersavings_balance_level {849850 POWERSAVINGS_BALANCE_NONE = 0, /* No power saving load balance */···894893 return 0;895894}896895897897-struct sched_group {898898- struct sched_group *next; /* Must be a circular list */896896+struct sched_group_power {899897 atomic_t ref;900900-901898 /*902899 * CPU power of this group, SCHED_LOAD_SCALE being max power for a903900 * single CPU.904901 */905905- unsigned int cpu_power, cpu_power_orig;902902+ unsigned int power, power_orig;903903+};904904+905905+struct sched_group {906906+ struct sched_group *next; /* Must be a circular list */907907+ atomic_t ref;908908+906909 unsigned int group_weight;910910+ struct sched_group_power *sgp;907911908912 /*909913 * The CPUs this group covers.···12601254#ifdef CONFIG_PREEMPT_RCU12611255 int rcu_read_lock_nesting;12621256 char rcu_read_unlock_special;12571257+#if defined(CONFIG_RCU_BOOST) && defined(CONFIG_TREE_PREEMPT_RCU)12581258+ int rcu_boosted;12591259+#endif /* #if defined(CONFIG_RCU_BOOST) && defined(CONFIG_TREE_PREEMPT_RCU) */12631260 struct list_head rcu_node_entry;12641261#endif /* #ifdef CONFIG_PREEMPT_RCU */12651262#ifdef CONFIG_TREE_PREEMPT_RCU
+1-5
include/linux/sdla.h
···112112 short Tb_max;113113};114114115115-#ifndef __KERNEL__116116-117117-void sdla(void *cfg_info, char *dev, struct frad_conf *conf, int quiet);118118-119119-#else115115+#ifdef __KERNEL__120116121117/* important Z80 window addresses */122118#define SDLA_CONTROL_WND 0xE000
+1
include/net/sctp/command.h
···6363 SCTP_CMD_ECN_ECNE, /* Do delayed ECNE processing. */6464 SCTP_CMD_ECN_CWR, /* Do delayed CWR processing. */6565 SCTP_CMD_TIMER_START, /* Start a timer. */6666+ SCTP_CMD_TIMER_START_ONCE, /* Start a timer once */6667 SCTP_CMD_TIMER_RESTART, /* Restart a timer. */6768 SCTP_CMD_TIMER_STOP, /* Stop a timer. */6869 SCTP_CMD_INIT_CHOOSE_TRANSPORT, /* Choose transport for an INIT. */
···84848585static struct rcu_state *rcu_state;86868787+/*8888+ * The rcu_scheduler_active variable transitions from zero to one just8989+ * before the first task is spawned. So when this variable is zero, RCU9090+ * can assume that there is but one task, allowing RCU to (for example)9191+ * optimized synchronize_sched() to a simple barrier(). When this variable9292+ * is one, RCU must actually do all the hard work required to detect real9393+ * grace periods. This variable is also used to suppress boot-time false9494+ * positives from lockdep-RCU error checking.9595+ */8796int rcu_scheduler_active __read_mostly;8897EXPORT_SYMBOL_GPL(rcu_scheduler_active);9898+9999+/*100100+ * The rcu_scheduler_fully_active variable transitions from zero to one101101+ * during the early_initcall() processing, which is after the scheduler102102+ * is capable of creating new tasks. So RCU processing (for example,103103+ * creating tasks for RCU priority boosting) must be delayed until after104104+ * rcu_scheduler_fully_active transitions from zero to one. We also105105+ * currently delay invocation of any RCU callbacks until after this point.106106+ *107107+ * It might later prove better for people registering RCU callbacks during108108+ * early boot to take responsibility for these callbacks, but one step at109109+ * a time.110110+ */111111+static int rcu_scheduler_fully_active __read_mostly;8911290113#ifdef CONFIG_RCU_BOOST91114···12198DEFINE_PER_CPU(int, rcu_cpu_kthread_cpu);12299DEFINE_PER_CPU(unsigned int, rcu_cpu_kthread_loops);123100DEFINE_PER_CPU(char, rcu_cpu_has_work);124124-static char rcu_kthreads_spawnable;125101126102#endif /* #ifdef CONFIG_RCU_BOOST */127103···14891467 */14901468static void invoke_rcu_callbacks(struct rcu_state *rsp, struct rcu_data *rdp)14911469{14701470+ if (unlikely(!ACCESS_ONCE(rcu_scheduler_fully_active)))14711471+ return;14921472 if (likely(!rsp->boost)) {14931473 rcu_do_batch(rsp, rdp);14941474 return;
+50-18
kernel/rcutree_plugin.h
···6868DEFINE_PER_CPU(struct rcu_data, rcu_preempt_data);6969static struct rcu_state *rcu_state = &rcu_preempt_state;70707171+static void rcu_read_unlock_special(struct task_struct *t);7172static int rcu_preempted_readers_exp(struct rcu_node *rnp);72737374/*···148147 struct rcu_data *rdp;149148 struct rcu_node *rnp;150149151151- if (t->rcu_read_lock_nesting &&150150+ if (t->rcu_read_lock_nesting > 0 &&152151 (t->rcu_read_unlock_special & RCU_READ_UNLOCK_BLOCKED) == 0) {153152154153 /* Possibly blocking in an RCU read-side critical section. */···191190 rnp->gp_tasks = &t->rcu_node_entry;192191 }193192 raw_spin_unlock_irqrestore(&rnp->lock, flags);193193+ } else if (t->rcu_read_lock_nesting < 0 &&194194+ t->rcu_read_unlock_special) {195195+196196+ /*197197+ * Complete exit from RCU read-side critical section on198198+ * behalf of preempted instance of __rcu_read_unlock().199199+ */200200+ rcu_read_unlock_special(t);194201 }195202196203 /*···293284 * notify RCU core processing or task having blocked during the RCU294285 * read-side critical section.295286 */296296-static void rcu_read_unlock_special(struct task_struct *t)287287+static noinline void rcu_read_unlock_special(struct task_struct *t)297288{298289 int empty;299290 int empty_exp;···318309 }319310320311 /* Hardware IRQ handlers cannot block. */321321- if (in_irq()) {312312+ if (in_irq() || in_serving_softirq()) {322313 local_irq_restore(flags);323314 return;324315 }···351342#ifdef CONFIG_RCU_BOOST352343 if (&t->rcu_node_entry == rnp->boost_tasks)353344 rnp->boost_tasks = np;345345+ /* Snapshot and clear ->rcu_boosted with rcu_node lock held. */346346+ if (t->rcu_boosted) {347347+ special |= RCU_READ_UNLOCK_BOOSTED;348348+ t->rcu_boosted = 0;349349+ }354350#endif /* #ifdef CONFIG_RCU_BOOST */355351 t->rcu_blocked_node = NULL;356352···372358#ifdef CONFIG_RCU_BOOST373359 /* Unboost if we were boosted. */374360 if (special & RCU_READ_UNLOCK_BOOSTED) {375375- t->rcu_read_unlock_special &= ~RCU_READ_UNLOCK_BOOSTED;376361 rt_mutex_unlock(t->rcu_boost_mutex);377362 t->rcu_boost_mutex = NULL;378363 }···400387 struct task_struct *t = current;401388402389 barrier(); /* needed if we ever invoke rcu_read_unlock in rcutree.c */403403- --t->rcu_read_lock_nesting;404404- barrier(); /* decrement before load of ->rcu_read_unlock_special */405405- if (t->rcu_read_lock_nesting == 0 &&406406- unlikely(ACCESS_ONCE(t->rcu_read_unlock_special)))407407- rcu_read_unlock_special(t);390390+ if (t->rcu_read_lock_nesting != 1)391391+ --t->rcu_read_lock_nesting;392392+ else {393393+ t->rcu_read_lock_nesting = INT_MIN;394394+ barrier(); /* assign before ->rcu_read_unlock_special load */395395+ if (unlikely(ACCESS_ONCE(t->rcu_read_unlock_special)))396396+ rcu_read_unlock_special(t);397397+ barrier(); /* ->rcu_read_unlock_special load before assign */398398+ t->rcu_read_lock_nesting = 0;399399+ }408400#ifdef CONFIG_PROVE_LOCKING409409- WARN_ON_ONCE(ACCESS_ONCE(t->rcu_read_lock_nesting) < 0);401401+ {402402+ int rrln = ACCESS_ONCE(t->rcu_read_lock_nesting);403403+404404+ WARN_ON_ONCE(rrln < 0 && rrln > INT_MIN / 2);405405+ }410406#endif /* #ifdef CONFIG_PROVE_LOCKING */411407}412408EXPORT_SYMBOL_GPL(__rcu_read_unlock);···611589 rcu_preempt_qs(cpu);612590 return;613591 }614614- if (per_cpu(rcu_preempt_data, cpu).qs_pending)592592+ if (t->rcu_read_lock_nesting > 0 &&593593+ per_cpu(rcu_preempt_data, cpu).qs_pending)615594 t->rcu_read_unlock_special |= RCU_READ_UNLOCK_NEED_QS;616595}617596···718695719696 raw_spin_lock_irqsave(&rnp->lock, flags);720697 for (;;) {721721- if (!sync_rcu_preempt_exp_done(rnp))698698+ if (!sync_rcu_preempt_exp_done(rnp)) {699699+ raw_spin_unlock_irqrestore(&rnp->lock, flags);722700 break;701701+ }723702 if (rnp->parent == NULL) {703703+ raw_spin_unlock_irqrestore(&rnp->lock, flags);724704 wake_up(&sync_rcu_preempt_exp_wq);725705 break;726706 }···733707 raw_spin_lock(&rnp->lock); /* irqs already disabled */734708 rnp->expmask &= ~mask;735709 }736736- raw_spin_unlock_irqrestore(&rnp->lock, flags);737710}738711739712/*···11991174 t = container_of(tb, struct task_struct, rcu_node_entry);12001175 rt_mutex_init_proxy_locked(&mtx, t);12011176 t->rcu_boost_mutex = &mtx;12021202- t->rcu_read_unlock_special |= RCU_READ_UNLOCK_BOOSTED;11771177+ t->rcu_boosted = 1;12031178 raw_spin_unlock_irqrestore(&rnp->lock, flags);12041179 rt_mutex_lock(&mtx); /* Side effect: boosts task t's priority. */12051180 rt_mutex_unlock(&mtx); /* Keep lockdep happy. */···15571532 struct sched_param sp;15581533 struct task_struct *t;1559153415601560- if (!rcu_kthreads_spawnable ||15351535+ if (!rcu_scheduler_fully_active ||15611536 per_cpu(rcu_cpu_kthread_task, cpu) != NULL)15621537 return 0;15631538 t = kthread_create(rcu_cpu_kthread, (void *)(long)cpu, "rcuc%d", cpu);···16641639 struct sched_param sp;16651640 struct task_struct *t;1666164116671667- if (!rcu_kthreads_spawnable ||16421642+ if (!rcu_scheduler_fully_active ||16681643 rnp->qsmaskinit == 0)16691644 return 0;16701645 if (rnp->node_kthread_task == NULL) {···16901665 int cpu;16911666 struct rcu_node *rnp;1692166716931693- rcu_kthreads_spawnable = 1;16681668+ rcu_scheduler_fully_active = 1;16941669 for_each_possible_cpu(cpu) {16951670 per_cpu(rcu_cpu_has_work, cpu) = 0;16961671 if (cpu_online(cpu))···17121687 struct rcu_node *rnp = rdp->mynode;1713168817141689 /* Fire up the incoming CPU's kthread and leaf rcu_node kthread. */17151715- if (rcu_kthreads_spawnable) {16901690+ if (rcu_scheduler_fully_active) {17161691 (void)rcu_spawn_one_cpu_kthread(cpu);17171692 if (rnp->node_kthread_task == NULL)17181693 (void)rcu_spawn_one_node_kthread(rcu_state, rnp);···17501725static void rcu_cpu_kthread_setrt(int cpu, int to_rt)17511726{17521727}17281728+17291729+static int __init rcu_scheduler_really_started(void)17301730+{17311731+ rcu_scheduler_fully_active = 1;17321732+ return 0;17331733+}17341734+early_initcall(rcu_scheduler_really_started);1753173517541736static void __cpuinit rcu_prepare_kthreads(int cpu)17551737{
+196-40
kernel/sched.c
···25442544}2545254525462546#ifdef CONFIG_SMP25472547-static void sched_ttwu_pending(void)25472547+static void sched_ttwu_do_pending(struct task_struct *list)25482548{25492549 struct rq *rq = this_rq();25502550- struct task_struct *list = xchg(&rq->wake_list, NULL);25512551-25522552- if (!list)25532553- return;2554255025552551 raw_spin_lock(&rq->lock);25562552···25592563 raw_spin_unlock(&rq->lock);25602564}2561256525662566+#ifdef CONFIG_HOTPLUG_CPU25672567+25682568+static void sched_ttwu_pending(void)25692569+{25702570+ struct rq *rq = this_rq();25712571+ struct task_struct *list = xchg(&rq->wake_list, NULL);25722572+25732573+ if (!list)25742574+ return;25752575+25762576+ sched_ttwu_do_pending(list);25772577+}25782578+25792579+#endif /* CONFIG_HOTPLUG_CPU */25802580+25622581void scheduler_ipi(void)25632582{25642564- sched_ttwu_pending();25832583+ struct rq *rq = this_rq();25842584+ struct task_struct *list = xchg(&rq->wake_list, NULL);25852585+25862586+ if (!list)25872587+ return;25882588+25892589+ /*25902590+ * Not all reschedule IPI handlers call irq_enter/irq_exit, since25912591+ * traditionally all their work was done from the interrupt return25922592+ * path. Now that we actually do some work, we need to make sure25932593+ * we do call them.25942594+ *25952595+ * Some archs already do call them, luckily irq_enter/exit nest25962596+ * properly.25972597+ *25982598+ * Arguably we should visit all archs and update all handlers,25992599+ * however a fair share of IPIs are still resched only so this would26002600+ * somewhat pessimize the simple resched case.26012601+ */26022602+ irq_enter();26032603+ sched_ttwu_do_pending(list);26042604+ irq_exit();25652605}2566260625672607static void ttwu_queue_remote(struct task_struct *p, int cpu)···65896557 break;65906558 }6591655965926592- if (!group->cpu_power) {65606560+ if (!group->sgp->power) {65936561 printk(KERN_CONT "\n");65946562 printk(KERN_ERR "ERROR: domain->cpu_power not "65956563 "set\n");···66136581 cpulist_scnprintf(str, sizeof(str), sched_group_cpus(group));6614658266156583 printk(KERN_CONT " %s", str);66166616- if (group->cpu_power != SCHED_POWER_SCALE) {65846584+ if (group->sgp->power != SCHED_POWER_SCALE) {66176585 printk(KERN_CONT " (cpu_power = %d)",66186618- group->cpu_power);65866586+ group->sgp->power);66196587 }6620658866216589 group = group->next;···68066774 return rd;68076775}6808677667776777+static void free_sched_groups(struct sched_group *sg, int free_sgp)67786778+{67796779+ struct sched_group *tmp, *first;67806780+67816781+ if (!sg)67826782+ return;67836783+67846784+ first = sg;67856785+ do {67866786+ tmp = sg->next;67876787+67886788+ if (free_sgp && atomic_dec_and_test(&sg->sgp->ref))67896789+ kfree(sg->sgp);67906790+67916791+ kfree(sg);67926792+ sg = tmp;67936793+ } while (sg != first);67946794+}67956795+68096796static void free_sched_domain(struct rcu_head *rcu)68106797{68116798 struct sched_domain *sd = container_of(rcu, struct sched_domain, rcu);68126812- if (atomic_dec_and_test(&sd->groups->ref))67996799+68006800+ /*68016801+ * If its an overlapping domain it has private groups, iterate and68026802+ * nuke them all.68036803+ */68046804+ if (sd->flags & SD_OVERLAP) {68056805+ free_sched_groups(sd->groups, 1);68066806+ } else if (atomic_dec_and_test(&sd->groups->ref)) {68076807+ kfree(sd->groups->sgp);68136808 kfree(sd->groups);68096809+ }68146810 kfree(sd);68156811}68166812···70056945struct sd_data {70066946 struct sched_domain **__percpu sd;70076947 struct sched_group **__percpu sg;69486948+ struct sched_group_power **__percpu sgp;70086949};7009695070106951struct s_data {···70256964typedef struct sched_domain *(*sched_domain_init_f)(struct sched_domain_topology_level *tl, int cpu);70266965typedef const struct cpumask *(*sched_domain_mask_f)(int cpu);7027696669676967+#define SDTL_OVERLAP 0x0169686968+70286969struct sched_domain_topology_level {70296970 sched_domain_init_f init;70306971 sched_domain_mask_f mask;69726972+ int flags;70316973 struct sd_data data;70326974};7033697570347034-/*70357035- * Assumes the sched_domain tree is fully constructed70367036- */69766976+static int69776977+build_overlap_sched_groups(struct sched_domain *sd, int cpu)69786978+{69796979+ struct sched_group *first = NULL, *last = NULL, *groups = NULL, *sg;69806980+ const struct cpumask *span = sched_domain_span(sd);69816981+ struct cpumask *covered = sched_domains_tmpmask;69826982+ struct sd_data *sdd = sd->private;69836983+ struct sched_domain *child;69846984+ int i;69856985+69866986+ cpumask_clear(covered);69876987+69886988+ for_each_cpu(i, span) {69896989+ struct cpumask *sg_span;69906990+69916991+ if (cpumask_test_cpu(i, covered))69926992+ continue;69936993+69946994+ sg = kzalloc_node(sizeof(struct sched_group) + cpumask_size(),69956995+ GFP_KERNEL, cpu_to_node(i));69966996+69976997+ if (!sg)69986998+ goto fail;69996999+70007000+ sg_span = sched_group_cpus(sg);70017001+70027002+ child = *per_cpu_ptr(sdd->sd, i);70037003+ if (child->child) {70047004+ child = child->child;70057005+ cpumask_copy(sg_span, sched_domain_span(child));70067006+ } else70077007+ cpumask_set_cpu(i, sg_span);70087008+70097009+ cpumask_or(covered, covered, sg_span);70107010+70117011+ sg->sgp = *per_cpu_ptr(sdd->sgp, cpumask_first(sg_span));70127012+ atomic_inc(&sg->sgp->ref);70137013+70147014+ if (cpumask_test_cpu(cpu, sg_span))70157015+ groups = sg;70167016+70177017+ if (!first)70187018+ first = sg;70197019+ if (last)70207020+ last->next = sg;70217021+ last = sg;70227022+ last->next = first;70237023+ }70247024+ sd->groups = groups;70257025+70267026+ return 0;70277027+70287028+fail:70297029+ free_sched_groups(first, 0);70307030+70317031+ return -ENOMEM;70327032+}70337033+70377034static int get_group(int cpu, struct sd_data *sdd, struct sched_group **sg)70387035{70397036 struct sched_domain *sd = *per_cpu_ptr(sdd->sd, cpu);···71006981 if (child)71016982 cpu = cpumask_first(sched_domain_span(child));7102698371037103- if (sg)69846984+ if (sg) {71046985 *sg = *per_cpu_ptr(sdd->sg, cpu);69866986+ (*sg)->sgp = *per_cpu_ptr(sdd->sgp, cpu);69876987+ atomic_set(&(*sg)->sgp->ref, 1); /* for claim_allocations */69886988+ }7105698971066990 return cpu;71076991}7108699271096993/*71107110- * build_sched_groups takes the cpumask we wish to span, and a pointer71117111- * to a function which identifies what group(along with sched group) a CPU71127112- * belongs to. The return value of group_fn must be a >= 0 and < nr_cpu_ids71137113- * (due to the fact that we keep track of groups covered with a struct cpumask).71147114- *71156994 * build_sched_groups will build a circular linked list of the groups71166995 * covered by the given span, and will set each group's ->cpumask correctly,71176996 * and ->cpu_power to 0.69976997+ *69986998+ * Assumes the sched_domain tree is fully constructed71186999 */71197119-static void71207120-build_sched_groups(struct sched_domain *sd)70007000+static int70017001+build_sched_groups(struct sched_domain *sd, int cpu)71217002{71227003 struct sched_group *first = NULL, *last = NULL;71237004 struct sd_data *sdd = sd->private;71247005 const struct cpumask *span = sched_domain_span(sd);71257006 struct cpumask *covered;71267007 int i;70087008+70097009+ get_group(cpu, sdd, &sd->groups);70107010+ atomic_inc(&sd->groups->ref);70117011+70127012+ if (cpu != cpumask_first(sched_domain_span(sd)))70137013+ return 0;7127701471287015 lockdep_assert_held(&sched_domains_mutex);71297016 covered = sched_domains_tmpmask;···71457020 continue;7146702171477022 cpumask_clear(sched_group_cpus(sg));71487148- sg->cpu_power = 0;70237023+ sg->sgp->power = 0;7149702471507025 for_each_cpu(j, span) {71517026 if (get_group(j, sdd, NULL) != group)···71627037 last = sg;71637038 }71647039 last->next = first;70407040+70417041+ return 0;71657042}7166704371677044/*···71787051 */71797052static void init_sched_groups_power(int cpu, struct sched_domain *sd)71807053{71817181- WARN_ON(!sd || !sd->groups);70547054+ struct sched_group *sg = sd->groups;7182705571837183- if (cpu != group_first_cpu(sd->groups))70567056+ WARN_ON(!sd || !sg);70577057+70587058+ do {70597059+ sg->group_weight = cpumask_weight(sched_group_cpus(sg));70607060+ sg = sg->next;70617061+ } while (sg != sd->groups);70627062+70637063+ if (cpu != group_first_cpu(sg))71847064 return;71857185-71867186- sd->groups->group_weight = cpumask_weight(sched_group_cpus(sd->groups));7187706571887066 update_group_power(sd, cpu);71897067}···73097177static void claim_allocations(int cpu, struct sched_domain *sd)73107178{73117179 struct sd_data *sdd = sd->private;73127312- struct sched_group *sg = sd->groups;7313718073147181 WARN_ON_ONCE(*per_cpu_ptr(sdd->sd, cpu) != sd);73157182 *per_cpu_ptr(sdd->sd, cpu) = NULL;7316718373177317- if (cpu == cpumask_first(sched_group_cpus(sg))) {73187318- WARN_ON_ONCE(*per_cpu_ptr(sdd->sg, cpu) != sg);71847184+ if (atomic_read(&(*per_cpu_ptr(sdd->sg, cpu))->ref))73197185 *per_cpu_ptr(sdd->sg, cpu) = NULL;73207320- }71867186+71877187+ if (atomic_read(&(*per_cpu_ptr(sdd->sgp, cpu))->ref))71887188+ *per_cpu_ptr(sdd->sgp, cpu) = NULL;73217189}7322719073237191#ifdef CONFIG_SCHED_SMT···73427210#endif73437211 { sd_init_CPU, cpu_cpu_mask, },73447212#ifdef CONFIG_NUMA73457345- { sd_init_NODE, cpu_node_mask, },72137213+ { sd_init_NODE, cpu_node_mask, SDTL_OVERLAP, },73467214 { sd_init_ALLNODES, cpu_allnodes_mask, },73477215#endif73487216 { NULL, },···73667234 if (!sdd->sg)73677235 return -ENOMEM;7368723672377237+ sdd->sgp = alloc_percpu(struct sched_group_power *);72387238+ if (!sdd->sgp)72397239+ return -ENOMEM;72407240+73697241 for_each_cpu(j, cpu_map) {73707242 struct sched_domain *sd;73717243 struct sched_group *sg;72447244+ struct sched_group_power *sgp;7372724573737246 sd = kzalloc_node(sizeof(struct sched_domain) + cpumask_size(),73747247 GFP_KERNEL, cpu_to_node(j));···73887251 return -ENOMEM;7389725273907253 *per_cpu_ptr(sdd->sg, j) = sg;72547254+72557255+ sgp = kzalloc_node(sizeof(struct sched_group_power),72567256+ GFP_KERNEL, cpu_to_node(j));72577257+ if (!sgp)72587258+ return -ENOMEM;72597259+72607260+ *per_cpu_ptr(sdd->sgp, j) = sgp;73917261 }73927262 }73937263···74107266 struct sd_data *sdd = &tl->data;7411726774127268 for_each_cpu(j, cpu_map) {74137413- kfree(*per_cpu_ptr(sdd->sd, j));72697269+ struct sched_domain *sd = *per_cpu_ptr(sdd->sd, j);72707270+ if (sd && (sd->flags & SD_OVERLAP))72717271+ free_sched_groups(sd->groups, 0);74147272 kfree(*per_cpu_ptr(sdd->sg, j));72737273+ kfree(*per_cpu_ptr(sdd->sgp, j));74157274 }74167275 free_percpu(sdd->sd);74177276 free_percpu(sdd->sg);72777277+ free_percpu(sdd->sgp);74187278 }74197279}74207280···74647316 struct sched_domain_topology_level *tl;7465731774667318 sd = NULL;74677467- for (tl = sched_domain_topology; tl->init; tl++)73197319+ for (tl = sched_domain_topology; tl->init; tl++) {74687320 sd = build_sched_domain(tl, &d, cpu_map, attr, sd, i);73217321+ if (tl->flags & SDTL_OVERLAP || sched_feat(FORCE_SD_OVERLAP))73227322+ sd->flags |= SD_OVERLAP;73237323+ if (cpumask_equal(cpu_map, sched_domain_span(sd)))73247324+ break;73257325+ }7469732674707327 while (sd->child)74717328 sd = sd->child;···74827329 for_each_cpu(i, cpu_map) {74837330 for (sd = *per_cpu_ptr(d.sd, i); sd; sd = sd->parent) {74847331 sd->span_weight = cpumask_weight(sched_domain_span(sd));74857485- get_group(i, sd->private, &sd->groups);74867486- atomic_inc(&sd->groups->ref);74877487-74887488- if (i != cpumask_first(sched_domain_span(sd)))74897489- continue;74907490-74917491- build_sched_groups(sd);73327332+ if (sd->flags & SD_OVERLAP) {73337333+ if (build_overlap_sched_groups(sd, i))73347334+ goto error;73357335+ } else {73367336+ if (build_sched_groups(sd, i))73377337+ goto error;73387338+ }74927339 }74937340 }74947341···79107757#endif79117758#endif79127759 cfs_rq->min_vruntime = (u64)(-(1LL << 20));77607760+#ifndef CONFIG_64BIT77617761+ cfs_rq->min_vruntime_copy = cfs_rq->min_vruntime;77627762+#endif79137763}7914776479157765static void init_rt_rq(struct rt_rq *rt_rq, struct rq *rq)
+23-23
kernel/sched_fair.c
···15851585 }1586158615871587 /* Adjust by relative CPU power of the group */15881588- avg_load = (avg_load * SCHED_POWER_SCALE) / group->cpu_power;15881588+ avg_load = (avg_load * SCHED_POWER_SCALE) / group->sgp->power;1589158915901590 if (local_group) {15911591 this_load = avg_load;···26312631 power >>= SCHED_POWER_SHIFT;26322632 }2633263326342634- sdg->cpu_power_orig = power;26342634+ sdg->sgp->power_orig = power;2635263526362636 if (sched_feat(ARCH_POWER))26372637 power *= arch_scale_freq_power(sd, cpu);···26472647 power = 1;2648264826492649 cpu_rq(cpu)->cpu_power = power;26502650- sdg->cpu_power = power;26502650+ sdg->sgp->power = power;26512651}2652265226532653static void update_group_power(struct sched_domain *sd, int cpu)···2665266526662666 group = child->groups;26672667 do {26682668- power += group->cpu_power;26682668+ power += group->sgp->power;26692669 group = group->next;26702670 } while (group != child->groups);2671267126722672- sdg->cpu_power = power;26722672+ sdg->sgp->power = power;26732673}2674267426752675/*···26912691 /*26922692 * If ~90% of the cpu_power is still there, we're good.26932693 */26942694- if (group->cpu_power * 32 > group->cpu_power_orig * 29)26942694+ if (group->sgp->power * 32 > group->sgp->power_orig * 29)26952695 return 1;2696269626972697 return 0;···27712771 }2772277227732773 /* Adjust by relative CPU power of the group */27742774- sgs->avg_load = (sgs->group_load*SCHED_POWER_SCALE) / group->cpu_power;27742774+ sgs->avg_load = (sgs->group_load*SCHED_POWER_SCALE) / group->sgp->power;2775277527762776 /*27772777 * Consider the group unbalanced when the imbalance is larger···27882788 if ((max_cpu_load - min_cpu_load) >= avg_load_per_task && max_nr_running > 1)27892789 sgs->group_imb = 1;2790279027912791- sgs->group_capacity = DIV_ROUND_CLOSEST(group->cpu_power,27912791+ sgs->group_capacity = DIV_ROUND_CLOSEST(group->sgp->power,27922792 SCHED_POWER_SCALE);27932793 if (!sgs->group_capacity)27942794 sgs->group_capacity = fix_small_capacity(sd, group);···28772877 return;2878287828792879 sds->total_load += sgs.group_load;28802880- sds->total_pwr += sg->cpu_power;28802880+ sds->total_pwr += sg->sgp->power;2881288128822882 /*28832883 * In case the child domain prefers tasks go to siblings···29622962 if (this_cpu > busiest_cpu)29632963 return 0;2964296429652965- *imbalance = DIV_ROUND_CLOSEST(sds->max_load * sds->busiest->cpu_power,29652965+ *imbalance = DIV_ROUND_CLOSEST(sds->max_load * sds->busiest->sgp->power,29662966 SCHED_POWER_SCALE);29672967 return 1;29682968}···2993299329942994 scaled_busy_load_per_task = sds->busiest_load_per_task29952995 * SCHED_POWER_SCALE;29962996- scaled_busy_load_per_task /= sds->busiest->cpu_power;29962996+ scaled_busy_load_per_task /= sds->busiest->sgp->power;2997299729982998 if (sds->max_load - sds->this_load + scaled_busy_load_per_task >=29992999 (scaled_busy_load_per_task * imbn)) {···30073007 * moving them.30083008 */3009300930103010- pwr_now += sds->busiest->cpu_power *30103010+ pwr_now += sds->busiest->sgp->power *30113011 min(sds->busiest_load_per_task, sds->max_load);30123012- pwr_now += sds->this->cpu_power *30123012+ pwr_now += sds->this->sgp->power *30133013 min(sds->this_load_per_task, sds->this_load);30143014 pwr_now /= SCHED_POWER_SCALE;3015301530163016 /* Amount of load we'd subtract */30173017 tmp = (sds->busiest_load_per_task * SCHED_POWER_SCALE) /30183018- sds->busiest->cpu_power;30183018+ sds->busiest->sgp->power;30193019 if (sds->max_load > tmp)30203020- pwr_move += sds->busiest->cpu_power *30203020+ pwr_move += sds->busiest->sgp->power *30213021 min(sds->busiest_load_per_task, sds->max_load - tmp);3022302230233023 /* Amount of load we'd add */30243024- if (sds->max_load * sds->busiest->cpu_power <30243024+ if (sds->max_load * sds->busiest->sgp->power <30253025 sds->busiest_load_per_task * SCHED_POWER_SCALE)30263026- tmp = (sds->max_load * sds->busiest->cpu_power) /30273027- sds->this->cpu_power;30263026+ tmp = (sds->max_load * sds->busiest->sgp->power) /30273027+ sds->this->sgp->power;30283028 else30293029 tmp = (sds->busiest_load_per_task * SCHED_POWER_SCALE) /30303030- sds->this->cpu_power;30313031- pwr_move += sds->this->cpu_power *30303030+ sds->this->sgp->power;30313031+ pwr_move += sds->this->sgp->power *30323032 min(sds->this_load_per_task, sds->this_load + tmp);30333033 pwr_move /= SCHED_POWER_SCALE;30343034···3074307430753075 load_above_capacity *= (SCHED_LOAD_SCALE * SCHED_POWER_SCALE);3076307630773077- load_above_capacity /= sds->busiest->cpu_power;30773077+ load_above_capacity /= sds->busiest->sgp->power;30783078 }3079307930803080 /*···30903090 max_pull = min(sds->max_load - sds->avg_load, load_above_capacity);3091309130923092 /* How much load to actually move to equalise the imbalance */30933093- *imbalance = min(max_pull * sds->busiest->cpu_power,30943094- (sds->avg_load - sds->this_load) * sds->this->cpu_power)30933093+ *imbalance = min(max_pull * sds->busiest->sgp->power,30943094+ (sds->avg_load - sds->this_load) * sds->this->sgp->power)30953095 / SCHED_POWER_SCALE;3096309630973097 /*
+2
kernel/sched_features.h
···7070 * using the scheduler IPI. Reduces rq->lock contention/bounces.7171 */7272SCHED_FEAT(TTWU_QUEUE, 1)7373+7474+SCHED_FEAT(FORCE_SD_OVERLAP, 0)
+13-6
kernel/signal.c
···11781178{11791179 struct sighand_struct *sighand;1180118011811181- rcu_read_lock();11821181 for (;;) {11821182+ local_irq_save(*flags);11831183+ rcu_read_lock();11831184 sighand = rcu_dereference(tsk->sighand);11841184- if (unlikely(sighand == NULL))11851185+ if (unlikely(sighand == NULL)) {11861186+ rcu_read_unlock();11871187+ local_irq_restore(*flags);11851188 break;11891189+ }1186119011871187- spin_lock_irqsave(&sighand->siglock, *flags);11881188- if (likely(sighand == tsk->sighand))11911191+ spin_lock(&sighand->siglock);11921192+ if (likely(sighand == tsk->sighand)) {11931193+ rcu_read_unlock();11891194 break;11901190- spin_unlock_irqrestore(&sighand->siglock, *flags);11951195+ }11961196+ spin_unlock(&sighand->siglock);11971197+ rcu_read_unlock();11981198+ local_irq_restore(*flags);11911199 }11921192- rcu_read_unlock();1193120011941201 return sighand;11951202}
···23102310 for (i = 0; i <= classzone_idx; i++)23112311 present_pages += pgdat->node_zones[i].present_pages;2312231223132313- return balanced_pages > (present_pages >> 2);23132313+ /* A special case here: if zone has no page, we think it's balanced */23142314+ return balanced_pages >= (present_pages >> 2);23142315}2315231623162317/* is kswapd sleeping prematurely? */
···620620 struct sock *parent = bt_sk(sk)->parent;621621 rsp.result = cpu_to_le16(L2CAP_CR_PEND);622622 rsp.status = cpu_to_le16(L2CAP_CS_AUTHOR_PEND);623623- parent->sk_data_ready(parent, 0);623623+ if (parent)624624+ parent->sk_data_ready(parent, 0);624625625626 } else {626627 sk->sk_state = BT_CONFIG;···2324232323252324 sk = chan->sk;2326232523272327- if (sk->sk_state != BT_CONFIG) {23262326+ if (sk->sk_state != BT_CONFIG && sk->sk_state != BT_CONNECT2) {23282327 struct l2cap_cmd_rej rej;2329232823302329 rej.reason = cpu_to_le16(0x0002);···2335233423362335 /* Reject if config buffer is too small. */23372336 len = cmd_len - sizeof(*req);23382338- if (chan->conf_len + len > sizeof(chan->conf_req)) {23372337+ if (len < 0 || chan->conf_len + len > sizeof(chan->conf_req)) {23392338 l2cap_send_cmd(conn, cmd->ident, L2CAP_CONF_RSP,23402339 l2cap_build_conf_rsp(chan, rsp,23412340 L2CAP_CONF_REJECT, flags), rsp);···40104009 struct sock *parent = bt_sk(sk)->parent;40114010 res = L2CAP_CR_PEND;40124011 stat = L2CAP_CS_AUTHOR_PEND;40134013- parent->sk_data_ready(parent, 0);40124012+ if (parent)40134013+ parent->sk_data_ready(parent, 0);40144014 } else {40154015 sk->sk_state = BT_CONFIG;40164016 res = L2CAP_CR_SUCCESS;
+10-7
net/ceph/ceph_fs.c
···3636 if ((flags & O_DIRECTORY) == O_DIRECTORY)3737 return CEPH_FILE_MODE_PIN;3838#endif3939- if ((flags & O_APPEND) == O_APPEND)4040- flags |= O_WRONLY;41394242- if ((flags & O_ACCMODE) == O_RDWR)4343- mode = CEPH_FILE_MODE_RDWR;4444- else if ((flags & O_ACCMODE) == O_WRONLY)4040+ switch (flags & O_ACCMODE) {4141+ case O_WRONLY:4542 mode = CEPH_FILE_MODE_WR;4646- else4343+ break;4444+ case O_RDONLY:4745 mode = CEPH_FILE_MODE_RD;4848-4646+ break;4747+ case O_RDWR:4848+ case O_ACCMODE: /* this is what the VFS does */4949+ mode = CEPH_FILE_MODE_RDWR;5050+ break;5151+ }4952#ifdef O_LAZY5053 if (flags & O_LAZY)5154 mode |= CEPH_FILE_MODE_LAZY;
+2-1
net/mac80211/scan.c
···877877 for (i = 0; i < IEEE80211_NUM_BANDS; i++) {878878 local->sched_scan_ies.ie[i] = kzalloc(2 +879879 IEEE80211_MAX_SSID_LEN +880880- local->scan_ies_len,880880+ local->scan_ies_len +881881+ req->ie_len,881882 GFP_KERNEL);882883 if (!local->sched_scan_ies.ie[i]) {883884 ret = -ENOMEM;
+13-3
net/mac80211/wpa.c
···8686 struct sk_buff *skb = rx->skb;8787 struct ieee80211_rx_status *status = IEEE80211_SKB_RXCB(skb);8888 struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)skb->data;8989+ int queue = rx->queue;9090+9191+ /* otherwise, TKIP is vulnerable to TID 0 vs. non-QoS replays */9292+ if (rx->queue == NUM_RX_DATA_QUEUES - 1)9393+ queue = 0;89949095 /*9196 * it makes no sense to check for MIC errors on anything other···153148154149update_iv:155150 /* update IV in key information to be able to detect replays */156156- rx->key->u.tkip.rx[rx->queue].iv32 = rx->tkip_iv32;157157- rx->key->u.tkip.rx[rx->queue].iv16 = rx->tkip_iv16;151151+ rx->key->u.tkip.rx[queue].iv32 = rx->tkip_iv32;152152+ rx->key->u.tkip.rx[queue].iv16 = rx->tkip_iv16;158153159154 return RX_CONTINUE;160155···246241 struct ieee80211_key *key = rx->key;247242 struct sk_buff *skb = rx->skb;248243 struct ieee80211_rx_status *status = IEEE80211_SKB_RXCB(skb);244244+ int queue = rx->queue;245245+246246+ /* otherwise, TKIP is vulnerable to TID 0 vs. non-QoS replays */247247+ if (rx->queue == NUM_RX_DATA_QUEUES - 1)248248+ queue = 0;249249250250 hdrlen = ieee80211_hdrlen(hdr->frame_control);251251···271261 res = ieee80211_tkip_decrypt_data(rx->local->wep_rx_tfm,272262 key, skb->data + hdrlen,273263 skb->len - hdrlen, rx->sta->sta.addr,274274- hdr->addr1, hwaccel, rx->queue,264264+ hdr->addr1, hwaccel, queue,275265 &rx->tkip_iv32,276266 &rx->tkip_iv16);277267 if (res != TKIP_DECRYPT_OK)
+8-11
net/sctp/output.c
···500500 * Note: Adler-32 is no longer applicable, as has been replaced501501 * by CRC32-C as described in <draft-ietf-tsvwg-sctpcsum-02.txt>.502502 */503503- if (!sctp_checksum_disable &&504504- !(dst->dev->features & (NETIF_F_NO_CSUM | NETIF_F_SCTP_CSUM))) {505505- __u32 crc32 = sctp_start_cksum((__u8 *)sh, cksum_buf_len);503503+ if (!sctp_checksum_disable) {504504+ if (!(dst->dev->features & NETIF_F_SCTP_CSUM)) {505505+ __u32 crc32 = sctp_start_cksum((__u8 *)sh, cksum_buf_len);506506507507- /* 3) Put the resultant value into the checksum field in the508508- * common header, and leave the rest of the bits unchanged.509509- */510510- sh->checksum = sctp_end_cksum(crc32);511511- } else {512512- if (dst->dev->features & NETIF_F_SCTP_CSUM) {507507+ /* 3) Put the resultant value into the checksum field in the508508+ * common header, and leave the rest of the bits unchanged.509509+ */510510+ sh->checksum = sctp_end_cksum(crc32);511511+ } else {513512 /* no need to seed pseudo checksum for SCTP */514513 nskb->ip_summed = CHECKSUM_PARTIAL;515514 nskb->csum_start = (skb_transport_header(nskb) -516515 nskb->head);517516 nskb->csum_offset = offsetof(struct sctphdr, checksum);518518- } else {519519- nskb->ip_summed = CHECKSUM_UNNECESSARY;520517 }521518 }522519
+19-1
net/sctp/outqueue.c
···15821582#endif /* SCTP_DEBUG */15831583 if (transport) {15841584 if (bytes_acked) {15851585+ struct sctp_association *asoc = transport->asoc;15861586+15851587 /* We may have counted DATA that was migrated15861588 * to this transport due to DEL-IP operation.15871589 * Subtract those bytes, since the were never···16011599 */16021600 transport->error_count = 0;16031601 transport->asoc->overall_error_count = 0;16021602+16031603+ /*16041604+ * While in SHUTDOWN PENDING, we may have started16051605+ * the T5 shutdown guard timer after reaching the16061606+ * retransmission limit. Stop that timer as soon16071607+ * as the receiver acknowledged any data.16081608+ */16091609+ if (asoc->state == SCTP_STATE_SHUTDOWN_PENDING &&16101610+ del_timer(&asoc->timers16111611+ [SCTP_EVENT_TIMEOUT_T5_SHUTDOWN_GUARD]))16121612+ sctp_association_put(asoc);1604161316051614 /* Mark the destination transport address as16061615 * active if it is not so marked.···16421629 * A sender is doing zero window probing when the16431630 * receiver's advertised window is zero, and there is16441631 * only one data chunk in flight to the receiver.16321632+ *16331633+ * Allow the association to timeout while in SHUTDOWN16341634+ * PENDING or SHUTDOWN RECEIVED in case the receiver16351635+ * stays in zero window mode forever.16451636 */16461637 if (!q->asoc->peer.rwnd &&16471638 !list_empty(&tlist) &&16481648- (sack_ctsn+2 == q->asoc->next_tsn)) {16391639+ (sack_ctsn+2 == q->asoc->next_tsn) &&16401640+ q->asoc->state < SCTP_STATE_SHUTDOWN_PENDING) {16491641 SCTP_DEBUG_PRINTK("%s: SACK received for zero "16501642 "window probe: %u\n",16511643 __func__, sack_ctsn);
+18-2
net/sctp/sm_sideeffect.c
···670670 /* 8.3 Upon the receipt of the HEARTBEAT ACK, the sender of the671671 * HEARTBEAT should clear the error counter of the destination672672 * transport address to which the HEARTBEAT was sent.673673- * The association's overall error count is also cleared.674673 */675674 t->error_count = 0;676676- t->asoc->overall_error_count = 0;675675+676676+ /*677677+ * Although RFC4960 specifies that the overall error count must678678+ * be cleared when a HEARTBEAT ACK is received, we make an679679+ * exception while in SHUTDOWN PENDING. If the peer keeps its680680+ * window shut forever, we may never be able to transmit our681681+ * outstanding data and rely on the retransmission limit be reached682682+ * to shutdown the association.683683+ */684684+ if (t->asoc->state != SCTP_STATE_SHUTDOWN_PENDING)685685+ t->asoc->overall_error_count = 0;677686678687 /* Clear the hb_sent flag to signal that we had a good679688 * acknowledgement.···14451436 case SCTP_CMD_SETUP_T2:14461437 sctp_cmd_setup_t2(commands, asoc, cmd->obj.ptr);14471438 break;14391439+14401440+ case SCTP_CMD_TIMER_START_ONCE:14411441+ timer = &asoc->timers[cmd->obj.to];14421442+14431443+ if (timer_pending(timer))14441444+ break;14451445+ /* fall through */1448144614491447 case SCTP_CMD_TIMER_START:14501448 timer = &asoc->timers[cmd->obj.to];
+23-9
net/sctp/sm_statefuns.c
···51545154 * The sender of the SHUTDOWN MAY also start an overall guard timer51555155 * 'T5-shutdown-guard' to bound the overall time for shutdown sequence.51565156 */51575157- sctp_add_cmd_sf(commands, SCTP_CMD_TIMER_START,51575157+ sctp_add_cmd_sf(commands, SCTP_CMD_TIMER_RESTART,51585158 SCTP_TO(SCTP_EVENT_TIMEOUT_T5_SHUTDOWN_GUARD));5159515951605160 if (asoc->autoclose)···52995299 SCTP_INC_STATS(SCTP_MIB_T3_RTX_EXPIREDS);5300530053015301 if (asoc->overall_error_count >= asoc->max_retrans) {53025302- sctp_add_cmd_sf(commands, SCTP_CMD_SET_SK_ERR,53035303- SCTP_ERROR(ETIMEDOUT));53045304- /* CMD_ASSOC_FAILED calls CMD_DELETE_TCB. */53055305- sctp_add_cmd_sf(commands, SCTP_CMD_ASSOC_FAILED,53065306- SCTP_PERR(SCTP_ERROR_NO_ERROR));53075307- SCTP_INC_STATS(SCTP_MIB_ABORTEDS);53085308- SCTP_DEC_STATS(SCTP_MIB_CURRESTAB);53095309- return SCTP_DISPOSITION_DELETE_TCB;53025302+ if (asoc->state == SCTP_STATE_SHUTDOWN_PENDING) {53035303+ /*53045304+ * We are here likely because the receiver had its rwnd53055305+ * closed for a while and we have not been able to53065306+ * transmit the locally queued data within the maximum53075307+ * retransmission attempts limit. Start the T553085308+ * shutdown guard timer to give the receiver one last53095309+ * chance and some additional time to recover before53105310+ * aborting.53115311+ */53125312+ sctp_add_cmd_sf(commands, SCTP_CMD_TIMER_START_ONCE,53135313+ SCTP_TO(SCTP_EVENT_TIMEOUT_T5_SHUTDOWN_GUARD));53145314+ } else {53155315+ sctp_add_cmd_sf(commands, SCTP_CMD_SET_SK_ERR,53165316+ SCTP_ERROR(ETIMEDOUT));53175317+ /* CMD_ASSOC_FAILED calls CMD_DELETE_TCB. */53185318+ sctp_add_cmd_sf(commands, SCTP_CMD_ASSOC_FAILED,53195319+ SCTP_PERR(SCTP_ERROR_NO_ERROR));53205320+ SCTP_INC_STATS(SCTP_MIB_ABORTEDS);53215321+ SCTP_DEC_STATS(SCTP_MIB_CURRESTAB);53225322+ return SCTP_DISPOSITION_DELETE_TCB;53235323+ }53105324 }5311532553125326 /* E1) For the destination address for which the timer
···616616 BUG_ON(RPC_IS_QUEUED(task));617617618618 for (;;) {619619+ void (*do_action)(struct rpc_task *);619620620621 /*621621- * Execute any pending callback.622622+ * Execute any pending callback first.622623 */623623- if (task->tk_callback) {624624- void (*save_callback)(struct rpc_task *);625625-626626- /*627627- * We set tk_callback to NULL before calling it,628628- * in case it sets the tk_callback field itself:629629- */630630- save_callback = task->tk_callback;631631- task->tk_callback = NULL;632632- save_callback(task);633633- } else {624624+ do_action = task->tk_callback;625625+ task->tk_callback = NULL;626626+ if (do_action == NULL) {634627 /*635628 * Perform the next FSM step.636636- * tk_action may be NULL when the task has been killed637637- * by someone else.629629+ * tk_action may be NULL if the task has been killed.630630+ * In particular, note that rpc_killall_tasks may631631+ * do this at any time, so beware when dereferencing.638632 */639639- if (task->tk_action == NULL)633633+ do_action = task->tk_action;634634+ if (do_action == NULL)640635 break;641641- task->tk_action(task);642636 }637637+ do_action(task);643638644639 /*645640 * Lockless check for whether task is sleeping or not.