···5959James Bottomley <jejb@titanic.il.steeleye.com>6060James E Wilson <wilson@specifix.com>6161James Ketrenos <jketreno@io.(none)>6262+<javier@osg.samsung.com> <javier.martinez@collabora.co.uk>6263Jean Tourrilhes <jt@hpl.hp.com>6364Jeff Garzik <jgarzik@pretzel.yyz.us>6465Jens Axboe <axboe@suse.de>
+7
Documentation/arm/OMAP/README
···11+This file contains documentation for running mainline22+kernel on omaps.33+44+KERNEL NEW DEPENDENCIES55+v4.3+ Update is needed for custom .config files to make sure66+ CONFIG_REGULATOR_PBIAS is enabled for MMC1 to work77+ properly.
+28-3
MAINTAINERS
···894894L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)895895S: Maintained896896897897-ARM/Allwinner A1X SoC support897897+ARM/Allwinner sunXi SoC support898898M: Maxime Ripard <maxime.ripard@free-electrons.com>899899+M: Chen-Yu Tsai <wens@csie.org>899900L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)900901S: Maintained901901-N: sun[x4567]i902902+N: sun[x456789]i902903903904ARM/Allwinner SoC Clock Support904905M: Emilio López <emilio@elopez.com.ar>···35923591F: include/drm/i915*35933592F: include/uapi/drm/i915*3594359335943594+DRM DRIVERS FOR ATMEL HLCDC35953595+M: Boris Brezillon <boris.brezillon@free-electrons.com>35963596+L: dri-devel@lists.freedesktop.org35973597+S: Supported35983598+F: drivers/gpu/drm/atmel-hlcdc/35993599+F: Documentation/devicetree/bindings/drm/atmel/36003600+35953601DRM DRIVERS FOR EXYNOS35963602M: Inki Dae <inki.dae@samsung.com>35973603M: Joonyoung Shim <jy0922.shim@samsung.com>···36263618S: Maintained36273619F: drivers/gpu/drm/imx/36283620F: Documentation/devicetree/bindings/drm/imx/36213621+36223622+DRM DRIVERS FOR GMA500 (Poulsbo, Moorestown and derivative chipsets)36233623+M: Patrik Jakobsson <patrik.r.jakobsson@gmail.com>36243624+L: dri-devel@lists.freedesktop.org36253625+T: git git://github.com/patjak/drm-gma50036263626+S: Maintained36273627+F: drivers/gpu/drm/gma50036283628+F: include/drm/gma500*3629362936303630DRM DRIVERS FOR NVIDIA TEGRA36313631M: Thierry Reding <thierry.reding@gmail.com>···6800678468016785MELLANOX ETHERNET DRIVER (mlx4_en)68026786M: Amir Vadai <amirv@mellanox.com>68036803-M: Ido Shamay <idos@mellanox.com>68046787L: netdev@vger.kernel.org68056788S: Supported68066789W: http://www.mellanox.com···91289113S: Supported91299114F: Documentation/devicetree/bindings/net/snps,dwc-qos-ethernet.txt91309115F: drivers/net/ethernet/synopsys/dwc_eth_qos.c91169116+91179117+SYNOPSYS DESIGNWARE I2C DRIVER91189118+M: Andy Shevchenko <andriy.shevchenko@linux.intel.com>91199119+M: Jarkko Nikula <jarkko.nikula@linux.intel.com>91209120+M: Mika Westerberg <mika.westerberg@linux.intel.com>91219121+L: linux-i2c@vger.kernel.org91229122+S: Maintained91239123+F: drivers/i2c/busses/i2c-designware-*91249124+F: include/linux/platform_data/i2c-designware.h9131912591329126SYNOPSYS DESIGNWARE MMC/SD/SDIO DRIVER91339127M: Seungwon Jeon <tgih.jun@samsung.com>···1169011666ZSMALLOC COMPRESSED SLAB MEMORY ALLOCATOR1169111667M: Minchan Kim <minchan@kernel.org>1169211668M: Nitin Gupta <ngupta@vflare.org>1166911669+R: Sergey Senozhatsky <sergey.senozhatsky.work@gmail.com>1169311670L: linux-mm@kvack.org1169411671S: Maintained1169511672F: mm/zsmalloc.c
···559559560560void __init pdata_quirks_init(const struct of_device_id *omap_dt_match_table)561561{562562- omap_sdrc_init(NULL, NULL);562562+ /*563563+ * We still need this for omap2420 and omap3 PM to work, others are564564+ * using drivers/misc/sram.c already.565565+ */566566+ if (of_machine_is_compatible("ti,omap2420") ||567567+ of_machine_is_compatible("ti,omap3"))568568+ omap_sdrc_init(NULL, NULL);569569+563570 pdata_quirks_check(auxdata_quirks);564571 of_platform_populate(NULL, omap_dt_match_table,565572 omap_auxdata_lookup, NULL);
···6161 unsigned long addr,6262 unsigned char *hpte_slot_array,6363 int psize, int ssize, int local);6464- /* special for kexec, to be called in real mode, linear mapping is6565- * destroyed as well */6464+ /*6565+ * Special for kexec.6666+ * To be called in real mode with interrupts disabled. No locks are6767+ * taken as such, concurrent access on pre POWER5 hardware could result6868+ * in a deadlock.6969+ * The linear mapping is destroyed as well.7070+ */6671 void (*hpte_clear_all)(void);67726873 void __iomem * (*ioremap)(phys_addr_t addr, unsigned long size,
-17
arch/powerpc/include/asm/ppc-opcode.h
···141141#define PPC_INST_ISEL 0x7c00001e142142#define PPC_INST_ISEL_MASK 0xfc00003e143143#define PPC_INST_LDARX 0x7c0000a8144144-#define PPC_INST_LOGMPP 0x7c0007e4145144#define PPC_INST_LSWI 0x7c0004aa146145#define PPC_INST_LSWX 0x7c00042a147146#define PPC_INST_LWARX 0x7c000028···284285#define __PPC_EH(eh) 0285286#endif286287287287-/* POWER8 Micro Partition Prefetch (MPP) parameters */288288-/* Address mask is common for LOGMPP instruction and MPPR SPR */289289-#define PPC_MPPE_ADDRESS_MASK 0xffffffffc000ULL290290-291291-/* Bits 60 and 61 of MPP SPR should be set to one of the following */292292-/* Aborting the fetch is indeed setting 00 in the table size bits */293293-#define PPC_MPPR_FETCH_ABORT (0x0ULL << 60)294294-#define PPC_MPPR_FETCH_WHOLE_TABLE (0x2ULL << 60)295295-296296-/* Bits 54 and 55 of register for LOGMPP instruction should be set to: */297297-#define PPC_LOGMPP_LOG_L2 (0x02ULL << 54)298298-#define PPC_LOGMPP_LOG_L2L3 (0x01ULL << 54)299299-#define PPC_LOGMPP_LOG_ABORT (0x03ULL << 54)300300-301288/* Deal with instructions that older assemblers aren't aware of */302289#define PPC_DCBAL(a, b) stringify_in_c(.long PPC_INST_DCBAL | \303290 __PPC_RA(a) | __PPC_RB(b))···292307#define PPC_LDARX(t, a, b, eh) stringify_in_c(.long PPC_INST_LDARX | \293308 ___PPC_RT(t) | ___PPC_RA(a) | \294309 ___PPC_RB(b) | __PPC_EH(eh))295295-#define PPC_LOGMPP(b) stringify_in_c(.long PPC_INST_LOGMPP | \296296- __PPC_RB(b))297310#define PPC_LWARX(t, a, b, eh) stringify_in_c(.long PPC_INST_LWARX | \298311 ___PPC_RT(t) | ___PPC_RA(a) | \299312 ___PPC_RB(b) | __PPC_EH(eh))
···36363737#include <asm/reg.h>3838#include <asm/cputable.h>3939-#include <asm/cache.h>4039#include <asm/cacheflush.h>4140#include <asm/tlbflush.h>4241#include <asm/uaccess.h>···7374#define TB_NIL (~(u64)0)74757576static DECLARE_BITMAP(default_enabled_hcalls, MAX_HCALL_OPCODE/4 + 1);7676-7777-#if defined(CONFIG_PPC_64K_PAGES)7878-#define MPP_BUFFER_ORDER 07979-#elif defined(CONFIG_PPC_4K_PAGES)8080-#define MPP_BUFFER_ORDER 38181-#endif82778378static int dynamic_mt_modes = 6;8479module_param(dynamic_mt_modes, int, S_IRUGO | S_IWUSR);···14481455 vcore->kvm = kvm;14491456 INIT_LIST_HEAD(&vcore->preempt_list);1450145714511451- vcore->mpp_buffer_is_valid = false;14521452-14531453- if (cpu_has_feature(CPU_FTR_ARCH_207S))14541454- vcore->mpp_buffer = (void *)__get_free_pages(14551455- GFP_KERNEL|__GFP_ZERO,14561456- MPP_BUFFER_ORDER);14571457-14581458 return vcore;14591459}14601460···18781892 }18791893 }18801894 return 1;18811881-}18821882-18831883-static void kvmppc_start_saving_l2_cache(struct kvmppc_vcore *vc)18841884-{18851885- phys_addr_t phy_addr, mpp_addr;18861886-18871887- phy_addr = (phys_addr_t)virt_to_phys(vc->mpp_buffer);18881888- mpp_addr = phy_addr & PPC_MPPE_ADDRESS_MASK;18891889-18901890- mtspr(SPRN_MPPR, mpp_addr | PPC_MPPR_FETCH_ABORT);18911891- logmpp(mpp_addr | PPC_LOGMPP_LOG_L2);18921892-18931893- vc->mpp_buffer_is_valid = true;18941894-}18951895-18961896-static void kvmppc_start_restoring_l2_cache(const struct kvmppc_vcore *vc)18971897-{18981898- phys_addr_t phy_addr, mpp_addr;18991899-19001900- phy_addr = virt_to_phys(vc->mpp_buffer);19011901- mpp_addr = phy_addr & PPC_MPPE_ADDRESS_MASK;19021902-19031903- /* We must abort any in-progress save operations to ensure19041904- * the table is valid so that prefetch engine knows when to19051905- * stop prefetching. */19061906- logmpp(mpp_addr | PPC_LOGMPP_LOG_ABORT);19071907- mtspr(SPRN_MPPR, mpp_addr | PPC_MPPR_FETCH_WHOLE_TABLE);19081895}1909189619101897/*···2430247124312472 srcu_idx = srcu_read_lock(&vc->kvm->srcu);2432247324332433- if (vc->mpp_buffer_is_valid)24342434- kvmppc_start_restoring_l2_cache(vc);24352435-24362474 __kvmppc_vcore_entry();24372437-24382438- if (vc->mpp_buffer)24392439- kvmppc_start_saving_l2_cache(vc);2440247524412476 srcu_read_unlock(&vc->kvm->srcu, srcu_idx);24422477···30263073{30273074 long int i;3028307530293029- for (i = 0; i < KVM_MAX_VCORES; ++i) {30303030- if (kvm->arch.vcores[i] && kvm->arch.vcores[i]->mpp_buffer) {30313031- struct kvmppc_vcore *vc = kvm->arch.vcores[i];30323032- free_pages((unsigned long)vc->mpp_buffer,30333033- MPP_BUFFER_ORDER);30343034- }30763076+ for (i = 0; i < KVM_MAX_VCORES; ++i)30353077 kfree(kvm->arch.vcores[i]);30363036- }30373078 kvm->arch.online_vcores = 0;30383079}30393080
+11-12
arch/powerpc/mm/hash_native_64.c
···582582 * be when they isi), and we are the only one left. We rely on our kernel583583 * mapping being 0xC0's and the hardware ignoring those two real bits.584584 *585585+ * This must be called with interrupts disabled.586586+ *587587+ * Taking the native_tlbie_lock is unsafe here due to the possibility of588588+ * lockdep being on. On pre POWER5 hardware, not taking the lock could589589+ * cause deadlock. POWER5 and newer not taking the lock is fine. This only590590+ * gets called during boot before secondary CPUs have come up and during591591+ * crashdump and all bets are off anyway.592592+ *585593 * TODO: add batching support when enabled. remember, no dynamic memory here,586594 * athough there is the control page available...587595 */588596static void native_hpte_clear(void)589597{590598 unsigned long vpn = 0;591591- unsigned long slot, slots, flags;599599+ unsigned long slot, slots;592600 struct hash_pte *hptep = htab_address;593601 unsigned long hpte_v;594602 unsigned long pteg_count;595603 int psize, apsize, ssize;596604597605 pteg_count = htab_hash_mask + 1;598598-599599- local_irq_save(flags);600600-601601- /* we take the tlbie lock and hold it. Some hardware will602602- * deadlock if we try to tlbie from two processors at once.603603- */604604- raw_spin_lock(&native_tlbie_lock);605606606607 slots = pteg_count * HPTES_PER_GROUP;607608···615614 hpte_v = be64_to_cpu(hptep->v);616615617616 /*618618- * Call __tlbie() here rather than tlbie() since we619619- * already hold the native_tlbie_lock.617617+ * Call __tlbie() here rather than tlbie() since we can't take the618618+ * native_tlbie_lock.620619 */621620 if (hpte_v & HPTE_V_VALID) {622621 hpte_decode(hptep, slot, &psize, &apsize, &ssize, &vpn);···626625 }627626628627 asm volatile("eieio; tlbsync; ptesync":::"memory");629629- raw_spin_unlock(&native_tlbie_lock);630630- local_irq_restore(flags);631628}632629633630/*
+5-2
arch/powerpc/platforms/powernv/opal.c
···487487 * PRD component would have already got notified about this488488 * error through other channels.489489 *490490- * In any case, let us just fall through. We anyway heading491491- * down to panic path.490490+ * If hardware marked this as an unrecoverable MCE, we are491491+ * going to panic anyway. Even if it didn't, it's not safe to492492+ * continue at this point, so we should explicitly panic.492493 */494494+495495+ panic("PowerNV Unrecovered Machine Check");493496 return 0;494497}495498
+24-5
arch/powerpc/platforms/powernv/smp.c
···171171 * so clear LPCR:PECE1. We keep PECE2 enabled.172172 */173173 mtspr(SPRN_LPCR, mfspr(SPRN_LPCR) & ~(u64)LPCR_PECE1);174174+175175+ /*176176+ * Hard-disable interrupts, and then clear irq_happened flags177177+ * that we can safely ignore while off-line, since they178178+ * are for things for which we do no processing when off-line179179+ * (or in the case of HMI, all the processing we need to do180180+ * is done in lower-level real-mode code).181181+ */182182+ hard_irq_disable();183183+ local_paca->irq_happened &= ~(PACA_IRQ_DEC | PACA_IRQ_HMI);184184+174185 while (!generic_check_cpu_restart(cpu)) {186186+ /*187187+ * Clear IPI flag, since we don't handle IPIs while188188+ * offline, except for those when changing micro-threading189189+ * mode, which are handled explicitly below, and those190190+ * for coming online, which are handled via191191+ * generic_check_cpu_restart() calls.192192+ */193193+ kvmppc_set_host_ipi(cpu, 0);175194176195 ppc64_runlatch_off();177196···215196 * having finished executing in a KVM guest, then srr1216197 * contains 0.217198 */218218- if ((srr1 & wmask) == SRR1_WAKEEE) {199199+ if (((srr1 & wmask) == SRR1_WAKEEE) ||200200+ (local_paca->irq_happened & PACA_IRQ_EE)) {219201 icp_native_flush_interrupt();220220- local_paca->irq_happened &= PACA_IRQ_HARD_DIS;221221- smp_mb();222202 } else if ((srr1 & wmask) == SRR1_WAKEHDBELL) {223203 unsigned long msg = PPC_DBELL_TYPE(PPC_DBELL_SERVER);224204 asm volatile(PPC_MSGCLR(%0) : : "r" (msg));225225- kvmppc_set_host_ipi(cpu, 0);226205 }206206+ local_paca->irq_happened &= ~(PACA_IRQ_EE | PACA_IRQ_DBELL);207207+ smp_mb();227208228209 if (cpu_core_split_required())229210 continue;230211231231- if (!generic_check_cpu_restart(cpu))212212+ if (srr1 && !generic_check_cpu_restart(cpu))232213 DBG("CPU%d Unexpected exit while offline !\n", cpu);233214 }234215 mtspr(SPRN_LPCR, mfspr(SPRN_LPCR) | LPCR_PECE1);
···550550 if (sp < bottom || sp > top)551551 return 0;552552553553- fp = READ_ONCE(*(unsigned long *)sp);553553+ fp = READ_ONCE_NOCHECK(*(unsigned long *)sp);554554 do {555555 if (fp < bottom || fp > top)556556 return 0;557557- ip = READ_ONCE(*(unsigned long *)(fp + sizeof(unsigned long)));557557+ ip = READ_ONCE_NOCHECK(*(unsigned long *)(fp + sizeof(unsigned long)));558558 if (!in_sched_functions(ip))559559 return ip;560560- fp = READ_ONCE(*(unsigned long *)fp);560560+ fp = READ_ONCE_NOCHECK(*(unsigned long *)fp);561561 } while (count++ < 16 && p->state != TASK_RUNNING);562562 return 0;563563}
+8
arch/x86/kernel/setup.c
···11731173 clone_pgd_range(initial_page_table + KERNEL_PGD_BOUNDARY,11741174 swapper_pg_dir + KERNEL_PGD_BOUNDARY,11751175 KERNEL_PGD_PTRS);11761176+11771177+ /*11781178+ * sync back low identity map too. It is used for example11791179+ * in the 32-bit EFI stub.11801180+ */11811181+ clone_pgd_range(initial_page_table,11821182+ swapper_pg_dir + KERNEL_PGD_BOUNDARY,11831183+ KERNEL_PGD_PTRS);11761184#endif1177118511781186 tboot_probe();
+11-4
arch/x86/kernel/smpboot.c
···509509 */510510#define UDELAY_10MS_DEFAULT 10000511511512512-static unsigned int init_udelay = UDELAY_10MS_DEFAULT;512512+static unsigned int init_udelay = INT_MAX;513513514514static int __init cpu_init_udelay(char *str)515515{···522522static void __init smp_quirk_init_udelay(void)523523{524524 /* if cmdline changed it from default, leave it alone */525525- if (init_udelay != UDELAY_10MS_DEFAULT)525525+ if (init_udelay != INT_MAX)526526 return;527527528528 /* if modern processor, use no delay */529529 if (((boot_cpu_data.x86_vendor == X86_VENDOR_INTEL) && (boot_cpu_data.x86 == 6)) ||530530 ((boot_cpu_data.x86_vendor == X86_VENDOR_AMD) && (boot_cpu_data.x86 >= 0xF)))531531 init_udelay = 0;532532+533533+ /* else, use legacy delay */534534+ init_udelay = UDELAY_10MS_DEFAULT;532535}533536534537/*···660657 /*661658 * Give the other CPU some time to accept the IPI.662659 */663663- if (init_udelay)660660+ if (init_udelay == 0)661661+ udelay(10);662662+ else664663 udelay(300);665664666665 pr_debug("Startup point 1\n");···673668 /*674669 * Give the other CPU some time to accept the IPI.675670 */676676- if (init_udelay)671671+ if (init_udelay == 0)672672+ udelay(10);673673+ else677674 udelay(200);678675679676 if (maxlvt > 3) /* Due to the Pentium erratum 3AP. */
+7-3
arch/x86/kvm/emulate.c
···24182418 u64 val, cr0, cr4;24192419 u32 base3;24202420 u16 selector;24212421- int i;24212421+ int i, r;2422242224232423 for (i = 0; i < 16; i++)24242424 *reg_write(ctxt, i) = GET_SMSTATE(u64, smbase, 0x7ff8 - i * 8);···24602460 dt.address = GET_SMSTATE(u64, smbase, 0x7e68);24612461 ctxt->ops->set_gdt(ctxt, &dt);2462246224632463+ r = rsm_enter_protected_mode(ctxt, cr0, cr4);24642464+ if (r != X86EMUL_CONTINUE)24652465+ return r;24662466+24632467 for (i = 0; i < 6; i++) {24642464- int r = rsm_load_seg_64(ctxt, smbase, i);24682468+ r = rsm_load_seg_64(ctxt, smbase, i);24652469 if (r != X86EMUL_CONTINUE)24662470 return r;24672471 }2468247224692469- return rsm_enter_protected_mode(ctxt, cr0, cr4);24732473+ return X86EMUL_CONTINUE;24702474}2471247524722476static int em_rsm(struct x86_emulate_ctxt *ctxt)
+6-20
arch/x86/kvm/vmx.c
···41054105static int alloc_apic_access_page(struct kvm *kvm)41064106{41074107 struct page *page;41084108- struct kvm_userspace_memory_region kvm_userspace_mem;41094108 int r = 0;4110410941114110 mutex_lock(&kvm->slots_lock);41124111 if (kvm->arch.apic_access_page_done)41134112 goto out;41144114- kvm_userspace_mem.slot = APIC_ACCESS_PAGE_PRIVATE_MEMSLOT;41154115- kvm_userspace_mem.flags = 0;41164116- kvm_userspace_mem.guest_phys_addr = APIC_DEFAULT_PHYS_BASE;41174117- kvm_userspace_mem.memory_size = PAGE_SIZE;41184118- r = __x86_set_memory_region(kvm, &kvm_userspace_mem);41134113+ r = __x86_set_memory_region(kvm, APIC_ACCESS_PAGE_PRIVATE_MEMSLOT,41144114+ APIC_DEFAULT_PHYS_BASE, PAGE_SIZE);41194115 if (r)41204116 goto out;41214117···41364140{41374141 /* Called with kvm->slots_lock held. */4138414241394139- struct kvm_userspace_memory_region kvm_userspace_mem;41404143 int r = 0;4141414441424145 BUG_ON(kvm->arch.ept_identity_pagetable_done);4143414641444144- kvm_userspace_mem.slot = IDENTITY_PAGETABLE_PRIVATE_MEMSLOT;41454145- kvm_userspace_mem.flags = 0;41464146- kvm_userspace_mem.guest_phys_addr =41474147- kvm->arch.ept_identity_map_addr;41484148- kvm_userspace_mem.memory_size = PAGE_SIZE;41494149- r = __x86_set_memory_region(kvm, &kvm_userspace_mem);41474147+ r = __x86_set_memory_region(kvm, IDENTITY_PAGETABLE_PRIVATE_MEMSLOT,41484148+ kvm->arch.ept_identity_map_addr, PAGE_SIZE);4150414941514150 return r;41524151}···49404949static int vmx_set_tss_addr(struct kvm *kvm, unsigned int addr)49414950{49424951 int ret;49434943- struct kvm_userspace_memory_region tss_mem = {49444944- .slot = TSS_PRIVATE_MEMSLOT,49454945- .guest_phys_addr = addr,49464946- .memory_size = PAGE_SIZE * 3,49474947- .flags = 0,49484948- };4949495249504950- ret = x86_set_memory_region(kvm, &tss_mem);49534953+ ret = x86_set_memory_region(kvm, TSS_PRIVATE_MEMSLOT, addr,49544954+ PAGE_SIZE * 3);49514955 if (ret)49524956 return ret;49534957 kvm->arch.tss_addr = addr;
+75-60
arch/x86/kvm/x86.c
···64536453 return 1;64546454}6455645564566456+static inline bool kvm_vcpu_running(struct kvm_vcpu *vcpu)64576457+{64586458+ return (vcpu->arch.mp_state == KVM_MP_STATE_RUNNABLE &&64596459+ !vcpu->arch.apf.halted);64606460+}64616461+64566462static int vcpu_run(struct kvm_vcpu *vcpu)64576463{64586464 int r;···64676461 vcpu->srcu_idx = srcu_read_lock(&kvm->srcu);6468646264696463 for (;;) {64706470- if (vcpu->arch.mp_state == KVM_MP_STATE_RUNNABLE &&64716471- !vcpu->arch.apf.halted)64646464+ if (kvm_vcpu_running(vcpu))64726465 r = vcpu_enter_guest(vcpu);64736466 else64746467 r = vcpu_block(kvm, vcpu);···74797474 kvm_free_pit(kvm);74807475}7481747674827482-int __x86_set_memory_region(struct kvm *kvm,74837483- const struct kvm_userspace_memory_region *mem)74777477+int __x86_set_memory_region(struct kvm *kvm, int id, gpa_t gpa, u32 size)74847478{74857479 int i, r;74807480+ unsigned long hva;74817481+ struct kvm_memslots *slots = kvm_memslots(kvm);74827482+ struct kvm_memory_slot *slot, old;7486748374877484 /* Called with kvm->slots_lock held. */74887488- BUG_ON(mem->slot >= KVM_MEM_SLOTS_NUM);74857485+ if (WARN_ON(id >= KVM_MEM_SLOTS_NUM))74867486+ return -EINVAL;7489748774887488+ slot = id_to_memslot(slots, id);74897489+ if (size) {74907490+ if (WARN_ON(slot->npages))74917491+ return -EEXIST;74927492+74937493+ /*74947494+ * MAP_SHARED to prevent internal slot pages from being moved74957495+ * by fork()/COW.74967496+ */74977497+ hva = vm_mmap(NULL, 0, size, PROT_READ | PROT_WRITE,74987498+ MAP_SHARED | MAP_ANONYMOUS, 0);74997499+ if (IS_ERR((void *)hva))75007500+ return PTR_ERR((void *)hva);75017501+ } else {75027502+ if (!slot->npages)75037503+ return 0;75047504+75057505+ hva = 0;75067506+ }75077507+75087508+ old = *slot;74907509 for (i = 0; i < KVM_ADDRESS_SPACE_NUM; i++) {74917491- struct kvm_userspace_memory_region m = *mem;75107510+ struct kvm_userspace_memory_region m;7492751174937493- m.slot |= i << 16;75127512+ m.slot = id | (i << 16);75137513+ m.flags = 0;75147514+ m.guest_phys_addr = gpa;75157515+ m.userspace_addr = hva;75167516+ m.memory_size = size;74947517 r = __kvm_set_memory_region(kvm, &m);74957518 if (r < 0)74967519 return r;75207520+ }75217521+75227522+ if (!size) {75237523+ r = vm_munmap(old.userspace_addr, old.npages * PAGE_SIZE);75247524+ WARN_ON(r < 0);74977525 }7498752674997527 return 0;75007528}75017529EXPORT_SYMBOL_GPL(__x86_set_memory_region);7502753075037503-int x86_set_memory_region(struct kvm *kvm,75047504- const struct kvm_userspace_memory_region *mem)75317531+int x86_set_memory_region(struct kvm *kvm, int id, gpa_t gpa, u32 size)75057532{75067533 int r;7507753475087535 mutex_lock(&kvm->slots_lock);75097509- r = __x86_set_memory_region(kvm, mem);75367536+ r = __x86_set_memory_region(kvm, id, gpa, size);75107537 mutex_unlock(&kvm->slots_lock);7511753875127539 return r;···75537516 * unless the the memory map has changed due to process exit75547517 * or fd copying.75557518 */75567556- struct kvm_userspace_memory_region mem;75577557- memset(&mem, 0, sizeof(mem));75587558- mem.slot = APIC_ACCESS_PAGE_PRIVATE_MEMSLOT;75597559- x86_set_memory_region(kvm, &mem);75607560-75617561- mem.slot = IDENTITY_PAGETABLE_PRIVATE_MEMSLOT;75627562- x86_set_memory_region(kvm, &mem);75637563-75647564- mem.slot = TSS_PRIVATE_MEMSLOT;75657565- x86_set_memory_region(kvm, &mem);75197519+ x86_set_memory_region(kvm, APIC_ACCESS_PAGE_PRIVATE_MEMSLOT, 0, 0);75207520+ x86_set_memory_region(kvm, IDENTITY_PAGETABLE_PRIVATE_MEMSLOT, 0, 0);75217521+ x86_set_memory_region(kvm, TSS_PRIVATE_MEMSLOT, 0, 0);75667522 }75677523 kvm_iommu_unmap_guest(kvm);75687524 kfree(kvm->arch.vpic);···76587628 const struct kvm_userspace_memory_region *mem,76597629 enum kvm_mr_change change)76607630{76617661- /*76627662- * Only private memory slots need to be mapped here since76637663- * KVM_SET_MEMORY_REGION ioctl is no longer supported.76647664- */76657665- if ((memslot->id >= KVM_USER_MEM_SLOTS) && (change == KVM_MR_CREATE)) {76667666- unsigned long userspace_addr;76677667-76687668- /*76697669- * MAP_SHARED to prevent internal slot pages from being moved76707670- * by fork()/COW.76717671- */76727672- userspace_addr = vm_mmap(NULL, 0, memslot->npages * PAGE_SIZE,76737673- PROT_READ | PROT_WRITE,76747674- MAP_SHARED | MAP_ANONYMOUS, 0);76757675-76767676- if (IS_ERR((void *)userspace_addr))76777677- return PTR_ERR((void *)userspace_addr);76787678-76797679- memslot->userspace_addr = userspace_addr;76807680- }76817681-76827631 return 0;76837632}76847633···77197710{77207711 int nr_mmu_pages = 0;7721771277227722- if (change == KVM_MR_DELETE && old->id >= KVM_USER_MEM_SLOTS) {77237723- int ret;77247724-77257725- ret = vm_munmap(old->userspace_addr,77267726- old->npages * PAGE_SIZE);77277727- if (ret < 0)77287728- printk(KERN_WARNING77297729- "kvm_vm_ioctl_set_memory_region: "77307730- "failed to munmap memory\n");77317731- }77327732-77337713 if (!kvm->arch.n_requested_mmu_pages)77347714 nr_mmu_pages = kvm_mmu_calculate_mmu_pages(kvm);77357715···77677769 kvm_mmu_invalidate_zap_all_pages(kvm);77687770}7769777177727772+static inline bool kvm_vcpu_has_events(struct kvm_vcpu *vcpu)77737773+{77747774+ if (!list_empty_careful(&vcpu->async_pf.done))77757775+ return true;77767776+77777777+ if (kvm_apic_has_events(vcpu))77787778+ return true;77797779+77807780+ if (vcpu->arch.pv.pv_unhalted)77817781+ return true;77827782+77837783+ if (atomic_read(&vcpu->arch.nmi_queued))77847784+ return true;77857785+77867786+ if (test_bit(KVM_REQ_SMI, &vcpu->requests))77877787+ return true;77887788+77897789+ if (kvm_arch_interrupt_allowed(vcpu) &&77907790+ kvm_cpu_has_interrupt(vcpu))77917791+ return true;77927792+77937793+ return false;77947794+}77957795+77707796int kvm_arch_vcpu_runnable(struct kvm_vcpu *vcpu)77717797{77727798 if (is_guest_mode(vcpu) && kvm_x86_ops->check_nested_events)77737799 kvm_x86_ops->check_nested_events(vcpu, false);7774780077757775- return (vcpu->arch.mp_state == KVM_MP_STATE_RUNNABLE &&77767776- !vcpu->arch.apf.halted)77777777- || !list_empty_careful(&vcpu->async_pf.done)77787778- || kvm_apic_has_events(vcpu)77797779- || vcpu->arch.pv.pv_unhalted77807780- || atomic_read(&vcpu->arch.nmi_queued) ||77817781- (kvm_arch_interrupt_allowed(vcpu) &&77827782- kvm_cpu_has_interrupt(vcpu));78017801+ return kvm_vcpu_running(vcpu) || kvm_vcpu_has_events(vcpu);77837802}7784780377857804int kvm_arch_vcpu_should_kick(struct kvm_vcpu *vcpu)
+4-1
arch/x86/um/ldt.c
···1212#include <skas.h>1313#include <sysdep/tls.h>14141515-extern int modify_ldt(int func, void *ptr, unsigned long bytecount);1515+static inline int modify_ldt (int func, void *ptr, unsigned long bytecount)1616+{1717+ return syscall(__NR_modify_ldt, func, ptr, bytecount);1818+}16191720static long write_ldt_entry(struct mm_id *mm_idp, int func,1821 struct user_desc *desc, void **addr, int done)
+1-1
block/blk-core.c
···576576 q->queue_lock = &q->__queue_lock;577577 spin_unlock_irq(lock);578578579579- bdi_destroy(&q->backing_dev_info);579579+ bdi_unregister(&q->backing_dev_info);580580581581 /* @q is and will stay empty, shutdown and put */582582 blk_put_queue(q);
···71717272 /* ACPI tables must be present */73737474- if (!acpi_tb_tables_loaded()) {7474+ if (acpi_gbl_fadt_index == ACPI_INVALID_TABLE_INDEX) {7575 return_ACPI_STATUS(AE_NO_ACPI_TABLES);7676 }7777
+5-5
drivers/acpi/acpica/tbfadt.c
···298298 *299299 * FUNCTION: acpi_tb_parse_fadt300300 *301301- * PARAMETERS: table_index - Index for the FADT301301+ * PARAMETERS: None302302 *303303 * RETURN: None304304 *···307307 *308308 ******************************************************************************/309309310310-void acpi_tb_parse_fadt(u32 table_index)310310+void acpi_tb_parse_fadt(void)311311{312312 u32 length;313313 struct acpi_table_header *table;···319319 * Get a local copy of the FADT and convert it to a common format320320 * Map entire FADT, assumed to be smaller than one page.321321 */322322- length = acpi_gbl_root_table_list.tables[table_index].length;322322+ length = acpi_gbl_root_table_list.tables[acpi_gbl_fadt_index].length;323323324324 table =325325- acpi_os_map_memory(acpi_gbl_root_table_list.tables[table_index].326326- address, length);325325+ acpi_os_map_memory(acpi_gbl_root_table_list.326326+ tables[acpi_gbl_fadt_index].address, length);327327 if (!table) {328328 return;329329 }
···187187 * global one. Requires architecture specific dev_get_cma_area() helper188188 * function.189189 */190190-struct page *dma_alloc_from_contiguous(struct device *dev, int count,190190+struct page *dma_alloc_from_contiguous(struct device *dev, size_t count,191191 unsigned int align)192192{193193 if (align > CONFIG_CMA_ALIGNMENT)
+6-16
drivers/base/power/domain_governor.c
···7777 dev_update_qos_constraint);78787979 if (constraint_ns > 0) {8080- constraint_ns -= td->start_latency_ns;8080+ constraint_ns -= td->save_state_latency_ns +8181+ td->stop_latency_ns +8282+ td->start_latency_ns +8383+ td->restore_state_latency_ns;8184 if (constraint_ns == 0)8285 return false;8386 }8487 td->effective_constraint_ns = constraint_ns;8585- td->cached_stop_ok = constraint_ns > td->stop_latency_ns ||8686- constraint_ns == 0;8888+ td->cached_stop_ok = constraint_ns >= 0;8989+8790 /*8891 * The children have been suspended already, so we don't need to take8992 * their stop latencies into account here.···129126130127 off_on_time_ns = genpd->power_off_latency_ns +131128 genpd->power_on_latency_ns;132132- /*133133- * It doesn't make sense to remove power from the domain if saving134134- * the state of all devices in it and the power off/power on operations135135- * take too much time.136136- *137137- * All devices in this domain have been stopped already at this point.138138- */139139- list_for_each_entry(pdd, &genpd->dev_list, list_node) {140140- if (pdd->dev->driver)141141- off_on_time_ns +=142142- to_gpd_data(pdd)->td.save_state_latency_ns;143143- }144129145130 min_off_time_ns = -1;146131 /*···184193 * constraint_ns cannot be negative here, because the device has185194 * been suspended.186195 */187187- constraint_ns -= td->restore_state_latency_ns;188196 if (constraint_ns <= off_on_time_ns)189197 return false;190198
+30-6
drivers/block/nbd.c
···6060 bool disconnect; /* a disconnect has been requested by user */61616262 struct timer_list timeout_timer;6363+ spinlock_t tasks_lock;6364 struct task_struct *task_recv;6465 struct task_struct *task_send;6566···141140static void nbd_xmit_timeout(unsigned long arg)142141{143142 struct nbd_device *nbd = (struct nbd_device *)arg;144144- struct task_struct *task;143143+ unsigned long flags;145144146145 if (list_empty(&nbd->queue_head))147146 return;148147149148 nbd->disconnect = true;150149151151- task = READ_ONCE(nbd->task_recv);152152- if (task)153153- force_sig(SIGKILL, task);150150+ spin_lock_irqsave(&nbd->tasks_lock, flags);154151155155- task = READ_ONCE(nbd->task_send);156156- if (task)152152+ if (nbd->task_recv)153153+ force_sig(SIGKILL, nbd->task_recv);154154+155155+ if (nbd->task_send)157156 force_sig(SIGKILL, nbd->task_send);157157+158158+ spin_unlock_irqrestore(&nbd->tasks_lock, flags);158159159160 dev_err(nbd_to_dev(nbd), "Connection timed out, killed receiver and sender, shutting down connection\n");160161}···406403{407404 struct request *req;408405 int ret;406406+ unsigned long flags;409407410408 BUG_ON(nbd->magic != NBD_MAGIC);411409412410 sk_set_memalloc(nbd->sock->sk);413411412412+ spin_lock_irqsave(&nbd->tasks_lock, flags);414413 nbd->task_recv = current;414414+ spin_unlock_irqrestore(&nbd->tasks_lock, flags);415415416416 ret = device_create_file(disk_to_dev(nbd->disk), &pid_attr);417417 if (ret) {418418 dev_err(disk_to_dev(nbd->disk), "device_create_file failed!\n");419419+420420+ spin_lock_irqsave(&nbd->tasks_lock, flags);419421 nbd->task_recv = NULL;422422+ spin_unlock_irqrestore(&nbd->tasks_lock, flags);423423+420424 return ret;421425 }422426···439429440430 device_remove_file(disk_to_dev(nbd->disk), &pid_attr);441431432432+ spin_lock_irqsave(&nbd->tasks_lock, flags);442433 nbd->task_recv = NULL;434434+ spin_unlock_irqrestore(&nbd->tasks_lock, flags);443435444436 if (signal_pending(current)) {445437 siginfo_t info;···546534{547535 struct nbd_device *nbd = data;548536 struct request *req;537537+ unsigned long flags;549538539539+ spin_lock_irqsave(&nbd->tasks_lock, flags);550540 nbd->task_send = current;541541+ spin_unlock_irqrestore(&nbd->tasks_lock, flags);551542552543 set_user_nice(current, MIN_NICE);553544 while (!kthread_should_stop() || !list_empty(&nbd->waiting_queue)) {···587572 nbd_handle_req(nbd, req);588573 }589574575575+ spin_lock_irqsave(&nbd->tasks_lock, flags);590576 nbd->task_send = NULL;577577+ spin_unlock_irqrestore(&nbd->tasks_lock, flags);578578+579579+ /* Clear maybe pending signals */580580+ if (signal_pending(current)) {581581+ siginfo_t info;582582+ dequeue_signal_lock(current, ¤t->blocked, &info);583583+ }591584592585 return 0;593586}···10751052 nbd_dev[i].magic = NBD_MAGIC;10761053 INIT_LIST_HEAD(&nbd_dev[i].waiting_queue);10771054 spin_lock_init(&nbd_dev[i].queue_lock);10551055+ spin_lock_init(&nbd_dev[i].tasks_lock);10781056 INIT_LIST_HEAD(&nbd_dev[i].queue_head);10791057 mutex_init(&nbd_dev[i].tx_lock);10801058 init_timer(&nbd_dev[i].timeout_timer);
+15-9
drivers/block/nvme-core.c
···603603 struct nvme_iod *iod = ctx;604604 struct request *req = iod_get_private(iod);605605 struct nvme_cmd_info *cmd_rq = blk_mq_rq_to_pdu(req);606606-607606 u16 status = le16_to_cpup(&cqe->status) >> 1;607607+ bool requeue = false;608608+ int error = 0;608609609610 if (unlikely(status)) {610611 if (!(status & NVME_SC_DNR || blk_noretry_request(req))611612 && (jiffies - req->start_time) < req->timeout) {612613 unsigned long flags;613614615615+ requeue = true;614616 blk_mq_requeue_request(req);615617 spin_lock_irqsave(req->q->queue_lock, flags);616618 if (!blk_queue_stopped(req->q))617619 blk_mq_kick_requeue_list(req->q);618620 spin_unlock_irqrestore(req->q->queue_lock, flags);619619- return;621621+ goto release_iod;620622 }621623622624 if (req->cmd_type == REQ_TYPE_DRV_PRIV) {623625 if (cmd_rq->ctx == CMD_CTX_CANCELLED)624624- status = -EINTR;626626+ error = -EINTR;627627+ else628628+ error = status;625629 } else {626626- status = nvme_error_status(status);630630+ error = nvme_error_status(status);627631 }628632 }629633···639635 if (cmd_rq->aborted)640636 dev_warn(nvmeq->dev->dev,641637 "completing aborted command with status:%04x\n",642642- status);638638+ error);643639640640+release_iod:644641 if (iod->nents) {645642 dma_unmap_sg(nvmeq->dev->dev, iod->sg, iod->nents,646643 rq_data_dir(req) ? DMA_TO_DEVICE : DMA_FROM_DEVICE);···654649 }655650 nvme_free_iod(nvmeq->dev, iod);656651657657- blk_mq_complete_request(req, status);652652+ if (likely(!requeue))653653+ blk_mq_complete_request(req, error);658654}659655660656/* length is in bytes. gfp flags indicates whether we may sleep. */···1810180418111805 length = (io.nblocks + 1) << ns->lba_shift;18121806 meta_len = (io.nblocks + 1) * ns->ms;18131813- metadata = (void __user *)(unsigned long)io.metadata;18071807+ metadata = (void __user *)(uintptr_t)io.metadata;18141808 write = io.opcode & 1;1815180918161810 if (ns->ext) {···18501844 c.rw.metadata = cpu_to_le64(meta_dma);1851184518521846 status = __nvme_submit_sync_cmd(ns->queue, &c, NULL,18531853- (void __user *)io.addr, length, NULL, 0);18471847+ (void __user *)(uintptr_t)io.addr, length, NULL, 0);18541848 unmap:18551849 if (meta) {18561850 if (status == NVME_SC_SUCCESS && !write) {···18921886 timeout = msecs_to_jiffies(cmd.timeout_ms);1893188718941888 status = __nvme_submit_sync_cmd(ns ? ns->queue : dev->admin_q, &c,18951895- NULL, (void __user *)cmd.addr, cmd.data_len,18891889+ NULL, (void __user *)(uintptr_t)cmd.addr, cmd.data_len,18961890 &cmd.result, timeout);18971891 if (status >= 0) {18981892 if (put_user(cmd.result, &ucmd->result))
+53-38
drivers/block/rbd.c
···9696#define RBD_MINORS_PER_MAJOR 2569797#define RBD_SINGLE_MAJOR_PART_SHIFT 498989999+#define RBD_MAX_PARENT_CHAIN_LEN 16100100+99101#define RBD_SNAP_DEV_NAME_PREFIX "snap_"100102#define RBD_MAX_SNAP_NAME_LEN \101103 (NAME_MAX - (sizeof (RBD_SNAP_DEV_NAME_PREFIX) - 1))···428426 size_t count);429427static ssize_t rbd_remove_single_major(struct bus_type *bus, const char *buf,430428 size_t count);431431-static int rbd_dev_image_probe(struct rbd_device *rbd_dev, bool mapping);429429+static int rbd_dev_image_probe(struct rbd_device *rbd_dev, int depth);432430static void rbd_spec_put(struct rbd_spec *spec);433431434432static int rbd_dev_id_to_minor(int dev_id)···18651863 rbd_osd_read_callback(obj_request);18661864 break;18671865 case CEPH_OSD_OP_SETALLOCHINT:18681868- rbd_assert(osd_req->r_ops[1].op == CEPH_OSD_OP_WRITE);18661866+ rbd_assert(osd_req->r_ops[1].op == CEPH_OSD_OP_WRITE ||18671867+ osd_req->r_ops[1].op == CEPH_OSD_OP_WRITEFULL);18691868 /* fall through */18701869 case CEPH_OSD_OP_WRITE:18701870+ case CEPH_OSD_OP_WRITEFULL:18711871 rbd_osd_write_callback(obj_request);18721872 break;18731873 case CEPH_OSD_OP_STAT:···24052401 opcode = CEPH_OSD_OP_ZERO;24062402 }24072403 } else if (op_type == OBJ_OP_WRITE) {24082408- opcode = CEPH_OSD_OP_WRITE;24042404+ if (!offset && length == object_size)24052405+ opcode = CEPH_OSD_OP_WRITEFULL;24062406+ else24072407+ opcode = CEPH_OSD_OP_WRITE;24092408 osd_req_op_alloc_hint_init(osd_request, num_ops,24102409 object_size, object_size);24112410 num_ops++;···37673760 /* set io sizes to object size */37683761 segment_size = rbd_obj_bytes(&rbd_dev->header);37693762 blk_queue_max_hw_sectors(q, segment_size / SECTOR_SIZE);37633763+ q->limits.max_sectors = queue_max_hw_sectors(q);37703764 blk_queue_max_segments(q, segment_size / SECTOR_SIZE);37713765 blk_queue_max_segment_size(q, segment_size);37723766 blk_queue_io_min(q, segment_size);···51335125 return ret;51345126}5135512751365136-static int rbd_dev_probe_parent(struct rbd_device *rbd_dev)51285128+/*51295129+ * @depth is rbd_dev_image_probe() -> rbd_dev_probe_parent() ->51305130+ * rbd_dev_image_probe() recursion depth, which means it's also the51315131+ * length of the already discovered part of the parent chain.51325132+ */51335133+static int rbd_dev_probe_parent(struct rbd_device *rbd_dev, int depth)51375134{51385135 struct rbd_device *parent = NULL;51395139- struct rbd_spec *parent_spec;51405140- struct rbd_client *rbdc;51415136 int ret;5142513751435138 if (!rbd_dev->parent_spec)51445139 return 0;51455145- /*51465146- * We need to pass a reference to the client and the parent51475147- * spec when creating the parent rbd_dev. Images related by51485148- * parent/child relationships always share both.51495149- */51505150- parent_spec = rbd_spec_get(rbd_dev->parent_spec);51515151- rbdc = __rbd_get_client(rbd_dev->rbd_client);5152514051535153- ret = -ENOMEM;51545154- parent = rbd_dev_create(rbdc, parent_spec, NULL);51555155- if (!parent)51415141+ if (++depth > RBD_MAX_PARENT_CHAIN_LEN) {51425142+ pr_info("parent chain is too long (%d)\n", depth);51435143+ ret = -EINVAL;51565144 goto out_err;51575157-51585158- ret = rbd_dev_image_probe(parent, false);51595159- if (ret < 0)51605160- goto out_err;51615161- rbd_dev->parent = parent;51625162- atomic_set(&rbd_dev->parent_ref, 1);51635163-51645164- return 0;51655165-out_err:51665166- if (parent) {51675167- rbd_dev_unparent(rbd_dev);51685168- rbd_dev_destroy(parent);51695169- } else {51705170- rbd_put_client(rbdc);51715171- rbd_spec_put(parent_spec);51725145 }5173514651475147+ parent = rbd_dev_create(rbd_dev->rbd_client, rbd_dev->parent_spec,51485148+ NULL);51495149+ if (!parent) {51505150+ ret = -ENOMEM;51515151+ goto out_err;51525152+ }51535153+51545154+ /*51555155+ * Images related by parent/child relationships always share51565156+ * rbd_client and spec/parent_spec, so bump their refcounts.51575157+ */51585158+ __rbd_get_client(rbd_dev->rbd_client);51595159+ rbd_spec_get(rbd_dev->parent_spec);51605160+51615161+ ret = rbd_dev_image_probe(parent, depth);51625162+ if (ret < 0)51635163+ goto out_err;51645164+51655165+ rbd_dev->parent = parent;51665166+ atomic_set(&rbd_dev->parent_ref, 1);51675167+ return 0;51685168+51695169+out_err:51705170+ rbd_dev_unparent(rbd_dev);51715171+ if (parent)51725172+ rbd_dev_destroy(parent);51745173 return ret;51755174}51765175···52955280 * parent), initiate a watch on its header object before using that52965281 * object to get detailed information about the rbd image.52975282 */52985298-static int rbd_dev_image_probe(struct rbd_device *rbd_dev, bool mapping)52835283+static int rbd_dev_image_probe(struct rbd_device *rbd_dev, int depth)52995284{53005285 int ret;53015286···53135298 if (ret)53145299 goto err_out_format;5315530053165316- if (mapping) {53015301+ if (!depth) {53175302 ret = rbd_dev_header_watch_sync(rbd_dev);53185303 if (ret) {53195304 if (ret == -ENOENT)···53345319 * Otherwise this is a parent image, identified by pool, image53355320 * and snap ids - need to fill in names for those ids.53365321 */53375337- if (mapping)53225322+ if (!depth)53385323 ret = rbd_spec_fill_snap_id(rbd_dev);53395324 else53405325 ret = rbd_spec_fill_names(rbd_dev);···53565341 * Need to warn users if this image is the one being53575342 * mapped and has a parent.53585343 */53595359- if (mapping && rbd_dev->parent_spec)53445344+ if (!depth && rbd_dev->parent_spec)53605345 rbd_warn(rbd_dev,53615346 "WARNING: kernel layering is EXPERIMENTAL!");53625347 }5363534853645364- ret = rbd_dev_probe_parent(rbd_dev);53495349+ ret = rbd_dev_probe_parent(rbd_dev, depth);53655350 if (ret)53665351 goto err_out_probe;53675352···53725357err_out_probe:53735358 rbd_dev_unprobe(rbd_dev);53745359err_out_watch:53755375- if (mapping)53605360+ if (!depth)53765361 rbd_dev_header_unwatch_sync(rbd_dev);53775362out_header_name:53785363 kfree(rbd_dev->header_name);···54355420 spec = NULL; /* rbd_dev now owns this */54365421 rbd_opts = NULL; /* rbd_dev now owns this */5437542254385438- rc = rbd_dev_image_probe(rbd_dev, true);54235423+ rc = rbd_dev_image_probe(rbd_dev, 0);54395424 if (rc < 0)54405425 goto err_out_rbd_dev;54415426
···8585 /* We borrow the event spin lock for protecting flip_status */8686 spin_lock_irqsave(&crtc->dev->event_lock, flags);87878888- /* set the proper interrupt */8989- amdgpu_irq_get(adev, &adev->pageflip_irq, work->crtc_id);9088 /* do the flip (mmio) */9189 adev->mode_info.funcs->page_flip(adev, work->crtc_id, work->base);9290 /* set the flip status */
···402402 return true;403403 return false;404404}405405+406406+void amdgpu_fbdev_restore_mode(struct amdgpu_device *adev)407407+{408408+ struct amdgpu_fbdev *afbdev = adev->mode_info.rfbdev;409409+ struct drm_fb_helper *fb_helper;410410+ int ret;411411+412412+ if (!afbdev)413413+ return;414414+415415+ fb_helper = &afbdev->helper;416416+417417+ ret = drm_fb_helper_restore_fbdev_mode_unlocked(fb_helper);418418+ if (ret)419419+ DRM_DEBUG("failed to restore crtc mode\n");420420+}
+4-1
drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c
···485485 * Outdated mess for old drm with Xorg being in charge (void function now).486486 */487487/**488488- * amdgpu_driver_firstopen_kms - drm callback for last close488488+ * amdgpu_driver_lastclose_kms - drm callback for last close489489 *490490 * @dev: drm dev pointer491491 *···493493 */494494void amdgpu_driver_lastclose_kms(struct drm_device *dev)495495{496496+ struct amdgpu_device *adev = dev->dev_private;497497+498498+ amdgpu_fbdev_restore_mode(adev);496499 vga_switcheroo_process_delayed_switch();497500}498501
···294294 struct amdgpu_device *adev = dev_get_drvdata(dev);295295 umode_t effective_mode = attr->mode;296296297297- /* Skip limit attributes if DPM is not enabled */297297+ /* Skip attributes if DPM is not enabled */298298 if (!adev->pm.dpm_enabled &&299299 (attr == &sensor_dev_attr_temp1_crit.dev_attr.attr ||300300- attr == &sensor_dev_attr_temp1_crit_hyst.dev_attr.attr))300300+ attr == &sensor_dev_attr_temp1_crit_hyst.dev_attr.attr ||301301+ attr == &sensor_dev_attr_pwm1.dev_attr.attr ||302302+ attr == &sensor_dev_attr_pwm1_enable.dev_attr.attr ||303303+ attr == &sensor_dev_attr_pwm1_max.dev_attr.attr ||304304+ attr == &sensor_dev_attr_pwm1_min.dev_attr.attr))301305 return 0;302306303307 /* Skip fan attributes if fan is not present */
+3-1
drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
···455455 return -ENOMEM;456456457457 r = amdgpu_ib_get(ring, NULL, ndw * 4, ib);458458- if (r)458458+ if (r) {459459+ kfree(ib);459460 return r;461461+ }460462 ib->length_dw = 0;461463462464 /* walk over the address space and update the page directory */
+5-3
drivers/gpu/drm/amd/amdgpu/ci_dpm.c
···61856185 if (!amdgpu_dpm)61866186 return 0;6187618761886188+ /* init the sysfs and debugfs files late */61896189+ ret = amdgpu_pm_sysfs_init(adev);61906190+ if (ret)61916191+ return ret;61926192+61886193 ret = ci_set_temperature_range(adev);61896194 if (ret)61906195 return ret;···62376232 adev->pm.dpm.current_ps = adev->pm.dpm.requested_ps = adev->pm.dpm.boot_ps;62386233 if (amdgpu_dpm == 1)62396234 amdgpu_pm_print_power_states(adev);62406240- ret = amdgpu_pm_sysfs_init(adev);62416241- if (ret)62426242- goto dpm_failed;62436235 mutex_unlock(&adev->pm.mutex);62446236 DRM_INFO("amdgpu: dpm initialized\n");62456237
···143143}144144145145/**146146- * i915_gem_shrink - Shrink buffer object caches completely146146+ * i915_gem_shrink_all - Shrink buffer object caches completely147147 * @dev_priv: i915 device148148 *149149 * This is a simple wraper around i915_gem_shrink() to aggressively shrink all
+4-1
drivers/gpu/drm/i915/i915_gem_userptr.c
···804804 * Also note, that the object created here is not currently a "first class"805805 * object, in that several ioctls are banned. These are the CPU access806806 * ioctls: mmap(), pwrite and pread. In practice, you are expected to use807807- * direct access via your pointer rather than use those ioctls.807807+ * direct access via your pointer rather than use those ioctls. Another808808+ * restriction is that we do not allow userptr surfaces to be pinned to the809809+ * hardware and so we reject any attempt to create a framebuffer out of a810810+ * userptr.808811 *809812 * If you think this is a good interface to use to pass GPU memory between810813 * drivers, please use dma-buf instead. In fact, wherever possible use
+67-53
drivers/gpu/drm/i915/intel_display.c
···17241724 I915_READ(DPLL(!crtc->pipe)) | DPLL_DVO_2X_MODE);17251725 }1726172617271727+ /*17281728+ * Apparently we need to have VGA mode enabled prior to changing17291729+ * the P1/P2 dividers. Otherwise the DPLL will keep using the old17301730+ * dividers, even though the register value does change.17311731+ */17321732+ I915_WRITE(reg, 0);17331733+17341734+ I915_WRITE(reg, dpll);17351735+17271736 /* Wait for the clocks to stabilize. */17281737 POSTING_READ(reg);17291738 udelay(150);···1411614107 struct intel_framebuffer *intel_fb = to_intel_framebuffer(fb);1411714108 struct drm_i915_gem_object *obj = intel_fb->obj;14118141091411014110+ if (obj->userptr.mm) {1411114111+ DRM_DEBUG("attempting to use a userptr for a framebuffer, denied\n");1411214112+ return -EINVAL;1411314113+ }1411414114+1411914115 return drm_gem_handle_create(file, &obj->base, handle);1412014116}1412114117···1491114897 /* restore vblank interrupts to correct state */1491214898 drm_crtc_vblank_reset(&crtc->base);1491314899 if (crtc->active) {1490014900+ struct intel_plane *plane;1490114901+1491414902 drm_calc_timestamping_constants(&crtc->base, &crtc->base.hwmode);1491514903 update_scanline_offset(crtc);1491614904 drm_crtc_vblank_on(&crtc->base);1490514905+1490614906+ /* Disable everything but the primary plane */1490714907+ for_each_intel_plane_on_crtc(dev, crtc, plane) {1490814908+ if (plane->base.type == DRM_PLANE_TYPE_PRIMARY)1490914909+ continue;1491014910+1491114911+ plane->disable_plane(&plane->base, &crtc->base);1491214912+ }1491714913 }14918149141491914915 /* We need to sanitize the plane -> pipe mapping first because this will···1509115067 i915_redisable_vga_power_on(dev);1509215068}15093150691509415094-static bool primary_get_hw_state(struct intel_crtc *crtc)1507015070+static bool primary_get_hw_state(struct intel_plane *plane)1509515071{1509615096- struct drm_i915_private *dev_priv = crtc->base.dev->dev_private;1507215072+ struct drm_i915_private *dev_priv = to_i915(plane->base.dev);15097150731509815098- return !!(I915_READ(DSPCNTR(crtc->plane)) & DISPLAY_PLANE_ENABLE);1507415074+ return I915_READ(DSPCNTR(plane->plane)) & DISPLAY_PLANE_ENABLE;1509915075}15100150761510115101-static void readout_plane_state(struct intel_crtc *crtc,1510215102- struct intel_crtc_state *crtc_state)1507715077+/* FIXME read out full plane state for all planes */1507815078+static void readout_plane_state(struct intel_crtc *crtc)1510315079{1510415104- struct intel_plane *p;1510515105- struct intel_plane_state *plane_state;1510615106- bool active = crtc_state->base.active;1508015080+ struct drm_plane *primary = crtc->base.primary;1508115081+ struct intel_plane_state *plane_state =1508215082+ to_intel_plane_state(primary->state);15107150831510815108- for_each_intel_plane(crtc->base.dev, p) {1510915109- if (crtc->pipe != p->pipe)1511015110- continue;1508415084+ plane_state->visible =1508515085+ primary_get_hw_state(to_intel_plane(primary));15111150861511215112- plane_state = to_intel_plane_state(p->base.state);1511315113-1511415114- if (p->base.type == DRM_PLANE_TYPE_PRIMARY) {1511515115- plane_state->visible = primary_get_hw_state(crtc);1511615116- if (plane_state->visible)1511715117- crtc->base.state->plane_mask |=1511815118- 1 << drm_plane_index(&p->base);1511915119- } else {1512015120- if (active)1512115121- p->disable_plane(&p->base, &crtc->base);1512215122-1512315123- plane_state->visible = false;1512415124- }1512515125- }1508715087+ if (plane_state->visible)1508815088+ crtc->base.state->plane_mask |= 1 << drm_plane_index(primary);1512615089}15127150901512815091static void intel_modeset_readout_hw_state(struct drm_device *dev)···1513215121 crtc->base.state->active = crtc->active;1513315122 crtc->base.enabled = crtc->active;15134151231513515135- memset(&crtc->base.mode, 0, sizeof(crtc->base.mode));1513615136- if (crtc->base.state->active) {1513715137- intel_mode_from_pipe_config(&crtc->base.mode, crtc->config);1513815138- intel_mode_from_pipe_config(&crtc->base.state->adjusted_mode, crtc->config);1513915139- WARN_ON(drm_atomic_set_mode_for_crtc(crtc->base.state, &crtc->base.mode));1514015140-1514115141- /*1514215142- * The initial mode needs to be set in order to keep1514315143- * the atomic core happy. It wants a valid mode if the1514415144- * crtc's enabled, so we do the above call.1514515145- *1514615146- * At this point some state updated by the connectors1514715147- * in their ->detect() callback has not run yet, so1514815148- * no recalculation can be done yet.1514915149- *1515015150- * Even if we could do a recalculation and modeset1515115151- * right now it would cause a double modeset if1515215152- * fbdev or userspace chooses a different initial mode.1515315153- *1515415154- * If that happens, someone indicated they wanted a1515515155- * mode change, which means it's safe to do a full1515615156- * recalculation.1515715157- */1515815158- crtc->base.state->mode.private_flags = I915_MODE_FLAG_INHERITED;1515915159- }1516015160-1516115161- crtc->base.hwmode = crtc->config->base.adjusted_mode;1516215162- readout_plane_state(crtc, to_intel_crtc_state(crtc->base.state));1512415124+ readout_plane_state(crtc);15163151251516415126 DRM_DEBUG_KMS("[CRTC:%d] hw state readout: %s\n",1516515127 crtc->base.base.id,···1519015206 connector->base.base.id,1519115207 connector->base.name,1519215208 connector->base.encoder ? "enabled" : "disabled");1520915209+ }1521015210+1521115211+ for_each_intel_crtc(dev, crtc) {1521215212+ crtc->base.hwmode = crtc->config->base.adjusted_mode;1521315213+1521415214+ memset(&crtc->base.mode, 0, sizeof(crtc->base.mode));1521515215+ if (crtc->base.state->active) {1521615216+ intel_mode_from_pipe_config(&crtc->base.mode, crtc->config);1521715217+ intel_mode_from_pipe_config(&crtc->base.state->adjusted_mode, crtc->config);1521815218+ WARN_ON(drm_atomic_set_mode_for_crtc(crtc->base.state, &crtc->base.mode));1521915219+1522015220+ /*1522115221+ * The initial mode needs to be set in order to keep1522215222+ * the atomic core happy. It wants a valid mode if the1522315223+ * crtc's enabled, so we do the above call.1522415224+ *1522515225+ * At this point some state updated by the connectors1522615226+ * in their ->detect() callback has not run yet, so1522715227+ * no recalculation can be done yet.1522815228+ *1522915229+ * Even if we could do a recalculation and modeset1523015230+ * right now it would cause a double modeset if1523115231+ * fbdev or userspace chooses a different initial mode.1523215232+ *1523315233+ * If that happens, someone indicated they wanted a1523415234+ * mode change, which means it's safe to do a full1523515235+ * recalculation.1523615236+ */1523715237+ crtc->base.state->mode.private_flags = I915_MODE_FLAG_INHERITED;1523815238+ }1519315239 }1519415240}1519515241
+1
drivers/gpu/drm/i915/intel_lrc.c
···16591659 if (flush_domains) {16601660 flags |= PIPE_CONTROL_RENDER_TARGET_CACHE_FLUSH;16611661 flags |= PIPE_CONTROL_DEPTH_CACHE_FLUSH;16621662+ flags |= PIPE_CONTROL_FLUSH_ENABLE;16621663 }1663166416641665 if (invalidate_domains) {
+2
drivers/gpu/drm/i915/intel_ringbuffer.c
···347347 if (flush_domains) {348348 flags |= PIPE_CONTROL_RENDER_TARGET_CACHE_FLUSH;349349 flags |= PIPE_CONTROL_DEPTH_CACHE_FLUSH;350350+ flags |= PIPE_CONTROL_FLUSH_ENABLE;350351 }351352 if (invalidate_domains) {352353 flags |= PIPE_CONTROL_TLB_INVALIDATE;···419418 if (flush_domains) {420419 flags |= PIPE_CONTROL_RENDER_TARGET_CACHE_FLUSH;421420 flags |= PIPE_CONTROL_DEPTH_CACHE_FLUSH;421421+ flags |= PIPE_CONTROL_FLUSH_ENABLE;422422 }423423 if (invalidate_domains) {424424 flags |= PIPE_CONTROL_TLB_INVALIDATE;
···227227 struct nouveau_bo *nvbo = nouveau_gem_object(gem);228228 struct nvkm_vma *vma;229229230230- if (nvbo->bo.mem.mem_type == TTM_PL_TT)230230+ if (is_power_of_2(nvbo->valid_domains))231231+ rep->domain = nvbo->valid_domains;232232+ else if (nvbo->bo.mem.mem_type == TTM_PL_TT)231233 rep->domain = NOUVEAU_GEM_DOMAIN_GART;232234 else233235 rep->domain = NOUVEAU_GEM_DOMAIN_VRAM;234234-235236 rep->offset = nvbo->bo.offset;236237 if (cli->vm) {237238 vma = nouveau_bo_vma_find(nvbo, cli->vm);
+6
drivers/gpu/drm/nouveau/nvkm/subdev/bios/init.c
···267267 index = NVKM_I2C_BUS_PRI;268268 if (init->outp && init->outp->i2c_upper_default)269269 index = NVKM_I2C_BUS_SEC;270270+ } else271271+ if (index == 0x80) {272272+ index = NVKM_I2C_BUS_PRI;273273+ } else274274+ if (index == 0x81) {275275+ index = NVKM_I2C_BUS_SEC;270276 }271277272278 bus = nvkm_i2c_bus_find(i2c, index);
···3535nvkm_device_agp_quirks[] = {3636 /* VIA Apollo PRO133x / GeForce FX 5600 Ultra - fdo#20341 */3737 { PCI_VENDOR_ID_VIA, 0x0691, PCI_VENDOR_ID_NVIDIA, 0x0311, 2 },3838+ /* SiS 761 does not support AGP cards, use PCI mode */3939+ { PCI_VENDOR_ID_SI, 0x0761, PCI_ANY_ID, PCI_ANY_ID, 0 },3840 {},3941};4042···139137 while (quirk->hostbridge_vendor) {140138 if (info.device->vendor == quirk->hostbridge_vendor &&141139 info.device->device == quirk->hostbridge_device &&142142- pci->pdev->vendor == quirk->chip_vendor &&143143- pci->pdev->device == quirk->chip_device) {140140+ (quirk->chip_vendor == (u16)PCI_ANY_ID ||141141+ pci->pdev->vendor == quirk->chip_vendor) &&142142+ (quirk->chip_device == (u16)PCI_ANY_ID ||143143+ pci->pdev->device == quirk->chip_device)) {144144 nvkm_info(subdev, "forcing default agp mode to %dX, "145145 "use NvAGP=<mode> to override\n",146146 quirk->mode);
+9-1
drivers/gpu/drm/qxl/qxl_display.c
···244244 ret = qxl_bo_reserve(bo, false);245245 if (ret)246246 return ret;247247+ ret = qxl_bo_pin(bo, bo->type, NULL);248248+ qxl_bo_unreserve(bo);249249+ if (ret)250250+ return ret;247251248252 qxl_draw_dirty_fb(qdev, qfb_src, bo, 0, 0,249253 &norect, one_clip_rect, inc);···261257 }262258 drm_vblank_put(dev, qcrtc->index);263259264264- qxl_bo_unreserve(bo);260260+ ret = qxl_bo_reserve(bo, false);261261+ if (!ret) {262262+ qxl_bo_unpin(bo);263263+ qxl_bo_unreserve(bo);264264+ }265265266266 return 0;267267}
+11-8
drivers/gpu/drm/qxl/qxl_fb.c
···144144145145 spin_lock_irqsave(&qfbdev->dirty.lock, flags);146146147147- if (qfbdev->dirty.y1 < y)148148- y = qfbdev->dirty.y1;149149- if (qfbdev->dirty.y2 > y2)150150- y2 = qfbdev->dirty.y2;151151- if (qfbdev->dirty.x1 < x)152152- x = qfbdev->dirty.x1;153153- if (qfbdev->dirty.x2 > x2)154154- x2 = qfbdev->dirty.x2;147147+ if ((qfbdev->dirty.y2 - qfbdev->dirty.y1) &&148148+ (qfbdev->dirty.x2 - qfbdev->dirty.x1)) {149149+ if (qfbdev->dirty.y1 < y)150150+ y = qfbdev->dirty.y1;151151+ if (qfbdev->dirty.y2 > y2)152152+ y2 = qfbdev->dirty.y2;153153+ if (qfbdev->dirty.x1 < x)154154+ x = qfbdev->dirty.x1;155155+ if (qfbdev->dirty.x2 > x2)156156+ x2 = qfbdev->dirty.x2;157157+ }155158156159 qfbdev->dirty.x1 = x;157160 qfbdev->dirty.x2 = x2;
+1-3
drivers/gpu/drm/qxl/qxl_release.c
···307307 idr_ret = qxl_release_alloc(qdev, QXL_RELEASE_SURFACE_CMD, release);308308 if (idr_ret < 0)309309 return idr_ret;310310- bo = qxl_bo_ref(to_qxl_bo(entry->tv.bo));310310+ bo = to_qxl_bo(entry->tv.bo);311311312312 (*release)->release_offset = create_rel->release_offset + 64;313313···316316 info = qxl_release_map(qdev, *release);317317 info->id = idr_ret;318318 qxl_release_unmap(qdev, *release, info);319319-320320- qxl_bo_unref(&bo);321319 return 0;322320 }323321
+2-12
drivers/gpu/drm/radeon/radeon_display.c
···16331633 radeon_fbdev_init(rdev);16341634 drm_kms_helper_poll_init(rdev->ddev);1635163516361636- if (rdev->pm.dpm_enabled) {16371637- /* do dpm late init */16381638- ret = radeon_pm_late_init(rdev);16391639- if (ret) {16401640- rdev->pm.dpm_enabled = false;16411641- DRM_ERROR("radeon_pm_late_init failed, disabling dpm\n");16421642- }16431643- /* set the dpm state for PX since there won't be16441644- * a modeset to call this.16451645- */16461646- radeon_pm_compute_clocks(rdev);16471647- }16361636+ /* do pm late init */16371637+ ret = radeon_pm_late_init(rdev);1648163816491639 return 0;16501640}
···397397{398398 drm_fb_helper_remove_one_connector(&rdev->mode_info.rfbdev->helper, connector);399399}400400+401401+void radeon_fbdev_restore_mode(struct radeon_device *rdev)402402+{403403+ struct radeon_fbdev *rfbdev = rdev->mode_info.rfbdev;404404+ struct drm_fb_helper *fb_helper;405405+ int ret;406406+407407+ if (!rfbdev)408408+ return;409409+410410+ fb_helper = &rfbdev->helper;411411+412412+ ret = drm_fb_helper_restore_fbdev_mode_unlocked(fb_helper);413413+ if (ret)414414+ DRM_DEBUG("failed to restore crtc mode\n");415415+}
+4-1
drivers/gpu/drm/radeon/radeon_kms.c
···598598 * Outdated mess for old drm with Xorg being in charge (void function now).599599 */600600/**601601- * radeon_driver_firstopen_kms - drm callback for last close601601+ * radeon_driver_lastclose_kms - drm callback for last close602602 *603603 * @dev: drm dev pointer604604 *···606606 */607607void radeon_driver_lastclose_kms(struct drm_device *dev)608608{609609+ struct radeon_device *rdev = dev->dev_private;610610+611611+ radeon_fbdev_restore_mode(rdev);609612 vga_switcheroo_process_delayed_switch();610613}611614
···717717 struct radeon_device *rdev = dev_get_drvdata(dev);718718 umode_t effective_mode = attr->mode;719719720720- /* Skip limit attributes if DPM is not enabled */720720+ /* Skip attributes if DPM is not enabled */721721 if (rdev->pm.pm_method != PM_METHOD_DPM &&722722 (attr == &sensor_dev_attr_temp1_crit.dev_attr.attr ||723723- attr == &sensor_dev_attr_temp1_crit_hyst.dev_attr.attr))723723+ attr == &sensor_dev_attr_temp1_crit_hyst.dev_attr.attr ||724724+ attr == &sensor_dev_attr_pwm1.dev_attr.attr ||725725+ attr == &sensor_dev_attr_pwm1_enable.dev_attr.attr ||726726+ attr == &sensor_dev_attr_pwm1_max.dev_attr.attr ||727727+ attr == &sensor_dev_attr_pwm1_min.dev_attr.attr))724728 return 0;725729726730 /* Skip fan attributes if fan is not present */···13301326 INIT_DELAYED_WORK(&rdev->pm.dynpm_idle_work, radeon_dynpm_idle_work_handler);1331132713321328 if (rdev->pm.num_power_states > 1) {13331333- /* where's the best place to put these? */13341334- ret = device_create_file(rdev->dev, &dev_attr_power_profile);13351335- if (ret)13361336- DRM_ERROR("failed to create device file for power profile\n");13371337- ret = device_create_file(rdev->dev, &dev_attr_power_method);13381338- if (ret)13391339- DRM_ERROR("failed to create device file for power method\n");13401340-13411329 if (radeon_debugfs_pm_init(rdev)) {13421330 DRM_ERROR("Failed to register debugfs file for PM!\n");13431331 }···13861390 if (ret)13871391 goto dpm_failed;13881392 rdev->pm.dpm_enabled = true;13891389-13901390- ret = device_create_file(rdev->dev, &dev_attr_power_dpm_state);13911391- if (ret)13921392- DRM_ERROR("failed to create device file for dpm state\n");13931393- ret = device_create_file(rdev->dev, &dev_attr_power_dpm_force_performance_level);13941394- if (ret)13951395- DRM_ERROR("failed to create device file for dpm state\n");13961396- /* XXX: these are noops for dpm but are here for backwards compat */13971397- ret = device_create_file(rdev->dev, &dev_attr_power_profile);13981398- if (ret)13991399- DRM_ERROR("failed to create device file for power profile\n");14001400- ret = device_create_file(rdev->dev, &dev_attr_power_method);14011401- if (ret)14021402- DRM_ERROR("failed to create device file for power method\n");1403139314041394 if (radeon_debugfs_pm_init(rdev)) {14051395 DRM_ERROR("Failed to register debugfs file for dpm!\n");···15271545 int ret = 0;1528154615291547 if (rdev->pm.pm_method == PM_METHOD_DPM) {15301530- mutex_lock(&rdev->pm.mutex);15311531- ret = radeon_dpm_late_enable(rdev);15321532- mutex_unlock(&rdev->pm.mutex);15481548+ if (rdev->pm.dpm_enabled) {15491549+ ret = device_create_file(rdev->dev, &dev_attr_power_dpm_state);15501550+ if (ret)15511551+ DRM_ERROR("failed to create device file for dpm state\n");15521552+ ret = device_create_file(rdev->dev, &dev_attr_power_dpm_force_performance_level);15531553+ if (ret)15541554+ DRM_ERROR("failed to create device file for dpm state\n");15551555+ /* XXX: these are noops for dpm but are here for backwards compat */15561556+ ret = device_create_file(rdev->dev, &dev_attr_power_profile);15571557+ if (ret)15581558+ DRM_ERROR("failed to create device file for power profile\n");15591559+ ret = device_create_file(rdev->dev, &dev_attr_power_method);15601560+ if (ret)15611561+ DRM_ERROR("failed to create device file for power method\n");15621562+15631563+ mutex_lock(&rdev->pm.mutex);15641564+ ret = radeon_dpm_late_enable(rdev);15651565+ mutex_unlock(&rdev->pm.mutex);15661566+ if (ret) {15671567+ rdev->pm.dpm_enabled = false;15681568+ DRM_ERROR("radeon_pm_late_init failed, disabling dpm\n");15691569+ } else {15701570+ /* set the dpm state for PX since there won't be15711571+ * a modeset to call this.15721572+ */15731573+ radeon_pm_compute_clocks(rdev);15741574+ }15751575+ }15761576+ } else {15771577+ if (rdev->pm.num_power_states > 1) {15781578+ /* where's the best place to put these? */15791579+ ret = device_create_file(rdev->dev, &dev_attr_power_profile);15801580+ if (ret)15811581+ DRM_ERROR("failed to create device file for power profile\n");15821582+ ret = device_create_file(rdev->dev, &dev_attr_power_method);15831583+ if (ret)15841584+ DRM_ERROR("failed to create device file for power method\n");15851585+ }15331586 }15341587 return ret;15351588}
···2424#include <linux/kernel.h>2525#include <linux/module.h>2626#include <linux/delay.h>2727+#include <linux/dmi.h>2728#include <linux/i2c.h>2829#include <linux/clk.h>2930#include <linux/clk-provider.h>···5251}53525453#ifdef CONFIG_ACPI5454+/*5555+ * The HCNT/LCNT information coming from ACPI should be the most accurate5656+ * for given platform. However, some systems get it wrong. On such systems5757+ * we get better results by calculating those based on the input clock.5858+ */5959+static const struct dmi_system_id dw_i2c_no_acpi_params[] = {6060+ {6161+ .ident = "Dell Inspiron 7348",6262+ .matches = {6363+ DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),6464+ DMI_MATCH(DMI_PRODUCT_NAME, "Inspiron 7348"),6565+ },6666+ },6767+ { }6868+};6969+5570static void dw_i2c_acpi_params(struct platform_device *pdev, char method[],5671 u16 *hcnt, u16 *lcnt, u32 *sda_hold)5772{5873 struct acpi_buffer buf = { ACPI_ALLOCATE_BUFFER };5974 acpi_handle handle = ACPI_HANDLE(&pdev->dev);6075 union acpi_object *obj;7676+7777+ if (dmi_check_system(dw_i2c_no_acpi_params))7878+ return;61796280 if (ACPI_FAILURE(acpi_evaluate_object(handle, method, NULL, &buf)))6381 return;···273253 adap->dev.parent = &pdev->dev;274254 adap->dev.of_node = pdev->dev.of_node;275255276276- r = i2c_add_numbered_adapter(adap);277277- if (r) {278278- dev_err(&pdev->dev, "failure adding adapter\n");279279- return r;280280- }281281-282256 if (dev->pm_runtime_disabled) {283257 pm_runtime_forbid(&pdev->dev);284258 } else {···280266 pm_runtime_use_autosuspend(&pdev->dev);281267 pm_runtime_set_active(&pdev->dev);282268 pm_runtime_enable(&pdev->dev);269269+ }270270+271271+ r = i2c_add_numbered_adapter(adap);272272+ if (r) {273273+ dev_err(&pdev->dev, "failure adding adapter\n");274274+ pm_runtime_disable(&pdev->dev);275275+ return r;283276 }284277285278 return 0;
···11/*22 * Copyright (c) 2013, Cisco Systems, Inc. All rights reserved.33 *44- * This program is free software; you may redistribute it and/or modify55- * it under the terms of the GNU General Public License as published by66- * the Free Software Foundation; version 2 of the License.44+ * This software is available to you under a choice of one of two55+ * licenses. You may choose to be licensed under the terms of the GNU66+ * General Public License (GPL) Version 2, available from the file77+ * COPYING in the main directory of this source tree, or the88+ * BSD license below:99+ *1010+ * Redistribution and use in source and binary forms, with or1111+ * without modification, are permitted provided that the following1212+ * conditions are met:1313+ *1414+ * - Redistributions of source code must retain the above1515+ * copyright notice, this list of conditions and the following1616+ * disclaimer.1717+ *1818+ * - Redistributions in binary form must reproduce the above1919+ * copyright notice, this list of conditions and the following2020+ * disclaimer in the documentation and/or other materials2121+ * provided with the distribution.722 *823 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,924 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+18-3
drivers/infiniband/hw/usnic/usnic_abi.h
···11/*22 * Copyright (c) 2013, Cisco Systems, Inc. All rights reserved.33 *44- * This program is free software; you may redistribute it and/or modify55- * it under the terms of the GNU General Public License as published by66- * the Free Software Foundation; version 2 of the License.44+ * This software is available to you under a choice of one of two55+ * licenses. You may choose to be licensed under the terms of the GNU66+ * General Public License (GPL) Version 2, available from the file77+ * COPYING in the main directory of this source tree, or the88+ * BSD license below:99+ *1010+ * Redistribution and use in source and binary forms, with or1111+ * without modification, are permitted provided that the following1212+ * conditions are met:1313+ *1414+ * - Redistributions of source code must retain the above1515+ * copyright notice, this list of conditions and the following1616+ * disclaimer.1717+ *1818+ * - Redistributions in binary form must reproduce the above1919+ * copyright notice, this list of conditions and the following2020+ * disclaimer in the documentation and/or other materials2121+ * provided with the distribution.722 *823 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,924 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
···11/*22 * Copyright (c) 2013, Cisco Systems, Inc. All rights reserved.33 *44- * This program is free software; you may redistribute it and/or modify55- * it under the terms of the GNU General Public License as published by66- * the Free Software Foundation; version 2 of the License.44+ * This software is available to you under a choice of one of two55+ * licenses. You may choose to be licensed under the terms of the GNU66+ * General Public License (GPL) Version 2, available from the file77+ * COPYING in the main directory of this source tree, or the88+ * BSD license below:99+ *1010+ * Redistribution and use in source and binary forms, with or1111+ * without modification, are permitted provided that the following1212+ * conditions are met:1313+ *1414+ * - Redistributions of source code must retain the above1515+ * copyright notice, this list of conditions and the following1616+ * disclaimer.1717+ *1818+ * - Redistributions in binary form must reproduce the above1919+ * copyright notice, this list of conditions and the following2020+ * disclaimer in the documentation and/or other materials2121+ * provided with the distribution.722 *823 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,924 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+18-3
drivers/infiniband/hw/usnic/usnic_common_util.h
···11/*22 * Copyright (c) 2013, Cisco Systems, Inc. All rights reserved.33 *44- * This program is free software; you may redistribute it and/or modify55- * it under the terms of the GNU General Public License as published by66- * the Free Software Foundation; version 2 of the License.44+ * This software is available to you under a choice of one of two55+ * licenses. You may choose to be licensed under the terms of the GNU66+ * General Public License (GPL) Version 2, available from the file77+ * COPYING in the main directory of this source tree, or the88+ * BSD license below:99+ *1010+ * Redistribution and use in source and binary forms, with or1111+ * without modification, are permitted provided that the following1212+ * conditions are met:1313+ *1414+ * - Redistributions of source code must retain the above1515+ * copyright notice, this list of conditions and the following1616+ * disclaimer.1717+ *1818+ * - Redistributions in binary form must reproduce the above1919+ * copyright notice, this list of conditions and the following2020+ * disclaimer in the documentation and/or other materials2121+ * provided with the distribution.722 *823 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,924 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+18-3
drivers/infiniband/hw/usnic/usnic_debugfs.c
···11/*22 * Copyright (c) 2013, Cisco Systems, Inc. All rights reserved.33 *44- * This program is free software; you may redistribute it and/or modify55- * it under the terms of the GNU General Public License as published by66- * the Free Software Foundation; version 2 of the License.44+ * This software is available to you under a choice of one of two55+ * licenses. You may choose to be licensed under the terms of the GNU66+ * General Public License (GPL) Version 2, available from the file77+ * COPYING in the main directory of this source tree, or the88+ * BSD license below:99+ *1010+ * Redistribution and use in source and binary forms, with or1111+ * without modification, are permitted provided that the following1212+ * conditions are met:1313+ *1414+ * - Redistributions of source code must retain the above1515+ * copyright notice, this list of conditions and the following1616+ * disclaimer.1717+ *1818+ * - Redistributions in binary form must reproduce the above1919+ * copyright notice, this list of conditions and the following2020+ * disclaimer in the documentation and/or other materials2121+ * provided with the distribution.722 *823 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,924 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+18-3
drivers/infiniband/hw/usnic/usnic_debugfs.h
···11/*22 * Copyright (c) 2013, Cisco Systems, Inc. All rights reserved.33 *44- * This program is free software; you may redistribute it and/or modify55- * it under the terms of the GNU General Public License as published by66- * the Free Software Foundation; version 2 of the License.44+ * This software is available to you under a choice of one of two55+ * licenses. You may choose to be licensed under the terms of the GNU66+ * General Public License (GPL) Version 2, available from the file77+ * COPYING in the main directory of this source tree, or the88+ * BSD license below:99+ *1010+ * Redistribution and use in source and binary forms, with or1111+ * without modification, are permitted provided that the following1212+ * conditions are met:1313+ *1414+ * - Redistributions of source code must retain the above1515+ * copyright notice, this list of conditions and the following1616+ * disclaimer.1717+ *1818+ * - Redistributions in binary form must reproduce the above1919+ * copyright notice, this list of conditions and the following2020+ * disclaimer in the documentation and/or other materials2121+ * provided with the distribution.722 *823 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,924 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+18-3
drivers/infiniband/hw/usnic/usnic_fwd.c
···11/*22 * Copyright (c) 2013, Cisco Systems, Inc. All rights reserved.33 *44- * This program is free software; you may redistribute it and/or modify55- * it under the terms of the GNU General Public License as published by66- * the Free Software Foundation; version 2 of the License.44+ * This software is available to you under a choice of one of two55+ * licenses. You may choose to be licensed under the terms of the GNU66+ * General Public License (GPL) Version 2, available from the file77+ * COPYING in the main directory of this source tree, or the88+ * BSD license below:99+ *1010+ * Redistribution and use in source and binary forms, with or1111+ * without modification, are permitted provided that the following1212+ * conditions are met:1313+ *1414+ * - Redistributions of source code must retain the above1515+ * copyright notice, this list of conditions and the following1616+ * disclaimer.1717+ *1818+ * - Redistributions in binary form must reproduce the above1919+ * copyright notice, this list of conditions and the following2020+ * disclaimer in the documentation and/or other materials2121+ * provided with the distribution.722 *823 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,924 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+18-3
drivers/infiniband/hw/usnic/usnic_fwd.h
···11/*22 * Copyright (c) 2013, Cisco Systems, Inc. All rights reserved.33 *44- * This program is free software; you may redistribute it and/or modify55- * it under the terms of the GNU General Public License as published by66- * the Free Software Foundation; version 2 of the License.44+ * This software is available to you under a choice of one of two55+ * licenses. You may choose to be licensed under the terms of the GNU66+ * General Public License (GPL) Version 2, available from the file77+ * COPYING in the main directory of this source tree, or the88+ * BSD license below:99+ *1010+ * Redistribution and use in source and binary forms, with or1111+ * without modification, are permitted provided that the following1212+ * conditions are met:1313+ *1414+ * - Redistributions of source code must retain the above1515+ * copyright notice, this list of conditions and the following1616+ * disclaimer.1717+ *1818+ * - Redistributions in binary form must reproduce the above1919+ * copyright notice, this list of conditions and the following2020+ * disclaimer in the documentation and/or other materials2121+ * provided with the distribution.722 *823 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,924 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+18-3
drivers/infiniband/hw/usnic/usnic_ib.h
···11/*22 * Copyright (c) 2013, Cisco Systems, Inc. All rights reserved.33 *44- * This program is free software; you may redistribute it and/or modify55- * it under the terms of the GNU General Public License as published by66- * the Free Software Foundation; version 2 of the License.44+ * This software is available to you under a choice of one of two55+ * licenses. You may choose to be licensed under the terms of the GNU66+ * General Public License (GPL) Version 2, available from the file77+ * COPYING in the main directory of this source tree, or the88+ * BSD license below:99+ *1010+ * Redistribution and use in source and binary forms, with or1111+ * without modification, are permitted provided that the following1212+ * conditions are met:1313+ *1414+ * - Redistributions of source code must retain the above1515+ * copyright notice, this list of conditions and the following1616+ * disclaimer.1717+ *1818+ * - Redistributions in binary form must reproduce the above1919+ * copyright notice, this list of conditions and the following2020+ * disclaimer in the documentation and/or other materials2121+ * provided with the distribution.722 *823 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,924 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+18-3
drivers/infiniband/hw/usnic/usnic_ib_main.c
···11/*22 * Copyright (c) 2013, Cisco Systems, Inc. All rights reserved.33 *44- * This program is free software; you may redistribute it and/or modify55- * it under the terms of the GNU General Public License as published by66- * the Free Software Foundation; version 2 of the License.44+ * This software is available to you under a choice of one of two55+ * licenses. You may choose to be licensed under the terms of the GNU66+ * General Public License (GPL) Version 2, available from the file77+ * COPYING in the main directory of this source tree, or the88+ * BSD license below:99+ *1010+ * Redistribution and use in source and binary forms, with or1111+ * without modification, are permitted provided that the following1212+ * conditions are met:1313+ *1414+ * - Redistributions of source code must retain the above1515+ * copyright notice, this list of conditions and the following1616+ * disclaimer.1717+ *1818+ * - Redistributions in binary form must reproduce the above1919+ * copyright notice, this list of conditions and the following2020+ * disclaimer in the documentation and/or other materials2121+ * provided with the distribution.722 *823 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,924 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+18-3
drivers/infiniband/hw/usnic/usnic_ib_qp_grp.c
···11/*22 * Copyright (c) 2013, Cisco Systems, Inc. All rights reserved.33 *44- * This program is free software; you may redistribute it and/or modify55- * it under the terms of the GNU General Public License as published by66- * the Free Software Foundation; version 2 of the License.44+ * This software is available to you under a choice of one of two55+ * licenses. You may choose to be licensed under the terms of the GNU66+ * General Public License (GPL) Version 2, available from the file77+ * COPYING in the main directory of this source tree, or the88+ * BSD license below:99+ *1010+ * Redistribution and use in source and binary forms, with or1111+ * without modification, are permitted provided that the following1212+ * conditions are met:1313+ *1414+ * - Redistributions of source code must retain the above1515+ * copyright notice, this list of conditions and the following1616+ * disclaimer.1717+ *1818+ * - Redistributions in binary form must reproduce the above1919+ * copyright notice, this list of conditions and the following2020+ * disclaimer in the documentation and/or other materials2121+ * provided with the distribution.722 *823 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,924 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+18-3
drivers/infiniband/hw/usnic/usnic_ib_qp_grp.h
···11/*22 * Copyright (c) 2013, Cisco Systems, Inc. All rights reserved.33 *44- * This program is free software; you may redistribute it and/or modify55- * it under the terms of the GNU General Public License as published by66- * the Free Software Foundation; version 2 of the License.44+ * This software is available to you under a choice of one of two55+ * licenses. You may choose to be licensed under the terms of the GNU66+ * General Public License (GPL) Version 2, available from the file77+ * COPYING in the main directory of this source tree, or the88+ * BSD license below:99+ *1010+ * Redistribution and use in source and binary forms, with or1111+ * without modification, are permitted provided that the following1212+ * conditions are met:1313+ *1414+ * - Redistributions of source code must retain the above1515+ * copyright notice, this list of conditions and the following1616+ * disclaimer.1717+ *1818+ * - Redistributions in binary form must reproduce the above1919+ * copyright notice, this list of conditions and the following2020+ * disclaimer in the documentation and/or other materials2121+ * provided with the distribution.722 *823 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,924 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+18-3
drivers/infiniband/hw/usnic/usnic_ib_sysfs.c
···11/*22 * Copyright (c) 2013, Cisco Systems, Inc. All rights reserved.33 *44- * This program is free software; you may redistribute it and/or modify55- * it under the terms of the GNU General Public License as published by66- * the Free Software Foundation; version 2 of the License.44+ * This software is available to you under a choice of one of two55+ * licenses. You may choose to be licensed under the terms of the GNU66+ * General Public License (GPL) Version 2, available from the file77+ * COPYING in the main directory of this source tree, or the88+ * BSD license below:99+ *1010+ * Redistribution and use in source and binary forms, with or1111+ * without modification, are permitted provided that the following1212+ * conditions are met:1313+ *1414+ * - Redistributions of source code must retain the above1515+ * copyright notice, this list of conditions and the following1616+ * disclaimer.1717+ *1818+ * - Redistributions in binary form must reproduce the above1919+ * copyright notice, this list of conditions and the following2020+ * disclaimer in the documentation and/or other materials2121+ * provided with the distribution.722 *823 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,924 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+18-3
drivers/infiniband/hw/usnic/usnic_ib_sysfs.h
···11/*22 * Copyright (c) 2013, Cisco Systems, Inc. All rights reserved.33 *44- * This program is free software; you may redistribute it and/or modify55- * it under the terms of the GNU General Public License as published by66- * the Free Software Foundation; version 2 of the License.44+ * This software is available to you under a choice of one of two55+ * licenses. You may choose to be licensed under the terms of the GNU66+ * General Public License (GPL) Version 2, available from the file77+ * COPYING in the main directory of this source tree, or the88+ * BSD license below:99+ *1010+ * Redistribution and use in source and binary forms, with or1111+ * without modification, are permitted provided that the following1212+ * conditions are met:1313+ *1414+ * - Redistributions of source code must retain the above1515+ * copyright notice, this list of conditions and the following1616+ * disclaimer.1717+ *1818+ * - Redistributions in binary form must reproduce the above1919+ * copyright notice, this list of conditions and the following2020+ * disclaimer in the documentation and/or other materials2121+ * provided with the distribution.722 *823 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,924 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+18-3
drivers/infiniband/hw/usnic/usnic_ib_verbs.c
···11/*22 * Copyright (c) 2013, Cisco Systems, Inc. All rights reserved.33 *44- * This program is free software; you may redistribute it and/or modify55- * it under the terms of the GNU General Public License as published by66- * the Free Software Foundation; version 2 of the License.44+ * This software is available to you under a choice of one of two55+ * licenses. You may choose to be licensed under the terms of the GNU66+ * General Public License (GPL) Version 2, available from the file77+ * COPYING in the main directory of this source tree, or the88+ * BSD license below:99+ *1010+ * Redistribution and use in source and binary forms, with or1111+ * without modification, are permitted provided that the following1212+ * conditions are met:1313+ *1414+ * - Redistributions of source code must retain the above1515+ * copyright notice, this list of conditions and the following1616+ * disclaimer.1717+ *1818+ * - Redistributions in binary form must reproduce the above1919+ * copyright notice, this list of conditions and the following2020+ * disclaimer in the documentation and/or other materials2121+ * provided with the distribution.722 *823 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,924 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+18-3
drivers/infiniband/hw/usnic/usnic_ib_verbs.h
···11/*22 * Copyright (c) 2013, Cisco Systems, Inc. All rights reserved.33 *44- * This program is free software; you may redistribute it and/or modify55- * it under the terms of the GNU General Public License as published by66- * the Free Software Foundation; version 2 of the License.44+ * This software is available to you under a choice of one of two55+ * licenses. You may choose to be licensed under the terms of the GNU66+ * General Public License (GPL) Version 2, available from the file77+ * COPYING in the main directory of this source tree, or the88+ * BSD license below:99+ *1010+ * Redistribution and use in source and binary forms, with or1111+ * without modification, are permitted provided that the following1212+ * conditions are met:1313+ *1414+ * - Redistributions of source code must retain the above1515+ * copyright notice, this list of conditions and the following1616+ * disclaimer.1717+ *1818+ * - Redistributions in binary form must reproduce the above1919+ * copyright notice, this list of conditions and the following2020+ * disclaimer in the documentation and/or other materials2121+ * provided with the distribution.722 *823 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,924 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+18-3
drivers/infiniband/hw/usnic/usnic_log.h
···11/*22 * Copyright (c) 2013, Cisco Systems, Inc. All rights reserved.33 *44- * This program is free software; you may redistribute it and/or modify55- * it under the terms of the GNU General Public License as published by66- * the Free Software Foundation; version 2 of the License.44+ * This software is available to you under a choice of one of two55+ * licenses. You may choose to be licensed under the terms of the GNU66+ * General Public License (GPL) Version 2, available from the file77+ * COPYING in the main directory of this source tree, or the88+ * BSD license below:99+ *1010+ * Redistribution and use in source and binary forms, with or1111+ * without modification, are permitted provided that the following1212+ * conditions are met:1313+ *1414+ * - Redistributions of source code must retain the above1515+ * copyright notice, this list of conditions and the following1616+ * disclaimer.1717+ *1818+ * - Redistributions in binary form must reproduce the above1919+ * copyright notice, this list of conditions and the following2020+ * disclaimer in the documentation and/or other materials2121+ * provided with the distribution.722 *823 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,924 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+18-3
drivers/infiniband/hw/usnic/usnic_transport.c
···11/*22 * Copyright (c) 2013, Cisco Systems, Inc. All rights reserved.33 *44- * This program is free software; you may redistribute it and/or modify55- * it under the terms of the GNU General Public License as published by66- * the Free Software Foundation; version 2 of the License.44+ * This software is available to you under a choice of one of two55+ * licenses. You may choose to be licensed under the terms of the GNU66+ * General Public License (GPL) Version 2, available from the file77+ * COPYING in the main directory of this source tree, or the88+ * BSD license below:99+ *1010+ * Redistribution and use in source and binary forms, with or1111+ * without modification, are permitted provided that the following1212+ * conditions are met:1313+ *1414+ * - Redistributions of source code must retain the above1515+ * copyright notice, this list of conditions and the following1616+ * disclaimer.1717+ *1818+ * - Redistributions in binary form must reproduce the above1919+ * copyright notice, this list of conditions and the following2020+ * disclaimer in the documentation and/or other materials2121+ * provided with the distribution.722 *823 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,924 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+18-3
drivers/infiniband/hw/usnic/usnic_transport.h
···11/*22 * Copyright (c) 2013, Cisco Systems, Inc. All rights reserved.33 *44- * This program is free software; you may redistribute it and/or modify55- * it under the terms of the GNU General Public License as published by66- * the Free Software Foundation; version 2 of the License.44+ * This software is available to you under a choice of one of two55+ * licenses. You may choose to be licensed under the terms of the GNU66+ * General Public License (GPL) Version 2, available from the file77+ * COPYING in the main directory of this source tree, or the88+ * BSD license below:99+ *1010+ * Redistribution and use in source and binary forms, with or1111+ * without modification, are permitted provided that the following1212+ * conditions are met:1313+ *1414+ * - Redistributions of source code must retain the above1515+ * copyright notice, this list of conditions and the following1616+ * disclaimer.1717+ *1818+ * - Redistributions in binary form must reproduce the above1919+ * copyright notice, this list of conditions and the following2020+ * disclaimer in the documentation and/or other materials2121+ * provided with the distribution.722 *823 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,924 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+1-1
drivers/infiniband/hw/usnic/usnic_uiom.c
···77 * licenses. You may choose to be licensed under the terms of the GNU88 * General Public License (GPL) Version 2, available from the file99 * COPYING in the main directory of this source tree, or the1010- * OpenIB.org BSD license below:1010+ * BSD license below:1111 *1212 * Redistribution and use in source and binary forms, with or1313 * without modification, are permitted provided that the following
+18-3
drivers/infiniband/hw/usnic/usnic_uiom.h
···11/*22 * Copyright (c) 2013, Cisco Systems, Inc. All rights reserved.33 *44- * This program is free software; you may redistribute it and/or modify55- * it under the terms of the GNU General Public License as published by66- * the Free Software Foundation; version 2 of the License.44+ * This software is available to you under a choice of one of two55+ * licenses. You may choose to be licensed under the terms of the GNU66+ * General Public License (GPL) Version 2, available from the file77+ * COPYING in the main directory of this source tree, or the88+ * BSD license below:99+ *1010+ * Redistribution and use in source and binary forms, with or1111+ * without modification, are permitted provided that the following1212+ * conditions are met:1313+ *1414+ * - Redistributions of source code must retain the above1515+ * copyright notice, this list of conditions and the following1616+ * disclaimer.1717+ *1818+ * - Redistributions in binary form must reproduce the above1919+ * copyright notice, this list of conditions and the following2020+ * disclaimer in the documentation and/or other materials2121+ * provided with the distribution.722 *823 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,924 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
···11/*22 * Copyright (c) 2014, Cisco Systems, Inc. All rights reserved.33 *44- * This program is free software; you may redistribute it and/or modify55- * it under the terms of the GNU General Public License as published by66- * the Free Software Foundation; version 2 of the License.44+ * This software is available to you under a choice of one of two55+ * licenses. You may choose to be licensed under the terms of the GNU66+ * General Public License (GPL) Version 2, available from the file77+ * COPYING in the main directory of this source tree, or the88+ * BSD license below:99+ *1010+ * Redistribution and use in source and binary forms, with or1111+ * without modification, are permitted provided that the following1212+ * conditions are met:1313+ *1414+ * - Redistributions of source code must retain the above1515+ * copyright notice, this list of conditions and the following1616+ * disclaimer.1717+ *1818+ * - Redistributions in binary form must reproduce the above1919+ * copyright notice, this list of conditions and the following2020+ * disclaimer in the documentation and/or other materials2121+ * provided with the distribution.722 *823 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,924 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
···11/*22 * Copyright (c) 2013, Cisco Systems, Inc. All rights reserved.33 *44- * This program is free software; you may redistribute it and/or modify55- * it under the terms of the GNU General Public License as published by66- * the Free Software Foundation; version 2 of the License.44+ * This software is available to you under a choice of one of two55+ * licenses. You may choose to be licensed under the terms of the GNU66+ * General Public License (GPL) Version 2, available from the file77+ * COPYING in the main directory of this source tree, or the88+ * BSD license below:99+ *1010+ * Redistribution and use in source and binary forms, with or1111+ * without modification, are permitted provided that the following1212+ * conditions are met:1313+ *1414+ * - Redistributions of source code must retain the above1515+ * copyright notice, this list of conditions and the following1616+ * disclaimer.1717+ *1818+ * - Redistributions in binary form must reproduce the above1919+ * copyright notice, this list of conditions and the following2020+ * disclaimer in the documentation and/or other materials2121+ * provided with the distribution.722 *823 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,924 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+18-3
drivers/infiniband/hw/usnic/usnic_vnic.c
···11/*22 * Copyright (c) 2013, Cisco Systems, Inc. All rights reserved.33 *44- * This program is free software; you may redistribute it and/or modify55- * it under the terms of the GNU General Public License as published by66- * the Free Software Foundation; version 2 of the License.44+ * This software is available to you under a choice of one of two55+ * licenses. You may choose to be licensed under the terms of the GNU66+ * General Public License (GPL) Version 2, available from the file77+ * COPYING in the main directory of this source tree, or the88+ * BSD license below:99+ *1010+ * Redistribution and use in source and binary forms, with or1111+ * without modification, are permitted provided that the following1212+ * conditions are met:1313+ *1414+ * - Redistributions of source code must retain the above1515+ * copyright notice, this list of conditions and the following1616+ * disclaimer.1717+ *1818+ * - Redistributions in binary form must reproduce the above1919+ * copyright notice, this list of conditions and the following2020+ * disclaimer in the documentation and/or other materials2121+ * provided with the distribution.722 *823 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,924 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+18-3
drivers/infiniband/hw/usnic/usnic_vnic.h
···11/*22 * Copyright (c) 2013, Cisco Systems, Inc. All rights reserved.33 *44- * This program is free software; you may redistribute it and/or modify55- * it under the terms of the GNU General Public License as published by66- * the Free Software Foundation; version 2 of the License.44+ * This software is available to you under a choice of one of two55+ * licenses. You may choose to be licensed under the terms of the GNU66+ * General Public License (GPL) Version 2, available from the file77+ * COPYING in the main directory of this source tree, or the88+ * BSD license below:99+ *1010+ * Redistribution and use in source and binary forms, with or1111+ * without modification, are permitted provided that the following1212+ * conditions are met:1313+ *1414+ * - Redistributions of source code must retain the above1515+ * copyright notice, this list of conditions and the following1616+ * disclaimer.1717+ *1818+ * - Redistributions in binary form must reproduce the above1919+ * copyright notice, this list of conditions and the following2020+ * disclaimer in the documentation and/or other materials2121+ * provided with the distribution.722 *823 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,924 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
···241241 memcpy(&cyapa->product_id[13], &resp_data[62], 2);242242 cyapa->product_id[15] = '\0';243243244244+ /* Get the number of Rx electrodes. */244245 rotat_align = resp_data[68];245245- if (rotat_align) {246246- cyapa->electrodes_rx = cyapa->electrodes_y;247247- cyapa->electrodes_rx = cyapa->electrodes_y;248248- } else {249249- cyapa->electrodes_rx = cyapa->electrodes_x;250250- cyapa->electrodes_rx = cyapa->electrodes_y;251251- }246246+ cyapa->electrodes_rx =247247+ rotat_align ? cyapa->electrodes_y : cyapa->electrodes_x;252248 cyapa->aligned_electrodes_rx = (cyapa->electrodes_rx + 3) & ~3u;253249254250 if (!cyapa->electrodes_x || !cyapa->electrodes_y ||
+6-2
drivers/input/touchscreen/ads7846.c
···668668669669static int ads7846_get_value(struct ads7846 *ts, struct spi_message *m)670670{671671+ int value;671672 struct spi_transfer *t =672673 list_entry(m->transfers.prev, struct spi_transfer, transfer_list);673674674675 if (ts->model == 7845) {675675- return be16_to_cpup((__be16 *)&(((char*)t->rx_buf)[1])) >> 3;676676+ value = be16_to_cpup((__be16 *)&(((char *)t->rx_buf)[1]));676677 } else {677678 /*678679 * adjust: on-wire is a must-ignore bit, a BE12 value, then679680 * padding; built from two 8 bit values written msb-first.680681 */681681- return be16_to_cpup((__be16 *)t->rx_buf) >> 3;682682+ value = be16_to_cpup((__be16 *)t->rx_buf);682683 }684684+685685+ /* enforce ADC output is 12 bits width */686686+ return (value >> 3) & 0xfff;683687}684688685689static void ads7846_update_value(struct spi_message *m, int val)
+1-2
drivers/iommu/Kconfig
···2323config IOMMU_IO_PGTABLE_LPAE2424 bool "ARMv7/v8 Long Descriptor Format"2525 select IOMMU_IO_PGTABLE2626- # SWIOTLB guarantees a dma_to_phys() implementation2727- depends on ARM || ARM64 || (COMPILE_TEST && SWIOTLB)2626+ depends on HAS_DMA && (ARM || ARM64 || COMPILE_TEST)2827 help2928 Enable support for the ARM long descriptor pagetable format.3029 This allocator supports 4K/2M/1G, 16K/32M and 64K/512M page
+9
drivers/iommu/amd_iommu.c
···20062006{20072007 struct amd_iommu *iommu;2008200820092009+ /*20102010+ * First check if the device is still attached. It might already20112011+ * be detached from its domain because the generic20122012+ * iommu_detach_group code detached it and we try again here in20132013+ * our alias handling.20142014+ */20152015+ if (!dev_data->domain)20162016+ return;20172017+20092018 iommu = amd_iommu_rlookup_table[dev_data->devid];2010201920112020 /* decrease reference counters */
+3
drivers/iommu/amd_iommu_init.c
···12561256 if (!iommu->dev)12571257 return -ENODEV;1258125812591259+ /* Prevent binding other PCI device drivers to IOMMU devices */12601260+ iommu->dev->match_driver = false;12611261+12591262 pci_read_config_dword(iommu->dev, cap_ptr + MMIO_CAP_HDR_OFFSET,12601263 &iommu->cap);12611264 pci_read_config_dword(iommu->dev, cap_ptr + MMIO_RANGE_OFFSET,
+15-6
drivers/iommu/arm-smmu-v3.c
···5656#define IDR0_TTF_SHIFT 25757#define IDR0_TTF_MASK 0x35858#define IDR0_TTF_AARCH64 (2 << IDR0_TTF_SHIFT)5959+#define IDR0_TTF_AARCH32_64 (3 << IDR0_TTF_SHIFT)5960#define IDR0_S1P (1 << 1)6061#define IDR0_S2P (1 << 0)6162···343342#define CMDQ_TLBI_0_VMID_SHIFT 32344343#define CMDQ_TLBI_0_ASID_SHIFT 48345344#define CMDQ_TLBI_1_LEAF (1UL << 0)346346-#define CMDQ_TLBI_1_ADDR_MASK ~0xfffUL345345+#define CMDQ_TLBI_1_VA_MASK ~0xfffUL346346+#define CMDQ_TLBI_1_IPA_MASK 0xfffffffff000UL347347348348#define CMDQ_PRI_0_SSID_SHIFT 12349349#define CMDQ_PRI_0_SSID_MASK 0xfffffUL···772770 break;773771 case CMDQ_OP_TLBI_NH_VA:774772 cmd[0] |= (u64)ent->tlbi.asid << CMDQ_TLBI_0_ASID_SHIFT;775775- /* Fallthrough */773773+ cmd[1] |= ent->tlbi.leaf ? CMDQ_TLBI_1_LEAF : 0;774774+ cmd[1] |= ent->tlbi.addr & CMDQ_TLBI_1_VA_MASK;775775+ break;776776 case CMDQ_OP_TLBI_S2_IPA:777777 cmd[0] |= (u64)ent->tlbi.vmid << CMDQ_TLBI_0_VMID_SHIFT;778778 cmd[1] |= ent->tlbi.leaf ? CMDQ_TLBI_1_LEAF : 0;779779- cmd[1] |= ent->tlbi.addr & CMDQ_TLBI_1_ADDR_MASK;779779+ cmd[1] |= ent->tlbi.addr & CMDQ_TLBI_1_IPA_MASK;780780 break;781781 case CMDQ_OP_TLBI_NH_ASID:782782 cmd[0] |= (u64)ent->tlbi.asid << CMDQ_TLBI_0_ASID_SHIFT;···24642460 }2465246124662462 /* We only support the AArch64 table format at present */24672467- if ((reg & IDR0_TTF_MASK << IDR0_TTF_SHIFT) < IDR0_TTF_AARCH64) {24632463+ switch (reg & IDR0_TTF_MASK << IDR0_TTF_SHIFT) {24642464+ case IDR0_TTF_AARCH32_64:24652465+ smmu->ias = 40;24662466+ /* Fallthrough */24672467+ case IDR0_TTF_AARCH64:24682468+ break;24692469+ default:24682470 dev_err(smmu->dev, "AArch64 table format not supported!\n");24692471 return -ENXIO;24702472 }···25512541 dev_warn(smmu->dev,25522542 "failed to set DMA mask for table walker\n");2553254325542554- if (!smmu->ias)25552555- smmu->ias = smmu->oas;25442544+ smmu->ias = max(smmu->ias, smmu->oas);2556254525572546 dev_info(smmu->dev, "ias %lu-bit, oas %lu-bit (features 0x%08x)\n",25582547 smmu->ias, smmu->oas, smmu->features);
+9-4
drivers/iommu/intel-iommu.c
···21152115 return -ENOMEM;21162116 /* It is large page*/21172117 if (largepage_lvl > 1) {21182118+ unsigned long nr_superpages, end_pfn;21192119+21182120 pteval |= DMA_PTE_LARGE_PAGE;21192121 lvl_pages = lvl_to_nr_pages(largepage_lvl);21222122+21232123+ nr_superpages = sg_res / lvl_pages;21242124+ end_pfn = iov_pfn + nr_superpages * lvl_pages - 1;21252125+21202126 /*21212127 * Ensure that old small page tables are21222122- * removed to make room for superpage,21232123- * if they exist.21282128+ * removed to make room for superpage(s).21242129 */21252125- dma_pte_free_pagetable(domain, iov_pfn,21262126- iov_pfn + lvl_pages - 1);21302130+ dma_pte_free_pagetable(domain, iov_pfn, end_pfn);21272131 } else {21282132 pteval &= ~(uint64_t)DMA_PTE_LARGE_PAGE;21292133 }···2305230123062302 if (ret) {23072303 spin_unlock_irqrestore(&device_domain_lock, flags);23042304+ free_devinfo_mem(info);23082305 return NULL;23092306 }23102307
+13-11
drivers/iommu/io-pgtable-arm.c
···202202203203static bool selftest_running = false;204204205205-static dma_addr_t __arm_lpae_dma_addr(struct device *dev, void *pages)205205+static dma_addr_t __arm_lpae_dma_addr(void *pages)206206{207207- return phys_to_dma(dev, virt_to_phys(pages));207207+ return (dma_addr_t)virt_to_phys(pages);208208}209209210210static void *__arm_lpae_alloc_pages(size_t size, gfp_t gfp,···223223 goto out_free;224224 /*225225 * We depend on the IOMMU being able to work with any physical226226- * address directly, so if the DMA layer suggests it can't by227227- * giving us back some translation, that bodes very badly...226226+ * address directly, so if the DMA layer suggests otherwise by227227+ * translating or truncating them, that bodes very badly...228228 */229229- if (dma != __arm_lpae_dma_addr(dev, pages))229229+ if (dma != virt_to_phys(pages))230230 goto out_unmap;231231 }232232···243243static void __arm_lpae_free_pages(void *pages, size_t size,244244 struct io_pgtable_cfg *cfg)245245{246246- struct device *dev = cfg->iommu_dev;247247-248246 if (!selftest_running)249249- dma_unmap_single(dev, __arm_lpae_dma_addr(dev, pages),247247+ dma_unmap_single(cfg->iommu_dev, __arm_lpae_dma_addr(pages),250248 size, DMA_TO_DEVICE);251249 free_pages_exact(pages, size);252250}···252254static void __arm_lpae_set_pte(arm_lpae_iopte *ptep, arm_lpae_iopte pte,253255 struct io_pgtable_cfg *cfg)254256{255255- struct device *dev = cfg->iommu_dev;256256-257257 *ptep = pte;258258259259 if (!selftest_running)260260- dma_sync_single_for_device(dev, __arm_lpae_dma_addr(dev, ptep),260260+ dma_sync_single_for_device(cfg->iommu_dev,261261+ __arm_lpae_dma_addr(ptep),261262 sizeof(pte), DMA_TO_DEVICE);262263}263264···625628626629 if (cfg->oas > ARM_LPAE_MAX_ADDR_BITS)627630 return NULL;631631+632632+ if (!selftest_running && cfg->iommu_dev->dma_pfn_offset) {633633+ dev_err(cfg->iommu_dev, "Cannot accommodate DMA offset for IOMMU page tables\n");634634+ return NULL;635635+ }628636629637 data = kmalloc(sizeof(*data), GFP_KERNEL);630638 if (!data)
···4747# Used by LED subsystem flash drivers4848config V4L2_FLASH_LED_CLASS4949 tristate "V4L2 flash API for LED flash class devices"5050- depends on VIDEO_V4L2_SUBDEV_API5050+ depends on VIDEO_V4L2 && VIDEO_V4L2_SUBDEV_API5151 depends on LEDS_CLASS_FLASH5252 ---help---5353 Say Y here to enable V4L2 flash API support for LED flash
+9-3
drivers/memory/Kconfig
···5858 memory drives like NOR, NAND, OneNAND, SRAM.59596060config OMAP_GPMC_DEBUG6161- bool6161+ bool "Enable GPMC debug output and skip reset of GPMC during init"6262 depends on OMAP_GPMC6363 help6464 Enables verbose debugging mostly to decode the bootloader provided6565- timings. Enable this during development to configure devices6666- connected to the GPMC bus.6565+ timings. To preserve the bootloader provided timings, the reset6666+ of GPMC is skipped during init. Enable this during development to6767+ configure devices connected to the GPMC bus.6868+6969+ NOTE: In addition to matching the register setup with the bootloader7070+ you also need to match the GPMC FCLK frequency used by the7171+ bootloader or else the GPMC timings won't be identical with the7272+ bootloader timings.67736874config MVEBU_DEVBUS6975 bool "Marvell EBU Device Bus Controller"
+1-1
drivers/memory/omap-gpmc.c
···696696 int div;697697 u32 l;698698699699- gpmc_cs_show_timings(cs, "before gpmc_cs_set_timings");700699 div = gpmc_calc_divider(t->sync_clk);701700 if (div < 0)702701 return div;···19871988 if (ret < 0)19881989 goto err;1989199019911991+ gpmc_cs_show_timings(cs, "before gpmc_cs_program_settings");19901992 ret = gpmc_cs_program_settings(cs, &gpmc_s);19911993 if (ret < 0)19921994 goto err;
···120120 __func__, ctx->pe);121121 cxl_context_detach(ctx);122122123123- mutex_lock(&ctx->mapping_lock);124124- ctx->mapping = NULL;125125- mutex_unlock(&ctx->mapping_lock);123123+124124+ /*125125+ * Delete the context's mapping pointer, unless it's created by the126126+ * kernel API, in which case leave it so it can be freed by reclaim_ctx()127127+ */128128+ if (!ctx->kernelapi) {129129+ mutex_lock(&ctx->mapping_lock);130130+ ctx->mapping = NULL;131131+ mutex_unlock(&ctx->mapping_lock);132132+ }126133127134 put_device(&ctx->afu->dev);128135
···10351035 return 0;10361036}1037103710381038+/*10391039+ * Workaround a PCIe Host Bridge defect on some cards, that can cause10401040+ * malformed Transaction Layer Packet (TLP) errors to be erroneously10411041+ * reported. Mask this error in the Uncorrectable Error Mask Register.10421042+ *10431043+ * The upper nibble of the PSL revision is used to distinguish between10441044+ * different cards. The affected ones have it set to 0.10451045+ */10461046+static void cxl_fixup_malformed_tlp(struct cxl *adapter, struct pci_dev *dev)10471047+{10481048+ int aer;10491049+ u32 data;10501050+10511051+ if (adapter->psl_rev & 0xf000)10521052+ return;10531053+ if (!(aer = pci_find_ext_capability(dev, PCI_EXT_CAP_ID_ERR)))10541054+ return;10551055+ pci_read_config_dword(dev, aer + PCI_ERR_UNCOR_MASK, &data);10561056+ if (data & PCI_ERR_UNC_MALF_TLP)10571057+ if (data & PCI_ERR_UNC_INTN)10581058+ return;10591059+ data |= PCI_ERR_UNC_MALF_TLP;10601060+ data |= PCI_ERR_UNC_INTN;10611061+ pci_write_config_dword(dev, aer + PCI_ERR_UNCOR_MASK, data);10621062+}10631063+10381064static int cxl_vsec_looks_ok(struct cxl *adapter, struct pci_dev *dev)10391065{10401066 if (adapter->vsec_status & CXL_STATUS_SECOND_PORT)···1159113311601134 if ((rc = cxl_vsec_looks_ok(adapter, dev)))11611135 return rc;11361136+11371137+ cxl_fixup_malformed_tlp(adapter, dev);1162113811631139 if ((rc = setup_cxl_bars(dev)))11641140 return rc;
···19241924static int mmc_reset(struct mmc_host *host)19251925{19261926 struct mmc_card *card = host->card;19271927- u32 status;1928192719291928 if (!(host->caps & MMC_CAP_HW_RESET) || !host->ops->hw_reset)19301929 return -EOPNOTSUPP;···19351936 mmc_set_clock(host, host->f_init);1936193719371938 host->ops->hw_reset(host);19381938-19391939- /* If the reset has happened, then a status command will fail */19401940- if (!mmc_send_status(card, &status)) {19411941- mmc_host_clk_release(host);19421942- return -ENOSYS;19431943- }1944193919451940 /* Set initial state and call mmc_set_ios */19461941 mmc_set_initial_state(host);
···33513351 udp_rss_requested = 0;33523352 else33533353 return -EINVAL;33543354+33553355+ if (CHIP_IS_E1x(bp) && udp_rss_requested) {33563356+ DP(BNX2X_MSG_ETHTOOL,33573357+ "57710, 57711 boards don't support RSS according to UDP 4-tuple\n");33583358+ return -EINVAL;33593359+ }33603360+33543361 if ((info->flow_type == UDP_V4_FLOW) &&33553362 (bp->rss_conf_obj.udp_rss_v4 != udp_rss_requested)) {33563363 bp->rss_conf_obj.udp_rss_v4 = udp_rss_requested;
+23-9
drivers/net/ethernet/broadcom/genet/bcmgenet.c
···16831683 bcmgenet_intrl2_1_writel(priv, 0, INTRL2_CPU_MASK_CLEAR);16841684}1685168516861686+static void bcmgenet_link_intr_enable(struct bcmgenet_priv *priv)16871687+{16881688+ u32 int0_enable = 0;16891689+16901690+ /* Monitor cable plug/unplugged event for internal PHY, external PHY16911691+ * and MoCA PHY16921692+ */16931693+ if (priv->internal_phy) {16941694+ int0_enable |= UMAC_IRQ_LINK_EVENT;16951695+ } else if (priv->ext_phy) {16961696+ int0_enable |= UMAC_IRQ_LINK_EVENT;16971697+ } else if (priv->phy_interface == PHY_INTERFACE_MODE_MOCA) {16981698+ if (priv->hw_params->flags & GENET_HAS_MOCA_LINK_DET)16991699+ int0_enable |= UMAC_IRQ_LINK_EVENT;17001700+ }17011701+ bcmgenet_intrl2_0_writel(priv, int0_enable, INTRL2_CPU_MASK_CLEAR);17021702+}17031703+16861704static int init_umac(struct bcmgenet_priv *priv)16871705{16881706 struct device *kdev = &priv->pdev->dev;···17411723 /* Enable Tx default queue 16 interrupts */17421724 int0_enable |= UMAC_IRQ_TXDMA_DONE;1743172517441744- /* Monitor cable plug/unplugged event for internal PHY */17451745- if (priv->internal_phy) {17461746- int0_enable |= UMAC_IRQ_LINK_EVENT;17471747- } else if (priv->ext_phy) {17481748- int0_enable |= UMAC_IRQ_LINK_EVENT;17491749- } else if (priv->phy_interface == PHY_INTERFACE_MODE_MOCA) {17501750- if (priv->hw_params->flags & GENET_HAS_MOCA_LINK_DET)17511751- int0_enable |= UMAC_IRQ_LINK_EVENT;17521752-17261726+ /* Configure backpressure vectors for MoCA */17271727+ if (priv->phy_interface == PHY_INTERFACE_MODE_MOCA) {17531728 reg = bcmgenet_bp_mc_get(priv);17541729 reg |= BIT(priv->hw_params->bp_in_en_shift);17551730···26552644 umac_enable_set(priv, CMD_TX_EN | CMD_RX_EN, true);2656264526572646 netif_tx_start_all_queues(dev);26472647+26482648+ /* Monitor link interrupts now */26492649+ bcmgenet_link_intr_enable(priv);2658265026592651 phy_start(priv->phydev);26602652}
+1
drivers/net/ethernet/emulex/benet/be.h
···592592 int be_get_temp_freq;593593 struct be_hwmon hwmon_info;594594 u8 pf_number;595595+ u8 pci_func_num;595596 struct rss_info rss_info;596597 /* Filters for packets that need to be sent to BMC */597598 u32 bmc_filt_mask;
+24-7
drivers/net/ethernet/emulex/benet/be_cmds.c
···851851 return status;852852853853 dest_wrb = be_cmd_copy(adapter, wrb);854854- if (!dest_wrb)855855- return -EBUSY;854854+ if (!dest_wrb) {855855+ status = -EBUSY;856856+ goto unlock;857857+ }856858857859 if (use_mcc(adapter))858860 status = be_mcc_notify_wait(adapter);···864862 if (!status)865863 memcpy(wrb, dest_wrb, sizeof(*wrb));866864865865+unlock:867866 be_cmd_unlock(adapter);868867 return status;869868}···19871984 be_if_cap_flags(adapter));19881985 }19891986 flags &= be_if_cap_flags(adapter);19871987+ if (!flags)19881988+ return -ENOTSUPP;1990198919911990 return __be_cmd_rx_filter(adapter, flags, value);19921991}···28922887 if (!status) {28932888 attribs = attribs_cmd.va + sizeof(struct be_cmd_resp_hdr);28942889 adapter->hba_port_num = attribs->hba_attribs.phy_port;28902890+ adapter->pci_func_num = attribs->pci_func_num;28952891 serial_num = attribs->hba_attribs.controller_serial_number;28962892 for (i = 0; i < CNTL_SERIAL_NUM_WORDS; i++)28972893 adapter->serial_num[i] = le32_to_cpu(serial_num[i]) &···37153709 status = -EINVAL;37163710 goto err;37173711 }37183718-37193712 adapter->pf_number = desc->pf_num;37203713 be_copy_nic_desc(res, desc);37213714 }···37263721 return status;37273722}3728372337293729-/* Will use MBOX only if MCCQ has not been created */37243724+/* Will use MBOX only if MCCQ has not been created37253725+ * non-zero domain => a PF is querying this on behalf of a VF37263726+ * zero domain => a PF or a VF is querying this for itself37273727+ */37303728int be_cmd_get_profile_config(struct be_adapter *adapter,37313729 struct be_resources *res, u8 query, u8 domain)37323730{···37563748 OPCODE_COMMON_GET_PROFILE_CONFIG,37573749 cmd.size, &wrb, &cmd);3758375037593759- req->hdr.domain = domain;37603751 if (!lancer_chip(adapter))37613752 req->hdr.version = 1;37623753 req->type = ACTIVE_PROFILE_TYPE;37543754+ /* When a function is querying profile information relating to37553755+ * itself hdr.pf_number must be set to it's pci_func_num + 137563756+ */37573757+ req->hdr.domain = domain;37583758+ if (domain == 0)37593759+ req->hdr.pf_num = adapter->pci_func_num + 1;3763376037643761 /* When QUERY_MODIFIABLE_FIELDS_TYPE bit is set, cmd returns the37653762 * descriptors with all bits set to "1" for the fields which can be···39343921 vf_if_cap_flags &= ~(BE_IF_FLAGS_RSS |39353922 BE_IF_FLAGS_DEFQ_RSS);39363923 }39373937-39383938- nic_vft->cap_flags = cpu_to_le32(vf_if_cap_flags);39393924 } else {39403925 num_vf_qs = 1;39413926 }3942392739283928+ if (res_mod.vf_if_cap_flags & BE_IF_FLAGS_VLAN_PROMISCUOUS) {39293929+ nic_vft->flags |= BIT(IF_CAPS_FLAGS_VALID_SHIFT);39303930+ vf_if_cap_flags &= ~BE_IF_FLAGS_VLAN_PROMISCUOUS;39313931+ }39323932+39333933+ nic_vft->cap_flags = cpu_to_le32(vf_if_cap_flags);39433934 nic_vft->rq_count = cpu_to_le16(num_vf_qs);39443935 nic_vft->txq_count = cpu_to_le16(num_vf_qs);39453936 nic_vft->rssq_count = cpu_to_le16(num_vf_qs);
···11231123 struct sk_buff *skb,11241124 struct be_wrb_params *wrb_params)11251125{11261126- /* Lancer, SH-R ASICs have a bug wherein Packets that are 32 bytes or11271127- * less may cause a transmit stall on that port. So the work-around is11281128- * to pad short packets (<= 32 bytes) to a 36-byte length.11261126+ /* Lancer, SH and BE3 in SRIOV mode have a bug wherein11271127+ * packets that are 32b or less may cause a transmit stall11281128+ * on that port. The workaround is to pad such packets11291129+ * (len <= 32 bytes) to a minimum length of 36b.11291130 */11301130- if (unlikely(!BEx_chip(adapter) && skb->len <= 32)) {11311131+ if (skb->len <= 32) {11311132 if (skb_put_padto(skb, 36))11321133 return NULL;11331134 }···42064205 int status, level;42074206 u16 profile_id;4208420742094209- status = be_cmd_get_cntl_attributes(adapter);42104210- if (status)42114211- return status;42124212-42134208 status = be_cmd_query_fw_cfg(adapter);42144209 if (status)42154210 return status;···4403440644044407 if (!lancer_chip(adapter))44054408 be_cmd_req_native_mode(adapter);44094409+44104410+ /* Need to invoke this cmd first to get the PCI Function Number */44114411+ status = be_cmd_get_cntl_attributes(adapter);44124412+ if (status)44134413+ return status;4406441444074415 if (!BE2_chip(adapter) && be_physfn(adapter))44084416 be_alloc_sriov_res(adapter);···50014999 return false;50025000 }5003500150045004- return (fhdr->asic_type_rev >= adapter->asic_rev);50025002+ /* In BE3 FW images the "asic_type_rev" field doesn't track the50035003+ * asic_rev of the chips it is compatible with.50045004+ * When asic_type_rev is 0 the image is compatible only with50055005+ * pre-BE3-R chips (asic_rev < 0x10)50065006+ */50075007+ if (BEx_chip(adapter) && fhdr->asic_type_rev == 0)50085008+ return adapter->asic_rev < 0x10;50095009+ else50105010+ return (fhdr->asic_type_rev >= adapter->asic_rev);50055011}5006501250075013static int be_fw_download(struct be_adapter *adapter, const struct firmware* fw)
+28-6
drivers/net/ethernet/freescale/fsl_pq_mdio.c
···198198199199#if defined(CONFIG_GIANFAR) || defined(CONFIG_GIANFAR_MODULE)200200/*201201+ * Return the TBIPA address, starting from the address202202+ * of the mapped GFAR MDIO registers (struct gfar)201203 * This is mildly evil, but so is our hardware for doing this.202204 * Also, we have to cast back to struct gfar because of203205 * definition weirdness done in gianfar.h.204206 */205205-static uint32_t __iomem *get_gfar_tbipa(void __iomem *p)207207+static uint32_t __iomem *get_gfar_tbipa_from_mdio(void __iomem *p)206208{207209 struct gfar __iomem *enet_regs = p;208210209211 return &enet_regs->tbipa;212212+}213213+214214+/*215215+ * Return the TBIPA address, starting from the address216216+ * of the mapped GFAR MII registers (gfar_mii_regs[] within struct gfar)217217+ */218218+static uint32_t __iomem *get_gfar_tbipa_from_mii(void __iomem *p)219219+{220220+ return get_gfar_tbipa_from_mdio(container_of(p, struct gfar, gfar_mii_regs));210221}211222212223/*···231220232221#if defined(CONFIG_UCC_GETH) || defined(CONFIG_UCC_GETH_MODULE)233222/*234234- * Return the TBIPAR address for a QE MDIO node223223+ * Return the TBIPAR address for a QE MDIO node, starting from the address224224+ * of the mapped MII registers (struct fsl_pq_mii)235225 */236226static uint32_t __iomem *get_ucc_tbipa(void __iomem *p)237227{238238- struct fsl_pq_mdio __iomem *mdio = p;228228+ struct fsl_pq_mdio __iomem *mdio = container_of(p, struct fsl_pq_mdio, mii);239229240230 return &mdio->utbipar;241231}···312300 .compatible = "fsl,gianfar-tbi",313301 .data = &(struct fsl_pq_mdio_data) {314302 .mii_offset = 0,315315- .get_tbipa = get_gfar_tbipa,303303+ .get_tbipa = get_gfar_tbipa_from_mii,316304 },317305 },318306 {319307 .compatible = "fsl,gianfar-mdio",320308 .data = &(struct fsl_pq_mdio_data) {321309 .mii_offset = 0,322322- .get_tbipa = get_gfar_tbipa,310310+ .get_tbipa = get_gfar_tbipa_from_mii,323311 },324312 },325313 {···327315 .compatible = "gianfar",328316 .data = &(struct fsl_pq_mdio_data) {329317 .mii_offset = offsetof(struct fsl_pq_mdio, mii),330330- .get_tbipa = get_gfar_tbipa,318318+ .get_tbipa = get_gfar_tbipa_from_mdio,331319 },332320 },333321 {···456444 }457445458446 tbipa = data->get_tbipa(priv->map);447447+448448+ /*449449+ * Add consistency check to make sure TBI is contained450450+ * within the mapped range (not because we would get a451451+ * segfault, rather to catch bugs in computing TBI452452+ * address). Print error message but continue anyway.453453+ */454454+ if ((void *)tbipa > priv->map + resource_size(&res) - 4)455455+ dev_err(&pdev->dev, "invalid register map (should be at least 0x%04x to contain TBI address)\n",456456+ ((void *)tbipa - priv->map) + 4);459457460458 iowrite32be(be32_to_cpup(prop), tbipa);461459 }
···13641364 * and performing a NOP command13651365 */13661366 for(i = 0; !err && (i < dev->caps.num_comp_vectors); ++i) {13671367+ /* Make sure request_irq was called */13681368+ if (!priv->eq_table.eq[i].have_irq)13691369+ continue;13701370+13671371 /* Temporary use polling for command completions */13681372 mlx4_cmd_use_polling(dev);13691373
+2-8
drivers/net/ethernet/mellanox/mlx4/main.c
···2669266926702670 if (msi_x) {26712671 int nreq = dev->caps.num_ports * num_online_cpus() + 1;26722672- bool shared_ports = false;2673267226742673 nreq = min_t(int, dev->caps.num_eqs - dev->caps.reserved_eqs,26752674 nreq);26762676- if (nreq > MAX_MSIX) {26752675+ if (nreq > MAX_MSIX)26772676 nreq = MAX_MSIX;26782678- shared_ports = true;26792679- }2680267726812678 entries = kcalloc(nreq, sizeof *entries, GFP_KERNEL);26822679 if (!entries)···26962699 bitmap_zero(priv->eq_table.eq[MLX4_EQ_ASYNC].actv_ports.ports,26972700 dev->caps.num_ports);2698270126992699- if (MLX4_IS_LEGACY_EQ_MODE(dev->caps))27002700- shared_ports = true;27012701-27022702 for (i = 0; i < dev->caps.num_comp_vectors + 1; i++) {27032703 if (i == MLX4_EQ_ASYNC)27042704 continue;···27032709 priv->eq_table.eq[i].irq =27042710 entries[i + 1 - !!(i > MLX4_EQ_ASYNC)].vector;2705271127062706- if (shared_ports) {27122712+ if (MLX4_IS_LEGACY_EQ_MODE(dev->caps)) {27072713 bitmap_fill(priv->eq_table.eq[i].actv_ports.ports,27082714 dev->caps.num_ports);27092715 /* We don't set affinity hint when there
···168168 busses. It is required by the Octeon and ThunderX ethernet device169169 drivers.170170171171- If in doubt, say Y.172172-173171config MDIO_SUN4I174172 tristate "Allwinner sun4i MDIO interface support"175173 depends on ARCH_SUNXI
···703703 * abort after reading the nvm in case RF Kill is on, we will complete704704 * the init seq later when RF kill will switch to off705705 */706706- if (iwl_mvm_is_radio_killed(mvm)) {706706+ if (iwl_mvm_is_radio_hw_killed(mvm)) {707707 IWL_DEBUG_RF_KILL(mvm,708708 "jump over all phy activities due to RF kill\n");709709 iwl_remove_notification(&mvm->notif_wait, &calib_wait);···736736 ret = iwl_wait_notification(&mvm->notif_wait, &calib_wait,737737 MVM_UCODE_CALIB_TIMEOUT);738738739739- if (ret && iwl_mvm_is_radio_killed(mvm)) {739739+ if (ret && iwl_mvm_is_radio_hw_killed(mvm)) {740740 IWL_DEBUG_RF_KILL(mvm, "RFKILL while calibrating.\n");741741 ret = 1;742742 }
···860860 test_bit(IWL_MVM_STATUS_HW_CTKILL, &mvm->status);861861}862862863863+static inline bool iwl_mvm_is_radio_hw_killed(struct iwl_mvm *mvm)864864+{865865+ return test_bit(IWL_MVM_STATUS_HW_RFKILL, &mvm->status);866866+}867867+863868/* Must be called with rcu_read_lock() held and it can only be864869 * released when mvmsta is not needed anymore.865870 */
···96969797 rtl8821ae_bt_reg_init(hw);9898 rtlpci->msi_support = rtlpriv->cfg->mod_params->msi_support;9999+ rtlpci->int_clear = rtlpriv->cfg->mod_params->int_clear;99100 rtlpriv->btcoexist.btc_ops = rtl_btc_get_ops_pointer();100101101102 rtlpriv->dm.dm_initialgain_enable = 1;···168167 rtlpriv->psc.swctrl_lps = rtlpriv->cfg->mod_params->swctrl_lps;169168 rtlpriv->psc.fwctrl_lps = rtlpriv->cfg->mod_params->fwctrl_lps;170169 rtlpci->msi_support = rtlpriv->cfg->mod_params->msi_support;170170+ rtlpci->msi_support = rtlpriv->cfg->mod_params->int_clear;171171 if (rtlpriv->cfg->mod_params->disable_watchdog)172172 pr_info("watchdog disabled\n");173173 rtlpriv->psc.reg_fwctrl_lps = 3;···310308 .swctrl_lps = false,311309 .fwctrl_lps = true,312310 .msi_support = true,311311+ .int_clear = true,313312 .debug = DBG_EMERG,314313 .disable_watchdog = 0,315314};···440437module_param_named(msi, rtl8821ae_mod_params.msi_support, bool, 0444);441438module_param_named(disable_watchdog, rtl8821ae_mod_params.disable_watchdog,442439 bool, 0444);440440+module_param_named(int_clear, rtl8821ae_mod_params.int_clear, bool, 0444);443441MODULE_PARM_DESC(swenc, "Set to 1 for software crypto (default 0)\n");444442MODULE_PARM_DESC(ips, "Set to 0 to not use link power save (default 1)\n");445443MODULE_PARM_DESC(swlps, "Set to 1 to use SW control power save (default 0)\n");···448444MODULE_PARM_DESC(msi, "Set to 1 to use MSI interrupts mode (default 1)\n");449445MODULE_PARM_DESC(debug, "Set debug level (0-5) (default 0)");450446MODULE_PARM_DESC(disable_watchdog, "Set to 1 to disable the watchdog (default 0)\n");447447+MODULE_PARM_DESC(int_clear, "Set to 1 to disable interrupt clear before set (default 0)\n");451448452449static SIMPLE_DEV_PM_OPS(rtlwifi_pm_ops, rtl_pci_suspend, rtl_pci_resume);453450
···788788 /* Use the number of queues requested by the frontend */789789 be->vif->queues = vzalloc(requested_num_queues *790790 sizeof(struct xenvif_queue));791791+ if (!be->vif->queues) {792792+ xenbus_dev_fatal(dev, -ENOMEM,793793+ "allocating queues");794794+ return;795795+ }796796+791797 be->vif->num_queues = requested_num_queues;792798 be->vif->stalled_queues = requested_num_queues;793799
+4
drivers/pci/msi.c
···12431243 BUG_ON(!chip);12441244 if (!chip->irq_write_msi_msg)12451245 chip->irq_write_msi_msg = pci_msi_domain_write_msg;12461246+ if (!chip->irq_mask)12471247+ chip->irq_mask = pci_msi_mask_irq;12481248+ if (!chip->irq_unmask)12491249+ chip->irq_unmask = pci_msi_unmask_irq;12461250}1247125112481252/**
+8-2
drivers/perf/arm_pmu.c
···823823 }824824825825 /* Now look up the logical CPU number */826826- for_each_possible_cpu(cpu)827827- if (dn == of_cpu_device_node_get(cpu))826826+ for_each_possible_cpu(cpu) {827827+ struct device_node *cpu_dn;828828+829829+ cpu_dn = of_cpu_device_node_get(cpu);830830+ of_node_put(cpu_dn);831831+832832+ if (dn == cpu_dn)828833 break;834834+ }829835830836 if (cpu >= nr_cpu_ids) {831837 pr_warn("Failed to find logical CPU for %s\n",
···116116 if (ret)117117 goto error_ret;118118119119- for (i = 0; i < num_read; i++)119119+ for (i = 0; i < num_read / sizeof(u16); i++)120120 *(((u16 *)rx) + i) = be16_to_cpup((__be16 *)rx + i);121121122122 if (copy_to_user(buf, rx, num_read))
+5-4
drivers/staging/iio/adc/mxs-lradc.c
···930930 case IIO_CHAN_INFO_OFFSET:931931 if (chan->type == IIO_TEMP) {932932 /* The calculated value from the ADC is in Kelvin, we933933- * want Celsius for hwmon so the offset is934934- * -272.15 * scale933933+ * want Celsius for hwmon so the offset is -273.15934934+ * The offset is applied before scaling so it is935935+ * actually -213.15 * 4 / 1.012 = -1079.644268935936 */936936- *val = -1075;937937- *val2 = 691699;937937+ *val = -1079;938938+ *val2 = 644268;938939939940 return IIO_VAL_INT_PLUS_MICRO;940941 }
+1-1
drivers/staging/lustre/lustre/llite/dir.c
···224224225225 prefetchw(&page->flags);226226 ret = add_to_page_cache_lru(page, inode->i_mapping, offset,227227- GFP_KERNEL);227227+ GFP_NOFS);228228 if (ret == 0) {229229 unlock_page(page);230230 } else {
+1-1
drivers/thermal/samsung/exynos_tmu.c
···932932933933 if (data->soc == SOC_ARCH_EXYNOS5260)934934 emul_con = EXYNOS5260_EMUL_CON;935935- if (data->soc == SOC_ARCH_EXYNOS5433)935935+ else if (data->soc == SOC_ARCH_EXYNOS5433)936936 emul_con = EXYNOS5433_TMU_EMUL_CON;937937 else if (data->soc == SOC_ARCH_EXYNOS7)938938 emul_con = EXYNOS7_TMU_REG_EMUL_CON;
···21912191 }21922192 /* Fast path - was this the last TRB in the TD for this URB? */21932193 } else if (event_trb == td->last_trb) {21942194+ if (td->urb_length_set && trb_comp_code == COMP_SHORT_TX)21952195+ return finish_td(xhci, td, event_trb, event, ep,21962196+ status, false);21972197+21942198 if (EVENT_TRB_LEN(le32_to_cpu(event->transfer_len)) != 0) {21952199 td->urb->actual_length =21962200 td->urb->transfer_buffer_length -···22462242 td->urb->actual_length +=22472243 TRB_LEN(le32_to_cpu(cur_trb->generic.field[2])) -22482244 EVENT_TRB_LEN(le32_to_cpu(event->transfer_len));22452245+22462246+ if (trb_comp_code == COMP_SHORT_TX) {22472247+ xhci_dbg(xhci, "mid bulk/intr SP, wait for last TRB event\n");22482248+ td->urb_length_set = true;22492249+ return 0;22502250+ }22492251 }2250225222512253 return finish_td(xhci, td, event_trb, event, ep, status, false);···22842274 u32 trb_comp_code;22852275 int ret = 0;22862276 int td_num = 0;22772277+ bool handling_skipped_tds = false;2287227822882279 slot_id = TRB_TO_SLOT_ID(le32_to_cpu(event->flags));22892280 xdev = xhci->devs[slot_id];···24202409 */24212410 ep->skip = true;24222411 xhci_dbg(xhci, "Miss service interval error, set skip flag\n");24122412+ goto cleanup;24132413+ case COMP_PING_ERR:24142414+ ep->skip = true;24152415+ xhci_dbg(xhci, "No Ping response error, Skip one Isoc TD\n");24232416 goto cleanup;24242417 default:24252418 if (xhci_is_vendor_info_code(xhci, trb_comp_code)) {···25612546 ep, &status);2562254725632548cleanup:25492549+25502550+25512551+ handling_skipped_tds = ep->skip &&25522552+ trb_comp_code != COMP_MISSED_INT &&25532553+ trb_comp_code != COMP_PING_ERR;25542554+25642555 /*25652565- * Do not update event ring dequeue pointer if ep->skip is set.25662566- * Will roll back to continue process missed tds.25562556+ * Do not update event ring dequeue pointer if we're in a loop25572557+ * processing missed tds.25672558 */25682568- if (trb_comp_code == COMP_MISSED_INT || !ep->skip) {25592559+ if (!handling_skipped_tds)25692560 inc_deq(xhci, xhci->event_ring);25702570- }2571256125722562 if (ret) {25732563 urb = td->urb;···26072587 * Process them as short transfer until reach the td pointed by26082588 * the event.26092589 */26102610- } while (ep->skip && trb_comp_code != COMP_MISSED_INT);25902590+ } while (handling_skipped_tds);2611259126122592 return 0;26132593}
···25842584 alloc_start);25852585 if (ret)25862586 goto out;25872587- } else {25872587+ } else if (offset + len > inode->i_size) {25882588 /*25892589 * If we are fallocating from the end of the file onward we25902590 * need to zero out the end of the page if i_size lands in the
···376376#define BTRFS_BALANCE_ARGS_VRANGE (1ULL << 4)377377#define BTRFS_BALANCE_ARGS_LIMIT (1ULL << 5)378378379379+#define BTRFS_BALANCE_ARGS_MASK \380380+ (BTRFS_BALANCE_ARGS_PROFILES | \381381+ BTRFS_BALANCE_ARGS_USAGE | \382382+ BTRFS_BALANCE_ARGS_DEVID | \383383+ BTRFS_BALANCE_ARGS_DRANGE | \384384+ BTRFS_BALANCE_ARGS_VRANGE | \385385+ BTRFS_BALANCE_ARGS_LIMIT)386386+379387/*380388 * Profile changing flags. When SOFT is set we won't relocate chunk if381389 * it already has the target profile (even though it may be
+3-3
fs/cifs/file.c
···33803380 struct page *page, *tpage;33813381 unsigned int expected_index;33823382 int rc;33833383+ gfp_t gfp = GFP_KERNEL & mapping_gfp_mask(mapping);3383338433843385 INIT_LIST_HEAD(tmplist);33853386···33933392 */33943393 __set_page_locked(page);33953394 rc = add_to_page_cache_locked(page, mapping,33963396- page->index, GFP_KERNEL);33953395+ page->index, gfp);3397339633983397 /* give up if we can't stick it in the cache */33993398 if (rc) {···34193418 break;3420341934213420 __set_page_locked(page);34223422- if (add_to_page_cache_locked(page, mapping, page->index,34233423- GFP_KERNEL)) {34213421+ if (add_to_page_cache_locked(page, mapping, page->index, gfp)) {34243422 __clear_page_locked(page);34253423 break;34263424 }
+29-41
fs/dax.c
···285285static int dax_insert_mapping(struct inode *inode, struct buffer_head *bh,286286 struct vm_area_struct *vma, struct vm_fault *vmf)287287{288288+ struct address_space *mapping = inode->i_mapping;288289 sector_t sector = bh->b_blocknr << (inode->i_blkbits - 9);289290 unsigned long vaddr = (unsigned long)vmf->virtual_address;290291 void __pmem *addr;291292 unsigned long pfn;292293 pgoff_t size;293294 int error;295295+296296+ i_mmap_lock_read(mapping);294297295298 /*296299 * Check truncate didn't happen while we were allocating a block.···324321 error = vm_insert_mixed(vma, vaddr, pfn);325322326323 out:324324+ i_mmap_unlock_read(mapping);325325+327326 return error;328327}329328···387382 * from a read fault and we've raced with a truncate388383 */389384 error = -EIO;390390- goto unlock;385385+ goto unlock_page;391386 }392392- } else {393393- i_mmap_lock_write(mapping);394387 }395388396389 error = get_block(inode, block, &bh, 0);397390 if (!error && (bh.b_size < PAGE_SIZE))398391 error = -EIO; /* fs corruption? */399392 if (error)400400- goto unlock;393393+ goto unlock_page;401394402395 if (!buffer_mapped(&bh) && !buffer_unwritten(&bh) && !vmf->cow_page) {403396 if (vmf->flags & FAULT_FLAG_WRITE) {···406403 if (!error && (bh.b_size < PAGE_SIZE))407404 error = -EIO;408405 if (error)409409- goto unlock;406406+ goto unlock_page;410407 } else {411411- i_mmap_unlock_write(mapping);412408 return dax_load_hole(mapping, page, vmf);413409 }414410 }···419417 else420418 clear_user_highpage(new_page, vaddr);421419 if (error)422422- goto unlock;420420+ goto unlock_page;423421 vmf->page = page;424422 if (!page) {423423+ i_mmap_lock_read(mapping);425424 /* Check we didn't race with truncate */426425 size = (i_size_read(inode) + PAGE_SIZE - 1) >>427426 PAGE_SHIFT;428427 if (vmf->pgoff >= size) {428428+ i_mmap_unlock_read(mapping);429429 error = -EIO;430430- goto unlock;430430+ goto out;431431 }432432 }433433 return VM_FAULT_LOCKED;···465461 WARN_ON_ONCE(!(vmf->flags & FAULT_FLAG_WRITE));466462 }467463468468- if (!page)469469- i_mmap_unlock_write(mapping);470464 out:471465 if (error == -ENOMEM)472466 return VM_FAULT_OOM | major;···473471 return VM_FAULT_SIGBUS | major;474472 return VM_FAULT_NOPAGE | major;475473476476- unlock:474474+ unlock_page:477475 if (page) {478476 unlock_page(page);479477 page_cache_release(page);480480- } else {481481- i_mmap_unlock_write(mapping);482478 }483483-484479 goto out;485480}486481EXPORT_SYMBOL(__dax_fault);···555556 block = (sector_t)pgoff << (PAGE_SHIFT - blkbits);556557557558 bh.b_size = PMD_SIZE;558558- i_mmap_lock_write(mapping);559559 length = get_block(inode, block, &bh, write);560560 if (length)561561 return VM_FAULT_SIGBUS;562562+ i_mmap_lock_read(mapping);562563563564 /*564565 * If the filesystem isn't willing to tell us the length of a hole,···568569 if (!buffer_size_valid(&bh) || bh.b_size < PMD_SIZE)569570 goto fallback;570571571571- sector = bh.b_blocknr << (blkbits - 9);572572-573573- if (buffer_unwritten(&bh) || buffer_new(&bh)) {574574- int i;575575-576576- length = bdev_direct_access(bh.b_bdev, sector, &kaddr, &pfn,577577- bh.b_size);578578- if (length < 0) {579579- result = VM_FAULT_SIGBUS;580580- goto out;581581- }582582- if ((length < PMD_SIZE) || (pfn & PG_PMD_COLOUR))583583- goto fallback;584584-585585- for (i = 0; i < PTRS_PER_PMD; i++)586586- clear_pmem(kaddr + i * PAGE_SIZE, PAGE_SIZE);587587- wmb_pmem();588588- count_vm_event(PGMAJFAULT);589589- mem_cgroup_count_vm_event(vma->vm_mm, PGMAJFAULT);590590- result |= VM_FAULT_MAJOR;591591- }592592-593572 /*594573 * If we allocated new storage, make sure no process has any595574 * zero pages covering this hole596575 */597576 if (buffer_new(&bh)) {598598- i_mmap_unlock_write(mapping);577577+ i_mmap_unlock_read(mapping);599578 unmap_mapping_range(mapping, pgoff << PAGE_SHIFT, PMD_SIZE, 0);600600- i_mmap_lock_write(mapping);579579+ i_mmap_lock_read(mapping);601580 }602581603582 /*···612635 result = VM_FAULT_NOPAGE;613636 spin_unlock(ptl);614637 } else {638638+ sector = bh.b_blocknr << (blkbits - 9);615639 length = bdev_direct_access(bh.b_bdev, sector, &kaddr, &pfn,616640 bh.b_size);617641 if (length < 0) {···622644 if ((length < PMD_SIZE) || (pfn & PG_PMD_COLOUR))623645 goto fallback;624646647647+ if (buffer_unwritten(&bh) || buffer_new(&bh)) {648648+ int i;649649+ for (i = 0; i < PTRS_PER_PMD; i++)650650+ clear_pmem(kaddr + i * PAGE_SIZE, PAGE_SIZE);651651+ wmb_pmem();652652+ count_vm_event(PGMAJFAULT);653653+ mem_cgroup_count_vm_event(vma->vm_mm, PGMAJFAULT);654654+ result |= VM_FAULT_MAJOR;655655+ }656656+625657 result |= vmf_insert_pfn_pmd(vma, address, pmd, pfn, write);626658 }627659628660 out:661661+ i_mmap_unlock_read(mapping);662662+629663 if (buffer_unwritten(&bh))630664 complete_unwritten(&bh, !(result & VM_FAULT_ERROR));631631-632632- i_mmap_unlock_write(mapping);633665634666 return result;635667
+1-1
fs/ext4/Kconfig
···6363 If unsure, say N.64646565config EXT4_USE_FOR_EXT26666- bool "Use ext4 for ext2/ext3 file systems"6666+ bool "Use ext4 for ext2 file systems"6767 depends on EXT4_FS6868 depends on EXT2_FS=n6969 default y
+2-2
fs/ext4/readpage.c
···165165 if (pages) {166166 page = list_entry(pages->prev, struct page, lru);167167 list_del(&page->lru);168168- if (add_to_page_cache_lru(page, mapping,169169- page->index, GFP_KERNEL))168168+ if (add_to_page_cache_lru(page, mapping, page->index,169169+ GFP_KERNEL & mapping_gfp_mask(mapping)))170170 goto next_page;171171 }172172
···5656 u32 device_generation = 0;5757 int error;58585959- /*6060- * We do not attempt to support I/O smaller than the fs block size,6161- * or not aligned to it.6262- */6363- if (args->lg_minlength < block_size) {6464- dprintk("pnfsd: I/O too small\n");6565- goto out_layoutunavailable;6666- }6759 if (seg->offset & (block_size - 1)) {6860 dprintk("pnfsd: I/O misaligned\n");6961 goto out_layoutunavailable;
···116116 struct list_head work_list;117117 struct delayed_work dwork; /* work item used for writeback */118118119119+ struct list_head bdi_node; /* anchored at bdi->wb_list */120120+119121#ifdef CONFIG_CGROUP_WRITEBACK120122 struct percpu_ref refcnt; /* used only for !root wb's */121123 struct fprop_local_percpu memcg_completions;···152150 atomic_long_t tot_write_bandwidth;153151154152 struct bdi_writeback wb; /* the root writeback info for this bdi */153153+ struct list_head wb_list; /* list of all wbs */155154#ifdef CONFIG_CGROUP_WRITEBACK156155 struct radix_tree_root cgwb_tree; /* radix tree of active cgroup wbs */157156 struct rb_root cgwb_congested_tree; /* their congested states */
+5-64
include/linux/backing-dev.h
···1919#include <linux/slab.h>20202121int __must_check bdi_init(struct backing_dev_info *bdi);2222-void bdi_destroy(struct backing_dev_info *bdi);2222+void bdi_exit(struct backing_dev_info *bdi);23232424__printf(3, 4)2525int bdi_register(struct backing_dev_info *bdi, struct device *parent,2626 const char *fmt, ...);2727int bdi_register_dev(struct backing_dev_info *bdi, dev_t dev);2828+void bdi_unregister(struct backing_dev_info *bdi);2929+2830int __must_check bdi_setup_and_register(struct backing_dev_info *, char *);3131+void bdi_destroy(struct backing_dev_info *bdi);3232+2933void wb_start_writeback(struct bdi_writeback *wb, long nr_pages,3034 bool range_cyclic, enum wb_reason reason);3135void wb_start_background_writeback(struct bdi_writeback *wb);···412408 rcu_read_unlock();413409}414410415415-struct wb_iter {416416- int start_memcg_id;417417- struct radix_tree_iter tree_iter;418418- void **slot;419419-};420420-421421-static inline struct bdi_writeback *__wb_iter_next(struct wb_iter *iter,422422- struct backing_dev_info *bdi)423423-{424424- struct radix_tree_iter *titer = &iter->tree_iter;425425-426426- WARN_ON_ONCE(!rcu_read_lock_held());427427-428428- if (iter->start_memcg_id >= 0) {429429- iter->slot = radix_tree_iter_init(titer, iter->start_memcg_id);430430- iter->start_memcg_id = -1;431431- } else {432432- iter->slot = radix_tree_next_slot(iter->slot, titer, 0);433433- }434434-435435- if (!iter->slot)436436- iter->slot = radix_tree_next_chunk(&bdi->cgwb_tree, titer, 0);437437- if (iter->slot)438438- return *iter->slot;439439- return NULL;440440-}441441-442442-static inline struct bdi_writeback *__wb_iter_init(struct wb_iter *iter,443443- struct backing_dev_info *bdi,444444- int start_memcg_id)445445-{446446- iter->start_memcg_id = start_memcg_id;447447-448448- if (start_memcg_id)449449- return __wb_iter_next(iter, bdi);450450- else451451- return &bdi->wb;452452-}453453-454454-/**455455- * bdi_for_each_wb - walk all wb's of a bdi in ascending memcg ID order456456- * @wb_cur: cursor struct bdi_writeback pointer457457- * @bdi: bdi to walk wb's of458458- * @iter: pointer to struct wb_iter to be used as iteration buffer459459- * @start_memcg_id: memcg ID to start iteration from460460- *461461- * Iterate @wb_cur through the wb's (bdi_writeback's) of @bdi in ascending462462- * memcg ID order starting from @start_memcg_id. @iter is struct wb_iter463463- * to be used as temp storage during iteration. rcu_read_lock() must be464464- * held throughout iteration.465465- */466466-#define bdi_for_each_wb(wb_cur, bdi, iter, start_memcg_id) \467467- for ((wb_cur) = __wb_iter_init(iter, bdi, start_memcg_id); \468468- (wb_cur); (wb_cur) = __wb_iter_next(iter, bdi))469469-470411#else /* CONFIG_CGROUP_WRITEBACK */471412472413static inline bool inode_cgwb_enabled(struct inode *inode)···470521static inline void wb_blkcg_offline(struct blkcg *blkcg)471522{472523}473473-474474-struct wb_iter {475475- int next_id;476476-};477477-478478-#define bdi_for_each_wb(wb_cur, bdi, iter, start_blkcg_id) \479479- for ((iter)->next_id = (start_blkcg_id); \480480- ({ (wb_cur) = !(iter)->next_id++ ? &(bdi)->wb : NULL; }); )481524482525static inline int inode_congested(struct inode *inode, int cong_bits)483526{
+1-1
include/linux/cma.h
···2626extern int cma_init_reserved_mem(phys_addr_t base, phys_addr_t size,2727 unsigned int order_per_bit,2828 struct cma **res_cma);2929-extern struct page *cma_alloc(struct cma *cma, unsigned int count, unsigned int align);2929+extern struct page *cma_alloc(struct cma *cma, size_t count, unsigned int align);3030extern bool cma_release(struct cma *cma, const struct page *pages, unsigned int count);3131#endif
+13
include/linux/compiler-gcc.h
···237237#define KASAN_ABI_VERSION 3238238#endif239239240240+#if GCC_VERSION >= 40902241241+/*242242+ * Tell the compiler that address safety instrumentation (KASAN)243243+ * should not be applied to that function.244244+ * Conflicts with inlining: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67368245245+ */246246+#define __no_sanitize_address __attribute__((no_sanitize_address))247247+#endif248248+240249#endif /* gcc version >= 40000 specific checks */241250242251#if !defined(__noclone)243252#define __noclone /* not needed */253253+#endif254254+255255+#if !defined(__no_sanitize_address)256256+#define __no_sanitize_address244257#endif245258246259/*
+53-13
include/linux/compiler.h
···198198199199#include <uapi/linux/types.h>200200201201-static __always_inline void __read_once_size(const volatile void *p, void *res, int size)201201+#define __READ_ONCE_SIZE \202202+({ \203203+ switch (size) { \204204+ case 1: *(__u8 *)res = *(volatile __u8 *)p; break; \205205+ case 2: *(__u16 *)res = *(volatile __u16 *)p; break; \206206+ case 4: *(__u32 *)res = *(volatile __u32 *)p; break; \207207+ case 8: *(__u64 *)res = *(volatile __u64 *)p; break; \208208+ default: \209209+ barrier(); \210210+ __builtin_memcpy((void *)res, (const void *)p, size); \211211+ barrier(); \212212+ } \213213+})214214+215215+static __always_inline216216+void __read_once_size(const volatile void *p, void *res, int size)202217{203203- switch (size) {204204- case 1: *(__u8 *)res = *(volatile __u8 *)p; break;205205- case 2: *(__u16 *)res = *(volatile __u16 *)p; break;206206- case 4: *(__u32 *)res = *(volatile __u32 *)p; break;207207- case 8: *(__u64 *)res = *(volatile __u64 *)p; break;208208- default:209209- barrier();210210- __builtin_memcpy((void *)res, (const void *)p, size);211211- barrier();212212- }218218+ __READ_ONCE_SIZE;213219}220220+221221+#ifdef CONFIG_KASAN222222+/*223223+ * This function is not 'inline' because __no_sanitize_address confilcts224224+ * with inlining. Attempt to inline it may cause a build failure.225225+ * https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67368226226+ * '__maybe_unused' allows us to avoid defined-but-not-used warnings.227227+ */228228+static __no_sanitize_address __maybe_unused229229+void __read_once_size_nocheck(const volatile void *p, void *res, int size)230230+{231231+ __READ_ONCE_SIZE;232232+}233233+#else234234+static __always_inline235235+void __read_once_size_nocheck(const volatile void *p, void *res, int size)236236+{237237+ __READ_ONCE_SIZE;238238+}239239+#endif214240215241static __always_inline void __write_once_size(volatile void *p, void *res, int size)216242{···274248 * required ordering.275249 */276250277277-#define READ_ONCE(x) \278278- ({ union { typeof(x) __val; char __c[1]; } __u; __read_once_size(&(x), __u.__c, sizeof(x)); __u.__val; })251251+#define __READ_ONCE(x, check) \252252+({ \253253+ union { typeof(x) __val; char __c[1]; } __u; \254254+ if (check) \255255+ __read_once_size(&(x), __u.__c, sizeof(x)); \256256+ else \257257+ __read_once_size_nocheck(&(x), __u.__c, sizeof(x)); \258258+ __u.__val; \259259+})260260+#define READ_ONCE(x) __READ_ONCE(x, 1)261261+262262+/*263263+ * Use READ_ONCE_NOCHECK() instead of READ_ONCE() if you need264264+ * to hide memory access from KASAN.265265+ */266266+#define READ_ONCE_NOCHECK(x) __READ_ONCE(x, 0)279267280268#define WRITE_ONCE(x, val) \281269({ \
+2-2
include/linux/dma-contiguous.h
···111111 return ret;112112}113113114114-struct page *dma_alloc_from_contiguous(struct device *dev, int count,114114+struct page *dma_alloc_from_contiguous(struct device *dev, size_t count,115115 unsigned int order);116116bool dma_release_from_contiguous(struct device *dev, struct page *pages,117117 int count);···144144}145145146146static inline147147-struct page *dma_alloc_from_contiguous(struct device *dev, int count,147147+struct page *dma_alloc_from_contiguous(struct device *dev, size_t count,148148 unsigned int order)149149{150150 return NULL;
+5-3
include/linux/memcontrol.h
···676676677677struct list_head *mem_cgroup_cgwb_list(struct mem_cgroup *memcg);678678struct wb_domain *mem_cgroup_wb_domain(struct bdi_writeback *wb);679679-void mem_cgroup_wb_stats(struct bdi_writeback *wb, unsigned long *pavail,680680- unsigned long *pdirty, unsigned long *pwriteback);679679+void mem_cgroup_wb_stats(struct bdi_writeback *wb, unsigned long *pfilepages,680680+ unsigned long *pheadroom, unsigned long *pdirty,681681+ unsigned long *pwriteback);681682682683#else /* CONFIG_CGROUP_WRITEBACK */683684···688687}689688690689static inline void mem_cgroup_wb_stats(struct bdi_writeback *wb,691691- unsigned long *pavail,690690+ unsigned long *pfilepages,691691+ unsigned long *pheadroom,692692 unsigned long *pdirty,693693 unsigned long *pwriteback)694694{
···113113void __inet_twsk_schedule(struct inet_timewait_sock *tw, int timeo,114114 bool rearm);115115116116-static void inline inet_twsk_schedule(struct inet_timewait_sock *tw, int timeo)116116+static inline void inet_twsk_schedule(struct inet_timewait_sock *tw, int timeo)117117{118118 __inet_twsk_schedule(tw, timeo, false);119119}120120121121-static void inline inet_twsk_reschedule(struct inet_timewait_sock *tw, int timeo)121121+static inline void inet_twsk_reschedule(struct inet_timewait_sock *tw, int timeo)122122{123123 __inet_twsk_schedule(tw, timeo, true);124124}
+8
include/net/sock.h
···828828 if (sk_rcvqueues_full(sk, limit))829829 return -ENOBUFS;830830831831+ /*832832+ * If the skb was allocated from pfmemalloc reserves, only833833+ * allow SOCK_MEMALLOC sockets to use it as this socket is834834+ * helping free memory835835+ */836836+ if (skb_pfmemalloc(skb) && !sock_flag(sk, SOCK_MEMALLOC))837837+ return -ENOMEM;838838+831839 __sk_add_backlog(sk, skb);832840 sk->sk_backlog.len += skb->truesize;833841 return 0;
···119119#define WM8904_MIC_REGS 2120120#define WM8904_GPIO_REGS 4121121#define WM8904_DRC_REGS 4122122-#define WM8904_EQ_REGS 25122122+#define WM8904_EQ_REGS 24123123124124/**125125 * DRC configurations are specified with a label and a set of register
···323323 OVS_KEY_ATTR_MPLS, /* array of struct ovs_key_mpls.324324 * The implementation may restrict325325 * the accepted length of the array. */326326- OVS_KEY_ATTR_CT_STATE, /* u8 bitmask of OVS_CS_F_* */326326+ OVS_KEY_ATTR_CT_STATE, /* u32 bitmask of OVS_CS_F_* */327327 OVS_KEY_ATTR_CT_ZONE, /* u16 connection tracking zone. */328328 OVS_KEY_ATTR_CT_MARK, /* u32 connection tracking mark */329329- OVS_KEY_ATTR_CT_LABEL, /* 16-octet connection tracking label */329329+ OVS_KEY_ATTR_CT_LABELS, /* 16-octet connection tracking label */330330331331#ifdef __KERNEL__332332 OVS_KEY_ATTR_TUNNEL_INFO, /* struct ip_tunnel_info */···439439 __u8 nd_tll[ETH_ALEN];440440};441441442442-#define OVS_CT_LABEL_LEN 16443443-struct ovs_key_ct_label {444444- __u8 ct_label[OVS_CT_LABEL_LEN];442442+#define OVS_CT_LABELS_LEN 16443443+struct ovs_key_ct_labels {444444+ __u8 ct_labels[OVS_CT_LABELS_LEN];445445};446446447447/* OVS_KEY_ATTR_CT_STATE flags */···449449#define OVS_CS_F_ESTABLISHED 0x02 /* Part of an existing connection. */450450#define OVS_CS_F_RELATED 0x04 /* Related to an established451451 * connection. */452452-#define OVS_CS_F_INVALID 0x20 /* Could not track connection. */453453-#define OVS_CS_F_REPLY_DIR 0x40 /* Flow is in the reply direction. */454454-#define OVS_CS_F_TRACKED 0x80 /* Conntrack has occurred. */452452+#define OVS_CS_F_REPLY_DIR 0x08 /* Flow is in the reply direction. */453453+#define OVS_CS_F_INVALID 0x10 /* Could not track connection. */454454+#define OVS_CS_F_TRACKED 0x20 /* Conntrack has occurred. */455455456456/**457457 * enum ovs_flow_attr - attributes for %OVS_FLOW_* commands.···618618619619/**620620 * enum ovs_ct_attr - Attributes for %OVS_ACTION_ATTR_CT action.621621- * @OVS_CT_ATTR_FLAGS: u32 connection tracking flags.621621+ * @OVS_CT_ATTR_COMMIT: If present, commits the connection to the conntrack622622+ * table. This allows future packets for the same connection to be identified623623+ * as 'established' or 'related'.622624 * @OVS_CT_ATTR_ZONE: u16 connection tracking zone.623625 * @OVS_CT_ATTR_MARK: u32 value followed by u32 mask. For each bit set in the624626 * mask, the corresponding bit in the value is copied to the connection625627 * tracking mark field in the connection.626626- * @OVS_CT_ATTR_LABEL: %OVS_CT_LABEL_LEN value followed by %OVS_CT_LABEL_LEN628628+ * @OVS_CT_ATTR_LABEL: %OVS_CT_LABELS_LEN value followed by %OVS_CT_LABELS_LEN627629 * mask. For each bit set in the mask, the corresponding bit in the value is628630 * copied to the connection tracking label field in the connection.629631 * @OVS_CT_ATTR_HELPER: variable length string defining conntrack ALG.630632 */631633enum ovs_ct_attr {632634 OVS_CT_ATTR_UNSPEC,633633- OVS_CT_ATTR_FLAGS, /* u8 bitmask of OVS_CT_F_*. */635635+ OVS_CT_ATTR_COMMIT, /* No argument, commits connection. */634636 OVS_CT_ATTR_ZONE, /* u16 zone id. */635637 OVS_CT_ATTR_MARK, /* mark to associate with this connection. */636636- OVS_CT_ATTR_LABEL, /* label to associate with this connection. */638638+ OVS_CT_ATTR_LABELS, /* labels to associate with this connection. */637639 OVS_CT_ATTR_HELPER, /* netlink helper to assist detection of638640 related connections. */639641 __OVS_CT_ATTR_MAX640642};641643642644#define OVS_CT_ATTR_MAX (__OVS_CT_ATTR_MAX - 1)643643-644644-/*645645- * OVS_CT_ATTR_FLAGS flags - bitmask of %OVS_CT_F_*646646- * @OVS_CT_F_COMMIT: Commits the flow to the conntrack table. This allows647647- * future packets for the same connection to be identified as 'established'648648- * or 'related'.649649- */650650-#define OVS_CT_F_COMMIT 0x01651645652646/**653647 * enum ovs_action_attr - Action types.···699705 * data immediately followed by a mask.700706 * The data must be zero for the unmasked701707 * bits. */702702- OVS_ACTION_ATTR_CT, /* One nested OVS_CT_ATTR_* . */708708+ OVS_ACTION_ATTR_CT, /* Nested OVS_CT_ATTR_* . */703709704710 __OVS_ACTION_ATTR_MAX, /* Nothing past this will be accepted705711 * from userspace. */
···228228{229229 struct irq_chip *chip = info->chip;230230231231- BUG_ON(!chip);232232- if (!chip->irq_mask)233233- chip->irq_mask = pci_msi_mask_irq;234234- if (!chip->irq_unmask)235235- chip->irq_unmask = pci_msi_unmask_irq;231231+ BUG_ON(!chip || !chip->irq_mask || !chip->irq_unmask);236232 if (!chip->irq_set_affinity)237233 chip->irq_set_affinity = msi_domain_set_affinity;238234}
+6-2
kernel/kmod.c
···327327 call_usermodehelper_exec_sync(sub_info);328328 } else {329329 pid_t pid;330330-330330+ /*331331+ * Use CLONE_PARENT to reparent it to kthreadd; we do not332332+ * want to pollute current->children, and we need a parent333333+ * that always ignores SIGCHLD to ensure auto-reaping.334334+ */331335 pid = kernel_thread(call_usermodehelper_exec_async, sub_info,332332- SIGCHLD);336336+ CLONE_PARENT | SIGCHLD);333337 if (pid < 0) {334338 sub_info->retval = pid;335339 umh_complete(sub_info);
+8-4
kernel/sched/core.c
···23662366 trace_sched_wakeup_new(p);23672367 check_preempt_curr(rq, p, WF_FORK);23682368#ifdef CONFIG_SMP23692369- if (p->sched_class->task_woken)23692369+ if (p->sched_class->task_woken) {23702370+ /*23712371+ * Nothing relies on rq->lock after this, so its fine to23722372+ * drop it.23732373+ */23742374+ lockdep_unpin_lock(&rq->lock);23702375 p->sched_class->task_woken(rq, p);23762376+ lockdep_pin_lock(&rq->lock);23772377+ }23712378#endif23722379 task_rq_unlock(rq, p, &flags);23732380}···7244723772457238 alloc_cpumask_var(&non_isolated_cpus, GFP_KERNEL);72467239 alloc_cpumask_var(&fallback_doms, GFP_KERNEL);72477247-72487248- /* nohz_full won't take effect without isolating the cpus. */72497249- tick_nohz_full_add_cpus_to(cpu_isolated_map);7250724072517241 sched_init_numa();72527242
+13-4
kernel/sched/deadline.c
···668668 * Queueing this task back might have overloaded rq, check if we need669669 * to kick someone away.670670 */671671- if (has_pushable_dl_tasks(rq))671671+ if (has_pushable_dl_tasks(rq)) {672672+ /*673673+ * Nothing relies on rq->lock after this, so its safe to drop674674+ * rq->lock.675675+ */676676+ lockdep_unpin_lock(&rq->lock);672677 push_dl_task(rq);678678+ lockdep_pin_lock(&rq->lock);679679+ }673680#endif674681675682unlock:···10731066 int target = find_later_rq(p);1074106710751068 if (target != -1 &&10761076- dl_time_before(p->dl.deadline,10771077- cpu_rq(target)->dl.earliest_dl.curr))10691069+ (dl_time_before(p->dl.deadline,10701070+ cpu_rq(target)->dl.earliest_dl.curr) ||10711071+ (cpu_rq(target)->dl.dl_nr_running == 0)))10781072 cpu = target;10791073 }10801074 rcu_read_unlock();···1425141714261418 later_rq = cpu_rq(cpu);1427141914281428- if (!dl_time_before(task->dl.deadline,14201420+ if (later_rq->dl.dl_nr_running &&14211421+ !dl_time_before(task->dl.deadline,14291422 later_rq->dl.earliest_dl.curr)) {14301423 /*14311424 * Target rq has tasks of equal or earlier deadline,
+5-4
kernel/sched/fair.c
···23632363 */23642364 tg_weight = atomic_long_read(&tg->load_avg);23652365 tg_weight -= cfs_rq->tg_load_avg_contrib;23662366- tg_weight += cfs_rq_load_avg(cfs_rq);23662366+ tg_weight += cfs_rq->load.weight;2367236723682368 return tg_weight;23692369}···23732373 long tg_weight, load, shares;2374237423752375 tg_weight = calc_tg_weight(tg, cfs_rq);23762376- load = cfs_rq_load_avg(cfs_rq);23762376+ load = cfs_rq->load.weight;2377237723782378 shares = (tg->shares * load);23792379 if (tg_weight)···26642664/* Group cfs_rq's load_avg is used for task_h_load and update_cfs_share */26652665static inline int update_cfs_rq_load_avg(u64 now, struct cfs_rq *cfs_rq)26662666{26672667- int decayed;26682667 struct sched_avg *sa = &cfs_rq->avg;26682668+ int decayed, removed = 0;2669266926702670 if (atomic_long_read(&cfs_rq->removed_load_avg)) {26712671 long r = atomic_long_xchg(&cfs_rq->removed_load_avg, 0);26722672 sa->load_avg = max_t(long, sa->load_avg - r, 0);26732673 sa->load_sum = max_t(s64, sa->load_sum - r * LOAD_AVG_MAX, 0);26742674+ removed = 1;26742675 }2675267626762677 if (atomic_long_read(&cfs_rq->removed_util_avg)) {···26892688 cfs_rq->load_last_update_time_copy = sa->last_update_time;26902689#endif2691269026922692- return decayed;26912691+ return decayed || removed;26932692}2694269326952694/* Update task and its cfs_rq load average */
···8585 if (!object_is_on_stack(stack))8686 return;87878888+ /* Can't do this from NMI context (can cause deadlocks) */8989+ if (in_nmi())9090+ return;9191+8892 local_irq_save(flags);8993 arch_spin_lock(&max_stack_lock);9494+9595+ /*9696+ * RCU may not be watching, make it see us.9797+ * The stack trace code uses rcu_sched.9898+ */9999+ rcu_irq_enter();9010091101 /* In case another CPU set the tracer_frame on us */92102 if (unlikely(!frame_size))···179169 }180170181171 out:172172+ rcu_irq_exit();182173 arch_spin_unlock(&max_stack_lock);183174 local_irq_restore(flags);184175}
+4-4
kernel/workqueue.c
···14581458 timer_stats_timer_set_start_info(&dwork->timer);1459145914601460 dwork->wq = wq;14611461+ /* timer isn't guaranteed to run in this cpu, record earlier */14621462+ if (cpu == WORK_CPU_UNBOUND)14631463+ cpu = raw_smp_processor_id();14611464 dwork->cpu = cpu;14621465 timer->expires = jiffies + delay;1463146614641464- if (unlikely(cpu != WORK_CPU_UNBOUND))14651465- add_timer_on(timer, cpu);14661466- else14671467- add_timer(timer);14671467+ add_timer_on(timer, cpu);14681468}1469146914701470/**
···197197config FRAME_WARN198198 int "Warn for stack frames larger than (needs gcc 4.4)"199199 range 0 8192200200+ default 0 if KASAN200201 default 1024 if !64BIT201202 default 2048 if 64BIT202203 help
+1-1
lib/fault-inject.c
···4444 printk(KERN_NOTICE "FAULT_INJECTION: forcing a failure.\n"4545 "name %pd, interval %lu, probability %lu, "4646 "space %d, times %d\n", attr->dname,4747- attr->probability, attr->interval,4747+ attr->interval, attr->probability,4848 atomic_read(&attr->space),4949 atomic_read(&attr->times));5050 if (attr->verbose > 1)
···361361 * This function allocates part of contiguous memory on specific362362 * contiguous memory area.363363 */364364-struct page *cma_alloc(struct cma *cma, unsigned int count, unsigned int align)364364+struct page *cma_alloc(struct cma *cma, size_t count, unsigned int align)365365{366366 unsigned long mask, offset, pfn, start = 0;367367 unsigned long bitmap_maxno, bitmap_no, bitmap_count;···371371 if (!cma || !cma->count)372372 return NULL;373373374374- pr_debug("%s(cma %p, count %d, align %d)\n", __func__, (void *)cma,374374+ pr_debug("%s(cma %p, count %zu, align %d)\n", __func__, (void *)cma,375375 count, align);376376377377 if (!count)
+5-4
mm/filemap.c
···24882488 break;24892489 }2490249024912491+ if (fatal_signal_pending(current)) {24922492+ status = -EINTR;24932493+ break;24942494+ }24952495+24912496 status = a_ops->write_begin(file, mapping, pos, bytes, flags,24922497 &page, &fsdata);24932498 if (unlikely(status < 0))···25302525 written += copied;2531252625322527 balance_dirty_pages_ratelimited(mapping);25332533- if (fatal_signal_pending(current)) {25342534- status = -EINTR;25352535- break;25362536- }25372528 } while (iov_iter_count(i));2538252925392530 return written ? written : status;
+2-1
mm/huge_memory.c
···22062206 for (_pte = pte; _pte < pte+HPAGE_PMD_NR;22072207 _pte++, address += PAGE_SIZE) {22082208 pte_t pteval = *_pte;22092209- if (pte_none(pteval) || is_zero_pfn(pte_pfn(pteval))) {22092209+ if (pte_none(pteval) || (pte_present(pteval) &&22102210+ is_zero_pfn(pte_pfn(pteval)))) {22102211 if (!userfaultfd_armed(vma) &&22112212 ++none_or_zero <= khugepaged_max_ptes_none)22122213 continue;
+18-18
mm/memcontrol.c
···33873387 ret = page_counter_memparse(args, "-1", &threshold);33883388 if (ret)33893389 return ret;33903390+ threshold <<= PAGE_SHIFT;3390339133913392 mutex_lock(&memcg->thresholds_lock);33923393···37413740/**37423741 * mem_cgroup_wb_stats - retrieve writeback related stats from its memcg37433742 * @wb: bdi_writeback in question37443744- * @pavail: out parameter for number of available pages37433743+ * @pfilepages: out parameter for number of file pages37443744+ * @pheadroom: out parameter for number of allocatable pages according to memcg37453745 * @pdirty: out parameter for number of dirty pages37463746 * @pwriteback: out parameter for number of pages under writeback37473747 *37483748- * Determine the numbers of available, dirty, and writeback pages in @wb's37493749- * memcg. Dirty and writeback are self-explanatory. Available is a bit37503750- * more involved.37483748+ * Determine the numbers of file, headroom, dirty, and writeback pages in37493749+ * @wb's memcg. File, dirty and writeback are self-explanatory. Headroom37503750+ * is a bit more involved.37513751 *37523752- * A memcg's headroom is "min(max, high) - used". The available memory is37533753- * calculated as the lowest headroom of itself and the ancestors plus the37543754- * number of pages already being used for file pages. Note that this37553755- * doesn't consider the actual amount of available memory in the system.37563756- * The caller should further cap *@pavail accordingly.37523752+ * A memcg's headroom is "min(max, high) - used". In the hierarchy, the37533753+ * headroom is calculated as the lowest headroom of itself and the37543754+ * ancestors. Note that this doesn't consider the actual amount of37553755+ * available memory in the system. The caller should further cap37563756+ * *@pheadroom accordingly.37573757 */37583758-void mem_cgroup_wb_stats(struct bdi_writeback *wb, unsigned long *pavail,37593759- unsigned long *pdirty, unsigned long *pwriteback)37583758+void mem_cgroup_wb_stats(struct bdi_writeback *wb, unsigned long *pfilepages,37593759+ unsigned long *pheadroom, unsigned long *pdirty,37603760+ unsigned long *pwriteback)37603761{37613762 struct mem_cgroup *memcg = mem_cgroup_from_css(wb->memcg_css);37623763 struct mem_cgroup *parent;37633763- unsigned long head_room = PAGE_COUNTER_MAX;37643764- unsigned long file_pages;3765376437663765 *pdirty = mem_cgroup_read_stat(memcg, MEM_CGROUP_STAT_DIRTY);3767376637683767 /* this should eventually include NR_UNSTABLE_NFS */37693768 *pwriteback = mem_cgroup_read_stat(memcg, MEM_CGROUP_STAT_WRITEBACK);37693769+ *pfilepages = mem_cgroup_nr_lru_pages(memcg, (1 << LRU_INACTIVE_FILE) |37703770+ (1 << LRU_ACTIVE_FILE));37713771+ *pheadroom = PAGE_COUNTER_MAX;3770377237713771- file_pages = mem_cgroup_nr_lru_pages(memcg, (1 << LRU_INACTIVE_FILE) |37723772- (1 << LRU_ACTIVE_FILE));37733773 while ((parent = parent_mem_cgroup(memcg))) {37743774 unsigned long ceiling = min(memcg->memory.limit, memcg->high);37753775 unsigned long used = page_counter_read(&memcg->memory);3776377637773777- head_room = min(head_room, ceiling - min(ceiling, used));37773777+ *pheadroom = min(*pheadroom, ceiling - min(ceiling, used));37783778 memcg = parent;37793779 }37803780-37813781- *pavail = file_pages + head_room;37823780}3783378137843782#else /* CONFIG_CGROUP_WRITEBACK */
+2
mm/memory.c
···24262426 if (details.last_index < details.first_index)24272427 details.last_index = ULONG_MAX;2428242824292429+24302430+ /* DAX uses i_mmap_lock to serialise file truncate vs page fault */24292431 i_mmap_lock_write(mapping);24302432 if (unlikely(!RB_EMPTY_ROOT(&mapping->i_mmap)))24312433 unmap_mapping_range_tree(&mapping->i_mmap, &details);
+32-22
mm/page-writeback.c
···145145 unsigned long pos_ratio;146146};147147148148-#define DTC_INIT_COMMON(__wb) .wb = (__wb), \149149- .wb_completions = &(__wb)->completions150150-151148/*152149 * Length of period for aging writeout fractions of bdis. This is an153150 * arbitrarily chosen number. The longer the period, the slower fractions will···154157155158#ifdef CONFIG_CGROUP_WRITEBACK156159157157-#define GDTC_INIT(__wb) .dom = &global_wb_domain, \158158- DTC_INIT_COMMON(__wb)160160+#define GDTC_INIT(__wb) .wb = (__wb), \161161+ .dom = &global_wb_domain, \162162+ .wb_completions = &(__wb)->completions163163+159164#define GDTC_INIT_NO_WB .dom = &global_wb_domain160160-#define MDTC_INIT(__wb, __gdtc) .dom = mem_cgroup_wb_domain(__wb), \161161- .gdtc = __gdtc, \162162- DTC_INIT_COMMON(__wb)165165+166166+#define MDTC_INIT(__wb, __gdtc) .wb = (__wb), \167167+ .dom = mem_cgroup_wb_domain(__wb), \168168+ .wb_completions = &(__wb)->memcg_completions, \169169+ .gdtc = __gdtc163170164171static bool mdtc_valid(struct dirty_throttle_control *dtc)165172{···214213215214#else /* CONFIG_CGROUP_WRITEBACK */216215217217-#define GDTC_INIT(__wb) DTC_INIT_COMMON(__wb)216216+#define GDTC_INIT(__wb) .wb = (__wb), \217217+ .wb_completions = &(__wb)->completions218218#define GDTC_INIT_NO_WB219219#define MDTC_INIT(__wb, __gdtc)220220···684682 return max(thresh, dom->dirty_limit);685683}686684687687-/* memory available to a memcg domain is capped by system-wide clean memory */688688-static void mdtc_cap_avail(struct dirty_throttle_control *mdtc)685685+/*686686+ * Memory which can be further allocated to a memcg domain is capped by687687+ * system-wide clean memory excluding the amount being used in the domain.688688+ */689689+static void mdtc_calc_avail(struct dirty_throttle_control *mdtc,690690+ unsigned long filepages, unsigned long headroom)689691{690692 struct dirty_throttle_control *gdtc = mdtc_gdtc(mdtc);691691- unsigned long clean = gdtc->avail - min(gdtc->avail, gdtc->dirty);693693+ unsigned long clean = filepages - min(filepages, mdtc->dirty);694694+ unsigned long global_clean = gdtc->avail - min(gdtc->avail, gdtc->dirty);695695+ unsigned long other_clean = global_clean - min(global_clean, clean);692696693693- mdtc->avail = min(mdtc->avail, clean);697697+ mdtc->avail = filepages + min(headroom, other_clean);694698}695699696700/**···15701562 }1571156315721564 if (mdtc) {15731573- unsigned long writeback;15651565+ unsigned long filepages, headroom, writeback;1574156615751567 /*15761568 * If @wb belongs to !root memcg, repeat the same15771569 * basic calculations for the memcg domain.15781570 */15791579- mem_cgroup_wb_stats(wb, &mdtc->avail, &mdtc->dirty,15801580- &writeback);15811581- mdtc_cap_avail(mdtc);15711571+ mem_cgroup_wb_stats(wb, &filepages, &headroom,15721572+ &mdtc->dirty, &writeback);15821573 mdtc->dirty += writeback;15741574+ mdtc_calc_avail(mdtc, filepages, headroom);1583157515841576 domain_dirty_limits(mdtc);15851577···19011893 return true;1902189419031895 if (mdtc) {19041904- unsigned long writeback;18961896+ unsigned long filepages, headroom, writeback;1905189719061906- mem_cgroup_wb_stats(wb, &mdtc->avail, &mdtc->dirty, &writeback);19071907- mdtc_cap_avail(mdtc);18981898+ mem_cgroup_wb_stats(wb, &filepages, &headroom, &mdtc->dirty,18991899+ &writeback);19001900+ mdtc_calc_avail(mdtc, filepages, headroom);19081901 domain_dirty_limits(mdtc); /* ditto, ignore writeback */1909190219101903 if (mdtc->dirty > mdtc->bg_thresh)···19651956 int nr_pages = global_page_state(NR_FILE_DIRTY) +19661957 global_page_state(NR_UNSTABLE_NFS);19671958 struct bdi_writeback *wb;19681968- struct wb_iter iter;1969195919701960 /*19711961 * We want to write everything out, not just down to the dirty···19731965 if (!bdi_has_dirty_io(&q->backing_dev_info))19741966 return;1975196719761976- bdi_for_each_wb(wb, &q->backing_dev_info, &iter, 0)19681968+ rcu_read_lock();19691969+ list_for_each_entry_rcu(wb, &q->backing_dev_info.wb_list, bdi_node)19771970 if (wb_has_dirty_io(wb))19781971 wb_start_writeback(wb, nr_pages, true,19791972 WB_REASON_LAPTOP_TIMER);19731973+ rcu_read_unlock();19801974}1981197519821976/*
+4-4
mm/readahead.c
···8989 while (!list_empty(pages)) {9090 page = list_to_page(pages);9191 list_del(&page->lru);9292- if (add_to_page_cache_lru(page, mapping,9393- page->index, GFP_KERNEL)) {9292+ if (add_to_page_cache_lru(page, mapping, page->index,9393+ GFP_KERNEL & mapping_gfp_mask(mapping))) {9494 read_cache_pages_invalidate_page(mapping, page);9595 continue;9696 }···127127 for (page_idx = 0; page_idx < nr_pages; page_idx++) {128128 struct page *page = list_to_page(pages);129129 list_del(&page->lru);130130- if (!add_to_page_cache_lru(page, mapping,131131- page->index, GFP_KERNEL)) {130130+ if (!add_to_page_cache_lru(page, mapping, page->index,131131+ GFP_KERNEL & mapping_gfp_mask(mapping))) {132132 mapping->a_ops->readpage(filp, page);133133 }134134 page_cache_release(page);
+4-3
mm/vmstat.c
···1363136313641364static void vmstat_update(struct work_struct *w)13651365{13661366- if (refresh_cpu_vm_stats())13661366+ if (refresh_cpu_vm_stats()) {13671367 /*13681368 * Counters were updated so we expect more updates13691369 * to occur in the future. Keep on running the13701370 * update worker thread.13711371 */13721372- schedule_delayed_work(this_cpu_ptr(&vmstat_work),13721372+ schedule_delayed_work_on(smp_processor_id(),13731373+ this_cpu_ptr(&vmstat_work),13731374 round_jiffies_relative(sysctl_stat_interval));13741374- else {13751375+ } else {13751376 /*13761377 * We did not update any counters so the app may be in13771378 * a mode where it does not cause counter updates.
+71-28
net/bluetooth/hci_conn.c
···9191 * autoconnect action, remove them completely. If they are, just unmark9292 * them as waiting for connection, by clearing explicit_connect field.9393 */9494- if (params->auto_connect == HCI_AUTO_CONN_EXPLICIT)9494+ params->explicit_connect = false;9595+9696+ list_del_init(¶ms->action);9797+9898+ switch (params->auto_connect) {9999+ case HCI_AUTO_CONN_EXPLICIT:95100 hci_conn_params_del(conn->hdev, bdaddr, bdaddr_type);9696- else9797- params->explicit_connect = false;101101+ /* return instead of break to avoid duplicate scan update */102102+ return;103103+ case HCI_AUTO_CONN_DIRECT:104104+ case HCI_AUTO_CONN_ALWAYS:105105+ list_add(¶ms->action, &conn->hdev->pend_le_conns);106106+ break;107107+ case HCI_AUTO_CONN_REPORT:108108+ list_add(¶ms->action, &conn->hdev->pend_le_reports);109109+ break;110110+ default:111111+ break;112112+ }113113+114114+ hci_update_background_scan(conn->hdev);115115+}116116+117117+static void hci_conn_cleanup(struct hci_conn *conn)118118+{119119+ struct hci_dev *hdev = conn->hdev;120120+121121+ if (test_bit(HCI_CONN_PARAM_REMOVAL_PEND, &conn->flags))122122+ hci_conn_params_del(conn->hdev, &conn->dst, conn->dst_type);123123+124124+ hci_chan_list_flush(conn);125125+126126+ hci_conn_hash_del(hdev, conn);127127+128128+ if (hdev->notify)129129+ hdev->notify(hdev, HCI_NOTIFY_CONN_DEL);130130+131131+ hci_conn_del_sysfs(conn);132132+133133+ debugfs_remove_recursive(conn->debugfs);134134+135135+ hci_dev_put(hdev);136136+137137+ hci_conn_put(conn);98138}99139100140/* This function requires the caller holds hdev->lock */···142102{143103 hci_connect_le_scan_cleanup(conn);144104145145- hci_conn_hash_del(conn->hdev, conn);146146- hci_update_background_scan(conn->hdev);105105+ /* We can't call hci_conn_del here since that would deadlock106106+ * with trying to call cancel_delayed_work_sync(&conn->disc_work).107107+ * Instead, call just hci_conn_cleanup() which contains the bare108108+ * minimum cleanup operations needed for a connection in this109109+ * state.110110+ */111111+ hci_conn_cleanup(conn);147112}148113149114static void hci_acl_create_connection(struct hci_conn *conn)···626581 }627582 }628583629629- hci_chan_list_flush(conn);630630-631584 if (conn->amp_mgr)632585 amp_mgr_put(conn->amp_mgr);633586634634- hci_conn_hash_del(hdev, conn);635635- if (hdev->notify)636636- hdev->notify(hdev, HCI_NOTIFY_CONN_DEL);637637-638587 skb_queue_purge(&conn->data_q);639588640640- hci_conn_del_sysfs(conn);641641-642642- debugfs_remove_recursive(conn->debugfs);643643-644644- if (test_bit(HCI_CONN_PARAM_REMOVAL_PEND, &conn->flags))645645- hci_conn_params_del(conn->hdev, &conn->dst, conn->dst_type);646646-647647- hci_dev_put(hdev);648648-649649- hci_conn_put(conn);589589+ /* Remove the connection from the list and cleanup its remaining590590+ * state. This is a separate function since for some cases like591591+ * BT_CONNECT_SCAN we *only* want the cleanup part without the592592+ * rest of hci_conn_del.593593+ */594594+ hci_conn_cleanup(conn);650595651596 return 0;652597}···1008973 if (is_connected(hdev, addr, addr_type))1009974 return -EISCONN;101097510111011- params = hci_conn_params_add(hdev, addr, addr_type);10121012- if (!params)10131013- return -EIO;976976+ params = hci_conn_params_lookup(hdev, addr, addr_type);977977+ if (!params) {978978+ params = hci_conn_params_add(hdev, addr, addr_type);979979+ if (!params)980980+ return -ENOMEM;101498110151015- /* If we created new params, or existing params were marked as disabled,10161016- * mark them to be used just once to connect.10171017- */10181018- if (params->auto_connect == HCI_AUTO_CONN_DISABLED) {982982+ /* If we created new params, mark them to be deleted in983983+ * hci_connect_le_scan_cleanup. It's different case than984984+ * existing disabled params, those will stay after cleanup.985985+ */1019986 params->auto_connect = HCI_AUTO_CONN_EXPLICIT;987987+ }988988+989989+ /* We're trying to connect, so make sure params are at pend_le_conns */990990+ if (params->auto_connect == HCI_AUTO_CONN_DISABLED ||991991+ params->auto_connect == HCI_AUTO_CONN_REPORT ||992992+ params->auto_connect == HCI_AUTO_CONN_EXPLICIT) {1020993 list_del_init(¶ms->action);1021994 list_add(¶ms->action, &hdev->pend_le_conns);1022995 }
···5555 wake_up_bit(&hdev->flags, HCI_INQUIRY);56565757 hci_dev_lock(hdev);5858- hci_discovery_set_state(hdev, DISCOVERY_STOPPED);5858+ /* Set discovery state to stopped if we're not doing LE active5959+ * scanning.6060+ */6161+ if (!hci_dev_test_flag(hdev, HCI_LE_SCAN) ||6262+ hdev->le_scan_type != LE_SCAN_ACTIVE)6363+ hci_discovery_set_state(hdev, DISCOVERY_STOPPED);5964 hci_dev_unlock(hdev);60656166 hci_conn_check_pending(hdev);···46534648 /* If we're not connectable only connect devices that we have in46544649 * our pend_le_conns list.46554650 */46564656- params = hci_explicit_connect_lookup(hdev, addr, addr_type);46574657-46514651+ params = hci_pend_le_action_lookup(&hdev->pend_le_conns, addr,46524652+ addr_type);46584653 if (!params)46594654 return NULL;46604655
+20-4
net/bluetooth/mgmt.c
···35453545 auth_type);35463546 } else {35473547 u8 addr_type;35483548+ struct hci_conn_params *p;3548354935493550 /* Convert from L2CAP channel address type to HCI address type35503551 */···35633562 * If connection parameters already exist, then they35643563 * will be kept and this function does nothing.35653564 */35663566- hci_conn_params_add(hdev, &cp->addr.bdaddr, addr_type);35653565+ p = hci_conn_params_add(hdev, &cp->addr.bdaddr, addr_type);35663566+35673567+ if (p->auto_connect == HCI_AUTO_CONN_EXPLICIT)35683568+ p->auto_connect = HCI_AUTO_CONN_DISABLED;3567356935683570 conn = hci_connect_le_scan(hdev, &cp->addr.bdaddr,35693571 addr_type, sec_level,···61216117 __hci_update_background_scan(req);61226118 break;61236119 case HCI_AUTO_CONN_REPORT:61246124- list_add(¶ms->action, &hdev->pend_le_reports);61206120+ if (params->explicit_connect)61216121+ list_add(¶ms->action, &hdev->pend_le_conns);61226122+ else61236123+ list_add(¶ms->action, &hdev->pend_le_reports);61256124 __hci_update_background_scan(req);61266125 break;61276126 case HCI_AUTO_CONN_DIRECT:61286127 case HCI_AUTO_CONN_ALWAYS:61296128 if (!is_connected(hdev, addr, addr_type)) {61306129 list_add(¶ms->action, &hdev->pend_le_conns);61316131- __hci_update_background_scan(req);61306130+ /* If we are in scan phase of connecting, we were61316131+ * already added to pend_le_conns and scanning.61326132+ */61336133+ if (params->auto_connect != HCI_AUTO_CONN_EXPLICIT)61346134+ __hci_update_background_scan(req);61326135 }61336136 break;61346137 }···63906379 goto unlock;63916380 }6392638163936393- if (params->auto_connect == HCI_AUTO_CONN_DISABLED) {63826382+ if (params->auto_connect == HCI_AUTO_CONN_DISABLED ||63836383+ params->auto_connect == HCI_AUTO_CONN_EXPLICIT) {63946384 err = cmd->cmd_complete(cmd,63956385 MGMT_STATUS_INVALID_PARAMS);63966386 mgmt_pending_remove(cmd);···64276415 if (p->auto_connect == HCI_AUTO_CONN_DISABLED)64286416 continue;64296417 device_removed(sk, hdev, &p->addr, p->addr_type);64186418+ if (p->explicit_connect) {64196419+ p->auto_connect = HCI_AUTO_CONN_EXPLICIT;64206420+ continue;64216421+ }64306422 list_del(&p->action);64316423 list_del(&p->list);64326424 kfree(p);
+9-4
net/ceph/osd_client.c
···285285 switch (op->op) {286286 case CEPH_OSD_OP_READ:287287 case CEPH_OSD_OP_WRITE:288288+ case CEPH_OSD_OP_WRITEFULL:288289 ceph_osd_data_release(&op->extent.osd_data);289290 break;290291 case CEPH_OSD_OP_CALL:···486485 size_t payload_len = 0;487486488487 BUG_ON(opcode != CEPH_OSD_OP_READ && opcode != CEPH_OSD_OP_WRITE &&489489- opcode != CEPH_OSD_OP_ZERO && opcode != CEPH_OSD_OP_TRUNCATE);488488+ opcode != CEPH_OSD_OP_WRITEFULL && opcode != CEPH_OSD_OP_ZERO &&489489+ opcode != CEPH_OSD_OP_TRUNCATE);490490491491 op->extent.offset = offset;492492 op->extent.length = length;493493 op->extent.truncate_size = truncate_size;494494 op->extent.truncate_seq = truncate_seq;495495- if (opcode == CEPH_OSD_OP_WRITE)495495+ if (opcode == CEPH_OSD_OP_WRITE || opcode == CEPH_OSD_OP_WRITEFULL)496496 payload_len += length;497497498498 op->payload_len = payload_len;···672670 break;673671 case CEPH_OSD_OP_READ:674672 case CEPH_OSD_OP_WRITE:673673+ case CEPH_OSD_OP_WRITEFULL:675674 case CEPH_OSD_OP_ZERO:676675 case CEPH_OSD_OP_TRUNCATE:677677- if (src->op == CEPH_OSD_OP_WRITE)676676+ if (src->op == CEPH_OSD_OP_WRITE ||677677+ src->op == CEPH_OSD_OP_WRITEFULL)678678 request_data_len = src->extent.length;679679 dst->extent.offset = cpu_to_le64(src->extent.offset);680680 dst->extent.length = cpu_to_le64(src->extent.length);···685681 dst->extent.truncate_seq =686682 cpu_to_le32(src->extent.truncate_seq);687683 osd_data = &src->extent.osd_data;688688- if (src->op == CEPH_OSD_OP_WRITE)684684+ if (src->op == CEPH_OSD_OP_WRITE ||685685+ src->op == CEPH_OSD_OP_WRITEFULL)689686 ceph_osdc_msg_data_add(req->r_request, osd_data);690687 else691688 ceph_osdc_msg_data_add(req->r_reply, osd_data);
+1-1
net/core/ethtool.c
···1284128412851285 gstrings.len = ret;1286128612871287- data = kmalloc(gstrings.len * ETH_GSTRING_LEN, GFP_USER);12871287+ data = kcalloc(gstrings.len, ETH_GSTRING_LEN, GFP_USER);12881288 if (!data)12891289 return -ENOMEM;12901290
+6-1
net/core/filter.c
···14151415 return dev_forward_skb(dev, skb2);1416141614171417 skb2->dev = dev;14181418+ skb_sender_cpu_clear(skb2);14181419 return dev_queue_xmit(skb2);14191420}14201421···18551854 goto out;1856185518571856 /* We're copying the filter that has been originally attached,18581858- * so no conversion/decode needed anymore.18571857+ * so no conversion/decode needed anymore. eBPF programs that18581858+ * have no original program cannot be dumped through this.18591859 */18601860+ ret = -EACCES;18601861 fprog = filter->prog->orig_prog;18621862+ if (!fprog)18631863+ goto out;1861186418621865 ret = fprog->len;18631866 if (!len)
+59-11
net/dsa/dsa.c
···2222#include <linux/of_platform.h>2323#include <linux/of_net.h>2424#include <linux/sysfs.h>2525+#include <linux/phy_fixed.h>2526#include "dsa_priv.h"26272728char dsa_driver_version[] = "0.1";···306305 if (ret < 0)307306 goto out;308307309309- ds->slave_mii_bus = mdiobus_alloc();308308+ ds->slave_mii_bus = devm_mdiobus_alloc(parent);310309 if (ds->slave_mii_bus == NULL) {311310 ret = -ENOMEM;312311 goto out;···315314316315 ret = mdiobus_register(ds->slave_mii_bus);317316 if (ret < 0)318318- goto out_free;317317+ goto out;319318320319321320 /*···368367369368 return ret;370369371371-out_free:372372- mdiobus_free(ds->slave_mii_bus);373370out:374374- kfree(ds);375371 return ret;376372}377373···398400 /*399401 * Allocate and initialise switch state.400402 */401401- ds = kzalloc(sizeof(*ds) + drv->priv_size, GFP_KERNEL);403403+ ds = devm_kzalloc(parent, sizeof(*ds) + drv->priv_size, GFP_KERNEL);402404 if (ds == NULL)403405 return ERR_PTR(-ENOMEM);404406···418420419421static void dsa_switch_destroy(struct dsa_switch *ds)420422{423423+ struct device_node *port_dn;424424+ struct phy_device *phydev;425425+ struct dsa_chip_data *cd = ds->pd;426426+ int port;427427+421428#ifdef CONFIG_NET_DSA_HWMON422429 if (ds->hwmon_dev)423430 hwmon_device_unregister(ds->hwmon_dev);424431#endif432432+433433+ /* Disable configuration of the CPU and DSA ports */434434+ for (port = 0; port < DSA_MAX_PORTS; port++) {435435+ if (!(dsa_is_cpu_port(ds, port) || dsa_is_dsa_port(ds, port)))436436+ continue;437437+438438+ port_dn = cd->port_dn[port];439439+ if (of_phy_is_fixed_link(port_dn)) {440440+ phydev = of_phy_find_device(port_dn);441441+ if (phydev) {442442+ int addr = phydev->addr;443443+444444+ phy_device_free(phydev);445445+ of_node_put(port_dn);446446+ fixed_phy_del(addr);447447+ }448448+ }449449+ }450450+451451+ /* Destroy network devices for physical switch ports. */452452+ for (port = 0; port < DSA_MAX_PORTS; port++) {453453+ if (!(ds->phys_port_mask & (1 << port)))454454+ continue;455455+456456+ if (!ds->ports[port])457457+ continue;458458+459459+ unregister_netdev(ds->ports[port]);460460+ free_netdev(ds->ports[port]);461461+ }462462+463463+ mdiobus_unregister(ds->slave_mii_bus);425464}426465427466#ifdef CONFIG_PM_SLEEP···837802}838803#endif839804840840-static void dsa_setup_dst(struct dsa_switch_tree *dst, struct net_device *dev,841841- struct device *parent, struct dsa_platform_data *pd)805805+static int dsa_setup_dst(struct dsa_switch_tree *dst, struct net_device *dev,806806+ struct device *parent, struct dsa_platform_data *pd)842807{843808 int i;809809+ unsigned configured = 0;844810845811 dst->pd = pd;846812 dst->master_netdev = dev;···861825 dst->ds[i] = ds;862826 if (ds->drv->poll_link != NULL)863827 dst->link_poll_needed = 1;828828+829829+ ++configured;864830 }831831+832832+ /*833833+ * If no switch was found, exit cleanly834834+ */835835+ if (!configured)836836+ return -EPROBE_DEFER;865837866838 /*867839 * If we use a tagging format that doesn't have an ethertype···887843 dst->link_poll_timer.expires = round_jiffies(jiffies + HZ);888844 add_timer(&dst->link_poll_timer);889845 }846846+847847+ return 0;890848}891849892850static int dsa_probe(struct platform_device *pdev)···929883 goto out;930884 }931885932932- dst = kzalloc(sizeof(*dst), GFP_KERNEL);886886+ dst = devm_kzalloc(&pdev->dev, sizeof(*dst), GFP_KERNEL);933887 if (dst == NULL) {934888 dev_put(dev);935889 ret = -ENOMEM;···938892939893 platform_set_drvdata(pdev, dst);940894941941- dsa_setup_dst(dst, dev, &pdev->dev, pd);895895+ ret = dsa_setup_dst(dst, dev, &pdev->dev, pd);896896+ if (ret)897897+ goto out;942898943899 return 0;944900···962914 for (i = 0; i < dst->pd->nr_chips; i++) {963915 struct dsa_switch *ds = dst->ds[i];964916965965- if (ds != NULL)917917+ if (ds)966918 dsa_switch_destroy(ds);967919 }968920}
···149149150150 for (i = 0; i < NUM_IEEE80211_HW_FLAGS; i++) {151151 if (test_bit(i, local->hw.flags))152152- pos += scnprintf(pos, end - pos, "%s",152152+ pos += scnprintf(pos, end - pos, "%s\n",153153 hw_flag_names[i]);154154 }155155
+1
net/mac80211/status.c
···101101 * when it wakes up for the next time.102102 */103103 set_sta_flag(sta, WLAN_STA_CLEAR_PS_FILT);104104+ ieee80211_clear_fast_xmit(sta);104105105106 /*106107 * This code races in the following way:
+5-2
net/mac80211/tx.c
···1218121812191219 if (!tx->sta)12201220 info->flags |= IEEE80211_TX_CTL_CLEAR_PS_FILT;12211221- else if (test_and_clear_sta_flag(tx->sta, WLAN_STA_CLEAR_PS_FILT))12211221+ else if (test_and_clear_sta_flag(tx->sta, WLAN_STA_CLEAR_PS_FILT)) {12221222 info->flags |= IEEE80211_TX_CTL_CLEAR_PS_FILT;12231223+ ieee80211_check_fast_xmit(tx->sta);12241224+ }1223122512241226 info->flags |= IEEE80211_TX_CTL_FIRST_FRAGMENT;12251227···2453245124542452 if (test_sta_flag(sta, WLAN_STA_PS_STA) ||24552453 test_sta_flag(sta, WLAN_STA_PS_DRIVER) ||24562456- test_sta_flag(sta, WLAN_STA_PS_DELIVER))24542454+ test_sta_flag(sta, WLAN_STA_PS_DELIVER) ||24552455+ test_sta_flag(sta, WLAN_STA_CLEAR_PS_FILT))24572456 goto out;2458245724592458 if (sdata->noack_map)
+22-12
net/netlink/af_netlink.c
···27852785 struct sk_buff *skb = NULL;27862786 struct nlmsghdr *nlh;27872787 int len, err = -ENOBUFS;27882788+ int alloc_min_size;27882789 int alloc_size;2789279027902791 mutex_lock(nlk->cb_mutex);···27932792 err = -EINVAL;27942793 goto errout_skb;27952794 }27962796-27972797- cb = &nlk->cb;27982798- alloc_size = max_t(int, cb->min_dump_alloc, NLMSG_GOODSIZE);2799279528002796 if (!netlink_rx_is_mmaped(sk) &&28012797 atomic_read(&sk->sk_rmem_alloc) >= sk->sk_rcvbuf)···28032805 * to reduce number of system calls on dump operations, if user28042806 * ever provided a big enough buffer.28052807 */28062806- if (alloc_size < nlk->max_recvmsg_len) {28072807- skb = netlink_alloc_skb(sk,28082808- nlk->max_recvmsg_len,28092809- nlk->portid,28082808+ cb = &nlk->cb;28092809+ alloc_min_size = max_t(int, cb->min_dump_alloc, NLMSG_GOODSIZE);28102810+28112811+ if (alloc_min_size < nlk->max_recvmsg_len) {28122812+ alloc_size = nlk->max_recvmsg_len;28132813+ skb = netlink_alloc_skb(sk, alloc_size, nlk->portid,28102814 GFP_KERNEL |28112815 __GFP_NOWARN |28122816 __GFP_NORETRY);28132813- /* available room should be exact amount to avoid MSG_TRUNC */28142814- if (skb)28152815- skb_reserve(skb, skb_tailroom(skb) -28162816- nlk->max_recvmsg_len);28172817 }28182818- if (!skb)28182818+ if (!skb) {28192819+ alloc_size = alloc_min_size;28192820 skb = netlink_alloc_skb(sk, alloc_size, nlk->portid,28202821 GFP_KERNEL);28222822+ }28212823 if (!skb)28222824 goto errout_skb;28252825+28262826+ /* Trim skb to allocated size. User is expected to provide buffer as28272827+ * large as max(min_dump_alloc, 16KiB (mac_recvmsg_len capped at28282828+ * netlink_recvmsg())). dump will pack as many smaller messages as28292829+ * could fit within the allocated skb. skb is typically allocated28302830+ * with larger space than required (could be as much as near 2x the28312831+ * requested size with align to next power of 2 approach). Allowing28322832+ * dump to use the excess space makes it difficult for a user to have a28332833+ * reasonable static buffer based on the expected largest dump of a28342834+ * single netdev. The outcome is MSG_TRUNC error.28352835+ */28362836+ skb_reserve(skb, skb_tailroom(skb) - alloc_size);28232837 netlink_skb_set_owner_r(skb, sk);2824283828252839 len = cb->dump(skb, cb);
+14-5
net/openvswitch/actions.c
···684684{685685 if (skb_network_offset(skb) > MAX_L2_LEN) {686686 OVS_NLERR(1, "L2 header too long to fragment");687687- return;687687+ goto err;688688 }689689690690 if (ethertype == htons(ETH_P_IP)) {···708708 struct rt6_info ovs_rt;709709710710 if (!v6ops) {711711- kfree_skb(skb);712712- return;711711+ goto err;713712 }714713715714 prepare_frag(vport, skb);···727728 WARN_ONCE(1, "Failed fragment ->%s: eth=%04x, MRU=%d, MTU=%d.",728729 ovs_vport_name(vport), ntohs(ethertype), mru,729730 vport->dev->mtu);730730- kfree_skb(skb);731731+ goto err;731732 }733733+734734+ return;735735+err:736736+ kfree_skb(skb);732737}733738734739static void do_output(struct datapath *dp, struct sk_buff *skb, int out_port,···971968 case OVS_KEY_ATTR_CT_STATE:972969 case OVS_KEY_ATTR_CT_ZONE:973970 case OVS_KEY_ATTR_CT_MARK:974974- case OVS_KEY_ATTR_CT_LABEL:971971+ case OVS_KEY_ATTR_CT_LABELS:975972 err = -EINVAL;976973 break;977974 }···11021099 break;1103110011041101 case OVS_ACTION_ATTR_CT:11021102+ if (!is_flow_key_valid(key)) {11031103+ err = ovs_flow_key_update(skb, key);11041104+ if (err)11051105+ return err;11061106+ }11071107+11051108 err = ovs_ct_execute(ovs_dp_get_net(dp), skb, key,11061109 nla_data(a));11071110
···134134 kdebug("- %u", key->serial);135135 key_check(key);136136137137- /* Throw away the key data */138138- if (key->type->destroy)137137+ /* Throw away the key data if the key is instantiated */138138+ if (test_bit(KEY_FLAG_INSTANTIATED, &key->flags) &&139139+ !test_bit(KEY_FLAG_NEGATIVE, &key->flags) &&140140+ key->type->destroy)139141 key->type->destroy(key);140142141143 security_key_free(key);
+3
security/keys/request_key.c
···440440441441 kenter("");442442443443+ if (ctx->index_key.type == &key_type_keyring)444444+ return ERR_PTR(-EPERM);445445+443446 user = key_user_lookup(current_fsuid());444447 if (!user)445448 return ERR_PTR(-ENOMEM);
···3808380838093809 wm8962_reset(wm8962);3810381038113811+ regcache_mark_dirty(wm8962->regmap);38123812+38113813 /* SYSCLK defaults to on; make sure it is off so we can safely38123814 * write to registers if the device is declocked.38133815 */
+28
sound/soc/soc-ops.c
···207207EXPORT_SYMBOL_GPL(snd_soc_info_volsw);208208209209/**210210+ * snd_soc_info_volsw_sx - Mixer info callback for SX TLV controls211211+ * @kcontrol: mixer control212212+ * @uinfo: control element information213213+ *214214+ * Callback to provide information about a single mixer control, or a double215215+ * mixer control that spans 2 registers of the SX TLV type. SX TLV controls216216+ * have a range that represents both positive and negative values either side217217+ * of zero but without a sign bit.218218+ *219219+ * Returns 0 for success.220220+ */221221+int snd_soc_info_volsw_sx(struct snd_kcontrol *kcontrol,222222+ struct snd_ctl_elem_info *uinfo)223223+{224224+ struct soc_mixer_control *mc =225225+ (struct soc_mixer_control *)kcontrol->private_value;226226+227227+ snd_soc_info_volsw(kcontrol, uinfo);228228+ /* Max represents the number of levels in an SX control not the229229+ * maximum value, so add the minimum value back on230230+ */231231+ uinfo->value.integer.max += mc->min;232232+233233+ return 0;234234+}235235+EXPORT_SYMBOL_GPL(snd_soc_info_volsw_sx);236236+237237+/**210238 * snd_soc_get_volsw - single mixer get callback211239 * @kcontrol: mixer control212240 * @ucontrol: control element information
···25252626#define FIXUP_SECTION ".ex_fixup"27272828+static inline unsigned long __fls(unsigned long x);2929+2830#include "word-at-a-time.h"29313032#include "utils.h"31333434+static inline unsigned long __fls(unsigned long x)3535+{3636+ int lz;3737+3838+ asm (PPC_CNTLZL "%0,%1" : "=r" (lz) : "r" (x));3939+ return sizeof(unsigned long) - 1 - lz;4040+}32413342static int page_size;3443static char *mem_region;
+19
virt/kvm/arm/arch_timer.c
···137137void kvm_timer_flush_hwstate(struct kvm_vcpu *vcpu)138138{139139 struct arch_timer_cpu *timer = &vcpu->arch.timer_cpu;140140+ bool phys_active;141141+ int ret;140142141143 /*142144 * We're about to run this vcpu again, so there is no need to···153151 */154152 if (kvm_timer_should_fire(vcpu))155153 kvm_timer_inject_irq(vcpu);154154+155155+ /*156156+ * We keep track of whether the edge-triggered interrupt has been157157+ * signalled to the vgic/guest, and if so, we mask the interrupt and158158+ * the physical distributor to prevent the timer from raising a159159+ * physical interrupt whenever we run a guest, preventing forward160160+ * VCPU progress.161161+ */162162+ if (kvm_vgic_get_phys_irq_active(timer->map))163163+ phys_active = true;164164+ else165165+ phys_active = false;166166+167167+ ret = irq_set_irqchip_state(timer->map->irq,168168+ IRQCHIP_STATE_ACTIVE,169169+ phys_active);170170+ WARN_ON(ret);156171}157172158173/**
+55-40
virt/kvm/arm/vgic.c
···531531 return false;532532}533533534534+/*535535+ * If a mapped interrupt's state has been modified by the guest such that it536536+ * is no longer active or pending, without it have gone through the sync path,537537+ * then the map->active field must be cleared so the interrupt can be taken538538+ * again.539539+ */540540+static void vgic_handle_clear_mapped_irq(struct kvm_vcpu *vcpu)541541+{542542+ struct vgic_cpu *vgic_cpu = &vcpu->arch.vgic_cpu;543543+ struct list_head *root;544544+ struct irq_phys_map_entry *entry;545545+ struct irq_phys_map *map;546546+547547+ rcu_read_lock();548548+549549+ /* Check for PPIs */550550+ root = &vgic_cpu->irq_phys_map_list;551551+ list_for_each_entry_rcu(entry, root, entry) {552552+ map = &entry->map;553553+554554+ if (!vgic_dist_irq_is_pending(vcpu, map->virt_irq) &&555555+ !vgic_irq_is_active(vcpu, map->virt_irq))556556+ map->active = false;557557+ }558558+559559+ rcu_read_unlock();560560+}561561+534562bool vgic_handle_clear_pending_reg(struct kvm *kvm,535563 struct kvm_exit_mmio *mmio,536564 phys_addr_t offset, int vcpu_id)···589561 vcpu_id, offset);590562 vgic_reg_access(mmio, reg, offset, mode);591563564564+ vgic_handle_clear_mapped_irq(kvm_get_vcpu(kvm, vcpu_id));592565 vgic_update_state(kvm);593566 return true;594567 }···627598 ACCESS_READ_VALUE | ACCESS_WRITE_CLEARBIT);628599629600 if (mmio->is_write) {601601+ vgic_handle_clear_mapped_irq(kvm_get_vcpu(kvm, vcpu_id));630602 vgic_update_state(kvm);631603 return true;632604 }···1012982 pend_percpu = vcpu->arch.vgic_cpu.pending_percpu;1013983 pend_shared = vcpu->arch.vgic_cpu.pending_shared;1014984985985+ if (!dist->enabled) {986986+ bitmap_zero(pend_percpu, VGIC_NR_PRIVATE_IRQS);987987+ bitmap_zero(pend_shared, nr_shared);988988+ return 0;989989+ }990990+1015991 pending = vgic_bitmap_get_cpu_map(&dist->irq_pending, vcpu_id);1016992 enabled = vgic_bitmap_get_cpu_map(&dist->irq_enabled, vcpu_id);1017993 bitmap_and(pend_percpu, pending, enabled, VGIC_NR_PRIVATE_IRQS);···10441008 struct vgic_dist *dist = &kvm->arch.vgic;10451009 struct kvm_vcpu *vcpu;10461010 int c;10471047-10481048- if (!dist->enabled) {10491049- set_bit(0, dist->irq_pending_on_cpu);10501050- return;10511051- }1052101110531012 kvm_for_each_vcpu(c, vcpu, kvm) {10541013 if (compute_pending_for_cpu(vcpu))···11231092 struct vgic_cpu *vgic_cpu = &vcpu->arch.vgic_cpu;11241093 struct vgic_lr vlr = vgic_get_lr(vcpu, lr_nr);1125109410951095+ /*10961096+ * We must transfer the pending state back to the distributor before10971097+ * retiring the LR, otherwise we may loose edge-triggered interrupts.10981098+ */10991099+ if (vlr.state & LR_STATE_PENDING) {11001100+ vgic_dist_irq_set_pending(vcpu, irq);11011101+ vlr.hwirq = 0;11021102+ }11031103+11261104 vlr.state = 0;11271105 vgic_set_lr(vcpu, lr_nr, vlr);11281106 clear_bit(lr_nr, vgic_cpu->lr_used);···11721132 kvm_debug("Set active, clear distributor: 0x%x\n", vlr.state);11731133 vgic_irq_clear_active(vcpu, irq);11741134 vgic_update_state(vcpu->kvm);11751175- } else if (vgic_dist_irq_is_pending(vcpu, irq)) {11351135+ } else {11361136+ WARN_ON(!vgic_dist_irq_is_pending(vcpu, irq));11761137 vlr.state |= LR_STATE_PENDING;11771138 kvm_debug("Set pending: 0x%x\n", vlr.state);11781139 }···12811240 struct vgic_cpu *vgic_cpu = &vcpu->arch.vgic_cpu;12821241 struct vgic_dist *dist = &vcpu->kvm->arch.vgic;12831242 unsigned long *pa_percpu, *pa_shared;12841284- int i, vcpu_id, lr, ret;12431243+ int i, vcpu_id;12851244 int overflow = 0;12861245 int nr_shared = vgic_nr_shared_irqs(dist);12871246···13351294 * adjust that if needed while exiting.13361295 */13371296 clear_bit(vcpu_id, dist->irq_pending_on_cpu);13381338- }13391339-13401340- for (lr = 0; lr < vgic->nr_lr; lr++) {13411341- struct vgic_lr vlr;13421342-13431343- if (!test_bit(lr, vgic_cpu->lr_used))13441344- continue;13451345-13461346- vlr = vgic_get_lr(vcpu, lr);13471347-13481348- /*13491349- * If we have a mapping, and the virtual interrupt is13501350- * presented to the guest (as pending or active), then we must13511351- * set the state to active in the physical world. See13521352- * Documentation/virtual/kvm/arm/vgic-mapped-irqs.txt.13531353- */13541354- if (vlr.state & LR_HW) {13551355- struct irq_phys_map *map;13561356- map = vgic_irq_map_search(vcpu, vlr.irq);13571357-13581358- ret = irq_set_irqchip_state(map->irq,13591359- IRQCHIP_STATE_ACTIVE,13601360- true);13611361- WARN_ON(ret);13621362- }13631297 }13641298}13651299···14371421 return 0;1438142214391423 map = vgic_irq_map_search(vcpu, vlr.irq);14401440- BUG_ON(!map || !map->active);14241424+ BUG_ON(!map);1441142514421426 ret = irq_get_irqchip_state(map->irq,14431427 IRQCHIP_STATE_ACTIVE,···1445142914461430 WARN_ON(ret);1447143114481448- if (map->active) {14491449- ret = irq_set_irqchip_state(map->irq,14501450- IRQCHIP_STATE_ACTIVE,14511451- false);14521452- WARN_ON(ret);14321432+ if (map->active)14531433 return 0;14541454- }1455143414561435 return 1;14571436}···16181607 } else {16191608 if (level_triggered) {16201609 vgic_dist_irq_clear_level(vcpu, irq_num);16211621- if (!vgic_dist_irq_soft_pend(vcpu, irq_num))16101610+ if (!vgic_dist_irq_soft_pend(vcpu, irq_num)) {16221611 vgic_dist_irq_clear_pending(vcpu, irq_num);16121612+ vgic_cpu_irq_clear(vcpu, irq_num);16131613+ if (!compute_pending_for_cpu(vcpu))16141614+ clear_bit(cpuid, dist->irq_pending_on_cpu);16151615+ }16231616 }1624161716251618 ret = false;