···24382438 real-time workloads. It can also improve energy24392439 efficiency for asymmetric multiprocessors.2440244024412441- rcu_nocbs_poll [KNL,BOOT]24412441+ rcu_nocb_poll [KNL,BOOT]24422442 Rather than requiring that offloaded CPUs24432443 (specified by rcu_nocbs= above) explicitly24442444 awaken the corresponding "rcuoN" kthreads,
+26-1
Documentation/x86/boot.txt
···5757Protocol 2.11: (Kernel 3.6) Added a field for offset of EFI handover5858 protocol entry point.59596060+Protocol 2.12: (Kernel 3.8) Added the xloadflags field and extension fields6161+ to struct boot_params for for loading bzImage and ramdisk6262+ above 4G in 64bit.6363+6064**** MEMORY LAYOUT61656266The traditional memory map for the kernel loader, used for Image or···1861820230/4 2.05+ kernel_alignment Physical addr alignment required for kernel1871830234/1 2.05+ relocatable_kernel Whether kernel is relocatable or not1881840235/1 2.10+ min_alignment Minimum alignment, as a power of two189189-0236/2 N/A pad3 Unused185185+0236/2 2.12+ xloadflags Boot protocol option flags1901860238/4 2.06+ cmdline_size Maximum size of the kernel command line191187023C/4 2.07+ hardware_subarch Hardware subarchitecture1921880240/8 2.07+ hardware_subarch_data Subarchitecture-specific data···585581 There may be a considerable performance cost with an excessively586582 misaligned kernel. Therefore, a loader should typically try each587583 power-of-two alignment from kernel_alignment down to this alignment.584584+585585+Field name: xloadflags586586+Type: read587587+Offset/size: 0x236/2588588+Protocol: 2.12+589589+590590+ This field is a bitmask.591591+592592+ Bit 0 (read): XLF_KERNEL_64593593+ - If 1, this kernel has the legacy 64-bit entry point at 0x200.594594+595595+ Bit 1 (read): XLF_CAN_BE_LOADED_ABOVE_4G596596+ - If 1, kernel/boot_params/cmdline/ramdisk can be above 4G.597597+598598+ Bit 2 (read): XLF_EFI_HANDOVER_32599599+ - If 1, the kernel supports the 32-bit EFI handoff entry point600600+ given at handover_offset.601601+602602+ Bit 3 (read): XLF_EFI_HANDOVER_64603603+ - If 1, the kernel supports the 64-bit EFI handoff entry point604604+ given at handover_offset + 0x200.588605589606Field name: cmdline_size590607Type: read
+4
Documentation/x86/zero-page.txt
···1919090/010 ALL hd1_info hd1 disk parameter, OBSOLETE!!20200A0/010 ALL sys_desc_table System description table (struct sys_desc_table)21210B0/010 ALL olpc_ofw_header OLPC's OpenFirmware CIF and friends2222+0C0/004 ALL ext_ramdisk_image ramdisk_image high 32bits2323+0C4/004 ALL ext_ramdisk_size ramdisk_size high 32bits2424+0C8/004 ALL ext_cmd_line_ptr cmd_line_ptr high 32bits2225140/080 ALL edid_info Video mode setup (struct edid_info)23261C0/020 ALL efi_info EFI 32 information (struct efi_info)24271E0/004 ALL alk_mem_k Alternative mem check, in KB···30271E9/001 ALL eddbuf_entries Number of entries in eddbuf (below)31281EA/001 ALL edd_mbr_sig_buf_entries Number of entries in edd_mbr_sig_buffer3229 (below)3030+1EF/001 ALL sentinel Used to detect broken bootloaders3331290/040 ALL edd_mbr_sig_buffer EDD MBR signatures34322D0/A00 ALL e820_map E820 memory map table3533 (array of struct e820entry)
+2-2
MAINTAINERS
···14891489M: Haavard Skinnemoen <hskinnemoen@gmail.com>14901490M: Hans-Christian Egtvedt <egtvedt@samfundet.no>14911491W: http://www.atmel.com/products/AVR32/14921492-W: http://avr32linux.org/14921492+W: http://mirror.egtvedt.no/avr32linux.org/14931493W: http://avrfreaks.net/14941494S: Maintained14951495F: arch/avr32/···70767076F: sound/7077707770787078SOUND - SOC LAYER / DYNAMIC AUDIO POWER MANAGEMENT (ASoC)70797079-M: Liam Girdwood <lrg@ti.com>70797079+M: Liam Girdwood <lgirdwood@gmail.com>70807080M: Mark Brown <broonie@opensource.wolfsonmicro.com>70817081T: git git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git70827082L: alsa-devel@alsa-project.org (moderated for non-subscribers)
+2-2
Makefile
···11VERSION = 322PATCHLEVEL = 833SUBLEVEL = 044-EXTRAVERSION = -rc555-NAME = Terrified Chipmunk44+EXTRAVERSION = -rc755+NAME = Unicycling Gorilla6677# *DOCUMENTATION*88# To see a list of typical targets execute "make help"
+23-2
arch/arm/common/gic.c
···351351 irq_set_chained_handler(irq, gic_handle_cascade_irq);352352}353353354354+static u8 gic_get_cpumask(struct gic_chip_data *gic)355355+{356356+ void __iomem *base = gic_data_dist_base(gic);357357+ u32 mask, i;358358+359359+ for (i = mask = 0; i < 32; i += 4) {360360+ mask = readl_relaxed(base + GIC_DIST_TARGET + i);361361+ mask |= mask >> 16;362362+ mask |= mask >> 8;363363+ if (mask)364364+ break;365365+ }366366+367367+ if (!mask)368368+ pr_crit("GIC CPU mask not found - kernel will fail to boot.\n");369369+370370+ return mask;371371+}372372+354373static void __init gic_dist_init(struct gic_chip_data *gic)355374{356375 unsigned int i;···388369 /*389370 * Set all global interrupts to this CPU only.390371 */391391- cpumask = readl_relaxed(base + GIC_DIST_TARGET + 0);372372+ cpumask = gic_get_cpumask(gic);373373+ cpumask |= cpumask << 8;374374+ cpumask |= cpumask << 16;392375 for (i = 32; i < gic_irqs; i += 4)393376 writel_relaxed(cpumask, base + GIC_DIST_TARGET + i * 4 / 4);394377···421400 * Get what the GIC says our CPU mask is.422401 */423402 BUG_ON(cpu >= NR_GIC_CPU_IF);424424- cpu_mask = readl_relaxed(dist_base + GIC_DIST_TARGET + 0);403403+ cpu_mask = gic_get_cpumask(gic);425404 gic_cpu_map[cpu] = cpu_mask;426405427406 /*
+1-1
arch/arm/include/asm/memory.h
···3737 */3838#define PAGE_OFFSET UL(CONFIG_PAGE_OFFSET)3939#define TASK_SIZE (UL(CONFIG_PAGE_OFFSET) - UL(0x01000000))4040-#define TASK_UNMAPPED_BASE (UL(CONFIG_PAGE_OFFSET) / 3)4040+#define TASK_UNMAPPED_BASE ALIGN(TASK_SIZE / 3, SZ_16M)41414242/*4343 * The maximum size of a 26-bit user space task.
+1-1
arch/arm/mach-exynos/Kconfig
···414414 select CPU_EXYNOS4210415415 select HAVE_SAMSUNG_KEYPAD if INPUT_KEYBOARD416416 select PINCTRL417417- select PINCTRL_EXYNOS4417417+ select PINCTRL_EXYNOS418418 select USE_OF419419 help420420 Machine support for Samsung Exynos4 machine with device tree enabled.
+1-1
arch/arm/mach-realview/include/mach/irqs-eb.h
···115115/*116116 * Only define NR_IRQS if less than NR_IRQS_EB117117 */118118-#define NR_IRQS_EB (IRQ_EB_GIC_START + 96)118118+#define NR_IRQS_EB (IRQ_EB_GIC_START + 128)119119120120#if defined(CONFIG_MACH_REALVIEW_EB) \121121 && (!defined(NR_IRQS) || (NR_IRQS < NR_IRQS_EB))
+1-1
arch/arm/mm/dma-mapping.c
···640640641641 if (is_coherent || nommu())642642 addr = __alloc_simple_buffer(dev, size, gfp, &page);643643- else if (gfp & GFP_ATOMIC)643643+ else if (!(gfp & __GFP_WAIT))644644 addr = __alloc_from_pool(size, &page);645645 else if (!IS_ENABLED(CONFIG_CMA))646646 addr = __alloc_remap_buffer(dev, size, gfp, prot, &page, caller);
···88 select SSB_DRIVER_EXTIF99 select SSB_EMBEDDED1010 select SSB_B43_PCI_BRIDGE if PCI1111+ select SSB_DRIVER_PCICORE if PCI1112 select SSB_PCICORE_HOSTMODE if PCI1213 select SSB_DRIVER_GPIO1414+ select GPIOLIB1315 default y1416 help1517 Add support for old Broadcom BCM47xx boards with Sonics Silicon Backplane support.···2725 select BCMA_HOST_PCI if PCI2826 select BCMA_DRIVER_PCI_HOSTMODE if PCI2927 select BCMA_DRIVER_GPIO2828+ select GPIOLIB3029 default y3130 help3231 Add support for new Broadcom BCM47xx boards with Broadcom specific Advanced Microcontroller Bus.
+5-4
arch/mips/cavium-octeon/executive/cvmx-l2c.c
···3030 * measurement, and debugging facilities.3131 */32323333+#include <linux/compiler.h>3334#include <linux/irqflags.h>3435#include <asm/octeon/cvmx.h>3536#include <asm/octeon/cvmx-l2c.h>···286285 */287286static void fault_in(uint64_t addr, int len)288287{289289- volatile char *ptr;290290- volatile char dummy;288288+ char *ptr;289289+291290 /*292291 * Adjust addr and length so we get all cache lines even for293292 * small ranges spanning two cache lines.294293 */295294 len += addr & CVMX_CACHE_LINE_MASK;296295 addr &= ~CVMX_CACHE_LINE_MASK;297297- ptr = (volatile char *)cvmx_phys_to_ptr(addr);296296+ ptr = cvmx_phys_to_ptr(addr);298297 /*299298 * Invalidate L1 cache to make sure all loads result in data300299 * being in L2.301300 */302301 CVMX_DCACHE_INVALIDATE;303302 while (len > 0) {304304- dummy += *ptr;303303+ ACCESS_ONCE(*ptr);305304 len -= CVMX_CACHE_LINE_SIZE;306305 ptr += CVMX_CACHE_LINE_SIZE;307306 }
···2525#define MCOUNT_OFFSET_INSNS 42626#endif27272828+/* Arch override because MIPS doesn't need to run this from stop_machine() */2929+void arch_ftrace_update_code(int command)3030+{3131+ ftrace_modify_all_code(command);3232+}3333+2834/*2935 * Check if the address is in kernel space3036 *···9589 return 0;9690}97919292+#ifndef CONFIG_64BIT9393+static int ftrace_modify_code_2(unsigned long ip, unsigned int new_code1,9494+ unsigned int new_code2)9595+{9696+ int faulted;9797+9898+ safe_store_code(new_code1, ip, faulted);9999+ if (unlikely(faulted))100100+ return -EFAULT;101101+ ip += 4;102102+ safe_store_code(new_code2, ip, faulted);103103+ if (unlikely(faulted))104104+ return -EFAULT;105105+ flush_icache_range(ip, ip + 8); /* original ip + 12 */106106+ return 0;107107+}108108+#endif109109+98110/*99111 * The details about the calling site of mcount on MIPS100112 *···155131 * needed.156132 */157133 new = in_kernel_space(ip) ? INSN_NOP : INSN_B_1F;158158-134134+#ifdef CONFIG_64BIT159135 return ftrace_modify_code(ip, new);136136+#else137137+ /*138138+ * On 32 bit MIPS platforms, gcc adds a stack adjust139139+ * instruction in the delay slot after the branch to140140+ * mcount and expects mcount to restore the sp on return.141141+ * This is based on a legacy API and does nothing but142142+ * waste instructions so it's being removed at runtime.143143+ */144144+ return ftrace_modify_code_2(ip, new, INSN_NOP);145145+#endif160146}161147162148int ftrace_make_call(struct dyn_ftrace *rec, unsigned long addr)
···705705706706 printk(KERN_WARNING707707 "VPE loader: TC %d is already in use.\n",708708- t->index);708708+ v->tc->index);709709 return -ENOEXEC;710710 }711711 } else {
+1-1
arch/mips/lantiq/irq.c
···408408#endif409409410410 /* tell oprofile which irq to use */411411- cp0_perfcount_irq = LTQ_PERF_IRQ;411411+ cp0_perfcount_irq = irq_create_mapping(ltq_domain, LTQ_PERF_IRQ);412412413413 /*414414 * if the timer irq is not one of the mips irqs we need to
···193193194194void __init prom_init(void)195195{196196- int i, *argv, *envp; /* passed as 32 bit ptrs */196196+ int *argv, *envp; /* passed as 32 bit ptrs */197197 struct psb_info *prom_infop;198198+#ifdef CONFIG_SMP199199+ int i;200200+#endif198201199202 /* truncate to 32 bit and sign extend all args */200203 argv = (int *)(long)(int)fw_arg1;
···256256 int i;257257 struct setup_data *data;258258259259- data = (struct setup_data *)params->hdr.setup_data;259259+ data = (struct setup_data *)(unsigned long)params->hdr.setup_data;260260261261 while (data && data->next)262262- data = (struct setup_data *)data->next;262262+ data = (struct setup_data *)(unsigned long)data->next;263263264264 status = efi_call_phys5(sys_table->boottime->locate_handle,265265 EFI_LOCATE_BY_PROTOCOL, &pci_proto,···295295 if (!pci)296296 continue;297297298298+#ifdef CONFIG_X86_64298299 status = efi_call_phys4(pci->attributes, pci,299300 EfiPciIoAttributeOperationGet, 0,300301 &attributes);301301-302302+#else303303+ status = efi_call_phys5(pci->attributes, pci,304304+ EfiPciIoAttributeOperationGet, 0, 0,305305+ &attributes);306306+#endif302307 if (status != EFI_SUCCESS)303303- continue;304304-305305- if (!(attributes & EFI_PCI_IO_ATTRIBUTE_EMBEDDED_ROM))306308 continue;307309308310 if (!pci->romimage || !pci->romsize)···347345 memcpy(rom->romdata, pci->romimage, pci->romsize);348346349347 if (data)350350- data->next = (uint64_t)rom;348348+ data->next = (unsigned long)rom;351349 else352352- params->hdr.setup_data = (uint64_t)rom;350350+ params->hdr.setup_data = (unsigned long)rom;353351354352 data = (struct setup_data *)rom;355353···434432 * Once we've found a GOP supporting ConOut,435433 * don't bother looking any further.436434 */435435+ first_gop = gop;437436 if (conout_found)438437 break;439439-440440- first_gop = gop;441438 }442439 }443440
+5-3
arch/x86/boot/compressed/head_32.S
···3535#ifdef CONFIG_EFI_STUB3636 jmp preferred_addr37373838- .balign 0x103938 /*4039 * We don't need the return address, so set up the stack so4141- * efi_main() can find its arugments.4040+ * efi_main() can find its arguments.4241 */4242+ENTRY(efi_pe_entry)4343 add $0x4, %esp44444545 call make_boot_params···5050 pushl %eax5151 pushl %esi5252 pushl %ecx5353+ sub $0x4, %esp53545454- .org 0x30,0x905555+ENTRY(efi_stub_entry)5656+ add $0x4, %esp5557 call efi_main5658 cmpl $0, %eax5759 movl %eax, %esi
+4-4
arch/x86/boot/compressed/head_64.S
···201201 */202202#ifdef CONFIG_EFI_STUB203203 /*204204- * The entry point for the PE/COFF executable is 0x210, so only205205- * legacy boot loaders will execute this jmp.204204+ * The entry point for the PE/COFF executable is efi_pe_entry, so205205+ * only legacy boot loaders will execute this jmp.206206 */207207 jmp preferred_addr208208209209- .org 0x210209209+ENTRY(efi_pe_entry)210210 mov %rcx, %rdi211211 mov %rdx, %rsi212212 pushq %rdi···218218 popq %rsi219219 popq %rdi220220221221- .org 0x230,0x90221221+ENTRY(efi_stub_entry)222222 call efi_main223223 movq %rax,%rsi224224 cmpq $0,%rax
+29-10
arch/x86/boot/header.S
···2121#include <asm/e820.h>2222#include <asm/page_types.h>2323#include <asm/setup.h>2424+#include <asm/bootparam.h>2425#include "boot.h"2526#include "voffset.h"2627#include "zoffset.h"···256255 # header, from the old boot sector.257256258257 .section ".header", "a"258258+ .globl sentinel259259+sentinel: .byte 0xff, 0xff /* Used to detect broken loaders */260260+259261 .globl hdr260262hdr:261263setup_sects: .byte 0 /* Filled in by build.c */···283279 # Part 2 of the header, from the old setup.S284280285281 .ascii "HdrS" # header signature286286- .word 0x020b # header version number (>= 0x0105)282282+ .word 0x020c # header version number (>= 0x0105)287283 # or else old loadlin-1.5 will fail)288284 .globl realmode_swtch289285realmode_swtch: .word 0, 0 # default_switch, SETUPSEG···301297302298# flags, unused bits must be zero (RFU) bit within loadflags303299loadflags:304304-LOADED_HIGH = 1 # If set, the kernel is loaded high305305-CAN_USE_HEAP = 0x80 # If set, the loader also has set306306- # heap_end_ptr to tell how much307307- # space behind setup.S can be used for308308- # heap purposes.309309- # Only the loader knows what is free310310- .byte LOADED_HIGH300300+ .byte LOADED_HIGH # The kernel is to be loaded high311301312302setup_move_size: .word 0x8000 # size to move, when setup is not313303 # loaded at 0x90000. We will move setup···367369relocatable_kernel: .byte 0368370#endif369371min_alignment: .byte MIN_KERNEL_ALIGN_LG2 # minimum alignment370370-pad3: .word 0372372+373373+xloadflags:374374+#ifdef CONFIG_X86_64375375+# define XLF0 XLF_KERNEL_64 /* 64-bit kernel */376376+#else377377+# define XLF0 0378378+#endif379379+#ifdef CONFIG_EFI_STUB380380+# ifdef CONFIG_X86_64381381+# define XLF23 XLF_EFI_HANDOVER_64 /* 64-bit EFI handover ok */382382+# else383383+# define XLF23 XLF_EFI_HANDOVER_32 /* 32-bit EFI handover ok */384384+# endif385385+#else386386+# define XLF23 0387387+#endif388388+ .word XLF0 | XLF23371389372390cmdline_size: .long COMMAND_LINE_SIZE-1 #length of the command line,373391 #added with boot protocol···411397#define INIT_SIZE VO_INIT_SIZE412398#endif413399init_size: .long INIT_SIZE # kernel initialization size414414-handover_offset: .long 0x30 # offset to the handover400400+handover_offset:401401+#ifdef CONFIG_EFI_STUB402402+ .long 0x30 # offset to the handover415403 # protocol entry point404404+#else405405+ .long 0406406+#endif416407417408# End of setup header #####################################################418409
···52525353#define PECOFF_RELOC_RESERVE 0x2054545555+unsigned long efi_stub_entry;5656+unsigned long efi_pe_entry;5757+unsigned long startup_64;5858+5559/*----------------------------------------------------------------------*/56605761static const u32 crctab32[] = {···136132137133static void usage(void)138134{139139- die("Usage: build setup system [> image]");135135+ die("Usage: build setup system [zoffset.h] [> image]");140136}141137142138#ifdef CONFIG_EFI_STUB···210206 */211207 put_unaligned_le32(file_sz - 512, &buf[pe_header + 0x1c]);212208213213-#ifdef CONFIG_X86_32214209 /*215215- * Address of entry point.216216- *217217- * The EFI stub entry point is +16 bytes from the start of218218- * the .text section.210210+ * Address of entry point for PE/COFF executable219211 */220220- put_unaligned_le32(text_start + 16, &buf[pe_header + 0x28]);221221-#else222222- /*223223- * Address of entry point. startup_32 is at the beginning and224224- * the 64-bit entry point (startup_64) is always 512 bytes225225- * after. The EFI stub entry point is 16 bytes after that, as226226- * the first instruction allows legacy loaders to jump over227227- * the EFI stub initialisation228228- */229229- put_unaligned_le32(text_start + 528, &buf[pe_header + 0x28]);230230-#endif /* CONFIG_X86_32 */212212+ put_unaligned_le32(text_start + efi_pe_entry, &buf[pe_header + 0x28]);231213232214 update_pecoff_section_header(".text", text_start, text_sz);233215}234216235217#endif /* CONFIG_EFI_STUB */218218+219219+220220+/*221221+ * Parse zoffset.h and find the entry points. We could just #include zoffset.h222222+ * but that would mean tools/build would have to be rebuilt every time. It's223223+ * not as if parsing it is hard...224224+ */225225+#define PARSE_ZOFS(p, sym) do { \226226+ if (!strncmp(p, "#define ZO_" #sym " ", 11+sizeof(#sym))) \227227+ sym = strtoul(p + 11 + sizeof(#sym), NULL, 16); \228228+} while (0)229229+230230+static void parse_zoffset(char *fname)231231+{232232+ FILE *file;233233+ char *p;234234+ int c;235235+236236+ file = fopen(fname, "r");237237+ if (!file)238238+ die("Unable to open `%s': %m", fname);239239+ c = fread(buf, 1, sizeof(buf) - 1, file);240240+ if (ferror(file))241241+ die("read-error on `zoffset.h'");242242+ buf[c] = 0;243243+244244+ p = (char *)buf;245245+246246+ while (p && *p) {247247+ PARSE_ZOFS(p, efi_stub_entry);248248+ PARSE_ZOFS(p, efi_pe_entry);249249+ PARSE_ZOFS(p, startup_64);250250+251251+ p = strchr(p, '\n');252252+ while (p && (*p == '\r' || *p == '\n'))253253+ p++;254254+ }255255+}236256237257int main(int argc, char ** argv)238258{···269241 void *kernel;270242 u32 crc = 0xffffffffUL;271243272272- if (argc != 3)244244+ /* Defaults for old kernel */245245+#ifdef CONFIG_X86_32246246+ efi_pe_entry = 0x10;247247+ efi_stub_entry = 0x30;248248+#else249249+ efi_pe_entry = 0x210;250250+ efi_stub_entry = 0x230;251251+ startup_64 = 0x200;252252+#endif253253+254254+ if (argc == 4)255255+ parse_zoffset(argv[3]);256256+ else if (argc != 3)273257 usage();274258275259 /* Copy the setup code */···339299340300#ifdef CONFIG_EFI_STUB341301 update_pecoff_text(setup_sectors * 512, sz + i + ((sys_size * 16) - sz));302302+303303+#ifdef CONFIG_X86_64 /* Yes, this is really how we defined it :( */304304+ efi_stub_entry -= 0x200;305305+#endif306306+ put_unaligned_le32(efi_stub_entry, &buf[0x264]);342307#endif343308344309 crc = partial_crc32(buf, i, crc);
+2-2
arch/x86/ia32/ia32entry.S
···207207 testl $(_TIF_ALLWORK_MASK & ~_TIF_SYSCALL_AUDIT),TI_flags+THREAD_INFO(%rsp,RIP-ARGOFFSET)208208 jnz ia32_ret_from_sys_call209209 TRACE_IRQS_ON210210- sti210210+ ENABLE_INTERRUPTS(CLBR_NONE)211211 movl %eax,%esi /* second arg, syscall return value */212212 cmpl $-MAX_ERRNO,%eax /* is it an error ? */213213 jbe 1f···217217 call __audit_syscall_exit218218 movq RAX-ARGOFFSET(%rsp),%rax /* reload syscall return value */219219 movl $(_TIF_ALLWORK_MASK & ~_TIF_SYSCALL_AUDIT),%edi220220- cli220220+ DISABLE_INTERRUPTS(CLBR_NONE)221221 TRACE_IRQS_OFF222222 testl %edi,TI_flags+THREAD_INFO(%rsp,RIP-ARGOFFSET)223223 jz \exit
+1
arch/x86/include/asm/efi.h
···9494#endif /* CONFIG_X86_32 */95959696extern int add_efi_memmap;9797+extern unsigned long x86_efi_facility;9798extern void efi_set_executable(efi_memory_desc_t *md, bool executable);9899extern int efi_memblock_x86_reserve_range(void);99100extern void efi_call_phys_prelog(void);
+1-1
arch/x86/include/asm/uv/uv.h
···1616extern const struct cpumask *uv_flush_tlb_others(const struct cpumask *cpumask,1717 struct mm_struct *mm,1818 unsigned long start,1919- unsigned end,1919+ unsigned long end,2020 unsigned int cpu);21212222#else /* X86_UV */
+46-17
arch/x86/include/uapi/asm/bootparam.h
···11#ifndef _ASM_X86_BOOTPARAM_H22#define _ASM_X86_BOOTPARAM_H3344+/* setup_data types */55+#define SETUP_NONE 066+#define SETUP_E820_EXT 177+#define SETUP_DTB 288+#define SETUP_PCI 399+1010+/* ram_size flags */1111+#define RAMDISK_IMAGE_START_MASK 0x07FF1212+#define RAMDISK_PROMPT_FLAG 0x80001313+#define RAMDISK_LOAD_FLAG 0x40001414+1515+/* loadflags */1616+#define LOADED_HIGH (1<<0)1717+#define QUIET_FLAG (1<<5)1818+#define KEEP_SEGMENTS (1<<6)1919+#define CAN_USE_HEAP (1<<7)2020+2121+/* xloadflags */2222+#define XLF_KERNEL_64 (1<<0)2323+#define XLF_CAN_BE_LOADED_ABOVE_4G (1<<1)2424+#define XLF_EFI_HANDOVER_32 (1<<2)2525+#define XLF_EFI_HANDOVER_64 (1<<3)2626+2727+#ifndef __ASSEMBLY__2828+429#include <linux/types.h>530#include <linux/screen_info.h>631#include <linux/apm_bios.h>···338#include <asm/e820.h>349#include <asm/ist.h>3510#include <video/edid.h>3636-3737-/* setup data types */3838-#define SETUP_NONE 03939-#define SETUP_E820_EXT 14040-#define SETUP_DTB 24141-#define SETUP_PCI 342114312/* extensible setup data list node */4413struct setup_data {···4728 __u16 root_flags;4829 __u32 syssize;4930 __u16 ram_size;5050-#define RAMDISK_IMAGE_START_MASK 0x07FF5151-#define RAMDISK_PROMPT_FLAG 0x80005252-#define RAMDISK_LOAD_FLAG 0x40005331 __u16 vid_mode;5432 __u16 root_dev;5533 __u16 boot_flag;···5842 __u16 kernel_version;5943 __u8 type_of_loader;6044 __u8 loadflags;6161-#define LOADED_HIGH (1<<0)6262-#define QUIET_FLAG (1<<5)6363-#define KEEP_SEGMENTS (1<<6)6464-#define CAN_USE_HEAP (1<<7)6545 __u16 setup_move_size;6646 __u32 code32_start;6747 __u32 ramdisk_image;···7058 __u32 initrd_addr_max;7159 __u32 kernel_alignment;7260 __u8 relocatable_kernel;7373- __u8 _pad2[3];6161+ __u8 min_alignment;6262+ __u16 xloadflags;7463 __u32 cmdline_size;7564 __u32 hardware_subarch;7665 __u64 hardware_subarch_data;···119106 __u8 hd1_info[16]; /* obsolete! */ /* 0x090 */120107 struct sys_desc_table sys_desc_table; /* 0x0a0 */121108 struct olpc_ofw_header olpc_ofw_header; /* 0x0b0 */122122- __u8 _pad4[128]; /* 0x0c0 */109109+ __u32 ext_ramdisk_image; /* 0x0c0 */110110+ __u32 ext_ramdisk_size; /* 0x0c4 */111111+ __u32 ext_cmd_line_ptr; /* 0x0c8 */112112+ __u8 _pad4[116]; /* 0x0cc */123113 struct edid_info edid_info; /* 0x140 */124114 struct efi_info efi_info; /* 0x1c0 */125115 __u32 alt_mem_k; /* 0x1e0 */···131115 __u8 eddbuf_entries; /* 0x1e9 */132116 __u8 edd_mbr_sig_buf_entries; /* 0x1ea */133117 __u8 kbd_status; /* 0x1eb */134134- __u8 _pad6[5]; /* 0x1ec */118118+ __u8 _pad5[3]; /* 0x1ec */119119+ /*120120+ * The sentinel is set to a nonzero value (0xff) in header.S.121121+ *122122+ * A bootloader is supposed to only take setup_header and put123123+ * it into a clean boot_params buffer. If it turns out that124124+ * it is clumsy or too generous with the buffer, it most125125+ * probably will pick up the sentinel variable too. The fact126126+ * that this variable then is still 0xff will let kernel127127+ * know that some variables in boot_params are invalid and128128+ * kernel should zero out certain portions of boot_params.129129+ */130130+ __u8 sentinel; /* 0x1ef */131131+ __u8 _pad6[1]; /* 0x1f0 */135132 struct setup_header hdr; /* setup header */ /* 0x1f1 */136133 __u8 _pad7[0x290-0x1f1-sizeof(struct setup_header)];137134 __u32 edd_mbr_sig_buffer[EDD_MBR_SIG_MAX]; /* 0x290 */···163134 X86_NR_SUBARCHS,164135};165136166166-137137+#endif /* __ASSEMBLY__ */167138168139#endif /* _ASM_X86_BOOTPARAM_H */
···17811781 * Leave room for the "copied" frame17821782 */17831783 subq $(5*8), %rsp17841784+ CFI_ADJUST_CFA_OFFSET 5*81784178517851786 /* Copy the stack frame to the Saved frame */17861787 .rept 5···18641863nmi_swapgs:18651864 SWAPGS_UNSAFE_STACK18661865nmi_restore:18671867- RESTORE_ALL 818681868-18691869- /* Pop the extra iret frame */18701870- addq $(5*8), %rsp18661866+ /* Pop the extra iret frame at once */18671867+ RESTORE_ALL 6*81871186818721869 /* Clear the NMI executing stack variable */18731870 movq $0, 5*8(%rsp)
+7-2
arch/x86/kernel/head_32.S
···300300 leal -__PAGE_OFFSET(%ecx),%esp301301302302default_entry:303303+#define CR0_STATE (X86_CR0_PE | X86_CR0_MP | X86_CR0_ET | \304304+ X86_CR0_NE | X86_CR0_WP | X86_CR0_AM | \305305+ X86_CR0_PG)306306+ movl $(CR0_STATE & ~X86_CR0_PG),%eax307307+ movl %eax,%cr0308308+303309/*304310 * New page tables may be in 4Mbyte page mode and may305311 * be using the global pages. ···370364 */371365 movl $pa(initial_page_table), %eax372366 movl %eax,%cr3 /* set the page table pointer.. */373373- movl %cr0,%eax374374- orl $X86_CR0_PG,%eax367367+ movl $CR0_STATE,%eax375368 movl %eax,%cr0 /* ..and set paging (PG) bit */376369 ljmp $__BOOT_CS,$1f /* Clear prefetch and normalize %eip */3773701:
+3
arch/x86/kernel/msr.c
···174174 unsigned int cpu;175175 struct cpuinfo_x86 *c;176176177177+ if (!capable(CAP_SYS_RAWIO))178178+ return -EPERM;179179+177180 cpu = iminor(file->f_path.dentry->d_inode);178181 if (cpu >= nr_cpu_ids || !cpu_online(cpu))179182 return -ENXIO; /* No such CPU */
+1-1
arch/x86/kernel/pci-dma.c
···5656EXPORT_SYMBOL(x86_dma_fallback_dev);57575858/* Number of entries preallocated for DMA-API debugging */5959-#define PREALLOC_DMA_DEBUG_ENTRIES 327685959+#define PREALLOC_DMA_DEBUG_ENTRIES 6553660606161int dma_set_mask(struct device *dev, u64 mask)6262{
+1-1
arch/x86/kernel/reboot.c
···584584 break;585585586586 case BOOT_EFI:587587- if (efi_enabled)587587+ if (efi_enabled(EFI_RUNTIME_SERVICES))588588 efi.reset_system(reboot_mode ?589589 EFI_RESET_WARM :590590 EFI_RESET_COLD,
+14-14
arch/x86/kernel/setup.c
···807807#ifdef CONFIG_EFI808808 if (!strncmp((char *)&boot_params.efi_info.efi_loader_signature,809809 "EL32", 4)) {810810- efi_enabled = 1;811811- efi_64bit = false;810810+ set_bit(EFI_BOOT, &x86_efi_facility);812811 } else if (!strncmp((char *)&boot_params.efi_info.efi_loader_signature,813812 "EL64", 4)) {814814- efi_enabled = 1;815815- efi_64bit = true;813813+ set_bit(EFI_BOOT, &x86_efi_facility);814814+ set_bit(EFI_64BIT, &x86_efi_facility);816815 }817817- if (efi_enabled && efi_memblock_x86_reserve_range())818818- efi_enabled = 0;816816+817817+ if (efi_enabled(EFI_BOOT))818818+ efi_memblock_x86_reserve_range();819819#endif820820821821 x86_init.oem.arch_setup();···888888889889 finish_e820_parsing();890890891891- if (efi_enabled)891891+ if (efi_enabled(EFI_BOOT))892892 efi_init();893893894894 dmi_scan_machine();···971971 * The EFI specification says that boot service code won't be called972972 * after ExitBootServices(). This is, in fact, a lie.973973 */974974- if (efi_enabled)974974+ if (efi_enabled(EFI_MEMMAP))975975 efi_reserve_boot_services();976976977977 /* preallocate 4k for mptable mpc */···1114111411151115#ifdef CONFIG_VT11161116#if defined(CONFIG_VGA_CONSOLE)11171117- if (!efi_enabled || (efi_mem_type(0xa0000) != EFI_CONVENTIONAL_MEMORY))11171117+ if (!efi_enabled(EFI_BOOT) || (efi_mem_type(0xa0000) != EFI_CONVENTIONAL_MEMORY))11181118 conswitchp = &vga_con;11191119#elif defined(CONFIG_DUMMY_CONSOLE)11201120 conswitchp = &dummy_con;···11311131 register_refined_jiffies(CLOCK_TICK_RATE);1132113211331133#ifdef CONFIG_EFI11341134- /* Once setup is done above, disable efi_enabled on mismatched11351135- * firmware/kernel archtectures since there is no support for11361136- * runtime services.11341134+ /* Once setup is done above, unmap the EFI memory map on11351135+ * mismatched firmware/kernel archtectures since there is no11361136+ * support for runtime services.11371137 */11381138- if (efi_enabled && IS_ENABLED(CONFIG_X86_64) != efi_64bit) {11381138+ if (efi_enabled(EFI_BOOT) &&11391139+ IS_ENABLED(CONFIG_X86_64) != efi_enabled(EFI_64BIT)) {11391140 pr_info("efi: Setup done, disabling due to 32/64-bit mismatch\n");11401141 efi_unmap_memmap();11411141- efi_enabled = 0;11421142 }11431143#endif11441144}
+35-24
arch/x86/platform/efi/efi.c
···51515252#define EFI_DEBUG 153535454-int efi_enabled;5555-EXPORT_SYMBOL(efi_enabled);5656-5754struct efi __read_mostly efi = {5855 .mps = EFI_INVALID_TABLE_ADDR,5956 .acpi = EFI_INVALID_TABLE_ADDR,···66696770struct efi_memory_map memmap;68716969-bool efi_64bit;7070-7172static struct efi efi_phys __initdata;7273static efi_system_table_t efi_systab __initdata;73747475static inline bool efi_is_native(void)7576{7676- return IS_ENABLED(CONFIG_X86_64) == efi_64bit;7777+ return IS_ENABLED(CONFIG_X86_64) == efi_enabled(EFI_64BIT);7778}7979+8080+unsigned long x86_efi_facility;8181+8282+/*8383+ * Returns 1 if 'facility' is enabled, 0 otherwise.8484+ */8585+int efi_enabled(int facility)8686+{8787+ return test_bit(facility, &x86_efi_facility) != 0;8888+}8989+EXPORT_SYMBOL(efi_enabled);78907991static int __init setup_noefi(char *arg)8092{8181- efi_enabled = 0;9393+ clear_bit(EFI_BOOT, &x86_efi_facility);8294 return 0;8395}8496early_param("noefi", setup_noefi);···432426433427void __init efi_unmap_memmap(void)434428{429429+ clear_bit(EFI_MEMMAP, &x86_efi_facility);435430 if (memmap.map) {436431 early_iounmap(memmap.map, memmap.nr_map * memmap.desc_size);437432 memmap.map = NULL;···467460468461static int __init efi_systab_init(void *phys)469462{470470- if (efi_64bit) {463463+ if (efi_enabled(EFI_64BIT)) {471464 efi_system_table_64_t *systab64;472465 u64 tmp = 0;473466···559552 void *config_tables, *tablep;560553 int i, sz;561554562562- if (efi_64bit)555555+ if (efi_enabled(EFI_64BIT))563556 sz = sizeof(efi_config_table_64_t);564557 else565558 sz = sizeof(efi_config_table_32_t);···579572 efi_guid_t guid;580573 unsigned long table;581574582582- if (efi_64bit) {575575+ if (efi_enabled(EFI_64BIT)) {583576 u64 table64;584577 guid = ((efi_config_table_64_t *)tablep)->guid;585578 table64 = ((efi_config_table_64_t *)tablep)->table;···691684 if (boot_params.efi_info.efi_systab_hi ||692685 boot_params.efi_info.efi_memmap_hi) {693686 pr_info("Table located above 4GB, disabling EFI.\n");694694- efi_enabled = 0;695687 return;696688 }697689 efi_phys.systab = (efi_system_table_t *)boot_params.efi_info.efi_systab;···700694 ((__u64)boot_params.efi_info.efi_systab_hi<<32));701695#endif702696703703- if (efi_systab_init(efi_phys.systab)) {704704- efi_enabled = 0;697697+ if (efi_systab_init(efi_phys.systab))705698 return;706706- }699699+700700+ set_bit(EFI_SYSTEM_TABLES, &x86_efi_facility);707701708702 /*709703 * Show what we know for posterity···721715 efi.systab->hdr.revision >> 16,722716 efi.systab->hdr.revision & 0xffff, vendor);723717724724- if (efi_config_init(efi.systab->tables, efi.systab->nr_tables)) {725725- efi_enabled = 0;718718+ if (efi_config_init(efi.systab->tables, efi.systab->nr_tables))726719 return;727727- }720720+721721+ set_bit(EFI_CONFIG_TABLES, &x86_efi_facility);728722729723 /*730724 * Note: We currently don't support runtime services on an EFI···733727734728 if (!efi_is_native())735729 pr_info("No EFI runtime due to 32/64-bit mismatch with kernel\n");736736- else if (efi_runtime_init()) {737737- efi_enabled = 0;738738- return;730730+ else {731731+ if (efi_runtime_init())732732+ return;733733+ set_bit(EFI_RUNTIME_SERVICES, &x86_efi_facility);739734 }740735741741- if (efi_memmap_init()) {742742- efi_enabled = 0;736736+ if (efi_memmap_init())743737 return;744744- }738738+739739+ set_bit(EFI_MEMMAP, &x86_efi_facility);740740+745741#ifdef CONFIG_X86_32746742 if (efi_is_native()) {747743 x86_platform.get_wallclock = efi_get_time;···949941 *950942 * Call EFI services through wrapper functions.951943 */952952- efi.runtime_version = efi_systab.fw_revision;944944+ efi.runtime_version = efi_systab.hdr.revision;953945 efi.get_time = virt_efi_get_time;954946 efi.set_time = virt_efi_set_time;955947 efi.get_wakeup_time = virt_efi_get_wakeup_time;···976968{977969 efi_memory_desc_t *md;978970 void *p;971971+972972+ if (!efi_enabled(EFI_MEMMAP))973973+ return 0;979974980975 for (p = memmap.map; p < memmap.map_end; p += memmap.desc_size) {981976 md = p;
+17-5
arch/x86/platform/efi/efi_64.c
···3838#include <asm/cacheflush.h>3939#include <asm/fixmap.h>40404141-static pgd_t save_pgd __initdata;4141+static pgd_t *save_pgd __initdata;4242static unsigned long efi_flags __initdata;43434444static void __init early_code_mapping_set_exec(int executable)···6161void __init efi_call_phys_prelog(void)6262{6363 unsigned long vaddress;6464+ int pgd;6565+ int n_pgds;64666567 early_code_mapping_set_exec(1);6668 local_irq_save(efi_flags);6767- vaddress = (unsigned long)__va(0x0UL);6868- save_pgd = *pgd_offset_k(0x0UL);6969- set_pgd(pgd_offset_k(0x0UL), *pgd_offset_k(vaddress));6969+7070+ n_pgds = DIV_ROUND_UP((max_pfn << PAGE_SHIFT), PGDIR_SIZE);7171+ save_pgd = kmalloc(n_pgds * sizeof(pgd_t), GFP_KERNEL);7272+7373+ for (pgd = 0; pgd < n_pgds; pgd++) {7474+ save_pgd[pgd] = *pgd_offset_k(pgd * PGDIR_SIZE);7575+ vaddress = (unsigned long)__va(pgd * PGDIR_SIZE);7676+ set_pgd(pgd_offset_k(pgd * PGDIR_SIZE), *pgd_offset_k(vaddress));7777+ }7078 __flush_tlb_all();7179}7280···8375 /*8476 * After the lock is released, the original page table is restored.8577 */8686- set_pgd(pgd_offset_k(0x0UL), save_pgd);7878+ int pgd;7979+ int n_pgds = DIV_ROUND_UP((max_pfn << PAGE_SHIFT) , PGDIR_SIZE);8080+ for (pgd = 0; pgd < n_pgds; pgd++)8181+ set_pgd(pgd_offset_k(pgd * PGDIR_SIZE), save_pgd[pgd]);8282+ kfree(save_pgd);8783 __flush_tlb_all();8884 local_irq_restore(efi_flags);8985 early_code_mapping_set_exec(0);
+7-3
arch/x86/platform/uv/tlb_uv.c
···10341034 * globally purge translation cache of a virtual address or all TLB's10351035 * @cpumask: mask of all cpu's in which the address is to be removed10361036 * @mm: mm_struct containing virtual address range10371037- * @va: virtual address to be removed (or TLB_FLUSH_ALL for all TLB's on cpu)10371037+ * @start: start virtual address to be removed from TLB10381038+ * @end: end virtual address to be remove from TLB10381039 * @cpu: the current cpu10391040 *10401041 * This is the entry point for initiating any UV global TLB shootdown.···10571056 */10581057const struct cpumask *uv_flush_tlb_others(const struct cpumask *cpumask,10591058 struct mm_struct *mm, unsigned long start,10601060- unsigned end, unsigned int cpu)10591059+ unsigned long end, unsigned int cpu)10611060{10621061 int locals = 0;10631062 int remotes = 0;···1114111311151114 record_send_statistics(stat, locals, hubs, remotes, bau_desc);1116111511171117- bau_desc->payload.address = start;11161116+ if (!end || (end - start) <= PAGE_SIZE)11171117+ bau_desc->payload.address = start;11181118+ else11191119+ bau_desc->payload.address = TLB_FLUSH_ALL;11181120 bau_desc->payload.sending_cpu = cpu;11191121 /*11201122 * uv_flush_send_and_wait returns 0 if all cpu's were messaged,
···170170 consistent_sync(vaddr, size, direction);171171}172172173173+/* Not supported for now */174174+static inline int dma_mmap_coherent(struct device *dev,175175+ struct vm_area_struct *vma, void *cpu_addr,176176+ dma_addr_t dma_addr, size_t size)177177+{178178+ return -EINVAL;179179+}180180+181181+static inline int dma_get_sgtable(struct device *dev, struct sg_table *sgt,182182+ void *cpu_addr, dma_addr_t dma_addr,183183+ size_t size)184184+{185185+ return -EINVAL;186186+}187187+173188#endif /* _XTENSA_DMA_MAPPING_H */
+32-10
block/genhd.c
···35353636static struct device_type disk_type;37373838+static void disk_check_events(struct disk_events *ev,3939+ unsigned int *clearing_ptr);3840static void disk_alloc_events(struct gendisk *disk);3941static void disk_add_events(struct gendisk *disk);4042static void disk_del_events(struct gendisk *disk);···15511549 const struct block_device_operations *bdops = disk->fops;15521550 struct disk_events *ev = disk->ev;15531551 unsigned int pending;15521552+ unsigned int clearing = mask;1554155315551554 if (!ev) {15561555 /* for drivers still using the old ->media_changed method */···15611558 return 0;15621559 }1563156015641564- /* tell the workfn about the events being cleared */15611561+ disk_block_events(disk);15621562+15631563+ /*15641564+ * store the union of mask and ev->clearing on the stack so that the15651565+ * race with disk_flush_events does not cause ambiguity (ev->clearing15661566+ * can still be modified even if events are blocked).15671567+ */15651568 spin_lock_irq(&ev->lock);15661566- ev->clearing |= mask;15691569+ clearing |= ev->clearing;15701570+ ev->clearing = 0;15671571 spin_unlock_irq(&ev->lock);1568157215691569- /* uncondtionally schedule event check and wait for it to finish */15701570- disk_block_events(disk);15711571- queue_delayed_work(system_freezable_wq, &ev->dwork, 0);15721572- flush_delayed_work(&ev->dwork);15731573- __disk_unblock_events(disk, false);15731573+ disk_check_events(ev, &clearing);15741574+ /*15751575+ * if ev->clearing is not 0, the disk_flush_events got called in the15761576+ * middle of this function, so we want to run the workfn without delay.15771577+ */15781578+ __disk_unblock_events(disk, ev->clearing ? true : false);1574157915751580 /* then, fetch and clear pending events */15761581 spin_lock_irq(&ev->lock);15771577- WARN_ON_ONCE(ev->clearing & mask); /* cleared by workfn */15781582 pending = ev->pending & mask;15791583 ev->pending &= ~mask;15801584 spin_unlock_irq(&ev->lock);15851585+ WARN_ON_ONCE(clearing & mask);1581158615821587 return pending;15831588}1584158915901590+/*15911591+ * Separate this part out so that a different pointer for clearing_ptr can be15921592+ * passed in for disk_clear_events.15931593+ */15851594static void disk_events_workfn(struct work_struct *work)15861595{15871596 struct delayed_work *dwork = to_delayed_work(work);15881597 struct disk_events *ev = container_of(dwork, struct disk_events, dwork);15981598+15991599+ disk_check_events(ev, &ev->clearing);16001600+}16011601+16021602+static void disk_check_events(struct disk_events *ev,16031603+ unsigned int *clearing_ptr)16041604+{15891605 struct gendisk *disk = ev->disk;15901606 char *envp[ARRAY_SIZE(disk_uevents) + 1] = { };15911591- unsigned int clearing = ev->clearing;16071607+ unsigned int clearing = *clearing_ptr;15921608 unsigned int events;15931609 unsigned long intv;15941610 int nr_events = 0, i;···1620159816211599 events &= ~ev->pending;16221600 ev->pending |= events;16231623- ev->clearing &= ~clearing;16011601+ *clearing_ptr &= ~clearing;1624160216251603 intv = disk_events_poll_jiffies(disk);16261604 if (!ev->block && intv)
+1-1
drivers/acpi/osl.c
···250250 return acpi_rsdp;251251#endif252252253253- if (efi_enabled) {253253+ if (efi_enabled(EFI_CONFIG_TABLES)) {254254 if (efi.acpi20 != EFI_INVALID_TABLE_ADDR)255255 return efi.acpi20;256256 else if (efi.acpi != EFI_INVALID_TABLE_ADDR)
+73-73
drivers/atm/iphase.h
···636636#define SEG_BASE IPHASE5575_FRAG_CONTROL_REG_BASE 637637#define REASS_BASE IPHASE5575_REASS_CONTROL_REG_BASE 638638639639-typedef volatile u_int freg_t;639639+typedef volatile u_int ffreg_t;640640typedef u_int rreg_t;641641642642typedef struct _ffredn_t {643643- freg_t idlehead_high; /* Idle cell header (high) */644644- freg_t idlehead_low; /* Idle cell header (low) */645645- freg_t maxrate; /* Maximum rate */646646- freg_t stparms; /* Traffic Management Parameters */647647- freg_t abrubr_abr; /* ABRUBR Priority Byte 1, TCR Byte 0 */648648- freg_t rm_type; /* */649649- u_int filler5[0x17 - 0x06];650650- freg_t cmd_reg; /* Command register */651651- u_int filler18[0x20 - 0x18];652652- freg_t cbr_base; /* CBR Pointer Base */653653- freg_t vbr_base; /* VBR Pointer Base */654654- freg_t abr_base; /* ABR Pointer Base */655655- freg_t ubr_base; /* UBR Pointer Base */656656- u_int filler24;657657- freg_t vbrwq_base; /* VBR Wait Queue Base */658658- freg_t abrwq_base; /* ABR Wait Queue Base */659659- freg_t ubrwq_base; /* UBR Wait Queue Base */660660- freg_t vct_base; /* Main VC Table Base */661661- freg_t vcte_base; /* Extended Main VC Table Base */662662- u_int filler2a[0x2C - 0x2A];663663- freg_t cbr_tab_beg; /* CBR Table Begin */664664- freg_t cbr_tab_end; /* CBR Table End */665665- freg_t cbr_pointer; /* CBR Pointer */666666- u_int filler2f[0x30 - 0x2F];667667- freg_t prq_st_adr; /* Packet Ready Queue Start Address */668668- freg_t prq_ed_adr; /* Packet Ready Queue End Address */669669- freg_t prq_rd_ptr; /* Packet Ready Queue read pointer */670670- freg_t prq_wr_ptr; /* Packet Ready Queue write pointer */671671- freg_t tcq_st_adr; /* Transmit Complete Queue Start Address*/672672- freg_t tcq_ed_adr; /* Transmit Complete Queue End Address */673673- freg_t tcq_rd_ptr; /* Transmit Complete Queue read pointer */674674- freg_t tcq_wr_ptr; /* Transmit Complete Queue write pointer*/675675- u_int filler38[0x40 - 0x38];676676- freg_t queue_base; /* Base address for PRQ and TCQ */677677- freg_t desc_base; /* Base address of descriptor table */678678- u_int filler42[0x45 - 0x42];679679- freg_t mode_reg_0; /* Mode register 0 */680680- freg_t mode_reg_1; /* Mode register 1 */681681- freg_t intr_status_reg;/* Interrupt Status register */682682- freg_t mask_reg; /* Mask Register */683683- freg_t cell_ctr_high1; /* Total cell transfer count (high) */684684- freg_t cell_ctr_lo1; /* Total cell transfer count (low) */685685- freg_t state_reg; /* Status register */686686- u_int filler4c[0x58 - 0x4c];687687- freg_t curr_desc_num; /* Contains the current descriptor num */688688- freg_t next_desc; /* Next descriptor */689689- freg_t next_vc; /* Next VC */690690- u_int filler5b[0x5d - 0x5b];691691- freg_t present_slot_cnt;/* Present slot count */692692- u_int filler5e[0x6a - 0x5e];693693- freg_t new_desc_num; /* New descriptor number */694694- freg_t new_vc; /* New VC */695695- freg_t sched_tbl_ptr; /* Schedule table pointer */696696- freg_t vbrwq_wptr; /* VBR wait queue write pointer */697697- freg_t vbrwq_rptr; /* VBR wait queue read pointer */698698- freg_t abrwq_wptr; /* ABR wait queue write pointer */699699- freg_t abrwq_rptr; /* ABR wait queue read pointer */700700- freg_t ubrwq_wptr; /* UBR wait queue write pointer */701701- freg_t ubrwq_rptr; /* UBR wait queue read pointer */702702- freg_t cbr_vc; /* CBR VC */703703- freg_t vbr_sb_vc; /* VBR SB VC */704704- freg_t abr_sb_vc; /* ABR SB VC */705705- freg_t ubr_sb_vc; /* UBR SB VC */706706- freg_t vbr_next_link; /* VBR next link */707707- freg_t abr_next_link; /* ABR next link */708708- freg_t ubr_next_link; /* UBR next link */709709- u_int filler7a[0x7c-0x7a];710710- freg_t out_rate_head; /* Out of rate head */711711- u_int filler7d[0xca-0x7d]; /* pad out to full address space */712712- freg_t cell_ctr_high1_nc;/* Total cell transfer count (high) */713713- freg_t cell_ctr_lo1_nc;/* Total cell transfer count (low) */714714- u_int fillercc[0x100-0xcc]; /* pad out to full address space */643643+ ffreg_t idlehead_high; /* Idle cell header (high) */644644+ ffreg_t idlehead_low; /* Idle cell header (low) */645645+ ffreg_t maxrate; /* Maximum rate */646646+ ffreg_t stparms; /* Traffic Management Parameters */647647+ ffreg_t abrubr_abr; /* ABRUBR Priority Byte 1, TCR Byte 0 */648648+ ffreg_t rm_type; /* */649649+ u_int filler5[0x17 - 0x06];650650+ ffreg_t cmd_reg; /* Command register */651651+ u_int filler18[0x20 - 0x18];652652+ ffreg_t cbr_base; /* CBR Pointer Base */653653+ ffreg_t vbr_base; /* VBR Pointer Base */654654+ ffreg_t abr_base; /* ABR Pointer Base */655655+ ffreg_t ubr_base; /* UBR Pointer Base */656656+ u_int filler24;657657+ ffreg_t vbrwq_base; /* VBR Wait Queue Base */658658+ ffreg_t abrwq_base; /* ABR Wait Queue Base */659659+ ffreg_t ubrwq_base; /* UBR Wait Queue Base */660660+ ffreg_t vct_base; /* Main VC Table Base */661661+ ffreg_t vcte_base; /* Extended Main VC Table Base */662662+ u_int filler2a[0x2C - 0x2A];663663+ ffreg_t cbr_tab_beg; /* CBR Table Begin */664664+ ffreg_t cbr_tab_end; /* CBR Table End */665665+ ffreg_t cbr_pointer; /* CBR Pointer */666666+ u_int filler2f[0x30 - 0x2F];667667+ ffreg_t prq_st_adr; /* Packet Ready Queue Start Address */668668+ ffreg_t prq_ed_adr; /* Packet Ready Queue End Address */669669+ ffreg_t prq_rd_ptr; /* Packet Ready Queue read pointer */670670+ ffreg_t prq_wr_ptr; /* Packet Ready Queue write pointer */671671+ ffreg_t tcq_st_adr; /* Transmit Complete Queue Start Address*/672672+ ffreg_t tcq_ed_adr; /* Transmit Complete Queue End Address */673673+ ffreg_t tcq_rd_ptr; /* Transmit Complete Queue read pointer */674674+ ffreg_t tcq_wr_ptr; /* Transmit Complete Queue write pointer*/675675+ u_int filler38[0x40 - 0x38];676676+ ffreg_t queue_base; /* Base address for PRQ and TCQ */677677+ ffreg_t desc_base; /* Base address of descriptor table */678678+ u_int filler42[0x45 - 0x42];679679+ ffreg_t mode_reg_0; /* Mode register 0 */680680+ ffreg_t mode_reg_1; /* Mode register 1 */681681+ ffreg_t intr_status_reg;/* Interrupt Status register */682682+ ffreg_t mask_reg; /* Mask Register */683683+ ffreg_t cell_ctr_high1; /* Total cell transfer count (high) */684684+ ffreg_t cell_ctr_lo1; /* Total cell transfer count (low) */685685+ ffreg_t state_reg; /* Status register */686686+ u_int filler4c[0x58 - 0x4c];687687+ ffreg_t curr_desc_num; /* Contains the current descriptor num */688688+ ffreg_t next_desc; /* Next descriptor */689689+ ffreg_t next_vc; /* Next VC */690690+ u_int filler5b[0x5d - 0x5b];691691+ ffreg_t present_slot_cnt;/* Present slot count */692692+ u_int filler5e[0x6a - 0x5e];693693+ ffreg_t new_desc_num; /* New descriptor number */694694+ ffreg_t new_vc; /* New VC */695695+ ffreg_t sched_tbl_ptr; /* Schedule table pointer */696696+ ffreg_t vbrwq_wptr; /* VBR wait queue write pointer */697697+ ffreg_t vbrwq_rptr; /* VBR wait queue read pointer */698698+ ffreg_t abrwq_wptr; /* ABR wait queue write pointer */699699+ ffreg_t abrwq_rptr; /* ABR wait queue read pointer */700700+ ffreg_t ubrwq_wptr; /* UBR wait queue write pointer */701701+ ffreg_t ubrwq_rptr; /* UBR wait queue read pointer */702702+ ffreg_t cbr_vc; /* CBR VC */703703+ ffreg_t vbr_sb_vc; /* VBR SB VC */704704+ ffreg_t abr_sb_vc; /* ABR SB VC */705705+ ffreg_t ubr_sb_vc; /* UBR SB VC */706706+ ffreg_t vbr_next_link; /* VBR next link */707707+ ffreg_t abr_next_link; /* ABR next link */708708+ ffreg_t ubr_next_link; /* UBR next link */709709+ u_int filler7a[0x7c-0x7a];710710+ ffreg_t out_rate_head; /* Out of rate head */711711+ u_int filler7d[0xca-0x7d]; /* pad out to full address space */712712+ ffreg_t cell_ctr_high1_nc;/* Total cell transfer count (high) */713713+ ffreg_t cell_ctr_lo1_nc;/* Total cell transfer count (low) */714714+ u_int fillercc[0x100-0xcc]; /* pad out to full address space */715715} ffredn_t;716716717717typedef struct _rfredn_t {
···276276void bcma_bus_unregister(struct bcma_bus *bus)277277{278278 struct bcma_device *cores[3];279279+ int err;280280+281281+ err = bcma_gpio_unregister(&bus->drv_cc);282282+ if (err == -EBUSY)283283+ bcma_err(bus, "Some GPIOs are still in use.\n");284284+ else if (err)285285+ bcma_err(bus, "Can not unregister GPIO driver: %i\n", err);279286280287 cores[0] = bcma_find_core(bus, BCMA_CORE_MIPS_74K);281288 cores[1] = bcma_find_core(bus, BCMA_CORE_PCIE);
+1-1
drivers/block/drbd/drbd_req.c
···168168}169169170170/* must hold resource->req_lock */171171-static void start_new_tl_epoch(struct drbd_tconn *tconn)171171+void start_new_tl_epoch(struct drbd_tconn *tconn)172172{173173 /* no point closing an epoch, if it is empty, anyways. */174174 if (tconn->current_tle_writes == 0)
···792792{793793 struct llist_node *all_gnts;794794 struct grant *persistent_gnt;795795+ struct llist_node *n;795796796797 /* Prevent new requests being issued until we fix things up. */797798 spin_lock_irq(&info->io_lock);···805804 /* Remove all persistent grants */806805 if (info->persistent_gnts_c) {807806 all_gnts = llist_del_all(&info->persistent_gnts);808808- llist_for_each_entry(persistent_gnt, all_gnts, node) {807807+ llist_for_each_entry_safe(persistent_gnt, n, all_gnts, node) {809808 gnttab_end_foreign_access(persistent_gnt->gref, 0, 0UL);810809 __free_page(pfn_to_page(persistent_gnt->pfn));811810 kfree(persistent_gnt);···836835static void blkif_completion(struct blk_shadow *s, struct blkfront_info *info,837836 struct blkif_response *bret)838837{839839- int i;838838+ int i = 0;840839 struct bio_vec *bvec;841840 struct req_iterator iter;842841 unsigned long flags;···853852 */854853 rq_for_each_segment(bvec, s->request, iter) {855854 BUG_ON((bvec->bv_offset + bvec->bv_len) > PAGE_SIZE);856856- i = offset >> PAGE_SHIFT;855855+ if (bvec->bv_offset < offset)856856+ i++;857857 BUG_ON(i >= s->req.u.rw.nr_segments);858858 shared_data = kmap_atomic(859859 pfn_to_page(s->grants_used[i]->pfn));···863861 bvec->bv_len);864862 bvec_kunmap_irq(bvec_data, &flags);865863 kunmap_atomic(shared_data);866866- offset += bvec->bv_len;864864+ offset = bvec->bv_offset + bvec->bv_len;867865 }868866 }869867 /* Add the persistent grant into the list of free grants */
+2-1
drivers/char/virtio_console.c
···20622062 /* Disable interrupts for vqs */20632063 vdev->config->reset(vdev);20642064 /* Finish up work that's lined up */20652065- cancel_work_sync(&portdev->control_work);20652065+ if (use_multiport(portdev))20662066+ cancel_work_sync(&portdev->control_work);2066206720672068 list_for_each_entry_safe(port, port2, &portdev->ports, list)20682069 unplug_port(port);
+3-3
drivers/edac/edac_mc.c
···340340 /*341341 * Alocate and fill the csrow/channels structs342342 */343343- mci->csrows = kcalloc(sizeof(*mci->csrows), tot_csrows, GFP_KERNEL);343343+ mci->csrows = kcalloc(tot_csrows, sizeof(*mci->csrows), GFP_KERNEL);344344 if (!mci->csrows)345345 goto error;346346 for (row = 0; row < tot_csrows; row++) {···351351 csr->csrow_idx = row;352352 csr->mci = mci;353353 csr->nr_channels = tot_channels;354354- csr->channels = kcalloc(sizeof(*csr->channels), tot_channels,354354+ csr->channels = kcalloc(tot_channels, sizeof(*csr->channels),355355 GFP_KERNEL);356356 if (!csr->channels)357357 goto error;···369369 /*370370 * Allocate and fill the dimm structs371371 */372372- mci->dimms = kcalloc(sizeof(*mci->dimms), tot_dimms, GFP_KERNEL);372372+ mci->dimms = kcalloc(tot_dimms, sizeof(*mci->dimms), GFP_KERNEL);373373 if (!mci->dimms)374374 goto error;375375
+1-1
drivers/edac/edac_pci_sysfs.c
···256256 struct edac_pci_dev_attribute *edac_pci_dev;257257 edac_pci_dev = (struct edac_pci_dev_attribute *)attr;258258259259- if (edac_pci_dev->show)259259+ if (edac_pci_dev->store)260260 return edac_pci_dev->store(edac_pci_dev->value, buffer, count);261261 return -EIO;262262}
+1-1
drivers/firmware/dmi_scan.c
···471471 char __iomem *p, *q;472472 int rc;473473474474- if (efi_enabled) {474474+ if (efi_enabled(EFI_CONFIG_TABLES)) {475475 if (efi.smbios == EFI_INVALID_TABLE_ADDR)476476 goto error;477477
+5-4
drivers/firmware/efivars.c
···674674 err = -EACCES;675675 break;676676 case EFI_NOT_FOUND:677677- err = -ENOENT;677677+ err = -EIO;678678 break;679679 default:680680 err = -EINVAL;···793793 spin_unlock(&efivars->lock);794794 efivar_unregister(var);795795 drop_nlink(inode);796796+ d_delete(file->f_dentry);796797 dput(file->f_dentry);797798798799 } else {···995994 list_del(&var->list);996995 spin_unlock(&efivars->lock);997996 efivar_unregister(var);998998- drop_nlink(dir);997997+ drop_nlink(dentry->d_inode);999998 dput(dentry);1000999 return 0;10011000 }···17831782 printk(KERN_INFO "EFI Variables Facility v%s %s\n", EFIVARS_VERSION,17841783 EFIVARS_DATE);1785178417861786- if (!efi_enabled)17851785+ if (!efi_enabled(EFI_RUNTIME_SERVICES))17871786 return 0;1788178717891788 /* For now we'll register the efi directory at /sys/firmware/efi */···18231822static void __exit18241823efivars_exit(void)18251824{18261826- if (efi_enabled) {18251825+ if (efi_enabled(EFI_RUNTIME_SERVICES)) {18271826 unregister_efivars(&__efivars);18281827 kobject_put(efi_kobj);18291828 }
+1-1
drivers/firmware/iscsi_ibft_find.c
···9999 /* iBFT 1.03 section 1.4.3.1 mandates that UEFI machines will100100 * only use ACPI for this */101101102102- if (!efi_enabled)102102+ if (!efi_enabled(EFI_BOOT))103103 find_ibft_in_mem();104104105105 if (ibft_addr) {
+2-2
drivers/gpu/drm/exynos/Kconfig
···24242525config DRM_EXYNOS_FIMD2626 bool "Exynos DRM FIMD"2727- depends on DRM_EXYNOS && !FB_S3C2727+ depends on DRM_EXYNOS && !FB_S3C && !ARCH_MULTIPLATFORM2828 help2929 Choose this option if you want to use Exynos FIMD for DRM.3030···48484949config DRM_EXYNOS_IPP5050 bool "Exynos DRM IPP"5151- depends on DRM_EXYNOS5151+ depends on DRM_EXYNOS && !ARCH_MULTIPLATFORM5252 help5353 Choose this option if you want to use IPP feature for DRM.5454
+15-18
drivers/gpu/drm/exynos/exynos_drm_connector.c
···1818#include "exynos_drm_drv.h"1919#include "exynos_drm_encoder.h"20202121-#define MAX_EDID 2562221#define to_exynos_connector(x) container_of(x, struct exynos_drm_connector,\2322 drm_connector)2423···9596 to_exynos_connector(connector);9697 struct exynos_drm_manager *manager = exynos_connector->manager;9798 struct exynos_drm_display_ops *display_ops = manager->display_ops;9898- unsigned int count;9999+ struct edid *edid = NULL;100100+ unsigned int count = 0;101101+ int ret;99102100103 DRM_DEBUG_KMS("%s\n", __FILE__);101104···115114 * because lcd panel has only one mode.116115 */117116 if (display_ops->get_edid) {118118- int ret;119119- void *edid;120120-121121- edid = kzalloc(MAX_EDID, GFP_KERNEL);122122- if (!edid) {123123- DRM_ERROR("failed to allocate edid\n");124124- return 0;117117+ edid = display_ops->get_edid(manager->dev, connector);118118+ if (IS_ERR_OR_NULL(edid)) {119119+ ret = PTR_ERR(edid);120120+ edid = NULL;121121+ DRM_ERROR("Panel operation get_edid failed %d\n", ret);122122+ goto out;125123 }126124127127- ret = display_ops->get_edid(manager->dev, connector,128128- edid, MAX_EDID);129129- if (ret < 0) {130130- DRM_ERROR("failed to get edid data.\n");131131- kfree(edid);132132- edid = NULL;133133- return 0;125125+ count = drm_add_edid_modes(connector, edid);126126+ if (count < 0) {127127+ DRM_ERROR("Add edid modes failed %d\n", count);128128+ goto out;134129 }135130136131 drm_mode_connector_update_edid_property(connector, edid);137137- count = drm_add_edid_modes(connector, edid);138138- kfree(edid);139132 } else {140133 struct exynos_drm_panel_info *panel;141134 struct drm_display_mode *mode = drm_mode_create(connector->dev);···156161 count = 1;157162 }158163164164+out:165165+ kfree(edid);159166 return count;160167}161168
+11-13
drivers/gpu/drm/exynos/exynos_drm_dmabuf.c
···1919struct exynos_drm_dmabuf_attachment {2020 struct sg_table sgt;2121 enum dma_data_direction dir;2222+ bool is_mapped;2223};23242425static int exynos_gem_attach_dma_buf(struct dma_buf *dmabuf,···73727473 DRM_DEBUG_PRIME("%s\n", __FILE__);75747676- if (WARN_ON(dir == DMA_NONE))7777- return ERR_PTR(-EINVAL);7878-7975 /* just return current sgt if already requested. */8080- if (exynos_attach->dir == dir)7676+ if (exynos_attach->dir == dir && exynos_attach->is_mapped)8177 return &exynos_attach->sgt;8282-8383- /* reattaching is not allowed. */8484- if (WARN_ON(exynos_attach->dir != DMA_NONE))8585- return ERR_PTR(-EBUSY);86788779 buf = gem_obj->buffer;8880 if (!buf) {···101107 wr = sg_next(wr);102108 }103109104104- nents = dma_map_sg(attach->dev, sgt->sgl, sgt->orig_nents, dir);105105- if (!nents) {106106- DRM_ERROR("failed to map sgl with iommu.\n");107107- sgt = ERR_PTR(-EIO);108108- goto err_unlock;110110+ if (dir != DMA_NONE) {111111+ nents = dma_map_sg(attach->dev, sgt->sgl, sgt->orig_nents, dir);112112+ if (!nents) {113113+ DRM_ERROR("failed to map sgl with iommu.\n");114114+ sg_free_table(sgt);115115+ sgt = ERR_PTR(-EIO);116116+ goto err_unlock;117117+ }109118 }110119120120+ exynos_attach->is_mapped = true;111121 exynos_attach->dir = dir;112122 attach->priv = exynos_attach;113123
+2-2
drivers/gpu/drm/exynos/exynos_drm_drv.h
···148148struct exynos_drm_display_ops {149149 enum exynos_drm_output_type type;150150 bool (*is_connected)(struct device *dev);151151- int (*get_edid)(struct device *dev, struct drm_connector *connector,152152- u8 *edid, int len);151151+ struct edid *(*get_edid)(struct device *dev,152152+ struct drm_connector *connector);153153 void *(*get_panel)(struct device *dev);154154 int (*check_timing)(struct device *dev, void *timing);155155 int (*power_on)(struct device *dev, int mode);
+1-1
drivers/gpu/drm/exynos/exynos_drm_g2d.c
···324324 g2d_userptr = NULL;325325}326326327327-dma_addr_t *g2d_userptr_get_dma_addr(struct drm_device *drm_dev,327327+static dma_addr_t *g2d_userptr_get_dma_addr(struct drm_device *drm_dev,328328 unsigned long userptr,329329 unsigned long size,330330 struct drm_file *filp,
···505505 struct drm_i915_private *dev_priv = dev->dev_private;506506 int ret = init_ring_common(ring);507507508508- if (INTEL_INFO(dev)->gen > 3) {508508+ if (INTEL_INFO(dev)->gen > 3)509509 I915_WRITE(MI_MODE, _MASKED_BIT_ENABLE(VS_TIMER_DISPATCH));510510- if (IS_GEN7(dev))511511- I915_WRITE(GFX_MODE_GEN7,512512- _MASKED_BIT_DISABLE(GFX_TLB_INVALIDATE_ALWAYS) |513513- _MASKED_BIT_ENABLE(GFX_REPLAY_MODE));514514- }510510+511511+ /* We need to disable the AsyncFlip performance optimisations in order512512+ * to use MI_WAIT_FOR_EVENT within the CS. It should already be513513+ * programmed to '1' on all products.514514+ */515515+ if (INTEL_INFO(dev)->gen >= 6)516516+ I915_WRITE(MI_MODE, _MASKED_BIT_ENABLE(ASYNC_FLIP_PERF_DISABLE));517517+518518+ /* Required for the hardware to program scanline values for waiting */519519+ if (INTEL_INFO(dev)->gen == 6)520520+ I915_WRITE(GFX_MODE,521521+ _MASKED_BIT_ENABLE(GFX_TLB_INVALIDATE_ALWAYS));522522+523523+ if (IS_GEN7(dev))524524+ I915_WRITE(GFX_MODE_GEN7,525525+ _MASKED_BIT_DISABLE(GFX_TLB_INVALIDATE_ALWAYS) |526526+ _MASKED_BIT_ENABLE(GFX_REPLAY_MODE));515527516528 if (INTEL_INFO(dev)->gen >= 5) {517529 ret = init_pipe_control(ring);
···241241 y = 0;242242 }243243244244- if (ASIC_IS_AVIVO(rdev)) {244244+ /* fixed on DCE6 and newer */245245+ if (ASIC_IS_AVIVO(rdev) && !ASIC_IS_DCE6(rdev)) {245246 int i = 0;246247 struct drm_crtc *crtc_p;247248
+2-1
drivers/gpu/drm/radeon/radeon_device.c
···429429{430430 uint32_t reg;431431432432- if (efi_enabled && rdev->pdev->subsystem_vendor == PCI_VENDOR_ID_APPLE)432432+ if (efi_enabled(EFI_BOOT) &&433433+ rdev->pdev->subsystem_vendor == PCI_VENDOR_ID_APPLE)433434 return false;434435435436 /* first check CRTCs */
+4-2
drivers/gpu/drm/radeon/radeon_display.c
···11151115 }1116111611171117 radeon_fb = kzalloc(sizeof(*radeon_fb), GFP_KERNEL);11181118- if (radeon_fb == NULL)11181118+ if (radeon_fb == NULL) {11191119+ drm_gem_object_unreference_unlocked(obj);11191120 return ERR_PTR(-ENOMEM);11211121+ }1120112211211123 ret = radeon_framebuffer_init(dev, radeon_fb, mode_cmd, obj);11221124 if (ret) {11231125 kfree(radeon_fb);11241126 drm_gem_object_unreference_unlocked(obj);11251125- return NULL;11271127+ return ERR_PTR(ret);11261128 }1127112911281130 return &radeon_fb->base;
+3
drivers/gpu/drm/radeon/radeon_ring.c
···377377{378378 int r;379379380380+ /* make sure we aren't trying to allocate more space than there is on the ring */381381+ if (ndw > (ring->ring_size / 4))382382+ return -ENOMEM;380383 /* Align requested size with padding so unlock_commit can381384 * pad safely */382385 ndw = (ndw + ring->align_mask) & ~ring->align_mask;
···336336 WREG32(R600_CITF_CNTL, blackout);337337 }338338 }339339+ /* wait for the MC to settle */340340+ udelay(100);339341}340342341343void rv515_mc_resume(struct radeon_device *rdev, struct rv515_mc_save *save)
···518518 .ioctl_ops = &fm_drv_ioctl_ops,519519 .name = FM_DRV_NAME,520520 .release = video_device_release,521521+ /*522522+ * To ensure both the tuner and modulator ioctls are accessible we523523+ * set the vfl_dir to M2M to indicate this.524524+ *525525+ * It is not really a mem2mem device of course, but it can both receive526526+ * and transmit using the same radio device. It's the only radio driver527527+ * that does this and it should really be split in two radio devices,528528+ * but that would affect applications using this driver.529529+ */530530+ .vfl_dir = VFL_DIR_M2M,521531};522532523533int fm_v4l2_init_video_device(struct fmdev *fmdev, int radio_nr)
+1
drivers/mtd/devices/Kconfig
···272272 tristate "M-Systems Disk-On-Chip G3"273273 select BCH274274 select BCH_CONST_PARAMS275275+ select BITREVERSE275276 ---help---276277 This provides an MTD device driver for the M-Systems DiskOnChip277278 G3 devices.
···1717#include "bcm47xxnflash.h"18181919/* Broadcom uses 1'000'000 but it seems to be too many. Tests on WNDR4500 has2020- * shown 164 retries as maxiumum. */2121-#define NFLASH_READY_RETRIES 10002020+ * shown ~1000 retries as maxiumum. */2121+#define NFLASH_READY_RETRIES 1000022222323#define NFLASH_SECTOR_SIZE 5122424
···28572857 int i;28582858 int val;2859285928602860- /* ONFI need to be probed in 8 bits mode */28612861- WARN_ON(chip->options & NAND_BUSWIDTH_16);28602860+ /* ONFI need to be probed in 8 bits mode, and 16 bits should be selected with NAND_BUSWIDTH_AUTO */28612861+ if (chip->options & NAND_BUSWIDTH_16) {28622862+ pr_err("Trying ONFI probe in 16 bits mode, aborting !\n");28632863+ return 0;28642864+ }28622865 /* Try ONFI for unknown chip or LP */28632866 chip->cmdfunc(mtd, NAND_CMD_READID, 0x20, -1);28642867 if (chip->read_byte(mtd) != 'O' || chip->read_byte(mtd) != 'N' ||
+1-1
drivers/net/ethernet/mellanox/mlx4/main.c
···380380 }381381 }382382383383- if ((dev_cap->flags &383383+ if ((dev->caps.flags &384384 (MLX4_DEV_CAP_FLAG_64B_CQE | MLX4_DEV_CAP_FLAG_64B_EQE)) &&385385 mlx4_is_master(dev))386386 dev->caps.function_caps |= MLX4_FUNC_CAP_64B_EQE_CQE;
···151151/* Notify xenvif that ring now has space to send an skb to the frontend */152152void xenvif_notify_tx_completion(struct xenvif *vif);153153154154+/* Prevent the device from generating any further traffic. */155155+void xenvif_carrier_off(struct xenvif *vif);156156+154157/* Returns number of ring slots required to send an skb to the frontend */155158unsigned int xen_netbk_count_skb_slots(struct xenvif *vif, struct sk_buff *skb);156159
···147147 atomic_dec(&netbk->netfront_count);148148}149149150150-static void xen_netbk_idx_release(struct xen_netbk *netbk, u16 pending_idx);150150+static void xen_netbk_idx_release(struct xen_netbk *netbk, u16 pending_idx,151151+ u8 status);151152static void make_tx_response(struct xenvif *vif,152153 struct xen_netif_tx_request *txp,153154 s8 st);···880879881880 do {882881 make_tx_response(vif, txp, XEN_NETIF_RSP_ERROR);883883- if (cons >= end)882882+ if (cons == end)884883 break;885884 txp = RING_GET_REQUEST(&vif->tx, cons++);886885 } while (1);887886 vif->tx.req_cons = cons;888887 xen_netbk_check_rx_xenvif(vif);888888+ xenvif_put(vif);889889+}890890+891891+static void netbk_fatal_tx_err(struct xenvif *vif)892892+{893893+ netdev_err(vif->dev, "fatal error; disabling device\n");894894+ xenvif_carrier_off(vif);889895 xenvif_put(vif);890896}891897···909901910902 do {911903 if (frags >= work_to_do) {912912- netdev_dbg(vif->dev, "Need more frags\n");904904+ netdev_err(vif->dev, "Need more frags\n");905905+ netbk_fatal_tx_err(vif);913906 return -frags;914907 }915908916909 if (unlikely(frags >= MAX_SKB_FRAGS)) {917917- netdev_dbg(vif->dev, "Too many frags\n");910910+ netdev_err(vif->dev, "Too many frags\n");911911+ netbk_fatal_tx_err(vif);918912 return -frags;919913 }920914921915 memcpy(txp, RING_GET_REQUEST(&vif->tx, cons + frags),922916 sizeof(*txp));923917 if (txp->size > first->size) {924924- netdev_dbg(vif->dev, "Frags galore\n");918918+ netdev_err(vif->dev, "Frag is bigger than frame.\n");919919+ netbk_fatal_tx_err(vif);925920 return -frags;926921 }927922···932921 frags++;933922934923 if (unlikely((txp->offset + txp->size) > PAGE_SIZE)) {935935- netdev_dbg(vif->dev, "txp->offset: %x, size: %u\n",924924+ netdev_err(vif->dev, "txp->offset: %x, size: %u\n",936925 txp->offset, txp->size);926926+ netbk_fatal_tx_err(vif);937927 return -frags;938928 }939929 } while ((txp++)->flags & XEN_NETTXF_more_data);···978966 pending_idx = netbk->pending_ring[index];979967 page = xen_netbk_alloc_page(netbk, skb, pending_idx);980968 if (!page)981981- return NULL;969969+ goto err;982970983971 gop->source.u.ref = txp->gref;984972 gop->source.domid = vif->domid;···1000988 }10019891002990 return gop;991991+err:992992+ /* Unwind, freeing all pages and sending error responses. */993993+ while (i-- > start) {994994+ xen_netbk_idx_release(netbk, frag_get_pending_idx(&frags[i]),995995+ XEN_NETIF_RSP_ERROR);996996+ }997997+ /* The head too, if necessary. */998998+ if (start)999999+ xen_netbk_idx_release(netbk, pending_idx, XEN_NETIF_RSP_ERROR);10001000+10011001+ return NULL;10031002}1004100310051004static int xen_netbk_tx_check_gop(struct xen_netbk *netbk,···1019996{1020997 struct gnttab_copy *gop = *gopp;1021998 u16 pending_idx = *((u16 *)skb->data);10221022- struct pending_tx_info *pending_tx_info = netbk->pending_tx_info;10231023- struct xenvif *vif = pending_tx_info[pending_idx].vif;10241024- struct xen_netif_tx_request *txp;1025999 struct skb_shared_info *shinfo = skb_shinfo(skb);10261000 int nr_frags = shinfo->nr_frags;10271001 int i, err, start;1028100210291003 /* Check status of header. */10301004 err = gop->status;10311031- if (unlikely(err)) {10321032- pending_ring_idx_t index;10331033- index = pending_index(netbk->pending_prod++);10341034- txp = &pending_tx_info[pending_idx].req;10351035- make_tx_response(vif, txp, XEN_NETIF_RSP_ERROR);10361036- netbk->pending_ring[index] = pending_idx;10371037- xenvif_put(vif);10381038- }10051005+ if (unlikely(err))10061006+ xen_netbk_idx_release(netbk, pending_idx, XEN_NETIF_RSP_ERROR);1039100710401008 /* Skip first skb fragment if it is on same page as header fragment. */10411009 start = (frag_get_pending_idx(&shinfo->frags[0]) == pending_idx);1042101010431011 for (i = start; i < nr_frags; i++) {10441012 int j, newerr;10451045- pending_ring_idx_t index;1046101310471014 pending_idx = frag_get_pending_idx(&shinfo->frags[i]);10481015···10411028 if (likely(!newerr)) {10421029 /* Had a previous error? Invalidate this fragment. */10431030 if (unlikely(err))10441044- xen_netbk_idx_release(netbk, pending_idx);10311031+ xen_netbk_idx_release(netbk, pending_idx, XEN_NETIF_RSP_OKAY);10451032 continue;10461033 }1047103410481035 /* Error on this fragment: respond to client with an error. */10491049- txp = &netbk->pending_tx_info[pending_idx].req;10501050- make_tx_response(vif, txp, XEN_NETIF_RSP_ERROR);10511051- index = pending_index(netbk->pending_prod++);10521052- netbk->pending_ring[index] = pending_idx;10531053- xenvif_put(vif);10361036+ xen_netbk_idx_release(netbk, pending_idx, XEN_NETIF_RSP_ERROR);1054103710551038 /* Not the first error? Preceding frags already invalidated. */10561039 if (err)···1054104510551046 /* First error: invalidate header and preceding fragments. */10561047 pending_idx = *((u16 *)skb->data);10571057- xen_netbk_idx_release(netbk, pending_idx);10481048+ xen_netbk_idx_release(netbk, pending_idx, XEN_NETIF_RSP_OKAY);10581049 for (j = start; j < i; j++) {10591050 pending_idx = frag_get_pending_idx(&shinfo->frags[j]);10601060- xen_netbk_idx_release(netbk, pending_idx);10511051+ xen_netbk_idx_release(netbk, pending_idx, XEN_NETIF_RSP_OKAY);10611052 }1062105310631054 /* Remember the error: invalidate all subsequent fragments. */···1091108210921083 /* Take an extra reference to offset xen_netbk_idx_release */10931084 get_page(netbk->mmap_pages[pending_idx]);10941094- xen_netbk_idx_release(netbk, pending_idx);10851085+ xen_netbk_idx_release(netbk, pending_idx, XEN_NETIF_RSP_OKAY);10951086 }10961087}10971088···1104109511051096 do {11061097 if (unlikely(work_to_do-- <= 0)) {11071107- netdev_dbg(vif->dev, "Missing extra info\n");10981098+ netdev_err(vif->dev, "Missing extra info\n");10991099+ netbk_fatal_tx_err(vif);11081100 return -EBADR;11091101 }11101102···11141104 if (unlikely(!extra.type ||11151105 extra.type >= XEN_NETIF_EXTRA_TYPE_MAX)) {11161106 vif->tx.req_cons = ++cons;11171117- netdev_dbg(vif->dev,11071107+ netdev_err(vif->dev,11181108 "Invalid extra type: %d\n", extra.type);11091109+ netbk_fatal_tx_err(vif);11191110 return -EINVAL;11201111 }11211112···11321121 struct xen_netif_extra_info *gso)11331122{11341123 if (!gso->u.gso.size) {11351135- netdev_dbg(vif->dev, "GSO size must not be zero.\n");11241124+ netdev_err(vif->dev, "GSO size must not be zero.\n");11251125+ netbk_fatal_tx_err(vif);11361126 return -EINVAL;11371127 }1138112811391129 /* Currently only TCPv4 S.O. is supported. */11401130 if (gso->u.gso.type != XEN_NETIF_GSO_TYPE_TCPV4) {11411141- netdev_dbg(vif->dev, "Bad GSO type %d.\n", gso->u.gso.type);11311131+ netdev_err(vif->dev, "Bad GSO type %d.\n", gso->u.gso.type);11321132+ netbk_fatal_tx_err(vif);11421133 return -EINVAL;11431134 }11441135···1277126412781265 /* Get a netif from the list with work to do. */12791266 vif = poll_net_schedule_list(netbk);12671267+ /* This can sometimes happen because the test of12681268+ * list_empty(net_schedule_list) at the top of the12691269+ * loop is unlocked. Just go back and have another12701270+ * look.12711271+ */12801272 if (!vif)12811273 continue;12741274+12751275+ if (vif->tx.sring->req_prod - vif->tx.req_cons >12761276+ XEN_NETIF_TX_RING_SIZE) {12771277+ netdev_err(vif->dev,12781278+ "Impossible number of requests. "12791279+ "req_prod %d, req_cons %d, size %ld\n",12801280+ vif->tx.sring->req_prod, vif->tx.req_cons,12811281+ XEN_NETIF_TX_RING_SIZE);12821282+ netbk_fatal_tx_err(vif);12831283+ continue;12841284+ }1282128512831286 RING_FINAL_CHECK_FOR_REQUESTS(&vif->tx, work_to_do);12841287 if (!work_to_do) {···13231294 work_to_do = xen_netbk_get_extras(vif, extras,13241295 work_to_do);13251296 idx = vif->tx.req_cons;13261326- if (unlikely(work_to_do < 0)) {13271327- netbk_tx_err(vif, &txreq, idx);12971297+ if (unlikely(work_to_do < 0))13281298 continue;13291329- }13301299 }1331130013321301 ret = netbk_count_requests(vif, &txreq, txfrags, work_to_do);13331333- if (unlikely(ret < 0)) {13341334- netbk_tx_err(vif, &txreq, idx - ret);13021302+ if (unlikely(ret < 0))13351303 continue;13361336- }13041304+13371305 idx += ret;1338130613391307 if (unlikely(txreq.size < ETH_HLEN)) {···1342131613431317 /* No crossing a page as the payload mustn't fragment. */13441318 if (unlikely((txreq.offset + txreq.size) > PAGE_SIZE)) {13451345- netdev_dbg(vif->dev,13191319+ netdev_err(vif->dev,13461320 "txreq.offset: %x, size: %u, end: %lu\n",13471321 txreq.offset, txreq.size,13481322 (txreq.offset&~PAGE_MASK) + txreq.size);13491349- netbk_tx_err(vif, &txreq, idx);13231323+ netbk_fatal_tx_err(vif);13501324 continue;13511325 }13521326···13741348 gso = &extras[XEN_NETIF_EXTRA_TYPE_GSO - 1];1375134913761350 if (netbk_set_skb_gso(vif, skb, gso)) {13511351+ /* Failure in netbk_set_skb_gso is fatal. */13771352 kfree_skb(skb);13781378- netbk_tx_err(vif, &txreq, idx);13791353 continue;13801354 }13811355 }···14741448 txp->size -= data_len;14751449 } else {14761450 /* Schedule a response immediately. */14771477- xen_netbk_idx_release(netbk, pending_idx);14511451+ xen_netbk_idx_release(netbk, pending_idx, XEN_NETIF_RSP_OKAY);14781452 }1479145314801454 if (txp->flags & XEN_NETTXF_csum_blank)···15261500 xen_netbk_tx_submit(netbk);15271501}1528150215291529-static void xen_netbk_idx_release(struct xen_netbk *netbk, u16 pending_idx)15031503+static void xen_netbk_idx_release(struct xen_netbk *netbk, u16 pending_idx,15041504+ u8 status)15301505{15311506 struct xenvif *vif;15321507 struct pending_tx_info *pending_tx_info;···1541151415421515 vif = pending_tx_info->vif;1543151615441544- make_tx_response(vif, &pending_tx_info->req, XEN_NETIF_RSP_OKAY);15171517+ make_tx_response(vif, &pending_tx_info->req, status);1545151815461519 index = pending_index(netbk->pending_prod++);15471520 netbk->pending_ring[index] = pending_idx;
+2-3
drivers/pinctrl/Kconfig
···181181182182config PINCTRL_SAMSUNG183183 bool184184- depends on OF && GPIOLIB185184 select PINMUX186185 select PINCONF187186188188-config PINCTRL_EXYNOS4189189- bool "Pinctrl driver data for Exynos4 SoC"187187+config PINCTRL_EXYNOS188188+ bool "Pinctrl driver data for Samsung EXYNOS SoCs"190189 depends on OF && GPIOLIB191190 select PINCTRL_SAMSUNG192191
···599599}600600601601/* parse the pin numbers listed in the 'samsung,exynos5440-pins' property */602602-static int __init exynos5440_pinctrl_parse_dt_pins(struct platform_device *pdev,602602+static int exynos5440_pinctrl_parse_dt_pins(struct platform_device *pdev,603603 struct device_node *cfg_np, unsigned int **pin_list,604604 unsigned int *npins)605605{···630630 * Parse the information about all the available pin groups and pin functions631631 * from device node of the pin-controller.632632 */633633-static int __init exynos5440_pinctrl_parse_dt(struct platform_device *pdev,633633+static int exynos5440_pinctrl_parse_dt(struct platform_device *pdev,634634 struct exynos5440_pinctrl_priv_data *priv)635635{636636 struct device *dev = &pdev->dev;···723723}724724725725/* register the pinctrl interface with the pinctrl subsystem */726726-static int __init exynos5440_pinctrl_register(struct platform_device *pdev,726726+static int exynos5440_pinctrl_register(struct platform_device *pdev,727727 struct exynos5440_pinctrl_priv_data *priv)728728{729729 struct device *dev = &pdev->dev;···798798}799799800800/* register the gpiolib interface with the gpiolib subsystem */801801-static int __init exynos5440_gpiolib_register(struct platform_device *pdev,801801+static int exynos5440_gpiolib_register(struct platform_device *pdev,802802 struct exynos5440_pinctrl_priv_data *priv)803803{804804 struct gpio_chip *gc;···831831}832832833833/* unregister the gpiolib interface with the gpiolib subsystem */834834-static int __init exynos5440_gpiolib_unregister(struct platform_device *pdev,834834+static int exynos5440_gpiolib_unregister(struct platform_device *pdev,835835 struct exynos5440_pinctrl_priv_data *priv)836836{837837 int ret = gpiochip_remove(priv->gc);
+4-5
drivers/pinctrl/pinctrl-mxs.c
···146146static void mxs_dt_free_map(struct pinctrl_dev *pctldev,147147 struct pinctrl_map *map, unsigned num_maps)148148{149149- int i;149149+ u32 i;150150151151 for (i = 0; i < num_maps; i++) {152152 if (map[i].type == PIN_MAP_TYPE_MUX_GROUP)···203203 void __iomem *reg;204204 u8 bank, shift;205205 u16 pin;206206- int i;206206+ u32 i;207207208208 for (i = 0; i < g->npins; i++) {209209 bank = PINID_TO_BANK(g->pins[i]);···256256 void __iomem *reg;257257 u8 ma, vol, pull, bank, shift;258258 u16 pin;259259- int i;259259+ u32 i;260260261261 ma = CONFIG_TO_MA(config);262262 vol = CONFIG_TO_VOL(config);···345345 const char *propname = "fsl,pinmux-ids";346346 char *group;347347 int length = strlen(np->name) + SUFFIX_LEN;348348- int i;349349- u32 val;348348+ u32 val, i;350349351350 group = devm_kzalloc(&pdev->dev, length, GFP_KERNEL);352351 if (!group)
+1-1
drivers/pinctrl/pinctrl-nomadik.c
···676676}677677EXPORT_SYMBOL(nmk_gpio_set_mode);678678679679-static int nmk_prcm_gpiocr_get_mode(struct pinctrl_dev *pctldev, int gpio)679679+static int __maybe_unused nmk_prcm_gpiocr_get_mode(struct pinctrl_dev *pctldev, int gpio)680680{681681 int i;682682 u16 reg;
+2-77
drivers/pinctrl/pinctrl-single.c
···3030#define PCS_MUX_BITS_NAME "pinctrl-single,bits"3131#define PCS_REG_NAME_LEN ((sizeof(unsigned long) * 2) + 1)3232#define PCS_OFF_DISABLED ~0U3333-#define PCS_MAX_GPIO_VALUES 234333534/**3635 * struct pcs_pingroup - pingroups for a function···7475 const char **pgnames;7576 int npgnames;7677 struct list_head node;7777-};7878-7979-/**8080- * struct pcs_gpio_range - pinctrl gpio range8181- * @range: subrange of the GPIO number space8282- * @gpio_func: gpio function value in the pinmux register8383- */8484-struct pcs_gpio_range {8585- struct pinctrl_gpio_range range;8686- int gpio_func;8778};88798980/**···403414}404415405416static int pcs_request_gpio(struct pinctrl_dev *pctldev,406406- struct pinctrl_gpio_range *range, unsigned pin)417417+ struct pinctrl_gpio_range *range, unsigned offset)407418{408408- struct pcs_device *pcs = pinctrl_dev_get_drvdata(pctldev);409409- struct pcs_gpio_range *gpio = NULL;410410- int end, mux_bytes;411411- unsigned data;412412-413413- gpio = container_of(range, struct pcs_gpio_range, range);414414- end = range->pin_base + range->npins - 1;415415- if (pin < range->pin_base || pin > end) {416416- dev_err(pctldev->dev,417417- "pin %d isn't in the range of %d to %d\n",418418- pin, range->pin_base, end);419419- return -EINVAL;420420- }421421- mux_bytes = pcs->width / BITS_PER_BYTE;422422- data = pcs->read(pcs->base + pin * mux_bytes) & ~pcs->fmask;423423- data |= gpio->gpio_func;424424- pcs->write(data, pcs->base + pin * mux_bytes);425425- return 0;419419+ return -ENOTSUPP;426420}427421428422static struct pinmux_ops pcs_pinmux_ops = {···879907880908static struct of_device_id pcs_of_match[];881909882882-static int pcs_add_gpio_range(struct device_node *node, struct pcs_device *pcs)883883-{884884- struct pcs_gpio_range *gpio;885885- struct device_node *child;886886- struct resource r;887887- const char name[] = "pinctrl-single";888888- u32 gpiores[PCS_MAX_GPIO_VALUES];889889- int ret, i = 0, mux_bytes = 0;890890-891891- for_each_child_of_node(node, child) {892892- ret = of_address_to_resource(child, 0, &r);893893- if (ret < 0)894894- continue;895895- memset(gpiores, 0, sizeof(u32) * PCS_MAX_GPIO_VALUES);896896- ret = of_property_read_u32_array(child, "pinctrl-single,gpio",897897- gpiores, PCS_MAX_GPIO_VALUES);898898- if (ret < 0)899899- continue;900900- gpio = devm_kzalloc(pcs->dev, sizeof(*gpio), GFP_KERNEL);901901- if (!gpio) {902902- dev_err(pcs->dev, "failed to allocate pcs gpio\n");903903- return -ENOMEM;904904- }905905- gpio->range.name = devm_kzalloc(pcs->dev, sizeof(name),906906- GFP_KERNEL);907907- if (!gpio->range.name) {908908- dev_err(pcs->dev, "failed to allocate range name\n");909909- return -ENOMEM;910910- }911911- memcpy((char *)gpio->range.name, name, sizeof(name));912912-913913- gpio->range.id = i++;914914- gpio->range.base = gpiores[0];915915- gpio->gpio_func = gpiores[1];916916- mux_bytes = pcs->width / BITS_PER_BYTE;917917- gpio->range.pin_base = (r.start - pcs->res->start) / mux_bytes;918918- gpio->range.npins = (r.end - r.start) / mux_bytes + 1;919919-920920- pinctrl_add_gpio_range(pcs->pctl, &gpio->range);921921- }922922- return 0;923923-}924924-925910static int pcs_probe(struct platform_device *pdev)926911{927912 struct device_node *np = pdev->dev.of_node;···9741045 ret = -EINVAL;9751046 goto free;9761047 }977977-978978- ret = pcs_add_gpio_range(np, pcs);979979- if (ret < 0)980980- goto free;98110489821049 dev_info(pcs->dev, "%i pins at pa %p size %u\n",9831050 pcs->desc.npins, pcs->base, pcs->size);
···244244 if (force)245245 pr_warn("module loaded by force\n");246246 /* first ensure that we are running on IBM HW */247247- else if (efi_enabled || !dmi_check_system(ibm_rtl_dmi_table))247247+ else if (efi_enabled(EFI_BOOT) || !dmi_check_system(ibm_rtl_dmi_table))248248 return -ENODEV;249249250250 /* Get the address for the Extended BIOS Data Area */
+4
drivers/platform/x86/samsung-laptop.c
···2626#include <linux/seq_file.h>2727#include <linux/debugfs.h>2828#include <linux/ctype.h>2929+#include <linux/efi.h>2930#include <acpi/video.h>30313132/*···15441543{15451544 struct samsung_laptop *samsung;15461545 int ret;15461546+15471547+ if (efi_enabled(EFI_BOOT))15481548+ return -ENODEV;1547154915481550 quirks = &samsung_unknown;15491551 if (!force && !dmi_check_system(samsung_dmi_table))
···998998 return NULL;999999 }1000100010011001- ret = of_regulator_match(pdev->dev.parent, regulators, matches, count);10011001+ ret = of_regulator_match(&pdev->dev, regulators, matches, count);10021002 if (ret < 0) {10031003 dev_err(&pdev->dev, "Error parsing regulator init data: %d\n",10041004 ret);
+1-1
drivers/regulator/tps80031-regulator.c
···728728 }729729 }730730 rdev = regulator_register(&ri->rinfo->desc, &config);731731- if (IS_ERR_OR_NULL(rdev)) {731731+ if (IS_ERR(rdev)) {732732 dev_err(&pdev->dev,733733 "register regulator failed %s\n",734734 ri->rinfo->desc.name);
+3
drivers/rtc/rtc-isl1208.c
···506506{507507 unsigned long timeout = jiffies + msecs_to_jiffies(1000);508508 struct i2c_client *client = data;509509+ struct rtc_device *rtc = i2c_get_clientdata(client);509510 int handled = 0, sr, err;510511511512 /*···528527529528 if (sr & ISL1208_REG_SR_ALM) {530529 dev_dbg(&client->dev, "alarm!\n");530530+531531+ rtc_update_irq(rtc, 1, RTC_IRQF | RTC_AF);531532532533 /* Clear the alarm */533534 sr &= ~ISL1208_REG_SR_ALM;
+5-3
drivers/rtc/rtc-pl031.c
···4444#define RTC_YMR 0x34 /* Year match register */4545#define RTC_YLR 0x38 /* Year data load register */46464747+#define RTC_CR_EN (1 << 0) /* counter enable bit */4748#define RTC_CR_CWEN (1 << 26) /* Clockwatch enable bit */48494950#define RTC_TCR_EN (1 << 1) /* Periodic timer enable bit */···321320 struct pl031_local *ldata;322321 struct pl031_vendor_data *vendor = id->data;323322 struct rtc_class_ops *ops = &vendor->ops;324324- unsigned long time;323323+ unsigned long time, data;325324326325 ret = amba_request_regions(adev, NULL);327326 if (ret)···346345 dev_dbg(&adev->dev, "designer ID = 0x%02x\n", amba_manf(adev));347346 dev_dbg(&adev->dev, "revision = 0x%01x\n", amba_rev(adev));348347348348+ data = readl(ldata->base + RTC_CR);349349 /* Enable the clockwatch on ST Variants */350350 if (vendor->clockwatch)351351- writel(readl(ldata->base + RTC_CR) | RTC_CR_CWEN,352352- ldata->base + RTC_CR);351351+ data |= RTC_CR_CWEN;352352+ writel(data | RTC_CR_EN, ldata->base + RTC_CR);353353354354 /*355355 * On ST PL031 variants, the RTC reset value does not provide correct
···633633 return -ENOMEM;634634 pci_set_drvdata(pdev, pci_info);635635636636- if (efi_enabled)636636+ if (efi_enabled(EFI_RUNTIME_SERVICES))637637 orom = isci_get_efi_var(pdev);638638639639 if (!orom)
···443443444444void ssb_bus_unregister(struct ssb_bus *bus)445445{446446+ int err;447447+448448+ err = ssb_gpio_unregister(bus);449449+ if (err == -EBUSY)450450+ ssb_dprintk(KERN_ERR PFX "Some GPIOs are still in use.\n");451451+ else if (err)452452+ ssb_dprintk(KERN_ERR PFX453453+ "Can not unregister GPIO driver: %i\n", err);454454+446455 ssb_buses_lock();447456 ssb_devices_unregister(bus);448457 list_del(&bus->list);
+5
drivers/ssb/ssb_private.h
···267267268268#ifdef CONFIG_SSB_DRIVER_GPIO269269extern int ssb_gpio_init(struct ssb_bus *bus);270270+extern int ssb_gpio_unregister(struct ssb_bus *bus);270271#else /* CONFIG_SSB_DRIVER_GPIO */271272static inline int ssb_gpio_init(struct ssb_bus *bus)272273{273274 return -ENOTSUPP;275275+}276276+static inline int ssb_gpio_unregister(struct ssb_bus *bus)277277+{278278+ return 0;274279}275280#endif /* CONFIG_SSB_DRIVER_GPIO */276281
+7-1
drivers/target/target_core_device.c
···941941942942int se_dev_set_fabric_max_sectors(struct se_device *dev, u32 fabric_max_sectors)943943{944944+ int block_size = dev->dev_attrib.block_size;945945+944946 if (dev->export_count) {945947 pr_err("dev[%p]: Unable to change SE Device"946948 " fabric_max_sectors while export_count is %d\n",···980978 /*981979 * Align max_sectors down to PAGE_SIZE to follow transport_allocate_data_tasks()982980 */981981+ if (!block_size) {982982+ block_size = 512;983983+ pr_warn("Defaulting to 512 for zero block_size\n");984984+ }983985 fabric_max_sectors = se_dev_align_max_sectors(fabric_max_sectors,984984- dev->dev_attrib.block_size);986986+ block_size);985987986988 dev->dev_attrib.fabric_max_sectors = fabric_max_sectors;987989 pr_debug("dev[%p]: SE Device max_sectors changed to %u\n",
+5
drivers/target/target_core_fabric_configfs.c
···754754 return -EFAULT;755755 }756756757757+ if (!(dev->dev_flags & DF_CONFIGURED)) {758758+ pr_err("se_device not configured yet, cannot port link\n");759759+ return -ENODEV;760760+ }761761+757762 tpg_ci = &lun_ci->ci_parent->ci_group->cg_item;758763 se_tpg = container_of(to_config_group(tpg_ci),759764 struct se_portal_group, tpg_group);
···641641642642out:643643 rbuf = transport_kmap_data_sg(cmd);644644- if (!rbuf)645645- return TCM_LOGICAL_UNIT_COMMUNICATION_FAILURE;646646-647647- memcpy(rbuf, buf, min_t(u32, sizeof(buf), cmd->data_length));648648- transport_kunmap_data_sg(cmd);644644+ if (rbuf) {645645+ memcpy(rbuf, buf, min_t(u32, sizeof(buf), cmd->data_length));646646+ transport_kunmap_data_sg(cmd);647647+ }649648650649 if (!ret)651650 target_complete_cmd(cmd, GOOD);···850851{851852 struct se_device *dev = cmd->se_dev;852853 char *cdb = cmd->t_task_cdb;853853- unsigned char *buf, *map_buf;854854+ unsigned char buf[SE_MODE_PAGE_BUF], *rbuf;854855 int type = dev->transport->get_device_type(dev);855856 int ten = (cmd->t_task_cdb[0] == MODE_SENSE_10);856857 bool dbd = !!(cdb[1] & 0x08);···862863 int ret;863864 int i;864865865865- map_buf = transport_kmap_data_sg(cmd);866866- if (!map_buf)867867- return TCM_LOGICAL_UNIT_COMMUNICATION_FAILURE;868868- /*869869- * If SCF_PASSTHROUGH_SG_TO_MEM_NOALLOC is not set, then we870870- * know we actually allocated a full page. Otherwise, if the871871- * data buffer is too small, allocate a temporary buffer so we872872- * don't have to worry about overruns in all our INQUIRY873873- * emulation handling.874874- */875875- if (cmd->data_length < SE_MODE_PAGE_BUF &&876876- (cmd->se_cmd_flags & SCF_PASSTHROUGH_SG_TO_MEM_NOALLOC)) {877877- buf = kzalloc(SE_MODE_PAGE_BUF, GFP_KERNEL);878878- if (!buf) {879879- transport_kunmap_data_sg(cmd);880880- return TCM_LOGICAL_UNIT_COMMUNICATION_FAILURE;881881- }882882- } else {883883- buf = map_buf;884884- }866866+ memset(buf, 0, SE_MODE_PAGE_BUF);867867+885868 /*886869 * Skip over MODE DATA LENGTH + MEDIUM TYPE fields to byte 3 for887870 * MODE_SENSE_10 and byte 2 for MODE_SENSE (6).···915934 if (page == 0x3f) {916935 if (subpage != 0x00 && subpage != 0xff) {917936 pr_warn("MODE_SENSE: Invalid subpage code: 0x%02x\n", subpage);918918- kfree(buf);919919- transport_kunmap_data_sg(cmd);920937 return TCM_INVALID_CDB_FIELD;921938 }922939···951972 pr_err("MODE SENSE: unimplemented page/subpage: 0x%02x/0x%02x\n",952973 page, subpage);953974954954- transport_kunmap_data_sg(cmd);955975 return TCM_UNKNOWN_MODE_PAGE;956976957977set_length:···959981 else960982 buf[0] = length - 1;961983962962- if (buf != map_buf) {963963- memcpy(map_buf, buf, cmd->data_length);964964- kfree(buf);984984+ rbuf = transport_kmap_data_sg(cmd);985985+ if (rbuf) {986986+ memcpy(rbuf, buf, min_t(u32, SE_MODE_PAGE_BUF, cmd->data_length));987987+ transport_kunmap_data_sg(cmd);965988 }966989967967- transport_kunmap_data_sg(cmd);968990 target_complete_cmd(cmd, GOOD);969991 return 0;970992}
+44
drivers/usb/core/hcd.c
···3939#include <asm/unaligned.h>4040#include <linux/platform_device.h>4141#include <linux/workqueue.h>4242+#include <linux/pm_runtime.h>42434344#include <linux/usb.h>4445#include <linux/usb/hcd.h>···10261025 return retval;10271026}1028102710281028+/*10291029+ * usb_hcd_start_port_resume - a root-hub port is sending a resume signal10301030+ * @bus: the bus which the root hub belongs to10311031+ * @portnum: the port which is being resumed10321032+ *10331033+ * HCDs should call this function when they know that a resume signal is10341034+ * being sent to a root-hub port. The root hub will be prevented from10351035+ * going into autosuspend until usb_hcd_end_port_resume() is called.10361036+ *10371037+ * The bus's private lock must be held by the caller.10381038+ */10391039+void usb_hcd_start_port_resume(struct usb_bus *bus, int portnum)10401040+{10411041+ unsigned bit = 1 << portnum;10421042+10431043+ if (!(bus->resuming_ports & bit)) {10441044+ bus->resuming_ports |= bit;10451045+ pm_runtime_get_noresume(&bus->root_hub->dev);10461046+ }10471047+}10481048+EXPORT_SYMBOL_GPL(usb_hcd_start_port_resume);10491049+10501050+/*10511051+ * usb_hcd_end_port_resume - a root-hub port has stopped sending a resume signal10521052+ * @bus: the bus which the root hub belongs to10531053+ * @portnum: the port which is being resumed10541054+ *10551055+ * HCDs should call this function when they know that a resume signal has10561056+ * stopped being sent to a root-hub port. The root hub will be allowed to10571057+ * autosuspend again.10581058+ *10591059+ * The bus's private lock must be held by the caller.10601060+ */10611061+void usb_hcd_end_port_resume(struct usb_bus *bus, int portnum)10621062+{10631063+ unsigned bit = 1 << portnum;10641064+10651065+ if (bus->resuming_ports & bit) {10661066+ bus->resuming_ports &= ~bit;10671067+ pm_runtime_put_noidle(&bus->root_hub->dev);10681068+ }10691069+}10701070+EXPORT_SYMBOL_GPL(usb_hcd_end_port_resume);1029107110301072/*-------------------------------------------------------------------------*/10311073
+52-18
drivers/usb/core/hub.c
···28382838EXPORT_SYMBOL_GPL(usb_enable_ltm);2839283928402840#ifdef CONFIG_USB_SUSPEND28412841+/*28422842+ * usb_disable_function_remotewakeup - disable usb3.028432843+ * device's function remote wakeup28442844+ * @udev: target device28452845+ *28462846+ * Assume there's only one function on the USB 3.028472847+ * device and disable remote wake for the first28482848+ * interface. FIXME if the interface association28492849+ * descriptor shows there's more than one function.28502850+ */28512851+static int usb_disable_function_remotewakeup(struct usb_device *udev)28522852+{28532853+ return usb_control_msg(udev, usb_sndctrlpipe(udev, 0),28542854+ USB_REQ_CLEAR_FEATURE, USB_RECIP_INTERFACE,28552855+ USB_INTRF_FUNC_SUSPEND, 0, NULL, 0,28562856+ USB_CTRL_SET_TIMEOUT);28572857+}2841285828422859/*28432860 * usb_port_suspend - suspend a usb device's upstream port···29722955 dev_dbg(hub->intfdev, "can't suspend port %d, status %d\n",29732956 port1, status);29742957 /* paranoia: "should not happen" */29752975- if (udev->do_remote_wakeup)29762976- (void) usb_control_msg(udev, usb_sndctrlpipe(udev, 0),29772977- USB_REQ_CLEAR_FEATURE, USB_RECIP_DEVICE,29782978- USB_DEVICE_REMOTE_WAKEUP, 0,29792979- NULL, 0,29802980- USB_CTRL_SET_TIMEOUT);29582958+ if (udev->do_remote_wakeup) {29592959+ if (!hub_is_superspeed(hub->hdev)) {29602960+ (void) usb_control_msg(udev,29612961+ usb_sndctrlpipe(udev, 0),29622962+ USB_REQ_CLEAR_FEATURE,29632963+ USB_RECIP_DEVICE,29642964+ USB_DEVICE_REMOTE_WAKEUP, 0,29652965+ NULL, 0,29662966+ USB_CTRL_SET_TIMEOUT);29672967+ } else29682968+ (void) usb_disable_function_remotewakeup(udev);29692969+29702970+ }2981297129822972 /* Try to enable USB2 hardware LPM again */29832973 if (udev->usb2_hw_lpm_capable == 1)···30763052 * udev->reset_resume30773053 */30783054 } else if (udev->actconfig && !udev->reset_resume) {30793079- le16_to_cpus(&devstatus);30803080- if (devstatus & (1 << USB_DEVICE_REMOTE_WAKEUP)) {30813081- status = usb_control_msg(udev,30823082- usb_sndctrlpipe(udev, 0),30833083- USB_REQ_CLEAR_FEATURE,30553055+ if (!hub_is_superspeed(udev->parent)) {30563056+ le16_to_cpus(&devstatus);30573057+ if (devstatus & (1 << USB_DEVICE_REMOTE_WAKEUP))30583058+ status = usb_control_msg(udev,30593059+ usb_sndctrlpipe(udev, 0),30603060+ USB_REQ_CLEAR_FEATURE,30843061 USB_RECIP_DEVICE,30853085- USB_DEVICE_REMOTE_WAKEUP, 0,30863086- NULL, 0,30873087- USB_CTRL_SET_TIMEOUT);30883088- if (status)30893089- dev_dbg(&udev->dev,30903090- "disable remote wakeup, status %d\n",30913091- status);30623062+ USB_DEVICE_REMOTE_WAKEUP, 0,30633063+ NULL, 0,30643064+ USB_CTRL_SET_TIMEOUT);30653065+ } else {30663066+ status = usb_get_status(udev, USB_RECIP_INTERFACE, 0,30673067+ &devstatus);30683068+ le16_to_cpus(&devstatus);30693069+ if (!status && devstatus & (USB_INTRF_STAT_FUNC_RW_CAP30703070+ | USB_INTRF_STAT_FUNC_RW))30713071+ status =30723072+ usb_disable_function_remotewakeup(udev);30923073 }30743074+30753075+ if (status)30763076+ dev_dbg(&udev->dev,30773077+ "disable remote wakeup, status %d\n",30783078+ status);30933079 status = 0;30943080 }30953081 return status;
···649649 status = STS_PCD;650650 }651651 }652652- /* FIXME autosuspend idle root hubs */652652+653653+ /* If a resume is in progress, make sure it can finish */654654+ if (ehci->resuming_ports)655655+ mod_timer(&hcd->rh_timer, jiffies + msecs_to_jiffies(25));656656+653657 spin_unlock_irqrestore (&ehci->lock, flags);654658 return status ? retval : 0;655659}···855851 /* resume signaling for 20 msec */856852 ehci->reset_done[wIndex] = jiffies857853 + msecs_to_jiffies(20);854854+ usb_hcd_start_port_resume(&hcd->self, wIndex);858855 /* check the port again */859856 mod_timer(&ehci_to_hcd(ehci)->rh_timer,860857 ehci->reset_done[wIndex]);···867862 clear_bit(wIndex, &ehci->suspended_ports);868863 set_bit(wIndex, &ehci->port_c_suspend);869864 ehci->reset_done[wIndex] = 0;865865+ usb_hcd_end_port_resume(&hcd->self, wIndex);870866871867 /* stop resume signaling */872868 temp = ehci_readl(ehci, status_reg);···956950 ehci->reset_done[wIndex] = 0;957951 if (temp & PORT_PE)958952 set_bit(wIndex, &ehci->port_c_suspend);953953+ usb_hcd_end_port_resume(&hcd->self, wIndex);959954 }960955961956 if (temp & PORT_OC)
+30-20
drivers/usb/host/ehci-q.c
···11971197 if (ehci->async_iaa || ehci->async_unlinking)11981198 return;1199119912001200- /* Do all the waiting QHs at once */12011201- ehci->async_iaa = ehci->async_unlink;12021202- ehci->async_unlink = NULL;12031203-12041200 /* If the controller isn't running, we don't have to wait for it */12051201 if (unlikely(ehci->rh_state < EHCI_RH_RUNNING)) {12021202+12031203+ /* Do all the waiting QHs */12041204+ ehci->async_iaa = ehci->async_unlink;12051205+ ehci->async_unlink = NULL;12061206+12061207 if (!nested) /* Avoid recursion */12071208 end_unlink_async(ehci);1208120912091210 /* Otherwise start a new IAA cycle */12101211 } else if (likely(ehci->rh_state == EHCI_RH_RUNNING)) {12121212+ struct ehci_qh *qh;12131213+12141214+ /* Do only the first waiting QH (nVidia bug?) */12151215+ qh = ehci->async_unlink;12161216+ ehci->async_iaa = qh;12171217+ ehci->async_unlink = qh->unlink_next;12181218+ qh->unlink_next = NULL;12191219+12111220 /* Make sure the unlinks are all visible to the hardware */12121221 wmb();12131222···12641255 }12651256}1266125712581258+static void start_unlink_async(struct ehci_hcd *ehci, struct ehci_qh *qh);12591259+12671260static void unlink_empty_async(struct ehci_hcd *ehci)12681261{12691269- struct ehci_qh *qh, *next;12701270- bool stopped = (ehci->rh_state < EHCI_RH_RUNNING);12621262+ struct ehci_qh *qh;12631263+ struct ehci_qh *qh_to_unlink = NULL;12711264 bool check_unlinks_later = false;12651265+ int count = 0;1272126612731273- /* Unlink all the async QHs that have been empty for a timer cycle */12741274- next = ehci->async->qh_next.qh;12751275- while (next) {12761276- qh = next;12771277- next = qh->qh_next.qh;12781278-12671267+ /* Find the last async QH which has been empty for a timer cycle */12681268+ for (qh = ehci->async->qh_next.qh; qh; qh = qh->qh_next.qh) {12791269 if (list_empty(&qh->qtd_list) &&12801270 qh->qh_state == QH_STATE_LINKED) {12811281- if (!stopped && qh->unlink_cycle ==12821282- ehci->async_unlink_cycle)12711271+ ++count;12721272+ if (qh->unlink_cycle == ehci->async_unlink_cycle)12831273 check_unlinks_later = true;12841274 else12851285- single_unlink_async(ehci, qh);12751275+ qh_to_unlink = qh;12861276 }12871277 }1288127812891289- /* Start a new IAA cycle if any QHs are waiting for it */12901290- if (ehci->async_unlink)12911291- start_iaa_cycle(ehci, false);12791279+ /* If nothing else is being unlinked, unlink the last empty QH */12801280+ if (!ehci->async_iaa && !ehci->async_unlink && qh_to_unlink) {12811281+ start_unlink_async(ehci, qh_to_unlink);12821282+ --count;12831283+ }1292128412931293- /* QHs that haven't been empty for long enough will be handled later */12941294- if (check_unlinks_later) {12851285+ /* Other QHs will be handled later */12861286+ if (count > 0) {12951287 ehci_enable_event(ehci, EHCI_HRTIMER_ASYNC_UNLINKS, true);12961288 ++ehci->async_unlink_cycle;12971289 }
+6-3
drivers/usb/host/ehci-sched.c
···213213}214214215215static const unsigned char216216-max_tt_usecs[] = { 125, 125, 125, 125, 125, 125, 30, 0 };216216+max_tt_usecs[] = { 125, 125, 125, 125, 125, 125, 125, 25 };217217218218/* carryover low/fullspeed bandwidth that crosses uframe boundries */219219static inline void carryover_tt_bandwidth(unsigned short tt_usecs[8])···22122212 }22132213 ehci->now_frame = now_frame;2214221422152215+ frame = ehci->last_iso_frame;22152216 for (;;) {22162217 union ehci_shadow q, *q_p;22172218 __hc32 type, *hw_p;2218221922192219- frame = ehci->last_iso_frame;22202220restart:22212221 /* scan each element in frame's queue for completions */22222222 q_p = &ehci->pshadow [frame];···23212321 /* Stop when we have reached the current frame */23222322 if (frame == now_frame)23232323 break;23242324- ehci->last_iso_frame = (frame + 1) & fmask;23242324+23252325+ /* The last frame may still have active siTDs */23262326+ ehci->last_iso_frame = frame;23272327+ frame = (frame + 1) & fmask;23252328 }23262329}
+15-14
drivers/usb/host/ehci-timer.c
···113113114114 if (want != actual) {115115116116- /* Poll again later, but give up after about 20 ms */117117- if (ehci->ASS_poll_count++ < 20) {118118- ehci_enable_event(ehci, EHCI_HRTIMER_POLL_ASS, true);119119- return;120120- }121121- ehci_dbg(ehci, "Waited too long for the async schedule status (%x/%x), giving up\n",122122- want, actual);116116+ /* Poll again later */117117+ ehci_enable_event(ehci, EHCI_HRTIMER_POLL_ASS, true);118118+ ++ehci->ASS_poll_count;119119+ return;123120 }121121+122122+ if (ehci->ASS_poll_count > 20)123123+ ehci_dbg(ehci, "ASS poll count reached %d\n",124124+ ehci->ASS_poll_count);124125 ehci->ASS_poll_count = 0;125126126127 /* The status is up-to-date; restart or stop the schedule as needed */···160159161160 if (want != actual) {162161163163- /* Poll again later, but give up after about 20 ms */164164- if (ehci->PSS_poll_count++ < 20) {165165- ehci_enable_event(ehci, EHCI_HRTIMER_POLL_PSS, true);166166- return;167167- }168168- ehci_dbg(ehci, "Waited too long for the periodic schedule status (%x/%x), giving up\n",169169- want, actual);162162+ /* Poll again later */163163+ ehci_enable_event(ehci, EHCI_HRTIMER_POLL_PSS, true);164164+ return;170165 }166166+167167+ if (ehci->PSS_poll_count > 20)168168+ ehci_dbg(ehci, "PSS poll count reached %d\n",169169+ ehci->PSS_poll_count);171170 ehci->PSS_poll_count = 0;172171173172 /* The status is up-to-date; restart or stop the schedule as needed */
+1
drivers/usb/host/pci-quirks.c
···780780 "defaulting to EHCI.\n");781781 dev_warn(&xhci_pdev->dev,782782 "USB 3.0 devices will work at USB 2.0 speeds.\n");783783+ usb_disable_xhci_ports(xhci_pdev);783784 return;784785 }785786
+3
drivers/usb/host/uhci-hub.c
···116116 }117117 }118118 clear_bit(port, &uhci->resuming_ports);119119+ usb_hcd_end_port_resume(&uhci_to_hcd(uhci)->self, port);119120}120121121122/* Wait for the UHCI controller in HP's iLO2 server management chip.···168167 set_bit(port, &uhci->resuming_ports);169168 uhci->ports_timeout = jiffies +170169 msecs_to_jiffies(25);170170+ usb_hcd_start_port_resume(171171+ &uhci_to_hcd(uhci)->self, port);171172172173 /* Make sure we see the port again173174 * after the resuming period is over. */
+9-4
drivers/usb/host/xhci-ring.c
···16981698 faked_port_index + 1);16991699 if (slot_id && xhci->devs[slot_id])17001700 xhci_ring_device(xhci, slot_id);17011701- if (bus_state->port_remote_wakeup && (1 << faked_port_index)) {17011701+ if (bus_state->port_remote_wakeup & (1 << faked_port_index)) {17021702 bus_state->port_remote_wakeup &=17031703 ~(1 << faked_port_index);17041704 xhci_test_and_clear_bit(xhci, port_array,···25892589 (trb_comp_code != COMP_STALL &&25902590 trb_comp_code != COMP_BABBLE))25912591 xhci_urb_free_priv(xhci, urb_priv);25922592+ else25932593+ kfree(urb_priv);2592259425932595 usb_hcd_unlink_urb_from_ep(bus_to_hcd(urb->dev->bus), urb);25942596 if ((urb->actual_length != urb->transfer_buffer_length &&···31103108 * running_total.31113109 */31123110 packets_transferred = (running_total + trb_buff_len) /31133113- usb_endpoint_maxp(&urb->ep->desc);31113111+ GET_MAX_PACKET(usb_endpoint_maxp(&urb->ep->desc));3114311231153113 if ((total_packet_count - packets_transferred) > 31)31163114 return 31 << 17;···36443642 td_len = urb->iso_frame_desc[i].length;36453643 td_remain_len = td_len;36463644 total_packet_count = DIV_ROUND_UP(td_len,36473647- usb_endpoint_maxp(&urb->ep->desc));36453645+ GET_MAX_PACKET(36463646+ usb_endpoint_maxp(&urb->ep->desc)));36483647 /* A zero-length transfer still involves at least one packet. */36493648 if (total_packet_count == 0)36503649 total_packet_count++;···36673664 td = urb_priv->td[i];36683665 for (j = 0; j < trbs_per_td; j++) {36693666 u32 remainder = 0;36703670- field = TRB_TBC(burst_count) | TRB_TLBPC(residue);36673667+ field = 0;3671366836723669 if (first_trb) {36703670+ field = TRB_TBC(burst_count) |36713671+ TRB_TLBPC(residue);36733672 /* Queue the isoc TRB */36743673 field |= TRB_TYPE(TRB_ISOC);36753674 /* Assume URB_ISO_ASAP is set */
···147147#define XSENS_CONVERTER_6_PID 0xD38E148148#define XSENS_CONVERTER_7_PID 0xD38F149149150150+/**151151+ * Zolix (www.zolix.com.cb) product ids152152+ */153153+#define FTDI_OMNI1509 0xD491 /* Omni1509 embedded USB-serial */154154+150155/*151156 * NDI (www.ndigital.com) product ids152157 */···209204210205/*211206 * ELV USB devices submitted by Christian Abt of ELV (www.elv.de).212212- * All of these devices use FTDI's vendor ID (0x0403).207207+ * Almost all of these devices use FTDI's vendor ID (0x0403).213208 * Further IDs taken from ELV Windows .inf file.214209 *215210 * The previously included PID for the UO 100 module was incorrect.···217212 *218213 * Armin Laeuger originally sent the PID for the UM 100 module.219214 */215215+#define FTDI_ELV_VID 0x1B1F /* ELV AG */216216+#define FTDI_ELV_WS300_PID 0xC006 /* eQ3 WS 300 PC II */220217#define FTDI_ELV_USR_PID 0xE000 /* ELV Universal-Sound-Recorder */221218#define FTDI_ELV_MSM1_PID 0xE001 /* ELV Mini-Sound-Modul */222219#define FTDI_ELV_KL100_PID 0xE002 /* ELV Kfz-Leistungsmesser KL 100 */
···9292 return 0;9393}94949595-/* This places the HUAWEI E220 devices in multi-port mode */9696-int usb_stor_huawei_e220_init(struct us_data *us)9595+/* This places the HUAWEI usb dongles in multi-port mode */9696+static int usb_stor_huawei_feature_init(struct us_data *us)9797{9898 int result;9999···103103 0x01, 0x0, NULL, 0x0, 1000);104104 US_DEBUGP("Huawei mode set result is %d\n", result);105105 return 0;106106+}107107+108108+/*109109+ * It will send a scsi switch command called rewind' to huawei dongle.110110+ * When the dongle receives this command at the first time,111111+ * it will reboot immediately. After rebooted, it will ignore this command.112112+ * So it is unnecessary to read its response.113113+ */114114+static int usb_stor_huawei_scsi_init(struct us_data *us)115115+{116116+ int result = 0;117117+ int act_len = 0;118118+ struct bulk_cb_wrap *bcbw = (struct bulk_cb_wrap *) us->iobuf;119119+ char rewind_cmd[] = {0x11, 0x06, 0x20, 0x00, 0x00, 0x01, 0x01, 0x00,120120+ 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};121121+122122+ bcbw->Signature = cpu_to_le32(US_BULK_CB_SIGN);123123+ bcbw->Tag = 0;124124+ bcbw->DataTransferLength = 0;125125+ bcbw->Flags = bcbw->Lun = 0;126126+ bcbw->Length = sizeof(rewind_cmd);127127+ memset(bcbw->CDB, 0, sizeof(bcbw->CDB));128128+ memcpy(bcbw->CDB, rewind_cmd, sizeof(rewind_cmd));129129+130130+ result = usb_stor_bulk_transfer_buf(us, us->send_bulk_pipe, bcbw,131131+ US_BULK_CB_WRAP_LEN, &act_len);132132+ US_DEBUGP("transfer actual length=%d, result=%d\n", act_len, result);133133+ return result;134134+}135135+136136+/*137137+ * It tries to find the supported Huawei USB dongles.138138+ * In Huawei, they assign the following product IDs139139+ * for all of their mobile broadband dongles,140140+ * including the new dongles in the future.141141+ * So if the product ID is not included in this list,142142+ * it means it is not Huawei's mobile broadband dongles.143143+ */144144+static int usb_stor_huawei_dongles_pid(struct us_data *us)145145+{146146+ struct usb_interface_descriptor *idesc;147147+ int idProduct;148148+149149+ idesc = &us->pusb_intf->cur_altsetting->desc;150150+ idProduct = us->pusb_dev->descriptor.idProduct;151151+ /* The first port is CDROM,152152+ * means the dongle in the single port mode,153153+ * and a switch command is required to be sent. */154154+ if (idesc && idesc->bInterfaceNumber == 0) {155155+ if ((idProduct == 0x1001)156156+ || (idProduct == 0x1003)157157+ || (idProduct == 0x1004)158158+ || (idProduct >= 0x1401 && idProduct <= 0x1500)159159+ || (idProduct >= 0x1505 && idProduct <= 0x1600)160160+ || (idProduct >= 0x1c02 && idProduct <= 0x2202)) {161161+ return 1;162162+ }163163+ }164164+ return 0;165165+}166166+167167+int usb_stor_huawei_init(struct us_data *us)168168+{169169+ int result = 0;170170+171171+ if (usb_stor_huawei_dongles_pid(us)) {172172+ if (us->pusb_dev->descriptor.idProduct >= 0x1446)173173+ result = usb_stor_huawei_scsi_init(us);174174+ else175175+ result = usb_stor_huawei_feature_init(us);176176+ }177177+ return result;106178}
+2-2
drivers/usb/storage/initializers.h
···4646 * flash reader */4747int usb_stor_ucr61s2b_init(struct us_data *us);48484949-/* This places the HUAWEI E220 devices in multi-port mode */5050-int usb_stor_huawei_e220_init(struct us_data *us);4949+/* This places the HUAWEI usb dongles in multi-port mode */5050+int usb_stor_huawei_init(struct us_data *us);
···4141#define USUAL_DEV(useProto, useTrans) \4242{ USB_INTERFACE_INFO(USB_CLASS_MASS_STORAGE, useProto, useTrans) }43434444+/* Define the device is matched with Vendor ID and interface descriptors */4545+#define UNUSUAL_VENDOR_INTF(id_vendor, cl, sc, pr, \4646+ vendorName, productName, useProtocol, useTransport, \4747+ initFunction, flags) \4848+{ \4949+ .match_flags = USB_DEVICE_ID_MATCH_INT_INFO \5050+ | USB_DEVICE_ID_MATCH_VENDOR, \5151+ .idVendor = (id_vendor), \5252+ .bInterfaceClass = (cl), \5353+ .bInterfaceSubClass = (sc), \5454+ .bInterfaceProtocol = (pr), \5555+ .driver_info = (flags) \5656+}5757+4458struct usb_device_id usb_storage_usb_ids[] = {4559# include "unusual_devs.h"4660 { } /* Terminating entry */···6450#undef UNUSUAL_DEV6551#undef COMPLIANT_DEV6652#undef USUAL_DEV5353+#undef UNUSUAL_VENDOR_INTF67546855/*6956 * The table of devices to ignore
+1-3
drivers/vhost/tcm_vhost.c
···575575576576 /* Must use ioctl VHOST_SCSI_SET_ENDPOINT */577577 tv_tpg = vs->vs_tpg;578578- if (unlikely(!tv_tpg)) {579579- pr_err("%s endpoint not set\n", __func__);578578+ if (unlikely(!tv_tpg))580579 return;581581- }582580583581 mutex_lock(&vq->mutex);584582 vhost_disable_notify(&vs->dev, vq);
+2-2
drivers/xen/events.c
···840840841841 if (irq == -1) {842842 irq = xen_allocate_irq_dynamic();843843- if (irq == -1)843843+ if (irq < 0)844844 goto out;845845846846 irq_set_chip_and_handler_name(irq, &xen_dynamic_chip,···944944945945 if (irq == -1) {946946 irq = xen_allocate_irq_dynamic();947947- if (irq == -1)947947+ if (irq < 0)948948 goto out;949949950950 irq_set_chip_and_handler_name(irq, &xen_percpu_chip,
+7-7
drivers/xen/xen-pciback/pciback_ops.c
···135135 struct pci_dev *dev, struct xen_pci_op *op)136136{137137 struct xen_pcibk_dev_data *dev_data;138138- int otherend = pdev->xdev->otherend_id;139138 int status;140139141140 if (unlikely(verbose_request))···143144 status = pci_enable_msi(dev);144145145146 if (status) {146146- printk(KERN_ERR "error enable msi for guest %x status %x\n",147147- otherend, status);147147+ pr_warn_ratelimited(DRV_NAME ": %s: error enabling MSI for guest %u: err %d\n",148148+ pci_name(dev), pdev->xdev->otherend_id,149149+ status);148150 op->value = 0;149151 return XEN_PCI_ERR_op_failed;150152 }···223223 pci_name(dev), i,224224 op->msix_entries[i].vector);225225 }226226- } else {227227- printk(KERN_WARNING DRV_NAME ": %s: failed to enable MSI-X: err %d!\n",228228- pci_name(dev), result);229229- }226226+ } else227227+ pr_warn_ratelimited(DRV_NAME ": %s: error enabling MSI-X for guest %u: err %d!\n",228228+ pci_name(dev), pdev->xdev->otherend_id,229229+ result);230230 kfree(entries);231231232232 op->value = result;
+10-12
fs/btrfs/extent-tree.c
···45344534 unsigned nr_extents = 0;45354535 int extra_reserve = 0;45364536 enum btrfs_reserve_flush_enum flush = BTRFS_RESERVE_FLUSH_ALL;45374537- int ret;45374537+ int ret = 0;45384538 bool delalloc_lock = true;4539453945404540 /* If we are a free space inode we need to not flush since we will be in···45794579 csum_bytes = BTRFS_I(inode)->csum_bytes;45804580 spin_unlock(&BTRFS_I(inode)->lock);4581458145824582- if (root->fs_info->quota_enabled) {45824582+ if (root->fs_info->quota_enabled)45834583 ret = btrfs_qgroup_reserve(root, num_bytes +45844584 nr_extents * root->leafsize);45854585- if (ret) {45864586- spin_lock(&BTRFS_I(inode)->lock);45874587- calc_csum_metadata_size(inode, num_bytes, 0);45884588- spin_unlock(&BTRFS_I(inode)->lock);45894589- if (delalloc_lock)45904590- mutex_unlock(&BTRFS_I(inode)->delalloc_mutex);45914591- return ret;45924592- }45934593- }4594458545954595- ret = reserve_metadata_bytes(root, block_rsv, to_reserve, flush);45864586+ /*45874587+ * ret != 0 here means the qgroup reservation failed, we go straight to45884588+ * the shared error handling then.45894589+ */45904590+ if (ret == 0)45914591+ ret = reserve_metadata_bytes(root, block_rsv,45924592+ to_reserve, flush);45934593+45964594 if (ret) {45974595 u64 to_free = 0;45984596 unsigned dropped;
···293293 struct btrfs_key key;294294 struct btrfs_ioctl_defrag_range_args range;295295 int num_defrag;296296+ int index;297297+ int ret;296298297299 /* get the inode */298300 key.objectid = defrag->root;299301 btrfs_set_key_type(&key, BTRFS_ROOT_ITEM_KEY);300302 key.offset = (u64)-1;303303+304304+ index = srcu_read_lock(&fs_info->subvol_srcu);305305+301306 inode_root = btrfs_read_fs_root_no_name(fs_info, &key);302307 if (IS_ERR(inode_root)) {303303- kmem_cache_free(btrfs_inode_defrag_cachep, defrag);304304- return PTR_ERR(inode_root);308308+ ret = PTR_ERR(inode_root);309309+ goto cleanup;310310+ }311311+ if (btrfs_root_refs(&inode_root->root_item) == 0) {312312+ ret = -ENOENT;313313+ goto cleanup;305314 }306315307316 key.objectid = defrag->ino;···318309 key.offset = 0;319310 inode = btrfs_iget(fs_info->sb, &key, inode_root, NULL);320311 if (IS_ERR(inode)) {321321- kmem_cache_free(btrfs_inode_defrag_cachep, defrag);322322- return PTR_ERR(inode);312312+ ret = PTR_ERR(inode);313313+ goto cleanup;323314 }315315+ srcu_read_unlock(&fs_info->subvol_srcu, index);324316325317 /* do a chunk of defrag */326318 clear_bit(BTRFS_INODE_IN_DEFRAG, &BTRFS_I(inode)->runtime_flags);···356346357347 iput(inode);358348 return 0;349349+cleanup:350350+ srcu_read_unlock(&fs_info->subvol_srcu, index);351351+ kmem_cache_free(btrfs_inode_defrag_cachep, defrag);352352+ return ret;359353}360354361355/*···16081594 if (err < 0 && num_written > 0)16091595 num_written = err;16101596 }16111611-out:15971597+16121598 if (sync)16131599 atomic_dec(&BTRFS_I(inode)->sync_writers);16001600+out:16141601 sb_end_write(inode->i_sb);16151602 current->backing_dev_info = NULL;16161603 return num_written ? num_written : err;
+4-1
fs/btrfs/ioctl.c
···515515516516 BUG_ON(ret);517517518518- d_instantiate(dentry, btrfs_lookup_dentry(dir, dentry));519518fail:520519 if (async_transid) {521520 *async_transid = trans->transid;···524525 }525526 if (err && !ret)526527 ret = err;528528+529529+ if (!ret)530530+ d_instantiate(dentry, btrfs_lookup_dentry(dir, dentry));531531+527532 return ret;528533}529534
+10-3
fs/btrfs/ordered-data.c
···836836 * if the disk i_size is already at the inode->i_size, or837837 * this ordered extent is inside the disk i_size, we're done838838 */839839- if (disk_i_size == i_size || offset <= disk_i_size) {839839+ if (disk_i_size == i_size)840840 goto out;841841- }841841+842842+ /*843843+ * We still need to update disk_i_size if outstanding_isize is greater844844+ * than disk_i_size.845845+ */846846+ if (offset <= disk_i_size &&847847+ (!ordered || ordered->outstanding_isize <= disk_i_size))848848+ goto out;842849843850 /*844851 * walk backward from this ordered extent to disk_i_size.···877870 break;878871 if (test->file_offset >= i_size)879872 break;880880- if (test->file_offset >= disk_i_size) {873873+ if (entry_end(test) > disk_i_size) {881874 /*882875 * we don't update disk_i_size now, so record this883876 * undealt i_size. Or we will not know the real
+20-5
fs/btrfs/scrub.c
···580580 int corrected = 0;581581 struct btrfs_key key;582582 struct inode *inode = NULL;583583+ struct btrfs_fs_info *fs_info;583584 u64 end = offset + PAGE_SIZE - 1;584585 struct btrfs_root *local_root;586586+ int srcu_index;585587586588 key.objectid = root;587589 key.type = BTRFS_ROOT_ITEM_KEY;588590 key.offset = (u64)-1;589589- local_root = btrfs_read_fs_root_no_name(fixup->root->fs_info, &key);590590- if (IS_ERR(local_root))591591+592592+ fs_info = fixup->root->fs_info;593593+ srcu_index = srcu_read_lock(&fs_info->subvol_srcu);594594+595595+ local_root = btrfs_read_fs_root_no_name(fs_info, &key);596596+ if (IS_ERR(local_root)) {597597+ srcu_read_unlock(&fs_info->subvol_srcu, srcu_index);591598 return PTR_ERR(local_root);599599+ }592600593601 key.type = BTRFS_INODE_ITEM_KEY;594602 key.objectid = inum;595603 key.offset = 0;596596- inode = btrfs_iget(fixup->root->fs_info->sb, &key, local_root, NULL);604604+ inode = btrfs_iget(fs_info->sb, &key, local_root, NULL);605605+ srcu_read_unlock(&fs_info->subvol_srcu, srcu_index);597606 if (IS_ERR(inode))598607 return PTR_ERR(inode);599608···615606 }616607617608 if (PageUptodate(page)) {618618- struct btrfs_fs_info *fs_info;619609 if (PageDirty(page)) {620610 /*621611 * we need to write the data to the defect sector. the···31883180 u64 physical_for_dev_replace;31893181 u64 len;31903182 struct btrfs_fs_info *fs_info = nocow_ctx->sctx->dev_root->fs_info;31833183+ int srcu_index;3191318431923185 key.objectid = root;31933186 key.type = BTRFS_ROOT_ITEM_KEY;31943187 key.offset = (u64)-1;31883188+31893189+ srcu_index = srcu_read_lock(&fs_info->subvol_srcu);31903190+31953191 local_root = btrfs_read_fs_root_no_name(fs_info, &key);31963196- if (IS_ERR(local_root))31923192+ if (IS_ERR(local_root)) {31933193+ srcu_read_unlock(&fs_info->subvol_srcu, srcu_index);31973194 return PTR_ERR(local_root);31953195+ }3198319631993197 key.type = BTRFS_INODE_ITEM_KEY;32003198 key.objectid = inum;32013199 key.offset = 0;32023200 inode = btrfs_iget(fs_info->sb, &key, local_root, NULL);32013201+ srcu_read_unlock(&fs_info->subvol_srcu, srcu_index);32033202 if (IS_ERR(inode))32043203 return PTR_ERR(inode);32053204
+19-8
fs/btrfs/transaction.c
···333333 &root->fs_info->trans_block_rsv,334334 num_bytes, flush);335335 if (ret)336336- return ERR_PTR(ret);336336+ goto reserve_fail;337337 }338338again:339339 h = kmem_cache_alloc(btrfs_trans_handle_cachep, GFP_NOFS);340340- if (!h)341341- return ERR_PTR(-ENOMEM);340340+ if (!h) {341341+ ret = -ENOMEM;342342+ goto alloc_fail;343343+ }342344343345 /*344346 * If we are JOIN_NOLOCK we're already committing a transaction and···367365 if (ret < 0) {368366 /* We must get the transaction if we are JOIN_NOLOCK. */369367 BUG_ON(type == TRANS_JOIN_NOLOCK);370370-371371- if (type < TRANS_JOIN_NOLOCK)372372- sb_end_intwrite(root->fs_info->sb);373373- kmem_cache_free(btrfs_trans_handle_cachep, h);374374- return ERR_PTR(ret);368368+ goto join_fail;375369 }376370377371 cur_trans = root->fs_info->running_transaction;···408410 if (!current->journal_info && type != TRANS_USERSPACE)409411 current->journal_info = h;410412 return h;413413+414414+join_fail:415415+ if (type < TRANS_JOIN_NOLOCK)416416+ sb_end_intwrite(root->fs_info->sb);417417+ kmem_cache_free(btrfs_trans_handle_cachep, h);418418+alloc_fail:419419+ if (num_bytes)420420+ btrfs_block_rsv_release(root, &root->fs_info->trans_block_rsv,421421+ num_bytes);422422+reserve_fail:423423+ if (qgroup_reserved)424424+ btrfs_qgroup_free(root, qgroup_reserved);425425+ return ERR_PTR(ret);411426}412427413428struct btrfs_trans_handle *btrfs_start_transaction(struct btrfs_root *root,
+2-1
fs/btrfs/volumes.c
···15561556 ret = 0;1557155715581558 /* Notify udev that device has changed */15591559- btrfs_kobject_uevent(bdev, KOBJ_CHANGE);15591559+ if (bdev)15601560+ btrfs_kobject_uevent(bdev, KOBJ_CHANGE);1560156115611562error_brelse:15621563 brelse(bh);
+4-4
fs/dlm/user.c
···503503#endif504504 return -EINVAL;505505506506-#ifdef CONFIG_COMPAT507507- if (count > sizeof(struct dlm_write_request32) + DLM_RESNAME_MAXLEN)508508-#else506506+ /*507507+ * can't compare against COMPAT/dlm_write_request32 because508508+ * we don't yet know if is64bit is zero509509+ */509510 if (count > sizeof(struct dlm_write_request) + DLM_RESNAME_MAXLEN)510510-#endif511511 return -EINVAL;512512513513 kbuf = kzalloc(count + 1, GFP_NOFS);
···236236 error = nfs4_discover_server_trunking(clp, &old);237237 if (error < 0)238238 goto error;239239+ nfs_put_client(clp);239240 if (clp != old) {240241 clp->cl_preserve_clid = true;241241- nfs_put_client(clp);242242 clp = old;243243- atomic_inc(&clp->cl_count);244243 }245244246245 return clp;···305306 .clientid = new->cl_clientid,306307 .confirm = new->cl_confirm,307308 };308308- int status;309309+ int status = -NFS4ERR_STALE_CLIENTID;309310310311 spin_lock(&nn->nfs_client_lock);311312 list_for_each_entry_safe(pos, n, &nn->nfs_client_list, cl_share_link) {···331332332333 if (prev)333334 nfs_put_client(prev);335335+ prev = pos;334336335337 status = nfs4_proc_setclientid_confirm(pos, &clid, cred);336336- if (status == 0) {338338+ switch (status) {339339+ case -NFS4ERR_STALE_CLIENTID:340340+ break;341341+ case 0:337342 nfs4_swap_callback_idents(pos, new);338343339339- nfs_put_client(pos);344344+ prev = NULL;340345 *result = pos;341346 dprintk("NFS: <-- %s using nfs_client = %p ({%d})\n",342347 __func__, pos, atomic_read(&pos->cl_count));343343- return 0;344344- }345345- if (status != -NFS4ERR_STALE_CLIENTID) {346346- nfs_put_client(pos);347347- dprintk("NFS: <-- %s status = %d, no result\n",348348- __func__, status);349349- return status;348348+ default:349349+ goto out;350350 }351351352352 spin_lock(&nn->nfs_client_lock);353353- prev = pos;354353 }354354+ spin_unlock(&nn->nfs_client_lock);355355356356- /*357357- * No matching nfs_client found. This should be impossible,358358- * because the new nfs_client has already been added to359359- * nfs_client_list by nfs_get_client().360360- *361361- * Don't BUG(), since the caller is holding a mutex.362362- */356356+ /* No match found. The server lost our clientid */357357+out:363358 if (prev)364359 nfs_put_client(prev);365365- spin_unlock(&nn->nfs_client_lock);366366- pr_err("NFS: %s Error: no matching nfs_client found\n", __func__);367367- return -NFS4ERR_STALE_CLIENTID;360360+ dprintk("NFS: <-- %s status = %d\n", __func__, status);361361+ return status;368362}369363370364#ifdef CONFIG_NFS_V4_1···424432{425433 struct nfs_net *nn = net_generic(new->cl_net, nfs_net_id);426434 struct nfs_client *pos, *n, *prev = NULL;427427- int error;435435+ int status = -NFS4ERR_STALE_CLIENTID;428436429437 spin_lock(&nn->nfs_client_lock);430438 list_for_each_entry_safe(pos, n, &nn->nfs_client_list, cl_share_link) {···440448 nfs_put_client(prev);441449 prev = pos;442450443443- error = nfs_wait_client_init_complete(pos);444444- if (error < 0) {451451+ nfs4_schedule_lease_recovery(pos);452452+ status = nfs_wait_client_init_complete(pos);453453+ if (status < 0) {445454 nfs_put_client(pos);446455 spin_lock(&nn->nfs_client_lock);447456 continue;448457 }449449-458458+ status = pos->cl_cons_state;450459 spin_lock(&nn->nfs_client_lock);460460+ if (status < 0)461461+ continue;451462 }452463453464 if (pos->rpc_ops != new->rpc_ops)···468473 if (!nfs4_match_serverowners(pos, new))469474 continue;470475476476+ atomic_inc(&pos->cl_count);471477 spin_unlock(&nn->nfs_client_lock);472478 dprintk("NFS: <-- %s using nfs_client = %p ({%d})\n",473479 __func__, pos, atomic_read(&pos->cl_count));···477481 return 0;478482 }479483480480- /*481481- * No matching nfs_client found. This should be impossible,482482- * because the new nfs_client has already been added to483483- * nfs_client_list by nfs_get_client().484484- *485485- * Don't BUG(), since the caller is holding a mutex.486486- */484484+ /* No matching nfs_client found. */487485 spin_unlock(&nn->nfs_client_lock);488488- pr_err("NFS: %s Error: no matching nfs_client found\n", __func__);489489- return -NFS4ERR_STALE_CLIENTID;486486+ dprintk("NFS: <-- %s status = %d\n", __func__, status);487487+ return status;490488}491489#endif /* CONFIG_NFS_V4_1 */492490
+14-8
fs/nfs/nfs4state.c
···136136 clp->cl_confirm = clid.confirm;137137138138 status = nfs40_walk_client_list(clp, result, cred);139139- switch (status) {140140- case -NFS4ERR_STALE_CLIENTID:141141- set_bit(NFS4CLNT_LEASE_CONFIRM, &clp->cl_state);142142- case 0:139139+ if (status == 0) {143140 /* Sustain the lease, even if it's empty. If the clientid4144141 * goes stale it's of no use for trunking discovery. */145142 nfs4_schedule_state_renewal(*result);146146- break;147143 }148148-149144out:150145 return status;151146}···18581863 case -ETIMEDOUT:18591864 case -EAGAIN:18601865 ssleep(1);18661866+ case -NFS4ERR_STALE_CLIENTID:18611867 dprintk("NFS: %s after status %d, retrying\n",18621868 __func__, status);18631869 goto again;···20182022 nfs4_begin_drain_session(clp);20192023 cred = nfs4_get_exchange_id_cred(clp);20202024 status = nfs4_proc_destroy_session(clp->cl_session, cred);20212021- if (status && status != -NFS4ERR_BADSESSION &&20222022- status != -NFS4ERR_DEADSESSION) {20252025+ switch (status) {20262026+ case 0:20272027+ case -NFS4ERR_BADSESSION:20282028+ case -NFS4ERR_DEADSESSION:20292029+ break;20302030+ case -NFS4ERR_BACK_CHAN_BUSY:20312031+ case -NFS4ERR_DELAY:20322032+ set_bit(NFS4CLNT_SESSION_RESET, &clp->cl_state);20332033+ status = 0;20342034+ ssleep(1);20352035+ goto out;20362036+ default:20232037 status = nfs4_recovery_handle_error(clp, status);20242038 goto out;20252039 }
···46804680 return error;46814681 }4682468246834683- if (bma->flags & XFS_BMAPI_STACK_SWITCH)46844684- bma->stack_switch = 1;46854685-46864683 error = xfs_bmap_alloc(bma);46874684 if (error)46884685 return error;···49524955 bma.userdata = 0;49534956 bma.flist = flist;49544957 bma.firstblock = firstblock;49584958+49594959+ if (flags & XFS_BMAPI_STACK_SWITCH)49604960+ bma.stack_switch = 1;4955496149564962 while (bno < end && n < *nmap) {49574963 inhole = eof || bma.got.br_startoff > bno;
+20
fs/xfs/xfs_buf.c
···487487 struct rb_node *parent;488488 xfs_buf_t *bp;489489 xfs_daddr_t blkno = map[0].bm_bn;490490+ xfs_daddr_t eofs;490491 int numblks = 0;491492 int i;492493···498497 /* Check for IOs smaller than the sector size / not sector aligned */499498 ASSERT(!(numbytes < (1 << btp->bt_sshift)));500499 ASSERT(!(BBTOB(blkno) & (xfs_off_t)btp->bt_smask));500500+501501+ /*502502+ * Corrupted block numbers can get through to here, unfortunately, so we503503+ * have to check that the buffer falls within the filesystem bounds.504504+ */505505+ eofs = XFS_FSB_TO_BB(btp->bt_mount, btp->bt_mount->m_sb.sb_dblocks);506506+ if (blkno >= eofs) {507507+ /*508508+ * XXX (dgc): we should really be returning EFSCORRUPTED here,509509+ * but none of the higher level infrastructure supports510510+ * returning a specific error on buffer lookup failures.511511+ */512512+ xfs_alert(btp->bt_mount,513513+ "%s: Block out of range: block 0x%llx, EOFS 0x%llx ",514514+ __func__, blkno, eofs);515515+ return NULL;516516+ }501517502518 /* get tree root */503519 pag = xfs_perag_get(btp->bt_mount,···15051487 while (!list_empty(&btp->bt_lru)) {15061488 bp = list_first_entry(&btp->bt_lru, struct xfs_buf, b_lru);15071489 if (atomic_read(&bp->b_hold) > 1) {14901490+ trace_xfs_buf_wait_buftarg(bp, _RET_IP_);14911491+ list_move_tail(&bp->b_lru, &btp->bt_lru);15081492 spin_unlock(&btp->bt_lru_lock);15091493 delay(100);15101494 goto restart;
+10-2
fs/xfs/xfs_buf_item.c
···652652653653 /*654654 * If the buf item isn't tracking any data, free it, otherwise drop the655655- * reference we hold to it.655655+ * reference we hold to it. If we are aborting the transaction, this may656656+ * be the only reference to the buf item, so we free it anyway657657+ * regardless of whether it is dirty or not. A dirty abort implies a658658+ * shutdown, anyway.656659 */657660 clean = 1;658661 for (i = 0; i < bip->bli_format_count; i++) {···667664 }668665 if (clean)669666 xfs_buf_item_relse(bp);670670- else667667+ else if (aborted) {668668+ if (atomic_dec_and_test(&bip->bli_refcount)) {669669+ ASSERT(XFS_FORCED_SHUTDOWN(lip->li_mountp));670670+ xfs_buf_item_relse(bp);671671+ }672672+ } else671673 atomic_dec(&bip->bli_refcount);672674673675 if (!hold)
···351351 }352352 if (shift)353353 alloc_blocks >>= shift;354354+355355+ /*356356+ * If we are still trying to allocate more space than is357357+ * available, squash the prealloc hard. This can happen if we358358+ * have a large file on a small filesystem and the above359359+ * lowspace thresholds are smaller than MAXEXTLEN.360360+ */361361+ while (alloc_blocks >= freesp)362362+ alloc_blocks >>= 4;354363 }355364356365 if (alloc_blocks < mp->m_writeio_blocks)
···618618#endif619619620620/*621621- * We play games with efi_enabled so that the compiler will, if possible, remove622622- * EFI-related code altogether.621621+ * We play games with efi_enabled so that the compiler will, if622622+ * possible, remove EFI-related code altogether.623623 */624624+#define EFI_BOOT 0 /* Were we booted from EFI? */625625+#define EFI_SYSTEM_TABLES 1 /* Can we use EFI system tables? */626626+#define EFI_CONFIG_TABLES 2 /* Can we use EFI config tables? */627627+#define EFI_RUNTIME_SERVICES 3 /* Can we use runtime services? */628628+#define EFI_MEMMAP 4 /* Can we use EFI memory map? */629629+#define EFI_64BIT 5 /* Is the firmware 64-bit? */630630+624631#ifdef CONFIG_EFI625632# ifdef CONFIG_X86626626- extern int efi_enabled;627627- extern bool efi_64bit;633633+extern int efi_enabled(int facility);628634# else629629-# define efi_enabled 1635635+static inline int efi_enabled(int facility)636636+{637637+ return 1;638638+}630639# endif631640#else632632-# define efi_enabled 0641641+static inline int efi_enabled(int facility)642642+{643643+ return 0;644644+}633645#endif634646635647/*
+25
include/linux/llist.h
···125125 (pos) = llist_entry((pos)->member.next, typeof(*(pos)), member))126126127127/**128128+ * llist_for_each_entry_safe - iterate safely against remove over some entries129129+ * of lock-less list of given type.130130+ * @pos: the type * to use as a loop cursor.131131+ * @n: another type * to use as a temporary storage.132132+ * @node: the fist entry of deleted list entries.133133+ * @member: the name of the llist_node with the struct.134134+ *135135+ * In general, some entries of the lock-less list can be traversed136136+ * safely only after being removed from list, so start with an entry137137+ * instead of list head. This variant allows removal of entries138138+ * as we iterate.139139+ *140140+ * If being used on entries deleted from lock-less list directly, the141141+ * traverse order is from the newest to the oldest added entry. If142142+ * you want to traverse from the oldest to the newest, you must143143+ * reverse the order by yourself before traversing.144144+ */145145+#define llist_for_each_entry_safe(pos, n, node, member) \146146+ for ((pos) = llist_entry((node), typeof(*(pos)), member), \147147+ (n) = (pos)->member.next; \148148+ &(pos)->member != NULL; \149149+ (pos) = llist_entry(n, typeof(*(pos)), member), \150150+ (n) = (&(pos)->member != NULL) ? (pos)->member.next : NULL)151151+152152+/**128153 * llist_empty - tests whether a lock-less list is empty129154 * @head: the list to test130155 *
+1-1
include/linux/memcontrol.h
···429429 * the slab_mutex must be held when looping through those caches430430 */431431#define for_each_memcg_cache_index(_idx) \432432- for ((_idx) = 0; i < memcg_limited_groups_array_size; (_idx)++)432432+ for ((_idx) = 0; (_idx) < memcg_limited_groups_array_size; (_idx)++)433433434434static inline bool memcg_kmem_enabled(void)435435{
+1-1
include/linux/mmu_notifier.h
···151151 * Therefore notifier chains can only be traversed when either152152 *153153 * 1. mmap_sem is held.154154- * 2. One of the reverse map locks is held (i_mmap_mutex or anon_vma->mutex).154154+ * 2. One of the reverse map locks is held (i_mmap_mutex or anon_vma->rwsem).155155 * 3. No other concurrent thread can access the list (release)156156 */157157struct mmu_notifier {
+2
include/linux/usb.h
···357357 int bandwidth_int_reqs; /* number of Interrupt requests */358358 int bandwidth_isoc_reqs; /* number of Isoc. requests */359359360360+ unsigned resuming_ports; /* bit array: resuming root-hub ports */361361+360362#if defined(CONFIG_USB_MON) || defined(CONFIG_USB_MON_MODULE)361363 struct mon_bus *mon_bus; /* non-null when associated */362364 int monitored; /* non-zero when monitored */
+3
include/linux/usb/hcd.h
···430430extern void usb_wakeup_notification(struct usb_device *hdev,431431 unsigned int portnum);432432433433+extern void usb_hcd_start_port_resume(struct usb_bus *bus, int portnum);434434+extern void usb_hcd_end_port_resume(struct usb_bus *bus, int portnum);435435+433436/* The D0/D1 toggle bits ... USE WITH CAUTION (they're almost hcd-internal) */434437#define usb_gettoggle(dev, ep, out) (((dev)->toggle[out] >> (ep)) & 1)435438#define usb_dotoggle(dev, ep, out) ((dev)->toggle[out] ^= (1 << (ep)))
+1-1
include/linux/usb/usbnet.h
···102102#define FLAG_LINK_INTR 0x0800 /* updates link (carrier) status */103103104104#define FLAG_POINTTOPOINT 0x1000 /* possibly use "usb%d" names */105105-#define FLAG_NOARP 0x2000 /* device can't do ARP */106105107106/*108107 * Indicates to usbnet, that USB driver accumulates multiple IP packets.···109110 */110111#define FLAG_MULTI_PACKET 0x2000111112#define FLAG_RX_ASSEMBLE 0x4000 /* rx packets may span >1 frames */113113+#define FLAG_NOARP 0x8000 /* device can't do ARP */112114113115 /* init device ... can sleep, or cause probe() failure */114116 int (*bind)(struct usbnet *, struct usb_interface *);
+6
include/uapi/linux/usb/ch9.h
···152152#define USB_INTRF_FUNC_SUSPEND_LP (1 << (8 + 0))153153#define USB_INTRF_FUNC_SUSPEND_RW (1 << (8 + 1))154154155155+/*156156+ * Interface status, Figure 9-5 USB 3.0 spec157157+ */158158+#define USB_INTRF_STAT_FUNC_RW_CAP 1159159+#define USB_INTRF_STAT_FUNC_RW 2160160+155161#define USB_ENDPOINT_HALT 0 /* IN/OUT will STALL */156162157163/* Bit array elements as returned by the USB_REQ_GET_STATUS request. */
+2-2
init/main.c
···604604 pidmap_init();605605 anon_vma_init();606606#ifdef CONFIG_X86607607- if (efi_enabled)607607+ if (efi_enabled(EFI_RUNTIME_SERVICES))608608 efi_enter_virtual_mode();609609#endif610610 thread_info_cache_init();···632632 acpi_early_init(); /* before LAPIC and SMP init */633633 sfi_init_late();634634635635- if (efi_enabled) {635635+ if (efi_enabled(EFI_RUNTIME_SERVICES)) {636636 efi_late_init();637637 efi_free_boot_services();638638 }
+18-2
kernel/events/core.c
···908908}909909910910/*911911+ * Initialize event state based on the perf_event_attr::disabled.912912+ */913913+static inline void perf_event__state_init(struct perf_event *event)914914+{915915+ event->state = event->attr.disabled ? PERF_EVENT_STATE_OFF :916916+ PERF_EVENT_STATE_INACTIVE;917917+}918918+919919+/*911920 * Called at perf_event creation and when events are attached/detached from a912921 * group.913922 */···61886179 event->overflow_handler = overflow_handler;61896180 event->overflow_handler_context = context;6190618161916191- if (attr->disabled)61926192- event->state = PERF_EVENT_STATE_OFF;61826182+ perf_event__state_init(event);6193618361946184 pmu = NULL;61956185···6617660966186610 mutex_lock(&gctx->mutex);66196611 perf_remove_from_context(group_leader);66126612+66136613+ /*66146614+ * Removing from the context ends up with disabled66156615+ * event. What we want here is event in the initial66166616+ * startup state, ready to be add into new context.66176617+ */66186618+ perf_event__state_init(group_leader);66206619 list_for_each_entry(sibling, &group_leader->sibling_list,66216620 group_entry) {66226621 perf_remove_from_context(sibling);66226622+ perf_event__state_init(sibling);66236623 put_ctx(gctx);66246624 }66256625 mutex_unlock(&gctx->mutex);
-9
kernel/printk.c
···8787struct console *console_drivers;8888EXPORT_SYMBOL_GPL(console_drivers);89899090-#ifdef CONFIG_LOCKDEP9191-static struct lockdep_map console_lock_dep_map = {9292- .name = "console_lock"9393-};9494-#endif9595-9690/*9791 * This is used for debugging the mess that is the VT code by9892 * keeping track if we have the console semaphore held. It's···19181924 return;19191925 console_locked = 1;19201926 console_may_schedule = 1;19211921- mutex_acquire(&console_lock_dep_map, 0, 0, _RET_IP_);19221927}19231928EXPORT_SYMBOL(console_lock);19241929···19391946 }19401947 console_locked = 1;19411948 console_may_schedule = 0;19421942- mutex_acquire(&console_lock_dep_map, 0, 1, _RET_IP_);19431949 return 1;19441950}19451951EXPORT_SYMBOL(console_trylock);···20992107 local_irq_restore(flags);21002108 }21012109 console_locked = 0;21022102- mutex_release(&console_lock_dep_map, 1, _RET_IP_);2103211021042111 /* Release the exclusive_console once it is used */21052112 if (unlikely(exclusive_console))
+10-3
kernel/rcutree_plugin.h
···4040#ifdef CONFIG_RCU_NOCB_CPU4141static cpumask_var_t rcu_nocb_mask; /* CPUs to have callbacks offloaded. */4242static bool have_rcu_nocb_mask; /* Was rcu_nocb_mask allocated? */4343-static bool rcu_nocb_poll; /* Offload kthread are to poll. */4444-module_param(rcu_nocb_poll, bool, 0444);4343+static bool __read_mostly rcu_nocb_poll; /* Offload kthread are to poll. */4544static char __initdata nocb_buf[NR_CPUS * 5];4645#endif /* #ifdef CONFIG_RCU_NOCB_CPU */4746···21582159}21592160__setup("rcu_nocbs=", rcu_nocb_setup);2160216121622162+static int __init parse_rcu_nocb_poll(char *arg)21632163+{21642164+ rcu_nocb_poll = 1;21652165+ return 0;21662166+}21672167+early_param("rcu_nocb_poll", parse_rcu_nocb_poll);21682168+21612169/* Is the specified CPU a no-CPUs CPU? */21622170static bool is_nocb_cpu(int cpu)21632171{···23722366 for (;;) {23732367 /* If not polling, wait for next batch of callbacks. */23742368 if (!rcu_nocb_poll)23752375- wait_event(rdp->nocb_wq, rdp->nocb_head);23692369+ wait_event_interruptible(rdp->nocb_wq, rdp->nocb_head);23762370 list = ACCESS_ONCE(rdp->nocb_head);23772371 if (!list) {23782372 schedule_timeout_interruptible(1);23732373+ flush_signals(current);23792374 continue;23802375 }23812376
···566566static int do_balance_runtime(struct rt_rq *rt_rq)567567{568568 struct rt_bandwidth *rt_b = sched_rt_bandwidth(rt_rq);569569- struct root_domain *rd = cpu_rq(smp_processor_id())->rd;569569+ struct root_domain *rd = rq_of_rt_rq(rt_rq)->rd;570570 int i, weight, more = 0;571571 u64 rt_period;572572
+12-1
kernel/smp.c
···3333 struct call_single_data csd;3434 atomic_t refs;3535 cpumask_var_t cpumask;3636+ cpumask_var_t cpumask_ipi;3637};37383839static DEFINE_PER_CPU_SHARED_ALIGNED(struct call_function_data, cfd_data);···5756 if (!zalloc_cpumask_var_node(&cfd->cpumask, GFP_KERNEL,5857 cpu_to_node(cpu)))5958 return notifier_from_errno(-ENOMEM);5959+ if (!zalloc_cpumask_var_node(&cfd->cpumask_ipi, GFP_KERNEL,6060+ cpu_to_node(cpu)))6161+ return notifier_from_errno(-ENOMEM);6062 break;61636264#ifdef CONFIG_HOTPLUG_CPU···6965 case CPU_DEAD:7066 case CPU_DEAD_FROZEN:7167 free_cpumask_var(cfd->cpumask);6868+ free_cpumask_var(cfd->cpumask_ipi);7269 break;7370#endif7471 };···531526 return;532527 }533528529529+ /*530530+ * After we put an entry into the list, data->cpumask531531+ * may be cleared again when another CPU sends another IPI for532532+ * a SMP function call, so data->cpumask will be zero.533533+ */534534+ cpumask_copy(data->cpumask_ipi, data->cpumask);534535 raw_spin_lock_irqsave(&call_function.lock, flags);535536 /*536537 * Place entry at the _HEAD_ of the list, so that any cpu still···560549 smp_mb();561550562551 /* Send a message to all CPUs in the map */563563- arch_send_call_function_ipi_mask(data->cpumask);552552+ arch_send_call_function_ipi_mask(data->cpumask_ipi);564553565554 /* Optionally wait for the CPUs to complete */566555 if (wait)
···160160 if (is_write_migration_entry(entry))161161 pte = pte_mkwrite(pte);162162#ifdef CONFIG_HUGETLB_PAGE163163- if (PageHuge(new))163163+ if (PageHuge(new)) {164164 pte = pte_mkhuge(pte);165165+ pte = arch_make_huge_pte(pte, vma, new, 0);166166+ }165167#endif166168 flush_cache_page(vma, addr, pte_pfn(pte));167169 set_pte_at(mm, addr, ptep, pte);
+1-1
mm/mmap.c
···29432943 * vma in this mm is backed by the same anon_vma or address_space.29442944 *29452945 * We can take all the locks in random order because the VM code29462946- * taking i_mmap_mutex or anon_vma->mutex outside the mmap_sem never29462946+ * taking i_mmap_mutex or anon_vma->rwsem outside the mmap_sem never29472947 * takes more than one of them in a row. Secondly we're protected29482948 * against a concurrent mm_take_all_locks() by the mm_all_locks_mutex.29492949 *
···859859860860 skb_pull(skb, sizeof(code));861861862862+ /*863863+ * The SMP context must be initialized for all other PDUs except864864+ * pairing and security requests. If we get any other PDU when865865+ * not initialized simply disconnect (done if this function866866+ * returns an error).867867+ */868868+ if (code != SMP_CMD_PAIRING_REQ && code != SMP_CMD_SECURITY_REQ &&869869+ !conn->smp_chan) {870870+ BT_ERR("Unexpected SMP command 0x%02x. Disconnecting.", code);871871+ kfree_skb(skb);872872+ return -ENOTSUPP;873873+ }874874+862875 switch (code) {863876 case SMP_CMD_PAIRING_REQ:864877 reason = smp_cmd_pairing_req(conn, skb);
···3535/* Must be called with rcu_read_lock. */3636static void netdev_port_receive(struct vport *vport, struct sk_buff *skb)3737{3838- if (unlikely(!vport)) {3939- kfree_skb(skb);4040- return;4141- }3838+ if (unlikely(!vport))3939+ goto error;4040+4141+ if (unlikely(skb_warn_if_lro(skb)))4242+ goto error;42434344 /* Make our own copy of the packet. Otherwise we will mangle the4445 * packet for anyone who came before us (e.g. tcpdump via AF_PACKET).···51505251 skb_push(skb, ETH_HLEN);5352 ovs_vport_receive(vport, skb);5353+ return;5454+5555+error:5656+ kfree_skb(skb);5457}55585659/* Called with rcu_read_lock and bottom-halves disabled. */···173168 packet_length(skb), mtu);174169 goto error;175170 }176176-177177- if (unlikely(skb_warn_if_lro(skb)))178178- goto error;179171180172 skb->dev = netdev_vport->dev;181173 len = skb->len;
+1-1
net/sctp/auth.c
···7171 return;72727373 if (atomic_dec_and_test(&key->refcnt)) {7474- kfree(key);7474+ kzfree(key);7575 SCTP_DBG_OBJCNT_DEC(keys);7676 }7777}
+5
net/sctp/endpointola.c
···249249/* Final destructor for endpoint. */250250static void sctp_endpoint_destroy(struct sctp_endpoint *ep)251251{252252+ int i;253253+252254 SCTP_ASSERT(ep->base.dead, "Endpoint is not dead", return);253255254256 /* Free up the HMAC transform. */···272270 /* Cleanup. */273271 sctp_inq_free(&ep->base.inqueue);274272 sctp_bind_addr_free(&ep->base.bind_addr);273273+274274+ for (i = 0; i < SCTP_HOW_MANY_SECRETS; ++i)275275+ memset(&ep->secret_key[i], 0, SCTP_SECRET_SIZE);275276276277 /* Remove and free the port */277278 if (sctp_sk(ep->base.sk)->bind_hash)
···9898 list_add(&task->u.tk_wait.timer_list, &queue->timer_list.list);9999}100100101101+static void rpc_rotate_queue_owner(struct rpc_wait_queue *queue)102102+{103103+ struct list_head *q = &queue->tasks[queue->priority];104104+ struct rpc_task *task;105105+106106+ if (!list_empty(q)) {107107+ task = list_first_entry(q, struct rpc_task, u.tk_wait.list);108108+ if (task->tk_owner == queue->owner)109109+ list_move_tail(&task->u.tk_wait.list, q);110110+ }111111+}112112+101113static void rpc_set_waitqueue_priority(struct rpc_wait_queue *queue, int priority)102114{103103- queue->priority = priority;115115+ if (queue->priority != priority) {116116+ /* Fairness: rotate the list when changing priority */117117+ rpc_rotate_queue_owner(queue);118118+ queue->priority = priority;119119+ }104120}105121106122static void rpc_set_waitqueue_owner(struct rpc_wait_queue *queue, pid_t pid)
+2
samples/seccomp/Makefile
···19192020# Try to match the kernel target.2121ifndef CONFIG_64BIT2222+ifndef CROSS_COMPILE22232324# s390 has -m31 flag to build 31 bit binaries2425ifndef CONFIG_S390···3534HOSTLOADLIBES_bpf-direct += $(MFLAG)3635HOSTLOADLIBES_bpf-fancy += $(MFLAG)3736HOSTLOADLIBES_dropper += $(MFLAG)3737+endif3838endif39394040# Tell kbuild to always build the programs