···1818 parameters containing user virtual addresses *must* have1919 their top byte cleared before trapping to the kernel.20202121- (2) Tags are not guaranteed to be preserved when delivering2222- signals. This means that signal handlers in applications2323- making use of tags cannot rely on the tag information for2424- user virtual addresses being maintained for fields inside2525- siginfo_t. One exception to this rule is for signals raised2626- in response to debug exceptions, where the tag information2121+ (2) Non-zero tags are not preserved when delivering signals.2222+ This means that signal handlers in applications making use2323+ of tags cannot rely on the tag information for user virtual2424+ addresses being maintained for fields inside siginfo_t.2525+ One exception to this rule is for signals raised in response2626+ to watchpoint debug exceptions, where the tag information2727 will be preserved.28282929 (3) Special care should be taken when using tagged pointers,3030 since it is likely that C compilers will not hazard two3131- addresses differing only in the upper bits.3131+ virtual addresses differing only in the upper byte.32323333The architecture prevents the use of a tagged PC, so the upper byte will3434be set to a sign-extension of bit 55 on exception return.
+7-7
Documentation/filesystems/vfs.txt
···359359 ssize_t (*listxattr) (struct dentry *, char *, size_t);360360 int (*removexattr) (struct dentry *, const char *);361361 void (*update_time)(struct inode *, struct timespec *, int);362362- int (*atomic_open)(struct inode *, struct dentry *,362362+ int (*atomic_open)(struct inode *, struct dentry *, struct file *,363363+ unsigned open_flag, umode_t create_mode, int *opened);363364 int (*tmpfile) (struct inode *, struct dentry *, umode_t);364364-} ____cacheline_aligned;365365- struct file *, unsigned open_flag,366366- umode_t create_mode, int *opened);367365};368366369367Again, all methods are called without any locks being held, unless···468470 method the filesystem can look up, possibly create and open the file in469471 one atomic operation. If it cannot perform this (e.g. the file type470472 turned out to be wrong) it may signal this by returning 1 instead of471471- usual 0 or -ve . This method is only called if the last472472- component is negative or needs lookup. Cached positive dentries are473473- still handled by f_op->open().473473+ usual 0 or -ve . This method is only called if the last component is474474+ negative or needs lookup. Cached positive dentries are still handled by475475+ f_op->open(). If the file was created, the FILE_CREATED flag should be476476+ set in "opened". In case of O_EXCL the method must only succeed if the477477+ file didn't exist and hence FILE_CREATED shall always be set on success.474478475479 tmpfile: called in the end of O_TMPFILE open(). Optional, equivalent to476480 atomically creating, opening and unlinking a file in given directory.
+6
Documentation/networking/bonding.txt
···13621362To remove an ARP target:13631363# echo -192.168.0.100 > /sys/class/net/bond0/bonding/arp_ip_target1364136413651365+To configure the interval between learning packet transmits:13661366+# echo 12 > /sys/class/net/bond0/bonding/lp_interval13671367+ NOTE: the lp_inteval is the number of seconds between instances where13681368+the bonding driver sends learning packets to each slaves peer switch. The13691369+default interval is 1 second.13701370+13651371Example Configuration13661372---------------------13671373 We begin with the same example that is shown in section 3.3,
+1-3
Documentation/scheduler/sched-design-CFS.txt
···6666runqueue.67676868CFS maintains a time-ordered rbtree, where all runnable tasks are sorted by the6969-p->se.vruntime key (there is a subtraction using rq->cfs.min_vruntime to7070-account for possible wraparounds). CFS picks the "leftmost" task from this7171-tree and sticks to it.6969+p->se.vruntime key. CFS picks the "leftmost" task from this tree and sticks to it.7270As the system progresses forwards, the executed tasks are put into the tree7371more and more to the right --- slowly but surely giving a chance for every task7472to become the "leftmost task" and thus get on the CPU within a deterministic
+1-1
Makefile
···11VERSION = 322PATCHLEVEL = 1233SUBLEVEL = 044-EXTRAVERSION = -rc144+EXTRAVERSION = -rc255NAME = One Giant Leap for Frogkind6677# *DOCUMENTATION*
···11+/*22+ * Copyright (C) 2012 Texas Instruments Incorporated - http://www.ti.com/33+ *44+ * This program is free software; you can redistribute it and/or modify55+ * it under the terms of the GNU General Public License version 2 as66+ * published by the Free Software Foundation.77+ */88+/dts-v1/;99+1010+#include "am33xx.dtsi"1111+#include "am335x-bone-common.dtsi"1212+1313+&ldo3_reg {1414+ regulator-min-microvolt = <1800000>;1515+ regulator-max-microvolt = <1800000>;1616+ regulator-always-on;1717+};
···233233 of_node_put(np);234234}235235236236-static void __init imx6q_opp_init(struct device *cpu_dev)236236+static void __init imx6q_opp_init(void)237237{238238 struct device_node *np;239239+ struct device *cpu_dev = get_cpu_device(0);239240241241+ if (!cpu_dev) {242242+ pr_warn("failed to get cpu0 device\n");243243+ return;244244+ }240245 np = of_node_get(cpu_dev->of_node);241246 if (!np) {242247 pr_warn("failed to find cpu0 node\n");···273268 imx6q_cpuidle_init();274269275270 if (IS_ENABLED(CONFIG_ARM_IMX6Q_CPUFREQ)) {276276- imx6q_opp_init(&imx6q_cpufreq_pdev.dev);271271+ imx6q_opp_init();277272 platform_device_register(&imx6q_cpufreq_pdev);278273 }279274}
+11
arch/arm/mach-imx/system.c
···117117 /* Configure the L2 PREFETCH and POWER registers */118118 val = readl_relaxed(l2x0_base + L2X0_PREFETCH_CTRL);119119 val |= 0x70800000;120120+ /*121121+ * The L2 cache controller(PL310) version on the i.MX6D/Q is r3p1-50rel0122122+ * The L2 cache controller(PL310) version on the i.MX6DL/SOLO/SL is r3p2123123+ * But according to ARM PL310 errata: 752271124124+ * ID: 752271: Double linefill feature can cause data corruption125125+ * Fault Status: Present in: r3p0, r3p1, r3p1-50rel0. Fixed in r3p2126126+ * Workaround: The only workaround to this erratum is to disable the127127+ * double linefill feature. This is the default behavior.128128+ */129129+ if (cpu_is_imx6q())130130+ val &= ~(1 << 30 | 1 << 23);120131 writel_relaxed(val, l2x0_base + L2X0_PREFETCH_CTRL);121132 val = L2X0_DYNAMIC_CLK_GATING_EN | L2X0_STNDBY_MODE_EN;122133 writel_relaxed(val, l2x0_base + L2X0_POWER_CTRL);
···11/*22- * OMAP4 SMP source file. It contains platform specific fucntions22+ * OMAP4 SMP source file. It contains platform specific functions33 * needed for the linux smp kernel.44 *55 * Copyright (C) 2009 Texas Instruments, Inc.
+1-1
arch/arm/mach-omap2/omap_device.c
···158158 }159159160160 od = omap_device_alloc(pdev, hwmods, oh_cnt);161161- if (!od) {161161+ if (IS_ERR(od)) {162162 dev_err(&pdev->dev, "Cannot allocate omap_device for :%s\n",163163 oh_name);164164 ret = PTR_ERR(od);
···11-menu "ST-Ericsson AB U300/U335 Platform"22-33-comment "ST-Ericsson Mobile Platform Products"44-51config ARCH_U30062 bool "ST-Ericsson U300 Series" if ARCH_MULTI_V573 depends on MMU···2125 help2226 Support for ST-Ericsson U300 series mobile platforms.23272424-comment "ST-Ericsson U300/U335 Feature Selections"2828+if ARCH_U3002929+3030+menu "ST-Ericsson AB U300/U335 Platform"25312632config MACH_U3002733 depends on ARCH_U300···5153 SPI framework and ARM PL022 support.52545355endmenu5656+5757+endif
+1
arch/arm/mach-ux500/cache-l2x0.c
···6969 * some SMI service available.7070 */7171 outer_cache.disable = NULL;7272+ outer_cache.set_debug = NULL;72737374 return 0;7475}
+1-1
arch/arm64/include/asm/hwcap.h
···4343 COMPAT_HWCAP_VFPv3|COMPAT_HWCAP_VFPv4|\4444 COMPAT_HWCAP_NEON|COMPAT_HWCAP_IDIV)45454646-extern unsigned int elf_hwcap;4646+extern unsigned long elf_hwcap;4747#endif4848#endif
+16-5
arch/arm64/kernel/process.c
···143143144144void __show_regs(struct pt_regs *regs)145145{146146- int i;146146+ int i, top_reg;147147+ u64 lr, sp;148148+149149+ if (compat_user_mode(regs)) {150150+ lr = regs->compat_lr;151151+ sp = regs->compat_sp;152152+ top_reg = 12;153153+ } else {154154+ lr = regs->regs[30];155155+ sp = regs->sp;156156+ top_reg = 29;157157+ }147158148159 show_regs_print_info(KERN_DEFAULT);149160 print_symbol("PC is at %s\n", instruction_pointer(regs));150150- print_symbol("LR is at %s\n", regs->regs[30]);161161+ print_symbol("LR is at %s\n", lr);151162 printk("pc : [<%016llx>] lr : [<%016llx>] pstate: %08llx\n",152152- regs->pc, regs->regs[30], regs->pstate);153153- printk("sp : %016llx\n", regs->sp);154154- for (i = 29; i >= 0; i--) {163163+ regs->pc, lr, regs->pstate);164164+ printk("sp : %016llx\n", sp);165165+ for (i = top_reg; i >= 0; i--) {155166 printk("x%-2d: %016llx ", i, regs->regs[i]);156167 if (i % 2 == 0)157168 printk("\n");
+1-1
arch/arm64/kernel/setup.c
···5757unsigned int processor_id;5858EXPORT_SYMBOL(processor_id);59596060-unsigned int elf_hwcap __read_mostly;6060+unsigned long elf_hwcap __read_mostly;6161EXPORT_SYMBOL_GPL(elf_hwcap);62626363static const char *cpu_name;
+1-1
arch/arm64/mm/fault.c
···130130 force_sig_info(sig, &si, tsk);131131}132132133133-void do_bad_area(unsigned long addr, unsigned int esr, struct pt_regs *regs)133133+static void do_bad_area(unsigned long addr, unsigned int esr, struct pt_regs *regs)134134{135135 struct task_struct *tsk = current;136136 struct mm_struct *mm = tsk->active_mm;
-3
arch/mips/Makefile
···288288vmlinux.32: vmlinux289289 $(OBJCOPY) -O $(32bit-bfd) $(OBJCOPYFLAGS) $< $@290290291291-292292-#obj-$(CONFIG_KPROBES) += kprobes.o293293-294291#295292# The 64-bit ELF tools are pretty broken so at this time we generate 64-bit296293# ELF files from 32-bit files by conversion.
+2-1
arch/mips/alchemy/common/usb.c
···1414#include <linux/module.h>1515#include <linux/spinlock.h>1616#include <linux/syscore_ops.h>1717+#include <asm/cpu.h>1718#include <asm/mach-au1x00/au1000.h>18191920/* control register offsets */···359358{360359#if defined(CONFIG_DMA_COHERENT)361360 /* Au1200 AB USB does not support coherent memory */362362- if (!(read_c0_prid() & 0xff)) {361361+ if (!(read_c0_prid() & PRID_REV_MASK)) {363362 printk(KERN_INFO "Au1200 USB: this is chip revision AB !!\n");364363 printk(KERN_INFO "Au1200 USB: update your board or re-configure"365364 " the kernel\n");
+2-2
arch/mips/bcm63xx/cpu.c
···306306307307 switch (c->cputype) {308308 case CPU_BMIPS3300:309309- if ((read_c0_prid() & 0xff00) != PRID_IMP_BMIPS3300_ALT)309309+ if ((read_c0_prid() & PRID_IMP_MASK) != PRID_IMP_BMIPS3300_ALT)310310 __cpu_name[cpu] = "Broadcom BCM6338";311311 /* fall-through */312312 case CPU_BMIPS32:313313 chipid_reg = BCM_6345_PERF_BASE;314314 break;315315 case CPU_BMIPS4350:316316- switch ((read_c0_prid() & 0xff)) {316316+ switch ((read_c0_prid() & PRID_REV_MASK)) {317317 case 0x04:318318 chipid_reg = BCM_3368_PERF_BASE;319319 break;
···1313#include <asm/cpu-info.h>1414#include <cpu-feature-overrides.h>15151616-#ifndef current_cpu_type1717-#define current_cpu_type() current_cpu_data.cputype1818-#endif1919-2020-#define boot_cpu_type() cpu_data[0].cputype2121-2216/*2317 * SMP assumption: Options of CPU 0 are a superset of all processors.2418 * This is true for all known MIPS systems.
···11+/*22+ * This file is subject to the terms and conditions of the GNU General Public33+ * License. See the file "COPYING" in the main directory of this archive44+ * for more details.55+ *66+ * Copyright (C) 2003, 2004 Ralf Baechle77+ * Copyright (C) 2004 Maciej W. Rozycki88+ */99+#ifndef __ASM_CPU_TYPE_H1010+#define __ASM_CPU_TYPE_H1111+1212+#include <linux/smp.h>1313+#include <linux/compiler.h>1414+1515+static inline int __pure __get_cpu_type(const int cpu_type)1616+{1717+ switch (cpu_type) {1818+#if defined(CONFIG_SYS_HAS_CPU_LOONGSON2E) || \1919+ defined(CONFIG_SYS_HAS_CPU_LOONGSON2F)2020+ case CPU_LOONGSON2:2121+#endif2222+2323+#ifdef CONFIG_SYS_HAS_CPU_LOONGSON1B2424+ case CPU_LOONGSON1:2525+#endif2626+2727+#ifdef CONFIG_SYS_HAS_CPU_MIPS32_R12828+ case CPU_4KC:2929+ case CPU_ALCHEMY:3030+ case CPU_BMIPS3300:3131+ case CPU_BMIPS4350:3232+ case CPU_PR4450:3333+ case CPU_BMIPS32:3434+ case CPU_JZRISC:3535+#endif3636+3737+#if defined(CONFIG_SYS_HAS_CPU_MIPS32_R1) || \3838+ defined(CONFIG_SYS_HAS_CPU_MIPS32_R2)3939+ case CPU_4KEC:4040+#endif4141+4242+#ifdef CONFIG_SYS_HAS_CPU_MIPS32_R24343+ case CPU_4KSC:4444+ case CPU_24K:4545+ case CPU_34K:4646+ case CPU_1004K:4747+ case CPU_74K:4848+ case CPU_M14KC:4949+ case CPU_M14KEC:5050+#endif5151+5252+#ifdef CONFIG_SYS_HAS_CPU_MIPS64_R15353+ case CPU_5KC:5454+ case CPU_5KE:5555+ case CPU_20KC:5656+ case CPU_25KF:5757+ case CPU_SB1:5858+ case CPU_SB1A:5959+#endif6060+6161+#ifdef CONFIG_SYS_HAS_CPU_MIPS64_R26262+ /*6363+ * All MIPS64 R2 processors have their own special symbols. That is,6464+ * there currently is no pure R2 core6565+ */6666+#endif6767+6868+#ifdef CONFIG_SYS_HAS_CPU_R30006969+ case CPU_R2000:7070+ case CPU_R3000:7171+ case CPU_R3000A:7272+ case CPU_R3041:7373+ case CPU_R3051:7474+ case CPU_R3052:7575+ case CPU_R3081:7676+ case CPU_R3081E:7777+#endif7878+7979+#ifdef CONFIG_SYS_HAS_CPU_TX39XX8080+ case CPU_TX3912:8181+ case CPU_TX3922:8282+ case CPU_TX3927:8383+#endif8484+8585+#ifdef CONFIG_SYS_HAS_CPU_VR41XX8686+ case CPU_VR41XX:8787+ case CPU_VR4111:8888+ case CPU_VR4121:8989+ case CPU_VR4122:9090+ case CPU_VR4131:9191+ case CPU_VR4133:9292+ case CPU_VR4181:9393+ case CPU_VR4181A:9494+#endif9595+9696+#ifdef CONFIG_SYS_HAS_CPU_R43009797+ case CPU_R4300:9898+ case CPU_R4310:9999+#endif100100+101101+#ifdef CONFIG_SYS_HAS_CPU_R4X00102102+ case CPU_R4000PC:103103+ case CPU_R4000SC:104104+ case CPU_R4000MC:105105+ case CPU_R4200:106106+ case CPU_R4400PC:107107+ case CPU_R4400SC:108108+ case CPU_R4400MC:109109+ case CPU_R4600:110110+ case CPU_R4700:111111+ case CPU_R4640:112112+ case CPU_R4650:113113+#endif114114+115115+#ifdef CONFIG_SYS_HAS_CPU_TX49XX116116+ case CPU_TX49XX:117117+#endif118118+119119+#ifdef CONFIG_SYS_HAS_CPU_R5000120120+ case CPU_R5000:121121+#endif122122+123123+#ifdef CONFIG_SYS_HAS_CPU_R5432124124+ case CPU_R5432:125125+#endif126126+127127+#ifdef CONFIG_SYS_HAS_CPU_R5500128128+ case CPU_R5500:129129+#endif130130+131131+#ifdef CONFIG_SYS_HAS_CPU_R6000132132+ case CPU_R6000:133133+ case CPU_R6000A:134134+#endif135135+136136+#ifdef CONFIG_SYS_HAS_CPU_NEVADA137137+ case CPU_NEVADA:138138+#endif139139+140140+#ifdef CONFIG_SYS_HAS_CPU_R8000141141+ case CPU_R8000:142142+#endif143143+144144+#ifdef CONFIG_SYS_HAS_CPU_R10000145145+ case CPU_R10000:146146+ case CPU_R12000:147147+ case CPU_R14000:148148+#endif149149+#ifdef CONFIG_SYS_HAS_CPU_RM7000150150+ case CPU_RM7000:151151+ case CPU_SR71000:152152+#endif153153+#ifdef CONFIG_SYS_HAS_CPU_RM9000154154+ case CPU_RM9000:155155+#endif156156+#ifdef CONFIG_SYS_HAS_CPU_SB1157157+ case CPU_SB1:158158+ case CPU_SB1A:159159+#endif160160+#ifdef CONFIG_SYS_HAS_CPU_CAVIUM_OCTEON161161+ case CPU_CAVIUM_OCTEON:162162+ case CPU_CAVIUM_OCTEON_PLUS:163163+ case CPU_CAVIUM_OCTEON2:164164+#endif165165+166166+#ifdef CONFIG_SYS_HAS_CPU_BMIPS4380167167+ case CPU_BMIPS4380:168168+#endif169169+170170+#ifdef CONFIG_SYS_HAS_CPU_BMIPS5000171171+ case CPU_BMIPS5000:172172+#endif173173+174174+#ifdef CONFIG_SYS_HAS_CPU_XLP175175+ case CPU_XLP:176176+#endif177177+178178+#ifdef CONFIG_SYS_HAS_CPU_XLR179179+ case CPU_XLR:180180+#endif181181+ break;182182+ default:183183+ unreachable();184184+ }185185+186186+ return cpu_type;187187+}188188+189189+static inline int __pure current_cpu_type(void)190190+{191191+ const int cpu_type = current_cpu_data.cputype;192192+193193+ return __get_cpu_type(cpu_type);194194+}195195+196196+static inline int __pure boot_cpu_type(void)197197+{198198+ const int cpu_type = cpu_data[0].cputype;199199+200200+ return __get_cpu_type(cpu_type);201201+}202202+203203+#endif /* __ASM_CPU_TYPE_H */
+29-9
arch/mips/include/asm/cpu.h
···33 * various MIPS cpu types.44 *55 * Copyright (C) 1996 David S. Miller (davem@davemloft.net)66- * Copyright (C) 2004 Maciej W. Rozycki66+ * Copyright (C) 2004, 2013 Maciej W. Rozycki77 */88#ifndef _ASM_CPU_H99#define _ASM_CPU_H10101111-/* Assigned Company values for bits 23:16 of the PRId Register1212- (CP0 register 15, select 0). As of the MIPS32 and MIPS64 specs from1313- MTI, the PRId register is defined in this (backwards compatible)1414- way:1111+/*1212+ As of the MIPS32 and MIPS64 specs from MTI, the PRId register (CP01313+ register 15, select 0) is defined in this (backwards compatible) way:15141615 +----------------+----------------+----------------+----------------+1716 | Company Options| Company ID | Processor ID | Revision |···2122 that bits 16-23 have been 0 for all MIPS processors before the MIPS32/642223 spec.2324*/2525+2626+#define PRID_OPT_MASK 0xff0000002727+2828+/*2929+ * Assigned Company values for bits 23:16 of the PRId register.3030+ */3131+3232+#define PRID_COMP_MASK 0xff000024332534#define PRID_COMP_LEGACY 0x0000002635#define PRID_COMP_MIPS 0x010000···4538#define PRID_COMP_INGENIC 0xd0000046394740/*4848- * Assigned values for the product ID register. In order to detect a4949- * certain CPU type exactly eventually additional registers may need to5050- * be examined. These are valid when 23:16 == PRID_COMP_LEGACY4141+ * Assigned Processor ID (implementation) values for bits 15:8 of the PRId4242+ * register. In order to detect a certain CPU type exactly eventually4343+ * additional registers may need to be examined.5144 */4545+4646+#define PRID_IMP_MASK 0xff004747+4848+/*4949+ * These are valid when 23:16 == PRID_COMP_LEGACY5050+ */5151+5252#define PRID_IMP_R2000 0x01005353#define PRID_IMP_AU1_REV1 0x01005454#define PRID_IMP_AU1_REV2 0x0200···196182#define PRID_IMP_NETLOGIC_XLP2XX 0x1200197183198184/*199199- * Definitions for 7:0 on legacy processors185185+ * Particular Revision values for bits 7:0 of the PRId register.200186 */201187202188#define PRID_REV_MASK 0x00ff189189+190190+/*191191+ * Definitions for 7:0 on legacy processors192192+ */203193204194#define PRID_REV_TX4927 0x0022205195#define PRID_REV_TX4937 0x0030···244226 * +---------------------------------+----------------+----------------+245227 * 31 16 15 8 7 0246228 */229229+230230+#define FPIR_IMP_MASK 0xff00247231248232#define FPIR_IMP_NONE 0x0000249233
···88#ifndef __ASM_MACH_IP22_CPU_FEATURE_OVERRIDES_H99#define __ASM_MACH_IP22_CPU_FEATURE_OVERRIDES_H10101111+#include <asm/cpu.h>1212+1113/*1214 * IP22 with a variety of processors so we can't use defaults for everything.1315 */
···88#ifndef __ASM_MACH_IP27_CPU_FEATURE_OVERRIDES_H99#define __ASM_MACH_IP27_CPU_FEATURE_OVERRIDES_H10101111+#include <asm/cpu.h>1212+1113/*1214 * IP27 only comes with R10000 family processors all using the same config1315 */
···99#ifndef __ASM_MACH_IP28_CPU_FEATURE_OVERRIDES_H1010#define __ASM_MACH_IP28_CPU_FEATURE_OVERRIDES_H11111212+#include <asm/cpu.h>1313+1214/*1315 * IP28 only comes with R10000 family processors all using the same config1416 */
···10101111#ifdef __KERNEL__12121313+#include <asm/cpu-features.h>1314#include <asm/mipsregs.h>1515+#include <asm/cpu-type.h>14161517/*1618 * This is the clock rate of the i8253 PIT. A MIPS system may not have···35333634typedef unsigned int cycles_t;37353636+/*3737+ * On R4000/R4400 before version 5.0 an erratum exists such that if the3838+ * cycle counter is read in the exact moment that it is matching the3939+ * compare register, no interrupt will be generated.4040+ *4141+ * There is a suggested workaround and also the erratum can't strike if4242+ * the compare interrupt isn't being used as the clock source device.4343+ * However for now the implementaton of this function doesn't get these4444+ * fine details right.4545+ */3846static inline cycles_t get_cycles(void)3947{4040- return 0;4848+ switch (boot_cpu_type()) {4949+ case CPU_R4400PC:5050+ case CPU_R4400SC:5151+ case CPU_R4400MC:5252+ if ((read_c0_prid() & 0xff) >= 0x0050)5353+ return read_c0_count();5454+ break;5555+5656+ case CPU_R4000PC:5757+ case CPU_R4000SC:5858+ case CPU_R4000MC:5959+ break;6060+6161+ default:6262+ if (cpu_has_counter)6363+ return read_c0_count();6464+ break;6565+ }6666+6767+ return 0; /* no usable counter */4168}42694370#endif /* __KERNEL__ */
+2-1
arch/mips/include/asm/vga.h
···66#ifndef _ASM_VGA_H77#define _ASM_VGA_H8899+#include <asm/addrspace.h>910#include <asm/byteorder.h>10111112/*···1413 * access the videoram directly without any black magic.1514 */16151717-#define VGA_MAP_MEM(x, s) (0xb0000000L + (unsigned long)(x))1616+#define VGA_MAP_MEM(x, s) CKSEG1ADDR(0x10000000L + (unsigned long)(x))18171918#define vga_readb(x) (*(x))2019#define vga_writeb(x, y) (*(y) = (x))
+37-21
arch/mips/kernel/cpu-probe.c
···20202121#include <asm/bugs.h>2222#include <asm/cpu.h>2323+#include <asm/cpu-type.h>2324#include <asm/fpu.h>2425#include <asm/mipsregs.h>2526#include <asm/watch.h>···5655{5756 struct cpuinfo_mips *c = ¤t_cpu_data;58575959- switch (c->cputype) {5858+ switch (current_cpu_type()) {6059 case CPU_34K:6160 /*6261 * Erratum "RPS May Cause Incorrect Instruction Execution"···123122 */124123static inline int __cpu_has_fpu(void)125124{126126- return ((cpu_get_fpu_id() & 0xff00) != FPIR_IMP_NONE);125125+ return ((cpu_get_fpu_id() & FPIR_IMP_MASK) != FPIR_IMP_NONE);127126}128127129128static inline void cpu_probe_vmbits(struct cpuinfo_mips *c)···291290 return config4 & MIPS_CONF_M;292291}293292293293+static inline unsigned int decode_config5(struct cpuinfo_mips *c)294294+{295295+ unsigned int config5;296296+297297+ config5 = read_c0_config5();298298+ config5 &= ~MIPS_CONF5_UFR;299299+ write_c0_config5(config5);300300+301301+ return config5 & MIPS_CONF_M;302302+}303303+294304static void decode_configs(struct cpuinfo_mips *c)295305{296306 int ok;···322310 ok = decode_config3(c);323311 if (ok)324312 ok = decode_config4(c);313313+ if (ok)314314+ ok = decode_config5(c);325315326316 mips_probe_watch_registers(c);327317···336322337323static inline void cpu_probe_legacy(struct cpuinfo_mips *c, unsigned int cpu)338324{339339- switch (c->processor_id & 0xff00) {325325+ switch (c->processor_id & PRID_IMP_MASK) {340326 case PRID_IMP_R2000:341327 c->cputype = CPU_R2000;342328 __cpu_name[cpu] = "R2000";···347333 c->tlbsize = 64;348334 break;349335 case PRID_IMP_R3000:350350- if ((c->processor_id & 0xff) == PRID_REV_R3000A) {336336+ if ((c->processor_id & PRID_REV_MASK) == PRID_REV_R3000A) {351337 if (cpu_has_confreg()) {352338 c->cputype = CPU_R3081E;353339 __cpu_name[cpu] = "R3081";···367353 break;368354 case PRID_IMP_R4000:369355 if (read_c0_config() & CONF_SC) {370370- if ((c->processor_id & 0xff) >= PRID_REV_R4400) {356356+ if ((c->processor_id & PRID_REV_MASK) >=357357+ PRID_REV_R4400) {371358 c->cputype = CPU_R4400PC;372359 __cpu_name[cpu] = "R4400PC";373360 } else {···376361 __cpu_name[cpu] = "R4000PC";377362 }378363 } else {379379- if ((c->processor_id & 0xff) >= PRID_REV_R4400) {364364+ if ((c->processor_id & PRID_REV_MASK) >=365365+ PRID_REV_R4400) {380366 c->cputype = CPU_R4400SC;381367 __cpu_name[cpu] = "R4400SC";382368 } else {···470454 __cpu_name[cpu] = "TX3927";471455 c->tlbsize = 64;472456 } else {473473- switch (c->processor_id & 0xff) {457457+ switch (c->processor_id & PRID_REV_MASK) {474458 case PRID_REV_TX3912:475459 c->cputype = CPU_TX3912;476460 __cpu_name[cpu] = "TX3912";···656640static inline void cpu_probe_mips(struct cpuinfo_mips *c, unsigned int cpu)657641{658642 decode_configs(c);659659- switch (c->processor_id & 0xff00) {643643+ switch (c->processor_id & PRID_IMP_MASK) {660644 case PRID_IMP_4KC:661645 c->cputype = CPU_4KC;662646 __cpu_name[cpu] = "MIPS 4Kc";···727711static inline void cpu_probe_alchemy(struct cpuinfo_mips *c, unsigned int cpu)728712{729713 decode_configs(c);730730- switch (c->processor_id & 0xff00) {714714+ switch (c->processor_id & PRID_IMP_MASK) {731715 case PRID_IMP_AU1_REV1:732716 case PRID_IMP_AU1_REV2:733717 c->cputype = CPU_ALCHEMY;···746730 break;747731 case 4:748732 __cpu_name[cpu] = "Au1200";749749- if ((c->processor_id & 0xff) == 2)733733+ if ((c->processor_id & PRID_REV_MASK) == 2)750734 __cpu_name[cpu] = "Au1250";751735 break;752736 case 5:···764748{765749 decode_configs(c);766750767767- switch (c->processor_id & 0xff00) {751751+ switch (c->processor_id & PRID_IMP_MASK) {768752 case PRID_IMP_SB1:769753 c->cputype = CPU_SB1;770754 __cpu_name[cpu] = "SiByte SB1";771755 /* FPU in pass1 is known to have issues. */772772- if ((c->processor_id & 0xff) < 0x02)756756+ if ((c->processor_id & PRID_REV_MASK) < 0x02)773757 c->options &= ~(MIPS_CPU_FPU | MIPS_CPU_32FPR);774758 break;775759 case PRID_IMP_SB1A:···782766static inline void cpu_probe_sandcraft(struct cpuinfo_mips *c, unsigned int cpu)783767{784768 decode_configs(c);785785- switch (c->processor_id & 0xff00) {769769+ switch (c->processor_id & PRID_IMP_MASK) {786770 case PRID_IMP_SR71000:787771 c->cputype = CPU_SR71000;788772 __cpu_name[cpu] = "Sandcraft SR71000";···795779static inline void cpu_probe_nxp(struct cpuinfo_mips *c, unsigned int cpu)796780{797781 decode_configs(c);798798- switch (c->processor_id & 0xff00) {782782+ switch (c->processor_id & PRID_IMP_MASK) {799783 case PRID_IMP_PR4450:800784 c->cputype = CPU_PR4450;801785 __cpu_name[cpu] = "Philips PR4450";···807791static inline void cpu_probe_broadcom(struct cpuinfo_mips *c, unsigned int cpu)808792{809793 decode_configs(c);810810- switch (c->processor_id & 0xff00) {794794+ switch (c->processor_id & PRID_IMP_MASK) {811795 case PRID_IMP_BMIPS32_REV4:812796 case PRID_IMP_BMIPS32_REV8:813797 c->cputype = CPU_BMIPS32;···822806 set_elf_platform(cpu, "bmips3300");823807 break;824808 case PRID_IMP_BMIPS43XX: {825825- int rev = c->processor_id & 0xff;809809+ int rev = c->processor_id & PRID_REV_MASK;826810827811 if (rev >= PRID_REV_BMIPS4380_LO &&828812 rev <= PRID_REV_BMIPS4380_HI) {···848832static inline void cpu_probe_cavium(struct cpuinfo_mips *c, unsigned int cpu)849833{850834 decode_configs(c);851851- switch (c->processor_id & 0xff00) {835835+ switch (c->processor_id & PRID_IMP_MASK) {852836 case PRID_IMP_CAVIUM_CN38XX:853837 case PRID_IMP_CAVIUM_CN31XX:854838 case PRID_IMP_CAVIUM_CN30XX:···891875 decode_configs(c);892876 /* JZRISC does not implement the CP0 counter. */893877 c->options &= ~MIPS_CPU_COUNTER;894894- switch (c->processor_id & 0xff00) {878878+ switch (c->processor_id & PRID_IMP_MASK) {895879 case PRID_IMP_JZRISC:896880 c->cputype = CPU_JZRISC;897881 __cpu_name[cpu] = "Ingenic JZRISC";···906890{907891 decode_configs(c);908892909909- if ((c->processor_id & 0xff00) == PRID_IMP_NETLOGIC_AU13XX) {893893+ if ((c->processor_id & PRID_IMP_MASK) == PRID_IMP_NETLOGIC_AU13XX) {910894 c->cputype = CPU_ALCHEMY;911895 __cpu_name[cpu] = "Au1300";912896 /* following stuff is not for Alchemy */···921905 MIPS_CPU_EJTAG |922906 MIPS_CPU_LLSC);923907924924- switch (c->processor_id & 0xff00) {908908+ switch (c->processor_id & PRID_IMP_MASK) {925909 case PRID_IMP_NETLOGIC_XLP2XX:926910 c->cputype = CPU_XLP;927911 __cpu_name[cpu] = "Broadcom XLPII";···1000984 c->cputype = CPU_UNKNOWN;10019851002986 c->processor_id = read_c0_prid();10031003- switch (c->processor_id & 0xff0000) {987987+ switch (c->processor_id & PRID_COMP_MASK) {1004988 case PRID_COMP_LEGACY:1005989 cpu_probe_legacy(c, cpu);1006990 break;
···1919#include <asm/bootinfo.h>2020#include <asm/cacheops.h>2121#include <asm/cpu-features.h>2222+#include <asm/cpu-type.h>2223#include <asm/page.h>2324#include <asm/pgtable.h>2425#include <asm/r4kcache.h>···187186 unsigned long dcache_size;188187 unsigned int config1;189188 struct cpuinfo_mips *c = ¤t_cpu_data;189189+ int cputype = current_cpu_type();190190191191 config1 = read_c0_config1();192192- switch (c->cputype) {192192+ switch (cputype) {193193 case CPU_CAVIUM_OCTEON:194194 case CPU_CAVIUM_OCTEON_PLUS:195195 c->icache.linesz = 2 << ((config1 >> 19) & 7);···201199 c->icache.sets * c->icache.ways * c->icache.linesz;202200 c->icache.waybit = ffs(icache_size / c->icache.ways) - 1;203201 c->dcache.linesz = 128;204204- if (c->cputype == CPU_CAVIUM_OCTEON_PLUS)202202+ if (cputype == CPU_CAVIUM_OCTEON_PLUS)205203 c->dcache.sets = 2; /* CN5XXX has two Dcache sets */206204 else207205 c->dcache.sets = 1; /* CN3XXX has one Dcache set */
+32-16
arch/mips/mm/c-r4k.c
···1212#include <linux/highmem.h>1313#include <linux/kernel.h>1414#include <linux/linkage.h>1515+#include <linux/preempt.h>1516#include <linux/sched.h>1617#include <linux/smp.h>1718#include <linux/mm.h>···2524#include <asm/cacheops.h>2625#include <asm/cpu.h>2726#include <asm/cpu-features.h>2727+#include <asm/cpu-type.h>2828#include <asm/io.h>2929#include <asm/page.h>3030#include <asm/pgtable.h>···603601 /* Catch bad driver code */604602 BUG_ON(size == 0);605603604604+ preempt_disable();606605 if (cpu_has_inclusive_pcaches) {607606 if (size >= scache_size)608607 r4k_blast_scache();···624621 R4600_HIT_CACHEOP_WAR_IMPL;625622 blast_dcache_range(addr, addr + size);626623 }624624+ preempt_enable();627625628626 bc_wback_inv(addr, size);629627 __sync();···635631 /* Catch bad driver code */636632 BUG_ON(size == 0);637633634634+ preempt_disable();638635 if (cpu_has_inclusive_pcaches) {639636 if (size >= scache_size)640637 r4k_blast_scache();···660655 R4600_HIT_CACHEOP_WAR_IMPL;661656 blast_inv_dcache_range(addr, addr + size);662657 }658658+ preempt_enable();663659664660 bc_inv(addr, size);665661 __sync();···786780787781static inline void alias_74k_erratum(struct cpuinfo_mips *c)788782{783783+ unsigned int imp = c->processor_id & PRID_IMP_MASK;784784+ unsigned int rev = c->processor_id & PRID_REV_MASK;785785+789786 /*790787 * Early versions of the 74K do not update the cache tags on a791788 * vtag miss/ptag hit which can occur in the case of KSEG0/KUSEG792789 * aliases. In this case it is better to treat the cache as always793790 * having aliases.794791 */795795- if ((c->processor_id & 0xff) <= PRID_REV_ENCODE_332(2, 4, 0))796796- c->dcache.flags |= MIPS_CACHE_VTAG;797797- if ((c->processor_id & 0xff) == PRID_REV_ENCODE_332(2, 4, 0))798798- write_c0_config6(read_c0_config6() | MIPS_CONF6_SYND);799799- if (((c->processor_id & 0xff00) == PRID_IMP_1074K) &&800800- ((c->processor_id & 0xff) <= PRID_REV_ENCODE_332(1, 1, 0))) {801801- c->dcache.flags |= MIPS_CACHE_VTAG;802802- write_c0_config6(read_c0_config6() | MIPS_CONF6_SYND);792792+ switch (imp) {793793+ case PRID_IMP_74K:794794+ if (rev <= PRID_REV_ENCODE_332(2, 4, 0))795795+ c->dcache.flags |= MIPS_CACHE_VTAG;796796+ if (rev == PRID_REV_ENCODE_332(2, 4, 0))797797+ write_c0_config6(read_c0_config6() | MIPS_CONF6_SYND);798798+ break;799799+ case PRID_IMP_1074K:800800+ if (rev <= PRID_REV_ENCODE_332(1, 1, 0)) {801801+ c->dcache.flags |= MIPS_CACHE_VTAG;802802+ write_c0_config6(read_c0_config6() | MIPS_CONF6_SYND);803803+ }804804+ break;805805+ default:806806+ BUG();803807 }804808}805809···825809 unsigned long config1;826810 unsigned int lsize;827811828828- switch (c->cputype) {812812+ switch (current_cpu_type()) {829813 case CPU_R4600: /* QED style two way caches? */830814 case CPU_R4700:831815 case CPU_R5000:···10411025 * presumably no vendor is shipping his hardware in the "bad"10421026 * configuration.10431027 */10441044- if ((prid & 0xff00) == PRID_IMP_R4000 && (prid & 0xff) < 0x40 &&10281028+ if ((prid & PRID_IMP_MASK) == PRID_IMP_R4000 &&10291029+ (prid & PRID_REV_MASK) < PRID_REV_R4400 &&10451030 !(config & CONF_SC) && c->icache.linesz != 16 &&10461031 PAGE_SIZE <= 0x8000)10471032 panic("Improper R4000SC processor configuration detected");···10621045 * normally they'd suffer from aliases but magic in the hardware deals10631046 * with that for us so we don't need to take care ourselves.10641047 */10651065- switch (c->cputype) {10481048+ switch (current_cpu_type()) {10661049 case CPU_20KC:10671050 case CPU_25KF:10681051 case CPU_SB1:···10821065 case CPU_34K:10831066 case CPU_74K:10841067 case CPU_1004K:10851085- if (c->cputype == CPU_74K)10681068+ if (current_cpu_type() == CPU_74K)10861069 alias_74k_erratum(c);10871070 if ((read_c0_config7() & (1 << 16))) {10881071 /* effectively physically indexed dcache,···10951078 c->dcache.flags |= MIPS_CACHE_ALIASES;10961079 }1097108010981098- switch (c->cputype) {10811081+ switch (current_cpu_type()) {10991082 case CPU_20KC:11001083 /*11011084 * Some older 20Kc chips doesn't have the 'VI' bit in···12241207 * processors don't have a S-cache that would be relevant to the12251208 * Linux memory management.12261209 */12271227- switch (c->cputype) {12101210+ switch (current_cpu_type()) {12281211 case CPU_R4000SC:12291212 case CPU_R4000MC:12301213 case CPU_R4400SC:···14011384{14021385 extern char __weak except_vec2_generic;14031386 extern char __weak except_vec2_sb1;14041404- struct cpuinfo_mips *c = ¤t_cpu_data;1405138714061406- switch (c->cputype) {13881388+ switch (current_cpu_type()) {14071389 case CPU_SB1:14081390 case CPU_SB1A:14091391 set_uncached_handler(0x100, &except_vec2_sb1, 0x80);
···66#include <linux/sched.h>77#include <linux/mm.h>8899+#include <asm/cpu-type.h>910#include <asm/mipsregs.h>1011#include <asm/bcache.h>1112#include <asm/cacheops.h>···7271 unsigned int tmp;73727473 /* Check the bypass bit (L2B) */7575- switch (c->cputype) {7474+ switch (current_cpu_type()) {7675 case CPU_34K:7776 case CPU_74K:7877 case CPU_1004K:
···2525#endif26262727#include <asm/bootinfo.h>2828+#include <asm/cpu.h>2829#include <asm/io.h>2930#include <asm/reboot.h>3031#include <asm/sni.h>···174173 system_type = "RM300-Cxx";175174 break;176175 case SNI_BRD_PCI_DESKTOP:177177- switch (read_c0_prid() & 0xff00) {176176+ switch (read_c0_prid() & PRID_IMP_MASK) {178177 case PRID_IMP_R4600:179178 case PRID_IMP_R4700:180179 system_type = "RM200-C20";
+1-1
arch/tile/Kconfig
···361361362362config VMALLOC_RESERVE363363 hex364364- default 0x1000000364364+ default 0x2000000365365366366config HARDWALL367367 bool "Hardwall support to allow access to user dynamic network"
+44-46
arch/tile/gxio/iorpc_mpipe.c
···2121 unsigned int flags;2222};23232424-int gxio_mpipe_alloc_buffer_stacks(gxio_mpipe_context_t * context,2424+int gxio_mpipe_alloc_buffer_stacks(gxio_mpipe_context_t *context,2525 unsigned int count, unsigned int first,2626 unsigned int flags)2727{···4545 unsigned int buffer_size_enum;4646};47474848-int gxio_mpipe_init_buffer_stack_aux(gxio_mpipe_context_t * context,4848+int gxio_mpipe_init_buffer_stack_aux(gxio_mpipe_context_t *context,4949 void *mem_va, size_t mem_size,5050 unsigned int mem_flags, unsigned int stack,5151 unsigned int buffer_size_enum)···8080 unsigned int flags;8181};82828383-int gxio_mpipe_alloc_notif_rings(gxio_mpipe_context_t * context,8383+int gxio_mpipe_alloc_notif_rings(gxio_mpipe_context_t *context,8484 unsigned int count, unsigned int first,8585 unsigned int flags)8686{···102102 unsigned int ring;103103};104104105105-int gxio_mpipe_init_notif_ring_aux(gxio_mpipe_context_t * context, void *mem_va,105105+int gxio_mpipe_init_notif_ring_aux(gxio_mpipe_context_t *context, void *mem_va,106106 size_t mem_size, unsigned int mem_flags,107107 unsigned int ring)108108{···133133 unsigned int ring;134134};135135136136-int gxio_mpipe_request_notif_ring_interrupt(gxio_mpipe_context_t * context,136136+int gxio_mpipe_request_notif_ring_interrupt(gxio_mpipe_context_t *context,137137 int inter_x, int inter_y,138138 int inter_ipi, int inter_event,139139 unsigned int ring)···158158 unsigned int ring;159159};160160161161-int gxio_mpipe_enable_notif_ring_interrupt(gxio_mpipe_context_t * context,161161+int gxio_mpipe_enable_notif_ring_interrupt(gxio_mpipe_context_t *context,162162 unsigned int ring)163163{164164 struct enable_notif_ring_interrupt_param temp;···179179 unsigned int flags;180180};181181182182-int gxio_mpipe_alloc_notif_groups(gxio_mpipe_context_t * context,182182+int gxio_mpipe_alloc_notif_groups(gxio_mpipe_context_t *context,183183 unsigned int count, unsigned int first,184184 unsigned int flags)185185{···201201 gxio_mpipe_notif_group_bits_t bits;202202};203203204204-int gxio_mpipe_init_notif_group(gxio_mpipe_context_t * context,204204+int gxio_mpipe_init_notif_group(gxio_mpipe_context_t *context,205205 unsigned int group,206206 gxio_mpipe_notif_group_bits_t bits)207207{···223223 unsigned int flags;224224};225225226226-int gxio_mpipe_alloc_buckets(gxio_mpipe_context_t * context, unsigned int count,226226+int gxio_mpipe_alloc_buckets(gxio_mpipe_context_t *context, unsigned int count,227227 unsigned int first, unsigned int flags)228228{229229 struct alloc_buckets_param temp;···244244 MPIPE_LBL_INIT_DAT_BSTS_TBL_t bucket_info;245245};246246247247-int gxio_mpipe_init_bucket(gxio_mpipe_context_t * context, unsigned int bucket,247247+int gxio_mpipe_init_bucket(gxio_mpipe_context_t *context, unsigned int bucket,248248 MPIPE_LBL_INIT_DAT_BSTS_TBL_t bucket_info)249249{250250 struct init_bucket_param temp;···265265 unsigned int flags;266266};267267268268-int gxio_mpipe_alloc_edma_rings(gxio_mpipe_context_t * context,268268+int gxio_mpipe_alloc_edma_rings(gxio_mpipe_context_t *context,269269 unsigned int count, unsigned int first,270270 unsigned int flags)271271{···288288 unsigned int channel;289289};290290291291-int gxio_mpipe_init_edma_ring_aux(gxio_mpipe_context_t * context, void *mem_va,291291+int gxio_mpipe_init_edma_ring_aux(gxio_mpipe_context_t *context, void *mem_va,292292 size_t mem_size, unsigned int mem_flags,293293 unsigned int ring, unsigned int channel)294294{···315315EXPORT_SYMBOL(gxio_mpipe_init_edma_ring_aux);316316317317318318-int gxio_mpipe_commit_rules(gxio_mpipe_context_t * context, const void *blob,318318+int gxio_mpipe_commit_rules(gxio_mpipe_context_t *context, const void *blob,319319 size_t blob_size)320320{321321 const void *params = blob;···332332 unsigned int flags;333333};334334335335-int gxio_mpipe_register_client_memory(gxio_mpipe_context_t * context,335335+int gxio_mpipe_register_client_memory(gxio_mpipe_context_t *context,336336 unsigned int iotlb, HV_PTE pte,337337 unsigned int flags)338338{···355355 unsigned int flags;356356};357357358358-int gxio_mpipe_link_open_aux(gxio_mpipe_context_t * context,358358+int gxio_mpipe_link_open_aux(gxio_mpipe_context_t *context,359359 _gxio_mpipe_link_name_t name, unsigned int flags)360360{361361 struct link_open_aux_param temp;···374374 int mac;375375};376376377377-int gxio_mpipe_link_close_aux(gxio_mpipe_context_t * context, int mac)377377+int gxio_mpipe_link_close_aux(gxio_mpipe_context_t *context, int mac)378378{379379 struct link_close_aux_param temp;380380 struct link_close_aux_param *params = &temp;···393393 int64_t val;394394};395395396396-int gxio_mpipe_link_set_attr_aux(gxio_mpipe_context_t * context, int mac,396396+int gxio_mpipe_link_set_attr_aux(gxio_mpipe_context_t *context, int mac,397397 uint32_t attr, int64_t val)398398{399399 struct link_set_attr_aux_param temp;···415415 uint64_t cycles;416416};417417418418-int gxio_mpipe_get_timestamp_aux(gxio_mpipe_context_t * context, uint64_t * sec,419419- uint64_t * nsec, uint64_t * cycles)418418+int gxio_mpipe_get_timestamp_aux(gxio_mpipe_context_t *context, uint64_t *sec,419419+ uint64_t *nsec, uint64_t *cycles)420420{421421 int __result;422422 struct get_timestamp_aux_param temp;···440440 uint64_t cycles;441441};442442443443-int gxio_mpipe_set_timestamp_aux(gxio_mpipe_context_t * context, uint64_t sec,443443+int gxio_mpipe_set_timestamp_aux(gxio_mpipe_context_t *context, uint64_t sec,444444 uint64_t nsec, uint64_t cycles)445445{446446 struct set_timestamp_aux_param temp;···460460 int64_t nsec;461461};462462463463-int gxio_mpipe_adjust_timestamp_aux(gxio_mpipe_context_t * context,464464- int64_t nsec)463463+int gxio_mpipe_adjust_timestamp_aux(gxio_mpipe_context_t *context, int64_t nsec)465464{466465 struct adjust_timestamp_aux_param temp;467466 struct adjust_timestamp_aux_param *params = &temp;···474475475476EXPORT_SYMBOL(gxio_mpipe_adjust_timestamp_aux);476477477477-struct adjust_timestamp_freq_param {478478- int32_t ppb;479479-};480480-481481-int gxio_mpipe_adjust_timestamp_freq(gxio_mpipe_context_t * context,482482- int32_t ppb)483483-{484484- struct adjust_timestamp_freq_param temp;485485- struct adjust_timestamp_freq_param *params = &temp;486486-487487- params->ppb = ppb;488488-489489- return hv_dev_pwrite(context->fd, 0, (HV_VirtAddr) params,490490- sizeof(*params),491491- GXIO_MPIPE_OP_ADJUST_TIMESTAMP_FREQ);492492-}493493-494494-EXPORT_SYMBOL(gxio_mpipe_adjust_timestamp_freq);495495-496478struct config_edma_ring_blks_param {497479 unsigned int ering;498480 unsigned int max_blks;···481501 unsigned int db;482502};483503484484-int gxio_mpipe_config_edma_ring_blks(gxio_mpipe_context_t * context,504504+int gxio_mpipe_config_edma_ring_blks(gxio_mpipe_context_t *context,485505 unsigned int ering, unsigned int max_blks,486506 unsigned int min_snf_blks, unsigned int db)487507{···500520501521EXPORT_SYMBOL(gxio_mpipe_config_edma_ring_blks);502522523523+struct adjust_timestamp_freq_param {524524+ int32_t ppb;525525+};526526+527527+int gxio_mpipe_adjust_timestamp_freq(gxio_mpipe_context_t *context, int32_t ppb)528528+{529529+ struct adjust_timestamp_freq_param temp;530530+ struct adjust_timestamp_freq_param *params = &temp;531531+532532+ params->ppb = ppb;533533+534534+ return hv_dev_pwrite(context->fd, 0, (HV_VirtAddr) params,535535+ sizeof(*params),536536+ GXIO_MPIPE_OP_ADJUST_TIMESTAMP_FREQ);537537+}538538+539539+EXPORT_SYMBOL(gxio_mpipe_adjust_timestamp_freq);540540+503541struct arm_pollfd_param {504542 union iorpc_pollfd pollfd;505543};506544507507-int gxio_mpipe_arm_pollfd(gxio_mpipe_context_t * context, int pollfd_cookie)545545+int gxio_mpipe_arm_pollfd(gxio_mpipe_context_t *context, int pollfd_cookie)508546{509547 struct arm_pollfd_param temp;510548 struct arm_pollfd_param *params = &temp;···539541 union iorpc_pollfd pollfd;540542};541543542542-int gxio_mpipe_close_pollfd(gxio_mpipe_context_t * context, int pollfd_cookie)544544+int gxio_mpipe_close_pollfd(gxio_mpipe_context_t *context, int pollfd_cookie)543545{544546 struct close_pollfd_param temp;545547 struct close_pollfd_param *params = &temp;···556558 HV_PTE base;557559};558560559559-int gxio_mpipe_get_mmio_base(gxio_mpipe_context_t * context, HV_PTE *base)561561+int gxio_mpipe_get_mmio_base(gxio_mpipe_context_t *context, HV_PTE *base)560562{561563 int __result;562564 struct get_mmio_base_param temp;···577579 unsigned long size;578580};579581580580-int gxio_mpipe_check_mmio_offset(gxio_mpipe_context_t * context,582582+int gxio_mpipe_check_mmio_offset(gxio_mpipe_context_t *context,581583 unsigned long offset, unsigned long size)582584{583585 struct check_mmio_offset_param temp;
+7-8
arch/tile/gxio/iorpc_mpipe_info.c
···1515/* This file is machine-generated; DO NOT EDIT! */1616#include "gxio/iorpc_mpipe_info.h"17171818-1918struct instance_aux_param {2019 _gxio_mpipe_link_name_t name;2120};22212323-int gxio_mpipe_info_instance_aux(gxio_mpipe_info_context_t * context,2222+int gxio_mpipe_info_instance_aux(gxio_mpipe_info_context_t *context,2423 _gxio_mpipe_link_name_t name)2524{2625 struct instance_aux_param temp;···3839 _gxio_mpipe_link_mac_t mac;3940};40414141-int gxio_mpipe_info_enumerate_aux(gxio_mpipe_info_context_t * context,4242+int gxio_mpipe_info_enumerate_aux(gxio_mpipe_info_context_t *context,4243 unsigned int idx,4343- _gxio_mpipe_link_name_t * name,4444- _gxio_mpipe_link_mac_t * mac)4444+ _gxio_mpipe_link_name_t *name,4545+ _gxio_mpipe_link_mac_t *mac)4546{4647 int __result;4748 struct enumerate_aux_param temp;···49505051 __result =5152 hv_dev_pread(context->fd, 0, (HV_VirtAddr) params, sizeof(*params),5252- (((uint64_t) idx << 32) |5353+ (((uint64_t)idx << 32) |5354 GXIO_MPIPE_INFO_OP_ENUMERATE_AUX));5455 *name = params->name;5556 *mac = params->mac;···6364 HV_PTE base;6465};65666666-int gxio_mpipe_info_get_mmio_base(gxio_mpipe_info_context_t * context,6767+int gxio_mpipe_info_get_mmio_base(gxio_mpipe_info_context_t *context,6768 HV_PTE *base)6869{6970 int __result;···8586 unsigned long size;8687};87888888-int gxio_mpipe_info_check_mmio_offset(gxio_mpipe_info_context_t * context,8989+int gxio_mpipe_info_check_mmio_offset(gxio_mpipe_info_context_t *context,8990 unsigned long offset, unsigned long size)9091{9192 struct check_mmio_offset_param temp;
+14-14
arch/tile/gxio/iorpc_trio.c
···2121 unsigned int flags;2222};23232424-int gxio_trio_alloc_asids(gxio_trio_context_t * context, unsigned int count,2424+int gxio_trio_alloc_asids(gxio_trio_context_t *context, unsigned int count,2525 unsigned int first, unsigned int flags)2626{2727 struct alloc_asids_param temp;···4444 unsigned int flags;4545};46464747-int gxio_trio_alloc_memory_maps(gxio_trio_context_t * context,4747+int gxio_trio_alloc_memory_maps(gxio_trio_context_t *context,4848 unsigned int count, unsigned int first,4949 unsigned int flags)5050{···6767 unsigned int flags;6868};69697070-int gxio_trio_alloc_scatter_queues(gxio_trio_context_t * context,7070+int gxio_trio_alloc_scatter_queues(gxio_trio_context_t *context,7171 unsigned int count, unsigned int first,7272 unsigned int flags)7373{···9191 unsigned int flags;9292};93939494-int gxio_trio_alloc_pio_regions(gxio_trio_context_t * context,9494+int gxio_trio_alloc_pio_regions(gxio_trio_context_t *context,9595 unsigned int count, unsigned int first,9696 unsigned int flags)9797{···115115 unsigned int flags;116116};117117118118-int gxio_trio_init_pio_region_aux(gxio_trio_context_t * context,118118+int gxio_trio_init_pio_region_aux(gxio_trio_context_t *context,119119 unsigned int pio_region, unsigned int mac,120120 uint32_t bus_address_hi, unsigned int flags)121121{···145145 unsigned int order_mode;146146};147147148148-int gxio_trio_init_memory_map_mmu_aux(gxio_trio_context_t * context,148148+int gxio_trio_init_memory_map_mmu_aux(gxio_trio_context_t *context,149149 unsigned int map, unsigned long va,150150 uint64_t size, unsigned int asid,151151 unsigned int mac, uint64_t bus_address,···175175 struct pcie_trio_ports_property trio_ports;176176};177177178178-int gxio_trio_get_port_property(gxio_trio_context_t * context,178178+int gxio_trio_get_port_property(gxio_trio_context_t *context,179179 struct pcie_trio_ports_property *trio_ports)180180{181181 int __result;···198198 unsigned int intx;199199};200200201201-int gxio_trio_config_legacy_intr(gxio_trio_context_t * context, int inter_x,201201+int gxio_trio_config_legacy_intr(gxio_trio_context_t *context, int inter_x,202202 int inter_y, int inter_ipi, int inter_event,203203 unsigned int mac, unsigned int intx)204204{···227227 unsigned int asid;228228};229229230230-int gxio_trio_config_msi_intr(gxio_trio_context_t * context, int inter_x,230230+int gxio_trio_config_msi_intr(gxio_trio_context_t *context, int inter_x,231231 int inter_y, int inter_ipi, int inter_event,232232 unsigned int mac, unsigned int mem_map,233233 uint64_t mem_map_base, uint64_t mem_map_limit,···259259 unsigned int mac;260260};261261262262-int gxio_trio_set_mps_mrs(gxio_trio_context_t * context, uint16_t mps,262262+int gxio_trio_set_mps_mrs(gxio_trio_context_t *context, uint16_t mps,263263 uint16_t mrs, unsigned int mac)264264{265265 struct set_mps_mrs_param temp;···279279 unsigned int mac;280280};281281282282-int gxio_trio_force_rc_link_up(gxio_trio_context_t * context, unsigned int mac)282282+int gxio_trio_force_rc_link_up(gxio_trio_context_t *context, unsigned int mac)283283{284284 struct force_rc_link_up_param temp;285285 struct force_rc_link_up_param *params = &temp;···296296 unsigned int mac;297297};298298299299-int gxio_trio_force_ep_link_up(gxio_trio_context_t * context, unsigned int mac)299299+int gxio_trio_force_ep_link_up(gxio_trio_context_t *context, unsigned int mac)300300{301301 struct force_ep_link_up_param temp;302302 struct force_ep_link_up_param *params = &temp;···313313 HV_PTE base;314314};315315316316-int gxio_trio_get_mmio_base(gxio_trio_context_t * context, HV_PTE *base)316316+int gxio_trio_get_mmio_base(gxio_trio_context_t *context, HV_PTE *base)317317{318318 int __result;319319 struct get_mmio_base_param temp;···334334 unsigned long size;335335};336336337337-int gxio_trio_check_mmio_offset(gxio_trio_context_t * context,337337+int gxio_trio_check_mmio_offset(gxio_trio_context_t *context,338338 unsigned long offset, unsigned long size)339339{340340 struct check_mmio_offset_param temp;
+4-4
arch/tile/gxio/iorpc_usb_host.c
···1919 union iorpc_interrupt interrupt;2020};21212222-int gxio_usb_host_cfg_interrupt(gxio_usb_host_context_t * context, int inter_x,2222+int gxio_usb_host_cfg_interrupt(gxio_usb_host_context_t *context, int inter_x,2323 int inter_y, int inter_ipi, int inter_event)2424{2525 struct cfg_interrupt_param temp;···4141 unsigned int flags;4242};43434444-int gxio_usb_host_register_client_memory(gxio_usb_host_context_t * context,4444+int gxio_usb_host_register_client_memory(gxio_usb_host_context_t *context,4545 HV_PTE pte, unsigned int flags)4646{4747 struct register_client_memory_param temp;···6161 HV_PTE base;6262};63636464-int gxio_usb_host_get_mmio_base(gxio_usb_host_context_t * context, HV_PTE *base)6464+int gxio_usb_host_get_mmio_base(gxio_usb_host_context_t *context, HV_PTE *base)6565{6666 int __result;6767 struct get_mmio_base_param temp;···8282 unsigned long size;8383};84848585-int gxio_usb_host_check_mmio_offset(gxio_usb_host_context_t * context,8585+int gxio_usb_host_check_mmio_offset(gxio_usb_host_context_t *context,8686 unsigned long offset, unsigned long size)8787{8888 struct check_mmio_offset_param temp;
···176176 */177177 uint_reg_t stack_idx : 5;178178 /* Reserved. */179179- uint_reg_t __reserved_2 : 5;179179+ uint_reg_t __reserved_2 : 3;180180+ /*181181+ * Instance ID. For devices that support automatic buffer return between182182+ * mPIPE instances, this field indicates the buffer owner. If the INST183183+ * field does not match the mPIPE's instance number when a packet is184184+ * egressed, buffers with HWB set will be returned to the other mPIPE185185+ * instance. Note that not all devices support multi-mPIPE buffer186186+ * return. The MPIPE_EDMA_INFO.REMOTE_BUFF_RTN_SUPPORT bit indicates187187+ * whether the INST field in the buffer descriptor is populated by iDMA188188+ * hardware. This field is ignored on writes.189189+ */190190+ uint_reg_t inst : 2;180191 /*181192 * Reads as one to indicate that this is a hardware managed buffer.182193 * Ignored on writes since all buffers on a given stack are the same size.···216205 uint_reg_t c : 2;217206 uint_reg_t size : 3;218207 uint_reg_t hwb : 1;219219- uint_reg_t __reserved_2 : 5;208208+ uint_reg_t inst : 2;209209+ uint_reg_t __reserved_2 : 3;220210 uint_reg_t stack_idx : 5;221211 uint_reg_t __reserved_1 : 6;222212 int_reg_t va : 35;···243231 /* Reserved. */244232 uint_reg_t __reserved_0 : 3;245233 /* eDMA ring being accessed */246246- uint_reg_t ring : 5;234234+ uint_reg_t ring : 6;247235 /* Reserved. */248248- uint_reg_t __reserved_1 : 18;236236+ uint_reg_t __reserved_1 : 17;249237 /*250238 * This field of the address selects the region (address space) to be251239 * accessed. For the egress DMA post region, this field must be 5.···262250 uint_reg_t svc_dom : 5;263251 uint_reg_t __reserved_2 : 6;264252 uint_reg_t region : 3;265265- uint_reg_t __reserved_1 : 18;266266- uint_reg_t ring : 5;253253+ uint_reg_t __reserved_1 : 17;254254+ uint_reg_t ring : 6;267255 uint_reg_t __reserved_0 : 3;268256#endif269257 };
···4444 * descriptors toggles each time the ring tail pointer wraps.4545 */4646 uint_reg_t gen : 1;4747+ /**4848+ * For devices with EDMA reorder support, this field allows the4949+ * descriptor to select the egress FIFO. The associated DMA ring must5050+ * have ALLOW_EFIFO_SEL enabled.5151+ */5252+ uint_reg_t efifo_sel : 6;4753 /** Reserved. Must be zero. */4848- uint_reg_t r0 : 7;5454+ uint_reg_t r0 : 1;4955 /** Checksum generation enabled for this transfer. */5056 uint_reg_t csum : 1;5157 /**···116110 uint_reg_t notif : 1;117111 uint_reg_t ns : 1;118112 uint_reg_t csum : 1;119119- uint_reg_t r0 : 7;113113+ uint_reg_t r0 : 1;114114+ uint_reg_t efifo_sel : 6;120115 uint_reg_t gen : 1;121116#endif122117···133126 /** Reserved. */134127 uint_reg_t __reserved_1 : 3;135128 /**136136- * Instance ID. For devices that support more than one mPIPE instance,137137- * this field indicates the buffer owner. If the INST field does not138138- * match the mPIPE's instance number when a packet is egressed, buffers139139- * with HWB set will be returned to the other mPIPE instance.129129+ * Instance ID. For devices that support automatic buffer return between130130+ * mPIPE instances, this field indicates the buffer owner. If the INST131131+ * field does not match the mPIPE's instance number when a packet is132132+ * egressed, buffers with HWB set will be returned to the other mPIPE133133+ * instance. Note that not all devices support multi-mPIPE buffer134134+ * return. The MPIPE_EDMA_INFO.REMOTE_BUFF_RTN_SUPPORT bit indicates135135+ * whether the INST field in the buffer descriptor is populated by iDMA136136+ * hardware.140137 */141141- uint_reg_t inst : 1;142142- /** Reserved. */143143- uint_reg_t __reserved_2 : 1;138138+ uint_reg_t inst : 2;144139 /**145140 * Always set to one by hardware in iDMA packet descriptors. For eDMA,146141 * indicates whether the buffer will be released to the buffer stack···175166 uint_reg_t c : 2;176167 uint_reg_t size : 3;177168 uint_reg_t hwb : 1;178178- uint_reg_t __reserved_2 : 1;179179- uint_reg_t inst : 1;169169+ uint_reg_t inst : 2;180170 uint_reg_t __reserved_1 : 3;181171 uint_reg_t stack_idx : 5;182172 uint_reg_t __reserved_0 : 6;···416408 /**417409 * Sequence number applied when packet is distributed. Classifier418410 * selects which sequence number is to be applied by writing the 13-bit419419- * SQN-selector into this field.411411+ * SQN-selector into this field. For devices that support EXT_SQN (as412412+ * indicated in IDMA_INFO.EXT_SQN_SUPPORT), the GP_SQN can be extended to413413+ * 32-bits via the IDMA_CTL.EXT_SQN register. In this case the414414+ * PACKET_SQN will be reduced to 32 bits.420415 */421416 uint_reg_t gp_sqn : 16;422417 /**···462451 /** Reserved. */463452 uint_reg_t __reserved_5 : 3;464453 /**465465- * Instance ID. For devices that support more than one mPIPE instance,466466- * this field indicates the buffer owner. If the INST field does not467467- * match the mPIPE's instance number when a packet is egressed, buffers468468- * with HWB set will be returned to the other mPIPE instance.454454+ * Instance ID. For devices that support automatic buffer return between455455+ * mPIPE instances, this field indicates the buffer owner. If the INST456456+ * field does not match the mPIPE's instance number when a packet is457457+ * egressed, buffers with HWB set will be returned to the other mPIPE458458+ * instance. Note that not all devices support multi-mPIPE buffer459459+ * return. The MPIPE_EDMA_INFO.REMOTE_BUFF_RTN_SUPPORT bit indicates460460+ * whether the INST field in the buffer descriptor is populated by iDMA461461+ * hardware.469462 */470470- uint_reg_t inst : 1;471471- /** Reserved. */472472- uint_reg_t __reserved_6 : 1;463463+ uint_reg_t inst : 2;473464 /**474465 * Always set to one by hardware in iDMA packet descriptors. For eDMA,475466 * indicates whether the buffer will be released to the buffer stack···504491 uint_reg_t c : 2;505492 uint_reg_t size : 3;506493 uint_reg_t hwb : 1;507507- uint_reg_t __reserved_6 : 1;508508- uint_reg_t inst : 1;494494+ uint_reg_t inst : 2;509495 uint_reg_t __reserved_5 : 3;510496 uint_reg_t stack_idx : 5;511497 uint_reg_t __reserved_4 : 6;
···4646#define GXIO_TRIO_OP_GET_MMIO_BASE IORPC_OPCODE(IORPC_FORMAT_NONE_NOUSER, 0x8000)4747#define GXIO_TRIO_OP_CHECK_MMIO_OFFSET IORPC_OPCODE(IORPC_FORMAT_NONE_NOUSER, 0x8001)48484949-int gxio_trio_alloc_asids(gxio_trio_context_t * context, unsigned int count,4949+int gxio_trio_alloc_asids(gxio_trio_context_t *context, unsigned int count,5050 unsigned int first, unsigned int flags);515152525353-int gxio_trio_alloc_memory_maps(gxio_trio_context_t * context,5353+int gxio_trio_alloc_memory_maps(gxio_trio_context_t *context,5454 unsigned int count, unsigned int first,5555 unsigned int flags);565657575858-int gxio_trio_alloc_scatter_queues(gxio_trio_context_t * context,5858+int gxio_trio_alloc_scatter_queues(gxio_trio_context_t *context,5959 unsigned int count, unsigned int first,6060 unsigned int flags);61616262-int gxio_trio_alloc_pio_regions(gxio_trio_context_t * context,6262+int gxio_trio_alloc_pio_regions(gxio_trio_context_t *context,6363 unsigned int count, unsigned int first,6464 unsigned int flags);65656666-int gxio_trio_init_pio_region_aux(gxio_trio_context_t * context,6666+int gxio_trio_init_pio_region_aux(gxio_trio_context_t *context,6767 unsigned int pio_region, unsigned int mac,6868 uint32_t bus_address_hi, unsigned int flags);696970707171-int gxio_trio_init_memory_map_mmu_aux(gxio_trio_context_t * context,7171+int gxio_trio_init_memory_map_mmu_aux(gxio_trio_context_t *context,7272 unsigned int map, unsigned long va,7373 uint64_t size, unsigned int asid,7474 unsigned int mac, uint64_t bus_address,7575 unsigned int node,7676 unsigned int order_mode);77777878-int gxio_trio_get_port_property(gxio_trio_context_t * context,7878+int gxio_trio_get_port_property(gxio_trio_context_t *context,7979 struct pcie_trio_ports_property *trio_ports);80808181-int gxio_trio_config_legacy_intr(gxio_trio_context_t * context, int inter_x,8181+int gxio_trio_config_legacy_intr(gxio_trio_context_t *context, int inter_x,8282 int inter_y, int inter_ipi, int inter_event,8383 unsigned int mac, unsigned int intx);84848585-int gxio_trio_config_msi_intr(gxio_trio_context_t * context, int inter_x,8585+int gxio_trio_config_msi_intr(gxio_trio_context_t *context, int inter_x,8686 int inter_y, int inter_ipi, int inter_event,8787 unsigned int mac, unsigned int mem_map,8888 uint64_t mem_map_base, uint64_t mem_map_limit,8989 unsigned int asid);909091919292-int gxio_trio_set_mps_mrs(gxio_trio_context_t * context, uint16_t mps,9292+int gxio_trio_set_mps_mrs(gxio_trio_context_t *context, uint16_t mps,9393 uint16_t mrs, unsigned int mac);94949595-int gxio_trio_force_rc_link_up(gxio_trio_context_t * context, unsigned int mac);9595+int gxio_trio_force_rc_link_up(gxio_trio_context_t *context, unsigned int mac);96969797-int gxio_trio_force_ep_link_up(gxio_trio_context_t * context, unsigned int mac);9797+int gxio_trio_force_ep_link_up(gxio_trio_context_t *context, unsigned int mac);98989999-int gxio_trio_get_mmio_base(gxio_trio_context_t * context, HV_PTE *base);9999+int gxio_trio_get_mmio_base(gxio_trio_context_t *context, HV_PTE *base);100100101101-int gxio_trio_check_mmio_offset(gxio_trio_context_t * context,101101+int gxio_trio_check_mmio_offset(gxio_trio_context_t *context,102102 unsigned long offset, unsigned long size);103103104104#endif /* !__GXIO_TRIO_LINUX_RPC_H__ */
+4-4
arch/tile/include/gxio/iorpc_usb_host.h
···3131#define GXIO_USB_HOST_OP_GET_MMIO_BASE IORPC_OPCODE(IORPC_FORMAT_NONE_NOUSER, 0x8000)3232#define GXIO_USB_HOST_OP_CHECK_MMIO_OFFSET IORPC_OPCODE(IORPC_FORMAT_NONE_NOUSER, 0x8001)33333434-int gxio_usb_host_cfg_interrupt(gxio_usb_host_context_t * context, int inter_x,3434+int gxio_usb_host_cfg_interrupt(gxio_usb_host_context_t *context, int inter_x,3535 int inter_y, int inter_ipi, int inter_event);36363737-int gxio_usb_host_register_client_memory(gxio_usb_host_context_t * context,3737+int gxio_usb_host_register_client_memory(gxio_usb_host_context_t *context,3838 HV_PTE pte, unsigned int flags);39394040-int gxio_usb_host_get_mmio_base(gxio_usb_host_context_t * context,4040+int gxio_usb_host_get_mmio_base(gxio_usb_host_context_t *context,4141 HV_PTE *base);42424343-int gxio_usb_host_check_mmio_offset(gxio_usb_host_context_t * context,4343+int gxio_usb_host_check_mmio_offset(gxio_usb_host_context_t *context,4444 unsigned long offset, unsigned long size);45454646#endif /* !__GXIO_USB_HOST_LINUX_RPC_H__ */
+4-4
arch/tile/include/gxio/usb_host.h
···5353 * @return Zero if the context was successfully initialized, else a5454 * GXIO_ERR_xxx error code.5555 */5656-extern int gxio_usb_host_init(gxio_usb_host_context_t * context, int usb_index,5656+extern int gxio_usb_host_init(gxio_usb_host_context_t *context, int usb_index,5757 int is_ehci);58585959/* Destroy a USB context.···6868 * @return Zero if the context was successfully destroyed, else a6969 * GXIO_ERR_xxx error code.7070 */7171-extern int gxio_usb_host_destroy(gxio_usb_host_context_t * context);7171+extern int gxio_usb_host_destroy(gxio_usb_host_context_t *context);72727373/* Retrieve the address of the shim's MMIO registers.7474 *7575 * @param context Pointer to a properly initialized gxio_usb_host_context_t.7676 * @return The address of the shim's MMIO registers.7777 */7878-extern void *gxio_usb_host_get_reg_start(gxio_usb_host_context_t * context);7878+extern void *gxio_usb_host_get_reg_start(gxio_usb_host_context_t *context);79798080/* Retrieve the length of the shim's MMIO registers.8181 *8282 * @param context Pointer to a properly initialized gxio_usb_host_context_t.8383 * @return The length of the shim's MMIO registers.8484 */8585-extern size_t gxio_usb_host_get_reg_len(gxio_usb_host_context_t * context);8585+extern size_t gxio_usb_host_get_reg_len(gxio_usb_host_context_t *context);86868787#endif /* _GXIO_USB_H_ */
+1-1
arch/tile/kernel/compat.c
···8484{8585 return sys_llseek(fd, offset_high, offset_low, result, origin);8686}8787-8787+8888/* Provide the compat syscall number to call mapping. */8989#undef __SYSCALL9090#define __SYSCALL(nr, call) [nr] = (call),
-55
arch/tile/kernel/futex_64.S
···11-/*22- * Copyright 2011 Tilera Corporation. All Rights Reserved.33- *44- * This program is free software; you can redistribute it and/or55- * modify it under the terms of the GNU General Public License66- * as published by the Free Software Foundation, version 2.77- *88- * This program is distributed in the hope that it will be useful, but99- * WITHOUT ANY WARRANTY; without even the implied warranty of1010- * MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE, GOOD TITLE or1111- * NON INFRINGEMENT. See the GNU General Public License for1212- * more details.1313- *1414- * Atomically access user memory, but use MMU to avoid propagating1515- * kernel exceptions.1616- */1717-1818-#include <linux/linkage.h>1919-#include <asm/errno.h>2020-#include <asm/futex.h>2121-#include <asm/page.h>2222-#include <asm/processor.h>2323-2424-/*2525- * Provide a set of atomic memory operations supporting <asm/futex.h>.2626- *2727- * r0: user address to manipulate2828- * r1: new value to write, or for cmpxchg, old value to compare against2929- * r2: (cmpxchg only) new value to write3030- *3131- * Return __get_user struct, r0 with value, r1 with error.3232- */3333-#define FUTEX_OP(name, ...) \3434-STD_ENTRY(futex_##name) \3535- __VA_ARGS__; \3636- { \3737- move r1, zero; \3838- jrp lr \3939- }; \4040- STD_ENDPROC(futex_##name); \4141- .pushsection __ex_table,"a"; \4242- .quad 1b, get_user_fault; \4343- .popsection4444-4545- .pushsection .fixup,"ax"4646-get_user_fault:4747- { movei r1, -EFAULT; jrp lr }4848- ENDPROC(get_user_fault)4949- .popsection5050-5151-FUTEX_OP(cmpxchg, mtspr CMPEXCH_VALUE, r1; 1: cmpexch4 r0, r0, r2)5252-FUTEX_OP(set, 1: exch4 r0, r0, r1)5353-FUTEX_OP(add, 1: fetchadd4 r0, r0, r1)5454-FUTEX_OP(or, 1: fetchor4 r0, r0, r1)5555-FUTEX_OP(andn, nor r1, r1, zero; 1: fetchand4 r0, r0, r1)
+1-2
arch/tile/kernel/setup.c
···12681268 if ((long)VMALLOC_START >= 0)12691269 early_panic(12701270 "Linux VMALLOC region below the 2GB line (%#lx)!\n"12711271- "Reconfigure the kernel with fewer NR_HUGE_VMAPS\n"12721272- "or smaller VMALLOC_RESERVE.\n",12711271+ "Reconfigure the kernel with smaller VMALLOC_RESERVE.\n",12731272 VMALLOC_START);12741273#endif12751274}
+2-2
arch/tile/kernel/unaligned.c
···551551/*552552 * This function generates unalign fixup JIT.553553 *554554- * We fist find unalign load/store instruction's destination, source555555- * reguisters: ra, rb and rd. and 3 scratch registers by calling554554+ * We first find unalign load/store instruction's destination, source555555+ * registers: ra, rb and rd. and 3 scratch registers by calling556556 * find_regs(...). 3 scratch clobbers should not alias with any register557557 * used in the fault bundle. Then analyze the fault bundle to determine558558 * if it's a load or store, operand width, branch or address increment etc.
-2
arch/tile/mm/fault.c
···149149 pmd_k = vmalloc_sync_one(pgd, address);150150 if (!pmd_k)151151 return -1;152152- if (pmd_huge(*pmd_k))153153- return 0; /* support TILE huge_vmap() API */154152 pte_k = pte_offset_kernel(pmd_k, address);155153 if (!pte_present(*pte_k))156154 return -1;
···127127 }128128129129 /* Shatter the huge page into the preallocated L2 page table. */130130- pmd_populate_kernel(&init_mm, pmd,131131- get_prealloc_pte(pte_pfn(*(pte_t *)pmd)));130130+ pmd_populate_kernel(&init_mm, pmd, get_prealloc_pte(pmd_pfn(*pmd)));132131133132#ifdef __PAGETABLE_PMD_FOLDED134133 /* Walk every pgd on the system and update the pmd there. */
+3-2
arch/x86/Kconfig
···481481 bool "Intel Low Power Subsystem Support"482482 depends on ACPI483483 select COMMON_CLK484484+ select PINCTRL484485 ---help---485486 Select to build support for Intel Low Power Subsystem such as486487 found on Intel Lynxpoint PCH. Selecting this option enables487487- things like clock tree (common clock framework) which are needed488488- by the LPSS peripheral drivers.488488+ things like clock tree (common clock framework) and pincontrol489489+ which are needed by the LPSS peripheral drivers.489490490491config X86_RDC321X491492 bool "RDC R-321x SoC"
···653653{654654 static int current_node = -1;655655 int node = early_cpu_to_node(cpu);656656+ int max_cpu_present = find_last_bit(cpumask_bits(cpu_present_mask), NR_CPUS);656657657658 if (system_state == SYSTEM_BOOTING) {658659 if (node != current_node) {···662661 current_node = node;663662 pr_info("Booting Node %3d, Processors ", node);664663 }665665- pr_cont(" #%d%s", cpu, cpu == (nr_cpu_ids - 1) ? " OK\n" : "");664664+ pr_cont(" #%4d%s", cpu, cpu == max_cpu_present ? " OK\n" : "");666665 return;667666 } else668667 pr_info("Booting Node %d Processor %d APIC 0x%x\n",
+13-1
arch/x86/kvm/emulate.c
···20252025 return rc;20262026}2027202720282028+static int em_ret_far_imm(struct x86_emulate_ctxt *ctxt)20292029+{20302030+ int rc;20312031+20322032+ rc = em_ret_far(ctxt);20332033+ if (rc != X86EMUL_CONTINUE)20342034+ return rc;20352035+ rsp_increment(ctxt, ctxt->src.val);20362036+ return X86EMUL_CONTINUE;20372037+}20382038+20282039static int em_cmpxchg(struct x86_emulate_ctxt *ctxt)20292040{20302041 /* Save real source value, then compare EAX against destination. */···37743763 G(ByteOp, group11), G(0, group11),37753764 /* 0xC8 - 0xCF */37763765 I(Stack | SrcImmU16 | Src2ImmByte, em_enter), I(Stack, em_leave),37773777- N, I(ImplicitOps | Stack, em_ret_far),37663766+ I(ImplicitOps | Stack | SrcImmU16, em_ret_far_imm),37673767+ I(ImplicitOps | Stack, em_ret_far),37783768 D(ImplicitOps), DI(SrcImmByte, intn),37793769 D(ImplicitOps | No64), II(ImplicitOps, em_iret, iret),37803770 /* 0xD0 - 0xD7 */
+19-1
arch/x86/kvm/paging_tmpl.h
···9999 pt_element_t prefetch_ptes[PTE_PREFETCH_NUM];100100 gpa_t pte_gpa[PT_MAX_FULL_LEVELS];101101 pt_element_t __user *ptep_user[PT_MAX_FULL_LEVELS];102102+ bool pte_writable[PT_MAX_FULL_LEVELS];102103 unsigned pt_access;103104 unsigned pte_access;104105 gfn_t gfn;···236235 if (pte == orig_pte)237236 continue;238237238238+ /*239239+ * If the slot is read-only, simply do not process the accessed240240+ * and dirty bits. This is the correct thing to do if the slot241241+ * is ROM, and page tables in read-as-ROM/write-as-MMIO slots242242+ * are only supported if the accessed and dirty bits are already243243+ * set in the ROM (so that MMIO writes are never needed).244244+ *245245+ * Note that NPT does not allow this at all and faults, since246246+ * it always wants nested page table entries for the guest247247+ * page tables to be writable. And EPT works but will simply248248+ * overwrite the read-only memory to set the accessed and dirty249249+ * bits.250250+ */251251+ if (unlikely(!walker->pte_writable[level - 1]))252252+ continue;253253+239254 ret = FNAME(cmpxchg_gpte)(vcpu, mmu, ptep_user, index, orig_pte, pte);240255 if (ret)241256 return ret;···326309 goto error;327310 real_gfn = gpa_to_gfn(real_gfn);328311329329- host_addr = gfn_to_hva(vcpu->kvm, real_gfn);312312+ host_addr = gfn_to_hva_prot(vcpu->kvm, real_gfn,313313+ &walker->pte_writable[walker->level - 1]);330314 if (unlikely(kvm_is_error_hva(host_addr)))331315 goto error;332316
+13
arch/x86/kvm/vmx.c
···53395339 return 0;53405340 }5341534153425342+ /*53435343+ * EPT violation happened while executing iret from NMI,53445344+ * "blocked by NMI" bit has to be set before next VM entry.53455345+ * There are errata that may cause this bit to not be set:53465346+ * AAK134, BY25.53475347+ */53485348+ if (exit_qualification & INTR_INFO_UNBLOCK_NMI)53495349+ vmcs_set_bits(GUEST_INTERRUPTIBILITY_INFO, GUEST_INTR_STATE_NMI);53505350+53425351 gpa = vmcs_read64(GUEST_PHYSICAL_ADDRESS);53435352 trace_kvm_page_fault(gpa, exit_qualification);53445353···77757766 vmcs_write64(GUEST_PDPTR1, vmcs12->guest_pdptr1);77767767 vmcs_write64(GUEST_PDPTR2, vmcs12->guest_pdptr2);77777768 vmcs_write64(GUEST_PDPTR3, vmcs12->guest_pdptr3);77697769+ __clear_bit(VCPU_EXREG_PDPTR,77707770+ (unsigned long *)&vcpu->arch.regs_avail);77717771+ __clear_bit(VCPU_EXREG_PDPTR,77727772+ (unsigned long *)&vcpu->arch.regs_dirty);77787773 }7779777477807775 kvm_register_write(vcpu, VCPU_REGS_RSP, vmcs12->guest_rsp);
+15-10
block/blk-cgroup.c
···235235 blkg->online = true;236236 spin_unlock(&blkcg->lock);237237238238- if (!ret)238238+ if (!ret) {239239+ if (blkcg == &blkcg_root) {240240+ q->root_blkg = blkg;241241+ q->root_rl.blkg = blkg;242242+ }239243 return blkg;244244+ }240245241246 /* @blkg failed fully initialized, use the usual release path */242247 blkg_put(blkg);···340335 rcu_assign_pointer(blkcg->blkg_hint, NULL);341336342337 /*338338+ * If root blkg is destroyed. Just clear the pointer since root_rl339339+ * does not take reference on root blkg.340340+ */341341+ if (blkcg == &blkcg_root) {342342+ blkg->q->root_blkg = NULL;343343+ blkg->q->root_rl.blkg = NULL;344344+ }345345+346346+ /*343347 * Put the reference taken at the time of creation so that when all344348 * queues are gone, group can be destroyed.345349 */···374360 blkg_destroy(blkg);375361 spin_unlock(&blkcg->lock);376362 }377377-378378- /*379379- * root blkg is destroyed. Just clear the pointer since380380- * root_rl does not take reference on root blkg.381381- */382382- q->root_blkg = NULL;383383- q->root_rl.blkg = NULL;384363}385364386365/*···977970 ret = PTR_ERR(blkg);978971 goto out_unlock;979972 }980980- q->root_blkg = blkg;981981- q->root_rl.blkg = blkg;982973983974 list_for_each_entry(blkg, &q->blkg_list, q_node)984975 cnt++;
+2-4
block/blk-core.c
···15491549 if (plug) {15501550 /*15511551 * If this is the first request added after a plug, fire15521552- * of a plug trace. If others have been added before, check15531553- * if we have multiple devices in this plug. If so, make a15541554- * note to sort the list before dispatch.15521552+ * of a plug trace.15551553 */15561556- if (list_empty(&plug->list))15541554+ if (!request_count)15571555 trace_block_plug(q);15581556 else {15591557 if (request_count >= BLK_MAX_REQUEST_COUNT) {
···778778 return error;779779 }780780781781- if (mac[i] == NULL || mac_pton(mac[i], card->atmdev->esi)) {781781+ if (mac[i] == NULL || !mac_pton(mac[i], card->atmdev->esi)) {782782 nicstar_read_eprom(card->membase, NICSTAR_EPROM_MAC_ADDR_OFFSET,783783 card->atmdev->esi, 6);784784 if (memcmp(card->atmdev->esi, "\x00\x00\x00\x00\x00\x00", 6) ==
+7-5
drivers/bcma/scan.c
···269269 return NULL;270270}271271272272+#define IS_ERR_VALUE_U32(x) ((x) >= (u32)-MAX_ERRNO)273273+272274static int bcma_get_next_core(struct bcma_bus *bus, u32 __iomem **eromptr,273275 struct bcma_device_id *match, int core_num,274276 struct bcma_device *core)···353351 * the main register space for the core354352 */355353 tmp = bcma_erom_get_addr_desc(bus, eromptr, SCAN_ADDR_TYPE_SLAVE, 0);356356- if (tmp == 0 || IS_ERR_VALUE(tmp)) {354354+ if (tmp == 0 || IS_ERR_VALUE_U32(tmp)) {357355 /* Try again to see if it is a bridge */358356 tmp = bcma_erom_get_addr_desc(bus, eromptr,359357 SCAN_ADDR_TYPE_BRIDGE, 0);360360- if (tmp == 0 || IS_ERR_VALUE(tmp)) {358358+ if (tmp == 0 || IS_ERR_VALUE_U32(tmp)) {361359 return -EILSEQ;362360 } else {363361 bcma_info(bus, "Bridge found\n");···371369 for (j = 0; ; j++) {372370 tmp = bcma_erom_get_addr_desc(bus, eromptr,373371 SCAN_ADDR_TYPE_SLAVE, i);374374- if (IS_ERR_VALUE(tmp)) {372372+ if (IS_ERR_VALUE_U32(tmp)) {375373 /* no more entries for port _i_ */376374 /* pr_debug("erom: slave port %d "377375 * "has %d descriptors\n", i, j); */···388386 for (j = 0; ; j++) {389387 tmp = bcma_erom_get_addr_desc(bus, eromptr,390388 SCAN_ADDR_TYPE_MWRAP, i);391391- if (IS_ERR_VALUE(tmp)) {389389+ if (IS_ERR_VALUE_U32(tmp)) {392390 /* no more entries for port _i_ */393391 /* pr_debug("erom: master wrapper %d "394392 * "has %d descriptors\n", i, j); */···406404 for (j = 0; ; j++) {407405 tmp = bcma_erom_get_addr_desc(bus, eromptr,408406 SCAN_ADDR_TYPE_SWRAP, i + hack);409409- if (IS_ERR_VALUE(tmp)) {407407+ if (IS_ERR_VALUE_U32(tmp)) {410408 /* no more entries for port _i_ */411409 /* pr_debug("erom: master wrapper %d "412410 * has %d descriptors\n", i, j); */
+59-18
drivers/block/rbd.c
···931931 u64 snap_id)932932{933933 u32 which;934934+ const char *snap_name;934935935936 which = rbd_dev_snap_index(rbd_dev, snap_id);936937 if (which == BAD_SNAP_INDEX)937937- return NULL;938938+ return ERR_PTR(-ENOENT);938939939939- return _rbd_dev_v1_snap_name(rbd_dev, which);940940+ snap_name = _rbd_dev_v1_snap_name(rbd_dev, which);941941+ return snap_name ? snap_name : ERR_PTR(-ENOMEM);940942}941943942944static const char *rbd_snap_name(struct rbd_device *rbd_dev, u64 snap_id)···28142812 obj_request_done_set(obj_request);28152813}2816281428172817-static int rbd_obj_notify_ack(struct rbd_device *rbd_dev, u64 notify_id)28152815+static int rbd_obj_notify_ack_sync(struct rbd_device *rbd_dev, u64 notify_id)28182816{28192817 struct rbd_obj_request *obj_request;28202818 struct ceph_osd_client *osdc = &rbd_dev->rbd_client->client->osdc;···28292827 obj_request->osd_req = rbd_osd_req_create(rbd_dev, false, obj_request);28302828 if (!obj_request->osd_req)28312829 goto out;28322832- obj_request->callback = rbd_obj_request_put;2833283028342831 osd_req_op_watch_init(obj_request->osd_req, 0, CEPH_OSD_OP_NOTIFY_ACK,28352832 notify_id, 0, 0);28362833 rbd_osd_req_format_read(obj_request);2837283428382835 ret = rbd_obj_request_submit(osdc, obj_request);28392839-out:28402836 if (ret)28412841- rbd_obj_request_put(obj_request);28372837+ goto out;28382838+ ret = rbd_obj_request_wait(obj_request);28392839+out:28402840+ rbd_obj_request_put(obj_request);2842284128432842 return ret;28442843}···28592856 if (ret)28602857 rbd_warn(rbd_dev, "header refresh error (%d)\n", ret);2861285828622862- rbd_obj_notify_ack(rbd_dev, notify_id);28592859+ rbd_obj_notify_ack_sync(rbd_dev, notify_id);28632860}2864286128652862/*···33313328 clear_bit(RBD_DEV_FLAG_EXISTS, &rbd_dev->flags);33323329}3333333033313331+static void rbd_dev_update_size(struct rbd_device *rbd_dev)33323332+{33333333+ sector_t size;33343334+ bool removing;33353335+33363336+ /*33373337+ * Don't hold the lock while doing disk operations,33383338+ * or lock ordering will conflict with the bdev mutex via:33393339+ * rbd_add() -> blkdev_get() -> rbd_open()33403340+ */33413341+ spin_lock_irq(&rbd_dev->lock);33423342+ removing = test_bit(RBD_DEV_FLAG_REMOVING, &rbd_dev->flags);33433343+ spin_unlock_irq(&rbd_dev->lock);33443344+ /*33453345+ * If the device is being removed, rbd_dev->disk has33463346+ * been destroyed, so don't try to update its size33473347+ */33483348+ if (!removing) {33493349+ size = (sector_t)rbd_dev->mapping.size / SECTOR_SIZE;33503350+ dout("setting size to %llu sectors", (unsigned long long)size);33513351+ set_capacity(rbd_dev->disk, size);33523352+ revalidate_disk(rbd_dev->disk);33533353+ }33543354+}33553355+33343356static int rbd_dev_refresh(struct rbd_device *rbd_dev)33353357{33363358 u64 mapping_size;···33753347 up_write(&rbd_dev->header_rwsem);3376334833773349 if (mapping_size != rbd_dev->mapping.size) {33783378- sector_t size;33793379-33803380- size = (sector_t)rbd_dev->mapping.size / SECTOR_SIZE;33813381- dout("setting size to %llu sectors", (unsigned long long)size);33823382- set_capacity(rbd_dev->disk, size);33833383- revalidate_disk(rbd_dev->disk);33503350+ rbd_dev_update_size(rbd_dev);33843351 }3385335233863353 return ret;···4084406140854062 snap_id = snapc->snaps[which];40864063 snap_name = rbd_dev_v2_snap_name(rbd_dev, snap_id);40874087- if (IS_ERR(snap_name))40884088- break;40644064+ if (IS_ERR(snap_name)) {40654065+ /* ignore no-longer existing snapshots */40664066+ if (PTR_ERR(snap_name) == -ENOENT)40674067+ continue;40684068+ else40694069+ break;40704070+ }40894071 found = !strcmp(name, snap_name);40904072 kfree(snap_name);40914073 }···41694141 /* Look up the snapshot name, and make a copy */4170414241714143 snap_name = rbd_snap_name(rbd_dev, spec->snap_id);41724172- if (!snap_name) {41734173- ret = -ENOMEM;41444144+ if (IS_ERR(snap_name)) {41454145+ ret = PTR_ERR(snap_name);41744146 goto out_err;41754147 }41764148···51915163 if (ret < 0 || already)51925164 return ret;5193516551945194- rbd_bus_del_dev(rbd_dev);51955166 ret = rbd_dev_header_watch_sync(rbd_dev, false);51965167 if (ret)51975168 rbd_warn(rbd_dev, "failed to cancel watch event (%d)\n", ret);51695169+51705170+ /*51715171+ * flush remaining watch callbacks - these must be complete51725172+ * before the osd_client is shutdown51735173+ */51745174+ dout("%s: flushing notifies", __func__);51755175+ ceph_osdc_flush_notifies(&rbd_dev->rbd_client->client->osdc);51765176+ /*51775177+ * Don't free anything from rbd_dev->disk until after all51785178+ * notifies are completely processed. Otherwise51795179+ * rbd_bus_del_dev() will race with rbd_watch_cb(), resulting51805180+ * in a potential use after free of rbd_dev->disk or rbd_dev.51815181+ */51825182+ rbd_bus_del_dev(rbd_dev);51985183 rbd_dev_image_release(rbd_dev);51995184 module_put(THIS_MODULE);52005185
+6-1
drivers/cpufreq/cpufreq-cpu0.c
···1212#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt13131414#include <linux/clk.h>1515+#include <linux/cpu.h>1516#include <linux/cpufreq.h>1617#include <linux/err.h>1718#include <linux/module.h>···178177 struct device_node *np;179178 int ret;180179181181- cpu_dev = &pdev->dev;180180+ cpu_dev = get_cpu_device(0);181181+ if (!cpu_dev) {182182+ pr_err("failed to get cpu0 device\n");183183+ return -ENODEV;184184+ }182185183186 np = of_node_get(cpu_dev->of_node);184187 if (!np) {
+20-11
drivers/cpufreq/cpufreq.c
···952952 if (cpu == policy->cpu)953953 return;954954955955+ /*956956+ * Take direct locks as lock_policy_rwsem_write wouldn't work here.957957+ * Also lock for last cpu is enough here as contention will happen only958958+ * after policy->cpu is changed and after it is changed, other threads959959+ * will try to acquire lock for new cpu. And policy is already updated960960+ * by then.961961+ */962962+ down_write(&per_cpu(cpu_policy_rwsem, policy->cpu));963963+955964 policy->last_cpu = policy->cpu;956965 policy->cpu = cpu;966966+967967+ up_write(&per_cpu(cpu_policy_rwsem, policy->last_cpu));957968958969#ifdef CONFIG_CPU_FREQ_TABLE959970 cpufreq_frequency_table_update_policy_cpu(policy);···11361125 int ret;1137112611381127 /* first sibling now owns the new sysfs dir */11391139- cpu_dev = get_cpu_device(cpumask_first(policy->cpus));11281128+ cpu_dev = get_cpu_device(cpumask_any_but(policy->cpus, old_cpu));1140112911411130 /* Don't touch sysfs files during light-weight tear-down */11421131 if (frozen)···12001189 policy->governor->name, CPUFREQ_NAME_LEN);12011190#endif1202119112031203- WARN_ON(lock_policy_rwsem_write(cpu));11921192+ lock_policy_rwsem_read(cpu);12041193 cpus = cpumask_weight(policy->cpus);12051205-12061206- if (cpus > 1)12071207- cpumask_clear_cpu(cpu, policy->cpus);12081208- unlock_policy_rwsem_write(cpu);11941194+ unlock_policy_rwsem_read(cpu);1209119512101196 if (cpu != policy->cpu) {12111197 if (!frozen)···1211120312121204 new_cpu = cpufreq_nominate_new_policy_cpu(policy, cpu, frozen);12131205 if (new_cpu >= 0) {12141214- WARN_ON(lock_policy_rwsem_write(cpu));12151206 update_policy_cpu(policy, new_cpu);12161216- unlock_policy_rwsem_write(cpu);1217120712181208 if (!frozen) {12191209 pr_debug("%s: policy Kobject moved to cpu: %d "···12431237 return -EINVAL;12441238 }1245123912461246- lock_policy_rwsem_read(cpu);12401240+ WARN_ON(lock_policy_rwsem_write(cpu));12471241 cpus = cpumask_weight(policy->cpus);12481248- unlock_policy_rwsem_read(cpu);12421242+12431243+ if (cpus > 1)12441244+ cpumask_clear_cpu(cpu, policy->cpus);12451245+ unlock_policy_rwsem_write(cpu);1249124612501247 /* If cpu is last user of policy, free policy */12511248 if (cpus == 1) {···21042095 write_lock_irqsave(&cpufreq_driver_lock, flags);21052096 if (cpufreq_driver) {21062097 write_unlock_irqrestore(&cpufreq_driver_lock, flags);21072107- return -EBUSY;20982098+ return -EEXIST;21082099 }21092100 cpufreq_driver = driver_data;21102101 write_unlock_irqrestore(&cpufreq_driver_lock, flags);
+6-1
drivers/cpufreq/imx6q-cpufreq.c
···77 */8899#include <linux/clk.h>1010+#include <linux/cpu.h>1011#include <linux/cpufreq.h>1112#include <linux/delay.h>1213#include <linux/err.h>···203202 unsigned long min_volt, max_volt;204203 int num, ret;205204206206- cpu_dev = &pdev->dev;205205+ cpu_dev = get_cpu_device(0);206206+ if (!cpu_dev) {207207+ pr_err("failed to get cpu0 device\n");208208+ return -ENODEV;209209+ }207210208211 np = of_node_get(cpu_dev->of_node);209212 if (!np) {
···42424343#include <drm/drmP.h>44444545+/******************************************************************/4646+/** \name Context bitmap support */4747+/*@{*/4848+4549/**4650 * Free a handle from the context bitmap.4751 *···5652 * in drm_device::ctx_idr, while holding the drm_device::struct_mutex5753 * lock.5854 */5959-static void drm_ctxbitmap_free(struct drm_device * dev, int ctx_handle)5555+void drm_ctxbitmap_free(struct drm_device * dev, int ctx_handle)6056{6161- if (drm_core_check_feature(dev, DRIVER_MODESET))6262- return;6363-6457 mutex_lock(&dev->struct_mutex);6558 idr_remove(&dev->ctx_idr, ctx_handle);6659 mutex_unlock(&dev->struct_mutex);6767-}6868-6969-/******************************************************************/7070-/** \name Context bitmap support */7171-/*@{*/7272-7373-void drm_legacy_ctxbitmap_release(struct drm_device *dev,7474- struct drm_file *file_priv)7575-{7676- if (drm_core_check_feature(dev, DRIVER_MODESET))7777- return;7878-7979- mutex_lock(&dev->ctxlist_mutex);8080- if (!list_empty(&dev->ctxlist)) {8181- struct drm_ctx_list *pos, *n;8282-8383- list_for_each_entry_safe(pos, n, &dev->ctxlist, head) {8484- if (pos->tag == file_priv &&8585- pos->handle != DRM_KERNEL_CONTEXT) {8686- if (dev->driver->context_dtor)8787- dev->driver->context_dtor(dev,8888- pos->handle);8989-9090- drm_ctxbitmap_free(dev, pos->handle);9191-9292- list_del(&pos->head);9393- kfree(pos);9494- --dev->ctx_count;9595- }9696- }9797- }9898- mutex_unlock(&dev->ctxlist_mutex);9960}1006110162/**···90121 *91122 * Initialise the drm_device::ctx_idr92123 */9393-void drm_legacy_ctxbitmap_init(struct drm_device * dev)124124+int drm_ctxbitmap_init(struct drm_device * dev)94125{9595- if (drm_core_check_feature(dev, DRIVER_MODESET))9696- return;9797-98126 idr_init(&dev->ctx_idr);127127+ return 0;99128}100129101130/**···104137 * Free all idr members using drm_ctx_sarea_free helper function105138 * while holding the drm_device::struct_mutex lock.106139 */107107-void drm_legacy_ctxbitmap_cleanup(struct drm_device * dev)140140+void drm_ctxbitmap_cleanup(struct drm_device * dev)108141{109142 mutex_lock(&dev->struct_mutex);110143 idr_destroy(&dev->ctx_idr);···135168 struct drm_ctx_priv_map *request = data;136169 struct drm_local_map *map;137170 struct drm_map_list *_entry;138138-139139- if (drm_core_check_feature(dev, DRIVER_MODESET))140140- return -EINVAL;141171142172 mutex_lock(&dev->struct_mutex);143173···179215 struct drm_ctx_priv_map *request = data;180216 struct drm_local_map *map = NULL;181217 struct drm_map_list *r_list = NULL;182182-183183- if (drm_core_check_feature(dev, DRIVER_MODESET))184184- return -EINVAL;185218186219 mutex_lock(&dev->struct_mutex);187220 list_for_each_entry(r_list, &dev->maplist, head) {···280319 struct drm_ctx ctx;281320 int i;282321283283- if (drm_core_check_feature(dev, DRIVER_MODESET))284284- return -EINVAL;285285-286322 if (res->count >= DRM_RESERVED_CONTEXTS) {287323 memset(&ctx, 0, sizeof(ctx));288324 for (i = 0; i < DRM_RESERVED_CONTEXTS; i++) {···309351{310352 struct drm_ctx_list *ctx_entry;311353 struct drm_ctx *ctx = data;312312-313313- if (drm_core_check_feature(dev, DRIVER_MODESET))314314- return -EINVAL;315354316355 ctx->handle = drm_ctxbitmap_next(dev);317356 if (ctx->handle == DRM_KERNEL_CONTEXT) {···353398{354399 struct drm_ctx *ctx = data;355400356356- if (drm_core_check_feature(dev, DRIVER_MODESET))357357- return -EINVAL;358358-359401 /* This is 0, because we don't handle any context flags */360402 ctx->flags = 0;361403···375423{376424 struct drm_ctx *ctx = data;377425378378- if (drm_core_check_feature(dev, DRIVER_MODESET))379379- return -EINVAL;380380-381426 DRM_DEBUG("%d\n", ctx->handle);382427 return drm_context_switch(dev, dev->last_context, ctx->handle);383428}···394445 struct drm_file *file_priv)395446{396447 struct drm_ctx *ctx = data;397397-398398- if (drm_core_check_feature(dev, DRIVER_MODESET))399399- return -EINVAL;400448401449 DRM_DEBUG("%d\n", ctx->handle);402450 drm_context_switch_complete(dev, file_priv, ctx->handle);···416470 struct drm_file *file_priv)417471{418472 struct drm_ctx *ctx = data;419419-420420- if (drm_core_check_feature(dev, DRIVER_MODESET))421421- return -EINVAL;422473423474 DRM_DEBUG("%d\n", ctx->handle);424475 if (ctx->handle != DRM_KERNEL_CONTEXT) {
+8
drivers/gpu/drm/drm_fb_helper.c
···416416 return;417417418418 /*419419+ * fbdev->blank can be called from irq context in case of a panic.420420+ * Since we already have our own special panic handler which will421421+ * restore the fbdev console mode completely, just bail out early.422422+ */423423+ if (oops_in_progress)424424+ return;425425+426426+ /*419427 * For each CRTC in this fb, turn the connectors on/off.420428 */421429 drm_modeset_lock_all(dev);
+20-1
drivers/gpu/drm/drm_fops.c
···439439 if (dev->driver->driver_features & DRIVER_GEM)440440 drm_gem_release(dev, file_priv);441441442442- drm_legacy_ctxbitmap_release(dev, file_priv);442442+ mutex_lock(&dev->ctxlist_mutex);443443+ if (!list_empty(&dev->ctxlist)) {444444+ struct drm_ctx_list *pos, *n;445445+446446+ list_for_each_entry_safe(pos, n, &dev->ctxlist, head) {447447+ if (pos->tag == file_priv &&448448+ pos->handle != DRM_KERNEL_CONTEXT) {449449+ if (dev->driver->context_dtor)450450+ dev->driver->context_dtor(dev,451451+ pos->handle);452452+453453+ drm_ctxbitmap_free(dev, pos->handle);454454+455455+ list_del(&pos->head);456456+ kfree(pos);457457+ --dev->ctx_count;458458+ }459459+ }460460+ }461461+ mutex_unlock(&dev->ctxlist_mutex);443462444463 mutex_lock(&dev->struct_mutex);445464
+8-2
drivers/gpu/drm/drm_stub.c
···292292 goto error_out_unreg;293293 }294294295295- drm_legacy_ctxbitmap_init(dev);295295+296296+297297+ retcode = drm_ctxbitmap_init(dev);298298+ if (retcode) {299299+ DRM_ERROR("Cannot allocate memory for context bitmap.\n");300300+ goto error_out_unreg;301301+ }296302297303 if (driver->driver_features & DRIVER_GEM) {298304 retcode = drm_gem_init(dev);···452446 drm_rmmap(dev, r_list->map);453447 drm_ht_remove(&dev->map_hash);454448455455- drm_legacy_ctxbitmap_cleanup(dev);449449+ drm_ctxbitmap_cleanup(dev);456450457451 if (drm_core_check_feature(dev, DRIVER_MODESET))458452 drm_put_minor(&dev->control);
+1-1
drivers/gpu/drm/exynos/Kconfig
···56565757config DRM_EXYNOS_FIMC5858 bool "Exynos DRM FIMC"5959- depends on DRM_EXYNOS_IPP && MFD_SYSCON && OF5959+ depends on DRM_EXYNOS_IPP && MFD_SYSCON6060 help6161 Choose this option if you want to use Exynos FIMC for DRM.6262
+4-3
drivers/gpu/drm/exynos/exynos_drm_buf.c
···6363 return -ENOMEM;6464 }65656666- buf->kvaddr = dma_alloc_attrs(dev->dev, buf->size,6666+ buf->kvaddr = (void __iomem *)dma_alloc_attrs(dev->dev,6767+ buf->size,6768 &buf->dma_addr, GFP_KERNEL,6869 &buf->dma_attrs);6970 if (!buf->kvaddr) {···9190 }92919392 buf->sgt = drm_prime_pages_to_sg(buf->pages, nr_pages);9494- if (!buf->sgt) {9393+ if (IS_ERR(buf->sgt)) {9594 DRM_ERROR("failed to get sg table.\n");9696- ret = -ENOMEM;9595+ ret = PTR_ERR(buf->sgt);9796 goto err_free_attrs;9897 }9998
···13921392 if (i915_terminally_wedged(&dev_priv->gpu_error))13931393 return VM_FAULT_SIGBUS;13941394 case -EAGAIN:13951395- /* Give the error handler a chance to run and move the13961396- * objects off the GPU active list. Next time we service the13971397- * fault, we should be able to transition the page into the13981398- * GTT without touching the GPU (and so avoid further13991399- * EIO/EGAIN). If the GPU is wedged, then there is no issue14001400- * with coherency, just lost writes.13951395+ /*13961396+ * EAGAIN means the gpu is hung and we'll wait for the error13971397+ * handler to reset everything when re-faulting in13981398+ * i915_mutex_lock_interruptible.14011399 */14021402- set_need_resched();14031400 case 0:14041401 case -ERESTARTSYS:14051402 case -EINTR:
+54-14
drivers/gpu/drm/i915/i915_irq.c
···14691469 return ret;14701470}1471147114721472+static void i915_error_wake_up(struct drm_i915_private *dev_priv,14731473+ bool reset_completed)14741474+{14751475+ struct intel_ring_buffer *ring;14761476+ int i;14771477+14781478+ /*14791479+ * Notify all waiters for GPU completion events that reset state has14801480+ * been changed, and that they need to restart their wait after14811481+ * checking for potential errors (and bail out to drop locks if there is14821482+ * a gpu reset pending so that i915_error_work_func can acquire them).14831483+ */14841484+14851485+ /* Wake up __wait_seqno, potentially holding dev->struct_mutex. */14861486+ for_each_ring(ring, dev_priv, i)14871487+ wake_up_all(&ring->irq_queue);14881488+14891489+ /* Wake up intel_crtc_wait_for_pending_flips, holding crtc->mutex. */14901490+ wake_up_all(&dev_priv->pending_flip_queue);14911491+14921492+ /*14931493+ * Signal tasks blocked in i915_gem_wait_for_error that the pending14941494+ * reset state is cleared.14951495+ */14961496+ if (reset_completed)14971497+ wake_up_all(&dev_priv->gpu_error.reset_queue);14981498+}14991499+14721500/**14731501 * i915_error_work_func - do process context error handling work14741502 * @work: work struct···15111483 drm_i915_private_t *dev_priv = container_of(error, drm_i915_private_t,15121484 gpu_error);15131485 struct drm_device *dev = dev_priv->dev;15141514- struct intel_ring_buffer *ring;15151486 char *error_event[] = { I915_ERROR_UEVENT "=1", NULL };15161487 char *reset_event[] = { I915_RESET_UEVENT "=1", NULL };15171488 char *reset_done_event[] = { I915_ERROR_UEVENT "=0", NULL };15181518- int i, ret;14891489+ int ret;1519149015201491 kobject_uevent_env(&dev->primary->kdev.kobj, KOBJ_CHANGE, error_event);15211492···15331506 kobject_uevent_env(&dev->primary->kdev.kobj, KOBJ_CHANGE,15341507 reset_event);1535150815091509+ /*15101510+ * All state reset _must_ be completed before we update the15111511+ * reset counter, for otherwise waiters might miss the reset15121512+ * pending state and not properly drop locks, resulting in15131513+ * deadlocks with the reset work.15141514+ */15361515 ret = i915_reset(dev);15161516+15171517+ intel_display_handle_reset(dev);1537151815381519 if (ret == 0) {15391520 /*···15631528 atomic_set(&error->reset_counter, I915_WEDGED);15641529 }1565153015661566- for_each_ring(ring, dev_priv, i)15671567- wake_up_all(&ring->irq_queue);15681568-15691569- intel_display_handle_reset(dev);15701570-15711571- wake_up_all(&dev_priv->gpu_error.reset_queue);15311531+ /*15321532+ * Note: The wake_up also serves as a memory barrier so that15331533+ * waiters see the update value of the reset counter atomic_t.15341534+ */15351535+ i915_error_wake_up(dev_priv, true);15721536 }15731537}15741538···16761642void i915_handle_error(struct drm_device *dev, bool wedged)16771643{16781644 struct drm_i915_private *dev_priv = dev->dev_private;16791679- struct intel_ring_buffer *ring;16801680- int i;1681164516821646 i915_capture_error_state(dev);16831647 i915_report_and_clear_eir(dev);···16851653 &dev_priv->gpu_error.reset_counter);1686165416871655 /*16881688- * Wakeup waiting processes so that the reset work item16891689- * doesn't deadlock trying to grab various locks.16561656+ * Wakeup waiting processes so that the reset work function16571657+ * i915_error_work_func doesn't deadlock trying to grab various16581658+ * locks. By bumping the reset counter first, the woken16591659+ * processes will see a reset in progress and back off,16601660+ * releasing their locks and then wait for the reset completion.16611661+ * We must do this for _all_ gpu waiters that might hold locks16621662+ * that the reset work needs to acquire.16631663+ *16641664+ * Note: The wake_up serves as the required memory barrier to16651665+ * ensure that the waiters see the updated value of the reset16661666+ * counter atomic_t.16901667 */16911691- for_each_ring(ring, dev_priv, i)16921692- wake_up_all(&ring->irq_queue);16681668+ i915_error_wake_up(dev_priv, false);16931669 }1694167016951671 /*
+1-1
drivers/gpu/drm/i915/intel_ddi.c
···778778 /* Can only use the always-on power well for eDP when779779 * not using the panel fitter, and when not using motion780780 * blur mitigation (which we don't support). */781781- if (intel_crtc->config.pch_pfit.size)781781+ if (intel_crtc->config.pch_pfit.enabled)782782 temp |= TRANS_DDI_EDP_INPUT_A_ONOFF;783783 else784784 temp |= TRANS_DDI_EDP_INPUT_A_ON;
+20-22
drivers/gpu/drm/i915/intel_display.c
···22492249 I915_WRITE(PIPESRC(intel_crtc->pipe),22502250 ((crtc->mode.hdisplay - 1) << 16) |22512251 (crtc->mode.vdisplay - 1));22522252- if (!intel_crtc->config.pch_pfit.size &&22522252+ if (!intel_crtc->config.pch_pfit.enabled &&22532253 (intel_pipe_has_type(crtc, INTEL_OUTPUT_LVDS) ||22542254 intel_pipe_has_type(crtc, INTEL_OUTPUT_EDP))) {22552255 I915_WRITE(PF_CTL(intel_crtc->pipe), 0);···32033203 struct drm_i915_private *dev_priv = dev->dev_private;32043204 int pipe = crtc->pipe;3205320532063206- if (crtc->config.pch_pfit.size) {32063206+ if (crtc->config.pch_pfit.enabled) {32073207 /* Force use of hard-coded filter coefficients32083208 * as some pre-programmed values are broken,32093209 * e.g. x201.···3428342834293429 /* To avoid upsetting the power well on haswell only disable the pfit if34303430 * it's in use. The hw state code will make sure we get this right. */34313431- if (crtc->config.pch_pfit.size) {34313431+ if (crtc->config.pch_pfit.enabled) {34323432 I915_WRITE(PF_CTL(pipe), 0);34333433 I915_WRITE(PF_WIN_POS(pipe), 0);34343434 I915_WRITE(PF_WIN_SZ(pipe), 0);···48774877 return -EINVAL;48784878 }4879487948804880- /* Ensure that the cursor is valid for the new mode before changing... */48814881- intel_crtc_update_cursor(crtc, true);48824882-48834880 if (is_lvds && dev_priv->lvds_downclock_avail) {48844881 /*48854882 * Ensure we match the reduced clock's P to the target clock.···57655768 intel_crtc->config.dpll.p2 = clock.p2;57665769 }5767577057685768- /* Ensure that the cursor is valid for the new mode before changing... */57695769- intel_crtc_update_cursor(crtc, true);57705770-57715771 /* CPU eDP is the only output that doesn't need a PCH PLL of its own. */57725772 if (intel_crtc->config.has_pch_encoder) {57735773 fp = i9xx_dpll_compute_fp(&intel_crtc->config.dpll);···58535859 tmp = I915_READ(PF_CTL(crtc->pipe));5854586058555861 if (tmp & PF_ENABLE) {58625862+ pipe_config->pch_pfit.enabled = true;58565863 pipe_config->pch_pfit.pos = I915_READ(PF_WIN_POS(crtc->pipe));58575864 pipe_config->pch_pfit.size = I915_READ(PF_WIN_SZ(crtc->pipe));58585865···62316236 if (!crtc->base.enabled)62326237 continue;6233623862346234- if (crtc->pipe != PIPE_A || crtc->config.pch_pfit.size ||62396239+ if (crtc->pipe != PIPE_A || crtc->config.pch_pfit.enabled ||62356240 crtc->config.cpu_transcoder != TRANSCODER_EDP)62366241 enable = true;62376242 }···6253625862546259 if (!intel_ddi_pll_mode_set(crtc))62556260 return -EINVAL;62566256-62576257- /* Ensure that the cursor is valid for the new mode before changing... */62586258- intel_crtc_update_cursor(crtc, true);6259626162606262 if (intel_crtc->config.has_dp_encoder)62616263 intel_dp_set_m_n(intel_crtc);···6486649464876495 /* Set ELD valid state */64886496 tmp = I915_READ(aud_cntrl_st2);64896489- DRM_DEBUG_DRIVER("HDMI audio: pin eld vld status=0x%8x\n", tmp);64976497+ DRM_DEBUG_DRIVER("HDMI audio: pin eld vld status=0x%08x\n", tmp);64906498 tmp |= (AUDIO_ELD_VALID_A << (pipe * 4));64916499 I915_WRITE(aud_cntrl_st2, tmp);64926500 tmp = I915_READ(aud_cntrl_st2);64936493- DRM_DEBUG_DRIVER("HDMI audio: eld vld status=0x%8x\n", tmp);65016501+ DRM_DEBUG_DRIVER("HDMI audio: eld vld status=0x%08x\n", tmp);6494650264956503 /* Enable HDMI mode */64966504 tmp = I915_READ(aud_config);64976497- DRM_DEBUG_DRIVER("HDMI audio: audio conf: 0x%8x\n", tmp);65056505+ DRM_DEBUG_DRIVER("HDMI audio: audio conf: 0x%08x\n", tmp);64986506 /* clear N_programing_enable and N_value_index */64996507 tmp &= ~(AUD_CONFIG_N_VALUE_INDEX | AUD_CONFIG_N_PROG_ENABLE);65006508 I915_WRITE(aud_config, tmp);···69296937 intel_crtc->cursor_width = width;69306938 intel_crtc->cursor_height = height;6931693969326932- intel_crtc_update_cursor(crtc, intel_crtc->cursor_bo != NULL);69406940+ if (intel_crtc->active)69416941+ intel_crtc_update_cursor(crtc, intel_crtc->cursor_bo != NULL);6933694269346943 return 0;69356944fail_unpin:···69496956 intel_crtc->cursor_x = x;69506957 intel_crtc->cursor_y = y;6951695869526952- intel_crtc_update_cursor(crtc, intel_crtc->cursor_bo != NULL);69596959+ if (intel_crtc->active)69606960+ intel_crtc_update_cursor(crtc, intel_crtc->cursor_bo != NULL);6953696169546962 return 0;69556963}···81998205 pipe_config->gmch_pfit.control,82008206 pipe_config->gmch_pfit.pgm_ratios,82018207 pipe_config->gmch_pfit.lvds_border_bits);82028202- DRM_DEBUG_KMS("pch pfit: pos: 0x%08x, size: 0x%08x\n",82088208+ DRM_DEBUG_KMS("pch pfit: pos: 0x%08x, size: 0x%08x, %s\n",82038209 pipe_config->pch_pfit.pos,82048204- pipe_config->pch_pfit.size);82108210+ pipe_config->pch_pfit.size,82118211+ pipe_config->pch_pfit.enabled ? "enabled" : "disabled");82058212 DRM_DEBUG_KMS("ips: %i\n", pipe_config->ips_enabled);82068213}82078214···85988603 if (INTEL_INFO(dev)->gen < 4)85998604 PIPE_CONF_CHECK_I(gmch_pfit.pgm_ratios);86008605 PIPE_CONF_CHECK_I(gmch_pfit.lvds_border_bits);86018601- PIPE_CONF_CHECK_I(pch_pfit.pos);86028602- PIPE_CONF_CHECK_I(pch_pfit.size);86068606+ PIPE_CONF_CHECK_I(pch_pfit.enabled);86078607+ if (current_config->pch_pfit.enabled) {86088608+ PIPE_CONF_CHECK_I(pch_pfit.pos);86098609+ PIPE_CONF_CHECK_I(pch_pfit.size);86108610+ }8603861186048612 PIPE_CONF_CHECK_I(ips_enabled);86058613
+1
drivers/gpu/drm/i915/intel_drv.h
···280280 struct {281281 u32 pos;282282 u32 size;283283+ bool enabled;283284 } pch_pfit;284285285286 /* FDI configuration, only valid if has_pch_encoder is set. */
···4040 }41414242 msm_obj->sgt = drm_prime_pages_to_sg(p, npages);4343- if (!msm_obj->sgt) {4343+ if (IS_ERR(msm_obj->sgt)) {4444 dev_err(dev->dev, "failed to allocate sgt\n");4545- return ERR_PTR(-ENOMEM);4545+ return ERR_CAST(msm_obj->sgt);4646 }47474848 msm_obj->pages = p;···159159out:160160 switch (ret) {161161 case -EAGAIN:162162- set_need_resched();163162 case 0:164163 case -ERESTARTSYS:165164 case -EINTR:···392393}393394394395void msm_gem_move_to_active(struct drm_gem_object *obj,395395- struct msm_gpu *gpu, uint32_t fence)396396+ struct msm_gpu *gpu, bool write, uint32_t fence)396397{397398 struct msm_gem_object *msm_obj = to_msm_bo(obj);398399 msm_obj->gpu = gpu;399399- msm_obj->fence = fence;400400+ if (write)401401+ msm_obj->write_fence = fence;402402+ else403403+ msm_obj->read_fence = fence;400404 list_del_init(&msm_obj->mm_list);401405 list_add_tail(&msm_obj->mm_list, &gpu->active_list);402406}···413411 WARN_ON(!mutex_is_locked(&dev->struct_mutex));414412415413 msm_obj->gpu = NULL;416416- msm_obj->fence = 0;414414+ msm_obj->read_fence = 0;415415+ msm_obj->write_fence = 0;417416 list_del_init(&msm_obj->mm_list);418417 list_add_tail(&msm_obj->mm_list, &priv->inactive_list);419418···436433 struct msm_gem_object *msm_obj = to_msm_bo(obj);437434 int ret = 0;438435439439- if (is_active(msm_obj) && !(op & MSM_PREP_NOSYNC))440440- ret = msm_wait_fence_interruptable(dev, msm_obj->fence, timeout);436436+ if (is_active(msm_obj)) {437437+ uint32_t fence = 0;438438+439439+ if (op & MSM_PREP_READ)440440+ fence = msm_obj->write_fence;441441+ if (op & MSM_PREP_WRITE)442442+ fence = max(fence, msm_obj->read_fence);443443+ if (op & MSM_PREP_NOSYNC)444444+ timeout = NULL;445445+446446+ ret = msm_wait_fence_interruptable(dev, fence, timeout);447447+ }441448442449 /* TODO cache maintenance */443450···468455 uint64_t off = drm_vma_node_start(&obj->vma_node);469456470457 WARN_ON(!mutex_is_locked(&dev->struct_mutex));471471- seq_printf(m, "%08x: %c(%d) %2d (%2d) %08llx %p %d\n",458458+ seq_printf(m, "%08x: %c(r=%u,w=%u) %2d (%2d) %08llx %p %d\n",472459 msm_obj->flags, is_active(msm_obj) ? 'A' : 'I',473473- msm_obj->fence, obj->name, obj->refcount.refcount.counter,460460+ msm_obj->read_fence, msm_obj->write_fence,461461+ obj->name, obj->refcount.refcount.counter,474462 off, msm_obj->vaddr, obj->size);475463}476464
+1-1
drivers/gpu/drm/msm/msm_gem.h
···3636 */3737 struct list_head mm_list;3838 struct msm_gpu *gpu; /* non-null if active */3939- uint32_t fence;3939+ uint32_t read_fence, write_fence;40404141 /* Transiently in the process of submit ioctl, objects associated4242 * with the submit are on submit->bo_list.. this only lasts for
+13-11
drivers/gpu/drm/msm/msm_gem_submit.c
···7878 }79798080 if (submit_bo.flags & BO_INVALID_FLAGS) {8181- DBG("invalid flags: %x", submit_bo.flags);8181+ DRM_ERROR("invalid flags: %x\n", submit_bo.flags);8282 ret = -EINVAL;8383 goto out_unlock;8484 }···9292 */9393 obj = idr_find(&file->object_idr, submit_bo.handle);9494 if (!obj) {9595- DBG("invalid handle %u at index %u", submit_bo.handle, i);9595+ DRM_ERROR("invalid handle %u at index %u\n", submit_bo.handle, i);9696 ret = -EINVAL;9797 goto out_unlock;9898 }···100100 msm_obj = to_msm_bo(obj);101101102102 if (!list_empty(&msm_obj->submit_entry)) {103103- DBG("handle %u at index %u already on submit list",103103+ DRM_ERROR("handle %u at index %u already on submit list\n",104104 submit_bo.handle, i);105105 ret = -EINVAL;106106 goto out_unlock;···216216 struct msm_gem_object **obj, uint32_t *iova, bool *valid)217217{218218 if (idx >= submit->nr_bos) {219219- DBG("invalid buffer index: %u (out of %u)", idx, submit->nr_bos);220220- return EINVAL;219219+ DRM_ERROR("invalid buffer index: %u (out of %u)\n",220220+ idx, submit->nr_bos);221221+ return -EINVAL;221222 }222223223224 if (obj)···240239 int ret;241240242241 if (offset % 4) {243243- DBG("non-aligned cmdstream buffer: %u", offset);242242+ DRM_ERROR("non-aligned cmdstream buffer: %u\n", offset);244243 return -EINVAL;245244 }246245···267266 return -EFAULT;268267269268 if (submit_reloc.submit_offset % 4) {270270- DBG("non-aligned reloc offset: %u",269269+ DRM_ERROR("non-aligned reloc offset: %u\n",271270 submit_reloc.submit_offset);272271 return -EINVAL;273272 }···277276278277 if ((off >= (obj->base.size / 4)) ||279278 (off < last_offset)) {280280- DBG("invalid offset %u at reloc %u", off, i);279279+ DRM_ERROR("invalid offset %u at reloc %u\n", off, i);281280 return -EINVAL;282281 }283282···375374 goto out;376375377376 if (submit_cmd.size % 4) {378378- DBG("non-aligned cmdstream buffer size: %u",377377+ DRM_ERROR("non-aligned cmdstream buffer size: %u\n",379378 submit_cmd.size);380379 ret = -EINVAL;381380 goto out;382381 }383382384384- if (submit_cmd.size >= msm_obj->base.size) {385385- DBG("invalid cmdstream size: %u", submit_cmd.size);383383+ if ((submit_cmd.size + submit_cmd.submit_offset) >=384384+ msm_obj->base.size) {385385+ DRM_ERROR("invalid cmdstream size: %u\n", submit_cmd.size);386386 ret = -EINVAL;387387 goto out;388388 }
···707707 switch (connector->connector_type) {708708 case DRM_MODE_CONNECTOR_DVII:709709 case DRM_MODE_CONNECTOR_HDMIB: /* HDMI-B is basically DL-DVI; analog works fine */710710- if (drm_detect_hdmi_monitor(radeon_connector->edid) &&711711- radeon_audio)710710+ if ((radeon_connector->audio == RADEON_AUDIO_ENABLE) ||711711+ (drm_detect_hdmi_monitor(radeon_connector->edid) &&712712+ (radeon_connector->audio == RADEON_AUDIO_AUTO)))712713 return ATOM_ENCODER_MODE_HDMI;713714 else if (radeon_connector->use_digital)714715 return ATOM_ENCODER_MODE_DVI;···719718 case DRM_MODE_CONNECTOR_DVID:720719 case DRM_MODE_CONNECTOR_HDMIA:721720 default:722722- if (drm_detect_hdmi_monitor(radeon_connector->edid) &&723723- radeon_audio)721721+ if ((radeon_connector->audio == RADEON_AUDIO_ENABLE) ||722722+ (drm_detect_hdmi_monitor(radeon_connector->edid) &&723723+ (radeon_connector->audio == RADEON_AUDIO_AUTO)))724724 return ATOM_ENCODER_MODE_HDMI;725725 else726726 return ATOM_ENCODER_MODE_DVI;···734732 if ((dig_connector->dp_sink_type == CONNECTOR_OBJECT_ID_DISPLAYPORT) ||735733 (dig_connector->dp_sink_type == CONNECTOR_OBJECT_ID_eDP))736734 return ATOM_ENCODER_MODE_DP;737737- else if (drm_detect_hdmi_monitor(radeon_connector->edid) &&738738- radeon_audio)735735+ else if ((radeon_connector->audio == RADEON_AUDIO_ENABLE) ||736736+ (drm_detect_hdmi_monitor(radeon_connector->edid) &&737737+ (radeon_connector->audio == RADEON_AUDIO_AUTO)))739738 return ATOM_ENCODER_MODE_HDMI;740739 else741740 return ATOM_ENCODER_MODE_DVI;···16501647 atombios_dig_encoder_setup(encoder, ATOM_ENABLE, 0);16511648 atombios_dig_transmitter_setup(encoder, ATOM_TRANSMITTER_ACTION_SETUP, 0, 0);16521649 atombios_dig_transmitter_setup(encoder, ATOM_TRANSMITTER_ACTION_ENABLE, 0, 0);16531653- /* some early dce3.2 boards have a bug in their transmitter control table */16541654- if ((rdev->family != CHIP_RV710) && (rdev->family != CHIP_RV730))16501650+ /* some dce3.x boards have a bug in their transmitter control table.16511651+ * ACTION_ENABLE_OUTPUT can probably be dropped since ACTION_ENABLE16521652+ * does the same thing and more.16531653+ */16541654+ if ((rdev->family != CHIP_RV710) && (rdev->family != CHIP_RV730) &&16551655+ (rdev->family != CHIP_RS880))16551656 atombios_dig_transmitter_setup(encoder, ATOM_TRANSMITTER_ACTION_ENABLE_OUTPUT, 0, 0);16561657 }16571658 if (ENCODER_MODE_IS_DP(atombios_get_encoder_mode(encoder)) && connector) {
-6
drivers/gpu/drm/radeon/btc_dpm.c
···23402340 return ret;23412341 }2342234223432343- ret = rv770_dpm_force_performance_level(rdev, RADEON_DPM_FORCED_LEVEL_AUTO);23442344- if (ret) {23452345- DRM_ERROR("rv770_dpm_force_performance_level failed\n");23462346- return ret;23472347- }23482348-23492343 return 0;23502344}23512345
-6
drivers/gpu/drm/radeon/ci_dpm.c
···47484748 if (pi->pcie_performance_request)47494749 ci_notify_link_speed_change_after_state_change(rdev, new_ps, old_ps);4750475047514751- ret = ci_dpm_force_performance_level(rdev, RADEON_DPM_FORCED_LEVEL_AUTO);47524752- if (ret) {47534753- DRM_ERROR("ci_dpm_force_performance_level failed\n");47544754- return ret;47554755- }47564756-47574751 cik_update_cg(rdev, (RADEON_CG_BLOCK_GFX |47584752 RADEON_CG_BLOCK_MC |47594753 RADEON_CG_BLOCK_SDMA |
+26-13
drivers/gpu/drm/radeon/ci_smc.c
···4747 u32 smc_start_address,4848 const u8 *src, u32 byte_count, u32 limit)4949{5050+ unsigned long flags;5051 u32 data, original_data;5152 u32 addr;5253 u32 extra_shift;5353- int ret;5454+ int ret = 0;54555556 if (smc_start_address & 3)5657 return -EINVAL;···60596160 addr = smc_start_address;62616262+ spin_lock_irqsave(&rdev->smc_idx_lock, flags);6363 while (byte_count >= 4) {6464 /* SMC address space is BE */6565 data = (src[0] << 24) | (src[1] << 16) | (src[2] << 8) | src[3];66666767 ret = ci_set_smc_sram_address(rdev, addr, limit);6868 if (ret)6969- return ret;6969+ goto done;70707171 WREG32(SMC_IND_DATA_0, data);7272···82808381 ret = ci_set_smc_sram_address(rdev, addr, limit);8482 if (ret)8585- return ret;8383+ goto done;86848785 original_data = RREG32(SMC_IND_DATA_0);8886···999710098 ret = ci_set_smc_sram_address(rdev, addr, limit);10199 if (ret)102102- return ret;100100+ goto done;103101104102 WREG32(SMC_IND_DATA_0, data);105103 }106106- return 0;104104+105105+done:106106+ spin_unlock_irqrestore(&rdev->smc_idx_lock, flags);107107+108108+ return ret;107109}108110109111void ci_start_smc(struct radeon_device *rdev)···203197204198int ci_load_smc_ucode(struct radeon_device *rdev, u32 limit)205199{200200+ unsigned long flags;206201 u32 ucode_start_address;207202 u32 ucode_size;208203 const u8 *src;···226219 return -EINVAL;227220228221 src = (const u8 *)rdev->smc_fw->data;222222+ spin_lock_irqsave(&rdev->smc_idx_lock, flags);229223 WREG32(SMC_IND_INDEX_0, ucode_start_address);230224 WREG32_P(SMC_IND_ACCESS_CNTL, AUTO_INCREMENT_IND_0, ~AUTO_INCREMENT_IND_0);231225 while (ucode_size >= 4) {···239231 ucode_size -= 4;240232 }241233 WREG32_P(SMC_IND_ACCESS_CNTL, 0, ~AUTO_INCREMENT_IND_0);234234+ spin_unlock_irqrestore(&rdev->smc_idx_lock, flags);242235243236 return 0;244237}···247238int ci_read_smc_sram_dword(struct radeon_device *rdev,248239 u32 smc_address, u32 *value, u32 limit)249240{241241+ unsigned long flags;250242 int ret;251243244244+ spin_lock_irqsave(&rdev->smc_idx_lock, flags);252245 ret = ci_set_smc_sram_address(rdev, smc_address, limit);253253- if (ret)254254- return ret;246246+ if (ret == 0)247247+ *value = RREG32(SMC_IND_DATA_0);248248+ spin_unlock_irqrestore(&rdev->smc_idx_lock, flags);255249256256- *value = RREG32(SMC_IND_DATA_0);257257- return 0;250250+ return ret;258251}259252260253int ci_write_smc_sram_dword(struct radeon_device *rdev,261254 u32 smc_address, u32 value, u32 limit)262255{256256+ unsigned long flags;263257 int ret;264258259259+ spin_lock_irqsave(&rdev->smc_idx_lock, flags);265260 ret = ci_set_smc_sram_address(rdev, smc_address, limit);266266- if (ret)267267- return ret;261261+ if (ret == 0)262262+ WREG32(SMC_IND_DATA_0, value);263263+ spin_unlock_irqrestore(&rdev->smc_idx_lock, flags);268264269269- WREG32(SMC_IND_DATA_0, value);270270- return 0;265265+ return ret;271266}
···396396 }397397 }398398399399+ if (property == rdev->mode_info.audio_property) {400400+ struct radeon_connector *radeon_connector = to_radeon_connector(connector);401401+ /* need to find digital encoder on connector */402402+ encoder = radeon_find_encoder(connector, DRM_MODE_ENCODER_TMDS);403403+ if (!encoder)404404+ return 0;405405+406406+ radeon_encoder = to_radeon_encoder(encoder);407407+408408+ if (radeon_connector->audio != val) {409409+ radeon_connector->audio = val;410410+ radeon_property_change_mode(&radeon_encoder->base);411411+ }412412+ }413413+399414 if (property == rdev->mode_info.underscan_property) {400415 /* need to find digital encoder on connector */401416 encoder = radeon_find_encoder(connector, DRM_MODE_ENCODER_TMDS);···14351420 if (radeon_dp_getdpcd(radeon_connector))14361421 ret = connector_status_connected;14371422 } else {14381438- /* try non-aux ddc (DP to DVI/HMDI/etc. adapter) */14231423+ /* try non-aux ddc (DP to DVI/HDMI/etc. adapter) */14391424 if (radeon_ddc_probe(radeon_connector, false))14401425 ret = connector_status_connected;14411426 }···15001485 .detect = radeon_dp_detect,15011486 .fill_modes = drm_helper_probe_single_connector_modes,15021487 .set_property = radeon_connector_set_property,14881488+ .destroy = radeon_dp_connector_destroy,14891489+ .force = radeon_dvi_force,14901490+};14911491+14921492+static const struct drm_connector_funcs radeon_edp_connector_funcs = {14931493+ .dpms = drm_helper_connector_dpms,14941494+ .detect = radeon_dp_detect,14951495+ .fill_modes = drm_helper_probe_single_connector_modes,14961496+ .set_property = radeon_lvds_set_property,14971497+ .destroy = radeon_dp_connector_destroy,14981498+ .force = radeon_dvi_force,14991499+};15001500+15011501+static const struct drm_connector_funcs radeon_lvds_bridge_connector_funcs = {15021502+ .dpms = drm_helper_connector_dpms,15031503+ .detect = radeon_dp_detect,15041504+ .fill_modes = drm_helper_probe_single_connector_modes,15051505+ .set_property = radeon_lvds_set_property,15031506 .destroy = radeon_dp_connector_destroy,15041507 .force = radeon_dvi_force,15051508};···16131580 goto failed;16141581 radeon_dig_connector->igp_lane_info = igp_lane_info;16151582 radeon_connector->con_priv = radeon_dig_connector;16161616- drm_connector_init(dev, &radeon_connector->base, &radeon_dp_connector_funcs, connector_type);16171617- drm_connector_helper_add(&radeon_connector->base, &radeon_dp_connector_helper_funcs);16181583 if (i2c_bus->valid) {16191584 /* add DP i2c bus */16201585 if (connector_type == DRM_MODE_CONNECTOR_eDP)···16291598 case DRM_MODE_CONNECTOR_VGA:16301599 case DRM_MODE_CONNECTOR_DVIA:16311600 default:16011601+ drm_connector_init(dev, &radeon_connector->base,16021602+ &radeon_dp_connector_funcs, connector_type);16031603+ drm_connector_helper_add(&radeon_connector->base,16041604+ &radeon_dp_connector_helper_funcs);16321605 connector->interlace_allowed = true;16331606 connector->doublescan_allowed = true;16341607 radeon_connector->dac_load_detect = true;···16451610 case DRM_MODE_CONNECTOR_HDMIA:16461611 case DRM_MODE_CONNECTOR_HDMIB:16471612 case DRM_MODE_CONNECTOR_DisplayPort:16131613+ drm_connector_init(dev, &radeon_connector->base,16141614+ &radeon_dp_connector_funcs, connector_type);16151615+ drm_connector_helper_add(&radeon_connector->base,16161616+ &radeon_dp_connector_helper_funcs);16481617 drm_object_attach_property(&radeon_connector->base.base,16491618 rdev->mode_info.underscan_property,16501619 UNDERSCAN_OFF);···16581619 drm_object_attach_property(&radeon_connector->base.base,16591620 rdev->mode_info.underscan_vborder_property,16601621 0);16221622+ drm_object_attach_property(&radeon_connector->base.base,16231623+ rdev->mode_info.audio_property,16241624+ RADEON_AUDIO_DISABLE);16611625 subpixel_order = SubPixelHorizontalRGB;16621626 connector->interlace_allowed = true;16631627 if (connector_type == DRM_MODE_CONNECTOR_HDMIB)···16761634 break;16771635 case DRM_MODE_CONNECTOR_LVDS:16781636 case DRM_MODE_CONNECTOR_eDP:16371637+ drm_connector_init(dev, &radeon_connector->base,16381638+ &radeon_lvds_bridge_connector_funcs, connector_type);16391639+ drm_connector_helper_add(&radeon_connector->base,16401640+ &radeon_dp_connector_helper_funcs);16791641 drm_object_attach_property(&radeon_connector->base.base,16801642 dev->mode_config.scaling_mode_property,16811643 DRM_MODE_SCALE_FULLSCREEN);···17541708 rdev->mode_info.underscan_vborder_property,17551709 0);17561710 }17111711+ if (ASIC_IS_DCE2(rdev)) {17121712+ drm_object_attach_property(&radeon_connector->base.base,17131713+ rdev->mode_info.audio_property,17141714+ RADEON_AUDIO_DISABLE);17151715+ }17571716 if (connector_type == DRM_MODE_CONNECTOR_DVII) {17581717 radeon_connector->dac_load_detect = true;17591718 drm_object_attach_property(&radeon_connector->base.base,···17991748 rdev->mode_info.underscan_vborder_property,18001749 0);18011750 }17511751+ if (ASIC_IS_DCE2(rdev)) {17521752+ drm_object_attach_property(&radeon_connector->base.base,17531753+ rdev->mode_info.audio_property,17541754+ RADEON_AUDIO_DISABLE);17551755+ }18021756 subpixel_order = SubPixelHorizontalRGB;18031757 connector->interlace_allowed = true;18041758 if (connector_type == DRM_MODE_CONNECTOR_HDMIB)···18431787 rdev->mode_info.underscan_vborder_property,18441788 0);18451789 }17901790+ if (ASIC_IS_DCE2(rdev)) {17911791+ drm_object_attach_property(&radeon_connector->base.base,17921792+ rdev->mode_info.audio_property,17931793+ RADEON_AUDIO_DISABLE);17941794+ }18461795 connector->interlace_allowed = true;18471796 /* in theory with a DP to VGA converter... */18481797 connector->doublescan_allowed = false;···18581797 goto failed;18591798 radeon_dig_connector->igp_lane_info = igp_lane_info;18601799 radeon_connector->con_priv = radeon_dig_connector;18611861- drm_connector_init(dev, &radeon_connector->base, &radeon_dp_connector_funcs, connector_type);18001800+ drm_connector_init(dev, &radeon_connector->base, &radeon_edp_connector_funcs, connector_type);18621801 drm_connector_helper_add(&radeon_connector->base, &radeon_dp_connector_helper_funcs);18631802 if (i2c_bus->valid) {18641803 /* add DP i2c bus */
+8-3
drivers/gpu/drm/radeon/radeon_cs.c
···2828#include <drm/radeon_drm.h>2929#include "radeon_reg.h"3030#include "radeon.h"3131+#include "radeon_trace.h"31323233static int radeon_cs_parser_relocs(struct radeon_cs_parser *p)3334{···8180 p->relocs[i].lobj.bo = p->relocs[i].robj;8281 p->relocs[i].lobj.written = !!r->write_domain;83828484- /* the first reloc of an UVD job is the8585- msg and that must be in VRAM */8686- if (p->ring == R600_RING_TYPE_UVD_INDEX && i == 0) {8383+ /* the first reloc of an UVD job is the msg and that must be in8484+ VRAM, also but everything into VRAM on AGP cards to avoid8585+ image corruptions */8686+ if (p->ring == R600_RING_TYPE_UVD_INDEX &&8787+ (i == 0 || p->rdev->flags & RADEON_IS_AGP)) {8788 /* TODO: is this still needed for NI+ ? */8889 p->relocs[i].lobj.domain =8990 RADEON_GEM_DOMAIN_VRAM;···561558 r = radeon_cs_handle_lockup(rdev, r);562559 return r;563560 }561561+562562+ trace_radeon_cs(&parser);564563565564 r = radeon_cs_ib_chunk(rdev, &parser);566565 if (r) {
···170170 ttm_tt_unbind(ttm);171171 }172172173173- if (likely(ttm->pages != NULL)) {173173+ if (ttm->state == tt_unbound) {174174 ttm->bdev->driver->ttm_tt_unpopulate(ttm);175175 }176176
-1
drivers/gpu/drm/udl/udl_gem.c
···9797 ret = vm_insert_page(vma, (unsigned long)vmf->virtual_address, page);9898 switch (ret) {9999 case -EAGAIN:100100- set_need_resched();101100 case 0:102101 case -ERESTARTSYS:103102 return VM_FAULT_NOPAGE;
+65-9
drivers/hid/hid-core.c
···9494static struct hid_field *hid_register_field(struct hid_report *report, unsigned usages, unsigned values)9595{9696 struct hid_field *field;9797- int i;98979998 if (report->maxfield == HID_MAX_FIELDS) {10099 hid_err(report->device, "too many fields in report\n");···111112 field->usage = (struct hid_usage *)(field + 1);112113 field->value = (s32 *)(field->usage + usages);113114 field->report = report;114114-115115- for (i = 0; i < usages; i++)116116- field->usage[i].usage_index = i;117115118116 return field;119117}···222226{223227 struct hid_report *report;224228 struct hid_field *field;225225- int usages;229229+ unsigned usages;226230 unsigned offset;227227- int i;231231+ unsigned i;228232229233 report = hid_register_report(parser->device, report_type, parser->global.report_id);230234 if (!report) {···251255 if (!parser->local.usage_index) /* Ignore padding fields */252256 return 0;253257254254- usages = max_t(int, parser->local.usage_index, parser->global.report_count);258258+ usages = max_t(unsigned, parser->local.usage_index,259259+ parser->global.report_count);255260256261 field = hid_register_field(report, usages, parser->global.report_count);257262 if (!field)···263266 field->application = hid_lookup_collection(parser, HID_COLLECTION_APPLICATION);264267265268 for (i = 0; i < usages; i++) {266266- int j = i;269269+ unsigned j = i;267270 /* Duplicate the last usage we parsed if we have excess values */268271 if (i >= parser->local.usage_index)269272 j = parser->local.usage_index - 1;270273 field->usage[i].hid = parser->local.usage[j];271274 field->usage[i].collection_index =272275 parser->local.collection_index[j];276276+ field->usage[i].usage_index = i;273277 }274278275279 field->maxusage = usages;···799801}800802EXPORT_SYMBOL_GPL(hid_parse_report);801803804804+static const char * const hid_report_names[] = {805805+ "HID_INPUT_REPORT",806806+ "HID_OUTPUT_REPORT",807807+ "HID_FEATURE_REPORT",808808+};809809+/**810810+ * hid_validate_values - validate existing device report's value indexes811811+ *812812+ * @device: hid device813813+ * @type: which report type to examine814814+ * @id: which report ID to examine (0 for first)815815+ * @field_index: which report field to examine816816+ * @report_counts: expected number of values817817+ *818818+ * Validate the number of values in a given field of a given report, after819819+ * parsing.820820+ */821821+struct hid_report *hid_validate_values(struct hid_device *hid,822822+ unsigned int type, unsigned int id,823823+ unsigned int field_index,824824+ unsigned int report_counts)825825+{826826+ struct hid_report *report;827827+828828+ if (type > HID_FEATURE_REPORT) {829829+ hid_err(hid, "invalid HID report type %u\n", type);830830+ return NULL;831831+ }832832+833833+ if (id >= HID_MAX_IDS) {834834+ hid_err(hid, "invalid HID report id %u\n", id);835835+ return NULL;836836+ }837837+838838+ /*839839+ * Explicitly not using hid_get_report() here since it depends on840840+ * ->numbered being checked, which may not always be the case when841841+ * drivers go to access report values.842842+ */843843+ report = hid->report_enum[type].report_id_hash[id];844844+ if (!report) {845845+ hid_err(hid, "missing %s %u\n", hid_report_names[type], id);846846+ return NULL;847847+ }848848+ if (report->maxfield <= field_index) {849849+ hid_err(hid, "not enough fields in %s %u\n",850850+ hid_report_names[type], id);851851+ return NULL;852852+ }853853+ if (report->field[field_index]->report_count < report_counts) {854854+ hid_err(hid, "not enough values in %s %u field %u\n",855855+ hid_report_names[type], id, field_index);856856+ return NULL;857857+ }858858+ return report;859859+}860860+EXPORT_SYMBOL_GPL(hid_validate_values);861861+802862/**803863 * hid_open_report - open a driver-specific device report804864 *···13521296 goto out;13531297 }1354129813551355- if (hid->claimed != HID_CLAIMED_HIDRAW) {12991299+ if (hid->claimed != HID_CLAIMED_HIDRAW && report->maxfield) {13561300 for (a = 0; a < report->maxfield; a++)13571301 hid_input_field(hid, report->field[a], cdata, interrupt);13581302 hdrv = hid->driver;
+10-1
drivers/hid/hid-input.c
···485485 if (field->flags & HID_MAIN_ITEM_CONSTANT)486486 goto ignore;487487488488+ /* Ignore if report count is out of bounds. */489489+ if (field->report_count < 1)490490+ goto ignore;491491+488492 /* only LED usages are supported in output fields */489493 if (field->report_type == HID_OUTPUT_REPORT &&490494 (usage->hid & HID_USAGE_PAGE) != HID_UP_LED) {···1240123612411237 rep_enum = &hid->report_enum[HID_FEATURE_REPORT];12421238 list_for_each_entry(rep, &rep_enum->report_list, list)12431243- for (i = 0; i < rep->maxfield; i++)12391239+ for (i = 0; i < rep->maxfield; i++) {12401240+ /* Ignore if report count is out of bounds. */12411241+ if (rep->field[i]->report_count < 1)12421242+ continue;12431243+12441244 for (j = 0; j < rep->field[i]->maxusage; j++) {12451245 /* Verify if Battery Strength feature is available */12461246 hidinput_setup_battery(hid, HID_FEATURE_REPORT, rep->field[i]);···12531245 drv->feature_mapping(hid, rep->field[i],12541246 rep->field[i]->usage + j);12551247 }12481248+ }12561249}1257125012581251static struct hid_input *hidinput_allocate(struct hid_device *hid)
+19-6
drivers/hid/hid-lenovo-tpkbd.c
···339339 struct tpkbd_data_pointer *data_pointer;340340 size_t name_sz = strlen(dev_name(dev)) + 16;341341 char *name_mute, *name_micmute;342342- int ret;342342+ int i, ret;343343+344344+ /* Validate required reports. */345345+ for (i = 0; i < 4; i++) {346346+ if (!hid_validate_values(hdev, HID_FEATURE_REPORT, 4, i, 1))347347+ return -ENODEV;348348+ }349349+ if (!hid_validate_values(hdev, HID_OUTPUT_REPORT, 3, 0, 2))350350+ return -ENODEV;343351344352 if (sysfs_create_group(&hdev->dev.kobj,345353 &tpkbd_attr_group_pointer)) {···414406 ret = hid_parse(hdev);415407 if (ret) {416408 hid_err(hdev, "hid_parse failed\n");417417- goto err_free;409409+ goto err;418410 }419411420412 ret = hid_hw_start(hdev, HID_CONNECT_DEFAULT);421413 if (ret) {422414 hid_err(hdev, "hid_hw_start failed\n");423423- goto err_free;415415+ goto err;424416 }425417426418 uhdev = (struct usbhid_device *) hdev->driver_data;427419428428- if (uhdev->ifnum == 1)429429- return tpkbd_probe_tp(hdev);420420+ if (uhdev->ifnum == 1) {421421+ ret = tpkbd_probe_tp(hdev);422422+ if (ret)423423+ goto err_hid;424424+ }430425431426 return 0;432432-err_free:427427+err_hid:428428+ hid_hw_stop(hdev);429429+err:433430 return ret;434431}435432
+3-16
drivers/hid/hid-lg2ff.c
···6464 struct hid_report *report;6565 struct hid_input *hidinput = list_entry(hid->inputs.next,6666 struct hid_input, list);6767- struct list_head *report_list =6868- &hid->report_enum[HID_OUTPUT_REPORT].report_list;6967 struct input_dev *dev = hidinput->input;7068 int error;71697272- if (list_empty(report_list)) {7373- hid_err(hid, "no output report found\n");7070+ /* Check that the report looks ok */7171+ report = hid_validate_values(hid, HID_OUTPUT_REPORT, 0, 0, 7);7272+ if (!report)7473 return -ENODEV;7575- }7676-7777- report = list_entry(report_list->next, struct hid_report, list);7878-7979- if (report->maxfield < 1) {8080- hid_err(hid, "output report is empty\n");8181- return -ENODEV;8282- }8383- if (report->field[0]->report_count < 7) {8484- hid_err(hid, "not enough values in the field\n");8585- return -ENODEV;8686- }87748875 lg2ff = kmalloc(sizeof(struct lg2ff_device), GFP_KERNEL);8976 if (!lg2ff)
+6-23
drivers/hid/hid-lg3ff.c
···6666 int x, y;67676868/*6969- * Maxusage should always be 63 (maximum fields)7070- * likely a better way to ensure this data is clean6969+ * Available values in the field should always be 63, but we only use up to7070+ * 35. Instead, clear the entire area, however big it is.7171 */7272- memset(report->field[0]->value, 0, sizeof(__s32)*report->field[0]->maxusage);7272+ memset(report->field[0]->value, 0,7373+ sizeof(__s32) * report->field[0]->report_count);73747475 switch (effect->type) {7576 case FF_CONSTANT:···130129int lg3ff_init(struct hid_device *hid)131130{132131 struct hid_input *hidinput = list_entry(hid->inputs.next, struct hid_input, list);133133- struct list_head *report_list = &hid->report_enum[HID_OUTPUT_REPORT].report_list;134132 struct input_dev *dev = hidinput->input;135135- struct hid_report *report;136136- struct hid_field *field;137133 const signed short *ff_bits = ff3_joystick_ac;138134 int error;139135 int i;140136141141- /* Find the report to use */142142- if (list_empty(report_list)) {143143- hid_err(hid, "No output report found\n");144144- return -1;145145- }146146-147137 /* Check that the report looks ok */148148- report = list_entry(report_list->next, struct hid_report, list);149149- if (!report) {150150- hid_err(hid, "NULL output report\n");151151- return -1;152152- }153153-154154- field = report->field[0];155155- if (!field) {156156- hid_err(hid, "NULL field\n");157157- return -1;158158- }138138+ if (!hid_validate_values(hid, HID_OUTPUT_REPORT, 0, 0, 35))139139+ return -ENODEV;159140160141 /* Assume single fixed device G940 */161142 for (i = 0; ff_bits[i] >= 0; i++)
+1-19
drivers/hid/hid-lg4ff.c
···484484int lg4ff_init(struct hid_device *hid)485485{486486 struct hid_input *hidinput = list_entry(hid->inputs.next, struct hid_input, list);487487- struct list_head *report_list = &hid->report_enum[HID_OUTPUT_REPORT].report_list;488487 struct input_dev *dev = hidinput->input;489489- struct hid_report *report;490490- struct hid_field *field;491488 struct lg4ff_device_entry *entry;492489 struct lg_drv_data *drv_data;493490 struct usb_device_descriptor *udesc;494491 int error, i, j;495492 __u16 bcdDevice, rev_maj, rev_min;496493497497- /* Find the report to use */498498- if (list_empty(report_list)) {499499- hid_err(hid, "No output report found\n");500500- return -1;501501- }502502-503494 /* Check that the report looks ok */504504- report = list_entry(report_list->next, struct hid_report, list);505505- if (!report) {506506- hid_err(hid, "NULL output report\n");495495+ if (!hid_validate_values(hid, HID_OUTPUT_REPORT, 0, 0, 7))507496 return -1;508508- }509509-510510- field = report->field[0];511511- if (!field) {512512- hid_err(hid, "NULL field\n");513513- return -1;514514- }515497516498 /* Check what wheel has been connected */517499 for (i = 0; i < ARRAY_SIZE(lg4ff_devices); i++) {
+2-15
drivers/hid/hid-lgff.c
···128128int lgff_init(struct hid_device* hid)129129{130130 struct hid_input *hidinput = list_entry(hid->inputs.next, struct hid_input, list);131131- struct list_head *report_list = &hid->report_enum[HID_OUTPUT_REPORT].report_list;132131 struct input_dev *dev = hidinput->input;133133- struct hid_report *report;134134- struct hid_field *field;135132 const signed short *ff_bits = ff_joystick;136133 int error;137134 int i;138135139139- /* Find the report to use */140140- if (list_empty(report_list)) {141141- hid_err(hid, "No output report found\n");142142- return -1;143143- }144144-145136 /* Check that the report looks ok */146146- report = list_entry(report_list->next, struct hid_report, list);147147- field = report->field[0];148148- if (!field) {149149- hid_err(hid, "NULL field\n");150150- return -1;151151- }137137+ if (!hid_validate_values(hid, HID_OUTPUT_REPORT, 0, 0, 7))138138+ return -ENODEV;152139153140 for (i = 0; i < ARRAY_SIZE(devices); i++) {154141 if (dev->id.vendor == devices[i].idVendor &&
+8-2
drivers/hid/hid-logitech-dj.c
···461461 struct hid_report *report;462462 struct hid_report_enum *output_report_enum;463463 u8 *data = (u8 *)(&dj_report->device_index);464464- int i;464464+ unsigned int i;465465466466 output_report_enum = &hdev->report_enum[HID_OUTPUT_REPORT];467467 report = output_report_enum->report_id_hash[REPORT_ID_DJ_SHORT];···471471 return -ENODEV;472472 }473473474474- for (i = 0; i < report->field[0]->report_count; i++)474474+ for (i = 0; i < DJREPORT_SHORT_LENGTH - 1; i++)475475 report->field[0]->value[i] = data[i];476476477477 hid_hw_request(hdev, report, HID_REQ_SET_REPORT);···788788 if (retval) {789789 dev_err(&hdev->dev,790790 "%s:parse of interface 2 failed\n", __func__);791791+ goto hid_parse_fail;792792+ }793793+794794+ if (!hid_validate_values(hdev, HID_OUTPUT_REPORT, REPORT_ID_DJ_SHORT,795795+ 0, DJREPORT_SHORT_LENGTH - 1)) {796796+ retval = -ENODEV;791797 goto hid_parse_fail;792798 }793799
+14-12
drivers/hid/hid-multitouch.c
···101101 unsigned last_slot_field; /* the last field of a slot */102102 unsigned mt_report_id; /* the report ID of the multitouch device */103103 unsigned pen_report_id; /* the report ID of the pen device */104104- __s8 inputmode; /* InputMode HID feature, -1 if non-existent */105105- __s8 inputmode_index; /* InputMode HID feature index in the report */106106- __s8 maxcontact_report_id; /* Maximum Contact Number HID feature,104104+ __s16 inputmode; /* InputMode HID feature, -1 if non-existent */105105+ __s16 inputmode_index; /* InputMode HID feature index in the report */106106+ __s16 maxcontact_report_id; /* Maximum Contact Number HID feature,107107 -1 if non-existent */108108 __u8 num_received; /* how many contacts we received */109109 __u8 num_expected; /* expected last contact index */···312312 struct hid_field *field, struct hid_usage *usage)313313{314314 struct mt_device *td = hid_get_drvdata(hdev);315315- int i;316315317316 switch (usage->hid) {318317 case HID_DG_INPUTMODE:319319- td->inputmode = field->report->id;320320- td->inputmode_index = 0; /* has to be updated below */321321-322322- for (i=0; i < field->maxusage; i++) {323323- if (field->usage[i].hid == usage->hid) {324324- td->inputmode_index = i;325325- break;326326- }318318+ /* Ignore if value index is out of bounds. */319319+ if (usage->usage_index >= field->report_count) {320320+ dev_err(&hdev->dev, "HID_DG_INPUTMODE out of range\n");321321+ break;327322 }323323+324324+ td->inputmode = field->report->id;325325+ td->inputmode_index = usage->usage_index;328326329327 break;330328 case HID_DG_CONTACTMAX:···509511 mt_store_field(usage, td, hi);510512 return 1;511513 case HID_DG_CONTACTCOUNT:514514+ /* Ignore if indexes are out of bounds. */515515+ if (field->index >= field->report->maxfield ||516516+ usage->usage_index >= field->report_count)517517+ return 1;512518 td->cc_index = field->index;513519 td->cc_value_index = usage->usage_index;514520 return 1;
···22952295static void22962296hfcpci_softirq(void *arg)22972297{22982298- (void) driver_for_each_device(&hfc_driver.driver, NULL, arg,22992299- _hfcpci_softirq);22982298+ WARN_ON_ONCE(driver_for_each_device(&hfc_driver.driver, NULL, arg,22992299+ _hfcpci_softirq) != 0);2300230023012301 /* if next event would be in the past ... */23022302 if ((s32)(hfc_jiffies + tics - jiffies) <= 0)
+2-2
drivers/isdn/hisax/amd7930_fn.c
···314314315315 t += sprintf(t, "Amd7930: empty_Dfifo cnt: %d |", cs->rcvidx);316316 QuickHex(t, cs->rcvbuf, cs->rcvidx);317317- debugl1(cs, cs->dlog);317317+ debugl1(cs, "%s", cs->dlog);318318 }319319 /* moves received data in sk-buffer */320320 memcpy(skb_put(skb, cs->rcvidx), cs->rcvbuf, cs->rcvidx);···406406407407 t += sprintf(t, "Amd7930: fill_Dfifo cnt: %d |", count);408408 QuickHex(t, deb_ptr, count);409409- debugl1(cs, cs->dlog);409409+ debugl1(cs, "%s", cs->dlog);410410 }411411 /* AMD interrupts on */412412 AmdIrqOn(cs);
···14721472 bond_info->lp_counter++;1473147314741474 /* send learning packets */14751475- if (bond_info->lp_counter >= BOND_ALB_LP_TICKS) {14751475+ if (bond_info->lp_counter >= BOND_ALB_LP_TICKS(bond)) {14761476 /* change of curr_active_slave involves swapping of mac addresses.14771477 * in order to avoid this swapping from happening while14781478 * sending the learning packets, the curr_slave_lock must be held for
+5-4
drivers/net/bonding/bond_alb.h
···3636 * Used for division - never set3737 * to zero !!!3838 */3939-#define BOND_ALB_LP_INTERVAL 1 /* In seconds, periodic send of4040- * learning packets to the switch4141- */3939+#define BOND_ALB_DEFAULT_LP_INTERVAL 14040+#define BOND_ALB_LP_INTERVAL(bond) (bond->params.lp_interval) /* In seconds, periodic send of4141+ * learning packets to the switch4242+ */42434344#define BOND_TLB_REBALANCE_TICKS (BOND_TLB_REBALANCE_INTERVAL \4445 * ALB_TIMER_TICKS_PER_SEC)45464646-#define BOND_ALB_LP_TICKS (BOND_ALB_LP_INTERVAL \4747+#define BOND_ALB_LP_TICKS(bond) (BOND_ALB_LP_INTERVAL(bond) \4748 * ALB_TIMER_TICKS_PER_SEC)48494950#define TLB_HASH_TABLE_SIZE 256 /* The size of the clients hash table.
···246246 BNX2X_MAX_CNIC_ETH_CL_ID_IDX,247247};248248249249-#define BNX2X_CNIC_START_ETH_CID(bp) (BNX2X_NUM_NON_CNIC_QUEUES(bp) *\249249+/* use a value high enough to be above all the PFs, which has least significant250250+ * nibble as 8, so when cnic needs to come up with a CID for UIO to use to251251+ * calculate doorbell address according to old doorbell configuration scheme252252+ * (db_msg_sz 1 << 7 * cid + 0x40 DPM offset) it can come up with a valid number253253+ * We must avoid coming up with cid 8 for iscsi since according to this method254254+ * the designated UIO cid will come out 0 and it has a special handling for that255255+ * case which doesn't suit us. Therefore will will cieling to closes cid which256256+ * has least signigifcant nibble 8 and if it is 8 we will move forward to 0x18.257257+ */258258+259259+#define BNX2X_1st_NON_L2_ETH_CID(bp) (BNX2X_NUM_NON_CNIC_QUEUES(bp) * \250260 (bp)->max_cos)261261+/* amount of cids traversed by UIO's DPM addition to doorbell */262262+#define UIO_DPM 8263263+/* roundup to DPM offset */264264+#define UIO_ROUNDUP(bp) (roundup(BNX2X_1st_NON_L2_ETH_CID(bp), \265265+ UIO_DPM))266266+/* offset to nearest value which has lsb nibble matching DPM */267267+#define UIO_CID_OFFSET(bp) ((UIO_ROUNDUP(bp) + UIO_DPM) % \268268+ (UIO_DPM * 2))269269+/* add offset to rounded-up cid to get a value which could be used with UIO */270270+#define UIO_DPM_ALIGN(bp) (UIO_ROUNDUP(bp) + UIO_CID_OFFSET(bp))271271+/* but wait - avoid UIO special case for cid 0 */272272+#define UIO_DPM_CID0_OFFSET(bp) ((UIO_DPM * 2) * \273273+ (UIO_DPM_ALIGN(bp) == UIO_DPM))274274+/* Properly DPM aligned CID dajusted to cid 0 secal case */275275+#define BNX2X_CNIC_START_ETH_CID(bp) (UIO_DPM_ALIGN(bp) + \276276+ (UIO_DPM_CID0_OFFSET(bp)))277277+/* how many cids were wasted - need this value for cid allocation */278278+#define UIO_CID_PAD(bp) (BNX2X_CNIC_START_ETH_CID(bp) - \279279+ BNX2X_1st_NON_L2_ETH_CID(bp))251280 /* iSCSI L2 */252281#define BNX2X_ISCSI_ETH_CID(bp) (BNX2X_CNIC_START_ETH_CID(bp))253282 /* FCoE L2 */···15711542 */15721543 bool fcoe_init;1573154415741574- int pm_cap;15751545 int mrrs;1576154615771547 struct delayed_work sp_task;···17091681 * Maximum CID count that might be required by the bnx2x:17101682 * Max RSS * Max_Tx_Multi_Cos + FCoE + iSCSI17111683 */16841684+17121685#define BNX2X_L2_CID_COUNT(bp) (BNX2X_NUM_ETH_QUEUES(bp) * BNX2X_MULTI_TX_COS \17131713- + 2 * CNIC_SUPPORT(bp))16861686+ + CNIC_SUPPORT(bp) * (2 + UIO_CID_PAD(bp)))17141687#define BNX2X_L2_MAX_CID(bp) (BNX2X_MAX_RSS_COUNT(bp) * BNX2X_MULTI_TX_COS \17151715- + 2 * CNIC_SUPPORT(bp))16881688+ + CNIC_SUPPORT(bp) * (2 + UIO_CID_PAD(bp)))17161689#define L2_ILT_LINES(bp) (DIV_ROUND_UP(BNX2X_L2_CID_COUNT(bp),\17171690 ILT_PAGE_CIDS))17181691
+4-4
drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c
···30083008 u16 pmcsr;3009300930103010 /* If there is no power capability, silently succeed */30113011- if (!bp->pm_cap) {30113011+ if (!bp->pdev->pm_cap) {30123012 BNX2X_DEV_INFO("No power capability. Breaking.\n");30133013 return 0;30143014 }3015301530163016- pci_read_config_word(bp->pdev, bp->pm_cap + PCI_PM_CTRL, &pmcsr);30163016+ pci_read_config_word(bp->pdev, bp->pdev->pm_cap + PCI_PM_CTRL, &pmcsr);3017301730183018 switch (state) {30193019 case PCI_D0:30203020- pci_write_config_word(bp->pdev, bp->pm_cap + PCI_PM_CTRL,30203020+ pci_write_config_word(bp->pdev, bp->pdev->pm_cap + PCI_PM_CTRL,30213021 ((pmcsr & ~PCI_PM_CTRL_STATE_MASK) |30223022 PCI_PM_CTRL_PME_STATUS));30233023···30413041 if (bp->wol)30423042 pmcsr |= PCI_PM_CTRL_PME_ENABLE;3043304330443044- pci_write_config_word(bp->pdev, bp->pm_cap + PCI_PM_CTRL,30443044+ pci_write_config_word(bp->pdev, bp->pdev->pm_cap + PCI_PM_CTRL,30453045 pmcsr);3046304630473047 /* No more memory access after this point until
···922922 else923923 mask &= ~(1 << 30);924924 }925925+ if (mac->type == e1000_pch2lan) {926926+ /* SHRAH[0,1,2] different than previous */927927+ if (i == 7)928928+ mask &= 0xFFF4FFFF;929929+ /* SHRAH[3] different than SHRAH[0,1,2] */930930+ if (i == 10)931931+ mask |= (1 << 30);932932+ }925933926934 REG_PATTERN_TEST_ARRAY(E1000_RA, ((i << 1) + 1), mask,927935 0xFFFFFFFF);
+8-5
drivers/net/ethernet/intel/e1000e/ich8lan.c
···13711371 return;13721372 }1373137313741374- if (index < hw->mac.rar_entry_count) {13741374+ /* RAR[1-6] are owned by manageability. Skip those and program the13751375+ * next address into the SHRA register array.13761376+ */13771377+ if (index < (u32)(hw->mac.rar_entry_count - 6)) {13751378 s32 ret_val;1376137913771380 ret_val = e1000_acquire_swflag_ich8lan(hw);···19651962 if (ret_val)19661963 goto release;1967196419681968- /* Copy both RAL/H (rar_entry_count) and SHRAL/H (+4) to PHY */19691969- for (i = 0; i < (hw->mac.rar_entry_count + 4); i++) {19651965+ /* Copy both RAL/H (rar_entry_count) and SHRAL/H to PHY */19661966+ for (i = 0; i < (hw->mac.rar_entry_count); i++) {19701967 mac_reg = er32(RAL(i));19711968 hw->phy.ops.write_reg_page(hw, BM_RAR_L(i),19721969 (u16)(mac_reg & 0xFFFF));···20102007 return ret_val;2011200820122009 if (enable) {20132013- /* Write Rx addresses (rar_entry_count for RAL/H, +4 for20102010+ /* Write Rx addresses (rar_entry_count for RAL/H, and20142011 * SHRAL/H) and initial CRC values to the MAC20152012 */20162016- for (i = 0; i < (hw->mac.rar_entry_count + 4); i++) {20132013+ for (i = 0; i < hw->mac.rar_entry_count; i++) {20172014 u8 mac_addr[ETH_ALEN] = { 0 };20182015 u32 addr_high, addr_low;20192016
···719719 u32 ctrl_ext;720720 u32 mdic;721721722722+ /* Extra read required for some PHY's on i354 */723723+ if (hw->mac.type == e1000_i354)724724+ igb_get_phy_id(hw);725725+722726 /* For SGMII PHYs, we try the list of possible addresses until723727 * we find one that works. For non-SGMII PHYs724728 * (e.g. integrated copper PHYs), an address of 1 should
+9-1
drivers/net/ethernet/intel/igb/e1000_mac.c
···712712static s32 igb_set_default_fc(struct e1000_hw *hw)713713{714714 s32 ret_val = 0;715715+ u16 lan_offset;715716 u16 nvm_data;716717717718 /* Read and store word 0x0F of the EEPROM. This word contains bits···723722 * control setting, then the variable hw->fc will724723 * be initialized based on a value in the EEPROM.725724 */726726- ret_val = hw->nvm.ops.read(hw, NVM_INIT_CONTROL2_REG, 1, &nvm_data);725725+ if (hw->mac.type == e1000_i350) {726726+ lan_offset = NVM_82580_LAN_FUNC_OFFSET(hw->bus.func);727727+ ret_val = hw->nvm.ops.read(hw, NVM_INIT_CONTROL2_REG728728+ + lan_offset, 1, &nvm_data);729729+ } else {730730+ ret_val = hw->nvm.ops.read(hw, NVM_INIT_CONTROL2_REG,731731+ 1, &nvm_data);732732+ }727733728734 if (ret_val) {729735 hw_dbg("NVM Read Error\n");
+25
drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c
···160160 bool autoneg = false;161161 bool link_up;162162163163+ /* SFP type is needed for get_link_capabilities */164164+ if (hw->phy.media_type & (ixgbe_media_type_fiber |165165+ ixgbe_media_type_fiber_qsfp)) {166166+ if (hw->phy.sfp_type == ixgbe_sfp_type_not_present)167167+ hw->phy.ops.identify_sfp(hw);168168+ }169169+163170 hw->mac.ops.get_link_capabilities(hw, &supported_link, &autoneg);164171165172 /* set the supported link speeds */···193186 ecmd->advertising |= ADVERTISED_1000baseT_Full;194187 if (supported_link & IXGBE_LINK_SPEED_100_FULL)195188 ecmd->advertising |= ADVERTISED_100baseT_Full;189189+190190+ if (hw->phy.multispeed_fiber && !autoneg) {191191+ if (supported_link & IXGBE_LINK_SPEED_10GB_FULL)192192+ ecmd->advertising = ADVERTISED_10000baseT_Full;193193+ }196194 }197195198196 if (autoneg) {···325313 */326314 if (ecmd->advertising & ~ecmd->supported)327315 return -EINVAL;316316+317317+ /* only allow one speed at a time if no autoneg */318318+ if (!ecmd->autoneg && hw->phy.multispeed_fiber) {319319+ if (ecmd->advertising ==320320+ (ADVERTISED_10000baseT_Full |321321+ ADVERTISED_1000baseT_Full))322322+ return -EINVAL;323323+ }328324329325 old = hw->phy.autoneg_advertised;330326 advertised = 0;···18251805 unsigned int size = 1024;18261806 netdev_tx_t tx_ret_val;18271807 struct sk_buff *skb;18081808+ u32 flags_orig = adapter->flags;18091809+18101810+ /* DCB can modify the frames on Tx */18111811+ adapter->flags &= ~IXGBE_FLAG_DCB_ENABLED;1828181218291813 /* allocate test skb */18301814 skb = alloc_skb(size, GFP_KERNEL);···1881185718821858 /* free the original skb */18831859 kfree_skb(skb);18601860+ adapter->flags = flags_orig;1884186118851862 return ret_val;18861863}
+17-2
drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
···35713571{35723572 struct ixgbe_hw *hw = &adapter->hw;35733573 int i;35743574- u32 rxctrl;35743574+ u32 rxctrl, rfctl;3575357535763576 /* disable receives while setting up the descriptors */35773577 rxctrl = IXGBE_READ_REG(hw, IXGBE_RXCTRL);···3579357935803580 ixgbe_setup_psrtype(adapter);35813581 ixgbe_setup_rdrxctl(adapter);35823582+35833583+ /* RSC Setup */35843584+ rfctl = IXGBE_READ_REG(hw, IXGBE_RFCTL);35853585+ rfctl &= ~IXGBE_RFCTL_RSC_DIS;35863586+ if (!(adapter->flags2 & IXGBE_FLAG2_RSC_ENABLED))35873587+ rfctl |= IXGBE_RFCTL_RSC_DIS;35883588+ IXGBE_WRITE_REG(hw, IXGBE_RFCTL, rfctl);3582358935833590 /* Program registers for the distribution of queues */35843591 ixgbe_setup_mrqc(adapter);···60005993 adapter->flags &= ~IXGBE_FLAG_NEED_LINK_CONFIG;6001599460025995 speed = hw->phy.autoneg_advertised;60036003- if ((!speed) && (hw->mac.ops.get_link_capabilities))59965996+ if ((!speed) && (hw->mac.ops.get_link_capabilities)) {60045997 hw->mac.ops.get_link_capabilities(hw, &speed, &autoneg);59985998+59995999+ /* setup the highest link when no autoneg */60006000+ if (!autoneg) {60016001+ if (speed & IXGBE_LINK_SPEED_10GB_FULL)60026002+ speed = IXGBE_LINK_SPEED_10GB_FULL;60036003+ }60046004+ }60056005+60056006 if (hw->mac.ops.setup_link)60066007 hw->mac.ops.setup_link(hw, speed, true);60076008
···5353 for (i = 0; i < priv->tx_ring_num; i++) {5454 priv->tx_cq[i].moder_cnt = priv->tx_frames;5555 priv->tx_cq[i].moder_time = priv->tx_usecs;5656- err = mlx4_en_set_cq_moder(priv, &priv->tx_cq[i]);5757- if (err)5858- return err;5656+ if (priv->port_up) {5757+ err = mlx4_en_set_cq_moder(priv, &priv->tx_cq[i]);5858+ if (err)5959+ return err;6060+ }5961 }60626163 if (priv->adaptive_rx_coal)···6765 priv->rx_cq[i].moder_cnt = priv->rx_frames;6866 priv->rx_cq[i].moder_time = priv->rx_usecs;6967 priv->last_moder_time[i] = MLX4_EN_AUTO_CONF;7070- err = mlx4_en_set_cq_moder(priv, &priv->rx_cq[i]);7171- if (err)7272- return err;6868+ if (priv->port_up) {6969+ err = mlx4_en_set_cq_moder(priv, &priv->rx_cq[i]);7070+ if (err)7171+ return err;7272+ }7373 }74747575 return err;
+1-1
drivers/net/ethernet/micrel/ks8851_mll.c
···915915 struct ks_net *ks = netdev_priv(netdev);916916 int err;917917918918-#define KS_INT_FLAGS (IRQF_DISABLED|IRQF_TRIGGER_LOW)918918+#define KS_INT_FLAGS IRQF_TRIGGER_LOW919919 /* lock the card, even if we may not actually do anything920920 * else at the moment.921921 */
+1-2
drivers/net/ethernet/natsemi/jazzsonic.c
···8383{8484 int retval;85858686- retval = request_irq(dev->irq, sonic_interrupt, IRQF_DISABLED,8787- "sonic", dev);8686+ retval = request_irq(dev->irq, sonic_interrupt, 0, "sonic", dev);8887 if (retval) {8988 printk(KERN_ERR "%s: unable to get IRQ %d.\n",9089 dev->name, dev->irq);
+1-2
drivers/net/ethernet/natsemi/xtsonic.c
···9595{9696 int retval;97979898- retval = request_irq(dev->irq, sonic_interrupt, IRQF_DISABLED,9999- "sonic", dev);9898+ retval = request_irq(dev->irq, sonic_interrupt, 0, "sonic", dev);10099 if (retval) {101100 printk(KERN_ERR "%s: unable to get IRQ %d.\n",102101 dev->name, dev->irq);
+2-2
drivers/net/ethernet/pasemi/pasemi_mac.c
···12191219 snprintf(mac->tx_irq_name, sizeof(mac->tx_irq_name), "%s tx",12201220 dev->name);1221122112221222- ret = request_irq(mac->tx->chan.irq, pasemi_mac_tx_intr, IRQF_DISABLED,12221222+ ret = request_irq(mac->tx->chan.irq, pasemi_mac_tx_intr, 0,12231223 mac->tx_irq_name, mac->tx);12241224 if (ret) {12251225 dev_err(&mac->pdev->dev, "request_irq of irq %d failed: %d\n",···12301230 snprintf(mac->rx_irq_name, sizeof(mac->rx_irq_name), "%s rx",12311231 dev->name);1232123212331233- ret = request_irq(mac->rx->chan.irq, pasemi_mac_rx_intr, IRQF_DISABLED,12331233+ ret = request_irq(mac->rx->chan.irq, pasemi_mac_rx_intr, 0,12341234 mac->rx_irq_name, mac->rx);12351235 if (ret) {12361236 dev_err(&mac->pdev->dev, "request_irq of irq %d failed: %d\n",
···42314231 case RTL_GIGA_MAC_VER_23:42324232 case RTL_GIGA_MAC_VER_24:42334233 case RTL_GIGA_MAC_VER_34:42344234+ case RTL_GIGA_MAC_VER_35:42344235 RTL_W32(RxConfig, RX128_INT_EN | RX_MULTI_EN | RX_DMA_BURST);42354236 break;42364237 case RTL_GIGA_MAC_VER_40:
+1-1
drivers/net/ethernet/sfc/Kconfig
···77 select I2C_ALGOBIT88 select PTP_1588_CLOCK99 ---help---1010- This driver supports 10-gigabit Ethernet cards based on1010+ This driver supports 10/40-gigabit Ethernet cards based on1111 the Solarflare SFC4000, SFC9000-family and SFC9100-family1212 controllers.1313
+37-21
drivers/net/ethernet/sfc/ef10.c
···9494 return resource_size(&efx->pci_dev->resource[EFX_MEM_BAR]);9595}96969797-static int efx_ef10_init_capabilities(struct efx_nic *efx)9797+static int efx_ef10_init_datapath_caps(struct efx_nic *efx)9898{9999 MCDI_DECLARE_BUF(outbuf, MC_CMD_GET_CAPABILITIES_OUT_LEN);100100 struct efx_ef10_nic_data *nic_data = efx->nic_data;···107107 outbuf, sizeof(outbuf), &outlen);108108 if (rc)109109 return rc;110110+ if (outlen < sizeof(outbuf)) {111111+ netif_err(efx, drv, efx->net_dev,112112+ "unable to read datapath firmware capabilities\n");113113+ return -EIO;114114+ }110115111111- if (outlen >= sizeof(outbuf)) {112112- nic_data->datapath_caps =113113- MCDI_DWORD(outbuf, GET_CAPABILITIES_OUT_FLAGS1);114114- if (!(nic_data->datapath_caps &115115- (1 << MC_CMD_GET_CAPABILITIES_OUT_TX_TSO_LBN))) {116116- netif_err(efx, drv, efx->net_dev,117117- "Capabilities don't indicate TSO support.\n");118118- return -ENODEV;119119- }116116+ nic_data->datapath_caps =117117+ MCDI_DWORD(outbuf, GET_CAPABILITIES_OUT_FLAGS1);118118+119119+ if (!(nic_data->datapath_caps &120120+ (1 << MC_CMD_GET_CAPABILITIES_OUT_TX_TSO_LBN))) {121121+ netif_err(efx, drv, efx->net_dev,122122+ "current firmware does not support TSO\n");123123+ return -ENODEV;124124+ }125125+126126+ if (!(nic_data->datapath_caps &127127+ (1 << MC_CMD_GET_CAPABILITIES_OUT_RX_PREFIX_LEN_14_LBN))) {128128+ netif_err(efx, probe, efx->net_dev,129129+ "current firmware does not support an RX prefix\n");130130+ return -ENODEV;120131 }121132122133 return 0;···228217 if (rc)229218 goto fail3;230219231231- rc = efx_ef10_init_capabilities(efx);220220+ rc = efx_ef10_init_datapath_caps(efx);232221 if (rc < 0)233222 goto fail3;234223235224 efx->rx_packet_len_offset =236225 ES_DZ_RX_PREFIX_PKTLEN_OFST - ES_DZ_RX_PREFIX_SIZE;237237-238238- if (!(nic_data->datapath_caps &239239- (1 << MC_CMD_GET_CAPABILITIES_OUT_RX_PREFIX_LEN_14_LBN))) {240240- netif_err(efx, probe, efx->net_dev,241241- "current firmware does not support an RX prefix\n");242242- rc = -ENODEV;243243- goto fail3;244244- }245226246227 rc = efx_mcdi_port_get_number(efx);247228 if (rc < 0)···262259 rc = efx_mcdi_mon_probe(efx);263260 if (rc)264261 goto fail3;265265-266266- efx_ptp_probe(efx);267262268263 return 0;269264···342341{343342 struct efx_ef10_nic_data *nic_data = efx->nic_data;344343 int rc;344344+345345+ if (nic_data->must_check_datapath_caps) {346346+ rc = efx_ef10_init_datapath_caps(efx);347347+ if (rc)348348+ return rc;349349+ nic_data->must_check_datapath_caps = false;350350+ }345351346352 if (nic_data->must_realloc_vis) {347353 /* We cannot let the number of VIs change now */···717709 nic_data->must_realloc_vis = true;718710 nic_data->must_restore_filters = true;719711 nic_data->rx_rss_context = EFX_EF10_RSS_CONTEXT_INVALID;712712+713713+ /* The datapath firmware might have been changed */714714+ nic_data->must_check_datapath_caps = true;715715+716716+ /* MAC statistics have been cleared on the NIC; clear the local717717+ * statistic that we update with efx_update_diff_stat().718718+ */719719+ nic_data->stats[EF10_STAT_rx_bad_bytes] = 0;720720721721 return -EIO;722722}
···3333#include <linux/usb/usbnet.h>343435353636-#if defined(CONFIG_USB_NET_RNDIS_HOST) || defined(CONFIG_USB_NET_RNDIS_HOST_MODULE)3636+#if IS_ENABLED(CONFIG_USB_NET_RNDIS_HOST)37373838static int is_rndis(struct usb_interface_descriptor *desc)3939{···6969 0xa6, 0x07, 0xc0, 0xff, 0xcb, 0x7e, 0x39, 0x2a,7070};71717272-/*7373- * probes control interface, claims data interface, collects the bulk7272+/* probes control interface, claims data interface, collects the bulk7473 * endpoints, activates data interface (if needed), maybe sets MTU.7574 * all pure cdc, except for certain firmware workarounds, and knowing7675 * that rndis uses one different rule.···8788 struct usb_cdc_mdlm_desc *desc = NULL;8889 struct usb_cdc_mdlm_detail_desc *detail = NULL;89909090- if (sizeof dev->data < sizeof *info)9191+ if (sizeof(dev->data) < sizeof(*info))9192 return -EDOM;92939394 /* expect strict spec conformance for the descriptors, but···125126 is_activesync(&intf->cur_altsetting->desc) ||126127 is_wireless_rndis(&intf->cur_altsetting->desc));127128128128- memset(info, 0, sizeof *info);129129+ memset(info, 0, sizeof(*info));129130 info->control = intf;130131 while (len > 3) {131131- if (buf [1] != USB_DT_CS_INTERFACE)132132+ if (buf[1] != USB_DT_CS_INTERFACE)132133 goto next_desc;133134134135 /* use bDescriptorSubType to identify the CDC descriptors.···138139 * in favor of a complicated OID-based RPC scheme doing what139140 * CDC Ethernet achieves with a simple descriptor.140141 */141141- switch (buf [2]) {142142+ switch (buf[2]) {142143 case USB_CDC_HEADER_TYPE:143144 if (info->header) {144145 dev_dbg(&intf->dev, "extra CDC header\n");145146 goto bad_desc;146147 }147148 info->header = (void *) buf;148148- if (info->header->bLength != sizeof *info->header) {149149+ if (info->header->bLength != sizeof(*info->header)) {149150 dev_dbg(&intf->dev, "CDC header len %u\n",150151 info->header->bLength);151152 goto bad_desc;···174175 goto bad_desc;175176 }176177 info->u = (void *) buf;177177- if (info->u->bLength != sizeof *info->u) {178178+ if (info->u->bLength != sizeof(*info->u)) {178179 dev_dbg(&intf->dev, "CDC union len %u\n",179180 info->u->bLength);180181 goto bad_desc;···232233 goto bad_desc;233234 }234235 info->ether = (void *) buf;235235- if (info->ether->bLength != sizeof *info->ether) {236236+ if (info->ether->bLength != sizeof(*info->ether)) {236237 dev_dbg(&intf->dev, "CDC ether len %u\n",237238 info->ether->bLength);238239 goto bad_desc;···273274 break;274275 }275276next_desc:276276- len -= buf [0]; /* bLength */277277- buf += buf [0];277277+ len -= buf[0]; /* bLength */278278+ buf += buf[0];278279 }279280280281 /* Microsoft ActiveSync based and some regular RNDIS devices lack the···378379}379380EXPORT_SYMBOL_GPL(usbnet_cdc_unbind);380381381381-/*-------------------------------------------------------------------------382382- *383383- * Communications Device Class, Ethernet Control model382382+/* Communications Device Class, Ethernet Control model384383 *385384 * Takes two interfaces. The DATA interface is inactive till an altsetting386385 * is selected. Configuration data includes class descriptors. There's···386389 *387390 * This should interop with whatever the 2.4 "CDCEther.c" driver388391 * (by Brad Hards) talked with, with more functionality.389389- *390390- *-------------------------------------------------------------------------*/392392+ */391393392394static void dumpspeed(struct usbnet *dev, __le32 *speeds)393395{···400404{401405 struct usb_cdc_notification *event;402406403403- if (urb->actual_length < sizeof *event)407407+ if (urb->actual_length < sizeof(*event))404408 return;405409406410 /* SPEED_CHANGE can get split into two 8-byte packets */···419423 case USB_CDC_NOTIFY_SPEED_CHANGE: /* tx/rx rates */420424 netif_dbg(dev, timer, dev->net, "CDC: speed change (len %d)\n",421425 urb->actual_length);422422- if (urb->actual_length != (sizeof *event + 8))426426+ if (urb->actual_length != (sizeof(*event) + 8))423427 set_bit(EVENT_STS_SPLIT, &dev->flags);424428 else425429 dumpspeed(dev, (__le32 *) &event[1]);···465469static const struct driver_info cdc_info = {466470 .description = "CDC Ethernet Device",467471 .flags = FLAG_ETHER | FLAG_POINTTOPOINT,468468- // .check_connect = cdc_check_connect,469472 .bind = usbnet_cdc_bind,470473 .unbind = usbnet_cdc_unbind,471474 .status = usbnet_cdc_status,···488493#define DELL_VENDOR_ID 0x413C489494#define REALTEK_VENDOR_ID 0x0bda490495491491-static const struct usb_device_id products [] = {492492-/*493493- * BLACKLIST !!496496+static const struct usb_device_id products[] = {497497+/* BLACKLIST !!494498 *495499 * First blacklist any products that are egregiously nonconformant496500 * with the CDC Ethernet specs. Minor braindamage we cope with; when···536542 .driver_info = 0,537543}, {538544 .match_flags = USB_DEVICE_ID_MATCH_INT_INFO539539- | USB_DEVICE_ID_MATCH_DEVICE,545545+ | USB_DEVICE_ID_MATCH_DEVICE,540546 .idVendor = 0x04DD,541547 .idProduct = 0x8007, /* C-700 */542548 ZAURUS_MASTER_INTERFACE,···653659 .driver_info = 0,654660},655661656656-/*657657- * WHITELIST!!!662662+/* WHITELIST!!!658663 *659664 * CDC Ether uses two interfaces, not necessarily consecutive.660665 * We match the main interface, ignoring the optional device···665672 */666673{667674 /* ZTE (Vodafone) K3805-Z */668668- .match_flags = USB_DEVICE_ID_MATCH_VENDOR669669- | USB_DEVICE_ID_MATCH_PRODUCT670670- | USB_DEVICE_ID_MATCH_INT_INFO,671671- .idVendor = ZTE_VENDOR_ID,672672- .idProduct = 0x1003,673673- .bInterfaceClass = USB_CLASS_COMM,674674- .bInterfaceSubClass = USB_CDC_SUBCLASS_ETHERNET,675675- .bInterfaceProtocol = USB_CDC_PROTO_NONE,675675+ USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1003, USB_CLASS_COMM,676676+ USB_CDC_SUBCLASS_ETHERNET,677677+ USB_CDC_PROTO_NONE),676678 .driver_info = (unsigned long)&wwan_info,677679}, {678680 /* ZTE (Vodafone) K3806-Z */679679- .match_flags = USB_DEVICE_ID_MATCH_VENDOR680680- | USB_DEVICE_ID_MATCH_PRODUCT681681- | USB_DEVICE_ID_MATCH_INT_INFO,682682- .idVendor = ZTE_VENDOR_ID,683683- .idProduct = 0x1015,684684- .bInterfaceClass = USB_CLASS_COMM,685685- .bInterfaceSubClass = USB_CDC_SUBCLASS_ETHERNET,686686- .bInterfaceProtocol = USB_CDC_PROTO_NONE,681681+ USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1015, USB_CLASS_COMM,682682+ USB_CDC_SUBCLASS_ETHERNET,683683+ USB_CDC_PROTO_NONE),687684 .driver_info = (unsigned long)&wwan_info,688685}, {689686 /* ZTE (Vodafone) K4510-Z */690690- .match_flags = USB_DEVICE_ID_MATCH_VENDOR691691- | USB_DEVICE_ID_MATCH_PRODUCT692692- | USB_DEVICE_ID_MATCH_INT_INFO,693693- .idVendor = ZTE_VENDOR_ID,694694- .idProduct = 0x1173,695695- .bInterfaceClass = USB_CLASS_COMM,696696- .bInterfaceSubClass = USB_CDC_SUBCLASS_ETHERNET,697697- .bInterfaceProtocol = USB_CDC_PROTO_NONE,687687+ USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1173, USB_CLASS_COMM,688688+ USB_CDC_SUBCLASS_ETHERNET,689689+ USB_CDC_PROTO_NONE),698690 .driver_info = (unsigned long)&wwan_info,699691}, {700692 /* ZTE (Vodafone) K3770-Z */701701- .match_flags = USB_DEVICE_ID_MATCH_VENDOR702702- | USB_DEVICE_ID_MATCH_PRODUCT703703- | USB_DEVICE_ID_MATCH_INT_INFO,704704- .idVendor = ZTE_VENDOR_ID,705705- .idProduct = 0x1177,706706- .bInterfaceClass = USB_CLASS_COMM,707707- .bInterfaceSubClass = USB_CDC_SUBCLASS_ETHERNET,708708- .bInterfaceProtocol = USB_CDC_PROTO_NONE,693693+ USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1177, USB_CLASS_COMM,694694+ USB_CDC_SUBCLASS_ETHERNET,695695+ USB_CDC_PROTO_NONE),709696 .driver_info = (unsigned long)&wwan_info,710697}, {711698 /* ZTE (Vodafone) K3772-Z */712712- .match_flags = USB_DEVICE_ID_MATCH_VENDOR713713- | USB_DEVICE_ID_MATCH_PRODUCT714714- | USB_DEVICE_ID_MATCH_INT_INFO,715715- .idVendor = ZTE_VENDOR_ID,716716- .idProduct = 0x1181,717717- .bInterfaceClass = USB_CLASS_COMM,718718- .bInterfaceSubClass = USB_CDC_SUBCLASS_ETHERNET,719719- .bInterfaceProtocol = USB_CDC_PROTO_NONE,699699+ USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1181, USB_CLASS_COMM,700700+ USB_CDC_SUBCLASS_ETHERNET,701701+ USB_CDC_PROTO_NONE),720702 .driver_info = (unsigned long)&wwan_info,703703+}, {704704+ /* Telit modules */705705+ USB_VENDOR_AND_INTERFACE_INFO(0x1bc7, USB_CLASS_COMM,706706+ USB_CDC_SUBCLASS_ETHERNET, USB_CDC_PROTO_NONE),707707+ .driver_info = (kernel_ulong_t) &wwan_info,721708}, {722709 USB_INTERFACE_INFO(USB_CLASS_COMM, USB_CDC_SUBCLASS_ETHERNET,723710 USB_CDC_PROTO_NONE),···709736710737}, {711738 /* Various Huawei modems with a network port like the UMG1831 */712712- .match_flags = USB_DEVICE_ID_MATCH_VENDOR713713- | USB_DEVICE_ID_MATCH_INT_INFO,714714- .idVendor = HUAWEI_VENDOR_ID,715715- .bInterfaceClass = USB_CLASS_COMM,716716- .bInterfaceSubClass = USB_CDC_SUBCLASS_ETHERNET,717717- .bInterfaceProtocol = 255,739739+ USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, USB_CLASS_COMM,740740+ USB_CDC_SUBCLASS_ETHERNET, 255),718741 .driver_info = (unsigned long)&wwan_info,719742},720720- { }, // END743743+ { }, /* END */721744};722745MODULE_DEVICE_TABLE(usb, products);723746
+21-19
drivers/net/vxlan.c
···564564 struct net_device *dev;565565 struct net *net = sock_net(sk);566566 sa_family_t sa_family = sk->sk_family;567567- u16 port = htons(inet_sk(sk)->inet_sport);567567+ __be16 port = inet_sk(sk)->inet_sport;568568569569 rcu_read_lock();570570 for_each_netdev_rcu(net, dev) {···581581 struct net_device *dev;582582 struct net *net = sock_net(sk);583583 sa_family_t sa_family = sk->sk_family;584584- u16 port = htons(inet_sk(sk)->inet_sport);584584+ __be16 port = inet_sk(sk)->inet_sport;585585586586 rcu_read_lock();587587 for_each_netdev_rcu(net, dev) {···20212021};2022202220232023/* Calls the ndo_add_vxlan_port of the caller in order to20242024- * supply the listening VXLAN udp ports.20242024+ * supply the listening VXLAN udp ports. Callers are expected20252025+ * to implement the ndo_add_vxlan_port.20252026 */20262027void vxlan_get_rx_port(struct net_device *dev)20272028{···20302029 struct net *net = dev_net(dev);20312030 struct vxlan_net *vn = net_generic(net, vxlan_net_id);20322031 sa_family_t sa_family;20332033- u16 port;20342034- int i;20352035-20362036- if (!dev || !dev->netdev_ops || !dev->netdev_ops->ndo_add_vxlan_port)20372037- return;20322032+ __be16 port;20332033+ unsigned int i;2038203420392035 spin_lock(&vn->sock_lock);20402036 for (i = 0; i < PORT_HASH_SIZE; ++i) {20412041- hlist_for_each_entry_rcu(vs, vs_head(net, i), hlist) {20422042- port = htons(inet_sk(vs->sock->sk)->inet_sport);20372037+ hlist_for_each_entry_rcu(vs, &vn->sock_list[i], hlist) {20382038+ port = inet_sk(vs->sock->sk)->inet_sport;20432039 sa_family = vs->sock->sk->sk_family;20442040 dev->netdev_ops->ndo_add_vxlan_port(dev, sa_family,20452041 port);···2490249224912493 SET_ETHTOOL_OPS(dev, &vxlan_ethtool_ops);2492249424932493- /* create an fdb entry for default destination */24942494- err = vxlan_fdb_create(vxlan, all_zeros_mac,24952495- &vxlan->default_dst.remote_ip,24962496- NUD_REACHABLE|NUD_PERMANENT,24972497- NLM_F_EXCL|NLM_F_CREATE,24982498- vxlan->dst_port, vxlan->default_dst.remote_vni,24992499- vxlan->default_dst.remote_ifindex, NTF_SELF);25002500- if (err)25012501- return err;24952495+ /* create an fdb entry for a valid default destination */24962496+ if (!vxlan_addr_any(&vxlan->default_dst.remote_ip)) {24972497+ err = vxlan_fdb_create(vxlan, all_zeros_mac,24982498+ &vxlan->default_dst.remote_ip,24992499+ NUD_REACHABLE|NUD_PERMANENT,25002500+ NLM_F_EXCL|NLM_F_CREATE,25012501+ vxlan->dst_port,25022502+ vxlan->default_dst.remote_vni,25032503+ vxlan->default_dst.remote_ifindex,25042504+ NTF_SELF);25052505+ if (err)25062506+ return err;25072507+ }2502250825032509 err = register_netdevice(dev);25042510 if (err) {
+2-2
drivers/net/wireless/brcm80211/Kconfig
···28282929config BRCMFMAC_SDIO3030 bool "SDIO bus interface support for FullMAC driver"3131- depends on MMC3131+ depends on (MMC = y || MMC = BRCMFMAC)3232 depends on BRCMFMAC3333 select FW_LOADER3434 default y···39394040config BRCMFMAC_USB4141 bool "USB bus interface support for FullMAC driver"4242- depends on USB4242+ depends on (USB = y || USB = BRCMFMAC)4343 depends on BRCMFMAC4444 select FW_LOADER4545 ---help---
+25-3
drivers/net/wireless/cw1200/cw1200_spi.c
···4040 struct cw1200_common *core;4141 const struct cw1200_platform_data_spi *pdata;4242 spinlock_t lock; /* Serialize all bus operations */4343+ wait_queue_head_t wq;4344 int claimed;4545+ int irq_disabled;4446};45474648#define SDIO_TO_SPI_ADDR(addr) ((addr & 0x1f)>>2)···199197{200198 unsigned long flags;201199200200+ DECLARE_WAITQUEUE(wait, current);201201+202202 might_sleep();203203204204+ add_wait_queue(&self->wq, &wait);204205 spin_lock_irqsave(&self->lock, flags);205206 while (1) {206207 set_current_state(TASK_UNINTERRUPTIBLE);···216211 set_current_state(TASK_RUNNING);217212 self->claimed = 1;218213 spin_unlock_irqrestore(&self->lock, flags);214214+ remove_wait_queue(&self->wq, &wait);219215220216 return;221217}···228222 spin_lock_irqsave(&self->lock, flags);229223 self->claimed = 0;230224 spin_unlock_irqrestore(&self->lock, flags);225225+ wake_up(&self->wq);226226+231227 return;232228}233229···238230 struct hwbus_priv *self = dev_id;239231240232 if (self->core) {233233+ disable_irq_nosync(self->func->irq);234234+ self->irq_disabled = 1;241235 cw1200_irq_handler(self->core);242236 return IRQ_HANDLED;243237 } else {···273263274264static int cw1200_spi_irq_unsubscribe(struct hwbus_priv *self)275265{276276- int ret = 0;277277-278266 pr_debug("SW IRQ unsubscribe\n");279267 disable_irq_wake(self->func->irq);280268 free_irq(self->func->irq, self);281269282282- return ret;270270+ return 0;271271+}272272+273273+static int cw1200_spi_irq_enable(struct hwbus_priv *self, int enable)274274+{275275+ /* Disables are handled by the interrupt handler */276276+ if (enable && self->irq_disabled) {277277+ enable_irq(self->func->irq);278278+ self->irq_disabled = 0;279279+ }280280+281281+ return 0;283282}284283285284static int cw1200_spi_off(const struct cw1200_platform_data_spi *pdata)···368349 .unlock = cw1200_spi_unlock,369350 .align_size = cw1200_spi_align_size,370351 .power_mgmt = cw1200_spi_pm,352352+ .irq_enable = cw1200_spi_irq_enable,371353};372354373355/* Probe Function to be called by SPI stack when device is discovered */···419399 spin_lock_init(&self->lock);420400421401 spi_set_drvdata(func, self);402402+403403+ init_waitqueue_head(&self->wq);422404423405 status = cw1200_spi_irq_subscribe(self);424406
+1-1
drivers/net/wireless/cw1200/fwio.c
···485485486486 /* Enable interrupt signalling */487487 priv->hwbus_ops->lock(priv->hwbus_priv);488488- ret = __cw1200_irq_enable(priv, 1);488488+ ret = __cw1200_irq_enable(priv, 2);489489 priv->hwbus_ops->unlock(priv->hwbus_priv);490490 if (ret < 0)491491 goto unsubscribe;
+1
drivers/net/wireless/cw1200/hwbus.h
···2828 void (*unlock)(struct hwbus_priv *self);2929 size_t (*align_size)(struct hwbus_priv *self, size_t size);3030 int (*power_mgmt)(struct hwbus_priv *self, bool suspend);3131+ int (*irq_enable)(struct hwbus_priv *self, int enable);3132};32333334#endif /* CW1200_HWBUS_H */
+15
drivers/net/wireless/cw1200/hwio.c
···273273 u16 val16;274274 int ret;275275276276+ /* We need to do this hack because the SPI layer can sleep on I/O277277+ and the general path involves I/O to the device in interrupt278278+ context.279279+280280+ However, the initial enable call needs to go to the hardware.281281+282282+ We don't worry about shutdown because we do a full reset which283283+ clears the interrupt enabled bits.284284+ */285285+ if (priv->hwbus_ops->irq_enable) {286286+ ret = priv->hwbus_ops->irq_enable(priv->hwbus_priv, enable);287287+ if (ret || enable < 2)288288+ return ret;289289+ }290290+276291 if (HIF_8601_SILICON == priv->hw_type) {277292 ret = __cw1200_reg_read_32(priv, ST90TDS_CONFIG_REG_ID, &val32);278293 if (ret < 0) {
+6-5
drivers/net/wireless/rt2x00/rt2800lib.c
···66596659 rt2800_init_registers(rt2x00dev)))66606660 return -EIO;6661666166626662+ if (unlikely(rt2800_wait_bbp_rf_ready(rt2x00dev)))66636663+ return -EIO;66646664+66626665 /*66636666 * Send signal to firmware during boot time.66646667 */66656668 rt2800_register_write(rt2x00dev, H2M_BBP_AGENT, 0);66666669 rt2800_register_write(rt2x00dev, H2M_MAILBOX_CSR, 0);66676667- if (rt2x00_is_usb(rt2x00dev)) {66706670+ if (rt2x00_is_usb(rt2x00dev))66686671 rt2800_register_write(rt2x00dev, H2M_INT_SRC, 0);66696669- rt2800_mcu_request(rt2x00dev, MCU_BOOT_SIGNAL, 0, 0, 0);66706670- }66726672+ rt2800_mcu_request(rt2x00dev, MCU_BOOT_SIGNAL, 0, 0, 0);66716673 msleep(1);6672667466736673- if (unlikely(rt2800_wait_bbp_rf_ready(rt2x00dev) ||66746674- rt2800_wait_bbp_ready(rt2x00dev)))66756675+ if (unlikely(rt2800_wait_bbp_ready(rt2x00dev)))66756676 return -EIO;6676667766776678 rt2800_init_bbp(rt2x00dev);
+10-5
drivers/net/wireless/rtl818x/rtl8187/dev.c
···438438 skb_queue_tail(&priv->rx_queue, skb);439439 usb_anchor_urb(entry, &priv->anchored);440440 ret = usb_submit_urb(entry, GFP_KERNEL);441441+ usb_put_urb(entry);441442 if (ret) {442443 skb_unlink(skb, &priv->rx_queue);443444 usb_unanchor_urb(entry);444445 goto err;445446 }446446- usb_free_urb(entry);447447 }448448 return ret;449449450450err:451451- usb_free_urb(entry);452451 kfree_skb(skb);453452 usb_kill_anchored_urbs(&priv->anchored);454453 return ret;···955956 (RETRY_COUNT << 8 /* short retry limit */) |956957 (RETRY_COUNT << 0 /* long retry limit */) |957958 (7 << 21 /* MAX TX DMA */));958958- rtl8187_init_urbs(dev);959959- rtl8187b_init_status_urb(dev);959959+ ret = rtl8187_init_urbs(dev);960960+ if (ret)961961+ goto rtl8187_start_exit;962962+ ret = rtl8187b_init_status_urb(dev);963963+ if (ret)964964+ usb_kill_anchored_urbs(&priv->anchored);960965 goto rtl8187_start_exit;961966 }962967···969966 rtl818x_iowrite32(priv, &priv->map->MAR[0], ~0);970967 rtl818x_iowrite32(priv, &priv->map->MAR[1], ~0);971968972972- rtl8187_init_urbs(dev);969969+ ret = rtl8187_init_urbs(dev);970970+ if (ret)971971+ goto rtl8187_start_exit;973972974973 reg = RTL818X_RX_CONF_ONLYERLPKT |975974 RTL818X_RX_CONF_RX_AUTORESETPHY |
+1
drivers/net/xen-netback/common.h
···184184 unsigned long rx_ring_ref, unsigned int tx_evtchn,185185 unsigned int rx_evtchn);186186void xenvif_disconnect(struct xenvif *vif);187187+void xenvif_free(struct xenvif *vif);187188188189int xenvif_xenbus_init(void);189190void xenvif_xenbus_fini(void);
+11-17
drivers/net/xen-netback/interface.c
···353353 }354354355355 netdev_dbg(dev, "Successfully created xenvif\n");356356+357357+ __module_get(THIS_MODULE);358358+356359 return vif;357360}358361···368365 /* Already connected through? */369366 if (vif->tx_irq)370367 return 0;371371-372372- __module_get(THIS_MODULE);373368374369 err = xenvif_map_frontend_rings(vif, tx_ring_ref, rx_ring_ref);375370 if (err < 0)···407406408407 init_waitqueue_head(&vif->wq);409408 vif->task = kthread_create(xenvif_kthread,410410- (void *)vif, vif->dev->name);409409+ (void *)vif, "%s", vif->dev->name);411410 if (IS_ERR(vif->task)) {412411 pr_warn("Could not allocate kthread for %s\n", vif->dev->name);413412 err = PTR_ERR(vif->task);···453452454453void xenvif_disconnect(struct xenvif *vif)455454{456456- /* Disconnect funtion might get called by generic framework457457- * even before vif connects, so we need to check if we really458458- * need to do a module_put.459459- */460460- int need_module_put = 0;461461-462455 if (netif_carrier_ok(vif->dev))463456 xenvif_carrier_off(vif);464457···463468 unbind_from_irqhandler(vif->tx_irq, vif);464469 unbind_from_irqhandler(vif->rx_irq, vif);465470 }466466- /* vif->irq is valid, we had a module_get in467467- * xenvif_connect.468468- */469469- need_module_put = 1;471471+ vif->tx_irq = 0;470472 }471473472474 if (vif->task)473475 kthread_stop(vif->task);474476477477+ xenvif_unmap_frontend_rings(vif);478478+}479479+480480+void xenvif_free(struct xenvif *vif)481481+{475482 netif_napi_del(&vif->napi);476483477484 unregister_netdev(vif->dev);478485479479- xenvif_unmap_frontend_rings(vif);480480-481486 free_netdev(vif->dev);482487483483- if (need_module_put)484484- module_put(THIS_MODULE);488488+ module_put(THIS_MODULE);485489}
+65-31
drivers/net/xen-netback/netback.c
···212212 return false;213213}214214215215+struct xenvif_count_slot_state {216216+ unsigned long copy_off;217217+ bool head;218218+};219219+220220+unsigned int xenvif_count_frag_slots(struct xenvif *vif,221221+ unsigned long offset, unsigned long size,222222+ struct xenvif_count_slot_state *state)223223+{224224+ unsigned count = 0;225225+226226+ offset &= ~PAGE_MASK;227227+228228+ while (size > 0) {229229+ unsigned long bytes;230230+231231+ bytes = PAGE_SIZE - offset;232232+233233+ if (bytes > size)234234+ bytes = size;235235+236236+ if (start_new_rx_buffer(state->copy_off, bytes, state->head)) {237237+ count++;238238+ state->copy_off = 0;239239+ }240240+241241+ if (state->copy_off + bytes > MAX_BUFFER_OFFSET)242242+ bytes = MAX_BUFFER_OFFSET - state->copy_off;243243+244244+ state->copy_off += bytes;245245+246246+ offset += bytes;247247+ size -= bytes;248248+249249+ if (offset == PAGE_SIZE)250250+ offset = 0;251251+252252+ state->head = false;253253+ }254254+255255+ return count;256256+}257257+215258/*216259 * Figure out how many ring slots we're going to need to send @skb to217260 * the guest. This function is essentially a dry run of···262219 */263220unsigned int xenvif_count_skb_slots(struct xenvif *vif, struct sk_buff *skb)264221{222222+ struct xenvif_count_slot_state state;265223 unsigned int count;266266- int i, copy_off;224224+ unsigned char *data;225225+ unsigned i;267226268268- count = DIV_ROUND_UP(skb_headlen(skb), PAGE_SIZE);227227+ state.head = true;228228+ state.copy_off = 0;269229270270- copy_off = skb_headlen(skb) % PAGE_SIZE;230230+ /* Slot for the first (partial) page of data. */231231+ count = 1;271232233233+ /* Need a slot for the GSO prefix for GSO extra data? */272234 if (skb_shinfo(skb)->gso_size)273235 count++;236236+237237+ data = skb->data;238238+ while (data < skb_tail_pointer(skb)) {239239+ unsigned long offset = offset_in_page(data);240240+ unsigned long size = PAGE_SIZE - offset;241241+242242+ if (data + size > skb_tail_pointer(skb))243243+ size = skb_tail_pointer(skb) - data;244244+245245+ count += xenvif_count_frag_slots(vif, offset, size, &state);246246+247247+ data += size;248248+ }274249275250 for (i = 0; i < skb_shinfo(skb)->nr_frags; i++) {276251 unsigned long size = skb_frag_size(&skb_shinfo(skb)->frags[i]);277252 unsigned long offset = skb_shinfo(skb)->frags[i].page_offset;278278- unsigned long bytes;279253280280- offset &= ~PAGE_MASK;281281-282282- while (size > 0) {283283- BUG_ON(offset >= PAGE_SIZE);284284- BUG_ON(copy_off > MAX_BUFFER_OFFSET);285285-286286- bytes = PAGE_SIZE - offset;287287-288288- if (bytes > size)289289- bytes = size;290290-291291- if (start_new_rx_buffer(copy_off, bytes, 0)) {292292- count++;293293- copy_off = 0;294294- }295295-296296- if (copy_off + bytes > MAX_BUFFER_OFFSET)297297- bytes = MAX_BUFFER_OFFSET - copy_off;298298-299299- copy_off += bytes;300300-301301- offset += bytes;302302- size -= bytes;303303-304304- if (offset == PAGE_SIZE)305305- offset = 0;306306- }254254+ count += xenvif_count_frag_slots(vif, offset, size, &state);307255 }308256 return count;309257}
+13-6
drivers/net/xen-netback/xenbus.c
···4242 if (be->vif) {4343 kobject_uevent(&dev->dev.kobj, KOBJ_OFFLINE);4444 xenbus_rm(XBT_NIL, dev->nodename, "hotplug-status");4545- xenvif_disconnect(be->vif);4545+ xenvif_free(be->vif);4646 be->vif = NULL;4747 }4848 kfree(be);···213213{214214 struct backend_info *be = dev_get_drvdata(&dev->dev);215215216216- if (be->vif) {217217- xenbus_rm(XBT_NIL, dev->nodename, "hotplug-status");216216+ if (be->vif)218217 xenvif_disconnect(be->vif);218218+}219219+220220+static void destroy_backend(struct xenbus_device *dev)221221+{222222+ struct backend_info *be = dev_get_drvdata(&dev->dev);223223+224224+ if (be->vif) {225225+ kobject_uevent(&dev->dev.kobj, KOBJ_OFFLINE);226226+ xenbus_rm(XBT_NIL, dev->nodename, "hotplug-status");227227+ xenvif_free(be->vif);219228 be->vif = NULL;220229 }221230}···255246 case XenbusStateConnected:256247 if (dev->state == XenbusStateConnected)257248 break;258258- backend_create_xenvif(be);259249 if (be->vif)260250 connect(be);261251 break;262252263253 case XenbusStateClosing:264264- if (be->vif)265265- kobject_uevent(&dev->dev.kobj, KOBJ_OFFLINE);266254 disconnect_backend(dev);267255 xenbus_switch_state(dev, XenbusStateClosing);268256 break;···268262 xenbus_switch_state(dev, XenbusStateClosed);269263 if (xenbus_dev_is_online(dev))270264 break;265265+ destroy_backend(dev);271266 /* fall through if not online */272267 case XenbusStateUnknown:273268 device_unregister(&dev->dev);
+3-3
drivers/pci/pci-acpi.c
···4747 if (event != ACPI_NOTIFY_DEVICE_WAKE || !pci_dev)4848 return;49495050+ if (pci_dev->pme_poll)5151+ pci_dev->pme_poll = false;5252+5053 if (pci_dev->current_state == PCI_D3cold) {5154 pci_wakeup_event(pci_dev);5255 pm_runtime_resume(&pci_dev->dev);···5956 /* Clear PME Status if set. */6057 if (pci_dev->pme_support)6158 pci_check_pme_status(pci_dev);6262-6363- if (pci_dev->pme_poll)6464- pci_dev->pme_poll = false;65596660 pci_wakeup_event(pci_dev);6761 pm_runtime_resume(&pci_dev->dev);
···6464#define MAX_PAGES_PER_CTRL_STRUCT_POOL 86565#define BNX2I_RESERVED_SLOW_PATH_CMD_SLOTS 466666767-#define BNX2I_5771X_DBELL_PAGE_SIZE 1286767+#define BNX2X_DB_SHIFT 368686969/* 5706/08 hardware has limit on maximum buffer size per BD it can handle */7070#define MAX_BD_LENGTH 65535
···9696 To compile this driver as a module, choose M here: the module will be9797 called skel.98989999+config COMEDI_SSV_DNP100100+ tristate "SSV Embedded Systems DIL/Net-PC support"101101+ depends on X86_32 || COMPILE_TEST102102+ ---help---103103+ Enable support for SSV Embedded Systems DIL/Net-PC104104+105105+ To compile this driver as a module, choose M here: the module will be106106+ called ssv_dnp.107107+99108endif # COMEDI_MISC_DRIVERS100109101110menuconfig COMEDI_ISA_DRIVERS···394385395386 To compile this driver as a module, choose M here: the module will be396387 called dmm32at.388388+389389+config COMEDI_UNIOXX5390390+ tristate "Fastwel UNIOxx-5 analog and digital io board support"391391+ ---help---392392+ Enable support for Fastwel UNIOxx-5 (analog and digital i/o) boards393393+394394+ To compile this driver as a module, choose M here: the module will be395395+ called unioxx5.397396398397config COMEDI_FL512399398 tristate "FL512 ISA card support"···872855 To compile this driver as a module, choose M here: the module will be873856 called dyna_pci10xx.874857875875-config COMEDI_UNIOXX5876876- tristate "Fastwel UNIOxx-5 analog and digital io board support"877877- ---help---878878- Enable support for Fastwel UNIOxx-5 (analog and digital i/o) boards879879-880880- To compile this driver as a module, choose M here: the module will be881881- called unioxx5.882882-883858config COMEDI_GSC_HPDI884859 tristate "General Standards PCI-HPDI32 / PMC-HPDI32 support"885860 select COMEDI_FC···1093108410941085 To compile this driver as a module, choose M here: the module will be10951086 called s626.10961096-10971097-config COMEDI_SSV_DNP10981098- tristate "SSV Embedded Systems DIL/Net-PC support"10991099- ---help---11001100- Enable support for SSV Embedded Systems DIL/Net-PC11011101-11021102- To compile this driver as a module, choose M here: the module will be11031103- called ssv_dnp.1104108711051088config COMEDI_MITE11061089 depends on HAS_DMA
+10-7
drivers/staging/dgap/dgap_driver.c
···470470471471 DGAP_LOCK(dgap_global_lock, flags);472472 brd->msgbuf = NULL;473473- printk(brd->msgbuf_head);473473+ printk("%s", brd->msgbuf_head);474474 kfree(brd->msgbuf_head);475475 brd->msgbuf_head = NULL;476476 DGAP_UNLOCK(dgap_global_lock, flags);···624624 DPR_INIT(("dgap_scan(%d) - printing out the msgbuf\n", i));625625 DGAP_LOCK(dgap_global_lock, flags);626626 brd->msgbuf = NULL;627627- printk(brd->msgbuf_head);627627+ printk("%s", brd->msgbuf_head);628628 kfree(brd->msgbuf_head);629629 brd->msgbuf_head = NULL;630630 DGAP_UNLOCK(dgap_global_lock, flags);···951951 char buf[1024];952952 int i;953953 unsigned long flags;954954+ size_t length;954955955956 DGAP_LOCK(dgap_global_lock, flags);956957957958 /* Format buf using fmt and arguments contained in ap. */958959 va_start(ap, fmt);959959- i = vsprintf(buf, fmt, ap);960960+ i = vsnprintf(buf, sizeof(buf), fmt, ap);960961 va_end(ap);961962962963 DPR((buf));963964964965 if (!brd || !brd->msgbuf) {965965- printk(buf);966966+ printk("%s", buf);966967 DGAP_UNLOCK(dgap_global_lock, flags);967968 return;968969 }969970970970- memcpy(brd->msgbuf, buf, strlen(buf));971971- brd->msgbuf += strlen(buf);972972- *brd->msgbuf = 0;971971+ length = strlen(buf) + 1;972972+ if (brd->msgbuf - brd->msgbuf_head < length)973973+ length = brd->msgbuf - brd->msgbuf_head;974974+ memcpy(brd->msgbuf, buf, length);975975+ brd->msgbuf += length;973976974977 DGAP_UNLOCK(dgap_global_lock, flags);975978}
···383383384384 /* CLONE_VM and CLONE_FILES just avoid a needless copy, because we385385 * just drop the VM and FILES in cfs_daemonize_ctxt() right away. */386386- rc = PTR_ERR(kthread_run(ptlrpc_pinger_main,387387- &pinger_thread, pinger_thread.t_name));386386+ rc = PTR_ERR(kthread_run(ptlrpc_pinger_main, &pinger_thread,387387+ "%s", pinger_thread.t_name));388388 if (IS_ERR_VALUE(rc)) {389389 CERROR("cannot start thread: %d\n", rc);390390 return rc;
+4-4
drivers/staging/lustre/lustre/ptlrpc/ptlrpcd.c
···615615 init_completion(&pc->pc_starting);616616 init_completion(&pc->pc_finishing);617617 spin_lock_init(&pc->pc_lock);618618- strncpy(pc->pc_name, name, sizeof(pc->pc_name) - 1);618618+ strlcpy(pc->pc_name, name, sizeof(pc->pc_name));619619 pc->pc_set = ptlrpc_prep_set();620620 if (pc->pc_set == NULL)621621 GOTO(out, rc = -ENOMEM);···638638 GOTO(out, rc);639639 }640640641641- task = kthread_run(ptlrpcd, pc, pc->pc_name);641641+ task = kthread_run(ptlrpcd, pc, "%s", pc->pc_name);642642 if (IS_ERR(task))643643 GOTO(out, rc = PTR_ERR(task));644644···745745 if (ptlrpcds == NULL)746746 GOTO(out, rc = -ENOMEM);747747748748- snprintf(name, 15, "ptlrpcd_rcv");748748+ snprintf(name, sizeof(name), "ptlrpcd_rcv");749749 set_bit(LIOD_RECOVERY, &ptlrpcds->pd_thread_rcv.pc_flags);750750 rc = ptlrpcd_start(-1, nthreads, name, &ptlrpcds->pd_thread_rcv);751751 if (rc < 0)···764764 * unnecessary dependency. But how to distribute async RPCs load765765 * among all the ptlrpc daemons becomes another trouble. */766766 for (i = 0; i < nthreads; i++) {767767- snprintf(name, 15, "ptlrpcd_%d", i);767767+ snprintf(name, sizeof(name), "ptlrpcd_%d", i);768768 rc = ptlrpcd_start(i, nthreads, name, &ptlrpcds->pd_threads[i]);769769 if (rc < 0)770770 GOTO(out, rc);
···11config USB_DWC322 tristate "DesignWare USB3 DRD Core Support"33 depends on (USB || USB_GADGET) && HAS_DMA44- depends on EXTCON54 select USB_XHCI_PLATFORM if USB_SUPPORT && USB_XHCI_HCD65 help76 Say Y or M here if your system has a Dual Role SuperSpeed
···22222323MODULE_DESCRIPTION("FUSB300 USB gadget driver");2424MODULE_LICENSE("GPL");2525-MODULE_AUTHOR("Yuan Hsin Chen <yhchen@faraday-tech.com>");2525+MODULE_AUTHOR("Yuan-Hsin Chen, Feng-Hsin Chiang <john453@faraday-tech.com>");2626MODULE_ALIAS("platform:fusb300_udc");27272828#define DRIVER_VERSION "20 October 2010"
+4-4
drivers/usb/gadget/multi.c
···179179 return ret;180180}181181182182-static int rndis_config_register(struct usb_composite_dev *cdev)182182+static __ref int rndis_config_register(struct usb_composite_dev *cdev)183183{184184 static struct usb_configuration config = {185185 .bConfigurationValue = MULTI_RNDIS_CONFIG_NUM,···194194195195#else196196197197-static int rndis_config_register(struct usb_composite_dev *cdev)197197+static __ref int rndis_config_register(struct usb_composite_dev *cdev)198198{199199 return 0;200200}···241241 return ret;242242}243243244244-static int cdc_config_register(struct usb_composite_dev *cdev)244244+static __ref int cdc_config_register(struct usb_composite_dev *cdev)245245{246246 static struct usb_configuration config = {247247 .bConfigurationValue = MULTI_CDC_CONFIG_NUM,···256256257257#else258258259259-static int cdc_config_register(struct usb_composite_dev *cdev)259259+static __ref int cdc_config_register(struct usb_composite_dev *cdev)260260{261261 return 0;262262}
+3
drivers/usb/gadget/mv_u3d_core.c
···645645 struct mv_u3d_ep *ep;646646 struct mv_u3d_ep_context *ep_context;647647 u32 epxcr, direction;648648+ unsigned long flags;648649649650 if (!_ep)650651 return -EINVAL;···662661 direction = mv_u3d_ep_dir(ep);663662664663 /* nuke all pending requests (does flush) */664664+ spin_lock_irqsave(&u3d->lock, flags);665665 mv_u3d_nuke(ep, -ESHUTDOWN);666666+ spin_unlock_irqrestore(&u3d->lock, flags);666667667668 /* Disable the endpoint for Rx or Tx and reset the endpoint type */668669 if (direction == MV_U3D_EP_DIR_OUT) {
+4-9
drivers/usb/gadget/s3c-hsotg.c
···24752475 if (gintsts & GINTSTS_ErlySusp) {24762476 dev_dbg(hsotg->dev, "GINTSTS_ErlySusp\n");24772477 writel(GINTSTS_ErlySusp, hsotg->regs + GINTSTS);24782478-24792479- s3c_hsotg_disconnect(hsotg);24802478 }2481247924822480 /*···29602962 if (!hsotg)29612963 return -ENODEV;2962296429632963- if (!driver || driver != hsotg->driver || !driver->unbind)29642964- return -EINVAL;29652965-29662965 /* all endpoints should be shutdown */29672966 for (ep = 0; ep < hsotg->num_of_eps; ep++)29682967 s3c_hsotg_ep_disable(&hsotg->eps[ep].ep);···29672972 spin_lock_irqsave(&hsotg->lock, flags);2968297329692974 s3c_hsotg_phy_disable(hsotg);29702970- regulator_bulk_disable(ARRAY_SIZE(hsotg->supplies), hsotg->supplies);2971297529722972- hsotg->driver = NULL;29762976+ if (!driver)29772977+ hsotg->driver = NULL;29782978+29732979 hsotg->gadget.speed = USB_SPEED_UNKNOWN;2974298029752981 spin_unlock_irqrestore(&hsotg->lock, flags);2976298229772977- dev_info(hsotg->dev, "unregistered gadget driver '%s'\n",29782978- driver->driver.name);29832983+ regulator_bulk_disable(ARRAY_SIZE(hsotg->supplies), hsotg->supplies);2979298429802985 return 0;29812986}
···7979 return &dpll_map[i].params;8080 }81818282- return 0;8282+ return NULL;8383}84848585static int omap_usb3_suspend(struct usb_phy *x, int suspend)
+1-1
drivers/usb/serial/Kconfig
···6060 - Suunto ANT+ USB device.6161 - Fundamental Software dongle.6262 - HP4x calculators6363- - a number of Motoroloa phones6363+ - a number of Motorola phones6464 - Siemens USB/MPI adapter.6565 - ViVOtech ViVOpay USB device.6666 - Infineon Modem Flashloader USB interface
+32-11
drivers/usb/serial/pl2303.c
···139139 HX_TA, /* HX(A) / X(A) / TA version */ /* TODO: improve */140140 HXD_EA_RA_SA, /* HXD / EA / RA / SA version */ /* TODO: improve */141141 TB, /* TB version */142142+ HX_CLONE, /* Cheap and less functional clone of the HX chip */142143};143144/*144145 * NOTE: don't know the difference between type 0 and type 1,···207206 * the device descriptors of the X/HX, HXD, EA, RA, SA, TA, TB208207 */209208 if (le16_to_cpu(serial->dev->descriptor.bcdDevice) == 0x300) {210210- type = HX_TA;211211- type_str = "X/HX/TA";209209+ /* Check if the device is a clone */210210+ pl2303_vendor_read(0x9494, 0, serial, buf);211211+ /*212212+ * NOTE: Not sure if this read is really needed.213213+ * The HX returns 0x00, the clone 0x02, but the Windows214214+ * driver seems to ignore the value and continues.215215+ */216216+ pl2303_vendor_write(0x0606, 0xaa, serial);217217+ pl2303_vendor_read(0x8686, 0, serial, buf);218218+ if (buf[0] != 0xaa) {219219+ type = HX_CLONE;220220+ type_str = "X/HX clone (limited functionality)";221221+ } else {222222+ type = HX_TA;223223+ type_str = "X/HX/TA";224224+ }225225+ pl2303_vendor_write(0x0606, 0x00, serial);212226 } else if (le16_to_cpu(serial->dev->descriptor.bcdDevice)213227 == 0x400) {214228 type = HXD_EA_RA_SA;···321305{322306 /*323307 * NOTE: Only the values defined in baud_sup are supported !324324- * => if unsupported values are set, the PL2303 seems to325325- * use 9600 baud (at least my PL2303X always does)308308+ * => if unsupported values are set, the PL2303 uses 9600 baud instead309309+ * => HX clones just don't work at unsupported baud rates < 115200 baud,310310+ * for baud rates > 115200 they run at 115200 baud326311 */327312 const int baud_sup[] = { 75, 150, 300, 600, 1200, 1800, 2400, 3600,328313 4800, 7200, 9600, 14400, 19200, 28800, 38400,···333316 * NOTE: With the exception of type_0/1 devices, the following334317 * additional baud rates are supported (tested with HX rev. 3A only):335318 * 110*, 56000*, 128000, 134400, 161280, 201600, 256000*, 268800,336336- * 403200, 806400. (*: not HX)319319+ * 403200, 806400. (*: not HX and HX clones)337320 *338321 * Maximum values: HXD, TB: 12000000; HX, TA: 6000000;339339- * type_0+1: 1228800; RA: 921600; SA: 115200322322+ * type_0+1: 1228800; RA: 921600; HX clones, SA: 115200340323 *341324 * As long as we are not using this encoding method for anything else342342- * than the type_0+1 and HX chips, there is no point in complicating343343- * the code to support them.325325+ * than the type_0+1, HX and HX clone chips, there is no point in326326+ * complicating the code to support them.344327 */345328 int i;346329···364347 baud = min_t(int, baud, 6000000);365348 else if (type == type_0 || type == type_1)366349 baud = min_t(int, baud, 1228800);350350+ else if (type == HX_CLONE)351351+ baud = min_t(int, baud, 115200);367352 /* Direct (standard) baud rate encoding method */368353 put_unaligned_le32(baud, buf);369354···378359 /*379360 * Divisor based baud rate encoding method380361 *381381- * NOTE: it's not clear if the type_0/1 chips support this method362362+ * NOTE: HX clones do NOT support this method.363363+ * It's not clear if the type_0/1 chips support it.382364 *383365 * divisor = 12MHz * 32 / baudrate = 2^A * B384366 *···472452 * 1) Direct method: encodes the baud rate value directly473453 * => supported by all chip types474454 * 2) Divisor based method: encodes a divisor to a base value (12MHz*32)475475- * => supported by HX chips (and likely not by type_0/1 chips)455455+ * => not supported by HX clones (and likely type_0/1 chips)476456 *477457 * NOTE: Although the divisor based baud rate encoding method is much478458 * more flexible, some of the standard baud rate values can not be···480460 * the device likely uses the same baud rate generator for both methods481461 * so that there is likley no difference.482462 */483483- if (type == type_0 || type == type_1)463463+ if (type == type_0 || type == type_1 || type == HX_CLONE)484464 baud = pl2303_baudrate_encode_direct(baud, type, buf);485465 else486466 baud = pl2303_baudrate_encode_divisor(baud, type, buf);···833813 result = usb_control_msg(serial->dev, usb_sndctrlpipe(serial->dev, 0),834814 BREAK_REQUEST, BREAK_REQUEST_TYPE, state,835815 0, NULL, 0, 100);816816+ /* NOTE: HX clones don't support sending breaks, -EPIPE is returned */836817 if (result)837818 dev_err(&port->dev, "error sending break = %d\n", result);838819}
+28-15
drivers/vhost/scsi.c
···461461 u32 i;462462 for (i = 0; i < tv_cmd->tvc_sgl_count; i++)463463 put_page(sg_page(&tv_cmd->tvc_sgl[i]));464464- }464464+ }465465466466 tcm_vhost_put_inflight(tv_cmd->inflight);467467 percpu_ida_free(&se_sess->sess_tag_pool, se_cmd->map_tag);···13731373 return 0;13741374}1375137513761376+static void vhost_scsi_free(struct vhost_scsi *vs)13771377+{13781378+ if (is_vmalloc_addr(vs))13791379+ vfree(vs);13801380+ else13811381+ kfree(vs);13821382+}13831383+13761384static int vhost_scsi_open(struct inode *inode, struct file *f)13771385{13781386 struct vhost_scsi *vs;13791387 struct vhost_virtqueue **vqs;13801380- int r, i;13881388+ int r = -ENOMEM, i;1381138913821382- vs = kzalloc(sizeof(*vs), GFP_KERNEL);13831383- if (!vs)13841384- return -ENOMEM;13901390+ vs = kzalloc(sizeof(*vs), GFP_KERNEL | __GFP_NOWARN | __GFP_REPEAT);13911391+ if (!vs) {13921392+ vs = vzalloc(sizeof(*vs));13931393+ if (!vs)13941394+ goto err_vs;13951395+ }1385139613861397 vqs = kmalloc(VHOST_SCSI_MAX_VQ * sizeof(*vqs), GFP_KERNEL);13871387- if (!vqs) {13881388- kfree(vs);13891389- return -ENOMEM;13901390- }13981398+ if (!vqs)13991399+ goto err_vqs;1391140013921401 vhost_work_init(&vs->vs_completion_work, vhost_scsi_complete_cmd_work);13931402 vhost_work_init(&vs->vs_event_work, tcm_vhost_evt_work);···1416140714171408 tcm_vhost_init_inflight(vs, NULL);1418140914191419- if (r < 0) {14201420- kfree(vqs);14211421- kfree(vs);14221422- return r;14231423- }14101410+ if (r < 0)14111411+ goto err_init;1424141214251413 f->private_data = vs;14261414 return 0;14151415+14161416+err_init:14171417+ kfree(vqs);14181418+err_vqs:14191419+ vhost_scsi_free(vs);14201420+err_vs:14211421+ return r;14271422}1428142314291424static int vhost_scsi_release(struct inode *inode, struct file *f)···14441431 /* Jobs can re-queue themselves in evt kick handler. Do extra flush. */14451432 vhost_scsi_flush(vs);14461433 kfree(vs->dev.vqs);14471447- kfree(vs);14341434+ vhost_scsi_free(vs);14481435 return 0;14491436}14501437
···10051005 return ret;10061006 }1007100710081008- if (root->ref_cows)10091009- btrfs_reloc_cow_block(trans, root, buf, cow);10081008+ if (root->ref_cows) {10091009+ ret = btrfs_reloc_cow_block(trans, root, buf, cow);10101010+ if (ret)10111011+ return ret;10121012+ }1010101310111014 if (buf == root->node) {10121015 WARN_ON(parent && parent != buf);
+4-13
fs/btrfs/ctree.h
···11181118 */11191119 struct percpu_counter total_bytes_pinned;1120112011211121- /*11221122- * we bump reservation progress every time we decrement11231123- * bytes_reserved. This way people waiting for reservations11241124- * know something good has happened and they can check11251125- * for progress. The number here isn't to be trusted, it11261126- * just shows reclaim activity11271127- */11281128- unsigned long reservation_progress;11291129-11301121 unsigned int full:1; /* indicates that we cannot allocate any more11311122 chunks for this space */11321123 unsigned int chunk_alloc:1; /* set if we are allocating a chunk */···31263135 unsigned num_items)31273136{31283137 return (root->leafsize + root->nodesize * (BTRFS_MAX_LEVEL - 1)) *31293129- 3 * num_items;31383138+ 2 * num_items;31303139}3131314031323141/*···39303939 struct btrfs_root *root);39313940int btrfs_recover_relocation(struct btrfs_root *root);39323941int btrfs_reloc_clone_csums(struct inode *inode, u64 file_pos, u64 len);39333933-void btrfs_reloc_cow_block(struct btrfs_trans_handle *trans,39343934- struct btrfs_root *root, struct extent_buffer *buf,39353935- struct extent_buffer *cow);39423942+int btrfs_reloc_cow_block(struct btrfs_trans_handle *trans,39433943+ struct btrfs_root *root, struct extent_buffer *buf,39443944+ struct extent_buffer *cow);39363945void btrfs_reloc_pre_snapshot(struct btrfs_trans_handle *trans,39373946 struct btrfs_pending_snapshot *pending,39383947 u64 *bytes_to_reserve);
+2-2
fs/btrfs/dev-replace.c
···400400 args->result = BTRFS_IOCTL_DEV_REPLACE_RESULT_NO_ERROR;401401 btrfs_dev_replace_unlock(dev_replace);402402403403- btrfs_wait_all_ordered_extents(root->fs_info, 0);403403+ btrfs_wait_all_ordered_extents(root->fs_info);404404405405 /* force writing the updated state information to disk */406406 trans = btrfs_start_transaction(root, 0);···475475 mutex_unlock(&dev_replace->lock_finishing_cancel_unmount);476476 return ret;477477 }478478- btrfs_wait_all_ordered_extents(root->fs_info, 0);478478+ btrfs_wait_all_ordered_extents(root->fs_info);479479480480 trans = btrfs_start_transaction(root, 0);481481 if (IS_ERR(trans)) {
+2
fs/btrfs/disk-io.c
···157157 { .id = BTRFS_TREE_LOG_OBJECTID, .name_stem = "log" },158158 { .id = BTRFS_TREE_RELOC_OBJECTID, .name_stem = "treloc" },159159 { .id = BTRFS_DATA_RELOC_TREE_OBJECTID, .name_stem = "dreloc" },160160+ { .id = BTRFS_UUID_TREE_OBJECTID, .name_stem = "uuid" },160161 { .id = 0, .name_stem = "tree" },161162};162163···34163415 if (total_errors > max_errors) {34173416 printk(KERN_ERR "btrfs: %d errors while writing supers\n",34183417 total_errors);34183418+ mutex_unlock(&root->fs_info->fs_devices->device_list_mutex);3419341934203420 /* FUA is masked off if unsupported and can't be the reason */34213421 btrfs_error(root->fs_info, -EIO,
+30-27
fs/btrfs/extent-tree.c
···39253925 u64 space_size;39263926 u64 avail;39273927 u64 used;39283928- u64 to_add;3929392839303929 used = space_info->bytes_used + space_info->bytes_reserved +39313930 space_info->bytes_pinned + space_info->bytes_readonly;···39583959 BTRFS_BLOCK_GROUP_RAID10))39593960 avail >>= 1;3960396139613961- to_add = space_info->total_bytes;39623962-39633962 /*39643963 * If we aren't flushing all things, let us overcommit up to39653964 * 1/2th of the space. If we can flush, don't let us overcommit39663965 * too much, let it overcommit up to 1/8 of the space.39673966 */39683967 if (flush == BTRFS_RESERVE_FLUSH_ALL)39693969- to_add >>= 3;39683968+ avail >>= 3;39703969 else39713971- to_add >>= 1;39703970+ avail >>= 1;3972397139733973- /*39743974- * Limit the overcommit to the amount of free space we could possibly39753975- * allocate for chunks.39763976- */39773977- to_add = min(avail, to_add);39783978-39793979- if (used + bytes < space_info->total_bytes + to_add)39723972+ if (used + bytes < space_info->total_bytes + avail)39803973 return 1;39813974 return 0;39823975}···39914000 */39924001 btrfs_start_all_delalloc_inodes(root->fs_info, 0);39934002 if (!current->journal_info)39943994- btrfs_wait_all_ordered_extents(root->fs_info, 0);40034003+ btrfs_wait_all_ordered_extents(root->fs_info);39954004 }39964005}39974006···40214030 if (delalloc_bytes == 0) {40224031 if (trans)40234032 return;40244024- btrfs_wait_all_ordered_extents(root->fs_info, 0);40334033+ btrfs_wait_all_ordered_extents(root->fs_info);40254034 return;40264035 }40274036···4049405840504059 loops++;40514060 if (wait_ordered && !trans) {40524052- btrfs_wait_all_ordered_extents(root->fs_info, 0);40614061+ btrfs_wait_all_ordered_extents(root->fs_info);40534062 } else {40544063 time_left = schedule_timeout_killable(1);40554064 if (time_left)···44564465 space_info->bytes_may_use -= num_bytes;44574466 trace_btrfs_space_reservation(fs_info, "space_info",44584467 space_info->flags, num_bytes, 0);44594459- space_info->reservation_progress++;44604468 spin_unlock(&space_info->lock);44614469 }44624470 }···46564666 sinfo->bytes_may_use -= num_bytes;46574667 trace_btrfs_space_reservation(fs_info, "space_info",46584668 sinfo->flags, num_bytes, 0);46594659- sinfo->reservation_progress++;46604669 block_rsv->reserved = block_rsv->size;46614670 block_rsv->full = 1;46624671 }···54355446 space_info->bytes_readonly += num_bytes;54365447 cache->reserved -= num_bytes;54375448 space_info->bytes_reserved -= num_bytes;54385438- space_info->reservation_progress++;54395449 }54405450 spin_unlock(&cache->lock);54415451 spin_unlock(&space_info->lock);···61056117/*61066118 * walks the btree of allocated extents and find a hole of a given size.61076119 * The key ins is changed to record the hole:61086108- * ins->objectid == block start61206120+ * ins->objectid == start position61096121 * ins->flags = BTRFS_EXTENT_ITEM_KEY61106110- * ins->offset == number of blocks61226122+ * ins->offset == the size of the hole.61116123 * Any available blocks before search_start are skipped.61246124+ *61256125+ * If there is no suitable free space, we will record the max size of61266126+ * the free space extent currently.61126127 */61136128static noinline int find_free_extent(struct btrfs_root *orig_root,61146129 u64 num_bytes, u64 empty_size,···61246133 struct btrfs_block_group_cache *block_group = NULL;61256134 struct btrfs_block_group_cache *used_block_group;61266135 u64 search_start = 0;61366136+ u64 max_extent_size = 0;61276137 int empty_cluster = 2 * 1024 * 1024;61286138 struct btrfs_space_info *space_info;61296139 int loop = 0;···62846292 btrfs_get_block_group(used_block_group);6285629362866294 offset = btrfs_alloc_from_cluster(used_block_group,62876287- last_ptr, num_bytes, used_block_group->key.objectid);62956295+ last_ptr,62966296+ num_bytes,62976297+ used_block_group->key.objectid,62986298+ &max_extent_size);62886299 if (offset) {62896300 /* we have a block, we're done */62906301 spin_unlock(&last_ptr->refill_lock);···63506355 * cluster63516356 */63526357 offset = btrfs_alloc_from_cluster(block_group,63536353- last_ptr, num_bytes,63546354- search_start);63586358+ last_ptr,63596359+ num_bytes,63606360+ search_start,63616361+ &max_extent_size);63556362 if (offset) {63566363 /* we found one, proceed */63576364 spin_unlock(&last_ptr->refill_lock);···63886391 if (cached &&63896392 block_group->free_space_ctl->free_space <63906393 num_bytes + empty_cluster + empty_size) {63946394+ if (block_group->free_space_ctl->free_space >63956395+ max_extent_size)63966396+ max_extent_size =63976397+ block_group->free_space_ctl->free_space;63916398 spin_unlock(&block_group->free_space_ctl->tree_lock);63926399 goto loop;63936400 }63946401 spin_unlock(&block_group->free_space_ctl->tree_lock);6395640263966403 offset = btrfs_find_space_for_alloc(block_group, search_start,63976397- num_bytes, empty_size);64046404+ num_bytes, empty_size,64056405+ &max_extent_size);63986406 /*63996407 * If we didn't find a chunk, and we haven't failed on this64006408 * block group before, and this block group is in the middle of···65176515 ret = 0;65186516 }65196517out:65206520-65186518+ if (ret == -ENOSPC)65196519+ ins->offset = max_extent_size;65216520 return ret;65226521}65236522···65766573 flags);6577657465786575 if (ret == -ENOSPC) {65796579- if (!final_tried) {65806580- num_bytes = num_bytes >> 1;65766576+ if (!final_tried && ins->offset) {65776577+ num_bytes = min(num_bytes >> 1, ins->offset);65816578 num_bytes = round_down(num_bytes, root->sectorsize);65826579 num_bytes = max(num_bytes, min_alloc_size);65836580 if (num_bytes == min_alloc_size)
···1859185918601860 ret = btrfs_log_dentry_safe(trans, root, dentry);18611861 if (ret < 0) {18621862- mutex_unlock(&inode->i_mutex);18631863- goto out;18621862+ /* Fallthrough and commit/free transaction. */18631863+ ret = 1;18641864 }1865186518661866 /* we've logged all the items and now have a consistent
+47-20
fs/btrfs/free-space-cache.c
···14311431 ctl->free_space += bytes;14321432}1433143314341434+/*14351435+ * If we can not find suitable extent, we will use bytes to record14361436+ * the size of the max extent.14371437+ */14341438static int search_bitmap(struct btrfs_free_space_ctl *ctl,14351439 struct btrfs_free_space *bitmap_info, u64 *offset,14361440 u64 *bytes)14371441{14381442 unsigned long found_bits = 0;14431443+ unsigned long max_bits = 0;14391444 unsigned long bits, i;14401445 unsigned long next_zero;14461446+ unsigned long extent_bits;1441144714421448 i = offset_to_bit(bitmap_info->offset, ctl->unit,14431449 max_t(u64, *offset, bitmap_info->offset));···14521446 for_each_set_bit_from(i, bitmap_info->bitmap, BITS_PER_BITMAP) {14531447 next_zero = find_next_zero_bit(bitmap_info->bitmap,14541448 BITS_PER_BITMAP, i);14551455- if ((next_zero - i) >= bits) {14561456- found_bits = next_zero - i;14491449+ extent_bits = next_zero - i;14501450+ if (extent_bits >= bits) {14511451+ found_bits = extent_bits;14571452 break;14531453+ } else if (extent_bits > max_bits) {14541454+ max_bits = extent_bits;14581455 }14591456 i = next_zero;14601457 }···14681459 return 0;14691460 }1470146114621462+ *bytes = (u64)(max_bits) * ctl->unit;14711463 return -1;14721464}1473146514661466+/* Cache the size of the max extent in bytes */14741467static struct btrfs_free_space *14751468find_free_space(struct btrfs_free_space_ctl *ctl, u64 *offset, u64 *bytes,14761476- unsigned long align)14691469+ unsigned long align, u64 *max_extent_size)14771470{14781471 struct btrfs_free_space *entry;14791472 struct rb_node *node;14801480- u64 ctl_off;14811473 u64 tmp;14821474 u64 align_off;14831475 int ret;1484147614851477 if (!ctl->free_space_offset.rb_node)14861486- return NULL;14781478+ goto out;1487147914881480 entry = tree_search_offset(ctl, offset_to_bitmap(ctl, *offset), 0, 1);14891481 if (!entry)14901490- return NULL;14821482+ goto out;1491148314921484 for (node = &entry->offset_index; node; node = rb_next(node)) {14931485 entry = rb_entry(node, struct btrfs_free_space, offset_index);14941494- if (entry->bytes < *bytes)14861486+ if (entry->bytes < *bytes) {14871487+ if (entry->bytes > *max_extent_size)14881488+ *max_extent_size = entry->bytes;14951489 continue;14901490+ }1496149114971492 /* make sure the space returned is big enough14981493 * to match our requested alignment14991494 */15001495 if (*bytes >= align) {15011501- ctl_off = entry->offset - ctl->start;15021502- tmp = ctl_off + align - 1;;14961496+ tmp = entry->offset - ctl->start + align - 1;15031497 do_div(tmp, align);15041498 tmp = tmp * align + ctl->start;15051499 align_off = tmp - entry->offset;···15111499 tmp = entry->offset;15121500 }1513150115141514- if (entry->bytes < *bytes + align_off)15021502+ if (entry->bytes < *bytes + align_off) {15031503+ if (entry->bytes > *max_extent_size)15041504+ *max_extent_size = entry->bytes;15151505 continue;15061506+ }1516150715171508 if (entry->bitmap) {15181518- ret = search_bitmap(ctl, entry, &tmp, bytes);15091509+ u64 size = *bytes;15101510+15111511+ ret = search_bitmap(ctl, entry, &tmp, &size);15191512 if (!ret) {15201513 *offset = tmp;15141514+ *bytes = size;15211515 return entry;15161516+ } else if (size > *max_extent_size) {15171517+ *max_extent_size = size;15221518 }15231519 continue;15241520 }···15351515 *bytes = entry->bytes - align_off;15361516 return entry;15371517 }15381538-15181518+out:15391519 return NULL;15401520}15411521···21362116}2137211721382118u64 btrfs_find_space_for_alloc(struct btrfs_block_group_cache *block_group,21392139- u64 offset, u64 bytes, u64 empty_size)21192119+ u64 offset, u64 bytes, u64 empty_size,21202120+ u64 *max_extent_size)21402121{21412122 struct btrfs_free_space_ctl *ctl = block_group->free_space_ctl;21422123 struct btrfs_free_space *entry = NULL;···2148212721492128 spin_lock(&ctl->tree_lock);21502129 entry = find_free_space(ctl, &offset, &bytes_search,21512151- block_group->full_stripe_len);21302130+ block_group->full_stripe_len, max_extent_size);21522131 if (!entry)21532132 goto out;21542133···21582137 if (!entry->bytes)21592138 free_bitmap(ctl, entry);21602139 } else {21612161-21622140 unlink_free_space(ctl, entry);21632141 align_gap_len = offset - entry->offset;21642142 align_gap = entry->offset;···21712151 else21722152 link_free_space(ctl, entry);21732153 }21742174-21752154out:21762155 spin_unlock(&ctl->tree_lock);21772156···22252206static u64 btrfs_alloc_from_bitmap(struct btrfs_block_group_cache *block_group,22262207 struct btrfs_free_cluster *cluster,22272208 struct btrfs_free_space *entry,22282228- u64 bytes, u64 min_start)22092209+ u64 bytes, u64 min_start,22102210+ u64 *max_extent_size)22292211{22302212 struct btrfs_free_space_ctl *ctl = block_group->free_space_ctl;22312213 int err;···22382218 search_bytes = bytes;2239221922402220 err = search_bitmap(ctl, entry, &search_start, &search_bytes);22412241- if (err)22212221+ if (err) {22222222+ if (search_bytes > *max_extent_size)22232223+ *max_extent_size = search_bytes;22422224 return 0;22252225+ }2243222622442227 ret = search_start;22452228 __bitmap_clear_bits(ctl, entry, ret, bytes);···22572234 */22582235u64 btrfs_alloc_from_cluster(struct btrfs_block_group_cache *block_group,22592236 struct btrfs_free_cluster *cluster, u64 bytes,22602260- u64 min_start)22372237+ u64 min_start, u64 *max_extent_size)22612238{22622239 struct btrfs_free_space_ctl *ctl = block_group->free_space_ctl;22632240 struct btrfs_free_space *entry = NULL;···2277225422782255 entry = rb_entry(node, struct btrfs_free_space, offset_index);22792256 while(1) {22572257+ if (entry->bytes < bytes && entry->bytes > *max_extent_size)22582258+ *max_extent_size = entry->bytes;22592259+22802260 if (entry->bytes < bytes ||22812261 (!entry->bitmap && entry->offset < min_start)) {22822262 node = rb_next(&entry->offset_index);···22932267 if (entry->bitmap) {22942268 ret = btrfs_alloc_from_bitmap(block_group,22952269 cluster, entry, bytes,22962296- cluster->window_start);22702270+ cluster->window_start,22712271+ max_extent_size);22972272 if (ret == 0) {22982273 node = rb_next(&entry->offset_index);22992274 if (!node)
···9393 */9494#define LOG_WALK_PIN_ONLY 09595#define LOG_WALK_REPLAY_INODES 19696-#define LOG_WALK_REPLAY_ALL 29696+#define LOG_WALK_REPLAY_DIR_INDEX 29797+#define LOG_WALK_REPLAY_ALL 397989899static int btrfs_log_inode(struct btrfs_trans_handle *trans,99100 struct btrfs_root *root, struct inode *inode,···394393 if (inode_item) {395394 struct btrfs_inode_item *item;396395 u64 nbytes;396396+ u32 mode;397397398398 item = btrfs_item_ptr(path->nodes[0], path->slots[0],399399 struct btrfs_inode_item);···402400 item = btrfs_item_ptr(eb, slot,403401 struct btrfs_inode_item);404402 btrfs_set_inode_nbytes(eb, item, nbytes);403403+404404+ /*405405+ * If this is a directory we need to reset the i_size to406406+ * 0 so that we can set it up properly when replaying407407+ * the rest of the items in this log.408408+ */409409+ mode = btrfs_inode_mode(eb, item);410410+ if (S_ISDIR(mode))411411+ btrfs_set_inode_size(eb, item, 0);405412 }406413 } else if (inode_item) {407414 struct btrfs_inode_item *item;415415+ u32 mode;408416409417 /*410418 * New inode, set nbytes to 0 so that the nbytes comes out···422410 */423411 item = btrfs_item_ptr(eb, slot, struct btrfs_inode_item);424412 btrfs_set_inode_nbytes(eb, item, 0);413413+414414+ /*415415+ * If this is a directory we need to reset the i_size to 0 so416416+ * that we can set it up properly when replaying the rest of417417+ * the items in this log.418418+ */419419+ mode = btrfs_inode_mode(eb, item);420420+ if (S_ISDIR(mode))421421+ btrfs_set_inode_size(eb, item, 0);425422 }426423insert:427424 btrfs_release_path(path);···15171496 iput(inode);15181497 return -EIO;15191498 }14991499+15201500 ret = btrfs_add_link(trans, dir, inode, name, name_len, 1, index);1521150115221502 /* FIXME, put inode into FIXUP list */···15561534 u8 log_type;15571535 int exists;15581536 int ret = 0;15371537+ bool update_size = (key->type == BTRFS_DIR_INDEX_KEY);1559153815601539 dir = read_one_inode(root, key->objectid);15611540 if (!dir)···16271604 goto insert;16281605out:16291606 btrfs_release_path(path);16071607+ if (!ret && update_size) {16081608+ btrfs_i_size_write(dir, dir->i_size + name_len * 2);16091609+ ret = btrfs_update_inode(trans, root, dir);16101610+ }16301611 kfree(name);16311612 iput(dir);16321613 return ret;···16411614 name, name_len, log_type, &log_key);16421615 if (ret && ret != -ENOENT)16431616 goto out;16171617+ update_size = false;16441618 ret = 0;16451619 goto out;16461620}···20552027 if (ret)20562028 break;20572029 }20302030+20312031+ if (key.type == BTRFS_DIR_INDEX_KEY &&20322032+ wc->stage == LOG_WALK_REPLAY_DIR_INDEX) {20332033+ ret = replay_one_dir_item(wc->trans, root, path,20342034+ eb, i, &key);20352035+ if (ret)20362036+ break;20372037+ }20382038+20582039 if (wc->stage < LOG_WALK_REPLAY_ALL)20592040 continue;20602041···20852048 eb, i, &key);20862049 if (ret)20872050 break;20882088- } else if (key.type == BTRFS_DIR_ITEM_KEY ||20892089- key.type == BTRFS_DIR_INDEX_KEY) {20512051+ } else if (key.type == BTRFS_DIR_ITEM_KEY) {20902052 ret = replay_one_dir_item(wc->trans, root, path,20912053 eb, i, &key);20922054 if (ret)···38413805 int ret = 0;38423806 struct btrfs_root *root;38433807 struct dentry *old_parent = NULL;38083808+ struct inode *orig_inode = inode;3844380938453810 /*38463811 * for regular files, if its inode is already on disk, we don't···38613824 }3862382538633826 while (1) {38643864- BTRFS_I(inode)->logged_trans = trans->transid;38273827+ /*38283828+ * If we are logging a directory then we start with our inode,38293829+ * not our parents inode, so we need to skipp setting the38303830+ * logged_trans so that further down in the log code we don't38313831+ * think this inode has already been logged.38323832+ */38333833+ if (inode != orig_inode)38343834+ BTRFS_I(inode)->logged_trans = trans->transid;38653835 smp_mb();3866383638673837 if (BTRFS_I(inode)->last_unlink_trans > last_committed) {
···26562656 int acc_mode;26572657 int create_error = 0;26582658 struct dentry *const DENTRY_NOT_SET = (void *) -1UL;26592659+ bool excl;2659266026602661 BUG_ON(dentry->d_inode);26612662···26702669 if ((open_flag & O_CREAT) && !IS_POSIXACL(dir))26712670 mode &= ~current_umask();2672267126732673- if ((open_flag & (O_EXCL | O_CREAT)) == (O_EXCL | O_CREAT)) {26722672+ excl = (open_flag & (O_EXCL | O_CREAT)) == (O_EXCL | O_CREAT);26732673+ if (excl)26742674 open_flag &= ~O_TRUNC;26752675- *opened |= FILE_CREATED;26762676- }2677267526782676 /*26792677 * Checking write permission is tricky, bacuse we don't know if we are···27252725 goto out;27262726 }2727272727282728- acc_mode = op->acc_mode;27292729- if (*opened & FILE_CREATED) {27302730- fsnotify_create(dir, dentry);27312731- acc_mode = MAY_OPEN;27322732- }27332733-27342728 if (error) { /* returned 1, that is */27352729 if (WARN_ON(file->f_path.dentry == DENTRY_NOT_SET)) {27362730 error = -EIO;···27342740 dput(dentry);27352741 dentry = file->f_path.dentry;27362742 }27372737- if (create_error && dentry->d_inode == NULL) {27382738- error = create_error;27392739- goto out;27432743+ if (*opened & FILE_CREATED)27442744+ fsnotify_create(dir, dentry);27452745+ if (!dentry->d_inode) {27462746+ WARN_ON(*opened & FILE_CREATED);27472747+ if (create_error) {27482748+ error = create_error;27492749+ goto out;27502750+ }27512751+ } else {27522752+ if (excl && !(*opened & FILE_CREATED)) {27532753+ error = -EEXIST;27542754+ goto out;27552755+ }27402756 }27412757 goto looked_up;27422758 }···27552751 * We didn't have the inode before the open, so check open permission27562752 * here.27572753 */27542754+ acc_mode = op->acc_mode;27552755+ if (*opened & FILE_CREATED) {27562756+ WARN_ON(!(open_flag & O_CREAT));27572757+ fsnotify_create(dir, dentry);27582758+ acc_mode = MAY_OPEN;27592759+ }27582760 error = may_open(&file->f_path, acc_mode, open_flag);27592761 if (error)27602762 fput(file);
+3
fs/nfs/dir.c
···13921392{13931393 int err;1394139413951395+ if ((open_flags & (O_CREAT | O_EXCL)) == (O_CREAT | O_EXCL))13961396+ *opened |= FILE_CREATED;13971397+13951398 err = finish_open(file, dentry, do_open, opened);13961399 if (err)13971400 goto out;
+18-3
fs/open.c
···744744745745/**746746 * finish_open - finish opening a file747747- * @od: opaque open data747747+ * @file: file pointer748748 * @dentry: pointer to dentry749749 * @open: open callback750750+ * @opened: state of open750751 *751752 * This can be used to finish opening a file passed to i_op->atomic_open().752753 *753754 * If the open callback is set to NULL, then the standard f_op->open()754755 * filesystem callback is substituted.756756+ *757757+ * NB: the dentry reference is _not_ consumed. If, for example, the dentry is758758+ * the return value of d_splice_alias(), then the caller needs to perform dput()759759+ * on it after finish_open().760760+ *761761+ * On successful return @file is a fully instantiated open file. After this, if762762+ * an error occurs in ->atomic_open(), it needs to clean up with fput().763763+ *764764+ * Returns zero on success or -errno if the open failed.755765 */756766int finish_open(struct file *file, struct dentry *dentry,757767 int (*open)(struct inode *, struct file *),···782772/**783773 * finish_no_open - finish ->atomic_open() without opening the file784774 *785785- * @od: opaque open data775775+ * @file: file pointer786776 * @dentry: dentry or NULL (as returned from ->lookup())787777 *788778 * This can be used to set the result of a successful lookup in ->atomic_open().789789- * The filesystem's atomic_open() method shall return NULL after calling this.779779+ *780780+ * NB: unlike finish_open() this function does consume the dentry reference and781781+ * the caller need not dput() it.782782+ *783783+ * Returns "1" which must be the return value of ->atomic_open() after having784784+ * called this function.790785 */791786int finish_no_open(struct file *file, struct dentry *dentry)792787{
+23-6
fs/pstore/platform.c
···168168 int err, ret;169169170170 ret = -EIO;171171- err = zlib_inflateInit(&stream);171171+ err = zlib_inflateInit2(&stream, WINDOW_BITS);172172 if (err != Z_OK)173173 goto error;174174···195195static void allocate_buf_for_compression(void)196196{197197 size_t size;198198+ size_t cmpr;198199199199- big_oops_buf_sz = (psinfo->bufsize * 100) / 45;200200+ switch (psinfo->bufsize) {201201+ /* buffer range for efivars */202202+ case 1000 ... 2000:203203+ cmpr = 56;204204+ break;205205+ case 2001 ... 3000:206206+ cmpr = 54;207207+ break;208208+ case 3001 ... 3999:209209+ cmpr = 52;210210+ break;211211+ /* buffer range for nvram, erst */212212+ case 4000 ... 10000:213213+ cmpr = 45;214214+ break;215215+ default:216216+ cmpr = 60;217217+ break;218218+ }219219+220220+ big_oops_buf_sz = (psinfo->bufsize * 100) / cmpr;200221 big_oops_buf = kmalloc(big_oops_buf_sz, GFP_KERNEL);201222 if (big_oops_buf) {202223 size = max(zlib_deflate_workspacesize(WINDOW_BITS, MEM_LEVEL),···316295 compressed = true;317296 total_len = zipped_len;318297 } else {319319- pr_err("pstore: compression failed for Part %d"320320- " returned %d\n", part, zipped_len);321321- pr_err("pstore: Capture uncompressed"322322- " oops/panic report of Part %d\n", part);323298 compressed = false;324299 total_len = copy_kmsg_to_buffer(hsize, len);325300 }
···950950 * multiple net devices on single physical port.951951 *952952 * void (*ndo_add_vxlan_port)(struct net_device *dev,953953- * sa_family_t sa_family, __u16 port);953953+ * sa_family_t sa_family, __be16 port);954954 * Called by vxlan to notiy a driver about the UDP port and socket955955 * address family that vxlan is listnening to. It is called only when956956 * a new port starts listening. The operation is protected by the957957 * vxlan_net->sock_lock.958958 *959959 * void (*ndo_del_vxlan_port)(struct net_device *dev,960960- * sa_family_t sa_family, __u16 port);960960+ * sa_family_t sa_family, __be16 port);961961 * Called by vxlan to notify the driver about a UDP port and socket962962 * address family that vxlan is not listening to anymore. The operation963963 * is protected by the vxlan_net->sock_lock.···10931093 struct netdev_phys_port_id *ppid);10941094 void (*ndo_add_vxlan_port)(struct net_device *dev,10951095 sa_family_t sa_family,10961096- __u16 port);10961096+ __be16 port);10971097 void (*ndo_del_vxlan_port)(struct net_device *dev,10981098 sa_family_t sa_family,10991099- __u16 port);10991099+ __be16 port);11001100};1101110111021102/*
+4-2
include/linux/netfilter/ipset/ip_set.h
···296296297297/* Match elements marked with nomatch */298298static inline bool299299-ip_set_enomatch(int ret, u32 flags, enum ipset_adt adt)299299+ip_set_enomatch(int ret, u32 flags, enum ipset_adt adt, struct ip_set *set)300300{301301 return adt == IPSET_TEST &&302302- ret == -ENOTEMPTY && ((flags >> 16) & IPSET_FLAG_NOMATCH);302302+ (set->type->features & IPSET_TYPE_NOMATCH) &&303303+ ((flags >> 16) & IPSET_FLAG_NOMATCH) &&304304+ (ret > 0 || ret == -ENOTEMPTY);303305}304306305307/* Check the NLA_F_NET_BYTEORDER flag */
+1
include/linux/timex.h
···141141extern void hardpps(const struct timespec *, const struct timespec *);142142143143int read_current_timer(unsigned long *timer_val);144144+void ntp_notify_cmos_timer(void);144145145146/* The clock frequency of the i8253/i8254 PIT */146147#define PIT_TICK_RATE 1193182ul
+8-4
include/net/ip.h
···264264265265extern void __ip_select_ident(struct iphdr *iph, struct dst_entry *dst, int more);266266267267-static inline void ip_select_ident(struct iphdr *iph, struct dst_entry *dst, struct sock *sk)267267+static inline void ip_select_ident(struct sk_buff *skb, struct dst_entry *dst, struct sock *sk)268268{269269- if (iph->frag_off & htons(IP_DF)) {269269+ struct iphdr *iph = ip_hdr(skb);270270+271271+ if ((iph->frag_off & htons(IP_DF)) && !skb->local_df) {270272 /* This is only to work around buggy Windows95/2000271273 * VJ compression implementations. If the ID field272274 * does not change, they drop every other packet in···280278 __ip_select_ident(iph, dst, 0);281279}282280283283-static inline void ip_select_ident_more(struct iphdr *iph, struct dst_entry *dst, struct sock *sk, int more)281281+static inline void ip_select_ident_more(struct sk_buff *skb, struct dst_entry *dst, struct sock *sk, int more)284282{285285- if (iph->frag_off & htons(IP_DF)) {283283+ struct iphdr *iph = ip_hdr(skb);284284+285285+ if ((iph->frag_off & htons(IP_DF)) && !skb->local_df) {286286 if (sk && inet_sk(sk)->inet_daddr) {287287 iph->id = htons(inet_sk(sk)->inet_id);288288 inet_sk(sk)->inet_id += 1 + more;
+1-1
include/net/netfilter/nf_conntrack_extend.h
···8686static inline void nf_ct_ext_free(struct nf_conn *ct)8787{8888 if (ct->ext)8989- kfree(ct->ext);8989+ kfree_rcu(ct->ext, rcu);9090}91919292/* Add this type, returns pointer to data or NULL. */
···59285928 cfs_rq = task_cfs_rq(current);59295929 curr = cfs_rq->curr;5930593059315931- if (unlikely(task_cpu(p) != this_cpu)) {59325932- rcu_read_lock();59335933- __set_task_cpu(p, this_cpu);59345934- rcu_read_unlock();59355935- }59315931+ /*59325932+ * Not only the cpu but also the task_group of the parent might have59335933+ * been changed after parent->se.parent,cfs_rq were copied to59345934+ * child->se.parent,cfs_rq. So call __set_task_cpu() to make those59355935+ * of child point to valid ones.59365936+ */59375937+ rcu_read_lock();59385938+ __set_task_cpu(p, this_cpu);59395939+ rcu_read_unlock();5936594059375941 update_curr(cfs_rq);59385942
+3-2
kernel/sched/stats.h
···104104}105105106106/*107107- * Called when a process ceases being the active-running process, either108108- * voluntarily or involuntarily. Now we can calculate how long we ran.107107+ * Called when a process ceases being the active-running process involuntarily108108+ * due, typically, to expiring its time slice (this may also be called when109109+ * switching to the idle task). Now we can calculate how long we ran.109110 * Also, if the process is still in the TASK_RUNNING state, call110111 * sched_info_queued() to mark that it has now again started waiting on111112 * the runqueue.
···168168 case ETH_P_8021Q:169169 vhdr = (struct vlan_ethhdr *)skb->data;170170 vid = ntohs(vhdr->h_vlan_TCI) & VLAN_VID_MASK;171171+ vid |= BATADV_VLAN_HAS_TAG;171172172173 if (vhdr->h_vlan_encapsulated_proto != ethertype)173174 break;···332331 case ETH_P_8021Q:333332 vhdr = (struct vlan_ethhdr *)skb->data;334333 vid = ntohs(vhdr->h_vlan_TCI) & VLAN_VID_MASK;334334+ vid |= BATADV_VLAN_HAS_TAG;335335336336 if (vhdr->h_vlan_encapsulated_proto != ethertype)337337 break;
+2-2
net/bridge/br_netlink.c
···207207 struct net_device *dev, u32 filter_mask)208208{209209 int err = 0;210210- struct net_bridge_port *port = br_port_get_rcu(dev);210210+ struct net_bridge_port *port = br_port_get_rtnl(dev);211211212212 /* not a bridge port and */213213 if (!port && !(filter_mask & RTEXT_FILTER_BRVLAN))···451451 struct net_port_vlans *pv;452452453453 if (br_port_exists(dev))454454- pv = nbp_get_vlan_info(br_port_get_rcu(dev));454454+ pv = nbp_get_vlan_info(br_port_get_rtnl(dev));455455 else if (dev->priv_flags & IFF_EBRIDGE)456456 pv = br_get_vlan_info((struct net_bridge *)netdev_priv(dev));457457 else
+3-5
net/bridge/br_private.h
···202202203203static inline struct net_bridge_port *br_port_get_rcu(const struct net_device *dev)204204{205205- struct net_bridge_port *port =206206- rcu_dereference_rtnl(dev->rx_handler_data);207207-208208- return br_port_exists(dev) ? port : NULL;205205+ return rcu_dereference(dev->rx_handler_data);209206}210207211211-static inline struct net_bridge_port *br_port_get_rtnl(struct net_device *dev)208208+static inline struct net_bridge_port *br_port_get_rtnl(const struct net_device *dev)212209{213210 return br_port_exists(dev) ?214211 rtnl_dereference(dev->rx_handler_data) : NULL;···743746extern void br_init_port(struct net_bridge_port *p);744747extern void br_become_designated_port(struct net_bridge_port *p);745748749749+extern void __br_set_forward_delay(struct net_bridge *br, unsigned long t);746750extern int br_set_forward_delay(struct net_bridge *br, unsigned long x);747751extern int br_set_hello_time(struct net_bridge *br, unsigned long x);748752extern int br_set_max_age(struct net_bridge *br, unsigned long x);
+19-10
net/bridge/br_stp.c
···209209 p->designated_age = jiffies - bpdu->message_age;210210211211 mod_timer(&p->message_age_timer, jiffies212212- + (p->br->max_age - bpdu->message_age));212212+ + (bpdu->max_age - bpdu->message_age));213213}214214215215/* called under bridge lock */···544544545545}546546547547-int br_set_forward_delay(struct net_bridge *br, unsigned long val)547547+void __br_set_forward_delay(struct net_bridge *br, unsigned long t)548548{549549- unsigned long t = clock_t_to_jiffies(val);550550-551551- if (br->stp_enabled != BR_NO_STP &&552552- (t < BR_MIN_FORWARD_DELAY || t > BR_MAX_FORWARD_DELAY))553553- return -ERANGE;554554-555555- spin_lock_bh(&br->lock);556549 br->bridge_forward_delay = t;557550 if (br_is_root_bridge(br))558551 br->forward_delay = br->bridge_forward_delay;552552+}553553+554554+int br_set_forward_delay(struct net_bridge *br, unsigned long val)555555+{556556+ unsigned long t = clock_t_to_jiffies(val);557557+ int err = -ERANGE;558558+559559+ spin_lock_bh(&br->lock);560560+ if (br->stp_enabled != BR_NO_STP &&561561+ (t < BR_MIN_FORWARD_DELAY || t > BR_MAX_FORWARD_DELAY))562562+ goto unlock;563563+564564+ __br_set_forward_delay(br, t);565565+ err = 0;566566+567567+unlock:559568 spin_unlock_bh(&br->lock);560560- return 0;569569+ return err;561570}
+10-2
net/bridge/br_stp_if.c
···129129 char *envp[] = { NULL };130130131131 r = call_usermodehelper(BR_STP_PROG, argv, envp, UMH_WAIT_PROC);132132+133133+ spin_lock_bh(&br->lock);134134+135135+ if (br->bridge_forward_delay < BR_MIN_FORWARD_DELAY)136136+ __br_set_forward_delay(br, BR_MIN_FORWARD_DELAY);137137+ else if (br->bridge_forward_delay < BR_MAX_FORWARD_DELAY)138138+ __br_set_forward_delay(br, BR_MAX_FORWARD_DELAY);139139+132140 if (r == 0) {133141 br->stp_enabled = BR_USER_STP;134142 br_debug(br, "userspace STP started\n");···145137 br_debug(br, "using kernel STP\n");146138147139 /* To start timers on any ports left in blocking */148148- spin_lock_bh(&br->lock);149140 br_port_state_selection(br);150150- spin_unlock_bh(&br->lock);151141 }142142+143143+ spin_unlock_bh(&br->lock);152144}153145154146static void br_stp_stop(struct net_bridge *br)
+11
net/ceph/osd_client.c
···22162216EXPORT_SYMBOL(ceph_osdc_sync);2217221722182218/*22192219+ * Call all pending notify callbacks - for use after a watch is22202220+ * unregistered, to make sure no more callbacks for it will be invoked22212221+ */22222222+extern void ceph_osdc_flush_notifies(struct ceph_osd_client *osdc)22232223+{22242224+ flush_workqueue(osdc->notify_wq);22252225+}22262226+EXPORT_SYMBOL(ceph_osdc_flush_notifies);22272227+22282228+22292229+/*22192230 * init, shutdown22202231 */22212232int ceph_osdc_init(struct ceph_osd_client *osdc, struct ceph_client *client)
···3232 * At the moment of writing this notes identifier of IP packets is generated3333 * to be unpredictable using this code only for packets subjected3434 * (actually or potentially) to defragmentation. I.e. DF packets less than3535- * PMTU in size uses a constant ID and do not use this code (see3636- * ip_select_ident() in include/net/ip.h).3535+ * PMTU in size when local fragmentation is disabled use a constant ID and do3636+ * not use this code (see ip_select_ident() in include/net/ip.h).3737 *3838 * Route cache entries hold references to our nodes.3939 * New cache entries get references via lookup by destination IP address in
···502502 * ACKs, wait for troubles.503503 */504504 if (crtt > tp->srtt) {505505- inet_csk(sk)->icsk_rto = crtt + max(crtt >> 2, tcp_rto_min(sk));505505+ /* Set RTO like tcp_rtt_estimator(), but from cached RTT. */506506+ crtt >>= 3;507507+ inet_csk(sk)->icsk_rto = crtt + max(2 * crtt, tcp_rto_min(sk));506508 } else if (tp->srtt == 0) {507509 /* RFC6298: 5.7 We've failed to get a valid RTT sample from508510 * 3WHS. This is most likely due to retransmission,
···10521052 * Not an artificial restriction anymore, as we must prevent10531053 * possible loops created by swapping in setlist type of sets. */10541054 if (!(from->type->features == to->type->features &&10551055- from->type->family == to->type->family))10551055+ from->family == to->family))10561056 return -IPSET_ERR_TYPE_MISMATCH;1057105710581058 strncpy(from_name, from->name, IPSET_MAXNAMELEN);···14891489 if (ret == -EAGAIN)14901490 ret = 1;1491149114921492- return (ret < 0 && ret != -ENOTEMPTY) ? ret :14931493- ret > 0 ? 0 : -IPSET_ERR_EXIST;14921492+ return ret > 0 ? 0 : -IPSET_ERR_EXIST;14941493}1495149414961495/* Get headed data of a set */
···634634 break;635635 case ICMP_REDIRECT:636636 sctp_icmp_redirect(sk, transport, skb);637637- err = 0;638638- break;637637+ /* Fall through to out_unlock. */639638 default:640639 goto out_unlock;641640 }
+14-30
net/sctp/ipv6.c
···183183 break;184184 case NDISC_REDIRECT:185185 sctp_icmp_redirect(sk, transport, skb);186186- break;186186+ goto out_unlock;187187 default:188188 break;189189 }···204204 in6_dev_put(idev);205205}206206207207-/* Based on tcp_v6_xmit() in tcp_ipv6.c. */208207static int sctp_v6_xmit(struct sk_buff *skb, struct sctp_transport *transport)209208{210209 struct sock *sk = skb->sk;211210 struct ipv6_pinfo *np = inet6_sk(sk);212212- struct flowi6 fl6;213213-214214- memset(&fl6, 0, sizeof(fl6));215215-216216- fl6.flowi6_proto = sk->sk_protocol;217217-218218- /* Fill in the dest address from the route entry passed with the skb219219- * and the source address from the transport.220220- */221221- fl6.daddr = transport->ipaddr.v6.sin6_addr;222222- fl6.saddr = transport->saddr.v6.sin6_addr;223223-224224- fl6.flowlabel = np->flow_label;225225- IP6_ECN_flow_xmit(sk, fl6.flowlabel);226226- if (ipv6_addr_type(&fl6.saddr) & IPV6_ADDR_LINKLOCAL)227227- fl6.flowi6_oif = transport->saddr.v6.sin6_scope_id;228228- else229229- fl6.flowi6_oif = sk->sk_bound_dev_if;230230-231231- if (np->opt && np->opt->srcrt) {232232- struct rt0_hdr *rt0 = (struct rt0_hdr *) np->opt->srcrt;233233- fl6.daddr = *rt0->addr;234234- }211211+ struct flowi6 *fl6 = &transport->fl.u.ip6;235212236213 pr_debug("%s: skb:%p, len:%d, src:%pI6 dst:%pI6\n", __func__, skb,237237- skb->len, &fl6.saddr, &fl6.daddr);214214+ skb->len, &fl6->saddr, &fl6->daddr);238215239239- SCTP_INC_STATS(sock_net(sk), SCTP_MIB_OUTSCTPPACKS);216216+ IP6_ECN_flow_xmit(sk, fl6->flowlabel);240217241218 if (!(transport->param_flags & SPP_PMTUD_ENABLE))242219 skb->local_df = 1;243220244244- return ip6_xmit(sk, skb, &fl6, np->opt, np->tclass);221221+ SCTP_INC_STATS(sock_net(sk), SCTP_MIB_OUTSCTPPACKS);222222+223223+ return ip6_xmit(sk, skb, fl6, np->opt, np->tclass);245224}246225247226/* Returns the dst cache entry for the given source and destination ip···233254 struct dst_entry *dst = NULL;234255 struct flowi6 *fl6 = &fl->u.ip6;235256 struct sctp_bind_addr *bp;257257+ struct ipv6_pinfo *np = inet6_sk(sk);236258 struct sctp_sockaddr_entry *laddr;237259 union sctp_addr *baddr = NULL;238260 union sctp_addr *daddr = &t->ipaddr;239261 union sctp_addr dst_saddr;262262+ struct in6_addr *final_p, final;240263 __u8 matchlen = 0;241264 __u8 bmatchlen;242265 sctp_scope_t scope;···262281 pr_debug("src=%pI6 - ", &fl6->saddr);263282 }264283265265- dst = ip6_dst_lookup_flow(sk, fl6, NULL, false);284284+ final_p = fl6_update_dst(fl6, np->opt, &final);285285+ dst = ip6_dst_lookup_flow(sk, fl6, final_p, false);266286 if (!asoc || saddr)267287 goto out;268288···315333 }316334 }317335 rcu_read_unlock();336336+318337 if (baddr) {319338 fl6->saddr = baddr->v6.sin6_addr;320339 fl6->fl6_sport = baddr->v6.sin6_port;321321- dst = ip6_dst_lookup_flow(sk, fl6, NULL, false);340340+ final_p = fl6_update_dst(fl6, np->opt, &final);341341+ dst = ip6_dst_lookup_flow(sk, fl6, final_p, false);322342 }323343324344out:
+11
net/sunrpc/auth_gss/auth_gss.c
···10751075 kref_put(&gss_auth->kref, gss_free_callback);10761076}1077107710781078+/*10791079+ * Auths may be shared between rpc clients that were cloned from a10801080+ * common client with the same xprt, if they also share the flavor and10811081+ * target_name.10821082+ *10831083+ * The auth is looked up from the oldest parent sharing the same10841084+ * cl_xprt, and the auth itself references only that common parent10851085+ * (which is guaranteed to last as long as any of its descendants).10861086+ */10781087static struct gss_auth *10791088gss_auth_find_or_add_hashed(struct rpc_auth_create_args *args,10801089 struct rpc_clnt *clnt,···10971088 gss_auth,10981089 hash,10991090 hashval) {10911091+ if (gss_auth->client != clnt)10921092+ continue;11001093 if (gss_auth->rpc_auth.au_flavor != args->pseudoflavor)11011094 continue;11021095 if (gss_auth->target_name != args->target_name) {
+4-1
virt/kvm/async_pf.c
···101101 typeof(*work), queue);102102 cancel_work_sync(&work->work);103103 list_del(&work->queue);104104- if (!work->done) /* work was canceled */104104+ if (!work->done) { /* work was canceled */105105+ mmdrop(work->mm);106106+ kvm_put_kvm(vcpu->kvm); /* == work->vcpu->kvm */105107 kmem_cache_free(async_pf_cache, work);108108+ }106109 }107110108111 spin_lock(&vcpu->async_pf.lock);
+9-5
virt/kvm/kvm_main.c
···10581058EXPORT_SYMBOL_GPL(gfn_to_hva);1059105910601060/*10611061- * The hva returned by this function is only allowed to be read.10621062- * It should pair with kvm_read_hva() or kvm_read_hva_atomic().10611061+ * If writable is set to false, the hva returned by this function is only10621062+ * allowed to be read.10631063 */10641064-static unsigned long gfn_to_hva_read(struct kvm *kvm, gfn_t gfn)10641064+unsigned long gfn_to_hva_prot(struct kvm *kvm, gfn_t gfn, bool *writable)10651065{10661066+ struct kvm_memory_slot *slot = gfn_to_memslot(kvm, gfn);10671067+ if (writable)10681068+ *writable = !memslot_is_readonly(slot);10691069+10661070 return __gfn_to_hva_many(gfn_to_memslot(kvm, gfn), gfn, NULL, false);10671071}10681072···14341430 int r;14351431 unsigned long addr;1436143214371437- addr = gfn_to_hva_read(kvm, gfn);14331433+ addr = gfn_to_hva_prot(kvm, gfn, NULL);14381434 if (kvm_is_error_hva(addr))14391435 return -EFAULT;14401436 r = kvm_read_hva(data, (void __user *)addr + offset, len);···14721468 gfn_t gfn = gpa >> PAGE_SHIFT;14731469 int offset = offset_in_page(gpa);1474147014751475- addr = gfn_to_hva_read(kvm, gfn);14711471+ addr = gfn_to_hva_prot(kvm, gfn, NULL);14761472 if (kvm_is_error_hva(addr))14771473 return -EFAULT;14781474 pagefault_disable();