···196196 * active IRQs causes the interrupt output to pulse, the upper levels197197 * will call us again if there are more interrupts to process.198198 */199199-static void200200-sa1111_irq_handler(unsigned int __irq, struct irq_desc *desc)199199+static void sa1111_irq_handler(struct irq_desc *desc)201200{202202- unsigned int irq = irq_desc_get_irq(desc);203201 unsigned int stat0, stat1, i;204202 struct sa1111 *sachip = irq_desc_get_handler_data(desc);205203 void __iomem *mapbase = sachip->base + SA1111_INTC;···212214 sa1111_writel(stat1, mapbase + SA1111_INTSTATCLR1);213215214216 if (stat0 == 0 && stat1 == 0) {215215- do_bad_IRQ(irq, desc);217217+ do_bad_IRQ(desc);216218 return;217219 }218220
···2323/*2424 * This is for easy migration, but should be changed in the source2525 */2626-#define do_bad_IRQ(irq,desc) \2626+#define do_bad_IRQ(desc) \2727do { \2828 raw_spin_lock(&desc->lock); \2929- handle_bad_irq(irq, desc); \2929+ handle_bad_irq(desc); \3030 raw_spin_unlock(&desc->lock); \3131} while(0)3232
-20
arch/arm/kernel/irq.c
···7979 handle_IRQ(irq, regs);8080}81818282-void set_irq_flags(unsigned int irq, unsigned int iflags)8383-{8484- unsigned long clr = 0, set = IRQ_NOREQUEST | IRQ_NOPROBE | IRQ_NOAUTOEN;8585-8686- if (irq >= nr_irqs) {8787- pr_err("Trying to set irq flags for IRQ%d\n", irq);8888- return;8989- }9090-9191- if (iflags & IRQF_VALID)9292- clr |= IRQ_NOREQUEST;9393- if (iflags & IRQF_PROBE)9494- clr |= IRQ_NOPROBE;9595- if (!(iflags & IRQF_NOAUTOEN))9696- clr |= IRQ_NOAUTOEN;9797- /* Order is clear bits in "clr" then set bits in "set" */9898- irq_modify_status(irq, clr, set & ~clr);9999-}100100-EXPORT_SYMBOL_GPL(set_irq_flags);101101-10282void __init init_IRQ(void)10383{10484 int ret;
+5-3
arch/arm/kernel/kgdb.c
···259259 if (err)260260 return err;261261262262- patch_text((void *)bpt->bpt_addr,263263- *(unsigned int *)arch_kgdb_ops.gdb_bpt_instr);262262+ /* Machine is already stopped, so we can use __patch_text() directly */263263+ __patch_text((void *)bpt->bpt_addr,264264+ *(unsigned int *)arch_kgdb_ops.gdb_bpt_instr);264265265266 return err;266267}267268268269int kgdb_arch_remove_breakpoint(struct kgdb_bkpt *bpt)269270{270270- patch_text((void *)bpt->bpt_addr, *(unsigned int *)bpt->saved_instr);271271+ /* Machine is already stopped, so we can use __patch_text() directly */272272+ __patch_text((void *)bpt->bpt_addr, *(unsigned int *)bpt->saved_instr);271273272274 return 0;273275}
+9-6
arch/arm/kernel/signal.c
···343343 */344344 thumb = handler & 1;345345346346-#if __LINUX_ARM_ARCH__ >= 7347346 /*348348- * Clear the If-Then Thumb-2 execution state349349- * ARM spec requires this to be all 000s in ARM mode350350- * Snapdragon S4/Krait misbehaves on a Thumb=>ARM351351- * signal transition without this.347347+ * Clear the If-Then Thumb-2 execution state. ARM spec348348+ * requires this to be all 000s in ARM mode. Snapdragon349349+ * S4/Krait misbehaves on a Thumb=>ARM signal transition350350+ * without this.351351+ *352352+ * We must do this whenever we are running on a Thumb-2353353+ * capable CPU, which includes ARMv6T2. However, we elect354354+ * to always do this to simplify the code; this field is355355+ * marked UNK/SBZP for older architectures.352356 */353357 cpsr &= ~PSR_IT_MASK;354354-#endif355358356359 if (thumb) {357360 cpsr |= PSR_T_BIT;
-11
arch/arm/kvm/Kconfig
···4545 ---help---4646 Provides host support for ARM processors.47474848-config KVM_ARM_MAX_VCPUS4949- int "Number maximum supported virtual CPUs per VM"5050- depends on KVM_ARM_HOST5151- default 45252- help5353- Static number of max supported virtual CPUs per VM.5454-5555- If you choose a high number, the vcpu structures will be quite5656- large, so only choose a reasonable number that you expect to5757- actually use.5858-5948endif # VIRTUALIZATION
+1-1
arch/arm/kvm/arm.c
···446446 * Map the VGIC hardware resources before running a vcpu the first447447 * time on this VM.448448 */449449- if (unlikely(!vgic_ready(kvm))) {449449+ if (unlikely(irqchip_in_kernel(kvm) && !vgic_ready(kvm))) {450450 ret = kvm_vgic_map_resources(kvm);451451 if (ret)452452 return ret;
···9191 write_imipr_3,9292};93939494-static void iop13xx_msi_handler(unsigned int irq, struct irq_desc *desc)9494+static void iop13xx_msi_handler(struct irq_desc *desc)9595{9696 int i, j;9797 unsigned long status;
+2-2
arch/arm/mach-lpc32xx/irq.c
···370370 .irq_set_wake = lpc32xx_irq_wake371371};372372373373-static void lpc32xx_sic1_handler(unsigned int irq, struct irq_desc *desc)373373+static void lpc32xx_sic1_handler(struct irq_desc *desc)374374{375375 unsigned long ints = __raw_readl(LPC32XX_INTC_STAT(LPC32XX_SIC1_BASE));376376···383383 }384384}385385386386-static void lpc32xx_sic2_handler(unsigned int irq, struct irq_desc *desc)386386+static void lpc32xx_sic2_handler(struct irq_desc *desc)387387{388388 unsigned long ints = __raw_readl(LPC32XX_INTC_STAT(LPC32XX_SIC2_BASE));389389
+1-2
arch/arm/mach-netx/generic.c
···6969#define DEBUG_IRQ(fmt...) while (0) {}7070#endif71717272-static void7373-netx_hif_demux_handler(unsigned int irq_unused, struct irq_desc *desc)7272+static void netx_hif_demux_handler(struct irq_desc *desc)7473{7574 unsigned int irq = NETX_IRQ_HIF_CHAINED(0);7675 unsigned int stat;
+1-1
arch/arm/mach-omap1/fpga.c
···8787 fpga_ack_irq(d);8888}89899090-static void innovator_fpga_IRQ_demux(unsigned int irq, struct irq_desc *desc)9090+static void innovator_fpga_IRQ_demux(struct irq_desc *desc)9191{9292 u32 stat;9393 int fpga_irq;
+1-1
arch/arm/mach-omap2/prm_common.c
···102102 * dispatched accordingly. Clearing of the wakeup events should be103103 * done by the SoC specific individual handlers.104104 */105105-static void omap_prcm_irq_handler(unsigned int irq, struct irq_desc *desc)105105+static void omap_prcm_irq_handler(struct irq_desc *desc)106106{107107 unsigned long pending[OMAP_PRCM_MAX_NR_PENDING_REG];108108 unsigned long priority_pending[OMAP_PRCM_MAX_NR_PENDING_REG];
···166166 * ensure that the IRQ signal is deasserted before returning. This167167 * is rather unfortunate.168168 */169169-static void neponset_irq_handler(unsigned int irq, struct irq_desc *desc)169169+static void neponset_irq_handler(struct irq_desc *desc)170170{171171 struct neponset_drvdata *d = irq_desc_get_handler_data(desc);172172 unsigned int irr;
+3-1
arch/arm/mm/dma-mapping.c
···12491249 struct dma_iommu_mapping *mapping = to_dma_iommu_mapping(dev);12501250 unsigned int count = PAGE_ALIGN(size) >> PAGE_SHIFT;12511251 dma_addr_t dma_addr, iova;12521252- int i, ret = DMA_ERROR_CODE;12521252+ int i;1253125312541254 dma_addr = __alloc_iova(mapping, size);12551255 if (dma_addr == DMA_ERROR_CODE)···1257125712581258 iova = dma_addr;12591259 for (i = 0; i < count; ) {12601260+ int ret;12611261+12601262 unsigned int next_pfn = page_to_pfn(pages[i]) + 1;12611263 phys_addr_t phys = page_to_phys(pages[i]);12621264 unsigned int len, j;
···4141 ---help---4242 Provides host support for ARM processors.43434444-config KVM_ARM_MAX_VCPUS4545- int "Number maximum supported virtual CPUs per VM"4646- depends on KVM_ARM_HOST4747- default 44848- help4949- Static number of max supported virtual CPUs per VM.5050-5151- If you choose a high number, the vcpu structures will be quite5252- large, so only choose a reasonable number that you expect to5353- actually use.5454-5544endif # VIRTUALIZATION
···4646 * The builtin Amiga hardware interrupt handlers.4747 */48484949-static void ami_int1(unsigned int irq, struct irq_desc *desc)4949+static void ami_int1(struct irq_desc *desc)5050{5151 unsigned short ints = amiga_custom.intreqr & amiga_custom.intenar;5252···6969 }7070}71717272-static void ami_int3(unsigned int irq, struct irq_desc *desc)7272+static void ami_int3(struct irq_desc *desc)7373{7474 unsigned short ints = amiga_custom.intreqr & amiga_custom.intenar;7575···9292 }9393}94949595-static void ami_int4(unsigned int irq, struct irq_desc *desc)9595+static void ami_int4(struct irq_desc *desc)9696{9797 unsigned short ints = amiga_custom.intreqr & amiga_custom.intenar;9898···121121 }122122}123123124124-static void ami_int5(unsigned int irq, struct irq_desc *desc)124124+static void ami_int5(struct irq_desc *desc)125125{126126 unsigned short ints = amiga_custom.intreqr & amiga_custom.intenar;127127
+2-4
arch/m68k/coldfire/intc-5272.c
···143143 * We need to be careful with the masking/acking due to the side effects144144 * of masking an interrupt.145145 */146146-static void intc_external_irq(unsigned int __irq, struct irq_desc *desc)146146+static void intc_external_irq(struct irq_desc *desc)147147{148148- unsigned int irq = irq_desc_get_irq(desc);149149-150148 irq_desc_get_chip(desc)->irq_ack(&desc->irq_data);151151- handle_simple_irq(irq, desc);149149+ handle_simple_irq(desc);152150}153151154152static struct irq_chip intc_irq_chip = {
+1-2
arch/m68k/include/asm/irq.h
···6464 struct pt_regs *));6565extern void m68k_setup_user_interrupt(unsigned int vec, unsigned int cnt);6666extern void m68k_setup_irq_controller(struct irq_chip *,6767- void (*handle)(unsigned int irq,6868- struct irq_desc *desc),6767+ void (*handle)(struct irq_desc *desc),6968 unsigned int irq, unsigned int cnt);70697170extern unsigned int irq_canonicalize(unsigned int irq);
···4545 * Baboon interrupt handler. This works a lot like a VIA.4646 */47474848-static void baboon_irq(unsigned int irq, struct irq_desc *desc)4848+static void baboon_irq(struct irq_desc *desc)4949{5050 int irq_bit, irq_num;5151 unsigned char events;
+2-2
arch/m68k/mac/oss.c
···6363 * Handle miscellaneous OSS interrupts.6464 */65656666-static void oss_irq(unsigned int __irq, struct irq_desc *desc)6666+static void oss_irq(struct irq_desc *desc)6767{6868 int events = oss->irq_pending &6969 (OSS_IP_IOPSCC | OSS_IP_SCSI | OSS_IP_IOPISM);···9999 * Unlike the VIA/RBV this is on its own autovector interrupt level.100100 */101101102102-static void oss_nubus_irq(unsigned int irq, struct irq_desc *desc)102102+static void oss_nubus_irq(struct irq_desc *desc)103103{104104 int events, irq_bit, i;105105
+1-1
arch/m68k/mac/psc.c
···113113 * PSC interrupt handler. It's a lot like the VIA interrupt handler.114114 */115115116116-static void psc_irq(unsigned int __irq, struct irq_desc *desc)116116+static void psc_irq(struct irq_desc *desc)117117{118118 unsigned int offset = (unsigned int)irq_desc_get_handler_data(desc);119119 unsigned int irq = irq_desc_get_irq(desc);
+3-3
arch/m68k/mac/via.c
···446446 * via6522.c :-), disable/pending masks added.447447 */448448449449-void via1_irq(unsigned int irq, struct irq_desc *desc)449449+void via1_irq(struct irq_desc *desc)450450{451451 int irq_num;452452 unsigned char irq_bit, events;···467467 } while (events >= irq_bit);468468}469469470470-static void via2_irq(unsigned int irq, struct irq_desc *desc)470470+static void via2_irq(struct irq_desc *desc)471471{472472 int irq_num;473473 unsigned char irq_bit, events;···493493 * VIA2 dispatcher as a fast interrupt handler.494494 */495495496496-void via_nubus_irq(unsigned int irq, struct irq_desc *desc)496496+static void via_nubus_irq(struct irq_desc *desc)497497{498498 int slot_irq;499499 unsigned char slot_bit, events;
···3838#include <asm/udbg.h>3939#include <asm/mmu_context.h>4040#include <asm/epapr_hcalls.h>4141+#include <asm/code-patching.h>41424243#define DBG(fmt...)4344···110109 * This is called very early on the boot process, after a minimal111110 * MMU environment has been set up but before MMU_init is called.112111 */112112+extern unsigned int memset_nocache_branch; /* Insn to be replaced by NOP */113113+113114notrace void __init machine_init(u64 dt_ptr)114115{115116 lockdep_init();116117117118 /* Enable early debugging if any specified (see udbg.h) */118119 udbg_early_init();120120+121121+ patch_instruction((unsigned int *)&memcpy, PPC_INST_NOP);122122+ patch_instruction(&memset_nocache_branch, PPC_INST_NOP);119123120124 /* Do some early initialization based on the flat device tree */121125 early_init_devtree(__va(dt_ptr));
···7373 * Use dcbz on the complete cache lines in the destination7474 * to set them to zero. This requires that the destination7575 * area is cacheable. -- paulus7676+ *7777+ * During early init, cache might not be active yet, so dcbz cannot be used.7878+ * We therefore skip the optimised bloc that uses dcbz. This jump is7979+ * replaced by a nop once cache is active. This is done in machine_init()7680 */7781_GLOBAL(memset)7882 rlwimi r4,r4,8,16,23···9288 subf r6,r0,r69389 cmplwi 0,r4,09490 bne 2f /* Use normal procedure if r4 is not zero */9191+_GLOBAL(memset_nocache_branch)9292+ b 2f /* Skip optimised bloc until cache is enabled */95939694 clrlwi r7,r6,32-LG_CACHELINE_BYTES9795 add r8,r7,r5···134128 * the destination area is cacheable.135129 * We only use this version if the source and dest don't overlap.136130 * -- paulus.131131+ *132132+ * During early init, cache might not be active yet, so dcbz cannot be used.133133+ * We therefore jump to generic_memcpy which doesn't use dcbz. This jump is134134+ * replaced by a nop once cache is active. This is done in machine_init()137135 */138136_GLOBAL(memmove)139137 cmplw 0,r3,r4···145135 /* fall through */146136147137_GLOBAL(memcpy)138138+ b generic_memcpy148139 add r7,r3,r5 /* test if the src & dst overlap */149140 add r8,r4,r5150141 cmplw 0,r4,r7
+2-1
arch/powerpc/mm/hugepage-hash64.c
···8585 BUG_ON(index >= 4096);86868787 vpn = hpt_vpn(ea, vsid, ssize);8888- hash = hpt_hash(vpn, shift, ssize);8988 hpte_slot_array = get_hpte_slot_array(pmdp);9089 if (psize == MMU_PAGE_4K) {9190 /*···100101 valid = hpte_valid(hpte_slot_array, index);101102 if (valid) {102103 /* update the hpte bits */104104+ hash = hpt_hash(vpn, shift, ssize);103105 hidx = hpte_hash_index(hpte_slot_array, index);104106 if (hidx & _PTEIDX_SECONDARY)105107 hash = ~hash;···126126 if (!valid) {127127 unsigned long hpte_group;128128129129+ hash = hpt_hash(vpn, shift, ssize);129130 /* insert new entry */130131 pa = pmd_pfn(__pmd(old_pmd)) << PAGE_SHIFT;131132 new_pmd |= _PAGE_HASHPTE;
+3-2
arch/powerpc/platforms/512x/mpc5121_ads_cpld.c
···104104 return irq_linear_revmap(cpld_pic_host, cpld_irq);105105}106106107107-static void108108-cpld_pic_cascade(unsigned int irq, struct irq_desc *desc)107107+static void cpld_pic_cascade(struct irq_desc *desc)109108{109109+ unsigned int irq;110110+110111 irq = cpld_pic_get_irq(0, PCI_IGNORE, &cpld_regs->pci_status,111112 &cpld_regs->pci_mask);112113 if (irq != NO_IRQ) {
···20492049 struct iommu_table *tbl = NULL;20502050 long rc;2051205120522052+ /*20532053+ * crashkernel= specifies the kdump kernel's maximum memory at20542054+ * some offset and there is no guaranteed the result is a power20552055+ * of 2, which will cause errors later.20562056+ */20572057+ const u64 max_memory = __rounddown_pow_of_two(memory_hotplug_max());20582058+20592059+ /*20602060+ * In memory constrained environments, e.g. kdump kernel, the20612061+ * DMA window can be larger than available memory, which will20622062+ * cause errors later.20632063+ */20642064+ const u64 window_size = min((u64)pe->table_group.tce32_size, max_memory);20652065+20522066 rc = pnv_pci_ioda2_create_table(&pe->table_group, 0,20532067 IOMMU_PAGE_SHIFT_4K,20542054- pe->table_group.tce32_size,20682068+ window_size,20552069 POWERNV_IOMMU_DEFAULT_LEVELS, &tbl);20562070 if (rc) {20572071 pe_err(pe, "Failed to create 32-bit TCE table, err %ld",
···5454 if (hw_irq == XICS_IPI || hw_irq == XICS_IRQ_SPURIOUS)5555 return;56565757- server = xics_get_irq_server(d->irq, d->affinity, 0);5757+ server = xics_get_irq_server(d->irq, irq_data_get_affinity_mask(d), 0);5858 server = ics_opal_mangle_server(server);59596060 rc = opal_set_xive(hw_irq, server, DEFAULT_PRIORITY);
+1-1
arch/powerpc/sysdev/xics/ics-rtas.c
···4747 if (hw_irq == XICS_IPI || hw_irq == XICS_IRQ_SPURIOUS)4848 return;49495050- server = xics_get_irq_server(d->irq, d->affinity, 0);5050+ server = xics_get_irq_server(d->irq, irq_data_get_affinity_mask(d), 0);51515252 call_status = rtas_call(ibm_set_xive, 3, 1, NULL, hw_irq, server,5353 DEFAULT_PRIORITY);
+1-1
arch/powerpc/sysdev/xilinx_intc.c
···222222/*223223 * Support code for cascading to 8259 interrupt controllers224224 */225225-static void xilinx_i8259_cascade(unsigned int irq, struct irq_desc *desc)225225+static void xilinx_i8259_cascade(struct irq_desc *desc)226226{227227 struct irq_chip *chip = irq_desc_get_chip(desc);228228 unsigned int cascade_irq = i8259_irq();
-5
arch/s390/configs/zfcpdump_defconfig
···11# CONFIG_SWAP is not set22CONFIG_NO_HZ=y33CONFIG_HIGH_RES_TIMERS=y44-CONFIG_RCU_FAST_NO_HZ=y54CONFIG_BLK_DEV_INITRD=y65CONFIG_CC_OPTIMIZE_FOR_SIZE=y76# CONFIG_COMPAT_BRK is not set···5354# CONFIG_MONWRITER is not set5455# CONFIG_S390_VMUR is not set5556# CONFIG_HID is not set5656-CONFIG_MEMSTICK=y5757-CONFIG_MEMSTICK_DEBUG=y5858-CONFIG_MEMSTICK_UNSAFE_RESUME=y5959-CONFIG_MSPRO_BLOCK=y6057# CONFIG_IOMMU_SUPPORT is not set6158CONFIG_EXT2_FS=y6259CONFIG_EXT3_FS=y
···11911191 clg %r9,BASED(.Lcleanup_save_fpu_fpc_end)11921192 jhe 1f11931193 lg %r2,__LC_CURRENT11941194+ aghi %r2,__TASK_thread119411950: # Store floating-point controls11951196 stfpc __THREAD_FPU_fpc(%r2)119611971: # Load register save area and check if VX is active···12531252 clg %r9,BASED(.Lcleanup_load_fpu_regs_vx_ctl)12541253 jhe 6f12551254 lg %r4,__LC_CURRENT12551255+ aghi %r4,__TASK_thread12561256 lfpc __THREAD_FPU_fpc(%r4)12571257 tm __THREAD_FPU_flags+3(%r4),FPU_USE_VX # VX-enabled task ?12581258 lg %r4,__THREAD_FPU_regs(%r4) # %r4 <- reg save area
+8-4
arch/s390/kernel/perf_cpum_cf.c
···157157158158 cpuhw = &get_cpu_var(cpu_hw_events);159159160160- /* check authorization for cpu counter sets */160160+ /* Check authorization for cpu counter sets.161161+ * If the particular CPU counter set is not authorized,162162+ * return with -ENOENT in order to fall back to other163163+ * PMUs that might suffice the event request.164164+ */161165 ctrs_state = cpumf_state_ctl[hwc->config_base];162166 if (!(ctrs_state & cpuhw->info.auth_ctl))163163- err = -EPERM;167167+ err = -ENOENT;164168165169 put_cpu_var(cpu_hw_events);166170 return err;···540536 */541537 if (!(cpuhw->flags & PERF_EVENT_TXN))542538 if (validate_ctr_auth(&event->hw))543543- return -EPERM;539539+ return -ENOENT;544540545541 ctr_set_enable(&cpuhw->state, event->hw.config_base);546542 event->hw.state = PERF_HES_UPTODATE | PERF_HES_STOPPED;···615611 state = cpuhw->state & ~((1 << CPUMF_LCCTL_ENABLE_SHIFT) - 1);616612 state >>= CPUMF_LCCTL_ENABLE_SHIFT;617613 if ((state & cpuhw->info.auth_ctl) != state)618618- return -EPERM;614614+ return -ENOENT;619615620616 cpuhw->flags &= ~PERF_EVENT_TXN;621617 perf_pmu_enable(pmu);
+3-35
arch/s390/kernel/swsusp.S
···3030 aghi %r15,-STACK_FRAME_OVERHEAD3131 stg %r1,__SF_BACKCHAIN(%r15)32323333+ /* Store FPU registers */3434+ brasl %r14,save_fpu_regs3535+3336 /* Deactivate DAT */3437 stnsm __SF_EMPTY(%r15),0xfb3538···50475148 /* Store registers */5249 mvc 0x318(4,%r1),__SF_EMPTY(%r15) /* move prefix to lowcore */5353- stfpc 0x31c(%r1) /* store fpu control */5454- std 0,0x200(%r1) /* store f0 */5555- std 1,0x208(%r1) /* store f1 */5656- std 2,0x210(%r1) /* store f2 */5757- std 3,0x218(%r1) /* store f3 */5858- std 4,0x220(%r1) /* store f4 */5959- std 5,0x228(%r1) /* store f5 */6060- std 6,0x230(%r1) /* store f6 */6161- std 7,0x238(%r1) /* store f7 */6262- std 8,0x240(%r1) /* store f8 */6363- std 9,0x248(%r1) /* store f9 */6464- std 10,0x250(%r1) /* store f10 */6565- std 11,0x258(%r1) /* store f11 */6666- std 12,0x260(%r1) /* store f12 */6767- std 13,0x268(%r1) /* store f13 */6868- std 14,0x270(%r1) /* store f14 */6969- std 15,0x278(%r1) /* store f15 */7050 stam %a0,%a15,0x340(%r1) /* store access registers */7151 stctg %c0,%c15,0x380(%r1) /* store control registers */7252 stmg %r0,%r15,0x280(%r1) /* store general registers */···234248235249 lctlg %c0,%c15,0x380(%r13) /* load control registers */236250 lam %a0,%a15,0x340(%r13) /* load access registers */237237-238238- lfpc 0x31c(%r13) /* load fpu control */239239- ld 0,0x200(%r13) /* load f0 */240240- ld 1,0x208(%r13) /* load f1 */241241- ld 2,0x210(%r13) /* load f2 */242242- ld 3,0x218(%r13) /* load f3 */243243- ld 4,0x220(%r13) /* load f4 */244244- ld 5,0x228(%r13) /* load f5 */245245- ld 6,0x230(%r13) /* load f6 */246246- ld 7,0x238(%r13) /* load f7 */247247- ld 8,0x240(%r13) /* load f8 */248248- ld 9,0x248(%r13) /* load f9 */249249- ld 10,0x250(%r13) /* load f10 */250250- ld 11,0x258(%r13) /* load f11 */251251- ld 12,0x260(%r13) /* load f12 */252252- ld 13,0x268(%r13) /* load f13 */253253- ld 14,0x270(%r13) /* load f14 */254254- ld 15,0x278(%r13) /* load f15 */255251256252 /* Load old stack */257253 lg %r15,0x2f8(%r13)
···5656 .irq_unmask = hd64461_unmask_irq,5757};58585959-static void hd64461_irq_demux(unsigned int irq, struct irq_desc *desc)5959+static void hd64461_irq_demux(struct irq_desc *desc)6060{6161 unsigned short intv = __raw_readw(HD64461_NIRR);6262 unsigned int ext_irq = HD64461_IRQBASE;
+1-1
arch/sparc/kernel/leon_kernel.c
···5353}54545555/* Handle one or multiple IRQs from the extended interrupt controller */5656-static void leon_handle_ext_irq(unsigned int irq, struct irq_desc *desc)5656+static void leon_handle_ext_irq(struct irq_desc *desc)5757{5858 unsigned int eirq;5959 struct irq_bucket *p;
+1-1
arch/sparc/kernel/leon_pci_grpci1.c
···357357};358358359359/* Handle one or multiple IRQs from the PCI core */360360-static void grpci1_pci_flow_irq(unsigned int irq, struct irq_desc *desc)360360+static void grpci1_pci_flow_irq(struct irq_desc *desc)361361{362362 struct grpci1_priv *priv = grpci1priv;363363 int i, ack = 0;
+1-1
arch/sparc/kernel/leon_pci_grpci2.c
···498498};499499500500/* Handle one or multiple IRQs from the PCI core */501501-static void grpci2_pci_flow_irq(unsigned int irq, struct irq_desc *desc)501501+static void grpci2_pci_flow_irq(struct irq_desc *desc)502502{503503 struct grpci2_priv *priv = grpci2priv;504504 int i, ack = 0;
+2-3
arch/tile/kernel/pci_gx.c
···304304 * to Linux which just calls handle_level_irq() after clearing the305305 * MAC INTx Assert status bit associated with this interrupt.306306 */307307-static void trio_handle_level_irq(unsigned int __irq, struct irq_desc *desc)307307+static void trio_handle_level_irq(struct irq_desc *desc)308308{309309 struct pci_controller *controller = irq_desc_get_handler_data(desc);310310 gxio_trio_context_t *trio_context = controller->trio;311311 uint64_t intx = (uint64_t)irq_desc_get_chip_data(desc);312312- unsigned int irq = irq_desc_get_irq(desc);313312 int mac = controller->mac;314313 unsigned int reg_offset;315314 uint64_t level_mask;316315317317- handle_level_irq(irq, desc);316316+ handle_level_irq(desc);318317319318 /*320319 * Clear the INTx Level status, otherwise future interrupts are
+1-1
arch/unicore32/kernel/irq.c
···112112 * irq_controller_lock held, and IRQs disabled. Decode the IRQ113113 * and call the handler.114114 */115115-static void puv3_gpio_handler(unsigned int __irq, struct irq_desc *desc)115115+static void puv3_gpio_handler(struct irq_desc *desc)116116{117117 unsigned int mask, irq;118118
···10151015 * This is the Guest timer interrupt handler (hardware interrupt 0). We just10161016 * call the clockevent infrastructure and it does whatever needs doing.10171017 */10181018-static void lguest_time_irq(unsigned int irq, struct irq_desc *desc)10181018+static void lguest_time_irq(struct irq_desc *desc)10191019{10201020 unsigned long flags;10211021
···682682 struct dev_pm_opp *opp;683683 int i, uv;684684685685+ rcu_read_lock();686686+685687 opp = dev_pm_opp_find_freq_ceil(td->soc->dev, &rate);686686- if (IS_ERR(opp))688688+ if (IS_ERR(opp)) {689689+ rcu_read_unlock();687690 return PTR_ERR(opp);691691+ }688692 uv = dev_pm_opp_get_voltage(opp);693693+694694+ rcu_read_unlock();689695690696 for (i = 0; i < td->i2c_lut_size; i++) {691697 if (regulator_list_voltage(td->vdd_reg, td->i2c_lut[i]) == uv)
+1-2
drivers/cpufreq/acpi-cpufreq.c
···375375376376 pr_debug("get_cur_freq_on_cpu (%d)\n", cpu);377377378378- policy = cpufreq_cpu_get(cpu);378378+ policy = cpufreq_cpu_get_raw(cpu);379379 if (unlikely(!policy))380380 return 0;381381382382 data = policy->driver_data;383383- cpufreq_cpu_put(policy);384383 if (unlikely(!data || !data->freq_table))385384 return 0;386385
+2-2
drivers/cpufreq/cpufreq.c
···238238}239239EXPORT_SYMBOL_GPL(cpufreq_generic_init);240240241241-/* Only for cpufreq core internal use */242242-static struct cpufreq_policy *cpufreq_cpu_get_raw(unsigned int cpu)241241+struct cpufreq_policy *cpufreq_cpu_get_raw(unsigned int cpu)243242{244243 struct cpufreq_policy *policy = per_cpu(cpufreq_cpu_data, cpu);245244246245 return policy && cpumask_test_cpu(cpu, policy->cpus) ? policy : NULL;247246}247247+EXPORT_SYMBOL_GPL(cpufreq_cpu_get_raw);248248249249unsigned int cpufreq_generic_get(unsigned int cpu)250250{
+6-6
drivers/devfreq/devfreq.c
···5353{5454 struct devfreq *tmp_devfreq;55555656- if (unlikely(IS_ERR_OR_NULL(dev))) {5656+ if (IS_ERR_OR_NULL(dev)) {5757 pr_err("DEVFREQ: %s: Invalid parameters\n", __func__);5858 return ERR_PTR(-EINVAL);5959 }···133133{134134 struct devfreq_governor *tmp_governor;135135136136- if (unlikely(IS_ERR_OR_NULL(name))) {136136+ if (IS_ERR_OR_NULL(name)) {137137 pr_err("DEVFREQ: %s: Invalid parameters\n", __func__);138138 return ERR_PTR(-EINVAL);139139 }···177177 return err;178178179179 /*180180- * Adjust the freuqency with user freq and QoS.180180+ * Adjust the frequency with user freq and QoS.181181 *182182- * List from the highest proiority183183- * max_freq (probably called by thermal when it's too hot)182182+ * List from the highest priority183183+ * max_freq184184 * min_freq185185 */186186···482482 devfreq->profile->max_state *483483 devfreq->profile->max_state,484484 GFP_KERNEL);485485- devfreq->time_in_state = devm_kzalloc(dev, sizeof(unsigned int) *485485+ devfreq->time_in_state = devm_kzalloc(dev, sizeof(unsigned long) *486486 devfreq->profile->max_state,487487 GFP_KERNEL);488488 devfreq->last_stat_updated = jiffies;
···2121static int devfreq_simple_ondemand_func(struct devfreq *df,2222 unsigned long *freq)2323{2424- struct devfreq_dev_status stat;2525- int err = df->profile->get_dev_status(df->dev.parent, &stat);2424+ int err;2525+ struct devfreq_dev_status *stat;2626 unsigned long long a, b;2727 unsigned int dfso_upthreshold = DFSO_UPTHRESHOLD;2828 unsigned int dfso_downdifferential = DFSO_DOWNDIFFERENCTIAL;2929 struct devfreq_simple_ondemand_data *data = df->data;3030 unsigned long max = (df->max_freq) ? df->max_freq : UINT_MAX;31313232+ err = devfreq_update_stats(df);3233 if (err)3334 return err;3535+3636+ stat = &df->last_status;34373538 if (data) {3639 if (data->upthreshold)···4643 return -EINVAL;47444845 /* Assume MAX if it is going to be divided by zero */4949- if (stat.total_time == 0) {4646+ if (stat->total_time == 0) {5047 *freq = max;5148 return 0;5249 }53505451 /* Prevent overflow */5555- if (stat.busy_time >= (1 << 24) || stat.total_time >= (1 << 24)) {5656- stat.busy_time >>= 7;5757- stat.total_time >>= 7;5252+ if (stat->busy_time >= (1 << 24) || stat->total_time >= (1 << 24)) {5353+ stat->busy_time >>= 7;5454+ stat->total_time >>= 7;5855 }59566057 /* Set MAX if it's busy enough */6161- if (stat.busy_time * 100 >6262- stat.total_time * dfso_upthreshold) {5858+ if (stat->busy_time * 100 >5959+ stat->total_time * dfso_upthreshold) {6360 *freq = max;6461 return 0;6562 }66636764 /* Set MAX if we do not know the initial frequency */6868- if (stat.current_frequency == 0) {6565+ if (stat->current_frequency == 0) {6966 *freq = max;7067 return 0;7168 }72697370 /* Keep the current frequency */7474- if (stat.busy_time * 100 >7575- stat.total_time * (dfso_upthreshold - dfso_downdifferential)) {7676- *freq = stat.current_frequency;7171+ if (stat->busy_time * 100 >7272+ stat->total_time * (dfso_upthreshold - dfso_downdifferential)) {7373+ *freq = stat->current_frequency;7774 return 0;7875 }79768077 /* Set the desired frequency based on the load */8181- a = stat.busy_time;8282- a *= stat.current_frequency;8383- b = div_u64(a, stat.total_time);7878+ a = stat->busy_time;7979+ a *= stat->current_frequency;8080+ b = div_u64(a, stat->total_time);8481 b *= 100;8582 b = div_u64(b, (dfso_upthreshold - dfso_downdifferential / 2));8683 *freq = (unsigned long) b;
+5-3
drivers/devfreq/tegra-devfreq.c
···541541static int tegra_governor_get_target(struct devfreq *devfreq,542542 unsigned long *freq)543543{544544- struct devfreq_dev_status stat;544544+ struct devfreq_dev_status *stat;545545 struct tegra_devfreq *tegra;546546 struct tegra_devfreq_device *dev;547547 unsigned long target_freq = 0;548548 unsigned int i;549549 int err;550550551551- err = devfreq->profile->get_dev_status(devfreq->dev.parent, &stat);551551+ err = devfreq_update_stats(devfreq);552552 if (err)553553 return err;554554555555- tegra = stat.private_data;555555+ stat = &devfreq->last_status;556556+557557+ tegra = stat->private_data;556558557559 for (i = 0; i < ARRAY_SIZE(tegra->devices); i++) {558560 dev = &tegra->devices[i];
+1-1
drivers/dma/ipu/ipu_irq.c
···266266}267267268268/* Chained IRQ handler for IPU function and error interrupt */269269-static void ipu_irq_handler(unsigned int __irq, struct irq_desc *desc)269269+static void ipu_irq_handler(struct irq_desc *desc)270270{271271 struct ipu *ipu = irq_desc_get_handler_data(desc);272272 u32 status;
···305305 * which have been set as summary IRQ lines and which are triggered,306306 * and to call their interrupt handlers.307307 */308308-static void msm_summary_irq_handler(unsigned int irq, struct irq_desc *desc)308308+static void msm_summary_irq_handler(struct irq_desc *desc)309309{310310 unsigned long i;311311 struct irq_chip *chip = irq_desc_get_chip(desc);
···272272}273273274274/* MX1 and MX3 has one interrupt *per* gpio port */275275-static void mx3_gpio_irq_handler(u32 irq, struct irq_desc *desc)275275+static void mx3_gpio_irq_handler(struct irq_desc *desc)276276{277277 u32 irq_stat;278278 struct mxc_gpio_port *port = irq_desc_get_handler_data(desc);···288288}289289290290/* MX2 has one interrupt *for all* gpio ports */291291-static void mx2_gpio_irq_handler(u32 irq, struct irq_desc *desc)291291+static void mx2_gpio_irq_handler(struct irq_desc *desc)292292{293293 u32 irq_msk, irq_stat;294294 struct mxc_gpio_port *port;
+1-1
drivers/gpio/gpio-mxs.c
···154154}155155156156/* MXS has one interrupt *per* gpio port */157157-static void mxs_gpio_irq_handler(u32 irq, struct irq_desc *desc)157157+static void mxs_gpio_irq_handler(struct irq_desc *desc)158158{159159 u32 irq_stat;160160 struct mxs_gpio_port *port = irq_desc_get_handler_data(desc);
+1-1
drivers/gpio/gpio-omap.c
···709709 * line's interrupt handler has been run, we may miss some nested710710 * interrupts.711711 */712712-static void omap_gpio_irq_handler(unsigned int irq, struct irq_desc *desc)712712+static void omap_gpio_irq_handler(struct irq_desc *desc)713713{714714 void __iomem *isr_reg = NULL;715715 u32 isr;
+1-1
drivers/gpio/gpio-pl061.c
···187187 return 0;188188}189189190190-static void pl061_irq_handler(unsigned irq, struct irq_desc *desc)190190+static void pl061_irq_handler(struct irq_desc *desc)191191{192192 unsigned long pending;193193 int offset;
···172172 * irq_controller_lock held, and IRQs disabled. Decode the IRQ173173 * and call the handler.174174 */175175-static void176176-sa1100_gpio_handler(unsigned int __irq, struct irq_desc *desc)175175+static void sa1100_gpio_handler(struct irq_desc *desc)177176{178177 unsigned int irq, mask;179178
+1-1
drivers/gpio/gpio-tegra.c
···266266 gpiochip_unlock_as_irq(&tegra_gpio_chip, gpio);267267}268268269269-static void tegra_gpio_irq_handler(unsigned int irq, struct irq_desc *desc)269269+static void tegra_gpio_irq_handler(struct irq_desc *desc)270270{271271 int port;272272 int pin;
···177177 return 0;178178}179179180180-static void zx_irq_handler(unsigned irq, struct irq_desc *desc)180180+static void zx_irq_handler(struct irq_desc *desc)181181{182182 unsigned long pending;183183 int offset;
+1-1
drivers/gpio/gpio-zynq.c
···514514 * application for that pin.515515 * Note: A bug is reported if no handler is set for the gpio pin.516516 */517517-static void zynq_gpio_irqhandler(unsigned int irq, struct irq_desc *desc)517517+static void zynq_gpio_irqhandler(struct irq_desc *desc)518518{519519 u32 int_sts, int_enb;520520 unsigned int bank_num;
···7070 return gic_irq(d) < 32;7171}72727373-static inline bool forwarded_irq(struct irq_data *d)7474-{7575- return d->handler_data != NULL;7676-}7777-7873static inline void __iomem *gic_dist_base(struct irq_data *d)7974{8075 if (gic_irq_in_rdist(d)) /* SGI+PPI -> SGI_base for this CPU */···244249 * disabled/masked will not get "stuck", because there is245250 * noone to deactivate it (guest is being terminated).246251 */247247- if (forwarded_irq(d))252252+ if (irqd_is_forwarded_to_vcpu(d))248253 gic_poke_irq(d, GICD_ICACTIVER);249254}250255···319324 * No need to deactivate an LPI, or an interrupt that320325 * is is getting forwarded to a vcpu.321326 */322322- if (gic_irq(d) >= 8192 || forwarded_irq(d))327327+ if (gic_irq(d) >= 8192 || irqd_is_forwarded_to_vcpu(d))323328 return;324329 gic_write_dir(gic_irq(d));325330}···352357353358static int gic_irq_set_vcpu_affinity(struct irq_data *d, void *vcpu)354359{355355- d->handler_data = vcpu;360360+ if (vcpu)361361+ irqd_set_forwarded_to_vcpu(d);362362+ else363363+ irqd_clr_forwarded_to_vcpu(d);356364 return 0;357365}358366···752754 irq_set_percpu_devid(irq);753755 irq_domain_set_info(d, irq, hw, chip, d->host_data,754756 handle_percpu_devid_irq, NULL, NULL);755755- set_irq_flags(irq, IRQF_VALID | IRQF_NOAUTOEN);757757+ irq_set_status_flags(irq, IRQ_NOAUTOEN);756758 }757759 /* SPIs */758760 if (hw >= 32 && hw < gic_data.irq_nr) {759761 irq_domain_set_info(d, irq, hw, chip, d->host_data,760762 handle_fasteoi_irq, NULL, NULL);761761- set_irq_flags(irq, IRQF_VALID | IRQF_PROBE);763763+ irq_set_probe(irq);762764 }763765 /* LPIs */764766 if (hw >= 8192 && hw < GIC_ID_NR) {···766768 return -EPERM;767769 irq_domain_set_info(d, irq, hw, chip, d->host_data,768770 handle_fasteoi_irq, NULL, NULL);769769- set_irq_flags(irq, IRQF_VALID);770771 }771772772773 return 0;
+52-34
drivers/irqchip/irq-gic.c
···145145 void *data = irq_data_get_irq_handler_data(d);146146147147 /*148148- * If handler_data pointing to one of the secondary GICs, then149149- * this is a cascading interrupt, and it cannot possibly be150150- * forwarded.148148+ * If handler_data is set, this is a cascading interrupt, and149149+ * it cannot possibly be forwarded.151150 */152152- if (data >= (void *)(gic_data + 1) &&153153- data < (void *)(gic_data + MAX_GIC_NR))154154- return true;155155-156156- return false;157157-}158158-159159-static inline bool forwarded_irq(struct irq_data *d)160160-{161161- /*162162- * A forwarded interrupt:163163- * - is on the primary GIC164164- * - has its handler_data set to a value165165- * - that isn't a secondary GIC166166- */167167- if (d->handler_data && !cascading_gic_irq(d))168168- return true;169169-170170- return false;151151+ return data != NULL;171152}172153173154/*···182201 * disabled/masked will not get "stuck", because there is183202 * noone to deactivate it (guest is being terminated).184203 */185185- if (forwarded_irq(d))204204+ if (irqd_is_forwarded_to_vcpu(d))186205 gic_poke_irq(d, GIC_DIST_ACTIVE_CLEAR);187206}188207···199218static void gic_eoimode1_eoi_irq(struct irq_data *d)200219{201220 /* Do not deactivate an IRQ forwarded to a vcpu. */202202- if (forwarded_irq(d))221221+ if (irqd_is_forwarded_to_vcpu(d))203222 return;204223205224 writel_relaxed(gic_irq(d), gic_cpu_base(d) + GIC_CPU_DEACTIVATE);···277296 if (cascading_gic_irq(d))278297 return -EINVAL;279298280280- d->handler_data = vcpu;299299+ if (vcpu)300300+ irqd_set_forwarded_to_vcpu(d);301301+ else302302+ irqd_clr_forwarded_to_vcpu(d);281303 return 0;282304}283305···341357 } while (1);342358}343359344344-static void gic_handle_cascade_irq(unsigned int irq, struct irq_desc *desc)360360+static void gic_handle_cascade_irq(struct irq_desc *desc)345361{346362 struct gic_chip_data *chip_data = irq_desc_get_handler_data(desc);347363 struct irq_chip *chip = irq_desc_get_chip(desc);···360376361377 cascade_irq = irq_find_mapping(chip_data->domain, gic_irq);362378 if (unlikely(gic_irq < 32 || gic_irq > 1020))363363- handle_bad_irq(cascade_irq, desc);379379+ handle_bad_irq(desc);364380 else365381 generic_handle_irq(cascade_irq);366382···890906 irq_set_percpu_devid(irq);891907 irq_domain_set_info(d, irq, hw, chip, d->host_data,892908 handle_percpu_devid_irq, NULL, NULL);893893- set_irq_flags(irq, IRQF_VALID | IRQF_NOAUTOEN);909909+ irq_set_status_flags(irq, IRQ_NOAUTOEN);894910 } else {895911 irq_domain_set_info(d, irq, hw, chip, d->host_data,896912 handle_fasteoi_irq, NULL, NULL);897897- set_irq_flags(irq, IRQF_VALID | IRQF_PROBE);913913+ irq_set_probe(irq);898914 }899915 return 0;900916}···11031119#ifdef CONFIG_OF11041120static int gic_cnt __initdata;1105112111221122+static bool gic_check_eoimode(struct device_node *node, void __iomem **base)11231123+{11241124+ struct resource cpuif_res;11251125+11261126+ of_address_to_resource(node, 1, &cpuif_res);11271127+11281128+ if (!is_hyp_mode_available())11291129+ return false;11301130+ if (resource_size(&cpuif_res) < SZ_8K)11311131+ return false;11321132+ if (resource_size(&cpuif_res) == SZ_128K) {11331133+ u32 val_low, val_high;11341134+11351135+ /*11361136+ * Verify that we have the first 4kB of a GIC40011371137+ * aliased over the first 64kB by checking the11381138+ * GICC_IIDR register on both ends.11391139+ */11401140+ val_low = readl_relaxed(*base + GIC_CPU_IDENT);11411141+ val_high = readl_relaxed(*base + GIC_CPU_IDENT + 0xf000);11421142+ if ((val_low & 0xffff0fff) != 0x0202043B ||11431143+ val_low != val_high)11441144+ return false;11451145+11461146+ /*11471147+ * Move the base up by 60kB, so that we have a 8kB11481148+ * contiguous region, which allows us to use GICC_DIR11491149+ * at its normal offset. Please pass me that bucket.11501150+ */11511151+ *base += 0xf000;11521152+ cpuif_res.start += 0xf000;11531153+ pr_warn("GIC: Adjusting CPU interface base to %pa",11541154+ &cpuif_res.start);11551155+ }11561156+11571157+ return true;11581158+}11591159+11061160static int __init11071161gic_of_init(struct device_node *node, struct device_node *parent)11081162{11091163 void __iomem *cpu_base;11101164 void __iomem *dist_base;11111111- struct resource cpu_res;11121165 u32 percpu_offset;11131166 int irq;11141167···11581137 cpu_base = of_iomap(node, 1);11591138 WARN(!cpu_base, "unable to map gic cpu registers\n");1160113911611161- of_address_to_resource(node, 1, &cpu_res);11621162-11631140 /*11641141 * Disable split EOI/Deactivate if either HYP is not available11651142 * or the CPU interface is too small.11661143 */11671167- if (gic_cnt == 0 && (!is_hyp_mode_available() ||11681168- resource_size(&cpu_res) < SZ_8K))11441144+ if (gic_cnt == 0 && !gic_check_eoimode(node, &cpu_base))11691145 static_key_slow_dec(&supports_deactivate);1170114611711147 if (of_property_read_u32(node, "cpu-offset", &percpu_offset))
···8383 /* nothing to do here */8484}85858686-static void keystone_irq_handler(unsigned __irq, struct irq_desc *desc)8686+static void keystone_irq_handler(struct irq_desc *desc)8787{8888 unsigned int irq = irq_desc_get_irq(desc);8989 struct keystone_irq_device *kirq = irq_desc_get_handler_data(desc);···127127128128 irq_set_chip_data(virq, kirq);129129 irq_set_chip_and_handler(virq, &kirq->chip, handle_level_irq);130130- set_irq_flags(virq, IRQF_VALID | IRQF_PROBE);130130+ irq_set_probe(virq);131131 return 0;132132}133133
+1-1
drivers/irqchip/irq-metag-ext.c
···446446 * Whilst using TR2 to detect external interrupts is a software convention it is447447 * (hopefully) unlikely to change.448448 */449449-static void meta_intc_irq_demux(unsigned int irq, struct irq_desc *desc)449449+static void meta_intc_irq_demux(struct irq_desc *desc)450450{451451 struct meta_intc_priv *priv = &meta_intc_priv;452452 irq_hw_number_t hw;
+1-1
drivers/irqchip/irq-metag.c
···220220 * occurred. It is this function's job to demux this irq and221221 * figure out exactly which trigger needs servicing.222222 */223223-static void metag_internal_irq_demux(unsigned int irq, struct irq_desc *desc)223223+static void metag_internal_irq_demux(struct irq_desc *desc)224224{225225 struct metag_internal_irq_priv *priv = irq_desc_get_handler_data(desc);226226 irq_hw_number_t hw;
···283283static int intc_irqpin_irq_set_wake(struct irq_data *d, unsigned int on)284284{285285 struct intc_irqpin_priv *p = irq_data_get_irq_chip_data(d);286286+ int hw_irq = irqd_to_hwirq(d);287287+288288+ irq_set_irq_wake(p->irq[hw_irq].requested_irq, on);286289287290 if (!p->clk)288291 return 0;···335332 return status;336333}337334335335+/*336336+ * This lock class tells lockdep that INTC External IRQ Pin irqs are in a337337+ * different category than their parents, so it won't report false recursion.338338+ */339339+static struct lock_class_key intc_irqpin_irq_lock_class;340340+338341static int intc_irqpin_irq_domain_map(struct irq_domain *h, unsigned int virq,339342 irq_hw_number_t hw)340343{···351342352343 intc_irqpin_dbg(&p->irq[hw], "map");353344 irq_set_chip_data(virq, h->host_data);345345+ irq_set_lockdep_class(virq, &intc_irqpin_irq_lock_class);354346 irq_set_chip_and_handler(virq, &p->irq_chip, handle_level_irq);355355- set_irq_flags(virq, IRQF_VALID); /* kill me now */356347 return 0;357348}358349
+10
drivers/irqchip/irq-renesas-irqc.c
···121121static int irqc_irq_set_wake(struct irq_data *d, unsigned int on)122122{123123 struct irqc_priv *p = irq_data_get_irq_chip_data(d);124124+ int hw_irq = irqd_to_hwirq(d);125125+126126+ irq_set_irq_wake(p->irq[hw_irq].requested_irq, on);124127125128 if (!p->clk)126129 return 0;···153150 return IRQ_NONE;154151}155152153153+/*154154+ * This lock class tells lockdep that IRQC irqs are in a different155155+ * category than their parents, so it won't report false recursion.156156+ */157157+static struct lock_class_key irqc_irq_lock_class;158158+156159static int irqc_irq_domain_map(struct irq_domain *h, unsigned int virq,157160 irq_hw_number_t hw)158161{···166157167158 irqc_dbg(&p->irq[hw], "map");168159 irq_set_chip_data(virq, h->host_data);160160+ irq_set_lockdep_class(virq, &irqc_irq_lock_class);169161 irq_set_chip_and_handler(virq, &p->irq_chip, handle_level_irq);170162 return 0;171163}
+3-13
drivers/irqchip/irq-s3c24xx.c
···298298 .irq_set_type = s3c_irqext0_type,299299};300300301301-static void s3c_irq_demux(unsigned int __irq, struct irq_desc *desc)301301+static void s3c_irq_demux(struct irq_desc *desc)302302{303303 struct irq_chip *chip = irq_desc_get_chip(desc);304304 struct s3c_irq_data *irq_data = irq_desc_get_chip_data(desc);···466466467467 irq_set_chip_data(virq, irq_data);468468469469- set_irq_flags(virq, IRQF_VALID);470470-471469 if (parent_intc && irq_data->type != S3C_IRQTYPE_NONE) {472470 if (irq_data->parent_irq > 31) {473471 pr_err("irq-s3c24xx: parent irq %lu is out of range\n",474472 irq_data->parent_irq);475475- goto err;473473+ return -EINVAL;476474 }477475478476 parent_irq_data = &parent_intc->irqs[irq_data->parent_irq];···483485 if (!irqno) {484486 pr_err("irq-s3c24xx: could not find mapping for parent irq %lu\n",485487 irq_data->parent_irq);486486- goto err;488488+ return -EINVAL;487489 }488490 irq_set_chained_handler(irqno, s3c_irq_demux);489491 }490492491493 return 0;492492-493493-err:494494- set_irq_flags(virq, 0);495495-496496- /* the only error can result from bad mapping data*/497497- return -EINVAL;498494}499495500496static const struct irq_domain_ops s3c24xx_irq_ops = {···11651173 handle_edge_irq);1166117411671175 irq_set_chip_data(virq, irq_data);11681168-11691169- set_irq_flags(virq, IRQF_VALID);1170117611711177 return 0;11721178}
···182182 &spear320_shirq_intrcomm_ras,183183};184184185185-static void shirq_handler(unsigned __irq, struct irq_desc *desc)185185+static void shirq_handler(struct irq_desc *desc)186186{187187 struct spear_shirq *shirq = irq_desc_get_handler_data(desc);188188 u32 pend;···211211 for (i = 0; i < shirq->nr_irqs; i++) {212212 irq_set_chip_and_handler(shirq->virq_base + i,213213 shirq->irq_chip, handle_simple_irq);214214- set_irq_flags(shirq->virq_base + i, IRQF_VALID);215214 irq_set_chip_data(shirq->virq_base + i, shirq);216215 }217216}
+2-1
drivers/leds/Kconfig
···170170171171config LEDS_IPAQ_MICRO172172 tristate "LED Support for the Compaq iPAQ h3xxx"173173+ depends on LEDS_CLASS173174 depends on MFD_IPAQ_MICRO174175 help175176 Choose this option if you want to use the notification LED on···230229 tristate "Common Driver for TI/National LP5521/5523/55231/5562/8501"231230 depends on LEDS_LP5521 || LEDS_LP5523 || LEDS_LP5562 || LEDS_LP8501232231 select FW_LOADER233233- select FW_LOADER_USER_HELPER_FALLBACK232232+ select FW_LOADER_USER_HELPER234233 help235234 This option supports common operations for LP5521/5523/55231/5562/8501236235 devices.
···185185/*--------------------------------------------------------------------------*/186186187187/* Handle the T7L66XB interrupt mux */188188-static void t7l66xb_irq(unsigned int irq, struct irq_desc *desc)188188+static void t7l66xb_irq(struct irq_desc *desc)189189{190190 struct t7l66xb *t7l66xb = irq_desc_get_handler_data(desc);191191 unsigned int isr;
+1-2
drivers/mfd/tc6393xb.c
···522522523523/*--------------------------------------------------------------------------*/524524525525-static void526526-tc6393xb_irq(unsigned int irq, struct irq_desc *desc)525525+static void tc6393xb_irq(struct irq_desc *desc)527526{528527 struct tc6393xb *tc6393xb = irq_desc_get_handler_data(desc);529528 unsigned int isr;
+1-1
drivers/mfd/ucb1x00-core.c
···282282 * SIBCLK to talk to the chip. We leave the clock running until283283 * we have finished processing all interrupts from the chip.284284 */285285-static void ucb1x00_irq(unsigned int __irq, struct irq_desc *desc)285285+static void ucb1x00_irq(struct irq_desc *desc)286286{287287 struct ucb1x00 *ucb = irq_desc_get_handler_data(desc);288288 unsigned int isr, i;
···48484949 phb = pci_bus_to_host(dev->bus);5050 afu = (struct cxl_afu *)phb->private_data;5151+5252+ if (!cxl_adapter_link_ok(afu->adapter)) {5353+ dev_warn(&dev->dev, "%s: Device link is down, refusing to enable AFU\n", __func__);5454+ return false;5555+ }5656+5157 set_dma_ops(&dev->dev, &dma_direct_ops);5258 set_dma_offset(&dev->dev, PAGE_OFFSET);5359
+4-2
drivers/net/ethernet/mellanox/mlx4/en_rx.c
···1047104710481048 /* If we used up all the quota - we're probably not done yet... */10491049 if (done == budget) {10501050- int cpu_curr;10511050 const struct cpumask *aff;10511051+ struct irq_data *idata;10521052+ int cpu_curr;1052105310531054 INC_PERF_COUNTER(priv->pstats.napi_quota);1054105510551056 cpu_curr = smp_processor_id();10561056- aff = irq_desc_get_irq_data(cq->irq_desc)->affinity;10571057+ idata = irq_desc_get_irq_data(cq->irq_desc);10581058+ aff = irq_data_get_affinity_mask(idata);1057105910581060 if (likely(cpumask_test_cpu(cpu_curr, aff)))10591061 return budget;
···16791679 * Use this if you have a separate interrupt for each16801680 * pinctrl-single instance.16811681 */16821682-static void pcs_irq_chain_handler(unsigned int irq, struct irq_desc *desc)16821682+static void pcs_irq_chain_handler(struct irq_desc *desc)16831683{16841684 struct pcs_soc_data *pcs_soc = irq_desc_get_handler_data(desc);16851685 struct irq_chip *chip;
···9999 */100100static inline void activate_irq(int irq)101101{102102-#ifdef CONFIG_ARM103103- /* ARM requires an extra step to clear IRQ_NOREQUEST, which it104104- * sets on behalf of every irq_chip. Also sets IRQ_NOPROBE.105105- */106106- set_irq_flags(irq, IRQF_VALID);107107-#else108108- /* same effect on other architectures */109109- irq_set_noprobe(irq);110110-#endif102102+ irq_modify_status(irq, IRQ_NOREQUEST, IRQ_NOPROBE);111103}112104113105static inline int intc_handle_int_cmp(const void *a, const void *b)
···12421242 goto out_clear;12431243 }12441244 bd_set_size(bdev, (loff_t)bdev->bd_part->nr_sects << 9);12451245+ /*12461246+ * If the partition is not aligned on a page12471247+ * boundary, we can't do dax I/O to it.12481248+ */12491249+ if ((bdev->bd_part->start_sect % (PAGE_SIZE / 512)) ||12501250+ (bdev->bd_part->nr_sects % (PAGE_SIZE / 512)))12511251+ bdev->bd_inode->i_flags &= ~S_DAX;12451252 }12461253 } else {12471254 if (bdev->bd_contains == bdev) {
···14811481 wbc_detach_inode(&wbc);14821482 work->nr_pages -= write_chunk - wbc.nr_to_write;14831483 wrote += write_chunk - wbc.nr_to_write;14841484+14851485+ if (need_resched()) {14861486+ /*14871487+ * We're trying to balance between building up a nice14881488+ * long list of IOs to improve our merge rate, and14891489+ * getting those IOs out quickly for anyone throttling14901490+ * in balance_dirty_pages(). cond_resched() doesn't14911491+ * unplug, so get our IOs out the door before we14921492+ * give up the CPU.14931493+ */14941494+ blk_flush_plug(current);14951495+ cond_resched();14961496+ }14971497+14981498+14841499 spin_lock(&wb->list_lock);14851500 spin_lock(&inode->i_lock);14861501 if (!(inode->i_state & I_DIRTY_ALL))···15031488 requeue_inode(inode, wb, &wbc);15041489 inode_sync_complete(inode);15051490 spin_unlock(&inode->i_lock);15061506- cond_resched_lock(&wb->list_lock);14911491+15071492 /*15081493 * bail out to wb_writeback() often enough to check15091494 * background threshold and other termination conditions.
+2-2
include/acpi/button.h
···3344#include <linux/notifier.h>5566-#if defined(CONFIG_ACPI_BUTTON) || defined(CONFIG_ACPI_BUTTON_MODULE)66+#if IS_ENABLED(CONFIG_ACPI_BUTTON)77extern int acpi_lid_notifier_register(struct notifier_block *nb);88extern int acpi_lid_notifier_unregister(struct notifier_block *nb);99extern int acpi_lid_open(void);···2020{2121 return 1;2222}2323-#endif /* defined(CONFIG_ACPI_BUTTON) || defined(CONFIG_ACPI_BUTTON_MODULE) */2323+#endif /* IS_ENABLED(CONFIG_ACPI_BUTTON) */24242525#endif /* ACPI_BUTTON_H */
+1-1
include/acpi/video.h
···2424 acpi_backlight_native,2525};26262727-#if (defined CONFIG_ACPI_VIDEO || defined CONFIG_ACPI_VIDEO_MODULE)2727+#if IS_ENABLED(CONFIG_ACPI_VIDEO)2828extern int acpi_video_register(void);2929extern void acpi_video_unregister(void);3030extern int acpi_video_get_edid(struct acpi_device *device, int type,
+1-1
include/asm-generic/memory_model.h
···7373 * Convert a physical address to a Page Frame Number and back7474 */7575#define __phys_to_pfn(paddr) ((unsigned long)((paddr) >> PAGE_SHIFT))7676-#define __pfn_to_phys(pfn) ((pfn) << PAGE_SHIFT)7676+#define __pfn_to_phys(pfn) PFN_PHYS(pfn)77777878#define page_to_pfn __page_to_pfn7979#define pfn_to_page __pfn_to_page
+1-5
include/kvm/arm_vgic.h
···3535#define VGIC_V3_MAX_LRS 163636#define VGIC_MAX_IRQS 10243737#define VGIC_V2_MAX_CPUS 83838-3939-/* Sanity checks... */4040-#if (KVM_MAX_VCPUS > 255)4141-#error Too many KVM VCPUs, the VGIC only supports up to 255 VCPUs for now4242-#endif3838+#define VGIC_V3_MAX_CPUS 25543394440#if (VGIC_NR_IRQS_LEGACY & 31)4541#error "VGIC_NR_IRQS must be a multiple of 32"
···473473 unsigned int depends_on;474474};475475476476-extern struct percpu_rw_semaphore cgroup_threadgroup_rwsem;477477-478478-/**479479- * cgroup_threadgroup_change_begin - threadgroup exclusion for cgroups480480- * @tsk: target task481481- *482482- * Called from threadgroup_change_begin() and allows cgroup operations to483483- * synchronize against threadgroup changes using a percpu_rw_semaphore.484484- */485485-static inline void cgroup_threadgroup_change_begin(struct task_struct *tsk)486486-{487487- percpu_down_read(&cgroup_threadgroup_rwsem);488488-}489489-490490-/**491491- * cgroup_threadgroup_change_end - threadgroup exclusion for cgroups492492- * @tsk: target task493493- *494494- * Called from threadgroup_change_end(). Counterpart of495495- * cgroup_threadcgroup_change_begin().496496- */497497-static inline void cgroup_threadgroup_change_end(struct task_struct *tsk)498498-{499499- percpu_up_read(&cgroup_threadgroup_rwsem);500500-}476476+void cgroup_threadgroup_change_begin(struct task_struct *tsk);477477+void cgroup_threadgroup_change_end(struct task_struct *tsk);501478502479#else /* CONFIG_CGROUPS */503480
+5
include/linux/cpufreq.h
···127127#define CPUFREQ_SHARED_TYPE_ANY (3) /* Freq can be set from any dependent CPU*/128128129129#ifdef CONFIG_CPU_FREQ130130+struct cpufreq_policy *cpufreq_cpu_get_raw(unsigned int cpu);130131struct cpufreq_policy *cpufreq_cpu_get(unsigned int cpu);131132void cpufreq_cpu_put(struct cpufreq_policy *policy);132133#else134134+static inline struct cpufreq_policy *cpufreq_cpu_get_raw(unsigned int cpu)135135+{136136+ return NULL;137137+}133138static inline struct cpufreq_policy *cpufreq_cpu_get(unsigned int cpu)134139{135140 return NULL;
+23-1
include/linux/devfreq.h
···6565 * The "flags" parameter's possible values are6666 * explained above with "DEVFREQ_FLAG_*" macros.6767 * @get_dev_status: The device should provide the current performance6868- * status to devfreq, which is used by governors.6868+ * status to devfreq. Governors are recommended not to6969+ * use this directly. Instead, governors are recommended7070+ * to use devfreq_update_stats() along with7171+ * devfreq.last_status.6972 * @get_cur_freq: The device should provide the current frequency7073 * at which it is operating.7174 * @exit: An optional callback that is called when devfreq···164161 struct delayed_work work;165162166163 unsigned long previous_freq;164164+ struct devfreq_dev_status last_status;167165168166 void *data; /* private data for governors */169167···207203 struct devfreq *devfreq);208204extern void devm_devfreq_unregister_opp_notifier(struct device *dev,209205 struct devfreq *devfreq);206206+207207+/**208208+ * devfreq_update_stats() - update the last_status pointer in struct devfreq209209+ * @df: the devfreq instance whose status needs updating210210+ *211211+ * Governors are recommended to use this function along with last_status,212212+ * which allows other entities to reuse the last_status without affecting213213+ * the values fetched later by governors.214214+ */215215+static inline int devfreq_update_stats(struct devfreq *df)216216+{217217+ return df->profile->get_dev_status(df->dev.parent, &df->last_status);218218+}210219211220#if IS_ENABLED(CONFIG_DEVFREQ_GOV_SIMPLE_ONDEMAND)212221/**···305288static inline void devm_devfreq_unregister_opp_notifier(struct device *dev,306289 struct devfreq *devfreq)307290{291291+}292292+293293+static inline int devfreq_update_stats(struct devfreq *df)294294+{295295+ return -EINVAL;308296}309297#endif /* CONFIG_PM_DEVFREQ */310298
···762762 unsigned audit_tty_log_passwd;763763 struct tty_audit_buf *tty_audit_buf;764764#endif765765+#ifdef CONFIG_CGROUPS766766+ /*767767+ * group_rwsem prevents new tasks from entering the threadgroup and768768+ * member tasks from exiting,a more specifically, setting of769769+ * PF_EXITING. fork and exit paths are protected with this rwsem770770+ * using threadgroup_change_begin/end(). Users which require771771+ * threadgroup to remain stable should use threadgroup_[un]lock()772772+ * which also takes care of exec path. Currently, cgroup is the773773+ * only user.774774+ */775775+ struct rw_semaphore group_rwsem;776776+#endif765777766778 oom_flags_t oom_flags;767779 short oom_score_adj; /* OOM kill score adjustment */
···4646#include <linux/slab.h>4747#include <linux/spinlock.h>4848#include <linux/rwsem.h>4949-#include <linux/percpu-rwsem.h>5049#include <linux/string.h>5150#include <linux/sort.h>5251#include <linux/kmod.h>···102103 * cgroup_mutex. Reading requires either cgroup_mutex or this spinlock.103104 */104105static DEFINE_SPINLOCK(release_agent_path_lock);105105-106106-struct percpu_rw_semaphore cgroup_threadgroup_rwsem;107106108107#define cgroup_assert_mutex_or_rcu_locked() \109108 RCU_LOCKDEP_WARN(!rcu_read_lock_held() && \···869872 up_write(&css_set_rwsem);870873871874 return cset;875875+}876876+877877+void cgroup_threadgroup_change_begin(struct task_struct *tsk)878878+{879879+ down_read(&tsk->signal->group_rwsem);880880+}881881+882882+void cgroup_threadgroup_change_end(struct task_struct *tsk)883883+{884884+ up_read(&tsk->signal->group_rwsem);885885+}886886+887887+/**888888+ * threadgroup_lock - lock threadgroup889889+ * @tsk: member task of the threadgroup to lock890890+ *891891+ * Lock the threadgroup @tsk belongs to. No new task is allowed to enter892892+ * and member tasks aren't allowed to exit (as indicated by PF_EXITING) or893893+ * change ->group_leader/pid. This is useful for cases where the threadgroup894894+ * needs to stay stable across blockable operations.895895+ *896896+ * fork and exit explicitly call threadgroup_change_{begin|end}() for897897+ * synchronization. While held, no new task will be added to threadgroup898898+ * and no existing live task will have its PF_EXITING set.899899+ *900900+ * de_thread() does threadgroup_change_{begin|end}() when a non-leader901901+ * sub-thread becomes a new leader.902902+ */903903+static void threadgroup_lock(struct task_struct *tsk)904904+{905905+ down_write(&tsk->signal->group_rwsem);906906+}907907+908908+/**909909+ * threadgroup_unlock - unlock threadgroup910910+ * @tsk: member task of the threadgroup to unlock911911+ *912912+ * Reverse threadgroup_lock().913913+ */914914+static inline void threadgroup_unlock(struct task_struct *tsk)915915+{916916+ up_write(&tsk->signal->group_rwsem);872917}873918874919static struct cgroup_root *cgroup_root_from_kf(struct kernfs_root *kf_root)···21132074 lockdep_assert_held(&css_set_rwsem);2114207521152076 /*21162116- * We are synchronized through cgroup_threadgroup_rwsem against21172117- * PF_EXITING setting such that we can't race against cgroup_exit()21182118- * changing the css_set to init_css_set and dropping the old one.20772077+ * We are synchronized through threadgroup_lock() against PF_EXITING20782078+ * setting such that we can't race against cgroup_exit() changing the20792079+ * css_set to init_css_set and dropping the old one.21192080 */21202081 WARN_ON_ONCE(tsk->flags & PF_EXITING);21212082 old_cset = task_css_set(tsk);···21722133 * @src_cset and add it to @preloaded_csets, which should later be cleaned21732134 * up by cgroup_migrate_finish().21742135 *21752175- * This function may be called without holding cgroup_threadgroup_rwsem21762176- * even if the target is a process. Threads may be created and destroyed21772177- * but as long as cgroup_mutex is not dropped, no new css_set can be put21782178- * into play and the preloaded css_sets are guaranteed to cover all21792179- * migrations.21362136+ * This function may be called without holding threadgroup_lock even if the21372137+ * target is a process. Threads may be created and destroyed but as long21382138+ * as cgroup_mutex is not dropped, no new css_set can be put into play and21392139+ * the preloaded css_sets are guaranteed to cover all migrations.21802140 */21812141static void cgroup_migrate_add_src(struct css_set *src_cset,21822142 struct cgroup *dst_cgrp,···22782240 * @threadgroup: whether @leader points to the whole process or a single task22792241 *22802242 * Migrate a process or task denoted by @leader to @cgrp. If migrating a22812281- * process, the caller must be holding cgroup_threadgroup_rwsem. The22432243+ * process, the caller must be holding threadgroup_lock of @leader. The22822244 * caller is also responsible for invoking cgroup_migrate_add_src() and22832245 * cgroup_migrate_prepare_dst() on the targets before invoking this22842246 * function and following up with cgroup_migrate_finish().···24062368 * @leader: the task or the leader of the threadgroup to be attached24072369 * @threadgroup: attach the whole threadgroup?24082370 *24092409- * Call holding cgroup_mutex and cgroup_threadgroup_rwsem.23712371+ * Call holding cgroup_mutex and threadgroup_lock of @leader.24102372 */24112373static int cgroup_attach_task(struct cgroup *dst_cgrp,24122374 struct task_struct *leader, bool threadgroup)···24982460 if (!cgrp)24992461 return -ENODEV;2500246225012501- percpu_down_write(&cgroup_threadgroup_rwsem);24632463+retry_find_task:25022464 rcu_read_lock();25032465 if (pid) {25042466 tsk = find_task_by_vpid(pid);25052467 if (!tsk) {24682468+ rcu_read_unlock();25062469 ret = -ESRCH;25072507- goto out_unlock_rcu;24702470+ goto out_unlock_cgroup;25082471 }25092472 } else {25102473 tsk = current;···25212482 */25222483 if (tsk == kthreadd_task || (tsk->flags & PF_NO_SETAFFINITY)) {25232484 ret = -EINVAL;25242524- goto out_unlock_rcu;24852485+ rcu_read_unlock();24862486+ goto out_unlock_cgroup;25252487 }2526248825272489 get_task_struct(tsk);25282490 rcu_read_unlock();2529249124922492+ threadgroup_lock(tsk);24932493+ if (threadgroup) {24942494+ if (!thread_group_leader(tsk)) {24952495+ /*24962496+ * a race with de_thread from another thread's exec()24972497+ * may strip us of our leadership, if this happens,24982498+ * there is no choice but to throw this task away and24992499+ * try again; this is25002500+ * "double-double-toil-and-trouble-check locking".25012501+ */25022502+ threadgroup_unlock(tsk);25032503+ put_task_struct(tsk);25042504+ goto retry_find_task;25052505+ }25062506+ }25072507+25302508 ret = cgroup_procs_write_permission(tsk, cgrp, of);25312509 if (!ret)25322510 ret = cgroup_attach_task(cgrp, tsk, threadgroup);2533251125342534- put_task_struct(tsk);25352535- goto out_unlock_threadgroup;25122512+ threadgroup_unlock(tsk);2536251325372537-out_unlock_rcu:25382538- rcu_read_unlock();25392539-out_unlock_threadgroup:25402540- percpu_up_write(&cgroup_threadgroup_rwsem);25142514+ put_task_struct(tsk);25152515+out_unlock_cgroup:25412516 cgroup_kn_unlock(of->kn);25422517 return ret ?: nbytes;25432518}···2696264326972644 lockdep_assert_held(&cgroup_mutex);2698264526992699- percpu_down_write(&cgroup_threadgroup_rwsem);27002700-27012646 /* look up all csses currently attached to @cgrp's subtree */27022647 down_read(&css_set_rwsem);27032648 css_for_each_descendant_pre(css, cgroup_css(cgrp, NULL)) {···27512700 goto out_finish;27522701 last_task = task;2753270227032703+ threadgroup_lock(task);27042704+ /* raced against de_thread() from another thread? */27052705+ if (!thread_group_leader(task)) {27062706+ threadgroup_unlock(task);27072707+ put_task_struct(task);27082708+ continue;27092709+ }27102710+27542711 ret = cgroup_migrate(src_cset->dfl_cgrp, task, true);2755271227132713+ threadgroup_unlock(task);27562714 put_task_struct(task);2757271527582716 if (WARN(ret, "cgroup: failed to update controllers for the default hierarchy (%d), further operations may crash or hang\n", ret))···2771271127722712out_finish:27732713 cgroup_migrate_finish(&preloaded_csets);27742774- percpu_up_write(&cgroup_threadgroup_rwsem);27752714 return ret;27762715}27772716···50835024 unsigned long key;50845025 int ssid, err;5085502650865086- BUG_ON(percpu_init_rwsem(&cgroup_threadgroup_rwsem));50875027 BUG_ON(cgroup_init_cftypes(NULL, cgroup_dfl_base_files));50885028 BUG_ON(cgroup_init_cftypes(NULL, cgroup_legacy_base_files));50895029
···83838484 if (!desc)8585 return -EINVAL;8686- desc->irq_data.handler_data = data;8686+ desc->irq_common_data.handler_data = data;8787 irq_put_desc_unlock(desc, flags);8888 return 0;8989}···105105106106 if (!desc)107107 return -EINVAL;108108- desc->irq_data.msi_desc = entry;108108+ desc->irq_common_data.msi_desc = entry;109109 if (entry && !irq_offset)110110 entry->irq = irq_base;111111 irq_put_desc_unlock(desc, flags);···372372373373/**374374 * handle_simple_irq - Simple and software-decoded IRQs.375375- * @irq: the interrupt number376375 * @desc: the interrupt description structure for this irq377376 *378377 * Simple interrupts are either sent from a demultiplexing interrupt···381382 * Note: The caller is expected to handle the ack, clear, mask and382383 * unmask issues if necessary.383384 */384384-void385385-handle_simple_irq(unsigned int irq, struct irq_desc *desc)385385+void handle_simple_irq(struct irq_desc *desc)386386{387387 raw_spin_lock(&desc->lock);388388···423425424426/**425427 * handle_level_irq - Level type irq handler426426- * @irq: the interrupt number427428 * @desc: the interrupt description structure for this irq428429 *429430 * Level type interrupts are active as long as the hardware line has···430433 * it after the associated handler has acknowledged the device, so the431434 * interrupt line is back to inactive.432435 */433433-void434434-handle_level_irq(unsigned int irq, struct irq_desc *desc)436436+void handle_level_irq(struct irq_desc *desc)435437{436438 raw_spin_lock(&desc->lock);437439 mask_ack_irq(desc);···492496493497/**494498 * handle_fasteoi_irq - irq handler for transparent controllers495495- * @irq: the interrupt number496499 * @desc: the interrupt description structure for this irq497500 *498501 * Only a single callback will be issued to the chip: an ->eoi()···499504 * for modern forms of interrupt handlers, which handle the flow500505 * details in hardware, transparently.501506 */502502-void503503-handle_fasteoi_irq(unsigned int irq, struct irq_desc *desc)507507+void handle_fasteoi_irq(struct irq_desc *desc)504508{505509 struct irq_chip *chip = desc->irq_data.chip;506510···540546541547/**542548 * handle_edge_irq - edge type IRQ handler543543- * @irq: the interrupt number544549 * @desc: the interrupt description structure for this irq545550 *546551 * Interrupt occures on the falling and/or rising edge of a hardware···553560 * the handler was running. If all pending interrupts are handled, the554561 * loop is left.555562 */556556-void557557-handle_edge_irq(unsigned int irq, struct irq_desc *desc)563563+void handle_edge_irq(struct irq_desc *desc)558564{559565 raw_spin_lock(&desc->lock);560566···610618#ifdef CONFIG_IRQ_EDGE_EOI_HANDLER611619/**612620 * handle_edge_eoi_irq - edge eoi type IRQ handler613613- * @irq: the interrupt number614621 * @desc: the interrupt description structure for this irq615622 *616623 * Similar as the above handle_edge_irq, but using eoi and w/o the617624 * mask/unmask logic.618625 */619619-void handle_edge_eoi_irq(unsigned int irq, struct irq_desc *desc)626626+void handle_edge_eoi_irq(struct irq_desc *desc)620627{621628 struct irq_chip *chip = irq_desc_get_chip(desc);622629···656665657666/**658667 * handle_percpu_irq - Per CPU local irq handler659659- * @irq: the interrupt number660668 * @desc: the interrupt description structure for this irq661669 *662670 * Per CPU interrupts on SMP machines without locking requirements663671 */664664-void665665-handle_percpu_irq(unsigned int irq, struct irq_desc *desc)672672+void handle_percpu_irq(struct irq_desc *desc)666673{667674 struct irq_chip *chip = irq_desc_get_chip(desc);668675···677688678689/**679690 * handle_percpu_devid_irq - Per CPU local irq handler with per cpu dev ids680680- * @irq: the interrupt number681691 * @desc: the interrupt description structure for this irq682692 *683693 * Per CPU interrupts on SMP machines without locking requirements. Same as···686698 * contain the real device id for the cpu on which this handler is687699 * called688700 */689689-void handle_percpu_devid_irq(unsigned int irq, struct irq_desc *desc)701701+void handle_percpu_devid_irq(struct irq_desc *desc)690702{691703 struct irq_chip *chip = irq_desc_get_chip(desc);692704 struct irqaction *action = desc->action;693705 void *dev_id = raw_cpu_ptr(action->percpu_dev_id);706706+ unsigned int irq = irq_desc_get_irq(desc);694707 irqreturn_t res;695708696709 kstat_incr_irqs_this_cpu(desc);···785796 return;786797787798 __irq_do_set_handler(desc, handle, 1, NULL);788788- desc->irq_data.handler_data = data;799799+ desc->irq_common_data.handler_data = data;789800790801 irq_put_desc_busunlock(desc, flags);791802}
+3-1
kernel/irq/handle.c
···2727 *2828 * Handles spurious and unhandled IRQ's. It also prints a debugmessage.2929 */3030-void handle_bad_irq(unsigned int irq, struct irq_desc *desc)3030+void handle_bad_irq(struct irq_desc *desc)3131{3232+ unsigned int irq = irq_desc_get_irq(desc);3333+3234 print_irq_desc(irq, desc);3335 kstat_incr_irqs_this_cpu(desc);3436 ack_bad_irq(irq);
···192192 switch (ret) {193193 case IRQ_SET_MASK_OK:194194 case IRQ_SET_MASK_OK_DONE:195195- cpumask_copy(data->affinity, mask);195195+ cpumask_copy(desc->irq_common_data.affinity, mask);196196 case IRQ_SET_MASK_OK_NOCOPY:197197 irq_set_thread_affinity(desc);198198 ret = 0;···304304 if (irq_move_pending(&desc->irq_data))305305 irq_get_pending(cpumask, desc);306306 else307307- cpumask_copy(cpumask, desc->irq_data.affinity);307307+ cpumask_copy(cpumask, desc->irq_common_data.affinity);308308 raw_spin_unlock_irqrestore(&desc->lock, flags);309309310310 notify->notify(notify, cpumask);···375375 * one of the targets is online.376376 */377377 if (irqd_has_set(&desc->irq_data, IRQD_AFFINITY_SET)) {378378- if (cpumask_intersects(desc->irq_data.affinity,378378+ if (cpumask_intersects(desc->irq_common_data.affinity,379379 cpu_online_mask))380380- set = desc->irq_data.affinity;380380+ set = desc->irq_common_data.affinity;381381 else382382 irqd_clear(&desc->irq_data, IRQD_AFFINITY_SET);383383 }···829829 * This code is triggered unconditionally. Check the affinity830830 * mask pointer. For CPU_MASK_OFFSTACK=n this is optimized out.831831 */832832- if (desc->irq_data.affinity)833833- cpumask_copy(mask, desc->irq_data.affinity);832832+ if (desc->irq_common_data.affinity)833833+ cpumask_copy(mask, desc->irq_common_data.affinity);834834 else835835 valid = false;836836 raw_spin_unlock_irq(&desc->lock);
···2669266926702670/*26712671 * Check if only the current task is running on the cpu.26722672+ *26732673+ * Caution: this function does not check that the caller has disabled26742674+ * preemption, thus the result might have a time-of-check-to-time-of-use26752675+ * race. The caller is responsible to use it correctly, for example:26762676+ *26772677+ * - from a non-preemptable section (of course)26782678+ *26792679+ * - from a thread that is bound to a single CPU26802680+ *26812681+ * - in a loop with very short iterations (e.g. a polling loop)26722682 */26732683bool single_task_running(void)26742684{26752675- if (cpu_rq(smp_processor_id())->nr_running == 1)26762676- return true;26772677- else26782678- return false;26852685+ return raw_rq()->nr_running == 1;26792686}26802687EXPORT_SYMBOL(single_task_running);26812688
···11#!/bin/bash22TCID="zram.sh"3344-check_prereqs()55-{66- local msg="skip all tests:"77-88- if [ $UID != 0 ]; then99- echo $msg must be run as root >&21010- exit 01111- fi1212-}44+. ./zram_lib.sh135146run_zram () {157echo "--------------------"
+2-1
tools/testing/selftests/zram/zram_lib.sh
···2323check_prereqs()2424{2525 local msg="skip all tests:"2626+ local uid=$(id -u)26272727- if [ $UID != 0 ]; then2828+ if [ $uid -ne 0 ]; then2829 echo $msg must be run as root >&22930 exit 03031 fi
···22222323typedef unsigned long long dma_addr_t;2424typedef size_t __kernel_size_t;2525+typedef unsigned int __wsum;25262627struct page {2728 unsigned long long dummy;···4746 if (__kmalloc_fake)4847 return __kmalloc_fake;4948 return malloc(s);4949+}5050+static inline void *kzalloc(size_t s, gfp_t gfp)5151+{5252+ void *p = kmalloc(s, gfp);5353+5454+ memset(p, 0, s);5555+ return p;5056}51575258static inline void kfree(void *p)
+8
virt/kvm/arm/arch_timer.c
···200200 timer->irq = irq;201201202202 /*203203+ * The bits in CNTV_CTL are architecturally reset to UNKNOWN for ARMv8204204+ * and to 0 for ARMv7. We provide an implementation that always205205+ * resets the timer to be disabled and unmasked and is compliant with206206+ * the ARMv7 architecture.207207+ */208208+ timer->cntv_ctl = 0;209209+210210+ /*203211 * Tell the VGIC that the virtual interrupt is tied to a204212 * physical interrupt. We do that once per VCPU.205213 */
···11441144 struct irq_phys_map *map;11451145 map = vgic_irq_map_search(vcpu, irq);1146114611471147- /*11481148- * If we have a mapping, and the virtual interrupt is11491149- * being injected, then we must set the state to11501150- * active in the physical world. Otherwise the11511151- * physical interrupt will fire and the guest will11521152- * exit before processing the virtual interrupt.11531153- */11541147 if (map) {11551155- int ret;11561156-11571157- BUG_ON(!map->active);11581148 vlr.hwirq = map->phys_irq;11591149 vlr.state |= LR_HW;11601150 vlr.state &= ~LR_EOI_INT;11611161-11621162- ret = irq_set_irqchip_state(map->irq,11631163- IRQCHIP_STATE_ACTIVE,11641164- true);11651165- WARN_ON(ret);1166115111671152 /*11681153 * Make sure we're not going to sample this···12401255 struct vgic_cpu *vgic_cpu = &vcpu->arch.vgic_cpu;12411256 struct vgic_dist *dist = &vcpu->kvm->arch.vgic;12421257 unsigned long *pa_percpu, *pa_shared;12431243- int i, vcpu_id;12581258+ int i, vcpu_id, lr, ret;12441259 int overflow = 0;12451260 int nr_shared = vgic_nr_shared_irqs(dist);12461261···12941309 * adjust that if needed while exiting.12951310 */12961311 clear_bit(vcpu_id, dist->irq_pending_on_cpu);13121312+ }13131313+13141314+ for (lr = 0; lr < vgic->nr_lr; lr++) {13151315+ struct vgic_lr vlr;13161316+13171317+ if (!test_bit(lr, vgic_cpu->lr_used))13181318+ continue;13191319+13201320+ vlr = vgic_get_lr(vcpu, lr);13211321+13221322+ /*13231323+ * If we have a mapping, and the virtual interrupt is13241324+ * presented to the guest (as pending or active), then we must13251325+ * set the state to active in the physical world. See13261326+ * Documentation/virtual/kvm/arm/vgic-mapped-irqs.txt.13271327+ */13281328+ if (vlr.state & LR_HW) {13291329+ struct irq_phys_map *map;13301330+ map = vgic_irq_map_search(vcpu, vlr.irq);13311331+13321332+ ret = irq_set_irqchip_state(map->irq,13331333+ IRQCHIP_STATE_ACTIVE,13341334+ true);13351335+ WARN_ON(ret);13361336+ }12971337 }12981338}12991339
···771771 return KVM_MMIO_BUS;772772}773773774774-static int775775-kvm_assign_ioeventfd(struct kvm *kvm, struct kvm_ioeventfd *args)774774+static int kvm_assign_ioeventfd_idx(struct kvm *kvm,775775+ enum kvm_bus bus_idx,776776+ struct kvm_ioeventfd *args)776777{777777- enum kvm_bus bus_idx;778778- struct _ioeventfd *p;779779- struct eventfd_ctx *eventfd;780780- int ret;781778782782- bus_idx = ioeventfd_bus_from_flags(args->flags);783783- /* must be natural-word sized, or 0 to ignore length */784784- switch (args->len) {785785- case 0:786786- case 1:787787- case 2:788788- case 4:789789- case 8:790790- break;791791- default:792792- return -EINVAL;793793- }794794-795795- /* check for range overflow */796796- if (args->addr + args->len < args->addr)797797- return -EINVAL;798798-799799- /* check for extra flags that we don't understand */800800- if (args->flags & ~KVM_IOEVENTFD_VALID_FLAG_MASK)801801- return -EINVAL;802802-803803- /* ioeventfd with no length can't be combined with DATAMATCH */804804- if (!args->len &&805805- args->flags & (KVM_IOEVENTFD_FLAG_PIO |806806- KVM_IOEVENTFD_FLAG_DATAMATCH))807807- return -EINVAL;779779+ struct eventfd_ctx *eventfd;780780+ struct _ioeventfd *p;781781+ int ret;808782809783 eventfd = eventfd_ctx_fdget(args->fd);810784 if (IS_ERR(eventfd))···817843 if (ret < 0)818844 goto unlock_fail;819845820820- /* When length is ignored, MMIO is also put on a separate bus, for821821- * faster lookups.822822- */823823- if (!args->len && !(args->flags & KVM_IOEVENTFD_FLAG_PIO)) {824824- ret = kvm_io_bus_register_dev(kvm, KVM_FAST_MMIO_BUS,825825- p->addr, 0, &p->dev);826826- if (ret < 0)827827- goto register_fail;828828- }829829-830846 kvm->buses[bus_idx]->ioeventfd_count++;831847 list_add_tail(&p->list, &kvm->ioeventfds);832848···824860825861 return 0;826862827827-register_fail:828828- kvm_io_bus_unregister_dev(kvm, bus_idx, &p->dev);829863unlock_fail:830864 mutex_unlock(&kvm->slots_lock);831865···835873}836874837875static int838838-kvm_deassign_ioeventfd(struct kvm *kvm, struct kvm_ioeventfd *args)876876+kvm_deassign_ioeventfd_idx(struct kvm *kvm, enum kvm_bus bus_idx,877877+ struct kvm_ioeventfd *args)839878{840840- enum kvm_bus bus_idx;841879 struct _ioeventfd *p, *tmp;842880 struct eventfd_ctx *eventfd;843881 int ret = -ENOENT;844882845845- bus_idx = ioeventfd_bus_from_flags(args->flags);846883 eventfd = eventfd_ctx_fdget(args->fd);847884 if (IS_ERR(eventfd))848885 return PTR_ERR(eventfd);···862901 continue;863902864903 kvm_io_bus_unregister_dev(kvm, bus_idx, &p->dev);865865- if (!p->length) {866866- kvm_io_bus_unregister_dev(kvm, KVM_FAST_MMIO_BUS,867867- &p->dev);868868- }869904 kvm->buses[bus_idx]->ioeventfd_count--;870905 ioeventfd_release(p);871906 ret = 0;···872915873916 eventfd_ctx_put(eventfd);874917918918+ return ret;919919+}920920+921921+static int kvm_deassign_ioeventfd(struct kvm *kvm, struct kvm_ioeventfd *args)922922+{923923+ enum kvm_bus bus_idx = ioeventfd_bus_from_flags(args->flags);924924+ int ret = kvm_deassign_ioeventfd_idx(kvm, bus_idx, args);925925+926926+ if (!args->len && bus_idx == KVM_MMIO_BUS)927927+ kvm_deassign_ioeventfd_idx(kvm, KVM_FAST_MMIO_BUS, args);928928+929929+ return ret;930930+}931931+932932+static int933933+kvm_assign_ioeventfd(struct kvm *kvm, struct kvm_ioeventfd *args)934934+{935935+ enum kvm_bus bus_idx;936936+ int ret;937937+938938+ bus_idx = ioeventfd_bus_from_flags(args->flags);939939+ /* must be natural-word sized, or 0 to ignore length */940940+ switch (args->len) {941941+ case 0:942942+ case 1:943943+ case 2:944944+ case 4:945945+ case 8:946946+ break;947947+ default:948948+ return -EINVAL;949949+ }950950+951951+ /* check for range overflow */952952+ if (args->addr + args->len < args->addr)953953+ return -EINVAL;954954+955955+ /* check for extra flags that we don't understand */956956+ if (args->flags & ~KVM_IOEVENTFD_VALID_FLAG_MASK)957957+ return -EINVAL;958958+959959+ /* ioeventfd with no length can't be combined with DATAMATCH */960960+ if (!args->len &&961961+ args->flags & (KVM_IOEVENTFD_FLAG_PIO |962962+ KVM_IOEVENTFD_FLAG_DATAMATCH))963963+ return -EINVAL;964964+965965+ ret = kvm_assign_ioeventfd_idx(kvm, bus_idx, args);966966+ if (ret)967967+ goto fail;968968+969969+ /* When length is ignored, MMIO is also put on a separate bus, for970970+ * faster lookups.971971+ */972972+ if (!args->len && bus_idx == KVM_MMIO_BUS) {973973+ ret = kvm_assign_ioeventfd_idx(kvm, KVM_FAST_MMIO_BUS, args);974974+ if (ret < 0)975975+ goto fast_fail;976976+ }977977+978978+ return 0;979979+980980+fast_fail:981981+ kvm_deassign_ioeventfd_idx(kvm, bus_idx, args);982982+fail:875983 return ret;876984}877985
+20-3
virt/kvm/kvm_main.c
···20042004 if (vcpu->halt_poll_ns) {20052005 ktime_t stop = ktime_add_ns(ktime_get(), vcpu->halt_poll_ns);2006200620072007+ ++vcpu->stat.halt_attempted_poll;20072008 do {20082009 /*20092010 * This sets KVM_REQ_UNHALT if an interrupt···20442043 else if (vcpu->halt_poll_ns < halt_poll_ns &&20452044 block_ns < halt_poll_ns)20462045 grow_halt_poll_ns(vcpu);20472047- }20462046+ } else20472047+ vcpu->halt_poll_ns = 0;2048204820492049 trace_kvm_vcpu_wakeup(block_ns, waited);20502050}···31583156static inline int kvm_io_bus_cmp(const struct kvm_io_range *r1,31593157 const struct kvm_io_range *r2)31603158{31613161- if (r1->addr < r2->addr)31593159+ gpa_t addr1 = r1->addr;31603160+ gpa_t addr2 = r2->addr;31613161+31623162+ if (addr1 < addr2)31623163 return -1;31633163- if (r1->addr + r1->len > r2->addr + r2->len)31643164+31653165+ /* If r2->len == 0, match the exact address. If r2->len != 0,31663166+ * accept any overlapping write. Any order is acceptable for31673167+ * overlapping ranges, because kvm_io_bus_get_first_dev ensures31683168+ * we process all of them.31693169+ */31703170+ if (r2->len) {31713171+ addr1 += r1->len;31723172+ addr2 += r2->len;31733173+ }31743174+31753175+ if (addr1 > addr2)31643176 return 1;31773177+31653178 return 0;31663179}31673180