···162162What: /sys/devices/system/cpu/cpu*/cache/index3/cache_disable_{0,1}163163Date: August 2008164164KernelVersion: 2.6.27165165-Contact: discuss@x86-64.org165165+Contact: Linux kernel mailing list <linux-kernel@vger.kernel.org>166166Description: Disable L3 cache indices167167168168 These files exist in every CPU's cache/index3 directory. Each
···1717- #clock-cells: from common clock binding; shall be set to 1.1818- clocks: from common clock binding; list of parent clock1919 handles, shall be xtal reference clock or xtal and clkin for2020- si5351c only.2020+ si5351c only. Corresponding clock input names are "xtal" and2121+ "clkin" respectively.2122- #address-cells: shall be set to 1.2223- #size-cells: shall be set to 0.2324···72717372 /* connect xtal input to 25MHz reference */7473 clocks = <&ref25>;7474+ clock-names = "xtal";75757676 /* connect xtal input as source of pll0 and pll1 */7777 silabs,pll-source = <0 0>, <1 0>;
···33Required properties:44- compatible: Should be "cdns,[<chip>-]{emac}"55 Use "cdns,at91rm9200-emac" Atmel at91rm9200 SoC.66- or the generic form: "cdns,emac".66+ Use "cdns,zynq-gem" Xilinx Zynq-7xxx SoC.77+ Or the generic form: "cdns,emac".78- reg: Address and length of the register set for the device89- interrupts: Should contain macb interrupt910- phy-mode: see ethernet.txt file in the same directory.
···1515 a) Discovering and configuring TCMU uio devices1616 b) Waiting for events on the device(s)1717 c) Managing the command ring1818-3) Command filtering and pass_level1919-4) A final note1818+3) A final note201921202221TCM Userspace Design···323324 /* Process events from cmd ring until we catch up with cmd_head */324325 while (ent != (void *)mb + mb->cmdr_off + mb->cmd_head) {325326326326- if (tcmu_hdr_get_op(&ent->hdr) == TCMU_OP_CMD) {327327+ if (tcmu_hdr_get_op(ent->hdr.len_op) == TCMU_OP_CMD) {327328 uint8_t *cdb = (void *)mb + ent->req.cdb_off;328329 bool success = true;329330···338339 ent->rsp.scsi_status = SCSI_CHECK_CONDITION;339340 }340341 }342342+ else if (tcmu_hdr_get_op(ent->hdr.len_op) != TCMU_OP_PAD) {343343+ /* Tell the kernel we didn't handle unknown opcodes */344344+ ent->hdr.uflags |= TCMU_UFLAG_UNKNOWN_OP;345345+ }341346 else {342342- /* Do nothing for PAD entries */347347+ /* Do nothing for PAD entries except update cmd_tail */343348 }344349345350 /* update cmd_tail */···361358362359 return 0;363360}364364-365365-366366-Command filtering and pass_level367367---------------------------------368368-369369-TCMU supports a "pass_level" option with valid values of 0 or 1. When370370-the value is 0 (the default), nearly all SCSI commands received for371371-the device are passed through to the handler. This allows maximum372372-flexibility but increases the amount of code required by the handler,373373-to support all mandatory SCSI commands. If pass_level is set to 1,374374-then only IO-related commands are presented, and the rest are handled375375-by LIO's in-kernel command emulation. The commands presented at level376376-1 include all versions of:377377-378378-READ379379-WRITE380380-WRITE_VERIFY381381-XDWRITEREAD382382-WRITE_SAME383383-COMPARE_AND_WRITE384384-SYNCHRONIZE_CACHE385385-UNMAP386361387362388363A final note
+14-4
Documentation/virtual/kvm/mmu.txt
···169169 Contains the value of cr4.smep && !cr0.wp for which the page is valid170170 (pages for which this is true are different from other pages; see the171171 treatment of cr0.wp=0 below).172172+ role.smap_andnot_wp:173173+ Contains the value of cr4.smap && !cr0.wp for which the page is valid174174+ (pages for which this is true are different from other pages; see the175175+ treatment of cr0.wp=0 below).172176 gfn:173177 Either the guest page table containing the translations shadowed by this174178 page, or the base page frame for linear translations. See role.direct.···348344349345(user write faults generate a #PF)350346351351-In the first case there is an additional complication if CR4.SMEP is352352-enabled: since we've turned the page into a kernel page, the kernel may now353353-execute it. We handle this by also setting spte.nx. If we get a user354354-fetch or read fault, we'll change spte.u=1 and spte.nx=gpte.nx back.347347+In the first case there are two additional complications:348348+- if CR4.SMEP is enabled: since we've turned the page into a kernel page,349349+ the kernel may now execute it. We handle this by also setting spte.nx.350350+ If we get a user fetch or read fault, we'll change spte.u=1 and351351+ spte.nx=gpte.nx back.352352+- if CR4.SMAP is disabled: since the page has been changed to a kernel353353+ page, it can not be reused when CR4.SMAP is enabled. We set354354+ CR4.SMAP && !CR0.WP into shadow page's role to avoid this case. Note,355355+ here we do not care the case that CR4.SMAP is enabled since KVM will356356+ directly inject #PF to guest due to failed permission check.355357356358To prevent an spte that was converted into a kernel page with cr0.wp=0357359from being written by the kernel after cr0.wp has changed to 1, we make
···304304static int of_pmu_irq_cfg(struct platform_device *pdev)305305{306306 int i, irq;307307- int *irqs = kcalloc(pdev->num_resources, sizeof(*irqs), GFP_KERNEL);308308-309309- if (!irqs)310310- return -ENOMEM;307307+ int *irqs;311308312309 /* Don't bother with PPIs; they're already affine */313310 irq = platform_get_irq(pdev, 0);314311 if (irq >= 0 && irq_is_percpu(irq))315312 return 0;313313+314314+ irqs = kcalloc(pdev->num_resources, sizeof(*irqs), GFP_KERNEL);315315+ if (!irqs)316316+ return -ENOMEM;316317317318 for (i = 0; i < pdev->num_resources; ++i) {318319 struct device_node *dn;
+13-3
arch/arm/mach-imx/gpc.c
···280280 struct device_node *np;281281282282 np = of_find_compatible_node(NULL, NULL, "fsl,imx6q-gpc");283283- if (WARN_ON(!np ||284284- !of_find_property(np, "interrupt-controller", NULL)))285285- pr_warn("Outdated DT detected, system is about to crash!!!\n");283283+ if (WARN_ON(!np))284284+ return;285285+286286+ if (WARN_ON(!of_find_property(np, "interrupt-controller", NULL))) {287287+ pr_warn("Outdated DT detected, suspend/resume will NOT work\n");288288+289289+ /* map GPC, so that at least CPUidle and WARs keep working */290290+ gpc_base = of_iomap(np, 0);291291+ }286292}287293288294#ifdef CONFIG_PM_GENERIC_DOMAINS···448442{449443 struct regulator *pu_reg;450444 int ret;445445+446446+ /* bail out if DT too old and doesn't provide the necessary info */447447+ if (!of_property_read_bool(pdev->dev.of_node, "#power-domain-cells"))448448+ return 0;451449452450 pu_reg = devm_regulator_get_optional(&pdev->dev, "pu");453451 if (PTR_ERR(pu_reg) == -ENODEV)
+1-1
arch/arm/mach-pxa/pxa_cplds_irqs.c
···107107 struct resource *res;108108 struct cplds *fpga;109109 int ret;110110- unsigned int base_irq = 0;110110+ int base_irq;111111 unsigned long irqflags = 0;112112113113 fpga = devm_kzalloc(&pdev->dev, sizeof(*fpga), GFP_KERNEL);
+10-10
arch/arm/mm/mmu.c
···11121112 }1113111311141114 /*11151115- * Find the first non-section-aligned page, and point11151115+ * Find the first non-pmd-aligned page, and point11161116 * memblock_limit at it. This relies on rounding the11171117- * limit down to be section-aligned, which happens at11181118- * the end of this function.11171117+ * limit down to be pmd-aligned, which happens at the11181118+ * end of this function.11191119 *11201120 * With this algorithm, the start or end of almost any11211121- * bank can be non-section-aligned. The only exception11221122- * is that the start of the bank 0 must be section-11211121+ * bank can be non-pmd-aligned. The only exception is11221122+ * that the start of the bank 0 must be section-11231123 * aligned, since otherwise memory would need to be11241124 * allocated when mapping the start of bank 0, which11251125 * occurs before any free memory is mapped.11261126 */11271127 if (!memblock_limit) {11281128- if (!IS_ALIGNED(block_start, SECTION_SIZE))11281128+ if (!IS_ALIGNED(block_start, PMD_SIZE))11291129 memblock_limit = block_start;11301130- else if (!IS_ALIGNED(block_end, SECTION_SIZE))11301130+ else if (!IS_ALIGNED(block_end, PMD_SIZE))11311131 memblock_limit = arm_lowmem_limit;11321132 }11331133···11371137 high_memory = __va(arm_lowmem_limit - 1) + 1;1138113811391139 /*11401140- * Round the memblock limit down to a section size. This11401140+ * Round the memblock limit down to a pmd size. This11411141 * helps to ensure that we will allocate memory from the11421142- * last full section, which should be mapped.11421142+ * last full pmd, which should be mapped.11431143 */11441144 if (memblock_limit)11451145- memblock_limit = round_down(memblock_limit, SECTION_SIZE);11451145+ memblock_limit = round_down(memblock_limit, PMD_SIZE);11461146 if (!memblock_limit)11471147 memblock_limit = arm_lowmem_limit;11481148
+1
arch/arm/xen/enlighten.c
···272272void xen_arch_post_suspend(int suspend_cancelled) { }273273void xen_timer_resume(void) { }274274void xen_arch_resume(void) { }275275+void xen_arch_suspend(void) { }275276276277277278/* In the hypervisor.S file. */
+10-3
arch/ia64/pci/pci.c
···478478479479int pcibios_root_bridge_prepare(struct pci_host_bridge *bridge)480480{481481- struct pci_controller *controller = bridge->bus->sysdata;482482-483483- ACPI_COMPANION_SET(&bridge->dev, controller->companion);481481+ /*482482+ * We pass NULL as parent to pci_create_root_bus(), so if it is not NULL483483+ * here, pci_create_root_bus() has been called by someone else and484484+ * sysdata is likely to be different from what we expect. Let it go in485485+ * that case.486486+ */487487+ if (!bridge->dev.parent) {488488+ struct pci_controller *controller = bridge->bus->sysdata;489489+ ACPI_COMPANION_SET(&bridge->dev, controller->companion);490490+ }484491 return 0;485492}486493
+3
arch/mips/ath79/prom.c
···11/*22 * Atheros AR71XX/AR724X/AR913X specific prom routines33 *44+ * Copyright (C) 2015 Laurent Fasnacht <l@libres.ch>45 * Copyright (C) 2008-2010 Gabor Juhos <juhosg@openwrt.org>56 * Copyright (C) 2008 Imre Kaloz <kaloz@openwrt.org>67 *···2625{2726 fw_init_cmdline();28272828+#ifdef CONFIG_BLK_DEV_INITRD2929 /* Read the initrd address from the firmware environment */3030 initrd_start = fw_getenvl("initrd_start");3131 if (initrd_start) {3232 initrd_start = KSEG0ADDR(initrd_start);3333 initrd_end = initrd_start + fw_getenvl("initrd_size");3434 }3535+#endif3536}36373738void __init prom_free_prom_memory(void)
···7373 uint64_t nip, uint64_t addr)7474{7575 uint64_t srr1;7676- int index = __this_cpu_inc_return(mce_nest_count);7676+ int index = __this_cpu_inc_return(mce_nest_count) - 1;7777 struct machine_check_event *mce = this_cpu_ptr(&mce_event[index]);78787979 /*···184184 if (!get_mce_event(&evt, MCE_EVENT_RELEASE))185185 return;186186187187- index = __this_cpu_inc_return(mce_queue_count);187187+ index = __this_cpu_inc_return(mce_queue_count) - 1;188188 /* If queue is full, just return for now. */189189 if (index >= MAX_MC_EVT) {190190 __this_cpu_dec(mce_queue_count);
···689689struct page *690690follow_huge_addr(struct mm_struct *mm, unsigned long address, int write)691691{692692- pte_t *ptep;693693- struct page *page;692692+ pte_t *ptep, pte;694693 unsigned shift;695694 unsigned long mask, flags;695695+ struct page *page = ERR_PTR(-EINVAL);696696+697697+ local_irq_save(flags);698698+ ptep = find_linux_pte_or_hugepte(mm->pgd, address, &shift);699699+ if (!ptep)700700+ goto no_page;701701+ pte = READ_ONCE(*ptep);696702 /*703703+ * Verify it is a huge page else bail.697704 * Transparent hugepages are handled by generic code. We can skip them698705 * here.699706 */700700- local_irq_save(flags);701701- ptep = find_linux_pte_or_hugepte(mm->pgd, address, &shift);707707+ if (!shift || pmd_trans_huge(__pmd(pte_val(pte))))708708+ goto no_page;702709703703- /* Verify it is a huge page else bail. */704704- if (!ptep || !shift || pmd_trans_huge(*(pmd_t *)ptep)) {705705- local_irq_restore(flags);706706- return ERR_PTR(-EINVAL);710710+ if (!pte_present(pte)) {711711+ page = NULL;712712+ goto no_page;707713 }708714 mask = (1UL << shift) - 1;709709- page = pte_page(*ptep);715715+ page = pte_page(pte);710716 if (page)711717 page += (address & mask) / PAGE_SIZE;712718719719+no_page:713720 local_irq_restore(flags);714721 return page;715722}
+11
arch/powerpc/mm/pgtable_64.c
···839839 * hash fault look at them.840840 */841841 memset(pgtable, 0, PTE_FRAG_SIZE);842842+ /*843843+ * Serialize against find_linux_pte_or_hugepte which does lock-less844844+ * lookup in page tables with local interrupts disabled. For huge pages845845+ * it casts pmd_t to pte_t. Since format of pte_t is different from846846+ * pmd_t we want to prevent transit from pmd pointing to page table847847+ * to pmd pointing to huge page (and back) while interrupts are disabled.848848+ * We clear pmd to possibly replace it with page table pointer in849849+ * different code paths. So make sure we wait for the parallel850850+ * find_linux_pte_or_hugepage to finish.851851+ */852852+ kick_all_cpus_sync();842853 return old_pmd;843854}844855
+13-12
arch/s390/crypto/ghash_s390.c
···1616#define GHASH_DIGEST_SIZE 1617171818struct ghash_ctx {1919- u8 icv[16];2020- u8 key[16];1919+ u8 key[GHASH_BLOCK_SIZE];2120};22212322struct ghash_desc_ctx {2323+ u8 icv[GHASH_BLOCK_SIZE];2424+ u8 key[GHASH_BLOCK_SIZE];2425 u8 buffer[GHASH_BLOCK_SIZE];2526 u32 bytes;2627};···2928static int ghash_init(struct shash_desc *desc)3029{3130 struct ghash_desc_ctx *dctx = shash_desc_ctx(desc);3131+ struct ghash_ctx *ctx = crypto_shash_ctx(desc->tfm);32323333 memset(dctx, 0, sizeof(*dctx));3434+ memcpy(dctx->key, ctx->key, GHASH_BLOCK_SIZE);34353536 return 0;3637}···4845 }49465047 memcpy(ctx->key, key, GHASH_BLOCK_SIZE);5151- memset(ctx->icv, 0, GHASH_BLOCK_SIZE);52485349 return 0;5450}···5654 const u8 *src, unsigned int srclen)5755{5856 struct ghash_desc_ctx *dctx = shash_desc_ctx(desc);5959- struct ghash_ctx *ctx = crypto_shash_ctx(desc->tfm);6057 unsigned int n;6158 u8 *buf = dctx->buffer;6259 int ret;···7170 src += n;72717372 if (!dctx->bytes) {7474- ret = crypt_s390_kimd(KIMD_GHASH, ctx, buf,7373+ ret = crypt_s390_kimd(KIMD_GHASH, dctx, buf,7574 GHASH_BLOCK_SIZE);7675 if (ret != GHASH_BLOCK_SIZE)7776 return -EIO;···80798180 n = srclen & ~(GHASH_BLOCK_SIZE - 1);8281 if (n) {8383- ret = crypt_s390_kimd(KIMD_GHASH, ctx, src, n);8282+ ret = crypt_s390_kimd(KIMD_GHASH, dctx, src, n);8483 if (ret != n)8584 return -EIO;8685 src += n;···9594 return 0;9695}97969898-static int ghash_flush(struct ghash_ctx *ctx, struct ghash_desc_ctx *dctx)9797+static int ghash_flush(struct ghash_desc_ctx *dctx)9998{10099 u8 *buf = dctx->buffer;101100 int ret;···105104106105 memset(pos, 0, dctx->bytes);107106108108- ret = crypt_s390_kimd(KIMD_GHASH, ctx, buf, GHASH_BLOCK_SIZE);107107+ ret = crypt_s390_kimd(KIMD_GHASH, dctx, buf, GHASH_BLOCK_SIZE);109108 if (ret != GHASH_BLOCK_SIZE)110109 return -EIO;110110+111111+ dctx->bytes = 0;111112 }112113113113- dctx->bytes = 0;114114 return 0;115115}116116117117static int ghash_final(struct shash_desc *desc, u8 *dst)118118{119119 struct ghash_desc_ctx *dctx = shash_desc_ctx(desc);120120- struct ghash_ctx *ctx = crypto_shash_ctx(desc->tfm);121120 int ret;122121123123- ret = ghash_flush(ctx, dctx);122122+ ret = ghash_flush(dctx);124123 if (!ret)125125- memcpy(dst, ctx->icv, GHASH_BLOCK_SIZE);124124+ memcpy(dst, dctx->icv, GHASH_BLOCK_SIZE);126125 return ret;127126}128127
+1-1
arch/s390/crypto/prng.c
···125125 /* fill page with urandom bytes */126126 get_random_bytes(pg, PAGE_SIZE);127127 /* exor page with stckf values */128128- for (n = 0; n < sizeof(PAGE_SIZE/sizeof(u64)); n++) {128128+ for (n = 0; n < PAGE_SIZE / sizeof(u64); n++) {129129 u64 *p = ((u64 *)pg) + n;130130 *p ^= get_tod_clock_fast();131131 }
+1-1
arch/s390/include/asm/pgtable.h
···494494 return (pmd_val(pmd) & _SEGMENT_ENTRY_LARGE) != 0;495495}496496497497-static inline int pmd_pfn(pmd_t pmd)497497+static inline unsigned long pmd_pfn(pmd_t pmd)498498{499499 unsigned long origin_mask;500500
+10-9
arch/s390/net/bpf_jit_comp.c
···443443444444/*445445 * Compile one eBPF instruction into s390x code446446+ *447447+ * NOTE: Use noinline because for gcov (-fprofile-arcs) gcc allocates a lot of448448+ * stack space for the large switch statement.446449 */447447-static int bpf_jit_insn(struct bpf_jit *jit, struct bpf_prog *fp, int i)450450+static noinline int bpf_jit_insn(struct bpf_jit *jit, struct bpf_prog *fp, int i)448451{449452 struct bpf_insn *insn = &fp->insnsi[i];450453 int jmp_off, last, insn_count = 1;···591588 EMIT4(0xb9160000, dst_reg, rc_reg);592589 break;593590 }594594- case BPF_ALU64 | BPF_DIV | BPF_X: /* dst = dst / (u32) src */595595- case BPF_ALU64 | BPF_MOD | BPF_X: /* dst = dst % (u32) src */591591+ case BPF_ALU64 | BPF_DIV | BPF_X: /* dst = dst / src */592592+ case BPF_ALU64 | BPF_MOD | BPF_X: /* dst = dst % src */596593 {597594 int rc_reg = BPF_OP(insn->code) == BPF_DIV ? REG_W1 : REG_W0;598595···605602 EMIT4_IMM(0xa7090000, REG_W0, 0);606603 /* lgr %w1,%dst */607604 EMIT4(0xb9040000, REG_W1, dst_reg);608608- /* llgfr %dst,%src (u32 cast) */609609- EMIT4(0xb9160000, dst_reg, src_reg);610605 /* dlgr %w0,%dst */611611- EMIT4(0xb9870000, REG_W0, dst_reg);606606+ EMIT4(0xb9870000, REG_W0, src_reg);612607 /* lgr %dst,%rc */613608 EMIT4(0xb9040000, dst_reg, rc_reg);614609 break;···633632 EMIT4(0xb9160000, dst_reg, rc_reg);634633 break;635634 }636636- case BPF_ALU64 | BPF_DIV | BPF_K: /* dst = dst / (u32) imm */637637- case BPF_ALU64 | BPF_MOD | BPF_K: /* dst = dst % (u32) imm */635635+ case BPF_ALU64 | BPF_DIV | BPF_K: /* dst = dst / imm */636636+ case BPF_ALU64 | BPF_MOD | BPF_K: /* dst = dst % imm */638637 {639638 int rc_reg = BPF_OP(insn->code) == BPF_DIV ? REG_W1 : REG_W0;640639···650649 EMIT4(0xb9040000, REG_W1, dst_reg);651650 /* dlg %w0,<d(imm)>(%l) */652651 EMIT6_DISP_LH(0xe3000000, 0x0087, REG_W0, REG_0, REG_L,653653- EMIT_CONST_U64((u32) imm));652652+ EMIT_CONST_U64(imm));654653 /* lgr %dst,%rc */655654 EMIT4(0xb9040000, dst_reg, rc_reg);656655 break;
+2-1
arch/sparc/include/asm/cpudata_64.h
···2424 unsigned int icache_line_size;2525 unsigned int ecache_size;2626 unsigned int ecache_line_size;2727- int core_id;2727+ unsigned short sock_id;2828+ unsigned short core_id;2829 int proc_id;2930} cpuinfo_sparc;3031
···708708 struct pt_regs *regs)709709{710710 int i, ret = 0;711711+ char *tmp;711712712713 for (i = 0; i < mca_cfg.banks; i++) {713714 m->status = mce_rdmsrl(MSR_IA32_MCx_STATUS(i));···717716 if (quirk_no_way_out)718717 quirk_no_way_out(i, m, regs);719718 }720720- if (mce_severity(m, mca_cfg.tolerant, msg, true) >=721721- MCE_PANIC_SEVERITY)719719+720720+ if (mce_severity(m, mca_cfg.tolerant, &tmp, true) >= MCE_PANIC_SEVERITY) {721721+ *msg = tmp;722722 ret = 1;723723+ }723724 }724725 return ret;725726}
+15
arch/x86/kernel/i387.c
···173173 xstate_size = sizeof(struct i387_fxsave_struct);174174 else175175 xstate_size = sizeof(struct i387_fsave_struct);176176+177177+ /*178178+ * Quirk: we don't yet handle the XSAVES* instructions179179+ * correctly, as we don't correctly convert between180180+ * standard and compacted format when interfacing181181+ * with user-space - so disable it for now.182182+ *183183+ * The difference is small: with recent CPUs the184184+ * compacted format is only marginally smaller than185185+ * the standard FPU state format.186186+ *187187+ * ( This is easy to backport while we are fixing188188+ * XSAVES* support. )189189+ */190190+ setup_clear_cpu_cap(X86_FEATURE_XSAVES);176191}177192178193/*
+4
arch/x86/kvm/cpuid.c
···1616#include <linux/module.h>1717#include <linux/vmalloc.h>1818#include <linux/uaccess.h>1919+#include <asm/i387.h> /* For use_eager_fpu. Ugh! */2020+#include <asm/fpu-internal.h> /* For use_eager_fpu. Ugh! */1921#include <asm/user.h>2022#include <asm/xsave.h>2123#include "cpuid.h"···9694 best = kvm_find_cpuid_entry(vcpu, 0xD, 1);9795 if (best && (best->eax & (F(XSAVES) | F(XSAVEC))))9896 best->ebx = xstate_required_size(vcpu->arch.xcr0, true);9797+9898+ vcpu->arch.eager_fpu = guest_cpuid_has_mpx(vcpu);9999100100 /*101101 * The existing code assumes virtual address is 48-bit in the canonical
+8
arch/x86/kvm/cpuid.h
···117117 best = kvm_find_cpuid_entry(vcpu, 7, 0);118118 return best && (best->ebx & bit(X86_FEATURE_RTM));119119}120120+121121+static inline bool guest_cpuid_has_mpx(struct kvm_vcpu *vcpu)122122+{123123+ struct kvm_cpuid_entry2 *best;124124+125125+ best = kvm_find_cpuid_entry(vcpu, 7, 0);126126+ return best && (best->ebx & bit(X86_FEATURE_MPX));127127+}120128#endif
···718718 mmu_is_nested(vcpu));719719 if (likely(r != RET_MMIO_PF_INVALID))720720 return r;721721+722722+ /*723723+ * page fault with PFEC.RSVD = 1 is caused by shadow724724+ * page fault, should not be used to walk guest page725725+ * table.726726+ */727727+ error_code &= ~PFERR_RSVD_MASK;721728 };722729723730 r = mmu_topup_memory_caches(vcpu);
···702702int kvm_set_cr4(struct kvm_vcpu *vcpu, unsigned long cr4)703703{704704 unsigned long old_cr4 = kvm_read_cr4(vcpu);705705- unsigned long pdptr_bits = X86_CR4_PGE | X86_CR4_PSE |706706- X86_CR4_PAE | X86_CR4_SMEP;705705+ unsigned long pdptr_bits = X86_CR4_PGE | X86_CR4_PSE | X86_CR4_PAE |706706+ X86_CR4_SMEP | X86_CR4_SMAP;707707+707708 if (cr4 & CR4_RESERVED_BITS)708709 return 1;709710···744743 if (((cr4 ^ old_cr4) & pdptr_bits) ||745744 (!(cr4 & X86_CR4_PCIDE) && (old_cr4 & X86_CR4_PCIDE)))746745 kvm_mmu_reset_context(vcpu);747747-748748- if ((cr4 ^ old_cr4) & X86_CR4_SMAP)749749- update_permission_bitmask(vcpu, vcpu->arch.walk_mmu, false);750746751747 if ((cr4 ^ old_cr4) & X86_CR4_OSXSAVE)752748 kvm_update_cpuid(vcpu);···61956197 return;6196619861976199 page = gfn_to_page(vcpu->kvm, APIC_DEFAULT_PHYS_BASE >> PAGE_SHIFT);62006200+ if (is_error_page(page))62016201+ return;61986202 kvm_x86_ops->set_apic_access_page_addr(vcpu, page_to_phys(page));6199620362006204 /*···70607060 fpu_save_init(&vcpu->arch.guest_fpu);70617061 __kernel_fpu_end();70627062 ++vcpu->stat.fpu_reload;70637063- kvm_make_request(KVM_REQ_DEACTIVATE_FPU, vcpu);70637063+ if (!vcpu->arch.eager_fpu)70647064+ kvm_make_request(KVM_REQ_DEACTIVATE_FPU, vcpu);70657065+70647066 trace_kvm_fpu(0);70657067}70667068···70787076struct kvm_vcpu *kvm_arch_vcpu_create(struct kvm *kvm,70797077 unsigned int id)70807078{70797079+ struct kvm_vcpu *vcpu;70807080+70817081 if (check_tsc_unstable() && atomic_read(&kvm->online_vcpus) != 0)70827082 printk_once(KERN_WARNING70837083 "kvm: SMP vm created on host with unstable TSC; "70847084 "guest TSC will not be reliable\n");70857085- return kvm_x86_ops->vcpu_create(kvm, id);70857085+70867086+ vcpu = kvm_x86_ops->vcpu_create(kvm, id);70877087+70887088+ /*70897089+ * Activate fpu unconditionally in case the guest needs eager FPU. It will be70907090+ * deactivated soon if it doesn't.70917091+ */70927092+ kvm_x86_ops->fpu_activate(vcpu);70937093+ return vcpu;70867094}7087709570887096int kvm_arch_vcpu_setup(struct kvm_vcpu *vcpu)
+6-1
arch/x86/net/bpf_jit_comp.c
···966966 }967967 ctx.cleanup_addr = proglen;968968969969- for (pass = 0; pass < 10; pass++) {969969+ /* JITed image shrinks with every pass and the loop iterates970970+ * until the image stops shrinking. Very large bpf programs971971+ * may converge on the last pass. In such case do one more972972+ * pass to emit the final image973973+ */974974+ for (pass = 0; pass < 10 || image; pass++) {970975 proglen = do_jit(prog, addrs, image, oldproglen, &ctx);971976 if (proglen <= 0) {972977 image = NULL;
+10-3
arch/x86/pci/acpi.c
···482482483483int pcibios_root_bridge_prepare(struct pci_host_bridge *bridge)484484{485485- struct pci_sysdata *sd = bridge->bus->sysdata;486486-487487- ACPI_COMPANION_SET(&bridge->dev, sd->companion);485485+ /*486486+ * We pass NULL as parent to pci_create_root_bus(), so if it is not NULL487487+ * here, pci_create_root_bus() has been called by someone else and488488+ * sysdata is likely to be different from what we expect. Let it go in489489+ * that case.490490+ */491491+ if (!bridge->dev.parent) {492492+ struct pci_sysdata *sd = bridge->bus->sysdata;493493+ ACPI_COMPANION_SET(&bridge->dev, sd->companion);494494+ }488495 return 0;489496}490497
···734734}735735EXPORT_SYMBOL(blk_init_queue_node);736736737737+static void blk_queue_bio(struct request_queue *q, struct bio *bio);738738+737739struct request_queue *738740blk_init_allocated_queue(struct request_queue *q, request_fn_proc *rfn,739741 spinlock_t *lock)···15801578 blk_rq_bio_prep(req->q, req, bio);15811579}1582158015831583-void blk_queue_bio(struct request_queue *q, struct bio *bio)15811581+static void blk_queue_bio(struct request_queue *q, struct bio *bio)15841582{15851583 const bool sync = !!(bio->bi_rw & REQ_SYNC);15861584 struct blk_plug *plug;···16881686 spin_unlock_irq(q->queue_lock);16891687 }16901688}16911691-EXPORT_SYMBOL_GPL(blk_queue_bio); /* for device mapper only */1692168916931690/*16941691 * If bio->bi_dev is a partition, remap the location
-9
crypto/Kconfig
···15121512 This option enables the user-spaces interface for random15131513 number generator algorithms.1514151415151515-config CRYPTO_USER_API_AEAD15161516- tristate "User-space interface for AEAD cipher algorithms"15171517- depends on NET15181518- select CRYPTO_AEAD15191519- select CRYPTO_USER_API15201520- help15211521- This option enables the user-spaces interface for AEAD15221522- cipher algorithms.15231523-15241515config CRYPTO_HASH_INFO15251516 bool15261517
+4-5
crypto/algif_aead.c
···3333 /*3434 * RSGL_MAX_ENTRIES is an artificial limit where user space at maximum3535 * can cause the kernel to allocate RSGL_MAX_ENTRIES * ALG_MAX_PAGES3636- * bytes3636+ * pages3737 */3838#define RSGL_MAX_ENTRIES ALG_MAX_PAGES3939 struct af_alg_sgl rsgl[RSGL_MAX_ENTRIES];···435435 if (err < 0)436436 goto unlock;437437 usedpages += err;438438- /* chain the new scatterlist with initial list */438438+ /* chain the new scatterlist with previous one */439439 if (cnt)440440- scatterwalk_crypto_chain(ctx->rsgl[0].sg,441441- ctx->rsgl[cnt].sg, 1,442442- sg_nents(ctx->rsgl[cnt-1].sg));440440+ af_alg_link_sg(&ctx->rsgl[cnt-1], &ctx->rsgl[cnt]);441441+443442 /* we do not need more iovecs as we have sufficient memory */444443 if (outlen <= usedpages)445444 break;
···465465 if (!crtc[i])466466 continue;467467468468+ if (crtc[i]->cursor == plane)469469+ continue;470470+468471 /* There's no other way to figure out whether the crtc is running. */469472 ret = drm_crtc_vblank_get(crtc[i]);470473 if (ret == 0) {
···1818#include "exynos_drm_drv.h"19192020struct exynos_drm_crtc *exynos_drm_crtc_create(struct drm_device *drm_dev,2121- struct drm_plane *plane,2222- int pipe,2323- enum exynos_drm_output_type type,2424- struct exynos_drm_crtc_ops *ops,2525- void *context);2121+ struct drm_plane *plane,2222+ int pipe,2323+ enum exynos_drm_output_type type,2424+ const struct exynos_drm_crtc_ops *ops,2525+ void *context);2626int exynos_drm_crtc_enable_vblank(struct drm_device *dev, int pipe);2727void exynos_drm_crtc_disable_vblank(struct drm_device *dev, int pipe);2828void exynos_drm_crtc_finish_pageflip(struct drm_device *dev, int pipe);
+6-14
drivers/gpu/drm/exynos/exynos_drm_drv.h
···7171 * @dma_addr: array of bus(accessed by dma) address to the memory region7272 * allocated for a overlay.7373 * @zpos: order of overlay layer(z position).7474- * @index_color: if using color key feature then this value would be used7575- * as index color.7676- * @default_win: a window to be enabled.7777- * @color_key: color key on or off.7878- * @local_path: in case of lcd type, local path mode on or off.7979- * @transparency: transparency on or off.8080- * @activated: activated or not.8174 * @enabled: enabled or not.8275 * @resume: to resume or not.8376 *···101108 uint32_t pixel_format;102109 dma_addr_t dma_addr[MAX_FB_BUFFER];103110 unsigned int zpos;104104- unsigned int index_color;105111106106- bool default_win:1;107107- bool color_key:1;108108- bool local_path:1;109109- bool transparency:1;110110- bool activated:1;111112 bool enabled:1;112113 bool resume:1;113114};···168181 * @win_disable: disable hardware specific overlay.169182 * @te_handler: trigger to transfer video image at the tearing effect170183 * synchronization signal if there is a page flip request.184184+ * @clock_enable: optional function enabling/disabling display domain clock,185185+ * called from exynos-dp driver before powering up (with186186+ * 'enable' argument as true) and after powering down (with187187+ * 'enable' as false).171188 */172189struct exynos_drm_crtc;173190struct exynos_drm_crtc_ops {···186195 void (*win_commit)(struct exynos_drm_crtc *crtc, unsigned int zpos);187196 void (*win_disable)(struct exynos_drm_crtc *crtc, unsigned int zpos);188197 void (*te_handler)(struct exynos_drm_crtc *crtc);198198+ void (*clock_enable)(struct exynos_drm_crtc *crtc, bool enable);189199};190200191201/*···213221 unsigned int dpms;214222 wait_queue_head_t pending_flip_queue;215223 struct drm_pending_vblank_event *event;216216- struct exynos_drm_crtc_ops *ops;224224+ const struct exynos_drm_crtc_ops *ops;217225 void *ctx;218226};219227
+1-38
drivers/gpu/drm/exynos/exynos_drm_fb.c
···171171 return &exynos_fb->fb;172172}173173174174-static u32 exynos_drm_format_num_buffers(struct drm_mode_fb_cmd2 *mode_cmd)175175-{176176- unsigned int cnt = 0;177177-178178- if (mode_cmd->pixel_format != DRM_FORMAT_NV12)179179- return drm_format_num_planes(mode_cmd->pixel_format);180180-181181- while (cnt != MAX_FB_BUFFER) {182182- if (!mode_cmd->handles[cnt])183183- break;184184- cnt++;185185- }186186-187187- /*188188- * check if NV12 or NV12M.189189- *190190- * NV12191191- * handles[0] = base1, offsets[0] = 0192192- * handles[1] = base1, offsets[1] = Y_size193193- *194194- * NV12M195195- * handles[0] = base1, offsets[0] = 0196196- * handles[1] = base2, offsets[1] = 0197197- */198198- if (cnt == 2) {199199- /*200200- * in case of NV12 format, offsets[1] is not 0 and201201- * handles[0] is same as handles[1].202202- */203203- if (mode_cmd->offsets[1] &&204204- mode_cmd->handles[0] == mode_cmd->handles[1])205205- cnt = 1;206206- }207207-208208- return cnt;209209-}210210-211174static struct drm_framebuffer *212175exynos_user_fb_create(struct drm_device *dev, struct drm_file *file_priv,213176 struct drm_mode_fb_cmd2 *mode_cmd)···193230194231 drm_helper_mode_fill_fb_struct(&exynos_fb->fb, mode_cmd);195232 exynos_fb->exynos_gem_obj[0] = to_exynos_gem_obj(obj);196196- exynos_fb->buf_cnt = exynos_drm_format_num_buffers(mode_cmd);233233+ exynos_fb->buf_cnt = drm_format_num_planes(mode_cmd->pixel_format);197234198235 DRM_DEBUG_KMS("buf_cnt = %d\n", exynos_fb->buf_cnt);199236
+24-29
drivers/gpu/drm/exynos/exynos_drm_fimd.c
···3333#include "exynos_drm_crtc.h"3434#include "exynos_drm_plane.h"3535#include "exynos_drm_iommu.h"3636-#include "exynos_drm_fimd.h"37363837/*3938 * FIMD stands for Fully Interactive Mobile Display and···215216 DRM_DEBUG_KMS("vblank wait timed out.\n");216217}217218218218-static void fimd_enable_video_output(struct fimd_context *ctx, int win,219219+static void fimd_enable_video_output(struct fimd_context *ctx, unsigned int win,219220 bool enable)220221{221222 u32 val = readl(ctx->regs + WINCON(win));···228229 writel(val, ctx->regs + WINCON(win));229230}230231231231-static void fimd_enable_shadow_channel_path(struct fimd_context *ctx, int win,232232+static void fimd_enable_shadow_channel_path(struct fimd_context *ctx,233233+ unsigned int win,232234 bool enable)233235{234236 u32 val = readl(ctx->regs + SHADOWCON);···244244245245static void fimd_clear_channel(struct fimd_context *ctx)246246{247247- int win, ch_enabled = 0;247247+ unsigned int win, ch_enabled = 0;248248249249 DRM_DEBUG_KMS("%s\n", __FILE__);250250···946946 drm_handle_vblank(ctx->drm_dev, ctx->pipe);947947}948948949949-static struct exynos_drm_crtc_ops fimd_crtc_ops = {949949+static void fimd_dp_clock_enable(struct exynos_drm_crtc *crtc, bool enable)950950+{951951+ struct fimd_context *ctx = crtc->ctx;952952+ u32 val;953953+954954+ /*955955+ * Only Exynos 5250, 5260, 5410 and 542x requires enabling DP/MIE956956+ * clock. On these SoCs the bootloader may enable it but any957957+ * power domain off/on will reset it to disable state.958958+ */959959+ if (ctx->driver_data != &exynos5_fimd_driver_data)960960+ return;961961+962962+ val = enable ? DP_MIE_CLK_DP_ENABLE : DP_MIE_CLK_DISABLE;963963+ writel(DP_MIE_CLK_DP_ENABLE, ctx->regs + DP_MIE_CLKCON);964964+}965965+966966+static const struct exynos_drm_crtc_ops fimd_crtc_ops = {950967 .dpms = fimd_dpms,951968 .mode_fixup = fimd_mode_fixup,952969 .commit = fimd_commit,···973956 .win_commit = fimd_win_commit,974957 .win_disable = fimd_win_disable,975958 .te_handler = fimd_te_handler,959959+ .clock_enable = fimd_dp_clock_enable,976960};977961978962static irqreturn_t fimd_irq_handler(int irq, void *dev_id)···10431025 if (ctx->display)10441026 exynos_drm_create_enc_conn(drm_dev, ctx->display);1045102710461046- ret = fimd_iommu_attach_devices(ctx, drm_dev);10471047- if (ret)10481048- return ret;10491049-10501050- return 0;10511051-10281028+ return fimd_iommu_attach_devices(ctx, drm_dev);10521029}1053103010541031static void fimd_unbind(struct device *dev, struct device *master,···1204119112051192 return 0;12061193}12071207-12081208-void fimd_dp_clock_enable(struct exynos_drm_crtc *crtc, bool enable)12091209-{12101210- struct fimd_context *ctx = crtc->ctx;12111211- u32 val;12121212-12131213- /*12141214- * Only Exynos 5250, 5260, 5410 and 542x requires enabling DP/MIE12151215- * clock. On these SoCs the bootloader may enable it but any12161216- * power domain off/on will reset it to disable state.12171217- */12181218- if (ctx->driver_data != &exynos5_fimd_driver_data)12191219- return;12201220-12211221- val = enable ? DP_MIE_CLK_DP_ENABLE : DP_MIE_CLK_DISABLE;12221222- writel(DP_MIE_CLK_DP_ENABLE, ctx->regs + DP_MIE_CLKCON);12231223-}12241224-EXPORT_SYMBOL_GPL(fimd_dp_clock_enable);1225119412261195struct platform_driver fimd_driver = {12271196 .probe = fimd_probe,
-15
drivers/gpu/drm/exynos/exynos_drm_fimd.h
···11-/*22- * Copyright (c) 2015 Samsung Electronics Co., Ltd.33- *44- * This program is free software; you can redistribute it and/or modify it55- * under the terms of the GNU General Public License as published by the66- * Free Software Foundation; either version 2 of the License, or (at your77- * option) any later version.88- */99-1010-#ifndef _EXYNOS_DRM_FIMD_H_1111-#define _EXYNOS_DRM_FIMD_H_1212-1313-extern void fimd_dp_clock_enable(struct exynos_drm_crtc *crtc, bool enable);1414-1515-#endif /* _EXYNOS_DRM_FIMD_H_ */
···4444#define MIXER_WIN_NR 34545#define MIXER_DEFAULT_WIN 046464747+/* The pixelformats that are natively supported by the mixer. */4848+#define MXR_FORMAT_RGB565 44949+#define MXR_FORMAT_ARGB1555 55050+#define MXR_FORMAT_ARGB4444 65151+#define MXR_FORMAT_ARGB8888 75252+4753struct mixer_resources {4854 int irq;4955 void __iomem *mixer_regs;···333327 mixer_reg_writemask(res, MXR_CFG, val, MXR_CFG_RGB_FMT_MASK);334328}335329336336-static void mixer_cfg_layer(struct mixer_context *ctx, int win, bool enable)330330+static void mixer_cfg_layer(struct mixer_context *ctx, unsigned int win,331331+ bool enable)337332{338333 struct mixer_resources *res = &ctx->mixer_res;339334 u32 val = enable ? ~0 : 0;···366359 struct mixer_resources *res = &ctx->mixer_res;367360368361 mixer_reg_writemask(res, MXR_STATUS, ~0, MXR_STATUS_REG_RUN);369369-370370- mixer_regs_dump(ctx);371362}372363373364static void mixer_stop(struct mixer_context *ctx)···378373 while (!(mixer_reg_read(res, MXR_STATUS) & MXR_STATUS_REG_IDLE) &&379374 --timeout)380375 usleep_range(10000, 12000);381381-382382- mixer_regs_dump(ctx);383376}384377385385-static void vp_video_buffer(struct mixer_context *ctx, int win)378378+static void vp_video_buffer(struct mixer_context *ctx, unsigned int win)386379{387380 struct mixer_resources *res = &ctx->mixer_res;388381 unsigned long flags;389382 struct exynos_drm_plane *plane;390390- unsigned int buf_num = 1;391383 dma_addr_t luma_addr[2], chroma_addr[2];392384 bool tiled_mode = false;393385 bool crcb_mode = false;···395393 switch (plane->pixel_format) {396394 case DRM_FORMAT_NV12:397395 crcb_mode = false;398398- buf_num = 2;399396 break;400400- /* TODO: single buffer format NV12, NV21 */397397+ case DRM_FORMAT_NV21:398398+ crcb_mode = true;399399+ break;401400 default:402402- /* ignore pixel format at disable time */403403- if (!plane->dma_addr[0])404404- break;405405-406401 DRM_ERROR("pixel format for vp is wrong [%d].\n",407402 plane->pixel_format);408403 return;409404 }410405411411- if (buf_num == 2) {412412- luma_addr[0] = plane->dma_addr[0];413413- chroma_addr[0] = plane->dma_addr[1];414414- } else {415415- luma_addr[0] = plane->dma_addr[0];416416- chroma_addr[0] = plane->dma_addr[0]417417- + (plane->pitch * plane->fb_height);418418- }406406+ luma_addr[0] = plane->dma_addr[0];407407+ chroma_addr[0] = plane->dma_addr[1];419408420409 if (plane->scan_flag & DRM_MODE_FLAG_INTERLACE) {421410 ctx->interlace = true;···477484 mixer_vsync_set_update(ctx, true);478485 spin_unlock_irqrestore(&res->reg_slock, flags);479486487487+ mixer_regs_dump(ctx);480488 vp_regs_dump(ctx);481489}482490···512518 return -ENOTSUPP;513519}514520515515-static void mixer_graph_buffer(struct mixer_context *ctx, int win)521521+static void mixer_graph_buffer(struct mixer_context *ctx, unsigned int win)516522{517523 struct mixer_resources *res = &ctx->mixer_res;518524 unsigned long flags;···525531526532 plane = &ctx->planes[win];527533528528- #define RGB565 4529529- #define ARGB1555 5530530- #define ARGB4444 6531531- #define ARGB8888 7534534+ switch (plane->pixel_format) {535535+ case DRM_FORMAT_XRGB4444:536536+ fmt = MXR_FORMAT_ARGB4444;537537+ break;532538533533- switch (plane->bpp) {534534- case 16:535535- fmt = ARGB4444;539539+ case DRM_FORMAT_XRGB1555:540540+ fmt = MXR_FORMAT_ARGB1555;536541 break;537537- case 32:538538- fmt = ARGB8888;542542+543543+ case DRM_FORMAT_RGB565:544544+ fmt = MXR_FORMAT_RGB565;539545 break;546546+547547+ case DRM_FORMAT_XRGB8888:548548+ case DRM_FORMAT_ARGB8888:549549+ fmt = MXR_FORMAT_ARGB8888;550550+ break;551551+540552 default:541541- fmt = ARGB8888;553553+ DRM_DEBUG_KMS("pixelformat unsupported by mixer\n");554554+ return;542555 }543556544557 /* check if mixer supports requested scaling setup */···618617619618 mixer_vsync_set_update(ctx, true);620619 spin_unlock_irqrestore(&res->reg_slock, flags);620620+621621+ mixer_regs_dump(ctx);621622}622623623624static void vp_win_reset(struct mixer_context *ctx)···10731070 mutex_unlock(&ctx->mixer_mutex);1074107110751072 mixer_stop(ctx);10731073+ mixer_regs_dump(ctx);10761074 mixer_window_suspend(ctx);1077107510781076 ctx->int_en = mixer_reg_read(res, MXR_INT_EN);···11301126 return -EINVAL;11311127}1132112811331133-static struct exynos_drm_crtc_ops mixer_crtc_ops = {11291129+static const struct exynos_drm_crtc_ops mixer_crtc_ops = {11341130 .dpms = mixer_dpms,11351131 .enable_vblank = mixer_enable_vblank,11361132 .disable_vblank = mixer_disable_vblank,···11601156 .has_sclk = 1,11611157};1162115811631163-static struct platform_device_id mixer_driver_types[] = {11591159+static const struct platform_device_id mixer_driver_types[] = {11641160 {11651161 .name = "s5p-mixer",11661162 .driver_data = (unsigned long)&exynos4210_mxr_drv_data,
+11-13
drivers/gpu/drm/i915/intel_pm.c
···20452045 p->pipe_htotal = intel_crtc->config->base.adjusted_mode.crtc_htotal;20462046 p->pixel_rate = ilk_pipe_pixel_rate(dev, crtc);2047204720482048- if (crtc->primary->state->fb) {20492049- p->pri.enabled = true;20482048+ if (crtc->primary->state->fb)20502049 p->pri.bytes_per_pixel =20512050 crtc->primary->state->fb->bits_per_pixel / 8;20522052- } else {20532053- p->pri.enabled = false;20542054- p->pri.bytes_per_pixel = 0;20552055- }20512051+ else20522052+ p->pri.bytes_per_pixel = 4;2056205320572057- if (crtc->cursor->state->fb) {20582058- p->cur.enabled = true;20592059- p->cur.bytes_per_pixel = 4;20602060- } else {20612061- p->cur.enabled = false;20622062- p->cur.bytes_per_pixel = 0;20632063- }20542054+ p->cur.bytes_per_pixel = 4;20552055+ /*20562056+ * TODO: for now, assume primary and cursor planes are always enabled.20572057+ * Setting them to false makes the screen flicker.20582058+ */20592059+ p->pri.enabled = true;20602060+ p->cur.enabled = true;20612061+20642062 p->pri.horiz_pixels = intel_crtc->config->pipe_src_w;20652063 p->cur.horiz_pixels = intel_crtc->base.cursor->state->crtc_w;20662064
+1-1
drivers/gpu/drm/msm/adreno/adreno_gpu.c
···384384 if (gpu->memptrs_bo) {385385 if (gpu->memptrs_iova)386386 msm_gem_put_iova(gpu->memptrs_bo, gpu->base.id);387387- drm_gem_object_unreference(gpu->memptrs_bo);387387+ drm_gem_object_unreference_unlocked(gpu->memptrs_bo);388388 }389389 release_firmware(gpu->pm4);390390 release_firmware(gpu->pfp);
+5-5
drivers/gpu/drm/msm/dsi/dsi.c
···177177 goto fail;178178 }179179180180+ for (i = 0; i < MSM_DSI_ENCODER_NUM; i++) {181181+ encoders[i]->bridge = msm_dsi->bridge;182182+ msm_dsi->encoders[i] = encoders[i];183183+ }184184+180185 msm_dsi->connector = msm_dsi_manager_connector_init(msm_dsi->id);181186 if (IS_ERR(msm_dsi->connector)) {182187 ret = PTR_ERR(msm_dsi->connector);183188 dev_err(dev->dev, "failed to create dsi connector: %d\n", ret);184189 msm_dsi->connector = NULL;185190 goto fail;186186- }187187-188188- for (i = 0; i < MSM_DSI_ENCODER_NUM; i++) {189189- encoders[i]->bridge = msm_dsi->bridge;190190- msm_dsi->encoders[i] = encoders[i];191191 }192192193193 priv->bridges[priv->num_bridges++] = msm_dsi->bridge;
+8-13
drivers/gpu/drm/msm/dsi/dsi_host.c
···10231023 *data = buf[1]; /* strip out dcs type */10241024 return 1;10251025 } else {10261026- pr_err("%s: read data does not match with rx_buf len %d\n",10261026+ pr_err("%s: read data does not match with rx_buf len %zu\n",10271027 __func__, msg->rx_len);10281028 return -EINVAL;10291029 }···10401040 data[1] = buf[2];10411041 return 2;10421042 } else {10431043- pr_err("%s: read data does not match with rx_buf len %d\n",10431043+ pr_err("%s: read data does not match with rx_buf len %zu\n",10441044 __func__, msg->rx_len);10451045 return -EINVAL;10461046 }···10931093{10941094 u32 *lp, *temp, data;10951095 int i, j = 0, cnt;10961096- bool ack_error = false;10971096 u32 read_cnt;10981097 u8 reg[16];10991098 int repeated_bytes = 0;···11041105 if (cnt > 4)11051106 cnt = 4; /* 4 x 32 bits registers only */1106110711071107- /* Calculate real read data count */11081108- read_cnt = dsi_read(msm_host, 0x1d4) >> 16;11091109-11101110- ack_error = (rx_byte == 4) ?11111111- (read_cnt == 8) : /* short pkt + 4-byte error pkt */11121112- (read_cnt == (pkt_size + 6 + 4)); /* long pkt+4-byte error pkt*/11131113-11141114- if (ack_error)11151115- read_cnt -= 4; /* Remove 4 byte error pkt */11081108+ if (rx_byte == 4)11091109+ read_cnt = 4;11101110+ else11111111+ read_cnt = pkt_size + 6;1116111211171113 /*11181114 * In case of multiple reads from the panel, after the first read, there···12091215 container_of(work, struct msm_dsi_host, err_work);12101216 u32 status = msm_host->err_work_state;1211121712121212- pr_err("%s: status=%x\n", __func__, status);12181218+ pr_err_ratelimited("%s: status=%x\n", __func__, status);12131219 if (status & DSI_ERR_STATE_MDP_FIFO_UNDERFLOW)12141220 dsi_sw_reset_restore(msm_host);12151221···17911797 case MIPI_DSI_RX_ACKNOWLEDGE_AND_ERROR_REPORT:17921798 pr_err("%s: rx ACK_ERR_PACLAGE\n", __func__);17931799 ret = 0;18001800+ break;17941801 case MIPI_DSI_RX_GENERIC_SHORT_READ_RESPONSE_1BYTE:17951802 case MIPI_DSI_RX_DCS_SHORT_READ_RESPONSE_1BYTE:17961803 ret = dsi_short_read1_resp(buf, msg);
+5-1
drivers/gpu/drm/msm/dsi/dsi_manager.c
···462462 struct msm_dsi *msm_dsi = dsi_mgr_get_dsi(id);463463 struct drm_connector *connector = NULL;464464 struct dsi_connector *dsi_connector;465465- int ret;465465+ int ret, i;466466467467 dsi_connector = devm_kzalloc(msm_dsi->dev->dev,468468 sizeof(*dsi_connector), GFP_KERNEL);···494494 ret = drm_connector_register(connector);495495 if (ret)496496 goto fail;497497+498498+ for (i = 0; i < MSM_DSI_ENCODER_NUM; i++)499499+ drm_mode_connector_attach_encoder(connector,500500+ msm_dsi->encoders[i]);497501498502 return connector;499503
···13791379 /* updated in get modes as well since we need to know if it's analog or digital */13801380 radeon_connector_update_scratch_regs(connector, ret);1381138113821382- if (radeon_audio != 0) {13831383- radeon_connector_get_edid(connector);13821382+ if (radeon_audio != 0)13841383 radeon_audio_detect(connector, ret);13851385- }1386138413871385exit:13881386 pm_runtime_mark_last_busy(connector->dev->dev);···1717171917181720 radeon_connector_update_scratch_regs(connector, ret);1719172117201720- if (radeon_audio != 0) {17211721- radeon_connector_get_edid(connector);17221722+ if (radeon_audio != 0)17221723 radeon_audio_detect(connector, ret);17231723- }1724172417251725out:17261726 pm_runtime_mark_last_busy(connector->dev->dev);
···365365 if (!pd)366366 return ERR_PTR(-ENOMEM);367367368368- if (udata && uctx) {368368+ if (udata && uctx && dev->attr.max_dpp_pds) {369369 pd->dpp_enabled =370370 ocrdma_get_asic_type(dev) == OCRDMA_ASIC_GEN_SKH_R;371371 pd->num_dpp_qp =···17211721 struct ocrdma_qp *qp;17221722 struct ocrdma_dev *dev;17231723 struct ib_qp_attr attrs;17241724- int attr_mask = IB_QP_STATE;17241724+ int attr_mask;17251725 unsigned long flags;1726172617271727 qp = get_ocrdma_qp(ibqp);17281728 dev = get_ocrdma_dev(ibqp->device);1729172917301730- attrs.qp_state = IB_QPS_ERR;17311730 pd = qp->pd;1732173117331732 /* change the QP state to ERROR */17341734- _ocrdma_modify_qp(ibqp, &attrs, attr_mask);17351735-17331733+ if (qp->state != OCRDMA_QPS_RST) {17341734+ attrs.qp_state = IB_QPS_ERR;17351735+ attr_mask = IB_QP_STATE;17361736+ _ocrdma_modify_qp(ibqp, &attrs, attr_mask);17371737+ }17361738 /* ensure that CQEs for newly created QP (whose id may be same with17371739 * one which just getting destroyed are same), dont get17381740 * discarded until the old CQEs are discarded.
···747747 input_close_device(handle);748748}749749750750+static bool joydev_dev_is_absolute_mouse(struct input_dev *dev)751751+{752752+ DECLARE_BITMAP(jd_scratch, KEY_CNT);753753+754754+ BUILD_BUG_ON(ABS_CNT > KEY_CNT || EV_CNT > KEY_CNT);755755+756756+ /*757757+ * Virtualization (VMware, etc) and remote management (HP758758+ * ILO2) solutions use absolute coordinates for their virtual759759+ * pointing devices so that there is one-to-one relationship760760+ * between pointer position on the host screen and virtual761761+ * guest screen, and so their mice use ABS_X, ABS_Y and 3762762+ * primary button events. This clashes with what joydev763763+ * considers to be joysticks (a device with at minimum ABS_X764764+ * axis).765765+ *766766+ * Here we are trying to separate absolute mice from767767+ * joysticks. A device is, for joystick detection purposes,768768+ * considered to be an absolute mouse if the following is769769+ * true:770770+ *771771+ * 1) Event types are exactly EV_ABS, EV_KEY and EV_SYN.772772+ * 2) Absolute events are exactly ABS_X and ABS_Y.773773+ * 3) Keys are exactly BTN_LEFT, BTN_RIGHT and BTN_MIDDLE.774774+ * 4) Device is not on "Amiga" bus.775775+ */776776+777777+ bitmap_zero(jd_scratch, EV_CNT);778778+ __set_bit(EV_ABS, jd_scratch);779779+ __set_bit(EV_KEY, jd_scratch);780780+ __set_bit(EV_SYN, jd_scratch);781781+ if (!bitmap_equal(jd_scratch, dev->evbit, EV_CNT))782782+ return false;783783+784784+ bitmap_zero(jd_scratch, ABS_CNT);785785+ __set_bit(ABS_X, jd_scratch);786786+ __set_bit(ABS_Y, jd_scratch);787787+ if (!bitmap_equal(dev->absbit, jd_scratch, ABS_CNT))788788+ return false;789789+790790+ bitmap_zero(jd_scratch, KEY_CNT);791791+ __set_bit(BTN_LEFT, jd_scratch);792792+ __set_bit(BTN_RIGHT, jd_scratch);793793+ __set_bit(BTN_MIDDLE, jd_scratch);794794+795795+ if (!bitmap_equal(dev->keybit, jd_scratch, KEY_CNT))796796+ return false;797797+798798+ /*799799+ * Amiga joystick (amijoy) historically uses left/middle/right800800+ * button events.801801+ */802802+ if (dev->id.bustype == BUS_AMIGA)803803+ return false;804804+805805+ return true;806806+}750807751808static bool joydev_match(struct input_handler *handler, struct input_dev *dev)752809{···813756814757 /* Avoid tablets, digitisers and similar devices */815758 if (test_bit(EV_KEY, dev->evbit) && test_bit(BTN_DIGI, dev->keybit))759759+ return false;760760+761761+ /* Avoid absolute mice */762762+ if (joydev_dev_is_absolute_mouse(dev))816763 return false;817764818765 return true;
+1-1
drivers/input/mouse/Kconfig
···156156 Say Y here if you are running under control of VMware hypervisor157157 (ESXi, Workstation or Fusion). Also make sure that when you enable158158 this option, you remove the xf86-input-vmmouse user-space driver159159- or upgrade it to at least xf86-input-vmmouse 13.0.1, which doesn't159159+ or upgrade it to at least xf86-input-vmmouse 13.1.0, which doesn't160160 load in the presence of an in-kernel vmmouse driver.161161162162 If unsure, say N.
+5
drivers/input/mouse/alps.c
···941941 case V7_PACKET_ID_TWO:942942 mt[1].x &= ~0x000F;943943 mt[1].y |= 0x000F;944944+ /* Detect false-postive touches where x & y report max value */945945+ if (mt[1].y == 0x7ff && mt[1].x == 0xff0) {946946+ mt[1].x = 0;947947+ /* y gets set to 0 at the end of this function */948948+ }944949 break;945950946951 case V7_PACKET_ID_MULTI:
···164164 STMPE_TSC_CTRL_TSC_EN, STMPE_TSC_CTRL_TSC_EN);165165166166 /* start polling for touch_det to detect release */167167- schedule_delayed_work(&ts->work, HZ / 50);167167+ schedule_delayed_work(&ts->work, msecs_to_jiffies(50));168168169169 return IRQ_HANDLED;170170}
+1-1
drivers/input/touchscreen/sx8654.c
···187187 return -ENOMEM;188188189189 input = devm_input_allocate_device(&client->dev);190190- if (!sx8654)190190+ if (!input)191191 return -ENOMEM;192192193193 input->name = "SX8654 I2C Touchscreen";
+8-1
drivers/irqchip/irq-gic-v3-its.c
···828828 u64 typer = readq_relaxed(its->base + GITS_TYPER);829829 u32 ids = GITS_TYPER_DEVBITS(typer);830830831831- order = get_order((1UL << ids) * entry_size);831831+ /*832832+ * 'order' was initialized earlier to the default page833833+ * granule of the the ITS. We can't have an allocation834834+ * smaller than that. If the requested allocation835835+ * is smaller, round up to the default page granule.836836+ */837837+ order = max(get_order((1UL << ids) * entry_size),838838+ order);832839 if (order >= MAX_ORDER) {833840 order = MAX_ORDER - 1;834841 pr_warn("%s: Device Table too large, reduce its page order to %u\n",
···177177 * nr_pending is 0 and In_sync is clear, the entries we return will178178 * still be in the same position on the list when we re-enter179179 * list_for_each_entry_continue_rcu.180180+ *181181+ * Note that if entered with 'rdev == NULL' to start at the182182+ * beginning, we temporarily assign 'rdev' to an address which183183+ * isn't really an rdev, but which can be used by184184+ * list_for_each_entry_continue_rcu() to find the first entry.180185 */181186 rcu_read_lock();182187 if (rdev == NULL)183188 /* start at the beginning */184184- rdev = list_entry_rcu(&mddev->disks, struct md_rdev, same_set);189189+ rdev = list_entry(&mddev->disks, struct md_rdev, same_set);185190 else {186191 /* release the previous rdev and start from there. */187192 rdev_dec_pending(rdev, mddev);
···1304130413051305 if (ios->clock) {13061306 unsigned int clock_min = ~0U;13071307- u32 clkdiv;13071307+ int clkdiv;1308130813091309 spin_lock_bh(&host->lock);13101310 if (!host->mode_reg) {···13281328 /* Calculate clock divider */13291329 if (host->caps.has_odd_clk_div) {13301330 clkdiv = DIV_ROUND_UP(host->bus_hz, clock_min) - 2;13311331- if (clkdiv > 511) {13311331+ if (clkdiv < 0) {13321332+ dev_warn(&mmc->class_dev,13331333+ "clock %u too fast; using %lu\n",13341334+ clock_min, host->bus_hz / 2);13351335+ clkdiv = 0;13361336+ } else if (clkdiv > 511) {13321337 dev_warn(&mmc->class_dev,13331338 "clock %u too slow; using %lu\n",13341339 clock_min, host->bus_hz / (511 + 2));
+1-1
drivers/net/bonding/bond_options.c
···624624out:625625 if (ret)626626 bond_opt_error_interpret(bond, opt, ret, val);627627- else627627+ else if (bond->dev->reg_state == NETREG_REGISTERED)628628 call_netdevice_notifiers(NETDEV_CHANGEINFODATA, bond->dev);629629630630 return ret;
+1-1
drivers/net/ethernet/broadcom/bnx2x/bnx2x.h
···17741774 int stats_state;1775177517761776 /* used for synchronization of concurrent threads statistics handling */17771777- struct mutex stats_lock;17771777+ struct semaphore stats_lock;1778177817791779 /* used by dmae command loader */17801780 struct dmae_command stats_dmae;
···13721372 * that context in case someone is in the middle of a transition.13731373 * For other events, wait a bit until lock is taken.13741374 */13751375- if (!mutex_trylock(&bp->stats_lock)) {13751375+ if (down_trylock(&bp->stats_lock)) {13761376 if (event == STATS_EVENT_UPDATE)13771377 return;1378137813791379 DP(BNX2X_MSG_STATS,13801380 "Unlikely stats' lock contention [event %d]\n", event);13811381- mutex_lock(&bp->stats_lock);13811381+ if (unlikely(down_timeout(&bp->stats_lock, HZ / 10))) {13821382+ BNX2X_ERR("Failed to take stats lock [event %d]\n",13831383+ event);13841384+ return;13851385+ }13821386 }1383138713841388 bnx2x_stats_stm[state][event].action(bp);13851389 bp->stats_state = bnx2x_stats_stm[state][event].next_state;1386139013871387- mutex_unlock(&bp->stats_lock);13911391+ up(&bp->stats_lock);1388139213891393 if ((event != STATS_EVENT_UPDATE) || netif_msg_timer(bp))13901394 DP(BNX2X_MSG_STATS, "state %d -> event %d -> state %d\n",···19741970 /* Wait for statistics to end [while blocking further requests],19751971 * then run supplied function 'safely'.19761972 */19771977- mutex_lock(&bp->stats_lock);19731973+ rc = down_timeout(&bp->stats_lock, HZ / 10);19741974+ if (unlikely(rc)) {19751975+ BNX2X_ERR("Failed to take statistics lock for safe execution\n");19761976+ goto out_no_lock;19771977+ }1978197819791979 bnx2x_stats_comp(bp);19801980 while (bp->stats_pending && cnt--)···19961988 /* No need to restart statistics - if they're enabled, the timer19971989 * will restart the statistics.19981990 */19991999- mutex_unlock(&bp->stats_lock);20002000-19911991+ up(&bp->stats_lock);19921992+out_no_lock:20011993 return rc;20021994}
···37013701 setup_timer(&bnad->bna.ioceth.ioc.sem_timer, bnad_iocpf_sem_timeout,37023702 ((unsigned long)bnad));3703370337043704- /* Now start the timer before calling IOC */37053705- mod_timer(&bnad->bna.ioceth.ioc.iocpf_timer,37063706- jiffies + msecs_to_jiffies(BNA_IOC_TIMER_FREQ));37073707-37083704 /*37093705 * Start the chip37103706 * If the call back comes with error, we bail out.
+7
drivers/net/ethernet/brocade/bna/cna_fwimg.c
···3030 u32 *bfi_image_size, char *fw_name)3131{3232 const struct firmware *fw;3333+ u32 n;33343435 if (request_firmware(&fw, fw_name, &pdev->dev)) {3536 pr_alert("Can't locate firmware %s\n", fw_name);···4039 *bfi_image = (u32 *)fw->data;4140 *bfi_image_size = fw->size/sizeof(u32);4241 bfi_fw = fw;4242+4343+ /* Convert loaded firmware to host order as it is stored in file4444+ * as sequence of LE32 integers.4545+ */4646+ for (n = 0; n < *bfi_image_size; n++)4747+ le32_to_cpus(*bfi_image + n);43484449 return *bfi_image;4550error:
+18
drivers/net/ethernet/cadence/macb.c
···350350 else351351 phydev->supported &= PHY_BASIC_FEATURES;352352353353+ if (bp->caps & MACB_CAPS_NO_GIGABIT_HALF)354354+ phydev->supported &= ~SUPPORTED_1000baseT_Half;355355+353356 phydev->advertising = phydev->supported;354357355358 bp->link = 0;···10401037 * add that if/when we get our hands on a full-blown MII PHY.10411038 */1042103910401040+ /* There is a hardware issue under heavy load where DMA can10411041+ * stop, this causes endless "used buffer descriptor read"10421042+ * interrupts but it can be cleared by re-enabling RX. See10431043+ * the at91 manual, section 41.3.1 or the Zynq manual10441044+ * section 16.7.4 for details.10451045+ */10431046 if (status & MACB_BIT(RXUBR)) {10441047 ctrl = macb_readl(bp, NCR);10451048 macb_writel(bp, NCR, ctrl & ~MACB_BIT(RE));···27022693 .init = at91ether_init,27032694};2704269526962696+static const struct macb_config zynq_config = {26972697+ .caps = MACB_CAPS_SG_DISABLED | MACB_CAPS_GIGABIT_MODE_AVAILABLE |26982698+ MACB_CAPS_NO_GIGABIT_HALF,26992699+ .dma_burst_length = 16,27002700+ .clk_init = macb_clk_init,27012701+ .init = macb_init,27022702+};27032703+27052704static const struct of_device_id macb_dt_ids[] = {27062705 { .compatible = "cdns,at32ap7000-macb" },27072706 { .compatible = "cdns,at91sam9260-macb", .data = &at91sam9260_config },···27202703 { .compatible = "atmel,sama5d4-gem", .data = &sama5d4_config },27212704 { .compatible = "cdns,at91rm9200-emac", .data = &emac_config },27222705 { .compatible = "cdns,emac", .data = &emac_config },27062706+ { .compatible = "cdns,zynq-gem", .data = &zynq_config },27232707 { /* sentinel */ }27242708};27252709MODULE_DEVICE_TABLE(of, macb_dt_ids);
···29212921 struct neighbour *n = __ipv4_neigh_lookup(dev, (__force u32)ip_addr);29222922 int err = 0;2923292329242924- if (!n)29242924+ if (!n) {29252925 n = neigh_create(&arp_tbl, &ip_addr, dev);29262926- if (!n)29272927- return -ENOMEM;29262926+ if (IS_ERR(n))29272927+ return IS_ERR(n);29282928+ }2928292929292930 /* If the neigh is already resolved, then go ahead and29302931 * install the entry, otherwise start the ARP process to···29372936 else29382937 neigh_event_send(n, NULL);2939293829392939+ neigh_release(n);29402940 return err;29412941}29422942
+25-17
drivers/net/ethernet/sfc/rx.c
···224224 }225225}226226227227-static void efx_free_rx_buffer(struct efx_rx_buffer *rx_buf)227227+static void efx_free_rx_buffers(struct efx_rx_queue *rx_queue,228228+ struct efx_rx_buffer *rx_buf,229229+ unsigned int num_bufs)228230{229229- if (rx_buf->page) {230230- put_page(rx_buf->page);231231- rx_buf->page = NULL;232232- }231231+ do {232232+ if (rx_buf->page) {233233+ put_page(rx_buf->page);234234+ rx_buf->page = NULL;235235+ }236236+ rx_buf = efx_rx_buf_next(rx_queue, rx_buf);237237+ } while (--num_bufs);233238}234239235240/* Attempt to recycle the page if there is an RX recycle ring; the page can···283278 /* If this is the last buffer in a page, unmap and free it. */284279 if (rx_buf->flags & EFX_RX_BUF_LAST_IN_PAGE) {285280 efx_unmap_rx_buffer(rx_queue->efx, rx_buf);286286- efx_free_rx_buffer(rx_buf);281281+ efx_free_rx_buffers(rx_queue, rx_buf, 1);287282 }288283 rx_buf->page = NULL;289284}···309304310305 efx_recycle_rx_pages(channel, rx_buf, n_frags);311306312312- do {313313- efx_free_rx_buffer(rx_buf);314314- rx_buf = efx_rx_buf_next(rx_queue, rx_buf);315315- } while (--n_frags);307307+ efx_free_rx_buffers(rx_queue, rx_buf, n_frags);316308}317309318310/**···433431434432 skb = napi_get_frags(napi);435433 if (unlikely(!skb)) {436436- while (n_frags--) {437437- put_page(rx_buf->page);438438- rx_buf->page = NULL;439439- rx_buf = efx_rx_buf_next(&channel->rx_queue, rx_buf);440440- }434434+ struct efx_rx_queue *rx_queue;435435+436436+ rx_queue = efx_channel_get_rx_queue(channel);437437+ efx_free_rx_buffers(rx_queue, rx_buf, n_frags);441438 return;442439 }443440···623622624623 skb = efx_rx_mk_skb(channel, rx_buf, n_frags, eh, hdr_len);625624 if (unlikely(skb == NULL)) {626626- efx_free_rx_buffer(rx_buf);625625+ struct efx_rx_queue *rx_queue;626626+627627+ rx_queue = efx_channel_get_rx_queue(channel);628628+ efx_free_rx_buffers(rx_queue, rx_buf, n_frags);627629 return;628630 }629631 skb_record_rx_queue(skb, channel->rx_queue.core_index);···665661 * loopback layer, and free the rx_buf here666662 */667663 if (unlikely(efx->loopback_selftest)) {664664+ struct efx_rx_queue *rx_queue;665665+668666 efx_loopback_rx_packet(efx, eh, rx_buf->len);669669- efx_free_rx_buffer(rx_buf);667667+ rx_queue = efx_channel_get_rx_queue(channel);668668+ efx_free_rx_buffers(rx_queue, rx_buf,669669+ channel->rx_pkt_n_frags);670670 goto out;671671 }672672
+6
drivers/net/ethernet/stmicro/stmmac/stmmac.h
···117117 int use_riwt;118118 int irq_wake;119119 spinlock_t ptp_lock;120120+121121+#ifdef CONFIG_DEBUG_FS122122+ struct dentry *dbgfs_dir;123123+ struct dentry *dbgfs_rings_status;124124+ struct dentry *dbgfs_dma_cap;125125+#endif120126};121127122128int stmmac_mdio_unregister(struct net_device *ndev);
···742742 */743743void phy_start(struct phy_device *phydev)744744{745745+ bool do_resume = false;746746+ int err = 0;747747+745748 mutex_lock(&phydev->lock);746749747750 switch (phydev->state) {···755752 phydev->state = PHY_UP;756753 break;757754 case PHY_HALTED:755755+ /* make sure interrupts are re-enabled for the PHY */756756+ err = phy_enable_interrupts(phydev);757757+ if (err < 0)758758+ break;759759+758760 phydev->state = PHY_RESUMING;761761+ do_resume = true;762762+ break;759763 default:760764 break;761765 }762766 mutex_unlock(&phydev->lock);767767+768768+ /* if phy was suspended, bring the physical link up again */769769+ if (do_resume)770770+ phy_resume(phydev);763771}764772EXPORT_SYMBOL(phy_start);765773···783769 struct delayed_work *dwork = to_delayed_work(work);784770 struct phy_device *phydev =785771 container_of(dwork, struct phy_device, state_queue);786786- bool needs_aneg = false, do_suspend = false, do_resume = false;772772+ bool needs_aneg = false, do_suspend = false;787773 int err = 0;788774789775 mutex_lock(&phydev->lock);···902888 }903889 break;904890 case PHY_RESUMING:905905- err = phy_clear_interrupt(phydev);906906- if (err)907907- break;908908-909909- err = phy_config_interrupt(phydev, PHY_INTERRUPT_ENABLED);910910- if (err)911911- break;912912-913891 if (AUTONEG_ENABLE == phydev->autoneg) {914892 err = phy_aneg_done(phydev);915893 if (err < 0)···939933 }940934 phydev->adjust_link(phydev->attached_dev);941935 }942942- do_resume = true;943936 break;944937 }945938···948943 err = phy_start_aneg(phydev);949944 else if (do_suspend)950945 phy_suspend(phydev);951951- else if (do_resume)952952- phy_resume(phydev);953946954947 if (err < 0)955948 phy_error(phydev);···10561053{10571054 /* According to 802.3az,the EEE is supported only in full duplex-mode.10581055 * Also EEE feature is active when core is operating with MII, GMII10591059- * or RGMII. Internal PHYs are also allowed to proceed and should10601060- * return an error if they do not support EEE.10561056+ * or RGMII (all kinds). Internal PHYs are also allowed to proceed and10571057+ * should return an error if they do not support EEE.10611058 */10621059 if ((phydev->duplex == DUPLEX_FULL) &&10631060 ((phydev->interface == PHY_INTERFACE_MODE_MII) ||10641061 (phydev->interface == PHY_INTERFACE_MODE_GMII) ||10651065- (phydev->interface == PHY_INTERFACE_MODE_RGMII) ||10621062+ (phydev->interface >= PHY_INTERFACE_MODE_RGMII &&10631063+ phydev->interface <= PHY_INTERFACE_MODE_RGMII_TXID) ||10661064 phy_is_internal(phydev))) {10671065 int eee_lp, eee_cap, eee_adv;10681066 u32 lp, cap, adv;
···29612961 * to the list by the previous loop.29622962 */29632963 if (!net_eq(dev_net(vxlan->dev), net))29642964- unregister_netdevice_queue(dev, &list);29642964+ unregister_netdevice_queue(vxlan->dev, &list);29652965 }2966296629672967 unregister_netdevice_many(&list);
+5-7
drivers/net/wireless/brcm80211/brcmfmac/msgbuf.c
···511511 msgbuf->rx_pktids,512512 msgbuf->ioctl_resp_pktid);513513 if (msgbuf->ioctl_resp_ret_len != 0) {514514- if (!skb) {515515- brcmf_err("Invalid packet id idx recv'd %d\n",516516- msgbuf->ioctl_resp_pktid);514514+ if (!skb)517515 return -EBADF;518518- }516516+519517 memcpy(buf, skb->data, (len < msgbuf->ioctl_resp_ret_len) ?520518 len : msgbuf->ioctl_resp_ret_len);521519 }···872874 flowid -= BRCMF_NROF_H2D_COMMON_MSGRINGS;873875 skb = brcmf_msgbuf_get_pktid(msgbuf->drvr->bus_if->dev,874876 msgbuf->tx_pktids, idx);875875- if (!skb) {876876- brcmf_err("Invalid packet id idx recv'd %d\n", idx);877877+ if (!skb)877878 return;878878- }879879880880 set_bit(flowid, msgbuf->txstatus_done_map);881881 commonring = msgbuf->flowrings[flowid];···1152115611531157 skb = brcmf_msgbuf_get_pktid(msgbuf->drvr->bus_if->dev,11541158 msgbuf->rx_pktids, idx);11591159+ if (!skb)11601160+ return;1155116111561162 if (data_offset)11571163 skb_pull(skb, data_offset);
···70707171/* Highest firmware API version supported */7272#define IWL7260_UCODE_API_MAX 137373-#define IWL3160_UCODE_API_MAX 1374737574/* Oldest version we won't warn about */7675#define IWL7260_UCODE_API_OK 127777-#define IWL3160_UCODE_API_OK 127676+#define IWL3165_UCODE_API_OK 1378777978/* Lowest firmware API version supported */8079#define IWL7260_UCODE_API_MIN 108181-#define IWL3160_UCODE_API_MIN 108080+#define IWL3165_UCODE_API_MIN 1382818382/* NVM versions */8483#define IWL7260_NVM_VERSION 0x0a1d···102103103104#define IWL3160_FW_PRE "iwlwifi-3160-"104105#define IWL3160_MODULE_FIRMWARE(api) IWL3160_FW_PRE __stringify(api) ".ucode"105105-106106-#define IWL3165_FW_PRE "iwlwifi-3165-"107107-#define IWL3165_MODULE_FIRMWARE(api) IWL3165_FW_PRE __stringify(api) ".ucode"108106109107#define IWL7265_FW_PRE "iwlwifi-7265-"110108#define IWL7265_MODULE_FIRMWARE(api) IWL7265_FW_PRE __stringify(api) ".ucode"···244248245249const struct iwl_cfg iwl3165_2ac_cfg = {246250 .name = "Intel(R) Dual Band Wireless AC 3165",247247- .fw_name_pre = IWL3165_FW_PRE,251251+ .fw_name_pre = IWL7265D_FW_PRE,248252 IWL_DEVICE_7000,253253+ /* sparse doens't like the re-assignment but it is safe */254254+#ifndef __CHECKER__255255+ .ucode_api_ok = IWL3165_UCODE_API_OK,256256+ .ucode_api_min = IWL3165_UCODE_API_MIN,257257+#endif249258 .ht_params = &iwl7000_ht_params,250259 .nvm_ver = IWL3165_NVM_VERSION,251260 .nvm_calib_ver = IWL3165_TX_POWER_VERSION,···326325327326MODULE_FIRMWARE(IWL7260_MODULE_FIRMWARE(IWL7260_UCODE_API_OK));328327MODULE_FIRMWARE(IWL3160_MODULE_FIRMWARE(IWL3160_UCODE_API_OK));329329-MODULE_FIRMWARE(IWL3165_MODULE_FIRMWARE(IWL3160_UCODE_API_OK));330328MODULE_FIRMWARE(IWL7265_MODULE_FIRMWARE(IWL7260_UCODE_API_OK));331329MODULE_FIRMWARE(IWL7265D_MODULE_FIRMWARE(IWL7260_UCODE_API_OK));
+5
drivers/net/wireless/iwlwifi/iwl-eeprom-parse.c
···66 * GPL LICENSE SUMMARY77 *88 * Copyright(c) 2008 - 2014 Intel Corporation. All rights reserved.99+ * Copyright(c) 2015 Intel Mobile Communications GmbH910 *1011 * This program is free software; you can redistribute it and/or modify1112 * it under the terms of version 2 of the GNU General Public License as···3231 * BSD LICENSE3332 *3433 * Copyright(c) 2005 - 2014 Intel Corporation. All rights reserved.3434+ * Copyright(c) 2015 Intel Mobile Communications GmbH3535 * All rights reserved.3636 *3737 * Redistribution and use in source and binary forms, with or without···749747 ht_info->ht_supported = false;750748 return;751749 }750750+751751+ if (data->sku_cap_mimo_disabled)752752+ rx_chains = 1;752753753754 ht_info->ht_supported = true;754755 ht_info->cap = IEEE80211_HT_CAP_DSSSCCK40;
+3
drivers/net/wireless/iwlwifi/iwl-eeprom-parse.h
···66 * GPL LICENSE SUMMARY77 *88 * Copyright(c) 2008 - 2014 Intel Corporation. All rights reserved.99+ * Copyright(c) 2015 Intel Mobile Communications GmbH910 *1011 * This program is free software; you can redistribute it and/or modify1112 * it under the terms of version 2 of the GNU General Public License as···3231 * BSD LICENSE3332 *3433 * Copyright(c) 2005 - 2014 Intel Corporation. All rights reserved.3434+ * Copyright(c) 2015 Intel Mobile Communications GmbH3535 * All rights reserved.3636 *3737 * Redistribution and use in source and binary forms, with or without···8684 bool sku_cap_11ac_enable;8785 bool sku_cap_amt_enable;8886 bool sku_cap_ipan_enable;8787+ bool sku_cap_mimo_disabled;89889089 u16 radio_cfg_type;9190 u8 radio_cfg_step;
+24-8
drivers/net/wireless/iwlwifi/iwl-nvm-parse.c
···66 * GPL LICENSE SUMMARY77 *88 * Copyright(c) 2008 - 2014 Intel Corporation. All rights reserved.99- * Copyright(c) 2013 - 2014 Intel Mobile Communications GmbH99+ * Copyright(c) 2013 - 2015 Intel Mobile Communications GmbH1010 *1111 * This program is free software; you can redistribute it and/or modify1212 * it under the terms of version 2 of the GNU General Public License as···3232 * BSD LICENSE3333 *3434 * Copyright(c) 2005 - 2014 Intel Corporation. All rights reserved.3535- * Copyright(c) 2013 - 2014 Intel Mobile Communications GmbH3535+ * Copyright(c) 2013 - 2015 Intel Mobile Communications GmbH3636 * All rights reserved.3737 *3838 * Redistribution and use in source and binary forms, with or without···116116117117/* SKU Capabilities (actual values from NVM definition) */118118enum nvm_sku_bits {119119- NVM_SKU_CAP_BAND_24GHZ = BIT(0),120120- NVM_SKU_CAP_BAND_52GHZ = BIT(1),121121- NVM_SKU_CAP_11N_ENABLE = BIT(2),122122- NVM_SKU_CAP_11AC_ENABLE = BIT(3),119119+ NVM_SKU_CAP_BAND_24GHZ = BIT(0),120120+ NVM_SKU_CAP_BAND_52GHZ = BIT(1),121121+ NVM_SKU_CAP_11N_ENABLE = BIT(2),122122+ NVM_SKU_CAP_11AC_ENABLE = BIT(3),123123+ NVM_SKU_CAP_MIMO_DISABLE = BIT(5),123124};124125125126/*···369368 if (cfg->ht_params->ldpc)370369 vht_cap->cap |= IEEE80211_VHT_CAP_RXLDPC;371370371371+ if (data->sku_cap_mimo_disabled) {372372+ num_rx_ants = 1;373373+ num_tx_ants = 1;374374+ }375375+372376 if (num_tx_ants > 1)373377 vht_cap->cap |= IEEE80211_VHT_CAP_TXSTBC;374378 else···471465 if (cfg->device_family != IWL_DEVICE_FAMILY_8000)472466 return le16_to_cpup(nvm_sw + RADIO_CFG);473467474474- return le32_to_cpup((__le32 *)(nvm_sw + RADIO_CFG_FAMILY_8000));468468+ return le32_to_cpup((__le32 *)(phy_sku + RADIO_CFG_FAMILY_8000));475469476470}477471···533527 const u8 *hw_addr;534528535529 if (mac_override) {530530+ static const u8 reserved_mac[] = {531531+ 0x02, 0xcc, 0xaa, 0xff, 0xee, 0x00532532+ };533533+536534 hw_addr = (const u8 *)(mac_override +537535 MAC_ADDRESS_OVERRIDE_FAMILY_8000);538536···548538 data->hw_addr[4] = hw_addr[5];549539 data->hw_addr[5] = hw_addr[4];550540551551- if (is_valid_ether_addr(data->hw_addr))541541+ /*542542+ * Force the use of the OTP MAC address in case of reserved MAC543543+ * address in the NVM, or if address is given but invalid.544544+ */545545+ if (is_valid_ether_addr(data->hw_addr) &&546546+ memcmp(reserved_mac, hw_addr, ETH_ALEN) != 0)552547 return;553548554549 IWL_ERR_DEV(dev,···625610 data->sku_cap_11n_enable = false;626611 data->sku_cap_11ac_enable = data->sku_cap_11n_enable &&627612 (sku & NVM_SKU_CAP_11AC_ENABLE);613613+ data->sku_cap_mimo_disabled = sku & NVM_SKU_CAP_MIMO_DISABLE;628614629615 data->n_hw_addrs = iwl_get_n_hw_addrs(cfg, nvm_sw);630616
···17501750 int i, j, n_matches, ret;1751175117521752 fw_status = iwl_mvm_get_wakeup_status(mvm, vif);17531753- if (!IS_ERR_OR_NULL(fw_status))17531753+ if (!IS_ERR_OR_NULL(fw_status)) {17541754 reasons = le32_to_cpu(fw_status->wakeup_reasons);17551755+ kfree(fw_status);17561756+ }1755175717561758 if (reasons & IWL_WOWLAN_WAKEUP_BY_RFKILL_DEASSERTED)17571759 wakeup.rfkill_release = true;···18701868 /* get the BSS vif pointer again */18711869 vif = iwl_mvm_get_bss_vif(mvm);18721870 if (IS_ERR_OR_NULL(vif))18731873- goto out_unlock;18711871+ goto err;1874187218751873 ret = iwl_trans_d3_resume(mvm->trans, &d3_status, test);18761874 if (ret)18771877- goto out_unlock;18751875+ goto err;1878187618791877 if (d3_status != IWL_D3_STATUS_ALIVE) {18801878 IWL_INFO(mvm, "Device was reset during suspend\n");18811881- goto out_unlock;18791879+ goto err;18821880 }1883188118841882 /* query SRAM first in case we want event logging */···19041902 goto out_iterate;19051903 }1906190419071907- out_unlock:19051905+err:19061906+ iwl_mvm_free_nd(mvm);19081907 mutex_unlock(&mvm->mutex);1909190819101909out_iterate:···19181915 /* return 1 to reconfigure the device */19191916 set_bit(IWL_MVM_STATUS_IN_HW_RESTART, &mvm->status);19201917 set_bit(IWL_MVM_STATUS_D3_RECONFIG, &mvm->status);19181918+19191919+ /* We always return 1, which causes mac80211 to do a reconfig19201920+ * with IEEE80211_RECONFIG_TYPE_RESTART. This type of19211921+ * reconfig calls iwl_mvm_restart_complete(), where we unref19221922+ * the IWL_MVM_REF_UCODE_DOWN, so we need to take the19231923+ * reference here.19241924+ */19251925+ iwl_mvm_ref(mvm, IWL_MVM_REF_UCODE_DOWN);19211926 return 1;19221927}19231928···20322021 __iwl_mvm_resume(mvm, true);20332022 rtnl_unlock();20342023 iwl_abort_notification_waits(&mvm->notif_wait);20352035- iwl_mvm_ref(mvm, IWL_MVM_REF_UCODE_DOWN);20362024 ieee80211_restart_hw(mvm->hw);2037202520382026 /* wait for restart and disconnect all interfaces */
-3
drivers/net/wireless/iwlwifi/mvm/mac80211.c
···39953995 if (!iwl_fw_dbg_trigger_enabled(mvm->fw, FW_DBG_TRIGGER_MLME))39963996 return;3997399739983998- if (event->u.mlme.status == MLME_SUCCESS)39993999- return;40004000-40013998 trig = iwl_fw_dbg_get_trigger(mvm->fw, FW_DBG_TRIGGER_MLME);40023999 trig_mlme = (void *)trig->data;40034000 if (!iwl_fw_dbg_trigger_check_stop(mvm, vif, trig))
+4-2
drivers/net/wireless/iwlwifi/mvm/ops.c
···12631263 ieee80211_iterate_active_interfaces(12641264 mvm->hw, IEEE80211_IFACE_ITER_NORMAL,12651265 iwl_mvm_d0i3_disconnect_iter, mvm);12661266-12671267- iwl_free_resp(&get_status_cmd);12681266out:12691267 iwl_mvm_d0i3_enable_tx(mvm, qos_seq);12681268+12691269+ /* qos_seq might point inside resp_pkt, so free it only now */12701270+ if (get_status_cmd.resp_pkt)12711271+ iwl_free_resp(&get_status_cmd);1270127212711273 /* the FW might have updated the regdomain */12721274 iwl_mvm_update_changed_regdom(mvm);
+3
drivers/net/wireless/iwlwifi/mvm/rs.c
···180180 if (iwl_mvm_vif_low_latency(mvmvif) && mvmsta->vif->p2p)181181 return false;182182183183+ if (mvm->nvm_data->sku_cap_mimo_disabled)184184+ return false;185185+183186 return true;184187}185188
+3-3
drivers/net/wireless/iwlwifi/pcie/internal.h
···11/******************************************************************************22 *33- * Copyright(c) 2003 - 2014 Intel Corporation. All rights reserved.44- * Copyright(c) 2013 - 2014 Intel Mobile Communications GmbH33+ * Copyright(c) 2003 - 2015 Intel Corporation. All rights reserved.44+ * Copyright(c) 2013 - 2015 Intel Mobile Communications GmbH55 *66 * Portions of this file are derived from the ipw3945 project, as well77 * as portions of the ieee80211 subsystem header files.···320320321321 /*protect hw register */322322 spinlock_t reg_lock;323323- bool cmd_in_flight;323323+ bool cmd_hold_nic_awake;324324 bool ref_cmd_in_flight;325325326326 /* protect ref counter */
+7-5
drivers/net/wireless/iwlwifi/pcie/trans.c
···10491049 iwl_pcie_rx_stop(trans);1050105010511051 /* Power-down device's busmaster DMA clocks */10521052- iwl_write_prph(trans, APMG_CLK_DIS_REG,10531053- APMG_CLK_VAL_DMA_CLK_RQT);10541054- udelay(5);10521052+ if (trans->cfg->device_family != IWL_DEVICE_FAMILY_8000) {10531053+ iwl_write_prph(trans, APMG_CLK_DIS_REG,10541054+ APMG_CLK_VAL_DMA_CLK_RQT);10551055+ udelay(5);10561056+ }10551057 }1056105810571059 /* Make sure (redundant) we've released our request to stay awake */···1372137013731371 spin_lock_irqsave(&trans_pcie->reg_lock, *flags);1374137213751375- if (trans_pcie->cmd_in_flight)13731373+ if (trans_pcie->cmd_hold_nic_awake)13761374 goto out;1377137513781376 /* this bit wakes up the NIC */···14381436 */14391437 __acquire(&trans_pcie->reg_lock);1440143814411441- if (trans_pcie->cmd_in_flight)14391439+ if (trans_pcie->cmd_hold_nic_awake)14421440 goto out;1443144114441442 __iwl_trans_pcie_clear_bit(trans, CSR_GP_CNTRL,
+9-14
drivers/net/wireless/iwlwifi/pcie/tx.c
···10391039 iwl_trans_pcie_ref(trans);10401040 }1041104110421042- if (trans_pcie->cmd_in_flight)10431043- return 0;10441044-10451045- trans_pcie->cmd_in_flight = true;10461046-10471042 /*10481043 * wake up the NIC to make sure that the firmware will see the host10491044 * command - we will let the NIC sleep once all the host commands10501045 * returned. This needs to be done only on NICs that have10511046 * apmg_wake_up_wa set.10521047 */10531053- if (trans->cfg->base_params->apmg_wake_up_wa) {10481048+ if (trans->cfg->base_params->apmg_wake_up_wa &&10491049+ !trans_pcie->cmd_hold_nic_awake) {10541050 __iwl_trans_pcie_set_bit(trans, CSR_GP_CNTRL,10551051 CSR_GP_CNTRL_REG_FLAG_MAC_ACCESS_REQ);10561052 if (trans->cfg->device_family == IWL_DEVICE_FAMILY_8000)···10601064 if (ret < 0) {10611065 __iwl_trans_pcie_clear_bit(trans, CSR_GP_CNTRL,10621066 CSR_GP_CNTRL_REG_FLAG_MAC_ACCESS_REQ);10631063- trans_pcie->cmd_in_flight = false;10641067 IWL_ERR(trans, "Failed to wake NIC for hcmd\n");10651068 return -EIO;10661069 }10701070+ trans_pcie->cmd_hold_nic_awake = true;10671071 }1068107210691073 return 0;···10811085 iwl_trans_pcie_unref(trans);10821086 }1083108710841084- if (WARN_ON(!trans_pcie->cmd_in_flight))10851085- return 0;10881088+ if (trans->cfg->base_params->apmg_wake_up_wa) {10891089+ if (WARN_ON(!trans_pcie->cmd_hold_nic_awake))10901090+ return 0;1086109110871087- trans_pcie->cmd_in_flight = false;10881088-10891089- if (trans->cfg->base_params->apmg_wake_up_wa)10921092+ trans_pcie->cmd_hold_nic_awake = false;10901093 __iwl_trans_pcie_clear_bit(trans, CSR_GP_CNTRL,10911091- CSR_GP_CNTRL_REG_FLAG_MAC_ACCESS_REQ);10921092-10941094+ CSR_GP_CNTRL_REG_FLAG_MAC_ACCESS_REQ);10951095+ }10931096 return 0;10941097}10951098
···12921292 chv_gpio_irq_mask_unmask(d, false);12931293}1294129412951295+static unsigned chv_gpio_irq_startup(struct irq_data *d)12961296+{12971297+ /*12981298+ * Check if the interrupt has been requested with 0 as triggering12991299+ * type. In that case it is assumed that the current values13001300+ * programmed to the hardware are used (e.g BIOS configured13011301+ * defaults).13021302+ *13031303+ * In that case ->irq_set_type() will never be called so we need to13041304+ * read back the values from hardware now, set correct flow handler13051305+ * and update mappings before the interrupt is being used.13061306+ */13071307+ if (irqd_get_trigger_type(d) == IRQ_TYPE_NONE) {13081308+ struct gpio_chip *gc = irq_data_get_irq_chip_data(d);13091309+ struct chv_pinctrl *pctrl = gpiochip_to_pinctrl(gc);13101310+ unsigned offset = irqd_to_hwirq(d);13111311+ int pin = chv_gpio_offset_to_pin(pctrl, offset);13121312+ irq_flow_handler_t handler;13131313+ unsigned long flags;13141314+ u32 intsel, value;13151315+13161316+ intsel = readl(chv_padreg(pctrl, pin, CHV_PADCTRL0));13171317+ intsel &= CHV_PADCTRL0_INTSEL_MASK;13181318+ intsel >>= CHV_PADCTRL0_INTSEL_SHIFT;13191319+13201320+ value = readl(chv_padreg(pctrl, pin, CHV_PADCTRL1));13211321+ if (value & CHV_PADCTRL1_INTWAKECFG_LEVEL)13221322+ handler = handle_level_irq;13231323+ else13241324+ handler = handle_edge_irq;13251325+13261326+ spin_lock_irqsave(&pctrl->lock, flags);13271327+ if (!pctrl->intr_lines[intsel]) {13281328+ __irq_set_handler_locked(d->irq, handler);13291329+ pctrl->intr_lines[intsel] = offset;13301330+ }13311331+ spin_unlock_irqrestore(&pctrl->lock, flags);13321332+ }13331333+13341334+ chv_gpio_irq_unmask(d);13351335+ return 0;13361336+}13371337+12951338static int chv_gpio_irq_type(struct irq_data *d, unsigned type)12961339{12971340 struct gpio_chip *gc = irq_data_get_irq_chip_data(d);···1400135714011358static struct irq_chip chv_gpio_irqchip = {14021359 .name = "chv-gpio",13601360+ .irq_startup = chv_gpio_irq_startup,14031361 .irq_ack = chv_gpio_irq_ack,14041362 .irq_mask = chv_gpio_irq_mask,14051363 .irq_unmask = chv_gpio_irq_unmask,
···11581158 poll_timeout = time;11591159 hr_time = ktime_set(0, poll_timeout);1160116011611161- if (!hrtimer_is_queued(&ap_poll_timer) ||11621162- !hrtimer_forward(&ap_poll_timer, hrtimer_get_expires(&ap_poll_timer), hr_time)) {11631163- hrtimer_set_expires(&ap_poll_timer, hr_time);11641164- hrtimer_start_expires(&ap_poll_timer, HRTIMER_MODE_ABS);11651165- }11611161+ spin_lock_bh(&ap_poll_timer_lock);11621162+ hrtimer_cancel(&ap_poll_timer);11631163+ hrtimer_set_expires(&ap_poll_timer, hr_time);11641164+ hrtimer_start_expires(&ap_poll_timer, HRTIMER_MODE_ABS);11651165+ spin_unlock_bh(&ap_poll_timer_lock);11661166+11661167 return count;11671168}11681169···15291528 ktime_t hr_time;1530152915311530 spin_lock_bh(&ap_poll_timer_lock);15321532- if (hrtimer_is_queued(&ap_poll_timer) || ap_suspend_flag)15331533- goto out;15341534- if (ktime_to_ns(hrtimer_expires_remaining(&ap_poll_timer)) <= 0) {15311531+ if (!hrtimer_is_queued(&ap_poll_timer) && !ap_suspend_flag) {15351532 hr_time = ktime_set(0, poll_timeout);15361533 hrtimer_forward_now(&ap_poll_timer, hr_time);15371534 hrtimer_restart(&ap_poll_timer);15381535 }15391539-out:15401536 spin_unlock_bh(&ap_poll_timer_lock);15411537}15421538···19501952{19511953 int i;1952195419531953- if (ap_domain_index != -1)19551955+ if ((ap_domain_index != -1) && (ap_test_config_domain(ap_domain_index)))19541956 for (i = 0; i < AP_DEVICES; i++)19551957 ap_reset_queue(AP_MKQID(i, ap_domain_index));19561958}···20952097 hrtimer_cancel(&ap_poll_timer);20962098 destroy_workqueue(ap_work_queue);20972099 tasklet_kill(&ap_tasklet);20982098- root_device_unregister(ap_root_device);20992100 while ((dev = bus_find_device(&ap_bus_type, NULL, NULL,21002101 __ap_match_all)))21012102 {···21032106 }21042107 for (i = 0; ap_bus_attrs[i]; i++)21052108 bus_remove_file(&ap_bus_type, ap_bus_attrs[i]);21092109+ root_device_unregister(ap_root_device);21062110 bus_unregister(&ap_bus_type);21072111 unregister_reset_call(&ap_reset_call);21082112 if (ap_using_interrupts())
+3-3
drivers/scsi/be2iscsi/be.h
···11/**22- * Copyright (C) 2005 - 2014 Emulex22+ * Copyright (C) 2005 - 2015 Avago Technologies33 * All rights reserved.44 *55 * This program is free software; you can redistribute it and/or···88 * Public License is included in this distribution in the file called COPYING.99 *1010 * Contact Information:1111- * linux-drivers@emulex.com1111+ * linux-drivers@avagotech.com1212 *1313- * Emulex1313+ * Avago Technologies1414 * 3333 Susan Street1515 * Costa Mesa, CA 926261616 */
+3-3
drivers/scsi/be2iscsi/be_cmds.c
···11/**22- * Copyright (C) 2005 - 2014 Emulex22+ * Copyright (C) 2005 - 2015 Avago Technologies33 * All rights reserved.44 *55 * This program is free software; you can redistribute it and/or···88 * Public License is included in this distribution in the file called COPYING.99 *1010 * Contact Information:1111- * linux-drivers@emulex.com1111+ * linux-drivers@avagotech.com1212 *1313- * Emulex1313+ * Avago Technologies1414 * 3333 Susan Street1515 * Costa Mesa, CA 926261616 */
+3-3
drivers/scsi/be2iscsi/be_cmds.h
···11/**22- * Copyright (C) 2005 - 2014 Emulex22+ * Copyright (C) 2005 - 2015 Avago Technologies33 * All rights reserved.44 *55 * This program is free software; you can redistribute it and/or···88 * Public License is included in this distribution in the file called COPYING.99 *1010 * Contact Information:1111- * linux-drivers@emulex.com1111+ * linux-drivers@avagotech.com1212 *1313- * Emulex1313+ * Avago Technologies1414 * 3333 Susan Street1515 * Costa Mesa, CA 926261616 */
+4-4
drivers/scsi/be2iscsi/be_iscsi.c
···11/**22- * Copyright (C) 2005 - 2014 Emulex22+ * Copyright (C) 2005 - 2015 Avago Technologies33 * All rights reserved.44 *55 * This program is free software; you can redistribute it and/or···77 * as published by the Free Software Foundation. The full GNU General88 * Public License is included in this distribution in the file called COPYING.99 *1010- * Written by: Jayamohan Kallickal (jayamohan.kallickal@emulex.com)1010+ * Written by: Jayamohan Kallickal (jayamohan.kallickal@avagotech.com)1111 *1212 * Contact Information:1313- * linux-drivers@emulex.com1313+ * linux-drivers@avagotech.com1414 *1515- * Emulex1515+ * Avago Technologies1616 * 3333 Susan Street1717 * Costa Mesa, CA 926261818 */
+4-4
drivers/scsi/be2iscsi/be_iscsi.h
···11/**22- * Copyright (C) 2005 - 2014 Emulex22+ * Copyright (C) 2005 - 2015 Avago Technologies33 * All rights reserved.44 *55 * This program is free software; you can redistribute it and/or···77 * as published by the Free Software Foundation. The full GNU General88 * Public License is included in this distribution in the file called COPYING.99 *1010- * Written by: Jayamohan Kallickal (jayamohan.kallickal@emulex.com)1010+ * Written by: Jayamohan Kallickal (jayamohan.kallickal@avagotech.com)1111 *1212 * Contact Information:1313- * linux-drivers@emulex.com1313+ * linux-drivers@avagotech.com1414 *1515- * Emulex1515+ * Avago Technologies1616 * 3333 Susan Street1717 * Costa Mesa, CA 926261818 */
+6-6
drivers/scsi/be2iscsi/be_main.c
···11/**22- * Copyright (C) 2005 - 2014 Emulex22+ * Copyright (C) 2005 - 2015 Avago Technologies33 * All rights reserved.44 *55 * This program is free software; you can redistribute it and/or···77 * as published by the Free Software Foundation. The full GNU General88 * Public License is included in this distribution in the file called COPYING.99 *1010- * Written by: Jayamohan Kallickal (jayamohan.kallickal@emulex.com)1010+ * Written by: Jayamohan Kallickal (jayamohan.kallickal@avagotech.com)1111 *1212 * Contact Information:1313- * linux-drivers@emulex.com1313+ * linux-drivers@avagotech.com1414 *1515- * Emulex1515+ * Avago Technologies1616 * 3333 Susan Street1717 * Costa Mesa, CA 926261818 */···50505151MODULE_DESCRIPTION(DRV_DESC " " BUILD_STR);5252MODULE_VERSION(BUILD_STR);5353-MODULE_AUTHOR("Emulex Corporation");5353+MODULE_AUTHOR("Avago Technologies");5454MODULE_LICENSE("GPL");5555module_param(be_iopoll_budget, int, 0);5656module_param(enable_msix, int, 0);···552552553553static struct scsi_host_template beiscsi_sht = {554554 .module = THIS_MODULE,555555- .name = "Emulex 10Gbe open-iscsi Initiator Driver",555555+ .name = "Avago Technologies 10Gbe open-iscsi Initiator Driver",556556 .proc_name = DRV_NAME,557557 .queuecommand = iscsi_queuecommand,558558 .change_queue_depth = scsi_change_queue_depth,
+5-5
drivers/scsi/be2iscsi/be_main.h
···11/**22- * Copyright (C) 2005 - 2014 Emulex22+ * Copyright (C) 2005 - 2015 Avago Technologies33 * All rights reserved.44 *55 * This program is free software; you can redistribute it and/or···77 * as published by the Free Software Foundation. The full GNU General88 * Public License is included in this distribution in the file called COPYING.99 *1010- * Written by: Jayamohan Kallickal (jayamohan.kallickal@emulex.com)1010+ * Written by: Jayamohan Kallickal (jayamohan.kallickal@avagotech.com)1111 *1212 * Contact Information:1313- * linux-drivers@emulex.com1313+ * linux-drivers@avagotech.com1414 *1515- * Emulex1515+ * Avago Technologies1616 * 3333 Susan Street1717 * Costa Mesa, CA 926261818 */···37373838#define DRV_NAME "be2iscsi"3939#define BUILD_STR "10.4.114.0"4040-#define BE_NAME "Emulex OneConnect" \4040+#define BE_NAME "Avago Technologies OneConnect" \4141 "Open-iSCSI Driver version" BUILD_STR4242#define DRV_DESC BE_NAME " " "Driver"4343
+4-4
drivers/scsi/be2iscsi/be_mgmt.c
···11/**22- * Copyright (C) 2005 - 2014 Emulex22+ * Copyright (C) 2005 - 2015 Avago Technologies33 * All rights reserved.44 *55 * This program is free software; you can redistribute it and/or···77 * as published by the Free Software Foundation. The full GNU General88 * Public License is included in this distribution in the file called COPYING.99 *1010- * Written by: Jayamohan Kallickal (jayamohan.kallickal@emulex.com)1010+ * Written by: Jayamohan Kallickal (jayamohan.kallickal@avagotech.com)1111 *1212 * Contact Information:1313- * linux-drivers@emulex.com1313+ * linux-drivers@avagotech.com1414 *1515- * Emulex1515+ * Avago Technologies1616 * 3333 Susan Street1717 * Costa Mesa, CA 926261818 */
+4-4
drivers/scsi/be2iscsi/be_mgmt.h
···11/**22- * Copyright (C) 2005 - 2014 Emulex22+ * Copyright (C) 2005 - 2015 Avago Technologies33 * All rights reserved.44 *55 * This program is free software; you can redistribute it and/or···77 * as published by the Free Software Foundation. The full GNU General88 * Public License is included in this distribution in the file called COPYING.99 *1010- * Written by: Jayamohan Kallickal (jayamohan.kallickal@emulex.com)1010+ * Written by: Jayamohan Kallickal (jayamohan.kallickal@avagotech.com)1111 *1212 * Contact Information:1313- * linux-drivers@emulex.com1313+ * linux-drivers@avagotech.com1414 *1515- * Emulex1515+ * Avago Technologies1616 * 3333 Susan Street1717 * Costa Mesa, CA 926261818 */
+21-20
drivers/scsi/lpfc/lpfc_scsi.c
···11301130}1131113111321132/**11331133- * lpfc_fcpcmd_to_iocb - copy the fcp_cmd data into the IOCB11341134- * @data: A pointer to the immediate command data portion of the IOCB.11351135- * @fcp_cmnd: The FCP Command that is provided by the SCSI layer.11361136- *11371137- * The routine copies the entire FCP command from @fcp_cmnd to @data while11381138- * byte swapping the data to big endian format for transmission on the wire.11391139- **/11401140-static void11411141-lpfc_fcpcmd_to_iocb(uint8_t *data, struct fcp_cmnd *fcp_cmnd)11421142-{11431143- int i, j;11441144-11451145- for (i = 0, j = 0; i < sizeof(struct fcp_cmnd);11461146- i += sizeof(uint32_t), j++) {11471147- ((uint32_t *)data)[j] = cpu_to_be32(((uint32_t *)fcp_cmnd)[j]);11481148- }11491149-}11501150-11511151-/**11521133 * lpfc_scsi_prep_dma_buf_s3 - DMA mapping for scsi buffer to SLI3 IF spec11531134 * @phba: The Hba for which this call is being executed.11541135 * @lpfc_cmd: The scsi buffer which is going to be mapped.···12641283 * we need to set word 4 of IOCB here12651284 */12661285 iocb_cmd->un.fcpi.fcpi_parm = scsi_bufflen(scsi_cmnd);12671267- lpfc_fcpcmd_to_iocb(iocb_cmd->unsli3.fcp_ext.icd, fcp_cmnd);12681286 return 0;12691287}12701288···41274147}4128414841294149/**41504150+ * lpfc_fcpcmd_to_iocb - copy the fcp_cmd data into the IOCB41514151+ * @data: A pointer to the immediate command data portion of the IOCB.41524152+ * @fcp_cmnd: The FCP Command that is provided by the SCSI layer.41534153+ *41544154+ * The routine copies the entire FCP command from @fcp_cmnd to @data while41554155+ * byte swapping the data to big endian format for transmission on the wire.41564156+ **/41574157+static void41584158+lpfc_fcpcmd_to_iocb(uint8_t *data, struct fcp_cmnd *fcp_cmnd)41594159+{41604160+ int i, j;41614161+ for (i = 0, j = 0; i < sizeof(struct fcp_cmnd);41624162+ i += sizeof(uint32_t), j++) {41634163+ ((uint32_t *)data)[j] = cpu_to_be32(((uint32_t *)fcp_cmnd)[j]);41644164+ }41654165+}41664166+41674167+/**41304168 * lpfc_scsi_prep_cmnd - Wrapper func for convert scsi cmnd to FCP info unit41314169 * @vport: The virtual port for which this call is being executed.41324170 * @lpfc_cmd: The scsi command which needs to send.···42234225 fcp_cmnd->fcpCntl3 = 0;42244226 phba->fc4ControlRequests++;42254227 }42284228+ if (phba->sli_rev == 3 &&42294229+ !(phba->sli3_options & LPFC_SLI3_BG_ENABLED))42304230+ lpfc_fcpcmd_to_iocb(iocb_cmd->unsli3.fcp_ext.icd, fcp_cmnd);42264231 /*42274232 * Finish initializing those IOCB fields that are independent42284233 * of the scsi_cmnd request_buffer
···359359360360 /*361361 * Accessing PCI config without a proper delay after devices reset (not362362- * GPIO reset) was causing reboots on WRT300N v1.0.362362+ * GPIO reset) was causing reboots on WRT300N v1.0 (BCM4704).363363 * Tested delay 850 us lowered reboot chance to 50-80%, 1000 us fixed it364364 * completely. Flushing all writes was also tested but with no luck.365365+ * The same problem was reported for WRT350N v1 (BCM4705), so we just366366+ * sleep here unconditionally.365367 */366366- if (pc->dev->bus->chip_id == 0x4704)367367- usleep_range(1000, 2000);368368+ usleep_range(1000, 2000);368369369370 /* Enable PCI bridge BAR0 prefetch and burst */370371 val = PCI_COMMAND_MASTER | PCI_COMMAND_MEMORY;
+1-1
drivers/target/iscsi/iscsi_target.c
···230230 * Here we serialize access across the TIQN+TPG Tuple.231231 */232232 ret = down_interruptible(&tpg->np_login_sem);233233- if ((ret != 0) || signal_pending(current))233233+ if (ret != 0)234234 return -1;235235236236 spin_lock_bh(&tpg->tpg_state_lock);
···704704705705 if (dev->se_hba->hba_flags & HBA_FLAGS_INTERNAL_USE)706706 return 0;707707- if (dev->transport->transport_type == TRANSPORT_PLUGIN_PHBA_PDEV)707707+ if (dev->transport->transport_flags & TRANSPORT_FLAG_PASSTHROUGH)708708 return 0;709709710710 if (!port)···2377237723782378int core_setup_alua(struct se_device *dev)23792379{23802380- if (dev->transport->transport_type != TRANSPORT_PLUGIN_PHBA_PDEV &&23802380+ if (!(dev->transport->transport_flags & TRANSPORT_FLAG_PASSTHROUGH) &&23812381 !(dev->se_hba->hba_flags & HBA_FLAGS_INTERNAL_USE)) {23822382 struct t10_alua_lu_gp_member *lu_gp_mem;23832383
+19-21
drivers/target/target_core_configfs.c
···212212213213 pr_debug("Target_Core_ConfigFS: REGISTER -> Allocated Fabric:"214214 " %s\n", tf->tf_group.cg_item.ci_name);215215- /*216216- * Setup tf_ops.tf_subsys pointer for usage with configfs_depend_item()217217- */218218- tf->tf_ops.tf_subsys = tf->tf_subsys;219215 tf->tf_fabric = &tf->tf_group.cg_item;220216 pr_debug("Target_Core_ConfigFS: REGISTER -> Set tf->tf_fabric"221217 " for %s\n", name);···287291 },288292};289293290290-struct configfs_subsystem *target_core_subsystem[] = {291291- &target_core_fabrics,292292- NULL,293293-};294294+int target_depend_item(struct config_item *item)295295+{296296+ return configfs_depend_item(&target_core_fabrics, item);297297+}298298+EXPORT_SYMBOL(target_depend_item);299299+300300+void target_undepend_item(struct config_item *item)301301+{302302+ return configfs_undepend_item(&target_core_fabrics, item);303303+}304304+EXPORT_SYMBOL(target_undepend_item);294305295306/*##############################################################################296307// Start functions called by external Target Fabrics Modules···470467 * struct target_fabric_configfs->tf_cit_tmpl471468 */472469 tf->tf_module = fo->module;473473- tf->tf_subsys = target_core_subsystem[0];474470 snprintf(tf->tf_name, TARGET_FABRIC_NAME_SIZE, "%s", fo->name);475471476472 tf->tf_ops = *fo;···811809{812810 int ret;813811814814- if (dev->transport->transport_type == TRANSPORT_PLUGIN_PHBA_PDEV)812812+ if (dev->transport->transport_flags & TRANSPORT_FLAG_PASSTHROUGH)815813 return sprintf(page, "Passthrough\n");816814817815 spin_lock(&dev->dev_reservation_lock);···962960static ssize_t target_core_dev_pr_show_attr_res_type(963961 struct se_device *dev, char *page)964962{965965- if (dev->transport->transport_type == TRANSPORT_PLUGIN_PHBA_PDEV)963963+ if (dev->transport->transport_flags & TRANSPORT_FLAG_PASSTHROUGH)966964 return sprintf(page, "SPC_PASSTHROUGH\n");967965 else if (dev->dev_reservation_flags & DRF_SPC2_RESERVATIONS)968966 return sprintf(page, "SPC2_RESERVATIONS\n");···975973static ssize_t target_core_dev_pr_show_attr_res_aptpl_active(976974 struct se_device *dev, char *page)977975{978978- if (dev->transport->transport_type == TRANSPORT_PLUGIN_PHBA_PDEV)976976+ if (dev->transport->transport_flags & TRANSPORT_FLAG_PASSTHROUGH)979977 return 0;980978981979 return sprintf(page, "APTPL Bit Status: %s\n",···990988static ssize_t target_core_dev_pr_show_attr_res_aptpl_metadata(991989 struct se_device *dev, char *page)992990{993993- if (dev->transport->transport_type == TRANSPORT_PLUGIN_PHBA_PDEV)991991+ if (dev->transport->transport_flags & TRANSPORT_FLAG_PASSTHROUGH)994992 return 0;995993996994 return sprintf(page, "Ready to process PR APTPL metadata..\n");···10371035 u16 port_rpti = 0, tpgt = 0;10381036 u8 type = 0, scope;1039103710401040- if (dev->transport->transport_type == TRANSPORT_PLUGIN_PHBA_PDEV)10381038+ if (dev->transport->transport_flags & TRANSPORT_FLAG_PASSTHROUGH)10411039 return 0;10421040 if (dev->dev_reservation_flags & DRF_SPC2_RESERVATIONS)10431041 return 0;···28722870{28732871 struct config_group *target_cg, *hba_cg = NULL, *alua_cg = NULL;28742872 struct config_group *lu_gp_cg = NULL;28752875- struct configfs_subsystem *subsys;28732873+ struct configfs_subsystem *subsys = &target_core_fabrics;28762874 struct t10_alua_lu_gp *lu_gp;28772875 int ret;28782876···28802878 " Engine: %s on %s/%s on "UTS_RELEASE"\n",28812879 TARGET_CORE_VERSION, utsname()->sysname, utsname()->machine);2882288028832883- subsys = target_core_subsystem[0];28842881 config_group_init(&subsys->su_group);28852882 mutex_init(&subsys->su_mutex);28862883···3009300830103009static void __exit target_core_exit_configfs(void)30113010{30123012- struct configfs_subsystem *subsys;30133011 struct config_group *hba_cg, *alua_cg, *lu_gp_cg;30143012 struct config_item *item;30153013 int i;30163016-30173017- subsys = target_core_subsystem[0];3018301430193015 lu_gp_cg = &alua_lu_gps_group;30203016 for (i = 0; lu_gp_cg->default_groups[i]; i++) {···30433045 * We expect subsys->su_group.default_groups to be released30443046 * by configfs subsystem provider logic..30453047 */30463046- configfs_unregister_subsystem(subsys);30473047- kfree(subsys->su_group.default_groups);30483048+ configfs_unregister_subsystem(&target_core_fabrics);30493049+ kfree(target_core_fabrics.su_group.default_groups);3048305030493051 core_alua_free_lu_gp(default_lu_gp);30503052 default_lu_gp = NULL;
+76-2
drivers/target/target_core_device.c
···3333#include <linux/kthread.h>3434#include <linux/in.h>3535#include <linux/export.h>3636+#include <asm/unaligned.h>3637#include <net/sock.h>3738#include <net/tcp.h>3839#include <scsi/scsi.h>···528527 list_add_tail(&port->sep_list, &dev->dev_sep_list);529528 spin_unlock(&dev->se_port_lock);530529531531- if (dev->transport->transport_type != TRANSPORT_PLUGIN_PHBA_PDEV &&530530+ if (!(dev->transport->transport_flags & TRANSPORT_FLAG_PASSTHROUGH) &&532531 !(dev->se_hba->hba_flags & HBA_FLAGS_INTERNAL_USE)) {533532 tg_pt_gp_mem = core_alua_allocate_tg_pt_gp_mem(port);534533 if (IS_ERR(tg_pt_gp_mem) || !tg_pt_gp_mem) {···16041603 * anything virtual (IBLOCK, FILEIO, RAMDISK), but not for TCM/pSCSI16051604 * passthrough because this is being provided by the backend LLD.16061605 */16071607- if (dev->transport->transport_type != TRANSPORT_PLUGIN_PHBA_PDEV) {16061606+ if (!(dev->transport->transport_flags & TRANSPORT_FLAG_PASSTHROUGH)) {16081607 strncpy(&dev->t10_wwn.vendor[0], "LIO-ORG", 8);16091608 strncpy(&dev->t10_wwn.model[0],16101609 dev->transport->inquiry_prod, 16);···17081707 target_free_device(g_lun0_dev);17091708 core_delete_hba(hba);17101709}17101710+17111711+/*17121712+ * Common CDB parsing for kernel and user passthrough.17131713+ */17141714+sense_reason_t17151715+passthrough_parse_cdb(struct se_cmd *cmd,17161716+ sense_reason_t (*exec_cmd)(struct se_cmd *cmd))17171717+{17181718+ unsigned char *cdb = cmd->t_task_cdb;17191719+17201720+ /*17211721+ * Clear a lun set in the cdb if the initiator talking to use spoke17221722+ * and old standards version, as we can't assume the underlying device17231723+ * won't choke up on it.17241724+ */17251725+ switch (cdb[0]) {17261726+ case READ_10: /* SBC - RDProtect */17271727+ case READ_12: /* SBC - RDProtect */17281728+ case READ_16: /* SBC - RDProtect */17291729+ case SEND_DIAGNOSTIC: /* SPC - SELF-TEST Code */17301730+ case VERIFY: /* SBC - VRProtect */17311731+ case VERIFY_16: /* SBC - VRProtect */17321732+ case WRITE_VERIFY: /* SBC - VRProtect */17331733+ case WRITE_VERIFY_12: /* SBC - VRProtect */17341734+ case MAINTENANCE_IN: /* SPC - Parameter Data Format for SA RTPG */17351735+ break;17361736+ default:17371737+ cdb[1] &= 0x1f; /* clear logical unit number */17381738+ break;17391739+ }17401740+17411741+ /*17421742+ * For REPORT LUNS we always need to emulate the response, for everything17431743+ * else, pass it up.17441744+ */17451745+ if (cdb[0] == REPORT_LUNS) {17461746+ cmd->execute_cmd = spc_emulate_report_luns;17471747+ return TCM_NO_SENSE;17481748+ }17491749+17501750+ /* Set DATA_CDB flag for ops that should have it */17511751+ switch (cdb[0]) {17521752+ case READ_6:17531753+ case READ_10:17541754+ case READ_12:17551755+ case READ_16:17561756+ case WRITE_6:17571757+ case WRITE_10:17581758+ case WRITE_12:17591759+ case WRITE_16:17601760+ case WRITE_VERIFY:17611761+ case WRITE_VERIFY_12:17621762+ case 0x8e: /* WRITE_VERIFY_16 */17631763+ case COMPARE_AND_WRITE:17641764+ case XDWRITEREAD_10:17651765+ cmd->se_cmd_flags |= SCF_SCSI_DATA_CDB;17661766+ break;17671767+ case VARIABLE_LENGTH_CMD:17681768+ switch (get_unaligned_be16(&cdb[8])) {17691769+ case READ_32:17701770+ case WRITE_32:17711771+ case 0x0c: /* WRITE_VERIFY_32 */17721772+ case XDWRITEREAD_32:17731773+ cmd->se_cmd_flags |= SCF_SCSI_DATA_CDB;17741774+ break;17751775+ }17761776+ }17771777+17781778+ cmd->execute_cmd = exec_cmd;17791779+17801780+ return TCM_NO_SENSE;17811781+}17821782+EXPORT_SYMBOL(passthrough_parse_cdb);
···521521 " pdv_host_id: %d\n", pdv->pdv_host_id);522522 return -EINVAL;523523 }524524+ pdv->pdv_lld_host = sh;524525 }525526 } else {526527 if (phv->phv_mode == PHV_VIRTUAL_HOST_ID) {···604603 if ((phv->phv_mode == PHV_LLD_SCSI_HOST_NO) &&605604 (phv->phv_lld_host != NULL))606605 scsi_host_put(phv->phv_lld_host);606606+ else if (pdv->pdv_lld_host)607607+ scsi_host_put(pdv->pdv_lld_host);607608608609 if ((sd->type == TYPE_DISK) || (sd->type == TYPE_ROM))609610 scsi_device_put(sd);···973970 return TCM_LOGICAL_UNIT_COMMUNICATION_FAILURE;974971}975972976976-/*977977- * Clear a lun set in the cdb if the initiator talking to use spoke978978- * and old standards version, as we can't assume the underlying device979979- * won't choke up on it.980980- */981981-static inline void pscsi_clear_cdb_lun(unsigned char *cdb)982982-{983983- switch (cdb[0]) {984984- case READ_10: /* SBC - RDProtect */985985- case READ_12: /* SBC - RDProtect */986986- case READ_16: /* SBC - RDProtect */987987- case SEND_DIAGNOSTIC: /* SPC - SELF-TEST Code */988988- case VERIFY: /* SBC - VRProtect */989989- case VERIFY_16: /* SBC - VRProtect */990990- case WRITE_VERIFY: /* SBC - VRProtect */991991- case WRITE_VERIFY_12: /* SBC - VRProtect */992992- case MAINTENANCE_IN: /* SPC - Parameter Data Format for SA RTPG */993993- break;994994- default:995995- cdb[1] &= 0x1f; /* clear logical unit number */996996- break;997997- }998998-}999999-1000973static sense_reason_t1001974pscsi_parse_cdb(struct se_cmd *cmd)1002975{10031003- unsigned char *cdb = cmd->t_task_cdb;10041004-1005976 if (cmd->se_cmd_flags & SCF_BIDI)1006977 return TCM_UNSUPPORTED_SCSI_OPCODE;100797810081008- pscsi_clear_cdb_lun(cdb);10091009-10101010- /*10111011- * For REPORT LUNS we always need to emulate the response, for everything10121012- * else the default for pSCSI is to pass the command to the underlying10131013- * LLD / physical hardware.10141014- */10151015- switch (cdb[0]) {10161016- case REPORT_LUNS:10171017- cmd->execute_cmd = spc_emulate_report_luns;10181018- return 0;10191019- case READ_6:10201020- case READ_10:10211021- case READ_12:10221022- case READ_16:10231023- case WRITE_6:10241024- case WRITE_10:10251025- case WRITE_12:10261026- case WRITE_16:10271027- case WRITE_VERIFY:10281028- cmd->se_cmd_flags |= SCF_SCSI_DATA_CDB;10291029- /* FALLTHROUGH*/10301030- default:10311031- cmd->execute_cmd = pscsi_execute_cmd;10321032- return 0;10331033- }979979+ return passthrough_parse_cdb(cmd, pscsi_execute_cmd);1034980}10359811036982static sense_reason_t···11411189static struct se_subsystem_api pscsi_template = {11421190 .name = "pscsi",11431191 .owner = THIS_MODULE,11441144- .transport_type = TRANSPORT_PLUGIN_PHBA_PDEV,11921192+ .transport_flags = TRANSPORT_FLAG_PASSTHROUGH,11451193 .attach_hba = pscsi_attach_hba,11461194 .detach_hba = pscsi_detach_hba,11471195 .pmode_enable_hba = pscsi_pmode_enable_hba,
···119119}120120121121/**122122+ * ti_errata814_bandgap_read_temp() - helper function to read dra7 sensor temperature123123+ * @bgp: pointer to ti_bandgap structure124124+ * @reg: desired register (offset) to be read125125+ *126126+ * Function to read dra7 bandgap sensor temperature. This is done separately127127+ * so as to workaround the errata "Bandgap Temperature read Dtemp can be128128+ * corrupted" - Errata ID: i814".129129+ * Read accesses to registers listed below can be corrupted due to incorrect130130+ * resynchronization between clock domains.131131+ * Read access to registers below can be corrupted :132132+ * CTRL_CORE_DTEMP_MPU/GPU/CORE/DSPEVE/IVA_n (n = 0 to 4)133133+ * CTRL_CORE_TEMP_SENSOR_MPU/GPU/CORE/DSPEVE/IVA_n134134+ *135135+ * Return: the register value.136136+ */137137+static u32 ti_errata814_bandgap_read_temp(struct ti_bandgap *bgp, u32 reg)138138+{139139+ u32 val1, val2;140140+141141+ val1 = ti_bandgap_readl(bgp, reg);142142+ val2 = ti_bandgap_readl(bgp, reg);143143+144144+ /* If both times we read the same value then that is right */145145+ if (val1 == val2)146146+ return val1;147147+148148+ /* if val1 and val2 are different read it third time */149149+ return ti_bandgap_readl(bgp, reg);150150+}151151+152152+/**122153 * ti_bandgap_read_temp() - helper function to read sensor temperature123154 * @bgp: pointer to ti_bandgap structure124155 * @id: bandgap sensor id···179148 }180149181150 /* read temperature */182182- temp = ti_bandgap_readl(bgp, reg);151151+ if (TI_BANDGAP_HAS(bgp, ERRATA_814))152152+ temp = ti_errata814_bandgap_read_temp(bgp, reg);153153+ else154154+ temp = ti_bandgap_readl(bgp, reg);155155+183156 temp &= tsr->bgap_dtemp_mask;184157185158 if (TI_BANDGAP_HAS(bgp, FREEZE_BIT))···445410{446411 struct temp_sensor_data *ts_data = bgp->conf->sensors[id].ts_data;447412 struct temp_sensor_registers *tsr;448448- u32 thresh_val, reg_val, t_hot, t_cold;413413+ u32 thresh_val, reg_val, t_hot, t_cold, ctrl;449414 int err = 0;450415451416 tsr = bgp->conf->sensors[id].registers;···477442 ~(tsr->threshold_thot_mask | tsr->threshold_tcold_mask);478443 reg_val |= (t_hot << __ffs(tsr->threshold_thot_mask)) |479444 (t_cold << __ffs(tsr->threshold_tcold_mask));445445+446446+ /**447447+ * Errata i813:448448+ * Spurious Thermal Alert: Talert can happen randomly while the device449449+ * remains under the temperature limit defined for this event to trig.450450+ * This spurious event is caused by a incorrect re-synchronization451451+ * between clock domains. The comparison between configured threshold452452+ * and current temperature value can happen while the value is453453+ * transitioning (metastable), thus causing inappropriate event454454+ * generation. No spurious event occurs as long as the threshold value455455+ * stays unchanged. Spurious event can be generated while a thermal456456+ * alert threshold is modified in457457+ * CONTROL_BANDGAP_THRESHOLD_MPU/GPU/CORE/DSPEVE/IVA_n.458458+ */459459+460460+ if (TI_BANDGAP_HAS(bgp, ERRATA_813)) {461461+ /* Mask t_hot and t_cold events at the IP Level */462462+ ctrl = ti_bandgap_readl(bgp, tsr->bgap_mask_ctrl);463463+464464+ if (hot)465465+ ctrl &= ~tsr->mask_hot_mask;466466+ else467467+ ctrl &= ~tsr->mask_cold_mask;468468+469469+ ti_bandgap_writel(bgp, ctrl, tsr->bgap_mask_ctrl);470470+ }471471+472472+ /* Write the threshold value */480473 ti_bandgap_writel(bgp, reg_val, tsr->bgap_threshold);474474+475475+ if (TI_BANDGAP_HAS(bgp, ERRATA_813)) {476476+ /* Unmask t_hot and t_cold events at the IP Level */477477+ ctrl = ti_bandgap_readl(bgp, tsr->bgap_mask_ctrl);478478+ if (hot)479479+ ctrl |= tsr->mask_hot_mask;480480+ else481481+ ctrl |= tsr->mask_cold_mask;482482+483483+ ti_bandgap_writel(bgp, ctrl, tsr->bgap_mask_ctrl);484484+ }481485482486 if (err) {483487 dev_err(bgp->dev, "failed to reprogram thot threshold\n");
+6
drivers/thermal/ti-soc-thermal/ti-bandgap.h
···318318 * TI_BANDGAP_FEATURE_HISTORY_BUFFER - used when the bandgap device features319319 * a history buffer of temperatures.320320 *321321+ * TI_BANDGAP_FEATURE_ERRATA_814 - used to workaorund when the bandgap device322322+ * has Errata 814323323+ * TI_BANDGAP_FEATURE_ERRATA_813 - used to workaorund when the bandgap device324324+ * has Errata 813321325 * TI_BANDGAP_HAS(b, f) - macro to check if a bandgap device is capable of a322326 * specific feature (above) or not. Return non-zero, if yes.323327 */···335331#define TI_BANDGAP_FEATURE_FREEZE_BIT BIT(7)336332#define TI_BANDGAP_FEATURE_COUNTER_DELAY BIT(8)337333#define TI_BANDGAP_FEATURE_HISTORY_BUFFER BIT(9)334334+#define TI_BANDGAP_FEATURE_ERRATA_814 BIT(10)335335+#define TI_BANDGAP_FEATURE_ERRATA_813 BIT(11)338336#define TI_BANDGAP_HAS(b, f) \339337 ((b)->conf->features & TI_BANDGAP_FEATURE_ ## f)340338
···880880 * indirect refs to their parent bytenr.881881 * When roots are found, they're added to the roots list882882 *883883+ * NOTE: This can return values > 0884884+ *883885 * FIXME some caching might speed things up884886 */885887static int find_parent_nodes(struct btrfs_trans_handle *trans,···12001198 return ret;12011199}1202120012011201+/**12021202+ * btrfs_check_shared - tell us whether an extent is shared12031203+ *12041204+ * @trans: optional trans handle12051205+ *12061206+ * btrfs_check_shared uses the backref walking code but will short12071207+ * circuit as soon as it finds a root or inode that doesn't match the12081208+ * one passed in. This provides a significant performance benefit for12091209+ * callers (such as fiemap) which want to know whether the extent is12101210+ * shared but do not need a ref count.12111211+ *12121212+ * Return: 0 if extent is not shared, 1 if it is shared, < 0 on error.12131213+ */12031214int btrfs_check_shared(struct btrfs_trans_handle *trans,12041215 struct btrfs_fs_info *fs_info, u64 root_objectid,12051216 u64 inum, u64 bytenr)···12411226 ret = find_parent_nodes(trans, fs_info, bytenr, elem.seq, tmp,12421227 roots, NULL, root_objectid, inum);12431228 if (ret == BACKREF_FOUND_SHARED) {12291229+ /* this is the only condition under which we return 1 */12441230 ret = 1;12451231 break;12461232 }12471233 if (ret < 0 && ret != -ENOENT)12481234 break;12351235+ ret = 0;12491236 node = ulist_next(tmp, &uiter);12501237 if (!node)12511238 break;
+20
fs/btrfs/extent-tree.c
···88298829 goto again;88308830 }8831883188328832+ /*88338833+ * if we are changing raid levels, try to allocate a corresponding88348834+ * block group with the new raid level.88358835+ */88368836+ alloc_flags = update_block_group_flags(root, cache->flags);88378837+ if (alloc_flags != cache->flags) {88388838+ ret = do_chunk_alloc(trans, root, alloc_flags,88398839+ CHUNK_ALLOC_FORCE);88408840+ /*88418841+ * ENOSPC is allowed here, we may have enough space88428842+ * already allocated at the new raid level to88438843+ * carry on88448844+ */88458845+ if (ret == -ENOSPC)88468846+ ret = 0;88478847+ if (ret < 0)88488848+ goto out;88498849+ }8832885088338851 ret = set_block_group_ro(cache, 0);88348852 if (!ret)···88608842out:88618843 if (cache->flags & BTRFS_BLOCK_GROUP_SYSTEM) {88628844 alloc_flags = update_block_group_flags(root, cache->flags);88458845+ lock_chunks(root->fs_info->chunk_root);88638846 check_system_chunk(trans, root, alloc_flags);88478847+ unlock_chunks(root->fs_info->chunk_root);88648848 }88658849 mutex_unlock(&root->fs_info->ro_block_group_mutex);88668850
···2727#include "cifsglob.h"2828#include "cifs_debug.h"29293030-/*3131- * cifs_utf16_bytes - how long will a string be after conversion?3232- * @utf16 - pointer to input string3333- * @maxbytes - don't go past this many bytes of input string3434- * @codepage - destination codepage3535- *3636- * Walk a utf16le string and return the number of bytes that the string will3737- * be after being converted to the given charset, not including any null3838- * termination required. Don't walk past maxbytes in the source buffer.3939- */4040-int4141-cifs_utf16_bytes(const __le16 *from, int maxbytes,4242- const struct nls_table *codepage)4343-{4444- int i;4545- int charlen, outlen = 0;4646- int maxwords = maxbytes / 2;4747- char tmp[NLS_MAX_CHARSET_SIZE];4848- __u16 ftmp;4949-5050- for (i = 0; i < maxwords; i++) {5151- ftmp = get_unaligned_le16(&from[i]);5252- if (ftmp == 0)5353- break;5454-5555- charlen = codepage->uni2char(ftmp, tmp, NLS_MAX_CHARSET_SIZE);5656- if (charlen > 0)5757- outlen += charlen;5858- else5959- outlen++;6060- }6161-6262- return outlen;6363-}6464-6530int cifs_remap(struct cifs_sb_info *cifs_sb)6631{6732 int map_type;···120155 * enough to hold the result of the conversion (at least NLS_MAX_CHARSET_SIZE).121156 */122157static int123123-cifs_mapchar(char *target, const __u16 src_char, const struct nls_table *cp,158158+cifs_mapchar(char *target, const __u16 *from, const struct nls_table *cp,124159 int maptype)125160{126161 int len = 1;162162+ __u16 src_char;163163+164164+ src_char = *from;127165128166 if ((maptype == SFM_MAP_UNI_RSVD) && convert_sfm_char(src_char, target))129167 return len;···136168137169 /* if character not one of seven in special remap set */138170 len = cp->uni2char(src_char, target, NLS_MAX_CHARSET_SIZE);139139- if (len <= 0) {140140- *target = '?';141141- len = 1;142142- }171171+ if (len <= 0)172172+ goto surrogate_pair;173173+174174+ return len;175175+176176+surrogate_pair:177177+ /* convert SURROGATE_PAIR and IVS */178178+ if (strcmp(cp->charset, "utf8"))179179+ goto unknown;180180+ len = utf16s_to_utf8s(from, 3, UTF16_LITTLE_ENDIAN, target, 6);181181+ if (len <= 0)182182+ goto unknown;183183+ return len;184184+185185+unknown:186186+ *target = '?';187187+ len = 1;143188 return len;144189}145190···187206 int nullsize = nls_nullsize(codepage);188207 int fromwords = fromlen / 2;189208 char tmp[NLS_MAX_CHARSET_SIZE];190190- __u16 ftmp;209209+ __u16 ftmp[3]; /* ftmp[3] = 3array x 2bytes = 6bytes UTF-16 */191210192211 /*193212 * because the chars can be of varying widths, we need to take care···198217 safelen = tolen - (NLS_MAX_CHARSET_SIZE + nullsize);199218200219 for (i = 0; i < fromwords; i++) {201201- ftmp = get_unaligned_le16(&from[i]);202202- if (ftmp == 0)220220+ ftmp[0] = get_unaligned_le16(&from[i]);221221+ if (ftmp[0] == 0)203222 break;223223+ if (i + 1 < fromwords)224224+ ftmp[1] = get_unaligned_le16(&from[i + 1]);225225+ else226226+ ftmp[1] = 0;227227+ if (i + 2 < fromwords)228228+ ftmp[2] = get_unaligned_le16(&from[i + 2]);229229+ else230230+ ftmp[2] = 0;204231205232 /*206233 * check to see if converting this character might make the···223234 /* put converted char into 'to' buffer */224235 charlen = cifs_mapchar(&to[outlen], ftmp, codepage, map_type);225236 outlen += charlen;237237+238238+ /* charlen (=bytes of UTF-8 for 1 character)239239+ * 4bytes UTF-8(surrogate pair) is charlen=4240240+ * (4bytes UTF-16 code)241241+ * 7-8bytes UTF-8(IVS) is charlen=3+4 or 4+4242242+ * (2 UTF-8 pairs divided to 2 UTF-16 pairs) */243243+ if (charlen == 4)244244+ i++;245245+ else if (charlen >= 5)246246+ /* 5-6bytes UTF-8 */247247+ i += 2;226248 }227249228250 /* properly null-terminate string */···293293success:294294 put_unaligned_le16(0, &to[i]);295295 return i;296296+}297297+298298+/*299299+ * cifs_utf16_bytes - how long will a string be after conversion?300300+ * @utf16 - pointer to input string301301+ * @maxbytes - don't go past this many bytes of input string302302+ * @codepage - destination codepage303303+ *304304+ * Walk a utf16le string and return the number of bytes that the string will305305+ * be after being converted to the given charset, not including any null306306+ * termination required. Don't walk past maxbytes in the source buffer.307307+ */308308+int309309+cifs_utf16_bytes(const __le16 *from, int maxbytes,310310+ const struct nls_table *codepage)311311+{312312+ int i;313313+ int charlen, outlen = 0;314314+ int maxwords = maxbytes / 2;315315+ char tmp[NLS_MAX_CHARSET_SIZE];316316+ __u16 ftmp[3];317317+318318+ for (i = 0; i < maxwords; i++) {319319+ ftmp[0] = get_unaligned_le16(&from[i]);320320+ if (ftmp[0] == 0)321321+ break;322322+ if (i + 1 < maxwords)323323+ ftmp[1] = get_unaligned_le16(&from[i + 1]);324324+ else325325+ ftmp[1] = 0;326326+ if (i + 2 < maxwords)327327+ ftmp[2] = get_unaligned_le16(&from[i + 2]);328328+ else329329+ ftmp[2] = 0;330330+331331+ charlen = cifs_mapchar(tmp, ftmp, codepage, NO_MAP_UNI_RSVD);332332+ outlen += charlen;333333+ }334334+335335+ return outlen;296336}297337298338/*···449409 char src_char;450410 __le16 dst_char;451411 wchar_t tmp;412412+ wchar_t *wchar_to; /* UTF-16 */413413+ int ret;414414+ unicode_t u;452415453416 if (map_chars == NO_MAP_UNI_RSVD)454417 return cifs_strtoUTF16(target, source, PATH_MAX, cp);418418+419419+ wchar_to = kzalloc(6, GFP_KERNEL);455420456421 for (i = 0; i < srclen; j++) {457422 src_char = source[i];···486441 * if no match, use question mark, which at least in487442 * some cases serves as wild card488443 */489489- if (charlen < 1) {490490- dst_char = cpu_to_le16(0x003f);491491- charlen = 1;444444+ if (charlen > 0)445445+ goto ctoUTF16;446446+447447+ /* convert SURROGATE_PAIR */448448+ if (strcmp(cp->charset, "utf8") || !wchar_to)449449+ goto unknown;450450+ if (*(source + i) & 0x80) {451451+ charlen = utf8_to_utf32(source + i, 6, &u);452452+ if (charlen < 0)453453+ goto unknown;454454+ } else455455+ goto unknown;456456+ ret = utf8s_to_utf16s(source + i, charlen,457457+ UTF16_LITTLE_ENDIAN,458458+ wchar_to, 6);459459+ if (ret < 0)460460+ goto unknown;461461+462462+ i += charlen;463463+ dst_char = cpu_to_le16(*wchar_to);464464+ if (charlen <= 3)465465+ /* 1-3bytes UTF-8 to 2bytes UTF-16 */466466+ put_unaligned(dst_char, &target[j]);467467+ else if (charlen == 4) {468468+ /* 4bytes UTF-8(surrogate pair) to 4bytes UTF-16469469+ * 7-8bytes UTF-8(IVS) divided to 2 UTF-16470470+ * (charlen=3+4 or 4+4) */471471+ put_unaligned(dst_char, &target[j]);472472+ dst_char = cpu_to_le16(*(wchar_to + 1));473473+ j++;474474+ put_unaligned(dst_char, &target[j]);475475+ } else if (charlen >= 5) {476476+ /* 5-6bytes UTF-8 to 6bytes UTF-16 */477477+ put_unaligned(dst_char, &target[j]);478478+ dst_char = cpu_to_le16(*(wchar_to + 1));479479+ j++;480480+ put_unaligned(dst_char, &target[j]);481481+ dst_char = cpu_to_le16(*(wchar_to + 2));482482+ j++;483483+ put_unaligned(dst_char, &target[j]);492484 }485485+ continue;486486+487487+unknown:488488+ dst_char = cpu_to_le16(0x003f);489489+ charlen = 1;493490 }491491+492492+ctoUTF16:494493 /*495494 * character may take more than one byte in the source string,496495 * but will take exactly two bytes in the target string···545456546457ctoUTF16_out:547458 put_unaligned(0, &target[j]); /* Null terminate target unicode string */459459+ kfree(wchar_to);548460 return j;549461}550462
+2
fs/cifs/cifsfs.c
···469469 seq_puts(s, ",nouser_xattr");470470 if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_MAP_SPECIAL_CHR)471471 seq_puts(s, ",mapchars");472472+ if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_MAP_SFM_CHR)473473+ seq_puts(s, ",mapposix");472474 if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_UNX_EMUL)473475 seq_puts(s, ",sfu");474476 if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_NO_BRL)
+2-2
fs/cifs/cifsproto.h
···361361extern int CIFSUnixCreateSymLink(const unsigned int xid,362362 struct cifs_tcon *tcon,363363 const char *fromName, const char *toName,364364- const struct nls_table *nls_codepage);364364+ const struct nls_table *nls_codepage, int remap);365365extern int CIFSSMBUnixQuerySymLink(const unsigned int xid,366366 struct cifs_tcon *tcon,367367 const unsigned char *searchName, char **syminfo,368368- const struct nls_table *nls_codepage);368368+ const struct nls_table *nls_codepage, int remap);369369extern int CIFSSMBQuerySymLink(const unsigned int xid, struct cifs_tcon *tcon,370370 __u16 fid, char **symlinkinfo,371371 const struct nls_table *nls_codepage);
···9090 if (dentry) {9191 inode = d_inode(dentry);9292 if (inode) {9393+ if (d_mountpoint(dentry))9494+ goto out;9395 /*9496 * If we're generating inode numbers, then we don't9597 * want to clobber the existing one with the one that
+2-1
fs/cifs/smb1ops.c
···960960 /* Check for unix extensions */961961 if (cap_unix(tcon->ses)) {962962 rc = CIFSSMBUnixQuerySymLink(xid, tcon, full_path, target_path,963963- cifs_sb->local_nls);963963+ cifs_sb->local_nls,964964+ cifs_remap(cifs_sb));964965 if (rc == -EREMOTE)965966 rc = cifs_unix_dfs_readlink(xid, tcon, full_path,966967 target_path,
+1-1
fs/cifs/smb2pdu.c
···110110111111 /* GLOBAL_CAP_LARGE_MTU will only be set if dialect > SMB2.02 */112112 /* See sections 2.2.4 and 3.2.4.1.5 of MS-SMB2 */113113- if ((tcon->ses) &&113113+ if ((tcon->ses) && (tcon->ses->server) &&114114 (tcon->ses->server->capabilities & SMB2_GLOBAL_CAP_LARGE_MTU))115115 hdr->CreditCharge = cpu_to_le16(1);116116 /* else CreditCharge MBZ */
+4-4
fs/dcache.c
···12391239 /* might go back up the wrong parent if we have had a rename. */12401240 if (need_seqretry(&rename_lock, seq))12411241 goto rename_retry;12421242- next = child->d_child.next;12431243- while (unlikely(child->d_flags & DCACHE_DENTRY_KILLED)) {12421242+ /* go into the first sibling still alive */12431243+ do {12441244+ next = child->d_child.next;12441245 if (next == &this_parent->d_subdirs)12451246 goto ascend;12461247 child = list_entry(next, struct dentry, d_child);12471247- next = next->next;12481248- }12481248+ } while (unlikely(child->d_flags & DCACHE_DENTRY_KILLED));12491249 rcu_read_unlock();12501250 goto resume;12511251 }
···18451845 trace_nfs_writeback_inode_enter(inode);1846184618471847 ret = filemap_write_and_wait(inode->i_mapping);18481848- if (!ret) {18491849- ret = nfs_commit_inode(inode, FLUSH_SYNC);18501850- if (!ret)18511851- pnfs_sync_inode(inode, true);18521852- }18481848+ if (ret)18491849+ goto out;18501850+ ret = nfs_commit_inode(inode, FLUSH_SYNC);18511851+ if (ret < 0)18521852+ goto out;18531853+ pnfs_sync_inode(inode, true);18541854+ ret = 0;1853185518561856+out:18541857 trace_nfs_writeback_inode_exit(inode, ret);18551858 return ret;18561859}
+1-1
fs/omfs/bitmap.c
···159159 goto out;160160161161found:162162- *return_block = i * bits_per_entry + bit;162162+ *return_block = (u64) i * bits_per_entry + bit;163163 *return_size = run;164164 ret = set_run(sb, i, bits_per_entry, bit, run, 1);165165
+7-3
fs/omfs/inode.c
···306306 */307307static int omfs_get_imap(struct super_block *sb)308308{309309- unsigned int bitmap_size, count, array_size;309309+ unsigned int bitmap_size, array_size;310310+ int count;310311 struct omfs_sb_info *sbi = OMFS_SB(sb);311312 struct buffer_head *bh;312313 unsigned long **ptr;···360359}361360362361enum {363363- Opt_uid, Opt_gid, Opt_umask, Opt_dmask, Opt_fmask362362+ Opt_uid, Opt_gid, Opt_umask, Opt_dmask, Opt_fmask, Opt_err364363};365364366365static const match_table_t tokens = {···369368 {Opt_umask, "umask=%o"},370369 {Opt_dmask, "dmask=%o"},371370 {Opt_fmask, "fmask=%o"},371371+ {Opt_err, NULL},372372};373373374374static int parse_options(char *options, struct omfs_sb_info *sbi)···550548 }551549552550 sb->s_root = d_make_root(root);553553- if (!sb->s_root)551551+ if (!sb->s_root) {552552+ ret = -ENOMEM;554553 goto out_brelse_bh2;554554+ }555555 printk(KERN_DEBUG "omfs: Mounted volume %s\n", omfs_rb->r_name);556556557557 ret = 0;
···222222 struct kstat stat;223223 int err;224224225225+ if (WARN_ON(!workdir))226226+ return ERR_PTR(-EROFS);227227+225228 err = ovl_lock_rename_workdir(workdir, upperdir);226229 if (err)227230 goto out;···324321 struct dentry *upper;325322 struct dentry *newdentry;326323 int err;324324+325325+ if (WARN_ON(!workdir))326326+ return -EROFS;327327328328 err = ovl_lock_rename_workdir(workdir, upperdir);329329 if (err)···512506 struct dentry *opaquedir = NULL;513507 int err;514508515515- if (is_dir && OVL_TYPE_MERGE_OR_LOWER(ovl_path_type(dentry))) {516516- opaquedir = ovl_check_empty_and_clear(dentry);517517- err = PTR_ERR(opaquedir);518518- if (IS_ERR(opaquedir))519519- goto out;509509+ if (WARN_ON(!workdir))510510+ return -EROFS;511511+512512+ if (is_dir) {513513+ if (OVL_TYPE_MERGE_OR_LOWER(ovl_path_type(dentry))) {514514+ opaquedir = ovl_check_empty_and_clear(dentry);515515+ err = PTR_ERR(opaquedir);516516+ if (IS_ERR(opaquedir))517517+ goto out;518518+ } else {519519+ LIST_HEAD(list);520520+521521+ /*522522+ * When removing an empty opaque directory, then it523523+ * makes no sense to replace it with an exact replica of524524+ * itself. But emptiness still needs to be checked.525525+ */526526+ err = ovl_check_empty_dir(dentry, &list);527527+ ovl_cache_free(&list);528528+ if (err)529529+ goto out;530530+ }520531 }521532522533 err = ovl_lock_rename_workdir(workdir, upperdir);
+5-5
fs/overlayfs/super.c
···529529{530530 struct ovl_fs *ufs = sb->s_fs_info;531531532532- if (!(*flags & MS_RDONLY) && !ufs->upper_mnt)532532+ if (!(*flags & MS_RDONLY) && (!ufs->upper_mnt || !ufs->workdir))533533 return -EROFS;534534535535 return 0;···925925 ufs->workdir = ovl_workdir_create(ufs->upper_mnt, workpath.dentry);926926 err = PTR_ERR(ufs->workdir);927927 if (IS_ERR(ufs->workdir)) {928928- pr_err("overlayfs: failed to create directory %s/%s\n",929929- ufs->config.workdir, OVL_WORKDIR_NAME);930930- goto out_put_upper_mnt;928928+ pr_warn("overlayfs: failed to create directory %s/%s (errno: %i); mounting read-only\n",929929+ ufs->config.workdir, OVL_WORKDIR_NAME, -err);930930+ sb->s_flags |= MS_RDONLY;931931+ ufs->workdir = NULL;931932 }932933 }933934···998997 kfree(ufs->lower_mnt);999998out_put_workdir:1000999 dput(ufs->workdir);10011001-out_put_upper_mnt:10021000 mntput(ufs->upper_mnt);10031001out_put_lowerpath:10041002 for (i = 0; i < numlower; i++)
+4-4
fs/xfs/libxfs/xfs_attr_leaf.c
···574574 * After the last attribute is removed revert to original inode format,575575 * making all literal area available to the data fork once more.576576 */577577-STATIC void578578-xfs_attr_fork_reset(577577+void578578+xfs_attr_fork_remove(579579 struct xfs_inode *ip,580580 struct xfs_trans *tp)581581{···641641 (mp->m_flags & XFS_MOUNT_ATTR2) &&642642 (dp->i_d.di_format != XFS_DINODE_FMT_BTREE) &&643643 !(args->op_flags & XFS_DA_OP_ADDNAME)) {644644- xfs_attr_fork_reset(dp, args->trans);644644+ xfs_attr_fork_remove(dp, args->trans);645645 } else {646646 xfs_idata_realloc(dp, -size, XFS_ATTR_FORK);647647 dp->i_d.di_forkoff = xfs_attr_shortform_bytesfit(dp, totsize);···905905 if (forkoff == -1) {906906 ASSERT(dp->i_mount->m_flags & XFS_MOUNT_ATTR2);907907 ASSERT(dp->i_d.di_format != XFS_DINODE_FMT_BTREE);908908- xfs_attr_fork_reset(dp, args->trans);908908+ xfs_attr_fork_remove(dp, args->trans);909909 goto out;910910 }911911
···32243224 align_alen += temp;32253225 align_off -= temp;32263226 }32273227- /*32283228- * Same adjustment for the end of the requested area.32293229- */32303230- if ((temp = (align_alen % extsz))) {32273227+32283228+ /* Same adjustment for the end of the requested area. */32293229+ temp = (align_alen % extsz);32303230+ if (temp)32313231 align_alen += extsz - temp;32323232- }32323232+32333233+ /*32343234+ * For large extent hint sizes, the aligned extent might be larger than32353235+ * MAXEXTLEN. In that case, reduce the size by an extsz so that it pulls32363236+ * the length back under MAXEXTLEN. The outer allocation loops handle32373237+ * short allocation just fine, so it is safe to do this. We only want to32383238+ * do it when we are forced to, though, because it means more allocation32393239+ * operations are required.32403240+ */32413241+ while (align_alen > MAXEXTLEN)32423242+ align_alen -= extsz;32433243+ ASSERT(align_alen <= MAXEXTLEN);32443244+32333245 /*32343246 * If the previous block overlaps with this proposed allocation32353247 * then move the start forward without adjusting the length.···33303318 return -EINVAL;33313319 } else {33323320 ASSERT(orig_off >= align_off);33333333- ASSERT(orig_end <= align_off + align_alen);33213321+ /* see MAXEXTLEN handling above */33223322+ ASSERT(orig_end <= align_off + align_alen ||33233323+ align_alen + extsz > MAXEXTLEN);33343324 }3335332533363326#ifdef DEBUG···41134099 /* Figure out the extent size, adjust alen */41144100 extsz = xfs_get_extsz_hint(ip);41154101 if (extsz) {41164116- /*41174117- * Make sure we don't exceed a single extent length when we41184118- * align the extent by reducing length we are going to41194119- * allocate by the maximum amount extent size aligment may41204120- * require.41214121- */41224122- alen = XFS_FILBLKS_MIN(len, MAXEXTLEN - (2 * extsz - 1));41234102 error = xfs_bmap_extsize_align(mp, got, prev, extsz, rt, eof,41244103 1, 0, &aoff, &alen);41254104 ASSERT(!error);
+6-3
fs/xfs/libxfs/xfs_ialloc.c
···376376 */377377 newlen = args.mp->m_ialloc_inos;378378 if (args.mp->m_maxicount &&379379- percpu_counter_read(&args.mp->m_icount) + newlen >379379+ percpu_counter_read_positive(&args.mp->m_icount) + newlen >380380 args.mp->m_maxicount)381381 return -ENOSPC;382382 args.minlen = args.maxlen = args.mp->m_ialloc_blks;···13391339 * If we have already hit the ceiling of inode blocks then clear13401340 * okalloc so we scan all available agi structures for a free13411341 * inode.13421342+ *13431343+ * Read rough value of mp->m_icount by percpu_counter_read_positive,13441344+ * which will sacrifice the preciseness but improve the performance.13421345 */13431346 if (mp->m_maxicount &&13441344- percpu_counter_read(&mp->m_icount) + mp->m_ialloc_inos >13451345- mp->m_maxicount) {13471347+ percpu_counter_read_positive(&mp->m_icount) + mp->m_ialloc_inos13481348+ > mp->m_maxicount) {13461349 noroom = 1;13471350 okalloc = 0;13481351 }
+50-35
fs/xfs/xfs_attr_inactive.c
···380380 return error;381381}382382383383+/*384384+ * xfs_attr_inactive kills all traces of an attribute fork on an inode. It385385+ * removes both the on-disk and in-memory inode fork. Note that this also has to386386+ * handle the condition of inodes without attributes but with an attribute fork387387+ * configured, so we can't use xfs_inode_hasattr() here.388388+ *389389+ * The in-memory attribute fork is removed even on error.390390+ */383391int384384-xfs_attr_inactive(xfs_inode_t *dp)392392+xfs_attr_inactive(393393+ struct xfs_inode *dp)385394{386386- xfs_trans_t *trans;387387- xfs_mount_t *mp;388388- int error;395395+ struct xfs_trans *trans;396396+ struct xfs_mount *mp;397397+ int cancel_flags = 0;398398+ int lock_mode = XFS_ILOCK_SHARED;399399+ int error = 0;389400390401 mp = dp->i_mount;391402 ASSERT(! XFS_NOT_DQATTACHED(mp, dp));392403393393- xfs_ilock(dp, XFS_ILOCK_SHARED);394394- if (!xfs_inode_hasattr(dp) ||395395- dp->i_d.di_aformat == XFS_DINODE_FMT_LOCAL) {396396- xfs_iunlock(dp, XFS_ILOCK_SHARED);397397- return 0;398398- }399399- xfs_iunlock(dp, XFS_ILOCK_SHARED);404404+ xfs_ilock(dp, lock_mode);405405+ if (!XFS_IFORK_Q(dp))406406+ goto out_destroy_fork;407407+ xfs_iunlock(dp, lock_mode);400408401409 /*402410 * Start our first transaction of the day.···416408 * the inode in every transaction to let it float upward through417409 * the log.418410 */411411+ lock_mode = 0;419412 trans = xfs_trans_alloc(mp, XFS_TRANS_ATTRINVAL);420413 error = xfs_trans_reserve(trans, &M_RES(mp)->tr_attrinval, 0, 0);421421- if (error) {422422- xfs_trans_cancel(trans, 0);423423- return error;424424- }425425- xfs_ilock(dp, XFS_ILOCK_EXCL);414414+ if (error)415415+ goto out_cancel;416416+417417+ lock_mode = XFS_ILOCK_EXCL;418418+ cancel_flags = XFS_TRANS_RELEASE_LOG_RES | XFS_TRANS_ABORT;419419+ xfs_ilock(dp, lock_mode);420420+421421+ if (!XFS_IFORK_Q(dp))422422+ goto out_cancel;426423427424 /*428425 * No need to make quota reservations here. We expect to release some···435422 */436423 xfs_trans_ijoin(trans, dp, 0);437424438438- /*439439- * Decide on what work routines to call based on the inode size.440440- */441441- if (!xfs_inode_hasattr(dp) ||442442- dp->i_d.di_aformat == XFS_DINODE_FMT_LOCAL) {443443- error = 0;444444- goto out;445445- }446446- error = xfs_attr3_root_inactive(&trans, dp);447447- if (error)448448- goto out;425425+ /* invalidate and truncate the attribute fork extents */426426+ if (dp->i_d.di_aformat != XFS_DINODE_FMT_LOCAL) {427427+ error = xfs_attr3_root_inactive(&trans, dp);428428+ if (error)429429+ goto out_cancel;449430450450- error = xfs_itruncate_extents(&trans, dp, XFS_ATTR_FORK, 0);451451- if (error)452452- goto out;431431+ error = xfs_itruncate_extents(&trans, dp, XFS_ATTR_FORK, 0);432432+ if (error)433433+ goto out_cancel;434434+ }435435+436436+ /* Reset the attribute fork - this also destroys the in-core fork */437437+ xfs_attr_fork_remove(dp, trans);453438454439 error = xfs_trans_commit(trans, XFS_TRANS_RELEASE_LOG_RES);455455- xfs_iunlock(dp, XFS_ILOCK_EXCL);456456-440440+ xfs_iunlock(dp, lock_mode);457441 return error;458442459459-out:460460- xfs_trans_cancel(trans, XFS_TRANS_RELEASE_LOG_RES|XFS_TRANS_ABORT);461461- xfs_iunlock(dp, XFS_ILOCK_EXCL);443443+out_cancel:444444+ xfs_trans_cancel(trans, cancel_flags);445445+out_destroy_fork:446446+ /* kill the in-core attr fork before we drop the inode lock */447447+ if (dp->i_afp)448448+ xfs_idestroy_fork(dp, XFS_ATTR_FORK);449449+ if (lock_mode)450450+ xfs_iunlock(dp, lock_mode);462451 return error;463452}
···19461946 /*19471947 * If there are attributes associated with the file then blow them away19481948 * now. The code calls a routine that recursively deconstructs the19491949- * attribute fork. We need to just commit the current transaction19501950- * because we can't use it for xfs_attr_inactive().19491949+ * attribute fork. If also blows away the in-core attribute fork.19511950 */19521952- if (ip->i_d.di_anextents > 0) {19531953- ASSERT(ip->i_d.di_forkoff != 0);19541954-19511951+ if (XFS_IFORK_Q(ip)) {19551952 error = xfs_attr_inactive(ip);19561953 if (error)19571954 return;19581955 }1959195619601960- if (ip->i_afp)19611961- xfs_idestroy_fork(ip, XFS_ATTR_FORK);19621962-19571957+ ASSERT(!ip->i_afp);19631958 ASSERT(ip->i_d.di_anextents == 0);19591959+ ASSERT(ip->i_d.di_forkoff == 0);1964196019651961 /*19661962 * Free the inode.···28792883 if (error)28802884 return error;2881288528822882- /* Satisfy xfs_bumplink that this is a real tmpfile */28862886+ /*28872887+ * Prepare the tmpfile inode as if it were created through the VFS.28882888+ * Otherwise, the link increment paths will complain about nlink 0->1.28892889+ * Drop the link count as done by d_tmpfile(), complete the inode setup28902890+ * and flag it as linkable.28912891+ */28922892+ drop_nlink(VFS_I(tmpfile));28832893 xfs_finish_inode_setup(tmpfile);28842894 VFS_I(tmpfile)->i_state |= I_LINKABLE;28852895···31533151 * intermediate state on disk.31543152 */31553153 if (wip) {31563156- ASSERT(wip->i_d.di_nlink == 0);31543154+ ASSERT(VFS_I(wip)->i_nlink == 0 && wip->i_d.di_nlink == 0);31573155 error = xfs_bumplink(tp, wip);31583156 if (error)31593157 goto out_trans_abort;
+20-14
fs/xfs/xfs_mount.c
···10841084 return xfs_sync_sb(mp, true);10851085}1086108610871087+/*10881088+ * Deltas for the inode count are +/-64, hence we use a large batch size10891089+ * of 128 so we don't need to take the counter lock on every update.10901090+ */10911091+#define XFS_ICOUNT_BATCH 12810871092int10881093xfs_mod_icount(10891094 struct xfs_mount *mp,10901095 int64_t delta)10911096{10921092- /* deltas are +/-64, hence the large batch size of 128. */10931093- __percpu_counter_add(&mp->m_icount, delta, 128);10941094- if (percpu_counter_compare(&mp->m_icount, 0) < 0) {10971097+ __percpu_counter_add(&mp->m_icount, delta, XFS_ICOUNT_BATCH);10981098+ if (__percpu_counter_compare(&mp->m_icount, 0, XFS_ICOUNT_BATCH) < 0) {10951099 ASSERT(0);10961100 percpu_counter_add(&mp->m_icount, -delta);10971101 return -EINVAL;···11171113 return 0;11181114}1119111511161116+/*11171117+ * Deltas for the block count can vary from 1 to very large, but lock contention11181118+ * only occurs on frequent small block count updates such as in the delayed11191119+ * allocation path for buffered writes (page a time updates). Hence we set11201120+ * a large batch count (1024) to minimise global counter updates except when11211121+ * we get near to ENOSPC and we have to be very accurate with our updates.11221122+ */11231123+#define XFS_FDBLOCKS_BATCH 102411201124int11211125xfs_mod_fdblocks(11221126 struct xfs_mount *mp,···11631151 * Taking blocks away, need to be more accurate the closer we11641152 * are to zero.11651153 *11661166- * batch size is set to a maximum of 1024 blocks - if we are11671167- * allocating of freeing extents larger than this then we aren't11681168- * going to be hammering the counter lock so a lock per update11691169- * is not a problem.11701170- *11711154 * If the counter has a value of less than 2 * max batch size,11721155 * then make everything serialise as we are real close to11731156 * ENOSPC.11741157 */11751175-#define __BATCH 102411761176- if (percpu_counter_compare(&mp->m_fdblocks, 2 * __BATCH) < 0)11581158+ if (__percpu_counter_compare(&mp->m_fdblocks, 2 * XFS_FDBLOCKS_BATCH,11591159+ XFS_FDBLOCKS_BATCH) < 0)11771160 batch = 1;11781161 else11791179- batch = __BATCH;11801180-#undef __BATCH11621162+ batch = XFS_FDBLOCKS_BATCH;1181116311821164 __percpu_counter_add(&mp->m_fdblocks, delta, batch);11831183- if (percpu_counter_compare(&mp->m_fdblocks,11841184- XFS_ALLOC_SET_ASIDE(mp)) >= 0) {11651165+ if (__percpu_counter_compare(&mp->m_fdblocks, XFS_ALLOC_SET_ASIDE(mp),11661166+ XFS_FDBLOCKS_BATCH) >= 0) {11851167 /* we had space! */11861168 return 0;11871169 }
-2
include/linux/blkdev.h
···821821extern int sg_scsi_ioctl(struct request_queue *, struct gendisk *, fmode_t,822822 struct scsi_ioctl_command __user *);823823824824-extern void blk_queue_bio(struct request_queue *q, struct bio *bio);825825-826824/*827825 * A queue has just exitted congestion. Note this in the global counter of828826 * congested queues, and wake up anyone who was waiting for requests to be
···151151 return 1;152152}153153154154-static inline int cpumask_set_cpu_local_first(int i, int numa_node, cpumask_t *dstp)154154+static inline unsigned int cpumask_local_spread(unsigned int i, int node)155155{156156- set_bit(0, cpumask_bits(dstp));157157-158156 return 0;159157}160158···206208207209int cpumask_next_and(int n, const struct cpumask *, const struct cpumask *);208210int cpumask_any_but(const struct cpumask *mask, unsigned int cpu);209209-int cpumask_set_cpu_local_first(int i, int numa_node, cpumask_t *dstp);211211+unsigned int cpumask_local_spread(unsigned int i, int node);210212211213/**212214 * for_each_cpu - iterate over every cpu in a mask
+2-2
include/linux/hid-sensor-hub.h
···7474 * @usage: Usage id for this hub device instance.7575 * @start_collection_index: Starting index for a phy type collection7676 * @end_collection_index: Last index for a phy type collection7777- * @mutex: synchronizing mutex.7777+ * @mutex_ptr: synchronizing mutex pointer.7878 * @pending: Holds information of pending sync read request.7979 */8080struct hid_sensor_hub_device {···8484 u32 usage;8585 int start_collection_index;8686 int end_collection_index;8787- struct mutex mutex;8787+ struct mutex *mutex_ptr;8888 struct sensor_hub_pending pending;8989};9090
···1717#ifndef _LINUX_RHASHTABLE_H1818#define _LINUX_RHASHTABLE_H19192020+#include <linux/atomic.h>2021#include <linux/compiler.h>2122#include <linux/errno.h>2223#include <linux/jhash.h>···101100 * @key_len: Length of key102101 * @key_offset: Offset of key in struct to be hashed103102 * @head_offset: Offset of rhash_head in struct to be hashed103103+ * @insecure_max_entries: Maximum number of entries (may be exceeded)104104 * @max_size: Maximum size while expanding105105 * @min_size: Minimum size while shrinking106106 * @nulls_base: Base value to generate nulls marker···117115 size_t key_len;118116 size_t key_offset;119117 size_t head_offset;118118+ unsigned int insecure_max_entries;120119 unsigned int max_size;121120 unsigned int min_size;122121 u32 nulls_base;···287284{288285 return atomic_read(&ht->nelems) > tbl->size &&289286 (!ht->p.max_size || tbl->size < ht->p.max_size);287287+}288288+289289+/**290290+ * rht_grow_above_max - returns true if table is above maximum291291+ * @ht: hash table292292+ * @tbl: current table293293+ */294294+static inline bool rht_grow_above_max(const struct rhashtable *ht,295295+ const struct bucket_table *tbl)296296+{297297+ return ht->p.insecure_max_entries &&298298+ atomic_read(&ht->nelems) >= ht->p.insecure_max_entries;290299}291300292301/* The bucket lock is selected based on the hash and protects mutations···603588 goto slow_path;604589 goto out;605590 }591591+592592+ err = -E2BIG;593593+ if (unlikely(rht_grow_above_max(ht, tbl)))594594+ goto out;606595607596 if (unlikely(rht_grow_above_100(ht, tbl))) {608597slow_path:
···158158 * sum(delta(snd_una)), or how many bytes159159 * were acked.160160 */161161+ struct u64_stats_sync syncp; /* protects 64bit vars (cf tcp_get_info()) */162162+161163 u32 snd_una; /* First byte we want an ack for */162164 u32 snd_sml; /* Last byte of the most recently transmitted small packet */163165 u32 rcv_tstamp; /* timestamp of last received ACK (for keepalives) */
···354354};355355356356/**357357- * enum ieee80211_rssi_event - data attached to an %RSSI_EVENT357357+ * struct ieee80211_rssi_event - data attached to an %RSSI_EVENT358358 * @data: See &enum ieee80211_rssi_event_data359359 */360360struct ieee80211_rssi_event {···388388};389389390390/**391391- * enum ieee80211_mlme_event - data attached to an %MLME_EVENT391391+ * struct ieee80211_mlme_event - data attached to an %MLME_EVENT392392 * @data: See &enum ieee80211_mlme_event_data393393 * @status: See &enum ieee80211_mlme_event_status394394 * @reason: the reason code if applicable···401401402402/**403403 * struct ieee80211_event - event to be sent to the driver404404- * @type The event itself. See &enum ieee80211_event_type.404404+ * @type: The event itself. See &enum ieee80211_event_type.405405 * @rssi: relevant if &type is %RSSI_EVENT406406 * @mlme: relevant if &type is %AUTH_EVENT407407+ * @u: union holding the above two fields407408 */408409struct ieee80211_event {409410 enum ieee80211_event_type type;
···140140 TP_ARGS(call_site, ptr)141141);142142143143-DEFINE_EVENT(kmem_free, kmem_cache_free,143143+DEFINE_EVENT_CONDITION(kmem_free, kmem_cache_free,144144145145 TP_PROTO(unsigned long call_site, const void *ptr),146146147147- TP_ARGS(call_site, ptr)147147+ TP_ARGS(call_site, ptr),148148+149149+ /*150150+ * This trace can be potentially called from an offlined cpu.151151+ * Since trace points use RCU and RCU should not be used from152152+ * offline cpus, filter such calls out.153153+ * While this trace can be called from a preemptable section,154154+ * it has no impact on the condition since tasks can migrate155155+ * only from online cpus to other online cpus. Thus its safe156156+ * to use raw_smp_processor_id.157157+ */158158+ TP_CONDITION(cpu_online(raw_smp_processor_id()))148159);149160150150-TRACE_EVENT(mm_page_free,161161+TRACE_EVENT_CONDITION(mm_page_free,151162152163 TP_PROTO(struct page *page, unsigned int order),153164154165 TP_ARGS(page, order),166166+167167+168168+ /*169169+ * This trace can be potentially called from an offlined cpu.170170+ * Since trace points use RCU and RCU should not be used from171171+ * offline cpus, filter such calls out.172172+ * While this trace can be called from a preemptable section,173173+ * it has no impact on the condition since tasks can migrate174174+ * only from online cpus to other online cpus. Thus its safe175175+ * to use raw_smp_processor_id.176176+ */177177+ TP_CONDITION(cpu_online(raw_smp_processor_id())),155178156179 TP_STRUCT__entry(157180 __field( unsigned long, pfn )···276253 TP_ARGS(page, order, migratetype)277254);278255279279-DEFINE_EVENT_PRINT(mm_page, mm_page_pcpu_drain,256256+TRACE_EVENT_CONDITION(mm_page_pcpu_drain,280257281258 TP_PROTO(struct page *page, unsigned int order, int migratetype),282259283260 TP_ARGS(page, order, migratetype),261261+262262+ /*263263+ * This trace can be potentially called from an offlined cpu.264264+ * Since trace points use RCU and RCU should not be used from265265+ * offline cpus, filter such calls out.266266+ * While this trace can be called from a preemptable section,267267+ * it has no impact on the condition since tasks can migrate268268+ * only from online cpus to other online cpus. Thus its safe269269+ * to use raw_smp_processor_id.270270+ */271271+ TP_CONDITION(cpu_online(raw_smp_processor_id())),272272+273273+ TP_STRUCT__entry(274274+ __field( unsigned long, pfn )275275+ __field( unsigned int, order )276276+ __field( int, migratetype )277277+ ),278278+279279+ TP_fast_assign(280280+ __entry->pfn = page ? page_to_pfn(page) : -1UL;281281+ __entry->order = order;282282+ __entry->migratetype = migratetype;283283+ ),284284285285 TP_printk("page=%p pfn=%lu order=%d migratetype=%d",286286 pfn_to_page(__entry->pfn), __entry->pfn,
+3
include/uapi/linux/netfilter/nf_conntrack_tcp.h
···4242/* The field td_maxack has been set */4343#define IP_CT_TCP_FLAG_MAXACK_SET 0x2044444545+/* Marks possibility for expected RFC5961 challenge ACK */4646+#define IP_CT_EXP_CHALLENGE_ACK 0x404747+4548struct nf_ct_tcp_flags {4649 __u8 flags;4750 __u8 mask;
+1-1
include/uapi/linux/rtnetlink.h
···337337#define RTNH_F_DEAD 1 /* Nexthop is dead (used by multipath) */338338#define RTNH_F_PERVASIVE 2 /* Do recursive gateway lookup */339339#define RTNH_F_ONLINK 4 /* Gateway is forced on link */340340-#define RTNH_F_EXTERNAL 8 /* Route installed externally */340340+#define RTNH_F_OFFLOAD 8 /* offloaded route */341341342342/* Macros to handle hexthops */343343
+1
include/uapi/linux/virtio_balloon.h
···2626 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF2727 * SUCH DAMAGE. */2828#include <linux/types.h>2929+#include <linux/virtio_types.h>2930#include <linux/virtio_ids.h>3031#include <linux/virtio_config.h>3132
+1-1
include/xen/events.h
···1717 irq_handler_t handler,1818 unsigned long irqflags, const char *devname,1919 void *dev_id);2020-int bind_virq_to_irq(unsigned int virq, unsigned int cpu);2020+int bind_virq_to_irq(unsigned int virq, unsigned int cpu, bool percpu);2121int bind_virq_to_irqhandler(unsigned int virq, unsigned int cpu,2222 irq_handler_t handler,2323 unsigned long irqflags, const char *devname,
+3
kernel/module.c
···33703370 module_bug_cleanup(mod);33713371 mutex_unlock(&module_mutex);3372337233733373+ blocking_notifier_call_chain(&module_notify_list,33743374+ MODULE_STATE_GOING, mod);33753375+33733376 /* we can't deallocate the module until we clear memory protection */33743377 unset_module_init_ro_nx(mod);33753378 unset_module_core_ro_nx(mod);
+1-4
kernel/sched/core.c
···44254425 long ret;4426442644274427 current->in_iowait = 1;44284428- if (old_iowait)44294429- blk_schedule_flush_plug(current);44304430- else44314431- blk_flush_plug(current);44284428+ blk_schedule_flush_plug(current);4432442944334430 delayacct_blkio_start();44344431 rq = raw_rq();
+8-6
kernel/time/hrtimer.c
···266266/*267267 * Divide a ktime value by a nanosecond value268268 */269269-u64 __ktime_divns(const ktime_t kt, s64 div)269269+s64 __ktime_divns(const ktime_t kt, s64 div)270270{271271- u64 dclc;272271 int sft = 0;272272+ s64 dclc;273273+ u64 tmp;273274274275 dclc = ktime_to_ns(kt);276276+ tmp = dclc < 0 ? -dclc : dclc;277277+275278 /* Make sure the divisor is less than 2^32: */276279 while (div >> 32) {277280 sft++;278281 div >>= 1;279282 }280280- dclc >>= sft;281281- do_div(dclc, (unsigned long) div);282282-283283- return dclc;283283+ tmp >>= sft;284284+ do_div(tmp, (unsigned long) div);285285+ return dclc < 0 ? -tmp : tmp;284286}285287EXPORT_SYMBOL_GPL(__ktime_divns);286288#endif /* BITS_PER_LONG >= 64 */
···139139#endif140140141141/**142142- * cpumask_set_cpu_local_first - set i'th cpu with local numa cpu's first143143- *142142+ * cpumask_local_spread - select the i'th cpu with local numa cpu's first144143 * @i: index number145145- * @numa_node: local numa_node146146- * @dstp: cpumask with the relevant cpu bit set according to the policy144144+ * @node: local numa_node147145 *148148- * This function sets the cpumask according to a numa aware policy.149149- * cpumask could be used as an affinity hint for the IRQ related to a150150- * queue. When the policy is to spread queues across cores - local cores151151- * first.146146+ * This function selects an online CPU according to a numa aware policy;147147+ * local cpus are returned first, followed by non-local ones, then it148148+ * wraps around.152149 *153153- * Returns 0 on success, -ENOMEM for no memory, and -EAGAIN when failed to set154154- * the cpu bit and need to re-call the function.150150+ * It's not very efficient, but useful for setup.155151 */156156-int cpumask_set_cpu_local_first(int i, int numa_node, cpumask_t *dstp)152152+unsigned int cpumask_local_spread(unsigned int i, int node)157153{158158- cpumask_var_t mask;159154 int cpu;160160- int ret = 0;161155162162- if (!zalloc_cpumask_var(&mask, GFP_KERNEL))163163- return -ENOMEM;164164-156156+ /* Wrap: we always want a cpu. */165157 i %= num_online_cpus();166158167167- if (numa_node == -1 || !cpumask_of_node(numa_node)) {168168- /* Use all online cpu's for non numa aware system */169169- cpumask_copy(mask, cpu_online_mask);159159+ if (node == -1) {160160+ for_each_cpu(cpu, cpu_online_mask)161161+ if (i-- == 0)162162+ return cpu;170163 } else {171171- int n;164164+ /* NUMA first. */165165+ for_each_cpu_and(cpu, cpumask_of_node(node), cpu_online_mask)166166+ if (i-- == 0)167167+ return cpu;172168173173- cpumask_and(mask,174174- cpumask_of_node(numa_node), cpu_online_mask);169169+ for_each_cpu(cpu, cpu_online_mask) {170170+ /* Skip NUMA nodes, done above. */171171+ if (cpumask_test_cpu(cpu, cpumask_of_node(node)))172172+ continue;175173176176- n = cpumask_weight(mask);177177- if (i >= n) {178178- i -= n;179179-180180- /* If index > number of local cpu's, mask out local181181- * cpu's182182- */183183- cpumask_andnot(mask, cpu_online_mask, mask);174174+ if (i-- == 0)175175+ return cpu;184176 }185177 }186186-187187- for_each_cpu(cpu, mask) {188188- if (--i < 0)189189- goto out;190190- }191191-192192- ret = -EAGAIN;193193-194194-out:195195- free_cpumask_var(mask);196196-197197- if (!ret)198198- cpumask_set_cpu(cpu, dstp);199199-200200- return ret;178178+ BUG();201179}202202-EXPORT_SYMBOL(cpumask_set_cpu_local_first);180180+EXPORT_SYMBOL(cpumask_local_spread);
+3-3
lib/percpu_counter.c
···197197 * Compare counter against given value.198198 * Return 1 if greater, 0 if equal and -1 if less199199 */200200-int percpu_counter_compare(struct percpu_counter *fbc, s64 rhs)200200+int __percpu_counter_compare(struct percpu_counter *fbc, s64 rhs, s32 batch)201201{202202 s64 count;203203204204 count = percpu_counter_read(fbc);205205 /* Check to see if rough count will be sufficient for comparison */206206- if (abs(count - rhs) > (percpu_counter_batch*num_online_cpus())) {206206+ if (abs(count - rhs) > (batch * num_online_cpus())) {207207 if (count > rhs)208208 return 1;209209 else···218218 else219219 return 0;220220}221221-EXPORT_SYMBOL(percpu_counter_compare);221221+EXPORT_SYMBOL(__percpu_counter_compare);222222223223static int __init percpu_counter_startup(void)224224{
+11
lib/rhashtable.c
···1414 * published by the Free Software Foundation.1515 */16161717+#include <linux/atomic.h>1718#include <linux/kernel.h>1819#include <linux/init.h>1920#include <linux/log2.h>···447446 if (key && rhashtable_lookup_fast(ht, key, ht->p))448447 goto exit;449448449449+ err = -E2BIG;450450+ if (unlikely(rht_grow_above_max(ht, tbl)))451451+ goto exit;452452+450453 err = -EAGAIN;451454 if (rhashtable_check_elasticity(ht, tbl, hash) ||452455 rht_grow_above_100(ht, tbl))···742737743738 if (params->max_size)744739 ht->p.max_size = rounddown_pow_of_two(params->max_size);740740+741741+ if (params->insecure_max_entries)742742+ ht->p.insecure_max_entries =743743+ rounddown_pow_of_two(params->insecure_max_entries);744744+ else745745+ ht->p.insecure_max_entries = ht->p.max_size * 2;745746746747 ht->p.min_size = max(ht->p.min_size, HASH_MIN_SIZE);747748
+1-1
net/8021q/vlan.c
···443443 case NETDEV_UP:444444 /* Put all VLANs for this dev in the up state too. */445445 vlan_group_for_each_dev(grp, i, vlandev) {446446- flgs = vlandev->flags;446446+ flgs = dev_get_flags(vlandev);447447 if (flgs & IFF_UP)448448 continue;449449
+4-2
net/bluetooth/hci_core.c
···28542854 * state. If we were running both LE and BR/EDR inquiry28552855 * simultaneously, and BR/EDR inquiry is already28562856 * finished, stop discovery, otherwise BR/EDR inquiry28572857- * will stop discovery when finished.28572857+ * will stop discovery when finished. If we will resolve28582858+ * remote device name, do not change discovery state.28582859 */28592859- if (!test_bit(HCI_INQUIRY, &hdev->flags))28602860+ if (!test_bit(HCI_INQUIRY, &hdev->flags) &&28612861+ hdev->discovery.state != DISCOVERY_RESOLVING)28602862 hci_discovery_set_state(hdev,28612863 DISCOVERY_STOPPED);28622864 } else {
+2-2
net/bridge/br_multicast.c
···1072107210731073 err = br_ip6_multicast_add_group(br, port, &grec->grec_mca,10741074 vid);10751075- if (!err)10751075+ if (err)10761076 break;10771077 }10781078···18221822 if (query->startup_sent < br->multicast_startup_query_count)18231823 query->startup_sent++;1824182418251825- RCU_INIT_POINTER(querier, NULL);18251825+ RCU_INIT_POINTER(querier->port, NULL);18261826 br_multicast_send_query(br, NULL, query);18271827 spin_unlock(&br->multicast_lock);18281828}
+9-18
net/bridge/br_netfilter.c
···3737#include <net/route.h>3838#include <net/netfilter/br_netfilter.h>39394040-#if IS_ENABLED(CONFIG_NF_CONNTRACK)4141-#include <net/netfilter/nf_conntrack.h>4242-#endif4343-4440#include <asm/uaccess.h>4541#include "br_private.h"4642#ifdef CONFIG_SYSCTL···346350 return 0;347351}348352349349-static bool dnat_took_place(const struct sk_buff *skb)353353+static bool daddr_was_changed(const struct sk_buff *skb,354354+ const struct nf_bridge_info *nf_bridge)350355{351351-#if IS_ENABLED(CONFIG_NF_CONNTRACK)352352- enum ip_conntrack_info ctinfo;353353- struct nf_conn *ct;354354-355355- ct = nf_ct_get(skb, &ctinfo);356356- if (!ct || nf_ct_is_untracked(ct))357357- return false;358358-359359- return test_bit(IPS_DST_NAT_BIT, &ct->status);360360-#else361361- return false;362362-#endif356356+ return ip_hdr(skb)->daddr != nf_bridge->ipv4_daddr;363357}364358365359/* This requires some explaining. If DNAT has taken place,366360 * we will need to fix up the destination Ethernet address.361361+ * This is also true when SNAT takes place (for the reply direction).367362 *368363 * There are two cases to consider:369364 * 1. The packet was DNAT'ed to a device in the same bridge···408421 nf_bridge->pkt_otherhost = false;409422 }410423 nf_bridge->mask ^= BRNF_NF_BRIDGE_PREROUTING;411411- if (dnat_took_place(skb)) {424424+ if (daddr_was_changed(skb, nf_bridge)) {412425 if ((err = ip_route_input(skb, iph->daddr, iph->saddr, iph->tos, dev))) {413426 struct in_device *in_dev = __in_dev_get_rcu(dev);414427···619632 struct sk_buff *skb,620633 const struct nf_hook_state *state)621634{635635+ struct nf_bridge_info *nf_bridge;622636 struct net_bridge_port *p;623637 struct net_bridge *br;624638 __u32 len = nf_bridge_encap_header_len(skb);···656668 return NF_DROP;657669 if (!setup_pre_routing(skb))658670 return NF_DROP;671671+672672+ nf_bridge = nf_bridge_info_get(skb);673673+ nf_bridge->ipv4_daddr = ip_hdr(skb)->daddr;659674660675 skb->protocol = htons(ETH_P_IP);661676
···13061306 if (list_empty(&req->r_osd_item))13071307 req->r_osd = NULL;13081308 }13091309-13101310- list_del_init(&req->r_req_lru_item); /* can be on notarget */13111309 ceph_osdc_put_request(req);13121310}13131311···20152017 err = __map_request(osdc, req,20162018 force_resend || force_resend_writes);20172019 dout("__map_request returned %d\n", err);20182018- if (err == 0)20192019- continue; /* no change and no osd was specified */20202020 if (err < 0)20212021 continue; /* hrm! */20222022- if (req->r_osd == NULL) {20232023- dout("tid %llu maps to no valid osd\n", req->r_tid);20242024- needmap++; /* request a newer map */20252025- continue;20262026- }20222022+ if (req->r_osd == NULL || err > 0) {20232023+ if (req->r_osd == NULL) {20242024+ dout("lingering %p tid %llu maps to no osd\n",20252025+ req, req->r_tid);20262026+ /*20272027+ * A homeless lingering request makes20282028+ * no sense, as it's job is to keep20292029+ * a particular OSD connection open.20302030+ * Request a newer map and kick the20312031+ * request, knowing that it won't be20322032+ * resent until we actually get a map20332033+ * that can tell us where to send it.20342034+ */20352035+ needmap++;20362036+ }2027203720282028- dout("kicking lingering %p tid %llu osd%d\n", req, req->r_tid,20292029- req->r_osd ? req->r_osd->o_osd : -1);20302030- __register_request(osdc, req);20312031- __unregister_linger_request(osdc, req);20382038+ dout("kicking lingering %p tid %llu osd%d\n", req,20392039+ req->r_tid, req->r_osd ? req->r_osd->o_osd : -1);20402040+ __register_request(osdc, req);20412041+ __unregister_linger_request(osdc, req);20422042+ }20322043 }20332044 reset_changed_osds(osdc);20342045 mutex_unlock(&osdc->request_mutex);
+3
net/core/rtnetlink.c
···24162416{24172417 struct sk_buff *skb;2418241824192419+ if (dev->reg_state != NETREG_REGISTERED)24202420+ return;24212421+24192422 skb = rtmsg_ifinfo_build_skb(type, dev, change, flags);24202423 if (skb)24212424 rtmsg_ifinfo_send(skb, dev, flags);
···902902 bool send;903903 int code;904904905905+ /* IP on this device is disabled. */906906+ if (!in_dev)907907+ goto out;908908+905909 net = dev_net(rt->dst.dev);906910 if (!IN_DEV_FORWARD(in_dev)) {907911 switch (rt->dst.error) {
···187187188188 tcp_cleanup_congestion_control(sk);189189 icsk->icsk_ca_ops = ca;190190+ icsk->icsk_ca_setsockopt = 1;190191191192 if (sk->sk_state != TCP_CLOSE && icsk->icsk_ca_ops->init)192193 icsk->icsk_ca_ops->init(sk);···336335 rcu_read_lock();337336 ca = __tcp_ca_find_autoload(name);338337 /* No change asking for existing value */339339- if (ca == icsk->icsk_ca_ops)338338+ if (ca == icsk->icsk_ca_ops) {339339+ icsk->icsk_ca_setsockopt = 1;340340 goto out;341341+ }341342 if (!ca)342343 err = -ENOENT;343344 else if (!((ca->flags & TCP_CONG_NON_RESTRICTED) ||
+4
net/ipv4/tcp_fastopen.c
···206206 skb_set_owner_r(skb2, child);207207 __skb_queue_tail(&child->sk_receive_queue, skb2);208208 tp->syn_data_acked = 1;209209+210210+ /* u64_stats_update_begin(&tp->syncp) not needed here,211211+ * as we certainly are not changing upper 32bit value (0)212212+ */209213 tp->bytes_received = end_seq - TCP_SKB_CB(skb)->seq - 1;210214 } else {211215 end_seq = TCP_SKB_CB(skb)->seq + 1;
+13-6
net/ipv4/tcp_input.c
···26982698 struct tcp_sock *tp = tcp_sk(sk);26992699 bool recovered = !before(tp->snd_una, tp->high_seq);2700270027012701+ if ((flag & FLAG_SND_UNA_ADVANCED) &&27022702+ tcp_try_undo_loss(sk, false))27032703+ return;27042704+27012705 if (tp->frto) { /* F-RTO RFC5682 sec 3.1 (sack enhanced version). */27022706 /* Step 3.b. A timeout is spurious if not all data are27032707 * lost, i.e., never-retransmitted data are (s)acked.27042708 */27052705- if (tcp_try_undo_loss(sk, flag & FLAG_ORIG_SACK_ACKED))27092709+ if ((flag & FLAG_ORIG_SACK_ACKED) &&27102710+ tcp_try_undo_loss(sk, true))27062711 return;2707271227082708- if (after(tp->snd_nxt, tp->high_seq) &&27092709- (flag & FLAG_DATA_SACKED || is_dupack)) {27102710- tp->frto = 0; /* Loss was real: 2nd part of step 3.a */27132713+ if (after(tp->snd_nxt, tp->high_seq)) {27142714+ if (flag & FLAG_DATA_SACKED || is_dupack)27152715+ tp->frto = 0; /* Step 3.a. loss was real */27112716 } else if (flag & FLAG_SND_UNA_ADVANCED && !recovered) {27122717 tp->high_seq = tp->snd_nxt;27132718 __tcp_push_pending_frames(sk, tcp_current_mss(sk),···27372732 else if (flag & FLAG_SND_UNA_ADVANCED)27382733 tcp_reset_reno_sack(tp);27392734 }27402740- if (tcp_try_undo_loss(sk, false))27412741- return;27422735 tcp_xmit_retransmit_queue(sk);27432736}27442737···32863283{32873284 u32 delta = ack - tp->snd_una;3288328532863286+ u64_stats_update_begin(&tp->syncp);32893287 tp->bytes_acked += delta;32883288+ u64_stats_update_end(&tp->syncp);32903289 tp->snd_una = ack;32913290}32923291···32973292{32983293 u32 delta = seq - tp->rcv_nxt;3299329432953295+ u64_stats_update_begin(&tp->syncp);33003296 tp->bytes_received += delta;32973297+ u64_stats_update_end(&tp->syncp);33013298 tp->rcv_nxt = seq;33023299}33033300
+5-2
net/ipv4/tcp_minisocks.c
···300300 tw->tw_v6_daddr = sk->sk_v6_daddr;301301 tw->tw_v6_rcv_saddr = sk->sk_v6_rcv_saddr;302302 tw->tw_tclass = np->tclass;303303- tw->tw_flowlabel = np->flow_label >> 12;303303+ tw->tw_flowlabel = be32_to_cpu(np->flow_label & IPV6_FLOWLABEL_MASK);304304 tw->tw_ipv6only = sk->sk_ipv6only;305305 }306306#endif···420420 rcu_read_unlock();421421 }422422423423- if (!ca_got_dst && !try_module_get(icsk->icsk_ca_ops->owner))423423+ /* If no valid choice made yet, assign current system default ca. */424424+ if (!ca_got_dst &&425425+ (!icsk->icsk_ca_setsockopt ||426426+ !try_module_get(icsk->icsk_ca_ops->owner)))424427 tcp_assign_congestion_control(sk);425428426429 tcp_set_ca_state(sk, TCP_CA_Open);
+2-4
net/ipv4/udp.c
···13451345 }13461346 unlock_sock_fast(sk, slow);1347134713481348- if (noblock)13491349- return -EAGAIN;13501350-13511351- /* starting over for a new packet */13481348+ /* starting over for a new packet, but check if we need to yield */13491349+ cond_resched();13521350 msg->msg_flags &= ~MSG_TRUNC;13531351 goto try_again;13541352}
···693693{694694 struct rt6_info *iter = NULL;695695 struct rt6_info **ins;696696+ struct rt6_info **fallback_ins = NULL;696697 int replace = (info->nlh &&697698 (info->nlh->nlmsg_flags & NLM_F_REPLACE));698699 int add = (!info->nlh ||···717716 (info->nlh->nlmsg_flags & NLM_F_EXCL))718717 return -EEXIST;719718 if (replace) {720720- found++;721721- break;719719+ if (rt_can_ecmp == rt6_qualify_for_ecmp(iter)) {720720+ found++;721721+ break;722722+ }723723+ if (rt_can_ecmp)724724+ fallback_ins = fallback_ins ?: ins;725725+ goto next_iter;722726 }723727724728 if (iter->dst.dev == rt->dst.dev &&···759753 if (iter->rt6i_metric > rt->rt6i_metric)760754 break;761755756756+next_iter:762757 ins = &iter->dst.rt6_next;758758+ }759759+760760+ if (fallback_ins && !found) {761761+ /* No ECMP-able route found, replace first non-ECMP one */762762+ ins = fallback_ins;763763+ iter = *ins;764764+ found++;763765 }764766765767 /* Reset round-robin state, if necessary */···829815 }830816831817 } else {818818+ int nsiblings;819819+832820 if (!found) {833821 if (add)834822 goto add;···851835 info->nl_net->ipv6.rt6_stats->fib_route_nodes++;852836 fn->fn_flags |= RTN_RTINFO;853837 }838838+ nsiblings = iter->rt6i_nsiblings;854839 fib6_purge_rt(iter, fn, info->nl_net);855840 rt6_release(iter);841841+842842+ if (nsiblings) {843843+ /* Replacing an ECMP route, remove all siblings */844844+ ins = &rt->dst.rt6_next;845845+ iter = *ins;846846+ while (iter) {847847+ if (rt6_qualify_for_ecmp(iter)) {848848+ *ins = iter->dst.rt6_next;849849+ fib6_purge_rt(iter, fn, info->nl_net);850850+ rt6_release(iter);851851+ nsiblings--;852852+ } else {853853+ ins = &iter->dst.rt6_next;854854+ }855855+ iter = *ins;856856+ }857857+ WARN_ON(nsiblings != 0);858858+ }856859 }857860858861 return 0;
+3-1
net/ipv6/ip6_output.c
···1300130013011301 /* If this is the first and only packet and device13021302 * supports checksum offloading, let's use it.13031303+ * Use transhdrlen, same as IPv4, because partial13041304+ * sums only work when transhdrlen is set.13031305 */13041304- if (!skb && sk->sk_protocol == IPPROTO_UDP &&13061306+ if (transhdrlen && sk->sk_protocol == IPPROTO_UDP &&13051307 length + fragheaderlen < mtu &&13061308 rt->dst.dev->features & NETIF_F_V6_CSUM &&13071309 !exthdrlen)
+24-3
net/ipv6/ip6_vti.c
···322322 }323323324324 XFRM_TUNNEL_SKB_CB(skb)->tunnel.ip6 = t;325325- skb->mark = be32_to_cpu(t->parms.i_key);326325327326 rcu_read_unlock();328327···341342 struct pcpu_sw_netstats *tstats;342343 struct xfrm_state *x;343344 struct ip6_tnl *t = XFRM_TUNNEL_SKB_CB(skb)->tunnel.ip6;345345+ u32 orig_mark = skb->mark;346346+ int ret;344347345348 if (!t)346349 return 1;···359358 x = xfrm_input_state(skb);360359 family = x->inner_mode->afinfo->family;361360362362- if (!xfrm_policy_check(NULL, XFRM_POLICY_IN, skb, family))361361+ skb->mark = be32_to_cpu(t->parms.i_key);362362+ ret = xfrm_policy_check(NULL, XFRM_POLICY_IN, skb, family);363363+ skb->mark = orig_mark;364364+365365+ if (!ret)363366 return -EPERM;364367365368 skb_scrub_packet(skb, !net_eq(t->net, dev_net(skb->dev)));···435430 struct net_device *tdev;436431 struct xfrm_state *x;437432 int err = -1;433433+ int mtu;438434439435 if (!dst)440436 goto tx_err_link_failure;···469463 skb_dst_set(skb, dst);470464 skb->dev = skb_dst(skb)->dev;471465466466+ mtu = dst_mtu(dst);467467+ if (!skb->ignore_df && skb->len > mtu) {468468+ skb_dst(skb)->ops->update_pmtu(dst, NULL, skb, mtu);469469+470470+ if (skb->protocol == htons(ETH_P_IPV6))471471+ icmpv6_send(skb, ICMPV6_PKT_TOOBIG, 0, mtu);472472+ else473473+ icmp_send(skb, ICMP_DEST_UNREACH, ICMP_FRAG_NEEDED,474474+ htonl(mtu));475475+476476+ return -EMSGSIZE;477477+ }478478+472479 err = dst_output(skb);473480 if (net_xmit_eval(err) == 0) {474481 struct pcpu_sw_netstats *tstats = this_cpu_ptr(dev->tstats);···514495 int ret;515496516497 memset(&fl, 0, sizeof(fl));517517- skb->mark = be32_to_cpu(t->parms.o_key);518498519499 switch (skb->protocol) {520500 case htons(ETH_P_IPV6):···533515 default:534516 goto tx_err;535517 }518518+519519+ /* override mark with tunnel output key */520520+ fl.flowi_mark = be32_to_cpu(t->parms.o_key);536521537522 ret = vti6_xmit(skb, dev, &fl);538523 if (ret < 0)
···25042504 int attrlen;25052505 int err = 0, last_err = 0;2506250625072507+ remaining = cfg->fc_mp_len;25072508beginning:25082509 rtnh = (struct rtnexthop *)cfg->fc_mp;25092509- remaining = cfg->fc_mp_len;2510251025112511 /* Parse a Multipath Entry */25122512 while (rtnh_ok(rtnh, remaining)) {···25362536 * next hops that have been already added.25372537 */25382538 add = 0;25392539+ remaining = cfg->fc_mp_len - remaining;25392540 goto beginning;25402541 }25412542 }25422543 /* Because each route is added like a single route we remove25432543- * this flag after the first nexthop (if there is a collision,25442544- * we have already fail to add the first nexthop:25452545- * fib6_add_rt2node() has reject it).25442544+ * these flags after the first nexthop: if there is a collision,25452545+ * we have already failed to add the first nexthop:25462546+ * fib6_add_rt2node() has rejected it; when replacing, old25472547+ * nexthops have been replaced by first new, the rest should25482548+ * be added to it.25462549 */25472547- cfg->fc_nlinfo.nlh->nlmsg_flags &= ~NLM_F_EXCL;25502550+ cfg->fc_nlinfo.nlh->nlmsg_flags &= ~(NLM_F_EXCL |25512551+ NLM_F_REPLACE);25482552 rtnh = rtnh_next(rtnh, &remaining);25492553 }25502554
···525525 }526526 unlock_sock_fast(sk, slow);527527528528- if (noblock)529529- return -EAGAIN;530530-531531- /* starting over for a new packet */528528+ /* starting over for a new packet, but check if we need to yield */529529+ cond_resched();532530 msg->msg_flags &= ~MSG_TRUNC;533531 goto try_again;534532}···729731 (inet->inet_dport && inet->inet_dport != rmt_port) ||730732 (!ipv6_addr_any(&sk->sk_v6_daddr) &&731733 !ipv6_addr_equal(&sk->sk_v6_daddr, rmt_addr)) ||732732- (sk->sk_bound_dev_if && sk->sk_bound_dev_if != dif))734734+ (sk->sk_bound_dev_if && sk->sk_bound_dev_if != dif) ||735735+ (!ipv6_addr_any(&sk->sk_v6_rcv_saddr) &&736736+ !ipv6_addr_equal(&sk->sk_v6_rcv_saddr, loc_addr)))733737 return false;734738 if (!inet6_mc_check(sk, loc_addr, rmt_addr))735739 return false;
+11-48
net/mac80211/cfg.c
···24952495 struct ieee80211_roc_work *new_roc,24962496 struct ieee80211_roc_work *cur_roc)24972497{24982498- unsigned long j = jiffies;24992499- unsigned long cur_roc_end = cur_roc->hw_start_time +25002500- msecs_to_jiffies(cur_roc->duration);25012501- struct ieee80211_roc_work *next_roc;25022502- int new_dur;24982498+ unsigned long now = jiffies;24992499+ unsigned long remaining = cur_roc->hw_start_time +25002500+ msecs_to_jiffies(cur_roc->duration) -25012501+ now;2503250225042503 if (WARN_ON(!cur_roc->started || !cur_roc->hw_begun))25052504 return false;2506250525072507- if (time_after(j + IEEE80211_ROC_MIN_LEFT, cur_roc_end))25062506+ /* if it doesn't fit entirely, schedule a new one */25072507+ if (new_roc->duration > jiffies_to_msecs(remaining))25082508 return false;2509250925102510 ieee80211_handle_roc_started(new_roc);2511251125122512- new_dur = new_roc->duration - jiffies_to_msecs(cur_roc_end - j);25132513-25142514- /* cur_roc is long enough - add new_roc to the dependents list. */25152515- if (new_dur <= 0) {25162516- list_add_tail(&new_roc->list, &cur_roc->dependents);25172517- return true;25182518- }25192519-25202520- new_roc->duration = new_dur;25212521-25222522- /*25232523- * if cur_roc was already coalesced before, we might25242524- * want to extend the next roc instead of adding25252525- * a new one.25262526- */25272527- next_roc = list_entry(cur_roc->list.next,25282528- struct ieee80211_roc_work, list);25292529- if (&next_roc->list != &local->roc_list &&25302530- next_roc->chan == new_roc->chan &&25312531- next_roc->sdata == new_roc->sdata &&25322532- !WARN_ON(next_roc->started)) {25332533- list_add_tail(&new_roc->list, &next_roc->dependents);25342534- next_roc->duration = max(next_roc->duration,25352535- new_roc->duration);25362536- next_roc->type = max(next_roc->type, new_roc->type);25372537- return true;25382538- }25392539-25402540- /* add right after cur_roc */25412541- list_add(&new_roc->list, &cur_roc->list);25422542-25122512+ /* add to dependents so we send the expired event properly */25132513+ list_add_tail(&new_roc->list, &cur_roc->dependents);25432514 return true;25442515}25452516···26232652 * In the offloaded ROC case, if it hasn't begun, add26242653 * this new one to the dependent list to be handled26252654 * when the master one begins. If it has begun,26262626- * check that there's still a minimum time left and26272627- * if so, start this one, transmitting the frame, but26282628- * add it to the list directly after this one with26292629- * a reduced time so we'll ask the driver to execute26302630- * it right after finishing the previous one, in the26312631- * hope that it'll also be executed right afterwards,26322632- * effectively extending the old one.26332633- * If there's no minimum time left, just add it to the26342634- * normal list.26352635- * TODO: the ROC type is ignored here, assuming that it26362636- * is better to immediately use the current ROC.26552655+ * check if it fits entirely within the existing one,26562656+ * in which case it will just be dependent as well.26572657+ * Otherwise, schedule it by itself.26372658 */26382659 if (!tmp->hw_begun) {26392660 list_add_tail(&roc->list, &tmp->dependents);
+3-6
net/mac80211/ieee80211_i.h
···205205 * @IEEE80211_RX_CMNTR: received on cooked monitor already206206 * @IEEE80211_RX_BEACON_REPORTED: This frame was already reported207207 * to cfg80211_report_obss_beacon().208208+ * @IEEE80211_RX_REORDER_TIMER: this frame is released by the209209+ * reorder buffer timeout timer, not the normal RX path208210 *209211 * These flags are used across handling multiple interfaces210212 * for a single frame.···214212enum ieee80211_rx_flags {215213 IEEE80211_RX_CMNTR = BIT(0),216214 IEEE80211_RX_BEACON_REPORTED = BIT(1),215215+ IEEE80211_RX_REORDER_TIMER = BIT(2),217216};218217219218struct ieee80211_rx_data {···327324 u8 dst[ETH_ALEN];328325 u8 flags;329326};330330-331331-#if HZ/100 == 0332332-#define IEEE80211_ROC_MIN_LEFT 1333333-#else334334-#define IEEE80211_ROC_MIN_LEFT (HZ/100)335335-#endif336327337328struct ieee80211_roc_work {338329 struct list_head list;
···21212121 /* deliver to local stack */21222122 skb->protocol = eth_type_trans(skb, dev);21232123 memset(skb->cb, 0, sizeof(skb->cb));21242124- if (rx->local->napi)21242124+ if (!(rx->flags & IEEE80211_RX_REORDER_TIMER) &&21252125+ rx->local->napi)21252126 napi_gro_receive(rx->local->napi, skb);21262127 else21272128 netif_receive_skb(skb);···32323231 /* This is OK -- must be QoS data frame */32333232 .security_idx = tid,32343233 .seqno_idx = tid,32353235- .flags = 0,32343234+ .flags = IEEE80211_RX_REORDER_TIMER,32363235 };32373236 struct tid_ampdu_rx *tid_agg_rx;32383237
+3
net/mac80211/util.c
···2023202320242024 /* add back keys */20252025 list_for_each_entry(sdata, &local->interfaces, list)20262026+ ieee80211_reset_crypto_tx_tailroom(sdata);20272027+20282028+ list_for_each_entry(sdata, &local->interfaces, list)20262029 if (ieee80211_sdata_running(sdata))20272030 ieee80211_enable_keys(sdata);20282031
+4-2
net/mac80211/wep.c
···98989999 hdr->frame_control |= cpu_to_le16(IEEE80211_FCTL_PROTECTED);100100101101- if (WARN_ON(skb_tailroom(skb) < IEEE80211_WEP_ICV_LEN ||102102- skb_headroom(skb) < IEEE80211_WEP_IV_LEN))101101+ if (WARN_ON(skb_headroom(skb) < IEEE80211_WEP_IV_LEN))103102 return NULL;104103105104 hdrlen = ieee80211_hdrlen(hdr->frame_control);···165166 u8 *iv;166167 size_t len;167168 u8 rc4key[3 + WLAN_KEY_LEN_WEP104];169169+170170+ if (WARN_ON(skb_tailroom(skb) < IEEE80211_WEP_ICV_LEN))171171+ return -1;168172169173 iv = ieee80211_wep_add_iv(local, skb, keylen, keyidx);170174 if (!iv)
+2
net/netfilter/Kconfig
···863863 depends on NETFILTER_XTABLES864864 depends on NETFILTER_ADVANCED865865 depends on (IPV6 || IPV6=n)866866+ depends on (IP6_NF_IPTABLES || IP6_NF_IPTABLES=n)866867 depends on IP_NF_MANGLE867868 select NF_DEFRAG_IPV4868869 select NF_DEFRAG_IPV6 if IP6_NF_IPTABLES···13571356 depends on NETFILTER_ADVANCED13581357 depends on !NF_CONNTRACK || NF_CONNTRACK13591358 depends on (IPV6 || IPV6=n)13591359+ depends on (IP6_NF_IPTABLES || IP6_NF_IPTABLES=n)13601360 select NF_DEFRAG_IPV413611361 select NF_DEFRAG_IPV6 if IP6_NF_IPTABLES13621362 help
+3
net/netfilter/ipvs/ip_vs_ctl.c
···38233823 cancel_work_sync(&ipvs->defense_work.work);38243824 unregister_net_sysctl_table(ipvs->sysctl_hdr);38253825 ip_vs_stop_estimator(net, &ipvs->tot_stats);38263826+38273827+ if (!net_eq(net, &init_net))38283828+ kfree(ipvs->sysctl_tbl);38263829}3827383038283831#else
+32-3
net/netfilter/nf_conntrack_proto_tcp.c
···202202 * sES -> sES :-)203203 * sFW -> sCW Normal close request answered by ACK.204204 * sCW -> sCW205205- * sLA -> sTW Last ACK detected.205205+ * sLA -> sTW Last ACK detected (RFC5961 challenged)206206 * sTW -> sTW Retransmitted last ACK. Remain in the same state.207207 * sCL -> sCL208208 */···261261 * sES -> sES :-)262262 * sFW -> sCW Normal close request answered by ACK.263263 * sCW -> sCW264264- * sLA -> sTW Last ACK detected.264264+ * sLA -> sTW Last ACK detected (RFC5961 challenged)265265 * sTW -> sTW Retransmitted last ACK.266266 * sCL -> sCL267267 */···906906 1 : ct->proto.tcp.last_win;907907 ct->proto.tcp.seen[ct->proto.tcp.last_dir].td_scale =908908 ct->proto.tcp.last_wscale;909909+ ct->proto.tcp.last_flags &= ~IP_CT_EXP_CHALLENGE_ACK;909910 ct->proto.tcp.seen[ct->proto.tcp.last_dir].flags =910911 ct->proto.tcp.last_flags;911912 memset(&ct->proto.tcp.seen[dir], 0,···924923 * may be in sync but we are not. In that case, we annotate925924 * the TCP options and let the packet go through. If it is a926925 * valid SYN packet, the server will reply with a SYN/ACK, and927927- * then we'll get in sync. Otherwise, the server ignores it. */926926+ * then we'll get in sync. Otherwise, the server potentially927927+ * responds with a challenge ACK if implementing RFC5961.928928+ */928929 if (index == TCP_SYN_SET && dir == IP_CT_DIR_ORIGINAL) {929930 struct ip_ct_tcp_state seen = {};930931···942939 ct->proto.tcp.last_flags |=943940 IP_CT_TCP_FLAG_SACK_PERM;944941 }942942+ /* Mark the potential for RFC5961 challenge ACK,943943+ * this pose a special problem for LAST_ACK state944944+ * as ACK is intrepretated as ACKing last FIN.945945+ */946946+ if (old_state == TCP_CONNTRACK_LAST_ACK)947947+ ct->proto.tcp.last_flags |=948948+ IP_CT_EXP_CHALLENGE_ACK;945949 }946950 spin_unlock_bh(&ct->lock);947951 if (LOG_INVALID(net, IPPROTO_TCP))···980970 nf_log_packet(net, pf, 0, skb, NULL, NULL, NULL,981971 "nf_ct_tcp: invalid state ");982972 return -NF_ACCEPT;973973+ case TCP_CONNTRACK_TIME_WAIT:974974+ /* RFC5961 compliance cause stack to send "challenge-ACK"975975+ * e.g. in response to spurious SYNs. Conntrack MUST976976+ * not believe this ACK is acking last FIN.977977+ */978978+ if (old_state == TCP_CONNTRACK_LAST_ACK &&979979+ index == TCP_ACK_SET &&980980+ ct->proto.tcp.last_dir != dir &&981981+ ct->proto.tcp.last_index == TCP_SYN_SET &&982982+ (ct->proto.tcp.last_flags & IP_CT_EXP_CHALLENGE_ACK)) {983983+ /* Detected RFC5961 challenge ACK */984984+ ct->proto.tcp.last_flags &= ~IP_CT_EXP_CHALLENGE_ACK;985985+ spin_unlock_bh(&ct->lock);986986+ if (LOG_INVALID(net, IPPROTO_TCP))987987+ nf_log_packet(net, pf, 0, skb, NULL, NULL, NULL,988988+ "nf_ct_tcp: challenge-ACK ignored ");989989+ return NF_ACCEPT; /* Don't change state */990990+ }991991+ break;983992 case TCP_CONNTRACK_CLOSE:984993 if (index == TCP_RST_SET985994 && (ct->proto.tcp.seen[!dir].flags & IP_CT_TCP_FLAG_MAXACK_SET)
+2-2
net/netfilter/nf_tables_api.c
···44724472 */44734473void nft_data_uninit(const struct nft_data *data, enum nft_data_types type)44744474{44754475- switch (type) {44764476- case NFT_DATA_VALUE:44754475+ if (type < NFT_DATA_VERDICT)44774476 return;44774477+ switch (type) {44784478 case NFT_DATA_VERDICT:44794479 return nft_verdict_uninit(data);44804480 default:
+10-9
net/netfilter/nfnetlink_log.c
···1073107310741074static int __init nfnetlink_log_init(void)10751075{10761076- int status = -ENOMEM;10761076+ int status;10771077+10781078+ status = register_pernet_subsys(&nfnl_log_net_ops);10791079+ if (status < 0) {10801080+ pr_err("failed to register pernet ops\n");10811081+ goto out;10821082+ }1077108310781084 netlink_register_notifier(&nfulnl_rtnl_notifier);10791085 status = nfnetlink_subsys_register(&nfulnl_subsys);···10941088 goto cleanup_subsys;10951089 }1096109010971097- status = register_pernet_subsys(&nfnl_log_net_ops);10981098- if (status < 0) {10991099- pr_err("failed to register pernet ops\n");11001100- goto cleanup_logger;11011101- }11021091 return status;1103109211041104-cleanup_logger:11051105- nf_log_unregister(&nfulnl_logger);11061093cleanup_subsys:11071094 nfnetlink_subsys_unregister(&nfulnl_subsys);11081095cleanup_netlink_notifier:11091096 netlink_unregister_notifier(&nfulnl_rtnl_notifier);10971097+ unregister_pernet_subsys(&nfnl_log_net_ops);10981098+out:11101099 return status;11111100}1112110111131102static void __exit nfnetlink_log_fini(void)11141103{11151115- unregister_pernet_subsys(&nfnl_log_net_ops);11161104 nf_log_unregister(&nfulnl_logger);11171105 nfnetlink_subsys_unregister(&nfulnl_subsys);11181106 netlink_unregister_notifier(&nfulnl_rtnl_notifier);11071107+ unregister_pernet_subsys(&nfnl_log_net_ops);11191108}1120110911211110MODULE_DESCRIPTION("netfilter userspace logging");
+9-9
net/netfilter/nfnetlink_queue_core.c
···1317131713181318static int __init nfnetlink_queue_init(void)13191319{13201320- int status = -ENOMEM;13201320+ int status;13211321+13221322+ status = register_pernet_subsys(&nfnl_queue_net_ops);13231323+ if (status < 0) {13241324+ pr_err("nf_queue: failed to register pernet ops\n");13251325+ goto out;13261326+ }1321132713221328 netlink_register_notifier(&nfqnl_rtnl_notifier);13231329 status = nfnetlink_subsys_register(&nfqnl_subsys);···13321326 goto cleanup_netlink_notifier;13331327 }1334132813351335- status = register_pernet_subsys(&nfnl_queue_net_ops);13361336- if (status < 0) {13371337- pr_err("nf_queue: failed to register pernet ops\n");13381338- goto cleanup_subsys;13391339- }13401329 register_netdevice_notifier(&nfqnl_dev_notifier);13411330 nf_register_queue_handler(&nfqh);13421331 return status;1343133213441344-cleanup_subsys:13451345- nfnetlink_subsys_unregister(&nfqnl_subsys);13461333cleanup_netlink_notifier:13471334 netlink_unregister_notifier(&nfqnl_rtnl_notifier);13351335+out:13481336 return status;13491337}13501338···13461346{13471347 nf_unregister_queue_handler();13481348 unregister_netdevice_notifier(&nfqnl_dev_notifier);13491349- unregister_pernet_subsys(&nfnl_queue_net_ops);13501349 nfnetlink_subsys_unregister(&nfqnl_subsys);13511350 netlink_unregister_notifier(&nfqnl_rtnl_notifier);13511351+ unregister_pernet_subsys(&nfnl_queue_net_ops);1352135213531353 rcu_barrier(); /* Wait for completion of call_rcu()'s */13541354}
···8181 struct tcf_proto_ops *t;8282 int rc = -ENOENT;83838484+ /* Wait for outstanding call_rcu()s, if any, from a8585+ * tcf_proto_ops's destroy() handler.8686+ */8787+ rcu_barrier();8888+8489 write_lock(&cls_mod_lock);8590 list_for_each_entry(t, &tcf_proto_base, head) {8691 if (t == ops) {
+6-4
net/sched/sch_api.c
···815815 if (dev->flags & IFF_UP)816816 dev_deactivate(dev);817817818818- if (new && new->ops->attach) {819819- new->ops->attach(new);820820- num_q = 0;821821- }818818+ if (new && new->ops->attach)819819+ goto skip;822820823821 for (i = 0; i < num_q; i++) {824822 struct netdev_queue *dev_queue = dev_ingress_queue(dev);···832834 qdisc_destroy(old);833835 }834836837837+skip:835838 if (!ingress) {836839 notify_and_destroy(net, skb, n, classid,837840 dev->qdisc, new);838841 if (new && !new->ops->attach)839842 atomic_inc(&new->refcnt);840843 dev->qdisc = new ? : &noop_qdisc;844844+845845+ if (new && new->ops->attach)846846+ new->ops->attach(new);841847 } else {842848 notify_and_destroy(net, skb, n, classid, old, new);843849 }
+3-3
net/switchdev/switchdev.c
···338338 fi, tos, type, nlflags,339339 tb_id);340340 if (!err)341341- fi->fib_flags |= RTNH_F_EXTERNAL;341341+ fi->fib_flags |= RTNH_F_OFFLOAD;342342 }343343344344 return err;···364364 const struct swdev_ops *ops;365365 int err = 0;366366367367- if (!(fi->fib_flags & RTNH_F_EXTERNAL))367367+ if (!(fi->fib_flags & RTNH_F_OFFLOAD))368368 return 0;369369370370 dev = netdev_switch_get_dev_by_nhs(fi);···376376 err = ops->swdev_fib_ipv4_del(dev, htonl(dst), dst_len,377377 fi, tos, type, tb_id);378378 if (!err)379379- fi->fib_flags &= ~RTNH_F_EXTERNAL;379379+ fi->fib_flags &= ~RTNH_F_OFFLOAD;380380 }381381382382 return err;
+8
net/unix/af_unix.c
···18801880 unix_state_unlock(sk);18811881 timeo = freezable_schedule_timeout(timeo);18821882 unix_state_lock(sk);18831883+18841884+ if (sock_flag(sk, SOCK_DEAD))18851885+ break;18861886+18831887 clear_bit(SOCK_ASYNC_WAITDATA, &sk->sk_socket->flags);18841888 }18851889···19431939 struct sk_buff *skb, *last;1944194019451941 unix_state_lock(sk);19421942+ if (sock_flag(sk, SOCK_DEAD)) {19431943+ err = -ECONNRESET;19441944+ goto unlock;19451945+ }19461946 last = skb = skb_peek(&sk->sk_receive_queue);19471947again:19481948 if (skb == NULL) {
+16-1
net/xfrm/xfrm_input.c
···1313#include <net/dst.h>1414#include <net/ip.h>1515#include <net/xfrm.h>1616+#include <net/ip_tunnels.h>1717+#include <net/ip6_tunnel.h>16181719static struct kmem_cache *secpath_cachep __read_mostly;1820···188186 struct xfrm_state *x = NULL;189187 xfrm_address_t *daddr;190188 struct xfrm_mode *inner_mode;189189+ u32 mark = skb->mark;191190 unsigned int family;192191 int decaps = 0;193192 int async = 0;···205202 daddr = (xfrm_address_t *)(skb_network_header(skb) +206203 XFRM_SPI_SKB_CB(skb)->daddroff);207204 family = XFRM_SPI_SKB_CB(skb)->family;205205+206206+ /* if tunnel is present override skb->mark value with tunnel i_key */207207+ if (XFRM_TUNNEL_SKB_CB(skb)->tunnel.ip4) {208208+ switch (family) {209209+ case AF_INET:210210+ mark = be32_to_cpu(XFRM_TUNNEL_SKB_CB(skb)->tunnel.ip4->parms.i_key);211211+ break;212212+ case AF_INET6:213213+ mark = be32_to_cpu(XFRM_TUNNEL_SKB_CB(skb)->tunnel.ip6->parms.i_key);214214+ break;215215+ }216216+ }208217209218 /* Allocate new secpath or COW existing one. */210219 if (!skb->sp || atomic_read(&skb->sp->refcnt) != 1) {···244229 goto drop;245230 }246231247247- x = xfrm_state_lookup(net, skb->mark, daddr, spi, nexthdr, family);232232+ x = xfrm_state_lookup(net, mark, daddr, spi, nexthdr, family);248233 if (x == NULL) {249234 XFRM_INC_STATS(net, LINUX_MIB_XFRMINNOSTATES);250235 xfrm_audit_state_notfound(skb, family, spi, seq);
+2
net/xfrm/xfrm_replay.c
···9999100100 if (x->type->flags & XFRM_TYPE_REPLAY_PROT) {101101 XFRM_SKB_CB(skb)->seq.output.low = ++x->replay.oseq;102102+ XFRM_SKB_CB(skb)->seq.output.hi = 0;102103 if (unlikely(x->replay.oseq == 0)) {103104 x->replay.oseq--;104105 xfrm_audit_state_replay_overflow(x, skb);···178177179178 if (x->type->flags & XFRM_TYPE_REPLAY_PROT) {180179 XFRM_SKB_CB(skb)->seq.output.low = ++replay_esn->oseq;180180+ XFRM_SKB_CB(skb)->seq.output.hi = 0;181181 if (unlikely(replay_esn->oseq == 0)) {182182 replay_esn->oseq--;183183 xfrm_audit_state_replay_overflow(x, skb);
···7373 " " if utils.get_long_type().sizeof == 8 else ""))74747575 for module in module_list():7676- ref = 07777- module_refptr = module['refptr']7878- for cpu in cpus.cpu_list("cpu_possible_mask"):7979- refptr = cpus.per_cpu(module_refptr, cpu)8080- ref += refptr['incs']8181- ref -= refptr['decs']8282-8376 gdb.write("{address} {name:<19} {size:>8} {ref}".format(8477 address=str(module['module_core']).split()[0],8578 name=module['name'].string(),8679 size=str(module['core_size']),8787- ref=str(ref)))8080+ ref=str(module['refcnt']['counter'])))88818982 source_list = module['source_list']9083 t = self._module_use_type.get_type().pointer()
-1
sound/atmel/ac97c.c
···916916{917917 struct ac97c_platform_data *pdata;918918 struct device_node *node = dev->of_node;919919- const struct of_device_id *match;920919921920 if (!node) {922921 dev_err(dev, "Device does not have associated DT data\n");
+1-1
sound/core/pcm_lib.c
···339339 if (delta > new_hw_ptr) {340340 /* check for double acknowledged interrupts */341341 hdelta = curr_jiffies - runtime->hw_ptr_jiffies;342342- if (hdelta > runtime->hw_ptr_buffer_jiffies/2) {342342+ if (hdelta > runtime->hw_ptr_buffer_jiffies/2 + 1) {343343 hw_base += runtime->buffer_size;344344 if (hw_base >= runtime->boundary) {345345 hw_base = 0;
+12-1
sound/pci/hda/hda_generic.c
···844844 snd_hda_codec_write(codec, nid, 0,845845 AC_VERB_SET_POWER_STATE, state);846846 changed = nid;847847+ /* all known codecs seem to be capable to handl848848+ * widgets state even in D3, so far.849849+ * if any new codecs need to restore the widget850850+ * states after D0 transition, call the function851851+ * below.852852+ */853853+#if 0 /* disabled */847854 if (state == AC_PWRST_D0)848855 snd_hdac_regmap_sync_node(&codec->core, nid);856856+#endif849857 }850858 }851859 return changed;···49264918 dig_only:49274919 parse_digital(codec);4928492049294929- if (spec->power_down_unused || codec->power_save_node)49214921+ if (spec->power_down_unused || codec->power_save_node) {49304922 if (!codec->power_filter)49314923 codec->power_filter = snd_hda_gen_path_power_filter;49244924+ if (!codec->patch_ops.stream_pm)49254925+ codec->patch_ops.stream_pm = snd_hda_gen_stream_pm;49264926+ }4932492749334928 if (!spec->no_analog && spec->beep_nid) {49344929 err = snd_hda_attach_beep_device(codec, spec->beep_nid);
···11171117 switch (chip->usb_id) {11181118 case USB_ID(0x045E, 0x075D): /* MS Lifecam Cinema */11191119 case USB_ID(0x045E, 0x076D): /* MS Lifecam HD-5000 */11201120+ case USB_ID(0x045E, 0x0772): /* MS Lifecam Studio */11211121+ case USB_ID(0x045E, 0x0779): /* MS Lifecam HD-3000 */11201122 case USB_ID(0x04D8, 0xFEEA): /* Benchmark DAC1 Pre */11211123 return true;11221124 }
+2
tools/net/bpf_jit_disasm.c
···123123 assert(ret == 0);124124125125 ptr = haystack;126126+ memset(pmatch, 0, sizeof(pmatch));127127+126128 while (1) {127129 ret = regexec(®ex, ptr, 1, pmatch, 0);128130 if (ret == 0) {
+184-40
tools/power/x86/turbostat/turbostat.c
···5252unsigned int skip_c1;5353unsigned int do_nhm_cstates;5454unsigned int do_snb_cstates;5555+unsigned int do_knl_cstates;5556unsigned int do_pc2;5657unsigned int do_pc3;5758unsigned int do_pc6;···9291unsigned int do_ring_perf_limit_reasons;9392unsigned int crystal_hz;9493unsigned long long tsc_hz;9494+int base_cpu;95959696#define RAPL_PKG (1 << 0)9797 /* 0x610 MSR_PKG_POWER_LIMIT */···318316319317 if (do_nhm_cstates)320318 outp += sprintf(outp, " CPU%%c1");321321- if (do_nhm_cstates && !do_slm_cstates)319319+ if (do_nhm_cstates && !do_slm_cstates && !do_knl_cstates)322320 outp += sprintf(outp, " CPU%%c3");323321 if (do_nhm_cstates)324322 outp += sprintf(outp, " CPU%%c6");···548546 if (!(t->flags & CPU_IS_FIRST_THREAD_IN_CORE))549547 goto done;550548551551- if (do_nhm_cstates && !do_slm_cstates)549549+ if (do_nhm_cstates && !do_slm_cstates && !do_knl_cstates)552550 outp += sprintf(outp, "%8.2f", 100.0 * c->c3/t->tsc);553551 if (do_nhm_cstates)554552 outp += sprintf(outp, "%8.2f", 100.0 * c->c6/t->tsc);···10201018 if (!(t->flags & CPU_IS_FIRST_THREAD_IN_CORE))10211019 return 0;1022102010231023- if (do_nhm_cstates && !do_slm_cstates) {10211021+ if (do_nhm_cstates && !do_slm_cstates && !do_knl_cstates) {10241022 if (get_msr(cpu, MSR_CORE_C3_RESIDENCY, &c->c3))10251023 return -6;10261024 }1027102510281028- if (do_nhm_cstates) {10261026+ if (do_nhm_cstates && !do_knl_cstates) {10291027 if (get_msr(cpu, MSR_CORE_C6_RESIDENCY, &c->c6))10281028+ return -7;10291029+ } else if (do_knl_cstates) {10301030+ if (get_msr(cpu, MSR_KNL_CORE_C6_RESIDENCY, &c->c6))10301031 return -7;10311032 }10321033···11551150 unsigned long long msr;11561151 unsigned int ratio;1157115211581158- get_msr(0, MSR_NHM_PLATFORM_INFO, &msr);11531153+ get_msr(base_cpu, MSR_NHM_PLATFORM_INFO, &msr);1159115411601155 fprintf(stderr, "cpu0: MSR_NHM_PLATFORM_INFO: 0x%08llx\n", msr);11611156···11671162 fprintf(stderr, "%d * %.0f = %.0f MHz base frequency\n",11681163 ratio, bclk, ratio * bclk);1169116411701170- get_msr(0, MSR_IA32_POWER_CTL, &msr);11651165+ get_msr(base_cpu, MSR_IA32_POWER_CTL, &msr);11711166 fprintf(stderr, "cpu0: MSR_IA32_POWER_CTL: 0x%08llx (C1E auto-promotion: %sabled)\n",11721167 msr, msr & 0x2 ? "EN" : "DIS");11731168···11801175 unsigned long long msr;11811176 unsigned int ratio;1182117711831183- get_msr(0, MSR_TURBO_RATIO_LIMIT2, &msr);11781178+ get_msr(base_cpu, MSR_TURBO_RATIO_LIMIT2, &msr);1184117911851180 fprintf(stderr, "cpu0: MSR_TURBO_RATIO_LIMIT2: 0x%08llx\n", msr);11861181···12021197 unsigned long long msr;12031198 unsigned int ratio;1204119912051205- get_msr(0, MSR_TURBO_RATIO_LIMIT1, &msr);12001200+ get_msr(base_cpu, MSR_TURBO_RATIO_LIMIT1, &msr);1206120112071202 fprintf(stderr, "cpu0: MSR_TURBO_RATIO_LIMIT1: 0x%08llx\n", msr);12081203···12541249 unsigned long long msr;12551250 unsigned int ratio;1256125112571257- get_msr(0, MSR_TURBO_RATIO_LIMIT, &msr);12521252+ get_msr(base_cpu, MSR_TURBO_RATIO_LIMIT, &msr);1258125312591254 fprintf(stderr, "cpu0: MSR_TURBO_RATIO_LIMIT: 0x%08llx\n", msr);12601255···13011296}1302129713031298static void12991299+dump_knl_turbo_ratio_limits(void)13001300+{13011301+ int cores;13021302+ unsigned int ratio;13031303+ unsigned long long msr;13041304+ int delta_cores;13051305+ int delta_ratio;13061306+ int i;13071307+13081308+ get_msr(base_cpu, MSR_NHM_TURBO_RATIO_LIMIT, &msr);13091309+13101310+ fprintf(stderr, "cpu0: MSR_NHM_TURBO_RATIO_LIMIT: 0x%08llx\n",13111311+ msr);13121312+13131313+ /**13141314+ * Turbo encoding in KNL is as follows:13151315+ * [7:0] -- Base value of number of active cores of bucket 1.13161316+ * [15:8] -- Base value of freq ratio of bucket 1.13171317+ * [20:16] -- +ve delta of number of active cores of bucket 2.13181318+ * i.e. active cores of bucket 2 =13191319+ * active cores of bucket 1 + delta13201320+ * [23:21] -- Negative delta of freq ratio of bucket 2.13211321+ * i.e. freq ratio of bucket 2 =13221322+ * freq ratio of bucket 1 - delta13231323+ * [28:24]-- +ve delta of number of active cores of bucket 3.13241324+ * [31:29]-- -ve delta of freq ratio of bucket 3.13251325+ * [36:32]-- +ve delta of number of active cores of bucket 4.13261326+ * [39:37]-- -ve delta of freq ratio of bucket 4.13271327+ * [44:40]-- +ve delta of number of active cores of bucket 5.13281328+ * [47:45]-- -ve delta of freq ratio of bucket 5.13291329+ * [52:48]-- +ve delta of number of active cores of bucket 6.13301330+ * [55:53]-- -ve delta of freq ratio of bucket 6.13311331+ * [60:56]-- +ve delta of number of active cores of bucket 7.13321332+ * [63:61]-- -ve delta of freq ratio of bucket 7.13331333+ */13341334+ cores = msr & 0xFF;13351335+ ratio = (msr >> 8) && 0xFF;13361336+ if (ratio > 0)13371337+ fprintf(stderr,13381338+ "%d * %.0f = %.0f MHz max turbo %d active cores\n",13391339+ ratio, bclk, ratio * bclk, cores);13401340+13411341+ for (i = 16; i < 64; i = i + 8) {13421342+ delta_cores = (msr >> i) & 0x1F;13431343+ delta_ratio = (msr >> (i + 5)) && 0x7;13441344+ if (!delta_cores || !delta_ratio)13451345+ return;13461346+ cores = cores + delta_cores;13471347+ ratio = ratio - delta_ratio;13481348+13491349+ /** -ve ratios will make successive ratio calculations13501350+ * negative. Hence return instead of carrying on.13511351+ */13521352+ if (ratio > 0)13531353+ fprintf(stderr,13541354+ "%d * %.0f = %.0f MHz max turbo %d active cores\n",13551355+ ratio, bclk, ratio * bclk, cores);13561356+ }13571357+}13581358+13591359+static void13041360dump_nhm_cst_cfg(void)13051361{13061362 unsigned long long msr;1307136313081308- get_msr(0, MSR_NHM_SNB_PKG_CST_CFG_CTL, &msr);13641364+ get_msr(base_cpu, MSR_NHM_SNB_PKG_CST_CFG_CTL, &msr);1309136513101366#define SNB_C1_AUTO_UNDEMOTE (1UL << 27)13111367#define SNB_C3_AUTO_UNDEMOTE (1UL << 28)···14471381}1448138214491383/*14501450- * cpu_is_first_sibling_in_core(cpu)14511451- * return 1 if given CPU is 1st HT sibling in the core13841384+ * get_cpu_position_in_core(cpu)13851385+ * return the position of the CPU among its HT siblings in the core13861386+ * return -1 if the sibling is not in list14521387 */14531453-int cpu_is_first_sibling_in_core(int cpu)13881388+int get_cpu_position_in_core(int cpu)14541389{14551455- return cpu == parse_int_file("/sys/devices/system/cpu/cpu%d/topology/thread_siblings_list", cpu);13901390+ char path[64];13911391+ FILE *filep;13921392+ int this_cpu;13931393+ char character;13941394+ int i;13951395+13961396+ sprintf(path,13971397+ "/sys/devices/system/cpu/cpu%d/topology/thread_siblings_list",13981398+ cpu);13991399+ filep = fopen(path, "r");14001400+ if (filep == NULL) {14011401+ perror(path);14021402+ exit(1);14031403+ }14041404+14051405+ for (i = 0; i < topo.num_threads_per_core; i++) {14061406+ fscanf(filep, "%d", &this_cpu);14071407+ if (this_cpu == cpu) {14081408+ fclose(filep);14091409+ return i;14101410+ }14111411+14121412+ /* Account for no separator after last thread*/14131413+ if (i != (topo.num_threads_per_core - 1))14141414+ fscanf(filep, "%c", &character);14151415+ }14161416+14171417+ fclose(filep);14181418+ return -1;14561419}1457142014581421/*···15071412{15081413 char path[80];15091414 FILE *filep;15101510- int sib1, sib2;15111511- int matches;14151415+ int sib1;14161416+ int matches = 0;15121417 char character;14181418+ char str[100];14191419+ char *ch;1513142015141421 sprintf(path, "/sys/devices/system/cpu/cpu%d/topology/thread_siblings_list", cpu);15151422 filep = fopen_or_die(path, "r");14231423+15161424 /*15171425 * file format:15181518- * if a pair of number with a character between: 2 siblings (eg. 1-2, or 1,4)15191519- * otherwinse 1 sibling (self).14261426+ * A ',' separated or '-' separated set of numbers14271427+ * (eg 1-2 or 1,3,4,5)15201428 */15211521- matches = fscanf(filep, "%d%c%d\n", &sib1, &character, &sib2);14291429+ fscanf(filep, "%d%c\n", &sib1, &character);14301430+ fseek(filep, 0, SEEK_SET);14311431+ fgets(str, 100, filep);14321432+ ch = strchr(str, character);14331433+ while (ch != NULL) {14341434+ matches++;14351435+ ch = strchr(ch+1, character);14361436+ }1522143715231438 fclose(filep);15241524-15251525- if (matches == 3)15261526- return 2;15271527- else15281528- return 1;14391439+ return matches+1;15291440}1530144115311442/*···16951594void check_dev_msr()16961595{16971596 struct stat sb;15971597+ char pathname[32];1698159816991699- if (stat("/dev/cpu/0/msr", &sb))15991599+ sprintf(pathname, "/dev/cpu/%d/msr", base_cpu);16001600+ if (stat(pathname, &sb))17001601 if (system("/sbin/modprobe msr > /dev/null 2>&1"))17011602 err(-5, "no /dev/cpu/0/msr, Try \"# modprobe msr\" ");17021603}···17111608 cap_user_data_t cap_data = &cap_data_data;17121609 extern int capget(cap_user_header_t hdrp, cap_user_data_t datap);17131610 int do_exit = 0;16111611+ char pathname[32];1714161217151613 /* check for CAP_SYS_RAWIO */17161614 cap_header->pid = getpid();···17261622 }1727162317281624 /* test file permissions */17291729- if (euidaccess("/dev/cpu/0/msr", R_OK)) {16251625+ sprintf(pathname, "/dev/cpu/%d/msr", base_cpu);16261626+ if (euidaccess(pathname, R_OK)) {17301627 do_exit++;17311628 warn("/dev/cpu/0/msr open failed, try chown or chmod +r /dev/cpu/*/msr");17321629 }···18091704 default:18101705 return 0;18111706 }18121812- get_msr(0, MSR_NHM_SNB_PKG_CST_CFG_CTL, &msr);17071707+ get_msr(base_cpu, MSR_NHM_SNB_PKG_CST_CFG_CTL, &msr);1813170818141709 pkg_cstate_limit = pkg_cstate_limits[msr & 0xF];18151710···18581753 }18591754}1860175517561756+int has_knl_turbo_ratio_limit(unsigned int family, unsigned int model)17571757+{17581758+ if (!genuine_intel)17591759+ return 0;17601760+17611761+ if (family != 6)17621762+ return 0;17631763+17641764+ switch (model) {17651765+ case 0x57: /* Knights Landing */17661766+ return 1;17671767+ default:17681768+ return 0;17691769+ }17701770+}18611771static void18621772dump_cstate_pstate_config_info(family, model)18631773{···1889176918901770 if (has_nhm_turbo_ratio_limit(family, model))18911771 dump_nhm_turbo_ratio_limits();17721772+17731773+ if (has_knl_turbo_ratio_limit(family, model))17741774+ dump_knl_turbo_ratio_limits();1892177518931776 dump_nhm_cst_cfg();18941777}···19241801 if (get_msr(cpu, MSR_IA32_ENERGY_PERF_BIAS, &msr))19251802 return 0;1926180319271927- switch (msr & 0x7) {18041804+ switch (msr & 0xF) {19281805 case ENERGY_PERF_BIAS_PERFORMANCE:19291806 epb_string = "performance";19301807 break;···20481925 unsigned long long msr;2049192620501927 if (do_rapl & RAPL_PKG_POWER_INFO)20512051- if (!get_msr(0, MSR_PKG_POWER_INFO, &msr))19281928+ if (!get_msr(base_cpu, MSR_PKG_POWER_INFO, &msr))20521929 return ((msr >> 0) & RAPL_POWER_GRANULARITY) * rapl_power_units;2053193020541931 switch (model) {···20731950 case 0x3F: /* HSX */20741951 case 0x4F: /* BDX */20751952 case 0x56: /* BDX-DE */19531953+ case 0x57: /* KNL */20761954 return (rapl_dram_energy_units = 15.3 / 1000000);20771955 default:20781956 return (rapl_energy_units);···21151991 case 0x3F: /* HSX */21161992 case 0x4F: /* BDX */21171993 case 0x56: /* BDX-DE */19941994+ case 0x57: /* KNL */21181995 do_rapl = RAPL_PKG | RAPL_DRAM | RAPL_DRAM_POWER_INFO | RAPL_DRAM_PERF_STATUS | RAPL_PKG_PERF_STATUS | RAPL_PKG_POWER_INFO;21191996 break;21201997 case 0x2D:···21312006 }2132200721332008 /* units on package 0, verify later other packages match */21342134- if (get_msr(0, MSR_RAPL_POWER_UNIT, &msr))20092009+ if (get_msr(base_cpu, MSR_RAPL_POWER_UNIT, &msr))21352010 return;2136201121372012 rapl_power_units = 1.0 / (1 << (msr & 0xF));···24562331 return 0;24572332}2458233323342334+int is_knl(unsigned int family, unsigned int model)23352335+{23362336+ if (!genuine_intel)23372337+ return 0;23382338+ switch (model) {23392339+ case 0x57: /* KNL */23402340+ return 1;23412341+ }23422342+ return 0;23432343+}23442344+24592345#define SLM_BCLK_FREQS 524602346double slm_freq_table[SLM_BCLK_FREQS] = { 83.3, 100.0, 133.3, 116.7, 80.0};24612347···24762340 unsigned int i;24772341 double freq;2478234224792479- if (get_msr(0, MSR_FSB_FREQ, &msr))23432343+ if (get_msr(base_cpu, MSR_FSB_FREQ, &msr))24802344 fprintf(stderr, "SLM BCLK: unknown\n");2481234524822346 i = msr & 0xf;···25442408 if (!do_nhm_platform_info)25452409 goto guess;2546241025472547- if (get_msr(0, MSR_IA32_TEMPERATURE_TARGET, &msr))24112411+ if (get_msr(base_cpu, MSR_IA32_TEMPERATURE_TARGET, &msr))25482412 goto guess;2549241325502414 target_c_local = (msr >> 16) & 0xFF;···26772541 do_c8_c9_c10 = has_hsw_msrs(family, model);26782542 do_skl_residency = has_skl_msrs(family, model);26792543 do_slm_cstates = is_slm(family, model);25442544+ do_knl_cstates = is_knl(family, model);26802545 bclk = discover_bclk(family, model);2681254626822547 rapl_probe(family, model);···2892275528932756 my_package_id = get_physical_package_id(cpu_id);28942757 my_core_id = get_core_id(cpu_id);28952895-28962896- if (cpu_is_first_sibling_in_core(cpu_id)) {28972897- my_thread_id = 0;27582758+ my_thread_id = get_cpu_position_in_core(cpu_id);27592759+ if (!my_thread_id)28982760 topo.num_cores++;28992899- } else {29002900- my_thread_id = 1;29012901- }2902276129032762 init_counter(EVEN_COUNTERS, my_thread_id, my_core_id, my_package_id, cpu_id);29042763 init_counter(ODD_COUNTERS, my_thread_id, my_core_id, my_package_id, cpu_id);···29182785 for_all_proc_cpus(initialize_counters);29192786}2920278727882788+void set_base_cpu(void)27892789+{27902790+ base_cpu = sched_getcpu();27912791+ if (base_cpu < 0)27922792+ err(-ENODEV, "No valid cpus found");27932793+27942794+ if (debug > 1)27952795+ fprintf(stderr, "base_cpu = %d\n", base_cpu);27962796+}27972797+29212798void turbostat_init()29222799{28002800+ setup_all_buffers();28012801+ set_base_cpu();29232802 check_dev_msr();29242803 check_permissions();29252804 process_cpuid();2926280529272927- setup_all_buffers();2928280629292807 if (debug)29302808 for_all_cpus(print_epb, ODD_COUNTERS);···30142870}3015287130162872void print_version() {30173017- fprintf(stderr, "turbostat version 4.5 2 Apr, 2015"28732873+ fprintf(stderr, "turbostat version 4.7 27-May, 2015"30182874 " - Len Brown <lenb@kernel.org>\n");30192875}30202876